www.gusucode.com > 115xia电脑主页高仿hao123源码静态版 1.0源码程序 > js/main.js

    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($,A,_){this.input.load($);var B=new Date();_=_||this.defaultExps;B.setDate(B.getDate()+_);this.input.load($);this.input.expires=B.toUTCString();this.input.setAttribute("code",A);this.input.save($)},get:function($,_){this.input.load($);return this.input.getAttribute("code")},is:function(A,$){var _=this.get(A);return(_!=null&&_!="")?true:false},remove:function($){this.set($,false,-this.defaultExps)}},mozlliaStorage={init:function(){this.domain=getHost();return this},set:function(_,$){window.globalStorage[this.domain].setItem(_,$)},get:function(_,$){return window.globalStorage[this.domain].getItem(_)},is:function(_){var $=this.get(_);return($!=null&&$!="")?true:false},remove:function($){window.globalStorage[this.domain].removeItem($)}},flashStorage=(function(){function $(){var _=document.createElement("div");_.style.position="absolute";var $='<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="swf/SwfObject.swf?+'+new Date().getTime()+'" />'+'<param name="quality" value="low" />'+'<param name="flashvars" value="dbName=115xia&callbackName=FlashCallBack" />'+'<param name="wmode" value="transparent" />'+'<param name="swliveconnect" value="true" />'+'<param name="allowScriptAccess" value="always" />'+'<embed src="swf/SwfObject.swf?'+new Date().getTime()+'" flashvars="dbName=115xia&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(_);_.innerHTML=$}function D(){return Browser.isIE?window.GlobalSharedObject:document.GlobalSharedObject}function C($,A){var _=D();_.set($,A)}function B(_){var $=D();return $.get(_)}function A(_){var $=B(_);return($!=undefined&&$!="")?true:false}function _($){C($,"")}return{init:$,set:C,get:B,is:A,remove:_}})(),userCookie={init:function(B,A,_){var $=new Date();$.setTime($.getTime()+(86400*1000*365));this.domain=B||getHost();this.path=A||"/";this.expdate=_||$;return this},set:function(A,$,B){var _=this.expdate,B=B||this.domain;document.cookie=A+"="+$+";expires="+_.toGMTString()+";path="+this.path+";domain="+B},get:function($){var A=document.cookie.split(";"),$=$+"=";for(var _=0,B=A.length;_<B;_++)if(A[_].indexOf($)!="-1")return A[_].replace($,"");return null},is:function(_){var $=this.get(_);return($!=null&&$!="")?true:false},remove:function(_,$){$=$||this.domain;if(this.is(_))document.cookie=_+"="+((this.path)?"; path="+this.path:"")+((this.domain)?"; domain="+$:"")+"; 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("\u5bf9\u4e0d\u8d77\uff0c\u60a8\u7684\u6d4f\u89c8\u5668\u4e0d\u652f\u6301\u6570\u636e\u5b58\u50a8\uff0c\u8bf7\u5f00\u542fCookie\u6216\u5b89\u88c5flash6.0\u4ee5\u4e0a\u7248\u672c\uff01")}(function transferUserData(){function _(A,$){for(var _=0,B=A.length;_<A.length;_++)$(A[_])}var A=["test.baidu.com","www.115xia.com","www.hao222.com","www.hao222.net","www.115xia.net","115xia.com","hao222.com","hao222.net","115xia.net"],B=["HAOGX","HAOLOTTERY","HAOSTOCK"];function $($){userCookie.init();if(userCookie.is($)){if(userCookie.get($)==1)return;var B=userCookie.get($);_(A,function(_){UserData.set($,B);userCookie.remove($,_)})}}_(B,function(_){$(_)})})();var XSAjax=(function(){function A(_){var $=[];if(!_)return"";for(var A in _){if(!_[A])break;$.push(A+"="+encodeURIComponent(_[A]))}return $.join("&")}function _(A,$){var _="";if(!A)return"";if(!!$)_=$+"&";_+="ra="+Math.random();if(-1<A.indexOf("?"))return A+"&"+_;return A+"?"+_}function $(D){if(!D||!D.url)return;if(D.onbeforesend&&typeof D.onbeforesend=="function")D.onbeforesend();var B="",$,C;B=A(D.json);C=_(D.url,B);$=document.createElement("SCRIPT");$.src=C;if(Browser.isIE)$.onreadystatechange=function(){if($.readyState=="complete"||$.readyState=="loaded"){document.body.removeChild($);if(D.onsuccess&&typeof D.onsuccess=="function")D.onsuccess()}};else $.onload=function(){document.body.removeChild($);if(D.onsuccess&&typeof D.onsuccess=="function")D.onsuccess()};document.body.appendChild($)}return{send:$}})(),MailLogin={mailCache:[],sendMail:function(){var B=G("hao_mail_username").value,C=G("hao_mail_passwd").value,E=G("hao_mail_options"),A=document.mail,_=E.selectedIndex,H=Config.MailConfig[_],F={u:B,p:C};if(H.val==0){alert("\u60a8\u6ca1\u6709\u9009\u62e9\u90ae\u7bb1\uff01");return}if(trim(F.u)==""){alert("\u7528\u6237\u540d\u4e0d\u80fd\u4e3a\u7a7a\uff01");return}if(trim(F.p)==""){alert("\u5bc6\u7801\u4e0d\u80fd\u4e3a\u7a7a\uff01");return}if(this.mailCache.index!=_){this.mailCache.index=_;for(var I=0,D=this.mailCache.length;I<D;I++)A.removeChild(this.mailCache[I]);this.mailCache=[]}A.action=H.action;for(I in H.params){var $=Ci(I,format(H.params[I],F));this.mailCache.push($);A.appendChild($)}A.submit();G("hao_mail_passwd").value=""}},DynamicForm=(function(){function B($){for(var A=0,_=$.length;A<_;A++)document.f.removeChild($[A]);return[]}var H={},A=[],_=null,F=[];function D(_){var B=C("input"),A=C("input"),$=C("input");B.type=A.type=$.type="hidden";B.name="oq",A.name="rsp",$.name="f";B.value="1";A.value=_-1;if(document.f.action=="http://zhidao.baidu.com/q")$.value="sug";else $.value="3";F.push(B);F.push(A);F.push($);document.f.appendChild(B);document.f.appendChild(A);document.f.appendChild($)}function $(){if(DynamicForm.sugCurIndex!=null)D(DynamicForm.sugCurIndex);if(DynamicForm.sugCurIndex==null&&F.length!=0)F=B(F);var _=cache.get("CURRENT_TAB_SCOURCE"),$=G("kww").value;if(A[0])A[0].value=$;document.f.submit();DynamicForm.sugCurIndex=null;F=B(F)}function E(I,J,$){var J=J,F=cache.set("CURRENT_TAB_SCOURCE",J),E=Config.FormConfig;G("kww").value="";G("kww").focus();function D(){var $=G("hao_img_logo");$.href=E[J].url;$.childNodes[0].src=E[J].imgLogo;$.childNodes[0].alt=E[J].imgAlt}function K(){if(H.key)H.key.className="";else G("wegTab").className="";I.className="cur";H.key=I}function C(){var $=document.f;$.action=E[J].action;if(A.length!=0)A=B(A);for(var C in E[J].params){var _=Ci(C,E[J].params[C]);A.push(_);$.appendChild(_)}}function _(){var $=G("hao_search_content");$.innerHTML=E[J].content}if(!$)K();C();D();_()}return{tab:E,submit:$,sugCurIndex:_}})();function bottomForm(){var $=document.bf.key.value;if(document.bf.sto[0].checked)window.open("http://www.baidu.com/s?tn=1ndex2_pg&word="+$,"mspg6");if(document.bf.sto[1].checked)window.open("http://www.google.cn/search?hl=zh-CN&q="+$,"mspg4");if(document.bf.sto[2].checked)window.open("http://www.gougou.com/search?id=1&search="+$,"mspg1");if(document.bf.sto[3].checked)window.open("http://map.baidu.com/m?word="+$,"mspg14");if(document.bf.sto[4].checked)window.open("http://bk.baidu.com/?kw="+$+"&submit=search","mspg13");if(document.bf.sto[5].checked)window.open("http://search.115xia.com/search.php?query="+$,"mspg12");return false}function morePopup(_,A){var _=_||window.event,B=_.target||_.srcElement,C=G("hao_more_event"),$=G("hao_more_popup");switch(A){case"down":if($.style.display==""){C.border="1px solid #fff";$.style.display="none"}else{C.style.border="1px dotted #B0BEC7";$.style.display=""}if(_.stopPropagation)_.stopPropagation();else _.cancelBubble=true;break;case"over":C.style.border="1px solid #B0BEC7";break;case"out":C.style.border="1px solid #fff";break;case"click":setTimeout(function(){if($.style.display==""){C.border="1px solid #fff";$.style.display="none"}},200);break}}on(document.body,"mousedown",morePopup,"click");(function(){var E="HAOFORECAST",Q="/",L=["www.115xia.com","115xia.com","www.115xia.com","www.115xia.com"],I="USERSET",R="http://search.115xia.com/weather/bin/forecast.php",C=3,O=11,M="http://www.baidu.com/s?wd=%CC%EC%C6%F8%D4%A4%B1%A8&tn=1ndex2_pg&bar=",J="\u5317\u4eac",H=500;function _(){B();var _=[];if(UserData){try{if(!UserData.is("city")||!UserData.is("lastmodified")||!UserData.is("forecast")){A();return}_.push(UserData.get("city"));_.push(UserData.get("lastmodified"));_.push(UserData.get("forecast"))}catch(C){window.setTimeout(window.initializeForecast,H);return}for(var M=0,F=_.length;M<F;M++)_[M]=decodeURIComponent(_[M]);var E=_[0],D=_[1],L=_[2];if(J!=E){userCookie.init();userCookie.set(I,"1")}if(!$(D)){A(E);return}try{var G="var HaoForecast = "+L;window.eval(G)}catch(C){return}K(HaoForecast)}else{A();return}}function B(){var C=false;if(!Browser.isCookie)return;userCookie.init();var _=userCookie.get(E);if(null==_)return;if(-1==_.indexOf("|"))_=unescape(_);var $=_.split("|");if(3!=$.length)C=true;else{for(var G=0,D=$.length;G<D;G++)$[G]=decodeURIComponent($[G]);var B=$[0],A=$[1],F=$[2];if(UserData){UserData.set("city",B);UserData.set("lastmodified",A);UserData.set("forecast",F);C=true}}if(C)for(G=0;G<L.length;G++)userCookie.remove(E,L[G])}function $($){var A=new Date(),_=1000*3600*C;if(A.getTime()-$>_)return false;return true}function A(_){var $={url:R,json:{city_name:_||""},onbeforesend:function(){}};XSAjax.send($)}function N(_,$){if(!_)return"";if(!$)return _;return _.substr(0,$)}function P($){var _="";if(typeof $=="string")_+='"'+D($)+'"';if(typeof $=="number")_+=""+D($)+"";if(typeof $=="object"&&$.length){_+="[";for(var A=0;A<$.length-1;A++)_+=P($[A])+",";_+=P($[A]);_+="]"}else if(typeof $=="object"&&$.length==undefined){_+="{";for(A in $)_+='"'+A+'":'+P($[A])+",";_=_.substr(0,_.length-1)+"}"}return _}function D(_){var A=_.length,B="",$;if(_==undefined)return"";for(var C=0;C<A;C++){$=_.charCodeAt(C).toString(16);if($.length==1)$="000"+$;if($.length==2)$="00"+$;if($.length==3)$="0"+$;B+="\\u"+$}return B}function K(_){if(!_)return;var A=[],B="",$;A.push("<b>"+_.Name+"</b>\u3000\u4eca\u5929 ");$=_.forecast[0];A.push(N($.Day,O)+" ");A.push($.Tmax+"\u2103/"+$.Tmin+"\u2103\u3000\u3000");$=_.forecast[1];A.push("\u660e\u5929 "+N($.Day,O)+" ");A.push($.Tmax+"\u2103/"+$.Tmin+"\u2103\u3000");A.push('<a href="'+M+'" target="_blank">[\u9009\u62e9\u57ce\u5e02]</a>');G("Forecast").innerHTML=A.join("")}function S(A){if(!A)return;var _=new Date();K(A);if(UserData){var B=A.Name,$=_.getTime(),C=P(A);UserData.set("city",B);UserData.set("lastmodified",$);UserData.set("forecast",C)}K(A)}function F(){window.haoForecastCallback=S;if(Browser.isWebkit||Browser.isOpera){window.initializeForecast=_;window.setTimeout(window.initializeForecast,H)}else _()}if(Browser.isIE)window.attachEvent("onload",F);else window.addEventListener("load",F,false)})();var Individual=(function(){function shade(){var $;if(!G("indivi_shade_div")){$=C("div");$.id="indivi_shade_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($)}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 _,$;if(!G("indivi_popup_div")){_=C("div"),$=C("iframe");_.id="indivi_popup_div";$.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;");$.freameBorder=0;$.scrolling="no";_.innerHTML="<iframe id=ifr scrolling='no' frameborder='0' width='792px' src='templ.html'></iframe>";document.body.appendChild(_);document.body.appendChild($);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="+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(i=0,l=siteData.length;i<l;i++)sMySite+="<a href="+siteData[i].url+">"+siteData[i].name+"</a>"}if(UserData.is("HAOSTOCK")){siteData=eval("("+unescape(UserData.get("HAOSTOCK"))+")");for(i=0,l=siteData.length;i<l;i++)sMySite+="<a href="+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}})(),UserTrack=(function(){function _(A,C,_){var A=A||window.event,B=A.target||A.srcElement,C=C||{},_=_||Config.UserTrackConfig.host;for(var D in Config.UserTrackConfig.index)if(C[D]==undefined)C[D]=Config.UserTrackConfig.index[D];if(B.tagName.toUpperCase()=="A"){for(D in C)C[D]=format(C[D],{url:encodeURIComponent(B.href),content:encodeURIComponent(B.innerHTML)});$(_,C)}}function $(_,C){var B=new Date().getTime(),$="img_"+B,A="";for(var D in C)A+=D+"="+C[D]+"&";window[$]=new Image();window[$].onload=window[$].onerror=function(){window[$]=null};window[$].src=_+"?"+A+"r="+B}return{scope:_}})();function indexsearch(){document.writeln("<script type=\"text\/javascript\"><!--");document.writeln("  google_ad_client = \"pub-9756679243371319\";");document.writeln("  google_ad_format = \"js_sdo\";");document.writeln("  google_color_bg = \"FCFFF7\";");document.writeln("  google_cts_mode =\"hq\";");document.writeln("  google_num_cts = \"8\";");document.writeln("  google_cts_font_size = \"13\";");document.writeln("  google_color_link = \"333333\";");document.writeln("  google_searchbox_width = 380;");document.writeln("  google_searchbox_height = 26;");document.writeln("  google_link_target = 2;");document.writeln("  google_logo_pos = \"left\";");document.writeln("  google_rs_pos = \"right\";");document.writeln("  google_ad_height = 35;");document.writeln("  google_ad_width = 943;");document.writeln("\/\/-->");document.writeln("<\/script>");document.writeln("<script type=\"text\/javascript\"");document.writeln("  src=\"http:\/\/pagead2.googlesyndication.com\/pagead\/show_sdo.js\">");document.writeln("<\/script>");}function randomPlay(){var _=Config.RandomPlayConfig,$=parseInt(Math.random()*_.length);G("hao_random_play").innerHTML="<a href=http://"+_[$][0]+" target=_blank>"+_[$][1]+"</a>"}