// JavaScript Document

	function checkreg(theform){
		// <![CDATA[
		fields = "";
		valid = true;
		
		if(theform.name.value == ""){
			//$('name').style.backgroundColor = "#FED9D9";
			//$('name').style.backgroundImage = "none";
			//Effect.Pulsate('firstnameRow');
			fields += "You must enter your first name.\n";
			valid = false;
		}
		
		if(theform.name.value.length < 2){
			fields += "You must enter a valid first name.\n";
			//$('name').style.backgroundColor = "#cef1ff";
			//$('name').style.backgroundImage = "none";
			valid = false;
			
		}
		if(theform.last_name.value == ""){
			//$('surname').style.backgroundColor = "#FED9D9";	
			//$('surname').style.backgroundImage = "none";
			fields += "You must enter your surname.\n";
			valid = false;
		}	
		if(theform.last_name.value.length < 2){
			fields += "You must enter a valid surname.\n";
			//$('surname').style.backgroundColor = "#cef1ff";	
			//$('surname').style.backgroundImage = "none";
			
			valid = false;
		}	
		if(theform.email.value == ""){
			//$('email').style.backgroundColor = "#FED9D9";
			//$('email').style.backgroundImage = "none";
			//Effect.Pulsate('emailRow');
			fields += "You must provide us with an email address.\n";
			valid = false;
		}
		if(theform.email.value.indexOf("@") == -1 || theform.email.value.indexOf(".") == -1){
			//$('email').style.backgroundColor = "#FED9D9";	
			//$('email').style.backgroundImage = "none";
			//Effect.Pulsate('emailRow');
			fields += "You must provide us with a valid email address.\n";
			valid = false;
		}
		
		if(theform.confirm_email.value != theform.email.value){
			fields += "The confirmation email address must match the email address.\n";
			valid = false;
		}
				
		if(!theform.terms.checked){
			//$('termsRow').style.backgroundColor = "#FED9D9";
			//$('termsRow').style.backgroundImage = "none";
			fields += "You must agree to the terms and conditions.\n";
			valid = false;	
		}
			
		if(valid == false){
			message = "Please address the highlighted fields\n";
			message += "--------------------------------------------------\n";
			message += fields;
			alert(message);
			return(false);
		}
		
	}
		

function CheckEmail(email)
{
if (window.XMLHttpRequest)
{// code for IE7+, Firefox, Chrome, Opera, Safari
xmlhttp=new XMLHttpRequest();
}
else
{// code for IE6, IE5
xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
}
xmlhttp.open("GET","checkemail.php?email="+email,false);
xmlhttp.send(null);

	if(xmlhttp.responseText != 0){
		document.getElementById('emailerror').style.display='';
		document.register.Register.disabled=true;
		/*document.getElementById('emailerror').innerHTML=xmlhttp.responseText;*/
	
	}else{
		document.getElementById('emailerror').style.display='none';
		document.register.Register.disabled=false;
	}
}


		
