var returnValue = false;

function changeurl(url){
	location.href=url;
}

/* validation for New Letter sign up form */
function subValidation(){	
	if(document.GRSubscribeForm.category2.value == ""){
		alert("Please enter you name in 'Name' field.");		
		document.GRSubscribeForm.category2.focus();
	}else if(document.GRSubscribeForm.category3.value == ""){
		alert("Please enter you email id in 'Email' field.");		
		document.GRSubscribeForm.category3.focus();
	}else{
		returnValue = true;
	}
	return returnValue;
}

function copyFields() {
	if(document.frmcheckout.cf.checked){
		document.frmcheckout.ch1.value = document.frmcheckout.FirstName.value;
		document.frmcheckout.ch2.value = document.frmcheckout.LastName.value;
		document.frmcheckout.BillingAddress1.value = document.frmcheckout.ShippingAddress1.value;
		document.frmcheckout.BillingAddress2.value = document.frmcheckout.ShippingAddress2.value;
		document.frmcheckout.BillingCity.value = document.frmcheckout.ShippingCity.value;
		document.frmcheckout.BillingState.value = document.frmcheckout.ShippingState.value;
		document.frmcheckout.BillingCountry.value = document.frmcheckout.ShippingCountry.value;
		document.frmcheckout.BillingZip.value = document.frmcheckout.ShippingZip.value;
		document.frmcheckout.BillingPhone.value = document.frmcheckout.ShippingPhone.value;
	}else{
		document.frmcheckout.ch1.value = "";
		document.frmcheckout.ch2.value = "";
		document.frmcheckout.BillingAddress1.value = "";
		document.frmcheckout.BillingAddress2.value = "";
		document.frmcheckout.BillingCity.value = "";
		document.frmcheckout.BillingState.value = "";
		document.frmcheckout.BillingCountry.value = "";
		document.frmcheckout.BillingZip.value = "";
		document.frmcheckout.BillingPhone.value = "";
	}
}

function CheckThis() 
{

	if(document.frmcheckout.FirstName.value=="")
	{
		alert("Enter your first name, please!");
		document.frmcheckout.FirstName.focus();
		return false;
	}

	if(document.frmcheckout.LastName.value=="")
	{
		alert("Enter your last name, please!");
		document.frmcheckout.LastName.focus();
		return false;
	}

	if(document.frmcheckout.ShippingAddress1.value=="")
	{
		alert("Enter the shipping address, please!");
		document.frmcheckout.ShippingAddress1.focus();
		return false;
	}

	if(document.frmcheckout.ShippingCity.value=="")
	{
		alert("Enter the shipping city, please!");
		document.frmcheckout.ShippingCity.focus();
		return false;
	}

	
	if(document.frmcheckout.ShippingCountry.value=="")
	{
		alert("Enter the shipping country, please!");
		document.frmcheckout.ShippingCountry.focus();
		return false;
	}

	if(document.frmcheckout.ShippingZip.value=="")
	{
		alert("Enter the shipping destination zip code, please!");
		document.frmcheckout.ShippingZip.focus();
		return false;
	}

	if(document.frmcheckout.ShippingPhone.value=="")
	{
		alert("Enter the shipping phone, please!");
		document.frmcheckout.ShippingPhone.focus();
		return false;
	}

	if(document.frmcheckout.ch1.value=="")
	{
		alert("Enter the credit card holder's first name, please!");
		document.frmcheckout.ch1.focus();
		return false;
	}

	if(document.frmcheckout.ch2.value=="")
	{
		alert("Enter the credit card holder's last name, please!");
		document.frmcheckout.ch2.focus();
		return false;
	}

	if(document.frmcheckout.BillingAddress1.value=="")
	{
		alert("Enter the billing address, please!");
		document.frmcheckout.BillingAddress1.focus();
		return false;
	}

	if(document.frmcheckout.BillingCity.value=="")
	{
		alert("Enter the billing city, please!");
		document.frmcheckout.BillingCity.focus();
		return false;
	}

	

	if(document.frmcheckout.BillingCountry.value=="")
	{
		alert("Enter the billing country, please!");
		document.frmcheckout.BillingCountry.focus();
		return false;
	}

	if(document.frmcheckout.BillingZip.value=="")
	{
		alert("Enter the billing address zip code, please!");
		document.frmcheckout.BillingZip.focus();
		return false;
	}

	if(document.frmcheckout.BillingPhone.value=="")
	{
		alert("Enter the card holder's phone number, please!");
		document.frmcheckout.BillingPhone.focus();
		return false;
	}

	if(document.frmcheckout.YourEmail.value=="")
	{
		alert("Enter your email address, please!\n\nWe will send you a receipt.");
		document.frmcheckout.YourEmail.focus();
		return false;
	}

}

function CheckThis2() 
{
	if(document.frmcheckout.CFirstName.value=="")
	{
		alert("Enter your first name, please!");
		document.frmcheckout.CFirstName.focus();
		return false;
	}

	if(document.frmcheckout.CLastName.value=="")
	{
		alert("Enter your last name, please!");
		document.frmcheckout.CLastName.focus();
		return false;
	}

	if(document.frmcheckout.CAddress.value=="")
	{
		alert("Enter the Address, please!");
		document.frmcheckout.CAddress.focus();
		return false;
	}
	if(document.frmcheckout.CState.value=="")
	{
		alert("Enter your State, please!");
		document.frmcheckout.CState.focus();
		return false;
	}

	if(document.frmcheckout.Czip.value=="")
	{
		alert("Enter your Zipcode, please!");
		document.frmcheckout.Czip.focus();
		return false;
	}

	if(document.frmcheckout.cc_num.value=="")
	{
		alert("Enter the Credit Card Number, please!");
		document.frmcheckout.cc_num.focus();
		return false;
	}
	if(isNaN(document.frmcheckout.cc_num.value))
	{
		alert("Enter the Credit Card Number, please!");
		document.frmcheckout.cc_num.focus();
		return false;
	}
	
	if(document.frmcheckout.cardcode.value=="")
	{
		alert("Enter your Card Code, please!");
		document.frmcheckout.cardcode.focus();
		return false;
	}
	if(document.frmcheckout.month.value=="" || document.frmcheckout.year.value=="")
	{
		alert("Select Card Expiration Date, please!");
		document.frmcheckout.month.focus();
		return false;
	}
	
	return true
}
