// JavaScript Document
//=====================================================================================================================================================================
function validateContact(){
	if(document.checkContact.name.value == ''){
		alert("Please enter name")	
		document.checkContact.name.focus()
		return false
	}else if(document.checkContact.email.value == ''){
		alert("Please enter email")	
		document.checkContact.email.focus()
		return false
	}else if(!emailCheck(document.checkContact.email.value)){
	document.checkContact.email.focus()
	return false
	}/*else if(document.checkContact.phone.value == ''){
		alert("Please enter phone")	
		document.checkContact.phone.focus()
		return false
	}*/else if(document.checkContact.comments.value == ''){
		alert("Please enter comments")	
		document.checkContact.comments.focus()
		return false
	}

document.getElementById("contactsubmit").value = "Please wait.."	

//=============Send data through Ajax
xmlHttp=GetXmlHttpObject()
xmlHttp.onreadystatechange=function (){
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
 {
	 
	 
	 	 document.getElementById("LoginForm").reset()

 document.getElementById("contactsubmit").value = "Sent"	
	document.getElementById("LoginForm").onsubmit = returnfalse
 } 

}
name = document.checkContact.name.value
email = document.checkContact.email.value
phone = document.checkContact.phone.value
comments = document.checkContact.comments.value
if(document.checkContact.Sendnewsleter.checked){
send = 1
}else{
send = 0
}

xmlHttp.open("GET","contactMail.php?name="+name+"&email="+email+"&phone="+phone+"&comments="+comments+"&send="+send,true)
xmlHttp.send(null)
return false;
//====END
return false
}
//=====================================================================================================================================================================



