// Plugins

// usage: log('inside coolFunc', this, arguments);
// paulirish.com/2009/log-a-lightweight-wrapper-for-consolelog/
window.log = function(){
log.history = log.history || [];   // store logs to an array for reference
log.history.push(arguments);
arguments.callee = arguments.callee.caller; 
if(this.console) console.log( Array.prototype.slice.call(arguments) );
};

// make it safe to use console.log always
(function(b){function c(){}for(var d="assert,count,debug,dir,dirxml,error,exception,group,groupCollapsed,groupEnd,info, log,markTimeline,profile,profileEnd,time,timeEnd,trace,warn".split(","),a;a=d.pop();)b[a]=b[a]||c})(window.console=window.console||{});

// jQuery/helper plugins

/*!
 * HTML5 Placeholder jQuery Plugin v1.8.2
 * @link http://github.com/mathiasbynens/Placeholder-jQuery-Plugin
 * @author Mathias Bynens <http://mathiasbynens.be/>
 */
 
;(function($) {

	var isInputSupported = 'placeholder' in document.createElement('input'),
	    isTextareaSupported = 'placeholder' in document.createElement('textarea');
	if (isInputSupported && isTextareaSupported) {
		$.fn.placeholder = function() {
			return this;
		};
		$.fn.placeholder.input = $.fn.placeholder.textarea = true;
	} else {
		$.fn.placeholder = function() {
			return this.filter((isInputSupported ? 'textarea' : ':input') + '[placeholder]')
				.bind('focus.placeholder', clearPlaceholder)
				.bind('blur.placeholder', setPlaceholder)
			.trigger('blur.placeholder').end();
		};
		$.fn.placeholder.input = isInputSupported;
		$.fn.placeholder.textarea = isTextareaSupported;
	}

	function args(elem) {
		// Return an object of element attributes
		var newAttrs = {},
		    rinlinejQuery = /^jQuery\d+$/;
		$.each(elem.attributes, function(i, attr) {
			if (attr.specified && !rinlinejQuery.test(attr.name)) {
				newAttrs[attr.name] = attr.value;
			}
		});
		return newAttrs;
	}

	function clearPlaceholder() {
		var $input = $(this);
		if ($input.val() === $input.attr('placeholder') && $input.hasClass('placeholder')) {
			if ($input.data('placeholder-password')) {
				$input.hide().next().attr('id', $input.removeAttr('id').data('placeholder-id')).show().focus();
			} else {
				$input.val('').removeClass('placeholder');
			}
		}
	}

	function setPlaceholder(elem) {
		var $replacement,
		    $input = $(this),
		    $origInput = $input,
		    id = this.id;
		if ($input.val() === '') {
			if ($input.is(':password')) {
				if (!$input.data('placeholder-textinput')) {
					try {
						$replacement = $input.clone().attr({ type: 'text' });
					} catch(e) {
						$replacement = $('<input>').attr($.extend(args(this), { type: 'text' }));
					}
					$replacement
						.removeAttr('name')
						// We could just use the `.data(obj)` syntax here, but that wouldn’t work in pre-1.4.3 jQueries
						.data('placeholder-password', true)
						.data('placeholder-id', id)
						.bind('focus.placeholder', clearPlaceholder);
					$input
						.data('placeholder-textinput', $replacement)
						.data('placeholder-id', id)
						.before($replacement);
				}
				$input = $input.removeAttr('id').hide().prev().attr('id', id).show();
			}
			$input.addClass('placeholder').val($input.attr('placeholder'));
		} else {
			$input.removeClass('placeholder');
		}
	}

	$(function() {
		// Look for forms
		$('form').bind('submit.placeholder', function() {
			// Clear the placeholder values so they don’t get submitted
			var $inputs = $('.placeholder', this).each(clearPlaceholder);
			setTimeout(function() {
				$inputs.each(setPlaceholder);
			}, 10);
		});
	});

	// Clear placeholder values upon page reload
	$(window).bind('unload.placeholder', function() {
		$('.placeholder').val('');
	});


	
	
	
	
	
	
	
	
	/*!
	   * noSelect jQuery Plugin v1.0.2
	   * @link http://mths.be/noselect
	   * @author Mathias Bynens <http://mathiasbynens.be/>
	   */
	   jQuery.fn.noSelect = function() {

	    // Since the string 'none' is used three times, storing it in a variable gives better results after minification
	    var none = 'none';

	    // onselectstart and ondragstart for WebKit & IE
	    // onmousedown for WebKit & Opera
	    return this.bind('selectstart dragstart mousedown', function() {
	     return false;
	    }).css({
	     'MozUserSelect': none,
	     'WebkitUserSelect': none,
	     'userSelect': none
	    });

	   };

	   $(function() {

	    var isDetailsSupported = (function(doc) {
	     var el = doc.createElement('details'),
	         de = doc.documentElement,
	         fake,
	         root = doc.body || (function() {
	          fake = true;
	          return de.insertBefore(doc.createElement('body'), de.firstChildElement || de.firstChild);
	         }()),
	         diff;
	     el.innerHTML = '<summary>a</summary>b';
	     el.style.display = '';
	     root.appendChild(el);
	     diff = el.offsetHeight;
	     el.open = true;
	     diff = diff != el.offsetHeight;
	     root.removeChild(el);
	     if (fake) {
	      root.parentNode.removeChild(root);
	     }
	     return diff;
	    }(document));

	    // Execute the fallback only if there’s no native `details` support
	    if (!isDetailsSupported) {

	     document.documentElement.className += ' no-details';

	     // Loop through all `details` elements
	     $('details').each(function() {

	      // Store a reference to the current `details` element in a variable
	      var $details = $(this),
	          // Store a reference to the `summary` element of the current `details` element (if any) in a variable
	          $detailsSummary = $('summary', $details),
	          // Do the same for the info within the `details` element
	          $detailsNotSummary = $details.children(':not(summary)'),
	          // This will be used later to look for direct child text nodes
	          $detailsNotSummaryContents = $details.contents(':not(summary)'),
	          // This will be used later on
	          open;

	      // If there is no `summary` in the current `details` element…
	      if (!$detailsSummary.length) {
	       // …create one with default text
	       $detailsSummary = $(document.createElement('summary')).text('Details').prependTo($details);
	      }

	      // Look for direct child text nodes
	      if ($detailsNotSummary.length !== $detailsNotSummaryContents.length) {
	       // Wrap child text nodes in a `span` element
	       $detailsNotSummaryContents.filter(function() {
	        // Only keep the node in the collection if it’s a text node containing more than only whitespace
	        return (this.nodeType === 3) && (/[^\t\n\r ]/.test(this.data));
	       }).wrap('<span>');
	       // There are now no direct child text nodes anymore — they’re wrapped in `span` elements
	       $detailsNotSummary = $details.children(':not(summary)');
	      }

	      // Hide content unless there’s an `open` attribute
	      // Chrome 10 already recognizes the `open` attribute as a boolean (even though it doesn’t support rendering `<details>` yet
	      // Other browsers without `<details>` support treat it as a string
	      open = $details.attr('open');
	      if (typeof open == 'string' || (typeof open == 'boolean' && open)) {
	       $details.addClass('open');
	       $detailsNotSummary.show();
	      } else {
	       $detailsNotSummary.hide();
	      }

	      // Set the `tabindex` of the `summary` element to 0 to make it keyboard accessible
	      $detailsSummary.attr('tabIndex', 0).click(function() {
	       // Focus on the `summary` element
	       $detailsSummary.focus();
	       // Toggle the `open` attribute of the `details` element
	       typeof $details.attr('open') !== 'undefined' ? $details.removeAttr('open') : $details.attr('open', 'open');
	       // Toggle the additional information in the `details` element
	       $detailsNotSummary.toggle(0);
	       $details.toggleClass('open');
	      }).keyup(function(event) {
	       if (13 === event.keyCode || 32 === event.keyCode) {
	        // Enter or Space is pressed — trigger the `click` event on the `summary` element
	        // Opera already seems to trigger the `click` event when Enter is pressed
	        if (!($.browser.opera && 13 === event.keyCode)) {
	         event.preventDefault();
	         $detailsSummary.click();
	        }
	       }
	      });

	     });

	    }

	   });	



	   /*! (c) Mat Marquis (@wilto). MIT License. http://wil.to/3a */

	   (function( $, undefined ) {
	   	var inst = 0;
	
	   	$.fn.getPercentage = function() {
	   		var oPercent = this.attr('style').match(/margin\-left:(.*[0-9])/i) && parseInt(RegExp.$1, 10);
		
	   		return oPercent;
	   	};
	
	   	$.fn.adjRounding = function(slide) {
	   		var $el = $(this),
	   			$slides = $el.find( slide ),
	   			diff = $el.parent().width() - $($slides[0]).width();
		
	   		if (diff !== 0) { 
	   			$($slides).css( "position", "relative" );
			
	   			for (var i = 0; i < $slides.length; i++) {
	   				$($slides[i]).css( "left", (diff * i) + "px" );
	   			}
	   		}

	   		return this;
	   	};
	
	   	$.fn.carousel = function(config) {
		
	   		// Prevent re-init:
	   		if( this.data( "carousel-initialized" ) ) { return; }
		
	   		// Carousel is being initialized:
	   		this.data( "carousel-initialized", true );

	   		var defaults = {
	   			slider			: '.slider',
	   			slide			: '.slide',
	   			prevSlide		: null,
	   			nextSlide		: null,
	   			slideHed		: null,
	   			addPagination	: false,
	   			addNav			: ( config != undefined && ( config.prevSlide || config.nextSlide ) ) ? false : true,
	   			namespace		: 'carousel',
	   			speed			: 300
	   		},
	   		opt               = $.extend(defaults, config),
	   		$slidewrap        = this,
	   		dBody            = (document.body || document.documentElement),
	   		transitionSupport = function() {
	   		    dBody.setAttribute('style', 'transition:top 1s ease;-webkit-transition:top 1s ease;-moz-transition:top 1s ease;');
	   			var tSupport = !!(dBody.style.transition || dBody.style.webkitTransition || dBody.style.msTransition || dBody.style.OTransition || dBody.style.MozTransition );
			
	   			return tSupport;
	   		},
	   		carousel = {
	   			init : function() {				
	   				inst++;
								
	   				$slidewrap.each(function(carInt) {
	   						var $wrap      = $(this),
	   							$slider    = $wrap.find(opt.slider),
	   							$slide     = $wrap.find(opt.slide),			
	   							slidenum   = $slide.length,
	   							transition = "margin-left " + ( opt.speed / 1000 ) + "s ease",
	   							tmp        = 'carousel-' + inst + '-' + carInt;

	   						if( $slide.length <= 1 ) {
	   							return; /* No sense running all this code if the carousel functionality is unnecessary. */
	   						}
						
	   						$wrap
	   							.css({
	   								overflow             : "hidden",
	   								width                : "100%"
	   							})
	   							.attr('role' , 'application');
						
	   						$slider
	   							.attr( 'id', ( $slider[0].id || 'carousel-' + inst + '-' + carInt ) )
	   							.css({
	   								"marginLeft"         : "0px",
	   								"float"              : "left",
	   								"width"              : 100 * slidenum + "%",
	   								"-webkit-transition" : transition,
	   								"-moz-transition"    : transition,
	   								"-ms-transition"     : transition,
	   								"-o-transition"      : transition,
	   								"transition"         : transition
	   							})
	   							.bind( 'carouselmove' , carousel.move )
	   							.bind( 'nextprev'     , carousel.nextPrev )
	   							.bind( 'navstate'     , carousel.navState );

	   						$slide
	   							.css({
	   								"float": "left",
	   								width: (100 / slidenum) + "%"				
	   							})
	   							.each(function(i) {
	   								var $el = $(this);

	   								$el.attr({
	   									role : "tabpanel document",
	   									id   : tmp + '-slide' + i
	   								});

	   								if( opt.addPagination ) {
	   									$el.attr('aria-labelledby', tmp + '-tab' + i);
	   								}
	   							});
	
	   						// Build and insert navigation/pagination, if specified in the options:
	   						opt.addPagination   && carousel.addPagination();
	   						opt.addNav 			&& carousel.addNav();
						
	   						$slider.trigger( "navstate", { current: 0 });
	   				});
	   			},
	   			addNav : function() {
	   				$slidewrap.each(function(i) {						
	   					var $oEl = $(this),
	   						$slider = $oEl.find(opt.slider),
	   						currentSlider = $slider[0].id,
	   						navMarkup = [
	   							'<ul class="slidecontrols" role="navigation">',
	   							'	<li role="presentation"><a href="#' + currentSlider + '" class="' + opt.namespace + '-next">Next</a></li>',
	   							'	<li role="presentation"><a href="#' + currentSlider + '" class="' + opt.namespace + '-prev">Prev</a></li>',
	   							'</ul>'
	   							].join(''),
	   						nextprev = {
	   							nextSlide : '.' + opt.namespace + '-next',
	   							prevSlide : '.' + opt.namespace + '-prev'
	   						};

	   					opt = $.extend(opt, nextprev);
					
	   					$oEl.prepend(navMarkup);
	   				});
	   			},
	   			addPagination : function() {
	   				$slidewrap.each(function(i) {
	   					var $oEl        = $(this),
	   						$pagination = $('<ol class="' + opt.namespace + '-tabs" role="tablist navigation" />'),
	   						$slider     = $oEl.find(opt.slider),
	   						$slides     = $oEl.find(opt.slide),
	   						slideNum    = $slides.length,
	   						associated  = 'carousel-' + inst + '-' + i;
						
	   					while( slideNum-- ) {
	   						var hed = $( $slides[ slideNum ] ).find( opt.slideHed ).text() || 'Page ' + ( slideNum + 1 ),
	   							tabMarkup = [
	   								'<li role="presentation">',
	   									'<a href="#' + associated + '-slide' + slideNum +'"',
	   									' aria-controls="' + associated + '-slide' + slideNum +'"',
	   									' id="' + associated + '-tab' + slideNum + '" role="tab">' + hed + '</a>',
	   								'</li>'
	   							].join('');
						
	   						$pagination.prepend(tabMarkup);
	   					};

	   					$pagination
	   						.appendTo( $oEl )
	   						.find('li').keydown( function(e) {
	   							var $el      = $(this),
	   								$prevTab = $el.prev().find('a'),
	   								$nextTab = $el.next().find('a');

	   							switch( e.which ) {
	   								case 37:
	   								case 38:		
	   									$prevTab.length && $prevTab.trigger('click').focus();
	   									e.preventDefault();
	   									break;
	   								case 39: 
	   								case 40:
	   									$nextTab.length && $nextTab.trigger('click').focus();
	   									e.preventDefault();
	   									break;
	   							}
	   						})
	   						.find('a').click( function(e) {
	   							var $el = $(this);
							
	   							if( $el.attr('aria-selected') == 'false' ) { 
	   								var current = $el.parent().index(),
	   									move    = -( 100 * ( current ) ),
	   									$slider = $oEl.find( opt.slider );

	   								$slider.trigger( 'carouselmove', { moveTo: move });
	   							}
	   							e.preventDefault();
	   						});
	   				});
	   			},
	   			roundDown : function(oVal) {
	   				var val = parseInt(oVal, 10);

	   				return Math.ceil( (val - (val % 100 ) ) / 100) * 100;
	   			},
	   			navState : function(e, ui) {
	   				var $el          = $(this),
	   					$slides      = $el.find(opt.slide),
	   					ind          = -(ui.current / 100),
	   					$activeSlide = $($slides[ind]);
								
	   				$el.attr('aria-activedescendant', $activeSlide[0].id);

	   				// Update state of active tabpanel:
	   				$activeSlide
	   					.addClass( opt.namespace + "-active-slide" )
	   					.attr( 'aria-hidden', false )
	   					.siblings()	
	   						.removeClass( opt.namespace + "-active-slide" )
	   						.attr( 'aria-hidden', true );
						
	   				// Update state of next/prev navigation:
	   				if( ( !!opt.prevSlide || !!opt.nextSlide ) ) {
	   					var $target = $('[href*="#' + this.id + '"]');
					
	   					$target.removeClass( opt.namespace + '-disabled' );

	   					if( ind == 0 ) {
	   						$target.filter(opt.prevSlide).addClass( opt.namespace + '-disabled' );
	   					} else if( ind == $slides.length - 1 ) {
	   						$target.filter(opt.nextSlide).addClass( opt.namespace + '-disabled' );
	   					}
	   				}
								
	   				// Update state of pagination tabs:
	   				if( !!opt.addPagination ) {
	   					var tabId = $activeSlide.attr('aria-labelledby'),
	   						$tab  = $('#' + tabId );
					
	   					$tab
	   						.parent()
	   						.addClass(opt.namespace + '-active-tab')
	   						.siblings()
	   						.removeClass(opt.namespace + '-active-tab')
	   						.find('a')
	   							.attr({
	   								'aria-selected' : false,
	   								'tabindex' : -1
	   							});
							
	   					$tab.attr({
	   						'aria-selected' : true,
	   						'tabindex' : 0
	   					});
	   				}
	   			},
	   			move : function(e, ui) {
	   				var $el = $(this);

	   				$el
	   					.trigger(opt.namespace + "-beforemove")
	   					.trigger("navstate", { current: ui.moveTo });
				
	   				if( transitionSupport() ) {

	   					$el
	   						.adjRounding( opt.slide ) /* Accounts for browser rounding errors. Lookin’ at you, iOS Safari. */
	   						.css('marginLeft', ui.moveTo + "%")
	   						.one("transitionend webkitTransitionEnd OTransitionEnd", function() {
	   							$(this).trigger( opt.namespace + "-aftermove" );
	   						});
						
	   				} else {					
	   					$el
	   						.adjRounding( opt.slide )
	   						.animate({ marginLeft: ui.moveTo + "%" }, { duration : opt.speed, queue : false }, function() {
	   							$(this).trigger( opt.namespace + "-aftermove" );
	   						});
	   				}
	   			},
	   			nextPrev : function(e, ui) {				
	   				var $el = $(this),
	   					left = ( $el ) ? $el.getPercentage() : 0,
	   					$slide = $el.find(opt.slide),
	   					constrain = ui.dir === 'prev' ? left != 0 : -left < ($slide.length - 1) * 100,
	   					$target = $( '[href="#' + this.id + '"]');

	   				if (!$el.is(":animated") && constrain ) {

	   					if ( ui.dir === 'prev' ) {
	   						left = ( left % 100 != 0 ) ? carousel.roundDown(left) : left + 100;
	   					} else {
	   						left = ( ( left % 100 ) != 0 ) ? carousel.roundDown(left) - 100 : left - 100;
	   					}

	   					$el.trigger('carouselmove', { moveTo: left });

	   					$target
	   						.removeClass( opt.namespace + '-disabled')
	   						.removeAttr('aria-disabled');

	   					switch( left ) {
	   						case ( -($slide.length - 1) * 100 ):
	   							$target.filter(opt.nextSlide)
	   								.addClass( opt.namespace + '-disabled')
	   								.attr('aria-disabled', true);
	   							break;
	   						case 0:
	   							$target.filter(opt.prevSlide)
	   								.addClass( opt.namespace + '-disabled')
	   								.attr('aria-disabled', true);
	   							break;
	   					}
	   				} else {
	   					var reset = carousel.roundDown(left);

	   					$el.trigger('carouselmove', { moveTo: reset });
	   				}

	   			}
	   		};
	
	   		carousel.init(this);

	   		$(opt.nextSlide + ',' + opt.prevSlide)
	   			.bind('click', function(e) {
	   				var $el = $(this),
	   					link = this.hash,
	   					dir = ( $el.is(opt.prevSlide) ) ? 'prev' : 'next',
	   					$slider = $(link);

	   					if ( $el.is('.' + opt.namespace + '-disabled') ) { 
	   						return false;
	   					}

	   					$slider.trigger('nextprev', { dir: dir });
				
	   				e.preventDefault();
	   			})
	   			.bind('keydown', function(e) {
	   				var $el = $(this),
	   					link = this.hash;

	   				switch (e.which) {
	   					case 37:
	   					case 38:
	   						$('#' + link).trigger('nextprev', { dir: 'next' });
	   						e.preventDefault();
	   						break;
	   					case 39:
	   					case 40:
	   						$('#' + link).trigger('nextprev', { dir: 'prev' });
	   						e.preventDefault();
	   						break;
	   				}
	   			});

	   		var setup = {
	   			wrap : this,
	   			slider : opt.slider
	   		};
	   		$slidewrap.bind( "dragSnap", setup, function(e, ui){
	   			var $slider = $(this).find( opt.slider ),
	   				dir = ( ui.direction === "left" ) ? 'next' : 'prev';
			
	   			$slider.trigger("nextprev", { dir: dir });	
	   		});


	   		$slidewrap.filter('[data-autorotate]').each(function() {
	   			var auto,
	   				$el         = $(this),
	   				speed       = $el.attr('data-autorotate'),
	   				slidenum    = $el.find(opt.slide).length,
	   				autoAdvance = function() {
	   					var $slider  = $el.find(opt.slider),
	   						active   = -( $(opt.slider).getPercentage() / 100 ) + 1;

	   					switch( active ) {
	   						case slidenum: 
	   							clearInterval(auto);

	   							auto = setInterval(function() {
	   								autoAdvance();
	   								$slider.trigger("nextprev", { dir: 'prev' });	
	   							}, speed);

	   							break;
	   						case 1:
	   							clearInterval(auto);

	   							auto = setInterval(function() {
	   								autoAdvance();								
	   								$slider.trigger("nextprev", { dir: 'next' });	
	   							}, speed);

	   							break;
	   					}
	   				};

	   			auto = setInterval(autoAdvance, speed);

	   			$el
	   				.attr('aria-live', 'polite')
	   				.bind('mouseenter click touchstart', function() {
	   					clearInterval(auto);
	   				});
	   		});

	   		return this;
	   	};
	
	   	$.event.special.dragSnap = {
	   		setup: function(setup) {

	   			var $el = $(this),
	   				transitionSwap = function($el, tog) {
	   					var speed = 0.3,
	   						transition = ( tog ) ? "margin-left " + speed + "s ease" : 'none';

	   					$el.css({
	   						"-webkit-transition" : transition,
	   						"-moz-transition"    : transition,
	   						"-ms-transition"     : transition,
	   						"-o-transition"      : transition,
	   						"transition"         : transition
	   					});
	   				},
	   				roundDown = function(left) {
	   					left = parseInt(left, 10);
	   					return Math.ceil( (left - (left % 100 ) ) / 100) * 100;
	   				},
	   				snapBack = function(e, ui) {
	   					var $el = ui.target,
	   						currentPos = ( $el.attr('style') != undefined ) ? $el.getPercentage() : 0,
	   						left = (ui.left === false) ? roundDown(currentPos) - 100 : roundDown(currentPos),
	   						dStyle = document.body.style,
	   						transitionSupport = function() {
	   						    dBody.setAttribute('style', 'transition:top 1s ease;-webkit-transition:top 1s ease;-moz-transition:top 1s ease;');
	   							var tSupport = !!(dBody.style.transition || dBody.style.webkitTransition || dBody.style.MozTransition );

	   							return tSupport;
	   						};

	   					transitionSwap($el, true);

	   					if( transitionSupport() ) {
	   						$el.css('marginLeft', left + "%");
	   					} else {
	   						$el.animate({ marginLeft: left + "%" }, opt.speed);
	   					}
	   				};

	   			$el
	   				.bind("snapback", snapBack)
	   				.bind("touchstart", function(e) {
	   					var data = e.originalEvent.touches ? e.originalEvent.touches[0] : e,
	   						start = {
	   							time: (new Date).getTime(),
	   							coords: [ data.pageX, data.pageY ],
	   							origin: $(e.target).closest( setup.wrap )
	   						},
	   						stop,
	   						$tEl = $(e.target).closest( setup.slider ),
	   						currentPos = ( $tEl.attr('style') != undefined ) ? $tEl.getPercentage() : 0;

	   					transitionSwap($tEl, false);

	   					function moveHandler(e) {
	   						var data = e.originalEvent.touches ? e.originalEvent.touches[0] : e;
	   						stop = {
	   								time: (new Date).getTime(),
	   								coords: [ data.pageX, data.pageY ]
	   						};

	   						if(!start || Math.abs(start.coords[0] - stop.coords[0]) < Math.abs(start.coords[1] - stop.coords[1]) ) {
	   							return;
	   						}

	   						$tEl.css({"margin-left": currentPos + ( ( (stop.coords[0] - start.coords[0]) / start.origin.width() ) * 100 ) + '%' });						

	   						// prevent scrolling
	   						if (Math.abs(start.coords[0] - stop.coords[0]) > 10) {
	   							e.preventDefault();
	   						}

	   					};

	   					$el
	   						.bind("gesturestart", function(e) {
	   							$el
	   								.unbind("touchmove", moveHandler)
	   								.unbind("touchend", moveHandler);
	   						})
	   						.bind("touchmove", moveHandler)
	   						.one("touchend", function(e) {

	   							$el.unbind("touchmove", moveHandler);

	   							transitionSwap($tEl, true);

	   							if (start && stop ) {

	   								if (Math.abs(start.coords[0] - stop.coords[0]) > 10
	   									&& Math.abs(start.coords[0] - stop.coords[0]) > Math.abs(start.coords[1] - stop.coords[1])) {
	   									e.preventDefault();
	   								} else {
	   									$el.trigger('snapback', { target: $tEl, left: true });
	   									return;
	   								}

	   								if (Math.abs(start.coords[0] - stop.coords[0]) > 1 && Math.abs(start.coords[1] - stop.coords[1]) < 75) {
	   									var left = start.coords[0] > stop.coords[0];

	   								if( -( stop.coords[0] - start.coords[0]) > ( start.origin.width() / 4 ) || ( stop.coords[0] - start.coords[0]) > ( start.origin.width() / 4 ) ) {

	   									start.origin.trigger("dragSnap", {direction: left ? "left" : "right"});

	   									} else {								
	   										$el.trigger('snapback', { target: $tEl, left: left });
	   									}

	   								}
	   							}
	   							start = stop = undefined;
	   						});
	   				});
	   		}
	   	};
	   })(jQuery);



/*
	jQuery zAccordion Plugin
	Copyright 2010 - 2011 - Nate Armagost - http://www.armagost.com/zaccordion
	Version 1.1.2
	Licensed under the MIT and GPL licenses
*/
(function($){
	$.fn.extend({ 
		zAccordion: function(options) {
			/* Default Options */
			var defaults = {
				timeout: 6000, /* Time between each slide (in ms) */
				width: 960, /* Width of the container (in px) */
				height: 340, /* Height of the container (in px) */
				slideWidth: 660, /* Width of each slide (in px) */
				slideHeight: 340, /* Height of each slide (in px) */
				tabWidth: 100, /* Width of each slide's "tab" (when clicked it opens the slide) */
				startingSlide: 0, /* Zero-based index of which slide should be displayed */
				slideClass: "slide", /* Class of each slide */
				slideOpenClass: "slide-open", /* Class of open slides */
				slideClosedClass: "slide-closed", /* Class of closed slides */
				slidePreviousClass: "slide-previous", /* Class of the slide that was previously open before a new one was triggered */
				easing: null, /* Easing method */
				speed: 1200, /* Speed of the slide transition (in ms) */
				open: function() {}, /* Callback function for opening slide */
				close: function() {}, /* Callback function for closing slides */
				auto: true, /* Whether or not the slideshow should play automatically */
				trigger: "click", /* Event type that will bind to the "tab" (click, mouseover, etc.) */
				pause: true, /* Pause on hover */
				click: function() {}, /* Function called on click */
				invert: false, /* Whether or not to invert the slideshow, so the last slide stays in the same position, rather than the first slide */
				afterBuild: function() {} /* Function called after the accordion is finished building */
			};
			/* Measuring the height */
			if ((options.height == undefined) && (options.slideHeight == undefined)) {
				options.height = defaults.height;
				options.slideHeight = defaults.slideHeight;
			}
			else if ((options.height != undefined) && (options.slideHeight == undefined)) {
				options.slideHeight = options.height;
			}
			else if ((options.height == undefined) && (options.slideHeight != undefined)) {
				options.height = options.slideHeight;
			}
			/* Measure the width - this gets a bit tricky */
			/* Nothing is defined */
			if ((options.width == undefined) && (options.slideWidth == undefined) && (options.tabWidth == undefined)) {
				options.width = defaults.width;
				options.tabWidth = defaults.tabWidth;
				options.slideWidth = defaults.slideWidth;
			}
			/* One of three is defined */
			else if ((options.width != undefined) && (options.slideWidth == undefined) && (options.tabWidth == undefined)) {
				options.tabWidth = 100;
				options.slideWidth = options.width - ((this.children().size() - 1) * options.tabWidth);
			}
			else if ((options.width == undefined) && (options.slideWidth != undefined) && (options.tabWidth == undefined)) {
				options.width = defaults.width;
				options.tabWidth = (defaults.width - options.slideWidth) / (this.children().size() - 1);
			}
			else if ((options.width == undefined) && (options.slideWidth == undefined) && (options.tabWidth != undefined)) {
				options.width = defaults.width;
				options.slideWidth  = options.width - ((this.children().size() - 1) * options.tabWidth);
			}
			/* Two of three are defined */
			else if ((options.width != undefined) && (options.slideWidth != undefined) && (options.tabWidth == undefined)) {
				options.tabWidth = (options.width - options.slideWidth) / (this.children().size() - 1);
			}
			else if ((options.width != undefined) && (options.slideWidth == undefined) && (options.tabWidth != undefined)) {
				options.slideWidth = options.width - ((this.children().size() - 1) * options.tabWidth);
			}
			else if ((options.width == undefined) && (options.slideWidth != undefined) && (options.tabWidth != undefined)) {
				options.width = ((this.children().size() - 1) * options.tabWidth) + options.slideWidth;
			}
			defaults.animate = options.slideWidth - options.tabWidth; /* Number of pixels yet do be displayed on a hidden slide */
			var interval = null;
			defaults.inside = false; /* Determines whether or not the mouse is inside the container.  Container should pause on hover if needed. */
			defaults.current = defaults.startingSlide;
			var options = $.extend(defaults, options);
			this.click = function(num) {
				clearTimeout(interval);
				num++;
				if ((num > $(this).children().size()) || (num < 1)) {
					num = 1;
				}
				$(this).children($(this).children().get(0).tagName + ":nth-child(" + num + ")").trigger(defaults.trigger);
			};
			this.stop = function() { /* This will stop the accordion unless the slides are clicked, however, it will not resume the autoplay */
				clearTimeout(interval);
				defaults.auto = false;
			};
			this.start = function() { /* This will start the accordion back up if it has been stopped */
				clearTimeout(interval);
				defaults.auto = true;
				var s = $(this).children().get(0).tagName + "." + defaults.slideOpenClass;
				this.click($(this).children(s).index() + 1);
			};
			return this.each(function() {
				var o = options;
				var obj = $(this);
				var x; /* Used to set up each slide's position */
				var i = 10000; /* Setting up layers if inverted */
				/* Count the number of slides */
				var originals = [];
				/* Loop through each of the slides */
				obj.children().each(function(index) {
					var z; /* Used to set the z-index of a slide */
					if (!o.invert) {
						x = index * o.tabWidth; /* Used for the position of each slide */
					} else {
						x = ((obj.children().size() - 1) * o.tabWidth) - (index * o.tabWidth);
					}
					originals[index] = x;
					if (!o.invert) {
						z = index * 10; /* Increase each slide's z-index by 10 so they sit on top of each other */
					} else {
						z = ((obj.children().size() - 1) - index) * 10;
					}
					$(this).addClass(o.slideClass); /* Add the slide class to each of the slides */
					$(this).css({
						"top": 0,
						"z-index": z,
						"margin": 0,
						"padding": 0,
						"float": "left",
						"display": "block",
						"position": "absolute",
						"overflow": "hidden",
						"width": o.slideWidth + "px",
						"height": o.slideHeight + "px"
					});
					if (!o.invert) {
						$(this).css({
							"left": x + "px",
							"float": "left"
						});
					} else {
						$(this).css({
							"right": x + "px",
							"float": "right"
						});
					}
					if (index == (o.startingSlide)) {
						$(this).addClass(o.slideOpenClass).css("cursor", "default");
					}
					else {
						$(this).addClass(o.slideClosedClass).css("cursor", "pointer");
						if ((index > (o.startingSlide)) && (!o.invert)) {
							var y = index + 1;
							obj.children(obj.children().get(0).tagName + ":nth-child(" + y + ")").css({
								left: originals[y-1] + o.animate + "px"
							});
						} else if ((index < (o.startingSlide)) && (o.invert)) {
							var y = index + 1;
							obj.children(obj.children().get(0).tagName + ":nth-child(" + y + ")").css({
								right: originals[y-1] + o.animate + "px"
							});
						}
					}
				});
				/* Modify the CSS of the main container */
				obj.css({
					"display": "block",
					"height": o.height + "px",
					"overflow": "hidden",
					"width": o.width + "px",
					"padding": 0,
					"position": "relative",
					"overflow": "hidden"
				});
				/* If the container is a list, get rid of any bullets */
				if ((obj.get(0).tagName == "UL") || (obj.get(0).tagName == "OL")) {
					obj.css({
						"list-style": "none"
					});
				}
				obj.hover(function () {
					o.inside = true;
					try{
						clearTimeout(interval);
					} catch(e){}
				},
				/* Restart the accordion when user moves mouse out of the slides */
				function () {
					o.inside = false;
					try{
						clearTimeout(interval);
					} catch(e){}
					if (o.auto) {
						interval = setTimeout(function(){
							o.current = obj.children(obj.children().get(0).tagName + "." + o.slideOpenClass).index() + 1;
							var next = o.current + 1;
							if (next > originals.length) {
								next = 1;
							}
							obj.children(obj.children().get(0).tagName + ":nth-child(" + next + ")").trigger(o.trigger);
						}, o.timeout );
					}
				});
				/* Set up the listener to change slides when triggered */
				obj.children(obj.children().get(0).tagName + "." + o.slideClass).bind(o.trigger, function() {
					/* Don't do anything if the slide is already open */
					if (!($(this).hasClass(o.slideOpenClass))) {
						/* If the slide is not open... */
						try{
							clearTimeout(interval);
						} catch(e){}
						if (!o.inside && o.auto) {
							interval = setTimeout(function(){
								o.current = obj.children(obj.children().get(0).tagName + "." + o.slideOpenClass).index() + 1;
								var next = o.current + 1;
								if (next > originals.length) {
									next = 1;
								}
								obj.children(obj.children().get(0).tagName + ":nth-child(" + next + ")").trigger(o.trigger);
							}, o.timeout );
						}
						obj.children(obj.children().get(0).tagName + "." + o.slidePreviousClass).removeClass(o.slidePreviousClass);
						obj.children(obj.children().get(0).tagName + "." + o.slideOpenClass).addClass(o.slidePreviousClass);
						obj.children(obj.children().get(0).tagName + "." + o.slideClass).addClass(o.slideClosedClass).removeClass(o.slideOpenClass).css("cursor", "pointer"); /* Remove the open class from all the slide tabs */
						$(this).addClass(o.slideOpenClass).removeClass(o.slideClosedClass).css("cursor", "default"); /* Add the open class to the slide tab that was just triggered */
						var index = $(this).index() + 1; /* The index refers to the actual slide number that was triggered (no zeros) */
						if (o.click != null) {
							o.click();
						}
						if (!o.invert) {
							obj.children(obj.children().get(0).tagName + ":nth-child(" + index + ")").stop().animate(
								{ left: originals[index-1] + "px" }, o.speed, o.easing, o.open);
						} else {
							obj.children(obj.children().get(0).tagName + ":nth-child(" + index + ")").stop().animate(
								{ right: originals[index-1] + "px" }, o.speed, o.easing, o.open);
						}
						/* Closing other slides */
						for (var i = 1;i <= originals.length;i++) {
							if (i < index) {
								if (!o.invert) {
									obj.children(obj.children().get(0).tagName + ":nth-child(" + i + ")").stop().animate(
										{ left: originals[i-1] + "px" }, o.speed, o.easing, o.close);
								} else {
									obj.children(obj.children().get(0).tagName + ":nth-child(" + i + ")").stop().animate(
										{ right: o.width - (i * o.tabWidth) + "px" }, o.speed, o.easing, o.close);
								}
							}
							if (i > index) {
								if (!o.invert) {
									obj.children(obj.children().get(0).tagName + ":nth-child(" + i + ")").stop().animate(
										{ left: originals[i-1] + o.animate + "px" }, o.speed, o.easing, o.close);
								} else {
									obj.children(obj.children().get(0).tagName + ":nth-child(" + i + ")").stop().animate(
										{ right: (originals.length - i) * o.tabWidth + "px" }, o.speed, o.easing, o.close);
								}
							}
						}
						return false; /* This is important. If a visible link is clicked within the slide, it will open the slide instead of redirecting the link */
					}
				});
				/* Set up the original timer */
				if (o.auto) {
					interval = setTimeout(function(){
						o.current = obj.children(obj.children().get(0).tagName + "." + o.slideOpenClass).index() + 1;
						var next = o.current + 1;
						if (next > originals.length) {
							next = 1;
						}
						obj.children(obj.children().get(0).tagName + ":nth-child(" + next + ")").trigger(o.trigger);
					}, o.timeout );
				}
				o.afterBuild();
			});
		}
	});
})(jQuery);

/*
* $ lightbox_me
* By: Buck Wilson
* Version : 2.3
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
*     http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/


(function($) {

    $.fn.lightbox_me = function(options) {

        return this.each(function() {

            var
                opts = $.extend({}, $.fn.lightbox_me.defaults, options),
                $overlay = $(),
                $self = $(this),
                $iframe = $('<iframe id="foo" style="z-index: ' + (opts.zIndex + 1) + ';border: none; margin: 0; padding: 0; position: absolute; width: 100%; height: 100%; top: 0; left: 0; filter: mask();"/>'),
                ie6 = ($.browser.msie && $.browser.version < 7);

            if (opts.showOverlay) {
                //check if there's an existing overlay, if so, make subequent ones clear
               var $currentOverlays = $(".js_lb_overlay:visible");
                if ($currentOverlays.length > 0){
                    $overlay = $('<div class="lb_overlay_clear js_lb_overlay"/>');
                } else {
                    $overlay = $('<div class="' + opts.classPrefix + '_overlay js_lb_overlay"/>');
                }
            }

            /*----------------------------------------------------
               DOM Building
            ---------------------------------------------------- */
            if (ie6) {
                var src = /^https/i.test(window.location.href || '') ? 'javascript:false' : 'about:blank';
                $iframe.attr('src', src);
                $('body').append($iframe);
            } // iframe shim for ie6, to hide select elements
            $('body').append($self.hide()).append($overlay);


            /*----------------------------------------------------
               Overlay CSS stuffs
            ---------------------------------------------------- */

            // set css of the overlay
            if (opts.showOverlay) {
                setOverlayHeight(); // pulled this into a function because it is called on window resize.
                $overlay.css({ position: 'absolute', width: '100%', top: 0, left: 0, right: 0, bottom: 0, zIndex: (opts.zIndex + 2), display: 'none' });
				if (!$overlay.hasClass('lb_overlay_clear')){
                	$overlay.css(opts.overlayCSS);
                }
            }

            /*----------------------------------------------------
               Animate it in.
            ---------------------------------------------------- */
               //
            if (opts.showOverlay) {
                $overlay.fadeIn(opts.overlaySpeed, function() {
                    setSelfPosition();
                    $self[opts.appearEffect](opts.lightboxSpeed, function() { setOverlayHeight(); setSelfPosition(); opts.onLoad()});
                });
            } else {
                setSelfPosition();
                $self[opts.appearEffect](opts.lightboxSpeed, function() { opts.onLoad()});
            }

            /*----------------------------------------------------
               Hide parent if parent specified (parentLightbox should be jquery reference to any parent lightbox)
            ---------------------------------------------------- */
            if (opts.parentLightbox) {
                opts.parentLightbox.fadeOut(200);
            }


            /*----------------------------------------------------
               Bind Events
            ---------------------------------------------------- */

            $(window).resize(setOverlayHeight)
                     .resize(setSelfPosition)
                     .scroll(setSelfPosition)
                     .keyup(observeKeyPress);
            if (opts.closeClick) {
                $overlay.click(function(e) { closeLightbox(); e.preventDefault; });
            }
            $self.delegate(opts.closeSelector, "click", function(e) {
                closeLightbox(); e.preventDefault();
            });
            $self.bind('close', closeLightbox);
            $self.bind('reposition', setSelfPosition);

            

            /*--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
              -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- */


            /*----------------------------------------------------
               Private Functions
            ---------------------------------------------------- */

            /* Remove or hide all elements */
            function closeLightbox() {
                var s = $self[0].style;
                if (opts.destroyOnClose) {
                    $self.add($overlay).remove();
                } else {
                    $self.add($overlay).hide();
                }

                //show the hidden parent lightbox
                if (opts.parentLightbox) {
                    opts.parentLightbox.fadeIn(200);
                }

                $iframe.remove();
                
				// clean up events.
                $self.undelegate(opts.closeSelector, "click");

                $(window).unbind('reposition', setOverlayHeight);
                $(window).unbind('reposition', setSelfPosition);
                $(window).unbind('scroll', setSelfPosition);
                $(document).unbind('keyup', observeKeyPress);
                if (ie6)
                    s.removeExpression('top');
                opts.onClose();
            }


            /* Function to bind to the window to observe the escape/enter key press */
            function observeKeyPress(e) {
                if((e.keyCode == 27 || (e.DOM_VK_ESCAPE == 27 && e.which==0)) && opts.closeEsc) closeLightbox();
            }


            /* Set the height of the overlay
                    : if the document height is taller than the window, then set the overlay height to the document height.
                    : otherwise, just set overlay height: 100%
            */
            function setOverlayHeight() {
                if ($(window).height() < $(document).height()) {
                    $overlay.css({height: $(document).height() + 'px'});
                     $iframe.css({height: $(document).height() + 'px'}); 
                } else {
                    $overlay.css({height: '100%'});
                    if (ie6) {
                        $('html,body').css('height','100%');
                        $iframe.css('height', '100%');
                    } // ie6 hack for height: 100%; TODO: handle this in IE7
                }
            }


            /* Set the position of the modal'd window ($self)
                    : if $self is taller than the window, then make it absolutely positioned
                    : otherwise fixed
            */
            function setSelfPosition() {
                var s = $self[0].style;

                // reset CSS so width is re-calculated for margin-left CSS
                $self.css({left: '50%', marginLeft: ($self.outerWidth() / 2) * -1,  zIndex: (opts.zIndex + 3) });


                /* we have to get a little fancy when dealing with height, because lightbox_me
                    is just so fancy.
                 */

                // if the height of $self is bigger than the window and self isn't already position absolute
                if (($self.height() + 80  >= $(window).height()) && ($self.css('position') != 'absolute' || ie6)) {

                    // we are going to make it positioned where the user can see it, but they can still scroll
                    // so the top offset is based on the user's scroll position.
                    var topOffset = $(document).scrollTop() + 40;
                    $self.css({position: 'absolute', top: topOffset + 'px', marginTop: 0})
                    if (ie6) {
                        s.removeExpression('top');
                    }
                } else if ($self.height()+ 80  < $(window).height()) {
                    //if the height is less than the window height, then we're gonna make this thing position: fixed.
                    // in ie6 we're gonna fake it.
                    if (ie6) {
                        s.position = 'absolute';
                        if (opts.centered) {
                            s.setExpression('top', '(document.documentElement.clientHeight || document.body.clientHeight) / 2 - (this.offsetHeight / 2) + (blah = document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop) + "px"')
                            s.marginTop = 0;
                        } else {
                            var top = (opts.modalCSS && opts.modalCSS.top) ? parseInt(opts.modalCSS.top) : 0;
                            s.setExpression('top', '((blah = document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop) + '+top+') + "px"')
                        }
                    } else {
                        if (opts.centered) {
                            $self.css({ position: 'fixed', top: '50%', marginTop: ($self.outerHeight() / 2) * -1})
                        } else {
                            $self.css({ position: 'fixed'}).css(opts.modalCSS);
                        }

                    }
                }
            }

        });



    };

    $.fn.lightbox_me.defaults = {

        // animation
        appearEffect: "fadeIn",
        appearEase: "",
        overlaySpeed: 250,
        lightboxSpeed: 300,

        // close
        closeSelector: ".close",
        closeClick: true,
        closeEsc: true,

        // behavior
        destroyOnClose: false,
        showOverlay: true,
        parentLightbox: false,

        // callbacks
        onLoad: function() {},
        onClose: function() {},

        // style
        classPrefix: 'lb',
        zIndex: 999,
        centered: false,
        modalCSS: {top: '40px'},
        overlayCSS: {background: 'black', opacity: .3}
    }
})(jQuery);








