var sent=0;
var currentForm;
var req;

function submitFormHT(actionPage)
{

isExit=false;
//window.onbeforeunload = null;

document.forms[1].action = actionPage;
document.forms[1].submit();
}

function applyCoupon(sessionID) {
	if (document.getElementById("promocode").value != "") {
		//call Ajax window to verify code and update cart records if needed.
		var url = "applyCouponHealthyLife.asp?sessionID=" + sessionID + "&promo=" + document.getElementById("promocode").value;
		      
	      if (window.ActiveXObject) {
		  isIE = true;
		  req = new ActiveXObject("Microsoft.XMLHTTP");
		  if (req) {
		    req.onreadystatechange = processCouponResponse;
		    req.open("GET", url, true);
		    req.send();
		  }
	      }

	      else if (window.XMLHttpRequest) {
		  req = new XMLHttpRequest();
		  req.onreadystatechange = processCouponResponse;
		  req.open("GET", url, true);
		  req.send(null);                  
	     } 
		
	}
	else {
		alert("Enter a Valid Promo Code before continuing");
	}
}



function CopyValues_landing3b() {
	
	if (document.getElementById("billingTable").style.display != "block") {
		document.getElementById("billingTable").style.display = "none";
		document.forms[1].shipphonearea.value=document.forms[1].billphonearea.value;
		document.forms[1].shipphoneprefix.value=document.forms[1].billphoneprefix.value;
		document.forms[1].shipphonepostfix.value=document.forms[1].billphonepostfix.value;
		document.forms[1].shipadd1.value=document.forms[1].billadd1.value;
		document.forms[1].shipcity.value=document.forms[1].billcity.value;
		try {
		document.forms[1].shipotherprovence.value=document.forms[1].otherprovence.value;
		}
		catch (e) {
		//ignore
		}
		
		try {
			document.forms[1].shipstate.value=document.forms[1].billstate.value;
			}
			catch (e) {
			//ignore
		}
		
		try {
			document.forms[1].shipcountry.value=document.forms[1].billcountry.value;
		}
		catch (e) {
			//ignore
		}
		document.forms[1].shipadd2.value=document.forms[1].billadd2.value;
		document.forms[1].shipzip1.value=document.forms[1].billzip1.value;
		document.forms[1].shipLast.value=document.forms[1].lname.value;
		document.forms[1].shipFirst.value=document.forms[1].fname.value;
		document.getElementById("billingTable").style.display = "block";
	}
	else {	
		//set all the fields 2 blank
		document.forms[1].shipphonearea.value="";
		document.forms[1].shipphoneprefix.value="";
		document.forms[1].shipphonepostfix.value="";
		document.forms[1].shipadd1.value="";
		document.forms[1].shipcity.value="";
		try {
			document.forms[1].shipotherprovence.value="";
		}
		catch (e) {
			//ignore
		}
		
		try {
			document.forms[1].shipstate.value="";
		}
		catch (e) {
			//ignore
		}
		
		try {
			document.forms[1].shipcountry.value="";
		}
		catch (e) {
			//ignore
		}
		
		
		document.forms[1].shipadd2.value="";
		document.forms[1].shipzip1.value="";
		document.forms[1].shipLast.value="";
		document.forms[1].shipFirst.value="";
		document.getElementById("billingTable").style.display = "none";
	}
	
	
	//added to recalc shipping
	

}

function alertWin(x, err) 
{
    var lsError = "<font color=red size=2><b>Errors (The following fields are required):</b></font><hr><font size=2>";
    for (i = 0; i < x; i++){
        lsError += ((i+1) + ". " + err[i] + "<br>");
    }
    document.getElementById("errs").innerHTML = lsError + "</font>";
    document.getElementById("LandingPagePopupBox").style.display = "block";
    
    
}

function closeWin(x, err) 
{
    document.getElementById("LandingPagePopupBox").style.display = "none";
    
    
}

function resetTextboxes(theForm) {
	theForm.checkbox3.style.backgroundColor = "#FFFFFF";
	theForm.checkbox3.style.borderColor = "#666666";
        theForm.fname.style.backgroundColor = "#FFFFFF";
        theForm.fname.style.borderColor = "#666666";
        theForm.lname.style.backgroundColor = "#FFFFFF";
        theForm.lname.style.borderColor = "#666666";
        theForm.shipFirst.style.backgroundColor = "#FFFFFF";
        theForm.shipFirst.style.borderColor = "#666666";
        theForm.shipLast.style.backgroundColor = "#FFFFFF";
        theForm.shipLast.style.borderColor = "#666666";
        theForm.shipadd1.style.backgroundColor = "#FFFFFF";
        theForm.shipadd1.style.borderColor = "#666666";
	theForm.shipzip1.style.backgroundColor = "#FFFFFF";
	theForm.shipzip1.style.borderColor = "#666666";
	theForm.shipcity.style.backgroundColor = "#FFFFFF";
	theForm.shipcity.style.borderColor = "#666666";
	if (theForm.shipotherprovence != undefined) {
		theForm.shipotherprovence.style.backgroundColor = "#FFFFFF";
		theForm.shipotherprovence.style.borderColor = "#666666";
	}
	
	if (theForm.shipstate != undefined) {
	
	
			theForm.shipstate.style.backgroundColor = "#FFFFFF";
			theForm.shipstate.style.borderColor = "#666666";
	}
	
	if (theForm.billstate != undefined) {
		
		
				theForm.billstate.style.backgroundColor = "#FFFFFF";
				theForm.billstate.style.borderColor = "#666666";
	}
	
	try {
		theForm.billcountry.style.backgroundColor = "#FFFFFF";
		theForm.billcountry.style.borderColor = "#666666";
	}
	catch (e) {
		//ignore
	}
	
	try {
			theForm.shipcountry.style.backgroundColor = "#FFFFFF";
			theForm.shipcountry.style.borderColor = "#666666";
		}
		catch (e) {
			//ignore
	}
	theForm.shipphonearea.style.borderColor = "#666666";
	theForm.shipphonearea.style.backgroundColor = "#FFFFFF";
	theForm.shipphoneprefix.style.borderColor = "#666666";
	theForm.shipphoneprefix.style.backgroundColor = "#FFFFFF";
	theForm.shipphonepostfix.style.borderColor = "#666666";
	theForm.shipphonepostfix.style.backgroundColor = "#FFFFFF";
	theForm.email.style.backgroundColor = "#FFFFFF";
        theForm.email.style.borderColor = "#666666";
        
        
        if (theForm.shipinfo.checked) {
		theForm.billphonearea.style.backgroundColor = "#FFFFFF";
		theForm.billphonearea.style.borderColor = "#666666";
		theForm.shipphoneprefix.style.borderColor = "#666666";
		theForm.billphoneprefix.style.backgroundColor = "#FFFFFF";
		theForm.billphonepostfix.style.borderColor = "#666666";
		theForm.billphonepostfix.style.backgroundColor = "#FFFFFF";
		theForm.billadd1.style.backgroundColor = "#FFFFFF";
		theForm.billadd2.style.backgroundColor = "#FFFFFF";
		theForm.billzip1.style.backgroundColor = "#FFFFFF";
		theForm.billcity.style.backgroundColor = "#FFFFFF";
		try {
			theForm.otherprovence.style.backgroundColor = "#FFFFFF";
			theForm.otherprovence.style.borderColor = "#666666";
		}
		catch (e) {
			//ignore	
		}
		
		theForm.billadd1.style.borderColor = "#666666";

		theForm.billadd2.style.borderColor = "#666666";
		theForm.billzip1.style.borderColor = "#666666";
		theForm.billcity.style.borderColor = "#666666";
		
		theForm.shippingType.style.backgroundColor = "#FFFFFF";
		theForm.shippingType.style.borderColor = "#666666";
        }
        
        //payment fields
        
	    theForm.ccnumber.style.backgroundColor = "#FFFFFF";
	    theForm.ccnumber.style.borderColor = "#666666";   
	    theForm.cctype.style.backgroundColor = "#FFFFFF";
	    theForm.cctype.style.borderColor = "#666666";   
	    theForm.cccode.style.backgroundColor = "#FFFFFF";
	    theForm.cccode.style.borderColor = "#666666";   
	    theForm.ccname.style.backgroundColor = "#FFFFFF";
	    theForm.ccname.style.borderColor = "#666666"; 
        
        //new fields
        try {
		theForm.productStrength.style.backgroundColor = "#FFFFFF";
		theForm.productStrength.style.borderColor = "#666666";
        	theForm.typeselected[0].style.backgroundColor = "#FFFFFF";
        }
        catch (E) {
        	//ignore the fields not existing.
        }
}

