var temeLine={};
temeLine.slider=function(){
	var dInnerContent=document.getElementById("ic"),timeContent=document.getElementById("timeContent"),speed=200,
		dInnerContentHeight=dInnerContent.offsetHeight,
		timeContentHeight=timeContent.offsetHeight,
		stepct=0,
		upItv=null,
		downItv=null,
		dstStep=5,
		timeStep=5,
		marginStep=5,
		maxTop=dInnerContentHeight-timeContentHeight,
		timeContentHeight=timeContent.offsetHeight;
	return {
		up:function(){
			var _self=this;
			this.clearAllSvt();
			upItv=setInterval(function(){
				_self.util.slide("up",_self);
			},timeStep);
		},
		down:function(){
			var _self=this;
			this.clearAllSvt();
			downItv=setInterval(function(){
				_self.util.slide("down",_self);
			},timeStep);
		},
		clearAllSvt:function(){
			clearInterval(upItv);
			clearInterval(downItv);
		},
		util:{
			slide:function(type,me){
				var _curTop=this.topToInt(dInnerContent);
				switch(type){
					case "up":
						stepct+=dstStep;
						var isTop=(Math.abs(_curTop)>=maxTop)||(Math.abs(_curTop)>=maxTop);
						if(isTop){
							me.clearAllSvt();
							return false;//dInnerContent.style.top=(-1)*maxTop+marginStep+"px";
						}else{
							dInnerContent.style.top=_curTop-dstStep+"px";
						}
						break;
					case "down":
						stepct+=dstStep;
						var isBottom=(_curTop>=0);
						if(isBottom){
							me.clearAllSvt();
							return false;//dInnerContent.style.top=(-1)*maxTop+marginStep+"px";
						}else{
							dInnerContent.style.top=_curTop+dstStep+"px";
						}
						break;
					default:
						break;
				}
			},
			topToInt:function(dom){
				return parseInt(dom.style.top.replace("px",""));
			}
		}
	};
}
temeLine.slider=temeLine.slider();
