<!--

function doContactPopUp()
{
  var p = 'scrollbars=yes,resizable=yes,toolbar=no,'
        + 'menubar=no,status=yes,location=no,left=125,top=0,height=620,'
	+ 'width=470';

  win2=window.open("/contact.php","ct",p);
  window.blur();
  win2.focus();
} // doContactPopUp


function valContactForm(tForm)
{
  if (tForm.FName.value == "")
  {
    alert("Please enter a first name.");
    tForm.FName.focus();
    return (false);
  }

  if (! emailCheck(tForm.Email.value))
  {
    tForm.Email.focus();
    return (false);
  }
  else return (true);
} //valContactForm

function valSStratForm(tForm)
{
  if (tForm.Name.value == "")
  {
    alert("Please enter a name.");
    tForm.Name.focus();
    return (false);
  }

  if (! emailCheck(tForm.Email.value))
  {
    tForm.Email.focus();
    return (false);
  }
  else return (true);
} //valSStratForm

function valUnivGovForm(tForm)
{
  if (tForm.FName.value == "")
  {
    alert("Please enter a first name.");
    tForm.FName.focus();
    return (false);
  }

  if (tForm.LName.value == "")
  {
    alert("Please enter a last name.");
    tForm.LName.focus();
    return (false);
  }

  if (! emailCheck(tForm.Email.value))
  {
    tForm.Email.focus();
    return (false);
  }

  if (tForm.Organization.value == "")
  {
    alert("Please enter your organization's name.");
    tForm.Organization.focus();
    return (false);
  }

  if (tForm.Phone.value == "")
  {
    alert("Please enter your phone number.");
    tForm.Phone.focus();
    return (false);
  }

  if (tForm.NumUnits.value == "")
  {
    alert("Please enter the number of laptops to protect, estimated if necessary.");
    tForm.NumUnits.focus();
    return (false);
  }

  if (tForm.DecisionTimeFrame.value == "NONE")
  {
    alert("Please enter a decision time frame.");
    tForm.DecisionTimeFrame.focus();
    return (false);
  }

  return (true);
} //valUnivGovForm

function valLibraryForm(tForm)
{
  if (tForm.FName.value == "")
  {
    alert("Please enter a first name.");
    tForm.FName.focus();
    return (false);
  }

  if (tForm.LName.value == "")
  {
    alert("Please enter a last name.");
    tForm.LName.focus();
    return (false);
  }

  if (! emailCheck(tForm.Email.value))
  {
    tForm.Email.focus();
    return (false);
  }

  if (tForm.Organization.value == "")
  {
    alert("Please enter your organization's name.");
    tForm.Organization.focus();
    return (false);
  }

  if (tForm.Phone.value == "")
  {
    alert("Please enter your phone number.");
    tForm.Phone.focus();
    return (false);
  }

  if (tForm.NumUnits.value == "")
  {
    alert("Please enter the number of laptops to protect, estimated if necessary.");
    tForm.NumUnits.focus();
    return (false);
  }

  if (tForm.DecisionTimeFrame.value == "NONE")
  {
    alert("Please enter a decision time frame.");
    tForm.DecisionTimeFrame.focus();
    return (false);
  }

  if (   (tForm.MLWhitePaper.checked == false)
      && (tForm.OSUCaseStudy.checked == false)
      && (tForm.MLDataSheet.checked == false)
     )
  {
    alert("Please select at least one document to download.");
    return (false);
  }

  return (true);
} //valLibraryForm

function valCompTIABenefitsForm(tForm)
{
  if (tForm.FName.value == "")
  {
    alert("Please enter a first name.");
    tForm.FName.focus();
    return (false);
  }

  if (tForm.LName.value == "")
  {
    alert("Please enter a last name.");
    tForm.LName.focus();
    return (false);
  }

  if (! emailCheck(tForm.Email.value))
  {
    tForm.Email.focus();
    return (false);
  }

  if (tForm.Organization.value == "")
  {
    alert("Please enter your organization's name.");
    tForm.Organization.focus();
    return (false);
  }

  if (tForm.Phone.value == "")
  {
    alert("Please enter your phone number.");
    tForm.Phone.focus();
    return (false);
  }

  if (tForm.NumUnits.value == "")
  {
    alert("Please enter the number of laptops to protect, estimated if necessary.");
    tForm.NumUnits.focus();
    return (false);
  }

  return (true);
} //valCompTIABenefitsForm


