
var Destination = new DestinationMsg();
/*
var styles = "/style/destination.css";
var newSS=document.createElement('link');
newSS.rel='stylesheet';
newSS.type='text/css';
newSS.href=escape(styles);
document.getElementsByTagName("head")[0].appendChild(newSS);
*/

function DestinationMsg()
{
	this.Citys = [['阿坝','aba','四川','ab'],['阿克苏','akesu','新疆','aks'],['阿勒泰','aletai','新疆','alt'],['阿里','ali','西藏','al'],['安康','ankang','陕西','ak'],['安庆','anqing','安徽','aq'],['鞍山','anshan','辽宁','as'],['安阳','anyang','河南','ay'],['安顺','anzhun','贵州','az'],['巴黎','bali','bl'],['巴中','bazhong','四川','bz'],['白城','baicheng','吉林','bc'],['百色','baise','广东','bs'],['白山','baishan','吉林','bs'],['保定','baoding','河北','bd'],['宝鸡','baoji','陕西','bj'],['宝山','baoshan','云南','bs'],['包头','baotou','内蒙古','bt'],['北海','beihai','广东','bh'],['北京','beijing','北京','蓝途热门推荐','bj'],['本溪','benxi','辽宁','bx'],['博尔塔拉','boertala','新疆','betl'],['沧州','cangzhou','河北','cz'],['长白山','changbaishan','吉林','cbs'],['长春','changchun','吉林','cc'],['长岛','changdao','山东','cd'],['常德','changde','湖南','cd'],['昌都','changdu','西藏','cd'],['昌吉','changji','新疆','cj'],['长沙','changsha','湖南','cs'],['常州','changzhou','江苏','cz'],['巢湖','chaohu','安徽','ch'],['郴州','chenzhou','湖南','cz'],['承德','chengde','河北','cd'],['成都','chengdu','四川','cd'],['澄迈','chengmai','海南','cm'],['赤壁','chibi','湖北','cb'],['赤峰','chifeng','内蒙古','cf'],['赤水','chishui','贵州','cs'],['池州','chizhou','安徽','cz'],['重庆','chongqing','重庆','cq'],['大理','dalian','云南','dl'],['大庆','daqing','黑龙江','dq'],['大同','datong','山西','dt'],['大兴安岭','daxinganling','黑龙江','dxal'],['大足','dazhu','重庆','dz'],['丹东','dandong','辽宁','dd'],['当雄','dangxiong','西藏','dx'],['稻城','daocheng','四川','dc'],['迪庆','diqing','云南','dq'],['东莞','donggan','广东','dg'],['东京','dongjing','蓝途热门推荐','dj'],['敦煌','dunhuang','甘肃','dh'],['峨眉山','emeishan','四川','ems'],['鄂州','ezhou','湖北','ez'],['恩施','enshi','湖北','es'],['梵净山','fanjingshan','贵州','fjs'],['丰都','fengdu','重庆','fd'],['奉节','fengjie','重庆','fj'],['佛山','foshan','广东','fs'],['富春江','fuchunjiang','浙江','fcj'],['涪陵','fuling','重庆','fl'],['福州','fuzhou','福建','fz'],['甘南藏族','gannanzangzu','甘肃','gnzz'],['赣西','ganxi','江西','gx'],['赣州','ganzhou','江西','gz'],['甘孜','ganzi','四川','gz'],['格尔木','geermu','青海','gem'],['广安','guangan','四川','ga'],['广元','guangyuan','四川','gy'],['广州','guangzhou','广东','gz'],['桂林','guilin','广东','蓝途热门推荐','gl'],['贵阳','guiyang','贵州','gy'],['果洛','guoluo','青海','gl'],['哈尔滨','haerbin','黑龙江','heb'],['哈密','hami','新疆','hm'],['海东','haidong','青海','hd'],['海口','haikou','海南','hk'],['海拉尔','hailaer','内蒙古','hle'],['海北','haimei','青海','hm'],['海南藏族','hainanzangzu','青海','hnzz'],['海宁','haining','浙江','hn'],['海西','haixi','青海','hx'],['韩城','hancheng','陕西','hc'],['邯郸','handan','河北','hd'],['汉中','hanzhong','陕西','hz'],['杭州','hangzhou','浙江','hz'],['鹤壁','hebi','河南','hb'],['合肥','hefei','安徽','hf'],['鹤岗','hegang','黑龙江','hg'],['和田','hetian','新疆','ht'],['河源','heyuan','广东','hy'],['贺州','hezhou','广东','hz'],['黑河','heihe','黑龙江','hh'],['衡水','hengshui','河北','hs'],['衡阳','hengyang','湖南','hy'],['香港','hongkong','xianggang','xg','hk','蓝途热门推荐','hk'],['呼和浩特','huhehaote','内蒙古','hhht'],['葫芦岛','huludao','辽宁','hld'],['呼伦贝尔','hulunbeier','内蒙古','hlbe'],['华山','huashan','陕西','hs'],['淮安','huaian','江苏','ha'],['怀化','huaihua','湖南','hh'],['淮南','huainan','陕西','hn'],['黄冈','huanggang','湖北','hg'],['黄果树','huangguoshu','贵州','hgs'],['黄龙','huanglong','四川','hl'],['黄南','huangnan','青海','hn'],['黄山','huangshan','安徽','hs'],['惠东','huidong','广东','hd'],['惠州','huizhou','广东','hz'],['吉林','jilin','吉林','jl'],['济南','jinan','山东','jn'],['鸡西','jixi','黑龙江','jx'],['济源','jiyuan','河南','jy'],['佳木斯','jiamusi','黑龙江','jms'],['嘉兴','jiaxing','浙江','jx'],['嘉峪关','jiayuguan','甘肃','jyg'],['江门','jiangmen','广东','jm'],['江阴','jiangyin','江苏','jy'],['焦作','jiaozuo','河南','jz'],['金华','jinhua','浙江','jh'],['晋中','jinzhong','山西','jz'],['晋州','jinzhou','山西','jz'],['景德镇','jingdezhen','江西','jdz'],['井冈山','jinggangshan','江西','jgs'],['随州','suizhou','湖北','sz'],['荆州','jingzhou','湖北','jz'],['九江','jiujiang','江西','jj'],['酒泉','jiuquan','甘肃','jq'],['九寨沟','jiuzhaigou','四川','jzg'],['喀纳斯','kanasi','新疆','kns'],['喀什','kashen','新疆','ks'],['开封','kaifeng','河南','kf'],['康定','kangding','四川','kd'],['库尔勒','keerle','新疆','kel'],['可可西里','kekexili','青海','kkxl'],['克拉玛依','kelamayi','新疆','klmy'],['克孜勒苏','kezilesu','新疆','kzls'],['昆明','kunming','云南','km'],['昆山','kunzhan','江苏','kz'],['拉萨','lasha','西藏','ls'],['莱芜','laiwu','山东','lw'],['兰州','lanzhou','甘肃','lz'],['廊坊','langfang','河北','lf'],['丽江','lijiang','云南','蓝途热门推荐','lj'],['丽水','lishui','浙江','ls'],['连云港','lianyugang','江苏','lyg'],['梁山','liangshan','四川','ls'],['临安','linan','浙江','la'],['临汾','linfen','山西','lf'],['临水','linshui','海南','ls'],['临武','linwu','宁夏','lw'],['临夏','linxia','甘肃','lx'],['林芝','linzhi','西藏','lz'],['六盘水','liupanshui','贵州','lps'],['柳州','liuzhou','广东','lz'],['陇南','longnan','甘肃','ln'],['娄底','loudi','湖南','ld'],['泸沽湖','luguhu','云南','lgh'],['庐山','lushan','江西','ls'],['泸州','luzhou','四川','lz'],['洛阳','luoyang','河南','ly'],['吕梁','lvliang','山西','ll'],['马鞍山','maanshan','安徽','mas'],['曼谷','mangu','蓝途热门推荐','mg'],['茂名','maoming','广东','mm'],['眉山','meishan','四川','ms'],['梅州','meizhou','广东','mz'],['绵羊','mianyang','四川','my'],['牡丹江','mudanjiang','黑龙江','mdj'],['那曲','naqu','西藏','nq'],['南昌','nanchang','江西','nc'],['南充','nanchong','四川','nc'],['南海','nanhai','广东','nh'],['南京','nanjing','江苏','nj'],['南麓山列岛','nanlushanliedao','浙江','nlsld'],['南通','nantong','江苏','nt'],['南阳','nanyang','河南','ny'],['宁波','ningbo','浙江','nb'],['番禺','panyu','广东','py'],['攀枝花','panzhihua','四川','pzh'],['鄱阳湖','poyanghu','江西','pyh'],['莆田','putian','福建','pt'],['普陀山','putuoshan','浙江','pts'],['齐齐哈尔','qiqihaer','黑龙江','qqhe'],['七台河','qitaihe','黑龙江','qth'],['千岛湖','qiandaohu','浙江','qdh'],['黔东','qiandong','贵州','qd'],['黔南','qiannan','贵州','qn'],['黔西','qianxi','贵州','qx'],['秦皇岛','qinhuangdao','河北','qhd'],['秦始皇','qinshihuang','陕西','qsh'],['青岛','qingdao','山东','qd'],['青海湖','qinghaihu','青海','qhh'],['青铜峡','qingtongxia','宁夏','qtx'],['清远','qingyuan','广东','蓝途热门推荐','qy'],['青藏铁路','qingzangtielu','西藏','qztl'],['琼海','qionghai','海南','qh'],['琼山','qiongshan','海南','qs'],['曲阜','qufu','山东','qf'],['曲靖','qujing','云南','qj'],['衢州','quzhou','浙江','qz'],['泉州','quanzhou','福建','qz'],['日喀则','rikaze','西藏','rkz'],['三门峡','sanmenxia','河南','smx'],['三清山','sanqingshan','江西','sqs'],['三峡','sanxia','重庆','sx'],['三亚','sanya','海南','蓝途热门推荐','sy'],['山南','shannan','西藏','sn'],['汕头','shantou','广东','st'],['汕尾','shanwei','广东','sw'],['上海','shanghai','上海','蓝途热门推荐','sh'],['商洛','shangluo','陕西','sl'],['商丘','shangqiu','河南','sq'],['上饶','shangrao','江西','sr'],['韶关','shaoguan','广东','sg'],['绍兴','shaoxing','浙江','sx'],['邵阳','shaoyang','湖南','sy'],['神龙架','shenlongjia','湖北','slj'],['沈阳','shenyang','辽宁','sy'],['深圳','shenzhen','广东','sz'],['石河子','shihezi','新疆','shz'],['石家庄','shijiazhuang','河北','sjz'],['石林','shilin','云南','sl'],['十堰','shiyan','湖北','sy'],['双鸭山','shuangyashan','黑龙江','sys'],['朔州','shuozhou','山西','sz'],['松原','songyuan','吉林','sy'],['宿州','suzhou','安徽','sz'],['绥化','suihua','黑龙江','sh'],['遂宁','suining','四川','sn'],['泰安','taian','山东','ta'],['太原','taiyuan','山西','ty'],['台州','taizhou','浙江','tz'],['唐山','tangshan','河北','ts'],['天津','tianjing','天津','tj'],['天水','tianshui','甘肃','ts'],['天台山','tiantaishan','浙江','tts'],['铁岭','tieling','辽宁','tl'],['铜川','tongchuan','陕西','tc'],['通化','tonghua','吉林','th'],['铜陵','tongling','安徽','tl'],['铜仁','tongren','贵州','tr'],['通什','tongshi','海南','ts'],['吐鲁番','tulufan','新疆','tlf'],['万宁','wanning','海南','wn'],['万州','wanzhou','重庆','wz'],['潍坊','weifang','山东','wf'],['威海','weihai','山东','wh'],['文昌','wenchang','海南','wc'],['温州','wenzhou','浙江','wz'],['武汉','wuhan','湖北','wh'],['芜湖','wuhu','安徽','wh'],['乌兰察布盟','wulancabumeng','内蒙古','wlcbm'],['乌鲁木齐','wulumuqi','新疆','wlmq'],['巫山','wushan','重庆','ws'],['抚顺','wushun','辽宁','ws'],['武威','wuwei','甘肃','ww'],['无锡','wuxi','江苏','wx'],['武夷山','wuyishan','福建','wys'],['婺源','wuyuan','江西','wy'],['乌镇','wuzhen','浙江','wz'],['梧州','wuzhou','广东','wz'],['西安','xian','陕西','xa'],['锡林郭勒','xilinguole','内蒙古','xlgl'],['悉尼','xini','蓝途热门推荐','xn'],['西宁','xining','广东','xn'],['四平','xiping','吉林','xp'],['西沙群岛','xishaqundao','海南','xsqd'],['西双版纳','xishuangbanna','云南','xsbn'],['厦门','xiamen','福建','xm'],['咸宁','xianning','湖北','xn'],['咸阳','xianyang','陕西','xy'],['襄樊','xiangfan','湖北','xf'],['湘潭','xiangtan','湖南','xt'],['湘西','xiangxi','湖南','xx'],['孝感','xiaogan','湖北','xg'],['新乡','xinxinag','河南','xx'],['信阳','xinyang','河南','xy'],['新余','xinyu','江西','xy'],['兴安盟','xinganmeng','内蒙古','xam'],['兴城','xingcheng','辽宁','xc'],['兴隆','xinglong','海南','xl'],['许昌','xuchang','河南','xc'],['徐州','xuzhou','江苏','xz'],['雅安','yaan','四川','ya'],['延安','yanan','陕西','ya'],['延边','yanbian','吉林','yb'],['盐城','yancheng','江苏','yc'],['雁荡山','yandangshan','浙江','yds'],['烟台','yantai','山东','yt'],['阳江','yangjiang','广东','yj'],['阳泉','yangquan','山西','yq'],['扬州','yangzhou','江苏','yz'],['宜宾','yibin','四川','yb'],['宜昌','yichang','湖北','yc'],['宜春','yichun','江西','yc'],['伊犁','yili','新疆','yl'],['黟县','yixian','安徽','yx'],['宜兴','yixing','江苏','yx'],['益阳','yiyang','湖南','yy'],['银川','yinchuan','宁夏','yc'],['营口','yingkou','辽宁','yk'],['永州','yongzhou','湖南','yz'],['玉树','yushu','青海','ys'],['玉溪','yuxi','云南','yx'],['岳阳','yueyang','湖南','yy'],['云浮','yunfu','广东','yf'],['湛江','zhanjiang','广东','zj'],['张家界','zhangjiajie','湖南','zjj'],['张家口','zhangjiakou','河北','zjk'],['张掖','zhangye','甘肃','zy'],['漳州','zhangzhou','福建','zz'],['肇庆','zhaoqing','广东','zq'],['镇江','zhenjiang','江苏','zj'],['郑州','zhengzhou','河南','zz'],['中山','zhongshan','广东','zs'],['周口','zhoukou','河南','zk'],['舟山','zhoushan','浙江','zs'],['周庄','zhouzhuang','江苏','zz'],['珠海','zhuhai','广东','zh'],['驻马店','zhumadian','河南','zmd'],['株洲','zhuzhou','湖南','zz'],['淄博','zibo','山东','zb'],['自贡','zigong','四川','zg'],['遵义','zunyi','贵州','zy']];										//目的地址
    this.eventSrc	= null;						//触发控件
	this.eventDiv	= null;						//显示div
	this.eventIframe	= null;					//iframe
	this.MsgArray	= [""];						//输出内容
	this.showfocus	= 0;
	this.whereFocus	= this.showfocus;
	this.onDocumentClick	= null;				//
	this.page		= 0;						//
	this.pagesize	=10;						//
	this.searchKey	="";						//
	this.Msg ="中文/拼音";
	this.NormalColor ="#666666";
	this.ChageColor	="#333333";
	this.Browser = { 
		'isIE' : (navigator.userAgent.indexOf('MSIE') >= 0) && (navigator.userAgent.indexOf('Opera') < 0), 
		'isFirefox' : navigator.userAgent.indexOf('Firefox') >= 0, 
		'isOpera' : navigator.userAgent.indexOf('Opera') >= 0 
	}; 
	this.styles = "../style/destination.css";

}

