/*
	Coverflow plugin for jQuery
	Copyright (c) 2010 Last Exit
	http://lastexit.tv/
*/
;(function($){$.coverflow={defaults:{startAt:0,show:2}};$.fn.extend({coverflow:function(options){this.options=$.extend({},$.coverflow.defaults,options);var self=this;this.items=$(this).children().bind("click",function(){self.moveTo(this);return false});this.itemWidth=this.items.outerWidth(true);this.itemHeight=this.items.outerHeight(true);this.current=this.options.startAt;this.glideTo(0,this.current);this.center();this.currentElement=$(this.items).eq(this.current)},moveTo:function(item){this.previous=this.current;this.current=!isNaN(parseInt(item))?parseInt(item):this.items.index(item);if(this.previous==this.current){window.location.href($('a',item).attr('href'))}var self=this,to=Math.abs(self.previous-self.current)<=1?self.previous:self.current+(self.previous<self.current?-1:1);self.glideTo(to,self.current);self.center()},center:function(){var left=(-this.current*this.itemWidth/2)+(this.parent()[0].offsetWidth/2-this.itemWidth/2);this.animate({left:(left)},{duration:400,easing:"jswing"})},glideTo:function(from,to){var self=this,offset=null;var height=0;this.items.each(function(i){var side=(i==to&&from-to<0)||i-to>0?"left":"right";var sideNo=(side=="left"?to-i:i-to);if(sideNo<-self.options.show){$(this).animate({'opacity':'0.0'},300)}else{$(this).animate({'opacity':'1.0'},300);switch(sideNo){case 0:$('.exec-details').css('display','none');$('.exec-details',this).css('display','block');$(this).css({'height':'','top':''});break;case-1:removeHeight=(self.itemHeight*0.10);$(this).css({'height':(self.itemHeight)-removeHeight,'top':removeHeight/2});break;case-2:removeHeight=(self.itemHeight*0.20);$(this).css({'height':(self.itemHeight)-removeHeight,'top':removeHeight/2});break;default:$(this).css({'height':'','top':''});break}}$(this).css({left:((-i*((self.itemWidth/4)*2))),zIndex:self.items.length+sideNo})})}})})(jQuery);
