$.fn.innerfade=function(a){return this.each(function(){var c={speed:"normal",timeout:2000,type:"sequence",containerheight:"auto"};if($.browser.msie==true){document.execCommand("BackgroundImageCache",false,true)}if(a){$.extend(c,a)}var d=$(this).children().get();if(d.length>1){$(this).parent().css("position","relative");$(this).css("height",c.containerheight);for(var b=0;b<d.length;b++){$(d[b]).css("z-index",d.length-b).css("position","absolute");$(d[b]).hide()}if(c.type=="sequence"){setTimeout(function(){$.innerfade.next(d,c,1,0)},c.timeout);$(d[0]).show()}else{if(c.type=="random"){setTimeout(function(){do{current=Math.floor(Math.random()*(d.length))}while(current==0);$.innerfade.next(d,c,current,0)},c.timeout);$(d[0]).show()}else{alert("type must either be 'sequence' or 'random'")}}}})};$.innerfade=function(){};$.innerfade.next=function(c,a,d,b){$(c[b]).fadeOut(a.speed);$(c[d]).fadeIn(a.speed);if(a.type=="sequence"){if((d+1)<c.length){d=d+1;b=d-1}else{d=0;b=c.length-1}}else{if(a.type=="random"){b=d;while(d==b){d=Math.floor(Math.random()*(c.length))}}else{alert("type must either be 'sequence' or 'random'")}}setTimeout((function(){$.innerfade.next(c,a,d,b)}),a.timeout)};

