// 东方饭店90年滚动书籍
var df = {
	$ : function(objName){if(document.getElementById){return eval('document.getElementById("'+objName+'")')}else{return eval('document.all.'+objName)}},
	isIE : navigator.appVersion.indexOf("MSIE")!=-1?true:false,

	//Event
	addEvent : function(obj,eventType,func){if(obj.attachEvent){obj.attachEvent("on" + eventType,func);}else{obj.addEventListener(eventType,func,false)}},
	delEvent : function(obj,eventType,func){
		if(obj.detachEvent){obj.detachEvent("on" + eventType,func)}else{obj.removeEventListener(eventType,func,false)}
	},
	
	//Cookie
	readCookie : function(l){
	    var i="",I=l+"=";
	    if(document.cookie.length>0){
	        var offset=document.cookie.indexOf(I);
	        if(offset!=-1){
	            offset+=I.length;
	            var end=document.cookie.indexOf(";",offset);
	            if(end==-1)end=document.cookie.length;
	            i=unescape(document.cookie.substring(offset,end))
	        }
	    };
	    return i
	},

	writeCookie : function(O,o,l,I){
	    var i="",c="";
	    if(l!=null){
	        i=new Date((new Date).getTime()+l*3600000);
	        i="; expires="+i.toGMTString()
	    };
        if(I!=null){
            c=";domain="+I
        };
        document.cookie=O+"="+escape(o)+i+c
    },
	 
    //Style
    readStyle:function(i,I){if(i.style[I]){return i.style[I]}else if(i.currentStyle){return i.currentStyle[I]}else if(document.defaultView&&document.defaultView.getComputedStyle){var l=document.defaultView.getComputedStyle(i,null);return l.getPropertyValue(I)}else{return null}}
};


//图片自动大小
var flag=false;
function DrawImage(ImgD){
	var image=new Image();
	var iwidth = 100;
	var iheight = 85; //定义允许高度，当宽度大于这个值时等比例缩小
	image.src=ImgD.src;
	if(image.width>0 && image.height>0){
		flag=true;
		if(image.width/image.height>= iwidth/iheight){
			if(image.width>iwidth){
				ImgD.width=iwidth;
				ImgD.height=(image.height*iwidth)/image.width;
			}else{
				ImgD.width=image.width;
				ImgD.height=image.height;
			}
		}else{
			if(image.height>iheight){
				ImgD.height=iheight;
				ImgD.width=(image.width*iheight)/image.height; 
			}else{
				ImgD.width=image.width; 
				ImgD.height=image.height;
			}
		}
	}
}

function DrawImage2(ImgD){
	var image=new Image();
	var iwidth = 2000;
	var iheight = 1393; //定义允许高度，当宽度大于这个值时等比例缩小
	image.src=ImgD.src;
	if(image.width>0 && image.height>0){
		flag=true;
		if(image.width/image.height>= iwidth/iheight){
			if(image.width>iwidth){ 
				ImgD.width=iwidth;
				ImgD.height=(image.height*iwidth)/image.width;
			}else{
				ImgD.width=image.width; 
				ImgD.height=image.height;
			}
		}else{
			if(image.height>iheight){ 
				ImgD.height=iheight;
				ImgD.width=(image.width*iheight)/image.height; 
			}else{
				ImgD.width=image.width; 
				ImgD.height=image.height;
			}
		}
	}
}



//图片移动
function moveStart (event){
	var Obj = df.$("photoimg");
	var oObj = df.$("BigPic");
	Obj.onmousemove = mousemove;
	Obj.onmouseup = mouseup;
	Obj.setCapture ? Obj.setCapture() : function(){};
	oEvent = window.event ? window.event : event;
	var dragData = {x : oEvent.clientX, y : oEvent.clientY};
	var backData = {x : parseInt(oObj.scrollTop), y : parseInt(oObj.scrollLeft)};
	Obj.style.cursor = "move";
	function mousemove(){
		var oEvent = window.event ? window.event : event;
		var iLeft = oEvent.clientX - dragData["x"] + parseInt(oObj.scrollLeft);
		var iTop = oEvent.clientY - dragData["y"] + parseInt(oObj.scrollTop);
		oObj.scrollLeft = iLeft;
		oObj.scrollTop = iTop;
		dragData = {x: oEvent.clientX, y: oEvent.clientY};   
	}
	function mouseup(){
		var oEvent = window.event ? window.event : event;
		Obj.onmousemove = null;
		Obj.onmouseup = null;
		if(oEvent.clientX < 1 || oEvent.clientY < 1 || oEvent.clientX > document.body.clientWidth || oEvent.clientY > document.body.clientHeight){
			oObj.scrollLeft = backData.y;
			oObj.scrollTop = backData.x;
		}
	   Obj.style.cursor = "auto";
	   Obj.releaseCapture ? Obj.releaseCapture() : function(){};
	}
}