function valDemoForm(tForm)
{
  if (tForm.FName.value == "")
  {
    alert("Please enter a first name.");
    tForm.FName.focus();
    return (false);
  }

  if (tForm.LName.value == "")
  {
    alert("Please enter a last name.");
    tForm.LName.focus();
    return (false);
  }

  if (! emailCheck(tForm.Email.value))
  {
    tForm.Email.focus();
    return (false);
  }

  if (tForm.Organization.value == "")
  {
    alert("Please enter your organization's name.");
    tForm.Organization.focus();
    return (false);
  }

  if (tForm.Phone.value == "")
  {
    alert("Please enter your phone number.");
    tForm.Phone.focus();
    return (false);
  }

  if (tForm.NumUnits.value == "")
  {
    alert("Please enter the number of laptops to protect, estimated if necessary.");
    tForm.NumUnits.focus();
    return (false);
  }

  if (tForm.DecisionTimeFrame.value == "NONE")
  {
    alert("Please enter a decision time frame.");
    tForm.DecisionTimeFrame.focus();
    return (false);
  }

  return (true);
} //valDemoForm


function valResellersForm(tForm)
{
  if (tForm.FName.value == "")
  {
    alert("Please enter a first name.");
    tForm.FName.focus();
    return (false);
  }

  if (tForm.LName.value == "")
  {
    alert("Please enter a last name.");
    tForm.LName.focus();
    return (false);
  }

  if (! emailCheck(tForm.Email.value))
  {
    tForm.Email.focus();
    return (false);
  }

  if (tForm.Organization.value == "")
  {
    alert("Please enter your organization's name.");
    tForm.Organization.focus();
    return (false);
  }

  if (tForm.Phone.value == "")
  {
    alert("Please enter your phone number.");
    tForm.Phone.focus();
    return (false);
  }

  if (tForm.NumUnits.value == "")
  {
    alert("Please enter the number of laptops to protect, estimated if necessary.");
    tForm.NumUnits.focus();
    return (false);
  }

  if (tForm.DecisionTimeFrame.value == "NONE")
  {
    alert("Please enter a decision time frame.");
    tForm.DecisionTimeFrame.focus();
    return (false);
  }

  return (true);
} //valResellersForm

function valLSMForm(tForm)
{
  if (tForm.Name.value == "")
  {
    alert("Please enter your name.");
    tForm.Name.focus();
    return (false);
  }

  if (! emailCheck(tForm.Email.value))
  {
    tForm.Email.focus();
    return (false);
  }

  return (true);
} //valLSMForm

function valAffiliateForm(tForm)
{
  if (tForm.FName.value == "")
  {
    alert("Please enter a first name.");
    tForm.FName.focus();
    return (false);
  }

  if (tForm.LName.value == "")
  {
    alert("Please enter a last name.");
    tForm.LName.focus();
    return (false);
  }

  if (! emailCheck(tForm.Email.value))
  {
    tForm.Email.focus();
    return (false);
  }

  if (tForm.Organization.value == "")
  {
    alert("Please enter your organization's name.");
    tForm.Organization.focus();
    return (false);
  }

  if (tForm.Phone.value == "")
  {
    alert("Please enter your phone number.");
    tForm.Phone.focus();
    return (false);
  }

  return (true);
} //valAffiliateForm


function doContactAffPopUp()
{
  var p = 'scrollbars=yes,resizable=yes,toolbar=no,'
        + 'menubar=no,status=yes,location=no,left=125,top=0,height=620,'
	+ 'width=470';

  win2=window.open("/contactaff.php","ct",p);
  window.blur();
  win2.focus();
} // doContactPopUp


function  loadRecoverPassword() {
  recoverp=window.open("https://secure.saferegistry.com/pub/recover_password.php", "recoverpassword", "width=500, height=550, left=80, top=80, status=no, menubar=yes, scrollbars=yes, resizable=yes, fullscreen=no, controls=yes");
}


