<!--
//工具栏
var tfs=GetCookie('bookfs');
var tbg=GetCookie('bookbg');
var tfc=GetCookie('bookfc');
var lis=GetCookie('listss');


if (tfs != null){
document.write ('<style type="text/css">');
document.write ('#a_fontsize {  font-size: '+tfs+'px; }');
document.write ('</style>');
}
if (tbg != null){
document.write ('<style type="text/css">');
document.write ('#a_fontsize {  background-color: '+tbg+' }');
document.write ('</style>');
}
if(tfc != null)
{
document.write('<style type="text/css">');
document.write('#a_fontsize {color:'+tfc+'}');
document.write ('</style>');
}

if (lis != null){
document.write ('<style type="text/css">');
document.write ('#put_layer3 { display: '+lis+'; }');
document.write ('</style>');
}

function selis(id){
document.getElementById('put_layer3').style.display=id;
SetCookie('listss',id);
}


function setfs(id){
document.getElementById('a_fontsize').style.fontSize=id+"px";
SetCookie('bookfs',id);
}

function setbg(id){
document.getElementById('a_fontsize').style.backgroundColor=id;
SetCookie('bookbg',id);
}

function setfc(id)
{
document.getElementById('a_fontsize').style.color = id;
SetCookie('bookfc',id);
}

//cookie读写脚本

function GetCookieVal(offset)
{
var endstr = document.cookie.indexOf (";", offset);
if (endstr == -1)
endstr = document.cookie.length;
return unescape(document.cookie.substring(offset, endstr));
}

function SetCookie(name, value)
{
var expires = new Date();
expires.setTime(expires.getTime() + 12 * 30 * 24 * 60 * 60 * 1000);
document.cookie = name + "=" + value + ";expires=" + expires.toGMTString();
}

function DelCookie(name)
{
var exp = new Date();
exp.setTime (exp.getTime() - 1);
var cval = GetCookie (name);
document.cookie = name + "=" + cval + "; expires="+ exp.toGMTString();
}

function GetCookie(name)
{
var arg = name + "=";
var alen = arg.length;
var clen = document.cookie.length;
var i = 0;
while (i < clen)
{
var j = i + alen;
if (document.cookie.substring(i, j) == arg)
return GetCookieVal (j);
i = document.cookie.indexOf(" ", i) + 1;
if (i == 0) break;
}
return null;
}
 
//显示隐藏层
function put_layer(no) 
{
	 if ( !!no ) 
	 { 
	 	obj = document.getElementById("put_layer" + no);
	 	if ( obj.style.display != "none" ) {
		    obj.style.display = "none"; 
		}
		else {
		   obj.style.display = "block";
		}
	  } 
} 



  function popCoverDiv(){
   if (G("cover_div")) {
    G("cover_div").style.display = '';
   } else {
    var coverDiv = GC('div');
    document.body.appendChild(coverDiv);
    coverDiv.id = 'cover_div';
    
    with(coverDiv.style) {
     position = 'absolute';
     background = '#000000';
     left = '0px';
     top = '0px';
     var bodySize = getBodySize();
     width = bodySize[0] + 'px'
     height = bodySize[1] + 'px';
     zIndex = 98;
     if (isIE()) {
      filter = "Alpha(Opacity=80)";
     } else {
      opacity = 0.8;
     }
    }
   }
}
//屏蔽错误JS
function ResumeError() { 
return true; 
} 
window.onerror = ResumeError;
//网页报错
function openwinx(url,name,w,h)
{ 
window.open(url,name,"top=100,left=400,width=" + w + ",height=" + h + ",toolbar=no,menubar=no,scrollbars=no,resizable=no,location=no,status=no")
}
// 复制链接
function copyToClipBoard(){
var clipBoardContent="";
clipBoardContent+=document.title;
clipBoardContent+="\r\n";
clipBoardContent+=this.location.href;
window.clipboardData.setData("Text",clipBoardContent);
alert("复制成功，请粘贴后推荐给您的好友！");
}
var zz={
	init:function(){
		
		var elms = document.getElementsByName("sliding");

		for(var g=0; g<elms.length; g++){
			
			var lielms = elms[g].getElementsByTagName('LI');
			
			for(var i=0; i<lielms.length; i++){
				
				lielms[i].onmousedown = function(){
					
					var pnobj = this.parentNode.parentNode.nextSibling.tagName == "DIV" ? this.parentNode.parentNode.nextSibling : this.parentNode.parentNode.nextSibling.nextSibling;
					var objsx = pnobj.getElementsByTagName('UL');
					var elmsx = this.parentNode.getElementsByTagName('LI');
					var thisx = 0;
					
					for(var j=0; j<elmsx.length; j++){
						if(elmsx[j] == this) thisx = j;
						elmsx[j].className="";
						objsx[j].style.display="none";
					}
					
					this.className='on';
					objsx[thisx].style.display="";
					
				}
			}
		}

		
	}}
//导航切换
function doClick(o){
	 o.className="selected";
	 var j;
	 var id;
	 var e;
	 for(var i=0;i<=11;i++){
	   id ="nav"+i;
	   j = document.getElementById(id);
	   e = document.getElementById("sub"+i);
	   if(id != o.id){
	   	 j.className="no";
	   	 e.style.display = "none";
	   }else{
			e.style.display = "block";
	   }
	 }
	 }
	 $(document).ready(function() {
    $("#localize_head_trigger").click(function () {
      if ($("div#localize").is(":hidden")) $("div#localize").slideDown("fast");
      else $("div#localize").slideUp("fast");
    });
	
});
//flink
function doflink(o){
	 o.className="onn";
	 var j;
	 var id;
	 var e;
	 for(var i=1;i<=3;i++){
	   id ="fn"+i;
	   j = document.getElementById(id);
	   e = document.getElementById("fl"+i);
	   if(id != o.id){
	   	 j.className="no";
	   	 e.style.display = "none";
	   }else{
			e.style.display = "block";
	   }
	 }
	 }	 
// Smooth Scroll Back to Top
var scrollToTop = function(){ $('a[@href=#top]').click(function(){ backToTop(); return false;} ) };
function backToTop() {
    var x1 = x2 = x3 = 0;
    var y1 = y2 = y3 = 0;

    if (document.documentElement) {
        x1 = document.documentElement.scrollLeft || 0;
        y1 = document.documentElement.scrollTop || 0;
    }

    if (document.body) {
        x2 = document.body.scrollLeft || 0;
        y2 = document.body.scrollTop || 0;
    }

    x3 = window.scrollX || 0;
    y3 = window.scrollY || 0;

    var x = Math.max(x1, Math.max(x2, x3));
    var y = Math.max(y1, Math.max(y2, y3));

    window.scrollTo(Math.floor(x / 2), Math.floor(y / 2));

    if (x > 0 || y > 0) {
        window.setTimeout("backToTop()", 30);
    }
}
function $1(objectId) { 
     if(document.getElementById && document.getElementById(objectId)) { 
       return document.getElementById(objectId); 
     }  
     else if (document.all && document.all(objectId)) { 
      return document.all(objectId); 
     }  
     else if (document.layers && document.layers[objectId]) { 
       return document.layers[objectId]; 
     }  
     else { 
       return false; 
    } 
}

//-->
