﻿			var sh;
			//preLeft=0; currentLeft=0; stopscroll=false; getlimit=0;preTop=0; currentTop=0;
			var marquee_type = document.getElementById("marquee_type").value;
			var lk1 = document.getElementById("lk1");
			var lk2 = document.getElementById("lk2");
			var marquee_run = document.getElementById("marquee_run");
			var speed = 5;
			
			function StopScroll()
			{
				//stopscroll = true;
				clearInterval( sh );
			}
			function scrollLeft()
			{
				StopScroll();
				marquee_type = "left";
				lk2.innerHTML = lk1.innerHTML;
				function Marquee(){
					if(lk2.offsetWidth - marquee_run.scrollLeft <= 50)
						marquee_run.scrollLeft -= lk1.offsetWidth;
					else{
						marquee_run.scrollLeft ++;
					}
				}
				sh = setInterval(Marquee,speed);
			
			}
			function scrollRight()
			{
				StopScroll();
				marquee_type = "right";
				//lk2.innerHTML = lk1.innerHTML;
				marquee_run.scrollRight = marquee_run.scrollWidth;
				function Marquee2(){
					if(marquee_run.scrollLeft <= 50)
						marquee_run.scrollLeft += lk1.offsetWidth;
					else{
						marquee_run.scrollLeft --;
					}
				}
				sh = setInterval(Marquee2,speed);
			}
			
			function Left()
			{
				scrollLeft();
			}
			
			function Right()
			{
				scrollRight();
			}
			marquee_run.onmouseover=function() {StopScroll();}
			marquee_run.onmouseout=function() {
				if(marquee_type == "left"){
					Left();
				}else if(marquee_type == "right"){
					//sh = setInterval(scrollRight,speed)
					Right();
				}
			}