try{NAVFUN}catch(ex){NAVFUN={}};WONIUCOMMON={log:function(l){try{console.info(l);}catch(e){}},$:function(id){return document.getElementById(id);},NAVFUN:function(product){NAVFUN[product]?NAVFUN[product]():this[product]();},closeAllList:function(hodePage){var hodes=["","M"];for(var i in hodes){if(hodes[i]===hodePage)continue;WONIUCOMMON.$("woniunav_list"+hodes[i]).style.display="none";}WONIUCOMMON.$("woniunav_userName").className="selfCenter";},openList:function(idx){idx=idx||"";if(this.timer){clearTimeout(this.timer);this.timer=null;}this.timer=setTimeout(function(){WONIUCOMMON.$("woniunav_list"+idx).style.display="";this.timer=null;},200);this.tikerClose();},tikerClose:function(){if(this.closeTimer){clearTimeout(this.closeTimer);this.closeTimer=null;}this.closeTimer=setTimeout(function(){WONIUCOMMON.closeAllList();},2000);},clearTiker:function(){if(this.closeTimer){clearTimeout(this.closeTimer);this.closeTime=null;}},home:function(){var userId=WONIUCOMMON.NAV.User.userId;if(!userId)return;var fun=location.href.match(/woniu\.com\/\d+\.\w+/)?this.goUrl:this.openUrl;if(userId){fun("http://hi.woniu.com/$u.home".replace("$u",userId));}else{fun("http://www.woniu.com/homespace/redirect.html");}},myGame:function(){var gUrl=WONIUCOMMON.NAV.getGameHome();if(gUrl){this.openUrl(gUrl);}},menuMain:function(){this.closeAllList("M");this.openList('M');WONIUCOMMON.$("woniunav_userName").className="selfCenterSe";},center:function(){alert("游戏中心");},consortia:function(){this.goUrl("http://www.woniu.com/apply/");},channel:function(){this.closeAllList("");this.openList("");},passport:function(){this.openUrl("http://passport.woniu.com/summary.do?method=prepare");},charge:function(){this.goUrl("http://res.woniu.com/imprest/imprest_main.html");},shop:function(){this.goUrl("http://shop.woniu.com/");},jwl:function(){this.goUrl("http://jwl.woniu.com/");},service:function(){this.goUrl("http://res.woniu.com/support/support.html");},bbs:function(){this.goUrl("http://club.woniu.com/");},viewMsg:function(){NAVFUN.viewMsg?NAVFUN.viewMsg():this.goUrl("http://www.woniu.com/personal/showSNSCommunity?app=model/message");},logout:function(_csu){NAVFUN.logout?NAVFUN.logout():this.goUrl("http://snslogin.woniu.com/login/logout.do?isRedirct=1&targetUrl=&csu=");},goUrl:function(url){location.assign?location.assign(url):setTimeout(function(){location.href=url},10);},openUrl:function(url){window.open(url);}};WONIUCOMMON.NAV={isIE:/MSIE/i.test(navigator.userAgent),product:"index",productList:["zone","passport","consortia","center","game","charge","shop","jwl","service","channel"],woniuGameList:{10:{name:'九阴真经',url:'http://9yin.woniu.com/'},7:{name:'天子',url:'http://tz.woniu.com/'},12:{name:'帝国文明',url:'http://dg.woniu.com/'},3:{name:'机甲世纪',url:'http://aoa.woniu.com/'},6:{name:'机甲世纪Ⅱ',url:'http://aoa.woniu.com/'},13:{name:'机甲世纪革新版',url:'http://aoa.woniu.com/'},4:{name:'舞街区',url:'http://5jq.woniu.com/'},1:{name:'航海世纪',url:'http://vc.woniu.com/'},9:{name:'英雄之城',url:'http://hero.woniu.com/'}},loginDoms:NAVFUN&&NAVFUN.loginDoms?NAVFUN.loginDoms:["woniunav_oncot"],logoutDoms:NAVFUN&&NAVFUN.logoutDoms?NAVFUN.logoutDoms:["woniunav_offcot"],allDoms:["woniunav_oncot","woniunav_offcot"],TOP:{getDOMStr:function(_p,_u,_csu){var name=(_u.nickName||_u.userName||"").replace(/</g,"&lt;").replace(/>/g,"&gt;");var service=(/[?&]service=/i).test(location.href)?'':'?service='+(location.host=="www.woniu.com"?"http://club.woniu.com/":location.href);return['<div class="WN_total_MenuKKone">','<div class="WN_total_MenuKK">','<div class="WN_menuL">','<div class="WN_menuR">','<div class="WN_menuM">','<a class="WN_logo" hidefocus="true" href="http://www.woniu.com/">','<img src="http://resimage.woniu.com/comres/js/woniu/style/images/wn_logo.gif" alt="蜗牛网 www.woniu.com" />','</a>','<div class="WN_menuML" id="WN_menuML">','<span id="woniunav_offcot" style="display:'+(name?'none':'')+';"><a href="http://www.woniu.com/account/login.do'+service+'" class="WN_marginR">[请登录]</a>&nbsp;&nbsp;<a class="WN_marginR" href="http://reg.woniu.com/?fromUrl=TL.WN.0.0.0" target="_blank">[免费注册]</a>','</span>','<div class="WN_gameandspace" id="woniunav_oncot" style="display:'+(name?'':'none')+';">','<span class="WN_menuRsayHi"></span>','<div class="WN_display_user_LR">','<div class="WN_selfCenter" style="display:none;" id="woniunav_listM" onmouseout="WONIUCOMMON.tikerClose();">','<div class="WN_selfCenterKK">','<a href="http://www.woniu.com/personal/showSNSCommunity?app=rightIndex" onclick="WONIUCOMMON.clearTiker();" hidefocus="true">个人中心</a><br />','<a href="javascript:WONIUCOMMON.NAVFUN(\'home\');" onmouseover="WONIUCOMMON.clearTiker();" hidefocus="true">我的地盘</a><br />','<a href="http://www.woniu.com/personal/showSNSCommunity?app=model/game" onmouseover="WONIUCOMMON.clearTiker();" hidefocus="true">我的游戏</a><br />','<a href="http://www.woniu.com/personal/showSNSCommunity?app=model/effort" onmouseover="WONIUCOMMON.clearTiker();" hidefocus="true">我的成就</a><br />','</div>','</div>','<a hidefocus="true" href="javascript:;" class="selfCenter" id="woniunav_userName" onclick="WONIUCOMMON.NAVFUN(\'menuMain\');">'+name+'</a>','<a href="http://www.woniu.com/account/logout.do" id="woniunav_logout" class="WN_menuMLOut">[退出]</a>','<span class="WN_menuMLlink WN_menuMLlinkSp"><a href="http://www.woniu.com/personal/showSNSCommunity?app=model/message">消息</a><span class="msgNum" id="woniunav_msg" onclick="window.open(\'http://www.woniu.com/personal/showSNSCommunity?app=model/message\');" style="cursor:pointer;">..</span></span>','<span class="WN_menuMLlink WN_menuMLlinkOp"><a href="http://invite.woniu.com/" target="_invite">邀请</a></span>','<span class="WN_menuMLlink"><a href="http://www.woniu.com/personal/showSNSCommunity?app=model/info">设置</a></span>','</div>','<span>&nbsp;</span>','<a href="javascript:WONIUCOMMON.NAVFUN(\'myGame\');" hidefocus="true" class="WN_total_tmp2" id="woniunav_myGame">','</a>','</div>','</div>','<div class="WN_menuMR">','<a href="http://res.woniu.com/imprest/imprest_main.html" target="_blank" class="WN_total_qlnk_payment">充值</a>','<a href="http://www.woniu.com/community/index/" hidefocus="true" class="WN_total_qlnk_community">社区</a>','<a href="http://club.woniu.com/" hidefocus="true" class="WN_total_qlnk_bbs">论坛</a>','<a id="woniunav_service" href="javascript:WONIUCOMMON.NAVFUN(\'service\')" hidefocus="true" class="WN_total_qlnk_service">客服</a>','<div id="woniunav_channel" onclick="WONIUCOMMON.NAVFUN(\'channel\');" class="fastWay">','<a hidefocus="true" class="WN_menuFastWayMore"></a>','</div>','</div>','</div>','</div>','</div>','</div>','<div class="WN_total_MenuIptKK">','<div class="WN_total_MenuIpt">','<div class="fastWay_OPt" style="display:none" id="woniunav_list" onmouseout="WONIUCOMMON.tikerClose();">','<div class="WN_optInnerAbs"></div>','<iframe onmouseover="try{WONIUCOMMON.clearTiker();}catch(e){}" class="WN_aframetwo" allowtransparency="true" scrolling="no" frameborder="0" hspace="0" src="http://resimage.woniu.com/comres/js/woniu/iframeMore.html"></iframe>','</div>','<input id="woniunav_ipt" name="" value="我要找人..." def="我要找人..." onblur="if(this.value==\'\'){this.value=this.getAttribute(\'def\');}" onfocus="if(this.value==this.getAttribute(\'def\')){this.value=\'\';}" onkeydown="WONIUCOMMON.NAV.search();" />','<a href="javascript:WONIUCOMMON.NAV.search();" hidefocus="true" class="WN_total_search"></a>','</div>','</div>','</div>','<div class="WN_total_MenuKKtwo"></div>'].join("");}},BOT:{getDOMStr:function(_cdt){return['<div class="WN_bottomKK">','<div class="WN_bottomCot">','<p class="WN_bottomCotLink"><a href="http://www.snailgame.net/" target="_blank">蜗牛公司</a> | <a href="http://www.snailgame.net/cn/gsjl.html" target="_blank">关于蜗牛</a> | <a href="http://www.snailgame.net/cn/contact.shtml" target="_blank">联系方式</a> | <a href="http://jwl.woniu.com/jwl2/index.html" target="_blank">金网络</a> | <a href="http://www.snailgame.net/cn/recruitment.shtml" target="_blank">蜗牛招聘</a> | <a href="http://res.woniu.com/support/support.html" target="_blank">客服中心</a><a class="WN_bottomLink" href="http://www.snailgame.net/" target="_blank">-苏州市蜗牛电子有限公司-</a></p>','<p class="WN_bottomCotAbout">网络文化经营许可证 文网文[2007]027号 | 苏ICP备08012323号  中华人民共和国增值电信业务经营许可证:苏B2-20080096</p>','</div>','</div>',].join("");}},getScript:function(){if(!this.script){var scripts=document.getElementsByTagName("script");var script=scripts[scripts.length-1];var src=script.getAttribute("src");if(src&&src.match(/woniuCommonNav/i)){this.script=script;}else{for(var i=0;i<scripts.length;i++){var script=scripts[i];var src=script.getAttribute("src");if(src&&src.match(/woniuCommonNav/i)){this.script=script;break;}}}}return this.script;},importCss:function(){var head=document.getElementsByTagName("head")[0];if(this.cls){var _link=document.createElement("link");_link.href=this.cls;_link.rel="stylesheet";_link.type="text/css";head.appendChild(_link);}else{var _link=document.createElement("link");_link.href="http://resimage.woniu.com/comres/js/woniu/style/style.css";_link.rel="stylesheet";_link.type="text/css";head.firstChild?head.insertBefore(_link,head.firstChild):head.appendChild(_link);}delete _link;},getCookie:function(key){var reg=new RegExp("(^| )"+key+"=([^;]*)(;|$)");var arr=document.cookie.match(reg);return arr==null?null:decodeURIComponent(arr[2]);},setCookie:function(sName,sValue,oExpires,sPath,sDomain,bSecure){var sCookie=sName+"="+encodeURIComponent(sValue);if(oExpires){sCookie+="; expires="+oExpires.toGMTString();}if(sPath){sCookie+="; path="+sPath;}if(sDomain){sCookie+="; domain="+sDomain;}if(bSecure){sCookie+="; secure";}document.cookie=sCookie;},getQuery:function(key){var reg=new RegExp("[?&]+"+key+"=([^\?&]*)[?&]?");var ret=location.search.match(reg);return ret?ret[1]:"";},checkPromot:function(){var PRMT=this.getQuery("promotParam");if(PRMT){this.setCookie("PRMT",PRMT,null,"/",".woniu.com");}},verifyIdentity:function(){var userInfo={};var D1XN_INFO=this.getCookie("userInfoSNS");if(D1XN_INFO){var info=D1XN_INFO.split(/\+&&&&/g);var time=this.getCookie("lastTime");userInfo={lastTime:time?time.split(",")[0]:null,userId:info[0],account:(info[1]),nickName:(info[2]),sex:(info[3])};};this.User={type:this.getCookie("type"),sex:userInfo["sex"],nickName:userInfo["nickName"],account:userInfo["account"],userId:userInfo["userId"],userGame:this.getCookie("userGame"),userName:this.getCookie("userName")};if(this.logStatus!=null){this.isLogin=(this.logStatus=="true"?true:false);}else{if(this.User["nickName"]||this.User["userName"]){this.isLogin=true;}}var remember=this.getCookie("remember");if(remember&&!D1XN_INFO){location.replace("http://www.woniu.com/account/login.do?service="+location.href);}},update:function(product,isLogin){debugger;product=product||this.product;isLogin=isLogin||false;var oldSe=WONIUCOMMON.$("woniunav_"+this.product);if(oldSe){oldSe.className=oldSe.className.replace(/\s+Se/,"");}var newSe=WONIUCOMMON.$("woniunav_"+product);if(newSe){newSe.className=newSe.className+" Se";}this.product=product;this.isLogin=isLogin;if(this.isLogin){this.verifyIdentity();WONIUCOMMON.$("woniunav_userName").innerHTML=(this.User.nickName||this.User.userName||"").replace(/</g,"&lt;").replace(/>/g,"&gt;");this.getGuild();this.getMessageNo();this.fillUserGame();this.shiftLogStatus("login");}else{this.shiftLogStatus("logout");}},shiftLogStatus:function(){var hide=this.allDoms;for(var i in hide){try{WONIUCOMMON.$(hide[i]).style.display="none";}catch(e){WONIUCOMMON.log(hide[i]+"隐藏->未找到");}}var show=this.isLogin?this.loginDoms:this.logoutDoms;for(var i in show){try{WONIUCOMMON.$(show[i]).style.display="";}catch(e){WONIUCOMMON.log(show[i]+"显示->未找到");}}},getGameHome:function(){var url="";var game=this.User.userGame;if(game&&game>-1){url=this.woniuGameList[game]?this.woniuGameList[game]["url"]:null;}return url;},search:function(){var ipt;try{var evt=window.event||arguments.callee.caller.arguments[0];if(evt.keyCode==13){ipt=evt.srcElement||evt.target;}}catch(ex){ipt=WONIUCOMMON.$("woniunav_ipt");}if(ipt){var name=ipt.value.replace(/^\s+|\s+$/g,"");if(name&&name.indexOf("我要找人")<0){ipt.focus();window.open("http://hi.woniu.com/home/search.html?searchStyle=exact&nickName="+name,"_new");}else{window.open("http://hi.woniu.com/home/search.html","_new");}}},scriptRequest:function(src,cb){var script=document.createElement("script");script.type="text/javascript";if(this.isIE){script.onreadystatechange=function(){if(script.readyState=="complete"||script.readyState=="loaded"){if(cb){try{cb();}catch(e){}}script.parentNode.removeChild(script);}};}else{script.onload=function(){if(cb){try{cb();}catch(e){}}script.parentNode.removeChild(script);};};script.src=src;document.getElementsByTagName("head")[0].appendChild(script);},getMessageNo:function(){if(this.User.userId){this.scriptRequest("http://hi.woniu.com/newuser/newmessage.do?m=jsQuery&jsback=WONIUCOMMON.NAV.fillMsgInfo&userId="+this.User.userId+"&t="+(new Date().getTime()));}},fillMsgInfo:function(msgs){var n=0;if(msgs){for(var i in msgs){n+=parseInt(Number(msgs[i]));}}if(n>0){WONIUCOMMON.$("woniunav_msg").innerHTML=n;}else{WONIUCOMMON.$("woniunav_msg").innerHTML="0";}WONIUCOMMON.$("woniunav_msg").style.display="";if(window.fillMsgInfo){window.fillMsgInfo(msgs);}},fillUserGame:function(){var game=this.User.userGame;if(game&&game>-1){var gameName=this.woniuGameList[game]?this.woniuGameList[game]["name"]:null;if(!gameName){try{if(!woniuGameList)throw"notLoad";var gameName="";for(var i=0;i<woniuGameList.length;i++){if(woniuGameList[i]["id"]==game){gameName=woniuGameList[i]["name"];break;}}}catch(e){this.scriptRequest("http://hi.woniu.com/res/public/commonRes/dictionary/woniuGame.js",function(){WONIUCOMMON.NAV.fillUserGame();});}}WONIUCOMMON.$("woniunav_myGame").innerHTML=gameName;}},init:function(){this.product=this.getScript().getAttribute("product")||this.product||"index";this.noFoot=(this.getScript().getAttribute("noFoot")=="true"?true:false);this.csu=this.getScript().getAttribute("csu")||"";this.cls=this.getScript().getAttribute("cls")||"";this.noCls=(this.getScript().getAttribute("noCls")=="true"?true:false);this.delay=(this.getScript().getAttribute("delay")=="true"?true:false);this.logStatus=(this.getScript().getAttribute("logStatus"));if(!this.noCls){this.importCss();}this.checkPromot();this.verifyIdentity();this.isIE?document.attachEvent("onclick",WONIUCOMMON.closeAllList):window.addEventListener("click",WONIUCOMMON.closeAllList,false);if(this.delay){WONIUCOMMON.NAV.isIE?(function(){document.attachEvent("onreadystatechange",function(){if(document.readyState=="complete"||document.readyState=="loaded"){WONIUCOMMON.NAV.render();}});}()):document.addEventListener("DOMContentLoaded",function(){WONIUCOMMON.NAV.render();},false);}else{this.render();}},getGuild:function(){if(this.isLogin){var guild=this.getCookie("GI_"+this.User["userId"]);if(guild&&guild!=","){var tmp=guild.split(",");guild={"guildDomain":tmp[0],"guildName":tmp[1]}}(guild)?this.fillGuild(guild):this.scriptRequest("http://hi.woniu.com/newuser/guild.do?account="+this.User["account"]+"&jsback=WONIUCOMMON.NAV.fillGuild"+"&t="+(new Date().getTime()));}},fillGuild:function(guild){if(!guild["guildDomain"]||!guild["guildName"]){return;};this.Guild=guild;var guildBtn=WONIUCOMMON.$("woniunav_consortia");guildBtn.href="http://gh.woniu.com/"+guild["guildDomain"];guildBtn.innerHTML="我的公会";this.setCookie("GI_"+this.User["userId"],[guild["guildDomain"],guild["guildName"]].join(","),null,"/","woniu.com");},render:function(){var _top=NAVFUN.topCotId?WONIUCOMMON.$(NAVFUN.topCotId):document.createElement("div");_top.className="WN_total";_top.innerHTML=this.TOP.getDOMStr(this.product,this.User,this.csu);document.body.insertBefore(_top,document.body.firstChild);delete _top;if(!this.noFoot){var _bot=NAVFUN.botCotId?WONIUCOMMON.$(NAVFUN.botCotId):document.createElement("div");_bot.className="WN_bottom";_bot.innerHTML=this.BOT.getDOMStr(this.product);document.body.appendChild(_bot);delete _bot;}if(this.isLogin){this.getMessageNo();this.fillUserGame();}this.shiftLogStatus();},initTopBar:function(nickName,isLogin,columnName,myId,scrollFlag){}};initTopBar=function(nickName,isLogin,columnName,myId,scrollFlag){};WONIUCOMMON.NAV.init();