﻿/*!
 * jQuery imagesLoaded plugin v1.2.4
 * http://github.com/desandro/imagesloaded
 *
 * MIT License. by Paul Irish et al.
 */
;(function($, undefined) {

// blank image data-uri
var BLANK = 'data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///ywAAAAAAQABAAACAUwAOw==';

// $('#my-container').imagesLoaded(myFunction)
// or
// $('img').imagesLoaded(myFunction)

// execute a callback when all images have loaded.
// needed because .load() doesn't work on cached images

// callback is executed when all images has fineshed loading
// callback function arguments: $all_images, $proper_images, $broken_images
// `this` is the jQuery wrapped container

// returns previous jQuery wrapped container extended with deferred object
// done method arguments: .done( function( $all_images ){ ... } )
// fail method arguments: .fail( function( $all_images, $proper_images, $broken_images ){ ... } )
// progress method arguments: .progress( function( images_count, loaded_count, proper_count, broken_count )

$.fn.imagesLoaded = function( callback ) {
	var $this = this,
		deferred = $.isFunction($.Deferred) ? $.Deferred() : 0,
		hasNotify = $.isFunction(deferred.notify),
		$images = $this.find('img').add( $this.filter('img') ),
		len = $images.length,
		loaded = [],
		proper = [],
		broken = [];

	function doneLoading() {
		var $proper = $(proper),
			$broken = $(broken);

		if ( deferred ) {
			if ( broken.length ) {
				deferred.reject( $images, $proper, $broken );
			} else {
				deferred.resolve( $images );
			}
		}

		if ( $.isFunction( callback ) ) {
			callback.call( $this, $images, $proper, $broken );
		}
	}

	function imgLoaded( event ) {
		var img = event.target;

		// dont proceed if img src is blank or if img is already loaded
		if ( img.src === BLANK || $.inArray( img, loaded ) !== -1 ) {
			return;
		}

		// store element in loaded images array
		loaded.push( img );

		// keep track of broken and properly loaded images
		if ( event.type === 'error' ) {
			broken.push( img );
		} else {
			proper.push( img );
		}

		// cache event type in element data for future calls
		$.data( img, 'imagesLoaded', { event: event.type, src: img.src } );

		if ( hasNotify ) {
			deferred.notify( $images.length, loaded.length, proper.length, broken.length );
		}

		if ( --len <= 0 ){
			setTimeout( doneLoading );
			$images.unbind( '.imagesLoaded', imgLoaded );
		}
	}

	// if no images, trigger immediately
	if ( !len ) {
		doneLoading();
	}

	$images.bind( 'load.imagesLoaded error.imagesLoaded', imgLoaded ).each( function() {
		var src = this.src;
		// find out if this image has been already checked for status
		var cached = $.data( this, 'imagesLoaded' );
		// if it was, and src has not changed, trigger the corresponding event
		if ( cached && cached.src === src ) {
			$(this).triggerHandler( cached.event );
			return;
		}
		// cached images don't fire load sometimes, so we reset src.
		// webkit hack from http://groups.google.com/group/jquery-dev/browse_thread/thread/eee6ab7b2da50e1f
		// data uri bypasses webkit log warning (thx doug jones)
		this.src = BLANK;
		this.src = src;
	});

	return deferred ? deferred.promise( $this ) : $this;
};

})(jQuery);



/**
 * jQuery Masonry v2.1.02
 * A dynamic layout plugin for jQuery
 * The flip-side of CSS Floats
 * http://masonry.desandro.com
 *
 * Licensed under the MIT license.
 * Copyright 2011 David DeSandro
 */
