//fill cities
function DcreateRequestObject() {
    var DtmpXmlHttpObject;
    
    //depending on what the browser supports, use the right way to create the XMLHttpRequest object
    if (window.XMLHttpRequest) { 
        // Mozilla, Safari would use this method ...
        DtmpXmlHttpObject = new XMLHttpRequest();
	
    } else if (window.ActiveXObject) { 
        // IE would use this method ...
        DtmpXmlHttpObject = new ActiveXObject("Microsoft.XMLHTTP");
    }
    
    return DtmpXmlHttpObject;
}

//call the above function to create the XMLHttpRequest object
var Dhttp = DcreateRequestObject();


function DmakePostRequest(page_name,obj1,obj2,obj3) {
	
    //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 = Dprepare_param(obj1,obj2,obj3);
 
    Dhttp.open('POST', page_name ,true);
  
	Dhttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
	
	Dhttp.setRequestHeader("Content-length", params.length);
	 
	Dhttp.setRequestHeader("Connection", "close");
	 
	
    //assign a handler for the response
    Dhttp.onreadystatechange = DprocessResponse;
	
    //actually send the request to the server
    Dhttp.send(params);
    
}


function DmakePostRequest_1(page_name,obj1,obj2,obj3) {
    //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 = Dprepare_param(obj1,obj2,obj3);
 
    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 = DprocessResponse;
	
    //actually send the request to the server
    http.send(params);
}

function DprocessResponse() {
    //check if the response has been received from the server
    
if(Dhttp.readyState == 4){
	
        //read and assign the response from the server
        var response = Dhttp.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('calendar_wrap').innerHTML =  response;
      //_client_login_sbox.hide()
		
    }
    else
    {
    	//checkLogin();
    	document.getElementById('calendar_wrap').innerHTML ="<p align='center'><br><br><img src='images/Calloading2.gif'></p>";

    }
    
    
}



function Dprepare_param(obj1,obj2,obj3)
{ 
	
		var  par='mno=' + obj1 +'&year='+ obj2+'&r='+ obj3;
	
	//alert(par);
	return par;
}

