<!--
(function(){var a=document.getElementsByTagName("script");
var scriptfile=a[a.length-1];
if(scriptfile.parentNode!=document.body){
 if(scriptfile.parentNode.style.display=="none"){
  scriptfile.parentNode.style.display="";
 }
}
})();
if(typeof iCast_Rotator!='function'){iCast_Rotator=function(o,l,w){var f;this.o=o;this.j=l;this.v=this.o==1?l:w;this.id=iCast_Rotator.id++;this.m='iCast_Rotator_'+this.id;this.n=[];this.L=new Date();this.e=0;var D=false;for(var i=0;i<this.o;i++){f=this.m+'_'+(i+1);g=iCast_Rotator.B(f);if(g!=''){this.n[i]=g;D=true;}else{this.n[i]=0;}}if(!D){var r=Math.ceil(Math.random()*this.o);var t=this.m+'_'+r;iCast_Rotator.P(t,this.L.getTime(),1440);this.e=r;return r;}else{var R=this.n.join(',').split(',');var k=R.sort();var max=Number(k[k.length-1]);var min=Number(k[0]);for(var i=0;i<this.n.length;i++){if(max==this.n[i]){F=i+1;break;}}if(typeof F!='undefined'){G=this.m+'_'+F;H=Number(iCast_Rotator.B(G));K=new Date(H+this.v*1000*60);M=new Date(min+this.j*1000*60);if(this.L>M&&this.L>K){I=F%this.o+1;J=this.m+'_'+I;iCast_Rotator.P(J,this.L.getTime(),1440);this.e=I;return I;}else{this.e=0;return 0;}}}};iCast_Rotator.id=1;iCast_Rotator.B=function(N){var c=document.cookie.split("; ");for(var i=0;i<c.length;i++){var d=c[i].split("=");if(N==d[0])return unescape(d[1]);}return '';};iCast_Rotator.P=function(N,O,Q){var L=new Date();var z=new Date(L.getTime()+Q*60000);document.cookie=N+"="+escape(O)+"; path=/; expires="+z.toGMTString()+";";}};


//复制网址
function CopyToClipBoard(){
	var clipBoardContent=''; 
	clipBoardContent+="《"+articlename+"》"+"在线阅读网址:";
	clipBoardContent+=window.location;
	window.clipboardData.setData("Text",clipBoardContent);
	alert("你已复制链接及标题，请粘贴到POPO/MSN/QQ等发给好友!");
}

//设为主页 
function SetHome(obj, vrl) {   
    try {   
        obj.style.behavior = 'url(#default#homepage)';   
        obj.setHomePage(vrl);   
    } catch (e) {   
        if (window.netscape) {   
            try {   
                netscape.security.PrivilegeManager   
                        .enablePrivilege("UniversalXPConnect");   
            } catch (e) {   
                alert("此操作被浏览器拒绝！\n请在浏览器地址栏输入“about:config”并回车\n然后将 [signed.applets.codebase_principal_support]的值设置为'true',双击即可。");   
            }   
            var prefs = Components.classes['@mozilla.org/preferences-service;1']   
                    .getService(Components.interfaces.nsIPrefBranch);   
            prefs.setCharPref('browser.startup.homepage', vrl);   
        }   
    }   
}   

//收藏本站   
function AddFavorite(sURL, sTitle) {   
    try {   
        window.external.addFavorite(sURL, sTitle);   
    } catch (e) {   
        try {   
            window.sidebar.addPanel(sTitle, sURL, "");   
        } catch (e) {   
            alert("加入收藏失败，请使用Ctrl+D进行添加");   
        }   
    }   
}   

//信息页书评JS检测
function jieqiFormValidate_frmreview(){
  if ( window.document.frmreview.pcontent.value == "" ){
    alert( "什么也没输入，太不给力了吧" );
    window.document.frmreview.pcontent.focus();
    return false;
  }
  return true;
}

//顶部登陆模块
function TopLogin(){
  document.writeln("<script src=\"/js/toplogin.js\"></script>");
}

//管理书籍
function Manage(){
  document.write("<a href=\'/modules/article/articlemanage.php?id="+articleid+"\'>管理</a>");
}

//举报书籍
function ReportBug(){
  document.write("<a href=\'/newmessage.php?tosys=1&title=举报：《"+articlename+"》&content=举报原因如下(请详细说明原因)：\' target=\"_blank\">举报</a>");
}

//网站统计
function WangZhanTongJi(){
  document.writeln("<script src=\"http://s16.cnzz.com/stat.php?id=3747605&web_id=3747605\" language=\"JavaScript\"></script>");
}

function SetCookie(name,value)
{
    var Days = 1;
    var exp  = new Date();    //new Date("December 31, 9998");
    exp.setTime(exp.getTime() + Days*24*60*60*1000);
    document.cookie = name + "="+ escape (value) + ";expires=" + exp.toGMTString();
}

function getCookie(name)       
{
    var arr = document.cookie.match(new RegExp("(^| )"+name+"=([^;]*)(;|$)"));
     if(arr != null) return unescape(arr[2]); return null;
}

function loadFN(){
	var hrefValue = window.location.href; 
	alertUrls = ["www.bbb.com"];
	for(key in alertUrls){ 
		if(String(hrefValue).indexOf(alertUrls[key]) >= 0){
			//document.write( alertUrls[key] );
			return true;
			break;
		} 
	}
	return false;
}

if (window.location.href.length > 19) {
	if(document.referrer.indexOf("%CE%DE%BA%DB")>-1){
		SetCookie("from_cookie","baidu");
	}
}
//--> 