DestinationMsg.prototype.init = function(){
	if(this.eventDiv==null){
		this.eventDiv=document.createElement('DIV');
		this.eventDiv.style.display='none';
		this.eventDiv.id='destionation';
		this.eventDiv.style.position='absolute';
		var bs=document.getElementsByTagName('BODY');
		bs[0].appendChild(this.eventDiv);
		this.MsgArray.length=0;

	}
	
}


DestinationMsg.prototype.ShowDivMsg = function(str){
	
	if(isNaN(str)){
		str = 0;
	}
	this.page = str;
	var totalPage = 0;
	totalPage = parseInt((this.MsgArray.length-1)*1 / this.pagesize);
	if(totalPage*1*this.pagesize < this.MsgArray.length)
		totalPage = totalPage+1;


	var MsgStr="";
	if(this.MsgArray.length==0) return false;
	if(this.eventDiv	== null) return false;
	
	var s ='';

	s += '<div class="destionationTitle">'+this.searchKey+', 按拼音排列</div>';
	s += '<div class="destionationContent"><ul>';
	for(i=this.page*1*this.pagesize;i<this.MsgArray.length && i<(this.page*1+1)*this.pagesize;i++){

		s += '<li'+(i==this.whereFocus?' class="state"':'')+' onmousemove="parent.Destination.highlight('+i%this.pagesize+')"  onclick="parent.Destination.OnDestinationClick();" ><span>'+this.MsgArray[i][0]+'</span>&nbsp;'+this.MsgArray[i][1]+'</li>';
	
	}
	

	s += '</ul></div>';	

	if(totalPage>1){
		s += '<div class="destionationPage">';

		for(i=this.page-3; i<=this.page*1+3 && i<totalPage; i++)
		{
			if(i>=0){
				this.page==i?s +='<strong>'+(i*1+1)+'</strong> ':s += '<a href="javascript:parent.Destination.ShowDivMsg('+i+')" id="ToPage'+i+'">'+(i*1+1)+'</a> ';
			}
		}
		s += '</div>';
	}

	this.ShowDiv();
	this.HtmlWriteIn(s.toString());
	
}

