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

