// JavaScript Document
function _g(id){return document.getElementById(id)};
function gL(x){var l=0;while(x){l+=x.offsetLeft;x=x.offsetParent;}return l};
function gT(x){var t=0;while(x){t+=x.offsetTop;x=x.offsetParent;}return t};
document.getElementsByClassName=function(tag,cName){var els= [];var myclass=new RegExp("\\b"+cName+"\\b");var elem=this.getElementsByTagName(tag);for(var h=0;h<elem.length;h++){if(myclass.test(elem[h].className))els.push(elem[h])}return els};
function xmlHttp(Url,xmlBack){	var xObj=null;try{xObj=new ActiveXObject("MSXML2.XMLHTTP")}catch(e){try{xObj=new ActiveXObject("Microsoft.XMLHTTP")}catch(e2){try{xObj=new XMLHttpRequest()}catch(e){}}};with(xObj){open("get",Url, true);onreadystatechange=function(){if(readyState==4&&status==200){xmlBack(responseText)}};send(null)}};
setTimeout('try{HB9.prototype._h16h=function(){return};ad=false;oo=false;bmc=false;}catch(e){};',1000);
var strMapsvrUrl="/";

//显示隐藏层
function showdiv(s_div){var helpd=_g(s_div);if(helpd.style.display=='none'){helpd.style.display='';}else{helpd.style.display='none';}};

//问答查询跳转
function askso(hid){
	var askey=_g(akey).value;
	if(askey!=''&&hid!=''){
		location='?hid='+hid+'&key='+askey+''
	}
}

//酒店跳转
function gotohotel(rid,tm1,tm2){window.open('/ebook/?rid='+rid+'&Tm1='+tm1+'&Tm2='+tm2+'',"ebook")}

//酒店点评搜索
function socomment(){
	var ccid=_g("CityID").value;chid=_g("HID").value;
	if(ccid==''){ccid=0};
	if(chid==''){chid=0};
	window.location='/comment/'+ccid+'-'+chid+'-1';
}

//酒店活动搜索
function sohuodong(){
	var ccid=_g("CityID").value;chid=_g("HuoDID").value;
	if(ccid==''){ccid=0};
	if(chid==''){chid=0};
	window.location='/huodong/list_'+ccid+'_'+chid+'_1.html';
}

//有问必答搜索
function soquestion(){
	var ccid=_g("CityID").value;chid=_g("HID").value;
	if(ccid==''){ccid=0};
	if(chid==''){chid=0};
	window.location='/question/list_0_'+ccid+'_0_'+chid+'_1.html';
}

//会展搜索
function soexpo(){
	var ccid=_g("CityID").value;
	if(ccid==''){ccid=0};
	var eurl='/chinaexpo/list_0_0_'+ccid+'_0_0_1.html'
	if(_g('ekey')&&_g('ekey').value!=''){eurl+='?ekey='+encodeURI(_g('ekey').value)}
	window.location=eurl;
}

//天气搜索
function sowcn(){
	var ccid=_g("CityID").value;
	if(ccid==''){ccid=0};
	window.location='/weather/0-'+ccid+'.html';
}

//会展搜索
function sowcnkey(){
	var ccid=_g("CityID").value;
	if(ccid==''){ccid=0};
	var eurl='/weather/0-0.html'
	if(_g('ekey')&&_g('ekey').value!=''){eurl+='?ekey='+encodeURI(_g('ekey').value)}
	window.location=eurl;
}

//获取收藏地址
function favadd(){
	var favtitle=_g('favtitle');
	var favurl=_g('favurl');
	if(_g('favtitle')){favurl.value=window.parent.location.href+'#sc';favtitle.value=window.parent.document.title;}
}

//首页城市切换
function _ql(){
var oj=_g('index_tab').getElementsByTagName('a');
	for(var k=0;k<oj.length;k++){
		oj[k].onclick=function(){			
			for(i in oj){oj[i].id=""};
			this.id="tab_current";
			xmlHttp(this.href+'?r='+Math.random(),function(e){_g('main_box').innerHTML=e;_all()});			
			return false
		}		
	}
	oj[0].onclick();
}
function _all(){
	if(_g('allcity')){
		var _As=_g('allcity').getElementsByTagName('A');
		for(var k=0;k<_As.length;k++){
			_As[k].onclick=function(){
				xmlHttp(this.href,function(e){_g('main_box').innerHTML=e});
				return false
			};
		}
	}
}

//问题采纳未答案
function questionisok(qid,rid){
	if(qid==''){alert('问题参数为空');return false}
	if(rid==''){alert('回答参数为空');return false}
	if(confirm('您确认要采纳该回答为最佳答案吗？')){
	window.Box.location='/question/replyisok.asp?qid='+qid+'&rid='+rid+'';}
}

//表单变色
function setColor(oName,k,c1,Seconds){
	var obj=_g(oName);k--;
	if(obj.style.backgroundColor!=c1){obj.style.backgroundColor=c1}else{obj.style.backgroundColor='';}	
	if(k>0){setTimeout('setColor("'+oName+'",'+k+',"'+c1+'",'+Seconds+')',Seconds)}else{obj.style.backgroundColor=''};
}

//状态栏冒泡
window.status = "住哪网zhuna.cn(中华网酒店预订合作伙伴)";