function e_book()
{
    this.status=0;
	this.id="sjs_book";
	this.main_div=sjs_book_div;
	this.base_div=null;
	this.sjs_tool_bar=null;
	this.toolbar_height=50;
	this.page_no_current=0;
	
	this.next_img_buf_l=null;
	this.next_img_buf_r=null;
	this.last_img_buf_l=null;
	this.last_img_buf_r=null;
	
	this.index_img_l=null;
	this.index_img_r=null;
	
	this.img_div=null;

	
	this.cursor_small_src="images/magnifier.cur";
	this.cursor_large_src="images/right.cur";

	this.border_table=null;
	
	this.screen_width=0;
	this.screen_height=0;
	this.pv_ratio=1;
	this.pv_ratio_last;
	this.pv_pic_width=0;
	this.pv_pic_height=0;
	this.object_width=object_width;
	
	this.offset_top=0;
	this.offset_left=0;	
	this.blank_top=0;
	this.blank_left=0;
	
	this.be_draged=false;
	this.drag_strat=new Point();
	this.offset_drag_strat=new Point();
	
	this.pl_step=10;
	this.pl_delaytime=20;
	
	this.turn_page_id=null;
	this.turn_next_left=turn_next_left;
	this.turn_last_right=turn_last_right;
	this.turn_last_left=turn_last_left;
	this.turn_next_right=turn_next_right;
	this.turn_page_end=turn_page_end;
	this.turn_page_end=turn_page_end;
	this.turn_last_page=turn_last_page;
	this.turn_next_page=turn_next_page;
	
	this.mytab_detail=new tab_detail();
	
	this.on_base_mousedown=on_base_mousedown;
	this.on_base_mousemove=on_base_mousemove;
	this.on_base_mouseup=on_base_mouseup;
	this.on_base_mouseover=on_base_mouseover;
	this.on_base_resize=on_base_resize;
	this.on_buf_imgload=on_buf_imgload;
	
	this.large_pic=large_pic;
	this.small_pic=small_pic;
	this.move_pic=move_pic;
	
	this.go_page=go_page;
	
	this.img_preload=img_preload;
	this.img_buf_ready=img_buf_ready;
	this.img_buf_ready_last=0;
	this.img_buf_ready_next=0;
	this.img_ready_current_left=0;
	this.img_ready_current_right=0;
	this.img_ready_current=0;
	this.next_div;
	this.last_div;
	this.next_bottom=100;
	this.arrow_div_show=arrow_div_show;

	this.move_div_up;
	this.move_div_down;
	this.move_div_left;
	this.move_div_right
	this.move_timeout;
	
	this.fastmove_img_hide=fastmove_img_hide;
	this.fastmove_img_show=fastmove_img_show;
	this.fastmove_img_reset=fastmove_img_reset;
	this.imgload_count_detail=0;
	
	this.initial=initial;
	this.initial();
}

