var UperLow = function(_name,_comparttime,_height){
	var this_rep= this;
	this.element=document.getElementById(_name);
	this.istoping=false;
	this.is_interval = true ;
	if(typeof _comparttime == 'undefined') this.comparttime=4000; else this.comparttime=_comparttime;
	if(typeof _height == 'undefined') this.height=40; else this.height=_height;
	this.ename=_name;
	this.to_top_interval=window.setInterval(function(){this_rep.test_totop();},this_rep.comparttime);
	//alert(this.to_top_interval);
	this.element.onmouseover=function() {this_rep.is_interval = false ; window.clearInterval(this_rep.to_top_interval);}

	this.element.onmouseout=function() {if(!this_rep.is_interval){this_rep.to_top_interval=setInterval(function(){this_rep.test_totop();},this_rep.comparttime);this_rep.is_interval=true ;}}
	this.test_totop = function(){
		if(this_rep.istoping)return ;
		this_rep.scrollup(this_rep.element,this_rep.height,0);
	}
	this.scrollup = function(o,d,c){
	if(d==c){
		var t=o.firstChild.cloneNode(true);
		o.removeChild(o.firstChild);
		t.style.marginTop=o.firstChild.style.marginTop='0px';
		o.appendChild(t);
		this_rep.istoping=false ;
	}
	else{
		var s=3,c=c+s,l=(c>=d?c-d:0);
		o.firstChild.style.marginTop=-c+l+'px';
		this_rep.istoping=true ;
		window.setTimeout(function(){this_rep.scrollup(o,d,c-l);},100);
	}
}
}