(function(a,b,c){var d=b.event,e;d.special.smartresize={setup:function(){b(this).bind("resize",d.special.smartresize.handler)},teardown:function(){b(this).unbind("resize",d.special.smartresize.handler)},handler:function(a,b){var c=this,d=arguments;a.type="smartresize",e&&clearTimeout(e),e=setTimeout(function(){jQuery.event.handle.apply(c,d)},b==="execAsap"?0:100)}},b.fn.smartresize=function(a){return a?this.bind("smartresize",a):this.trigger("smartresize",["execAsap"])},b.Mason=function(a,c){this.element=b(c),this._create(a),this._init()},b.Mason.settings={isResizable:!0,isAnimated:!1,animationOptions:{queue:!1,duration:500},gutterWidth:0,isRTL:!1,isFitWidth:!1,containerStyle:{position:"relative"}},b.Mason.prototype={_filterFindBricks:function(a){var b=this.options.itemSelector;return b?a.filter(b).add(a.find(b)):a},_getBricks:function(a){var b=this._filterFindBricks(a).css({position:"absolute"}).addClass("masonry-brick");return b},_create:function(c){this.options=b.extend(!0,{},b.Mason.settings,c),this.styleQueue=[];var d=this.element[0].style;this.originalStyle={height:d.height||""};var e=this.options.containerStyle;for(var f in e)this.originalStyle[f]=d[f]||"";this.element.css(e),this.horizontalDirection=this.options.isRTL?"right":"left",this.offset={x:parseInt(this.element.css("padding-"+this.horizontalDirection),10),y:parseInt(this.element.css("padding-top"),10)},this.isFluid=this.options.columnWidth&&typeof this.options.columnWidth=="function";var g=this;setTimeout(function(){g.element.addClass("masonry")},0),this.options.isResizable&&b(a).bind("smartresize.masonry",function(){g.resize()}),this.reloadItems()},_init:function(a){this._getColumns(),this._reLayout(a)},option:function(a,c){b.isPlainObject(a)&&(this.options=b.extend(!0,this.options,a))},layout:function(a,b){for(var c=0,d=a.length;c<d;c++)this._placeBrick(a[c]);var e={};e.height=Math.max.apply(Math,this.colYs);if(this.options.isFitWidth){var f=0,c=this.cols;while(--c){if(this.colYs[c]!==0)break;f++}e.width=(this.cols-f)*this.columnWidth-this.options.gutterWidth}this.styleQueue.push({$el:this.element,style:e});var g=this.isLaidOut?this.options.isAnimated?"animate":"css":"css",h=this.options.animationOptions,i;for(c=0,d=this.styleQueue.length;c<d;c++)i=this.styleQueue[c],i.$el[g](i.style,h);this.styleQueue=[],b&&b.call(a),this.isLaidOut=!0},_getColumns:function(){var a=this.options.isFitWidth?this.element.parent():this.element,b=a.width();this.columnWidth=this.isFluid?this.options.columnWidth(b):this.options.columnWidth||this.$bricks.outerWidth(!0)||b,this.columnWidth+=this.options.gutterWidth,this.cols=Math.floor((b+this.options.gutterWidth)/this.columnWidth),this.cols=Math.max(this.cols,1)},_placeBrick:function(a){var c=b(a),d,e,f,g,h;d=Math.ceil(c.outerWidth(!0)/(this.columnWidth+this.options.gutterWidth)),d=Math.min(d,this.cols);if(d===1)f=this.colYs;else{e=this.cols+1-d,f=[];for(h=0;h<e;h++)g=this.colYs.slice(h,h+d),f[h]=Math.max.apply(Math,g)}var i=Math.min.apply(Math,f),j=0;for(var k=0,l=f.length;k<l;k++)if(f[k]===i){j=k;break}var m={top:i+this.offset.y};m[this.horizontalDirection]=this.columnWidth*j+this.offset.x,this.styleQueue.push({$el:c,style:m});var n=i+c.outerHeight(!0),o=this.cols+1-l;for(k=0;k<o;k++)this.colYs[j+k]=n},resize:function(){var a=this.cols;this._getColumns(),(this.isFluid||this.cols!==a)&&this._reLayout()},_reLayout:function(a){var b=this.cols;this.colYs=[];while(b--)this.colYs.push(0);this.layout(this.$bricks,a)},reloadItems:function(){this.$bricks=this._getBricks(this.element.children())},reload:function(a){this.reloadItems(),this._init(a)},appended:function(a,b,c){if(b){this._filterFindBricks(a).css({top:this.element.height()});var d=this;setTimeout(function(){d._appended(a,c)},1)}else this._appended(a,c)},_appended:function(a,b){var c=this._getBricks(a);this.$bricks=this.$bricks.add(c),this.layout(c,b)},remove:function(a){this.$bricks=this.$bricks.not(a),a.remove()},destroy:function(){this.$bricks.removeClass("masonry-brick").each(function(){this.style.position="",this.style.top="",this.style.left=""});var c=this.element[0].style;for(var d in this.originalStyle)c[d]=this.originalStyle[d];this.element.unbind(".masonry").removeClass("masonry").removeData("masonry"),b(a).unbind(".masonry")}},b.fn.imagesLoaded=function(a){function i(a){a.target.src!==f&&b.inArray(this,g)===-1&&(g.push(this),--e<=0&&(setTimeout(h),d.unbind(".imagesLoaded",i)))}function h(){a.call(c,d)}var c=this,d=c.find("img").add(c.filter("img")),e=d.length,f="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///ywAAAAAAQABAAACAUwAOw==",g=[];e||h(),d.bind("load.imagesLoaded error.imagesLoaded",i).each(function(){var a=this.src;this.src=f,this.src=a});return c};var f=function(a){this.console&&console.error(a)};b.fn.masonry=function(a){if(typeof a=="string"){var c=Array.prototype.slice.call(arguments,1);this.each(function(){var d=b.data(this,"masonry");if(!d)f("cannot call methods on masonry prior to initialization; attempted to call method '"+a+"'");else{if(!b.isFunction(d[a])||a.charAt(0)==="_"){f("no such method '"+a+"' for masonry instance");return}d[a].apply(d,c)}})}else this.each(function(){var c=b.data(this,"masonry");c?(c.option(a||{}),c._init()):b.data(this,"masonry",new b.Mason(a,this))});return this}})(window,jQuery);/**
 * guiders.js
 *
 * version 1.1.2
 *
 * Developed at Optimizely. (www.optimizely.com)
 * We make A/B testing you'll actually use.
 *
 * Released under the Apache License 2.0.
 * www.apache.org/licenses/LICENSE-2.0.html
 *
 * Questions about Guiders or Optimizely?
 * Email us at jeff+pickhardt@optimizely.com or hello@optimizely.com.
 *
 * Enjoy!
 */