function initial()
{
    this.screen_width=this.main_div.clientWidth;
	this.screen_height=this.main_div.clientHeight;
	var pv_ratio_1=pic_width*2/this.screen_width;
	var pv_ratio_2=pic_height/(this.screen_height-this.toolbar_height);
	if(pv_ratio_1<=pv_ratio_2)
	{
	  this.pv_ratio=pv_ratio_2;
	}
	else
	{
	  this.pv_ratio=pv_ratio_1;
	}
	this.pv_pic_width=Math.ceil(pic_width/this.pv_ratio);
	this.pv_pic_height=Math.ceil(pic_height/this.pv_ratio);
	if(this.screen_width>this.pv_pic_width*2)
	{
	  this.blank_left=Math.ceil(this.screen_width-this.pv_pic_width*2)/2;
	}
	else
	{
	  this.blank_left=0;
	}
	if(this.screen_height-this.toolbar_height>this.pv_pic_height)
	{
      this.blank_top=Math.ceil(this.screen_height-this.toolbar_height-this.pv_pic_height)/2;
	}
	else
	{
	  this.blank_top=0;
	}
	
	this.page_no_current=parseInt(page_no,10);
	if(this.page_no_current%2==1)
	{
	  this.page_no_current--;
	}
	page_no=this.page_no_current<100?"0"+(this.page_no_current<10?"0"+this.page_no_current:this.page_no_current):this.page_no_current;
	
	var mydiv=document.createElement("div");
	this.main_div.appendChild(mydiv);
	mydiv.id="base_div";
	this.base_div=base_div;
	delete mydiv;
	with(this.base_div.style)
	{
		top=0;
		left=0;
		width=this.screen_width;
		height=this.screen_height;
		zIndex=0;
		position="absolute";
		overflow="hidden";
	}
	
	var mydiv=document.createElement("div");
	this.base_div.appendChild(mydiv);
	mydiv.id="sjs_tool_bar";
	this.sjs_tool_bar=sjs_tool_bar;
	delete mydiv;
	with(this.sjs_tool_bar.style)
	{
		top=0;
		left=0;
		width=this.screen_width;
		height=this.toolbar_height;
		zIndex=20;
		position="absolute";
		overflow="visible";
	}
	
	var mydiv=document.createElement("div");
	this.base_div.appendChild(mydiv);
	mydiv.outerHTML="<div id='img_div' onmousedown='"+this.id+".on_base_mousedown(this)' onmousemove='"+this.id+".on_base_mousemove(this)' onmouseup='"+this.id+".on_base_mouseup(this)' onmouseover='"+this.id+".on_base_mouseover(this)' onmouseout='event_cancel()'></div>";
	delete mydiv;
	this.img_div=img_div;
	with(this.img_div.style)
	{		
		top=this.toolbar_height;
		left=0;
		width=this.screen_width;
		height=this.screen_height-this.toolbar_height;
		zIndex=9;
		position="absolute";		
		overflow="hidden";
	}
	
	var myarrowdiv=document.createElement("div");
	this.base_div.appendChild(myarrowdiv);
	myarrowdiv.outerHTML="<div id='next_div' onclick='next_page();'onmousedown='event_cancel()' onmousemove='event_cancel()' onmouseup='event_cancel()'></div>";
	delete myarrowdiv;
	this.next_div=next_div;
	var myimg=document.createElement("img");
	this.next_div.appendChild(myimg)
	myimg.src="images/arrow_next.gif";
	myimg.alt="下一页";
	delete myimg;
	with(this.next_div.style)
	{		
		bottom=200;
		right=0;
		width=50;
		height=10;
		zIndex=10;
		position="absolute";
		cursor="hand";
		filter="alpha(opacity=50)";
	}
	
	var myarrowdiv=document.createElement("div");
	this.base_div.appendChild(myarrowdiv);
	myarrowdiv.outerHTML="<div id='last_div' onclick='last_page();' onmousedown='event_cancel()' onmousemove='event_cancel()' onmouseup='event_cancel()'></div>";;
	delete myarrowdiv;
	this.last_div=last_div;
	var myimg=document.createElement("img");
	this.last_div.appendChild(myimg)
	myimg.src="images/arrow_last.gif";
	myimg.alt="上一页";
	delete myimg;
	with(this.last_div.style)
	{		
		bottom=200;
		left=0;
		width=50;
		height=10;
		zIndex=10;
		position="absolute";
		cursor="hand";
		filter="alpha(opacity=50)";
	}
	this.arrow_div_show();
	
	var mydiv=document.createElement("div");
	this.base_div.appendChild(mydiv);
	mydiv.id="load_img";
	delete mydiv;
	this.load_img=load_img;
	var myimg=document.createElement("img");
	this.load_img.appendChild(myimg)
	myimg.src="images/load_img.gif";
	delete myimg;
	with(this.load_img.style)
	{		
		bottom=20;
		right=0;
		width=80;
		height=26;
		zIndex=10;
		position="absolute";
		if (total_page<3){visibility="hidden";}
	}
	
	var mymovediv=document.createElement("div");
	this.base_div.appendChild(mymovediv);
	mymovediv.outerHTML="<div id='move_div_up' onmouseover='start_move(0,-10)' onmouseout='move_out()' onmousedown='event_cancel()' onmousemove='event_cancel()' onmouseup='event_cancel()'></div>";
	delete mymovediv;
	this.move_div_up=move_div_up;
	var myimg=document.createElement("img");
	this.move_div_up.appendChild(myimg)
	myimg.src="images/up.gif";
	delete myimg;
	with(this.move_div_up.style)
	{	
		top=this.toolbar_height;
		left=this.screen_width/2;
		width=50;
		height=10;
		zIndex=10;
		position="absolute";
		cursor="move";
		filter="alpha(opacity=50)";
	}
	
	var mymovediv=document.createElement("div");
	this.base_div.appendChild(mymovediv);
	mymovediv.outerHTML="<div id='move_div_down' onmouseover='start_move(0,10)' onmouseout='move_out()' onMouseDown='event_cancel()' onmousemove='event_cancel()' onmouseup='event_cancel()'></div>";
	delete mymovediv;
	this.move_div_down=move_div_down;
	var myimg=document.createElement("img");
	this.move_div_down.appendChild(myimg)
	myimg.src="images/down.gif";
	delete myimg;
	with(this.move_div_down.style)
	{
		bottom=0;
		left=this.screen_width/2;
		width=50;
		height=10;
		zIndex=10;
		position="absolute";
		cursor="move";
		filter="alpha(opacity=50)";
	}

	var mymovediv=document.createElement("div");
	this.base_div.appendChild(mymovediv);
	mymovediv.outerHTML="<div id='move_div_left' onmouseover='start_move(-10,0)' onmouseout='move_out()' onMouseDown='event_cancel()' onmousemove='event_cancel()' onmouseup='event_cancel()'></div>";
	delete mymovediv;
	this.move_div_left=move_div_left;
	var myimg=document.createElement("img");
	this.move_div_left.appendChild(myimg)
	myimg.src="images/left.gif";
	delete myimg;
	with(this.move_div_left.style)
	{		
		bottom=(this.screen_height-this.toolbar_height)/2;
		left=0;
		width=50;
		height=10;
		zIndex=10;
		position="absolute";	
		cursor="move";
		filter="alpha(opacity=50)";
	}
	
	var mymovediv=document.createElement("div");
	this.base_div.appendChild(mymovediv);
	mymovediv.outerHTML="<div id='move_div_right' onmouseover='start_move(10,0)' onmouseout='move_out()' onMouseDown='event_cancel()' onmousemove='event_cancel()' onmouseup='event_cancel()' onmouseover='start_move(10,0)'></div>";
	delete mymovediv;
	this.move_div_right=move_div_right;
	var myimg=document.createElement("img");
	this.move_div_right.appendChild(myimg)
	myimg.src="images/right.gif";
	delete myimg;
	with(this.move_div_right.style)
	{
		bottom=(this.screen_height-this.toolbar_height)/2;
		right=0;
		width=50;
		height=10;
		zIndex=10;
		position="absolute";
		cursor="move";
		filter="alpha(opacity=50)";
	}
	this.fastmove_img_hide();
	
	var myimg=document.createElement("img");
	this.base_div.appendChild(myimg);
	myimg.outerHTML="<img id='next_img_buf_l' onload='"+this.id+".img_buf_ready(this);load_img_show(this)'>";
	delete myimg;
	this.next_img_buf_l=next_img_buf_l;
	this.next_img_buf_l.style.width=0;

	var myimg=document.createElement("img");
	this.base_div.appendChild(myimg);
	myimg.outerHTML="<img id='next_img_buf_r' onload='"+this.id+".img_buf_ready(this);load_img_show(this)'>";
	delete myimg;
	this.next_img_buf_r=next_img_buf_r;
	this.next_img_buf_r.style.width=0;
	
	var myimg=document.createElement("img");
	this.base_div.appendChild(myimg);
	myimg.outerHTML="<img id='last_img_buf_l' onload='"+this.id+".img_buf_ready(this)'>";
	delete myimg;
	this.last_img_buf_l=last_img_buf_l;
	this.last_img_buf_l.style.width=0;
	
	var myimg=document.createElement("img");
	this.base_div.appendChild(myimg);
	myimg.outerHTML="<img id='last_img_buf_r' onload='"+this.id+".img_buf_ready(this)'>";
	delete myimg;
	this.last_img_buf_r=last_img_buf_r;
	this.last_img_buf_r.style.width=0;

	var myimg=document.createElement("img");
	this.img_div.appendChild(myimg);
	myimg.outerHTML="<img id='index_img_l' onload='"+this.id+".on_buf_imgload(this)'>";
	delete myimg;
	this.index_img_l=index_img_l;
	with(this.index_img_l.style)
	{			
		cursor=this.cursor_small_src;
		right=this.screen_width-this.blank_left-this.pv_pic_width;
		top=this.blank_top;
		width=this.pv_pic_width;
		height=this.pv_pic_height;
		zIndex=11;
		position="absolute";
	}
	
	var myimg=document.createElement("img");
	this.img_div.appendChild(myimg);
	myimg.outerHTML="<img id='index_img_r' onload='"+this.id+".on_buf_imgload(this)'>";
	delete myimg;
	this.index_img_r=index_img_r;
	with(this.index_img_r.style)
	{			
		cursor=this.cursor_small_src;
		left=this.blank_left+this.pv_pic_width;
		top=this.blank_top;
		width=this.pv_pic_width;
		height=this.pv_pic_height;
		zIndex=11;
		position="absolute";
	}
	if(this.blank_left>=11)
	{
		var mytable=document.createElement("table");
		this.img_div.appendChild(mytable);
		mytable.id="border_table";
		this.border_table=border_table;
		delete mytable;
		with(this.border_table)
		{
			border=0;
			align="center";
			cellPadding=0;
			cellSpacing=0;
			with(style)
			{
				left=this.blank_left-11;
				height=this.pv_pic_height;
				position="absolute";
				zIndex=5;
			}
		}
		
		for(i=0;i<2;i++)
		{
			var myrow=this.border_table.insertRow();
			for(j=0;j<3;j++)
			{
				var mycell=myrow.insertCell();
				if(i==0&&j!=1)
				{
					mycell.width=11;
					mycell.vAlign="top";
					if(j==0)
					{
						mycell.background="images/book_leftbg.gif";
						mycell.innerHTML="<img src='images/book_lefttop.gif' width='11' height='7'>";
					}
					if(j==2)
					{
						mycell.background="images/book_rightbg.gif";
						mycell.innerHTML="<img src='images/book_righttop.gif' width='11' 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='11' height='7'>";
					}
					if(j==2)
					{
						mycell.background="images/book_rightbg.gif";
						mycell.innerHTML="<img src='images/book_rightbot.gif' width='11' height='7'>";
					}
				}
				else
				{
					mycell.width=this.pv_pic_width*2;
					mycell.innerHTML=" ";
				}
			}
		}
	}
}

