﻿
/* External Plugins */
//
// create closure
//
(function($) {
  var Temp = function(){
    this.add = function(key, value){
      if(typeof this.values == "undefined")
        this.values = {};
      if(typeof this.values[key] == "undefined" || typeof this.values[key] == null)
        this.values[key] = 0;
      this.values[key]+=value;
      return this.values[key];
    };
    this.get = function(key){
      if(typeof this.values == "undefined")
        this.values = {};
      if(typeof this.values^[key] == "undefined")
        this.values[key] = null;
      return this.values[key];
    };
    this.set = function(key, value){
      if(typeof this.values == "undefined")
        this.values = {};
      if(typeof this.values[key] == "undefined")
        this.values[key] = value;
      return this.values[key];
    };

  };

  $.getBaseUri = function(){
    var b = $("base").attr("href");
    if(b) return $("base").attr("href");
    else return "";
  };

  $.fn.faq = function() {
    return this.each(function() {
      var $this = $(this);
      var dl = $('dl', $this);
      dl.addClass('inv');
      var ul = $(" <ul />");
      var dd = $('dt', $this);
      dd.each(
          function(){
            var li = $(" <li />").attr("class", (dd.length > 1) ? "" : "chosen");
            var fakeDt = $(" <div />").attr("class", "dt").text($(this).text());
            var fakeDd = $(" <div />").attr("class", "dd").text($(this).next().text());
            li.append(fakeDt);
            li.append(fakeDd);
            ul.append(li);
          }
          );
      ul.appendTo($this);
      $('.dt', $this).click(
          function(){
            $(this).parent().siblings().each(function(){
              var li = $(this);
              if(li.hasClass('chosen')){
                li.removeClass('chosen');
              }
            });
            $($(this).parent()).addClass('chosen');
          }
          );
      //      debug($(dd[0]).text());
    });
  };
  $.fn.expanders = function(options) {
    var defaults = {
      isAccordion: false
    };
    var options = $.extend({}, defaults, options);
    return this.each(function() {
      var $this = $(this);
      var isAccordion = options.isAccordion || $(this).hasClass('accordion');
      var toExpand =$('.toExpand', this);
      if(toExpand.length > 0){
        if(isAccordion){
          function setChosen(index) {
            return $this.attr("chosen", index);
          }
          function getChosen(reJquery){
            if(reJquery)
              return $this.find(".toExpand[index='"+getChosen()+"']");
            else
              return $this.attr("chosen");
          };
          function getChosenHead(reJquery){
            if(reJquery)
              return $this.find(".toExpand[index='"+getChosen()+"'] .expHead");
            else
              return $this.find(".toExpand[index='"+getChosen()+"'] .expHead")[0];
          }
          function getChosenContent(reJquery){
            if(reJquery)
              return $this.find(".toExpand[index='"+getChosen()+"'] .expContent");
            else
              return $this.find(".toExpand[index='"+getChosen()+"'] .expContent")[0];
          }
          $this.setClassAttributs("chosen");
          toExpand.each(function(i){
            $(this).attr("index", i);
            $('.expHead', this)
                .click(function(){
              if(getChosenHead() != this){
                getChosenContent(true).slideToggle('slow', function(){});
                $('.expContent', $(this).parent()).slideToggle('slow', function(){});
                getChosen(true).toggleClass('notExpanded');
                setChosen($(this).parent().attr("index"));
              } else {
                getChosenContent(true).slideToggle('slow', function(){});
                setChosen(-1);
              }
              $(this).parent().toggleClass('notExpanded');
            });
            if(getChosen(true)[0] != this)
              $(this).addClass("notExpanded");
            if(i != getChosen()){
              $('.expContent', this).css('display', 'none');
            }
          }).addClass('hasJS');
        }else {
          toExpand.each(function(){
            $('.expHead', this)
                .click(function(){
              $('.expContent', $(this).parent()).slideToggle('slow', function(){});
              $(this).parent().toggleClass('notExpanded');
            });
            $(this).addClass("notExpanded");
            $('.expContent', this).css('display', 'none');
          }).addClass('hasJS');
        }
      }
    });
  };

  $.fn.video = function() {
    var t = new Temp();
    function getId(name, rfunc){
      var newId = name+(t.add('video', 1));
      if($('#' + newId).length > 0)
        getId(name, rfunc);
      else
        rfunc(newId);
    }
    return this.each(function() {
      var $this = $(this);
      var $parent = $this.parent();
      var img = $('img', $this);
      var dimensions = {
        width: img.width(),
        height: img.height()+20
      };
      if(swfobject.getFlashPlayerVersion().major >= 9) {
        $parent.height($parent.height()+20);
        if(!$this.attr('id')) {
          getId('videoPlayer', function(id){
            $this.attr('id', id);
          });
        };
        var flashvars = {file: $this.attr('href'), "image": img.attr('src')};
        var params = {'allowfullscreen':'true', 'wmode':'transparent'};
        var attributes = {};
swfobject.embedSWF("fileadmin/swf/longtail/player.swf", $this.attr('id'), dimensions.width, dimensions.height, "9.0.0", false, flashvars, params, attributes);
      }
    });
  };
  $.fn.additionalInput = function() {
    return this.each(function() {
      var $this = $(this);
      function checkState(checked){
        if(checked){
          $this[0].disabled = false;
        } else {
          $this[0].disabled = true;
          if($this[0].nodeName == "SELECT") {
            for(var i=0; i<$this[0].options.length; i++){
              if(i==0)
                $this[0].options[i].selected = true;
              else
                $this[0].options[i].selected = false;
            };
          } else if ($this[0].nodeName == "INPUT"){;
            $this[0].value = "";
          }
        }
        return checked;
      }
      var parentInput = $($this.parents()[1]).find("p:first input");
      checkState(parentInput[0].checked);
      $($this.parents()[2]).find('input[name="'+parentInput[0].name+'"]').change(function(){
        checkState(parentInput[0].checked);
      });
    });
  };
  $.fn.externLinks = function() {
    return this.each(function() {
      var t = $(this).text();
      $(this).text("");
      $(this).append("<span>"+t+"</span>");
      $(this).removeClass("extern");
      $(this).addClass("extern2");
    });
  };
  $.fn.datepicker = function() {
    return this.each(function() {
      //      $(this).addClass("hasJs");
      $(this).find("input").each(function(){
        var labels = $($(this).parents()[1]).find("label.inv[for='"+this.id+"']");
        var labelText = jQuery.trim(labels.text());
        $(this).setClassAttributs("default");
        if(this.value == "") {
          this.value = $(this).attr("default").substring(0, $(this).attr("maxlength"));
        }
      });
      //      $(this).click(function(){alert("Function not available!")});
    });
  };
  $.fn.setClassAttributs = function(attributeName) {
    return this.each(function() {
      var $this = $(this);
      var splitting = this.className.split(" ");
      for(var i= 0; i<splitting.length; i++) {
        if(splitting[i].indexOf(attributeName) != -1){
          var value = splitting[i].substring(splitting[i].indexOf("(")+1, splitting[i].indexOf(")"));
          if(value != "") {
            $this.attr(attributeName, value);
          }
          $(this).removeClass(splitting[i]);
        }
      }
    });
  };
  $.fn.slider = function() {
    function initSlider($select){
      $select.setClassAttributs("imagepre");
      var $sliderCont = $('<div class="sliderCont" />');
      $sliderCont.append('<img class="image0" src="'+$.getBaseUri()+'/fileadmin/img/style/'+$select.attr('imagepre')+'_0.png" />');
      $sliderCont.append('<img class="image1" src="'+$.getBaseUri()+'/fileadmin/img/style/'+$select.attr('imagepre')+'_1.png" />');
      var $scaleCont = $('<div class="scaleCont" />');
      var $valuesCont = $('<div class="valuesCont" />');
      var valuesWidth = 100/($select[0].options.length)*2;
      for(var i=0;i<$select[0].options.length+1;i++){
        var $scale = $('<div class="scale" />');
        $scale.css("width", 100/($select[0].options.length)*i+"%");
        $scaleCont.append($scale);
        if($select[0].options[i]){
          var $value = $('<div class="value" />').text($select[0].options[i].text);
          $value.css({"left":(100/($select[0].options.length)*i-valuesWidth/$select[0].options.length-1)+"%", "width": valuesWidth});
          $valuesCont.append($value);
        }
      }
      var $sliderThumb = $('<img class="thumb" src="'+$.getBaseUri()+'/fileadmin/img/style/slider_thumb.png" />')
      var $lastScale = $scaleCont.find('div.scale:last');
      $lastScale.bind('click', function(event){
        $sliderThumb.animate({'left':event.pageX-$(this).offsetParent().offset().left}, 500);
        var v = Math.floor((event.pageX-$(this).offsetParent().offset().left)/$(this).offsetParent().width()*$select[0].options.length);
        selectOption($select[0].options, v );
      });
      $scaleCont.append($valuesCont);
      $scaleCont.append($sliderThumb);
      $sliderCont.append($scaleCont);
      return $sliderCont;

    }
    function selectOption(options, value){
      for(var i=0; i<options.length; i++) {
        options[i].selected = (i==value);
      };
    }
    return this.each(function() {
      var $this = $(this);
      $this.addClass('hasJS');
      var $iSlider = $this.find(".iSliderMod");
      var $select = $this.find("select");
      $select.addClass("inv");
      $iSlider.append(initSlider($select));
      var $thumb = $iSlider.find(".thumb");
      var parentLeft = $thumb.offsetParent().offset().left;
      var parentWidth = $thumb.offsetParent().width();
      var select = $select[0];
      var options = select.options;
      var moving = 0;
      $thumb.bind('drag', function(event){
          moving = event.cursorOffsetX+event.offsetX-parentLeft;
          if(moving >= 0 && moving <= parentWidth){
            $(this).css({
              left: moving
            });
          }
        })
        .bind('dragend', function (){
          var thumbValue =  Math.floor(moving/parentWidth*options.length);
          if(options.selectedIndex != thumbValue)
            selectOption(options, thumbValue);
        })
    });
  };
  $.fn.textMaxlength = function() {
    return this.each(function() {
      var $this = $(this);
      $this.setClassAttributs("maxlength");
      $this.setClassAttributs("translateFrom");
      $this.setClassAttributs("translateCharacter");
      if($this.attr("maxlength") != undefined) {
        function countCharacters(){
          $this.siblings().text("("+$this[0].value.length+" "+$this.attr("translatefrom")+" "+$this.attr("maxlength")+" "+$this.attr("translatecharacter")+")");
        }
        $this.wrap('<div class="textareaMaxlengthMod" />');
        $($this.parents()[0]).append($("<span />"));
        countCharacters();
        this.onkeyup = function(){
          if(this.value.length > $this.attr("maxlength")) {
            this.value = this.value.substring(0, $this.attr("maxlength"));
          }
          countCharacters();
        };
      }
    });
  };
  $.fn.slideshow = function() {
    var t = new Temp();
    if(typeof window.slideshowFlashloaded == "undefined")
      window.slideshowFlashloaded = function(flashObjId){
        function showImage(image){
          flash.setPause();
          flash.showImage(image);
          return image;
        }
        var flash = $('#'+flashObjId)[0];
        flash.loadJSON(t.get(flashObjId));
        var $p = $('#'+flashObjId).parent();
        var items = 0;
        if($p.attr('enableskip') == "true"){
          var current = showImage(0);
          items = $p.attr("items");
          if($p.find("a").length == 0) {;
            var $next = $('<a href="javascript:void(0)" class="next" />');
            $next.append('<img src="'+$.getBaseUri()+'/fileadmin/img/style/icons/arrow_04204E.gif" />');
            $next.bind('click', function(){
              current++;
              if(current >= items) current = 0;
              current = showImage(current);
            });
            $p.append($next);
            var $prev = $('<a href="javascript:void(0)" class="prev" />');
            $prev.append('<img src="'+$.getBaseUri()+'../img/style/icons/arrow_right_dbe2ec.gif" />');
            $prev.bind('click', function(){
              current--;
              if(current < 0) current = items-1;
              current = showImage(current);
            });
            $p.append($prev);
          }
        }
      };
    function getId(name, rfunc){
      var newId = name+(t.add('idCounter', 1));
      if($('#' + newId).length > 0)
        getId(name, rfunc);
      else
        rfunc(newId);
    }

    return this.each(function() {
      var $this = $(this);
      var images = '{"images":[';
      var dimensions = {};
      $this.wrap('<div class="'+ this.className +'" />');
      var $p = $this.parent();
      $p.setClassAttributs("enableSkip");
      $p.setClassAttributs("dimW");
      $p.setClassAttributs("dimH");
      dimensions.width = $p.attr('dimw');
      dimensions.height = $p.attr('dimh');
      var l = $("img", this).each(function(i){
        images+= ((i==0) ? '' : ',') + '{';
        if(i==0){
          if(!dimensions.height) dimensions.height = $(this).height();
          if(!dimensions.width) dimensions.width = $(this).width();
        };
        var a = $(this).parent();
        images+='"image":"'+this.src+'"';
        images+=',"url":"'+a.attr('href')+'"';
        if(a.attr('target') != "")
          images+=',"target":"'+a.attr('target')+'"';

        images+='}';
      }).length;
      $p.attr("items", l);
      images+=']}';
      $this.height(dimensions.height);
      $this.width(dimensions.width);
      $this.css("overflow", "hidden");
      if(!$this.attr('id')) {
        getId('slideshow', function(id){
          $this.attr('id', id);
        });
      };
      t.set($this.attr('id'), images);
      var attributes = {
        id: $this.attr('id'),
        name: $this.attr('id')
      };
      var flashvars = {
        isLoaded:"slideshowFlashloaded",
        id:$this.attr('id'),
        delayTime:"0",
        intervalTime: "3000",
        autoStart: ($p.attr("autostart") != "true") ? "true" : "false"
      };
      var params = {
        wmode:"transparent",
        scalemode:"noscale"
      };
      swfobject.embedSWF("fileadmin/swf/slideshow.swf", $this.attr('id'), dimensions.width, dimensions.height, "9.0.0", "expressInstall.swf", flashvars, params, attributes);
    });
  };
})(jQuery);
/*!
jquery.event.drag.js ~ v1.5 ~ Copyright (c) 2008, Three Dub Media (http://threedubmedia.com)
Liscensed under the MIT License ~ http://threedubmedia.googlecode.com/files/MIT-LICENSE.txt
*/
(function($){ // secure $ jQuery alias
/*******************************************************************************************/
// Created: 2008-06-04 | Updated: 2009-03-24
/*******************************************************************************************/
// Events: drag, dragstart, dragend
/*******************************************************************************************/

// jquery method
$.fn.drag = function( fn1, fn2, fn3 ){
  if ( fn2 ) this.bind('dragstart', fn1 ); // 2+ args
  if ( fn3 ) this.bind('dragend', fn3 ); // 3 args
  return !fn1 ? this.trigger('drag') // 0 args
    : this.bind('drag', fn2 ? fn2 : fn1 ); // 1+ args
  };

// local refs
var $event = $.event, $special = $event.special,

// special event configuration
drag = $special.drag = {
  not: ':input', // don't begin to drag on event.targets that match this selector
  distance: 0, // distance dragged before dragstart
  which: 1, // mouse button pressed to start drag sequence
  dragging: false, // hold the active target element
  setup: function( data ){
    data = $.extend({
      distance: drag.distance,
      which: drag.which,
      not: drag.not
      }, data || {});
    data.distance = squared( data.distance ); //  x² + y² = distance²
    $event.add( this, "mousedown", handler, data );
    if ( this.attachEvent ) this.attachEvent("ondragstart", dontStart ); // prevent image dragging in IE...
    },
  teardown: function(){
    $event.remove( this, "mousedown", handler );
    if ( this === drag.dragging ) drag.dragging = drag.proxy = false; // deactivate element
    selectable( this, true ); // enable text selection
    if ( this.detachEvent ) this.detachEvent("ondragstart", dontStart ); // prevent image dragging in IE...
    }
  };

// prevent normal event binding...
$special.dragstart = $special.dragend = { setup:function(){}, teardown:function(){} };

// handle drag-releatd DOM events
function handler ( event ){
  var elem = this, returned, data = event.data || {};
  // mousemove or mouseup
  if ( data.elem ){
    // update event properties...
    elem = event.dragTarget = data.elem; // drag source element
    event.dragProxy = drag.proxy || elem; // proxy element or source
    event.cursorOffsetX = data.pageX - data.left; // mousedown offset
    event.cursorOffsetY = data.pageY - data.top; // mousedown offset
    event.offsetX = event.pageX - event.cursorOffsetX; // element offset
    event.offsetY = event.pageY - event.cursorOffsetY; // element offset
    }
  // mousedown, check some initial props to avoid the switch statement
  else if ( drag.dragging || ( data.which>0 && event.which!=data.which ) ||
    $( event.target ).is( data.not ) ) return;
  // handle various events
  switch ( event.type ){
    // mousedown, left click, event.target is not restricted, init dragging
    case 'mousedown':
      $.extend( data, $( elem ).offset(), {
        elem: elem, target: event.target,
        pageX: event.pageX, pageY: event.pageY
        }); // store some initial attributes
      $event.add( document, "mousemove mouseup", handler, data );
      selectable( elem, false ); // disable text selection
      drag.dragging = null; // pending state
      return false; // prevents text selection in safari
    // mousemove, check distance, start dragging
    case !drag.dragging && 'mousemove':
      if ( squared( event.pageX-data.pageX )
        + squared( event.pageY-data.pageY ) //  x² + y² = distance²
        < data.distance ) break; // distance tolerance not reached
      event.target = data.target; // force target from "mousedown" event (fix distance issue)
      returned = hijack( event, "dragstart", elem ); // trigger "dragstart", return proxy element
      if ( returned !== false ){ // "dragstart" not rejected
        drag.dragging = elem; // activate element
        drag.proxy = event.dragProxy = $( returned || elem )[0]; // set proxy
        }
    // mousemove, dragging
    case 'mousemove':
      if ( drag.dragging ){
        returned = hijack( event, "drag", elem ); // trigger "drag"
        if ( $special.drop ){ // manage drop events
          $special.drop.allowed = ( returned !== false ); // prevent drop
          $special.drop.handler( event ); // "dropstart", "dropend"
          }
        if ( returned !== false ) break; // "drag" not rejected, stop
        event.type = "mouseup"; // helps "drop" handler behave
        }
    // mouseup, stop dragging
    case 'mouseup':
      $event.remove( document, "mousemove mouseup", handler ); // remove page events
      if ( drag.dragging ){
        if ( $special.drop ) $special.drop.handler( event ); // "drop"
        hijack( event, "dragend", elem ); // trigger "dragend"
        }
      selectable( elem, true ); // enable text selection
      drag.dragging = drag.proxy = data.elem = false; // deactivate element
      break;
    }
  return true;
  };

// set event type to custom value, and handle it
function hijack ( event, type, elem ){
  event.type = type; // force the event type
  var result = $.event.handle.call( elem, event );
  return result===false ? false : result || event.result;
  };

// return the value squared
function squared ( value ){ return Math.pow( value, 2 ); };

// suppress default dragstart IE events...
function dontStart(){ return ( drag.dragging === false ); };

// toggles text selection attributes
function selectable ( elem, bool ){
  if ( !elem ) return; // maybe element was removed ?
  elem.unselectable = bool ? "off" : "on"; // IE
  elem.onselectstart = function(){ return bool; }; // IE
  //if ( document.selection && document.selection.empty ) document.selection.empty(); // IE
  if ( elem.style ) elem.style.MozUserSelect = bool ? "" : "none"; // FF
  };

/*******************************************************************************************/
})( jQuery ); // confine scope

