(function ($) {

/**
 * A progressbar object. Initialized with the given id. Must be inserted into
 * the DOM afterwards through progressBar.element.
 *
 * method is the function which will perform the HTTP request to get the
 * progress bar state. Either "GET" or "POST".
 *
 * e.g. pb = new progressBar('myProgressBar');
 *      some_element.appendChild(pb.element);
 */
Drupal.progressBar = function (id, updateCallback, method, errorCallback) {
  var pb = this;
  this.id = id;
  this.method = method || 'GET';
  this.updateCallback = updateCallback;
  this.errorCallback = errorCallback;

  // The WAI-ARIA setting aria-live="polite" will announce changes after users
  // have completed their current activity and not interrupt the screen reader.
  this.element = $('<div class="progress" aria-live="polite"></div>').attr('id', id);
  this.element.html('<div class="bar"><div class="filled"></div></div>' +
                    '<div class="percentage"></div>' +
                    '<div class="message">&nbsp;</div>');
};

/**
 * Set the percentage and status message for the progressbar.
 */
Drupal.progressBar.prototype.setProgress = function (percentage, message) {
  if (percentage >= 0 && percentage <= 100) {
    $('div.filled', this.element).css('width', percentage + '%');
    $('div.percentage', this.element).html(percentage + '%');
  }
  $('div.message', this.element).html(message);
  if (this.updateCallback) {
    this.updateCallback(percentage, message, this);
  }
};

/**
 * Start monitoring progress via Ajax.
 */
Drupal.progressBar.prototype.startMonitoring = function (uri, delay) {
  this.delay = delay;
  this.uri = uri;
  this.sendPing();
};

/**
 * Stop monitoring progress via Ajax.
 */
Drupal.progressBar.prototype.stopMonitoring = function () {
  clearTimeout(this.timer);
  // This allows monitoring to be stopped from within the callback.
  this.uri = null;
};

/**
 * Request progress data from server.
 */
Drupal.progressBar.prototype.sendPing = function () {
  if (this.timer) {
    clearTimeout(this.timer);
  }
  if (this.uri) {
    var pb = this;
    // When doing a post request, you need non-null data. Otherwise a
    // HTTP 411 or HTTP 406 (with Apache mod_security) error may result.
    $.ajax({
      type: this.method,
      url: this.uri,
      data: '',
      dataType: 'json',
      success: function (progress) {
        // Display errors.
        if (progress.status == 0) {
          pb.displayError(progress.data);
          return;
        }
        // Update display.
        pb.setProgress(progress.percentage, progress.message);
        // Schedule next timer.
        pb.timer = setTimeout(function () { pb.sendPing(); }, pb.delay);
      },
      error: function (xmlhttp) {
        pb.displayError(Drupal.ajaxError(xmlhttp, pb.uri));
      }
    });
  }
};

/**
 * Display errors on the page.
 */
Drupal.progressBar.prototype.displayError = function (string) {
  var error = $('<div class="messages error"></div>').html(string);
  $(this.element).before(error).hide();

  if (this.errorCallback) {
    this.errorCallback(this);
  }
};

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

})(jQuery);
;
/**
* hoverIntent r6 // 2011.02.26 // jQuery 1.5.1+
* <http://cherne.net/brian/resources/jquery.hoverIntent.html>
* 
* @param  f  onMouseOver function || An object with configuration options
* @param  g  onMouseOut function  || Nothing (use configuration options object)
* @author    Brian Cherne brian(at)cherne(dot)net
*/
(function($){$.fn.hoverIntent=function(f,g){var cfg={sensitivity:7,interval:100,timeout:0};cfg=$.extend(cfg,g?{over:f,out:g}:f);var cX,cY,pX,pY;var track=function(ev){cX=ev.pageX;cY=ev.pageY};var compare=function(ev,ob){ob.hoverIntent_t=clearTimeout(ob.hoverIntent_t);if((Math.abs(pX-cX)+Math.abs(pY-cY))<cfg.sensitivity){$(ob).unbind("mousemove",track);ob.hoverIntent_s=1;return cfg.over.apply(ob,[ev])}else{pX=cX;pY=cY;ob.hoverIntent_t=setTimeout(function(){compare(ev,ob)},cfg.interval)}};var delay=function(ev,ob){ob.hoverIntent_t=clearTimeout(ob.hoverIntent_t);ob.hoverIntent_s=0;return cfg.out.apply(ob,[ev])};var handleHover=function(e){var ev=jQuery.extend({},e);var ob=this;if(ob.hoverIntent_t){ob.hoverIntent_t=clearTimeout(ob.hoverIntent_t)}if(e.type=="mouseenter"){pX=ev.pageX;pY=ev.pageY;$(ob).bind("mousemove",track);if(ob.hoverIntent_s!=1){ob.hoverIntent_t=setTimeout(function(){compare(ev,ob)},cfg.interval)}}else{$(ob).unbind("mousemove",track);if(ob.hoverIntent_s==1){ob.hoverIntent_t=setTimeout(function(){delay(ev,ob)},cfg.timeout)}}};return this.bind('mouseenter',handleHover).bind('mouseleave',handleHover)}})(jQuery);;
/* Copyright (c) 2010 Brandon Aaron (http://brandonaaron.net)
 * Licensed under the MIT License (LICENSE.txt).
 *
 * Version 2.1.2
 */
