﻿function ScrolltoLeft(id, speed) {
    var container = document.getElementById(id);
    container.style.overflow = "hidden";

    var first = container.scrollWidth;
    container.innerHTML += container.innerHTML;

    var last = container.scrollWidth;
    var scroll = last - first;

    function marquee() {
        if (scroll == container.scrollLeft) {
            container.scrollLeft = 1;
        }
        else {
            container.scrollLeft++;
        }
    }

    var timer = setInterval(marquee, speed);

    container.onmouseover = function() { clearInterval(timer); }
    container.onmouseout = function() { timer = setInterval(marquee, speed); }
}
