function GetCookie(sName) { var aCookie = document.cookie.split("; "); for (var i=0; i < aCookie.length; i++) { var aCrumb = aCookie[i].split("="); if (sName == aCrumb[0]) { return aCrumb[1]; } } return null; } function SetCookie(name, value, time, domain) { var expdate = new Date(); var expires = time; if(expires!=null){ expdate.setTime(expdate.getTime() + ( expires * 1000 )); expd = "expires="+expdate.toGMTString()+";"; }else expd = ""; if (domain) { domain = "domain="+ domain +"; path=/; "; } document.cookie = name + "=" + escape (value) + "; " + expd + domain; } var cookieTag = "Crystal_skin"; var vSkin = GetCookie(cookieTag); function setSkinColor(vSkinNum) { SetCookie( cookieTag, vSkinNum, 60*60*24*30,"cnwest.com"); document.getElementById("skinCss").href = "images/1.files/css_"+vSkinNum+".css"; } if( vSkin && vSkin!="Style" ) { document.getElementById("skinCss").href = "images/1.files/css_"+vSkin+".css"; } //mname=标题的id,csson=鼠标滑上的样式,cssout=离开的样式,obj=div框的id,id=当前的菜单编号,num=菜单总个数 //其中mname,obj不包含id值,如4个菜单第一个1是title1,div为div1则 c_tab("title","","","div",1,4) function c_tab(mname,csson,cssout,obj,id,num) { for(var i=1;i<=num;i++) { menu=eval(""+obj+i); m=eval(""+mname+i); if(i==id) { menu.style.display=""; m.className=csson; } else { menu.style.display="none"; m.className=cssout; } } } $=function(id){ return document.getElementById(id); } //转换字号 function doZoom(size){ if(size==12){ $("contentText").style.fontSize = size + "px"; $("fs12").style.display = ""; $("fs14").style.display = "none"; $("fs16").style.display = "none"; } if(size==14){ $("contentText").style.fontSize = size + "px"; $("fs12").style.display = "none"; $("fs14").style.display = ""; $("fs16").style.display = "none"; } if(size==16){ $("contentText").style.fontSize = size + "px"; $("fs12").style.display = "none"; $("fs14").style.display = "none"; $("fs16").style.display = ""; } } function copyLink(){ try { var cText = document.location.toString(); if (window.clipboardData) { window.clipboardData.setData("Text", cText); alert("复制完成!"); } else if (window.netscape) { try { netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect"); } catch (e) { alert("您的浏览器设置为不允许复制!\n如果需要此操作,请在浏览器地址栏输入'about:config'并回车\n然后将'signed.applets.codebase_principal_support'设置为'true',再重试复制操作!"); return false; } var clip = Components.classes['@mozilla.org/widget/clipboard;1'].createInstance(Components.interfaces.nsIClipboard); if (!clip) return; var trans = Components.classes['@mozilla.org/widget/transferable;1'].createInstance(Components.interfaces.nsITransferable); if (!trans) { return; } trans.addDataFlavor('text/unicode'); var str = new Object(); var len = new Object(); var str = Components.classes["@mozilla.org/supports-string;1"].createInstance(Components.interfaces.nsISupportsString); str.data = cText; trans.setTransferData("text/unicode", str, cText.length * 2); var clipid = Components.interfaces.nsIClipboard; if (!clip) return false; clip.setData(trans, null, clipid.kGlobalClipboard); alert("复制完成!"); } } catch (e) { } }