/* ------------------------------------------------------------------------
  Class: prettyPhoto
  Use: Lightbox clone for jQuery
  Author: Stephane Caron (http://www.no-margin-for-errors.com)
  Version: 2.4.3
------------------------------------------------------------------------- */

var $pp_pic_holder;
var $ppt;

(function($) {
  $.fn.prettyPhoto = function(settings) {
    // global Variables
    var doresize = true;
    var percentBased = false;
    var imagesArray = [];
    var setPosition = 0; /* Position in the set */
    var pp_contentHeight;
    var pp_contentWidth;
    var pp_containerHeight;
    var pp_containerWidth;
    var pp_type = 'image';
  
    // Global elements
    var $caller;
    var $scrollPos = _getScroll();
  
    $(window).scroll(function(){ $scrollPos = _getScroll(); _centerPicture(); });
    $(window).resize(function(){ _centerPicture(); _resizeOverlay(); });
    $(document).keypress(function(e){
      switch(e.keyCode){
        case 37:
          if (setPosition == 1) return;
          changePicture('previous');
          break;
        case 39:
          if (setPosition == setCount) return;
          changePicture('next');
          break;
        case 27:
          close();
          break;
      };
      });

    var localizeDefault = {
      close: "Close",
      next: "next",
      previous: "previous",
      expand: "Expand",
      expandTitle: "Expand the image"
    };
 
  
    settings = jQuery.extend({
      animationSpeed: 'normal', /* fast/slow/normal */
      padding: 40, /* padding for each side of the picture */
      opacity: 0.80, /* Value between 0 and 1 */
      showTitle: true, /* true/false */
      allowresize: true, /* true/false */
      counter_separator_label: '/', /* The separator for the gallery counter 1 "of" 2 */
      theme: 'light_rounded', /* light_rounded / dark_rounded / light_square / dark_square */
      localize: localizeDefault,
      callback: function(){}
    }, settings);
    
    // Fallback to a supported theme for IE6
    if(jQuery.browser.msie && jQuery.browser.version == '6.0'){
      settings.theme = "light_square";
    }
  
    $(this).each(function(){
      var hasTitle = false;
      var isSet = false;
      var setCount = 0; /* Total images in the set */
      var arrayPosition = 0; /* Total position in the array */
      
      imagesArray[imagesArray.length] = this;
      $(this).bind('click',function(){
        open(this);
        return false;
      });
    });
  
    function open(el) {
      $caller = $(el);
    
      // Find out if the picture is part of a set
      theRel = $caller.attr('rel');
      galleryRegExp = /\[(?:.*)\]/;
      theGallery = galleryRegExp.exec(theRel);
    
      // Calculate the number of items in the set, and the position of the clicked picture.
      isSet = false;
      setCount = 0;
      
      _getFileType();
      
      for (i = 0; i < imagesArray.length; i++){
        if($(imagesArray[i]).attr('rel').indexOf(theGallery) != -1){
          setCount++;
          if(setCount > 1) isSet = true;

          if($(imagesArray[i]).attr('href') == $caller.attr('href')){
            setPosition = setCount;
            arrayPosition = i;
          };
        };
      };
    
      _buildOverlay();

      // Display the current position
      $pp_pic_holder.find('p.currentTextHolder').text(setPosition + settings.counter_separator_label + setCount);

      // Position the picture in the center of the viewing area
      _centerPicture();
    
      $('#pp_full_res').hide();
      $pp_pic_holder.find('.pp_loaderIcon').show();
    };
  
    showimage = function(width,height,containerWidth,containerHeight,contentHeight,contentWidth,resized){
      $('.pp_loaderIcon').hide();

      if($.browser.opera) {
        windowHeight = window.innerHeight;
        windowWidth = window.innerWidth;
      }else{
        windowHeight = $(window).height();
        windowWidth = $(window).width();
      };

      $pp_pic_holder.find('.pp_content').animate({'height':contentHeight},settings.animationSpeed);

      projectedTop = $scrollPos['scrollTop'] + ((windowHeight/2) - (containerHeight/2));
      if(projectedTop < 0) projectedTop = 0 + $pp_pic_holder.find('.ppt').height();

      // Resize the holder
      $pp_pic_holder.animate({
        'top': projectedTop,
        'left': ((windowWidth/2) - (containerWidth/2)),
        'width': containerWidth
      },settings.animationSpeed,function(){
        $pp_pic_holder.width(containerWidth);
        $pp_pic_holder.find('.pp_hoverContainer,#fullResImage').height(height).width(width);

        // Fade the new image
        $pp_pic_holder.find('#pp_full_res').fadeIn(settings.animationSpeed,function(){
          $(this).find('object,embed').css('visibility','visible');
        });

        // Show the nav elements
        _showContent();
      
        // Fade the resizing link if the image is resized
        if(resized) $('a.pp_expand,a.pp_contract').fadeIn(settings.animationSpeed);
      });
    };
    
    function _showContent(){
      // Show the nav
      if(isSet && pp_type=="image") { $pp_pic_holder.find('.pp_hoverContainer').fadeIn(settings.animationSpeed); }else{ $pp_pic_holder.find('.pp_hoverContainer').hide(); }
      $pp_pic_holder.find('.pp_details').fadeIn(settings.animationSpeed);
      
      // Show the title
      if(settings.showTitle && hasTitle){
        $ppt.css({
          'top' : $pp_pic_holder.offset().top - 22,
          'left' : $pp_pic_holder.offset().left + (settings.padding/2),
          'display' : 'none'
        });
      
        $ppt.fadeIn(settings.animationSpeed);
      };
    }
    
    function _hideContent(){
      // Fade out the current picture
      $pp_pic_holder.find('.pp_hoverContainer,.pp_details').fadeOut(settings.animationSpeed);
      $pp_pic_holder.find('#pp_full_res object,#pp_full_res embed').css('visibility','hidden');
      $pp_pic_holder.find('#pp_full_res').fadeOut(settings.animationSpeed,function(){
        $('.pp_loaderIcon').show();
      
        // Preload the image
        _preload();
      });
      
      // Hide the title
      $ppt.fadeOut(settings.animationSpeed);
    }
  
    function changePicture(direction){
      if(direction == 'previous') {
        arrayPosition--;
        setPosition--;
      }else{
        arrayPosition++;
        setPosition++;
      };

      // Allow the resizing of the images
      if(!doresize) doresize = true;

      _hideContent();
      $('a.pp_expand,a.pp_contract').fadeOut(settings.animationSpeed,function(){
        $(this).removeClass('pp_contract').addClass('pp_expand');
      });
    };
  
    function close(){
      $pp_pic_holder.find('object,embed').css('visibility','hidden');
      
      $('div.pp_pic_holder,div.ppt').fadeOut(settings.animationSpeed);
      
      $('div.pp_overlay').fadeOut(settings.animationSpeed, function(){
        $('div.pp_overlay,div.pp_pic_holder,div.ppt').remove();
      
        // To fix the bug with IE select boxes
        if($.browser.msie && $.browser.version == 6){
          $('select').css('visibility','visible');
        };
        
        settings.callback();
      });
      
      doresize = true;
    };
  
    function _checkPosition(){
      // If at the end, hide the next link
      if(setPosition == setCount) {
        $pp_pic_holder.find('a.pp_next').css('visibility','hidden');
        $pp_pic_holder.find('a.pp_arrow_next').addClass('disabled').unbind('click');
      }else{ 
        $pp_pic_holder.find('a.pp_next').css('visibility','visible');
        $pp_pic_holder.find('a.pp_arrow_next.disabled').removeClass('disabled').bind('click',function(){
          changePicture('next');
          return false;
        });
      };
    
      // If at the beginning, hide the previous link
      if(setPosition == 1) {
        $pp_pic_holder.find('a.pp_previous').css('visibility','hidden');
        $pp_pic_holder.find('a.pp_arrow_previous').addClass('disabled').unbind('click');
      }else{
        $pp_pic_holder.find('a.pp_previous').css('visibility','visible');
        $pp_pic_holder.find('a.pp_arrow_previous.disabled').removeClass('disabled').bind('click',function(){
          changePicture('previous');
          return false;
        });
      };
    
      // Change the current picture text
      $pp_pic_holder.find('p.currentTextHolder').text(setPosition + settings.counter_separator_label + setCount);
    
      $caller = (isSet) ? $(imagesArray[arrayPosition]) : $caller;
      _getFileType();

      if($caller.attr('title')){
        $pp_pic_holder.find('.pp_description').show().html(unescape($caller.attr('title')));
      }else{
        $pp_pic_holder.find('.pp_description').hide().text('');
      };
    
      if($caller.find('img').attr('alt') && settings.showTitle){
        hasTitle = true;
        $ppt.html(unescape($caller.find('img').attr('alt')));
      }else{
        hasTitle = false;
      };
    };
  
    function _fitToViewport(width,height){
      hasBeenResized = false;
    
      _getDimensions(width,height);
      
      // Define them in case there's no resize needed
      imageWidth = width;
      imageHeight = height;

      windowHeight = $(window).height();
      windowWidth = $(window).width();
    
      if( ((pp_containerWidth > windowWidth) || (pp_containerHeight > windowHeight)) && doresize && settings.allowresize && !percentBased) {
        hasBeenResized = true;
        notFitting = true;
      
        while (notFitting){
          if((pp_containerWidth > windowWidth)){
            imageWidth = (windowWidth - 200);
            imageHeight = (height/width) * imageWidth;
          }else if((pp_containerHeight > windowHeight)){
            imageHeight = (windowHeight - 200);
            imageWidth = (width/height) * imageHeight;
          }else{
            notFitting = false;
          };

          pp_containerHeight = imageHeight;
          pp_containerWidth = imageWidth;
        };
      
        _getDimensions(imageWidth,imageHeight);
      };

      return {
        width:imageWidth,
        height:imageHeight,
        containerHeight:pp_containerHeight,
        containerWidth:pp_containerWidth,
        contentHeight:pp_contentHeight,
        contentWidth:pp_contentWidth,
        resized:hasBeenResized
      };
    };
    
    function _getDimensions(width,height){
      $pp_pic_holder.find('.pp_details').width(width).find('.pp_description').width(width - parseFloat($pp_pic_holder.find('a.pp_close').css('width'))); /* To have the correct height */
      
      // Get the container size, to resize the holder to the right dimensions
      pp_contentHeight = height + $pp_pic_holder.find('.pp_details').height() + parseFloat($pp_pic_holder.find('.pp_details').css('marginTop')) + parseFloat($pp_pic_holder.find('.pp_details').css('marginBottom'));
      pp_contentWidth = width;
      pp_containerHeight = pp_contentHeight + $pp_pic_holder.find('.ppt').height() + $pp_pic_holder.find('.pp_top').height() + $pp_pic_holder.find('.pp_bottom').height();
      pp_containerWidth = width + settings.padding;
    }
  
    function _getFileType(){
      if ($caller.attr('href').match(/youtube\.com\/watch/i)) {
        pp_type = 'youtube';
      }else if($caller.attr('href').indexOf('.mov') != -1){ 
        pp_type = 'quicktime';
      }else if($caller.attr('href').indexOf('.swf') != -1){
        pp_type = 'flash';
      }else if($caller.attr('href').indexOf('iframe') != -1){
        pp_type = 'iframe'
      }else{
        pp_type = 'image';
      }
    }
  
    function _centerPicture(){
      if ($pp_pic_holder){ if($pp_pic_holder.size() == 0){ return; }}else{ return; }; //Make sure the gallery is open

      if($.browser.opera) {
        windowHeight = window.innerHeight;
        windowWidth = window.innerWidth;
      }else{
        windowHeight = $(window).height();
        windowWidth = $(window).width();
      };
    
      if(doresize) {
        $pHeight = $pp_pic_holder.height();
        $pWidth = $pp_pic_holder.width();
        $tHeight = $ppt.height();
        
        projectedTop = (windowHeight/2) + $scrollPos['scrollTop'] - ($pHeight/2);
        if(projectedTop < 0) projectedTop = 0 + $tHeight;
        
        $pp_pic_holder.css({
          'top': projectedTop,
          'left': (windowWidth/2) + $scrollPos['scrollLeft'] - ($pWidth/2)
        });
    
        $ppt.css({
          'top' : projectedTop - $tHeight,
          'left' : (windowWidth/2) + $scrollPos['scrollLeft'] - ($pWidth/2) + (settings.padding/2)
        });
      };
    };
  
    function _preload(){
      // Hide the next/previous links if on first or last images.
      _checkPosition();
    
      if(pp_type == 'image'){
        // Set the new image
        imgPreloader = new Image();
    
        // Preload the neighbour images
        nextImage = new Image();
        if(isSet && setPosition > setCount) nextImage.src = $(imagesArray[arrayPosition + 1]).attr('href');
        prevImage = new Image();
        if(isSet && imagesArray[arrayPosition - 1]) prevImage.src = $(imagesArray[arrayPosition - 1]).attr('href');

        pp_typeMarkup = '<img id="fullResImage" src="" />';        
        $pp_pic_holder.find('#pp_full_res')[0].innerHTML = pp_typeMarkup;

        $pp_pic_holder.find('.pp_content').css('overflow','hidden');
        $pp_pic_holder.find('#fullResImage').attr('src',$caller.attr('href'));

        imgPreloader.onload = function(){
          var correctSizes = _fitToViewport(imgPreloader.width,imgPreloader.height);
          imgPreloader.width = correctSizes['width'];
          imgPreloader.height = correctSizes['height'];
          showimage(imgPreloader.width,imgPreloader.height,correctSizes["containerWidth"],correctSizes["containerHeight"],correctSizes["contentHeight"],correctSizes["contentWidth"],correctSizes["resized"]);
        };
    
        imgPreloader.src = $caller.attr('href');
      }else{
        // Get the dimensions
        movie_width = ( parseFloat(grab_param('width',$caller.attr('href'))) ) ? grab_param('width',$caller.attr('href')) : "425";
        movie_height = ( parseFloat(grab_param('height',$caller.attr('href'))) ) ? grab_param('height',$caller.attr('href')) : "344";

        // If the size is % based
        if(movie_width.indexOf('%') != -1 || movie_height.indexOf('%') != -1){
          movie_height = ($(window).height() * parseFloat(movie_height) / 100) - 100;
          movie_width = ($(window).width() * parseFloat(movie_width) / 100) - 100;
          parsentBased = true;
        }else{
          movie_height = parseFloat(movie_height);
          movie_width = parseFloat(movie_width);
        }
        
        if(pp_type == 'quicktime'){ movie_height+=13; }
        
        // Fit them to viewport
        correctSizes = _fitToViewport(movie_width,movie_height);
        
        if(pp_type == 'youtube'){
          pp_typeMarkup = '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="'+correctSizes['width']+'" height="'+correctSizes['height']+'"><param name="allowfullscreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="movie" value="http://www.youtube.com/v/'+grab_param('v',$caller.attr('href'))+'" /><embed src="http://www.youtube.com/v/'+grab_param('v',$caller.attr('href'))+'" type="application/x-shockwave-flash" allowfullscreen="true" allowscriptaccess="always" width="'+correctSizes['width']+'" height="'+correctSizes['height']+'"></embed></object>';
        }else if(pp_type == 'quicktime'){
          pp_typeMarkup = '<object classid="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B" codebase="http://www.apple.com/qtactivex/qtplugin.cab" height="'+correctSizes['height']+'" width="'+correctSizes['width']+'"><param name="src" value="'+$caller.attr('href')+'"><param name="autoplay" value="true"><param name="type" value="video/quicktime"><embed src="'+$caller.attr('href')+'" height="'+correctSizes['height']+'" width="'+correctSizes['width']+'" autoplay="true" type="video/quicktime" pluginspage="http://www.apple.com/quicktime/download/"></embed></object>';
        }else if(pp_type == 'flash'){
          flash_vars = $caller.attr('href');
          flash_vars = flash_vars.substring($caller.attr('href').indexOf('flashvars') + 10,$caller.attr('href').length);

          filename = $caller.attr('href');
          filename = filename.substring(0,filename.indexOf('?'));

          pp_typeMarkup = '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="'+correctSizes['width']+'" height="'+correctSizes['height']+'"><param name="allowfullscreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="movie" value="'+filename+'?'+flash_vars+'" /><embed src="'+filename+'?'+flash_vars+'" type="application/x-shockwave-flash" allowfullscreen="true" allowscriptaccess="always" width="'+correctSizes['width']+'" height="'+correctSizes['height']+'"></embed></object>';
        }else if(pp_type == 'iframe'){
          movie_url = $caller.attr('href');
          movie_url = movie_url.substr(0,movie_url.indexOf('iframe')-1);

          pp_typeMarkup = '<iframe src ="'+movie_url+'" width="'+(correctSizes['width']-10)+'" height="'+(correctSizes['height']-10)+'" frameborder="no"></iframe>';
        }
        // Append HTML
        $pp_pic_holder.find('#pp_full_res')[0].innerHTML = pp_typeMarkup;
        
        // Show content
        showimage(correctSizes['width'],correctSizes['height'],correctSizes["containerWidth"],correctSizes["containerHeight"],correctSizes["contentHeight"],correctSizes["contentWidth"],correctSizes["resized"]);
      }
    };
  
    function _getScroll(){
      if (self.pageYOffset) {
        scrollTop = self.pageYOffset;
        scrollLeft = self.pageXOffset;
      } else if (document.documentElement && document.documentElement.scrollTop) {   // Explorer 6 Strict
        scrollTop = document.documentElement.scrollTop;
        scrollLeft = document.documentElement.scrollLeft;
      } else if (document.body) {// all other Explorers
        scrollTop = document.body.scrollTop;
        scrollLeft = document.body.scrollLeft;  
      }
      
      return {scrollTop:scrollTop,scrollLeft:scrollLeft};
    };
  
    function _resizeOverlay() {
      $('div.pp_overlay').css({
        'height':$(document).height(),
        'width':$(window).width()
      });
    };
  
    function _buildOverlay(){
      toInject = "";
      
      // Build the background overlay div
      toInject += "<div class='pp_overlay'></div>";
      
      // Define the markup to append, depending on the content type.
      if(pp_type == 'image'){
        pp_typeMarkup = '<img id="fullResImage" src="" />';
      }else{
        pp_typeMarkup = '';
      }
      
      // Basic HTML for the picture holder
//      toInject += '<div class="pp_pic_holder"><div class="pp_top"><div class="pp_left"></div><div class="pp_middle"></div><div class="pp_right"></div></div><div class="pp_content"><a href="#" class="pp_expand" title="Expand the image">Expand</a><div class="pp_loaderIcon"></div><div class="pp_hoverContainer"><a class="pp_next" href="#">next</a><a class="pp_previous" href="#">previous</a></div><div id="pp_full_res">'+ pp_typeMarkup +'</div><div class="pp_details clearfix"><a class="pp_close" href="#">Close</a><p class="pp_description"></p><div class="pp_nav"><a href="#" class="pp_arrow_previous">Previous</a><p class="currentTextHolder">0'+settings.counter_separator_label+'0</p><a href="#" class="pp_arrow_next">Next</a></div></div></div><div class="pp_bottom"><div class="pp_left"></div><div class="pp_middle"></div><div class="pp_right"></div></div></div>';
      toInject += '<div class="pp_pic_holder"><div class="pp_top"><div class="pp_left"></div><div class="pp_middle"></div><div class="pp_right"></div></div><div class="pp_content"><a href="#" class="pp_expand" title="'+settings.localize.expandTitle+'">'+settings.localize.expand+'</a><div class="pp_loaderIcon"></div><div class="pp_hoverContainer"><a class="pp_next" href="#">'+settings.localize.next+'</a><a class="pp_previous" href="#">'+settings.localize.previous+'</a></div><div id="pp_full_res">'+ pp_typeMarkup +'</div><div class="pp_details clearfix"><p class="pp_description"></p><div class="pp_nav"><a href="#" class="pp_arrow_previous">'+settings.localize.previous+'</a><p class="currentTextHolder">0'+settings.counter_separator_label+'0</p><a href="#" class="pp_arrow_next">'+settings.localize.next+'</a></div></div></div><div class="pp_bottom"><div class="pp_left"></div><div class="pp_middle"></div><div class="pp_right"></div></div><a class="pp_close" href="#"><span>'+settings.localize.close+'</span></a></div>';
      // Basic html for the title holder
      toInject += '<div class="ppt"></div>';
      
      $('body').append(toInject);
      
      // Set my global selectors
      $pp_pic_holder = $('.pp_pic_holder');
      $ppt = $('.ppt');
      
      $('div.pp_overlay').css('height',$(document).height()).bind('click',function(){
        close();
      });

      $pp_pic_holder.css({'opacity': 0}).addClass(settings.theme);

      $('a.pp_close').bind('click',function(){ close(); return false; });

      $('a.pp_expand').bind('click',function(){        
        $this = $(this);
        
        // Expand the image
        if($this.hasClass('pp_expand')){
          $this.removeClass('pp_expand').addClass('pp_contract');
          doresize = false;
        }else{
          $this.removeClass('pp_contract').addClass('pp_expand');
          doresize = true;
        };
      
        _hideContent();
        
        $pp_pic_holder.find('.pp_hoverContainer, #pp_full_res, .pp_details').fadeOut(settings.animationSpeed,function(){
          _preload();
        });
    
        return false;  
      });
    
      $pp_pic_holder.find('.pp_previous, .pp_arrow_previous').bind('click',function(){
        changePicture('previous');
        return false;
      });
    
      $pp_pic_holder.find('.pp_next, .pp_arrow_next').bind('click',function(){
        changePicture('next');
        return false;
      });

      $pp_pic_holder.find('.pp_hoverContainer').css({
        'margin-left': settings.padding/2
      });
    
      // If it's not a set, hide the links
      if(!isSet) {
        $pp_pic_holder.find('.pp_hoverContainer,.pp_nav').hide();
      };


      // To fix the bug with IE select boxes
      if($.browser.msie && $.browser.version == 6){
        $('body').addClass('ie6');
        $('select').css('visibility','hidden');
      };

      // Then fade it in
      $('div.pp_overlay').css('opacity',0).fadeTo(settings.animationSpeed,settings.opacity, function(){
        $pp_pic_holder.css('opacity',0).fadeIn(settings.animationSpeed,function(){
          $pp_pic_holder.attr('style','left:'+$pp_pic_holder.css('left')+';top:'+$pp_pic_holder.css('top')+';');
          _preload();
        });
      });
    };
  };
  
  function grab_param(name,url){
    name = name.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]");
    var regexS = "[\\?&]"+name+"=([^&#]*)";
    var regex = new RegExp( regexS );
    var results = regex.exec( url );
    if( results == null )
      return "";
    else
      return results[1];
  }
})(jQuery);

