var http = createRequestObject();
var http2 = createRequestObject();
function createRequestObject(){
    var request;
    if(navigator.appName == "Microsoft Internet Explorer"){
		request = new ActiveXObject("Microsoft.XMLHTTP");
       
    }
    else{
		request =new XMLHttpRequest();
       
    }
    return request;
}
function country1(){
    http2.open('get', 'searchHotels.php?uncach=' + Math.floor(Math.random()*100000) + '&country=' + document.getElementById('country2').value );
    http2.onreadystatechange = handleInf;
    http2.send(null);
	document.getElementById('mydiv').innerHTML = '<select name="h" id="h"style="width:140px; margin-left:20px;margin-top:5px;"><option value="h">Select Category</option></select>';
}
function handleInf(){
    if(http2.readyState == 1){
        document.getElementById('mydi').innerHTML = 'Please Wait';
    }
    if(http2.readyState == 4){
        var response = http2.responseText;
        document.getElementById('mydi').innerHTML = response;
    }
}
function city1(){
	
    http.open('get', 'searchHotels.php?uncach=' + Math.floor(Math.random()*100000) + '&citys=' + document.getElementById('city').value);
    http.onreadystatechange = handleInfo;
    http.send(null);
	
}
function handleInfo(){
    if(http.readyState == 1){
        document.getElementById('mydiv').innerHTML = 'Please Wait';
    }
    if(http.readyState == 4){
        var response = http.responseText;
        document.getElementById('mydiv').innerHTML = response;
    }
}

