
	function chk_checkout(x) {

		message 	= "Form incomplete, please \n\n";
		submitOK	= "True";

		if (x.Name.value == "")
		{ message += "- Enter your name\n";							submitOK="False"; }
		
		if (x.DeliveryAddress.value == "") 
		{ message += "- Enter your delivery address\n";					submitOK="False"; }
		
		if (x.PostCode.value == "") 
		{ message += "- Enter your delivery postcode\n";				submitOK="False"; }

		if (x.Country.value == "") 
		{ message += "- Select your country\n";						submitOK="False"; }

		if (x.Country.value == "us") 
		{
			//alert(x.State.value);
			if (x.State.value == "")
			{ message += "- Select your state\n";						submitOK="False"; }
		}

		if (x.Telephone.value == "") 
		{ message += "- Enter your telephone number\n";					submitOK="False"; }

		if (!isValidEmail (x.EmailAddress.value)) 
		{ message += "- Enter a correct email address\n";				submitOK="False"; }
		
		if (submitOK=="False")
			{ alert(message); return false; }
		/*
		if (!chksel (x.DeliveryDetails))
		{ message += "- Enter your delivery details\n";					submitOK="False"; }
		
		if (x.HowFoundSite.value == "Other Search Engine" && x.Which.value == "Which: ") {
			alert ("For our information, please could you let us know which search engine led you to this site.");
			return false;
		}


		if (x.HowFoundSite.value == "Publication" && x.Which.value == "Which: ") {
			alert ("For our information, please could you let us know which magazine publication led you to this site.");
			return false;
		}


		if (x.HowFoundSite.value != "Publication" && 
			x.HowFoundSite.value != "Other Search Engine")
					x.Which.value = "Which: ";
		*/
		return true;

	} <!-- end of function -->




	function isValidEmail(address) {

		if (address.indexOf('@') < 2) return false;

		var period = address.indexOf('.');

		if (period == -1) return false;

		var name = address.substring(0, address.indexOf('@'));
		var domain = address.substring(address.indexOf('@') + 1);

		if (name.indexOf('(') != -1 || name.indexOf(')') != -1 || name.indexOf('<') != -1 || name.indexOf('>') != -1
		|| name.indexOf(',') != -1 || name.indexOf(';') != -1 || name.indexOf(':') != -1 || name.indexOf('\\') != -1 
		|| name.indexOf('"') != -1 || name.indexOf('[') != -1 || name.indexOf(']') != -1 || name.indexOf(' ') != -1)
			 return false;

		if (domain.indexOf('(') != -1 || domain.indexOf(')') != -1 || domain.indexOf('<') != -1
		|| domain.indexOf('>') != -1
		|| domain.indexOf(',') != -1 || domain.indexOf(';') != -1 || domain.indexOf(':') != -1 
		|| domain.indexOf('\\') != -1 || domain.indexOf('"') != -1 || domain.indexOf('[') != -1 
		|| domain.indexOf(']') != -1 || domain.indexOf(' ') != -1) 
			return false;

	return true;

	} <!-- end of function -->




	function chksel (x) {

		var boxLength 			= x.length;
		var v					= "";
		var ov				= "";

		for (i = 0; i < boxLength; i++) {

			if (x.options[i].selected && x.options[i].value != "0")
				return true; 
		}

		return false;

	} <!-- end of function -->

	function show_state()
	{
		if(document.formX.Country[document.formX.Country.selectedIndex].value == "us")
		{
			document.getElementById('us_state').style.display="inline";
		}
		else
		{
			document.getElementById('us_state').style.display="none";
		}
	}