DestinationMsg.prototype.HtmlWriteIn = function(content){
	this.eventDiv.innerHTML='<iframe MARGINWIDTH=0 MARGINHEIGHT=0 HSPACE=0 VSPACE=0 FRAMEBORDER=0 SCROLLING=no id="destionationIframe" width="202" height="272"></iframe>';
	if(this.Browser.isIE){
		this.eventIframe = document.frames("destionationIframe").document;
	}else{
		this.eventIframe = document.getElementById('destionationIframe').contentDocument;
	}	
	var HtmlData = '';
	HtmlData += '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">\r\n<html xmlns="http://www.w3.org/1999/xhtml">\r\n<head>\r\n<title>Landtu.com</title>\r\n';
	HtmlData += '<link href="'+this.styles+'" rel="stylesheet" type="text/css">\r\n</head>\r\n<body style="margin:0px; padding:0px;height:270px;border:#7F9DB9 solid 1px;background:#FFFFFF;" >\r\n<DIV ID="destionation_content">';
	HtmlData += content;
	HtmlData += '</div>\r\n</body>\r\n</html>\r\n';
	this.eventIframe.open();
	this.eventIframe.write(HtmlData);
	this.eventIframe.close();
	//onload="//parent.document.all(\'destionationIframe\').height=document.body.scrollHeight"
}



