// Java Documen
document.write('<style type="text/css">');
document.write('#getplatform {position:absolute;background-color:#CBDEE7;visibility:hidden;color:#0099FF;border:1px #ccc solid;border-color:#0099FF;list-style:none;cursor:pointer;}');
document.write('#getplatform iframe{display:none;/*sorry for IE5*/display/**/:block;/*sorry for IE5*/position:absolute;/*must have*/top:0;/*must have*/left:0;/*must have*/z-index:-1;/*must have*/filter:mask();/*must have*/width: 100%;/*must have for any big value*/height: 100%;/*must have for any big value*/;}');
document.write('.hint{border-bottom:1px dashed #C1C1C1;background: #FFFFFF ;color: #656565;font-size: 12px;padding-left:6px;}');
document.write('.mover {padding-left:6px;line-height:120%;cursor: pointer;font-size: 12px;color: #0099FF;border-top-width: 1px;border-bottom-width: 1px;border-top-style: solid;border-bottom-style: solid;border-top-color: #1E5075;border-bottom-color: #1E5075;background-color: #B1D0E0;}');
document.write('.mout { background: #FFFFFF ; line-height:120%;border-top:1px solid #FFFFFF; border-bottom:1px solid #FFFFFF ;padding-left:6px;font-size: 12px;color: #0099FF;}');
document.write('.selected{line-height:120%;font-size: 12px;color: #FFFFFF;padding-left:6px;background-color: #0099FF;border-top-width: 1px;border-bottom-width: 1px;border-top-style: solid;border-bottom-style: solid;border-top-color: #DFEEFF;border-bottom-color: #DFEEFF;}');
document.write('.tdleft{font-size: 12px;padding-left:6px;}');
document.write('.tdright{padding-right:4px;}');
document.write('</style>');

//酒店根据城市查找三字码 
function getThreeWordByCitysFlight(cityName) 
{ 
        var threeWord = ""; 
        for(var i = 0,len = citysFlight.length;i<len;i++) 
        { 
                if(cityName == citysFlight[i][1]) 
                { 
                        threeWord = citysFlight[i][0]; 
                        break; 
                } 
        } 
        return threeWord; 
} 

//初始化常用城市
var commoncitys,citys;

var commoncitysHotel = new Array();

var citysHotel = new Array();


var commoncitysFlight = new Array();
commoncitysFlight[0]=new Array('SZX','深圳','Shenzhen','SZ');
commoncitysFlight[1]=new Array('PEK','北京','Beijing','BJ');
commoncitysFlight[2]=new Array('SHA','上海','Shanghai','SH');
commoncitysFlight[3]=new Array('CAN','广州','Guangzhou','GZ');
commoncitysFlight[4]=new Array('CTU','成都','Chengdu','CD');
commoncitysFlight[5]=new Array('HGH','杭州','Hangzhou','HZ');
commoncitysFlight[6]=new Array('CSX','长沙','Changsha','CS');
commoncitysFlight[7]=new Array('CKG','重庆','Chongqing','CQ');
commoncitysFlight[8]=new Array('KMG','昆明','Kunming','KM');
commoncitysFlight[9]=new Array('XIY','西安','Xian','XA');
commoncitysFlight[10]=new Array('WUH','武汉','Wuhan','WH');
commoncitysFlight[11]=new Array('NKG','南京','Nanjing','NJ');
commoncitysFlight[12]=new Array('TAO','青岛','Qingdao','QD');
commoncitysFlight[13]=new Array('SYX','三亚','Sanya','SY');
commoncitysFlight[14]=new Array('XMN','厦门','Xiamen','XM');
commoncitysFlight[15]=new Array('HKG','香港','Xianggang','XG');
commoncitysFlight[16]=new Array('MAC','澳门','Aomen','AM');


