// File created by Tristan Mcvean
// Date: 17.07.05 
function ValidateBuyForm() {

if (document.fPricing.Total.value==0.00)
	{alert("Please enter numbers in the above licensing options before continue with your order!");
	return false;
	}

if (!document.fPricing.accountType[0].checked && !document.fPricing.accountType[1].checked)
	{alert("Please select whether you are adding to an existing account or creating a new account!");
	return false;
	}
	
if (document.fPricing.accountType[0].checked)
	{document.forms[0].action = 'buy-ringcad-engagement-ring-design-software3.asp';
	document.forms[0].submit()
	}
	else
	{document.forms[0].action = 'buy-ringcad-engagement-ring-design-software2.asp';
	document.forms[0].submit()
	}
}

function ValidateBuy2Form() {
	
	if (document.fPricing.Email.value=="")
	{alert("Please enter the Email address you used when you ordered a License before!");
	document.fPricing.Email.focus();
	return false;
	}
	
	if (document.fPricing.Email.value != "") {
		if (!(document.fPricing.Email.value.match(/^(\w|\.|\d|\,|-)+@((\w|\d|\,|-)+\.)+((\w|\d|,|-)+)$/i))) {
		   window.alert("Please enter a valid Email address, eg. name@myisp.com!");
		   document.fPricing.Email.focus();
		return false;
		}
	}
	
	if (document.fPricing.Password.value=="")
	{alert("Please enter the Password you used when you ordered a License before. If you have forgotten your Password, simply enter your Email address in the Email box and your Password will be sent to that Email address!");
	document.fPricing.Password.focus();
	return false;
	}
	
	document.forms[0].action = 'getaccount.asp';
 	document.forms[0].submit()

}

function ValidateBuy3Form() {
	
	if (document.fPricing.Title.value=="")
	{alert("Please enter your Title!");
	document.fPricing.Title.focus();
	return false;
	}
	if (document.fPricing.FirstName.value=="")
	{alert("Please enter your First Name!");
	document.fPricing.FirstName.focus();
	return false;
	}
	if (document.fPricing.LastName.value=="")
	{alert("Please enter your Last Name!");
	document.fPricing.LastName.focus();
	return false;
	}
	if (document.fPricing.Address1.value=="")
	{alert("Please enter the First Line of your Address!");
	document.fPricing.Address1.focus();
	return false;
	}
	if (document.fPricing.TownCity.value=="")
	{alert("Please enter the Town or City of your Address!");
	document.fPricing.TownCity.focus();
	return false;
	}
	if (document.fPricing.CountyState.value=="")
	{alert("Please enter the County or State of your Address!");
	document.fPricing.CountyState.focus();
	return false;
	}
	if (document.fPricing.PostcodeZip.value=="")
	{alert("Please enter the Postcode or Zip of your Address!");
	document.fPricing.PostcodeZip.focus();
	return false;
	}
	if (document.fPricing.Country.value=="")
	{alert("Please enter the Country you are from!");
	document.fPricing.Country.focus();
	return false;
	}
	if (document.fPricing.Telephone.value=="")
	{alert("Please enter your Telephone Number!");
	document.fPricing.Telephone.focus();
	return false;
	}
	if (document.fPricing.Email.value=="")
	{alert("Please enter your Email Address. You will be Emailed your Serial Key and a link to download Ringcad!");
	document.fPricing.Email.focus();
	return false;
	}
	if (document.fPricing.Email.value != "") {
		if (!(document.fPricing.Email.value.match(/^(\w|\.|\d|\,|-)+@((\w|\d|\,|-)+\.)+((\w|\d|,|-)+)$/i))) {
		   window.alert("Please enter a valid Email Address, eg. myname@myisp.com");
		   document.fPricing.Email.focus();
		   return false;
	   }
	}
	if (document.fPricing.RepeatEmail.value=="")
	{alert("Please confirm your Email. This will ensure your Email is correct. You will be Emailed your Serial Key and a link to download Ringcad!");
	document.fPricing.RepeatEmail.focus();
	return false;
	}
	if (document.fPricing.RepeatEmail.value != "") {
		if (!(document.fPricing.RepeatEmail.value.match(/^(\w|\.|\d|\,|-)+@((\w|\d|\,|-)+\.)+((\w|\d|,|-)+)$/i))) {
		   window.alert("Please confirm a valid Email Address, eg. myname@myisp.com");
		   document.fPricing.RepeatEmail.focus();
		   return false;
	   }	
	}
	if ((document.fPricing.Email.value != document.fPricing.RepeatEmail.value))
	{
		alert("The two Email Addresses do not match!");
		return false;
	}
	if (document.fPricing.Password.value=="")
	{alert("Please enter a Password. This will make it quicker to order Ringcad in future!");
	document.fPricing.Password.focus();
	return false;
	}
	if (document.fPricing.RepeatPassword.value=="")
	{alert("Please confirm your Password. This will ensure your Password is correct and will make it quicker to order Ringcad in future!");
	document.fPricing.RepeatPassword.focus();
	return false;
	}
	if ((document.fPricing.Password.value != document.fPricing.RepeatPassword.value))
	{
		alert("The two Passwords do not match!");
		return false;
	}
	if (!document.fPricing.internet.checked && document.fPricing.magazine.value=="" && !document.fPricing.shop.checked && !document.fPricing.friend.checked && !document.fPricing.exhibition.checked && document.fPricing.other.value=="")
	{alert("To help us with future marketing in order to produce better products and services, Please tell us how you heard about us!");
	return false;
	}
	
	document.forms[0].action = 'addorder.asp';
 	document.forms[0].submit()

}

