/*  
 *  Slider Kit v1.8 (packed) - Sliding contents with jQuery
 *  http://www.kyrielles.net/sliderkit
 *  
 *  Copyright (c) 2010-2011 Alan Frog
 *  Licensed under the GNU General Public License
 *  See <license.txt> or <http://www.gnu.org/licenses/>
 *  
 *  Requires : jQuery v1.3+ <http://jquery.com/>
 * 
 */
eval(function(p,a,c,k,e,r){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--)r[e(c)]=k[c]||e(c);k=[function(e){return r[e]}];e=function(){return'\\w+'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}('(7($){2m=7(){o n=3;3.2n=7(c,d){3.4=$.3n({},3.2o,d);3.8={1b:3.4.t+"-1b",1c:3.4.t+"-1c",y:3.4.t+"-y",B:3.4.t+"-1c-3o",N:3.4.t+"-1c-3p",13:3.4.t+"-y-3q",v:3.4.t+"-v",J:3.4.t+"-v-3r",2p:3.4.t+"-v-1d",14:3.4.t+"-v-2q",15:3.4.t+"-v-2r",F:3.4.t+"-1d-3s",1e:3.4.t+"-3t-1d",2s:3.4.t+"-1O-2q",2t:3.4.t+"-1O-2r",G:3.4.t+"-3u-1d",O:3.4.t+"-1O-1d"};3.q=$(c);3.y=$("."+3.8.1c,3.q);3.u=3.y.K();3.v=$("."+3.8.v,3.q);3.J=$("."+3.8.J,3.v);3.H=3.u>0?1:0;3.1x=3.J.K()>0?1:0;3.1P=3.q.P();3.2u=3.q.Q();6(!3.H&&!3.1x){3.R("1Q #3v",3.4.S,1)}x 6(3.1P=="16"&&!3.4.1y){3.R("1Q #3w",3.4.S,1)}3.q.z("2v","3x");3.p=0;3.1f=0;3.1g=0;3.L=r;3.1R=0;3.1h=1;3.1z=0;3.T=r;3.3y=9;3.3z=1;3.2w=9;3.2x=1i 1A;3.2y=1i 1A;3.2z=1i 1A;3.2A=1i 1A;6(3.1x){3.2B()}3.2C();6(3.H){3.1S=$("."+3.8.y,3.q);6(3.4.1B=="1C"){3.2D()}}3.1D=!3.H?1:0;6(3.4.1T){3.q.1T(7(a,b){b>0?n.1E():n.1j();w 9})}6(3.4.2E){3.q.3A(7(a){6(a.2F==37){n.1E()}x 6(a.2F==39){n.1j()}})}6(3.4.2G&&3.H){3.1S.U(7(){n.1j();w 9})}3.2H=3.4.1F>=3.u?3.u-1:3.4.1F<0?0:3.4.1F;6(3.4.2I){1U{3.3B()}1V(17){3.R(17,3.4.S,0)}}6(3.4.1W){1U{3.3C(3.4.1W)}1V(17){3.R(17,3.4.S,0)}}3.1G(3.2H,r);6(3.4.16){3.1k();3.2J()}6(3.4.1X){1U{3.3D(3.4.1X)}1V(17){3.R(17,3.4.S,0)}}w 3};3.2o={t:"1Y",1F:0,16:s,2K:3E,1H:9,1T:9,2E:9,1l:9,V:5,2L:9,2M:9,2N:9,1Z:9,2O:s,2P:"1C",20:7(){},21:7(){},I:r,2Q:3F,2R:r,1B:"22",1I:3G,23:r,2S:"1m",24:7(){},25:7(){},2T:9,2G:9,C:9,2U:9,2V:9,1y:9,2W:s,2I:9,1W:9,1X:9,S:9};3.R=7(a,b,c){6(b){3H("3I 3J 3K!\\3L = "+a+" (3M 3N 3O 3P)\\2X 2Y = "+3.q.2Z("2Y")+"\\2X 26 = "+3.q.2Z("26"))}6(c){w 9}};3.2J=7(){6(!3.1J&&!3.4.1H){3.q.30(7(){6(n.T!=r){n.1n()}},7(){n.1k()})}6(3.4.1H){3.q.3Q(7(){6(n.T==r){n.1k()}})}};3.2B=7(){3.M=$("3R",3.J);3.D=$("27",3.M);3.1K=3.D.K();6(3.H&&(3.1K!=3.u)&&3.v.K()==1){3.R("1Q #3S",3.4.S,1)}6(3.4.2V){3.4.V=3.u}x{7 1o(a){28=n.D.z(a);6(28!="16"&&a!=""&&a!="3T"){w 31(28)}x w 0}o c=3.4.C?3.v.P():3.v.Q();o d=3.D.3U(s);o e=3.D.3V(s);o f=1o("1p-W")+1o("1p-3W");o g=1o("1p-X")+1o("1p-3X");3.Y=3.4.C?e:d;3.29=3.Y*3.1K;3.1q=(3.4.V*3.Y)-(3.4.C?g:f);3.1L=3.4.C?"X":"W";o h=3.4.C?"P":"Q";o i=3.4.C?"Q":"P";3.D.z({Q:3.D.Q(),P:3.D.P()});3.M.z(h,3.29+"2a");3.J.z({Q:3.4.C?d:3.1q,P:3.4.C?3.1q:e});6(3.4.2M){3.J.z(3.1L,(c-3.1q)/2).z("1p","0")}3.u=3.1K;6(3.u>3.4.V){3.1z=s;6(3.4.I==r||3.4.I<0||3.4.I>3.u){3.4.I=3.4.V}3.1M=$("."+3.8.2p,3.v);6(3.1M.K()>0){3.32()}}}6(3.4.2L&&3.H){3.D.2b(7(){n.1G(2c(3,"27"),$(3))})}x 6(3.H||3.4.1Z){3.D.U(7(){n.1G(2c(3,"27"),$(3));w 9})}7 2c(a,b){w $(b,$(a).2d()).3Y(a)}};3.32=7(){3.33=s;3.18=$("."+3.8.14,3.v);3.1r=$("."+3.8.15,3.v);3.18.U(7(){n.14();w 9});3.1r.U(7(){n.15();w 9});6(3.4.2N){3.18.2b(7(){n.14(s)});3.1r.2b(7(){n.15(s)});3.1M.3Z(7(){n.34()})}6(!3.4.1l){3.18.40(3.8.F)}};3.2e=7(){3.19=3.4.C?3.M.2f().X:3.M.2f().W;3.Z=10.41(10.1s(3.19)/3.Y);3.11=10.42((3.29-10.1s(3.19)-3.1q)/3.Y);6(3.11<0){3.11=0}};3.2C=7(){3.G=$("."+3.8.G,3.q);3.1a=$("."+3.8.O,3.q);3.1J=3.G.K()>0?1:0;3.O=3.1a.K()>0?1:0;6(3.1J){6(3.4.16){3.G.A(3.8.1e)}3.G.U(7(){6(n.G.1N(n.8.1e)){n.2g()}x{n.35()}w 9})}6(3.O){3.2h=$("."+3.8.2s,3.q);3.2i=$("."+3.8.2t,3.q);6(3.4.2T){3.1a.1t();$("."+3.8.y,3.q).30(7(){n.1a.36()},7(){n.1a.43()})}3.2h.U(7(){n.1E($(3));w 9});3.2i.U(7(){n.1j($(3));w 9})}};3.2D=7(){3.y.44(\'<38 26="\'+3.8.13+\'"></38>\');3.13=$("."+3.8.13,3.1S);3.13.z({"2f":"45"})};3.12=7(a,b,c,d,e){6(e&&3.T!=r){6(3.1J){3.2g()}6(3.4.1H){n.1n()}}6(a){6(a.1N(3.8.F)){w 9}}o f=0;o g=$(":46",3.4.2W?3.v:3.q).K()>0?1:0;6(!g&&!3.2w){3.1f=3.p;6(c==r&&!d){3.p=b=="-="?3.p+1:3.p-1}x 6(c!=r){c=31(c);3.p=c<0?0:c>3.u-1?3.u-1:c;o h=a?a.2d().2d().1N(3.8.J)?9:s:s}6(3.O){3.1a.E(3.8.F)}6(!3.4.1l){6(3.p==-1){3.p=0;f=1}6(3.p==0&&3.O){3.2h.A(3.8.F)}6(3.p==3.u){3.p=3.u-1;f=1}6(3.p==3.u-1){6(3.4.16){3.1n()}6(3.O){3.2i.A(3.8.F)}}}x 6(!3.1z){6(3.p==3.u){3.p=0}6(3.p==-1){3.p=3.u-1}}6(3.1z&&!f){3.3a(d,b,h)}6(3.1x){3.3b(3.p)}6(!(d&&!3.4.2O)){6(3.H){3.3c(3.p,b)}}6(3.1h){3.1h=0}}};3.3a=7(a,b,c){3.2e();o d=a?s:9;o e=0;6(!a){o f=10.1s(3.p+1-3.Z);o g=3.4.V-f+1;o h=3.p==0||3.p==3.u-1?1:0;6((3.4.1Z&&(g==1||f==1))&&!3.1h&&!h){e=3.4.I-1;d=s}6(g==0||f==0){d=s}6(c){o i=10.1s(3.1f-3.p);6(i>0){e=i;d=s}}6(b==""){6(3.1f==3.p&&!h){b=3.3d=="-="?"+=":"-="}x{b=3.1f<3.p?"-=":"+="}}3.3d=b}6(d){o j=e>0?e:3.4.I;o k=b=="-="?3.11:3.Z;o l=k<j?k:j;o m=l*3.Y;3.1g=b=="-="?3.Z+l:3.Z-l+3.4.V-1;6((b=="-="&&3.1g>3.p)||(b=="+="&&3.1g<3.p)){3.p=3.1g}6(3.4.1l){6(3.Z<=0&&b=="+="){b="-=";3.p=3.u-1;m=(3.11/3.4.I)*(3.Y*3.4.I)}x 6(3.11==0&&b=="-="){b="+=";3.p=0;m=10.1s(3.19)}}3.3e(b,m)}};3.3c=7(a,b){3.L=3.y.3f(a);o c=7(){6($.1u(n.4.25)){n.4.25()}n.1v(n.2y)};6(!3.L.1N(3.8.B)){6(3.1h){3.2j=3.4.2S;o d=1}x{o e=3.4.1y&&3.4.1B=="22"?"3g":"1m";3.2j=3.4.1y?e:3.4.1B}6($.1u(n.4.24)){n.4.24()}3.1v(3.2x);3.3h[3.2j](b,d,c)}};3.3e=7(a,b){o c=7(){6(!n.4.1l&&n.33){n.1M.E(n.8.F);n.2e();6(n.Z<=0){n.18.A(n.8.F)}x 6(n.11<=0){n.1r.A(n.8.F)}}6(n.1w){47(7(){n.1w=="-="?n.14():n.15()},0)}x 6($.1u(n.4.21)){n.4.21()}n.1v(n.2A)};6($.1u(n.4.20)){n.4.20()}n.1v(n.2z);3.3i[3.4.2P](a,b,c)};3.1v=7(c){$.3j(c,7(a,b){6($.1u(b)){b()}})};3.48=7(a){a.49=0};3.3h={1m:7(a,b,c){n.y.E(n.8.B).1t();n.L.A(n.8.B).2k();c()},1C:7(a,b,c){6(a==""){a=n.1R<n.p?"-=":"+="}n.1R=n.p;o d=a=="-="?"+":"-";o e=n.4.2U?"X":"W";o f=n.4.C?n.1P:n.2u;o g=e=="X"?{X:a+f}:{W:a+f};n.3k=$("."+n.8.N,n.q);n.3l=$("."+n.8.B,n.q);n.y.z(e,"0");n.3k.E(n.8.N).1t();n.3l.E(n.8.B).A(n.8.N);n.L.A(n.8.B).z(e,d+f+"2a").2k();n.13.3m(s,s).z(e,"0").2l(g,n.4.1I,n.4.23,7(){c()})},22:7(a,b,c){6(b){n.y.1t()}x{n.L.z("2v","1m")}$("."+n.8.N,n.q).E(n.8.N);$("."+n.8.B,n.q).3m(s,s).E(n.8.B).A(n.8.N);n.L.A(n.8.B).2l({"4a":"2k"},n.4.1I,n.4.23,7(){c()})},3g:7(a,b,c){n.y.E(n.8.B).1t();n.L.36(n.4.1I,7(){c()})}};3.3i={1m:7(a,b,c){o d=a=="-="?n.19-b:n.19+b;n.M.z(n.1L,d+"2a");c()},1C:7(a,b,c){n.M.2l(n.1L=="W"?{W:a+b}:{X:a+b},n.4.2Q,n.4.2R,7(){c()})}};3.2g=7(){3.G.E(3.8.1e);3.1n()};3.35=7(){3.G.A(n.8.1e);3.1k()};3.1k=7(){o a=3;3.T=4b(7(){a.12(r,"-=",r,a.1D,r)},a.4.2K)};3.1n=7(){4c(3.T);3.T=r};3.1G=7(a,b){3.12(b,"",a,0,1)};3.1E=7(a){3.12(a,"+=",r,n.1D,1)};3.1j=7(a){3.12(a,"-=",r,n.1D,1)};3.14=7(c){6(c){n.1w="-="}3.12(3.18,"+=",r,1,1)};3.15=7(c){6(c){n.1w="+="}3.12(3.1r,"-=",r,1,1)};3.34=7(){n.1w=""};3.3b=7(a){$("."+3.8.1b,3.M).E(3.8.1b);3.D.3f(a).A(3.8.1b)}};$.4d.1Y=7(a){w 3.3j(7(){$(3).4e("1Y",1i 2m().2n(3,a))})}})(4f);',62,264,'|||this|options||if|function|cssNames|false|||||||||||||||var|currId|domObj|null|true|cssprefix|allItems|nav|return|else|panels|css|addClass|panelActive|verticalnav|navLI|removeClass|btnDisable|playBtn|arePanels|scroll|navClip|size|currPanel|navUL|panelOld|goBtns|height|width|_errorReport|debug|isPlaying|click|shownavitems|left|top|navLIsize|LIbefore|Math|LIafter|_change|panelsWrapper|navPrev|navNext|auto|err|navBtnPrev|navPos|gBtns|selected|panel|btn|btnPause|prevId|newId|firstTime|new|stepForward|autoScrollStart|circular|none|autoScrollStop|getLImargin|margin|navClipSize|navBtnNext|abs|hide|isFunction|_runCallBacks|scrollcontinue|isNavClip|freeheight|scrollActive|Array|panelfx|sliding|lineScrollDo|stepBackward|start|changeWithId|autostill|panelfxspeed|isPlayBtn|navLINum|cssPosAttr|navBtns|hasClass|go|domObjHeight|Error|prevPanel|panelsBag|mousewheel|try|catch|delaycaptions|timer|sliderkit|navscrollatend|navfxbefore|navfxafter|fading|panelfxeasing|panelfxbefore|panelfxafter|class|li|attrVal|navULSize|px|mouseover|getIndex|parent|_getNavPos|position|playBtnPause|goBtnPrev|goBtnNext|panelTransition|show|animate|SliderKit|_init|_settings|navBtn|prev|next|goPrev|goNext|domObjWidth|display|animating|panelAnteFns|panelPostFns|navAnteFns|navPostFns|_buildNav|_buildControls|_wrapPanels|keyboard|keyCode|panelclick|startId|counter|_autoScrollHoverStop|autospeed|navitemshover|navclipcenter|navcontinuous|navpanelautoswitch|navfx|scrollspeed|scrolleasing|panelfxfirst|panelbtnshover|verticalslide|tabs|fastchange|nElement|id|attr|hover|parseInt|_buildNavButtons|scrollBtns|navStopContinuous|playBtnStart|fadeIn||div||_setNavScroll|selectThumbnail|_animPanel|scrollWay|_animNav|eq|tabsfading|_panelTransitions|_navTransitions|each|oldPanel|activePanel|stop|extend|active|old|wrapper|clip|disable|pause|play|01|02|block|changeOngoing|currLine|keyup|Counter|DelayCaptions|Timer|4000|600|700|alert|Slider|Kit|error|nMessage|see|doc|for|details|mouseleave|ul|03|0px|outerWidth|outerHeight|right|bottom|index|mouseout|toggleClass|ceil|floor|fadeOut|wrapAll|relative|animated|setTimeout|_clearCallBacks|length|opacity|setInterval|clearTimeout|fn|data|jQuery'.split('|'),0,{}))