var coverLayer = {
	divObj : null,
	_coverTime : null,
	_coverRe : function(){//刷新遮盖层
		if(document.body.offsetHeight < document.documentElement.clientHeight){
			this.divObj.style.width = document.body.clientWidth + "px";
			this.divObj.style.height = document.documentElement.clientHeight + "px";
		}else{
			this.divObj.style.width = document.body.clientWidth + "px";
			this.divObj.style.height = document.body.clientHeight + "px";
		}
	},
	isIE : navigator.appVersion.indexOf("MSIE")!=-1?true:false,
	on : function(noSave){ //打开遮盖层
		if(this.divObj == null){
			this.divObj = document.createElement("div");
			this.divObj.style.zIndex = 10000;
			this.divObj.style.left = '0px';;
			this.divObj.style.top = '0px';;
			this.divObj.style.position = "absolute";
			this.divObj.style.backgroundColor = "#333";
			if(this.isIE){
				var tempFrame = document.createElement("iframe");
				tempFrame.style.filter = "Alpha(Opacity=0)";
				tempFrame.frameBorder=0;
				tempFrame.scrolling="no";
				tempFrame.style.width = "100%";
				tempFrame.style.height = "100%";
				this.divObj.appendChild(tempFrame);
				this.divObj.style.filter = "Alpha(Opacity=80)";
			}else{
				this.divObj.style.opacity = 0.8
			};
			document.body.appendChild(this.divObj);
		};
		if(document.body.offsetHeight < document.documentElement.clientHeight){
			this.divObj.style.width = document.body.clientWidth + "px";
			this.divObj.style.height = document.documentElement.clientHeight + "px";
		}else{
			this.divObj.style.width = document.body.clientWidth + "px";
			this.divObj.style.height = document.body.clientHeight + "px";
		};
		this.divObj.style.display = "block";
		clearInterval(this._coverTime);
		this._coverTime = setInterval("coverLayer._coverRe()",50);
	},
	off : function(noSave){ //关闭遮盖层
		if(this.divObj){this.divObj.style.display = "none"};
		clearInterval(this._coverTime);
	}
}



