document.write ("<div id='show' class='JJ_showLayer' style='display:none;position:absolute'>");
document.write ("(1)点评奖金：是指您通过旅悦旅行网预订酒店并且入住后，返回登陆旅悦旅行网，");
document.write ("对您入住的酒店发表点评，经我们核实后，由我们网站返给您的现金奖励。<br/>");
document.write ("(2)点评奖金是由旅悦旅行网站促销返还的，与酒店无关，所以您不能向酒店前台索要。<br/>");
document.write ("</div>");

function loadroom_info(hotel_id,queryprice) {
	$.get("../inc/agetroom_info.asp?hotel_id="+hotel_id+"&queryprice="+queryprice, function(data){	$("#common_table"+hotel_id).html(data);$("#common_table"+hotel_id).css("display","block");$("#room_show"+hotel_id).css("display","none");$("#room_hide"+hotel_id).css("display","block");})}	
	
function loadroom_info1(hotel_id,queryprice,intime,outtime,eId){
	if($("#common_table"+hotel_id).html()!="")	{
		$("#common_table"+hotel_id).css("display","block");
		$("#room_show"+hotel_id).css("display","none");
		$("#room_hide"+hotel_id).css("display","block");
	}else{
		if(eId!="0"){
			$.ajax({ 
	      	  type: "get", 
		      url: "../inc/agetroom_info1.asp", 
    	      data:"hotel_id="+hotel_id+"&queryprice=" + queryprice + "&d=" + new Date().getTime(),
		      success:function(data){
	  	    	$("#common_table"+hotel_id).html(data);
				$("#common_table"+hotel_id).css("display","block");
				$("#room_show"+hotel_id).css("display","none");
				$("#room_hide"+hotel_id).css("display","block");
				$.ajax({
					   type:"get",
					   url:"/ajax/GetPriceE.aspx",
					   data:"elongId="+eId+"&intime="+intime+"&outtime="+outtime+"&d="+new Date().getTime(),
					   success:function(data){
							check(data,hotel_id);
					   }
				});
		  	  }
			});
		}else{
			var tableStr;
			var firstDate;
			var secondDate;
			var thirdDate;
			firstDate=DateAdd("d",0,intime);
			secondDate=DateAdd("d",1,intime);
			thirdDate=DateAdd("d",2,intime);
			tableStr="<table class=\"common_table\" cellpadding=\"0\" cellspacing=\"0\">"+
					"<thead><tr><th>房型</th><th>详情</th><th>宽带</th><th>早餐</th><th>门市价</th>"+
					"<th>"+(firstDate.getMonth()+1)+"月"+firstDate.getDate()+"日</th><th>"+(secondDate.getMonth()+1)+"月"+secondDate.getDate()+"日</th><th>"+(thirdDate.getMonth()+1)+"月"+thirdDate.getDate()+"日</th>"+
					"<th class=\"JJ\" onmouseover=\"show_jjtishi(event)\" onmouseout=\"hide_jjtishi()\"><em>奖金</em></td>"+
					"<th>预订</th></tr></thead>"+
					"<tbody id=\"room"+hotel_id+"\">"+
					"</tbody>"+
					"</table>";
			$("#common_table"+hotel_id).html(tableStr);
			$("#common_table"+hotel_id).css("display","block");
			$("#room_show"+hotel_id).css("display","none");
			$("#room_hide"+hotel_id).css("display","block");
			$.ajax({
				  type: "get", 
		  	      url: "/ajax/GetPrice.aspx", 
			      data:"sid="+hotel_id+"&intime=" + intime + "&outtime=" + outtime + "&d=" + new Date().getTime(),
	    		  success:function(data){
			  	    $("#room"+hotel_id).html(data);
	  			  }
			});
		}
	}
}

function check(s,hid){
	if(s!=""){
		//alert(s);
		var rooms=new Array();
		room_id=new Array();
		rooms=s.split("@");
		for (i=0;i<rooms.length-1;i++){
			room_id.push(rooms[i].split("|")[0]);
			if(rooms[i].indexOf("-1")==-1){
				$("#"+hid+"-"+room_id[i]).removeClass("old_price")
			}
			for (k=1;k<=3;k++){
				$("#"+hid+"-"+room_id[i]).children().eq(k+4).html("￥"+rooms[i].split("|")[k])
			}
		}
		change_price(hid);
	}else{
		change_price(hid);
	}
}

function change_price(hid){
	var change_price=$("#room"+hid).children(".old_price");
	for(i=0;i<change_price.length;i++){
		for(k=1;k<=3;k++){
			$("#"+change_price[i].id).children().eq(k+4).html("满房");
		}
		$("#"+change_price[i].id).children().eq(3+6).html("<img src='/bg/booking_full_btn.png'/>");
	}
}

/* 得到日期年月日等加数字后的日期 */
function DateAdd(strInterval,num,dateValue){
	var formday=dateValue.split("-");
	formdays=formday[1]+"/"+formday[2]+"/"+formday[0];
	var dtTmp = new Date(formdays);
	var number =parseInt(num);
	return new Date(Date.parse(dtTmp) + (86400000 * number))
}
	
function hide_room_info(hotel_id,queryprice){
$("#common_table"+hotel_id).css("display","none");$("#room_show"+hotel_id).css("display","block");$("#room_hide"+hotel_id).css("display","none");
}
function show_jjtishi(event){
 event = event||window.event;
  var obj = document.getElementById("show");
   obj.style.display="block";
        if(document.documentElement){
            obj.style.top = event.clientY + document.documentElement.scrollTop+5+"px";
            obj.style.left =event.clientX + document.documentElement.scrollLeft-240+"px";
        }
        else
        {
        obj.style.top = event.pageY+5+"px";
        obj.style.left = event.pageX-240+"px";
        }
}
document.write ("<div id='show_map' class='JJ_showLayer' style='display:none;position:absolute'>");
document.write ("(1)旅悦旅行网通过地图定位技术帮您搜索酒店，本距离数值基于google地图数据，仅供参考；<br/>");
document.write ("(2)所示距离为两目的地之间的直线距离，实际行车或步行距离将稍大于该距离；");
document.write ("</div>");

function show_jjtishi_map(event){
 event = event||window.event;
  var obj = document.getElementById("show_map");
   obj.style.display="block";
        if(document.documentElement){
            obj.style.top = event.clientY + document.documentElement.scrollTop+5+"px";
            obj.style.left =event.clientX + document.documentElement.scrollLeft-240+"px";
        }
        else
        {
        obj.style.top = event.pageY+5+"px";
        obj.style.left = event.pageX-240+"px";
        }
}
function hide_jjtishi_map(){$("#show_map").css("display","none");}
function hide_cxiao(){$("#cxiao_pop").css("display","none");}
function show_cxiao(){$("#cxiao_pop").css("display","block");}
function hide_jjtishi(){$("#show").css("display","none");}