/**
 * Equal Heights Plugin
 * Equalize the heights of elements. Great for columns or any elements
 * that need to be the same size (floats, etc).
 * 
 * Version 1.0
 * Updated 12/10/2008
 *
 * Copyright (c) 2008 Rob Glazebrook (cssnewbie.com) 
 *
 * Usage: $(object).equalHeights([minHeight], [maxHeight]);
 * 
 * Example 1: $(".cols").equalHeights(); Sets all columns to the same height.
 * Example 2: $(".cols").equalHeights(400); Sets all cols to at least 400px tall.
 * Example 3: $(".cols").equalHeights(100,300); Cols are at least 100 but no more
 * than 300 pixels tall. Elements with too much content will gain a scrollbar.
 * 
 */

(function($) {
  $.fn.equalHeights = function(minHeight, maxHeight) {
    tallest = (minHeight) ? minHeight : 0;
    this.each(function() {
      if($(this).height() > tallest) {
        tallest = $(this).height();
      }
    });
    if((maxHeight) && tallest > maxHeight) tallest = maxHeight;
    return this.each(function() {
      $(this).height(tallest).css("overflow","auto");
    });
  }
  $.fn.equalOffsetTop = function() {
    tallest = 0;
    heightCorr = 0;
    difference = 0;
    this.each(function() {
      if($(this).offset().top > tallest) {
        tallest = $(this).offset().top;
      }
    });
    return this.each(function() {
      var thisOffset = $(this).offset();      
      $(this).offset({top: tallest, left: thisOffset.left });
      $(this).parent().css({height: $(this).parent().height() + tallest - thisOffset.top });
    });
  }
})(jQuery);

