///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// This computer program is protected by copyright law and international treaties.                                                   //
// Unauthorized reproduction or distribution of the program, or any portion of it, may result in severe civil and criminal penalties,//
// and will be prosecuted to the maximum extent possible under law.                                                                  //
// Copyright(c) NetEase.com, Inc. All Right Reserved.                                                                                //
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

function Book(){
	this.id="book";
	this.body=bookdiv;
	this.Status=0;
	this.bookbasediv=null;
	this.ToolBar=null;
	this.NextImgBufferL=null;
	this.LastImgBufferL=null;
	this.NextImgBufferR=null;
	this.LastImgBufferR=null;
	this.LImgprv=null;
	this.RImgprv=null;
	this.MouseCursor=null;
	this.MouseCursorLeftUri="images/fangdajin.cur";
	this.MouseCursorOutUri="images/right.ani";
	this.ImgDIV=null;
	this.ImgdetDIV=null;
	this.TxtdetDIV=null;
	this.mytable=null;
	this.BorderTable=null;
	this.ValidScreenWidth=0;
	this.ValidScreenHeight=0;
	this.Pv_Ratio=1;
	this.Pv_Pic_Width=0;
	this.Pv_Pic_Height=0;
	this.LeftOffset=0;
	this.LeftBlank=0;
	this.TopOffset=0;
	this.TopBlank=0;
	this.BasebDraged=false;
	this.DragStart=new Point();
	this.DragStartOffset=new Point();
	this.PL_Step=8;
	this.PL_DelayTime=20;
	this.PL_Width=0;
	this.ID_Leaf_Middle=null;
	this.Initial=Initial;
	this.OnBaseMouseDown=OnBaseMouseDown;
	this.OnBaseMouseMove=OnBaseMouseMove;
	this.OnBaseMouseUp=OnBaseMouseUp;
	this.OnBaseMouseOver=OnBaseMouseOver;
	this.OnBaseMouseWheel=OnBaseMouseWheel;
	this.OnLoadBufferImg=OnLoadBufferImg;
	this.onBaseResize=onBaseResize;
	this.EnlargePic=EnlargePic;
	this.getImgsrcArray=getImgsrcArray;
	this.LeafForward=LeafForward;
	this.LeafBackward=LeafBackward;
	this.MovePic=MovePic;
	this.GotoPage=GotoPage;
	this.GotoSearch=GotoSearch;
	this.PreLoadImg=PreLoadImg;
	this.Leaf_RL=Leaf_RL;
	this.Leaf_LL=Leaf_LL;
	this.Leaf_RR=Leaf_RR;
	this.Leaf_LR=Leaf_LR;
	this.Leaf_End_Left=Leaf_End_Left;
	this.Leaf_End_Right=Leaf_End_Right;
	this.SetObjWidth=SetObjWidth;
	this.ShrinkPic=ShrinkPic;
	this.ImgBufferReady=ImgBufferReady;
	this.LastImgBufferReady=0;
	this.NextImgBufferReady=0;
	this.CurrentLImgReady=0;
	this.CurrentRImgReady=0;
	this.nextDiv;//显示下一页的按钮
	this.prevDiv;//显示上一页的按钮
	this.lastPvRatio;
	this.nextBottom=100;
	this.showNextPageDiv=showNextPageDiv;
	this.ProcessbarDiv=null;
	this.ProcessbarTable=null;
	this.moveUpDiv;
	this.moveDownDiv;
	this.moveLeftDiv;
	this.moveRightDiv
	this.moveTimeOut;
	this.hideQuickMoveImg=hideQuickMoveImg;
	this.showQuickMoveImg=showQuickMoveImg;
	this.resetQuickMoveImg=resetQuickMoveImg;
	this.runProcessbar=runProcessbar;
	this.ID_runProcessbar=null;
	this.CurrentImgReady=0;
	this.DetailImgLoadCount=0;
	this.PosDetail=new Point();
	this.DetailTable=null;
	this.Toolbar_Height=50;
	this.currentPageNo=0;
	this.noWait=false;
	this.Initial();
}
function Initial(){
//	this.noWait=true;
	this.currentPageNo=parseInt(PageNo,10);
	if(this.currentPageNo%2==1){
		this.currentPageNo--;
	}
	PageNo=this.currentPageNo<100?"0"+(this.currentPageNo<10?"0"+this.currentPageNo:this.currentPageNo):this.currentPageNo;
	this.ValidScreenWidth=this.body.clientWidth;
	this.ValidScreenHeight=this.body.clientHeight;
	var Pv_Ratio1=Pic_Width*2/this.ValidScreenWidth;
	var Pv_Ratio2=Pic_Height/(this.ValidScreenHeight-this.Toolbar_Height-10);
	if(Pv_Ratio1<=Pv_Ratio2){
		this.Pv_Ratio=Pv_Ratio2;
	}
	else{
		this.Pv_Ratio=Pv_Ratio1;
	}
	this.Pv_Pic_Width=Math.ceil(Pic_Width/this.Pv_Ratio);
	this.Pv_Pic_Height=Math.ceil(Pic_Height/this.Pv_Ratio);
	if(this.ValidScreenWidth>this.Pv_Pic_Width*2){
		this.LeftBlank=Math.ceil(this.ValidScreenWidth-this.Pv_Pic_Width*2)/2;
	}
	else{
		this.LeftBlank=0;
	}
	if(this.ValidScreenHeight-this.Toolbar_Height>this.Pv_Pic_Height){
		this.TopBlank=Math.ceil(this.ValidScreenHeight-this.Toolbar_Height-this.Pv_Pic_Height)/2;
	}
	else{
		this.TopBlank=5;
	}
	var tmpBookBaseDiv=document.createElement("Div");
	this.body.appendChild(tmpBookBaseDiv);
	tmpBookBaseDiv.outerHTML="<div id=\"bookbasediv\"> </div>";
	this.bookbasediv=bookbasediv;
	delete tmpBookBaseDiv;
	with(this.bookbasediv.style) {
		position="absolute";
		top=0;
		left=0;
		width=this.ValidScreenWidth;
		height=this.ValidScreenHeight;
		zIndex=0;
		overflow="hidden";
		backgroundColor="#115588";
	}
	var tmpToolBar=document.createElement("DIV");
	this.bookbasediv.appendChild(tmpToolBar);
	tmpToolBar.outerHTML="<div id=\"ToolBar\"> </div>";
	this.ToolBar=ToolBar;
	delete tmpToolBar;
	with(this.ToolBar.style) {
		position="absolute";
		top=0;
		left=0;
		width=this.ValidScreenWidth;
		height=this.Toolbar_Height;
		zIndex=20;
		overflow="visible";
		backgroundColor="#E6E6E6";
	}
	
	var tmpImgUpper=document.createElement("DIV");
	this.bookbasediv.appendChild(tmpImgUpper);
	tmpImgUpper.outerHTML="<div id=\"ImgDIV\" onMouseDown=\""+this.id+".OnBaseMouseDown(this)\" onmousemove=\""+this.id+".OnBaseMouseMove(this)\" onmouseup=\""+this.id+".OnBaseMouseUp(this)\" onmouseover=\""+this.id+".OnBaseMouseOver(this)\" onmouseout=\"javascript:cacelEvent()\" onmousewheel=\"return "+this.id+".OnBaseMouseWheel(this)\"> </div>";
	delete tmpImgUpper;
	this.ImgDIV=ImgDIV;
	with(this.ImgDIV.style) {
		position="absolute";
		top=this.Toolbar_Height;
		left=0;
		width=this.ValidScreenWidth;
		height=this.ValidScreenHeight-this.Toolbar_Height;
		zIndex=9;		
		overflow="hidden";
	}

	var tmpImgUpper=document.createElement("DIV");
	this.ImgDIV.appendChild(tmpImgUpper);
	tmpImgUpper.outerHTML="<div id=\"ImgdetDIV\"> </div>";
	delete tmpImgUpper;
	this.ImgdetDIV=ImgdetDIV;
	
	var tmpNextDiv=document.createElement("DIV");
	this.bookbasediv.appendChild(tmpNextDiv);
	tmpNextDiv.outerHTML=
		"<div id='NextDiv' onClick='javascript:nextPage();'"+
		"onMouseDown='javascript:cacelEvent()'	onmousemove='javascript:cacelEvent()'"+
		"onmouseup='javascript:cacelEvent()' onmouseover='javascript:showTips(1)'><img src='images/arrow_next.gif' alt='下一页'></img></div>";
	delete tmpNextDiv;
	this.nextDiv=NextDiv;
	with(this.nextDiv.style) {
		position="absolute";
		bottom =100;
		right=0;
		width=50;
		height=10;
		zIndex=10;
		cursor="hand";
		filter="alpha(opacity=50)";
	}
	var tmpPrevDiv=document.createElement("DIV");
	this.bookbasediv.appendChild(tmpPrevDiv);
	tmpPrevDiv.outerHTML="<div id='PrevDiv' onClick='javascript:prevPage();'"+
		"onMouseDown='javascript:cacelEvent()'	onmousemove='javascript:cacelEvent()'"+
		"onmouseup='javascript:cacelEvent()' onmouseover='javascript:showTips(0)'> <img src='images/arrow_prev.gif' alt='上一页'></img></div>";;
	delete tmpPrevDiv;
	this.prevDiv=PrevDiv;
	with(this.prevDiv.style) {
		position="absolute";
		bottom=100;
		left=0;
		width=50;
		height=10;
		zIndex=10;
		cursor="hand";
		filter="alpha(opacity=50)";
	}
	this.showNextPageDiv();
	//createMoveDiv(id,mouseoverEventHandler,mouseoutEventHandler,cancelEventHandler,img)
	
	var tmpNextDiv=document.createElement("DIV");
	this.bookbasediv.appendChild(tmpNextDiv);
	tmpNextDiv.outerHTML=
		"<div id='MoveUpDiv' onmouseout='javascript:moveOut();'"+
		"onMouseDown='javascript:moveCancelEvent()'	onmousemove='javascript:moveCancelEvent()'"+
		"onmouseup='javascript:moveCancelEvent()' onmouseover='javascript:startMove(\"moveUp()\")'><img src='images/button_moveup.gif' alt=\"上移\"></img></div>";
	delete tmpPrevDiv;
	this.moveUpDiv=MoveUpDiv;
	with(this.moveUpDiv.style) {
		position="absolute";	
		top=this.Toolbar_Height+5;
		left=this.ValidScreenWidth/2;
		width=37;
		height=10;
		zIndex=10;
		cursor="move";
		filter="alpha(opacity=50)";
	}
	var tmpNextDiv=document.createElement("DIV");
	this.bookbasediv.appendChild(tmpNextDiv);
	tmpNextDiv.outerHTML=
		"<div id='MoveDownDiv' onmouseout='javascript:moveOut();'"+
		"onMouseDown='javascript:moveCancelEvent()'	onmousemove='javascript:moveCancelEvent()'"+
		"onmouseup='javascript:moveCancelEvent()' onmouseover='javascript:startMove(\"moveDown()\")'><img src='images/button_movedown.gif' alt=\"下移\"></img></div>";
	delete tmpPrevDiv;
	this.moveDownDiv=MoveDownDiv;
	with(this.moveDownDiv.style) {
		position="absolute";
		bottom=5;
		left=this.ValidScreenWidth/2;
		width=37;
		height=10;
		zIndex=10;
		cursor="move";
		filter="alpha(opacity=50)";
	}

	var tmpNextDiv=document.createElement("DIV");
	this.bookbasediv.appendChild(tmpNextDiv);
	tmpNextDiv.outerHTML=
		"<div id='MoveLeftDiv' onmouseout='javascript:moveOut();'"+
		"onMouseDown='javascript:moveCancelEvent()'	onmousemove='javascript:moveCancelEvent()'"+
		"onmouseup='javascript:moveCancelEvent()' onmouseover='javascript:startMove(\"moveLeft()\")'><img src='images/button_moveleft.gif' alt=\"左移\"></img></div>";
	delete tmpPrevDiv;
	this.moveLeftDiv=MoveLeftDiv;
	with(this.moveLeftDiv.style) {
		position="absolute";	
		bottom=(this.ValidScreenHeight-this.Toolbar_Height)/2
		left=5;
		width=37;
		height=10;
		zIndex=10;
		cursor="move";
		filter="alpha(opacity=50)";
	}
	var tmpNextDiv=document.createElement("DIV");
	this.bookbasediv.appendChild(tmpNextDiv);
	tmpNextDiv.outerHTML=
		"<div id='MoveRightDiv' onmouseout='javascript:moveOut();'"+
		"onMouseDown='javascript:moveCancelEvent()'	onmousemove='javascript:moveCancelEvent()'"+
		"onmouseup='javascript:moveCancelEvent()' onmouseover='javascript:startMove(\"moveRight()\")'><img src='images/button_moveright.gif' alt=\"右移\"></img></div>";
	delete tmpPrevDiv;
	this.moveRightDiv=MoveRightDiv;
	with(this.moveRightDiv.style) {
		position="absolute";
		bottom=(this.ValidScreenHeight-this.Toolbar_Height)/2
		right=5;
		width=37;
		height=10;
		zIndex=10;
		cursor="move";
		filter="alpha(opacity=50)";
	}
	this.hideQuickMoveImg();
	var tmpImgBuffer=document.createElement("IMG");
	this.ImgDIV.appendChild(tmpImgBuffer);
	tmpImgBuffer.outerHTML="<img id=\"NextImgBufferL\" onload=\""+this.id+".ImgBufferReady(this)\">";
	delete tmpImgBuffer;
	this.NextImgBufferL=NextImgBufferL;
	this.NextImgBufferL.style.width=0;

	var tmpImgBuffer=document.createElement("IMG");
	this.ImgDIV.appendChild(tmpImgBuffer);
	tmpImgBuffer.outerHTML="<img id=\"NextImgBufferR\" onload=\""+this.id+".ImgBufferReady(this)\">";
	delete tmpImgBuffer;
	this.NextImgBufferR=NextImgBufferR;
	with(this.NextImgBufferR.style) {
		position="absolute";
		left=this.LeftBlank+this.Pv_Pic_Width;
		top=this.TopBlank;
		width=this.Pv_Pic_Width;
		height=this.Pv_Pic_Height;
		zIndex=11;
		if(this.noWait){
			visivility="hidden";
		}
	}
	
	var tmpImgBuffer=document.createElement("IMG");
	this.ImgDIV.appendChild(tmpImgBuffer);
	tmpImgBuffer.outerHTML=" <img id=\"LastImgBufferL\" onload=\""+this.id+".ImgBufferReady(this)\">";
	delete tmpImgBuffer;
	this.LastImgBufferL=LastImgBufferL;
	with(this.LastImgBufferL.style) {
		position="absolute";
		right=this.ValidScreenWidth-this.LeftBlank-this.Pv_Pic_Width;
		top=this.TopBlank;
		width=this.Pv_Pic_Width;
		height=this.Pv_Pic_Height;
		zIndex=11;
		if(this.noWait){
			visivility="hidden";
		}
	}
	
	var tmpImgBuffer=document.createElement("IMG");
	this.ImgDIV.appendChild(tmpImgBuffer);
	tmpImgBuffer.outerHTML=" <img id=\"LastImgBufferR\" onload=\""+this.id+".ImgBufferReady(this)\">";
	delete tmpImgBuffer;
	this.LastImgBufferR=LastImgBufferR;
	this.LastImgBufferR.style.width=0;

	var tmpImgUpper=document.createElement("IMG");
	this.ImgDIV.appendChild(tmpImgUpper);
	tmpImgUpper.outerHTML=" <img id=\"LImgprv\" onload=\""+this.id+".OnLoadBufferImg(this)\">";
	delete tmpImgUpper;
	this.LImgprv=LImgprv;
	with(this.LImgprv) {
		with(style) {
			position="absolute";
			cursor=this.MouseCursorLeftUri;
			right=this.ValidScreenWidth-this.LeftBlank-this.Pv_Pic_Width;
			top=this.TopBlank;
			width=this.Pv_Pic_Width;
			height=this.Pv_Pic_Height;
			zIndex=12;
		}
	}
	
	var tmpImgUpper=document.createElement("IMG");
	this.ImgDIV.appendChild(tmpImgUpper);
	tmpImgUpper.outerHTML=" <img id=\"RImgprv\" onload=\""+this.id+".OnLoadBufferImg(this)\">";
	delete tmpImgUpper;
	this.RImgprv=RImgprv;
	with(this.RImgprv) {
		with(style) {
			position="absolute";
			cursor=this.MouseCursorLeftUri;
			left=this.LeftBlank+this.Pv_Pic_Width;
			top=this.TopBlank;
			width=this.Pv_Pic_Width;
			height=this.Pv_Pic_Height;
			zIndex=12;
		}
	}

	var tmpImgUpper=document.createElement("DIV");
	this.ImgDIV.appendChild(tmpImgUpper);
	tmpImgUpper.outerHTML="<div id=\"TxtdetDIV\"> </div>";
	delete tmpImgUpper;
	this.TxtdetDIV=TxtdetDIV;

	var tmpDiv=document.createElement("DIV");
	this.bookbasediv.appendChild(tmpDiv);
	tmpDiv.outerHTML="<div id=\"ProcessbarDiv\"> </div>";
	delete tmpDiv;
	this.ProcessbarDiv=ProcessbarDiv;
	with(this.ProcessbarDiv.style) {
		position="absolute";
		bottom=10;
		right=10;
		width=152;
		height=20;
		zIndex=10;
		filter="alpha(opacity=100)";
		border="1 solid black";
		visibility="hidden";
	}
	this.ProcessbarDiv.innerHTML="<table><tr><td style=\"font-size:12;color:#000000;font-weight:bold\"> 正在调入下一页内容...</td></tr></table>";
	
	var tmpShadow=document.createElement("DIV");
	this.ImgDIV.appendChild(tmpShadow);
	tmpShadow.outerHTML="<div id=\"Shadow\"> </div>";
	delete tmpShadow;
	this.Shadow=Shadow;
	with(this.Shadow.style) {
		cursor=this.MouseCursorLeftUri;
		position="absolute";
		top=this.TopBlank;
		left=0;
		width="100%";
		height=this.Pv_Pic_Height;
		zIndex=13;
		filter="alpha(opacity=100)";
		border=0;
		visibility="visible";
	}
	this.Shadow.innerHTML="<table width=38 height=100% border=0 cellpadding=0 cellspacing=0 align=center><tr><td style=\"filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src='images/shadow.png',sizingMethod='scale');\"></td></tr></table>";
	
	var tabletmp=document.createElement("TABLE");
	this.ProcessbarDiv.appendChild(tabletmp);
	tabletmp.outerHTML="<table id=\"ProcessbarTable\"> </table>";
	this.ProcessbarTable=ProcessbarTable;
	delete tabletmp;
	var Processbar=this.ProcessbarTable.insertRow().insertCell();
	with(this.ProcessbarTable){
		border=0;
		align="left";
		vAlign="middle";
		cellPadding=0;
		cellSpacing=0;
		with(style){
			position="absolute";
			top=0;
			left=0;
			width=0;
			height=20;
			zIndex=-1;
			filter="alpha(opacity=50)";
			backgroundColor="#6666FF";
		}
	}

	if(this.LeftBlank>=12){
		var tabletmp=document.createElement("TABLE");
		this.ImgDIV.appendChild(tabletmp);
		tabletmp.outerHTML="<table id=\"BorderTable\"> </table>";
		this.BorderTable=BorderTable;
		delete tabletmp;
		with(this.BorderTable){
			border=0;
			align="center";
			cellPadding=0;
			cellSpacing=0;
			with(style){
				top=5;
				left=this.LeftBlank-12;
				height=this.Pv_Pic_Height;
				position="absolute";
				zIndex=5;
			}
		}
		for(i=0;i<2;i++){
			var myrow=this.BorderTable.insertRow();
			for(j=0;j<3;j++){
				var mycell=myrow.insertCell();
				if(i==0&&j!=1){
					mycell.width=12;
					mycell.vAlign="top";
					if(j==0){
						mycell.background="images/book_leftbg.gif";
						mycell.innerHTML="<img src=\"images/book_lefttop.gif\" width=\"12\" height=\"7\">";
					}
					if(j==2){
						mycell.background="images/book_rightbg.gif";
						mycell.innerHTML="<img src=\"images/book_righttop.gif\" width=\"12\" height=\"7\">";
					}
				}else if(i==1&&j!=1){
					mycell.vAlign="bottom";
					if(j==0){
						mycell.background="images/book_leftbg.gif";
						mycell.innerHTML="<img src=\"images/book_leftbot.gif\" width=\"12\" height=\"7\">";
					}
					if(j==2){
						mycell.background="images/book_rightbg.gif";
						mycell.innerHTML="<img src=\"images/book_rightbot.gif\" width=\"12\" height=\"7\">";
					}
				}
				else{
					mycell.width=this.Pv_Pic_Width*2;
					mycell.innerHTML=" ";
				}
			}
		}
	}
}
function onBaseResize(){
	if(this.CurrentImgReady!=1){
		setTimeout("onBaseResize()",100);
		return;
	}
	this.lastPvRatio=this.Pv_Ratio;
	this.ValidScreenWidth=this.body.clientWidth;
	this.ValidScreenHeight=this.body.clientHeight;
	var Pv_Ratio1=Pic_Width*2/this.ValidScreenWidth;
	var Pv_Ratio2=Pic_Height/(this.ValidScreenHeight-this.Toolbar_Height-10);
	if(Pv_Ratio1<=Pv_Ratio2){
		this.Pv_Ratio=Pv_Ratio2;
	}
	else{
		this.Pv_Ratio=Pv_Ratio1;
	}
	this.Pv_Pic_Width=Math.ceil(Pic_Width/this.Pv_Ratio);
	this.Pv_Pic_Height=Math.ceil(Pic_Height/this.Pv_Ratio);
	if(this.ValidScreenWidth>this.Pv_Pic_Width*2){
		this.LeftBlank=Math.ceil(this.ValidScreenWidth-this.Pv_Pic_Width*2)/2;
	}
	else{
		this.LeftBlank=0;
	}
	if(this.ValidScreenHeight-this.Toolbar_Height>this.Pv_Pic_Height){
		this.TopBlank=Math.ceil(this.ValidScreenHeight-this.Toolbar_Height-this.Pv_Pic_Height)/2;
	}
	else{
		this.TopBlank=5;
	}
	with(this.bookbasediv.style) {
		width=this.ValidScreenWidth;
		height=this.ValidScreenHeight;
	}
	with(this.ToolBar.style) {
		width=this.ValidScreenWidth;
		height=this.Toolbar_Height;
	}
	with(this.ImgDIV.style) {
		width=this.ValidScreenWidth;
		height=this.ValidScreenHeight-this.Toolbar_Height;
	}
	with(this.LImgprv.style) {
		right=this.ValidScreenWidth-this.LeftBlank-this.Pv_Pic_Width;
		top=this.TopBlank;
		width=this.Pv_Pic_Width;
		height=this.Pv_Pic_Height;
	}
	with(this.RImgprv.style) {
		left=this.LeftBlank+this.Pv_Pic_Width;
		top=this.TopBlank;
		width=this.Pv_Pic_Width;
		height=this.Pv_Pic_Height;
	}
	with(this.LastImgBufferL.style) {
		right=this.ValidScreenWidth-this.LeftBlank-this.Pv_Pic_Width;
		top=this.TopBlank;
		width=this.Pv_Pic_Width;
		height=this.Pv_Pic_Height;
	}
	with(this.NextImgBufferR.style) {
		left=this.LeftBlank+this.Pv_Pic_Width;
		top=this.TopBlank;
		width=this.Pv_Pic_Width;
		height=this.Pv_Pic_Height;
	}
	if(typeof(MiniMap)!="undefined") {
		MiniMap.SetMiniMapImg();
	}
	if(this.LeftBlank>=12&&this.BorderTable!=null){
		with(this.BorderTable.style){
			left=this.LeftBlank-12;
			height=this.Pv_Pic_Height;
		}
		this.BorderTable.rows(0).cells(1).width=this.Pv_Pic_Width*2;
		this.BorderTable.rows(1).cells(1).width=this.Pv_Pic_Width*2;
	}
	else if(this.BorderTable!=null){
		this.BorderTable.style.left=0;
		this.BorderTable.style.height=0;
	}
	this.nextBottom=this.nextBottom*this.lastPvRatio/this.Pv_Ratio;
	this.nextDiv.style.bottom=this.nextBottom;
	this.prevDiv.style.bottom=this.nextBottom;
	this.Shadow.style.height=this.Pv_Pic_Height;
	this.Shadow.style.top=this.TopBlank;
	this.resetQuickMoveImg();
}
function OnBaseMouseDown(arg_obj){
    switch(event.button) {
    case 1 :
		arg_obj.style.cursor="images/hand.cur";	
		this.DragStart.x=event.x;
		this.DragStart.y=event.y;
		this.DragStartOffset.x=this.LeftOffset;
		this.DragStartOffset.y=this.TopOffset;
        break;
    case 2 :
        break;
    }
    event.cancelBubble=true;
}
function OnBaseMouseMove(arg_Obj){	
	if(this.Status==1){
		switch(event.button) {
		case 1 :
			arg_Obj.setCapture();
			this.BasebDraged=true;
			arg_Obj.style.cursor="images/hand.cur";			
			this.LeftOffset=event.x-this.DragStart.x+this.DragStartOffset.x;
			this.TopOffset=event.y-this.DragStart.y+this.DragStartOffset.y;
			this.EnlargePic();
			break;
		}
	}
	event.cancelBubble=true;
}
function OnBaseMouseWheel(arg_Obj){
	this.BasebDraged=true;
	this.TopOffset+=event.wheelDelta/4;
	this.EnlargePic();
	return false;
}
function OnBaseMouseUp(arg_Obj){
	if(this.Status==1){
		switch(event.button){
			case 1 :
				if(this.BasebDraged){
					arg_Obj.releaseCapture();
					this.BasebDraged=false;
					arg_Obj.style.cursor="default";
				}
				else{					
					this.MovePic(event.x-this.LeftOffset,event.y-this.TopOffset);
				}
				break;
			case 2 :
				this.ShrinkPic();
				this.showNextPageDiv();
				break;
			default :
		}
	}
	else{
		switch(event.button){
			case 1:
				this.MovePic((event.x-this.LeftBlank)*this.Pv_Ratio+(this.ValidScreenWidth>Pic_Width*2?((this.ValidScreenWidth-Pic_Width*2)/2):0),(event.y-this.TopBlank-this.Toolbar_Height)*this.Pv_Ratio+this.Toolbar_Height);
				hideNextPageDiv();
				break;
			case 2:
				if(event.x<this.ValidScreenWidth/2){
					this.LeafForward();
				}
				else if(event.x>this.ValidScreenWidth/2){
					this.LeafBackward();
				}
				break;
			default:
		}
	}
	event.cancelBubble=true;
}
function OnBaseMouseOver(arg_Obj){	
	var vTitle="";
	if(this.Status==0){
		vTitle="点击鼠标左键放大";
		if(event.x>this.ValidScreenWidth/2&&this.NextImgBufferReady==2){
			vTitle+="，点击鼠标右键向后翻页";
		}
		else if(event.x<this.ValidScreenWidth/2&&this.LastImgBufferReady==2){
			vTitle+="，点击鼠标右键向前翻页";
		}
	}
	else{
		vTitle="点击鼠标右键缩小，点击鼠标左键或拖拽鼠标移动图片";
	}
	this.ImgDIV.title=vTitle;
	event.cancelBubble=true;
}
function PreLoadImg(newPageNo){
	this.NextImgBufferReady=0;
	this.LastImgBufferReady=0;
	if(typeof(newPageNo)=="undefined"){
		if(this.currentPageNo<AllPages-2){
			var nextPageNo=parseInt(this.currentPageNo,10)+2;
			var nextPageNo2=parseInt(this.currentPageNo,10)+3;
			nextPageNo=nextPageNo<100?("0"+(nextPageNo<10?("0"+nextPageNo):nextPageNo)):nextPageNo;
			nextPageNo2=nextPageNo2<100?("0"+(nextPageNo2<10?("0"+nextPageNo2):nextPageNo2)):nextPageNo2;
			this.NextImgBufferL.src=Pic_Path_Base+"/"+nextPageNo+(isOffline?".jpg":"/"+nextPageNo+".jpg.pv");
			this.NextImgBufferR.src=Pic_Path_Base+"/"+nextPageNo2+(isOffline?".jpg":"/"+nextPageNo2+".jpg.pv");
		}
		if(this.currentPageNo>0){
			var lastPageNo=parseInt(this.currentPageNo,10)-2;
			var lastPageNo2=parseInt(this.currentPageNo,10)-1;
			lastPageNo=lastPageNo<100?("0"+(lastPageNo<10?("0"+lastPageNo):lastPageNo)):lastPageNo;
			lastPageNo2=lastPageNo2<100?("0"+(lastPageNo2<10?("0"+lastPageNo2):lastPageNo2)):lastPageNo2;
			this.LastImgBufferL.src=Pic_Path_Base+"/"+lastPageNo+(isOffline?".jpg":"/"+lastPageNo+".jpg.pv");
			this.LastImgBufferR.src=Pic_Path_Base+"/"+lastPageNo2+(isOffline?".jpg":"/"+lastPageNo2+".jpg.pv");
		}
	}
	else{
		if(newPageNo%2==1){
			newPageNo--;
		}
		if(newPageNo>=0&&newPageNo<AllPages){
			var nextPageNo=parseInt(newPageNo,10)+1;
			newPageNoStr=newPageNo<100?("0"+(newPageNo<10?("0"+newPageNo):newPageNo)):newPageNo;
			nextPageNo=nextPageNo<100?("0"+(nextPageNo<10?("0"+nextPageNo):nextPageNo)):nextPageNo;
			if(newPageNo>this.currentPageNo){
				this.NextImgBufferL.src=Pic_Path_Base+"/"+newPageNoStr+(isOffline?".jpg":"/"+newPageNoStr+".jpg.pv");
				this.NextImgBufferR.src=Pic_Path_Base+"/"+nextPageNo+(isOffline?".jpg":"/"+nextPageNo+".jpg.pv");
			}
			else if(newPageNo<this.currentPageNo){
				this.LastImgBufferL.src=Pic_Path_Base+"/"+newPageNoStr+(isOffline?".jpg":"/"+newPageNoStr+".jpg.pv");
				this.LastImgBufferR.src=Pic_Path_Base+"/"+nextPageNo+(isOffline?".jpg":"/"+nextPageNo+".jpg.pv");
			}
		}
	}
	this.ProcessbarDiv.style.visibility="visible";
	this.ProcessbarTable.style.width=0;
	clearTimeout(this.ID_runProcessbar);
	this.runProcessbar();
}
function runProcessbar() {
	clearTimeout(this.ID_runProcessbar);
	if((this.currentPageNo>=AllPages-2||this.NextImgBufferReady==2)&&(this.currentPageNo==0||this.LastImgBufferReady==2)){
		this.ProcessbarDiv.style.visibility="hidden";
	}
	else{
		var newtablewidth=parseInt(this.ProcessbarTable.style.width)+1;
		this.ProcessbarTable.style.width=newtablewidth;
		if(newtablewidth<parseInt(this.ProcessbarDiv.style.width)-10){
			this.ID_runProcessbar=setTimeout(this.id+".runProcessbar()",100);
		}
	}
}