function ForgotPassword() {
	
	if (document.fPricing.Email.value=="")
	{alert("Please enter the Email address you used when you ordered a License before. The Password will automatically be sent to that Email address!");
	document.fPricing.Email.focus();
	return false;
	}
	
	if (document.fPricing.Email.value != "") {
		if (!(document.fPricing.Email.value.match(/^(\w|\.|\d|\,|-)+@((\w|\d|\,|-)+\.)+((\w|\d|,|-)+)$/i))) {
		   window.alert("Please enter a valid Email address, eg. myname@myisp.com. The Password will automatically be sent to that Email address!");
		   document.fPricing.Email.focus();
		return false;
		}
	}
	
	document.forms[0].action = 'forgottenpassword.asp';
 	document.forms[0].submit()

}

function ValidateConfirmDetails() {
	
	if (document.fPricing.Title.value=="")
	{alert("Please enter your Title!");
	document.fPricing.Title.focus();
	return false;
	}
	if (document.fPricing.FirstName.value=="")
	{alert("Please enter your First Name!");
	document.fPricing.FirstName.focus();
	return false;
	}
	if (document.fPricing.LastName.value=="")
	{alert("Please enter your Last Name!");
	document.fPricing.LastName.focus();
	return false;
	}
	if (document.fPricing.Address1.value=="")
	{alert("Please enter the First Line of your Address!");
	document.fPricing.Address1.focus();
	return false;
	}
	if (document.fPricing.TownCity.value=="")
	{alert("Please enter the Town or City of your Address!");
	document.fPricing.TownCity.focus();
	return false;
	}
	if (document.fPricing.CountyState.value=="")
	{alert("Please enter the County or State of your Address!");
	document.fPricing.CountyState.focus();
	return false;
	}
	if (document.fPricing.PostcodeZip.value=="")
	{alert("Please enter the Postcode or Zip of your Address!");
	document.fPricing.PostcodeZip.focus();
	return false;
	}
	if (document.fPricing.Country.value=="")
	{alert("Please enter the Country you are from!");
	document.fPricing.PostcodeZip.focus();
	return false;
	}
	if (document.fPricing.Telephone.value=="")
	{alert("Please enter your Telephone Number!");
	document.fPricing.Telephone.focus();
	return false;
	}
	if (document.fPricing.Email.value=="")
	{alert("Please enter your Email Address. You will be Emailed your Serial Key and a link to download Ringcad!");
	document.fPricing.Email.focus();
	return false;
	}
	if (document.fPricing.Email.value != "") {
		if (!(document.fPricing.Email.value.match(/^(\w|\.|\d|\,|-)+@((\w|\d|\,|-)+\.)+((\w|\d|,|-)+)$/i))) {
		   window.alert("Please enter a valid Email Address, eg. myname@myisp.com");
		   document.fPricing.Email.focus();
		   return false;
	   }
	}
	
	document.forms[0].action = 'confirmaddorder.asp';
 	document.forms[0].submit()
	
}

function UpdateDetails() {
	
	if (document.fPricing.Title.value=="")
	{alert("Please enter your Title!");
	document.fPricing.Title.focus();
	return false;
	}
	if (document.fPricing.FirstName.value=="")
	{alert("Please enter your First Name!");
	document.fPricing.FirstName.focus();
	return false;
	}
	if (document.fPricing.LastName.value=="")
	{alert("Please enter your Last Name!");
	document.fPricing.LastName.focus();
	return false;
	}
	if (document.fPricing.Address1.value=="")
	{alert("Please enter the First Line of your Address!");
	document.fPricing.Address1.focus();
	return false;
	}
	if (document.fPricing.TownCity.value=="")
	{alert("Please enter the Town or City of your Address!");
	document.fPricing.TownCity.focus();
	return false;
	}
	if (document.fPricing.CountyState.value=="")
	{alert("Please enter the County or State of your Address!");
	document.fPricing.CountyState.focus();
	return false;
	}
	if (document.fPricing.PostcodeZip.value=="")
	{alert("Please enter the Postcode or Zip of your Address!");
	document.fPricing.PostcodeZip.focus();
	return false;
	}
	if (document.fPricing.Country.value=="")
	{alert("Please enter the Country you are from!");
	document.fPricing.PostcodeZip.focus();
	return false;
	}
	if (document.fPricing.Telephone.value=="")
	{alert("Please enter your Telephone Number!");
	document.fPricing.Telephone.focus();
	return false;
	}
	if (document.fPricing.Email.value=="")
	{alert("Please enter your Email Address. You will be Emailed your Serial Key and a link to download Ringcad!");
	document.fPricing.Email.focus();
	return false;
	}
	if (document.fPricing.Email.value != "") {
		if (!(document.fPricing.Email.value.match(/^(\w|\.|\d|\,|-)+@((\w|\d|\,|-)+\.)+((\w|\d|,|-)+)$/i))) {
		   window.alert("Please enter a valid Email Address, eg. myname@myisp.com");
		   document.fPricing.Email.focus();
		   return false;
	   }
	}
	
	document.forms[0].action = 'updatedetails.asp';
 	document.forms[0].submit()
	
}

function NewAccount() {
	
	document.forms[0].action = 'buy-ringcad-engagement-ring-design-software3.asp';
 	document.forms[0].submit()
	
}

function Login() {
	
	document.fPricing.action = 'buy-ringcad-engagement-ring-design-software2.asp';
 	document.fPricing.submit()
	
}