<!--
//************ Start Default Commands ************
var graphic = "";   
var isNS4 = 0; var isIE4 = 0; var isNS6 = 0; var isNew = 0;
var docObj, styleObj, currObj, cstyleObj;
var bVer = (parseInt(navigator.appVersion));
var bName = navigator.appName;
var brow = ((navigator.appName) + (parseInt(navigator.appVersion)));
if (bName == "Netscape" && bVer >= 3) version = "js";
else if (bName == "Microsoft Internet Explorer" && bVer >= 4) version = "js";
else if (bName == "Netscape" && bVer == 2) version = "no";
else if (bName == "Microsoft Internet Explorer" && bVer >= 2) version = "no";
if (parseInt(navigator.appVersion >= 5)){isNew = 1}
else if (brow == "Netscape4") {isNS4 = 1;}
else if (brow == "Netscape5") {isNS6 = 1;}
else if (brow == "Microsoft Internet Explorer4") {isIE4 = 1;}
				
if (isNS4||isNS6||isIE4||isNew) {
  if(isNS4){ docObj = "document."; }
  else if(isNS6){ docObj = "document.getElementById('"; }
  else { docObj = "document.all."; }
  if(isNS4){ styleObj = ""; }
  else if(isNS6){ styleObj = "').style"; }
  else { styleObj = ".style"; }
  
  if(isNS4){ cstyleObj = ""; }
  else if(isNS6){ cstyleObj = "').currentStyle"; }
  else { cstyleObj = ".currentStyle"; }
}
function getQuery(val){
  var querystring = location.search.substring(1,location.search.length);
  var o = "";
  var tSec = querystring.indexOf(val+"=");
  var tStr = querystring.substring( (tSec+(val.length+1)),querystring.length);
  
  if(tSec != -1){
    if(tStr.indexOf('&') != -1){
      o = tStr.substring(0,tStr.indexOf('&'));
    } else {
      o = tStr;
    }
  }
  return o;
}
function replaceSubstring(s,f,w){
  rtn = "";
  flg = 0;
  
  for(i = 0; i < s.length; i++){
    if(s.substr(i,f.length) == f){
      rtn += w;
      i += (f.length - 1);
    } else {
      rtn += s.charAt(i);
    }
  }
  
  return (rtn);
}
function urlencode(str) {
  str = escape(str);
  str = str.replace('+', '%2B');
  str = str.replace('%20', '+');
  str = str.replace('*', '%2A');
  str = str.replace('/', '%2F');
  str = str.replace('@', '%40');
  return str;
}
function testAlpha(f,t,d){
  if(d == ""){ d = 0; }
  var doc = document.forms[d];
  var ele = doc.elements[f];
  var str = false;
  if(ele.value == ""){
    alert("Please enter a " + t);
  } else {
    if(/[^0-9]/i.test(ele.value)){
      alert("Sorry, your " + t + " is not formatted correctly");
    } else {
      str = true;
    }
  }
  return str;
}
function openPopup(URL,id,width,height){
  window.open(URL, id, "toolbar=no,location=no,width="+width+",height="+height+",status=yes,scrollbars=yes,scrolling=yes,menubar=no,resizable=yes");
}
function openPopupLocked(URL,id,width,height){
  window.open(URL, id, "toolbar=no,location=no,width="+width+",height="+height+",status=yes,scrollbars=yes,scrolling=yes,menubar=no,resizable=no");
}
function goPage(u){
  location.href = u;
}
function displayChange(l,v) {
  if (isNS4||isNS6||isIE4||isNew) { eval(docObj + l + styleObj + '.display = "' + v + '"') }
}
function setFocus(f,d){
  document.forms[d].elements[f].focus();
}
function updateFieldText(f,t,s,d){
  if(d == ""){ d = 0; }
  var doc = document.forms[d];
  var ele = doc.elements[f].value;
  if(s == "c"){
    if(ele == t){ doc.elements[f].value = ""; }
  } else if(s == "a"){
    if(ele == ""){ doc.elements[f].value = t; }
  }
}
//************ End Default Commands ************
function quickSearch(f,t,d){
  var doc = document.forms[d];
  var query = doc.elements[f].value;

  if(query == "" || query == t){
    alert("Please enter a search term.");
    setFocus(f,d);
    return false;
  } else {
    location.href = "/search?searchview&query=" + query
  }
}
function keydownSearch(){
  var doc = document.forms[0];
  var q = doc.Query.value;
  if( navigator.appName.indexOf('Microsoft') > -1 ){
    var k = window.event.keyCode
    if(k == 13) {
      window.event.returnValue = false;
      window.event.cancelBubble = true;
      quickSearch('Query','Search',0);
    }
  }
}
function setFocus(f,d){
  document.forms[d].elements[f].focus();
}
function testEmail(f,d){
  var a = document.forms[d].elements[f].value;
  var at = a.indexOf("@")
  var name = a.substring(0, at)
  var isp = a.substring(at + 1, a.length)
  var dot = a.lastIndexOf(".")
  if (at == -1 || at == 0 || name == "" || isp == "" || dot == -1 || dot == (a.length - 1)) {
    alert('You must enter a valid email address');
    setFocus(f,d);
  } else {
    return true;
  }
}
function testText(f,t,d){
  if(document.forms[d].elements[f].value != ""){
    return true;
  } else {
    alert('You must enter ' + t);
    setFocus(f,d);
  }
}
function submitContactUs(){
  var d = 0;
  var doc = document.forms[d];
  if( testText('Name','your name',d) && testText('CompanyName','your company name',d) && testText('TelephoneNumber','telephone number',d) && testEmail('EmailAddress',d) ){
    if(doc.CaptchaText.value == ""){
  	alert("You must enter the text contained within the image in the field 'Enter the text on the image above'");
      setFocus('CaptchaText',d);
    } else {
      doc.submit();
    }
  }
}
function submitEHS(){
  var d = 0;
  var doc = document.forms[d];
  var isChecked = doc.AuthMXChange.checked;

  if( testText('Name','your administrator\'s name',d) && testText('JobTitle','your job title',d) && testText('CompanyName','your company name',d) && testAlpha('TelephoneNumber','telephone number',d) && testEmail('EmailAddress',d) && testText('EmailDomains','the email domains',d) && testText('NoOfSeats','the number of users',d) && testText('PeopleEmailList','the email addresses of the users',d) ){
    if (isChecked==false) {
		alert("You must click the checkbox to confirm that you agree to make necessary changes to your MX records.");
    } else if(doc.CaptchaText.value == ""){
		alert("You must enter the text contained within the image in the field 'Enter the text on the image above'");
	      setFocus('CaptchaText',d);
    }else{
      	doc.submit();
    }

  }
}
function ImageExplanation(){
  var reason = document.forms[0].CaptchaExplanation.value;
  alert(reason);
}
function redirectPage(){
  var redirecturl = document.forms[0].RedirectTo.value;
  if(redirecturl != ""){
    location.href = redirecturl;
  }
}
//************ START sifr/sifr Commands ************
var fsalbert = { src: '/802573F300423EF7/fsalbert.swf' };
sIFR.activate(fsalbert);
sIFR.replace(fsalbert, {
  selector: 'div#header h2'
  ,css: [
    '.sIFR-root { text-align: right; font-weight: normal; font-size: 18px; color: #28289F; }'
    ,'strong { font-weight: normal; color: #000066; }'
  ]
  ,transparent: true
});
function initswfir(){

}
//************ END sifr/swfir Commands ************
//-->
