function smscheck(){
	var name=document.getElementById("txt_smsname").value;
	var phone=document.getElementById("txt_smsphone").value;
	var msg=document.getElementById("txt_smscomments").value;
	var numericExpression = /^[0-9]+$/;	
  if(!(phone.match(numericExpression)) || (phone=="") ||(phone==" ")){
		alert("Please enter numbers only");
		document.getElementById("txt_smsphone").focus();
		return false;
	}	
	else {
                xmlHttp=GetXmlHttpObject()
                if (xmlHttp==null) {
                   alert ("Browser does not support HTTP Request")
                   return
                }  else  {
                   xmlHttp.open("POST","sendsmstomobile.php",true); //calling testing.php using POST method
                   xmlHttp.onreadystatechange  = handleServerResponse;
                   xmlHttp.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
                   xmlHttp.send("&name=" + name + "&phoneno=" +phone+"&msg="+msg); //Posting txtname to PHP File
                }
         }

}
function GetXmlHttpObject() {
    var xmlHttp=null;
    try  {
     // Firefox, Opera 8.0+, Safari
     xmlHttp=new XMLHttpRequest();
     }
    catch (e) {
     // Internet Explorer
     try   {
      xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
      }
     catch (e) {
      xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
      }
     }
return xmlHttp;
}

function handleServerResponse() {
    if(xmlHttp.readyState == 1){      
      document.getElementById("div_sms").innerHTML="Message sending...";      
    }
   if (xmlHttp.readyState == 4) {
     if(xmlHttp.status == 200) {
       document.getElementById("div_sms").innerHTML=xmlHttp.responseText; //Update the HTML Form element
       document.getElementById("txt_smsname").value="";
	     document.getElementById("txt_smsphone").value="";
	     document.getElementById("txt_smscomments").value="";
     }    
   }
}