//IMAGE CROSS FADE
//© Websir(websir.co.uk)
//created by Alex Oliver on 03/12/09 22:00 GMT
//
//VARIABLES
// aniDuration = the speed of the element animation
// aniInterval = Set the interval between each animation
// easing = the jquery effect used in the animation of the content
//
//USAGE
//$('image_container').imgCrossFade({aniDuration:600,aniInterval:3000,easing:'linear'});

var imgCfadeInt;
(function(d){d.fn.extend({imgCrossFade:function(a){var f={aniDuration:600,aniInterval:3E3,easing:"linear"};a=d.extend(f,a);return this.each(function(){var b=d(this).children("img"),e=b.size()-1,c=0;b.animate({opacity:0},{duration:0,queue:false}).css({display:"block"});if(e>0){b.eq(0).animate({opacity:1},{duration:a.aniDuration,queue:false,easing:a.easing});if(e>1)imgCfadeInt=setInterval(function(){if(e==c)c=0;else c++;b.animate({opacity:0},{duration:a.aniDuration,queue:false,easing:a.easing}).eq(c).animate({opacity:1},{duration:a.aniDuration,
queue:false,easing:a.easing})},a.aniInterval)}})}})})(jQuery);