window.Passport={"IsVip":false,"IsAnJianSchoolGroup":false,"IsRenZheng":false,"UserId":0,"UserName":null,"UserPwd":null,"AvatarURL":"http://userapi.anjian.com/uc_server/avatar.php?uid=0","LevelInfo":null,"MemberInfo":null,"SoftVerInfo":null,"LevelNumsByRz":0,"IsLogin":null}; document.domain="anjian.com"; (function(){ function addEvent(o,e,f){o.addEventListener?o.addEventListener(e,f,false):o.attachEvent("on" + e,f)} var d=document,b=d.body,de=d.documentElement,loginDiv=0,bgDiv=0,ifr=0,borderDiv=0,isIE6 = navigator.userAgent.indexOf("MSIE 6.0") > -1,s=0,md=100000; var logoutURL="http://act.anjian.com/Login/Logout.aspx"; var loginURL="http://act.anjian.com/Login/LoginUI/V1/FastLoginIfr.aspx"; var currURL=location.protocol+"//"+location.host+location.pathname+location.search; var styleIndex=1,styleApp=""; window.UFastLoginOnPageLoad=function(){ }; window.UFastLoginOnPageHeadLoad=function(){ if(styleApp)$(ifr.contentWindow.document.head).prepend(styleApp); }; //显示快速登录框 //styleSet:1默认样式,具体的样式标签的HTML代码(如style标签,或如link标签) window.UShowFastLogin=function(succeedBackFnName,styleSet) { b=d.body; if(!loginDiv){ loginDiv=d.createElement("div"); loginDiv.id="FastLoginDiv"; loginDiv.style.cssText="position:fixed;_position:absolute;width:200px;height:100px;padding:0;margin:0;top:50%;left:-9999px;margin:-50px 0 0 -100px;z-index:9999;visibility:hidden;"; loginDiv.innerHTML='
' +''; b.insertBefore(loginDiv,b.firstChild); bgDiv=document.createElement("div"); bgDiv.style.cssText="position:fixed;_position:absolute;width:100%;height:100%;top:0;left:0;z-index:8888;display:none;background:#000;filter:alpha(opacity=30);opacity:0.3;"; b.insertBefore(bgDiv,b.firstChild); ifr=document.getElementById("FastLoginIfr"); borderDiv=document.getElementById("FastLoginBorder"); if(isIE6){ addEvent(window,"scroll",RePosFastLogin); addEvent(b,"scroll",RePosFastLogin); addEvent(window,"resize",RePosFastLogin); } } styleApp=""; switch(typeof(styleSet)){ case "string": styleIndex=0;styleApp=styleSet; break; case "number": styleIndex=stringSet; break; default: styleIndex=1; break; } ifr.src=loginURL+"?SourceURL="+encodeURIComponent(currURL)+"&OptStyle="+styleIndex+"&SucceedBackFn="+encodeURIComponent(succeedBackFnName) +"&CloseFn=UCloseFastLogin&ResizeFn=UResizeFastLogin&PageHeadLoadBackFn=UFastLoginOnPageHeadLoad&PageLoadBackFn=UFastLoginOnPageLoad"; bgDiv.style.display = "block"; s=1; RePosFastLogin(); } //重新调整快速登录框的尺寸 window.UResizeFastLogin=function(){ if (s&&loginDiv) { var height = Math.max(ifr.contentWindow.document.body.scrollHeight||300,ifr.contentWindow.document.documentElement.scrollHeight||300); var width = Math.max(ifr.contentWindow.document.body.scrollWidth||300,ifr.contentWindow.document.documentElement.scrollWidth||300); //重新设置大小注意,一定要加px,否则firefox下有问题 loginDiv.style.width = width + "px"; loginDiv.style.height = height + "px"; //最好重新调整登录框的位置, 这儿略.... //先隐藏,在显示,这样可以避免滚动条的出现 loginDiv.style.visibility = "hidden"; loginDiv.style.visibility = "visible"; loginDiv.style.marginLeft = "-"+parseInt(width/2) + 'px'; loginDiv.style.marginTop = "-"+parseInt(height/2) + 'px'; RePosFastLogin(); } } //关闭快速登录框 window.UCloseFastLogin=function(){ if (loginDiv) { loginDiv.style.left = "-9999px"; bgDiv.style.display = "none"; s=0; } } //注销 window.ULogoutAjax=function(backFn){ var fr=$('').prependTo(d.body) .ready(function(){window.Passport=null;if(backFn)backFn()}).attr("src",logoutURL+"?NoJump=1"); }; window.ULogout=function(returnURL){ returnURL=returnURL||location.href; window.location=logoutURL+"?ReturnURL="+escape(returnURL); }; //重新调整快速登录框的位置 function RePosFastLogin(){ if (s&&loginDiv) { if(isIE6){ bgDiv.style.width = Math.min(Math.min(de.scrollWidth||md, b.scrollWidth||md), Math.min(de.offsetWidth||md, b.offsetWidth||md)) + "px"; bgDiv.style.height = Math.max(Math.max(de.scrollHeight, b.scrollHeight), Math.max(de.offsetHeight, b.offsetHeight)) + "px"; loginDiv.style.left = parseInt(Math.max(de.scrollLeft, b.scrollLeft)+de.clientWidth/2)+"px"; loginDiv.style.top = parseInt(Math.max(de.scrollTop, b.scrollTop)+de.clientHeight/2)+"px"; }else{ loginDiv.style.left = "50%"; } } } })();