function HorizontalScroller()
{
this.NewsScrollingContainer = null;
this.NewsScrollingControl = null;
this.ScrollerHeight = 0;
this.ScrollingSpeed = 0;
this.ScrollRightToLeft = true;
this.BackgroundColor = "";
this.TextColor = "";
this.BorderColor = "";
this.BorderSize = 0;
this.NewsLine = "";
this.ID = 0;
}
HorizontalScroller.prototype.ShowScroller = function()
{
var DivCssStyle = "width:100%;height:"+this.ScrollerHeight+"px;position:relative;overflow:hidden;";
var TableCssStyle = "width:100%;padding:2px;";
if(this.BackgroundColor != "") TableCssStyle += 'background-color:'+this.BackgroundColor+';';
if(this.TextColor != "")
{
TableCssStyle += 'color:'+this.TextColor+';';
document.write('');
}
if(this.BorderSize > 0)
{
TableCssStyle += "border-width:"+this.BorderSize+"px; border-style:solid;";
if(this.BorderColor != "") TableCssStyle += "border-color:"+this.BorderColor+";";
}
document.write('
');
this.StartScrolling();
}
HorizontalScroller.prototype.StartScrolling = function()
{
this.NewsScrollingContainer = document.getElementById("myrssreader_scrolling_news_container_"+this.ID);
this.NewsScrollingControl = document.getElementById("myrssreader_scrolling_news_"+this.ID);
var ScrollerInstance = this;
if(this.ScrollRightToLeft == true)
this.NewsScrollingControl.style.left = parseInt(this.NewsScrollingContainer.offsetWidth) + 10 + "px";
else
this.NewsScrollingControl.style.left = parseInt(this.NewsScrollingControl.offsetWidth) * (-1) + 10 + "px";
self.setInterval(function(){ScrollerInstance.ScrollNews()}, 20);
}
HorizontalScroller.prototype.ScrollNews = function()
{
if(this.ScrollRightToLeft == true)
{
if(parseInt(this.NewsScrollingControl.style.left) > (parseInt(this.NewsScrollingControl.offsetWidth) * (-1) + 10))
this.NewsScrollingControl.style.left = parseInt(this.NewsScrollingControl.style.left) - this.ScrollingSpeed + "px";
else
this.NewsScrollingControl.style.left = parseInt(this.NewsScrollingContainer.offsetWidth) + 10 + "px";
}
else
{
if(parseInt(this.NewsScrollingControl.style.left) < (parseInt(this.NewsScrollingContainer.offsetWidth) + 10))
this.NewsScrollingControl.style.left = parseInt(this.NewsScrollingControl.style.left) + this.ScrollingSpeed + "px";
else
this.NewsScrollingControl.style.left = parseInt(this.NewsScrollingControl.offsetWidth) * (-1) + 10 + "px";
}
}