function on_base_resize()
{
	if(this.img_ready_current!=1)
	{
		setTimeout("on_base_resize()",100);
		return;
	}
	this.pv_ratio_last=this.pv_ratio;
	this.screen_width=this.main_div.clientWidth;
	this.screen_height=this.main_div.clientHeight;
	var pv_ratio_1=pic_width*2/this.screen_width;
	var pv_ratio_2=pic_height/(this.screen_height-this.toolbar_height);
	if(pv_ratio_1<=pv_ratio_2)
	{
		this.pv_ratio=pv_ratio_2;
	}
	else
	{
		this.pv_ratio=pv_ratio_1;
	}
	this.pv_pic_width=Math.ceil(pic_width/this.pv_ratio);
	this.pv_pic_height=Math.ceil(pic_height/this.pv_ratio);
	if(this.screen_width>this.pv_pic_width*2)
	{
		this.blank_left=Math.ceil(this.screen_width-this.pv_pic_width*2)/2;
	}
	else
	{
		this.blank_left=0;
	}
	if(this.screen_height-this.toolbar_height>this.pv_pic_height)
	{
		this.blank_top=Math.ceil(this.screen_height-this.toolbar_height-this.pv_pic_height)/2;
	}
	else
	{
		this.blank_top=0;
	}
	with(this.base_div.style) 
	{
		width=this.screen_width;
		height=this.screen_height;
	}
	with(this.sjs_tool_bar.style) 
	{
		width=this.screen_width;
		height=this.toolbar_height;
	}
	with(this.img_div.style) 
	{
		width=this.screen_width;
		height=this.screen_height-this.toolbar_height;
	}
	with(this.index_img_l.style)
	{
		right=this.screen_width-this.blank_left-this.pv_pic_width;
		top=this.blank_top;
		width=this.pv_pic_width;
		height=this.pv_pic_height;
	}
	with(this.index_img_r.style)
	{
		left=this.blank_left+this.pv_pic_width;
		top=this.blank_top;
		width=this.pv_pic_width;
		height=this.pv_pic_height;
	}
	if(typeof(mini_map)!="undefined")
	{
		mini_map.SetMiniMapImg();
	}
	if(this.blank_left>=11&&this.border_table!=null)
	{
		with(this.border_table.style)
		{
			left=this.blank_left-11;
			height=this.pv_pic_height;
		}
		this.border_table.rows(0).cells(1).width=this.pv_pic_width*2;
		this.border_table.rows(1).cells(1).width=this.pv_pic_width*2;
	}
	else if(this.border_table!=null)
	{
		this.border_table.style.left=0;
		this.border_table.style.height=0;
	}
	this.next_bottom=this.next_bottom*this.pv_ratio_last/this.pv_ratio;
	this.next_div.style.bottom=this.next_bottom;
	this.last_div.style.bottom=this.next_bottom;	
	this.fastmove_img_reset();
}

function on_base_mousedown(object)
{
    switch(event.button)
	{
    case 1 :
		this.drag_strat.x=event.x;
		this.drag_strat.y=event.y;
		this.offset_drag_strat.x=this.offset_left;
		this.offset_drag_strat.y=this.offset_top;
        break;
    case 2 :
        break;
    }
    event.cancelBubble=true;
}

function on_base_mousemove(object)
{	
	if(this.status==1)
	{
		switch(event.button)
		{
		 case 1 :
			object.setCapture();
			this.be_draged=true;
			object.style.cursor="move";			
			this.offset_left=event.x-this.drag_strat.x+this.offset_drag_strat.x;
			this.offset_top=event.y-this.drag_strat.y+this.offset_drag_strat.y;
			this.large_pic();
			break;
		}
	}
	event.cancelBubble=true;
}

function on_base_mouseup(object)
{
	if(this.status==1)
	{
		switch(event.button)
		{
			case 1 :
				if(this.be_draged)
				{
					object.releaseCapture();
					this.be_draged=false;
					object.style.cursor="default";
				}
				else
				{					
					this.move_pic(event.x-this.offset_left,event.y-this.offset_top);
				}
				break;
			case 2 :
				this.small_pic();
				this.arrow_div_show();
				break;
			default :
		}
	}
	else
	{
		switch(event.button)
		{
			case 1:
				this.move_pic((event.x-this.blank_left)*this.pv_ratio+(this.screen_width>pic_width*2?((this.screen_width-pic_width*2)/2):0),(event.y-this.blank_top-this.toolbar_height)*this.pv_ratio+this.toolbar_height);
				arrow_div_hide();
				break;
			case 2:
				if(event.x<this.screen_width/2)
				{
					this.turn_last_page();
				}
				else if(event.x>this.screen_width/2)
				{
					this.turn_next_page();
				}
				break;
			default:
		}
	}
	event.cancelBubble=true;
}

function on_base_mouseover(object)
{	
	var mytitle="";
	if(this.status==0)
	{
		mytitle="点击鼠标左键放大";
		if(event.x>this.screen_width/2&&this.img_buf_ready_next==2)
		{
			mytitle+="，点击鼠标右键向后翻页";
		}
		else if(event.x<this.screen_width/2&&this.img_buf_ready_last==2)
		{
			mytitle+="，点击鼠标右键向前翻页";
		}
	}
	else
	{
		mytitle="点击鼠标右键缩小，点击鼠标左键或拖拽鼠标移动图片";
	}
	this.img_div.title=mytitle;
	event.cancelBubble=true;
}