function valRegForm(tForm)
{
  trial = tForm.doTrial.value;

  if (tForm.stage.value == "1")
  {
    if (tForm.firstName.value == "")
    {
      alert("Please enter a first name.");
      tForm.firstName.focus();
      return (false);
    }

    if (tForm.lastName.value == "")
    {
      alert("Please enter a last name.");
      tForm.lastName.focus();
      return (false);
    }

    if (! emailCheck(tForm.email.value))
    {
      tForm.email.focus();
      return (false);
    }

    if (tForm.emailConf.value != tForm.email.value)
    {
      alert("The email re-type doesn't match. Please correct.");
      tForm.emailConf.focus();
      return (false);
    }

    return (true);
  } // stage == 1

  if (tForm.stage.value == "2")
  {
    if (tForm.street1.value == "")
    {
      alert("Please enter a street value.");
      tForm.street1.focus();
      return (false);
    }

    if (tForm.city.value == "")
    {
      alert("Please enter a city value.");
      tForm.city.focus();
      return (false);
    }

    if ((tForm.state.value == "") || (tForm.state.value == "ZZ"))
    {
      alert("Please enter a state/province value.");
      tForm.state.focus();
      return (false);
    }

    if (tForm.zip.value == "")
    {
      alert("Please enter a zip/postal code value.");
      tForm.zip.focus();
      return (false);
    }

    if (tForm.shipStreet1.value == "")
    {
      alert("Please enter a shipping street value. Use the 'copy my billing address' button to instantly copy your billing address.");
      tForm.shipStreet1.focus();
      return (false);
    }

    if (tForm.shipCity.value == "")
    {
      alert("Please enter a shipping city value. Use the 'copy my billing address' button to instantly copy your billing address.");
      tForm.shipCity.focus();
      return (false);
    }

    if ((tForm.shipState.value == "") || (tForm.shipState.value == "ZZ"))
    {
      alert("Please enter a shipping state/province value. Use the 'copy my billing address' button to instantly copy your billing address.");
      tForm.shipState.focus();
      return (false);
    }

    if (tForm.shipZip.value == "")
    {
      alert("Please enter a shipping zip/postal code value. Use the 'copy my billing address' button to instantly copy your billing address.");
      tForm.shipZip.focus();
      return (false);
    }

    return (true);
  } // stage == 2

} // valRegForm

function valSMBRegForm(tForm)
{
  if (tForm.firstName.value == "")
  {
    alert("Please enter a first name.");
    tForm.firstName.focus();
    return (false);
  }

  if (tForm.lastName.value == "")
  {
    alert("Please enter a last name.");
    tForm.lastName.focus();
    return (false);
  }

  if (tForm.company.value == "")
  {
    alert("Please enter your company name.");
    tForm.company.focus();
    return (false);
  }

  if (! emailCheck(tForm.email.value))
  {
    tForm.email.focus();
    return (false);
  }

  if (tForm.emailConf.value != tForm.email.value)
  {
    alert("The email re-type doesn't match. Please correct.");
    tForm.emailConf.focus();
    return (false);
  }

  if (tForm.workPhone.value == "")
  {
    alert("Please enter a reliable phone number.");
    tForm.workPhone.focus();
    return (false);
  }

  if (tForm.fax.value == "")
  {
    alert("Please enter a fax number. If you do not have a fax, please enter NA as your fax number");
    tForm.fax.focus();
    return (false);
  }

  if (tForm.shipStreet1.value == "")
  {
    alert("Please enter a street value.");
    tForm.shipStreet1.focus();
    return (false);
  }

  if (tForm.shipCity.value == "")
  {
    alert("Please enter a city value.");
    tForm.shipCity.focus();
    return (false);
  }

  if ((tForm.shipState.value == "") || (tForm.shipState.value == "ZZ"))
  {
    alert("Please enter a state value.");
    tForm.shipState.focus();
    return (false);
  }

  if (tForm.shipZip.value == "")
  {
    alert("Please enter a zip code value.");
    tForm.shipZip.focus();
    return (false);
  }

  return (true);
} // valSMBRegForm

function isInteger(n)
{
  return ((!isNaN(n)) && (Math.floor(n)==n));
} // function isInteger