(function(a){a.fn.bgiframe=(a.browser.msie&&/msie 6\.0/i.test(navigator.userAgent)?function(d){d=a.extend({top:"auto",left:"auto",width:"auto",height:"auto",opacity:true,src:"javascript:false;"},d);var c='<iframe class="bgiframe"frameborder="0"tabindex="-1"src="'+d.src+'"style="display:block;position:absolute;z-index:-1;'+(d.opacity!==false?"filter:Alpha(Opacity='0');":"")+"top:"+(d.top=="auto"?"expression(((parseInt(this.parentNode.currentStyle.borderTopWidth)||0)*-1)+'px')":b(d.top))+";left:"+(d.left=="auto"?"expression(((parseInt(this.parentNode.currentStyle.borderLeftWidth)||0)*-1)+'px')":b(d.left))+";width:"+(d.width=="auto"?"expression(this.parentNode.offsetWidth+'px')":b(d.width))+";height:"+(d.height=="auto"?"expression(this.parentNode.offsetHeight+'px')":b(d.height))+';"/>';return this.each(function(){if(a(this).children("iframe.bgiframe").length===0){this.insertBefore(document.createElement(c),this.firstChild)}})}:function(){return this});a.fn.bgIframe=a.fn.bgiframe;function b(c){return c&&c.constructor===Number?c+"px":c}})(jQuery);;
/*
 * Superfish v1.4.8 - jQuery menu widget
 * Copyright (c) 2008 Joel Birch
 *
 * Dual licensed under the MIT and GPL licenses:
 *   http://www.opensource.org/licenses/mit-license.php
 *   http://www.gnu.org/licenses/gpl.html
 *
 * CHANGELOG: http://users.tpg.com.au/j_birch/plugins/superfish/changelog.txt
 */

(function($){
  $.fn.superfish = function(op){
    var sf = $.fn.superfish,
      c = sf.c,
      $arrow = $(['<span class="',c.arrowClass,'"> &#187;</span>'].join('')),
      over = function(){
        var $$ = $(this), menu = getMenu($$);
        clearTimeout(menu.sfTimer);
        $$.showSuperfishUl().siblings().hideSuperfishUl();
      },
      out = function(){
        var $$ = $(this), menu = getMenu($$), o = sf.op;
        clearTimeout(menu.sfTimer);
        menu.sfTimer=setTimeout(function(){
          o.retainPath=($.inArray($$[0],o.$path)>-1);
          $$.hideSuperfishUl();
          if (o.$path.length && $$.parents(['li.',o.hoverClass].join('')).length<1){over.call(o.$path);}
        },o.delay);
      },
      getMenu = function($menu){
        var menu = $menu.parents(['ul.',c.menuClass,':first'].join(''))[0];
        sf.op = sf.o[menu.serial];
        return menu;
      },
      addArrow = function($a){ $a.addClass(c.anchorClass).append($arrow.clone()); };

    return this.each(function() {
      var s = this.serial = sf.o.length;
      var o = $.extend({},sf.defaults,op);
      o.$path = $('li.'+o.pathClass,this).slice(0,o.pathLevels).each(function(){
        $(this).addClass([o.hoverClass,c.bcClass].join(' '))
          .filter('li:has(ul)').removeClass(o.pathClass);
      });
      sf.o[s] = sf.op = o;

      $('li:has(ul)',this)[($.fn.hoverIntent && !o.disableHI) ? 'hoverIntent' : 'hover'](over,out).each(function() {
        if (o.autoArrows) addArrow( $('>a:first-child',this) );
      })
      .not('.'+c.bcClass)
        .hideSuperfishUl();

      var $a = $('a',this);
      $a.each(function(i){
        var $li = $a.eq(i).parents('li');
        $a.eq(i).focus(function(){over.call($li);}).blur(function(){out.call($li);});
      });
      o.onInit.call(this);

    }).each(function() {
      var menuClasses = [c.menuClass];
      if (sf.op.dropShadows  && !($.browser.msie && $.browser.version < 7)) menuClasses.push(c.shadowClass);
      $(this).addClass(menuClasses.join(' '));
    });
  };

  var sf = $.fn.superfish;
  sf.o = [];
  sf.op = {};
  sf.IE7fix = function(){
    var o = sf.op;
    if ($.browser.msie && $.browser.version > 6 && o.dropShadows && o.animation.opacity!=undefined)
      this.toggleClass(sf.c.shadowClass+'-off');
    };
  sf.c = {
    bcClass: 'sf-breadcrumb',
    menuClass: 'sf-js-enabled',
    anchorClass: 'sf-with-ul',
    arrowClass: 'sf-sub-indicator',
    shadowClass: 'sf-shadow'
  };
  sf.defaults = {
    hoverClass: 'sfHover',
    pathClass: 'overideThisToUse',
    pathLevels: 1,
    delay: 800,
    animation: {opacity:'show'},
    speed: 'normal',
    autoArrows: true,
    dropShadows: true,
    disableHI: false, // true disables hoverIntent detection
    onInit: function(){}, // callback functions
    onBeforeShow: function(){},
    onShow: function(){},
    onHide: function(){}
  };
  $.fn.extend({
    hideSuperfishUl : function(){
      var o = sf.op,
        not = (o.retainPath===true) ? o.$path : '';
      o.retainPath = false;
      var $ul = $(['li.',o.hoverClass].join(''),this).add(this).not(not).removeClass(o.hoverClass)
          .find('>ul').hide().css('visibility','hidden');
      o.onHide.call($ul);
      return this;
    },
    showSuperfishUl : function(){
      var o = sf.op,
        sh = sf.c.shadowClass+'-off',
        $ul = this.addClass(o.hoverClass)
          .find('>ul:hidden').css('visibility','visible');
      sf.IE7fix.call($ul);
      o.onBeforeShow.call($ul);
      $ul.animate(o.animation,o.speed,function(){ sf.IE7fix.call($ul); o.onShow.call($ul); });
      return this;
    }
  });
})(jQuery);;
/*
 * Supersubs v0.2b - jQuery plugin - LAST UPDATE: MARCH 23rd, 2011
 * Copyright (c) 2008 Joel Birch
 *
 * Jan 16th, 2011 - Modified a little in order to work with NavBar menus as well.
 *
 * Dual licensed under the MIT and GPL licenses:
 *   http://www.opensource.org/licenses/mit-license.php
 *   http://www.gnu.org/licenses/gpl.html
 *
 * This plugin automatically adjusts submenu widths of suckerfish-style menus to that of
 * their longest list item children. If you use this, please expect bugs and report them
 * to the jQuery Google Group with the word 'Superfish' in the subject line.
 *
 */