function isValidForm2(theForm) 
{
    document.getElementById("errs").innerHTML = "";
    var err = new Array();
    var x=0;
	var selValue=0;
    
    resetTextboxes(theForm);
    
    if (theForm.checkbox3.checked == false) {
    	err[x] = 'Please check the box that you agree to the terms & conditions..';
	        theForm.checkbox3.style.backgroundColor = "#FCB1B1";
	        theForm.checkbox3.style.borderColor = "#7D1111";
	        theForm.checkbox3.focus();
        x=x+1;
    }
    
    if (theForm.email.value == "" || theForm.email.value.indexOf('@', 0) == -1 || theForm.email.value.indexOf('.', 0) == -1)
        {
            err[x] = 'Valid email address.';
            theForm.email.style.backgroundColor = "#FCB1B1";
            theForm.email.style.borderColor = "#7D1111";
            x=x+1;
    	}
    
	
	    if (theForm.fname.value == "")
	    {
		err[x] = 'Please enter a value for the \"first name\" field.';
		theForm.fname.style.backgroundColor = "#FCB1B1";
		theForm.fname.style.borderColor = "#7D1111";
		theForm.fname.focus();
		x=x+1;
	    }
	    if (theForm.fname.value.length < 2)
	    {
		err[x] = 'Please enter at least 2 characters in the \"first name\" field.';
		theForm.fname.style.backgroundColor = "#FCB1B1";
		theForm.fname.style.borderColor = "#7D1111";
		theForm.fname.focus();
		x=x+1;
	    }
	    if (theForm.fname.value.length > 25)
	    {
		err[x] = 'Please enter at most 25 characters in the \"first name\" field.';
		theForm.fname.style.backgroundColor = "#FCB1B1";
		theForm.fname.style.borderColor = "#7D1111";
		theForm.fname.focus();
		x=x+1;
	    }
	    if (theForm.lname.value == "")
	    {
		err[x] = 'Please enter a value for the \"last name\" field.';
		theForm.lname.style.backgroundColor = "#FCB1B1";
		theForm.lname.style.borderColor = "#7D1111";
		theForm.lname.focus();
		x=x+1;
	    }
	    if (theForm.lname.value.length < 2)
	    {
		err[x] = 'Please enter at least 2 characters in the \"last name\" field.';
		theForm.lname.style.backgroundColor = "#FCB1B1";
		theForm.lname.style.borderColor = "#7D1111";
		theForm.lname.focus();
		x=x+1;
	    }
	    if (theForm.lname.value.length > 50)
	    {
		err[x] = 'Please enter at most 50 characters in the \"last name\" field.';
		theForm.lname.style.backgroundColor = "#FCB1B1";
		theForm.lname.style.borderColor = "#7D1111";
		theForm.lname.focus();
		x=x+1;
	    }
	    
	    theForm.ccname.value = theForm.fname.value + ' ' + theForm.lname.value;
	    theForm.shipattn.value = theForm.ccname.value;
	    
	    if (theForm.billadd1.value == "")
	    {
		err[x] = 'Please enter a value for the \"Bill Address\" field.';
		theForm.billadd1.style.backgroundColor = "#FCB1B1";
		theForm.billadd1.style.borderColor = "#7D1111";
		theForm.billadd1.focus();
		x=x+1;
	    }
	    if (theForm.billadd1.value.length < 5)
	    {
		err[x] = 'Please enter at least 5 characters in the \"Bill Address\" field.';
		theForm.billadd1.style.backgroundColor = "#FCB1B1";
		theForm.billadd1.style.borderColor = "#7D1111";
		theForm.billadd1.focus();
		x=x+1;
	    }
	    if (theForm.billadd1.value.length > 50)
	    {
		err[x] = 'Please enter at most 50 characters in the \"Bill Address\" field.';
		theForm.billadd1.style.backgroundColor = "#FCB1B1";
		theForm.billadd1.style.borderColor = "#7D1111";
		theForm.billadd1.focus();
		x=x+1;
	    }
	    if (theForm.billcity.value == "")
	    {
		err[x] = 'Please enter a value for the \"bill city\" field.';
		theForm.billcity.style.backgroundColor = "#FCB1B1";
		theForm.billcity.style.borderColor = "#7D1111";
		theForm.billcity.focus();
		x=x+1;
	    }
	    if (theForm.billcity.value.length <= 1)
	    {
		err[x] = 'Please enter at least 2 characters in the \"bill city\" field.';
		theForm.billcity.style.backgroundColor = "#FCB1B1";
		theForm.billcity.style.borderColor = "#7D1111";
		theForm.billcity.focus();
		x=x+1;
	    }
	    if (theForm.billcity.value.length >= 51)
	    {
		err[x] = 'Please enter at most 50 characters in the \"bill city\" field.';
		theForm.billcity.style.backgroundColor = "#FCB1B1";
		theForm.billcity.style.borderColor = "#7D1111";
		theForm.billcity.focus();
		x=x+1;
	    }
	    
	    if (theForm.otherprovence != undefined) {
	    if (theForm.otherprovence.selectedIndex == "0")
	    {
	    	if (theForm.billcountry.value == "Canada") {
	    	
		    err[x] = 'Please enter a valid state or province field.';
		    theForm.otherprovence.style.backgroundColor = "#FCB1B1";
		    theForm.otherprovence.style.borderColor = "#7D1111";
		    theForm.otherprovence.focus();
		    x=x+1;
		}
	    }}

if (theForm.billcountry != undefined) {
	    if (theForm.billcountry.selectedIndex == "0")
	    {
		err[x] = 'Please enter a valid country.';
		    theForm.billcountry.style.backgroundColor = "#FCB1B1";
		    theForm.billcountry.style.borderColor = "#7D1111";
		    theForm.billcountry.focus();
		    x=x+1;

	    }}


	    if (theForm.billzip1.value == "")
	    {
		err[x] = 'Please enter a value for the \"Billing Postal Code\" field.';
		theForm.billzip1.style.backgroundColor = "#FCB1B1";
		theForm.billzip1.style.borderColor = "#7D1111";
		theForm.billzip1.focus();
		x=x+1;
	    }
	    if (theForm.billzip1.value.length < 4)
	    {
		err[x] = 'Please enter at least 4 characters in the \"Billing Postal Code\" field.';
		theForm.billzip1.style.backgroundColor = "#FCB1B1";
		theForm.billzip1.style.borderColor = "#7D1111";
		theForm.billzip1.focus();
		x=x+1;
	    }
	    if (theForm.billzip1.value.length > 10)
	    {
		err[x] = 'Please enter at most 10 characters in the \"bill zip\" field.';
		theForm.billzip1.style.backgroundColor = "#FCB1B1";
		theForm.billzip1.style.borderColor = "#7D1111";
		theForm.billzip1.focus();
		x=x+1;
	    }
	    
	   
    
	    if (theForm.billphonearea.value == "")
	    {
		err[x] = 'Please enter a value for the \"bill phone area code\" field.';
		theForm.billphonearea.style.backgroundColor = "#FCB1B1";
		theForm.billphonearea.style.borderColor = "#7D1111";
		theForm.billphonearea.focus();
		x=x+1;
	    }
	    if (theForm.billphonearea.value.length < 3)
	    {
		err[x] = 'Please enter at least 3 characters in the \"bill phone area \" field.';
		theForm.billphonearea.style.backgroundColor = "#FCB1B1";
		theForm.billphonearea.style.borderColor = "#7D1111";
		theForm.billphonearea.focus();
		x=x+1;
	    }

		if (!numericOnly(theForm.billphonearea.value))
		{
			err[x] = 'Please enter a valid value in the \"bill Phone Area Code\" field.';
			theForm.billphonearea.style.backgroundColor = "#FCB1B1";
			theForm.billphonearea.style.borderColor = "#7D1111";
			theForm.billphonearea.focus();
			x=x+1;
		}

		if (!numericOnly(theForm.billphoneprefix.value))
		{
			err[x] = 'Please enter a valid value in the \"bill Phone Prefix\" field.';
			theForm.billphoneprefix.style.backgroundColor = "#FCB1B1";
			theForm.billphoneprefix.style.borderColor = "#7D1111";
			theForm.billphoneprefix.focus();
			x=x+1;
		}

		if (!numericOnly(theForm.billphonepostfix.value))
		{
			err[x] = 'Please enter a valid value in the \"bill Phone Postfix\" field.';
			theForm.billphonepostfix.style.backgroundColor = "#FCB1B1";
			theForm.billphonepostfix.style.borderColor = "#7D1111";
			theForm.billphonepostfix.focus();
			x=x+1;
		}
	
	    if (theForm.billphoneprefix.value == "")
		{
		    err[x] = 'Please enter a value for the \"bill phone prefix\" field.';
		    theForm.billphoneprefix.style.backgroundColor = "#FCB1B1";
		    theForm.billphoneprefix.style.borderColor = "#7D1111";
		    theForm.billphoneprefix.focus();
		    x=x+1;
		}
		if (theForm.billphoneprefix.value.length < 3)
		{
		    err[x] = 'Please enter at least 3 characters in the \"bill phone prefix \" field.';
		    theForm.billphoneprefix.style.backgroundColor = "#FCB1B1";
		    theForm.billphoneprefix.style.borderColor = "#7D1111";
		    theForm.billphoneprefix.focus();
		    x=x+1;
	    }

	    if (theForm.billphonepostfix.value == "")
		{
		    err[x] = 'Please enter a value for the \"bill phone s\" field.';
		    theForm.billphonepostfix.style.backgroundColor = "#FCB1B1";
		    theForm.billphonepostfix.style.borderColor = "#7D1111";
		    theForm.billphonepostfix.focus();
		    x=x+1;
		}
		if (theForm.billphonepostfix.value.length < 4)
		{
		    err[x] = 'Please enter at least 3 characters in the \"bill phone suffix \" field.';
		    theForm.billphonepostfix.style.backgroundColor = "#FCB1B1";
		    theForm.billphonepostfix.style.borderColor = "#7D1111";
		    theForm.billphonepostfix.focus();
		    x=x+1;
	    }

	    theForm.billphone.value = theForm.billphonearea.value + theForm.billphoneprefix.value + theForm.billphonepostfix.value
    
    if (theForm.shipinfo.checked) {
		    //shipping
		    theForm.shipattn.value = theForm.shipFirst.value + " " + theForm.shipLast.value;
		    if (theForm.shipattn.value == "")
		    {
			err[x] = 'Please enter a value for the \"ship first and last name\" fields.';
			theForm.shipFirst.style.backgroundColor = "#FCB1B1";
			theForm.shipFirst.style.borderColor = "#7D1111";
			theForm.shipLast.style.backgroundColor = "#FCB1B1";
			theForm.shipLast.style.borderColor = "#7D1111";
			theForm.shipFirst.focus();
			x=x+1;
		    }
		    if (theForm.shipattn.value.length < 2)
		    {
			err[x] = 'Please enter at least 2 characters in the \"ship first and last name\" field.';
			theForm.shipFirst.style.backgroundColor = "#FCB1B1";
			theForm.shipFirst.style.borderColor = "#7D1111";
			theForm.shipLast.style.backgroundColor = "#FCB1B1";
			theForm.shipLast.style.borderColor = "#7D1111";
			theForm.shipFirst.focus();
			x=x+1;
		    }
		    if (theForm.shipattn.value.length > 50)
		    {
			err[x] = 'Please enter at most 50 characters in the \"ship first and last name\" field.';
			theForm.shipFirst.style.backgroundColor = "#FCB1B1";
			theForm.shipFirst.style.borderColor = "#7D1111";
			theForm.shipLast.style.backgroundColor = "#FCB1B1";
			theForm.shipLast.style.borderColor = "#7D1111";
			theForm.shipFirst.focus();
			x=x+1;
		    }
		    if (theForm.shipadd1.value == "")
		    {
			err[x] = 'Please enter a value for the \"ship address\" field.';
			theForm.shipadd1.style.backgroundColor = "#FCB1B1";
			theForm.shipadd1.style.borderColor = "#7D1111";
			theForm.shipadd1.focus();
			x=x+1;
		    }
		    if (theForm.shipadd1.value.length < 5)
		    {
			err[x] = 'Please enter at least 5 characters in the \"ship address\" field.';
			theForm.shipadd1.style.backgroundColor = "#FCB1B1";
			theForm.shipadd1.style.borderColor = "#7D1111";
			theForm.shipadd1.focus();
			x=x+1;
		    }
		    if (theForm.shipadd1.value.length > 50)
		    {
			err[x] = 'Please enter at most 50 characters in the \"ship address\" field.';
			theForm.shipadd1.style.backgroundColor = "#FCB1B1";
			theForm.shipadd1.style.borderColor = "#7D1111";
			theForm.shipadd1.focus();
			x=x+1;
		    }
		    if (theForm.shipcity.value == "")
		    {
			err[x] = 'Please enter a value for the \"ship city\" field.';
			theForm.shipcity.style.backgroundColor = "#FCB1B1";
			theForm.shipcity.style.borderColor = "#7D1111";
			theForm.shipcity.focus();
			x=x+1;
		    }
		    if (theForm.shipcity.value.length < 2)
		    {
			err[x] = 'Please enter at least 2 characters in the \"ship city\" field.';
			theForm.shipcity.style.backgroundColor = "#FCB1B1";
			theForm.shipcity.style.borderColor = "#7D1111";
			theForm.shipcity.focus();
			x=x+1;
		    }
		    if (theForm.shipcity.value.length > 50)
		    {
			err[x] = 'Please enter at most 50 characters in the \"ship city\" field.';
			theForm.shipcity.style.backgroundColor = "#FCB1B1";
			theForm.shipcity.style.borderColor = "#7D1111";
			theForm.shipcity.focus();
			x=x+1;
		    }
		    
		    if (theForm.shipotherprovence != undefined) {
		    if (theForm.shipotherprovence.selectedIndex == "0")
		    {
		    	if (theForm.shipcountry.value == "Canada") {
			    err[x] = 'Please enter a state or province field.';
			    theForm.shipotherprovence.style.backgroundColor = "#FCB1B1";
			    theForm.shipotherprovence.style.borderColor = "#7D1111";
			    theForm.shipotherprovence.focus();
			    x=x+1;
			    }

		    }}
		    
		    if (theForm.shipcountry != undefined) {
		    		    if (theForm.shipcountry.selectedIndex == "0")
		    		    {
		    			    err[x] = 'Please enter a country field.';
		    			    theForm.shipcountry.style.backgroundColor = "#FCB1B1";
		    			    theForm.shipcountry.style.borderColor = "#7D1111";
		    			    theForm.shipcountry.focus();
		    			    x=x+1;
		    
		    }}

		    if (theForm.shipzip1.value == "")
		    {
			err[x] = 'Please enter a value for the \"shipping Zip code\" field.';
			theForm.shipzip1.style.backgroundColor = "#FCB1B1";
			theForm.shipzip1.style.borderColor = "#7D1111";
			theForm.shipzip1.focus();
			x=x+1;
		    }
		    if (theForm.shipzip1.value.length < 4)
		    {
			err[x] = 'Please enter at least 4 characters in the \"Shipping Zip Code\" field.';
			theForm.shipzip1.style.backgroundColor = "#FCB1B1";
			theForm.shipzip1.style.borderColor = "#7D1111";
			theForm.shipzip1.focus();
			x=x+1;
		    }
		    if (theForm.shipzip1.value.length > 10)
		    {
			err[x] = 'Please enter at most 10 characters in the \"Shipping Zip Code\" field.';
			theForm.shipzip1.style.backgroundColor = "#FCB1B1";
			theForm.shipzip1.style.borderColor = "#7D1111";
			theForm.shipzip1.focus();
			x=x+1;
		    }

		   




		    if (theForm.shipphonearea.value == "")
			{
			    err[x] = 'Please enter a value for the \"ship phone area code\" field.';
			    theForm.shipphonearea.style.backgroundColor = "#FCB1B1";
			    theForm.shipphonearea.style.borderColor = "#7D1111";
			    theForm.shipphonearea.focus();
			    x=x+1;
			}
			if (theForm.shipphonearea.value.length < 3)
			{
			    err[x] = 'Please enter at least 3 characters in the \"ship phone area \" field.';
			    theForm.shipphonearea.style.backgroundColor = "#FCB1B1";
			    theForm.shipphonearea.style.borderColor = "#7D1111";
			    theForm.shipphonearea.focus();
			    x=x+1;
			}

			if (!numericOnly(theForm.shipphonearea.value))
			{
				err[x] = 'Please enter a valid value in the \"Ship Phone Area Code\" field.';
				theForm.shipphonearea.style.backgroundColor = "#FCB1B1";
				theForm.shipphonearea.style.borderColor = "#7D1111";
				theForm.shipphonearea.focus();
				x=x+1;
			}

			if (!numericOnly(theForm.shipphoneprefix.value))
			{
				err[x] = 'Please enter a valid value in the \"Ship Phone Prefix\" field.';
				theForm.shipphoneprefix.style.backgroundColor = "#FCB1B1";
				theForm.shipphoneprefix.style.borderColor = "#7D1111";
				theForm.shipphoneprefix.focus();
				x=x+1;
			}

			if (!numericOnly(theForm.shipphonepostfix.value))
			{
				err[x] = 'Please enter a valid value in the \"Ship Phone Postfix\" field.';
				theForm.shipphonepostfix.style.backgroundColor = "#FCB1B1";
				theForm.shipphonepostfix.style.borderColor = "#7D1111";
				theForm.shipphonepostfix.focus();
				x=x+1;
			}


			if (theForm.shipphoneprefix.value == "")
			    {
				err[x] = 'Please enter a value for the \"ship phone prefix\" field.';
				theForm.shipphoneprefix.style.backgroundColor = "#FCB1B1";
				theForm.shipphoneprefix.style.borderColor = "#7D1111";
				theForm.shipphoneprefix.focus();
				x=x+1;
			    }
			    if (theForm.shipphoneprefix.value.length < 3)
			    {
				err[x] = 'Please enter at least 3 characters in the \"ship phone prefix \" field.';
				theForm.shipphoneprefix.style.backgroundColor = "#FCB1B1";
				theForm.shipphoneprefix.style.borderColor = "#7D1111";
				theForm.shipphoneprefix.focus();
				x=x+1;
			}

			if (theForm.shipphonepostfix.value == "")
			    {
				err[x] = 'Please enter a value for the \"ship phone s\" field.';
				theForm.shipphonepostfix.style.backgroundColor = "#FCB1B1";
				theForm.shipphonepostfix.style.borderColor = "#7D1111";
				theForm.shipphonepostfix.focus();
				x=x+1;
			    }
			    if (theForm.shipphonepostfix.value.length < 4)
			    {
				err[x] = 'Please enter at least 3 characters in the \"ship phone suffix \" field.';
				theForm.shipphonepostfix.style.backgroundColor = "#FCB1B1";
				theForm.shipphonepostfix.style.borderColor = "#7D1111";
				theForm.shipphonepostfix.focus();
				x=x+1;
		    }

		    theForm.shipphone.value = theForm.shipphonearea.value + theForm.shipphoneprefix.value + theForm.shipphonepostfix.value

		    if (theForm.shippingType.selectedIndex > 4000) {
			err[x] = 'Please select a valid shipping type.';
				    theForm.shippingType.style.backgroundColor = "#FCB1B1";
				    theForm.shippingType.style.borderColor = "#7D1111";
				    theForm.shippingType.focus();
			    x=x+1;
		    }  
	}
    
    if (theForm.cctype.value == "")
	{
	    err[x] = 'Please select the credit card type from the menu.';
	    theForm.cctype.style.backgroundColor = "#FCB1B1";
	    theForm.cctype.style.borderColor = "#7D1111";
	    theForm.cctype.focus();
	    x=x+1;
	}
	if (theForm.ccnumber.value == "")
	{
	    err[x] = 'Please enter a valid credit card number.';
	    theForm.ccnumber.style.backgroundColor = "#FCB1B1";
	    theForm.ccnumber.style.borderColor = "#7D1111";
	    theForm.ccnumber.focus();
	    x=x+1;
	}
	if (theForm.cctype.value == "AmericanExpress")
	{
	    if (theForm.ccnumber.value.length < 15)
	    {
		err[x] = 'American Express cards have 15 digits.  Please enter only 15 digits with no spaces or dashes.';
		theForm.ccnumber.style.backgroundColor = "#FCB1B1";
		theForm.ccnumber.style.borderColor = "#7D1111";
		theForm.ccnumber.focus();
		x=x+1;
	    }
	    if (theForm.ccnumber.value.length > 17)
	    {
		err[x] = 'American Express cards have 15 digits.  Please enter only 15 digits with no spaces or dashes.';
		theForm.ccnumber.style.backgroundColor = "#FCB1B1";
		theForm.ccnumber.style.borderColor = "#7D1111";
		theForm.ccnumber.focus();
		x=x+1;
	    }
	}
	if (theForm.cctype.selectedIndex > 1)
	{
	    if (theForm.ccnumber.value.length < 16)
	    {
		err[x] = 'Visa, Mastercard and Discover cards have 16 digits.  Please enter only 16 digits with no spaces or dashes.';
		theForm.ccnumber.style.backgroundColor = "#FCB1B1";
		theForm.ccnumber.style.borderColor = "#7D1111";
		theForm.ccnumber.focus();
		x=x+1;
	    }
	    if (theForm.ccnumber.value.length > 19)
	    {
		err[x] = 'Visa, Mastercard and Discover cards have 16 digits.  Please enter only 16 digits with no spaces or dashes.';
		theForm.ccnumber.style.backgroundColor = "#FCB1B1";
		theForm.ccnumber.style.borderColor = "#7D1111";
		theForm.ccnumber.focus();
		x=x+1;
	    }
	}
	if (theForm.cccode.value == "")
	{
	    err[x] = 'Please enter your credit card security code. This helps to prevent fraud.';
	    theForm.cccode.style.backgroundColor = "#FCB1B1";
	    theForm.cccode.style.borderColor = "#7D1111";
	    theForm.cccode.focus();
	    x=x+1;
	}
	if (theForm.ccname.value == "")
	{
	    err[x] = 'Please enter card holders full name.';
	    theForm.ccname.style.backgroundColor = "#FCB1B1";
	    theForm.ccname.style.borderColor = "#7D1111";
	    theForm.ccname.focus();
	    x=x+1;
	}
	
	if (theForm.ccMonth.selectedIndex < 1) {
	    	err[x] = 'Please select a valid credit card expiration month.';
			    theForm.ccMonth.style.backgroundColor = "#FCB1B1";
			    theForm.ccMonth.style.borderColor = "#7D1111";
			    theForm.ccMonth.focus();
		    x=x+1;
	    }
		
		if (theForm.ccYear.selectedIndex < 1) {
	    	err[x] = 'Please select a valid credit card expiration year.';
			    theForm.ccYear.style.backgroundColor = "#FCB1B1";
			    theForm.ccYear.style.borderColor = "#7D1111";
			    theForm.ccYear.focus();
		    x=x+1;
    }
            
    if (x > 0)
    {
        alertWin(x, err);
    }
    else
    {
        if (sent==0)
        { 
            if (!theForm.shipinfo.checked) {
            		document.forms[1].shipphonearea.value=document.forms[1].billphonearea.value;
			document.forms[1].shipphoneprefix.value=document.forms[1].billphoneprefix.value;
			document.forms[1].shipphonepostfix.value=document.forms[1].billphonepostfix.value;
			document.forms[1].shipadd1.value=document.forms[1].billadd1.value;
			document.forms[1].shipcity.value=document.forms[1].billcity.value;
			if (document.forms[1].otherprovence != undefined) {
				document.forms[1].shipotherprovence.value=document.forms[1].otherprovence.value;
			}				
			
			if (document.forms[1].billcountry != undefined) {
							document.forms[1].shipcountry.value=document.forms[1].billcountry.value;
			}				
			document.forms[1].shipadd2.value=document.forms[1].billadd2.value;
			document.forms[1].shipzip1.value=document.forms[1].billzip1.value;
			document.forms[1].shipLast.value=document.forms[1].lname.value;
			document.forms[1].shipFirst.value=document.forms[1].fname.value;
			theForm.shipphone.value = theForm.billphone.value;
            }
            document.getElementById("results").innerHTML = "<BR><B><I>Processing Order, Please Be Patient...</I></B><BR>";
			//this.options[this.selectedIndex].value
	    
			theForm.submit();
            sent=1;
        }
    }
}



