function _A(B,A,C){this.$request=null;this.$deal=null;this.$fail=null;this.$useUnique=false;if(window.XMLHttpRequest){this.$request=new XMLHttpRequest()}else{if(typeof ActiveXObject!="undefined"){this.$request=new ActiveXObject("Microsoft.XMLHTTP")}else{return false}}this.$isSending=false;this.$url=(typeof B=="undefined")?"":B;this.$method=(typeof A=="undefined")?"POST":A;this.$params=null;this.$timeout=40000;this.ontimeout=function(){msg("time out")};this.$needhandle=(typeof C=="undefined")?true:C}_A.prototype.parse=function(B,A){this.$deal=B;this.$fail=A;this.send()};_A.prototype.useUnique=function(A){if(typeof A=="undefined"||A){this.$useUnique=true}else{this.$useUnique=false}};_A.prototype.getParams=function(){var C;var B=true;var A=new Array();for(C in this){if(typeof this[C]!="function"&&C.charAt(0)!="$"){A.push(C+"="+encodeURIComponent(this[C]))}}this.$params=A.join("&");if(this.$useUnique){this.$params+="&UNKEY="+new Date().getTime()}};_A.prototype.clear=function(){var A;for(A in this){if(typeof this[A]!="function"&&A.charAt(0)!="$"){delete this[A]}}this.$params=null};_A.prototype.send=function(){this.getParams();if(this.$method=="GET"){this.$request.open(this.$method,this.$url+"?"+this.$params,this.$needhandle)}else{this.$request.open(this.$method,this.$url,this.$needhandle)}var C=this.$request,D=this.callSuccess,F=this.callFail,G=this.$deal,B=this.$fail;var A=this;timeout=window.setTimeout(this.timeout,this.$timeout,this);if(this.$needhandle){var E=this.handle;this.$request.onreadystatechange=function(){E(C,D,F,G,B,timeout,A)}}this.$request.setRequestHeader("Content-Type","application/x-www-form-urlencoded");if(this.$method=="GET"){this.$request.send(null);this.handle(C,D,F,G,B,timeout)}else{this.$request.send(this.$params)}this.$isSending=true};_A.prototype.$=function(A){if(!arguments.length){return this.$request.responseText}switch(A){case"text":return this.$request.responseText;case"xml":return this.$request.responseXML;case"body":return this.$request.responseBody;case"stream":return this.$request.responseStream;case"allHeader":return this.$request.getAllResponseHeader();case"error":return this.$error;case"errorCode":return this.$errorCode;case"header":if(arguments.length==2){return this.$request.getResponseHeader(arguments[1])}return this.$request.getResponseHeader();default:return this.$request.getResponseHeader(A)}};_A.prototype.handle=function(E,C,F,H,D,B,A){try{if(E.readyState==4){A.$isSending=false;window.clearTimeout(B);if(E.status==200||E.status==304||E.status==0){C(H)}else{A.$errorCode=E.status;A.$error=E.statusText;F(D);throw new HandleException(E.status,E.statusText)}}}catch(G){}};_A.prototype.callSuccess=function(_deal){try{if(typeof _deal=="function"){_deal.call()}else{if(_deal.charAt(_deal.length-1)!=")"){eval(_deal+"()")}else{eval(_deal)}}}catch(e){throw new HandleException("Call Sucess Method Error")}};_A.prototype.callFail=function(_fail){try{if(typeof _fail=="function"){_fail.call()}else{if(_fail.charAt(_deal.length-1)!=")"){eval(_fail+"()")}else{eval(_fail)}}}catch(e){throw new HandleException("Call Fail Method Error")}};_A.prototype.timeout=function(A){if(!A.$isSending){return false}try{A.$errorCode=-1;A.$error="Time Out";A.cancel(A);A.ontimeout();throw new HandleException(-1,"Time Out")}catch(B){}};_A.prototype.cancel=function(A){try{if(A.$isSending){A.$request.abort();A.$isSending=false}}catch(B){}};function HandleException(B,A){this.code=B;this.name=A}HandleException.prototype=new Error("Ajax Exception");HandleException.prototype.constructor=HandleException;var RegisterEvent=function(F,D,C,B){var E=true;if(typeof B!="undefined"){E=(B!=false)}if(document.addEventListener){var A=D.indexOf("on")==0?D.replace("on",""):D;try{F.addEventListener(A,C,E);return true}catch(D){return false}}else{if(document.attachEvent){var A=D.indexOf("on")==0?D:"on"+D;try{F.attachEvent(A,C);return true}catch(D){return false}}else{return false}}};var RemoveEvent=function(F,D,C,B){var E=true;if(typeof B!="undefined"){E=(B!=false)}if(document.addEventListener){var A=D.indexOf("on")==0?D.replace("on",""):D;try{F.removeEventListener(A,C,E);return true}catch(D){return false}}else{if(document.attachEvent){var A=D.indexOf("on")!=0?D.replace("on",""):D;try{F.detachEvent(A,C);return true}catch(D){return false}}else{return false}}};try{Element.prototype.registerEvent=function(C,B,A){RegisterEvent(this,C,B,A)};Element.prototype.removeEvent=function(C,B,A){RemoveEvent(this,C,B,A)}}catch(e){}var EventStopProp=function(A){if(document.addEventListener){try{A.stopPropagation();A.preventDefault()}catch(B){return false}}else{if(document.attachEvent){try{A.cancelBubble=true;A.returnValue=false}catch(B){return false}}else{return false}}};function $E(A,B){if(A){this.tagName=A;this.$node=document.createElement(this.tagName);this.firstChild=null;this.lastChild=null;this.previousSibling=null;this.nextSibling=null;this.childNodes=null;this.parentNode=null;$E.set(this.$node,B)}}$E.set=function(B,A){if(A){for(var D in A){if(typeof B[D]=="string"){B[D]=A[D]}else{for(var C in A[D]){B[D][C]=A[D][C]}}}}};$E.prototype={getNode:function(A){if(typeof A!="object"){return false}if(A.$node){return A.$node}return A},reset:function(A){if(typeof A=="undefined"){var A=this.$settings}else{this.$settings=A}$E.set(this.$node,A)},insertTo:function(A){if(A){try{var C=this.getNode(A);C.appendChild(this.$node);this.refresh()}catch(B){}}},remove:function(){try{this.$node.parentNode.removeChild(this.$node);this.refresh()}catch(A){}},show:function(B){try{this.$node.style.display=B?B:"block"}catch(A){}},appendBefore:function(A,E){try{var D=this.getNode(E),C=this.getNode(A);C.insertBefore(this.$node,D);this.refresh()}catch(B){}},replace:function(A){try{var C=this.getNode(A);this.$node.parentNode.replaceChild(C,this.$node);this.$node=C;this.refresh()}catch(B){}},hide:function(){try{this.$node.style.display="none"}catch(A){}},appendChild:function(A){try{if(typeof A=="string"){var C=document.createTextNode(A)}else{var C=this.getNode(A)}this.$node.appendChild(C);this.refresh()}catch(B){}},removeChild:function(A){try{var C=this.getNode(A);this.$node.removeChild(C);this.refresh()}catch(B){}},insertBefore:function(A,E){try{var D=this.getNode(A);var C=this.getNode(E);this.$node.insertBefore(D,C);this.refresh()}catch(B){}},replaceChild:function(A,E){try{var D=this.getNode(A);var C=this.getNode(E);this.$node.insertBefore(D,C);this.refresh()}catch(B){}},refresh:function(){this.firstChild=this.$node.firstChild;this.lastChild=this.$node.lastChild;this.previousSibling=this.$node.previousSibling;this.nextSibling=this.$node.nextSibling;this.childNodes=this.$node.childNodes;this.parentNode=this.$node.parentNode},addEventListener:function(C,B,A){RegisterEvent(this.$node,C,B,A)},removeEventListener:function(C,B,A){RemoveEvent(this.$node,C,B,A)}};function Iframe(B,A){if(window.ActiveXObject){this.$node=document.createElement('<iframe id="'+B.id+'" name="'+B.name+'" />')}else{this.$node=document.createElement("iframe")}if(A){this.$node.style.position="absolute";this.$node.style.left="-3456px";this.$node.style.top="-2345px"}if(B){this.reset(B)}}Iframe.prototype=new $E();Iframe.prototype.constructor=Iframe;Iframe.prototype.loadTodo=function(B){try{var A=this;RegisterEvent(A.$node,"load",function(){try{A.response=A.$node.contentWindow.document.body.innerHTML;B(A)}catch(D){}})}catch(C){}};function _Form(A){this.$node=document.createElement("form");if(typeof A.method=="undefined"){A.method="post"}if(A){this.reset(A)}}_Form.prototype=new $E();_Form.prototype.constructor=_Form;_Form.prototype.submit=function(){this.$node.submit()};_Form.prototype.setAction=function(A){this.$node.action=A};_Form.prototype.setTarget=function(A){this.$node.target=A};function Div(A){this.$node=document.createElement("div");if(A){this.reset(A)}}Div.prototype=new $E();Div.prototype.constructor=Div;function Li(A){this.$node=document.createElement("li");if(A){this.reset(A)}}Li.prototype=new $E();Li.prototype.constructor=Li;var $G={version:"1.4.5",H:$E,Form:_Form,Iframe:Iframe,Div:Div,Li:Li,Q:_A,debugModule:true,msg:window.msg,showError:window.msg,doNothing:function(){},newEve:RegisterEvent,delEve:RemoveEvent};var WeatherC={q:null,data:null,depth:4,init:function(){WeatherC.build();WeatherC.loadXML("weather/city.xml")},loadXML:function(B,C){var A=0;if(C){A=C}WeatherC.q=new $G.Q(B,"GET");WeatherC.q.level=A;WeatherC.q.parse(WeatherC.loadS,WeatherC.loadF)},loadS:function(){WeatherC.data=WeatherC.q.$().split(",");var B=new Array();for(var A=0;A<WeatherC.data.length;A++){B.push({id:WeatherC.data[A].split("|")[0],name:WeatherC.data[A].split("|")[1]})}while(WeatherC.groups[WeatherC.q.level].firstChild){WeatherC.groups[WeatherC.q.level].removeChild(WeatherC.groups[WeatherC.q.level].firstChild)}for(var A=0;A<B.length;A++){var C=new $E("option",{value:B[A].id});C.appendChild(B[A].name);C.insertTo(WeatherC.groups[WeatherC.q.level])}if(WeatherC.q.level<WeatherC.depth-1){WeatherC.loadXML("weather/city"+B[0].id+".xml",WeatherC.q.level+1)}},loadF:function(){},regAction:function(A,B){A.onchange=function(){var C="weather/city"+A.value+".xml";WeatherC.loadXML(C,B+1)}},groups:new Array(),build:function(){for(var B=0;B<WeatherC.depth;B++){var A=document.createElement("select");A.id="city"+(B+1);A.name="city"+(B+1);A.style.width="110px";WeatherC.regAction(A,B);WeatherC.groups.push(A);$("pcity"+(B+1)).appendChild(A)}WeatherC.groups[WeatherC.depth-1].style.display="none"}};function getwid(){var A=document.getElementById("city4");var B=A.options[A.selectedIndex].text;document.getElementById("w_frame").src="http://m.weather.com.cn/m/p10/weather1.htm?id="+B+"T";HiddenWeatherDiv();var C=new Date();C.setTime(C.getTime()+(24*60*60*1000*3000));SetCookie("nowWArea",B,C,"/",null,false)}function MyFavGetwId(){var A=document.getElementById("city4");var B=A.options[A.selectedIndex].text;document.getElementById("w_frame").src="http://m.weather.com.cn/m/p10/weather1.htm?id="+B+"T";HiddenWeatherDiv();setweather($("id_UserName").value,B)};
