(function(b){if(!b){alert("The Promo Rotator requires jQuery.  Aborting rotation.");return}if(typeof b.fn.AnimateTrigger=="function"){return}var a={init:function(c){return this.each(function(){var h=b(this);if(!h.data("AnimateTrigger")){h.data("AnimateTrigger",{})}var f=h.data("AnimateTrigger");var g={hover_events:true,show_precall:false,show_callback:false,hide_precall:false,hide_callback:false,show_interrupt_precall:false,show_interrupt_callback:false,hide_interrupt_precall:false,hide_interrupt_callback:false,positionElement:false,xOffset:0,yOffset:0,animated_element:false,animate:false,animate_show:{opacity:"show",height:"show"},animate_show_speed:600,animate_show_easing:"linear",animate_hide:{opacity:"hide",height:"hide"},animate_hide_speed:600,animate_hide_easing:"linear",animate_hide_nodisplay:true,hideDelay:1,stopClick:true,IE6HideSelects:false};var e=b.extend({},g,c);if(e.animate_show_speed=="slow"){e.animate_show_speed=600}if(e.animate_show_speed=="normal"||e.animate_show_speed=="_default"){e.animate_show_speed=400}if(e.animate_show_speed=="fast"){e.animate_show_speed=200}if(e.animate_hide_speed=="slow"){e.animate_hide_speed=600}if(e.animate_hide_speed=="normal"||e.animate_hide_speed=="_default"){e.animate_hide_speed=400}if(e.animate_hide_speed=="fast"){e.animate_hide_speed=200}if(typeof e.animated_element=="object"){if(typeof(e.animated_element.fn)!="object"){e.animated_element=b(e.animated_element)}}else{e.animated_element=b(e.animated_element)}if(e.animated_element.length<1){b.error("Invalid animated_element during AnimateTrigger initialization")}if(!e.animated_element.data("AnimateTrigger_Animated")){e.animated_element.data("AnimateTrigger_Animated",{})}var i=e.animated_element.data("AnimateTrigger_Animated");if(!e.animated_element.data("AnimateTrigger")){e.animated_element.data("AnimateTrigger",{})}var d=e.animated_element.data("AnimateTrigger");i.originalDisplay=e.animated_element.css("display")=="none"?"":e.animated_element.css("display");if(e.animate){if(e.animate_hide_nodisplay){e.animated_element.css("display","none")}e.animated_element.animate(e.animate_hide,0);if(e.animate_hide.height||e.animate_hide.width){i.fully_shown_properties={}}if(e.animate_hide.height){i.fully_shown_properties.height=e.animated_element.height()}if(e.animate_hide.width){i.fully_shown_properties.width=e.animated_element.width()}}else{e.animated_element.hide()}f.animated_element=e.animated_element;f.stopClick=e.stopClick;f.show_precall=e.show_precall;f.show_callback=e.show_callback;f.hide_precall=e.hide_precall;f.hide_callback=e.hide_callback;f.show_interrupt_precall=e.show_interrupt_precall;f.show_interrupt_callback=e.show_interrupt_callback;f.hide_interrupt_precall=e.hide_interrupt_precall;f.hide_interrupt_callback=e.hide_interrupt_callback;d.is_animated_element=true;i.trigger_element=h;i.hide_animated_element_timeout=false;i.showing=false;i.positionElement=e.positionElement;i.xOffset=e.xOffset;i.yOffset=e.yOffset;i.animate=e.animate;i.animate_show=e.animate_show;i.animate_show_speed=e.animate_show_speed;i.animate_show_easing=e.animate_show_easing;i.animate_hide=e.animate_hide;i.animate_hide_speed=e.animate_hide_speed;i.animate_hide_easing=e.animate_hide_easing;i.animate_hide_nodisplay=e.animate_hide_nodisplay;i.hideDelay=e.hideDelay;i.IE6HideSelects=e.IE6HideSelects;if(e.hover_events){h.hover(function(){a.do_show.apply(b(this))},function(){a.do_mouseout.apply(b(this))});e.animated_element.hover(function(){a.do_show.apply(b(this))},function(){a.do_mouseout.apply(b(this))});h.unbind("click")}else{h.unbind("hover");e.animated_element.unbind("hover");h.click(function(){a.toggle_animated.apply(h);if(e.stopClick){return false}return true})}if(e.hover_events&&e.stopClick){h.click(function(){return false})}})},do_show:function(){return this.each(function(){var i=b(this),g=i.data("AnimateTrigger");if(g.is_animated_element){var g=i.data("AnimateTrigger_Animated"),e=g.trigger_element,d=e.data("AnimateTrigger");if(g.IE6HideSelects&&b.browser.msie&&/MSIE [4-6]/.test(navigator.appVersion)){b("select").css("visibility","hidden")}if(g.hide_animated_element_timeout){clearTimeout(g.hide_animated_element_timeout);g.hide_animated_element_timeout=false}if(!g.showing&&g.animate){g.showing=true;if(g.animate_hide_nodisplay){g.animated_element.css("display",g.originalDisplay)}if(i.is(":animated")&&g.fully_shown_properties){i.stop(true);var c=b.extend({},g.animate_show,g.fully_shown_properties),h=false,f;if(g.animate_show.height=="show"){h=1-(1*i.height())/(1*g.fully_shown_properties.height)}if(g.animate_show.width=="show"){if(!h){h=1-(1*i.width())/(1*g.fully_shown_properties.width)}}if(g.animate_show.opacity=="show"){if(!h){h=1-parseFloat(i.css("opacity"))}}f=Math.round(h?(g.animate_show_speed*h):g.animate_show_speed);if(typeof d.show_interrupt_precall=="function"){d.show_interrupt_precall.apply(e)}else{if(typeof d.show_precall=="function"){d.show_precall.apply(e)}}i.animate(c,f,g.animate_show_easing,function(){var m=b(this),l=m.data("AnimateTrigger_Animated"),k=l.trigger_element,j=k.data("AnimateTrigger");if(l.animate_show.height=="show"){m.css("height","")}if(l.animate_show.width=="show"){m.css("width","")}if(l.animate_show.opacity=="show"){m.css("opacity","")}if(typeof j.show_interrupt_callback=="function"){j.show_interrupt_callback.apply(k)}else{if(typeof j.show_callback=="function"){j.show_callback.apply(k)}}})}else{if(typeof d.show_precall=="function"){d.show_precall.apply(e)}i.animate(g.animate_show,g.animate_show_speed,g.animate_show_easing,function(){var m=b(this),l=m.data("AnimateTrigger_Animated"),k=l.trigger_element,j=k.data("AnimateTrigger");l.fully_shown_properties={};if(l.animate_show.height=="show"){l.fully_shown_properties.height=m.height()}if(l.animate_show.width=="show"){l.fully_shown_properties.width=m.width()}if(l.animate_show.opacity=="show"){l.fully_shown_properties.opacity=1}if(typeof j.show_callback=="function"){j.show_callback.apply(k)}})}}else{if(typeof d.show_precall=="function"){d.show_precall.apply(e)}i.show();g.showing=true;if(typeof d.show_callback=="function"){d.show_callback.apply(e)}}}if(g.animated_element){a.do_show.apply(g.animated_element)}})},do_hide:function(){return this.each(function(){var h=b(this),g=h.data("AnimateTrigger");if(g.is_animated_element){var g=h.data("AnimateTrigger_Animated"),f=g.trigger_element,d=f.data("AnimateTrigger");if(g.IE6HideSelects){if(b.browser.msie&&/MSIE [4-6]/.test(navigator.appVersion)){b("select").css("visibility","")}}g.showing=false;if(g.animate){if(h.is(":animated")){var c=false,e;if(g.animate_show.height=="show"&&g.fully_shown_properties){c=(1*h.height())/(1*g.fully_shown_properties.height)}if(g.animate_show.width=="show"&&g.fully_shown_properties){if(!c){c=(1*h.width())/(1*g.fully_shown_properties.width)}}if(g.animate_show.opacity=="show"){if(!c){c=parseFloat(h.css("opacity"))}}e=Math.round(c?(g.animate_hide_speed*c):g.animate_hide_speed);if(typeof d.hide_interrupt_precall=="function"){d.hide_interrupt_precall.apply(f)}else{if(typeof d.hide_precall=="function"){d.hide_precall.apply(f)}}h.stop();h.animate(g.animate_hide,e,g.animate_hide_easing,function(){var l=b(this),k=l.data("AnimateTrigger_Animated"),j=k.trigger_element,i=j.data("AnimateTrigger");if(k.animate_hide_nodisplay){l.css("display","none")}if(k.animate_show.height=="show"){l.css("height","")}if(k.animate_show.width=="show"){k.fully_shown_properties.width=l.css("width","")}if(k.animate_show.opacity=="show"){l.css("opacity","")}if(typeof i.hide_interrupt_callback=="function"){i.hide_interrupt_callback.apply(j)}})}else{if(typeof d.hide_precall=="function"){d.hide_precall.apply(f)}h.animate(g.animate_hide,g.animate_hide_speed,g.animate_hide_easing,function(){var l=b(this),k=l.data("AnimateTrigger_Animated"),j=k.trigger_element,i=j.data("AnimateTrigger");if(k.animate_hide_nodisplay){l.css("display","none")}if(typeof i.hide_callback=="function"){i.hide_callback.apply(j)}})}}else{if(typeof d.hide_precall=="function"){d.hide_precall.apply(f)}h.hide();g.showing=false;if(typeof d.hide_callback=="function"){d.hide_callback.apply(f)}}g.hide_animated_element_timeout=false}if(g.animated_element){a.do_hide.apply(g.animated_element)}})},do_mouseout:function(){return this.each(function(){var d=b(this),c=d.data("AnimateTrigger");if(c.is_animated_element){c=d.data("AnimateTrigger_Animated");c.hide_animated_element_timeout=setTimeout(function(){a.do_hide.apply(d)},c.hideDelay*1000)}if(c.animated_element){a.do_mouseout.apply(c.animated_element)}})},toggle_animated:function(){return this.each(function(){var d=b(this),c=d.data("AnimateTrigger");if(c.is_animated_element){c=d.data("AnimateTrigger_Animated");if(c.showing){a.do_hide.apply(d)}else{a.do_show.apply(d)}}if(c.animated_element){a.toggle_animated.apply(c.animated_element)}})}};b.fn.AnimateTrigger=function(c){if(a[c]){return a[c].apply(this,Array.prototype.slice.call(arguments,1))}else{if(typeof c==="object"||!c){return a.init.apply(this,arguments)}else{b.error("Method "+c+" does not exist on jQuery.AnimateTrigger")}}}})(jQuery);