function OnLoadBufferImg(arg_obj){
	if(arg_obj.id=='LImgprv'){
		this.CurrentLImgReady=1;
	}
	if(arg_obj.id=='RImgprv'){
		this.CurrentRImgReady=1;
	}
	if(this.noWait||(this.CurrentLImgReady==1&&this.CurrentRImgReady==1)){
		this.CurrentLImgReady=0;
		this.CurrentRImgReady=0;
		this.CurrentImgReady=1;
		this.PreLoadImg();
	}
	else
		return;

}
function EnlargePic(){
	this.ImgDIV.style.top=this.Toolbar_Height;
	this.ImgDIV.style.height=this.ValidScreenHeight-this.Toolbar_Height;
	if(this.ValidScreenWidth-Pic_Width*2>this.LeftOffset){
		this.LeftOffset=this.ValidScreenWidth-Pic_Width*2;
	}
	if(this.LeftOffset>0){
		this.LeftOffset=0;
	}
	if(this.ValidScreenHeight-this.Toolbar_Height-Pic_Height>this.TopOffset){
		this.TopOffset=this.ValidScreenHeight-this.Toolbar_Height-Pic_Height;
	}
	if(this.TopOffset>0){
		this.TopOffset=0;
	}
	if(this.BorderTable!=null){
		this.BorderTable.style.visibility="hidden";
	}
	this.ProcessbarDiv.style.visibility="hidden";
	this.Shadow.style.visibility="hidden";
	with(this.LImgprv.style){
		position="absolute";
		right=this.ValidScreenWidth-this.LeftOffset-Pic_Width;
		top=this.TopOffset+(this.ValidScreenHeight-this.Toolbar_Height>Pic_Height?((this.ValidScreenHeight-Pic_Height-this.Toolbar_Height)/2):0);
		width=Pic_Width;
		height=Pic_Height;
	}
	with(this.RImgprv.style){
		position="absolute";
		left=this.LeftOffset+(this.ValidScreenWidth>Pic_Width*2?((this.ValidScreenWidth-Pic_Width*2)/2):0)+Pic_Width;
		top=this.TopOffset+(this.ValidScreenHeight-this.Toolbar_Height>Pic_Height?((this.ValidScreenHeight-Pic_Height-this.Toolbar_Height)/2):0);
		width=Pic_Width;
		height=Pic_Height;
	}
	if(typeof(MiniMap)!="undefined") {
		if(MiniMap.SetMiniMapImg()){
			MiniMap.dmiDoShow();
		}
		MiniMap.ResizeMiniMap();
	}
	if(this.Status==0){
		if(!isOffline){
			var Focus_x=parseInt(this.ValidScreenWidth)/2-parseInt(this.LeftOffset);
			var Focus_y=parseInt(this.ValidScreenHeight)/2-parseInt(this.TopOffset);
			var colscount=Math.ceil(Pic_Width/Small_Pix);
			var rowscount=Math.ceil(Pic_Height/Small_Pix);
			var PageNo2=parseInt(this.currentPageNo,10)+1;
			PageNo2=PageNo2<100?("0"+(PageNo2<10?("0"+PageNo2):PageNo2)):PageNo2;
			var mytabletmp=document.createElement('TABLE');
			this.ImgdetDIV.appendChild(mytabletmp);
			mytabletmp.outerHTML="<table id=\"mytable\"> </table>";
			this.mytable=mytable;
			delete mytabletmp;
			mytable.border=0;
			mytable.style.tableLayout="fixed";
			mytable.cellPadding=0;
			mytable.cellSpacing=0;
			for(i=0;i<rowscount;i++){
				var myrow=mytable.insertRow();
				for(j=0;j<colscount*2;j++){
					myrow.insertCell();
					if(j%colscount==colscount-1&&Pic_Width%Small_Pix!=0)
						myrow.cells(j).width=Pic_Width%Small_Pix;
					else
						myrow.cells(j).width=Small_Pix;
					if(i%rowscount==rowscount-1&&Pic_Height%Small_Pix!=0)
						myrow.cells(j).height=Pic_Height%Small_Pix;
					else
						myrow.cells(j).height=Small_Pix;
					myrow.cells(j).innerText=" ";
				}
			}
			var index_col=Math.ceil((Focus_x+Small_Pix/2)/Small_Pix)-1;
			if(Focus_x+Small_Pix/2>Pic_Width)index_col--;
			var index_row=Math.ceil((Focus_y-Small_Pix/2)/Small_Pix)-1;
			var picindex=colscount*2*index_row+index_col;
			if(Focus_x>Pic_Width){
				Focus_x=Focus_x-Pic_Width;
				index_col=Math.ceil((Focus_x+Small_Pix/2)/Small_Pix)-1+colscount;
				picindex=colscount*2*index_row+index_col;
			}
			var orderedImgsrcArr=this.getImgsrcArray(picindex,colscount*2,rowscount);
			for(var i=0;i<orderedImgsrcArr.length;i++){
				picindex=orderedImgsrcArr[i];
				var LoadPicHTML;
				if(picindex%(colscount*2)<colscount){
					LoadPicHTML="<img src=\""+Pic_Path_Base+"/"+PageNo+"/"+PageNo+".jpg."+(Math.floor(picindex/colscount)*(colscount/2)+(picindex%colscount))+"\"/>";	
				}
				else{
					LoadPicHTML="<img src=\""+Pic_Path_Base+"/"+PageNo2+"/"+PageNo2+".jpg."+(Math.floor(picindex/colscount)*(colscount/2)+(picindex%colscount)-(colscount/2))+"\"/>";	
				}
				mytable.rows(Math.floor(picindex/(colscount*2))).cells(picindex%(colscount*2)).innerHTML=LoadPicHTML;
			}
			addCookieNumber("enLarge");
		}
		with(this.TxtdetDIV.style) {
			position="absolute";
			top=this.TopBlank;
			right=this.ValidScreenWidth/2-150;
			width=300;
			height=this.Pv_Pic_Height;
			overflowY="hidden";
			zIndex=-1;
			visibility="visible";
		}
		this.TxtdetDIV.innerHTML="<font color=#FFCC66 style=\"font-size:11px\"><font color=#FFFF66>如果您看到以下文字，</font><br>表示有一些浏览器插件错误地将电子样本当作广告进行了屏蔽，<br>导致电子样本浏览失败！请检查您的系统是否安装了以下插件：<br>　3721上网助手、<br>　雅虎助手、<br>　超级兔子、<br>　baidu搜霸<br>或者您正在使用MYIE、遨游(Maxthon)、腾讯TT 浏览电子样本。<p>解决办法：<font color=#FFFFFF>请暂停“拦截浮动广告”</font><p>以3721上网助手为例：<p>请选择下拉菜单“已拦截”，寻找到“拦截浮动广告”<br>一项，将前面的钩选“√”去除；<p></font>";
		this.Status=1;
	}
	with(this.ImgdetDIV.style) {
		position="absolute";
		top=this.TopOffset+(this.ValidScreenHeight-this.Toolbar_Height>Pic_Height?((this.ValidScreenHeight-Pic_Height-this.Toolbar_Height)/2):0);
		left=this.LeftOffset+(this.ValidScreenWidth>Pic_Width*2?((this.ValidScreenWidth-Pic_Width*2)/2):0);
		width=Pic_Width*2;
		height=Pic_Height;
		zIndex=13;
		cursor=this.MouseCursorOutUri;
		overflow="hidden";
		visibility="visible";
	}
	
	this.showQuickMoveImg();

}
//written by 简伟军
function getImgsrcArray(num,colscount,rowscount) {
	var retArray=new Array();
	var tempArray=new Array();	
	var row=0;
	if(num%colscount==0) row=Math.ceil(num/colscount);
	else row=Math.ceil(num/colscount)-1;
	var col=num%colscount;
	retArray.push(num);
	if(colscount>=2&&rowscount>=2) {    
		if(row>0&&row<rowscount-1) {
			if(col>0&&col<colscount-1){
				var from=num - (colscount+1);
				for(i=from;i<from+3&&i<row*colscount;i++){
					retArray.push(i);
				}
				for(i=from+3;i<row*colscount;i++){
					tempArray.push(i);
				}
				retArray.push(num-1);
				for(i=num-2;i>=row*colscount;i--){
					tempArray.push(i);
				}
				retArray.push(num+1);
				for(i=num+2;i<(row+1)*colscount;i++){	     	        
	   				tempArray.push(i);
				}
				from=num + (colscount-1);
				for(i=from-1;i>=(row+1)*colscount;i--){
					tempArray.push(i);
				}
				for(i=from;i<from+3&&i<rowscount*colscount;i++){
					retArray.push(i);
				}
				for(i=from+3;i<rowscount*colscount;i++){
					tempArray.push(i);
				}
				for(i=num - (colscount+1)-1;i>=0;i--){
					tempArray.push(i);
				}
			}
			else if(col==0){
				var from=num - colscount;
				for(i=0;i<from;i++){
					tempArray.push(i);
				}
				for(i=from;i<from+2&&i<row*colscount;i++){
					retArray.push(i);
				}
				for(i=from+2;i<row*colscount;i++){
					tempArray.push(i);
				}
				retArray.push(num+1);
				for(i=num+2;i<(row+1)*colscount;i++){	     	        
					tempArray.push(i);
				}	      
				from=num + colscount;
				for(i=from;i<from+2&&i<rowscount*colscount;i++){
					retArray.push(i);
				}
				for(i=from+2;i<rowscount*colscount;i++){
					tempArray.push(i);
				}
			}
			else if(col==colscount-1){
				var from=num - (colscount+1);
				for(i=0;i<from;i++){
					tempArray.push(i);
				}
				for(i=from;i<from+2&&i<row*colscount;i++){
					retArray.push(i);
				}
				retArray.push(num-1);
				for(i=row*colscount;i<num-1;i++){	     	        
					tempArray.push(i);
				}	      
				from=num + (colscount-1);
				for(i=(row+1)*colscount;i<from;i++){
					tempArray.push(i);
				}
				for(i=from;i<from+2&&i<(row+2)*colscount;i++){
				retArray.push(i);
				}
				for(i=(row+2)*colscount;i<rowscount*colscount;i++){
					tempArray.push(i);
				}
			}
		}
		else if(row==0){
			if(num!=0&&col!=colscount-1){
				var from=num;
				retArray.push(num-1);
				for(i=num-2;i>=0;i--){
					tempArray.push(i);
				}
				retArray.push(num+1);

				for(i=num+2;i<colscount;i++){	     	        
					tempArray.push(i);
				}	      
				from=num + (colscount-1);
				for(i=from-1;i>=(row+1)*colscount;i--){
					tempArray.push(i);
				}

				for(i=from;i<from+3&&i<rowscount*colscount;i++){
					retArray.push(i);
				}

				for(i=from+3;i<rowscount*colscount;i++){
					tempArray.push(i);
				}
			}
			else if(num==0){
				retArray.push(num+1);

				for(i=num+2;i<(row+1)*colscount;i++){	     	        
					tempArray.push(i);
				}	      
				var from=num + colscount;	      
				for(i=from;i<from+2&&i<rowscount*colscount;i++){
					retArray.push(i);
				}

				for(i=from+2;i<rowscount*colscount;i++){
					tempArray.push(i);
				}
			}
			else if(col==colscount-1){
				retArray.push(num-1);
				for(i=num-2;i>=0;i--){	     	        
					tempArray.push(i);
				}		 
				var from=num + (colscount-1);
				for(i=from-1;i>=(row+1)*colscount;i--){
					tempArray.push(i);
				}
				for(i=from;i<from+2&&i<(row+2)*colscount;i++){
					retArray.push(i);
				}

				for(i=(row+2)*colscount;i<rowscount*colscount;i++){
					tempArray.push(i);
				}

			}
		}
		else if(row==rowscount-1){
			if(col!=0&&col!=colscount-1){
				var from=num;
				retArray.push(num-1);
				for(i=num-2;i>=row*colscount;i--){
					tempArray.push(i);
				}
				retArray.push(num+1);
				for(i=num+2;i<rowscount*colscount;i++){	     	        
					tempArray.push(i);
				}	      
				from=num - (colscount+1);
				for(i=from;i<from+3&&i<row*colscount;i++){
					retArray.push(i);
				}

				for(i=from+3;i<row*colscount;i++){
					tempArray.push(i);
				}

				for(i=from-1;i>=0;i--){
					tempArray.push(i);
				}
			}
			else if(col==0){
				retArray.push(num+1);

				for(i=num+2;i<(row+1)*colscount;i++){	     	        
					tempArray.push(i);
				}	      

				var from=num - colscount;	

				for(i=from;i<from+2&&i<row*colscount;i++){
					retArray.push(i);
				}

				for(i=from+2;i<row*colscount;i++){
					tempArray.push(i);
				}
				for(i=from-1;i>=0;i--){
					tempArray.push(i);
				}
			}
			else if(col==colscount-1){
				retArray.push(num-1);
				for(i=num-2;i>=row*colscount;i--){	     	        
					tempArray.push(i);
				}		 
				var from=num - (colscount+1);
				for(i=from-1;i>=0;i--){
					tempArray.push(i);
				}
				for(i=from;i<from+2&&i<row*colscount;i++){
					retArray.push(i);
				}
			}
		}
	}
	else {
		for(i=num-1;i>=0;i--){
			retArray.push(i);
		}

		for(i=num+1;i<rowscount*colscount;i++){
			retArray.push(i);
		}
	}
	var tempString='';
	for(i=0;i<tempArray.length;i++){
		retArray.push(tempArray[i]);
	}
	return retArray;
}
function ShrinkPic(){
	if(this.Status==1){
		this.DetailImgLoadCount=0;
		this.ImgdetDIV.style.visibility="hidden";
		this.ImgDIV.style.top=this.Toolbar_Height;
		this.ImgDIV.style.height=this.ValidScreenHeight-this.Toolbar_Height;
		this.ImgdetDIV.innerHTML="";
		with(this.LImgprv.style){
			position="absolute";
			cursor=this.MouseCursorLeftUri;
			right=this.ValidScreenWidth-this.LeftBlank-this.Pv_Pic_Width;
			top=this.TopBlank;
			width=this.Pv_Pic_Width;
			height=this.Pv_Pic_Height;
		}
		with(this.RImgprv.style){
			position="absolute";
			cursor=this.MouseCursorLeftUri;
			showDebugMessage(cursor,"debug");
			left=this.LeftBlank+this.Pv_Pic_Width;
			top=this.TopBlank;
			width=this.Pv_Pic_Width;
			height=this.Pv_Pic_Height;
		}
		this.Status=0;
		MiniMap.dmiDoHide();
		if(this.BorderTable!=null){
			this.BorderTable.style.visibility="visible";
			this.BorderTable.style.cursor=this.MouseCursorLeftUri;
		}
		this.Shadow.style.visibility="visible";
	}
}
function LeafForward(){
	if(typeof(this.currentPageNo)=="undefined"){
		setTimeout("LeafForward()",100);
		return;
	}
	if(this.currentPageNo>0){
		if(this.noWait||this.LastImgBufferReady==2){
			this.GotoPage(this.currentPageNo-2);
		}
		else{
			setTimeout("LeafForward()",100);
			return;
		}
	}
	else{
		alert("已经到达最前页!");
		return;
	}
}
function LeafBackward(){
	if(typeof(this.currentPageNo)=="undefined"){
		setTimeout("LeafBackward()",100);
		return;
	}
	if(this.currentPageNo<AllPages-2){
		if(this.noWait||this.NextImgBufferReady==2){
			this.GotoPage(this.currentPageNo+2);
		}
		else{
			setTimeout("LeafBackward()",100);
			return;
		}
	}
	else{
		alert("已经到达最末页!");
		return;
	}
}
function Leaf_RL() {
	clearTimeout(this.ID_Leaf_Middle);
	if(!this.noWait&&this.NextImgBufferReady<2){
		this.ID_Leaf_Middle=setTimeout(this.id+".Leaf_RL()",50);
		return;
	}
	clearTimeout(this.ID_Leaf_Middle);
	var iNewWidth=this.Pv_Pic_Width;
	for(iIdx=0;iIdx < this.PL_Step;iIdx++) {
		iNewWidth=iNewWidth-this.Pv_Pic_Width/this.PL_Step;
		this.ID_Leaf_Middle=setTimeout(this.id+".SetObjWidth("+this.RImgprv.id+","+iNewWidth+")",(iIdx+1)* this.PL_DelayTime);
	}
	this.ID_Leaf_Middle=setTimeout(this.id+".Leaf_LL()",iIdx * this.PL_DelayTime);
}
function Leaf_LL() {
	if(this.noWait){
		this.RImgprv.src="file://d:/blank.gif";
		this.NextImgBufferR.style.visibility="hidden";
	}
	this.RImgprv.src=this.NextImgBufferR.src;
	this.RImgprv.style.width=this.Pv_Pic_Width;
	clearTimeout(this.ID_Leaf_Middle);
	var iNewWidth=0;
	if(this.noWait){
		this.LImgprv.src="file://d:/blank.gif";
		this.NextImgBufferL.style.visibility="hidden";
	}
	this.LImgprv.src=this.NextImgBufferL.src;
    for(iIdx=0;iIdx < this.PL_Step;iIdx++) {
		iNewWidth=iNewWidth+this.Pv_Pic_Width/this.PL_Step;
		this.ID_Leaf_Middle=setTimeout(this.id+".SetObjWidth("+this.LImgprv.id+","+iNewWidth+")",(iIdx+1)* this.PL_DelayTime);
    }
	this.ID_Leaf_Middle=setTimeout(this.id+"."+"Leaf_End_Left()",iIdx * this.iPL_DelayTime);
}
function Leaf_End_Left() {
	clearTimeout(this.ID_Leaf_Middle);
}
function Leaf_LR() {
	clearTimeout(this.ID_Leaf_Middle);
	if(!this.noWait&&this.LastImgBufferReady<2){
		this.ID_Leaf_Middle=setTimeout(this.id+".Leaf_LR()",50);
		return;
	}
	clearTimeout(this.ID_Leaf_Middle);
	var iNewWidth=this.Pv_Pic_Width;
	for(iIdx=0;iIdx < this.PL_Step;iIdx++) {
		iNewWidth=iNewWidth-this.Pv_Pic_Width/this.PL_Step;
		this.ID_Leaf_Middle=setTimeout(this.id+".SetObjWidth("+this.LImgprv.id+","+iNewWidth+")",(iIdx+1)* this.PL_DelayTime);
	}
	this.ID_Leaf_Middle=setTimeout(this.id+".Leaf_RR()",iIdx * this.PL_DelayTime);
}
function Leaf_RR() {
	if(this.noWait){
		this.LImgprv.src="file://d:/blank.gif";
		this.LastImgBufferL.style.visibility="hidden";
	}
	this.LImgprv.src=this.LastImgBufferL.src;
	this.LImgprv.style.width=this.Pv_Pic_Width;
	clearTimeout(this.ID_Leaf_Middle);
	var iNewWidth=0;
	if(this.noWait){
		this.RImgprv.src="file://d:/blank.gif";
		this.LastImgBufferR.style.visibility="hidden";
	}
	this.RImgprv.src=this.LastImgBufferR.src;
	for(iIdx=0;iIdx < this.PL_Step;iIdx++) {
		iNewWidth=iNewWidth+this.Pv_Pic_Width/this.PL_Step;
		this.ID_Leaf_Middle=setTimeout(this.id+".SetObjWidth("+this.RImgprv.id+","+iNewWidth+")",(iIdx+1)* this.PL_DelayTime);
    }
	this.ID_Leaf_Middle=setTimeout(this.id+"."+"Leaf_End_Right()",iIdx * this.iPL_DelayTime);
}
function Leaf_End_Right() {
	clearTimeout(this.ID_Leaf_Middle);
}
function SetObjWidth(arg_Obj,arg_Width) {
	if(arg_Width > this.Pv_Pic_Width) {
        arg_Width=this.Pv_Pic_Width;
    }
    arg_Obj.style.width=arg_Width;
}
function MovePic(x,y){	
	this.LeftOffset=0-x+this.ValidScreenWidth/2;
	this.TopOffset=0-(y-this.Toolbar_Height)+(this.ValidScreenHeight-this.Toolbar_Height)/2;	
	this.EnlargePic();
}
function ImgBufferReady(arg_obj){
	switch(arg_obj.id){
		case "LastImgBufferL":
			this.LastImgBufferReady++;
			break;
		case "LastImgBufferR":
			this.LastImgBufferReady++;
			break;
		case "NextImgBufferL":
			this.NextImgBufferReady++;
			break;
		case "NextImgBufferR":
			this.NextImgBufferReady++;
			break;
		default:
	}
}
function GotoPage(newPageNo){
	newPageNo=parseInt(newPageNo,10);
	if(isNaN(newPageNo)){
		return;
	}
	this.TxtdetDIV.style.visibility="hidden";
	if(newPageNo%2==1){
		newPageNo--;
	}
	if(newPageNo<0){
		newPageNo=0
	}
	else if(newPageNo>=AllPages){
		newPageNo=AllPages-2;
	}
	if(newPageNo!=this.currentPageNo){
		this.PreLoadImg(newPageNo);
		if(this.Status==1){
			this.ShrinkPic();
		}
		if(newPageNo<this.currentPageNo){
			this.Leaf_LR();
		}
		else if(newPageNo>this.currentPageNo){
			this.Leaf_RL();
		}
		this.currentPageNo=newPageNo;
		PageNo=this.currentPageNo<100?("0"+(this.currentPageNo<10?("0"+this.currentPageNo):this.currentPageNo)):this.currentPageNo;
		toolbar.showPageNumber(this.currentPageNo);
		addCookieNumber("pages");
		this.showNextPageDiv();
		try{
			if(!isOffline)neteaseTracker();
		}catch(ex){}
	}
}
function GotoSearch(keywords){
	if(keywords.length>1&&keywords.indexOf("请输入")<0){
		window.open("http://co.163.com/neteaseivp/ecatalog/index.jsp?keyword="+keywords+"&way="+WAY);
	}
}
function MiniMap() {
	this.id="MiniMap";
	try {
		this.ParentDiv=arguments[0];
		this.Left=arguments[1];
		this.Top=arguments[2];
	} catch(e) {}
	this.MiniMapBaseDiv=null;
	this.MiniMapLastLImgSrc=null;//上一次左边的小图
	this.MiniMapLastRImgSrc=null;//上一次右边的小图
	this.MiniMapLImg=null;
	this.MiniMapRImg=null;
	this.ScaleDiv=null;
	this.ShadowDiv=null;
	this.Scale=0;
	this.bDraged=false;
	this.DragScaleDivClickPos=new Point();
	this.ScalePos=new Point();
	this.DragMiniMapBaseDivClickPos=new Point();
	this.MiniMapPos=new Point();
	this.DragScaleDiv=DragScaleDiv;
	this.DragMiniMapBaseDiv=DragMiniMapBaseDiv;
	this.SetMiniMapImg=SetMiniMapImg;
	this.dmiInitial=dmiInitial;
	this.dmiDoShow=dmiDoShow;
	this.dmiDoHide=dmiDoHide;
	this.ResizeMiniMap=ResizeMiniMap;
	this.OnMouseDownScaleDiv=OnMouseDownScaleDiv;
	this.OnMouseMoveScaleDiv=OnMouseMoveScaleDiv;
	this.OnMouseUpScaleDiv=OnMouseUpScaleDiv;
	this.OnMouseMoveMiniMapBaseDiv=OnMouseMoveMiniMapBaseDiv;
	this.OnMouseUpMiniMapBaseDiv=OnMouseUpMiniMapBaseDiv;
	this.iLoadMiniMapImgCount=0;
	this.dmiInitial();
}
function dmiInitial() {
	if(typeof(this.Left)=="undefined") {
		this.Left=0
	}
	if(typeof(this.Top)=="undefined") {
		this.Top=0
	}
	var tmpMiniMap2BaseDiv=document.createElement("DIV");
	this.ParentDiv.appendChild(tmpMiniMap2BaseDiv);
	tmpMiniMap2BaseDiv.outerHTML="<div id=\"MiniMapBaseDiv\" onmousemove=\""+this.id+".OnMouseMoveMiniMapBaseDiv("+"MiniMapBaseDiv"+")\" onmouseup=\""+this.id+".OnMouseUpMiniMapBaseDiv("+"MiniMapBaseDiv"+")\" </div>";
	this.MiniMapBaseDiv=MiniMapBaseDiv;
	delete tmpMiniMap2BaseDiv;
	with(this.MiniMapBaseDiv.style) {
		position="absolute";
		width=0;
		height=0;
		left=this.Left;
		top=this.Top;
		visibility="hidden";
		overflow="hidden";
		border="1 solid black";
		backgroundColor="blue";
		zIndex=20;
	}
	var tmpLeftImg=document.createElement("IMG");
	this.MiniMapBaseDiv.appendChild(tmpLeftImg);
	tmpLeftImg.outerHTML=" <img id=\"MiniMapLImg\" onload=\"OnLoadMiniMapImg()\""+">";
	this.MiniMapLImg=MiniMapLImg;
	with(this.MiniMapLImg.style) {
		position="absolute";
		left=0;
		top=0;
		zIndex=5;
	}
	var tmpRightImg=document.createElement("IMG");
	this.MiniMapBaseDiv.appendChild(tmpRightImg);
	tmpRightImg.outerHTML=" <img id=\"MiniMapRImg\" onload=\"OnLoadMiniMapImg()\""+">";
	this.MiniMapRImg=MiniMapRImg;
	with(this.MiniMapRImg.style) {
		position="absolute";
		left=0;
		top=0;
		zIndex=5;
	}
	var tmpScaleDiv=document.createElement("DIV");
	this.MiniMapBaseDiv.appendChild(tmpScaleDiv);
	tmpScaleDiv.outerHTML=" <div id=\"ScaleDiv\" onmousedown=\""+this.id+".OnMouseDownScaleDiv()\" onmousemove=\""+this.id+".OnMouseMoveScaleDiv()\" onmouseup=\""+this.id+".OnMouseUpScaleDiv()\" > </div>";
	delete tmpScaleDiv;
	this.ScaleDiv=ScaleDiv;
	with(this.ScaleDiv.style) {
		position="absolute";
		filter="alpha(opacity=0)";
		left=0;
		top=0;
		width=0;
		height=0;
		zIndex=20;
		backgroundColor="blue";
	}
    var tmpShadowDiv=document.createElement("DIV");
    this.MiniMapBaseDiv.appendChild(tmpShadowDiv);
    tmpShadowDiv.outerHTML=" <div id=\"ShadowDiv\"> </div>";
    delete tmpShadowDiv;
    this.ShadowDiv=ShadowDiv;
    with(this.ShadowDiv.style) {
        position="absolute";
        border="2 solid red";
        cursor="default";
        left=0;
        top=0;
        width=0;
        height=0;
        zIndex=10;
    }
}
function OnLoadMiniMapImg() {
    this.MiniMap.iLoadMiniMapImgCount=this.MiniMap.iLoadMiniMapImgCount+1;
    if(this.MiniMap.iLoadMiniMapImgCount !=2) {
        return;
    }
    this.MiniMap.ResizeMiniMap();
    this.MiniMap.iLoadMiniMapImgCount=0;
	if(book.Status==0) {
        this.MiniMap.dmiDoHide();
    } else {
        this.MiniMap.dmiDoShow();
    }
}
function ResizeMiniMap() {
	this.MiniMapBaseDiv.style.width=this.MiniMapLImg.width * 2;
	this.MiniMapBaseDiv.style.height=this.MiniMapLImg.height;
	this.MiniMapRImg.style.left=this.MiniMapLImg.width;
	this.Scale=this.MiniMapLImg.height/Pic_Height;
	this.ScaleDiv.style.width=book.ValidScreenWidth*this.MiniMapLImg.width/Pic_Width;
	this.ScaleDiv.style.height=(book.ValidScreenHeight-book.Toolbar_Height)*this.MiniMapLImg.height/Pic_Height;
	this.ScaleDiv.style.left=Math.ceil(-book.LeftOffset * this.Scale);
	this.ScaleDiv.style.top=Math.ceil(-book.TopOffset * this.Scale);
	if(parseInt(this.ScaleDiv.style.left,10)<0){
		this.ScaleDiv.style.left=2;
	}
	else if(parseInt(this.ScaleDiv.style.left)+parseInt(this.ScaleDiv.style.width)+4>parseInt(this.MiniMapBaseDiv.style.width)){
		this.ScaleDiv.style.left=parseInt(this.MiniMapBaseDiv.style.width)-parseInt(this.ScaleDiv.style.width)-2;
	}
	if(parseInt(this.ScaleDiv.style.top,10)<0){
		this.ScaleDiv.style.top=2;
	}
	else if(parseInt(this.ScaleDiv.style.top)+parseInt(this.ScaleDiv.style.height)+4>parseInt(this.MiniMapBaseDiv.style.height)){
		this.ScaleDiv.style.top=parseInt(this.MiniMapBaseDiv.style.height)-parseInt(this.ScaleDiv.style.height)-2;
	}
    this.ShadowDiv.style.width=parseInt(this.ScaleDiv.style.width);
    this.ShadowDiv.style.height=parseInt(this.ScaleDiv.style.height);
    this.ShadowDiv.style.left=parseInt(this.ScaleDiv.style.left);
    this.ShadowDiv.style.top=parseInt(this.ScaleDiv.style.top);
}
function SetMiniMapImg() {
	this.MiniMapLImg.style.height=130;
	this.MiniMapRImg.style.height=130;
	showDebugMessage("init mini map img","debug");
	var needShow=false;
	var nextPageNo=parseInt(book.currentPageNo,10)+1;
	nextPageNo=nextPageNo<100?("0"+(nextPageNo<10?("0"+nextPageNo):nextPageNo)):nextPageNo;
	//判断上一次的图片和这一次的图片是否相同
	var lsrc=Pic_Path_Base+"/"+PageNo+(isOffline?".jpg":"/"+PageNo+".jpg.s");
	if(this.MiniMapLastLImgSrc!=lsrc){
		this.MiniMapLastLImgSrc=lsrc;
		this.MiniMapLImg.src=lsrc;
	}
	else{
		needShow=true;
	}
	var rsrc=Pic_Path_Base+"/"+nextPageNo+(isOffline?".jpg":"/"+nextPageNo+".jpg.s");
	if(this.MiniMapLastRImgSrc!=rsrc){
		this.MiniMapLastRImgSrc=rsrc;
		this.MiniMapRImg.src=rsrc;
	}	
	else{
		needShow=true;
	}
	return needShow;
}

	
function dmiDoShow() {
	this.MiniMapBaseDiv.style.visibility="visible";
	this.MiniMapLImg.style.visibility="visible";
	this.MiniMapRImg.style.visibility="visible";
	this.ScaleDiv.style.visibility="visible";
}
function dmiDoHide() {
	this.MiniMapBaseDiv.style.visibility="hidden";
	this.MiniMapLImg.style.visibility="hidden";
	this.MiniMapRImg.style.visibility="hidden";
	this.ScaleDiv.style.visibility="hidden";
}
function DragScaleDiv(arg_x,arg_y) {
    var iVariation_X;
    var iVariation_Y;
    var ResultDragTop=0;
    var ResultDragLeft=0;
    iVariation_X=arg_x;
    iVariation_Y=arg_y;
    ResultDragLeft=(iVariation_X-parseInt(MiniMap.MiniMapBaseDiv.style.left,10)-parseInt(MiniMap.ScaleDiv.style.width,10)/2)/MiniMap.Scale;
    ResultDragTop=(iVariation_Y-parseInt(MiniMap.MiniMapBaseDiv.style.top,10)-book.Toolbar_Height-parseInt(MiniMap.ScaleDiv.style.height,10)/2)/MiniMap.Scale;
    if(ResultDragLeft < 0) {
        ResultDragLeft=0;
    }
    if(ResultDragTop < 0) {
        ResultDragTop=0;
    }
    if(ResultDragLeft > Pic_Width*2) {
        ResultDragLeft=Pic_Width*2;
    }
    if(ResultDragTop > Pic_Height) {
        ResultDragTop=Pic_Height;
    }
	book.LeftOffset=-ResultDragLeft;
	book.TopOffset=-ResultDragTop;
	book.EnlargePic();
}
function DragMiniMapBaseDiv(arg_X,arg_Y) {
    var iVariation_X;
    var iVariation_Y;
    var ResultDragTop=0;
    var ResultDragLeft=0;
    iVariation_X=arg_X;
    iVariation_Y=arg_Y;
    ResultDragLeft=iVariation_X-parseInt(this.MiniMapBaseDiv.style.width,10)/2;
    ResultDragTop=iVariation_Y-book.Toolbar_Height-parseInt(MiniMap.MiniMapBaseDiv.style.height,10)/2;
    if(ResultDragLeft < 0) {
        ResultDragLeft=0;
    }
    if(ResultDragTop < 0) {
        ResultDragTop=0;
    }
    if(ResultDragLeft > book.ValidScreenWidth-parseInt(this.MiniMapBaseDiv.style.width,10)) {
        ResultDragLeft=book.ValidScreenWidth-parseInt(this.MiniMapBaseDiv.style.width,10);
    }
    if(ResultDragTop > book.ValidScreenHeight-book.Toolbar_Height-parseInt(this.MiniMapBaseDiv.style.height,10)) {
        ResultDragTop=book.ValidScreenHeight-book.Toolbar_Height-parseInt(this.MiniMapBaseDiv.style.height,10);
    }
    this.MiniMapBaseDiv.style.left=ResultDragLeft;
    this.MiniMapBaseDiv.style.top=ResultDragTop;
}
function OnMouseDownScaleDiv() {
	showDebugMessage("OnMouseDownScaleDiv:button="+event.button,"debug");
    switch(event.button) {
    case 1 :
        this.ScaleDiv.setCapture();
        this.ScaleDiv.style.cursor="move";
        break;
    case 2 :
        break;
    }
    event.cancelBubble=true;
}
function OnMouseMoveScaleDiv() {
	showDebugMessage("OnMouseMoveScaleDiv:x="+event.x+";y="+event.y,"debug");
    var iXPos=event.x;
    var iYPos=event.y;
    switch(event.button) {
    case 1 :
        setTimeout(this.id+".DragScaleDiv("+iXPos+","+iYPos+")",1);
        break;
    }
    event.cancelBubble=true;
}
function OnMouseUpScaleDiv() {
	showDebugMessage("OnMouseUpScaleDiv:button="+event.button,"debug");
    switch(event.button) {
    case 1 :
        this.ScaleDiv.releaseCapture();
        this.ScaleDiv.style.cursor="default";
        break;
    }
    event.cancelBubble=true;
}

