var CnFlightCityBoxObject;
var CnFlightAllCity_CaptionA;
var flightCityList = {
      HOT: ["北京首都","北京南苑","上海虹桥","上海浦东","深圳","杭州","广州","成都","南京","武汉","呼和浩特","重庆","长沙","昆明","西安","青岛","天津","宁波","厦门","太原","大连","济南"],
      A : ["阿克苏","阿勒泰","安康","安庆","安顺","鞍山"],
      B : ["百色","蚌埠","包头","保山","北海","北京首都","北京南苑"],
      C : ["昌都","长春","长海","长沙","长治","常德","常州","朝阳","成都","赤峰","重庆"],
      D : ["达县","大理","大连","大同","丹东","德宏","迪庆","东营","敦煌","大庆"],
      E : ["鄂尔多斯","恩施"],
      F : ["佛山","福州","阜阳","富蕴"],
      G : ["赣州","格尔木","光化","广汉","广州","贵阳","桂林"],
      H : ["哈尔滨","哈密","海口","海拉尔","邯郸","汉中","杭州","合肥","和田","黑河","衡阳","呼和浩特","怀化","黄山","黄岩","徽州"],
      J : ["吉安","吉林","济南","济宁","佳木斯","嘉峪关","锦州","晋江","井冈山","景德镇","景洪","九江","九寨沟","酒泉"],
      K : ["喀纳斯","喀什","克拉玛依","库车","库尔勒","昆明"],
      L : ["拉萨","兰州","黎平","丽江","连城","连云港","林西","林芝","临沧","临沂","柳州","龙岩","庐山","泸州","路桥","洛阳"],
      M : ["满洲里","芒市","梅县","绵阳","漠河","牡丹江"],
      N : ["那拉提","南昌","南充","南京","南宁","南通","南阳","宁波"],
      P : ["攀枝花","普洱"],
      Q : ["齐齐哈尔","且末","秦皇岛","青岛","庆阳","衢州","泉州"],
      S : ["三亚","沙市","汕头","鄯善","上海虹桥","上海浦东","深圳","沈阳","石家庄","思茅","苏州"],
      T : ["塔城","台州","太原","天津","通化","通辽","铜仁","腾冲"],
      W : ["万州","威海","潍坊","温州","文山","乌海","无锡","梧州","武汉","武夷山","乌兰浩特","乌鲁木齐"],
      X : ["西安","西昌","西宁","西双版纳","锡林浩特","厦门","香格里拉","襄樊","兴城","兴宁","兴义","邢台","徐州"],
      Y : ["烟台","延安","延吉","盐城","伊宁","宜宾","宜昌","义乌","银川","永州零陵","榆林","元谋","运城"],
      Z : ["湛江","张家界","昭通","郑州","芷江","中甸","舟山","珠海","遵义"]
     };
