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.

148 lines
5.9 KiB
JavaScript

/*
* Copyright (c) 2011 China Highlights
* //www.chinahighlights.com/
*
* Date: 2011/10/10
* Describe: Tansfer 页面脚本
*/
$(function(){
var sdates = $("#dateline,#dateline2,#dropdateline,#dropdateline2")
.datepicker({showAnim:"fadeIn",duration:0,minDate: 0, maxDate:"1y",numberOfMonths: 2,showButtonPanel: true});
$('span[id*=hisTip]').CHtip({ClassName:"CHtip"});
$(".tranferNav li").click(
function(){
$(".tranferNav li").removeClass("active");
$(this).addClass("active");
$("#contentflightRight form").hide().filter("#"+$(this).attr("subid")).show();
}
).css("cursor","pointer");
$("#price").change(function(){
if($(this).val()=="3"){
$(this).parents("form").attr("action","/china-flights/searchresult.asp");
$("#inlandFlight").hide();
$("#outlandFlight").show();
$("#triptypeDiv").hide();
$("#triptypeDiv").find("span").eq(1).hide().end().eq(0).find("input").trigger("click");
}else{
$("#triptypeDiv").show();
$(this).parents("form").attr("action","/china-flights/postquery.asp");
$("#triptypeDiv").find("span").show();
$("#inlandFlight").show();
$("#outlandFlight").hide();
if($(this).val()=="1"){
$("#startCode1").html(citystr);
$("#destinationCode1").html(citystr1);
}else{
$("#startCode1").html(cityHM);
$("#destinationCode1").html(cityHM).val('PEK');
}
}
});
$("#flightSearchBox :radio").click(function(){
$("#flightSearchBox label:last").hide(1);
if($(this).val()=="2"){
$("#flightSearchBox label:last").show(1);
}
});
$("#takeoffDate1").datepicker(
{showAnim:"fadeIn",duration:0,minDate: 0,maxDate:"2y",numberOfMonths: 2,showButtonPanel: true}
);
$("#takeoffDate2").datepicker(
{showAnim:"fadeIn",duration:0,minDate: 0,maxDate:"2y",numberOfMonths: 2,showButtonPanel: true,onSelect:function(dateStr){
if(new Date(dateStr).getTime()<new Date($("#takeoffDate1").val()).getTime()){
$(this).val("123546");
}
}}
);
});
//==============
//切换左边的菜单
function Togle(obj,id,callback){
var mObj = $(obj);
var isHiden = true;
var sObj = $("#"+id);
if(sObj.is(":hidden")){
sObj.slideDown("slow");
isHiden = false;
mObj.removeClass("filtercategoryclose").addClass("filtercategory");
}else{
sObj.slideUp("slow");
mObj.removeClass("filtercategory").addClass("filtercategoryclose");
}
if(typeof callback != 'undefined'){
callback(mObj,isHiden);
}
}
function Tomore(obj,ismore){
if(ismore){
obj.removeClass("more").addClass("unmore");
} else {
obj.removeClass("unmore").addClass("more");
}
}
function showRecommend(ids){
$.facebox.settings.opacity=0.5;
$.facebox.settings.outClose=false;
$.facebox({ajax:'/hotel/recomment.asp?hid='+ids});
}
function submittransfer(o){
var FormID = $(o).parents("form").attr("id");
if(FormID=="pick-up-form"){
//1
if (!StrIsNullOrEmpty("city","Please select your arrival airport.","NONE","",true)) return false;
if (!StrIsNullOrEmpty("hotel","Please fill in your hotel name. ","","",true)) return false;
if (!StrIsNullOrEmpty("destination","Please fill in your hotel address.","","",true)) return false;
if (!StrIsNullOrEmpty("dateline","Please fill in your arrival date.","","",true)) return false;
if (!StrIsNullOrEmpty("flightno","Please fill in your flight number. ","","",true)) return false;
if (!StrIsNullOrEmpty("arrivaltime","Please fill in your arrival time (Beijing Time).","","",true)) return false;
if (!StrIsNullOrEmpty("passengers","Please fill in the number of passengers requiring a transfer.","","",true)) return false;
} else if(FormID=="drop-off-form"){
//2
if (!StrIsNullOrEmpty("dropcity","Please select your departure airport. ","NONE","",true)) return false;
if (!StrIsNullOrEmpty("drophotel","Please fill in your hotel name.","NONE","",true)) return false;
if (!StrIsNullOrEmpty("dorpdestination","Please fill in your hotel address. ","","",true)) return false;
if (!StrIsNullOrEmpty("dropdateline","Please fill in your departure date.","","",true)) return false;
if (!StrIsNullOrEmpty("dropflightno","Please fill in your flight No..","","",true)) return false;
if (!StrIsNullOrEmpty("dropdptime","Please fill in your departure time (Beijing Time).","","",true)) return false;
if (!StrIsNullOrEmpty("droppassengers","Please fill in your departure date.","","",true)) return false;
} else if(FormID=="pick-drop-form"){
//3
if (!StrIsNullOrEmpty("city1","Please select your arrival airport.","NONE","",true)) return false;
if (!StrIsNullOrEmpty("hotel1","Please fill in your hotel name. ","","",true)) return false;
if (!StrIsNullOrEmpty("destination1","Please fill in your hotel address.","","",true)) return false;
if (!StrIsNullOrEmpty("dateline1","Please fill in your arrival date.","","",true)) return false;
if (!StrIsNullOrEmpty("flightno1","Please fill in your flight number. ","","",true)) return false;
if (!StrIsNullOrEmpty("arrivaltime1","Please fill in your arrival time (Beijing Time).","","",true)) return false;
if (!StrIsNullOrEmpty("passengers1","Please fill in the number of passengers requiring a transfer.","","",true)) return false;
if (!StrIsNullOrEmpty("dropcity1","Please select your departure airport. ","NONE","",true)) return false;
if (!StrIsNullOrEmpty("drophotel1","Please fill in your hotel name.","NONE","",true)) return false;
if (!StrIsNullOrEmpty("dorpdestination1","Please fill in your hotel address. ","","",true)) return false;
if (!StrIsNullOrEmpty("dropdateline1","Please fill in your departure date.","","",true)) return false;
if (!StrIsNullOrEmpty("dropflightno1","Please fill in your flight No..","","",true)) return false;
if (!StrIsNullOrEmpty("dropdptime1","Please fill in your departure time (Beijing Time).","","",true)) return false;
if (!StrIsNullOrEmpty("droppassengers1","Please fill in your departure date.","","",true)) return false;
if (!StrIsNullOrEmpty("city1","Please select your arrival airport.","NONE","",true)) return false;
} else {
return false;
}
return true;
}