// New Marquee
function snMarquee(myid,timeout,step,dir){
	if(!dir)var dir="up";
	if(!timeout)var timeout=20;
	if(!step)var step=1;
	var tmc=document.getElementById(myid);
	tmc.style.overflow="hidden";
	tmc.style.position="relative";
	var twidth=tmc.scrollWidth;
	var theight=tmc.scrollHeight;
	var content=tmc.innerHTML;
	if(dir=="up"){
		tmc.innerHTML="<div style='position:absolute;top:0px;left:0px;height:"+theight+"px; width:"+twidth+"px;' id='"+myid+"_wrap'>"+content+content+"</div>";
		var target=document.getElementById(myid+"_wrap");
		target.mypos=0;
	}else if(dir=="down"){
		tmc.innerHTML="<div style='position:absolute;top:0px;left:0px;height:"+theight+"px; width:"+twidth+"px;' id='"+myid+"_wrap'>"+content+content+"</div>";
		var target=document.getElementById(myid+"_wrap");
		target.mypos=-theight;
	}else if(dir=="left"){
		tmc.innerHTML="<div style='position:absolute;top:0px;left:0px;height:"+theight+"px; width:"+2*twidth+"px;' id='"+myid+"_wrap'><div style='float:left;height:"+theight+"px; width:"+twidth+"px;'>"+content+"</div><div style='float:left;height:"+theight+"px; width:"+twidth+"px;'>"+content+"</div></div>";
		var target=document.getElementById(myid+"_wrap");
		target.mypos=0;
	}else if(dir=="right"){
		tmc.innerHTML="<div style='position:absolute;top:0px;left:0px;height:"+theight+"px; width:"+2*twidth+"px;' id='"+myid+"_wrap'><div style='float:left;height:"+theight+"px; width:"+twidth+"px;'>"+content+"</div><div style='float:left;height:"+theight+"px; width:"+twidth+"px;'>"+content+"</div></div>";
		var target=document.getElementById(myid+"_wrap");
		target.mypos=-twidth;
	}
	target.onmouseover=function(){
		target.rollme=true;
	}
	target.onmouseout=function(){
		target.rollme=false;
	}
	var scrollme=function(){
		if(target.rollme)return;
		if(dir=="up"){
			target.mypos-=step;
			if(target.mypos<-theight)target.mypos=0;
			target.style.top=target.mypos+"px";
		}else if(dir=="down"){
			target.mypos+=step;
			if(target.mypos>=0)target.mypos=-theight;
			target.style.top=target.mypos+"px";
		}else if(dir=="left"){
			target.mypos-=step;
			if(target.mypos<-twidth)target.mypos=0;
			target.style.left=target.mypos+"px";
		}else if(dir=="right"){
			target.mypos+=step;
			if(target.mypos>=0)target.mypos=-twidth;
			target.style.left=target.mypos+"px";
		}
	}
	setInterval(scrollme,timeout);
}