(function($){ // $ will refer to jQuery within this closure

  $.fn.supersubs = function(options){
    var opts = $.extend({}, $.fn.supersubs.defaults, options);
	// return original object to support chaining
    return this.each(function() {
      // cache selections
      var $$ = $(this);
      // support metadata
      var o = $.meta ? $.extend({}, opts, $$.data()) : opts;
      // get the font size of menu.
      // .css('fontSize') returns various results cross-browser, so measure an em dash instead
      var fontsize = $('<li id="menu-fontsize">&#8212;</li>').css({
        'padding' : 0,
        'position' : 'absolute',
        'top' : '-99999em',
        'width' : 'auto'
      }).appendTo($$).width(); //clientWidth is faster, but was incorrect here
      // remove em dash
      $('#menu-fontsize').remove();

      // Jump on level if it's a "NavBar"
      if ($$.hasClass('sf-navbar')) {
        $$ = $('li > ul', $$);
      }
      // cache all ul elements 
      $ULs = $$.find('ul:not(.sf-megamenu)');
      // loop through each ul in menu
      $ULs.each(function(i) {
        // cache this ul
        var $ul = $ULs.eq(i);
        // get all (li) children of this ul
        var $LIs = $ul.children();
        // get all anchor grand-children
        var $As = $LIs.children('a');
        // force content to one line and save current float property
        var liFloat = $LIs.css('white-space','nowrap').css('float');
        // remove width restrictions and floats so elements remain vertically stacked
        var emWidth = $ul.add($LIs).add($As).css({
          'float' : 'none',
          'width'  : 'auto'
        })
        // this ul will now be shrink-wrapped to longest li due to position:absolute
        // so save its width as ems. Clientwidth is 2 times faster than .width() - thanks Dan Switzer
        .end().end()[0].clientWidth / fontsize;
        // add more width to ensure lines don't turn over at certain sizes in various browsers
        emWidth += o.extraWidth;
        // restrict to at least minWidth and at most maxWidth
        if (emWidth > o.maxWidth)    { emWidth = o.maxWidth; }
        else if (emWidth < o.minWidth)  { emWidth = o.minWidth; }
        emWidth += 'em';
        // set ul to width in ems
        $ul.css('width',emWidth);
        // restore li floats to avoid IE bugs
        // set li width to full width of this ul
        // revert white-space to normal
        $LIs.css({
          'float' : liFloat,
          'width' : '100%',
          'white-space' : 'normal'
        })
        // update offset position of descendant ul to reflect new width of parent
        .each(function(){
          var $childUl = $('>ul',this);
          var offsetDirection = $childUl.css('left')!==undefined ? 'left' : 'right';
          $childUl.css(offsetDirection,emWidth);
        });
      });

    });
  };
  // expose defaults
  $.fn.supersubs.defaults = {
    minWidth: 9, // requires em unit.
    maxWidth: 25, // requires em unit.
    extraWidth: 0 // extra width can ensure lines don't sometimes turn over due to slight browser differences in how they round-off values
  };

})(jQuery); // plugin code ends;
/*
* Supposition v0.2 - an optional enhancer for Superfish jQuery menu widget - LAST UPDATE: MARCH 23rd, 2011
*
* Copyright (c) 2008 Joel Birch - based mostly on work by Jesse Klaasse and credit goes largely to him.
* Special thanks to Karl Swedberg for valuable input.
* 
* Dec 28th, 2010 - Modified for the Superfish project for Drupal (http://drupal.org/project/superfish)
*
* jQuery version: 1.3.x or higher.
*
* Dual licensed under the MIT and GPL licenses:
* 	http://www.opensource.org/licenses/mit-license.php
* 	http://www.gnu.org/licenses/gpl.html
*/

(function($){
  $.fn.supposition = function(){
    var $w = $(window), /*do this once instead of every onBeforeShow call*/
    _offset = function(dir) {
      return window[dir == 'y' ? 'pageYOffset' : 'pageXOffset']
      || document.documentElement && document.documentElement[dir=='y' ? 'scrollTop' : 'scrollLeft']
      || document.body[dir=='y' ? 'scrollTop' : 'scrollLeft'];
    },
    onHide = function(){
      this.css({Top:'',Right:'',Bottom:'',Left:''});
    },
    onBeforeShow = function(){
      this.each(function(){
        var $u = $(this);
        $u.css('display','block');
        var menuWidth = $u.width(),
        menuParentWidth = $u.closest('li').outerWidth(true),
        menuParentLeft = $u.closest('li').offset().left,
        totalRight = $w.width() + _offset('x'),
        menuRight = $u.offset().left + menuWidth,
        exactMenuWidth = (menuRight > (menuParentWidth + menuParentLeft)) ? menuWidth - (menuRight - (menuParentWidth + menuParentLeft)) : menuWidth;  
        if ($u.parents('.sf-js-enabled').hasClass('rtl')) {
          if (menuParentLeft < exactMenuWidth) {
            $u.css('left', menuParentWidth + 'px');
            $u.css('right', 'auto');
          }
        }
        else {
          if (menuRight > totalRight && menuParentLeft > menuWidth) {
            $u.css('right', menuParentWidth + 'px');
            $u.css('left', 'auto');
          }
        }
        var windowHeight = $w.height(),
        offsetTop = $u.offset().top,
        menuParentHeight = $u.parent().outerHeight(true),
        menuHeight = $u.height(),
        baseline = windowHeight + _offset('y');
        var expandUp = ((offsetTop + menuHeight > baseline) && (offsetTop > menuHeight));
        if (expandUp) {
          $u.css('bottom', menuParentHeight + 'px');
          $u.css('top', 'auto');
        }
        $u.css('display','none');
      });
    };

    return this.each(function() {
    var o = $.fn.superfish.o[this.serial]; /* get this menu's options */

    /* if callbacks already set, store them */
    var _onBeforeShow = o.onBeforeShow,
    _onHide = o.onHide;

    $.extend($.fn.superfish.o[this.serial],{
    onBeforeShow: function() {
    onBeforeShow.call(this); /* fire our Supposition callback */
    _onBeforeShow.call(this); /* fire stored callbacks */
    },
    onHide: function() {
    onHide.call(this); /* fire our Supposition callback */
    _onHide.call(this); /* fire stored callbacks */
    }
    });
    });
  };
})(jQuery);;
/*
 * sf-Touchscreen v1.0b - Provides touchscreen compatibility for the jQuery Superfish plugin. - LAST UPDATE: MARCH 23rd, 2011
 *
 * Developer's notes:
 * Built as a part of the Superfish project for Drupal (http://drupal.org/project/superfish) 
 * Found any bug? have any cool ideas? contact me right away! http://drupal.org/user/619294/contact
 *
 * jQuery version: 1.3.x or higher.
 *
 * Dual licensed under the MIT and GPL licenses:
 *   http://www.opensource.org/licenses/mit-license.php
 *   http://www.gnu.org/licenses/gpl.html
*/

