(function($){var opts;var currPanel=0;var prevPanel=0;var numPanels;var myThis;$.fn.panel=function(options){var defaults={PIC_OFFSTAGE:-700,PIC_ONSTAGE:0,FULL_SIZE_IMAGE_HEIGHT:528,PANEL_ANIMATE_OUT:500,PANEL_ANIMATE_IN:500,CALLBACK:""};opts=$.extend(defaults,options);myThis=$(this);numPanels=$(this).length;$(this).each(function(index){if(index==0){$(this).css({position:"relative",opacity:1});$(this).css({filter:""});$(this).css({left:opts.PIC_ONSTAGE,"z-index":100});}else{posOffset=opts.FULL_SIZE_IMAGE_HEIGHT*index;$(this).css({position:"relative",top:-posOffset,opacity:0});$(this).css({left:opts.PIC_OFFSTAGE,"z-index":0});}});};$.fn.panel.transition=function(panelNum){if((panelNum==currPanel)||(panelNum>=numPanels)){if(typeof opts.CALLBACK=="function"){opts.CALLBACK.call(this);}return;}prevPanel=currPanel;currPanel=panelNum;$(myThis[prevPanel]).animate({opacity:0},{queue:false,duration:opts.PANEL_ANIMATE_OUT,complete:function(){$(this).css({left:opts.PIC_OFFSTAGE,"z-index":0});}});$(myThis[currPanel]).css({left:opts.PIC_ONSTAGE});$(myThis[currPanel]).css({opacity:0}).stop().animate({opacity:1},{queue:false,duration:opts.PANEL_ANIMATE_IN,complete:function(){$(this).css({"z-index":100,filter:""});if(typeof opts.CALLBACK=="function"){opts.CALLBACK.call(this);}}});};})(jQuery);