(function(){
   var style="#ShowFlightCityBox a{color:#0055AA;}  #ShowFlightCityBox a:hover{ color:#ff6000;}";
  document.write("<style type='text/css'>");
  document.write(style);
  document.write("</style>");
  
 var CnFlightCityBoxString ="<div id='ShowFlightCityBox' style='position:absolute; top:50px; left:50px; width:430px; height:120px;border:solid 1px #7F9DB9;background:#FFFFFF; z-index:1000000; text-align:left; display:none;'></div> <iframe id='ShowFlightCityBoxIframe' style='position:absolute; display:none;' src=''> </iframe>"; 
  document.write(CnFlightCityBoxString);
})();
function ShowFlightAllCityCaption_MouseOut(obj)
{
    CnFlightAllCity_CaptionA.style.visibility = "visible";
    obj.style.display = "none";
}  
function CnFlightCityBox(id)	//第一步执行的函数
{
     var obj=document.getElementById(id);
         obj.attachEvent("onclick", function(){CnFlightCityBox_Click(obj);});
         obj.attachEvent("onkeyup",function(){CnFlightCityBox_KeyUp(obj);});
         obj.attachEvent("onkeydown",function(){CnFlightCityBox_KeyDown(obj);});      
     if(obj.value=='拼音输入/单击选择' || obj.value=='')
     {
         if(id == 'ddlOrgCity')
         { 
           obj.value='上海';
          } 
         else 
			 if(id == 'ddlDesCity')
			 {
			   obj.value='北京'; 
			 } 
			else
			{ 
				obj.value='';
			 } 
         obj.style.color='black'; 
	 }
}
function CnFlightCityBox_KeyDown(obj)	//第二步执行的函数
{
           if(event.keyCode=="40")
           {
               var prev = document.getElementById("FlightCityListIndex_"+flightCityListIndex);
               flightCityListIndex++;
               var selected = document.getElementById("FlightCityListIndex_"+flightCityListIndex);                
               if(prev)
			   {prev.style.background="#FFFFFF";prev.selected='false';}
               if(selected) {selected.style.background="#C8E3FC"; selected.selected='true';}
               else{ if(prev){prev.style.background="#C8E3FC";prev.selected='true'; flightCityListIndex--;}}
           }
           if(event.keyCode=="38")
           {
               var next = document.getElementById("FlightCityListIndex_"+flightCityListIndex);
               flightCityListIndex--;
               var selected = document.getElementById("FlightCityListIndex_"+flightCityListIndex);               
               if(next) {next.style.background="#FFFFFF";next.selected='false';}
               if(selected){ selected.style.background="#C8E3FC"; selected.selected='true';  }
               else
			   { if(next){next.style.background="#C8E3FC";next.selected='false';flightCityListIndex++;} }
           }
           if(event.keyCode=="13")
           {
                var selected = document.getElementById("FlightCityListIndex_"+flightCityListIndex);
                if(selected){ obj.value=selected.childNodes[1].innerHTML; document.getElementById('ShowFlightCityBox').style.display="none"; document.getElementById('ShowFlightCityBoxIframe').style.display="none"; if(obj.id=='ddlOrgCity')document.getElementById("ddlDesCity").click(); }
           }
           return false;
}
function CnFlightCityBox_KeyUp(obj) //第三步执行的函数
{
   if(event.keyCode=="40" || event.keyCode=="38" || event.keyCode=="13")return;
   if(obj.value.replace(new RegExp("(^[\\s]*)|([\\s]*$)", "g"), "")=="")return;
   var inputKey = obj.value.replace(/(^\s*)|(\s*$)/g, "");
     if(CnFlightCityBoxIsChinese(inputKey))
	   {
		  CnFlightCityBox_KeyUpShowFlightBox(obj,CnFlightConvertChinese(inputKey));
	   }
	else
	   {
		  CnFlightCityBox_KeyUpShowFlightBox(obj,inputKey);
	   }
}
function CnFlightCityBox_Click(obj) //第四步执行的函数
{
   CnFlightCityBoxObject=obj;
    var __CnFlightBoxDiv = document.getElementById('ShowFlightCityBox');
        __CnFlightBoxDiv.style.cssText="position:absolute; top:50px; left:50px; width:430px; height:120px;border:solid 1px #7F9DB9;background:#FFFFFF; z-index:1000000; text-align:left; display:none;";
        __CnFlightBoxDiv.style.top=CnFlightCityBoxGetPointsPos(obj,"Top")+obj.offsetHeight;
        if(CnFlightCityBoxGetPointsPos(obj,"Left")+420 < document.body.clientWidth)
      {     
              __CnFlightBoxDiv.style.left = CnFlightCityBoxGetPointsPos(obj,"Left");
      }
      else
      {
     __CnFlightBoxDiv.style.left = CnFlightCityBoxGetPointsPos(obj,"Left") -(420-obj.offsetWidth) ; 
      }     
	  var ___DeflautFlightCityString = "<a id='FlightHotCityLabel' hideFocus='true' style='font-size:14px;font-weight:bold; color:#ff6000;margin-left:5px; float:left;' href='javascript:void(0)' onclick='ShowCnFlightBoxHotCity_Click();'>[热门城市]</a><a id='FlightAllCityLabel' hideFocus='true' style='margin-left:300px; font-size:14px;font-weight:bold;cursor:pointer;color:#FA6600;' onclick='CnFlightCityBox_Close()'>[关闭]</a>"+
      "<div style='height:1px; margin-top:5px;border-bottom:dotted 1px #DCDCDC; overflow:hidden;'></div>"+
      "<div id='ShowFlightHotCity' style='margin-left:5px;'>"+
          "<div>"+
              "<a href='javascript:void(0)' title='北京首都' style='font-size:14px;font-family:Helvetica,Arial,sans-serif; display:inline-block; font-weight:lighter; margin:5px;' onclick='CnFlightBoxHotCityA_Click(this)'>北京首都</a>"+
			  "<a href='javascript:void(0)' title='北京南苑' style='font-size:14px;font-family:Helvetica,Arial,sans-serif; display:inline-block; font-weight:lighter; margin:5px;' onclick='CnFlightBoxHotCityA_Click(this)'>北京南苑</a>"+
              "<a href='javascript:void(0)' title='上海虹桥' style='font-size:14px;font-family:Helvetica,Arial,sans-serif; display:inline-block; font-weight:lighter; margin:5px;' onclick='CnFlightBoxHotCityA_Click(this)'>上海虹桥</a>"+
			  "<a href='javascript:void(0)' title='上海浦东' style='font-size:14px;font-family:Helvetica,Arial,sans-serif; display:inline-block; font-weight:lighter; margin:5px;' onclick='CnFlightBoxHotCityA_Click(this)'>上海浦东</a>"+
              "<a href='javascript:void(0)' title='天津' style='font-size:14px;font-family:Helvetica,Arial,sans-serif; display:inline-block; font-weight:lighter; margin:5px;' onclick='CnFlightBoxHotCityA_Click(this)'>天津</a>"+
              "<a href='javascript:void(0)' title='深圳' style='font-size:14px;font-family:Helvetica,Arial,sans-serif; display:inline-block; font-weight:lighter; margin:5px;' onclick='CnFlightBoxHotCityA_Click(this)'>深圳</a>"+
              "<a href='javascript:void(0)' title='杭州' style='font-size:14px;font-family:Helvetica,Arial,sans-serif; display:inline-block; font-weight:lighter; margin:5px;' onclick='CnFlightBoxHotCityA_Click(this)'>杭州</a>"+
              "<a href='javascript:void(0)' title='广州' style='font-size:14px;font-family:Helvetica,Arial,sans-serif; display:inline-block; font-weight:lighter; margin:5px;' onclick='CnFlightBoxHotCityA_Click(this)'>广州</a>"+
              "<a href='javascript:void(0)' title='成都' style='font-size:14px;font-family:Helvetica,Arial,sans-serif; display:inline-block; font-weight:lighter; margin:5px;' onclick='CnFlightBoxHotCityA_Click(this)'>成都</a>"+
              "<a href='javascript:void(0)' title='南京' style='font-size:14px;font-family:Helvetica,Arial,sans-serif; display:inline-block; font-weight:lighter; margin:5px;' onclick='CnFlightBoxHotCityA_Click(this)'>南京</a>"+
              "<a href='javascript:void(0)' title='武汉' style='font-size:14px;font-family:Helvetica,Arial,sans-serif; display:inline-block; font-weight:lighter; margin:5px;' onclick='CnFlightBoxHotCityA_Click(this)'>武汉</a>"+
              "<a href='javascript:void(0)' title='重庆' style='font-size:14px;font-family:Helvetica,Arial,sans-serif; display:inline-block; font-weight:lighter; margin:5px;' onclick='CnFlightBoxHotCityA_Click(this)'>重庆</a>"+
              "<a href='javascript:void(0)' title='长沙' style='font-size:14px;font-family:Helvetica,Arial,sans-serif; display:inline-block; font-weight:lighter; margin:5px;' onclick='CnFlightBoxHotCityA_Click(this)'>长沙</a>"+
              "<a href='javascript:void(0)' title='昆明' style='font-size:14px;font-family:Helvetica,Arial,sans-serif; display:inline-block; font-weight:lighter; margin:5px;' onclick='CnFlightBoxHotCityA_Click(this)'>昆明</a>"+
              "<a href='javascript:void(0)' title='西安' style='font-size:14px;font-family:Helvetica,Arial,sans-serif; display:inline-block; font-weight:lighter; margin:5px;' onclick='CnFlightBoxHotCityA_Click(this)'>西安</a>"+
              "<a href='javascript:void(0)' title='青岛' style='font-size:14px;font-family:Helvetica,Arial,sans-serif; display:inline-block; font-weight:lighter; margin:5px;' onclick='CnFlightBoxHotCityA_Click(this)'>青岛</a>"+
              "<a href='javascript:void(0)' title='宁波' style='font-size:14px;font-family:Helvetica,Arial,sans-serif; display:inline-block; font-weight:lighter; margin:5px;' onclick='CnFlightBoxHotCityA_Click(this)'>宁波</a>"+
              "<a href='javascript:void(0)' title='厦门' style='font-size:14px;font-family:Helvetica,Arial,sans-serif; display:inline-block; font-weight:lighter; margin:5px;' onclick='CnFlightBoxHotCityA_Click(this)'>厦门</a>"+
              "<a href='javascript:void(0)' title='太原' style='font-size:14px;font-family:Helvetica,Arial,sans-serif; display:inline-block; font-weight:lighter; margin:5px;' onclick='CnFlightBoxHotCityA_Click(this)'>太原</a>"+
              "<a href='javascript:void(0)' title='大连' style='font-size:14px;font-family:Helvetica,Arial,sans-serif; display:inline-block; font-weight:lighter; margin:5px;' onclick='CnFlightBoxHotCityA_Click(this)'>大连</a>"+
              "<a href='javascript:void(0)' title='济南' style='font-size:14px;font-family:Helvetica,Arial,sans-serif; display:inline-block; font-weight:lighter; margin:5px;' onclick='CnFlightBoxHotCityA_Click(this)'>济南</a>"+
              "<a href='javascript:void(0)' title='呼和浩特' style='font-size:14px;font-family:Helvetica,Arial,sans-serif; display:inline-block; font-weight:lighter; margin:5px;' onclick='CnFlightBoxHotCityA_Click(this)'>呼和浩特</a>"+
          "</div>"+
      "</div>"+
      "<div id='ShowFlightAllCity' style='margin-left:5px; display:none;'>"+
      "<label style='color:#000; font-size:14px;font-weight:lighter;margin: 3px;text-align: right;cursor:default;'> 拼音首字母:</label>"+
      "<a style='font-size:14px;font-family:Helvetica,Arial,sans-serif; display:inline-block; font-weight:lighter; margin:3px; color:#0055AA;' title='A' href='javascript:void(0)' onmouseover='ShowFlightAllCity_MouseOver(this)'> A</a>"+
      "<a style='font-size:14px;font-family:Helvetica,Arial,sans-serif; display:inline-block; font-weight:lighter; margin:3px; color:#0055AA;' title='B' href='javascript:void(0)' onmouseover='ShowFlightAllCity_MouseOver(this)'> B</a>"+
      "<a style='font-size:14px;font-family:Helvetica,Arial,sans-serif; display:inline-block; font-weight:lighter; margin:3px; color:#0055AA;' title='C' href='javascript:void(0)' onmouseover='ShowFlightAllCity_MouseOver(this)'> C</a>"+
      "<a style='font-size:14px;font-family:Helvetica,Arial,sans-serif; display:inline-block; font-weight:lighter; margin:3px; color:#0055AA;' title='D' href='javascript:void(0)' onmouseover='ShowFlightAllCity_MouseOver(this)'> D</a>"+
      "<a style='font-size:14px;font-family:Helvetica,Arial,sans-serif; display:inline-block; font-weight:lighter; margin:3px; color:#0055AA;' title='E' href='javascript:void(0)' onmouseover='ShowFlightAllCity_MouseOver(this)'> E</a>"+
      "<a style='font-size:14px;font-family:Helvetica,Arial,sans-serif; display:inline-block; font-weight:lighter; margin:3px; color:#0055AA;' title='F' href='javascript:void(0)' onmouseover='ShowFlightAllCity_MouseOver(this)'> F</a>"+
      "<a style='font-size:14px;font-family:Helvetica,Arial,sans-serif; display:inline-block; font-weight:lighter; margin:3px; color:#0055AA;' title='G' href='javascript:void(0)' onmouseover='ShowFlightAllCity_MouseOver(this)'> G</a>"+                          
      "<a style='font-size:14px;font-family:Helvetica,Arial,sans-serif; display:inline-block; font-weight:lighter; margin:3px; color:#0055AA;' title='H' href='javascript:void(0)' onmouseover='ShowFlightAllCity_MouseOver(this)'> H</a>"+
      "<a style='font-size:14px;font-family:Helvetica,Arial,sans-serif; display:inline-block; font-weight:lighter; margin:3px; color:#0055AA;' title='J' href='javascript:void(0)' onmouseover='ShowFlightAllCity_MouseOver(this)'> J</a>"+
      "<a style='font-size:14px;font-family:Helvetica,Arial,sans-serif; display:inline-block; font-weight:lighter; margin:3px; color:#0055AA;' title='K' href='javascript:void(0)' onmouseover='ShowFlightAllCity_MouseOver(this)'> K</a>"+
      "<a style='font-size:14px;font-family:Helvetica,Arial,sans-serif; display:inline-block; font-weight:lighter; margin:3px; color:#0055AA;' title='L' href='javascript:void(0)' onmouseover='ShowFlightAllCity_MouseOver(this)'> L</a>"+
      "<a style='font-size:14px;font-family:Helvetica,Arial,sans-serif; display:inline-block; font-weight:lighter; margin:3px; color:#0055AA;' title='M' href='javascript:void(0)' onmouseover='ShowFlightAllCity_MouseOver(this)'> M</a>"+
      "<a style='font-size:14px;font-family:Helvetica,Arial,sans-serif; display:inline-block; font-weight:lighter; margin:3px; color:#0055AA;' title='N' href='javascript:void(0)' onmouseover='ShowFlightAllCity_MouseOver(this)'> N</a>"+
      "<a style='font-size:14px;font-family:Helvetica,Arial,sans-serif; display:inline-block; font-weight:lighter; margin:3px; color:#0055AA;' title='P' href='javascript:void(0)' onmouseover='ShowFlightAllCity_MouseOver(this)'> P</a>"+
      "<a style='font-size:14px;font-family:Helvetica,Arial,sans-serif; display:inline-block; font-weight:lighter; margin:3px; color:#0055AA;' title='Q' href='javascript:void(0)' onmouseover='ShowFlightAllCity_MouseOver(this)'> Q</a>"+
      "<a style='font-size:14px;font-family:Helvetica,Arial,sans-serif; display:inline-block; font-weight:lighter; margin:3px; color:#0055AA;' title='S' href='javascript:void(0)' onmouseover='ShowFlightAllCity_MouseOver(this)'> S</a>"+
      "<a style='font-size:14px;font-family:Helvetica,Arial,sans-serif; display:inline-block; font-weight:lighter; margin:3px; color:#0055AA;' title='T' href='javascript:void(0)' onmouseover='ShowFlightAllCity_MouseOver(this)'> T</a>"+
      "<a style='font-size:14px;font-family:Helvetica,Arial,sans-serif; display:inline-block; font-weight:lighter; margin:3px; color:#0055AA;' title='W' href='javascript:void(0)' onmouseover='ShowFlightAllCity_MouseOver(this)'> W</a>"+
      "<a style='font-size:14px;font-family:Helvetica,Arial,sans-serif; display:inline-block; font-weight:lighter; margin:3px; color:#0055AA;' title='X' href='javascript:void(0)' onmouseover='ShowFlightAllCity_MouseOver(this)'> X</a>"+
      "<a style='font-size:14px;font-family:Helvetica,Arial,sans-serif; display:inline-block; font-weight:lighter; margin:3px; color:#0055AA;' title='Y' href='javascript:void(0)' onmouseover='ShowFlightAllCity_MouseOver(this)'> Y</a>"+
      "<a style='font-size:14px;font-family:Helvetica,Arial,sans-serif; display:inline-block; font-weight:lighter; margin:3px; color:#0055AA;' title='Z' href='javascript:void(0)' onmouseover='ShowFlightAllCity_MouseOver(this)'> Z</a>"+
      "<a style='font-size:25px;text-decoration:none; position:absolute; font-weight:bold; display:none;' href='javascript:void(0)' id='ShowFlightAllCity_CaptionA' title='A' onmouseout='ShowFlightAllCityCaption_MouseOut(this)' onclick='ShowFlightAllCity_ShowClickA(this)'>A</a>"+
      "<div id='ShowFlightAllCity_List'> "+
         "<a href='javascript:void(0)' style='font-size:14px;font-family:Helvetica,Arial,sans-serif; display:inline-block; font-weight:lighter; margin:5px;' title='阿克苏' onclick='CnFlightBoxHotCityA_Click(this)'>阿克苏 </a>"+
         "<a href='javascript:void(0)' style='font-size:14px;font-family:Helvetica,Arial,sans-serif; display:inline-block; font-weight:lighter; margin:5px;' title='阿勒泰' onclick='CnFlightBoxHotCityA_Click(this)'>阿勒泰 </a>"+
         "<a href='javascript:void(0)' style='font-size:14px;font-family:Helvetica,Arial,sans-serif; display:inline-block; font-weight:lighter; margin:5px;' title='安康'   onclick='CnFlightBoxHotCityA_Click(this)'>安康 </a>"+
         "<a href='javascript:void(0)' style='font-size:14px;font-family:Helvetica,Arial,sans-serif; display:inline-block; font-weight:lighter; margin:5px;' title='安庆'   onclick='CnFlightBoxHotCityA_Click(this)'>安庆 </a>"+
         "<a href='javascript:void(0)' style='font-size:14px;font-family:Helvetica,Arial,sans-serif; display:inline-block; font-weight:lighter; margin:5px;' title='安顺'   onclick='CnFlightBoxHotCityA_Click(this)'>安顺 </a>"+
         "<a href='javascript:void(0)' style='font-size:14px;font-family:Helvetica,Arial,sans-serif; display:inline-block; font-weight:lighter; margin:5px;' title='鞍山'   onclick='CnFlightBoxHotCityA_Click(this)'>鞍山 </a>"+
      "</div>"+
      "</div>"+
      "<a href='javascript:void(0)' style='position:absolute; bottom:2px; right:5px;font-size:15px;font-weight:bold; color:#ff6000;' href='javascript:void(0)'onclick='ShowCnFlightBoxAllCity_Click()'>[所有城市]</a>";      
        __CnFlightBoxDiv.innerHTML = ___DeflautFlightCityString;
        __CnFlightBoxDiv.style.display="block";
        document.getElementById('ShowFlightCityBoxIframe').style.width = __CnFlightBoxDiv.offsetWidth;
        document.getElementById('ShowFlightCityBoxIframe').style.height = __CnFlightBoxDiv.offsetHeight;
        document.getElementById('ShowFlightCityBoxIframe').style.top = CnFlightCityBoxGetPointsPos(__CnFlightBoxDiv,"Top");
        document.getElementById('ShowFlightCityBoxIframe').style.left = CnFlightCityBoxGetPointsPos(__CnFlightBoxDiv,"Left");
        document.getElementById('ShowFlightCityBoxIframe').style.display = "block";
        
      try {
           var r=CnFlightCityBoxObject.createTextRange(); 
            r.moveEnd('character',CnFlightCityBoxObject.value.length); 
            r.moveStart('character',0);
            r.select();
    }  
   catch(e){
    } 
}
function CnFlightCityBoxGetPointsPos(el,ePro) //第五步执行的函数
{
	 var ePos=0;
	 while(el!=null)
		 {  
		  ePos+=el["offset"+ePro];
		  el=el.offsetParent;
		 }
	 return ePos;
}
function ShowCnFlightBoxHotCity_Click() //第六步执行的函数
{
    CnFlightCityBoxObject.focus();
    document.getElementById('FlightAllCityLabel').style.color ="#0055AA";
    document.getElementById('FlightHotCityLabel').style.color ="#ff6000";
    document.getElementById('ShowFlightHotCity').style.display ="block";
    document.getElementById('ShowFlightAllCity').style.display ="none";
}
function ShowCnFlightBoxAllCity_Click() //第七步执行的函数
{
    CnFlightCityBoxObject.focus();
    document.getElementById('FlightAllCityLabel').style.color ="#ff6000";
    document.getElementById('FlightHotCityLabel').style.color ="#0055AA";
    document.getElementById('ShowFlightHotCity').style.display ="none";
    document.getElementById('ShowFlightAllCity').style.display ="block";
}
function CnFlightBoxHotCityA_Click(obj)//第八步执行的函数
{
  if(CnFlightCityBoxObject==null)
    return ;
  CnFlightCityBoxObject.value = obj.innerHTML; 
  document.getElementById('ShowFlightCityBox').style.display="none";  
  document.getElementById('ShowFlightCityBoxIframe').style.display="none";   
}
function ShowFlightAllCity_MouseOver(obj)//第九步执行的函数
{
    if(CnFlightAllCity_CaptionA !=null)
    {
      CnFlightAllCity_CaptionA.style.visibility = "visible";
    }
     CnFlightAllCity_CaptionA = obj;
     obj.style.visibility ="hidden";
     document.getElementById('ShowFlightAllCity_CaptionA').innerHTML = obj.innerHTML;
     document.getElementById('ShowFlightAllCity_CaptionA').title = obj.innerHTML;
     document.getElementById('ShowFlightAllCity_CaptionA').style.left = CnFlightCityBoxGetPointsPos(obj,"Left")-CnFlightCityBoxGetPointsPos(document.getElementById('ShowFlightCityBox'),"Left")-5;
     document.getElementById('ShowFlightAllCity_CaptionA').style.top = CnFlightCityBoxGetPointsPos(obj,"Top")-CnFlightCityBoxGetPointsPos(document.getElementById('ShowFlightCityBox'),"Top")-0;
     document.getElementById('ShowFlightAllCity_CaptionA').style.display ="block";
}
function ShowFlightAllCity_ShowClickA(obj)//第十步执行的函数
{
    CnFlightCityBoxObject.focus();
    var FlightAllCityListString="";
    for( var i=0; i< flightCityList[obj.innerHTML].length; i++)
    {
       FlightAllCityListString+="<a href='javascript:void(0)' style='font-size:14px;font-family:Helvetica,Arial,sans-serif; display:inline-block; font-weight:lighter; margin:5px;' title='"+flightCityList[obj.innerHTML][i]+"' onclick='CnFlightBoxHotCityA_Click(this)'>"+flightCityList[obj.innerHTML][i]+"</a>";
    }
    document.getElementById('ShowFlightAllCity_List').innerHTML = FlightAllCityListString;
}
function CnFlightCityBox_Close()//第十一步执行的函数
{
   document.getElementById('ShowFlightCityBox').style.display="none"; 
   document.getElementById('ShowFlightCityBoxIframe').style.display="none"; 
}

