function send_request(url,method) {
	http_request = false;
	if(window.XMLHttpRequest) {
		http_request = new XMLHttpRequest();
		if (http_request.overrideMimeType) {
			http_request.overrideMimeType('text/xml');
		}
	}
	else if (window.ActiveXObject) {
		try {
			http_request = new ActiveXObject("Msxml2.XMLHTTP");
		} catch (e) {
			try {
				http_request = new ActiveXObject("Microsoft.XMLHTTP");
			} catch (e) {}
		}
	}
	if (!http_request) {
		window.alert("不能创建XMLHttpRequest对象实例.");
		return false;
	}
	switch(method){
		case 1: http_request.onreadystatechange = processRequest1;break;
		case 2: http_request.onreadystatechange = processRequest2;break;
		case 3: http_request.onreadystatechange = processRequest3;break;
		case 4: http_request.onreadystatechange = processRequest4;break;
		case 5: http_request.onreadystatechange = processRequest5;break;
		case 6: http_request.onreadystatechange = processRequest6;break;
		case 7: http_request.onreadystatechange = processRequest7;break;
		case 8: http_request.onreadystatechange = processRequest8;break;
		case 9: http_request.onreadystatechange = processRequest9;break;
		case 10: http_request.onreadystatechange = processRequest10;break;
		case 11: http_request.onreadystatechange = processRequest11;break;
		case 12: http_request.onreadystatechange = processRequest12;break;
	}
	http_request.open("GET", url, true);
	http_request.send(null);
}

function send_request_country(url,method,valueSelect,idName) {
	http_request_country = false;
	if(window.XMLHttpRequest) {
		http_request_country = new XMLHttpRequest();
		if (http_request_country.overrideMimeType) {
			http_request_country.overrideMimeType('text/xml');
		}
	}
	else if (window.ActiveXObject) {
		try {
			http_request_country = new ActiveXObject("Msxml2.XMLHTTP");
		} catch (e) {
			try {
				http_request_country = new ActiveXObject("Microsoft.XMLHTTP");
			} catch (e) {}
		}
	}
	if (!http_request_country) {
		window.alert("不能创建XMLHttpRequest对象实例.");
		return false;
	}
	http_request_country.onreadystatechange = function () {
        if (http_request_country.readyState == 4) {
            if (http_request_country.status == 200) {
			addOptionGroup(idName,http_request_country.responseText,valueSelect);
            } else {
                //alert("您所请求的页面有异常。");
            }
        }else {
		}
    };
	http_request_country.open("GET", url, true);
	http_request_country.send(null);
}


 
function send_request_province(url,method,valueSelect,idName) {
	http_request_province = false;
	if(window.XMLHttpRequest) {
		http_request_province = new XMLHttpRequest();
		if (http_request_province.overrideMimeType) {
			http_request_province.overrideMimeType('text/xml');
		}
	}
	else if (window.ActiveXObject) {
		try {
			http_request_province = new ActiveXObject("Msxml2.XMLHTTP");
		} catch (e) {
			try {
				http_request_province = new ActiveXObject("Microsoft.XMLHTTP");
			} catch (e) {}
		}
	}
	if (!http_request_province) {
		window.alert("不能创建XMLHttpRequest对象实例.");
		return false;
	}
	http_request_province.onreadystatechange = function () {
        if (http_request_province.readyState == 4) {
            if (http_request_province.status == 200) {
			addOptionGroup(idName,http_request_province.responseText,valueSelect);
            } else {
                //alert("您所请求的页面有异常。");
            }
        }
    };
	http_request_province.open("GET", url, true);
	http_request_province.send(null);
}


