/*!
 * jQuery UI @VERSION
 *
 * Copyright 2012, AUTHORS.txt (http://jqueryui.com/about)
 * Dual licensed under the MIT or GPL Version 2 licenses.
 * http://jquery.org/license
 *
 * http://docs.jquery.com/UI
 */
!function(t,e){
// selectors
function n(e,n){var r=e.nodeName.toLowerCase();if("area"===r){var o,s=e.parentNode,u=s.name;return!(!e.href||!u||"map"!==s.nodeName.toLowerCase())&&(o=t("img[usemap=#"+u+"]")[0],!!o&&i(o))}return(/input|select|textarea|button|object/.test(r)?!e.disabled:"a"==r?e.href||n:n)&&i(e)}function i(e){return!t(e).parents().andSelf().filter(function(){return"hidden"===t.curCSS(this,"visibility")||t.expr.filters.hidden(this)}).length}
// prevent duplicate loading
// this is only a problem because we proxy existing functions
// and we don't want to double proxy them
t.ui=t.ui||{},t.ui.version||(t.extend(t.ui,{version:"@VERSION",keyCode:{ALT:18,BACKSPACE:8,CAPS_LOCK:20,COMMA:188,COMMAND:91,COMMAND_LEFT:91,// COMMAND
COMMAND_RIGHT:93,CONTROL:17,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,INSERT:45,LEFT:37,MENU:93,// COMMAND_RIGHT
NUMPAD_ADD:107,NUMPAD_DECIMAL:110,NUMPAD_DIVIDE:111,NUMPAD_ENTER:108,NUMPAD_MULTIPLY:106,NUMPAD_SUBTRACT:109,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SHIFT:16,SPACE:32,TAB:9,UP:38,WINDOWS:91}}),
// plugins
t.fn.extend({propAttr:t.fn.prop||t.fn.attr,_focus:t.fn.focus,focus:function(e,n){return"number"==typeof e?this.each(function(){var i=this;setTimeout(function(){t(i).focus(),n&&n.call(i)},e)}):this._focus.apply(this,arguments)},scrollParent:function(){var e;return e=t.browser.msie&&/(static|relative)/.test(this.css("position"))||/absolute/.test(this.css("position"))?this.parents().filter(function(){return/(relative|absolute|fixed)/.test(t.curCSS(this,"position",1))&&/(auto|scroll)/.test(t.curCSS(this,"overflow",1)+t.curCSS(this,"overflow-y",1)+t.curCSS(this,"overflow-x",1))}).eq(0):this.parents().filter(function(){return/(auto|scroll)/.test(t.curCSS(this,"overflow",1)+t.curCSS(this,"overflow-y",1)+t.curCSS(this,"overflow-x",1))}).eq(0),/fixed/.test(this.css("position"))||!e.length?t(document):e},zIndex:function(n){if(n!==e)return this.css("zIndex",n);if(this.length)for(var i,r,o=t(this[0]);o.length&&o[0]!==document;){if(
// Ignore z-index if position is set to a value where z-index is ignored by the browser
// This makes behavior of this function consistent across browsers
// WebKit always returns auto if the element is positioned
i=o.css("position"),("absolute"===i||"relative"===i||"fixed"===i)&&(
// IE returns 0 when zIndex is not specified
// other browsers return a string
// we ignore the case of nested elements with an explicit value of 0
// <div style="z-index: -10;"><div style="z-index: 0;"></div></div>
r=parseInt(o.css("zIndex"),10),!isNaN(r)&&0!==r))return r;o=o.parent()}return 0},disableSelection:function(){return this.bind((t.support.selectstart?"selectstart":"mousedown")+".ui-disableSelection",function(t){t.preventDefault()})},enableSelection:function(){return this.unbind(".ui-disableSelection")}}),t.each(["Width","Height"],function(n,i){function r(e,n,i,r){return t.each(o,function(){n-=parseFloat(t.curCSS(e,"padding"+this,!0))||0,i&&(n-=parseFloat(t.curCSS(e,"border"+this+"Width",!0))||0),r&&(n-=parseFloat(t.curCSS(e,"margin"+this,!0))||0)}),n}var o="Width"===i?["Left","Right"]:["Top","Bottom"],s=i.toLowerCase(),u={innerWidth:t.fn.innerWidth,innerHeight:t.fn.innerHeight,outerWidth:t.fn.outerWidth,outerHeight:t.fn.outerHeight};t.fn["inner"+i]=function(n){return n===e?u["inner"+i].call(this):this.each(function(){t(this).css(s,r(this,n)+"px")})},t.fn["outer"+i]=function(e,n){return"number"!=typeof e?u["outer"+i].call(this,e):this.each(function(){t(this).css(s,r(this,e,!0,n)+"px")})}}),t.extend(t.expr[":"],{data:function(e,n,i){return!!t.data(e,i[3])},focusable:function(e){return n(e,!isNaN(t.attr(e,"tabindex")))},tabbable:function(e){var i=t.attr(e,"tabindex"),r=isNaN(i);return(r||i>=0)&&n(e,!r)}}),
// support
t(function(){var e=document.body,n=e.appendChild(n=document.createElement("div"));
// access offsetHeight before setting the style to prevent a layout bug
// in IE 9 which causes the elemnt to continue to take up space even
// after it is removed from the DOM (#8026)
n.offsetHeight,t.extend(n.style,{minHeight:"100px",height:"auto",padding:0,borderWidth:0}),t.support.minHeight=100===n.offsetHeight,t.support.selectstart="onselectstart"in n,
// set display to none to avoid a layout bug in IE
// http://dev.jquery.com/ticket/4014
e.removeChild(n).style.display="none"}),
// deprecated
t.extend(t.ui,{
// $.ui.plugin is deprecated.  Use the proxy pattern instead.
plugin:{add:function(e,n,i){var r=t.ui[e].prototype;for(var o in i)r.plugins[o]=r.plugins[o]||[],r.plugins[o].push([n,i[o]])},call:function(t,e,n){var i=t.plugins[e];if(i&&t.element[0].parentNode)for(var r=0;r<i.length;r++)t.options[i[r][0]]&&i[r][1].apply(t.element,n)}},
// will be deprecated when we switch to jQuery 1.4 - use jQuery.contains()
contains:function(t,e){return document.compareDocumentPosition?16&t.compareDocumentPosition(e):t!==e&&t.contains(e)},
// only used by resizable
hasScroll:function(e,n){
//If overflow is hidden, the element might have extra content, but the user wants to hide it
if("hidden"===t(e).css("overflow"))return!1;var i=n&&"left"===n?"scrollLeft":"scrollTop",r=!1;
// TODO: determine which cases actually cause this to happen
// if the element doesn't have the scroll set, see if it's possible to
// set the scroll
return e[i]>0||(e[i]=1,r=e[i]>0,e[i]=0,r)},
// these are odd functions, fix the API or move into individual plugins
isOverAxis:function(t,e,n){
//Determines when x coordinate is over "b" element axis
return t>e&&t<e+n},isOver:function(e,n,i,r,o,s){
//Determines when x, y coordinates is over "b" element
return t.ui.isOverAxis(e,i,o)&&t.ui.isOverAxis(n,r,s)}}))}(jQuery);

/*!
 * jQuery UI Widget @VERSION
 *
 * Copyright 2012, AUTHORS.txt (http://jqueryui.com/about)
 * Dual licensed under the MIT or GPL Version 2 licenses.
 * http://jquery.org/license
 *
 * http://docs.jquery.com/UI/Widget
 */
!function(t,e){
// jQuery 1.4+
if(t.cleanData){var i=t.cleanData;t.cleanData=function(e){for(var n,s=0;null!=(n=e[s]);s++)try{t(n).triggerHandler("remove")}catch(a){}i(e)}}else{var n=t.fn.remove;t.fn.remove=function(e,i){return this.each(function(){return i||e&&!t.filter(e,[this]).length||t("*",this).add([this]).each(function(){try{t(this).triggerHandler("remove")}catch(e){}}),n.call(t(this),e,i)})}}t.widget=function(e,i,n){var s,a=e.split(".")[0];e=e.split(".")[1],s=a+"-"+e,n||(n=i,i=t.Widget),
// create selector for plugin
t.expr[":"][s]=function(i){return!!t.data(i,e)},t[a]=t[a]||{},t[a][e]=function(t,e){
// allow instantiation without initializing for simple inheritance
arguments.length&&this._createWidget(t,e)};var r=new i;
// we need to make the options hash a property directly on the new instance
// otherwise we'll modify the options hash on the prototype that we're
// inheriting from
//	$.each( basePrototype, function( key, val ) {
//		if ( $.isPlainObject(val) ) {
//			basePrototype[ key ] = $.extend( {}, val );
//		}
//	});
r.options=t.extend(!0,{},r.options),t[a][e].prototype=t.extend(!0,r,{namespace:a,widgetName:e,widgetEventPrefix:t[a][e].prototype.widgetEventPrefix||e,widgetBaseClass:s},n),t.widget.bridge(e,t[a][e])},t.widget.bridge=function(i,n){t.fn[i]=function(s){var a="string"==typeof s,r=Array.prototype.slice.call(arguments,1),o=this;
// prevent calls to internal methods
// allow multiple hashes to be passed on init
// prevent calls to internal methods
return s=!a&&r.length?t.extend.apply(null,[!0,s].concat(r)):s,a&&"_"===s.charAt(0)?o:(a?this.each(function(){var n=t.data(this,i),a=n&&t.isFunction(n[s])?n[s].apply(n,r):n;
// TODO: add this back in 1.9 and use $.error() (see #5972)
//				if ( !instance ) {
//					throw "cannot call methods on " + name + " prior to initialization; " +
//						"attempted to call method '" + options + "'";
//				}
//				if ( !$.isFunction( instance[options] ) ) {
//					throw "no such method '" + options + "' for " + name + " widget instance";
//				}
//				var methodValue = instance[ options ].apply( instance, args );
if(a!==n&&a!==e)return o=a,!1}):this.each(function(){var e=t.data(this,i);e?e.option(s||{})._init():t.data(this,i,new n(s,this))}),o)}},t.Widget=function(t,e){
// allow instantiation without initializing for simple inheritance
arguments.length&&this._createWidget(t,e)},t.Widget.prototype={widgetName:"widget",widgetEventPrefix:"",options:{disabled:!1},_createWidget:function(e,i){
// $.widget.bridge stores the plugin instance, but we do it anyway
// so that it's stored even before the _create function runs
t.data(i,this.widgetName,this),this.element=t(i),this.options=t.extend(!0,{},this.options,this._getCreateOptions(),e);var n=this;this.element.bind("remove."+this.widgetName,function(){n.destroy()}),this._create(),this._trigger("create"),this._init()},_getCreateOptions:function(){return t.metadata&&t.metadata.get(this.element[0])[this.widgetName]},_create:function(){},_init:function(){},destroy:function(){this.element.unbind("."+this.widgetName).removeData(this.widgetName),this.widget().unbind("."+this.widgetName).removeAttr("aria-disabled").removeClass(this.widgetBaseClass+"-disabled ui-state-disabled")},widget:function(){return this.element},option:function(i,n){var s=i;if(0===arguments.length)
// don't return a reference to the internal hash
return t.extend({},this.options);if("string"==typeof i){if(n===e)return this.options[i];s={},s[i]=n}return this._setOptions(s),this},_setOptions:function(e){var i=this;return t.each(e,function(t,e){i._setOption(t,e)}),this},_setOption:function(t,e){return this.options[t]=e,"disabled"===t&&this.widget()[e?"addClass":"removeClass"](this.widgetBaseClass+"-disabled ui-state-disabled").attr("aria-disabled",e),this},enable:function(){return this._setOption("disabled",!1)},disable:function(){return this._setOption("disabled",!0)},_trigger:function(e,i,n){var s,a,r=this.options[e];if(n=n||{},i=t.Event(i),i.type=(e===this.widgetEventPrefix?e:this.widgetEventPrefix+e).toLowerCase(),
// the original event may come from any element
// so we need to reset the target on the new event
i.target=this.element[0],
// copy original event properties over to the new event
a=i.originalEvent)for(s in a)s in i||(i[s]=a[s]);return this.element.trigger(i,n),!(t.isFunction(r)&&r.call(this.element[0],i,n)===!1||i.isDefaultPrevented())}}}(jQuery);

/*!
 * jQuery UI Mouse @VERSION
 *
 * Copyright 2012, AUTHORS.txt (http://jqueryui.com/about)
 * Dual licensed under the MIT or GPL Version 2 licenses.
 * http://jquery.org/license
 *
 * http://docs.jquery.com/UI/Mouse
 *
 * Depends:
 *	jquery.ui.widget.js
 */
!function(e,t){var s=!1;e(document).mouseup(function(e){s=!1}),e.widget("ui.mouse",{options:{cancel:":input,option",distance:1,delay:0},_mouseInit:function(){var t=this;this.element.bind("mousedown."+this.widgetName,function(e){return t._mouseDown(e)}).bind("click."+this.widgetName,function(s){if(!0===e.data(s.target,t.widgetName+".preventClickEvent"))return e.removeData(s.target,t.widgetName+".preventClickEvent"),s.stopImmediatePropagation(),!1}),this.started=!1},
// TODO: make sure destroying one instance of mouse doesn't mess with
// other instances of mouse
_mouseDestroy:function(){this.element.unbind("."+this.widgetName),e(document).unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate)},_mouseDown:function(t){
// don't let more than one widget handle mouseStart
if(!s){
// we may have missed mouseup (out of window)
this._mouseStarted&&this._mouseUp(t),this._mouseDownEvent=t;var i=this,o=1==t.which,
// event.target.nodeName works around a bug in IE 8 with
// disabled inputs (#7620)
n=!("string"!=typeof this.options.cancel||!t.target.nodeName)&&e(t.target).closest(this.options.cancel).length;
// Click event may never have fired (Gecko & Opera)
// these delegates are required to keep context
return!(o&&!n&&this._mouseCapture(t))||(this.mouseDelayMet=!this.options.delay,this.mouseDelayMet||(this._mouseDelayTimer=setTimeout(function(){i.mouseDelayMet=!0},this.options.delay)),this._mouseDistanceMet(t)&&this._mouseDelayMet(t)&&(this._mouseStarted=this._mouseStart(t)!==!1,!this._mouseStarted)?(t.preventDefault(),!0):(!0===e.data(t.target,this.widgetName+".preventClickEvent")&&e.removeData(t.target,this.widgetName+".preventClickEvent"),this._mouseMoveDelegate=function(e){return i._mouseMove(e)},this._mouseUpDelegate=function(e){return i._mouseUp(e)},e(document).bind("mousemove."+this.widgetName,this._mouseMoveDelegate).bind("mouseup."+this.widgetName,this._mouseUpDelegate),t.preventDefault(),s=!0,!0))}},_mouseMove:function(t){
// IE mouseup check - mouseup happened when mouse was out of window
// IE mouseup check - mouseup happened when mouse was out of window
return!e.browser.msie||document.documentMode>=9||t.button?this._mouseStarted?(this._mouseDrag(t),t.preventDefault()):(this._mouseDistanceMet(t)&&this._mouseDelayMet(t)&&(this._mouseStarted=this._mouseStart(this._mouseDownEvent,t)!==!1,this._mouseStarted?this._mouseDrag(t):this._mouseUp(t)),!this._mouseStarted):this._mouseUp(t)},_mouseUp:function(t){return e(document).unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate),this._mouseStarted&&(this._mouseStarted=!1,t.target==this._mouseDownEvent.target&&e.data(t.target,this.widgetName+".preventClickEvent",!0),this._mouseStop(t)),!1},_mouseDistanceMet:function(e){return Math.max(Math.abs(this._mouseDownEvent.pageX-e.pageX),Math.abs(this._mouseDownEvent.pageY-e.pageY))>=this.options.distance},_mouseDelayMet:function(e){return this.mouseDelayMet},
// These are placeholder methods, to be overriden by extending plugin
_mouseStart:function(e){},_mouseDrag:function(e){},_mouseStop:function(e){},_mouseCapture:function(e){return!0}})}(jQuery);

/*!
 * jQuery UI Position @VERSION
 *
 * Copyright 2012, AUTHORS.txt (http://jqueryui.com/about)
 * Dual licensed under the MIT or GPL Version 2 licenses.
 * http://jquery.org/license
 *
 * http://docs.jquery.com/UI/Position
 */
!function(t,e){t.ui=t.ui||{};var o=/left|center|right/,i=/top|center|bottom/,n="center",l={},f=t.fn.position,s=t.fn.offset;t.fn.position=function(e){if(!e||!e.of)return f.apply(this,arguments);
// make a copy, we don't want to modify arguments
e=t.extend({},e);var s,r,a,p=t(e.of),h=p[0],c=(e.collision||"flip").split(" "),u=e.offset?e.offset.split(" "):[0,0];
// force left top to allow flipping
// force my and at to have valid horizontal and veritcal positions
// if a value is missing or invalid, it will be converted to center 
// normalize collision option
// normalize offset option
return 9===h.nodeType?(s=p.width(),r=p.height(),a={top:0,left:0}):h.setTimeout?(s=p.width(),r=p.height(),a={top:p.scrollTop(),left:p.scrollLeft()}):h.preventDefault?(e.at="left top",s=r=0,a={top:e.of.pageY,left:e.of.pageX}):(s=p.outerWidth(),r=p.outerHeight(),a=p.offset()),t.each(["my","at"],function(){var t=(e[this]||"").split(" ");1===t.length&&(t=o.test(t[0])?t.concat([n]):i.test(t[0])?[n].concat(t):[n,n]),t[0]=o.test(t[0])?t[0]:n,t[1]=i.test(t[1])?t[1]:n,e[this]=t}),1===c.length&&(c[1]=c[0]),u[0]=parseInt(u[0],10)||0,1===u.length&&(u[1]=u[0]),u[1]=parseInt(u[1],10)||0,"right"===e.at[0]?a.left+=s:e.at[0]===n&&(a.left+=s/2),"bottom"===e.at[1]?a.top+=r:e.at[1]===n&&(a.top+=r/2),a.left+=u[0],a.top+=u[1],this.each(function(){var o,i=t(this),f=i.outerWidth(),p=i.outerHeight(),h=parseInt(t.curCSS(this,"marginLeft",!0))||0,g=parseInt(t.curCSS(this,"marginTop",!0))||0,d=f+h+(parseInt(t.curCSS(this,"marginRight",!0))||0),m=p+g+(parseInt(t.curCSS(this,"marginBottom",!0))||0),y=t.extend({},a);"right"===e.my[0]?y.left-=f:e.my[0]===n&&(y.left-=f/2),"bottom"===e.my[1]?y.top-=p:e.my[1]===n&&(y.top-=p/2),
// prevent fractions if jQuery version doesn't support them (see #5280)
l.fractions||(y.left=Math.round(y.left),y.top=Math.round(y.top)),o={left:y.left-h,top:y.top-g},t.each(["left","top"],function(i,n){t.ui.position[c[i]]&&t.ui.position[c[i]][n](y,{targetWidth:s,targetHeight:r,elemWidth:f,elemHeight:p,collisionPosition:o,collisionWidth:d,collisionHeight:m,offset:u,my:e.my,at:e.at})}),t.fn.bgiframe&&i.bgiframe(),i.offset(t.extend(y,{using:e.using}))})},t.ui.position={fit:{left:function(e,o){var i=t(window),n=o.collisionPosition.left+o.collisionWidth-i.width()-i.scrollLeft();e.left=n>0?e.left-n:Math.max(e.left-o.collisionPosition.left,e.left)},top:function(e,o){var i=t(window),n=o.collisionPosition.top+o.collisionHeight-i.height()-i.scrollTop();e.top=n>0?e.top-n:Math.max(e.top-o.collisionPosition.top,e.top)}},flip:{left:function(e,o){if(o.at[0]!==n){var i=t(window),l=o.collisionPosition.left+o.collisionWidth-i.width()-i.scrollLeft(),f="left"===o.my[0]?-o.elemWidth:"right"===o.my[0]?o.elemWidth:0,s="left"===o.at[0]?o.targetWidth:-o.targetWidth,r=-2*o.offset[0];e.left+=o.collisionPosition.left<0?f+s+r:l>0?f+s+r:0}},top:function(e,o){if(o.at[1]!==n){var i=t(window),l=o.collisionPosition.top+o.collisionHeight-i.height()-i.scrollTop(),f="top"===o.my[1]?-o.elemHeight:"bottom"===o.my[1]?o.elemHeight:0,s="top"===o.at[1]?o.targetHeight:-o.targetHeight,r=-2*o.offset[1];e.top+=o.collisionPosition.top<0?f+s+r:l>0?f+s+r:0}}}},
// offset setter from jQuery 1.4
t.offset.setOffset||(t.offset.setOffset=function(e,o){
// set position first, in-case top/left are set even on static elem
/static/.test(t.curCSS(e,"position"))&&(e.style.position="relative");var i=t(e),n=i.offset(),l=parseInt(t.curCSS(e,"top",!0),10)||0,f=parseInt(t.curCSS(e,"left",!0),10)||0,s={top:o.top-n.top+l,left:o.left-n.left+f};"using"in o?o.using.call(e,s):i.css(s)},t.fn.offset=function(e){var o=this[0];return o&&o.ownerDocument?e?this.each(function(){t.offset.setOffset(this,e)}):s.call(this):null}),
// fraction support test (older versions of jQuery don't support fractions)
function(){var e,o,i,n,f,s=document.getElementsByTagName("body")[0],r=document.createElement("div");
//Create a "fake body" for testing based on method used in jQuery.support
e=document.createElement(s?"div":"body"),i={visibility:"hidden",width:0,height:0,border:0,margin:0,background:"none"},s&&t.extend(i,{position:"absolute",left:"-1000px",top:"-1000px"});for(var a in i)e.style[a]=i[a];e.appendChild(r),o=s||document.documentElement,o.insertBefore(e,o.firstChild),r.style.cssText="position: absolute; left: 10.7432222px; top: 10.432325px; height: 30px; width: 201px;",n=t(r).offset(function(t,e){return e}).offset(),e.innerHTML="",o.removeChild(e),f=n.top+n.left+(s?2e3:0),l.fractions=f>21&&f<22}()}(jQuery);

/*!
 * jQuery UI Draggable @VERSION
 *
 * Copyright 2012, AUTHORS.txt (http://jqueryui.com/about)
 * Dual licensed under the MIT or GPL Version 2 licenses.
 * http://jquery.org/license
 *
 * http://docs.jquery.com/UI/Draggables
 *
 * Depends:
 *	jquery.ui.core.js
 *	jquery.ui.mouse.js
 *	jquery.ui.widget.js
 */
