// ColorBox v1.3.17.2 - 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 bc(b){if(!U){P=b;_();y=a(P);Q=0;if(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);if(Q===-1){y=y.add(P);Q=y.length-1}}if(!S){S=T=true;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=Z(K.initialWidth,"x");K.h=Z(K.initialHeight,"y");X.position();if(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)}ba(h,K.onOpen);J.add(D).hide();I.html(K.close).show()}X.load(true)}}function bb(){var a,b=f+"Slideshow_",c="click."+f,d,e,g;if(K.slideshow&&y[1]){d=function(){F.text(K.slideshowStop).unbind(c).bind(j,function(){if(Q<y.length-1||K.loop){a=setTimeout(X.next,K.slideshowSpeed)}}).bind(i,function(){clearTimeout(a)}).one(c+" "+k,e);r.removeClass(b+"off").addClass(b+"on");a=setTimeout(X.next,K.slideshowSpeed)};e=function(){clearTimeout(a);F.text(K.slideshowStart).unbind([j,i,k,c].join(" ")).one(c,d);r.removeClass(b+"on").addClass(b+"off")};if(K.slideshowAuto){d()}else{e()}}else{r.removeClass(b+"off "+b+"on")}}function ba(b,c){if(c){c.call(P)}a.event.trigger(b)}function _(b){K=a.extend({},a.data(P,e));for(b in K){if(a.isFunction(K[b])&&b.substring(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;if(typeof K.href==="string"){K.href=a.trim(K.href)}}function $(a){return K.photo||/\.(gif|png|jpg|jpeg|bmp)(?:\?([^#]*))?(?:#(\.*))?$/i.test(a)}function Z(a,b){return Math.round((/%/.test(a)?(b==="x"?z.width():z.height())/100:1)*parseInt(a,10))}function Y(c,d,e){e=b.createElement("div");if(c){e.id=f+c}e.style.cssText=d||"";return a(e)}var d={transition:"elastic",speed:300,width:false,initialWidth:"600",innerWidth:false,maxWidth:false,height:false,initialHeight:"450",innerHeight:false,maxHeight:false,scalePhotos:true,scrolling:true,inline:false,html:false,iframe:false,fastIframe:true,photo:false,href:false,title:false,rel:false,opacity:.9,preloading:true,current:"image {current} of {total}",previous:"previous",next:"next",close:"close",open:false,returnFocus:true,loop:true,slideshow:false,slideshowAuto:true,slideshowSpeed:2500,slideshowStart:"start slideshow",slideshowStop:"stop slideshow",onOpen:false,onLoad:false,onComplete:false,onCleanup:false,onClosed:false,overlayClose:true,escKey:true,arrowKey:true,top:false,bottom:false,left:false,right:false,fixed:false,data:false},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;X=a.fn[e]=a[e]=function(b,c){var f=this;b=b||{};if(!f[0]){if(f.selector){return f}f=a("<a/>");b.open=true}if(c){b.onComplete=c}f.each(function(){a.data(this,e,a.extend({},a.data(this,e)||d,b));a(this).addClass(g)});if(a.isFunction(b.open)&&b.open.call(f)||b.open){bc(f[0])}return f};X.init=function(){z=a(c);r=Y().attr({id:e,"class":n?f+(o?"IE6":"IE"):""});q=Y("Overlay",o?"position:absolute":"").hide().append(E=Y("Current"),G=Y("Next"),H=Y("Previous"),F=Y("Slideshow").bind(h,bb),I=Y("Close"));s=Y("Wrapper");t=Y("Content").append(A=Y("LoadedContent","width:0; height:0; overflow:hidden"),C=Y("LoadingOverlay").add(Y("LoadingGraphic")),D=Y("Title"));s.append(Y().append(Y("TopLeft"),u=Y("TopCenter"),Y("TopRight")),Y(false,"clear:left").append(v=Y("MiddleLeft"),t,w=Y("MiddleRight")),Y(false,"clear:left").append(Y("BottomLeft"),x=Y("BottomCenter"),Y("BottomRight"))).children().children().css({"float":"left"});B=Y(false,"position:absolute; width:9999px; visibility:hidden; display:none");a("body").prepend(q,r.append(s,B));t.children().hover(function(){a(this).addClass("hover")},function(){a(this).removeClass("hover")}).addClass("hover");L=u.height()+x.height()+t.outerHeight(true)-t.height();M=v.width()+w.width()+t.outerWidth(true)-t.width();N=A.outerHeight(true);O=A.outerWidth(true);r.css({"padding-bottom":L,"padding-right":M}).hide();G.click(function(){X.next()});H.click(function(){X.prev()});I.click(function(){X.close()});J=G.add(H).add(E).add(F);t.children().removeClass("hover");q.click(function(){if(K.overlayClose){X.close()}});a(b).bind("keydown."+f,function(a){var b=a.keyCode;if(S&&K.escKey&&b===27){a.preventDefault();X.close()}if(S&&K.arrowKey&&y[1]){if(b===37){a.preventDefault();H.click()}else if(b===39){a.preventDefault();G.click()}}})};X.remove=function(){r.add(q).remove();a("."+g).removeData(e).removeClass(g)};X.position=function(a,c){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 d=0,e=0;z.unbind("resize."+f);r.hide();if(K.fixed&&!o){r.css({position:"fixed"})}else{d=z.scrollTop();e=z.scrollLeft();r.css({position:"absolute"})}if(K.right!==false){e+=Math.max(z.width()-K.w-O-M-Z(K.right,"x"),0)}else if(K.left!==false){e+=Z(K.left,"x")}else{e+=Math.round(Math.max(z.width()-K.w-O-M,0)/2)}if(K.bottom!==false){d+=Math.max(b.documentElement.clientHeight-K.h-N-L-Z(K.bottom,"y"),0)}else if(K.top!==false){d+=Z(K.top,"y")}else{d+=Math.round(Math.max(b.documentElement.clientHeight-K.h-N-L,0)/2)}r.show();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:d,left:e},{duration:a,complete:function(){g(this);T=false;s[0].style.width=K.w+O+M+"px";s[0].style.height=K.h+N+L+"px";if(c){c()}setTimeout(function(){z.bind("resize."+f,X.position)},1)},step:function(){g(this)}})};X.resize=function(a){if(S){a=a||{};if(a.width){K.w=Z(a.width,"x")-O-M}if(a.innerWidth){K.w=Z(a.innerWidth,"x")}A.css({width:K.w});if(a.height){K.h=Z(a.height,"y")-N-L}if(a.innerHeight){K.h=Z(a.innerHeight,"y")}if(!a.innerHeight&&!a.height){var b=A.wrapInner("<div style='overflow:auto'></div>").children();K.h=b.height();b.replaceWith(b.children())}A.css({height:K.h});X.position(K.transition==="none"?0:K.speed)}};X.prep=function(b){function h(){K.h=K.h||A.height();K.h=K.mh&&K.mh<K.h?K.mh:K.h;return K.h}function g(){K.w=K.w||A.width();K.w=K.mw&&K.mw<K.w?K.mw:K.w;return K.w}if(!S){return}var c,d=K.transition==="none"?0:K.speed;A.remove();A=Y("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"});if(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 o(){if(n){r[0].style.removeAttribute("filter")}}var b,c,g,h,i=y.length,k,l;if(!S){return}l=function(){clearTimeout(W);C.hide();ba(j,K.onComplete)};if(n){if(R){A.fadeIn(100)}}D.html(K.title).add(A).show();if(i>1){if(typeof K.current==="string"){E.html(K.current.replace("{current}",Q+1).replace("{total}",i)).show()}G[K.loop||Q<i-1?"show":"hide"]().html(K.next);H[K.loop||Q?"show":"hide"]().html(K.previous);b=Q?y[Q-1]:y[i-1];g=Q<i-1?y[Q+1]:y[0];if(K.slideshow){F.show()}if(K.preloading){h=a.data(g,e).href||g.href;c=a.data(b,e).href||b.href;h=a.isFunction(h)?h.call(g):h;c=a.isFunction(c)?c.call(b):c;if($(h)){a("<img/>")[0].src=h}if($(c)){a("<img/>")[0].src=c}}}else{J.hide()}if(K.iframe){k=a("<iframe/>").addClass(f+"Iframe")[0];if(K.fastIframe){l()}else{a(k).one("load",l)}k.name=f+ +(new Date);k.src=K.href;if(!K.scrolling){k.scrolling="no"}if(n){k.frameBorder=0;k.allowTransparency="true"}a(k).appendTo(A).one(m,function(){k.src="//about:blank"})}else{l()}if(K.transition==="fade"){r.fadeTo(d,1,o)}else{o()}};if(K.transition==="fade"){r.fadeTo(d,0,function(){X.position(0,c)})}else{X.position(d,c)}};X.load=function(b){var c,d,e=X.prep;T=true;R=false;P=y[Q];if(!b){_()}ba(m);ba(i,K.onLoad);K.h=K.height?Z(K.height,"y")-N-L:K.innerHeight&&Z(K.innerHeight,"y");K.w=K.width?Z(K.width,"x")-O-M:K.innerWidth&&Z(K.innerWidth,"x");K.mw=K.w;K.mh=K.h;if(K.maxWidth){K.mw=Z(K.maxWidth,"x")-O-M;K.mw=K.w&&K.w<K.mw?K.w:K.mw}if(K.maxHeight){K.mh=Z(K.maxHeight,"y")-N-L;K.mh=K.h&&K.h<K.mh?K.h:K.mh}c=K.href;W=setTimeout(function(){C.show()},100);if(K.inline){Y().hide().insertBefore(a(c)[0]).one(m,function(){a(this).replaceWith(A.children())});e(a(c))}else if(K.iframe){e(" ")}else if(K.html){e(K.html)}else if($(c)){a(R=new Image).addClass(f+"Photo").error(function(){K.title=false;e(Y("Error").text("This image could not be loaded"))}).load(function(){var a;R.onload=null;if(K.scalePhotos){d=function(){R.height-=R.height*a;R.width-=R.width*a};if(K.mw&&R.width>K.mw){a=(R.width-K.mw)/R.width;d()}if(K.mh&&R.height>K.mh){a=(R.height-K.mh)/R.height;d()}}if(K.h){R.style.marginTop=Math.max(K.h-R.height,0)/2+"px"}if(y[1]&&(Q<y.length-1||K.loop)){R.style.cursor="pointer";R.onclick=function(){X.next()}}if(n){R.style.msInterpolationMode="bicubic"}setTimeout(function(){e(R)},1)});setTimeout(function(){R.src=c},1)}else if(c){B.load(c,K.data,function(b,c,d){e(c==="error"?Y("Error").text("Request unsuccessful: "+d.statusText):a(this).contents())})}};X.next=function(){if(!T&&y[1]&&(Q<y.length-1||K.loop)){Q=Q<y.length-1?Q+1:0;X.load()}};X.prev=function(){if(!T&&y[1]&&(Q||K.loop)){Q=Q?Q-1:y.length-1;X.load()}};X.close=function(){if(S&&!U){U=true;S=false;ba(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();ba(m);A.remove();setTimeout(function(){U=false;ba(l,K.onClosed)},1)})}};X.element=function(){return a(P)};X.settings=d;V=function(a){if(!(a.button!==0&&typeof a.button!=="undefined"||a.ctrlKey||a.shiftKey||a.altKey)){a.preventDefault();bc(this)}};if(a.fn.delegate){a(b).delegate("."+g,"click",V)}else{a("."+g).live("click",V)}a(X.init)})(jQuery,document,this);
(function ($) {

Drupal.behaviors.initColorbox = {
  attach: function (context, settings) {
    if (!$.isFunction($.colorbox)) {
      return;
    }
    $('a, area, input', context)
      .filter('.colorbox')
      .once('init-colorbox-processed')
      .colorbox(settings.colorbox);
  }
};

{
  $(document).bind('cbox_complete', function () {
    Drupal.attachBehaviors('#cboxLoadedContent');
  });
}

})(jQuery);
;
(function ($) {

Drupal.behaviors.initColorboxLoad = {
  attach: function (context, settings) {
    if (!$.isFunction($.colorbox)) {
      return;
    }
    $.urlParams = function (url) {
      var p = {},
          e,
          a = /\+/g,  // Regex for replacing addition symbol with a space
          r = /([^&=]+)=?([^&]*)/g,
          d = function (s) { return decodeURIComponent(s.replace(a, ' ')); },
          q = url.split('?');
      while (e = r.exec(q[1])) {
        e[1] = d(e[1]);
        e[2] = d(e[2]);
        switch (e[2].toLowerCase()) {
          case 'true':
          case 'yes':
            e[2] = true;
            break;
          case 'false':
          case 'no':
            e[2] = false;
            break;
        }
        if (e[1] == 'width') { e[1] = 'innerWidth'; }
        if (e[1] == 'height') { e[1] = 'innerHeight'; }
        p[e[1]] = e[2];
      }
      return p;
    };
    $('a, area, input', context)
      .filter('.colorbox-load')
      .once('init-colorbox-load-processed', function () {
        var params = $.urlParams($(this).attr('href'));
        $(this).colorbox($.extend({}, settings.colorbox, params));
      });
  }
};

})(jQuery);
;
(function ($) {

$(document).ready(function() {

  // Accepts a string; returns the string with regex metacharacters escaped. The returned string
  // can safely be used at any point within a regex to match the provided literal string. Escaped
  // characters are [ ] { } ( ) * + ? - . , \ ^ $ # and whitespace. The character | is excluded
  // in this function as it's used to separate the domains names.
  RegExp.escapeDomains = function(text) {
    return (text) ? text.replace(/[-[\]{}()*+?.,\\^$#\s]/g, "\\$&") : '';
  }

  // Attach onclick event to document only and catch clicks on all elements.
  $(document.body).click(function(event) {
    // Catch the closest surrounding link of a clicked element.
    $(event.target).closest("a,area").each(function() {

      var ga = Drupal.settings.googleanalytics;
      // Expression to check for absolute internal links.
      var isInternal = new RegExp("^(https?):\/\/" + window.location.host, "i");
      // Expression to check for special links like gotwo.module /go/* links.
      var isInternalSpecial = new RegExp("(\/go\/.*)$", "i");
      // Expression to check for download links.
      var isDownload = new RegExp("\\.(" + ga.trackDownloadExtensions + ")$", "i");
      // Expression to check for the sites cross domains.
      var isCrossDomain = new RegExp("^(https?|ftp|news|nntp|telnet|irc|ssh|sftp|webcal):\/\/.*(" + RegExp.escapeDomains(ga.trackCrossDomains) + ")", "i");

      // Is the clicked URL internal?
      if (isInternal.test(this.href)) {
        // Is download tracking activated and the file extension configured for download tracking?
        if (ga.trackDownload && isDownload.test(this.href)) {
          // Download link clicked.
          var extension = isDownload.exec(this.href);
          _gaq.push(["_trackEvent", "Downloads", extension[1].toUpperCase(), this.href.replace(isInternal, '')]);
        }
        else if (isInternalSpecial.test(this.href)) {
          // Keep the internal URL for Google Analytics website overlay intact.
          _gaq.push(["_trackPageview", this.href.replace(isInternal, '')]);
        }
      }
      else {
        if (ga.trackMailto && $(this).is("a[href^=mailto:],area[href^=mailto:]")) {
          // Mailto link clicked.
          _gaq.push(["_trackEvent", "Mails", "Click", this.href.substring(7)]);
        }
        else if (ga.trackOutbound && this.href) {
          if (ga.trackDomainMode == 2 && isCrossDomain.test(this.href)) {
            // Top-level cross domain clicked. document.location is handled by _link internally.
            _gaq.push(["_link", this.href]);
          }
          else if (ga.trackOutboundAsPageview) {
            // Track all external links as page views after URL cleanup.
            // Currently required, if click should be tracked as goal.
            _gaq.push(["_trackPageview", '/outbound/' + this.href.replace(/^(https?|ftp|news|nntp|telnet|irc|ssh|sftp|webcal):\/\//i, '').split('/').join('--')]);
          }
          else {
            // External link clicked.
            _gaq.push(["_trackEvent", "Outbound links", "Click", this.href]);
          }
        }
      }
    });
  });
});

})(jQuery);
;