function valOneStepRegForm(tForm)
{

    if (tForm.firstName.value == "")
    {
      alert("Please enter a first name.");
      tForm.firstName.focus();
      return (false);
    }

    if (tForm.lastName.value == "")
    {
      alert("Please enter a last name.");
      tForm.lastName.focus();
      return (false);
    }
    if (tForm.company.value == "")
    {
      alert("Please enter a company name.");
      tForm.company.focus();
      return (false);
    }

    if (! emailCheck(tForm.email.value))
    {
      tForm.email.focus();
      return (false);
    }

    if (tForm.emailConf.value != tForm.email.value)
    {
      alert("The email re-type doesn't match. Please correct.");
      tForm.emailConf.focus();
      return (false);
    }

    if (tForm.workPhone.value == "")
    {
      alert("Please enter a work phone.");
      tForm.workPhone.focus();
      return (false);
    }

    if (tForm.street1.value == "")
    {
      alert("Please enter a street value.");
      tForm.street1.focus();
      return (false);
    }

    if (tForm.city.value == "")
    {
      alert("Please enter a city value.");
      tForm.city.focus();
      return (false);
    }

    if ((tForm.state.value == "") || (tForm.state.value == "ZZ"))
    {
      alert("Please enter a state/province value.");
      tForm.state.focus();
      return (false);
    }

    if (tForm.zip.value == "")
    {
      alert("Please enter a zip/postal code value.");
      tForm.zip.focus();
      return (false);
    }

    if (tForm.shipStreet1.value == "")
    {
      alert("Please enter a shipping street value. Use the 'copy my billing address' button to instantly copy your billing address.");
      tForm.shipStreet1.focus();
      return (false);
    }

    if (tForm.shipCity.value == "")
    {
      alert("Please enter a shipping city value. Use the 'copy my billing address' button to instantly copy your billing address.");
      tForm.shipCity.focus();
      return (false);
    }

    if ((tForm.shipState.value == "") || (tForm.shipState.value == "ZZ"))
    {
      alert("Please enter a shipping state/province value. Use the 'copy my billing address' button to instantly copy your billing address.");
      tForm.shipState.focus();
      return (false);
    }

    if (tForm.shipZip.value == "")
    {
      alert("Please enter a shipping zip/postal code value. Use the 'copy my billing address' button to instantly copy your billing address.");
      tForm.shipZip.focus();
      return (false);
    }

    m_strOut = new String(tForm.qty.value); 
    tForm.qty.value = m_strOut.replace(/[^0-9]/g, ''); 

    if (tForm.qty.value == "" || (! isInteger(tForm.qty.value)) || (parseInt(tForm.qty.value) < 0))
    {
      alert("Please enter a valid number of computers to protect.");
      tForm.qty.focus();
      return (false);
    }

    return CheckCardNumber(tForm);

} // valOneStepRegForm

function valCPRegForm(tForm)
{
    if (tForm.sFirstName.value == "")
    {
      alert("Please enter a student first name.");
      tForm.sFirstName.focus();
      return (false);
    }

    if (tForm.sLastName.value == "")
    {
      alert("Please enter a student last name.");
      tForm.sLastName.focus();
      return (false);
    }

    if (! emailCheck(tForm.sEmail.value))
    {
      tForm.sEmail.focus();
      return (false);
    }

    if (tForm.sEmailConf.value != tForm.sEmail.value)
    {
      alert("The student email re-type doesn't match. Please correct.");
      tForm.sEmailConf.focus();
      return (false);
    }

    if (tForm.firstName.value == "")
    {
      alert("Please enter a parent first name.");
      tForm.firstName.focus();
      return (false);
    }

    if (tForm.lastName.value == "")
    {
      alert("Please enter a parent last name.");
      tForm.lastName.focus();
      return (false);
    }

    if (! emailCheck(tForm.email.value))
    {
      tForm.email.focus();
      return (false);
    }

    if (tForm.emailConf.value != tForm.email.value)
    {
      alert("The student email re-type doesn't match. Please correct.");
      tForm.emailConf.focus();
      return (false);
    }

    if (tForm.homePhone.value == "")
    {
      alert("Please enter a parent phone number.");
      tForm.homePhone.focus();
      return (false);
    }

    if (tForm.street1.value == "")
    {
      alert("Please enter a parent street value.");
      tForm.street1.focus();
      return (false);
    }

    if (tForm.city.value == "")
    {
      alert("Please enter a parent city value.");
      tForm.city.focus();
      return (false);
    }

    if ((tForm.state.value == "") || (tForm.state.value == "ZZ"))
    {
      alert("Please enter a parent state/province value.");
      tForm.state.focus();
      return (false);
    }

    if (tForm.zip.value == "")
    {
      alert("Please enter a parent zip/postal code value.");
      tForm.zip.focus();
      return (false);
    }

    return CheckCardNumber(tForm);

} // valOneStepRegForm

function valRenewalRegForm(tForm)
{

    if (! emailCheck(tForm.email.value))
    {
      tForm.email.focus();
      return (false);
    }

    if (tForm.emailConf.value != tForm.email.value)
    {
      alert("The email re-type doesn't match. Please correct.");
      tForm.emailConf.focus();
      return (false);
    }

    return CheckCardNumber(tForm);

} // valOneStepRegForm


function copyBillToShip(inForm)
{
  inForm.shipStreet1.value = inForm.street1.value;
  inForm.shipStreet2.value = inForm.street2.value;
  inForm.shipCity.value = inForm.city.value;
  inForm.shipState.value = inForm.state.value;
  inForm.shipZip.value = inForm.zip.value;
  inForm.shipCountry.value = inForm.country.value;
} //copyBillToShip



