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] = '20/11/08 Η Εμπορική Τράπεζα χορηγός στο θεσμό των Retail Bu...'; ScrollItemURL[0] ='/cbg/gr/press/press_releases_story.jsp?docid=F89779D3694524FD2872DD05EC8B1F&cabinet=PRESS_RELEASES&lang=gr'; ScrollItemText[1] = '05/11/08 Αποτελέσματα εννεαμήνου Ιανουαρίου-Σεπτεμβρίου 200...'; ScrollItemURL[1] ='/cbg/gr/press/press_releases_story.jsp?docid=7E82A9ADE22817D850FB9B40F2CB0D&cabinet=PRESS_RELEASES&lang=gr'; ScrollItemText[2] = '23/10/08 Ανακοίνωση Τύπου Εμπορικής Τράπεζας'; ScrollItemURL[2] ='/cbg/gr/press/press_releases_story.jsp?docid=6C006FDA4AFA534A7464B74560BAA8&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' + '
'; for(var i=0; i' + ScrollItemTextAndURL[i][TheItemText] + ''; } text += '| |
'; 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;