function img_preload(new_page_no)
{
	this.img_buf_ready_next=0;
	this.img_buf_ready_last=0;
	
	if(typeof(new_page_no)=="undefined")
	{
		if(this.page_no_current<total_page-2)
		{
			var next_page_no=parseInt(this.page_no_current,10)+2;
			var next_page_no_2=parseInt(this.page_no_current,10)+3;
			next_page_no=next_page_no<100?("0"+(next_page_no<10?("0"+next_page_no):next_page_no)):next_page_no;
			next_page_no_2=next_page_no_2<100?("0"+(next_page_no_2<10?("0"+next_page_no_2):next_page_no_2)):next_page_no_2;
			this.next_img_buf_l.src=pic_src+"/"+next_page_no+".jpg";
			this.next_img_buf_r.src=pic_src+"/"+next_page_no_2+".jpg";
			load_img.style.visibility="visible";
		}
		if(this.page_no_current>0)
		{
			var last_page_no=parseInt(this.page_no_current,10)-2;
			var last_page_no_2=parseInt(this.page_no_current,10)-1;
			last_page_no=last_page_no<100?("0"+(last_page_no<10?("0"+last_page_no):last_page_no)):last_page_no;
			last_page_no_2=last_page_no_2<100?("0"+(last_page_no_2<10?("0"+last_page_no_2):last_page_no_2)):last_page_no_2;
			this.last_img_buf_l.src=pic_src+"/"+last_page_no+".jpg";
			this.last_img_buf_r.src=pic_src+"/"+last_page_no_2+".jpg";
		}
	}
	else
	{
		if(new_page_no%2==1)
		{
			new_page_no--;
		}
		if(new_page_no>=0&&new_page_no<total_page)
		{
			var next_page_no=parseInt(new_page_no,10)+1;
			new_page_no_str=new_page_no<100?("0"+(new_page_no<10?("0"+new_page_no):new_page_no)):new_page_no;
			next_page_no=next_page_no<100?("0"+(next_page_no<10?("0"+next_page_no):next_page_no)):next_page_no;
			if(new_page_no>this.page_no_current)
			{
				this.next_img_buf_l.src=pic_src+"/"+new_page_no_str+".jpg";
				this.next_img_buf_r.src=pic_src+"/"+next_page_no+".jpg";
				
			}
			else if(new_page_no<this.page_no_current)
			{
				this.last_img_buf_l.src=pic_src+"/"+new_page_no_str+".jpg";
				this.last_img_buf_r.src=pic_src+"/"+next_page_no+".jpg";
			}
		}
	}
}

function on_buf_imgload(object)
{
	if(object.id=='index_img_l')
	{
		this.img_ready_current_left=1;
	}
	if(object.id=='index_img_r')
	{
		this.img_ready_current_right=1;
	}
	if(this.img_ready_current_left==1&&this.img_ready_current_right==1)
	{
		this.img_ready_current_left=0;
		this.img_ready_current_right=0;
		this.img_ready_current=1;
		this.img_preload();
	}
	else
		return;
}

function large_pic()
{
  if(this.status==0)
   {
	 this.status=1;	
   }
	if(this.screen_width-pic_width*2>this.offset_left)
	{
		this.offset_left=this.screen_width-pic_width*2;
	}
	if(this.offset_left>0)
	{
		this.offset_left=0;
	}
	if(this.screen_height-this.toolbar_height-pic_height>this.offset_top)
	{
		this.offset_top=this.screen_height-this.toolbar_height-pic_height;
	}
	if(this.offset_top>0)
	{
		this.offset_top=0;
	}
	if(this.border_table!=null)
	{
		this.border_table.style.visibility="hidden";
	}
	with(this.index_img_l.style)
	{
		position="absolute";
		cursor=this.cursor_large_src;
		right=this.screen_width-this.offset_left-pic_width;
		top=this.offset_top+(this.screen_height-this.toolbar_height>pic_height?((this.screen_height-pic_height-this.toolbar_height)/2):0);
		width=pic_width;
		height=pic_height;
	}
	with(this.index_img_r.style)
	{
		position="absolute";
		cursor=this.cursor_large_src;
		left=this.offset_left+(this.screen_width>pic_width*2?((this.screen_width-pic_width*2)/2):0)+pic_width;
		top=this.offset_top+(this.screen_height-this.toolbar_height>pic_height?((this.screen_height-pic_height-this.toolbar_height)/2):0);
		width=pic_width;
		height=pic_height;
	}
	
	if(typeof(mini_map)!="undefined")
	{
		if(mini_map.SetMiniMapImg())
		{
			mini_map.dmiDoShow();
		}	
		mini_map.ResizeMiniMap();
	}
	this.fastmove_img_show();

}

function on_det_imgload()
{
	if(typeof(this.imgload_count_detail)=="undefined")
	{
		setTimeout("on_det_imgload()",100);
		return;
	}
	this.imgload_count_detail++;
	if(this.imgload_count_detail==4)
	{
		this.base_div.cursor="default";
	}
	else if(this.imgload_count_detail<4)
	{
		this.base_div.cursor="wait";
	}
}


function small_pic()
{
	if(this.status==1)
	{
		this.imgload_count_detail=0;
		with(this.index_img_l.style)
		{
			position="absolute";
			cursor=this.cursor_small_src;
			right=this.screen_width-this.blank_left-this.pv_pic_width;
			top=this.blank_top;
			width=this.pv_pic_width;
			height=this.pv_pic_height;
			zIndex=2;
		}
		with(this.index_img_r.style)
		{
			position="absolute";
			cursor=this.cursor_small_src;
			left=this.blank_left+this.pv_pic_width;
			top=this.blank_top;
			width=this.pv_pic_width;
			height=this.pv_pic_height;
			zIndex=2;
		}
		this.status=0;
		mini_map.dmiDoHide();
		if(this.border_table!=null)
		{
			this.border_table.style.visibility="visible";
			this.border_table.style.cursor=this.cursor_small_src;
		}
	}
}

function turn_last_page()
{
	if(typeof(this.page_no_current)=="undefined")
	{
		setTimeout("turn_last_page()",100);
		return;
	}
	if(this.page_no_current>0)
	{
		if(this.img_buf_ready_last==2)
		{
			this.go_page(this.page_no_current-2);
		}
		else
		{
			setTimeout("turn_last_page()",100);
			return;
		}
	}
	else
	{
		alert("已经到达第一页!");
		return;
	}
}

function turn_next_page()
{
	if(typeof(this.page_no_current)=="undefined")
	{
		setTimeout("turn_next_page()",100);
		return;
	}
	if(this.page_no_current<total_page-2)
	{
		if(this.img_buf_ready_next==2)
		{
			this.go_page(this.page_no_current+2);
		}
		else
		{
			setTimeout("turn_next_page()",100);
			return;
		}
	}
	else
	{
		alert("已经到达最后一页!");
		return;
	}
}

function turn_next_right()
{
	clearTimeout(this.turn_page_id);
	if(this.img_buf_ready_next<2){
		this.turn_page_id=setTimeout(this.id+".turn_next_right()",50);
		return;
	}
	clearTimeout(this.turn_page_id);
	var new_width=this.pv_pic_width;
	for(iIdx=0;iIdx < this.pl_step;iIdx++)
	{
		new_width=new_width-this.pv_pic_width/this.pl_step;
		this.turn_page_id=setTimeout(this.id+".object_width("+this.index_img_r.id+","+new_width+")",(iIdx+1)* this.pl_delaytime);
	}
	this.turn_page_id=setTimeout(this.id+".turn_next_left()",iIdx * this.pl_delaytime);
}

function turn_next_left()
{
	this.index_img_r.src=this.next_img_buf_r.src;
	this.index_img_r.style.width=this.pv_pic_width;
	clearTimeout(this.turn_page_id);
	var new_width=0;
	this.index_img_l.src=this.next_img_buf_l.src;
    for(iIdx=0;iIdx < this.pl_step;iIdx++)
	{
		new_width=new_width+this.pv_pic_width/this.pl_step;
		this.turn_page_id=setTimeout(this.id+".object_width("+this.index_img_l.id+","+new_width+")",(iIdx+1)* this.pl_delaytime);
    }
	this.turn_page_id=setTimeout(this.id+"."+"turn_page_end()",iIdx * this.ipl_delaytime);
}