function OnMouseMoveMiniMapBaseDiv(arg_Obj) {
	showDebugMessage("OnMouseMoveMiniMapBaseDiv:x="+event.x+";y="+event.y,"debug");
	var iXPos=event.x;
	var iYPos=event.y;
	switch(event.button) {
	case 1 :
        arg_Obj.setCapture();
		this.bDraged=true;
        arg_Obj.style.cursor="move";
		setTimeout(this.id+".DragMiniMapBaseDiv("+iXPos+","+iYPos+")",1);
		break;
	}
	event.cancelBubble=true;
}
function OnMouseUpMiniMapBaseDiv(arg_Obj) {
	showDebugMessage("OnMouseMoveMiniMapBaseDiv:x="+event.x+";y="+event.y+";bDraged="+this.bDraged,"debug");
    switch(event.button) {
    case 1 :
		if(this.bDraged){
			arg_Obj.releaseCapture();
			this.bDraged=false;
			arg_Obj.style.cursor="default";
		}
		else{
			var iXPos=event.x;
			var iYPos=event.y;
			this.DragScaleDiv(iXPos,iYPos);
		}
        break;
    }
    event.cancelBubble=true;
}
function Toolbar(){
	this.id="toolbar";
	this.showText=showText;
	this.topTable=null;
	this.bottomTable=null;
	this.CatalogDiv=null;
	this.CatalogTable=null;
	this.initialToolbar=initialToolbar;
	this.printImg=printImg;
	this.check_printForm=check_printForm;
	this.showPageNumber=showPageNumber;
	this.MM_swapImgRestore=MM_swapImgRestore;
	this.MM_preloadImages=MM_preloadImages;
	this.MM_findObj=MM_findObj;
	this.MM_swapImage=MM_swapImage;
	this.MM_showHideLayers=MM_showHideLayers;
	this.MM_showHideLayers2=MM_showHideLayers2;
	this.openSourceMap=openSourceMap;
	
	this.initialToolbar();
}
function initialToolbar(){
	var tabletmp=document.createElement('TABLE');
	book.ToolBar.appendChild(tabletmp);
	tabletmp.outerHTML="<table id=\"topTable\"> </table>";
	this.topTable=topTable;
	delete tabletmp;
	this.topTable.width="100%";
	this.topTable.height="25";
	this.topTable.border=0;
	this.topTable.cellSpacing=0;
	this.topTable.cellPadding=0
	topTable.background="images/topbg.gif";
	with(this.topTable.style){
		backgroundRepeat="repeat-x";
		backgroundPosition="left top";
	}
	var myrow=this.topTable.insertRow();
	var mycol=myrow.insertCell();	
	mycol.noWrap="true";
	mycol.width=85;
	mycol.innerHTML="<a href=\"../index.htm\"><img src=\"images/eclogo.gif\" border=0 height=25 width=75></a>";
	
	var mycol=myrow.insertCell();
	mycol.noWrap="true";
	var td=mycol;
	mycol.width=10;
	mycol.innerHTML="";
	//mycol.innerHTML="<a href=\"http://co.163.com/forum/content/98_200826_1.htm\" target=\"_blank\" class=\"greenfont\">下载阅读器</a>";
	with(td.style){
		paddingTop=4;
	}

	var mycol=myrow.insertCell();
	mycol.noWrap="true";
	mycol.width=500;
	
	var mycol=myrow.insertCell();
	mycol.noWrap="true";
	mycol.width=170;
	mycol.innerHTML="";
	//mycol.innerHTML="<font color=\"#555555\"><strong>搜索</strong></font>&nbsp;<input id=\"ecsearch\" type=\"text\" size=\"12\" style=\"height:20px;color:#999999;\" onFocus=\"if(this.value=='请输入关键字')this.value='';\" onBlur=\"if(this.value=='')this.value='请输入关键字';\" value=\"请输入关键字\" onKeyDown=\"if(event.keyCode==13)book.GotoSearch(ecsearch.value);else return\">&nbsp;<img src=\"images/button_go.gif\" border=0 style=\"cursor:hand;\" align=\"absmiddle\" onclick=\"book.GotoSearch(ecsearch.value)\">";

	var mycol=myrow.insertCell();
	mycol.noWrap="true";
	mycol.style.paddingRight=5;
	mycol.align="right";
	mycol.vAlign="middle";
	mycol.innerHTML="<a href=\"#\" class=\"bluefont\" onClick=\"copyClipboard()\">复制本页地址</a><img src=\"images/spaceline.gif\" align=absMiddle><a href=\"../index.htm\" class=\"bluefont\">返回公司首页</a><img src=\"images/spaceline.gif\" align=absMiddle><a href=\"../contact.asp\" class=\"bluefont\">联系我们</a>"+(isOffline?"":"<img src=\"images/spaceline.gif\" align=absMiddle><a href=# class=\"bluefont\" onMouseOver=\"MM_showHideLayers('ReportDiv','','show')\">看不清楚？</a>")+"<img src=\"images/spaceline.gif\" align=absMiddle><img src=images/button_print.gif height=20 width=52 border=0 align=absMiddle style=\"cursor:hand;\" onclick=\"MM_showHideLayers2('PrintDivs)\">";

	var tabletmp=document.createElement('TABLE');
	book.ToolBar.appendChild(tabletmp);
	tabletmp.outerHTML="<table width=100% height=25 border=0 cellspacing=0 cellpadding=0 style=\"background:url(images/topbg.gif) repeat-x left bottom;border-bottom:#333333 1px solid;\"><tr><td><table id=\"bottomTable\"> </table></td></tr></table>";
	this.bottomTable=bottomTable;
	delete tabletmp;
	this.bottomTable.height="24";
	this.bottomTable.border=0;
	this.bottomTable.cellSpacing=0;
	this.bottomTable.cellPadding=0;

	var myrow=this.bottomTable.insertRow();
	var td=myrow.insertCell();
	td.noWrap="true";
	with(td.style){
		paddingLeft=10;
		paddingTop=4;
	}
	td.innerHTML="<a href=\"#\" onMouseOver=\"MM_showHideLayers('CatalogDiv','','show')\"><img src=\"images/pic_catalog.gif\" align=absmiddle border=0 height=20 width=83></a>";
	
	var td=myrow.insertCell();
	td.noWrap="true";
	with(td.style){
		paddingLeft=10;
	}
	td.innerHTML="<span id='popo'></span>"+(isOffline?"":"　<a href=\"http://co.163.com/neteaseivp/ecatalog/down_client.jsp?bookId=" + BookId + "\" target=\"_blank\"><img src=\"http://co.163.com/neteaseivp/co163/images/button_ecdown.gif\" border=0 align=absmiddle></a>");

	var td=myrow.insertCell();
	td.noWrap="true";
	with(td.style){
		paddingLeft=15;
		paddingRight=15;
		paddingTop=5;
	}
	td.innerHTML="<span title=\""+Telephone+"\" style=\"width:"+(book.ValidScreenWidth-300)+";overflow:hidden;white-space:nowrap;text-overflow:ellipsis;\"><a href=\""+CorpURL+"\" class=\"bluefont bfont\" target=_blank>"+CorpName+"</a>"+(Telephone.length>0?("　　联系电话："+Telephone):"")+"</span>";
	
	var catalogtmp=document.createElement('DIV');
	this.bottomTable.rows(0).cells(0).appendChild(catalogtmp);
	catalogtmp.outerHTML="<div id=\"CatalogDiv\" onMouseOver=\"MM_showHideLayers('CatalogDiv','','show')\" onMouseOut=\"MM_showHideLayers('CatalogDiv','','hide')\"> </div>";
	this.CatalogDiv=CatalogDiv;
	delete catalogtmp;
	with(this.CatalogDiv.style){
		position="absolute";
		height=300;
		top=50;
		left=10;
		width=151;
		visibility="hidden";
		overflowY="auto";
		filter="alpha(opacity=90)";
	}

	var catalogtmp=document.createElement('TABLE');
	this.CatalogDiv.appendChild(catalogtmp);
	catalogtmp.outerHTML="<table id=\"CatalogTable\"> </table>";
	this.CatalogTable=CatalogTable;
	delete catalogtmp;
	this.CatalogTable.width="100%";
	this.CatalogTable.border=0;
	this.CatalogTable.cellSpacing=1;
	this.CatalogTable.cellPadding=3;
	this.CatalogTable.bgColor="#e2e2e2";
	for(i=0;i<Catalogs.length;i+=2){
		var td=this.CatalogTable.insertRow().insertCell();
		td.bgColor="#ffffff";
		td.innerHTML=Math.ceil(i/2+1)+" <a href=\"#\" onclick=\"book.GotoPage("+Catalogs[i+1]+");addCookieNumber('menuJump')\" class=\"text3\">"+Catalogs[i]+"</a>";
	}
	
	var catalogtmp=document.createElement('DIV');
	this.topTable.rows(0).cells(3).appendChild(catalogtmp);
	catalogtmp.outerHTML="<div id=\"ReportDiv\" onMouseOver=\"MM_showHideLayers('ReportDiv','','show')\" onMouseOut=\"MM_showHideLayers('ReportDiv','','hide')\"> </div>";
	this.ReportDiv=ReportDiv;
	delete catalogtmp;
	with(this.ReportDiv.style){
		position="absolute";
		top=26;
		width=150;
		right=5;
		visibility="hidden";
		border="1 solid #333333";
		background="#FFFFCC";
	}
	this.ReportDiv.innerHTML="<table border=0 cellpadding=5><tr><td style=\"line-height:18px;font-weight:bold;color:#444444;\">1、点击放大后，图片下载需要一定时间，请耐心等待。<br>2、如图片下载完成后，仍觉得样本模糊，您可下载原图(<a href=\"#\" class=text2 onclick=\"openSourceMap(0)\">左</a> <a href=\"#\" class=text2 onclick=\"openSourceMap(1)\">右</a>)</td></tr></table>";

	var catalogtmp=document.createElement('DIV');
	this.topTable.rows(0).cells(4).appendChild(catalogtmp);
	catalogtmp.outerHTML="<div id=\"PrintDiv\"> </div>";
	this.PrintDiv=PrintDiv;
	delete catalogtmp;
	with(this.PrintDiv.style){
		position="absolute";
		top=26;
		width=150;
		right=5;
		visibility="hidden";
		border="1 solid #333333";
		zindex=50;
	}
	this.PrintDiv.innerHTML="<table border=0 bgcolor=\"#FFFFCC\" cellSpacing=0 cellPadding=0><form name=printForm onsubmit=\"return(check_printForm())\"><tr><td style=\"padding:5px;\"><input type=\"radio\" name=\"Print_range\" checked> 当前页 <input type=\"checkbox\" name=\"Print_left\" checked>左 <input type=\"checkbox\"  name=\"Print_right\" checked>右<br><input type=\"radio\" name=\"Print_range\"> 全部页<br><input type=\"radio\" name=\"Print_range\"> 选定范围 <br><input type=\"text\" name=\"Print_pages\"><br>请输入页码，以英文逗号隔开。（例如：0,2,3）</td></tr><tr><td align=center style=\"padding-bottom:5px;\"><input type=\"submit\" value=\"打印\"> <input type=\"reset\" value=\"关闭\" onclick=\"MM_showHideLayers('PrintDiv','','hide')\"></td></tr></form></table>";

	var catalogtmp=document.createElement('DIV');
	this.topTable.rows(0).cells(4).appendChild(catalogtmp);
	catalogtmp.outerHTML="<div id=\"Recommend\"> </div>";
	this.Recommend=Recommend;
	delete catalogtmp;
	with(this.Recommend.style){
		position="absolute";
		top=26;
		width=300;
		right=5;
		visibility="hidden";
		border="1 solid #333333";
		zindex=50;
	}
	this.Recommend.innerHTML="<table border=0 bgcolor=\"#FFFFCC\" cellSpacing=0 cellPadding=5>	<form name=mailForm onsubmit=\"return(check_mailForm())\">	<tr><td align=\"right\" style=\"padding:5px;\">您的姓名：</td>	  <td style=\"padding:5px;\"><input name=\"myname\" type=\"text\" size=\"12\"></td>	</tr>	<tr><td align=\"right\" style=\"padding:5px;\">您朋友的姓名：</td>	  <td style=\"padding:5px;\"><input name=\"fname\" type=\"text\" size=\"12\"></td>	</tr>	<tr><td align=\"right\" style=\"padding:5px;\">您朋友的邮箱：</td>	  <td style=\"padding:5px;\"><input name=\"fmail\" type=\"text\" size=\"20\"></td>	</tr>	<tr><td align=\"left\" style=\"padding:5px;word-break:break-all\" valign=top colspan=2 width=300>邮件内容：<br>	  <label>　　您的朋友给您推荐了一本样本《"+BookTitle+"》，您可以用浏览器打开此链接查看样本:<br>http://co.163.com/gs_"+BookId+"_0.htm	  </label></td>	</tr>	<tr><td align=\"right\" style=\"padding:5px;\">补充：</td>	  <td style=\"padding:5px;\"><textarea name=\"content\" cols=\"23\" rows=\"4\"></textarea></td>	</tr>	<tr><td colspan=\"2\" align=center style=\"padding-bottom:5px;\"><input type=\"reset\" value=\"关闭\" onclick=\"MM_showHideLayers('Recommend','','hide')\"> <input type=\"submit\" value=\"发送\"></td>	  </tr>	</form></table>";
	var catalogtmp=document.createElement('DIV');
	this.topTable.rows(0).cells(4).appendChild(catalogtmp);		
	catalogtmp.outerHTML="<div id=\"NameCard\"> </div>";
	this.NameCard=NameCard;
	delete catalogtmp;
	with(this.NameCard.style){
		position="absolute";
		top=0;
		width=549;
		height=0;
		right=5;
		visibility="hidden";
		border="1 solid #333333";
		zindex=50;
		textAlign="center";
		backgroundColor="#ffffff";
	}
    this.NameCard.innerHTML="<iframe id=\"NameCardFrame\" name=\"NameCardFrame\" width=100% height=0 frameborder=0 scrolling=No marginheight=0 marginwidth=0 src=\"about:blank\"></iframe><div id=NameCardButtonDiv style=\"font-size:14px;font-weight:bold\"><div id=\"NameCardButtonTop\" style=\"padding-top:6px;border-top:1px solid #333333;\" ></div><div id=\"NameCardButtonUnder\" style=\"padding-top:6px;border-top:1px solid #333333;\" ></div></div>";
	
	var td=this.topTable.rows(0).cells(2);
	td.innerHTML=td.innerHTML+"第&nbsp;<input id=\"pageno\" type=\"text\" value=\""+book.currentPageNo+"\" size=\"2\" style=\"height:20px;font-size:9pt;\" onKeyDown=\"javascript:if(event.keyCode==13)book.GotoPage(pageno.value);else return\">&nbsp;/"+(AllPages-1)+"页&nbsp;<img src=\"images/button_go.gif\" style=\"cursor:hand;\" onclick=\"book.GotoPage(pageno.value);\" align=\"absmiddle\" height=20 width=25>&nbsp;<img src=\"images/button_play1.gif\" height=20 width=55 border=\"0\" hspace=\"2\" align=\"absmiddle\" style=\"cursor:hand;\" onclick=\"book.GotoPage(0)\"><img src=\"images/button_play2.gif\" height=20 width=55 border=\"0\" hspace=\"2\" align=\"absmiddle\" style=\"cursor:hand;\" onclick=\"book.LeafForward()\"><img src=\"images/button_play3.gif\" height=20 width=55 border=\"0\" hspace=\"2\" align=\"absmiddle\" style=\"cursor:hand;\" onclick=\"book.LeafBackward()\"><img src=\"images/button_play4.gif\" height=20 width=55 border=\"0\" hspace=\"2\" align=\"absmiddle\" style=\"cursor:hand;\" onclick=\"book.GotoPage("+(AllPages-1)+")\">";
}
function showPageNumber(newpageno){
	pageno.value=newpageno;
}
function showText(content){
	book.ToolBar.innerHTML=content;
}
function MM_swapImgRestore() {
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}
function MM_preloadImages() {
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}
function MM_findObj(n, d) {
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}
function MM_swapImage() {
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
function MM_showHideLayers() {
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v=='hide')?'hidden':v; }
    obj.visibility=v; }
}
function MM_showHideLayers2() {
  var i,p,v,obj,args=MM_showHideLayers2.arguments;
  for (i=0; i<args.length; i++) if ((obj=MM_findObj(args[i]))!=null) { 
    if (obj.style) { v=obj.style.visibility; v=(v=='visible')?'hidden':'visible'}
    obj.style.visibility=v; }
}
function printImg(args){
//	var memo="推荐厂商加入中国最大的电子样本库，特大惊喜等着你！咨询电话：020-61210163-580、583";
	var memo="";
	var one_window=window.open("about:blank","","scrollbars=yes,resizable=yes,width=800,height=600");
	one_window.document.open();
	one_window.document.write("<html><head><title>"+document.title+"</title></head><body topmargin=0 leftmargin=0>");
	Print_Pages = args.split(",");
	for(i=0;i<Print_Pages.length;i++){
		if(i==0){
			one_window.document.write("<div align=center>"+memo+"</div>");
		}
		else{
			one_window.document.write("<div align=center style=\"page-break-before:always\">"+memo+"</div>");
		}
		one_window.document.write("<img src="+Pic_Path_Base+"/"+(isOffline?"":Print_Pages[i]+"/")+Print_Pages[i]+".jpg width=100%>");
		addCookieNumber("Print");
	}
	one_window.document.close();
	one_window.window.print();
	one_window.window.close();
}
function check_printForm(){
	var currentPageNo2=book.currentPageNo+1;
	PageNo1=book.currentPageNo<100?"0"+(book.currentPageNo<10?"0"+book.currentPageNo:book.currentPageNo):book.currentPageNo;
	PageNo2=currentPageNo2<100?"0"+(currentPageNo2<10?"0"+currentPageNo2:currentPageNo2):currentPageNo2;
	
	var Print_pages="";
	if(printForm.Print_range[0].checked){
		if(printForm.Print_left.checked){
			Print_pages+=","+PageNo1;
		}
		if(printForm.Print_right.checked){
			Print_pages+=","+PageNo2;
		}
	}
	else if(printForm.Print_range[1].checked){
		for(i=0;i<AllPages;i++){
			PageNo1=i<100?"0"+(i<10?"0"+i:i):i;
			Print_pages+=","+PageNo1;
		}
	}
	else if(printForm.Print_range[2].checked){
		fillPages=printForm.Print_pages.value.split(",");
		for(i=0;i<fillPages.length;i++){
			var pageNum=parseInt(fillPages[i],10);
			PageNo=pageNum<100?"0"+(pageNum<10?"0"+pageNum:pageNum):pageNum;
			Print_pages+=","+PageNo;
		}
	}
	if(Print_pages.length>0)
		printImg(Print_pages.substr(1));
	this.MM_showHideLayers('PrintDiv','','hide');
	return false;
}
function check_mailForm(){
	var myname=document.mailForm.myname.value;
	var fname=document.mailForm.fname.value;
	var fmail=document.mailForm.fmail.value;
	var content=document.mailForm.content.value;
	if(myname.length<2){
		alert("请写上您的姓名，好让您的朋友知道您是谁。");
		document.mailForm.myname.focus();
		return false;
	}
	if(fname.length<1){
		alert("请写上您朋友的姓名或者称呼。");
		document.mailForm.fname.focus();
		return false;
	}
	if(fmail.length<2){
		alert("请正确填写您朋友的邮件。不然发送不会成功。");
		document.mailForm.fmail.focus();
		return false;
	}
	else{
		var email_ok=true;
		if((at=fmail.indexOf("@"))<0){
			email_ok=false;
		}
		if((dot=fmail.lastIndexOf("."))<0){
			email_ok=false;
		}
		if(at>dot||dot>=fmail.length-1){
			email_ok=false;
		}
		if(!email_ok){
			alert("请正确填写您朋友的邮件。不然发送不会成功。");
			document.mailForm.fmail.focus();
			return false;
		}
	}
	var postData="bookid="+BookId+"&booktitle="+escape(BookTitle)+"&myname="+escape(myname)+"&fname="+escape(fname)+"&fmail="+escape(fmail)+"&content="+escape(content);
	var xmlDOM=forGetUrl(CatalogServerName+"/ebook/recommend.jsp",postData);
	var root = xmlDOM.documentElement;
	var sValue = root.getElementsByTagName('ret')[0].firstChild.data;
	if(sValue=="1"){
		alert("发送成功");
	}else{
		alert(sValue.substring(1));
	}
	this.MM_showHideLayers('Recommend','','hide');
	return false;
}
function copyClipboard(){
	window.clipboardData.setData('Text','http://www.kb0.cn/webs/index.htm');
	alert('地址已经复制，您可以通过泡泡、QQ或者邮件发给您的朋友了。');
	addCookieNumber('Copied');
	return;
}
function openSourceMap(args){
	var page_no="";
	switch(args){
		case 1:
			var nextPageNo=book.currentPageNo+1;
			nextPageNo=nextPageNo<100?("0"+(nextPageNo<10?("0"+nextPageNo):nextPageNo)):nextPageNo;
			page_no=nextPageNo;
			break;
		case 0:
			page_no=PageNo;
			break
		default:page_no="";
	}
	if(page_no!=""){
		var uploadPath=Pic_Path_Base.replace(/made/gi,"upload");
		window.open(uploadPath+"/"+page_no+".jpg");
	}
}
var colors =new Array("white","#FFFFEE","#EDF1F9");
function showNameCardDiv(step,queryType){
	var namecardframe=document.getElementById("NameCardFrame");
	
	if(step==1&&namecardframe.src=="about:blank"){	

		this.NameCardButtonTop.innerHTML=
		"<table border=\"0\" align=\"center\" cellpadding=\"1\" cellspacing=\"1\" ><tr>"
	    +"<td width=360 align=\"center\" style=\"font-size:14px;font-weight:bold;color:#d00; \">您需要下列帮助吗？</td>"
		+"<td valign=top><a href=\"javascript:closeNameCard()\"><img src=\"http://co.163.com/neteaseivp/co163/images/close.jpg\" border=0/></a></td></tr></table>";		
		
		this.NameCardButtonUnder.innerHTML=
		"<table border=\"0\" align=\"center\" cellpadding=\"1\" cellspacing=\"1\" style=\"font-size:14px;font-weight:bold;color:#d00; \"> "
  		+"<tr><td ><div align=\"center\" style=\"font-size:14px;font-weight:bold;padding-left:10px;padding-right:20px;\"><a style=\"color:blue;\" href=\"javascript:showNameCardDiv(2,1)\" >我要了解价格</a></div></td>"
		+"<td ><div align=\"center\" style=\"font-size:14px;font-weight:bold;padding-left:10px;padding-right:20px;\"><a style=\"color:blue;\" href=\"javascript:showNameCardDiv(2,2)\" >邮寄样本给我</a></div></td>"
		+"<td ><div align=\"center\" style=\"font-size:14px;font-weight:bold;padding-left:10px;padding-right:20px;\"><a style=\"color:blue;\" href=\"javascript:showNameCardDiv(2,3)\" >请企业联系我</a></div></td>"
		+"</tr></table>";
		
		this.NameCardButtonTop.style.display="none";
		this.NameCardButtonUnder.style.display="none";
		namecardframe.src="http://co.163.com/neteaseivp/namecard/ok.jsp?id="+EnterpId+"&pid="+BookId+"&type="+NameCardType+"&source="+escape("浏览样本")+"&title="+escape(BookTitle);
		 this.NameCard.style.visibility="visible";
	}
	else if(step==2&&namecardframe.src.indexOf("ok.jsp")>0){
		if(!queryType){
			queryType=0;
		}
		this.NameCardButtonDiv.innerHTML="<div align=right><a href=\"javascript:closeNameCard()\">关闭</a>　 </div>";
		namecardframe.src="http://co.163.com/neteaseivp/namecard/input.jsp?im=0&queryType="+queryType;
		this.NameCard.style.height="0px";
		this.NameCard.style.visibility="visible";
	}	
	var nowHeight=parseInt(this.NameCard.style.height);	
	if(step==1&&nowHeight<53){
		this.NameCard.style.height=parseInt(nowHeight)+4;
		setTimeout("showNameCardDiv("+step+")",100);
	}else if(step==1&&nowHeight>=53){
		var top=document.getElementById("NameCardButtonTop");
		var under=document.getElementById("NameCardButtonUnder");
		if(top!=null&&under!=null){			
			top.style.display="block";
			under.style.display="block";
			var c=Math.floor(Math.random()*colors.length);
			this.NameCard.style.backgroundColor=colors[c];
		    setTimeout("showNameCardDiv("+step+")",1000);
		}  
	}else if(step==2&&nowHeight<259){
		this.NameCard.style.height=parseInt(nowHeight)+15;
		if(nowHeight>14)namecardframe.style.height=parseInt(this.NameCard.style.height)-16;
		setTimeout("showNameCardDiv("+step+")",80);
	}

	
}

