/** * @license In-Field Label jQuery Plugin * http://fuelyourcoding.com/scripts/infield.html * * Copyright (c) 2009-2010 Doug Neiner * Dual licensed under the MIT and GPL licenses. * Uses the same license as jQuery, see: * http://docs.jquery.com/License * * @version 0.1.2 */ (function ($) { $.InFieldLabels = function (label, field, options) { // To avoid scope issues, use 'base' instead of 'this' // to reference this class from internal events and functions. var base = this; // Access to jQuery and DOM versions of each element base.$label = $(label); base.label = label; base.$field = $(field); base.field = field; base.$label.data("InFieldLabels", base); base.showing = true; base.init = function () { // Merge supplied options with default options base.options = $.extend({}, $.InFieldLabels.defaultOptions, options); // Check if the field is already filled in if (base.$field.val() !== "") { base.$label.hide(); base.showing = false; } base.$field.focus(function () { base.fadeOnFocus(); }).blur(function () { base.checkForEmpty(true); }).bind('keydown.infieldlabel', function (e) { // Use of a namespace (.infieldlabel) allows us to // unbind just this method later base.hideOnChange(e); }).bind('paste', function (e) { // Since you can not paste an empty string we can assume // that the fieldis not empty and the label can be cleared. base.setOpacity(0.0); }).change(function (e) { base.checkForEmpty(); }).bind('onPropertyChange', function () { base.checkForEmpty(); }); }; // If the label is currently showing // then fade it down to the amount // specified in the settings base.fadeOnFocus = function () { if (base.showing) { base.setOpacity(base.options.fadeOpacity); } }; base.setOpacity = function (opacity) { base.$label.stop().animate({ opacity: opacity }, base.options.fadeDuration); base.showing = (opacity > 0.0); }; // Checks for empty as a fail safe // set blur to true when passing from // the blur event base.checkForEmpty = function (blur) { if (base.$field.val() === "") { base.prepForShow(); base.setOpacity(blur ? 1.0 : base.options.fadeOpacity); } else { base.setOpacity(0.0); } }; base.prepForShow = function (e) { if (!base.showing) { // Prepare for a animate in... base.$label.css({opacity: 0.0}).show(); // Reattach the keydown event base.$field.bind('keydown.infieldlabel', function (e) { base.hideOnChange(e); }); } }; base.hideOnChange = function (e) { if ( (e.keyCode === 16) || // Skip Shift (e.keyCode === 9) // Skip Tab ) { return; } if (base.showing) { base.$label.hide(); base.showing = false; } // Remove keydown event to save on CPU processing base.$field.unbind('keydown.infieldlabel'); }; // Run the initialization method base.init(); }; $.InFieldLabels.defaultOptions = { fadeOpacity: 0.5, // Once a field has focus, how transparent should the label be fadeDuration: 300 // How long should it take to animate from 1.0 opacity to the fadeOpacity }; $.fn.inFieldLabels = function (options) { return this.each(function () { // Find input or textarea based on for= attribute // The for attribute on the label must contain the ID // of the input or textarea element var for_attr = $(this).attr('for'), $field; if (!for_attr) { return; // Nothing to attach, since the for field wasn't used } // Find the referenced input or textarea element $field = $( "input#" + for_attr + "[type='text']," + "input#" + for_attr + "[type='search']," + "input#" + for_attr + "[type='tel']," + "input#" + for_attr + "[type='url']," + "input#" + for_attr + "[type='email']," + "input#" + for_attr + "[type='password']," + "textarea#" + for_attr ); if ($field.length === 0) { return; // Again, nothing to attach } // Only create object for input[text], input[password], or textarea (new $.InFieldLabels(this, $field[0], options)); }); }; }(jQuery)); /** * hoverIntent r6 // 2011.02.26 // jQuery 1.5.1+ * * * @param f onMouseOver function || An object with configuration options * @param g onMouseOut function || Nothing (use configuration options object) * @author Brian Cherne brian(at)cherne(dot)net */ (function($){$.fn.hoverIntent=function(f,g){var cfg={sensitivity:7,interval:100,timeout:0};cfg=$.extend(cfg,g?{over:f,out:g}:f);var cX,cY,pX,pY;var track=function(ev){cX=ev.pageX;cY=ev.pageY};var compare=function(ev,ob){ob.hoverIntent_t=clearTimeout(ob.hoverIntent_t);if((Math.abs(pX-cX)+Math.abs(pY-cY))').insertAfter($this); } $span.toggleClass('checked', $this.is(':checked')); $span.toggleClass('disabled', $this.is(':disabled')); }); } function appendCustomSelect(sel) { var $this = $(sel), $customSelect = $this.next('div.custom.dropdown'), $options = $this.find('option'), maxWidth = 0, $li; if ($this.hasClass('no-custom')) { return; } if ($customSelect.length === 0) { $customSelectSize = ''; if ($(sel).hasClass('small')) { $customSelectSize = 'small'; } else if ($(sel).hasClass('medium')) { $customSelectSize = 'medium'; } else if ($(sel).hasClass('large')) { $customSelectSize = 'large'; } else if ($(sel).hasClass('expand')) { $customSelectSize = 'expand'; } $customSelect = $('"'); $options.each(function () { $li = $('
  • ' + $(this).html() + '
  • '); $customSelect.find('ul').append($li); }); $customSelect.prepend('' + $options.first().html() + ''); $this.after($customSelect); $this.hide(); } else { // refresh the ul with options from the select in case the supplied markup doesn't match $customSelect.find('ul').html(''); $options.each(function () { $li = $('
  • ' + $(this).html() + '
  • '); $customSelect.find('ul').append($li); }); } $customSelect.toggleClass('disabled', $this.is(':disabled')); $options.each(function (index) { if (this.selected) { $customSelect.find('li').eq(index).addClass('selected'); $customSelect.find('.current').html($(this).html()); } }); $customSelect.css('width', 'inherit'); $customSelect.find('ul').css('width', 'inherit'); $customSelect.find('li').each(function () { $customSelect.addClass('open'); if ($(this).outerWidth() > maxWidth) { maxWidth = $(this).outerWidth(); } $customSelect.removeClass('open'); }); if (!$customSelect.is('.small, .medium, .large, .expand')) { $customSelect.css('width', maxWidth + 18 + 'px'); $customSelect.find('ul').css('width', maxWidth + 16 + 'px'); } } $.foundation.customForms.appendCustomMarkup = function () { appendCustomMarkup('checkbox'); appendCustomMarkup('radio'); $('.form.custom select').each(function () { appendCustomSelect(this); }); }; $.foundation.customForms.appendCustomMarkup(); }); (function ($) { function refreshCustomSelect($select) { var maxWidth = 0, $customSelect = $select.next(); $options = $select.find('option'); $customSelect.find('ul').html(''); $options.each(function () { $li = $('
  • ' + $(this).html() + '
  • '); $customSelect.find('ul').append($li); }); // re-populate $options.each(function (index) { if (this.selected) { $customSelect.find('li').eq(index).addClass('selected'); $customSelect.find('.current').html($(this).html()); } }); // fix width $customSelect.removeAttr('style') .find('ul').removeAttr('style'); $customSelect.find('li').each(function () { $customSelect.addClass('open'); if ($(this).outerWidth() > maxWidth) { maxWidth = $(this).outerWidth(); } $customSelect.removeClass('open'); }); $customSelect.css('width', maxWidth + 18 + 'px'); $customSelect.find('ul').css('width', maxWidth + 16 + 'px'); } function toggleCheckbox($element) { var $input = $element.prev(), input = $input[0]; if (false == $input.is(':disabled')) { input.checked = ((input.checked) ? false : true); $element.toggleClass('checked'); $input.trigger('change'); } } function toggleRadio($element) { var $input = $element.prev(), input = $input[0]; if (false == $input.is(':disabled')) { $('input:radio[name="' + $input.attr('name') + '"]').each(function () { $(this).next().removeClass('checked'); }); input.checked = ((input.checked) ? false : true); $element.toggleClass('checked'); $input.trigger('change'); } } $('.form.custom span.custom.checkbox').live('click', function (event) { event.preventDefault(); event.stopPropagation(); toggleCheckbox($(this)); }); $('.form.custom span.custom.radio').live('click', function (event) { event.preventDefault(); event.stopPropagation(); toggleRadio($(this)); }); $('.form.custom select').live('change', function (event) { refreshCustomSelect($(this)); }); $('.form.custom label').live('click', function (event) { var $associatedElement = $('#' + $(this).attr('for')), $customCheckbox, $customRadio; if ($associatedElement.length !== 0) { if ($associatedElement.attr('type') === 'checkbox') { event.preventDefault(); $customCheckbox = $(this).find('span.custom.checkbox'); toggleCheckbox($customCheckbox); } else if ($associatedElement.attr('type') === 'radio') { event.preventDefault(); $customRadio = $(this).find('span.custom.radio'); toggleRadio($customRadio); } } }); $('.form.custom div.custom.dropdown a.current, .form.custom div.custom.dropdown a.selector').live('click', function (event) { var $this = $(this), $dropdown = $this.closest('div.custom.dropdown'), $select = $dropdown.prev(); event.preventDefault(); if (false == $select.is(':disabled')) { $dropdown.toggleClass('open'); if ($dropdown.hasClass('open')) { $(document).bind('click.customdropdown', function (event) { $dropdown.removeClass('open'); $(document).unbind('.customdropdown'); }); } else { $(document).unbind('.customdropdown'); } return false; } }); $('.form.custom div.custom.dropdown li').live('click', function (event) { var $this = $(this), $customDropdown = $this.closest('div.custom.dropdown'), $select = $customDropdown.prev(), selectedIndex = 0; event.preventDefault(); event.stopPropagation(); $this .closest('ul') .find('li') .removeClass('selected'); $this.addClass('selected'); $customDropdown .removeClass('open') .find('a.current') .html($this.html()); $this.closest('ul').find('li').each(function (index) { if ($this[0] == this) { selectedIndex = index; } }); $select[0].selectedIndex = selectedIndex; $select.trigger('change'); }); })(jQuery); /* * jQuery FlexSlider v1.8 * http://www.woothemes.com/flexslider/ * * Copyright 2012 WooThemes * Free to use under the MIT license. * http://www.opensource.org/licenses/mit-license.php * * Contributing Author: Tyler Smith */ ;(function ($) { //FlexSlider: Object Instance $.flexslider = function(el, options) { var slider = $(el); var dataOpts = slider.data("options"); // slider DOM reference for use outside of the plugin $.data(el, "flexslider", slider); slider.init = function() { slider.vars = $.extend({}, $.flexslider.defaults, options, dataOpts); $.data(el, 'flexsliderInit', true); slider.container = $('.slides', slider).eq(0); slider.slides = $('.slides:first > li', slider); slider.count = slider.slides.length; slider.animating = false; slider.currentSlide = slider.vars.slideToStart; slider.animatingTo = slider.currentSlide; slider.atEnd = (slider.currentSlide == 0) ? true : false; slider.eventType = ('ontouchstart' in document.documentElement) ? 'touchstart' : 'click'; slider.cloneCount = 0; slider.cloneOffset = 0; slider.manualPause = false; slider.vertical = (slider.vars.slideDirection == "vertical"); slider.prop = (slider.vertical) ? "top" : "marginLeft"; slider.args = {}; //Test for webbkit CSS3 Animations slider.transitions = "webkitTransition" in document.body.style && slider.vars.useCSS; if (slider.transitions) slider.prop = "-webkit-transform"; //Test for controlsContainer if (slider.vars.controlsContainer != "") { slider.controlsContainer = $(slider.vars.controlsContainer).eq($('.slides').index(slider.container)); slider.containerExists = slider.controlsContainer.length > 0; } //Test for manualControls if (slider.vars.manualControls != "") { slider.manualControls = $(slider.vars.manualControls, ((slider.containerExists) ? slider.controlsContainer : slider)); slider.manualExists = slider.manualControls.length > 0; } /////////////////////////////////////////////////////////////////// // FlexSlider: Randomize Slides if (slider.vars.randomize) { slider.slides.sort(function() { return (Math.round(Math.random())-0.5); }); slider.container.empty().append(slider.slides); } /////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////// // FlexSlider: Slider Animation Initialize if (slider.vars.animation.toLowerCase() == "slide") { if (slider.transitions) { slider.setTransition(0); } slider.css({"overflow": "hidden"}); if (slider.vars.animationLoop) { slider.cloneCount = 2; slider.cloneOffset = 1; slider.container.append(slider.slides.filter(':first').clone().addClass('clone')).prepend(slider.slides.filter(':last').clone().addClass('clone')); } //create newSlides to capture possible clones slider.newSlides = $('.slides:first > li', slider); var sliderOffset = (-1 * (slider.currentSlide + slider.cloneOffset)); if (slider.vertical) { slider.newSlides.css({"display": "block", "width": "100%", "float": "left"}); slider.container.height((slider.count + slider.cloneCount) * 200 + "%").css("position", "absolute").width("100%"); //Timeout function to give browser enough time to get proper height initially setTimeout(function() { slider.css({"position": "relative"}).height(slider.slides.filter(':first').height()); slider.args[slider.prop] = (slider.transitions) ? "translate3d(0," + sliderOffset * slider.height() + "px,0)" : sliderOffset * slider.height() + "px"; slider.container.css(slider.args); }, 100); } else { slider.args[slider.prop] = (slider.transitions) ? "translate3d(" + sliderOffset * slider.width() + "px,0,0)" : sliderOffset * slider.width() + "px"; slider.container.width((slider.count + slider.cloneCount) * 200 + "%").css(slider.args); //Timeout function to give browser enough time to get proper width initially setTimeout(function() { slider.newSlides.width(slider.width()).css({"float": "left", "display": "block"}); }, 100); } } else { //Default to fade //Not supporting fade CSS3 transitions right now slider.transitions = false; slider.slides.css({"width": "100%", "float": "left", "marginRight": "-100%"}).eq(slider.currentSlide).fadeIn(slider.vars.animationDuration); } /////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////// // FlexSlider: Control Nav if (slider.vars.controlNav) { if (slider.manualExists) { slider.controlNav = slider.manualControls; } else { var controlNavScaffold = $('
      '); var j = 1; for (var i = 0; i < slider.count; i++) { controlNavScaffold.append('
    1. ' + j + '
    2. '); j++; } if (slider.containerExists) { $(slider.controlsContainer).append(controlNavScaffold); slider.controlNav = $('.flex-control-nav li a', slider.controlsContainer); } else { slider.append(controlNavScaffold); slider.controlNav = $('.flex-control-nav li a', slider); } } slider.controlNav.eq(slider.currentSlide).addClass('active'); slider.controlNav.bind(slider.eventType, function(event) { event.preventDefault(); if (!$(this).hasClass('active')) { (slider.controlNav.index($(this)) > slider.currentSlide) ? slider.direction = "next" : slider.direction = "prev"; slider.flexAnimate(slider.controlNav.index($(this)), slider.vars.pauseOnAction); } }); } /////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////// //FlexSlider: Direction Nav if (slider.vars.directionNav) { var directionNavScaffold = $(''); if (slider.containerExists) { $(slider.controlsContainer).append(directionNavScaffold); slider.directionNav = $('.flex-direction-nav li a', slider.controlsContainer); } else { slider.append(directionNavScaffold); slider.directionNav = $('.flex-direction-nav li a', slider); } //Set initial disable styles if necessary if (!slider.vars.animationLoop) { if (slider.currentSlide == 0) { slider.directionNav.filter('.prev').addClass('disabled'); } else if (slider.currentSlide == slider.count - 1) { slider.directionNav.filter('.next').addClass('disabled'); } } slider.directionNav.bind(slider.eventType, function(event) { event.preventDefault(); var target = ($(this).hasClass('next')) ? slider.getTarget('next') : slider.getTarget('prev'); if (slider.canAdvance(target)) { slider.flexAnimate(target, slider.vars.pauseOnAction); } }); } ////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////// //FlexSlider: Keyboard Nav if (slider.vars.keyboardNav && $('ul.slides').length == 1) { function keyboardMove(event) { if (slider.animating) { return; } else if (event.keyCode != 39 && event.keyCode != 37){ return; } else { if (event.keyCode == 39) { var target = slider.getTarget('next'); } else if (event.keyCode == 37){ var target = slider.getTarget('prev'); } if (slider.canAdvance(target)) { slider.flexAnimate(target, slider.vars.pauseOnAction); } } } $(document).bind('keyup', keyboardMove); } ////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////// // FlexSlider: Mousewheel interaction if (slider.vars.mousewheel) { slider.mousewheelEvent = (/Firefox/i.test(navigator.userAgent)) ? "DOMMouseScroll" : "mousewheel"; slider.bind(slider.mousewheelEvent, function(e) { e.preventDefault(); e = e ? e : window.event; var wheelData = e.detail ? e.detail * -1 : e.originalEvent.wheelDelta / 40, target = (wheelData < 0) ? slider.getTarget('next') : slider.getTarget('prev'); if (slider.canAdvance(target)) { slider.flexAnimate(target, slider.vars.pauseOnAction); } }); } /////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////// //FlexSlider: Slideshow Setup if (slider.vars.slideshow) { //pauseOnHover if (slider.vars.pauseOnHover && slider.vars.slideshow) { slider.hover(function() { slider.pause(); }, function() { if (!slider.manualPause) { slider.resume(); } }); } //Initialize animation slider.animatedSlides = setInterval(slider.animateSlides, slider.vars.slideshowSpeed); } ////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////// //FlexSlider: Pause/Play if (slider.vars.pausePlay) { var pausePlayScaffold = $('
      '); if (slider.containerExists) { slider.controlsContainer.append(pausePlayScaffold); slider.pausePlay = $('.flex-pauseplay span', slider.controlsContainer); } else { slider.append(pausePlayScaffold); slider.pausePlay = $('.flex-pauseplay span', slider); } var pausePlayState = (slider.vars.slideshow) ? 'pause' : 'play'; slider.pausePlay.addClass(pausePlayState).text((pausePlayState == 'pause') ? slider.vars.pauseText : slider.vars.playText); slider.pausePlay.bind(slider.eventType, function(event) { event.preventDefault(); if ($(this).hasClass('pause')) { slider.pause(); slider.manualPause = true; } else { slider.resume(); slider.manualPause = false; } }); } ////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////// //FlexSlider:Touch Swip Gestures //Some brilliant concepts adapted from the following sources //Source: TouchSwipe - http://www.netcu.de/jquery-touchwipe-iphone-ipad-library //Source: SwipeJS - http://swipejs.com if ('ontouchstart' in document.documentElement && slider.vars.touch) { //For brevity, variables are named for x-axis scrolling //The variables are then swapped if vertical sliding is applied //This reduces redundant code...I think :) //If debugging, recognize variables are named for horizontal scrolling var startX, startY, offset, cwidth, dx, startT, scrolling = false; slider.each(function() { if ('ontouchstart' in document.documentElement) { this.addEventListener('touchstart', onTouchStart, false); } }); function onTouchStart(e) { if (slider.animating) { e.preventDefault(); } else if (e.touches.length == 1) { slider.pause(); cwidth = (slider.vertical) ? slider.height() : slider.width(); startT = Number(new Date()); offset = (slider.vertical) ? (slider.currentSlide + slider.cloneOffset) * slider.height() : (slider.currentSlide + slider.cloneOffset) * slider.width(); startX = (slider.vertical) ? e.touches[0].pageY : e.touches[0].pageX; startY = (slider.vertical) ? e.touches[0].pageX : e.touches[0].pageY; slider.setTransition(0); this.addEventListener('touchmove', onTouchMove, false); this.addEventListener('touchend', onTouchEnd, false); } } function onTouchMove(e) { dx = (slider.vertical) ? startX - e.touches[0].pageY : startX - e.touches[0].pageX; scrolling = (slider.vertical) ? (Math.abs(dx) < Math.abs(e.touches[0].pageX - startY)) : (Math.abs(dx) < Math.abs(e.touches[0].pageY - startY)); if (!scrolling) { e.preventDefault(); if (slider.vars.animation == "slide" && slider.transitions) { if (!slider.vars.animationLoop) { dx = dx/((slider.currentSlide == 0 && dx < 0 || slider.currentSlide == slider.count - 1 && dx > 0) ? (Math.abs(dx)/cwidth+2) : 1); } slider.args[slider.prop] = (slider.vertical) ? "translate3d(0," + (-offset - dx) + "px,0)": "translate3d(" + (-offset - dx) + "px,0,0)"; slider.container.css(slider.args); } } } function onTouchEnd(e) { slider.animating = false; if (slider.animatingTo == slider.currentSlide && !scrolling && !(dx == null)) { var target = (dx > 0) ? slider.getTarget('next') : slider.getTarget('prev'); if (slider.canAdvance(target) && Number(new Date()) - startT < 550 && Math.abs(dx) > 20 || Math.abs(dx) > cwidth/2) { slider.flexAnimate(target, slider.vars.pauseOnAction); } else if (slider.vars.animation !== "fade") { slider.flexAnimate(slider.currentSlide, slider.vars.pauseOnAction); } } //Finish the touch by undoing the touch session this.removeEventListener('touchmove', onTouchMove, false); this.removeEventListener('touchend', onTouchEnd, false); startX = null; startY = null; dx = null; offset = null; } } ////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////// //FlexSlider: Resize Functions (If necessary) if (slider.vars.animation.toLowerCase() == "slide") { $(window).resize(function(){ if (!slider.animating && slider.is(":visible")) { if (slider.vertical) { slider.height(slider.slides.filter(':first').height()); slider.args[slider.prop] = (-1 * (slider.currentSlide + slider.cloneOffset))* slider.slides.filter(':first').height() + "px"; if (slider.transitions) { slider.setTransition(0); slider.args[slider.prop] = (slider.vertical) ? "translate3d(0," + slider.args[slider.prop] + ",0)" : "translate3d(" + slider.args[slider.prop] + ",0,0)"; } slider.container.css(slider.args); } else { slider.newSlides.width(slider.width()); slider.args[slider.prop] = (-1 * (slider.currentSlide + slider.cloneOffset))* slider.width() + "px"; if (slider.transitions) { slider.setTransition(0); slider.args[slider.prop] = (slider.vertical) ? "translate3d(0," + slider.args[slider.prop] + ",0)" : "translate3d(" + slider.args[slider.prop] + ",0,0)"; } slider.container.css(slider.args); } } }); } ////////////////////////////////////////////////////////////////// //FlexSlider: start() Callback slider.vars.start(slider); } //FlexSlider: Animation Actions slider.flexAnimate = function(target, pause) { if (!slider.animating && slider.is(":visible")) { //Animating flag slider.animating = true; //FlexSlider: before() animation Callback slider.animatingTo = target; slider.vars.before(slider); //Optional paramter to pause slider when making an anmiation call if (pause) { slider.pause(); } //Update controlNav if (slider.vars.controlNav) { slider.controlNav.removeClass('active').eq(target).addClass('active'); } //Is the slider at either end slider.atEnd = (target == 0 || target == slider.count - 1) ? true : false; if (!slider.vars.animationLoop && slider.vars.directionNav) { if (target == 0) { slider.directionNav.removeClass('disabled').filter('.prev').addClass('disabled'); } else if (target == slider.count - 1) { slider.directionNav.removeClass('disabled').filter('.next').addClass('disabled'); } else { slider.directionNav.removeClass('disabled'); } } if (!slider.vars.animationLoop && target == slider.count - 1) { slider.pause(); //FlexSlider: end() of cycle Callback slider.vars.end(slider); } if (slider.vars.animation.toLowerCase() == "slide") { var dimension = (slider.vertical) ? slider.slides.filter(':first').height() : slider.slides.filter(':first').width(); if (slider.currentSlide == 0 && target == slider.count - 1 && slider.vars.animationLoop && slider.direction != "next") { slider.slideString = "0px"; } else if (slider.currentSlide == slider.count - 1 && target == 0 && slider.vars.animationLoop && slider.direction != "prev") { slider.slideString = (-1 * (slider.count + 1)) * dimension + "px"; } else { slider.slideString = (-1 * (target + slider.cloneOffset)) * dimension + "px"; } slider.args[slider.prop] = slider.slideString; if (slider.transitions) { slider.setTransition(slider.vars.animationDuration); slider.args[slider.prop] = (slider.vertical) ? "translate3d(0," + slider.slideString + ",0)" : "translate3d(" + slider.slideString + ",0,0)"; slider.container.css(slider.args).one("webkitTransitionEnd transitionend", function(){ slider.wrapup(dimension); }); } else { slider.container.animate(slider.args, slider.vars.animationDuration, function(){ slider.wrapup(dimension); }); } } else { //Default to Fade slider.slides.eq(slider.currentSlide).fadeOut(slider.vars.animationDuration); slider.slides.eq(target).fadeIn(slider.vars.animationDuration, function() { slider.wrapup(); }); } } } //FlexSlider: Function to minify redundant animation actions slider.wrapup = function(dimension) { if (slider.vars.animation == "slide") { //Jump the slider if necessary if (slider.currentSlide == 0 && slider.animatingTo == slider.count - 1 && slider.vars.animationLoop) { slider.args[slider.prop] = (-1 * slider.count) * dimension + "px"; if (slider.transitions) { slider.setTransition(0); slider.args[slider.prop] = (slider.vertical) ? "translate3d(0," + slider.args[slider.prop] + ",0)" : "translate3d(" + slider.args[slider.prop] + ",0,0)"; } slider.container.css(slider.args); } else if (slider.currentSlide == slider.count - 1 && slider.animatingTo == 0 && slider.vars.animationLoop) { slider.args[slider.prop] = -1 * dimension + "px"; if (slider.transitions) { slider.setTransition(0); slider.args[slider.prop] = (slider.vertical) ? "translate3d(0," + slider.args[slider.prop] + ",0)" : "translate3d(" + slider.args[slider.prop] + ",0,0)"; } slider.container.css(slider.args); } } slider.animating = false; slider.currentSlide = slider.animatingTo; //FlexSlider: after() animation Callback slider.vars.after(slider); } //FlexSlider: Automatic Slideshow slider.animateSlides = function() { if (!slider.animating) { slider.flexAnimate(slider.getTarget("next")); } } //FlexSlider: Automatic Slideshow Pause slider.pause = function() { clearInterval(slider.animatedSlides); if (slider.vars.pausePlay) { slider.pausePlay.removeClass('pause').addClass('play').text(slider.vars.playText); } } //FlexSlider: Automatic Slideshow Start/Resume slider.resume = function() { slider.animatedSlides = setInterval(slider.animateSlides, slider.vars.slideshowSpeed); if (slider.vars.pausePlay) { slider.pausePlay.removeClass('play').addClass('pause').text(slider.vars.pauseText); } } //FlexSlider: Helper function for non-looping sliders slider.canAdvance = function(target) { if (!slider.vars.animationLoop && slider.atEnd) { if (slider.currentSlide == 0 && target == slider.count - 1 && slider.direction != "next") { return false; } else if (slider.currentSlide == slider.count - 1 && target == 0 && slider.direction == "next") { return false; } else { return true; } } else { return true; } } //FlexSlider: Helper function to determine animation target slider.getTarget = function(dir) { slider.direction = dir; if (dir == "next") { return (slider.currentSlide == slider.count - 1) ? 0 : slider.currentSlide + 1; } else { return (slider.currentSlide == 0) ? slider.count - 1 : slider.currentSlide - 1; } } //FlexSlider: Helper function to set CSS3 transitions slider.setTransition = function(dur) { slider.container.css({'-webkit-transition-duration': (dur/1000) + "s"}); } //FlexSlider: Initialize slider.init(); } //FlexSlider: Default Settings $.flexslider.defaults = { animation: "fade", //String: Select your animation type, "fade" or "slide" slideDirection: "horizontal", //String: Select the sliding direction, "horizontal" or "vertical" slideshow: true, //Boolean: Animate slider automatically slideshowSpeed: 7000, //Integer: Set the speed of the slideshow cycling, in milliseconds animationDuration: 600, //Integer: Set the speed of animations, in milliseconds directionNav: true, //Boolean: Create navigation for previous/next navigation? (true/false) controlNav: true, //Boolean: Create navigation for paging control of each clide? Note: Leave true for manualControls usage keyboardNav: true, //Boolean: Allow slider navigating via keyboard left/right keys mousewheel: false, //Boolean: Allow slider navigating via mousewheel prevText: "Previous", //String: Set the text for the "previous" directionNav item nextText: "Next", //String: Set the text for the "next" directionNav item pausePlay: false, //Boolean: Create pause/play dynamic element pauseText: 'Pause', //String: Set the text for the "pause" pausePlay item playText: 'Play', //String: Set the text for the "play" pausePlay item randomize: false, //Boolean: Randomize slide order slideToStart: 0, //Integer: The slide that the slider should start on. Array notation (0 = first slide) animationLoop: true, //Boolean: Should the animation loop? If false, directionNav will received "disable" classes at either end pauseOnAction: true, //Boolean: Pause the slideshow when interacting with control elements, highly recommended. pauseOnHover: false, //Boolean: Pause the slideshow when hovering over slider, then resume when no longer hovering useCSS: true, //Boolean: Override the use of CSS3 Translate3d animations touch: true, //Boolean: Disable touchswipe events controlsContainer: "", //Selector: Declare which container the navigation elements should be appended too. Default container is the flexSlider element. Example use would be ".flexslider-container", "#container", etc. If the given element is not found, the default action will be taken. manualControls: "", //Selector: Declare custom control navigation. Example would be ".flex-control-nav li" or "#tabs-nav li img", etc. The number of elements in your controlNav should match the number of slides/tabs. start: function(){}, //Callback: function(slider) - Fires when the slider loads the first slide before: function(){}, //Callback: function(slider) - Fires asynchronously with each slider animation after: function(){}, //Callback: function(slider) - Fires after each slider animation completes end: function(){} //Callback: function(slider) - Fires when the slider reaches the last slide (asynchronous) } //FlexSlider: Plugin Function $.fn.flexslider = function(options) { return this.each(function() { var $slides = $(this).find('.slides > li'); if ($slides.length === 1) { $slides.find('.slides > li').fadeIn(400); if (options && options.start) options.start($(this)); } else if ($(this).data('flexsliderInit') != true) { new $.flexslider(this, options); } }); } })(jQuery); (function(a){a.fn.stupidtable=function(b){var c=this;b=b||{};b=a.extend({},{"int":function(a,b){return parseInt(a,10)-parseInt(b,10)},"float":function(a,b){return parseFloat(a)-parseFloat(b)},string:function(a,b){if(ab)return+1;return 0}},b);var d=function(a,b){return!!a&&!!b&&!(a=0;h--){m.push(h)}}else{m=e(column,l)}var n=a(f(d,m));c.find("tbody").append(n)})}})(jQuery) ; /* * jQuery Reveal Plugin 1.0 * www.ZURB.com * Copyright 2010, ZURB * Free to use under the MIT license. * http://www.opensource.org/licenses/mit-license.php */ /*globals jQuery */ (function ($) { $('a[data-reveal-id]').live('click', function (event) { event.preventDefault(); var modalLocation = $(this).attr('data-reveal-id'); $('#' + modalLocation).reveal($(this).data()); }); $.fn.reveal = function (options) { var defaults = { animation: 'fadeAndPop', // fade, fadeAndPop, none animationSpeed: 300, // how fast animtions are closeOnBackgroundClick: true, // if you click background will modal close? dismissModalClass: 'close-reveal-modal', // the class of a button or element that will close an open modal open: $.noop, opened: $.noop, close: $.noop, closed: $.noop }; options = $.extend({}, defaults, options); return this.each(function () { var modal = $(this), topMeasure = parseInt(modal.css('top'), 10), topOffset = modal.outerHeight(true) + topMeasure, locked = false, modalBg = $('.reveal-modal-bg'), closeButton; if (modalBg.length === 0) { modalBg = $('
      ').insertAfter(modal); modalBg.fadeTo('fast', 0.8); } function unlockModal() { locked = false; } function lockModal() { locked = true; } function openAnimation() { if (!locked) { lockModal(); if (options.animation === "fadeAndPop") { modal.css({'top': $(document).scrollTop() - topOffset, 'opacity': 0, 'visibility': 'visible'}); modalBg.fadeIn(options.animationSpeed / 2); modal.delay(options.animationSpeed / 2).animate({ "top": $(document).scrollTop() + topMeasure + 'px', "opacity": 1 }, options.animationSpeed, function () { modal.trigger('reveal:opened'); }); } if (options.animation === "fade") { modal.css({'opacity': 0, 'visibility': 'visible', 'top': $(document).scrollTop() + topMeasure}); modalBg.fadeIn(options.animationSpeed / 2); modal.delay(options.animationSpeed / 2).animate({ "opacity": 1 }, options.animationSpeed, function () { modal.trigger('reveal:opened'); }); } if (options.animation === "none") { modal.css({'visibility': 'visible', 'top': $(document).scrollTop() + topMeasure}); modalBg.css({"display": "block"}); modal.trigger('reveal:opened'); } } } modal.bind('reveal:open.reveal', openAnimation); function closeAnimation() { if (!locked) { lockModal(); if (options.animation === "fadeAndPop") { modal.animate({ "top": $(document).scrollTop() - topOffset + 'px', "opacity": 0 }, options.animationSpeed / 2, function () { modal.css({'top': topMeasure, 'opacity': 1, 'visibility': 'hidden'}); }); modalBg.delay(options.animationSpeed).fadeOut(options.animationSpeed, function () { modal.trigger('reveal:closed'); }); } if (options.animation === "fade") { modal.animate({ "opacity" : 0 }, options.animationSpeed, function () { modal.css({'opacity': 1, 'visibility': 'hidden', 'top': topMeasure}); }); modalBg.delay(options.animationSpeed).fadeOut(options.animationSpeed, function () { modal.trigger('reveal:closed'); }); } if (options.animation === "none") { modal.css({'visibility': 'hidden', 'top': topMeasure}); modalBg.css({'display': 'none'}); modal.trigger('reveal:closed'); } } } function destroy() { modal.unbind('.reveal'); modalBg.unbind('.reveal'); $('.' + options.dismissModalClass).unbind('.reveal'); $('body').unbind('.reveal'); } modal.bind('reveal:close.reveal', closeAnimation); modal.bind('reveal:opened.reveal reveal:closed.reveal', unlockModal); modal.bind('reveal:closed.reveal', destroy); modal.bind('reveal:open.reveal', options.open); modal.bind('reveal:opened.reveal', options.opened); modal.bind('reveal:close.reveal', options.close); modal.bind('reveal:closed.reveal', options.closed); modal.trigger('reveal:open'); closeButton = $('.' + options.dismissModalClass).bind('click.reveal', function () { modal.trigger('reveal:close'); }); if (options.closeOnBackgroundClick) { modalBg.css({"cursor": "pointer"}); modalBg.bind('click.reveal', function () { modal.trigger('reveal:close'); }); } $('body').bind('keyup.reveal', function (event) { if (event.which === 27) { // 27 is the keycode for the Escape key modal.trigger('reveal:close'); } }); }); }; } (jQuery)); /* * jQuery Foundation Tooltip Plugin 1.0.1 * http://foundation.zurb.com * Copyright 2012, ZURB * Free to use under the MIT license. * http://www.opensource.org/licenses/mit-license.php */ ;(function($) { var attributes = { bodyHeight : 0, pollInterval : 1000 }, methods = { init : function(options) { return this.each(function() { var targets, tips, tipTemplate, poll; $(window).data('tooltips', 'init'); targets = $('.has-tip'); tips = $('.tooltip'); tipTemplate = function(target, content) { return '' + content + ''; }; poll = setInterval(methods.isDomResized, attributes.pollInterval); if (tips.length < 1) { targets.each(function(i){ var target, tip, id, content, classes; target = $(this); id = 'foundationTooltip' + i; content = target.attr('title'); classes = target.attr('class'); target.data('id', id); tip = $(tipTemplate(id, content)); tip.addClass(classes).removeClass('has-tip').appendTo('body'); if (Modernizr.touch) tip.append('tap to close '); methods.reposition(target, tip, classes); tip.fadeOut(150); }); } $(window).on('resize.tooltip', function() { var tips = $('.tooltip'); tips.each(function() { var data, target, tip, classes; data = $(this).data(); target = targets = $('.has-tip'); tip = $(this); classes = tip.attr('class'); targets.each(function() { ($(this).data().id == data.id) ? target = $(this) : target = target; }); methods.reposition(target, tip, classes); }); }); /* if (Modernizr.touch) { $('.tooltip').on('click.tooltip touchstart.tooltip touchend.tooltip', function(e) { e.preventDefault(); $(this).fadeOut(150); }); targets.on('click.tooltip touchstart.tooltip touchend.tooltip', function(e){ e.preventDefault(); $('.tooltip').hide(); $('span[data-id=' + $(this).data('id') + '].tooltip').fadeIn(150); targets.attr('title', ""); }); } else { targets.hover(function() { $('span[data-id=' + $(this).data('id') + '].tooltip').fadeIn(150); targets.attr('title', ""); }, function() { $('span[data-id=' + $(this).data('id') + '].tooltip').fadeOut(150); }); }*/ }); }, reload : function() { var $self = $(window); return ($self.data('tooltips')) ? $self.tooltips('destroy').tooltips('init') : $self.tooltips('init'); }, destroy : function() { return this.each(function(){ $(window).unbind('.tooltip'); $('.has-tip').unbind('.tooltip'); $('.tooltip').each(function(i){ $($('.has-tip').get(i)).attr('title', $(this).text()); //console.log("removed "+ $($('.has-tip').get(i)).attr('id')); }).remove(); }); }, reposition : function(target, tip, classes) { var width, nub, nubHeight, nubWidth, row, objPos; width = target.data('width'); nub = tip.children('.nub'); nubHeight = nub.outerHeight(); nubWidth = nub.outerWidth(); objPos = function(obj, top, right, bottom, left, width) { return obj.css({ 'top' : top, 'bottom' : bottom, 'left' : left, 'right' : right, 'width' : (width) ? width : 'auto' }).end(); }; //console.log("target:"+target.data('id')+", left:"+target.offset().left); objPos(tip, (target.offset().top + target.outerHeight() - 10), 'auto', 'auto', target.offset().left, width); objPos(nub, -nubHeight, 'auto', 'auto', 10); if ($(window).width() < 767) { row = target.parents('.row'); tip.width(row.outerWidth() - 20).css('left', row.offset().left).addClass('tip-override'); objPos(nub, -nubHeight, 'auto', 'auto', target.offset().left); } else { if (classes.indexOf('tip-top') > -1) { objPos(tip, (target.offset().top - tip.outerHeight() - nubHeight), 'auto', 'auto', target.offset().left, width) .removeClass('tip-override'); objPos(nub, 'auto', 'auto', -nubHeight, 'auto'); } else if (classes.indexOf('tip-left') > -1) { objPos(tip, (target.offset().top + (target.outerHeight() / 2) - nubHeight), 'auto', 'auto', (target.offset().left - tip.outerWidth() - 10), width) .removeClass('tip-override'); objPos(nub, (tip.outerHeight() / 2) - (nubHeight / 2), -nubHeight, 'auto', 'auto'); } else if (classes.indexOf('tip-right') > -1) { objPos(tip, (target.offset().top + (target.outerHeight() / 2) - nubHeight), 'auto', 'auto', (target.offset().left + target.outerWidth() + 10), width) .removeClass('tip-override'); objPos(nub, (tip.outerHeight() / 2) - (nubHeight / 2), 'auto', 'auto', -nubHeight); } } }, isDomResized : function() { $body = $('body'); if(attributes.bodyHeight != $body.height()) { attributes.bodyHeight = $body.height(); $(window).trigger('resize'); } } }; $.fn.tooltips = function( method ) { if ( methods[method] ) { return methods[ method ].apply( this, Array.prototype.slice.call( arguments, 1 )); } else if ( typeof method === 'object' || ! method ) { return methods.init.apply( this, arguments ); } else { $.error( 'Method ' + method + ' does not exist on jQuery.tooltips' ); } }; })(jQuery); /* * jScrollPane - v2.0.0beta12 - 2012-05-14 * 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 ay,Q=this,Y,aj,v,al,T,Z,y,q,az,aE,au,i,I,h,j,aa,U,ap,X,t,A,aq,af,am,G,l,at,ax,x,av,aH,f,L,ai=true,P=true,aG=false,k=false,ao=D.clone(false,false).empty(),ac=b.fn.mwheelIntent?"mwheelIntent.jsp":"mousewheel.jsp";aH=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 ar(aQ){var aL,aN,aM,aJ,aI,aP,aO=false,aK=false;ay=aQ;if(Y===c){aI=D.scrollTop();aP=D.scrollLeft();D.css({overflow:"hidden",padding:0});aj=D.innerWidth()+f;v=D.innerHeight();D.width(aj);Y=b('
      ').css("padding",aH).append(D.children());al=b('
      ').css({width:aj+"px",height:v+"px"}).append(Y).appendTo(D)}else{D.css("width","");aO=ay.stickToBottom&&K();aK=ay.stickToRight&&B();aJ=D.innerWidth()+f!=aj||D.outerHeight()!=v;if(aJ){aj=D.innerWidth()+f;v=D.innerHeight();al.css({width:aj+"px",height:v+"px"})}if(!aJ&&L==T&&Y.outerHeight()==Z){D.width(aj);return}L=T;Y.css("width","");D.width(aj);al.find(">.jspVerticalBar,>.jspHorizontalBar").remove().end()}Y.css("overflow","auto");if(aQ.contentWidth){T=aQ.contentWidth}else{T=Y[0].scrollWidth}Z=Y[0].scrollHeight;Y.css("overflow","");y=T/aj;q=Z/v;az=q>1;aE=y>1;if(!(aE||az)){D.removeClass("jspScrollable");Y.css({top:0,width:al.width()-f});n();E();R();w()}else{D.addClass("jspScrollable");aL=ay.maintainPosition&&(I||aa);if(aL){aN=aC();aM=aA()}aF();z();F();if(aL){N(aK?(T-aj):aN,false);M(aO?(Z-v):aM,false)}J();ag();an();if(ay.enableKeyboardNavigation){S()}if(ay.clickOnTrack){p()}C();if(ay.hijackInternalLinks){m()}}if(ay.autoReinitialise&&!av){av=setInterval(function(){ar(ay)},ay.autoReinitialiseDelay)}else{if(!ay.autoReinitialise&&av){clearInterval(av)}}aI&&D.scrollTop(0)&&M(aI,false);aP&&D.scrollLeft(0)&&N(aP,false);D.trigger("jsp-initialised",[aE||az])}function aF(){if(az){al.append(b('
      ').append(b('
      '),b('
      ').append(b('
      ').append(b('
      '),b('
      '))),b('
      ')));U=al.find(">.jspVerticalBar");ap=U.find(">.jspTrack");au=ap.find(">.jspDrag");if(ay.showArrows){aq=b('').bind("mousedown.jsp",aD(0,-1)).bind("click.jsp",aB);af=b('').bind("mousedown.jsp",aD(0,1)).bind("click.jsp",aB);if(ay.arrowScrollOnHover){aq.bind("mouseover.jsp",aD(0,-1,aq));af.bind("mouseover.jsp",aD(0,1,af))}ak(ap,ay.verticalArrowPositions,aq,af)}t=v;al.find(">.jspVerticalBar>.jspCap:visible,>.jspVerticalBar>.jspArrow").each(function(){t-=b(this).outerHeight()});au.hover(function(){au.addClass("jspHover")},function(){au.removeClass("jspHover")}).bind("mousedown.jsp",function(aI){b("html").bind("dragstart.jsp selectstart.jsp",aB);au.addClass("jspActive");var s=aI.pageY-au.position().top;b("html").bind("mousemove.jsp",function(aJ){V(aJ.pageY-s,false)}).bind("mouseup.jsp mouseleave.jsp",aw);return false});o()}}function o(){ap.height(t+"px");I=0;X=ay.verticalGutter+ap.outerWidth();Y.width(aj-X-f);try{if(U.position().left===0){Y.css("margin-left",X+"px")}}catch(s){}}function z(){if(aE){al.append(b('
      ').append(b('
      '),b('
      ').append(b('
      ').append(b('
      '),b('
      '))),b('
      ')));am=al.find(">.jspHorizontalBar");G=am.find(">.jspTrack");h=G.find(">.jspDrag");if(ay.showArrows){ax=b('').bind("mousedown.jsp",aD(-1,0)).bind("click.jsp",aB);x=b('').bind("mousedown.jsp",aD(1,0)).bind("click.jsp",aB); if(ay.arrowScrollOnHover){ax.bind("mouseover.jsp",aD(-1,0,ax));x.bind("mouseover.jsp",aD(1,0,x))}ak(G,ay.horizontalArrowPositions,ax,x)}h.hover(function(){h.addClass("jspHover")},function(){h.removeClass("jspHover")}).bind("mousedown.jsp",function(aI){b("html").bind("dragstart.jsp selectstart.jsp",aB);h.addClass("jspActive");var s=aI.pageX-h.position().left;b("html").bind("mousemove.jsp",function(aJ){W(aJ.pageX-s,false)}).bind("mouseup.jsp mouseleave.jsp",aw);return false});l=al.innerWidth();ah()}}function ah(){al.find(">.jspHorizontalBar>.jspCap:visible,>.jspHorizontalBar>.jspArrow").each(function(){l-=b(this).outerWidth()});G.width(l+"px");aa=0}function F(){if(aE&&az){var aI=G.outerHeight(),s=ap.outerWidth();t-=aI;b(am).find(">.jspCap:visible,>.jspArrow").each(function(){l+=b(this).outerWidth()});l-=s;v-=s;aj-=aI;G.parent().append(b('
      ').css("width",aI+"px"));o();ah()}if(aE){Y.width((al.outerWidth()-f)+"px")}Z=Y.outerHeight();q=Z/v;if(aE){at=Math.ceil(1/y*l);if(at>ay.horizontalDragMaxWidth){at=ay.horizontalDragMaxWidth}else{if(atay.verticalDragMaxHeight){A=ay.verticalDragMaxHeight}else{if(AaS){Q.scrollByY(-aP)}else{V(aS)}}else{if(aM>0){if(I+aQaS){Q.scrollByX(-aP)}else{W(aS)}}else{if(aM>0){if(aa+aQi){s=i}}if(aI===c){aI=ay.animateScroll}if(aI){Q.animate(au,"top",s,ad)}else{au.css("top",s);ad(s)}}function ad(aI){if(aI===c){aI=au.position().top}al.scrollTop(0);I=aI;var aL=I===0,aJ=I==i,aK=aI/i,s=-aK*(Z-v);if(ai!=aL||aG!=aJ){ai=aL;aG=aJ;D.trigger("jsp-arrow-change",[ai,aG,P,k])}u(aL,aJ);Y.css("top",s);D.trigger("jsp-scroll-y",[-s,aL,aJ]).trigger("scroll")}function W(aI,s){if(!aE){return}if(aI<0){aI=0}else{if(aI>j){aI=j}}if(s===c){s=ay.animateScroll}if(s){Q.animate(h,"left",aI,ae) }else{h.css("left",aI);ae(aI)}}function ae(aI){if(aI===c){aI=h.position().left}al.scrollTop(0);aa=aI;var aL=aa===0,aK=aa==j,aJ=aI/j,s=-aJ*(T-aj);if(P!=aL||k!=aK){P=aL;k=aK;D.trigger("jsp-arrow-change",[ai,aG,P,k])}r(aL,aK);Y.css("left",s);D.trigger("jsp-scroll-x",[-s,aL,aK]).trigger("scroll")}function u(aI,s){if(ay.showArrows){aq[aI?"addClass":"removeClass"]("jspDisabled");af[s?"addClass":"removeClass"]("jspDisabled")}}function r(aI,s){if(ay.showArrows){ax[aI?"addClass":"removeClass"]("jspDisabled");x[s?"addClass":"removeClass"]("jspDisabled")}}function M(s,aI){var aJ=s/(Z-v);V(aJ*i,aI)}function N(aI,s){var aJ=aI/(T-aj);W(aJ*j,s)}function ab(aV,aQ,aJ){var aN,aK,aL,s=0,aU=0,aI,aP,aO,aS,aR,aT;try{aN=b(aV)}catch(aM){return}aK=aN.outerHeight();aL=aN.outerWidth();al.scrollTop(0);al.scrollLeft(0);while(!aN.is(".jspPane")){s+=aN.position().top;aU+=aN.position().left;aN=aN.offsetParent();if(/^body|html$/i.test(aN[0].nodeName)){return}}aI=aA();aO=aI+v;if(saO){aR=s-v+aK+ay.verticalGutter}}if(aR){M(aR,aJ)}aP=aC();aS=aP+aj;if(aUaS){aT=aU-aj+aL+ay.horizontalGutter}}if(aT){N(aT,aJ)}}function aC(){return -Y.position().left}function aA(){return -Y.position().top}function K(){var s=Z-v;return(s>20)&&(s-aA()<10)}function B(){var s=T-aj;return(s>20)&&(s-aC()<10)}function ag(){al.unbind(ac).bind(ac,function(aL,aM,aK,aI){var aJ=aa,s=I;Q.scrollBy(aK*ay.mouseWheelSpeed,-aI*ay.mouseWheelSpeed,false);return aJ==aa&&s==I})}function n(){al.unbind(ac)}function aB(){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,aI,aK=[];aE&&aK.push(am[0]);az&&aK.push(U[0]);Y.focus(function(){D.focus()});D.attr("tabindex",0).unbind("keydown.jsp keypress.jsp").bind("keydown.jsp",function(aN){if(aN.target!==this&&!(aK.length&&b(aN.target).closest(aK).length)){return}var aM=aa,aL=I;switch(aN.keyCode){case 40:case 38:case 34:case 32:case 33:case 39:case 37:s=aN.keyCode;aJ();break;case 35:M(Z-v);s=null;break;case 36:M(0);s=null;break}aI=aN.keyCode==s&&aM!=aa||aL!=I;return !aI}).bind("keypress.jsp",function(aL){if(aL.keyCode==s){aJ()}return !aI});if(ay.hideFocus){D.css("outline","none");if("hideFocus" in al[0]){D.attr("hideFocus",true)}}else{D.css("outline","");if("hideFocus" in al[0]){D.attr("hideFocus",false)}}function aJ(){var aM=aa,aL=I;switch(s){case 40:Q.scrollByY(ay.keyboardSpeed,false);break;case 38:Q.scrollByY(-ay.keyboardSpeed,false);break;case 34:case 32:Q.scrollByY(v*ay.scrollPagePercent,false);break;case 33:Q.scrollByY(-v*ay.scrollPagePercent,false);break;case 39:Q.scrollByX(ay.keyboardSpeed,false);break;case 37:Q.scrollByX(-ay.keyboardSpeed,false);break}aI=aM!=aa||aL!=I;return aI}}function R(){D.attr("tabindex","-1").removeAttr("tabindex").unbind("keydown.jsp keypress.jsp")}function C(){if(location.hash&&location.hash.length>1){var aK,aI,aJ=escape(location.hash.substr(1));try{aK=b("#"+aJ+', a[name="'+aJ+'"]')}catch(s){return}if(aK.length&&Y.find(aJ)){if(al.scrollTop()===0){aI=setInterval(function(){if(al.scrollTop()>0){ab(aK,true);b(document).scrollTop(al.position().top);clearInterval(aI)}},50)}else{ab(aK,true);b(document).scrollTop(al.position().top)}}}}function m(){if(b(document.body).data("jspHijack")){return}b(document.body).data("jspHijack",true);b(document.body).delegate("a[href*=#]","click",function(s){var aI=this.href.substr(0,this.href.indexOf("#")),aK=location.href,aO,aP,aJ,aM,aL,aN;if(location.href.indexOf("#")!==-1){aK=location.href.substr(0,location.href.indexOf("#"))}if(aI!==aK){return}aO=escape(this.href.substr(this.href.indexOf("#")+1));aP;try{aP=b("#"+aO+', a[name="'+aO+'"]')}catch(aQ){return}if(!aP.length){return}aJ=aP.closest(".jspScrollable");aM=aJ.data("jsp");aM.scrollToElement(aP,true);if(aJ[0].scrollIntoView){aL=b(a).scrollTop();aN=aP.offset().top;if(aNaL+b(a).height()){aJ[0].scrollIntoView()}}s.preventDefault() })}function an(){var aJ,aI,aL,aK,aM,s=false;al.unbind("touchstart.jsp touchmove.jsp touchend.jsp click.jsp-touchclick").bind("touchstart.jsp",function(aN){var aO=aN.originalEvent.touches[0];aJ=aC();aI=aA();aL=aO.pageX;aK=aO.pageY;aM=false;s=true}).bind("touchmove.jsp",function(aQ){if(!s){return}var aP=aQ.originalEvent.touches[0],aO=aa,aN=I;Q.scrollTo(aJ+aL-aP.pageX,aI+aK-aP.pageY);aM=aM||Math.abs(aL-aP.pageX)>5||Math.abs(aK-aP.pageY)>5;return aO==aa&&aN==I}).bind("touchend.jsp",function(aN){s=false}).bind("click.jsp-touchclick",function(aN){if(aM){aM=false;return false}})}function g(){var s=aA(),aI=aC();D.removeClass("jspScrollable").unbind(".jsp");D.replaceWith(ao.append(Y.children()));ao.scrollTop(s);ao.scrollLeft(aI);if(av){clearInterval(av)}}b.extend(Q,{reinitialise:function(aI){aI=b.extend({},ay,aI);ar(aI)},scrollToElement:function(aJ,aI,s){ab(aJ,aI,s)},scrollTo:function(aJ,s,aI){N(aJ,aI);M(s,aI)},scrollToX:function(aI,s){N(aI,s)},scrollToY:function(s,aI){M(s,aI)},scrollToPercentX:function(aI,s){N(aI*(T-aj),s)},scrollToPercentY:function(aI,s){M(aI*(Z-v),s)},scrollBy:function(aI,s,aJ){Q.scrollByX(aI,aJ);Q.scrollByY(s,aJ)},scrollByX:function(s,aJ){var aI=aC()+Math[s<0?"floor":"ceil"](s),aK=aI/(T-aj);W(aK*j,aJ)},scrollByY:function(s,aJ){var aI=aA()+Math[s<0?"floor":"ceil"](s),aK=aI/(Z-v);V(aK*i,aJ)},positionDragX:function(s,aI){W(s,aI)},positionDragY:function(aI,s){V(aI,s)},animate:function(aI,aL,s,aK){var aJ={};aJ[aL]=s;aI.animate(aJ,{duration:ay.animateDuration,easing:ay.animateEase,queue:false,step:aK})},getContentPositionX:function(){return aC()},getContentPositionY:function(){return aA()},getContentWidth:function(){return T},getContentHeight:function(){return Z},getPercentScrolledX:function(){return aC()/(T-aj)},getPercentScrolledY:function(){return aA()/(Z-v)},getIsScrollableH:function(){return aE},getIsScrollableV:function(){return az},getContentPane:function(){return Y},scrollToBottom:function(s){V(i,s)},hijackInternalLinks:b.noop,destroy:function(){g()}});ar(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); /*! Copyright (c) 2011 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.6 * * Requires: 1.2.2+ */ (function($) { var types = ['DOMMouseScroll', 'mousewheel']; if ($.event.fixHooks) { for ( var i=types.length; i; ) { $.event.fixHooks[ types[--i] ] = $.event.mouseHooks; } } $.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 ( orgEvent.wheelDelta ) { delta = orgEvent.wheelDelta/120; } if ( orgEvent.detail ) { delta = -orgEvent.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.dispatch || $.event.handle).apply(this, args); } })(jQuery); // Using Sprockets to concatenate all our separate plugins into this file at runtime // usage: log('inside coolFunc', this, arguments); // paulirish.com/2009/log-a-lightweight-wrapper-for-consolelog/ window.log = function f(){ log.history = log.history || []; log.history.push(arguments); if(this.console) { var args = arguments, newarr; try { args.callee = f.caller } catch(e) {}; newarr = [].slice.call(args); if (typeof console.log === 'object') log.apply.call(console.log, console, newarr); else console.log.apply(console, newarr);}}; // make it safe to use console.log always (function(a){function b(){}for(var c="assert,count,debug,dir,dirxml,error,exception,group,groupCollapsed,groupEnd,info,log,markTimeline,profile,profileEnd,time,timeEnd,trace,warn".split(","),d;!!(d=c.pop());){a[d]=a[d]||b;}}) (function(){try{console.log();return window.console;}catch(a){return (window.console={});}}()); // place any jQuery/helper plugins in here, instead of separate, slower script files. ;(function($) { $.fn.panelTabs = function(options) { options = $.extend({}, { currentTabClass: 'current', tabContentClass: 'tab-content', activeTabContentClass: 'tab-active' }, options); return this.each(function () { var tabsNav = $(this); var tabLinks = $('.tabs a', tabsNav); tabLinks.bind('click', function(e){ //e.preventDefault(); $el = $(this) var elId = $el.attr('href').replace(/#/, "."); var $tabPanels = $('.tab-content'); var $target = $tabPanels.filter(elId); if ($target.length != 0) { tabsNav.find('li.'+options.currentTabClass).removeClass(options.currentTabClass); $el.closest('li').addClass(options.currentTabClass) $tabPanels.hide(); $target.show(); } }); if(window.location.hash.length > 0){ tabLinks.filter('[href="'+window.location.hash+'"]').trigger("click"); } }); }; // })(jQuery); ;(function ( $, window, document, undefined ) { // Create the defaults once var pluginName = 'xl', defaults = { imageContainer: 'bgstretcher', slideSelector: '.slide', navSelector: '.thumb-nav', resizeProportionally: true, resizeAnimate: false, images: [], imageWidth: 1024, imageHeight: 768, maxWidth: 'auto', maxHeight: 'auto', nextSlideDelay: 3000, slideShowSpeed: 'normal', slideShow: true, transitionEffect: 'fade', // none, fade, simpleSlide, superSlide slideDirection: 'N', // N, S, W, E, (if superSlide - NW, NE, SW, SE) sequenceMode: 'normal', // back, random buttonPrev: '', buttonNext: '', pagination: '', anchoring: 'left top', // right bottom center anchoringImg: 'left top', // right bottom center preloadImg: false, startElementIndex: 0, callbackfunction: null }; // The actual plugin constructor function Plugin( element, options ) { this.element = element; // jQuery has an extend method which merges the contents of two or // more objects, storing the result in the first object. The first object // is generally empty as we don't want to alter the default options for // future instances of the plugin this.options = $.extend( {}, defaults, options) ; this._defaults = defaults; this._name = pluginName; this.init(); } Plugin.prototype.init = function () { // Place initialization logic here // You already have access to the DOM element and the options via the instance, // e.g., this.element and this.options //console.log(this.options);============================== var p = this, $this = $(this.element), $slides = $this.find(this.options.slideSelector), $nav = $this.find(this.options.navSelector), $window = $(window), contW = $this.width(), contH = $this.height(); slideCount = $slides.length; $this.addClass("xl-container"); $slides.hide(); $slides.each(function(i){ var slide = $(this); var imgsrc = slide.data("image"); var img = new Image(); $(img).load(function(){ // Image loaded, append and scale it! $(this).prependTo(slide).hide().fadeIn( p.options.slideShowSpeed ); }).error(function(){ // Error! }).attr("src", imgsrc); }); $slides.eq(this.options.startElementIndex).show().addClass("current"); $nav.find('li').eq(this.options.startElementIndex).addClass("current"); var that,current; that = current = $slides.eq(this.options.startElementIndex); var navItem = $nav.find('li').eq(this.options.startElementIndex+1); var curIndex = this.options.startElementIndex; var nextIndex = this.options.startElementIndex+1 < slideCount?this.options.startElementIndex+1:0; var next=$slides.eq(nextIndex); //console.log("Next Index: " + nextIndex);=============================== $nav.on("click", "li a", function(e){ e.preventDefault(); that = $(this), navItem = that.closest('li'); current = $slides.filter(".current"); curIndex = current.index(), next, nextIndex = $(this).parents('li').index()+1 < slideCount ? $(this).parents('li').index()+1:0; next = $slides.eq(nextIndex-1); $slides.removeClass("current"); next.addClass("current"); $nav.find('li').removeClass("current"); navItem.addClass("current"); // Fade In effect next.fadeIn( p.options.slideShowSpeed ); current.fadeOut( p.options.slideShowSpeed, function(){ //console.log("Callback"); p.options.after(next); }); }); //after set interval trigger click // var nextClick; // setInterval(function(){ // $nav.find('li').eq(nextIndex).find('a').click(); // },p.options.slideShowSpeed*9); //the 10 is to delay it a bit //Make equal tabs var tabs = $nav.find('li'); var numTabs = tabs.length; tabs.css('width', 100/numTabs + '%'); tabs.last().addClass("last"); /* var tabsWidthBef = 0; // OR grab the CSS value to be quicker tabs.each( function(i) { tabsWidthBef += $(this).outerWidth(); }); var spaceToWorkWith = contW - tabsWidthBef; var addedTabWidth = Math.floor(spaceToWorkWith/numTabs); var spaceLeftOver = spaceToWorkWith % numTabs; tabs.each( function(i) { var curWidth = $(this).width(); // Add the leftover space to the last tab if((tabs.length - 1) == i){ $(this).css('width', curWidth + addedTabWidth + spaceLeftOver + 'px'); }else{ $(this).css('width', curWidth + addedTabWidth + 'px'); } }); */ }; // A really lightweight plugin wrapper around the constructor, // preventing against multiple instantiations $.fn[pluginName] = function ( options ) { return this.each(function () { if (!$.data(this, 'plugin_' + pluginName)) { $.data(this, 'plugin_' + pluginName, new Plugin( this, options )); } }); }; })(jQuery, window);