  
  function makePOSTRequest(url, parameters) {
      
      http_request = false;
	 
      if (window.XMLHttpRequest) { // Mozilla, Safari,...
         http_request = new XMLHttpRequest();
         
      } else if (window.ActiveXObject) { // IE
         try {
            http_request = new ActiveXObject("Msxml2.XMLHTTP");
         } catch (e) {
            try {
               http_request = new ActiveXObject("Microsoft.XMLHTTP");
            } catch (e) {}
         }
      }
      if (!http_request) {
         alert('Cannot create XMLHTTP instance');
         return false;
      }
      if (http_request.overrideMimeType) {
         	// set type accordingly to anticipated content type
            http_request.overrideMimeType('text/xml');
            http_request.overrideMimeType('text/html');
         }
	   
      http_request.onreadystatechange = alertContents;
	  http_request.open('POST', url,true);
	  http_request.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
      http_request.setRequestHeader("Content-length", parameters.length);
      http_request.setRequestHeader("Connection", "close");
      http_request.send(parameters);
   }

   function alertContents() {
	  if (http_request.readyState == 0 || http_request.readyState == 1 || http_request.readyState == 2 || http_request.readyState == 3)
	  {
		   writeConsole("Sending Your Request......");
	  }
      if (http_request.readyState == 4) {
                  
         if (http_request.status == 200) {
			
           writeConsole(http_request.responseText);
       
         } else {
            alert('There was a problem with the request.');
			 
         }
      }
   }
   
   function getHotel() {
	   		
		var poststr = "txt_name=" + encodeURI(document.getElementById('txt_name').value)+
	                   "&txt_email=" + encodeURI(document.getElementById('txt_email').value)+
					   "&chkin=" + encodeURI(document.getElementById('chkin').value)+
					   "&chkout=" + encodeURI(document.getElementById('chkout').value)+
					   "&select1=" + encodeURI(document.getElementById('select1').value)+
					   "&select2=" + encodeURI(document.getElementById('select2').value)+
					   "&txt_rmrk=" + encodeURI(document.getElementById('txt_rmrk').value)+
					   "&url=" + encodeURI(document.location);
	 
         makePOSTRequest("hotelpackagemail.php", poststr);
	    
   }
       
function writeConsole(content) {
 top.consoleRef=window.open('','myconsole',
  'width=350,height=250'
   +',menubar=0'
   +',toolbar=1'
   +',status=0'
   +',scrollbars=1'
   +',resizable=1')
 top.consoleRef.document.writeln(
  '<html><head><title>Console</title></head>'
   +'<body bgcolor=white onLoad="self.focus()">'
   +content
   +'</body></html>'
 )
 top.consoleRef.document.close()
}// JavaScript Document