﻿var Home=(function(){var G=null,o=null,a=null,D=null,m=-1;var v=0,C=null;var f=null,x=-1;var w=null,l=null,b=null,A=null,r=null,y=null,H=null,E=null;function p(){for(var n=0;n<G.length;n++){Zhishi.Event.attachEventListener(G[n],"mouseover",k.bind(G[n],n));Zhishi.Event.attachEventListener(G[n],"mouseout",u.bind(G[n],n));Zhishi.Event.attachEventListener(o[n],"mouseover",J.bind(o[n],n));Zhishi.Event.attachEventListener(o[n],"mouseout",u.bind(G[n],n))}}function k(K,P){var n=(G[K].getXY()[1]+2);var N=(G[K].getXY()[0]+188)+"px";var M=navigator.userAgent;if(M.indexOf("MSIE 7.")>0){var L=M.split(";");var O=L[L.length-1].trim();if(!(O.startsWith("Maxthon")||O.startsWith("SE")||Zhishi.Browser.isTT||O.startsWith("TheWorld")||O.startsWith("360SE"))||/qqbrowser/.test(window.navigator.userAgent.toLowerCase())){n-=2}}n+="px";if(D!=null){clearTimeout(D)}if(a!=null){clearTimeout(a)}D=setTimeout(function(){if(!o[K].visible()){if(m>-1){o[m].hide();G[m].className=""}o[K].style.top=n;o[K].style.left=N;o[K].show();G[K].className="current";m=K;o[K].show}},200)}function u(n){a=setTimeout(function(){G[n].className="";if(o[n].visible()){o[n].hide();m=-1}},200)}function J(n){if(a!=null){clearTimeout(a);clearTimeout(D)}}function B(){var P=get("bbsData");var N=get("bbsArea");var n=P.gets("a");var Q=n.length;if(P.innerHTML.trim()!=""){N.appendChild(document.createTextNode("\u95ee\u95ee\u52a8\u6001："));for(i=0;i<Q;i++){var O=document.createElement("span");var K=document.createElement("a");K.innerHTML=n[i].innerHTML;K.href=n[i].href;K.target="_blank";O.appendChild(K);if(i==0){O.style.display="inline-block"}N.appendChild(O)}var M=document.createElement("button");M.className="last";M.innerHTML="\u4e0a\u4e00\u6761";M.onclick=function(){d(v-1)};var L=document.createElement("button");L.className="next";L.innerHTML="\u4e0b\u4e00\u6761";L.onclick=function(){d(v+1)};N.appendChild(M);N.appendChild(L);c(Q)}}function d(K){var n=gets("#bbsArea span");var M=n.length;if(K>M-1){K=0}if(K<0){K=M-1}v=K;for(var L=0;L<M;L++){if(L==K){n[L].style.display="inline-block"}else{n[L].style.display="none"}}c(M)}function c(n){if(C!=null){clearTimeout(C)}C=setTimeout(function(){if(v==n-1){v=0}else{v++}d(v)},3000)}function t(){l.src="http://cache.soso.com/wenwen/sponsor/images/243853644.png";w.href="http://wenwen.soso.com/z/ShowUser.e?sp=498233b51fc4c781c103160238dda798&ch=w.gr.dh";w.target="_blank";b.innerHTML="\u5468\u7ade";b.href="http://wenwen.soso.com/z/ShowUser.e?sp=498233b51fc4c781c103160238dda798&ch=w.gr.dh";b.target="_blank";A.className="ico_lv18";r.innerHTML="13591";y.innerHTML="55.4%";H.innerHTML="\u7535\u8111\u5b89\u5168";H.href="http://wenwen.soso.com/z/c321454080.htm";H.target="_blank";E.innerHTML="\u7535\u8111\u5b89\u5168\u7c7b\u7684\u4e13\u5bb6 "}function F(){G=gets("#categoryWrap dl");o=gets("#leftCategories .category");w=get("user_link");l=get("user_img");b=get("user_id");A=get("user_lv");r=get("answer_num");y=get("adoption_rate");H=get("good_cate");E=get("expert_info")}function e(){z(0);s()}function z(K){if(K==null){return}x=K;for(var L=0;L<3;L++){var n=get("home-tab-"+L);var M=get("home-tab-div-"+L);if(L==K){if(n!=null){n.className="current"}if(M!=null){M.style.display="block"}}else{if(n!=null){n.className=""}if(M!=null){M.style.display="none"}}}}function q(){g()}function I(){s()}function g(){clearInterval(f)}function s(){f=setInterval(j,6000)}function j(){x++;if(x>2){x=0}z(x)}function h(){F();e();p();B();t()}return{Homeinit:h,switchTab:z,clearAuto:g,setAuto:s}})();
