function Checkform(theForm)
	{
	strError = 'The field(s): \n\n';
	strErrorEnd = '\n\n must not be blank.';
	intError = 0;
	field = '';
	for (i=0; i<theForm.elements.length; i++)
		{
		if (theForm.elements[i].name.substring(0,5)=="field" && theForm.elements[i].value=="" && theForm.elements[i].value==0)
			{
			intError=1;
			field+=theForm.elements[i].name.substring(5)+"\n";
			}
		if (theForm.elements[i].name=="fieldFirstName" && theForm.elements[i].value=="First name")
			{
			intError=1;
			field+="First name"+"\n";
			}
		if (theForm.elements[i].name=="fieldLastName" && theForm.elements[i].value=="Surname")
			{
			intError=1;
			field+="Surname"+"\n";
			}
		if (theForm.elements[i].name=="Positions" && theForm.elements[i].value=="")
			{
			intError=1;
			field+="Position(s) Sought"+"\n";
			}
		if (theForm.elements[i].name=="Centres" && theForm.elements[i].value=="")
			{
			intError=1;
			field+="Centres Interested In"+"\n";
			}
		if (theForm.elements[i].name=="rte1" && theForm.elements[i].value=="")
			{
			intError=1;
			field+="Message"+"\n";
			}
		if (theForm.elements[i].name=="fieldName" && theForm.elements[i].value=="Full Name")
			{
			intError=1;
			field+="Full Name"+"\n";
			}
		}
	if(intError==1)
		{
		alert(strError+field+strErrorEnd);
		return false;
		}
	}

function CheckformWithPassword(theForm)
	{
	strError = 'The field(s): \n';
	strErrorEnd = 'must not be blank.\n\n';
	intError = 0;
	field = '';
	alertField1 = '';
	alertField2 = '';
	for (i=0; i<theForm.elements.length; i++)
		{
		if (theForm.elements[i].name.substring(0,5)=="field" && theForm.elements[i].value=="" && theForm.elements[i].value==0)
			{
			intError=1;
			field+="   "+theForm.elements[i].name.substring(5)+"\n";
			}
		}
	if(intError==1)
		{
		alertField1 = strError+field+strErrorEnd;
		}
	if (theForm.fieldPassword1.value!=theForm.fieldPassword2.value)
		{
		intError=1;
		alertField2="The passwords are not equal";
		}
	if(intError==1)
		{
		alert(alertField1+alertField2);
		return false;
		}
	}

function CheckformWithPasswordAndMail(theForm)
	{
	var x = theForm.fieldEmail.value;
	var filter  = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;
	strError = 'The field(s): \n';
	strErrorEnd = 'must not be blank.\n\n';
	intError = 0;
	field = '';
	alertField1 = '';
	alertField2 = '';
	alertField3 = '';
	for (i=0; i<theForm.elements.length; i++)
		{
		if (theForm.elements[i].name.substring(0,5)=="field" && theForm.elements[i].value=="" && theForm.elements[i].value==0)
			{
			intError=1;
			field+="   "+theForm.elements[i].name.substring(5)+"\n";
			}
		}
	if(intError==1)
		{
		alertField1 = strError+field+strErrorEnd;
		}
	if (theForm.fieldPassword1.value!=theForm.fieldPassword2.value)
		{
		intError=1;
		alertField2="The passwords are not equal.\n\n";
		}
	if (!(filter.test(x)))
		{
		intError=1;
		alertField3="Incorrect Email address!\n\n";
		}
	if(intError==1)
		{
		alert(alertField3+alertField2+alertField1);
		return false;
		}
	}

function CheckformWithMail(theForm)
	{
	var x = theForm.fieldEmail.value;
	var filter  = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;
	strError = 'The field(s): \n';
	strErrorEnd = 'must not be blank.\n\n';
	intError = 0;
	field = '';
	alertField1 = '';
	alertField2 = '';
	alertField3 = '';
	for (i=0; i<theForm.elements.length; i++)
		{
		if (theForm.elements[i].name.substring(0,5)=="field" && theForm.elements[i].value=="" && theForm.elements[i].value==0)
			{
			intError=1;
			field+="   "+theForm.elements[i].name.substring(5)+"\n";
			}
		}
	if(intError==1)
		{
		alertField1 = strError+field+strErrorEnd;
		}
	if (!(filter.test(x)))
		{
		intError=1;
		alertField3="Incorrect Email address!\n\n";
		}
	if(intError==1)
		{
		alert(alertField3+alertField2+alertField1);
		return false;
		}
	}

function clearField(theField)
	{
	if (theField.defaultValue==theField.value)
		theField.value = ""
	}