//开头加;号是防止前一个js末行代码未加;结束 ;if(!window._addIvyID) document.write(' */ var pconline = { getId : function(objName){if(document.getElementById){return eval('document.getElementById("'+objName+'")')}else{return eval('document.all.'+objName)}}, addEvent : function(obj,eventType,func){if(obj.attachEvent){obj.attachEvent("on" + eventType,func);}else{obj.addEventListener(eventType,func,false)}}, delEvent : function(obj,eventType,func){ if(obj.detachEvent){obj.detachEvent("on" + eventType,func)}else{obj.removeEventListener(eventType,func,false)} } }; function LoginSelectClickOther(e){ thisObj = e.target?e.target:event.srcElement; do{ if(thisObj.id == "loginselect") return; if(thisObj.tagName == "BODY"){LoginSelectClose();return;}; thisObj = thisObj.parentNode; }while(thisObj.parentNode); }; function clickLoginSelect(){ if(pconline.getId("loginopt").style.display == "block"){ LoginSelectClose(); }else{ pconline.getId("loginopt").style.display = "block"; pconline.addEvent(document.body,"mousedown",LoginSelectClickOther); } }; function LoginSelectClose(){ pconline.getId("loginopt").style.display = "none"; pconline.delEvent(document.body,"mousedown",LoginSelectClickOther); }; function LoginSelect(title){ var titleName; switch(title){ case "pcclub": titleName = "PCclub"; document.loginform.direction.value="PCclub"; document.loginform.action="//passport2.pconline.com.cn/passport2/passport/login.jsp"; break; case "company": titleName = "商家"; document.loginform.direction.value="商家"; document.loginform.action="//eyp.pconline.com.cn/member/login.htm"; break; }; pconline.getId("loginselectdis").innerHTML = titleName; LoginSelectClose(); }; function ajaxLogon() { if(document.getElementById('ajaxLogon') == null) return; document.getElementById('ajaxLogon').innerHTML= //-----未登录 ''+ '
'+ ' '+ ' '+ ''+ //'
'+ //'选择去向'+ //''+ //'
'+ ' '+ '
'+ //-----已登录 '
'+( //* location.host.match(/pconline/)?'太平洋社区': location.host.match(/pcauto/)?'博客管理 ': location.host.match(/pcgames/)?'jClub管理': location.host.match(/pclady/)?'博客管理': location.host.match(/pckids/)?'博客管理': /**/ '')+'帐号管理 退出'+ '
' //以下是雅黑字体功能: ;//+''; var ajaxLogonHasYaHei = typeof dlgHelper!='object'; if(!ajaxLogonHasYaHei) for(var i = dlgHelper.fonts.count-1; i>0; i--) { if(dlgHelper.fonts(i) == '微软雅黑') { ajaxLogonHasYaHei = true; break; } } if(ajaxLogonHasYaHei) { //ajaxLogonYaHei(); /* document.getElementById('ajaxLogon').innerHTML+='  雅黑?'; */ } } ajaxLogon();//main function ajaxLogonYaHei(toggle) { var yahei = !!document.cookie.match(/(^|; )YaHei=/); if(toggle) { yahei = !yahei; jQuery.cookie('YaHei', '1', {expires:yahei?999:-1,path:'/',domain:location.hostname.replace(/^\w+/,'')}); } document.body.style.fontFamily = yahei ? '微软雅黑' : ''; try { if(window!=top) top.document.body.style.fontFamily = yahei ? '微软雅黑' : ''; } catch(e) {} } function ajaxLogonRefresh() { if(!document.cookie.match(/(^|; )common_session_id=[^;]+/) != !jQuery('#ajaxLogon>span:last:visible').length) jQuery('#ajaxLogon>span')//.toggle() 改成下面一行以绕开jquery1.3.2的toggle在这里失效的BUG .each(function(){var a=$(this); if(a.css('display')=='none') a.show(); else a.hide(); }); } function jQueryLoaded4Logon() { var $ = jQuery; $('#ajaxLogon form').append('') .submit(function(){ var usr = this['username'].value, pwd = this['password'].value; if(usr==''||pwd=='') { alert('请填写用户名和密码'); return false; } var direction = this['direction'].value; if(direction=='') { alert('请选择去向'); return false; } if(this.action.match(/member/)) return; //商家 $('input[type=submit]',this).css('opacity',.5).attr('disabled',true); this.target='pconline_login'; var win=window.open('','pconline_login','height=1, width=1, top=9999, left=0, toolbar=no, menubar=no, scrollbars=no,resizable=no,location=no, status=no'); window.focus(); var time=0; var fm = this; var checker = setInterval(function(){ if(time++ < 600 && !win.closed) return; clearInterval(checker); if(win.closed) { if(document.cookie.match(/(^|; )common_session_id=[^;]+/)) ajaxLogonRefresh(); else alert('登录失败! 请检查帐号和密码是否正确。'); } else { win.close(); alert('登录超时失败,请检查网络状况并再试一次。'); } $('input[type=submit]',fm).css('opacity',1).attr('disabled',false); },100); //$.getScript(this.action+(this.action.match(/\?/)?"&":"?")+"username=" +usr+"&password="+pwd, ajaxLogonRefresh); }); /**/ } setTimeout(function(){ if(typeof jQuery!='undefined') return jQueryLoaded4Logon(); var $_already_defined = typeof $ != 'undefined'; needJS(window.jQuery,'//www1.pconline.com.cn/js/pc.jquery1.3.js',function(){ if($_already_defined) $ = jQuery.noConflict(); jQueryLoaded4Logon(); }); },1000); //等1秒,先显示页面其它内容 function needJS(fn,src,callback) { if(typeof callback != 'function') return; //非法回调函数 if(typeof fn != 'undefined' && fn != null && fn != '') return callback(false); //功能早已载入 var scripts = window.__needJS__ || (window.__needJS__ = []); var script = scripts[src] || (scripts[src] = {loaded:false,callbacks:[]}); if(script.loaded) return callback(false); else script.callbacks.push(callback); if(script.callbacks.length == 1) { var js = document.createElement('script'); js.src = src; js.onreadystatechange = js.onload = function() { if(!js.readyState || js.readyState == 'loaded' || js.readyState == 'complete') { script.loaded = true; for(var i=0; i