//this is for landing3 page.
function resetTextboxes_landing3(theForm) {
	theForm.shipFirst.style.backgroundColor = "#FFFFFF";
	theForm.shipFirst.style.borderColor = "#666666";
	theForm.shipLast.style.backgroundColor = "#FFFFFF";
	theForm.shipLast.style.borderColor = "#666666";
	
	theForm.shipadd1.style.backgroundColor = "#FFFFFF";
	theForm.shipadd1.style.borderColor = "#666666";
	theForm.shipzip1.style.backgroundColor = "#FFFFFF";
	theForm.shipzip1.style.borderColor = "#666666";
	theForm.shipcity.style.backgroundColor = "#FFFFFF";
	theForm.shipcity.style.borderColor = "#666666";
	theForm.otherprovence.style.backgroundColor = "#FFFFFF";
	theForm.otherprovence.style.borderColor = "#666666";
	theForm.shipphonearea.style.borderColor = "#666666";
	theForm.shipphonearea.style.backgroundColor = "#FFFFFF";
	theForm.shipphoneprefix.style.borderColor = "#666666";
	theForm.shipphoneprefix.style.backgroundColor = "#FFFFFF";
	theForm.shipphonepostfix.style.borderColor = "#666666";
	theForm.shipphonepostfix.style.backgroundColor = "#FFFFFF";
	theForm.email.style.backgroundColor = "#FFFFFF";
	theForm.email.style.borderColor = "#666666"; 
}