var Slide = {
	picTitleId : "PicTitle",
	picMemoId : "PicMemo",
	picListId : "PicList",
	BigPicId : "BigPic",
	picArrTopId : "topArr",
	picArrDownId : "DownArr",
	playButtonId : "playButton",
	estateId : "estate",
	mainBoxId : "Main",
	repetition : false, //循环播放
	prefetch : true, //预读图片
	autoPlay : true, //自动播放
	autoPlayTimeObj : null,
	timeSpeed : 5,
	maxWidth : 550,
	filmstrips : [],
	prefetchImg : [],
	selectedIndex : 0,
	previousPicList : {},
	nextPicList : {},
	add : function(s){
		this.filmstrips.push(s);
		if(this.prefetch){ //预载图片
			var tempImg = new Image();
			tempImg.src = s.src;
			this.prefetchImg.push(tempImg);
		};
	},
	initialize : function(){
		var tempWidth = 0;
		if(this.filmstrips.length * 65 < df.$("PicList").offsetWidth){
			tempWidth = Math.round(df.$("PicList").offsetWidth / 2 - this.filmstrips.length * 65/2);
		};

		var tempHTML = '',i;
		for(i=0;i<this.filmstrips.length;i++){
			tempHTML += '<div class="pic'+ (i==this.selectedIndex?"On":"") +'" id="slide_' + i + '"><table cellspacing="0"><tr><td><a href="javascript:Slide.select(' + i + ');" onclick="this.blur();"><img src="' + this.filmstrips[i].lowsrc + '" alt="东方饭店九十年" height="85" onload="showImage(this);"/></a></td></tr></table></div>';
		};

		df.$(this.picListId).innerHTML = tempHTML;
        df.$("photoimg").src = this.filmstrips[0].src;
		this.select(this.selectedIndex);
		if(this.autoPlay){this.play()}else{this.stop()};
		if(this.onstart){this.onstart()};
	},
	select : function(num,type){
		if(this.endSelect.estate == 1){
			this.endSelect.close();
		};
		var i;
		if(num >= this.filmstrips.length || num < 0){return};
		
		df.$("slide_" + this.selectedIndex).className = "pic";
		df.$("slide_" + num).className = "picOn";
		
        df.$("photoimg").src = this.filmstrips[num].src;
		this.selectedIndex = num;
		this.plan.set((num + 1)/this.filmstrips.length);//进度

        ScrollPicPlumb_01.pageTo(num + 1);

		df.$("total").innerHTML = (num + 1) + "/" + this.filmstrips.length;
		if(this.autoPlay){this.play()};
	},
	next : function(type){
		var tempNum = this.selectedIndex + 1;
		if(tempNum >= this.filmstrips.length){
			if(this.repetition){ //循环播放
				tempNum = 0;
			}else{
				this.endSelect.open(); //选择
				this.stop();
				return;
			};
		};
		this.select(tempNum,type);
	},
	previous : function(){
		var tempNum = this.selectedIndex - 1;
		if(tempNum < 0){ //循环播放
			if(this.repetition){
				tempNum = this.filmstrips.length - 1
			}else{
				return;
			};
		};
		this.select(tempNum);
	},
	play : function(){
		clearInterval(this.autoPlayTimeObj);
		this.autoPlayTimeObj = setInterval("Slide.next('auto')",this.timeSpeed*1000);
		df.$(this.playButtonId).onclick = function(){Slide.stop()};
		df.$(this.estateId).className = "stop";
		df.$(this.estateId).title = "暂停";
		this.autoPlay = true;
	},
	stop : function(){
		clearInterval(this.autoPlayTimeObj);
		df.$(this.playButtonId).onclick = function(){Slide.play()};
		df.$(this.estateId).className = "play";
		df.$(this.estateId).title = "播放";
		this.autoPlay = false;
	},
	rePlay : function(){ //重新播放
		if(this.endSelect.estate == 1){this.endSelect.close()};
		this.autoPlay = true;
		this.select(0);
	}
};

Slide.plan = { //进度 object
	id : "plan",
	maxWidth : 50, //总宽度
	width : 0, //当前宽度
	percent : 0, //百分比
	set : function(num){ //设置 如：set(4/23)
		this.percent = Math.round((num) * 100);
		if(this.percent > 100){this.percent == 100};
		this.width = Math.round(this.maxWidth * (this.percent/100));
		if(this.width > 1 && this.width != this.maxWidth){
			df.$(this.id).style.borderRight = "1px solid #6c4a32";
			df.$(this.id).style.width = this.width - 1 + "px";
			df.$(this.id).style.display = "block";
		}else if(this.width <= 0){
			df.$(this.id).style.display = "none";
		}else if(this.width >= this.maxWidth){
			df.$(this.id).style.borderRight = "none";
			df.$(this.id).style.width = this.maxWidth + "px";
			df.$(this.id).style.display = "block";
		};
		df.$(this.id).title = this.percent + "%";
	}
};

