﻿// JScript 文件

//首页查询选择项切换
function AirFlightClass()
{
}
var timestatefoucs=false;
var framestatefocus=false;
AirFlightClass.prototype.$ = function(str){return document.getElementById(str);}
AirFlightClass.prototype.$$ = function(str){return document.getElementsByName(str);}
var AirFlight = new AirFlightClass();
 
AirFlightClass.prototype.BindFlightSearchUriInfo = function(citycode,cityname,fromdate,avtypes,tocitycode,tocityname,threadcitycode,threadcityname,todate,airflight,airway)
{
    if(airflight=="")airflight="不限";
    if(airway=="") airway="ALL";
    var avtype=this.$$("Avtype");
    this.$("fromcity").value = cityname;
    this.$("fromcitycode").value = citycode;
     this.$("tcity").value=tocityname;
     this.$("twocitycode").value = tocitycode;
    this.$("tocity").value=threadcityname;
     this.$("tocitycode").value=threadcitycode;
      
    this.$("startDate").value = fromdate;
     this.$("returnDate").value= todate;
     this.$("airwaycode").value=airflight; 
     this.$("airway").value=airway; 
     
     var bnt=avtypes;
      var flight_twocity = this.$("flight_twocity");
    var flight_twodate = this.$("flight_twodate");
    var flight_threecity = this.$("flight_threecity");
    var flight_twodateli = this.$("flight_twodateli");
    
    for(var n=0;n<avtype.length;n++)
    {
        if(avtype[n].value==bnt+"")
        {
            avtype[n].checked=true;
        }else{
            avtype[n].checked=false;
        }
    }
     if(bnt==1)
    {
        flight_twocity.innerHTML="目的城市";
        flight_twodateli.style.display="none";
        flight_threecity.style.display="none";
		if(this.$("flight_twotime")!=null)
		{
			this.$("flight_twotime").innerHTML="返程时间";
			this.$("flight_twotimeli").style.display="none";
		}
		
    }
    if(bnt==2)
    {
        flight_twocity.innerHTML="目的城市";
        flight_twodate.innerHTML="返程日期";
        flight_twodateli.style.display="block";
        flight_threecity.style.display="none";
		if(this.$("flight_twotime")!=null)
		{
			this.$("flight_twotime").innerHTML="返程时间";
			this.$("flight_twotimeli").style.display="block";
		}
    }
    if(bnt==3)
    {
        flight_twocity.innerHTML="中转城市";
        flight_twodate.innerHTML="中转日期";
        flight_twodateli.style.display="block";
        flight_threecity.style.display="block";
		if(this.$("flight_twotime")!=null)
		{
			this.$("flight_twotime").innerHTML="中转时间";
			this.$("flight_twotimeli").style.display="block";
		}
    }
}

//***********************************************************//
AirFlightClass.prototype.SetPageHome = function(obj,uri)
{
 
        try{ 
                obj.style.behavior='url(#default#homepage)';obj.setHomePage(uri); 
        } 
        catch(e){ 
                if(window.netscape) { 
                        try { 
                                netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect"); 
                        } 
                        catch (e) { 
                                alert("此操作被浏览器拒绝！\n请在浏览器地址栏输入“about:config”并回车\n然后将 [signed.applets.codebase_principal_support]的值设置为'true',双击即可。"); 
                        } 
                        var prefs = Components.classes['@mozilla.org/preferences-service;1'].getService(Components.interfaces.nsIPrefBranch); 
                        prefs.setCharPref('browser.startup.homepage',uri); 
                 } 
        } 

}
AirFlightClass.prototype.SelectAnySearchBnt = function(bnt)
{
    var flight_search_bnt = this.$("flight_search_bnt");
    var hotel_search_bnt = this.$("hotel_search_bnt");
    var travel_search_bnt = this.$("travel_search_bnt");
    var internet_search_bnt = this.$("internet_search_bnt");
    
    var flight_search_main = this.$("flight_search_main");
    var hotel_srarch_main = this.$("hotel_srarch_main");
    var travel_srarch_main = this.$("travel_srarch_main");
    var internet_srarch_main = this.$("internet_srarch_main");
    
    if(bnt==1)
    {
        flight_search_bnt.className="index_page_search_main_span_menu_flight";
        hotel_search_bnt.className="index_page_search_main_span_menu_hotel_noselect";
        internet_search_bnt.className="index_page_search_main_span_menu_inter_noselect";
        travel_search_bnt.className="index_page_search_main_span_menu_travel_noselect";
        
        flight_search_main.style.display="block";
        hotel_srarch_main.style.display="none";
        travel_srarch_main.style.display="none";
        internet_srarch_main.style.display="none";
    }
    if(bnt==2)
    {
       flight_search_bnt.className="index_page_search_main_span_menu_flight_noselect";
        hotel_search_bnt.className="index_page_search_main_span_menu_hotel";
        internet_search_bnt.className="index_page_search_main_span_menu_inter_noselect";
        travel_search_bnt.className="index_page_search_main_span_menu_travel_noselect";
        
        flight_search_main.style.display="none";
        hotel_srarch_main.style.display="block";
        travel_srarch_main.style.display="none";
        internet_srarch_main.style.display="none";
    }
    if(bnt==3)
    {
        flight_search_bnt.className="index_page_search_main_span_menu_flight_noselect";
        hotel_search_bnt.className="index_page_search_main_span_menu_hotel_noselect";
        internet_search_bnt.className="index_page_search_main_span_menu_inter";
        travel_search_bnt.className="index_page_search_main_span_menu_travel_noselect";
        
        flight_search_main.style.display="none";
        hotel_srarch_main.style.display="none";
        travel_srarch_main.style.display="none";
        internet_srarch_main.style.display="block";      
    }
    if(bnt==4)
    {
        flight_search_bnt.className="index_page_search_main_span_menu_flight_noselect";
        hotel_search_bnt.className="index_page_search_main_span_menu_hotel_noselect";
        internet_search_bnt.className="index_page_search_main_span_menu_inter_noselect";
        travel_search_bnt.className="index_page_search_main_span_menu_travel";
        
        flight_search_main.style.display="none";
        hotel_srarch_main.style.display="none";
        travel_srarch_main.style.display="block";
        internet_srarch_main.style.display="none";       
    }
}
AirFlightClass.prototype.PostSearchTravel = function()
{
    var TravelType = this.$$("TravelType");
    var tp;
    for(var i=0;i<TravelType.length;i++)
    {
        if(TravelType[i].checked)
        {
            tp=TravelType[i].value;
            break;
        }
    }
    var checkprice=/^[0-9]{1,}([.][0-9]{1,2}){0,1}$/;
    var TravelFcity = this.$("TravelFcity");
    var TravelTcity = this.$("TravelTcity");
    if(TravelTcity.value.length<1)
    {
        alert("请选择目的地!");
        TravelTcity.focus();
        return false;
    }
    var TravelPrice = this.$("TravelPrice");
    var TravelEndPrice = this.$("TravelEndPrice");
    if(TravelPrice.value!="")
    {
        if(!checkprice.exec(TravelPrice.value))
        {
            alert("请输入标准的价格格式.如:100或100.10");
            TravelPrice.focus();
            return false;
        }
    }
    if(TravelEndPrice.value!="")
    {
        if(!checkprice.exec(TravelEndPrice.value))
        {
            alert("请输入标准的价格格式.如:100或100.10");
            TravelEndPrice.focus();
            return false;
        }
    }
    var TravelKeyword = this.$("TravelKeyword");
    
    window.location="/travel/TravelLi.aspx?k="+TravelKeyword.value+"&c1="+TravelFcity.value+"&c2="+TravelTcity.value+"&p1="+TravelPrice.value+"&p2="+TravelEndPrice.value+"&s="+tp;
}
AirFlightClass.prototype.SelectTravelCityCode = function(str,ct,fr,code,codehidden)
{
	var box = window.parent.document.getElementById(ct);
	box.value=str;
	var hotelcitycodeletter = window.parent.document.getElementById(codehidden);
	hotelcitycodeletter.value=code;
	if(window.parent.document.getElementById("Landmarks")!=null)
	{
	AirFlight.ChdSetSelectListInfo('Landmarks',window.parent.CityLandArray,'hotelcitycodeletter','地标');
	AirFlight.ChdSetSelectListInfo('Locatios',window.parent.CityAreaArray,'hotelcitycodeletter','行政区');
	}
	var frame=window.parent.document.getElementById(fr);
	frame.style.display="none";
}
AirFlightClass.prototype.SelectTravelsCityCode = function(str,ct,fr,code,codehidden,TravelPlace,TravelLove)
{
	var box = window.parent.document.getElementById(ct);
	box.value=str;
	var hotelcitycodeletter = window.parent.document.getElementById(codehidden);
	hotelcitycodeletter.value=code;
	try{
	if(window.parent.document.getElementById(TravelPlace)!=null)
	{
	AirFlight.ChdSetSelectListInfo(TravelPlace,window.parent.TravelPlaceArray,codehidden,'');
	}
	}catch(err)
	{}
	var frame=window.parent.document.getElementById(fr);
	frame.style.display="none";
}
AirFlightClass.prototype.SetTravelCityFrameDefaultValue = function(box)
{
    var boxs = document.getElementById(box);
    if(box=="travelcity")
    {
        var tcf=document.getElementById('TravelCitysFrame');
        var twcf=window.frames.TravelCitysFrame;
        twcf.b=boxs.value;
        twcf.SetListInfo();
    }
    else
    {
        var tcf=document.getElementById('TravelToCitysFrame');
        var twcf=window.frames.TravelToCitysFrame;
        twcf.b=boxs.value;
        twcf.SetListInfo();
    }
}
AirFlightClass.prototype.FrameDocumentHeight = function(str,info,ct)
{
    
    var TravelFromFrame = window.parent.document.getElementById("TravelFromFrame");
     
    TravelFromFrame.style.height=(str+2)+"px";
    var box = window.parent.document.getElementById(ct);
    box.value=info;
}
AirFlightClass.prototype.SetFrameDefaultValue = function(box)
{
    var boxs = window.parent.document.getElementById(box);
    if(box=="hotelcity")
    {
        var tcf=document.getElementById('HotelCitysFrame');
        var twcf=window.frames.HotelCitysFrame;
        twcf.b=boxs.value;
        twcf.SetListInfo();
    }
    else
    {
        var tcf=document.getElementById('TravelTocityFrame');
        var twcf=window.frames.TravelTocityFrame;
        twcf.b=boxs.value;
        twcf.SetListInfo();
    }
}
AirFlightClass.prototype.ShowTravelCityFrame = function(frame,box,valuehidden)
{
    var tcf=document.getElementById(frame);
   
    var twcf = eval("window.frames."+frame);
    twcf.firstvalue="";
 	twcf.b="";
 	twcf.citycode="";
	tcf.onmouseover=function()
	{framestatefocus=true;} 
	tcf.onmouseout=function()
	{framestatefocus=false;} 
	this.SetOjbectWay(box,frame,100);
	tcf.style.display="block";
	framestatefocus=false;
}
AirFlightClass.prototype.ShowTicketAirPortsCityFrame = function(box,valuehidden)
{
    var tcf=document.getElementById("TravelTicketcityFrame");
    var twcf=window.frames.TravelTicketcityFrame;
    twcf.CityBox = box;
    twcf.CityCodeHidden = valuehidden;
    twcf.firstvalue="";
	twcf.firstcode="";
	twcf.b="";
    var boxs = this.$(box);
     twcf.b=boxs.value;
    twcf.SetListInfo();
	tcf.onmouseover=function()
	{framestatefocus=true;} 
	tcf.onmouseout=function()
	{framestatefocus=false;} 
	this.SetOjbectWay(box,"TravelTicketcityFrame",100);
	tcf.style.display="block";
	framestatefocus=false;
 }

AirFlightClass.prototype.ShowTicketFlightLiFrame = function(box,valuehidden)
{
    var tcf=document.getElementById("TravelFlightLiFrame");
    var twcf=window.frames.TravelFlightLiFrame;
    twcf.CityBox = box;
    twcf.CityCodeHidden = valuehidden;
    twcf.firstvalue="";
	twcf.firstcode="";
	twcf.b="";
    var boxs = this.$(box);
    twcf.SetListInfo();
	tcf.onmouseover=function()
	{framestatefocus=true;} 
	tcf.onmouseout=function()
	{framestatefocus=false;} 
	this.SetOjbectWay(box,"TravelFlightLiFrame",100);
	tcf.style.display="block";
	framestatefocus=false;
}