var guiders=(function($){var guiders={version:"1.1.2",_defaultSettings:{attachTo:null,buttons:[{name:"Close"}],buttonCustomHTML:"",description:"Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.",isHashable:true,offset:{top:null,left:null},onShow:null,overlay:false,position:0,title:"Sample title goes here",width:400,xButton:false},_htmlSkeleton:["<div class='guider'>","  <div class='guider_content'>","    <h1 class='guider_title'></h1>","    <div class='guider_close'></div>","    <p class='guider_description'></p>","    <div class='guider_buttons'>","    </div>","  </div>","  <div class='guider_arrow'>","  </div>","</div>"].join(""),_arrowSize:42,_guiders:{},_currentGuiderID:null,_lastCreatedGuiderID:null,_zIndexForHilight:101,_addButtons:function(myGuider){var guiderButtonsContainer=myGuider.elem.find(".guider_buttons");for(var i=myGuider.buttons.length-1;i>=0;i--){var thisButton=myGuider.buttons[i];var thisButtonElem=$("<a></a>",{"class":"guider_button","text":thisButton.text});if(typeof thisButton.classString!=="undefined"&&thisButton.classString!==null){thisButtonElem.addClass(thisButton.classString)}guiderButtonsContainer.append(thisButtonElem);if(thisButton.onclick){thisButtonElem.bind("click",thisButton.onclick)}else if(!thisButton.onclick&&thisButton.name.toLowerCase()==="close"){thisButtonElem.bind("click",function(){guiders.hideAll()})}else if(!thisButton.onclick&&thisButton.name.toLowerCase()==="next"){thisButtonElem.bind("click",function(){guiders.next()})}}if(myGuider.buttonCustomHTML!==""){var myCustomHTML=$(myGuider.buttonCustomHTML);myGuider.elem.find(".guider_buttons").append(myCustomHTML)}},_addXButton:function(myGuider){var xButtonContainer=myGuider.elem.find(".guider_close");var xButton=$("<div></div>",{"class":"x_button","role":"button"});xButtonContainer.append(xButton);xButton.click(function(){guiders.hideAll()})},_attach:function(myGuider){if(typeof myGuider.attachTo==="undefined"||myGuider===null){return}var myHeight=myGuider.elem.innerHeight();var myWidth=myGuider.elem.innerWidth();if(myGuider.position===0){myGuider.elem.css("position","absolute");myGuider.elem.css("top",($(window).height()-myHeight)/3+$(window).scrollTop()+"px");myGuider.elem.css("left",($(window).width()-myWidth)/2+$(window).scrollLeft()+"px");return}if($(myGuider.attachTo).length==0){myGuider.shouldLazyAttach=true;return}myGuider.attachTo=$(myGuider.attachTo);var base=myGuider.attachTo.offset();var attachToHeight=myGuider.attachTo.innerHeight();var attachToWidth=myGuider.attachTo.innerWidth();var top=base.top;var left=base.left;var bufferOffset=0.9*guiders._arrowSize;var offsetMap={1:[-bufferOffset-myHeight,attachToWidth-myWidth],2:[0,bufferOffset+attachToWidth],3:[attachToHeight/2-myHeight/2,bufferOffset+attachToWidth],4:[attachToHeight-myHeight,bufferOffset+attachToWidth],5:[bufferOffset+attachToHeight,attachToWidth-myWidth],6:[bufferOffset+attachToHeight,attachToWidth/2-myWidth/2],7:[bufferOffset+attachToHeight,0],8:[attachToHeight-myHeight,-myWidth-bufferOffset],9:[attachToHeight/2-myHeight/2,-myWidth-bufferOffset],10:[0,-myWidth-bufferOffset],11:[-bufferOffset-myHeight,0],12:[-bufferOffset-myHeight,attachToWidth/2-myWidth/2]};offset=offsetMap[myGuider.position];top+=offset[0];left+=offset[1];if(myGuider.offset.top!==null){top+=myGuider.offset.top}if(myGuider.offset.left!==null){left+=myGuider.offset.left}myGuider.elem.css({"position":"absolute","top":top,"left":left})},_guiderById:function(id){if(typeof guiders._guiders[id]==="undefined"){throw"Cannot find guider with id "+id}return guiders._guiders[id]},_showOverlay:function(){$("#guider_overlay").fadeIn("fast")},_highlightElement:function(selector){$(selector).css({'z-index':guiders._zIndexForHilight})},_dehighlightElement:function(selector){$(selector).css({'z-index':1})},_hideOverlay:function(){$("#guider_overlay").fadeOut("fast")},_initializeOverlay:function(){if($("#guider_overlay").length===0){$("<div id=\"guider_overlay\"></div>").hide().appendTo("body")}},_styleArrow:function(myGuider){var position=myGuider.position||0;if(!position){return}var myGuiderArrow=$(myGuider.elem.find(".guider_arrow"));var newClass={1:"guider_arrow_down",2:"guider_arrow_left",3:"guider_arrow_left",4:"guider_arrow_left",5:"guider_arrow_up",6:"guider_arrow_up",7:"guider_arrow_up",8:"guider_arrow_right",9:"guider_arrow_right",10:"guider_arrow_right",11:"guider_arrow_down",12:"guider_arrow_down"};myGuiderArrow.addClass(newClass[position]);var myHeight=myGuider.elem.innerHeight();var myWidth=myGuider.elem.innerWidth();var arrowOffset=guiders._arrowSize/2;var positionMap={1:["right",arrowOffset],2:["top",arrowOffset],3:["top",myHeight/2-arrowOffset],4:["bottom",arrowOffset],5:["right",arrowOffset],6:["left",myWidth/2-arrowOffset],7:["left",arrowOffset],8:["bottom",arrowOffset],9:["top",myHeight/2-arrowOffset],10:["top",arrowOffset],11:["left",arrowOffset],12:["left",myWidth/2-arrowOffset]};var position=positionMap[myGuider.position];myGuiderArrow.css(position[0],position[1]+"px")},_showIfHashed:function(myGuider){var GUIDER_HASH_TAG="guider=";var hashIndex=window.location.hash.indexOf(GUIDER_HASH_TAG);if(hashIndex!==-1){var hashGuiderId=window.location.hash.substr(hashIndex+GUIDER_HASH_TAG.length);if(myGuider.id.toLowerCase()===hashGuiderId.toLowerCase()){guiders.show(myGuider.id)}}},next:function(){var currentGuider=guiders._guiders[guiders._currentGuiderID];if(typeof currentGuider==="undefined"){return}var nextGuiderId=currentGuider.next||null;if(nextGuiderId!==null&&nextGuiderId!==""){var myGuider=guiders._guiderById(nextGuiderId);var omitHidingOverlay=myGuider.overlay?true:false;guiders.hideAll(omitHidingOverlay);if(currentGuider.highlight){guiders._dehighlightElement(currentGuider.highlight)}if(myGuider.shouldLazyAttach){this._attach(myGuider)}guiders.show(nextGuiderId)}},createGuider:function(passedSettings){if(passedSettings===null||passedSettings===undefined){passedSettings={}}myGuider=$.extend({},guiders._defaultSettings,passedSettings);myGuider.id=myGuider.id||String(Math.floor(Math.random()*1000));var guiderElement=$(guiders._htmlSkeleton);myGuider.elem=guiderElement;myGuider.elem.css("width",myGuider.width+"px");guiderElement.find("h1.guider_title").html(myGuider.title);guiderElement.find("p.guider_description").html(myGuider.description);guiders._addButtons(myGuider);if(myGuider.xButton){guiders._addXButton(myGuider)}guiderElement.hide();guiderElement.appendTo("body");guiderElement.attr("id",myGuider.id);if(typeof myGuider.attachTo!=="undefined"&&myGuider!==null){guiders._attach(myGuider);guiders._styleArrow(myGuider)}guiders._initializeOverlay();guiders._guiders[myGuider.id]=myGuider;guiders._lastCreatedGuiderID=myGuider.id;if(myGuider.isHashable){guiders._showIfHashed(myGuider)}return guiders},hideAll:function(omitHidingOverlay){$(".guider").fadeOut("fast");if(typeof omitHidingOverlay!=="undefined"&&omitHidingOverlay===true){}else{guiders._hideOverlay()}return guiders},show:function(id){if(!id&&guiders._lastCreatedGuiderID){id=guiders._lastCreatedGuiderID}var myGuider=guiders._guiderById(id);if(myGuider.overlay){guiders._showOverlay();if(myGuider.highlight){guiders._highlightElement(myGuider.highlight)}}guiders._attach(myGuider);if(myGuider.onShow){myGuider.onShow(myGuider)}myGuider.elem.fadeIn("fast");var windowHeight=$(window).height();var scrollHeight=$(window).scrollTop();var guiderOffset=myGuider.elem.offset();var guiderElemHeight=myGuider.elem.height();if(guiderOffset.top-scrollHeight<0||guiderOffset.top+guiderElemHeight+40>scrollHeight+windowHeight){window.scrollTo(0,Math.max(guiderOffset.top+(guiderElemHeight/2)-(windowHeight/2),0))}guiders._currentGuiderID=id;return guiders}};return guiders}).call(this,jQuery);