//初始化各个城市
var citysFlight=new Array();
// A
citysFlight[0]=new Array('AAT','阿勒泰','Aletai','ALT');
citysFlight[1]=new Array('AKA','安康','Ankang','AK');
citysFlight[2]=new Array('AKU','阿克苏','Akesu','AKS');
citysFlight[3]=new Array('AYN','安阳','Anyang','AY');
citysFlight[4]=new Array('AQC','安庆','Anqing','AQ');
citysFlight[5]=new Array('BAV','包头','Baotou','BT');
citysFlight[6]=new Array('PEK','北京','Beijin','BJ');
citysFlight[7]=new Array('BHY','北海','Beihai','BH');
citysFlight[8]=new Array('BPX','西藏','Xizhang','XZ');
citysFlight[9]=new Array('BSD','保山','Baoshan','BS');
citysFlight[10]=new Array('CAN','广州','Guangzhou','GZ');
citysFlight[11]=new Array('CGD','常德','Changde','CD');
citysFlight[12]=new Array('CGO','郑州','Zhenzhou','ZZ');
citysFlight[13]=new Array('CGQ','长春','Changchun','CC');
citysFlight[14]=new Array('CHG','朝阳','Chaoyang','CY');
citysFlight[15]=new Array('CHW','酒泉','Jiuquan','JQ');
citysFlight[16]=new Array('CIF','赤峰','Chifeng','CF');
citysFlight[17]=new Array('CIH','长治','Changzhi','CZ');
citysFlight[18]=new Array('CKG','重庆','Chongqing','CQ');
citysFlight[19]=new Array('CNI','长海','Changhai','CH');
citysFlight[20]=new Array('CSX','长沙','Changsha','CS');
citysFlight[21]=new Array('CTU','成都','Chengdu','CD');
citysFlight[22]=new Array('CZX','常州','Changzhou','CZ');
citysFlight[23]=new Array('DAT','大同','Datong','DT');
citysFlight[24]=new Array('DAX','达县','Daxian','DX');
citysFlight[25]=new Array('DDG','丹东','Dandong','DD');
citysFlight[26]=new Array('DIG','中甸','Zhongdian','ZD');
citysFlight[27]=new Array('DLU','大理','Dali','DL');
citysFlight[28]=new Array('DLX','大连','Dalian','DL');
citysFlight[29]=new Array('DNH','敦煌','Dunhuang','DH');
citysFlight[30]=new Array('DSN','东胜','DongSheng','DS');
citysFlight[31]=new Array('DZU','陪陵','Peiling','PL');
citysFlight[32]=new Array('DYG','张家界','Zhangjiajie','ZJJ');
citysFlight[33]=new Array('ENH','恩施','Shien','SN');
citysFlight[34]=new Array('ENY','延安','Yanan','YA');
citysFlight[35]=new Array('FOC','福州','Fuzhou','FZ');
citysFlight[36]=new Array('FUG','阜阳','Fuyang','FY');
citysFlight[37]=new Array('FYN','富蕴','Fuyun','FY');
citysFlight[38]=new Array('GOQ','格尔木','Geermu','GEM');
citysFlight[39]=new Array('GHN','广汉','Guanghan','GH');
citysFlight[40]=new Array('HAK','海口','Haikou','HK');
citysFlight[41]=new Array('HEK','黑河','Heihe','HH');
citysFlight[42]=new Array('HET','呼和浩特','Fuhehaote','FHHT');
citysFlight[43]=new Array('HFE','合肥','Hefei','HF');
citysFlight[44]=new Array('HGH','杭州','Hangzhou','HZ');
citysFlight[45]=new Array('HHA','黄花/长沙','Huanghua','HH');
citysFlight[46]=new Array('HLD','海拉尔','Hailaer','HLE');
citysFlight[47]=new Array('HLH','乌兰浩特','Wulanhaote','WLHT');
citysFlight[48]=new Array('HMI','哈密','Hami','HM');
citysFlight[49]=new Array('HNY','衡阳','Henyang','HY');
citysFlight[50]=new Array('HRB','哈尔滨','Haerbin','HEB');
citysFlight[51]=new Array('HYN','黄岩','Huangyan','HY');
citysFlight[52]=new Array('HSN','舟山','Zhoushan','ZS');
citysFlight[53]=new Array('HTN','和田/河滩','Hetian','HT');
citysFlight[54]=new Array('HZG','汉中','Hanzhong','HZ');
citysFlight[55]=new Array('HKG','香港','Hongkong','HK');
citysFlight[56]=new Array('INC','银川','Yinchuan','YC');
citysFlight[57]=new Array('IQM','且末','Qiemo','QM');
citysFlight[58]=new Array('IQN','庆阳','Qingyang','QY');
citysFlight[59]=new Array('JDZ','景德镇','Jingdezhen','JDZ');
citysFlight[60]=new Array('JHG','景洪','Jinghong','JH');
citysFlight[61]=new Array('JGN','嘉峪关','Jiayuguang','JYG');
citysFlight[62]=new Array('JIU','九江','Jiujiang','JJ');
citysFlight[63]=new Array('JZH','九寨沟','Jiuzhaigou','JZG');
citysFlight[64]=new Array('JJN','晋江','Jinjiang','JJ');
citysFlight[65]=new Array('JNZ','荆州','jinzhou','JZ');
citysFlight[66]=new Array('JMU','佳木斯','Jiamusi','JMS');
citysFlight[67]=new Array('JUZ','矩州','Juzhou','JZ');
citysFlight[68]=new Array('KCA','库车','Kuche','KC');
citysFlight[69]=new Array('KHG','喀什','Keshi','KS');
citysFlight[70]=new Array('KHN','南昌','Nanchang','NC');
citysFlight[71]=new Array('KMG','昆明','kunming','KM');
citysFlight[72]=new Array('KNC','吉安','Jian','JA');
citysFlight[73]=new Array('KOW','赣州','Ganzhou','GZ');
citysFlight[74]=new Array('KRL','库尔勒','Kuerle','KEL');
citysFlight[75]=new Array('KRY','克拉玛依','Kelamayi','KLMY');
citysFlight[76]=new Array('KWE','贵阳','Guiyang','GY');
citysFlight[77]=new Array('KWL','桂林','Guilin','GL');
citysFlight[78]=new Array('LIA','梁平','Liangping','LP');
citysFlight[79]=new Array('LHW','兰州','Lanzhou','LZ');
citysFlight[80]=new Array('LHK','光化/老河口','Guanghua','GH');
citysFlight[81]=new Array('LYA','洛阳','Luoyang','LY');
citysFlight[82]=new Array('LUZ','庐山','Lushan','LS');
citysFlight[83]=new Array('LXA','拉萨','Lasa','LS');
citysFlight[84]=new Array('LJG','俪江','Lijiang','LJ');
citysFlight[85]=new Array('LUM','潞西','Luxi','LX');
citysFlight[86]=new Array('LXI','林西','Linxi','LX');
citysFlight[87]=new Array('LYG','连云港','Lianyungang','LYG');
citysFlight[88]=new Array('LYI','临沂','Linqi','LQ');
citysFlight[89]=new Array('LZD','兰州东','Lanzhoudong','LZD');
citysFlight[90]=new Array('LZH','柳州','Liuzhou','LZ');
citysFlight[91]=new Array('LXI','怀柔','Huairou','HR');
citysFlight[92]=new Array('LZO','泸州','Luzhou','LZ');
citysFlight[93]=new Array('MXZ','梅县','Meixian','MX');
citysFlight[94]=new Array('MAC','澳门','Macau','AC');
citysFlight[95]=new Array('MDG','牡丹江','Moudanjiang','MDJ');
citysFlight[96]=new Array('NAO','南充','Nanchong','NC');
citysFlight[97]=new Array('NDG','齐齐哈尔','Qiqihaer','QQHE');
citysFlight[98]=new Array('NGB','宁波','Ningbo','NB');
citysFlight[99]=new Array('NKG','南京','Nanjing','NJ');
citysFlight[100]=new Array('NNG','南宁','Nanning','NN');
citysFlight[101]=new Array('NTG','南通','Nantong','NT');
citysFlight[102]=new Array('NNY','南阳','Nanyang','NY');
citysFlight[103]=new Array('PVG','上海浦东','Pudong','PD');
citysFlight[104]=new Array('PZI','樊枝花','Panzhihua','PZH');
citysFlight[105]=new Array('SHS','沙市','Shashi','SS');
citysFlight[106]=new Array('SHA','上海虹桥','Shanghai','SH');
citysFlight[107]=new Array('SHE','沈阳','Shengyang','SY');
citysFlight[108]=new Array('SHP','山海关','Shanhaiguang','SHG');
citysFlight[109]=new Array('SJW','石家庄','Shijiazhuang','SJZ');
citysFlight[110]=new Array('SIA','西安','Xian','XA');
citysFlight[111]=new Array('SWA','汕头','Shantou','ST');
citysFlight[112]=new Array('SZX','深圳','Shenzhen','SZ');
citysFlight[113]=new Array('SYM','思茅','Shimao','SM');
citysFlight[114]=new Array('SYX','三亚','Shanya','SY');
citysFlight[115]=new Array('TAO','青岛','Qingdao','QD');
citysFlight[116]=new Array('TCG','塔昌','Tachang','TC');
citysFlight[117]=new Array('TEN','铜仁','Tongren','TR');
citysFlight[118]=new Array('TGO','辽通','Liaotong','LT');
citysFlight[119]=new Array('TNA','济南','Jinan','JN');
citysFlight[120]=new Array('TSN','天津','Tianjin','TJ');
citysFlight[121]=new Array('TXN','黄山','Huangshan','HS');
citysFlight[122]=new Array('TXN','屯溪','Tunxi','TX');
citysFlight[123]=new Array('TYN','太原','Taiyuan','TY');
citysFlight[124]=new Array('URC','乌鲁木齐','Wulumuqi','WLMQ');
citysFlight[125]=new Array('UYN','榆林','Yulin','YL');
citysFlight[126]=new Array('WUH','武汉','Wuhan','WH');
citysFlight[127]=new Array('WEF','潍坊','Weifang','WF');
citysFlight[128]=new Array('WEH','威海','Weihai','WH');
citysFlight[129]=new Array('WXN','万县','Wanxian','WX');
citysFlight[130]=new Array('WNZ','温州','Wenzhou','WZ');
citysFlight[131]=new Array('WUZ','梧州','Wuzhou','WZ');
citysFlight[132]=new Array('WUS','武夷山','Wuyishan','WYS');
citysFlight[133]=new Array('WUA','乌海','Wuhai','WH');
citysFlight[134]=new Array('XEN','兴城','Xicheng','XC');
citysFlight[135]=new Array('XFN','襄樊','Xiangfan','XF');
citysFlight[136]=new Array('XIC','西昌','Xichang','XC');
citysFlight[137]=new Array('XIL','锡林浩特','Xilinhaote','XLHT');
citysFlight[138]=new Array('XIY','咸阳/西安','Xianyan','XY');
citysFlight[139]=new Array('XIN','兴宁/新宁','Xinning','XN');
citysFlight[140]=new Array('XMN','厦门','Shamen','SM');
citysFlight[141]=new Array('XNN','西宁','Xining','XN');
citysFlight[142]=new Array('XUZ','徐州','Xuzhou','XZ');
citysFlight[143]=new Array('YBP','宜宾','Yibin','YB');
citysFlight[144]=new Array('YIH','宜昌','Yichang','YC');
citysFlight[145]=new Array('YIN','伊宁','Yining','YN');
citysFlight[146]=new Array('YNT','烟台','Yiantai','YT');
citysFlight[147]=new Array('YLN','依兰','Yilan','YL');
citysFlight[148]=new Array('YNJ','延吉','Yanji','YJ');
citysFlight[149]=new Array('YIW','义乌','Yiwu','YW');
citysFlight[150]=new Array('ZAT','昭通','Zhaotong','ZT');
citysFlight[151]=new Array('ZGC','中川/兰州','Zhongchuang','ZC');
citysFlight[152]=new Array('ZHA','湛江','Zhanjiang','ZJ');
citysFlight[153]=new Array('ZUH','珠海','Zhuhai','ZH');
citysFlight[154]=new Array('ZYI','遵义','Zunyi','ZY');