<!-- Changes:  Sandeep V. Tamhankar (stamhankar@hotmail.com) -->

/* 1.1.2: Fixed a bug where trailing . in e-mail address was passing
            (the bug is actually in the weak regexp engine of the browser; I
            simplified the regexps to make it work).
   1.1.1: Removed restriction that countries must be preceded by a domain,
            so abc@host.uk is now legal.  However, there's still the 
            restriction that an address must end in a two or three letter
            word.
     1.1: Rewrote most of the function to conform more closely to RFC 822.
     1.0: Original  */

<!-- This script and many more are available free online at -->
<!-- The JavaScript Source!! http://javascript.internet.com -->

<!-- Begin
function emailCheck (emailStr) {
/* The following pattern is used to check if the entered e-mail address
   fits the user@domain format.  It also is used to separate the username
   from the domain. */
var emailPat=/^(.+)@(.+)$/
/* The following string represents the pattern for matching all special
   characters.  We don't want to allow special characters in the address. 
   These characters include ( ) < > @ , ; : \ " . [ ]    */
var specialChars="\\(\\)<>@,;:\\\\\\\"\\.\\[\\]"
/* The following string represents the range of characters allowed in a 
   username or domainname.  It really states which chars aren't allowed. */
var validChars="\[^\\s" + specialChars + "\]"
/* The following pattern applies if the "user" is a quoted string (in
   which case, there are no rules about which characters are allowed
   and which aren't; anything goes).  E.g. "jiminy cricket"@disney.com
   is a legal e-mail address. */
var quotedUser="(\"[^\"]*\")"
/* The following pattern applies for domains that are IP addresses,
   rather than symbolic names.  E.g. joe@[123.124.233.4] is a legal
   e-mail address. NOTE: The square brackets are required. */
var ipDomainPat=/^\[(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})\]$/
/* The following string represents an atom (basically a series of
   non-special characters.) */
var atom=validChars + '+'
/* The following string represents one word in the typical username.
   For example, in john.doe@somewhere.com, john and doe are words.
   Basically, a word is either an atom or quoted string. */
var word="(" + atom + "|" + quotedUser + ")"
// The following pattern describes the structure of the user
var userPat=new RegExp("^" + word + "(\\." + word + ")*$")
/* The following pattern describes the structure of a normal symbolic
   domain, as opposed to ipDomainPat, shown above. */
var domainPat=new RegExp("^" + atom + "(\\." + atom +")*$")


/* Finally, let's start trying to figure out if the supplied address is
   valid. */

/* Begin with the coarse pattern to simply break up user@domain into
   different pieces that are easy to analyze. */
var matchArray=emailStr.match(emailPat)
if (matchArray==null) {
  /* Too many/few @'s or something; basically, this address doesn't
     even fit the general mould of a valid e-mail address. */
	alert("Invalid email address--please correct it.")
	return false
}
var user=matchArray[1]
var domain=matchArray[2]

// See if "user" is valid 
if (user.match(userPat)==null) {
    // user is not valid
    alert("Invalid email address--please correct it.")
    return false
}

/* if the e-mail address is at an IP address (as opposed to a symbolic
   host name) make sure the IP address is valid. */
var IPArray=domain.match(ipDomainPat)
if (IPArray!=null) {
    // this is an IP address
	  for (var i=1;i<=4;i++) {
	    if (IPArray[i]>255) {
		alert("Invalid email address IP address--please correct it.")
		return false
	    }
    }
    return true
}

// Domain is symbolic name
var domainArray=domain.match(domainPat)
if (domainArray==null) {
        alert("Invalid email address--please correct it (check the part after the '@')")
    return false
}

/* domain name seems valid, but now make sure that it ends in a
   three-letter word (like com, edu, gov) or a two-letter word,
   representing country (uk, nl), and that there's a hostname preceding 
   the domain or country. */

/* Now we need to break up the domain to get a count of how many atoms
   it consists of. */

/* DY DISABLE this--new domain names are not part of this schema
var atomPat=new RegExp(atom,"g")
var domArr=domain.match(atomPat)
var len=domArr.length
if (domArr[domArr.length-1].length<2 || 
    domArr[domArr.length-1].length>3) {
   // the address must end in a two letter or three letter word.
   alert("The address must end in a three-letter domain, or two letter country.")
   return false
}

// Make sure there's a host name preceding the domain.
if (len<2) {
   var errStr="Invalid email address--please correct it."
   alert(errStr)
   return false
}
*/

// If we've gotten this far, everything's valid!
return true;
}



-->