function isValidForm3_landing3(theForm) 
{
	currentForm = theForm;
    //check zip and phone 1st.  If they pass, then call web service
    //if web service passes, then move on to the zip code and area code checker.
    resetTextboxes_landing3(theForm);
    
    //call service...
    //validateZipAreaCode(theForm.shipzip1.value,theForm.shipphonearea.value);
    finalizeValidation();
    return(false);
}

function removeSpaces(string) {
 return string.split(' ').join('');
}


function finalizeValidation() {
	document.getElementById("errs").innerHTML = "";
	        var err = new Array();
	    var x=0;
	    
	    if (currentForm.shipFirst.value == "")
	    {
	        err[x] = 'Please enter a value for the \"first name\" field.';
	        currentForm.shipFirst.style.backgroundColor = "#FCB1B1";
	        currentForm.shipFirst.style.borderColor = "#7D1111";
	        currentForm.shipFirst.focus();
	        x=x+1;
	    }
	    if (currentForm.shipFirst.value.length < 2)
	    {
	        err[x] = 'Please enter at least 2 characters in the \"first name\" field.';
	        currentForm.shipFirst.style.backgroundColor = "#FCB1B1";
	        currentForm.shipFirst.style.borderColor = "#7D1111";
	        currentForm.shipFirst.focus();
	        x=x+1;
	    }
	    if (currentForm.shipFirst.value.length > 25)
	    {
	        err[x] = 'Please enter at most 25 characters in the \"first name\" field.';
	        currentForm.shipFirst.style.backgroundColor = "#FCB1B1";
	        currentForm.shipFirst.style.borderColor = "#7D1111";
	        currentForm.shipFirst.focus();
	        x=x+1;
	    }
	    if (currentForm.shipLast.value == "")
	    {
	        err[x] = 'Please enter a value for the \"last name\" field.';
	        currentForm.shipLast.style.backgroundColor = "#FCB1B1";
	        currentForm.shipLast.style.borderColor = "#7D1111";
	        currentForm.shipLast.focus();
	        x=x+1;
	    }
	    if (currentForm.shipLast.value.length < 2)
	    {
	        err[x] = 'Please enter at least 2 characters in the \"last name\" field.';
	        currentForm.shipLast.style.backgroundColor = "#FCB1B1";
	        currentForm.shipLast.style.borderColor = "#7D1111";
	        currentForm.shipLast.focus();
	        x=x+1;
	    }
	    if (currentForm.shipLast.value.length > 50)
	    {
	        err[x] = 'Please enter at most 50 characters in the \"last name\" field.';
	        currentForm.shipLast.style.backgroundColor = "#FCB1B1";
	        currentForm.shipLast.style.borderColor = "#7D1111";
	        currentForm.shipLast.focus();
	        x=x+1;
	    }
	    if (currentForm.email.value == "" || currentForm.email.value.indexOf('@', 0) == -1 || currentForm.email.value.indexOf('.', 0) == -1)
	    {
	        err[x] = 'Valid email address.';
	        currentForm.email.style.backgroundColor = "#FCB1B1";
	        currentForm.email.style.borderColor = "#7D1111";
	        x=x+1;
	    }
	
	    //shipping
	    //currentForm.shipattn.value = currentForm.shipFirst.value + " " + currentForm.shipLast.value;
	    if (currentForm.shipadd1.value == "")
	    {
	        err[x] = 'Please enter a value for the \"ship address\" field.';
	        currentForm.shipadd1.style.backgroundColor = "#FCB1B1";
	        currentForm.shipadd1.style.borderColor = "#7D1111";
	        currentForm.shipadd1.focus();
	        x=x+1;
	    }
	    if (currentForm.shipadd1.value.length < 5)
	    {
	        err[x] = 'Please enter at least 5 characters in the \"ship address\" field.';
	        currentForm.shipadd1.style.backgroundColor = "#FCB1B1";
	        currentForm.shipadd1.style.borderColor = "#7D1111";
	        currentForm.shipadd1.focus();
	        x=x+1;
	    }
	    
	    var shipAddr = currentForm.shipadd1.value;
	    shipAddr = shipAddr.toLowerCase();
	    shipAddr = shipAddr.split('.').join('');
	    shipAddr = removeSpaces(shipAddr);

	    if (shipAddr.indexOf('pobox') >= 0)
	    {
	        err[x] = 'Unfortunately, UPS is unable to deliver to PO Boxes.  Please give us a real address to continue.';
	        currentForm.shipadd1.style.backgroundColor = "#FCB1B1";
	        currentForm.shipadd1.style.borderColor = "#7D1111";
	        currentForm.shipadd1.focus();
	        x=x+1;
	    }

	    if (currentForm.shipadd1.value.length > 50)
	    {
	        err[x] = 'Please enter at most 50 characters in the \"ship address\" field.';
	        currentForm.shipadd1.style.backgroundColor = "#FCB1B1";
	        currentForm.shipadd1.style.borderColor = "#7D1111";
	        currentForm.shipadd1.focus();
	        x=x+1;
	    }

	    //Does Shipping Address contain a PO Box?


	    if (currentForm.shipcity.value == "")
	    {
	        err[x] = 'Please enter a value for the \"ship city\" field.';
	        currentForm.shipcity.style.backgroundColor = "#FCB1B1";
	        currentForm.shipcity.style.borderColor = "#7D1111";
	        currentForm.shipcity.focus();
	        x=x+1;
	    }
	    if (currentForm.shipcity.value.length < 2)
	    {
	        err[x] = 'Please enter at least 2 characters in the \"ship city\" field.';
	        currentForm.shipcity.style.backgroundColor = "#FCB1B1";
	        currentForm.shipcity.style.borderColor = "#7D1111";
	        currentForm.shipcity.focus();
	        x=x+1;
	    }
	    if (currentForm.shipcity.value.length > 50)
	    {
	        err[x] = 'Please enter at most 50 characters in the \"ship city\" field.';
	        currentForm.shipcity.style.backgroundColor = "#FCB1B1";
	        currentForm.shipcity.style.borderColor = "#7D1111";
	        currentForm.shipcity.focus();
	        x=x+1;
	    }
	    if (currentForm.otherprovence.selectedIndex == "0")
	    {
	            err[x] = 'Please enter a state or province field.';
	            currentForm.otherprovence.style.backgroundColor = "#FCB1B1";
	            currentForm.otherprovence.style.borderColor = "#7D1111";
	            currentForm.otherprovence.focus();
	            x=x+1;
	    
	    }
	    
	    
		if (!numericOnly(currentForm.shipphonearea.value))
				{
					err[x] = 'Please enter a valid value in the \"Ship Area Code\" field.';
					currentForm.shipphonearea.style.backgroundColor = "#FCB1B1";
					currentForm.shipphonearea.style.borderColor = "#7D1111";
					currentForm.shipphonearea.focus();
					x=x+1;
		}
		
		if (!numericOnly(currentForm.shipphoneprefix.value))
		{
			err[x] = 'Please enter a valid value in the \"Ship Phone Prefix\" field.';
			currentForm.shipphoneprefix.style.backgroundColor = "#FCB1B1";
			currentForm.shipphoneprefix.style.borderColor = "#7D1111";
			currentForm.shipphoneprefix.focus();
			x=x+1;
		}
	
		if (!numericOnly(currentForm.shipphonepostfix.value))
		{
			err[x] = 'Please enter a valid value in the \"Ship Phone Postfix\" field.';
			currentForm.shipphonepostfix.style.backgroundColor = "#FCB1B1";
			currentForm.shipphonepostfix.style.borderColor = "#7D1111";
			currentForm.shipphonepostfix.focus();
			x=x+1;
		}
	        
	        if (currentForm.shipphoneprefix.value == "")
	            {
	                err[x] = 'Please enter a value for the \"ship phone prefix\" field.';
	                currentForm.shipphoneprefix.style.backgroundColor = "#FCB1B1";
	                currentForm.shipphoneprefix.style.borderColor = "#7D1111";
	                currentForm.shipphoneprefix.focus();
	                x=x+1;
	            }
	            if (currentForm.shipphoneprefix.value.length < 3)
	            {
	                err[x] = 'Please enter at least 3 characters in the \"ship phone prefix \" field.';
	                currentForm.shipphoneprefix.style.backgroundColor = "#FCB1B1";
	                currentForm.shipphoneprefix.style.borderColor = "#7D1111";
	                currentForm.shipphoneprefix.focus();
	                x=x+1;
	        }
	        
	        if (currentForm.shipphonearea.value == "")
			            {
			                err[x] = 'Please enter a value for the \"ship area code\" field.';
			                currentForm.shipphonearea.style.backgroundColor = "#FCB1B1";
			                currentForm.shipphonearea.style.borderColor = "#7D1111";
			                currentForm.shipphonearea.focus();
			                x=x+1;
			            }
			            if (currentForm.shipphonearea.value.length < 3)
			            {
			                err[x] = 'Please enter at least 3 characters in the \"ship area code \" field.';
			                currentForm.shipphonearea.style.backgroundColor = "#FCB1B1";
			                currentForm.shipphonearea.style.borderColor = "#7D1111";
			                currentForm.shipphonearea.focus();
			                x=x+1;
	        }
	       
	       
	        if (currentForm.shipzip1.value.length < 5) {
	        	{
			err[x] = 'Please enter a value for the \"ship zip code\" field.';
			currentForm.shipzip1.style.backgroundColor = "#FCB1B1";
			currentForm.shipzip1.style.borderColor = "#7D1111";
			currentForm.shipzip1.focus();
			x=x+1;
	            	}
	        }
	        
	        if (currentForm.shipphonepostfix.value == "")
	            {
	                err[x] = 'Please enter a value for the \"ship phone suffix\" field.';
	                currentForm.shipphonepostfix.style.backgroundColor = "#FCB1B1";
	                currentForm.shipphonepostfix.style.borderColor = "#7D1111";
	                currentForm.shipphonepostfix.focus();
	                x=x+1;
	            }
	            if (currentForm.shipphonepostfix.value.length < 4)
	            {
	                err[x] = 'Please enter at least 3 characters in the \"ship phone suffix \" field.';
	                currentForm.shipphonepostfix.style.backgroundColor = "#FCB1B1";
	                currentForm.shipphonepostfix.style.borderColor = "#7D1111";
	                currentForm.shipphonepostfix.focus();
	                x=x+1;
	    }
	    
	    currentForm.shipphone.value = currentForm.shipphonearea.value + currentForm.shipphoneprefix.value + currentForm.shipphonepostfix.value
	    
	    if (x > 0)
	    {
			alertWin(x, err);
			return(false);
	    }
	    else
	    {
	        if (sent==0)
	        {
				currentForm.fname.value = currentForm.shipFirst.value
				currentForm.lname.value = currentForm.shipLast.value
				currentForm.billadd1.value = currentForm.shipadd1.value
				currentForm.billadd2.value = currentForm.shipadd2.value
				currentForm.billcity.value = currentForm.shipcity.value
				currentForm.otherprovence.value = currentForm.otherprovence.value
				currentForm.billzip1.value = currentForm.shipzip1.value
				currentForm.billphonearea.value = currentForm.shipphonearea.value
				currentForm.billphoneprefix.value = currentForm.shipphoneprefix.value
				currentForm.billphonepostfix.value = currentForm.shipphonepostfix.value
		
		    document.getElementById("errs").innerHTML = "<BR><B><I>Processing Order, Please Be Patient...</I></B><BR>";
	            currentForm.submit();
	            sent=1;
	        }
    }
	
}


