var cookie_prefix = 'cxgt_'; var Cookies = { get : function(name) { var arg = cookie_prefix + name + "="; var alen = arg.length; var clen = document.cookie.length; var i = 0; var j = 0; while (i < clen) { j = i + alen; if (document.cookie.substring(i, j) == arg) return Cookies.getCookieVal(j); i = document.cookie.indexOf(" ", i) + 1; if (i == 0) break; } return ""; }, getCookieVal : function(offset) { var endstr = document.cookie.indexOf(";", cookie_prefix + offset); if (endstr == -1) { endstr = document.cookie.length; } return unescape(document.cookie.substring(cookie_prefix + offset, endstr)); } }; //读取cookies function getCookie(name) { var arr, reg = new RegExp("(^| )" + name + "=([^;]*)(;|$)"); if (arr = document.cookie.match(reg)) return unescape(arr[2]); else return null; } var islogin = ""; var fid = ""; var uid = ""; var nickname = ""; if('' != null && '' != ""){ islogin = true; } var globalhead = { siteTile : "北京文化艺术在线学习空间", uid : "", member :function(){ return { role:"", uid:"", nickname:"", username:"", depart:"", ak:"" } }, format : function(){ globalhead.loginUrl = globalhead.formatUrl("http://www.bjszwhg.org.cn/login" + escape(window.location.href)); if('http://www.bjszwhg.org.cn/login' == ''){ globalhead.loginUrl = "//passport-xuexi.bjszwhg.org.cn/?backurl=" + escape(window.location.href); } globalhead.iUrl = globalhead.formatUrl("http://i-xuexi.bjszwhg.org.cn"); globalhead.photoUrl = globalhead.formatUrl("http://photo-xuexi.bjszwhg.org.cn"); globalhead.indexUrl = globalhead.formatUrl("https://www.bjszwhg.org.cn/"); globalhead.videoUrl = globalhead.formatUrl("http://video-xuexi.bjszwhg.org.cn"); globalhead.bookUrl = globalhead.formatUrl("http://book-xuexi.bjszwhg.org.cn"); globalhead.courseUrl = globalhead.formatUrl("http://course-xuexi.bjszwhg.org.cn"); globalhead.loginout = "//passport-xuexi.bjszwhg.org.cn/logout.shtml?backurl=" + escape(window.location.href); }, formatUrl : function(url){ if(url.indexOf('//') == 0){ return url; } return '//' + url; }, show : function(id){ document.getElementById(id).style.display = 'block'; }, hide : function(id){ document.getElementById(id).style.display = 'none'; }, left : function(){ var html = ['