function send_request_city(url,method,valueSelect,idName) {
	http_request_city = false;
	if(window.XMLHttpRequest) {
		http_request_city = new XMLHttpRequest();
		if (http_request_city.overrideMimeType) {
			http_request_city.overrideMimeType('text/xml');
		}
	}
	else if (window.ActiveXObject) {
		try {
			http_request_city = new ActiveXObject("Msxml2.XMLHTTP");
		} catch (e) {
			try {
				http_request_city = new ActiveXObject("Microsoft.XMLHTTP");
			} catch (e) {}
		}
	}
	if (!http_request_city) {
		window.alert("不能创建XMLHttpRequest对象实例.");
		return false;
	}
	http_request_city.onreadystatechange = function () {
        if (http_request_city.readyState == 4) {
            if (http_request_city.status == 200) {
			addOptionGroup(idName,http_request_city.responseText,valueSelect);
            } else {
                //alert("您所请求的页面有异常。");
            }
        }
	};
	http_request_city.open("GET", url, true);
	http_request_city.send(null);
}



function send_request_scenic(url,method,valueSelect,idName) {
	http_request_scenic = false;
	if(window.XMLHttpRequest) {
		http_request_scenic = new XMLHttpRequest();
		if (http_request_scenic.overrideMimeType) {
			http_request_scenic.overrideMimeType('text/xml');
		}
	}
	else if (window.ActiveXObject) {
		try {
			http_request_scenic = new ActiveXObject("Msxml2.XMLHTTP");
		} catch (e) {
			try {
				http_request_scenic = new ActiveXObject("Microsoft.XMLHTTP");
			} catch (e) {}
		}
  }
  if (!http_request_scenic) {
   window.alert("不能创建XMLHttpRequest对象实例.");
   return false;
  }
  http_request_scenic.onreadystatechange = function () {
        if (http_request_scenic.readyState == 4) {
            if (http_request_scenic.status == 200) {
			addOptionGroup(idName,http_request_scenic.responseText,valueSelect);
            } else {
                //alert("您所请求的页面有异常。");
            }
        }
    };
  http_request_scenic.open("GET", url, true);
  http_request_scenic.send(null);
 }

function send_request_area(url,method,valueSelect,idName) {
	http_request_area = false;
	if(window.XMLHttpRequest) {
		http_request_area = new XMLHttpRequest();
		if (http_request_area.overrideMimeType) {
			http_request_area.overrideMimeType('text/xml');
		}
	}
	else if (window.ActiveXObject) {
		try {
			http_request_area = new ActiveXObject("Msxml2.XMLHTTP");
		} catch (e) {
			try {
				http_request_area = new ActiveXObject("Microsoft.XMLHTTP");
			} catch (e) {}
		}
  }
  if (!http_request_area) {
   window.alert("不能创建XMLHttpRequest对象实例.");
   return false;
  }
  http_request_area.onreadystatechange = function () {
        if (http_request_area.readyState == 4) {
            if (http_request_area.status == 200) {
			addOptionGroup(idName,http_request_area.responseText,valueSelect);
            } else {
                //alert("您所请求的页面有异常。");
            }
        }
    };
  http_request_area.open("GET", url, true);
  http_request_area.send(null);
 }

 
 

function send_request_shoptype(url,method,valueSelect,idName) {
	http_request_shoptype = false;
	//document.writeln(url);
	if(window.XMLHttpRequest) {
		http_request_shoptype = new XMLHttpRequest();
		if (http_request_shoptype.overrideMimeType) {
			http_request_shoptype.overrideMimeType('text/xml');
		}
	}
	else if (window.ActiveXObject) {
		try {
			http_request_shoptype = new ActiveXObject("Msxml2.XMLHTTP");
		} catch (e) {
			try {
				http_request_shoptype = new ActiveXObject("Microsoft.XMLHTTP");
			} catch (e) {}
		}
  }
  if (!http_request_shoptype) {
   window.alert("不能创建XMLHttpRequest对象实例.");
   return false;
  }
  http_request_shoptype.onreadystatechange = function () {
        if (http_request_shoptype.readyState == 4) {
            if (http_request_shoptype.status == 200) {
			addOptionGroup(idName,http_request_shoptype.responseText,valueSelect);
            } else {
                //alert("您所请求的页面有异常。");
            }
        }
    };
  http_request_shoptype.open("GET", url, true);
  http_request_shoptype.send(null);
 }




