(function($){
$.fn.innerfade=function(_2){
return this.each(function(){
$.innerfade(this,_2);
});
};
$.innerfade=function(_3,_4){
var _5={"animationtype":"fade","speed":"normal","type":"sequence","timeout":2000,"containerheight":"auto","runningclass":"innerfade","children":null};
if(_4){
$.extend(_5,_4);
}
if(_5.children===null){
var _6=$(_3).children();
}else{
var _6=$(_3).children(_5.children);
}
if(_6.length>1){
$(_3).css("position","relative").css("height",_5.containerheight).addClass(_5.runningclass);
for(var i=0;i<_6.length;i++){
$(_6[i]).css("z-index",String(_6.length-i)).css("position","absolute").hide();
}
if(_5.type=="sequence"){
setTimeout(function(){
$.innerfade.next(_6,_5,1,0);
},_5.timeout);
$(_6[0]).show();
}else{
if(_5.type=="random"){
var _8=Math.floor(Math.random()*(_6.length));
setTimeout(function(){
do{
_9=Math.floor(Math.random()*(_6.length));
}while(_8==_9);
$.innerfade.next(_6,_5,_9,_8);
},_5.timeout);
$(_6[_8]).show();
}else{
if(_5.type=="random_start"){
_5.type="sequence";
var _9=Math.floor(Math.random()*(_6.length));
setTimeout(function(){
$.innerfade.next(_6,_5,(_9+1)%_6.length,_9);
},_5.timeout);
$(_6[_9]).show();
}else{
alert("Innerfade-Type must either be 'sequence', 'random' or 'random_start'");
}
}
}
}
};
$.innerfade.next=function(_a,_b,_c,_d){
if(_b.animationtype=="slide"){
$(_a[_d]).slideUp(_b.speed);
$(_a[_c]).slideDown(_b.speed);
}else{
if(_b.animationtype=="fade"){
$(_a[_d]).fadeOut(_b.speed);
$(_a[_c]).fadeIn(_b.speed,function(){
removeFilter($(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(){
$.innerfade.next(_a,_b,_c,_d);
}),_b.timeout);
};
})(jQuery);
function removeFilter(_e){
if(_e.style.removeAttribute){
_e.style.removeAttribute("filter");
}
}