(function($){
  $.fn.sftouchscreen = function() {
    // Return original object to support chaining.
    return this.each( function() {
      // Select hyperlinks from parent menu items.
      $(this).find('li > ul').closest('li').children('a').each( function() {
	    var $item = $(this);
        // No .toggle() here as it's not possible to reset it.
        $item.click( function(event){
	      // Already clicked? proceed to the URI.
          if ($item.hasClass('sf-clicked')) {
            var $uri = $item.attr('href');
            window.location = $uri;
          }
          else {
            event.preventDefault();
            $item.addClass('sf-clicked');
          }
        }).closest('li').mouseleave( function(){
          // So, we reset everything.
          $item.removeClass('sf-clicked');
        });
	  });
    });
  };
})(jQuery);;
/**
 * @license 
 * jQuery Tools @VERSION Tabs- The basics of UI design.
 * 
 * NO COPYRIGHTS OR LICENSES. DO WHAT YOU LIKE.
 * 
 * http://flowplayer.org/tools/tabs/
 *
 * Since: November 2008
 * Date: @DATE 
 */  
(function($) {
    
  // static constructs
  $.tools = $.tools || {version: '@VERSION'};
  
  $.tools.tabs = {
    
    conf: {
      tabs: 'a',
      current: 'current',
      onBeforeClick: null,
      onClick: null, 
      effect: 'default',
      initialIndex: 0,      
      event: 'click',
      rotate: false,
      
      // slide effect
      slideUpSpeed: 400,
      slideDownSpeed: 400,
      
      // 1.2
      history: false
    },
    
    addEffect: function(name, fn) {
      effects[name] = fn;
    }
    
  };
  
  var effects = {
    
    // simple "toggle" effect
    'default': function(i, done) { 
      this.getPanes().hide().eq(i).show();
      done.call();
    }, 
    
    /*
      configuration:
        - fadeOutSpeed (positive value does "crossfading")
        - fadeInSpeed
    */
    fade: function(i, done) {   
      
      var conf = this.getConf(),
         speed = conf.fadeOutSpeed,
         panes = this.getPanes();
      
      // panes = $('div.pane-slider-content')
      if (speed && panes.hasClass('start') == false) {
        panes.fadeOut(speed); 
      } else {
        panes.hide().removeClass('start'); 
      }
      if (panes.eq(i).hasClass('start') == false) {
        panes.eq(i).fadeIn(conf.fadeInSpeed, done); 
      } else {
        panes.eq(i).show().removeClass('start');
      }
    },
    
    // for basic accordions
    slide: function(i, done) {
      var conf = this.getConf();
      
      this.getPanes().slideUp(conf.slideUpSpeed);
      this.getPanes().eq(i).slideDown(conf.slideDownSpeed, done);      
    }, 

    /**
     * AJAX effect
     */
    ajax: function(i, done)  {      
      this.getPanes().eq(0).load(this.getTabs().eq(i).attr("href"), done);  
    }   
  };    
  
  /**
   * Horizontal accordion
   * 
   * @deprecated will be replaced with a more robust implementation
  */
  
  var
    /**
    *   @type {Boolean}
    *
    *   Mutex to control horizontal animation
    *   Disables clicking of tabs while animating
    *   They mess up otherwise as currentPane gets set *after* animation is done
    */
    animating,
    /**
    *   @type {Number}
    *   
    *   Initial width of tab panes
    */
    w;
   
  $.tools.tabs.addEffect("horizontal", function(i, done) {
    if (animating) return;    // don't allow other animations
    
    var nextPane = this.getPanes().eq(i),
        currentPane = this.getCurrentPane();
        
    // store original width of a pane into memory
    w || ( w = this.getPanes().eq(0).width() );
    animating = true;
    
    nextPane.show(); // hidden by default
    
    // animate current pane's width to zero
    // animate next pane's width at the same time for smooth animation
    currentPane.animate({width: 0}, {
      step: function(now){
        nextPane.css("width", w-now);
      },
      complete: function(){
        $(this).hide();
        done.call();
        animating = false;
     }
    });
    // Dirty hack...  onLoad, currentPant will be empty and nextPane will be the first pane
    // If this is the case, manually run callback since the animation never occured, and reset animating
    if (!currentPane.length){ 
      done.call(); 
      animating = false;
    }
  }); 

  
  function Tabs(root, paneSelector, conf) {
    
    var self = this, 
       trigger = root.add(this),
       tabs = root.find(conf.tabs),
       panes = paneSelector.jquery ? paneSelector : root.children(paneSelector),       
       current;
       
    
    // make sure tabs and panes are found
    if (!tabs.length)  { tabs = root.children(); }
    if (!panes.length) { panes = root.parent().find(paneSelector); }
    if (!panes.length) { panes = $(paneSelector); }
    
    
    // public methods
    $.extend(this, {        
      click: function(i, e) {
        
        var tab = tabs.eq(i);
        
        if (typeof i == 'string' && i.replace("#", "")) {
          tab = tabs.filter("[href*=" + i.replace("#", "") + "]");
          i = Math.max(tabs.index(tab), 0);
        }
                
        if (conf.rotate) {
          var last = tabs.length -1; 
          if (i < 0) { return self.click(last, e); }
          if (i > last) { return self.click(0, e); }            
        }
        
        if (!tab.length) {
          if (current >= 0) { return self; }
          i = conf.initialIndex;
          tab = tabs.eq(i);
        }       
        
        // current tab is being clicked
        if (i === current) { return self; }
        
        // possibility to cancel click action       
        e = e || $.Event();
        e.type = "onBeforeClick";
        trigger.trigger(e, [i]);        
        if (e.isDefaultPrevented()) { return; }

        // call the effect
        effects[conf.effect].call(self, i, function() {
          current = i;
          // onClick callback
          e.type = "onClick";
          trigger.trigger(e, [i]);
        });     
        
        // default behaviour
        tabs.removeClass(conf.current); 
        tab.addClass(conf.current);       
        
        return self;
      },
      
      getConf: function() {
        return conf;  
      },

      getTabs: function() {
        return tabs;  
      },
      
      getPanes: function() {
        return panes; 
      },
      
      getCurrentPane: function() {
        return panes.eq(current); 
      },
      
      getCurrentTab: function() {
        return tabs.eq(current);  
      },
      
      getIndex: function() {
        return current; 
      }, 
      
      next: function() {
        return self.click(current + 1);
      },
      
      prev: function() {
        return self.click(current - 1); 
      },
      
      destroy: function() {
        tabs.unbind(conf.event).removeClass(conf.current);
        panes.find("a[href^=#]").unbind("click.T"); 
        return self;
      }
    
    });

    // callbacks  
    $.each("onBeforeClick,onClick".split(","), function(i, name) {
        
      // configuration
      if ($.isFunction(conf[name])) {
        $(self).bind(name, conf[name]); 
      }

      // API
      self[name] = function(fn) {
        if (fn) { $(self).bind(name, fn); }
        return self;  
      };
    });
  
    
    if (conf.history && $.fn.history) {
      $.tools.history.init(tabs);
      conf.event = 'history';
    } 
    
    // setup click actions for each tab
    tabs.each(function(i) {         
      $(this).bind(conf.event, function(e) {
        self.click(i, e);
        return e.preventDefault();
      });     
    });
    
    // cross tab anchor link
    panes.find("a[href^=#]").bind("click.T", function(e) {
      self.click($(this).attr("href"), e);    
    }); 
    
    // open initial tab
    if (location.hash && conf.tabs == "a" && root.find("[href=" +location.hash+ "]").length) {
      self.click(location.hash);

    } else {
      if (conf.initialIndex === 0 || conf.initialIndex > 0) {
        self.click(conf.initialIndex);
      }
    }       
    
  }
  
  
  // jQuery plugin implementation
  $.fn.tabs = function(paneSelector, conf) {

    // return existing instance
    var el = this.data("tabs");
    if (el) { 
      el.destroy(); 
      this.removeData("tabs");
    }

    if ($.isFunction(conf)) {
      conf = {onBeforeClick: conf};
    }
    
    // setup conf
    conf = $.extend({}, $.tools.tabs.conf, conf);   
    
    
    this.each(function() {        
      el = new Tabs($(this), paneSelector, conf);
      $(this).data("tabs", el); 
    });   
   
    return conf.api ? el: this;   
  };    
    
}) (jQuery); 