function closeNameCard(){
	this.NameCard.style.display='none';
}
function SetCookie (name, value) {
	var argv = SetCookie.arguments;
	var argc = SetCookie.arguments.length;
	var expires = (2 < argc) ? argv[2] : null;
	var path = (3 < argc) ? argv[3] : null;
	var domain = (4 < argc) ? argv[4] : null;
	var secure = (5 < argc) ? argv[5] : false;
	document.cookie = name + "=" + escape (value) +
	((expires == null) ? "" : ("; expires=" + expires.toGMTString())) +
	((path == null) ? "" : ("; path=" + path)) +
	((domain == null) ? "" : ("; domain=" + domain)) +
	((secure == true) ? "; secure" : "");
}
function getCookie(name) {
	var search;
	search = name + "=";
	offset = document.cookie.indexOf(search) ;
	if (offset != -1) {
		offset += search.length;
		end = document.cookie.indexOf(";", offset);
		if (end == -1)
			end = document.cookie.length;
		return unescape(document.cookie.substring(offset, end));
	}
	else
		return "";
}
function resetCookie(){
	SetCookie("pages",2);
	SetCookie("StartTime",new Date());
	SetCookie("enLarge",0);
	SetCookie("menuJump",0);
	SetCookie("Print",0);
	SetCookie("Copied",0);
	if(BookTitle.charAt(BookTitle.length-1)!="."){
		var online=true;
		try{
			var xmlDOM = forGetUrl(CatalogServerName+"/ebook/online.xml","");
			var root = xmlDOM.documentElement;
		}catch(exception){
			//alert(exception.description);
			online=false;
		}
		if(online){
			//setTimeout("showNameCardDiv(1)",20000);
			setTimeout("recordNamecardVip()",5000);
		}
	}
	return;
}
function sendCookie(){
	return ;
}
function recordNamecardVip(){
	var url="http://co.163.com/neteaseivp/namecard/input_vip.jsp?id="+EnterpId+"&pid="+BookId+"&type="+NameCardType;
	var ScriptName = "InsertNamecardVip";
	var head= document.getElementsByTagName("head").item(0);
	var old = document.getElementById(ScriptName);
	if (old)  head.removeChild(old);
	var script = document.createElement("SCRIPT");
	script.src = url;
	script.defer = true;
	script.type = "text/javascript";
	script.id = ScriptName;
	head.appendChild(script);
	return true;
}