/*
* jQuery.ImageSwitch
* Version: 1.1.0
* http://www.hieu.co.uk/ImageSwitch/
*
* Copyright (c) 2009 Hieu Pham - http://www.hieu.co.uk
* COMMON DEVELOPMENT AND DISTRIBUTION LICENSE (CDDL)
* http://www.opensource.org/licenses/cddl1.php
*
* Date: 24/01/2011
* Revision: 50
*/
var Debug = function(b, a) { if (!$("#Debug")) { $("body").append("<div id='Debug'></div>") } if (a) { $("#Debug").html($("#Debug").html() + "<br/>" + b) } else { $("#Debug").html($("#Debug").html() + b) } }; var max_ImageSwitch_Effect_ID = 0; (function(a) { a.fn.ImageSwitch = function(l, d) { var f = { Type: "FadeIn", NewImage: "", EffectOriginal: true, Speed: 1000, StartLeft: 50, StartTop: 0, StartOpacity: 0, EndLeft: -50, EndTop: 0, EndOpacity: 0, Direction: "RightLeft", Door1: "", Door2: "" }; var q = a.extend(f, l); var i = this; var h = 0; var k; var p; var o; var j = function() { i.data("imageswitch", -1) }; if (a.isFunction(d)) { j = function() { d(); i.data(i, -1) } } var c = function() { i.parent().append("<img class='GrpEffectImg' id='" + k.replace("#", "") + "'/>"); a(k).attr("src", i.attr("src")); a(k).css("position", "absolute"); a(k).css("top", i.position().top); a(k).css("left", i.position().left); a(k).css("opacity", 1); i.attr("src", q.NewImage); if (q.EffectOriginal) { i.css("opacity", q.StartOpacity); i.animate({ opacity: 1 }, q.Speed) } a(k).animate({ opacity: 0 }, q.Speed, function() { a(k).remove(); j() }) }; var g = function(r) { a("body").append("<img class='GrpEffectImg' id='" + k.replace("#", "") + "'/>"); a(k).css("position", "absolute"); if (r) { a(k).attr("src", q.NewImage); a(k).css("top", i.offset().top + q.StartTop); a(k).css("left", i.offset().left + q.StartLeft); a(k).css("opacity", q.StartOpacity); EndTop = i.offset().top; EndLeft = i.offset().left; EndOpacity = 1 } else { a(k).attr("src", i.attr("src")); i.attr("src", q.NewImage); a(k).css("top", i.offset().top); a(k).css("left", i.offset().left); a(k).css("opacity", 1); EndTop = i.offset().top + q.EndTop; EndLeft = i.offset().left + q.EndLeft; EndOpacity = q.EndOpacity } a(k).animate({ opacity: EndOpacity, top: EndTop, left: EndLeft }, q.Speed, function() { i.attr("src", q.NewImage); a(k).remove(); j() }) }; var b = function(u) { var t = i.clone(true); i.wrap("<div id='GrpViewport-" + h + "'></div>"); a("#GrpViewport-" + h).css("overflow", "hidden"); a("#GrpViewport-" + h).width(i.width()); a("#GrpViewport-" + h).height(i.height()); a("#GrpViewport-" + h).append("<img class='GrpEffectImg' id='" + k.replace("#", "") + "'/>"); a(k).css("position", "absolute"); var r = 0; var s = 0; switch (q.Direction) { case "RightLeft": s = -i.width(); break; case "LeftRight": s = i.width(); break; case "TopDown": r = -i.height(); break; case "DownTop": r = i.height(); break } if (u) { a(k).attr("src", q.NewImage); a(k).css("top", r); a(k).css("left", s); a(k).css("opacity", q.StartOpacity); EndTop = 0; EndLeft = 0; EndOpacity = 1 } else { a(k).attr("src", i.attr("src")); a(k).css("left", 0); a(k).css("top", 0); i.attr("src", q.NewImage); EndTop = r; EndLeft = s; EndOpacity = q.EndOpacity } if (i.css("position") != "absolute") { a("#GrpViewport-" + h).css("position", "relative"); i.css("position", "absolute") } else { a("#GrpViewport-" + h).css("position", "absolute"); a("#GrpViewport-" + h).css("left", i.css("left")); a("#GrpViewport-" + h).css("top", i.css("top")); i.css("top", 0); i.css("left", 0) } if (q.EffectOriginal && u) { i.animate({ top: -r, left: -s }, q.Speed) } a(k).animate({ opacity: EndOpacity, top: EndTop, left: EndLeft }, q.Speed, function() { t.attr("src", q.NewImage); t.removeAttr("imageswitch"); a("#GrpViewport-" + h).replaceWith(t); j() }) }; var n = function() { var t = i.clone(true); i.wrap("<div id='GrpViewport'></div>"); a("#GrpViewport").css("overflow", "hidden"); a("#GrpViewport").width(i.width()); a("#GrpViewport").height(i.height()); a("#GrpViewport").append("<div class='GrpEffectDiv' id='" + p.replace("#", "") + "'/>"); a(p).attr("src", q.NewImage); a(p).css("position", "absolute"); a(p).css("background-color", "#FFF"); if (q.Door1.length > 0) { a(p).css("background", q.Door1) } a(p).width(i.width()); a(p).height(i.height()); var r = 0; var s = 0; switch (q.Direction) { case "RightLeft": s = -i.width(); break; case "LeftRight": s = i.width(); break; case "TopDown": r = -i.height(); break; case "DownTop": r = i.height(); break } a(p).css("top", r); a(p).css("left", s); if (i.css("position") != "absolute") { a("#GrpViewport").css("position", "relative"); i.css("position", "absolute") } else { a("#GrpViewport").css("position", "absolute"); a("#GrpViewport").css("left", i.css("left")); a("#GrpViewport").css("top", i.css("top")); i.css("top", 0); i.css("left", 0) } a(p).animate({ top: 0, left: 0 }, q.Speed, function() { i.attr("src", q.NewImage); a(p).animate({ top: r, left: s }, q.Speed, function() { t.attr("src", q.NewImage); t.removeAttr("imageswitch"); a("#GrpViewport").replaceWith(t); j() }) }) }; var e = function() { var v = i.css("position"); var r = i.css("left"); var u = i.css("top"); i.wrap("<div id='GrpViewport'></div>"); a("#GrpViewport").css("overflow", "hidden"); a("#GrpViewport").width(i.width()); a("#GrpViewport").height(i.height()); a("#GrpViewport").append("<div class='GrpEffectDiv' id='" + p.replace("#", "") + "'/>"); a(p).css("position", "absolute"); a(p).css("background-color", "#FFF"); if (q.Door1.length > 0) { a(p).css("background", q.Door1) } a(p).width(i.width()); a(p).height(i.height()); a("#GrpViewport").append("<div class='GrpEffectDiv1' id='" + o.replace("#", "") + "'/>"); a(o).css("position", "absolute"); a(o).css("background-color", "#FFF"); if (q.Door2.length > 0) { a(o).css("background", q.Door2) } a(o).width(i.width()); a(o).height(i.height()); var s = 0; var t = 0; switch (q.Direction) { case "RightLeft": t = -i.width(); break; case "LeftRight": t = i.width(); break; case "TopDown": s = -i.height(); break; case "DownTop": s = i.height(); break } a(p).css("top", s); a(p).css("left", t); a(o).css("top", -s); a(o).css("left", -t); if (!q.EffectOriginal) { a(p).css("background", "#FFF url(" + q.NewImage + ") no-repeat " + -t / 2 + "px " + -s / 2 + "px"); a(o).css("background", "#FFF url(" + q.NewImage + ") no-repeat " + t / 2 + "px " + s / 2 + "px") } if (i.css("position") != "absolute") { a("#GrpViewport").css("position", "relative"); i.css("position", "absolute") } else { a("#GrpViewport").css("position", "absolute"); a("#GrpViewport").css("left", r); a("#GrpViewport").css("top", u); i.css("position", "absolute"); i.css("top", 0); i.css("left", 0) } a(p).animate({ top: s / 2, left: t / 2 }, q.Speed, function() { i.attr("src", q.NewImage); if (!q.EffectOriginal) { i.css("position", v); i.css("top", u); i.css("left", r); a("#GrpViewport").replaceWith(i) } else { a(p).animate({ top: s, left: t }, q.Speed, function() { i.css("position", v); i.css("top", u); i.css("left", r); a("#GrpViewport").replaceWith(i) }) } }); a(o).animate({ top: -s / 2, left: -t / 2 }, q.Speed, function() { i.attr("src", q.NewImage); if (!q.EffectOriginal) { j() } else { a(o).animate({ top: -s, left: -t }, q.Speed, function() { j() }) } }) }; var m = function(s) { var r = i.clone(true); if (i.css("z-index") == "auto") { i.css("z-index", 100) } if (i.css("position") != "absolute") { i.css("position", "relative") } a("body").append("<img class='GrpEffectImg'  id='" + k.replace("#", "") + "'/>"); a(k).css("position", "absolute"); a(k).css("top", i.offset().top); a(k).css("left", i.offset().left); if (s) { a(k).css("opacity", q.StartOpacity); a(k).css("z-index", i.css("z-index") - 1); a(k).attr("src", q.NewImage) } else { a(k).css("opacity", 1); a(k).css("z-index", i.css("z-index") + 1); a(k).attr("src", i.attr("src")); i.attr("src", q.NewImage) } if (Math.abs(q.EndTop) < i.height() && Math.abs(q.EndLeft) < i.width()) { EndTop = i.offset().top; EndLeft = i.offset().left + i.width() } else { EndTop = i.offset().top + q.EndTop; EndLeft = i.offset().left + q.EndLeft } EndOpacity = 1; a(k).animate({ opacity: EndOpacity, top: EndTop, left: EndLeft }, q.Speed, function() { if (s) { a(k).css("z-index", 101) } else { EndOpacity = q.EndOpacity; a(k).css("z-index", 2) } a(k).animate({ opacity: EndOpacity, top: i.offset().top, left: i.offset().left }, q.Speed, function() { r.attr("src", q.NewImage); r.removeAttr("imageswitch"); i.replaceWith(r); a(k).remove(); j() }) }) }; return this.each(function() { i = a(this); if (!i.ImageAnimating()) { h = max_ImageSwitch_Effect_ID; max_ImageSwitch_Effect_ID += 1; i.data(i, h); k = "#GrpEffectImg-" + h; p = "#GrpEffectDiv1-" + h; o = "#GrpEffectDiv2-" + h; var r = new Image(); r.src = q.NewImage; a.ImagePreload(q.NewImage, function() { switch (q.Type) { case "FadeIn": c(); break; case "FlyIn": g(true); break; case "FlyOut": g(false); break; case "FlipIn": m(true); break; case "FlipOut": m(false); break; case "ScrollIn": b(true); break; case "ScrollOut": b(false); break; case "SingleDoor": n(); break; case "DoubleDoor": e(); break } }) } }) } })(jQuery); (function(a) { a.fn.ImageAnimating = function() { if (this.data("imageswitch") > 0) { return true } else { return false } } })(jQuery); (function(a) { a.fn.ImageStop = function(c, b, d) { return this.each(function() { if (a(this).ImageAnimating()) { var e = a.data(this, "imageswitch"); a("#GrpEffectImg-" + e).stop(c, b); a("#GrpEffectDiv-" + e).stop(c, b); a("#GrpEffectDiv1-" + e).stop(c, b); a(this).stop(c, b); a("#GrpEffectImg-" + e).remove(); a("#GrpEffectDiv-" + e).remove(); a("#GrpEffectDiv1-" + e).remove(); if (a.isFunction(d)) { d() } } }) } })(jQuery); (function(a) { a.ImageStopAll = function(c, b, d) { a(".GrpEffectImg").stop(c, b); a(".GrpEffectDiv").stop(c, b); a(".GrpEffectDiv1").stop(c, b); a(this).stop(c, b); a(".GrpEffectImg").remove(); a(".GrpEffectDiv").remove(); a(".GrpEffectDiv1").remove(); a.data(this, "imageswitch", -1); if (a.isFunction(d)) { d() } } })(jQuery); (function(a) { a.ImagePreload = function(b, d) { var c = new Image(); c.src = b; if (a.isFunction(d)) { a(c).load(d()) } } })(jQuery);

/* END jQuery.ImageSwitch */

/* http://keith-wood.name/countdown.html
   Countdown for jQuery v1.5.9.
   Written by Keith Wood (kbwood{at}iinet.com.au) January 2008.
   Dual licensed under the GPL (http://dev.jquery.com/browser/trunk/jquery/GPL-LICENSE.txt) and 
   MIT (http://dev.jquery.com/browser/trunk/jquery/MIT-LICENSE.txt) licenses. 
   Please attribute the author if you use it. */