AirFlightClass.prototype.ShowInterTicketAirPortsCityFrame = function(box,valuehidden)
{
    var tcf=document.getElementById("InterTravelTicketcityFrame");
    var twcf=window.frames.InterTravelTicketcityFrame;
    twcf.CityBox = box;
    twcf.CityCodeHidden = valuehidden;
    twcf.firstvalue="";
	twcf.firstcode="";
	twcf.b="";
    var boxs = this.$(box);
    twcf.SetListInfo();
	tcf.onmouseover=function()
	{framestatefocus=true;} 
	tcf.onmouseout=function()
	{framestatefocus=false;} 
	this.SetOjbectWay(box,"InterTravelTicketcityFrame",100);
	tcf.style.display="block";
	framestatefocus=false;
}
AirFlightClass.prototype.HiddenTicketAirPortsCityFrame = function(box,valuehidden)
{
    var cf = document.getElementById("TravelTicketcityFrame");
    var twcf=window.frames.TravelTicketcityFrame;
    
    
	if(cf!=null)
	if(!framestatefocus)
	{
	    this.$(box).value=twcf.firstvalue;
	    this.$(valuehidden).value=twcf.firstcode;
		cf.style.display="none";
		twcf.firstvalue="";
		twcf.firstcode="";
		twcf.b="";
     }
}
AirFlightClass.prototype.HiddenTicketFlightLiFrame = function(box,valuehidden)
{
    var cf = document.getElementById("TravelFlightLiFrame");
    var twcf=window.frames.TravelFlightLiFrame;
	if(cf!=null)
	if(!framestatefocus)
	{
	    this.$(box).value=twcf.firstvalue;
	    this.$(valuehidden).value=twcf.firstcode;
		cf.style.display="none";
		twcf.firstvalue="";
		twcf.firstcode="";
		twcf.b="";
     }

}
AirFlightClass.prototype.HiddenInterTicketAirPortsCityFrame = function(box,valuehidden)
{
    var cf = document.getElementById("InterTravelTicketcityFrame");
    var twcf=window.frames.InterTravelTicketcityFrame;
	if(cf!=null)
	if(!framestatefocus)
	{
	    this.$(box).value=twcf.firstvalue;
	    this.$(valuehidden).value=twcf.firstcode;
		cf.style.display="none";
		twcf.firstvalue="";
		twcf.firstcode="";
		twcf.b="";
     }
}
AirFlightClass.prototype.SetAirPortsFrameDefaultValue = function(box)
{
    var box = this.$(box);
    var tcf=document.getElementById('TravelTicketcityFrame');
    var twcf=window.frames.TravelTicketcityFrame;
    twcf.b=box.value;
    twcf.SetListInfo();
}
AirFlightClass.prototype.SetFlightLiFrameDefaultValue = function(box)
{
    var box = this.$(box);
    var tcf=document.getElementById('TravelFlightLiFrame');
    var twcf=window.frames.TravelFlightLiFrame;
    twcf.b=box.value;
    twcf.SetListInfo();
}
AirFlightClass.prototype.SetInterAirPortsFrameDefaultValue = function(box)
{
    var box = this.$(box);
    var tcf=document.getElementById('InterTravelTicketcityFrame');
    var twcf=window.frames.InterTravelTicketcityFrame;
    twcf.b=box.value;
    twcf.SetListInfo();
}
AirFlightClass.prototype.SelectTicketAirPortsCityCode = function(str,code,ct,hidds,fr)
{
	var box = window.parent.document.getElementById(ct);
	var codes = window.parent.document.getElementById(hidds);
	box.value=str;
	codes.value=code;
	var frame=window.parent.document.getElementById(fr);
	frame.style.display="none";
}
AirFlightClass.prototype.HiddenTravelCityFrame = function(ff)
{
    var cf = document.getElementById(ff);
	if(cf!=null)
	if(!framestatefocus)
	{
		cf.style.display="none";
     }
}
AirFlightClass.prototype.HiddenTravelTCityFrame = function(TravelTcity,TravelTcityCode,TravelPlace,TravelLove)
{
    var cf = document.getElementById("TravelCitysFrame");
    var twcf=window.frames.TravelCitysFrame;
	if(cf!=null)
	if(!framestatefocus)
	{
	    this.$(TravelTcity).value=twcf.firstvalue;
 	    this.$(TravelTcityCode).value=twcf.citycode;
	    
		cf.style.display="none";
     }
}
AirFlightClass.prototype.HiddenToTravelTCityFrame = function(TravelTcity,TravelTcityCode,TravelPlace,TravelLove)
{
    var cf = document.getElementById("TravelToCitysFrame");
    var twcf=window.frames.TravelToCitysFrame;
	if(cf!=null)
	if(!framestatefocus)
	{
	    this.$(TravelTcity).value=twcf.firstvalue;
 	    this.$(TravelTcityCode).value=twcf.citycode;
	    
		cf.style.display="none";
     }
}
AirFlightClass.prototype.HiddenHotelCityFrame = function()
{
    var cf = document.getElementById("HotelCitysFrame");
    var twcf=window.frames.HotelCitysFrame;
	if(cf!=null)
	if(!framestatefocus)
	{
	    this.$("hotelcity").value=twcf.firstvalue;
	    this.$("hotelcitycodeletter").value=twcf.citycode;
	    try{
	    AirFlight.SetSelectListInfo('Landmarks',CityLandArray,'hotelcitycodeletter','地标');AirFlight.SetSelectListInfo('Locatios',CityAreaArray,'hotelcitycodeletter','行政区');
	 } catch(err)
	 {}  
		cf.style.display="none";
     }
}
AirFlightClass.prototype.HiddenFrame = function(frame,box)
{
	var cf = document.getElementById(frame);
    var twcf=eval("window.frames."+frame);
	if(cf!=null)
		if(!framestatefocus)
		{
			this.$(box).value=twcf.firstvalue;
			cf.style.display="none";
		 }
}
//城市切换
AirFlightClass.prototype.SelectAvTypeForCityDate = function(bnt)
{
    var flight_twocity = this.$("flight_twocity");
    var flight_twodate = this.$("flight_twodate");
    var flight_threecity = this.$("flight_threecity");
    var flight_twodateli = this.$("flight_twodateli");
    if(bnt==1)
    {
        flight_twocity.innerHTML="目的城市";
        flight_twodateli.style.display="none";
        flight_threecity.style.display="none";
		if(this.$("flight_twotime")!=null)
		{
			this.$("flight_twotime").innerHTML="返程时间";
			this.$("flight_twotimeli").style.display="none";
		}
		
    }
    if(bnt==2)
    {
        flight_twocity.innerHTML="目的城市";
        flight_twodate.innerHTML="返程日期";
        flight_twodateli.style.display="block";
        flight_threecity.style.display="none";
		if(this.$("flight_twotime")!=null)
		{
			this.$("flight_twotime").innerHTML="返程时间";
			this.$("flight_twotimeli").style.display="block";
		}
    }
    if(bnt==3)
    {
        flight_twocity.innerHTML="中转城市";
        flight_twodate.innerHTML="中转日期";
        flight_twodateli.style.display="block";
        flight_threecity.style.display="block";
		if(this.$("flight_twotime")!=null)
		{
			this.$("flight_twotime").innerHTML="中转时间";
			this.$("flight_twotimeli").style.display="block";
		}
    }
}

AirFlightClass.prototype.SelectInterAvTypeForCityDate = function(bnt)
{
    var flight_twodate = this.$("interrspan");
    if(bnt==1)
    {
         flight_twodate.style.display="none";
     }
    if(bnt==2)
    {
        
        flight_twodate.style.display="block";
        
    }
     
}
AirFlightClass.prototype.changebuybntstyle = function(e,c)
{
	e.className=c;
}
AirFlightClass.prototype.openorderpage = function(page)
{

}
AirFlightClass.prototype.searchanyvalue = function(page)
{
   var startDate = this.$("startDate");
   var returnDate = this.$("returnDate");
   window.location=page+"&sdate="+startDate.value+"&edate="+returnDate.value;
}
AirFlightClass.prototype.SetOjbectWay = function(a,b,widths)
{
    var cf = this.$(b);
    var eT=0,eL=0,p=this.$(a);
    var sT=document.body.scrollTop,sL=document.body.scrollLeft;
    var eH=this.$(a).clientHeight,eW=this.$(a).clientWidth;
    while(p&&p.tagName!="BODY"){eT+=p.offsetTop;eL+=p.offsetLeft;p=p.offsetParent;}
 
    cf.style.top=eT+eH+1+"px";
	cf.style.left=((document.body.clientWidth-(eL-sL)>=widths)?eL:eL+eW-widths)+"px";
}
AirFlightClass.prototype.ShowSortAvResult = function()
{
    
    if(framestatefocus==false)
    {
        framestatefocus=true;
    }else{
        framestatefocus=false;
    }
    this.SetOjbectWay("sortresultinfos","sortavresultbnt",114);
    if(framestatefocus)
    {
    this.$("sortavresultbnt").style.display="block";
    }else{
    this.$("sortavresultbnt").style.display="none";
    }
    
}
 
