<!--  to hide script contents from old browsers
function Validator(theForm)
{
   // make sure the name field is not blank
   if (theForm.shopper_name.value == "")
   {
            alert('We\'re sorry, but you did not complete the registration information correctly.  Please fill it out completely and then select a download option.')
           theForm.shopper_name.focus();
           return (false);
   }
	 // make sure email field is not blank
   if (theForm.shopper_email.value == "")
   {
            alert('We\'re sorry, but you did not complete the registration information correctly.  Please fill it out completely and then select a download option.')
           theForm.shopper_email.focus();
           return (false);
   }
	// check the EMAIL format
	if (!isEmailFieldValid(theForm.shopper_email))
	{
		alert("Please verify that your email address is in the proper format - name@company.com.");	theForm.shopper_email.focus();
		return (false);
	}
}

function checkEmail(strEmailField)
{	// check the EMAIL format
	if (!isEmailStrValid(strEmailField.value))
	{
		alert("Please verify that your email address is in the proper format - name@company.com.");
		return (false);
	}
	return true;

}function isEmailFieldValid(frmField)
{   
	var str = frmField.value;
		
	// Return false if e-mail field does not contain a '@' and '.' .   
	if (!isEmailStrValid(str))
		return false;      
	else
		return true;      
}

function isEmailStrValid(str)
{   
	if (str.length == 0)	return true;
// Return false if e-mail field does not contain a '@' and '.' .   
	if (str.indexOf ('@',0) == -1 || str.indexOf ('.',0) == -1)
		return false;      
	else
		return true;      
}

function MakeValidCC(str)
{
	//return str.replace(/[^0-9]/g,"");
	return str.replace(/\D/g, "");}
function MakeValidCDKey(str)
{
	return str.replace(/[^0-9,a-z,A-Z]/g,"");}
function isValidCCNo(str)
{
	if (str.length == 0)	return true;
	// Return true if ccNo field does not contain a '-' and ' ' (space) .
	if ((str.indexOf ('-',0) >= 0) || (str.indexOf (' ',0) >= 0))	return false;
	else 
		return true;
}

function isFieldValid(frmField)
{
	var str = frmField.value;
	// Return false if e-mail field does not contain a '@' and '.' .
	if (!isStrValid(str))
		return false;
	else
		return true;
}

function isStrValid(str)
{   
	if (str.length >= 0)		return true;
else		return false;}
function isValidPhone(s)
{
	if(s.length==0)
		return true;
	MakeValidCC(s);
	if(s.length != 10)
		return false;
	return true;
}		
function isZipValid(str
)
{	// Return false if zip field contains invalid chars or incorrect length.   
	if (str.indexOf ('-',0) == -1 || str.indexOf (' ',0) == -1)
		return false;
	else
		return true;      
}

function MakeValidZip(str, cn)
{
	if (cn == 'USA')
		str = str.substring(0, 9);
	else
		str = str.substring(0, 6);
	return str.replace(/[^0-9,a-z,A-Z]/g,"");}
function isValidZip(str)
{
	if (str.length == 0)
		return true;
}
function checkZip(strField)
{
	var z;
	var s;
	z = strField;
	if (isFieldValid(z))
		s = z.value;
	else{
		alert("Please verify that Zip Code is correct. e.g. 99999-9999");
		return false;
	}
	if (s.length == 0)
		return true;

	if (cn == 'USA'){
		if ((s.length > 10) || !(s.match(/^[0-9]{5}(-[0-9]{4})*$/)))	{
			alert("Please verify that Zip Code is correct. e.g. 99999-9999");
			return false;
		}
	}

	if (cn == 'CA'){
		if ((s.length > 7 ) || !(s.match(/^[a-z][0-9][a-z] [0-9][a-z][0-9]$/i)))	{
			alert("Please verify that Postal Code is correct. e.g. X9X 9X9");
			return false;
		}}return true;			
}// end hiding contents from old browsers  -->