/*
 * jQuery.fn.autoResize 1.14
 * --
 * https://github.com/padolsey/jQuery.fn.autoResize
 * --
 * This program is free software. It comes without any warranty, to
 * the extent permitted by applicable law. You can redistribute it
 * and/or modify it under the terms of the Do What The Fuck You Want
 * To Public License, Version 2, as published by Sam Hocevar. See
 * http://sam.zoy.org/wtfpl/COPYING for more details. */ 

(function(a){function e(b,c){if(b.data("AutoResizer")){b.data("AutoResizer").destroy()}c=this.config=a.extend({},d.defaults,c);this.el=b;this.nodeName=b[0].nodeName.toLowerCase();this.originalHeight=b.height();this.previousScrollTop=null;this.value=b.val();if(c.maxWidth==="original")c.maxWidth=b.width();if(c.minWidth==="original")c.minWidth=b.width();if(c.maxHeight==="original")c.maxHeight=b.height();if(c.minHeight==="original")c.minHeight=b.height();if(this.nodeName==="textarea"){b.css({resize:"none",overflowY:"hidden"})}b.data("AutoResizer",this);c.animate.complete=function(a){return function(){c.onAfterResize.call(b);return a.apply(this,arguments)}}(c.animate.complete);this.bind()}function d(b){this.filter(d.resizableFilterSelector).each(function(){new e(a(this),b)});return this}var b="ar"+ +(new Date),c=d.defaults={onResize:function(){},onBeforeResize:function(){return 123},onAfterResize:function(){return 555},animate:{duration:200,complete:function(){}},extraSpace:50,minHeight:"original",maxHeight:500,minWidth:"original",maxWidth:500};d.cloneCSSProperties=["lineHeight","textDecoration","letterSpacing","fontSize","fontFamily","fontStyle","fontWeight","textTransform","textAlign","direction","wordSpacing","fontSizeAdjust","paddingTop","paddingLeft","paddingBottom","paddingRight","width"];d.cloneCSSValues={position:"absolute",top:-9999,left:-9999,opacity:0,overflow:"hidden"};d.resizableFilterSelector=["textarea:not(textarea."+b+")","input:not(input[type])","input[type=text]","input[type=password]","input[type=email]","input[type=url]"].join(",");d.AutoResizer=e;a.fn.autoResize=d;e.prototype={bind:function(){var b=a.proxy(function(){this.check();return true},this);this.unbind();this.el.bind("keyup.autoResize",b).bind("change.autoResize",b).bind("paste.autoResize",function(){setTimeout(function(){b()},0)});if(!this.el.is(":hidden")){this.check(null,true)}},unbind:function(){this.el.unbind(".autoResize")},createClone:function(){var c=this.el,e=this.nodeName==="textarea"?c.clone():a("<span/>");this.clone=e;a.each(d.cloneCSSProperties,function(a,b){e[0].style[b]=c.css(b)});e.removeAttr("name").removeAttr("id").addClass(b).attr("tabIndex",-1).css(d.cloneCSSValues);if(this.nodeName==="textarea"){e.height("auto")}else{e.width("auto").css({whiteSpace:"nowrap"})}},check:function(a,b){if(!this.clone){this.createClone();this.injectClone()}var c=this.config,d=this.clone,e=this.el,f=e.val();if(f===this.prevValue){return true}this.prevValue=f;if(this.nodeName==="input"){d.text(f);var g=d.width(),h=g+c.extraSpace>=c.minWidth?g+c.extraSpace:c.minWidth,i=e.width();h=Math.min(h,c.maxWidth);if(h<i&&h>=c.minWidth||h>=c.minWidth&&h<=c.maxWidth){c.onBeforeResize.call(e);c.onResize.call(e);e.scrollLeft(0);if(c.animate&&!b){e.stop(1,1).animate({width:h},c.animate)}else{e.width(h);c.onAfterResize.call(e)}}return}d.width(e.width()).height(0).val(f).scrollTop(1e4);var j=d[0].scrollTop;if(this.previousScrollTop===j){return}this.previousScrollTop=j;if(j+c.extraSpace>=c.maxHeight){e.css("overflowY","");j=c.maxHeight;b=true}else if(j<=c.minHeight){j=c.minHeight}else{e.css("overflowY","hidden");j+=c.extraSpace}c.onBeforeResize.call(e);c.onResize.call(e);if(c.animate&&!b){e.stop(1,1).animate({height:j},c.animate)}else{e.height(j);c.onAfterResize.call(e)}},destroy:function(){this.unbind();this.el.removeData("AutoResizer");this.clone.remove();delete this.el;delete this.clone},injectClone:function(){(d.cloneContainer||(d.cloneContainer=a("<arclones/>").appendTo("body"))).append(this.clone)}}})(jQuery);