AirFlightClass.prototype.SetDateTimeInfo = function(a)
{
	var tcf=document.getElementById("TimeCalFrame");
	var twcf=window.frames.TimeCalFrame;
	tcf.onmouseover=function()
	{timestatefoucs=true;} 
	tcf.onmouseout=function()
	{timestatefoucs=false;} 
	this.SetOjbectWay(a,"TimeCalFrame",122);
	tcf.style.display="block";
	twcf.timebox=a;
	
	timestatefoucs=false;
	tcf.style.width=125+"px";
	tcf.style.height=110+"px";
}
AirFlightClass.prototype.AvLog = function()
 {
 var SpecialImgs = "<img src=\"/skin/images/flight/special.gif\"  hspace=\"3\" align=\"absmiddle\">";
    var onetrip = this.$("onetrip2");
    var twotrip = this.$("twotrip2");
    var flight_loginfo = this.$("flight_loginfo");
    var onetripitem = onetrip.value.split(",");
    var tripinfos="";
   if(onetrip.value!="")
   {
   var specialhead="";
                if(onetripitem=="1")
                {
                    specialhead=SpecialImgs;
                }
    tripinfos+="<div class=\"flight_avlog_li_main\">";
    tripinfos+="<div class=\"flight_avlog_li_trip0\"></div>";
    tripinfos+="<div class=\"flight_page_lineflight_fullhead_li_str\" style=\"font-size:12px; color:#333333;line-height:20px;width:90px;\"><img src=\"../skin/airways/"+onetripitem[3]+".gif\" width=\"16\" height=\"16\" hspace=\"3\" align=\"absmiddle\" />"+onetripitem[4]+"<br />"+onetripitem[6]+"</div><div class=\"flight_page_lineflight_fullhead_li_str\" style=\"font-size:12px; color:#333333;line-height:40px;width:100px; \"><span class=\"flight_list_air_ftimes\">"+onetripitem[80]+"</span></div><div class=\"flight_page_lineflight_fullhead_li_str\" style=\"font-size:12px; color:#333333;line-height:20px;width:160px;text-align:left;\" title=\""+onetripitem[15]+"\"><span class=\"flight_list_air_ftimes\">"+onetripitem[13]+"</span>&nbsp;&nbsp;"+onetripitem[9]+"<br /><span class=\"flight_list_air_etimes\">"+onetripitem[14]+"</span>&nbsp;&nbsp;"+onetripitem[12]+"</div><div class=\"flight_page_lineflight_fullhead_li_str\" style=\"font-size:12px; color:#333333;line-height:40px;width:80px; \">机型"+onetripitem[66]+"</div><div class=\"flight_page_lineflight_fullhead_li_str\" style=\"color:#666;line-height:20px;width:70px;font-size:12px \">机建&yen;<span style=\"font-weight:bold;font-size:14px;\">"+onetripitem[39]+"</span><br />燃油&yen;<span style=\"font-weight:bold;font-size:14px;\">"+onetripitem[42]+"</span></div>";
     
                    
    tripinfos+="<div class=\"flight_page_lineflight_fullhead_li_str\" style=\"font-size:12px; color:#333333;line-height:20px;width:80px;\">"+specialhead+onetripitem[88]+"<br/><span title=\""+onetripitem[23]+"\" class=\"flight_list_air_rules\">退改签</span></div>";
                    
    tripinfos+="<div class=\"flight_page_lineflight_fullhead_li_str\" style=\"font-size:12px; color:#666;line-height:40px;width:70px;\">&yen;<span style=\"font-size:16px; font-weight:bold; color:#FF0000;\">"+onetripitem[63]+"</span>/成人</div>";
     tripinfos+="</div>";
 }
    if(twotrip.value!="")
    {
    var specialhead="";
                if(onetripitem=="1")
                {
                    specialhead=SpecialImgs;
                }
        onetripitem = twotrip.value.split(",");
        tripinfos+="<div class=\"flight_avlog_li_main\">";
    tripinfos+="<div class=\"flight_avlog_li_trip1\"></div>";
    tripinfos+="<div class=\"flight_page_lineflight_fullhead_li_str\" style=\"font-size:12px; color:#333333;line-height:20px;width:90px;\"><img src=\"../skin/airways/"+onetripitem[3]+".gif\" width=\"16\" height=\"16\" hspace=\"3\" align=\"absmiddle\" />"+onetripitem[4]+"<br />"+onetripitem[6]+"</div><div class=\"flight_page_lineflight_fullhead_li_str\" style=\"font-size:12px; color:#333333;line-height:40px;width:100px; \"><span class=\"flight_list_air_ftimes\">"+onetripitem[80]+"</span></div><div class=\"flight_page_lineflight_fullhead_li_str\" style=\"font-size:12px; color:#333333;line-height:20px;width:160px;text-align:left;\" title=\""+onetripitem[15]+"\"><span class=\"flight_list_air_ftimes\">"+onetripitem[13]+"</span>&nbsp;&nbsp;"+onetripitem[9]+"<br /><span class=\"flight_list_air_etimes\">"+onetripitem[14]+"</span>&nbsp;&nbsp;"+onetripitem[12]+"</div><div class=\"flight_page_lineflight_fullhead_li_str\" style=\"font-size:12px; color:#333333;line-height:40px;width:80px; \">机型"+onetripitem[66]+"</div><div class=\"flight_page_lineflight_fullhead_li_str\" style=\"color:#666;line-height:20px;width:70px;font-size:12px \">机建&yen;<span style=\"font-weight:bold;font-size:14px;\">"+onetripitem[39]+"</span><br />燃油&yen;<span style=\"font-weight:bold;font-size:14px;\">"+onetripitem[42]+"</span></div>";
     
                    
    tripinfos+="<div class=\"flight_page_lineflight_fullhead_li_str\" style=\"font-size:12px; color:#333333;line-height:20px;width:80px;\">"+specialhead+onetripitem[88]+"<br/><span title=\""+onetripitem[23]+"\" class=\"flight_list_air_rules\">退改签</span></div>";
                    
    tripinfos+="<div class=\"flight_page_lineflight_fullhead_li_str\" style=\"font-size:12px; color:#666;line-height:40px;width:80px; \">价格&yen;<span style=\"font-size:16px;font-weight:bold; color:#FF0000;\">"+onetripitem[63]+"</span>/成人</div>";
     tripinfos+="</div>";
    }
    flight_loginfo.innerHTML = tripinfos;
    
    var billpaybank = this.$("billpaybank");
    if(billpaybank!=null)
    {
        var PayType=this.$$("PayType");
        if(PayType!=null)
        {
            if(PayType.length>0)
            {
                if(PayType[0].value=="102")
                {
                    billpaybank.style.display="block";
                }else{
                    billpaybank.style.display="none";
                }
            }
        }
    }
 }
 AirFlightClass.prototype.AvLog3 = function()
 {
    var onetrip = this.$("onetrip");
    var twotrip = this.$("twotrip");
    var flight_loginfo = this.$("flight_loginfo");
    var onetripitem = onetrip.value.split(",");
   
    var tripinfos="<div class=\"flight_log_li\"><div class=\"flight_log_li_head\"><div class=\"flight_log_head_ways\" style=\"font-size:14px; font-weight:bold;color:#666;line-height:20px;width:180px;\"><img src=\"../skin/airways/"+onetripitem[3]+".gif\" width=\"16\" height=\"16\" hspace=\"3\" align=\"absmiddle\" />"+onetripitem[6]+"<br />"+onetripitem[5]+"</div><div class=\"flight_log_head_ways\" style=\"font-size:12px; font-weight:bold;text-align:left;color:#666;line-height:40px;width:90px;\">"+onetripitem[66]+"</div><div class=\"flight_log_head_ways\" style=\"font-size:12px; text-align:left;color:#333333;line-height:20px;width:240px;\">"+onetripitem[13]+"&nbsp;起飞："+onetripitem[9]+"<br />"+onetripitem[14]+"&nbsp;抵达："+onetripitem[12]+"</div><div class=\"flight_log_head_ways\" style=\"font-size:12px; font-weight:bold;text-align:left;color:#666;line-height:40px;width:160px;\">历时："+onetripitem[15]+"&nbsp;&nbsp;"+onetripitem[19]+"公里</div></div><div class=\"flight_log_li_head_seat_head\"><div class=\"flight_page_lineflight_fullhead_chdli_head_str\" style=\"width:130px;\">舱位</div><div class=\"flight_page_lineflight_fullhead_chdli_head_str\" style=\"width:130px;\">行程日期</div><div class=\"flight_page_lineflight_fullhead_chdli_head_str\" style=\"width:100px;\">机建／燃油</div><div class=\"flight_page_lineflight_fullhead_chdli_head_str\" style=\"width:90px;\">票面价格</div><div class=\"flight_page_lineflight_fullhead_chdli_head_str\" style=\"width:90px;\">奖金</div><div class=\"flight_page_lineflight_fullhead_chdli_head_str\" style=\"width:90px;\">会员价</div><div class=\"flight_page_lineflight_fullhead_chdli_head_str\" style=\"width:100px;\">小计</div></div><div class=\"flight_log_li_head_seat_head_info\"><div class=\"flight_page_lineflight_fullhead_chdli_head_str\" style=\"width:130px;color:#0066CC;\">"+onetripitem[25]+"("+onetripitem[20]+")</div><div class=\"flight_page_lineflight_fullhead_chdli_head_str\" style=\"width:130px;color:#000000;\">"+onetripitem[80]+"</div><div class=\"flight_page_lineflight_fullhead_chdli_head_str\" style=\"width:100px;font-weight:bold;\">"+onetripitem[39]+"&yen;／"+onetripitem[42]+"&yen;</div><div class=\"flight_page_lineflight_fullhead_chdli_head_str\" style=\"width:90px;font-weight:bold;text-decoration: line-through;\">"+onetripitem[22]+"&yen;</div><div class=\"flight_page_lineflight_fullhead_chdli_head_str\" style=\"width:90px;color:#FF6600; font-weight:bold;\">"+onetripitem[60]+"&yen;</div><div class=\"flight_page_lineflight_fullhead_chdli_head_str\" style=\"width:90px;color:#FF0000; font-weight:bold;\">"+(parseInt(onetripitem[22])-parseInt(onetripitem[60]))+"&yen;</div><div class=\"flight_page_lineflight_fullhead_chdli_head_str\" style=\"width:100px;\">"+(parseInt(onetripitem[39])+parseInt(onetripitem[42])+parseInt(onetripitem[22])-parseInt(onetripitem[60]))+"&yen;</div></div><div class=\"flight_log_li_head_seat_head_inforule\" style=\"color:#ff0000;font-size:14px;\" >退改签规定："+onetripitem[23]+"</div></div>";
    if(twotrip.value!="")
    {
        onetripitem = twotrip.value.split(",");
        tripinfos+="<div class=\"flight_log_li\"><div class=\"flight_log_li_head\"><div class=\"flight_log_head_ways\" style=\"font-size:14px; font-weight:bold;color:#666;line-height:20px;width:180px;\"><img src=\"../skin/airways/"+onetripitem[3]+".gif\" width=\"16\" height=\"16\" hspace=\"3\" align=\"absmiddle\" />"+onetripitem[6]+"<br />"+onetripitem[5]+"</div><div class=\"flight_log_head_ways\" style=\"font-size:12px; font-weight:bold;text-align:left;color:#666;line-height:40px;width:90px;\">"+onetripitem[66]+"</div><div class=\"flight_log_head_ways\" style=\"font-size:12px; text-align:left;color:#333333;line-height:20px;width:240px;\">"+onetripitem[13]+"&nbsp;起飞："+onetripitem[9]+"<br />"+onetripitem[14]+"&nbsp;抵达："+onetripitem[12]+"</div><div class=\"flight_log_head_ways\" style=\"font-size:12px; font-weight:bold;text-align:left;color:#666;line-height:40px;width:160px;\">历时："+onetripitem[15]+"&nbsp;&nbsp;"+onetripitem[19]+"公里</div></div><div class=\"flight_log_li_head_seat_head\"><div class=\"flight_page_lineflight_fullhead_chdli_head_str\" style=\"width:130px;\">舱位</div><div class=\"flight_page_lineflight_fullhead_chdli_head_str\" style=\"width:130px;\">行程日期</div><div class=\"flight_page_lineflight_fullhead_chdli_head_str\" style=\"width:100px;\">机建／燃油</div><div class=\"flight_page_lineflight_fullhead_chdli_head_str\" style=\"width:90px;\">票面价格</div><div class=\"flight_page_lineflight_fullhead_chdli_head_str\" style=\"width:90px;\">奖金</div><div class=\"flight_page_lineflight_fullhead_chdli_head_str\" style=\"width:90px;\">会员价</div><div class=\"flight_page_lineflight_fullhead_chdli_head_str\" style=\"width:100px;\">小计</div></div><div class=\"flight_log_li_head_seat_head_info\"><div class=\"flight_page_lineflight_fullhead_chdli_head_str\" style=\"width:130px;color:#0066CC;\">"+onetripitem[25]+"("+onetripitem[20]+")</div><div class=\"flight_page_lineflight_fullhead_chdli_head_str\" style=\"width:130px;color:#000000;\">"+onetripitem[80]+"</div><div class=\"flight_page_lineflight_fullhead_chdli_head_str\" style=\"width:100px;font-weight:bold;\">"+onetripitem[39]+"&yen;／"+onetripitem[42]+"&yen;</div><div class=\"flight_page_lineflight_fullhead_chdli_head_str\" style=\"width:90px;font-weight:bold;text-decoration: line-through;\">"+onetripitem[22]+"&yen;</div><div class=\"flight_page_lineflight_fullhead_chdli_head_str\" style=\"width:90px;color:#FF6600; font-weight:bold;\">"+onetripitem[60]+"&yen;</div><div class=\"flight_page_lineflight_fullhead_chdli_head_str\" style=\"width:90px;color:#FF0000; font-weight:bold;\">"+(parseInt(onetripitem[22])-parseInt(onetripitem[60]))+"&yen;</div><div class=\"flight_page_lineflight_fullhead_chdli_head_str\" style=\"width:100px;\">"+(parseInt(onetripitem[39])+parseInt(onetripitem[42])+parseInt(onetripitem[22])-parseInt(onetripitem[60]))+"&yen;</div></div><div class=\"flight_log_li_head_seat_head_inforule\"  style=\"color:#ff0000;font-size:14px;\">退改签规定："+onetripitem[23]+"</div></div>";
    }
    flight_loginfo.innerHTML = tripinfos;
    
    var billpaybank = this.$("billpaybank");
    if(billpaybank!=null)
    {
        var PayType=this.$$("PayType");
        if(PayType!=null)
        {
            if(PayType.length>0)
            {
                if(PayType[0].value=="102")
                {
                    billpaybank.style.display="block";
                }else{
                    billpaybank.style.display="none";
                }
            }
        }
    }
 }
 AirFlightClass.prototype.AvLog2 = function()
 {
    var onetrip = this.$("onetrip");
    var twotrip = this.$("twotrip");
    var flight_loginfo = this.$("flight_loginfo");
    var onetripitem = null;
   var tripinfos="";
   if(onetrip.value!="")
   {
    onetripitem = onetrip.value.split(",");
    tripinfos+="<div class=\"passenger_flight_trip_head\">";
tripinfos+="<div class=\"passenger_flight_trip_head_title\" style=\"width:100px;\">航空公司</div>";
tripinfos+="<div class=\"passenger_flight_trip_head_title\" style=\"width:80px;\">航班号</div>";
tripinfos+="<div class=\"passenger_flight_trip_head_title\" style=\"width:110px;\">航程日期</div>";
tripinfos+="<div class=\"passenger_flight_trip_head_title\" style=\"width:160px;\">起飞时间/机场</div>";
tripinfos+="<div class=\"passenger_flight_trip_head_title\" style=\"width:160px;\">抵达时间/机场</div>";
tripinfos+="<div class=\"passenger_flight_trip_head_title\" style=\"width:80px;\">机场建设费</div>";
tripinfos+="<div class=\"passenger_flight_trip_head_title\" style=\"width:80px;\">燃油费</div>";
tripinfos+="<div class=\"passenger_flight_trip_head_title\" style=\"width:80px;\">机票价格</div>";
tripinfos+="<div class=\"passenger_flight_trip_head_title\" style=\"width:90px;\">单张合计价格</div>";
tripinfos+="</div>";
tripinfos+="<div class=\"passenger_flight_trip_main\">";
tripinfos+="<div class=\"passenger_flight_trip_infomain\">";
tripinfos+="<div class=\"passenger_flight_trip_infostr\" style=\"width:100px;line-height:50px;\"><img src=\"../skin/airways/"+onetripitem[3]+".gif\" width=\"16\" height=\"16\" hspace=\"3\" align=\"absmiddle\" />"+onetripitem[4]+"</div>";
tripinfos+="<div class=\"passenger_flight_trip_infostr\" style=\"width:80px;line-height:50px;\">"+onetripitem[6]+"</div>";
tripinfos+="<div class=\"passenger_flight_trip_infostr\" style=\"width:110px;line-height:50px;\">"+onetripitem[80]+"</div>";
tripinfos+="<div class=\"passenger_flight_trip_infostr\" style=\"width:160px;line-height:50px;\">"+onetripitem[13]+"&nbsp;&nbsp;"+onetripitem[9]+"</div>";
tripinfos+="<div class=\"passenger_flight_trip_infostr\" style=\"width:160px;line-height:50px;\">"+onetripitem[14]+"&nbsp;&nbsp;"+onetripitem[12]+"</div>";
tripinfos+="<div class=\"passenger_flight_trip_infostr\" style=\"width:80px;line-height:25px;\">&yen;"+onetripitem[39]+"";
tripinfos+="<br />";
tripinfos+="<span class=\"passenger_flight_trip_chdotherprice\">&yen;"+onetripitem[40]+"</span>";
tripinfos+="</div>";
tripinfos+="<div class=\"passenger_flight_trip_infostr\" style=\"width:80px;line-height:25px;\">&yen;"+onetripitem[42]+"";
tripinfos+="<br />";
tripinfos+="<span class=\"passenger_flight_trip_chdotherprice\">&yen;"+onetripitem[43]+"</span></div>";
tripinfos+="<div class=\"passenger_flight_trip_infostr\" style=\"width:80px;line-height:25px;\">&yen;"+onetripitem[63]+"";
tripinfos+="<br />";
tripinfos+="<span class=\"passenger_flight_trip_chdotherprice\">&yen;"+onetripitem[64]+"</span></div>";
tripinfos+="<div class=\"passenger_flight_trip_infostr\" style=\"width:90px;line-height:25px;\">";
tripinfos+="<div class=\"passenger_flight_trip_mantp\">成人</div><span class=\"passenger_flight_trip_priceli\">&yen;"+(parseInt(onetripitem[63])+parseInt(onetripitem[39])+parseInt(onetripitem[42]))+"</span>";
tripinfos+="<br />";
tripinfos+="<div class=\"passenger_flight_trip_mantp\">儿童</div><span class=\"passenger_flight_trip_chdpriceli\">&yen;"+(parseInt(onetripitem[64])+parseInt(onetripitem[40])+parseInt(onetripitem[43]))+"</span>";
tripinfos+="</div>";
tripinfos+="</div>";
tripinfos+="<div class=\"passenger_flight_trip_spaceline\"></div>";
tripinfos+="<div class=\"passenger_flight_trip_inforule_str\">"+onetripitem[23]+"</div>";
tripinfos+="</div>";
tripinfos+="<div class=\"passenger_flight_trip_bottom\"></div>";
    }
    if(twotrip.value!="")
    {
        onetripitem = twotrip.value.split(",");
        tripinfos+="<div class=\"passenger_flight_trip_head\">";
tripinfos+="<div class=\"passenger_flight_trip_head_title\" style=\"width:100px;\">航空公司</div>";
tripinfos+="<div class=\"passenger_flight_trip_head_title\" style=\"width:80px;\">航班号</div>";
tripinfos+="<div class=\"passenger_flight_trip_head_title\" style=\"width:110px;\">航程日期</div>";
tripinfos+="<div class=\"passenger_flight_trip_head_title\" style=\"width:160px;\">起飞时间/机场</div>";
tripinfos+="<div class=\"passenger_flight_trip_head_title\" style=\"width:160px;\">抵达时间/机场</div>";
tripinfos+="<div class=\"passenger_flight_trip_head_title\" style=\"width:80px;\">机场建设费</div>";
tripinfos+="<div class=\"passenger_flight_trip_head_title\" style=\"width:80px;\">燃油费</div>";
tripinfos+="<div class=\"passenger_flight_trip_head_title\" style=\"width:80px;\">机票价格</div>";
tripinfos+="<div class=\"passenger_flight_trip_head_title\" style=\"width:90px;\">单张合计价格</div>";
tripinfos+="</div>";
tripinfos+="<div class=\"passenger_flight_trip_main\">";
tripinfos+="<div class=\"passenger_flight_trip_infomain\">";
tripinfos+="<div class=\"passenger_flight_trip_infostr\" style=\"width:100px;line-height:50px;\"><img src=\"../skin/airways/"+onetripitem[3]+".gif\" width=\"16\" height=\"16\" hspace=\"3\" align=\"absmiddle\" />"+onetripitem[4]+"</div>";
tripinfos+="<div class=\"passenger_flight_trip_infostr\" style=\"width:80px;line-height:50px;\">"+onetripitem[6]+"</div>";
tripinfos+="<div class=\"passenger_flight_trip_infostr\" style=\"width:110px;line-height:50px;\">"+onetripitem[80]+"</div>";
tripinfos+="<div class=\"passenger_flight_trip_infostr\" style=\"width:160px;line-height:50px;\">"+onetripitem[13]+"&nbsp;&nbsp;"+onetripitem[9]+"</div>";
tripinfos+="<div class=\"passenger_flight_trip_infostr\" style=\"width:160px;line-height:50px;\">"+onetripitem[14]+"&nbsp;&nbsp;"+onetripitem[12]+"</div>";
tripinfos+="<div class=\"passenger_flight_trip_infostr\" style=\"width:80px;line-height:25px;\">&yen;"+onetripitem[39]+"";
tripinfos+="<br />";
tripinfos+="<span class=\"passenger_flight_trip_chdotherprice\">&yen;"+onetripitem[40]+"</span>";
tripinfos+="</div>";
tripinfos+="<div class=\"passenger_flight_trip_infostr\" style=\"width:80px;line-height:25px;\">&yen;"+onetripitem[42]+"";
tripinfos+="<br />";
tripinfos+="<span class=\"passenger_flight_trip_chdotherprice\">&yen;"+onetripitem[43]+"</span></div>";
tripinfos+="<div class=\"passenger_flight_trip_infostr\" style=\"width:80px;line-height:25px;\">&yen;"+onetripitem[63]+"";
tripinfos+="<br />";
tripinfos+="<span class=\"passenger_flight_trip_chdotherprice\">&yen;"+onetripitem[64]+"</span></div>";
tripinfos+="<div class=\"passenger_flight_trip_infostr\" style=\"width:90px;line-height:25px;\">";
tripinfos+="<div class=\"passenger_flight_trip_mantp\">成人</div><span class=\"passenger_flight_trip_priceli\">&yen;"+(parseInt(onetripitem[63])+parseInt(onetripitem[39])+parseInt(onetripitem[42]))+"</span>";
tripinfos+="<br />";
tripinfos+="<div class=\"passenger_flight_trip_mantp\">儿童</div><span class=\"passenger_flight_trip_chdpriceli\">&yen;"+(parseInt(onetripitem[64])+parseInt(onetripitem[40])+parseInt(onetripitem[43]))+"</span>";
tripinfos+="</div>";
tripinfos+="</div>";
tripinfos+="<div class=\"passenger_flight_trip_spaceline\"></div>";
tripinfos+="<div class=\"passenger_flight_trip_inforule_str\">"+onetripitem[23]+"</div>";
tripinfos+="</div>";
tripinfos+="<div class=\"passenger_flight_trip_bottom\"></div>";
    }
     flight_loginfo.innerHTML = tripinfos;
 }