function addCookieNumber(arg){
	var oriNumber=parseInt(getCookie(arg));
	var step=1;
	if(arg=="pages"){
		step=2;
	}
	SetCookie(arg,oriNumber+step);
}
function forGetUrl(url,reqData){
	try{
		var xmlHttp;
		if (window.XMLHttpRequest){
			xmlHttp = new XMLHttpRequest();
		} else if (window.ActiveXObject) {
			xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
		}
		if(reqData!=""){
			xmlHttp.open("POST", url, false);
			xmlHttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
			xmlHttp.send(reqData);
		}
		else{
			xmlHttp.open("GET", url, false);
			xmlHttp.send();
		}
		return xmlHttp.responseXML;
	}catch(exception){
		//alert(exception.description+","+url);
	}
}
function Point() {
    this.x=0;
    this.y=0;
}
var jiahuihuang=navigator.appVersion;
if(jiahuihuang.indexOf("MSIE 6")<0&&jiahuihuang.indexOf("MSIE 5.5")<0&&jiahuihuang.indexOf("MSIE 7")<0){
	//if(confirm("对不起，您使用的浏览器版本太低，所以不能正常浏览我们的网站，请点击“确定”升级您的浏览器。\n\n友情提醒：您现在使用的浏览器有不少漏洞，会给您的系统带来安全隐患，升级到最新版本可以大大提高您系统的安全系数！")){
//		window.open("http://www.microsoft.com/downloads/details.aspx?displaylang=zh-cn&FamilyID=1e1550cb-5e5d-48f5-b02b-20b602228de6");
//	}	
}
//if(window.location.href.indexOf("163.com")>0)
//	document.domain="163.com";
var OLD_PN=PageNo;
book=new Book();
book.LImgprv.src=Pic_Path_Base+"/"+PageNo+(isOffline?".jpg":"/"+PageNo+".jpg.pv");
var nextPageNo=book.currentPageNo+1;
nextPageNo=nextPageNo<100?("0"+(nextPageNo<10?("0"+nextPageNo):nextPageNo)):nextPageNo;
book.RImgprv.src=Pic_Path_Base+"/"+nextPageNo+(isOffline?".jpg":"/"+nextPageNo+".jpg.pv");
MiniMap=new MiniMap(book.ImgDIV,60,20);
toolbar=new Toolbar();
//document.write("<script src=\"http://co.163.com/neteaseivp/include/popoOnline.jsp?enterp_id="+EnterpId+"&bookName="+BookTitle+"\"><"+"/script>");
function debugMailFrame(){
	book.EnlargePic();
	var newWin=window.open("about:blank");
	newWin.document.write(book.body.outerHTML);
}
//debugMailFrame();