function send_request_vote(url,sort,id,value,state) {
	http_request_vote = false;
	if(window.XMLHttpRequest) {
		http_request_vote = new XMLHttpRequest();
		if (http_request_vote.overrideMimeType) {
			http_request_vote.overrideMimeType('text/xml');
		}
	}
	else if (window.ActiveXObject) {
		try {
			http_request_vote = new ActiveXObject("Msxml2.XMLHTTP");
		} catch (e) {
			try {
				http_request_vote = new ActiveXObject("Microsoft.XMLHTTP");
			} catch (e) {}
		}
  }
  if (!http_request_vote) {
   window.alert("不能创建XMLHttpRequest对象实例.");
   return false;
  }
  http_request_vote.onreadystatechange = function () {
        if (http_request_vote.readyState == 4) {
            if (http_request_vote.status == 200) {
				htmlValue=http_request_vote.responseText;
				if(htmlValue==1){
					window.location.href='/member/login.php?goUrl='+document.location.href;
				}else{
					document.getElementById("travel_vote").innerHTML=http_request_vote.responseText;
					if(id>0){
						if(state==1){
							if(confirm("操作成功，现在去说说我的印象？")){
								if(sort==1){
									goToUrl='/comment/C'+id+'P0#comment';
								}else if(sort==2){
									goToUrl='/comment/S'+id+'P0#comment';
								}else{
									goToUrl='#comment';
								}
								window.location.href=goToUrl;
							}
						}else if(state==2){
							if(confirm("操作成功，现在发布旅游计划？")){
								if(sort==1){
									goToUrl='/line.php?act=add&to_city='+id;
								}else if(sort==2){
									goToUrl='/line.php?act=add&to_scenic='+id;
								}else{
									goToUrl='/line.php?act=add';
								}
								window.location.href=goToUrl;
							}
						}
					}
				}
            } else {
                //alert("您所请求的页面有异常。");
            }
        }
    };
  http_request_vote.open("GET", url, true);
  http_request_vote.send(null);
}



function send_request_msg() {
	var url='/tool/travel/get_msg.php?randnum=' + Math.random();
	//alert(url);
	http_request_msg = false;
	if(window.XMLHttpRequest) {
		http_request_msg = new XMLHttpRequest();
		if (http_request_msg.overrideMimeType) {
			http_request_msg.overrideMimeType('text/xml');
		}
	}
	else if (window.ActiveXObject) {
		try {
			http_request_msg = new ActiveXObject("Msxml2.XMLHTTP");
		} catch (e) {
			try {
				http_request_msg = new ActiveXObject("Microsoft.XMLHTTP");
			} catch (e) {}
		}
  }
  if (!http_request_msg) {
   window.alert("不能创建XMLHttpRequest对象实例.");
   return false;
  }
  http_request_msg.onreadystatechange = function () {
        if (http_request_msg.readyState == 4) {
            if (http_request_msg.status == 200) {
				htmlValue=http_request_msg.responseText;
				if(htmlValue=='0'){
				}else{			
					document.getElementById("msgNewInfo").innerHTML=htmlValue;
					setInterval(blinkNewMsg, 1000);
					//return false;
					document.getElementById("msgNewInfo").innerHTML='<a href="/mycp.php?f=msg"><img src="/img/newMsg.gif" align="absbottom" /></a>';		
				}
            } else {
                //alert("您所请求的页面有异常。");
            }
        }
    };
  http_request_msg.open("GET", url, true);
  http_request_msg.send(null);
}

var g_blinkswitch = 0;
var g_blinktitle = document.title;
function blinkNewMsg(){
	//alert(g_blinktitle);
	document.title = g_blinkswitch % 2==0 ? "【　　　】 - " + g_blinktitle : "【新消息】 - " + g_blinktitle;
	g_blinkswitch++;
}




function processRequest1() {
	if (http_request.readyState == 4) {
		if (http_request.status == 200) {
			addOptionGroup("nav_country",http_request.responseText);
		} else {
			//alert("您所请求的页面有异常。");
		}
	}
}
 