AirFlightClass.prototype.HiddenDateTimeInfo = function()
{
	var tcf=document.getElementById("TimeCalFrame");
 	if(!timestatefoucs)
	{
		 tcf.style.display="none";
	}
}
AirFlightClass.prototype.PostInterSearchFilght = function()
{
}
AirFlightClass.prototype.PostSearchFilght = function(str)
{
   var avtype=this.$$("Avtype");
    var fromcity=this.$("fromcity");
    var fromcode = this.$("fromcitycode").value;
    var tocity=this.$("tcity");
    var tocitycode=this.$("twocitycode").value;
    var transit = this.$("tocity");
    var transitcodes = this.$("tocitycode");
	var transitcode="";
	if(transit!=null)
	{
	transitcode = transitcodes.value;
	}
    
    var regcitycode=/^[a-zA-Z]{3}$/;
    if(!regcitycode.exec(fromcode))
    {
        alert("请选择起飞城市！");
        fromcity.focus();
        return false;
    }
    
    var tstate=1;
    for(var i=0;i<avtype.length;i++)
    {
        if(avtype[i].checked)
        {
            tstate=avtype[i].value;
            break;
        }
    }
    
    if(tstate==2 || tstate==1)
    {
        if(!regcitycode.exec(tocitycode))
        {
            alert("请选择目的城市！");
            tocity.focus();
            return false;
        }
        if(tocitycode==fromcode)
        {
            alert("起飞城市与目的城市不能相同！");
            tocity.focus();
            return false;
        }
    }
    if(tstate==3)
    {
        if(!regcitycode.exec(tocitycode))
        {
            alert("请选择中转城市！");
            tocity.focus();
            return false;
        }
        if(tocitycode==fromcode)
        {
            alert("起飞城市与中转城市不能相同！");
            tocity.focus();
            return false;
        }
        if(!regcitycode.exec(transitcode))
        {
            alert("请选择目的城市！");
            transit.focus();
            return false;
        }
        if(tocitycode==transitcode)
        {
            alert("目的城市与中转城市不能相同！");
            transit.focus();
            return false;
        }
        var tempcity=transitcode;
        transitcode = tocitycode;
        tocitycode = tempcity;
    }
    var fromdate=this.$("startDate");
    var returndate=this.$("returnDate");
    var regdate=/^[0-9]{4}[-][0-9]{2}[-][0-9]{2}$/;
    if(!regdate.exec(fromdate.value))
    {
        alert("请选择正确的出发时间！");
        fromdate.focus();
        return false;
    }
    if(tstate==2 || tstate==3)
    {
        if(!regdate.exec(returndate.value))
        {
            alert("请选择正确的第二程时间！");
            returndate.focus();
            return false;
        }
    }
    
    var fromtime = this.$("avftime");
    var totime = this.$("avstime");
     
    var airway;
     
        if(str!=null)
        {
            airway=this.$(str);
        }else{
        airway = this.$("airway");
        }
    
    var seattyep = this.$$("seattype");
    var searchuri="/flight/ticketsearch.aspx?avtype="+tstate+"&fromcity="+fromcode+"&tocity="+tocitycode+"&transitcity="+transitcode+"&startdate="+fromdate.value+"&returndate="+returndate.value;
    
    var regtime=/^[0-9]{2}[:][0-9]{2}$/;
    if(fromtime!=null)
    {
        if(regtime.exec(fromtime.value))
        {
            searchuri+="&starttime="+fromtime.value;
        }else{
            searchuri+="&starttime=00:00";
        }
    }else{
        searchuri+="&starttime=00:00";
    }
    if(totime!=null)
    {
        if(regtime.exec(totime.value))
        {
            searchuri+="&returntime="+totime.value;
        }else{
            searchuri+="&returntime=00:00";
        }
        
    }else{
        searchuri+="&returntime=00:00";
    }
    if(airway!=null)
    {
        searchuri+="&airway="+airway.value;
    }else{
        searchuri+="&airway=";
    }
    searchuri+="&seattype=";
    if(seattyep!=null)
    {
        for(var i=0;i<seattyep.length;i++)
        {
            if(seattyep[i].checked)
            {
                searchuri+=seattyep[i].value;
                break;
            }
        }
    }
   
    window.location=searchuri;
    
}
AirFlightClass.prototype.FlightSpecialCityList = function(pagetype)
{
    if(FlightSpecialCity.length>0)
    {
        var flightspecialcity = this.$("flightspecialcity");
        var flightspecialcityli="";
        var citycount = FlightSpecialCity.length;
        for(var i=0;i<FlightSpecialCity.length;i++)
        {
            if(i==0)
            {
                flightspecialcityli+=" <div class=\"flight_special_cityhead_cityli_select\" id=\"fscitycodeid"+i+"\" onclick=\"AirFlight.FlightSpecialCitySelect("+i+","+citycount+","+pagetype+",'"+FlightSpecialCity[i][0]+"');\">"+FlightSpecialCity[i][1]+"</div>";
             }else{
                flightspecialcityli+="<div class=\"flight_special_cityhead_cityli_noselect\" id=\"fscitycodeid"+i+"\" onclick=\"AirFlight.FlightSpecialCitySelect("+i+","+citycount+","+pagetype+",'"+FlightSpecialCity[i][0]+"');\">"+FlightSpecialCity[i][1]+"</div>";
            }
        }
        flightspecialcity.innerHTML=flightspecialcityli;
    }
}
AirFlightClass.prototype.FlightIndexSpecialCityList = function(pagetype)
{
    if(FlightSpecialCity.length>0)
    {
        var flightspecialcity = this.$("flightspecialcity");
        var flightspecialcityli="";
        var citycount = FlightSpecialCity.length;
        for(var i=0;i<FlightSpecialCity.length;i++)
        {
            if(i==0)
            {
                flightspecialcityli+=" <div class=\"flight_special_cityhead_cityli_select\" id=\"fscitycodeid"+i+"\" onclick=\"AirFlight.FlightSpecialCitySelectIndex("+i+","+citycount+","+pagetype+",'"+FlightSpecialCity[i][0]+"');\">"+FlightSpecialCity[i][1]+"</div>";
             }else{
                flightspecialcityli+="<div class=\"flight_special_cityhead_cityli_noselect\" id=\"fscitycodeid"+i+"\" onclick=\"AirFlight.FlightSpecialCitySelectIndex("+i+","+citycount+","+pagetype+",'"+FlightSpecialCity[i][0]+"');\">"+FlightSpecialCity[i][1]+"</div>";
            }
        }
        flightspecialcity.innerHTML=flightspecialcityli;
    }
}
AirFlightClass.prototype.TowFlightSpecialCityList = function(pagetype)
{
    if(FlightSpecialCity.length>0)
    {
        var flightspecialcity = this.$("fligthspecialfcity");
        var flightspecialcityli="";
        var citycount = TowFlightSpecialCity.length;
        for(var i=0;i<TowFlightSpecialCity.length;i++)
        {
            if(i==0)
            {
                flightspecialcityli+=" <div class=\"flight_special_cityhead_cityli_select\" id=\"tfscitycodeid"+i+"\" onclick=\"AirFlight.TowFlightSpecialCitySelect("+i+","+citycount+","+pagetype+",'"+TowFlightSpecialCity[i][0]+"');\">"+TowFlightSpecialCity[i][1]+"</div>";
             }else{
                flightspecialcityli+="<div class=\"flight_special_cityhead_cityli_noselect\" id=\"tfscitycodeid"+i+"\" onclick=\"AirFlight.TowFlightSpecialCitySelect("+i+","+citycount+","+pagetype+",'"+TowFlightSpecialCity[i][0]+"');\">"+TowFlightSpecialCity[i][1]+"</div>";
            }
        }
        flightspecialcity.innerHTML=flightspecialcityli;
    }
}
AirFlightClass.prototype.FlightOrderSearch = function()
{
    var orderstate = this.$("orderstate").value;
    var ordernum = this.$("orderNum").value;
    var startdate = this.$("startDate").value;
    var etartdate = this.$("returnDate").value;
    if(ordernum!="")
    {
        var regoid = /^([aA]|[bB]|[cC]){0,1}[0-9]{0,30}$/;
	    if(!regoid.exec(ordernum))
	    {
		    alert("订单号格式不符合本系统规则,请重新尝试!");
		    this.$("orderNum").focus();
		    return false;
	    }
    }
    var datetime=/^[0-9]{4}[-][0-9]{2}[-][0-9]{2}$/;
    if(startdate!="")
    {
        if(!datetime.exec(startdate))
	    {
		    alert("日期格式不正确!");
		    this.$("startDate").focus();
		    return false;
	    }
    }
    if(etartdate!="")
    {
        if(!datetime.exec(etartdate))
	    {
		    alert("日期格式不正确!");
		    this.$("returnDate").focus();
		    return false;
	    }
    }
    window.location="/order/?state="+orderstate+"&oid="+ordernum+"&d1="+startdate+"&d2="+etartdate;
}
AirFlightClass.prototype.HotelOrderSearch = function()
{
    var orderstate = this.$("orderstate").value;
    var ordernum = this.$("orderNum").value;
    var startdate = this.$("startDate").value;
    var etartdate = this.$("returnDate").value;
    if(ordernum!="")
    {
        var regoid = /^([aA]|[bB]|[cC]){0,1}[0-9]{0,30}$/;
	    if(!regoid.exec(ordernum))
	    {
		    alert("订单号格式不符合本系统规则,请重新尝试!");
		    this.$("orderNum").focus();
		    return false;
	    }
    }
    var datetime=/^[0-9]{4}[-][0-9]{2}[-][0-9]{2}$/;
    if(startdate!="")
    {
        if(!datetime.exec(startdate))
	    {
		    alert("日期格式不正确!");
		    this.$("startDate").focus();
		    return false;
	    }
    }
    if(etartdate!="")
    {
        if(!datetime.exec(etartdate))
	    {
		    alert("日期格式不正确!");
		    this.$("returnDate").focus();
		    return false;
	    }
    }
    window.location="/order/hotelorder.aspx?h="+orderstate+"&oid="+ordernum+"&d1="+startdate+"&d2="+etartdate;
}
AirFlightClass.prototype.PostSearchTicketAvh = function()
{
    var avnumber = this.$("avnumber");
    var onetrip = this.$("onetrip");
    var twotrip = this.$("twotrip");
    var urls = this.$("urls");
    
    var firstvalue = this.$("firstvalue");
    var secondvalue = this.$("secondvalue");
    var avcount = this.$("avcount");
    
    onetrip.value = firstvalue.value;
    twotrip.value = secondvalue.value;
    avnumber.value = avcount.value;
    this.$("agentid").value = this.$("agentids").value;
     var SearchUrl = this.$("SearchUrl");
    var urlid = this.$("urlid");
    
    urlid.value = SearchUrl.value;
    var sendavhbooking = this.$("sendavhbooking");
    sendavhbooking.action = "result.aspx?"+urls.value;
    sendavhbooking.submit();
}
AirFlightClass.prototype.PostTowSearchTicketAvh = function()
{
    var avnumber = this.$("avnumber");
    var onetrip = this.$("onetrip");
    var twotrip = this.$("twotrip");
    var urls = this.$("urls");
    
    var firstvalue = this.$("firstvalue");
    var secondvalue = this.$("secondvalue");
    var avcount = this.$("avcount");
    
    onetrip.value = firstvalue.value;
    twotrip.value = secondvalue.value;
    avnumber.value = avcount.value;
     var SearchUrl = this.$("SearchUrl");
    var urlid = this.$("urlid");
    this.$("policy").value = this.$("policyid").value;
    
     
    urlid.value = SearchUrl.value;
    var sendavhbooking = this.$("sendavhbooking");
    sendavhbooking.action = "queryResult.aspx?"+urls.value;
    sendavhbooking.submit();
}
AirFlightClass.prototype.TowFlightSpecialCitySelect = function(indexnum,count,pagetype,citycode)
{
    for(var i=0;i<count;i++)
    {
        var li = this.$("tfscitycodeid"+i);
         if(i==indexnum)
        {
           li.className="flight_special_cityhead_cityli_select";
        }else{
            li.className="flight_special_cityhead_cityli_noselect";
         }
    }
    var loddiv = "<div class=\"spacelinfo_load_wait\">正在加载数据....</div>";
    this.$("flight_fspecial_list_info").innerHTML = loddiv;
    var FlightAjax = new AjaxPro("flight_fspecial_list_info");
    FlightAjax.Get("/flight/LoadFlightSpecialTow.aspx?citycode="+citycode+"&pagetype="+pagetype+"&rands="+Math.floor(Math.random()*100000+1));
}
AirFlightClass.prototype.FlightSpecialCitySelect = function(indexnum,count,pagetype,citycode)
{
    for(var i=0;i<count;i++)
    {
        var li = this.$("fscitycodeid"+i);
         if(i==indexnum)
        {
           li.className="flight_special_cityhead_cityli_select";
        }else{
            li.className="flight_special_cityhead_cityli_noselect";
         }
    }
    var loddiv = "<div class=\"spacelinfo_load_wait\">正在加载数据....</div>";
    this.$("flight_special_list_info").innerHTML = loddiv;
    var FlightAjax = new AjaxPro("flight_special_list_info");
    FlightAjax.Get("/flight/LoadFlightSpecialNum.aspx?citycode="+citycode+"&pagetype="+pagetype+"&rands="+Math.floor(Math.random()*100000+1));
}
AirFlightClass.prototype.FlightSpecialCitySelectIndex = function(indexnum,count,pagetype,citycode)
{
    for(var i=0;i<count;i++)
    {
        var li = this.$("fscitycodeid"+i);
         if(i==indexnum)
        {
           li.className="flight_special_cityhead_cityli_select";
        }else{
            li.className="flight_special_cityhead_cityli_noselect";
         }
    }
    var loddiv = "<div class=\"spacelinfo_load_wait\">正在加载数据....</div>";
    this.$("flight_special_list_info").innerHTML = loddiv;
    var FlightAjax = new AjaxPro("flight_special_list_info");
    FlightAjax.Get("/flight/LoadIndexFlightSpecialNum.aspx?citycode="+citycode+"&pagetype="+pagetype+"&rands="+Math.floor(Math.random()*100000+1));
}

