/*
	Based on TinyFader: Copyright (c) 2010, by Michael Leigeber
	The original script is available free of charge for both personal or commercial
	projects under the creative commons license:
		http://www.leigeber.com/2010/09/fading-slideshow-script/
		http://creativecommons.org/licenses/by/3.0/us/
*/
var TINY={};function T$(i){return document.getElementById(i)}
function T$$(e,p){return p.getElementsByTagName(e)}
TINY.fader=function(){this.pO=null;this.ppO=null;function fade(n,p){this.n=n;this.init(p)}
fade.prototype.init=function(p){var s=T$(p.id),u=this.u=T$$('li',s),l=u.length,i=this.l=this.c=this.z=0;if(p.navid&&p.activeclass){this.g=T$$('li',T$(p.navid));this.s=p.activeclass}
s.style.overflow='hidden';this.a=p.auto||0;this.p=p.resume||0;for(i;i<l;i++){if(u[i].parentNode==s){u[i].style.position='absolute';this.l++;u[i].o=p.visible?100:0;u[i].style.opacity=u[i].o/100;u[i].style.filter='alpha(opacity='+u[i].o+')'}}
this.pos(p.position||0,this.a?1:0,p.visible)},fade.prototype.auto=function(){this.u.ai=setInterval(new Function(this.n+'.move(1,1)'),this.a*2000)},fade.prototype.move=function(d,a){var n=this.c+d,i=d==1?n==this.l?0:n:n<0?this.l-1:n;this.pos(i,a)},fade.prototype.pos=function(i,a,v){if(pO!=i){var p=this.u[i];if(pO!=null){var pp=this.u[pO];}
if(ppO!=null){var ppOO=this.u[ppO];}
clearInterval(p.si);clearInterval(this.u.ai);this.u.ai=0;this.c=i;if(p.o>=100&&!v){p.o=0;p.style.opacity=0;p.style.filter='alpha(opacity=0)'}
if(this.g){for(var x=0;x<this.l;x++){this.g[x].className=x==i?this.s:''}}
if((p.si=setInterval(new Function(this.n+'.fade('+i+','+a+')'),30))!='undefined'){if(ppO!=null){ppOO.style.zIndex=ppO+1;}
if(pO!=null){pp.style.zIndex=this.l+1;ppO=pO;}
pO=i;p.style.zIndex=this.l+2;}}},fade.prototype.fade=function(i,a){var p=this.u[i];if(document.body.style.webkitTransition!==undefined){if(p.o<=0){p.style.webkitTransition="opacity .5s linear";p.style.opacity=1;p.addEventListener('webkitTransitionEnd',function(){p.o=100},true);p.o=1;}else if(p.o==100){p.style.webkitTransition="none";clearInterval(p.si);if((a||(this.a&&this.p))&&!this.u.ai){this.auto()}}}else{if(p.o>=100){clearInterval(p.si);if((a||(this.a&&this.p))&&!this.u.ai){this.auto()}}else{p.o+=5;p.style.opacity=p.o/100;p.style.filter='alpha(opacity='+p.o+')'}}};return{fade:fade}}();