function processRequest2() {
	if (http_request.readyState == 4) {
		if (http_request.status == 200) {
			addOptionGroup("nav_province",http_request.responseText);
		} else {
			//alert("您所请求的页面有异常。");
		}
	}
}

function processRequest3() {
	if (http_request.readyState == 4) {
		if (http_request.status == 200) {
			addOptionGroup("nav_city",http_request.responseText);
		} else {
			//alert("您所请求的页面有异常。");
		}
	}
}

function processRequest4() {
	if (http_request.readyState == 4) {
		if (http_request.status == 200) {
			addOptionGroup("province_id",http_request.responseText);
		} else {
			//alert("您所请求的页面有异常。");
		}
	}
}
function processRequest5() {
	if (http_request.readyState == 4) {
		if (http_request.status == 200) {
			addOptionGroup("city_id",http_request.responseText);
		} else {
			//alert("您所请求的页面有异常。");
		}
	}
}

function processRequest6() {
	if (http_request.readyState == 4) {
		if (http_request.status == 200) {
			addOptionGroup("scenic_id",http_request.responseText);
		} else {
			//alert("您所请求的页面有异常。");
		}
	}
}

function processRequest7() {
	if (http_request.readyState == 4) {
		if (http_request.status == 200) {
			areaValue=http_request.responseText;
			areaValueUse=areaValue.split(",");
			strLen=areaValueUse.length/4;
			if(areaValue != ""){
				areaContent='';
				strSeparato='';
				for (i=0; i<strLen; i++)
				{
					var j=i*4+1;
					if(j==1){
						strSeparator='';
					}else{
						strSeparator='、';
					}
					areaContent+=strSeparator+areaValueUse[j];
				}
			}else{
				areaContent='该城市还没有添加任何城区';
			}
			document.getElementById("area_id").innerHTML=areaContent;
		} else {
			//alert("您所请求的页面有异常。");
		}
	}
}


function processRequest8() {
	if (http_request.readyState == 4) {
		if (http_request.status == 200) {
			areaValue=http_request.responseText;
			if(areaValue !=''){
				addOptionGroup("area_id",areaValue);
			}else{
				var objSelect = document.getElementsByTagName("SELECT");
				objSelect['area_id'].options.add(new Option('无城区',0));
			}
		} else {
			//alert("您所请求的页面有异常。");
		}
	}
}

function processRequest9() {
	if (http_request.readyState == 4) {
		if (http_request.status == 200) {
			typeValue=http_request.responseText;
			if(typeValue !=''){
				addOptionGroup("type_id",typeValue);
			}else{
				var e =eval(document.getElementById('type_id'));
				optionsClear(e);
			}
		} else {
			//alert("您所请求的页面有异常。");
		}
	}
}


function processRequest10() {
	if (http_request.readyState == 4) {
		if (http_request.status == 200) {
			addOptionGroup("to_province_id",http_request.responseText);
		} else {
			//alert("您所请求的页面有异常。");
		}
	}
}
function processRequest11() {
	if (http_request.readyState == 4) {
		if (http_request.status == 200) {
			addOptionGroup("to_city_id",http_request.responseText);
		} else {
			//alert("您所请求的页面有异常。");
		}
	}
}

function processRequest12() {
	if (http_request.readyState == 4) {
		if (http_request.status == 200) {
			addOptionGroup("to_scenic_id",http_request.responseText);
		} else {
			//alert("您所请求的页面有异常。");
		}
	}
}



