$.fn.Carousel=function(a){function u(){function y(){for(b=0;b<d.length;b++){i=Math.cos(g+b*j+h)*a.radius+q;n=Math.sin(g+b*j+h)*a.radius+v;k=o/(o+n);e=-Math.sin(g+b*j+h)*a.radius_y+r;p=s/2-k*100/2;if(a.view=="parallel"&&a.varyopacity==true)l={top:e,left:i+p,zIndex:parseInt(e),opacity:k};else if(a.view=="parallel")l={top:e,left:i,zIndex:parseInt(e)};$(d[b]).css(l)}z.click(function(){a.onclick(this)})}function t(c,f){i=Math.cos(c+f*j+h)*a.radius+q;n=Math.sin(c+f*j+h)*a.radius+v;k=o/(o+n);e=-Math.sin(c+
f*j+h)*a.radius_y+r;p=s/2-k*100/2;if(a.view=="parallel"&&a.varyopacity==true)l={top:e,left:i+p,opacity:k,zIndex:parseInt(e)};else if(a.view=="parallel")l={top:e,left:i,zIndex:parseInt(e)};$(d[f]).css(l)}function A(){var c=0,f=setInterval(function(){g+=Math.PI/(m*10);for(b=0;b<d.length;b++)t(g,b);c++;if(c==20){a.oncycle();clearInterval(f)}},40/a.speed)}if($.browser.msie)if(a.autoplay!=false)a.autoplay+=80;var v=100,o=$(d[0]).width()*(m*600/$(d[0]).width()),b=0,h,w=0;if(m%2!=0)w=180;var g=w*Math.PI/
180,j=Math.PI/(m/2),l,p,x,s=$(d[0]).width(),i,e,n,k;h=Math.PI/2;q-=s/2;$.fn.Carousel.next=function(){$.fn.Carousel.stop();var c=0,f=setInterval(function(){g+=Math.PI/(m*10);for(b=0;b<d.length;b++)t(g,b);c++;if(c==20){a.oncycle();clearInterval(f)}},40/a.speed)};$.fn.Carousel.prev=function(){$.fn.Carousel.stop();var c=0,f=setInterval(function(){g-=Math.PI/(m*10);for(b=0;b<d.length;b++)t(g,b);c++;if(c==20){a.oncycle();clearInterval(f)}},40/a.speed)};y();$.fn.Carousel.stop=function(){clearInterval(x)};
$.fn.Carousel.play=function(){if(a.autoplay==true)a.autoplay=4E3;x=setInterval(function(){A()},a.autoplay)};a.autoplay!=false&&$.fn.Carousel.play()}a=$.extend({speed:1,radius:300,radius_y:2,view:"parallel",varyopacity:true,oncycle:function(){},onclick:function(){},autoplay:false},a);var z=$(this).find("div").css({position:"absolute"}),d=$.makeArray($(this).find("div")),m=d.length,q=$(this).offset().left+a.radius,r=$(this).offset().top;$(this).css({height:r});$.browser.webkit?$(d[0]).find("img").load(function(){u()}):
u()};