AirFlightClass.prototype.GoFastPay = function()
{
    var yourname = this.$("yourname");
    if(yourname.value.length<1)
    {
        alert("请正确填写付款人姓名");
        yourname.focus();
        return false;
    }
    var mobile = this.$("mobile");
    var regmobile = /^[0-9]{11,13}$/;
    if(!regmobile.exec(mobile.value))
    {
        alert("手机号格式不正确！");
        mobile.focus();
        return false;
    }
    var pcode = this.$("pcode");
    var regimgcode =/^[0-9]{4}$/;
    if(!regimgcode.exec(pcode.value))
    {
        alert("验证码格式不正确!");
        pcode.focus();
        return false;
    }
    var regimgmoney =/^[0-9]{1,}([.][0-9]{1,2}){0,1}$/;
    var paymoney = this.$("paymoney");
    if(!regimgmoney.exec(paymoney.value))
    {
        alert("请正确填写支付金额!");
        paymoney.focus();
        return false;
    }
    var payman = this.$("payman");
    if(payman.value.length<3)
    {
        alert("请正确填写付款人账户!");
        payman.focus();
        return false;
    }
    var getpayman = this.$("getpayman");
    if(getpayman.value.length<3)
    {
        alert("请正确填写收款人账户!");
        getpayman.focus();
        return false;
    }
     var payinfos = this.$("payinfos");
    if(payinfos.value.length<5 || payinfos.value.length>250)
    {
        alert("请正确填写收款说明!");
        payinfos.focus();
        return false;
    }
    
    return true;
}
AirFlightClass.prototype.GoFastPayOnline = function()
{
    var paytype = this.$("PayType").value;
    var yourname = this.$("fPayUserName");
     if(this.$("getuserinfo").value=="1")
    {
    if(this.$("PayUsers").value=="")
        {
            alert("请填写持卡人真实姓名");
            this.$("PayUsers").focus();
            return false;
        }
        if(this.$("UserCards").value=="")
        {
            alert("请填写持卡人证件号");
            this.$("UserCards").focus();
            return false;
        }
        if(this.$("PayMobiles").value=="")
        {
            alert("请填写持卡人电话号");
            this.$("PayMobiles").focus();
            return false;
        }
        if(this.$("PayMails").value=="")
        {
            alert("请填写持卡人信用卡卡号");
            this.$("PayMails").focus();
            return false;
        }
        this.$("PayUser").value = this.$("PayUsers").value;
        this.$("UserCard").value = this.$("UserCards").value;
        this.$("PayMobile").value = this.$("PayMobiles").value;
        this.$("PayMail").value = this.$("PayMails").value;
    }
    if(yourname.value.length<1)
    {
        alert("请正确填写付款人姓名");
        yourname.focus();
        return false;
    }
    var Ordernum = this.$("FOrderNumber");
    
    var mobile = this.$("fPayUserMobile");
    var regmobile = /^[0-9]{11,13}$/;
    if(!regmobile.exec(mobile.value))
    {
        alert("手机号格式不正确！");
        mobile.focus();
        return false;
    }
    var regimgmoney =/^[0-9]{1,}([.][0-9]{1,2}){0,1}$/;
    var paymoney = this.$("fPayMoney");
    if(!regimgmoney.exec(paymoney.value))
    {
        alert("请正确填写支付金额!");
        paymoney.focus();
        return false;
    }
    if(isNaN(paymoney.value) || parseInt(paymoney.value) > 9999)
    {
		alert("请正确填写支付金额!");
        paymoney.focus();
        return false;
    }
    var bankId = this.$$("bank"+paytype);
    var banks="";
    if(bankId==null)
    {
        banks="";
    }else{
     
        for(var i=0;i<bankId.length;i++)
        {
             if(bankId[i].checked)
             {
                banks=bankId[i].value;
                break;
            }
        }
        
    } 
    this.$("banks").value=banks;
    this.$("uname").value=yourname.value;
   this.$("umobile").value=mobile.value;
   this.$("uprice").value=paymoney.value;
   this.$("uabout").value=Ordernum.value;
   this.$("paytypes").value=paytype;
   this.$("fastpayform").submit();
    
}

AirFlightClass.prototype.SendCreateOrder =function()
{
    var err = false;
		var objValue = "";
		jQuery("#divPassengers .lantDivPassenger").each(function(i,o){
			if(i == 0) return;
			var obj = jQuery(this).find("input[@name*='fPassengerName']");
			if(i>0 && obj.val().length < 2)
			{	
				alert("第"+i+"个乘机人姓名不正确");
				obj.focus();
				err = true;
				return false;
			}
			var isOk = true;
			var EnName = /^[a-zA-Z]{1,}[/][a-zA-Z]{1,}([\s]{0,1}[a-zA-Z]{0,}){0,1}$/;
			var CnName = /^([\u4E00-\u9FA5a-zA-Z]{1,}){1,}[\s]{0,}([\u4E00-\u9FA5a-zA-Z]{1,}){0,1}$/;
			if(!EnName.exec(obj.val()))
			{
				isOk = false;				
			}
			if(!isOk)
			{
				isOk = CnName.exec(obj.val());
			}
			var IsEnStr = /^[a-zA-Z]{1,}$/;
			var Spacereg = /\s/g; 
			var SpaceStrInfo = obj.val().replace(Spacereg, ""); 
			if(IsEnStr.exec(SpaceStrInfo))
			{
			    isOk=false;
			}
			if(!isOk)
			{
				alert("第"+i+"个乘机人姓名非法,请参看上面的乘机人姓名规则!");
				obj.focus();
				err = true;
				return false;
			}
		
			objValue += obj.val() + "|";
			
			obj = jQuery(this).find("select[@name*='fPassengerType']");
			var pobj = jQuery(this).find("select[@name*='fPassengerType']");
			objValue += obj.val() + "|";
			var ctypeobj = jQuery(this).find("select[@name*='fPassengerCardType']");
			objValue += ctypeobj.val() + "|";
			obj = jQuery(this).find("input[@name*='fPassengerCard']");
			var infobj = jQuery(this).find("input[@name*='InfCard']");
			var chdobj = jQuery(this).find("input[@name*='fPassengerChdCard']");
			var AduName = jQuery(this).find("input[@name*='AduName']");
 			if(pobj.val()==1)
			{
			    if(i>0 && obj.val().length < 3)
			    {
				    alert("第"+i+"个乘机人证件号码不正确");
				    obj.focus();
				    err = true;
				    return false;
				}
				if(ctypeobj.val()=='101')
				{
				    if(!AirFlight.checkCard(obj.val().toUpperCase()))
				    {
				        alert("第"+i+"个乘机人证件号码不正确");
				        obj.focus();
				        err = true;
				        return false;
				    }
				}
			}
			else if(pobj.val()==2)
			{
			    var regdatetime = /^[0-9]{4}[-]{1}[0-9]{2}[-]{1}[0-9]{2}$/;
                if(!regdatetime.exec(chdobj.val()))
                {
                    alert("生日格式不正确!格式如:2010-01-01");
                    chdobj.focus();
                    err = true;
                    return false;
                }
                var dlong = GetYearLong(chdobj.val(),2);
                if(dlong<0)
                {
                    alert("生日时间不正确!");
                    chdobj.focus();
                    err = true;
                    return false;
                }
			}
			else{
			    var regdatetime = /^[0-9]{4}[-]{1}[0-9]{2}[-]{1}[0-9]{2}$/;
                if(!regdatetime.exec(infobj.val()))
                {
                    alert("生日格式不正确!格式如:2010-01-01");
                    infobj.focus();
                    err = true;
                    return false;
                }
                var dlong = GetYearLong(infobj.val(),3);
                if(dlong<0)
                {
                    alert("生日时间不正确!");
                    infobj.focus();
                    err = true;
                    return false;
                }
                if(AduName.val()=="")
                {
                    alert("婴儿携带人姓名不能为空!携带人必须是当前乘机人中的成人!");
                    AduName.focus();
                    err = true;
                    return false;
                }
            }
			objValue += obj.val() + "|";
			obj = jQuery(this).find("select[@name*='fPassengerInsurance']");
			objValue += obj.val() + "^";
		});
		if(err)return false;
		jQuery("#fPassengers").val(objValue.slice(0,-1));
		
		
		 var fDist = this.$$("fDist");
     for(var i=0;i<fDist.length;i++)
     {
        if(fDist[i].checked)
        {
            if(fDist[i].getAttribute("chd")!="0")
            {
               var fDistAddress = this.$("fDistAddress");
               if(fDistAddress.value=="")
               {
                   alert("请正确填写您的详细地址!");
                   fDistAddress.focus();
                   return false;
               }
               var fDistPost = this.$("fDistPost");
               if(fDistPost.value.length>8)
               {
                   alert("请正确填写您的所在地邮政编码!");
                   fDistPost.focus();
                   return false;
               }
               var fDistContactName = this.$("fDistContactName");
               if(fDistContactName.value=="")
               {
                   alert("请正确填写收件人姓名!");
                   fDistContactName.focus();
                   return false;
               }
               var fDistTel = this.$("fDistTel");
               if(fDistTel.value=="")
               {
                   alert("请正确填写联系人电话!");
                   fDistTel.focus();
                  return false;
               }
               
            }
            break;
        }
    }
		
		objValue = "";
		var con = jQuery("#fContactName");
		if(con.val().length < 2)
		{
			alert("联系人姓名不正确");
			con[0].focus();
			return false;
		}
		objValue += con.val() + "|";
		con = jQuery("#fContactPhone");
		if(con.val().length < 2)
		{
			alert("联系人手机号码不正确");
			con[0].focus();
			return false;
		}
		var regmobile = /^[0-9]{11}$/;
        if(!regmobile.exec(con.val()))
        {
            alert("手机号不正确！");
            con[0].focus();
            return false;
        }
    
    return AirFlight.SendPassengerToCreateOrder();
}
function GetYearLong(birdday,tp)
{
    var DateLong=-1;
     var arr1=birdday.split("-");   
     var outdate = new Date(arr1[0],arr1[1],arr1[2]);
     var now= new Date();   
     var year=now.getYear();   
     var month=now.getMonth()+1;   
     var day=now.getDate();  
     if(tp==3)
     {
         var indate = new Date(year,month,day);
         DateLong = (parseInt((indate-outdate)  /  1000  /  60  /  60  /24));
         
         if(DateLong>-1)
         {
            var indate2 = new Date(year-2,month,day);
            DateLong = (parseInt((outdate-indate2)  /  1000  /  60  /  60  /24));
         }
     }
     if(tp==2)
     {
        var indate = new Date(year-2,month,day);
        DateLong = (parseInt((indate-outdate)  /  1000  /  60  /  60  /24));
        if(DateLong>-1)
        {
            var indate2 = new Date(year-12,month,day);
            DateLong = (parseInt((outdate-indate2)  /  1000  /  60  /  60  /24));
        }
     }
     return DateLong;
}
AirFlightClass.prototype.SendPassengerToCreateOrder =function()
{
    var SearchUrl = this.$("SearchUrl").value;
    var onetrip = this.$("onetrip").value;
    var twotrip = this.$("twotrip").value;
    var fContactName = this.$("fContactName").value;
    var fContactPhone = this.$("fContactPhone").value;
    var fContactTel = this.$("fContactTel").value;
    var fContactEmail = this.$("fContactEmail").value; 
    var agentid = this.$("agentid").value;
    var chdedk = this.$("chdedk").value;
    var url="SearchUrl="+SearchUrl+"&onetrip="+onetrip+"&twotrip="+twotrip+"&fContactName="+fContactName+"&fContactPhone="+fContactPhone+"&fContactTel="+fContactTel+"&fContactEmail="+fContactEmail+"&agentid="+agentid+"&chdedk="+chdedk;
     
    var PassengerName = "";
    var fPassengerType = "";
    var fPassengerInsurance = "";
    var fPassengerCardType = "";
    var fPassengerCard = "";
    var InfCard="";
    var AduName="";
    
    var fPassengerNameItem = this.$$("fPassengerName");
    var fPassengerTypeItem = this.$$("fPassengerType");
    var fPassengerInsuranceItem = this.$$("fPassengerInsurance");
    var fPassengerCardTypeItem = this.$$("fPassengerCardType");
    var fPassengerCardItem = this.$$("fPassengerCard");
    var fPassengerChdCardItem = this.$$("fPassengerChdCard");
    var InfCardItem = this.$$("InfCard");
    var AduNameItem = this.$$("AduName");
    var ChengRenCount=0;
    var YingErCount=0;
    
    for(var i=0;i<fPassengerNameItem.length;i++)
    {
        if(fPassengerNameItem[i].value!="")
        {
            if(PassengerName=="")
            {
                  if(fPassengerTypeItem[i].value=="1")
                  {
                    ChengRenCount++;
                    fPassengerCard = fPassengerCardItem[i].value;
                  }
                  if(fPassengerTypeItem[i].value=="2")
                  {
                    fPassengerCard = fPassengerChdCardItem[i].value;
                  }
                  if(fPassengerTypeItem[i].value=="3")
                  {
                   var acounts = this.CheckAdusItem(AduNameItem[i].value);
                   
                   if(acounts!=1)
                   {
                         alert("第"+i+"婴儿的携带人不在乘机人中,请重新输入携带人!携带人必须是乘机人中的成人!");
                            AduNameItem[i].focus();
                        return false;
                        break;
                   }
                   var aducountindex = this.CheckAdusItemForAdus(AduNameItem[i].value);
                   if(aducountindex>2)
                   {
                        alert("一个成人最多只能携带两名婴儿!");
                        return false;
                        break;
                   }
                    YingErCount++;
                   
                  }
                  PassengerName = fPassengerNameItem[i].value;
                  fPassengerType = fPassengerTypeItem[i].value;
                  fPassengerInsurance = fPassengerInsuranceItem[i].value;
                  fPassengerCardType = fPassengerCardTypeItem[i].value;
                  
                  InfCard = InfCardItem[i].value;
                  AduName = AduNameItem[i].value;
                  
             }else{
                  if(fPassengerTypeItem[i].value=="1")
                  {
                    ChengRenCount++;
                     fPassengerCard += ","+ fPassengerCardItem[i].value;
                  }
                  if(fPassengerTypeItem[i].value=="2")
                  {
                    fPassengerCard += ","+ fPassengerChdCardItem[i].value;
                  }
                  if(fPassengerTypeItem[i].value=="3")
                  {
                    var acounts = this.CheckAdusItem(AduNameItem[i].value);
                       if(acounts!=1)
                       {
                            alert("第"+i+"婴儿的携带人不在乘机人中,请重新输入携带人!携带人必须是乘机人中的成人!");
                            AduNameItem[i].focus();
                            return false;
                            break;
                       }
                       var aducountindex = this.CheckAdusItemForAdus(AduNameItem[i].value);
                       if(aducountindex>2)
                       {
                            alert("一个成人最多只能携带两名婴儿!");
                            return false;
                            break;
                       }
                      YingErCount++;
                   
                  }
                  PassengerName += ","+fPassengerNameItem[i].value;
                  fPassengerType += ","+ fPassengerTypeItem[i].value;
                  fPassengerInsurance += ","+ fPassengerInsuranceItem[i].value;
                  fPassengerCardType += ","+ fPassengerCardTypeItem[i].value;
                 
                  InfCard +=","+ InfCardItem[i].value;
                  AduName +=","+ AduNameItem[i].value;
              }
          }
     }
    
    if(YingErCount>ChengRenCount*2)
    {
        alert("一个成人最多只能携带两名婴儿!婴儿不能单独预订!");
        return false;
    }
    
    url+="&fPassengerName="+PassengerName+"&fPassengerType="+fPassengerType+"&fPassengerInsurance="+fPassengerInsurance+"&fPassengerCardType="+fPassengerCardType+"&fPassengerCard="+fPassengerCard+"&inffPassengerCard="+InfCard+"&aduname="+AduName;
    var mDistItem = this.$$("fDist");
    var mDist="";
    for(var n=0;n<mDistItem.length;n++)
    {
        if(mDistItem[n].checked)
        {
            mDist=mDistItem[n].value;
            break;
        }
    }
    var mDistCity = this.$("fDistCity").value;
    var mDistAddress = this.$("fDistAddress").value;
    var mDistPost = this.$("fDistPost").value;
    var mDistContactName = this.$("fDistContactName").value;
    var mDistTel = this.$("fDistTel").value;
    
   url+="&fDist="+mDist+"&fDistCity="+mDistCity+"&fDistAddress="+mDistAddress+"&fDistPost="+mDistPost+"&fDistContactName="+mDistContactName+"&fDistTel="+mDistTel;
   
   AirFlight.showpopupbg();
   var pleasewaiting = this.$("WriteOrderWait");
   var clientWidth = document.documentElement.clientWidth ? document.documentElement.clientWidth : document.body.clientWidth;
   pleasewaiting.style.left=(clientWidth-485)/2+"px";
   
   var eT=0,eL=0,p=this.$("passengerlispanforwaitli");
   var sT=document.body.scrollTop,sL=document.body.scrollLeft;
   var eH=p.clientHeight,eW=p.clientWidth;
   while(p&&p.tagName!="BODY"){eT+=p.offsetTop;eL+=p.offsetLeft;p=p.offsetParent;}
 
   pleasewaiting.style.top=eT+eH-40+"px";
   
   pleasewaiting.style.display="block";
   var Ajax = new AjaxPro("WriteOrderWait");
   AjaxReturnType = 1;
   AjaxCommand = ShowThisOrderInfo;
   Ajax.Post("CreateOrder.aspx",url);
}
AirFlightClass.prototype.CheckAdusItem = function(AdusName)
{
    var pcount=0;
    var fPassengerNameItem = this.$$("fPassengerName");
    var fPassengerTypeItem = this.$$("fPassengerType");
    for(var i=0;i<fPassengerNameItem.length;i++)
    {
        if(fPassengerTypeItem[i].value=="1")
        {
            if(fPassengerNameItem[i].value!="")
            {
                if(AdusName==fPassengerNameItem[i].value)
                {
                    pcount=pcount+1;
                }
            }
        }
    }
    return pcount;
}
AirFlightClass.prototype.CheckAdusItemForAdus = function(AdusName)
{
    var pcount=0;
    var AduNameItem = this.$$("AduName");
    for(var i=0;i<AduNameItem.length;i++)
    {
        if(AduNameItem[i].value!="")
        {
            if(AdusName==AduNameItem[i].value)
            {
                 pcount=pcount+1;
            }
        }
    }
    return pcount;
}
AirFlightClass.prototype.showpopupbg = function()
{
    var bgobj = AirFlight.$("WaitBackground");
    var clientWidth = document.body.clientWidth;
    var clientHeight = document.documentElement.clientHeight ? document.documentElement.clientHeight : document.body.clientHeight;

    var swidth,sheight;
    swidth=document.body.offsetWidth+document.body.offsetLeft*2;
    if(document.body.clientHeight<screen.height)
        sheight=screen.height;
    else
        sheight=document.body.clientHeight+document.body.offsetTop*2;
    
    bgobj.style.display="block";
    if(document.all)
    {
        bgobj.style.filter="progid:dximagetransform.microsoft.alpha(opacity=25)";
    }else{
        bgobj.style.MozOpacity="0.25";  
    }
    bgobj.style.width=swidth+"px";
    bgobj.style.height=sheight+"px";
    bgobj.style.zIndex = 998;
    bgobj.oncontextmenu=function(){return false;}
    bgobj.ondragstart=function(){return false;}
    bgobj.onselectstart=function(){return false;}
}
function ShowThisOrderInfo(id)
{
     if(id=="err")
    {
    window.location="sderror.aspx";
    }else
    {
    window.location=id;
    }
}
var intPassengersCount = 0;
function addPassengers(tripType)
{
	if(intPassengersCount>8)
	{
		alert("乘机人个数不能超过9人!");
		return;
	}

	var te = jQuery("#divPassenger").clone();	
	te.html(te.html().split("[$ID$]").join(++intPassengersCount));
	jQuery("#divPassengers").append(te.html());
	jQuery("select[@name=fPassengerInsurance1] option").each(function(i,n){
		if(parseInt(jQuery(this).val()) < parseInt(TripItem[TripItem.length-1][71])){
			jQuery(this).remove();
		}
	});
	PassengersApply();
}
function delPassengers(index)
{
	if(intPassengersCount < 2) return;
	jQuery("#tablePassenger"+index).remove();
	intPassengersCount--;
	PassengersApply();
}
function PassengersApply()
{
	for(var n=0;n<TripItem.length;n++){}
	var mPrise = 0, mInsurance = 0;
 	
 	jQuery(".fPassengerType").each(function(i,n){
		if(i>0)
		{
			for(var x=0;x<TripItem.length;x++)
			{
			    if(n.value==1)
			    {
			        mPrise+=parseInt(TripItem[x][63])+parseInt(TripItem[x][39])+parseInt(TripItem[x][42]);
			    }
			    if(n.value==2)
			    {
			        mPrise+=parseInt(TripItem[x][64])+parseInt(TripItem[x][40])+parseInt(TripItem[x][43]);
			    }
			    if(n.value==3)
			    {
			         mPrise+=parseInt(TripItem[x][65])+parseInt(TripItem[x][41])+parseInt(TripItem[x][44]);
 			    } 
 			}
 			mInsurance += parseInt(jQuery("select[@name=fPassengerInsurance]")[i].value) * (n.value == 1 ? parseInt(TripItem[0][68]) : parseInt(TripItem[0][69]));
		}
	});
 	
	jQuery("#spanTotalMoney").html(Math.round(mPrise *100) / 100 + "");
	jQuery("#spanTotalPassenger").html(intPassengersCount + "");
	jQuery("#spanTotalInsurance").html(mInsurance + "");
}
function SelectPassengerType(obj,e)
{
    if(obj!=null)
    {
        var PassengerTypes = e.value;
        var fPassengermaincarcli=document.getElementById("fPassengermaincarcli"+obj);
        var fPassengerinfcarcli=document.getElementById("fPassengerinfcarcli"+obj);
        var fPassengerchdcarcli=document.getElementById("fPassengerchdcarcli"+obj);
   
        if(PassengerTypes==3)
        {
              fPassengermaincarcli.style.display="none";
              fPassengerinfcarcli.style.display="block";
              fPassengerchdcarcli.style.display="none";
              
         }else if(PassengerTypes==2)
         {
              fPassengermaincarcli.style.display="none";
              fPassengerinfcarcli.style.display="none";
              fPassengerchdcarcli.style.display="block";              
           
         }else{
              fPassengermaincarcli.style.display="block";
              fPassengerinfcarcli.style.display="none";
              fPassengerchdcarcli.style.display="none";      
         }
     }
	return PassengersApply();
}

 
AirFlightClass.prototype.PostSearchSpecialFilght = function()
{
    var fromcity = this.$("spfromcitycode");
    var tocity = this.$("sptwocitycode");
    window.location="/flight/specials.aspx?f="+fromcity.value+"&t="+tocity.value;
}
AirFlightClass.prototype.ChangeDist = function(str,count,arrays)
{
    var divDist = this.$("divDist");
    var fDistCitySelect = this.$("fDistCity");
    var spanDistCityDes = this.$("spanDistCityDes");
     fDistCitySelect.options.length=0
    if(count>0)
    {
        divDist.style.display="block";
        
         
        for(var n=0;n<arrays.length;n++)
        {
            var oo=document.createElement('OPTION'); 
            oo.text=arrays[n][0]; 
            oo.value=arrays[n][0]+"|"+arrays[n][1]+"|"+arrays[n][2];
            fDistCitySelect.options.add(oo);
            if(n==0)
            {
                spanDistCityDes.innerHTML=arrays[n][2];
            }
        }

    }else{
       
        divDist.style.display="none";
    }
}
AirFlightClass.prototype.ChangeDistCity = function(e)
{
    var spanDistCityDes = this.$("spanDistCityDes");
    var str = e.value.split("|"); 
     spanDistCityDes.innerHTML = str[2];
}

