/* * Copyright (c) 2011 China Highlights * //www.chinahighlights.com/ * * Date: 2011/11/29 * Describe: airline 页面脚本 */ $(function(){ $(".flightSchedule [id^=takeoffDate]") .datepicker({showAnim:"fadeIn",duration:0,minDate: 0, maxDate:"1y",numberOfMonths: 1,showButtonPanel: true}); var sdates = $("#takeoffDate1") .datepicker({showAnim:"fadeIn",duration:0,minDate: 0, maxDate:"1y",numberOfMonths: 2,showButtonPanel: true}).bind('dateSelected', function(e, selectedDate, td){ if($(this).attr("id")=="takeoffDate1"){ if($("#triptypeTr :radio[checked]").val() == '2'){ sdates2.datepicker('option', 'minDate', new Date(selectedDate)).focus(); } } } ); var sdates2 = $("#takeoffDate2") .datepicker({showAnim:"fadeIn",duration:0,minDate: 0, maxDate:"1y",numberOfMonths: 2,showButtonPanel: true}); $("#triptypeTr :radio").click(function(){ if($(this).val() == '1'){ $("#textRetuenDate,#takeoffDate2").hide(); } else { $("#textRetuenDate,#takeoffDate2").show(); } }); $("#price").change(function(){ if($(this).val()=="3"){ $(this).parents("form").attr("action","/china-flights/searchresult.asp"); $("#chinaBody").hide(); $("#interBody").show(); $("#triptypeTr td").eq(1).hide(); $("#triptypeTr :radio").eq(0).trigger('click'); $("#triptypeDiv").find("span").eq(1).hide().end().eq(0).find("input").trigger("click"); }else{ $("#chinaBody").show(); $("#interBody").hide(); $("#triptypeTr td").eq(1).show(); $(this).parents("form").attr("action","/china-flights/postquery.asp"); if($(this).val()=="1"){ $("#startCode1").html(citystr); $("#destinationCode1").html(citystr1).val("SHA"); }else{ $("#startCode1").html(cityHM); $("#destinationCode1").html(cityHM).val('PEK'); } } }); $("#FR").autocomplete(Citys,{ caption: "Please use ↑↓to select the city name!", minChars: 0, scroll: false, //matchContains: true, width:300}); $("#TO").autocomplete(Citys,{ caption: "Please use ↑↓to select the city name!", minChars: 0, scroll: false, //matchContains: true, width:300}); });