You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
74 lines
2.6 KiB
JavaScript
74 lines
2.6 KiB
JavaScript
//Javascript
|
|
//hotel hotelinfo page script
|
|
//create date:2011-03-30
|
|
//author :wst
|
|
//copy right : chinahighlight
|
|
if(typeof $=="function")
|
|
{
|
|
$(function(){
|
|
var starttime = GetCookie("searchhotel","starttime");
|
|
var endtime = GetCookie("searchhotel","endtime");
|
|
starttime = isNaN(Date.parse(starttime))?new Date().addDays(1):new Date(starttime);
|
|
endtime = isNaN(Date.parse(endtime))?new Date().addDays(2):new Date(endtime);
|
|
|
|
$("#starttime,#starttime2").val(starttime.asString());
|
|
$("#endtime,#endtime2").val(endtime.asString());
|
|
$("#starttime2Day").val(starttime.getDayName(1)+'.');
|
|
$("#endtime2Day").val(endtime.getDayName(1)+'.');
|
|
$("#changeDate #TxtSdateDay").html(starttime.getDayName(1)+'.');
|
|
$("#changeDate #TxtEdateDay").html(endtime.getDayName(1)+'.');
|
|
|
|
var t1 = $("#changeDate #starttime").val(), t2 = $("#changeDate #endtime").val()
|
|
$("#changeDate #hotelnight").html(Math.ceil((new Date(t2) - new Date(t1))/86400000));
|
|
$("#changeDate #TxtSdate").html(t1);
|
|
$("#changeDate #TxtEdate").html(t2);
|
|
//--------
|
|
$("#ckRequestRate").trigger("click");
|
|
|
|
var sdates = $("#starttime2,#endtime2").datepicker({showAnim:"fadeIn",duration:0,minDate: 0, maxDate:"2y",numberOfMonths: 3,showButtonPanel: true,
|
|
onSelect: function( selectedDate ){
|
|
var dayID = $(this).attr('id')+'Day';
|
|
$("#"+dayID).val(new Date(selectedDate).getDayName(1)+'.');
|
|
}});
|
|
shcity= $("a[name='city']");
|
|
|
|
$("#hotelcityList a").click(function(){
|
|
$("#citys").val($(this).text());
|
|
shcity.text($(this).text());
|
|
$("#hotelcityList").hide();
|
|
});
|
|
$("a[name='city']").click(function(){
|
|
$("#hotelcityList").fadeIn(200);
|
|
});
|
|
$(".closeIt").click(function(){
|
|
$("#hotelcityList").fadeOut(200);
|
|
});
|
|
|
|
|
|
$("#introContent p:not(:first),#introContent ul").hide();
|
|
$("#introContent").slideDown();
|
|
|
|
$(".showMore").click(function(){
|
|
$("#introContent p:not(:first),#introContent ul").toggle();
|
|
$(this).find("span").toggle();
|
|
});
|
|
|
|
$(".research").click(function(){$("#changeDate>div").eq(1).show().end().eq(2).hide();});
|
|
|
|
//
|
|
if(typeof jsPicStr != 'undefined'){
|
|
$.each(jsPicStr,function(i,n){$("#mPhotoDetail").append('<a href="javascript:void(0)" url="'+n[0].replace('-s.','-m.')+'" class="jq_preview" title="'+n[1]+'"><img src="'+n[0]+'" name="minhotlephoto"/></a>');});
|
|
}
|
|
|
|
if( typeof $.fn.preview == 'function' ){
|
|
$("a.jq_preview").preview();
|
|
}
|
|
|
|
$("#printTaxi .printLink a").click(function(){
|
|
hotelPrintText.document.body.innerHTML=$("#printTaxi ul").html();
|
|
hotelPrintText.focus();
|
|
hotelPrintText.print();
|
|
});
|
|
|
|
});
|
|
} |