Slide.speedBar = { //速度条

	slideId : "slide",
	slideButtonId : "slideButton",
	grades : 30, //等级数
	grade : 1, //等级
	_slideWidth : 0,
	_slideButtonWidth : 0,
	_marginLeft : 0,
	_mouseDisparity : 0,
	initialize : function(){
		this._slideWidth = df.$(this.slideId).offsetWidth;
		this._slideButtonWidth = df.$(this.slideButtonId).offsetWidth;
		this._marginLeft = Math.round(this._slideWidth/this.grades * (this.grade - 1));

		df.$(this.slideButtonId).style.marginLeft = this._marginLeft + "px";
		df.$("speedCall").innerHTML = this.grade + "秒";

		df.$(this.slideId).onselectstart = function(){return false};
		df.$(this.slideButtonId).onmousedown = function(e){Slide.speedBar.mouseDown(e);return false};
	},
	mouseDown : function(e){
		e = window.event?window.event:e;
		this._mouseDisparity = (e.pageX?e.pageX:e.clientX) - this._marginLeft;
		document.onmousemove = function(e){Slide.speedBar.mouseOver(e)};
		document.onmouseup = function(){Slide.speedBar.mouseEnd()};
	},
	mouseOver : function(e){
		e = window.event?window.event:e;
		this._marginLeft = (e.pageX?e.pageX:e.clientX) - this._mouseDisparity;
		if(this._marginLeft > (this._slideWidth - this._slideButtonWidth)){this._marginLeft = this._slideWidth - this._slideButtonWidth};
		if(this._marginLeft < 0){this._marginLeft = 0;};
		df.$(this.slideButtonId).style.marginLeft = this._marginLeft + "px";

		this.grade = Math.round(this._marginLeft/(this._slideWidth/this.grades) + 1);

		if(this.onmover){this.onmover()};
	},
	mouseEnd : function(){
		if(this.onend){this.onend()};

		df.writeCookie("eSp",this.grade,720);
		document.onmousemove = null;
		document.onmouseup = null;
	},
	onmover : function(){
		df.$("speedCall").innerHTML = this.grade + "秒";
	},
	onend : function(){
		Slide.timeSpeed = this.grade;
		if(Slide.autoPlay){Slide.play()};
	}
};

Slide.background = {
	estate : 1,
	initialize : function(){
		df.$("color_01").onclick = function(){Slide.background.select(1)};
		df.$("color_02").onclick = function(){Slide.background.select(2)};
		df.$("color_03").onclick = function(){Slide.background.select(3)};
		this.select(this.estate);
	},
	select : function(num){
		var className = "";

		switch(num){
			case 2:
				className = "bS_02";
				this.labelClass(2);
				break;
			case 3:
				className = "bS_03";
				this.labelClass(3);
				break;
			default :
				num = 1;
				className = "";
				this.labelClass(1);
		};
		document.body.className = className;
		df.writeCookie("eBg",num,720);
	},
	labelClass : function(num){
		df.$("color_01").className = "";
		df.$("color_02").className = "";
		df.$("color_03").className = "";
		df.$("color_0" + num).className = "selected";
	}
};

//结束选择
Slide.endSelect = {
	endSelectId : "endSelect",
	closeId : "endSelClose",
	rePlayButId : "rePlayBut",
	estate : 0, //1:open  0:close
	open : function(){
		this.estate = 1;
		df.$(this.endSelectId).style.display = "block";
		Slide.stop();
		df.$(Slide.playButtonId).onclick = function(){Slide.rePlay()};
		df.$(Slide.estateId).title = "重新播放";
		df.$(this.closeId).onclick = function(){Slide.endSelect.close()};
		df.$(this.rePlayButId).onclick = function(){Slide.rePlay()};
	},
	close : function(){
		this.estate = 0;
		//df.$(Slide.playButtonId).onclick = function(){Slide.play()};
		df.$(this.endSelectId).style.display = "none";
	}
};