// **** remove Opacity-Filter in ie ****
function removeFilter(element) {
  if(element.style.removeAttribute){
    element.style.removeAttribute('filter');
  }
}
 /*
 *   easyAccordion 0.1 - jQuery plugin
 *  written by Andrea Cima Serniotti  
 *  http://www.madeincima.eu
 *
 *  Copyright (c) 2010 Andrea Cima Serniotti (http://www.madeincima.eu)
 *  Dual licensed under the MIT (MIT-LICENSE.txt) and GPL (GPL-LICENSE.txt) licenses.
 *  Built for jQuery library http://jquery.com
 */
 
(function(jQuery) {
  jQuery.fn.easyAccordion = function(options) {
  
  var defaults = {      
    slideNum: true,
    autoStart: false,
    slideInterval: 3000
  };
      
  this.each(function() {
    
    var settings = jQuery.extend(defaults, options);    
    jQuery(this).find('dl').addClass('easy-accordion');
    
    
    // -------- Set the variables ------------------------------------------------------------------------------
    
    jQuery.fn.setVariables = function() {
      dlWidth = jQuery(this).width();
      dlHeight = jQuery(this).height();
      dtWidth = jQuery(this).find('dt').outerHeight();
      if (jQuery.browser.msie){ dtWidth = $(this).find('dt').outerWidth();}
      dtHeight = dlHeight - (jQuery(this).find('dt').outerWidth()-jQuery(this).find('dt').width());
      slideTotal = jQuery(this).find('dt').size();
      ddWidth = dlWidth - (dtWidth*slideTotal) - (jQuery(this).find('dd').outerWidth(true)-jQuery(this).find('dd').width());
      ddHeight = dlHeight - (jQuery(this).find('dd').outerHeight(true)-jQuery(this).find('dd').height());
    };
    jQuery(this).setVariables();
  
    
    // -------- Fix some weird cross-browser issues due to the CSS rotation -------------------------------------

    if (jQuery.browser.safari){ var dtTop = (dlHeight-dtWidth)/2; var dtOffset = -dtTop;  /* Safari and Chrome */ }
    if (jQuery.browser.mozilla){ var dtTop = dlHeight - 20; var dtOffset = - 20; /* FF */ }
    if (jQuery.browser.msie){ var dtTop = 0; var dtOffset = 0; /* IE */ }
    
    
    // -------- Getting things ready ------------------------------------------------------------------------------
    
    var f = 1;
    jQuery(this).find('dt').each(function(){
      jQuery(this).css({'width':dtHeight,'top':dtTop,'margin-left':dtOffset});  
      if(settings.slideNum == true){
        jQuery('<span class="slide-number">'+0+f+'</span>').appendTo(this);
        if(jQuery.browser.msie){  
          var slideNumLeft = parseInt(jQuery(this).find('.slide-number').css('left')) - 14;
          jQuery(this).find('.slide-number').css({'left': slideNumLeft})
          if(jQuery.browser.version == 6.0 || jQuery.browser.version == 7.0){
            jQuery(this).find('.slide-number').css({'bottom':'auto'});
          }
          if(jQuery.browser.version == 8.0){
          var slideNumTop = jQuery(this).find('.slide-number').css('bottom');
          var slideNumTopVal = parseInt(slideNumTop) + parseInt(jQuery(this).css('padding-top'))  - 12; 
          jQuery(this).find('.slide-number').css({'bottom': slideNumTopVal}); 
          }
        } else {
          var slideNumTop = jQuery(this).find('.slide-number').css('bottom');
          var slideNumTopVal = parseInt(slideNumTop) + parseInt(jQuery(this).css('padding-top')); 
          jQuery(this).find('.slide-number').css({'bottom': slideNumTopVal}); 
        }
      }
      f = f + 1;
    });
    
    if(jQuery(this).find('.active').size()) { 
      jQuery(this).find('.active').next('dd').addClass('active');
    } else {
      jQuery(this).find('dt:first').addClass('active').next('dd').addClass('active');
    }
    
    jQuery(this).find('dt:first').css({'left':'0'}).next().css({'left':dtWidth});
    jQuery(this).find('dd').css({'width':ddWidth,'height':ddHeight});  

    
    // -------- Functions ------------------------------------------------------------------------------
    
    jQuery.fn.findActiveSlide = function() {
        var i = 1;
        this.find('dt').each(function(){
        if(jQuery(this).hasClass('active')){
          activeID = i; // Active slide
        } else if (jQuery(this).hasClass('no-more-active')){
          noMoreActiveID = i; // No more active slide
        }
        i = i + 1;
      });
    };
      
    jQuery.fn.calculateSlidePos = function() {
      var u = 2;
      jQuery(this).find('dt').not(':first').each(function(){  
        var activeDtPos = dtWidth*activeID;
        if(u <= activeID){
          var leftDtPos = dtWidth*(u-1);
          jQuery(this).animate({'left': leftDtPos});
          if(u < activeID){ // If the item sits to the left of the active element
            jQuery(this).next().css({'left':leftDtPos+dtWidth});  
          } else{ // If the item is the active one
            jQuery(this).next().animate({'left':activeDtPos});
          }
        } else {
          var rightDtPos = dlWidth-(dtWidth*(slideTotal-u+1));
          jQuery(this).animate({'left': rightDtPos});
          var rightDdPos = rightDtPos+dtWidth;
          jQuery(this).next().animate({'left':rightDdPos});  
        }
        u = u+ 1;
      });
      setTimeout( function() {
        jQuery('.easy-accordion').find('dd').not('.active').each(function(){ 
          jQuery(this).css({'display':'none'});
        });
      }, 400);
      
    };
  
    jQuery.fn.activateSlide = function() {
      this.parent('dl').setVariables();  
      this.parent('dl').find('dd').css({'display':'block'});
      this.parent('dl').find('dd.plus').removeClass('plus');
      this.parent('dl').find('.no-more-active').removeClass('no-more-active');
      this.parent('dl').find('.active').removeClass('active').addClass('no-more-active');
      this.addClass('active').next().addClass('active');  
      this.parent('dl').findActiveSlide();
      if(activeID < noMoreActiveID){
        this.parent('dl').find('dd.no-more-active').addClass('plus');
      }
      this.parent('dl').calculateSlidePos();  
    };
  
    jQuery.fn.rotateSlides = function(slideInterval, timerInstance) {
      var accordianInstance = jQuery(this);
      timerInstance.value = setTimeout(function(){accordianInstance.rotateSlides(slideInterval, timerInstance);}, slideInterval);
      jQuery(this).findActiveSlide();
      var totalSlides = jQuery(this).find('dt').size();
      var activeSlide = activeID;
      var newSlide = activeSlide + 1;
      if (newSlide > totalSlides) newSlide = 1;
      jQuery(this).find('dt:eq(' + (newSlide-1) + ')').activateSlide(); // activate the new slide
    }


    // -------- Let's do it! ------------------------------------------------------------------------------
    
    function trackerObject() {this.value = null}
    var timerInstance = new trackerObject();
    
    jQuery(this).findActiveSlide();
    jQuery(this).calculateSlidePos();
    
    if (settings.autoStart == true){
      var accordianInstance = jQuery(this);
      var interval = parseInt(settings.slideInterval);
      timerInstance.value = setTimeout(function(){
        accordianInstance.rotateSlides(interval, timerInstance);
        }, interval);
    } 

    jQuery(this).find('dt').not('active').click(function(){    
      jQuery(this).activateSlide();
      clearTimeout(timerInstance.value);
    });  
        
    if (!(jQuery.browser.msie && jQuery.browser.version == 6.0)){ 
      jQuery('dt').hover(function(){
        jQuery(this).addClass('hover');
      }, function(){
        jQuery(this).removeClass('hover');
      });
    }
  });
  };
})(jQuery);
 
