﻿function showroomprice(){
    $("#room_price").ajaxSend(function(){ $(this).html("<img src='/images/total.gif'>正在更新酒店价格..."); }).ajaxError(function(){ $(this).html("查询价格失败"); });
    $.get("room_price.asp", {hotelid: $("#hotelid").val(), dc1: $("#dc1").val(), dc2: $("#dc2").val() }, function(data){ $("#room_price").html( data ); });
}
function showroompricephp(){
    $("#room_price").ajaxSend(function(){ $(this).html("<img src='/images/total.gif'>正在更新酒店价格..."); }).ajaxError(function(){ $(this).html("查询价格失败"); });
    $.get("/sdkphp/room_price.php", {hotelid: $("#hotelid").val(), dc1: $("#dc1").val(), dc2: $("#dc2").val() }, function(data){ $("#room_price").html( data ); });
}


function sp(id){
    $("#sp"+escape(id)).ajaxSend(function(){ $(this).html("<img src='/images/total.gif'>"); }).ajaxError(function(){ $(this).html("查询失败"); });
    $.get("/price.asp?id="+escape(id), { dc1: $("#dc1").val()}, function(data){ $("#sp"+escape(id)).html( data ); });
}

function showdate(){
  now=new Date();  
  year=now.getFullYear(); 
  month=now.getMonth()+1; 
  day=now.getDate();
  //time_str=year+"-"+month+"-"+day; 
  time_str=getQry("dc1");
  if (time_str==null) 
     {
      time_str=year+"-"+month+"-"+day; 
     }
  now.setTime(now.getTime()+24*3600*1000); 
  year=now.getFullYear(); 
  month=now.getMonth()+1; 
  day=now.getDate(); 
  //time_str2=year+"-"+month+"-"+day; 
  time_str2=getQry("dc2");
    if (time_str2==null) 
     {
      time_str2=year+"-"+month+"-"+day; 
     }
  $("#dc1").val(time_str); 
  $("#dc2").val(time_str2); 
};
function showdate2(){
  now=new Date();  
  year=now.getFullYear(); 
  month=now.getMonth()+1; 
  day=now.getDate();
  time_str3=year+"-"+month+"-"+day; 
  now.setTime(now.getTime()+24*3600*1000); 
  year=now.getFullYear(); 
  month=now.getMonth()+1; 
  day=now.getDate(); 
  time_str4=year+"-"+month+"-"+day; 
  $("#dc3").val(time_str3); 
  $("#dc4").val(time_str4); 
};
var old=null;
function changemenu(mydiv){
  var obj = document.getElementById(mydiv);
  if (old!=null&&old!=obj)
    old.style.display='none';
  old=obj;
  if (obj.style.display=='none'){
    obj.style.display='';
  }else{
    obj.style.display='none';
  }
}
function getQry(key){
var search=location.search.slice(1);
var arr=search.split("&");
for(var i=0;i<arr.length;i++){
   var ar=arr[i].split("=");
   if(ar[0]==key){
    return ar[1];
   }
}
}
function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}
function view(newsfile) {

	var gt = unescape('%3e');
	var popup = null;
	var over = "Launch Pop-up Navigator";
	popup = window.open('', 'popupnav', 'width=520,height=258,resizable=1,scrollbars=yes');
	if (popup != null) {
		if (popup.opener == null) {
		popup.opener = self;
		}
	popup.location.href = newsfile;
	}
}