/*------------------------------------------------------------------------------
Function:		TabInterface()
Author:			Aaron Gustafson (aaron at easy-designs dot net)
Creation Date:	7 December 2006
Version:		1.3
Homepage:		http://github.com/easy-designs/TabInterface.js
License:		MIT License (see MIT-LICENSE)
------------------------------------------------------------------------------*/
	function TabInterface(c,d){this.Version="1.3";var j=false,i=document.createElement("ul"),g={section:document.createElement("section"),li:document.createElement("li")};function e(){var x,r,s,p=["header","h1","h2","h3","h4","h5","h6"],t,v,q,w,u,n,o,y;x=c.getAttribute("id")||"folder-"+d;if(!c.getAttribute("id")){c.setAttribute("id",x)}c.setAttribute("role","application");i.setAttribute("role","tablist");g.section.setAttribute("role","tabpanel");g.section.setAttribute("aria-hidden","true");g.section.setAttribute("tabindex","-1");g.li.setAttribute("role","tab");g.li.setAttribute("aria-selected","false");g.li.setAttribute("tabindex","-1");r=c.firstChild;while(r){s=r.nextSibling;if(r.nodeType==3&&!(/\S/).test(r.nodeValue)){c.removeChild(r)}r=s}for(t=0,v=p.length;t<v;t++){if(c.firstChild.nodeName.toLowerCase()==p[t]){q=p[t];break}}h(c,"tabbed-on");f(c,"tabbed");w=new RegExp("<("+q+")","ig");u=c.innerHTML.replace(w,"||||<$1").split("||||");u.shift();c.innerHTML="";h(i,"index");c.appendChild(i);for(t=0,v=u.length;t<v;t++){n=g.section.cloneNode(true);h(n,"folder");n.setAttribute("id",x+"-"+t);n.setAttribute("aria-labelledby",x+"-"+t+"-tab");n.innerHTML=u[t];c.appendChild(n);o=g.li.cloneNode(true);o.setAttribute("id",x+"-"+t+"-tab");o.setAttribute("aria-controls",x+"-"+t);o.setAttribute("aria-describedby",x+"-"+t);o.onclick=b;o.onkeydown=m;o.onfocus=b;y=n.getElementsByTagName(q)[0];if(y.getAttribute("title")){o.innerHTML=y.getAttribute("title")}else{o.innerHTML=y.innerHTML;h(y,"hidden")}i.appendChild(o);if(t===0){h(n,"visible");n.setAttribute("aria-hidden","false");o.setAttribute("aria-selected","true");o.setAttribute("tabindex","0");j=n.getAttribute("id");c.setAttribute("aria-activedescendant",j);h(o,"active")}}}function b(q){q=(q)?q:event;var p=q.target||q.srcElement,o=document.getElementById(j),n=document.getElementById(j+"-tab"),r;p=k(p);r=document.getElementById(p.getAttribute("id").replace("-tab",""));f(n,"active");n.setAttribute("aria-selected","false");n.setAttribute("tabindex","-1");f(o,"visible");o.setAttribute("aria-hidden","true");h(p,"active");p.setAttribute("aria-selected","true");p.setAttribute("tabindex","0");h(r,"visible");r.setAttribute("aria-hidden","false");j=r.getAttribute("id");c.setAttribute("aria-activedescendant",j)}function h(o,p){var n=(!o.className)?[]:o.className.split(" ");n.push(p);o.className=n.join(" ")}function f(p,q){var o=p.className.split(" ");for(var n=o.length-1;n>=0;n--){if(o[n]==q){o.splice(n,1)}}p.className=o.join(" ")}function k(n){while(n.nodeName.toLowerCase()!="li"){n=n.parentNode}return n}function m(q){q=(q)?q:event;var o=q.target||q.srcElement,n=q.keyCode||q.charCode,p=true;o=k(o);switch(n){case 13:document.getElementById(j).focus();p=false;break;case 37:case 38:a(o,"previous",false);p=false;break;case 39:case 40:a(o,"next",false);p=false;break;case 36:a(o,"previous",true);p=false;break;case 35:a(o,"next",true);p=false;break;case 27:o.blur();p=false;break}if(!p){return l(q)}}function a(o,q,n){if(n){if(q=="previous"){o.parentNode.childNodes[0].focus()}else{o.parentNode.childNodes[o.parentNode.childNodes.length-1].focus()}}else{var p=q=="previous"?o.previousSibling:o.nextSibling;if(p){p.focus()}else{if(q=="next"){o.parentNode.childNodes[0].focus()}else{o.parentNode.childNodes[o.parentNode.childNodes.length-1].focus()}}}}function l(n){if(typeof n.stopPropagation=="function"){n.stopPropagation()}else{if(typeof n.cancelBubble!="undefined"){n.cancelBubble=true}}if(n.preventDefault){n.preventDefault()}return false}e()};
}(jQuery));
