var ieUserData={init:function(){this.defaultExps=365;this.input=C("input");this.input.type="hidden";this.input.id="ieuserdata";this.input.addBehavior("#default#userData");document.body.appendChild(this.input);return this},set:function(F,J,I){this.input.load(F);var H=new Date();I=I||this.defaultExps;H.setDate(H.getDate()+I);this.input.load(F);this.input.expires=H.toUTCString();this.input.setAttribute("code",J);this.input.save(F)},get:function(D,E){this.input.load(D);return this.input.getAttribute("code")},is:function(H,F){var E=this.get(H);return(E!=null&&E!="")?true:false},remove:function(B){this.set(B,false,-this.defaultExps)}};var mozlliaStorage={init:function(){this.domain=getHost();return this},set:function(D,E){window.globalStorage[this.domain].setItem(D,E)},get:function(D,E){return window.globalStorage[this.domain].getItem(D)},is:function(E){var D=this.get(E);return(D!=null&&D!="")?true:false},remove:function(B){window.globalStorage[this.domain].removeItem(B)}};var flashStorage=(function(){function J(){var A=document.createElement("div");A.style.position="absolute";var B='<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" width="1" height="1" id="GlobalSharedObject"><param name="movie" value="../hao123_files/swf/SwfObject.swf?+'+new Date().getTime()+'" /><param name="quality" value="low" /><param name="flashvars" value="dbName=hao123&callbackName=FlashCallBack" /><param name="wmode" value="transparent" /><param name="swliveconnect" value="true" /><param name="allowScriptAccess" value="always" /><embed src="../hao123_files/swf/SwfObject.swf?'+new Date().getTime()+'" flashvars="dbName=hao123&callbackName=FlashCallBack" quality="low" swLiveConnect="true" width="1" height="1" allowScriptAccess="always" wmode="transparent" name="GlobalSharedObject" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer"></embed></object>';(document.body||document.documentElement).appendChild(A);A.innerHTML=B}function L(){return Browser.isIE?window.GlobalSharedObject:document.GlobalSharedObject}function I(D,B){var A=L();A.set(D,B)}function M(B){var A=L();return A.get(B)}function K(A){var B=M(A);return(B!=undefined&&B!="")?true:false}function H(A){I(A,"")}return{init:J,set:I,get:M,is:K,remove:H}})();var userCookie={init:function(I,H,F){var J=new Date();J.setTime(J.getTime()+(86400*1000*365));this.domain=I||getHost();this.path=H||"/";this.expdate=F||J;return this},set:function(J,H,I){var F=this.expdate,I=I||this.domain;document.cookie=J+"="+H+";expires="+F.toGMTString()+";path="+this.path+";domain="+I},get:function(H){var J=document.cookie.split(";"),H=H+"=";for(var I=0,F=J.length;I<F;I++){if(J[I].indexOf(H)!="-1"){return J[I].replace(H,"")}}return null},is:function(E){var D=this.get(E);return(D!=null&&D!="")?true:false},remove:function(D,E){var E=E||this.domain;if(this.is(D)){document.cookie=D+"="+((this.path)?"; path="+this.path:"")+((this.domain)?"; domain="+E:"")+"; expires=Thu, 01-Jan-70 00:00:01 GMT"}}};if(!window.UserData){var UserData=null;if(Browser.isIE){UserData=ieUserData.init()}else{if(Browser.isFF){UserData=mozlliaStorage.init()}else{if(Browser.isFlash){flashStorage.init();UserData=flashStorage}else{if(Browser.isCookie){UserData=userCookie.init()}else{alert("对不起，您的浏览器不支持数据存储，请开启Cookie或安装flash6.0以上版本！")}}}}}(function transferUserData(){function F(E,A){for(var B=0,D=E.length;B<E.length;B++){A(E[B])}}var J=["test.baidu.com","www.hao123.com","www.hao222.com","www.hao222.net","www.hao123.net","hao123.com","hao222.com","hao222.net","hao123.net"],I=["HAOGX","HAOLOTTERY","HAOSTOCK"];function H(B){userCookie.init();if(userCookie.is(B)){if(userCookie.get(B)==1){return }var A=userCookie.get(B);F(J,function(D){UserData.set(B,A);userCookie.remove(B,D)})}}F(I,function(A){H(A)})})();var XSAjax=(function(){function B(H){var E=[];if(!H){return""}for(var F in H){if(!H[F]){break}E.push(F+"="+encodeURIComponent(H[F]))}return E.join("&")}function D(E,F){var H="";if(!E){return""}if(!!F){H=F+"&"}H+="ra="+Math.random();if(-1<E.indexOf("?")){return E+"&"+H}return E+"?"+H}function A(H){if(!H||!H.url){return }if(H.onbeforesend&&typeof H.onbeforesend=="function"){H.onbeforesend()}var I="",F,E;I=B(H.json);E=D(H.url,I);F=document.createElement("SCRIPT");F.src=E;if(Browser.isIE){F.onreadystatechange=function(){if(F.readyState=="complete"||F.readyState=="loaded"){document.body.removeChild(F);if(H.onsuccess&&typeof H.onsuccess=="function"){H.onsuccess()}}}}else{F.onload=function(){document.body.removeChild(F);if(H.onsuccess&&typeof H.onsuccess=="function"){H.onsuccess()}}}document.body.appendChild(F)}return{send:A}})();var MailLogin={mailCache:[],sendMail:function(){var F=G("hao_mail_username").value,K=G("hao_mail_passwd").value,L=G("hao_mail_options"),A=document.mail,H=L.selectedIndex,I=Config.MailConfig[H],D={u:F,p:K};if(I.val==0){alert("您没有选择邮箱！");return }if(trim(D.u)==""){alert("用户名不能为空！");return }if(trim(D.p)==""){alert("密码不能为空！");return }if(this.mailCache.index!=H){this.mailCache.index=H;for(var E=0,B=this.mailCache.length;E<B;E++){A.removeChild(this.mailCache[E])}this.mailCache=[]}A.action=I.action;for(var E in I.params){var J=Ci(E,format(I.params[E],D));this.mailCache.push(J);A.appendChild(J)}A.submit();G("hao_mail_passwd").value=""}};var DynamicForm=(function(){function H(L){for(var M=0,K=L.length;M<K;M++){document.f.removeChild(L[M])}return[]}var E={},A=[],F=null,D=[];function B(L){var N=C("input"),K=C("input"),M=C("input");N.type=K.type=M.type="hidden";N.name="oq",K.name="rsp",M.name="f";N.value="1";K.value=L-1;if(document.f.action=="http://zhidao.baidu.com/q"){M.value="sug"}else{M.value="3"}D.push(N);D.push(K);D.push(M);document.f.appendChild(N);document.f.appendChild(K);document.f.appendChild(M)}function J(){if(DynamicForm.sugCurIndex!=null){B(DynamicForm.sugCurIndex)}if(DynamicForm.sugCurIndex==null&&D.length!=0){D=H(D)}var L=cache.get("CURRENT_TAB_SCOURCE"),K=G("kww").value;if(A[0]){A[0].value=K}document.f.submit();DynamicForm.sugCurIndex=null;D=H(D)}function I(Q,R,S){var R=R,P=cache.set("CURRENT_TAB_SCOURCE",R),M=Config.FormConfig;G("kww").value="";G("kww").focus();function K(){var T=G("hao_img_logo");T.href=M[R].url;T.childNodes[0].src=M[R].imgLogo;T.childNodes[0].alt=M[R].imgAlt}function L(){if(E.key){E.key.className=""}else{G("wegTab").className=""}Q.className="cur";E.key=Q}function O(){var V=document.f;V.action=M[R].action;if(A.length!=0){A=H(A)}for(var U in M[R]["params"]){var T=Ci(U,M[R]["params"][U]);A.push(T);V.appendChild(T)}}function N(){var T=G("hao_search_content");T.innerHTML=M[R].content}if(!S){L()}O();K();N()}return{tab:I,submit:J,sugCurIndex:F}})();function bottomForm(){var A=document.bf.key.value;if(document.bf.sto[0].checked){window.open("http://www.baidu.com/s?tn=sitehao123&word="+A,"mspg6")}if(document.bf.sto[1].checked){window.open("http://www.google.cn/search?hl=zh-CN&q="+A,"mspg4")}if(document.bf.sto[2].checked){window.open("http://www.gougou.com/search?id=1&search="+A,"mspg1")}if(document.bf.sto[3].checked){window.open("http://map.baidu.com/m?word="+A,"mspg14")}if(document.bf.sto[4].checked){window.open("http://bk.baidu.com/?kw="+A+"&submit=search","mspg13")}if(document.bf.sto[5].checked){window.open("http://search.hao123.com/search.php?query="+A,"mspg12")}return false}function morePopup(F,A){var F=F||window.event,E=F.target||F.srcElement,B=G("hao_more_event"),D=G("hao_more_popup");switch(A){case"down":if(D.style.display==""){B.border="1px solid #fff";D.style.display="none"}else{B.style.border="1px dotted #B0BEC7";D.style.display=""}if(F.stopPropagation){F.stopPropagation()}else{F.cancelBubble=true}break;case"over":B.style.border="1px solid #B0BEC7";break;case"out":B.style.border="1px solid #fff";break;case"click":setTimeout(function(){if(D.style.display==""){B.border="1px solid #fff";D.style.display="none"}},200);break}}on(document.body,"mousedown",morePopup,"click");(function(){var COOKIE_NAME="HAOFORECAST",COOKIE_PATH="/",COOKIE_DOMAIN=["hao123.net","hao123.com","hao222.net","hao222.com"],COOKIE_USERSET="USERSET",REQUEST_URL="http://search.hao123.com/weather/bin/forecast.php",EXPIRE_HOUR=3,MAXLEN=11,SHEZHI_URL="shezhi.html",DEFAULT_CITY="北京",TIME_OUT=500;function initializeForecast(){fixCookie();var valueArr=[];if(UserData){try{if(!UserData.is("city")||!UserData.is("lastmodified")||!UserData.is("forecast")){requestForecast();return }valueArr.push(UserData.get("city"));valueArr.push(UserData.get("lastmodified"));valueArr.push(UserData.get("forecast"))}catch(e){window.setTimeout(window.initializeForecast,TIME_OUT);return }for(var i=0,len=valueArr.length;i<len;i++){valueArr[i]=decodeURIComponent(valueArr[i])}var cityName=valueArr[0],lastModified=valueArr[1],fcStr=valueArr[2];if(DEFAULT_CITY!=cityName){userCookie.init();userCookie.set(COOKIE_USERSET,"1")}if(!isLatest(lastModified)){requestForecast(cityName);return }try{var evalStr="var HaoForecast = "+fcStr;window.eval(evalStr)}catch(e){return }displayForecast(HaoForecast)}else{requestForecast();return }}function fixCookie(){var bDelete=false;if(!Browser.isCookie){return }userCookie.init();var fcCookie=userCookie.get(COOKIE_NAME);if(null==fcCookie){return }if(-1==fcCookie.indexOf("|")){fcCookie=unescape(fcCookie)}var valueArr=fcCookie.split("|");if(3!=valueArr.length){bDelete=true}else{for(var i=0,len=valueArr.length;i<len;i++){valueArr[i]=decodeURIComponent(valueArr[i])}var cityName=valueArr[0],lastModified=valueArr[1],fcStr=valueArr[2];if(UserData){UserData.set("city",cityName);UserData.set("lastmodified",lastModified);UserData.set("forecast",fcStr);bDelete=true}}if(bDelete){for(var i=0;i<COOKIE_DOMAIN.length;i++){userCookie.remove(COOKIE_NAME,COOKIE_DOMAIN[i])}}}function isLatest(lastModified){var now=new Date(),timeSpan=1000*3600*EXPIRE_HOUR;if(now.getTime()-lastModified>timeSpan){return false}return true}function requestForecast(cityName){var reqOptions={url:REQUEST_URL,json:{city_name:cityName||""},onbeforesend:function(){}};XSAjax.send(reqOptions)}function truncate(str,max){if(!str){return""}if(!max){return str}return str.substr(0,max)}function serializeJSON(json){var retVal="";if(typeof json=="string"){retVal+='"'+unicode(json)+'"'}if(typeof json=="number"){retVal+=""+unicode(json)+""}if(typeof json=="object"&&json.length){retVal+="[";for(var i=0;i<json.length-1;i++){retVal+=serializeJSON(json[i])+","}retVal+=serializeJSON(json[i]);retVal+="]"}else{if(typeof json=="object"&&json.length==undefined){retVal+="{";for(var i in json){retVal+='"'+i+'":'+serializeJSON(json[i])+","}retVal=retVal.substr(0,retVal.length-1)+"}"}}return retVal}function unicode(str){var len=str.length,retStr="",tmpStr;if(str==undefined){return""}for(var i=0;i<len;i++){tmpStr=str.charCodeAt(i).toString(16);if(tmpStr.length==1){tmpStr="000"+tmpStr}if(tmpStr.length==2){tmpStr="00"+tmpStr}if(tmpStr.length==3){tmpStr="0"+tmpStr}retStr+="\\u"+tmpStr}return retStr}function displayForecast(forecast){if(!forecast){return }var tmpArr=[],dateStr="",fcObj;tmpArr.push("<b>"+forecast.Name+"</b>　今天 ");fcObj=forecast.forecast[0];tmpArr.push(truncate(fcObj.Day,MAXLEN)+" ");tmpArr.push(fcObj.Tmax+"℃/"+fcObj.Tmin+"℃　　");fcObj=forecast.forecast[1];tmpArr.push("明天 "+truncate(fcObj.Day,MAXLEN)+" ");tmpArr.push(fcObj.Tmax+"℃/"+fcObj.Tmin+"℃　");tmpArr.push('<a href="../hao123_files/'+SHEZHI_URL+'" target="_blank">[选择城市]</a>');G("Forecast").innerHTML=tmpArr.join("")}function updateForecast(forecast){if(!forecast){return }var now=new Date();displayForecast(forecast);if(UserData){var cityName=forecast.Name,lastModified=now.getTime(),fcStr=serializeJSON(forecast);UserData.set("city",cityName);UserData.set("lastmodified",lastModified);UserData.set("forecast",fcStr)}displayForecast(forecast)}function init(){window.haoForecastCallback=updateForecast;if(Browser.isWebkit||Browser.isOpera){window.initializeForecast=initializeForecast;window.setTimeout(window.initializeForecast,TIME_OUT)}else{initializeForecast()}}if(Browser.isIE){window.attachEvent("onload",init)}else{window.addEventListener("load",init,false)}})();var Individual=(function(){function shade(){var div;if(!G("indivi_shade_div")){div=C("div");div.id="indivi_shade_div";div.style.height=document.body.scrollHeight+"px";setStyle("#indivi_shade_div","width:100%;height:0px;position:absolute;top:0px;left:0px;background-color:#FFF;filter: alpha(opacity=40);opacity:0.4;z-index:996;");document.body.appendChild(div)}else{setStyle("#indivi_shade_div","display:block")}}function hide(){if(!G("indivi_popup_div")){return }setStyle("#indivi_popup_div","display:none");setStyle("#indivi_popup_iframe","display:none");setStyle("#indivi_shade_div","display:none")}function resize(){if(!G("indivi_popup_div")){return }G("indivi_popup_div").style.left=G("indivi_popup_iframe").style.left=(document.body.offsetWidth-792)/2+"px"}on(window,"resize",resize);function popup(){var div,iframe;if(!G("indivi_popup_div")){div=C("div"),iframe=C("iframe");div.id="indivi_popup_div";iframe.id="indivi_popup_iframe";setStyle("#indivi_popup_div","position:absolute;top:100px;width:792px;border:2px solid #8ab78a;z-index:1000;");setStyle("#indivi_popup_iframe","position:absolute;top:100px;width:792px;z-index:998;height:650px;");iframe.freameBorder=0;iframe.scrolling="no";div.innerHTML="<iframe id=ifr scrolling='no' frameborder='0' width='792px' src='templ.html'></iframe>";document.body.appendChild(div);document.body.appendChild(iframe);resize()}else{setStyle("#indivi_popup_div","display:block");setStyle("#indivi_popup_iframe","display:block")}}function transferIndivi(){if(UserData.is("HAOGX")){var indivData=eval("("+unescape(UserData.get("HAOGX"))+")"),value=indivData.dataValue,url=indivData.dataUrl,bgColor=indivData.bgColor,fontColor=indivData.fontColor,bgColorNum=indivData.bgColorNum,fontColorNum=indivData.fontColorNum,sMyLike="";for(var i=0,l=value.length;i<l;i++){if(value[i]!="null"&&value[i]!=""){sMyLike+="<a href="../hao123_files/+url[i]+">"+value[i]+"</a>"}}if(bgColorNum&&bgColorNum!=0){setStyle("body","background:url("+bgColor+") fixed no-repeat center;");setStyle(".bg1,.bg2,#hao_my_like,#hao_my_site","background:none");setStyle("#content,.mail,.usrbar,.bottom,#aside,.bottom table","filter: alpha(opacity=80);opacity:0.8;");setStyle(".sort th,.sort td","border-bottom:1px none;")}if(fontColorNum&&fontColorNum!=0){setStyle("#container a:link,#container a:visited,#container,#aside th a:link,#aside th a:visited,a.f1:link,a.f1:visited,a.f2:link,a.f2:visited,.bottom td","color:"+fontColor);setStyle("#container a:hover,#aside th a:hover,a.f1:hover,a.f2:hover","color:#F00")}if(sMyLike!=""){G("hao_my_like").childNodes[1].innerHTML=sMyLike;setStyle("#hao_my_like","display:block")}}var sMySite="";if(UserData.is("HAOLOTTERY")){var siteData=eval("("+unescape(UserData.get("HAOLOTTERY"))+")");for(var i=0,l=siteData.length;i<l;i++){sMySite+="<a href="../hao123_files/+siteData[i].url+">"+siteData[i].name+"</a>"}}if(UserData.is("HAOSTOCK")){var siteData=eval("("+unescape(UserData.get("HAOSTOCK"))+")");for(var i=0,l=siteData.length;i<l;i++){sMySite+="<a href="../hao123_files/+siteData[i].url+">"+siteData[i].name+"</a>"}}if(sMySite!=""){G("hao_my_site").childNodes[1].innerHTML=sMySite;setStyle("#hao_my_site","display:block")}}if(Browser.isWebkit||Browser.isOpera){window.FlashCallBack=function(){transferIndivi()}}else{on(window,"load",transferIndivi)}function reload(){location.replace(location.href)}function show(){popup();shade()}return{show:show,hide:hide,reload:reload}})();var UserTrack=(function(){function A(H,I){var H=H||window.event,F=H.target||H.srcElement,I=I||Config.UserTrackConfig.index;function E(L){var J={};for(var K in L){J[K]=L[K]}return J}var I=E(I);if(F.tagName.toUpperCase()=="A"){for(var D in I){I[D]=format(I[D],{url:encodeURIComponent(F.href),content:encodeURIComponent(F.innerHTML)})}B(Config.UserTrackConfig.host,I);I.url="#{url}",I.content="#{content}"}}function B(I,J){var H=new Date().getTime(),E="img_"+H,D="";for(var F in J){D+=F+"="+J[F]+"&"}window[E]=new Image();window[E].onload=window[E].onerror=function(){window[E]=null};window[E].src=I+"?"+D+"r="+H}return{scope:A}})();function randomPlay(){var B=Config.RandomPlayConfig;var A=parseInt(Math.random()*B.length);G("hao_random_play").innerHTML="<a href=http://"+B[A][0]+" target=_blank>"+B[A][1]+"</a>"};
