function openWindowEmail(url)
{
popupWin = window.open(url,'new_page','width=475,height=350,resizable=1,scrollbars=no');
}

function openWindowLarge(url)
{
popupWin = window.open(url,'new_page','width=700,height=700,resizable=1,scrollbars=no');
}

function openWindowCSC(url)
{
popupWin = window.open(url,'new_page','width=460,height=500,resizable=1,scrollbars=no');
}

function goState(p) 
{ window.location.href = "cart.asp?State="+p; } 

function doClear(theText) 
{
   if (theText.value == theText.defaultValue)
	{
       theText.value = ""
   	}
}

function chkEmail(theForm)
{
    // test if valid email address, must have @ and .
    var checkEmail = "@.";
    var checkStr = theForm.Email.value;
    var EmailValid = false;
    var EmailAt = false;
    var EmailPeriod = false;
    for (i = 0;  i < checkStr.length;  i++)
    {
      ch = checkStr.charAt(i);
      for (j = 0;  j < checkEmail.length;  j++)
    {
    if (ch == checkEmail.charAt(j) && ch == "@")
    EmailAt = true;
    if (ch == checkEmail.charAt(j) && ch == ".")
    EmailPeriod = true;
    	  if (EmailAt && EmailPeriod)
    		break;
    	  if (j == checkEmail.length)
    		break;
    	}
    	// if both the @ and . were in the string
    if (EmailAt && EmailPeriod)
    {
    		EmailValid = true
    		break;
    	}
    }
    if (!EmailValid)
    {
    alert("The \"email\" field must contain an \"@\" and a \".\".");
    theForm.Email.focus();
    return (false);
    }
   return (true);
}



function FillFields(box) {
if(box.checked == false) { return; }

document.FrontPage_Form1.ShipFirstName.value  = document.FrontPage_Form1.FirstName.value;
document.FrontPage_Form1.ShipLastName.value  = document.FrontPage_Form1.LastName.value;

document.FrontPage_Form1.ShipAddress1.value  = document.FrontPage_Form1.Address1.value;
document.FrontPage_Form1.ShipAddress2.value  = document.FrontPage_Form1.Address2.value;
document.FrontPage_Form1.ShipCity.value  = document.FrontPage_Form1.City.value;
document.FrontPage_Form1.ShipState.value = document.FrontPage_Form1.State.value;
document.FrontPage_Form1.ShipPostalCode.value  = document.FrontPage_Form1.PostalCode.value;

document.FrontPage_Form1.ShipCountry.value  = document.FrontPage_Form1.Country.value;
}