function loadCountry(country_id,province_id,city_id,scenic_id,type) {
	//默认代表景点
	//type=2代表城区平铺
	//type=3代表城区列表
	
	send_request_country("/get_city.php?act=country&randnum="+Math.random(),1,country_id,'country_id');
	if(country_id>0){
		send_request_province("/get_city.php?act=province&country_id="+ country_id+"&randnum="+Math.random(),2,province_id,'province_id');
	//alert("/get_city.php?act=province&country_id="+ country_id+"&randnum="+Math.random());
	}
	if(province_id>0){
		send_request_city("/get_city.php?act=city&province_id="+province_id,3,city_id,'city_id');
	}
	if(city_id>0){
		if(type==-1){
		}else if(type==2){
			send_request("/get_city.php?act=area&city_id="+city_id,7);
		}else if(type==3){
			send_request("/get_city.php?act=area&city_id="+city_id,8);
		}else if(type==4){//表示编辑时定位
			send_request_area("/get_city.php?act=area&city_id="+city_id,0,scenic_id,'area_id');
		}else{
			send_request_scenic("/get_city.php?act=scenic&city_id="+city_id,4,scenic_id,'scenic_id');
		}
	}
}



function loadNavCountry(country_id,province_id,city_id) {
	//加载导航位置列表框
	
	send_request_country("/get_city.php?act=country",1,country_id,'nav_country');
	if(country_id>0){
		send_request_province("/get_city.php?act=province&country_id="+ country_id,2,province_id,'nav_province');
	}
	if(province_id>0){
		send_request_city("/get_city.php?act=city&province_id="+province_id,3,city_id,'nav_city');
	}
}

function loadProvince(countryName,provinceName,cityName,scenicName,type) {
	//type=2代表城区平铺
	var e0 =eval(document.getElementById(countryName));
	if(cityName!=''){
		var e1 =eval(document.getElementById(cityName));
		optionsClear(e1);
	}
	if(scenicName!=''){
		var e2 =eval(document.getElementById(scenicName));
		if(type==2){
			e2.innerHTML='没有选择相应城市';
		}else{
			optionsClear(e2);
		}
	}
	var methodId;
	if(countryName=='nav_country'){
		methodId=2;
	}else if(countryName=='country_id'){
		methodId=4;
	}else if(countryName=='to_country_id'){
		methodId=10;
	}
	send_request("/get_city.php?act=province&country_id="+e0.value,methodId);
}

function loadCity(provinceName,cityName,scenicName,type) {
	//type=2代表城区平铺
	var e0 =eval(document.getElementById(provinceName));
	var e1 =eval(document.getElementById(cityName));
	optionsClear(e1);
	if(scenicName!=''){
		var e2 =eval(document.getElementById(scenicName));
		if(type==2){
			e2.innerHTML='没有选择相应城市';
		}else{
			optionsClear(e2);
		}
	}
	var methodId;
	if(provinceName=='nav_province'){
		methodId=3;

		//判断是否有下属城市，直辖市直接跳转
		goToProvince=e0.value;
		if(goToProvince==1){
			location.href='/travel/C14_0';
		}else if(goToProvince==2){
			location.href='/travel/C87_0';
		}else if(goToProvince==3){
			location.href='/travel/C16_0';
		}else if(goToProvince==4){
			location.href='/travel/C357_0';
		}else if(goToProvince==5){
			location.href='/travel/C355_0';
		}
	}else if(provinceName=='province_id'){
		methodId=5;
	}else if(provinceName=='to_province_id'){
		methodId=11;
	}
	send_request("/get_city.php?act=city&province_id="+e0.value,methodId);
}

function loadScenic(cityName,scenicName) {
	send_request("/get_city.php?act=scenic&city_id="+document.getElementById("city_id").value,6);
}

function loadCityArea(type) {
	//type=2代表城区平铺
	//type=3代表城区列表
	if(type==2){
		send_request("/get_city.php?act=area&city_id="+document.getElementById("city_id").value,7);
	}else if(type==3){
		var e =eval(document.getElementById('area_id'));
		optionsClear(e);
		send_request("/get_city.php?act=area&city_id="+document.getElementById("city_id").value,8);
	}
}

function loadShopType(typeId) {
	if(typeId>0){
	send_request_shoptype("/get_city.php?act=shopType&sort_id="+document.getElementById("sort_id").value,9,typeId,'type_id');
	}else{
	send_request("/get_city.php?act=shopType&sort_id="+document.getElementById("sort_id").value,9);
	}
}


