/*Programming language: Java Script* *Requirements: IE 4+, Netscape 6+, Mozilla and all other Dom capable browsers* */ function TSlinkrotation () { // fill the linklist with your links this.addLink = addLink; // change the link this.rotateLink = rotateLink; // loop the rotateLink() function this.start = function() { // check if browser supports javascript and start rotation if browser does if (document.all || document.getElementById) { //setInterval(this.objName+'.rotateLink()', this.refreshTime); setTimeout(this.objName+'.rotateLink()',0);//Must show at time 0; setInterval(this.objName+'.rotateLink()', this.refreshTime); } } } function NormalRotation(divName) { this.linklist = new Array(); this.parameter = new Array(); this.linktype = new Array(); // give every linkrotation object an unique name this.objName = "linkrotation" + (TSlinkrotation.id++); eval(this.objName + "=this"); this.refreshTime = 60000 * 1000; this.divName = divName; this.currentIndex = -1; this.setCurrentIndex = function() { if (this.currentIndex >= this.linklist.length - 1) this.currentIndex = 0; else this.currentIndex++; } this.showTracer = function() { var tr=new Image(1,1); tr.src="/IMAGES/eet_ban_preview.gif?"+this.parameter[this.currentIndex]+"/|/|Random="+Math.random(); } } NormalRotation.prototype = new TSlinkrotation; /* support functions */ function addLink(link,parameter,type) { this.linklist[this.linklist.length] = link; this.parameter[this.parameter.length] = parameter; this.linktype[this.linktype.length] = type; } function rotateLink() { this.setCurrentIndex(); if (document.getElementById && document.createRange) { // Netscape 6+, Mozilla // we can use the W3C DOM var range = document.createRange(); // search the
in the webpage var div = document.getElementById(this.divName); range.setStartBefore(div); // prepare the new link var currentLink = range.createContextualFragment(this.linklist[this.currentIndex]); // remove the old link while (div.hasChildNodes()) div.removeChild(div.lastChild); // write the new link into the webpage div.appendChild(currentLink); } else if (document.all) { // Internet Explorer 4+, Opera (does not support DHTML) // we have to use the ms object model eval('document.all.'+this.divName+'.innerHTML = this.linklist[this.currentIndex]'); if (this.linktype[this.currentIndex]=='Another') { setTimeout('shrinkHide(panExpand)',3*1000); // setTimeout('shrinkHide(panExpand)',100); } } this.showTracer(); } TSlinkrotation.id = 0; //--------------Rotation Expand Click Banner Use Only-------------------// function startHide() { setTimeout('shrinkHide(document.getElementById("panExpand"))',0); } function shrinkHide(panWindow) { // // alert(panWindow); if(panWindow!=null) { if(parseInt(panWindow.style.height) > 5 ) { panWindow.style.height = parseInt(panWindow.style.height) - 5; }else{ panWindow.style.height = 0; } if(parseInt(panWindow.style.height) > 0 ) { setTimeout('shrinkHide(document.getElementById("panExpand"))',20); }else{ panWindow.style.visibility = "hidden"; } } } function showPan() { var panWindow = document.getElementById("panExpand"); panWindow.style.visibility = "visible"; panWindow.style.height = 180; //panWindow.style.left = self.style.left; }