//全屏
Slide.fullScreen = {
	fullScreenButId : "fullScreen",
	estate : 0,//1:full 0:close
	fullWin : null,
	timeObj : null,
	initialize : function(){
		try{
			if(window.opener){
				if(window.opener.Slide.fullScreen.estate == 1){
					this.setFull();
				}
			}else{
				df.$(this.fullScreenButId).onclick = function(){Slide.fullScreen.full()};
			}
		}catch(e){df.$(this.fullScreenButId).onclick = function(){Slide.fullScreen.full()}};
	},
	full : function(){
		this.fullWin = window.open(window.location.href,"fullWin","scrollbars")
		this.fullWin.moveTo(0,0)
		this.fullWin.resizeTo(screen.width,screen.height);
		this.estate = 1;
		Slide.stop();

		df.$("fullClew").style.display = "block";
		coverLayer.on();
		this.timeObj = setInterval("Slide.fullScreen.scoutFullWin()",100);
		df.$("fullClose").onclick = function(){Slide.fullScreen.fullWin.close()};
		df.$("fullCloseBut").onclick = function(){Slide.fullScreen.fullWin.close()};
	},
	scoutFullWin : function(){
		if(this.fullWin.closed){
			coverLayer.off();
			df.$("fullClew").style.display = "none";
			clearInterval(this.timeObj);
			Slide.onstart();
			Slide.play();
		}else{
			df.$("fullClew").style.left = Math.round((document.body.offsetWidth - 230)/2) + "px";
			df.$("fullClew").style.top = Math.round((document.documentElement.scrollTop==0?document.body.scrollTop:document.documentElement.scrollTop) + document.documentElement.clientHeight * 0.3) + "px";
		};
	},
	close : function(){
		window.close();
	},
	setFull : function(){
		df.$(this.fullScreenButId).onclick = function(){Slide.fullScreen.close()};
		df.$("page").style.width = "auto";
		df.$("page").style.padding = "5px";
		df.$(this.fullScreenButId).innerHTML = "退出";
		df.$(this.fullScreenButId).className = "close";
		df.$(Slide.picList.picListId).style.width = df.$("page").offsetWidth - 246 + "px";
	}
}

Slide.onstart = function(){
	try{document.execCommand('BackgroundImageCache', false, true);}catch(e){};
	//全屏
	//Slide.fullScreen.initialize();

	//速度条
	Slide.speedBar.grade = parseInt(df.readCookie("eSp"));
	if(isNaN(Slide.speedBar.grade)){Slide.speedBar.grade = 5};
	Slide.speedBar.initialize();
	Slide.speedBar.onend();

	//背景
	/*
	Slide.background.estate = parseInt(df.readCookie("eBg"));
	if(isNaN(Slide.background.estate)){Slide.background.estate = 1};
	Slide.background.initialize();
	*/

	//推荐栏
	/*
	Slide.brilliant.estate = parseInt(df.readCookie("eBl"));
	if(isNaN(Slide.brilliant.estate)){Slide.brilliant.estate = 0};
	Slide.brilliant.initialize();
	*/

	//图片列表滚动
	//Slide.picList.initialize();
};



