function echeck(str) {
	var at="@"
	var dot="."
	var lat=str.indexOf(at)
	var lstr=str.length
	var ldot=str.indexOf(dot)
	
	if (str.indexOf(at)==-1){	 
	   return false
		}
	
	if (str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr){		 
	   return false
		}
	
	if (str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr){
		return false
		}
	
	 if (str.indexOf(at,(lat+1))!=-1){	   
		return false
		 }
	
	 if (str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot){		    
		return false
		 }
	
	 if (str.indexOf(dot,(lat+2))==-1){		 
		return false
		 }
		
	 if (str.indexOf(" ")!=-1){	
		return false
		 }
	
	 return true					
	}


	function valButton(btn) {
	    var cnt = -1;
	    for (var i=btn.length-1; i > -1; i--) {
	        if (btn[i].checked) {cnt = i; i = -1;}
	    }
	    if (cnt > -1) return btn[cnt].value;
	    else return null;
	}



function CheckTheForm() {	

	if (document.registerform.name.value=="") {
		alert("A Name is required")
		document.registerform.name.focus();
		return false;
		}	

	if (document.registerform.phone.value=="") {
		alert("A Phone Number is required")
		document.registerform.phone.focus();
		return false;
		}

	if (document.registerform.project_addy.value=="") {
		alert("The Project Address is required")
		document.registerform.project_addy.focus();
		return false;
		}
		
	if (document.registerform.project_type.value=="") {
		alert("A Project Type is required")
		document.registerform.project_type.focus();
		return false;
		}
		
	if (document.registerform.refferal.value=="") {
		alert("A Refferal is required")
		document.registerform.refferal.focus();
		return false;
		}

}