function CnFlightCityBoxIsChinese(s)
{ 
   var ret=true; 
   for(var i=0;i<s.length;i++) 
    ret=ret && (s.charCodeAt(i)>=10000); 
    return ret; 
} 
 function CnFlightConvertChinese(str) 
 { 
        var spell = {0xB0A1:"a", 0xB0A3:"ai", 0xB0B0:"an", 0xB0B9:"ang", 0xB0BC:"ao", 0xB0C5:"ba", 0xB0D7:"bai", 0xB0DF:"ban", 0xB0EE:"bang", 0xB0FA:"bao", 0xB1AD:"bei", 0xB1BC:"ben", 0xB1C0:"beng", 0xB1C6:"bi", 0xB1DE:"bian", 0xB1EA:"biao", 0xB1EE:"bie", 0xB1F2:"bin", 0xB1F8:"bing", 0xB2A3:"bo", 0xB2B8:"bu", 0xB2C1:"ca", 0xB2C2:"cai", 0xB2CD:"can", 0xB2D4:"cang", 0xB2D9:"cao", 0xB2DE:"ce", 0xB2E3:"ceng", 0xB2E5:"cha", 0xB2F0:"chai", 0xB2F3:"chan", 0xB2FD:"chang", 0xB3AC:"chao", 0xB3B5:"che", 0xB3BB:"chen", 0xB3C5:"cheng", 0xB3D4:"chi", 0xB3E4:"chong", 0xB3E9:"chou", 0xB3F5:"chu", 0xB4A7:"chuai", 0xB4A8:"chuan", 0xB4AF:"chuang", 0xB4B5:"chui", 0xB4BA:"chun", 0xB4C1:"chuo", 0xB4C3:"ci", 0xB4CF:"cong", 0xB4D5:"cou", 0xB4D6:"cu", 0xB4DA:"cuan", 0xB4DD:"cui", 0xB4E5:"cun", 0xB4E8:"cuo", 0xB4EE:"da", 0xB4F4:"dai", 0xB5A2:"dan", 0xB5B1:"dang", 0xB5B6:"dao", 0xB5C2:"de", 0xB5C5:"deng", 0xB5CC:"di", 0xB5DF:"dian", 0xB5EF:"diao", 0xB5F8:"die", 0xB6A1:"ding", 0xB6AA:"diu", 0xB6AB:"dong", 0xB6B5:"dou", 0xB6BC:"du", 0xB6CB:"duan", 0xB6D1:"dui", 0xB6D5:"dun", 0xB6DE:"duo", 0xB6EA:"e", 0xB6F7:"en", 0xB6F8:"er", 0xB7A2:"fa", 0xB7AA:"fan", 0xB7BB:"fang", 0xB7C6:"fei", 0xB7D2:"fen", 0xB7E1:"feng", 0xB7F0:"fo", 0xB7F1:"fou", 0xB7F2:"fu", 0xB8C1:"ga", 0xB8C3:"gai", 0xB8C9:"gan", 0xB8D4:"gang", 0xB8DD:"gao", 0xB8E7:"ge", 0xB8F8:"gei", 0xB8F9:"gen", 0xB8FB:"geng", 0xB9A4:"gong", 0xB9B3:"gou", 0xB9BC:"gu", 0xB9CE:"gua", 0xB9D4:"guai", 0xB9D7:"guan", 0xB9E2:"guang", 0xB9E5:"gui", 0xB9F5:"gun", 0xB9F8:"guo", 0xB9FE:"ha", 0xBAA1:"hai", 0xBAA8:"han", 0xBABB:"hang", 0xBABE:"hao", 0xBAC7:"he", 0xBAD9:"hei", 0xBADB:"hen", 0xBADF:"heng", 0xBAE4:"hong", 0xBAED:"hou", 0xBAF4:"hu", 0xBBA8:"hua", 0xBBB1:"huai", 0xBBB6:"huan", 0xBBC4:"huang", 0xBBD2:"hui", 0xBBE7:"hun", 0xBBED:"huo", 0xBBF7:"ji", 0xBCCE:"jia", 0xBCDF:"jian", 0xBDA9:"jiang", 0xBDB6:"jiao", 0xBDD2:"jie", 0xBDED:"jin", 0xBEA3:"jing", 0xBEBC:"jiong", 0xBEBE:"jiu", 0xBECF:"ju", 0xBEE8:"juan", 0xBEEF:"jue", 0xBEF9:"jun", 0xBFA6:"ka", 0xBFAA:"kai", 0xBFAF:"kan", 0xBFB5:"kang", 0xBFBC:"kao", 0xBFC0:"ke", 0xBFCF:"ken", 0xBFD3:"keng", 0xBFD5:"kong", 0xBFD9:"kou", 0xBFDD:"ku", 0xBFE4:"kua", 0xBFE9:"kuai", 0xBFED:"kuan", 0xBFEF:"kuang", 0xBFF7:"kui", 0xC0A4:"kun", 0xC0A8:"kuo", 0xC0AC:"la", 0xC0B3:"lai", 0xC0B6:"lan", 0xC0C5:"lang", 0xC0CC:"lao", 0xC0D5:"le", 0xC0D7:"lei", 0xC0E2:"leng", 0xC0E5:"li", 0xC1A9:"lia", 0xC1AA:"lian", 0xC1B8:"liang", 0xC1C3:"liao", 0xC1D0:"lie", 0xC1D5:"lin", 0xC1E1:"ling", 0xC1EF:"liu", 0xC1FA:"long", 0xC2A5:"lou", 0xC2AB:"lu", 0xC2BF:"lv", 0xC2CD:"luan", 0xC2D3:"lue", 0xC2D5:"lun", 0xC2DC:"luo", 0xC2E8:"ma", 0xC2F1:"mai", 0xC2F7:"man", 0xC3A2:"mang", 0xC3A8:"mao", 0xC3B4:"me", 0xC3B5:"mei", 0xC3C5:"men", 0xC3C8:"meng", 0xC3D0:"mi", 0xC3DE:"mian", 0xC3E7:"miao", 0xC3EF:"mie", 0xC3F1:"min", 0xC3F7:"ming", 0xC3FD:"miu", 0xC3FE:"mo", 0xC4B1:"mou", 0xC4B4:"mu", 0xC4C3:"na", 0xC4CA:"nai", 0xC4CF:"nan", 0xC4D2:"nang", 0xC4D3:"nao", 0xC4D8:"ne", 0xC4D9:"nei", 0xC4DB:"nen", 0xC4DC:"neng", 0xC4DD:"ni", 0xC4E8:"nian", 0xC4EF:"niang", 0xC4F1:"niao", 0xC4F3:"nie", 0xC4FA:"nin", 0xC4FB:"ning", 0xC5A3:"niu", 0xC5A7:"nong", 0xC5AB:"nu", 0xC5AE:"nv", 0xC5AF:"nuan", 0xC5B0:"nue", 0xC5B2:"nuo", 0xC5B6:"o", 0xC5B7:"ou", 0xC5BE:"pa", 0xC5C4:"pai", 0xC5CA:"pan", 0xC5D2:"pang", 0xC5D7:"pao", 0xC5DE:"pei", 0xC5E7:"pen", 0xC5E9:"peng", 0xC5F7:"pi", 0xC6AA:"pian", 0xC6AE:"piao", 0xC6B2:"pie", 0xC6B4:"pin", 0xC6B9:"ping", 0xC6C2:"po", 0xC6CB:"pu", 0xC6DA:"qi", 0xC6FE:"qia", 0xC7A3:"qian", 0xC7B9:"qiang", 0xC7C1:"qiao", 0xC7D0:"qie", 0xC7D5:"qin", 0xC7E0:"qing", 0xC7ED:"qiong", 0xC7EF:"qiu", 0xC7F7:"qu", 0xC8A6:"quan", 0xC8B1:"que", 0xC8B9:"qun", 0xC8BB:"ran", 0xC8BF:"rang", 0xC8C4:"rao", 0xC8C7:"re", 0xC8C9:"ren", 0xC8D3:"reng", 0xC8D5:"ri", 0xC8D6:"rong", 0xC8E0:"rou", 0xC8E3:"ru", 0xC8ED:"ruan", 0xC8EF:"rui", 0xC8F2:"run", 0xC8F4:"ruo", 0xC8F6:"sa", 0xC8F9:"sai", 0xC8FD:"san", 0xC9A3:"sang", 0xC9A6:"sao", 0xC9AA:"se", 0xC9AD:"sen", 0xC9AE:"seng", 0xC9AF:"sha", 0xC9B8:"shai", 0xC9BA:"shan", 0xC9CA:"shang", 0xC9D2:"shao", 0xC9DD:"she", 0xC9E9:"shen", 0xC9F9:"sheng", 0xCAA6:"shi", 0xCAD5:"shou", 0xCADF:"shu", 0xCBA2:"shua", 0xCBA4:"shuai", 0xCBA8:"shuan", 0xCBAA:"shuang", 0xCBAD:"shui", 0xCBB1:"shun", 0xCBB5:"shuo", 0xCBB9:"si", 0xCBC9:"song", 0xCBD1:"sou", 0xCBD4:"su", 0xCBE1:"suan", 0xCBE4:"sui", 0xCBEF:"sun", 0xCBF2:"suo", 0xCBFA:"ta", 0xCCA5:"tai", 0xCCAE:"tan", 0xCCC0:"tang", 0xCCCD:"tao", 0xCCD8:"te", 0xCCD9:"teng", 0xCCDD:"ti", 0xCCEC:"tian", 0xCCF4:"tiao", 0xCCF9:"tie", 0xCCFC:"ting", 0xCDA8:"tong", 0xCDB5:"tou", 0xCDB9:"tu", 0xCDC4:"tuan", 0xCDC6:"tui", 0xCDCC:"tun", 0xCDCF:"tuo", 0xCDDA:"wa", 0xCDE1:"wai", 0xCDE3:"wan", 0xCDF4:"wang", 0xCDFE:"wei", 0xCEC1:"wen", 0xCECB:"weng", 0xCECE:"wo", 0xCED7:"wu", 0xCEF4:"xi", 0xCFB9:"xia", 0xCFC6:"xian", 0xCFE0:"xiang", 0xCFF4:"xiao", 0xD0A8:"xie", 0xD0BD:"xin", 0xD0C7:"xing", 0xD0D6:"xiong", 0xD0DD:"xiu", 0xD0E6:"xu", 0xD0F9:"xuan", 0xD1A5:"xue", 0xD1AB:"xun", 0xD1B9:"ya", 0xD1C9:"yan", 0xD1EA:"yang", 0xD1FB:"yao", 0xD2AC:"ye", 0xD2BB:"yi", 0xD2F0:"yin", 0xD3A2:"ying", 0xD3B4:"yo", 0xD3B5:"yong", 0xD3C4:"you", 0xD3D9:"yu", 0xD4A7:"yuan", 0xD4BB:"yue", 0xD4C5:"yun", 0xD4D1:"za", 0xD4D4:"zai", 0xD4DB:"zan", 0xD4DF:"zang", 0xD4E2:"zao", 0xD4F0:"ze", 0xD4F4:"zei", 0xD4F5:"zen", 0xD4F6:"zeng", 0xD4FA:"zha", 0xD5AA:"zhai", 0xD5B0:"zhan", 0xD5C1:"zhang", 0xD5D0:"zhao", 0xD5DA:"zhe", 0xD5E4:"zhen", 0xD5F4:"zheng", 0xD6A5:"zhi", 0xD6D0:"zhong", 0xD6DB:"zhou", 0xD6E9:"zhu", 0xD7A5:"zhua", 0xD7A7:"zhuai", 0xD7A8:"zhuan", 0xD7AE:"zhuang", 0xD7B5:"zhui", 0xD7BB:"zhun", 0xD7BD:"zhuo", 0xD7C8:"zi", 0xD7D7:"zong", 0xD7DE:"zou", 0xD7E2:"zu", 0xD7EA:"zuan", 0xD7EC:"zui", 0xD7F0:"zun", 0xD7F2:"zuo"} ;
        var pStr = "";
        for (var i=0; i<str.length; i++) 
        { 
         if (str.charAt(i) == "\n") pStr += "" 
         else  pStr += ""+pinyin(str.charAt(i)) ; 
        } 
        if(pStr=='zhongqing')
           pStr='chongqing';
           
        return pStr ;
        
         function pinyin(char) 
         { 
            var spellArray = new Array() 
            if (!char.charCodeAt(0) ||char.charCodeAt(0) < 1328) return "" ;
            if (spellArray[char.charCodeAt(0)]) return spellArray[char.charCodeAt(0)];
            execScript("ascCode=hex(asc(\""+char+"\"))", "vbscript") 
            ascCode = eval("0x"+ascCode) 
            if (!(ascCode>0xB0A0 && ascCode<0xD7FC)) return "";
            for (var i=ascCode; (!spell[i] && i>0);) i-- 
              return spell[i] ;
         } 
 }
            