AirFlightClass.prototype.CheckDistInfo = function()
{
    var fDist = this.$$("fDist");
    var rstate = true;
    for(var i=0;i<fDist.length;i++)
    {
        if(fDist[i].checked)
        {
            if(fDist[i].getAttribute("chd")!="0")
            {
               var fDistAddress = this.$("fDistAddress");
               if(fDistAddress.value=="")
               {
                   alert("请正确填写您的详细地址!");
                   fDistAddress.focus();
                   rstate =  false;
                   return rstate;
               }
               var fDistPost = this.$("fDistPost");
               if(fDistPost.value=="")
               {
                   alert("请正确填写您的所在地邮政编码!");
                   fDistPost.focus();
                   rstate =  false;
                   return rstate;
               }
               var fDistContactName = this.$("fDistContactName");
               if(fDistContactName.value=="")
               {
                   alert("请正确填写收件人姓名!");
                   fDistContactName.focus();
                   rstate =  false;
                   return rstate;
               }
               var fDistTel = this.$("fDistTel");
               if(fDistTel.value=="")
               {
                   alert("请正确填写联系人电话!");
                   fDistTel.focus();
                   rstate =  false;
                   return rstate;
               }
               
            }else{
                rstate =  true;
            }
            break;
        }
    }
    return rstate;
}
AirFlightClass.prototype.GoOnlineFastPay = function()
{
    var OrderId = this.$("OrderId");
    var PayType = this.$("PayType");
    
    if(this.$("getuserinfo").value=="1")
    {
        if(this.$("PayUsers").value=="")
        {
            alert("请填写持卡人真实姓名");
            this.$("PayUsers").focus();
            return false;
        }
        if(this.$("UserCards").value=="")
        {
            alert("请填写持卡人证件号");
            this.$("UserCards").focus();
            return false;
        }
        if(this.$("PayMobiles").value=="")
        {
            alert("请填写持卡人电话号");
            this.$("PayMobiles").focus();
            return false;
        }
        if(this.$("PayMails").value=="")
        {
            alert("请填写持卡人信用卡卡号");
            this.$("PayMails").focus();
            return false;
        }
        this.$("PayUser").value = this.$("PayUsers").value;
        
        this.$("UserCard").value = this.$("UserCards").value;
        this.$("PayMobile").value = this.$("PayMobiles").value;
        this.$("PayMail").value = this.$("PayMails").value;
    }
    
    var PayTypevalue=PayType.value;
     
    var bankId = this.$$("bank"+PayTypevalue);
    var banks="";
    if(bankId==null)
    {
        banks="";
    }else{
     
        for(var i=0;i<bankId.length;i++)
        {
             if(bankId[i].checked)
             {
                banks=bankId[i].value;
                break;
            }
        }
        
    } 
    this.$("banks").value=banks;
     this.$("PayTypes").value=PayTypevalue;
    this.$("OrderIds").value=OrderId.value;
    this.$("gopay").submit();
}
 
AirFlightClass.prototype.GoMotopayOnline = function()
{
    var OrderId = this.$("OrderId");
    var PayType = this.$("PayType");
    var CardName = this.$("CardName");
    if(CardName.value=="")
    {
        alert("请填写持卡人真实姓名");
        CardName.focus();
        return false;
    }
    
    this.$("CardName1").value=CardName.value;
    var CardCardNumber = this.$("CardCardNumber");
    if(CardCardNumber.value=="")
    {
        alert("请填写持卡人证件号码");
        CardCardNumber.focus();
        return false;
    }
    
    this.$("CardCardNumber1").value=CardCardNumber.value;
    
     var CardInfo = this.$("CardInfo");
    if(CardInfo.value=="")
    {
        alert("请填写持卡人信用卡卡号");
        CardInfo.focus();
        return false;
    }
    
    this.$("CardInfo1").value=CardInfo.value;
    
    var years = this.$("years");
    var regyear = /^[0-9]{2}$/;
    if(!regyear.exec(years.value))
    {
        alert("请填写持卡人信用卡有效期年份");
        years.focus();
        return false;
    }
    
    this.$("years1").value=years.value;
    
    
    var months = this.$("months");
    if(!regyear.exec(months.value))
    {
        alert("请填写持卡人信用卡有效期月份");
        months.focus();
        return false;
    }
    
    this.$("months1").value=months.value;
    
    this.$("PayTypes").value="105";
    this.$("OrderIds").value=OrderId.value;
    this.$("gopay").submit();
}
AirFlightClass.prototype.CheckUserMess = function(tp)
{
    var Umess = this.$("Umess");
    if(Umess.value.length<1)
    {
        alert("请输入您申请退票或改签的留言内容!");
        return false;
    }
    if(tp==0)
    {
       return confirm('申请退票将会直接取消您的订座记录,请问是否继续执行此项操作?!');
    }
    return true;
}
AirFlightClass.prototype.SetSelectListInfo = function(selectid,arrays,parentstr,def)
{
    var sele = AirFlight.$(selectid);

    sele.options.length=0
    var ooo=document.createElement('OPTION'); 
    ooo.text="-----"+def+"-----"; 
    ooo.value="";
    sele.options.add(ooo);
    var hotelcitycodeletter = AirFlight.$(parentstr).value;
    for(var i=0;i<arrays.length;i++)
    {
        if(arrays[i][1]==hotelcitycodeletter)
        {
            var oo=document.createElement('OPTION'); 
            oo.text=arrays[i][0]; 
            oo.value=arrays[i][2];
            sele.options.add(oo);
        }
    }
}
AirFlightClass.prototype.ChdSetSelectListInfo = function(selectid,arrays,parentstr,def)
{
    var sele = window.parent.document.getElementById(selectid);

    sele.options.length=0
    var ooo=document.createElement('OPTION'); 
    ooo.text="-----"+def+"-----"; 
    ooo.value="";
    sele.options.add(ooo);
    var hotelcitycodeletter = window.parent.document.getElementById(parentstr).value;
    for(var i=0;i<arrays.length;i++)
    {
        if(arrays[i][1]==hotelcitycodeletter)
        {
            var oo=document.createElement('OPTION'); 
            oo.text=arrays[i][0]; 
            oo.value=arrays[i][2];
            sele.options.add(oo);
        }
    }
}