DestinationMsg.prototype.HideDivMsg = function(){
	if(this.eventDiv	== null) return false;
	this.eventDiv.style.display='none';
}

DestinationMsg.prototype.ShowDiv = function(){

	if(this.eventSrc.value == this.Msg){
		this.eventSrc.value = "";
	}
	
	if(this.MsgArray.length	 == 0 ) return;
	if(this.eventDiv	== null) return;
	this.eventDiv.style.display='block';
	this.ShowWhere();
	//this.highlight(this.showfocus);

	this.onDocumentClick = document.onclick;

	document.onclick = function(event) {
		var obj;
		event=event?event:(window.event?window.event:null);
		obj = event.srcElement ? event.srcElement : event.target;
		if(obj != Destination.eventSrc){
			if(obj.id.indexOf("ToPage")!=-1)
				{return;}
			Destination.OnDestinationClick();
			document.onclick = Destination.onDocumentClick;
		}else{
			//Destination.eventDiv.style.display='none';
		}
		
	}
	

}
DestinationMsg.prototype.ShowWhere= function(){
	var OBTop=0;
	var OBLeft=0;
	var OBWidth=0;
	var OBHeight=0;

	var oCurrentNode = this.eventSrc;
	while(oCurrentNode != null && oCurrentNode.tagName != "BODY"){
		OBTop += oCurrentNode.offsetTop;
		OBLeft += oCurrentNode.offsetLeft;
		oCurrentNode = oCurrentNode.offsetParent;
	}

	OBTop += document.getElementsByTagName('BODY')[0].offsetTop 
	OBLeft += document.getElementsByTagName('BODY')[0].offsetLeft 
	
	this.eventDiv.style.top = (OBTop + 2 + this.eventSrc.offsetHeight + "px");
	this.eventDiv.style.left = (OBLeft  + 2 + "px");

}


