/// ***************************** /// * RadRotator * /// ***************************** function RadRotator(id) { this.ID = id; this.Container = ''; this.InnerContainer = ''; this.CurrentFrame = 0; this.Frames = new Array(); this.Tickers = new Array(); this.NextFrameDelay = 2500; this.FrameEffect = ''; this.FrameChangeType = 'Frame'; this.FrameHeight = 0; this.FrameWidth = 0; this.ScrollSpeed = 30; this.ScrollHeight = 0; this.ScrollWidth = 0; this.ScrollDirection = 'vertical'; this.Paused = false; this.Browser = "uplevel"; this.timeoutvalue = null; this.running = false; this.topframe = 0; this.Dots = new Array(); this.SelectedDot = null; } RadRotator.prototype.ClearTicker = function() { var firstIndex; var lastIndex; if (this.Tickers.length) { tlrkScrollReadyState = false; var tickerCounter = this.Tickers.length; firstIndex = (this.CurrentFrame) * (tickerCounter / this.Frames.length); lastIndex = firstIndex + (tickerCounter / this.Frames.length); } for (var i=firstIndex; i 0) { var dot = document.getElementById(this.Dots[this.CurrentFrame]); if (this.ID == "managementNewsRotator") mDotClick(dot); if (this.ID == "employeeNewsRotator") eDotClick(dot); } } RadRotator.prototype.ShowFrame = function() { var innerContainer = document.getElementById(this.InnerContainer); var Container = document.getElementById(this.Container); var currentFrame = document.getElementById(this.Frames[this.CurrentFrame]); innerContainer.style.visibility = 'hidden'; innerContainer.innerHTML = currentFrame.innerHTML; if (this.FrameEffect && (this.Browser == "IE5" || this.Browser == "IE6")) { document.getElementById(this.InnerContainer).style.filter = this.FrameEffect; document.getElementById(this.InnerContainer).filters[0].apply(); } innerContainer.style.visibility = 'visible'; var instance = this; if (this.FrameEffect && (this.Browser == "IE5" || this.Browser == "IE6")) { document.getElementById(this.InnerContainer).filters[0].play(); window.setTimeout(function() { instance.StartTickers(); }, 1200); } else { this.StartTickers(); } } RadRotator.prototype.StartTickers = function() { if (this.Tickers.length) { tlrkScrollReadyState = false; var tickerCounter = this.Tickers.length; firstTicker = this.Tickers[(this.CurrentFrame) * (tickerCounter / this.Frames.length)]; firstTicker.Start(); } } RadRotator.prototype.NextFrame = function() { this.IncrementFrame(); this.ShowFrame(); if (this.NextFrameDelay) { eval(this.ID + " = " + "this;"); this.timeoutvalue = window.setTimeout(this.ID + ".NextFrame()", this.NextFrameDelay); } } // SCROLL RadRotator.prototype.CopyNextToScrollBuffer = function() { var innerContainer = document.getElementById(this.InnerContainer); var parentTable = document.getElementById(this.InnerContainer).firstChild; var parentTBody = parentTable.getElementsByTagName("TBODY")[0]; var parentRow = parentTable.getElementsByTagName("TR")[0]; if (this.ScrollDirection == 'vertical') { var clonedParentRow = parentRow.cloneNode(true); parentTBody.removeChild(parentRow); innerContainer.style.top = '0px'; parentTBody.appendChild(clonedParentRow); } else { var parentCell = parentRow.getElementsByTagName("TD")[0]; var clonedParentCell = parentCell.cloneNode(true); parentRow.removeChild(parentCell); innerContainer.style.left = '0px'; parentRow.appendChild(clonedParentCell); } this.topframe++; if (this.topframe >= this.Frames.length) this.topframe = 0; this.ClearTicker(); this.IncrementFrame(); if (this.Tickers.length) { tlrkScrollReadyState = false; var tickerCounter = this.Tickers.length; firstTicker = this.Tickers[(this.CurrentFrame) * (tickerCounter / this.Frames.length)]; firstTicker.Start(); } } RadRotator.prototype.NextScroll = function() { var innerContainer = document.getElementById(this.InnerContainer); innerContainer.style.top = '0px'; innerContainer.style.left = '0px'; innerContainer.style.visibility = 'visible'; if (this.Tickers.length) { tlrkScrollReadyState = false; var tickerCounter = this.Tickers.length; firstTicker = this.Tickers[(this.CurrentFrame) * (tickerCounter / this.Frames.length)]; firstTicker.Start(); } eval(this.ID + " = " + "this;"); this.timeoutvalue = window.setTimeout(this.ID + ".ScrollFrames(false);", this.NextFrameDelay); } RadRotator.prototype.CalculateFrameSize = function() { this.FrameHeight = parseInt(document.getElementById(this.Container).style.height.replace('px','')); this.FrameWidth = parseInt(document.getElementById(this.Container).style.width.replace('px','')); if (this.ScrollHeight == 0) this.ScrollHeight = this.FrameHeight; if (this.ScrollWidth == 0) this.ScrollWidth = this.FrameWidth; } RadRotator.prototype.InitScroll = function() { if (this.ScrollDirection == 'vertical') { for (i=0; i this.Lines[this.CurrentLine].length) { if (this.OnEnd) { this.OnEnd(); } this.CurrentLine = this.CurrentLine + 1; this.CurrentChar = 0; if (this.CurrentLine > this.Lines.length - 1) { overflowFlag = true; this.CurrentLine = 0; } if (overflowFlag && this.LineLoop == false) return; eval(this.ID + " = " + "this;"); window.setTimeout(this.ID + ".PrintNextChar(true)", this.NewLineDelay); return; } if (this.StatusBar) window.status += this.Lines[this.CurrentLine].charAt(this.CurrentChar-1); else con.innerHTML += this.Lines[this.CurrentLine].charAt(this.CurrentChar-1); eval(this.ID + " = " + "this;"); window.setTimeout(this.ID + ".PrintNextChar(false)", this.NewCharDelay); } RadRotator.prototype.SetFrame = function(frame) { if (frame < this.Frames.length) this.CurrentFrame = frame; else this.CurrentFrame = 0; } RadRotator.prototype.ScrollTo = function(frame) { //alert(frame); //alert(this.topframe); //frame = frame - this.topframe; var innerContainer = document.getElementById(this.InnerContainer); var parentTable = document.getElementById(this.InnerContainer).firstChild; var parentTBody = parentTable.getElementsByTagName("TBODY")[0]; while (frame != this.topframe) { var parentRow = parentTable.getElementsByTagName("TR")[0]; if (this.ScrollDirection == 'vertical') { var clonedParentRow = parentRow.cloneNode(true); parentTBody.removeChild(parentRow); parentTBody.appendChild(clonedParentRow); } else { var parentCell = parentRow.getElementsByTagName("TD")[0]; var clonedParentCell = parentCell.cloneNode(true); parentRow.removeChild(parentCell); parentRow.appendChild(clonedParentCell); } this.topframe++; if (this.topframe >= this.Frames.length) this.topframe = 0; } innerContainer.style.top = '0px'; this.ClearTicker(); //this.IncrementFrame(); if (this.Tickers.length) { tlrkScrollReadyState = false; var tickerCounter = this.Tickers.length; firstTicker = this.Tickers[(this.CurrentFrame) * (tickerCounter / this.Frames.length)]; firstTicker.Start(); } } RadRotator.prototype.GoTo = function(frame) { if (this.FrameChangeType == "frame") { this.SetFrame(frame); this.ShowFrame(); window.clearTimeout(this.timeoutvalue); this.running = false; } else { window.clearTimeout(this.timeoutvalue); this.ScrollTo(frame); //timeoutvalue = window.setTimeout(this.ID + ".ScrollFrames(false);", 0); this.running = false; } this.Paused = true; }