function hideNextPageDiv(){
	book.nextDiv.style.display="none";
	book.prevDiv.style.display="none";	
	book.showQuickMoveImg();
}
function showNextPageDiv(){
	if(this.currentPageNo<AllPages-2){
		this.nextDiv.style.display="";
	}
	else{
		this.nextDiv.style.display="none";
	}
	if(this.currentPageNo>0){
		this.prevDiv.style.display="";	
	}
	else{
		this.prevDiv.style.display="none";	
	}
	this.hideQuickMoveImg();
}
function nextPage(){
	book.LeafBackward();	
	event.cancelBubble=true;
}
function prevPage(){
	book.LeafForward();
	event.cancelBubble=true;
}
function cacelEvent(){
	if(event!=null) event.cancelBubble=true;
}
function showTips(i){
	var vTitle='';
	if(i==1) vTitle="下一页";
	else vTitle="上一页";
	book.ImgDIV.title=vTitle;
	event.cancelBubble=true;
}

function hideQuickMoveImg(){
	if(this.moveUpDiv!=null){		
		this.moveUpDiv.style.visibility="hidden";
		this.moveDownDiv.style.visibility="hidden";
		this.moveLeftDiv.style.visibility="hidden";
		this.moveRightDiv.style.visibility="hidden";	
	}
}
function resetQuickMoveImg(){
	with(this.moveUpDiv.style) {
		top=this.Toolbar_Height+5;
		left=this.ValidScreenWidth/2;
	}
	with(this.moveDownDiv.style) {
		bottom=5;
		left=this.ValidScreenWidth/2;
	}
	with(this.moveLeftDiv.style) {
		top=(this.ValidScreenHeight-this.Toolbar_Height)/2;
		left=5;
	}
	with(this.moveRightDiv.style) {		
		top=(this.ValidScreenHeight-this.Toolbar_Height)/2;		
		right=5;
	}
}
function showQuickMoveImg(){	
	var test=this.ValidScreenWidth-Pic_Width*2-this.LeftOffset;
	showDebugMessage("X="+this.LeftOffset+";Y="+this.TopOffset+";picHeight="+Pic_Height+";picWidth="+Pic_Width);
	showDebugMessage("test="+test);
	if(this.LeftOffset>=0){
		this.moveLeftDiv.style.visibility ="hidden";
	}
	else{
		this.moveLeftDiv.style.visibility ="visible";
	}
	if(this.ValidScreenWidth-Pic_Width*2-this.LeftOffset>=0){
		this.moveRightDiv.style.visibility ="hidden";
	}
	else{
		this.moveRightDiv.style.visibility ="visible";
	}
	if(this.TopOffset>=0){
		this.moveUpDiv.style.visibility ="hidden";
	}
	else{
		this.moveUpDiv.style.visibility ="visible";
	}
	if(this.ValidScreenHeight-this.Toolbar_Height-Pic_Height-this.TopOffset>=0){
		this.moveDownDiv.style.visibility ="hidden";	
	}
	else{
		this.moveDownDiv.style.visibility ="visible";	
	}
}
function startMove(s){		
	//event.cancelBubble=true;
	showDebugMessage("start move:"+s);
	moveCancelEvent();		
	eval(s);
	showDebugMessage("startMove("+s+");");	
	book.moveTimeOut=setTimeout("startMove('"+s+"');",1);
}

