function ValidateLogin(){
	var LoginFORM = eval("document.LoginForm");
	LoginFORM.eMail.style.backgroundColor="";
	LoginFORM.Password.style.backgroundColor="";
	if(!ValidateeMail(LoginFORM.eMail.value)){
		LoginFORM.eMail.style.backgroundColor="#FFC0C0";
		alert("ERROR: Invalid eMail Address\n\nPlease enter a valid eMail address.");
		LoginFORM.eMail.select();
		return false;
	}
	if(LoginFORM.Password.value.length<2){
		LoginFORM.Password.style.backgroundColor="#FFC0C0";
		alert("ERROR: Invalid Password\n\nPlease enter a valid password.");
		LoginFORM.Password.select();
		return false;
	}
	//document.ProcessingImage_Login.style.visibility="Visible";
	LoginFORM.ButtonLogin.style.cursor="Wait";
	LoginFORM.ButtonLogin.value="Logging In";
	LoginFORM.ButtonLogin.disabled=true;
	LoginFORM.action="login.php";
	LoginFORM.Process.value="Login";
	setTimeout("document.LoginForm.submit();",1000);
}

function ValidateRegister(){
	var RegisterFORM = eval("document.RegisterForm");
	RegisterFORM.OwnersName.style.backgroundColor="";
	RegisterFORM.ContactsName.style.backgroundColor="";
	RegisterFORM.LabName.style.backgroundColor="";
	RegisterFORM.LabAddress.style.backgroundColor="";
	RegisterFORM.PostCode.style.backgroundColor="";
	RegisterFORM.Phone.style.backgroundColor="";
	RegisterFORM.eMail.style.backgroundColor="";
	//RegisterFORM.Image1.style.backgroundColor="";
	//RegisterFORM.Image2.style.backgroundColor="";
	if(RegisterFORM.OwnersName.value.length<5){
		RegisterFORM.OwnersName.style.backgroundColor="#FFC0C0";
		alert("ERROR: Owner's Full Name Missing\n\nPlease enter the owner's full name.");
		RegisterFORM.OwnersName.select();
		return false;
	}
	if(RegisterFORM.ContactsName.value.length<5){
		RegisterFORM.ContactsName.style.backgroundColor="#FFC0C0";
		alert("ERROR: Daily Contact Name Missing\n\nPlease enter the daily contact name.\n\nThis may be the same as the Owner's Name.");
		RegisterFORM.ContactsName.select();
		return false;
	}
	if(RegisterFORM.LabName.value.length<3){
		RegisterFORM.LabName.style.backgroundColor="#FFC0C0";
		alert("ERROR: Laboratory Name Missing\n\nPlease enter the Laboratory Name.");
		RegisterFORM.LabName.select();
		return false;
	}
	if(RegisterFORM.LabAddress.value.length<20){
		RegisterFORM.LabAddress.style.backgroundColor="#FFC0C0";
		alert("ERROR: Laboratory Address Missing\n\nPlease enter the Laboratory Address.");
		RegisterFORM.LabAddress.select();
		return false;
	}
	if(RegisterFORM.PostCode.value.length<5){
		RegisterFORM.PostCode.style.backgroundColor="#FFC0C0";
		alert("ERROR: Laboratory Post Code Missing\n\nPlease enter the Laboratory Post Code.");
		RegisterFORM.PostCode.select();
		return false;
	}
	if(RegisterFORM.Phone.value.length<10){
		RegisterFORM.Phone.style.backgroundColor="#FFC0C0";
		alert("ERROR: Laboratory Phone Missing\n\nPlease enter the Laboratory Phone Number.");
		RegisterFORM.Phone.select();
		return false;
	}
	if(!ValidateeMail(RegisterFORM.eMail.value)){
		RegisterFORM.eMail.style.backgroundColor="#FFC0C0";
		alert("ERROR: Invalid eMail Address\n\nPlease enter a valid eMail address.\n\nYour eMail address will be your login name so please ensure you enter it correctly.");
		RegisterFORM.eMail.select();
		return false;
	}

//	if(RegisterFORM.Password1.value.length<2){
//		RegisterFORM.Password1.style.backgroundColor="#FFC0C0";
//		alert("ERROR: Invalid Password\n\nPlease enter a longer password.");
//		RegisterFORM.Password1.select();
//		return false;
//	}
//	if(RegisterFORM.Password1.value!=RegisterFORM.Password2.value){
//		RegisterFORM.Password1.style.backgroundColor="#FFC0C0";
//		RegisterFORM.Password2.style.backgroundColor="#FFC0C0";
//		alert("ERROR: Passwords Don't Match\n\nThe two passwords you entered are not the same. Please try again.");
//		RegisterFORM.Password1.select();
//		return false;
//	}
//	if(RegisterFORM.Image1.options[RegisterFORM.Image1.selectedIndex].value==""){
//		RegisterFORM.Image1.options[RegisterFORM.Image1.selectedIndex].style.backgroundColor="#FFC0C0";
//		alert("ERROR: Validation Image 1 Not Selected\n\nUsing the drop down menu, select what you think you can see as the first white symbol in the image below it.");
//		RegisterFORM.Image1.options[RegisterFORM.Image1.selectedIndex].focus();
//		return false;
//	}
//	if(RegisterFORM.Image2.options[RegisterFORM.Image2.selectedIndex].value==""){
//		RegisterFORM.Image2.options[RegisterFORM.Image2.selectedIndex].style.backgroundColor="#FFC0C0";
//		alert("ERROR: Validation Image 2 Not Selected\n\nUsing the drop down menu, select what you think you can see as the second white symbol in the image below it.");
//		RegisterFORM.Image2.options[RegisterFORM.Image2.selectedIndex].focus();
//		return false;
//	}
	document.ProcessingImage_Register.style.visibility="Visible";
	RegisterFORM.ButtonRegister.style.cursor="Wait";
	RegisterFORM.ButtonRegister.value="Registering";
	RegisterFORM.ButtonRegister.disabled=true;
	document.LoginForm.ButtonLogin.disabled=true;
	RegisterFORM.action="login.php";
	RegisterFORM.Process.value="Register";
	setTimeout("document.RegisterForm.submit();",1000);
}

function LoadValidationImage(){
	document.Ash.style.background="url(http://www.bracon.co.uk/test/img.php)";
	self.focus();
}