/**
 * @license 
 * jQuery Tools @VERSION Slideshow - Extend it.
 * 
 * NO COPYRIGHTS OR LICENSES. DO WHAT YOU LIKE.
 * 
 * http://flowplayer.org/tools/tabs/slideshow.html
 *
 * Since: September 2009
 * Date: @DATE 
 */
(function($) {
  
  var tool;
  
  tool = $.tools.tabs.slideshow = { 

    conf: {
      next: '.forward',
      prev: '.backward',
      disabledClass: 'disabled',
      autoplay: false,
      autopause: true,
      interval: 3000, 
      clickable: true,
      api: false
    }
  };  
  
  function Slideshow(root, conf) {
  
    var self = this,
       fire = root.add(this),
       tabs = root.data("tabs"),
       timer, 
       stopped = true;
    
    // next / prev buttons
    function find(query) {
      var el = $(query);
      return el.length < 2 ? el : root.parent().find(query);  
    } 
    
    var nextButton = find(conf.next).click(function() {
      tabs.next();    
    });
    
    var prevButton = find(conf.prev).click(function() {
      tabs.prev();    
    }); 

    /**
    *
    *   Similar fix for autoscroll animation queue problem
    */
    function next(){
      timer = clearTimeout(timer);
      timer = setTimeout(function(){
        tabs.next();
      }, conf.interval);
    }

    // extend the Tabs API with slideshow methods     
    $.extend(self, {
        
      // return tabs API
      getTabs: function() {
        return tabs;  
      },
      
      getConf: function() {
        return conf;  
      },
        
      play: function() {
  
        // do not start additional timer if already exists
        if (timer) { return self; } 
        
        // onBeforePlay
        var e = $.Event("onBeforePlay");
        fire.trigger(e);        
        if (e.isDefaultPrevented()) { return self; }        
        
        stopped = false;        
        
        // onPlay
        fire.trigger("onPlay");       
        
        fire.bind('onClick', next);
        next();
        
        return self;
      },
    
      pause: function() {
        
        if (!timer) { return self; }

        // onBeforePause
        var e = $.Event("onBeforePause");
        fire.trigger(e);          
        if (e.isDefaultPrevented()) { return self; }    
        
        timer = clearTimeout(timer);
        
        // onPause
        fire.trigger("onPause");  
        
        fire.unbind('onClick', next);
        
        return self;
      },
      
      // resume playing if not stopped
      resume: function() {
        stopped || self.play();
      },
      
      // when stopped - mouseover won't restart 
      stop: function() {          
        self.pause();
        stopped = true; 
      }
      
    });

    // callbacks  
    $.each("onBeforePlay,onPlay,onBeforePause,onPause".split(","), function(i, name) {
        
      // configuration
      if ($.isFunction(conf[name]))  {
        $(self).bind(name, conf[name]); 
      }
      
      // API methods        
      self[name] = function(fn) {
        return $(self).bind(name, fn);
      };
    }); 
    
  
    /* when mouse enters, slideshow stops */
    if (conf.autopause) {
      tabs.getTabs().add(nextButton).add(prevButton).add(tabs.getPanes()).hover(self.pause, self.resume);
    } 
    
    if (conf.autoplay) {
      self.play();  
    }
    
    if (conf.clickable) {
      tabs.getPanes().click(function()  {
        tabs.next();
      });
    } 
    
    // manage disabling of next/prev buttons
    if (!tabs.getConf().rotate) {
      
      var disabled = conf.disabledClass;
      
      if (!tabs.getIndex()) {
        prevButton.addClass(disabled);
      }
      
      tabs.onBeforeClick(function(e, i)  { 
        prevButton.toggleClass(disabled, !i);
        nextButton.toggleClass(disabled, i == tabs.getTabs().length -1); 
      });
    }  
  }
  
  // jQuery plugin implementation
  $.fn.slideshow = function(conf) {
  
    // return existing instance
    var el = this.data("slideshow");
    if (el) { return el; }
 
    conf = $.extend({}, tool.conf, conf);
    
    this.each(function() {
      el = new Slideshow($(this), conf);
      $(this).data("slideshow", el);      
    }); 

    return conf.api ? el : this;
  };
  
})(jQuery); 