function moveUp(){	
	move(0,-40);	
}
function moveDown(){
	move(0,40);
}
function moveLeft(){
	move(-40,0);
}
function moveRight(){
	move(40,0);
}
function moveOut(){
	showDebugMessage("out");		
	clearTimeout(book.moveTimeOut);
	event.cancelBubble=true;
}
function moveCancelEvent(){	
	showDebugMessage("cancel event");
	cacelEvent();
}

function move(x,y){	
	showDebugMessage("start move");
	
	var arg_Obj=book.ImgDIV;	
	book.LeftOffset=book.LeftOffset-x;
	book.TopOffset=book.TopOffset-y;
	book.EnlargePic();	
	
}

function resizewindow(){
	book.onBaseResize();
}
/**
 *added by wangbin ,method for test
 */
var allowedLevel="info";
var disableDebug=false;//true disallow debug
function getLevelNumber(level){
	if(level=="debug") return 0;
	if(level=="info") return 1;
	return -1;
}
function createNewDebugWindow(){
	return window.open("message.htm");
}
var messageWindow=null;

function showDebugMessage(m,level){
	if(disableDebug) return;
	if(level==null) level="debug";
	var levelNumber=getLevelNumber(level);
	var allowedLevelNumber=getLevelNumber(allowedLevel);
	//alert(levelNumber+":"+allowedLevelNumber);
	if(levelNumber>=allowedLevelNumber){
		if(messageWindow==null||messageWindow.closed) messageWindow=createNewDebugWindow();
		messageWindow.document.write(m+"<br>");
	}
}
if(typeof(showLarge)!="undefined"){
	if(showLarge==1){
		book.TopOffset=-Pic_Height/4;
	}
	else if(showLarge==2){
		book.TopOffset=-Pic_Height;
	}
	if(OLD_PN%2==1){
		book.LeftOffset=-2*Pic_Width
	}
	if(showLarge!=null)
		book.EnlargePic();
}