/**
 * jQuery Galleriffic plugin
 *
 * Copyright (c) 2008 Trent Foley (http://trentacular.com)
 * Licensed under the MIT License:
 *   http://www.opensource.org/licenses/mit-license.php
 *
 * Much thanks to primary contributer Ponticlaro (http://www.ponticlaro.com)
 */
;(function($) {
  // Globally keep track of all images by their unique hash.  Each item is an image data object.
  var allImages = {};
  var imageCounter = 0;

  // Galleriffic static class
  $.galleriffic = {
    version: '2.0.1',

    // Strips invalid characters and any leading # characters
    normalizeHash: function(hash) {
      return hash.replace(/^.*#/, '').replace(/\?.*$/, '');
    },

    getImage: function(hash) {
      if (!hash)
        return undefined;

      hash = $.galleriffic.normalizeHash(hash);
      return allImages[hash];
    },

    // Global function that looks up an image by its hash and displays the image.
    // Returns false when an image is not found for the specified hash.
    // @param {String} hash This is the unique hash value assigned to an image.
    gotoImage: function(hash) {
      var imageData = $.galleriffic.getImage(hash);
      if (!imageData)
        return false;

      var gallery = imageData.gallery;
      gallery.gotoImage(imageData);
      
      return true;
    },

    // Removes an image from its respective gallery by its hash.
    // Returns false when an image is not found for the specified hash or the
    // specified owner gallery does match the located images gallery.
    // @param {String} hash This is the unique hash value assigned to an image.
    // @param {Object} ownerGallery (Optional) When supplied, the located images
    // gallery is verified to be the same as the specified owning gallery before
    // performing the remove operation.
    removeImageByHash: function(hash, ownerGallery) {
      var imageData = $.galleriffic.getImage(hash);
      if (!imageData)
        return false;

      var gallery = imageData.gallery;
      if (ownerGallery && ownerGallery != gallery)
        return false;

      return gallery.removeImageByIndex(imageData.index);
    }
  };

  var defaults = {
    delay:                     3000,
    numThumbs:                 20,
    preloadAhead:              40, // Set to -1 to preload all images
    enableTopPager:            false,
    enableBottomPager:         true,
    maxPagesToShow:            7,
    imageContainerSel:         '',
    captionContainerSel:       '',
    controlsContainerSel:      '',
    loadingContainerSel:       '',
    renderSSControls:          true,
    renderNavControls:         true,
    playLinkText:              'Play',
    pauseLinkText:             'Pause',
    prevLinkText:              'Previous',
    nextLinkText:              'Next',
    nextPageLinkText:          'Next &rsaquo;',
    prevPageLinkText:          '&lsaquo; Prev',
    enableHistory:             false,
    enableKeyboardNavigation:  true,
    autoStart:                 false,
    syncTransitions:           false,
    defaultTransitionDuration: 1000,
    onSlideChange:             undefined, // accepts a delegate like such: function(prevIndex, nextIndex) { ... }
    onTransitionOut:           undefined, // accepts a delegate like such: function(slide, caption, isSync, callback) { ... }
    onTransitionIn:            undefined, // accepts a delegate like such: function(slide, caption, isSync) { ... }
    onPageTransitionOut:       undefined, // accepts a delegate like such: function(callback) { ... }
    onPageTransitionIn:        undefined, // accepts a delegate like such: function() { ... }
    onImageAdded:              undefined, // accepts a delegate like such: function(imageData, $li) { ... }
    onImageRemoved:            undefined  // accepts a delegate like such: function(imageData, $li) { ... }
  };

  // Primary Galleriffic initialization function that should be called on the thumbnail container.
  $.fn.galleriffic = function(settings) {
    //  Extend Gallery Object
    $.extend(this, {
      // Returns the version of the script
      version: $.galleriffic.version,

      // Current state of the slideshow
      isSlideshowRunning: false,
      slideshowTimeout: undefined,

      // This function is attached to the click event of generated hyperlinks within the gallery
      clickHandler: function(e, link) {
        this.pause();

        if (!this.enableHistory) {
          // The href attribute holds the unique hash for an image
          var hash = $.galleriffic.normalizeHash($(link).attr('href'));
          $.galleriffic.gotoImage(hash);
          e.preventDefault();
        }
      },

      // Appends an image to the end of the set of images.  Argument listItem can be either a jQuery DOM element or arbitrary html.
      // @param listItem Either a jQuery object or a string of html of the list item that is to be added to the gallery.
      appendImage: function(listItem) {
        this.addImage(listItem, false, false);
        return this;
      },

      // Inserts an image into the set of images.  Argument listItem can be either a jQuery DOM element or arbitrary html.
      // @param listItem Either a jQuery object or a string of html of the list item that is to be added to the gallery.
      // @param {Integer} position The index within the gallery where the item shouold be added.
      insertImage: function(listItem, position) {
        this.addImage(listItem, false, true, position);
        return this;
      },

      // Adds an image to the gallery and optionally inserts/appends it to the DOM (thumbExists)
      // @param listItem Either a jQuery object or a string of html of the list item that is to be added to the gallery.
      // @param {Boolean} thumbExists Specifies whether the thumbnail already exists in the DOM or if it needs to be added.
      // @param {Boolean} insert Specifies whether the the image is appended to the end or inserted into the gallery.
      // @param {Integer} position The index within the gallery where the item shouold be added.
      addImage: function(listItem, thumbExists, insert, position) {
        var $li = ( typeof listItem === "string" ) ? $(listItem) : listItem;        
        var $aThumb = $li.find('a.thumb');
        var slideUrl = $aThumb.attr('href');
        var title = $aThumb.attr('title');
        var $caption = $li.find('.caption').remove();
        var hash = $aThumb.attr('name');

        // Increment the image counter
        imageCounter++;

        // Autogenerate a hash value if none is present or if it is a duplicate
        if (!hash || allImages[''+hash]) {
          hash = imageCounter;
        }

        // Set position to end when not specified
        if (!insert)
          position = this.data.length;
        
        var imageData = {
          title:title,
          slideUrl:slideUrl,
          caption:$caption,
          hash:hash,
          gallery:this,
          index:position
        };

        // Add the imageData to this gallery's array of images
        if (insert) {
          this.data.splice(position, 0, imageData);

          // Reset index value on all imageData objects
          this.updateIndices(position);
        }
        else {
          this.data.push(imageData);
        }

        var gallery = this;

        // Add the element to the DOM
        if (!thumbExists) {
          // Update thumbs passing in addition post transition out handler
          this.updateThumbs(function() {
            var $thumbsUl = gallery.find('ul.thumbs');
            if (insert)
              $thumbsUl.children(':eq('+position+')').before($li);
            else
              $thumbsUl.append($li);
            
            if (gallery.onImageAdded)
              gallery.onImageAdded(imageData, $li);
          });
        }

        // Register the image globally
        allImages[''+hash] = imageData;

        // Setup attributes and click handler
        $aThumb.attr('rel', 'history')
          .attr('href', '#'+hash)
          .removeAttr('name')
          .click(function(e) {
            gallery.clickHandler(e, this);
          });

        return this;
      },

      // Removes an image from the gallery based on its index.
      // Returns false when the index is out of range.
      removeImageByIndex: function(index) {
        if (index < 0 || index >= this.data.length)
          return false;
        
        var imageData = this.data[index];
        if (!imageData)
          return false;
        
        this.removeImage(imageData);
        
        return true;
      },

      // Convenience method that simply calls the global removeImageByHash method.
      removeImageByHash: function(hash) {
        return $.galleriffic.removeImageByHash(hash, this);
      },

      // Removes an image from the gallery.
      removeImage: function(imageData) {
        var index = imageData.index;
        
        // Remove the image from the gallery data array
        this.data.splice(index, 1);
        
        // Remove the global registration
        delete allImages[''+imageData.hash];
        
        // Remove the image's list item from the DOM
        this.updateThumbs(function() {
          var $li = gallery.find('ul.thumbs')
            .children(':eq('+index+')')
            .remove();

          if (gallery.onImageRemoved)
            gallery.onImageRemoved(imageData, $li);
        });

        // Update each image objects index value
        this.updateIndices(index);

        return this;
      },

      // Updates the index values of the each of the images in the gallery after the specified index
      updateIndices: function(startIndex) {
        for (i = startIndex; i < this.data.length; i++) {
          this.data[i].index = i;
        }
        
        return this;
      },

      // Scraped the thumbnail container for thumbs and adds each to the gallery
      initializeThumbs: function() {
        this.data = [];
        var gallery = this;

        this.find('ul.thumbs > li').each(function(i) {
          gallery.addImage($(this), true, false);
        });

        return this;
      },

      isPreloadComplete: false,

      // Initalizes the image preloader
      preloadInit: function() {
        if (this.preloadAhead == 0) return this;
        
        this.preloadStartIndex = this.currentImage.index;
        var nextIndex = this.getNextIndex(this.preloadStartIndex);
        return this.preloadRecursive(this.preloadStartIndex, nextIndex);
      },

      // Changes the location in the gallery the preloader should work
      // @param {Integer} index The index of the image where the preloader should restart at.
      preloadRelocate: function(index) {
        // By changing this startIndex, the current preload script will restart
        this.preloadStartIndex = index;
        return this;
      },

      // Recursive function that performs the image preloading
      // @param {Integer} startIndex The index of the first image the current preloader started on.
      // @param {Integer} currentIndex The index of the current image to preload.
      preloadRecursive: function(startIndex, currentIndex) {
        // Check if startIndex has been relocated
        if (startIndex != this.preloadStartIndex) {
          var nextIndex = this.getNextIndex(this.preloadStartIndex);
          return this.preloadRecursive(this.preloadStartIndex, nextIndex);
        }

        var gallery = this;

        // Now check for preloadAhead count
        var preloadCount = currentIndex - startIndex;
        if (preloadCount < 0)
          preloadCount = this.data.length-1-startIndex+currentIndex;
        if (this.preloadAhead >= 0 && preloadCount > this.preloadAhead) {
          // Do this in order to keep checking for relocated start index
          setTimeout(function() { gallery.preloadRecursive(startIndex, currentIndex); }, 500);
          return this;
        }

        var imageData = this.data[currentIndex];
        if (!imageData)
          return this;

        // If already loaded, continue
        if (imageData.image)
          return this.preloadNext(startIndex, currentIndex); 
        
        // Preload the image
        var image = new Image();
        
        image.onload = function() {
          imageData.image = this;
          gallery.preloadNext(startIndex, currentIndex);
        };

        image.alt = imageData.title;
        image.src = imageData.slideUrl;

        return this;
      },
      
      // Called by preloadRecursive in order to preload the next image after the previous has loaded.
      // @param {Integer} startIndex The index of the first image the current preloader started on.
      // @param {Integer} currentIndex The index of the current image to preload.
      preloadNext: function(startIndex, currentIndex) {
        var nextIndex = this.getNextIndex(currentIndex);
        if (nextIndex == startIndex) {
          this.isPreloadComplete = true;
        } else {
          // Use setTimeout to free up thread
          var gallery = this;
          setTimeout(function() { gallery.preloadRecursive(startIndex, nextIndex); }, 100);
        }

        return this;
      },

      // Safe way to get the next image index relative to the current image.
      // If the current image is the last, returns 0
      getNextIndex: function(index) {
        var nextIndex = index+1;
        if (nextIndex >= this.data.length)
          nextIndex = 0;
        return nextIndex;
      },

      // Safe way to get the previous image index relative to the current image.
      // If the current image is the first, return the index of the last image in the gallery.
      getPrevIndex: function(index) {
        var prevIndex = index-1;
        if (prevIndex < 0)
          prevIndex = this.data.length-1;
        return prevIndex;
      },

      // Pauses the slideshow
      pause: function() {
        this.isSlideshowRunning = false;
        if (this.slideshowTimeout) {
          clearTimeout(this.slideshowTimeout);
          this.slideshowTimeout = undefined;
        }

        if (this.$controlsContainer) {
          this.$controlsContainer
            .find('div.ss-controls a').removeClass().addClass('play')
            .attr('title', this.playLinkText)
            .attr('href', '#play')
            .html(this.playLinkText);
        }
        
        return this;
      },

      // Plays the slideshow
      play: function() {
        this.isSlideshowRunning = true;

        if (this.$controlsContainer) {
          this.$controlsContainer
            .find('div.ss-controls a').removeClass().addClass('pause')
            .attr('title', this.pauseLinkText)
            .attr('href', '#pause')
            .html(this.pauseLinkText);
        }

        if (!this.slideshowTimeout) {
          var gallery = this;
          this.slideshowTimeout = setTimeout(function() { gallery.ssAdvance(); }, this.delay);
        }

        return this;
      },

      // Toggles the state of the slideshow (playing/paused)
      toggleSlideshow: function() {
        if (this.isSlideshowRunning)
          this.pause();
        else
          this.play();

        return this;
      },

      // Advances the slideshow to the next image and delegates navigation to the
      // history plugin when history is enabled
      // enableHistory is true
      ssAdvance: function() {
        if (this.isSlideshowRunning)
          this.next(true);

        return this;
      },

      // Advances the gallery to the next image.
      // @param {Boolean} dontPause Specifies whether to pause the slideshow.
      // @param {Boolean} bypassHistory Specifies whether to delegate navigation to the history plugin when history is enabled.  
      next: function(dontPause, bypassHistory) {
        this.gotoIndex(this.getNextIndex(this.currentImage.index), dontPause, bypassHistory);
        return this;
      },

      // Navigates to the previous image in the gallery.
      // @param {Boolean} dontPause Specifies whether to pause the slideshow.
      // @param {Boolean} bypassHistory Specifies whether to delegate navigation to the history plugin when history is enabled.
      previous: function(dontPause, bypassHistory) {
        this.gotoIndex(this.getPrevIndex(this.currentImage.index), dontPause, bypassHistory);
        return this;
      },

      // Navigates to the next page in the gallery.
      // @param {Boolean} dontPause Specifies whether to pause the slideshow.
      // @param {Boolean} bypassHistory Specifies whether to delegate navigation to the history plugin when history is enabled.
      nextPage: function(dontPause, bypassHistory) {
        var page = this.getCurrentPage();
        var lastPage = this.getNumPages() - 1;
        if (page < lastPage) {
          var startIndex = page * this.numThumbs;
          var nextPage = startIndex + this.numThumbs;
          this.gotoIndex(nextPage, dontPause, bypassHistory);
        }

        return this;
      },

      // Navigates to the previous page in the gallery.
      // @param {Boolean} dontPause Specifies whether to pause the slideshow.
      // @param {Boolean} bypassHistory Specifies whether to delegate navigation to the history plugin when history is enabled.
      previousPage: function(dontPause, bypassHistory) {
        var page = this.getCurrentPage();
        if (page > 0) {
          var startIndex = page * this.numThumbs;
          var prevPage = startIndex - this.numThumbs;        
          this.gotoIndex(prevPage, dontPause, bypassHistory);
        }
        
        return this;
      },

      // Navigates to the image at the specified index in the gallery
      // @param {Integer} index The index of the image in the gallery to display.
      // @param {Boolean} dontPause Specifies whether to pause the slideshow.
      // @param {Boolean} bypassHistory Specifies whether to delegate navigation to the history plugin when history is enabled.
      gotoIndex: function(index, dontPause, bypassHistory) {
        if (!dontPause)
          this.pause();
        
        if (index < 0) index = 0;
        else if (index >= this.data.length) index = this.data.length-1;
        
        var imageData = this.data[index];
        
        if (!bypassHistory && this.enableHistory)
          $.historyLoad(String(imageData.hash));  // At the moment, historyLoad only accepts string arguments
        else
          this.gotoImage(imageData);

        return this;
      },

      // This function is garaunteed to be called anytime a gallery slide changes.
      // @param {Object} imageData An object holding the image metadata of the image to navigate to.
      gotoImage: function(imageData) {
        var index = imageData.index;

        if (this.onSlideChange)
          this.onSlideChange(this.currentImage.index, index);
        
        this.currentImage = imageData;
        this.preloadRelocate(index);
        
        this.refresh();
        
        return this;
      },

      // Returns the default transition duration value.  The value is halved when not
      // performing a synchronized transition.
      // @param {Boolean} isSync Specifies whether the transitions are synchronized.
      getDefaultTransitionDuration: function(isSync) {
        if (isSync)
          return this.defaultTransitionDuration;
        return this.defaultTransitionDuration / 2;
      },

      // Rebuilds the slideshow image and controls and performs transitions
      refresh: function() {
        var imageData = this.currentImage;
        if (!imageData)
          return this;

        var index = imageData.index;

        // Update Controls
        if (this.$controlsContainer) {
          this.$controlsContainer
            .find('div.nav-controls a.prev').attr('href', '#'+this.data[this.getPrevIndex(index)].hash).end()
            .find('div.nav-controls a.next').attr('href', '#'+this.data[this.getNextIndex(index)].hash);
        }

        var previousSlide = this.$imageContainer.find('span.current').addClass('previous').removeClass('current');
        var previousCaption = 0;

        if (this.$captionContainer) {
          previousCaption = this.$captionContainer.find('span.current').addClass('previous').removeClass('current');
        }

        // Perform transitions simultaneously if syncTransitions is true and the next image is already preloaded
        var isSync = this.syncTransitions && imageData.image;

        // Flag we are transitioning
        var isTransitioning = true;
        var gallery = this;

        var transitionOutCallback = function() {
          // Flag that the transition has completed
          isTransitioning = false;

          // Remove the old slide
          previousSlide.remove();

          // Remove old caption
          if (previousCaption)
            previousCaption.remove();

          if (!isSync) {
            if (imageData.image && imageData.hash == gallery.data[gallery.currentImage.index].hash) {
              gallery.buildImage(imageData, isSync);
            } else {
              // Show loading container
              if (gallery.$loadingContainer) {
                gallery.$loadingContainer.show();
              }
            }
          }
        };

        if (previousSlide.length == 0) {
          // For the first slide, the previous slide will be empty, so we will call the callback immediately
          transitionOutCallback();
        } else {
          if (this.onTransitionOut) {
            this.onTransitionOut(previousSlide, previousCaption, isSync, transitionOutCallback);
          } else {
            previousSlide.fadeTo(this.getDefaultTransitionDuration(isSync), 0.0, transitionOutCallback);
            if (previousCaption)
              previousCaption.fadeTo(this.getDefaultTransitionDuration(isSync), 0.0);
          }
        }

        // Go ahead and begin transitioning in of next image
        if (isSync)
          this.buildImage(imageData, isSync);

        if (!imageData.image) {
          var image = new Image();
          
          // Wire up mainImage onload event
          image.onload = function() {
            imageData.image = this;

            // Only build image if the out transition has completed and we are still on the same image hash
            if (!isTransitioning && imageData.hash == gallery.data[gallery.currentImage.index].hash) {
              gallery.buildImage(imageData, isSync);
            }
          };

          // set alt and src
          image.alt = imageData.title;
          image.src = imageData.slideUrl;
        }

        // This causes the preloader (if still running) to relocate out from the currentIndex
        this.relocatePreload = true;

        return this.syncThumbs();
      },

      // Called by the refresh method after the previous image has been transitioned out or at the same time
      // as the out transition when performing a synchronous transition.
      // @param {Object} imageData An object holding the image metadata of the image to build.
      // @param {Boolean} isSync Specifies whether the transitions are synchronized.
      buildImage: function(imageData, isSync) {
        var gallery = this;
        var nextIndex = this.getNextIndex(imageData.index);

        // Construct new hidden span for the image
        var newSlide = this.$imageContainer
          .append('<span class="image-wrapper current"><a class="advance-link" rel="history" href="#'+this.data[nextIndex].hash+'" title="'+imageData.title+'">&nbsp;</a></span>')
          .find('span.current').css('opacity', '0');
        
        newSlide.find('a')
          .append(imageData.image)
          .click(function(e) {
            gallery.clickHandler(e, this);
          });
        
        var newCaption = 0;
        if (this.$captionContainer) {
          // Construct new hidden caption for the image
          newCaption = this.$captionContainer
            .append('<span class="image-caption current"></span>')
            .find('span.current').css('opacity', '0')
            .append(imageData.caption);
        }

        // Hide the loading conatiner
        if (this.$loadingContainer) {
          this.$loadingContainer.hide();
        }

        // Transition in the new image
        if (this.onTransitionIn) {
          this.onTransitionIn(newSlide, newCaption, isSync);
        } else {
          newSlide.fadeTo(this.getDefaultTransitionDuration(isSync), 1.0);
                    $('.advance-link img').removeAttr('height');
          if (newCaption)
            newCaption.fadeTo(this.getDefaultTransitionDuration(isSync), 1.0);
        }
        
        if (this.isSlideshowRunning) {
          if (this.slideshowTimeout)
            clearTimeout(this.slideshowTimeout);

          this.slideshowTimeout = setTimeout(function() { gallery.ssAdvance(); }, this.delay);
        }

        return this;
      },

      // Returns the current page index that should be shown for the currentImage
      getCurrentPage: function() {
        return Math.floor(this.currentImage.index / this.numThumbs);
      },

      // Applies the selected class to the current image's corresponding thumbnail.
      // Also checks if the current page has changed and updates the displayed page of thumbnails if necessary.
      syncThumbs: function() {
        var page = this.getCurrentPage();
        if (page != this.displayedPage)
          this.updateThumbs();

        // Remove existing selected class and add selected class to new thumb
        var $thumbs = this.find('ul.thumbs').children();
        $thumbs.filter('.selected').removeClass('selected');
        $thumbs.eq(this.currentImage.index).addClass('selected');

        return this;
      },

      // Performs transitions on the thumbnails container and updates the set of
      // thumbnails that are to be displayed and the navigation controls.
      // @param {Delegate} postTransitionOutHandler An optional delegate that is called after
      // the thumbnails container has transitioned out and before the thumbnails are rebuilt.
      updateThumbs: function(postTransitionOutHandler) {
        var gallery = this;
        var transitionOutCallback = function() {
          // Call the Post-transition Out Handler
          if (postTransitionOutHandler)
            postTransitionOutHandler();
          
          gallery.rebuildThumbs();

          // Transition In the thumbsContainer
          if (gallery.onPageTransitionIn)
            gallery.onPageTransitionIn();
          else
            gallery.show();
        };

        // Transition Out the thumbsContainer
        if (this.onPageTransitionOut) {
          this.onPageTransitionOut(transitionOutCallback);
        } else {
          this.hide();
          transitionOutCallback();
        }

        return this;
      },

      // Updates the set of thumbnails that are to be displayed and the navigation controls.
      rebuildThumbs: function() {
        var needsPagination = this.data.length > this.numThumbs;

        // Rebuild top pager
        if (this.enableTopPager) {
          var $topPager = this.find('div.top');
          if ($topPager.length == 0)
            $topPager = this.prepend('<div class="top pagination"></div>').find('div.top');
          else
            $topPager.empty();

          if (needsPagination)
            this.buildPager($topPager);
        }

        // Rebuild bottom pager
        if (this.enableBottomPager) {
          var $bottomPager = this.find('div.bottom');
          if ($bottomPager.length == 0)
            $bottomPager = this.append('<div class="bottom pagination"></div>').find('div.bottom');
          else
            $bottomPager.empty();

          if (needsPagination)
            this.buildPager($bottomPager);
        }

        var page = this.getCurrentPage();
        var startIndex = page*this.numThumbs;
        var stopIndex = startIndex+this.numThumbs-1;
        if (stopIndex >= this.data.length)
          stopIndex = this.data.length-1;

        // Show/Hide thumbs
        var $thumbsUl = this.find('ul.thumbs');
        $thumbsUl.find('li').each(function(i) {
          var $li = $(this);
          if (i >= startIndex && i <= stopIndex) {
            $li.show();
          } else {
            $li.hide();
          }
        });

        this.displayedPage = page;

        // Remove the noscript class from the thumbs container ul
        $thumbsUl.removeClass('noscript');
        
        return this;
      },

      // Returns the total number of pages required to display all the thumbnails.
      getNumPages: function() {
        return Math.ceil(this.data.length/this.numThumbs);
      },

      // Rebuilds the pager control in the specified matched element.
      // @param {jQuery} pager A jQuery element set matching the particular pager to be rebuilt.
      buildPager: function(pager) {
        var gallery = this;
        var numPages = this.getNumPages();
        var page = this.getCurrentPage();
        var startIndex = page * this.numThumbs;
        var pagesRemaining = this.maxPagesToShow - 1;
        
        var pageNum = page - Math.floor((this.maxPagesToShow - 1) / 2) + 1;
        if (pageNum > 0) {
          var remainingPageCount = numPages - pageNum;
          if (remainingPageCount < pagesRemaining) {
            pageNum = pageNum - (pagesRemaining - remainingPageCount);
          }
        }

        if (pageNum < 0) {
          pageNum = 0;
        }

        // Prev Page Link
        if (page > 0) {
          var prevPage = startIndex - this.numThumbs;
          pager.append('<a rel="history" href="#'+this.data[prevPage].hash+'" title="'+this.prevPageLinkText+'">'+this.prevPageLinkText+'</a>');
        }

        // Create First Page link if needed
        if (pageNum > 0) {
          this.buildPageLink(pager, 0, numPages);
          if (pageNum > 1)
            pager.append('<span class="ellipsis">&hellip;</span>');
          
          pagesRemaining--;
        }

        // Page Index Links
        while (pagesRemaining > 0) {
          this.buildPageLink(pager, pageNum, numPages);
          pagesRemaining--;
          pageNum++;
        }

        // Create Last Page link if needed
        if (pageNum < numPages) {
          var lastPageNum = numPages - 1;
          if (pageNum < lastPageNum)
            pager.append('<span class="ellipsis">&hellip;</span>');

          this.buildPageLink(pager, lastPageNum, numPages);
        }

        // Next Page Link
        var nextPage = startIndex + this.numThumbs;
        if (nextPage < this.data.length) {
          pager.append('<a rel="history" href="#'+this.data[nextPage].hash+'" title="'+this.nextPageLinkText+'">'+this.nextPageLinkText+'</a>');
        }

        pager.find('a').click(function(e) {
          gallery.clickHandler(e, this);
        });

        return this;
      },

      // Builds a single page link within a pager.  This function is called by buildPager
      // @param {jQuery} pager A jQuery element set matching the particular pager to be rebuilt.
      // @param {Integer} pageNum The page number of the page link to build.
      // @param {Integer} numPages The total number of pages required to display all thumbnails.
      buildPageLink: function(pager, pageNum, numPages) {
        var pageLabel = pageNum + 1;
        var currentPage = this.getCurrentPage();
        if (pageNum == currentPage)
          pager.append('<span class="current">'+pageLabel+'</span>');
        else if (pageNum < numPages) {
          var imageIndex = pageNum*this.numThumbs;
          pager.append('<a rel="history" href="#'+this.data[imageIndex].hash+'" title="'+pageLabel+'">'+pageLabel+'</a>');
        }
        
        return this;
      }
    });

    // Now initialize the gallery
    $.extend(this, defaults, settings);
    
    // Verify the history plugin is available
    if (this.enableHistory && !$.historyInit)
      this.enableHistory = false;
    
    // Select containers
    if (this.imageContainerSel) this.$imageContainer = $(this.imageContainerSel);
    if (this.captionContainerSel) this.$captionContainer = $(this.captionContainerSel);
    if (this.loadingContainerSel) this.$loadingContainer = $(this.loadingContainerSel);

    // Initialize the thumbails
    this.initializeThumbs();
    
    if (this.maxPagesToShow < 3)
      this.maxPagesToShow = 3;

    this.displayedPage = -1;
    this.currentImage = this.data[0];
    var gallery = this;

    // Hide the loadingContainer
    if (this.$loadingContainer)
      this.$loadingContainer.hide();

    // Setup controls
    if (this.controlsContainerSel) {
      this.$controlsContainer = $(this.controlsContainerSel).empty();
      
      if (this.renderSSControls) {
        if (this.autoStart) {
          this.$controlsContainer
            .append('<div class="ss-controls"><a href="#pause" class="pause" title="'+this.pauseLinkText+'">'+this.pauseLinkText+'</a></div>');
        } else {
          this.$controlsContainer
            .append('<div class="ss-controls"><a href="#play" class="play" title="'+this.playLinkText+'">'+this.playLinkText+'</a></div>');
        }

        this.$controlsContainer.find('div.ss-controls a')
          .click(function(e) {
            gallery.toggleSlideshow();
            e.preventDefault();
            return false;
          });
      }
    
      if (this.renderNavControls) {
        this.$controlsContainer
          .append('<div class="nav-controls"><a class="prev" rel="history" title="'+this.prevLinkText+'">'+this.prevLinkText+'</a><a class="next" rel="history" title="'+this.nextLinkText+'">'+this.nextLinkText+'</a></div>')
          .find('div.nav-controls a')
          .click(function(e) {
            gallery.clickHandler(e, this);
          });
      }
    }

    var initFirstImage = !this.enableHistory || !location.hash;
    if (this.enableHistory && location.hash) {
      var hash = $.galleriffic.normalizeHash(location.hash);
      var imageData = allImages[hash];
      if (!imageData)
        initFirstImage = true;
    }

    // Setup gallery to show the first image
    if (initFirstImage)
      this.gotoIndex(0, false, true);

    // Setup Keyboard Navigation
    if (this.enableKeyboardNavigation) {
      $(document).keydown(function(e) {
        var key = e.charCode ? e.charCode : e.keyCode ? e.keyCode : 0;
        switch(key) {
          case 32: // space
            gallery.next();
            e.preventDefault();
            break;
          case 33: // Page Up
            gallery.previousPage();
            e.preventDefault();
            break;
          case 34: // Page Down
            gallery.nextPage();
            e.preventDefault();
            break;
          case 35: // End
            gallery.gotoIndex(gallery.data.length-1);
            e.preventDefault();
            break;
          case 36: // Home
            gallery.gotoIndex(0);
            e.preventDefault();
            break;
          case 37: // left arrow
            gallery.previous();
            e.preventDefault();
            break;
          case 39: // right arrow
            gallery.next();
            e.preventDefault();
            break;
        }
      });
    }

    // Auto start the slideshow
    if (this.autoStart)
      this.play();

    // Kickoff Image Preloader after 1 second
    setTimeout(function() { gallery.preloadInit(); }, 1000);

    return this;
  };
})(jQuery);



// ColorBox v1.3.18 - a full featured, light-weight, customizable lightbox based on jQuery 1.3+
// Copyright (c) 2011 Jack Moore - jack@colorpowered.com
// Licensed under the MIT license: http://www.opensource.org/licenses/mit-license.php
(function (a, b, c) { function Y(c, d, e) { var g = b.createElement(c); return d && (g.id = f + d), e && (g.style.cssText = e), a(g) } function Z(a) { var b = y.length, c = (Q + a) % b; return c < 0 ? b + c : c } function $(a, b) { return Math.round((/%/.test(a) ? (b === "x" ? z.width() : z.height()) / 100 : 1) * parseInt(a, 10)) } function _(a) { return K.photo || /\.(gif|png|jpe?g|bmp|ico)((#|\?).*)?$/i.test(a) } function ba() { var b; K = a.extend({}, a.data(P, e)); for (b in K) a.isFunction(K[b]) && b.slice(0, 2) !== "on" && (K[b] = K[b].call(P)); K.rel = K.rel || P.rel || "nofollow", K.href = K.href || a(P).attr("href"), K.title = K.title || P.title, typeof K.href == "string" && (K.href = a.trim(K.href)) } function bb(b, c) { a.event.trigger(b), c && c.call(P) } function bc() { var a, b = f + "Slideshow_", c = "click." + f, d, e, g; K.slideshow && y[1] ? (d = function () { F.text(K.slideshowStop).unbind(c).bind(j, function () { if (Q < y.length - 1 || K.loop) a = setTimeout(W.next, K.slideshowSpeed) }).bind(i, function () { clearTimeout(a) }).one(c + " " + k, e), r.removeClass(b + "off").addClass(b + "on"), a = setTimeout(W.next, K.slideshowSpeed) }, e = function () { clearTimeout(a), F.text(K.slideshowStart).unbind([j, i, k, c].join(" ")).one(c, function () { W.next(), d() }), r.removeClass(b + "on").addClass(b + "off") }, K.slideshowAuto ? d() : e()) : r.removeClass(b + "off " + b + "on") } function bd(b) { if (!U) { P = b, ba(), y = a(P), Q = 0, K.rel !== "nofollow" && (y = a("." + g).filter(function () { var b = a.data(this, e).rel || this.rel; return b === K.rel }), Q = y.index(P), Q === -1 && (y = y.add(P), Q = y.length - 1)); if (!S) { S = T = !0, r.show(); if (K.returnFocus) try { P.blur(), a(P).one(l, function () { try { this.focus() } catch (a) { } }) } catch (c) { } q.css({ opacity: +K.opacity, cursor: K.overlayClose ? "pointer" : "auto" }).show(), K.w = $(K.initialWidth, "x"), K.h = $(K.initialHeight, "y"), W.position(), o && z.bind("resize." + p + " scroll." + p, function () { q.css({ width: z.width(), height: z.height(), top: z.scrollTop(), left: z.scrollLeft() }) }).trigger("resize." + p), bb(h, K.onOpen), J.add(D).hide(), I.html(K.close).show() } W.load(!0) } } var d = { transition: "elastic", speed: 300, width: !1, initialWidth: "600", innerWidth: !1, maxWidth: !1, height: !1, initialHeight: "450", innerHeight: !1, maxHeight: !1, scalePhotos: !0, scrolling: !0, inline: !1, html: !1, iframe: !1, fastIframe: !0, photo: !1, href: !1, title: !1, rel: !1, opacity: .9, preloading: !0, current: "image {current} of {total}", previous: "previous", next: "next", close: "close", open: !1, returnFocus: !0, loop: !0, slideshow: !1, slideshowAuto: !0, slideshowSpeed: 2500, slideshowStart: "start slideshow", slideshowStop: "stop slideshow", onOpen: !1, onLoad: !1, onComplete: !1, onCleanup: !1, onClosed: !1, overlayClose: !0, escKey: !0, arrowKey: !0, top: !1, bottom: !1, left: !1, right: !1, fixed: !1, data: undefined }, e = "colorbox", f = "cbox", g = f + "Element", h = f + "_open", i = f + "_load", j = f + "_complete", k = f + "_cleanup", l = f + "_closed", m = f + "_purge", n = a.browser.msie && !a.support.opacity, o = n && a.browser.version < 7, p = f + "_IE6", q, r, s, t, u, v, w, x, y, z, A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X = "div"; W = a.fn[e] = a[e] = function (b, c) { var f = this; b = b || {}, W.init(); if (!f[0]) { if (f.selector) return f; f = a("<a/>"), b.open = !0 } return c && (b.onComplete = c), f.each(function () { a.data(this, e, a.extend({}, a.data(this, e) || d, b)), a(this).addClass(g) }), (a.isFunction(b.open) && b.open.call(f) || b.open) && bd(f[0]), f }, W.init = function () { if (!r) { if (!a("body")[0]) { a(W.init); return } z = a(c), r = Y(X).attr({ id: e, "class": n ? f + (o ? "IE6" : "IE") : "" }), q = Y(X, "Overlay", o ? "position:absolute" : "").hide(), s = Y(X, "Wrapper"), t = Y(X, "Content").append(A = Y(X, "LoadedContent", "width:0; height:0; overflow:hidden"), C = Y(X, "LoadingOverlay").add(Y(X, "LoadingGraphic")), D = Y(X, "Title"), E = Y(X, "Current"), G = Y(X, "Next"), H = Y(X, "Previous"), F = Y(X, "Slideshow").bind(h, bc), I = Y(X, "Close")), s.append(Y(X).append(Y(X, "TopLeft"), u = Y(X, "TopCenter"), Y(X, "TopRight")), Y(X, !1, "clear:left").append(v = Y(X, "MiddleLeft"), t, w = Y(X, "MiddleRight")), Y(X, !1, "clear:left").append(Y(X, "BottomLeft"), x = Y(X, "BottomCenter"), Y(X, "BottomRight"))).find("div div").css({ "float": "left" }), B = Y(X, !1, "position:absolute; width:9999px; visibility:hidden; display:none"), a("body").prepend(q, r.append(s, B)), L = u.height() + x.height() + t.outerHeight(!0) - t.height(), M = v.width() + w.width() + t.outerWidth(!0) - t.width(), N = A.outerHeight(!0), O = A.outerWidth(!0), r.css({ "padding-bottom": L, "padding-right": M }).hide(), G.click(function () { W.next() }), H.click(function () { W.prev() }), I.click(function () { W.close() }), J = G.add(H).add(E).add(F), q.click(function () { K.overlayClose && W.close() }), a(b).bind("keydown." + f, function (a) { var b = a.keyCode; S && K.escKey && b === 27 && (a.preventDefault(), W.close()), S && K.arrowKey && y[1] && (b === 37 ? (a.preventDefault(), H.click()) : b === 39 && (a.preventDefault(), G.click())) }) } }, W.remove = function () { r.add(q).remove(), r = null, a("." + g).removeData(e).removeClass(g) }, W.position = function (a, b) { function g(a) { u[0].style.width = x[0].style.width = t[0].style.width = a.style.width, C[0].style.height = C[1].style.height = t[0].style.height = v[0].style.height = w[0].style.height = a.style.height } var c = 0, d = 0, e = r.offset(); z.unbind("resize." + f), r.css({ top: -99999, left: -99999 }), K.fixed && !o ? r.css({ position: "fixed" }) : (c = z.scrollTop(), d = z.scrollLeft(), r.css({ position: "absolute" })), K.right !== !1 ? d += Math.max(z.width() - K.w - O - M - $(K.right, "x"), 0) : K.left !== !1 ? d += $(K.left, "x") : d += Math.round(Math.max(z.width() - K.w - O - M, 0) / 2), K.bottom !== !1 ? c += Math.max(z.height() - K.h - N - L - $(K.bottom, "y"), 0) : K.top !== !1 ? c += $(K.top, "y") : c += Math.round(Math.max(z.height() - K.h - N - L, 0) / 2), r.css({ top: e.top, left: e.left }), a = r.width() === K.w + O && r.height() === K.h + N ? 0 : a || 0, s[0].style.width = s[0].style.height = "9999px", r.dequeue().animate({ width: K.w + O, height: K.h + N, top: c, left: d }, { duration: a, complete: function () { g(this), T = !1, s[0].style.width = K.w + O + M + "px", s[0].style.height = K.h + N + L + "px", b && b(), setTimeout(function () { z.bind("resize." + f, W.position) }, 1) }, step: function () { g(this) } }) }, W.resize = function (a) { S && (a = a || {}, a.width && (K.w = $(a.width, "x") - O - M), a.innerWidth && (K.w = $(a.innerWidth, "x")), A.css({ width: K.w }), a.height && (K.h = $(a.height, "y") - N - L), a.innerHeight && (K.h = $(a.innerHeight, "y")), !a.innerHeight && !a.height && (A.css({ height: "auto" }), K.h = A.height()), A.css({ height: K.h }), W.position(K.transition === "none" ? 0 : K.speed)) }, W.prep = function (b) { function g() { return K.w = K.w || A.width(), K.w = K.mw && K.mw < K.w ? K.mw : K.w, K.w } function h() { return K.h = K.h || A.height(), K.h = K.mh && K.mh < K.h ? K.mh : K.h, K.h } if (!S) return; var c, d = K.transition === "none" ? 0 : K.speed; A.remove(), A = Y(X, "LoadedContent").append(b), A.hide().appendTo(B.show()).css({ width: g(), overflow: K.scrolling ? "auto" : "hidden" }).css({ height: h() }).prependTo(t), B.hide(), a(R).css({ "float": "none" }), o && a("select").not(r.find("select")).filter(function () { return this.style.visibility !== "hidden" }).css({ visibility: "hidden" }).one(k, function () { this.style.visibility = "inherit" }), c = function () { function q() { n && r[0].style.removeAttribute("filter") } var b, c, g = y.length, h, i = "frameBorder", k = "allowTransparency", l, o, p; if (!S) return; l = function () { clearTimeout(V), C.hide(), bb(j, K.onComplete) }, n && R && A.fadeIn(100), D.html(K.title).add(A).show(); if (g > 1) { typeof K.current == "string" && E.html(K.current.replace("{current}", Q + 1).replace("{total}", g)).show(), G[K.loop || Q < g - 1 ? "show" : "hide"]().html(K.next), H[K.loop || Q ? "show" : "hide"]().html(K.previous), K.slideshow && F.show(); if (K.preloading) { b = [Z(-1), Z(1)]; while (c = y[b.pop()]) o = a.data(c, e).href || c.href, a.isFunction(o) && (o = o.call(c)), _(o) && (p = new Image, p.src = o) } } else J.hide(); K.iframe ? (h = Y("iframe")[0], i in h && (h[i] = 0), k in h && (h[k] = "true"), h.name = f + +(new Date), K.fastIframe ? l() : a(h).one("load", l), h.src = K.href, K.scrolling || (h.scrolling = "no"), a(h).addClass(f + "Iframe").appendTo(A).one(m, function () { h.src = "//about:blank" })) : l(), K.transition === "fade" ? r.fadeTo(d, 1, q) : q() }, K.transition === "fade" ? r.fadeTo(d, 0, function () { W.position(0, c) }) : W.position(d, c) }, W.load = function (b) { var c, d, e = W.prep; T = !0, R = !1, P = y[Q], b || ba(), bb(m), bb(i, K.onLoad), K.h = K.height ? $(K.height, "y") - N - L : K.innerHeight && $(K.innerHeight, "y"), K.w = K.width ? $(K.width, "x") - O - M : K.innerWidth && $(K.innerWidth, "x"), K.mw = K.w, K.mh = K.h, K.maxWidth && (K.mw = $(K.maxWidth, "x") - O - M, K.mw = K.w && K.w < K.mw ? K.w : K.mw), K.maxHeight && (K.mh = $(K.maxHeight, "y") - N - L, K.mh = K.h && K.h < K.mh ? K.h : K.mh), c = K.href, V = setTimeout(function () { C.show() }, 100), K.inline ? (Y(X).hide().insertBefore(a(c)[0]).one(m, function () { a(this).replaceWith(A.children()) }), e(a(c))) : K.iframe ? e(" ") : K.html ? e(K.html) : _(c) ? (a(R = new Image).addClass(f + "Photo").error(function () { K.title = !1, e(Y(X, "Error").text("This image could not be loaded")) }).load(function () { var a; R.onload = null, K.scalePhotos && (d = function () { R.height -= R.height * a, R.width -= R.width * a }, K.mw && R.width > K.mw && (a = (R.width - K.mw) / R.width, d()), K.mh && R.height > K.mh && (a = (R.height - K.mh) / R.height, d())), K.h && (R.style.marginTop = Math.max(K.h - R.height, 0) / 2 + "px"), y[1] && (Q < y.length - 1 || K.loop) && (R.style.cursor = "pointer", R.onclick = function () { W.next() }), n && (R.style.msInterpolationMode = "bicubic"), setTimeout(function () { e(R) }, 1) }), setTimeout(function () { R.src = c }, 1)) : c && B.load(c, K.data, function (b, c, d) { e(c === "error" ? Y(X, "Error").text("Request unsuccessful: " + d.statusText) : a(this).contents()) }) }, W.next = function () { !T && y[1] && (Q < y.length - 1 || K.loop) && (Q = Z(1), W.load()) }, W.prev = function () { !T && y[1] && (Q || K.loop) && (Q = Z(-1), W.load()) }, W.close = function () { S && !U && (U = !0, S = !1, bb(k, K.onCleanup), z.unbind("." + f + " ." + p), q.fadeTo(200, 0), r.stop().fadeTo(300, 0, function () { r.add(q).css({ opacity: 1, cursor: "auto" }).hide(), bb(m), A.remove(), setTimeout(function () { U = !1, bb(l, K.onClosed) }, 1) })) }, W.element = function () { return a(P) }, W.settings = d, a("." + g, b).live("click", function (a) { a.which > 1 || a.shiftKey || a.altKey || a.metaKey || (a.preventDefault(), bd(this)) }), W.init() })(jQuery, document, this);

/*
    * jReject (jQuery Browser Rejection Plugin)
    * Version 0.7-Beta
    * URL: http://jreject.turnwheel.com/
    * Description: jReject gives you a customizable and easy solution to reject/allowing specific browsers access to your pages
    * Author: Steven Bower (TurnWheel Designs) http://turnwheel.com/
    * Copyright: Copyright (c) 2009-2010 Steven Bower under dual MIT/GPL license.
    * Depends On: jQuery Browser Plugin (http://jquery.thewikies.com/browser)
 */
(function(b){b.reject=function(a){a=b.extend(true,{reject:{all:false,msie5:true,msie6:true},display:[],browserInfo:{firefox:{text:"Firefox 3.5+",url:"http://www.mozilla.com/firefox/"},safari:{text:"Safari 4",url:"http://www.apple.com/safari/download/"},opera:{text:"Opera 10.5",url:"http://www.opera.com/download/"},chrome:{text:"Chrome 5",url:"http://www.google.com/chrome/"},msie:{text:"Internet Explorer 8",url:"http://www.microsoft.com/windows/Internet-explorer/"},gcf:{text:"Google Chrome Frame",
url:"http://code.google.com/chrome/chromeframe/",allow:{all:false,msie:true}}},header:"Did you know that your Internet Browser is out of date?",paragraph1:"Your browser is out of date, and may not be compatible with our website. A list of the most popular web browsers can be found below.",paragraph2:"Just click on the icons to get to the download page",close:true,closeMessage:"By closing this window you acknowledge that your experience on this website may be degraded",closeLink:"Close This Window",
closeURL:"#",closeESC:true,closeCookie:false,cookieSettings:{path:"/",expires:0},imagePath:"/images/",overlayBgColor:"#000",overlayOpacity:0.8,fadeInTime:"fast",fadeOutTime:"fast"},a);if(a.display.length<1)a.display=["firefox","chrome","msie","safari","opera","gcf"];b.isFunction(a.beforeReject)&&a.beforeReject(a);if(!a.close)a.closeESC=false;var d=function(c){return(c.all?true:false)||(c[b.os.name]?true:false)||(c[b.layout.name]?true:false)||(c[b.browser.name]?true:false)||(c[b.browser.className]?
true:false)};if(!d(a.reject)){b.isFunction(a.onFail)&&a.onFail(a);return false}if(a.close&&a.closeCookie){var f="jreject-close",h=function(c,g){if(typeof g!="undefined"){var e="";if(a.cookieSettings.expires!=0){e=new Date;e.setTime(e.getTime()+a.cookieSettings.expires);e="; expires="+e.toGMTString()}var k=a.cookieSettings.path||"/";document.cookie=c+"="+encodeURIComponent(g==null?"":g)+e+"; path="+k}else{k=null;if(document.cookie&&document.cookie!="")for(var o=document.cookie.split(";"),n=0;n<o.length;++n){e=
b.trim(o[n]);if(e.substring(0,c.length+1)==c+"="){k=decodeURIComponent(e.substring(c.length+1));break}}return k}};if(h(f)!=null)return false}var i='<div id="jr_overlay"></div><div id="jr_wrap"><div id="jr_inner"><h1 id="jr_header">'+a.header+"</h1>"+(a.paragraph1===""?"":"<p>"+a.paragraph1+"</p>")+(a.paragraph2===""?"":"<p>"+a.paragraph2+"</p>")+"<ul>",l=0;for(var s in a.display){var p=a.display[s],j=a.browserInfo[p]||false;if(!(!j||j.allow!=undefined&&!d(j.allow))){i+='<li id="jr_'+p+'"><div class="jr_icon"></div><div><a href="'+
(j.url||"#")+'">'+(j.text||"Unknown")+"</a></div></li>";++l}}i+='</ul><div id="jr_close">'+(a.close?'<a href="'+a.closeURL+'">'+a.closeLink+"</a><p>"+a.closeMessage+"</p>":"")+"</div></div></div>";var m=b("<div>"+i+"</div>");d=q();i=r();m.bind("closejr",function(){if(!a.close)return false;b.isFunction(a.beforeClose)&&a.beforeClose(a);b(this).unbind("closejr");b("#jr_overlay,#jr_wrap").fadeOut(a.fadeOutTime,function(){b(this).remove();b.isFunction(a.afterClose)&&a.afterClose(a)});b("embed, object, select, applet").show();
a.closeCookie&&h(f,"true");return true});m.find("#jr_overlay").css({width:d[0],height:d[1],position:"absolute",top:0,left:0,background:a.overlayBgColor,zIndex:200,opacity:a.overlayOpacity,padding:0,margin:0}).next("#jr_wrap").css({position:"absolute",width:"100%",top:i[1]+d[3]/4,left:i[0],zIndex:300,textAlign:"center",padding:0,margin:0}).children("#jr_inner").css({background:"#FFF",border:"1px solid #CCC",fontFamily:'"Lucida Grande","Lucida Sans Unicode",Arial,Verdana,sans-serif',color:"#4F4F4F",
margin:"0 auto",position:"relative",height:"auto",minWidth:l*100,maxWidth:l*140,width:b.layout.name=="trident"?l*155:"auto",padding:20,fontSize:12}).children("#jr_header").css({display:"block",fontSize:"1.3em",marginBottom:"0.5em",color:"#333",fontFamily:"Helvetica,Arial,sans-serif",fontWeight:"bold",textAlign:"left",padding:5,margin:0}).nextAll("p").css({textAlign:"left",padding:5,margin:0}).siblings("ul").css({listStyleImage:"none",listStylePosition:"outside",listStyleType:"none",margin:0,padding:0}).children("li").css({background:'transparent url("'+
a.imagePath+'background_browser.gif") no-repeat scroll left top',cusor:"pointer","float":"left",width:120,height:122,margin:"0 10px 10px 10px",padding:0,textAlign:"center"}).children(".jr_icon").css({width:100,height:100,margin:"1px auto",padding:0,background:"transparent no-repeat scroll left top",cursor:"pointer"}).each(function(){var c=b(this);c.css("background","transparent url("+a.imagePath+"browser_"+c.parent("li").attr("id").replace(/jr_/,"")+".gif) no-repeat scroll left top");c.click(function(){window.open(b(this).next("div").children("a").attr("href"),
"jr_"+Math.round(Math.random()*11));return false})}).siblings("div").css({color:"#808080",fontSize:"0.8em",height:18,lineHeight:"17px",margin:"1px auto",padding:0,width:118,textAlign:"center"}).children("a").css({color:"#333",textDecoration:"none",padding:0,margin:0}).hover(function(){b(this).css("textDecoration","underline")},function(){b(this).css("textDecoration","none")}).click(function(){window.open(b(this).attr("href"),"jr_"+Math.round(Math.random()*11));return false}).parents("#jr_inner").children("#jr_close").css({margin:"0 0 0 50px",
clear:"both",textAlign:"left",padding:0,margin:0}).children("a").css({color:"#000",display:"block",width:"auto",margin:0,padding:0,textDecoration:"underline"}).click(function(){b(this).trigger("closejr");if(a.closeURL==="#")return false}).nextAll("p").css({padding:"10px 0 0 0",margin:0});b("#jr_overlay").focus();b("embed, object, select, applet").hide();b("body").append(m.hide().fadeIn(a.fadeInTime));b(window).bind("resize scroll",function(){var c=q();b("#jr_overlay").css({width:c[0],height:c[1]});
var g=r();b("#jr_wrap").css({top:g[1]+c[3]/4,left:g[0]})});a.closeESC&&b(document).bind("keydown",function(c){c.keyCode==27&&m.trigger("closejr")});b.isFunction(a.afterReject)&&a.afterReject(a);return true};var q=function(){var a=window.innerWidth&&window.scrollMaxX?window.innerWidth+window.scrollMaxX:document.body.scrollWidth>document.body.offsetWidth?document.body.scrollWidth:document.body.offsetWidth,d=window.innerHeight&&window.scrollMaxY?window.innerHeight+window.scrollMaxY:document.body.scrollHeight>
document.body.offsetHeight?document.body.scrollHeight:document.body.offsetHeight,f=window.innerWidth?window.innerWidth:document.documentElement&&document.documentElement.clientWidth?document.documentElement.clientWidth:document.body.clientWidth,h=window.innerHeight?window.innerHeight:document.documentElement&&document.documentElement.clientHeight?document.documentElement.clientHeight:document.body.clientHeight;return[a<f?a:f,d<h?h:d,f,h]},r=function(){return[window.pageXOffset?window.pageXOffset:
document.documentElement&&document.documentElement.scrollTop?document.documentElement.scrollLeft:document.body.scrollLeft,window.pageYOffset?window.pageYOffset:document.documentElement&&document.documentElement.scrollTop?document.documentElement.scrollTop:document.body.scrollTop]}})(jQuery);

/*
    * jQuery Browser Plugin
    * Version 2.3
    * 2008-09-17 19:27:05
    * URL: http://jquery.thewikies.com/browser
    * Description: jQuery Browser Plugin extends browser detection capabilities and can assign browser selectors to CSS classes.
    * Author: Nate Cavanaugh, Minhchau Dang, & Jonathan Neal
    * Copyright: Copyright (c) 2008 Jonathan Neal under dual MIT/GPL license.
*/
(function($){$.browserTest=function(a,z){var u='unknown',x='X',m=function(r,h){for(var i=0;i<h.length;i=i+1){r=r.replace(h[i][0],h[i][1]);}return r;},c=function(i,a,b,c){var r={name:m((a.exec(i)||[u,u])[1],b)};r[r.name]=true;r.version=(c.exec(i)||[x,x,x,x])[3];if(r.name.match(/safari/)&&r.version>400){r.version='2.0';}if(r.name==='presto'){r.version=($.browser.version>9.27)?'futhark':'linear_b';}r.versionNumber=parseFloat(r.version,10)||0;r.versionX=(r.version!==x)?(r.version+'').substr(0,1):x;r.className=r.name+r.versionX;return r;};a=(a.match(/Opera|Navigator|Minefield|KHTML|Chrome/)?m(a,[[/(Firefox|MSIE|KHTML,\slike\sGecko|Konqueror)/,''],['Chrome Safari','Chrome'],['KHTML','Konqueror'],['Minefield','Firefox'],['Navigator','Netscape']]):a).toLowerCase();$.browser=$.extend((!z)?$.browser:{},c(a,/(camino|chrome|firefox|netscape|konqueror|lynx|msie|opera|safari)/,[],/(camino|chrome|firefox|netscape|netscape6|opera|version|konqueror|lynx|msie|safari)(\/|\s)([a-z0-9\.\+]*?)(\;|dev|rel|\s|$)/));$.layout=c(a,/(gecko|konqueror|msie|opera|webkit)/,[['konqueror','khtml'],['msie','trident'],['opera','presto']],/(applewebkit|rv|konqueror|msie)(\:|\/|\s)([a-z0-9\.]*?)(\;|\)|\s)/);$.os={name:(/(win|mac|linux|sunos|solaris|iphone)/.exec(navigator.platform.toLowerCase())||[u])[0].replace('sunos','solaris')};if(!z){$('html').addClass([$.os.name,$.browser.name,$.browser.className,$.layout.name,$.layout.className].join(' '));}};$.browserTest(navigator.userAgent);})(jQuery);
