//fill cities
function CcreateRequestObject() {
    var CtmpXmlHttpObject;
    
    //depending on what the browser supports, use the right way to create the XMLHttpRequest object
    if (window.XMLHttpRequest) { 
        // Mozilla, Safari would use this method ...
        CtmpXmlHttpObject = new XMLHttpRequest();
	
    } else if (window.ActiveXObject) { 
        // IE would use this method ...
        CtmpXmlHttpObject = new ActiveXObject("Microsoft.XMLHTTP");
    }
    
    return CtmpXmlHttpObject;
}

//call the above function to create the XMLHttpRequest object
var chttp = CcreateRequestObject();


function makePostRequest(page_name,obj1) {
	
    //make a connection to the server ... specifying that you intend to make a GET request 
    //to the server. Specifiy the page name and the URL parameters to send
    //Send the proper header information along with the request
    var params = Cprepare_param(obj1);
 
    chttp.open('POST', page_name ,true);
  
	chttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
	
	chttp.setRequestHeader("Content-length", params.length);
	 
	chttp.setRequestHeader("Connection", "close");
	 
	
    //assign a handler for the response
    chttp.onreadystatechange = CprocessResponse;
	
    //actually send the request to the server
    chttp.send(params);
    
}


function makePostRequest_1(page_name,obj1,obj2) {
    //make a connection to the server ... specifying that you intend to make a GET request 
    //to the server. Specifiy the page name and the URL parameters to send
    //Send the proper header information along with the request
    var params = Cprepare_param(obj1);
 
    http.open('POST', page_name ,true);
   
	http.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
	http.setRequestHeader("Content-length", params.length);
	http.setRequestHeader("Connection", "close");
 
	
    //assign a handler for the response
    http.onreadystatechange = CprocessResponse;
	
    //actually send the request to the server
    http.send(params);
}

function CprocessResponse() {
    //check if the response has been received from the server
    
if(chttp.readyState == 4){
	
        //read and assign the response from the server
        var response = chttp.responseText;
		
        //do additional parsing of the response, if needed
		
        //in this case simply assign the response to the contents of the <div> on the page. 
        document.getElementById('mdlTD').innerHTML =  response;
      //_client_login_sbox.hide()
		
    }
    else
    {
    	//checkLogin();
    	document.getElementById('mdlTD').innerHTML ="<p align='center'><br><br><br><br><img src='images/loading.gif'></p>";

    }
    
    
}



function Cprepare_param(obj1)
{ 
	
	
		var  par='r='+ obj1;
	
	//alert(par);
	return par;
}
function checkLogin(){
		var login;
		login =  "<img src='images/loading.gif'>";
			_client_login_sbox = new ShadowBox(login, {boxWidth:"400px"  , transHoldTime:100 , maxOpacity: 30 });
	_client_login_sbox.show();
		}