DestinationMsg.prototype.Top10  = function(){

	var string,count=0;
	
	this.MsgArray.length = 0;
	
	for(var i=0; i<this.Citys.length;i++)
	{
		for(var jj=0; jj<this.Citys[i].length;jj++){	
			if( this.Citys[i][jj].indexOf("蓝途热门推荐") !=-1 )
			{	
				this.MsgArray[count] =["",""];
				this.MsgArray[count][0] = this.Citys[i][0];
				this.MsgArray[count][1] = this.Citys[i][1];

				count++;
				break;
			}
		
		}
	}
	if(this.MsgArray.length!=0)
		this.ShowDivMsg(0);
	else
		this.HideDivMsg();
}

DestinationMsg.prototype.ActionKeyin = function(){

	var string,count=0;
	
	this.MsgArray.length = 0;
	string=this.eventSrc.value;
	this.searchKey=this.eventSrc.value;
	if(string=="") {
		this.Top10();
		return;
	}
	
	for(var i=0; i<this.Citys.length;i++)
	{
		for(var jj=0; jj<this.Citys[i].length;jj++){	
			if( this.Citys[i][jj].indexOf(string) !=-1 )
			{	
				this.MsgArray[count] =["",""];
				this.MsgArray[count][0] = this.Citys[i][0];
				this.MsgArray[count][1] = this.Citys[i][1];
				this.MsgArray[count][2] = this.Citys[i][jj].indexOf(string);

				count++;
				break;
			}
		
		}
	}

	this.MsgArray = this.MsgArray.sort(this.cmp);

	if(this.MsgArray.length!=0){
		this.showfocus	= 0;
		this.whereFocus	= 0;
		this.ShowDivMsg(0);	
	}else{
		this.HideDivMsg();
	}
	
}
DestinationMsg.prototype.cmp = function(e1,e2){
	return e1[2]-e2[2];
}