AirFlightClass.prototype.GoSearchHotel = function()
{
    var hotelcitycodeletter = this.$("hotelcitycodeletter");
    if(hotelcitycodeletter.value=="")
    {
        alert("请选择目的城市!");
        this.$("hotelcity").focus();
        return false;
    }
    var checkdate =/^[0-9]{4}[-][0-9]{1,2}[-][0-9]{1,2}$/;
    if(!checkdate.exec(this.$("hotelsave").value))
    {
        alert("请选择入住日期");
        this.$("hotelsave").focus();
        return false;
    }
    if(!checkdate.exec(this.$("hotelout").value))
    {
        alert("请选择离店日期");
        this.$("hotelout").focus();
        return false;
    }
    var hname = this.$("hotelkeyword");
        
    var Landmarks = this.$("Landmarks");
    var Locatios = this.$("Locatios");
     

    var hotelprice = this.$("hotelprice");
    var hotelStartClass = this.$("hotelStartClass");
    var hotetype = this.$("hotetype");

    var hoteltypeinfo="";
    if(hotetype!=null)
    {
        hoteltypeinfo=hotetype.value;
    }
    var Locatiosinfo="";
    if(Locatios!=null)
    {
        Locatiosinfo=Locatios.value;
    }
    var Landmarksinfo="";
    if(Landmarks!=null)
    {
        Landmarksinfo=Landmarks.value;
    }
    
    //window.location ="/Hotel/Hotel_search.aspx?key=" + hname.value + "&city=" + hotelcitycodeletter.value + "&land=" + Landmarksinfo + "&locations=" + Locatiosinfo + "&start=" + this.$("hotelsave").value + "&end=" + this.$("hotelout").value + "&price=" + hotelprice.value + "&star=" + hotelStartClass.value + "&tp=" + hoteltypeinfo;
     window.location ="/Hotel/hotelslist.aspx?hotelkeyword=" + hname.value + "&hotelcitycodeletter=" + hotelcitycodeletter.value + "&Landmarks=" + Landmarksinfo + "&locations=" + Locatiosinfo + "&hotelsave=" + this.$("hotelsave").value + "&hotelout=" + this.$("hotelout").value + "&hotelprice=" + hotelprice.value + "&hotelStartClass=" + hotelStartClass.value + "&hotetype=" + hoteltypeinfo;
}
AirFlightClass.prototype.GoSearchHotel_Page = function()
{
   this.$("key").value=this.$("hotelkeyword").value;
   this.$("city").value = this.$("hotelcitycodeletter").value;
   this.$("land").value = this.$("Landmarks").value;
   this.$("locations").value = this.$("Locatiosinfo").value;
   this.$("start").value = this.$("hotelsave").value;
   this.$("end").value = this.$("hotelout").value;

   this.$("price").value = this.$("hotelprice").value;
   this.$("star").value = this.$("hotelStartClass").value;
   this.$("tp").value = this.$("hotetype").value;
            
   this.$("gosearch").submit();
}
AirFlightClass.prototype.ShowHotelInfoDatePrice = function(f,e,a)
{
    var datepriceinfos=this.$("datepriceinfos");
    var widths=160;
    var eT=0,eL=0,p=this.$(a);
    var sT=document.body.scrollTop,sL=document.body.scrollLeft;
    var eH=this.$(a).clientHeight,eW=this.$(a).clientWidth;
    while(p&&p.tagName!="BODY"){eT+=p.offsetTop;eL+=p.offsetLeft;p=p.offsetParent;}
    datepriceinfos.style.top=eT+eH+"px";
	datepriceinfos.style.left=((document.body.clientWidth-(eL-sL)>=widths)?eL:eL+eW-widths)-220+"px";
    if(f==0)
    {
            datepriceinfos.style.display="block";
            var DateListInfos="";
            var dateitem = e.split('|');
            var table="<div class=\"hotel_datepriceli\"><div class=\"hotel_datepriceli_head\"></div><div class=\"hotel_datepriceli_center\"><div class=\"hotel_datepriceli_center_main\"><div class=\"hotel_datepriceli_center_dayli\"><div class=\"hotel_datepriceli_center_weeks_count\"></div><div class=\"hotel_datepriceli_center_weeks_info\">周一</div><div class=\"hotel_datepriceli_center_weeks_info\">周二</div><div class=\"hotel_datepriceli_center_weeks_info\">周三</div><div class=\"hotel_datepriceli_center_weeks_info\">周四</div><div class=\"hotel_datepriceli_center_weeks_info\">周五</div><div class=\"hotel_datepriceli_center_weeks_info\">周六</div><div class=\"hotel_datepriceli_center_weeks_info\">周日</div></div>";
            
            var endtable="</div></div><div class=\"hotel_datepriceli_end\"></div></div>";
            var tditem="";
            var tds="";
            var nm=1;
            for(var i=1;i<dateitem.length;i++)
            {
               var infoitem = dateitem[i].split('^');
               var from = infoitem[0];
               if(infoitem[2]=="0")
               {
                    tditem+="<div class=\"hotel_datepriceli_center_dayinfo\"><span class=\"hotel_search_info_dateprice_li_price_span\">"+infoitem[1]+"</span><br />"+infoitem[3]+"</div>";
               }else{
                    tditem+="<div class=\"hotel_datepriceli_center_dayinfo\"><span class=\"hotel_search_info_dateprice_li_price_span\">"+infoitem[1]+"-"+infoitem[2]+"</span><br />"+infoitem[3]+"</div>";
               }
               if(i%7==0)
               {
                    tds+="<div class=\"hotel_datepriceli_center_dayli\"><div class=\"hotel_datepriceli_center_weeks_count\" style=\"line-height:40px;\">第&nbsp;"+nm+"&nbsp;周</div>"+tditem+"</div>";
                    tditem="";
                    nm++;
               }
                
            }
            DateListInfos = table+tds+endtable;
            datepriceinfos.innerHTML = DateListInfos;
       }else{
            datepriceinfos.style.display="none";
       }
}
AirFlightClass.prototype.LoadHotelInfoDatePrice = function()
{
var datepriceinfos=this.$("datepriceinfos");
    var DatePrices = this.$("DatePrices").value;
    var table="<table width=\"750\" border=\"0\" cellspacing=\"1\" cellpadding=\"0\" bgcolor=\"#ECECEC\"><tr><th height=\"22\" bgcolor=\"#F5F5F5\" scope=\"col\">周一</th><th bgcolor=\"#F5F5F5\" scope=\"col\">周二</th><th bgcolor=\"#F5F5F5\" scope=\"col\">周三</th><th bgcolor=\"#F5F5F5\" scope=\"col\">周四</th><th bgcolor=\"#F5F5F5\" scope=\"col\">周五</th><th bgcolor=\"#F5F5F5\" scope=\"col\">周六</th><th bgcolor=\"#F5F5F5\" scope=\"col\">周日</th></tr>";
     var DateListInfos="";
     var dateitem = DatePrices.split('|');
     var endtable="</table>";
     var tditem="";
     for(var i=1;i<dateitem.length;i++)
     {
       var infoitem = dateitem[i].split('^');
       var from = infoitem[0];
       if(infoitem[2]=="0")
       {
            tditem+="<td align=\"center\" bgcolor=\"#FFFFFF\" class=\"hotel_search_info_dateprice_li_price\"><span class=\"hotel_search_info_dateprice_li_price_span\">"+infoitem[1]+"</span><br />"+infoitem[3]+"</td>";
       }else{
            tditem+="<td align=\"center\" bgcolor=\"#FFFFFF\" class=\"hotel_search_info_dateprice_li_price\"><span class=\"hotel_search_info_dateprice_li_price_span\">"+infoitem[1]+"-"+infoitem[2]+"</span><br />"+infoitem[3]+"</td>";
       }
       if(i%7==0)
       {
            tditem="<tr>"+tditem+"</tr>";
       }
     }
     DateListInfos = table+tditem+endtable;
     datepriceinfos.innerHTML = DateListInfos;
}
AirFlightClass.prototype.GoHotelBuyPage = function(hotelid,roomid,fromdate,todate,str)
{
    this.$("hotelid").value=hotelid;
    this.$("roomid").value=roomid;
    this.$("start").value=fromdate;
    this.$("end").value=todate;
    this.$("dayprice").value=str;
    this.$("gobuy").submit();
}

AirFlightClass.prototype.GoHotelBuyPageChangeDate = function()
{
    this.$("hotelids").value=this.$("HotelId").value;
    this.$("roomids").value=this.$("RoomId").value;
    this.$("start").value=this.$("startdateTime").value;
    this.$("end").value=this.$("enddateTime").value;
    this.$("dayprice").value=this.$("DatePrices").value;
    this.$("gobuy").submit();
}
AirFlightClass.prototype.ChangeHotelGusestCount = function()
{
    var RoomNumDrop = this.$("RoomNumDrop");
    var counts=RoomNumDrop.value;
    for(var n=1;n<=9;n++)
    {
        var guestli = this.$("guestli"+n);
         guestli.style.display="none";
    }
    for(var i=1;i<=counts;i++)
    {
         var guestli = this.$("guestli"+i);
         guestli.style.display="block";
    }   
}
AirFlightClass.prototype.SendBuyHotelOrder = function()
{
    var RoomNumDrop = this.$("RoomNumDrop");
    var counts=RoomNumDrop.value;
    for(var i=1;i<=counts;i++)
    {
         var guestli = this.$("GuestName"+i);
         if(guestli.value=="")
         {
            alert("请输入入住人姓名!");
            guestli.focus();
            return false;
         }
    }   
    var TouchNameTxt= this.$("TouchNameTxt");
    if(TouchNameTxt.value=="")
    {
        alert("请输联系人姓名!");
            TouchNameTxt.focus();
            return false;
    }
     var Mobile= this.$("Mobile");
     var regmobile = /^[1]([3][0-9]{1}|55|50|51|52|53|56|59|58|86|88|89)[0-9]{8}$/;
    if(!regmobile.exec(Mobile.value))
    {
        alert("联系人手机号不正确！");
        Mobile.focus();
        return false;
    }
    var regnumber = /^[0-9]{1,2}$/;
    var RoomBed= this.$("RoomBed");
    if(!regnumber.exec(RoomBed.value))
    {
        alert("加床数量不正确！");
        RoomBed.value="0";
        RoomBed.focus();
        return false;
    }
    var RoomMeal= this.$("RoomMeal");
    if(!regnumber.exec(RoomMeal.value))
    {
        alert("加餐数量不正确！");
        RoomMeal.value="0";
        RoomMeal.focus();
        return false;
    }
    if(!this.$("greedmess").checked)
    {
         alert("请同意用户服务条款！");
         return false;
    }
    this.$("hotelids").value=this.$("HotelId").value;
    this.$("roomids").value=this.$("RoomId").value;
    this.$("start").value=this.$("startdateTime").value;
    this.$("end").value=this.$("enddateTime").value;
    this.$("dayprice").value=this.$("DatePrices").value;
    
    this.$("umess").value=this.$("guestmess").value;
        this.$("addbedcount").value=this.$("RoomBed").value;
        this.$("addmealcount").value=this.$("RoomMeal").value;
        this.$("touchname").value=this.$("TouchNameTxt").value;
        this.$("touchmobile").value=this.$("Mobile").value;
        this.$("roomcount").value=counts;
        this.$("passenger1").value=this.$("GuestName1").value;
        this.$("passenger2").value=this.$("GuestName2").value;
        this.$("passenger3").value=this.$("GuestName3").value;  
        this.$("passenger4").value=this.$("GuestName4").value; 
        this.$("passenger5").value=this.$("GuestName5").value; 
        this.$("passenger6").value=this.$("GuestName6").value; 
        this.$("passenger7").value=this.$("GuestName7").value;
        this.$("passenger8").value=this.$("GuestName8").value;
        this.$("passenger9").value=this.$("GuestName9").value;
        
        this.$("starttime").value=this.$("fromtimes").value;
        this.$("endtime").value=this.$("endtimes").value;
        this.$("usex").value=this.$("contact_sex").value;
        
        try
        {
        if(this.$("loginstate").value=="0")
        {
         var uname= this.$("username");
        var upasswd= this.$("passwd");
        var lmobile = this.$("loginmobile");
        var regusername = /^[0-9a-zA-Z]{6,16}$/;
        if(uname.value =="" || mobile.value=="")
        {
            if(uname.value!="")
            {
                if(!regusername.exec(uname.value))
                {
                    alert("用户名不正确！");
                    uname.focus();
                    return false;
                }
                if(!regusername.exec(upasswd.value))
                {
                    alert("密码不正确！");
                    upasswd.focus();
                    return false;
                }
                lmobile.value="";
               }else{
                    var regmobile = /^[1]([3][0-9]{1}|55|50|51|52|53|56|59|57|58|86|88|89)[0-9]{8}$/;
	                
	                if(!regu.exec(lmobile.value))
	                {
		                alert("手机号码不正确!");
		                lmobile.focus();
		                return false;
	                }
	                uname.value="";
	                upasswd.value="";
	            }
	        }
            this.$("lusername").value=this.$("username").value;
            this.$("lpassword").value=this.$("passwd").value;
            this.$("lmobile").value=this.$("loginmobile").value;
            }
        }catch(err)
        {
        }
    
    this.$("gobuy").action="/hotel/CreateHotelOrder.aspx";
    this.$("gobuy").submit();
}
AirFlightClass.prototype.ShowTravelsCityFrame = function(frame,box,valuehidden)
{
    var tcf=document.getElementById(frame);
   
    var twcf = eval("window.frames."+frame);
    twcf.firstvalue="";
 	twcf.b="";
 	twcf.citycode="";
 	twcf.TravelCityName=box;
 	twcf.TravelCityCode=valuehidden;
	tcf.onmouseover=function()
	{framestatefocus=true;} 
	tcf.onmouseout=function()
	{framestatefocus=false;} 
	this.SetOjbectWay(box,frame,100);
	tcf.style.display="block";
	framestatefocus=false;
}
AirFlightClass.prototype.SenTravelTripSearch = function()
{
    var Url="/travel/TravelSearch.aspx?";
    var travelcitycodeletter= this.$("travelcitycodeletter").value;
    if(travelcitycodeletter=="")
    {
        alert("请选择出发城市");
        this.$("travelcity").focus();
        return false;
    }
    Url+="from="+travelcitycodeletter;
     var traveltocitycodeletter= this.$("traveltocitycodeletter").value;
    if(traveltocitycodeletter=="")
    {
        alert("请选择目的城市");
        this.$("traveltocity").focus();
        return false;
    }
   
    Url+="&to="+traveltocitycodeletter;
    var checkint=/^[0-9]{1,8}$/;
    var TravelPrice = this.$("TravelPrice").value;
    if(TravelPrice!="")
    {
        if(!checkint.exec(TravelPrice))
        {
            alert("预算费用必须为数值");
            this.$("TravelPrice").value="0";
            this.$("TravelPrice").focus();
            return false;
        }
    }
    Url+="&start="+TravelPrice;
    var TravelEndPrice = this.$("TravelEndPrice").value;
    if(TravelEndPrice!="")
    {
        if(!checkint.exec(TravelEndPrice))
        {
            alert("预算费用必须为数值");
            this.$("TravelEndPrice").value="0";
            this.$("TravelEndPrice").focus();
            return false;
        }
    }
    Url+="&end="+TravelEndPrice;
    var TravelKeyword = this.$("TravelKeyword").value;
    Url+="&key="+TravelKeyword;    
    var traveltream = this.$("traveltream");
    if(traveltream!=null)
    {
        Url+="&tream="+traveltream.value;  
    }
    window.location=Url;
}
AirFlightClass.prototype.GoSearchTravelTrip_Page = function()
{
    this.$("from").value = this.$("froms").value;
    this.$("to").value = this.$("tos").value;
    this.$("start").value = this.$("starts").value;
    this.$("end").value = this.$("ends").value;
    this.$("key").value = this.$("keys").value;
    this.$("tream").value = this.$("treams").value;
    this.$("gosearch").submit();
}
AirFlightClass.prototype.SetPhotoInfos = function(i)
{
    if(PhotoArray.length>0)
    {
        var photospan=this.$("bigimg");
        photospan.innerHTML="<img src=\""+PhotoArray[i][1]+"\" alt=\""+PhotoArray[i][0]+"\" width=\"500\" height=\"280\" />";
    }
}
AirFlightClass.prototype.SetPhotoInfoLists = function(n,move)
{
    if(PhotoArray.length>0)
    {
        var photospan=this.$("smalllist");
        var phtolis="";
        
        
        
        var lindex=0;
        
        if(!move)
        {
            photoindex--;
            if(photoindex<0)photoindex=0;
            if(n==-1)
            {
                n=photoindex;
            }
            for(var i=n;i<PhotoArray.length;i++)
            {
            if(lindex>=4)
                {
                    break;
                }
                phtolis+="<div class=\"travel_travelinfo_left_photo_small_main_li\" onclick=\"AirFlight.SetPhotoInfos("+i+");\"><img src=\""+PhotoArray[i][1]+"\" alt=\""+PhotoArray[i][0]+"\" width=\"70\" height=\"45\" /></div>";
                
                lindex++;
            }
            if(photoindex<0)photoindex=1;
        }else{
            if(photoindex<=0)photoindex=1;
            if(n==-1)
            {
                n=photoindex;
            }
             for(var i=n;i<PhotoArray.length;i++)
             {
              if(lindex>=4)
                {
                    break;
                }
                phtolis+="<div class=\"travel_travelinfo_left_photo_small_main_li\" onclick=\"AirFlight.SetPhotoInfos("+i+");\"><img src=\""+PhotoArray[i][1]+"\" alt=\""+PhotoArray[i][0]+"\" width=\"70\" height=\"45\" /></div>";
                lindex++;
            }
            photoindex++;
            var Plenght=PhotoArray.length-4;
            if(Plenght>0)
            {
                if(photoindex>Plenght)photoindex=Plenght;
            }
            //alert(photoindex);
        }
        
        
        photospan.innerHTML=phtolis;
    }
}
AirFlightClass.prototype.ChangeGuestBookMember = function()
{
    var NoMember = this.$("NoMember");
    var memberpasswdsapn = this.$("memberpasswdsapn");
    var membernamespan = this.$("membernamespan");
    if(NoMember.checked)
    {
        membernamespan.innerHTML="昵称：";
        memberpasswdsapn.style.display="none";
    }else{
        membernamespan.innerHTML="用户名：";
        memberpasswdsapn.style.display="block";
    }
}
AirFlightClass.prototype.SetGuestBookInfo = function()
{
    var NoMember = this.$("NoMember");
    if(NoMember!=null)
    {
        var username = this.$("username");
        if(NoMember.checked)
        {
            if(username.value=="")
            {
                alert("请输入昵称！");
                username.focus();
                return false;
            } 
        }else{
            if(username.value=="")
            {
                alert("请输入用户名！");
                username.focus();
                return false;
            } 
            var passwd = this.$("passwd");   
            if(passwd.value=="")
            {
                alert("请输入密码！");
                passwd.focus();
                return false;
            }         
        }
    }
        var imgcode = this.$("imgcode");
        if(imgcode.value=="")
        {
            alert("请输入附加码！");
                imgcode.focus();
                return false;
        }
    var HotelTalks = this.$("HotelTalks");
        if(HotelTalks.value=="")
        {
            alert("请输入留言内容！");
                HotelTalks.focus();
                return false;
        }
}