function isValidForm2_landing2(theForm) 
{
    document.getElementById("errs").innerHTML = "";
    var err = new Array();
    var x=0;
    
    resetTextboxes_landing2(theForm);
    
   
    if (theForm.shipFirst.value == "")
    {
        err[x] = 'Please enter a value for the \"first name\" field.';
        theForm.shipFirst.style.backgroundColor = "#FCB1B1";
        theForm.shipFirst.style.borderColor = "#7D1111";
        theForm.shipFirst.focus();
        x=x+1;
    }
    if (theForm.shipFirst.value.length < 2)
    {
        err[x] = 'Please enter at least 2 characters in the \"first name\" field.';
        theForm.shipFirst.style.backgroundColor = "#FCB1B1";
        theForm.shipFirst.style.borderColor = "#7D1111";
        theForm.shipFirst.focus();
        x=x+1;
    }
    if (theForm.shipFirst.value.length > 25)
    {
        err[x] = 'Please enter at most 25 characters in the \"first name\" field.';
        theForm.shipFirst.style.backgroundColor = "#FCB1B1";
        theForm.shipFirst.style.borderColor = "#7D1111";
        theForm.shipFirst.focus();
        x=x+1;
    }
    if (theForm.shipLast.value == "")
    {
        err[x] = 'Please enter a value for the \"last name\" field.';
        theForm.shipLast.style.backgroundColor = "#FCB1B1";
        theForm.shipLast.style.borderColor = "#7D1111";
        theForm.shipLast.focus();
        x=x+1;
    }
    if (theForm.shipLast.value.length < 2)
    {
        err[x] = 'Please enter at least 2 characters in the \"last name\" field.';
        theForm.shipLast.style.backgroundColor = "#FCB1B1";
        theForm.shipLast.style.borderColor = "#7D1111";
        theForm.shipLast.focus();
        x=x+1;
    }
    if (theForm.shipLast.value.length > 50)
    {
        err[x] = 'Please enter at most 50 characters in the \"last name\" field.';
        theForm.shipLast.style.backgroundColor = "#FCB1B1";
        theForm.shipLast.style.borderColor = "#7D1111";
        theForm.shipLast.focus();
        x=x+1;
    }
    if (theForm.email.value == "" || theForm.email.value.indexOf('@', 0) == -1 || theForm.email.value.indexOf('.', 0) == -1)
    {
        err[x] = 'Valid email address.';
        theForm.email.style.backgroundColor = "#FCB1B1";
        theForm.email.style.borderColor = "#7D1111";
        x=x+1;
    }

    //shipping
    //theForm.shipattn.value = theForm.shipFirst.value + " " + theForm.shipLast.value;
    if (theForm.shipadd1.value == "")
    {
        err[x] = 'Please enter a value for the \"ship address\" field.';
        theForm.shipadd1.style.backgroundColor = "#FCB1B1";
        theForm.shipadd1.style.borderColor = "#7D1111";
        theForm.shipadd1.focus();
        x=x+1;
    }
    if (theForm.shipadd1.value.length < 5)
    {
        err[x] = 'Please enter at least 5 characters in the \"ship address\" field.';
        theForm.shipadd1.style.backgroundColor = "#FCB1B1";
        theForm.shipadd1.style.borderColor = "#7D1111";
        theForm.shipadd1.focus();
        x=x+1;
    }
    if (theForm.shipadd1.value.length > 50)
    {
        err[x] = 'Please enter at most 50 characters in the \"ship address\" field.';
        theForm.shipadd1.style.backgroundColor = "#FCB1B1";
        theForm.shipadd1.style.borderColor = "#7D1111";
        theForm.shipadd1.focus();
        x=x+1;
    }
    if (theForm.shipcity.value == "")
    {
        err[x] = 'Please enter a value for the \"ship city\" field.';
        theForm.shipcity.style.backgroundColor = "#FCB1B1";
        theForm.shipcity.style.borderColor = "#7D1111";
        theForm.shipcity.focus();
        x=x+1;
    }
    if (theForm.shipcity.value.length < 2)
    {
        err[x] = 'Please enter at least 2 characters in the \"ship city\" field.';
        theForm.shipcity.style.backgroundColor = "#FCB1B1";
        theForm.shipcity.style.borderColor = "#7D1111";
        theForm.shipcity.focus();
        x=x+1;
    }
    if (theForm.shipcity.value.length > 50)
    {
        err[x] = 'Please enter at most 50 characters in the \"ship city\" field.';
        theForm.shipcity.style.backgroundColor = "#FCB1B1";
        theForm.shipcity.style.borderColor = "#7D1111";
        theForm.shipcity.focus();
        x=x+1;
    }
    if (theForm.otherprovence.selectedIndex == "0")
    {
            err[x] = 'Please enter a state or province field.';
            theForm.otherprovence.style.backgroundColor = "#FCB1B1";
            theForm.otherprovence.style.borderColor = "#7D1111";
            theForm.otherprovence.focus();
            x=x+1;
    
    }
    
    if (theForm.shipzip1.value == "")
    {
        err[x] = 'Please enter a value for the \"shipping postal code\" field.';
        theForm.shipzip1.style.backgroundColor = "#FCB1B1";
        theForm.shipzip1.style.borderColor = "#7D1111";
        theForm.shipzip1.focus();
        x=x+1;
    }
    if (theForm.shipzip1.value.length < 4)
    {
        err[x] = 'Please enter at least 4 characters in the \"Shipping Postal Code\" field.';
        theForm.shipzip1.style.backgroundColor = "#FCB1B1";
        theForm.shipzip1.style.borderColor = "#7D1111";
        theForm.shipzip1.focus();
        x=x+1;
    }
    if (theForm.shipzip1.value.length > 10)
    {
        err[x] = 'Please enter at most 10 characters in the \"Shipping Postal Code\" field.';
        theForm.shipzip1.style.backgroundColor = "#FCB1B1";
        theForm.shipzip1.style.borderColor = "#7D1111";
        theForm.shipzip1.focus();
        x=x+1;
    }
    
    
    
    
    if (theForm.shipphonearea.value == "")
        {
            err[x] = 'Please enter a value for the \"ship phone area code\" field.';
            theForm.shipphonearea.style.backgroundColor = "#FCB1B1";
            theForm.shipphonearea.style.borderColor = "#7D1111";
            theForm.shipphonearea.focus();
            x=x+1;
        }
        if (theForm.shipphonearea.value.length < 3)
        {
            err[x] = 'Please enter at least 3 characters in the \"ship phone area \" field.';
            theForm.shipphonearea.style.backgroundColor = "#FCB1B1";
            theForm.shipphonearea.style.borderColor = "#7D1111";
            theForm.shipphonearea.focus();
            x=x+1;
        }

        if (!numericOnly(theForm.shipphonearea.value))
	{
		err[x] = 'Please enter a valid value in the \"Ship Phone Area Code\" field.';
		theForm.shipphonearea.style.backgroundColor = "#FCB1B1";
		theForm.shipphonearea.style.borderColor = "#7D1111";
		theForm.shipphonearea.focus();
		x=x+1;
	}
	
	if (!numericOnly(theForm.shipphoneprefix.value))
	{
		err[x] = 'Please enter a valid value in the \"Ship Phone Prefix\" field.';
		theForm.shipphoneprefix.style.backgroundColor = "#FCB1B1";
		theForm.shipphoneprefix.style.borderColor = "#7D1111";
		theForm.shipphoneprefix.focus();
		x=x+1;
	}
	
	if (!numericOnly(theForm.shipphonepostfix.value))
	{
		err[x] = 'Please enter a valid value in the \"Ship Phone Postfix\" field.';
		theForm.shipphonepostfix.style.backgroundColor = "#FCB1B1";
		theForm.shipphonepostfix.style.borderColor = "#7D1111";
		theForm.shipphonepostfix.focus();
		x=x+1;
	}

        if (theForm.shipphoneprefix.value == "")
            {
                err[x] = 'Please enter a value for the \"ship phone prefix\" field.';
                theForm.shipphoneprefix.style.backgroundColor = "#FCB1B1";
                theForm.shipphoneprefix.style.borderColor = "#7D1111";
                theForm.shipphoneprefix.focus();
                x=x+1;
            }
            if (theForm.shipphoneprefix.value.length < 3)
            {
                err[x] = 'Please enter at least 3 characters in the \"ship phone prefix \" field.';
                theForm.shipphoneprefix.style.backgroundColor = "#FCB1B1";
                theForm.shipphoneprefix.style.borderColor = "#7D1111";
                theForm.shipphoneprefix.focus();
                x=x+1;
        }
        
        if (theForm.shipphonepostfix.value == "")
            {
                err[x] = 'Please enter a value for the \"ship phone s\" field.';
                theForm.shipphonepostfix.style.backgroundColor = "#FCB1B1";
                theForm.shipphonepostfix.style.borderColor = "#7D1111";
                theForm.shipphonepostfix.focus();
                x=x+1;
            }
            if (theForm.shipphonepostfix.value.length < 4)
            {
                err[x] = 'Please enter at least 3 characters in the \"ship phone suffix \" field.';
                theForm.shipphonepostfix.style.backgroundColor = "#FCB1B1";
                theForm.shipphonepostfix.style.borderColor = "#7D1111";
                theForm.shipphonepostfix.focus();
                x=x+1;
    }
    
    theForm.shipphone.value = theForm.shipphonearea.value + theForm.shipphoneprefix.value + theForm.shipphonepostfix.value
    
    if (x > 0)
    {
		alertWin(x, err);
		return(false);
    }
    else
    {
        if (sent==0)
        {
            sent=1;
            theForm.fname.value = theForm.shipFirst.value
		theForm.lname.value = theForm.shipLast.value
		theForm.billadd1.value = theForm.shipadd1.value
		theForm.billadd2.value = theForm.shipadd2.value
		theForm.billcity.value = theForm.shipcity.value
		theForm.otherprovence.value = theForm.otherprovence.value
		theForm.billzip1.value = theForm.shipzip1.value
		theForm.billphonearea.value = theForm.shipphonearea.value
		theForm.billphoneprefix.value = theForm.shipphoneprefix.value
		theForm.billphonepostfix.value = theForm.shipphonepostfix.value
	
	    document.getElementById("results").innerHTML = "<BR><B><I>Processing Order, Please Be Patient...</I></B><BR>";
            theForm.submit();
            
        }
    }
}