commoncitys = commoncitysFlight;
citys = citysFlight;


//根据三字码查找城市
function getCityByThreeWord(threeWord)
{
	var cityCn = "";
	for(var i = 0,len = citys.length;i<len;i++)
	{
		if(threeWord == citys[i][0])
		{
			cityCn = citys[i][1];
			break;
		}
	}
	return cityCn;
}
//根据城市查找三字码
function getThreeWordByCity(cityName)
{
	var threeWord = "";
	for(var i = 0,len = citys.length;i<len;i++)
	{
		if(cityName == citys[i][1])
		{
			threeWord = citys[i][0];
			break;
		}
	}
	return threeWord;
}
var parentbject;
var city_suggest = function(){
	this.Remoreurl = ''; // 远程URL地址
	this.object = '';
	this.id2 = '';
	this.taskid = 0;
	this.delaySec = 200; // 默认延迟多少毫秒出现提示框
	this.lastkeys_val= 0;
	var lastkeys_val= 0;
	this.lastinputstr = '';	
	/**
	* 初始化类库
	*/
	this.init_zhaobussuggest=  function(){
		var objBody = document.body;
		var objiFrame = document.createElement("iframe");
		var objplatform = document.createElement("div");
                 
		objiFrame.setAttribute('id','getiframe');
		objiFrame.style.zindex='100';		
		objiFrame.style.position = 'absolute';
		objiFrame.style.display = 'none';
		objplatform.setAttribute('id','getplatform');
		objplatform.setAttribute('align','left');
		objplatform.style.zindex='10000';
		objBody.appendChild(objiFrame);
		objBody.appendChild(objplatform);
		var win=objBody || window
                
		if(!document.all) {
			objBody.addEventListener("click",this.hidden_suggest,false);
			
		}else{
			win.document.attachEvent("onclick",this.hidden_suggest);
			
		}
	}

	/***************************************************fill_div()*********************************************/
	//函数功能：动态填充div的内容，该div显示所有的提示内容
	//函数参数：allplat 一个字符串数组，包含了所有可能的提示内容
	this.fill_div = function(allplat){
		var msgplat = '';
		var all = '';
		var spell = '';
		var chinese = '';
		var platkeys = this.object.value;
        platkeys=this.ltrim(platkeys);
		if(!platkeys){
			msgplat += '<table class="hint" width="210"><tr align="left"><td class="tdleft" height="10" align="left">输入中文/拼音或&uarr;&darr;选择</td></tr></table><table width="210" class="mout" height="2"><tr><td></td></tr></table>';
			for(i=0;i<allplat.length;i++){
			    all=allplat[i].split(",");
				spell=all[0];
				chinese=all[1];
				szm=all[2];
				msgplat += '<table class="mout" width="210"><tr onclick="parentbject.add_input_text(\'' + chinese + '\',\'' + szm + '\')"><td class="tdleft" height="10" align="left">'+ spell +
				       '</td><td class="tdright" align="right">' + chinese + '</td><td style="display:none">' + szm + '</td></tr></table>';
			}
        }
		else {
			if(allplat.length < 1 || !allplat[0]){
				msgplat += '<table class="hint" width="210"><tr align="left"><td class="tdleft" height="10" align="left">对不起，找不到：'+platkeys+'</td></tr></table><table width="210" class="mout" height="2"><tr><td></td></tr></table>';

			}
			else{
			   msgplat += '<table class="hint" width="210"><tr align="left"><td class="tdleft" height="10" align="left">'+platkeys+'，按拼音排序</td></tr></table><table width="210" class="mout" height="2"><tr><td></td></tr></table>';
			   for(i=0;i<allplat.length;i++){
					all=allplat[i].split(",");
					spell=all[0];
					chinese=all[1];
					szm=all[2];
					msgplat += '<table class="mout" width="210"><tr onclick="parentbject.add_input_text(\'' + chinese + '\',\'' + szm + '\')"><td class="tdleft" height="10" align="left">'+ spell +
				       '</td><td class="tdright" align="right">' + chinese + '</td><td style="display:none">' + szm + '</td></tr></table>';
				}
			}
		}
		msgplat +='<iframe></iframe>'
		document.getElementById("getplatform").innerHTML =  msgplat;
		var nodes = document.getElementById("getplatform").childNodes;
		nodes[0].className = "hint";
		if(allplat.length >= 1 && allplat[0]){
			nodes[2].className = "selected";
		}
		//this.lastkeys_val = 0;
		for(var i=2;i<nodes.length;i++){
			nodes[i].onmouseover = function(){
				this.className = "mover";
				}
			nodes[i].onmouseout = function(){
				if(parentbject.lastkeys_val==(parentIndexOf(this)-2)){this.className = "selected";}
				else{this.className = "mout";}
			}
		}
		document.getElementById("getiframe").style.width = document.getElementById("getplatform").clientWidth+2;
        document.getElementById("getiframe").style.height = document.getElementById("getplatform").clientHeight+2;		
	}

	/***************************************************fix_div_coordinate*********************************************/
	//函数功能：控制提示div的位置，使之刚好出现在文本输入框的下面
	this.fix_div_coordinate = function(){
		var leftpos=0;
		var toppos=0;
		aTag = this.object;				
		do {
			aTag = aTag.offsetParent;
			leftpos	+= aTag.offsetLeft;
			toppos += aTag.offsetTop;
		}while(aTag!=document.body);
		document.getElementById("getiframe").style.width = this.object.offsetWidth + 'px';
		
		if(document.layers){
			document.getElementById("getiframe").style.left = this.object.offsetLeft	+ leftpos + "px";
			document.getElementById("getiframe").style.top = this.object.offsetTop +	toppos + this.object.offsetHeight + 2 + "px";
		}else{
			document.getElementById("getiframe").style.left =this.object.offsetLeft	+ leftpos  +"px";
			document.getElementById("getiframe").style.top = this.object.offsetTop +	toppos + this.object.offsetHeight + 'px';
		}
		//document.getElementById("getplatform").style.width = this.object.offsetWidth + 'px';
		//document.getElementById("getiframe").style.width= this.object.offsetWidth + 'px';
		if(document.layers){
			document.getElementById("getplatform").style.left = this.object.offsetLeft	+ leftpos + "px";
			document.getElementById("getplatform").style.top = this.object.offsetTop +	toppos + this.object.offsetHeight + 2 + "px";
		}else{
			document.getElementById("getplatform").style.left =this.object.offsetLeft	+ leftpos  +"px";
			document.getElementById("getplatform").style.top = this.object.offsetTop +	toppos + this.object.offsetHeight + 'px';
		}
		
	}

    /***************************************************hidden_suggest*********************************************/
	//函数功能：隐藏提示框
	this.hidden_suggest = function (){
		this.lastkeys_val = 0;		 
		document.getElementById("getiframe").style.visibility = "hidden";
		document.getElementById("getplatform").style.visibility = "hidden";
	}

	/***************************************************show_suggest*********************************************/
	//函数功能：显示提示框
	this.show_suggest = function (){
		document.getElementById("getiframe").style.visibility = "visible";
		document.getElementById("getplatform").style.visibility = "visible";
	}
	this.is_showsuggest= function (){
		if(document.getElementById("getplatform").style.visibility == "visible") return true;else return false;
	}

	this.sleep = function(n){
		var start=new Date().getTime(); //for opera only
		while(true) if(new Date().getTime()-start>n) break;
	}
	this.ltrim = function (strtext){
		return strtext.replace(/[\$&\|\^*%#@! ]+/, '');
	}

    /***************************************************add_input_text*********************************************/
	//函数功能：当用户选中时填充相应的城市名字

	this.add_input_text = function (keys,szm){
		 
		keys=this.ltrim(keys)
		this.object.value = keys;
		var id=this.object.id;		
		document.getElementById(this.id2.id).value = szm;
		document.getElementById(id).style.color="#000000";
		document.getElementById(id).value=keys;
     }

	/***************************************************keys_handleup*********************************************/
	//函数功能：用于处理当用户用向上的方向键选择内容时的事件
	this.keys_handleup = function (){
		if(this.lastkeys_val > 0) this.lastkeys_val--;
		var nodes = document.getElementById("getplatform").childNodes;
		if(this.lastkeys_val < 0) this.lastkeys_val = nodes.length-1;
		var b = 0;
		for(var i=2;i<nodes.length;i++){
			if(b == this.lastkeys_val){
				nodes[i].className = "selected";
				this.add_input_text(nodes[i].childNodes[0].childNodes[0].childNodes[1].innerHTML,nodes[i].childNodes[0].childNodes[0].childNodes[2].innerHTML);
			}else{
				nodes[i].className = "mout";
			}
			b++;
		}
	}

	/***************************************************keys_handledown*********************************************/
	//函数功能：用于处理当用户用向下的方向键选择内容时的事件
	this.keys_handledown = function (){
		
		this.lastkeys_val++;
		
		var nodes = document.getElementById("getplatform").childNodes;
		
		if(this.lastkeys_val >= nodes.length-2) {
			
			this.lastkeys_val--;
			return;
		}
		
		var b = 0;
		for(var i=2;i<nodes.length;i++){
			
			if(b == this.lastkeys_val){
				
				nodes[i].className = "selected";
				this.add_input_text(nodes[i].childNodes[0].childNodes[0].childNodes[1].innerHTML,nodes[i].childNodes[0].childNodes[0].childNodes[2].innerHTML);
			}else{
				nodes[i].className = "mout";
			}
			b++;
		}
	}

	this.ajaxac_getkeycode = function (e)
	{
		var code;
		if (!e) var e = window.event;
		if (e.keyCode) code = e.keyCode;
		else if (e.which) code = e.which;
		
		return code;
		
	}

	/***************************************************keys_enter*********************************************/
	//函数功能：用于处理当用户回车键选择内容时的事件
	this.keys_enter = function (){
		  
		var nodes = document.getElementById("getplatform").childNodes;
		for(var i=2;i<nodes.length;i++){
			if(nodes[i].className == "selected"){
				
			  this.add_input_text(nodes[i].childNodes[0].childNodes[0].childNodes[1].innerHTML,nodes[i].childNodes[0].childNodes[0].childNodes[2].innerHTML);
			}
		}
		this.hidden_suggest();
	}

 
function getEvent()
{
 if(document.all)    return window.event;//如果是ie
 func=getEvent.caller;
        while(func!=null){
            var arg0=func.arguments[0];
            if(arg0){if((arg0.constructor==Event || arg0.constructor ==MouseEvent) || (typeof(arg0)=="object" && arg0.preventDefault && arg0.stopPropagation)){return arg0;}            }
            func=func.caller;
        }
       return null;
}

    /***************************************************display*********************************************/
	//函数功能：入口函数，将提示层div显示出来
	//输入参数：object 当前输入所在的对象，如文本框
	//输入参数：e IE事件对象
	this.display = function (object,id2,e){		
		this.object = document.getElementById(object);
		this.id2 = document.getElementById(id2);
		if(!document.getElementById("getplatform")) this.init_zhaobussuggest();
		e = e || window.event;
		//var e=getEvent();
		e.stopPropagation;
		e.cancelBubble = true;
		if (e.target) targ = e.target;  else if (e.srcElement) targ = e.srcElement;
		if (targ.nodeType == 3)  targ = targ.parentNode;

		var inputkeys = this.ajaxac_getkeycode(e);
		switch(inputkeys){
			case 38: //向上方向键
				this.keys_handleup(this.object.id);
			    return;break;
			case 40: //向下方向键
			  
				if(this.is_showsuggest()) this.keys_handledown(this.object.id); else this.show_suggest();
			    return;break;
			case 39: //向右方向键
				return;break;
			case 37: //向左方向键
				return;break;
			case 13: //对应回车键
			 
			    this.keys_enter();
			    return;break;
			case 18: //对应Alt键
				this.hidden_suggest();
			    return;break;
			case 27: //对应Esc键
				this.hidden_suggest();
			    return;break;
		}

		//object.value = this.ltrim(object.value);
		
		//if(object.value == this.lastinputstr) return;else this.lastinputstr = object.value;
		if(window.opera) this.sleep(100);//延迟0.1秒
		parentbject = this;
		if(this.taskid) window.clearTimeout(this.taskid);
        this.taskid=setTimeout("parentbject.localtext();" , this.delaySec)
		//this.taskid = setTimeout("parentbject.remoteurltext();" , this.delaySec);

	}

	//函数功能：从本地js数组中获取要填充到提示层div中的文本内容
	this.localtext = function(){
		var id=this.object.id;
        var suggestions="";
        suggestions=this.getSuggestionByName();
		suggestions=suggestions.substring(0,suggestions.length-1);

		parentbject.show_suggest();
		parentbject.fill_div(suggestions.split(';'));
		parentbject.fix_div_coordinate();
	}

	/***************************************************getSuggestionByName*********************************************/
	//函数功能：从本地js数组中获取要填充到提示层div中的城市名字
	this.getSuggestionByName = function(){
		platkeys = this.object.value;
		var str="";
        platkeys=this.ltrim(platkeys);
		if(!platkeys){
			for(i=0;i<commoncitys.length;i++){
				str+=commoncitys[i][2]+","+commoncitys[i][1]+","+commoncitys[i][0]+";";
			}
			return str;
        }
		else{
		   platkeys=platkeys.toUpperCase();
			for(i=0;i<citys.length;i++){
			    if(this.getLeftStr(citys[i][0],platkeys.length).toUpperCase()==platkeys||
				   (citys[i][1].toUpperCase().indexOf(platkeys)!=-1)||
				   this.getLeftStr(citys[i][2],platkeys.length).toUpperCase()==platkeys||
				   this.getLeftStr(citys[i][3],platkeys.length).toUpperCase()==platkeys)
					str+=citys[i][2]+","+citys[i][1]+","+citys[i][0]+";";
			}
			return str;
		}
	}

	/***************************************************getLeftStr************* *************************************/
    //函数功能：得到左边的字符串
    this.getLeftStr = function(str,len){

        if(isNaN(len)||len==null){
            len = str.length;
        }
        else{
            if(parseInt(len)<0||parseInt(len)>str.length){
                len = str.length;
             }
        }
        return str.substr(0,len);
    }

	/***************************************************parentIndexOf************* *************************************/
    //函数功能：得到子结点在父结点的位置
	function parentIndexOf(node){
	  for (var i=0; i<node.parentNode.childNodes.length; i++){
			if(node==node.parentNode.childNodes[i]){return i;}
	  }
   }


}

function showSearch(obj,type){
	
	
    if(type==1){
        if(document.getElementById(obj).value==""){
			document.getElementById(obj).style.color="#C1C1C1";
			document.getElementById(obj).value="中文/拼音";
		}
    }else{
        if(document.getElementById(obj).value=="中文/拼音"){
			document.getElementById(obj).style.color="#000000";
            document.getElementById(obj).value="";
		}
    }
}


 
 var suggest = new city_suggest();
 function search(){
	if(!checkform()){
	   return;
	}
	InlandForm.submit();

}

function change_iframe(idname,urlcity){
	idname.location.href=urlcity;
}
//改变搜索框文字
function changetext(thisid){
	if(thisid == "search1"){
		commoncitys = commoncitysHotel;
		citys = citysHotel;
		document.getElementById("hCity").value = "中文/拼音";
	}else if(thisid == "search2"){
		commoncitys = commoncitysFlight;
		citys = citysFlight;
		document.getElementById("bCity").value = "中文/拼音";
	}

	for(i=1; i<=3; i++)
	{
		var tdid="search"+i;
		document.getElementById(tdid).className="searchitem_b";
	}
	
	document.getElementById(thisid).className="searchitem_r";
}
<!-- 搜索框更换-->
function closeothers(thisid) {
  if (thisid.style.display=="") { 
	hotel.style.display="none";
	plane.style.display="none";
	pkg.style.display="none";
	
    thisid.style.display="";
  }
  else{
  thisid.style.display="";
  }
}