var flightCityListIndex;
function CnFlightCityBox_KeyUpShowFlightBox(obj,inputKey)
{
      var flightCityBox=document.getElementById("ShowFlightCityBox");
          flightCityBox.style.left=CnFlightCityBoxGetPointsPos(obj,"Left");
       flightCityBox.style.top=CnFlightCityBoxGetPointsPos(obj,"Top")+obj.offsetHeight;  
       flightCityBox.style.width=obj.offsetWidth +30;
       flightCityBox.style.overflow="auto";
       flightCityBox.style.height="";
       flightCityBox.innerHTML="";
   
   var FlightCityBoxListString="<div style='font-size:15px; color:#FF7B00; font-weight:bold; border-bottom-style:dashed ; border-bottom-color:#DCDCDC; border-bottom-width:thin; word-break:break-all;overflow:hidden; margin-left:2px;'>"+inputKey.toLowerCase()+"&nbsp;&nbsp;&nbsp;&nbsp; <span style='color:#707070; font-size:12px;font-weight:normal;'>↑↓选择 </span></div><ul id='ShowFlightCityBoxUl' style='list-style:none; margin-top:2px; margin-left:2px;'>";
   var fristChar=inputKey.substr(0,1).toUpperCase();
       if(fristChar=="I" || fristChar=="O" || fristChar=="U" || fristChar=="V" || fristChar=="R")
       {
              FlightCityBoxListString +="<li style='text-align:left; color:#707070; font-size:12px;'>对不起,没有找到!</li></ul>";
              flightCityBox.innerHTML=FlightCityBoxListString;
              flightCityBox.style.display="block";
              
   document.getElementById('ShowFlightCityBoxIframe').style.width = flightCityBox.offsetWidth;
   document.getElementById('ShowFlightCityBoxIframe').style.height = flightCityBox.offsetHeight;
   document.getElementById('ShowFlightCityBoxIframe').style.top = CnFlightCityBoxGetPointsPos(flightCityBox,"Top");
   document.getElementById('ShowFlightCityBoxIframe').style.left = CnFlightCityBoxGetPointsPos(flightCityBox,"Left");
   document.getElementById('ShowFlightCityBoxIframe').style.display = "block";
       }
       else
       {
              var citycount=0;
              try{
                  for(var i=0; i< flightCityList[fristChar].length; i++ )
                  {
                       if(CnFlightConvertChinese(flightCityList[fristChar][i]).substr(0,inputKey.length) !=inputKey.toLowerCase())continue;
                       ListString="<li style='color:#0055AA; text-align:left;'> ";
                       if(citycount==0)
                       {
                           flightCityListIndex=0;
                           FlightCityBoxListString +="<div id='FlightCityListIndex_"+citycount+"' style='text-align:left;height:20px;background:#C8E3FC;' selected='true' onmouseover=\"this.style.background='#E7F1FD'; this.style.cursor='hand';\" onmouseleave=\"this.style.cursor='default'; if(this.selected =='true')this.style.background='#C8E3FC';else this.style.background='#FFFFFF';\" onclick=\" CnFlightCityBoxObject.value=this.childNodes[1].innerHTML; CnFlightCityBoxObject.style.color='black'; document.getElementById('ShowFlightCityBox').style.display='none';document.getElementById('ShowFlightCityBoxIframe').style.display='none'; \"> <span style='float:left;color:#0055AA; font-size:13px; clear:both;'>"+CnFlightConvertChinese(flightCityList[fristChar][i])+"</span><span style='float:right; color:#707070; font-size:13px;'>"+flightCityList[fristChar][i]+"</span></div></li>";
                       }
                       else
                       {
                           FlightCityBoxListString +="<div id='FlightCityListIndex_"+citycount+"' style='text-align:left;height:20px;' selected='false' onmouseover=\"this.style.background='#E7F1FD'; this.style.cursor='hand';\" onmouseleave=\"this.style.cursor='default'; if(this.selected =='true')this.style.background='#C8E3FC';else this.style.background='#FFFFFF';\"  onclick=\" CnFlightCityBoxObject.value=this.childNodes[1].innerHTML; CnFlightCityBoxObject.style.color='black'; document.getElementById('ShowFlightCityBox').style.display='none'; document.getElementById('ShowFlightCityBoxIframe').style.display='none'; \"><span style='float:left;color:#0055AA; font-size:13px; clear:both;'>"+CnFlightConvertChinese(flightCityList[fristChar][i])+"</span><span style='float:right; color:#707070; font-size:13px;'>"+flightCityList[fristChar][i]+"</span> </div></li>";
                       }
                       citycount++;
                  }
               }catch(e){}
              
              if(citycount==0)
              {
                 FlightCityBoxListString +="<li style='text-align:left; color:#707070; font-size:12px;'>对不起,没有找到!</li></ul>";
              }  
              else
              {
                 FlightCityBoxListString+="</ul>"
              }            
              flightCityBox.innerHTML=FlightCityBoxListString;
              flightCityBox.style.display="block";
              
        document.getElementById('ShowFlightCityBoxIframe').style.width = flightCityBox.offsetWidth;
        document.getElementById('ShowFlightCityBoxIframe').style.height = flightCityBox.offsetHeight;
        document.getElementById('ShowFlightCityBoxIframe').style.top = CnFlightCityBoxGetPointsPos(flightCityBox,"Top");
        document.getElementById('ShowFlightCityBoxIframe').style.left = CnFlightCityBoxGetPointsPos(flightCityBox,"Left");
        document.getElementById('ShowFlightCityBoxIframe').style.display = "block";
       }       
}

function CnFlightBoxMultiOnload(FuncName)
{
   var oldProc = window.onload ? window.onload.toString() : ""; 
   if (oldProc.indexOf("anonymous()") > 0)
   {
      oldProc = oldProc.substring(oldProc.indexOf("{") + 1, oldProc.lastIndexOf("}")) + "; ";
   }
   oldProc += FuncName;window.onload = new Function (oldProc);
}
function CnFlightDocumentonMouseDown()
{
   try{
        var el = event.srcElement;
        var IsFlightBox=false;
        var c=0;
        
        while(el !=null)
        {  
           if(c>5)
            break;
            
            if(document.getElementById('ShowFlightCityBox') == el)
            {
                IsFlightBox= true;
                break;
            }
            el=el.parentNode;
            c++;
        }
        if(IsFlightBox==false)
        {
           document.getElementById('ShowFlightCityBox').style.display="none"; 
           document.getElementById('ShowFlightCityBoxIframe').style.display="none"; 
        } 
    }
    catch(e)
    {}  
}