function isUpDownKey(kc){

	if(kc==40 || kc==38 || kc== 13 || kc==33 || kc==34){//down,up,pageup,pagedown,enter
		var index=Destination.showfocus;
		var ls = Destination.eventIframe.body.getElementsByTagName('LI');
		if(index > ls.length-1)
			index =0 ;
		switch (kc)
		{
			case 33:
				if(index-5>0) 
					index = index-5;
				else
					index = 0;
				Destination.highlight(index);
				break;
			case 34:
				if(index+5<ls.length-1) 
					index = index+5;
				else
					index = ls.length-1;
				Destination.highlight(index);
				break;					
			case 38:
				if(index>0) 
					index = index-1;
				else
				 	index =0;
				Destination.highlight(index);
				break;
			case 40:
				if(index<ls.length-1)
					index = index+1;
				else
					indec = ls.length-1
				Destination.highlight(index);
				break;
			case 13:
				Destination.OnDestinationClick();
				break;
		}
			
		return true;
	}else{
		return false;
	}
}

DestinationMsg.prototype.highlight = function(idx) {

	if(this.eventDiv.style.display=='none'){return false;}
	if(idx==this.showfocus){return true;}
	var i;

	var ls = this.eventIframe.body.getElementsByTagName('LI');

	if(this.showfocus>=0 && (this.pagesize*1*this.page+this.showfocus*1)!=this.whereFocus && this.showfocus<ls.length){
		ls[this.showfocus].className='';
	}
	if((this.whereFocus*1-this.pagesize*1*this.page)>=0 && (this.whereFocus*1-this.pagesize*1*this.page)<ls.length  && (idx*1)!=(this.whereFocus*1-this.pagesize*1*this.page) ){
		ls[(this.whereFocus*1-this.pagesize*1*this.page)].className='state';
	}
	
	if(idx>=0 && idx<ls.length){
		ls[idx].className='hover';
		this.showfocus=parseInt(idx);
	}
	//this.MsgArray
}