/**
 * @license 
 * jQuery Tools @VERSION Tooltip - UI essentials
 * 
 * NO COPYRIGHTS OR LICENSES. DO WHAT YOU LIKE.
 * 
 * http://flowplayer.org/tools/tooltip/
 *
 * Since: November 2008
 * Date: @DATE 
 */
(function($) {  
  // static constructs
  $.tools = $.tools || {version: '@VERSION'};
  
  $.tools.tooltip = {
    
    conf: { 
      
      // default effect variables
      effect: 'toggle',     
      fadeOutSpeed: "fast",
      predelay: 0,
      delay: 30,
      opacity: 1,     
      tip: 0,
            fadeIE: false, // enables fade effect in IE
      
      // 'top', 'bottom', 'right', 'left', 'center'
      position: ['top', 'center'], 
      offset: [0, 0],
      relative: false,
      cancelDefault: true,
      
      // type to event mapping 
      events: {
        def:      "mouseenter,mouseleave",
        input:    "focus,blur",
        widget:   "focus mouseenter,blur mouseleave",
        tooltip:    "mouseenter,mouseleave"
      },
      
      // 1.2
      layout: '<div/>',
      tipClass: 'tooltip'
    },
    
    addEffect: function(name, loadFn, hideFn) {
      effects[name] = [loadFn, hideFn]; 
    } 
  };
  
  
  var effects = { 
    toggle: [ 
      function(done) { 
        var conf = this.getConf(), tip = this.getTip(), o = conf.opacity;
        if (o < 1) { tip.css({opacity: o}); }
        tip.show();
        done.call();
      },
      
      function(done) { 
        this.getTip().hide();
        done.call();
      } 
    ],
    
    fade: [
      function(done) {
        var conf = this.getConf();
        if (!$.browser.msie || conf.fadeIE) {
          this.getTip().fadeTo(conf.fadeInSpeed, conf.opacity, done);
        }
        else {
          this.getTip().show();
          done();
        }
      },
      function(done) {
        var conf = this.getConf();
        if (!$.browser.msie || conf.fadeIE) {
          this.getTip().fadeOut(conf.fadeOutSpeed, done);
        }
        else {
          this.getTip().hide();
          done();
        }
      }
    ]   
  };   

    
  /* calculate tip position relative to the trigger */    
  function getPosition(trigger, tip, conf) {  

    
    // get origin top/left position 
    var top = conf.relative ? trigger.position().top : trigger.offset().top, 
       left = conf.relative ? trigger.position().left : trigger.offset().left,
       pos = conf.position[0];

    top  -= tip.outerHeight() - conf.offset[0];
    left += trigger.outerWidth() + conf.offset[1];
    
    // iPad position fix
    if (/iPad/i.test(navigator.userAgent)) {
      top -= $(window).scrollTop();
    }
    
    // adjust Y   
    var height = tip.outerHeight() + trigger.outerHeight();
    if (pos == 'center')  { top += height / 2; }
    if (pos == 'bottom')  { top += height; }
    
    
    // adjust X
    pos = conf.position[1];   
    var width = tip.outerWidth() + trigger.outerWidth();
    if (pos == 'center')  { left -= width / 2; }
    if (pos == 'left')    { left -= width; }   
    
    return {top: top, left: left};
  }   

  
  
  function Tooltip(trigger, conf) {

    var self = this, 
       fire = trigger.add(self),
       tip,
       timer = 0,
       pretimer = 0, 
       title = trigger.attr("title"),
       tipAttr = trigger.attr("data-tooltip"),
       effect = effects[conf.effect],
       shown,
         
       // get show/hide configuration
       isInput = trigger.is(":input"), 
       isWidget = isInput && trigger.is(":checkbox, :radio, select, :button, :submit"),     
       type = trigger.attr("type"),
       evt = conf.events[type] || conf.events[isInput ? (isWidget ? 'widget' : 'input') : 'def']; 
    
    
    // check that configuration is sane
    if (!effect) { throw "Nonexistent effect \"" + conf.effect + "\""; }          
    
    evt = evt.split(/,\s*/); 
    if (evt.length != 2) { throw "Tooltip: bad events configuration for " + type; } 
    
    
    // trigger --> show  
    trigger.bind(evt[0], function(e) {

      clearTimeout(timer);
      if (conf.predelay) {
        pretimer = setTimeout(function() { self.show(e); }, conf.predelay); 
        
      } else {
        self.show(e); 
      }
      
    // trigger --> hide
    }).bind(evt[1], function(e)  {
      clearTimeout(pretimer);
      if (conf.delay)  {
        timer = setTimeout(function() { self.hide(e); }, conf.delay); 
        
      } else {
        self.hide(e);   
      }
      
    }); 
    
    
    // remove default title
    if (title && conf.cancelDefault) { 
      trigger.removeAttr("title");
      trigger.data("title", title);     
    }   
    
    $.extend(self, {
        
      show: function(e) {  

        // tip not initialized yet
        if (!tip) {
          
          // data-tooltip 
          if (tipAttr) {
            tip = $(tipAttr);

          // single tip element for all
          } else if (conf.tip) { 
            tip = $(conf.tip).eq(0);
            
          // autogenerated tooltip
          } else if (title) { 
            tip = $(conf.layout).addClass(conf.tipClass).appendTo(document.body)
              .hide().append(title);

          // manual tooltip
          } else {  
            tip = trigger.next();  
            if (!tip.length) { tip = trigger.parent().next(); }    
          }
          
          if (!tip.length) { throw "Cannot find tooltip for " + trigger;  }
        } 
        
        if (self.isShown()) { return self; }  
        
        // stop previous animation
        tip.stop(true, true);         
        
        // get position
        var pos = getPosition(trigger, tip, conf);      
    
        // restore title for single tooltip element
        if (conf.tip) {
          tip.html(trigger.data("title"));
        }

        // onBeforeShow
        e = $.Event();
        e.type = "onBeforeShow";
        fire.trigger(e, [pos]);       
        if (e.isDefaultPrevented()) { return self; }
    
        
        // onBeforeShow may have altered the configuration
        pos = getPosition(trigger, tip, conf);
        
        // set position
        tip.css({position:'absolute', top: pos.top, left: pos.left});         
        
        shown = true;
        
        // invoke effect 
        effect[0].call(self, function() {
          e.type = "onShow";
          shown = 'full';
          fire.trigger(e);     
        });         

    
        // tooltip events       
        var event = conf.events.tooltip.split(/,\s*/);

        if (!tip.data("__set")) {
          
          tip.unbind(event[0]).bind(event[0], function() { 
            clearTimeout(timer);
            clearTimeout(pretimer);
          });
          
          if (event[1] && !trigger.is("input:not(:checkbox, :radio), textarea")) {          
            tip.unbind(event[1]).bind(event[1], function(e) {
  
              // being moved to the trigger element
              if (e.relatedTarget != trigger[0]) {
                trigger.trigger(evt[1].split(" ")[0]);
              }
            }); 
          } 
          
          // bind agein for if same tip element
          if (!conf.tip) tip.data("__set", true);
        }
        
        return self;
      },
      
      hide: function(e) {

        if (!tip || !self.isShown()) { return self; }
      
        // onBeforeHide
        e = $.Event();
        e.type = "onBeforeHide";
        fire.trigger(e);        
        if (e.isDefaultPrevented()) { return; }
  
        shown = false;
        
        effects[conf.effect][1].call(self, function() {
          e.type = "onHide";
          fire.trigger(e);     
        });
        
        return self;
      },
      
      isShown: function(fully) {
        return fully ? shown == 'full' : shown; 
      },
        
      getConf: function() {
        return conf;  
      },
        
      getTip: function() {
        return tip; 
      },
      
      getTrigger: function() {
        return trigger; 
      }   

    });   

    // callbacks  
    $.each("onHide,onBeforeShow,onShow,onBeforeHide".split(","), function(i, name) {
        
      // configuration
      if ($.isFunction(conf[name])) { 
        $(self).bind(name, conf[name]); 
      }

      // API
      self[name] = function(fn) {
        if (fn) { $(self).bind(name, fn); }
        return self;
      };
    });
    
  }
    
  
  // jQuery plugin implementation
  $.fn.tooltip = function(conf) {
    
    // return existing instance
    var api = this.data("tooltip");
    if (api) { return api; }

    conf = $.extend(true, {}, $.tools.tooltip.conf, conf);
    
    // position can also be given as string
    if (typeof conf.position == 'string') {
      conf.position = conf.position.split(/,?\s/);  
    }
    
    // install tooltip for each entry in jQuery object
    this.each(function() {
      api = new Tooltip($(this), conf); 
      $(this).data("tooltip", api); 
    });
    
    return conf.api ? api: this;     
  };
    
}) (jQuery);

    

