function $a(id,tag){var re=(id&&typeof id!="string")?id:document.getElementById(id);if(!tag){return re;}else{return re.getElementsByTagName(tag);}}
function HtmlMove(id,tag,path,rate,upbt,downbt,pgtime,lis)
{
	var mous=false,o=$a(id);o.onmouseover=function(){mous=true;};o.onmouseout=function(){mous=false;};
	var fg=tag.split('/'),as=$a(o,fg[1]),fx=(path=="scrollRight"||path=="scrollLeft")?"scrollLeft":"scrollTop";
	var ow=fx=="scrollTop"?as[0].offsetHeight:as[0].offsetWidth,pw=fx=="scrollTop"?o.offsetHeight:o.offsetWidth;
	var pgli=lis||Math.floor((pw+ow/2)/ow),pg=Math.floor((as.length+(pgli-1))/pgli),pgmx=ow*pgli,now=0,mx,d;
	var os=$a(o,fg[0])[0];os.innerHTML+=os.innerHTML;d=setInterval(function(){go_to((path=="scrollTop"||path=="scrollLeft")?true:false);},pgtime);
	if(upbt)
	{
		var ups=$a(upbt),uimg=addImg(ups.src),uimg1=addImg(ups.src.replace(/(.*)(\.\w{3})/,"$1_$2"));
		ups.onmouseover=function(){this.src=uimg1.src;};ups.onmouseout=function(){this.src=uimg.src;}
		$a(upbt).onmousedown=function(){clearInterval(d);go_to(true);d=setInterval(function(){go_to(true);},pgtime);}
	}
	if(downbt)
	{
		var down=$a(downbt),dimg=addImg(down.src),dimg1=addImg(down.src.replace(/(.*)(\.\w{3})/,"$1_$2"));
		down.onmouseover=function(){this.src=dimg1.src;};down.onmouseout=function(){this.src=dimg.src;}
		down.onmousedown=function(){clearInterval(d);go_to(false);d=setInterval(function(){go_to(false);},pgtime);}
	}
	function go_to(fxs){if(mous){return;};var ex;
	if(fxs){if(now<pg){now++;}else{now=1;o[fx]=0;}mx=now*pgmx;ex=setInterval(function(){(o[fx]+rate<mx)?(o[fx]+=rate):o[fx]=mx;if(o[fx]==mx){clearInterval(ex);}},10);}
	else{if(now>0){now--;}else{now=pg-1;o[fx]=pg*pgmx;}mx=now*pgmx;ex=setInterval(function(){(o[fx]-rate>mx)?(o[fx]-=rate):o[fx]=mx;if(o[fx]==mx){clearInterval(ex);}},10);}}
}
function addImg(url){var img=new Image();img.src=url;return img;}
