// JavaScript Document

function Validator_contact(theForm)
{
	
	if(theForm.name.value == "")
  {
    alert("Please enter Name");
    theForm.name.focus();
    return (false);
  }

  if(theForm.mobile.value == "")
  {
    alert("Please enter Contact Number");
    theForm.mobile.focus();
    return (false);
  }
  
   if (theForm.email.value == "")
  {
    alert("Please enter your Email Address");
    theForm.email.focus();
    return (false);
  }
  if  (theForm.email.value != "")
  {   
	var eresult
	var str=theForm.email.value
  	var filter=/^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i
	if (!filter.test(str))
	  {
		alert("Please enter a valid Email address!")
		theForm.email.focus();
		eresult=false;
		return (eresult);
  	  }
  
  }  
  
    if(theForm.message.value == "")
  {
    alert("Please enter Message");
    theForm.message.focus();
    return (false);
  }
  
  
  if (theForm.spam.value == "")
  {
    alert("Please Enter Security Code");
    theForm.spam.focus();
    return (false);
  }
  
}


/*function getXMLHTTP() { 
		var xmlhttp=false;	
		try{
			xmlhttp=new XMLHttpRequest();
		}
		catch(e)	{		
			try{			
				xmlhttp= new ActiveXObject("Microsoft.XMLHTTP");
			}
			catch(e){
				try{
				xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
				}
				catch(e1){
					xmlhttp=false;
				}
			}
		}
		 	
		return xmlhttp;
}
	
	
	
function getCity(strURL) {		
		
		var req = getXMLHTTP();
		
		if (req) {
			
			req.onreadystatechange = function() {
				if (req.readyState == 4) {
					// only if "OK"
					if (req.status == 200) {						
						document.getElementById('citydiv').innerHTML=req.responseText;						
					} else {
						alert("There was a problem while using XMLHTTP:\n" + req.statusText);
					}
				}				
			}			
			req.open("GET", strURL, true);
			req.send(null);
		}
				
}*/