function resetTextboxes_landing2(theForm) {
	theForm.shipFirst.style.backgroundColor = "#FFFFFF";
	theForm.shipFirst.style.borderColor = "#666666";
	theForm.shipLast.style.backgroundColor = "#FFFFFF";
	theForm.shipLast.style.borderColor = "#666666";
	
	theForm.shipadd1.style.backgroundColor = "#FFFFFF";
	theForm.shipadd1.style.borderColor = "#666666";
	theForm.shipzip1.style.backgroundColor = "#FFFFFF";
	theForm.shipzip1.style.borderColor = "#666666";
	theForm.shipcity.style.backgroundColor = "#FFFFFF";
	theForm.shipcity.style.borderColor = "#666666";
	theForm.otherprovence.style.backgroundColor = "#FFFFFF";
	theForm.shipotherprovence.style.borderColor = "#666666";
	theForm.shipphonearea.style.borderColor = "#666666";
	theForm.shipphonearea.style.backgroundColor = "#FFFFFF";
	theForm.shipphoneprefix.style.borderColor = "#666666";
	theForm.shipphoneprefix.style.backgroundColor = "#FFFFFF";
	theForm.shipphonepostfix.style.borderColor = "#666666";
	theForm.shipphonepostfix.style.backgroundColor = "#FFFFFF";
	theForm.email.style.backgroundColor = "#FFFFFF";
	theForm.email.style.borderColor = "#666666"; 
}