Slide.picList = { //列表滚动
	leftArrId : "topArr",
	rightArrId : "downtArr",
	picListId : "PicList",
	timeoutObj : null,
	pageWidth : 65,
	totalWidth : 0,
	offsetWidth : 0,
	lock : false,
	initialize : function(){
		df.$(this.rightArrId).onmousedown = function(){Slide.picList.leftMouseDown()};
		df.$(this.rightArrId).onmouseout = function(){Slide.picList.leftEnd("out");this.className='';};
		df.$(this.rightArrId).onmouseup = function(){Slide.picList.leftEnd("up")};
		df.$(this.leftArrId).onmousedown = function(){Slide.picList.rightMouseDown()};
		df.$(this.leftArrId).onmouseout = function(){Slide.picList.rightEnd("out");this.className='';};
		df.$(this.leftArrId).onmouseup = function(){Slide.picList.rightEnd("up")};
		this.totalWidth = Slide.filmstrips.length * this.pageWidth;
		this.offsetWidth = df.$(this.picListId).offsetWidth;

	},
	leftMouseDown : function(){
		if(this.lock){return};
		this.lock = true;
		this.timeoutObj = setInterval("Slide.picList.moveLeft()",10);
	},
	rightMouseDown : function(){
		if(this.lock){return};
		this.lock = true;
		this.timeoutObj = setInterval("Slide.picList.moveRight()",10);
	},
	moveLeft : function(){
		if(df.$(this.picListId).scrollLeft + 10 > this.totalWidth - this.offsetWidth){
			df.$(this.picListId).scrollLeft = this.totalWidth - this.offsetWidth;
			this.leftEnd();
		}else{
			df.$(this.picListId).scrollLeft += 10;
		};
	},
	moveRight : function(){
		df.$(this.picListId).scrollLeft -= 10;
		if(df.$(this.picListId).scrollLeft == 0){this.rightEnd()};
	},
	moveTop : function(){
		if(df.$(this.picListId).scrollTop + 10 > this.totalHeight - this.offsetHeight){
			df.$(this.picListId).scrollTop = this.totalHeight - this.offsetHeight;
			this.leftEnd();
		}else{
			df.$(this.picListId).scrollTop += 10;
		};
	},
	moveDown : function(){
		df.$(this.picListId).scrollDown -= 10;
		if(df.$(this.picListId).scrollDown == 0){this.rightEnd()};
	},
	leftEnd : function(type){
		if(type=="out"){if(!this.lock){return}};
		clearInterval(this.timeoutObj);
		this.lock = false;
		this.move(30);
	},
	rightEnd : function(type){
		if(type=="out"){if(!this.lock){return}};
		clearInterval(this.timeoutObj);
		this.lock = false;
		this.move(-30);
	},
	foucsTo : function(num){
		if(this.lock){return};
		this.lock = true;

		var _moveWidth = Math.round(num * this.pageWidth - this.offsetWidth / 2) - 33;
		_moveWidth -= df.$(this.picListId).scrollLeft;

		if(df.$(this.picListId).scrollLeft + _moveWidth < 0){
			_moveWidth = - df.$(this.picListId).scrollLeft;
		};
		if(df.$(this.picListId).scrollLeft + _moveWidth >= this.totalWidth - this.offsetWidth){
			_moveWidth = this.totalWidth - this.offsetWidth - df.$(this.picListId).scrollLeft;
		};

		this.move(_moveWidth);
	},
	move : function(num){
		var thisMove = num/4;
		if(Math.abs(thisMove)<1 && thisMove!=0){
			thisMove = (thisMove>=0?1:-1)*1;
		}else{
			thisMove = Math.round(thisMove);
		};

		var temp = df.$(this.picListId).scrollLeft + thisMove;
		if(temp <= 0){df.$(this.picListId).scrollLeft = 0;this.lock = false;return;}
		if(temp >= this.totalWidth - this.offsetWidth){df.$(this.picListId).scrollLeft = this.totalWidth - this.offsetWidth;this.lock = false;return;}
		df.$(this.picListId).scrollLeft += thisMove;
		num -= thisMove;
		if(Math.abs(num) <= 1){this.lock = false;return;}else{
			setTimeout("Slide.picList.move(" + num + ")",10)
		}

	}
};


// -------------------------------------------------------------------------------------

//垂直滚动图片构造函数
//UI&UE Dept. mengjia