function goToCity(){
	cityId=document.getElementById("nav_city").value;
	if(cityId==0){
		alert('请选择具体城市！');
		return false;
	}else{
		location.href='/travel/C'+cityId+'_0';
	}
}

function goToScenic(type){
	location.href='/travel/S'+document.getElementById("scenic_id").value+'_'+type;
}

function getInfoList(state,sort,star,type){
	if(type==-1){
		location.href='/travel/C'+document.getElementById("city_id").value+'_0';
	}else{
	location.href='/'+type+'/list/S'+state+'T'+sort+'C'+document.getElementById("city_id").value+'S'+star+'A0L0D0P0';
	}
}


function loadTravelVote(state,sort,id,value){
	//state=0代表无操作，1代表去过，2代表想去
	//sort=1代表城市，sort=2代表景点
	send_request_vote('/tool/travel/get_vote.php?id='+id+'&sort='+sort+'&value='+value+'&state='+state);
}

/*
function userTravelVote(state,sort,id,value,type){
	if(sort==1){
		url="/comment/S"+state+"C"+id+"V"+value;
	}else if(sort==2){
		url="/comment/S"+state+"S"+id+"V"+value;
	}
	if(state==0 || (state==1 &&  type !='form')){
		send_request(url,9);
	}else{
		send_request_vote('/tool/travel/get_vote.php?id='+id+'&sort='+sort+'&value='+value+'&state='+state);
		document.getElementById("commentDiv").innerHTML=" ";
		document.getElementById("commentDiv").style.display="none";
		document.getElementById("bodyDiv").style.display="none"; 
		window.onscroll='';
	}
}
*/

function userTravelVote(state,sort,id,value,type){
	send_request_vote('/tool/travel/get_vote.php?id='+id+'&sort='+sort+'&value='+value+'&state='+state,sort,id,value,state);
}


function userNewMsg(username){
	if(username!=''){
		send_request_msg();
		window.setInterval(send_request_msg, 300000);
	}
}


function optionsClear(e){
	e.options.length = 1;
}

function addOptionGroup(selectId,optGroupString,valueSelect){
	
	var optGroup = optGroupString.split(",");
	var strLen=optGroup.length;
	var strArrLen=optGroup.length/4;

	var objSelect = document.getElementsByTagName("SELECT");
	var objSelectNow = objSelect[selectId];
	objSelectNow.length = 1;
	if(optGroupString != ""){
		for (i=0; i<strArrLen; i++)
		{
			var j=i*4;
			if(optGroup[j]==valueSelect){
				objSelectNow.options.add(new Option(optGroup[j+1], optGroup[j],true,true));
			}else{
				objSelectNow.options.add(new Option(optGroup[j+1], optGroup[j]));
			}
		}
	}else{
	}
}


function checkAddAnswer(type){
	String.prototype.trim = function()
	{
		return this.replace(/(^\s*)|(\s*$)/g, "");
	}
	if((document.form1.top_id.value)==0)
	{
		alert("提交方式出错!");
		return false;
	}
	content=document.form1.content.value.trim();
	if(type=='ask'){
		typeTxt='回答';
	}else if(type=='bbs'){
		typeTxt='回复';
	}else{
		typeTxt='评论';
	}
	if(content.length<1){
		alert(typeTxt+'内容不能为空');
		document.form1.content.focus(); 
		return false;
	}
	if(content.length<20 || content.length>5000){
		alert('对不起，'+typeTxt+'内容需在20-5000字之间!');
		document.form1.content.focus();
		return false;
	}
	document.form1.content.value=content;

}


function checkShopComment(){
	String.prototype.trim = function()
	{
		return this.replace(/(^\s*)|(\s*$)/g, "");
	}
	if(document.form1.top_id.value==0 || document.form1.sort.value==0 || document.form1.city_id.value==0)
	{
		alert("提交方式出错!");
		return false;
	}
	content=document.form1.content.value.trim();
	if(content.length<1){
		alert('点评内容不能为空');
		document.form1.content.focus(); 
		return false;
	}
	if(content.length<50 || content.length>5000){
		alert('对不起，内容需在50-5000字之间。\r\n你只能对亲身体验或者希望体验的对象进行点评。谢谢！');
		document.form1.content.focus(); 
		return false;
	}
	document.form1.content.value=content;

}


