	var url = window.location.href; 
	var start=url.indexOf("D_"); 
	if(start==-1){
		var start=url.indexOf("d_"); 
	}
	var end=url.indexOf(".htm");
	var first=start+parseInt(2);
	var str = url.substring(first,end);
	if(str=="http"){
		str="101010100";
	}
	function isIE(){ //ie? 
		if (window.navigator.userAgent.toLowerCase().indexOf("msie")>=1) 
			return true; 
		else 
			return false; 
	} 
	
	if(!isIE()){ //firefox innerText define
		HTMLElement.prototype.__defineGetter__(     "innerText", 
			function(){
				var anyString = "";
				var childS = this.childNodes;
				for(var i=0; i<childS.length; i++) {
					if(childS[i].nodeType==1)
						anyString += childS[i].tagName=="BR" ? '\n' : childS[i].innerText;
					else if(childS[i].nodeType==3)
						anyString += childS[i].nodeValue;
				}
				return anyString;
			}
		); 
		HTMLElement.prototype.__defineSetter__(     "innerText", 
			function(sText){ 
				this.textContent=sText; 
			}
		); 
	}
	var xmlhttp=null; 
	var ctemp="";
	function createXMLHTTPRequext(){ 
		if (window.XMLHttpRequest){
			xmlhttp = new XMLHttpRequest(); //Mozilla
	
		}
		else if (window.ActiveXObject) {
			xmlhttp =new ActiveXObject("Msxml2.XMLHTTP") ;
			if (! xmlhttp ){
				xmlhttp = new ActiveXObject('Microsoft.XMLHTTP'); 
			}
		}
	}
	
	function PostOrder(xmldoc) 
	{ 
		createXMLHTTPRequext();
		xmlhttp.open("GET", xmldoc,false); 
		xmlhttp.onreadystatechange= HandleStateChange;  
		xmlhttp.send(null); 
	}
	var jsonobj;
	
	function HandleStateChange() 
	{ 
	
		if (xmlhttp.readyState == 4){ 
			var jsontext =xmlhttp.responseText;
		   //var aman = eval("jsontext");
		   //alert(aman)
		   var func = new Function("return " + jsontext);
		   jsonobj = func();
	
		} 
	} 

	var xmldoc='/Weather/data/sk/'+str+'.html';
	var xmlhttp; 
	PostOrder(xmldoc);
	HandleStateChange();
	var temp=jsonobj.weatherinfo.temp;
	ctemp=temp;
	var height="";
	if(temp=="暂无实况"){
		height="70";
	}
	else{
		height=parseInt((50-temp)*0.42)+parseInt(20);
	}

    var sd=jsonobj.weatherinfo.SD;
    var rd=jsonobj.weatherinfo.isRadar;
    
    var ws=jsonobj.weatherinfo.WS;

    var wd=jsonobj.weatherinfo.WD;
    var sj=jsonobj.weatherinfo.time;
    var sm=jsonobj.weatherinfo.sm;
    var img="";
    var z="%";
    var ff=">>";
    if(wd=="东风"){
      img="e.gif";
    }
    else if(wd=="西风")
    {
     img="w.gif";
    }
    else if(wd=="南风")
    {
     img="s.gif";
    }
    else if(wd=="北风")
    {
     img="n.gif";
    }
    else if(wd=="东南风")
    {
     img="se.gif";
    }
    else if(wd=="东北风")
    {
     img="ne.gif";
    }
    else if(wd=="西南风")
    {
     img="sw.gif";
    }
    else if(wd=="西北风")
    {
     img="nw.gif";
    }
    else if(wd=="西北偏北风")
    {
     img="nnw.gif";
    }
    else if(wd=="西北偏西风")
    {
     img="wnw.gif";
    }
    else if(wd=="东北偏北风")
    {
     img="nne.gif";
    }
    else if(wd=="东北偏东风")
    {
     img="ene.gif";
    }
    else if(wd=="西南偏西风")
    {
     img="wsw.gif";
    }
    else if(wd=="西南偏南风")
    {
     img="ssw.gif";
    }
    else if(wd=="东南偏东风")
    {
     img="ese.gif";
    }
    else if(wd=="东南偏南风")
    {
     img="sse.gif";
    }
    else if(wd=="暂无实况")
    {
      img="bg_weatherwind.gif";
    } 
 
document.write('<head>');
document.write('<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" />');
document.write('<title>实况</title>');
document.write('<style>');
document.write('.mid_contenttopl p em.bg_wind{');
document.write('	background: url(/images/weather/i/'+img+') no-repeat 30px 5px;');	
document.write('}');
document.write('</style>');
document.write('<link href=\"/images/weather/global.css\" rel=\"stylesheet\" type=\"text/css\" media=\"all\" />');
document.write('<link href=\"/images/weather/citystyle.css\" rel=\"stylesheet\" type=\"text/css\" media=\"all\" />');
document.write('</head>');
document.write('<body>');
document.write('<div class=\"mid_contenttopl\">');
document.write('				<h3><strong><a href=\"#\">最新实况</a></strong></h3>');
document.write('				<p>');
document.write('					<span><strong><a href=\"#\">气温</a></strong></span>');
document.write('					<em class=\"bg_temp\">');
document.write('						<i class=\"no_list\"><br />50&nbsp;-<br />25&nbsp;-<br />0&nbsp;-<br />-25&nbsp;-<br />-50&nbsp;-</i>');
document.write('						<i class=\"img_list\" style=\"height: '+height+''+z+'"></i>');
if(temp=="暂无实况"){
document.write('						<i class=\"no_icon\"><a id="abc" style=\"fontsize:12px;\">'+temp+'℃</a><br /></i>');
}
else{
document.write('	                    <i class=\"no_icon\"><strong><a id="abc">'+temp+'℃</a></strong><br /></i>');
}
document.write('					</em>');
document.write('					<span><a href=\"#\">湿度：'+sd+'</a></span>');
document.write('				</p>');
document.write('				<p>');
document.write('					<span><strong><a href=\"#\">风向</a></strong></span>');
document.write('					<em class=\"bg_wind\">');
document.write('    <i class="no_icon2"><strong>'+sm+'<br/>&nbsp;m/s</strong></i></em>');
document.write('					<span><a href=\"#\">'+wd+' '+ws+'</a></span>');
document.write('				</p>');
document.write('			</div>');
document.write('</body>');
function c2f(c)
{
	var m=document.getElementById("back").innerText; 

	if(m=="转到华氏"){
		var f=parseInt(9/5*c)+parseInt(32);
		var z=f+"℉";
		document.getElementById("abc").innerText=z;
	 	document.getElementById("back").innerText="转到摄氏";
	}
	else if(m=="转到摄氏")
	{
		n=ctemp;
		var k=ctemp+"℃";
		document.getElementById("abc").innerText=k;
 		document.getElementById("back").innerText="转到华氏";
	}
	//alert(name);
}