//landing2b
function isValidForm2_landing2b(theForm) 
{
    document.getElementById("errs").innerHTML = "";
    var err = new Array();
    var x=0;
    
    resetTextboxes_landing2b(theForm);
    
    if (theForm.checkbox3.checked == false) {
        	err[x] = 'Please check the box that you agree to the terms & conditions..';
    	        theForm.checkbox3.style.backgroundColor = "#FCB1B1";
    	        theForm.checkbox3.style.borderColor = "#7D1111";
    	        theForm.checkbox3.focus();
            x=x+1;
    }
    
    
    

    
	 if (theForm.fname.value == "")
    {
        err[x] = 'Please enter a value for the \"first name\" field.';
        theForm.fname.style.backgroundColor = "#FCB1B1";
        theForm.fname.style.borderColor = "#7D1111";
        theForm.fname.focus();
        x=x+1;
    }
    if (theForm.fname.value.length < 2)
    {
        err[x] = 'Please enter at least 2 characters in the \"first name\" field.';
        theForm.fname.style.backgroundColor = "#FCB1B1";
        theForm.fname.style.borderColor = "#7D1111";
        theForm.fname.focus();
        x=x+1;
    }
    if (theForm.fname.value.length > 25)
    {
        err[x] = 'Please enter at most 25 characters in the \"first name\" field.';
        theForm.fname.style.backgroundColor = "#FCB1B1";
        theForm.fname.style.borderColor = "#7D1111";
        theForm.fname.focus();
        x=x+1;
    }
    if (theForm.lname.value == "")
    {
        err[x] = 'Please enter a value for the \"last name\" field.';
        theForm.lname.style.backgroundColor = "#FCB1B1";
        theForm.lname.style.borderColor = "#7D1111";
        theForm.lname.focus();
        x=x+1;
    }
    if (theForm.lname.value.length < 2)
    {
        err[x] = 'Please enter at least 2 characters in the \"last name\" field.';
        theForm.lname.style.backgroundColor = "#FCB1B1";
        theForm.lname.style.borderColor = "#7D1111";
        theForm.lname.focus();
        x=x+1;
    }
    if (theForm.lname.value.length > 50)
    {
        err[x] = 'Please enter at most 50 characters in the \"last name\" field.';
        theForm.lname.style.backgroundColor = "#FCB1B1";
        theForm.lname.style.borderColor = "#7D1111";
        theForm.lname.focus();
        x=x+1;
    }
	
	if (theForm.billadd1.value == "")
    {
        err[x] = 'Please enter a value for the \"Bill Address\" field.';
        theForm.billadd1.style.backgroundColor = "#FCB1B1";
        theForm.billadd1.style.borderColor = "#7D1111";
        theForm.billadd1.focus();
        x=x+1;
    }
    if (theForm.billadd1.value.length < 5)
    {
        err[x] = 'Please enter at least 5 characters in the \"Bill Address\" field.';
        theForm.billadd1.style.backgroundColor = "#FCB1B1";
        theForm.billadd1.style.borderColor = "#7D1111";
        theForm.billadd1.focus();
        x=x+1;
    }
    if (theForm.billadd1.value.length > 50)
    {
        err[x] = 'Please enter at most 50 characters in the \"Bill Address\" field.';
        theForm.billadd1.style.backgroundColor = "#FCB1B1";
        theForm.billadd1.style.borderColor = "#7D1111";
        theForm.billadd1.focus();
        x=x+1;
    }
    if (theForm.billcity.value == "")
    {
        err[x] = 'Please enter a value for the \"bill city\" field.';
        theForm.billcity.style.backgroundColor = "#FCB1B1";
        theForm.billcity.style.borderColor = "#7D1111";
        theForm.billcity.focus();
        x=x+1;
    }
    if (theForm.billcity.value.length <= 1)
    {
        err[x] = 'Please enter at least 2 characters in the \"bill city\" field.';
        theForm.billcity.style.backgroundColor = "#FCB1B1";
        theForm.billcity.style.borderColor = "#7D1111";
        theForm.billcity.focus();
        x=x+1;
    }
    if (theForm.billcity.value.length >= 51)
    {
        err[x] = 'Please enter at most 50 characters in the \"bill city\" field.';
        theForm.billcity.style.backgroundColor = "#FCB1B1";
        theForm.billcity.style.borderColor = "#7D1111";
        theForm.billcity.focus();
        x=x+1;
    }
    if (theForm.otherprovence.selectedIndex == "0")
    {
        err[x] = 'Please enter a valid state or province field.';
	    theForm.otherprovence.style.backgroundColor = "#FCB1B1";
	    theForm.otherprovence.style.borderColor = "#7D1111";
	    theForm.otherprovence.focus();
	    x=x+1;
        
    }
    
    
    if (theForm.billzip1.value == "")
    {
        err[x] = 'Please enter a value for the \"Billing Postal Code\" field.';
        theForm.billzip1.style.backgroundColor = "#FCB1B1";
        theForm.billzip1.style.borderColor = "#7D1111";
        theForm.billzip1.focus();
        x=x+1;
    }
    if (theForm.billzip1.value.length < 4)
    {
        err[x] = 'Please enter at least 4 characters in the \"Billing Postal Code\" field.';
        theForm.billzip1.style.backgroundColor = "#FCB1B1";
        theForm.billzip1.style.borderColor = "#7D1111";
        theForm.billzip1.focus();
        x=x+1;
    }
    if (theForm.billzip1.value.length > 10)
    {
        err[x] = 'Please enter at most 10 characters in the \"bill zip\" field.';
        theForm.billzip1.style.backgroundColor = "#FCB1B1";
        theForm.billzip1.style.borderColor = "#7D1111";
        theForm.billzip1.focus();
        x=x+1;
    }
    
    
	
	if (theForm.shippingType.selectedIndex > 3000) {
    	err[x] = 'Please select a valid shipping type.';
		    theForm.shippingType.style.backgroundColor = "#FCB1B1";
		    theForm.shippingType.style.borderColor = "#7D1111";
		    theForm.shippingType.focus();
	    x=x+1;
    }  
	
     if (theForm.billphonearea.value == "")
    {
        err[x] = 'Please enter a value for the \"bill phone area code\" field.';
        theForm.billphonearea.style.backgroundColor = "#FCB1B1";
        theForm.billphonearea.style.borderColor = "#7D1111";
        theForm.billphonearea.focus();
        x=x+1;
    }
    if (theForm.billphonearea.value.length < 3)
    {
        err[x] = 'Please enter at least 3 characters in the \"bill phone area \" field.';
        theForm.billphonearea.style.backgroundColor = "#FCB1B1";
        theForm.billphonearea.style.borderColor = "#7D1111";
        theForm.billphonearea.focus();
        x=x+1;
    }
   
        if (!numericOnly(theForm.billphonearea.value))
	{
		err[x] = 'Please enter a valid value in the \"bill Phone Area Code\" field.';
		theForm.billphonearea.style.backgroundColor = "#FCB1B1";
		theForm.billphonearea.style.borderColor = "#7D1111";
		theForm.billphonearea.focus();
		x=x+1;
	}
	
	if (!numericOnly(theForm.billphoneprefix.value))
	{
		err[x] = 'Please enter a valid value in the \"bill Phone Prefix\" field.';
		theForm.billphoneprefix.style.backgroundColor = "#FCB1B1";
		theForm.billphoneprefix.style.borderColor = "#7D1111";
		theForm.billphoneprefix.focus();
		x=x+1;
	}
	
	if (!numericOnly(theForm.billphonepostfix.value))
	{
		err[x] = 'Please enter a valid value in the \"bill Phone Postfix\" field.';
		theForm.billphonepostfix.style.backgroundColor = "#FCB1B1";
		theForm.billphonepostfix.style.borderColor = "#7D1111";
		theForm.billphonepostfix.focus();
		x=x+1;
	}
	
    if (theForm.billphoneprefix.value == "")
        {
            err[x] = 'Please enter a value for the \"bill phone prefix\" field.';
            theForm.billphoneprefix.style.backgroundColor = "#FCB1B1";
            theForm.billphoneprefix.style.borderColor = "#7D1111";
            theForm.billphoneprefix.focus();
            x=x+1;
        }
        if (theForm.billphoneprefix.value.length < 3)
        {
            err[x] = 'Please enter at least 3 characters in the \"bill phone prefix \" field.';
            theForm.billphoneprefix.style.backgroundColor = "#FCB1B1";
            theForm.billphoneprefix.style.borderColor = "#7D1111";
            theForm.billphoneprefix.focus();
            x=x+1;
    }
    
    if (theForm.billphonepostfix.value == "")
        {
            err[x] = 'Please enter a value for the \"bill phone s\" field.';
            theForm.billphonepostfix.style.backgroundColor = "#FCB1B1";
            theForm.billphonepostfix.style.borderColor = "#7D1111";
            theForm.billphonepostfix.focus();
            x=x+1;
        }
        if (theForm.billphonepostfix.value.length < 4)
        {
            err[x] = 'Please enter at least 3 characters in the \"bill phone suffix \" field.';
            theForm.billphonepostfix.style.backgroundColor = "#FCB1B1";
            theForm.billphonepostfix.style.borderColor = "#7D1111";
            theForm.billphonepostfix.focus();
            x=x+1;
    }
    
    theForm.billphone.value = theForm.billphonearea.value + theForm.billphoneprefix.value + theForm.billphonepostfix.value
		
    
    if (theForm.cctype.value == "")
	{
	    err[x] = 'Please select the credit card type from the menu.';
	    theForm.cctype.style.backgroundColor = "#FCB1B1";
	    theForm.cctype.style.borderColor = "#7D1111";
	    theForm.cctype.focus();
	    x=x+1;
	}
	if (theForm.ccnumber.value == "")
	{
	    err[x] = 'Please enter a valid credit card number.';
	    theForm.ccnumber.style.backgroundColor = "#FCB1B1";
	    theForm.ccnumber.style.borderColor = "#7D1111";
	    theForm.ccnumber.focus();
	    x=x+1;
	}
	if (theForm.cctype.value == "AmericanExpress")
	{
	    if (theForm.ccnumber.value.length < 15)
	    {
		err[x] = 'American Express cards have 15 digits.  Please enter only 15 digits with no spaces or dashes.';
		theForm.ccnumber.style.backgroundColor = "#FCB1B1";
		theForm.ccnumber.style.borderColor = "#7D1111";
		theForm.ccnumber.focus();
		x=x+1;
	    }
	    if (theForm.ccnumber.value.length > 17)
	    {
		err[x] = 'American Express cards have 15 digits.  Please enter only 15 digits with no spaces or dashes.';
		theForm.ccnumber.style.backgroundColor = "#FCB1B1";
		theForm.ccnumber.style.borderColor = "#7D1111";
		theForm.ccnumber.focus();
		x=x+1;
	    }
	}
	if (theForm.cctype.selectedIndex > 1)
	{
	    if (theForm.ccnumber.value.length < 16)
	    {
		err[x] = 'Visa, Mastercard and Discover cards have 16 digits.  Please enter only 16 digits with no spaces or dashes.';
		theForm.ccnumber.style.backgroundColor = "#FCB1B1";
		theForm.ccnumber.style.borderColor = "#7D1111";
		theForm.ccnumber.focus();
		x=x+1;
	    }
	    if (theForm.ccnumber.value.length > 19)
	    {
		err[x] = 'Visa, Mastercard and Discover cards have 16 digits.  Please enter only 16 digits with no spaces or dashes.';
		theForm.ccnumber.style.backgroundColor = "#FCB1B1";
		theForm.ccnumber.style.borderColor = "#7D1111";
		theForm.ccnumber.focus();
		x=x+1;
	    }
	}
	if (theForm.cccode.value == "")
	{
	    err[x] = 'Please enter your credit card security code. This helps to prevent fraud.';
	    theForm.cccode.style.backgroundColor = "#FCB1B1";
	    theForm.cccode.style.borderColor = "#7D1111";
	    theForm.cccode.focus();
	    x=x+1;
	}
	if (theForm.ccname.value == "")
	{
	    err[x] = 'Please enter card holders full name.';
	    theForm.ccname.style.backgroundColor = "#FCB1B1";
	    theForm.ccname.style.borderColor = "#7D1111";
	    theForm.ccname.focus();
	    x=x+1;
	}
	
	if (theForm.ccMonth.selectedIndex < 1) {
    	err[x] = 'Please select a valid credit card expiration month.';
		    theForm.ccMonth.style.backgroundColor = "#FCB1B1";
		    theForm.ccMonth.style.borderColor = "#7D1111";
		    theForm.ccMonth.focus();
	    x=x+1;
    }
	
	if (theForm.ccYear.selectedIndex < 1) {
    	err[x] = 'Please select a valid credit card expiration year.';
		    theForm.ccYear.style.backgroundColor = "#FCB1B1";
		    theForm.ccYear.style.borderColor = "#7D1111";
		    theForm.ccYear.focus();
	    x=x+1;
    }
                    
            
   	if (x > 0) {
		alertWin(x, err);
		return(false);
    }
    else
    {
        if (sent==0)
        {
	    sent=1;
	    document.getElementById("results").innerHTML = "<font color=white><BR><img src=secure/images/indicator.gif>&nbsp;<B><I>Processing, Do Not Click Button Again..</I></B><BR></font>";	    
        }
    }
}


