
function fetch_state(val){
//alert(val);
if (window.XMLHttpRequest)
{// code for IE7+, Firefox, Chrome, Opera, Safari
xmlhttp=new XMLHttpRequest();
}
 else
 {// code for IE6, IE5
 xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
 }

   var countryname = val;
     var queryString = "state.php?countryname=" + countryname;
         xmlhttp.open("GET",queryString,false);
             xmlhttp.send(null);
//alert(xmlhttp.responseText);   
document.getElementById('statename').innerHTML=xmlhttp.responseText;
   }