function ScrollPicPlumb(scrollContId,arrLeftId,arrRightId,dotListId){
	this.scrollContId = scrollContId; //内容容器ID
	this.arrLeftId = arrLeftId; //左箭头ID
	this.arrRightId = arrRightId; //右箭头ID
	this.dotListId = dotListId; //点列表ID

	this.dotClassName   = "dotItem";//点className
	this.dotOnClassName   = "dotItemOn";//当前点className
	this.dotObjArr = [];

	this.pageHeight = 0; //翻页宽度
	this.frameHeight = 0; //显示框宽度
	this.speed = 10; //移动速度(单位毫秒，越小越快)
	this.space = 10; //每次移动像素(单位px，越大越快)

	this.pageIndex = 0;

	this.autoPlay = true;
	this.autoPlayTime = 5; //秒

	var _autoTimeObj;
	var _scrollTimeObj;
	var _state = "ready"; // ready | floating | stoping

	this.stripDiv = document.createElement("DIV");

	this.listDiv01 = document.createElement("DIV");
	this.listDiv02 = document.createElement("DIV");

	//对象压栈
	if(!ScrollPicPlumb.childs){ //创建栈
		ScrollPicPlumb.childs = [];
	};
	this.ID = ScrollPicPlumb.childs.length;
	ScrollPicPlumb.childs.push(this);

	this.initialize = function(){ //初始化
		if(!this.scrollContId){
			throw new Error("必须指定scrollContId.");
			return;
		};
		this.scrollContDiv = df.$(this.scrollContId);
		if(!this.scrollContDiv){
			throw new Error("scrollContId不是正确的对象.(scrollContId = \""+ this.scrollContId +"\")");
			return;
		};

		this.scrollContDiv.style.height = this.frameHeight + "px";
		this.scrollContDiv.style.overflow = "hidden";

		//HTML
		this.listDiv01.innerHTML = this.listDiv02.innerHTML = this.scrollContDiv.innerHTML;
		this.scrollContDiv.innerHTML = "";
		this.scrollContDiv.appendChild(this.stripDiv);
		this.stripDiv.appendChild(this.listDiv01);
		this.stripDiv.appendChild(this.listDiv02);

		this.stripDiv.style.overflow = "hidden";
		this.stripDiv.style.zoom = "1";
		//this.stripDiv.style.width = "32766px";

		this.listDiv01.style.overflow = "hidden";
		this.listDiv02.style.overflow = "hidden";
		this.listDiv01.style.zoom = "1";
		this.listDiv02.style.zoom = "1";

		df.addEvent(this.scrollContDiv,"mouseover",Function("ScrollPicPlumb.childs[" + this.ID + "].stop()"));
		df.addEvent(this.scrollContDiv,"mouseout",Function("ScrollPicPlumb.childs[" + this.ID + "].play()"));

		//Arrowhead event
		//left (Top)
		if(this.arrLeftId){
			this.arrLeftObj = df.$(this.arrLeftId);
			if(this.arrLeftObj){
				df.addEvent(this.arrLeftObj,"mousedown",Function("ScrollPicPlumb.childs[" + this.ID + "].rightMouseDown()"));
				df.addEvent(this.arrLeftObj,"mouseup",Function("ScrollPicPlumb.childs[" + this.ID + "].rightEnd()"));
				df.addEvent(this.arrLeftObj,"mouseout",Function("ScrollPicPlumb.childs[" + this.ID + "].rightEnd()"));
			};
		};
		//right (Bottom)
		if(this.arrRightId){
			this.arrRightObj = df.$(this.arrRightId);
			if(this.arrRightObj){
				df.addEvent(this.arrRightObj,"mousedown",Function("ScrollPicPlumb.childs[" + this.ID + "].leftMouseDown()"));
				df.addEvent(this.arrRightObj,"mouseup",Function("ScrollPicPlumb.childs[" + this.ID + "].leftEnd()"));
				df.addEvent(this.arrRightObj,"mouseout",Function("ScrollPicPlumb.childs[" + this.ID + "].leftEnd()"));
			};
		};

		//dot
		if(this.dotListId){
			this.dotListObj = df.$(this.dotListId);
			if(this.dotListObj){
				var pages = Math.round(this.listDiv01.offsetHeight / this.frameHeight + 0.4),i,tempObj;
				for(i=0;i<pages;i++){
					tempObj = document.createElement("span");
					this.dotListObj.appendChild(tempObj);
					this.dotObjArr.push(tempObj);

					if(i==this.pageIndex){
						tempObj.className = this.dotClassName;
					}else{
						tempObj.className = this.dotOnClassName;
					};
					tempObj.title = "第" + (i+1) + "页";
					df.addEvent(tempObj,"click",Function("ScrollPicPlumb.childs[" + this.ID + "].pageTo(" + i + ")"));
				};
			};
		};

		//autoPlay
		if(this.autoPlay){this.play()};
	};

	this.leftMouseDown = function(){
		if(_state != "ready"){return};
		_state = "floating";
		_scrollTimeObj = setInterval("ScrollPicPlumb.childs[" + this.ID + "].moveLeft()",this.speed);
	};
	this.rightMouseDown = function(){
		if(_state != "ready"){return};
		_state = "floating";
		_scrollTimeObj = setInterval("ScrollPicPlumb.childs[" + this.ID + "].moveRight()",this.speed);
	};
	this.moveLeft = function(){
		if(this.scrollContDiv.scrollTop + this.space >= this.listDiv01.scrollHeight){
			this.scrollContDiv.scrollTop = this.scrollContDiv.scrollTop + this.space - this.listDiv01.scrollHeight;
		}else{
			this.scrollContDiv.scrollTop += this.space;
		};
		this.accountPageIndex();
	};
	this.moveRight = function(){
		if(this.scrollContDiv.scrollTop - this.space <= 0){
			this.scrollContDiv.scrollTop = this.listDiv01.scrollHeight + this.scrollContDiv.scrollTop - this.space;

		}else{
			this.scrollContDiv.scrollTop -= this.space;
		};
		this.accountPageIndex();
	};
	this.leftEnd = function(){
		if(_state != "floating"){return};
		_state = "stoping";
		clearInterval(_scrollTimeObj);

		var fill = this.pageHeight - this.scrollContDiv.scrollTop % this.pageHeight;

		this.move(fill);
	};
	this.rightEnd = function(){
		if(_state != "floating"){return};
		_state = "stoping";
		clearInterval(_scrollTimeObj);

		var fill = - this.scrollContDiv.scrollTop % this.pageHeight;

		this.move(fill);
	};
	this.move = function(num,quick){
		var thisMove = num/5;
		if(!quick){
			if(thisMove > this.space){thisMove = this.space};
			if(thisMove < -this.space){thisMove = -this.space};
		}

		if(Math.abs(thisMove)<1 && thisMove!=0){
			thisMove = thisMove>=0?1:-1;
		}else{
			thisMove = Math.round(thisMove);
		};

		var temp = this.scrollContDiv.scrollTop + thisMove;
		//if(temp <= 0){this.scrollContDiv.scrollTop = 0;this.lock = false;return;}

		//if(temp >= this.totalWidth - this.offsetHeight){this.scrollContDiv.scrollTop = this.totalWidth - this.offsetHeight;this.lock = false;return;}

		if(thisMove>0){
			if(this.scrollContDiv.scrollTop + thisMove >= this.listDiv01.scrollHeight){
				this.scrollContDiv.scrollTop = this.scrollContDiv.scrollTop + thisMove - this.listDiv01.scrollHeight;
			}else{
				this.scrollContDiv.scrollTop += thisMove;
			};
		}else{
			if(this.scrollContDiv.scrollTop - thisMove <= 0){
				this.scrollContDiv.scrollTop = this.listDiv01.scrollHeight + this.scrollContDiv.scrollTop - thisMove;
			}else{
				this.scrollContDiv.scrollTop += thisMove;
			};
		};

		num -= thisMove;
		if(Math.abs(num) == 0){
			_state = "ready";
			if(this.autoPlay){this.play()};
			this.accountPageIndex();
			return;
		}else{
			this.accountPageIndex();
			setTimeout("ScrollPicPlumb.childs[" + this.ID + "].move(" + num + "," + quick + ")",this.speed)
		};

	};
	this.next = function(){
		if(_state != "ready"){return};
		_state = "stoping";
		this.move(this.pageHeight,true);
	};
	this.play = function(){
		if(!this.autoPlay){return};
		clearInterval(_autoTimeObj);
		_autoTimeObj = setInterval("ScrollPicPlumb.childs[" + this.ID + "].next();",this.autoPlayTime * 1000);
	};
	this.stop = function(){
		clearInterval(_autoTimeObj);
	};
	this.pageTo = function(num){
		if(_state != "ready"){return};
		_state = "stoping";

		var fill = num * this.pageHeight - (this.pageHeight * 3) - this.scrollContDiv.scrollTop;
		this.move(fill,true);
	};
	this.accountPageIndex = function(){
		this.pageIndex = Math.round(this.scrollContDiv.scrollTop / this.frameHeight);
		if(this.pageIndex > Math.round(this.listDiv01.offsetHeight / this.frameHeight + 0.4) - 1){this.pageIndex = 0};
		var i;
		for(i=0;i<this.dotObjArr.length;i++){
			if(i==this.pageIndex){
				this.dotObjArr[i].className = this.dotClassName;
			}else{
				this.dotObjArr[i].className = this.dotOnClassName;
			};
		};

	};
};
