
function FrontPage_Form1_Validator(theForm)
{
	var isEdit = false;
	if(theForm.editMode != null && theForm.editMode.value == "1")
		isEdit = true;
	if(!isEdit)
	{
		if (theForm.txt_user_email.value == "")
		{
			alert("Please enter a value for the \"Email\" field.");
			theForm.txt_user_email.focus();
			return (false);
		}
		if (theForm.txt_user_password.value == "")
		{
			alert("The password do not match. Please enter your preferred password in the 2 boxes below.");
			theForm.txt_user_password.focus();
			return (false);
		}
		if (theForm.txt_user_password_repeat.value == "" || theForm.txt_user_password_repeat.value!=theForm.txt_user_password.value)
		{
			alert("The password do not match. Please enter your preferred password in the 2 boxes below.");
			theForm.txt_user_password.focus();
			return (false);
		}
	}
	
	if (theForm.txt_forename.value == "")
	{
		alert("Please enter a value for the \"Forename\" field.");
		theForm.txt_forename.focus();
		return (false);
	}

	if (theForm.txt_surname.value == "")
	{
		alert("Please enter a value for the \"Surname\" field.");
		theForm.txt_surname.focus();
		return (false);
	}
		
	if (theForm.txt_job.value == "")
	{
		alert("Please enter a value for the \"Job title\" field.");
		theForm.txt_job.focus();
		return (false);
	}

	if (theForm.txt_addr1.value == "")
	{
		alert("Please enter a value for the \"Address 1\" field.");
		theForm.txt_addr1.focus();
		return (false);
	}

	if (theForm.txt_town.value == "")
	{
		alert("Please enter a value for the \"Town\" field.");
		theForm.txt_town.focus();
		return (false);
	}

	if (theForm.txt_postcode.value == "")
	{
		alert("Please enter a value for the \"Postcode\" field.");
		theForm.txt_postcode.focus();
		return (false);
	}

	if (document.getElementById('ddl_country').selectedIndex < 1)
	{
		alert("Please select one of the \"Country\" options.");
		document.getElementById('ddl_country').focus();
		return (false);
	}

	if (theForm.txt_tel.value == "") {
	    alert("Please enter a value for the \"Telephone\" field.");
	    theForm.txt_postcode.focus();
	    return (falsetxt_tel
	}
	
	eturn true;

}

function ValidateDemo(theForm) {
	return true;
}		

function ShowHideEmailForm()
{
	dpa = document.getElementById('mzemail_a9901_canemail');
	
	ctrl = document.getElementById('emailformat');
	if(dpa.checked)
		ctrl.style.display = 'block';
	else
		ctrl.style.display = 'none';

}

function ShowHideDss03(ddl)
{
	if(ddl.selectedIndex == ddl.options.length - 1)
	{
		document.getElementById('dss04_heard_t0499').disabled = false;
		document.getElementById('dss04_other').style.display = 'block';
	}
	else
	{
		document.getElementById('dss04_heard_t0499').disabled = true;
		document.getElementById('dss04_other').style.display = 'none';
	}
}

function disable(id) {
	document.getElementById(id).disabled = true;
}

function changeType(typeId) {
	document.getElementById("contTypeId").value = typeId;
}