(function($){function Countdown(){this.regional=[];this.regional['']={labels:['Years','Months','Weeks','Days','Hours','Minutes','Seconds'],labels1:['Year','Month','Week','Day','Hour','Minute','Second'],compactLabels:['y','m','w','d'],whichLabels:null,timeSeparator:':',isRTL:false};this._defaults={until:null,since:null,timezone:null,serverSync:null,format:'dHMS',layout:'',compact:false,significant:0,description:'',expiryUrl:'',expiryText:'',alwaysExpire:false,onExpiry:null,onTick:null,tickInterval:1};$.extend(this._defaults,this.regional['']);this._serverSyncs=[]}var w='countdown';var Y=0;var O=1;var W=2;var D=3;var H=4;var M=5;var S=6;$.extend(Countdown.prototype,{markerClassName:'hasCountdown',_timer:setInterval(function(){$.countdown._updateTargets()},980),_timerTargets:[],setDefaults:function(a){this._resetExtraLabels(this._defaults,a);extendRemove(this._defaults,a||{})},UTCDate:function(a,b,c,e,f,g,h,i){if(typeof b=='object'&&b.constructor==Date){i=b.getMilliseconds();h=b.getSeconds();g=b.getMinutes();f=b.getHours();e=b.getDate();c=b.getMonth();b=b.getFullYear()}var d=new Date();d.setUTCFullYear(b);d.setUTCDate(1);d.setUTCMonth(c||0);d.setUTCDate(e||1);d.setUTCHours(f||0);d.setUTCMinutes((g||0)-(Math.abs(a)<30?a*60:a));d.setUTCSeconds(h||0);d.setUTCMilliseconds(i||0);return d},periodsToSeconds:function(a){return a[0]*31557600+a[1]*2629800+a[2]*604800+a[3]*86400+a[4]*3600+a[5]*60+a[6]},_settingsCountdown:function(a,b){if(!b){return $.countdown._defaults}var c=$.data(a,w);return(b=='all'?c.options:c.options[b])},_attachCountdown:function(a,b){var c=$(a);if(c.hasClass(this.markerClassName)){return}c.addClass(this.markerClassName);var d={options:$.extend({},b),_periods:[0,0,0,0,0,0,0]};$.data(a,w,d);this._changeCountdown(a)},_addTarget:function(a){if(!this._hasTarget(a)){this._timerTargets.push(a)}},_hasTarget:function(a){return($.inArray(a,this._timerTargets)>-1)},_removeTarget:function(b){this._timerTargets=$.map(this._timerTargets,function(a){return(a==b?null:a)})},_updateTargets:function(){for(var i=this._timerTargets.length-1;i>=0;i--){this._updateCountdown(this._timerTargets[i])}},_updateCountdown:function(a,b){var c=$(a);b=b||$.data(a,w);if(!b){return}c.html(this._generateHTML(b));c[(this._get(b,'isRTL')?'add':'remove')+'Class']('countdown_rtl');var d=this._get(b,'onTick');if(d){var e=b._hold!='lap'?b._periods:this._calculatePeriods(b,b._show,this._get(b,'significant'),new Date());var f=this._get(b,'tickInterval');if(f==1||this.periodsToSeconds(e)%f==0){d.apply(a,[e])}}var g=b._hold!='pause'&&(b._since?b._now.getTime()<b._since.getTime():b._now.getTime()>=b._until.getTime());if(g&&!b._expiring){b._expiring=true;if(this._hasTarget(a)||this._get(b,'alwaysExpire')){this._removeTarget(a);var h=this._get(b,'onExpiry');if(h){h.apply(a,[])}var i=this._get(b,'expiryText');if(i){var j=this._get(b,'layout');b.options.layout=i;this._updateCountdown(a,b);b.options.layout=j}var k=this._get(b,'expiryUrl');if(k){window.location=k}}b._expiring=false}else if(b._hold=='pause'){this._removeTarget(a)}$.data(a,w,b)},_changeCountdown:function(a,b,c){b=b||{};if(typeof b=='string'){var d=b;b={};b[d]=c}var e=$.data(a,w);if(e){this._resetExtraLabels(e.options,b);extendRemove(e.options,b);this._adjustSettings(a,e);$.data(a,w,e);var f=new Date();if((e._since&&e._since<f)||(e._until&&e._until>f)){this._addTarget(a)}this._updateCountdown(a,e)}},_resetExtraLabels:function(a,b){var c=false;for(var n in b){if(n!='whichLabels'&&n.match(/[Ll]abels/)){c=true;break}}if(c){for(var n in a){if(n.match(/[Ll]abels[0-9]/)){a[n]=null}}}},_adjustSettings:function(a,b){var c;var d=this._get(b,'serverSync');var e=0;var f=null;for(var i=0;i<this._serverSyncs.length;i++){if(this._serverSyncs[i][0]==d){f=this._serverSyncs[i][1];break}}if(f!=null){e=(d?f:0);c=new Date()}else{var g=(d?d.apply(a,[]):null);c=new Date();e=(g?c.getTime()-g.getTime():0);this._serverSyncs.push([d,e])}var h=this._get(b,'timezone');h=(h==null?-c.getTimezoneOffset():h);b._since=this._get(b,'since');if(b._since!=null){b._since=this.UTCDate(h,this._determineTime(b._since,null));if(b._since&&e){b._since.setMilliseconds(b._since.getMilliseconds()+e)}}b._until=this.UTCDate(h,this._determineTime(this._get(b,'until'),c));if(e){b._until.setMilliseconds(b._until.getMilliseconds()+e)}b._show=this._determineShow(b)},_destroyCountdown:function(a){var b=$(a);if(!b.hasClass(this.markerClassName)){return}this._removeTarget(a);b.removeClass(this.markerClassName).empty();$.removeData(a,w)},_pauseCountdown:function(a){this._hold(a,'pause')},_lapCountdown:function(a){this._hold(a,'lap')},_resumeCountdown:function(a){this._hold(a,null)},_hold:function(a,b){var c=$.data(a,w);if(c){if(c._hold=='pause'&&!b){c._periods=c._savePeriods;var d=(c._since?'-':'+');c[c._since?'_since':'_until']=this._determineTime(d+c._periods[0]+'y'+d+c._periods[1]+'o'+d+c._periods[2]+'w'+d+c._periods[3]+'d'+d+c._periods[4]+'h'+d+c._periods[5]+'m'+d+c._periods[6]+'s');this._addTarget(a)}c._hold=b;c._savePeriods=(b=='pause'?c._periods:null);$.data(a,w,c);this._updateCountdown(a,c)}},_getTimesCountdown:function(a){var b=$.data(a,w);return(!b?null:(!b._hold?b._periods:this._calculatePeriods(b,b._show,this._get(b,'significant'),new Date())))},_get:function(a,b){return(a.options[b]!=null?a.options[b]:$.countdown._defaults[b])},_determineTime:function(k,l){var m=function(a){var b=new Date();b.setTime(b.getTime()+a*1000);return b};var n=function(a){a=a.toLowerCase();var b=new Date();var c=b.getFullYear();var d=b.getMonth();var e=b.getDate();var f=b.getHours();var g=b.getMinutes();var h=b.getSeconds();var i=/([+-]?[0-9]+)\s*(s|m|h|d|w|o|y)?/g;var j=i.exec(a);while(j){switch(j[2]||'s'){case's':h+=parseInt(j[1],10);break;case'm':g+=parseInt(j[1],10);break;case'h':f+=parseInt(j[1],10);break;case'd':e+=parseInt(j[1],10);break;case'w':e+=parseInt(j[1],10)*7;break;case'o':d+=parseInt(j[1],10);e=Math.min(e,$.countdown._getDaysInMonth(c,d));break;case'y':c+=parseInt(j[1],10);e=Math.min(e,$.countdown._getDaysInMonth(c,d));break}j=i.exec(a)}return new Date(c,d,e,f,g,h,0)};var o=(k==null?l:(typeof k=='string'?n(k):(typeof k=='number'?m(k):k)));if(o)o.setMilliseconds(0);return o},_getDaysInMonth:function(a,b){return 32-new Date(a,b,32).getDate()},_normalLabels:function(a){return a},_generateHTML:function(c){var d=this._get(c,'significant');c._periods=(c._hold?c._periods:this._calculatePeriods(c,c._show,d,new Date()));var e=false;var f=0;var g=d;var h=$.extend({},c._show);for(var i=Y;i<=S;i++){e|=(c._show[i]=='?'&&c._periods[i]>0);h[i]=(c._show[i]=='?'&&!e?null:c._show[i]);f+=(h[i]?1:0);g-=(c._periods[i]>0?1:0)}var j=[false,false,false,false,false,false,false];for(var i=S;i>=Y;i--){if(c._show[i]){if(c._periods[i]){j[i]=true}else{j[i]=g>0;g--}}}var k=this._get(c,'compact');var l=this._get(c,'layout');var m=(k?this._get(c,'compactLabels'):this._get(c,'labels'));var n=this._get(c,'whichLabels')||this._normalLabels;var o=this._get(c,'timeSeparator');var p=this._get(c,'description')||'';var q=function(a){var b=$.countdown._get(c,'compactLabels'+n(c._periods[a]));return(h[a]?c._periods[a]+(b?b[a]:m[a])+' ':'')};var r=function(a){var b=$.countdown._get(c,'labels'+n(c._periods[a]));return((!d&&h[a])||(d&&j[a])?'<span class="countdown_section"><span class="countdown_amount">'+c._periods[a]+'</span><br/>'+(b?b[a]:m[a])+'</span>':'')};return(l?this._buildLayout(c,h,l,k,d,j):((k?'<span class="countdown_row countdown_amount'+(c._hold?' countdown_holding':'')+'">'+q(Y)+q(O)+q(W)+q(D)+(h[H]?this._minDigits(c._periods[H],2):'')+(h[M]?(h[H]?o:'')+this._minDigits(c._periods[M],2):'')+(h[S]?(h[H]||h[M]?o:'')+this._minDigits(c._periods[S],2):''):'<span class="countdown_row countdown_show'+(d||f)+(c._hold?' countdown_holding':'')+'">'+r(Y)+r(O)+r(W)+r(D)+r(H)+r(M)+r(S))+'</span>'+(p?'<span class="countdown_row countdown_descr">'+p+'</span>':'')))},_buildLayout:function(c,d,e,f,g,h){var j=this._get(c,(f?'compactLabels':'labels'));var k=this._get(c,'whichLabels')||this._normalLabels;var l=function(a){return($.countdown._get(c,(f?'compactLabels':'labels')+k(c._periods[a]))||j)[a]};var m=function(a,b){return Math.floor(a/b)%10};var o={desc:this._get(c,'description'),sep:this._get(c,'timeSeparator'),yl:l(Y),yn:c._periods[Y],ynn:this._minDigits(c._periods[Y],2),ynnn:this._minDigits(c._periods[Y],3),y1:m(c._periods[Y],1),y10:m(c._periods[Y],10),y100:m(c._periods[Y],100),y1000:m(c._periods[Y],1000),ol:l(O),on:c._periods[O],onn:this._minDigits(c._periods[O],2),onnn:this._minDigits(c._periods[O],3),o1:m(c._periods[O],1),o10:m(c._periods[O],10),o100:m(c._periods[O],100),o1000:m(c._periods[O],1000),wl:l(W),wn:c._periods[W],wnn:this._minDigits(c._periods[W],2),wnnn:this._minDigits(c._periods[W],3),w1:m(c._periods[W],1),w10:m(c._periods[W],10),w100:m(c._periods[W],100),w1000:m(c._periods[W],1000),dl:l(D),dn:c._periods[D],dnn:this._minDigits(c._periods[D],2),dnnn:this._minDigits(c._periods[D],3),d1:m(c._periods[D],1),d10:m(c._periods[D],10),d100:m(c._periods[D],100),d1000:m(c._periods[D],1000),hl:l(H),hn:c._periods[H],hnn:this._minDigits(c._periods[H],2),hnnn:this._minDigits(c._periods[H],3),h1:m(c._periods[H],1),h10:m(c._periods[H],10),h100:m(c._periods[H],100),h1000:m(c._periods[H],1000),ml:l(M),mn:c._periods[M],mnn:this._minDigits(c._periods[M],2),mnnn:this._minDigits(c._periods[M],3),m1:m(c._periods[M],1),m10:m(c._periods[M],10),m100:m(c._periods[M],100),m1000:m(c._periods[M],1000),sl:l(S),sn:c._periods[S],snn:this._minDigits(c._periods[S],2),snnn:this._minDigits(c._periods[S],3),s1:m(c._periods[S],1),s10:m(c._periods[S],10),s100:m(c._periods[S],100),s1000:m(c._periods[S],1000)};var p=e;for(var i=Y;i<=S;i++){var q='yowdhms'.charAt(i);var r=new RegExp('\\{'+q+'<\\}(.*)\\{'+q+'>\\}','g');p=p.replace(r,((!g&&d[i])||(g&&h[i])?'$1':''))}$.each(o,function(n,v){var a=new RegExp('\\{'+n+'\\}','g');p=p.replace(a,v)});return p},_minDigits:function(a,b){a=''+a;if(a.length>=b){return a}a='0000000000'+a;return a.substr(a.length-b)},_determineShow:function(a){var b=this._get(a,'format');var c=[];c[Y]=(b.match('y')?'?':(b.match('Y')?'!':null));c[O]=(b.match('o')?'?':(b.match('O')?'!':null));c[W]=(b.match('w')?'?':(b.match('W')?'!':null));c[D]=(b.match('d')?'?':(b.match('D')?'!':null));c[H]=(b.match('h')?'?':(b.match('H')?'!':null));c[M]=(b.match('m')?'?':(b.match('M')?'!':null));c[S]=(b.match('s')?'?':(b.match('S')?'!':null));return c},_calculatePeriods:function(c,d,e,f){c._now=f;c._now.setMilliseconds(0);var g=new Date(c._now.getTime());if(c._since){if(f.getTime()<c._since.getTime()){c._now=f=g}else{f=c._since}}else{g.setTime(c._until.getTime());if(f.getTime()>c._until.getTime()){c._now=f=g}}var h=[0,0,0,0,0,0,0];if(d[Y]||d[O]){var i=$.countdown._getDaysInMonth(f.getFullYear(),f.getMonth());var j=$.countdown._getDaysInMonth(g.getFullYear(),g.getMonth());var k=(g.getDate()==f.getDate()||(g.getDate()>=Math.min(i,j)&&f.getDate()>=Math.min(i,j)));var l=function(a){return(a.getHours()*60+a.getMinutes())*60+a.getSeconds()};var m=Math.max(0,(g.getFullYear()-f.getFullYear())*12+g.getMonth()-f.getMonth()+((g.getDate()<f.getDate()&&!k)||(k&&l(g)<l(f))?-1:0));h[Y]=(d[Y]?Math.floor(m/12):0);h[O]=(d[O]?m-h[Y]*12:0);f=new Date(f.getTime());var n=(f.getDate()==i);var o=$.countdown._getDaysInMonth(f.getFullYear()+h[Y],f.getMonth()+h[O]);if(f.getDate()>o){f.setDate(o)}f.setFullYear(f.getFullYear()+h[Y]);f.setMonth(f.getMonth()+h[O]);if(n){f.setDate(o)}}var p=Math.floor((g.getTime()-f.getTime())/1000);var q=function(a,b){h[a]=(d[a]?Math.floor(p/b):0);p-=h[a]*b};q(W,604800);q(D,86400);q(H,3600);q(M,60);q(S,1);if(p>0&&!c._since){var r=[1,12,4.3482,7,24,60,60];var s=S;var t=1;for(var u=S;u>=Y;u--){if(d[u]){if(h[s]>=t){h[s]=0;p=1}if(p>0){h[u]++;p=0;s=u;t=1}}t*=r[u]}}if(e){for(var u=Y;u<=S;u++){if(e&&h[u]){e--}else if(!e){h[u]=0}}}return h}});function extendRemove(a,b){$.extend(a,b);for(var c in b){if(b[c]==null){a[c]=null}}return a}$.fn.countdown=function(a){var b=Array.prototype.slice.call(arguments,1);if(a=='getTimes'||a=='settings'){return $.countdown['_'+a+'Countdown'].apply($.countdown,[this[0]].concat(b))}return this.each(function(){if(typeof a=='string'){$.countdown['_'+a+'Countdown'].apply($.countdown,[this].concat(b))}else{$.countdown._attachCountdown(this,a)}})};$.countdown=new Countdown()})(jQuery);



/* CONTENT SCROLLER */
                               
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            
/*! Copyright (c) 2010 Brandon Aaron (http://brandonaaron.net)
 * Licensed under the MIT License (LICENSE.txt).
 *
 * Thanks to: http://adomas.org/javascript-mouse-wheel/ for some pointers.
 * Thanks to: Mathias Bank(http://www.mathias-bank.de) for a scope bug fix.
 * Thanks to: Seamus Leahy for adding deltaX and deltaY
 *
 * Version: 3.0.4
 * 
 * Requires: 1.2.2+
 */

(function($) {

var types = ['DOMMouseScroll', 'mousewheel'];

$.event.special.mousewheel = {
    setup: function() {
        if ( this.addEventListener ) {
            for ( var i=types.length; i; ) {
                this.addEventListener( types[--i], handler, false );
            }
        } else {
            this.onmousewheel = handler;
        }
    },
    
    teardown: function() {
        if ( this.removeEventListener ) {
            for ( var i=types.length; i; ) {
                this.removeEventListener( types[--i], handler, false );
            }
        } else {
            this.onmousewheel = null;
        }
    }
};

$.fn.extend({
    mousewheel: function(fn) {
        return fn ? this.bind("mousewheel", fn) : this.trigger("mousewheel");
    },
    
    unmousewheel: function(fn) {
        return this.unbind("mousewheel", fn);
    }
});


function handler(event) {
    var orgEvent = event || window.event, args = [].slice.call( arguments, 1 ), delta = 0, returnValue = true, deltaX = 0, deltaY = 0;
    event = $.event.fix(orgEvent);
    event.type = "mousewheel";
    
    // Old school scrollwheel delta
    if ( event.wheelDelta ) { delta = event.wheelDelta/120; }
    if ( event.detail     ) { delta = -event.detail/3; }
    
    // New school multidimensional scroll (touchpads) deltas
    deltaY = delta;
    
    // Gecko
    if ( orgEvent.axis !== undefined && orgEvent.axis === orgEvent.HORIZONTAL_AXIS ) {
        deltaY = 0;
        deltaX = -1*delta;
    }
    
    // Webkit
    if ( orgEvent.wheelDeltaY !== undefined ) { deltaY = orgEvent.wheelDeltaY/120; }
    if ( orgEvent.wheelDeltaX !== undefined ) { deltaX = -1*orgEvent.wheelDeltaX/120; }
    
    // Add event and delta to the front of the arguments
    args.unshift(event, delta, deltaX, deltaY);
    
    return $.event.handle.apply(this, args);
}

})(jQuery);    
    
    
 /**
 * @author trixta
 * @version 1.2
 */
