var zz = { add: function(D, C, A, B) { B = B || false; if (D.addEventListener) { D.addEventListener(C, A, B) } else { if (D.attachEvent) { D.attachEvent("on" + C, A) } } }, remove: function(D, C, A, B) { B = B || false; if (D.removeEventListener) { D.removeEventListener(C, A, B) } else { if (D.detachEvent) { D.detachEvent("on" + C, A) } } }, DOMit: function(A) { A = A ? A : window.event; if (!A.target) { A.target = A.srcElement } if (!A.preventDefault) { A.preventDefault = function() { A.returnValue = false; return false } } if (!A.stopPropagation) { A.stopPropagation = function() { A.cancelBubble = true } } return A }, getTarget: function(A) { A = zz.DOMit(A); var B = A.target; if (B.nodeType != 1) { B = B.parentNode } return B } }; function addLoadEvent(A) { var B = window.onload ? window.onload : function() { }; window.onload = function() { B(); A() } } function myRot(H, F, G, B, A, E) { var D = document.getElementById(H); if (!D) { D = document.images[H]; if (!D) { return } D.id = H } this.id = H; this.speed = F || 4500; this.path = G || ""; this.bRand = E; this.ctr = 0; this.timer = 0; this.imgs = []; this._setupLink(D, A); this.bTrans = B && typeof D.filters != "undefined"; var C = myRot.col.length; myRot.col[C] = this; this.animString = "myRot.col[" + C + "]" } myRot.col = []; myRot.resumeDelay = 400; myRot.prototype._setupLink = function(C, B) { if (C.parentNode && C.parentNode.tagName.toLowerCase() == "a") { var A = this.parentLink = C.parentNode; if (B) { zz.add(A, "mouseover", myRot.pause); zz.add(A, "mouseout", myRot.resume) } } }; myRot.getInstanceById = function(D) { var A = myRot.col.length, C; for (var B = 0; B < A; B++) { C = myRot.col[B]; if (C.id && C.id == D) { return C } } return null }; myRot.prototype.on_rotate = function() { }; myRot.prototype.addImages = function() { var A; for (var B = 0; arguments[B]; B++) { A = new Image(); A.src = this.path + arguments[B]; this.imgs[this.imgs.length] = A } }; myRot.prototype.rotate = function() { clearTimeout(this.timer); this.timer = null; var A = document.getElementById(this.id); if (this.bRand) { this.setRandomCtr() } else { if (this.ctr < this.imgs.length - 1) { this.ctr++ } else { this.ctr = 0 } } if (this.bTrans) { this.doImageTrans(A) } else { A.src = this.imgs[this.ctr].src } this.swapAlt(A); this.prepAction(); this.on_rotate(); this.timer = setTimeout(this.animString + ".rotate()", this.speed) }; myRot.prototype.setRandomCtr = function() { var A = 0, B; do { B = Math.floor(Math.random() * this.imgs.length); A++ } while (B == this.ctr && A < 6); this.ctr = B }; myRot.prototype.doImageTrans = function(A) { A.style.filter = "blendTrans(duration=1)"; if (A.filters.blendTrans) { A.filters.blendTrans.Apply() } A.src = this.imgs[this.ctr].src; A.filters.blendTrans.Play() }; myRot.prototype.swapAlt = function(A) { if (!A.setAttribute) { return } if (this.alt && this.alt[this.ctr]) { A.setAttribute("alt", this.alt[this.ctr]) } if (this.title && this.title[this.ctr]) { A.setAttribute("title", this.title[this.ctr]) } }; myRot.prototype.prepAction = function() { if (this.actions && this.parentLink && this.actions[this.ctr]) { if (typeof this.actions[this.ctr] == "string") { this.parentLink.href = this.actions[this.ctr] } else { if (typeof this.actions[this.ctr] == "function") { var A = this.id; this.parentLink.href = "javascript: void " + this.actions[this.ctr] + "('" + A + "')" } } } }; myRot.prototype.showCaption = function() { if (this.captions && this.captionId) { var A = document.getElementById(this.captionId); if (A && this.captions[this.ctr]) { A.innerHTML = this.captions[this.ctr] } } }; myRot.start = function() { var A = myRot.col.length, C; for (var B = 0; B < A; B++) { C = myRot.col[B]; if (C && C.id) { C.timer = setTimeout(C.animString + ".rotate()", C.speed) } } }; myRot.stop = function() { var A = myRot.col.length, C; for (var B = 0; B < A; B++) { C = myRot.col[B]; if (C) { clearTimeout(C.timer); C.timer = null } } }; myRot.pause = function(B) { B = zz.DOMit(B); var C = B.target.id; var A = myRot.getInstanceById(C); if (A) { clearTimeout(A.timer); A.timer = null } }; myRot.resume = function(B) { B = zz.DOMit(B); var C = B.target.id; var A = myRot.getInstanceById(C); if (A && A.id) { A.timer = setTimeout(A.animString + ".rotate()", myRot.resumeDelay) } }; myRot.setup = function() { if (!document.getElementById) { return } var D, C, B, F, E, A; for (D = 0; arguments[D]; D++) { B = arguments[D]; F = new myRot(B.id, B.speed, B.path, B.bTrans, B.bMouse, B.bRand); try { E = B.images; A = E.length; for (C = 0; C < A; C++) { F.addImages(E[C]) } if (B.num) { F.ctr = B.num } if (B.actions && B.actions.length == A) { F.addProp("actions", B.actions) } if (B.alt && B.alt.length == A) { F.addProp("alt", B.alt) } if (B.title && B.title.length == A) { F.addProp("title", B.title) } if (B.captions) { F.addProp("captions", B.captions); F.captionId = B.captionId; myRot.addRotateEvent(F, function(H) { return function() { myRot.getInstanceById(H).showCaption() } } (B.id)) } } catch (G) { } } myRot.start() }; myRot.addRotateEvent = function(B, A) { var C = B.on_rotate; B.on_rotate = function() { C(); A() } }; myRot.prototype.addProp = function(D, B) { if (!this[D]) { this[D] = [] } var A = B.length; for (var C = 0; C < A; C++) { this[D][this[D].length] = B[C] } }; function doNothing() { return } zz.add(window, "load", doNothing);