function turn_last_left()
{
	clearTimeout(this.turn_page_id);
	if(this.img_buf_ready_last<2){
		this.turn_page_id=setTimeout(this.id+".turn_last_left()",50);
		return;
	}
	clearTimeout(this.turn_page_id);
	var new_width=this.pv_pic_width;
	for(iIdx=0;iIdx < this.pl_step;iIdx++) {
		new_width=new_width-this.pv_pic_width/this.pl_step;
		this.turn_page_id=setTimeout(this.id+".object_width("+this.index_img_l.id+","+new_width+")",(iIdx+1)* this.pl_delaytime);
	}
	this.turn_page_id=setTimeout(this.id+".turn_last_right()",iIdx * this.pl_delaytime);

}

function turn_last_right()
{
	this.index_img_l.src=this.last_img_buf_l.src;
	this.index_img_l.style.width=this.pv_pic_width;
	clearTimeout(this.turn_page_id);
	var new_width=0;
	this.index_img_r.src=this.last_img_buf_r.src;
    for(iIdx=0;iIdx < this.pl_step;iIdx++) {
		new_width=new_width+this.pv_pic_width/this.pl_step;
		this.turn_page_id=setTimeout(this.id+".object_width("+this.index_img_r.id+","+new_width+")",(iIdx+1)* this.pl_delaytime);
    }
	this.turn_page_id=setTimeout(this.id+"."+"turn_page_end()",iIdx * this.ipl_delaytime);
}

function turn_page_end()
{
	clearTimeout(this.turn_page_id);
}

function object_width(object,arg_Width)
{
	if(arg_Width > this.pv_pic_width)
	{
        arg_Width=this.pv_pic_width;
    }
    object.style.width=arg_Width;
}

function move_pic(x,y)
{	
	this.offset_left=0-x+this.screen_width/2;
	this.offset_top=0-(y-this.toolbar_height)+(this.screen_height-this.toolbar_height)/2;	
	this.large_pic();
}

function img_buf_ready(object)
{
	switch(object.id)
	{
		case "last_img_buf_l":
			this.img_buf_ready_last++;
			break;
		case "last_img_buf_r":
			this.img_buf_ready_last++;
			break;
		case "next_img_buf_l":
			this.img_buf_ready_next++;
			break;
		case "next_img_buf_r":
			this.img_buf_ready_next++;
			break;
		default:
	}
}

function go_page(new_page_no)
{
	if(new_page_no%2==1)
	{
		new_page_no--;
	}
	if(new_page_no<0)
	{
		new_page_no=0
	}
	else if(new_page_no>=total_page)
	{
		new_page_no=total_page-2;
	}
	this.img_preload(new_page_no);
	
	if(this.status==1)
	{
		this.small_pic();
	}
	if(new_page_no<this.page_no_current)
	{
		this.turn_last_left();
	}
	else if(new_page_no>sjs_book.page_no_current)
	{
		this.turn_next_right();
	}
	this.page_no_current=parseInt(new_page_no,10);
	page_no=this.page_no_current<100?("0"+(this.page_no_current<10?("0"+this.page_no_current):this.page_no_current)):this.page_no_current;
	toolbar.page_no_show(this.page_no_current);
	this.arrow_div_show();
}

function mini_map()
{
	this.id="mini_map";
	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 mydiv=document.createElement("div");
	this.ParentDiv.appendChild(mydiv);
	mydiv.outerHTML="<div id='MiniMapBaseDiv' onmousemove='"+this.id+".OnMousemoveMiniMapBaseDiv("+"MiniMapBaseDiv"+")' onmouseup='"+this.id+".OnMouseUpMiniMapBaseDiv("+"MiniMapBaseDiv"+")'></div>";
	MiniMapBaseDiv.title="鼠标左键可以拖放小地图的位置，鼠标右键点选蓝框在小地图上的位置以查看大图！";
	this.MiniMapBaseDiv=MiniMapBaseDiv;
	delete mydiv;
	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="white";
		zIndex=20;
	}
	var myimg=document.createElement("img");
	this.MiniMapBaseDiv.appendChild(myimg);
	myimg.outerHTML="<img id='MiniMapLImg' onload='OnLoadMiniMapImg()'>";
	this.MiniMapLImg=MiniMapLImg;
	delete myimg;
	with(this.MiniMapLImg.style)
	{
		position="absolute";
		left=0;
		top=0;
		zIndex=5;
	}
	var myimg=document.createElement("img");
	this.MiniMapBaseDiv.appendChild(myimg);
	myimg.outerHTML="<img id='MiniMapRImg' onload='OnLoadMiniMapImg()'>";
	this.MiniMapRImg=MiniMapRImg;
	delete myimg;
	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=21;
		
	}
    var tmpShadowDiv=document.createElement("DIV");
    this.MiniMapBaseDiv.appendChild(tmpShadowDiv);
    tmpShadowDiv.id="ShadowDiv";
    delete tmpShadowDiv;
    this.ShadowDiv=ShadowDiv;
    with(this.ShadowDiv.style)
	{
        position="absolute";
        border="2 solid blue";
        cursor="default";
        left=0;
        top=0;
        width=0;
        height=0;
        zIndex=10;
    }
}

function OnLoadMiniMapImg() {
    this.mini_map.iLoadMiniMapImgCount=this.mini_map.iLoadMiniMapImgCount+1;
    if(this.mini_map.iLoadMiniMapImgCount !=2) 
	{
        return;
    }
    this.mini_map.ResizeMiniMap();
    this.mini_map.iLoadMiniMapImgCount=0;
	if(sjs_book.status==0) 
	{
        this.mini_map.dmiDoHide();
    } 
	else 
	{
        this.mini_map.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=sjs_book.screen_width*this.MiniMapLImg.width/pic_width;
	this.ScaleDiv.style.height=(sjs_book.screen_height-sjs_book.toolbar_height)*this.MiniMapLImg.height/pic_height;
	this.ScaleDiv.style.left=Math.ceil(-sjs_book.offset_left * this.Scale);
	this.ScaleDiv.style.top=Math.ceil(-sjs_book.offset_top * 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;
	var needShow=false;
	var next_page_no=parseInt(sjs_book.page_no_current,10)+1;
	next_page_no=next_page_no<100?("0"+(next_page_no<10?("0"+next_page_no):next_page_no)):next_page_no;
	var lsrc=pic_src+"/"+page_no+".jpg";
	if(this.MiniMapLastLImgSrc!=lsrc){
		this.MiniMapLastLImgSrc=lsrc;
		this.MiniMapLImg.src=lsrc;
	}
	else{
		needShow=true;
	}
	var rsrc=pic_src+"/"+next_page_no+".jpg";
	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(mini_map.MiniMapBaseDiv.style.left,10)-parseInt(mini_map.ScaleDiv.style.width,10)/2)/mini_map.Scale;
    ResultDragTop=(iVariation_Y-parseInt(mini_map.MiniMapBaseDiv.style.top,10)-sjs_book.toolbar_height-parseInt(mini_map.ScaleDiv.style.height,10)/2)/mini_map.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;
    }
	sjs_book.offset_left=-ResultDragLeft;
	sjs_book.offset_top=-ResultDragTop;
	sjs_book.large_pic();
}

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-sjs_book.toolbar_height-parseInt(mini_map.MiniMapBaseDiv.style.height,10)/2;
    if(ResultDragLeft < 0) {
        ResultDragLeft=0;
    }
    if(ResultDragTop < 0) {
        ResultDragTop=0;
    }
    if(ResultDragLeft > sjs_book.screen_width-parseInt(this.MiniMapBaseDiv.style.width,10)) {
        ResultDragLeft=sjs_book.screen_width-parseInt(this.MiniMapBaseDiv.style.width,10);
    }
    if(ResultDragTop > sjs_book.screen_height-sjs_book.toolbar_height-parseInt(this.MiniMapBaseDiv.style.height,10)) {
        ResultDragTop=sjs_book.screen_height-sjs_book.toolbar_height-parseInt(this.MiniMapBaseDiv.style.height,10);
    }
    this.MiniMapBaseDiv.style.left=ResultDragLeft;
    this.MiniMapBaseDiv.style.top=ResultDragTop;
}