(function($){

var mwheelI = {
            pos: [-260, -260]
        },
    minDif     = 3,
    doc     = document,
    root     = doc.documentElement,
    body     = doc.body,
    longDelay, shortDelay
;

function unsetPos(){
    if(this === mwheelI.elem){
        mwheelI.pos = [-260, -260];
        mwheelI.elem = false;
        minDif = 3;
    }
}

$.event.special.mwheelIntent = {
    setup: function(){
        var jElm = $(this).bind('mousewheel', $.event.special.mwheelIntent.handler);
        if( this !== doc && this !== root && this !== body ){
            jElm.bind('mouseleave', unsetPos);
        }
        jElm = null;
        return true;
    },
    teardown: function(){
        $(this)
            .unbind('mousewheel', $.event.special.mwheelIntent.handler)
            .unbind('mouseleave', unsetPos)
        ;
        return true;
    },
    handler: function(e, d){
        var pos = [e.clientX, e.clientY];
        if( this === mwheelI.elem || Math.abs(mwheelI.pos[0] - pos[0]) > minDif || Math.abs(mwheelI.pos[1] - pos[1]) > minDif ){
            mwheelI.elem = this;
            mwheelI.pos = pos;
            minDif = 250;
            
            clearTimeout(shortDelay);
            shortDelay = setTimeout(function(){
                minDif = 10;
            }, 200);
            clearTimeout(longDelay);
            longDelay = setTimeout(function(){
                minDif = 3;
            }, 1500);
            e = $.extend({}, e, {type: 'mwheelIntent'});
            return $.event.handle.apply(this, arguments);
        }
    }
};
$.fn.extend({
    mwheelIntent: function(fn) {
        return fn ? this.bind("mwheelIntent", fn) : this.trigger("mwheelIntent");
    },
    
    unmwheelIntent: function(fn) {
        return this.unbind("mwheelIntent", fn);
    }
});

$(function(){
    body = doc.body;
    //assume that document is always scrollable, doesn't hurt if not
    $(doc).bind('mwheelIntent.mwheelIntentDefault', $.noop);
});
})(jQuery);
     
     
      
      
      
/*
 * jScrollPane - v2.0.0beta11 - 2011-07-04
 * http://jscrollpane.kelvinluck.com/
 *
 * Copyright (c) 2010 Kelvin Luck
 * Dual licensed under the MIT and GPL licenses.
 */
(function(b,a,c){b.fn.jScrollPane=function(e){function d(D,O){var az,Q=this,Y,ak,v,am,T,Z,y,q,aA,aF,av,i,I,h,j,aa,U,aq,X,t,A,ar,af,an,G,l,au,ay,x,aw,aI,f,L,aj=true,P=true,aH=false,k=false,ap=D.clone(false,false).empty(),ac=b.fn.mwheelIntent?"mwheelIntent.jsp":"mousewheel.jsp";aI=D.css("paddingTop")+" "+D.css("paddingRight")+" "+D.css("paddingBottom")+" "+D.css("paddingLeft");f=(parseInt(D.css("paddingLeft"),10)||0)+(parseInt(D.css("paddingRight"),10)||0);function at(aR){var aM,aO,aN,aK,aJ,aQ,aP=false,aL=false;az=aR;if(Y===c){aJ=D.scrollTop();aQ=D.scrollLeft();D.css({overflow:"hidden",padding:0});ak=D.innerWidth()+f;v=D.innerHeight();D.width(ak);Y=b('<div class="jspPane" />').css("padding",aI).append(D.children());am=b('<div class="jspContainer" />').css({width:ak+"px",height:v+"px"}).append(Y).appendTo(D)}else{D.css("width","");aP=az.stickToBottom&&K();aL=az.stickToRight&&B();aK=D.innerWidth()+f!=ak||D.outerHeight()!=v;if(aK){ak=D.innerWidth()+f;v=D.innerHeight();am.css({width:ak+"px",height:v+"px"})}if(!aK&&L==T&&Y.outerHeight()==Z){D.width(ak);return}L=T;Y.css("width","");D.width(ak);am.find(">.jspVerticalBar,>.jspHorizontalBar").remove().end()}Y.css("overflow","auto");if(aR.contentWidth){T=aR.contentWidth}else{T=Y[0].scrollWidth}Z=Y[0].scrollHeight;Y.css("overflow","");y=T/ak;q=Z/v;aA=q>1;aF=y>1;if(!(aF||aA)){D.removeClass("jspScrollable");Y.css({top:0,width:am.width()-f});n();E();R();w();ai()}else{D.addClass("jspScrollable");aM=az.maintainPosition&&(I||aa);if(aM){aO=aD();aN=aB()}aG();z();F();if(aM){N(aL?(T-ak):aO,false);M(aP?(Z-v):aN,false)}J();ag();ao();if(az.enableKeyboardNavigation){S()}if(az.clickOnTrack){p()}C();if(az.hijackInternalLinks){m()}}if(az.autoReinitialise&&!aw){aw=setInterval(function(){at(az)},az.autoReinitialiseDelay)}else{if(!az.autoReinitialise&&aw){clearInterval(aw)}}aJ&&D.scrollTop(0)&&M(aJ,false);aQ&&D.scrollLeft(0)&&N(aQ,false);D.trigger("jsp-initialised",[aF||aA])}function aG(){if(aA){am.append(b('<div class="jspVerticalBar" />').append(b('<div class="jspCap jspCapTop" />'),b('<div class="jspTrack" />').append(b('<div class="jspDrag" />').append(b('<div class="jspDragTop" />'),b('<div class="jspDragBottom" />'))),b('<div class="jspCap jspCapBottom" />')));U=am.find(">.jspVerticalBar");aq=U.find(">.jspTrack");av=aq.find(">.jspDrag");if(az.showArrows){ar=b('<a class="jspArrow jspArrowUp" />').bind("mousedown.jsp",aE(0,-1)).bind("click.jsp",aC);af=b('<a class="jspArrow jspArrowDown" />').bind("mousedown.jsp",aE(0,1)).bind("click.jsp",aC);if(az.arrowScrollOnHover){ar.bind("mouseover.jsp",aE(0,-1,ar));af.bind("mouseover.jsp",aE(0,1,af))}al(aq,az.verticalArrowPositions,ar,af)}t=v;am.find(">.jspVerticalBar>.jspCap:visible,>.jspVerticalBar>.jspArrow").each(function(){t-=b(this).outerHeight()});av.hover(function(){av.addClass("jspHover")},function(){av.removeClass("jspHover")}).bind("mousedown.jsp",function(aJ){b("html").bind("dragstart.jsp selectstart.jsp",aC);av.addClass("jspActive");var s=aJ.pageY-av.position().top;b("html").bind("mousemove.jsp",function(aK){V(aK.pageY-s,false)}).bind("mouseup.jsp mouseleave.jsp",ax);return false});o()}}function o(){aq.height(t+"px");I=0;X=az.verticalGutter+aq.outerWidth();Y.width(ak-X-f);try{if(U.position().left===0){Y.css("margin-left",X+"px")}}catch(s){}}function z(){if(aF){am.append(b('<div class="jspHorizontalBar" />').append(b('<div class="jspCap jspCapLeft" />'),b('<div class="jspTrack" />').append(b('<div class="jspDrag" />').append(b('<div class="jspDragLeft" />'),b('<div class="jspDragRight" />'))),b('<div class="jspCap jspCapRight" />')));an=am.find(">.jspHorizontalBar");G=an.find(">.jspTrack");h=G.find(">.jspDrag");if(az.showArrows){ay=b('<a class="jspArrow jspArrowLeft" />').bind("mousedown.jsp",aE(-1,0)).bind("click.jsp",aC);x=b('<a class="jspArrow jspArrowRight" />').bind("mousedown.jsp",aE(1,0)).bind("click.jsp",aC);
if(az.arrowScrollOnHover){ay.bind("mouseover.jsp",aE(-1,0,ay));x.bind("mouseover.jsp",aE(1,0,x))}al(G,az.horizontalArrowPositions,ay,x)}h.hover(function(){h.addClass("jspHover")},function(){h.removeClass("jspHover")}).bind("mousedown.jsp",function(aJ){b("html").bind("dragstart.jsp selectstart.jsp",aC);h.addClass("jspActive");var s=aJ.pageX-h.position().left;b("html").bind("mousemove.jsp",function(aK){W(aK.pageX-s,false)}).bind("mouseup.jsp mouseleave.jsp",ax);return false});l=am.innerWidth();ah()}}function ah(){am.find(">.jspHorizontalBar>.jspCap:visible,>.jspHorizontalBar>.jspArrow").each(function(){l-=b(this).outerWidth()});G.width(l+"px");aa=0}function F(){if(aF&&aA){var aJ=G.outerHeight(),s=aq.outerWidth();t-=aJ;b(an).find(">.jspCap:visible,>.jspArrow").each(function(){l+=b(this).outerWidth()});l-=s;v-=s;ak-=aJ;G.parent().append(b('<div class="jspCorner" />').css("width",aJ+"px"));o();ah()}if(aF){Y.width((am.outerWidth()-f)+"px")}Z=Y.outerHeight();q=Z/v;if(aF){au=Math.ceil(1/y*l);if(au>az.horizontalDragMaxWidth){au=az.horizontalDragMaxWidth}else{if(au<az.horizontalDragMinWidth){au=az.horizontalDragMinWidth}}h.width(au+"px");j=l-au;ae(aa)}if(aA){A=Math.ceil(1/q*t);if(A>az.verticalDragMaxHeight){A=az.verticalDragMaxHeight}else{if(A<az.verticalDragMinHeight){A=az.verticalDragMinHeight}}av.height(A+"px");i=t-A;ad(I)}}function al(aK,aM,aJ,s){var aO="before",aL="after",aN;if(aM=="os"){aM=/Mac/.test(navigator.platform)?"after":"split"}if(aM==aO){aL=aM}else{if(aM==aL){aO=aM;aN=aJ;aJ=s;s=aN}}aK[aO](aJ)[aL](s)}function aE(aJ,s,aK){return function(){H(aJ,s,this,aK);this.blur();return false}}function H(aM,aL,aP,aO){aP=b(aP).addClass("jspActive");var aN,aK,aJ=true,s=function(){if(aM!==0){Q.scrollByX(aM*az.arrowButtonSpeed)}if(aL!==0){Q.scrollByY(aL*az.arrowButtonSpeed)}aK=setTimeout(s,aJ?az.initialDelay:az.arrowRepeatFreq);aJ=false};s();aN=aO?"mouseout.jsp":"mouseup.jsp";aO=aO||b("html");aO.bind(aN,function(){aP.removeClass("jspActive");aK&&clearTimeout(aK);aK=null;aO.unbind(aN)})}function p(){w();if(aA){aq.bind("mousedown.jsp",function(aO){if(aO.originalTarget===c||aO.originalTarget==aO.currentTarget){var aM=b(this),aP=aM.offset(),aN=aO.pageY-aP.top-I,aK,aJ=true,s=function(){var aS=aM.offset(),aT=aO.pageY-aS.top-A/2,aQ=v*az.scrollPagePercent,aR=i*aQ/(Z-v);if(aN<0){if(I-aR>aT){Q.scrollByY(-aQ)}else{V(aT)}}else{if(aN>0){if(I+aR<aT){Q.scrollByY(aQ)}else{V(aT)}}else{aL();return}}aK=setTimeout(s,aJ?az.initialDelay:az.trackClickRepeatFreq);aJ=false},aL=function(){aK&&clearTimeout(aK);aK=null;b(document).unbind("mouseup.jsp",aL)};s();b(document).bind("mouseup.jsp",aL);return false}})}if(aF){G.bind("mousedown.jsp",function(aO){if(aO.originalTarget===c||aO.originalTarget==aO.currentTarget){var aM=b(this),aP=aM.offset(),aN=aO.pageX-aP.left-aa,aK,aJ=true,s=function(){var aS=aM.offset(),aT=aO.pageX-aS.left-au/2,aQ=ak*az.scrollPagePercent,aR=j*aQ/(T-ak);if(aN<0){if(aa-aR>aT){Q.scrollByX(-aQ)}else{W(aT)}}else{if(aN>0){if(aa+aR<aT){Q.scrollByX(aQ)}else{W(aT)}}else{aL();return}}aK=setTimeout(s,aJ?az.initialDelay:az.trackClickRepeatFreq);aJ=false},aL=function(){aK&&clearTimeout(aK);aK=null;b(document).unbind("mouseup.jsp",aL)};s();b(document).bind("mouseup.jsp",aL);return false}})}}function w(){if(G){G.unbind("mousedown.jsp")}if(aq){aq.unbind("mousedown.jsp")}}function ax(){b("html").unbind("dragstart.jsp selectstart.jsp mousemove.jsp mouseup.jsp mouseleave.jsp");if(av){av.removeClass("jspActive")}if(h){h.removeClass("jspActive")}}function V(s,aJ){if(!aA){return}if(s<0){s=0}else{if(s>i){s=i}}if(aJ===c){aJ=az.animateScroll}if(aJ){Q.animate(av,"top",s,ad)}else{av.css("top",s);ad(s)}}function ad(aJ){if(aJ===c){aJ=av.position().top}am.scrollTop(0);I=aJ;var aM=I===0,aK=I==i,aL=aJ/i,s=-aL*(Z-v);if(aj!=aM||aH!=aK){aj=aM;aH=aK;D.trigger("jsp-arrow-change",[aj,aH,P,k])}u(aM,aK);Y.css("top",s);D.trigger("jsp-scroll-y",[-s,aM,aK]).trigger("scroll")}function W(aJ,s){if(!aF){return}if(aJ<0){aJ=0}else{if(aJ>j){aJ=j}}if(s===c){s=az.animateScroll}if(s){Q.animate(h,"left",aJ,ae)
}else{h.css("left",aJ);ae(aJ)}}function ae(aJ){if(aJ===c){aJ=h.position().left}am.scrollTop(0);aa=aJ;var aM=aa===0,aL=aa==j,aK=aJ/j,s=-aK*(T-ak);if(P!=aM||k!=aL){P=aM;k=aL;D.trigger("jsp-arrow-change",[aj,aH,P,k])}r(aM,aL);Y.css("left",s);D.trigger("jsp-scroll-x",[-s,aM,aL]).trigger("scroll")}function u(aJ,s){if(az.showArrows){ar[aJ?"addClass":"removeClass"]("jspDisabled");af[s?"addClass":"removeClass"]("jspDisabled")}}function r(aJ,s){if(az.showArrows){ay[aJ?"addClass":"removeClass"]("jspDisabled");x[s?"addClass":"removeClass"]("jspDisabled")}}function M(s,aJ){var aK=s/(Z-v);V(aK*i,aJ)}function N(aJ,s){var aK=aJ/(T-ak);W(aK*j,s)}function ab(aW,aR,aK){var aO,aL,aM,s=0,aV=0,aJ,aQ,aP,aT,aS,aU;try{aO=b(aW)}catch(aN){return}aL=aO.outerHeight();aM=aO.outerWidth();am.scrollTop(0);am.scrollLeft(0);while(!aO.is(".jspPane")){s+=aO.position().top;aV+=aO.position().left;aO=aO.offsetParent();if(/^body|html$/i.test(aO[0].nodeName)){return}}aJ=aB();aP=aJ+v;if(s<aJ||aR){aS=s-az.verticalGutter}else{if(s+aL>aP){aS=s-v+aL+az.verticalGutter}}if(aS){M(aS,aK)}aQ=aD();aT=aQ+ak;if(aV<aQ||aR){aU=aV-az.horizontalGutter}else{if(aV+aM>aT){aU=aV-ak+aM+az.horizontalGutter}}if(aU){N(aU,aK)}}function aD(){return -Y.position().left}function aB(){return -Y.position().top}function K(){var s=Z-v;return(s>20)&&(s-aB()<10)}function B(){var s=T-ak;return(s>20)&&(s-aD()<10)}function ag(){am.unbind(ac).bind(ac,function(aM,aN,aL,aJ){var aK=aa,s=I;Q.scrollBy(aL*az.mouseWheelSpeed,-aJ*az.mouseWheelSpeed,false);return aK==aa&&s==I})}function n(){am.unbind(ac)}function aC(){return false}function J(){Y.find(":input,a").unbind("focus.jsp").bind("focus.jsp",function(s){ab(s.target,false)})}function E(){Y.find(":input,a").unbind("focus.jsp")}function S(){var s,aJ,aL=[];aF&&aL.push(an[0]);aA&&aL.push(U[0]);Y.focus(function(){D.focus()});D.attr("tabindex",0).unbind("keydown.jsp keypress.jsp").bind("keydown.jsp",function(aO){if(aO.target!==this&&!(aL.length&&b(aO.target).closest(aL).length)){return}var aN=aa,aM=I;switch(aO.keyCode){case 40:case 38:case 34:case 32:case 33:case 39:case 37:s=aO.keyCode;aK();break;case 35:M(Z-v);s=null;break;case 36:M(0);s=null;break}aJ=aO.keyCode==s&&aN!=aa||aM!=I;return !aJ}).bind("keypress.jsp",function(aM){if(aM.keyCode==s){aK()}return !aJ});if(az.hideFocus){D.css("outline","none");if("hideFocus" in am[0]){D.attr("hideFocus",true)}}else{D.css("outline","");if("hideFocus" in am[0]){D.attr("hideFocus",false)}}function aK(){var aN=aa,aM=I;switch(s){case 40:Q.scrollByY(az.keyboardSpeed,false);break;case 38:Q.scrollByY(-az.keyboardSpeed,false);break;case 34:case 32:Q.scrollByY(v*az.scrollPagePercent,false);break;case 33:Q.scrollByY(-v*az.scrollPagePercent,false);break;case 39:Q.scrollByX(az.keyboardSpeed,false);break;case 37:Q.scrollByX(-az.keyboardSpeed,false);break}aJ=aN!=aa||aM!=I;return aJ}}function R(){D.attr("tabindex","-1").removeAttr("tabindex").unbind("keydown.jsp keypress.jsp")}function C(){if(location.hash&&location.hash.length>1){var aL,aJ,aK=escape(location.hash);try{aL=b(aK)}catch(s){return}if(aL.length&&Y.find(aK)){if(am.scrollTop()===0){aJ=setInterval(function(){if(am.scrollTop()>0){ab(aK,true);b(document).scrollTop(am.position().top);clearInterval(aJ)}},50)}else{ab(aK,true);b(document).scrollTop(am.position().top)}}}}function ai(){b("a.jspHijack").unbind("click.jsp-hijack").removeClass("jspHijack")}function m(){ai();b("a[href^=#]").addClass("jspHijack").bind("click.jsp-hijack",function(){var s=this.href.split("#"),aJ;if(s.length>1){aJ=s[1];if(aJ.length>0&&Y.find("#"+aJ).length>0){ab("#"+aJ,true);return false}}})}function ao(){var aK,aJ,aM,aL,aN,s=false;am.unbind("touchstart.jsp touchmove.jsp touchend.jsp click.jsp-touchclick").bind("touchstart.jsp",function(aO){var aP=aO.originalEvent.touches[0];aK=aD();aJ=aB();aM=aP.pageX;aL=aP.pageY;aN=false;s=true}).bind("touchmove.jsp",function(aR){if(!s){return}var aQ=aR.originalEvent.touches[0],aP=aa,aO=I;Q.scrollTo(aK+aM-aQ.pageX,aJ+aL-aQ.pageY);aN=aN||Math.abs(aM-aQ.pageX)>5||Math.abs(aL-aQ.pageY)>5;
return aP==aa&&aO==I}).bind("touchend.jsp",function(aO){s=false}).bind("click.jsp-touchclick",function(aO){if(aN){aN=false;return false}})}function g(){var s=aB(),aJ=aD();D.removeClass("jspScrollable").unbind(".jsp");D.replaceWith(ap.append(Y.children()));ap.scrollTop(s);ap.scrollLeft(aJ)}b.extend(Q,{reinitialise:function(aJ){aJ=b.extend({},az,aJ);at(aJ)},scrollToElement:function(aK,aJ,s){ab(aK,aJ,s)},scrollTo:function(aK,s,aJ){N(aK,aJ);M(s,aJ)},scrollToX:function(aJ,s){N(aJ,s)},scrollToY:function(s,aJ){M(s,aJ)},scrollToPercentX:function(aJ,s){N(aJ*(T-ak),s)},scrollToPercentY:function(aJ,s){M(aJ*(Z-v),s)},scrollBy:function(aJ,s,aK){Q.scrollByX(aJ,aK);Q.scrollByY(s,aK)},scrollByX:function(s,aK){var aJ=aD()+Math[s<0?"floor":"ceil"](s),aL=aJ/(T-ak);W(aL*j,aK)},scrollByY:function(s,aK){var aJ=aB()+Math[s<0?"floor":"ceil"](s),aL=aJ/(Z-v);V(aL*i,aK)},positionDragX:function(s,aJ){W(s,aJ)},positionDragY:function(aJ,s){V(aJ,s)},animate:function(aJ,aM,s,aL){var aK={};aK[aM]=s;aJ.animate(aK,{duration:az.animateDuration,easing:az.animateEase,queue:false,step:aL})},getContentPositionX:function(){return aD()},getContentPositionY:function(){return aB()},getContentWidth:function(){return T},getContentHeight:function(){return Z},getPercentScrolledX:function(){return aD()/(T-ak)},getPercentScrolledY:function(){return aB()/(Z-v)},getIsScrollableH:function(){return aF},getIsScrollableV:function(){return aA},getContentPane:function(){return Y},scrollToBottom:function(s){V(i,s)},hijackInternalLinks:function(){m()},destroy:function(){g()}});at(O)}e=b.extend({},b.fn.jScrollPane.defaults,e);b.each(["mouseWheelSpeed","arrowButtonSpeed","trackClickSpeed","keyboardSpeed"],function(){e[this]=e[this]||e.speed});return this.each(function(){var f=b(this),g=f.data("jsp");if(g){g.reinitialise(e)}else{g=new d(f,e);f.data("jsp",g)}})};b.fn.jScrollPane.defaults={showArrows:false,maintainPosition:true,stickToBottom:false,stickToRight:false,clickOnTrack:true,autoReinitialise:false,autoReinitialiseDelay:500,verticalDragMinHeight:0,verticalDragMaxHeight:99999,horizontalDragMinWidth:0,horizontalDragMaxWidth:99999,contentWidth:c,animateScroll:false,animateDuration:300,animateEase:"linear",hijackInternalLinks:false,verticalGutter:4,horizontalGutter:4,mouseWheelSpeed:0,arrowButtonSpeed:0,arrowRepeatFreq:50,arrowScrollOnHover:false,trackClickSpeed:0,trackClickRepeatFreq:70,verticalArrowPositions:"split",horizontalArrowPositions:"split",enableKeyboardNavigation:true,hideFocus:false,keyboardSpeed:0,initialDelay:300,speed:30,scrollPagePercent:0.8}})(jQuery,this);                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              
        


