/* 作者:李永华 liyh@hainan.net 日期:2007-8-16 功能:实现天涯需要顶侧导航 用法:直接js调用 参数:无 修改:陈南杰 chennj@hainan.net 修改日期:2007-10-26 */ if (navigator.userAgent.indexOf('Opera') >= 0) { //opera浏览器调用原来的代码, document.write(""); } else { function getCookie_ByTopGuide(name){ var dc = document.cookie; var prefix = name + "="; var begin = dc.indexOf("; " + prefix); if (begin == -1){ begin = dc.indexOf(prefix); if (begin != 0) return null; }else{ begin += 2; } var end = document.cookie.indexOf(";", begin); if (end == -1){ end = dc.length; } return unescape(dc.substring(begin + prefix.length, end)); } function getUniqueId_ByTopGuide(){ var base = getCookie_ByTopGuide("base"); if(base==null) return null; else{ var temp = base.split('&')[1]; var uqid = temp.substring(temp.indexOf('=')+1,temp.length); return uqid; } } function getRegionId_ByTopGuide(){ var base = getCookie_ByTopGuide("base"); if(base==null) return null; else{ var temp = base.split('&')[0]; var dtid = temp.substring(temp.indexOf('=')+1,temp.length); return dtid; } } function getUserName_ByTopGuide(){ var user = getCookie_ByTopGuide("user"); if(user==null) return null; else{ var temp = user.split('&')[0]; var userName = temp.substring(temp.indexOf('=')+1,temp.length); return userName; } } function getUserId_ByTopGuide(){ var user = getCookie_ByTopGuide("user"); if(user==null) return 0; else{ var temp = user.split('&')[1]; var userId = temp.substring(temp.indexOf('=')+1,temp.length); return userId; } } function getKey_ByTopGuide(){ var temp = getCookie_ByTopGuide("temp"); if(temp==null) return 0; else{ var temp1 = temp.split('&')[0]; var key = temp1.substring(temp1.indexOf('=')+1,temp1.length); return key; } } function getCookie_TimeByTopGuide(){ var temp = getCookie_ByTopGuide("temp"); if(temp==null) return 1000000000; else{ var temp1 = temp.split('&')[2]; var cookieTime = temp1.substring(temp1.indexOf('=')+1,temp1.length); return cookieTime; } } var key_ByTopGuide=getKey_ByTopGuide(); var idwriter_ByTopGuide=getUserId_ByTopGuide(); var aParams = document.location.search.substr(1).toLowerCase().split('&'); var QueryLen=aParams.length; var QueryString=""; var startFlag=true; var myHref=""; //过滤aParams中包含的idwriter和key并重新组装这个查询串 for(var i=0;i0 || myHref.indexOf("info.tianya.cn")>0))//content,info页面不需要包含左侧导航, { myHref=encodeURIComponent(myHref); myHref="index.htm@vitem="+myHref; } document.write(''); document.write('
'); var LoginFun=new function() { this.loginDivState=false; this.Opacity=0; this.Div=""; this.LoginDiv=""; this.timer; this.maxOpacity=60;//alpha值 this.delay=10;//延迟效果时间ms this.stepOpacity=10;//每次效果alpha增减值 this.Iframe; this.showTopLoginDiv=function(_e,tipStr) { if(document.getElementById("tianyaTopGuideIframe")==null) { var iframe = document.createElement("IFRAME"); iframe.id = "tianyaTopGuideIframe"; iframe.style.position = "absolute"; iframe.style.left = 0; iframe.style.top = 0; iframe.style.width = (document.body.scrollWidth>document.body.offsetWidth)?document.body.scrollWidth:document.body.offsetWidth; iframe.style.height = (document.body.scrollHeight>document.body.offsetHeight)?(document.body.scrollHeight+20):document.body.offsetHeight; this.Iframe = iframe; var div = document.createElement("DIV"); div.id = "tianyaTopGuideDiv"; div.style.position = "absolute"; div.style.left = 0; div.style.top = 0; div.oncontextmenu = function() { return false; } div.onselectstart = function() { return false; } this.Div = div; var div2 = document.createElement("DIV"); div2.id = "tianyaTopGuideLoginDiv"; div2.style.position = "absolute"; div2.style.top = (document.body.scrollTop)+parseInt(document.body.clientHeight)/2-100; div2.style.left = document.body.scrollLeft+parseInt(document.body.clientWidth)/2-200; this.LoginDiv=div2; div2.oncontextmenu = function() { return false } document.body.appendChild(iframe); document.body.appendChild(div); document.body.appendChild(div2); } else { this.Div = document.getElementById("tianyaTopGuideDiv"); this.LoginDiv=document.getElementById("tianyaTopGuideLoginDiv"); this.Iframe = document.getElementById("tianyaTopGuideIframe"); this.Iframe.style.display = "block"; this.Div.style.display = "block"; this.LoginDiv.style.display = "block"; this.LoginDiv.innerHTML = tipStr; } this.Div.style.width=document.body.scrollWidth; this.Div.style.height=document.body.scrollHeight; this.LoginDiv.innerHTML = tipStr; this.timer=window.setInterval("LoginFun.showByStep()",this.delay);//在此不能使用this.showByStep(), var l = document.body.scrollLeft; var t = document.body.scrollTop; document.body.style.overflow = "hidden"; document.body.scrollLeft = l; document.body.scrollTop = t; }; this.showByStep=function() { if(this.Opacity == this.maxOpacity) { window.clearInterval(this.timer); return; } this.Opacity=(this.Opacity + this.stepOpacity) > this.maxOpacity ? this.maxOpacity :this.Opacity + this.stepOpacity; this.Div.style.filter = "Alpha(Opacity= " + this.Opacity + ")"; this.Div.style.opacity=parseInt(this.Opacity)/100; }; this.hiddenTopLoginDiv=function() { this.loginDivState=false; document.body.style.overflow='auto'; this.timer=window.setInterval("LoginFun.hiddenByStep()",this.delay); }; this.hiddenByStep=function() { if(this.Opacity == 0) { window.clearInterval(this.timer); this.Iframe.style.display='none'; this.Div.style.display='none'; this.LoginDiv.style.display='none'; return; } this.Opacity = (this.Opacity - this.stepOpacity) < 0 ? 0: this.Opacity - this.stepOpacity; this.Div.style.filter = "Alpha(Opacity=" + this.Opacity + ")"; this.Div.style.opacity = parseInt(this.Opacity)/100; }; this.ForbidScrolling=function() { document.body.scrollTop=0; }; this.Login=function(_e) { this.showTopLoginDiv(_e,'
社区登录

用户名:
密 码:
我是新人,立即注册

'); }; } //window.onscroll = LoginFun.ForbidScrolling; }