/* jquery.fufade.js 1.0
// chrismckee.co.uk // http://bit.ly/chrisisagit */
(function(a){var c,d,f,h,k,l,m,n;a.fn.fuFade=function(b){return this.each(function(){a.fuFade(this,b)})};a.fuFade=function(b,g){c={speed:"normal",type:"sequence",timeout:2E3,containerheight:"auto",runningclass:"fufade",children:null};g&&a.extend(c,g);d=c.children===null?a(b).children():(d=a(b).children(c.children));if(d.length>1){a(b).css("position","relative").css("height",c.containerheight).addClass(c.runningclass);for(f=0;f<d.length;f++)a(d[f]).css("z-index",String(d.length-f)).css("position",
"absolute").hide();a(".nextbtn").bind("click",function(){n=setTimeout(function(){a.fuFade.next(d,c,1,0,n)},0)});a(".backbtn").fadeTo("fast",0.5);if(c.type==="sequence"){setTimeout(function(){a.fuFade.next(d,c,1,0)},c.timeout);a(d[0]).show()}else if(c.type==="random"){k=Math.floor(Math.random()*d.length);setTimeout(function(){do h=Math.floor(Math.random()*d.length);while(k===h);a.fuFade.next(d,c,h,k)},c.timeout);a(d[k]).show()}else if(c.type==="random_start"){c.type="sequence";h=Math.floor(Math.random()*
d.length);setTimeout(function(){a.fuFade.next(d,c,(h+1)%d.length,h)},c.timeout);a(d[h]).show()}else try{console.log("fuFade-Type must either be 'sequence' or 'random'")}catch(e){}}};a.fuFade.next=function(b,g,e,j,i){clearTimeout(i);m=e===b.length-1?0:e+1;l=e===0?b.length-1:(l=e-1);for(f=0;f<b.length;f++)if(f!==j&&f!==e){a(b[f]).css("z-index","1");a(b[f]).css("top",0).css("left",0);a(b[f]).fadeOut(g.speed)}a(b[j]).css("z-index","190");a(b[e]).css("z-index","195");a(".nextbtn").unbind("click");a(".nextbtn").bind("click",
function(){clearTimeout(i);a.fuFade.next(b,g,m,e,i);return false});a(".backbtn").unbind("click");a(".backbtn").bind("click",function(){clearTimeout(i);a.fuFade.next(b,g,l,e,i);return false});a(b[j]).fadeOut(g.speed);a(b[e]).fadeIn(g.speed,function(){a.fuFade.removeFilter(a(this)[0])});a(".backbtn").fadeTo("fast",1);if(g.type==="sequence")if(e+1<b.length){e+=1;j=e-1}else{e=0;j=b.length-1}i=setTimeout(function(){a.fuFade.next(b,g,m,l,i)},g.timeout)};a.fuFade.removeFilter=function(b){b.style.removeAttribute&&
b.style.removeAttribute("filter")}})(jQuery);
