function CheckWP_registration()
{
	theFrm = document.frmSS;
	hasDot = theFrm.Field_Email.value.indexOf(".");
	hasAt = theFrm.Field_Email.value.indexOf("@");

	if (hasDot == -1 || hasAt == -1)
	{
		alert("Please enter a valid email address.");
		theFrm.Field_Email.focus();
		theFrm.Field_Email.select();
		return false;
	}

	valcheck1 = theFrm.Field_Email.value;
	valcheck2 = theFrm.emailconfirm.value;

	if (valcheck1 != valcheck2)
	{
		alert("Please confirm your email address and check it is correct.");
		alert(valcheck1);
		theFrm.emailconfirm.focus();
		theFrm.emailconfirm.select();
		return false;
	}				
	valcheck = document.getElementById("Field_Firstname");
	if (valcheck.value == "") {
		alert("Please enter a value for the 'First name' field.");
		valcheck.focus();
		valcheck.select();
		return false;
	}
	else {
		var minsize_3 = 1;
		var maxsize_3 = 100;
		var fieldlength = 0;
		fieldlength = valcheck.value.length;
		if (fieldlength < minsize_3) {
			alert("You must enter a value for the 'First name' field longer than " + minsize_3 + " characters");
			valcheck.focus();
			return false;
		}
		if (fieldlength > maxsize_3) {
			alert("You must enter a value for the 'First name' field no longer than " + maxsize_3 + " characters");
			valcheck.focus();
			return false;
		}
	}

	valcheck = document.getElementById("Field_Surname");
	if (valcheck.value == "") {
		alert("Please enter a value for the 'Surname' field.");
		valcheck.focus();
		valcheck.select();
		return false;
	}
	else {
		var minsize_4 = 1;
		var maxsize_4 = 100;
		var fieldlength = 0;
		fieldlength = valcheck.value.length;
		if (fieldlength < minsize_4) {
			alert("You must enter a value for the 'Surname' field longer than " + minsize_4 + " characters");
			valcheck.focus();
			return false;
		}
		if (fieldlength > maxsize_4) {
			alert("You must enter a value for the 'Surname' field no longer than " + maxsize_4 + " characters");
			valcheck.focus();
			return false;
		}
	}						

	valcheck = document.getElementById("Field_Company");
	if (valcheck.value == "") {
		alert("Please enter a value for the 'Company' field.");
		valcheck.focus();
		valcheck.select();
		return false;
	}
	else {
		var minsize_1 = 0;
		var maxsize_1 = 100;
		var fieldlength = 0;
		fieldlength = valcheck.value.length;
		if (fieldlength < minsize_1) {
			alert("You must enter a value for the 'Company' field longer than " + minsize_1 + " characters");
			valcheck.focus();
			return false;
		}
		if (fieldlength > maxsize_1) {
			alert("You must enter a value for the 'Company' field no longer than " + maxsize_1 + " characters");
			valcheck.focus();
			return false;
		}
	}

	valcheck = document.getElementById("Field_Business");
	var realVal = valcheck[valcheck.selectedIndex].value;
	if(valcheck.selectedIndex == 0 || realVal == ""){
		alert("Please enter a value for the 'Business Type' field.");
		valcheck.focus();
		return false;
	}

	valcheck = document.getElementById("Field_Country");
	var realVal = valcheck[valcheck.selectedIndex].value;
	if(valcheck.selectedIndex == 0 || realVal == ""){
		alert("Please enter a value for the 'Country' field.");
		valcheck.focus();
		return false;
	}

	return true;
}

function CheckWP_login()
{
	theFrm = document.loginWP;
	hasDot = theFrm.email.value.indexOf(".");
	hasAt = theFrm.email.value.indexOf("@");

	if (hasDot == -1 || hasAt == -1)
	{
		alert("Please enter a valid email address.");
		theFrm.email.focus();
		theFrm.email.select();
		return false;
	}

	return true;
}