/*
Name:       ImageFlow
Version:    1.3.0 (March 9 2010)
Author:     Finn Rudolph
Support:    http://finnrudolph.de/ImageFlow

License:    ImageFlow is licensed under a Creative Commons 
            Attribution-Noncommercial 3.0 Unported License 
            (http://creativecommons.org/licenses/by-nc/3.0/).

            You are free:
                + to Share - to copy, distribute and transmit the work
                + to Remix - to adapt the work

            Under the following conditions:
                + Attribution. You must attribute the work in the manner specified by the author or licensor 
                  (but not in any way that suggests that they endorse you or your use of the work). 
                + Noncommercial. You may not use this work for commercial purposes. 

            + For any reuse or distribution, you must make clear to others the license terms of this work.
            + Any of the above conditions can be waived if you get permission from the copyright holder.
            + Nothing in this license impairs or restricts the author's moral rights.

Credits:    This script is based on Michael L. Perrys Cover flow in Javascript [1].
            The reflections are generated server-sided by a slightly hacked version 
            of Richard Daveys easyreflections [2] written in PHP. The mouse wheel 
            support is an implementation of Adomas Paltanavicius JavaScript mouse 
            wheel code [3]. It also uses the domReadyEvent from Tanny O'Haley [4].

            [1] http://www.adventuresinsoftware.com/blog/?p=104#comment-1981
            [2] http://reflection.corephp.co.uk/v2.php
            [3] http://adomas.org/javascript-mouse-wheel/
            [4] http://tanny.ica.com/ICA/TKO/tkoblog.nsf/dx/domcontentloaded-for-browsers-part-v
*/