AirFlightClass.prototype.SendSearchOrder = function()
{
    var SearchMobile = this.$("SearchMobile").value;
    var SearchOrder = this.$("SearchOrder").value;
     if(SearchMobile=="")
        {
            alert("请输入手机号");
            this.$("SearchMobile").focus();
            return false;
        }
    
        if(SearchOrder=="")
        {
            alert("请输入订单号");
            this.$("SearchOrder").focus();
            return false;
        } 
      
     
}

AirFlightClass.prototype.TripSelectAnyInfos = function(i)
{
    var l00 = this.$("l00");
    var l01 = this.$("l01");
    var l02 = this.$("l02");
    var l03 = this.$("l03");
    
    var info01 = this.$("info01");
    var info02 = this.$("info02");
    var info03 = this.$("info03");
    var info04 = this.$("info04");
    if(i==0)
    {
        l00.style.display="block";
        l01.style.display="none";
        if(l03!=null)
        {
        l03.style.display="none";
        }
        l02.style.display="none";
        info01.className="hotel_talk_select";
        info02.className="hotel_talk_noselect";
        info03.className="hotel_talk_noselect";
        if(info04!=null)
        {
        info04.className="hotel_talk_noselect";
        }
    }
    if(i==1)
    {
        if(l00!=null)
        {
        l00.style.display="none";
        }
        l01.style.display="block";
        if(l03!=null)
        {
        l03.style.display="none";
        }
        l02.style.display="none";
        if(info01!=null)
        {
        info01.className="hotel_talk_noselect";
        }
        info02.className="hotel_talk_select";
        if(info04!=null)
        {
        info04.className="hotel_talk_noselect";
        }
        info03.className="hotel_talk_noselect";
    }
    if(i==2)
    {
        if(l00!=null)
        {
        l00.style.display="none";
        }
        if(l03!=null)
        {
        l03.style.display="none";
        }
        l01.style.display="none";
        l02.style.display="block";
        if(info01!=null)
        {
        info01.className="hotel_talk_noselect";
        }
        info02.className="hotel_talk_noselect";
        if(info04!=null)
        {
        info04.className="hotel_talk_noselect";
        }
        info03.className="hotel_talk_select";
    }
    if(i==3)
    {
        if(l00!=null)
        {
        l00.style.display="none";
        }
        l01.style.display="none";
        l03.style.display="block";
        l02.style.display="none";
        if(info01!=null)
        {
        info01.className="hotel_talk_noselect";
        }
        info02.className="hotel_talk_noselect";
        info04.className="hotel_talk_select";
        info03.className="hotel_talk_noselect";
    }
}

AirFlightClass.prototype.SelectedPayCodeForBank = function(payindex,banktype,paycodecount,cid,paycode,showinfo)
{
    var payspaniditem = this.$("payspaniditem").value;
    this.$("PayType").value=paycode;
    var Pitem = payspaniditem.split('^');
    this.$("getuserinfo").value=showinfo;
    for(var i=0;i<paycodecount;i++)
    {
        var paycodepanli = this.$("orderpayspan_"+i);
        if(paycodepanli!=null)
        {
            if(i==payindex)
            {
                paycodepanli.className="order_info_paytype_select";
            }else{
                paycodepanli.className="order_info_paytype_noselect";
            }
        }
    }
    for(var n=0;n<Pitem.length;n++)
    {
        
        var BankLi = this.$(Pitem[n]);
        if(cid==Pitem[n])
        {
            if(banktype==1)
            {
               BankLi.style.display="block";
            }else{
                BankLi.style.display="none";
            }
        }else{
             BankLi.style.display="none";
        }
     }
     if(showinfo==1)
     {
        this.$("PayUserInfos").style.display="block";
     }else{
     this.$("PayUserInfos").style.display="none";
     }
}
/*************************flightnumsearch************************/
AirFlightClass.prototype.SelectedSearchFlightNumber = function(i)
{
    var fcitysearchspan = this.$("fcitysearchspan");
    var fnumsearchspan = this.$("fnumsearchspan");
    if(i==0)
    {
        fcitysearchspan.style.display="block";
        fnumsearchspan.style.display="none";
    }else{
        fcitysearchspan.style.display="none";
        fnumsearchspan.style.display="block";
    }
}
AirFlightClass.prototype.GoSearchFlightNumber = function(i)
{
     this.$("planfromcity").value = this.$("fcitycode").value;
    this.$("plantocity").value = this.$("ftcitycode").value;
    this.$("plannum").value = this.$("fnumcode").value;
    this.$("planair").value= this.$("flightcode").value;
     
    var searchflightnuminfoform = this.$("searchflightnuminfoform");
     searchflightnuminfoform.submit();
}
AirFlightClass.prototype.GoSearchFlightSpecialNumber = function()
{
    var citycode = this.$("fromcitycode").value;
    var startDate = this.$("startDate").value;
    var returnDate = this.$("returnDate").value;
    window.location="speciallist.aspx?city="+citycode+"&fdate="+startDate+"&edate="+returnDate;
}
AirFlightClass.prototype.ShowGoAccount = function()
{
    var goawards = this.$("goawards");
    if(goawards.style.display=="none")
    {
        goawards.style.display="block";
        goaccount.innerHTML="[取消提现]";
    }else{
        goawards.style.display="none";
        goaccount.innerHTML="[申请提现]";
    }
}
AirFlightClass.prototype.SearchAccount = function()
{
    var startDate = this.$("startDate").value;
    var returnDate = this.$("returnDate").value;
    window.location="Award.aspx?fdate="+startDate+"&edate="+returnDate;
}

AirFlightClass.prototype.CheckUserCard=function(sId)
{
   
 

}

var vcity={ 11:"北京",12:"天津",13:"河北",14:"山西",15:"内蒙古",
        	21:"辽宁",22:"吉林",23:"黑龙江",31:"上海",32:"江苏",
        	33:"浙江",34:"安徽",35:"福建",36:"江西",37:"山东",41:"河南",
        	42:"湖北",43:"湖南",44:"广东",45:"广西",46:"海南",50:"重庆",
        	51:"四川",52:"贵州",53:"云南",54:"西藏",61:"陕西",62:"甘肃",
        	63:"青海",64:"宁夏",65:"新疆",71:"台湾",81:"香港",82:"澳门",91:"国外"
           };

AirFlightClass.prototype.checkCard = function(card)
{
	//是否为空
	if(card === '')
	{
 		return false;
	}
	//校验长度，类型
	if(this.isCardNo(card) === false)
	{
 		return false;
	}
	//检查省份
	if(this.checkProvince(card) === false)
	{
 		return false;
	}
	//校验生日
	if(this.checkBirthday(card) === false)
	{
 		return false;
	}
	//检验位的检测
	if(this.checkParity(card) === false)
	{
 		return false;
	}
	return true;
}


//检查号码是否符合规范，包括长度，类型
AirFlightClass.prototype.isCardNo = function(card)
{
	//身份证号码为15位或者18位，15位时全为数字，18位前17位为数字，最后一位是校验位，可能为数字或字符X
	var reg = /(^\d{15}$)|(^\d{17}(\d|X)$)/;
	if(reg.test(card) === false)
	{
		return false;
	}

	return true;
}

//取身份证前两位,校验省份
AirFlightClass.prototype.checkProvince = function(card)
{
	var province = card.substr(0,2);
	if(vcity[province] == undefined)
	{
		return false;
	}
	return true;
}

//检查生日是否正确
AirFlightClass.prototype.checkBirthday = function(card)
{
	var len = card.length;
	//身份证15位时，次序为省（3位）市（3位）年（2位）月（2位）日（2位）校验位（3位），皆为数字
	if(len == '15')
	{
		var re_fifteen = /^(\d{6})(\d{2})(\d{2})(\d{2})(\d{3})$/; 
		var arr_data = card.match(re_fifteen);
		var year = arr_data[2];
		var month = arr_data[3];
		var day = arr_data[4];
		var birthday = new Date('19'+year+'/'+month+'/'+day);
		return this.verifyBirthday('19'+year,month,day,birthday);
	}
	//身份证18位时，次序为省（3位）市（3位）年（4位）月（2位）日（2位）校验位（4位），校验位末尾可能为X
	if(len == '18')
	{
		var re_eighteen = /^(\d{6})(\d{4})(\d{2})(\d{2})(\d{3})([0-9]|X)$/;
		var arr_data = card.match(re_eighteen);
		var year = arr_data[2];
		var month = arr_data[3];
		var day = arr_data[4];
		var birthday = new Date(year+'/'+month+'/'+day);
		return this.verifyBirthday(year,month,day,birthday);
	}
	return false;
}

//校验日期
AirFlightClass.prototype.verifyBirthday = function(year,month,day,birthday)
{
	var now = new Date();
	var now_year = now.getFullYear();
	//年月日是否合理
	if(birthday.getFullYear() == year && (birthday.getMonth() + 1) == month && birthday.getDate() == day)
	{
		//判断年份的范围（3岁到100岁之间)
		var time = now_year - year;
		if(time >= 3 && time <= 100)
		{
			return true;
		}
		return false;
	}
	return false;
}

//校验位的检测
AirFlightClass.prototype.checkParity = function(card)
{
	//15位转18位
	card = this.changeFivteenToEighteen(card);
	var len = card.length;
	if(len == '18')
	{
		var arrInt = new Array(7, 9, 10, 5, 8, 4, 2, 1, 6, 3, 7, 9, 10, 5, 8, 4, 2); 
		var arrCh = new Array('1', '0', 'X', '9', '8', '7', '6', '5', '4', '3', '2'); 
		var cardTemp = 0, i, valnum; 
		for(i = 0; i < 17; i ++) 
		{ 
			cardTemp += card.substr(i, 1) * arrInt[i]; 
		} 
		valnum = arrCh[cardTemp % 11]; 
		if (valnum == card.substr(17, 1)) 
		{
			return true;
		}
		return false;
	}
	return false;
}

//15位转18位身份证号
AirFlightClass.prototype.changeFivteenToEighteen = function(card)
{
	if(card.length == '15')
	{
		var arrInt = new Array(7, 9, 10, 5, 8, 4, 2, 1, 6, 3, 7, 9, 10, 5, 8, 4, 2); 
		var arrCh = new Array('1', '0', 'X', '9', '8', '7', '6', '5', '4', '3', '2'); 
		var cardTemp = 0, i;   
		card = card.substr(0, 6) + '19' + card.substr(6, card.length - 6);
		for(i = 0; i < 17; i ++) 
		{ 
			cardTemp += card.substr(i, 1) * arrInt[i]; 
		} 
		card += arrCh[cardTemp % 11]; 
		return card;
	}
	return card;
}