
    			//var promo=new imageRotator('promo');
    			//var images=[{src:'/img/rotate1.jpg',title:'Image 1',href:'/'},{src:'/img/rotate2.jpg',title:'Image 2'},{src:'/img/rotate3.jpg',title:'Image 3'},{src:'/img/rotate4.jpg',title:'Image 4'}];
    			//promo.init(5000,2,2,images,'rotator');

function imageRotator(varRef) {this.varRef=varRef;this.delay=2000;this.alphaSteps=5;this.timeSteps=2;this.images=[];this.container=null;this.index=0;this.loader=null;this.presenter=null;this.timer=null;this.init=init;this.loaded=loaded;this.faded=faded;this.next=next;function init(d,a,t,i,c) {if (d!==null) this.delay=d;if (a!==null) this.alphaSteps=a;if (t!==null) this.timeSteps=t;this.images=i;this.container=(typeof(c)=="string")?ob(c):c;this.index=0;this.container.innerHTML="<div id='iRPresentation' style='position:absolute'></div><div style='display:none;position:absolute' id='iRLoader'><img src='"+this.images[this.index].src+"' onload='"+this.varRef+".loaded();'/></div>";this.loader=ob('iRLoader');this.presenter=ob('iRPresentation');}function loaded() {fader(this.loader,0);this.loader.style.display='block';fadeObject.fade(this.loader,0,100,this.alphaSteps,this.varRef+".faded()");}function faded() {var ins="<img src='"+this.images[this.index].src+"' title='"+(this.images[this.index].title?this.images[this.index].title:"")+"'/>";if (this.images[this.index].href) ins="<a href='"+this.images[this.index].href+"'>"+ins+"</a>";this.presenter.innerHTML=ins;this.loader.style.display="none";this.timer=setTimeout(this.varRef+".next()",this.delay);}function next() {this.index++;if (this.index>=this.images.length) this.index=0;this.loader.innerHTML="<img src='"+this.images[this.index].src+"' onload='"+this.varRef+".loaded();'/>";}}
function ob(id){return document.getElementById(id);}

