<!-- hide script from old browsers
// Copys invoice related details to shipping
 function copyAddress(copyCheck) {
	// Properties
	var regForm=document.forms["regForm"]; // Getting the form object 
	
	if(copyCheck.checked) {
		// if it is checked copy the the details 	
		regForm.busAdd1.value=regForm.add1.value;
		regForm.busAdd2.value=regForm.add2.value;
		regForm.busCity.value=regForm.city.value;
		regForm.busState.value=regForm.state.value;
		regForm.busCountry.value=regForm.country.value;
		regForm.busPcode.value=regForm.pcode.value;
	}
}

function copyAddressAdmin(copyCheck) {
	// Properties
	var regForm=document.forms["addUser"]; // Getting the form object 
	
	if(copyCheck.checked) {
		// if it is checked copy the the details 	
		regForm.busAdd1.value=regForm.addLine1.value;
		regForm.busAdd2.value=regForm.addLine2.value;
		regForm.busCity.value=regForm.city.value;
		regForm.busState.value=regForm.state.value;
		regForm.busCountry.value=regForm.country.value;
		regForm.busPcode.value=regForm.postcode.value;
		regForm.busPhone.value=regForm.phone.value;
	}
}


// Purchase form validation
function checkrequired(which) 
{

	if (document.checkOut.firstName.value == '') 
	{
		alert("Please enter your First Name!");
		document.checkOut.firstName.className="formError";
		document.checkOut.firstName.focus()
		return false;
	}
	if (document.checkOut.lastName.value == '') 
	{
		alert("Please enter your Last name!");
		document.checkOut.firstName.className="";
		document.checkOut.lastName.className="formError";
		document.checkOut.lastName.focus()
		return false;
	}
	
    
	if (document.checkOut.email.value == '') 
	{
		alert("Please enter your Email!");
		document.checkOut.firstName.className="";
		document.checkOut.lastName.className="";
		document.checkOut.email.className="formError";
		document.checkOut.email.focus()
		return false;
	}
	if (echeck(document.checkOut.email.value)==false){
			document.checkOut.firstName.className="";
		    document.checkOut.lastName.className="";
		    document.checkOut.email.value=""
			document.checkOut.email.className="formError";
			document.checkOut.email.focus()
			return false
	}
	
	if (document.checkOut.add1.value == '') 
	{
		alert("Please enter an Address!");
		document.checkOut.firstName.className="";
		document.checkOut.lastName.className="";
		document.checkOut.email.className="";
		document.checkOut.add1.className="formError";
		document.checkOut.add1.focus()
		return false;
	}
	if (document.checkOut.city.value == '') 
	{
		alert("Please enter your City!");
		document.checkOut.firstName.className="";
		document.checkOut.lastName.className="";
		document.checkOut.email.className="";
		document.checkOut.add1.className="";
		document.checkOut.city.className="formError";
		document.checkOut.city.focus()
		return false;
	}
	
	if (document.checkOut.state.value == '') 
	{
		alert("Please select a State/Province!");
		document.checkOut.firstName.className="";
		document.checkOut.lastName.className="";
		document.checkOut.email.className="";
		document.checkOut.add1.className="";
		document.checkOut.city.className="";
		document.checkOut.state.className="formError";
		document.checkOut.state.focus()
		return false;
	}
	
	if (document.checkOut.country.value == '') 
	{
		alert("Please select a Country!");
		document.checkOut.firstName.className="";
		document.checkOut.lastName.className="";
		document.checkOut.email.className="";
		document.checkOut.add1.className="";
		document.checkOut.city.className="";
		document.checkOut.state.className="";
		document.checkOut.country.className="formError";
		document.checkOut.country.focus()
		return false;
	}
	
    if (document.checkOut.pcode.value == '') 
	{
		alert("Please enter your Post / Zip Code!");
		document.checkOut.firstName.className="";
		document.checkOut.lastName.className="";
		document.checkOut.email.className="";
		document.checkOut.add1.className="";
		document.checkOut.city.className="";
		document.checkOut.state.className="";
		document.checkOut.country.className="";
		document.checkOut.pcode.className="formError";
		document.checkOut.pcode.focus()
		return false;
	}
	
	if (document.checkOut.phone.value == '') 
	{
		alert("Please enter phone number!");
		document.checkOut.firstName.className="";
		document.checkOut.lastName.className="";
		document.checkOut.email.className="";
		document.checkOut.add1.className="";
		document.checkOut.city.className="";
		document.checkOut.state.className="";
		document.checkOut.country.className="";
		document.checkOut.pcode.className="";
		document.checkOut.phone.className="formError";
		document.checkOut.phone.focus()
		return false;
	}
	

	
	else
	return true;
}


function echeck(str) {
	
		var at="@"
		var dot="."
		var lat=str.indexOf(at)
		var lstr=str.length
		var ldot=str.indexOf(dot)
		if (str.indexOf(at)==-1){
		   alert("The email address you have entered is not valid\n Please enter a vaild email")
		   return false
		}

		if (str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr){
		   alert("The email address you have entered is not valid\n Please enter a vaild email")
		   return false
		}

		if (str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr){
		    alert("The email address you have entered is not valid\n Please enter a vaild email")
		    return false
		}

		 if (str.indexOf(at,(lat+1))!=-1){
		    alert("The email address you have entered is not valid\n Please enter a vaild email")
		    return false
		 }

		 if (str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot){
		    alert("The email address you have entered is not valid\n Please enter a vaild email")
		    return false
		 }

		 if (str.indexOf(dot,(lat+2))==-1){
		    alert("The email address you have entered is not valid\n Please enter a vaild email")
		    return false
		 }
		
		 if (str.indexOf(" ")!=-1){
		    alert("The email address you have entered is not valid\n Please enter a vaild email")
		    return false
		 }

 		 return true					
	}
	

//finish hiding
-->
