jQuery.extend(jQuery.easing,{easeInOutExpo:function(x,t,b,c,d){if(t==0)return b;if(t==d)return b+c;if((t/=d/2)<1)return c/2*Math.pow(2,10*(t-1))+b;return c/2*(-Math.pow(2,-10*--t)+2)+b}});(function($){$.fn.extend({panelGallery:function(options){var defaults={viewDuration:4000,transitionDuration:1000,boxSize:35,boxFadeDuration:1000,boxTransitionDuration:100,panelWidth:40,panelTransitionDuration:100,pauseOnHover:true,FX:new Array()};var options=$.extend(defaults,options);return this.each(function(){var randID=Math.round(Math.random()*100000000);var o=options;var obj=$(this);var numImages=$('div',obj).length;var imgDimensions={width:'100%',height:'100%'};var currentImage=0;var imageArray=new Array();var imageNameArray=new Array();var timeout;var firstTime=true;var mouseover=false;$(obj).width(imgDimensions.width).height(imgDimensions.height).css({'overflow':'hidden'});$('div',obj).each(function(){imageArray.push($(this));imageNameArray.push($(this).attr('name'));if(!$(this).is(':first')){$(this).remove()}});if(o.pauseOnHover){$(obj).mouseenter(function(){mouseover=true;clearTimeout(timeout);$(this).css({'cursor':'wait'})}).mouseleave(function(){mouseover=false;timeout=setTimeout(function(){if(!firstTime){imageArray.push(imageArray.shift());imageNameArray.push(imageNameArray.shift())}$('div',obj).remove();pickFX()},o.viewDuration)})}timeout=setTimeout(function(){pickFX()},o.viewDuration);function galleryFX(name,opt1){if(name=='fade'){$('div',obj).remove();$(obj).append(imageArray[0]).append(imageArray[1]);$('div:eq(1)',obj).css({'position':'absolute','top':'0','left':'0'}).hide().fadeIn(o.transitionDuration);cleanupAndProceed()}}function cleanupAndProceed(delay){delay=(!delay)?o.transitionDuration:delay;setTimeout(function(){if(!mouseover){firstTime=false;$(obj).append(imageArray[currentImage+1]);$('.box',obj).remove();$('.horizPanel',obj).remove();$('.vertPanel',obj).remove();timeout=setTimeout(function(){imageArray.push(imageArray.shift());imageNameArray.push(imageNameArray.shift());$('div',obj).remove();pickFX()},o.viewDuration)}},delay)}function pickFX(){randomFXarray=new Array("fade");var randFX=Math.floor(Math.random()*randomFXarray.length);if(imageNameArray[0])opt=imageNameArray[0];else if(o.FX.length>0){opt=o.FX[0];o.FX.push(o.FX.shift())}else opt=randomFXarray[randFX];opt1=opt.split(',');bool=(opt1[1]=='true')?true:false;str={name:opt1[0],opt1:bool};galleryFX(str.name,str.opt1)}})}})})(jQuery);Array.prototype.shuffle=function(){var s=[];while(this.length)s.push(this.splice(Math.random()*this.length,1));while(s.length)this.push(s.pop());return this}