function checkSearch(formName){
	String.prototype.trim = function()
	{
		return this.replace(/(^\s*)|(\s*$)/g, "");
	}
	//alert(formName);
	if(formName=='form1'){
		keyword=document.form1.keyword.value.trim();
		if(keyword.length<2 || keyword=='请输入旅游关键词：如 北京 巴黎 三亚 丽江'){
			alert('关键词不能少于2个字符');
			document.form1.keyword.focus(); 
			return false;
		}
		document.form1.keyword.value=keyword;
	}else if(formName=='form_nav'){
		keyword=document.form_nav.keyword.value.trim();
		if(keyword.length<2 || keyword=='请输入旅游关键词：如 北京 巴黎 三亚 丽江'){
			alert('关键词不能少于2个字符');
			document.form_nav.keyword.focus();
			return false;
		}
		document.form_nav.keyword.value=keyword;
	}

}

function goToUrl(url,obj){
	//window.location.href=url;
	//alert(url+'ss');
	obj.target="_self";
	obj.href = url;
	obj.click();
}

function loginGoToUrl(username,url,obj){//判断是否登录
	//window.location.href=url;
	//alert(url+'ss');
	if(username==''){
		if(confirm("你还没有登录，登录后继续操作？")){
			obj.target="_self";
			obj.href = '/member/login.php';
			obj.dbclick();
		}
	}else{
		obj.target="_self";
		obj.href = url;
		obj.click();
	}
}

function btGoToUrl(url,obj){
	window.location.href=url;
}

function goToComment(username){
	if(username==''){
		alert('你还没有登录，请登录后再回复！');
	}
}

function goRewardExchange(username,offid,obj){
	if(username==''){
		alert('你还没有登录，请登录后再兑换奖品！');
	}else if(offid>0){
		if(confirm("确定兑换该奖品吗？\r\n兑换后将扣除相应分值")){
			obj.target="_self";
			obj.href = '/reward.php?act=exchange&offid='+offid;
			obj.dbclick();
		}
	}else if(offid==0){
			obj.target="_self";
			obj.href = '/reward.php?act=exchangeCash';
			obj.click();
	}
}


function delContent(title,url,obj){
	if(confirm("确定删除《"+title+"》吗？\r\n删除后将扣除相应分值")){
		obj.target="_self";
		obj.href = url;
		obj.dbclick();
	}
}

function hiddenDiv(){
	document.getElementById("commentDiv").innerHTML=" ";
	document.getElementById("commentDiv").style.display="none";
	document.getElementById("bodyDiv").style.display="none"; 
	window.onscroll='';
}


function scrollDiv(){
	document.getElementById("bodyDiv").style.display='block';
	document.getElementById("bodyDiv").style.top=document.body.scrollTop; 
	document.getElementById("bodyDiv").style.left=document.body.scrollLeft;  

	document.getElementById("commentDiv").style.display='block';
 	document.getElementById("commentDiv").style.top=(document.documentElement.scrollTop+(document.documentElement.clientHeight-document.getElementById("commentDiv").offsetHeight)/2)+"px";
 	document.getElementById("commentDiv").style.left=(document.documentElement.scrollLeft+(document.documentElement.clientWidth-document.getElementById("commentDiv").offsetWidth)/2)+"px";
}


function doPrint() { 
bdhtml=window.document.body.innerHTML; 
sprnstr="<!--startprint-->"; 
eprnstr="<!--endprint-->"; 
prnhtml=bdhtml.substr(bdhtml.indexOf(sprnstr)+17); 
prnhtml=prnhtml.substring(0,prnhtml.indexOf(eprnstr)); 
window.document.body.innerHTML='<div class="container_center">'+prnhtml+'</div>'; 
window.print(); 
}

if(window.screen.width==1280){   
    document.write("<link href='/css/city/default1280.css' rel='stylesheet' type='text/css'>");   
}