/**
 * @license 
 * jQuery Tools @VERSION / Tooltip Slide Effect
 * 
 * NO COPYRIGHTS OR LICENSES. DO WHAT YOU LIKE.
 * 
 * http://flowplayer.org/tools/tooltip/slide.html
 *
 * Since: September 2009
 * Date: @DATE 
 */
(function($) { 

  // version number
  var t = $.tools.tooltip;
    
  // extend global configuragion with effect specific defaults
  $.extend(t.conf, { 
    direction: 'up', // down, left, right 
    bounce: false,
    slideOffset: 10,
    slideInSpeed: 200,
    slideOutSpeed: 200, 
    slideFade: !$.browser.msie
  });     
  
  // directions for slide effect
  var dirs = {
    up: ['-', 'top'],
    down: ['+', 'top'],
    left: ['-', 'left'],
    right: ['+', 'left']
  };
  
  /* default effect: "slide"  */
  t.addEffect("slide", 
    
    // show effect
    function(done) { 

      // variables
      var conf = this.getConf(), 
         tip = this.getTip(),
         params = conf.slideFade ? {opacity: conf.opacity} : {}, 
         dir = dirs[conf.direction] || dirs.up;

      // direction      
      params[dir[1]] = dir[0] +'='+ conf.slideOffset;
      
      // perform animation
      if (conf.slideFade) { tip.css({opacity:0}); }
      tip.show().animate(params, conf.slideInSpeed, done); 
    }, 
    
    // hide effect
    function(done) {
      
      // variables
      var conf = this.getConf(), 
         offset = conf.slideOffset,
         params = conf.slideFade ? {opacity: 0} : {}, 
         dir = dirs[conf.direction] || dirs.up;
      
      // direction
      var sign = "" + dir[0];
      if (conf.bounce) { sign = sign == '+' ? '-' : '+'; }      
      params[dir[1]] = sign +'='+ offset;     
      
      // perform animation
      this.getTip().animate(params, conf.slideOutSpeed, function()  {
        $(this).hide();
        done.call();    
      });
    }
  );  
  
})(jQuery); 
    
