"; // Close datepicker_header
+ return html;
+ },
+
+ /* Adjust one of the date sub-fields. */
+ _adjustInstDate: function(inst, offset, period) {
+ var year = inst.drawYear + (period === "Y" ? offset : 0),
+ month = inst.drawMonth + (period === "M" ? offset : 0),
+ day = Math.min(inst.selectedDay, this._getDaysInMonth(year, month)) + (period === "D" ? offset : 0),
+ date = this._restrictMinMax(inst, this._daylightSavingAdjust(new Date(year, month, day)));
+
+ inst.selectedDay = date.getDate();
+ inst.drawMonth = inst.selectedMonth = date.getMonth();
+ inst.drawYear = inst.selectedYear = date.getFullYear();
+ if (period === "M" || period === "Y") {
+ this._notifyChange(inst);
+ }
+ },
+
+ /* Ensure a date is within any min/max bounds. */
+ _restrictMinMax: function(inst, date) {
+ var minDate = this._getMinMaxDate(inst, "min"),
+ maxDate = this._getMinMaxDate(inst, "max"),
+ newDate = (minDate && date < minDate ? minDate : date);
+ return (maxDate && newDate > maxDate ? maxDate : newDate);
+ },
+
+ /* Notify change of month/year. */
+ _notifyChange: function(inst) {
+ var onChange = this._get(inst, "onChangeMonthYear");
+ if (onChange) {
+ onChange.apply((inst.input ? inst.input[0] : null),
+ [inst.selectedYear, inst.selectedMonth + 1, inst]);
+ }
+ },
+
+ /* Determine the number of months to show. */
+ _getNumberOfMonths: function(inst) {
+ var numMonths = this._get(inst, "numberOfMonths");
+ return (numMonths == null ? [1, 1] : (typeof numMonths === "number" ? [1, numMonths] : numMonths));
+ },
+
+ /* Determine the current maximum date - ensure no time components are set. */
+ _getMinMaxDate: function(inst, minMax) {
+ return this._determineDate(inst, this._get(inst, minMax + "Date"), null);
+ },
+
+ /* Find the number of days in a given month. */
+ _getDaysInMonth: function(year, month) {
+ return 32 - this._daylightSavingAdjust(new Date(year, month, 32)).getDate();
+ },
+
+ /* Find the day of the week of the first of a month. */
+ _getFirstDayOfMonth: function(year, month) {
+ return new Date(year, month, 1).getDay();
+ },
+
+ /* Determines if we should allow a "next/prev" month display change. */
+ _canAdjustMonth: function(inst, offset, curYear, curMonth) {
+ var numMonths = this._getNumberOfMonths(inst),
+ date = this._daylightSavingAdjust(new Date(curYear,
+ curMonth + (offset < 0 ? offset : numMonths[0] * numMonths[1]), 1));
+
+ if (offset < 0) {
+ date.setDate(this._getDaysInMonth(date.getFullYear(), date.getMonth()));
+ }
+ return this._isInRange(inst, date);
+ },
+
+ /* Is the given date in the accepted range? */
+ _isInRange: function(inst, date) {
+ var yearSplit, currentYear,
+ minDate = this._getMinMaxDate(inst, "min"),
+ maxDate = this._getMinMaxDate(inst, "max"),
+ minYear = null,
+ maxYear = null,
+ years = this._get(inst, "yearRange");
+ if (years){
+ yearSplit = years.split(":");
+ currentYear = new Date().getFullYear();
+ minYear = parseInt(yearSplit[0], 10);
+ maxYear = parseInt(yearSplit[1], 10);
+ if ( yearSplit[0].match(/[+\-].*/) ) {
+ minYear += currentYear;
+ }
+ if ( yearSplit[1].match(/[+\-].*/) ) {
+ maxYear += currentYear;
+ }
+ }
+
+ return ((!minDate || date.getTime() >= minDate.getTime()) &&
+ (!maxDate || date.getTime() <= maxDate.getTime()) &&
+ (!minYear || date.getFullYear() >= minYear) &&
+ (!maxYear || date.getFullYear() <= maxYear));
+ },
+
+ /* Provide the configuration settings for formatting/parsing. */
+ _getFormatConfig: function(inst) {
+ var shortYearCutoff = this._get(inst, "shortYearCutoff");
+ shortYearCutoff = (typeof shortYearCutoff !== "string" ? shortYearCutoff :
+ new Date().getFullYear() % 100 + parseInt(shortYearCutoff, 10));
+ return {shortYearCutoff: shortYearCutoff,
+ dayNamesShort: this._get(inst, "dayNamesShort"), dayNames: this._get(inst, "dayNames"),
+ monthNamesShort: this._get(inst, "monthNamesShort"), monthNames: this._get(inst, "monthNames")};
+ },
+
+ /* Format the given date for display. */
+ _formatDate: function(inst, day, month, year) {
+ if (!day) {
+ inst.currentDay = inst.selectedDay;
+ inst.currentMonth = inst.selectedMonth;
+ inst.currentYear = inst.selectedYear;
+ }
+ var date = (day ? (typeof day === "object" ? day :
+ this._daylightSavingAdjust(new Date(year, month, day))) :
+ this._daylightSavingAdjust(new Date(inst.currentYear, inst.currentMonth, inst.currentDay)));
+ return this.formatDate(this._get(inst, "dateFormat"), date, this._getFormatConfig(inst));
+ }
+});
+
+/*
+ * Bind hover events for datepicker elements.
+ * Done via delegate so the binding only occurs once in the lifetime of the parent div.
+ * Global datepicker_instActive, set by _updateDatepicker allows the handlers to find their way back to the active picker.
+ */
+function datepicker_bindHover(dpDiv) {
+ var selector = "button, .ui-datepicker-prev, .ui-datepicker-next, .ui-datepicker-calendar td a";
+ return dpDiv.delegate(selector, "mouseout", function() {
+ $(this).removeClass("ui-state-hover");
+ if (this.className.indexOf("ui-datepicker-prev") !== -1) {
+ $(this).removeClass("ui-datepicker-prev-hover");
+ }
+ if (this.className.indexOf("ui-datepicker-next") !== -1) {
+ $(this).removeClass("ui-datepicker-next-hover");
+ }
+ })
+ .delegate( selector, "mouseover", datepicker_handleMouseover );
+}
+
+function datepicker_handleMouseover() {
+ if (!$.datepicker._isDisabledDatepicker( datepicker_instActive.inline? datepicker_instActive.dpDiv.parent()[0] : datepicker_instActive.input[0])) {
+ $(this).parents(".ui-datepicker-calendar").find("a").removeClass("ui-state-hover");
+ $(this).addClass("ui-state-hover");
+ if (this.className.indexOf("ui-datepicker-prev") !== -1) {
+ $(this).addClass("ui-datepicker-prev-hover");
+ }
+ if (this.className.indexOf("ui-datepicker-next") !== -1) {
+ $(this).addClass("ui-datepicker-next-hover");
+ }
+ }
+}
+
+/* jQuery extend now ignores nulls! */
+function datepicker_extendRemove(target, props) {
+ $.extend(target, props);
+ for (var name in props) {
+ if (props[name] == null) {
+ target[name] = props[name];
+ }
+ }
+ return target;
+}
+
+/* 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(options){
+
+ /* Verify an empty collection wasn't passed - Fixes #6976 */
+ if ( !this.length ) {
+ return this;
+ }
+
+ /* Initialise the date picker. */
+ if (!$.datepicker.initialized) {
+ $(document).mousedown($.datepicker._checkExternalClick);
+ $.datepicker.initialized = true;
+ }
+
+ /* Append datepicker main container to body if not exist. */
+ if ($("#"+$.datepicker._mainDivId).length === 0) {
+ $("body").append($.datepicker.dpDiv);
+ }
+
+ var otherArgs = Array.prototype.slice.call(arguments, 1);
+ if (typeof options === "string" && (options === "isDisabled" || options === "getDate" || options === "widget")) {
+ return $.datepicker["_" + options + "Datepicker"].
+ apply($.datepicker, [this[0]].concat(otherArgs));
+ }
+ if (options === "option" && arguments.length === 2 && typeof arguments[1] === "string") {
+ return $.datepicker["_" + options + "Datepicker"].
+ apply($.datepicker, [this[0]].concat(otherArgs));
+ }
+ return this.each(function() {
+ typeof options === "string" ?
+ $.datepicker["_" + options + "Datepicker"].
+ apply($.datepicker, [this].concat(otherArgs)) :
+ $.datepicker._attachDatepicker(this, options);
+ });
+};
+
+$.datepicker = new Datepicker(); // singleton instance
+$.datepicker.initialized = false;
+$.datepicker.uuid = new Date().getTime();
+$.datepicker.version = "1.11.4";
+
+var datepicker = $.datepicker;
+
+
+
+}));;/**
* Ajax Queue Plugin
*
* Homepage: http://jquery.com/plugins/project/ajaxqueue
@@ -13223,1222 +15605,7 @@ Date.fullYearStart = '20';
//return ('0'+num).substring(-2); // doesn't work on IE :(
};
-})();;/**
- * Copyright (c) 2008 Kelvin Luck (http://www.kelvinluck.com/)
- * Dual licensed under the MIT (http://www.opensource.org/licenses/mit-license.php)
- * and GPL (http://www.opensource.org/licenses/gpl-license.php) licenses.
- * .
- * $Id: jquery.datePicker.js 102 2010-09-13 14:00:54Z kelvin.luck $
- **/
-
-(function($){
-
- $.fn.extend({
-/**
- * Render a calendar table into any matched elements.
- *
- * @param Object s (optional) Customize your calendars.
- * @option Number month The month to render (NOTE that months are zero based). Default is today's month.
- * @option Number year The year to render. Default is today's year.
- * @option Function renderCallback A reference to a function that is called as each cell is rendered and which can add classes and event listeners to the created nodes. Default is no callback.
- * @option Number showHeader Whether or not to show the header row, possible values are: $.dpConst.SHOW_HEADER_NONE (no header), $.dpConst.SHOW_HEADER_SHORT (first letter of each day) and $.dpConst.SHOW_HEADER_LONG (full name of each day). Default is $.dpConst.SHOW_HEADER_SHORT.
- * @option String hoverClass The class to attach to each cell when you hover over it (to allow you to use hover effects in IE6 which doesn't support the :hover pseudo-class on elements other than links). Default is dp-hover. Pass false if you don't want a hover class.
- * @type jQuery
- * @name renderCalendar
- * @cat plugins/datePicker
- * @author Kelvin Luck (http://www.kelvinluck.com/)
- *
- * @example $('#calendar-me').renderCalendar({month:0, year:2007});
- * @desc Renders a calendar displaying January 2007 into the element with an id of calendar-me.
- *
- * @example
- * var testCallback = function($td, thisDate, month, year)
- * {
- * if ($td.is('.current-month') && thisDate.getDay() == 4) {
- * var d = thisDate.getDate();
- * $td.bind(
- * 'click',
- * function()
- * {
- * alert('You clicked on ' + d + '/' + (Number(month)+1) + '/' + year);
- * }
- * ).addClass('thursday');
- * } else if (thisDate.getDay() == 5) {
- * $td.html('Friday the ' + $td.html() + 'th');
- * }
- * }
- * $('#calendar-me').renderCalendar({month:0, year:2007, renderCallback:testCallback});
- *
- * @desc Renders a calendar displaying January 2007 into the element with an id of calendar-me. Every Thursday in the current month has a class of "thursday" applied to it, is clickable and shows an alert when clicked. Every Friday on the calendar has the number inside replaced with text.
- **/
- renderCalendar : function(s)
- {
- var dc = function(a)
- {
- return document.createElement(a);
- };
-
- s = $.extend({}, $.fn.datePicker.defaults, s);
-
- if (s.showHeader != $.dpConst.SHOW_HEADER_NONE) {
- var headRow = $(dc('tr'));
- for (var i=Date.firstDayOfWeek; i 1) firstDayOffset -= 7;
- var weeksToDraw = Math.ceil(( (-1*firstDayOffset+1) + currentDate.getDaysInMonth() ) /7);
- currentDate.addDays(firstDayOffset-1);
-
- var doHover = function(firstDayInBounds)
- {
- return function()
- {
- if (s.hoverClass) {
- var $this = $(this);
- if (!s.selectWeek) {
- $this.addClass(s.hoverClass);
- } else if (firstDayInBounds && !$this.is('.disabled')) {
- $this.parent().addClass('activeWeekHover');
- }
- }
- }
- };
- var unHover = function()
- {
- if (s.hoverClass) {
- var $this = $(this);
- $this.removeClass(s.hoverClass);
- $this.parent().removeClass('activeWeekHover');
- }
- };
-
- var w = 0;
- while (w++ s.dpController.startDate : false;
- for (var i=0; i<7; i++) {
- var thisMonth = currentDate.getMonth() == month;
- var d = $(dc('td'))
- .text(currentDate.getDate() + '')
- .addClass((thisMonth ? 'current-month ' : 'other-month ') +
- (currentDate.isWeekend() ? 'weekend ' : 'weekday ') +
- (thisMonth && currentDate.getTime() == today.getTime() ? 'today ' : '')
- )
- .data('datePickerDate', currentDate.asString())
- .hover(doHover(firstDayInBounds), unHover)
- ;
- r.append(d);
- if (s.renderCallback) {
- s.renderCallback(d, currentDate, month, year);
- }
- // addDays(1) fails in some locales due to daylight savings. See issue 39.
- //currentDate.addDays(1);
- // set the time to midday to avoid any weird timezone issues??
- currentDate = new Date(currentDate.getFullYear(), currentDate.getMonth(), currentDate.getDate()+1, 12, 0, 0);
- }
- tbody.append(r);
- }
- calendarTable.append(tbody);
-
- return this.each(
- function()
- {
- $(this).empty().append(calendarTable);
- }
- );
- },
-/**
- * Create a datePicker associated with each of the matched elements.
- *
- * The matched element will receive a few custom events with the following signatures:
- *
- * dateSelected(event, date, $td, status)
- * Triggered when a date is selected. event is a reference to the event, date is the Date selected, $td is a jquery object wrapped around the TD that was clicked on and status is whether the date was selected (true) or deselected (false)
- *
- * dpClosed(event, selected)
- * Triggered when the date picker is closed. event is a reference to the event and selected is an Array containing Date objects.
- *
- * dpMonthChanged(event, displayedMonth, displayedYear)
- * Triggered when the month of the popped up calendar is changed. event is a reference to the event, displayedMonth is the number of the month now displayed (zero based) and displayedYear is the year of the month.
- *
- * dpDisplayed(event, $datePickerDiv)
- * Triggered when the date picker is created. $datePickerDiv is the div containing the date picker. Use this event to add custom content/ listeners to the popped up date picker.
- *
- * @param Object s (optional) Customize your date pickers.
- * @option Number month The month to render when the date picker is opened (NOTE that months are zero based). Default is today's month.
- * @option Number year The year to render when the date picker is opened. Default is today's year.
- * @option String startDate The first date date can be selected.
- * @option String endDate The last date that can be selected.
- * @option Boolean inline Whether to create the datePicker as inline (e.g. always on the page) or as a model popup. Default is false (== modal popup)
- * @option Boolean createButton Whether to create a .dp-choose-date anchor directly after the matched element which when clicked will trigger the showing of the date picker. Default is true.
- * @option Boolean showYearNavigation Whether to display buttons which allow the user to navigate through the months a year at a time. Default is true.
- * @option Boolean closeOnSelect Whether to close the date picker when a date is selected. Default is true.
- * @option Boolean displayClose Whether to create a "Close" button within the date picker popup. Default is false.
- * @option Boolean selectMultiple Whether a user should be able to select multiple dates with this date picker. Default is false.
- * @option Number numSelectable The maximum number of dates that can be selected where selectMultiple is true. Default is a very high number.
- * @option Boolean clickInput If the matched element is an input type="text" and this option is true then clicking on the input will cause the date picker to appear.
- * @option Boolean rememberViewedMonth Whether the datePicker should remember the last viewed month and open on it. If false then the date picker will always open with the month for the first selected date visible.
- * @option Boolean selectWeek Whether to select a complete week at a time...
- * @option Number verticalPosition The vertical alignment of the popped up date picker to the matched element. One of $.dpConst.POS_TOP and $.dpConst.POS_BOTTOM. Default is $.dpConst.POS_TOP.
- * @option Number horizontalPosition The horizontal alignment of the popped up date picker to the matched element. One of $.dpConst.POS_LEFT and $.dpConst.POS_RIGHT.
- * @option Number verticalOffset The number of pixels offset from the defined verticalPosition of this date picker that it should pop up in. Default in 0.
- * @option Number horizontalOffset The number of pixels offset from the defined horizontalPosition of this date picker that it should pop up in. Default in 0.
- * @option (Function|Array) renderCallback A reference to a function (or an array of separate functions) that is called as each cell is rendered and which can add classes and event listeners to the created nodes. Each callback function will receive four arguments; a jquery object wrapping the created TD, a Date object containing the date this TD represents, a number giving the currently rendered month and a number giving the currently rendered year. Default is no callback.
- * @option String hoverClass The class to attach to each cell when you hover over it (to allow you to use hover effects in IE6 which doesn't support the :hover pseudo-class on elements other than links). Default is dp-hover. Pass false if you don't want a hover class.
- * @option String autoFocusNextInput Whether focus should be passed onto the next input in the form (true) or remain on this input (false) when a date is selected and the calendar closes
- * @type jQuery
- * @name datePicker
- * @cat plugins/datePicker
- * @author Kelvin Luck (http://www.kelvinluck.com/)
- *
- * @example $('input.date-picker').datePicker();
- * @desc Creates a date picker button next to all matched input elements. When the button is clicked on the value of the selected date will be placed in the corresponding input (formatted according to Date.format).
- *
- * @example demo/index.html
- * @desc See the projects homepage for many more complex examples...
- **/
- datePicker : function(s)
- {
- if (!$.event._dpCache) $.event._dpCache = [];
-
- // initialise the date picker controller with the relevant settings...
- s = $.extend({}, $.fn.datePicker.defaults, s);
-
- return this.each(
- function()
- {
- var $this = $(this);
- var alreadyExists = true;
-
- if (!this._dpId) {
- this._dpId = $.event.guid++;
- $.event._dpCache[this._dpId] = new DatePicker(this);
- alreadyExists = false;
- }
-
- if (s.inline) {
- s.createButton = false;
- s.displayClose = false;
- s.closeOnSelect = false;
- $this.empty();
- }
-
- var controller = $.event._dpCache[this._dpId];
-
- controller.init(s);
-
- if (!alreadyExists && s.createButton) {
- // create it!
- controller.button = $('' + $.dpText.TEXT_CHOOSE_DATE + '')
- .bind(
- 'click',
- function()
- {
- $this.dpDisplay(this);
- this.blur();
- return false;
- }
- );
- $this.after(controller.button);
- }
-
- if (!alreadyExists && $this.is(':text')) {
- $this
- .bind(
- 'dateSelected',
- function(e, selectedDate, $td)
- {
- this.value = selectedDate.asString();
- }
- ).bind(
- 'change',
- function()
- {
- if (this.value == '') {
- controller.clearSelected();
- } else {
- var d = Date.fromString(this.value);
- if (d) {
- controller.setSelected(d, true, true);
- }
- }
- }
- );
- if (s.clickInput) {
- $this.bind(
- 'click',
- function()
- {
- // The change event doesn't happen until the input loses focus so we need to manually trigger it...
- $this.trigger('change');
- $this.dpDisplay();
- }
- );
- }
- var d = Date.fromString(this.value);
- if (this.value != '' && d) {
- controller.setSelected(d, true, true);
- }
- }
-
- $this.addClass('dp-applied');
-
- }
- )
- },
-/**
- * Disables or enables this date picker
- *
- * @param Boolean s Whether to disable (true) or enable (false) this datePicker
- * @type jQuery
- * @name dpSetDisabled
- * @cat plugins/datePicker
- * @author Kelvin Luck (http://www.kelvinluck.com/)
- *
- * @example $('.date-picker').datePicker();
- * $('.date-picker').dpSetDisabled(true);
- * @desc Prevents this date picker from displaying and adds a class of dp-disabled to it (and it's associated button if it has one) for styling purposes. If the matched element is an input field then it will also set the disabled attribute to stop people directly editing the field.
- **/
- dpSetDisabled : function(s)
- {
- return _w.call(this, 'setDisabled', s);
- },
-/**
- * Updates the first selectable date for any date pickers on any matched elements.
- *
- * @param String d A string representing the first selectable date (formatted according to Date.format).
- * @type jQuery
- * @name dpSetStartDate
- * @cat plugins/datePicker
- * @author Kelvin Luck (http://www.kelvinluck.com/)
- *
- * @example $('.date-picker').datePicker();
- * $('.date-picker').dpSetStartDate('01/01/2000');
- * @desc Creates a date picker associated with all elements with a class of "date-picker" then sets the first selectable date for each of these to the first day of the millenium.
- **/
- dpSetStartDate : function(d)
- {
- return _w.call(this, 'setStartDate', d);
- },
-/**
- * Updates the last selectable date for any date pickers on any matched elements.
- *
- * @param String d A string representing the last selectable date (formatted according to Date.format).
- * @type jQuery
- * @name dpSetEndDate
- * @cat plugins/datePicker
- * @author Kelvin Luck (http://www.kelvinluck.com/)
- *
- * @example $('.date-picker').datePicker();
- * $('.date-picker').dpSetEndDate('01/01/2010');
- * @desc Creates a date picker associated with all elements with a class of "date-picker" then sets the last selectable date for each of these to the first Janurary 2010.
- **/
- dpSetEndDate : function(d)
- {
- return _w.call(this, 'setEndDate', d);
- },
-/**
- * Gets a list of Dates currently selected by this datePicker. This will be an empty array if no dates are currently selected or NULL if there is no datePicker associated with the matched element.
- *
- * @type Array
- * @name dpGetSelected
- * @cat plugins/datePicker
- * @author Kelvin Luck (http://www.kelvinluck.com/)
- *
- * @example $('.date-picker').datePicker();
- * alert($('.date-picker').dpGetSelected());
- * @desc Will alert an empty array (as nothing is selected yet)
- **/
- dpGetSelected : function()
- {
- var c = _getController(this[0]);
- if (c) {
- return c.getSelected();
- }
- return null;
- },
-/**
- * Selects or deselects a date on any matched element's date pickers. Deselcting is only useful on date pickers where selectMultiple==true. Selecting will only work if the passed date is within the startDate and endDate boundries for a given date picker.
- *
- * @param String d A string representing the date you want to select (formatted according to Date.format).
- * @param Boolean v Whether you want to select (true) or deselect (false) this date. Optional - default = true.
- * @param Boolean m Whether you want the date picker to open up on the month of this date when it is next opened. Optional - default = true.
- * @param Boolean e Whether you want the date picker to dispatch events related to this change of selection. Optional - default = true.
- * @type jQuery
- * @name dpSetSelected
- * @cat plugins/datePicker
- * @author Kelvin Luck (http://www.kelvinluck.com/)
- *
- * @example $('.date-picker').datePicker();
- * $('.date-picker').dpSetSelected('01/01/2010');
- * @desc Creates a date picker associated with all elements with a class of "date-picker" then sets the selected date on these date pickers to the first Janurary 2010. When the date picker is next opened it will display Janurary 2010.
- **/
- dpSetSelected : function(d, v, m, e)
- {
- if (v == undefined) v=true;
- if (m == undefined) m=true;
- if (e == undefined) e=true;
- return _w.call(this, 'setSelected', Date.fromString(d), v, m, e);
- },
-/**
- * Sets the month that will be displayed when the date picker is next opened. If the passed month is before startDate then the month containing startDate will be displayed instead. If the passed month is after endDate then the month containing the endDate will be displayed instead.
- *
- * @param Number m The month you want the date picker to display. Optional - defaults to the currently displayed month.
- * @param Number y The year you want the date picker to display. Optional - defaults to the currently displayed year.
- * @type jQuery
- * @name dpSetDisplayedMonth
- * @cat plugins/datePicker
- * @author Kelvin Luck (http://www.kelvinluck.com/)
- *
- * @example $('.date-picker').datePicker();
- * $('.date-picker').dpSetDisplayedMonth(10, 2008);
- * @desc Creates a date picker associated with all elements with a class of "date-picker" then sets the selected date on these date pickers to the first Janurary 2010. When the date picker is next opened it will display Janurary 2010.
- **/
- dpSetDisplayedMonth : function(m, y)
- {
- return _w.call(this, 'setDisplayedMonth', Number(m), Number(y), true);
- },
-/**
- * Displays the date picker associated with the matched elements. Since only one date picker can be displayed at once then the date picker associated with the last matched element will be the one that is displayed.
- *
- * @param HTMLElement e An element that you want the date picker to pop up relative in position to. Optional - default behaviour is to pop up next to the element associated with this date picker.
- * @type jQuery
- * @name dpDisplay
- * @cat plugins/datePicker
- * @author Kelvin Luck (http://www.kelvinluck.com/)
- *
- * @example $('#date-picker').datePicker();
- * $('#date-picker').dpDisplay();
- * @desc Creates a date picker associated with the element with an id of date-picker and then causes it to pop up.
- **/
- dpDisplay : function(e)
- {
- return _w.call(this, 'display', e);
- },
-/**
- * Sets a function or array of functions that is called when each TD of the date picker popup is rendered to the page
- *
- * @param (Function|Array) a A function or an array of functions that are called when each td is rendered. Each function will receive four arguments; a jquery object wrapping the created TD, a Date object containing the date this TD represents, a number giving the currently rendered month and a number giving the currently rendered year.
- * @type jQuery
- * @name dpSetRenderCallback
- * @cat plugins/datePicker
- * @author Kelvin Luck (http://www.kelvinluck.com/)
- *
- * @example $('#date-picker').datePicker();
- * $('#date-picker').dpSetRenderCallback(function($td, thisDate, month, year)
- * {
- * // do stuff as each td is rendered dependant on the date in the td and the displayed month and year
- * });
- * @desc Creates a date picker associated with the element with an id of date-picker and then creates a function which is called as each td is rendered when this date picker is displayed.
- **/
- dpSetRenderCallback : function(a)
- {
- return _w.call(this, 'setRenderCallback', a);
- },
-/**
- * Sets the position that the datePicker will pop up (relative to it's associated element)
- *
- * @param Number v The vertical alignment of the created date picker to it's associated element. Possible values are $.dpConst.POS_TOP and $.dpConst.POS_BOTTOM
- * @param Number h The horizontal alignment of the created date picker to it's associated element. Possible values are $.dpConst.POS_LEFT and $.dpConst.POS_RIGHT
- * @type jQuery
- * @name dpSetPosition
- * @cat plugins/datePicker
- * @author Kelvin Luck (http://www.kelvinluck.com/)
- *
- * @example $('#date-picker').datePicker();
- * $('#date-picker').dpSetPosition($.dpConst.POS_BOTTOM, $.dpConst.POS_RIGHT);
- * @desc Creates a date picker associated with the element with an id of date-picker and makes it so that when this date picker pops up it will be bottom and right aligned to the #date-picker element.
- **/
- dpSetPosition : function(v, h)
- {
- return _w.call(this, 'setPosition', v, h);
- },
-/**
- * Sets the offset that the popped up date picker will have from it's default position relative to it's associated element (as set by dpSetPosition)
- *
- * @param Number v The vertical offset of the created date picker.
- * @param Number h The horizontal offset of the created date picker.
- * @type jQuery
- * @name dpSetOffset
- * @cat plugins/datePicker
- * @author Kelvin Luck (http://www.kelvinluck.com/)
- *
- * @example $('#date-picker').datePicker();
- * $('#date-picker').dpSetOffset(-20, 200);
- * @desc Creates a date picker associated with the element with an id of date-picker and makes it so that when this date picker pops up it will be 20 pixels above and 200 pixels to the right of it's default position.
- **/
- dpSetOffset : function(v, h)
- {
- return _w.call(this, 'setOffset', v, h);
- },
-/**
- * Closes the open date picker associated with this element.
- *
- * @type jQuery
- * @name dpClose
- * @cat plugins/datePicker
- * @author Kelvin Luck (http://www.kelvinluck.com/)
- *
- * @example $('.date-pick')
- * .datePicker()
- * .bind(
- * 'focus',
- * function()
- * {
- * $(this).dpDisplay();
- * }
- * ).bind(
- * 'blur',
- * function()
- * {
- * $(this).dpClose();
- * }
- * );
- **/
- dpClose : function()
- {
- return _w.call(this, '_closeCalendar', false, this[0]);
- },
-/**
- * Rerenders the date picker's current month (for use with inline calendars and renderCallbacks).
- *
- * @type jQuery
- * @name dpRerenderCalendar
- * @cat plugins/datePicker
- * @author Kelvin Luck (http://www.kelvinluck.com/)
- *
- **/
- dpRerenderCalendar : function()
- {
- return _w.call(this, '_rerenderCalendar');
- },
- // private function called on unload to clean up any expandos etc and prevent memory links...
- _dpDestroy : function()
- {
- // TODO - implement this?
- }
- });
-
- // private internal function to cut down on the amount of code needed where we forward
- // dp* methods on the jQuery object on to the relevant DatePicker controllers...
- var _w = function(f, a1, a2, a3, a4)
- {
- return this.each(
- function()
- {
- var c = _getController(this);
- if (c) {
- c[f](a1, a2, a3, a4);
- }
- }
- );
- };
-
- function DatePicker(ele)
- {
- this.ele = ele;
-
- // initial values...
- this.displayedMonth = null;
- this.displayedYear = null;
- this.startDate = null;
- this.endDate = null;
- this.showYearNavigation = null;
- this.closeOnSelect = null;
- this.displayClose = null;
- this.rememberViewedMonth= null;
- this.selectMultiple = null;
- this.numSelectable = null;
- this.numSelected = null;
- this.verticalPosition = null;
- this.horizontalPosition = null;
- this.verticalOffset = null;
- this.horizontalOffset = null;
- this.button = null;
- this.renderCallback = [];
- this.selectedDates = {};
- this.inline = null;
- this.context = '#dp-popup';
- this.settings = {};
- };
- $.extend(
- DatePicker.prototype,
- {
- init : function(s)
- {
- this.setStartDate(s.startDate);
- this.setEndDate(s.endDate);
- this.setDisplayedMonth(Number(s.month), Number(s.year));
- this.setRenderCallback(s.renderCallback);
- this.showYearNavigation = s.showYearNavigation;
- this.closeOnSelect = s.closeOnSelect;
- this.displayClose = s.displayClose;
- this.rememberViewedMonth = s.rememberViewedMonth;
- this.selectMultiple = s.selectMultiple;
- this.numSelectable = s.selectMultiple ? s.numSelectable : 1;
- this.numSelected = 0;
- this.verticalPosition = s.verticalPosition;
- this.horizontalPosition = s.horizontalPosition;
- this.hoverClass = s.hoverClass;
- this.setOffset(s.verticalOffset, s.horizontalOffset);
- this.inline = s.inline;
- this.settings = s;
- if (this.inline) {
- this.context = this.ele;
- this.display();
- }
- },
- setStartDate : function(d)
- {
- if (d) {
- this.startDate = Date.fromString(d);
- }
- if (!this.startDate) {
- this.startDate = (new Date()).zeroTime();
- }
- this.setDisplayedMonth(this.displayedMonth, this.displayedYear);
- },
- setEndDate : function(d)
- {
- if (d) {
- this.endDate = Date.fromString(d);
- }
- if (!this.endDate) {
- this.endDate = (new Date('12/31/2999')); // using the JS Date.parse function which expects mm/dd/yyyy
- }
- if (this.endDate.getTime() < this.startDate.getTime()) {
- this.endDate = this.startDate;
- }
- this.setDisplayedMonth(this.displayedMonth, this.displayedYear);
- },
- setPosition : function(v, h)
- {
- this.verticalPosition = v;
- this.horizontalPosition = h;
- },
- setOffset : function(v, h)
- {
- this.verticalOffset = parseInt(v) || 0;
- this.horizontalOffset = parseInt(h) || 0;
- },
- setDisabled : function(s)
- {
- $e = $(this.ele);
- $e[s ? 'addClass' : 'removeClass']('dp-disabled');
- if (this.button) {
- $but = $(this.button);
- $but[s ? 'addClass' : 'removeClass']('dp-disabled');
- $but.attr('title', s ? '' : $.dpText.TEXT_CHOOSE_DATE);
- }
- if ($e.is(':text')) {
- $e.attr('disabled', s ? 'disabled' : '');
- }
- },
- setDisplayedMonth : function(m, y, rerender)
- {
- if (this.startDate == undefined || this.endDate == undefined) {
- return;
- }
- var s = new Date(this.startDate.getTime());
- s.setDate(1);
- var e = new Date(this.endDate.getTime());
- e.setDate(1);
-
- var t;
- if ((!m && !y) || (isNaN(m) && isNaN(y))) {
- // no month or year passed - default to current month
- t = new Date().zeroTime();
- t.setDate(1);
- } else if (isNaN(m)) {
- // just year passed in - presume we want the displayedMonth
- t = new Date(y, this.displayedMonth, 1);
- } else if (isNaN(y)) {
- // just month passed in - presume we want the displayedYear
- t = new Date(this.displayedYear, m, 1);
- } else {
- // year and month passed in - that's the date we want!
- t = new Date(y, m, 1)
- }
- // check if the desired date is within the range of our defined startDate and endDate
- if (t.getTime() < s.getTime()) {
- t = s;
- } else if (t.getTime() > e.getTime()) {
- t = e;
- }
- var oldMonth = this.displayedMonth;
- var oldYear = this.displayedYear;
- this.displayedMonth = t.getMonth();
- this.displayedYear = t.getFullYear();
-
- if (rerender && (this.displayedMonth != oldMonth || this.displayedYear != oldYear))
- {
- this._rerenderCalendar();
- $(this.ele).trigger('dpMonthChanged', [this.displayedMonth, this.displayedYear]);
- }
- },
- setSelected : function(d, v, moveToMonth, dispatchEvents)
- {
- if (d < this.startDate || d.zeroTime() > this.endDate.zeroTime()) {
- // Don't allow people to select dates outside range...
- return;
- }
- var s = this.settings;
- if (s.selectWeek)
- {
- d = d.addDays(- (d.getDay() - Date.firstDayOfWeek + 7) % 7);
- if (d < this.startDate) // The first day of this week is before the start date so is unselectable...
- {
- return;
- }
- }
- if (v == this.isSelected(d)) // this date is already un/selected
- {
- return;
- }
- if (this.selectMultiple == false) {
- this.clearSelected();
- } else if (v && this.numSelected == this.numSelectable) {
- // can't select any more dates...
- return;
- }
- if (moveToMonth && (this.displayedMonth != d.getMonth() || this.displayedYear != d.getFullYear())) {
- this.setDisplayedMonth(d.getMonth(), d.getFullYear(), true);
- }
- this.selectedDates[d.asString()] = v;
- this.numSelected += v ? 1 : -1;
- var selectorString = 'td.' + (d.getMonth() == this.displayedMonth ? 'current-month' : 'other-month');
- var $td;
- $(selectorString, this.context).each(
- function()
- {
- if ($(this).data('datePickerDate') == d.asString()) {
- $td = $(this);
- if (s.selectWeek)
- {
- $td.parent()[v ? 'addClass' : 'removeClass']('selectedWeek');
- }
- $td[v ? 'addClass' : 'removeClass']('selected');
- }
- }
- );
- $('td', this.context).not('.selected')[this.selectMultiple && this.numSelected == this.numSelectable ? 'addClass' : 'removeClass']('unselectable');
-
- if (dispatchEvents)
- {
- var s = this.isSelected(d);
- $e = $(this.ele);
- var dClone = Date.fromString(d.asString());
- $e.trigger('dateSelected', [dClone, $td, s]);
- $e.trigger('change');
- }
- },
- isSelected : function(d)
- {
- return this.selectedDates[d.asString()];
- },
- getSelected : function()
- {
- var r = [];
- for(var s in this.selectedDates) {
- if (this.selectedDates[s] == true) {
- r.push(Date.fromString(s));
- }
- }
- return r;
- },
- clearSelected : function()
- {
- this.selectedDates = {};
- this.numSelected = 0;
- $('td.selected', this.context).removeClass('selected').parent().removeClass('selectedWeek');
- },
- display : function(eleAlignTo)
- {
- if ($(this.ele).is('.dp-disabled')) return;
-
- eleAlignTo = eleAlignTo || this.ele;
- var c = this;
- var $ele = $(eleAlignTo);
- var eleOffset = $ele.offset();
-
- var $createIn;
- var attrs;
- var attrsCalendarHolder;
- var cssRules;
-
- if (c.inline) {
- $createIn = $(this.ele);
- attrs = {
- 'id' : 'calendar-' + this.ele._dpId,
- 'class' : 'dp-popup dp-popup-inline'
- };
-
- $('.dp-popup', $createIn).remove();
- cssRules = {
- };
- } else {
- $createIn = $('body');
- attrs = {
- 'id' : 'dp-popup',
- 'class' : 'dp-popup'
- };
- cssRules = {
- 'top' : eleOffset.top + c.verticalOffset,
- 'left' : eleOffset.left + c.horizontalOffset
- };
-
- var _checkMouse = function(e)
- {
- var el = e.target;
- var cal = $('#dp-popup')[0];
-
- while (true){
- if (el == cal) {
- return true;
- } else if (el == document) {
- c._closeCalendar();
- return false;
- } else {
- el = $(el).parent()[0];
- }
- }
- };
- this._checkMouse = _checkMouse;
-
- c._closeCalendar(true);
- $(document).bind(
- 'keydown.datepicker',
- function(event)
- {
- if (event.keyCode == 27) {
- c._closeCalendar();
- }
- }
- );
- }
-
- if (!c.rememberViewedMonth)
- {
- var selectedDate = this.getSelected()[0];
- if (selectedDate) {
- selectedDate = new Date(selectedDate);
- this.setDisplayedMonth(selectedDate.getMonth(), selectedDate.getFullYear(), false);
- }
- }
-
- $createIn
- .append(
- $('')
- .attr(attrs)
- .css(cssRules)
- .append(
-// $('aaa'),
- $(''),
- $('')
- .append(
- $('<<')
- .bind(
- 'click',
- function()
- {
- return c._displayNewMonth.call(c, this, 0, -1);
- }
- ),
- $('<')
- .bind(
- 'click',
- function()
- {
- return c._displayNewMonth.call(c, this, -1, 0);
- }
- )
- ),
- $('')
- .append(
- $('>>')
- .bind(
- 'click',
- function()
- {
- return c._displayNewMonth.call(c, this, 0, 1);
- }
- ),
- $('>')
- .bind(
- 'click',
- function()
- {
- return c._displayNewMonth.call(c, this, 1, 0);
- }
- )
- ),
- $('')
- )
- .bgIframe()
- );
-
- var $pop = this.inline ? $('.dp-popup', this.context) : $('#dp-popup');
-
- if (this.showYearNavigation == false) {
- $('.dp-nav-prev-year, .dp-nav-next-year', c.context).css('display', 'none');
- }
- if (this.displayClose) {
- $pop.append(
- $('' + $.dpText.TEXT_CLOSE + '')
- .bind(
- 'click',
- function()
- {
- c._closeCalendar();
- return false;
- }
- )
- );
- }
- c._renderCalendar();
-
- $(this.ele).trigger('dpDisplayed', $pop);
-
- if (!c.inline) {
- if (this.verticalPosition == $.dpConst.POS_BOTTOM) {
- $pop.css('top', eleOffset.top + $ele.height() - $pop.height() + c.verticalOffset);
- }
- if (this.horizontalPosition == $.dpConst.POS_RIGHT) {
- $pop.css('left', eleOffset.left + $ele.width() - $pop.width() + c.horizontalOffset);
- }
-// $('.selectee', this.context).focus();
- $(document).bind('mousedown.datepicker', this._checkMouse);
- }
-
- },
- setRenderCallback : function(a)
- {
- if (a == null) return;
- if (a && typeof(a) == 'function') {
- a = [a];
- }
- this.renderCallback = this.renderCallback.concat(a);
- },
- cellRender : function ($td, thisDate, month, year) {
- var c = this.dpController;
- var d = new Date(thisDate.getTime());
-
- // add our click handlers to deal with it when the days are clicked...
-
- $td.bind(
- 'click',
- function()
- {
- var $this = $(this);
- if (!$this.is('.disabled')) {
- c.setSelected(d, !$this.is('.selected') || !c.selectMultiple, false, true);
- if (c.closeOnSelect) {
- // Focus the next input in the form…
- if (c.settings.autoFocusNextInput) {
- var ele = c.ele;
- var found = false;
- $(':input', ele.form).each(
- function()
- {
- if (found) {
- $(this).focus();
- return false;
- }
- if (this == ele) {
- found = true;
- }
- }
- );
- } else {
- c.ele.focus();
- }
- c._closeCalendar();
- }
- }
- }
- );
- if (c.isSelected(d)) {
- $td.addClass('selected');
- if (c.settings.selectWeek)
- {
- $td.parent().addClass('selectedWeek');
- }
- } else if (c.selectMultiple && c.numSelected == c.numSelectable) {
- $td.addClass('unselectable');
- }
-
- },
- _applyRenderCallbacks : function()
- {
- var c = this;
- $('td', this.context).each(
- function()
- {
- for (var i=0; i 20) {
- $this.addClass('disabled');
- }
- }
- );
- var d = this.startDate.getDate();
- $('.dp-calendar td.current-month', this.context).each(
- function()
- {
- var $this = $(this);
- if (Number($this.text()) < d) {
- $this.addClass('disabled');
- }
- }
- );
- } else {
- $('.dp-nav-prev-year', this.context).removeClass('disabled');
- $('.dp-nav-prev-month', this.context).removeClass('disabled');
- var d = this.startDate.getDate();
- if (d > 20) {
- // check if the startDate is last month as we might need to add some disabled classes...
- var st = this.startDate.getTime();
- var sd = new Date(st);
- sd.addMonths(1);
- if (this.displayedYear == sd.getFullYear() && this.displayedMonth == sd.getMonth()) {
- $('.dp-calendar td.other-month', this.context).each(
- function()
- {
- var $this = $(this);
- if (Date.fromString($this.data('datePickerDate')).getTime() < st) {
- $this.addClass('disabled');
- }
- }
- );
- }
- }
- }
- if (this.displayedYear == this.endDate.getFullYear() && this.displayedMonth == this.endDate.getMonth()) {
- $('.dp-nav-next-year', this.context).addClass('disabled');
- $('.dp-nav-next-month', this.context).addClass('disabled');
- $('.dp-calendar td.other-month', this.context).each(
- function()
- {
- var $this = $(this);
- if (Number($this.text()) < 14) {
- $this.addClass('disabled');
- }
- }
- );
- var d = this.endDate.getDate();
- $('.dp-calendar td.current-month', this.context).each(
- function()
- {
- var $this = $(this);
- if (Number($this.text()) > d) {
- $this.addClass('disabled');
- }
- }
- );
- } else {
- $('.dp-nav-next-year', this.context).removeClass('disabled');
- $('.dp-nav-next-month', this.context).removeClass('disabled');
- var d = this.endDate.getDate();
- if (d < 13) {
- // check if the endDate is next month as we might need to add some disabled classes...
- var ed = new Date(this.endDate.getTime());
- ed.addMonths(-1);
- if (this.displayedYear == ed.getFullYear() && this.displayedMonth == ed.getMonth()) {
- $('.dp-calendar td.other-month', this.context).each(
- function()
- {
- var $this = $(this);
- var cellDay = Number($this.text());
- if (cellDay < 13 && cellDay > d) {
- $this.addClass('disabled');
- }
- }
- );
- }
- }
- }
- this._applyRenderCallbacks();
- },
- _closeCalendar : function(programatic, ele)
- {
- if (!ele || ele == this.ele)
- {
- $(document).unbind('mousedown.datepicker');
- $(document).unbind('keydown.datepicker');
- this._clearCalendar();
- $('#dp-popup a').unbind();
- $('#dp-popup').empty().remove();
- if (!programatic) {
- $(this.ele).trigger('dpClosed', [this.getSelected()]);
- }
- }
- },
- // empties the current dp-calendar div and makes sure that all events are unbound
- // and expandos removed to avoid memory leaks...
- _clearCalendar : function()
- {
- // TODO.
- $('.dp-calendar td', this.context).unbind();
- $('.dp-calendar', this.context).empty();
- }
- }
- );
-
- // static constants
- $.dpConst = {
- SHOW_HEADER_NONE : 0,
- SHOW_HEADER_SHORT : 1,
- SHOW_HEADER_LONG : 2,
- POS_TOP : 0,
- POS_BOTTOM : 1,
- POS_LEFT : 0,
- POS_RIGHT : 1,
- DP_INTERNAL_FOCUS : 'dpInternalFocusTrigger'
- };
- // localisable text
- $.dpText = {
- TEXT_PREV_YEAR : 'Previous year',
- TEXT_PREV_MONTH : 'Previous month',
- TEXT_NEXT_YEAR : 'Next year',
- TEXT_NEXT_MONTH : 'Next month',
- TEXT_CLOSE : 'Close',
- TEXT_CHOOSE_DATE : 'Choose date',
- HEADER_FORMAT : 'mmmm yyyy'
- };
- // version
- $.dpVersion = '$Id: jquery.datePicker.js 102 2010-09-13 14:00:54Z kelvin.luck $';
-
- $.fn.datePicker.defaults = {
- month : undefined,
- year : undefined,
- showHeader : $.dpConst.SHOW_HEADER_SHORT,
- startDate : undefined,
- endDate : undefined,
- inline : false,
- renderCallback : null,
- createButton : true,
- showYearNavigation : true,
- closeOnSelect : true,
- displayClose : false,
- selectMultiple : false,
- numSelectable : Number.MAX_VALUE,
- clickInput : false,
- rememberViewedMonth : true,
- selectWeek : false,
- verticalPosition : $.dpConst.POS_TOP,
- horizontalPosition : $.dpConst.POS_LEFT,
- verticalOffset : 0,
- horizontalOffset : 0,
- hoverClass : 'dp-hover',
- autoFocusNextInput : false
- };
-
- function _getController(ele)
- {
- if (ele._dpId) return $.event._dpCache[ele._dpId];
- return false;
- };
-
- // make it so that no error is thrown if bgIframe plugin isn't included (allows you to use conditional
- // comments to only include bgIframe where it is needed in IE without breaking this plugin).
- if ($.fn.bgIframe == undefined) {
- $.fn.bgIframe = function() {return this; };
- };
-
-
- // clean-up
- $(window)
- .bind('unload', function() {
- var els = $.event._dpCache || [];
- for (var i in els) {
- $(els[i].ele)._dpDestroy();
- }
- });
-
-
-})(jQuery);;/*
+})();;/*
* imgPreview jQuery plugin
* Copyright (c) 2009 James Padolsey
* j@qd9.co.uk | http://james.padolsey.com
diff --git a/dist/opensourcepos.min.js b/dist/opensourcepos.min.js
index 2fb0772af..05e77ddfc 100644
--- a/dist/opensourcepos.min.js
+++ b/dist/opensourcepos.min.js
@@ -1,11 +1,11 @@
-/*! opensourcepos 18-08-2015 */
+/*! opensourcepos 04-09-2015 */
function get_dimensions(){var a={width:0,height:0};return"number"==typeof window.innerWidth?(a.width=window.innerWidth,a.height=window.innerHeight):document.documentElement&&(document.documentElement.clientWidth||document.documentElement.clientHeight)?(a.width=document.documentElement.clientWidth,a.height=document.documentElement.clientHeight):document.body&&(document.body.clientWidth||document.body.clientHeight)&&(a.width=document.body.clientWidth,a.height=document.body.clientHeight),a}function set_feedback(a,b,c){a?($("#feedback_bar").removeClass().addClass(b).html(a).css("opacity","1"),c||$("#feedback_bar").fadeTo(5e3,1).fadeTo("fast",0)):$("#feedback_bar").css("opacity","0")}function checkbox_click(a){a.stopPropagation(),do_email(enable_email.url),$(a.target).attr("checked")?$(a.target).parent().parent().find("td").addClass("selected").css("backgroundColor",""):$(a.target).parent().parent().find("td").removeClass()}function enable_search(a,b,c,d){c||(c=function(a){return a[0]}),enable_search.enabled||(enable_search.enabled=!0),$("#search").click(function(){$(this).attr("value","")});var e=$("#search").autocomplete(a,{max:100,delay:10,selectFirst:!1,formatItem:c,extraParams:d});return $("#search").result(function(){do_search(!0)}),attach_search_listener(),$("#search_form").submit(function(a){a.preventDefault(),$("#limit_from").val(0),get_selected_values().length>0&&!confirm(b)||do_search(!0)}),e}function attach_search_listener(){$("#pagination a").click(function(a){if($("#search").val()||$("#search_form input:checked")){a.preventDefault();var b=a.currentTarget.href.split("/"),c=b.pop();$("#limit_from").val(c),do_search(!0)}})}function do_search(a,b){enable_search.enabled&&(a&&$("#search").addClass("ac_loading"),$.post($("#search_form").attr("action"),$("#search_form").serialize(),function(a){$("#sortable_table tbody").html(a.rows),"function"==typeof b&&b(),$("#search").removeClass("ac_loading"),tb_init("#sortable_table a.thickbox"),$("#pagination").html(a.pagination),$("#sortable_table tbody :checkbox").click(checkbox_click),$("#select_all").attr("checked",!1),a.total_rows>0&&(update_sortable_table(),enable_row_selection()),attach_search_listener()},"json"))}function enable_email(a){enable_email.enabled||(enable_email.enabled=!0),enable_email.url||(enable_email.url=a),$("#select_all, #sortable_table tbody :checkbox").click(checkbox_click)}function do_email(a){enable_email.enabled&&$.post(a,{"ids[]":get_selected_values()},function(a){$("#email").attr("href",a)})}function enable_checkboxes(){$("#sortable_table tbody :checkbox").click(checkbox_click)}function enable_delete(a,b){enable_delete.enabled||(enable_delete.enabled=!0),$("#delete").click(function(c){if(c.preventDefault(),$("#sortable_table tbody :checkbox:checked").length>0){if(!confirm(a))return!1;do_delete($(this).attr("href"))}else alert(b)})}function do_delete(a){if(enable_delete.enabled){var b=get_selected_values(),c=get_selected_rows();$.post(a,{"ids[]":b},function(a){a.success?($(c).each(function(){$(this).find("td").animate({backgroundColor:"green"},1200,"linear").end().animate({opacity:0},1200,"linear",function(){$(this).remove(),$("#sortable_table tbody tr").length>0&&update_sortable_table()})}),set_feedback(a.message,"success_message",!1)):set_feedback(a.message,"error_message",!0)},"json")}}function enable_bulk_edit(a){enable_bulk_edit.enabled||(enable_bulk_edit.enabled=!0),$("#bulk_edit").click(function(b){b.preventDefault(),$("#sortable_table tbody :checkbox:checked").length>0?(tb_show($(this).attr("title"),$(this).attr("href"),!1),$(this).blur()):alert(a)})}function enable_select_all(){enable_select_all.enabled||(enable_select_all.enabled=!0),$("#select_all").click(function(){$("#sortable_table tbody :checkbox").each($(this).attr("checked")?function(){$(this).attr("checked",!0),$(this).parent().parent().find("td").addClass("selected").css("backgroundColor","")}:function(){$(this).attr("checked",!1),$(this).parent().parent().find("td").removeClass()})})}function enable_row_selection(a){enable_row_selection.enabled||(enable_row_selection.enabled=!0),"undefined"==typeof a&&(a=$("#sortable_table tbody tr")),a.hover(function(){$(this).find("td").addClass("over").css("backgroundColor",""),$(this).css("cursor","pointer")},function(){$(this).find("td").hasClass("selected")||$(this).find("td").removeClass()}),a.click(function(){var a=$(this).find(":checkbox");a.attr("checked",!a.attr("checked")),do_email(enable_email.url),a.attr("checked")?$(this).find("td").addClass("selected").css("backgroundColor",""):$(this).find("td").removeClass()})}function update_sortable_table(){if($("#sortable_table").trigger("update"),"undefined"!=typeof $("#sortable_table")[0].config){var a=$("#sortable_table")[0].config.sortList;$("#sortable_table").trigger("sorton",[a])}}function get_table_row(a){a=a||$("input[name='sale_id']").val();var b=$("#sortable_table tbody :checkbox[value='"+a+"']");return 0===b.length&&(b=$("#sortable_table tbody a[href*='/"+a+"/']")),b}function update_row(a,b,c){$.post(b,{row_id:a},function(b){var d=get_table_row(a).parent().parent();d.replaceWith(b),reinit_row(a),hightlight_row(a),c&&"function"==typeof c&&c()},"html")}function reinit_row(a){var b=$("#sortable_table tbody tr :checkbox[value="+a+"]"),c=b.parent().parent();enable_row_selection(c),update_sortable_table(),tb_init(c.find("a.thickbox")),b.click(checkbox_click)}function animate_row(a,b){b=b||"#e1ffdd",a.find("td").css("backgroundColor","#ffffff").animate({backgroundColor:b},"slow","linear").animate({backgroundColor:b},5e3).animate({backgroundColor:"#ffffff"},"slow","linear")}function hightlight_row(a){var b=$("#sortable_table tbody tr :checkbox[value="+a+"]"),c=b.parent().parent();animate_row(c)}function get_selected_values(){var a=new Array;return $("#sortable_table tbody :checkbox:checked").each(function(){a.push($(this).val())}),a}function get_selected_rows(){var a=new Array;return $("#sortable_table tbody :checkbox:checked").each(function(){a.push($(this).parent().parent())}),a}function get_visible_checkbox_ids(){var a=new Array;return $("#sortable_table tbody :checkbox").each(function(){a.push($(this).val())}),a}function tb_init(a){$(a).click(function(){var a=this.title||this.name||null,b=this.href||this.alt,c=this.rel||!1;return tb_show(a,b,c),this.blur(),!1})}function tb_show(a,b,c){try{"undefined"==typeof document.body.style.maxHeight?($("body","html").css({height:"100%",width:"100%"}),$("html").css("overflow","hidden"),null===document.getElementById("TB_HideSelect")&&($("body").append(""),$("#TB_overlay").click(tb_remove))):null===document.getElementById("TB_overlay")&&($("body").append(""),$("#TB_overlay").click(tb_remove)),$("#TB_overlay").addClass(tb_detectMacXFF()?"TB_overlayMacFFBGHack":"TB_overlayBG"),null===a&&(a=""),$("body").append("
"!==i[1]||m?[]:l.childNodes:l.firstChild&&l.firstChild.childNodes,f=n.length-1;f>=0;--f)$.nodeName(n[f],"tbody")&&!n[f].childNodes.length&&n[f].parentNode.removeChild(n[f]);!$.support.leadingWhitespace&&Pa.test(g)&&l.insertBefore(b.createTextNode(Pa.exec(g)[0]),l.firstChild),g=l.childNodes,l.parentNode.removeChild(l)}else g=b.createTextNode(g);g.nodeType?s.push(g):$.merge(s,g)}if(l&&(g=l=r=null),!$.support.appendChecked)for(e=0;null!=(g=s[e]);e++)$.nodeName(g,"input")?p(g):"undefined"!=typeof g.getElementsByTagName&&$.grep(g.getElementsByTagName("input"),p);if(c)for(o=function(a){return!a.type||Za.test(a.type)?d?d.push(a.parentNode?a.parentNode.removeChild(a):a):c.appendChild(a):void 0},e=0;null!=(g=s[e]);e++)$.nodeName(g,"script")&&o(g)||(c.appendChild(g),"undefined"!=typeof g.getElementsByTagName&&(q=$.grep($.merge([],g.getElementsByTagName("script")),o),s.splice.apply(s,[e+1,0].concat(q)),e+=q.length));return s},cleanData:function(a,b){for(var c,d,e,f,g=0,h=$.expando,i=$.cache,j=$.support.deleteExpando,k=$.event.special;null!=(e=a[g]);g++)if((b||$.acceptData(e))&&(d=e[h],c=d&&i[d])){if(c.events)for(f in c.events)k[f]?$.event.remove(e,f):$.removeEvent(e,f,c.handle);i[d]&&(delete i[d],j?delete e[h]:e.removeAttribute?e.removeAttribute(h):e[h]=null,$.deletedIds.push(d))}}}),function(){var a,b;$.uaMatch=function(a){a=a.toLowerCase();var b=/(chrome)[ \/]([\w.]+)/.exec(a)||/(webkit)[ \/]([\w.]+)/.exec(a)||/(opera)(?:.*version|)[ \/]([\w.]+)/.exec(a)||/(msie) ([\w.]+)/.exec(a)||a.indexOf("compatible")<0&&/(mozilla)(?:.*? rv:([\w.]+)|)/.exec(a)||[];return{browser:b[1]||"",version:b[2]||"0"}},a=$.uaMatch(R.userAgent),b={},a.browser&&(b[a.browser]=!0,b.version=a.version),b.chrome?b.webkit=!0:b.webkit&&(b.safari=!0),$.browser=b,$.sub=function(){function a(b,c){return new a.fn.init(b,c)}$.extend(!0,a,this),a.superclass=this,a.fn=a.prototype=this(),a.fn.constructor=a,a.sub=this.sub,a.fn.init=function(c,d){return d&&d instanceof $&&!(d instanceof a)&&(d=a(d)),$.fn.init.call(this,c,d,b)},a.fn.init.prototype=a.fn;var b=a(P);return a}}();var cb,db,eb,fb=/alpha\([^)]*\)/i,gb=/opacity=([^)]*)/,hb=/^(top|right|bottom|left)$/,ib=/^(none|table(?!-c[ea]).+)/,jb=/^margin/,kb=new RegExp("^("+_+")(.*)$","i"),lb=new RegExp("^("+_+")(?!px)[a-z%]+$","i"),mb=new RegExp("^([-+])=("+_+")","i"),nb={BODY:"block"},ob={position:"absolute",visibility:"hidden",display:"block"},pb={letterSpacing:0,fontWeight:400},qb=["Top","Right","Bottom","Left"],rb=["Webkit","O","Moz","ms"],sb=$.fn.toggle;$.fn.extend({css:function(a,c){return $.access(this,function(a,c,d){return d!==b?$.style(a,c,d):$.css(a,c)},a,c,arguments.length>1)},show:function(){return s(this,!0)},hide:function(){return s(this)},toggle:function(a,b){var c="boolean"==typeof a;return $.isFunction(a)&&$.isFunction(b)?sb.apply(this,arguments):this.each(function(){(c?a:r(this))?$(this).show():$(this).hide()})}}),$.extend({cssHooks:{opacity:{get:function(a,b){if(b){var c=cb(a,"opacity");return""===c?"1":c}}}},cssNumber:{fillOpacity:!0,fontWeight:!0,lineHeight:!0,opacity:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":$.support.cssFloat?"cssFloat":"styleFloat"},style:function(a,c,d,e){if(a&&3!==a.nodeType&&8!==a.nodeType&&a.style){var f,g,h,i=$.camelCase(c),j=a.style;if(c=$.cssProps[i]||($.cssProps[i]=q(j,i)),h=$.cssHooks[c]||$.cssHooks[i],d===b)return h&&"get"in h&&(f=h.get(a,!1,e))!==b?f:j[c];if(g=typeof d,"string"===g&&(f=mb.exec(d))&&(d=(f[1]+1)*f[2]+parseFloat($.css(a,c)),g="number"),!(null==d||"number"===g&&isNaN(d)||("number"!==g||$.cssNumber[i]||(d+="px"),h&&"set"in h&&(d=h.set(a,d,e))===b)))try{j[c]=d}catch(k){}}},css:function(a,c,d,e){var f,g,h,i=$.camelCase(c);return c=$.cssProps[i]||($.cssProps[i]=q(a.style,i)),h=$.cssHooks[c]||$.cssHooks[i],h&&"get"in h&&(f=h.get(a,!0,e)),f===b&&(f=cb(a,c)),"normal"===f&&c in pb&&(f=pb[c]),d||e!==b?(g=parseFloat(f),d||$.isNumeric(g)?g||0:f):f},swap:function(a,b,c){var d,e,f={};for(e in b)f[e]=a.style[e],a.style[e]=b[e];d=c.call(a);for(e in b)a.style[e]=f[e];return d}}),a.getComputedStyle?cb=function(b,c){var d,e,f,g,h=a.getComputedStyle(b,null),i=b.style;return h&&(d=h.getPropertyValue(c)||h[c],""!==d||$.contains(b.ownerDocument,b)||(d=$.style(b,c)),lb.test(d)&&jb.test(c)&&(e=i.width,f=i.minWidth,g=i.maxWidth,i.minWidth=i.maxWidth=i.width=d,d=h.width,i.width=e,i.minWidth=f,i.maxWidth=g)),d}:P.documentElement.currentStyle&&(cb=function(a,b){var c,d,e=a.currentStyle&&a.currentStyle[b],f=a.style;return null==e&&f&&f[b]&&(e=f[b]),lb.test(e)&&!hb.test(b)&&(c=f.left,d=a.runtimeStyle&&a.runtimeStyle.left,d&&(a.runtimeStyle.left=a.currentStyle.left),f.left="fontSize"===b?"1em":e,e=f.pixelLeft+"px",f.left=c,d&&(a.runtimeStyle.left=d)),""===e?"auto":e}),$.each(["height","width"],function(a,b){$.cssHooks[b]={get:function(a,c,d){return c?0===a.offsetWidth&&ib.test(cb(a,"display"))?$.swap(a,ob,function(){return v(a,b,d)}):v(a,b,d):void 0},set:function(a,c,d){return t(a,c,d?u(a,b,d,$.support.boxSizing&&"border-box"===$.css(a,"boxSizing")):0)}}}),$.support.opacity||($.cssHooks.opacity={get:function(a,b){return gb.test((b&&a.currentStyle?a.currentStyle.filter:a.style.filter)||"")?.01*parseFloat(RegExp.$1)+"":b?"1":""},set:function(a,b){var c=a.style,d=a.currentStyle,e=$.isNumeric(b)?"alpha(opacity="+100*b+")":"",f=d&&d.filter||c.filter||"";c.zoom=1,b>=1&&""===$.trim(f.replace(fb,""))&&c.removeAttribute&&(c.removeAttribute("filter"),d&&!d.filter)||(c.filter=fb.test(f)?f.replace(fb,e):f+" "+e)}}),$(function(){$.support.reliableMarginRight||($.cssHooks.marginRight={get:function(a,b){return $.swap(a,{display:"inline-block"},function(){return b?cb(a,"marginRight"):void 0})}}),!$.support.pixelPosition&&$.fn.position&&$.each(["top","left"],function(a,b){$.cssHooks[b]={get:function(a,c){if(c){var d=cb(a,b);return lb.test(d)?$(a).position()[b]+"px":d}}}})}),$.expr&&$.expr.filters&&($.expr.filters.hidden=function(a){return 0===a.offsetWidth&&0===a.offsetHeight||!$.support.reliableHiddenOffsets&&"none"===(a.style&&a.style.display||cb(a,"display"))},$.expr.filters.visible=function(a){return!$.expr.filters.hidden(a)}),$.each({margin:"",padding:"",border:"Width"},function(a,b){$.cssHooks[a+b]={expand:function(c){var d,e="string"==typeof c?c.split(" "):[c],f={};for(d=0;4>d;d++)f[a+qb[d]+b]=e[d]||e[d-2]||e[0];return f}},jb.test(a)||($.cssHooks[a+b].set=t)});var tb=/%20/g,ub=/\[\]$/,vb=/\r?\n/g,wb=/^(?:color|date|datetime|datetime-local|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,xb=/^(?:select|textarea)/i;$.fn.extend({serialize:function(){return $.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?$.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||xb.test(this.nodeName)||wb.test(this.type))}).map(function(a,b){var c=$(this).val();return null==c?null:$.isArray(c)?$.map(c,function(a){return{name:b.name,value:a.replace(vb,"\r\n")}}):{name:b.name,value:c.replace(vb,"\r\n")}}).get()}}),$.param=function(a,c){var d,e=[],f=function(a,b){b=$.isFunction(b)?b():null==b?"":b,e[e.length]=encodeURIComponent(a)+"="+encodeURIComponent(b)};if(c===b&&(c=$.ajaxSettings&&$.ajaxSettings.traditional),$.isArray(a)||a.jquery&&!$.isPlainObject(a))$.each(a,function(){f(this.name,this.value)});else for(d in a)x(d,a[d],c,f);return e.join("&").replace(tb,"+")};var yb,zb,Ab=/#.*$/,Bb=/^(.*?):[ \t]*([^\r\n]*)\r?$/gm,Cb=/^(?:about|app|app\-storage|.+\-extension|file|res|widget):$/,Db=/^(?:GET|HEAD)$/,Eb=/^\/\//,Fb=/\?/,Gb=/"),u=n("__ie_ondomload"),u&&p(u,"onreadystatechange",a)}catch(f){}N.webkit&&typeof C.readyState!=v&&(I=setInterval(function(){/loaded|complete/.test(C.readyState)&&b()},10)),typeof C.addEventListener!=v&&C.addEventListener("DOMContentLoaded",b,null),d(b)}}(),function(){N.ie&&N.win&&window.attachEvent("onunload",function(){for(var a=H.length,b=0;a>b;b++)H[b][0].detachEvent(H[b][1],H[b][2]);for(var c=G.length,d=0;c>d;d++)l(G[d]);for(var e in N)N[e]=null;N=null;for(var f in swfobject)swfobject[f]=null;swfobject=null})}()}return{registerObject:function(a,b,c){if(N.w3cdom&&a&&b){var d={};d.id=a,d.swfVersion=b,d.expressInstall=c?c:!1,F[F.length]=d,s(a,!1)}},getObjectById:function(a){var b=null;if(N.w3cdom){var c=n(a);if(c){var d=c.getElementsByTagName(w)[0];!d||d&&typeof c.SetVariable!=v?b=c:typeof d.SetVariable!=v&&(b=d)}}return b},embedSWF:function(a,b,d,e,f,h,i,k,l){if(N.w3cdom&&a&&b&&d&&e&&f)if(d+="",e+="",q(f)){s(b,!1);var m={};if(l&&typeof l===w)for(var n in l)l[n]!=Object.prototype[n]&&(m[n]=l[n]);m.data=a,m.width=d,m.height=e;var o={};if(k&&typeof k===w)for(var p in k)k[p]!=Object.prototype[p]&&(o[p]=k[p]);if(i&&typeof i===w)for(var r in i)i[r]!=Object.prototype[r]&&(typeof o.flashvars!=v?o.flashvars+="&"+r+"="+i[r]:o.flashvars=r+"="+i[r]);c(function(){j(m,o,b),m.id==b&&s(b,!0)})}else h&&!M&&q("6.0.65")&&(N.win||N.mac)&&(M=!0,s(b,!1),c(function(){
-var a={};a.id=a.altContentId=b,a.width=d,a.height=e,a.expressInstall=h,g(a)}))},getFlashPlayerVersion:function(){return{major:N.pv[0],minor:N.pv[1],release:N.pv[2]}},hasFlashPlayerVersion:q,createSWF:function(a,b,c){return N.w3cdom?j(a,b,c):void 0},removeSWF:function(a){N.w3cdom&&l(a)},createCSS:function(a,b){N.w3cdom&&r(a,b)},addDomLoadEvent:c,addLoadEvent:d,getQueryParamValue:function(a){var b=C.location.search||C.location.hash;if(null==a)return t(b);if(b)for(var c=b.substring(1).split("&"),d=0;d20&&(b=b.substring(b.length-19)),b},g="mi"+f(),h=function(a,b){this.g(a,b)};h.prototype={h:function(){var a=new RegExp(g+this.a+"=(\\d+)"),b=document.cookie.match(a);return b?b[1]:this.i()},i:function(){for(var a=0,b=this.b.length;b>a;a++)if(c(this.b[a].parentNode,"selected"))return a;return 0},j:function(a,b){var c=document.getElementById(a.TargetId);if(c){this.l(c);for(var f=0;f=this.b.length&&(a=0),this.j(this.b[a],0)}};var i=[],j=function(a){function c(){e||(e=!0,setTimeout(a,4))}function d(){if(!e)try{document.documentElement.doScroll("left"),c()}catch(a){setTimeout(d,10)}}var e=!1;if(document.addEventListener)document.addEventListener("DOMContentLoaded",c,!1);else if(document.attachEvent){try{var f=null!=window.frameElement}catch(g){}document.documentElement.doScroll&&!f&&d(),document.attachEvent("onreadystatechange",function(){"complete"===document.readyState&&c()})}b(window,"load",c)},k=function(){for(var a=document.getElementsByTagName("ul"),b=0,d=a.length;d>b;b++)c(a[b],"tabs")&&i.push(new h(a[b],b))};return j(k),{}}();var tb_pathToImage="images/loading_animation.gif";$(document).ready(function(){tb_init("a.thickbox, area.thickbox, input.thickbox"),imgLoader=new Image,imgLoader.src=tb_pathToImage});
\ No newline at end of file
+},formatAndAdd:function(b,c){var d=this.defaultMessage(b,c.method),e=/\$?\{(\d+)\}/g;"function"==typeof d?d=d.call(this,c.parameters,b):e.test(d)&&(d=a.validator.format(d.replace(e,"{$1}"),c.parameters)),this.errorList.push({message:d,element:b,method:c.method}),this.errorMap[b.name]=d,this.submitted[b.name]=d},addWrapper:function(a){return this.settings.wrapper&&(a=a.add(a.parent(this.settings.wrapper))),a},defaultShowErrors:function(){var a,b,c;for(a=0;this.errorList[a];a++)c=this.errorList[a],this.settings.highlight&&this.settings.highlight.call(this,c.element,this.settings.errorClass,this.settings.validClass),this.showLabel(c.element,c.message);if(this.errorList.length&&(this.toShow=this.toShow.add(this.containers)),this.settings.success)for(a=0;this.successList[a];a++)this.showLabel(this.successList[a]);if(this.settings.unhighlight)for(a=0,b=this.validElements();b[a];a++)this.settings.unhighlight.call(this,b[a],this.settings.errorClass,this.settings.validClass);this.toHide=this.toHide.not(this.toShow),this.hideErrors(),this.addWrapper(this.toShow).show()},validElements:function(){return this.currentElements.not(this.invalidElements())},invalidElements:function(){return a(this.errorList).map(function(){return this.element})},showLabel:function(b,c){var d,e,f,g=this.errorsFor(b),h=this.idOrName(b),i=a(b).attr("aria-describedby");g.length?(g.removeClass(this.settings.validClass).addClass(this.settings.errorClass),g.html(c)):(g=a("<"+this.settings.errorElement+">").attr("id",h+"-error").addClass(this.settings.errorClass).html(c||""),d=g,this.settings.wrapper&&(d=g.hide().show().wrap("<"+this.settings.wrapper+"/>").parent()),this.labelContainer.length?this.labelContainer.append(d):this.settings.errorPlacement?this.settings.errorPlacement(d,a(b)):d.insertAfter(b),g.is("label")?g.attr("for",h):0===g.parents("label[for='"+h+"']").length&&(f=g.attr("id").replace(/(:|\.|\[|\])/g,"\\$1"),i?i.match(new RegExp("\\b"+f+"\\b"))||(i+=" "+f):i=f,a(b).attr("aria-describedby",i),e=this.groups[b.name],e&&a.each(this.groups,function(b,c){c===e&&a("[name='"+b+"']",this.currentForm).attr("aria-describedby",g.attr("id"))}))),!c&&this.settings.success&&(g.text(""),"string"==typeof this.settings.success?g.addClass(this.settings.success):this.settings.success(g,b)),this.toShow=this.toShow.add(g)},errorsFor:function(b){var c=this.idOrName(b),d=a(b).attr("aria-describedby"),e="label[for='"+c+"'], label[for='"+c+"'] *";return d&&(e=e+", #"+d.replace(/\s+/g,", #")),this.errors().filter(e)},idOrName:function(a){return this.groups[a.name]||(this.checkable(a)?a.name:a.id||a.name)},validationTargetFor:function(b){return this.checkable(b)&&(b=this.findByName(b.name)),a(b).not(this.settings.ignore)[0]},checkable:function(a){return/radio|checkbox/i.test(a.type)},findByName:function(b){return a(this.currentForm).find("[name='"+b+"']")},getLength:function(b,c){switch(c.nodeName.toLowerCase()){case"select":return a("option:selected",c).length;case"input":if(this.checkable(c))return this.findByName(c.name).filter(":checked").length}return b.length},depend:function(a,b){return this.dependTypes[typeof a]?this.dependTypes[typeof a](a,b):!0},dependTypes:{"boolean":function(a){return a},string:function(b,c){return!!a(b,c.form).length},"function":function(a,b){return a(b)}},optional:function(b){var c=this.elementValue(b);return!a.validator.methods.required.call(this,c,b)&&"dependency-mismatch"},startRequest:function(a){this.pending[a.name]||(this.pendingRequest++,this.pending[a.name]=!0)},stopRequest:function(b,c){this.pendingRequest--,this.pendingRequest<0&&(this.pendingRequest=0),delete this.pending[b.name],c&&0===this.pendingRequest&&this.formSubmitted&&this.form()?(a(this.currentForm).submit(),this.formSubmitted=!1):!c&&0===this.pendingRequest&&this.formSubmitted&&(a(this.currentForm).triggerHandler("invalid-form",[this]),this.formSubmitted=!1)},previousValue:function(b){return a.data(b,"previousValue")||a.data(b,"previousValue",{old:null,valid:!0,message:this.defaultMessage(b,"remote")})}},classRuleSettings:{required:{required:!0},email:{email:!0},url:{url:!0},date:{date:!0},dateISO:{dateISO:!0},number:{number:!0},digits:{digits:!0},creditcard:{creditcard:!0}},addClassRules:function(b,c){b.constructor===String?this.classRuleSettings[b]=c:a.extend(this.classRuleSettings,b)},classRules:function(b){var c={},d=a(b).attr("class");return d&&a.each(d.split(" "),function(){this in a.validator.classRuleSettings&&a.extend(c,a.validator.classRuleSettings[this])}),c},attributeRules:function(b){var c,d,e={},f=a(b),g=b.getAttribute("type");for(c in a.validator.methods)"required"===c?(d=b.getAttribute(c),""===d&&(d=!0),d=!!d):d=f.attr(c),/min|max/.test(c)&&(null===g||/number|range|text/.test(g))&&(d=Number(d)),d||0===d?e[c]=d:g===c&&"range"!==g&&(e[c]=!0);return e.maxlength&&/-1|2147483647|524288/.test(e.maxlength)&&delete e.maxlength,e},dataRules:function(b){var c,d,e={},f=a(b);for(c in a.validator.methods)d=f.data("rule"+c.charAt(0).toUpperCase()+c.substring(1).toLowerCase()),void 0!==d&&(e[c]=d);return e},staticRules:function(b){var c={},d=a.data(b.form,"validator");return d.settings.rules&&(c=a.validator.normalizeRule(d.settings.rules[b.name])||{}),c},normalizeRules:function(b,c){return a.each(b,function(d,e){if(e===!1)return void delete b[d];if(e.param||e.depends){var f=!0;switch(typeof e.depends){case"string":f=!!a(e.depends,c.form).length;break;case"function":f=e.depends.call(c,c)}f?b[d]=void 0!==e.param?e.param:!0:delete b[d]}}),a.each(b,function(d,e){b[d]=a.isFunction(e)?e(c):e}),a.each(["minlength","maxlength"],function(){b[this]&&(b[this]=Number(b[this]))}),a.each(["rangelength","range"],function(){var c;b[this]&&(a.isArray(b[this])?b[this]=[Number(b[this][0]),Number(b[this][1])]:"string"==typeof b[this]&&(c=b[this].replace(/[\[\]]/g,"").split(/[\s,]+/),b[this]=[Number(c[0]),Number(c[1])]))}),a.validator.autoCreateRanges&&(null!=b.min&&null!=b.max&&(b.range=[b.min,b.max],delete b.min,delete b.max),null!=b.minlength&&null!=b.maxlength&&(b.rangelength=[b.minlength,b.maxlength],delete b.minlength,delete b.maxlength)),b},normalizeRule:function(b){if("string"==typeof b){var c={};a.each(b.split(/\s/),function(){c[this]=!0}),b=c}return b},addMethod:function(b,c,d){a.validator.methods[b]=c,a.validator.messages[b]=void 0!==d?d:a.validator.messages[b],c.length<3&&a.validator.addClassRules(b,a.validator.normalizeRule(b))},methods:{required:function(b,c,d){if(!this.depend(d,c))return"dependency-mismatch";if("select"===c.nodeName.toLowerCase()){var e=a(c).val();return e&&e.length>0}return this.checkable(c)?this.getLength(b,c)>0:a.trim(b).length>0},email:function(a,b){return this.optional(b)||/^[a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/.test(a)},url:function(a,b){return this.optional(b)||/^(https?|s?ftp):\/\/(((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:)*@)?(((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5]))|((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?)(:\d*)?)(\/((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)?)?(\?((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|[\uE000-\uF8FF]|\/|\?)*)?(#((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|\/|\?)*)?$/i.test(a)},date:function(a,b){return this.optional(b)||!/Invalid|NaN/.test(new Date(a).toString())},dateISO:function(a,b){return this.optional(b)||/^\d{4}[\/\-](0?[1-9]|1[012])[\/\-](0?[1-9]|[12][0-9]|3[01])$/.test(a)},number:function(a,b){return this.optional(b)||/^-?(?:\d+|\d{1,3}(?:,\d{3})+)?(?:\.\d+)?$/.test(a)},digits:function(a,b){return this.optional(b)||/^\d+$/.test(a)},creditcard:function(a,b){if(this.optional(b))return"dependency-mismatch";if(/[^0-9 \-]+/.test(a))return!1;var c,d,e=0,f=0,g=!1;if(a=a.replace(/\D/g,""),a.length<13||a.length>19)return!1;for(c=a.length-1;c>=0;c--)d=a.charAt(c),f=parseInt(d,10),g&&(f*=2)>9&&(f-=9),e+=f,g=!g;return e%10===0},minlength:function(b,c,d){var e=a.isArray(b)?b.length:this.getLength(b,c);return this.optional(c)||e>=d},maxlength:function(b,c,d){var e=a.isArray(b)?b.length:this.getLength(b,c);return this.optional(c)||d>=e},rangelength:function(b,c,d){var e=a.isArray(b)?b.length:this.getLength(b,c);return this.optional(c)||e>=d[0]&&e<=d[1]},min:function(a,b,c){return this.optional(b)||a>=c},max:function(a,b,c){return this.optional(b)||c>=a},range:function(a,b,c){return this.optional(b)||a>=c[0]&&a<=c[1]},equalTo:function(b,c,d){var e=a(d);return this.settings.onfocusout&&e.unbind(".validate-equalTo").bind("blur.validate-equalTo",function(){a(c).valid()}),b===e.val()},remote:function(b,c,d){if(this.optional(c))return"dependency-mismatch";var e,f,g=this.previousValue(c);return this.settings.messages[c.name]||(this.settings.messages[c.name]={}),g.originalMessage=this.settings.messages[c.name].remote,this.settings.messages[c.name].remote=g.message,d="string"==typeof d&&{url:d}||d,g.old===b?g.valid:(g.old=b,e=this,this.startRequest(c),f={},f[c.name]=b,a.ajax(a.extend(!0,{url:d,mode:"abort",port:"validate"+c.name,dataType:"json",data:f,context:e.currentForm,success:function(d){var f,h,i,j=d===!0||"true"===d;e.settings.messages[c.name].remote=g.originalMessage,j?(i=e.formSubmitted,e.prepareElement(c),e.formSubmitted=i,e.successList.push(c),delete e.invalid[c.name],e.showErrors()):(f={},h=d||e.defaultMessage(c,"remote"),f[c.name]=g.message=a.isFunction(h)?h(b):h,e.invalid[c.name]=!0,e.showErrors(f)),g.valid=j,e.stopRequest(c,j)}},d)),"pending")}}}),a.format=function(){throw"$.format has been deprecated. Please use $.validator.format instead."};var b,c={};a.ajaxPrefilter?a.ajaxPrefilter(function(a,b,d){var e=a.port;"abort"===a.mode&&(c[e]&&c[e].abort(),c[e]=d)}):(b=a.ajax,a.ajax=function(d){var e=("mode"in d?d:a.ajaxSettings).mode,f=("port"in d?d:a.ajaxSettings).port;return"abort"===e?(c[f]&&c[f].abort(),c[f]=b.apply(this,arguments),c[f]):b.apply(this,arguments)}),a.extend(a.fn,{validateDelegate:function(b,c,d){return this.bind(c,function(c){var e=a(c.target);return e.is(b)?d.apply(e,arguments):void 0})}})}),function(a){a.each(["customers","items","reports","receivings","sales"],function(b,c){a(window).jkey("f"+(b+1),function(){window.location=BASE_URL+"/"+c+"/index"})})}(jQuery),Date.dayNames=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],Date.abbrDayNames=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],Date.monthNames=["January","February","March","April","May","June","July","August","September","October","November","December"],Date.abbrMonthNames=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],Date.firstDayOfWeek=1,Date.format="mm/dd/yyyy",Date.fullYearStart="20",function(){function a(a,b){Date.prototype[a]||(Date.prototype[a]=b)}a("isLeapYear",function(){var a=this.getFullYear();return a%4==0&&a%100!=0||a%400==0}),a("isWeekend",function(){return 0==this.getDay()||6==this.getDay()}),a("isWeekDay",function(){return!this.isWeekend()}),a("getDaysInMonth",function(){return[31,this.isLeapYear()?29:28,31,30,31,30,31,31,30,31,30,31][this.getMonth()]}),a("getDayName",function(a){return a?Date.abbrDayNames[this.getDay()]:Date.dayNames[this.getDay()]}),a("getMonthName",function(a){return a?Date.abbrMonthNames[this.getMonth()]:Date.monthNames[this.getMonth()]}),a("getDayOfYear",function(){var a=new Date("1/1/"+this.getFullYear());return Math.floor((this.getTime()-a.getTime())/864e5)}),a("getWeekOfYear",function(){return Math.ceil(this.getDayOfYear()/7)}),a("setDayOfYear",function(a){return this.setMonth(0),this.setDate(a),this}),a("addYears",function(a){return this.setFullYear(this.getFullYear()+a),this}),a("addMonths",function(a){var b=this.getDate();return this.setMonth(this.getMonth()+a),b>this.getDate()&&this.addDays(-this.getDate()),this}),a("addDays",function(a){return this.setTime(this.getTime()+864e5*a),this}),a("addHours",function(a){return this.setHours(this.getHours()+a),this}),a("addMinutes",function(a){return this.setMinutes(this.getMinutes()+a),this}),a("addSeconds",function(a){return this.setSeconds(this.getSeconds()+a),this}),a("zeroTime",function(){return this.setMilliseconds(0),this.setSeconds(0),this.setMinutes(0),this.setHours(0),this}),a("asString",function(a){var c=a||Date.format;return c.split("yyyy").join(this.getFullYear()).split("yy").join((this.getFullYear()+"").substring(2)).split("mmmm").join(this.getMonthName(!1)).split("mmm").join(this.getMonthName(!0)).split("mm").join(b(this.getMonth()+1)).split("dd").join(b(this.getDate())).split("hh").join(b(this.getHours())).split("min").join(b(this.getMinutes())).split("ss").join(b(this.getSeconds()))}),Date.fromString=function(a,b){var c=b||Date.format,d=new Date("01/01/1977"),e=0,f=c.indexOf("mmmm");if(f>-1){for(var g=0;g-1){for(var h=a.substr(f,3),g=0;g-1?(i>f&&(i+=e),d.setFullYear(Number(a.substr(i,4)))):(i>f&&(i+=e),d.setFullYear(Number(Date.fullYearStart+a.substr(c.indexOf("yy"),2))));var j=c.indexOf("dd");return j>f&&(j+=e),d.setDate(Number(a.substr(j,2))),isNaN(d.getTime())?!1:d};var b=function(a){var b="0"+a;return b.substring(b.length-2)}}(),function(a){a.expr[":"].linkingToImage=function(b,c,d){return!(!a(b).attr(d[3])||!a(b).attr(d[3]).match(/\.(gif|jpe?g|png|bmp)$/i))},a.fn.imgPreview=function(b){function c(a){return a&&a.replace(/(\/?)([^\/]+)$/,"$1"+d.thumbPrefix+"$2")}var d=a.extend({imgCSS:{},distanceFromCursor:{top:10,left:10},preloadImages:!0,onShow:function(){},onHide:function(){},onLoad:function(){},containerID:"imgPreviewContainer",containerLoadingClass:"loading",thumbPrefix:"",srcAttr:"href"},b),e=a("").attr("id",d.containerID).append("").hide().css("position","absolute").appendTo("body"),f=a("img",e).css(d.imgCSS),g=this.filter(":linkingToImage("+d.srcAttr+")");return d.preloadImages&&!function(b){var e=new Image,f=arguments.callee,h=a(g[b]).attr(d.srcAttr);h&&(e.src=c(h),e.onload=function(){g[b+1]&&f(b+1)})}(0),g.mousemove(function(a){e.css({top:a.pageY+d.distanceFromCursor.top+"px",left:a.pageX+d.distanceFromCursor.left+"px"})}).hover(function(){var b=this;e.addClass(d.containerLoadingClass).show(),f.load(function(){e.removeClass(d.containerLoadingClass),f.show(),d.onLoad.call(f[0],b)}).attr("src",c(a(b).attr(d.srcAttr))),d.onShow.call(e[0],b)},function(){e.hide(),f.unbind("load").attr("src","").hide(),d.onHide.call(e[0],this)}),this}}(jQuery),enable_search.enabled=!1,enable_email.enabled=!1,enable_email.url=!1,enable_delete.enabled=!1,enable_bulk_edit.enabled=!1,enable_select_all.enabled=!1,enable_row_selection.enabled=!1,function(a){function b(a){return document.location.protocol+"//"+a}window.sessionStorage&&!sessionStorage.country&&a.ajax({type:"GET",url:b("ipinfo.io/json"),success:function(a){sessionStorage.country=a.country},dataType:"jsonp"});var c=b("nominatim.openstreetmap.org/search"),d=function(b){return function(c,d){if(null!=d&&d.length>0){for(var e in b)a("#"+b[e]).val(d[e]);return!1}return!0}},e=function(a){return a[0]+" - "+a[1]},f=function(b,c){var d=function(b,c){var d=[];return a.each(b.split("|"),function(b,e){c[e]&&d.length<2&&-1===a.inArray(c[e],d)&&d.push(c[e])}),d[0]+(d[1]?" ("+d[1]+")":"")};return function(e){var f=[];return a.each(e,function(e,g){var h=g.address,i=[];a.each(c,function(a,b){i.push(d(b,h))}),f[e]={data:i,value:h[b],result:h[b]}}),f}},g=function(b,c,d){return function(){var e={format:"json",limit:5,addressdetails:1,country:window.sessionStorage?sessionStorage.country:"be","accept-language":d||navigator.language};return e[c||b]=a("#"+b).val(),e}},h={init:function(b){a.each(b.fields,function(h,i){var j=d(i.dependencies);a("#"+h).autocomplete(c,{max:100,minChars:3,delay:500,formatItem:e,type:"GET",dataType:"json",extraParams:g(h,i.response&&i.response.field,b.language),parse:f(h,i.response&&i.response.format||i.dependencies)}),a("#"+h).result(j)})}};window.nominatim=h}(jQuery);var swfobject=function(){function a(){"complete"==u.readyState&&(u.parentNode.removeChild(u),b())}function b(){if(!L){if(N.ie&&N.win){var a=o("span");try{var b=C.getElementsByTagName("body")[0].appendChild(a);b.parentNode.removeChild(b)}catch(c){return}}L=!0,I&&(clearInterval(I),I=null);for(var d=E.length,e=0;d>e;e++)E[e]()}}function c(a){L?a():E[E.length]=a}function d(a){if(typeof B.addEventListener!=v)B.addEventListener("load",a,!1);else if(typeof C.addEventListener!=v)C.addEventListener("load",a,!1);else if(typeof B.attachEvent!=v)p(B,"onload",a);else if("function"==typeof B.onload){var b=B.onload;B.onload=function(){b(),a()}}else B.onload=a}function e(){for(var a=F.length,b=0;a>b;b++){var c=F[b].id;if(N.pv[0]>0){var d=n(c);d&&(F[b].width=d.getAttribute("width")?d.getAttribute("width"):"0",F[b].height=d.getAttribute("height")?d.getAttribute("height"):"0",q(F[b].swfVersion)?(N.webkit&&N.webkit<312&&f(d),s(c,!0)):F[b].expressInstall&&!M&&q("6.0.65")&&(N.win||N.mac)?g(F[b]):h(d))}else s(c,!0)}}function f(a){var b=a.getElementsByTagName(w)[0];if(b){var c=o("embed"),d=b.attributes;if(d)for(var e=d.length,f=0;e>f;f++)"DATA"==d[f].nodeName?c.setAttribute("src",d[f].nodeValue):c.setAttribute(d[f].nodeName,d[f].nodeValue);var g=b.childNodes;if(g)for(var h=g.length,i=0;h>i;i++)1==g[i].nodeType&&"PARAM"==g[i].nodeName&&c.setAttribute(g[i].getAttribute("name"),g[i].getAttribute("value"));a.parentNode.replaceChild(c,a)}}function g(a){M=!0;var b=n(a.id);if(b){if(a.altContentId){var c=n(a.altContentId);c&&(J=c,K=a.altContentId)}else J=i(b);!/%$/.test(a.width)&&parseInt(a.width,10)<310&&(a.width="310"),!/%$/.test(a.height)&&parseInt(a.height,10)<137&&(a.height="137"),C.title=C.title.slice(0,47)+" - Flash Player Installation";var d=N.ie&&N.win?"ActiveX":"PlugIn",e=C.title,f="MMredirectURL="+B.location+"&MMplayerType="+d+"&MMdoctitle="+e,g=a.id;if(N.ie&&N.win&&4!=b.readyState){var h=o("div");g+="SWFObjectNew",h.setAttribute("id",g),b.parentNode.insertBefore(h,b),b.style.display="none";var k=function(){b.parentNode.removeChild(b)};p(B,"onload",k)}j({data:a.expressInstall,id:A,width:a.width,height:a.height},{flashvars:f},g)}}function h(a){if(N.ie&&N.win&&4!=a.readyState){var b=o("div");a.parentNode.insertBefore(b,a),b.parentNode.replaceChild(i(a),b),a.style.display="none";var c=function(){a.parentNode.removeChild(a)};p(B,"onload",c)}else a.parentNode.replaceChild(i(a),a)}function i(a){var b=o("div");if(N.win&&N.ie)b.innerHTML=a.innerHTML;else{var c=a.getElementsByTagName(w)[0];if(c){var d=c.childNodes;if(d)for(var e=d.length,f=0;e>f;f++)1==d[f].nodeType&&"PARAM"==d[f].nodeName||8==d[f].nodeType||b.appendChild(d[f].cloneNode(!0))}}return b}function j(a,b,c){var d,e=n(c);if(e)if(typeof a.id==v&&(a.id=c),N.ie&&N.win){var f="";for(var g in a)a[g]!=Object.prototype[g]&&("data"==g.toLowerCase()?b.movie=a[g]:"styleclass"==g.toLowerCase()?f+=' class="'+a[g]+'"':"classid"!=g.toLowerCase()&&(f+=" "+g+'="'+a[g]+'"'));var h="";for(var i in b)b[i]!=Object.prototype[i]&&(h+='');e.outerHTML='",G[G.length]=a.id,d=n(a.id)}else if(N.webkit&&N.webkit<312){var j=o("embed");j.setAttribute("type",z);for(var l in a)a[l]!=Object.prototype[l]&&("data"==l.toLowerCase()?j.setAttribute("src",a[l]):"styleclass"==l.toLowerCase()?j.setAttribute("class",a[l]):"classid"!=l.toLowerCase()&&j.setAttribute(l,a[l]));for(var m in b)b[m]!=Object.prototype[m]&&"movie"!=m.toLowerCase()&&j.setAttribute(m,b[m]);e.parentNode.replaceChild(j,e),d=j}else{var p=o(w);p.setAttribute("type",z);for(var q in a)a[q]!=Object.prototype[q]&&("styleclass"==q.toLowerCase()?p.setAttribute("class",a[q]):"classid"!=q.toLowerCase()&&p.setAttribute(q,a[q]));for(var r in b)b[r]!=Object.prototype[r]&&"movie"!=r.toLowerCase()&&k(p,r,b[r]);e.parentNode.replaceChild(p,e),d=p}return d}function k(a,b,c){var d=o("param");d.setAttribute("name",b),d.setAttribute("value",c),a.appendChild(d)}function l(a){var b=n(a);!b||"OBJECT"!=b.nodeName&&"EMBED"!=b.nodeName||(N.ie&&N.win?4==b.readyState?m(a):B.attachEvent("onload",function(){m(a)}):b.parentNode.removeChild(b))}function m(a){var b=n(a);if(b){for(var c in b)"function"==typeof b[c]&&(b[c]=null);b.parentNode.removeChild(b)}}function n(a){var b=null;try{b=C.getElementById(a)}catch(c){}return b}function o(a){return C.createElement(a)}function p(a,b,c){a.attachEvent(b,c),H[H.length]=[a,b,c]}function q(a){var b=N.pv,c=a.split(".");return c[0]=parseInt(c[0],10),c[1]=parseInt(c[1],10)||0,c[2]=parseInt(c[2],10)||0,b[0]>c[0]||b[0]==c[0]&&b[1]>c[1]||b[0]==c[0]&&b[1]==c[1]&&b[2]>=c[2]?!0:!1}function r(a,b){if(!N.ie||!N.mac){var c=C.getElementsByTagName("head")[0],d=o("style");if(d.setAttribute("type","text/css"),d.setAttribute("media","screen"),N.ie&&N.win||typeof C.createTextNode==v||d.appendChild(C.createTextNode(a+" {"+b+"}")),c.appendChild(d),N.ie&&N.win&&typeof C.styleSheets!=v&&C.styleSheets.length>0){var e=C.styleSheets[C.styleSheets.length-1];typeof e.addRule==w&&e.addRule(a,b)}}}function s(a,b){var c=b?"visible":"hidden";L&&n(a)?n(a).style.visibility=c:r("#"+a,"visibility:"+c)}function t(a){var b=/[\\\"<>\.;]/,c=null!=b.exec(a);return c?encodeURIComponent(a):a}{var u,v="undefined",w="object",x="Shockwave Flash",y="ShockwaveFlash.ShockwaveFlash",z="application/x-shockwave-flash",A="SWFObjectExprInst",B=window,C=document,D=navigator,E=[],F=[],G=[],H=[],I=null,J=null,K=null,L=!1,M=!1,N=function(){var a=typeof C.getElementById!=v&&typeof C.getElementsByTagName!=v&&typeof C.createElement!=v,b=[0,0,0],c=null;if(typeof D.plugins!=v&&typeof D.plugins[x]==w)c=D.plugins[x].description,!c||typeof D.mimeTypes!=v&&D.mimeTypes[z]&&!D.mimeTypes[z].enabledPlugin||(c=c.replace(/^.*\s+(\S+\s+\S+$)/,"$1"),b[0]=parseInt(c.replace(/^(.*)\..*$/,"$1"),10),b[1]=parseInt(c.replace(/^.*\.(.*)\s.*$/,"$1"),10),b[2]=/r/.test(c)?parseInt(c.replace(/^.*r(.*)$/,"$1"),10):0);else if(typeof B.ActiveXObject!=v){var d=null,e=!1;try{d=new ActiveXObject(y+".7")}catch(f){try{d=new ActiveXObject(y+".6"),b=[6,0,21],d.AllowScriptAccess="always"}catch(f){6==b[0]&&(e=!0)}if(!e)try{d=new ActiveXObject(y)}catch(f){}}if(!e&&d)try{c=d.GetVariable("$version"),c&&(c=c.split(" ")[1].split(","),b=[parseInt(c[0],10),parseInt(c[1],10),parseInt(c[2],10)])}catch(f){}}var g=D.userAgent.toLowerCase(),h=D.platform.toLowerCase(),i=/webkit/.test(g)?parseFloat(g.replace(/^.*webkit\/(\d+(\.\d+)?).*$/,"$1")):!1,j=!1,k=/win/.test(h?h:g),l=/mac/.test(h?h:g);return{w3cdom:a,pv:b,webkit:i,ie:j,win:k,mac:l}}();!function(){if(N.w3cdom){if(c(e),N.ie&&N.win)try{C.write(""),u=n("__ie_ondomload"),u&&p(u,"onreadystatechange",a)}catch(f){}N.webkit&&typeof C.readyState!=v&&(I=setInterval(function(){/loaded|complete/.test(C.readyState)&&b()},10)),typeof C.addEventListener!=v&&C.addEventListener("DOMContentLoaded",b,null),d(b)}}(),function(){N.ie&&N.win&&window.attachEvent("onunload",function(){for(var a=H.length,b=0;a>b;b++)H[b][0].detachEvent(H[b][1],H[b][2]);for(var c=G.length,d=0;c>d;d++)l(G[d]);for(var e in N)N[e]=null;N=null;for(var f in swfobject)swfobject[f]=null;swfobject=null})}()}return{registerObject:function(a,b,c){if(N.w3cdom&&a&&b){var d={};d.id=a,d.swfVersion=b,d.expressInstall=c?c:!1,F[F.length]=d,s(a,!1)}},getObjectById:function(a){var b=null;if(N.w3cdom){var c=n(a);if(c){var d=c.getElementsByTagName(w)[0];!d||d&&typeof c.SetVariable!=v?b=c:typeof d.SetVariable!=v&&(b=d)}}return b},embedSWF:function(a,b,d,e,f,h,i,k,l){if(N.w3cdom&&a&&b&&d&&e&&f)if(d+="",e+="",q(f)){s(b,!1);var m={};if(l&&typeof l===w)for(var n in l)l[n]!=Object.prototype[n]&&(m[n]=l[n]);m.data=a,m.width=d,m.height=e;var o={};if(k&&typeof k===w)for(var p in k)k[p]!=Object.prototype[p]&&(o[p]=k[p]);if(i&&typeof i===w)for(var r in i)i[r]!=Object.prototype[r]&&(typeof o.flashvars!=v?o.flashvars+="&"+r+"="+i[r]:o.flashvars=r+"="+i[r]);c(function(){j(m,o,b),m.id==b&&s(b,!0)})}else h&&!M&&q("6.0.65")&&(N.win||N.mac)&&(M=!0,s(b,!1),c(function(){var a={};a.id=a.altContentId=b,a.width=d,a.height=e,a.expressInstall=h,g(a)}))},getFlashPlayerVersion:function(){return{major:N.pv[0],minor:N.pv[1],release:N.pv[2]}},hasFlashPlayerVersion:q,createSWF:function(a,b,c){return N.w3cdom?j(a,b,c):void 0},removeSWF:function(a){N.w3cdom&&l(a)},createCSS:function(a,b){N.w3cdom&&r(a,b)},addDomLoadEvent:c,addLoadEvent:d,getQueryParamValue:function(a){var b=C.location.search||C.location.hash;if(null==a)return t(b);if(b)for(var c=b.substring(1).split("&"),d=0;d20&&(b=b.substring(b.length-19)),b},g="mi"+f(),h=function(a,b){this.g(a,b)};h.prototype={h:function(){var a=new RegExp(g+this.a+"=(\\d+)"),b=document.cookie.match(a);return b?b[1]:this.i()},i:function(){for(var a=0,b=this.b.length;b>a;a++)if(c(this.b[a].parentNode,"selected"))return a;return 0},j:function(a,b){var c=document.getElementById(a.TargetId);if(c){this.l(c);for(var f=0;f=this.b.length&&(a=0),this.j(this.b[a],0)}};var i=[],j=function(a){function c(){e||(e=!0,setTimeout(a,4))}function d(){if(!e)try{document.documentElement.doScroll("left"),c()}catch(a){setTimeout(d,10)}}var e=!1;if(document.addEventListener)document.addEventListener("DOMContentLoaded",c,!1);else if(document.attachEvent){try{var f=null!=window.frameElement}catch(g){}document.documentElement.doScroll&&!f&&d(),document.attachEvent("onreadystatechange",function(){"complete"===document.readyState&&c()})}b(window,"load",c)},k=function(){for(var a=document.getElementsByTagName("ul"),b=0,d=a.length;d>b;b++)c(a[b],"tabs")&&i.push(new h(a[b],b))};return j(k),{}}();var tb_pathToImage="images/loading_animation.gif";$(document).ready(function(){tb_init("a.thickbox, area.thickbox, input.thickbox"),imgLoader=new Image,imgLoader.src=tb_pathToImage});
\ No newline at end of file
diff --git a/images/jquery-ui/ui-bg_diagonals-thick_18_b81900_40x40.png b/images/jquery-ui/ui-bg_diagonals-thick_18_b81900_40x40.png
new file mode 100644
index 000000000..688a63a2a
Binary files /dev/null and b/images/jquery-ui/ui-bg_diagonals-thick_18_b81900_40x40.png differ
diff --git a/images/jquery-ui/ui-bg_diagonals-thick_20_666666_40x40.png b/images/jquery-ui/ui-bg_diagonals-thick_20_666666_40x40.png
new file mode 100644
index 000000000..aa0b44d88
Binary files /dev/null and b/images/jquery-ui/ui-bg_diagonals-thick_20_666666_40x40.png differ
diff --git a/images/jquery-ui/ui-bg_flat_10_000000_40x100.png b/images/jquery-ui/ui-bg_flat_10_000000_40x100.png
new file mode 100644
index 000000000..01be222d2
Binary files /dev/null and b/images/jquery-ui/ui-bg_flat_10_000000_40x100.png differ
diff --git a/images/jquery-ui/ui-bg_glass_100_f6f6f6_1x400.png b/images/jquery-ui/ui-bg_glass_100_f6f6f6_1x400.png
new file mode 100644
index 000000000..558db7654
Binary files /dev/null and b/images/jquery-ui/ui-bg_glass_100_f6f6f6_1x400.png differ
diff --git a/images/jquery-ui/ui-bg_glass_100_fdf5ce_1x400.png b/images/jquery-ui/ui-bg_glass_100_fdf5ce_1x400.png
new file mode 100644
index 000000000..8af683476
Binary files /dev/null and b/images/jquery-ui/ui-bg_glass_100_fdf5ce_1x400.png differ
diff --git a/images/jquery-ui/ui-bg_glass_65_ffffff_1x400.png b/images/jquery-ui/ui-bg_glass_65_ffffff_1x400.png
new file mode 100644
index 000000000..ef1d63009
Binary files /dev/null and b/images/jquery-ui/ui-bg_glass_65_ffffff_1x400.png differ
diff --git a/images/jquery-ui/ui-bg_gloss-wave_35_f6a828_500x100.png b/images/jquery-ui/ui-bg_gloss-wave_35_f6a828_500x100.png
new file mode 100644
index 000000000..c0e636d08
Binary files /dev/null and b/images/jquery-ui/ui-bg_gloss-wave_35_f6a828_500x100.png differ
diff --git a/images/jquery-ui/ui-bg_highlight-soft_100_eeeeee_1x100.png b/images/jquery-ui/ui-bg_highlight-soft_100_eeeeee_1x100.png
new file mode 100644
index 000000000..6e9a0f018
Binary files /dev/null and b/images/jquery-ui/ui-bg_highlight-soft_100_eeeeee_1x100.png differ
diff --git a/images/jquery-ui/ui-bg_highlight-soft_75_ffe45c_1x100.png b/images/jquery-ui/ui-bg_highlight-soft_75_ffe45c_1x100.png
new file mode 100644
index 000000000..818ca6c00
Binary files /dev/null and b/images/jquery-ui/ui-bg_highlight-soft_75_ffe45c_1x100.png differ
diff --git a/images/jquery-ui/ui-icons_222222_256x240.png b/images/jquery-ui/ui-icons_222222_256x240.png
new file mode 100644
index 000000000..e9c8e16ac
Binary files /dev/null and b/images/jquery-ui/ui-icons_222222_256x240.png differ
diff --git a/images/jquery-ui/ui-icons_228ef1_256x240.png b/images/jquery-ui/ui-icons_228ef1_256x240.png
new file mode 100644
index 000000000..8d68c543e
Binary files /dev/null and b/images/jquery-ui/ui-icons_228ef1_256x240.png differ
diff --git a/images/jquery-ui/ui-icons_ef8c08_256x240.png b/images/jquery-ui/ui-icons_ef8c08_256x240.png
new file mode 100644
index 000000000..18bbfe821
Binary files /dev/null and b/images/jquery-ui/ui-icons_ef8c08_256x240.png differ
diff --git a/images/jquery-ui/ui-icons_ffd27a_256x240.png b/images/jquery-ui/ui-icons_ffd27a_256x240.png
new file mode 100644
index 000000000..4435b497e
Binary files /dev/null and b/images/jquery-ui/ui-icons_ffd27a_256x240.png differ
diff --git a/images/jquery-ui/ui-icons_ffffff_256x240.png b/images/jquery-ui/ui-icons_ffffff_256x240.png
new file mode 100644
index 000000000..4d66f596e
Binary files /dev/null and b/images/jquery-ui/ui-icons_ffffff_256x240.png differ
diff --git a/js/datepicker.js b/js/datepicker.js
deleted file mode 100644
index 5b19e6893..000000000
--- a/js/datepicker.js
+++ /dev/null
@@ -1,1216 +0,0 @@
-/**
- * Copyright (c) 2008 Kelvin Luck (http://www.kelvinluck.com/)
- * Dual licensed under the MIT (http://www.opensource.org/licenses/mit-license.php)
- * and GPL (http://www.opensource.org/licenses/gpl-license.php) licenses.
- * .
- * $Id: jquery.datePicker.js 102 2010-09-13 14:00:54Z kelvin.luck $
- **/
-
-(function($){
-
- $.fn.extend({
-/**
- * Render a calendar table into any matched elements.
- *
- * @param Object s (optional) Customize your calendars.
- * @option Number month The month to render (NOTE that months are zero based). Default is today's month.
- * @option Number year The year to render. Default is today's year.
- * @option Function renderCallback A reference to a function that is called as each cell is rendered and which can add classes and event listeners to the created nodes. Default is no callback.
- * @option Number showHeader Whether or not to show the header row, possible values are: $.dpConst.SHOW_HEADER_NONE (no header), $.dpConst.SHOW_HEADER_SHORT (first letter of each day) and $.dpConst.SHOW_HEADER_LONG (full name of each day). Default is $.dpConst.SHOW_HEADER_SHORT.
- * @option String hoverClass The class to attach to each cell when you hover over it (to allow you to use hover effects in IE6 which doesn't support the :hover pseudo-class on elements other than links). Default is dp-hover. Pass false if you don't want a hover class.
- * @type jQuery
- * @name renderCalendar
- * @cat plugins/datePicker
- * @author Kelvin Luck (http://www.kelvinluck.com/)
- *
- * @example $('#calendar-me').renderCalendar({month:0, year:2007});
- * @desc Renders a calendar displaying January 2007 into the element with an id of calendar-me.
- *
- * @example
- * var testCallback = function($td, thisDate, month, year)
- * {
- * if ($td.is('.current-month') && thisDate.getDay() == 4) {
- * var d = thisDate.getDate();
- * $td.bind(
- * 'click',
- * function()
- * {
- * alert('You clicked on ' + d + '/' + (Number(month)+1) + '/' + year);
- * }
- * ).addClass('thursday');
- * } else if (thisDate.getDay() == 5) {
- * $td.html('Friday the ' + $td.html() + 'th');
- * }
- * }
- * $('#calendar-me').renderCalendar({month:0, year:2007, renderCallback:testCallback});
- *
- * @desc Renders a calendar displaying January 2007 into the element with an id of calendar-me. Every Thursday in the current month has a class of "thursday" applied to it, is clickable and shows an alert when clicked. Every Friday on the calendar has the number inside replaced with text.
- **/
- renderCalendar : function(s)
- {
- var dc = function(a)
- {
- return document.createElement(a);
- };
-
- s = $.extend({}, $.fn.datePicker.defaults, s);
-
- if (s.showHeader != $.dpConst.SHOW_HEADER_NONE) {
- var headRow = $(dc('tr'));
- for (var i=Date.firstDayOfWeek; i 1) firstDayOffset -= 7;
- var weeksToDraw = Math.ceil(( (-1*firstDayOffset+1) + currentDate.getDaysInMonth() ) /7);
- currentDate.addDays(firstDayOffset-1);
-
- var doHover = function(firstDayInBounds)
- {
- return function()
- {
- if (s.hoverClass) {
- var $this = $(this);
- if (!s.selectWeek) {
- $this.addClass(s.hoverClass);
- } else if (firstDayInBounds && !$this.is('.disabled')) {
- $this.parent().addClass('activeWeekHover');
- }
- }
- }
- };
- var unHover = function()
- {
- if (s.hoverClass) {
- var $this = $(this);
- $this.removeClass(s.hoverClass);
- $this.parent().removeClass('activeWeekHover');
- }
- };
-
- var w = 0;
- while (w++ s.dpController.startDate : false;
- for (var i=0; i<7; i++) {
- var thisMonth = currentDate.getMonth() == month;
- var d = $(dc('td'))
- .text(currentDate.getDate() + '')
- .addClass((thisMonth ? 'current-month ' : 'other-month ') +
- (currentDate.isWeekend() ? 'weekend ' : 'weekday ') +
- (thisMonth && currentDate.getTime() == today.getTime() ? 'today ' : '')
- )
- .data('datePickerDate', currentDate.asString())
- .hover(doHover(firstDayInBounds), unHover)
- ;
- r.append(d);
- if (s.renderCallback) {
- s.renderCallback(d, currentDate, month, year);
- }
- // addDays(1) fails in some locales due to daylight savings. See issue 39.
- //currentDate.addDays(1);
- // set the time to midday to avoid any weird timezone issues??
- currentDate = new Date(currentDate.getFullYear(), currentDate.getMonth(), currentDate.getDate()+1, 12, 0, 0);
- }
- tbody.append(r);
- }
- calendarTable.append(tbody);
-
- return this.each(
- function()
- {
- $(this).empty().append(calendarTable);
- }
- );
- },
-/**
- * Create a datePicker associated with each of the matched elements.
- *
- * The matched element will receive a few custom events with the following signatures:
- *
- * dateSelected(event, date, $td, status)
- * Triggered when a date is selected. event is a reference to the event, date is the Date selected, $td is a jquery object wrapped around the TD that was clicked on and status is whether the date was selected (true) or deselected (false)
- *
- * dpClosed(event, selected)
- * Triggered when the date picker is closed. event is a reference to the event and selected is an Array containing Date objects.
- *
- * dpMonthChanged(event, displayedMonth, displayedYear)
- * Triggered when the month of the popped up calendar is changed. event is a reference to the event, displayedMonth is the number of the month now displayed (zero based) and displayedYear is the year of the month.
- *
- * dpDisplayed(event, $datePickerDiv)
- * Triggered when the date picker is created. $datePickerDiv is the div containing the date picker. Use this event to add custom content/ listeners to the popped up date picker.
- *
- * @param Object s (optional) Customize your date pickers.
- * @option Number month The month to render when the date picker is opened (NOTE that months are zero based). Default is today's month.
- * @option Number year The year to render when the date picker is opened. Default is today's year.
- * @option String startDate The first date date can be selected.
- * @option String endDate The last date that can be selected.
- * @option Boolean inline Whether to create the datePicker as inline (e.g. always on the page) or as a model popup. Default is false (== modal popup)
- * @option Boolean createButton Whether to create a .dp-choose-date anchor directly after the matched element which when clicked will trigger the showing of the date picker. Default is true.
- * @option Boolean showYearNavigation Whether to display buttons which allow the user to navigate through the months a year at a time. Default is true.
- * @option Boolean closeOnSelect Whether to close the date picker when a date is selected. Default is true.
- * @option Boolean displayClose Whether to create a "Close" button within the date picker popup. Default is false.
- * @option Boolean selectMultiple Whether a user should be able to select multiple dates with this date picker. Default is false.
- * @option Number numSelectable The maximum number of dates that can be selected where selectMultiple is true. Default is a very high number.
- * @option Boolean clickInput If the matched element is an input type="text" and this option is true then clicking on the input will cause the date picker to appear.
- * @option Boolean rememberViewedMonth Whether the datePicker should remember the last viewed month and open on it. If false then the date picker will always open with the month for the first selected date visible.
- * @option Boolean selectWeek Whether to select a complete week at a time...
- * @option Number verticalPosition The vertical alignment of the popped up date picker to the matched element. One of $.dpConst.POS_TOP and $.dpConst.POS_BOTTOM. Default is $.dpConst.POS_TOP.
- * @option Number horizontalPosition The horizontal alignment of the popped up date picker to the matched element. One of $.dpConst.POS_LEFT and $.dpConst.POS_RIGHT.
- * @option Number verticalOffset The number of pixels offset from the defined verticalPosition of this date picker that it should pop up in. Default in 0.
- * @option Number horizontalOffset The number of pixels offset from the defined horizontalPosition of this date picker that it should pop up in. Default in 0.
- * @option (Function|Array) renderCallback A reference to a function (or an array of separate functions) that is called as each cell is rendered and which can add classes and event listeners to the created nodes. Each callback function will receive four arguments; a jquery object wrapping the created TD, a Date object containing the date this TD represents, a number giving the currently rendered month and a number giving the currently rendered year. Default is no callback.
- * @option String hoverClass The class to attach to each cell when you hover over it (to allow you to use hover effects in IE6 which doesn't support the :hover pseudo-class on elements other than links). Default is dp-hover. Pass false if you don't want a hover class.
- * @option String autoFocusNextInput Whether focus should be passed onto the next input in the form (true) or remain on this input (false) when a date is selected and the calendar closes
- * @type jQuery
- * @name datePicker
- * @cat plugins/datePicker
- * @author Kelvin Luck (http://www.kelvinluck.com/)
- *
- * @example $('input.date-picker').datePicker();
- * @desc Creates a date picker button next to all matched input elements. When the button is clicked on the value of the selected date will be placed in the corresponding input (formatted according to Date.format).
- *
- * @example demo/index.html
- * @desc See the projects homepage for many more complex examples...
- **/
- datePicker : function(s)
- {
- if (!$.event._dpCache) $.event._dpCache = [];
-
- // initialise the date picker controller with the relevant settings...
- s = $.extend({}, $.fn.datePicker.defaults, s);
-
- return this.each(
- function()
- {
- var $this = $(this);
- var alreadyExists = true;
-
- if (!this._dpId) {
- this._dpId = $.event.guid++;
- $.event._dpCache[this._dpId] = new DatePicker(this);
- alreadyExists = false;
- }
-
- if (s.inline) {
- s.createButton = false;
- s.displayClose = false;
- s.closeOnSelect = false;
- $this.empty();
- }
-
- var controller = $.event._dpCache[this._dpId];
-
- controller.init(s);
-
- if (!alreadyExists && s.createButton) {
- // create it!
- controller.button = $('' + $.dpText.TEXT_CHOOSE_DATE + '')
- .bind(
- 'click',
- function()
- {
- $this.dpDisplay(this);
- this.blur();
- return false;
- }
- );
- $this.after(controller.button);
- }
-
- if (!alreadyExists && $this.is(':text')) {
- $this
- .bind(
- 'dateSelected',
- function(e, selectedDate, $td)
- {
- this.value = selectedDate.asString();
- }
- ).bind(
- 'change',
- function()
- {
- if (this.value == '') {
- controller.clearSelected();
- } else {
- var d = Date.fromString(this.value);
- if (d) {
- controller.setSelected(d, true, true);
- }
- }
- }
- );
- if (s.clickInput) {
- $this.bind(
- 'click',
- function()
- {
- // The change event doesn't happen until the input loses focus so we need to manually trigger it...
- $this.trigger('change');
- $this.dpDisplay();
- }
- );
- }
- var d = Date.fromString(this.value);
- if (this.value != '' && d) {
- controller.setSelected(d, true, true);
- }
- }
-
- $this.addClass('dp-applied');
-
- }
- )
- },
-/**
- * Disables or enables this date picker
- *
- * @param Boolean s Whether to disable (true) or enable (false) this datePicker
- * @type jQuery
- * @name dpSetDisabled
- * @cat plugins/datePicker
- * @author Kelvin Luck (http://www.kelvinluck.com/)
- *
- * @example $('.date-picker').datePicker();
- * $('.date-picker').dpSetDisabled(true);
- * @desc Prevents this date picker from displaying and adds a class of dp-disabled to it (and it's associated button if it has one) for styling purposes. If the matched element is an input field then it will also set the disabled attribute to stop people directly editing the field.
- **/
- dpSetDisabled : function(s)
- {
- return _w.call(this, 'setDisabled', s);
- },
-/**
- * Updates the first selectable date for any date pickers on any matched elements.
- *
- * @param String d A string representing the first selectable date (formatted according to Date.format).
- * @type jQuery
- * @name dpSetStartDate
- * @cat plugins/datePicker
- * @author Kelvin Luck (http://www.kelvinluck.com/)
- *
- * @example $('.date-picker').datePicker();
- * $('.date-picker').dpSetStartDate('01/01/2000');
- * @desc Creates a date picker associated with all elements with a class of "date-picker" then sets the first selectable date for each of these to the first day of the millenium.
- **/
- dpSetStartDate : function(d)
- {
- return _w.call(this, 'setStartDate', d);
- },
-/**
- * Updates the last selectable date for any date pickers on any matched elements.
- *
- * @param String d A string representing the last selectable date (formatted according to Date.format).
- * @type jQuery
- * @name dpSetEndDate
- * @cat plugins/datePicker
- * @author Kelvin Luck (http://www.kelvinluck.com/)
- *
- * @example $('.date-picker').datePicker();
- * $('.date-picker').dpSetEndDate('01/01/2010');
- * @desc Creates a date picker associated with all elements with a class of "date-picker" then sets the last selectable date for each of these to the first Janurary 2010.
- **/
- dpSetEndDate : function(d)
- {
- return _w.call(this, 'setEndDate', d);
- },
-/**
- * Gets a list of Dates currently selected by this datePicker. This will be an empty array if no dates are currently selected or NULL if there is no datePicker associated with the matched element.
- *
- * @type Array
- * @name dpGetSelected
- * @cat plugins/datePicker
- * @author Kelvin Luck (http://www.kelvinluck.com/)
- *
- * @example $('.date-picker').datePicker();
- * alert($('.date-picker').dpGetSelected());
- * @desc Will alert an empty array (as nothing is selected yet)
- **/
- dpGetSelected : function()
- {
- var c = _getController(this[0]);
- if (c) {
- return c.getSelected();
- }
- return null;
- },
-/**
- * Selects or deselects a date on any matched element's date pickers. Deselcting is only useful on date pickers where selectMultiple==true. Selecting will only work if the passed date is within the startDate and endDate boundries for a given date picker.
- *
- * @param String d A string representing the date you want to select (formatted according to Date.format).
- * @param Boolean v Whether you want to select (true) or deselect (false) this date. Optional - default = true.
- * @param Boolean m Whether you want the date picker to open up on the month of this date when it is next opened. Optional - default = true.
- * @param Boolean e Whether you want the date picker to dispatch events related to this change of selection. Optional - default = true.
- * @type jQuery
- * @name dpSetSelected
- * @cat plugins/datePicker
- * @author Kelvin Luck (http://www.kelvinluck.com/)
- *
- * @example $('.date-picker').datePicker();
- * $('.date-picker').dpSetSelected('01/01/2010');
- * @desc Creates a date picker associated with all elements with a class of "date-picker" then sets the selected date on these date pickers to the first Janurary 2010. When the date picker is next opened it will display Janurary 2010.
- **/
- dpSetSelected : function(d, v, m, e)
- {
- if (v == undefined) v=true;
- if (m == undefined) m=true;
- if (e == undefined) e=true;
- return _w.call(this, 'setSelected', Date.fromString(d), v, m, e);
- },
-/**
- * Sets the month that will be displayed when the date picker is next opened. If the passed month is before startDate then the month containing startDate will be displayed instead. If the passed month is after endDate then the month containing the endDate will be displayed instead.
- *
- * @param Number m The month you want the date picker to display. Optional - defaults to the currently displayed month.
- * @param Number y The year you want the date picker to display. Optional - defaults to the currently displayed year.
- * @type jQuery
- * @name dpSetDisplayedMonth
- * @cat plugins/datePicker
- * @author Kelvin Luck (http://www.kelvinluck.com/)
- *
- * @example $('.date-picker').datePicker();
- * $('.date-picker').dpSetDisplayedMonth(10, 2008);
- * @desc Creates a date picker associated with all elements with a class of "date-picker" then sets the selected date on these date pickers to the first Janurary 2010. When the date picker is next opened it will display Janurary 2010.
- **/
- dpSetDisplayedMonth : function(m, y)
- {
- return _w.call(this, 'setDisplayedMonth', Number(m), Number(y), true);
- },
-/**
- * Displays the date picker associated with the matched elements. Since only one date picker can be displayed at once then the date picker associated with the last matched element will be the one that is displayed.
- *
- * @param HTMLElement e An element that you want the date picker to pop up relative in position to. Optional - default behaviour is to pop up next to the element associated with this date picker.
- * @type jQuery
- * @name dpDisplay
- * @cat plugins/datePicker
- * @author Kelvin Luck (http://www.kelvinluck.com/)
- *
- * @example $('#date-picker').datePicker();
- * $('#date-picker').dpDisplay();
- * @desc Creates a date picker associated with the element with an id of date-picker and then causes it to pop up.
- **/
- dpDisplay : function(e)
- {
- return _w.call(this, 'display', e);
- },
-/**
- * Sets a function or array of functions that is called when each TD of the date picker popup is rendered to the page
- *
- * @param (Function|Array) a A function or an array of functions that are called when each td is rendered. Each function will receive four arguments; a jquery object wrapping the created TD, a Date object containing the date this TD represents, a number giving the currently rendered month and a number giving the currently rendered year.
- * @type jQuery
- * @name dpSetRenderCallback
- * @cat plugins/datePicker
- * @author Kelvin Luck (http://www.kelvinluck.com/)
- *
- * @example $('#date-picker').datePicker();
- * $('#date-picker').dpSetRenderCallback(function($td, thisDate, month, year)
- * {
- * // do stuff as each td is rendered dependant on the date in the td and the displayed month and year
- * });
- * @desc Creates a date picker associated with the element with an id of date-picker and then creates a function which is called as each td is rendered when this date picker is displayed.
- **/
- dpSetRenderCallback : function(a)
- {
- return _w.call(this, 'setRenderCallback', a);
- },
-/**
- * Sets the position that the datePicker will pop up (relative to it's associated element)
- *
- * @param Number v The vertical alignment of the created date picker to it's associated element. Possible values are $.dpConst.POS_TOP and $.dpConst.POS_BOTTOM
- * @param Number h The horizontal alignment of the created date picker to it's associated element. Possible values are $.dpConst.POS_LEFT and $.dpConst.POS_RIGHT
- * @type jQuery
- * @name dpSetPosition
- * @cat plugins/datePicker
- * @author Kelvin Luck (http://www.kelvinluck.com/)
- *
- * @example $('#date-picker').datePicker();
- * $('#date-picker').dpSetPosition($.dpConst.POS_BOTTOM, $.dpConst.POS_RIGHT);
- * @desc Creates a date picker associated with the element with an id of date-picker and makes it so that when this date picker pops up it will be bottom and right aligned to the #date-picker element.
- **/
- dpSetPosition : function(v, h)
- {
- return _w.call(this, 'setPosition', v, h);
- },
-/**
- * Sets the offset that the popped up date picker will have from it's default position relative to it's associated element (as set by dpSetPosition)
- *
- * @param Number v The vertical offset of the created date picker.
- * @param Number h The horizontal offset of the created date picker.
- * @type jQuery
- * @name dpSetOffset
- * @cat plugins/datePicker
- * @author Kelvin Luck (http://www.kelvinluck.com/)
- *
- * @example $('#date-picker').datePicker();
- * $('#date-picker').dpSetOffset(-20, 200);
- * @desc Creates a date picker associated with the element with an id of date-picker and makes it so that when this date picker pops up it will be 20 pixels above and 200 pixels to the right of it's default position.
- **/
- dpSetOffset : function(v, h)
- {
- return _w.call(this, 'setOffset', v, h);
- },
-/**
- * Closes the open date picker associated with this element.
- *
- * @type jQuery
- * @name dpClose
- * @cat plugins/datePicker
- * @author Kelvin Luck (http://www.kelvinluck.com/)
- *
- * @example $('.date-pick')
- * .datePicker()
- * .bind(
- * 'focus',
- * function()
- * {
- * $(this).dpDisplay();
- * }
- * ).bind(
- * 'blur',
- * function()
- * {
- * $(this).dpClose();
- * }
- * );
- **/
- dpClose : function()
- {
- return _w.call(this, '_closeCalendar', false, this[0]);
- },
-/**
- * Rerenders the date picker's current month (for use with inline calendars and renderCallbacks).
- *
- * @type jQuery
- * @name dpRerenderCalendar
- * @cat plugins/datePicker
- * @author Kelvin Luck (http://www.kelvinluck.com/)
- *
- **/
- dpRerenderCalendar : function()
- {
- return _w.call(this, '_rerenderCalendar');
- },
- // private function called on unload to clean up any expandos etc and prevent memory links...
- _dpDestroy : function()
- {
- // TODO - implement this?
- }
- });
-
- // private internal function to cut down on the amount of code needed where we forward
- // dp* methods on the jQuery object on to the relevant DatePicker controllers...
- var _w = function(f, a1, a2, a3, a4)
- {
- return this.each(
- function()
- {
- var c = _getController(this);
- if (c) {
- c[f](a1, a2, a3, a4);
- }
- }
- );
- };
-
- function DatePicker(ele)
- {
- this.ele = ele;
-
- // initial values...
- this.displayedMonth = null;
- this.displayedYear = null;
- this.startDate = null;
- this.endDate = null;
- this.showYearNavigation = null;
- this.closeOnSelect = null;
- this.displayClose = null;
- this.rememberViewedMonth= null;
- this.selectMultiple = null;
- this.numSelectable = null;
- this.numSelected = null;
- this.verticalPosition = null;
- this.horizontalPosition = null;
- this.verticalOffset = null;
- this.horizontalOffset = null;
- this.button = null;
- this.renderCallback = [];
- this.selectedDates = {};
- this.inline = null;
- this.context = '#dp-popup';
- this.settings = {};
- };
- $.extend(
- DatePicker.prototype,
- {
- init : function(s)
- {
- this.setStartDate(s.startDate);
- this.setEndDate(s.endDate);
- this.setDisplayedMonth(Number(s.month), Number(s.year));
- this.setRenderCallback(s.renderCallback);
- this.showYearNavigation = s.showYearNavigation;
- this.closeOnSelect = s.closeOnSelect;
- this.displayClose = s.displayClose;
- this.rememberViewedMonth = s.rememberViewedMonth;
- this.selectMultiple = s.selectMultiple;
- this.numSelectable = s.selectMultiple ? s.numSelectable : 1;
- this.numSelected = 0;
- this.verticalPosition = s.verticalPosition;
- this.horizontalPosition = s.horizontalPosition;
- this.hoverClass = s.hoverClass;
- this.setOffset(s.verticalOffset, s.horizontalOffset);
- this.inline = s.inline;
- this.settings = s;
- if (this.inline) {
- this.context = this.ele;
- this.display();
- }
- },
- setStartDate : function(d)
- {
- if (d) {
- this.startDate = Date.fromString(d);
- }
- if (!this.startDate) {
- this.startDate = (new Date()).zeroTime();
- }
- this.setDisplayedMonth(this.displayedMonth, this.displayedYear);
- },
- setEndDate : function(d)
- {
- if (d) {
- this.endDate = Date.fromString(d);
- }
- if (!this.endDate) {
- this.endDate = (new Date('12/31/2999')); // using the JS Date.parse function which expects mm/dd/yyyy
- }
- if (this.endDate.getTime() < this.startDate.getTime()) {
- this.endDate = this.startDate;
- }
- this.setDisplayedMonth(this.displayedMonth, this.displayedYear);
- },
- setPosition : function(v, h)
- {
- this.verticalPosition = v;
- this.horizontalPosition = h;
- },
- setOffset : function(v, h)
- {
- this.verticalOffset = parseInt(v) || 0;
- this.horizontalOffset = parseInt(h) || 0;
- },
- setDisabled : function(s)
- {
- $e = $(this.ele);
- $e[s ? 'addClass' : 'removeClass']('dp-disabled');
- if (this.button) {
- $but = $(this.button);
- $but[s ? 'addClass' : 'removeClass']('dp-disabled');
- $but.attr('title', s ? '' : $.dpText.TEXT_CHOOSE_DATE);
- }
- if ($e.is(':text')) {
- $e.attr('disabled', s ? 'disabled' : '');
- }
- },
- setDisplayedMonth : function(m, y, rerender)
- {
- if (this.startDate == undefined || this.endDate == undefined) {
- return;
- }
- var s = new Date(this.startDate.getTime());
- s.setDate(1);
- var e = new Date(this.endDate.getTime());
- e.setDate(1);
-
- var t;
- if ((!m && !y) || (isNaN(m) && isNaN(y))) {
- // no month or year passed - default to current month
- t = new Date().zeroTime();
- t.setDate(1);
- } else if (isNaN(m)) {
- // just year passed in - presume we want the displayedMonth
- t = new Date(y, this.displayedMonth, 1);
- } else if (isNaN(y)) {
- // just month passed in - presume we want the displayedYear
- t = new Date(this.displayedYear, m, 1);
- } else {
- // year and month passed in - that's the date we want!
- t = new Date(y, m, 1)
- }
- // check if the desired date is within the range of our defined startDate and endDate
- if (t.getTime() < s.getTime()) {
- t = s;
- } else if (t.getTime() > e.getTime()) {
- t = e;
- }
- var oldMonth = this.displayedMonth;
- var oldYear = this.displayedYear;
- this.displayedMonth = t.getMonth();
- this.displayedYear = t.getFullYear();
-
- if (rerender && (this.displayedMonth != oldMonth || this.displayedYear != oldYear))
- {
- this._rerenderCalendar();
- $(this.ele).trigger('dpMonthChanged', [this.displayedMonth, this.displayedYear]);
- }
- },
- setSelected : function(d, v, moveToMonth, dispatchEvents)
- {
- if (d < this.startDate || d.zeroTime() > this.endDate.zeroTime()) {
- // Don't allow people to select dates outside range...
- return;
- }
- var s = this.settings;
- if (s.selectWeek)
- {
- d = d.addDays(- (d.getDay() - Date.firstDayOfWeek + 7) % 7);
- if (d < this.startDate) // The first day of this week is before the start date so is unselectable...
- {
- return;
- }
- }
- if (v == this.isSelected(d)) // this date is already un/selected
- {
- return;
- }
- if (this.selectMultiple == false) {
- this.clearSelected();
- } else if (v && this.numSelected == this.numSelectable) {
- // can't select any more dates...
- return;
- }
- if (moveToMonth && (this.displayedMonth != d.getMonth() || this.displayedYear != d.getFullYear())) {
- this.setDisplayedMonth(d.getMonth(), d.getFullYear(), true);
- }
- this.selectedDates[d.asString()] = v;
- this.numSelected += v ? 1 : -1;
- var selectorString = 'td.' + (d.getMonth() == this.displayedMonth ? 'current-month' : 'other-month');
- var $td;
- $(selectorString, this.context).each(
- function()
- {
- if ($(this).data('datePickerDate') == d.asString()) {
- $td = $(this);
- if (s.selectWeek)
- {
- $td.parent()[v ? 'addClass' : 'removeClass']('selectedWeek');
- }
- $td[v ? 'addClass' : 'removeClass']('selected');
- }
- }
- );
- $('td', this.context).not('.selected')[this.selectMultiple && this.numSelected == this.numSelectable ? 'addClass' : 'removeClass']('unselectable');
-
- if (dispatchEvents)
- {
- var s = this.isSelected(d);
- $e = $(this.ele);
- var dClone = Date.fromString(d.asString());
- $e.trigger('dateSelected', [dClone, $td, s]);
- $e.trigger('change');
- }
- },
- isSelected : function(d)
- {
- return this.selectedDates[d.asString()];
- },
- getSelected : function()
- {
- var r = [];
- for(var s in this.selectedDates) {
- if (this.selectedDates[s] == true) {
- r.push(Date.fromString(s));
- }
- }
- return r;
- },
- clearSelected : function()
- {
- this.selectedDates = {};
- this.numSelected = 0;
- $('td.selected', this.context).removeClass('selected').parent().removeClass('selectedWeek');
- },
- display : function(eleAlignTo)
- {
- if ($(this.ele).is('.dp-disabled')) return;
-
- eleAlignTo = eleAlignTo || this.ele;
- var c = this;
- var $ele = $(eleAlignTo);
- var eleOffset = $ele.offset();
-
- var $createIn;
- var attrs;
- var attrsCalendarHolder;
- var cssRules;
-
- if (c.inline) {
- $createIn = $(this.ele);
- attrs = {
- 'id' : 'calendar-' + this.ele._dpId,
- 'class' : 'dp-popup dp-popup-inline'
- };
-
- $('.dp-popup', $createIn).remove();
- cssRules = {
- };
- } else {
- $createIn = $('body');
- attrs = {
- 'id' : 'dp-popup',
- 'class' : 'dp-popup'
- };
- cssRules = {
- 'top' : eleOffset.top + c.verticalOffset,
- 'left' : eleOffset.left + c.horizontalOffset
- };
-
- var _checkMouse = function(e)
- {
- var el = e.target;
- var cal = $('#dp-popup')[0];
-
- while (true){
- if (el == cal) {
- return true;
- } else if (el == document) {
- c._closeCalendar();
- return false;
- } else {
- el = $(el).parent()[0];
- }
- }
- };
- this._checkMouse = _checkMouse;
-
- c._closeCalendar(true);
- $(document).bind(
- 'keydown.datepicker',
- function(event)
- {
- if (event.keyCode == 27) {
- c._closeCalendar();
- }
- }
- );
- }
-
- if (!c.rememberViewedMonth)
- {
- var selectedDate = this.getSelected()[0];
- if (selectedDate) {
- selectedDate = new Date(selectedDate);
- this.setDisplayedMonth(selectedDate.getMonth(), selectedDate.getFullYear(), false);
- }
- }
-
- $createIn
- .append(
- $('')
- .attr(attrs)
- .css(cssRules)
- .append(
-// $('aaa'),
- $(''),
- $('')
- .append(
- $('<<')
- .bind(
- 'click',
- function()
- {
- return c._displayNewMonth.call(c, this, 0, -1);
- }
- ),
- $('<')
- .bind(
- 'click',
- function()
- {
- return c._displayNewMonth.call(c, this, -1, 0);
- }
- )
- ),
- $('')
- .append(
- $('>>')
- .bind(
- 'click',
- function()
- {
- return c._displayNewMonth.call(c, this, 0, 1);
- }
- ),
- $('>')
- .bind(
- 'click',
- function()
- {
- return c._displayNewMonth.call(c, this, 1, 0);
- }
- )
- ),
- $('')
- )
- .bgIframe()
- );
-
- var $pop = this.inline ? $('.dp-popup', this.context) : $('#dp-popup');
-
- if (this.showYearNavigation == false) {
- $('.dp-nav-prev-year, .dp-nav-next-year', c.context).css('display', 'none');
- }
- if (this.displayClose) {
- $pop.append(
- $('' + $.dpText.TEXT_CLOSE + '')
- .bind(
- 'click',
- function()
- {
- c._closeCalendar();
- return false;
- }
- )
- );
- }
- c._renderCalendar();
-
- $(this.ele).trigger('dpDisplayed', $pop);
-
- if (!c.inline) {
- if (this.verticalPosition == $.dpConst.POS_BOTTOM) {
- $pop.css('top', eleOffset.top + $ele.height() - $pop.height() + c.verticalOffset);
- }
- if (this.horizontalPosition == $.dpConst.POS_RIGHT) {
- $pop.css('left', eleOffset.left + $ele.width() - $pop.width() + c.horizontalOffset);
- }
-// $('.selectee', this.context).focus();
- $(document).bind('mousedown.datepicker', this._checkMouse);
- }
-
- },
- setRenderCallback : function(a)
- {
- if (a == null) return;
- if (a && typeof(a) == 'function') {
- a = [a];
- }
- this.renderCallback = this.renderCallback.concat(a);
- },
- cellRender : function ($td, thisDate, month, year) {
- var c = this.dpController;
- var d = new Date(thisDate.getTime());
-
- // add our click handlers to deal with it when the days are clicked...
-
- $td.bind(
- 'click',
- function()
- {
- var $this = $(this);
- if (!$this.is('.disabled')) {
- c.setSelected(d, !$this.is('.selected') || !c.selectMultiple, false, true);
- if (c.closeOnSelect) {
- // Focus the next input in the form…
- if (c.settings.autoFocusNextInput) {
- var ele = c.ele;
- var found = false;
- $(':input', ele.form).each(
- function()
- {
- if (found) {
- $(this).focus();
- return false;
- }
- if (this == ele) {
- found = true;
- }
- }
- );
- } else {
- c.ele.focus();
- }
- c._closeCalendar();
- }
- }
- }
- );
- if (c.isSelected(d)) {
- $td.addClass('selected');
- if (c.settings.selectWeek)
- {
- $td.parent().addClass('selectedWeek');
- }
- } else if (c.selectMultiple && c.numSelected == c.numSelectable) {
- $td.addClass('unselectable');
- }
-
- },
- _applyRenderCallbacks : function()
- {
- var c = this;
- $('td', this.context).each(
- function()
- {
- for (var i=0; i 20) {
- $this.addClass('disabled');
- }
- }
- );
- var d = this.startDate.getDate();
- $('.dp-calendar td.current-month', this.context).each(
- function()
- {
- var $this = $(this);
- if (Number($this.text()) < d) {
- $this.addClass('disabled');
- }
- }
- );
- } else {
- $('.dp-nav-prev-year', this.context).removeClass('disabled');
- $('.dp-nav-prev-month', this.context).removeClass('disabled');
- var d = this.startDate.getDate();
- if (d > 20) {
- // check if the startDate is last month as we might need to add some disabled classes...
- var st = this.startDate.getTime();
- var sd = new Date(st);
- sd.addMonths(1);
- if (this.displayedYear == sd.getFullYear() && this.displayedMonth == sd.getMonth()) {
- $('.dp-calendar td.other-month', this.context).each(
- function()
- {
- var $this = $(this);
- if (Date.fromString($this.data('datePickerDate')).getTime() < st) {
- $this.addClass('disabled');
- }
- }
- );
- }
- }
- }
- if (this.displayedYear == this.endDate.getFullYear() && this.displayedMonth == this.endDate.getMonth()) {
- $('.dp-nav-next-year', this.context).addClass('disabled');
- $('.dp-nav-next-month', this.context).addClass('disabled');
- $('.dp-calendar td.other-month', this.context).each(
- function()
- {
- var $this = $(this);
- if (Number($this.text()) < 14) {
- $this.addClass('disabled');
- }
- }
- );
- var d = this.endDate.getDate();
- $('.dp-calendar td.current-month', this.context).each(
- function()
- {
- var $this = $(this);
- if (Number($this.text()) > d) {
- $this.addClass('disabled');
- }
- }
- );
- } else {
- $('.dp-nav-next-year', this.context).removeClass('disabled');
- $('.dp-nav-next-month', this.context).removeClass('disabled');
- var d = this.endDate.getDate();
- if (d < 13) {
- // check if the endDate is next month as we might need to add some disabled classes...
- var ed = new Date(this.endDate.getTime());
- ed.addMonths(-1);
- if (this.displayedYear == ed.getFullYear() && this.displayedMonth == ed.getMonth()) {
- $('.dp-calendar td.other-month', this.context).each(
- function()
- {
- var $this = $(this);
- var cellDay = Number($this.text());
- if (cellDay < 13 && cellDay > d) {
- $this.addClass('disabled');
- }
- }
- );
- }
- }
- }
- this._applyRenderCallbacks();
- },
- _closeCalendar : function(programatic, ele)
- {
- if (!ele || ele == this.ele)
- {
- $(document).unbind('mousedown.datepicker');
- $(document).unbind('keydown.datepicker');
- this._clearCalendar();
- $('#dp-popup a').unbind();
- $('#dp-popup').empty().remove();
- if (!programatic) {
- $(this.ele).trigger('dpClosed', [this.getSelected()]);
- }
- }
- },
- // empties the current dp-calendar div and makes sure that all events are unbound
- // and expandos removed to avoid memory leaks...
- _clearCalendar : function()
- {
- // TODO.
- $('.dp-calendar td', this.context).unbind();
- $('.dp-calendar', this.context).empty();
- }
- }
- );
-
- // static constants
- $.dpConst = {
- SHOW_HEADER_NONE : 0,
- SHOW_HEADER_SHORT : 1,
- SHOW_HEADER_LONG : 2,
- POS_TOP : 0,
- POS_BOTTOM : 1,
- POS_LEFT : 0,
- POS_RIGHT : 1,
- DP_INTERNAL_FOCUS : 'dpInternalFocusTrigger'
- };
- // localisable text
- $.dpText = {
- TEXT_PREV_YEAR : 'Previous year',
- TEXT_PREV_MONTH : 'Previous month',
- TEXT_NEXT_YEAR : 'Next year',
- TEXT_NEXT_MONTH : 'Next month',
- TEXT_CLOSE : 'Close',
- TEXT_CHOOSE_DATE : 'Choose date',
- HEADER_FORMAT : 'mmmm yyyy'
- };
- // version
- $.dpVersion = '$Id: jquery.datePicker.js 102 2010-09-13 14:00:54Z kelvin.luck $';
-
- $.fn.datePicker.defaults = {
- month : undefined,
- year : undefined,
- showHeader : $.dpConst.SHOW_HEADER_SHORT,
- startDate : undefined,
- endDate : undefined,
- inline : false,
- renderCallback : null,
- createButton : true,
- showYearNavigation : true,
- closeOnSelect : true,
- displayClose : false,
- selectMultiple : false,
- numSelectable : Number.MAX_VALUE,
- clickInput : false,
- rememberViewedMonth : true,
- selectWeek : false,
- verticalPosition : $.dpConst.POS_TOP,
- horizontalPosition : $.dpConst.POS_LEFT,
- verticalOffset : 0,
- horizontalOffset : 0,
- hoverClass : 'dp-hover',
- autoFocusNextInput : false
- };
-
- function _getController(ele)
- {
- if (ele._dpId) return $.event._dpCache[ele._dpId];
- return false;
- };
-
- // make it so that no error is thrown if bgIframe plugin isn't included (allows you to use conditional
- // comments to only include bgIframe where it is needed in IE without breaking this plugin).
- if ($.fn.bgIframe == undefined) {
- $.fn.bgIframe = function() {return this; };
- };
-
-
- // clean-up
- $(window)
- .bind('unload', function() {
- var els = $.event._dpCache || [];
- for (var i in els) {
- $(els[i].ele)._dpDestroy();
- }
- });
-
-
-})(jQuery);
\ No newline at end of file
diff --git a/js/jquery-ui-1.11.4.js b/js/jquery-ui-1.11.4.js
new file mode 100644
index 000000000..f24b40b01
--- /dev/null
+++ b/js/jquery-ui-1.11.4.js
@@ -0,0 +1,2383 @@
+/*! jQuery UI - v1.11.4 - 2015-09-01
+* http://jqueryui.com
+* Includes: core.js, datepicker.js
+* Copyright 2015 jQuery Foundation and other contributors; Licensed MIT */
+
+(function( factory ) {
+ if ( typeof define === "function" && define.amd ) {
+
+ // AMD. Register as an anonymous module.
+ define([ "jquery" ], factory );
+ } else {
+
+ // Browser globals
+ factory( jQuery );
+ }
+}(function( $ ) {
+/*!
+ * jQuery UI Core 1.11.4
+ * http://jqueryui.com
+ *
+ * Copyright jQuery Foundation and other contributors
+ * Released under the MIT license.
+ * http://jquery.org/license
+ *
+ * http://api.jqueryui.com/category/ui-core/
+ */
+
+
+// $.ui might exist from components with no dependencies, e.g., $.ui.position
+$.ui = $.ui || {};
+
+$.extend( $.ui, {
+ version: "1.11.4",
+
+ keyCode: {
+ BACKSPACE: 8,
+ COMMA: 188,
+ DELETE: 46,
+ DOWN: 40,
+ END: 35,
+ ENTER: 13,
+ ESCAPE: 27,
+ HOME: 36,
+ LEFT: 37,
+ PAGE_DOWN: 34,
+ PAGE_UP: 33,
+ PERIOD: 190,
+ RIGHT: 39,
+ SPACE: 32,
+ TAB: 9,
+ UP: 38
+ }
+});
+
+// plugins
+$.fn.extend({
+ scrollParent: function( includeHidden ) {
+ var position = this.css( "position" ),
+ excludeStaticParent = position === "absolute",
+ overflowRegex = includeHidden ? /(auto|scroll|hidden)/ : /(auto|scroll)/,
+ scrollParent = this.parents().filter( function() {
+ var parent = $( this );
+ if ( excludeStaticParent && parent.css( "position" ) === "static" ) {
+ return false;
+ }
+ return overflowRegex.test( parent.css( "overflow" ) + parent.css( "overflow-y" ) + parent.css( "overflow-x" ) );
+ }).eq( 0 );
+
+ return position === "fixed" || !scrollParent.length ? $( this[ 0 ].ownerDocument || document ) : scrollParent;
+ },
+
+ uniqueId: (function() {
+ var uuid = 0;
+
+ return function() {
+ return this.each(function() {
+ if ( !this.id ) {
+ this.id = "ui-id-" + ( ++uuid );
+ }
+ });
+ };
+ })(),
+
+ removeUniqueId: function() {
+ return this.each(function() {
+ if ( /^ui-id-\d+$/.test( this.id ) ) {
+ $( this ).removeAttr( "id" );
+ }
+ });
+ }
+});
+
+// selectors
+function focusable( element, isTabIndexNotNaN ) {
+ var map, mapName, img,
+ nodeName = element.nodeName.toLowerCase();
+ if ( "area" === nodeName ) {
+ map = element.parentNode;
+ mapName = map.name;
+ if ( !element.href || !mapName || map.nodeName.toLowerCase() !== "map" ) {
+ return false;
+ }
+ img = $( "img[usemap='#" + mapName + "']" )[ 0 ];
+ return !!img && visible( img );
+ }
+ return ( /^(input|select|textarea|button|object)$/.test( nodeName ) ?
+ !element.disabled :
+ "a" === nodeName ?
+ element.href || isTabIndexNotNaN :
+ isTabIndexNotNaN) &&
+ // the element and all of its ancestors must be visible
+ visible( element );
+}
+
+function visible( element ) {
+ return $.expr.filters.visible( element ) &&
+ !$( element ).parents().addBack().filter(function() {
+ return $.css( this, "visibility" ) === "hidden";
+ }).length;
+}
+
+$.extend( $.expr[ ":" ], {
+ data: $.expr.createPseudo ?
+ $.expr.createPseudo(function( dataName ) {
+ return function( elem ) {
+ return !!$.data( elem, dataName );
+ };
+ }) :
+ // support: jQuery <1.8
+ function( elem, i, match ) {
+ return !!$.data( elem, match[ 3 ] );
+ },
+
+ focusable: function( element ) {
+ return focusable( element, !isNaN( $.attr( element, "tabindex" ) ) );
+ },
+
+ tabbable: function( element ) {
+ var tabIndex = $.attr( element, "tabindex" ),
+ isTabIndexNaN = isNaN( tabIndex );
+ return ( isTabIndexNaN || tabIndex >= 0 ) && focusable( element, !isTabIndexNaN );
+ }
+});
+
+// support: jQuery <1.8
+if ( !$( "" ).outerWidth( 1 ).jquery ) {
+ $.each( [ "Width", "Height" ], function( i, name ) {
+ var side = name === "Width" ? [ "Left", "Right" ] : [ "Top", "Bottom" ],
+ type = name.toLowerCase(),
+ orig = {
+ innerWidth: $.fn.innerWidth,
+ innerHeight: $.fn.innerHeight,
+ outerWidth: $.fn.outerWidth,
+ outerHeight: $.fn.outerHeight
+ };
+
+ function reduce( elem, size, border, margin ) {
+ $.each( side, function() {
+ size -= parseFloat( $.css( elem, "padding" + this ) ) || 0;
+ if ( border ) {
+ size -= parseFloat( $.css( elem, "border" + this + "Width" ) ) || 0;
+ }
+ if ( margin ) {
+ size -= parseFloat( $.css( elem, "margin" + this ) ) || 0;
+ }
+ });
+ return size;
+ }
+
+ $.fn[ "inner" + name ] = function( size ) {
+ if ( size === undefined ) {
+ return orig[ "inner" + name ].call( this );
+ }
+
+ return this.each(function() {
+ $( this ).css( type, reduce( this, size ) + "px" );
+ });
+ };
+
+ $.fn[ "outer" + name] = function( size, margin ) {
+ if ( typeof size !== "number" ) {
+ return orig[ "outer" + name ].call( this, size );
+ }
+
+ return this.each(function() {
+ $( this).css( type, reduce( this, size, true, margin ) + "px" );
+ });
+ };
+ });
+}
+
+// support: jQuery <1.8
+if ( !$.fn.addBack ) {
+ $.fn.addBack = function( selector ) {
+ return this.add( selector == null ?
+ this.prevObject : this.prevObject.filter( selector )
+ );
+ };
+}
+
+// support: jQuery 1.6.1, 1.6.2 (http://bugs.jquery.com/ticket/9413)
+if ( $( "" ).data( "a-b", "a" ).removeData( "a-b" ).data( "a-b" ) ) {
+ $.fn.removeData = (function( removeData ) {
+ return function( key ) {
+ if ( arguments.length ) {
+ return removeData.call( this, $.camelCase( key ) );
+ } else {
+ return removeData.call( this );
+ }
+ };
+ })( $.fn.removeData );
+}
+
+// deprecated
+$.ui.ie = !!/msie [\w.]+/.exec( navigator.userAgent.toLowerCase() );
+
+$.fn.extend({
+ focus: (function( orig ) {
+ return function( delay, fn ) {
+ return typeof delay === "number" ?
+ this.each(function() {
+ var elem = this;
+ setTimeout(function() {
+ $( elem ).focus();
+ if ( fn ) {
+ fn.call( elem );
+ }
+ }, delay );
+ }) :
+ orig.apply( this, arguments );
+ };
+ })( $.fn.focus ),
+
+ disableSelection: (function() {
+ var eventType = "onselectstart" in document.createElement( "div" ) ?
+ "selectstart" :
+ "mousedown";
+
+ return function() {
+ return this.bind( eventType + ".ui-disableSelection", function( event ) {
+ event.preventDefault();
+ });
+ };
+ })(),
+
+ enableSelection: function() {
+ return this.unbind( ".ui-disableSelection" );
+ },
+
+ zIndex: function( zIndex ) {
+ if ( zIndex !== undefined ) {
+ return this.css( "zIndex", zIndex );
+ }
+
+ if ( this.length ) {
+ var elem = $( this[ 0 ] ), position, value;
+ while ( elem.length && elem[ 0 ] !== document ) {
+ // 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
+ position = elem.css( "position" );
+ if ( position === "absolute" || position === "relative" || position === "fixed" ) {
+ // 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
+ //