/* ImageFlow - compressed with http://dean.edwards.name/packer/ */
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}('v 4Z(){u.2v={3Q:50,2N:1.5a,2J:y,30:C,1a:y,3j:\'1E\',S:\'5u\',2h:1.0,J:4,33:\'\',2f:C,3a:0.49,36:1.0,2z:v(){B.3V=u.2i},1Y:y,1T:[10,8,6,4,2],2x:5t,2y:1d,3e:C,2M:C,3G:\'\',1N:0.5,31:y,3L:\'\',3u:0.6,2G:C,2X:\'e-5m\',1q:14,1y:y,34:5n,3k:y,3r:1,3D:C,3H:y,1g:4w};9 t=u;u.X=v(a){17(9 b 3T t.2v){u[b]=(a!==1t&&a[b]!==1t)?a[b]:t.2v[b]}9 c=B.R(t.S);7(c){c.A.1H=\'2g\';u.N=c;7(u.3N()){u.H=B.R(t.S+\'5j\');u.2j=B.R(t.S+\'4z\');u.1V=B.R(t.S+\'3X\');u.1B=B.R(t.S+\'4c\');u.1R=B.R(t.S+\'4f\');u.3x=B.R(t.S+\'4j\');u.3l=B.R(t.S+\'4s\');u.1L=B.R(t.S+\'5e\');u.1M=[];u.1w=0;u.E=0;u.1C=0;u.1D=0;u.2q=C;u.2s=C;u.T=y;9 d=u.N.3F;9 e=W.11(d/t.2N);B.R(t.S+\'2A\').A.3b=((e*0.5)-22)+\'M\';c.A.1c=e+\'M\';u.21()}}};u.3N=v(){9 a=t.D.U(\'12\',\'23\');9 b,2S,1l,15;9 c=t.N.F.1r;17(9 d=0;d<c;d++){b=t.N.F[d];7(b&&b.24==1&&b.29==\'2b\'){7(t.2M===C){2S=(t.31)?\'3\':\'2\';1l=t.33+b.1z(\'1l\',2);1l=t.3L+\'3W\'+2S+\'.45?5p=\'+1l+t.3G;b.2d(\'1l\',1l)}15=b.1O(C);a.Q(15)}}7(t.1a){9 e=t.D.U(\'12\',\'23\');9 f=t.D.U(\'12\',\'23\');c=a.F.1r;7(c<t.J){t.J=c}7(c>1){9 i;17(i=0;i<c;i++){b=a.F[i];7(i<t.J){15=b.1O(C);e.Q(15)}7(c-i<t.J+1){15=b.1O(C);f.Q(15)}}17(i=0;i<c;i++){b=a.F[i];15=b.1O(C);f.Q(15)}17(i=0;i<t.J;i++){b=e.F[i];15=b.1O(C);f.Q(15)}a=f}}7(t.1y){9 g=t.D.U(\'12\',\'1y\');a.Q(g)}9 h=t.D.U(\'p\',\'52\');9 j=B.3h(\' \');h.Q(j);9 k=t.D.U(\'12\',\'3v\');9 l=t.D.U(\'12\',\'4o\');k.Q(l);9 m=t.D.U(\'12\',\'4J\');9 n=t.D.U(\'12\',\'57\');9 o=t.D.U(\'12\',\'2G\');n.Q(o);7(t.2J){9 p=t.D.U(\'12\',\'4t\',\'35\');9 q=t.D.U(\'12\',\'41\',\'35\');n.Q(p);n.Q(q)}9 r=t.D.U(\'12\',\'46\');r.Q(m);r.Q(n);9 s=y;7(t.N.Q(a)&&t.N.Q(h)&&t.N.Q(k)&&t.N.Q(r)){c=t.N.F.1r;17(d=0;d<c;d++){b=t.N.F[d];7(b&&b.24==1&&b.29==\'2b\'){t.N.5q(b)}}s=C}V s};u.21=v(){9 p=t.2Y();7((p<1d||t.2s)&&t.3e){7(t.2s&&p==1d){t.2s=y;L.1n(t.21,1d)}G{L.1n(t.21,40)}}G{B.R(t.S+\'2A\').A.1Z=\'2H\';B.R(t.S+\'4L\').A.1Z=\'2H\';L.1n(t.D.3c,4W);t.2m();7(t.O>1){t.1e.X();t.I.X();t.K.X();t.2o.X();7(t.1y){t.P.X()}7(t.2G){t.1B.A.1H=\'2g\'}}}};u.2Y=v(){9 a=t.H.F.1r;9 i=0,20=0;9 b=Z;17(9 c=0;c<a;c++){b=t.H.F[c];7(b&&b.24==1&&b.29==\'2b\'){7(b.2I){20++}i++}}9 d=W.11((20/i)*1d);9 e=B.R(t.S+\'5g\');e.A.1u=d+\'%\';7(t.1a){i=i-(t.J*2);20=(d<1)?0:W.11((i/1d)*d)}9 f=B.R(t.S+\'2A\');9 g=B.3h(\'3v 23 \'+20+\'/\'+i);f.5i(g,f.4i);V d};u.2m=v(){u.Y=t.H.3F+t.H.3I;u.1A=W.11(t.Y/t.2N);u.1U=t.J*t.1g;u.1I=t.Y*0.5;u.1q=t.1q*0.5;u.1f=(t.Y-(W.11(t.1q)*2))*t.3u;u.2u=W.11(t.1A*t.3a);t.N.A.1c=t.1A+\'M\';t.H.A.1c=t.2u+\'M\';t.1V.A.1c=(t.1A-t.2u)+\'M\';t.2j.A.1u=t.Y+\'M\';t.2j.A.3b=W.11(t.Y*0.3q)+\'M\';t.1B.A.1u=t.1f+\'M\';t.1B.A.4m=W.11(t.Y*0.3q)+\'M\';t.1B.A.2R=W.11(t.1q+((t.Y-t.1f)/2))+\'M\';t.1R.A.3s=t.2X;t.1R.4u=v(){t.I.1p(u);V y};7(t.2J){t.3l.1k=v(){t.1e.19(1)};t.3x.1k=v(){t.1e.19(-1)}}9 a=(t.2M===C)?t.1N+1:1;9 b=t.H.F.1r;9 i=0;9 c=Z;17(9 d=0;d<b;d++){c=t.H.F[d];7(c!==Z&&c.24==1&&c.29==\'2b\'){u.1M[i]=d;c.2i=c.1z(\'4D\');c.4F=(-i*t.1g);c.i=i;7(t.2q){7(c.1z(\'1u\')!==Z&&c.1z(\'1c\')!==Z){c.w=c.1z(\'1u\');c.h=c.1z(\'1c\')*a}G{c.w=c.1u;c.h=c.1c}}7((c.w)>(c.h/(t.1N+1))){c.1j=t.2x;c.26=t.2x}G{c.1j=t.2y;c.26=t.2y}7(t.2f===y){c.A.4O=\'4S\';c.A.1Z=\'4U\'}c.A.3s=t.3j;i++}}u.O=t.1M.1r;7(t.2f===y){c=t.H.F[t.1M[0]];u.3J=c.w*t.O;c.A.55=(t.Y/2)+(c.w/2)+\'M\';t.H.A.1c=c.h+\'M\';t.1V.A.1c=(t.1A-c.h)+\'M\'}7(t.2q){t.2q=y;t.E=t.3r-1;7(t.E<0){t.E=0}7(t.1a){t.E=t.E+t.J}2U=(t.1a)?(t.O-(t.J))-1:t.O-1;7(t.E>2U){t.E=2U}7(t.3D===y){t.1K(-t.E*t.1g)}7(t.3H){t.1K(5v)}}7(t.O>1){t.1J(t.E)}t.1K(t.1w)};u.1K=v(x){u.1w=x;u.1o=t.O;17(9 a=0;a<t.O;a++){9 b=t.H.F[t.1M[a]];9 c=a*-t.1g;7(t.2f){7((c+t.1U)<t.1D||(c-t.1U)>t.1D){b.A.1H=\'3S\';b.A.1Z=\'2H\'}G{9 z=(W.4I(4p+x*x)+1d)*t.36;9 d=x/z*t.1I+t.1I;b.A.1Z=\'4r\';9 e=(b.h/b.w*b.1j)/z*t.1I;9 f=0;1G(e>t.1A){1x y:f=b.1j/z*t.1I;13;1E:e=t.1A;f=b.w*e/b.h;13}9 g=(t.2u-e)+((e/(t.1N+1))*t.1N);b.A.2Z=d-(b.1j/2)/z*t.1I+\'M\';7(f&&e){b.A.1c=e+\'M\';b.A.1u=f+\'M\';b.A.5s=g+\'M\'}b.A.1H=\'2g\';1G(x<0){1x C:u.1o++;13;1E:u.1o=t.1o-1;13}1G(b.i==t.E){1x y:b.1k=v(){t.1J(u.i)};13;1E:u.1o=t.1o+1;7(b.2i!==\'\'){b.1k=t.2z}13}b.A.1o=t.1o}}G{7((c+t.1U)<t.1D||(c-t.1U)>t.1D){b.A.1H=\'3S\'}G{b.A.1H=\'2g\';1G(b.i==t.E){1x y:b.1k=v(){t.1J(u.i)};13;1E:7(b.2i!==\'\'){b.1k=t.2z}13}}t.H.A.2R=(x-t.3J)+\'M\'}x+=t.1g}};u.1J=v(a){9 b,1v;7(t.1a){7(a+1===t.J){1v=t.O-t.J;b=-1v*t.1g;a=1v-1}7(a===(t.O-t.J)){1v=t.J-1;b=-1v*t.1g;a=1v+1}}9 x=-a*t.1g;u.1C=x;u.1D=x;u.E=a;9 c=t.H.F[a].1z(\'4v\');7(c===\'\'||t.30===y){c=\'&56;\'}t.2j.4e=c;7(t.I.T===y){7(t.1a){u.1b=((a-t.J)*t.1f)/(t.O-(t.J*2)-1)-t.I.2k}G{u.1b=(a*t.1f)/(t.O-1)-t.I.2k}t.1R.A.2R=(t.1b-t.1q)+\'M\'}7(t.1Y===C||t.2h!==t.2v.2h){t.D.27(t.H.F[a],t.1T[0]);t.H.F[a].1j=t.H.F[a].1j*t.2h;9 d=0;9 e=0;9 f=0;9 g=t.1T.1r;17(9 i=1;i<(t.J+1);i++){7((i+1)>g){d=t.1T[g-1]}G{d=t.1T[i]}e=a+i;f=a-i;7(e<t.O){t.D.27(t.H.F[e],d);t.H.F[e].1j=t.H.F[e].26}7(f>=0){t.D.27(t.H.F[f],d);t.H.F[f].1j=t.H.F[f].26}}}7(b){t.1K(b)}7(t.T===y){t.T=C;t.2E()}};u.2E=v(){1G(t.1C<t.1w-1||t.1C>t.1w+1){1x C:t.1K(t.1w+(t.1C-t.1w)/3);L.1n(t.2E,t.3Q);t.T=C;13;1E:t.T=y;13}};u.2l=v(a){7(t.1y){t.P.2c()}t.1J(a)};u.P={2n:1,X:v(){(t.3k)?t.P.1p():t.P.1h()},2c:v(){t.D.2L(t.N,\'3m\',t.P.2c);t.P.1h()},3o:v(){t.D.16(t.N,\'3m\',t.P.2c)},1p:v(){t.D.25(t.1L,\'1y 43\');t.1L.1k=v(){t.P.1h()};t.P.3t=L.47(t.P.2P,t.34);L.1n(t.P.3o,1d)},1h:v(){t.D.25(t.1L,\'1y 4b\');t.1L.1k=v(){t.P.1p()};L.4d(t.P.3t)},2P:v(){9 a=t.E+t.P.2n;9 b=y;7(a===t.O){t.P.2n=-1;b=C}7(a<0){t.P.2n=1;b=C}(b)?t.P.2P():t.1J(a)}};u.1e={X:v(){7(L.1m){t.N.1m(\'4h\',t.1e.1W,y)}t.D.16(t.N,\'4k\',t.1e.1W)},1W:v(a){9 b=0;7(!a){a=L.1F}7(a.3z){b=a.3z/4q}G 7(a.3B){b=-a.3B/3}7(b){t.1e.19(b)}t.D.2p(a)},19:v(a){9 b=y;9 c=0;7(a>0){7(t.E>=1){c=t.E-1;b=C}}G{7(t.E<(t.O-1)){c=t.E+1;b=C}}7(b){t.2l(c)}}};u.I={1P:Z,2T:0,2e:0,2k:0,T:y,X:v(){t.D.16(t.N,\'4B\',t.I.3K);t.D.16(t.N,\'3M\',t.I.1h);t.D.16(B,\'3M\',t.I.1h);t.N.4H=v(){9 a=C;7(t.I.T){a=y}V a}},1p:v(o){t.I.1P=o;t.I.2T=t.I.2e-o.3I+t.1b},1h:v(){t.I.1P=Z;t.I.T=y},3K:v(e){9 a=0;7(!e){e=L.1F}7(e.2D){a=e.2D}G 7(e.3P){a=e.3P+B.2K.3d+B.4Q.3d}t.I.2e=a;7(t.I.1P!==Z){9 b=(t.I.2e-t.I.2T)+t.1q;7(b<(-t.1b)){b=-t.1b}7(b>(t.1f-t.1b)){b=t.1f-t.1b}9 c,E;7(t.1a){c=(b+t.1b)/(t.1f/(t.O-(t.J*2)-1));E=W.11(c)+t.J}G{c=(b+t.1b)/(t.1f/(t.O-1));E=W.11(c)}t.I.2k=b;t.I.1P.A.2Z=b+\'M\';7(t.E!==E){t.2l(E)}t.I.T=C}}};u.K={x:0,2B:0,2r:0,T:y,2F:C,X:v(){t.D.16(t.1V,\'4Y\',t.K.1p);t.D.16(B,\'51\',t.K.19);t.D.16(B,\'53\',t.K.1h)},3f:v(e){9 a=y;7(e.28){9 b=e.28[0].1C;7(b===t.1V||b===t.1R||b===t.1B){a=C}}V a},2C:v(e){9 x=0;7(e.28){x=e.28[0].2D}V x},1p:v(e){t.K.2B=t.K.2C(e);t.K.T=C;t.D.2p(e)},3w:v(){9 a=y;7(t.K.T){a=C}V a},19:v(e){7(t.K.3w&&t.K.3f(e)){9 a=(t.1a)?(t.O-(t.J*2)-1):(t.O-1);7(t.K.2F){t.K.2r=(a-t.E)*(t.Y/a);t.K.2F=y}9 b=-(t.K.2C(e)-t.K.2B-t.K.2r);7(b<0){b=0}7(b>t.Y){b=t.Y}t.K.x=b;9 c=W.11(b/(t.Y/a));c=a-c;7(t.E!==c){7(t.1a){c=c+t.J}t.2l(c)}t.D.2p(e)}},1h:v(){t.K.2r=t.K.x;t.K.T=y}};u.2o={X:v(){B.5d=v(a){t.2o.19(a)}},19:v(a){9 b=t.2o.1W(a);1G(b){1x 39:t.1e.19(-1);13;1x 37:t.1e.19(1);13}},1W:v(a){a=a||L.1F;V a.5h}};u.D={16:v(a,b,c){7(a.1m){a.1m(b,c,y)}G 7(a.3g){a["e"+b+c]=c;a[b+c]=v(){a["e"+b+c](L.1F)};a.3g("3y"+b,a[b+c])}},2L:v(a,b,c){7(a.32){a.32(b,c,y)}G 7(a.3A){7(a[b+c]===1t){5r(\'D.2L » 4G 3i 3C 1F 48 1t - 4K 4l 4M 42 3i 3C 4N 4n 1F?\')}a.3A(\'3y\'+b,a[b+c]);a[b+c]=Z;a[\'e\'+b+c]=Z}},27:v(a,b){7(t.1Y===C){a.A.1Y=b/10;a.A.4P=\'4a(1Y=\'+b*10+\')\'}},U:v(a,b,c){9 d=B.4R(a);d.2d(\'38\',t.S+\'4T\'+b);7(c!==1t){b+=\' \'+c}t.D.25(d,b);V d},25:v(a,b){7(a){a.2d(\'3Z\',b);a.2d(\'4V\',b)}},2p:v(e){7(e.3E){e.3E()}G{e.4X=y}V y},3c:v(){9 a=L.2t;7(1X L.2t!=\'v\'){L.2t=v(){t.2m()}}G{L.2t=v(){7(a){a()}t.2m()}}}}}9 1i={2Q:"1i",1S:{},1s:1,1Q:y,2O:Z,3n:v(a){7(!a.$$1s){a.$$1s=u.1s++;7(u.1Q){a()}u.1S[a.$$1s]=a}},58:v(a){7(a.$$1s){4x u.1S[a.$$1s]}},18:v(){7(u.1Q){V}u.1Q=C;17(9 i 3T u.1S){u.1S[i]()}},2w:v(){7(u.1Q){V}7(/5c|4y/i.3O(4g.5f)){7(/4A|2I/.3O(B.3p)){u.18()}G{1n(u.2Q+".2w()",1d)}}G 7(B.R("2V")){V C}7(1X u.2O==="v"){7(1X B.2W!==\'1t\'&&(B.2W(\'2K\')[0]!==Z||B.2K!==Z)){7(u.2O()){u.18()}G{1n(u.2Q+".2w()",4C)}}}V C},X:v(){7(B.1m){B.1m("5k",v(){1i.18()},y)}1n("1i.2w()",1d);v 18(){1i.18()}7(1X 16!=="1t"){16(L,"3R",18)}G 7(B.1m){B.1m("3R",18,y)}G 7(1X L.2a==="v"){9 a=L.2a;L.2a=v(){1i.18();a()}}G{L.2a=18}/*@4E@7(@5o||@3Y)B.44("<3U 38=2V 54 1l=\\"//:\\"><\\/3U>");9 b=B.R("2V");b.59=v(){7(u.3p=="2I"){1i.18()}};@5b@*/}};9 5l=v(a){1i.3n(a)};1i.X();',62,342,'|||||||if||var|||||||||||||||||||||this|function|||false||style|document|true|Helper|imageID|childNodes|else|imagesDiv|MouseDrag|imageFocusMax|Touch|window|px|ImageFlowDiv|max|Slideshow|appendChild|getElementById|ImageFlowID|busy|createDocumentElement|return|Math|init|imagesDivWidth|null||round|div|break||imageNode|addEvent|for|run|handle|circular|newSliderX|height|100|MouseWheel|scrollbarWidth|xStep|stop|domReadyEvent|pc|onclick|src|addEventListener|setTimeout|zIndex|start|sliderWidth|length|domReadyID|undefined|width|clonedImageID|current|case|slideshow|getAttribute|maxHeight|scrollbarDiv|target|memTarget|default|event|switch|visibility|size|glideTo|moveTo|buttonSlideshow|indexArray|reflectionP|cloneNode|object|bDone|sliderDiv|events|opacityArray|maxFocus|navigationDiv|get|typeof|opacity|display|completed|loadingProgress||images|nodeType|setClassName|pcMem|setOpacity|touches|nodeName|onload|IMG|interrupt|setAttribute|mouseX|imageScaling|visible|imageFocusM|url|captionDiv|newX|glideOnEvent|refresh|direction|Key|suppressBrowserDefault|firstRefresh|stopX|firstCheck|onresize|imagesDivHeight|defaults|schedule|percentLandscape|percentOther|onClick|_loading_txt|startX|getX|pageX|animate|first|slider|none|complete|buttons|body|removeEvent|reflections|aspectRatio|DOMContentLoadedCustom|slide|name|marginLeft|version|objectX|maxId|__ie_onload|getElementsByTagName|sliderCursor|loadingStatus|left|captions|reflectionPNG|removeEventListener|imagePath|slideshowSpeed|button|imagesM||id||imagesHeight|paddingTop|addResizeEvent|scrollLeft|preloadImages|isOnNavigationDiv|attachEvent|createTextNode|to|imageCursor|slideshowAutoplay|buttonPreviousDiv|click|add|addInterruptEvent|readyState|02|startID|cursor|action|scrollbarP|loading|isBusy|buttonNextDiv|on|wheelDelta|detachEvent|detail|detach|glideToStartID|preventDefault|offsetWidth|reflectionGET|startAnimation|offsetLeft|totalImagesWidth|drag|reflectPath|mouseup|createStructure|test|clientX|animationSpeed|load|hidden|in|script|location|reflect|_navigation|_win64|class||next|trying|pause|write|php|navigation|setInterval|is|67|alpha|play|_scrollbar|clearInterval|innerHTML|_slider|navigator|DOMMouseScroll|firstChild|_next|mousewheel|you|marginTop|unattached|loading_bar|10000|120|block|_previous|previous|onmousedown|alt|150|delete|WebKit|_caption|loaded|mousemove|250|longdesc|cc_on|xPosition|Pointer|onselectstart|sqrt|caption|perhaps|_loading|are|an|position|filter|documentElement|createElement|relative|_|inline|className|1000|returnValue|touchstart|ImageFlow||touchmove|loading_txt|touchend|defer|paddingLeft|nbsp|scrollbar|remove|onreadystatechange|964|end|KHTML|onkeydown|_slideshow|userAgent|_loading_bar|keyCode|replaceChild|_images|DOMContentLoaded|domReady|resize|1500|_win32|img|removeChild|alert|top|118|imageflow|5000'.split('|'),0,{}));                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