;
// build for Drupal 7, using jQuery 1.4+
// Version 1.0
// nivoSlider
jQuery(document).ready(function ($) {
  
  // build the settings variables
  var options = Drupal.settings.vt_jquery_tools;
  
  // fixing the options variable types
  
  if (options != 'undefined') {
   
    // slideshow
    options.slideshow.autopause = (options.slideshow.autopause == 'true');
    options.slideshow.autoplay = (options.slideshow.autoplay == 'true');
    options.slideshow.clickable = (options.slideshow.clickable == 'true');
    options.slideshow.interval = parseInt(options.slideshow.interval);
    
    // tabs
    options.tabs.fadeInSpeed = parseInt(options.tabs.fadeInSpeed);
    options.tabs.fadeOutSpeed = parseInt(options.tabs.fadeOutSpeed);
    options.tabs.history = (options.tabs.history == 'true');
    options.tabs.initialIndex = parseInt(options.tabs.initialIndex);
    options.tabs.rotate = (options.tabs.rotate == 'true');
    
    // we do this instead of relying of jquerytools standard click
    // function binding for smoother animation and preventing
    // trigger happy user
    if (options.tabs.event == 'mouseover') {
      options.tabs.event = 'click';
      
      function clickElement() {
        $(this).trigger('click');
      }
      
      function empty() {}
      
      var config = {
          over: clickElement,
          timeout: 300,
          out: empty,
      };
      $('#vt-jt-thumbnail ul').find('a').each(function() {
        $(this).hoverIntent(config);
      });
    }
    
    // tooltip
    options.tooltip.cancelDefault = (options.tooltip.cancelDefault == 'true');
    options.tooltip.delay = parseInt(options.tooltip.delay);
    options.tooltip.opacity = parseInt(options.tooltip.opacity);
    options.tooltip.predelay = parseInt(options.tooltip.predelay);
    options.tooltip.relative = (options.tooltip.relative == 'true');    
    options.tooltip.bounce = (options.tooltip.bounce == 'true');
    options.tooltip.slideInSpeed = parseInt(options.tooltip.slideInSpeed);
    options.tooltip.slideOutSpeed = parseInt(options.tooltip.slideOutSpeed);
    options.tooltip.slideOffset = parseInt(options.tooltip.slideOffset);
  }
  
  var delayed = parseInt(options.tabs.fadeInSpeed) + parseInt(options.tabs.fadeOutSpeed);
  /**$('div.pane-slider-content').queue(function() {    
    $(this).addClass('start');
    next();
  });
  
  $('#vt-jt-thumbnail ul').queue(function() {
    $(this).tabs('#vt-jt-content > div.pane-slider-content', options.tabs).slideshow(options.slideshow);
    next();
  });
  
  $('div.pane-slider-content').queue(function() {
     
    $(this).removeClass('start');
    next();
  });
  **/
  
  $('div.pane-slider-content').addClass('start');
  $('#vt-jt-thumbnail ul').tabs('#vt-jt-content > div.pane-slider-content', options.tabs).queue(function(next) {
    $('div.pane-slider-content').addClass('start');
    next();
  }).slideshow(options.slideshow);
    
  //$('#vt-jt-thumbnail ul').tabs('#vt-jt-content > div.pane-slider-content', options.tabs).slideshow(options.slideshow);     

  $('a.slide-thumbnail').tooltip(options.tooltip);
  //$('div.pane-slider-content').removeClass('start');
   
});;
/**
* hoverIntent r6 // 2011.02.26 // jQuery 1.5.1+
* <http://cherne.net/brian/resources/jquery.hoverIntent.html>
* 
* @param  f  onMouseOver function || An object with configuration options
* @param  g  onMouseOut function  || Nothing (use configuration options object)
* @author    Brian Cherne brian(at)cherne(dot)net
*/
(function($){$.fn.hoverIntent=function(f,g){var cfg={sensitivity:7,interval:100,timeout:0};cfg=$.extend(cfg,g?{over:f,out:g}:f);var cX,cY,pX,pY;var track=function(ev){cX=ev.pageX;cY=ev.pageY};var compare=function(ev,ob){ob.hoverIntent_t=clearTimeout(ob.hoverIntent_t);if((Math.abs(pX-cX)+Math.abs(pY-cY))<cfg.sensitivity){$(ob).unbind("mousemove",track);ob.hoverIntent_s=1;return cfg.over.apply(ob,[ev])}else{pX=cX;pY=cY;ob.hoverIntent_t=setTimeout(function(){compare(ev,ob)},cfg.interval)}};var delay=function(ev,ob){ob.hoverIntent_t=clearTimeout(ob.hoverIntent_t);ob.hoverIntent_s=0;return cfg.out.apply(ob,[ev])};var handleHover=function(e){var ev=jQuery.extend({},e);var ob=this;if(ob.hoverIntent_t){ob.hoverIntent_t=clearTimeout(ob.hoverIntent_t)}if(e.type=="mouseenter"){pX=ev.pageX;pY=ev.pageY;$(ob).bind("mousemove",track);if(ob.hoverIntent_s!=1){ob.hoverIntent_t=setTimeout(function(){compare(ev,ob)},cfg.interval)}}else{$(ob).unbind("mousemove",track);if(ob.hoverIntent_s==1){ob.hoverIntent_t=setTimeout(function(){delay(ev,ob)},cfg.timeout)}}};return this.bind('mouseenter',handleHover).bind('mouseleave',handleHover)}})(jQuery);;
(function ($) {

  Drupal.behaviors.captcha = {
    attach: function (context) {

      // Turn off autocompletion for the CAPTCHA response field.
      // We do it here with Javascript (instead of directly in the markup)
      // because this autocomplete attribute is not standard and
      // it would break (X)HTML compliance.
      $("#edit-captcha-response").attr("autocomplete", "off");

    }
  };

  Drupal.behaviors.captchaAdmin = {
    attach: function (context) {
    	// Add onclick handler to checkbox for adding a CAPTCHA description
    	// so that the textfields for the CAPTCHA description are hidden
    	// when no description should be added.
      // @todo: div.form-item-captcha-description depends on theming, maybe
      // it's better to add our own wrapper with id (instead of a class).
    	$("#edit-captcha-add-captcha-description").click(function() {
    		if ($("#edit-captcha-add-captcha-description").is(":checked")) {
    			// Show the CAPTCHA description textfield(s).
    			$("div.form-item-captcha-description").show('slow');
    		}
    		else {
    			// Hide the CAPTCHA description textfield(s).
    			$("div.form-item-captcha-description").hide('slow');
    		}
    	});
    	// Hide the CAPTCHA description textfields if option is disabled on page load.
    	if (!$("#edit-captcha-add-captcha-description").is(":checked")) {
    		$("div.form-item-captcha-description").hide();
    	}
    }

  };

})(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 {
            // External link clicked.
            _gaq.push(["_trackEvent", "Outbound links", "Click", this.href]);
          }
        }
      }
    });
  });
});

})(jQuery);
;