/* iphone style checkbox, http://awardwinningfjords.com/2009/06/16/iphone-style-checkboxes.html */
(function(a){function e(b,c){if(b.data("AutoResizer")){b.data("AutoResizer").destroy()}c=this.config=a.extend({},d.defaults,c);this.el=b;this.nodeName=b[0].nodeName.toLowerCase();this.originalHeight=b.height();this.previousScrollTop=null;this.value=b.val();if(c.maxWidth==="original")c.maxWidth=b.width();if(c.minWidth==="original")c.minWidth=b.width();if(c.maxHeight==="original")c.maxHeight=b.height();if(c.minHeight==="original")c.minHeight=b.height();if(this.nodeName==="textarea"){b.css({resize:"none",overflowY:"hidden"})}b.data("AutoResizer",this);c.animate.complete=function(a){return function(){c.onAfterResize.call(b);return a.apply(this,arguments)}}(c.animate.complete);this.bind()}function d(b){this.filter(d.resizableFilterSelector).each(function(){new e(a(this),b)});return this}var b="ar"+ +(new Date),c=d.defaults={onResize:function(){},onBeforeResize:function(){return 123},onAfterResize:function(){return 555},animate:{duration:200,complete:function(){}},extraSpace:50,minHeight:"original",maxHeight:500,minWidth:"original",maxWidth:500};d.cloneCSSProperties=["lineHeight","textDecoration","letterSpacing","fontSize","fontFamily","fontStyle","fontWeight","textTransform","textAlign","direction","wordSpacing","fontSizeAdjust","paddingTop","paddingLeft","paddingBottom","paddingRight","width"];d.cloneCSSValues={position:"absolute",top:-9999,left:-9999,opacity:0,overflow:"hidden"};d.resizableFilterSelector=["textarea:not(textarea."+b+")","input:not(input[type])","input[type=text]","input[type=password]","input[type=email]","input[type=url]"].join(",");d.AutoResizer=e;a.fn.autoResize=d;e.prototype={bind:function(){var b=a.proxy(function(){this.check();return true},this);this.unbind();this.el.bind("keyup.autoResize",b).bind("change.autoResize",b).bind("paste.autoResize",function(){setTimeout(function(){b()},0)});if(!this.el.is(":hidden")){this.check(null,true)}},unbind:function(){this.el.unbind(".autoResize")},createClone:function(){var c=this.el,e=this.nodeName==="textarea"?c.clone():a("<span/>");this.clone=e;a.each(d.cloneCSSProperties,function(a,b){e[0].style[b]=c.css(b)});e.removeAttr("name").removeAttr("id").addClass(b).attr("tabIndex",-1).css(d.cloneCSSValues);if(this.nodeName==="textarea"){e.height("auto")}else{e.width("auto").css({whiteSpace:"nowrap"})}},check:function(a,b){if(!this.clone){this.createClone();this.injectClone()}var c=this.config,d=this.clone,e=this.el,f=e.val();if(f===this.prevValue){return true}this.prevValue=f;if(this.nodeName==="input"){d.text(f);var g=d.width(),h=g+c.extraSpace>=c.minWidth?g+c.extraSpace:c.minWidth,i=e.width();h=Math.min(h,c.maxWidth);if(h<i&&h>=c.minWidth||h>=c.minWidth&&h<=c.maxWidth){c.onBeforeResize.call(e);c.onResize.call(e);e.scrollLeft(0);if(c.animate&&!b){e.stop(1,1).animate({width:h},c.animate)}else{e.width(h);c.onAfterResize.call(e)}}return}d.width(e.width()).height(0).val(f).scrollTop(1e4);var j=d[0].scrollTop;if(this.previousScrollTop===j){return}this.previousScrollTop=j;if(j+c.extraSpace>=c.maxHeight){e.css("overflowY","");j=c.maxHeight;b=true}else if(j<=c.minHeight){j=c.minHeight}else{e.css("overflowY","hidden");j+=c.extraSpace}c.onBeforeResize.call(e);c.onResize.call(e);if(c.animate&&!b){e.stop(1,1).animate({height:j},c.animate)}else{e.height(j);c.onAfterResize.call(e)}},destroy:function(){this.unbind();this.el.removeData("AutoResizer");this.clone.remove();delete this.el;delete this.clone},injectClone:function(){(d.cloneContainer||(d.cloneContainer=a("<arclones/>").appendTo("body"))).append(this.clone)}}})(jQuery);(function(){var a;var b=Array.prototype.slice;a=function(){function a(b,c){var d,e,f;this.elem=$(b);e=$.extend({},a.defaults,c);for(d in e){f=e[d];this[d]=f}this.elem.data(this.dataName,this);this.wrapCheckboxWithDivs();this.attachEvents();this.disableTextSelection();if(this.resizeHandle){this.optionallyResize("handle")}if(this.resizeContainer){this.optionallyResize("container")}this.initialPosition()}a.prototype.isDisabled=function(){return this.elem.is(":disabled")};a.prototype.wrapCheckboxWithDivs=function(){this.elem.wrap("<div class='"+this.containerClass+"' />");this.container=this.elem.parent();this.offLabel=$("<label class='"+this.labelOffClass+"'>\n  <span>"+this.uncheckedLabel+"</span>\n</label>").appendTo(this.container);this.offSpan=this.offLabel.children("span");this.onLabel=$("<label class='"+this.labelOnClass+"'>\n  <span>"+this.checkedLabel+"</span>\n</label>").appendTo(this.container);this.onSpan=this.onLabel.children("span");return this.handle=$("<div class='"+this.handleClass+"'>\n  <div class='"+this.handleRightClass+"'>\n    <div class='"+this.handleCenterClass+"' />\n  </div>\n</div>").appendTo(this.container)};a.prototype.disableTextSelection=function(){if($.browser.msie){return $([this.handle,this.offLabel,this.onLabel,this.container]).attr("unselectable","on")}};a.prototype._getDimension=function(a,b){if($.fn.actual!=null){return a.actual(b)}else{return a[b]()}};a.prototype.optionallyResize=function(a){var b,c,d;d=this._getDimension(this.onLabel,"width");c=this._getDimension(this.offLabel,"width");if(a==="container"){b=d>c?d:c;b+=this._getDimension(this.handle,"width")+this.handleMargin;return this.container.css({width:b})}else{b=d>c?d:c;return this.handle.css({width:b})}};a.prototype.onMouseDown=function(b){var c;b.preventDefault();if(this.isDisabled()){return}c=b.pageX||b.originalEvent.changedTouches[0].pageX;a.currentlyClicking=this.handle;a.dragStartPosition=c;return a.handleLeftOffset=parseInt(this.handle.css("left"),10)||0};a.prototype.onDragMove=function(b,c){var d,e;if(a.currentlyClicking!==this.handle){return}e=(c+a.handleLeftOffset-a.dragStartPosition)/this.rightSide;if(e<0){e=0}if(e>1){e=1}d=e*this.rightSide;this.handle.css({left:d});this.onLabel.css({width:d+this.handleRadius});this.offSpan.css({marginRight:-d});return this.onSpan.css({marginLeft:-(1-e)*this.rightSide})};a.prototype.onDragEnd=function(b,c){var d;if(a.currentlyClicking!==this.handle){return}if(this.isDisabled()){return}if(a.dragging){d=(c-a.dragStartPosition)/this.rightSide;this.elem.prop("checked",d>=.5)}else{this.elem.prop("checked",!this.elem.prop("checked"))}a.currentlyClicking=null;a.dragging=null;return this.didChange()};a.prototype.refresh=function(){return this.didChange()};a.prototype.didChange=function(){var a;if(typeof this.onChange==="function"){this.onChange(this.elem,this.elem.prop("checked"))}if(this.isDisabled()){this.container.addClass(this.disabledClass);return false}else{this.container.removeClass(this.disabledClass)}a=this.elem.prop("checked")?this.rightSide:0;this.handle.animate({left:a},this.duration);this.onLabel.animate({width:a+this.handleRadius},this.duration);this.offSpan.animate({marginRight:-a},this.duration);return this.onSpan.animate({marginLeft:a-this.rightSide},this.duration)};a.prototype.attachEvents=function(){var a,b,c;c=this;a=function(a){return c.onGlobalMove.apply(c,arguments)};b=function(d){c.onGlobalUp.apply(c,arguments);$(document).unbind("mousemove touchmove",a);return $(document).unbind("mouseup touchend",b)};this.elem.change(function(){return c.refresh()});return this.container.bind("mousedown touchstart",function(d){c.onMouseDown.apply(c,arguments);$(document).bind("mousemove touchmove",a);return $(document).bind("mouseup touchend",b)})};a.prototype.initialPosition=function(){var a,b;a=this._getDimension(this.container,"width");this.offLabel.css({width:a-this.containerRadius});b=this.containerRadius+1;if($.browser.msie&&$.browser.version<7){b-=3}this.rightSide=a-this._getDimension(this.handle,"width")-b;if(this.elem.is(":checked")){this.handle.css({left:this.rightSide});this.onLabel.css({width:this.rightSide+this.handleRadius});this.offSpan.css({marginRight:-this.rightSide})}else{this.onLabel.css({width:0});this.onSpan.css({marginLeft:-this.rightSide})}if(this.isDisabled()){return this.container.addClass(this.disabledClass)}};a.prototype.onGlobalMove=function(b){var c;if(!(!this.isDisabled()&&a.currentlyClicking)){return}b.preventDefault();c=b.pageX||b.originalEvent.changedTouches[0].pageX;if(!a.dragging&&Math.abs(a.dragStartPosition-c)>this.dragThreshold){a.dragging=true}return this.onDragMove(b,c)};a.prototype.onGlobalUp=function(b){var c;if(!a.currentlyClicking){return}b.preventDefault();c=b.pageX||b.originalEvent.changedTouches[0].pageX;this.onDragEnd(b,c);return false};a.defaults={duration:200,checkedLabel:"ON",uncheckedLabel:"OFF",resizeHandle:true,resizeContainer:true,disabledClass:"iPhoneCheckDisabled",containerClass:"iPhoneCheckContainer",labelOnClass:"iPhoneCheckLabelOn",labelOffClass:"iPhoneCheckLabelOff",handleClass:"iPhoneCheckHandle",handleCenterClass:"iPhoneCheckHandleCenter",handleRightClass:"iPhoneCheckHandleRight",dragThreshold:5,handleMargin:15,handleRadius:4,containerRadius:5,dataName:"iphoneStyle",onChange:function(){}};return a}();$.iphoneStyle=this.iOSCheckbox=a;$.fn.iphoneStyle=function(){var c,d,e,f,g,h,i,j,k,l,m,n;c=1<=arguments.length?b.call(arguments,0):[];e=(k=(l=c[0])!=null?l.dataName:void 0)!=null?k:a.defaults.dataName;m=this.filter(":checkbox");for(i=0,j=m.length;i<j;i++){d=m[i];f=$(d).data(e);if(f!=null){g=c[0],h=2<=c.length?b.call(c,1):[];if((n=f[g])!=null){n.apply(f,h)}}else{new a(d,c[0])}}return this};$.fn.iOSCheckbox=function(a){var b;if(a==null){a={}}b=$.extend({},a,{resizeHandle:false,disabledClass:"iOSCheckDisabled",containerClass:"iOSCheckContainer",labelOnClass:"iOSCheckLabelOn",labelOffClass:"iOSCheckLabelOff",handleClass:"iOSCheckHandle",handleCenterClass:"iOSCheckHandleCenter",handleRightClass:"iOSCheckHandleRight",dataName:"iOSCheckbox"});return this.iphoneStyle(b)}}).call(this);


 /*
 * TipTip
 * Copyright 2010 Drew Wilson
 * www.drewwilson.com
 * code.drewwilson.com/entry/tiptip-jquery-plugin
 *
 * Version 1.3   -   Updated: Mar. 23, 2010
 *
 * This Plug-In will create a custom tooltip to replace the default
 * browser tooltip. It is extremely lightweight and very smart in
 * that it detects the edges of the browser window and will make sure
 * the tooltip stays within the current window size. As a result the
 * tooltip will adjust itself to be displayed above, below, to the left 
 * or to the right depending on what is necessary to stay within the
 * browser window. It is completely customizable as well via CSS.
 *
 * This TipTip jQuery plug-in is dual licensed under the MIT and GPL licenses:
 *   http://www.opensource.org/licenses/mit-license.php
 *   http://www.gnu.org/licenses/gpl.html
 */
