function nrgSlideshow(a,b){function w(a){if(!m){var b=document.createElement("li");b.appendChild(a);b.className="slide";h.appendChild(b);p.push(b);b.style.display="block";b.style.visibility="hidden";b.style.overflow="hidden";b.style.position="absolute"}}function v(){if(n!=null&&b.enableAutoTransition){clearInterval(n);n=null}}function u(){if(n==null&&b.enableAutoTransition){var a=true;n=setTimeout(jQuery.proxy(function(){t("next",e);n=setInterval(jQuery.proxy(function(){t("next",e)},this),b.autoTransitionDelay*1e3+b.autoTransitionLength)},this),b.autoTransitionDelay*1e3)}}function t(a,g){if(a=="next")a=q==p.length-1&&b.loopSlides?0:q+1;if(a=="previous")a=q==0&&b.loopSlides?p.length-1:q-1;if(a<p.length&&a>-1&&q!==a){if(g!=e&&n!=null){v();u()}var h=0;var j={};switch(g){case d:h=b.manualTransitionLength;break;case e:h=b.autoTransitionLength;break;case f:h=b.intermediateTransitionLenth;break;case c:default:h=0;break}if(o!=null&&g!=f){clearTimeout(o);o=null}if(!b.allowSimultaneousTransitions&&g!=f){for(i in p){if(jQuery(p[i]).queue("fx").length>0)return}}j.direction="right";var m=Math.abs(q-a);var r=p.length;if(b.enableIntermediateTransition&&b.loopSlides){var r=p.length-m;if(q>a){if(m<=r)j.direction="left";else j.direction="right"}else{if(m>r)j.direction="left";else j.direction="right"}}else{if(a<q)j.direction="left";else j.direction="right"}j.sequenceState=false;if(g==f){if(m>1&&r>1){j.sequenceState="intermediate"}else{j.sequenceState="end"}}else if(m>1&&r>1){j.sequenceState="start"}if(b.enableIntermediateTransition){var s=q;if(j.direction=="left")s--;else s++;if(s<0)s=p.length-1;if(s>=p.length)s=0;if(j.sequenceState=="start"){h=b.intermediateTransitionLenth}h=b.transitionEffect(p,q,s,h,j,b);jQuery("li",l).removeClass("selected");jQuery(jQuery("li",l)[s]).addClass("selected");q=s;if(q!=a){if(o!=null){clearTimeout(o);o=null}o=setTimeout(jQuery.proxy(function(){t(a,f)},this),h)}}else{b.transitionEffect(p,q,a,h,j,b);jQuery("li",l).removeClass("selected");jQuery(jQuery("li",l)[a]).addClass("selected");q=a}if(!b.loopSlides||p.length<2){jQuery(".leftbutton, .rightbutton",k).removeClass("disabled");if(q==0)jQuery(".leftbutton",k).addClass("disabled");if(q==p.length-1)jQuery(".rightbutton",k).addClass("disabled")}}}function s(){if(typeof HTMLElement==="object"?a instanceof HTMLElement:typeof a==="object"&&a.nodeType===1&&typeof a.nodeName==="string"){g=a}else{g=document.getElementById(a)}g.className="nrgslideshow";h=document.createElement("ul");h.className="slidelist";h.style.listStyleType="none";h.style.position="absolute";h.style.overflow="hidden";h.style.margin="0";h.style.padding="0";h.style.top="0";h.style.left="0";h.style.zIndex="0";h.style.width="100%";h.style.height="100%";jQuery(h).width();for(var c=g.firstChild;c;c=c.nextSibling){if(c.style!=null){w(c.cloneNode(true))}}var d=g.cloneNode(false);g.parentNode.replaceChild(d,g);g=d;g.style.position="relative";g.appendChild(h);var e=document.createElement("div");e.style.position="absolute";e.style.top="0";e.style.left="0";e.style.zIndex="1";e.style.width="100%";e.style.height="100%";g.appendChild(e);if(b.enableDirectionButtons){k=document.createElement("div");k.className="directionbuttons";e.appendChild(k)}if(b.enableIndexList){l=document.createElement("ol");l.className="indexlist";e.appendChild(l)}}var a=a!=null?a:false;var b={manualTransitionLength:b.manualTransitionLength!=null?b.manualTransitionLength:800,loopSlides:b.loopSlides!=null?b.loopSlides:true,centerSlides:b.centerSlides!=null?b.centerSlides:true,clickProgression:b.clickProgression!=null?b.clickProgression:true,allowSimultaneousTransitions:b.allowSimultaneousTransitions!=null?b.allowSimultaneousTransitions:false,allowSimultaneousTransitions:false,transitionEffect:b.transitionEffect!=null?b.transitionEffect:nrgSlideshow.TransitionEffects.slideshowFade,transitionEffectSettings:b.transitionEffectSettings!=null?b.transitionEffectSettings:{},enableIntermediateTransition:b.enableIntermediateTransition!=null?b.enableIntermediateTransition:false,intermediateTransitionLenth:b.intermediateTransitionLenth!=null?b.intermediateTransitionLenth:300,enableAutoTransition:b.enableAutoTransition!=null?b.enableAutoTransition:true,autoTransitionDelay:b.autoTransitionDelay!=null?b.autoTransitionDelay:5,autoTransitionLength:b.autoTransitionLength!=null?b.autoTransitionLength:1300,autoTransitionHoverStop:b.autoTransitionHoverStop!=null?b.autoTransitionHoverStop:true,autoTransitionEdgeBehaviour:b.autoTransitionEdgeBehaviour!=null?b.autoTransitionEdgeBehaviour:"restart",enableDirectionButtons:b.enableDirectionButtons!=null?b.enableDirectionButtons:false,directionButtonsOpacity:b.directionButtonsOpacity!=null?b.directionButtonsOpacity:.6,directionButtonsHoverOpacity:b.directionButtonsHoverOpacity!=null?b.directionButtonsHoverOpacity:.9,directionButtonsLeftContent:b.directionButtonsLeftContent!=null?b.directionButtonsLeftContent:"< Prev",directionButtonsRightContent:b.directionButtonsRightContent!=null?b.directionButtonsRightContent:"Next >",enableIndexList:b.enableIndexList!=null?b.enableIndexList:true,indexListOpacity:b.indexListOpacity!=null?b.indexListOpacity:.4,indexListHoverOpacity:b.indexListHoverOpacity!=null?b.indexListHoverOpacity:.8,indexListHoverActivate:b.indexListHoverActivate!=null?b.indexListHoverActivate:false,indexListContent:b.indexListContent!=null?b.indexListContent:""};var c=0;var d=1;var e=2;var f=3;var g=null;var h=null;var j=null;var k=null;var l=null;var m=false;var n=null;var o=null;var p=new Array;var q=-1;var r=false;jQuery(window).load(jQuery.proxy(function(){r=true},this));this.run=function(){if(!m){m=true;var a=b.indexListHoverActivate?"mouseover":"click";if(b.enableIndexList){for(i in p){var e=document.createElement("li");e.appendChild(document.createTextNode(b.indexListContent));jQuery(e).bind(a,{index:i},function(a){t(parseInt(a.data.index),d)});l.appendChild(e)}}if(b.enableDirectionButtons){var f=document.createElement("div");f.className="leftbutton";f.appendChild(document.createTextNode(b.directionButtonsLeftContent));jQuery(f).bind("click",function(a){t("previous",d)});k.appendChild(f);var h=document.createElement("div");h.className="rightbutton";h.appendChild(document.createTextNode(b.directionButtonsRightContent));jQuery(h).bind("click",function(a){t("next",d)});k.appendChild(h)}jQuery(g).bind("mouseenter",function(){if(b.enableIndexList){jQuery(l).stop(true).fadeTo(500,b.indexListHoverOpacity)}if(b.enableDirectionButtons){jQuery(k).children().stop(true).fadeTo(500,b.directionButtonsHoverOpacity)}if(b.autoTransitionHoverStop){v()}}).bind("mouseleave",function(){if(b.enableIndexList){jQuery(l).stop(true).fadeTo(500,b.indexListOpacity)}if(b.enableDirectionButtons){jQuery(k).children().stop(true).fadeTo(500,b.directionButtonsOpacity)}if(b.autoTransitionHoverStop){u()}}).mouseleave();if(r){t(0,c);if(b.enableAutoTransition){u()}}else{jQuery(window).load(jQuery.proxy(function(){t(0,c);if(b.enableAutoTransition){u()}},this))}}};s()}nrgSlideshow.TransitionEffects=function(){};nrgSlideshow.TransitionEffects.instant=function(a,b,c,d,e,f){var g=b>-1?jQuery(a[b]):null;var h=jQuery(a[c]);var i=h.parent().innerWidth();var j=f.centerSlides?(i-h.width())/2+"px":"0";if(b<0){f.enableIntermediateTransition=false}h.css({visibility:"visible"});if(f.centerSlides){h.css({left:j})}if(g!=null){g.css({visibility:"hidden"})}return 0};nrgSlideshow.TransitionEffects.slideshowFade=function(a,b,c,d,e,f){var g=b>-1?jQuery(a[b]):null;var h=jQuery(a[c]);var j=h.parent().innerWidth();var k=f.centerSlides?(j-jQuery(a[c]).width())/2+"px":"0";var l="swing";switch(e.sequenceState){case"start":l="easeInSine";break;case"intermediate":l="linear";break;case"end":l="easeOutSine";break;case false:default:l="swing";break}if(b<0){for(i in a){iJq=jQuery(a[i]);if(f.centerSlides){iJq.css({left:k})}iJq.css({visibility:"visible"},l).hide()}h.fadeIn(d,l)}else{g.fadeOut(d,l);h.fadeIn(d,l)}return d};nrgSlideshow.TransitionEffects.slideshowSlide=function(a,b,c,d,e,f){var g=b>-1?jQuery(a[b]):null;var h=jQuery(a[c]);var j=h.parent().innerWidth();var k="swing";switch(e.sequenceState){case"start":k="easeInSine";d*=1.5;break;case"intermediate":k="linear";break;case"end":k="easeOutSine";d*=1.5;break;case false:default:k="swing";break}if(b<0){for(i in a){iJq=jQuery(a[i]);iJq.css({visibility:"visible"}).data("base",{left:f.centerSlides?(j-iJq.children().width())/2+"px":"0"}).hide()}h.show().animate({left:h.data("base").left},d)}else{if(e.direction=="left"){g.animate({left:j+"px"},d,k,function(){jQuery(this).hide()});h.show().css({left:"-"+j+"px"}).animate({left:h.data("base").left},d,k)}else{g.animate({left:"-"+j+"px"},d,k,function(){jQuery(this).hide()});h.show().css({left:j+"px"}).animate({left:h.data("base").left},d,k)}}return d};nrgSlideshow.TransitionEffects.showcase=function(a,b,c,d,e,f){var g=b>-1?jQuery(a[b]):null;var h=jQuery(a[c]);var j=f.transitionEffectSettings.numSideloadedSlides!=null?f.transitionEffectSettings.numSideloadedSlides:1;var k=h.parent().innerWidth();var l=h.parent().innerHeight();var m=j*2+1;var n=f.loopSlides&&m<a.length;var o=parseInt(k/m);var p=.5;var q=.2;var r="swing";switch(e.sequenceState){case"start":r="easeInSine";d*=2;break;case"intermediate":r="linear";break;case"end":r="easeOutSine";d*=2;break;case false:default:r="swing";break}if(b<0){f.enableIntermediateTransition=true;for(i in a){iJq=jQuery(a[i]);iJq.css({visibility:"visible"}).data("base",{width:iJq.children().width(),height:iJq.children().height()}).hide();iJq.children().css({width:"100%",height:"100%"})}if(c-1>=0||n){thisJq=c-1>=0?jQuery(a[c-1]):jQuery(a[a.length+c-1]);thisJq.show().css({top:"-"+l+"px",left:(k-thisJq.data("base").width*(p-q))/2-o+"px",width:thisJq.data("base").width*(p-q)+"px",height:thisJq.data("base").height*(p-q)+"px","z-index":"0",opacity:.7}).animate({top:(l-thisJq.data("base").height*(p-q))/2+"px","z-index":"-1"},d,r)}thisJq=h;thisJq.show().css({top:"-"+l+"px",left:(k-thisJq.data("base").width*p)/2+"px",width:thisJq.data("base").width*p+"px",height:thisJq.data("base").height*p+"px",opacity:1}).animate({top:(l-thisJq.data("base").height*p)/2+"px","z-index":"0"},d,r);if(c+1<a.length||n){thisJq=c+1<a.length?jQuery(a[c+1]):jQuery(a[0]);thisJq.show().css({top:"-"+l+"px",left:(k-thisJq.data("base").width*(p-q))/2+o+"px",width:thisJq.data("base").width*(p-q)+"px",height:thisJq.data("base").height*(p-q)+"px","z-index":"0",opacity:.7}).animate({top:(l-thisJq.data("base").height*(p-q))/2+"px","z-index":"-1"},d,r)}}else{if(e.direction=="left"){if(c-1>=0||n){thisJq=c-1>=0?jQuery(a[c-1]):jQuery(a[a.length+(c-1)]);thisJq.show().css({top:(l-thisJq.data("base").height*(p-q*1.5))/2+"px",left:(k-thisJq.data("base").width*(p-q*1.5))/2-o*1.5+"px",width:thisJq.data("base").width*(p-q*1.5)+"px",height:thisJq.data("base").height*(p-q*1.5)+"px","z-index":"-2",opacity:0}).animate({top:(l-thisJq.data("base").height*(p-q))/2+"px",left:(k-thisJq.data("base").width*(p-q))/2-o+"px",width:thisJq.data("base").width*(p-q)+"px",height:thisJq.data("base").height*(p-q)+"px","z-index":"-1",opacity:.7},{step:function(a,b){if(b.pos>=.4&&b.elem.style.zIndex!=-1){b.elem.style.zIndex="-1"}},duration:d,easing:r})}thisJq=h;thisJq.css({}).animate({top:(l-thisJq.data("base").height*p)/2+"px",left:(k-thisJq.data("base").width*p)/2+"px",width:thisJq.data("base").width*p+"px",height:thisJq.data("base").height*p+"px",opacity:1},{step:function(a,b){if(b.pos>=.4&&b.elem.style.zIndex!=0){b.elem.style.zIndex="0"}},duration:d,easing:r});if(c+1<a.length||n){thisJq=c+1<a.length?jQuery(a[c+1]):jQuery(a[c+1-a.length]);thisJq.css({}).animate({top:(l-thisJq.data("base").height*(p-q))/2+"px",left:(k-thisJq.data("base").width*(p-q))/2+o+"px",width:thisJq.data("base").width*(p-q)+"px",height:thisJq.data("base").height*(p-q)+"px",opacity:.7},{step:function(a,b){if(b.pos>=.4&&b.elem.style.zIndex!=-1){b.elem.style.zIndex="-1"}},duration:d,easing:r})}if(c+2<a.length||n){thisJq=c+2<a.length?jQuery(a[c+2]):jQuery(a[c+2-a.length]);thisJq.css({}).animate({top:(l-thisJq.data("base").height*(p-q*1.5))/2+"px",left:(k-thisJq.data("base").width*(p-q*1.5))/2+o*1.5+"px",width:thisJq.data("base").width*(p-q*1.5)+"px",height:thisJq.data("base").height*(p-q*1.5)+"px",opacity:0},{step:function(a,b){if(b.pos>=.4&&b.elem.style.zIndex!=-2){b.elem.style.zIndex="-2"}},duration:d,easing:r})}}else{if(c-2>=0||n){thisJq=c-2>=0?jQuery(a[c-2]):jQuery(a[a.length+(c-2)]);thisJq.css({}).animate({top:(l-thisJq.data("base").height*(p-q*1.5))/2+"px",left:(k-thisJq.data("base").width*(p-q*1.5))/2-o*1.5+"px",width:thisJq.data("base").width*(p-q*1.5)+"px",height:thisJq.data("base").height*(p-q*1.5)+"px",opacity:0},{step:function(a,b){if(b.pos>=.4&&b.elem.style.zIndex!=-2){b.elem.style.zIndex="-2"}},duration:d,easing:r})}if(c-1>=0||n){thisJq=c-1>=0?jQuery(a[c-1]):jQuery(a[a.length+(c-1)]);thisJq.css({}).animate({top:(l-thisJq.data("base").height*(p-q))/2+"px",left:(k-thisJq.data("base").width*(p-q))/2-o+"px",width:thisJq.data("base").width*(p-q)+"px",height:thisJq.data("base").height*(p-q)+"px",opacity:.7},{step:function(a,b){if(b.pos>=.4&&b.elem.style.zIndex!=-1){b.elem.style.zIndex="-1"}},duration:d,easing:r})}thisJq=h;thisJq.css({}).animate({top:(l-thisJq.data("base").height*p)/2+"px",left:(k-thisJq.data("base").width*p)/2+"px",width:thisJq.data("base").width*p+"px",height:thisJq.data("base").height*p+"px",opacity:1},{step:function(a,b){if(b.pos>=.4&&b.elem.style.zIndex!=0){b.elem.style.zIndex="0"}},duration:d,easing:r});if(c+1<a.length||n){thisJq=c+1<a.length?jQuery(a[c+1]):jQuery(a[c+1-a.length]);thisJq.show().css({top:(l-thisJq.data("base").height*(p-q*1.5))/2+"px",left:(k-thisJq.data("base").width*(p-q*1.5))/2+o*1.5+"px",width:thisJq.data("base").width*(p-q*1.5)+"px",height:thisJq.data("base").height*(p-q*1.5)+"px","z-index":"-2",opacity:0}).animate({top:(l-thisJq.data("base").height*(p-q))/2+"px",left:(k-thisJq.data("base").width*(p-q))/2+o+"px",width:thisJq.data("base").width*(p-q)+"px",height:thisJq.data("base").height*(p-q)+"px",opacity:.7},{step:function(a,b){if(b.pos>=.4&&b.elem.style.zIndex!=-1){b.elem.style.zIndex="-1"}},duration:d,easing:r})}}}return d}