function OnMouseDownScaleDiv() {
    switch(event.button) {
    case 2 :
        this.ScaleDiv.setCapture();
        this.ScaleDiv.style.cursor="hand";
        break;
    }
    event.cancelBubble=true;
}

function OnMousemoveScaleDiv() {
    var iXPos=event.x;
    var iYPos=event.y;
    switch(event.button) {
    case 2 :
        setTimeout(this.id+".DragScaleDiv("+iXPos+","+iYPos+")",1);
        break;
    }
    event.cancelBubble=true;
}

function OnMouseUpScaleDiv() {
    switch(event.button) {
    case 2 :
        this.ScaleDiv.releaseCapture();
        this.ScaleDiv.style.cursor="default";
        break;
    }
    event.cancelBubble=true;
}

function OnMousemoveMiniMapBaseDiv(object)
{
	var iXPos=event.x;
	var iYPos=event.y;
	switch(event.button)
	{
	case 1 :
        object.setCapture();
		this.bDraged=true;
        object.style.cursor="hand";
		setTimeout(this.id+".DragMiniMapBaseDiv("+iXPos+","+iYPos+")",1);
		break;
	}
	event.cancelBubble=true;
}

function OnMouseUpMiniMapBaseDiv(object) 
{
    switch(event.button) 
	{
    case 1 :
		if(this.bDraged)
		{
			object.releaseCapture();
			this.bDraged=false;
			object.style.cursor="default";
		}
		
        break;
	case 2 :
	   var iXPos=event.x;
	   var iYPos=event.y;
	   this.DragScaleDiv(iXPos,iYPos);
	   break;	
    }
    event.cancelBubble=true;
}

function toolbar()
{
	this.id="toolbar";
	this.topTable=null;
	this.bottomTable=null;
	this.booklist_div=null;
	this.booklist_tab=null;
	this.toolbar_initial=toolbar_initial;
	this.print_img=print_img;
	this.check_printForm=check_printForm;
	this.page_no_show=page_no_show;
	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.toolbar_initial();
}