!function(t,e){t.widget("ui.draggable",t.ui.mouse,{widgetEventPrefix:"drag",options:{addClasses:!0,appendTo:"parent",axis:!1,connectToSortable:!1,containment:!1,cursor:"auto",cursorAt:!1,grid:!1,handle:!1,helper:"original",iframeFix:!1,opacity:!1,refreshPositions:!1,revert:!1,revertDuration:500,scope:"default",scroll:!0,scrollSensitivity:20,scrollSpeed:20,snap:!1,snapMode:"both",snapTolerance:20,stack:!1,zIndex:!1},_create:function(){"original"!=this.options.helper||/^(?:r|a|f)/.test(this.element.css("position"))||(this.element[0].style.position="relative"),this.options.addClasses&&this.element.addClass("ui-draggable"),this.options.disabled&&this.element.addClass("ui-draggable-disabled"),this._mouseInit()},destroy:function(){if(this.element.data("draggable"))return this.element.removeData("draggable").unbind(".draggable").removeClass("ui-draggable ui-draggable-dragging ui-draggable-disabled"),this._mouseDestroy(),this},_mouseCapture:function(e){var s=this.options;
// among others, prevent a drag on a resizable-handle
// among others, prevent a drag on a resizable-handle
//Quit if we're not on a valid handle
return!(this.helper||s.disabled||t(e.target).is(".ui-resizable-handle"))&&(this.handle=this._getHandle(e),!!this.handle&&(s.iframeFix&&t(s.iframeFix===!0?"iframe":s.iframeFix).each(function(){t('<div class="ui-draggable-iframeFix" style="background: #fff;"></div>').css({width:this.offsetWidth+"px",height:this.offsetHeight+"px",position:"absolute",opacity:"0.001",zIndex:1e3}).css(t(this).offset()).appendTo("body")}),!0))},_mouseStart:function(e){var s=this.options;
//Trigger event + callbacks
//Create and append the visible helper
//Cache the helper size
//If ddmanager is used for droppables, set the global draggable
/*
		 * - Position generation -
		 * This block generates everything position related - it's the core of draggables.
		 */
//Cache the margins of the original element
//Store the helper's css position
//The element's absolute position on the page minus margins
//Generate the original position
//Adjust the mouse offset relative to the helper if 'cursorAt' is supplied
//Set a containment if given in the options
//Trigger event + callbacks
//Recache the helper size
//Prepare the droppable offsets
//Execute the drag once - this causes the helper not to be visible before getting its correct position
//If the ddmanager is used for droppables, inform the manager that dragging has started (see #5003)
return this.helper=this._createHelper(e),this._cacheHelperProportions(),t.ui.ddmanager&&(t.ui.ddmanager.current=this),this._cacheMargins(),this.cssPosition=this.helper.css("position"),this.scrollParent=this.helper.scrollParent(),this.offset=this.positionAbs=this.element.offset(),this.offset={top:this.offset.top-this.margins.top,left:this.offset.left-this.margins.left},t.extend(this.offset,{click:{//Where the click happened, relative to the element
left:e.pageX-this.offset.left,top:e.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()}),this.originalPosition=this.position=this._generatePosition(e),this.originalPageX=e.pageX,this.originalPageY=e.pageY,s.cursorAt&&this._adjustOffsetFromHelper(s.cursorAt),s.containment&&this._setContainment(),this._trigger("start",e)===!1?(this._clear(),!1):(this._cacheHelperProportions(),t.ui.ddmanager&&!s.dropBehaviour&&t.ui.ddmanager.prepareOffsets(this,e),this.helper.addClass("ui-draggable-dragging"),this._mouseDrag(e,!0),t.ui.ddmanager&&t.ui.ddmanager.dragStart(this,e),!0)},_mouseDrag:function(e,s){
//Call plugins and callbacks and use the resulting position if something is returned
if(
//Compute the helpers position
this.position=this._generatePosition(e),this.positionAbs=this._convertPositionTo("absolute"),!s){var i=this._uiHash();if(this._trigger("drag",e,i)===!1)return this._mouseUp({}),!1;this.position=i.position}return this.options.axis&&"y"==this.options.axis||(this.helper[0].style.left=this.position.left+"px"),this.options.axis&&"x"==this.options.axis||(this.helper[0].style.top=this.position.top+"px"),t.ui.ddmanager&&t.ui.ddmanager.drag(this,e),!1},_mouseStop:function(e){
//If we are using droppables, inform the manager about the drop
var s=!1;t.ui.ddmanager&&!this.options.dropBehaviour&&(s=t.ui.ddmanager.drop(this,e)),
//if a drop comes from outside (a sortable)
this.dropped&&(s=this.dropped,this.dropped=!1);for(
//if the original element is no longer in the DOM don't bother to continue (see #8269)
var i=this.element[0],o=!1;i&&(i=i.parentNode);)i==document&&(o=!0);if(!o&&"original"===this.options.helper)return!1;if("invalid"==this.options.revert&&!s||"valid"==this.options.revert&&s||this.options.revert===!0||t.isFunction(this.options.revert)&&this.options.revert.call(this.element,s)){var n=this;t(this.helper).animate(this.originalPosition,parseInt(this.options.revertDuration,10),function(){n._trigger("stop",e)!==!1&&n._clear()})}else this._trigger("stop",e)!==!1&&this._clear();return!1},_mouseUp:function(e){
//If the ddmanager is used for droppables, inform the manager that dragging has stopped (see #5003)
return this.options.iframeFix===!0&&t("div.ui-draggable-iframeFix").each(function(){this.parentNode.removeChild(this)}),t.ui.ddmanager&&t.ui.ddmanager.dragStop(this,e),t.ui.mouse.prototype._mouseUp.call(this,e)},cancel:function(){return this.helper.is(".ui-draggable-dragging")?this._mouseUp({}):this._clear(),this},_getHandle:function(e){var s=!this.options.handle||!t(this.options.handle,this.element).length;return t(this.options.handle,this.element).find("*").andSelf().each(function(){this==e.target&&(s=!0)}),s},_createHelper:function(e){var s=this.options,i=t.isFunction(s.helper)?t(s.helper.apply(this.element[0],[e])):"clone"==s.helper?this.element.clone().removeAttr("id"):this.element;return i.parents("body").length||i.appendTo("parent"==s.appendTo?this.element[0].parentNode:s.appendTo),i[0]==this.element[0]||/(fixed|absolute)/.test(i.css("position"))||i.css("position","absolute"),i},_adjustOffsetFromHelper:function(e){"string"==typeof e&&(e=e.split(" ")),t.isArray(e)&&(e={left:+e[0],top:+e[1]||0}),"left"in e&&(this.offset.click.left=e.left+this.margins.left),"right"in e&&(this.offset.click.left=this.helperProportions.width-e.right+this.margins.left),"top"in e&&(this.offset.click.top=e.top+this.margins.top),"bottom"in e&&(this.offset.click.top=this.helperProportions.height-e.bottom+this.margins.top)},_getParentOffset:function(){
//Get the offsetParent and cache its position
this.offsetParent=this.helper.offsetParent();var e=this.offsetParent.offset();
// This is a special case where we need to modify a offset calculated on start, since the following happened:
// 1. The position of the helper is absolute, so it's position is calculated based on the next positioned parent
// 2. The actual offset parent is a child of the scroll parent, and the scroll parent isn't the document, which means that
//    the scroll is included in the initial calculation of the offset of the parent, and never recalculated upon drag
//Ugly IE fix
return"absolute"==this.cssPosition&&this.scrollParent[0]!=document&&t.ui.contains(this.scrollParent[0],this.offsetParent[0])&&(e.left+=this.scrollParent.scrollLeft(),e.top+=this.scrollParent.scrollTop()),(this.offsetParent[0]==document.body||this.offsetParent[0].tagName&&"html"==this.offsetParent[0].tagName.toLowerCase()&&t.browser.msie)&&(e={top:0,left:0}),{top:e.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:e.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if("relative"==this.cssPosition){var t=this.element.position();return{top:t.top-(parseInt(this.helper.css("top"),10)||0)+this.scrollParent.scrollTop(),left:t.left-(parseInt(this.helper.css("left"),10)||0)+this.scrollParent.scrollLeft()}}return{top:0,left:0}},_cacheMargins:function(){this.margins={left:parseInt(this.element.css("marginLeft"),10)||0,top:parseInt(this.element.css("marginTop"),10)||0,right:parseInt(this.element.css("marginRight"),10)||0,bottom:parseInt(this.element.css("marginBottom"),10)||0}},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()}},_setContainment:function(){var e=this.options;if("parent"==e.containment&&(e.containment=this.helper[0].parentNode),"document"!=e.containment&&"window"!=e.containment||(this.containment=["document"==e.containment?0:t(window).scrollLeft()-this.offset.relative.left-this.offset.parent.left,"document"==e.containment?0:t(window).scrollTop()-this.offset.relative.top-this.offset.parent.top,("document"==e.containment?0:t(window).scrollLeft())+t("document"==e.containment?document:window).width()-this.helperProportions.width-this.margins.left,("document"==e.containment?0:t(window).scrollTop())+(t("document"==e.containment?document:window).height()||document.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top]),/^(document|window|parent)$/.test(e.containment)||e.containment.constructor==Array)e.containment.constructor==Array&&(this.containment=e.containment);else{var s=t(e.containment),i=s[0];if(!i)return;var o=(s.offset(),"hidden"!=t(i).css("overflow"));this.containment=[(parseInt(t(i).css("borderLeftWidth"),10)||0)+(parseInt(t(i).css("paddingLeft"),10)||0),(parseInt(t(i).css("borderTopWidth"),10)||0)+(parseInt(t(i).css("paddingTop"),10)||0),(o?Math.max(i.scrollWidth,i.offsetWidth):i.offsetWidth)-(parseInt(t(i).css("borderLeftWidth"),10)||0)-(parseInt(t(i).css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left-this.margins.right,(o?Math.max(i.scrollHeight,i.offsetHeight):i.offsetHeight)-(parseInt(t(i).css("borderTopWidth"),10)||0)-(parseInt(t(i).css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top-this.margins.bottom],this.relative_container=s}},_convertPositionTo:function(e,s){s||(s=this.position);var i="absolute"==e?1:-1,o=(this.options,"absolute"!=this.cssPosition||this.scrollParent[0]!=document&&t.ui.contains(this.scrollParent[0],this.offsetParent[0])?this.scrollParent:this.offsetParent),n=/(html|body)/i.test(o[0].tagName);return{top:s.top+this.offset.relative.top*i+this.offset.parent.top*i-(t.browser.safari&&t.browser.version<526&&"fixed"==this.cssPosition?0:("fixed"==this.cssPosition?-this.scrollParent.scrollTop():n?0:o.scrollTop())*i),left:s.left+this.offset.relative.left*i+this.offset.parent.left*i-(t.browser.safari&&t.browser.version<526&&"fixed"==this.cssPosition?0:("fixed"==this.cssPosition?-this.scrollParent.scrollLeft():n?0:o.scrollLeft())*i)}},_generatePosition:function(e){var s=this.options,i="absolute"!=this.cssPosition||this.scrollParent[0]!=document&&t.ui.contains(this.scrollParent[0],this.offsetParent[0])?this.scrollParent:this.offsetParent,o=/(html|body)/i.test(i[0].tagName),n=e.pageX,r=e.pageY;/*
		 * - Position constraining -
		 * Constrain the position to a mix of grid, containment.
		 */
if(this.originalPosition){//If we are not dragging yet, we won't check for options
var a;if(this.containment){if(this.relative_container){var l=this.relative_container.offset();a=[this.containment[0]+l.left,this.containment[1]+l.top,this.containment[2]+l.left,this.containment[3]+l.top]}else a=this.containment;e.pageX-this.offset.click.left<a[0]&&(n=a[0]+this.offset.click.left),e.pageY-this.offset.click.top<a[1]&&(r=a[1]+this.offset.click.top),e.pageX-this.offset.click.left>a[2]&&(n=a[2]+this.offset.click.left),e.pageY-this.offset.click.top>a[3]&&(r=a[3]+this.offset.click.top)}if(s.grid){
//Check for grid elements set to 0 to prevent divide by 0 error causing invalid argument errors in IE (see ticket #6950)
var h=s.grid[1]?this.originalPageY+Math.round((r-this.originalPageY)/s.grid[1])*s.grid[1]:this.originalPageY;r=a&&(h-this.offset.click.top<a[1]||h-this.offset.click.top>a[3])?h-this.offset.click.top<a[1]?h+s.grid[1]:h-s.grid[1]:h;var c=s.grid[0]?this.originalPageX+Math.round((n-this.originalPageX)/s.grid[0])*s.grid[0]:this.originalPageX;n=a&&(c-this.offset.click.left<a[0]||c-this.offset.click.left>a[2])?c-this.offset.click.left<a[0]?c+s.grid[0]:c-s.grid[0]:c}}return{top:r-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+(t.browser.safari&&t.browser.version<526&&"fixed"==this.cssPosition?0:"fixed"==this.cssPosition?-this.scrollParent.scrollTop():o?0:i.scrollTop()),left:n-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+(t.browser.safari&&t.browser.version<526&&"fixed"==this.cssPosition?0:"fixed"==this.cssPosition?-this.scrollParent.scrollLeft():o?0:i.scrollLeft())}},_clear:function(){this.helper.removeClass("ui-draggable-dragging"),this.helper[0]==this.element[0]||this.cancelHelperRemoval||this.helper.remove(),
//if($.ui.ddmanager) $.ui.ddmanager.current = null;
this.helper=null,this.cancelHelperRemoval=!1},
// From now on bulk stuff - mainly helpers
_trigger:function(e,s,i){//The absolute position has to be recalculated after plugins
return i=i||this._uiHash(),t.ui.plugin.call(this,e,[s,i]),"drag"==e&&(this.positionAbs=this._convertPositionTo("absolute")),t.Widget.prototype._trigger.call(this,e,s,i)},plugins:{},_uiHash:function(t){return{helper:this.helper,position:this.position,originalPosition:this.originalPosition,offset:this.positionAbs}}}),t.extend(t.ui.draggable,{version:"@VERSION"}),t.ui.plugin.add("draggable","connectToSortable",{start:function(e,s){var i=t(this).data("draggable"),o=i.options,n=t.extend({},s,{item:i.element});i.sortables=[],t(o.connectToSortable).each(function(){var s=t.data(this,"sortable");s&&!s.options.disabled&&(i.sortables.push({instance:s,shouldRevert:s.options.revert}),s.refreshPositions(),// Call the sortable's refreshPositions at drag start to refresh the containerCache since the sortable container cache is used in drag and needs to be up to date (this will ensure it's initialised as well as being kept in step with any changes that might have happened on the page).
s._trigger("activate",e,n))})},stop:function(e,s){
//If we are still over the sortable, we fake the stop event of the sortable, but also remove helper
var i=t(this).data("draggable"),o=t.extend({},s,{item:i.element});t.each(i.sortables,function(){this.instance.isOver?(this.instance.isOver=0,i.cancelHelperRemoval=!0,//Don't remove the helper in the draggable instance
this.instance.cancelHelperRemoval=!1,//Remove it in the sortable instance (so sortable plugins like revert still work)
//The sortable revert is supported, and we have to set a temporary dropped variable on the draggable to support revert: 'valid/invalid'
this.shouldRevert&&(this.instance.options.revert=!0),
//Trigger the stop of the sortable
this.instance._mouseStop(e),this.instance.options.helper=this.instance.options._helper,
//If the helper has been the original item, restore properties in the sortable
"original"==i.options.helper&&this.instance.currentItem.css({top:"auto",left:"auto"})):(this.instance.cancelHelperRemoval=!1,//Remove the helper in the sortable instance
this.instance._trigger("deactivate",e,o))})},drag:function(e,s){var i=t(this).data("draggable"),o=this;t.each(i.sortables,function(n){
//Copy over some variables to allow calling the sortable's native _intersectsWith
this.instance.positionAbs=i.positionAbs,this.instance.helperProportions=i.helperProportions,this.instance.offset.click=i.offset.click,this.instance._intersectsWith(this.instance.containerCache)?(
//If it intersects, we use a little isOver variable and set it once, so our move-in stuff gets fired only once
this.instance.isOver||(this.instance.isOver=1,
//Now we fake the start of dragging for the sortable instance,
//by cloning the list group item, appending it to the sortable and using it as inst.currentItem
//We can then fire the start event of the sortable with our passed browser event, and our own helper (so it doesn't create a new one)
this.instance.currentItem=t(o).clone().removeAttr("id").appendTo(this.instance.element).data("sortable-item",!0),this.instance.options._helper=this.instance.options.helper,//Store helper option to later restore it
this.instance.options.helper=function(){return s.helper[0]},e.target=this.instance.currentItem[0],this.instance._mouseCapture(e,!0),this.instance._mouseStart(e,!0,!0),
//Because the browser event is way off the new appended portlet, we modify a couple of variables to reflect the changes
this.instance.offset.click.top=i.offset.click.top,this.instance.offset.click.left=i.offset.click.left,this.instance.offset.parent.left-=i.offset.parent.left-this.instance.offset.parent.left,this.instance.offset.parent.top-=i.offset.parent.top-this.instance.offset.parent.top,i._trigger("toSortable",e),i.dropped=this.instance.element,//draggable revert needs that
//hack so receive/update callbacks work (mostly)
i.currentItem=i.element,this.instance.fromOutside=i),
//Provided we did all the previous steps, we can fire the drag event of the sortable on every draggable drag, when it intersects with the sortable
this.instance.currentItem&&this.instance._mouseDrag(e)):
//If it doesn't intersect with the sortable, and it intersected before,
//we fake the drag stop of the sortable, but make sure it doesn't remove the helper by using cancelHelperRemoval
this.instance.isOver&&(this.instance.isOver=0,this.instance.cancelHelperRemoval=!0,
//Prevent reverting on this forced stop
this.instance.options.revert=!1,
// The out event needs to be triggered independently
this.instance._trigger("out",e,this.instance._uiHash(this.instance)),this.instance._mouseStop(e,!0),this.instance.options.helper=this.instance.options._helper,
//Now we remove our currentItem, the list group clone again, and the placeholder, and animate the helper back to it's original size
this.instance.currentItem.remove(),this.instance.placeholder&&this.instance.placeholder.remove(),i._trigger("fromSortable",e),i.dropped=!1)})}}),t.ui.plugin.add("draggable","cursor",{start:function(e,s){var i=t("body"),o=t(this).data("draggable").options;i.css("cursor")&&(o._cursor=i.css("cursor")),i.css("cursor",o.cursor)},stop:function(e,s){var i=t(this).data("draggable").options;i._cursor&&t("body").css("cursor",i._cursor)}}),t.ui.plugin.add("draggable","opacity",{start:function(e,s){var i=t(s.helper),o=t(this).data("draggable").options;i.css("opacity")&&(o._opacity=i.css("opacity")),i.css("opacity",o.opacity)},stop:function(e,s){var i=t(this).data("draggable").options;i._opacity&&t(s.helper).css("opacity",i._opacity)}}),t.ui.plugin.add("draggable","scroll",{start:function(e,s){var i=t(this).data("draggable");i.scrollParent[0]!=document&&"HTML"!=i.scrollParent[0].tagName&&(i.overflowOffset=i.scrollParent.offset())},drag:function(e,s){var i=t(this).data("draggable"),o=i.options,n=!1;i.scrollParent[0]!=document&&"HTML"!=i.scrollParent[0].tagName?(o.axis&&"x"==o.axis||(i.overflowOffset.top+i.scrollParent[0].offsetHeight-e.pageY<o.scrollSensitivity?i.scrollParent[0].scrollTop=n=i.scrollParent[0].scrollTop+o.scrollSpeed:e.pageY-i.overflowOffset.top<o.scrollSensitivity&&(i.scrollParent[0].scrollTop=n=i.scrollParent[0].scrollTop-o.scrollSpeed)),o.axis&&"y"==o.axis||(i.overflowOffset.left+i.scrollParent[0].offsetWidth-e.pageX<o.scrollSensitivity?i.scrollParent[0].scrollLeft=n=i.scrollParent[0].scrollLeft+o.scrollSpeed:e.pageX-i.overflowOffset.left<o.scrollSensitivity&&(i.scrollParent[0].scrollLeft=n=i.scrollParent[0].scrollLeft-o.scrollSpeed))):(o.axis&&"x"==o.axis||(e.pageY-t(document).scrollTop()<o.scrollSensitivity?n=t(document).scrollTop(t(document).scrollTop()-o.scrollSpeed):t(window).height()-(e.pageY-t(document).scrollTop())<o.scrollSensitivity&&(n=t(document).scrollTop(t(document).scrollTop()+o.scrollSpeed))),o.axis&&"y"==o.axis||(e.pageX-t(document).scrollLeft()<o.scrollSensitivity?n=t(document).scrollLeft(t(document).scrollLeft()-o.scrollSpeed):t(window).width()-(e.pageX-t(document).scrollLeft())<o.scrollSensitivity&&(n=t(document).scrollLeft(t(document).scrollLeft()+o.scrollSpeed)))),n!==!1&&t.ui.ddmanager&&!o.dropBehaviour&&t.ui.ddmanager.prepareOffsets(i,e)}}),t.ui.plugin.add("draggable","snap",{start:function(e,s){var i=t(this).data("draggable"),o=i.options;i.snapElements=[],t(o.snap.constructor!=String?o.snap.items||":data(draggable)":o.snap).each(function(){var e=t(this),s=e.offset();this!=i.element[0]&&i.snapElements.push({item:this,width:e.outerWidth(),height:e.outerHeight(),top:s.top,left:s.left})})},drag:function(e,s){for(var i=t(this).data("draggable"),o=i.options,n=o.snapTolerance,r=s.offset.left,a=r+i.helperProportions.width,l=s.offset.top,h=l+i.helperProportions.height,c=i.snapElements.length-1;c>=0;c--){var p=i.snapElements[c].left,f=p+i.snapElements[c].width,d=i.snapElements[c].top,g=d+i.snapElements[c].height;
//Yes, I know, this is insane ;)
if(p-n<r&&r<f+n&&d-n<l&&l<g+n||p-n<r&&r<f+n&&d-n<h&&h<g+n||p-n<a&&a<f+n&&d-n<l&&l<g+n||p-n<a&&a<f+n&&d-n<h&&h<g+n){if("inner"!=o.snapMode){var u=Math.abs(d-h)<=n,m=Math.abs(g-l)<=n,v=Math.abs(p-a)<=n,P=Math.abs(f-r)<=n;u&&(s.position.top=i._convertPositionTo("relative",{top:d-i.helperProportions.height,left:0}).top-i.margins.top),m&&(s.position.top=i._convertPositionTo("relative",{top:g,left:0}).top-i.margins.top),v&&(s.position.left=i._convertPositionTo("relative",{top:0,left:p-i.helperProportions.width}).left-i.margins.left),P&&(s.position.left=i._convertPositionTo("relative",{top:0,left:f}).left-i.margins.left)}var b=u||m||v||P;if("outer"!=o.snapMode){var u=Math.abs(d-l)<=n,m=Math.abs(g-h)<=n,v=Math.abs(p-r)<=n,P=Math.abs(f-a)<=n;u&&(s.position.top=i._convertPositionTo("relative",{top:d,left:0}).top-i.margins.top),m&&(s.position.top=i._convertPositionTo("relative",{top:g-i.helperProportions.height,left:0}).top-i.margins.top),v&&(s.position.left=i._convertPositionTo("relative",{top:0,left:p}).left-i.margins.left),P&&(s.position.left=i._convertPositionTo("relative",{top:0,left:f-i.helperProportions.width}).left-i.margins.left)}!i.snapElements[c].snapping&&(u||m||v||P||b)&&i.options.snap.snap&&i.options.snap.snap.call(i.element,e,t.extend(i._uiHash(),{snapItem:i.snapElements[c].item})),i.snapElements[c].snapping=u||m||v||P||b}else i.snapElements[c].snapping&&i.options.snap.release&&i.options.snap.release.call(i.element,e,t.extend(i._uiHash(),{snapItem:i.snapElements[c].item})),i.snapElements[c].snapping=!1}}}),t.ui.plugin.add("draggable","stack",{start:function(e,s){var i=t(this).data("draggable").options,o=t.makeArray(t(i.stack)).sort(function(e,s){return(parseInt(t(e).css("zIndex"),10)||0)-(parseInt(t(s).css("zIndex"),10)||0)});if(o.length){var n=parseInt(o[0].style.zIndex)||0;t(o).each(function(t){this.style.zIndex=n+t}),this[0].style.zIndex=n+o.length}}}),t.ui.plugin.add("draggable","zIndex",{start:function(e,s){var i=t(s.helper),o=t(this).data("draggable").options;i.css("zIndex")&&(o._zIndex=i.css("zIndex")),i.css("zIndex",o.zIndex)},stop:function(e,s){var i=t(this).data("draggable").options;i._zIndex&&t(s.helper).css("zIndex",i._zIndex)}})}(jQuery);

/*!
 * jQuery UI Resizable @VERSION
 *
 * Copyright 2012, AUTHORS.txt (http://jqueryui.com/about)
 * Dual licensed under the MIT or GPL Version 2 licenses.
 * http://jquery.org/license
 *
 * http://docs.jquery.com/UI/Resizables
 *
 * Depends:
 *	jquery.ui.core.js
 *	jquery.ui.mouse.js
 *	jquery.ui.widget.js
 */
!function(t,e){t.widget("ui.resizable",t.ui.mouse,{widgetEventPrefix:"resize",options:{alsoResize:!1,animate:!1,animateDuration:"slow",animateEasing:"swing",aspectRatio:!1,autoHide:!1,containment:!1,ghost:!1,grid:!1,handles:"e,s,se",helper:!1,maxHeight:null,maxWidth:null,minHeight:10,minWidth:10,zIndex:1e3},_create:function(){var e=this,i=this.options;if(this.element.addClass("ui-resizable"),t.extend(this,{_aspectRatio:!!i.aspectRatio,aspectRatio:i.aspectRatio,originalElement:this.element,_proportionallyResizeElements:[],_helper:i.helper||i.ghost||i.animate?i.helper||"ui-resizable-helper":null}),
//Wrap the element if it cannot hold child nodes
this.element[0].nodeName.match(/canvas|textarea|input|select|button|img/i)&&(
//Create a wrapper element and set the wrapper to the new current internal element
this.element.wrap(t('<div class="ui-wrapper" style="overflow: hidden;"></div>').css({position:this.element.css("position"),width:this.element.outerWidth(),height:this.element.outerHeight(),top:this.element.css("top"),left:this.element.css("left")})),
//Overwrite the original this.element
this.element=this.element.parent().data("resizable",this.element.data("resizable")),this.elementIsWrapper=!0,
//Move margins to the wrapper
this.element.css({marginLeft:this.originalElement.css("marginLeft"),marginTop:this.originalElement.css("marginTop"),marginRight:this.originalElement.css("marginRight"),marginBottom:this.originalElement.css("marginBottom")}),this.originalElement.css({marginLeft:0,marginTop:0,marginRight:0,marginBottom:0}),
//Prevent Safari textarea resize
this.originalResizeStyle=this.originalElement.css("resize"),this.originalElement.css("resize","none"),
//Push the actual element to our proportionallyResize internal array
this._proportionallyResizeElements.push(this.originalElement.css({position:"static",zoom:1,display:"block"})),
// avoid IE jump (hard set the margin)
this.originalElement.css({margin:this.originalElement.css("margin")}),
// fix handlers offset
this._proportionallyResize()),this.handles=i.handles||(t(".ui-resizable-handle",this.element).length?{n:".ui-resizable-n",e:".ui-resizable-e",s:".ui-resizable-s",w:".ui-resizable-w",se:".ui-resizable-se",sw:".ui-resizable-sw",ne:".ui-resizable-ne",nw:".ui-resizable-nw"}:"e,s,se"),this.handles.constructor==String){"all"==this.handles&&(this.handles="n,e,s,w,se,sw,ne,nw");var s=this.handles.split(",");this.handles={};for(var h=0;h<s.length;h++){var n=t.trim(s[h]),o="ui-resizable-"+n,a=t('<div class="ui-resizable-handle '+o+'"></div>');
// Apply zIndex to all handles - see #7960
a.css({zIndex:i.zIndex}),
//TODO : What's going on here?
"se"==n&&a.addClass("ui-icon ui-icon-gripsmall-diagonal-se"),
//Insert into internal handles object and append to element
this.handles[n]=".ui-resizable-"+n,this.element.append(a)}}this._renderAxis=function(e){e=e||this.element;for(var i in this.handles){
//Apply pad to wrapper element, needed to fix axis position (textarea, inputs, scrolls)
if(this.handles[i].constructor==String&&(this.handles[i]=t(this.handles[i],this.element).show()),this.elementIsWrapper&&this.originalElement[0].nodeName.match(/textarea|input|select|button/i)){var s=t(this.handles[i],this.element),h=0;
//Checking the correct pad and border
h=/sw|ne|nw|se|n|s/.test(i)?s.outerHeight():s.outerWidth();
//The padding type i have to apply...
var n=["padding",/ne|nw|n/.test(i)?"Top":/se|sw|s/.test(i)?"Bottom":/^e$/.test(i)?"Right":"Left"].join("");e.css(n,h),this._proportionallyResize()}t(this.handles[i]).length}},
//TODO: make renderAxis a prototype function
this._renderAxis(this.element),this._handles=t(".ui-resizable-handle",this.element).disableSelection(),
//Matching axis name
this._handles.mouseover(function(){if(!e.resizing){if(this.className)var t=this.className.match(/ui-resizable-(se|sw|ne|nw|n|e|s|w)/i);
//Axis, default = se
e.axis=t&&t[1]?t[1]:"se"}}),
//If we want to auto hide the elements
i.autoHide&&(this._handles.hide(),t(this.element).addClass("ui-resizable-autohide").hover(function(){i.disabled||(t(this).removeClass("ui-resizable-autohide"),e._handles.show())},function(){i.disabled||e.resizing||(t(this).addClass("ui-resizable-autohide"),e._handles.hide())})),
//Initialize the mouse interaction
this._mouseInit()},destroy:function(){this._mouseDestroy();var e=function(e){t(e).removeClass("ui-resizable ui-resizable-disabled ui-resizable-resizing").removeData("resizable").unbind(".resizable").find(".ui-resizable-handle").remove()};
//TODO: Unwrap at same DOM position
if(this.elementIsWrapper){e(this.element);var i=this.element;i.after(this.originalElement.css({position:i.css("position"),width:i.outerWidth(),height:i.outerHeight(),top:i.css("top"),left:i.css("left")})).remove()}return this.originalElement.css("resize",this.originalResizeStyle),e(this.originalElement),this},_mouseCapture:function(e){var i=!1;for(var s in this.handles)t(this.handles[s])[0]==e.target&&(i=!0);return!this.options.disabled&&i},_mouseStart:function(e){var s=this.options,h=this.element.position(),n=this.element;this.resizing=!0,this.documentScroll={top:t(document).scrollTop(),left:t(document).scrollLeft()},
// bugfix for http://dev.jquery.com/ticket/1749
(n.is(".ui-draggable")||/absolute/.test(n.css("position")))&&n.css({position:"absolute",top:h.top,left:h.left}),this._renderProxy();var o=i(this.helper.css("left")),a=i(this.helper.css("top"));s.containment&&(o+=t(s.containment).scrollLeft()||0,a+=t(s.containment).scrollTop()||0),
//Store needed variables
this.offset=this.helper.offset(),this.position={left:o,top:a},this.size=this._helper?{width:n.outerWidth(),height:n.outerHeight()}:{width:n.width(),height:n.height()},this.originalSize=this._helper?{width:n.outerWidth(),height:n.outerHeight()}:{width:n.width(),height:n.height()},this.originalPosition={left:o,top:a},this.sizeDiff={width:n.outerWidth()-n.width(),height:n.outerHeight()-n.height()},this.originalMousePosition={left:e.pageX,top:e.pageY},
//Aspect Ratio
this.aspectRatio="number"==typeof s.aspectRatio?s.aspectRatio:this.originalSize.width/this.originalSize.height||1;var r=t(".ui-resizable-"+this.axis).css("cursor");return t("body").css("cursor","auto"==r?this.axis+"-resize":r),n.addClass("ui-resizable-resizing"),this._propagate("start",e),!0},_mouseDrag:function(e){
//Increase performance, avoid regex
var i=this.helper,s=(this.options,this.originalMousePosition),h=this.axis,n=e.pageX-s.left||0,o=e.pageY-s.top||0,a=this._change[h];if(!a)return!1;
// Calculate the attrs that will be change
var r=a.apply(this,[e,n,o]);t.browser.msie&&t.browser.version<7,this.sizeDiff;
// Put this in the mouseDrag handler since the user can start pressing shift while resizing
// plugins callbacks need to be called first
// calling the user callback at the end
return this._updateVirtualBoundaries(e.shiftKey),(this._aspectRatio||e.shiftKey)&&(r=this._updateRatio(r,e)),r=this._respectSize(r,e),this._propagate("resize",e),i.css({top:this.position.top+"px",left:this.position.left+"px",width:this.size.width+"px",height:this.size.height+"px"}),!this._helper&&this._proportionallyResizeElements.length&&this._proportionallyResize(),this._updateCache(r),this._trigger("resize",e,this.ui()),!1},_mouseStop:function(e){this.resizing=!1;var i=this.options,s=this;if(this._helper){var h=this._proportionallyResizeElements,n=h.length&&/textarea/i.test(h[0].nodeName),o=n&&t.ui.hasScroll(h[0],"left")?0:s.sizeDiff.height,a=n?0:s.sizeDiff.width,r={width:s.helper.width()-a,height:s.helper.height()-o},l=parseInt(s.element.css("left"),10)+(s.position.left-s.originalPosition.left)||null,p=parseInt(s.element.css("top"),10)+(s.position.top-s.originalPosition.top)||null;i.animate||this.element.css(t.extend(r,{top:p,left:l})),s.helper.height(s.size.height),s.helper.width(s.size.width),this._helper&&!i.animate&&this._proportionallyResize()}return t("body").css("cursor","auto"),this.element.removeClass("ui-resizable-resizing"),this._propagate("stop",e),this._helper&&this.helper.remove(),!1},_updateVirtualBoundaries:function(t){var e,i,h,n,o,a=this.options;o={minWidth:s(a.minWidth)?a.minWidth:0,maxWidth:s(a.maxWidth)?a.maxWidth:1/0,minHeight:s(a.minHeight)?a.minHeight:0,maxHeight:s(a.maxHeight)?a.maxHeight:1/0},(this._aspectRatio||t)&&(
// We want to create an enclosing box whose aspect ration is the requested one
// First, compute the "projected" size for each dimension based on the aspect ratio and other dimension
e=o.minHeight*this.aspectRatio,h=o.minWidth/this.aspectRatio,i=o.maxHeight*this.aspectRatio,n=o.maxWidth/this.aspectRatio,e>o.minWidth&&(o.minWidth=e),h>o.minHeight&&(o.minHeight=h),i<o.maxWidth&&(o.maxWidth=i),n<o.maxHeight&&(o.maxHeight=n)),this._vBoundaries=o},_updateCache:function(t){this.options;this.offset=this.helper.offset(),s(t.left)&&(this.position.left=t.left),s(t.top)&&(this.position.top=t.top),s(t.height)&&(this.size.height=t.height),s(t.width)&&(this.size.width=t.width)},_updateRatio:function(t,e){var i=(this.options,this.position),h=this.size,n=this.axis;return s(t.height)?t.width=t.height*this.aspectRatio:s(t.width)&&(t.height=t.width/this.aspectRatio),"sw"==n&&(t.left=i.left+(h.width-t.width),t.top=null),"nw"==n&&(t.top=i.top+(h.height-t.height),t.left=i.left+(h.width-t.width)),t},_respectSize:function(t,e){var i=(this.helper,this._vBoundaries),h=(this._aspectRatio||e.shiftKey,this.axis),n=s(t.width)&&i.maxWidth&&i.maxWidth<t.width,o=s(t.height)&&i.maxHeight&&i.maxHeight<t.height,a=s(t.width)&&i.minWidth&&i.minWidth>t.width,r=s(t.height)&&i.minHeight&&i.minHeight>t.height;a&&(t.width=i.minWidth),r&&(t.height=i.minHeight),n&&(t.width=i.maxWidth),o&&(t.height=i.maxHeight);var l=this.originalPosition.left+this.originalSize.width,p=this.position.top+this.size.height,d=/sw|nw|w/.test(h),g=/nw|ne|n/.test(h);a&&d&&(t.left=l-i.minWidth),n&&d&&(t.left=l-i.maxWidth),r&&g&&(t.top=p-i.minHeight),o&&g&&(t.top=p-i.maxHeight);
// fixing jump error on top/left - bug #2330
var f=!t.width&&!t.height;return f&&!t.left&&t.top?t.top=null:f&&!t.top&&t.left&&(t.left=null),t},_proportionallyResize:function(){this.options;if(this._proportionallyResizeElements.length)for(var e=this.helper||this.element,i=0;i<this._proportionallyResizeElements.length;i++){var s=this._proportionallyResizeElements[i];if(!this.borderDif){var h=[s.css("borderTopWidth"),s.css("borderRightWidth"),s.css("borderBottomWidth"),s.css("borderLeftWidth")],n=[s.css("paddingTop"),s.css("paddingRight"),s.css("paddingBottom"),s.css("paddingLeft")];this.borderDif=t.map(h,function(t,e){var i=parseInt(t,10)||0,s=parseInt(n[e],10)||0;return i+s})}t.browser.msie&&(t(e).is(":hidden")||t(e).parents(":hidden").length)||s.css({height:e.height()-this.borderDif[0]-this.borderDif[2]||0,width:e.width()-this.borderDif[1]-this.borderDif[3]||0})}},_renderProxy:function(){var e=this.element,i=this.options;if(this.elementOffset=e.offset(),this._helper){this.helper=this.helper||t('<div style="overflow:hidden;"></div>');
// fix ie6 offset TODO: This seems broken
var s=t.browser.msie&&t.browser.version<7,h=s?1:0,n=s?2:-1;this.helper.addClass(this._helper).css({width:this.element.outerWidth()+n,height:this.element.outerHeight()+n,position:"absolute",left:this.elementOffset.left-h+"px",top:this.elementOffset.top-h+"px",zIndex:++i.zIndex}),this.helper.appendTo("body").disableSelection()}else this.helper=this.element},_change:{e:function(t,e,i){return{width:this.originalSize.width+e}},w:function(t,e,i){var s=(this.options,this.originalSize),h=this.originalPosition;return{left:h.left+e,width:s.width-e}},n:function(t,e,i){var s=(this.options,this.originalSize),h=this.originalPosition;return{top:h.top+i,height:s.height-i}},s:function(t,e,i){return{height:this.originalSize.height+i}},se:function(e,i,s){return t.extend(this._change.s.apply(this,arguments),this._change.e.apply(this,[e,i,s]))},sw:function(e,i,s){return t.extend(this._change.s.apply(this,arguments),this._change.w.apply(this,[e,i,s]))},ne:function(e,i,s){return t.extend(this._change.n.apply(this,arguments),this._change.e.apply(this,[e,i,s]))},nw:function(e,i,s){return t.extend(this._change.n.apply(this,arguments),this._change.w.apply(this,[e,i,s]))}},_propagate:function(e,i){t.ui.plugin.call(this,e,[i,this.ui()]),"resize"!=e&&this._trigger(e,i,this.ui())},plugins:{},ui:function(){return{originalElement:this.originalElement,element:this.element,helper:this.helper,position:this.position,size:this.size,originalSize:this.originalSize,originalPosition:this.originalPosition}}}),t.extend(t.ui.resizable,{version:"@VERSION"}),/*
 * Resizable Extensions
 */
t.ui.plugin.add("resizable","alsoResize",{start:function(e,i){var s=t(this).data("resizable"),h=s.options,n=function(e){t(e).each(function(){var e=t(this);e.data("resizable-alsoresize",{width:parseInt(e.width(),10),height:parseInt(e.height(),10),left:parseInt(e.css("left"),10),top:parseInt(e.css("top"),10)})})};"object"!=typeof h.alsoResize||h.alsoResize.parentNode?n(h.alsoResize):h.alsoResize.length?(h.alsoResize=h.alsoResize[0],n(h.alsoResize)):t.each(h.alsoResize,function(t){n(t)})},resize:function(e,i){var s=t(this).data("resizable"),h=s.options,n=s.originalSize,o=s.originalPosition,a={height:s.size.height-n.height||0,width:s.size.width-n.width||0,top:s.position.top-o.top||0,left:s.position.left-o.left||0},r=function(e,s){t(e).each(function(){var e=t(this),h=t(this).data("resizable-alsoresize"),n={},o=s&&s.length?s:e.parents(i.originalElement[0]).length?["width","height"]:["width","height","top","left"];t.each(o,function(t,e){var i=(h[e]||0)+(a[e]||0);i&&i>=0&&(n[e]=i||null)}),e.css(n)})};"object"!=typeof h.alsoResize||h.alsoResize.nodeType?r(h.alsoResize):t.each(h.alsoResize,function(t,e){r(t,e)})},stop:function(e,i){t(this).removeData("resizable-alsoresize")}}),t.ui.plugin.add("resizable","animate",{stop:function(e,i){var s=t(this).data("resizable"),h=s.options,n=s._proportionallyResizeElements,o=n.length&&/textarea/i.test(n[0].nodeName),a=o&&t.ui.hasScroll(n[0],"left")?0:s.sizeDiff.height,r=o?0:s.sizeDiff.width,l={width:s.size.width-r,height:s.size.height-a},p=parseInt(s.element.css("left"),10)+(s.position.left-s.originalPosition.left)||null,d=parseInt(s.element.css("top"),10)+(s.position.top-s.originalPosition.top)||null;s.element.animate(t.extend(l,d&&p?{top:d,left:p}:{}),{duration:h.animateDuration,easing:h.animateEasing,step:function(){var i={width:parseInt(s.element.css("width"),10),height:parseInt(s.element.css("height"),10),top:parseInt(s.element.css("top"),10),left:parseInt(s.element.css("left"),10)};n&&n.length&&t(n[0]).css({width:i.width,height:i.height}),
// propagating resize, and updating values for each animation step
s._updateCache(i),s._propagate("resize",e)}})}}),t.ui.plugin.add("resizable","containment",{start:function(e,s){var h=t(this).data("resizable"),n=h.options,o=h.element,a=n.containment,r=a instanceof t?a.get(0):/parent/.test(a)?o.parent().get(0):a;if(r)if(h.containerElement=t(r),/document/.test(a)||a==document)h.containerOffset={left:0,top:0},h.containerPosition={left:0,top:0},h.parentData={element:t(document),left:0,top:0,width:t(document).width(),height:t(document).height()||document.body.parentNode.scrollHeight};else{var l=t(r),p=[];t(["Top","Right","Left","Bottom"]).each(function(t,e){p[t]=i(l.css("padding"+e))}),h.containerOffset=l.offset(),h.containerPosition=l.position(),h.containerSize={height:l.innerHeight()-p[3],width:l.innerWidth()-p[1]};var d=h.containerOffset,g=h.containerSize.height,f=h.containerSize.width,c=t.ui.hasScroll(r,"left")?r.scrollWidth:f,u=t.ui.hasScroll(r)?r.scrollHeight:g;h.parentData={element:r,left:d.left,top:d.top,width:c,height:u}}},resize:function(e,i){var s=t(this).data("resizable"),h=s.options,n=(s.containerSize,s.containerOffset),o=(s.size,s.position),a=s._aspectRatio||e.shiftKey,r={top:0,left:0},l=s.containerElement;l[0]!=document&&/static/.test(l.css("position"))&&(r=n),o.left<(s._helper?n.left:0)&&(s.size.width=s.size.width+(s._helper?s.position.left-n.left:s.position.left-r.left),a&&(s.size.height=s.size.width/s.aspectRatio),s.position.left=h.helper?n.left:0),o.top<(s._helper?n.top:0)&&(s.size.height=s.size.height+(s._helper?s.position.top-n.top:s.position.top),a&&(s.size.width=s.size.height*s.aspectRatio),s.position.top=s._helper?n.top:0),s.offset.left=s.parentData.left+s.position.left,s.offset.top=s.parentData.top+s.position.top;var p=Math.abs((s._helper?s.offset.left-r.left:s.offset.left-r.left)+s.sizeDiff.width),d=Math.abs((s._helper?s.offset.top-r.top:s.offset.top-n.top)+s.sizeDiff.height),g=s.containerElement.get(0)==s.element.parent().get(0),f=/relative|absolute/.test(s.containerElement.css("position"));g&&f&&(p-=s.parentData.left),p+s.size.width>=s.parentData.width&&(s.size.width=s.parentData.width-p,a&&(s.size.height=s.size.width/s.aspectRatio)),d+s.size.height>=s.parentData.height&&(s.size.height=s.parentData.height-d,a&&(s.size.width=s.size.height*s.aspectRatio))},stop:function(e,i){var s=t(this).data("resizable"),h=s.options,n=(s.position,s.containerOffset),o=s.containerPosition,a=s.containerElement,r=t(s.helper),l=r.offset(),p=r.outerWidth()-s.sizeDiff.width,d=r.outerHeight()-s.sizeDiff.height;s._helper&&!h.animate&&/relative/.test(a.css("position"))&&t(this).css({left:l.left-o.left-n.left,width:p,height:d}),s._helper&&!h.animate&&/static/.test(a.css("position"))&&t(this).css({left:l.left-o.left-n.left,width:p,height:d})}}),t.ui.plugin.add("resizable","ghost",{start:function(e,i){var s=t(this).data("resizable"),h=s.options,n=s.size;s.ghost=s.originalElement.clone(),s.ghost.css({opacity:.25,display:"block",position:"relative",height:n.height,width:n.width,margin:0,left:0,top:0}).addClass("ui-resizable-ghost").addClass("string"==typeof h.ghost?h.ghost:""),s.ghost.appendTo(s.helper)},resize:function(e,i){var s=t(this).data("resizable");s.options;s.ghost&&s.ghost.css({position:"relative",height:s.size.height,width:s.size.width})},stop:function(e,i){var s=t(this).data("resizable");s.options;s.ghost&&s.helper&&s.helper.get(0).removeChild(s.ghost.get(0))}}),t.ui.plugin.add("resizable","grid",{resize:function(e,i){var s=t(this).data("resizable"),h=s.options,n=s.size,o=s.originalSize,a=s.originalPosition,r=s.axis;h._aspectRatio||e.shiftKey;h.grid="number"==typeof h.grid?[h.grid,h.grid]:h.grid;var l=Math.round((n.width-o.width)/(h.grid[0]||1))*(h.grid[0]||1),p=Math.round((n.height-o.height)/(h.grid[1]||1))*(h.grid[1]||1);/^(se|s|e)$/.test(r)?(s.size.width=o.width+l,s.size.height=o.height+p):/^(ne)$/.test(r)?(s.size.width=o.width+l,s.size.height=o.height+p,s.position.top=a.top-p):/^(sw)$/.test(r)?(s.size.width=o.width+l,s.size.height=o.height+p,s.position.left=a.left-l):(s.size.width=o.width+l,s.size.height=o.height+p,s.position.top=a.top-p,s.position.left=a.left-l)}});var i=function(t){return parseInt(t,10)||0},s=function(t){return!isNaN(parseInt(t,10))}}(jQuery);

/*!
 * jQuery UI Button @VERSION
 *
 * Copyright 2012, AUTHORS.txt (http://jqueryui.com/about)
 * Dual licensed under the MIT or GPL Version 2 licenses.
 * http://jquery.org/license
 *
 * http://docs.jquery.com/UI/Button
 *
 * Depends:
 *	jquery.ui.core.js
 *	jquery.ui.widget.js
 */
!function(t,e){var i,n,s,o,u="ui-button ui-widget ui-state-default ui-corner-all",a="ui-state-hover ui-state-active ",r="ui-button-icons-only ui-button-icon-only ui-button-text-icons ui-button-text-icon-primary ui-button-text-icon-secondary ui-button-text-only",l=function(){var e=t(this).find(":ui-button");setTimeout(function(){e.button("refresh")},1)},d=function(e){var i=e.name,n=e.form,s=t([]);return i&&(s=n?t(n).find("[name='"+i+"']"):t("[name='"+i+"']",e.ownerDocument).filter(function(){return!this.form})),s};t.widget("ui.button",{options:{disabled:null,text:!0,label:null,icons:{primary:null,secondary:null}},_create:function(){this.element.closest("form").unbind("reset.button").bind("reset.button",l),"boolean"!=typeof this.options.disabled?this.options.disabled=!!this.element.propAttr("disabled"):this.element.propAttr("disabled",this.options.disabled),this._determineButtonType(),this.hasTitle=!!this.buttonElement.attr("title");var e=this,a=this.options,r="checkbox"===this.type||"radio"===this.type,h="ui-state-hover"+(r?"":" ui-state-active"),b="ui-state-focus";null===a.label&&(a.label=this.buttonElement.html()),this.buttonElement.addClass(u).attr("role","button").bind("mouseenter.button",function(){a.disabled||(t(this).addClass("ui-state-hover"),this===i&&t(this).addClass("ui-state-active"))}).bind("mouseleave.button",function(){a.disabled||t(this).removeClass(h)}).bind("click.button",function(t){a.disabled&&(t.preventDefault(),t.stopImmediatePropagation())}),this.element.bind("focus.button",function(){
// no need to check disabled, focus won't be triggered anyway
e.buttonElement.addClass(b)}).bind("blur.button",function(){e.buttonElement.removeClass(b)}),r&&(this.element.bind("change.button",function(){o||e.refresh()}),
// if mouse moves between mousedown and mouseup (drag) set clickDragged flag
// prevents issue where button state changes but checkbox/radio checked state
// does not in Firefox (see ticket #6970)
this.buttonElement.bind("mousedown.button",function(t){a.disabled||(o=!1,n=t.pageX,s=t.pageY)}).bind("mouseup.button",function(t){a.disabled||n===t.pageX&&s===t.pageY||(o=!0)})),"checkbox"===this.type?this.buttonElement.bind("click.button",function(){return!a.disabled&&!o&&(t(this).toggleClass("ui-state-active"),void e.buttonElement.attr("aria-pressed",e.element[0].checked))}):"radio"===this.type?this.buttonElement.bind("click.button",function(){if(a.disabled||o)return!1;t(this).addClass("ui-state-active"),e.buttonElement.attr("aria-pressed","true");var i=e.element[0];d(i).not(i).map(function(){return t(this).button("widget")[0]}).removeClass("ui-state-active").attr("aria-pressed","false")}):(this.buttonElement.bind("mousedown.button",function(){return!a.disabled&&(t(this).addClass("ui-state-active"),i=this,void t(document).one("mouseup",function(){i=null}))}).bind("mouseup.button",function(){return!a.disabled&&void t(this).removeClass("ui-state-active")}).bind("keydown.button",function(e){return!a.disabled&&void(e.keyCode!=t.ui.keyCode.SPACE&&e.keyCode!=t.ui.keyCode.ENTER||t(this).addClass("ui-state-active"))}).bind("keyup.button",function(){t(this).removeClass("ui-state-active")}),this.buttonElement.is("a")&&this.buttonElement.keyup(function(e){e.keyCode===t.ui.keyCode.SPACE&&
// TODO pass through original event correctly (just as 2nd argument doesn't work)
t(this).click()})),
// TODO: pull out $.Widget's handling for the disabled option into
// $.Widget.prototype._setOptionDisabled so it's easy to proxy and can
// be overridden by individual plugins
this._setOption("disabled",a.disabled),this._resetButton()},_determineButtonType:function(){if(this.element.is(":checkbox")?this.type="checkbox":this.element.is(":radio")?this.type="radio":this.element.is("input")?this.type="input":this.type="button","checkbox"===this.type||"radio"===this.type){
// we don't search against the document in case the element
// is disconnected from the DOM
var t=this.element.parents().filter(":last"),e="label[for='"+this.element.attr("id")+"']";this.buttonElement=t.find(e),this.buttonElement.length||(t=t.length?t.siblings():this.element.siblings(),this.buttonElement=t.filter(e),this.buttonElement.length||(this.buttonElement=t.find(e))),this.element.addClass("ui-helper-hidden-accessible");var i=this.element.is(":checked");i&&this.buttonElement.addClass("ui-state-active"),this.buttonElement.attr("aria-pressed",i)}else this.buttonElement=this.element},widget:function(){return this.buttonElement},destroy:function(){this.element.removeClass("ui-helper-hidden-accessible"),this.buttonElement.removeClass(u+" "+a+" "+r).removeAttr("role").removeAttr("aria-pressed").html(this.buttonElement.find(".ui-button-text").html()),this.hasTitle||this.buttonElement.removeAttr("title"),t.Widget.prototype.destroy.call(this)},_setOption:function(e,i){return t.Widget.prototype._setOption.apply(this,arguments),"disabled"===e?void(i?this.element.propAttr("disabled",!0):this.element.propAttr("disabled",!1)):void this._resetButton()},refresh:function(){var e=this.element.is(":disabled");e!==this.options.disabled&&this._setOption("disabled",e),"radio"===this.type?d(this.element[0]).each(function(){t(this).is(":checked")?t(this).button("widget").addClass("ui-state-active").attr("aria-pressed","true"):t(this).button("widget").removeClass("ui-state-active").attr("aria-pressed","false")}):"checkbox"===this.type&&(this.element.is(":checked")?this.buttonElement.addClass("ui-state-active").attr("aria-pressed","true"):this.buttonElement.removeClass("ui-state-active").attr("aria-pressed","false"))},_resetButton:function(){if("input"===this.type)return void(this.options.label&&this.element.val(this.options.label));var e=this.buttonElement.removeClass(r),i=t("<span></span>",this.element[0].ownerDocument).addClass("ui-button-text").html(this.options.label).appendTo(e.empty()).text(),n=this.options.icons,s=n.primary&&n.secondary,o=[];n.primary||n.secondary?(this.options.text&&o.push("ui-button-text-icon"+(s?"s":n.primary?"-primary":"-secondary")),n.primary&&e.prepend("<span class='ui-button-icon-primary ui-icon "+n.primary+"'></span>"),n.secondary&&e.append("<span class='ui-button-icon-secondary ui-icon "+n.secondary+"'></span>"),this.options.text||(o.push(s?"ui-button-icons-only":"ui-button-icon-only"),this.hasTitle||e.attr("title",i))):o.push("ui-button-text-only"),e.addClass(o.join(" "))}}),t.widget("ui.buttonset",{options:{items:":button, :submit, :reset, :checkbox, :radio, a, :data(button)"},_create:function(){this.element.addClass("ui-buttonset")},_init:function(){this.refresh()},_setOption:function(e,i){"disabled"===e&&this.buttons.button("option",e,i),t.Widget.prototype._setOption.apply(this,arguments)},refresh:function(){var e="rtl"===this.element.css("direction");this.buttons=this.element.find(this.options.items).filter(":ui-button").button("refresh").end().not(":ui-button").button().end().map(function(){return t(this).button("widget")[0]}).removeClass("ui-corner-all ui-corner-left ui-corner-right").filter(":first").addClass(e?"ui-corner-right":"ui-corner-left").end().filter(":last").addClass(e?"ui-corner-left":"ui-corner-right").end().end()},destroy:function(){this.element.removeClass("ui-buttonset"),this.buttons.map(function(){return t(this).button("widget")[0]}).removeClass("ui-corner-left ui-corner-right").end().button("destroy"),t.Widget.prototype.destroy.call(this)}})}(jQuery);

/*!
 * jQuery UI Dialog @VERSION
 *
 * Copyright 2012, AUTHORS.txt (http://jqueryui.com/about)
 * Dual licensed under the MIT or GPL Version 2 licenses.
 * http://jquery.org/license
 *
 * http://docs.jquery.com/UI/Dialog
 *
 * Depends:
 *	jquery.ui.core.js
 *	jquery.ui.widget.js
 *  jquery.ui.button.js
 *	jquery.ui.draggable.js
 *	jquery.ui.mouse.js
 *	jquery.ui.position.js
 *	jquery.ui.resizable.js
 */
!function(i,e){var t="ui-dialog ui-widget ui-widget-content ui-corner-all ",o={buttons:!0,height:!0,maxHeight:!0,maxWidth:!0,minHeight:!0,minWidth:!0,width:!0},a={maxHeight:!0,maxWidth:!0,minHeight:!0,minWidth:!0},
// support for jQuery 1.3.2 - handle common attrFn methods for dialog
n=i.attrFn||{val:!0,css:!0,html:!0,text:!0,data:!0,width:!0,height:!0,offset:!0,click:!0};i.widget("ui.dialog",{options:{autoOpen:!0,buttons:{},closeOnEscape:!0,closeText:"close",dialogClass:"",draggable:!0,hide:null,height:"auto",maxHeight:!1,maxWidth:!1,minHeight:150,minWidth:150,modal:!1,position:{my:"center",at:"center",collision:"fit",
// ensure that the titlebar is never outside the document
using:function(e){var t=i(this).css(e).offset().top;t<0&&i(this).css("top",e.top-t)}},resizable:!0,show:null,stack:!0,title:"",width:300,zIndex:1e3},_create:function(){this.originalTitle=this.element.attr("title"),
// #5742 - .attr() might return a DOMElement
"string"!=typeof this.originalTitle&&(this.originalTitle=""),this.options.title=this.options.title||this.originalTitle;var e=this,o=e.options,a=o.title||"&#160;",n=i.ui.dialog.getTitleId(e.element),s=(e.uiDialog=i("<div></div>")).appendTo(document.body).hide().addClass(t+o.dialogClass).css({zIndex:o.zIndex}).attr("tabIndex",-1).css("outline",0).keydown(function(t){o.closeOnEscape&&!t.isDefaultPrevented()&&t.keyCode&&t.keyCode===i.ui.keyCode.ESCAPE&&(e.close(t),t.preventDefault())}).attr({role:"dialog","aria-labelledby":n}).mousedown(function(i){e.moveToTop(!1,i)}),l=(e.element.show().removeAttr("title").addClass("ui-dialog-content ui-widget-content").appendTo(s),(e.uiDialogTitlebar=i("<div></div>")).addClass("ui-dialog-titlebar ui-widget-header ui-corner-all ui-helper-clearfix").prependTo(s)),d=i('<a href="#"></a>').addClass("ui-dialog-titlebar-close ui-corner-all").attr("role","button").hover(function(){d.addClass("ui-state-hover")},function(){d.removeClass("ui-state-hover")}).focus(function(){d.addClass("ui-state-focus")}).blur(function(){d.removeClass("ui-state-focus")}).click(function(i){return e.close(i),!1}).appendTo(l);(e.uiDialogTitlebarCloseText=i("<span></span>")).addClass("ui-icon ui-icon-closethick").text(o.closeText).appendTo(d),i("<span></span>").addClass("ui-dialog-title").attr("id",n).html(a).prependTo(l);
//handling of deprecated beforeclose (vs beforeClose) option
//Ticket #4669 http://dev.jqueryui.com/ticket/4669
//TODO: remove in 1.9pre
i.isFunction(o.beforeclose)&&!i.isFunction(o.beforeClose)&&(o.beforeClose=o.beforeclose),l.find("*").add(l).disableSelection(),o.draggable&&i.fn.draggable&&e._makeDraggable(),o.resizable&&i.fn.resizable&&e._makeResizable(),e._createButtons(o.buttons),e._isOpen=!1,i.fn.bgiframe&&s.bgiframe()},_init:function(){this.options.autoOpen&&this.open()},destroy:function(){var i=this;return i.overlay&&i.overlay.destroy(),i.uiDialog.hide(),i.element.unbind(".dialog").removeData("dialog").removeClass("ui-dialog-content ui-widget-content").hide().appendTo("body"),i.uiDialog.remove(),i.originalTitle&&i.element.attr("title",i.originalTitle),i},widget:function(){return this.uiDialog},close:function(e){var t,o,a=this;if(!1!==a._trigger("beforeClose",e))
// adjust the maxZ to allow other modal dialogs to continue to work (see #4309)
return a.overlay&&a.overlay.destroy(),a.uiDialog.unbind("keypress.ui-dialog"),a._isOpen=!1,a.options.hide?a.uiDialog.hide(a.options.hide,function(){a._trigger("close",e)}):(a.uiDialog.hide(),a._trigger("close",e)),i.ui.dialog.overlay.resize(),a.options.modal&&(t=0,i(".ui-dialog").each(function(){this!==a.uiDialog[0]&&(o=i(this).css("z-index"),isNaN(o)||(t=Math.max(t,o)))}),i.ui.dialog.maxZ=t),a},isOpen:function(){return this._isOpen},
// the force parameter allows us to move modal dialogs to their correct
// position on open
moveToTop:function(e,t){var o,a=this,n=a.options;
//Save and then restore scroll since Opera 9.5+ resets when parent z-Index is changed.
//  http://ui.jquery.com/bugs/ticket/3193
return n.modal&&!e||!n.stack&&!n.modal?a._trigger("focus",t):(n.zIndex>i.ui.dialog.maxZ&&(i.ui.dialog.maxZ=n.zIndex),a.overlay&&(i.ui.dialog.maxZ+=1,a.overlay.$el.css("z-index",i.ui.dialog.overlay.maxZ=i.ui.dialog.maxZ)),o={scrollTop:a.element.scrollTop(),scrollLeft:a.element.scrollLeft()},i.ui.dialog.maxZ+=1,a.uiDialog.css("z-index",i.ui.dialog.maxZ),a.element.attr(o),a._trigger("focus",t),a)},open:function(){if(!this._isOpen){var e=this,t=e.options,o=e.uiDialog;
// prevent tabbing out of modal dialogs
// set focus to the first tabbable element in the content area or the first button
// if there are no tabbable elements, set focus on the dialog itself
return e.overlay=t.modal?new i.ui.dialog.overlay(e):null,e._size(),e._position(t.position),o.show(t.show),e.moveToTop(!0),t.modal&&o.bind("keydown.ui-dialog",function(e){if(e.keyCode===i.ui.keyCode.TAB){var t=i(":tabbable",this),o=t.filter(":first"),a=t.filter(":last");return e.target!==a[0]||e.shiftKey?e.target===o[0]&&e.shiftKey?(a.focus(1),!1):void 0:(o.focus(1),!1)}}),i(e.element.find(":tabbable").get().concat(o.find(".ui-dialog-buttonpane :tabbable").get().concat(o.get()))).eq(0).focus(),e._isOpen=!0,e._trigger("open"),e}},_createButtons:function(e){var t=this,o=!1,a=i("<div></div>").addClass("ui-dialog-buttonpane ui-widget-content ui-helper-clearfix"),s=i("<div></div>").addClass("ui-dialog-buttonset").appendTo(a);
// if we already have a button pane, remove it
t.uiDialog.find(".ui-dialog-buttonpane").remove(),"object"==typeof e&&null!==e&&i.each(e,function(){return!(o=!0)}),o&&(i.each(e,function(e,o){o=i.isFunction(o)?{click:o,text:e}:o;var a=i('<button type="button"></button>').click(function(){o.click.apply(t.element[0],arguments)}).appendTo(s);
// can't use .attr( props, true ) with jQuery 1.3.2.
i.each(o,function(i,e){"click"!==i&&(i in n?a[i](e):a.attr(i,e))}),i.fn.button&&a.button()}),a.appendTo(t.uiDialog))},_makeDraggable:function(){function e(i){return{position:i.position,offset:i.offset}}var t,o=this,a=o.options,n=i(document);o.uiDialog.draggable({cancel:".ui-dialog-content, .ui-dialog-titlebar-close",handle:".ui-dialog-titlebar",containment:"document",start:function(n,s){t="auto"===a.height?"auto":i(this).height(),i(this).height(i(this).height()).addClass("ui-dialog-dragging"),o._trigger("dragStart",n,e(s))},drag:function(i,t){o._trigger("drag",i,e(t))},stop:function(s,l){a.position=[l.position.left-n.scrollLeft(),l.position.top-n.scrollTop()],i(this).removeClass("ui-dialog-dragging").height(t),o._trigger("dragStop",s,e(l)),i.ui.dialog.overlay.resize()}})},_makeResizable:function(t){function o(i){return{originalPosition:i.originalPosition,originalSize:i.originalSize,position:i.position,size:i.size}}t=t===e?this.options.resizable:t;var a=this,n=a.options,
// .ui-resizable has position: relative defined in the stylesheet
// but dialogs have to use absolute or fixed positioning
s=a.uiDialog.css("position"),l="string"==typeof t?t:"n,e,s,w,se,sw,ne,nw";a.uiDialog.resizable({cancel:".ui-dialog-content",containment:"document",alsoResize:a.element,maxWidth:n.maxWidth,maxHeight:n.maxHeight,minWidth:n.minWidth,minHeight:a._minHeight(),handles:l,start:function(e,t){i(this).addClass("ui-dialog-resizing"),a._trigger("resizeStart",e,o(t))},resize:function(i,e){a._trigger("resize",i,o(e))},stop:function(e,t){i(this).removeClass("ui-dialog-resizing"),n.height=i(this).height(),n.width=i(this).width(),a._trigger("resizeStop",e,o(t)),i.ui.dialog.overlay.resize()}}).css("position",s).find(".ui-resizable-se").addClass("ui-icon ui-icon-grip-diagonal-se")},_minHeight:function(){var i=this.options;return"auto"===i.height?i.minHeight:Math.min(i.minHeight,i.height)},_position:function(e){var t,o=[],a=[0,0];e?(
// deep extending converts arrays to objects in jQuery <= 1.3.2 :-(
//		if (typeof position == 'string' || $.isArray(position)) {
//			myAt = $.isArray(position) ? position : position.split(' ');
("string"==typeof e||"object"==typeof e&&"0"in e)&&(o=e.split?e.split(" "):[e[0],e[1]],1===o.length&&(o[1]=o[0]),i.each(["left","top"],function(i,e){+o[i]===o[i]&&(a[i]=o[i],o[i]=e)}),e={my:o.join(" "),at:o.join(" "),offset:a.join(" ")}),e=i.extend({},i.ui.dialog.prototype.options.position,e)):e=i.ui.dialog.prototype.options.position,
// need to show the dialog to get the actual offset in the position plugin
t=this.uiDialog.is(":visible"),t||this.uiDialog.show(),this.uiDialog.css({top:0,left:0}).position(i.extend({of:window},e)),t||this.uiDialog.hide()},_setOptions:function(e){var t=this,n={},s=!1;i.each(e,function(i,e){t._setOption(i,e),i in o&&(s=!0),i in a&&(n[i]=e)}),s&&this._size(),this.uiDialog.is(":data(resizable)")&&this.uiDialog.resizable("option",n)},_setOption:function(e,o){var a=this,n=a.uiDialog;switch(e){
//handling of deprecated beforeclose (vs beforeClose) option
//Ticket #4669 http://dev.jqueryui.com/ticket/4669
//TODO: remove in 1.9pre
case"beforeclose":e="beforeClose";break;case"buttons":a._createButtons(o);break;case"closeText":
// ensure that we always pass a string
a.uiDialogTitlebarCloseText.text(""+o);break;case"dialogClass":n.removeClass(a.options.dialogClass).addClass(t+o);break;case"disabled":o?n.addClass("ui-dialog-disabled"):n.removeClass("ui-dialog-disabled");break;case"draggable":var s=n.is(":data(draggable)");s&&!o&&n.draggable("destroy"),!s&&o&&a._makeDraggable();break;case"position":a._position(o);break;case"resizable":
// currently resizable, becoming non-resizable
var l=n.is(":data(resizable)");l&&!o&&n.resizable("destroy"),
// currently resizable, changing handles
l&&"string"==typeof o&&n.resizable("option","handles",o),
// currently non-resizable, becoming resizable
l||o===!1||a._makeResizable(o);break;case"title":
// convert whatever was passed in o a string, for html() to not throw up
i(".ui-dialog-title",a.uiDialogTitlebar).html(""+(o||"&#160;"))}i.Widget.prototype._setOption.apply(a,arguments)},_size:function(){/* If the user has resized the dialog, the .ui-dialog and .ui-dialog-content
		 * divs will both have width and height set, so we need to reset them
		 */
var e,t,o=this.options,a=this.uiDialog.is(":visible");if(
// reset content sizing
this.element.show().css({width:"auto",minHeight:0,height:0}),o.minWidth>o.width&&(o.width=o.minWidth),
// reset wrapper sizing
// determine the height of all the non-content elements
e=this.uiDialog.css({height:"auto",width:o.width}).height(),t=Math.max(0,o.minHeight-e),"auto"===o.height)
// only needed for IE6 support
if(i.support.minHeight)this.element.css({minHeight:t,height:"auto"});else{this.uiDialog.show();var n=this.element.css("height","auto").height();a||this.uiDialog.hide(),this.element.height(Math.max(n,t))}else this.element.height(Math.max(o.height-e,0));this.uiDialog.is(":data(resizable)")&&this.uiDialog.resizable("option","minHeight",this._minHeight())}}),i.extend(i.ui.dialog,{version:"@VERSION",uuid:0,maxZ:0,getTitleId:function(i){var e=i.attr("id");return e||(this.uuid+=1,e=this.uuid),"ui-dialog-title-"+e},overlay:function(e){this.$el=i.ui.dialog.overlay.create(e)}}),i.extend(i.ui.dialog.overlay,{instances:[],
// reuse old instances due to IE memory leak with alpha transparency (see #5185)
oldInstances:[],maxZ:0,events:i.map("focus,mousedown,mouseup,keydown,keypress,click".split(","),function(i){return i+".dialog-overlay"}).join(" "),create:function(e){0===this.instances.length&&(
// prevent use of anchors and inputs
// we use a setTimeout in case the overlay is created from an
// event that we're going to be cancelling (see #2804)
setTimeout(function(){
// handle $(el).dialog().dialog('close') (see #4065)
i.ui.dialog.overlay.instances.length&&i(document).bind(i.ui.dialog.overlay.events,function(e){
// stop events if the z-index of the target is < the z-index of the overlay
// we cannot return true when we don't want to cancel the event (#3523)
if(i(e.target).zIndex()<i.ui.dialog.overlay.maxZ)return!1})},1),
// allow closing by pressing the escape key
i(document).bind("keydown.dialog-overlay",function(t){e.options.closeOnEscape&&!t.isDefaultPrevented()&&t.keyCode&&t.keyCode===i.ui.keyCode.ESCAPE&&(e.close(t),t.preventDefault())}),
// handle window resize
i(window).bind("resize.dialog-overlay",i.ui.dialog.overlay.resize));var t=(this.oldInstances.pop()||i("<div></div>").addClass("ui-widget-overlay")).appendTo(document.body).css({width:this.width(),height:this.height()});return i.fn.bgiframe&&t.bgiframe(),this.instances.push(t),t},destroy:function(e){var t=i.inArray(e,this.instances);t!=-1&&this.oldInstances.push(this.instances.splice(t,1)[0]),0===this.instances.length&&i([document,window]).unbind(".dialog-overlay"),e.remove();
// adjust the maxZ to allow other modal dialogs to continue to work (see #4309)
var o=0;i.each(this.instances,function(){o=Math.max(o,this.css("z-index"))}),this.maxZ=o},height:function(){var e,t;
// handle IE 6
// handle IE 6
return i.browser.msie&&i.browser.version<7?(e=Math.max(document.documentElement.scrollHeight,document.body.scrollHeight),t=Math.max(document.documentElement.offsetHeight,document.body.offsetHeight),e<t?i(window).height()+"px":e+"px"):i(document).height()+"px"},width:function(){var e,t;
// handle IE
// handle IE
return i.browser.msie?(e=Math.max(document.documentElement.scrollWidth,document.body.scrollWidth),t=Math.max(document.documentElement.offsetWidth,document.body.offsetWidth),e<t?i(window).width()+"px":e+"px"):i(document).width()+"px"},resize:function(){/* If the dialog is draggable and the user drags it past the
		 * right edge of the window, the document becomes wider so we
		 * need to stretch the overlay. If the user then drags the
		 * dialog back to the left, the document will become narrower,
		 * so we need to shrink the overlay to the appropriate size.
		 * This is handled by shrinking the overlay before setting it
		 * to the full document size.
		 */
var e=i([]);i.each(i.ui.dialog.overlay.instances,function(){e=e.add(this)}),e.css({width:0,height:0}).css({width:i.ui.dialog.overlay.width(),height:i.ui.dialog.overlay.height()})}}),i.extend(i.ui.dialog.overlay.prototype,{destroy:function(){i.ui.dialog.overlay.destroy(this.$el)}})}(jQuery);

/*!
 * jQuery UI Datepicker @VERSION
 *
 * Copyright 2012, AUTHORS.txt (http://jqueryui.com/about)
 * Dual licensed under the MIT or GPL Version 2 licenses.
 * http://jquery.org/license
 *
 * http://docs.jquery.com/UI/Datepicker
 *
 * Depends:
 *	jquery.ui.core.js
 */
!function($,undefined){/* Date picker manager.
   Use the singleton instance of this class, $.datepicker, to interact with the date picker.
   Settings for (groups of) date pickers are maintained in an instance object,
   allowing multiple different settings on the same page. */
function Datepicker(){this.debug=!1,// Change this to true to start debugging
this._curInst=null,// The current instance in use
this._keyEvent=!1,// If the last event was a key event
this._disabledInputs=[],// List of date picker inputs that have been disabled
this._datepickerShowing=!1,// True if the popup picker is showing , false if not
this._inDialog=!1,// True if showing within a "dialog", false if not
this._mainDivId="ui-datepicker-div",// The ID of the main datepicker division
this._inlineClass="ui-datepicker-inline",// The name of the inline marker class
this._appendClass="ui-datepicker-append",// The name of the append marker class
this._triggerClass="ui-datepicker-trigger",// The name of the trigger marker class
this._dialogClass="ui-datepicker-dialog",// The name of the dialog marker class
this._disableClass="ui-datepicker-disabled",// The name of the disabled covering marker class
this._unselectableClass="ui-datepicker-unselectable",// The name of the unselectable cell marker class
this._currentClass="ui-datepicker-current-day",// The name of the current day marker class
this._dayOverClass="ui-datepicker-days-cell-over",// The name of the day hover marker class
this.regional=[],// Available regional settings, indexed by language code
this.regional[""]={// Default regional settings
closeText:"Done",// Display text for close link
prevText:"Prev",// Display text for previous month link
nextText:"Next",// Display text for next month link
currentText:"Today",// Display text for current month link
monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],// Names of months for drop-down and formatting
monthNamesShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],// For formatting
dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],// For formatting
dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],// For formatting
dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],// Column headings for days starting at Sunday
weekHeader:"Wk",// Column header for week of the year
dateFormat:"mm/dd/yy",// See format options on parseDate
firstDay:0,// The first day of the week, Sun = 0, Mon = 1, ...
isRTL:!1,// True if right-to-left language, false if left-to-right
showMonthAfterYear:!1,// True if the year select precedes month, false for month then year
yearSuffix:""},this._defaults={// Global defaults for all the date picker instances
showOn:"focus",// 'focus' for popup on focus,
// 'button' for trigger button, or 'both' for either
showAnim:"fadeIn",// Name of jQuery animation for popup
showOptions:{},// Options for enhanced animations
defaultDate:null,// Used when field is blank: actual date,
// +/-number for offset from today, null for today
appendText:"",// Display text following the input box, e.g. showing the format
buttonText:"...",// Text for trigger button
buttonImage:"",// URL for trigger button image
buttonImageOnly:!1,// True if the image appears alone, false if it appears on a button
hideIfNoPrevNext:!1,// True to hide next/previous month links
// if not applicable, false to just disable them
navigationAsDateFormat:!1,// True if date formatting applied to prev/today/next links
gotoCurrent:!1,// True if today link goes back to current selection instead
changeMonth:!1,// True if month can be selected directly, false if only prev/next
changeYear:!1,// True if year can be selected directly, false if only prev/next
yearRange:"c-10:c+10",// Range of years to display in drop-down,
// either relative to today's year (-nn:+nn), relative to currently displayed year
// (c-nn:c+nn), absolute (nnnn:nnnn), or a combination of the above (nnnn:-n)
showOtherMonths:!1,// True to show dates in other months, false to leave blank
selectOtherMonths:!1,// True to allow selection of dates in other months, false for unselectable
showWeek:!1,// True to show week of the year, false to not show it
calculateWeek:this.iso8601Week,// How to calculate the week of the year,
// takes a Date and returns the number of the week for it
shortYearCutoff:"+10",// Short year values < this are in the current century,
// > this are in the previous century,
// string value starting with '+' for current year + value
minDate:null,// The earliest selectable date, or null for no limit
maxDate:null,// The latest selectable date, or null for no limit
duration:"fast",// Duration of display/closure
beforeShowDay:null,// Function that takes a date and returns an array with
// [0] = true if selectable, false if not, [1] = custom CSS class name(s) or '',
// [2] = cell title (optional), e.g. $.datepicker.noWeekends
beforeShow:null,// Function that takes an input field and
// returns a set of custom settings for the date picker
onSelect:null,// Define a callback function when a date is selected
onChangeMonthYear:null,// Define a callback function when the month or year is changed
onClose:null,// Define a callback function when the datepicker is closed
numberOfMonths:1,// Number of months to show at a time
showCurrentAtPos:0,// The position in multipe months at which to show the current month (starting at 0)
stepMonths:1,// Number of months to step back/forward
stepBigMonths:12,// Number of months to step back/forward for the big links
altField:"",// Selector for an alternate field to store selected dates into
altFormat:"",// The date format to use for the alternate field
constrainInput:!0,// The input is constrained by the current date format
showButtonPanel:!1,// True to show button panel, false to not show it
autoSize:!1,// True to size the input for the date format, false to leave as is
disabled:!1},$.extend(this._defaults,this.regional[""]),this.dpDiv=bindHover($('<div id="'+this._mainDivId+'" class="ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all"></div>'))}/*
 * Bind hover events for datepicker elements.
 * Done via delegate so the binding only occurs once in the lifetime of the parent div.
 * Global instActive, set by _updateDatepicker allows the handlers to find their way back to the active picker.
 */
function bindHover(e){var t="button, .ui-datepicker-prev, .ui-datepicker-next, .ui-datepicker-calendar td a";return e.bind("mouseout",function(e){var a=$(e.target).closest(t);a.length&&a.removeClass("ui-state-hover ui-datepicker-prev-hover ui-datepicker-next-hover")}).bind("mouseover",function(a){var i=$(a.target).closest(t);!$.datepicker._isDisabledDatepicker(instActive.inline?e.parent()[0]:instActive.input[0])&&i.length&&(i.parents(".ui-datepicker-calendar").find("a").removeClass("ui-state-hover"),i.addClass("ui-state-hover"),i.hasClass("ui-datepicker-prev")&&i.addClass("ui-datepicker-prev-hover"),i.hasClass("ui-datepicker-next")&&i.addClass("ui-datepicker-next-hover"))})}/* jQuery extend now ignores nulls! */
function extendRemove(e,t){$.extend(e,t);for(var a in t)null!=t[a]&&t[a]!=undefined||(e[a]=t[a]);return e}/* Determine whether an object is an array. */
function isArray(e){return e&&($.browser.safari&&"object"==typeof e&&e.length||e.constructor&&e.constructor.toString().match(/\Array\(\)/))}$.extend($.ui,{datepicker:{version:"@VERSION"}});var PROP_NAME="datepicker",dpuuid=(new Date).getTime(),instActive;$.extend(Datepicker.prototype,{/* Class name added to elements to indicate already configured with a date picker. */
markerClassName:"hasDatepicker",
//Keep track of the maximum number of rows displayed (see #7043)
maxRows:4,/* Debug logging (if enabled). */
log:function(){this.debug&&console.log.apply("",arguments)},
// TODO rename to "widget" when switching to widget factory
_widgetDatepicker:function(){return this.dpDiv},/* Override the default settings for all instances of the date picker.
	   @param  settings  object - the new settings to use as defaults (anonymous object)
	   @return the manager object */
setDefaults:function(e){return extendRemove(this._defaults,e||{}),this},/* Attach the date picker to a jQuery selection.
	   @param  target    element - the target input field or division or span
	   @param  settings  object - the new settings to use for this date picker instance (anonymous) */
_attachDatepicker:function(target,settings){
// check for settings on the control itself - in namespace 'date:'
var inlineSettings=null;for(var attrName in this._defaults){var attrValue=target.getAttribute("date:"+attrName);if(attrValue){inlineSettings=inlineSettings||{};try{inlineSettings[attrName]=eval(attrValue)}catch(err){inlineSettings[attrName]=attrValue}}}var nodeName=target.nodeName.toLowerCase(),inline="div"==nodeName||"span"==nodeName;target.id||(this.uuid+=1,target.id="dp"+this.uuid);var inst=this._newInst($(target),inline);inst.settings=$.extend({},settings||{},inlineSettings||{}),"input"==nodeName?this._connectDatepicker(target,inst):inline&&this._inlineDatepicker(target,inst)},/* Create a new instance object. */
_newInst:function(e,t){var a=e[0].id.replace(/([^A-Za-z0-9_-])/g,"\\\\$1");// escape jQuery meta chars
return{id:a,input:e,// associated target
selectedDay:0,selectedMonth:0,selectedYear:0,// current selection
drawMonth:0,drawYear:0,// month being drawn
inline:t,// is datepicker inline or not
dpDiv:t?// presentation div
bindHover($('<div class="'+this._inlineClass+' ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all"></div>')):this.dpDiv}},/* Attach the date picker to an input field. */
_connectDatepicker:function(e,t){var a=$(e);t.append=$([]),t.trigger=$([]),a.hasClass(this.markerClassName)||(this._attachments(a,t),a.addClass(this.markerClassName).keydown(this._doKeyDown).keypress(this._doKeyPress).keyup(this._doKeyUp).bind("setData.datepicker",function(e,a,i){t.settings[a]=i}).bind("getData.datepicker",function(e,a){return this._get(t,a)}),this._autoSize(t),$.data(e,PROP_NAME,t),
//If disabled option is true, disable the datepicker once it has been attached to the input (see ticket #5665)
t.settings.disabled&&this._disableDatepicker(e))},/* Make attachments based on settings. */
_attachments:function(e,t){var a=this._get(t,"appendText"),i=this._get(t,"isRTL");t.append&&t.append.remove(),a&&(t.append=$('<span class="'+this._appendClass+'">'+a+"</span>"),e[i?"before":"after"](t.append)),e.unbind("focus",this._showDatepicker),t.trigger&&t.trigger.remove();var r=this._get(t,"showOn");if("focus"!=r&&"both"!=r||// pop-up date picker when in the marked field
e.focus(this._showDatepicker),"button"==r||"both"==r){// pop-up date picker when button clicked
var s=this._get(t,"buttonText"),n=this._get(t,"buttonImage");t.trigger=$(this._get(t,"buttonImageOnly")?$("<img/>").addClass(this._triggerClass).attr({src:n,alt:s,title:s}):$('<button type="button"></button>').addClass(this._triggerClass).html(""==n?s:$("<img/>").attr({src:n,alt:s,title:s}))),e[i?"before":"after"](t.trigger),t.trigger.click(function(){return $.datepicker._datepickerShowing&&$.datepicker._lastInput==e[0]?$.datepicker._hideDatepicker():$.datepicker._datepickerShowing&&$.datepicker._lastInput!=e[0]?($.datepicker._hideDatepicker(),$.datepicker._showDatepicker(e[0])):$.datepicker._showDatepicker(e[0]),!1})}},/* Apply the maximum length for the date format. */
_autoSize:function(e){if(this._get(e,"autoSize")&&!e.inline){var t=new Date(2009,11,20),a=this._get(e,"dateFormat");if(a.match(/[DM]/)){var i=function(e){for(var t=0,a=0,i=0;i<e.length;i++)e[i].length>t&&(t=e[i].length,a=i);return a};t.setMonth(i(this._get(e,a.match(/MM/)?"monthNames":"monthNamesShort"))),t.setDate(i(this._get(e,a.match(/DD/)?"dayNames":"dayNamesShort"))+20-t.getDay())}e.input.attr("size",this._formatDate(e,t).length)}},/* Attach an inline date picker to a div. */
_inlineDatepicker:function(e,t){var a=$(e);a.hasClass(this.markerClassName)||(a.addClass(this.markerClassName).append(t.dpDiv).bind("setData.datepicker",function(e,a,i){t.settings[a]=i}).bind("getData.datepicker",function(e,a){return this._get(t,a)}),$.data(e,PROP_NAME,t),this._setDate(t,this._getDefaultDate(t),!0),this._updateDatepicker(t),this._updateAlternate(t),
//If disabled option is true, disable the datepicker before showing it (see ticket #5665)
t.settings.disabled&&this._disableDatepicker(e),
// Set display:block in place of inst.dpDiv.show() which won't work on disconnected elements
// http://bugs.jqueryui.com/ticket/7552 - A Datepicker created on a detached div has zero height
t.dpDiv.css("display","block"))},/* Pop-up the date picker in a "dialog" box.
	   @param  input     element - ignored
	   @param  date      string or Date - the initial date to display
	   @param  onSelect  function - the function to call when a date is selected
	   @param  settings  object - update the dialog date picker instance's settings (anonymous object)
	   @param  pos       int[2] - coordinates for the dialog's position within the screen or
	                     event - with x/y coordinates or
	                     leave empty for default (screen centre)
	   @return the manager object */
_dialogDatepicker:function(e,t,a,i,r){var s=this._dialogInst;// internal instance
if(!s){this.uuid+=1;var n="dp"+this.uuid;this._dialogInput=$('<input type="text" id="'+n+'" style="position: absolute; top: -100px; width: 0px; z-index: -10;"/>'),this._dialogInput.keydown(this._doKeyDown),$("body").append(this._dialogInput),s=this._dialogInst=this._newInst(this._dialogInput,!1),s.settings={},$.data(this._dialogInput[0],PROP_NAME,s)}if(extendRemove(s.settings,i||{}),t=t&&t.constructor==Date?this._formatDate(s,t):t,this._dialogInput.val(t),this._pos=r?r.length?r:[r.pageX,r.pageY]:null,!this._pos){var d=document.documentElement.clientWidth,o=document.documentElement.clientHeight,c=document.documentElement.scrollLeft||document.body.scrollLeft,l=document.documentElement.scrollTop||document.body.scrollTop;this._pos=// should use actual width/height below
[d/2-100+c,o/2-150+l]}
// move input on screen for focus, but hidden behind dialog
return this._dialogInput.css("left",this._pos[0]+20+"px").css("top",this._pos[1]+"px"),s.settings.onSelect=a,this._inDialog=!0,this.dpDiv.addClass(this._dialogClass),this._showDatepicker(this._dialogInput[0]),$.blockUI&&$.blockUI(this.dpDiv),$.data(this._dialogInput[0],PROP_NAME,s),this},/* Detach a datepicker from its control.
	   @param  target    element - the target input field or division or span */
_destroyDatepicker:function(e){var t=$(e),a=$.data(e,PROP_NAME);if(t.hasClass(this.markerClassName)){var i=e.nodeName.toLowerCase();$.removeData(e,PROP_NAME),"input"==i?(a.append.remove(),a.trigger.remove(),t.removeClass(this.markerClassName).unbind("focus",this._showDatepicker).unbind("keydown",this._doKeyDown).unbind("keypress",this._doKeyPress).unbind("keyup",this._doKeyUp)):"div"!=i&&"span"!=i||t.removeClass(this.markerClassName).empty()}},/* Enable the date picker to a jQuery selection.
	   @param  target    element - the target input field or division or span */
_enableDatepicker:function(e){var t=$(e),a=$.data(e,PROP_NAME);if(t.hasClass(this.markerClassName)){var i=e.nodeName.toLowerCase();if("input"==i)e.disabled=!1,a.trigger.filter("button").each(function(){this.disabled=!1}).end().filter("img").css({opacity:"1.0",cursor:""});else if("div"==i||"span"==i){var r=t.children("."+this._inlineClass);r.children().removeClass("ui-state-disabled"),r.find("select.ui-datepicker-month, select.ui-datepicker-year").removeAttr("disabled")}this._disabledInputs=$.map(this._disabledInputs,function(t){return t==e?null:t})}},/* Disable the date picker to a jQuery selection.
	   @param  target    element - the target input field or division or span */
_disableDatepicker:function(e){var t=$(e),a=$.data(e,PROP_NAME);if(t.hasClass(this.markerClassName)){var i=e.nodeName.toLowerCase();if("input"==i)e.disabled=!0,a.trigger.filter("button").each(function(){this.disabled=!0}).end().filter("img").css({opacity:"0.5",cursor:"default"});else if("div"==i||"span"==i){var r=t.children("."+this._inlineClass);r.children().addClass("ui-state-disabled"),r.find("select.ui-datepicker-month, select.ui-datepicker-year").attr("disabled","disabled")}this._disabledInputs=$.map(this._disabledInputs,function(t){return t==e?null:t}),// delete entry
this._disabledInputs[this._disabledInputs.length]=e}},/* Is the first field in a jQuery collection disabled as a datepicker?
	   @param  target    element - the target input field or division or span
	   @return boolean - true if disabled, false if enabled */
_isDisabledDatepicker:function(e){if(!e)return!1;for(var t=0;t<this._disabledInputs.length;t++)if(this._disabledInputs[t]==e)return!0;return!1},/* Retrieve the instance data for the target control.
	   @param  target  element - the target input field or division or span
	   @return  object - the associated instance data
	   @throws  error if a jQuery problem getting data */
_getInst:function(e){try{return $.data(e,PROP_NAME)}catch(t){throw"Missing instance data for this datepicker"}},/* Update or retrieve the settings for a date picker attached to an input field or division.
	   @param  target  element - the target input field or division or span
	   @param  name    object - the new settings to update or
	                   string - the name of the setting to change or retrieve,
	                   when retrieving also 'all' for all instance settings or
	                   'defaults' for all global defaults
	   @param  value   any - the new value for the setting
	                   (omit if above is an object or to retrieve a value) */
_optionDatepicker:function(e,t,a){var i=this._getInst(e);if(2==arguments.length&&"string"==typeof t)return"defaults"==t?$.extend({},$.datepicker._defaults):i?"all"==t?$.extend({},i.settings):this._get(i,t):null;var r=t||{};if("string"==typeof t&&(r={},r[t]=a),i){this._curInst==i&&this._hideDatepicker();var s=this._getDateDatepicker(e,!0),n=this._getMinMaxDate(i,"min"),d=this._getMinMaxDate(i,"max");extendRemove(i.settings,r),
// reformat the old minDate/maxDate values if dateFormat changes and a new minDate/maxDate isn't provided
null!==n&&r.dateFormat!==undefined&&r.minDate===undefined&&(i.settings.minDate=this._formatDate(i,n)),null!==d&&r.dateFormat!==undefined&&r.maxDate===undefined&&(i.settings.maxDate=this._formatDate(i,d)),this._attachments($(e),i),this._autoSize(i),this._setDate(i,s),this._updateAlternate(i),this._updateDatepicker(i)}},
// change method deprecated
_changeDatepicker:function(e,t,a){this._optionDatepicker(e,t,a)},/* Redraw the date picker attached to an input field or division.
	   @param  target  element - the target input field or division or span */
_refreshDatepicker:function(e){var t=this._getInst(e);t&&this._updateDatepicker(t)},/* Set the dates for a jQuery selection.
	   @param  target   element - the target input field or division or span
	   @param  date     Date - the new date */
_setDateDatepicker:function(e,t){var a=this._getInst(e);a&&(this._setDate(a,t),this._updateDatepicker(a),this._updateAlternate(a))},/* Get the date(s) for the first entry in a jQuery selection.
	   @param  target     element - the target input field or division or span
	   @param  noDefault  boolean - true if no default date is to be used
	   @return Date - the current date */
_getDateDatepicker:function(e,t){var a=this._getInst(e);return a&&!a.inline&&this._setDateFromField(a,t),a?this._getDate(a):null},/* Handle keystrokes. */
_doKeyDown:function(e){var t=$.datepicker._getInst(e.target),a=!0,i=t.dpDiv.is(".ui-datepicker-rtl");if(t._keyEvent=!0,$.datepicker._datepickerShowing)switch(e.keyCode){case 9:$.datepicker._hideDatepicker(),a=!1;break;// hide on tab out
case 13:var r=$("td."+$.datepicker._dayOverClass+":not(."+$.datepicker._currentClass+")",t.dpDiv);r[0]&&$.datepicker._selectDay(e.target,t.selectedMonth,t.selectedYear,r[0]);var s=$.datepicker._get(t,"onSelect");if(s){var n=$.datepicker._formatDate(t);
// trigger custom callback
s.apply(t.input?t.input[0]:null,[n,t])}else $.datepicker._hideDatepicker();return!1;// select the value on enter
case 27:$.datepicker._hideDatepicker();break;// hide on escape
case 33:$.datepicker._adjustDate(e.target,e.ctrlKey?-$.datepicker._get(t,"stepBigMonths"):-$.datepicker._get(t,"stepMonths"),"M");break;// previous month/year on page up/+ ctrl
case 34:$.datepicker._adjustDate(e.target,e.ctrlKey?+$.datepicker._get(t,"stepBigMonths"):+$.datepicker._get(t,"stepMonths"),"M");break;// next month/year on page down/+ ctrl
case 35:(e.ctrlKey||e.metaKey)&&$.datepicker._clearDate(e.target),a=e.ctrlKey||e.metaKey;break;// clear on ctrl or command +end
case 36:(e.ctrlKey||e.metaKey)&&$.datepicker._gotoToday(e.target),a=e.ctrlKey||e.metaKey;break;// current on ctrl or command +home
case 37:(e.ctrlKey||e.metaKey)&&$.datepicker._adjustDate(e.target,i?1:-1,"D"),a=e.ctrlKey||e.metaKey,
// -1 day on ctrl or command +left
e.originalEvent.altKey&&$.datepicker._adjustDate(e.target,e.ctrlKey?-$.datepicker._get(t,"stepBigMonths"):-$.datepicker._get(t,"stepMonths"),"M");
// next month/year on alt +left on Mac
break;case 38:(e.ctrlKey||e.metaKey)&&$.datepicker._adjustDate(e.target,-7,"D"),a=e.ctrlKey||e.metaKey;break;// -1 week on ctrl or command +up
case 39:(e.ctrlKey||e.metaKey)&&$.datepicker._adjustDate(e.target,i?-1:1,"D"),a=e.ctrlKey||e.metaKey,
// +1 day on ctrl or command +right
e.originalEvent.altKey&&$.datepicker._adjustDate(e.target,e.ctrlKey?+$.datepicker._get(t,"stepBigMonths"):+$.datepicker._get(t,"stepMonths"),"M");
// next month/year on alt +right
break;case 40:(e.ctrlKey||e.metaKey)&&$.datepicker._adjustDate(e.target,7,"D"),a=e.ctrlKey||e.metaKey;break;// +1 week on ctrl or command +down
default:a=!1}else 36==e.keyCode&&e.ctrlKey?// display the date picker on ctrl+home
$.datepicker._showDatepicker(this):a=!1;a&&(e.preventDefault(),e.stopPropagation())},/* Filter entered characters - based on date format. */
_doKeyPress:function(e){var t=$.datepicker._getInst(e.target);if($.datepicker._get(t,"constrainInput")){var a=$.datepicker._possibleChars($.datepicker._get(t,"dateFormat")),i=String.fromCharCode(e.charCode==undefined?e.keyCode:e.charCode);return e.ctrlKey||e.metaKey||i<" "||!a||a.indexOf(i)>-1}},/* Synchronise manual entry and field/alternate field. */
_doKeyUp:function(e){var t=$.datepicker._getInst(e.target);if(t.input.val()!=t.lastVal)try{var a=$.datepicker.parseDate($.datepicker._get(t,"dateFormat"),t.input?t.input.val():null,$.datepicker._getFormatConfig(t));a&&(// only if valid
$.datepicker._setDateFromField(t),$.datepicker._updateAlternate(t),$.datepicker._updateDatepicker(t))}catch(i){$.datepicker.log(i)}return!0},/* Pop-up the date picker for a given input field.
       If false returned from beforeShow event handler do not show. 
	   @param  input  element - the input field attached to the date picker or
	                  event - if triggered by focus */
_showDatepicker:function(e){if(e=e.target||e,"input"!=e.nodeName.toLowerCase()&&(// find from button/image trigger
e=$("input",e.parentNode)[0]),!$.datepicker._isDisabledDatepicker(e)&&$.datepicker._lastInput!=e){var t=$.datepicker._getInst(e);$.datepicker._curInst&&$.datepicker._curInst!=t&&($.datepicker._curInst.dpDiv.stop(!0,!0),t&&$.datepicker._datepickerShowing&&$.datepicker._hideDatepicker($.datepicker._curInst.input[0]));var a=$.datepicker._get(t,"beforeShow"),i=a?a.apply(e,[e,t]):{};if(i!==!1){extendRemove(t.settings,i),t.lastVal=null,$.datepicker._lastInput=e,$.datepicker._setDateFromField(t),$.datepicker._inDialog&&(// hide cursor
e.value=""),$.datepicker._pos||(// position below input
$.datepicker._pos=$.datepicker._findPos(e),$.datepicker._pos[1]+=e.offsetHeight);var r=!1;$(e).parents().each(function(){return r|="fixed"==$(this).css("position"),!r}),r&&$.browser.opera&&(// correction for Opera when fixed and scrolled
$.datepicker._pos[0]-=document.documentElement.scrollLeft,$.datepicker._pos[1]-=document.documentElement.scrollTop);var s={left:$.datepicker._pos[0],top:$.datepicker._pos[1]};if($.datepicker._pos=null,
//to avoid flashes on Firefox
t.dpDiv.empty(),
// determine sizing offscreen
t.dpDiv.css({position:"absolute",display:"block",top:"-1000px"}),$.datepicker._updateDatepicker(t),
// fix width for dynamic number of date pickers
// and adjust position before showing
s=$.datepicker._checkOffset(t,s,r),t.dpDiv.css({position:$.datepicker._inDialog&&$.blockUI?"static":r?"fixed":"absolute",display:"none",left:s.left+"px",top:s.top+"px"}),!t.inline){var n=$.datepicker._get(t,"showAnim"),d=$.datepicker._get(t,"duration"),o=function(){var e=t.dpDiv.find("iframe.ui-datepicker-cover");// IE6- only
if(e.length){var a=$.datepicker._getBorders(t.dpDiv);e.css({left:-a[0],top:-a[1],width:t.dpDiv.outerWidth(),height:t.dpDiv.outerHeight()})}};t.dpDiv.zIndex($(e).zIndex()+1),$.datepicker._datepickerShowing=!0,$.effects&&$.effects[n]?t.dpDiv.show(n,$.datepicker._get(t,"showOptions"),d,o):t.dpDiv[n||"show"](n?d:null,o),n&&d||o(),t.input.is(":visible")&&!t.input.is(":disabled")&&t.input.focus(),$.datepicker._curInst=t}}}},/* Generate the date picker content. */
_updateDatepicker:function(e){var t=this;t.maxRows=4;//Reset the max number of rows being displayed (see #7043)
var a=$.datepicker._getBorders(e.dpDiv);instActive=e,// for delegate hover events
e.dpDiv.empty().append(this._generateHTML(e));var i=e.dpDiv.find("iframe.ui-datepicker-cover");// IE6- only
i.length&&//avoid call to outerXXXX() when not in IE6
i.css({left:-a[0],top:-a[1],width:e.dpDiv.outerWidth(),height:e.dpDiv.outerHeight()}),e.dpDiv.find("."+this._dayOverClass+" a").mouseover();var r=this._getNumberOfMonths(e),s=r[1],n=17;
// deffered render of the years select (to avoid flashes on Firefox) 
if(e.dpDiv.removeClass("ui-datepicker-multi-2 ui-datepicker-multi-3 ui-datepicker-multi-4").width(""),s>1&&e.dpDiv.addClass("ui-datepicker-multi-"+s).css("width",n*s+"em"),e.dpDiv[(1!=r[0]||1!=r[1]?"add":"remove")+"Class"]("ui-datepicker-multi"),e.dpDiv[(this._get(e,"isRTL")?"add":"remove")+"Class"]("ui-datepicker-rtl"),e==$.datepicker._curInst&&$.datepicker._datepickerShowing&&e.input&&
// #6694 - don't focus the input if it's already focused
// this breaks the change event in IE
e.input.is(":visible")&&!e.input.is(":disabled")&&e.input[0]!=document.activeElement&&e.input.focus(),e.yearshtml){var d=e.yearshtml;setTimeout(function(){
//assure that inst.yearshtml didn't change.
d===e.yearshtml&&e.yearshtml&&e.dpDiv.find("select.ui-datepicker-year:first").replaceWith(e.yearshtml),d=e.yearshtml=null},0)}},/* Retrieve the size of left and top borders for an element.
	   @param  elem  (jQuery object) the element of interest
	   @return  (number[2]) the left and top borders */
_getBorders:function(e){var t=function(e){return{thin:1,medium:2,thick:3}[e]||e};return[parseFloat(t(e.css("border-left-width"))),parseFloat(t(e.css("border-top-width")))]},/* Check positioning to remain on screen. */
_checkOffset:function(e,t,a){var i=e.dpDiv.outerWidth(),r=e.dpDiv.outerHeight(),s=e.input?e.input.outerWidth():0,n=e.input?e.input.outerHeight():0,d=document.documentElement.clientWidth+$(document).scrollLeft(),o=document.documentElement.clientHeight+$(document).scrollTop();
// now check if datepicker is showing outside window viewport - move to a better place if so.
return t.left-=this._get(e,"isRTL")?i-s:0,t.left-=a&&t.left==e.input.offset().left?$(document).scrollLeft():0,t.top-=a&&t.top==e.input.offset().top+n?$(document).scrollTop():0,t.left-=Math.min(t.left,t.left+i>d&&d>i?Math.abs(t.left+i-d):0),t.top-=Math.min(t.top,t.top+r>o&&o>r?Math.abs(r+n):0),t},/* Find an object's position on the screen. */
_findPos:function(e){for(var t=this._getInst(e),a=this._get(t,"isRTL");e&&("hidden"==e.type||1!=e.nodeType||$.expr.filters.hidden(e));)e=e[a?"previousSibling":"nextSibling"];var i=$(e).offset();return[i.left,i.top]},/* Hide the date picker from view.
	   @param  input  element - the input field attached to the date picker */
_hideDatepicker:function(e){var t=this._curInst;if(t&&(!e||t==$.data(e,PROP_NAME))&&this._datepickerShowing){var a=this._get(t,"showAnim"),i=this._get(t,"duration"),r=function(){$.datepicker._tidyDialog(t)};$.effects&&$.effects[a]?t.dpDiv.hide(a,$.datepicker._get(t,"showOptions"),i,r):t.dpDiv["slideDown"==a?"slideUp":"fadeIn"==a?"fadeOut":"hide"](a?i:null,r),a||r(),this._datepickerShowing=!1;var s=this._get(t,"onClose");s&&s.apply(t.input?t.input[0]:null,[t.input?t.input.val():"",t]),this._lastInput=null,this._inDialog&&(this._dialogInput.css({position:"absolute",left:"0",top:"-100px"}),$.blockUI&&($.unblockUI(),$("body").append(this.dpDiv))),this._inDialog=!1}},/* Tidy up after a dialog display. */
_tidyDialog:function(e){e.dpDiv.removeClass(this._dialogClass).unbind(".ui-datepicker-calendar")},/* Close date picker if clicked elsewhere. */
_checkExternalClick:function(e){if($.datepicker._curInst){var t=$(e.target),a=$.datepicker._getInst(t[0]);(t[0].id==$.datepicker._mainDivId||0!=t.parents("#"+$.datepicker._mainDivId).length||t.hasClass($.datepicker.markerClassName)||t.closest("."+$.datepicker._triggerClass).length||!$.datepicker._datepickerShowing||$.datepicker._inDialog&&$.blockUI)&&(!t.hasClass($.datepicker.markerClassName)||$.datepicker._curInst==a)||$.datepicker._hideDatepicker()}},/* Adjust one of the date sub-fields. */
_adjustDate:function(e,t,a){var i=$(e),r=this._getInst(i[0]);this._isDisabledDatepicker(i[0])||(this._adjustInstDate(r,t+("M"==a?this._get(r,"showCurrentAtPos"):0),// undo positioning
a),this._updateDatepicker(r))},/* Action for current link. */
_gotoToday:function(e){var t=$(e),a=this._getInst(t[0]);if(this._get(a,"gotoCurrent")&&a.currentDay)a.selectedDay=a.currentDay,a.drawMonth=a.selectedMonth=a.currentMonth,a.drawYear=a.selectedYear=a.currentYear;else{var i=new Date;a.selectedDay=i.getDate(),a.drawMonth=a.selectedMonth=i.getMonth(),a.drawYear=a.selectedYear=i.getFullYear()}this._notifyChange(a),this._adjustDate(t)},/* Action for selecting a new month/year. */
_selectMonthYear:function(e,t,a){var i=$(e),r=this._getInst(i[0]);r["selected"+("M"==a?"Month":"Year")]=r["draw"+("M"==a?"Month":"Year")]=parseInt(t.options[t.selectedIndex].value,10),this._notifyChange(r),this._adjustDate(i)},/* Action for selecting a day. */
_selectDay:function(e,t,a,i){var r=$(e);if(!$(i).hasClass(this._unselectableClass)&&!this._isDisabledDatepicker(r[0])){var s=this._getInst(r[0]);s.selectedDay=s.currentDay=$("a",i).html(),s.selectedMonth=s.currentMonth=t,s.selectedYear=s.currentYear=a,this._selectDate(e,this._formatDate(s,s.currentDay,s.currentMonth,s.currentYear))}},/* Erase the input field and hide the date picker. */
_clearDate:function(e){var t=$(e);this._getInst(t[0]);this._selectDate(t,"")},/* Update the input field with the selected date. */
_selectDate:function(e,t){var a=$(e),i=this._getInst(a[0]);t=null!=t?t:this._formatDate(i),i.input&&i.input.val(t),this._updateAlternate(i);var r=this._get(i,"onSelect");r?r.apply(i.input?i.input[0]:null,[t,i]):i.input&&i.input.trigger("change"),// fire the change event
i.inline?this._updateDatepicker(i):(this._hideDatepicker(),this._lastInput=i.input[0],"object"!=typeof i.input[0]&&i.input.focus(),// restore focus
this._lastInput=null)},/* Update any alternate field to synchronise with the main field. */
_updateAlternate:function(e){var t=this._get(e,"altField");if(t){// update alternate field too
var a=this._get(e,"altFormat")||this._get(e,"dateFormat"),i=this._getDate(e),r=this.formatDate(a,i,this._getFormatConfig(e));$(t).each(function(){$(this).val(r)})}},/* Set as beforeShowDay function to prevent selection of weekends.
	   @param  date  Date - the date to customise
	   @return [boolean, string] - is this date selectable?, what is its CSS class? */
noWeekends:function(e){var t=e.getDay();return[t>0&&t<6,""]},/* Set as calculateWeek to determine the week of the year based on the ISO 8601 definition.
	   @param  date  Date - the date to get the week for
	   @return  number - the number of the week within the year that contains this date */
iso8601Week:function(e){var t=new Date(e.getTime());
// Find Thursday of this week starting on Monday
t.setDate(t.getDate()+4-(t.getDay()||7));var a=t.getTime();// Compare with Jan 1
return t.setMonth(0),t.setDate(1),Math.floor(Math.round((a-t)/864e5)/7)+1},/* Parse a string value into a date object.
	   See formatDate below for the possible formats.

	   @param  format    string - the expected format of the date
	   @param  value     string - the date in the above format
	   @param  settings  Object - attributes include:
	                     shortYearCutoff  number - the cutoff year for determining the century (optional)
	                     dayNamesShort    string[7] - abbreviated names of the days from Sunday (optional)
	                     dayNames         string[7] - names of the days from Sunday (optional)
	                     monthNamesShort  string[12] - abbreviated names of the months (optional)
	                     monthNames       string[12] - names of the months (optional)
	   @return  Date - the extracted date value or null if value is blank */
parseDate:function(e,t,a){if(null==e||null==t)throw"Invalid arguments";if(t="object"==typeof t?t.toString():t+"",""==t)return null;var i=(a?a.shortYearCutoff:null)||this._defaults.shortYearCutoff;i="string"!=typeof i?i:(new Date).getFullYear()%100+parseInt(i,10);for(var r=(a?a.dayNamesShort:null)||this._defaults.dayNamesShort,s=(a?a.dayNames:null)||this._defaults.dayNames,n=(a?a.monthNamesShort:null)||this._defaults.monthNamesShort,d=(a?a.monthNames:null)||this._defaults.monthNames,o=-1,c=-1,l=-1,u=-1,h=!1,p=function(t){var a=m+1<e.length&&e.charAt(m+1)==t;return a&&m++,a},g=function(e){var a=p(e),i="@"==e?14:"!"==e?20:"y"==e&&a?4:"o"==e?3:2,r=new RegExp("^\\d{1,"+i+"}"),s=t.substring(k).match(r);if(!s)throw"Missing number at position "+k;return k+=s[0].length,parseInt(s[0],10)},_=function(e,a,i){var r=$.map(p(e)?i:a,function(e,t){return[[t,e]]}).sort(function(e,t){return-(e[1].length-t[1].length)}),s=-1;if($.each(r,function(e,a){var i=a[1];if(t.substr(k,i.length).toLowerCase()==i.toLowerCase())return s=a[0],k+=i.length,!1}),s!=-1)return s+1;throw"Unknown name at position "+k},f=function(){if(t.charAt(k)!=e.charAt(m))throw"Unexpected literal at position "+k;k++},k=0,m=0;m<e.length;m++)if(h)"'"!=e.charAt(m)||p("'")?f():h=!1;else switch(e.charAt(m)){case"d":l=g("d");break;case"D":_("D",r,s);break;case"o":u=g("o");break;case"m":c=g("m");break;case"M":c=_("M",n,d);break;case"y":o=g("y");break;case"@":var D=new Date(g("@"));o=D.getFullYear(),c=D.getMonth()+1,l=D.getDate();break;case"!":var D=new Date((g("!")-this._ticksTo1970)/1e4);o=D.getFullYear(),c=D.getMonth()+1,l=D.getDate();break;case"'":p("'")?f():h=!0;break;default:f()}if(k<t.length)throw"Extra/unparsed characters found in date: "+t.substring(k);if(o==-1?o=(new Date).getFullYear():o<100&&(o+=(new Date).getFullYear()-(new Date).getFullYear()%100+(o<=i?0:-100)),u>-1)for(c=1,l=u;;){var v=this._getDaysInMonth(o,c-1);if(l<=v)break;c++,l-=v}var D=this._daylightSavingAdjust(new Date(o,c-1,l));if(D.getFullYear()!=o||D.getMonth()+1!=c||D.getDate()!=l)throw"Invalid date";// E.g. 31/02/00
return D},/* Standard date formats. */
ATOM:"yy-mm-dd",// RFC 3339 (ISO 8601)
COOKIE:"D, dd M yy",ISO_8601:"yy-mm-dd",RFC_822:"D, d M y",RFC_850:"DD, dd-M-y",RFC_1036:"D, d M y",RFC_1123:"D, d M yy",RFC_2822:"D, d M yy",RSS:"D, d M y",// RFC 822
TICKS:"!",TIMESTAMP:"@",W3C:"yy-mm-dd",// ISO 8601
_ticksTo1970:24*(718685+Math.floor(492.5)-Math.floor(19.7)+Math.floor(4.925))*60*60*1e7,/* Format a date object into a string value.
	   The format can be combinations of the following:
	   d  - day of month (no leading zero)
	   dd - day of month (two digit)
	   o  - day of year (no leading zeros)
	   oo - day of year (three digit)
	   D  - day name short
	   DD - day name long
	   m  - month of year (no leading zero)
	   mm - month of year (two digit)
	   M  - month name short
	   MM - month name long
	   y  - year (two digit)
	   yy - year (four digit)
	   @ - Unix timestamp (ms since 01/01/1970)
	   ! - Windows ticks (100ns since 01/01/0001)
	   '...' - literal text
	   '' - single quote

	   @param  format    string - the desired format of the date
	   @param  date      Date - the date value to format
	   @param  settings  Object - attributes include:
	                     dayNamesShort    string[7] - abbreviated names of the days from Sunday (optional)
	                     dayNames         string[7] - names of the days from Sunday (optional)
	                     monthNamesShort  string[12] - abbreviated names of the months (optional)
	                     monthNames       string[12] - names of the months (optional)
	   @return  string - the date in the above format */
formatDate:function(e,t,a){if(!t)return"";var i=(a?a.dayNamesShort:null)||this._defaults.dayNamesShort,r=(a?a.dayNames:null)||this._defaults.dayNames,s=(a?a.monthNamesShort:null)||this._defaults.monthNamesShort,n=(a?a.monthNames:null)||this._defaults.monthNames,d=function(t){var a=h+1<e.length&&e.charAt(h+1)==t;return a&&h++,a},o=function(e,t,a){var i=""+t;if(d(e))for(;i.length<a;)i="0"+i;return i},c=function(e,t,a,i){return d(e)?i[t]:a[t]},l="",u=!1;if(t)for(var h=0;h<e.length;h++)if(u)"'"!=e.charAt(h)||d("'")?l+=e.charAt(h):u=!1;else switch(e.charAt(h)){case"d":l+=o("d",t.getDate(),2);break;case"D":l+=c("D",t.getDay(),i,r);break;case"o":l+=o("o",Math.round((new Date(t.getFullYear(),t.getMonth(),t.getDate()).getTime()-new Date(t.getFullYear(),0,0).getTime())/864e5),3);break;case"m":l+=o("m",t.getMonth()+1,2);break;case"M":l+=c("M",t.getMonth(),s,n);break;case"y":l+=d("y")?t.getFullYear():(t.getYear()%100<10?"0":"")+t.getYear()%100;break;case"@":l+=t.getTime();break;case"!":l+=1e4*t.getTime()+this._ticksTo1970;break;case"'":d("'")?l+="'":u=!0;break;default:l+=e.charAt(h)}return l},/* Extract all possible characters from the date format. */
_possibleChars:function(e){for(var t="",a=!1,i=function(t){var a=r+1<e.length&&e.charAt(r+1)==t;return a&&r++,a},r=0;r<e.length;r++)if(a)"'"!=e.charAt(r)||i("'")?t+=e.charAt(r):a=!1;else switch(e.charAt(r)){case"d":case"m":case"y":case"@":t+="0123456789";break;case"D":case"M":return null;// Accept anything
case"'":i("'")?t+="'":a=!0;break;default:t+=e.charAt(r)}return t},/* Get a setting value, defaulting if necessary. */
_get:function(e,t){return e.settings[t]!==undefined?e.settings[t]:this._defaults[t]},/* Parse existing date and initialise date picker. */
_setDateFromField:function(e,t){if(e.input.val()!=e.lastVal){var a,i,r=this._get(e,"dateFormat"),s=e.lastVal=e.input?e.input.val():null;a=i=this._getDefaultDate(e);var n=this._getFormatConfig(e);try{a=this.parseDate(r,s,n)||i}catch(d){this.log(d),s=t?"":s}e.selectedDay=a.getDate(),e.drawMonth=e.selectedMonth=a.getMonth(),e.drawYear=e.selectedYear=a.getFullYear(),e.currentDay=s?a.getDate():0,e.currentMonth=s?a.getMonth():0,e.currentYear=s?a.getFullYear():0,this._adjustInstDate(e)}},/* Retrieve the default date shown on opening. */
_getDefaultDate:function(e){return this._restrictMinMax(e,this._determineDate(e,this._get(e,"defaultDate"),new Date))},/* A date may be specified as an exact value or a relative one. */
_determineDate:function(e,t,a){var i=function(e){var t=new Date;return t.setDate(t.getDate()+e),t},r=function(t){try{return $.datepicker.parseDate($.datepicker._get(e,"dateFormat"),t,$.datepicker._getFormatConfig(e))}catch(a){}for(var i=(t.toLowerCase().match(/^c/)?$.datepicker._getDate(e):null)||new Date,r=i.getFullYear(),s=i.getMonth(),n=i.getDate(),d=/([+-]?[0-9]+)\s*(d|D|w|W|m|M|y|Y)?/g,o=d.exec(t);o;){switch(o[2]||"d"){case"d":case"D":n+=parseInt(o[1],10);break;case"w":case"W":n+=7*parseInt(o[1],10);break;case"m":case"M":s+=parseInt(o[1],10),n=Math.min(n,$.datepicker._getDaysInMonth(r,s));break;case"y":case"Y":r+=parseInt(o[1],10),n=Math.min(n,$.datepicker._getDaysInMonth(r,s))}o=d.exec(t)}return new Date(r,s,n)},s=null==t||""===t?a:"string"==typeof t?r(t):"number"==typeof t?isNaN(t)?a:i(t):new Date(t.getTime());return s=s&&"Invalid Date"==s.toString()?a:s,s&&(s.setHours(0),s.setMinutes(0),s.setSeconds(0),s.setMilliseconds(0)),this._daylightSavingAdjust(s)},/* Handle switch to/from daylight saving.
	   Hours may be non-zero on daylight saving cut-over:
	   > 12 when midnight changeover, but then cannot generate
	   midnight datetime, so jump to 1AM, otherwise reset.
	   @param  date  (Date) the date to check
	   @return  (Date) the corrected date */
_daylightSavingAdjust:function(e){return e?(e.setHours(e.getHours()>12?e.getHours()+2:0),e):null},/* Set the date(s) directly. */
_setDate:function(e,t,a){var i=!t,r=e.selectedMonth,s=e.selectedYear,n=this._restrictMinMax(e,this._determineDate(e,t,new Date));e.selectedDay=e.currentDay=n.getDate(),e.drawMonth=e.selectedMonth=e.currentMonth=n.getMonth(),e.drawYear=e.selectedYear=e.currentYear=n.getFullYear(),r==e.selectedMonth&&s==e.selectedYear||a||this._notifyChange(e),this._adjustInstDate(e),e.input&&e.input.val(i?"":this._formatDate(e))},/* Retrieve the date(s) directly. */
_getDate:function(e){var t=!e.currentYear||e.input&&""==e.input.val()?null:this._daylightSavingAdjust(new Date(e.currentYear,e.currentMonth,e.currentDay));return t},/* Generate the HTML for the current state of the date picker. */
_generateHTML:function(e){var t=new Date;t=this._daylightSavingAdjust(new Date(t.getFullYear(),t.getMonth(),t.getDate()));// clear time
var a=this._get(e,"isRTL"),i=this._get(e,"showButtonPanel"),r=this._get(e,"hideIfNoPrevNext"),s=this._get(e,"navigationAsDateFormat"),n=this._getNumberOfMonths(e),d=this._get(e,"showCurrentAtPos"),o=this._get(e,"stepMonths"),c=1!=n[0]||1!=n[1],l=this._daylightSavingAdjust(e.currentDay?new Date(e.currentYear,e.currentMonth,e.currentDay):new Date(9999,9,9)),u=this._getMinMaxDate(e,"min"),h=this._getMinMaxDate(e,"max"),p=e.drawMonth-d,g=e.drawYear;if(p<0&&(p+=12,g--),h){var _=this._daylightSavingAdjust(new Date(h.getFullYear(),h.getMonth()-n[0]*n[1]+1,h.getDate()));for(_=u&&_<u?u:_;this._daylightSavingAdjust(new Date(g,p,1))>_;)p--,p<0&&(p=11,g--)}e.drawMonth=p,e.drawYear=g;var f=this._get(e,"prevText");f=s?this.formatDate(f,this._daylightSavingAdjust(new Date(g,p-o,1)),this._getFormatConfig(e)):f;var k=this._canAdjustMonth(e,-1,g,p)?'<a class="ui-datepicker-prev ui-corner-all" onclick="DP_jQuery_'+dpuuid+".datepicker._adjustDate('#"+e.id+"', -"+o+", 'M');\" title=\""+f+'"><span class="ui-icon ui-icon-circle-triangle-'+(a?"e":"w")+'">'+f+"</span></a>":r?"":'<a class="ui-datepicker-prev ui-corner-all ui-state-disabled" title="'+f+'"><span class="ui-icon ui-icon-circle-triangle-'+(a?"e":"w")+'">'+f+"</span></a>",m=this._get(e,"nextText");m=s?this.formatDate(m,this._daylightSavingAdjust(new Date(g,p+o,1)),this._getFormatConfig(e)):m;var D=this._canAdjustMonth(e,1,g,p)?'<a class="ui-datepicker-next ui-corner-all" onclick="DP_jQuery_'+dpuuid+".datepicker._adjustDate('#"+e.id+"', +"+o+", 'M');\" title=\""+m+'"><span class="ui-icon ui-icon-circle-triangle-'+(a?"w":"e")+'">'+m+"</span></a>":r?"":'<a class="ui-datepicker-next ui-corner-all ui-state-disabled" title="'+m+'"><span class="ui-icon ui-icon-circle-triangle-'+(a?"w":"e")+'">'+m+"</span></a>",v=this._get(e,"currentText"),y=this._get(e,"gotoCurrent")&&e.currentDay?l:t;v=s?this.formatDate(v,y,this._getFormatConfig(e)):v;var M=e.inline?"":'<button type="button" class="ui-datepicker-close ui-state-default ui-priority-primary ui-corner-all" onclick="DP_jQuery_'+dpuuid+'.datepicker._hideDatepicker();">'+this._get(e,"closeText")+"</button>",b=i?'<div class="ui-datepicker-buttonpane ui-widget-content">'+(a?M:"")+(this._isInRange(e,y)?'<button type="button" class="ui-datepicker-current ui-state-default ui-priority-secondary ui-corner-all" onclick="DP_jQuery_'+dpuuid+".datepicker._gotoToday('#"+e.id+"');\">"+v+"</button>":"")+(a?"":M)+"</div>":"",w=parseInt(this._get(e,"firstDay"),10);w=isNaN(w)?0:w;for(var C=this._get(e,"showWeek"),I=this._get(e,"dayNames"),x=(this._get(e,"dayNamesShort"),this._get(e,"dayNamesMin")),N=this._get(e,"monthNames"),S=this._get(e,"monthNamesShort"),Y=this._get(e,"beforeShowDay"),A=this._get(e,"showOtherMonths"),F=this._get(e,"selectOtherMonths"),T=(this._get(e,"calculateWeek")||this.iso8601Week,this._getDefaultDate(e)),j="",O=0;O<n[0];O++){var K="";this.maxRows=4;for(var P=0;P<n[1];P++){var R=this._daylightSavingAdjust(new Date(g,p,e.selectedDay)),E=" ui-corner-all",W="";if(c){if(W+='<div class="ui-datepicker-group',n[1]>1)switch(P){case 0:W+=" ui-datepicker-group-first",E=" ui-corner-"+(a?"right":"left");break;case n[1]-1:W+=" ui-datepicker-group-last",E=" ui-corner-"+(a?"left":"right");break;default:W+=" ui-datepicker-group-middle",E=""}W+='">'}W+='<div class="ui-datepicker-header ui-widget-header ui-helper-clearfix'+E+'">'+(/all|left/.test(E)&&0==O?a?D:k:"")+(/all|right/.test(E)&&0==O?a?k:D:"")+this._generateMonthYearHeader(e,p,g,u,h,O>0||P>0,N,S)+// draw month headers
'</div><table class="ui-datepicker-calendar"><thead><tr>';for(var L=C?'<th class="ui-datepicker-week-col">'+this._get(e,"weekHeader")+"</th>":"",H=0;H<7;H++){// days of the week
var z=(H+w)%7;L+="<th"+((H+w+6)%7>=5?' class="ui-datepicker-week-end"':"")+'><span title="'+I[z]+'">'+x[z]+"</span></th>"}W+=L+"</tr></thead><tbody>";var U=this._getDaysInMonth(g,p);g==e.selectedYear&&p==e.selectedMonth&&(e.selectedDay=Math.min(e.selectedDay,U));var B=(this._getFirstDayOfMonth(g,p)-w+7)%7,V=Math.ceil((B+U)/7),Q=c&&this.maxRows>V?this.maxRows:V;//If multiple months, use the higher number of rows (see #7043)
this.maxRows=Q;for(var J=this._daylightSavingAdjust(new Date(g,p,1-B)),X=0;X<Q;X++){// create date picker rows
W+="<tr>";for(var Z=C?'<td class="ui-datepicker-week-col">'+this._get(e,"calculateWeek")(J)+"</td>":"",H=0;H<7;H++){// create date picker days
var q=Y?Y.apply(e.input?e.input[0]:null,[J]):[!0,""],G=J.getMonth()!=p,ee=G&&!F||!q[0]||u&&J<u||h&&J>h;Z+='<td class="'+((H+w+6)%7>=5?" ui-datepicker-week-end":"")+(// highlight weekends
G?" ui-datepicker-other-month":"")+(// highlight days from other months
J.getTime()==R.getTime()&&p==e.selectedMonth&&e._keyEvent||// user pressed key
T.getTime()==J.getTime()&&T.getTime()==R.getTime()?
// or defaultDate is current printedDate and defaultDate is selectedDate
" "+this._dayOverClass:"")+(// highlight selected day
ee?" "+this._unselectableClass+" ui-state-disabled":"")+(// highlight unselectable days
G&&!A?"":" "+q[1]+(// highlight custom dates
J.getTime()==l.getTime()?" "+this._currentClass:"")+(// highlight selected day
J.getTime()==t.getTime()?" ui-datepicker-today":""))+'"'+(// highlight today (if different)
G&&!A||!q[2]?"":' title="'+q[2]+'"')+(// cell title
ee?"":' onclick="DP_jQuery_'+dpuuid+".datepicker._selectDay('#"+e.id+"',"+J.getMonth()+","+J.getFullYear()+', this);return false;"')+">"+(// actions
G&&!A?"&#xa0;":// display for other months
ee?'<span class="ui-state-default">'+J.getDate()+"</span>":'<a class="ui-state-default'+(J.getTime()==t.getTime()?" ui-state-highlight":"")+(J.getTime()==l.getTime()?" ui-state-active":"")+(// highlight selected day
G?" ui-priority-secondary":"")+// distinguish dates from other months
'" href="#">'+J.getDate()+"</a>")+"</td>",// display selectable date
J.setDate(J.getDate()+1),J=this._daylightSavingAdjust(J)}W+=Z+"</tr>"}p++,p>11&&(p=0,g++),W+="</tbody></table>"+(c?"</div>"+(n[0]>0&&P==n[1]-1?'<div class="ui-datepicker-row-break"></div>':""):""),K+=W}j+=K}return j+=b+($.browser.msie&&parseInt($.browser.version,10)<7&&!e.inline?'<iframe src="javascript:false;" class="ui-datepicker-cover" frameborder="0"></iframe>':""),e._keyEvent=!1,j},/* Generate the month and year header. */
_generateMonthYearHeader:function(e,t,a,i,r,s,n,d){var o=this._get(e,"changeMonth"),c=this._get(e,"changeYear"),l=this._get(e,"showMonthAfterYear"),u='<div class="ui-datepicker-title">',h="";
// month selection
if(s||!o)h+='<span class="ui-datepicker-month">'+n[t]+"</span>";else{var p=i&&i.getFullYear()==a,g=r&&r.getFullYear()==a;h+='<select class="ui-datepicker-month" onchange="DP_jQuery_'+dpuuid+".datepicker._selectMonthYear('#"+e.id+"', this, 'M');\" >";for(var _=0;_<12;_++)(!p||_>=i.getMonth())&&(!g||_<=r.getMonth())&&(h+='<option value="'+_+'"'+(_==t?' selected="selected"':"")+">"+d[_]+"</option>");h+="</select>"}
// year selection
if(l||(u+=h+(!s&&o&&c?"":"&#xa0;")),!e.yearshtml)if(e.yearshtml="",s||!c)u+='<span class="ui-datepicker-year">'+a+"</span>";else{
// determine range of years to display
var f=this._get(e,"yearRange").split(":"),k=(new Date).getFullYear(),m=function(e){var t=e.match(/c[+-].*/)?a+parseInt(e.substring(1),10):e.match(/[+-].*/)?k+parseInt(e,10):parseInt(e,10);return isNaN(t)?k:t},D=m(f[0]),v=Math.max(D,m(f[1]||""));for(D=i?Math.max(D,i.getFullYear()):D,v=r?Math.min(v,r.getFullYear()):v,e.yearshtml+='<select class="ui-datepicker-year" onchange="DP_jQuery_'+dpuuid+".datepicker._selectMonthYear('#"+e.id+"', this, 'Y');\" >";D<=v;D++)e.yearshtml+='<option value="'+D+'"'+(D==a?' selected="selected"':"")+">"+D+"</option>";e.yearshtml+="</select>",u+=e.yearshtml,e.yearshtml=null}// Close datepicker_header
return u+=this._get(e,"yearSuffix"),l&&(u+=(!s&&o&&c?"":"&#xa0;")+h),u+="</div>"},/* Adjust one of the date sub-fields. */
_adjustInstDate:function(e,t,a){var i=e.drawYear+("Y"==a?t:0),r=e.drawMonth+("M"==a?t:0),s=Math.min(e.selectedDay,this._getDaysInMonth(i,r))+("D"==a?t:0),n=this._restrictMinMax(e,this._daylightSavingAdjust(new Date(i,r,s)));e.selectedDay=n.getDate(),e.drawMonth=e.selectedMonth=n.getMonth(),e.drawYear=e.selectedYear=n.getFullYear(),"M"!=a&&"Y"!=a||this._notifyChange(e)},/* Ensure a date is within any min/max bounds. */
_restrictMinMax:function(e,t){var a=this._getMinMaxDate(e,"min"),i=this._getMinMaxDate(e,"max"),r=a&&t<a?a:t;return r=i&&r>i?i:r},/* Notify change of month/year. */
_notifyChange:function(e){var t=this._get(e,"onChangeMonthYear");t&&t.apply(e.input?e.input[0]:null,[e.selectedYear,e.selectedMonth+1,e])},/* Determine the number of months to show. */
_getNumberOfMonths:function(e){var t=this._get(e,"numberOfMonths");return null==t?[1,1]:"number"==typeof t?[1,t]:t},/* Determine the current maximum date - ensure no time components are set. */
_getMinMaxDate:function(e,t){return this._determineDate(e,this._get(e,t+"Date"),null)},/* Find the number of days in a given month. */
_getDaysInMonth:function(e,t){return 32-this._daylightSavingAdjust(new Date(e,t,32)).getDate()},/* Find the day of the week of the first of a month. */
_getFirstDayOfMonth:function(e,t){return new Date(e,t,1).getDay()},/* Determines if we should allow a "next/prev" month display change. */
_canAdjustMonth:function(e,t,a,i){var r=this._getNumberOfMonths(e),s=this._daylightSavingAdjust(new Date(a,i+(t<0?t:r[0]*r[1]),1));return t<0&&s.setDate(this._getDaysInMonth(s.getFullYear(),s.getMonth())),this._isInRange(e,s)},/* Is the given date in the accepted range? */
_isInRange:function(e,t){var a=this._getMinMaxDate(e,"min"),i=this._getMinMaxDate(e,"max");return(!a||t.getTime()>=a.getTime())&&(!i||t.getTime()<=i.getTime())},/* Provide the configuration settings for formatting/parsing. */
_getFormatConfig:function(e){var t=this._get(e,"shortYearCutoff");return t="string"!=typeof t?t:(new Date).getFullYear()%100+parseInt(t,10),{shortYearCutoff:t,dayNamesShort:this._get(e,"dayNamesShort"),dayNames:this._get(e,"dayNames"),monthNamesShort:this._get(e,"monthNamesShort"),monthNames:this._get(e,"monthNames")}},/* Format the given date for display. */
_formatDate:function(e,t,a,i){t||(e.currentDay=e.selectedDay,e.currentMonth=e.selectedMonth,e.currentYear=e.selectedYear);var r=t?"object"==typeof t?t:this._daylightSavingAdjust(new Date(i,a,t)):this._daylightSavingAdjust(new Date(e.currentYear,e.currentMonth,e.currentDay));return this.formatDate(this._get(e,"dateFormat"),r,this._getFormatConfig(e))}}),/* Invoke the datepicker functionality.
   @param  options  string - a command, optionally followed by additional parameters or
                    Object - settings for attaching new datepicker functionality
   @return  jQuery object */
$.fn.datepicker=function(e){/* Verify an empty collection wasn't passed - Fixes #6976 */
if(!this.length)return this;/* Initialise the date picker. */
$.datepicker.initialized||($(document).mousedown($.datepicker._checkExternalClick).find("body").append($.datepicker.dpDiv),$.datepicker.initialized=!0);var t=Array.prototype.slice.call(arguments,1);return"string"!=typeof e||"isDisabled"!=e&&"getDate"!=e&&"widget"!=e?"option"==e&&2==arguments.length&&"string"==typeof arguments[1]?$.datepicker["_"+e+"Datepicker"].apply($.datepicker,[this[0]].concat(t)):this.each(function(){"string"==typeof e?$.datepicker["_"+e+"Datepicker"].apply($.datepicker,[this].concat(t)):$.datepicker._attachDatepicker(this,e)}):$.datepicker["_"+e+"Datepicker"].apply($.datepicker,[this[0]].concat(t))},$.datepicker=new Datepicker,// singleton instance
$.datepicker.initialized=!1,$.datepicker.uuid=(new Date).getTime(),$.datepicker.version="@VERSION",
// Workaround for #4055
// Add another global to avoid noConflict issues with inline event handlers
window["DP_jQuery_"+dpuuid]=$}(jQuery);

