var TheItemURL = 0;
var TheItemText = 1;
var DistanceFromLeftEdge = 0;
var LeftEdge = "left_edge";
var ScrollerWidth = 450;
var ScrollerHeight = 16;
var ScrollerLeft = 169;
var ScrollerTop = 84;
var ItemPadding = 25;
var LinkPrefix ="";
var OpenNewPageHere = "";
var SpanClassName = "TickerText";
var ScrollItemURL = new Array();
var ScrollItemText = new Array();
var ScrollItemTextAndURL = new Array();
var ShiftBy = 1;
var Loop = -1;
var Interval = 20;
var ScrollerObj = null;
ScrollItemText[0] = '10/03/10 Ολοκληρώνεται η αναδάσωση στον Υμηττό με την υποστ...';
ScrollItemURL[0] ='/cbg/gr/press/press_releases_story.jsp?docid=E17378F5D6A6E0FFA8F85507B44964&cabinet=PRESS_RELEASES&lang=gr';
ScrollItemText[1] = '08/03/10 Νέο καταναλωτικό δάνειο «Xpress» από την Εμπορική ...';
ScrollItemURL[1] ='/cbg/gr/press/press_releases_story.jsp?docid=B666F51BBE6EB0FFA6B745B9A7C193&cabinet=PRESS_RELEASES&lang=gr';
ScrollItemText[2] = '05/03/10 Εγκαίνια του ανανεωμένου καταστήματος της Εμπορική...';
ScrollItemURL[2] ='/cbg/gr/press/press_releases_story.jsp?docid=841BBE4E877DFAB1315B57E915FA15&cabinet=PRESS_RELEASES&lang=gr';
function LaunchScroller(up,left)
{
DistanceFromLeftEdge = left - 14;
ScrollerTop = up;
ScrollerLeft = eval(DistanceFromLeftEdge + leftEdgePosition(document.getElementById(LeftEdge)));
for(i=0; i' +
'';
document.body.insertAdjacentHTML("beforeEnd",text);
}
function Scroller(name, id, shiftBy, interval, loop)
{
this.name = name;
this.id = id;
this.shiftBy = shiftBy ? shiftBy : 1;
this.interval = interval ? interval : 100;
this.loop = loop ? loop : -1;
this.timesLooped = 0;
this.itemsScrolled = 1;
this.runId = null;
this.div = document.getElementById(id);
this.left = ScrollerWidth;
this.div.style.visibility = 'hidden';
var node = this.div.firstChild;
var next;
while (node)
{
next = node.nextSibling;
if (node.nodeType == 3)
this.div.removeChild(node);
node = next;
}
this.shiftLeftAt = this.div.firstChild.offsetWidth;
this.div.style.height = this.div.firstChild.offsetHeight;
}
function startScroller()
{
this.div.style.visibility = 'hidden';
this.stop();
this.left -= this.shiftBy;
if (this.left <= -this.shiftLeftAt)
{
if (this.loop != -1)
{
if (this.timesLooped >= this.loop - 1)
{
this.div.firstChild.style.visibility = 'hidden';
}
this.div.appendChild(this.div.firstChild);
this.itemsScrolled++;
if (this.itemsScrolled == ScrollItemTextAndURL.length + 1)
{
this.itemsScrolled = 0;
this.timesLooped++;
}
if (this.timesLooped >= this.loop)
{
return;
}
}
else
{
this.div.appendChild(this.div.firstChild);
}
this.left = 0;
this.shiftLeftAt = this.div.firstChild.offsetWidth;
if(this.shiftLeftAt == undefined)
this.shiftLeftAt = 0;
}
this.div.style.left = (this.left + 'px');
this.runId = setTimeout(this.name + '.start()', this.interval);
this.div.style.visibility = 'visible';
}
function stopScroller()
{
if (this.runId)
clearTimeout(this.runId);
this.runId = null;
}
function leftEdgePosition(parent)
{
var offsetLeft = 0;
var offsetTrail = parent;
while (offsetTrail)
{
offsetLeft += offsetTrail.offsetLeft;
offsetTrail = offsetTrail.offsetParent;
}
if (navigator.userAgent.indexOf("Mac") != -1 && typeof document.body.leftMargin != "undefined")
{
offsetLeft += document.body.leftMargin;
}
return offsetLeft;
}
function repositionScroller()
{
var scrollerDiv = document.getElementById("scrollerDIV");
if(scrollerDiv)
{
scrollerDiv.style.left = eval(DistanceFromLeftEdge + leftEdgePosition(document.getElementById(LeftEdge)));
}
}
window.onresize = repositionScroller;
Scroller.prototype.start = startScroller;
Scroller.prototype.stop = stopScroller;