function toolbar_initial()
{
	var tabletmp=document.createElement('TABLE');
	sjs_book.sjs_tool_bar.appendChild(tabletmp);
	tabletmp.id="topTable";
	this.topTable=topTable;
	delete tabletmp;
	this.topTable.width="100%";
	this.topTable.border=0;
	this.topTable.cellSpacing=0;
	this.topTable.cellPadding=0
	this.topTable.style.borderBottom="#C3C3C3 1px solid";
	this.topTable.bgColor="#d7d7d7";
	with(this.topTable.style)
	{
		backgroundRepeat="repeat-x";
		backgroundPosition="left top";
	}
	var myrow=this.topTable.insertRow();
	var mycol=myrow.insertCell();	
	mycol.width=400;
	mycol.noWrap="true";
	with(mycol.style)
	{
		backgroundRepeat="repeat-x";
		backgroundPosition="left top";
	}
	mycol.innerHTML="<img src='images/logo.gif' width='90' height='23' align='absmiddle'>";
	mycol.innerHTML+="<img src='images/spaceline.gif' width='2' height='18' hspace='8' align='absmiddle'>";
	mycol.innerHTML+="<font color='ee0000'><strong>"+mytitle+"</strong></font>";
	
	var mycol=myrow.insertCell();
	mycol.width=1;
	mycol.noWrap="true";
	with(mycol.style)
	{
		backgroundRepeat="repeat-x";
		backgroundPosition="left top";
	}
		
	var mycol=myrow.insertCell();
	mycol.noWrap="true";
	with(mycol.style)
	{
		backgroundRepeat="repeat-x";
		backgroundPosition="left top";
	}

	var mycol=myrow.insertCell();
	mycol.noWrap="true";
	mycol.style.paddingRight=5;
	mycol.align="right";
	mycol.vAlign="middle";
	
	mycol.innerHTML+="第<input id='mypage_no' type='text' value='"+sjs_book.page_no_current+"' size='2' style='height:20px;font-size:9pt;' onKeyDown='javascript:if(event.keyCode==13)sjs_book.go_page(mypage_no.value);else return'>/"+(total_page-1)+"页";
	mycol.innerHTML+="&nbsp;<input type='reset' value='转到' onclick='sjs_book.go_page(mypage_no.value);' style='width:40x;height:20px;font-size:9pt;border-top:#ffffff 1px solid;border-left:#ffffff 1px solid;border-right:#808080 1px solid;border-bottom:#808080 1px solid;cursor:hand;background-color:#8ACDF1' title='跳转到指定页'>";
	mycol.innerHTML+="&nbsp;<a href='#' onMouseOut='MM_swapImgRestore()' onMouseUp='MM_swapImgRestore();sjs_book.go_page(0)' onMouseDown=\"MM_swapImage('Image4','','images/but_home_on.gif',1)\" title='第一页'><img src='images/but_home.gif' name='Image4' width='22' height='20' border='0' align='absmiddle'></a>";
	mycol.innerHTML+="<a href='#' onMouseOut='MM_swapImgRestore()' onMouseUp='MM_swapImgRestore();sjs_book.turn_last_page()' onMouseDown=\"MM_swapImage('Image6','','images/but_prev_on.gif',1)\" title='上一页'><img src='images/but_prev.gif' name='Image6' width='22' height='20' border='0' align='absmiddle'></a>";
	mycol.innerHTML+="<a href='#' onMouseOut='MM_swapImgRestore()' onMouseUp='MM_swapImgRestore();sjs_book.turn_next_page()' onMouseDown=\"MM_swapImage('Image5','','images/but_next_on.gif',1)\" title='下一页'><img src='images/but_next.gif' name='Image5' width='22' height='20' border='0' align='absmiddle'></a>";
	mycol.innerHTML+="<a href='#' onMouseOut='MM_swapImgRestore()' onMouseUp='MM_swapImgRestore();sjs_book.go_page("+(total_page-1)+")' onMouseDown=\"MM_swapImage('Image7','','images/but_end_on.gif',1)\" title='最后一页'><img src='images/but_end.gif' name='Image7' width='22' height='20' border='0' align='absmiddle'></a>";
	mycol.innerHTML+="&nbsp;<a href='#' onMouseOut=\"MM_swapImgRestore();MM_showHideLayers('booklist_div','','hide')\" onMouseOver=\"MM_swapImage('Image3','','images/but_contents_on.gif',1);MM_showHideLayers('booklist_div','','show')\"><img src='images/but_contents.gif' name='Image3' width='151' height='20' border='0' align='absmiddle'></a>";
	mycol.innerHTML+="<img height=18 hspace=8 src='images/spaceline.gif' width=2 align=absMiddle>";
    mycol.innerHTML+="<a href='#' class='text2' onclick='MM_showHideLayers2(\"PrintDiv\")'><img src=images/print.gif border=0 align=absMiddle></a>";
	mycol.innerHTML+="<img height=18 hspace=8 src='images/spaceline.gif' width=2 align=absMiddle>";
	
	var tabletmp=document.createElement('TABLE');
	sjs_book.sjs_tool_bar.appendChild(tabletmp);
	tabletmp.id="bottomTable";
	this.bottomTable=bottomTable;
	delete tabletmp;
	this.bottomTable.width="100%";
	this.bottomTable.border=0;
	this.bottomTable.cellSpacing=0;
	this.bottomTable.cellPadding=0;
	this.bottomTable.bgColor="#EEEEEE";
	this.bottomTable.style.borderBottom="#d1d1d1 1px solid";
	this.bottomTable.style.borderTop="#333333 1px solid";

	var myrow=this.bottomTable.insertRow();
	var td=myrow.insertCell();
	td.background="images/top_img2.gif";
	with(td.style)
	{
		backgroundRepeat="repeat-x";
		backgroundPosition="left top";
		paddingLeft=10;
		paddingRight=10;
		paddingTop=2;
	}
	td.innerHTML="<a href='"+website+"' class='text2' target=_blank>"+company+"</a>";
	
	var td=myrow.insertCell();
	td.align="right";
	td.background="images/top_img2.gif";
	with(td.style)
	{
		backgroundRepeat="repeat-x";
		backgroundPosition="left top";
		paddingLeft=5;
		paddingRight=10;
		paddingTop=2;
	}
	td.innerHTML="<img src='images/cbiao_jiantou.gif' name=Image71 width=20 height=20 border=0 align=absMiddle id='Image71'><a href='javascript:' class='text2' target='_blank'></a><img src='images/cbiao_jiantou.gif' name=Image71 width=20 height=20 border=0 align=absMiddle id='Image71'><a href='#' class='text2' onclick='MM_showHideLayers2(\"CardDiv\")'>联系我们</a><img src='images/cbiao_jiantou.gif' name=Image71 width=20 height=20 border=0 align=absMiddle id='Image71'><a href='javascript:' target='_blank' class='text2'></a><font color=#ee0000></font><img src='images/cbiao_jiantou.gif' name=Image71 width=20 height=20 border=0 align=absMiddle id='Image71'><a href='javascript:' target='_blank'><font color='#ee0000'></font></a>";
	
	document.title=mytitle+" - "+document.title;

	var catalogtmp=document.createElement('DIV');
	this.topTable.rows(0).cells(2).appendChild(catalogtmp);
	catalogtmp.outerHTML="<div id='booklist_div' onMouseOver=\"MM_showHideLayers('booklist_div','','show')\" onMouseOut=\"MM_showHideLayers('booklist_div','','hide')\"></div>";
	this.booklist_div=booklist_div;
	delete catalogtmp;
	with(this.booklist_div.style)
	{
		position="absolute";
		height=300;
		top=20;
		right=117;
		width=151;
		visibility="hidden";
		overflowY="auto";
	}

	var mybooklist=document.createElement('TABLE');
	this.booklist_div.appendChild(mybooklist);
	mybooklist.id="booklist_tab";
	this.booklist_tab=booklist_tab;
	delete mybooklist;
	this.booklist_tab.width="100%";
	this.booklist_tab.border=0;
	this.booklist_tab.cellSpacing=1;
	this.booklist_tab.cellPadding=3;
	this.booklist_tab.bgColor="red";
	for(i=0;i<booklist.length;i+=2)
	{
		var td=this.booklist_tab.insertRow().insertCell();
		td.bgColor="#8ACDF1";
		td.innerHTML=Math.ceil(i/2+1)+"、<a href=# onclick='sjs_book.go_page("+booklist[i+1]+")' class='text3'>"+booklist[i]+"</a>";
	}

	var catalogtmp=document.createElement('DIV');
	this.topTable.rows(0).cells(3).appendChild(catalogtmp);
	catalogtmp.id="PrintDiv";
	this.PrintDiv=PrintDiv;
	delete catalogtmp;
	with(this.PrintDiv.style)
	{
		position="absolute";
		top=20;
		right=2;
		width=150;
		visibility="hidden";
		border="1 solid #000000";
	}
	this.PrintDiv.innerHTML="<table border=0 bgcolor='#FFFFCC' cellSpacing=4 cellPadding=0><form name=printForm onsubmit='return(check_printForm())'><tr><td><input type='radio' name='Print_range' checked> 当前页<input type='checkbox' name='Print_left' checked>左 <input type='checkbox'  name='Print_right' checked>右</td></tr><tr><td><input type='radio' name='Print_range'> 全部页</td></tr><tr><td><input type='radio' name='Print_range'> 选定范围<br><input type='text' name='print_pages'><br>请输入页码，以英文逗号隔开。（例如：0,2,3）</td></tr><tr><td><input type='reset' value='关闭' onclick=\"MM_showHideLayers('PrintDiv','','hide')\"> <input type='submit' value='打印'></td></tr></form></table>";
	
	var catalogtmp=document.createElement('DIV');
	this.bottomTable.rows(0).cells(1).appendChild(catalogtmp);
	catalogtmp.id="CardDiv";
	this.CardDiv=CardDiv;
	delete catalogtmp;
	with(this.CardDiv.style)
	{
		position="absolute";
		top=50;
		right=150;
		width=331;
		visibility="hidden";
		border="1 solid #000000";
	}
	var inner_str;
	inner_str="<table width='331' border=0 align=center cellpadding=0 cellspacing=0>";
	inner_str+="<tr><td width=10 height=30 bgcolor='#f3f3f3' class='red14b'>&nbsp;</td>";
	inner_str+="<td bgcolor='#f3f3f3' class='red14b'><font color='#ee0000'>"+company+"</font></td></tr>";
	inner_str+="<tr><td height=1 colspan=2 bgcolor='#dcdcdc' class='red14b'></td></tr></table>";
	inner_str+="<table width='331' border=0 align=center cellpadding=3 cellspacing=1 bgcolor='#dcdcdc'><tr><td height=22 bgcolor='#FFFFFF'>";
	inner_str+="<table width='100%'><tr><td>设计支持："+tel+"</td></tr></table></td></tr><tr><td height=22 bgcolor='#FFFFFF'>";
	inner_str+="<table width='100%'><tr><td>电子邮件：<a href='mailto:"+email+"' target='_blank'>"+email+"</a></td></tr></table></td></tr>";
	inner_str+="<tr><td height=22 bgcolor='#FFFFFF'><table width='100%'><tr><td>地　　址：" +address+"</td></tr></table></td></tr>";
	inner_str+="<tr><td height=22 bgcolor='#FFFFFF'><table width='100%'><tr><td>邮　　编："+zipcode+"</td>";
	inner_str+="<td align=right bgcolor='#FFFFFF'><a href=# onclick=\"MM_showHideLayers('CardDiv','','hide')\" class=text2>关闭</a></td></tr></table></td></tr></table>";
	this.CardDiv.innerHTML=inner_str;
}