function resetTextboxes_landing2b(theForm) {
	//payment fields

	theForm.checkbox3.style.backgroundColor = "#FFFFFF";
	theForm.checkbox3.style.borderColor = "#666666"; 
	
	theForm.ccnumber.style.backgroundColor = "#FFFFFF";
	theForm.ccnumber.style.borderColor = "#666666"; 
	theForm.cctype.style.backgroundColor = "#FFFFFF";
	theForm.cctype.style.borderColor = "#666666";   
	theForm.cccode.style.backgroundColor = "#FFFFFF";
	theForm.cccode.style.borderColor = "#666666";   
	theForm.ccname.style.backgroundColor = "#FFFFFF";
	theForm.ccname.style.borderColor = "#666666"; 
	
	theForm.ccMonth.style.backgroundColor = "#FFFFFF";
	theForm.ccMonth.style.borderColor = "#666666";   
	theForm.ccYear.style.backgroundColor = "#FFFFFF";
	theForm.ccYear.style.borderColor = "#666666";   
	
	 theForm.shippingType.style.backgroundColor = "#FFFFFF";
        theForm.shippingType.style.borderColor = "#666666";
	
	theForm.billphonearea.style.backgroundColor = "#FFFFFF";
        theForm.billphonearea.style.borderColor = "#666666";
        theForm.shipphoneprefix.style.borderColor = "#666666";
	theForm.billphoneprefix.style.backgroundColor = "#FFFFFF";
	theForm.billphonepostfix.style.borderColor = "#666666";
	theForm.billphonepostfix.style.backgroundColor = "#FFFFFF";
        theForm.billadd1.style.backgroundColor = "#FFFFFF";
        theForm.billadd2.style.backgroundColor = "#FFFFFF";
        theForm.billzip1.style.backgroundColor = "#FFFFFF";
        theForm.billcity.style.backgroundColor = "#FFFFFF";
        theForm.otherprovence.style.backgroundColor = "#FFFFFF";
        theForm.billadd1.style.borderColor = "#666666";
        theForm.billadd2.style.borderColor = "#666666";
        theForm.billzip1.style.borderColor = "#666666";
        theForm.billcity.style.borderColor = "#666666";

        theForm.otherprovence.style.borderColor = "#666666";
		theForm.fname.style.backgroundColor = "#FFFFFF";
        theForm.fname.style.borderColor = "#666666";
        theForm.lname.style.backgroundColor = "#FFFFFF";
        theForm.lname.style.borderColor = "#666666";

}

var phone_field_length=0;
function TabNext(obj,event,len,next_field) {
	if (event == "down") {
		phone_field_length=obj.value.length;
		}
	else if (event == "up") {
		if (obj.value.length != phone_field_length) {
			phone_field_length=obj.value.length;
			if (phone_field_length == len) {
				next_field.focus();
			}
		}
	}
}

function numericOnly(strString) {
   var strValidChars = "0123456789.-";
   var strChar;
   var blnResult = true;

   if (strString.length == 0) return false;

   //  test strString consists of valid characters listed above
   for (i = 0; i < strString.length && blnResult == true; i++)
	{
	strChar = strString.charAt(i);
	if (strValidChars.indexOf(strChar) == -1)
	 {
	 blnResult = false;
	 }
	}
	return blnResult;
}


//--------------THIS AREA CONTAINS WEB SERVICE CALLS-----------------------------

function validateZipAreaCode(zipcode,phone) {
      // branch for native XMLHttpRequest object
      var url = "backadmin/netfunctions.asmx/getCityStateAreaCode?zipCode=" + zipcode + "&phone=" + phone;
      
      if (window.ActiveXObject) {
          isIE = true;
          req = new ActiveXObject("Microsoft.XMLHTTP");
          if (req) {
            req.onreadystatechange = processWSResponse;
	    req.open("GET", url, true);
            req.send();
          }
      }
      
      else if (window.XMLHttpRequest) {
          req = new XMLHttpRequest();
          req.onreadystatechange = processWSResponse;
          req.open("GET", url, true);
          req.send(null);                  
      } 
      
      
  }
  
   //JL AJAX Billing postal lookup
    function processWSResponse() {
    
        if (req.readyState == 4) {
            if (req.status == 200) {
              response  = req.responseXML.documentElement;
              //if the elements exist then populate, otherwise, blank the values out 
              try 
              {
              	  
                  areacode = response.getElementsByTagName('areacode')[0].firstChild.data;
                  state = response.getElementsByTagName('state')[0].firstChild.data;                  
                  
                  
              }
              catch (error) {
                    alert("Either your zip code or your area code are invalid.  Please enter a valid zip code and area code before continuing.");
                    return(false);
              }
              
              finalizeValidation();  
                         
            } 
            else 
            {
                finalizeValidation();
            }
        }
  }
  
  //JL AJAX Coupon lookup
      function processCouponResponse() {
      
          if (req.readyState == 4) {
              if (req.status == 200) {
                response  = req.responseText;
                //if the elements exist then populate, otherwise, blank the values out 
                try 
                {
                    if (response == "") 
                    {alert('Sorry, the code you entered is not currently valid.');}
                    else {
                          document.getElementById("couponResult").innerHTML = "<b>Congratulations<br />Please select free ground<br />shipping below</b>";
                          
                          if (response.indexOf("FREE") > -1) {
                                document.getElementById("promo").value = "promo";
                          	var elSel = document.getElementById("shippingType");
                          	var elOptNew = document.createElement('option');
				elOptNew.text = 'Free Ground Delivery!';
				elOptNew.value = '141';
				var elOptOld = elSel.options[elSel.selectedIndex];  
				    try {
				      elSel.add(elOptNew, elOptOld); // standards compliant; doesn't work in IE
				    }
				    catch(ex) {
				      elSel.add(elOptNew, elSel.selectedIndex); // IE only
				    }
  			  }
                          
                    }
                }
                catch (error) {
                      alert("A problem occurred reaching our promo engine, sorry for the inconvenience." + error);
                      return(false);
                }
                
              } 
              else 
              {
                  alert("A problem occurred reaching our promo engine, sorry for the inconvenience.");
                  return(false);
              }
          }
  }