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] = '23/12/08 Emporiki Bank adopts measures to support small and...'; ScrollItemURL[0] ='/cbgen/gr/press/press_releases_story.jsp?docid=691B77C83E23493E9B69DE207319EF&cabinet=PRESS_RELEASES&lang=gr'; ScrollItemText[1] = '16/12/08 Mr. Crontiras visits Cyprus where he holds importa...'; ScrollItemURL[1] ='/cbgen/gr/press/press_releases_story.jsp?docid=AB21FCC4B57E640441F14982E7340B&cabinet=PRESS_RELEASES&lang=gr'; ScrollItemText[2] = '24/11/08 Opening of the new headquarters and confirmation o...'; ScrollItemURL[2] ='/cbgen/gr/press/press_releases_story.jsp?docid=4FA1A655E927D65A93A5C393AAB152&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;