(function(jQuery){jQuery.fn.innerfade=function(a){return this.each(function(){jQuery.innerfade(this,a)})};jQuery.innerfade=function(a,b){var c={'animationtype':'fade','speed':'normal','type':'sequence','timeout':2000,'containerheight':'auto','runningclass':'innerfade','children':null};if(b)jQuery.extend(c,b);if(c.children===null)var d=jQuery(a).children();else var d=jQuery(a).children(c.children);if(d.length>1){jQuery(a).css('position','relative').css('height',c.containerheight).addClass(c.runningclass);for(var i=0;i<d.length;i++){jQuery(d[i]).css('z-index',String(d.length-i)).css('position','absolute').hide()};if(c.type=="sequence"){setTimeout(function(){jQuery.innerfade.next(d,c,1,0)},c.timeout);jQuery(d[0]).show()}else if(c.type=="random"){var e=Math.floor(Math.random()*(d.length));setTimeout(function(){do{f=Math.floor(Math.random()*(d.length))}while(e==f);jQuery.innerfade.next(d,c,f,e)},c.timeout);jQuery(d[e]).show()}else if(c.type=='random_start'){c.type='sequence';var f=Math.floor(Math.random()*(d.length));setTimeout(function(){jQuery.innerfade.next(d,c,(f+1)%d.length,f)},c.timeout);jQuery(d[f]).show()}else{alert('Innerfade-Type must either be \'sequence\', \'random\' or \'random_start\'')}}};jQuery.innerfade.next=function(a,b,c,d){if(b.animationtype=='slide'){jQuery(a[d]).slideUp(b.speed);jQuery(a[c]).slideDown(b.speed)}else if(b.animationtype=='fade'){jQuery(a[d]).fadeOut(b.speed);jQuery(a[c]).fadeIn(b.speed,function(){removeFilter(jQuery(this)[0])})}else alert('Innerfade-animationtype must either be \'slide\' or \'fade\'');if(b.type=="sequence"){if((c+1)<a.length){c=c+1;d=c-1}else{c=0;d=a.length-1}}else if(b.type=="random"){d=c;while(c==d)c=Math.floor(Math.random()*a.length)}else alert('Innerfade-Type must either be \'sequence\', \'random\' or \'random_start\'');setTimeout((function(){jQuery.innerfade.next(a,b,c,d)}),b.timeout)}})(jQuery);function removeFilter(a){if(a.style.removeAttribute){a.style.removeAttribute('filter')}}