DestinationMsg.prototype.OnDestinationClick = function() {

	if(this.eventDiv.style.display=='none'){
		return false;
	}else{
			

		var temp = this.pagesize*1*this.page+this.showfocus*1;
		if(temp<this.MsgArray.length){
			this.eventSrc.value= this.MsgArray[temp][0];
		}else{
			this.eventSrc.value= this.MsgArray[this.MsgArray.length-1][0];
		}

		var ls = this.eventIframe.body.getElementsByTagName('LI');

		if((this.whereFocus*1-this.pagesize*1*this.page)>=0  && (this.whereFocus*1-this.pagesize*1*this.page)<ls.length){
			ls[this.whereFocus*1-this.pagesize*1*this.page].className = "";
		}
		if(this.showfocus>=0  && this.showfocus<ls.length){
			ls[this.showfocus].className = "state";
		}

		this.whereFocus = temp;
		
		this.HideDivMsg();		
	}

	if(this.eventSrc.value == this.Msg || this.eventSrc.value ==""){
		this.eventSrc.style.color=this.NormalColor;	
		this.eventSrc.value = this.Msg;
	}else{
		this.eventSrc.style.color=this.ChageColor;	
	}

}

DestinationMsg.prototype.InputOnBlur = function() {
	if(this.eventSrc.value == this.Msg || this.eventSrc.value ==""){
		this.eventSrc.style.color=this.NormalColor;	
		this.eventSrc.value = this.Msg;
	}else{
		this.eventSrc.style.color=this.ChageColor;	
	}
	this.eventSrc.onfocus = new Function('DestinationAction(Destination.eventSrc)');
}



function DestinationAction(obj)
{
	Destination.init();
	obj.select();
	if( Destination.eventSrc == obj ){
		Destination.ShowDiv();

	}else{	
		Destination.eventSrc = obj;		
		obj.style.textTransform="lowercase";

		if(Destination.eventSrc.value == Destination.Msg||Destination.eventSrc.value==""){
			Destination.eventSrc.value="";		
			Destination.Top10();
		}
		obj.onkeyup = function(event){
			event=event?event:(window.event?window.event:null);
			var kc=event.keyCode;
				
			if(kc==0)return;
			
			if(!isUpDownKey(kc))
			{
				Destination.ActionKeyin();
			}
	
		}
		obj.onblur	= new Function('Destination.InputOnBlur()');
		if(obj.value!="" && Destination.searchKey=="")
			Destination.ActionKeyin();

	}

	return;
}