(function($){$.fn.tipTip=function(options){var defaults={activation:"hover",keepAlive:false,maxWidth:"200px",edgeOffset:3,defaultPosition:"bottom",delay:400,fadeIn:200,fadeOut:200,attribute:"title",content:false,enter:function(){},exit:function(){}};var opts=$.extend(defaults,options);if($("#tiptip_holder").length<=0){var tiptip_holder=$('<div id="tiptip_holder" style="max-width:'+opts.maxWidth+';"></div>');var tiptip_content=$('<div id="tiptip_content"></div>');var tiptip_arrow=$('<div id="tiptip_arrow"></div>');$("body").append(tiptip_holder.html(tiptip_content).prepend(tiptip_arrow.html('<div id="tiptip_arrow_inner"></div>')))}else{var tiptip_holder=$("#tiptip_holder");var tiptip_content=$("#tiptip_content");var tiptip_arrow=$("#tiptip_arrow")}return this.each(function(){var org_elem=$(this);if(opts.content){var org_title=opts.content}else{var org_title=org_elem.attr(opts.attribute)}if(org_title!=""){if(!opts.content){org_elem.removeAttr(opts.attribute)}var timeout=false;if(opts.activation=="hover"){org_elem.hover(function(){active_tiptip()},function(){if(!opts.keepAlive){deactive_tiptip()}});if(opts.keepAlive){tiptip_holder.hover(function(){},function(){deactive_tiptip()})}}else if(opts.activation=="focus"){org_elem.focus(function(){active_tiptip()}).blur(function(){deactive_tiptip()})}else if(opts.activation=="click"){org_elem.click(function(){active_tiptip();return false}).hover(function(){},function(){if(!opts.keepAlive){deactive_tiptip()}});if(opts.keepAlive){tiptip_holder.hover(function(){},function(){deactive_tiptip()})}}function active_tiptip(){opts.enter.call(this);tiptip_content.html(org_title);tiptip_holder.hide().removeAttr("class").css("margin","0");tiptip_arrow.removeAttr("style");var top=parseInt(org_elem.offset()['top']);var left=parseInt(org_elem.offset()['left']);var org_width=parseInt(org_elem.outerWidth());var org_height=parseInt(org_elem.outerHeight());var tip_w=tiptip_holder.outerWidth();var tip_h=tiptip_holder.outerHeight();var w_compare=Math.round((org_width-tip_w)/2);var h_compare=Math.round((org_height-tip_h)/2);var marg_left=Math.round(left+w_compare);var marg_top=Math.round(top+org_height+opts.edgeOffset);var t_class="";var arrow_top="";var arrow_left=Math.round(tip_w-12)/2;if(opts.defaultPosition=="bottom"){t_class="_bottom"}else if(opts.defaultPosition=="top"){t_class="_top"}else if(opts.defaultPosition=="left"){t_class="_left"}else if(opts.defaultPosition=="right"){t_class="_right"}var right_compare=(w_compare+left)<parseInt($(window).scrollLeft());var left_compare=(tip_w+left)>parseInt($(window).width());if((right_compare&&w_compare<0)||(t_class=="_right"&&!left_compare)||(t_class=="_left"&&left<(tip_w+opts.edgeOffset+5))){t_class="_right";arrow_top=Math.round(tip_h-13)/2;arrow_left=-12;marg_left=Math.round(left+org_width+opts.edgeOffset);marg_top=Math.round(top+h_compare)}else if((left_compare&&w_compare<0)||(t_class=="_left"&&!right_compare)){t_class="_left";arrow_top=Math.round(tip_h-13)/2;arrow_left=Math.round(tip_w);marg_left=Math.round(left-(tip_w+opts.edgeOffset+5));marg_top=Math.round(top+h_compare)}var top_compare=(top+org_height+opts.edgeOffset+tip_h+8)>parseInt($(window).height()+$(window).scrollTop());var bottom_compare=((top+org_height)-(opts.edgeOffset+tip_h+8))<0;if(top_compare||(t_class=="_bottom"&&top_compare)||(t_class=="_top"&&!bottom_compare)){if(t_class=="_top"||t_class=="_bottom"){t_class="_top"}else{t_class=t_class+"_top"}arrow_top=tip_h;marg_top=Math.round(top-(tip_h+5+opts.edgeOffset))}else if(bottom_compare|(t_class=="_top"&&bottom_compare)||(t_class=="_bottom"&&!top_compare)){if(t_class=="_top"||t_class=="_bottom"){t_class="_bottom"}else{t_class=t_class+"_bottom"}arrow_top=-12;marg_top=Math.round(top+org_height+opts.edgeOffset)}if(t_class=="_right_top"||t_class=="_left_top"){marg_top=marg_top+5}else if(t_class=="_right_bottom"||t_class=="_left_bottom"){marg_top=marg_top-5}if(t_class=="_left_top"||t_class=="_left_bottom"){marg_left=marg_left+5}tiptip_arrow.css({"margin-left":arrow_left+"px","margin-top":arrow_top+"px"});tiptip_holder.css({"margin-left":marg_left+"px","margin-top":marg_top+"px"}).attr("class","tip"+t_class);if(timeout){clearTimeout(timeout)}timeout=setTimeout(function(){tiptip_holder.stop(true,true).fadeIn(opts.fadeIn)},opts.delay)}function deactive_tiptip(){opts.exit.call(this);if(timeout){clearTimeout(timeout)}tiptip_holder.fadeOut(opts.fadeOut)}}})}})(jQuery);

