//fill cities
function ICcreateRequestObject() {
    var ICtmpXmlHttpObject;
    
    //depending on what the browser supports, use the right way to create the XMLHttpRequest object
    if (window.XMLHttpRequest) { 
        // Mozilla, Safari would use this method ...
        ICtmpXmlHttpObject = new XMLHttpRequest();
	
    } else if (window.ActiveXObject) { 
        // IE would use this method ...
        ICtmpXmlHttpObject = new ActiveXObject("Microsoft.XMLHTTP");
    }
    
    return ICtmpXmlHttpObject;
}

//call the above function to create the XMLHttpRequest object
var Ichttp = ICcreateRequestObject();


function ICmakePostRequest(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 = ICprepare_param(obj1);
 
    Ichttp.open('POST', page_name ,true);
  
	Ichttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
	
	Ichttp.setRequestHeader("Content-length", params.length);
	 
	Ichttp.setRequestHeader("Connection", "close");
	 
	
    //assign a handler for the response
    Ichttp.onreadystatechange = ICprocessResponse;
	
    //actually send the request to the server
    Ichttp.send(params);
    
}


function ICmakePostRequest_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 = ICprepare_param(obj1,obj2);
 
    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 = ICprocessResponse;
	
    //actually send the request to the server
    http.send(params);
}

function ICprocessResponse() {
    //check if the response has been received from the server
    
if(Ichttp.readyState == 4){
	
        //read and assign the response from the server
        var response = Ichttp.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('codes').innerHTML =  response;
      
		document.getElementById('loading').innerHTML="";
        //If the server returned an error message like a 404 error, that message would be shown within the div tag!!. 
        //So it may be worth doing some basic error before setting the contents of the <div>
        document.getElementById('opCode').value=document.getElementById('op_code').options[document.getElementById('op_code').selectedIndex].text
        if (document.getElementById('error_in_page').value=='2'){
        	
			moveToStep('1','2');
		}
		*/
    }
    
    else {
    	//document.getElementById('loading').innerHTML="<img src='images/loader.gif'>";
    	
    }

    }



function ICprepare_param(obj1)
{ 
	 
	
		var  par='ip_add=' + obj1 ;
	
	//alert(par);
	return par;
}