function page_no_show(new_page_no)
{
	mypage_no.value=new_page_no;
}

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 print_img(args)
{
	var memo="";
	var onewindows=window.open("about:blank","onewindows","scrollbars=yes,resizable=yes,width=800,height=600");
	onewindows.document.open();
	onewindows.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)
		{
			onewindows.document.write("<div align=center>"+memo+"</div>");
		}
		else
		{
			onewindows.document.write("<div align=center style='page-break-before:always'>"+memo+"</div>");
		}
		onewindows.document.write("<img src="+pic_src+"/"+print_pages[i]+".jpg width=100%>");
	}
	onewindows.document.close();
	onewindows.window.print();
	onewindows.window.close();
}

function check_printForm()
{
	var page_no_current2=sjs_book.page_no_current+1;
	page_no_1=sjs_book.page_no_current<100?"0"+(sjs_book.page_no_current<10?"0"+sjs_book.page_no_current:sjs_book.page_no_current):sjs_book.page_no_current;
	page_no_2=page_no_current2<100?"0"+(page_no_current2<10?"0"+page_no_current2:page_no_current2):page_no_current2;
	
	var print_pages="";
	if(printForm.Print_range[0].checked)
	{
		if(printForm.Print_left.checked)
		{
			print_pages+=","+page_no_1;
		}
		if(printForm.Print_right.checked)
		{
			print_pages+=","+page_no_2;
		}
	}
	else if(printForm.Print_range[1].checked)
	{
		for(i=0;i<total_page;i++)
		{
			page_no_1=i<100?"0"+(i<10?"0"+i:i):i;
			print_pages+=","+page_no_1;
		}
	}
	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);
			page_no=pageNum<100?"0"+(pageNum<10?"0"+pageNum:pageNum):pageNum;
			print_pages+=","+page_no;
		}
	}
	if(print_pages.length>0)
		print_img(print_pages.substr(1));
	this.MM_showHideLayers('PrintDiv','','hide');
	return false;
}


function Point()
{
    this.x=0;
    this.y=0;
}

function tab_detail()
{
	this.rowscount=0;
	this.colscount=0;
	this.index_row=0;
	this.index_col=0;
	this.page_no_2=0;
	this.DetailImgCount=0;
}


function arrow_div_hide()
{
	sjs_book.next_div.style.display="none";
	sjs_book.last_div.style.display="none";	
	sjs_book.fastmove_img_show();
}

function arrow_div_show()
{
	if(this.page_no_current<total_page-2)
	{
		this.next_div.style.display="";
	}
	else
	{
		this.next_div.style.display="none";
	}
	if(this.page_no_current>0)
	{
		this.last_div.style.display="";	
	}
	else
	{
		this.last_div.style.display="none";	
	}
	this.fastmove_img_hide();
}

function next_page()
{
	sjs_book.turn_next_page();	
	event.cancelBubble=true;
}

function last_page()
{
	sjs_book.turn_last_page();
	event.cancelBubble=true;
}

function event_cancel()
{
	if(event!=null) event.cancelBubble=true;
}

function fastmove_img_hide()
{
	if(this.move_div_up!=null)
	{		
		this.move_div_up.style.visibility="hidden";
		this.move_div_down.style.visibility="hidden";
		this.move_div_left.style.visibility="hidden";
		this.move_div_right.style.visibility="hidden";	
	}
}

function fastmove_img_reset()
{
	with(this.move_div_up.style)
	{
		top=this.toolbar_height;
		left=this.screen_width/2;
	}
	with(this.move_div_down.style)
	{
		bottom=0;
		left=this.screen_width/2;
	}
	with(this.move_div_left.style)
	{
		top=(this.screen_height-this.toolbar_height)/2;
		left=0;
	}
	with(this.move_div_right.style)
	{		
		top=(this.screen_height-this.toolbar_height)/2;		
		right=0;
	}
}

function fastmove_img_show()
{	
	var test=this.screen_width-pic_width*2-this.offset_left;
	if(this.offset_left>=0)
	{
		this.move_div_left.style.visibility ="hidden";
	}
	else
	{
		this.move_div_left.style.visibility ="visible";
	}
	if(this.screen_width-pic_width*2-this.offset_left>=0)
	{
		this.move_div_right.style.visibility ="hidden";
	}
	else
	{
		this.move_div_right.style.visibility ="visible";
	}
	if(this.offset_top>=0)
	{
		this.move_div_up.style.visibility ="hidden";
	}
	else
	{
		this.move_div_up.style.visibility ="visible";
	}
	if(this.screen_height-this.toolbar_height-pic_height-this.offset_top>=0)
	{
		this.move_div_down.style.visibility ="hidden";	
	}
	else
	{
		this.move_div_down.style.visibility ="visible";	
	}
}

function start_move(x,y)
{		
	event_cancel();			
	sjs_book.move_timeout=setInterval("move("+x+","+y+")",10);
}

function move_out()
{		
	clearInterval(sjs_book.move_timeout);
	event.cancelBubble=true;
}

function move(x,y)
{	
	var object=sjs_book.img_div;	
	sjs_book.offset_left=sjs_book.offset_left-x;
	sjs_book.offset_top=sjs_book.offset_top-y;
	sjs_book.large_pic();	
}

function resizewindow()
{
    sjs_book.on_base_resize();
}

function load_img_show(object)
{
var i_l=0;
var i_r=0;
if(object.id=="next_img_buf_l")
{i_l=1;}
if(object.id=="next_img_buf_l")
{i_r=1;}
if (i_l+i_r>1)
{
load_img.style.visibility="hidden";
i_l=0;
i_r=0;
}
}


window.ClearEvent=function()
{
event.cancelBubble=false;
var sSrcTagName=event.srcElement.tagName.toLowerCase();
return (sSrcTagName=="textarea" || sSrcTagName=="input" || sSrcTagName=="select");
}
window.ClearKey=function()
{
event.cancelBubble=false;
var iKeyCode=event.keyCode;return !(iKeyCode==78 && event.ctrlKey);
}
with (window.document)
{
oncontextmenu=onselectstart=ondragstart=window.ClearEvent;
onkeydown=window.ClearKey;
}

sjs_book=new e_book();
toolbar=new toolbar();
var next_page_no=sjs_book.page_no_current+1;
next_page_no=next_page_no<100?("0"+(next_page_no<10?("0"+next_page_no):next_page_no)):next_page_no;
sjs_book.index_img_l.src=pic_src+"/"+page_no+".jpg";
sjs_book.index_img_r.src=pic_src+"/"+next_page_no+".jpg";
mini_map=new mini_map(sjs_book.img_div,0,0);

