function Ticker(targetMask, targetText) {    
    var targetMask = document.getElementById(targetMask);
    var targetText = document.getElementById(targetText);    

    this.move = function() {        
        targetText.style.left = (targetText.offsetLeft-1) + "px";                    
        if(targetText.offsetLeft < -targetText.offsetWidth) {            
            targetText.style.left = targetMask.offsetWidth+"px";                
        }             
    } 
    
    targetText.style.left = targetMask.offsetWidth+"px";                                 
    var obj = this;            

    setInterval(function(){obj.move();}, 25);

}
window.onload = function() {
    new Ticker('stockTicker', 'tickerText');
}