//fill cities
function WcreateRequestObject() {
    var WtmpXmlHttpObject;
    
    //depending on what the browser supports, use the right way to create the XMLHttpRequest object
    if (window.XMLHttpRequest) { 
        // Mozilla, Safari would use this method ...
        WtmpXmlHttpObject = new XMLHttpRequest();
	
    } else if (window.ActiveXObject) { 
        // IE would use this method ...
        WtmpXmlHttpObject = new ActiveXObject("Microsoft.XMLHTTP");
    }
    
    return WtmpXmlHttpObject;
}

//call the above function to create the XMLHttpRequest object
var Whttp = WcreateRequestObject();


function WmakePostRequest(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 = Wprepare_param(obj1);
 
    Whttp.open('POST', page_name ,true);
  
	Whttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
	
	Whttp.setRequestHeader("Content-length", params.length);
	 
	Whttp.setRequestHeader("Connection", "close");
	 
	
    //assign a handler for the response
    Whttp.onreadystatechange = WprocessResponse;
	
    //actually send the request to the server
    Whttp.send(params);
    
}


function WmakePostRequest_1(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 = Wprepare_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 = WprocessResponse;
	
    //actually send the request to the server
    http.send(params);
}

function WprocessResponse() {
    //check if the response has been received from the server
    
if(Whttp.readyState == 4){
	
        //read and assign the response from the server
        var response = Whttp.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('winnersOp').innerHTML =  response;
      //_client_login_sbox.hide()
		
    }
    else
    {
    	//checkLogin();
    	document.getElementById('winnersOp').innerHTML ="<br><br><br><br><center><img src='http://cdn.maktoob.com/research/panel/images/loading.gif'></center><br><br><br><br>";

    }
    
    
}



function Wprepare_param(obj1)
{ 
	
	
		var  par='mDate='+ obj1;
	
	//alert(par);
	return par;
}
