var Default_pid="101010100"; //目的就是获取id
var Http_u="http://search.hao123.com/weather/bin/forecast.php";
var http_cookies_name="_weather_city4" //cookies名字
function qT_setCookiess(name,value){
	var Days = 5; //此 cookie 将被保存 5 小时
	var exp = new Date(); //new Date("December 31, 9998");
	exp.setTime(exp.getTime() + Days*60*60*1000);
	document.cookie = name + "="+ escape(value) +";path=/;expires="+ exp.toGMTString();
}
function qT_GetCookieVal(offset){
	var endstr = document.cookie.indexOf (";", offset);
	if (endstr == -1)
	endstr = document.cookie.length;
	return unescape(document.cookie.substring(offset, endstr));
}

function qT_GetCookie(name){
	var arg = name + "=";
	var alen = arg.length;
	var clen = document.cookie.length;
	var i = 0;
	while (i < clen){
		var j = i + alen;
		if (document.cookie.substring(i, j) == arg)
		return qT_GetCookieVal (j);
		i = document.cookie.indexOf(" ", i) + 1;
		if (i == 0) break;
	}
	return null;
}	
function qT_loadJS(file,id,charset){
	var html_doc = document.getElementsByTagName('head')[0];
	js = document.createElement('script');
	js.setAttribute('type', 'text/javascript');
	js.setAttribute("charset",charset||"utf-8");
	js.setAttribute('src', file);
	if(id){js.id=id}
	html_doc.appendChild(js);
	js.onreadystatechange = function () {if(js.readyState == 'complete' || js.readyState =="loaded"){qT_goif()}};
	js.onload = function (){qT_goif()};
	return false;
}
function qT_goif(){
	var id_a
	if(HaoForecast){
		id_a=HaoForecast.URL;
		id_a=id_a.replace(/(.*?)weather\/(.*?).shtml/gi,"$2");
		qT_setCookiess('qTcityids',id_a);			
		qTwtsrc(id_a);
	}else qTwtsrc(101010100)
}		
var qTcityid=qT_GetCookie(http_cookies_name);

if(isNaN(qTcityid) || qTcityid==null || (new String(qTcityid)).length<5 ){
	qT_loadJS("http://search.hao123.com/weather/bin/forecast.php","qT_Weather_id","gb2312");
}
else
	qTwtsrc(qTcityid)	
