// --------------------------------------------------------------------- // init value var expandState=0; //0=隐藏 ,1=打开 // var isLogin = isLoginTemp; //0=没有登录,1登录 var isVip = 0; var url = 'http://passport.yesky.com/cas/login?service=http%3A%2F%2Fwww.ctocio.com.cn&furl=http%3A%2F%2Fcheck.ctocio.com.cn%2Ftechtarget%2Flogin.jsp%3Fsitsid=2%26service=http%3A%2F%2Fwww.ctocio.com.cn%26fail=true'; var userphoto=userphoto; var userprovince=userprovince; var usercity=usercity; var menuWebInfoTextStr = 'IT专家网^IT社区'; var menuWebInfoLinkStr = 'http://www.ctocio.com.cn^http://club.ctocio.com.cn/index.html'; var menuWebInfoTextArray; var menuWebInfoLinkArray; var webInfoLoginStr = ''; var webInfoLogoutStr = ''; if (menuWebInfoTextStr != '' && menuWebInfoLinkStr != '') { menuWebInfoTextArray = menuWebInfoTextStr.split('^'); menuWebInfoLinkArray = menuWebInfoLinkStr.split('^'); } if(leftgetCookie("leftLoginCookie")!=null){ expandState=leftgetCookie("leftLoginCookie"); } // --------------------------------------------------------------------- // creat shell // ------------------------------ function creatMenuShell(id_str,z_num,w_num,h_num){ var temp_str=''; return temp_str } function creatTitleLink(title_str,link_str){ var temp_str='
' +'> ' +title_str +'
'; return temp_str; } function creatLabelLink(title_str,link_str){ var temp_str='
' +'·' +title_str +'
'; return temp_str; } // ------------------------------ // menu action var menuAction_str='' +'' +'
' +'' +'
' // ------------------------------ // menu login var menuLogin_str = '' +'' +'' +'' +'' +'
用户登录' +'' +'
' +'' +'' +'
' +'' +'' +'
' +'
' +'' +'' +'' +'' +'
' +'用户名' +'' +'
' +'密 码' +'' +'
' +' ' +'
' /*+'    记住用户名
'*/ +'    永久登录' +'
' +'' +'' +'' +'' +'
' +'[注册] ' +'[忘记密码]' +'
'; //增加广告[Sunny Zhao 2003-3-23] menuLogin_str += '
'; if (menuWebInfoTextArray.length > 0 && menuWebInfoLinkArray.length == menuWebInfoTextArray.length) { for(var index=0;index' + menuWebInfoTextArray[index] + ''; } } menuLogin_str += '
' // +'' +'
' +'
'; // ------------------------------ // menu logout var menuLogout1_str='' +'' +'' +'
' +'' +'' +'' +'
欢迎回来' +'' +'
' +'
' +'
' +'
' +'
'+nickname+'
'+userprovince+'/'+usercity+'' +'
'; var menuLogout2_str='
' +'' +'' +'' +'' +'
' +'[注 销]' +'
'; //增加广告[Sunny Zhao 2003-3-23] menuLogout2_str += '
'; if (menuWebInfoTextArray.length > 0 && menuWebInfoLinkArray.length == menuWebInfoTextArray.length) { for(var index=0;index' + menuWebInfoTextArray[index] + ''; } } menuLogout2_str += '
' // --------------------------------------------------------------------- // init menu var creatLeftMenu_obj; function leftMenuInit(){ document.write((creatMenuShell('leftMenuMaster','115',10,10))+''); creatLeftMenu_obj=setInterval(function(){ if(document.getElementById("leftMenuMaster")!=null){ if(expandState == 1){ if(isLogin==1){ document.getElementById("leftMenuMaster").innerHTML=menuLogout1_str+creatLogMenu()+menuLogout2_str; }else{ document.getElementById("leftMenuMaster").innerHTML=menuLogin_str; } }else{ document.getElementById("leftMenuMaster").innerHTML=menuAction_str; } clearInterval(creatLeftMenu_obj); leftMenuScroll(); } },300); } leftMenuInit(); // --------------------------------------------------------------------- // init menu window.scrollBy(0,1); var leftMenuBodyBase_obj=(document.documentElement.scrollTop>document.body.scrollTop?document.documentElement:document.body); var leftMenuPageScroll_num=leftMenuBodyBase_obj.scrollTop; function leftMenuScroll(){ if(document.getElementById("leftMenuMaster")!=null){ document.getElementById("leftMenuMaster").style.top=leftMenuBodyBase_obj.scrollTop+'px'; document.getElementById("leftMenuMaster").style.left=leftMenuBodyBase_obj.scrollLeft+'px'; } } // on Scroll if(scrollList_array!=null){ scrollList_array.push(leftMenuScroll); }else{ var scrollList_array=new Array(); scrollList_array.push(leftMenuScroll); setInterval(function(){ for(var loops in scrollList_array){ scrollList_array[loops](); } },50); } // --------------------------------------------------------------------- // public method function leftsetCookie(name, value, expires, path, domain, secure) { var expdate = new Date(); expdate.setTime (expdate.getTime() + (86400 * 1000 * 31)); var curCookie = name + "=" + escape(value) + "; expires=" + expdate.toGMTString() + "; path=/" + "; domain=hexun.com" document.cookie = curCookie } function leftgetCookie(name) { var prefix = name + "=" var cookieStartIndex = document.cookie.indexOf(prefix) if (cookieStartIndex == -1) return null var cookieEndIndex = document.cookie.indexOf(";", cookieStartIndex + prefix.length) if (cookieEndIndex == -1) cookieEndIndex = document.cookie.length return unescape(document.cookie.substring(cookieStartIndex + prefix.length, cookieEndIndex)) } function expand(){ if(expandState == 0){ leftsetCookie("leftLoginCookie","1"); if(document.getElementById("leftMenuMaster")!=null){ if(isLogin==1){ document.getElementById("leftMenuMaster").innerHTML=menuLogout1_str+menuLogout2_str; }else{ document.getElementById("leftMenuMaster").innerHTML=menuLogin_str; } } expandState=1; } else{ leftsetCookie("leftLoginCookie","0"); document.getElementById("leftMenuMaster").innerHTML=menuAction_str; expandState=0; } } function expandOfLog(get_str){ if(get_str!=null&&isLogin==1){ document.getElementById("leftMenuCT").innerHTML=creatLogMenu(get_str); } } function CheckHWLoginForm(){ if(HWLoginForm.username.value==''){ alert('请填写用户名!'); HWLoginForm.username.focus(); return false; }else if(HWLoginForm.password.value==''){ alert('请填写密码!'); HWLoginForm.password.focus(); return false; } //document.HWLoginForm.submit(); } function Click_Name(){ if(document.HWLoginForm.LoginStateName.checked == true) { alert("选中可能产生密码安全问题,建议仅限于非公共场所使用。"); document.HWLoginForm.LoginStateAuto.checked = false; } } function Click_Auto(){ if(document.HWLoginForm.LoginStateAuto.checked == true){ alert("选中可能产生密码安全问题,建议仅限于非公共场所使用。"); document.HWLoginForm.LoginStateName.checked = false; } } function delay() { window.setTimeout("renovate()",6000); return false; } function renovate() { window.location.reload(); }