ZiXON.namespace("ZiXON.Effects");
(function(){ZiXON.Effects.ImageRotate=function(o){this.running=false;this.timeout=null;this.current=0;this.delay=2500;this.transition=50;this.links=new Array();this.start=function(o){if(!this.running){running=true;this.timeout=setTimeout(function(){ZiXON.Effects.ImageRotate.rotate(o)},this.delay);}};this.stop=function(){if(this.running){this.running=false;clearTimeout(this.timeout);}};this.add=function(u,l){this.urls[this.urls.length]=u;if(l!=null)this.links[this.urls.length-1]=l;};if(o && o.id){window[o.id]=this;this.id=o.id;document.write('<div id="'+o.id+'" style="position:absolute;height:'+o.height+'"></div>');this.urls=o.urls;if(o.links!=null)this.links=o.links;if(o.delay!=null)this.delay=o.delay;if(o.transition!=null)this.transition=o.transition;this.images=new Array();ZiXON.Effects.ImageRotate.nextImage(this);this.images[0].style.display="block";ZiXON.Effects.ImageRotate.setOpacity(this.images[0],1);ZiXON.Effects.ImageRotate.nextImage(this);if(o.start && (o.start=="true"))this.start(this);ZiXON.Effects.ImageRotate.nextImage(this);}};ZiXON.Effects.ImageRotate.rotate=function(o){if(o.images.length>1){var next=o.images[o.current+1]?o.current+1:0;o.images[next].style.display="block";ZiXON.Effects.ImageRotate.setOpacity(o.images[o.current],o.images[o.current].zOpacity-.05);ZiXON.Effects.ImageRotate.setOpacity(o.images[next],o.images[next].zOpacity+.05);if(o.images[o.current].zOpacity>0){o.timeout=setTimeout(function(){ZiXON.Effects.ImageRotate.rotate(o)},o.transistion);}else{o.images[o.current].style.display="none";o.current=next;o.timeout=setTimeout(function(){ZiXON.Effects.ImageRotate.rotate(o)},o.delay);ZiXON.Effects.ImageRotate.nextImage(o);}}else{o.timeout=setTimeout(function(){ZiXON.Effects.ImageRotate.rotate(o)},50);ZiXON.Effects.ImageRotate.nextImage(o);}};ZiXON.Effects.ImageRotate.setOpacity=function(o,a){if(a!=null)o.zOpacity=a;if(o.zOpacity>1)o.zOpacity=1;if(o.zOpacity<0)o.zOpacity=0;o.style.opacity=o.zOpacity;o.style.MozOpacity=o.zOpacity;o.style.KhtmlOpacity=o.zOpacity;o.style.filter="alpha(opacity="+(o.zOpacity*100)+")";};ZiXON.Effects.ImageRotate.nextImage=function(o){if(o.urls.length != o.images.length){var i=o.images.length;o.images[i]=new Image();o.images[i].border=0;o.images[i].style.display="none";o.images[i].style.position="absolute";o.images[i].src=o.urls[i];ZiXON.Effects.ImageRotate.setOpacity(o.images[i],0);if(o.links[i] && o.links[i].href && (o.links[i].href.length>0)){var l=document.createElement("a");l.href=o.links[i].href;if(o.links[i].target)l.target=o.links[i].target;document.getElementById(o.id).appendChild(l);l.appendChild(o.images[i]);}else{document.getElementById(o.id).appendChild(o.images[i]);}}}})();