/*!
// ----------------------------------------------------------------------------
// markItUp! Universal MarkUp Engine, JQuery plugin
// v 1.1.7
// Dual licensed under the MIT and GPL licenses.
// ----------------------------------------------------------------------------
// Copyright (C) 2007-2010 Jay Salvat
// http://markitup.jaysalvat.com/
// ----------------------------------------------------------------------------
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
// 
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
// 
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
// ----------------------------------------------------------------------------
*/
!function($){$.fn.markItUp=function(settings,extraSettings){var options,ctrlKey,shiftKey,altKey;
// compute markItUp! path
return ctrlKey=shiftKey=altKey=!1,options={id:"",nameSpace:"",root:"",previewInWindow:"",// 'width=800, height=600, resizable=yes, scrollbars=yes'
previewAutoRefresh:!0,previewPosition:"after",previewTemplatePath:"~/templates/preview.html",previewParserPath:"",previewParserVar:"data",resizeHandle:!0,beforeInsert:"",afterInsert:"",onEnter:{},onShiftEnter:{},onCtrlEnter:{},onTab:{},markupSet:[{}]},$.extend(options,settings,extraSettings),options.root||$("script").each(function(e,t){miuScript=$(t).get(0).src.match(/(.*)jquery\.markitup(\.pack)?\.js$/),null!==miuScript&&(options.root=miuScript[1])}),this.each(function(){
// apply the computed path to ~/
function localize(e,t){return t?e.replace(/("|')~\//g,"$1"+options.root):e.replace(/^~\//,options.root)}
// init and build editor
function init(){id="",nameSpace="",options.id?id='id="'+options.id+'"':$$.attr("id")&&(id='id="markItUp'+$$.attr("id").substr(0,1).toUpperCase()+$$.attr("id").substr(1)+'"'),options.nameSpace&&(nameSpace='class="'+options.nameSpace+'"'),$$.wrap("<div "+nameSpace+"></div>"),$$.wrap("<div "+id+' class="markItUp"></div>'),$$.wrap('<div class="markItUpContainer"></div>'),$$.addClass("markItUpEditor"),
// add the header before the textarea
header=$('<div class="markItUpHeader"></div>').insertBefore($$),$(dropMenus(options.markupSet)).appendTo(header),
// add the footer after the textarea
footer=$('<div class="markItUpFooter"></div>').insertAfter($$),
// add the resize handle after textarea
options.resizeHandle===!0&&$.browser.safari!==!0&&(resizeHandle=$('<div class="markItUpResizeHandle"></div>').insertAfter($$).bind("mousedown",function(e){var t,r,i=$$.height(),n=e.clientY;t=function(e){return $$.css("height",Math.max(20,e.clientY+i-n)+"px"),!1},r=function(e){return $("html").unbind("mousemove",t).unbind("mouseup",r),!1},$("html").bind("mousemove",t).bind("mouseup",r)}),footer.append(resizeHandle)),
// listen key events
$$.keydown(keyPressed).keyup(keyPressed),
// bind an event to catch external calls
$$.bind("insertion",function(e,t){t.target!==!1&&get(),textarea===$.markItUp.focused&&markup(t)}),
// remember the last focus
$$.focus(function(){$.markItUp.focused=this})}
// recursively build header with dropMenus from markupset
function dropMenus(markupSet){var ul=$("<ul></ul>"),i=0;return $("li:hover > ul",ul).css("display","block"),$.each(markupSet,function(){var button=this,t="",title,li,j;if(title=button.key?(button.name||"")+" [Ctrl+"+button.key+"]":button.name||"",key=button.key?'accesskey="'+button.key+'"':"",button.separator)li=$('<li class="markItUpSeparator">'+(button.separator||"")+"</li>").appendTo(ul);else{for(i++,j=levels.length-1;j>=0;j--)t+=levels[j]+"-";li=$('<li class="markItUpButton markItUpButton'+t+i+" "+(button.className||"")+'"><a href="" '+key+' title="'+title+'">'+(button.name||"")+"</a></li>").bind("contextmenu",function(){// prevent contextmenu on mac and allow ctrl+click
return!1}).click(function(){return!1}).mousedown(function(){return button.call&&eval(button.call)(),setTimeout(function(){markup(button)},1),!1}).hover(function(){$("> ul",this).show(),$(document).one("click",function(){// close dropmenu if click outside
$("ul ul",header).hide()})},function(){$("> ul",this).hide()}).appendTo(ul),button.dropMenu&&(levels.push(i),$(li).addClass("markItUpDropMenu").append(dropMenus(button.dropMenu)))}}),levels.pop(),ul}
// markItUp! markups
function magicMarkups(e){
// [![prompt]!], [![prompt:!:value]!]
return e?(e=e.toString(),e=e.replace(/\(\!\(([\s\S]*?)\)\!\)/g,function(e,t){var r=t.split("|!|");return altKey===!0?void 0!==r[1]?r[1]:r[0]:void 0===r[1]?"":r[0]}),e=e.replace(/\[\!\[([\s\S]*?)\]\!\]/g,function(e,t){var r=t.split(":!:");return abort!==!0&&(value=prompt(r[0],r[1]?r[1]:""),null===value&&(abort=!0),value)})):""}
// prepare action
function prepare(e){return $.isFunction(e)&&(e=e(hash)),magicMarkups(e)}
// build block to insert
function build(e){return openWith=prepare(clicked.openWith),placeHolder=prepare(clicked.placeHolder),replaceWith=prepare(clicked.replaceWith),closeWith=prepare(clicked.closeWith),""!==replaceWith?block=openWith+replaceWith+closeWith:""===selection&&""!==placeHolder?block=openWith+placeHolder+closeWith:block=openWith+(e||selection)+closeWith,{block:block,openWith:openWith,replaceWith:replaceWith,placeHolder:placeHolder,closeWith:closeWith}}
// define markup to insert
function markup(e){var t,r,i,n;if(hash=clicked=e,get(),$.extend(hash,{line:"",root:options.root,textarea:textarea,selection:selection||"",caretPosition:caretPosition,ctrlKey:ctrlKey,shiftKey:shiftKey,altKey:altKey}),
// callbacks before insertion
prepare(options.beforeInsert),prepare(clicked.beforeInsert),ctrlKey===!0&&shiftKey===!0&&prepare(clicked.beforeMultiInsert),$.extend(hash,{line:1}),ctrlKey===!0&&shiftKey===!0){for(lines=selection.split(/\r?\n/),r=0,i=lines.length,n=0;n<i;n++)""!==$.trim(lines[n])?($.extend(hash,{line:++r,selection:lines[n]}),lines[n]=build(lines[n]).block):lines[n]="";string={block:lines.join("\n")},start=caretPosition,t=string.block.length+($.browser.opera?i:0)}else ctrlKey===!0?(string=build(selection),start=caretPosition+string.openWith.length,t=string.block.length-string.openWith.length-string.closeWith.length,t-=fixIeBug(string.block)):shiftKey===!0?(string=build(selection),start=caretPosition,t=string.block.length,t-=fixIeBug(string.block)):(string=build(selection),start=caretPosition+string.block.length,t=0,start-=fixIeBug(string.block));""===selection&&""===string.replaceWith&&(caretOffset+=fixOperaBug(string.block),start=caretPosition+string.openWith.length,t=string.block.length-string.openWith.length-string.closeWith.length,caretOffset=$$.val().substring(caretPosition,$$.val().length).length,caretOffset-=fixOperaBug($$.val().substring(0,caretPosition))),$.extend(hash,{caretPosition:caretPosition,scrollPosition:scrollPosition}),string.block!==selection&&abort===!1?(insert(string.block),set(start,t)):caretOffset=-1,get(),$.extend(hash,{line:"",selection:selection}),
// callbacks after insertion
ctrlKey===!0&&shiftKey===!0&&prepare(clicked.afterMultiInsert),prepare(clicked.afterInsert),prepare(options.afterInsert),
// refresh preview if opened
previewWindow&&options.previewAutoRefresh&&refreshPreview(),
// reinit keyevent
shiftKey=altKey=ctrlKey=abort=!1}
// Substract linefeed in Opera
function fixOperaBug(e){return $.browser.opera?e.length-e.replace(/\n*/g,"").length:0}
// Substract linefeed in IE
function fixIeBug(e){return $.browser.msie?e.length-e.replace(/\r*/g,"").length:0}
// add markup
function insert(e){if(document.selection){var t=document.selection.createRange();t.text=e}else $$.val($$.val().substring(0,caretPosition)+e+$$.val().substring(caretPosition+selection.length,$$.val().length))}
// set a selection
function set(e,t){if(textarea.createTextRange){
// quick fix to make it work on Opera 9.5
if($.browser.opera&&$.browser.version>=9.5&&0==t)return!1;range=textarea.createTextRange(),range.collapse(!0),range.moveStart("character",e),range.moveEnd("character",t),range.select()}else textarea.setSelectionRange&&textarea.setSelectionRange(e,e+t);textarea.scrollTop=scrollPosition,textarea.focus()}
// get the selection
function get(){if(textarea.focus(),scrollPosition=textarea.scrollTop,document.selection)if(selection=document.selection.createRange().text,$.browser.msie){// ie
var e=document.selection.createRange(),t=e.duplicate();for(t.moveToElementText(textarea),caretPosition=-1;t.inRange(e);)// fix most of the ie bugs with linefeeds...
t.moveStart("character"),caretPosition++}else// opera
caretPosition=textarea.selectionStart;else// gecko & webkit
caretPosition=textarea.selectionStart,selection=$$.val().substring(caretPosition,textarea.selectionEnd);return selection}
// open preview window
function preview(){!previewWindow||previewWindow.closed?options.previewInWindow?previewWindow=window.open("","preview",options.previewInWindow):(iFrame=$('<iframe class="markItUpPreviewFrame"></iframe>'),"after"==options.previewPosition?iFrame.insertAfter(footer):iFrame.insertBefore(header),previewWindow=iFrame[iFrame.length-1].contentWindow||frame[iFrame.length-1]):altKey===!0&&(
// Thx Stephen M. Redd for the IE8 fix
iFrame?iFrame.remove():previewWindow.close(),previewWindow=iFrame=!1),options.previewAutoRefresh||refreshPreview()}
// refresh Preview window
function refreshPreview(){renderPreview()}function renderPreview(){return""!==options.previewParserPath?$.ajax({type:"POST",url:options.previewParserPath,data:options.previewParserVar+"="+encodeURIComponent($$.val()),success:function(e){writeInPreview(localize(e,1))}}):template||$.ajax({url:options.previewTemplatePath,success:function(e){writeInPreview(localize(e,1).replace(/<!-- content -->/g,$$.val()))}}),!1}function writeInPreview(e){if(previewWindow.document){try{sp=previewWindow.document.documentElement.scrollTop}catch(t){sp=0}previewWindow.document.open(),previewWindow.document.write(e),previewWindow.document.close(),previewWindow.document.documentElement.scrollTop=sp}options.previewInWindow&&previewWindow.focus()}
// set keys pressed
function keyPressed(e){if(shiftKey=e.shiftKey,altKey=e.altKey,ctrlKey=(!e.altKey||!e.ctrlKey)&&e.ctrlKey,"keydown"===e.type){if(ctrlKey===!0&&(li=$('a[accesskey="'+String.fromCharCode(e.keyCode)+'"]',header).parent("li"),0!==li.length))return ctrlKey=!1,setTimeout(function(){li.triggerHandler("mousedown")},1),!1;if(13===e.keyCode||10===e.keyCode)// Enter key
// Enter key
// Enter + Ctrl
// Enter + Shift
// only Enter
return ctrlKey===!0?(ctrlKey=!1,markup(options.onCtrlEnter),options.onCtrlEnter.keepDefault):shiftKey===!0?(shiftKey=!1,markup(options.onShiftEnter),options.onShiftEnter.keepDefault):(markup(options.onEnter),options.onEnter.keepDefault);if(9===e.keyCode)// Tab key
// Tab key
return 1!=shiftKey&&1!=ctrlKey&&1!=altKey&&(caretOffset!==-1?(get(),caretOffset=$$.val().length-caretOffset,set(caretOffset,0),caretOffset=-1,!1):(markup(options.onTab),options.onTab.keepDefault))}}var $$,textarea,levels,scrollPosition,caretPosition,caretOffset,clicked,hash,header,footer,previewWindow,template,iFrame,abort;$$=$(this),textarea=this,levels=[],abort=!1,scrollPosition=caretPosition=0,caretOffset=-1,options.previewParserPath=localize(options.previewParserPath),options.previewTemplatePath=localize(options.previewTemplatePath),init()})},$.fn.markItUpRemove=function(){return this.each(function(){var e=$(this).unbind().removeClass("markItUpEditor");e.parent("div").parent("div.markItUp").parent("div").replaceWith(e)})},$.markItUp=function(e){var t={target:!1};return $.extend(t,e),t.target?$(t.target).each(function(){$(this).focus(),$(this).trigger("insertion",[t])}):void $("textarea").trigger("insertion",[t])}}(jQuery);

/**
 * @license 
 * jQuery Tools 1.2.1 / Mask - Dim the lights
 * 
 * NO COPYRIGHTS OR LICENSES. DO WHAT YOU LIKE.
 * 
 * http://flowplayer.org/tools/toolbox/mask.html
 *
 * Since: Mar 2010
 * Date:    Tue May 11 09:22:32 2010 +0000 
 */
!function(n){/* one of the greatest headaches in the tool. finally made it */
function o(){
// the horror case
if(n.browser.msie){
// if there are no scrollbars then use window.height
var o=n(document).height(),e=n(window).height();return[window.innerWidth||// ie7+
document.documentElement.clientWidth||// ie6  
document.body.clientWidth,// ie6 quirks mode
o-e<20?e:o]}
// other well behaving browsers
return[n(window).width(),n(document).height()]}function e(o){if(o)return o.call(n.mask)}
// static constructs
n.tools=n.tools||{version:"1.2.1"};var t;t=n.tools.expose={conf:{maskId:"exposeMask",loadSpeed:"slow",closeSpeed:"fast",closeOnClick:!0,closeOnEsc:!0,
// css settings
zIndex:9998,opacity:.8,startOpacity:0,color:"#fff",
// callbacks
onLoad:null,onClose:null}};var i,s,c,d,a;n.mask={load:function(r,u){
// already loaded ?
if(c)return this;
// configuration
"string"==typeof r&&(r={color:r}),
// use latest config
r=r||d,d=r=n.extend(n.extend({},t.conf),r),
// get the mask
i=n("#"+r.maskId),
// or create it
i.length||(i=n("<div/>").attr("id",r.maskId),n("body").append(i));
// set position and dimensions 			
var l=o();i.css({position:"absolute",top:0,left:0,width:l[0],height:l[1],display:"none",opacity:r.startOpacity,zIndex:r.zIndex});
// background color 
var f=i.css("backgroundColor");
// onBeforeLoad
// onBeforeLoad
// esc button
// mask click closes
// resize mask when window is resized
// exposed elements
// make sure element is positioned absolutely or relatively
// make elements sit on top of the mask
// reveal mask
return f&&"transparent"!=f&&"rgba(0, 0, 0, 0)"!=f||i.css("backgroundColor",r.color),e(r.onBeforeLoad)===!1?this:(r.closeOnEsc&&n(document).bind("keydown.mask",function(o){27==o.keyCode&&n.mask.close(o)}),r.closeOnClick&&i.bind("click.mask",function(o){n.mask.close(o)}),n(window).bind("resize.mask",function(){n.mask.fit()}),u&&u.length&&(a=u.eq(0).css("zIndex"),n.each(u,function(){var o=n(this);/relative|absolute|fixed/i.test(o.css("position"))||o.css("position","relative")}),s=u.css({zIndex:Math.max(r.zIndex+1,"auto"==a?0:a)})),i.css({display:"block"}).fadeTo(r.loadSpeed,r.opacity,function(){n.mask.fit(),e(r.onLoad)}),c=!0,this)},close:function(){if(c){
// onBeforeClose
if(e(d.onBeforeClose)===!1)return this;i.fadeOut(d.closeSpeed,function(){e(d.onClose),s&&s.css({zIndex:a})}),
// unbind various event listeners
n(document).unbind("keydown.mask"),i.unbind("click.mask"),n(window).unbind("resize.mask"),c=!1}return this},fit:function(){if(c){var n=o();i.css({width:n[0],height:n[1]})}},getMask:function(){return i},isLoaded:function(){return c},getConf:function(){return d},getExposed:function(){return s}},n.fn.mask=function(o){return n.mask.load(o),this},n.fn.expose=function(o){return n.mask.load(o,this),this}}(jQuery);

/**
 * @license 
 * jQuery Tools 1.2.3 Overlay - Overlay base. Extend it.
 * 
 * NO COPYRIGHTS OR LICENSES. DO WHAT YOU LIKE.
 * 
 * http://flowplayer.org/tools/overlay/
 *
 * Since: March 2008
 * Date:    Mon Jun 7 13:43:53 2010 +0000 
 */
!function(e){function t(t,i){
// private variables
var r,c,l,s=this,a=t.add(s),f=e(window),d=e.tools.expose&&(i.mask||i.expose),u=Math.random().toString().slice(10);
// mask configuration
d&&("string"==typeof d&&(d={color:d}),d.closeOnClick=d.closeOnEsc=!1);
// get overlay and triggerr
var g=i.target||t.attr("rel");
// overlay not found. cannot continue
if(c=g?e(g):t,!c.length)throw"Could not find Overlay: "+g;
// trigger's click event
t&&t.index(c)==-1&&t.click(function(e){return s.load(e),e.preventDefault()}),
// API methods  
e.extend(s,{load:function(t){
// can be opened only once
if(s.isOpened())return s;
// find the effect
var r=o[i.effect];if(!r)throw'Overlay: cannot find effect : "'+i.effect+'"';if(
// close other instances?
i.oneInstance&&e.each(n,function(){this.close(t)}),
// onBeforeLoad
t=t||e.Event(),t.type="onBeforeLoad",a.trigger(t),t.isDefaultPrevented())return s;
// opened
l=!0,
// possible mask effect
d&&e(c).expose(d);
// position & dimensions 
var g=i.top,h=i.left,p=c.outerWidth({margin:!0}),v=c.outerHeight({margin:!0});
// load effect  		 		
// mask.click closes overlay
// when window is clicked outside overlay, we close
// keyboard::escape
// one callback is enough if multiple instances are loaded simultaneously
return"string"==typeof g&&(g="center"==g?Math.max((f.height()-v)/2,0):parseInt(g,10)/100*f.height()),"center"==h&&(h=Math.max((f.width()-p)/2,0)),r[0].call(s,{top:g,left:h},function(){l&&(t.type="onLoad",a.trigger(t))}),d&&i.closeOnClick&&e.mask.getMask().one("click",s.close),i.closeOnClick&&e(document).bind("click."+u,function(t){e(t.target).parents(c).length||s.close(t)}),i.closeOnEsc&&e(document).bind("keydown."+u,function(e){27==e.keyCode&&s.close(e)}),s},close:function(t){
// close effect
// unbind the keyboard / clicking actions
return s.isOpened()?(t=t||e.Event(),t.type="onBeforeClose",a.trigger(t),t.isDefaultPrevented()?void 0:(l=!1,o[i.effect][1].call(s,function(){t.type="onClose",a.trigger(t)}),e(document).unbind("click."+u).unbind("keydown."+u),d&&e.mask.close(),s)):s},getOverlay:function(){return c},getTrigger:function(){return t},getClosers:function(){return r},isOpened:function(){return l},
// manipulate start, finish and speeds
getConf:function(){return i}}),
// callbacks	
e.each("onBeforeLoad,onStart,onLoad,onBeforeClose,onClose".split(","),function(t,n){
// configuration
e.isFunction(i[n])&&e(s).bind(n,i[n]),
// API
s[n]=function(t){return e(s).bind(n,t),s}}),
// close button
r=c.find(i.close||".close"),r.length||i.close||(r=e('<a class="close"></a>'),c.prepend(r)),r.click(function(e){s.close(e)}),
// autoload
i.load&&s.load()}
// static constructs
e.tools=e.tools||{version:"1.2.3"},e.tools.overlay={addEffect:function(e,t,n){o[e]=[t,n]},conf:{close:null,closeOnClick:!0,closeOnEsc:!0,closeSpeed:"fast",effect:"default",
// since 1.2. fixed positioning not supported by IE6
fixed:!e.browser.msie||e.browser.version>6,left:"center",load:!1,// 1.2
mask:null,oneInstance:!0,speed:"normal",target:null,// target element to be overlayed. by default taken from [rel]  
top:"10%"}};var n=[],o={};
// the default effect. nice and easy!
e.tools.overlay.addEffect("default",/* 
			onLoad/onClose functions must be called otherwise none of the 
			user supplied callback methods won't be called
		*/
function(t,n){var o=this.getConf(),i=e(window);o.fixed||(t.top+=i.scrollTop(),t.left+=i.scrollLeft()),t.position=o.fixed?"fixed":"absolute",this.getOverlay().css(t).fadeIn(o.speed,n)},function(e){this.getOverlay().fadeOut(this.getConf().closeSpeed,e)}),
// jQuery plugin initialization
e.fn.overlay=function(o){
// already constructed --> return API
var i=this.data("overlay");return i?i:(e.isFunction(o)&&(o={onBeforeLoad:o}),o=e.extend(!0,{},e.tools.overlay.conf,o),this.each(function(){i=new t(e(this),o),n.push(i),e(this).data("overlay",i)}),o.api?i:this)}}(jQuery);

/*!
 * jQuery Templates Plugin 1.0.0pre
 * http://github.com/jquery/jquery-tmpl
 * Requires jQuery 1.4.2
 *
 * Copyright Software Freedom Conservancy, Inc.
 * Dual licensed under the MIT or GPL Version 2 licenses.
 * http://jquery.org/license
 */
!function(t,e){function n(e,n,l,a){
// Returns a template item data structure for a new rendered instance of a template (a 'template item').
// The content field is a hierarchical array of strings and nested items (to be
// removed and replaced by nodes field of dom elements, once inserted in DOM).
var r={data:a||0===a||a===!1?a:n?n.data:{},_wrap:n?n._wrap:null,tmpl:null,parent:n||null,nodes:[],calls:c,nest:f,wrap:m,html:s,update:d};
// Build the hierarchical content to be used during insertion into DOM
// Keep track of new template item, until it is stored as jQuery Data on DOM element
return e&&t.extend(r,e,{nodes:[],parent:n}),l&&(r.tmpl=l,r._ctnt=r._ctnt||r.tmpl(t,r),r.key=++k,(j.length?v:g)[k]=r),r}
//========================== Private helper functions, used by code above ==========================
function l(e,n,r){
// Convert hierarchical content into flat string array
// and finally return array of fragments ready for DOM insertion
var p,i=r?t.map(r,function(t){
// Insert template item annotations, to be converted to jQuery.data( "tmplItem" ) when elems are inserted into DOM.
// This is a child template item. Build nested template.
return"string"==typeof t?e.key?t.replace(/(<\w+)(?=[\s>])(?![^>]*_tmplitem)([^>]*)/g,"$1 "+h+'="'+e.key+'" $2'):t:l(t,e,t._ctnt)}):
// If content is not defined, insert tmplItem directly. Not a template item. May be a string, or a string array, e.g. from {{html $item.html()}}.
e;
// top-level template
// Support templates which have initial or final text nodes, or consist only of text
// Also support HTML entities within the HTML markup.
return n?i:(i=i.join(""),i.replace(/^\s*([^<\s][^<]*)?(<[\w\W]+>)([^>]*[^>\s])?\s*$/,function(e,n,l,r){p=t(l).get(),u(p),n&&(p=a(n).concat(p)),r&&(p=p.concat(a(r)))}),p?p:a(i))}function a(e){
// Use createElement, since createTextNode will not render HTML entities correctly
var n=document.createElement("div");return n.innerHTML=e,t.makeArray(n.childNodes)}
// Generate a reusable function that will serve to render a template against data
function r(e){
// Use the variable __ to hold a string array while building the compiled template. (See https://github.com/jquery/jquery-tmpl/issues#issue/10).
// Convert the template into pure JavaScript
return new Function("jQuery","$item","var $=jQuery,call,__=[],$data=$item.data;with($data){__.push('"+t.trim(e).replace(/([\\'])/g,"\\$1").replace(/[\r\t\n]/g," ").replace(/\$\{([^\}]*)\}/g,"{{= $1}}").replace(/\{\{(\/?)(\w+|.)(?:\(((?:[^\}]|\}(?!\}))*?)?\))?(?:\s+(.*?)?)?(\(((?:[^\}]|\}(?!\}))*?)\))?\s*\}\}/g,function(e,n,l,a,r,p,o){var u,c,f,m=t.tmpl.tag[l];if(!m)throw"Unknown template tag: "+l;
// Support for target being things like a.toLowerCase();
// In that case don't call with template item as 'this' pointer. Just evaluate...
return u=m._default||[],p&&!/\w$/.test(r)&&(r+=p,p=""),r?(r=i(r),o=o?","+i(o)+")":p?")":"",c=p?r.indexOf(".")>-1?r+i(p):"("+r+").call($item"+o:r,f=p?c:"(typeof("+r+")==='function'?("+r+").call($item):("+r+"))"):f=c=u.$1||"null",a=i(a),"');"+m[n?"close":"open"].split("$notnull_1").join(r?"typeof("+r+")!=='undefined' && ("+r+")!=null":"true").split("$1a").join(f).split("$1").join(c).split("$2").join(a||u.$2||"")+"__.push('"})+"');}return __;")}function p(e,n){
// Build the wrapped content.
e._wrap=l(e,!0,
// Suport imperative scenario in which options.wrapped can be set to a selector or an HTML string.
t.isArray(n)?n:[y.test(n)?n:t(n).html()]).join("")}function i(t){return t?t.replace(/\\'/g,"'").replace(/\\\\/g,"\\"):null}function o(t){var e=document.createElement("div");return e.appendChild(t.cloneNode(!0)),e.innerHTML}
// Store template items in jQuery.data(), ensuring a unique tmplItem data data structure for each rendered template instance.
function u(e){function l(e){function l(t){t+=u,p=c[t]=c[t]||n(p,g[p.parent.key+u]||p.parent)}var a,r,p,i,o=e;
// Ensure that each rendered template inserted into the DOM has its own template item,
if(i=e.getAttribute(h)){for(;o.parentNode&&1===(o=o.parentNode).nodeType&&!(a=o.getAttribute(h)););a!==i&&(
// The next ancestor with a _tmplitem expando is on a different key than this one.
// So this is a top-level element within this template item
// Set pntNode to the key of the parentNode, or to 0 if pntNode.parentNode is null, or pntNode is a fragment.
o=o.parentNode?11===o.nodeType?0:o.getAttribute(h)||0:0,(p=g[i])||(
// The item is for wrapped content, and was copied from the temporary parent wrappedItem.
p=v[i],p=n(p,g[o]||v[o]),p.key=++k,g[k]=p),T&&l(i)),e.removeAttribute(h)}else T&&(p=t.data(e,"tmplItem"))&&(
// This was a rendered element, cloned during append or appendTo etc.
// TmplItem stored in jQuery data has already been cloned in cloneCopyEvent. We must replace it with a fresh cloned tmplItem.
l(p.key),g[p.key]=p,o=t.data(e.parentNode,"tmplItem"),o=o?o.key:0);if(p){
// Find the template item of the parent element.
// (Using !=, not !==, since pntItem.key is number, and pntNode may be a string)
for(r=p;r&&r.key!=o;)
// Add this element as a top-level node for this rendered template item, as well as for any
// ancestor items between this item and the item of its parent element
r.nodes.push(e),r=r.parent;
// Delete content built during rendering - reduce API surface area and memory use, and avoid exposing of stale data after rendering...
delete p._ctnt,delete p._wrap,
// Store template item as jQuery data on the element
t.data(e,"tmplItem",p)}}var a,r,p,i,o,u="_"+T,c={};for(p=0,i=e.length;p<i;p++)if(1===(a=e[p]).nodeType){for(r=a.getElementsByTagName("*"),o=r.length-1;o>=0;o--)l(r[o]);l(a)}}
//---- Helper functions for template item ----
function c(t,e,n,l){return t?void j.push({_:t,tmpl:e,item:this,data:n,options:l}):j.pop()}function f(e,n,l){
// nested template, using {{tmpl}} tag
return t.tmpl(t.template(e),n,l,this)}function m(e,n){
// nested template, using {{wrap}} tag
var l=e.options||{};
// Apply the template, which may incorporate wrapped content,
return l.wrapped=n,t.tmpl(t.template(e.tmpl),e.data,l,e.item)}function s(e,n){var l=this._wrap;return t.map(t(t.isArray(l)?l.join(""):l).filter(e||"*"),function(t){return n?t.innerText||t.textContent:t.outerHTML||o(t)})}function d(){var e=this.nodes;t.tmpl(null,null,null,this).insertBefore(e[0]),t(e).remove()}var $,_=t.fn.domManip,h="_tmplitem",y=/^[^<]*(<[\w\W]+>)[^>]*$|\{\{\! /,g={},v={},w={key:0,data:{}},k=0,T=0,j=[];
// Override appendTo etc., in order to provide support for targeting multiple elements. (This code would disappear if integrated in jquery core).
t.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(e,n){t.fn[e]=function(l){var a,r,p,i,o=[],u=t(l),c=1===this.length&&this[0].parentNode;if($=g||{},c&&11===c.nodeType&&1===c.childNodes.length&&1===u.length)u[n](this[0]),o=this;else{for(r=0,p=u.length;r<p;r++)T=r,a=(r>0?this.clone(!0):this).get(),t(u[r])[n](a),o=o.concat(a);T=0,o=this.pushStack(o,e,u.selector)}return i=$,$=null,t.tmpl.complete(i),o}}),t.fn.extend({
// Use first wrapped element as template markup.
// Return wrapped set of template items, obtained by rendering template against data.
tmpl:function(e,n,l){return t.tmpl(this[0],e,n,l)},
// Find which rendered template item the first wrapped DOM element belongs to
tmplItem:function(){return t.tmplItem(this[0])},
// Consider the first wrapped element as a template declaration, and get the compiled template or store it as a named template.
template:function(e){return t.template(e,this[0])},domManip:function(e,n,l,a){if(e[0]&&t.isArray(e[0])){for(var r,p=t.makeArray(arguments),i=e[0],o=i.length,u=0;u<o&&!(r=t.data(i[u++],"tmplItem")););r&&T&&(p[2]=function(e){
// Handler called by oldManip when rendered template has been inserted into DOM.
t.tmpl.afterManip(this,e,l)}),_.apply(this,p)}else _.apply(this,arguments);return T=0,$||t.tmpl.complete(g),this}}),t.extend({
// Return wrapped set of template items, obtained by rendering template against data.
tmpl:function(e,a,r,i){var o,u=!i;if(u)
// This is a top-level tmpl call (not from a nested template using {{tmpl}})
i=w,e=t.template[e]||t.template(null,e),v={};else if(!e)
// Rebuild, without creating a new template item
// The template item is already associated with DOM - this is a refresh.
// Re-evaluate rendered template for the parentItem
return e=i.tmpl,g[i.key]=i,i.nodes=[],i.wrapped&&p(i,i.wrapped),t(l(i,null,i.tmpl(t,i)));return e?("function"==typeof a&&(a=a.call(i||{})),r&&r.wrapped&&p(r,r.wrapped),o=t.isArray(a)?t.map(a,function(t){return t?n(r,i,e,t):null}):[n(r,i,e,a)],u?t(l(i,null,o)):o):[]},
// Return rendered template item for an element.
tmplItem:function(e){var n;for(e instanceof t&&(e=e[0]);e&&1===e.nodeType&&!(n=t.data(e,"tmplItem"))&&(e=e.parentNode););return n||w},
// Set:
// Use $.template( name, tmpl ) to cache a named template,
// where tmpl is a template string, a script element or a jQuery instance wrapping a script element, etc.
// Use $( "selector" ).template( name ) to provide access by name to a script block template declaration.
// Get:
// Use $.template( name ) to access a cached template.
// Also $( selectorToScriptBlock ).template(), or $.template( null, templateString )
// will return the compiled template, without adding a name reference.
// If templateString includes at least one HTML tag, $.template( templateString ) is equivalent
// to $.template( null, templateString )
template:function(e,n){
// Compile template and associate with name
// This is an HTML string being passed directly in.
// If this is a template block, use cached copy, or generate tmpl function and cache.
// If not in map, and not containing at least on HTML tag, treat as a selector.
// (If integrated with core, use quickExpr.exec)
return n?("string"==typeof n?n=r(n):n instanceof t&&(n=n[0]||{}),n.nodeType&&(n=t.data(n,"tmpl")||t.data(n,"tmpl",r(n.innerHTML))),"string"==typeof e?t.template[e]=n:n):e?"string"!=typeof e?t.template(null,e):t.template[e]||t.template(null,y.test(e)?e:t(e)):null},encode:function(t){
// Do HTML encoding replacing < > & and ' and " by corresponding entities.
return(""+t).split("<").join("&lt;").split(">").join("&gt;").split('"').join("&#34;").split("'").join("&#39;")}}),t.extend(t.tmpl,{tag:{tmpl:{_default:{$2:"null"},open:"if($notnull_1){__=__.concat($item.nest($1,$2));}"},wrap:{_default:{$2:"null"},open:"$item.calls(__,$1,$2);__=[];",close:"call=$item.calls();__=call._.concat($item.wrap(call,__));"},each:{_default:{$2:"$index, $value"},open:"if($notnull_1){$.each($1a,function($2){with(this){",close:"}});}"},"if":{open:"if(($notnull_1) && $1a){",close:"}"},"else":{_default:{$1:"true"},open:"}else if(($notnull_1) && $1a){"},html:{
// Unecoded expression evaluation.
open:"if($notnull_1){__.push($1a);}"},"=":{
// Encoded expression evaluation. Abbreviated form is ${}.
_default:{$1:"$data"},open:"if($notnull_1){__.push($.encode($1a));}"},"!":{
// Comment tag. Skipped by parser
open:""}},
// This stub can be overridden, e.g. in jquery.tmplPlus for providing rendered events
complete:function(t){g={}},
// Call this from code which overrides domManip, or equivalent
// Manage cloning/storing template items etc.
afterManip:function(e,n,l){
// Provides cloned fragment ready for fixup prior to and after insertion into DOM
var a=11===n.nodeType?t.makeArray(n.childNodes):1===n.nodeType?[n]:[];
// Return fragment to original caller (e.g. append) for DOM insertion
l.call(e,n),
// Fragment has been inserted:- Add inserted nodes to tmplItem data structure. Replace inserted element annotations by jQuery.data.
u(a),T++}})}(jQuery);

//     Underscore.js 1.4.4
//     http://underscorejs.org
//     (c) 2009-2013 Jeremy Ashkenas, DocumentCloud Inc.
//     Underscore may be freely distributed under the MIT license.
(function(){
// Baseline setup
// --------------
// Establish the root object, `window` in the browser, or `global` on the server.
var n=this,t=n._,r={},e=Array.prototype,u=Object.prototype,i=Function.prototype,a=e.push,o=e.slice,c=e.concat,l=u.toString,f=u.hasOwnProperty,s=e.forEach,p=e.map,h=e.reduce,v=e.reduceRight,d=e.filter,y=e.every,g=e.some,m=e.indexOf,b=e.lastIndexOf,x=Array.isArray,_=Object.keys,w=i.bind,j=function(n){return n instanceof j?n:this instanceof j?void(this._wrapped=n):new j(n)};
// Export the Underscore object for **Node.js**, with
// backwards-compatibility for the old `require()` API. If we're in
// the browser, add `_` as a global object via a string identifier,
// for Closure Compiler "advanced" mode.
"undefined"!=typeof exports?("undefined"!=typeof module&&module.exports&&(exports=module.exports=j),exports._=j):n._=j,
// Current version.
j.VERSION="1.4.4";
// Collection Functions
// --------------------
// The cornerstone, an `each` implementation, aka `forEach`.
// Handles objects with the built-in `forEach`, arrays, and raw objects.
// Delegates to **ECMAScript 5**'s native `forEach` if available.
var A=j.each=j.forEach=function(n,t,e){if(null!=n)if(s&&n.forEach===s)n.forEach(t,e);else if(n.length===+n.length){for(var u=0,i=n.length;u<i;u++)if(t.call(e,n[u],u,n)===r)return}else for(var a in n)if(j.has(n,a)&&t.call(e,n[a],a,n)===r)return};
// Return the results of applying the iterator to each element.
// Delegates to **ECMAScript 5**'s native `map` if available.
j.map=j.collect=function(n,t,r){var e=[];return null==n?e:p&&n.map===p?n.map(t,r):(A(n,function(n,u,i){e[e.length]=t.call(r,n,u,i)}),e)};var E="Reduce of empty array with no initial value";
// **Reduce** builds up a single result from a list of values, aka `inject`,
// or `foldl`. Delegates to **ECMAScript 5**'s native `reduce` if available.
j.reduce=j.foldl=j.inject=function(n,t,r,e){var u=arguments.length>2;if(null==n&&(n=[]),h&&n.reduce===h)return e&&(t=j.bind(t,e)),u?n.reduce(t,r):n.reduce(t);if(A(n,function(n,i,a){u?r=t.call(e,r,n,i,a):(r=n,u=!0)}),!u)throw new TypeError(E);return r},
// The right-associative version of reduce, also known as `foldr`.
// Delegates to **ECMAScript 5**'s native `reduceRight` if available.
j.reduceRight=j.foldr=function(n,t,r,e){var u=arguments.length>2;if(null==n&&(n=[]),v&&n.reduceRight===v)return e&&(t=j.bind(t,e)),u?n.reduceRight(t,r):n.reduceRight(t);var i=n.length;if(i!==+i){var a=j.keys(n);i=a.length}if(A(n,function(o,c,l){c=a?a[--i]:--i,u?r=t.call(e,r,n[c],c,l):(r=n[c],u=!0)}),!u)throw new TypeError(E);return r},
// Return the first value which passes a truth test. Aliased as `detect`.
j.find=j.detect=function(n,t,r){var e;return O(n,function(n,u,i){if(t.call(r,n,u,i))return e=n,!0}),e},
// Return all the elements that pass a truth test.
// Delegates to **ECMAScript 5**'s native `filter` if available.
// Aliased as `select`.
j.filter=j.select=function(n,t,r){var e=[];return null==n?e:d&&n.filter===d?n.filter(t,r):(A(n,function(n,u,i){t.call(r,n,u,i)&&(e[e.length]=n)}),e)},
// Return all the elements for which a truth test fails.
j.reject=function(n,t,r){return j.filter(n,function(n,e,u){return!t.call(r,n,e,u)},r)},
// Determine whether all of the elements match a truth test.
// Delegates to **ECMAScript 5**'s native `every` if available.
// Aliased as `all`.
j.every=j.all=function(n,t,e){t||(t=j.identity);var u=!0;return null==n?u:y&&n.every===y?n.every(t,e):(A(n,function(n,i,a){if(!(u=u&&t.call(e,n,i,a)))return r}),!!u)};
// Determine if at least one element in the object matches a truth test.
// Delegates to **ECMAScript 5**'s native `some` if available.
// Aliased as `any`.
var O=j.some=j.any=function(n,t,e){t||(t=j.identity);var u=!1;return null==n?u:g&&n.some===g?n.some(t,e):(A(n,function(n,i,a){if(u||(u=t.call(e,n,i,a)))return r}),!!u)};
// Determine if the array or object contains a given value (using `===`).
// Aliased as `include`.
j.contains=j.include=function(n,t){return null!=n&&(m&&n.indexOf===m?n.indexOf(t)!=-1:O(n,function(n){return n===t}))},
// Invoke a method (with arguments) on every item in a collection.
j.invoke=function(n,t){var r=o.call(arguments,2),e=j.isFunction(t);return j.map(n,function(n){return(e?t:n[t]).apply(n,r)})},
// Convenience version of a common use case of `map`: fetching a property.
j.pluck=function(n,t){return j.map(n,function(n){return n[t]})},
// Convenience version of a common use case of `filter`: selecting only objects
// containing specific `key:value` pairs.
j.where=function(n,t,r){return j.isEmpty(t)?r?void 0:[]:j[r?"find":"filter"](n,function(n){for(var r in t)if(t[r]!==n[r])return!1;return!0})},
// Convenience version of a common use case of `find`: getting the first object
// containing specific `key:value` pairs.
j.findWhere=function(n,t){return j.where(n,t,!0)},
// Return the maximum element or (element-based computation).
// Can't optimize arrays of integers longer than 65,535 elements.
// See: https://bugs.webkit.org/show_bug.cgi?id=80797
j.max=function(n,t,r){if(!t&&j.isArray(n)&&n[0]===+n[0]&&n.length<65535)return Math.max.apply(Math,n);if(!t&&j.isEmpty(n))return-(1/0);var e={computed:-(1/0),value:-(1/0)};return A(n,function(n,u,i){var a=t?t.call(r,n,u,i):n;a>=e.computed&&(e={value:n,computed:a})}),e.value},
// Return the minimum element (or element-based computation).
j.min=function(n,t,r){if(!t&&j.isArray(n)&&n[0]===+n[0]&&n.length<65535)return Math.min.apply(Math,n);if(!t&&j.isEmpty(n))return 1/0;var e={computed:1/0,value:1/0};return A(n,function(n,u,i){var a=t?t.call(r,n,u,i):n;a<e.computed&&(e={value:n,computed:a})}),e.value},
// Shuffle an array.
j.shuffle=function(n){var t,r=0,e=[];return A(n,function(n){t=j.random(r++),e[r-1]=e[t],e[t]=n}),e};
// An internal function to generate lookup iterators.
var k=function(n){return j.isFunction(n)?n:function(t){return t[n]}};
// Sort the object's values by a criterion produced by an iterator.
j.sortBy=function(n,t,r){var e=k(t);return j.pluck(j.map(n,function(n,t,u){return{value:n,index:t,criteria:e.call(r,n,t,u)}}).sort(function(n,t){var r=n.criteria,e=t.criteria;if(r!==e){if(r>e||void 0===r)return 1;if(r<e||void 0===e)return-1}return n.index<t.index?-1:1}),"value")};
// An internal function used for aggregate "group by" operations.
var F=function(n,t,r,e){var u={},i=k(t||j.identity);return A(n,function(t,a){var o=i.call(r,t,a,n);e(u,o,t)}),u};
// Groups the object's values by a criterion. Pass either a string attribute
// to group by, or a function that returns the criterion.
j.groupBy=function(n,t,r){return F(n,t,r,function(n,t,r){(j.has(n,t)?n[t]:n[t]=[]).push(r)})},
// Counts instances of an object that group by a certain criterion. Pass
// either a string attribute to count by, or a function that returns the
// criterion.
j.countBy=function(n,t,r){return F(n,t,r,function(n,t){j.has(n,t)||(n[t]=0),n[t]++})},
// Use a comparator function to figure out the smallest index at which
// an object should be inserted so as to maintain order. Uses binary search.
j.sortedIndex=function(n,t,r,e){r=null==r?j.identity:k(r);for(var u=r.call(e,t),i=0,a=n.length;i<a;){var o=i+a>>>1;r.call(e,n[o])<u?i=o+1:a=o}return i},
// Safely convert anything iterable into a real, live array.
j.toArray=function(n){return n?j.isArray(n)?o.call(n):n.length===+n.length?j.map(n,j.identity):j.values(n):[]},
// Return the number of elements in an object.
j.size=function(n){return null==n?0:n.length===+n.length?n.length:j.keys(n).length},
// Array Functions
// ---------------
// Get the first element of an array. Passing **n** will return the first N
// values in the array. Aliased as `head` and `take`. The **guard** check
// allows it to work with `_.map`.
j.first=j.head=j.take=function(n,t,r){if(null!=n)return null==t||r?n[0]:o.call(n,0,t)},
// Returns everything but the last entry of the array. Especially useful on
// the arguments object. Passing **n** will return all the values in
// the array, excluding the last N. The **guard** check allows it to work with
// `_.map`.
j.initial=function(n,t,r){return o.call(n,0,n.length-(null==t||r?1:t))},
// Get the last element of an array. Passing **n** will return the last N
// values in the array. The **guard** check allows it to work with `_.map`.
j.last=function(n,t,r){if(null!=n)return null==t||r?n[n.length-1]:o.call(n,Math.max(n.length-t,0))},
// Returns everything but the first entry of the array. Aliased as `tail` and `drop`.
// Especially useful on the arguments object. Passing an **n** will return
// the rest N values in the array. The **guard**
// check allows it to work with `_.map`.
j.rest=j.tail=j.drop=function(n,t,r){return o.call(n,null==t||r?1:t)},
// Trim out all falsy values from an array.
j.compact=function(n){return j.filter(n,j.identity)};
// Internal implementation of a recursive `flatten` function.
var R=function(n,t,r){return A(n,function(n){j.isArray(n)?t?a.apply(r,n):R(n,t,r):r.push(n)}),r};
// Return a completely flattened version of an array.
j.flatten=function(n,t){return R(n,t,[])},
// Return a version of the array that does not contain the specified value(s).
j.without=function(n){return j.difference(n,o.call(arguments,1))},
// Produce a duplicate-free version of the array. If the array has already
// been sorted, you have the option of using a faster algorithm.
// Aliased as `unique`.
j.uniq=j.unique=function(n,t,r,e){j.isFunction(t)&&(e=r,r=t,t=!1);var u=r?j.map(n,r,e):n,i=[],a=[];return A(u,function(r,e){(t?e&&a[a.length-1]===r:j.contains(a,r))||(a.push(r),i.push(n[e]))}),i},
// Produce an array that contains the union: each distinct element from all of
// the passed-in arrays.
j.union=function(){return j.uniq(c.apply(e,arguments))},
// Produce an array that contains every item shared between all the
// passed-in arrays.
j.intersection=function(n){var t=o.call(arguments,1);return j.filter(j.uniq(n),function(n){return j.every(t,function(t){return j.indexOf(t,n)>=0})})},
// Take the difference between one array and a number of other arrays.
// Only the elements present in just the first array will remain.
j.difference=function(n){var t=c.apply(e,o.call(arguments,1));return j.filter(n,function(n){return!j.contains(t,n)})},
// Zip together multiple lists into a single array -- elements that share
// an index go together.
j.zip=function(){for(var n=o.call(arguments),t=j.max(j.pluck(n,"length")),r=new Array(t),e=0;e<t;e++)r[e]=j.pluck(n,""+e);return r},
// Converts lists into objects. Pass either a single array of `[key, value]`
// pairs, or two parallel arrays of the same length -- one of keys, and one of
// the corresponding values.
j.object=function(n,t){if(null==n)return{};for(var r={},e=0,u=n.length;e<u;e++)t?r[n[e]]=t[e]:r[n[e][0]]=n[e][1];return r},
// If the browser doesn't supply us with indexOf (I'm looking at you, **MSIE**),
// we need this function. Return the position of the first occurrence of an
// item in an array, or -1 if the item is not included in the array.
// Delegates to **ECMAScript 5**'s native `indexOf` if available.
// If the array is large and already in sort order, pass `true`
// for **isSorted** to use binary search.
j.indexOf=function(n,t,r){if(null==n)return-1;var e=0,u=n.length;if(r){if("number"!=typeof r)return e=j.sortedIndex(n,t),n[e]===t?e:-1;e=r<0?Math.max(0,u+r):r}if(m&&n.indexOf===m)return n.indexOf(t,r);for(;e<u;e++)if(n[e]===t)return e;return-1},
// Delegates to **ECMAScript 5**'s native `lastIndexOf` if available.
j.lastIndexOf=function(n,t,r){if(null==n)return-1;var e=null!=r;if(b&&n.lastIndexOf===b)return e?n.lastIndexOf(t,r):n.lastIndexOf(t);for(var u=e?r:n.length;u--;)if(n[u]===t)return u;return-1},
// Generate an integer Array containing an arithmetic progression. A port of
// the native Python `range()` function. See
// [the Python documentation](http://docs.python.org/library/functions.html#range).
j.range=function(n,t,r){arguments.length<=1&&(t=n||0,n=0),r=arguments[2]||1;for(var e=Math.max(Math.ceil((t-n)/r),0),u=0,i=new Array(e);u<e;)i[u++]=n,n+=r;return i},
// Function (ahem) Functions
// ------------------
// Create a function bound to a given object (assigning `this`, and arguments,
// optionally). Delegates to **ECMAScript 5**'s native `Function.bind` if
// available.
j.bind=function(n,t){if(n.bind===w&&w)return w.apply(n,o.call(arguments,1));var r=o.call(arguments,2);return function(){return n.apply(t,r.concat(o.call(arguments)))}},
// Partially apply a function by creating a version that has had some of its
// arguments pre-filled, without changing its dynamic `this` context.
j.partial=function(n){var t=o.call(arguments,1);return function(){return n.apply(this,t.concat(o.call(arguments)))}},
// Bind all of an object's methods to that object. Useful for ensuring that
// all callbacks defined on an object belong to it.
j.bindAll=function(n){var t=o.call(arguments,1);if(0===t.length)throw new Error("bindAll must be passed function names");return A(t,function(t){n[t]=j.bind(n[t],n)}),n},
// Memoize an expensive function by storing its results.
j.memoize=function(n,t){var r={};return t||(t=j.identity),function(){var e=t.apply(this,arguments);return j.has(r,e)?r[e]:r[e]=n.apply(this,arguments)}},
// Delays a function for the given number of milliseconds, and then calls
// it with the arguments supplied.
j.delay=function(n,t){var r=o.call(arguments,2);return setTimeout(function(){return n.apply(null,r)},t)},
// Defers a function, scheduling it to run after the current call stack has
// cleared.
j.defer=function(n){return j.delay.apply(j,[n,1].concat(o.call(arguments,1)))},
// Returns a function, that, when invoked, will only be triggered at most once
// during a given window of time.
j.throttle=function(n,t){var r,e,u,i,a=0,o=function(){a=new Date,u=null,i=n.apply(r,e)};return function(){var c=new Date,l=t-(c-a);return r=this,e=arguments,l<=0?(clearTimeout(u),u=null,a=c,i=n.apply(r,e)):u||(u=setTimeout(o,l)),i}},
// Returns a function, that, as long as it continues to be invoked, will not
// be triggered. The function will be called after it stops being called for
// N milliseconds. If `immediate` is passed, trigger the function on the
// leading edge, instead of the trailing.
j.debounce=function(n,t,r){var e,u;return function(){var i=this,a=arguments,o=function(){e=null,r||(u=n.apply(i,a))},c=r&&!e;return clearTimeout(e),e=setTimeout(o,t),c&&(u=n.apply(i,a)),u}},
// Returns a function that will be executed at most one time, no matter how
// often you call it. Useful for lazy initialization.
j.once=function(n){var t,r=!1;return function(){return r?t:(r=!0,t=n.apply(this,arguments),n=null,t)}},
// Returns the first function passed as an argument to the second,
// allowing you to adjust arguments, run code before and after, and
// conditionally execute the original function.
j.wrap=function(n,t){return function(){var r=[n];return a.apply(r,arguments),t.apply(this,r)}},
// Returns a function that is the composition of a list of functions, each
// consuming the return value of the function that follows.
j.compose=function(){var n=arguments;return function(){for(var t=arguments,r=n.length-1;r>=0;r--)t=[n[r].apply(this,t)];return t[0]}},
// Returns a function that will only be executed after being called N times.
j.after=function(n,t){return n<=0?t():function(){if(--n<1)return t.apply(this,arguments)}},
// Object Functions
// ----------------
// Retrieve the names of an object's properties.
// Delegates to **ECMAScript 5**'s native `Object.keys`
j.keys=_||function(n){if(n!==Object(n))throw new TypeError("Invalid object");var t=[];for(var r in n)j.has(n,r)&&(t[t.length]=r);return t},
// Retrieve the values of an object's properties.
j.values=function(n){var t=[];for(var r in n)j.has(n,r)&&t.push(n[r]);return t},
// Convert an object into a list of `[key, value]` pairs.
j.pairs=function(n){var t=[];for(var r in n)j.has(n,r)&&t.push([r,n[r]]);return t},
// Invert the keys and values of an object. The values must be serializable.
j.invert=function(n){var t={};for(var r in n)j.has(n,r)&&(t[n[r]]=r);return t},
// Return a sorted list of the function names available on the object.
// Aliased as `methods`
j.functions=j.methods=function(n){var t=[];for(var r in n)j.isFunction(n[r])&&t.push(r);return t.sort()},
// Extend a given object with all the properties in passed-in object(s).
j.extend=function(n){return A(o.call(arguments,1),function(t){if(t)for(var r in t)n[r]=t[r]}),n},
// Return a copy of the object only containing the whitelisted properties.
j.pick=function(n){var t={},r=c.apply(e,o.call(arguments,1));return A(r,function(r){r in n&&(t[r]=n[r])}),t},
// Return a copy of the object without the blacklisted properties.
j.omit=function(n){var t={},r=c.apply(e,o.call(arguments,1));for(var u in n)j.contains(r,u)||(t[u]=n[u]);return t},
// Fill in a given object with default properties.
j.defaults=function(n){return A(o.call(arguments,1),function(t){if(t)for(var r in t)null==n[r]&&(n[r]=t[r])}),n},
// Create a (shallow-cloned) duplicate of an object.
j.clone=function(n){return j.isObject(n)?j.isArray(n)?n.slice():j.extend({},n):n},
// Invokes interceptor with the obj, and then returns obj.
// The primary purpose of this method is to "tap into" a method chain, in
// order to perform operations on intermediate results within the chain.
j.tap=function(n,t){return t(n),n};
// Internal recursive comparison function for `isEqual`.
var S=function(n,t,r,e){
// Identical objects are equal. `0 === -0`, but they aren't identical.
// See the Harmony `egal` proposal: http://wiki.ecmascript.org/doku.php?id=harmony:egal.
if(n===t)return 0!==n||1/n==1/t;
// A strict comparison is necessary because `null == undefined`.
if(null==n||null==t)return n===t;
// Unwrap any wrapped objects.
n instanceof j&&(n=n._wrapped),t instanceof j&&(t=t._wrapped);
// Compare `[[Class]]` names.
var u=l.call(n);if(u!=l.call(t))return!1;switch(u){
// Strings, numbers, dates, and booleans are compared by value.
case"[object String]":
// Primitives and their corresponding object wrappers are equivalent; thus, `"5"` is
// equivalent to `new String("5")`.
return n==String(t);case"[object Number]":
// `NaN`s are equivalent, but non-reflexive. An `egal` comparison is performed for
// other numeric values.
return n!=+n?t!=+t:0==n?1/n==1/t:n==+t;case"[object Date]":case"[object Boolean]":
// Coerce dates and booleans to numeric primitive values. Dates are compared by their
// millisecond representations. Note that invalid dates with millisecond representations
// of `NaN` are not equivalent.
return+n==+t;
// RegExps are compared by their source patterns and flags.
case"[object RegExp]":return n.source==t.source&&n.global==t.global&&n.multiline==t.multiline&&n.ignoreCase==t.ignoreCase}if("object"!=typeof n||"object"!=typeof t)return!1;for(
// Assume equality for cyclic structures. The algorithm for detecting cyclic
// structures is adapted from ES 5.1 section 15.12.3, abstract operation `JO`.
var i=r.length;i--;)
// Linear search. Performance is inversely proportional to the number of
// unique nested structures.
if(r[i]==n)return e[i]==t;
// Add the first object to the stack of traversed objects.
r.push(n),e.push(t);var a=0,o=!0;
// Recursively compare objects and arrays.
if("[object Array]"==u){if(
// Compare array lengths to determine if a deep comparison is necessary.
a=n.length,o=a==t.length)
// Deep compare the contents, ignoring non-numeric properties.
for(;a--&&(o=S(n[a],t[a],r,e)););}else{
// Objects with different constructors are not equivalent, but `Object`s
// from different frames are.
var c=n.constructor,f=t.constructor;if(c!==f&&!(j.isFunction(c)&&c instanceof c&&j.isFunction(f)&&f instanceof f))return!1;
// Deep compare objects.
for(var s in n)if(j.has(n,s)&&(
// Count the expected number of properties.
a++,!(o=j.has(t,s)&&S(n[s],t[s],r,e))))break;
// Ensure that both objects contain the same number of properties.
if(o){for(s in t)if(j.has(t,s)&&!a--)break;o=!a}}
// Remove the first object from the stack of traversed objects.
return r.pop(),e.pop(),o};
// Perform a deep comparison to check if two objects are equal.
j.isEqual=function(n,t){return S(n,t,[],[])},
// Is a given array, string, or object empty?
// An "empty" object has no enumerable own-properties.
j.isEmpty=function(n){if(null==n)return!0;if(j.isArray(n)||j.isString(n))return 0===n.length;for(var t in n)if(j.has(n,t))return!1;return!0},
// Is a given value a DOM element?
j.isElement=function(n){return!(!n||1!==n.nodeType)},
// Is a given value an array?
// Delegates to ECMA5's native Array.isArray
j.isArray=x||function(n){return"[object Array]"==l.call(n)},
// Is a given variable an object?
j.isObject=function(n){return n===Object(n)},
// Add some isType methods: isArguments, isFunction, isString, isNumber, isDate, isRegExp.
A(["Arguments","Function","String","Number","Date","RegExp"],function(n){j["is"+n]=function(t){return l.call(t)=="[object "+n+"]"}}),
// Define a fallback version of the method in browsers (ahem, IE), where
// there isn't any inspectable "Arguments" type.
j.isArguments(arguments)||(j.isArguments=function(n){return!(!n||!j.has(n,"callee"))}),
// Optimize `isFunction` if appropriate.
"function"!=typeof/./&&(j.isFunction=function(n){return"function"==typeof n}),
// Is a given object a finite number?
j.isFinite=function(n){return isFinite(n)&&!isNaN(parseFloat(n))},
// Is the given value `NaN`? (NaN is the only number which does not equal itself).
j.isNaN=function(n){return j.isNumber(n)&&n!=+n},
// Is a given value a boolean?
j.isBoolean=function(n){return n===!0||n===!1||"[object Boolean]"==l.call(n)},
// Is a given value equal to null?
j.isNull=function(n){return null===n},
// Is a given variable undefined?
j.isUndefined=function(n){return void 0===n},
// Shortcut function for checking if an object has a given property directly
// on itself (in other words, not on a prototype).
j.has=function(n,t){return f.call(n,t)},
// Utility Functions
// -----------------
// Run Underscore.js in *noConflict* mode, returning the `_` variable to its
// previous owner. Returns a reference to the Underscore object.
j.noConflict=function(){return n._=t,this},
// Keep the identity function around for default iterators.
j.identity=function(n){return n},
// Run a function **n** times.
j.times=function(n,t,r){for(var e=Array(n),u=0;u<n;u++)e[u]=t.call(r,u);return e},
// Return a random integer between min and max (inclusive).
j.random=function(n,t){return null==t&&(t=n,n=0),n+Math.floor(Math.random()*(t-n+1))};
// List of HTML entities for escaping.
var I={escape:{"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#x27;","/":"&#x2F;"}};I.unescape=j.invert(I.escape);
// Regexes containing the keys and values listed immediately above.
var M={escape:new RegExp("["+j.keys(I.escape).join("")+"]","g"),unescape:new RegExp("("+j.keys(I.unescape).join("|")+")","g")};
// Functions for escaping and unescaping strings to/from HTML interpolation.
j.each(["escape","unescape"],function(n){j[n]=function(t){return null==t?"":(""+t).replace(M[n],function(t){return I[n][t]})}}),
// If the value of the named property is a function then invoke it;
// otherwise, return it.
j.result=function(n,t){if(null!=n){var r=n[t];return j.isFunction(r)?r.call(n):r}},
// Add your own custom functions to the Underscore object.
j.mixin=function(n){A(j.functions(n),function(t){var r=j[t]=n[t];j.prototype[t]=function(){var n=[this._wrapped];return a.apply(n,arguments),D.call(this,r.apply(j,n))}})};
// Generate a unique integer id (unique within the entire client session).
// Useful for temporary DOM ids.
var N=0;j.uniqueId=function(n){var t=++N+"";return n?n+t:t},
// By default, Underscore uses ERB-style template delimiters, change the
// following template settings to use alternative delimiters.
j.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g};
// When customizing `templateSettings`, if you don't want to define an
// interpolation, evaluation or escaping regex, we need one that is
// guaranteed not to match.
var T=/(.)^/,q={"'":"'","\\":"\\","\r":"r","\n":"n","\t":"t","\u2028":"u2028","\u2029":"u2029"},B=/\\|'|\r|\n|\t|\u2028|\u2029/g;
// JavaScript micro-templating, similar to John Resig's implementation.
// Underscore templating handles arbitrary delimiters, preserves whitespace,
// and correctly escapes quotes within interpolated code.
j.template=function(n,t,r){var e;r=j.defaults({},r,j.templateSettings);
// Combine delimiters into one regular expression via alternation.
var u=new RegExp([(r.escape||T).source,(r.interpolate||T).source,(r.evaluate||T).source].join("|")+"|$","g"),i=0,a="__p+='";n.replace(u,function(t,r,e,u,o){return a+=n.slice(i,o).replace(B,function(n){return"\\"+q[n]}),r&&(a+="'+\n((__t=("+r+"))==null?'':_.escape(__t))+\n'"),e&&(a+="'+\n((__t=("+e+"))==null?'':__t)+\n'"),u&&(a+="';\n"+u+"\n__p+='"),i=o+t.length,t}),a+="';\n",
// If a variable is not specified, place data values in local scope.
r.variable||(a="with(obj||{}){\n"+a+"}\n"),a="var __t,__p='',__j=Array.prototype.join,print=function(){__p+=__j.call(arguments,'');};\n"+a+"return __p;\n";try{e=new Function(r.variable||"obj","_",a)}catch(o){throw o.source=a,o}if(t)return e(t,j);var c=function(n){return e.call(this,n,j)};
// Provide the compiled function source as a convenience for precompilation.
return c.source="function("+(r.variable||"obj")+"){\n"+a+"}",c},
// Add a "chain" function, which will delegate to the wrapper.
j.chain=function(n){return j(n).chain()};
// OOP
// ---------------
// If Underscore is called as a function, it returns a wrapped object that
// can be used OO-style. This wrapper holds altered versions of all the
// underscore functions. Wrapped objects may be chained.
// Helper function to continue chaining intermediate results.
var D=function(n){return this._chain?j(n).chain():n};
// Add all of the Underscore functions to the wrapper object.
j.mixin(j),
// Add all mutator Array functions to the wrapper.
A(["pop","push","reverse","shift","sort","splice","unshift"],function(n){var t=e[n];j.prototype[n]=function(){var r=this._wrapped;return t.apply(r,arguments),"shift"!=n&&"splice"!=n||0!==r.length||delete r[0],D.call(this,r)}}),
// Add all accessor Array functions to the wrapper.
A(["concat","join","slice"],function(n){var t=e[n];j.prototype[n]=function(){return D.call(this,t.apply(this._wrapped,arguments))}}),j.extend(j.prototype,{
// Start chaining a wrapped Underscore object.
chain:function(){return this._chain=!0,this},
// Extracts the result from a wrapped and chained object.
value:function(){return this._wrapped}})}).call(this);

!function(t){"use strict";function e(t){return t=t.toString(),t.length<2?"0"+t:t}EE.formatDate=function(n,o){n=n||new Date,o=t.extend({time_format:"12",include_seconds:"n"},o);var u=n.getHours(),r=e(n.getMinutes()),i=e(n.getSeconds()),s=[],a="";return"12"==o.time_format&&(a=u<12?" AM":" PM",u=u%12||12),s.push(u),s.push(r),"y"==o.include_seconds&&s.push(i)," '"+s.join(":")+a+"'"},EE.date_obj_time=EE.formatDate(new Date,EE.date)}(jQuery);

var smiley_map = {};function insert_smiley(smiley, field_id) {var el = document.getElementsByName(field_id)[0], newStart;if ( ! el && smiley_map[field_id]) {el = document.getElementById(smiley_map[field_id]);if ( ! el)return false;}el.focus();smiley = " " + smiley;if ('selectionStart' in el) {newStart = el.selectionStart + smiley.length;el.value = el.value.substr(0, el.selectionStart) +smiley +el.value.substr(el.selectionEnd, el.value.length);el.setSelectionRange(newStart, newStart);}else if (document.selection) {document.selection.createRange().text = smiley;}}

/*!
 * ExpressionEngine - by EllisLab
 *
 * @package		ExpressionEngine
 * @author		EllisLab Dev Team
 * @copyright	Copyright (c) 2003 - 2015, EllisLab, Inc.
 * @license		http://ellislab.com/expressionengine/user-guide/license.html
 * @link		http://ellislab.com
 * @since		Version 2.0
 * @filesource
 */
//Dynamically set the textarea name
function setFieldName(e){e!=selField&&(selField=e,clear_state(),tagarray=new Array,usedarray=new Array,running=0)}
// Insert tag
function taginsert(item,tagOpen,tagClose){
// Determine which tag we are dealing with
var which=eval("item.name");if(!selField)return $.ee_notice(no_cursor),!1;var theSelection=!1,result=!1,theField=document.getElementById("entryform")[selField];
// Is this a Windows user?
// If so, add tags around selection
if("guided"==selMode&&(data=prompt(enter_text,""),null!=data&&""!=data&&(result=tagOpen+data+tagClose)),document.selection)return theSelection=document.selection.createRange().text,theField.focus(),theSelection?document.selection.createRange().text=0==result?tagOpen+theSelection+tagClose:result:document.selection.createRange().text=0==result?tagOpen+tagClose:result,theSelection="",theField.blur(),void theField.focus();if(!isNaN(theField.selectionEnd)){var newStart,scrollPos=theField.scrollTop,selLength=theField.textLength,selStart=theField.selectionStart,selEnd=theField.selectionEnd;selEnd<=2&&"undefined"!=typeof selLength&&(selEnd=selLength);var s1=theField.value.substring(0,selStart),s2=theField.value.substring(selStart,selEnd).s3=theField.value.substring(selEnd,selLength);return 0==result?(newStart=selStart+tagOpen.length+s2.length+tagClose.length,theField.value=0==result?s1+tagOpen+s2+tagClose+s3:result):(newStart=selStart+result.length,theField.value=s1+result+s3),theField.focus(),theField.selectionStart=newStart,theField.selectionEnd=newStart,void(theField.scrollTop=scrollPos)}if("guided"==selMode)return curField=document.submit_post[selfField],curField.value+=result,curField.blur(),void curField.focus();
// Add single open tags
if("other"==item)eval("document.getElementById('entryform')."+selField+".value += tagOpen");else if(0==eval(which)){var result=tagOpen;eval("document.getElementById('entryform')."+selField+".value += result"),eval(which+" = 1"),arraypush(tagarray,tagClose),arraypush(usedarray,which),running++,styleswap(which)}else{for(
// Close tags
n=0,i=0;i<tagarray.length;i++)if(tagarray[i]==tagClose){for(n=i,running--;tagarray[n];)closeTag=arraypop(tagarray),eval("document.getElementById('entryform')."+selField+".value += closeTag");for(;usedarray[n];)clearState=arraypop(usedarray),eval(clearState+" = 0"),document.getElementById(clearState).className="htmlButtonA"}running<=0&&"htmlButtonB"==document.getElementById("close_all").className&&(document.getElementById("close_all").className="htmlButtonA")}curField=eval("document.getElementById('entryform')."+selField),curField.blur(),curField.focus()}var selField=!1,selMode="normal";$(document).ready(function(){$(".js_show").show(),$(".js_hide").hide(),void 0!==EE.publish.markitup&&void 0!==EE.publish.markitup.fields&&$.each(EE.publish.markitup.fields,function(e,t){$("#"+e).markItUp(mySettings)}),EE.publish.smileys===!0&&($("a.glossary_link").click(function(){return $(this).parent().siblings(".glossary_content").slideToggle("fast"),$(this).parent().siblings(".smileyContent .spellcheck_content").hide(),!1}),$("a.smiley_link").toggle(function(){which=$(this).attr("id").substr(12),$("#smiley_table_"+which).slideDown("fast",function(){$(this).css("display","")})},function(){$("#smiley_table_"+which).slideUp("fast")}),$(this).parent().siblings(".glossary_content, .spellcheck_content").hide(),$(".glossary_content a").click(function(){return $.markItUp({replaceWith:$(this).attr("title")}),!1})),$(".btn_plus a").click(function(){return confirm(EE.lang.confirm_exit,"")}),
// inject the collapse button into the formatting buttons list
$(".markItUpHeader ul").prepend('<li class="close_formatting_buttons"><a href="#"><img width="10" height="10" src="'+EE.THEME_URL+'images/publish_minus.gif" alt="Close Formatting Buttons"/></a></li>'),$(".close_formatting_buttons a").toggle(function(){$(this).parent().parent().children(":not(.close_formatting_buttons)").hide(),$(this).parent().parent().css("height","13px"),$(this).children("img").attr("src",EE.THEME_URL+"images/publish_plus.png")},function(){$(this).parent().parent().children().show(),$(this).parent().parent().css("height","auto"),$(this).children("img").attr("src",EE.THEME_URL+"images/publish_minus.gif")});var e="";EE.publish.show_write_mode===!0&&$("#write_mode_textarea").markItUp(myWritemodeSettings),$(".write_mode_trigger").click(function(){
// put contents from other page into here
return e=$(this).attr("id").match(/^id_\d+$/)?"field_"+$(this).attr("id"):$(this).attr("id").replace(/id_/,""),$("#write_mode_textarea").val($("#"+e).val()),$("#write_mode_textarea").focus(),!1})});