<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE xsl:stylesheet[
	<!ENTITY nbsp "&#xa0;">
]><xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:egonp="http://schemas.gov.sk/form/00326615.A9999999.000000404.ElektronickeRozhodnutie/1.14" exclude-result-prefixes="egonp"><xsl:output method="html" doctype-system="http://www.w3.org/TR/html4/strict.dtd" doctype-public="-//W3C//DTD HTML 4.01//EN" indent="no" omit-xml-declaration="yes" /><xsl:template match="/"><html><head><meta http-equiv="X-UA-Compatible" content="IE=edge" /><title>Elektronické rozhodnutie</title><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><meta name="language" content="sk-SK" /><!--<link href="https://www.slovensko.sk/static/eForm/Designer/2.0.1.18/Styles/jquery-ui.css" rel="stylesheet" type="text/css"/>--><style type="text/css">
							/*
							* jQuery UI CSS Framework 1.8.14
							*
							* Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
							* Dual licensed under the MIT or GPL Version 2 licenses.
							* http://jquery.org/license
							*
							* http://docs.jquery.com/UI/Theming/API
							*/
							/* Layout helpers
							----------------------------------*/
							.ui-helper-hidden { display: none; }
							.ui-helper-hidden-accessible {
							clip: rect(1px 1px 1px 1px);
							clip: rect(1px 1px 1px 1px);
							position: absolute !important;
							}
							.ui-helper-reset {
							border: 0;
							font-size: 100%;
							line-height: 1.3;
							list-style: none;
							margin: 0;
							outline: 0;
							padding: 0;
							text-decoration: none;
							}
							.ui-helper-clearfix:after {
							clear: both;
							content: ".";
							display: block;
							height: 0;
							visibility: hidden;
							}
							.ui-helper-clearfix { display: inline-block; }
							/* required comment for clearfix to work in Opera \*/
							* html .ui-helper-clearfix { height: 1%; }
							.ui-helper-clearfix { display: block; }
							/* end clearfix */
							.ui-helper-zfix {
							filter: Alpha(Opacity=0);
							height: 100%;
							left: 0;
							opacity: 0;
							position: absolute;
							top: 0;
							width: 100%;
							}
							/* Interaction Cues
							----------------------------------*/
							.ui-state-disabled { cursor: default !important; }
							/* Icons
							----------------------------------*/
							/* states and Images */
							.ui-icon {
							background-repeat: no-repeat;
							display: block;
							overflow: hidden;
							text-indent: -99999px;
							}
							/* Misc visuals
							----------------------------------*/
							/* Overlays */
							.ui-widget-overlay {
							height: 100%;
							left: 0;
							position: absolute;
							top: 0;
							width: 100%;
							}
							/*
							* jQuery UI Accordion 1.8.14
							*
							* Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
							* Dual licensed under the MIT or GPL Version 2 licenses.
							* http://jquery.org/license
							*
							* http://docs.jquery.com/UI/Accordion#theming
							*/
							/* IE/Win - Fix animation bug - #4615 */
							.ui-accordion { width: 100%; }
							.ui-accordion .ui-accordion-header {
							cursor: pointer;
							margin-top: 1px;
							position: relative;
							zoom: 1;
							}
							.ui-accordion .ui-accordion-li-fix { display: inline; }
							.ui-accordion .ui-accordion-header-active { border-bottom: 0 !important; }
							.ui-accordion .ui-accordion-header a {
							display: block;
							font-size: 1em;
							padding: .5em .5em .5em .7em;
							}
							.ui-accordion-icons .ui-accordion-header a { padding-left: 2.2em; }
							.ui-accordion .ui-accordion-header .ui-icon {
							left: .5em;
							margin-top: -8px;
							position: absolute;
							top: 50%;
							}
							.ui-accordion .ui-accordion-content {
							border-top: 0;
							display: none;
							margin-bottom: 2px;
							margin-top: -2px;
							overflow: auto;
							padding: 1em 2.2em;
							position: relative;
							top: 1px;
							zoom: 1;
							}
							.ui-accordion .ui-accordion-content-active { display: block; }
							/*
							* jQuery UI Autocomplete 1.8.14
							*
							* Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
							* Dual licensed under the MIT or GPL Version 2 licenses.
							* http://jquery.org/license
							*
							* http://docs.jquery.com/UI/Autocomplete#theming
							*/
							.ui-autocomplete {
							cursor: default;
							position: absolute;
							}
							/* workarounds */
							* html .ui-autocomplete { width: 1px; } /* without this, the menu expands to 100% in IE6 */
							/*
							* jQuery UI Menu 1.8.14
							*
							* Copyright 2010, AUTHORS.txt (http://jqueryui.com/about)
							* Dual licensed under the MIT or GPL Version 2 licenses.
							* http://jquery.org/license
							*
							* http://docs.jquery.com/UI/Menu#theming
							*/
							.ui-menu {
							display: block;
							float: left;
							list-style: none;
							margin: 0;
							padding: 2px;
							}
							.ui-menu .ui-menu { margin-top: -3px; }
							.ui-menu .ui-menu-item {
							clear: left;
							float: left;
							margin: 0;
							padding: 0;
							width: 100%;
							zoom: 1;
							}
							.ui-menu .ui-menu-item a {
							display: block;
							line-height: 1.5;
							padding: .2em .4em;
							text-decoration: none;
							zoom: 1;
							}
							.ui-menu .ui-menu-item a.ui-state-hover,
							.ui-menu .ui-menu-item a.ui-state-active {
							font-weight: normal;
							margin: -1px;
							}
							/*
							* jQuery UI Button 1.8.14
							*
							* Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
							* Dual licensed under the MIT or GPL Version 2 licenses.
							* http://jquery.org/license
							*
							* http://docs.jquery.com/UI/Button#theming
							*/
							.ui-button {
							cursor: pointer;
							display: inline-block;
							margin-right: .1em;
							overflow: visible;
							padding: 0;
							position: relative;
							text-align: center;
							text-decoration: none !important;
							zoom: 1;
							} /* the overflow property removes extra width in IE */
							.ui-button-icon-only { width: 2.2em; } /* to make room for the icon, a width needs to be set here */
							button.ui-button-icon-only { width: 2.4em; } /* button elements seem to need a little more width */
							.ui-button-icons-only { width: 3.4em; }
							button.ui-button-icons-only { width: 3.7em; }
							/*button text element */
							.ui-button .ui-button-text {
							display: block;
							line-height: 1.4;
							}
							.ui-button-text-only .ui-button-text { padding: .4em 1em; }
							.ui-button-icon-only .ui-button-text, .ui-button-icons-only .ui-button-text {
							padding: .4em;
							text-indent: -9999999px;
							}
							.ui-button-text-icon-primary .ui-button-text, .ui-button-text-icons .ui-button-text { padding: .4em 1em .4em 2.1em; }
							.ui-button-text-icon-secondary .ui-button-text, .ui-button-text-icons .ui-button-text { padding: .4em 2.1em .4em 1em; }
							.ui-button-text-icons .ui-button-text {
							padding-left: 2.1em;
							padding-right: 2.1em;
							}
							/* no icon support for input elements, provide padding by default */
							input.ui-button { padding: .4em 1em; }
							/*button icon element(s) */
							.ui-button-icon-only .ui-icon, .ui-button-text-icon-primary .ui-icon, .ui-button-text-icon-secondary .ui-icon, .ui-button-text-icons .ui-icon, .ui-button-icons-only .ui-icon {
							margin-top: -8px;
							position: absolute;
							top: 50%;
							}
							.ui-button-icon-only .ui-icon {
							left: 50%;
							margin-left: -8px;
							}
							.ui-button-text-icon-primary .ui-button-icon-primary, .ui-button-text-icons .ui-button-icon-primary, .ui-button-icons-only .ui-button-icon-primary { left: .5em; }
							.ui-button-text-icon-secondary .ui-button-icon-secondary, .ui-button-text-icons .ui-button-icon-secondary, .ui-button-icons-only .ui-button-icon-secondary { right: .5em; }
							.ui-button-text-icons .ui-button-icon-secondary, .ui-button-icons-only .ui-button-icon-secondary { right: .5em; }
							/*button sets*/
							.ui-buttonset { margin-right: 7px; }
							.ui-buttonset .ui-button {
							margin-left: 0;
							margin-right: -.3em;
							}
							/* workarounds */
							button.ui-button::-moz-focus-inner {
							border: 0;
							padding: 0;
							} /* reset extra padding in Firefox */
							/*
							* jQuery UI Datepicker 1.8.14
							*
							* Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
							* Dual licensed under the MIT or GPL Version 2 licenses.
							* http://jquery.org/license
							*
							* http://docs.jquery.com/UI/Datepicker#theming
							*/
							.ui-datepicker {
							display: none;
							padding: .2em .2em 0;
							width: 17em;
							}
							.ui-datepicker .ui-datepicker-header {
							padding: .2em 0;
							position: relative;
							}
							.ui-datepicker .ui-datepicker-prev, .ui-datepicker .ui-datepicker-next {
							height: 1.8em;
							position: absolute;
							top: 2px;
							width: 1.8em;
							}
							.ui-datepicker .ui-datepicker-prev-hover, .ui-datepicker .ui-datepicker-next-hover { top: 1px; }
							.ui-datepicker .ui-datepicker-prev { left: 2px; }
							.ui-datepicker .ui-datepicker-next { right: 2px; }
							.ui-datepicker .ui-datepicker-prev-hover { left: 1px; }
							.ui-datepicker .ui-datepicker-next-hover { right: 1px; }
							.ui-datepicker .ui-datepicker-prev span, .ui-datepicker .ui-datepicker-next span {
							display: block;
							left: 50%;
							margin-left: -8px;
							margin-top: -8px;
							position: absolute;
							top: 50%;
							}
							.ui-datepicker .ui-datepicker-title {
							line-height: 1.8em;
							margin: 0 2.3em;
							text-align: center;
							}
							.ui-datepicker .ui-datepicker-title select {
							font-size: 1em;
							margin: 1px 0;
							}
							.ui-datepicker select.ui-datepicker-month-year { width: 100%; }
							.ui-datepicker select.ui-datepicker-month,
							.ui-datepicker select.ui-datepicker-year { width: 49%; }
							.ui-datepicker table {
							border-collapse: collapse;
							font-size: .9em;
							margin: 0 0 .4em;
							width: 100%;
							}
							.ui-datepicker th {
							border: 0;
							font-weight: bold;
							padding: .7em .3em;
							text-align: center;
							}
							.ui-datepicker td {
							border: 0;
							padding: 1px;
							}
							.ui-datepicker td span, .ui-datepicker td a {
							display: block;
							padding: .2em;
							text-align: right;
							text-decoration: none;
							}
							.ui-datepicker .ui-datepicker-buttonpane {
							background-image: none;
							border-bottom: 0;
							border-left: 0;
							border-right: 0;
							margin: .7em 0 0 0;
							padding: 0 .2em;
							}
							.ui-datepicker .ui-datepicker-buttonpane button {
							cursor: pointer;
							float: right;
							margin: .5em .2em .4em;
							overflow: visible;
							padding: .2em .6em .3em .6em;
							width: auto;
							}
							.ui-datepicker .ui-datepicker-buttonpane button.ui-datepicker-current { float: left; }
							/* with multiple calendars */
							.ui-datepicker.ui-datepicker-multi { width: auto; }
							.ui-datepicker-multi .ui-datepicker-group { float: left; }
							.ui-datepicker-multi .ui-datepicker-group table {
							margin: 0 auto .4em;
							width: 95%;
							}
							.ui-datepicker-multi-2 .ui-datepicker-group { width: 50%; }
							.ui-datepicker-multi-3 .ui-datepicker-group { width: 33.3%; }
							.ui-datepicker-multi-4 .ui-datepicker-group { width: 25%; }
							.ui-datepicker-multi .ui-datepicker-group-last .ui-datepicker-header { border-left-width: 0; }
							.ui-datepicker-multi .ui-datepicker-group-middle .ui-datepicker-header { border-left-width: 0; }
							.ui-datepicker-multi .ui-datepicker-buttonpane { clear: left; }
							.ui-datepicker-row-break {
							clear: both;
							font-size: 0em;
							width: 100%;
							}
							/* RTL support */
							.ui-datepicker-rtl { direction: rtl; }
							.ui-datepicker-rtl .ui-datepicker-prev {
							left: auto;
							right: 2px;
							}
							.ui-datepicker-rtl .ui-datepicker-next {
							left: 2px;
							right: auto;
							}
							.ui-datepicker-rtl .ui-datepicker-prev:hover {
							left: auto;
							right: 1px;
							}
							.ui-datepicker-rtl .ui-datepicker-next:hover {
							left: 1px;
							right: auto;
							}
							.ui-datepicker-rtl .ui-datepicker-buttonpane { clear: right; }
							.ui-datepicker-rtl .ui-datepicker-buttonpane button { float: left; }
							.ui-datepicker-rtl .ui-datepicker-buttonpane button.ui-datepicker-current { float: right; }
							.ui-datepicker-rtl .ui-datepicker-group { float: right; }
							.ui-datepicker-rtl .ui-datepicker-group-last .ui-datepicker-header {
							border-left-width: 1px;
							border-right-width: 0;
							}
							.ui-datepicker-rtl .ui-datepicker-group-middle .ui-datepicker-header {
							border-left-width: 1px;
							border-right-width: 0;
							}
							/* IE6 IFRAME FIX (taken from datepicker 1.5.3 */
							.ui-datepicker-cover {
							display: none; /*sorry for IE5*/
							display/**/: block; /*sorry for IE5*/
							filter: mask(); /*must have*/
							height: 200px; /*must have*/
							left: -4px; /*must have*/
							position: absolute; /*must have*/
							top: -4px; /*must have*/
							width: 200px; /*must have*/
							z-index: -1; /*must have*/
							}/*
							* jQuery UI Dialog 1.8.14
							*
							* Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
							* Dual licensed under the MIT or GPL Version 2 licenses.
							* http://jquery.org/license
							*
							* http://docs.jquery.com/UI/Dialog#theming
							*/
							.ui-dialog {
							overflow: hidden;
							padding: .2em;
							position: absolute;
							width: 300px;
							}
							.ui-dialog .ui-dialog-titlebar {
							padding: .4em 1em;
							position: relative;
							}
							.ui-dialog .ui-dialog-title {
							float: left;
							margin: .1em 16px .1em 0;
							}
							.ui-dialog .ui-dialog-titlebar-close {
							height: 18px;
							margin: -10px 0 0 0;
							padding: 1px;
							position: absolute;
							right: .3em;
							top: 50%;
							width: 19px;
							}
							.ui-dialog .ui-dialog-titlebar-close span {
							display: block;
							/*margin: 1px;*/
							}
							.ui-dialog .ui-dialog-titlebar-close:hover, .ui-dialog .ui-dialog-titlebar-close:focus { padding: 0; }
							.ui-dialog .ui-dialog-content {
							background: none;
							border: 0;
							overflow: auto;
							padding: .5em 1em;
							position: relative;
							zoom: 1;
							}
							.ui-dialog .ui-dialog-buttonpane {
							background-image: none;
							border-width: 1px 0 0 0;
							margin: .5em 0 0 0;
							padding: .3em 1em .5em .4em;
							text-align: left;
							}
							.ui-dialog .ui-dialog-buttonpane .ui-dialog-buttonset { float: right; }
							.ui-dialog .ui-dialog-buttonpane button {
							cursor: pointer;
							margin: .5em .4em .5em 0;
							}
							.ui-dialog .ui-resizable-se {
							bottom: 3px;
							height: 14px;
							right: 3px;
							width: 14px;
							}
							.ui-draggable .ui-dialog-titlebar { cursor: move; }
							/*
							* jQuery UI Progressbar 1.8.14
							*
							* Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
							* Dual licensed under the MIT or GPL Version 2 licenses.
							* http://jquery.org/license
							*
							* http://docs.jquery.com/UI/Progressbar#theming
							*/
							.ui-progressbar {
							height: 2em;
							text-align: left;
							}
							.ui-progressbar .ui-progressbar-value {
							height: 100%;
							margin: -1px;
							}/*
							* jQuery UI Resizable 1.8.14
							*
							* Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
							* Dual licensed under the MIT or GPL Version 2 licenses.
							* http://jquery.org/license
							*
							* http://docs.jquery.com/UI/Resizable#theming
							*/
							.ui-resizable { position: relative; }
							.ui-resizable-handle {
							display: block;
							font-size: 0.1px;
							position: absolute;
							z-index: 99999;
							}
							.ui-resizable-disabled .ui-resizable-handle, .ui-resizable-autohide .ui-resizable-handle { display: none; }
							.ui-resizable-n {
							cursor: n-resize;
							height: 7px;
							left: 0;
							top: -5px;
							width: 100%;
							}
							.ui-resizable-s {
							bottom: -5px;
							cursor: s-resize;
							height: 7px;
							left: 0;
							width: 100%;
							}
							.ui-resizable-e {
							cursor: e-resize;
							height: 100%;
							right: -5px;
							top: 0;
							width: 7px;
							}
							.ui-resizable-w {
							cursor: w-resize;
							height: 100%;
							left: -5px;
							top: 0;
							width: 7px;
							}
							.ui-resizable-se {
							bottom: 1px;
							cursor: se-resize;
							height: 12px;
							right: 1px;
							width: 12px;
							}
							.ui-resizable-sw {
							bottom: -5px;
							cursor: sw-resize;
							height: 9px;
							left: -5px;
							width: 9px;
							}
							.ui-resizable-nw {
							cursor: nw-resize;
							height: 9px;
							left: -5px;
							top: -5px;
							width: 9px;
							}
							.ui-resizable-ne {
							cursor: ne-resize;
							height: 9px;
							right: -5px;
							top: -5px;
							width: 9px;
							}/*
							* jQuery UI Selectable 1.8.14
							*
							* Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
							* Dual licensed under the MIT or GPL Version 2 licenses.
							* http://jquery.org/license
							*
							* http://docs.jquery.com/UI/Selectable#theming
							*/
							.ui-selectable-helper {
							border: 1px dotted black;
							position: absolute;
							z-index: 100;
							}
							/*
							* jQuery UI Slider 1.8.14
							*
							* Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
							* Dual licensed under the MIT or GPL Version 2 licenses.
							* http://jquery.org/license
							*
							* http://docs.jquery.com/UI/Slider#theming
							*/
							.ui-slider {
							position: relative;
							text-align: left;
							}
							.ui-slider .ui-slider-handle {
							cursor: default;
							height: 1.2em;
							position: absolute;
							width: 1.2em;
							z-index: 2;
							}
							.ui-slider .ui-slider-range {
							background-position: 0 0;
							border: 0;
							display: block;
							font-size: .7em;
							position: absolute;
							z-index: 1;
							}
							.ui-slider-horizontal { height: .8em; }
							.ui-slider-horizontal .ui-slider-handle {
							margin-left: -.6em;
							top: -.3em;
							}
							.ui-slider-horizontal .ui-slider-range {
							height: 100%;
							top: 0;
							}
							.ui-slider-horizontal .ui-slider-range-min { left: 0; }
							.ui-slider-horizontal .ui-slider-range-max { right: 0; }
							.ui-slider-vertical {
							height: 100px;
							width: .8em;
							}
							.ui-slider-vertical .ui-slider-handle {
							left: -.3em;
							margin-bottom: -.6em;
							margin-left: 0;
							}
							.ui-slider-vertical .ui-slider-range {
							left: 0;
							width: 100%;
							}
							.ui-slider-vertical .ui-slider-range-min { bottom: 0; }
							.ui-slider-vertical .ui-slider-range-max { top: 0; }/*
							* jQuery UI Tabs 1.8.14
							*
							* Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
							* Dual licensed under the MIT or GPL Version 2 licenses.
							* http://jquery.org/license
							*
							* http://docs.jquery.com/UI/Tabs#theming
							*/
							.ui-tabs {
							padding: .2em;
							position: relative;
							zoom: 1;
							} /* position: relative prevents IE scroll bug (element with position: relative inside container with overflow: auto appear as "fixed") */
							.ui-tabs .ui-tabs-nav {
							margin: 0;
							padding: .2em .2em 0;
							}
							.ui-tabs .ui-tabs-nav li {
							border-bottom: 0 !important;
							float: left;
							list-style: none;
							margin: 0 .2em 1px 0;
							padding: 0;
							position: relative;
							top: 1px;
							white-space: nowrap;
							}
							.ui-tabs .ui-tabs-nav li a {
							float: left;
							padding: .5em 1em;
							text-decoration: none;
							}
							.ui-tabs .ui-tabs-nav li.ui-tabs-selected {
							margin-bottom: 0;
							padding-bottom: 1px;
							}
							.ui-tabs .ui-tabs-nav li.ui-tabs-selected a, .ui-tabs .ui-tabs-nav li.ui-state-disabled a, .ui-tabs .ui-tabs-nav li.ui-state-processing a { cursor: text; }
							.ui-tabs .ui-tabs-nav li a, .ui-tabs.ui-tabs-collapsible .ui-tabs-nav li.ui-tabs-selected a { cursor: pointer; } /* first selector in group seems obsolete, but required to overcome bug in Opera applying cursor: text overall if defined elsewhere... */
							.ui-tabs .ui-tabs-panel {
							background: none;
							border-width: 0;
							display: block;
							padding: 1em 1.4em;
							}
							.ui-tabs .ui-tabs-hide { display: none !important; }
							/*
							* jQuery UI CSS Framework 1.8.14
							*
							* Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
							* Dual licensed under the MIT or GPL Version 2 licenses.
							* http://jquery.org/license
							*
							* http://docs.jquery.com/UI/Theming/API
							*
							* To view and modify this theme, visit http://jqueryui.com/themeroller/
							*/
							/* Component containers
							----------------------------------*/
							.ui-widget {
							font-family: Verdana, Arial, sans-serif/*{ffDefault}*/;
							font-size: 1.1em/*{fsDefault}*/;
							}
							.ui-widget .ui-widget { font-size: 1em; }
							.ui-widget input, .ui-widget select, .ui-widget textarea, .ui-widget button {
							font-family: Verdana, Arial, sans-serif/*{ffDefault}*/;
							font-size: 1em;
							}
							.ui-widget-content {
							background: #ffffff /*{bgColorContent}*/ /*url(../Images/ui-bg_flat_75_ffffff_40x100.png)*/ /*{bgImgUrlContent}*/ 50% /*{bgContentXPos}*/ 50% /*{bgContentYPos}*/ repeat-x/*{bgContentRepeat}*/;
							border: 1px solid #aaaaaa/*{borderColorContent}*/;
							color: #222222/*{fcContent}*/;
							}
							.ui-widget-content a { color: #222222/*{fcContent}*/; }
							.ui-widget-header {
							background: #cccccc /*{bgColorHeader}*/ /*url(../Images/ui-bg_highlight-soft_75_cccccc_1x100.png)*/ /*{bgImgUrlHeader}*/ 50% /*{bgHeaderXPos}*/ 50% /*{bgHeaderYPos}*/ repeat-x/*{bgHeaderRepeat}*/;
							border: 1px solid #aaaaaa/*{borderColorHeader}*/;
							color: #222222/*{fcHeader}*/;
							font-weight: bold;
							}
							.ui-widget-header a { color: #222222/*{fcHeader}*/; }
							/* Interaction states
							----------------------------------*/
							.ui-state-default, .ui-widget-content .ui-state-default, .ui-widget-header .ui-state-default {
							background: #e6e6e6 /*{bgColorDefault}*/ /*url(../Images/ui-bg_glass_75_e6e6e6_1x400.png)*/ /*{bgImgUrlDefault}*/ 50% /*{bgDefaultXPos}*/ 50% /*{bgDefaultYPos}*/ repeat-x/*{bgDefaultRepeat}*/;
							border: 1px solid #d3d3d3/*{borderColorDefault}*/;
							color: #555555/*{fcDefault}*/;
							font-weight: normal/*{fwDefault}*/;
							}
							.ui-state-default a, .ui-state-default a:link, .ui-state-default a:visited {
							color: #555555/*{fcDefault}*/;
							text-decoration: none;
							}
							.ui-state-hover, .ui-widget-content .ui-state-hover, .ui-widget-header .ui-state-hover, .ui-state-focus, .ui-widget-content .ui-state-focus, .ui-widget-header .ui-state-focus {
							background: #dadada /*{bgColorHover}*/ /*url(../Images/ui-bg_glass_75_dadada_1x400.png)*/ /*{bgImgUrlHover}*/ 50% /*{bgHoverXPos}*/ 50% /*{bgHoverYPos}*/ repeat-x/*{bgHoverRepeat}*/;
							border: 1px solid #999999/*{borderColorHover}*/;
							color: #212121/*{fcHover}*/;
							font-weight: normal/*{fwDefault}*/;
							}
							.ui-state-hover a, .ui-state-hover a:hover {
							color: #212121/*{fcHover}*/;
							text-decoration: none;
							}
							.ui-state-active, .ui-widget-content .ui-state-active, .ui-widget-header .ui-state-active {
							background: #ffffff /*{bgColorActive}*/ /*url(../Images/ui-bg_glass_65_ffffff_1x400.png)*/ /*{bgImgUrlActive}*/ 50% /*{bgActiveXPos}*/ 50% /*{bgActiveYPos}*/ repeat-x/*{bgActiveRepeat}*/;
							border: 1px solid #aaaaaa/*{borderColorActive}*/;
							color: #212121/*{fcActive}*/;
							font-weight: normal/*{fwDefault}*/;
							}
							.ui-state-active a, .ui-state-active a:link, .ui-state-active a:visited {
							color: #212121/*{fcActive}*/;
							text-decoration: none;
							}
							.ui-widget :active { outline: none; }
							/* Interaction Cues
							----------------------------------*/
							.ui-state-highlight, .ui-widget-content .ui-state-highlight, .ui-widget-header .ui-state-highlight {
							background: #fbf9ee /*{bgColorHighlight}*/ /*url(../Images/ui-bg_glass_55_fbf9ee_1x400.png)*/ /*{bgImgUrlHighlight}*/ 50% /*{bgHighlightXPos}*/ 50% /*{bgHighlightYPos}*/ repeat-x/*{bgHighlightRepeat}*/;
							border: 1px solid #fcefa1/*{borderColorHighlight}*/;
							color: #363636/*{fcHighlight}*/;
							}
							.ui-state-highlight a, .ui-widget-content .ui-state-highlight a, .ui-widget-header .ui-state-highlight a { color: #363636/*{fcHighlight}*/; }
							.ui-state-error, .ui-widget-content .ui-state-error, .ui-widget-header .ui-state-error {
							background: #fef1ec /*{bgColorError}*/ /*url(../Images/ui-bg_glass_95_fef1ec_1x400.png)*/ /*{bgImgUrlError}*/ 50% /*{bgErrorXPos}*/ 50% /*{bgErrorYPos}*/ repeat-x/*{bgErrorRepeat}*/;
							border: 1px solid #cd0a0a/*{borderColorError}*/;
							color: #cd0a0a/*{fcError}*/;
							}
							.ui-state-error a, .ui-widget-content .ui-state-error a, .ui-widget-header .ui-state-error a { color: #cd0a0a/*{fcError}*/; }
							.ui-state-error-text, .ui-widget-content .ui-state-error-text, .ui-widget-header .ui-state-error-text { color: #cd0a0a/*{fcError}*/; }
							.ui-priority-primary, .ui-widget-content .ui-priority-primary, .ui-widget-header .ui-priority-primary { font-weight: bold; }
							.ui-priority-secondary, .ui-widget-content .ui-priority-secondary, .ui-widget-header .ui-priority-secondary {
							filter: Alpha(Opacity=70);
							font-weight: normal;
							opacity: .7;
							}
							.ui-state-disabled, .ui-widget-content .ui-state-disabled, .ui-widget-header .ui-state-disabled {
							background-image: none;
							filter: Alpha(Opacity=35);
							opacity: .35;
							}
							/* Icons
							----------------------------------*/
							/* states and Images */
							.ui-icon {
							background-image: url(Images/ui-icons_222222_256x240.png)/*{iconsContent}*/;
							height: 16px;
							width: 16px;
							}
							.ui-widget-content .ui-icon { background-image: url(Images/ui-icons_222222_256x240.png)/*{iconsContent}*/; }
							.ui-widget-header .ui-icon { background-image: url(Images/ui-icons_222222_256x240.png)/*{iconsHeader}*/; }
							.ui-state-default .ui-icon { background-image: url(Images/ui-icons_888888_256x240.png)/*{iconsDefault}*/; }
							.ui-state-hover .ui-icon, .ui-state-focus .ui-icon { /*background-image: url(../Images/ui-icons_454545_256x240.png)*//*{iconsHover}*/; }
							.ui-state-active .ui-icon { /*background-image: url(Images/ui-icons_454545_256x240.png)*//*{iconsActive}*/; }
							.ui-state-highlight .ui-icon { /*background-image: url(Images/ui-icons_2e83ff_256x240.png)*//*{iconsHighlight}*/; }
							.ui-state-error .ui-icon, .ui-state-error-text .ui-icon { background-image: url(Images/ui-icons_cd0a0a_256x240.png)/*{iconsError}*/; }
							/* positioning */
							.ui-icon-carat-1-n { background-position: 0 0; }
							.ui-icon-carat-1-ne { background-position: -16px 0; }
							.ui-icon-carat-1-e { background-position: -32px 0; }
							.ui-icon-carat-1-se { background-position: -48px 0; }
							.ui-icon-carat-1-s { background-position: -64px 0; }
							.ui-icon-carat-1-sw { background-position: -80px 0; }
							.ui-icon-carat-1-w { background-position: -96px 0; }
							.ui-icon-carat-1-nw { background-position: -112px 0; }
							.ui-icon-carat-2-n-s { background-position: -128px 0; }
							.ui-icon-carat-2-e-w { background-position: -144px 0; }
							.ui-icon-triangle-1-n { background-position: 0 -16px; }
							.ui-icon-triangle-1-ne { background-position: -16px -16px; }
							.ui-icon-triangle-1-e { background-position: -32px -16px; }
							.ui-icon-triangle-1-se { background-position: -48px -16px; }
							.ui-icon-triangle-1-s { background-position: -64px -16px; }
							.ui-icon-triangle-1-sw { background-position: -80px -16px; }
							.ui-icon-triangle-1-w { background-position: -96px -16px; }
							.ui-icon-triangle-1-nw { background-position: -112px -16px; }
							.ui-icon-triangle-2-n-s { background-position: -128px -16px; }
							.ui-icon-triangle-2-e-w { background-position: -144px -16px; }
							.ui-icon-arrow-1-n { background-position: 0 -32px; }
							.ui-icon-arrow-1-ne { background-position: -16px -32px; }
							.ui-icon-arrow-1-e { background-position: -32px -32px; }
							.ui-icon-arrow-1-se { background-position: -48px -32px; }
							.ui-icon-arrow-1-s { background-position: -64px -32px; }
							.ui-icon-arrow-1-sw { background-position: -80px -32px; }
							.ui-icon-arrow-1-w { background-position: -96px -32px; }
							.ui-icon-arrow-1-nw { background-position: -112px -32px; }
							.ui-icon-arrow-2-n-s { background-position: -128px -32px; }
							.ui-icon-arrow-2-ne-sw { background-position: -144px -32px; }
							.ui-icon-arrow-2-e-w { background-position: -160px -32px; }
							.ui-icon-arrow-2-se-nw { background-position: -176px -32px; }
							.ui-icon-arrowstop-1-n { background-position: -192px -32px; }
							.ui-icon-arrowstop-1-e { background-position: -208px -32px; }
							.ui-icon-arrowstop-1-s { background-position: -224px -32px; }
							.ui-icon-arrowstop-1-w { background-position: -240px -32px; }
							.ui-icon-arrowthick-1-n { background-position: 0 -48px; }
							.ui-icon-arrowthick-1-ne { background-position: -16px -48px; }
							.ui-icon-arrowthick-1-e { background-position: -32px -48px; }
							.ui-icon-arrowthick-1-se { background-position: -48px -48px; }
							.ui-icon-arrowthick-1-s { background-position: -64px -48px; }
							.ui-icon-arrowthick-1-sw { background-position: -80px -48px; }
							.ui-icon-arrowthick-1-w { background-position: -96px -48px; }
							.ui-icon-arrowthick-1-nw { background-position: -112px -48px; }
							.ui-icon-arrowthick-2-n-s { background-position: -128px -48px; }
							.ui-icon-arrowthick-2-ne-sw { background-position: -144px -48px; }
							.ui-icon-arrowthick-2-e-w { background-position: -160px -48px; }
							.ui-icon-arrowthick-2-se-nw { background-position: -176px -48px; }
							.ui-icon-arrowthickstop-1-n { background-position: -192px -48px; }
							.ui-icon-arrowthickstop-1-e { background-position: -208px -48px; }
							.ui-icon-arrowthickstop-1-s { background-position: -224px -48px; }
							.ui-icon-arrowthickstop-1-w { background-position: -240px -48px; }
							.ui-icon-arrowreturnthick-1-w { background-position: 0 -64px; }
							.ui-icon-arrowreturnthick-1-n { background-position: -16px -64px; }
							.ui-icon-arrowreturnthick-1-e { background-position: -32px -64px; }
							.ui-icon-arrowreturnthick-1-s { background-position: -48px -64px; }
							.ui-icon-arrowreturn-1-w { background-position: -64px -64px; }
							.ui-icon-arrowreturn-1-n { background-position: -80px -64px; }
							.ui-icon-arrowreturn-1-e { background-position: -96px -64px; }
							.ui-icon-arrowreturn-1-s { background-position: -112px -64px; }
							.ui-icon-arrowrefresh-1-w { background-position: -128px -64px; }
							.ui-icon-arrowrefresh-1-n { background-position: -144px -64px; }
							.ui-icon-arrowrefresh-1-e { background-position: -160px -64px; }
							.ui-icon-arrowrefresh-1-s { background-position: -176px -64px; }
							.ui-icon-arrow-4 { background-position: 0 -80px; }
							.ui-icon-arrow-4-diag { background-position: -16px -80px; }
							.ui-icon-extlink { background-position: -32px -80px; }
							.ui-icon-newwin { background-position: -48px -80px; }
							.ui-icon-refresh { background-position: -64px -80px; }
							.ui-icon-shuffle { background-position: -80px -80px; }
							.ui-icon-transfer-e-w { background-position: -96px -80px; }
							.ui-icon-transferthick-e-w { background-position: -112px -80px; }
							.ui-icon-folder-collapsed { background-position: 0 -96px; }
							.ui-icon-folder-open { background-position: -16px -96px; }
							.ui-icon-document { background-position: -32px -96px; }
							.ui-icon-document-b { background-position: -48px -96px; }
							.ui-icon-note { background-position: -64px -96px; }
							.ui-icon-mail-closed { background-position: -80px -96px; }
							.ui-icon-mail-open { background-position: -96px -96px; }
							.ui-icon-suitcase { background-position: -112px -96px; }
							.ui-icon-comment { background-position: -128px -96px; }
							.ui-icon-person { background-position: -144px -96px; }
							.ui-icon-print { background-position: -160px -96px; }
							.ui-icon-trash { background-position: -176px -96px; }
							.ui-icon-locked { background-position: -192px -96px; }
							.ui-icon-unlocked { background-position: -208px -96px; }
							.ui-icon-bookmark { background-position: -224px -96px; }
							.ui-icon-tag { background-position: -240px -96px; }
							.ui-icon-home { background-position: 0 -112px; }
							.ui-icon-flag { background-position: -16px -112px; }
							.ui-icon-calendar { background-position: -32px -112px; }
							.ui-icon-cart { background-position: -48px -112px; }
							.ui-icon-pencil { background-position: -64px -112px; }
							.ui-icon-clock { background-position: -80px -112px; }
							.ui-icon-disk { background-position: -96px -112px; }
							.ui-icon-calculator { background-position: -112px -112px; }
							.ui-icon-zoomin { background-position: -128px -112px; }
							.ui-icon-zoomout { background-position: -144px -112px; }
							.ui-icon-search { background-position: -160px -112px; }
							.ui-icon-wrench { background-position: -176px -112px; }
							.ui-icon-gear { background-position: -192px -112px; }
							.ui-icon-heart { background-position: -208px -112px; }
							.ui-icon-star { background-position: -224px -112px; }
							.ui-icon-link { background-position: -240px -112px; }
							.ui-icon-cancel { background-position: 0 -128px; }
							.ui-icon-plus { background-position: -16px -128px; }
							.ui-icon-plusthick { background-position: -32px -128px; }
							.ui-icon-minus { background-position: -48px -128px; }
							.ui-icon-minusthick { background-position: -64px -128px; }
							.ui-icon-close { background-position: -80px -128px; }
							.ui-icon-closethick { background-position: -96px -128px; }
							.ui-icon-key { background-position: -112px -128px; }
							.ui-icon-lightbulb { background-position: -128px -128px; }
							.ui-icon-scissors { background-position: -144px -128px; }
							.ui-icon-clipboard { background-position: -160px -128px; }
							.ui-icon-copy { background-position: -176px -128px; }
							.ui-icon-contact { background-position: -192px -128px; }
							.ui-icon-image { background-position: -208px -128px; }
							.ui-icon-video { background-position: -224px -128px; }
							.ui-icon-script { background-position: -240px -128px; }
							.ui-icon-alert { background-position: 0 -144px; }
							.ui-icon-info { background-position: -16px -144px; }
							.ui-icon-notice { background-position: -32px -144px; }
							.ui-icon-help { background-position: -48px -144px; }
							.ui-icon-check { background-position: -64px -144px; }
							.ui-icon-bullet { background-position: -80px -144px; }
							.ui-icon-radio-off { background-position: -96px -144px; }
							.ui-icon-radio-on { background-position: -112px -144px; }
							.ui-icon-pin-w { background-position: -128px -144px; }
							.ui-icon-pin-s { background-position: -144px -144px; }
							.ui-icon-play { background-position: 0 -160px; }
							.ui-icon-pause { background-position: -16px -160px; }
							.ui-icon-seek-next { background-position: -32px -160px; }
							.ui-icon-seek-prev { background-position: -48px -160px; }
							.ui-icon-seek-end { background-position: -64px -160px; }
							.ui-icon-seek-start { background-position: -80px -160px; }
							/* ui-icon-seek-first is deprecated, use ui-icon-seek-start instead */
							.ui-icon-seek-first { background-position: -80px -160px; }
							.ui-icon-stop { background-position: -96px -160px; }
							.ui-icon-eject { background-position: -112px -160px; }
							.ui-icon-volume-off { background-position: -128px -160px; }
							.ui-icon-volume-on { background-position: -144px -160px; }
							.ui-icon-power { background-position: 0 -176px; }
							.ui-icon-signal-diag { background-position: -16px -176px; }
							.ui-icon-signal { background-position: -32px -176px; }
							.ui-icon-battery-0 { background-position: -48px -176px; }
							.ui-icon-battery-1 { background-position: -64px -176px; }
							.ui-icon-battery-2 { background-position: -80px -176px; }
							.ui-icon-battery-3 { background-position: -96px -176px; }
							.ui-icon-circle-plus { background-position: 0 -192px; }
							.ui-icon-circle-minus { background-position: -16px -192px; }
							.ui-icon-circle-close { background-position: -32px -192px; }
							.ui-icon-circle-triangle-e { background-position: -48px -192px; }
							.ui-icon-circle-triangle-s { background-position: -64px -192px; }
							.ui-icon-circle-triangle-w { background-position: -80px -192px; }
							.ui-icon-circle-triangle-n { background-position: -96px -192px; }
							.ui-icon-circle-arrow-e { background-position: -112px -192px; }
							.ui-icon-circle-arrow-s { background-position: -128px -192px; }
							.ui-icon-circle-arrow-w { background-position: -144px -192px; }
							.ui-icon-circle-arrow-n { background-position: -160px -192px; }
							.ui-icon-circle-zoomin { background-position: -176px -192px; }
							.ui-icon-circle-zoomout { background-position: -192px -192px; }
							.ui-icon-circle-check { background-position: -208px -192px; }
							.ui-icon-circlesmall-plus { background-position: 0 -208px; }
							.ui-icon-circlesmall-minus { background-position: -16px -208px; }
							.ui-icon-circlesmall-close { background-position: -32px -208px; }
							.ui-icon-squaresmall-plus { background-position: -48px -208px; }
							.ui-icon-squaresmall-minus { background-position: -64px -208px; }
							.ui-icon-squaresmall-close { background-position: -80px -208px; }
							.ui-icon-grip-dotted-vertical { background-position: 0 -224px; }
							.ui-icon-grip-dotted-horizontal { background-position: -16px -224px; }
							.ui-icon-grip-solid-vertical { background-position: -32px -224px; }
							.ui-icon-grip-solid-horizontal { background-position: -48px -224px; }
							.ui-icon-gripsmall-diagonal-se { background-position: -64px -224px; }
							.ui-icon-grip-diagonal-se { background-position: -80px -224px; }
							/* Misc visuals
							----------------------------------*/
							/* Corner radius */
							.ui-corner-all, .ui-corner-top, .ui-corner-left, .ui-corner-tl {
							-khtml-border-top-left-radius: 4px/*{cornerRadius}*/;
							-moz-border-radius-topleft: 4px/*{cornerRadius}*/;
							-webkit-border-top-left-radius: 4px/*{cornerRadius}*/;
							border-top-left-radius: 4px/*{cornerRadius}*/;
							}
							.ui-corner-all, .ui-corner-top, .ui-corner-right, .ui-corner-tr {
							-khtml-border-top-right-radius: 4px/*{cornerRadius}*/;
							-moz-border-radius-topright: 4px/*{cornerRadius}*/;
							-webkit-border-top-right-radius: 4px/*{cornerRadius}*/;
							border-top-right-radius: 4px/*{cornerRadius}*/;
							}
							.ui-corner-all, .ui-corner-bottom, .ui-corner-left, .ui-corner-bl {
							-khtml-border-bottom-left-radius: 4px/*{cornerRadius}*/;
							-moz-border-radius-bottomleft: 4px/*{cornerRadius}*/;
							-webkit-border-bottom-left-radius: 4px/*{cornerRadius}*/;
							border-bottom-left-radius: 4px/*{cornerRadius}*/;
							}
							.ui-corner-all, .ui-corner-bottom, .ui-corner-right, .ui-corner-br {
							-khtml-border-bottom-right-radius: 4px/*{cornerRadius}*/;
							-moz-border-radius-bottomright: 4px/*{cornerRadius}*/;
							-webkit-border-bottom-right-radius: 4px/*{cornerRadius}*/;
							border-bottom-right-radius: 4px/*{cornerRadius}*/;
							}
							/* Overlays */
							.ui-widget-overlay {
							background: #aaaaaa /*{bgColorOverlay}*/ /*url(../Images/ui-bg_flat_0_aaaaaa_40x100.png)*/ /*{bgImgUrlOverlay}*/ 50% /*{bgOverlayXPos}*/ 50% /*{bgOverlayYPos}*/ repeat-x/*{bgOverlayRepeat}*/;
							filter: Alpha(Opacity=30)/*{opacityOverlay}*/;
							opacity: .3;
							}
							.ui-widget-shadow {
							-khtml-border-radius: 8px/*{cornerRadiusShadow}*/;
							-moz-border-radius: 8px/*{cornerRadiusShadow}*/;
							-webkit-border-radius: 8px/*{cornerRadiusShadow}*/;
							background: #aaaaaa /*{bgColorShadow}*/ /*url(../Images/ui-bg_flat_0_aaaaaa_40x100.png)*/ /*{bgImgUrlShadow}*/ 50% /*{bgShadowXPos}*/ 50% /*{bgShadowYPos}*/ repeat-x/*{bgShadowRepeat}*/;
							border-radius: 8px/*{cornerRadiusShadow}*/;
							filter: Alpha(Opacity=30)/*{opacityShadow}*/;
							margin: -8px /*{offsetTopShadow}*/ 0 0 -8px/*{offsetLeftShadow}*/;
							opacity: .3;
							padding: 8px/*{thicknessShadow}*/;
							}
						</style><!--<link href="https://www.slovensko.sk/static/eForm/Designer/2.0.1.18/Styles/jquery.multiselect.css" rel="stylesheet" type="text/css"/>--><style type="text/css">
							.ui-multiselect { padding:2px 0 2px 4px; text-align:left }
							.ui-multiselect span.ui-icon { float:right }
							.ui-multiselect-single .ui-multiselect-checkboxes input { position:absolute !important; top: auto !important; left:-9999px; }
							.ui-multiselect-single .ui-multiselect-checkboxes label { padding:5px !important }
							.ui-multiselect-header { margin-bottom:3px; padding:3px 0 3px 4px }
							.ui-multiselect-header ul { font-size:0.9em }
							.ui-multiselect-header ul li { float:left; padding:0 10px 0 0 }
							.ui-multiselect-header a { text-decoration:none }
							.ui-multiselect-header a:hover { text-decoration:underline }
							.ui-multiselect-header span.ui-icon { float:left }
							.ui-multiselect-header li.ui-multiselect-close { float:right; text-align:right; padding-right:0 }
							.ui-multiselect-menu { display:none; padding:3px; position:absolute; z-index:10000; text-align: left }
							.ui-multiselect-checkboxes { position:relative /* fixes bug in IE6/7 */; overflow-y:auto }
							.ui-multiselect-checkboxes label { cursor:default; display:block; border:1px solid transparent; padding:3px 1px }
							.ui-multiselect-checkboxes label input { position:relative; top:1px }
							.ui-multiselect-checkboxes li { clear:both; font-size:0.9em; padding-right:3px }
							.ui-multiselect-checkboxes li.ui-multiselect-optgroup-label { text-align:center; font-weight:bold; border-bottom:1px solid }
							.ui-multiselect-checkboxes li.ui-multiselect-optgroup-label a { display:block; padding:3px; margin:1px 0; text-decoration:none }
							/* remove label borders in IE6 because IE6 does not support transparency */
							* html .ui-multiselect-checkboxes label { border:none }
						</style><!--<link href="https://www.slovensko.sk/static/eForm/Designer/2.0.1.18/Styles/jquery.multiselect.filter.css" rel="stylesheet" type="text/css"/>--><style type="text/css">
							.ui-multiselect-hasfilter ul { position:relative; top:2px }
							.ui-multiselect-filter { float:left; margin-right:10px; font-size:11px }
							.ui-multiselect-filter input { width:100px; font-size:10px; margin-left:5px; height:15px; padding:2px; border:1px solid #292929; -webkit-appearance:textfield; -webkit-box-sizing:content-box; }
						</style><!--<link href="https://www.slovensko.sk/static/eForm/Designer/2.0.1.18/Styles/base.css" rel="stylesheet" type="text/css"/>--><style type="text/css">
							img {
							border: 0;
							}
							p {
							line-height: 1.3em;
							margin: 1.3em 0;
							padding: 0;
							text-align: justify;
							}
							.block {
							display: block;
							}
							a {
							color: #fff;
							text-decoration: none;
							}
							a:hover {
							color: #000;
							text-decoration: underline;
							}
							.menu {
							margin: 10px 0px 0px 180px
							}
							.horizontal_menu {
							padding: 0px 10px 0px 0px;
							}
							.horizontal_menu ul {
							border: 0;
							float: left;
							list-style: none;
							margin: 0;
							padding: 0;
							text-align: left;
							}
							.horizontal_menu ul li {
							border: 0;
							float: left;
							margin: 0;
							padding: 0px 13px 10px 0px;
							}
							.horizontal_menu ul li a {
							float: left;
							font: bold 14px arial;
							margin: 0;
							padding: 10px 0;
							text-decoration: none;
							}
							.horizontal_menu ul li a:link {
							color: #828284;
							}
							.horizontal_menu ul li a:visited {
							color: #828284;
							}
							.horizontal_menu ul li a:hover {
							color: #6bb110;
							}
							.horizontal_menu ul li a.selected {
							color: #004478;
							}
							.vertical_menu {
							float: left;
							height: auto;
							margin: 0px 0px 0px 10px;
							width: 250px;
							}
							.vertical_menu ul {
							border: 0;
							list-style: url(Images/bullet.png) Inside;
							margin: 0;
							padding: 0;
							text-align: left;
							}
							.vertical_menu ul li {
							border: 0;
							margin: 0;
							padding: 5px 0px 0px 0px;
							}
							.vertical_menu ul li a {
							font: normal 13px arial;
							margin: 0;
							padding: 0px 0;
							text-decoration: none;
							}
							.vertical_menu ul li a:link {
							color: #87afcb;
							}
							.vertical_menu ul li a:visited {
							color: #87afcb;
							}
							.vertical_menu ul li.Selected a {
							color: #004478;
							font-weight: bold;
							}
							.vertical_menu ul li a:hover {
							color: #6bb110;
							font-weight: bold;
							}
							.HelpIco {
							padding-right: 5px;
							position: relative;
							top: 4px;
							}
							input[readonly], textarea[readonly], select[readonly]
							{
							color: #000000 !important;
							background-color: #f0f0f0 !important;
							}
							.info {
							background: url(Images/icko.png) no-repeat 0 0;
							width: 19px;
							height: 18px;
							display: inline-block;
							position: relative;
							top: 4px;
							}
							.dialog-modal {
							display: none;
							}
							table.display td {
							cursor: pointer;
							}
						</style><!--<link href="https://www.slovensko.sk/static/eForm/Designer/2.0.1.18/Styles/ego.css" rel="stylesheet" type="text/css"/>--><style type="text/css">
							body {
							background: url(Images/gradient.jpg) top repeat-x;
							background-color: #9bc2da;
							color: #646464;
							font-family: tahoma, helvetica, arial, sans-serif;
							}
							.clear { clear: both; }
							.hidden, .hiddenSection {
							display: none;
							visibility: hidden;
							}
							.layoutMain {
							margin: 0px auto;
							padding: 5px 5px 5px 5px;
							width: 900px;
							}
							.layoutRow { margin-bottom: 5px; }
							.caption { /*width: 100%; border-bottom: solid 1px black;*/ }
							.nocaption > .caption { border: 0px !important; }
							.nocaption > .caption span {
							background: none !important;
							display: none;
							}
							.caption .title { padding-left: 5px; }
							.columns {
							border: none;
							margin: 0px;
							padding: 0px;
							width: 100%;
							}
							.column {
							border: none;
							float: left;
							margin: 0px;
							padding: 0px;
							width: 100%;
							}
							.cell { margin: 5px 0 5px 5px; }
							.textBox { width: 160px; }
							.datepicker, .datepickerISO { width: 160px; }
							.time { width: 160px; }
							.datetime { width: 160px; }
							.daterangepicker { width: 160px; }
							.checkBoxList span { display: block; }
							.radioButtonList span { display: block; }
							.radioButtonList input { width: 10px; }
							.comboBox { width: 166px; }
							.remoteComboBox { width: 166px; }
							.remoteLookup { width: 166px; }
							.lookupConfiguration { display:none; }
							.multiCombobox { width: 166px; }
							.listBox { width: 166px; }
							.button { font-size: 0.55em !important; }
							.hierarchicalTree { width: 166px; }
							.chosentree { width: 166px; }
							.radioButtonLabel, .checkBoxLabel, .optionLabel {
							font-size: 0.75em;
							padding-left: 12px;
							}
							.fieldLabel {
							float: left;
							font-family: arial;
							font-size: 0.75em;
							line-height: 25px;
							margin: 0px 18px 0px 0px;
							padding: 0;
							width: 190px;
							}
							.textArea { font-family: arial;  overflow:auto; }
							/* výnimka pre Firefox */
							@-moz-document url-prefix() { .textArea { font-size: 112%; } }
							.label {
							float: left;
							font-family: arial;
							font-size: 0.75em;
							margin: 0;
							padding: 0;
							}
							.fieldContent {
							float: left;
							font-family: arial;
							font-size: 0.75em;
							margin: 0px;
							padding: 0px;
							vertical-align: top;
							}
							.fieldInfo {
							left: 0px;
							position: relative;
							top: 0px;
							}
							#repetitionCommands {
							margin: 5px;
							padding: 0px;
							}
							.addRemoveSection {
							cursor: pointer;
							font-family: arial;
							font-size: 0.75em;
							}
							.removeSection { display: none; }
							fieldset {
							border: 0;
							margin-top: 5px;
							padding: 0;
							}
							select.text {
							margin-bottom: 12px;
							padding: .4em;
							width: 95%;
							}
							.errorsContainer {
							border: 2px solid red !important;
							display: none;
							font-size: 0.75em;
							margin: 0px auto;
							padding: 5px;
							width: 900px !important;
							}
							.errorsContainer li {
							color: red;
							list-style-type: none;
							padding: 0px;
							}
							.errorsContainer li label { cursor: pointer; }
							input.error[type=text],
							textarea.error {
							border: 1px solid red;
							border-bottom: 6px solid red;
							}
							select.error { border: 1px solid red; }
							input.error[type=radio],
							input.error[type=checkbox] {
							border: 1px solid red;
							outline: 1px solid red;
							}
							input.warning[type=text],
							textarea.warning {
							border: 1px solid orange;
							border-bottom: 6px solid orange;
							}
							select.warning { border: 1px solid orange; }
							input.warning[type=radio],
							input.warning[type=checkbox] {
							border: 1px solid orange;
							outline: 1px solid orange;
							}
							.errorsContainer li label.warning {
							color: #B36F00;
							/*color: orange;*/
							list-style-type: none;
							padding: 0px;
							}
							em {
							color: red;
							font-size: 0.85em;
							font-style: normal;
							line-height: 16px;
							}
							.arrow {
							cursor: pointer;
							position: absolute;
							right: 2px;
							top: 2px;
							}
							.infoIcon { float: left; }
							.tableFilter { padding-bottom: 4px; }
							.tableFilterText {
							margin-right: 4px;
							width: 160px;
							}
							table.display {
							clear: both;
							margin: 0 auto;
							width: 100%;
							}
							table.display tr.even.row_selected td { background-color: #B0BED9; }
							table.display tr.odd.row_selected td { background-color: #9FAFD1; }
							table.display thead th span { float: right; }
							.dataTables_filter { padding: 10px 0 0 8px; }
							.dataTables_info {
							float: left;
							width: 60%;
							}
							.dataTables_paginate {
							float: right;
							text-align: right;
							width: 44px;
							width: 50px;
							}
							/* Main css end */
							/* jquery custom styles start */
							div.ui-datepicker { font-size: 0.83em; }
							.ui-dialog {
							font-size: 0.7em;
							padding: .3em;
							}
							/* jquery custom styles end */
							table.forms { margin: 0px 0px 5px 0px; }
							table.forms th { text-align: left; }
							.textleft { text-align: left; }
							.textcenter { text-align: center; }
							.textAreaOneRow {
							height: 19px;
							width: 806px;
							}
							.statusDialog img {
							display: block;
							margin: 15px auto;
							}
							.statusDialog .statusMessage { font-weight: bold; }
							.noscript {
							color: Red;
							font-weight: bold;
							text-align: center;
							}
							.headercorrection {
							font-size: 0.75em;
							margin: 0px;
							}
							.fieldVisualization {
							font-family: arial;
							font-size: 0.75em;
							margin: 0px;
							padding: 0px;
							}
							.wordwrap {
							white-space: pre-wrap;      /* CSS3 */
							white-space: -moz-pre-wrap; /* Firefox */
							white-space: -pre-wrap;     /* Opera less then 7 */
							white-space: -o-pre-wrap;   /* Opera 7 */
							word-wrap: break-word;      /* IE */
							}
							.date-range-selected > .ui-state-active,
							.date-range-selected > .ui-state-default {
							background: none;
							background-color: lightsteelblue;
							}
							.ui-widget-overlay {
							position: fixed !important;
							}
							.closeButton {
							cursor: pointer;
							}
							.withHeader {
							position: absolute;
							top: 2px;
							right: 15px;
							}
							.noHeader {
							float: right;
							}
							.lookupbutton {
							margin-left :2px;
							}
							.LookupDetailInfo {
							}
							.lookupComponentId {
							}
							.lookupComponentName {
							}
							.fieldId {
							}
							.LookupDetail {
							}
							.LookupDetailInfoText {
							}
							.LookupForm {
							}
							.FilterButton {
							}
						</style><!--<link href="https://www.slovensko.sk/static/eForm/Designer/2.0.1.18/Styles/treeselect.css" rel="stylesheet" type="text/css"/>--><style type="text/css">
							.treewrapper {
							padding:3px;
							margin-top: 2px;
							border: 1px solid #999;
							background-color: #fff;
							}
							.treeselect {
							margin:0;
							padding:0;
							font:90% Arial, Helvetica, sans-serif;
							color:#555;
							line-height:150%;
							text-align:left;
							}
							.treeselect a {
							display: inline-block;
							text-decoration:none;
							color:#057fac;
							}
							.treeselect a:hover{
							text-decoration:none;
							color:#999;
							}
							.treeselect, .treeselect ul, .treeselect .treenode {
							margin:0;
							padding:0;
							list-style:none;
							}
							.treeselect ul {
							display:none;
							}
							.treeselect .treenode {
							line-height: 24px;
							border-top: 1px solid #fff;
							border-left: 1px solid #fff;
							border-right: 1px solid #fff;
							position:relative;
							width:100%;
							}
							.treeselect .treenode ul ul {
							margin: 0 15px 0 15px;
							}
							.treeselect li.even {
							background:#f3f3f3;
							}
							.treeselect li.odd {
							background:#f3f3f3;
							}
							.treeselect .treenode input, .treeselect .treenode .treenode-no-select {
							float:left;
							position:absolute;
							top:3px;
							width:13px;
							height:13px;
							cursor:auto;
							font-size:0;
							}
							.treeselect .treenode span.treeselect-expand {
							float:left;
							position:absolute;
							top:4px;
							width:13px;
							height:13px;
							cursor:auto;
							font-size:0;
							}
							.treeselect .treeselect-select-all {
							font-weight: bold;
							margin-left: 5px;
							}
							.treeselect .treenode span.treeselect-expand, .treeselect .treenode span.treeselect-expand.collapsed {
							background:url(Images/collapsed.gif) no-repeat 0 0;
							}
							.treeselect .treenode span.treeselect-expand.expanded {
							background:url(Images/expanded.gif) no-repeat 0 0;
							}
							.treeselect span.treebusy, .treeselect span.treebusy.treeselect-expand.expanded, .treeselect span.treebusy.treeselect-expand.collapsed  {
							background:url(Images/throbber.gif) no-repeat 0 0;
							width:16px;
							height:10px;
							}
							.treeselect .treenode span.treeselect-expand.treebusy {
							top:5px;
							}
							.treeselect-title {
							display: inline-block;
							margin-right: 10px;
							}
						</style><!--<link href="https://www.slovensko.sk/static/eForm/Designer/2.0.1.18/Styles/chosentree.css" rel="stylesheet" type="text/css"/>--><style type="text/css">
							/* @group Base */
							.chzntree-container {
							font-size: 13px;
							position: relative;
							display: inline-block;
							zoom: 1;
							*display: inline;
							}
							.chzntree-container .chzntree-drop {
							background: #fff;
							border: 1px solid #aaa;
							border-top: 0;
							position: absolute;
							top: 29px;
							left: 0;
							-webkit-box-shadow: 0 4px 5px rgba(0,0,0,.15);
							-moz-box-shadow   : 0 4px 5px rgba(0,0,0,.15);
							-o-box-shadow     : 0 4px 5px rgba(0,0,0,.15);
							box-shadow        : 0 4px 5px rgba(0,0,0,.15);
							z-index: 999;
							}
							/* @end */
							/* @group Single Chosen */
							.chzntree-container-single .chzntree-single {
							background-color: #fff;
							background-image: -webkit-gradient(linear, left bottom, left top, color-stop(0, #eeeeee), color-stop(0.5, white));
							background-image: -webkit-linear-gradient(center bottom, #eeeeee 0%, white 50%);
							background-image: -moz-linear-gradient(center bottom, #eeeeee 0%, white 50%);
							background-image: -o-linear-gradient(top, #eeeeee 0%,#ffffff 50%);
							background-image: -ms-linear-gradient(top, #eeeeee 0%,#ffffff 50%);
							filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#eeeeee', endColorstr='#ffffff',GradientType=0 );
							background-image: linear-gradient(top, #eeeeee 0%,#ffffff 50%);
							-webkit-border-radius: 4px;
							-moz-border-radius   : 4px;
							border-radius        : 4px;
							-moz-background-clip   : padding;
							-webkit-background-clip: padding-box;
							background-clip        : padding-box;
							border: 1px solid #aaa;
							display: block;
							overflow: hidden;
							white-space: nowrap;
							position: relative;
							height: 26px;
							line-height: 26px;
							padding: 0 0 0 8px;
							color: #444;
							text-decoration: none;
							}
							.chzntree-container-single .chzntree-single span {
							margin-right: 26px;
							display: block;
							overflow: hidden;
							white-space: nowrap;
							-o-text-overflow: ellipsis;
							-ms-text-overflow: ellipsis;
							text-overflow: ellipsis;
							}
							.chzntree-container-single .chzntree-single abbr {
							display: block;
							position: absolute;
							right: 26px;
							top: 8px;
							width: 12px;
							height: 13px;
							font-size: 1px;
							background: url(http://harvesthq.github.com/chosen/chosen/chosen-sprite.png) right top no-repeat;
							}
							.chzntree-container-single .chzntree-single abbr:hover {
							background-position: right -11px;
							}
							.chzntree-container-single .chzntree-single div {
							-webkit-border-radius: 0 4px 4px 0;
							-moz-border-radius   : 0 4px 4px 0;
							border-radius        : 0 4px 4px 0;
							-moz-background-clip   : padding;
							-webkit-background-clip: padding-box;
							background-clip        : padding-box;
							background: #ccc;
							background-image: -webkit-gradient(linear, left bottom, left top, color-stop(0, #ccc), color-stop(0.6, #eee));
							background-image: -webkit-linear-gradient(center bottom, #ccc 0%, #eee 60%);
							background-image: -moz-linear-gradient(center bottom, #ccc 0%, #eee 60%);
							background-image: -o-linear-gradient(bottom, #ccc 0%, #eee 60%);
							background-image: -ms-linear-gradient(top, #cccccc 0%,#eeeeee 60%);
							filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#cccccc', endColorstr='#eeeeee',GradientType=0 );
							background-image: linear-gradient(top, #cccccc 0%,#eeeeee 60%);
							border-left: 1px solid #aaa;
							position: absolute;
							right: 0;
							top: 0;
							display: block;
							height: 100%;
							width: 18px;
							}
							.chzntree-container-single .chzntree-single div b {
							background: url('http://harvesthq.github.com/chosen/chosen/chosen-sprite.png') no-repeat 0 1px;
							display: block;
							width: 100%;
							height: 100%;
							}
							.chzntree-container-single .chzntree-search {
							padding: 3px 4px;
							position: relative;
							margin: 0;
							white-space: nowrap;
							z-index: 1010;
							}
							.chzntree-container-single .chzntree-search input[type='text'] {
							background: -webkit-gradient(linear, left bottom, left top, color-stop(0.85, white), color-stop(0.99, #eeeeee));
							background: -22px, -webkit-linear-gradient(center bottom, white 85%, #eeeeee 99%);
							background: -22px, -moz-linear-gradient(center bottom, white 85%, #eeeeee 99%);
							background: -o-linear-gradient(bottom, white 85%, #eeeeee 99%);
							background: -ms-linear-gradient(top, #ffffff 85%,#eeeeee 99%);
							background: linear-gradient(top, #ffffff 85%,#eeeeee 99%);
							margin: 1px 0;
							padding: 4px 20px 4px 5px;
							outline: 0;
							border: 1px solid #aaa;
							font-family: sans-serif;
							font-size: 1.2em;
							line-height: 1.8em;
							box-sizing: border-box;
							-webkit-box-sizing:border-box;
							-moz-box-sizing: border-box;
							width: 100%;
							height: auto;
							}
							.chzntree-container-single .chzntree-search.manualsearch input[type='text'] {
							width: 85%;
							}
							.chzntree-container-single .chzntree-search.manualsearch input.chosentree-search-btn {
							padding: 5px 20px;
							cursor: pointer;
							}
							.chzntree-container-single .chzntree-drop {
							-webkit-border-radius: 0 0 4px 4px;
							-moz-border-radius   : 0 0 4px 4px;
							border-radius        : 0 0 4px 4px;
							-moz-background-clip   : padding;
							-webkit-background-clip: padding-box;
							background-clip        : padding-box;
							}
							/* @end */
							.chzntree-container-single-nosearch .chzntree-search input[type='text'] {
							position: absolute;
							left: -9000px;
							}
							/* @group Multi Chosen */
							.chzntree-container-multi .chzntree-choices {
							background-color: #fff;
							background-image: -webkit-gradient(linear, left bottom, left top, color-stop(0.85, white), color-stop(0.99, #eeeeee));
							background-image: -webkit-linear-gradient(center bottom, white 85%, #eeeeee 99%);
							background-image: -moz-linear-gradient(center bottom, white 85%, #eeeeee 99%);
							background-image: -o-linear-gradient(bottom, white 85%, #eeeeee 99%);
							background-image: -ms-linear-gradient(top, #ffffff 85%,#eeeeee 99%);
							filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#ffffff', endColorstr='#eeeeee',GradientType=0 );
							background-image: linear-gradient(top, #ffffff 85%,#eeeeee 99%);
							border: 1px solid #aaa;
							margin: 0;
							padding: 0;
							cursor: text;
							overflow: hidden;
							height: auto !important;
							height: 1%;
							position: relative;
							}
							.chzntree-container-multi .chzntree-choices li {
							float: left;
							list-style: none;
							}
							.chzntree-container-multi .chzntree-choices .search-field {
							white-space: nowrap;
							margin: 0;
							padding: 0;
							}
							.chzntree-container-multi .chzntree-choices .search-field input[type='text'] {
							color: #666;
							background: transparent !important;
							border: 0 !important;
							padding: 5px;
							margin: 1px 0;
							outline: 0;
							-webkit-box-shadow: none;
							-moz-box-shadow   : none;
							-o-box-shadow     : none;
							box-shadow        : none;
							}
							.chzntree-container-multi .chzntree-choices .search-field .default {
							color: #999;
							}
							.chzntree-container-multi .chzntree-choices .search-choice {
							-webkit-border-radius: 3px;
							-moz-border-radius   : 3px;
							border-radius        : 3px;
							-moz-background-clip   : padding;
							-webkit-background-clip: padding-box;
							background-clip        : padding-box;
							background-color: #e4e4e4;
							background-image: -webkit-gradient(linear, left bottom, left top, color-stop(0, #e4e4e4), color-stop(0.7, #eeeeee));
							background-image: -webkit-linear-gradient(center bottom, #e4e4e4 0%, #eeeeee 70%);
							background-image: -moz-linear-gradient(center bottom, #e4e4e4 0%, #eeeeee 70%);
							background-image: -o-linear-gradient(bottom, #e4e4e4 0%, #eeeeee 70%);
							background-image: -ms-linear-gradient(top, #e4e4e4 0%,#eeeeee 70%);
							filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#e4e4e4', endColorstr='#eeeeee',GradientType=0 );
							background-image: linear-gradient(top, #e4e4e4 0%,#eeeeee 70%);
							color: #333;
							border: 1px solid #b4b4b4;
							line-height: 13px;
							padding: 3px 19px 3px 6px;
							margin: 3px 0 3px 5px;
							position: relative;
							}
							.chzntree-container-multi .chzntree-choices .search-choice span {
							cursor: default;
							}
							.chzntree-container-multi .chzntree-choices .search-choice-focus {
							background: #d4d4d4;
							}
							.chzntree-container-multi .chzntree-choices .search-choice .search-choice-close {
							display: block;
							position: absolute;
							right: 3px;
							top: 5px;
							width: 10px;
							height: 10px;
							font-size: 1px;
							background: url(images/chosen-sprite.png) right top no-repeat;
							}
							.chzntree-container-multi .chzntree-choices .search-choice .search-choice-close:hover {
							background-position: right -11px;
							}
							.chzntree-container-multi .chzntree-choices .search-choice-focus .search-choice-close {
							background-position: right -11px;
							}
							/* @end */
							/* @group Results */
							.chzntree-container .chzntree-results {
							margin: 0 4px 4px 0;
							max-height: 190px;
							padding: 0 0 0 4px;
							position: relative;
							overflow-x: hidden;
							overflow-y: auto;
							}
							.chzntree-container-multi .chzntree-results {
							margin: -1px 0 0;
							padding: 0;
							}
							.chzntree-container .chzntree-results li {
							display: none;
							line-height: 80%;
							padding: 7px 7px 8px;
							margin: 0;
							list-style: none;
							}
							.chzntree-container .chzntree-results .active-result {
							cursor: pointer;
							display: list-item;
							}
							.chzntree-container .chzntree-results .highlighted {
							background: #3875d7;
							color: #fff;
							}
							.chzntree-container .chzntree-results li em {
							background: #feffde;
							font-style: normal;
							}
							.chzntree-container .chzntree-results .highlighted em {
							background: transparent;
							}
							.chzntree-container .chzntree-results .no-results {
							background: #f4f4f4;
							display: list-item;
							}
							.chzntree-container .chzntree-results .group-result {
							cursor: default;
							color: #999;
							font-weight: bold;
							}
							.chzntree-container .chzntree-results .group-option {
							padding-left: 20px;
							}
							.chzntree-container-multi .chzntree-drop .result-selected {
							display: none;
							}
							/* @end */
							/* @group Active  */
							.chzntree-container-active .chzntree-single {
							-webkit-box-shadow: 0 0 5px rgba(0,0,0,.3);
							-moz-box-shadow   : 0 0 5px rgba(0,0,0,.3);
							-o-box-shadow     : 0 0 5px rgba(0,0,0,.3);
							box-shadow        : 0 0 5px rgba(0,0,0,.3);
							border: 1px solid #5897fb;
							}
							.chzntree-container-active .chzntree-single-with-drop {
							border: 1px solid #aaa;
							-webkit-box-shadow: 0 1px 0 #fff inset;
							-moz-box-shadow   : 0 1px 0 #fff inset;
							-o-box-shadow     : 0 1px 0 #fff inset;
							box-shadow        : 0 1px 0 #fff inset;
							background-color: #eee;
							background-image: -webkit-gradient(linear, left bottom, left top, color-stop(0, white), color-stop(0.5, #eeeeee));
							background-image: -webkit-linear-gradient(center bottom, white 0%, #eeeeee 50%);
							background-image: -moz-linear-gradient(center bottom, white 0%, #eeeeee 50%);
							background-image: -o-linear-gradient(bottom, white 0%, #eeeeee 50%);
							background-image: -ms-linear-gradient(top, #ffffff 0%,#eeeeee 50%);
							filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#ffffff', endColorstr='#eeeeee',GradientType=0 );
							background-image: linear-gradient(top, #ffffff 0%,#eeeeee 50%);
							-webkit-border-bottom-left-radius : 0;
							-webkit-border-bottom-right-radius: 0;
							-moz-border-radius-bottomleft : 0;
							-moz-border-radius-bottomright: 0;
							border-bottom-left-radius : 0;
							border-bottom-right-radius: 0;
							}
							.chzntree-container-active .chzntree-single-with-drop div {
							background: transparent;
							border-left: none;
							}
							.chzntree-container-active .chzntree-single-with-drop div b {
							background-position: -18px 1px;
							}
							.chzntree-container-active .chzntree-choices {
							-webkit-box-shadow: 0 0 5px rgba(0,0,0,.3);
							-moz-box-shadow   : 0 0 5px rgba(0,0,0,.3);
							-o-box-shadow     : 0 0 5px rgba(0,0,0,.3);
							box-shadow        : 0 0 5px rgba(0,0,0,.3);
							border: 1px solid #5897fb;
							}
							.chzntree-container-active .chzntree-choices .search-field input[type='text'] {
							color: #111 !important;
							}
							/* @end */
							/* @group Disabled Support */
							.chzntree-disabled {
							cursor: default;
							opacity:0.5 !important;
							}
							.chzntree-disabled .chzntree-single {
							cursor: default;
							}
							.chzntree-disabled .chzntree-choices .search-choice .search-choice-close {
							cursor: default;
							}
							/* @group Right to Left */
							.chzntree-rtl { direction:rtl;text-align: right; }
							.chzntree-rtl .chzntree-single { padding-left: 0; padding-right: 8px; }
							.chzntree-rtl .chzntree-single span { margin-left: 26px; margin-right: 0; }
							.chzntree-rtl .chzntree-single div {
							left: 0; right: auto;
							border-left: none; border-right: 1px solid #aaaaaa;
							-webkit-border-radius: 4px 0 0 4px;
							-moz-border-radius   : 4px 0 0 4px;
							border-radius        : 4px 0 0 4px;
							}
							.chzntree-rtl .chzntree-choices li { float: right; }
							.chzntree-rtl .chzntree-choices .search-choice { padding: 3px 6px 3px 19px; margin: 3px 5px 3px 0; }
							.chzntree-rtl .chzntree-choices .search-choice .search-choice-close { left: 5px; right: auto; background-position: right top;}
							.chzntree-rtl.chzntree-container-single .chzntree-results { margin-left: 4px; margin-right: 0; padding-left: 0; padding-right: 4px; }
							.chzntree-rtl .chzntree-results .group-option { padding-left: 0; padding-right: 20px; }
							.chzntree-rtl.chzntree-container-active .chzntree-single-with-drop div { border-right: none; }
							.chzntree-rtl .chzntree-search input[type='text'] {
							background: url('sites/all/themes/allplayers960/images/chosen-sprite.png') no-repeat -38px -22px, #ffffff;
							background: url('sites/all/themes/allplayers960/images/chosen-sprite.png') no-repeat -38px -22px, -webkit-gradient(linear, left bottom, left top, color-stop(0.85, white), color-stop(0.99, #eeeeee));
							background: url('sites/all/themes/allplayers960/images/chosen-sprite.png') no-repeat -38px -22px, -webkit-linear-gradient(center bottom, white 85%, #eeeeee 99%);
							background: url('sites/all/themes/allplayers960/images/chosen-sprite.png') no-repeat -38px -22px, -moz-linear-gradient(center bottom, white 85%, #eeeeee 99%);
							background: url('sites/all/themes/allplayers960/images/chosen-sprite.png') no-repeat -38px -22px, -o-linear-gradient(bottom, white 85%, #eeeeee 99%);
							background: url('sites/all/themes/allplayers960/images/chosen-sprite.png') no-repeat -38px -22px, -ms-linear-gradient(top, #ffffff 85%,#eeeeee 99%);
							background: url('sites/all/themes/allplayers960/images/chosen-sprite.png') no-repeat -38px -22px, linear-gradient(top, #ffffff 85%,#eeeeee 99%);
							padding: 4px 5px 4px 20px;
							}
							/* @end */
							.chzntree-container {
							width: 100%;
							}
							.chzntree-container-single .chzntree-search {
							padding: 0;
							}
							.chzntree-container-single .chzntree-search input[type='text'].searching {
							background:url(../Images/throbber.gif) no-repeat 99% 12px !important;
							}
							.chzntree-search-results .treeselect-title{
							margin-left: 5px !important;
							}
						</style><!--<link href="https://www.slovensko.sk/static/eForm/Designer/2.0.1.18/Styles/p_upvs.css" rel="stylesheet" type="text/css"/>--><style type="text/css">
							body {
							font-family : 'Open Sans' !important ;
							background : transparent !important ;
							}
							input[readonly="readonly"] {
							background : #f1f1f1;
							}
							input[disabled="disabled"], select[disabled="disabled"], textarea[disabled="disabled"] {
							color: #000000!important;
							background: #f0f0f0 !important;
							}
							.textBox {
							font-family : 'Open Sans';
							width : 160px;
							height : 25px;
							border-radius : 3px;
							background : #ffffff;
							border : #d3d0ce solid 1px;
							color : #222222;
							padding-left : 7px;
							}
							.comboBox, .remoteComboBox {
							width : 166px;
							height : 29px;
							border-radius : 3px;
							background : #ffffff;
							border : #d3d0ce solid 1px;
							color : #222222;
							padding-left : 4px;
							}
							.textArea {
							font-family : 'Open Sans';
							overflow : auto;
							border-radius : 3px;
							background : #ffffff;
							border : #d3d0ce solid 1px;
							color : #222222;
							padding-left : 7px;
							}
							.datepicker, .datepickerISO, .datetime, .time {
							height : 25px;
							font-family : 'Open Sans';
							width : 160px;
							border-radius : 3px;
							background : #ffffff;
							border : #d3d0ce solid 1px;
							color : #222222;
							padding-left : 7px;
							}
							.fieldLabel, .label {
							font-family : 'Open Sans', arial, sans-serif;
							line-height: 34px;
							}
							div.ui-datepicker {
							font-size : 0.83em;
							}
							.ui-widget-content {
							background : 50% 50% repeat-x #ffffff;
							border : #d4d4d4 solid 2px;
							color : #4f4e4e;
							border-radius : 3px;
							}
							.ui-widget-content a, .ui-widget-header a {
							color : #222222;
							}
							.ui-widget-header {
							cursor : pointer;
							font-size : 0.80em;
							color : #494949;
							border : #eae9e8 solid 1px;
							background-color : #eae9e8;
							border-radius : 3px;
							}
							.headercorrection {
							font-size : 1em;
							padding : 6px 2px 6px 5px;
							}
							.ui-state-default, .ui-widget-content .ui-state-default, .ui-widget-header .ui-state-default {
							background : 50% 50% repeat-x #bd0a26;
							border : #bd0a26 solid 1px;
							color : #ffffff;
							font-weight : bold;
							text-transform : uppercase;
							padding : 4px 8px 4px 8px;
							}
							.daterangepickerdiv .ui-state-default {
							padding : 1px 2px 1px 2px !important;
							}
							.daterangepickerdiv .ui-datepicker {
							width : Auto !important;
							height : Auto !important;
							}
							.date-range-selected > .ui-state-active,
							.date-range-selected > .ui-state-default {
							background-color: #EAE9E8 !important;
							}
							.ui-state-hover, .ui-widget-content .ui-state-hover, .ui-widget-header .ui-state-hover, .ui-state-focus, .ui-widget-content .ui-state-focus, .ui-widget-header .ui-state-focus {
							border : #e52241 solid 1px;
							color : #ffffff;
							font-weight : bold;
							}
							.ui-state-hover a, .ui-state-hover a:hover {
							color : #212121;
							text-decoration : none;
							}
							.radioButtonLabel {
							font-size : 0.75em;
							top : -2px;
							position : relative;
							padding-left : 12px;
							}
							.fieldContent input {
							border-radius : 3px;
							}
							.info {
							background : url(Images/info_icon_upvs.png) 0 0 no-repeat;
							width : 19px;
							height : 19px;
							display : inline-block;
							position : relative;
							top : 4px;
							margin-left : 5px;
							}
							.dialog-modal {
							display : none;
							}
							table.display td {
							cursor : pointer;
							}
							.button:hover, .lookupbutton:hover, .ui-slider-handle ui-state-default ui-corner-all ui-state-hover {
							background-color : #e52241 !important ;
							}
							.addRemoveSection span {
							font-size : 1.1em !important ;
							font-family : 'Open Sans', Verdana, Arial, sans-serif;
							}
							.addRemoveSection {
							margin-right: 3px;
							}
							.ui-widget-header button {
							background-color : white !important ;
							}
							.ui-priority-secondary, .ui-widget-content .ui-priority-secondary, .ui-widget-header .ui-priority-secondary {
							opacity : 1;
							}
							.checkBoxList label {
							font-size : 1em;
							font-family : 'Open Sans';
							padding-left : 10px;
							}
							.button {
							line-height : 1.4;
							}
							#showXml, #saveForm, #loadForm, #clearForm, #validateForm, #validateFormWithXsd, #validateFormWithServer, #printForm, #closeForm, #cancelForm,#loadFormXml, #saveToXml {
							font-size: 0.55em !important;
							}
							.optionLabel, .checkBoxLabel {
							top : -2px;
							position : relative;
							}
							.fieldContent {
							margin-top : 2px;
							margin-bottom : 2px;
							min-height: 30px;
							}
							.hyperLink, .crossLink {
							color : #bd0a26 !important ;
							font-family : 'Open Sans';
							}
							input[type="file"] {
							padding : 3px 0 0 3px;
							}
							input[type="button"], input[type="submit"], .lookupbutton {
							padding : 8px 12px 8px 12px !important ;
							font-size : 0.75em !important ;
							}
							.lookupbutton {
							margin-top: -4px;
							}
							.infoIcon {
							background-image : url(images/ui-icons_cd0a0a_256x240.png) !important ;
							}
							#ui-datepicker-div {
							min-width : 20em;
							background : #f9f9f9;
							}
							.ui-timepicker-div .ui-widget-header, .ui-datepicker-header {
							background : #ffffff !important ;
							margin : 2px 2px 2px 2px;
							}
							.ui-datepicker-header .ui-icon {
							background-image : url(images/ui-icons_cd0a0a_256x240.png) !important ;
							}
							dl dt {
							float : left;
							margin : 10px 120px 10px 0;
							}
							dl dd {
							width : 14em !important ;
							margin : 25px 0 10px 70px;
							}
							.ui_tpicker_time_label {
							width : 2em !important ;
							margin-right : 0;
							}
							.ui_tpicker_time {
							border : #eae9e8 solid 1px;
							background : #ffffff;
							width : 4em !important ;
							height : 1.5em;
							padding : 5px 0 5px 10px;
							}
							.ui_tpicker_time_label, .ui_tpicker_time, .ui_tpicker_hour_label, .ui_tpicker_minute_label {
							font-size : 0.85em;
							margin-bottom : 7px;
							}
							a.ui-slider-handle {
							padding : 2px 0 3px 0 !important ;
							margin-top : -4px;
							}
							.ui_tpicker_hour_slider, .ui_tpicker_minute_slider {
							height : 4px;
							background : #c5c5c5;
							border : 0;
							}
							.ui-priority-primary {
							background : #bd0a26 !important ;
							}
							.ui-priority-secondary {
							background : #494949 !important ;
							}
							.ui-priority-secondary, .ui-priority-primary {
							border : 0 !important ;
							padding : 8px 12px 8px 12px !important ;
							font-size : 0.70em !important ;
							}
							table.ui-datepicker-calendar td a {
							background : #ffffff !important ;
							color : #bd0a26 !important ;
							border : #eae9e8 solid 1px !important ;
							}
							table.ui-datepicker-calendar td a.ui-state-highlight {
							color : #494949 !important ;
							}
							table.ui-datepicker-calendar td a:hover, table.ui-datepicker-calendar td a.ui-state-active {
							background : #e15c71 !important ;
							color : #ffffff !important ;
							border : #bd0a26 solid 1px !important ;
							}
							.ui-datepicker-next-hover, .ui-datepicker-prev-hover {
							background : #ffffff !important ;
							border : #ffffff solid 1px !important ;
							color : #ffffff !important ;
							}
							.ui-datepicker-buttonpane {
							border : 0;
							}
							.ui-dialog .ui-dialog-titlebar {
							border : 0;
							background : #bd0a26;
							color : #bd0a26;
							padding : 4px 8px 4px 8px;
							width : 20px;
							float : right;
							}
							.lookup-dialog .ui-dialog-titlebar {
							margin-top : -6px;
							}
							.ui-dialog-titlebar-close.ui-state-hover {
							background : #e9ced2 !important ;
							}
							.ui-dialog {
							border : 0;
							background : #bd0a26 !important ;
							opacity : 0.9;
							}
							.ui-dialog .dialog-modal {
							margin : 5px;
							margin-top : 10px;
							padding-left : 7px;
							padding-top : 0;
							}
							.dialog-modal p span {
							color : #f9f9f9;
							font-size : 1em !important ;
							}
							div[lookupdetail].ui-dialog-content {
							color: #f9f9f9 !important;
							}
							.LookupDetailInfoText {
							color: #f9f9f9 !important;
							}
							.ui-widget-overlay {
							background : #ffffff;
							}
							.ui-dialog .ui-widget-content {
							background : none;
							border : 0;
							}
							.lookup-dialog {
							color : #494949 !important ;
							border : #d4d4d4 solid 2px;
							background : #f9f9f9 !important ;
							padding : 5px 0 5px 10px;
							opacity : 1;
							}
							.lookup-dialog .ui-helper-clearfix {
							background : #f9f9f9 !important ;
							}
							.lookup-dialog .fg-buttonset {
							width : 100px;
							}
							.lookup-dialog .ui-dialog-title {
							color : #f9f9f9;
							}
							.fg-button {
							margin-left : 3px !important ;
							}
							.lookup-dialog .ui-icon-closethick {
							margin-right : 5px;
							}
							.lookup-dialog .fg-toolbar {
							border : #d4d4d4 solid 1px;
							background : #eae9e8 !important ;
							color : #bd0a26;
							}
							.lookup-dialog table th {
							border-color : #d4d4d4 !important ;
							background : #ffffff !important ;
							color : #494949 !important ;
							}
							.fg-toolbar {
							background : #ffffff;
							padding : 0;
							}
							.lookup-dialog .fg-button {
							background : none;
							border : 0;
							}
							.lookup-dialog #FilterButton, .lookup-dialog .ui-button-text {
							font-size : 0.8em !important ;
							}
							.lookup-dialog .dataTables_processing {
							color : #4f4e4e;
							}
							.lookup-dialog .ui-icon, .ui-icon-closethick {
							background-image : url(images/ui-icons_cd0a0a_256x240.png) !important ;
							}
							.lookup-dialog thead th, .lookup-dialog tbody tr {
							color : #bd0a26 !important ;
							}
							.load-dialog {
							color : #494949 !important ;
							border : #d4d4d4 solid 2px;
							background : #f9f9f9 !important ;
							padding : 5px 0 5px 10px;
							opacity : 1;
							}
							.load-dialog .ui-icon-closethick {
							margin-right : 5px;
							}
							.load-dialog .ui-icon{
							background-image : url(images/ui-icons_cd0a0a_256x240.png) !important ;
							}
							.load-dialog .ui-helper-clearfix {
							background : #f9f9f9 !important ;
							}
							.load-dialog .fg-buttonset {
							width : 100px;
							}
							.load-dialog .ui-dialog-title {
							color : #f9f9f9;
							}
							.load-dialog .ui-dialog-titlebar {
							margin-top : -6px;
							}
						</style><link href="https://fonts.googleapis.com/css?family=Open+Sans:300,400,400italic,bold,600&amp;subset=latin,latin-ext" rel="stylesheet" type="text/css" /><script type="text/javascript">
							/* <![CDATA[ */
/*! jQuery v1.11.1 | (c) 2005, 2014 jQuery Foundation, Inc. | jquery.org/license */
!function (a, b) { "object" == typeof module && "object" == typeof module.exports ? module.exports = a.document ? b(a, !0) : function (a) { if (!a.document) throw new Error("jQuery requires a window with a document"); return b(a) } : b(a) }("undefined" != typeof window ? window : this, function (a, b) {
    var c = [], d = c.slice, e = c.concat, f = c.push, g = c.indexOf, h = {}, i = h.toString, j = h.hasOwnProperty, k = {}, l = "1.11.1", m = function (a, b) { return new m.fn.init(a, b) }, n = /^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, o = /^-ms-/, p = /-([\da-z])/gi, q = function (a, b) { return b.toUpperCase() }; m.fn = m.prototype = { jquery: l, constructor: m, selector: "", length: 0, toArray: function () { return d.call(this) }, get: function (a) { return null != a ? 0 > a ? this[a + this.length] : this[a] : d.call(this) }, pushStack: function (a) { var b = m.merge(this.constructor(), a); return b.prevObject = this, b.context = this.context, b }, each: function (a, b) { return m.each(this, a, b) }, map: function (a) { return this.pushStack(m.map(this, function (b, c) { return a.call(b, c, b) })) }, slice: function () { return this.pushStack(d.apply(this, arguments)) }, first: function () { return this.eq(0) }, last: function () { return this.eq(-1) }, eq: function (a) { var b = this.length, c = +a + (0 > a ? b : 0); return this.pushStack(c >= 0 && b > c ? [this[c]] : []) }, end: function () { return this.prevObject || this.constructor(null) }, push: f, sort: c.sort, splice: c.splice }, m.extend = m.fn.extend = function () { var a, b, c, d, e, f, g = arguments[0] || {}, h = 1, i = arguments.length, j = !1; for ("boolean" == typeof g && (j = g, g = arguments[h] || {}, h++), "object" == typeof g || m.isFunction(g) || (g = {}), h === i && (g = this, h--) ; i > h; h++) if (null != (e = arguments[h])) for (d in e) a = g[d], c = e[d], g !== c && (j && c && (m.isPlainObject(c) || (b = m.isArray(c))) ? (b ? (b = !1, f = a && m.isArray(a) ? a : []) : f = a && m.isPlainObject(a) ? a : {}, g[d] = m.extend(j, f, c)) : void 0 !== c && (g[d] = c)); return g }, m.extend({ expando: "jQuery" + (l + Math.random()).replace(/\D/g, ""), isReady: !0, error: function (a) { throw new Error(a) }, noop: function () { }, isFunction: function (a) { return "function" === m.type(a) }, isArray: Array.isArray || function (a) { return "array" === m.type(a) }, isWindow: function (a) { return null != a && a == a.window }, isNumeric: function (a) { return !m.isArray(a) && a - parseFloat(a) >= 0 }, isEmptyObject: function (a) { var b; for (b in a) return !1; return !0 }, isPlainObject: function (a) { var b; if (!a || "object" !== m.type(a) || a.nodeType || m.isWindow(a)) return !1; try { if (a.constructor && !j.call(a, "constructor") && !j.call(a.constructor.prototype, "isPrototypeOf")) return !1 } catch (c) { return !1 } if (k.ownLast) for (b in a) return j.call(a, b); for (b in a); return void 0 === b || j.call(a, b) }, type: function (a) { return null == a ? a + "" : "object" == typeof a || "function" == typeof a ? h[i.call(a)] || "object" : typeof a }, globalEval: function (b) { b && m.trim(b) && (a.execScript || function (b) { a.eval.call(a, b) })(b) }, camelCase: function (a) { return a.replace(o, "ms-").replace(p, q) }, nodeName: function (a, b) { return a.nodeName && a.nodeName.toLowerCase() === b.toLowerCase() }, each: function (a, b, c) { var d, e = 0, f = a.length, g = r(a); if (c) { if (g) { for (; f > e; e++) if (d = b.apply(a[e], c), d === !1) break } else for (e in a) if (d = b.apply(a[e], c), d === !1) break } else if (g) { for (; f > e; e++) if (d = b.call(a[e], e, a[e]), d === !1) break } else for (e in a) if (d = b.call(a[e], e, a[e]), d === !1) break; return a }, trim: function (a) { return null == a ? "" : (a + "").replace(n, "") }, makeArray: function (a, b) { var c = b || []; return null != a && (r(Object(a)) ? m.merge(c, "string" == typeof a ? [a] : a) : f.call(c, a)), c }, inArray: function (a, b, c) { var d; if (b) { if (g) return g.call(b, a, c); for (d = b.length, c = c ? 0 > c ? Math.max(0, d + c) : c : 0; d > c; c++) if (c in b && b[c] === a) return c } return -1 }, merge: function (a, b) { var c = +b.length, d = 0, e = a.length; while (c > d) a[e++] = b[d++]; if (c !== c) while (void 0 !== b[d]) a[e++] = b[d++]; return a.length = e, a }, grep: function (a, b, c) { for (var d, e = [], f = 0, g = a.length, h = !c; g > f; f++) d = !b(a[f], f), d !== h && e.push(a[f]); return e }, map: function (a, b, c) { var d, f = 0, g = a.length, h = r(a), i = []; if (h) for (; g > f; f++) d = b(a[f], f, c), null != d && i.push(d); else for (f in a) d = b(a[f], f, c), null != d && i.push(d); return e.apply([], i) }, guid: 1, proxy: function (a, b) { var c, e, f; return "string" == typeof b && (f = a[b], b = a, a = f), m.isFunction(a) ? (c = d.call(arguments, 2), e = function () { return a.apply(b || this, c.concat(d.call(arguments))) }, e.guid = a.guid = a.guid || m.guid++, e) : void 0 }, now: function () { return +new Date }, support: k }), m.each("Boolean Number String Function Array Date RegExp Object Error".split(" "), function (a, b) { h["[object " + b + "]"] = b.toLowerCase() }); function r(a) { var b = a.length, c = m.type(a); return "function" === c || m.isWindow(a) ? !1 : 1 === a.nodeType && b ? !0 : "array" === c || 0 === b || "number" == typeof b && b > 0 && b - 1 in a } var s = function (a) { var b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u = "sizzle" + -new Date, v = a.document, w = 0, x = 0, y = gb(), z = gb(), A = gb(), B = function (a, b) { return a === b && (l = !0), 0 }, C = "undefined", D = 1 << 31, E = {}.hasOwnProperty, F = [], G = F.pop, H = F.push, I = F.push, J = F.slice, K = F.indexOf || function (a) { for (var b = 0, c = this.length; c > b; b++) if (this[b] === a) return b; return -1 }, L = "checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped", M = "[\\x20\\t\\r\\n\\f]", N = "(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+", O = N.replace("w", "w#"), P = "\\[" + M + "*(" + N + ")(?:" + M + "*([*^$|!~]?=)" + M + "*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|(" + O + "))|)" + M + "*\\]", Q = ":(" + N + ")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|" + P + ")*)|.*)\\)|)", R = new RegExp("^" + M + "+|((?:^|[^\\\\])(?:\\\\.)*)" + M + "+$", "g"), S = new RegExp("^" + M + "*," + M + "*"), T = new RegExp("^" + M + "*([>+~]|" + M + ")" + M + "*"), U = new RegExp("=" + M + "*([^\\]'\"]*?)" + M + "*\\]", "g"), V = new RegExp(Q), W = new RegExp("^" + O + "$"), X = { ID: new RegExp("^#(" + N + ")"), CLASS: new RegExp("^\\.(" + N + ")"), TAG: new RegExp("^(" + N.replace("w", "w*") + ")"), ATTR: new RegExp("^" + P), PSEUDO: new RegExp("^" + Q), CHILD: new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\(" + M + "*(even|odd|(([+-]|)(\\d*)n|)" + M + "*(?:([+-]|)" + M + "*(\\d+)|))" + M + "*\\)|)", "i"), bool: new RegExp("^(?:" + L + ")$", "i"), needsContext: new RegExp("^" + M + "*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\(" + M + "*((?:-\\d)?\\d*)" + M + "*\\)|)(?=[^-]|$)", "i") }, Y = /^(?:input|select|textarea|button)$/i, Z = /^h\d$/i, $ = /^[^{]+\{\s*\[native \w/, _ = /^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/, ab = /[+~]/, bb = /'|\\/g, cb = new RegExp("\\\\([\\da-f]{1,6}" + M + "?|(" + M + ")|.)", "ig"), db = function (a, b, c) { var d = "0x" + b - 65536; return d !== d || c ? b : 0 > d ? String.fromCharCode(d + 65536) : String.fromCharCode(d >> 10 | 55296, 1023 & d | 56320) }; try { I.apply(F = J.call(v.childNodes), v.childNodes), F[v.childNodes.length].nodeType } catch (eb) { I = { apply: F.length ? function (a, b) { H.apply(a, J.call(b)) } : function (a, b) { var c = a.length, d = 0; while (a[c++] = b[d++]); a.length = c - 1 } } } function fb(a, b, d, e) { var f, h, j, k, l, o, r, s, w, x; if ((b ? b.ownerDocument || b : v) !== n && m(b), b = b || n, d = d || [], !a || "string" != typeof a) return d; if (1 !== (k = b.nodeType) && 9 !== k) return []; if (p && !e) { if (f = _.exec(a)) if (j = f[1]) { if (9 === k) { if (h = b.getElementById(j), !h || !h.parentNode) return d; if (h.id === j) return d.push(h), d } else if (b.ownerDocument && (h = b.ownerDocument.getElementById(j)) && t(b, h) && h.id === j) return d.push(h), d } else { if (f[2]) return I.apply(d, b.getElementsByTagName(a)), d; if ((j = f[3]) && c.getElementsByClassName && b.getElementsByClassName) return I.apply(d, b.getElementsByClassName(j)), d } if (c.qsa && (!q || !q.test(a))) { if (s = r = u, w = b, x = 9 === k && a, 1 === k && "object" !== b.nodeName.toLowerCase()) { o = g(a), (r = b.getAttribute("id")) ? s = r.replace(bb, "\\$&") : b.setAttribute("id", s), s = "[id='" + s + "'] ", l = o.length; while (l--) o[l] = s + qb(o[l]); w = ab.test(a) && ob(b.parentNode) || b, x = o.join(",") } if (x) try { return I.apply(d, w.querySelectorAll(x)), d } catch (y) { } finally { r || b.removeAttribute("id") } } } return i(a.replace(R, "$1"), b, d, e) } function gb() { var a = []; function b(c, e) { return a.push(c + " ") > d.cacheLength && delete b[a.shift()], b[c + " "] = e } return b } function hb(a) { return a[u] = !0, a } function ib(a) { var b = n.createElement("div"); try { return !!a(b) } catch (c) { return !1 } finally { b.parentNode && b.parentNode.removeChild(b), b = null } } function jb(a, b) { var c = a.split("|"), e = a.length; while (e--) d.attrHandle[c[e]] = b } function kb(a, b) { var c = b && a, d = c && 1 === a.nodeType && 1 === b.nodeType && (~b.sourceIndex || D) - (~a.sourceIndex || D); if (d) return d; if (c) while (c = c.nextSibling) if (c === b) return -1; return a ? 1 : -1 } function lb(a) { return function (b) { var c = b.nodeName.toLowerCase(); return "input" === c && b.type === a } } function mb(a) { return function (b) { var c = b.nodeName.toLowerCase(); return ("input" === c || "button" === c) && b.type === a } } function nb(a) { return hb(function (b) { return b = +b, hb(function (c, d) { var e, f = a([], c.length, b), g = f.length; while (g--) c[e = f[g]] && (c[e] = !(d[e] = c[e])) }) }) } function ob(a) { return a && typeof a.getElementsByTagName !== C && a } c = fb.support = {}, f = fb.isXML = function (a) { var b = a && (a.ownerDocument || a).documentElement; return b ? "HTML" !== b.nodeName : !1 }, m = fb.setDocument = function (a) { var b, e = a ? a.ownerDocument || a : v, g = e.defaultView; return e !== n && 9 === e.nodeType && e.documentElement ? (n = e, o = e.documentElement, p = !f(e), g && g !== g.top && (g.addEventListener ? g.addEventListener("unload", function () { m() }, !1) : g.attachEvent && g.attachEvent("onunload", function () { m() })), c.attributes = ib(function (a) { return a.className = "i", !a.getAttribute("className") }), c.getElementsByTagName = ib(function (a) { return a.appendChild(e.createComment("")), !a.getElementsByTagName("*").length }), c.getElementsByClassName = $.test(e.getElementsByClassName) && ib(function (a) { return a.innerHTML = "<div class='a'></div><div class='a i'></div>", a.firstChild.className = "i", 2 === a.getElementsByClassName("i").length }), c.getById = ib(function (a) { return o.appendChild(a).id = u, !e.getElementsByName || !e.getElementsByName(u).length }), c.getById ? (d.find.ID = function (a, b) { if (typeof b.getElementById !== C && p) { var c = b.getElementById(a); return c && c.parentNode ? [c] : [] } }, d.filter.ID = function (a) { var b = a.replace(cb, db); return function (a) { return a.getAttribute("id") === b } }) : (delete d.find.ID, d.filter.ID = function (a) { var b = a.replace(cb, db); return function (a) { var c = typeof a.getAttributeNode !== C && a.getAttributeNode("id"); return c && c.value === b } }), d.find.TAG = c.getElementsByTagName ? function (a, b) { return typeof b.getElementsByTagName !== C ? b.getElementsByTagName(a) : void 0 } : function (a, b) { var c, d = [], e = 0, f = b.getElementsByTagName(a); if ("*" === a) { while (c = f[e++]) 1 === c.nodeType && d.push(c); return d } return f }, d.find.CLASS = c.getElementsByClassName && function (a, b) { return typeof b.getElementsByClassName !== C && p ? b.getElementsByClassName(a) : void 0 }, r = [], q = [], (c.qsa = $.test(e.querySelectorAll)) && (ib(function (a) { a.innerHTML = "<select msallowclip=''><option selected=''></option></select>", a.querySelectorAll("[msallowclip^='']").length && q.push("[*^$]=" + M + "*(?:''|\"\")"), a.querySelectorAll("[selected]").length || q.push("\\[" + M + "*(?:value|" + L + ")"), a.querySelectorAll(":checked").length || q.push(":checked") }), ib(function (a) { var b = e.createElement("input"); b.setAttribute("type", "hidden"), a.appendChild(b).setAttribute("name", "D"), a.querySelectorAll("[name=d]").length && q.push("name" + M + "*[*^$|!~]?="), a.querySelectorAll(":enabled").length || q.push(":enabled", ":disabled"), a.querySelectorAll("*,:x"), q.push(",.*:") })), (c.matchesSelector = $.test(s = o.matches || o.webkitMatchesSelector || o.mozMatchesSelector || o.oMatchesSelector || o.msMatchesSelector)) && ib(function (a) { c.disconnectedMatch = s.call(a, "div"), s.call(a, "[s!='']:x"), r.push("!=", Q) }), q = q.length && new RegExp(q.join("|")), r = r.length && new RegExp(r.join("|")), b = $.test(o.compareDocumentPosition), t = b || $.test(o.contains) ? function (a, b) { var c = 9 === a.nodeType ? a.documentElement : a, d = b && b.parentNode; return a === d || !(!d || 1 !== d.nodeType || !(c.contains ? c.contains(d) : a.compareDocumentPosition && 16 & a.compareDocumentPosition(d))) } : function (a, b) { if (b) while (b = b.parentNode) if (b === a) return !0; return !1 }, B = b ? function (a, b) { if (a === b) return l = !0, 0; var d = !a.compareDocumentPosition - !b.compareDocumentPosition; return d ? d : (d = (a.ownerDocument || a) === (b.ownerDocument || b) ? a.compareDocumentPosition(b) : 1, 1 & d || !c.sortDetached && b.compareDocumentPosition(a) === d ? a === e || a.ownerDocument === v && t(v, a) ? -1 : b === e || b.ownerDocument === v && t(v, b) ? 1 : k ? K.call(k, a) - K.call(k, b) : 0 : 4 & d ? -1 : 1) } : function (a, b) { if (a === b) return l = !0, 0; var c, d = 0, f = a.parentNode, g = b.parentNode, h = [a], i = [b]; if (!f || !g) return a === e ? -1 : b === e ? 1 : f ? -1 : g ? 1 : k ? K.call(k, a) - K.call(k, b) : 0; if (f === g) return kb(a, b); c = a; while (c = c.parentNode) h.unshift(c); c = b; while (c = c.parentNode) i.unshift(c); while (h[d] === i[d]) d++; return d ? kb(h[d], i[d]) : h[d] === v ? -1 : i[d] === v ? 1 : 0 }, e) : n }, fb.matches = function (a, b) { return fb(a, null, null, b) }, fb.matchesSelector = function (a, b) { if ((a.ownerDocument || a) !== n && m(a), b = b.replace(U, "='$1']"), !(!c.matchesSelector || !p || r && r.test(b) || q && q.test(b))) try { var d = s.call(a, b); if (d || c.disconnectedMatch || a.document && 11 !== a.document.nodeType) return d } catch (e) { } return fb(b, n, null, [a]).length > 0 }, fb.contains = function (a, b) { return (a.ownerDocument || a) !== n && m(a), t(a, b) }, fb.attr = function (a, b) { (a.ownerDocument || a) !== n && m(a); var e = d.attrHandle[b.toLowerCase()], f = e && E.call(d.attrHandle, b.toLowerCase()) ? e(a, b, !p) : void 0; return void 0 !== f ? f : c.attributes || !p ? a.getAttribute(b) : (f = a.getAttributeNode(b)) && f.specified ? f.value : null }, fb.error = function (a) { throw new Error("Syntax error, unrecognized expression: " + a) }, fb.uniqueSort = function (a) { var b, d = [], e = 0, f = 0; if (l = !c.detectDuplicates, k = !c.sortStable && a.slice(0), a.sort(B), l) { while (b = a[f++]) b === a[f] && (e = d.push(f)); while (e--) a.splice(d[e], 1) } return k = null, a }, e = fb.getText = function (a) { var b, c = "", d = 0, f = a.nodeType; if (f) { if (1 === f || 9 === f || 11 === f) { if ("string" == typeof a.textContent) return a.textContent; for (a = a.firstChild; a; a = a.nextSibling) c += e(a) } else if (3 === f || 4 === f) return a.nodeValue } else while (b = a[d++]) c += e(b); return c }, d = fb.selectors = { cacheLength: 50, createPseudo: hb, match: X, attrHandle: {}, find: {}, relative: { ">": { dir: "parentNode", first: !0 }, " ": { dir: "parentNode" }, "+": { dir: "previousSibling", first: !0 }, "~": { dir: "previousSibling" } }, preFilter: { ATTR: function (a) { return a[1] = a[1].replace(cb, db), a[3] = (a[3] || a[4] || a[5] || "").replace(cb, db), "~=" === a[2] && (a[3] = " " + a[3] + " "), a.slice(0, 4) }, CHILD: function (a) { return a[1] = a[1].toLowerCase(), "nth" === a[1].slice(0, 3) ? (a[3] || fb.error(a[0]), a[4] = +(a[4] ? a[5] + (a[6] || 1) : 2 * ("even" === a[3] || "odd" === a[3])), a[5] = +(a[7] + a[8] || "odd" === a[3])) : a[3] && fb.error(a[0]), a }, PSEUDO: function (a) { var b, c = !a[6] && a[2]; return X.CHILD.test(a[0]) ? null : (a[3] ? a[2] = a[4] || a[5] || "" : c && V.test(c) && (b = g(c, !0)) && (b = c.indexOf(")", c.length - b) - c.length) && (a[0] = a[0].slice(0, b), a[2] = c.slice(0, b)), a.slice(0, 3)) } }, filter: { TAG: function (a) { var b = a.replace(cb, db).toLowerCase(); return "*" === a ? function () { return !0 } : function (a) { return a.nodeName && a.nodeName.toLowerCase() === b } }, CLASS: function (a) { var b = y[a + " "]; return b || (b = new RegExp("(^|" + M + ")" + a + "(" + M + "|$)")) && y(a, function (a) { return b.test("string" == typeof a.className && a.className || typeof a.getAttribute !== C && a.getAttribute("class") || "") }) }, ATTR: function (a, b, c) { return function (d) { var e = fb.attr(d, a); return null == e ? "!=" === b : b ? (e += "", "=" === b ? e === c : "!=" === b ? e !== c : "^=" === b ? c && 0 === e.indexOf(c) : "*=" === b ? c && e.indexOf(c) > -1 : "$=" === b ? c && e.slice(-c.length) === c : "~=" === b ? (" " + e + " ").indexOf(c) > -1 : "|=" === b ? e === c || e.slice(0, c.length + 1) === c + "-" : !1) : !0 } }, CHILD: function (a, b, c, d, e) { var f = "nth" !== a.slice(0, 3), g = "last" !== a.slice(-4), h = "of-type" === b; return 1 === d && 0 === e ? function (a) { return !!a.parentNode } : function (b, c, i) { var j, k, l, m, n, o, p = f !== g ? "nextSibling" : "previousSibling", q = b.parentNode, r = h && b.nodeName.toLowerCase(), s = !i && !h; if (q) { if (f) { while (p) { l = b; while (l = l[p]) if (h ? l.nodeName.toLowerCase() === r : 1 === l.nodeType) return !1; o = p = "only" === a && !o && "nextSibling" } return !0 } if (o = [g ? q.firstChild : q.lastChild], g && s) { k = q[u] || (q[u] = {}), j = k[a] || [], n = j[0] === w && j[1], m = j[0] === w && j[2], l = n && q.childNodes[n]; while (l = ++n && l && l[p] || (m = n = 0) || o.pop()) if (1 === l.nodeType && ++m && l === b) { k[a] = [w, n, m]; break } } else if (s && (j = (b[u] || (b[u] = {}))[a]) && j[0] === w) m = j[1]; else while (l = ++n && l && l[p] || (m = n = 0) || o.pop()) if ((h ? l.nodeName.toLowerCase() === r : 1 === l.nodeType) && ++m && (s && ((l[u] || (l[u] = {}))[a] = [w, m]), l === b)) break; return m -= e, m === d || m % d === 0 && m / d >= 0 } } }, PSEUDO: function (a, b) { var c, e = d.pseudos[a] || d.setFilters[a.toLowerCase()] || fb.error("unsupported pseudo: " + a); return e[u] ? e(b) : e.length > 1 ? (c = [a, a, "", b], d.setFilters.hasOwnProperty(a.toLowerCase()) ? hb(function (a, c) { var d, f = e(a, b), g = f.length; while (g--) d = K.call(a, f[g]), a[d] = !(c[d] = f[g]) }) : function (a) { return e(a, 0, c) }) : e } }, pseudos: { not: hb(function (a) { var b = [], c = [], d = h(a.replace(R, "$1")); return d[u] ? hb(function (a, b, c, e) { var f, g = d(a, null, e, []), h = a.length; while (h--) (f = g[h]) && (a[h] = !(b[h] = f)) }) : function (a, e, f) { return b[0] = a, d(b, null, f, c), !c.pop() } }), has: hb(function (a) { return function (b) { return fb(a, b).length > 0 } }), contains: hb(function (a) { return function (b) { return (b.textContent || b.innerText || e(b)).indexOf(a) > -1 } }), lang: hb(function (a) { return W.test(a || "") || fb.error("unsupported lang: " + a), a = a.replace(cb, db).toLowerCase(), function (b) { var c; do if (c = p ? b.lang : b.getAttribute("xml:lang") || b.getAttribute("lang")) return c = c.toLowerCase(), c === a || 0 === c.indexOf(a + "-"); while ((b = b.parentNode) && 1 === b.nodeType); return !1 } }), target: function (b) { var c = a.location && a.location.hash; return c && c.slice(1) === b.id }, root: function (a) { return a === o }, focus: function (a) { return a === n.activeElement && (!n.hasFocus || n.hasFocus()) && !!(a.type || a.href || ~a.tabIndex) }, enabled: function (a) { return a.disabled === !1 }, disabled: function (a) { return a.disabled === !0 }, checked: function (a) { var b = a.nodeName.toLowerCase(); return "input" === b && !!a.checked || "option" === b && !!a.selected }, selected: function (a) { return a.parentNode && a.parentNode.selectedIndex, a.selected === !0 }, empty: function (a) { for (a = a.firstChild; a; a = a.nextSibling) if (a.nodeType < 6) return !1; return !0 }, parent: function (a) { return !d.pseudos.empty(a) }, header: function (a) { return Z.test(a.nodeName) }, input: function (a) { return Y.test(a.nodeName) }, button: function (a) { var b = a.nodeName.toLowerCase(); return "input" === b && "button" === a.type || "button" === b }, text: function (a) { var b; return "input" === a.nodeName.toLowerCase() && "text" === a.type && (null == (b = a.getAttribute("type")) || "text" === b.toLowerCase()) }, first: nb(function () { return [0] }), last: nb(function (a, b) { return [b - 1] }), eq: nb(function (a, b, c) { return [0 > c ? c + b : c] }), even: nb(function (a, b) { for (var c = 0; b > c; c += 2) a.push(c); return a }), odd: nb(function (a, b) { for (var c = 1; b > c; c += 2) a.push(c); return a }), lt: nb(function (a, b, c) { for (var d = 0 > c ? c + b : c; --d >= 0;) a.push(d); return a }), gt: nb(function (a, b, c) { for (var d = 0 > c ? c + b : c; ++d < b;) a.push(d); return a }) } }, d.pseudos.nth = d.pseudos.eq; for (b in { radio: !0, checkbox: !0, file: !0, password: !0, image: !0 }) d.pseudos[b] = lb(b); for (b in { submit: !0, reset: !0 }) d.pseudos[b] = mb(b); function pb() { } pb.prototype = d.filters = d.pseudos, d.setFilters = new pb, g = fb.tokenize = function (a, b) { var c, e, f, g, h, i, j, k = z[a + " "]; if (k) return b ? 0 : k.slice(0); h = a, i = [], j = d.preFilter; while (h) { (!c || (e = S.exec(h))) && (e && (h = h.slice(e[0].length) || h), i.push(f = [])), c = !1, (e = T.exec(h)) && (c = e.shift(), f.push({ value: c, type: e[0].replace(R, " ") }), h = h.slice(c.length)); for (g in d.filter) !(e = X[g].exec(h)) || j[g] && !(e = j[g](e)) || (c = e.shift(), f.push({ value: c, type: g, matches: e }), h = h.slice(c.length)); if (!c) break } return b ? h.length : h ? fb.error(a) : z(a, i).slice(0) }; function qb(a) { for (var b = 0, c = a.length, d = ""; c > b; b++) d += a[b].value; return d } function rb(a, b, c) { var d = b.dir, e = c && "parentNode" === d, f = x++; return b.first ? function (b, c, f) { while (b = b[d]) if (1 === b.nodeType || e) return a(b, c, f) } : function (b, c, g) { var h, i, j = [w, f]; if (g) { while (b = b[d]) if ((1 === b.nodeType || e) && a(b, c, g)) return !0 } else while (b = b[d]) if (1 === b.nodeType || e) { if (i = b[u] || (b[u] = {}), (h = i[d]) && h[0] === w && h[1] === f) return j[2] = h[2]; if (i[d] = j, j[2] = a(b, c, g)) return !0 } } } function sb(a) { return a.length > 1 ? function (b, c, d) { var e = a.length; while (e--) if (!a[e](b, c, d)) return !1; return !0 } : a[0] } function tb(a, b, c) { for (var d = 0, e = b.length; e > d; d++) fb(a, b[d], c); return c } function ub(a, b, c, d, e) { for (var f, g = [], h = 0, i = a.length, j = null != b; i > h; h++) (f = a[h]) && (!c || c(f, d, e)) && (g.push(f), j && b.push(h)); return g } function vb(a, b, c, d, e, f) { return d && !d[u] && (d = vb(d)), e && !e[u] && (e = vb(e, f)), hb(function (f, g, h, i) { var j, k, l, m = [], n = [], o = g.length, p = f || tb(b || "*", h.nodeType ? [h] : h, []), q = !a || !f && b ? p : ub(p, m, a, h, i), r = c ? e || (f ? a : o || d) ? [] : g : q; if (c && c(q, r, h, i), d) { j = ub(r, n), d(j, [], h, i), k = j.length; while (k--) (l = j[k]) && (r[n[k]] = !(q[n[k]] = l)) } if (f) { if (e || a) { if (e) { j = [], k = r.length; while (k--) (l = r[k]) && j.push(q[k] = l); e(null, r = [], j, i) } k = r.length; while (k--) (l = r[k]) && (j = e ? K.call(f, l) : m[k]) > -1 && (f[j] = !(g[j] = l)) } } else r = ub(r === g ? r.splice(o, r.length) : r), e ? e(null, g, r, i) : I.apply(g, r) }) } function wb(a) { for (var b, c, e, f = a.length, g = d.relative[a[0].type], h = g || d.relative[" "], i = g ? 1 : 0, k = rb(function (a) { return a === b }, h, !0), l = rb(function (a) { return K.call(b, a) > -1 }, h, !0), m = [function (a, c, d) { return !g && (d || c !== j) || ((b = c).nodeType ? k(a, c, d) : l(a, c, d)) }]; f > i; i++) if (c = d.relative[a[i].type]) m = [rb(sb(m), c)]; else { if (c = d.filter[a[i].type].apply(null, a[i].matches), c[u]) { for (e = ++i; f > e; e++) if (d.relative[a[e].type]) break; return vb(i > 1 && sb(m), i > 1 && qb(a.slice(0, i - 1).concat({ value: " " === a[i - 2].type ? "*" : "" })).replace(R, "$1"), c, e > i && wb(a.slice(i, e)), f > e && wb(a = a.slice(e)), f > e && qb(a)) } m.push(c) } return sb(m) } function xb(a, b) { var c = b.length > 0, e = a.length > 0, f = function (f, g, h, i, k) { var l, m, o, p = 0, q = "0", r = f && [], s = [], t = j, u = f || e && d.find.TAG("*", k), v = w += null == t ? 1 : Math.random() || .1, x = u.length; for (k && (j = g !== n && g) ; q !== x && null != (l = u[q]) ; q++) { if (e && l) { m = 0; while (o = a[m++]) if (o(l, g, h)) { i.push(l); break } k && (w = v) } c && ((l = !o && l) && p--, f && r.push(l)) } if (p += q, c && q !== p) { m = 0; while (o = b[m++]) o(r, s, g, h); if (f) { if (p > 0) while (q--) r[q] || s[q] || (s[q] = G.call(i)); s = ub(s) } I.apply(i, s), k && !f && s.length > 0 && p + b.length > 1 && fb.uniqueSort(i) } return k && (w = v, j = t), r }; return c ? hb(f) : f } return h = fb.compile = function (a, b) { var c, d = [], e = [], f = A[a + " "]; if (!f) { b || (b = g(a)), c = b.length; while (c--) f = wb(b[c]), f[u] ? d.push(f) : e.push(f); f = A(a, xb(e, d)), f.selector = a } return f }, i = fb.select = function (a, b, e, f) { var i, j, k, l, m, n = "function" == typeof a && a, o = !f && g(a = n.selector || a); if (e = e || [], 1 === o.length) { if (j = o[0] = o[0].slice(0), j.length > 2 && "ID" === (k = j[0]).type && c.getById && 9 === b.nodeType && p && d.relative[j[1].type]) { if (b = (d.find.ID(k.matches[0].replace(cb, db), b) || [])[0], !b) return e; n && (b = b.parentNode), a = a.slice(j.shift().value.length) } i = X.needsContext.test(a) ? 0 : j.length; while (i--) { if (k = j[i], d.relative[l = k.type]) break; if ((m = d.find[l]) && (f = m(k.matches[0].replace(cb, db), ab.test(j[0].type) && ob(b.parentNode) || b))) { if (j.splice(i, 1), a = f.length && qb(j), !a) return I.apply(e, f), e; break } } } return (n || h(a, o))(f, b, !p, e, ab.test(a) && ob(b.parentNode) || b), e }, c.sortStable = u.split("").sort(B).join("") === u, c.detectDuplicates = !!l, m(), c.sortDetached = ib(function (a) { return 1 & a.compareDocumentPosition(n.createElement("div")) }), ib(function (a) { return a.innerHTML = "<a href='#'></a>", "#" === a.firstChild.getAttribute("href") }) || jb("type|href|height|width", function (a, b, c) { return c ? void 0 : a.getAttribute(b, "type" === b.toLowerCase() ? 1 : 2) }), c.attributes && ib(function (a) { return a.innerHTML = "<input/>", a.firstChild.setAttribute("value", ""), "" === a.firstChild.getAttribute("value") }) || jb("value", function (a, b, c) { return c || "input" !== a.nodeName.toLowerCase() ? void 0 : a.defaultValue }), ib(function (a) { return null == a.getAttribute("disabled") }) || jb(L, function (a, b, c) { var d; return c ? void 0 : a[b] === !0 ? b.toLowerCase() : (d = a.getAttributeNode(b)) && d.specified ? d.value : null }), fb }(a); m.find = s, m.expr = s.selectors, m.expr[":"] = m.expr.pseudos, m.unique = s.uniqueSort, m.text = s.getText, m.isXMLDoc = s.isXML, m.contains = s.contains; var t = m.expr.match.needsContext, u = /^<(\w+)\s*\/?>(?:<\/\1>|)$/, v = /^.[^:#\[\.,]*$/; function w(a, b, c) { if (m.isFunction(b)) return m.grep(a, function (a, d) { return !!b.call(a, d, a) !== c }); if (b.nodeType) return m.grep(a, function (a) { return a === b !== c }); if ("string" == typeof b) { if (v.test(b)) return m.filter(b, a, c); b = m.filter(b, a) } return m.grep(a, function (a) { return m.inArray(a, b) >= 0 !== c }) } m.filter = function (a, b, c) { var d = b[0]; return c && (a = ":not(" + a + ")"), 1 === b.length && 1 === d.nodeType ? m.find.matchesSelector(d, a) ? [d] : [] : m.find.matches(a, m.grep(b, function (a) { return 1 === a.nodeType })) }, m.fn.extend({ find: function (a) { var b, c = [], d = this, e = d.length; if ("string" != typeof a) return this.pushStack(m(a).filter(function () { for (b = 0; e > b; b++) if (m.contains(d[b], this)) return !0 })); for (b = 0; e > b; b++) m.find(a, d[b], c); return c = this.pushStack(e > 1 ? m.unique(c) : c), c.selector = this.selector ? this.selector + " " + a : a, c }, filter: function (a) { return this.pushStack(w(this, a || [], !1)) }, not: function (a) { return this.pushStack(w(this, a || [], !0)) }, is: function (a) { return !!w(this, "string" == typeof a && t.test(a) ? m(a) : a || [], !1).length } }); var x, y = a.document, z = /^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/, A = m.fn.init = function (a, b) { var c, d; if (!a) return this; if ("string" == typeof a) { if (c = "<" === a.charAt(0) && ">" === a.charAt(a.length - 1) && a.length >= 3 ? [null, a, null] : z.exec(a), !c || !c[1] && b) return !b || b.jquery ? (b || x).find(a) : this.constructor(b).find(a); if (c[1]) { if (b = b instanceof m ? b[0] : b, m.merge(this, m.parseHTML(c[1], b && b.nodeType ? b.ownerDocument || b : y, !0)), u.test(c[1]) && m.isPlainObject(b)) for (c in b) m.isFunction(this[c]) ? this[c](b[c]) : this.attr(c, b[c]); return this } if (d = y.getElementById(c[2]), d && d.parentNode) { if (d.id !== c[2]) return x.find(a); this.length = 1, this[0] = d } return this.context = y, this.selector = a, this } return a.nodeType ? (this.context = this[0] = a, this.length = 1, this) : m.isFunction(a) ? "undefined" != typeof x.ready ? x.ready(a) : a(m) : (void 0 !== a.selector && (this.selector = a.selector, this.context = a.context), m.makeArray(a, this)) }; A.prototype = m.fn, x = m(y); var B = /^(?:parents|prev(?:Until|All))/, C = { children: !0, contents: !0, next: !0, prev: !0 }; m.extend({ dir: function (a, b, c) { var d = [], e = a[b]; while (e && 9 !== e.nodeType && (void 0 === c || 1 !== e.nodeType || !m(e).is(c))) 1 === e.nodeType && d.push(e), e = e[b]; return d }, sibling: function (a, b) { for (var c = []; a; a = a.nextSibling) 1 === a.nodeType && a !== b && c.push(a); return c } }), m.fn.extend({ has: function (a) { var b, c = m(a, this), d = c.length; return this.filter(function () { for (b = 0; d > b; b++) if (m.contains(this, c[b])) return !0 }) }, closest: function (a, b) { for (var c, d = 0, e = this.length, f = [], g = t.test(a) || "string" != typeof a ? m(a, b || this.context) : 0; e > d; d++) for (c = this[d]; c && c !== b; c = c.parentNode) if (c.nodeType < 11 && (g ? g.index(c) > -1 : 1 === c.nodeType && m.find.matchesSelector(c, a))) { f.push(c); break } return this.pushStack(f.length > 1 ? m.unique(f) : f) }, index: function (a) { return a ? "string" == typeof a ? m.inArray(this[0], m(a)) : m.inArray(a.jquery ? a[0] : a, this) : this[0] && this[0].parentNode ? this.first().prevAll().length : -1 }, add: function (a, b) { return this.pushStack(m.unique(m.merge(this.get(), m(a, b)))) }, addBack: function (a) { return this.add(null == a ? this.prevObject : this.prevObject.filter(a)) } }); function D(a, b) { do a = a[b]; while (a && 1 !== a.nodeType); return a } m.each({ parent: function (a) { var b = a.parentNode; return b && 11 !== b.nodeType ? b : null }, parents: function (a) { return m.dir(a, "parentNode") }, parentsUntil: function (a, b, c) { return m.dir(a, "parentNode", c) }, next: function (a) { return D(a, "nextSibling") }, prev: function (a) { return D(a, "previousSibling") }, nextAll: function (a) { return m.dir(a, "nextSibling") }, prevAll: function (a) { return m.dir(a, "previousSibling") }, nextUntil: function (a, b, c) { return m.dir(a, "nextSibling", c) }, prevUntil: function (a, b, c) { return m.dir(a, "previousSibling", c) }, siblings: function (a) { return m.sibling((a.parentNode || {}).firstChild, a) }, children: function (a) { return m.sibling(a.firstChild) }, contents: function (a) { return m.nodeName(a, "iframe") ? a.contentDocument || a.contentWindow.document : m.merge([], a.childNodes) } }, function (a, b) { m.fn[a] = function (c, d) { var e = m.map(this, b, c); return "Until" !== a.slice(-5) && (d = c), d && "string" == typeof d && (e = m.filter(d, e)), this.length > 1 && (C[a] || (e = m.unique(e)), B.test(a) && (e = e.reverse())), this.pushStack(e) } }); var E = /\S+/g, F = {}; function G(a) { var b = F[a] = {}; return m.each(a.match(E) || [], function (a, c) { b[c] = !0 }), b } m.Callbacks = function (a) { a = "string" == typeof a ? F[a] || G(a) : m.extend({}, a); var b, c, d, e, f, g, h = [], i = !a.once && [], j = function (l) { for (c = a.memory && l, d = !0, f = g || 0, g = 0, e = h.length, b = !0; h && e > f; f++) if (h[f].apply(l[0], l[1]) === !1 && a.stopOnFalse) { c = !1; break } b = !1, h && (i ? i.length && j(i.shift()) : c ? h = [] : k.disable()) }, k = { add: function () { if (h) { var d = h.length; !function f(b) { m.each(b, function (b, c) { var d = m.type(c); "function" === d ? a.unique && k.has(c) || h.push(c) : c && c.length && "string" !== d && f(c) }) }(arguments), b ? e = h.length : c && (g = d, j(c)) } return this }, remove: function () { return h && m.each(arguments, function (a, c) { var d; while ((d = m.inArray(c, h, d)) > -1) h.splice(d, 1), b && (e >= d && e--, f >= d && f--) }), this }, has: function (a) { return a ? m.inArray(a, h) > -1 : !(!h || !h.length) }, empty: function () { return h = [], e = 0, this }, disable: function () { return h = i = c = void 0, this }, disabled: function () { return !h }, lock: function () { return i = void 0, c || k.disable(), this }, locked: function () { return !i }, fireWith: function (a, c) { return !h || d && !i || (c = c || [], c = [a, c.slice ? c.slice() : c], b ? i.push(c) : j(c)), this }, fire: function () { return k.fireWith(this, arguments), this }, fired: function () { return !!d } }; return k }, m.extend({ Deferred: function (a) { var b = [["resolve", "done", m.Callbacks("once memory"), "resolved"], ["reject", "fail", m.Callbacks("once memory"), "rejected"], ["notify", "progress", m.Callbacks("memory")]], c = "pending", d = { state: function () { return c }, always: function () { return e.done(arguments).fail(arguments), this }, then: function () { var a = arguments; return m.Deferred(function (c) { m.each(b, function (b, f) { var g = m.isFunction(a[b]) && a[b]; e[f[1]](function () { var a = g && g.apply(this, arguments); a && m.isFunction(a.promise) ? a.promise().done(c.resolve).fail(c.reject).progress(c.notify) : c[f[0] + "With"](this === d ? c.promise() : this, g ? [a] : arguments) }) }), a = null }).promise() }, promise: function (a) { return null != a ? m.extend(a, d) : d } }, e = {}; return d.pipe = d.then, m.each(b, function (a, f) { var g = f[2], h = f[3]; d[f[1]] = g.add, h && g.add(function () { c = h }, b[1 ^ a][2].disable, b[2][2].lock), e[f[0]] = function () { return e[f[0] + "With"](this === e ? d : this, arguments), this }, e[f[0] + "With"] = g.fireWith }), d.promise(e), a && a.call(e, e), e }, when: function (a) { var b = 0, c = d.call(arguments), e = c.length, f = 1 !== e || a && m.isFunction(a.promise) ? e : 0, g = 1 === f ? a : m.Deferred(), h = function (a, b, c) { return function (e) { b[a] = this, c[a] = arguments.length > 1 ? d.call(arguments) : e, c === i ? g.notifyWith(b, c) : --f || g.resolveWith(b, c) } }, i, j, k; if (e > 1) for (i = new Array(e), j = new Array(e), k = new Array(e) ; e > b; b++) c[b] && m.isFunction(c[b].promise) ? c[b].promise().done(h(b, k, c)).fail(g.reject).progress(h(b, j, i)) : --f; return f || g.resolveWith(k, c), g.promise() } }); var H; m.fn.ready = function (a) { return m.ready.promise().done(a), this }, m.extend({ isReady: !1, readyWait: 1, holdReady: function (a) { a ? m.readyWait++ : m.ready(!0) }, ready: function (a) { if (a === !0 ? !--m.readyWait : !m.isReady) { if (!y.body) return setTimeout(m.ready); m.isReady = !0, a !== !0 && --m.readyWait > 0 || (H.resolveWith(y, [m]), m.fn.triggerHandler && (m(y).triggerHandler("ready"), m(y).off("ready"))) } } }); function I() { y.addEventListener ? (y.removeEventListener("DOMContentLoaded", J, !1), a.removeEventListener("load", J, !1)) : (y.detachEvent("onreadystatechange", J), a.detachEvent("onload", J)) } function J() { (y.addEventListener || "load" === event.type || "complete" === y.readyState) && (I(), m.ready()) } m.ready.promise = function (b) { if (!H) if (H = m.Deferred(), "complete" === y.readyState) setTimeout(m.ready); else if (y.addEventListener) y.addEventListener("DOMContentLoaded", J, !1), a.addEventListener("load", J, !1); else { y.attachEvent("onreadystatechange", J), a.attachEvent("onload", J); var c = !1; try { c = null == a.frameElement && y.documentElement } catch (d) { } c && c.doScroll && !function e() { if (!m.isReady) { try { c.doScroll("left") } catch (a) { return setTimeout(e, 50) } I(), m.ready() } }() } return H.promise(b) }; var K = "undefined", L; for (L in m(k)) break; k.ownLast = "0" !== L, k.inlineBlockNeedsLayout = !1, m(function () { var a, b, c, d; c = y.getElementsByTagName("body")[0], c && c.style && (b = y.createElement("div"), d = y.createElement("div"), d.style.cssText = "position:absolute;border:0;width:0;height:0;top:0;left:-9999px", c.appendChild(d).appendChild(b), typeof b.style.zoom !== K && (b.style.cssText = "display:inline;margin:0;border:0;padding:1px;width:1px;zoom:1", k.inlineBlockNeedsLayout = a = 3 === b.offsetWidth, a && (c.style.zoom = 1)), c.removeChild(d)) }), function () { var a = y.createElement("div"); if (null == k.deleteExpando) { k.deleteExpando = !0; try { delete a.test } catch (b) { k.deleteExpando = !1 } } a = null }(), m.acceptData = function (a) { var b = m.noData[(a.nodeName + " ").toLowerCase()], c = +a.nodeType || 1; return 1 !== c && 9 !== c ? !1 : !b || b !== !0 && a.getAttribute("classid") === b }; var M = /^(?:\{[\w\W]*\}|\[[\w\W]*\])$/, N = /([A-Z])/g; function O(a, b, c) { if (void 0 === c && 1 === a.nodeType) { var d = "data-" + b.replace(N, "-$1").toLowerCase(); if (c = a.getAttribute(d), "string" == typeof c) { try { c = "true" === c ? !0 : "false" === c ? !1 : "null" === c ? null : +c + "" === c ? +c : M.test(c) ? m.parseJSON(c) : c } catch (e) { } m.data(a, b, c) } else c = void 0 } return c } function P(a) { var b; for (b in a) if (("data" !== b || !m.isEmptyObject(a[b])) && "toJSON" !== b) return !1; return !0 } function Q(a, b, d, e) {
        if (m.acceptData(a)) {
            var f, g, h = m.expando, i = a.nodeType, j = i ? m.cache : a, k = i ? a[h] : a[h] && h;
            if (k && j[k] && (e || j[k].data) || void 0 !== d || "string" != typeof b) return k || (k = i ? a[h] = c.pop() || m.guid++ : h), j[k] || (j[k] = i ? {} : { toJSON: m.noop }), ("object" == typeof b || "function" == typeof b) && (e ? j[k] = m.extend(j[k], b) : j[k].data = m.extend(j[k].data, b)), g = j[k], e || (g.data || (g.data = {}), g = g.data), void 0 !== d && (g[m.camelCase(b)] = d), "string" == typeof b ? (f = g[b], null == f && (f = g[m.camelCase(b)])) : f = g, f
        }
    } function R(a, b, c) { if (m.acceptData(a)) { var d, e, f = a.nodeType, g = f ? m.cache : a, h = f ? a[m.expando] : m.expando; if (g[h]) { if (b && (d = c ? g[h] : g[h].data)) { m.isArray(b) ? b = b.concat(m.map(b, m.camelCase)) : b in d ? b = [b] : (b = m.camelCase(b), b = b in d ? [b] : b.split(" ")), e = b.length; while (e--) delete d[b[e]]; if (c ? !P(d) : !m.isEmptyObject(d)) return } (c || (delete g[h].data, P(g[h]))) && (f ? m.cleanData([a], !0) : k.deleteExpando || g != g.window ? delete g[h] : g[h] = null) } } } m.extend({ cache: {}, noData: { "applet ": !0, "embed ": !0, "object ": "clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" }, hasData: function (a) { return a = a.nodeType ? m.cache[a[m.expando]] : a[m.expando], !!a && !P(a) }, data: function (a, b, c) { return Q(a, b, c) }, removeData: function (a, b) { return R(a, b) }, _data: function (a, b, c) { return Q(a, b, c, !0) }, _removeData: function (a, b) { return R(a, b, !0) } }), m.fn.extend({ data: function (a, b) { var c, d, e, f = this[0], g = f && f.attributes; if (void 0 === a) { if (this.length && (e = m.data(f), 1 === f.nodeType && !m._data(f, "parsedAttrs"))) { c = g.length; while (c--) g[c] && (d = g[c].name, 0 === d.indexOf("data-") && (d = m.camelCase(d.slice(5)), O(f, d, e[d]))); m._data(f, "parsedAttrs", !0) } return e } return "object" == typeof a ? this.each(function () { m.data(this, a) }) : arguments.length > 1 ? this.each(function () { m.data(this, a, b) }) : f ? O(f, a, m.data(f, a)) : void 0 }, removeData: function (a) { return this.each(function () { m.removeData(this, a) }) } }), m.extend({ queue: function (a, b, c) { var d; return a ? (b = (b || "fx") + "queue", d = m._data(a, b), c && (!d || m.isArray(c) ? d = m._data(a, b, m.makeArray(c)) : d.push(c)), d || []) : void 0 }, dequeue: function (a, b) { b = b || "fx"; var c = m.queue(a, b), d = c.length, e = c.shift(), f = m._queueHooks(a, b), g = function () { m.dequeue(a, b) }; "inprogress" === e && (e = c.shift(), d--), e && ("fx" === b && c.unshift("inprogress"), delete f.stop, e.call(a, g, f)), !d && f && f.empty.fire() }, _queueHooks: function (a, b) { var c = b + "queueHooks"; return m._data(a, c) || m._data(a, c, { empty: m.Callbacks("once memory").add(function () { m._removeData(a, b + "queue"), m._removeData(a, c) }) }) } }), m.fn.extend({ queue: function (a, b) { var c = 2; return "string" != typeof a && (b = a, a = "fx", c--), arguments.length < c ? m.queue(this[0], a) : void 0 === b ? this : this.each(function () { var c = m.queue(this, a, b); m._queueHooks(this, a), "fx" === a && "inprogress" !== c[0] && m.dequeue(this, a) }) }, dequeue: function (a) { return this.each(function () { m.dequeue(this, a) }) }, clearQueue: function (a) { return this.queue(a || "fx", []) }, promise: function (a, b) { var c, d = 1, e = m.Deferred(), f = this, g = this.length, h = function () { --d || e.resolveWith(f, [f]) }; "string" != typeof a && (b = a, a = void 0), a = a || "fx"; while (g--) c = m._data(f[g], a + "queueHooks"), c && c.empty && (d++, c.empty.add(h)); return h(), e.promise(b) } }); var S = /[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source, T = ["Top", "Right", "Bottom", "Left"], U = function (a, b) { return a = b || a, "none" === m.css(a, "display") || !m.contains(a.ownerDocument, a) }, V = m.access = function (a, b, c, d, e, f, g) { var h = 0, i = a.length, j = null == c; if ("object" === m.type(c)) { e = !0; for (h in c) m.access(a, b, h, c[h], !0, f, g) } else if (void 0 !== d && (e = !0, m.isFunction(d) || (g = !0), j && (g ? (b.call(a, d), b = null) : (j = b, b = function (a, b, c) { return j.call(m(a), c) })), b)) for (; i > h; h++) b(a[h], c, g ? d : d.call(a[h], h, b(a[h], c))); return e ? a : j ? b.call(a) : i ? b(a[0], c) : f }, W = /^(?:checkbox|radio)$/i; !function () { var a = y.createElement("input"), b = y.createElement("div"), c = y.createDocumentFragment(); if (b.innerHTML = "  <link/><table></table><a href='/a'>a</a><input type='checkbox'/>", k.leadingWhitespace = 3 === b.firstChild.nodeType, k.tbody = !b.getElementsByTagName("tbody").length, k.htmlSerialize = !!b.getElementsByTagName("link").length, k.html5Clone = "<:nav></:nav>" !== y.createElement("nav").cloneNode(!0).outerHTML, a.type = "checkbox", a.checked = !0, c.appendChild(a), k.appendChecked = a.checked, b.innerHTML = "<textarea>x</textarea>", k.noCloneChecked = !!b.cloneNode(!0).lastChild.defaultValue, c.appendChild(b), b.innerHTML = "<input type='radio' checked='checked' name='t'/>", k.checkClone = b.cloneNode(!0).cloneNode(!0).lastChild.checked, k.noCloneEvent = !0, b.attachEvent && (b.attachEvent("onclick", function () { k.noCloneEvent = !1 }), b.cloneNode(!0).click()), null == k.deleteExpando) { k.deleteExpando = !0; try { delete b.test } catch (d) { k.deleteExpando = !1 } } }(), function () { var b, c, d = y.createElement("div"); for (b in { submit: !0, change: !0, focusin: !0 }) c = "on" + b, (k[b + "Bubbles"] = c in a) || (d.setAttribute(c, "t"), k[b + "Bubbles"] = d.attributes[c].expando === !1); d = null }(); var X = /^(?:input|select|textarea)$/i, Y = /^key/, Z = /^(?:mouse|pointer|contextmenu)|click/, $ = /^(?:focusinfocus|focusoutblur)$/, _ = /^([^.]*)(?:\.(.+)|)$/; function ab() { return !0 } function bb() { return !1 } function cb() { try { return y.activeElement } catch (a) { } } m.event = { global: {}, add: function (a, b, c, d, e) { var f, g, h, i, j, k, l, n, o, p, q, r = m._data(a); if (r) { c.handler && (i = c, c = i.handler, e = i.selector), c.guid || (c.guid = m.guid++), (g = r.events) || (g = r.events = {}), (k = r.handle) || (k = r.handle = function (a) { return typeof m === K || a && m.event.triggered === a.type ? void 0 : m.event.dispatch.apply(k.elem, arguments) }, k.elem = a), b = (b || "").match(E) || [""], h = b.length; while (h--) f = _.exec(b[h]) || [], o = q = f[1], p = (f[2] || "").split(".").sort(), o && (j = m.event.special[o] || {}, o = (e ? j.delegateType : j.bindType) || o, j = m.event.special[o] || {}, l = m.extend({ type: o, origType: q, data: d, handler: c, guid: c.guid, selector: e, needsContext: e && m.expr.match.needsContext.test(e), namespace: p.join(".") }, i), (n = g[o]) || (n = g[o] = [], n.delegateCount = 0, j.setup && j.setup.call(a, d, p, k) !== !1 || (a.addEventListener ? a.addEventListener(o, k, !1) : a.attachEvent && a.attachEvent("on" + o, k))), j.add && (j.add.call(a, l), l.handler.guid || (l.handler.guid = c.guid)), e ? n.splice(n.delegateCount++, 0, l) : n.push(l), m.event.global[o] = !0); a = null } }, remove: function (a, b, c, d, e) { var f, g, h, i, j, k, l, n, o, p, q, r = m.hasData(a) && m._data(a); if (r && (k = r.events)) { b = (b || "").match(E) || [""], j = b.length; while (j--) if (h = _.exec(b[j]) || [], o = q = h[1], p = (h[2] || "").split(".").sort(), o) { l = m.event.special[o] || {}, o = (d ? l.delegateType : l.bindType) || o, n = k[o] || [], h = h[2] && new RegExp("(^|\\.)" + p.join("\\.(?:.*\\.|)") + "(\\.|$)"), i = f = n.length; while (f--) g = n[f], !e && q !== g.origType || c && c.guid !== g.guid || h && !h.test(g.namespace) || d && d !== g.selector && ("**" !== d || !g.selector) || (n.splice(f, 1), g.selector && n.delegateCount--, l.remove && l.remove.call(a, g)); i && !n.length && (l.teardown && l.teardown.call(a, p, r.handle) !== !1 || m.removeEvent(a, o, r.handle), delete k[o]) } else for (o in k) m.event.remove(a, o + b[j], c, d, !0); m.isEmptyObject(k) && (delete r.handle, m._removeData(a, "events")) } }, trigger: function (b, c, d, e) { var f, g, h, i, k, l, n, o = [d || y], p = j.call(b, "type") ? b.type : b, q = j.call(b, "namespace") ? b.namespace.split(".") : []; if (h = l = d = d || y, 3 !== d.nodeType && 8 !== d.nodeType && !$.test(p + m.event.triggered) && (p.indexOf(".") >= 0 && (q = p.split("."), p = q.shift(), q.sort()), g = p.indexOf(":") < 0 && "on" + p, b = b[m.expando] ? b : new m.Event(p, "object" == typeof b && b), b.isTrigger = e ? 2 : 3, b.namespace = q.join("."), b.namespace_re = b.namespace ? new RegExp("(^|\\.)" + q.join("\\.(?:.*\\.|)") + "(\\.|$)") : null, b.result = void 0, b.target || (b.target = d), c = null == c ? [b] : m.makeArray(c, [b]), k = m.event.special[p] || {}, e || !k.trigger || k.trigger.apply(d, c) !== !1)) { if (!e && !k.noBubble && !m.isWindow(d)) { for (i = k.delegateType || p, $.test(i + p) || (h = h.parentNode) ; h; h = h.parentNode) o.push(h), l = h; l === (d.ownerDocument || y) && o.push(l.defaultView || l.parentWindow || a) } n = 0; while ((h = o[n++]) && !b.isPropagationStopped()) b.type = n > 1 ? i : k.bindType || p, f = (m._data(h, "events") || {})[b.type] && m._data(h, "handle"), f && f.apply(h, c), f = g && h[g], f && f.apply && m.acceptData(h) && (b.result = f.apply(h, c), b.result === !1 && b.preventDefault()); if (b.type = p, !e && !b.isDefaultPrevented() && (!k._default || k._default.apply(o.pop(), c) === !1) && m.acceptData(d) && g && d[p] && !m.isWindow(d)) { l = d[g], l && (d[g] = null), m.event.triggered = p; try { d[p]() } catch (r) { } m.event.triggered = void 0, l && (d[g] = l) } return b.result } }, dispatch: function (a) { a = m.event.fix(a); var b, c, e, f, g, h = [], i = d.call(arguments), j = (m._data(this, "events") || {})[a.type] || [], k = m.event.special[a.type] || {}; if (i[0] = a, a.delegateTarget = this, !k.preDispatch || k.preDispatch.call(this, a) !== !1) { h = m.event.handlers.call(this, a, j), b = 0; while ((f = h[b++]) && !a.isPropagationStopped()) { a.currentTarget = f.elem, g = 0; while ((e = f.handlers[g++]) && !a.isImmediatePropagationStopped()) (!a.namespace_re || a.namespace_re.test(e.namespace)) && (a.handleObj = e, a.data = e.data, c = ((m.event.special[e.origType] || {}).handle || e.handler).apply(f.elem, i), void 0 !== c && (a.result = c) === !1 && (a.preventDefault(), a.stopPropagation())) } return k.postDispatch && k.postDispatch.call(this, a), a.result } }, handlers: function (a, b) { var c, d, e, f, g = [], h = b.delegateCount, i = a.target; if (h && i.nodeType && (!a.button || "click" !== a.type)) for (; i != this; i = i.parentNode || this) if (1 === i.nodeType && (i.disabled !== !0 || "click" !== a.type)) { for (e = [], f = 0; h > f; f++) d = b[f], c = d.selector + " ", void 0 === e[c] && (e[c] = d.needsContext ? m(c, this).index(i) >= 0 : m.find(c, this, null, [i]).length), e[c] && e.push(d); e.length && g.push({ elem: i, handlers: e }) } return h < b.length && g.push({ elem: this, handlers: b.slice(h) }), g }, fix: function (a) { if (a[m.expando]) return a; var b, c, d, e = a.type, f = a, g = this.fixHooks[e]; g || (this.fixHooks[e] = g = Z.test(e) ? this.mouseHooks : Y.test(e) ? this.keyHooks : {}), d = g.props ? this.props.concat(g.props) : this.props, a = new m.Event(f), b = d.length; while (b--) c = d[b], a[c] = f[c]; return a.target || (a.target = f.srcElement || y), 3 === a.target.nodeType && (a.target = a.target.parentNode), a.metaKey = !!a.metaKey, g.filter ? g.filter(a, f) : a }, props: "altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "), fixHooks: {}, keyHooks: { props: "char charCode key keyCode".split(" "), filter: function (a, b) { return null == a.which && (a.which = null != b.charCode ? b.charCode : b.keyCode), a } }, mouseHooks: { props: "button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement".split(" "), filter: function (a, b) { var c, d, e, f = b.button, g = b.fromElement; return null == a.pageX && null != b.clientX && (d = a.target.ownerDocument || y, e = d.documentElement, c = d.body, a.pageX = b.clientX + (e && e.scrollLeft || c && c.scrollLeft || 0) - (e && e.clientLeft || c && c.clientLeft || 0), a.pageY = b.clientY + (e && e.scrollTop || c && c.scrollTop || 0) - (e && e.clientTop || c && c.clientTop || 0)), !a.relatedTarget && g && (a.relatedTarget = g === a.target ? b.toElement : g), a.which || void 0 === f || (a.which = 1 & f ? 1 : 2 & f ? 3 : 4 & f ? 2 : 0), a } }, special: { load: { noBubble: !0 }, focus: { trigger: function () { if (this !== cb() && this.focus) try { return this.focus(), !1 } catch (a) { } }, delegateType: "focusin" }, blur: { trigger: function () { return this === cb() && this.blur ? (this.blur(), !1) : void 0 }, delegateType: "focusout" }, click: { trigger: function () { return m.nodeName(this, "input") && "checkbox" === this.type && this.click ? (this.click(), !1) : void 0 }, _default: function (a) { return m.nodeName(a.target, "a") } }, beforeunload: { postDispatch: function (a) { void 0 !== a.result && a.originalEvent && (a.originalEvent.returnValue = a.result) } } }, simulate: function (a, b, c, d) { var e = m.extend(new m.Event, c, { type: a, isSimulated: !0, originalEvent: {} }); d ? m.event.trigger(e, null, b) : m.event.dispatch.call(b, e), e.isDefaultPrevented() && c.preventDefault() } }, m.removeEvent = y.removeEventListener ? function (a, b, c) { a.removeEventListener && a.removeEventListener(b, c, !1) } : function (a, b, c) { var d = "on" + b; a.detachEvent && (typeof a[d] === K && (a[d] = null), a.detachEvent(d, c)) }, m.Event = function (a, b) { return this instanceof m.Event ? (a && a.type ? (this.originalEvent = a, this.type = a.type, this.isDefaultPrevented = a.defaultPrevented || void 0 === a.defaultPrevented && a.returnValue === !1 ? ab : bb) : this.type = a, b && m.extend(this, b), this.timeStamp = a && a.timeStamp || m.now(), void (this[m.expando] = !0)) : new m.Event(a, b) }, m.Event.prototype = { isDefaultPrevented: bb, isPropagationStopped: bb, isImmediatePropagationStopped: bb, preventDefault: function () { var a = this.originalEvent; this.isDefaultPrevented = ab, a && (a.preventDefault ? a.preventDefault() : a.returnValue = !1) }, stopPropagation: function () { var a = this.originalEvent; this.isPropagationStopped = ab, a && (a.stopPropagation && a.stopPropagation(), a.cancelBubble = !0) }, stopImmediatePropagation: function () { var a = this.originalEvent; this.isImmediatePropagationStopped = ab, a && a.stopImmediatePropagation && a.stopImmediatePropagation(), this.stopPropagation() } }, m.each({ mouseenter: "mouseover", mouseleave: "mouseout", pointerenter: "pointerover", pointerleave: "pointerout" }, function (a, b) { m.event.special[a] = { delegateType: b, bindType: b, handle: function (a) { var c, d = this, e = a.relatedTarget, f = a.handleObj; return (!e || e !== d && !m.contains(d, e)) && (a.type = f.origType, c = f.handler.apply(this, arguments), a.type = b), c } } }), k.submitBubbles || (m.event.special.submit = { setup: function () { return m.nodeName(this, "form") ? !1 : void m.event.add(this, "click._submit keypress._submit", function (a) { var b = a.target, c = m.nodeName(b, "input") || m.nodeName(b, "button") ? b.form : void 0; c && !m._data(c, "submitBubbles") && (m.event.add(c, "submit._submit", function (a) { a._submit_bubble = !0 }), m._data(c, "submitBubbles", !0)) }) }, postDispatch: function (a) { a._submit_bubble && (delete a._submit_bubble, this.parentNode && !a.isTrigger && m.event.simulate("submit", this.parentNode, a, !0)) }, teardown: function () { return m.nodeName(this, "form") ? !1 : void m.event.remove(this, "._submit") } }), k.changeBubbles || (m.event.special.change = { setup: function () { return X.test(this.nodeName) ? (("checkbox" === this.type || "radio" === this.type) && (m.event.add(this, "propertychange._change", function (a) { "checked" === a.originalEvent.propertyName && (this._just_changed = !0) }), m.event.add(this, "click._change", function (a) { this._just_changed && !a.isTrigger && (this._just_changed = !1), m.event.simulate("change", this, a, !0) })), !1) : void m.event.add(this, "beforeactivate._change", function (a) { var b = a.target; X.test(b.nodeName) && !m._data(b, "changeBubbles") && (m.event.add(b, "change._change", function (a) { !this.parentNode || a.isSimulated || a.isTrigger || m.event.simulate("change", this.parentNode, a, !0) }), m._data(b, "changeBubbles", !0)) }) }, handle: function (a) { var b = a.target; return this !== b || a.isSimulated || a.isTrigger || "radio" !== b.type && "checkbox" !== b.type ? a.handleObj.handler.apply(this, arguments) : void 0 }, teardown: function () { return m.event.remove(this, "._change"), !X.test(this.nodeName) } }), k.focusinBubbles || m.each({ focus: "focusin", blur: "focusout" }, function (a, b) { var c = function (a) { m.event.simulate(b, a.target, m.event.fix(a), !0) }; m.event.special[b] = { setup: function () { var d = this.ownerDocument || this, e = m._data(d, b); e || d.addEventListener(a, c, !0), m._data(d, b, (e || 0) + 1) }, teardown: function () { var d = this.ownerDocument || this, e = m._data(d, b) - 1; e ? m._data(d, b, e) : (d.removeEventListener(a, c, !0), m._removeData(d, b)) } } }), m.fn.extend({ on: function (a, b, c, d, e) { var f, g; if ("object" == typeof a) { "string" != typeof b && (c = c || b, b = void 0); for (f in a) this.on(f, b, c, a[f], e); return this } if (null == c && null == d ? (d = b, c = b = void 0) : null == d && ("string" == typeof b ? (d = c, c = void 0) : (d = c, c = b, b = void 0)), d === !1) d = bb; else if (!d) return this; return 1 === e && (g = d, d = function (a) { return m().off(a), g.apply(this, arguments) }, d.guid = g.guid || (g.guid = m.guid++)), this.each(function () { m.event.add(this, a, d, c, b) }) }, one: function (a, b, c, d) { return this.on(a, b, c, d, 1) }, off: function (a, b, c) { var d, e; if (a && a.preventDefault && a.handleObj) return d = a.handleObj, m(a.delegateTarget).off(d.namespace ? d.origType + "." + d.namespace : d.origType, d.selector, d.handler), this; if ("object" == typeof a) { for (e in a) this.off(e, b, a[e]); return this } return (b === !1 || "function" == typeof b) && (c = b, b = void 0), c === !1 && (c = bb), this.each(function () { m.event.remove(this, a, c, b) }) }, trigger: function (a, b) { return this.each(function () { m.event.trigger(a, b, this) }) }, triggerHandler: function (a, b) { var c = this[0]; return c ? m.event.trigger(a, b, c, !0) : void 0 } }); function db(a) { var b = eb.split("|"), c = a.createDocumentFragment(); if (c.createElement) while (b.length) c.createElement(b.pop()); return c } var eb = "abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video", fb = / jQuery\d+="(?:null|\d+)"/g, gb = new RegExp("<(?:" + eb + ")[\\s/>]", "i"), hb = /^\s+/, ib = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi, jb = /<([\w:]+)/, kb = /<tbody/i, lb = /<|&#?\w+;/, mb = /<(?:script|style|link)/i, nb = /checked\s*(?:[^=]|=\s*.checked.)/i, ob = /^$|\/(?:java|ecma)script/i, pb = /^true\/(.*)/, qb = /^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g, rb = { option: [1, "<select multiple='multiple'>", "</select>"], legend: [1, "<fieldset>", "</fieldset>"], area: [1, "<map>", "</map>"], param: [1, "<object>", "</object>"], thead: [1, "<table>", "</table>"], tr: [2, "<table><tbody>", "</tbody></table>"], col: [2, "<table><tbody></tbody><colgroup>", "</colgroup></table>"], td: [3, "<table><tbody><tr>", "</tr></tbody></table>"], _default: k.htmlSerialize ? [0, "", ""] : [1, "X<div>", "</div>"] }, sb = db(y), tb = sb.appendChild(y.createElement("div")); rb.optgroup = rb.option, rb.tbody = rb.tfoot = rb.colgroup = rb.caption = rb.thead, rb.th = rb.td; function ub(a, b) { var c, d, e = 0, f = typeof a.getElementsByTagName !== K ? a.getElementsByTagName(b || "*") : typeof a.querySelectorAll !== K ? a.querySelectorAll(b || "*") : void 0; if (!f) for (f = [], c = a.childNodes || a; null != (d = c[e]) ; e++) !b || m.nodeName(d, b) ? f.push(d) : m.merge(f, ub(d, b)); return void 0 === b || b && m.nodeName(a, b) ? m.merge([a], f) : f } function vb(a) { W.test(a.type) && (a.defaultChecked = a.checked) } function wb(a, b) { return m.nodeName(a, "table") && m.nodeName(11 !== b.nodeType ? b : b.firstChild, "tr") ? a.getElementsByTagName("tbody")[0] || a.appendChild(a.ownerDocument.createElement("tbody")) : a } function xb(a) { return a.type = (null !== m.find.attr(a, "type")) + "/" + a.type, a } function yb(a) { var b = pb.exec(a.type); return b ? a.type = b[1] : a.removeAttribute("type"), a } function zb(a, b) { for (var c, d = 0; null != (c = a[d]) ; d++) m._data(c, "globalEval", !b || m._data(b[d], "globalEval")) } function Ab(a, b) { if (1 === b.nodeType && m.hasData(a)) { var c, d, e, f = m._data(a), g = m._data(b, f), h = f.events; if (h) { delete g.handle, g.events = {}; for (c in h) for (d = 0, e = h[c].length; e > d; d++) m.event.add(b, c, h[c][d]) } g.data && (g.data = m.extend({}, g.data)) } } function Bb(a, b) { var c, d, e; if (1 === b.nodeType) { if (c = b.nodeName.toLowerCase(), !k.noCloneEvent && b[m.expando]) { e = m._data(b); for (d in e.events) m.removeEvent(b, d, e.handle); b.removeAttribute(m.expando) } "script" === c && b.text !== a.text ? (xb(b).text = a.text, yb(b)) : "object" === c ? (b.parentNode && (b.outerHTML = a.outerHTML), k.html5Clone && a.innerHTML && !m.trim(b.innerHTML) && (b.innerHTML = a.innerHTML)) : "input" === c && W.test(a.type) ? (b.defaultChecked = b.checked = a.checked, b.value !== a.value && (b.value = a.value)) : "option" === c ? b.defaultSelected = b.selected = a.defaultSelected : ("input" === c || "textarea" === c) && (b.defaultValue = a.defaultValue) } } m.extend({ clone: function (a, b, c) { var d, e, f, g, h, i = m.contains(a.ownerDocument, a); if (k.html5Clone || m.isXMLDoc(a) || !gb.test("<" + a.nodeName + ">") ? f = a.cloneNode(!0) : (tb.innerHTML = a.outerHTML, tb.removeChild(f = tb.firstChild)), !(k.noCloneEvent && k.noCloneChecked || 1 !== a.nodeType && 11 !== a.nodeType || m.isXMLDoc(a))) for (d = ub(f), h = ub(a), g = 0; null != (e = h[g]) ; ++g) d[g] && Bb(e, d[g]); if (b) if (c) for (h = h || ub(a), d = d || ub(f), g = 0; null != (e = h[g]) ; g++) Ab(e, d[g]); else Ab(a, f); return d = ub(f, "script"), d.length > 0 && zb(d, !i && ub(a, "script")), d = h = e = null, f }, buildFragment: function (a, b, c, d) { for (var e, f, g, h, i, j, l, n = a.length, o = db(b), p = [], q = 0; n > q; q++) if (f = a[q], f || 0 === f) if ("object" === m.type(f)) m.merge(p, f.nodeType ? [f] : f); else if (lb.test(f)) { h = h || o.appendChild(b.createElement("div")), i = (jb.exec(f) || ["", ""])[1].toLowerCase(), l = rb[i] || rb._default, h.innerHTML = l[1] + f.replace(ib, "<$1></$2>") + l[2], e = l[0]; while (e--) h = h.lastChild; if (!k.leadingWhitespace && hb.test(f) && p.push(b.createTextNode(hb.exec(f)[0])), !k.tbody) { f = "table" !== i || kb.test(f) ? "<table>" !== l[1] || kb.test(f) ? 0 : h : h.firstChild, e = f && f.childNodes.length; while (e--) m.nodeName(j = f.childNodes[e], "tbody") && !j.childNodes.length && f.removeChild(j) } m.merge(p, h.childNodes), h.textContent = ""; while (h.firstChild) h.removeChild(h.firstChild); h = o.lastChild } else p.push(b.createTextNode(f)); h && o.removeChild(h), k.appendChecked || m.grep(ub(p, "input"), vb), q = 0; while (f = p[q++]) if ((!d || -1 === m.inArray(f, d)) && (g = m.contains(f.ownerDocument, f), h = ub(o.appendChild(f), "script"), g && zb(h), c)) { e = 0; while (f = h[e++]) ob.test(f.type || "") && c.push(f) } return h = null, o }, cleanData: function (a, b) { for (var d, e, f, g, h = 0, i = m.expando, j = m.cache, l = k.deleteExpando, n = m.event.special; null != (d = a[h]) ; h++) if ((b || m.acceptData(d)) && (f = d[i], g = f && j[f])) { if (g.events) for (e in g.events) n[e] ? m.event.remove(d, e) : m.removeEvent(d, e, g.handle); j[f] && (delete j[f], l ? delete d[i] : typeof d.removeAttribute !== K ? d.removeAttribute(i) : d[i] = null, c.push(f)) } } }), m.fn.extend({ text: function (a) { return V(this, function (a) { return void 0 === a ? m.text(this) : this.empty().append((this[0] && this[0].ownerDocument || y).createTextNode(a)) }, null, a, arguments.length) }, append: function () { return this.domManip(arguments, function (a) { if (1 === this.nodeType || 11 === this.nodeType || 9 === this.nodeType) { var b = wb(this, a); b.appendChild(a) } }) }, prepend: function () { return this.domManip(arguments, function (a) { if (1 === this.nodeType || 11 === this.nodeType || 9 === this.nodeType) { var b = wb(this, a); b.insertBefore(a, b.firstChild) } }) }, before: function () { return this.domManip(arguments, function (a) { this.parentNode && this.parentNode.insertBefore(a, this) }) }, after: function () { return this.domManip(arguments, function (a) { this.parentNode && this.parentNode.insertBefore(a, this.nextSibling) }) }, remove: function (a, b) { for (var c, d = a ? m.filter(a, this) : this, e = 0; null != (c = d[e]) ; e++) b || 1 !== c.nodeType || m.cleanData(ub(c)), c.parentNode && (b && m.contains(c.ownerDocument, c) && zb(ub(c, "script")), c.parentNode.removeChild(c)); return this }, empty: function () { for (var a, b = 0; null != (a = this[b]) ; b++) { 1 === a.nodeType && m.cleanData(ub(a, !1)); while (a.firstChild) a.removeChild(a.firstChild); a.options && m.nodeName(a, "select") && (a.options.length = 0) } return this }, clone: function (a, b) { return a = null == a ? !1 : a, b = null == b ? a : b, this.map(function () { return m.clone(this, a, b) }) }, html: function (a) { return V(this, function (a) { var b = this[0] || {}, c = 0, d = this.length; if (void 0 === a) return 1 === b.nodeType ? b.innerHTML.replace(fb, "") : void 0; if (!("string" != typeof a || mb.test(a) || !k.htmlSerialize && gb.test(a) || !k.leadingWhitespace && hb.test(a) || rb[(jb.exec(a) || ["", ""])[1].toLowerCase()])) { a = a.replace(ib, "<$1></$2>"); try { for (; d > c; c++) b = this[c] || {}, 1 === b.nodeType && (m.cleanData(ub(b, !1)), b.innerHTML = a); b = 0 } catch (e) { } } b && this.empty().append(a) }, null, a, arguments.length) }, replaceWith: function () { var a = arguments[0]; return this.domManip(arguments, function (b) { a = this.parentNode, m.cleanData(ub(this)), a && a.replaceChild(b, this) }), a && (a.length || a.nodeType) ? this : this.remove() }, detach: function (a) { return this.remove(a, !0) }, domManip: function (a, b) { a = e.apply([], a); var c, d, f, g, h, i, j = 0, l = this.length, n = this, o = l - 1, p = a[0], q = m.isFunction(p); if (q || l > 1 && "string" == typeof p && !k.checkClone && nb.test(p)) return this.each(function (c) { var d = n.eq(c); q && (a[0] = p.call(this, c, d.html())), d.domManip(a, b) }); if (l && (i = m.buildFragment(a, this[0].ownerDocument, !1, this), c = i.firstChild, 1 === i.childNodes.length && (i = c), c)) { for (g = m.map(ub(i, "script"), xb), f = g.length; l > j; j++) d = i, j !== o && (d = m.clone(d, !0, !0), f && m.merge(g, ub(d, "script"))), b.call(this[j], d, j); if (f) for (h = g[g.length - 1].ownerDocument, m.map(g, yb), j = 0; f > j; j++) d = g[j], ob.test(d.type || "") && !m._data(d, "globalEval") && m.contains(h, d) && (d.src ? m._evalUrl && m._evalUrl(d.src) : m.globalEval((d.text || d.textContent || d.innerHTML || "").replace(qb, ""))); i = c = null } return this } }), m.each({ appendTo: "append", prependTo: "prepend", insertBefore: "before", insertAfter: "after", replaceAll: "replaceWith" }, function (a, b) { m.fn[a] = function (a) { for (var c, d = 0, e = [], g = m(a), h = g.length - 1; h >= d; d++) c = d === h ? this : this.clone(!0), m(g[d])[b](c), f.apply(e, c.get()); return this.pushStack(e) } }); var Cb, Db = {}; function Eb(b, c) { var d, e = m(c.createElement(b)).appendTo(c.body), f = a.getDefaultComputedStyle && (d = a.getDefaultComputedStyle(e[0])) ? d.display : m.css(e[0], "display"); return e.detach(), f } function Fb(a) { var b = y, c = Db[a]; return c || (c = Eb(a, b), "none" !== c && c || (Cb = (Cb || m("<iframe frameborder='0' width='0' height='0'/>")).appendTo(b.documentElement), b = (Cb[0].contentWindow || Cb[0].contentDocument).document, b.write(), b.close(), c = Eb(a, b), Cb.detach()), Db[a] = c), c } !function () { var a; k.shrinkWrapBlocks = function () { if (null != a) return a; a = !1; var b, c, d; return c = y.getElementsByTagName("body")[0], c && c.style ? (b = y.createElement("div"), d = y.createElement("div"), d.style.cssText = "position:absolute;border:0;width:0;height:0;top:0;left:-9999px", c.appendChild(d).appendChild(b), typeof b.style.zoom !== K && (b.style.cssText = "-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;display:block;margin:0;border:0;padding:1px;width:1px;zoom:1", b.appendChild(y.createElement("div")).style.width = "5px", a = 3 !== b.offsetWidth), c.removeChild(d), a) : void 0 } }(); var Gb = /^margin/, Hb = new RegExp("^(" + S + ")(?!px)[a-z%]+$", "i"), Ib, Jb, Kb = /^(top|right|bottom|left)$/; a.getComputedStyle ? (Ib = function (a) { return a.ownerDocument.defaultView.getComputedStyle(a, null) }, Jb = function (a, b, c) { var d, e, f, g, h = a.style; return c = c || Ib(a), g = c ? c.getPropertyValue(b) || c[b] : void 0, c && ("" !== g || m.contains(a.ownerDocument, a) || (g = m.style(a, b)), Hb.test(g) && Gb.test(b) && (d = h.width, e = h.minWidth, f = h.maxWidth, h.minWidth = h.maxWidth = h.width = g, g = c.width, h.width = d, h.minWidth = e, h.maxWidth = f)), void 0 === g ? g : g + "" }) : y.documentElement.currentStyle && (Ib = function (a) { return a.currentStyle }, Jb = function (a, b, c) { var d, e, f, g, h = a.style; return c = c || Ib(a), g = c ? c[b] : void 0, null == g && h && h[b] && (g = h[b]), Hb.test(g) && !Kb.test(b) && (d = h.left, e = a.runtimeStyle, f = e && e.left, f && (e.left = a.currentStyle.left), h.left = "fontSize" === b ? "1em" : g, g = h.pixelLeft + "px", h.left = d, f && (e.left = f)), void 0 === g ? g : g + "" || "auto" }); function Lb(a, b) { return { get: function () { var c = a(); if (null != c) return c ? void delete this.get : (this.get = b).apply(this, arguments) } } } !function () { var b, c, d, e, f, g, h; if (b = y.createElement("div"), b.innerHTML = "  <link/><table></table><a href='/a'>a</a><input type='checkbox'/>", d = b.getElementsByTagName("a")[0], c = d && d.style) { c.cssText = "float:left;opacity:.5", k.opacity = "0.5" === c.opacity, k.cssFloat = !!c.cssFloat, b.style.backgroundClip = "content-box", b.cloneNode(!0).style.backgroundClip = "", k.clearCloneStyle = "content-box" === b.style.backgroundClip, k.boxSizing = "" === c.boxSizing || "" === c.MozBoxSizing || "" === c.WebkitBoxSizing, m.extend(k, { reliableHiddenOffsets: function () { return null == g && i(), g }, boxSizingReliable: function () { return null == f && i(), f }, pixelPosition: function () { return null == e && i(), e }, reliableMarginRight: function () { return null == h && i(), h } }); function i() { var b, c, d, i; c = y.getElementsByTagName("body")[0], c && c.style && (b = y.createElement("div"), d = y.createElement("div"), d.style.cssText = "position:absolute;border:0;width:0;height:0;top:0;left:-9999px", c.appendChild(d).appendChild(b), b.style.cssText = "-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;display:block;margin-top:1%;top:1%;border:1px;padding:1px;width:4px;position:absolute", e = f = !1, h = !0, a.getComputedStyle && (e = "1%" !== (a.getComputedStyle(b, null) || {}).top, f = "4px" === (a.getComputedStyle(b, null) || { width: "4px" }).width, i = b.appendChild(y.createElement("div")), i.style.cssText = b.style.cssText = "-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;display:block;margin:0;border:0;padding:0", i.style.marginRight = i.style.width = "0", b.style.width = "1px", h = !parseFloat((a.getComputedStyle(i, null) || {}).marginRight)), b.innerHTML = "<table><tr><td></td><td>t</td></tr></table>", i = b.getElementsByTagName("td"), i[0].style.cssText = "margin:0;border:0;padding:0;display:none", g = 0 === i[0].offsetHeight, g && (i[0].style.display = "", i[1].style.display = "none", g = 0 === i[0].offsetHeight), c.removeChild(d)) } } }(), m.swap = function (a, b, c, d) { var e, f, g = {}; for (f in b) g[f] = a.style[f], a.style[f] = b[f]; e = c.apply(a, d || []); for (f in b) a.style[f] = g[f]; return e }; var Mb = /alpha\([^)]*\)/i, Nb = /opacity\s*=\s*([^)]*)/, Ob = /^(none|table(?!-c[ea]).+)/, Pb = new RegExp("^(" + S + ")(.*)$", "i"), Qb = new RegExp("^([+-])=(" + S + ")", "i"), Rb = { position: "absolute", visibility: "hidden", display: "block" }, Sb = { letterSpacing: "0", fontWeight: "400" }, Tb = ["Webkit", "O", "Moz", "ms"]; function Ub(a, b) { if (b in a) return b; var c = b.charAt(0).toUpperCase() + b.slice(1), d = b, e = Tb.length; while (e--) if (b = Tb[e] + c, b in a) return b; return d } function Vb(a, b) { for (var c, d, e, f = [], g = 0, h = a.length; h > g; g++) d = a[g], d.style && (f[g] = m._data(d, "olddisplay"), c = d.style.display, b ? (f[g] || "none" !== c || (d.style.display = ""), "" === d.style.display && U(d) && (f[g] = m._data(d, "olddisplay", Fb(d.nodeName)))) : (e = U(d), (c && "none" !== c || !e) && m._data(d, "olddisplay", e ? c : m.css(d, "display")))); for (g = 0; h > g; g++) d = a[g], d.style && (b && "none" !== d.style.display && "" !== d.style.display || (d.style.display = b ? f[g] || "" : "none")); return a } function Wb(a, b, c) { var d = Pb.exec(b); return d ? Math.max(0, d[1] - (c || 0)) + (d[2] || "px") : b } function Xb(a, b, c, d, e) { for (var f = c === (d ? "border" : "content") ? 4 : "width" === b ? 1 : 0, g = 0; 4 > f; f += 2) "margin" === c && (g += m.css(a, c + T[f], !0, e)), d ? ("content" === c && (g -= m.css(a, "padding" + T[f], !0, e)), "margin" !== c && (g -= m.css(a, "border" + T[f] + "Width", !0, e))) : (g += m.css(a, "padding" + T[f], !0, e), "padding" !== c && (g += m.css(a, "border" + T[f] + "Width", !0, e))); return g } function Yb(a, b, c) { var d = !0, e = "width" === b ? a.offsetWidth : a.offsetHeight, f = Ib(a), g = k.boxSizing && "border-box" === m.css(a, "boxSizing", !1, f); if (0 >= e || null == e) { if (e = Jb(a, b, f), (0 > e || null == e) && (e = a.style[b]), Hb.test(e)) return e; d = g && (k.boxSizingReliable() || e === a.style[b]), e = parseFloat(e) || 0 } return e + Xb(a, b, c || (g ? "border" : "content"), d, f) + "px" } m.extend({ cssHooks: { opacity: { get: function (a, b) { if (b) { var c = Jb(a, "opacity"); return "" === c ? "1" : c } } } }, cssNumber: { columnCount: !0, fillOpacity: !0, flexGrow: !0, flexShrink: !0, fontWeight: !0, lineHeight: !0, opacity: !0, order: !0, orphans: !0, widows: !0, zIndex: !0, zoom: !0 }, cssProps: { "float": k.cssFloat ? "cssFloat" : "styleFloat" }, style: function (a, b, c, d) { if (a && 3 !== a.nodeType && 8 !== a.nodeType && a.style) { var e, f, g, h = m.camelCase(b), i = a.style; if (b = m.cssProps[h] || (m.cssProps[h] = Ub(i, h)), g = m.cssHooks[b] || m.cssHooks[h], void 0 === c) return g && "get" in g && void 0 !== (e = g.get(a, !1, d)) ? e : i[b]; if (f = typeof c, "string" === f && (e = Qb.exec(c)) && (c = (e[1] + 1) * e[2] + parseFloat(m.css(a, b)), f = "number"), null != c && c === c && ("number" !== f || m.cssNumber[h] || (c += "px"), k.clearCloneStyle || "" !== c || 0 !== b.indexOf("background") || (i[b] = "inherit"), !(g && "set" in g && void 0 === (c = g.set(a, c, d))))) try { i[b] = c } catch (j) { } } }, css: function (a, b, c, d) { var e, f, g, h = m.camelCase(b); return b = m.cssProps[h] || (m.cssProps[h] = Ub(a.style, h)), g = m.cssHooks[b] || m.cssHooks[h], g && "get" in g && (f = g.get(a, !0, c)), void 0 === f && (f = Jb(a, b, d)), "normal" === f && b in Sb && (f = Sb[b]), "" === c || c ? (e = parseFloat(f), c === !0 || m.isNumeric(e) ? e || 0 : f) : f } }), m.each(["height", "width"], function (a, b) { m.cssHooks[b] = { get: function (a, c, d) { return c ? Ob.test(m.css(a, "display")) && 0 === a.offsetWidth ? m.swap(a, Rb, function () { return Yb(a, b, d) }) : Yb(a, b, d) : void 0 }, set: function (a, c, d) { var e = d && Ib(a); return Wb(a, c, d ? Xb(a, b, d, k.boxSizing && "border-box" === m.css(a, "boxSizing", !1, e), e) : 0) } } }), k.opacity || (m.cssHooks.opacity = { get: function (a, b) { return Nb.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 = m.isNumeric(b) ? "alpha(opacity=" + 100 * b + ")" : "", f = d && d.filter || c.filter || ""; c.zoom = 1, (b >= 1 || "" === b) && "" === m.trim(f.replace(Mb, "")) && c.removeAttribute && (c.removeAttribute("filter"), "" === b || d && !d.filter) || (c.filter = Mb.test(f) ? f.replace(Mb, e) : f + " " + e) } }), m.cssHooks.marginRight = Lb(k.reliableMarginRight, function (a, b) { return b ? m.swap(a, { display: "inline-block" }, Jb, [a, "marginRight"]) : void 0 }), m.each({ margin: "", padding: "", border: "Width" }, function (a, b) { m.cssHooks[a + b] = { expand: function (c) { for (var d = 0, e = {}, f = "string" == typeof c ? c.split(" ") : [c]; 4 > d; d++) e[a + T[d] + b] = f[d] || f[d - 2] || f[0]; return e } }, Gb.test(a) || (m.cssHooks[a + b].set = Wb) }), m.fn.extend({ css: function (a, b) { return V(this, function (a, b, c) { var d, e, f = {}, g = 0; if (m.isArray(b)) { for (d = Ib(a), e = b.length; e > g; g++) f[b[g]] = m.css(a, b[g], !1, d); return f } return void 0 !== c ? m.style(a, b, c) : m.css(a, b) }, a, b, arguments.length > 1) }, show: function () { return Vb(this, !0) }, hide: function () { return Vb(this) }, toggle: function (a) { return "boolean" == typeof a ? a ? this.show() : this.hide() : this.each(function () { U(this) ? m(this).show() : m(this).hide() }) } }); function Zb(a, b, c, d, e) { return new Zb.prototype.init(a, b, c, d, e) } m.Tween = Zb, Zb.prototype = {
        constructor: Zb, init: function (a, b, c, d, e, f) {
            this.elem = a, this.prop = c, this.easing = e || "swing", this.options = b, this.start = this.now = this.cur(), this.end = d, this.unit = f || (m.cssNumber[c] ? "" : "px")
        }, cur: function () { var a = Zb.propHooks[this.prop]; return a && a.get ? a.get(this) : Zb.propHooks._default.get(this) }, run: function (a) { var b, c = Zb.propHooks[this.prop]; return this.pos = b = this.options.duration ? m.easing[this.easing](a, this.options.duration * a, 0, 1, this.options.duration) : a, this.now = (this.end - this.start) * b + this.start, this.options.step && this.options.step.call(this.elem, this.now, this), c && c.set ? c.set(this) : Zb.propHooks._default.set(this), this }
    }, Zb.prototype.init.prototype = Zb.prototype, Zb.propHooks = { _default: { get: function (a) { var b; return null == a.elem[a.prop] || a.elem.style && null != a.elem.style[a.prop] ? (b = m.css(a.elem, a.prop, ""), b && "auto" !== b ? b : 0) : a.elem[a.prop] }, set: function (a) { m.fx.step[a.prop] ? m.fx.step[a.prop](a) : a.elem.style && (null != a.elem.style[m.cssProps[a.prop]] || m.cssHooks[a.prop]) ? m.style(a.elem, a.prop, a.now + a.unit) : a.elem[a.prop] = a.now } } }, Zb.propHooks.scrollTop = Zb.propHooks.scrollLeft = { set: function (a) { a.elem.nodeType && a.elem.parentNode && (a.elem[a.prop] = a.now) } }, m.easing = { linear: function (a) { return a }, swing: function (a) { return .5 - Math.cos(a * Math.PI) / 2 } }, m.fx = Zb.prototype.init, m.fx.step = {}; var $b, _b, ac = /^(?:toggle|show|hide)$/, bc = new RegExp("^(?:([+-])=|)(" + S + ")([a-z%]*)$", "i"), cc = /queueHooks$/, dc = [ic], ec = { "*": [function (a, b) { var c = this.createTween(a, b), d = c.cur(), e = bc.exec(b), f = e && e[3] || (m.cssNumber[a] ? "" : "px"), g = (m.cssNumber[a] || "px" !== f && +d) && bc.exec(m.css(c.elem, a)), h = 1, i = 20; if (g && g[3] !== f) { f = f || g[3], e = e || [], g = +d || 1; do h = h || ".5", g /= h, m.style(c.elem, a, g + f); while (h !== (h = c.cur() / d) && 1 !== h && --i) } return e && (g = c.start = +g || +d || 0, c.unit = f, c.end = e[1] ? g + (e[1] + 1) * e[2] : +e[2]), c }] }; function fc() { return setTimeout(function () { $b = void 0 }), $b = m.now() } function gc(a, b) { var c, d = { height: a }, e = 0; for (b = b ? 1 : 0; 4 > e; e += 2 - b) c = T[e], d["margin" + c] = d["padding" + c] = a; return b && (d.opacity = d.width = a), d } function hc(a, b, c) { for (var d, e = (ec[b] || []).concat(ec["*"]), f = 0, g = e.length; g > f; f++) if (d = e[f].call(c, b, a)) return d } function ic(a, b, c) { var d, e, f, g, h, i, j, l, n = this, o = {}, p = a.style, q = a.nodeType && U(a), r = m._data(a, "fxshow"); c.queue || (h = m._queueHooks(a, "fx"), null == h.unqueued && (h.unqueued = 0, i = h.empty.fire, h.empty.fire = function () { h.unqueued || i() }), h.unqueued++, n.always(function () { n.always(function () { h.unqueued--, m.queue(a, "fx").length || h.empty.fire() }) })), 1 === a.nodeType && ("height" in b || "width" in b) && (c.overflow = [p.overflow, p.overflowX, p.overflowY], j = m.css(a, "display"), l = "none" === j ? m._data(a, "olddisplay") || Fb(a.nodeName) : j, "inline" === l && "none" === m.css(a, "float") && (k.inlineBlockNeedsLayout && "inline" !== Fb(a.nodeName) ? p.zoom = 1 : p.display = "inline-block")), c.overflow && (p.overflow = "hidden", k.shrinkWrapBlocks() || n.always(function () { p.overflow = c.overflow[0], p.overflowX = c.overflow[1], p.overflowY = c.overflow[2] })); for (d in b) if (e = b[d], ac.exec(e)) { if (delete b[d], f = f || "toggle" === e, e === (q ? "hide" : "show")) { if ("show" !== e || !r || void 0 === r[d]) continue; q = !0 } o[d] = r && r[d] || m.style(a, d) } else j = void 0; if (m.isEmptyObject(o)) "inline" === ("none" === j ? Fb(a.nodeName) : j) && (p.display = j); else { r ? "hidden" in r && (q = r.hidden) : r = m._data(a, "fxshow", {}), f && (r.hidden = !q), q ? m(a).show() : n.done(function () { m(a).hide() }), n.done(function () { var b; m._removeData(a, "fxshow"); for (b in o) m.style(a, b, o[b]) }); for (d in o) g = hc(q ? r[d] : 0, d, n), d in r || (r[d] = g.start, q && (g.end = g.start, g.start = "width" === d || "height" === d ? 1 : 0)) } } function jc(a, b) { var c, d, e, f, g; for (c in a) if (d = m.camelCase(c), e = b[d], f = a[c], m.isArray(f) && (e = f[1], f = a[c] = f[0]), c !== d && (a[d] = f, delete a[c]), g = m.cssHooks[d], g && "expand" in g) { f = g.expand(f), delete a[d]; for (c in f) c in a || (a[c] = f[c], b[c] = e) } else b[d] = e } function kc(a, b, c) { var d, e, f = 0, g = dc.length, h = m.Deferred().always(function () { delete i.elem }), i = function () { if (e) return !1; for (var b = $b || fc(), c = Math.max(0, j.startTime + j.duration - b), d = c / j.duration || 0, f = 1 - d, g = 0, i = j.tweens.length; i > g; g++) j.tweens[g].run(f); return h.notifyWith(a, [j, f, c]), 1 > f && i ? c : (h.resolveWith(a, [j]), !1) }, j = h.promise({ elem: a, props: m.extend({}, b), opts: m.extend(!0, { specialEasing: {} }, c), originalProperties: b, originalOptions: c, startTime: $b || fc(), duration: c.duration, tweens: [], createTween: function (b, c) { var d = m.Tween(a, j.opts, b, c, j.opts.specialEasing[b] || j.opts.easing); return j.tweens.push(d), d }, stop: function (b) { var c = 0, d = b ? j.tweens.length : 0; if (e) return this; for (e = !0; d > c; c++) j.tweens[c].run(1); return b ? h.resolveWith(a, [j, b]) : h.rejectWith(a, [j, b]), this } }), k = j.props; for (jc(k, j.opts.specialEasing) ; g > f; f++) if (d = dc[f].call(j, a, k, j.opts)) return d; return m.map(k, hc, j), m.isFunction(j.opts.start) && j.opts.start.call(a, j), m.fx.timer(m.extend(i, { elem: a, anim: j, queue: j.opts.queue })), j.progress(j.opts.progress).done(j.opts.done, j.opts.complete).fail(j.opts.fail).always(j.opts.always) } m.Animation = m.extend(kc, { tweener: function (a, b) { m.isFunction(a) ? (b = a, a = ["*"]) : a = a.split(" "); for (var c, d = 0, e = a.length; e > d; d++) c = a[d], ec[c] = ec[c] || [], ec[c].unshift(b) }, prefilter: function (a, b) { b ? dc.unshift(a) : dc.push(a) } }), m.speed = function (a, b, c) { var d = a && "object" == typeof a ? m.extend({}, a) : { complete: c || !c && b || m.isFunction(a) && a, duration: a, easing: c && b || b && !m.isFunction(b) && b }; return d.duration = m.fx.off ? 0 : "number" == typeof d.duration ? d.duration : d.duration in m.fx.speeds ? m.fx.speeds[d.duration] : m.fx.speeds._default, (null == d.queue || d.queue === !0) && (d.queue = "fx"), d.old = d.complete, d.complete = function () { m.isFunction(d.old) && d.old.call(this), d.queue && m.dequeue(this, d.queue) }, d }, m.fn.extend({ fadeTo: function (a, b, c, d) { return this.filter(U).css("opacity", 0).show().end().animate({ opacity: b }, a, c, d) }, animate: function (a, b, c, d) { var e = m.isEmptyObject(a), f = m.speed(b, c, d), g = function () { var b = kc(this, m.extend({}, a), f); (e || m._data(this, "finish")) && b.stop(!0) }; return g.finish = g, e || f.queue === !1 ? this.each(g) : this.queue(f.queue, g) }, stop: function (a, b, c) { var d = function (a) { var b = a.stop; delete a.stop, b(c) }; return "string" != typeof a && (c = b, b = a, a = void 0), b && a !== !1 && this.queue(a || "fx", []), this.each(function () { var b = !0, e = null != a && a + "queueHooks", f = m.timers, g = m._data(this); if (e) g[e] && g[e].stop && d(g[e]); else for (e in g) g[e] && g[e].stop && cc.test(e) && d(g[e]); for (e = f.length; e--;) f[e].elem !== this || null != a && f[e].queue !== a || (f[e].anim.stop(c), b = !1, f.splice(e, 1)); (b || !c) && m.dequeue(this, a) }) }, finish: function (a) { return a !== !1 && (a = a || "fx"), this.each(function () { var b, c = m._data(this), d = c[a + "queue"], e = c[a + "queueHooks"], f = m.timers, g = d ? d.length : 0; for (c.finish = !0, m.queue(this, a, []), e && e.stop && e.stop.call(this, !0), b = f.length; b--;) f[b].elem === this && f[b].queue === a && (f[b].anim.stop(!0), f.splice(b, 1)); for (b = 0; g > b; b++) d[b] && d[b].finish && d[b].finish.call(this); delete c.finish }) } }), m.each(["toggle", "show", "hide"], function (a, b) { var c = m.fn[b]; m.fn[b] = function (a, d, e) { return null == a || "boolean" == typeof a ? c.apply(this, arguments) : this.animate(gc(b, !0), a, d, e) } }), m.each({ slideDown: gc("show"), slideUp: gc("hide"), slideToggle: gc("toggle"), fadeIn: { opacity: "show" }, fadeOut: { opacity: "hide" }, fadeToggle: { opacity: "toggle" } }, function (a, b) { m.fn[a] = function (a, c, d) { return this.animate(b, a, c, d) } }), m.timers = [], m.fx.tick = function () { var a, b = m.timers, c = 0; for ($b = m.now() ; c < b.length; c++) a = b[c], a() || b[c] !== a || b.splice(c--, 1); b.length || m.fx.stop(), $b = void 0 }, m.fx.timer = function (a) { m.timers.push(a), a() ? m.fx.start() : m.timers.pop() }, m.fx.interval = 13, m.fx.start = function () { _b || (_b = setInterval(m.fx.tick, m.fx.interval)) }, m.fx.stop = function () { clearInterval(_b), _b = null }, m.fx.speeds = { slow: 600, fast: 200, _default: 400 }, m.fn.delay = function (a, b) { return a = m.fx ? m.fx.speeds[a] || a : a, b = b || "fx", this.queue(b, function (b, c) { var d = setTimeout(b, a); c.stop = function () { clearTimeout(d) } }) }, function () { var a, b, c, d, e; b = y.createElement("div"), b.setAttribute("className", "t"), b.innerHTML = "  <link/><table></table><a href='/a'>a</a><input type='checkbox'/>", d = b.getElementsByTagName("a")[0], c = y.createElement("select"), e = c.appendChild(y.createElement("option")), a = b.getElementsByTagName("input")[0], d.style.cssText = "top:1px", k.getSetAttribute = "t" !== b.className, k.style = /top/.test(d.getAttribute("style")), k.hrefNormalized = "/a" === d.getAttribute("href"), k.checkOn = !!a.value, k.optSelected = e.selected, k.enctype = !!y.createElement("form").enctype, c.disabled = !0, k.optDisabled = !e.disabled, a = y.createElement("input"), a.setAttribute("value", ""), k.input = "" === a.getAttribute("value"), a.value = "t", a.setAttribute("type", "radio"), k.radioValue = "t" === a.value }(); var lc = /\r/g; m.fn.extend({ val: function (a) { var b, c, d, e = this[0]; { if (arguments.length) return d = m.isFunction(a), this.each(function (c) { var e; 1 === this.nodeType && (e = d ? a.call(this, c, m(this).val()) : a, null == e ? e = "" : "number" == typeof e ? e += "" : m.isArray(e) && (e = m.map(e, function (a) { return null == a ? "" : a + "" })), b = m.valHooks[this.type] || m.valHooks[this.nodeName.toLowerCase()], b && "set" in b && void 0 !== b.set(this, e, "value") || (this.value = e)) }); if (e) return b = m.valHooks[e.type] || m.valHooks[e.nodeName.toLowerCase()], b && "get" in b && void 0 !== (c = b.get(e, "value")) ? c : (c = e.value, "string" == typeof c ? c.replace(lc, "") : null == c ? "" : c) } } }), m.extend({ valHooks: { option: { get: function (a) { var b = m.find.attr(a, "value"); return null != b ? b : m.trim(m.text(a)) } }, select: { get: function (a) { for (var b, c, d = a.options, e = a.selectedIndex, f = "select-one" === a.type || 0 > e, g = f ? null : [], h = f ? e + 1 : d.length, i = 0 > e ? h : f ? e : 0; h > i; i++) if (c = d[i], !(!c.selected && i !== e || (k.optDisabled ? c.disabled : null !== c.getAttribute("disabled")) || c.parentNode.disabled && m.nodeName(c.parentNode, "optgroup"))) { if (b = m(c).val(), f) return b; g.push(b) } return g }, set: function (a, b) { var c, d, e = a.options, f = m.makeArray(b), g = e.length; while (g--) if (d = e[g], m.inArray(m.valHooks.option.get(d), f) >= 0) try { d.selected = c = !0 } catch (h) { d.scrollHeight } else d.selected = !1; return c || (a.selectedIndex = -1), e } } } }), m.each(["radio", "checkbox"], function () { m.valHooks[this] = { set: function (a, b) { return m.isArray(b) ? a.checked = m.inArray(m(a).val(), b) >= 0 : void 0 } }, k.checkOn || (m.valHooks[this].get = function (a) { return null === a.getAttribute("value") ? "on" : a.value }) }); var mc, nc, oc = m.expr.attrHandle, pc = /^(?:checked|selected)$/i, qc = k.getSetAttribute, rc = k.input; m.fn.extend({ attr: function (a, b) { return V(this, m.attr, a, b, arguments.length > 1) }, removeAttr: function (a) { return this.each(function () { m.removeAttr(this, a) }) } }), m.extend({ attr: function (a, b, c) { var d, e, f = a.nodeType; if (a && 3 !== f && 8 !== f && 2 !== f) return typeof a.getAttribute === K ? m.prop(a, b, c) : (1 === f && m.isXMLDoc(a) || (b = b.toLowerCase(), d = m.attrHooks[b] || (m.expr.match.bool.test(b) ? nc : mc)), void 0 === c ? d && "get" in d && null !== (e = d.get(a, b)) ? e : (e = m.find.attr(a, b), null == e ? void 0 : e) : null !== c ? d && "set" in d && void 0 !== (e = d.set(a, c, b)) ? e : (a.setAttribute(b, c + ""), c) : void m.removeAttr(a, b)) }, removeAttr: function (a, b) { var c, d, e = 0, f = b && b.match(E); if (f && 1 === a.nodeType) while (c = f[e++]) d = m.propFix[c] || c, m.expr.match.bool.test(c) ? rc && qc || !pc.test(c) ? a[d] = !1 : a[m.camelCase("default-" + c)] = a[d] = !1 : m.attr(a, c, ""), a.removeAttribute(qc ? c : d) }, attrHooks: { type: { set: function (a, b) { if (!k.radioValue && "radio" === b && m.nodeName(a, "input")) { var c = a.value; return a.setAttribute("type", b), c && (a.value = c), b } } } } }), nc = { set: function (a, b, c) { return b === !1 ? m.removeAttr(a, c) : rc && qc || !pc.test(c) ? a.setAttribute(!qc && m.propFix[c] || c, c) : a[m.camelCase("default-" + c)] = a[c] = !0, c } }, m.each(m.expr.match.bool.source.match(/\w+/g), function (a, b) { var c = oc[b] || m.find.attr; oc[b] = rc && qc || !pc.test(b) ? function (a, b, d) { var e, f; return d || (f = oc[b], oc[b] = e, e = null != c(a, b, d) ? b.toLowerCase() : null, oc[b] = f), e } : function (a, b, c) { return c ? void 0 : a[m.camelCase("default-" + b)] ? b.toLowerCase() : null } }), rc && qc || (m.attrHooks.value = { set: function (a, b, c) { return m.nodeName(a, "input") ? void (a.defaultValue = b) : mc && mc.set(a, b, c) } }), qc || (mc = { set: function (a, b, c) { var d = a.getAttributeNode(c); return d || a.setAttributeNode(d = a.ownerDocument.createAttribute(c)), d.value = b += "", "value" === c || b === a.getAttribute(c) ? b : void 0 } }, oc.id = oc.name = oc.coords = function (a, b, c) { var d; return c ? void 0 : (d = a.getAttributeNode(b)) && "" !== d.value ? d.value : null }, m.valHooks.button = { get: function (a, b) { var c = a.getAttributeNode(b); return c && c.specified ? c.value : void 0 }, set: mc.set }, m.attrHooks.contenteditable = { set: function (a, b, c) { mc.set(a, "" === b ? !1 : b, c) } }, m.each(["width", "height"], function (a, b) { m.attrHooks[b] = { set: function (a, c) { return "" === c ? (a.setAttribute(b, "auto"), c) : void 0 } } })), k.style || (m.attrHooks.style = { get: function (a) { return a.style.cssText || void 0 }, set: function (a, b) { return a.style.cssText = b + "" } }); var sc = /^(?:input|select|textarea|button|object)$/i, tc = /^(?:a|area)$/i; m.fn.extend({ prop: function (a, b) { return V(this, m.prop, a, b, arguments.length > 1) }, removeProp: function (a) { return a = m.propFix[a] || a, this.each(function () { try { this[a] = void 0, delete this[a] } catch (b) { } }) } }), m.extend({ propFix: { "for": "htmlFor", "class": "className" }, prop: function (a, b, c) { var d, e, f, g = a.nodeType; if (a && 3 !== g && 8 !== g && 2 !== g) return f = 1 !== g || !m.isXMLDoc(a), f && (b = m.propFix[b] || b, e = m.propHooks[b]), void 0 !== c ? e && "set" in e && void 0 !== (d = e.set(a, c, b)) ? d : a[b] = c : e && "get" in e && null !== (d = e.get(a, b)) ? d : a[b] }, propHooks: { tabIndex: { get: function (a) { var b = m.find.attr(a, "tabindex"); return b ? parseInt(b, 10) : sc.test(a.nodeName) || tc.test(a.nodeName) && a.href ? 0 : -1 } } } }), k.hrefNormalized || m.each(["href", "src"], function (a, b) { m.propHooks[b] = { get: function (a) { return a.getAttribute(b, 4) } } }), k.optSelected || (m.propHooks.selected = { get: function (a) { var b = a.parentNode; return b && (b.selectedIndex, b.parentNode && b.parentNode.selectedIndex), null } }), m.each(["tabIndex", "readOnly", "maxLength", "cellSpacing", "cellPadding", "rowSpan", "colSpan", "useMap", "frameBorder", "contentEditable"], function () { m.propFix[this.toLowerCase()] = this }), k.enctype || (m.propFix.enctype = "encoding"); var uc = /[\t\r\n\f]/g; m.fn.extend({ addClass: function (a) { var b, c, d, e, f, g, h = 0, i = this.length, j = "string" == typeof a && a; if (m.isFunction(a)) return this.each(function (b) { m(this).addClass(a.call(this, b, this.className)) }); if (j) for (b = (a || "").match(E) || []; i > h; h++) if (c = this[h], d = 1 === c.nodeType && (c.className ? (" " + c.className + " ").replace(uc, " ") : " ")) { f = 0; while (e = b[f++]) d.indexOf(" " + e + " ") < 0 && (d += e + " "); g = m.trim(d), c.className !== g && (c.className = g) } return this }, removeClass: function (a) { var b, c, d, e, f, g, h = 0, i = this.length, j = 0 === arguments.length || "string" == typeof a && a; if (m.isFunction(a)) return this.each(function (b) { m(this).removeClass(a.call(this, b, this.className)) }); if (j) for (b = (a || "").match(E) || []; i > h; h++) if (c = this[h], d = 1 === c.nodeType && (c.className ? (" " + c.className + " ").replace(uc, " ") : "")) { f = 0; while (e = b[f++]) while (d.indexOf(" " + e + " ") >= 0) d = d.replace(" " + e + " ", " "); g = a ? m.trim(d) : "", c.className !== g && (c.className = g) } return this }, toggleClass: function (a, b) { var c = typeof a; return "boolean" == typeof b && "string" === c ? b ? this.addClass(a) : this.removeClass(a) : this.each(m.isFunction(a) ? function (c) { m(this).toggleClass(a.call(this, c, this.className, b), b) } : function () { if ("string" === c) { var b, d = 0, e = m(this), f = a.match(E) || []; while (b = f[d++]) e.hasClass(b) ? e.removeClass(b) : e.addClass(b) } else (c === K || "boolean" === c) && (this.className && m._data(this, "__className__", this.className), this.className = this.className || a === !1 ? "" : m._data(this, "__className__") || "") }) }, hasClass: function (a) { for (var b = " " + a + " ", c = 0, d = this.length; d > c; c++) if (1 === this[c].nodeType && (" " + this[c].className + " ").replace(uc, " ").indexOf(b) >= 0) return !0; return !1 } }), m.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error contextmenu".split(" "), function (a, b) { m.fn[b] = function (a, c) { return arguments.length > 0 ? this.on(b, null, a, c) : this.trigger(b) } }), m.fn.extend({ hover: function (a, b) { return this.mouseenter(a).mouseleave(b || a) }, bind: function (a, b, c) { return this.on(a, null, b, c) }, unbind: function (a, b) { return this.off(a, null, b) }, delegate: function (a, b, c, d) { return this.on(b, a, c, d) }, undelegate: function (a, b, c) { return 1 === arguments.length ? this.off(a, "**") : this.off(b, a || "**", c) } }); var vc = m.now(), wc = /\?/, xc = /(,)|(\[|{)|(}|])|"(?:[^"\\\r\n]|\\["\\\/bfnrt]|\\u[\da-fA-F]{4})*"\s*:?|true|false|null|-?(?!0\d)\d+(?:\.\d+|)(?:[eE][+-]?\d+|)/g; m.parseJSON = function (b) { if (a.JSON && a.JSON.parse) return a.JSON.parse(b + ""); var c, d = null, e = m.trim(b + ""); return e && !m.trim(e.replace(xc, function (a, b, e, f) { return c && b && (d = 0), 0 === d ? a : (c = e || b, d += !f - !e, "") })) ? Function("return " + e)() : m.error("Invalid JSON: " + b) }, m.parseXML = function (b) { var c, d; if (!b || "string" != typeof b) return null; try { a.DOMParser ? (d = new DOMParser, c = d.parseFromString(b, "text/xml")) : (c = new ActiveXObject("Microsoft.XMLDOM"), c.async = "false", c.loadXML(b)) } catch (e) { c = void 0 } return c && c.documentElement && !c.getElementsByTagName("parsererror").length || m.error("Invalid XML: " + b), c }; var yc, zc, Ac = /#.*$/, Bc = /([?&])_=[^&]*/, Cc = /^(.*?):[ \t]*([^\r\n]*)\r?$/gm, Dc = /^(?:about|app|app-storage|.+-extension|file|res|widget):$/, Ec = /^(?:GET|HEAD)$/, Fc = /^\/\//, Gc = /^([\w.+-]+:)(?:\/\/(?:[^\/?#]*@|)([^\/?#:]*)(?::(\d+)|)|)/, Hc = {}, Ic = {}, Jc = "*/".concat("*"); try { zc = location.href } catch (Kc) { zc = y.createElement("a"), zc.href = "", zc = zc.href } yc = Gc.exec(zc.toLowerCase()) || []; function Lc(a) { return function (b, c) { "string" != typeof b && (c = b, b = "*"); var d, e = 0, f = b.toLowerCase().match(E) || []; if (m.isFunction(c)) while (d = f[e++]) "+" === d.charAt(0) ? (d = d.slice(1) || "*", (a[d] = a[d] || []).unshift(c)) : (a[d] = a[d] || []).push(c) } } function Mc(a, b, c, d) { var e = {}, f = a === Ic; function g(h) { var i; return e[h] = !0, m.each(a[h] || [], function (a, h) { var j = h(b, c, d); return "string" != typeof j || f || e[j] ? f ? !(i = j) : void 0 : (b.dataTypes.unshift(j), g(j), !1) }), i } return g(b.dataTypes[0]) || !e["*"] && g("*") } function Nc(a, b) { var c, d, e = m.ajaxSettings.flatOptions || {}; for (d in b) void 0 !== b[d] && ((e[d] ? a : c || (c = {}))[d] = b[d]); return c && m.extend(!0, a, c), a } function Oc(a, b, c) { var d, e, f, g, h = a.contents, i = a.dataTypes; while ("*" === i[0]) i.shift(), void 0 === e && (e = a.mimeType || b.getResponseHeader("Content-Type")); if (e) for (g in h) if (h[g] && h[g].test(e)) { i.unshift(g); break } if (i[0] in c) f = i[0]; else { for (g in c) { if (!i[0] || a.converters[g + " " + i[0]]) { f = g; break } d || (d = g) } f = f || d } return f ? (f !== i[0] && i.unshift(f), c[f]) : void 0 } function Pc(a, b, c, d) { var e, f, g, h, i, j = {}, k = a.dataTypes.slice(); if (k[1]) for (g in a.converters) j[g.toLowerCase()] = a.converters[g]; f = k.shift(); while (f) if (a.responseFields[f] && (c[a.responseFields[f]] = b), !i && d && a.dataFilter && (b = a.dataFilter(b, a.dataType)), i = f, f = k.shift()) if ("*" === f) f = i; else if ("*" !== i && i !== f) { if (g = j[i + " " + f] || j["* " + f], !g) for (e in j) if (h = e.split(" "), h[1] === f && (g = j[i + " " + h[0]] || j["* " + h[0]])) { g === !0 ? g = j[e] : j[e] !== !0 && (f = h[0], k.unshift(h[1])); break } if (g !== !0) if (g && a["throws"]) b = g(b); else try { b = g(b) } catch (l) { return { state: "parsererror", error: g ? l : "No conversion from " + i + " to " + f } } } return { state: "success", data: b } } m.extend({ active: 0, lastModified: {}, etag: {}, ajaxSettings: { url: zc, type: "GET", isLocal: Dc.test(yc[1]), global: !0, processData: !0, async: !0, contentType: "application/x-www-form-urlencoded; charset=UTF-8", accepts: { "*": Jc, text: "text/plain", html: "text/html", xml: "application/xml, text/xml", json: "application/json, text/javascript" }, contents: { xml: /xml/, html: /html/, json: /json/ }, responseFields: { xml: "responseXML", text: "responseText", json: "responseJSON" }, converters: { "* text": String, "text html": !0, "text json": m.parseJSON, "text xml": m.parseXML }, flatOptions: { url: !0, context: !0 } }, ajaxSetup: function (a, b) { return b ? Nc(Nc(a, m.ajaxSettings), b) : Nc(m.ajaxSettings, a) }, ajaxPrefilter: Lc(Hc), ajaxTransport: Lc(Ic), ajax: function (a, b) { "object" == typeof a && (b = a, a = void 0), b = b || {}; var c, d, e, f, g, h, i, j, k = m.ajaxSetup({}, b), l = k.context || k, n = k.context && (l.nodeType || l.jquery) ? m(l) : m.event, o = m.Deferred(), p = m.Callbacks("once memory"), q = k.statusCode || {}, r = {}, s = {}, t = 0, u = "canceled", v = { readyState: 0, getResponseHeader: function (a) { var b; if (2 === t) { if (!j) { j = {}; while (b = Cc.exec(f)) j[b[1].toLowerCase()] = b[2] } b = j[a.toLowerCase()] } return null == b ? null : b }, getAllResponseHeaders: function () { return 2 === t ? f : null }, setRequestHeader: function (a, b) { var c = a.toLowerCase(); return t || (a = s[c] = s[c] || a, r[a] = b), this }, overrideMimeType: function (a) { return t || (k.mimeType = a), this }, statusCode: function (a) { var b; if (a) if (2 > t) for (b in a) q[b] = [q[b], a[b]]; else v.always(a[v.status]); return this }, abort: function (a) { var b = a || u; return i && i.abort(b), x(0, b), this } }; if (o.promise(v).complete = p.add, v.success = v.done, v.error = v.fail, k.url = ((a || k.url || zc) + "").replace(Ac, "").replace(Fc, yc[1] + "//"), k.type = b.method || b.type || k.method || k.type, k.dataTypes = m.trim(k.dataType || "*").toLowerCase().match(E) || [""], null == k.crossDomain && (c = Gc.exec(k.url.toLowerCase()), k.crossDomain = !(!c || c[1] === yc[1] && c[2] === yc[2] && (c[3] || ("http:" === c[1] ? "80" : "443")) === (yc[3] || ("http:" === yc[1] ? "80" : "443")))), k.data && k.processData && "string" != typeof k.data && (k.data = m.param(k.data, k.traditional)), Mc(Hc, k, b, v), 2 === t) return v; h = k.global, h && 0 === m.active++ && m.event.trigger("ajaxStart"), k.type = k.type.toUpperCase(), k.hasContent = !Ec.test(k.type), e = k.url, k.hasContent || (k.data && (e = k.url += (wc.test(e) ? "&" : "?") + k.data, delete k.data), k.cache === !1 && (k.url = Bc.test(e) ? e.replace(Bc, "$1_=" + vc++) : e + (wc.test(e) ? "&" : "?") + "_=" + vc++)), k.ifModified && (m.lastModified[e] && v.setRequestHeader("If-Modified-Since", m.lastModified[e]), m.etag[e] && v.setRequestHeader("If-None-Match", m.etag[e])), (k.data && k.hasContent && k.contentType !== !1 || b.contentType) && v.setRequestHeader("Content-Type", k.contentType), v.setRequestHeader("Accept", k.dataTypes[0] && k.accepts[k.dataTypes[0]] ? k.accepts[k.dataTypes[0]] + ("*" !== k.dataTypes[0] ? ", " + Jc + "; q=0.01" : "") : k.accepts["*"]); for (d in k.headers) v.setRequestHeader(d, k.headers[d]); if (k.beforeSend && (k.beforeSend.call(l, v, k) === !1 || 2 === t)) return v.abort(); u = "abort"; for (d in { success: 1, error: 1, complete: 1 }) v[d](k[d]); if (i = Mc(Ic, k, b, v)) { v.readyState = 1, h && n.trigger("ajaxSend", [v, k]), k.async && k.timeout > 0 && (g = setTimeout(function () { v.abort("timeout") }, k.timeout)); try { t = 1, i.send(r, x) } catch (w) { if (!(2 > t)) throw w; x(-1, w) } } else x(-1, "No Transport"); function x(a, b, c, d) { var j, r, s, u, w, x = b; 2 !== t && (t = 2, g && clearTimeout(g), i = void 0, f = d || "", v.readyState = a > 0 ? 4 : 0, j = a >= 200 && 300 > a || 304 === a, c && (u = Oc(k, v, c)), u = Pc(k, u, v, j), j ? (k.ifModified && (w = v.getResponseHeader("Last-Modified"), w && (m.lastModified[e] = w), w = v.getResponseHeader("etag"), w && (m.etag[e] = w)), 204 === a || "HEAD" === k.type ? x = "nocontent" : 304 === a ? x = "notmodified" : (x = u.state, r = u.data, s = u.error, j = !s)) : (s = x, (a || !x) && (x = "error", 0 > a && (a = 0))), v.status = a, v.statusText = (b || x) + "", j ? o.resolveWith(l, [r, x, v]) : o.rejectWith(l, [v, x, s]), v.statusCode(q), q = void 0, h && n.trigger(j ? "ajaxSuccess" : "ajaxError", [v, k, j ? r : s]), p.fireWith(l, [v, x]), h && (n.trigger("ajaxComplete", [v, k]), --m.active || m.event.trigger("ajaxStop"))) } return v }, getJSON: function (a, b, c) { return m.get(a, b, c, "json") }, getScript: function (a, b) { return m.get(a, void 0, b, "script") } }), m.each(["get", "post"], function (a, b) { m[b] = function (a, c, d, e) { return m.isFunction(c) && (e = e || d, d = c, c = void 0), m.ajax({ url: a, type: b, dataType: e, data: c, success: d }) } }), m.each(["ajaxStart", "ajaxStop", "ajaxComplete", "ajaxError", "ajaxSuccess", "ajaxSend"], function (a, b) { m.fn[b] = function (a) { return this.on(b, a) } }), m._evalUrl = function (a) { return m.ajax({ url: a, type: "GET", dataType: "script", async: !1, global: !1, "throws": !0 }) }, m.fn.extend({ wrapAll: function (a) { if (m.isFunction(a)) return this.each(function (b) { m(this).wrapAll(a.call(this, b)) }); if (this[0]) { var b = m(a, this[0].ownerDocument).eq(0).clone(!0); this[0].parentNode && b.insertBefore(this[0]), b.map(function () { var a = this; while (a.firstChild && 1 === a.firstChild.nodeType) a = a.firstChild; return a }).append(this) } return this }, wrapInner: function (a) { return this.each(m.isFunction(a) ? function (b) { m(this).wrapInner(a.call(this, b)) } : function () { var b = m(this), c = b.contents(); c.length ? c.wrapAll(a) : b.append(a) }) }, wrap: function (a) { var b = m.isFunction(a); return this.each(function (c) { m(this).wrapAll(b ? a.call(this, c) : a) }) }, unwrap: function () { return this.parent().each(function () { m.nodeName(this, "body") || m(this).replaceWith(this.childNodes) }).end() } }), m.expr.filters.hidden = function (a) { return a.offsetWidth <= 0 && a.offsetHeight <= 0 || !k.reliableHiddenOffsets() && "none" === (a.style && a.style.display || m.css(a, "display")) }, m.expr.filters.visible = function (a) { return !m.expr.filters.hidden(a) }; var Qc = /%20/g, Rc = /\[\]$/, Sc = /\r?\n/g, Tc = /^(?:submit|button|image|reset|file)$/i, Uc = /^(?:input|select|textarea|keygen)/i; function Vc(a, b, c, d) { var e; if (m.isArray(b)) m.each(b, function (b, e) { c || Rc.test(a) ? d(a, e) : Vc(a + "[" + ("object" == typeof e ? b : "") + "]", e, c, d) }); else if (c || "object" !== m.type(b)) d(a, b); else for (e in b) Vc(a + "[" + e + "]", b[e], c, d) } m.param = function (a, b) { var c, d = [], e = function (a, b) { b = m.isFunction(b) ? b() : null == b ? "" : b, d[d.length] = encodeURIComponent(a) + "=" + encodeURIComponent(b) }; if (void 0 === b && (b = m.ajaxSettings && m.ajaxSettings.traditional), m.isArray(a) || a.jquery && !m.isPlainObject(a)) m.each(a, function () { e(this.name, this.value) }); else for (c in a) Vc(c, a[c], b, e); return d.join("&").replace(Qc, "+") }, m.fn.extend({ serialize: function () { return m.param(this.serializeArray()) }, serializeArray: function () { return this.map(function () { var a = m.prop(this, "elements"); return a ? m.makeArray(a) : this }).filter(function () { var a = this.type; return this.name && !m(this).is(":disabled") && Uc.test(this.nodeName) && !Tc.test(a) && (this.checked || !W.test(a)) }).map(function (a, b) { var c = m(this).val(); return null == c ? null : m.isArray(c) ? m.map(c, function (a) { return { name: b.name, value: a.replace(Sc, "\r\n") } }) : { name: b.name, value: c.replace(Sc, "\r\n") } }).get() } }), m.ajaxSettings.xhr = void 0 !== a.ActiveXObject ? function () { return !this.isLocal && /^(get|post|head|put|delete|options)$/i.test(this.type) && Zc() || $c() } : Zc; var Wc = 0, Xc = {}, Yc = m.ajaxSettings.xhr(); a.ActiveXObject && m(a).on("unload", function () { for (var a in Xc) Xc[a](void 0, !0) }), k.cors = !!Yc && "withCredentials" in Yc, Yc = k.ajax = !!Yc, Yc && m.ajaxTransport(function (a) { if (!a.crossDomain || k.cors) { var b; return { send: function (c, d) { var e, f = a.xhr(), g = ++Wc; if (f.open(a.type, a.url, a.async, a.username, a.password), a.xhrFields) for (e in a.xhrFields) f[e] = a.xhrFields[e]; a.mimeType && f.overrideMimeType && f.overrideMimeType(a.mimeType), a.crossDomain || c["X-Requested-With"] || (c["X-Requested-With"] = "XMLHttpRequest"); for (e in c) void 0 !== c[e] && f.setRequestHeader(e, c[e] + ""); f.send(a.hasContent && a.data || null), b = function (c, e) { var h, i, j; if (b && (e || 4 === f.readyState)) if (delete Xc[g], b = void 0, f.onreadystatechange = m.noop, e) 4 !== f.readyState && f.abort(); else { j = {}, h = f.status, "string" == typeof f.responseText && (j.text = f.responseText); try { i = f.statusText } catch (k) { i = "" } h || !a.isLocal || a.crossDomain ? 1223 === h && (h = 204) : h = j.text ? 200 : 404 } j && d(h, i, j, f.getAllResponseHeaders()) }, a.async ? 4 === f.readyState ? setTimeout(b) : f.onreadystatechange = Xc[g] = b : b() }, abort: function () { b && b(void 0, !0) } } } }); function Zc() { try { return new a.XMLHttpRequest } catch (b) { } } function $c() { try { return new a.ActiveXObject("Microsoft.XMLHTTP") } catch (b) { } } m.ajaxSetup({ accepts: { script: "text/javascript, application/javascript, application/ecmascript, application/x-ecmascript" }, contents: { script: /(?:java|ecma)script/ }, converters: { "text script": function (a) { return m.globalEval(a), a } } }), m.ajaxPrefilter("script", function (a) { void 0 === a.cache && (a.cache = !1), a.crossDomain && (a.type = "GET", a.global = !1) }), m.ajaxTransport("script", function (a) { if (a.crossDomain) { var b, c = y.head || m("head")[0] || y.documentElement; return { send: function (d, e) { b = y.createElement("script"), b.async = !0, a.scriptCharset && (b.charset = a.scriptCharset), b.src = a.url, b.onload = b.onreadystatechange = function (a, c) { (c || !b.readyState || /loaded|complete/.test(b.readyState)) && (b.onload = b.onreadystatechange = null, b.parentNode && b.parentNode.removeChild(b), b = null, c || e(200, "success")) }, c.insertBefore(b, c.firstChild) }, abort: function () { b && b.onload(void 0, !0) } } } }); var _c = [], ad = /(=)\?(?=&|$)|\?\?/; m.ajaxSetup({ jsonp: "callback", jsonpCallback: function () { var a = _c.pop() || m.expando + "_" + vc++; return this[a] = !0, a } }), m.ajaxPrefilter("json jsonp", function (b, c, d) { var e, f, g, h = b.jsonp !== !1 && (ad.test(b.url) ? "url" : "string" == typeof b.data && !(b.contentType || "").indexOf("application/x-www-form-urlencoded") && ad.test(b.data) && "data"); return h || "jsonp" === b.dataTypes[0] ? (e = b.jsonpCallback = m.isFunction(b.jsonpCallback) ? b.jsonpCallback() : b.jsonpCallback, h ? b[h] = b[h].replace(ad, "$1" + e) : b.jsonp !== !1 && (b.url += (wc.test(b.url) ? "&" : "?") + b.jsonp + "=" + e), b.converters["script json"] = function () { return g || m.error(e + " was not called"), g[0] }, b.dataTypes[0] = "json", f = a[e], a[e] = function () { g = arguments }, d.always(function () { a[e] = f, b[e] && (b.jsonpCallback = c.jsonpCallback, _c.push(e)), g && m.isFunction(f) && f(g[0]), g = f = void 0 }), "script") : void 0 }), m.parseHTML = function (a, b, c) { if (!a || "string" != typeof a) return null; "boolean" == typeof b && (c = b, b = !1), b = b || y; var d = u.exec(a), e = !c && []; return d ? [b.createElement(d[1])] : (d = m.buildFragment([a], b, e), e && e.length && m(e).remove(), m.merge([], d.childNodes)) }; var bd = m.fn.load; m.fn.load = function (a, b, c) { if ("string" != typeof a && bd) return bd.apply(this, arguments); var d, e, f, g = this, h = a.indexOf(" "); return h >= 0 && (d = m.trim(a.slice(h, a.length)), a = a.slice(0, h)), m.isFunction(b) ? (c = b, b = void 0) : b && "object" == typeof b && (f = "POST"), g.length > 0 && m.ajax({ url: a, type: f, dataType: "html", data: b }).done(function (a) { e = arguments, g.html(d ? m("<div>").append(m.parseHTML(a)).find(d) : a) }).complete(c && function (a, b) { g.each(c, e || [a.responseText, b, a]) }), this }, m.expr.filters.animated = function (a) { return m.grep(m.timers, function (b) { return a === b.elem }).length }; var cd = a.document.documentElement; function dd(a) { return m.isWindow(a) ? a : 9 === a.nodeType ? a.defaultView || a.parentWindow : !1 } m.offset = { setOffset: function (a, b, c) { var d, e, f, g, h, i, j, k = m.css(a, "position"), l = m(a), n = {}; "static" === k && (a.style.position = "relative"), h = l.offset(), f = m.css(a, "top"), i = m.css(a, "left"), j = ("absolute" === k || "fixed" === k) && m.inArray("auto", [f, i]) > -1, j ? (d = l.position(), g = d.top, e = d.left) : (g = parseFloat(f) || 0, e = parseFloat(i) || 0), m.isFunction(b) && (b = b.call(a, c, h)), null != b.top && (n.top = b.top - h.top + g), null != b.left && (n.left = b.left - h.left + e), "using" in b ? b.using.call(a, n) : l.css(n) } }, m.fn.extend({ offset: function (a) { if (arguments.length) return void 0 === a ? this : this.each(function (b) { m.offset.setOffset(this, a, b) }); var b, c, d = { top: 0, left: 0 }, e = this[0], f = e && e.ownerDocument; if (f) return b = f.documentElement, m.contains(b, e) ? (typeof e.getBoundingClientRect !== K && (d = e.getBoundingClientRect()), c = dd(f), { top: d.top + (c.pageYOffset || b.scrollTop) - (b.clientTop || 0), left: d.left + (c.pageXOffset || b.scrollLeft) - (b.clientLeft || 0) }) : d }, position: function () { if (this[0]) { var a, b, c = { top: 0, left: 0 }, d = this[0]; return "fixed" === m.css(d, "position") ? b = d.getBoundingClientRect() : (a = this.offsetParent(), b = this.offset(), m.nodeName(a[0], "html") || (c = a.offset()), c.top += m.css(a[0], "borderTopWidth", !0), c.left += m.css(a[0], "borderLeftWidth", !0)), { top: b.top - c.top - m.css(d, "marginTop", !0), left: b.left - c.left - m.css(d, "marginLeft", !0) } } }, offsetParent: function () { return this.map(function () { var a = this.offsetParent || cd; while (a && !m.nodeName(a, "html") && "static" === m.css(a, "position")) a = a.offsetParent; return a || cd }) } }), m.each({ scrollLeft: "pageXOffset", scrollTop: "pageYOffset" }, function (a, b) { var c = /Y/.test(b); m.fn[a] = function (d) { return V(this, function (a, d, e) { var f = dd(a); return void 0 === e ? f ? b in f ? f[b] : f.document.documentElement[d] : a[d] : void (f ? f.scrollTo(c ? m(f).scrollLeft() : e, c ? e : m(f).scrollTop()) : a[d] = e) }, a, d, arguments.length, null) } }), m.each(["top", "left"], function (a, b) { m.cssHooks[b] = Lb(k.pixelPosition, function (a, c) { return c ? (c = Jb(a, b), Hb.test(c) ? m(a).position()[b] + "px" : c) : void 0 }) }), m.each({ Height: "height", Width: "width" }, function (a, b) { m.each({ padding: "inner" + a, content: b, "": "outer" + a }, function (c, d) { m.fn[d] = function (d, e) { var f = arguments.length && (c || "boolean" != typeof d), g = c || (d === !0 || e === !0 ? "margin" : "border"); return V(this, function (b, c, d) { var e; return m.isWindow(b) ? b.document.documentElement["client" + a] : 9 === b.nodeType ? (e = b.documentElement, Math.max(b.body["scroll" + a], e["scroll" + a], b.body["offset" + a], e["offset" + a], e["client" + a])) : void 0 === d ? m.css(b, c, g) : m.style(b, c, d, g) }, b, f ? d : void 0, f, null) } }) }), m.fn.size = function () { return this.length }, m.fn.andSelf = m.fn.addBack, "function" == typeof define && define.amd && define("jquery", [], function () { return m }); var ed = a.jQuery, fd = a.$; return m.noConflict = function (b) { return a.$ === m && (a.$ = fd), b && a.jQuery === m && (a.jQuery = ed), m }, typeof b === K && (a.jQuery = a.$ = m), m
});
/* ]]> */
						</script><script type="text/javascript">
							/* <![CDATA[ */
/*! jQuery Migrate v1.2.1 | (c) 2005, 2013 jQuery Foundation, Inc. and other contributors | jquery.org/license */
jQuery.migrateMute===void 0&&(jQuery.migrateMute=!0),function(e,t,n){function r(n){var r=t.console;i[n]||(i[n]=!0,e.migrateWarnings.push(n),r&&r.warn&&!e.migrateMute&&(r.warn("JQMIGRATE: "+n),e.migrateTrace&&r.trace&&r.trace()))}function a(t,a,i,o){if(Object.defineProperty)try{return Object.defineProperty(t,a,{configurable:!0,enumerable:!0,get:function(){return r(o),i},set:function(e){r(o),i=e}}),n}catch(s){}e._definePropertyBroken=!0,t[a]=i}var i={};e.migrateWarnings=[],!e.migrateMute&&t.console&&t.console.log&&t.console.log("JQMIGRATE: Logging is active"),e.migrateTrace===n&&(e.migrateTrace=!0),e.migrateReset=function(){i={},e.migrateWarnings.length=0},"BackCompat"===document.compatMode&&r("jQuery is not compatible with Quirks Mode");var o=e("<input/>",{size:1}).attr("size")&&e.attrFn,s=e.attr,u=e.attrHooks.value&&e.attrHooks.value.get||function(){return null},c=e.attrHooks.value&&e.attrHooks.value.set||function(){return n},l=/^(?:input|button)$/i,d=/^[238]$/,p=/^(?:autofocus|autoplay|async|checked|controls|defer|disabled|hidden|loop|multiple|open|readonly|required|scoped|selected)$/i,f=/^(?:checked|selected)$/i;a(e,"attrFn",o||{},"jQuery.attrFn is deprecated"),e.attr=function(t,a,i,u){var c=a.toLowerCase(),g=t&&t.nodeType;return u&&(4>s.length&&r("jQuery.fn.attr( props, pass ) is deprecated"),t&&!d.test(g)&&(o?a in o:e.isFunction(e.fn[a])))?e(t)[a](i):("type"===a&&i!==n&&l.test(t.nodeName)&&t.parentNode&&r("Can't change the 'type' of an input or button in IE 6/7/8"),!e.attrHooks[c]&&p.test(c)&&(e.attrHooks[c]={get:function(t,r){var a,i=e.prop(t,r);return i===!0||"boolean"!=typeof i&&(a=t.getAttributeNode(r))&&a.nodeValue!==!1?r.toLowerCase():n},set:function(t,n,r){var a;return n===!1?e.removeAttr(t,r):(a=e.propFix[r]||r,a in t&&(t[a]=!0),t.setAttribute(r,r.toLowerCase())),r}},f.test(c)&&r("jQuery.fn.attr('"+c+"') may use property instead of attribute")),s.call(e,t,a,i))},e.attrHooks.value={get:function(e,t){var n=(e.nodeName||"").toLowerCase();return"button"===n?u.apply(this,arguments):("input"!==n&&"option"!==n&&r("jQuery.fn.attr('value') no longer gets properties"),t in e?e.value:null)},set:function(e,t){var a=(e.nodeName||"").toLowerCase();return"button"===a?c.apply(this,arguments):("input"!==a&&"option"!==a&&r("jQuery.fn.attr('value', val) no longer sets properties"),e.value=t,n)}};var g,h,v=e.fn.init,m=e.parseJSON,y=/^([^<]*)(<[\w\W]+>)([^>]*)$/;e.fn.init=function(t,n,a){var i;return t&&"string"==typeof t&&!e.isPlainObject(n)&&(i=y.exec(e.trim(t)))&&i[0]&&("<"!==t.charAt(0)&&r("$(html) HTML strings must start with '<' character"),i[3]&&r("$(html) HTML text after last tag is ignored"),"#"===i[0].charAt(0)&&(r("HTML string cannot start with a '#' character"),e.error("JQMIGRATE: Invalid selector string (XSS)")),n&&n.context&&(n=n.context),e.parseHTML)?v.call(this,e.parseHTML(i[2],n,!0),n,a):v.apply(this,arguments)},e.fn.init.prototype=e.fn,e.parseJSON=function(e){return e||null===e?m.apply(this,arguments):(r("jQuery.parseJSON requires a valid JSON string"),null)},e.uaMatch=function(e){e=e.toLowerCase();var t=/(chrome)[ \/]([\w.]+)/.exec(e)||/(webkit)[ \/]([\w.]+)/.exec(e)||/(opera)(?:.*version|)[ \/]([\w.]+)/.exec(e)||/(msie) ([\w.]+)/.exec(e)||0>e.indexOf("compatible")&&/(mozilla)(?:.*? rv:([\w.]+)|)/.exec(e)||[];return{browser:t[1]||"",version:t[2]||"0"}},e.browser||(g=e.uaMatch(navigator.userAgent),h={},g.browser&&(h[g.browser]=!0,h.version=g.version),h.chrome?h.webkit=!0:h.webkit&&(h.safari=!0),e.browser=h),a(e,"browser",e.browser,"jQuery.browser is deprecated"),e.sub=function(){function t(e,n){return new t.fn.init(e,n)}e.extend(!0,t,this),t.superclass=this,t.fn=t.prototype=this(),t.fn.constructor=t,t.sub=this.sub,t.fn.init=function(r,a){return a&&a instanceof e&&!(a instanceof t)&&(a=t(a)),e.fn.init.call(this,r,a,n)},t.fn.init.prototype=t.fn;var n=t(document);return r("jQuery.sub() is deprecated"),t},e.ajaxSetup({converters:{"text json":e.parseJSON}});var b=e.fn.data;e.fn.data=function(t){var a,i,o=this[0];return!o||"events"!==t||1!==arguments.length||(a=e.data(o,t),i=e._data(o,t),a!==n&&a!==i||i===n)?b.apply(this,arguments):(r("Use of jQuery.fn.data('events') is deprecated"),i)};var j=/\/(java|ecma)script/i,w=e.fn.andSelf||e.fn.addBack;e.fn.andSelf=function(){return r("jQuery.fn.andSelf() replaced by jQuery.fn.addBack()"),w.apply(this,arguments)},e.clean||(e.clean=function(t,a,i,o){a=a||document,a=!a.nodeType&&a[0]||a,a=a.ownerDocument||a,r("jQuery.clean() is deprecated");var s,u,c,l,d=[];if(e.merge(d,e.buildFragment(t,a).childNodes),i)for(c=function(e){return!e.type||j.test(e.type)?o?o.push(e.parentNode?e.parentNode.removeChild(e):e):i.appendChild(e):n},s=0;null!=(u=d[s]);s++)e.nodeName(u,"script")&&c(u)||(i.appendChild(u),u.getElementsByTagName!==n&&(l=e.grep(e.merge([],u.getElementsByTagName("script")),c),d.splice.apply(d,[s+1,0].concat(l)),s+=l.length));return d});var Q=e.event.add,x=e.event.remove,k=e.event.trigger,N=e.fn.toggle,T=e.fn.live,M=e.fn.die,S="ajaxStart|ajaxStop|ajaxSend|ajaxComplete|ajaxError|ajaxSuccess",C=RegExp("\\b(?:"+S+")\\b"),H=/(?:^|\s)hover(\.\S+|)\b/,A=function(t){return"string"!=typeof t||e.event.special.hover?t:(H.test(t)&&r("'hover' pseudo-event is deprecated, use 'mouseenter mouseleave'"),t&&t.replace(H,"mouseenter$1 mouseleave$1"))};e.event.props&&"attrChange"!==e.event.props[0]&&e.event.props.unshift("attrChange","attrName","relatedNode","srcElement"),e.event.dispatch&&a(e.event,"handle",e.event.dispatch,"jQuery.event.handle is undocumented and deprecated"),e.event.add=function(e,t,n,a,i){e!==document&&C.test(t)&&r("AJAX events should be attached to document: "+t),Q.call(this,e,A(t||""),n,a,i)},e.event.remove=function(e,t,n,r,a){x.call(this,e,A(t)||"",n,r,a)},e.fn.error=function(){var e=Array.prototype.slice.call(arguments,0);return r("jQuery.fn.error() is deprecated"),e.splice(0,0,"error"),arguments.length?this.bind.apply(this,e):(this.triggerHandler.apply(this,e),this)},e.fn.toggle=function(t,n){if(!e.isFunction(t)||!e.isFunction(n))return N.apply(this,arguments);r("jQuery.fn.toggle(handler, handler...) is deprecated");var a=arguments,i=t.guid||e.guid++,o=0,s=function(n){var r=(e._data(this,"lastToggle"+t.guid)||0)%o;return e._data(this,"lastToggle"+t.guid,r+1),n.preventDefault(),a[r].apply(this,arguments)||!1};for(s.guid=i;a.length>o;)a[o++].guid=i;return this.click(s)},e.fn.live=function(t,n,a){return r("jQuery.fn.live() is deprecated"),T?T.apply(this,arguments):(e(this.context).on(t,this.selector,n,a),this)},e.fn.die=function(t,n){return r("jQuery.fn.die() is deprecated"),M?M.apply(this,arguments):(e(this.context).off(t,this.selector||"**",n),this)},e.event.trigger=function(e,t,n,a){return n||C.test(e)||r("Global events are undocumented and deprecated"),k.call(this,e,t,n||document,a)},e.each(S.split("|"),function(t,n){e.event.special[n]={setup:function(){var t=this;return t!==document&&(e.event.add(document,n+"."+e.guid,function(){e.event.trigger(n,null,t,!0)}),e._data(this,n,e.guid++)),!1},teardown:function(){return this!==document&&e.event.remove(document,n+"."+e._data(this,n)),!1}}})}(jQuery,window);
/* ]]> */
						</script><script type="text/javascript">
							/* <![CDATA[ */
// jQuery Mask Plugin v1.3.2
// github.com/igorescobar/jQuery-Mask-Plugin
(function(c){var w=function(a,d,e){var f=this;a=c(a);var l;d="function"==typeof d?d(a.val(),void 0,a,e):d;f.init=function(){e=e||{};f.byPassKeys=[8,9,16,36,37,38,39,40,46,91];f.translation={0:{pattern:/\d/},9:{pattern:/\d/,optional:!0},"#":{pattern:/\d/,recursive:!0},A:{pattern:/[a-zA-Z0-9]/},S:{pattern:/[a-zA-Z]/}};f.translation=c.extend({},f.translation,e.translation);f=c.extend(!0,{},f,e);a.each(function(){!1!==e.maxlength&&a.attr("maxlength",d.length);a.attr("autocomplete","off");g.destroyEvents();
g.events();g.val(g.getMasked())})};var g={events:function(){a.on("keydown.mask",function(){l=g.val()});a.on("keyup.mask",g.behaviour);a.on("paste.mask",function(){setTimeout(function(){a.keydown().keyup()},100)})},destroyEvents:function(){a.off("keydown.mask").off("keyup.mask").off("paste.mask")},val:function(v){var d="input"===a.get(0).tagName.toLowerCase();return 0<arguments.length?d?a.val(v):a.text(v):d?a.val():a.text()},behaviour:function(a){a=a||window.event;if(-1===c.inArray(a.keyCode||a.which,
f.byPassKeys))return g.val(g.getMasked()),g.callbacks(a)},getMasked:function(){var a=[],c=g.val(),b=0,q=d.length,h=0,l=c.length,k=1,r="push",m=-1,n,s;e.reverse?(r="unshift",k=-1,n=0,b=q-1,h=l-1,s=function(){return-1<b&&-1<h}):(n=q-1,s=function(){return b<q&&h<l});for(;s();){var t=d.charAt(b),u=c.charAt(h),p=f.translation[t];p?(u.match(p.pattern)?(a[r](u),p.recursive&&(-1==m?m=b:b==n&&(b=m-k),n==m&&(b-=k)),b+=k):p.optional&&(b+=k,h-=k),h+=k):(a[r](t),u==t&&(h+=k),b+=k)}return a.join("")},callbacks:function(f){var c=
g.val(),b=g.val()!==l;if(!0===b&&"function"==typeof e.onChange)e.onChange(c,f,a,e);if(!0===b&&"function"==typeof e.onKeyPress)e.onKeyPress(c,f,a,e);if("function"===typeof e.onComplete&&c.length===d.length)e.onComplete(c,f,a,e)}};f.remove=function(){g.destroyEvents();g.val(f.getCleanVal()).removeAttr("maxlength")};f.getCleanVal=function(){for(var a=[],c=g.val(),b=0,e=d.length;b<e;b++)f.translation[d.charAt(b)]&&a.push(c.charAt(b));return a.join("")};f.init()};c.fn.mask=function(a,d){return this.each(function(){c(this).data("mask",
new w(this,a,d))})};c.fn.unmask=function(){return this.each(function(){try{c(this).data("mask").remove()}catch(a){}})};c("input[data-mask]").each(function(){var a=c(this),d={};"true"===a.attr("data-mask-reverse")&&(d.reverse=!0);"false"===a.attr("data-mask-maxlength")&&(d.maxlength=!1);a.mask(a.attr("data-mask"),d)})})(window.jQuery||window.Zepto);

/* ]]> */
						</script><script type="text/javascript">
							/* <![CDATA[ */
/*! jQuery UI - v1.10.4 - 2014-01-17
* http://jqueryui.com
* Includes: jquery.ui.core.js, jquery.ui.widget.js, jquery.ui.mouse.js, jquery.ui.position.js, jquery.ui.accordion.js, jquery.ui.autocomplete.js, jquery.ui.button.js, jquery.ui.datepicker.js, jquery.ui.dialog.js, jquery.ui.draggable.js, jquery.ui.droppable.js, jquery.ui.effect.js, jquery.ui.effect-blind.js, jquery.ui.effect-bounce.js, jquery.ui.effect-clip.js, jquery.ui.effect-drop.js, jquery.ui.effect-explode.js, jquery.ui.effect-fade.js, jquery.ui.effect-fold.js, jquery.ui.effect-highlight.js, jquery.ui.effect-pulsate.js, jquery.ui.effect-scale.js, jquery.ui.effect-shake.js, jquery.ui.effect-slide.js, jquery.ui.effect-transfer.js, jquery.ui.menu.js, jquery.ui.progressbar.js, jquery.ui.resizable.js, jquery.ui.selectable.js, jquery.ui.slider.js, jquery.ui.sortable.js, jquery.ui.spinner.js, jquery.ui.tabs.js, jquery.ui.tooltip.js
* Copyright 2014 jQuery Foundation and other contributors; Licensed MIT */

(function (e, t) { function i(t, i) { var s, a, o, r = t.nodeName.toLowerCase(); return "area" === r ? (s = t.parentNode, a = s.name, t.href && a && "map" === s.nodeName.toLowerCase() ? (o = e("img[usemap=#" + a + "]")[0], !!o && n(o)) : !1) : (/input|select|textarea|button|object/.test(r) ? !t.disabled : "a" === r ? t.href || i : i) && n(t) } function n(t) { return e.expr.filters.visible(t) && !e(t).parents().addBack().filter(function () { return "hidden" === e.css(this, "visibility") }).length } var s = 0, a = /^ui-id-\d+$/; e.ui = e.ui || {}, e.extend(e.ui, { version: "1.10.4", keyCode: { BACKSPACE: 8, COMMA: 188, DELETE: 46, DOWN: 40, END: 35, ENTER: 13, ESCAPE: 27, HOME: 36, LEFT: 37, NUMPAD_ADD: 107, NUMPAD_DECIMAL: 110, NUMPAD_DIVIDE: 111, NUMPAD_ENTER: 108, NUMPAD_MULTIPLY: 106, NUMPAD_SUBTRACT: 109, PAGE_DOWN: 34, PAGE_UP: 33, PERIOD: 190, RIGHT: 39, SPACE: 32, TAB: 9, UP: 38 } }), e.fn.extend({ focus: function (t) { return function (i, n) { return "number" == typeof i ? this.each(function () { var t = this; setTimeout(function () { e(t).focus(), n && n.call(t) }, i) }) : t.apply(this, arguments) } }(e.fn.focus), scrollParent: function () { var t; return t = e.ui.ie && /(static|relative)/.test(this.css("position")) || /absolute/.test(this.css("position")) ? this.parents().filter(function () { return /(relative|absolute|fixed)/.test(e.css(this, "position")) && /(auto|scroll)/.test(e.css(this, "overflow") + e.css(this, "overflow-y") + e.css(this, "overflow-x")) }).eq(0) : this.parents().filter(function () { return /(auto|scroll)/.test(e.css(this, "overflow") + e.css(this, "overflow-y") + e.css(this, "overflow-x")) }).eq(0), /fixed/.test(this.css("position")) || !t.length ? e(document) : t }, zIndex: function (i) { if (i !== t) return this.css("zIndex", i); if (this.length) for (var n, s, a = e(this[0]) ; a.length && a[0] !== document;) { if (n = a.css("position"), ("absolute" === n || "relative" === n || "fixed" === n) && (s = parseInt(a.css("zIndex"), 10), !isNaN(s) && 0 !== s)) return s; a = a.parent() } return 0 }, uniqueId: function () { return this.each(function () { this.id || (this.id = "ui-id-" + ++s) }) }, removeUniqueId: function () { return this.each(function () { a.test(this.id) && e(this).removeAttr("id") }) } }), e.extend(e.expr[":"], { data: e.expr.createPseudo ? e.expr.createPseudo(function (t) { return function (i) { return !!e.data(i, t) } }) : function (t, i, n) { return !!e.data(t, n[3]) }, focusable: function (t) { return i(t, !isNaN(e.attr(t, "tabindex"))) }, tabbable: function (t) { var n = e.attr(t, "tabindex"), s = isNaN(n); return (s || n >= 0) && i(t, !s) } }), e("<a>").outerWidth(1).jquery || e.each(["Width", "Height"], function (i, n) { function s(t, i, n, s) { return e.each(a, function () { i -= parseFloat(e.css(t, "padding" + this)) || 0, n && (i -= parseFloat(e.css(t, "border" + this + "Width")) || 0), s && (i -= parseFloat(e.css(t, "margin" + this)) || 0) }), i } var a = "Width" === n ? ["Left", "Right"] : ["Top", "Bottom"], o = n.toLowerCase(), r = { innerWidth: e.fn.innerWidth, innerHeight: e.fn.innerHeight, outerWidth: e.fn.outerWidth, outerHeight: e.fn.outerHeight }; e.fn["inner" + n] = function (i) { return i === t ? r["inner" + n].call(this) : this.each(function () { e(this).css(o, s(this, i) + "px") }) }, e.fn["outer" + n] = function (t, i) { return "number" != typeof t ? r["outer" + n].call(this, t) : this.each(function () { e(this).css(o, s(this, t, !0, i) + "px") }) } }), e.fn.addBack || (e.fn.addBack = function (e) { return this.add(null == e ? this.prevObject : this.prevObject.filter(e)) }), e("<a>").data("a-b", "a").removeData("a-b").data("a-b") && (e.fn.removeData = function (t) { return function (i) { return arguments.length ? t.call(this, e.camelCase(i)) : t.call(this) } }(e.fn.removeData)), e.ui.ie = !!/msie [\w.]+/.exec(navigator.userAgent.toLowerCase()), e.support.selectstart = "onselectstart" in document.createElement("div"), e.fn.extend({ disableSelection: function () { return this.bind((e.support.selectstart ? "selectstart" : "mousedown") + ".ui-disableSelection", function (e) { e.preventDefault() }) }, enableSelection: function () { return this.unbind(".ui-disableSelection") } }), e.extend(e.ui, { plugin: { add: function (t, i, n) { var s, a = e.ui[t].prototype; for (s in n) a.plugins[s] = a.plugins[s] || [], a.plugins[s].push([i, n[s]]) }, call: function (e, t, i) { var n, s = e.plugins[t]; if (s && e.element[0].parentNode && 11 !== e.element[0].parentNode.nodeType) for (n = 0; s.length > n; n++) e.options[s[n][0]] && s[n][1].apply(e.element, i) } }, hasScroll: function (t, i) { if ("hidden" === e(t).css("overflow")) return !1; var n = i && "left" === i ? "scrollLeft" : "scrollTop", s = !1; return t[n] > 0 ? !0 : (t[n] = 1, s = t[n] > 0, t[n] = 0, s) } }) })(jQuery); (function (t, e) { var i = 0, s = Array.prototype.slice, n = t.cleanData; t.cleanData = function (e) { for (var i, s = 0; null != (i = e[s]) ; s++) try { t(i).triggerHandler("remove") } catch (o) { } n(e) }, t.widget = function (i, s, n) { var o, a, r, h, l = {}, c = i.split(".")[0]; i = i.split(".")[1], o = c + "-" + i, n || (n = s, s = t.Widget), t.expr[":"][o.toLowerCase()] = function (e) { return !!t.data(e, o) }, t[c] = t[c] || {}, a = t[c][i], r = t[c][i] = function (t, i) { return this._createWidget ? (arguments.length && this._createWidget(t, i), e) : new r(t, i) }, t.extend(r, a, { version: n.version, _proto: t.extend({}, n), _childConstructors: [] }), h = new s, h.options = t.widget.extend({}, h.options), t.each(n, function (i, n) { return t.isFunction(n) ? (l[i] = function () { var t = function () { return s.prototype[i].apply(this, arguments) }, e = function (t) { return s.prototype[i].apply(this, t) }; return function () { var i, s = this._super, o = this._superApply; return this._super = t, this._superApply = e, i = n.apply(this, arguments), this._super = s, this._superApply = o, i } }(), e) : (l[i] = n, e) }), r.prototype = t.widget.extend(h, { widgetEventPrefix: a ? h.widgetEventPrefix || i : i }, l, { constructor: r, namespace: c, widgetName: i, widgetFullName: o }), a ? (t.each(a._childConstructors, function (e, i) { var s = i.prototype; t.widget(s.namespace + "." + s.widgetName, r, i._proto) }), delete a._childConstructors) : s._childConstructors.push(r), t.widget.bridge(i, r) }, t.widget.extend = function (i) { for (var n, o, a = s.call(arguments, 1), r = 0, h = a.length; h > r; r++) for (n in a[r]) o = a[r][n], a[r].hasOwnProperty(n) && o !== e && (i[n] = t.isPlainObject(o) ? t.isPlainObject(i[n]) ? t.widget.extend({}, i[n], o) : t.widget.extend({}, o) : o); return i }, t.widget.bridge = function (i, n) { var o = n.prototype.widgetFullName || i; t.fn[i] = function (a) { var r = "string" == typeof a, h = s.call(arguments, 1), l = this; return a = !r && h.length ? t.widget.extend.apply(null, [a].concat(h)) : a, r ? this.each(function () { var s, n = t.data(this, o); return n ? t.isFunction(n[a]) && "_" !== a.charAt(0) ? (s = n[a].apply(n, h), s !== n && s !== e ? (l = s && s.jquery ? l.pushStack(s.get()) : s, !1) : e) : t.error("no such method '" + a + "' for " + i + " widget instance") : t.error("cannot call methods on " + i + " prior to initialization; " + "attempted to call method '" + a + "'") }) : this.each(function () { var e = t.data(this, o); e ? e.option(a || {})._init() : t.data(this, o, new n(a, this)) }), l } }, t.Widget = function () { }, t.Widget._childConstructors = [], t.Widget.prototype = { widgetName: "widget", widgetEventPrefix: "", defaultElement: "<div>", options: { disabled: !1, create: null }, _createWidget: function (e, s) { s = t(s || this.defaultElement || this)[0], this.element = t(s), this.uuid = i++, this.eventNamespace = "." + this.widgetName + this.uuid, this.options = t.widget.extend({}, this.options, this._getCreateOptions(), e), this.bindings = t(), this.hoverable = t(), this.focusable = t(), s !== this && (t.data(s, this.widgetFullName, this), this._on(!0, this.element, { remove: function (t) { t.target === s && this.destroy() } }), this.document = t(s.style ? s.ownerDocument : s.document || s), this.window = t(this.document[0].defaultView || this.document[0].parentWindow)), this._create(), this._trigger("create", null, this._getCreateEventData()), this._init() }, _getCreateOptions: t.noop, _getCreateEventData: t.noop, _create: t.noop, _init: t.noop, destroy: function () { this._destroy(), this.element.unbind(this.eventNamespace).removeData(this.widgetName).removeData(this.widgetFullName).removeData(t.camelCase(this.widgetFullName)), this.widget().unbind(this.eventNamespace).removeAttr("aria-disabled").removeClass(this.widgetFullName + "-disabled " + "ui-state-disabled"), this.bindings.unbind(this.eventNamespace), this.hoverable.removeClass("ui-state-hover"), this.focusable.removeClass("ui-state-focus") }, _destroy: t.noop, widget: function () { return this.element }, option: function (i, s) { var n, o, a, r = i; if (0 === arguments.length) return t.widget.extend({}, this.options); if ("string" == typeof i) if (r = {}, n = i.split("."), i = n.shift(), n.length) { for (o = r[i] = t.widget.extend({}, this.options[i]), a = 0; n.length - 1 > a; a++) o[n[a]] = o[n[a]] || {}, o = o[n[a]]; if (i = n.pop(), 1 === arguments.length) return o[i] === e ? null : o[i]; o[i] = s } else { if (1 === arguments.length) return this.options[i] === e ? null : this.options[i]; r[i] = s } return this._setOptions(r), this }, _setOptions: function (t) { var e; for (e in t) this._setOption(e, t[e]); return this }, _setOption: function (t, e) { return this.options[t] = e, "disabled" === t && (this.widget().toggleClass(this.widgetFullName + "-disabled ui-state-disabled", !!e).attr("aria-disabled", e), this.hoverable.removeClass("ui-state-hover"), this.focusable.removeClass("ui-state-focus")), this }, enable: function () { return this._setOption("disabled", !1) }, disable: function () { return this._setOption("disabled", !0) }, _on: function (i, s, n) { var o, a = this; "boolean" != typeof i && (n = s, s = i, i = !1), n ? (s = o = t(s), this.bindings = this.bindings.add(s)) : (n = s, s = this.element, o = this.widget()), t.each(n, function (n, r) { function h() { return i || a.options.disabled !== !0 && !t(this).hasClass("ui-state-disabled") ? ("string" == typeof r ? a[r] : r).apply(a, arguments) : e } "string" != typeof r && (h.guid = r.guid = r.guid || h.guid || t.guid++); var l = n.match(/^(\w+)\s*(.*)$/), c = l[1] + a.eventNamespace, u = l[2]; u ? o.delegate(u, c, h) : s.bind(c, h) }) }, _off: function (t, e) { e = (e || "").split(" ").join(this.eventNamespace + " ") + this.eventNamespace, t.unbind(e).undelegate(e) }, _delay: function (t, e) { function i() { return ("string" == typeof t ? s[t] : t).apply(s, arguments) } var s = this; return setTimeout(i, e || 0) }, _hoverable: function (e) { this.hoverable = this.hoverable.add(e), this._on(e, { mouseenter: function (e) { t(e.currentTarget).addClass("ui-state-hover") }, mouseleave: function (e) { t(e.currentTarget).removeClass("ui-state-hover") } }) }, _focusable: function (e) { this.focusable = this.focusable.add(e), this._on(e, { focusin: function (e) { t(e.currentTarget).addClass("ui-state-focus") }, focusout: function (e) { t(e.currentTarget).removeClass("ui-state-focus") } }) }, _trigger: function (e, i, s) { var n, o, a = this.options[e]; if (s = s || {}, i = t.Event(i), i.type = (e === this.widgetEventPrefix ? e : this.widgetEventPrefix + e).toLowerCase(), i.target = this.element[0], o = i.originalEvent) for (n in o) n in i || (i[n] = o[n]); return this.element.trigger(i, s), !(t.isFunction(a) && a.apply(this.element[0], [i].concat(s)) === !1 || i.isDefaultPrevented()) } }, t.each({ show: "fadeIn", hide: "fadeOut" }, function (e, i) { t.Widget.prototype["_" + e] = function (s, n, o) { "string" == typeof n && (n = { effect: n }); var a, r = n ? n === !0 || "number" == typeof n ? i : n.effect || i : e; n = n || {}, "number" == typeof n && (n = { duration: n }), a = !t.isEmptyObject(n), n.complete = o, n.delay && s.delay(n.delay), a && t.effects && t.effects.effect[r] ? s[e](n) : r !== e && s[r] ? s[r](n.duration, n.easing, o) : s.queue(function (i) { t(this)[e](), o && o.call(s[0]), i() }) } }) })(jQuery); (function (t) { var e = !1; t(document).mouseup(function () { e = !1 }), t.widget("ui.mouse", { version: "1.10.4", options: { cancel: "input,textarea,button,select,option", distance: 1, delay: 0 }, _mouseInit: function () { var e = this; this.element.bind("mousedown." + this.widgetName, function (t) { return e._mouseDown(t) }).bind("click." + this.widgetName, function (i) { return !0 === t.data(i.target, e.widgetName + ".preventClickEvent") ? (t.removeData(i.target, e.widgetName + ".preventClickEvent"), i.stopImmediatePropagation(), !1) : undefined }), this.started = !1 }, _mouseDestroy: function () { this.element.unbind("." + this.widgetName), this._mouseMoveDelegate && t(document).unbind("mousemove." + this.widgetName, this._mouseMoveDelegate).unbind("mouseup." + this.widgetName, this._mouseUpDelegate) }, _mouseDown: function (i) { if (!e) { this._mouseStarted && this._mouseUp(i), this._mouseDownEvent = i; var s = this, n = 1 === i.which, a = "string" == typeof this.options.cancel && i.target.nodeName ? t(i.target).closest(this.options.cancel).length : !1; return n && !a && this._mouseCapture(i) ? (this.mouseDelayMet = !this.options.delay, this.mouseDelayMet || (this._mouseDelayTimer = setTimeout(function () { s.mouseDelayMet = !0 }, this.options.delay)), this._mouseDistanceMet(i) && this._mouseDelayMet(i) && (this._mouseStarted = this._mouseStart(i) !== !1, !this._mouseStarted) ? (i.preventDefault(), !0) : (!0 === t.data(i.target, this.widgetName + ".preventClickEvent") && t.removeData(i.target, this.widgetName + ".preventClickEvent"), this._mouseMoveDelegate = function (t) { return s._mouseMove(t) }, this._mouseUpDelegate = function (t) { return s._mouseUp(t) }, t(document).bind("mousemove." + this.widgetName, this._mouseMoveDelegate).bind("mouseup." + this.widgetName, this._mouseUpDelegate), i.preventDefault(), e = !0, !0)) : !0 } }, _mouseMove: function (e) { return t.ui.ie && (!document.documentMode || 9 > document.documentMode) && !e.button ? this._mouseUp(e) : this._mouseStarted ? (this._mouseDrag(e), e.preventDefault()) : (this._mouseDistanceMet(e) && this._mouseDelayMet(e) && (this._mouseStarted = this._mouseStart(this._mouseDownEvent, e) !== !1, this._mouseStarted ? this._mouseDrag(e) : this._mouseUp(e)), !this._mouseStarted) }, _mouseUp: function (e) { return t(document).unbind("mousemove." + this.widgetName, this._mouseMoveDelegate).unbind("mouseup." + this.widgetName, this._mouseUpDelegate), this._mouseStarted && (this._mouseStarted = !1, e.target === this._mouseDownEvent.target && t.data(e.target, this.widgetName + ".preventClickEvent", !0), this._mouseStop(e)), !1 }, _mouseDistanceMet: function (t) { return Math.max(Math.abs(this._mouseDownEvent.pageX - t.pageX), Math.abs(this._mouseDownEvent.pageY - t.pageY)) >= this.options.distance }, _mouseDelayMet: function () { return this.mouseDelayMet }, _mouseStart: function () { }, _mouseDrag: function () { }, _mouseStop: function () { }, _mouseCapture: function () { return !0 } }) })(jQuery); (function (t, e) { function i(t, e, i) { return [parseFloat(t[0]) * (p.test(t[0]) ? e / 100 : 1), parseFloat(t[1]) * (p.test(t[1]) ? i / 100 : 1)] } function s(e, i) { return parseInt(t.css(e, i), 10) || 0 } function n(e) { var i = e[0]; return 9 === i.nodeType ? { width: e.width(), height: e.height(), offset: { top: 0, left: 0 } } : t.isWindow(i) ? { width: e.width(), height: e.height(), offset: { top: e.scrollTop(), left: e.scrollLeft() } } : i.preventDefault ? { width: 0, height: 0, offset: { top: i.pageY, left: i.pageX } } : { width: e.outerWidth(), height: e.outerHeight(), offset: e.offset() } } t.ui = t.ui || {}; var a, o = Math.max, r = Math.abs, l = Math.round, h = /left|center|right/, c = /top|center|bottom/, u = /[\+\-]\d+(\.[\d]+)?%?/, d = /^\w+/, p = /%$/, f = t.fn.position; t.position = { scrollbarWidth: function () { if (a !== e) return a; var i, s, n = t("<div style='display:block;position:absolute;width:50px;height:50px;overflow:hidden;'><div style='height:100px;width:auto;'></div></div>"), o = n.children()[0]; return t("body").append(n), i = o.offsetWidth, n.css("overflow", "scroll"), s = o.offsetWidth, i === s && (s = n[0].clientWidth), n.remove(), a = i - s }, getScrollInfo: function (e) { var i = e.isWindow || e.isDocument ? "" : e.element.css("overflow-x"), s = e.isWindow || e.isDocument ? "" : e.element.css("overflow-y"), n = "scroll" === i || "auto" === i && e.width < e.element[0].scrollWidth, a = "scroll" === s || "auto" === s && e.height < e.element[0].scrollHeight; return { width: a ? t.position.scrollbarWidth() : 0, height: n ? t.position.scrollbarWidth() : 0 } }, getWithinInfo: function (e) { var i = t(e || window), s = t.isWindow(i[0]), n = !!i[0] && 9 === i[0].nodeType; return { element: i, isWindow: s, isDocument: n, offset: i.offset() || { left: 0, top: 0 }, scrollLeft: i.scrollLeft(), scrollTop: i.scrollTop(), width: s ? i.width() : i.outerWidth(), height: s ? i.height() : i.outerHeight() } } }, t.fn.position = function (e) { if (!e || !e.of) return f.apply(this, arguments); e = t.extend({}, e); var a, p, g, m, v, _, b = t(e.of), y = t.position.getWithinInfo(e.within), k = t.position.getScrollInfo(y), w = (e.collision || "flip").split(" "), D = {}; return _ = n(b), b[0].preventDefault && (e.at = "left top"), p = _.width, g = _.height, m = _.offset, v = t.extend({}, m), t.each(["my", "at"], function () { var t, i, s = (e[this] || "").split(" "); 1 === s.length && (s = h.test(s[0]) ? s.concat(["center"]) : c.test(s[0]) ? ["center"].concat(s) : ["center", "center"]), s[0] = h.test(s[0]) ? s[0] : "center", s[1] = c.test(s[1]) ? s[1] : "center", t = u.exec(s[0]), i = u.exec(s[1]), D[this] = [t ? t[0] : 0, i ? i[0] : 0], e[this] = [d.exec(s[0])[0], d.exec(s[1])[0]] }), 1 === w.length && (w[1] = w[0]), "right" === e.at[0] ? v.left += p : "center" === e.at[0] && (v.left += p / 2), "bottom" === e.at[1] ? v.top += g : "center" === e.at[1] && (v.top += g / 2), a = i(D.at, p, g), v.left += a[0], v.top += a[1], this.each(function () { var n, h, c = t(this), u = c.outerWidth(), d = c.outerHeight(), f = s(this, "marginLeft"), _ = s(this, "marginTop"), x = u + f + s(this, "marginRight") + k.width, C = d + _ + s(this, "marginBottom") + k.height, M = t.extend({}, v), T = i(D.my, c.outerWidth(), c.outerHeight()); "right" === e.my[0] ? M.left -= u : "center" === e.my[0] && (M.left -= u / 2), "bottom" === e.my[1] ? M.top -= d : "center" === e.my[1] && (M.top -= d / 2), M.left += T[0], M.top += T[1], t.support.offsetFractions || (M.left = l(M.left), M.top = l(M.top)), n = { marginLeft: f, marginTop: _ }, t.each(["left", "top"], function (i, s) { t.ui.position[w[i]] && t.ui.position[w[i]][s](M, { targetWidth: p, targetHeight: g, elemWidth: u, elemHeight: d, collisionPosition: n, collisionWidth: x, collisionHeight: C, offset: [a[0] + T[0], a[1] + T[1]], my: e.my, at: e.at, within: y, elem: c }) }), e.using && (h = function (t) { var i = m.left - M.left, s = i + p - u, n = m.top - M.top, a = n + g - d, l = { target: { element: b, left: m.left, top: m.top, width: p, height: g }, element: { element: c, left: M.left, top: M.top, width: u, height: d }, horizontal: 0 > s ? "left" : i > 0 ? "right" : "center", vertical: 0 > a ? "top" : n > 0 ? "bottom" : "middle" }; u > p && p > r(i + s) && (l.horizontal = "center"), d > g && g > r(n + a) && (l.vertical = "middle"), l.important = o(r(i), r(s)) > o(r(n), r(a)) ? "horizontal" : "vertical", e.using.call(this, t, l) }), c.offset(t.extend(M, { using: h })) }) }, t.ui.position = { fit: { left: function (t, e) { var i, s = e.within, n = s.isWindow ? s.scrollLeft : s.offset.left, a = s.width, r = t.left - e.collisionPosition.marginLeft, l = n - r, h = r + e.collisionWidth - a - n; e.collisionWidth > a ? l > 0 && 0 >= h ? (i = t.left + l + e.collisionWidth - a - n, t.left += l - i) : t.left = h > 0 && 0 >= l ? n : l > h ? n + a - e.collisionWidth : n : l > 0 ? t.left += l : h > 0 ? t.left -= h : t.left = o(t.left - r, t.left) }, top: function (t, e) { var i, s = e.within, n = s.isWindow ? s.scrollTop : s.offset.top, a = e.within.height, r = t.top - e.collisionPosition.marginTop, l = n - r, h = r + e.collisionHeight - a - n; e.collisionHeight > a ? l > 0 && 0 >= h ? (i = t.top + l + e.collisionHeight - a - n, t.top += l - i) : t.top = h > 0 && 0 >= l ? n : l > h ? n + a - e.collisionHeight : n : l > 0 ? t.top += l : h > 0 ? t.top -= h : t.top = o(t.top - r, t.top) } }, flip: { left: function (t, e) { var i, s, n = e.within, a = n.offset.left + n.scrollLeft, o = n.width, l = n.isWindow ? n.scrollLeft : n.offset.left, h = t.left - e.collisionPosition.marginLeft, c = h - l, u = h + e.collisionWidth - o - l, d = "left" === e.my[0] ? -e.elemWidth : "right" === e.my[0] ? e.elemWidth : 0, p = "left" === e.at[0] ? e.targetWidth : "right" === e.at[0] ? -e.targetWidth : 0, f = -2 * e.offset[0]; 0 > c ? (i = t.left + d + p + f + e.collisionWidth - o - a, (0 > i || r(c) > i) && (t.left += d + p + f)) : u > 0 && (s = t.left - e.collisionPosition.marginLeft + d + p + f - l, (s > 0 || u > r(s)) && (t.left += d + p + f)) }, top: function (t, e) { var i, s, n = e.within, a = n.offset.top + n.scrollTop, o = n.height, l = n.isWindow ? n.scrollTop : n.offset.top, h = t.top - e.collisionPosition.marginTop, c = h - l, u = h + e.collisionHeight - o - l, d = "top" === e.my[1], p = d ? -e.elemHeight : "bottom" === e.my[1] ? e.elemHeight : 0, f = "top" === e.at[1] ? e.targetHeight : "bottom" === e.at[1] ? -e.targetHeight : 0, g = -2 * e.offset[1]; 0 > c ? (s = t.top + p + f + g + e.collisionHeight - o - a, t.top + p + f + g > c && (0 > s || r(c) > s) && (t.top += p + f + g)) : u > 0 && (i = t.top - e.collisionPosition.marginTop + p + f + g - l, t.top + p + f + g > u && (i > 0 || u > r(i)) && (t.top += p + f + g)) } }, flipfit: { left: function () { t.ui.position.flip.left.apply(this, arguments), t.ui.position.fit.left.apply(this, arguments) }, top: function () { t.ui.position.flip.top.apply(this, arguments), t.ui.position.fit.top.apply(this, arguments) } } }, function () { var e, i, s, n, a, o = document.getElementsByTagName("body")[0], r = document.createElement("div"); e = document.createElement(o ? "div" : "body"), s = { visibility: "hidden", width: 0, height: 0, border: 0, margin: 0, background: "none" }, o && t.extend(s, { position: "absolute", left: "-1000px", top: "-1000px" }); for (a in s) e.style[a] = s[a]; e.appendChild(r), i = o || document.documentElement, i.insertBefore(e, i.firstChild), r.style.cssText = "position: absolute; left: 10.7432222px;", n = t(r).offset().left, t.support.offsetFractions = n > 10 && 11 > n, e.innerHTML = "", i.removeChild(e) }() })(jQuery); (function (e) { var t = 0, i = {}, a = {}; i.height = i.paddingTop = i.paddingBottom = i.borderTopWidth = i.borderBottomWidth = "hide", a.height = a.paddingTop = a.paddingBottom = a.borderTopWidth = a.borderBottomWidth = "show", e.widget("ui.accordion", { version: "1.10.4", options: { active: 0, animate: {}, collapsible: !1, event: "click", header: "> li > :first-child,> :not(li):even", heightStyle: "auto", icons: { activeHeader: "ui-icon-triangle-1-s", header: "ui-icon-triangle-1-e" }, activate: null, beforeActivate: null }, _create: function () { var t = this.options; this.prevShow = this.prevHide = e(), this.element.addClass("ui-accordion ui-widget ui-helper-reset").attr("role", "tablist"), t.collapsible || t.active !== !1 && null != t.active || (t.active = 0), this._processPanels(), 0 > t.active && (t.active += this.headers.length), this._refresh() }, _getCreateEventData: function () { return { header: this.active, panel: this.active.length ? this.active.next() : e(), content: this.active.length ? this.active.next() : e() } }, _createIcons: function () { var t = this.options.icons; t && (e("<span>").addClass("ui-accordion-header-icon ui-icon " + t.header).prependTo(this.headers), this.active.children(".ui-accordion-header-icon").removeClass(t.header).addClass(t.activeHeader), this.headers.addClass("ui-accordion-icons")) }, _destroyIcons: function () { this.headers.removeClass("ui-accordion-icons").children(".ui-accordion-header-icon").remove() }, _destroy: function () { var e; this.element.removeClass("ui-accordion ui-widget ui-helper-reset").removeAttr("role"), this.headers.removeClass("ui-accordion-header ui-accordion-header-active ui-helper-reset ui-state-default ui-corner-all ui-state-active ui-state-disabled ui-corner-top").removeAttr("role").removeAttr("aria-expanded").removeAttr("aria-selected").removeAttr("aria-controls").removeAttr("tabIndex").each(function () { /^ui-accordion/.test(this.id) && this.removeAttribute("id") }), this._destroyIcons(), e = this.headers.next().css("display", "").removeAttr("role").removeAttr("aria-hidden").removeAttr("aria-labelledby").removeClass("ui-helper-reset ui-widget-content ui-corner-bottom ui-accordion-content ui-accordion-content-active ui-state-disabled").each(function () { /^ui-accordion/.test(this.id) && this.removeAttribute("id") }), "content" !== this.options.heightStyle && e.css("height", "") }, _setOption: function (e, t) { return "active" === e ? (this._activate(t), undefined) : ("event" === e && (this.options.event && this._off(this.headers, this.options.event), this._setupEvents(t)), this._super(e, t), "collapsible" !== e || t || this.options.active !== !1 || this._activate(0), "icons" === e && (this._destroyIcons(), t && this._createIcons()), "disabled" === e && this.headers.add(this.headers.next()).toggleClass("ui-state-disabled", !!t), undefined) }, _keydown: function (t) { if (!t.altKey && !t.ctrlKey) { var i = e.ui.keyCode, a = this.headers.length, s = this.headers.index(t.target), n = !1; switch (t.keyCode) { case i.RIGHT: case i.DOWN: n = this.headers[(s + 1) % a]; break; case i.LEFT: case i.UP: n = this.headers[(s - 1 + a) % a]; break; case i.SPACE: case i.ENTER: this._eventHandler(t); break; case i.HOME: n = this.headers[0]; break; case i.END: n = this.headers[a - 1] } n && (e(t.target).attr("tabIndex", -1), e(n).attr("tabIndex", 0), n.focus(), t.preventDefault()) } }, _panelKeyDown: function (t) { t.keyCode === e.ui.keyCode.UP && t.ctrlKey && e(t.currentTarget).prev().focus() }, refresh: function () { var t = this.options; this._processPanels(), t.active === !1 && t.collapsible === !0 || !this.headers.length ? (t.active = !1, this.active = e()) : t.active === !1 ? this._activate(0) : this.active.length && !e.contains(this.element[0], this.active[0]) ? this.headers.length === this.headers.find(".ui-state-disabled").length ? (t.active = !1, this.active = e()) : this._activate(Math.max(0, t.active - 1)) : t.active = this.headers.index(this.active), this._destroyIcons(), this._refresh() }, _processPanels: function () { this.headers = this.element.find(this.options.header).addClass("ui-accordion-header ui-helper-reset ui-state-default ui-corner-all"), this.headers.next().addClass("ui-accordion-content ui-helper-reset ui-widget-content ui-corner-bottom").filter(":not(.ui-accordion-content-active)").hide() }, _refresh: function () { var i, a = this.options, s = a.heightStyle, n = this.element.parent(), r = this.accordionId = "ui-accordion-" + (this.element.attr("id") || ++t); this.active = this._findActive(a.active).addClass("ui-accordion-header-active ui-state-active ui-corner-top").removeClass("ui-corner-all"), this.active.next().addClass("ui-accordion-content-active").show(), this.headers.attr("role", "tab").each(function (t) { var i = e(this), a = i.attr("id"), s = i.next(), n = s.attr("id"); a || (a = r + "-header-" + t, i.attr("id", a)), n || (n = r + "-panel-" + t, s.attr("id", n)), i.attr("aria-controls", n), s.attr("aria-labelledby", a) }).next().attr("role", "tabpanel"), this.headers.not(this.active).attr({ "aria-selected": "false", "aria-expanded": "false", tabIndex: -1 }).next().attr({ "aria-hidden": "true" }).hide(), this.active.length ? this.active.attr({ "aria-selected": "true", "aria-expanded": "true", tabIndex: 0 }).next().attr({ "aria-hidden": "false" }) : this.headers.eq(0).attr("tabIndex", 0), this._createIcons(), this._setupEvents(a.event), "fill" === s ? (i = n.height(), this.element.siblings(":visible").each(function () { var t = e(this), a = t.css("position"); "absolute" !== a && "fixed" !== a && (i -= t.outerHeight(!0)) }), this.headers.each(function () { i -= e(this).outerHeight(!0) }), this.headers.next().each(function () { e(this).height(Math.max(0, i - e(this).innerHeight() + e(this).height())) }).css("overflow", "auto")) : "auto" === s && (i = 0, this.headers.next().each(function () { i = Math.max(i, e(this).css("height", "").height()) }).height(i)) }, _activate: function (t) { var i = this._findActive(t)[0]; i !== this.active[0] && (i = i || this.active[0], this._eventHandler({ target: i, currentTarget: i, preventDefault: e.noop })) }, _findActive: function (t) { return "number" == typeof t ? this.headers.eq(t) : e() }, _setupEvents: function (t) { var i = { keydown: "_keydown" }; t && e.each(t.split(" "), function (e, t) { i[t] = "_eventHandler" }), this._off(this.headers.add(this.headers.next())), this._on(this.headers, i), this._on(this.headers.next(), { keydown: "_panelKeyDown" }), this._hoverable(this.headers), this._focusable(this.headers) }, _eventHandler: function (t) { var i = this.options, a = this.active, s = e(t.currentTarget), n = s[0] === a[0], r = n && i.collapsible, o = r ? e() : s.next(), h = a.next(), d = { oldHeader: a, oldPanel: h, newHeader: r ? e() : s, newPanel: o }; t.preventDefault(), n && !i.collapsible || this._trigger("beforeActivate", t, d) === !1 || (i.active = r ? !1 : this.headers.index(s), this.active = n ? e() : s, this._toggle(d), a.removeClass("ui-accordion-header-active ui-state-active"), i.icons && a.children(".ui-accordion-header-icon").removeClass(i.icons.activeHeader).addClass(i.icons.header), n || (s.removeClass("ui-corner-all").addClass("ui-accordion-header-active ui-state-active ui-corner-top"), i.icons && s.children(".ui-accordion-header-icon").removeClass(i.icons.header).addClass(i.icons.activeHeader), s.next().addClass("ui-accordion-content-active"))) }, _toggle: function (t) { var i = t.newPanel, a = this.prevShow.length ? this.prevShow : t.oldPanel; this.prevShow.add(this.prevHide).stop(!0, !0), this.prevShow = i, this.prevHide = a, this.options.animate ? this._animate(i, a, t) : (a.hide(), i.show(), this._toggleComplete(t)), a.attr({ "aria-hidden": "true" }), a.prev().attr("aria-selected", "false"), i.length && a.length ? a.prev().attr({ tabIndex: -1, "aria-expanded": "false" }) : i.length && this.headers.filter(function () { return 0 === e(this).attr("tabIndex") }).attr("tabIndex", -1), i.attr("aria-hidden", "false").prev().attr({ "aria-selected": "true", tabIndex: 0, "aria-expanded": "true" }) }, _animate: function (e, t, s) { var n, r, o, h = this, d = 0, c = e.length && (!t.length || e.index() < t.index()), l = this.options.animate || {}, u = c && l.down || l, v = function () { h._toggleComplete(s) }; return "number" == typeof u && (o = u), "string" == typeof u && (r = u), r = r || u.easing || l.easing, o = o || u.duration || l.duration, t.length ? e.length ? (n = e.show().outerHeight(), t.animate(i, { duration: o, easing: r, step: function (e, t) { t.now = Math.round(e) } }), e.hide().animate(a, { duration: o, easing: r, complete: v, step: function (e, i) { i.now = Math.round(e), "height" !== i.prop ? d += i.now : "content" !== h.options.heightStyle && (i.now = Math.round(n - t.outerHeight() - d), d = 0) } }), undefined) : t.animate(i, o, r, v) : e.animate(a, o, r, v) }, _toggleComplete: function (e) { var t = e.oldPanel; t.removeClass("ui-accordion-content-active").prev().removeClass("ui-corner-top").addClass("ui-corner-all"), t.length && (t.parent()[0].className = t.parent()[0].className), this._trigger("activate", null, e) } }) })(jQuery); (function (e) { e.widget("ui.autocomplete", { version: "1.10.4", defaultElement: "<input>", options: { appendTo: null, autoFocus: !1, delay: 300, minLength: 1, position: { my: "left top", at: "left bottom", collision: "none" }, source: null, change: null, close: null, focus: null, open: null, response: null, search: null, select: null }, requestIndex: 0, pending: 0, _create: function () { var t, i, s, n = this.element[0].nodeName.toLowerCase(), a = "textarea" === n, o = "input" === n; this.isMultiLine = a ? !0 : o ? !1 : this.element.prop("isContentEditable"), this.valueMethod = this.element[a || o ? "val" : "text"], this.isNewMenu = !0, this.element.addClass("ui-autocomplete-input").attr("autocomplete", "off"), this._on(this.element, { keydown: function (n) { if (this.element.prop("readOnly")) return t = !0, s = !0, i = !0, undefined; t = !1, s = !1, i = !1; var a = e.ui.keyCode; switch (n.keyCode) { case a.PAGE_UP: t = !0, this._move("previousPage", n); break; case a.PAGE_DOWN: t = !0, this._move("nextPage", n); break; case a.UP: t = !0, this._keyEvent("previous", n); break; case a.DOWN: t = !0, this._keyEvent("next", n); break; case a.ENTER: case a.NUMPAD_ENTER: this.menu.active && (t = !0, n.preventDefault(), this.menu.select(n)); break; case a.TAB: this.menu.active && this.menu.select(n); break; case a.ESCAPE: this.menu.element.is(":visible") && (this._value(this.term), this.close(n), n.preventDefault()); break; default: i = !0, this._searchTimeout(n) } }, keypress: function (s) { if (t) return t = !1, (!this.isMultiLine || this.menu.element.is(":visible")) && s.preventDefault(), undefined; if (!i) { var n = e.ui.keyCode; switch (s.keyCode) { case n.PAGE_UP: this._move("previousPage", s); break; case n.PAGE_DOWN: this._move("nextPage", s); break; case n.UP: this._keyEvent("previous", s); break; case n.DOWN: this._keyEvent("next", s) } } }, input: function (e) { return s ? (s = !1, e.preventDefault(), undefined) : (this._searchTimeout(e), undefined) }, focus: function () { this.selectedItem = null, this.previous = this._value() }, blur: function (e) { return this.cancelBlur ? (delete this.cancelBlur, undefined) : (clearTimeout(this.searching), this.close(e), this._change(e), undefined) } }), this._initSource(), this.menu = e("<ul>").addClass("ui-autocomplete ui-front").appendTo(this._appendTo()).menu({ role: null }).hide().data("ui-menu"), this._on(this.menu.element, { mousedown: function (t) { t.preventDefault(), this.cancelBlur = !0, this._delay(function () { delete this.cancelBlur }); var i = this.menu.element[0]; e(t.target).closest(".ui-menu-item").length || this._delay(function () { var t = this; this.document.one("mousedown", function (s) { s.target === t.element[0] || s.target === i || e.contains(i, s.target) || t.close() }) }) }, menufocus: function (t, i) { if (this.isNewMenu && (this.isNewMenu = !1, t.originalEvent && /^mouse/.test(t.originalEvent.type))) return this.menu.blur(), this.document.one("mousemove", function () { e(t.target).trigger(t.originalEvent) }), undefined; var s = i.item.data("ui-autocomplete-item"); !1 !== this._trigger("focus", t, { item: s }) ? t.originalEvent && /^key/.test(t.originalEvent.type) && this._value(s.value) : this.liveRegion.text(s.value) }, menuselect: function (e, t) { var i = t.item.data("ui-autocomplete-item"), s = this.previous; this.element[0] !== this.document[0].activeElement && (this.element.focus(), this.previous = s, this._delay(function () { this.previous = s, this.selectedItem = i })), !1 !== this._trigger("select", e, { item: i }) && this._value(i.value), this.term = this._value(), this.close(e), this.selectedItem = i } }), this.liveRegion = e("<span>", { role: "status", "aria-live": "polite" }).addClass("ui-helper-hidden-accessible").insertBefore(this.element), this._on(this.window, { beforeunload: function () { this.element.removeAttr("autocomplete") } }) }, _destroy: function () { clearTimeout(this.searching), this.element.removeClass("ui-autocomplete-input").removeAttr("autocomplete"), this.menu.element.remove(), this.liveRegion.remove() }, _setOption: function (e, t) { this._super(e, t), "source" === e && this._initSource(), "appendTo" === e && this.menu.element.appendTo(this._appendTo()), "disabled" === e && t && this.xhr && this.xhr.abort() }, _appendTo: function () { var t = this.options.appendTo; return t && (t = t.jquery || t.nodeType ? e(t) : this.document.find(t).eq(0)), t || (t = this.element.closest(".ui-front")), t.length || (t = this.document[0].body), t }, _initSource: function () { var t, i, s = this; e.isArray(this.options.source) ? (t = this.options.source, this.source = function (i, s) { s(e.ui.autocomplete.filter(t, i.term)) }) : "string" == typeof this.options.source ? (i = this.options.source, this.source = function (t, n) { s.xhr && s.xhr.abort(), s.xhr = e.ajax({ url: i, data: t, dataType: "json", success: function (e) { n(e) }, error: function () { n([]) } }) }) : this.source = this.options.source }, _searchTimeout: function (e) { clearTimeout(this.searching), this.searching = this._delay(function () { this.term !== this._value() && (this.selectedItem = null, this.search(null, e)) }, this.options.delay) }, search: function (e, t) { return e = null != e ? e : this._value(), this.term = this._value(), e.length < this.options.minLength ? this.close(t) : this._trigger("search", t) !== !1 ? this._search(e) : undefined }, _search: function (e) { this.pending++, this.element.addClass("ui-autocomplete-loading"), this.cancelSearch = !1, this.source({ term: e }, this._response()) }, _response: function () { var t = ++this.requestIndex; return e.proxy(function (e) { t === this.requestIndex && this.__response(e), this.pending--, this.pending || this.element.removeClass("ui-autocomplete-loading") }, this) }, __response: function (e) { e && (e = this._normalize(e)), this._trigger("response", null, { content: e }), !this.options.disabled && e && e.length && !this.cancelSearch ? (this._suggest(e), this._trigger("open")) : this._close() }, close: function (e) { this.cancelSearch = !0, this._close(e) }, _close: function (e) { this.menu.element.is(":visible") && (this.menu.element.hide(), this.menu.blur(), this.isNewMenu = !0, this._trigger("close", e)) }, _change: function (e) { this.previous !== this._value() && this._trigger("change", e, { item: this.selectedItem }) }, _normalize: function (t) { return t.length && t[0].label && t[0].value ? t : e.map(t, function (t) { return "string" == typeof t ? { label: t, value: t } : e.extend({ label: t.label || t.value, value: t.value || t.label }, t) }) }, _suggest: function (t) { var i = this.menu.element.empty(); this._renderMenu(i, t), this.isNewMenu = !0, this.menu.refresh(), i.show(), this._resizeMenu(), i.position(e.extend({ of: this.element }, this.options.position)), this.options.autoFocus && this.menu.next() }, _resizeMenu: function () { var e = this.menu.element; e.outerWidth(Math.max(e.width("").outerWidth() + 1, this.element.outerWidth())) }, _renderMenu: function (t, i) { var s = this; e.each(i, function (e, i) { s._renderItemData(t, i) }) }, _renderItemData: function (e, t) { return this._renderItem(e, t).data("ui-autocomplete-item", t) }, _renderItem: function (t, i) { return e("<li>").append(e("<a>").text(i.label)).appendTo(t) }, _move: function (e, t) { return this.menu.element.is(":visible") ? this.menu.isFirstItem() && /^previous/.test(e) || this.menu.isLastItem() && /^next/.test(e) ? (this._value(this.term), this.menu.blur(), undefined) : (this.menu[e](t), undefined) : (this.search(null, t), undefined) }, widget: function () { return this.menu.element }, _value: function () { return this.valueMethod.apply(this.element, arguments) }, _keyEvent: function (e, t) { (!this.isMultiLine || this.menu.element.is(":visible")) && (this._move(e, t), t.preventDefault()) } }), e.extend(e.ui.autocomplete, { escapeRegex: function (e) { return e.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g, "\\$&") }, filter: function (t, i) { var s = RegExp(e.ui.autocomplete.escapeRegex(i), "i"); return e.grep(t, function (e) { return s.test(e.label || e.value || e) }) } }), e.widget("ui.autocomplete", e.ui.autocomplete, { options: { messages: { noResults: "No search results.", results: function (e) { return e + (e > 1 ? " results are" : " result is") + " available, use up and down arrow keys to navigate." } } }, __response: function (e) { var t; this._superApply(arguments), this.options.disabled || this.cancelSearch || (t = e && e.length ? this.options.messages.results(e.length) : this.options.messages.noResults, this.liveRegion.text(t)) } }) })(jQuery); (function (e) { var t, i = "ui-button ui-widget ui-state-default ui-corner-all", n = "ui-button-icons-only ui-button-icon-only ui-button-text-icons ui-button-text-icon-primary ui-button-text-icon-secondary ui-button-text-only", s = function () { var t = e(this); setTimeout(function () { t.find(":ui-button").button("refresh") }, 1) }, a = function (t) { var i = t.name, n = t.form, s = e([]); return i && (i = i.replace(/'/g, "\\'"), s = n ? e(n).find("[name='" + i + "']") : e("[name='" + i + "']", t.ownerDocument).filter(function () { return !this.form })), s }; e.widget("ui.button", { version: "1.10.4", defaultElement: "<button>", options: { disabled: null, text: !0, label: null, icons: { primary: null, secondary: null } }, _create: function () { this.element.closest("form").unbind("reset" + this.eventNamespace).bind("reset" + this.eventNamespace, s), "boolean" != typeof this.options.disabled ? this.options.disabled = !!this.element.prop("disabled") : this.element.prop("disabled", this.options.disabled), this._determineButtonType(), this.hasTitle = !!this.buttonElement.attr("title"); var n = this, o = this.options, r = "checkbox" === this.type || "radio" === this.type, h = r ? "" : "ui-state-active"; null === o.label && (o.label = "input" === this.type ? this.buttonElement.val() : this.buttonElement.html()), this._hoverable(this.buttonElement), this.buttonElement.addClass(i).attr("role", "button").bind("mouseenter" + this.eventNamespace, function () { o.disabled || this === t && e(this).addClass("ui-state-active") }).bind("mouseleave" + this.eventNamespace, function () { o.disabled || e(this).removeClass(h) }).bind("click" + this.eventNamespace, function (e) { o.disabled && (e.preventDefault(), e.stopImmediatePropagation()) }), this._on({ focus: function () { this.buttonElement.addClass("ui-state-focus") }, blur: function () { this.buttonElement.removeClass("ui-state-focus") } }), r && this.element.bind("change" + this.eventNamespace, function () { n.refresh() }), "checkbox" === this.type ? this.buttonElement.bind("click" + this.eventNamespace, function () { return o.disabled ? !1 : undefined }) : "radio" === this.type ? this.buttonElement.bind("click" + this.eventNamespace, function () { if (o.disabled) return !1; e(this).addClass("ui-state-active"), n.buttonElement.attr("aria-pressed", "true"); var t = n.element[0]; a(t).not(t).map(function () { return e(this).button("widget")[0] }).removeClass("ui-state-active").attr("aria-pressed", "false") }) : (this.buttonElement.bind("mousedown" + this.eventNamespace, function () { return o.disabled ? !1 : (e(this).addClass("ui-state-active"), t = this, n.document.one("mouseup", function () { t = null }), undefined) }).bind("mouseup" + this.eventNamespace, function () { return o.disabled ? !1 : (e(this).removeClass("ui-state-active"), undefined) }).bind("keydown" + this.eventNamespace, function (t) { return o.disabled ? !1 : ((t.keyCode === e.ui.keyCode.SPACE || t.keyCode === e.ui.keyCode.ENTER) && e(this).addClass("ui-state-active"), undefined) }).bind("keyup" + this.eventNamespace + " blur" + this.eventNamespace, function () { e(this).removeClass("ui-state-active") }), this.buttonElement.is("a") && this.buttonElement.keyup(function (t) { t.keyCode === e.ui.keyCode.SPACE && e(this).click() })), this._setOption("disabled", o.disabled), this._resetButton() }, _determineButtonType: function () { var e, t, i; this.type = this.element.is("[type=checkbox]") ? "checkbox" : this.element.is("[type=radio]") ? "radio" : this.element.is("input") ? "input" : "button", "checkbox" === this.type || "radio" === this.type ? (e = this.element.parents().last(), t = "label[for='" + this.element.attr("id") + "']", this.buttonElement = e.find(t), this.buttonElement.length || (e = e.length ? e.siblings() : this.element.siblings(), this.buttonElement = e.filter(t), this.buttonElement.length || (this.buttonElement = e.find(t))), this.element.addClass("ui-helper-hidden-accessible"), i = this.element.is(":checked"), i && this.buttonElement.addClass("ui-state-active"), this.buttonElement.prop("aria-pressed", i)) : this.buttonElement = this.element }, widget: function () { return this.buttonElement }, _destroy: function () { this.element.removeClass("ui-helper-hidden-accessible"), this.buttonElement.removeClass(i + " ui-state-active " + n).removeAttr("role").removeAttr("aria-pressed").html(this.buttonElement.find(".ui-button-text").html()), this.hasTitle || this.buttonElement.removeAttr("title") }, _setOption: function (e, t) { return this._super(e, t), "disabled" === e ? (this.element.prop("disabled", !!t), t && this.buttonElement.removeClass("ui-state-focus"), undefined) : (this._resetButton(), undefined) }, refresh: function () { var t = this.element.is("input, button") ? this.element.is(":disabled") : this.element.hasClass("ui-button-disabled"); t !== this.options.disabled && this._setOption("disabled", t), "radio" === this.type ? a(this.element[0]).each(function () { e(this).is(":checked") ? e(this).button("widget").addClass("ui-state-active").attr("aria-pressed", "true") : e(this).button("widget").removeClass("ui-state-active").attr("aria-pressed", "false") }) : "checkbox" === this.type && (this.element.is(":checked") ? this.buttonElement.addClass("ui-state-active").attr("aria-pressed", "true") : this.buttonElement.removeClass("ui-state-active").attr("aria-pressed", "false")) }, _resetButton: function () { if ("input" === this.type) return this.options.label && this.element.val(this.options.label), undefined; var t = this.buttonElement.removeClass(n), i = e("<span></span>", this.document[0]).addClass("ui-button-text").html(this.options.label).appendTo(t.empty()).text(), s = this.options.icons, a = s.primary && s.secondary, o = []; s.primary || s.secondary ? (this.options.text && o.push("ui-button-text-icon" + (a ? "s" : s.primary ? "-primary" : "-secondary")), s.primary && t.prepend("<span class='ui-button-icon-primary ui-icon " + s.primary + "'></span>"), s.secondary && t.append("<span class='ui-button-icon-secondary ui-icon " + s.secondary + "'></span>"), this.options.text || (o.push(a ? "ui-button-icons-only" : "ui-button-icon-only"), this.hasTitle || t.attr("title", e.trim(i)))) : o.push("ui-button-text-only"), t.addClass(o.join(" ")) } }), e.widget("ui.buttonset", { version: "1.10.4", options: { items: "button, input[type=button], input[type=submit], input[type=reset], input[type=checkbox], input[type=radio], a, :data(ui-button)" }, _create: function () { this.element.addClass("ui-buttonset") }, _init: function () { this.refresh() }, _setOption: function (e, t) { "disabled" === e && this.buttons.button("option", e, t), this._super(e, t) }, refresh: function () { var t = "rtl" === this.element.css("direction"); this.buttons = this.element.find(this.options.items).filter(":ui-button").button("refresh").end().not(":ui-button").button().end().map(function () { return e(this).button("widget")[0] }).removeClass("ui-corner-all ui-corner-left ui-corner-right").filter(":first").addClass(t ? "ui-corner-right" : "ui-corner-left").end().filter(":last").addClass(t ? "ui-corner-left" : "ui-corner-right").end().end() }, _destroy: function () { this.element.removeClass("ui-buttonset"), this.buttons.map(function () { return e(this).button("widget")[0] }).removeClass("ui-corner-left ui-corner-right").end().button("destroy") } }) })(jQuery); (function (e, t) {
    function i() { this._curInst = null, this._keyEvent = !1, this._disabledInputs = [], this._datepickerShowing = !1, this._inDialog = !1, this._mainDivId = "ui-datepicker-div", this._inlineClass = "ui-datepicker-inline", this._appendClass = "ui-datepicker-append", this._triggerClass = "ui-datepicker-trigger", this._dialogClass = "ui-datepicker-dialog", this._disableClass = "ui-datepicker-disabled", this._unselectableClass = "ui-datepicker-unselectable", this._currentClass = "ui-datepicker-current-day", this._dayOverClass = "ui-datepicker-days-cell-over", this.regional = [], this.regional[""] = { closeText: "Done", prevText: "Prev", nextText: "Next", currentText: "Today", monthNames: ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"], monthNamesShort: ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"], dayNames: ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"], dayNamesShort: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"], dayNamesMin: ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"], weekHeader: "Wk", dateFormat: "mm/dd/yy", firstDay: 0, isRTL: !1, showMonthAfterYear: !1, yearSuffix: "" }, this._defaults = { showOn: "focus", showAnim: "fadeIn", showOptions: {}, defaultDate: null, appendText: "", buttonText: "...", buttonImage: "", buttonImageOnly: !1, hideIfNoPrevNext: !1, navigationAsDateFormat: !1, gotoCurrent: !1, changeMonth: !1, changeYear: !1, yearRange: "c-10:c+10", showOtherMonths: !1, selectOtherMonths: !1, showWeek: !1, calculateWeek: this.iso8601Week, shortYearCutoff: "+10", minDate: null, maxDate: null, duration: "fast", beforeShowDay: null, beforeShow: null, onSelect: null, onChangeMonthYear: null, onClose: null, numberOfMonths: 1, showCurrentAtPos: 0, stepMonths: 1, stepBigMonths: 12, altField: "", altFormat: "", constrainInput: !0, showButtonPanel: !1, autoSize: !1, disabled: !1 }, e.extend(this._defaults, this.regional[""]), this.dpDiv = a(e("<div id='" + this._mainDivId + "' class='ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all'></div>")) } function a(t) { var i = "button, .ui-datepicker-prev, .ui-datepicker-next, .ui-datepicker-calendar td a"; return t.delegate(i, "mouseout", function () { e(this).removeClass("ui-state-hover"), -1 !== this.className.indexOf("ui-datepicker-prev") && e(this).removeClass("ui-datepicker-prev-hover"), -1 !== this.className.indexOf("ui-datepicker-next") && e(this).removeClass("ui-datepicker-next-hover") }).delegate(i, "mouseover", function () { e.datepicker._isDisabledDatepicker(n.inline ? t.parent()[0] : n.input[0]) || (e(this).parents(".ui-datepicker-calendar").find("a").removeClass("ui-state-hover"), e(this).addClass("ui-state-hover"), -1 !== this.className.indexOf("ui-datepicker-prev") && e(this).addClass("ui-datepicker-prev-hover"), -1 !== this.className.indexOf("ui-datepicker-next") && e(this).addClass("ui-datepicker-next-hover")) }) } function s(t, i) { e.extend(t, i); for (var a in i) null == i[a] && (t[a] = i[a]); return t } e.extend(e.ui, { datepicker: { version: "1.10.4" } }); var n, r = "datepicker"; e.extend(i.prototype, {
        markerClassName: "hasDatepicker", maxRows: 4, _widgetDatepicker: function () { return this.dpDiv }, setDefaults: function (e) { return s(this._defaults, e || {}), this }, _attachDatepicker: function (t, i) { var a, s, n; a = t.nodeName.toLowerCase(), s = "div" === a || "span" === a, t.id || (this.uuid += 1, t.id = "dp" + this.uuid), n = this._newInst(e(t), s), n.settings = e.extend({}, i || {}), "input" === a ? this._connectDatepicker(t, n) : s && this._inlineDatepicker(t, n) }, _newInst: function (t, i) { var s = t[0].id.replace(/([^A-Za-z0-9_\-])/g, "\\\\$1"); return { id: s, input: t, selectedDay: 0, selectedMonth: 0, selectedYear: 0, drawMonth: 0, drawYear: 0, inline: i, dpDiv: i ? a(e("<div class='" + this._inlineClass + " ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all'></div>")) : this.dpDiv } }, _connectDatepicker: function (t, i) { var a = e(t); i.append = e([]), i.trigger = e([]), a.hasClass(this.markerClassName) || (this._attachments(a, i), a.addClass(this.markerClassName).keydown(this._doKeyDown).keypress(this._doKeyPress).keyup(this._doKeyUp), this._autoSize(i), e.data(t, r, i), i.settings.disabled && this._disableDatepicker(t)) }, _attachments: function (t, i) { var a, s, n, r = this._get(i, "appendText"), o = this._get(i, "isRTL"); i.append && i.append.remove(), r && (i.append = e("<span class='" + this._appendClass + "'>" + r + "</span>"), t[o ? "before" : "after"](i.append)), t.unbind("focus", this._showDatepicker), i.trigger && i.trigger.remove(), a = this._get(i, "showOn"), ("focus" === a || "both" === a) && t.focus(this._showDatepicker), ("button" === a || "both" === a) && (s = this._get(i, "buttonText"), n = this._get(i, "buttonImage"), i.trigger = e(this._get(i, "buttonImageOnly") ? e("<img/>").addClass(this._triggerClass).attr({ src: n, alt: s, title: s }) : e("<button type='button'></button>").addClass(this._triggerClass).html(n ? e("<img/>").attr({ src: n, alt: s, title: s }) : s)), t[o ? "before" : "after"](i.trigger), i.trigger.click(function () { return e.datepicker._datepickerShowing && e.datepicker._lastInput === t[0] ? e.datepicker._hideDatepicker() : e.datepicker._datepickerShowing && e.datepicker._lastInput !== t[0] ? (e.datepicker._hideDatepicker(), e.datepicker._showDatepicker(t[0])) : e.datepicker._showDatepicker(t[0]), !1 })) }, _autoSize: function (e) { if (this._get(e, "autoSize") && !e.inline) { var t, i, a, s, n = new Date(2009, 11, 20), r = this._get(e, "dateFormat"); r.match(/[DM]/) && (t = function (e) { for (i = 0, a = 0, s = 0; e.length > s; s++) e[s].length > i && (i = e[s].length, a = s); return a }, n.setMonth(t(this._get(e, r.match(/MM/) ? "monthNames" : "monthNamesShort"))), n.setDate(t(this._get(e, r.match(/DD/) ? "dayNames" : "dayNamesShort")) + 20 - n.getDay())), e.input.attr("size", this._formatDate(e, n).length) } }, _inlineDatepicker: function (t, i) { var a = e(t); a.hasClass(this.markerClassName) || (a.addClass(this.markerClassName).append(i.dpDiv), e.data(t, r, i), this._setDate(i, this._getDefaultDate(i), !0), this._updateDatepicker(i), this._updateAlternate(i), i.settings.disabled && this._disableDatepicker(t), i.dpDiv.css("display", "block")) }, _dialogDatepicker: function (t, i, a, n, o) { var u, c, h, l, d, p = this._dialogInst; return p || (this.uuid += 1, u = "dp" + this.uuid, this._dialogInput = e("<input type='text' id='" + u + "' style='position: absolute; top: -100px; width: 0px;'/>"), this._dialogInput.keydown(this._doKeyDown), e("body").append(this._dialogInput), p = this._dialogInst = this._newInst(this._dialogInput, !1), p.settings = {}, e.data(this._dialogInput[0], r, p)), s(p.settings, n || {}), i = i && i.constructor === Date ? this._formatDate(p, i) : i, this._dialogInput.val(i), this._pos = o ? o.length ? o : [o.pageX, o.pageY] : null, this._pos || (c = document.documentElement.clientWidth, h = document.documentElement.clientHeight, l = document.documentElement.scrollLeft || document.body.scrollLeft, d = document.documentElement.scrollTop || document.body.scrollTop, this._pos = [c / 2 - 100 + l, h / 2 - 150 + d]), this._dialogInput.css("left", this._pos[0] + 20 + "px").css("top", this._pos[1] + "px"), p.settings.onSelect = a, this._inDialog = !0, this.dpDiv.addClass(this._dialogClass), this._showDatepicker(this._dialogInput[0]), e.blockUI && e.blockUI(this.dpDiv), e.data(this._dialogInput[0], r, p), this }, _destroyDatepicker: function (t) { var i, a = e(t), s = e.data(t, r); a.hasClass(this.markerClassName) && (i = t.nodeName.toLowerCase(), e.removeData(t, r), "input" === i ? (s.append.remove(), s.trigger.remove(), a.removeClass(this.markerClassName).unbind("focus", this._showDatepicker).unbind("keydown", this._doKeyDown).unbind("keypress", this._doKeyPress).unbind("keyup", this._doKeyUp)) : ("div" === i || "span" === i) && a.removeClass(this.markerClassName).empty()) }, _enableDatepicker: function (t) { var i, a, s = e(t), n = e.data(t, r); s.hasClass(this.markerClassName) && (i = t.nodeName.toLowerCase(), "input" === i ? (t.disabled = !1, n.trigger.filter("button").each(function () { this.disabled = !1 }).end().filter("img").css({ opacity: "1.0", cursor: "" })) : ("div" === i || "span" === i) && (a = s.children("." + this._inlineClass), a.children().removeClass("ui-state-disabled"), a.find("select.ui-datepicker-month, select.ui-datepicker-year").prop("disabled", !1)), this._disabledInputs = e.map(this._disabledInputs, function (e) { return e === t ? null : e })) }, _disableDatepicker: function (t) { var i, a, s = e(t), n = e.data(t, r); s.hasClass(this.markerClassName) && (i = t.nodeName.toLowerCase(), "input" === i ? (t.disabled = !0, n.trigger.filter("button").each(function () { this.disabled = !0 }).end().filter("img").css({ opacity: "0.5", cursor: "default" })) : ("div" === i || "span" === i) && (a = s.children("." + this._inlineClass), a.children().addClass("ui-state-disabled"), a.find("select.ui-datepicker-month, select.ui-datepicker-year").prop("disabled", !0)), this._disabledInputs = e.map(this._disabledInputs, function (e) { return e === t ? null : e }), this._disabledInputs[this._disabledInputs.length] = t) }, _isDisabledDatepicker: function (e) { if (!e) return !1; for (var t = 0; this._disabledInputs.length > t; t++) if (this._disabledInputs[t] === e) return !0; return !1 }, _getInst: function (t) { try { return e.data(t, r) } catch (i) { throw "Missing instance data for this datepicker" } }, _optionDatepicker: function (i, a, n) { var r, o, u, c, h = this._getInst(i); return 2 === arguments.length && "string" == typeof a ? "defaults" === a ? e.extend({}, e.datepicker._defaults) : h ? "all" === a ? e.extend({}, h.settings) : this._get(h, a) : null : (r = a || {}, "string" == typeof a && (r = {}, r[a] = n), h && (this._curInst === h && this._hideDatepicker(), o = this._getDateDatepicker(i, !0), u = this._getMinMaxDate(h, "min"), c = this._getMinMaxDate(h, "max"), s(h.settings, r), null !== u && r.dateFormat !== t && r.minDate === t && (h.settings.minDate = this._formatDate(h, u)), null !== c && r.dateFormat !== t && r.maxDate === t && (h.settings.maxDate = this._formatDate(h, c)), "disabled" in r && (r.disabled ? this._disableDatepicker(i) : this._enableDatepicker(i)), this._attachments(e(i), h), this._autoSize(h), this._setDate(h, o), this._updateAlternate(h), this._updateDatepicker(h)), t) }, _changeDatepicker: function (e, t, i) { this._optionDatepicker(e, t, i) }, _refreshDatepicker: function (e) { var t = this._getInst(e); t && this._updateDatepicker(t) }, _setDateDatepicker: function (e, t) { var i = this._getInst(e); i && (this._setDate(i, t), this._updateDatepicker(i), this._updateAlternate(i)) }, _getDateDatepicker: function (e, t) { var i = this._getInst(e); return i && !i.inline && this._setDateFromField(i, t), i ? this._getDate(i) : null }, _doKeyDown: function (t) { var i, a, s, n = e.datepicker._getInst(t.target), r = !0, o = n.dpDiv.is(".ui-datepicker-rtl"); if (n._keyEvent = !0, e.datepicker._datepickerShowing) switch (t.keyCode) { case 9: e.datepicker._hideDatepicker(), r = !1; break; case 13: return s = e("td." + e.datepicker._dayOverClass + ":not(." + e.datepicker._currentClass + ")", n.dpDiv), s[0] && e.datepicker._selectDay(t.target, n.selectedMonth, n.selectedYear, s[0]), i = e.datepicker._get(n, "onSelect"), i ? (a = e.datepicker._formatDate(n), i.apply(n.input ? n.input[0] : null, [a, n])) : e.datepicker._hideDatepicker(), !1; case 27: e.datepicker._hideDatepicker(); break; case 33: e.datepicker._adjustDate(t.target, t.ctrlKey ? -e.datepicker._get(n, "stepBigMonths") : -e.datepicker._get(n, "stepMonths"), "M"); break; case 34: e.datepicker._adjustDate(t.target, t.ctrlKey ? +e.datepicker._get(n, "stepBigMonths") : +e.datepicker._get(n, "stepMonths"), "M"); break; case 35: (t.ctrlKey || t.metaKey) && e.datepicker._clearDate(t.target), r = t.ctrlKey || t.metaKey; break; case 36: (t.ctrlKey || t.metaKey) && e.datepicker._gotoToday(t.target), r = t.ctrlKey || t.metaKey; break; case 37: (t.ctrlKey || t.metaKey) && e.datepicker._adjustDate(t.target, o ? 1 : -1, "D"), r = t.ctrlKey || t.metaKey, t.originalEvent.altKey && e.datepicker._adjustDate(t.target, t.ctrlKey ? -e.datepicker._get(n, "stepBigMonths") : -e.datepicker._get(n, "stepMonths"), "M"); break; case 38: (t.ctrlKey || t.metaKey) && e.datepicker._adjustDate(t.target, -7, "D"), r = t.ctrlKey || t.metaKey; break; case 39: (t.ctrlKey || t.metaKey) && e.datepicker._adjustDate(t.target, o ? -1 : 1, "D"), r = t.ctrlKey || t.metaKey, t.originalEvent.altKey && e.datepicker._adjustDate(t.target, t.ctrlKey ? +e.datepicker._get(n, "stepBigMonths") : +e.datepicker._get(n, "stepMonths"), "M"); break; case 40: (t.ctrlKey || t.metaKey) && e.datepicker._adjustDate(t.target, 7, "D"), r = t.ctrlKey || t.metaKey; break; default: r = !1 } else 36 === t.keyCode && t.ctrlKey ? e.datepicker._showDatepicker(this) : r = !1; r && (t.preventDefault(), t.stopPropagation()) }, _doKeyPress: function (i) { var a, s, n = e.datepicker._getInst(i.target); return e.datepicker._get(n, "constrainInput") ? (a = e.datepicker._possibleChars(e.datepicker._get(n, "dateFormat")), s = String.fromCharCode(null == i.charCode ? i.keyCode : i.charCode), i.ctrlKey || i.metaKey || " " > s || !a || a.indexOf(s) > -1) : t }, _doKeyUp: function (t) { var i, a = e.datepicker._getInst(t.target); if (a.input.val() !== a.lastVal) try { i = e.datepicker.parseDate(e.datepicker._get(a, "dateFormat"), a.input ? a.input.val() : null, e.datepicker._getFormatConfig(a)), i && (e.datepicker._setDateFromField(a), e.datepicker._updateAlternate(a), e.datepicker._updateDatepicker(a)) } catch (s) { } return !0 }, _showDatepicker: function (t) { if (t = t.target || t, "input" !== t.nodeName.toLowerCase() && (t = e("input", t.parentNode)[0]), !e.datepicker._isDisabledDatepicker(t) && e.datepicker._lastInput !== t) { var i, a, n, r, o, u, c; i = e.datepicker._getInst(t), e.datepicker._curInst && e.datepicker._curInst !== i && (e.datepicker._curInst.dpDiv.stop(!0, !0), i && e.datepicker._datepickerShowing && e.datepicker._hideDatepicker(e.datepicker._curInst.input[0])), a = e.datepicker._get(i, "beforeShow"), n = a ? a.apply(t, [t, i]) : {}, n !== !1 && (s(i.settings, n), i.lastVal = null, e.datepicker._lastInput = t, e.datepicker._setDateFromField(i), e.datepicker._inDialog && (t.value = ""), e.datepicker._pos || (e.datepicker._pos = e.datepicker._findPos(t), e.datepicker._pos[1] += t.offsetHeight), r = !1, e(t).parents().each(function () { return r |= "fixed" === e(this).css("position"), !r }), o = { left: e.datepicker._pos[0], top: e.datepicker._pos[1] }, e.datepicker._pos = null, i.dpDiv.empty(), i.dpDiv.css({ position: "absolute", display: "block", top: "-1000px" }), e.datepicker._updateDatepicker(i), o = e.datepicker._checkOffset(i, o, r), i.dpDiv.css({ position: e.datepicker._inDialog && e.blockUI ? "static" : r ? "fixed" : "absolute", display: "none", left: o.left + "px", top: o.top + "px" }), i.inline || (u = e.datepicker._get(i, "showAnim"), c = e.datepicker._get(i, "duration"), i.dpDiv.zIndex(e(t).zIndex() + 1), e.datepicker._datepickerShowing = !0, e.effects && e.effects.effect[u] ? i.dpDiv.show(u, e.datepicker._get(i, "showOptions"), c) : i.dpDiv[u || "show"](u ? c : null), e.datepicker._shouldFocusInput(i) && i.input.focus(), e.datepicker._curInst = i)) } }, _updateDatepicker: function (t) { this.maxRows = 4, n = t, t.dpDiv.empty().append(this._generateHTML(t)), this._attachHandlers(t), t.dpDiv.find("." + this._dayOverClass + " a").mouseover(); var i, a = this._getNumberOfMonths(t), s = a[1], r = 17; t.dpDiv.removeClass("ui-datepicker-multi-2 ui-datepicker-multi-3 ui-datepicker-multi-4").width(""), s > 1 && t.dpDiv.addClass("ui-datepicker-multi-" + s).css("width", r * s + "em"), t.dpDiv[(1 !== a[0] || 1 !== a[1] ? "add" : "remove") + "Class"]("ui-datepicker-multi"), t.dpDiv[(this._get(t, "isRTL") ? "add" : "remove") + "Class"]("ui-datepicker-rtl"), t === e.datepicker._curInst && e.datepicker._datepickerShowing && e.datepicker._shouldFocusInput(t) && t.input.focus(), t.yearshtml && (i = t.yearshtml, setTimeout(function () { i === t.yearshtml && t.yearshtml && t.dpDiv.find("select.ui-datepicker-year:first").replaceWith(t.yearshtml), i = t.yearshtml = null }, 0)) }, _shouldFocusInput: function (e) { return e.input && e.input.is(":visible") && !e.input.is(":disabled") && !e.input.is(":focus") }, _checkOffset: function (t, i, a) { var s = t.dpDiv.outerWidth(), n = t.dpDiv.outerHeight(), r = t.input ? t.input.outerWidth() : 0, o = t.input ? t.input.outerHeight() : 0, u = document.documentElement.clientWidth + (a ? 0 : e(document).scrollLeft()), c = document.documentElement.clientHeight + (a ? 0 : e(document).scrollTop()); return i.left -= this._get(t, "isRTL") ? s - r : 0, i.left -= a && i.left === t.input.offset().left ? e(document).scrollLeft() : 0, i.top -= a && i.top === t.input.offset().top + o ? e(document).scrollTop() : 0, i.left -= Math.min(i.left, i.left + s > u && u > s ? Math.abs(i.left + s - u) : 0), i.top -= Math.min(i.top, i.top + n > c && c > n ? Math.abs(n + o) : 0), i }, _findPos: function (t) { for (var i, a = this._getInst(t), s = this._get(a, "isRTL") ; t && ("hidden" === t.type || 1 !== t.nodeType || e.expr.filters.hidden(t)) ;) t = t[s ? "previousSibling" : "nextSibling"]; return i = e(t).offset(), [i.left, i.top] }, _hideDatepicker: function (t) { var i, a, s, n, o = this._curInst; !o || t && o !== e.data(t, r) || this._datepickerShowing && (i = this._get(o, "showAnim"), a = this._get(o, "duration"), s = function () { e.datepicker._tidyDialog(o) }, e.effects && (e.effects.effect[i] || e.effects[i]) ? o.dpDiv.hide(i, e.datepicker._get(o, "showOptions"), a, s) : o.dpDiv["slideDown" === i ? "slideUp" : "fadeIn" === i ? "fadeOut" : "hide"](i ? a : null, s), i || s(), this._datepickerShowing = !1, n = this._get(o, "onClose"), n && n.apply(o.input ? o.input[0] : null, [o.input ? o.input.val() : "", o]), this._lastInput = null, this._inDialog && (this._dialogInput.css({ position: "absolute", left: "0", top: "-100px" }), e.blockUI && (e.unblockUI(), e("body").append(this.dpDiv))), this._inDialog = !1) }, _tidyDialog: function (e) { e.dpDiv.removeClass(this._dialogClass).unbind(".ui-datepicker-calendar") }, _checkExternalClick: function (t) { if (e.datepicker._curInst) { var i = e(t.target), a = e.datepicker._getInst(i[0]); (i[0].id !== e.datepicker._mainDivId && 0 === i.parents("#" + e.datepicker._mainDivId).length && !i.hasClass(e.datepicker.markerClassName) && !i.closest("." + e.datepicker._triggerClass).length && e.datepicker._datepickerShowing && (!e.datepicker._inDialog || !e.blockUI) || i.hasClass(e.datepicker.markerClassName) && e.datepicker._curInst !== a) && e.datepicker._hideDatepicker() } }, _adjustDate: function (t, i, a) { var s = e(t), n = this._getInst(s[0]); this._isDisabledDatepicker(s[0]) || (this._adjustInstDate(n, i + ("M" === a ? this._get(n, "showCurrentAtPos") : 0), a), this._updateDatepicker(n)) }, _gotoToday: function (t) { var i, a = e(t), s = this._getInst(a[0]); this._get(s, "gotoCurrent") && s.currentDay ? (s.selectedDay = s.currentDay, s.drawMonth = s.selectedMonth = s.currentMonth, s.drawYear = s.selectedYear = s.currentYear) : (i = new Date, s.selectedDay = i.getDate(), s.drawMonth = s.selectedMonth = i.getMonth(), s.drawYear = s.selectedYear = i.getFullYear()), this._notifyChange(s), this._adjustDate(a) }, _selectMonthYear: function (t, i, a) { var s = e(t), n = this._getInst(s[0]); n["selected" + ("M" === a ? "Month" : "Year")] = n["draw" + ("M" === a ? "Month" : "Year")] = parseInt(i.options[i.selectedIndex].value, 10), this._notifyChange(n), this._adjustDate(s) }, _selectDay: function (t, i, a, s) { var n, r = e(t); e(s).hasClass(this._unselectableClass) || this._isDisabledDatepicker(r[0]) || (n = this._getInst(r[0]), n.selectedDay = n.currentDay = e("a", s).html(), n.selectedMonth = n.currentMonth = i, n.selectedYear = n.currentYear = a, this._selectDate(t, this._formatDate(n, n.currentDay, n.currentMonth, n.currentYear))) }, _clearDate: function (t) { var i = e(t); this._selectDate(i, "") }, _selectDate: function (t, i) { var a, s = e(t), n = this._getInst(s[0]); i = null != i ? i : this._formatDate(n), n.input && n.input.val(i), this._updateAlternate(n), a = this._get(n, "onSelect"), a ? a.apply(n.input ? n.input[0] : null, [i, n]) : n.input && n.input.trigger("change"), n.inline ? this._updateDatepicker(n) : (this._hideDatepicker(), this._lastInput = n.input[0], "object" != typeof n.input[0] && n.input.focus(), this._lastInput = null) }, _updateAlternate: function (t) { var i, a, s, n = this._get(t, "altField"); n && (i = this._get(t, "altFormat") || this._get(t, "dateFormat"), a = this._getDate(t), s = this.formatDate(i, a, this._getFormatConfig(t)), e(n).each(function () { e(this).val(s) })) }, noWeekends: function (e) { var t = e.getDay(); return [t > 0 && 6 > t, ""] }, iso8601Week: function (e) { var t, i = new Date(e.getTime()); return i.setDate(i.getDate() + 4 - (i.getDay() || 7)), t = i.getTime(), i.setMonth(0), i.setDate(1), Math.floor(Math.round((t - i) / 864e5) / 7) + 1 }, parseDate: function (i, a, s) { if (null == i || null == a) throw "Invalid arguments"; if (a = "object" == typeof a ? "" + a : a + "", "" === a) return null; var n, r, o, u, c = 0, h = (s ? s.shortYearCutoff : null) || this._defaults.shortYearCutoff, l = "string" != typeof h ? h : (new Date).getFullYear() % 100 + parseInt(h, 10), d = (s ? s.dayNamesShort : null) || this._defaults.dayNamesShort, p = (s ? s.dayNames : null) || this._defaults.dayNames, g = (s ? s.monthNamesShort : null) || this._defaults.monthNamesShort, m = (s ? s.monthNames : null) || this._defaults.monthNames, f = -1, _ = -1, v = -1, k = -1, y = !1, b = function (e) { var t = i.length > n + 1 && i.charAt(n + 1) === e; return t && n++, t }, D = function (e) { var t = b(e), i = "@" === e ? 14 : "!" === e ? 20 : "y" === e && t ? 4 : "o" === e ? 3 : 2, s = RegExp("^\\d{1," + i + "}"), n = a.substring(c).match(s); if (!n) throw "Missing number at position " + c; return c += n[0].length, parseInt(n[0], 10) }, w = function (i, s, n) { var r = -1, o = e.map(b(i) ? n : s, function (e, t) { return [[t, e]] }).sort(function (e, t) { return -(e[1].length - t[1].length) }); if (e.each(o, function (e, i) { var s = i[1]; return a.substr(c, s.length).toLowerCase() === s.toLowerCase() ? (r = i[0], c += s.length, !1) : t }), -1 !== r) return r + 1; throw "Unknown name at position " + c }, M = function () { if (a.charAt(c) !== i.charAt(n)) throw "Unexpected literal at position " + c; c++ }; for (n = 0; i.length > n; n++) if (y) "'" !== i.charAt(n) || b("'") ? M() : y = !1; else switch (i.charAt(n)) { case "d": v = D("d"); break; case "D": w("D", d, p); break; case "o": k = D("o"); break; case "m": _ = D("m"); break; case "M": _ = w("M", g, m); break; case "y": f = D("y"); break; case "@": u = new Date(D("@")), f = u.getFullYear(), _ = u.getMonth() + 1, v = u.getDate(); break; case "!": u = new Date((D("!") - this._ticksTo1970) / 1e4), f = u.getFullYear(), _ = u.getMonth() + 1, v = u.getDate(); break; case "'": b("'") ? M() : y = !0; break; default: M() } if (a.length > c && (o = a.substr(c), !/^\s+/.test(o))) throw "Extra/unparsed characters found in date: " + o; if (-1 === f ? f = (new Date).getFullYear() : 100 > f && (f += (new Date).getFullYear() - (new Date).getFullYear() % 100 + (l >= f ? 0 : -100)), k > -1) for (_ = 1, v = k; ;) { if (r = this._getDaysInMonth(f, _ - 1), r >= v) break; _++, v -= r } if (u = this._daylightSavingAdjust(new Date(f, _ - 1, v)), u.getFullYear() !== f || u.getMonth() + 1 !== _ || u.getDate() !== v) throw "Invalid date"; return u }, ATOM: "yy-mm-dd", COOKIE: "D, dd M yy", ISO_8601: "yy-mm-dd", RFC_822: "D, d M y", RFC_850: "DD, dd-M-y", RFC_1036: "D, d M y", RFC_1123: "D, d M yy", RFC_2822: "D, d M yy", RSS: "D, d M y", TICKS: "!", TIMESTAMP: "@", W3C: "yy-mm-dd", _ticksTo1970: 1e7 * 60 * 60 * 24 * (718685 + Math.floor(492.5) - Math.floor(19.7) + Math.floor(4.925)), formatDate: function (e, t, i) { if (!t) return ""; var a, s = (i ? i.dayNamesShort : null) || this._defaults.dayNamesShort, n = (i ? i.dayNames : null) || this._defaults.dayNames, r = (i ? i.monthNamesShort : null) || this._defaults.monthNamesShort, o = (i ? i.monthNames : null) || this._defaults.monthNames, u = function (t) { var i = e.length > a + 1 && e.charAt(a + 1) === t; return i && a++, i }, c = function (e, t, i) { var a = "" + t; if (u(e)) for (; i > a.length;) a = "0" + a; return a }, h = function (e, t, i, a) { return u(e) ? a[t] : i[t] }, l = "", d = !1; if (t) for (a = 0; e.length > a; a++) if (d) "'" !== e.charAt(a) || u("'") ? l += e.charAt(a) : d = !1; else switch (e.charAt(a)) { case "d": l += c("d", t.getDate(), 2); break; case "D": l += h("D", t.getDay(), s, n); break; case "o": l += c("o", Math.round((new Date(t.getFullYear(), t.getMonth(), t.getDate()).getTime() - new Date(t.getFullYear(), 0, 0).getTime()) / 864e5), 3); break; case "m": l += c("m", t.getMonth() + 1, 2); break; case "M": l += h("M", t.getMonth(), r, o); break; case "y": l += u("y") ? t.getFullYear() : (10 > t.getYear() % 100 ? "0" : "") + t.getYear() % 100; break; case "@": l += t.getTime(); break; case "!": l += 1e4 * t.getTime() + this._ticksTo1970; break; case "'": u("'") ? l += "'" : d = !0; break; default: l += e.charAt(a) } return l }, _possibleChars: function (e) { var t, i = "", a = !1, s = function (i) { var a = e.length > t + 1 && e.charAt(t + 1) === i; return a && t++, a }; for (t = 0; e.length > t; t++) if (a) "'" !== e.charAt(t) || s("'") ? i += e.charAt(t) : a = !1; else switch (e.charAt(t)) { case "d": case "m": case "y": case "@": i += "0123456789"; break; case "D": case "M": return null; case "'": s("'") ? i += "'" : a = !0; break; default: i += e.charAt(t) } return i }, _get: function (e, i) { return e.settings[i] !== t ? e.settings[i] : this._defaults[i] }, _setDateFromField: function (e, t) { if (e.input.val() !== e.lastVal) { var i = this._get(e, "dateFormat"), a = e.lastVal = e.input ? e.input.val() : null, s = this._getDefaultDate(e), n = s, r = this._getFormatConfig(e); try { n = this.parseDate(i, a, r) || s } catch (o) { a = t ? "" : a } e.selectedDay = n.getDate(), e.drawMonth = e.selectedMonth = n.getMonth(), e.drawYear = e.selectedYear = n.getFullYear(), e.currentDay = a ? n.getDate() : 0, e.currentMonth = a ? n.getMonth() : 0, e.currentYear = a ? n.getFullYear() : 0, this._adjustInstDate(e) } }, _getDefaultDate: function (e) { return this._restrictMinMax(e, this._determineDate(e, this._get(e, "defaultDate"), new Date)) }, _determineDate: function (t, i, a) { var s = function (e) { var t = new Date; return t.setDate(t.getDate() + e), t }, n = function (i) { try { return e.datepicker.parseDate(e.datepicker._get(t, "dateFormat"), i, e.datepicker._getFormatConfig(t)) } catch (a) { } for (var s = (i.toLowerCase().match(/^c/) ? e.datepicker._getDate(t) : null) || new Date, n = s.getFullYear(), r = s.getMonth(), o = s.getDate(), u = /([+\-]?[0-9]+)\s*(d|D|w|W|m|M|y|Y)?/g, c = u.exec(i) ; c;) { switch (c[2] || "d") { case "d": case "D": o += parseInt(c[1], 10); break; case "w": case "W": o += 7 * parseInt(c[1], 10); break; case "m": case "M": r += parseInt(c[1], 10), o = Math.min(o, e.datepicker._getDaysInMonth(n, r)); break; case "y": case "Y": n += parseInt(c[1], 10), o = Math.min(o, e.datepicker._getDaysInMonth(n, r)) } c = u.exec(i) } return new Date(n, r, o) }, r = null == i || "" === i ? a : "string" == typeof i ? n(i) : "number" == typeof i ? isNaN(i) ? a : s(i) : new Date(i.getTime()); return r = r && "Invalid Date" == "" + r ? a : r, r && (r.setHours(0), r.setMinutes(0), r.setSeconds(0), r.setMilliseconds(0)), this._daylightSavingAdjust(r) }, _daylightSavingAdjust: function (e) { return e ? (e.setHours(e.getHours() > 12 ? e.getHours() + 2 : 0), e) : null }, _setDate: function (e, t, i) { var a = !t, s = e.selectedMonth, n = e.selectedYear, r = this._restrictMinMax(e, this._determineDate(e, t, new Date)); e.selectedDay = e.currentDay = r.getDate(), e.drawMonth = e.selectedMonth = e.currentMonth = r.getMonth(), e.drawYear = e.selectedYear = e.currentYear = r.getFullYear(), s === e.selectedMonth && n === e.selectedYear || i || this._notifyChange(e), this._adjustInstDate(e), e.input && e.input.val(a ? "" : this._formatDate(e)) }, _getDate: function (e) { var t = !e.currentYear || e.input && "" === e.input.val() ? null : this._daylightSavingAdjust(new Date(e.currentYear, e.currentMonth, e.currentDay)); return t }, _attachHandlers: function (t) { var i = this._get(t, "stepMonths"), a = "#" + t.id.replace(/\\\\/g, "\\"); t.dpDiv.find("[data-handler]").map(function () { var t = { prev: function () { e.datepicker._adjustDate(a, -i, "M") }, next: function () { e.datepicker._adjustDate(a, +i, "M") }, hide: function () { e.datepicker._hideDatepicker() }, today: function () { e.datepicker._gotoToday(a) }, selectDay: function () { return e.datepicker._selectDay(a, +this.getAttribute("data-month"), +this.getAttribute("data-year"), this), !1 }, selectMonth: function () { return e.datepicker._selectMonthYear(a, this, "M"), !1 }, selectYear: function () { return e.datepicker._selectMonthYear(a, this, "Y"), !1 } }; e(this).bind(this.getAttribute("data-event"), t[this.getAttribute("data-handler")]) }) }, _generateHTML: function (e) { var t, i, a, s, n, r, o, u, c, h, l, d, p, g, m, f, _, v, k, y, b, D, w, M, C, x, I, N, T, A, E, S, Y, F, P, O, j, K, R, H = new Date, W = this._daylightSavingAdjust(new Date(H.getFullYear(), H.getMonth(), H.getDate())), L = this._get(e, "isRTL"), U = this._get(e, "showButtonPanel"), B = this._get(e, "hideIfNoPrevNext"), z = this._get(e, "navigationAsDateFormat"), q = this._getNumberOfMonths(e), G = this._get(e, "showCurrentAtPos"), J = this._get(e, "stepMonths"), Q = 1 !== q[0] || 1 !== q[1], V = this._daylightSavingAdjust(e.currentDay ? new Date(e.currentYear, e.currentMonth, e.currentDay) : new Date(9999, 9, 9)), $ = this._getMinMaxDate(e, "min"), X = this._getMinMaxDate(e, "max"), Z = e.drawMonth - G, et = e.drawYear; if (0 > Z && (Z += 12, et--), X) for (t = this._daylightSavingAdjust(new Date(X.getFullYear(), X.getMonth() - q[0] * q[1] + 1, X.getDate())), t = $ && $ > t ? $ : t; this._daylightSavingAdjust(new Date(et, Z, 1)) > t;) Z--, 0 > Z && (Z = 11, et--); for (e.drawMonth = Z, e.drawYear = et, i = this._get(e, "prevText"), i = z ? this.formatDate(i, this._daylightSavingAdjust(new Date(et, Z - J, 1)), this._getFormatConfig(e)) : i, a = this._canAdjustMonth(e, -1, et, Z) ? "<a class='ui-datepicker-prev ui-corner-all' data-handler='prev' data-event='click' title='" + i + "'><span class='ui-icon ui-icon-circle-triangle-" + (L ? "e" : "w") + "'>" + i + "</span></a>" : B ? "" : "<a class='ui-datepicker-prev ui-corner-all ui-state-disabled' title='" + i + "'><span class='ui-icon ui-icon-circle-triangle-" + (L ? "e" : "w") + "'>" + i + "</span></a>", s = this._get(e, "nextText"), s = z ? this.formatDate(s, this._daylightSavingAdjust(new Date(et, Z + J, 1)), this._getFormatConfig(e)) : s, n = this._canAdjustMonth(e, 1, et, Z) ? "<a class='ui-datepicker-next ui-corner-all' data-handler='next' data-event='click' title='" + s + "'><span class='ui-icon ui-icon-circle-triangle-" + (L ? "w" : "e") + "'>" + s + "</span></a>" : B ? "" : "<a class='ui-datepicker-next ui-corner-all ui-state-disabled' title='" + s + "'><span class='ui-icon ui-icon-circle-triangle-" + (L ? "w" : "e") + "'>" + s + "</span></a>", r = this._get(e, "currentText"), o = this._get(e, "gotoCurrent") && e.currentDay ? V : W, r = z ? this.formatDate(r, o, this._getFormatConfig(e)) : r, u = e.inline ? "" : "<button type='button' class='ui-datepicker-close ui-state-default ui-priority-primary ui-corner-all' data-handler='hide' data-event='click'>" + this._get(e, "closeText") + "</button>", c = U ? "<div class='ui-datepicker-buttonpane ui-widget-content'>" + (L ? u : "") + (this._isInRange(e, o) ? "<button type='button' class='ui-datepicker-current ui-state-default ui-priority-secondary ui-corner-all' data-handler='today' data-event='click'>" + r + "</button>" : "") + (L ? "" : u) + "</div>" : "", h = parseInt(this._get(e, "firstDay"), 10), h = isNaN(h) ? 0 : h, l = this._get(e, "showWeek"), d = this._get(e, "dayNames"), p = this._get(e, "dayNamesMin"), g = this._get(e, "monthNames"), m = this._get(e, "monthNamesShort"), f = this._get(e, "beforeShowDay"), _ = this._get(e, "showOtherMonths"), v = this._get(e, "selectOtherMonths"), k = this._getDefaultDate(e), y = "", D = 0; q[0] > D; D++) { for (w = "", this.maxRows = 4, M = 0; q[1] > M; M++) { if (C = this._daylightSavingAdjust(new Date(et, Z, e.selectedDay)), x = " ui-corner-all", I = "", Q) { if (I += "<div class='ui-datepicker-group", q[1] > 1) switch (M) { case 0: I += " ui-datepicker-group-first", x = " ui-corner-" + (L ? "right" : "left"); break; case q[1] - 1: I += " ui-datepicker-group-last", x = " ui-corner-" + (L ? "left" : "right"); break; default: I += " ui-datepicker-group-middle", x = "" } I += "'>" } for (I += "<div class='ui-datepicker-header ui-widget-header ui-helper-clearfix" + x + "'>" + (/all|left/.test(x) && 0 === D ? L ? n : a : "") + (/all|right/.test(x) && 0 === D ? L ? a : n : "") + this._generateMonthYearHeader(e, Z, et, $, X, D > 0 || M > 0, g, m) + "</div><table class='ui-datepicker-calendar'><thead>" + "<tr>", N = l ? "<th class='ui-datepicker-week-col'>" + this._get(e, "weekHeader") + "</th>" : "", b = 0; 7 > b; b++) T = (b + h) % 7, N += "<th" + ((b + h + 6) % 7 >= 5 ? " class='ui-datepicker-week-end'" : "") + ">" + "<span title='" + d[T] + "'>" + p[T] + "</span></th>"; for (I += N + "</tr></thead><tbody>", A = this._getDaysInMonth(et, Z), et === e.selectedYear && Z === e.selectedMonth && (e.selectedDay = Math.min(e.selectedDay, A)), E = (this._getFirstDayOfMonth(et, Z) - h + 7) % 7, S = Math.ceil((E + A) / 7), Y = Q ? this.maxRows > S ? this.maxRows : S : S, this.maxRows = Y, F = this._daylightSavingAdjust(new Date(et, Z, 1 - E)), P = 0; Y > P; P++) { for (I += "<tr>", O = l ? "<td class='ui-datepicker-week-col'>" + this._get(e, "calculateWeek")(F) + "</td>" : "", b = 0; 7 > b; b++) j = f ? f.apply(e.input ? e.input[0] : null, [F]) : [!0, ""], K = F.getMonth() !== Z, R = K && !v || !j[0] || $ && $ > F || X && F > X, O += "<td class='" + ((b + h + 6) % 7 >= 5 ? " ui-datepicker-week-end" : "") + (K ? " ui-datepicker-other-month" : "") + (F.getTime() === C.getTime() && Z === e.selectedMonth && e._keyEvent || k.getTime() === F.getTime() && k.getTime() === C.getTime() ? " " + this._dayOverClass : "") + (R ? " " + this._unselectableClass + " ui-state-disabled" : "") + (K && !_ ? "" : " " + j[1] + (F.getTime() === V.getTime() ? " " + this._currentClass : "") + (F.getTime() === W.getTime() ? " ui-datepicker-today" : "")) + "'" + (K && !_ || !j[2] ? "" : " title='" + j[2].replace(/'/g, "&#39;") + "'") + (R ? "" : " data-handler='selectDay' data-event='click' data-month='" + F.getMonth() + "' data-year='" + F.getFullYear() + "'") + ">" + (K && !_ ? "&#xa0;" : R ? "<span class='ui-state-default'>" + F.getDate() + "</span>" : "<a class='ui-state-default" + (F.getTime() === W.getTime() ? " ui-state-highlight" : "") + (F.getTime() === V.getTime() ? " ui-state-active" : "") + (K ? " ui-priority-secondary" : "") + "' href='#'>" + F.getDate() + "</a>") + "</td>", F.setDate(F.getDate() + 1), F = this._daylightSavingAdjust(F); I += O + "</tr>" } Z++, Z > 11 && (Z = 0, et++), I += "</tbody></table>" + (Q ? "</div>" + (q[0] > 0 && M === q[1] - 1 ? "<div class='ui-datepicker-row-break'></div>" : "") : ""), w += I } y += w } return y += c, e._keyEvent = !1, y }, _generateMonthYearHeader: function (e, t, i, a, s, n, r, o) {
            var u, c, h, l, d, p, g, m, f = this._get(e, "changeMonth"), _ = this._get(e, "changeYear"), v = this._get(e, "showMonthAfterYear"), k = "<div class='ui-datepicker-title'>", y = ""; if (n || !f) y += "<span class='ui-datepicker-month'>" + r[t] + "</span>"; else { for (u = a && a.getFullYear() === i, c = s && s.getFullYear() === i, y += "<select class='ui-datepicker-month' data-handler='selectMonth' data-event='change'>", h = 0; 12 > h; h++) (!u || h >= a.getMonth()) && (!c || s.getMonth() >= h) && (y += "<option value='" + h + "'" + (h === t ? " selected='selected'" : "") + ">" + o[h] + "</option>"); y += "</select>" } if (v || (k += y + (!n && f && _ ? "" : "&#xa0;")), !e.yearshtml) if (e.yearshtml = "", n || !_) k += "<span class='ui-datepicker-year'>" + i + "</span>"; else {
                for (l = this._get(e, "yearRange").split(":"), d = (new Date).getFullYear(), p = function (e) {
                var t = e.match(/c[+\-].*/) ? i + parseInt(e.substring(1), 10) : e.match(/[+\-].*/) ? d + parseInt(e, 10) : parseInt(e, 10);
                return isNaN(t) ? d : t
                }, g = p(l[0]), m = Math.max(g, p(l[1] || "")), g = a ? Math.max(g, a.getFullYear()) : g, m = s ? Math.min(m, s.getFullYear()) : m, e.yearshtml += "<select class='ui-datepicker-year' data-handler='selectYear' data-event='change'>"; m >= g; g++) e.yearshtml += "<option value='" + g + "'" + (g === i ? " selected='selected'" : "") + ">" + g + "</option>"; e.yearshtml += "</select>", k += e.yearshtml, e.yearshtml = null
            } return k += this._get(e, "yearSuffix"), v && (k += (!n && f && _ ? "" : "&#xa0;") + y), k += "</div>"
        }, _adjustInstDate: function (e, t, i) { var a = e.drawYear + ("Y" === i ? t : 0), s = e.drawMonth + ("M" === i ? t : 0), n = Math.min(e.selectedDay, this._getDaysInMonth(a, s)) + ("D" === i ? t : 0), r = this._restrictMinMax(e, this._daylightSavingAdjust(new Date(a, s, n))); e.selectedDay = r.getDate(), e.drawMonth = e.selectedMonth = r.getMonth(), e.drawYear = e.selectedYear = r.getFullYear(), ("M" === i || "Y" === i) && this._notifyChange(e) }, _restrictMinMax: function (e, t) { var i = this._getMinMaxDate(e, "min"), a = this._getMinMaxDate(e, "max"), s = i && i > t ? i : t; return a && s > a ? a : s }, _notifyChange: function (e) { var t = this._get(e, "onChangeMonthYear"); t && t.apply(e.input ? e.input[0] : null, [e.selectedYear, e.selectedMonth + 1, e]) }, _getNumberOfMonths: function (e) { var t = this._get(e, "numberOfMonths"); return null == t ? [1, 1] : "number" == typeof t ? [1, t] : t }, _getMinMaxDate: function (e, t) { return this._determineDate(e, this._get(e, t + "Date"), null) }, _getDaysInMonth: function (e, t) { return 32 - this._daylightSavingAdjust(new Date(e, t, 32)).getDate() }, _getFirstDayOfMonth: function (e, t) { return new Date(e, t, 1).getDay() }, _canAdjustMonth: function (e, t, i, a) { var s = this._getNumberOfMonths(e), n = this._daylightSavingAdjust(new Date(i, a + (0 > t ? t : s[0] * s[1]), 1)); return 0 > t && n.setDate(this._getDaysInMonth(n.getFullYear(), n.getMonth())), this._isInRange(e, n) }, _isInRange: function (e, t) { var i, a, s = this._getMinMaxDate(e, "min"), n = this._getMinMaxDate(e, "max"), r = null, o = null, u = this._get(e, "yearRange"); return u && (i = u.split(":"), a = (new Date).getFullYear(), r = parseInt(i[0], 10), o = parseInt(i[1], 10), i[0].match(/[+\-].*/) && (r += a), i[1].match(/[+\-].*/) && (o += a)), (!s || t.getTime() >= s.getTime()) && (!n || t.getTime() <= n.getTime()) && (!r || t.getFullYear() >= r) && (!o || o >= t.getFullYear()) }, _getFormatConfig: function (e) { var t = this._get(e, "shortYearCutoff"); return t = "string" != typeof t ? t : (new Date).getFullYear() % 100 + parseInt(t, 10), { shortYearCutoff: t, dayNamesShort: this._get(e, "dayNamesShort"), dayNames: this._get(e, "dayNames"), monthNamesShort: this._get(e, "monthNamesShort"), monthNames: this._get(e, "monthNames") } }, _formatDate: function (e, t, i, a) { t || (e.currentDay = e.selectedDay, e.currentMonth = e.selectedMonth, e.currentYear = e.selectedYear); var s = t ? "object" == typeof t ? t : this._daylightSavingAdjust(new Date(a, i, t)) : this._daylightSavingAdjust(new Date(e.currentYear, e.currentMonth, e.currentDay)); return this.formatDate(this._get(e, "dateFormat"), s, this._getFormatConfig(e)) }
    }), e.fn.datepicker = function (t) { if (!this.length) return this; e.datepicker.initialized || (e(document).mousedown(e.datepicker._checkExternalClick), e.datepicker.initialized = !0), 0 === e("#" + e.datepicker._mainDivId).length && e("body").append(e.datepicker.dpDiv); var i = Array.prototype.slice.call(arguments, 1); return "string" != typeof t || "isDisabled" !== t && "getDate" !== t && "widget" !== t ? "option" === t && 2 === arguments.length && "string" == typeof arguments[1] ? e.datepicker["_" + t + "Datepicker"].apply(e.datepicker, [this[0]].concat(i)) : this.each(function () { "string" == typeof t ? e.datepicker["_" + t + "Datepicker"].apply(e.datepicker, [this].concat(i)) : e.datepicker._attachDatepicker(this, t) }) : e.datepicker["_" + t + "Datepicker"].apply(e.datepicker, [this[0]].concat(i)) }, e.datepicker = new i, e.datepicker.initialized = !1, e.datepicker.uuid = (new Date).getTime(), e.datepicker.version = "1.10.4"
})(jQuery); (function (e) { var t = { buttons: !0, height: !0, maxHeight: !0, maxWidth: !0, minHeight: !0, minWidth: !0, width: !0 }, i = { maxHeight: !0, maxWidth: !0, minHeight: !0, minWidth: !0 }; e.widget("ui.dialog", { version: "1.10.4", options: { appendTo: "body", autoOpen: !0, buttons: [], closeOnEscape: !0, closeText: "close", dialogClass: "", draggable: !0, hide: null, height: "auto", maxHeight: null, maxWidth: null, minHeight: 150, minWidth: 150, modal: !1, position: { my: "center", at: "center", of: window, collision: "fit", using: function (t) { var i = e(this).css(t).offset().top; 0 > i && e(this).css("top", t.top - i) } }, resizable: !0, show: null, title: null, width: 300, beforeClose: null, close: null, drag: null, dragStart: null, dragStop: null, focus: null, open: null, resize: null, resizeStart: null, resizeStop: null }, _create: function () { this.originalCss = { display: this.element[0].style.display, width: this.element[0].style.width, minHeight: this.element[0].style.minHeight, maxHeight: this.element[0].style.maxHeight, height: this.element[0].style.height }, this.originalPosition = { parent: this.element.parent(), index: this.element.parent().children().index(this.element) }, this.originalTitle = this.element.attr("title"), this.options.title = this.options.title || this.originalTitle, this._createWrapper(), this.element.show().removeAttr("title").addClass("ui-dialog-content ui-widget-content").appendTo(this.uiDialog), this._createTitlebar(), this._createButtonPane(), this.options.draggable && e.fn.draggable && this._makeDraggable(), this.options.resizable && e.fn.resizable && this._makeResizable(), this._isOpen = !1 }, _init: function () { this.options.autoOpen && this.open() }, _appendTo: function () { var t = this.options.appendTo; return t && (t.jquery || t.nodeType) ? e(t) : this.document.find(t || "body").eq(0) }, _destroy: function () { var e, t = this.originalPosition; this._destroyOverlay(), this.element.removeUniqueId().removeClass("ui-dialog-content ui-widget-content").css(this.originalCss).detach(), this.uiDialog.stop(!0, !0).remove(), this.originalTitle && this.element.attr("title", this.originalTitle), e = t.parent.children().eq(t.index), e.length && e[0] !== this.element[0] ? e.before(this.element) : t.parent.append(this.element) }, widget: function () { return this.uiDialog }, disable: e.noop, enable: e.noop, close: function (t) { var i, a = this; if (this._isOpen && this._trigger("beforeClose", t) !== !1) { if (this._isOpen = !1, this._destroyOverlay(), !this.opener.filter(":focusable").focus().length) try { i = this.document[0].activeElement, i && "body" !== i.nodeName.toLowerCase() && e(i).blur() } catch (s) { } this._hide(this.uiDialog, this.options.hide, function () { a._trigger("close", t) }) } }, isOpen: function () { return this._isOpen }, moveToTop: function () { this._moveToTop() }, _moveToTop: function (e, t) { var i = !!this.uiDialog.nextAll(":visible").insertBefore(this.uiDialog).length; return i && !t && this._trigger("focus", e), i }, open: function () { var t = this; return this._isOpen ? (this._moveToTop() && this._focusTabbable(), undefined) : (this._isOpen = !0, this.opener = e(this.document[0].activeElement), this._size(), this._position(), this._createOverlay(), this._moveToTop(null, !0), this._show(this.uiDialog, this.options.show, function () { t._focusTabbable(), t._trigger("focus") }), this._trigger("open"), undefined) }, _focusTabbable: function () { var e = this.element.find("[autofocus]"); e.length || (e = this.element.find(":tabbable")), e.length || (e = this.uiDialogButtonPane.find(":tabbable")), e.length || (e = this.uiDialogTitlebarClose.filter(":tabbable")), e.length || (e = this.uiDialog), e.eq(0).focus() }, _keepFocus: function (t) { function i() { var t = this.document[0].activeElement, i = this.uiDialog[0] === t || e.contains(this.uiDialog[0], t); i || this._focusTabbable() } t.preventDefault(), i.call(this), this._delay(i) }, _createWrapper: function () { this.uiDialog = e("<div>").addClass("ui-dialog ui-widget ui-widget-content ui-corner-all ui-front " + this.options.dialogClass).hide().attr({ tabIndex: -1, role: "dialog" }).appendTo(this._appendTo()), this._on(this.uiDialog, { keydown: function (t) { if (this.options.closeOnEscape && !t.isDefaultPrevented() && t.keyCode && t.keyCode === e.ui.keyCode.ESCAPE) return t.preventDefault(), this.close(t), undefined; if (t.keyCode === e.ui.keyCode.TAB) { var i = this.uiDialog.find(":tabbable"), a = i.filter(":first"), s = i.filter(":last"); t.target !== s[0] && t.target !== this.uiDialog[0] || t.shiftKey ? t.target !== a[0] && t.target !== this.uiDialog[0] || !t.shiftKey || (s.focus(1), t.preventDefault()) : (a.focus(1), t.preventDefault()) } }, mousedown: function (e) { this._moveToTop(e) && this._focusTabbable() } }), this.element.find("[aria-describedby]").length || this.uiDialog.attr({ "aria-describedby": this.element.uniqueId().attr("id") }) }, _createTitlebar: function () { var t; this.uiDialogTitlebar = e("<div>").addClass("ui-dialog-titlebar ui-widget-header ui-corner-all ui-helper-clearfix").prependTo(this.uiDialog), this._on(this.uiDialogTitlebar, { mousedown: function (t) { e(t.target).closest(".ui-dialog-titlebar-close") || this.uiDialog.focus() } }), this.uiDialogTitlebarClose = e("<button type='button'></button>").button({ label: this.options.closeText, icons: { primary: "ui-icon-closethick" }, text: !1 }).addClass("ui-dialog-titlebar-close").appendTo(this.uiDialogTitlebar), this._on(this.uiDialogTitlebarClose, { click: function (e) { e.preventDefault(), this.close(e) } }), t = e("<span>").uniqueId().addClass("ui-dialog-title").prependTo(this.uiDialogTitlebar), this._title(t), this.uiDialog.attr({ "aria-labelledby": t.attr("id") }) }, _title: function (e) { this.options.title || e.html("&#160;"), e.text(this.options.title) }, _createButtonPane: function () { this.uiDialogButtonPane = e("<div>").addClass("ui-dialog-buttonpane ui-widget-content ui-helper-clearfix"), this.uiButtonSet = e("<div>").addClass("ui-dialog-buttonset").appendTo(this.uiDialogButtonPane), this._createButtons() }, _createButtons: function () { var t = this, i = this.options.buttons; return this.uiDialogButtonPane.remove(), this.uiButtonSet.empty(), e.isEmptyObject(i) || e.isArray(i) && !i.length ? (this.uiDialog.removeClass("ui-dialog-buttons"), undefined) : (e.each(i, function (i, a) { var s, n; a = e.isFunction(a) ? { click: a, text: i } : a, a = e.extend({ type: "button" }, a), s = a.click, a.click = function () { s.apply(t.element[0], arguments) }, n = { icons: a.icons, text: a.showText }, delete a.icons, delete a.showText, e("<button></button>", a).button(n).appendTo(t.uiButtonSet) }), this.uiDialog.addClass("ui-dialog-buttons"), this.uiDialogButtonPane.appendTo(this.uiDialog), undefined) }, _makeDraggable: function () { function t(e) { return { position: e.position, offset: e.offset } } var i = this, a = this.options; this.uiDialog.draggable({ cancel: ".ui-dialog-content, .ui-dialog-titlebar-close", handle: ".ui-dialog-titlebar", containment: "document", start: function (a, s) { e(this).addClass("ui-dialog-dragging"), i._blockFrames(), i._trigger("dragStart", a, t(s)) }, drag: function (e, a) { i._trigger("drag", e, t(a)) }, stop: function (s, n) { a.position = [n.position.left - i.document.scrollLeft(), n.position.top - i.document.scrollTop()], e(this).removeClass("ui-dialog-dragging"), i._unblockFrames(), i._trigger("dragStop", s, t(n)) } }) }, _makeResizable: function () { function t(e) { return { originalPosition: e.originalPosition, originalSize: e.originalSize, position: e.position, size: e.size } } var i = this, a = this.options, s = a.resizable, n = this.uiDialog.css("position"), r = "string" == typeof s ? s : "n,e,s,w,se,sw,ne,nw"; this.uiDialog.resizable({ cancel: ".ui-dialog-content", containment: "document", alsoResize: this.element, maxWidth: a.maxWidth, maxHeight: a.maxHeight, minWidth: a.minWidth, minHeight: this._minHeight(), handles: r, start: function (a, s) { e(this).addClass("ui-dialog-resizing"), i._blockFrames(), i._trigger("resizeStart", a, t(s)) }, resize: function (e, a) { i._trigger("resize", e, t(a)) }, stop: function (s, n) { a.height = e(this).height(), a.width = e(this).width(), e(this).removeClass("ui-dialog-resizing"), i._unblockFrames(), i._trigger("resizeStop", s, t(n)) } }).css("position", n) }, _minHeight: function () { var e = this.options; return "auto" === e.height ? e.minHeight : Math.min(e.minHeight, e.height) }, _position: function () { var e = this.uiDialog.is(":visible"); e || this.uiDialog.show(), this.uiDialog.position(this.options.position), e || this.uiDialog.hide() }, _setOptions: function (a) { var s = this, n = !1, r = {}; e.each(a, function (e, a) { s._setOption(e, a), e in t && (n = !0), e in i && (r[e] = a) }), n && (this._size(), this._position()), this.uiDialog.is(":data(ui-resizable)") && this.uiDialog.resizable("option", r) }, _setOption: function (e, t) { var i, a, s = this.uiDialog; "dialogClass" === e && s.removeClass(this.options.dialogClass).addClass(t), "disabled" !== e && (this._super(e, t), "appendTo" === e && this.uiDialog.appendTo(this._appendTo()), "buttons" === e && this._createButtons(), "closeText" === e && this.uiDialogTitlebarClose.button({ label: "" + t }), "draggable" === e && (i = s.is(":data(ui-draggable)"), i && !t && s.draggable("destroy"), !i && t && this._makeDraggable()), "position" === e && this._position(), "resizable" === e && (a = s.is(":data(ui-resizable)"), a && !t && s.resizable("destroy"), a && "string" == typeof t && s.resizable("option", "handles", t), a || t === !1 || this._makeResizable()), "title" === e && this._title(this.uiDialogTitlebar.find(".ui-dialog-title"))) }, _size: function () { var e, t, i, a = this.options; this.element.show().css({ width: "auto", minHeight: 0, maxHeight: "none", height: 0 }), a.minWidth > a.width && (a.width = a.minWidth), e = this.uiDialog.css({ height: "auto", width: a.width }).outerHeight(), t = Math.max(0, a.minHeight - e), i = "number" == typeof a.maxHeight ? Math.max(0, a.maxHeight - e) : "none", "auto" === a.height ? this.element.css({ minHeight: t, maxHeight: i, height: "auto" }) : this.element.height(Math.max(0, a.height - e)), this.uiDialog.is(":data(ui-resizable)") && this.uiDialog.resizable("option", "minHeight", this._minHeight()) }, _blockFrames: function () { this.iframeBlocks = this.document.find("iframe").map(function () { var t = e(this); return e("<div>").css({ position: "absolute", width: t.outerWidth(), height: t.outerHeight() }).appendTo(t.parent()).offset(t.offset())[0] }) }, _unblockFrames: function () { this.iframeBlocks && (this.iframeBlocks.remove(), delete this.iframeBlocks) }, _allowInteraction: function (t) { return e(t.target).closest(".ui-dialog").length ? !0 : !!e(t.target).closest(".ui-datepicker").length }, _createOverlay: function () { if (this.options.modal) { var t = this, i = this.widgetFullName; e.ui.dialog.overlayInstances || this._delay(function () { e.ui.dialog.overlayInstances && this.document.bind("focusin.dialog", function (a) { t._allowInteraction(a) || (a.preventDefault(), e(".ui-dialog:visible:last .ui-dialog-content").data(i)._focusTabbable()) }) }), this.overlay = e("<div>").addClass("ui-widget-overlay ui-front").appendTo(this._appendTo()), this._on(this.overlay, { mousedown: "_keepFocus" }), e.ui.dialog.overlayInstances++ } }, _destroyOverlay: function () { this.options.modal && this.overlay && (e.ui.dialog.overlayInstances--, e.ui.dialog.overlayInstances || this.document.unbind("focusin.dialog"), this.overlay.remove(), this.overlay = null) } }), e.ui.dialog.overlayInstances = 0, e.uiBackCompat !== !1 && e.widget("ui.dialog", e.ui.dialog, { _position: function () { var t, i = this.options.position, a = [], s = [0, 0]; i ? (("string" == typeof i || "object" == typeof i && "0" in i) && (a = i.split ? i.split(" ") : [i[0], i[1]], 1 === a.length && (a[1] = a[0]), e.each(["left", "top"], function (e, t) { +a[e] === a[e] && (s[e] = a[e], a[e] = t) }), i = { my: a[0] + (0 > s[0] ? s[0] : "+" + s[0]) + " " + a[1] + (0 > s[1] ? s[1] : "+" + s[1]), at: a.join(" ") }), i = e.extend({}, e.ui.dialog.prototype.options.position, i)) : i = e.ui.dialog.prototype.options.position, t = this.uiDialog.is(":visible"), t || this.uiDialog.show(), this.uiDialog.position(i), t || this.uiDialog.hide() } }) })(jQuery); (function (t) { t.widget("ui.draggable", t.ui.mouse, { version: "1.10.4", widgetEventPrefix: "drag", options: { addClasses: !0, appendTo: "parent", axis: !1, connectToSortable: !1, containment: !1, cursor: "auto", cursorAt: !1, grid: !1, handle: !1, helper: "original", iframeFix: !1, opacity: !1, refreshPositions: !1, revert: !1, revertDuration: 500, scope: "default", scroll: !0, scrollSensitivity: 20, scrollSpeed: 20, snap: !1, snapMode: "both", snapTolerance: 20, stack: !1, zIndex: !1, drag: null, start: null, stop: null }, _create: function () { "original" !== this.options.helper || /^(?:r|a|f)/.test(this.element.css("position")) || (this.element[0].style.position = "relative"), this.options.addClasses && this.element.addClass("ui-draggable"), this.options.disabled && this.element.addClass("ui-draggable-disabled"), this._mouseInit() }, _destroy: function () { this.element.removeClass("ui-draggable ui-draggable-dragging ui-draggable-disabled"), this._mouseDestroy() }, _mouseCapture: function (e) { var i = this.options; return this.helper || i.disabled || t(e.target).closest(".ui-resizable-handle").length > 0 ? !1 : (this.handle = this._getHandle(e), this.handle ? (t(i.iframeFix === !0 ? "iframe" : i.iframeFix).each(function () { t("<div class='ui-draggable-iframeFix' style='background: #fff;'></div>").css({ width: this.offsetWidth + "px", height: this.offsetHeight + "px", position: "absolute", opacity: "0.001", zIndex: 1e3 }).css(t(this).offset()).appendTo("body") }), !0) : !1) }, _mouseStart: function (e) { var i = this.options; return this.helper = this._createHelper(e), this.helper.addClass("ui-draggable-dragging"), this._cacheHelperProportions(), t.ui.ddmanager && (t.ui.ddmanager.current = this), this._cacheMargins(), this.cssPosition = this.helper.css("position"), this.scrollParent = this.helper.scrollParent(), this.offsetParent = this.helper.offsetParent(), this.offsetParentCssPosition = this.offsetParent.css("position"), this.offset = this.positionAbs = this.element.offset(), this.offset = { top: this.offset.top - this.margins.top, left: this.offset.left - this.margins.left }, this.offset.scroll = !1, t.extend(this.offset, { click: { left: e.pageX - this.offset.left, top: e.pageY - this.offset.top }, parent: this._getParentOffset(), relative: this._getRelativeOffset() }), this.originalPosition = this.position = this._generatePosition(e), this.originalPageX = e.pageX, this.originalPageY = e.pageY, i.cursorAt && this._adjustOffsetFromHelper(i.cursorAt), this._setContainment(), this._trigger("start", e) === !1 ? (this._clear(), !1) : (this._cacheHelperProportions(), t.ui.ddmanager && !i.dropBehaviour && t.ui.ddmanager.prepareOffsets(this, e), this._mouseDrag(e, !0), t.ui.ddmanager && t.ui.ddmanager.dragStart(this, e), !0) }, _mouseDrag: function (e, i) { if ("fixed" === this.offsetParentCssPosition && (this.offset.parent = this._getParentOffset()), this.position = this._generatePosition(e), this.positionAbs = this._convertPositionTo("absolute"), !i) { var s = this._uiHash(); if (this._trigger("drag", e, s) === !1) return this._mouseUp({}), !1; this.position = s.position } return this.options.axis && "y" === this.options.axis || (this.helper[0].style.left = this.position.left + "px"), this.options.axis && "x" === this.options.axis || (this.helper[0].style.top = this.position.top + "px"), t.ui.ddmanager && t.ui.ddmanager.drag(this, e), !1 }, _mouseStop: function (e) { var i = this, s = !1; return t.ui.ddmanager && !this.options.dropBehaviour && (s = t.ui.ddmanager.drop(this, e)), this.dropped && (s = this.dropped, this.dropped = !1), "original" !== this.options.helper || t.contains(this.element[0].ownerDocument, this.element[0]) ? ("invalid" === this.options.revert && !s || "valid" === this.options.revert && s || this.options.revert === !0 || t.isFunction(this.options.revert) && this.options.revert.call(this.element, s) ? t(this.helper).animate(this.originalPosition, parseInt(this.options.revertDuration, 10), function () { i._trigger("stop", e) !== !1 && i._clear() }) : this._trigger("stop", e) !== !1 && this._clear(), !1) : !1 }, _mouseUp: function (e) { return t("div.ui-draggable-iframeFix").each(function () { this.parentNode.removeChild(this) }), t.ui.ddmanager && t.ui.ddmanager.dragStop(this, e), t.ui.mouse.prototype._mouseUp.call(this, e) }, cancel: function () { return this.helper.is(".ui-draggable-dragging") ? this._mouseUp({}) : this._clear(), this }, _getHandle: function (e) { return this.options.handle ? !!t(e.target).closest(this.element.find(this.options.handle)).length : !0 }, _createHelper: function (e) { var i = this.options, s = t.isFunction(i.helper) ? t(i.helper.apply(this.element[0], [e])) : "clone" === i.helper ? this.element.clone().removeAttr("id") : this.element; return s.parents("body").length || s.appendTo("parent" === i.appendTo ? this.element[0].parentNode : i.appendTo), s[0] === this.element[0] || /(fixed|absolute)/.test(s.css("position")) || s.css("position", "absolute"), s }, _adjustOffsetFromHelper: function (e) { "string" == typeof e && (e = e.split(" ")), t.isArray(e) && (e = { left: +e[0], top: +e[1] || 0 }), "left" in e && (this.offset.click.left = e.left + this.margins.left), "right" in e && (this.offset.click.left = this.helperProportions.width - e.right + this.margins.left), "top" in e && (this.offset.click.top = e.top + this.margins.top), "bottom" in e && (this.offset.click.top = this.helperProportions.height - e.bottom + this.margins.top) }, _getParentOffset: function () { var e = this.offsetParent.offset(); return "absolute" === this.cssPosition && this.scrollParent[0] !== document && t.contains(this.scrollParent[0], this.offsetParent[0]) && (e.left += this.scrollParent.scrollLeft(), e.top += this.scrollParent.scrollTop()), (this.offsetParent[0] === document.body || this.offsetParent[0].tagName && "html" === this.offsetParent[0].tagName.toLowerCase() && t.ui.ie) && (e = { top: 0, left: 0 }), { top: e.top + (parseInt(this.offsetParent.css("borderTopWidth"), 10) || 0), left: e.left + (parseInt(this.offsetParent.css("borderLeftWidth"), 10) || 0) } }, _getRelativeOffset: function () { if ("relative" === this.cssPosition) { var t = this.element.position(); return { top: t.top - (parseInt(this.helper.css("top"), 10) || 0) + this.scrollParent.scrollTop(), left: t.left - (parseInt(this.helper.css("left"), 10) || 0) + this.scrollParent.scrollLeft() } } return { top: 0, left: 0 } }, _cacheMargins: function () { this.margins = { left: parseInt(this.element.css("marginLeft"), 10) || 0, top: parseInt(this.element.css("marginTop"), 10) || 0, right: parseInt(this.element.css("marginRight"), 10) || 0, bottom: parseInt(this.element.css("marginBottom"), 10) || 0 } }, _cacheHelperProportions: function () { this.helperProportions = { width: this.helper.outerWidth(), height: this.helper.outerHeight() } }, _setContainment: function () { var e, i, s, n = this.options; return n.containment ? "window" === n.containment ? (this.containment = [t(window).scrollLeft() - this.offset.relative.left - this.offset.parent.left, t(window).scrollTop() - this.offset.relative.top - this.offset.parent.top, t(window).scrollLeft() + t(window).width() - this.helperProportions.width - this.margins.left, t(window).scrollTop() + (t(window).height() || document.body.parentNode.scrollHeight) - this.helperProportions.height - this.margins.top], undefined) : "document" === n.containment ? (this.containment = [0, 0, t(document).width() - this.helperProportions.width - this.margins.left, (t(document).height() || document.body.parentNode.scrollHeight) - this.helperProportions.height - this.margins.top], undefined) : n.containment.constructor === Array ? (this.containment = n.containment, undefined) : ("parent" === n.containment && (n.containment = this.helper[0].parentNode), i = t(n.containment), s = i[0], s && (e = "hidden" !== i.css("overflow"), this.containment = [(parseInt(i.css("borderLeftWidth"), 10) || 0) + (parseInt(i.css("paddingLeft"), 10) || 0), (parseInt(i.css("borderTopWidth"), 10) || 0) + (parseInt(i.css("paddingTop"), 10) || 0), (e ? Math.max(s.scrollWidth, s.offsetWidth) : s.offsetWidth) - (parseInt(i.css("borderRightWidth"), 10) || 0) - (parseInt(i.css("paddingRight"), 10) || 0) - this.helperProportions.width - this.margins.left - this.margins.right, (e ? Math.max(s.scrollHeight, s.offsetHeight) : s.offsetHeight) - (parseInt(i.css("borderBottomWidth"), 10) || 0) - (parseInt(i.css("paddingBottom"), 10) || 0) - this.helperProportions.height - this.margins.top - this.margins.bottom], this.relative_container = i), undefined) : (this.containment = null, undefined) }, _convertPositionTo: function (e, i) { i || (i = this.position); var s = "absolute" === e ? 1 : -1, n = "absolute" !== this.cssPosition || this.scrollParent[0] !== document && t.contains(this.scrollParent[0], this.offsetParent[0]) ? this.scrollParent : this.offsetParent; return this.offset.scroll || (this.offset.scroll = { top: n.scrollTop(), left: n.scrollLeft() }), { top: i.top + this.offset.relative.top * s + this.offset.parent.top * s - ("fixed" === this.cssPosition ? -this.scrollParent.scrollTop() : this.offset.scroll.top) * s, left: i.left + this.offset.relative.left * s + this.offset.parent.left * s - ("fixed" === this.cssPosition ? -this.scrollParent.scrollLeft() : this.offset.scroll.left) * s } }, _generatePosition: function (e) { var i, s, n, a, o = this.options, r = "absolute" !== this.cssPosition || this.scrollParent[0] !== document && t.contains(this.scrollParent[0], this.offsetParent[0]) ? this.scrollParent : this.offsetParent, l = e.pageX, h = e.pageY; return this.offset.scroll || (this.offset.scroll = { top: r.scrollTop(), left: r.scrollLeft() }), this.originalPosition && (this.containment && (this.relative_container ? (s = this.relative_container.offset(), i = [this.containment[0] + s.left, this.containment[1] + s.top, this.containment[2] + s.left, this.containment[3] + s.top]) : i = this.containment, e.pageX - this.offset.click.left < i[0] && (l = i[0] + this.offset.click.left), e.pageY - this.offset.click.top < i[1] && (h = i[1] + this.offset.click.top), e.pageX - this.offset.click.left > i[2] && (l = i[2] + this.offset.click.left), e.pageY - this.offset.click.top > i[3] && (h = i[3] + this.offset.click.top)), o.grid && (n = o.grid[1] ? this.originalPageY + Math.round((h - this.originalPageY) / o.grid[1]) * o.grid[1] : this.originalPageY, h = i ? n - this.offset.click.top >= i[1] || n - this.offset.click.top > i[3] ? n : n - this.offset.click.top >= i[1] ? n - o.grid[1] : n + o.grid[1] : n, a = o.grid[0] ? this.originalPageX + Math.round((l - this.originalPageX) / o.grid[0]) * o.grid[0] : this.originalPageX, l = i ? a - this.offset.click.left >= i[0] || a - this.offset.click.left > i[2] ? a : a - this.offset.click.left >= i[0] ? a - o.grid[0] : a + o.grid[0] : a)), { top: h - this.offset.click.top - this.offset.relative.top - this.offset.parent.top + ("fixed" === this.cssPosition ? -this.scrollParent.scrollTop() : this.offset.scroll.top), left: l - this.offset.click.left - this.offset.relative.left - this.offset.parent.left + ("fixed" === this.cssPosition ? -this.scrollParent.scrollLeft() : this.offset.scroll.left) } }, _clear: function () { this.helper.removeClass("ui-draggable-dragging"), this.helper[0] === this.element[0] || this.cancelHelperRemoval || this.helper.remove(), this.helper = null, this.cancelHelperRemoval = !1 }, _trigger: function (e, i, s) { return s = s || this._uiHash(), t.ui.plugin.call(this, e, [i, s]), "drag" === e && (this.positionAbs = this._convertPositionTo("absolute")), t.Widget.prototype._trigger.call(this, e, i, s) }, plugins: {}, _uiHash: function () { return { helper: this.helper, position: this.position, originalPosition: this.originalPosition, offset: this.positionAbs } } }), t.ui.plugin.add("draggable", "connectToSortable", { start: function (e, i) { var s = t(this).data("ui-draggable"), n = s.options, a = t.extend({}, i, { item: s.element }); s.sortables = [], t(n.connectToSortable).each(function () { var i = t.data(this, "ui-sortable"); i && !i.options.disabled && (s.sortables.push({ instance: i, shouldRevert: i.options.revert }), i.refreshPositions(), i._trigger("activate", e, a)) }) }, stop: function (e, i) { var s = t(this).data("ui-draggable"), n = t.extend({}, i, { item: s.element }); t.each(s.sortables, function () { this.instance.isOver ? (this.instance.isOver = 0, s.cancelHelperRemoval = !0, this.instance.cancelHelperRemoval = !1, this.shouldRevert && (this.instance.options.revert = this.shouldRevert), this.instance._mouseStop(e), this.instance.options.helper = this.instance.options._helper, "original" === s.options.helper && this.instance.currentItem.css({ top: "auto", left: "auto" })) : (this.instance.cancelHelperRemoval = !1, this.instance._trigger("deactivate", e, n)) }) }, drag: function (e, i) { var s = t(this).data("ui-draggable"), n = this; t.each(s.sortables, function () { var a = !1, o = this; this.instance.positionAbs = s.positionAbs, this.instance.helperProportions = s.helperProportions, this.instance.offset.click = s.offset.click, this.instance._intersectsWith(this.instance.containerCache) && (a = !0, t.each(s.sortables, function () { return this.instance.positionAbs = s.positionAbs, this.instance.helperProportions = s.helperProportions, this.instance.offset.click = s.offset.click, this !== o && this.instance._intersectsWith(this.instance.containerCache) && t.contains(o.instance.element[0], this.instance.element[0]) && (a = !1), a })), a ? (this.instance.isOver || (this.instance.isOver = 1, this.instance.currentItem = t(n).clone().removeAttr("id").appendTo(this.instance.element).data("ui-sortable-item", !0), this.instance.options._helper = this.instance.options.helper, this.instance.options.helper = function () { return i.helper[0] }, e.target = this.instance.currentItem[0], this.instance._mouseCapture(e, !0), this.instance._mouseStart(e, !0, !0), this.instance.offset.click.top = s.offset.click.top, this.instance.offset.click.left = s.offset.click.left, this.instance.offset.parent.left -= s.offset.parent.left - this.instance.offset.parent.left, this.instance.offset.parent.top -= s.offset.parent.top - this.instance.offset.parent.top, s._trigger("toSortable", e), s.dropped = this.instance.element, s.currentItem = s.element, this.instance.fromOutside = s), this.instance.currentItem && this.instance._mouseDrag(e)) : this.instance.isOver && (this.instance.isOver = 0, this.instance.cancelHelperRemoval = !0, this.instance.options.revert = !1, this.instance._trigger("out", e, this.instance._uiHash(this.instance)), this.instance._mouseStop(e, !0), this.instance.options.helper = this.instance.options._helper, this.instance.currentItem.remove(), this.instance.placeholder && this.instance.placeholder.remove(), s._trigger("fromSortable", e), s.dropped = !1) }) } }), t.ui.plugin.add("draggable", "cursor", { start: function () { var e = t("body"), i = t(this).data("ui-draggable").options; e.css("cursor") && (i._cursor = e.css("cursor")), e.css("cursor", i.cursor) }, stop: function () { var e = t(this).data("ui-draggable").options; e._cursor && t("body").css("cursor", e._cursor) } }), t.ui.plugin.add("draggable", "opacity", { start: function (e, i) { var s = t(i.helper), n = t(this).data("ui-draggable").options; s.css("opacity") && (n._opacity = s.css("opacity")), s.css("opacity", n.opacity) }, stop: function (e, i) { var s = t(this).data("ui-draggable").options; s._opacity && t(i.helper).css("opacity", s._opacity) } }), t.ui.plugin.add("draggable", "scroll", { start: function () { var e = t(this).data("ui-draggable"); e.scrollParent[0] !== document && "HTML" !== e.scrollParent[0].tagName && (e.overflowOffset = e.scrollParent.offset()) }, drag: function (e) { var i = t(this).data("ui-draggable"), s = i.options, n = !1; i.scrollParent[0] !== document && "HTML" !== i.scrollParent[0].tagName ? (s.axis && "x" === s.axis || (i.overflowOffset.top + i.scrollParent[0].offsetHeight - e.pageY < s.scrollSensitivity ? i.scrollParent[0].scrollTop = n = i.scrollParent[0].scrollTop + s.scrollSpeed : e.pageY - i.overflowOffset.top < s.scrollSensitivity && (i.scrollParent[0].scrollTop = n = i.scrollParent[0].scrollTop - s.scrollSpeed)), s.axis && "y" === s.axis || (i.overflowOffset.left + i.scrollParent[0].offsetWidth - e.pageX < s.scrollSensitivity ? i.scrollParent[0].scrollLeft = n = i.scrollParent[0].scrollLeft + s.scrollSpeed : e.pageX - i.overflowOffset.left < s.scrollSensitivity && (i.scrollParent[0].scrollLeft = n = i.scrollParent[0].scrollLeft - s.scrollSpeed))) : (s.axis && "x" === s.axis || (e.pageY - t(document).scrollTop() < s.scrollSensitivity ? n = t(document).scrollTop(t(document).scrollTop() - s.scrollSpeed) : t(window).height() - (e.pageY - t(document).scrollTop()) < s.scrollSensitivity && (n = t(document).scrollTop(t(document).scrollTop() + s.scrollSpeed))), s.axis && "y" === s.axis || (e.pageX - t(document).scrollLeft() < s.scrollSensitivity ? n = t(document).scrollLeft(t(document).scrollLeft() - s.scrollSpeed) : t(window).width() - (e.pageX - t(document).scrollLeft()) < s.scrollSensitivity && (n = t(document).scrollLeft(t(document).scrollLeft() + s.scrollSpeed)))), n !== !1 && t.ui.ddmanager && !s.dropBehaviour && t.ui.ddmanager.prepareOffsets(i, e) } }), t.ui.plugin.add("draggable", "snap", { start: function () { var e = t(this).data("ui-draggable"), i = e.options; e.snapElements = [], t(i.snap.constructor !== String ? i.snap.items || ":data(ui-draggable)" : i.snap).each(function () { var i = t(this), s = i.offset(); this !== e.element[0] && e.snapElements.push({ item: this, width: i.outerWidth(), height: i.outerHeight(), top: s.top, left: s.left }) }) }, drag: function (e, i) { var s, n, a, o, r, l, h, c, u, d, p = t(this).data("ui-draggable"), g = p.options, f = g.snapTolerance, m = i.offset.left, _ = m + p.helperProportions.width, v = i.offset.top, b = v + p.helperProportions.height; for (u = p.snapElements.length - 1; u >= 0; u--) r = p.snapElements[u].left, l = r + p.snapElements[u].width, h = p.snapElements[u].top, c = h + p.snapElements[u].height, r - f > _ || m > l + f || h - f > b || v > c + f || !t.contains(p.snapElements[u].item.ownerDocument, p.snapElements[u].item) ? (p.snapElements[u].snapping && p.options.snap.release && p.options.snap.release.call(p.element, e, t.extend(p._uiHash(), { snapItem: p.snapElements[u].item })), p.snapElements[u].snapping = !1) : ("inner" !== g.snapMode && (s = f >= Math.abs(h - b), n = f >= Math.abs(c - v), a = f >= Math.abs(r - _), o = f >= Math.abs(l - m), s && (i.position.top = p._convertPositionTo("relative", { top: h - p.helperProportions.height, left: 0 }).top - p.margins.top), n && (i.position.top = p._convertPositionTo("relative", { top: c, left: 0 }).top - p.margins.top), a && (i.position.left = p._convertPositionTo("relative", { top: 0, left: r - p.helperProportions.width }).left - p.margins.left), o && (i.position.left = p._convertPositionTo("relative", { top: 0, left: l }).left - p.margins.left)), d = s || n || a || o, "outer" !== g.snapMode && (s = f >= Math.abs(h - v), n = f >= Math.abs(c - b), a = f >= Math.abs(r - m), o = f >= Math.abs(l - _), s && (i.position.top = p._convertPositionTo("relative", { top: h, left: 0 }).top - p.margins.top), n && (i.position.top = p._convertPositionTo("relative", { top: c - p.helperProportions.height, left: 0 }).top - p.margins.top), a && (i.position.left = p._convertPositionTo("relative", { top: 0, left: r }).left - p.margins.left), o && (i.position.left = p._convertPositionTo("relative", { top: 0, left: l - p.helperProportions.width }).left - p.margins.left)), !p.snapElements[u].snapping && (s || n || a || o || d) && p.options.snap.snap && p.options.snap.snap.call(p.element, e, t.extend(p._uiHash(), { snapItem: p.snapElements[u].item })), p.snapElements[u].snapping = s || n || a || o || d) } }), t.ui.plugin.add("draggable", "stack", { start: function () { var e, i = this.data("ui-draggable").options, s = t.makeArray(t(i.stack)).sort(function (e, i) { return (parseInt(t(e).css("zIndex"), 10) || 0) - (parseInt(t(i).css("zIndex"), 10) || 0) }); s.length && (e = parseInt(t(s[0]).css("zIndex"), 10) || 0, t(s).each(function (i) { t(this).css("zIndex", e + i) }), this.css("zIndex", e + s.length)) } }), t.ui.plugin.add("draggable", "zIndex", { start: function (e, i) { var s = t(i.helper), n = t(this).data("ui-draggable").options; s.css("zIndex") && (n._zIndex = s.css("zIndex")), s.css("zIndex", n.zIndex) }, stop: function (e, i) { var s = t(this).data("ui-draggable").options; s._zIndex && t(i.helper).css("zIndex", s._zIndex) } }) })(jQuery); (function (t) { function e(t, e, i) { return t > e && e + i > t } t.widget("ui.droppable", { version: "1.10.4", widgetEventPrefix: "drop", options: { accept: "*", activeClass: !1, addClasses: !0, greedy: !1, hoverClass: !1, scope: "default", tolerance: "intersect", activate: null, deactivate: null, drop: null, out: null, over: null }, _create: function () { var e, i = this.options, s = i.accept; this.isover = !1, this.isout = !0, this.accept = t.isFunction(s) ? s : function (t) { return t.is(s) }, this.proportions = function () { return arguments.length ? (e = arguments[0], undefined) : e ? e : e = { width: this.element[0].offsetWidth, height: this.element[0].offsetHeight } }, t.ui.ddmanager.droppables[i.scope] = t.ui.ddmanager.droppables[i.scope] || [], t.ui.ddmanager.droppables[i.scope].push(this), i.addClasses && this.element.addClass("ui-droppable") }, _destroy: function () { for (var e = 0, i = t.ui.ddmanager.droppables[this.options.scope]; i.length > e; e++) i[e] === this && i.splice(e, 1); this.element.removeClass("ui-droppable ui-droppable-disabled") }, _setOption: function (e, i) { "accept" === e && (this.accept = t.isFunction(i) ? i : function (t) { return t.is(i) }), t.Widget.prototype._setOption.apply(this, arguments) }, _activate: function (e) { var i = t.ui.ddmanager.current; this.options.activeClass && this.element.addClass(this.options.activeClass), i && this._trigger("activate", e, this.ui(i)) }, _deactivate: function (e) { var i = t.ui.ddmanager.current; this.options.activeClass && this.element.removeClass(this.options.activeClass), i && this._trigger("deactivate", e, this.ui(i)) }, _over: function (e) { var i = t.ui.ddmanager.current; i && (i.currentItem || i.element)[0] !== this.element[0] && this.accept.call(this.element[0], i.currentItem || i.element) && (this.options.hoverClass && this.element.addClass(this.options.hoverClass), this._trigger("over", e, this.ui(i))) }, _out: function (e) { var i = t.ui.ddmanager.current; i && (i.currentItem || i.element)[0] !== this.element[0] && this.accept.call(this.element[0], i.currentItem || i.element) && (this.options.hoverClass && this.element.removeClass(this.options.hoverClass), this._trigger("out", e, this.ui(i))) }, _drop: function (e, i) { var s = i || t.ui.ddmanager.current, n = !1; return s && (s.currentItem || s.element)[0] !== this.element[0] ? (this.element.find(":data(ui-droppable)").not(".ui-draggable-dragging").each(function () { var e = t.data(this, "ui-droppable"); return e.options.greedy && !e.options.disabled && e.options.scope === s.options.scope && e.accept.call(e.element[0], s.currentItem || s.element) && t.ui.intersect(s, t.extend(e, { offset: e.element.offset() }), e.options.tolerance) ? (n = !0, !1) : undefined }), n ? !1 : this.accept.call(this.element[0], s.currentItem || s.element) ? (this.options.activeClass && this.element.removeClass(this.options.activeClass), this.options.hoverClass && this.element.removeClass(this.options.hoverClass), this._trigger("drop", e, this.ui(s)), this.element) : !1) : !1 }, ui: function (t) { return { draggable: t.currentItem || t.element, helper: t.helper, position: t.position, offset: t.positionAbs } } }), t.ui.intersect = function (t, i, s) { if (!i.offset) return !1; var n, a, o = (t.positionAbs || t.position.absolute).left, r = (t.positionAbs || t.position.absolute).top, l = o + t.helperProportions.width, h = r + t.helperProportions.height, c = i.offset.left, u = i.offset.top, d = c + i.proportions().width, p = u + i.proportions().height; switch (s) { case "fit": return o >= c && d >= l && r >= u && p >= h; case "intersect": return o + t.helperProportions.width / 2 > c && d > l - t.helperProportions.width / 2 && r + t.helperProportions.height / 2 > u && p > h - t.helperProportions.height / 2; case "pointer": return n = (t.positionAbs || t.position.absolute).left + (t.clickOffset || t.offset.click).left, a = (t.positionAbs || t.position.absolute).top + (t.clickOffset || t.offset.click).top, e(a, u, i.proportions().height) && e(n, c, i.proportions().width); case "touch": return (r >= u && p >= r || h >= u && p >= h || u > r && h > p) && (o >= c && d >= o || l >= c && d >= l || c > o && l > d); default: return !1 } }, t.ui.ddmanager = { current: null, droppables: { "default": [] }, prepareOffsets: function (e, i) { var s, n, a = t.ui.ddmanager.droppables[e.options.scope] || [], o = i ? i.type : null, r = (e.currentItem || e.element).find(":data(ui-droppable)").addBack(); t: for (s = 0; a.length > s; s++) if (!(a[s].options.disabled || e && !a[s].accept.call(a[s].element[0], e.currentItem || e.element))) { for (n = 0; r.length > n; n++) if (r[n] === a[s].element[0]) { a[s].proportions().height = 0; continue t } a[s].visible = "none" !== a[s].element.css("display"), a[s].visible && ("mousedown" === o && a[s]._activate.call(a[s], i), a[s].offset = a[s].element.offset(), a[s].proportions({ width: a[s].element[0].offsetWidth, height: a[s].element[0].offsetHeight })) } }, drop: function (e, i) { var s = !1; return t.each((t.ui.ddmanager.droppables[e.options.scope] || []).slice(), function () { this.options && (!this.options.disabled && this.visible && t.ui.intersect(e, this, this.options.tolerance) && (s = this._drop.call(this, i) || s), !this.options.disabled && this.visible && this.accept.call(this.element[0], e.currentItem || e.element) && (this.isout = !0, this.isover = !1, this._deactivate.call(this, i))) }), s }, dragStart: function (e, i) { e.element.parentsUntil("body").bind("scroll.droppable", function () { e.options.refreshPositions || t.ui.ddmanager.prepareOffsets(e, i) }) }, drag: function (e, i) { e.options.refreshPositions && t.ui.ddmanager.prepareOffsets(e, i), t.each(t.ui.ddmanager.droppables[e.options.scope] || [], function () { if (!this.options.disabled && !this.greedyChild && this.visible) { var s, n, a, o = t.ui.intersect(e, this, this.options.tolerance), r = !o && this.isover ? "isout" : o && !this.isover ? "isover" : null; r && (this.options.greedy && (n = this.options.scope, a = this.element.parents(":data(ui-droppable)").filter(function () { return t.data(this, "ui-droppable").options.scope === n }), a.length && (s = t.data(a[0], "ui-droppable"), s.greedyChild = "isover" === r)), s && "isover" === r && (s.isover = !1, s.isout = !0, s._out.call(s, i)), this[r] = !0, this["isout" === r ? "isover" : "isout"] = !1, this["isover" === r ? "_over" : "_out"].call(this, i), s && "isout" === r && (s.isout = !1, s.isover = !0, s._over.call(s, i))) } }) }, dragStop: function (e, i) { e.element.parentsUntil("body").unbind("scroll.droppable"), e.options.refreshPositions || t.ui.ddmanager.prepareOffsets(e, i) } } })(jQuery); (function (t, e) { var i = "ui-effects-"; t.effects = { effect: {} }, function (t, e) { function i(t, e, i) { var s = u[e.type] || {}; return null == t ? i || !e.def ? null : e.def : (t = s.floor ? ~~t : parseFloat(t), isNaN(t) ? e.def : s.mod ? (t + s.mod) % s.mod : 0 > t ? 0 : t > s.max ? s.max : t) } function s(i) { var s = h(), n = s._rgba = []; return i = i.toLowerCase(), f(l, function (t, a) { var o, r = a.re.exec(i), l = r && a.parse(r), h = a.space || "rgba"; return l ? (o = s[h](l), s[c[h].cache] = o[c[h].cache], n = s._rgba = o._rgba, !1) : e }), n.length ? ("0,0,0,0" === n.join() && t.extend(n, a.transparent), s) : a[i] } function n(t, e, i) { return i = (i + 1) % 1, 1 > 6 * i ? t + 6 * (e - t) * i : 1 > 2 * i ? e : 2 > 3 * i ? t + 6 * (e - t) * (2 / 3 - i) : t } var a, o = "backgroundColor borderBottomColor borderLeftColor borderRightColor borderTopColor color columnRuleColor outlineColor textDecorationColor textEmphasisColor", r = /^([\-+])=\s*(\d+\.?\d*)/, l = [{ re: /rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/, parse: function (t) { return [t[1], t[2], t[3], t[4]] } }, { re: /rgba?\(\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/, parse: function (t) { return [2.55 * t[1], 2.55 * t[2], 2.55 * t[3], t[4]] } }, { re: /#([a-f0-9]{2})([a-f0-9]{2})([a-f0-9]{2})/, parse: function (t) { return [parseInt(t[1], 16), parseInt(t[2], 16), parseInt(t[3], 16)] } }, { re: /#([a-f0-9])([a-f0-9])([a-f0-9])/, parse: function (t) { return [parseInt(t[1] + t[1], 16), parseInt(t[2] + t[2], 16), parseInt(t[3] + t[3], 16)] } }, { re: /hsla?\(\s*(\d+(?:\.\d+)?)\s*,\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/, space: "hsla", parse: function (t) { return [t[1], t[2] / 100, t[3] / 100, t[4]] } }], h = t.Color = function (e, i, s, n) { return new t.Color.fn.parse(e, i, s, n) }, c = { rgba: { props: { red: { idx: 0, type: "byte" }, green: { idx: 1, type: "byte" }, blue: { idx: 2, type: "byte" } } }, hsla: { props: { hue: { idx: 0, type: "degrees" }, saturation: { idx: 1, type: "percent" }, lightness: { idx: 2, type: "percent" } } } }, u = { "byte": { floor: !0, max: 255 }, percent: { max: 1 }, degrees: { mod: 360, floor: !0 } }, d = h.support = {}, p = t("<p>")[0], f = t.each; p.style.cssText = "background-color:rgba(1,1,1,.5)", d.rgba = p.style.backgroundColor.indexOf("rgba") > -1, f(c, function (t, e) { e.cache = "_" + t, e.props.alpha = { idx: 3, type: "percent", def: 1 } }), h.fn = t.extend(h.prototype, { parse: function (n, o, r, l) { if (n === e) return this._rgba = [null, null, null, null], this; (n.jquery || n.nodeType) && (n = t(n).css(o), o = e); var u = this, d = t.type(n), p = this._rgba = []; return o !== e && (n = [n, o, r, l], d = "array"), "string" === d ? this.parse(s(n) || a._default) : "array" === d ? (f(c.rgba.props, function (t, e) { p[e.idx] = i(n[e.idx], e) }), this) : "object" === d ? (n instanceof h ? f(c, function (t, e) { n[e.cache] && (u[e.cache] = n[e.cache].slice()) }) : f(c, function (e, s) { var a = s.cache; f(s.props, function (t, e) { if (!u[a] && s.to) { if ("alpha" === t || null == n[t]) return; u[a] = s.to(u._rgba) } u[a][e.idx] = i(n[t], e, !0) }), u[a] && 0 > t.inArray(null, u[a].slice(0, 3)) && (u[a][3] = 1, s.from && (u._rgba = s.from(u[a]))) }), this) : e }, is: function (t) { var i = h(t), s = !0, n = this; return f(c, function (t, a) { var o, r = i[a.cache]; return r && (o = n[a.cache] || a.to && a.to(n._rgba) || [], f(a.props, function (t, i) { return null != r[i.idx] ? s = r[i.idx] === o[i.idx] : e })), s }), s }, _space: function () { var t = [], e = this; return f(c, function (i, s) { e[s.cache] && t.push(i) }), t.pop() }, transition: function (t, e) { var s = h(t), n = s._space(), a = c[n], o = 0 === this.alpha() ? h("transparent") : this, r = o[a.cache] || a.to(o._rgba), l = r.slice(); return s = s[a.cache], f(a.props, function (t, n) { var a = n.idx, o = r[a], h = s[a], c = u[n.type] || {}; null !== h && (null === o ? l[a] = h : (c.mod && (h - o > c.mod / 2 ? o += c.mod : o - h > c.mod / 2 && (o -= c.mod)), l[a] = i((h - o) * e + o, n))) }), this[n](l) }, blend: function (e) { if (1 === this._rgba[3]) return this; var i = this._rgba.slice(), s = i.pop(), n = h(e)._rgba; return h(t.map(i, function (t, e) { return (1 - s) * n[e] + s * t })) }, toRgbaString: function () { var e = "rgba(", i = t.map(this._rgba, function (t, e) { return null == t ? e > 2 ? 1 : 0 : t }); return 1 === i[3] && (i.pop(), e = "rgb("), e + i.join() + ")" }, toHslaString: function () { var e = "hsla(", i = t.map(this.hsla(), function (t, e) { return null == t && (t = e > 2 ? 1 : 0), e && 3 > e && (t = Math.round(100 * t) + "%"), t }); return 1 === i[3] && (i.pop(), e = "hsl("), e + i.join() + ")" }, toHexString: function (e) { var i = this._rgba.slice(), s = i.pop(); return e && i.push(~~(255 * s)), "#" + t.map(i, function (t) { return t = (t || 0).toString(16), 1 === t.length ? "0" + t : t }).join("") }, toString: function () { return 0 === this._rgba[3] ? "transparent" : this.toRgbaString() } }), h.fn.parse.prototype = h.fn, c.hsla.to = function (t) { if (null == t[0] || null == t[1] || null == t[2]) return [null, null, null, t[3]]; var e, i, s = t[0] / 255, n = t[1] / 255, a = t[2] / 255, o = t[3], r = Math.max(s, n, a), l = Math.min(s, n, a), h = r - l, c = r + l, u = .5 * c; return e = l === r ? 0 : s === r ? 60 * (n - a) / h + 360 : n === r ? 60 * (a - s) / h + 120 : 60 * (s - n) / h + 240, i = 0 === h ? 0 : .5 >= u ? h / c : h / (2 - c), [Math.round(e) % 360, i, u, null == o ? 1 : o] }, c.hsla.from = function (t) { if (null == t[0] || null == t[1] || null == t[2]) return [null, null, null, t[3]]; var e = t[0] / 360, i = t[1], s = t[2], a = t[3], o = .5 >= s ? s * (1 + i) : s + i - s * i, r = 2 * s - o; return [Math.round(255 * n(r, o, e + 1 / 3)), Math.round(255 * n(r, o, e)), Math.round(255 * n(r, o, e - 1 / 3)), a] }, f(c, function (s, n) { var a = n.props, o = n.cache, l = n.to, c = n.from; h.fn[s] = function (s) { if (l && !this[o] && (this[o] = l(this._rgba)), s === e) return this[o].slice(); var n, r = t.type(s), u = "array" === r || "object" === r ? s : arguments, d = this[o].slice(); return f(a, function (t, e) { var s = u["object" === r ? t : e.idx]; null == s && (s = d[e.idx]), d[e.idx] = i(s, e) }), c ? (n = h(c(d)), n[o] = d, n) : h(d) }, f(a, function (e, i) { h.fn[e] || (h.fn[e] = function (n) { var a, o = t.type(n), l = "alpha" === e ? this._hsla ? "hsla" : "rgba" : s, h = this[l](), c = h[i.idx]; return "undefined" === o ? c : ("function" === o && (n = n.call(this, c), o = t.type(n)), null == n && i.empty ? this : ("string" === o && (a = r.exec(n), a && (n = c + parseFloat(a[2]) * ("+" === a[1] ? 1 : -1))), h[i.idx] = n, this[l](h))) }) }) }), h.hook = function (e) { var i = e.split(" "); f(i, function (e, i) { t.cssHooks[i] = { set: function (e, n) { var a, o, r = ""; if ("transparent" !== n && ("string" !== t.type(n) || (a = s(n)))) { if (n = h(a || n), !d.rgba && 1 !== n._rgba[3]) { for (o = "backgroundColor" === i ? e.parentNode : e; ("" === r || "transparent" === r) && o && o.style;) try { r = t.css(o, "backgroundColor"), o = o.parentNode } catch (l) { } n = n.blend(r && "transparent" !== r ? r : "_default") } n = n.toRgbaString() } try { e.style[i] = n } catch (l) { } } }, t.fx.step[i] = function (e) { e.colorInit || (e.start = h(e.elem, i), e.end = h(e.end), e.colorInit = !0), t.cssHooks[i].set(e.elem, e.start.transition(e.end, e.pos)) } }) }, h.hook(o), t.cssHooks.borderColor = { expand: function (t) { var e = {}; return f(["Top", "Right", "Bottom", "Left"], function (i, s) { e["border" + s + "Color"] = t }), e } }, a = t.Color.names = { aqua: "#00ffff", black: "#000000", blue: "#0000ff", fuchsia: "#ff00ff", gray: "#808080", green: "#008000", lime: "#00ff00", maroon: "#800000", navy: "#000080", olive: "#808000", purple: "#800080", red: "#ff0000", silver: "#c0c0c0", teal: "#008080", white: "#ffffff", yellow: "#ffff00", transparent: [null, null, null, 0], _default: "#ffffff" } }(jQuery), function () { function i(e) { var i, s, n = e.ownerDocument.defaultView ? e.ownerDocument.defaultView.getComputedStyle(e, null) : e.currentStyle, a = {}; if (n && n.length && n[0] && n[n[0]]) for (s = n.length; s--;) i = n[s], "string" == typeof n[i] && (a[t.camelCase(i)] = n[i]); else for (i in n) "string" == typeof n[i] && (a[i] = n[i]); return a } function s(e, i) { var s, n, o = {}; for (s in i) n = i[s], e[s] !== n && (a[s] || (t.fx.step[s] || !isNaN(parseFloat(n))) && (o[s] = n)); return o } var n = ["add", "remove", "toggle"], a = { border: 1, borderBottom: 1, borderColor: 1, borderLeft: 1, borderRight: 1, borderTop: 1, borderWidth: 1, margin: 1, padding: 1 }; t.each(["borderLeftStyle", "borderRightStyle", "borderBottomStyle", "borderTopStyle"], function (e, i) { t.fx.step[i] = function (t) { ("none" !== t.end && !t.setAttr || 1 === t.pos && !t.setAttr) && (jQuery.style(t.elem, i, t.end), t.setAttr = !0) } }), t.fn.addBack || (t.fn.addBack = function (t) { return this.add(null == t ? this.prevObject : this.prevObject.filter(t)) }), t.effects.animateClass = function (e, a, o, r) { var l = t.speed(a, o, r); return this.queue(function () { var a, o = t(this), r = o.attr("class") || "", h = l.children ? o.find("*").addBack() : o; h = h.map(function () { var e = t(this); return { el: e, start: i(this) } }), a = function () { t.each(n, function (t, i) { e[i] && o[i + "Class"](e[i]) }) }, a(), h = h.map(function () { return this.end = i(this.el[0]), this.diff = s(this.start, this.end), this }), o.attr("class", r), h = h.map(function () { var e = this, i = t.Deferred(), s = t.extend({}, l, { queue: !1, complete: function () { i.resolve(e) } }); return this.el.animate(this.diff, s), i.promise() }), t.when.apply(t, h.get()).done(function () { a(), t.each(arguments, function () { var e = this.el; t.each(this.diff, function (t) { e.css(t, "") }) }), l.complete.call(o[0]) }) }) }, t.fn.extend({ addClass: function (e) { return function (i, s, n, a) { return s ? t.effects.animateClass.call(this, { add: i }, s, n, a) : e.apply(this, arguments) } }(t.fn.addClass), removeClass: function (e) { return function (i, s, n, a) { return arguments.length > 1 ? t.effects.animateClass.call(this, { remove: i }, s, n, a) : e.apply(this, arguments) } }(t.fn.removeClass), toggleClass: function (i) { return function (s, n, a, o, r) { return "boolean" == typeof n || n === e ? a ? t.effects.animateClass.call(this, n ? { add: s } : { remove: s }, a, o, r) : i.apply(this, arguments) : t.effects.animateClass.call(this, { toggle: s }, n, a, o) } }(t.fn.toggleClass), switchClass: function (e, i, s, n, a) { return t.effects.animateClass.call(this, { add: i, remove: e }, s, n, a) } }) }(), function () { function s(e, i, s, n) { return t.isPlainObject(e) && (i = e, e = e.effect), e = { effect: e }, null == i && (i = {}), t.isFunction(i) && (n = i, s = null, i = {}), ("number" == typeof i || t.fx.speeds[i]) && (n = s, s = i, i = {}), t.isFunction(s) && (n = s, s = null), i && t.extend(e, i), s = s || i.duration, e.duration = t.fx.off ? 0 : "number" == typeof s ? s : s in t.fx.speeds ? t.fx.speeds[s] : t.fx.speeds._default, e.complete = n || i.complete, e } function n(e) { return !e || "number" == typeof e || t.fx.speeds[e] ? !0 : "string" != typeof e || t.effects.effect[e] ? t.isFunction(e) ? !0 : "object" != typeof e || e.effect ? !1 : !0 : !0 } t.extend(t.effects, { version: "1.10.4", save: function (t, e) { for (var s = 0; e.length > s; s++) null !== e[s] && t.data(i + e[s], t[0].style[e[s]]) }, restore: function (t, s) { var n, a; for (a = 0; s.length > a; a++) null !== s[a] && (n = t.data(i + s[a]), n === e && (n = ""), t.css(s[a], n)) }, setMode: function (t, e) { return "toggle" === e && (e = t.is(":hidden") ? "show" : "hide"), e }, getBaseline: function (t, e) { var i, s; switch (t[0]) { case "top": i = 0; break; case "middle": i = .5; break; case "bottom": i = 1; break; default: i = t[0] / e.height } switch (t[1]) { case "left": s = 0; break; case "center": s = .5; break; case "right": s = 1; break; default: s = t[1] / e.width } return { x: s, y: i } }, createWrapper: function (e) { if (e.parent().is(".ui-effects-wrapper")) return e.parent(); var i = { width: e.outerWidth(!0), height: e.outerHeight(!0), "float": e.css("float") }, s = t("<div></div>").addClass("ui-effects-wrapper").css({ fontSize: "100%", background: "transparent", border: "none", margin: 0, padding: 0 }), n = { width: e.width(), height: e.height() }, a = document.activeElement; try { a.id } catch (o) { a = document.body } return e.wrap(s), (e[0] === a || t.contains(e[0], a)) && t(a).focus(), s = e.parent(), "static" === e.css("position") ? (s.css({ position: "relative" }), e.css({ position: "relative" })) : (t.extend(i, { position: e.css("position"), zIndex: e.css("z-index") }), t.each(["top", "left", "bottom", "right"], function (t, s) { i[s] = e.css(s), isNaN(parseInt(i[s], 10)) && (i[s] = "auto") }), e.css({ position: "relative", top: 0, left: 0, right: "auto", bottom: "auto" })), e.css(n), s.css(i).show() }, removeWrapper: function (e) { var i = document.activeElement; return e.parent().is(".ui-effects-wrapper") && (e.parent().replaceWith(e), (e[0] === i || t.contains(e[0], i)) && t(i).focus()), e }, setTransition: function (e, i, s, n) { return n = n || {}, t.each(i, function (t, i) { var a = e.cssUnit(i); a[0] > 0 && (n[i] = a[0] * s + a[1]) }), n } }), t.fn.extend({ effect: function () { function e(e) { function s() { t.isFunction(a) && a.call(n[0]), t.isFunction(e) && e() } var n = t(this), a = i.complete, r = i.mode; (n.is(":hidden") ? "hide" === r : "show" === r) ? (n[r](), s()) : o.call(n[0], i, s) } var i = s.apply(this, arguments), n = i.mode, a = i.queue, o = t.effects.effect[i.effect]; return t.fx.off || !o ? n ? this[n](i.duration, i.complete) : this.each(function () { i.complete && i.complete.call(this) }) : a === !1 ? this.each(e) : this.queue(a || "fx", e) }, show: function (t) { return function (e) { if (n(e)) return t.apply(this, arguments); var i = s.apply(this, arguments); return i.mode = "show", this.effect.call(this, i) } }(t.fn.show), hide: function (t) { return function (e) { if (n(e)) return t.apply(this, arguments); var i = s.apply(this, arguments); return i.mode = "hide", this.effect.call(this, i) } }(t.fn.hide), toggle: function (t) { return function (e) { if (n(e) || "boolean" == typeof e) return t.apply(this, arguments); var i = s.apply(this, arguments); return i.mode = "toggle", this.effect.call(this, i) } }(t.fn.toggle), cssUnit: function (e) { var i = this.css(e), s = []; return t.each(["em", "px", "%", "pt"], function (t, e) { i.indexOf(e) > 0 && (s = [parseFloat(i), e]) }), s } }) }(), function () { var e = {}; t.each(["Quad", "Cubic", "Quart", "Quint", "Expo"], function (t, i) { e[i] = function (e) { return Math.pow(e, t + 2) } }), t.extend(e, { Sine: function (t) { return 1 - Math.cos(t * Math.PI / 2) }, Circ: function (t) { return 1 - Math.sqrt(1 - t * t) }, Elastic: function (t) { return 0 === t || 1 === t ? t : -Math.pow(2, 8 * (t - 1)) * Math.sin((80 * (t - 1) - 7.5) * Math.PI / 15) }, Back: function (t) { return t * t * (3 * t - 2) }, Bounce: function (t) { for (var e, i = 4; ((e = Math.pow(2, --i)) - 1) / 11 > t;); return 1 / Math.pow(4, 3 - i) - 7.5625 * Math.pow((3 * e - 2) / 22 - t, 2) } }), t.each(e, function (e, i) { t.easing["easeIn" + e] = i, t.easing["easeOut" + e] = function (t) { return 1 - i(1 - t) }, t.easing["easeInOut" + e] = function (t) { return .5 > t ? i(2 * t) / 2 : 1 - i(-2 * t + 2) / 2 } }) }() })(jQuery); (function (t) { var e = /up|down|vertical/, i = /up|left|vertical|horizontal/; t.effects.effect.blind = function (s, n) { var a, o, r, l = t(this), h = ["position", "top", "bottom", "left", "right", "height", "width"], c = t.effects.setMode(l, s.mode || "hide"), u = s.direction || "up", d = e.test(u), p = d ? "height" : "width", f = d ? "top" : "left", g = i.test(u), m = {}, v = "show" === c; l.parent().is(".ui-effects-wrapper") ? t.effects.save(l.parent(), h) : t.effects.save(l, h), l.show(), a = t.effects.createWrapper(l).css({ overflow: "hidden" }), o = a[p](), r = parseFloat(a.css(f)) || 0, m[p] = v ? o : 0, g || (l.css(d ? "bottom" : "right", 0).css(d ? "top" : "left", "auto").css({ position: "absolute" }), m[f] = v ? r : o + r), v && (a.css(p, 0), g || a.css(f, r + o)), a.animate(m, { duration: s.duration, easing: s.easing, queue: !1, complete: function () { "hide" === c && l.hide(), t.effects.restore(l, h), t.effects.removeWrapper(l), n() } }) } })(jQuery); (function (t) { t.effects.effect.bounce = function (e, i) { var s, n, a, o = t(this), r = ["position", "top", "bottom", "left", "right", "height", "width"], l = t.effects.setMode(o, e.mode || "effect"), h = "hide" === l, c = "show" === l, u = e.direction || "up", d = e.distance, p = e.times || 5, f = 2 * p + (c || h ? 1 : 0), g = e.duration / f, m = e.easing, v = "up" === u || "down" === u ? "top" : "left", _ = "up" === u || "left" === u, b = o.queue(), y = b.length; for ((c || h) && r.push("opacity"), t.effects.save(o, r), o.show(), t.effects.createWrapper(o), d || (d = o["top" === v ? "outerHeight" : "outerWidth"]() / 3), c && (a = { opacity: 1 }, a[v] = 0, o.css("opacity", 0).css(v, _ ? 2 * -d : 2 * d).animate(a, g, m)), h && (d /= Math.pow(2, p - 1)), a = {}, a[v] = 0, s = 0; p > s; s++) n = {}, n[v] = (_ ? "-=" : "+=") + d, o.animate(n, g, m).animate(a, g, m), d = h ? 2 * d : d / 2; h && (n = { opacity: 0 }, n[v] = (_ ? "-=" : "+=") + d, o.animate(n, g, m)), o.queue(function () { h && o.hide(), t.effects.restore(o, r), t.effects.removeWrapper(o), i() }), y > 1 && b.splice.apply(b, [1, 0].concat(b.splice(y, f + 1))), o.dequeue() } })(jQuery); (function (t) { t.effects.effect.clip = function (e, i) { var s, n, a, o = t(this), r = ["position", "top", "bottom", "left", "right", "height", "width"], l = t.effects.setMode(o, e.mode || "hide"), h = "show" === l, c = e.direction || "vertical", u = "vertical" === c, d = u ? "height" : "width", p = u ? "top" : "left", f = {}; t.effects.save(o, r), o.show(), s = t.effects.createWrapper(o).css({ overflow: "hidden" }), n = "IMG" === o[0].tagName ? s : o, a = n[d](), h && (n.css(d, 0), n.css(p, a / 2)), f[d] = h ? a : 0, f[p] = h ? 0 : a / 2, n.animate(f, { queue: !1, duration: e.duration, easing: e.easing, complete: function () { h || o.hide(), t.effects.restore(o, r), t.effects.removeWrapper(o), i() } }) } })(jQuery); (function (t) { t.effects.effect.drop = function (e, i) { var s, n = t(this), a = ["position", "top", "bottom", "left", "right", "opacity", "height", "width"], o = t.effects.setMode(n, e.mode || "hide"), r = "show" === o, l = e.direction || "left", h = "up" === l || "down" === l ? "top" : "left", c = "up" === l || "left" === l ? "pos" : "neg", u = { opacity: r ? 1 : 0 }; t.effects.save(n, a), n.show(), t.effects.createWrapper(n), s = e.distance || n["top" === h ? "outerHeight" : "outerWidth"](!0) / 2, r && n.css("opacity", 0).css(h, "pos" === c ? -s : s), u[h] = (r ? "pos" === c ? "+=" : "-=" : "pos" === c ? "-=" : "+=") + s, n.animate(u, { queue: !1, duration: e.duration, easing: e.easing, complete: function () { "hide" === o && n.hide(), t.effects.restore(n, a), t.effects.removeWrapper(n), i() } }) } })(jQuery); (function (t) { t.effects.effect.explode = function (e, i) { function s() { b.push(this), b.length === u * d && n() } function n() { p.css({ visibility: "visible" }), t(b).remove(), g || p.hide(), i() } var a, o, r, l, h, c, u = e.pieces ? Math.round(Math.sqrt(e.pieces)) : 3, d = u, p = t(this), f = t.effects.setMode(p, e.mode || "hide"), g = "show" === f, m = p.show().css("visibility", "hidden").offset(), v = Math.ceil(p.outerWidth() / d), _ = Math.ceil(p.outerHeight() / u), b = []; for (a = 0; u > a; a++) for (l = m.top + a * _, c = a - (u - 1) / 2, o = 0; d > o; o++) r = m.left + o * v, h = o - (d - 1) / 2, p.clone().appendTo("body").wrap("<div></div>").css({ position: "absolute", visibility: "visible", left: -o * v, top: -a * _ }).parent().addClass("ui-effects-explode").css({ position: "absolute", overflow: "hidden", width: v, height: _, left: r + (g ? h * v : 0), top: l + (g ? c * _ : 0), opacity: g ? 0 : 1 }).animate({ left: r + (g ? 0 : h * v), top: l + (g ? 0 : c * _), opacity: g ? 1 : 0 }, e.duration || 500, e.easing, s) } })(jQuery); (function (t) { t.effects.effect.fade = function (e, i) { var s = t(this), n = t.effects.setMode(s, e.mode || "toggle"); s.animate({ opacity: n }, { queue: !1, duration: e.duration, easing: e.easing, complete: i }) } })(jQuery); (function (t) { t.effects.effect.fold = function (e, i) { var s, n, a = t(this), o = ["position", "top", "bottom", "left", "right", "height", "width"], r = t.effects.setMode(a, e.mode || "hide"), l = "show" === r, h = "hide" === r, c = e.size || 15, u = /([0-9]+)%/.exec(c), d = !!e.horizFirst, p = l !== d, f = p ? ["width", "height"] : ["height", "width"], g = e.duration / 2, m = {}, v = {}; t.effects.save(a, o), a.show(), s = t.effects.createWrapper(a).css({ overflow: "hidden" }), n = p ? [s.width(), s.height()] : [s.height(), s.width()], u && (c = parseInt(u[1], 10) / 100 * n[h ? 0 : 1]), l && s.css(d ? { height: 0, width: c } : { height: c, width: 0 }), m[f[0]] = l ? n[0] : c, v[f[1]] = l ? n[1] : 0, s.animate(m, g, e.easing).animate(v, g, e.easing, function () { h && a.hide(), t.effects.restore(a, o), t.effects.removeWrapper(a), i() }) } })(jQuery); (function (t) { t.effects.effect.highlight = function (e, i) { var s = t(this), n = ["backgroundImage", "backgroundColor", "opacity"], a = t.effects.setMode(s, e.mode || "show"), o = { backgroundColor: s.css("backgroundColor") }; "hide" === a && (o.opacity = 0), t.effects.save(s, n), s.show().css({ backgroundImage: "none", backgroundColor: e.color || "#ffff99" }).animate(o, { queue: !1, duration: e.duration, easing: e.easing, complete: function () { "hide" === a && s.hide(), t.effects.restore(s, n), i() } }) } })(jQuery); (function (t) { t.effects.effect.pulsate = function (e, i) { var s, n = t(this), a = t.effects.setMode(n, e.mode || "show"), o = "show" === a, r = "hide" === a, l = o || "hide" === a, h = 2 * (e.times || 5) + (l ? 1 : 0), c = e.duration / h, u = 0, d = n.queue(), p = d.length; for ((o || !n.is(":visible")) && (n.css("opacity", 0).show(), u = 1), s = 1; h > s; s++) n.animate({ opacity: u }, c, e.easing), u = 1 - u; n.animate({ opacity: u }, c, e.easing), n.queue(function () { r && n.hide(), i() }), p > 1 && d.splice.apply(d, [1, 0].concat(d.splice(p, h + 1))), n.dequeue() } })(jQuery); (function (t) { t.effects.effect.puff = function (e, i) { var s = t(this), n = t.effects.setMode(s, e.mode || "hide"), a = "hide" === n, o = parseInt(e.percent, 10) || 150, r = o / 100, l = { height: s.height(), width: s.width(), outerHeight: s.outerHeight(), outerWidth: s.outerWidth() }; t.extend(e, { effect: "scale", queue: !1, fade: !0, mode: n, complete: i, percent: a ? o : 100, from: a ? l : { height: l.height * r, width: l.width * r, outerHeight: l.outerHeight * r, outerWidth: l.outerWidth * r } }), s.effect(e) }, t.effects.effect.scale = function (e, i) { var s = t(this), n = t.extend(!0, {}, e), a = t.effects.setMode(s, e.mode || "effect"), o = parseInt(e.percent, 10) || (0 === parseInt(e.percent, 10) ? 0 : "hide" === a ? 0 : 100), r = e.direction || "both", l = e.origin, h = { height: s.height(), width: s.width(), outerHeight: s.outerHeight(), outerWidth: s.outerWidth() }, c = { y: "horizontal" !== r ? o / 100 : 1, x: "vertical" !== r ? o / 100 : 1 }; n.effect = "size", n.queue = !1, n.complete = i, "effect" !== a && (n.origin = l || ["middle", "center"], n.restore = !0), n.from = e.from || ("show" === a ? { height: 0, width: 0, outerHeight: 0, outerWidth: 0 } : h), n.to = { height: h.height * c.y, width: h.width * c.x, outerHeight: h.outerHeight * c.y, outerWidth: h.outerWidth * c.x }, n.fade && ("show" === a && (n.from.opacity = 0, n.to.opacity = 1), "hide" === a && (n.from.opacity = 1, n.to.opacity = 0)), s.effect(n) }, t.effects.effect.size = function (e, i) { var s, n, a, o = t(this), r = ["position", "top", "bottom", "left", "right", "width", "height", "overflow", "opacity"], l = ["position", "top", "bottom", "left", "right", "overflow", "opacity"], h = ["width", "height", "overflow"], c = ["fontSize"], u = ["borderTopWidth", "borderBottomWidth", "paddingTop", "paddingBottom"], d = ["borderLeftWidth", "borderRightWidth", "paddingLeft", "paddingRight"], p = t.effects.setMode(o, e.mode || "effect"), f = e.restore || "effect" !== p, g = e.scale || "both", m = e.origin || ["middle", "center"], v = o.css("position"), _ = f ? r : l, b = { height: 0, width: 0, outerHeight: 0, outerWidth: 0 }; "show" === p && o.show(), s = { height: o.height(), width: o.width(), outerHeight: o.outerHeight(), outerWidth: o.outerWidth() }, "toggle" === e.mode && "show" === p ? (o.from = e.to || b, o.to = e.from || s) : (o.from = e.from || ("show" === p ? b : s), o.to = e.to || ("hide" === p ? b : s)), a = { from: { y: o.from.height / s.height, x: o.from.width / s.width }, to: { y: o.to.height / s.height, x: o.to.width / s.width } }, ("box" === g || "both" === g) && (a.from.y !== a.to.y && (_ = _.concat(u), o.from = t.effects.setTransition(o, u, a.from.y, o.from), o.to = t.effects.setTransition(o, u, a.to.y, o.to)), a.from.x !== a.to.x && (_ = _.concat(d), o.from = t.effects.setTransition(o, d, a.from.x, o.from), o.to = t.effects.setTransition(o, d, a.to.x, o.to))), ("content" === g || "both" === g) && a.from.y !== a.to.y && (_ = _.concat(c).concat(h), o.from = t.effects.setTransition(o, c, a.from.y, o.from), o.to = t.effects.setTransition(o, c, a.to.y, o.to)), t.effects.save(o, _), o.show(), t.effects.createWrapper(o), o.css("overflow", "hidden").css(o.from), m && (n = t.effects.getBaseline(m, s), o.from.top = (s.outerHeight - o.outerHeight()) * n.y, o.from.left = (s.outerWidth - o.outerWidth()) * n.x, o.to.top = (s.outerHeight - o.to.outerHeight) * n.y, o.to.left = (s.outerWidth - o.to.outerWidth) * n.x), o.css(o.from), ("content" === g || "both" === g) && (u = u.concat(["marginTop", "marginBottom"]).concat(c), d = d.concat(["marginLeft", "marginRight"]), h = r.concat(u).concat(d), o.find("*[width]").each(function () { var i = t(this), s = { height: i.height(), width: i.width(), outerHeight: i.outerHeight(), outerWidth: i.outerWidth() }; f && t.effects.save(i, h), i.from = { height: s.height * a.from.y, width: s.width * a.from.x, outerHeight: s.outerHeight * a.from.y, outerWidth: s.outerWidth * a.from.x }, i.to = { height: s.height * a.to.y, width: s.width * a.to.x, outerHeight: s.height * a.to.y, outerWidth: s.width * a.to.x }, a.from.y !== a.to.y && (i.from = t.effects.setTransition(i, u, a.from.y, i.from), i.to = t.effects.setTransition(i, u, a.to.y, i.to)), a.from.x !== a.to.x && (i.from = t.effects.setTransition(i, d, a.from.x, i.from), i.to = t.effects.setTransition(i, d, a.to.x, i.to)), i.css(i.from), i.animate(i.to, e.duration, e.easing, function () { f && t.effects.restore(i, h) }) })), o.animate(o.to, { queue: !1, duration: e.duration, easing: e.easing, complete: function () { 0 === o.to.opacity && o.css("opacity", o.from.opacity), "hide" === p && o.hide(), t.effects.restore(o, _), f || ("static" === v ? o.css({ position: "relative", top: o.to.top, left: o.to.left }) : t.each(["top", "left"], function (t, e) { o.css(e, function (e, i) { var s = parseInt(i, 10), n = t ? o.to.left : o.to.top; return "auto" === i ? n + "px" : s + n + "px" }) })), t.effects.removeWrapper(o), i() } }) } })(jQuery); (function (t) { t.effects.effect.shake = function (e, i) { var s, n = t(this), a = ["position", "top", "bottom", "left", "right", "height", "width"], o = t.effects.setMode(n, e.mode || "effect"), r = e.direction || "left", l = e.distance || 20, h = e.times || 3, c = 2 * h + 1, u = Math.round(e.duration / c), d = "up" === r || "down" === r ? "top" : "left", p = "up" === r || "left" === r, f = {}, g = {}, m = {}, v = n.queue(), _ = v.length; for (t.effects.save(n, a), n.show(), t.effects.createWrapper(n), f[d] = (p ? "-=" : "+=") + l, g[d] = (p ? "+=" : "-=") + 2 * l, m[d] = (p ? "-=" : "+=") + 2 * l, n.animate(f, u, e.easing), s = 1; h > s; s++) n.animate(g, u, e.easing).animate(m, u, e.easing); n.animate(g, u, e.easing).animate(f, u / 2, e.easing).queue(function () { "hide" === o && n.hide(), t.effects.restore(n, a), t.effects.removeWrapper(n), i() }), _ > 1 && v.splice.apply(v, [1, 0].concat(v.splice(_, c + 1))), n.dequeue() } })(jQuery); (function (t) { t.effects.effect.slide = function (e, i) { var s, n = t(this), a = ["position", "top", "bottom", "left", "right", "width", "height"], o = t.effects.setMode(n, e.mode || "show"), r = "show" === o, l = e.direction || "left", h = "up" === l || "down" === l ? "top" : "left", c = "up" === l || "left" === l, u = {}; t.effects.save(n, a), n.show(), s = e.distance || n["top" === h ? "outerHeight" : "outerWidth"](!0), t.effects.createWrapper(n).css({ overflow: "hidden" }), r && n.css(h, c ? isNaN(s) ? "-" + s : -s : s), u[h] = (r ? c ? "+=" : "-=" : c ? "-=" : "+=") + s, n.animate(u, { queue: !1, duration: e.duration, easing: e.easing, complete: function () { "hide" === o && n.hide(), t.effects.restore(n, a), t.effects.removeWrapper(n), i() } }) } })(jQuery); (function (t) { t.effects.effect.transfer = function (e, i) { var s = t(this), n = t(e.to), a = "fixed" === n.css("position"), o = t("body"), r = a ? o.scrollTop() : 0, l = a ? o.scrollLeft() : 0, h = n.offset(), c = { top: h.top - r, left: h.left - l, height: n.innerHeight(), width: n.innerWidth() }, u = s.offset(), d = t("<div class='ui-effects-transfer'></div>").appendTo(document.body).addClass(e.className).css({ top: u.top - r, left: u.left - l, height: s.innerHeight(), width: s.innerWidth(), position: a ? "fixed" : "absolute" }).animate(c, e.duration, e.easing, function () { d.remove(), i() }) } })(jQuery); (function (t) { t.widget("ui.menu", { version: "1.10.4", defaultElement: "<ul>", delay: 300, options: { icons: { submenu: "ui-icon-carat-1-e" }, menus: "ul", position: { my: "left top", at: "right top" }, role: "menu", blur: null, focus: null, select: null }, _create: function () { this.activeMenu = this.element, this.mouseHandled = !1, this.element.uniqueId().addClass("ui-menu ui-widget ui-widget-content ui-corner-all").toggleClass("ui-menu-icons", !!this.element.find(".ui-icon").length).attr({ role: this.options.role, tabIndex: 0 }).bind("click" + this.eventNamespace, t.proxy(function (t) { this.options.disabled && t.preventDefault() }, this)), this.options.disabled && this.element.addClass("ui-state-disabled").attr("aria-disabled", "true"), this._on({ "mousedown .ui-menu-item > a": function (t) { t.preventDefault() }, "click .ui-state-disabled > a": function (t) { t.preventDefault() }, "click .ui-menu-item:has(a)": function (e) { var i = t(e.target).closest(".ui-menu-item"); !this.mouseHandled && i.not(".ui-state-disabled").length && (this.select(e), e.isPropagationStopped() || (this.mouseHandled = !0), i.has(".ui-menu").length ? this.expand(e) : !this.element.is(":focus") && t(this.document[0].activeElement).closest(".ui-menu").length && (this.element.trigger("focus", [!0]), this.active && 1 === this.active.parents(".ui-menu").length && clearTimeout(this.timer))) }, "mouseenter .ui-menu-item": function (e) { var i = t(e.currentTarget); i.siblings().children(".ui-state-active").removeClass("ui-state-active"), this.focus(e, i) }, mouseleave: "collapseAll", "mouseleave .ui-menu": "collapseAll", focus: function (t, e) { var i = this.active || this.element.children(".ui-menu-item").eq(0); e || this.focus(t, i) }, blur: function (e) { this._delay(function () { t.contains(this.element[0], this.document[0].activeElement) || this.collapseAll(e) }) }, keydown: "_keydown" }), this.refresh(), this._on(this.document, { click: function (e) { t(e.target).closest(".ui-menu").length || this.collapseAll(e), this.mouseHandled = !1 } }) }, _destroy: function () { this.element.removeAttr("aria-activedescendant").find(".ui-menu").addBack().removeClass("ui-menu ui-widget ui-widget-content ui-corner-all ui-menu-icons").removeAttr("role").removeAttr("tabIndex").removeAttr("aria-labelledby").removeAttr("aria-expanded").removeAttr("aria-hidden").removeAttr("aria-disabled").removeUniqueId().show(), this.element.find(".ui-menu-item").removeClass("ui-menu-item").removeAttr("role").removeAttr("aria-disabled").children("a").removeUniqueId().removeClass("ui-corner-all ui-state-hover").removeAttr("tabIndex").removeAttr("role").removeAttr("aria-haspopup").children().each(function () { var e = t(this); e.data("ui-menu-submenu-carat") && e.remove() }), this.element.find(".ui-menu-divider").removeClass("ui-menu-divider ui-widget-content") }, _keydown: function (e) { function i(t) { return t.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g, "\\$&") } var s, n, a, o, r, l = !0; switch (e.keyCode) { case t.ui.keyCode.PAGE_UP: this.previousPage(e); break; case t.ui.keyCode.PAGE_DOWN: this.nextPage(e); break; case t.ui.keyCode.HOME: this._move("first", "first", e); break; case t.ui.keyCode.END: this._move("last", "last", e); break; case t.ui.keyCode.UP: this.previous(e); break; case t.ui.keyCode.DOWN: this.next(e); break; case t.ui.keyCode.LEFT: this.collapse(e); break; case t.ui.keyCode.RIGHT: this.active && !this.active.is(".ui-state-disabled") && this.expand(e); break; case t.ui.keyCode.ENTER: case t.ui.keyCode.SPACE: this._activate(e); break; case t.ui.keyCode.ESCAPE: this.collapse(e); break; default: l = !1, n = this.previousFilter || "", a = String.fromCharCode(e.keyCode), o = !1, clearTimeout(this.filterTimer), a === n ? o = !0 : a = n + a, r = RegExp("^" + i(a), "i"), s = this.activeMenu.children(".ui-menu-item").filter(function () { return r.test(t(this).children("a").text()) }), s = o && -1 !== s.index(this.active.next()) ? this.active.nextAll(".ui-menu-item") : s, s.length || (a = String.fromCharCode(e.keyCode), r = RegExp("^" + i(a), "i"), s = this.activeMenu.children(".ui-menu-item").filter(function () { return r.test(t(this).children("a").text()) })), s.length ? (this.focus(e, s), s.length > 1 ? (this.previousFilter = a, this.filterTimer = this._delay(function () { delete this.previousFilter }, 1e3)) : delete this.previousFilter) : delete this.previousFilter } l && e.preventDefault() }, _activate: function (t) { this.active.is(".ui-state-disabled") || (this.active.children("a[aria-haspopup='true']").length ? this.expand(t) : this.select(t)) }, refresh: function () { var e, i = this.options.icons.submenu, s = this.element.find(this.options.menus); this.element.toggleClass("ui-menu-icons", !!this.element.find(".ui-icon").length), s.filter(":not(.ui-menu)").addClass("ui-menu ui-widget ui-widget-content ui-corner-all").hide().attr({ role: this.options.role, "aria-hidden": "true", "aria-expanded": "false" }).each(function () { var e = t(this), s = e.prev("a"), n = t("<span>").addClass("ui-menu-icon ui-icon " + i).data("ui-menu-submenu-carat", !0); s.attr("aria-haspopup", "true").prepend(n), e.attr("aria-labelledby", s.attr("id")) }), e = s.add(this.element), e.children(":not(.ui-menu-item):has(a)").addClass("ui-menu-item").attr("role", "presentation").children("a").uniqueId().addClass("ui-corner-all").attr({ tabIndex: -1, role: this._itemRole() }), e.children(":not(.ui-menu-item)").each(function () { var e = t(this); /[^\-\u2014\u2013\s]/.test(e.text()) || e.addClass("ui-widget-content ui-menu-divider") }), e.children(".ui-state-disabled").attr("aria-disabled", "true"), this.active && !t.contains(this.element[0], this.active[0]) && this.blur() }, _itemRole: function () { return { menu: "menuitem", listbox: "option" }[this.options.role] }, _setOption: function (t, e) { "icons" === t && this.element.find(".ui-menu-icon").removeClass(this.options.icons.submenu).addClass(e.submenu), this._super(t, e) }, focus: function (t, e) { var i, s; this.blur(t, t && "focus" === t.type), this._scrollIntoView(e), this.active = e.first(), s = this.active.children("a").addClass("ui-state-focus"), this.options.role && this.element.attr("aria-activedescendant", s.attr("id")), this.active.parent().closest(".ui-menu-item").children("a:first").addClass("ui-state-active"), t && "keydown" === t.type ? this._close() : this.timer = this._delay(function () { this._close() }, this.delay), i = e.children(".ui-menu"), i.length && t && /^mouse/.test(t.type) && this._startOpening(i), this.activeMenu = e.parent(), this._trigger("focus", t, { item: e }) }, _scrollIntoView: function (e) { var i, s, n, a, o, r; this._hasScroll() && (i = parseFloat(t.css(this.activeMenu[0], "borderTopWidth")) || 0, s = parseFloat(t.css(this.activeMenu[0], "paddingTop")) || 0, n = e.offset().top - this.activeMenu.offset().top - i - s, a = this.activeMenu.scrollTop(), o = this.activeMenu.height(), r = e.height(), 0 > n ? this.activeMenu.scrollTop(a + n) : n + r > o && this.activeMenu.scrollTop(a + n - o + r)) }, blur: function (t, e) { e || clearTimeout(this.timer), this.active && (this.active.children("a").removeClass("ui-state-focus"), this.active = null, this._trigger("blur", t, { item: this.active })) }, _startOpening: function (t) { clearTimeout(this.timer), "true" === t.attr("aria-hidden") && (this.timer = this._delay(function () { this._close(), this._open(t) }, this.delay)) }, _open: function (e) { var i = t.extend({ of: this.active }, this.options.position); clearTimeout(this.timer), this.element.find(".ui-menu").not(e.parents(".ui-menu")).hide().attr("aria-hidden", "true"), e.show().removeAttr("aria-hidden").attr("aria-expanded", "true").position(i) }, collapseAll: function (e, i) { clearTimeout(this.timer), this.timer = this._delay(function () { var s = i ? this.element : t(e && e.target).closest(this.element.find(".ui-menu")); s.length || (s = this.element), this._close(s), this.blur(e), this.activeMenu = s }, this.delay) }, _close: function (t) { t || (t = this.active ? this.active.parent() : this.element), t.find(".ui-menu").hide().attr("aria-hidden", "true").attr("aria-expanded", "false").end().find("a.ui-state-active").removeClass("ui-state-active") }, collapse: function (t) { var e = this.active && this.active.parent().closest(".ui-menu-item", this.element); e && e.length && (this._close(), this.focus(t, e)) }, expand: function (t) { var e = this.active && this.active.children(".ui-menu ").children(".ui-menu-item").first(); e && e.length && (this._open(e.parent()), this._delay(function () { this.focus(t, e) })) }, next: function (t) { this._move("next", "first", t) }, previous: function (t) { this._move("prev", "last", t) }, isFirstItem: function () { return this.active && !this.active.prevAll(".ui-menu-item").length }, isLastItem: function () { return this.active && !this.active.nextAll(".ui-menu-item").length }, _move: function (t, e, i) { var s; this.active && (s = "first" === t || "last" === t ? this.active["first" === t ? "prevAll" : "nextAll"](".ui-menu-item").eq(-1) : this.active[t + "All"](".ui-menu-item").eq(0)), s && s.length && this.active || (s = this.activeMenu.children(".ui-menu-item")[e]()), this.focus(i, s) }, nextPage: function (e) { var i, s, n; return this.active ? (this.isLastItem() || (this._hasScroll() ? (s = this.active.offset().top, n = this.element.height(), this.active.nextAll(".ui-menu-item").each(function () { return i = t(this), 0 > i.offset().top - s - n }), this.focus(e, i)) : this.focus(e, this.activeMenu.children(".ui-menu-item")[this.active ? "last" : "first"]())), undefined) : (this.next(e), undefined) }, previousPage: function (e) { var i, s, n; return this.active ? (this.isFirstItem() || (this._hasScroll() ? (s = this.active.offset().top, n = this.element.height(), this.active.prevAll(".ui-menu-item").each(function () { return i = t(this), i.offset().top - s + n > 0 }), this.focus(e, i)) : this.focus(e, this.activeMenu.children(".ui-menu-item").first())), undefined) : (this.next(e), undefined) }, _hasScroll: function () { return this.element.outerHeight() < this.element.prop("scrollHeight") }, select: function (e) { this.active = this.active || t(e.target).closest(".ui-menu-item"); var i = { item: this.active }; this.active.has(".ui-menu").length || this.collapseAll(e, !0), this._trigger("select", e, i) } }) })(jQuery); (function (t, e) { t.widget("ui.progressbar", { version: "1.10.4", options: { max: 100, value: 0, change: null, complete: null }, min: 0, _create: function () { this.oldValue = this.options.value = this._constrainedValue(), this.element.addClass("ui-progressbar ui-widget ui-widget-content ui-corner-all").attr({ role: "progressbar", "aria-valuemin": this.min }), this.valueDiv = t("<div class='ui-progressbar-value ui-widget-header ui-corner-left'></div>").appendTo(this.element), this._refreshValue() }, _destroy: function () { this.element.removeClass("ui-progressbar ui-widget ui-widget-content ui-corner-all").removeAttr("role").removeAttr("aria-valuemin").removeAttr("aria-valuemax").removeAttr("aria-valuenow"), this.valueDiv.remove() }, value: function (t) { return t === e ? this.options.value : (this.options.value = this._constrainedValue(t), this._refreshValue(), e) }, _constrainedValue: function (t) { return t === e && (t = this.options.value), this.indeterminate = t === !1, "number" != typeof t && (t = 0), this.indeterminate ? !1 : Math.min(this.options.max, Math.max(this.min, t)) }, _setOptions: function (t) { var e = t.value; delete t.value, this._super(t), this.options.value = this._constrainedValue(e), this._refreshValue() }, _setOption: function (t, e) { "max" === t && (e = Math.max(this.min, e)), this._super(t, e) }, _percentage: function () { return this.indeterminate ? 100 : 100 * (this.options.value - this.min) / (this.options.max - this.min) }, _refreshValue: function () { var e = this.options.value, i = this._percentage(); this.valueDiv.toggle(this.indeterminate || e > this.min).toggleClass("ui-corner-right", e === this.options.max).width(i.toFixed(0) + "%"), this.element.toggleClass("ui-progressbar-indeterminate", this.indeterminate), this.indeterminate ? (this.element.removeAttr("aria-valuenow"), this.overlayDiv || (this.overlayDiv = t("<div class='ui-progressbar-overlay'></div>").appendTo(this.valueDiv))) : (this.element.attr({ "aria-valuemax": this.options.max, "aria-valuenow": e }), this.overlayDiv && (this.overlayDiv.remove(), this.overlayDiv = null)), this.oldValue !== e && (this.oldValue = e, this._trigger("change")), e === this.options.max && this._trigger("complete") } }) })(jQuery); (function (t) { function e(t) { return parseInt(t, 10) || 0 } function i(t) { return !isNaN(parseInt(t, 10)) } t.widget("ui.resizable", t.ui.mouse, { version: "1.10.4", widgetEventPrefix: "resize", options: { alsoResize: !1, animate: !1, animateDuration: "slow", animateEasing: "swing", aspectRatio: !1, autoHide: !1, containment: !1, ghost: !1, grid: !1, handles: "e,s,se", helper: !1, maxHeight: null, maxWidth: null, minHeight: 10, minWidth: 10, zIndex: 90, resize: null, start: null, stop: null }, _create: function () { var e, i, s, n, a, o = this, r = this.options; if (this.element.addClass("ui-resizable"), t.extend(this, { _aspectRatio: !!r.aspectRatio, aspectRatio: r.aspectRatio, originalElement: this.element, _proportionallyResizeElements: [], _helper: r.helper || r.ghost || r.animate ? r.helper || "ui-resizable-helper" : null }), this.element[0].nodeName.match(/canvas|textarea|input|select|button|img/i) && (this.element.wrap(t("<div class='ui-wrapper' style='overflow: hidden;'></div>").css({ position: this.element.css("position"), width: this.element.outerWidth(), height: this.element.outerHeight(), top: this.element.css("top"), left: this.element.css("left") })), this.element = this.element.parent().data("ui-resizable", this.element.data("ui-resizable")), this.elementIsWrapper = !0, this.element.css({ marginLeft: this.originalElement.css("marginLeft"), marginTop: this.originalElement.css("marginTop"), marginRight: this.originalElement.css("marginRight"), marginBottom: this.originalElement.css("marginBottom") }), this.originalElement.css({ marginLeft: 0, marginTop: 0, marginRight: 0, marginBottom: 0 }), this.originalResizeStyle = this.originalElement.css("resize"), this.originalElement.css("resize", "none"), this._proportionallyResizeElements.push(this.originalElement.css({ position: "static", zoom: 1, display: "block" })), this.originalElement.css({ margin: this.originalElement.css("margin") }), this._proportionallyResize()), this.handles = r.handles || (t(".ui-resizable-handle", this.element).length ? { n: ".ui-resizable-n", e: ".ui-resizable-e", s: ".ui-resizable-s", w: ".ui-resizable-w", se: ".ui-resizable-se", sw: ".ui-resizable-sw", ne: ".ui-resizable-ne", nw: ".ui-resizable-nw" } : "e,s,se"), this.handles.constructor === String) for ("all" === this.handles && (this.handles = "n,e,s,w,se,sw,ne,nw"), e = this.handles.split(","), this.handles = {}, i = 0; e.length > i; i++) s = t.trim(e[i]), a = "ui-resizable-" + s, n = t("<div class='ui-resizable-handle " + a + "'></div>"), n.css({ zIndex: r.zIndex }), "se" === s && n.addClass("ui-icon ui-icon-gripsmall-diagonal-se"), this.handles[s] = ".ui-resizable-" + s, this.element.append(n); this._renderAxis = function (e) { var i, s, n, a; e = e || this.element; for (i in this.handles) this.handles[i].constructor === String && (this.handles[i] = t(this.handles[i], this.element).show()), this.elementIsWrapper && this.originalElement[0].nodeName.match(/textarea|input|select|button/i) && (s = t(this.handles[i], this.element), a = /sw|ne|nw|se|n|s/.test(i) ? s.outerHeight() : s.outerWidth(), n = ["padding", /ne|nw|n/.test(i) ? "Top" : /se|sw|s/.test(i) ? "Bottom" : /^e$/.test(i) ? "Right" : "Left"].join(""), e.css(n, a), this._proportionallyResize()), t(this.handles[i]).length }, this._renderAxis(this.element), this._handles = t(".ui-resizable-handle", this.element).disableSelection(), this._handles.mouseover(function () { o.resizing || (this.className && (n = this.className.match(/ui-resizable-(se|sw|ne|nw|n|e|s|w)/i)), o.axis = n && n[1] ? n[1] : "se") }), r.autoHide && (this._handles.hide(), t(this.element).addClass("ui-resizable-autohide").mouseenter(function () { r.disabled || (t(this).removeClass("ui-resizable-autohide"), o._handles.show()) }).mouseleave(function () { r.disabled || o.resizing || (t(this).addClass("ui-resizable-autohide"), o._handles.hide()) })), this._mouseInit() }, _destroy: function () { this._mouseDestroy(); var e, i = function (e) { t(e).removeClass("ui-resizable ui-resizable-disabled ui-resizable-resizing").removeData("resizable").removeData("ui-resizable").unbind(".resizable").find(".ui-resizable-handle").remove() }; return this.elementIsWrapper && (i(this.element), e = this.element, this.originalElement.css({ position: e.css("position"), width: e.outerWidth(), height: e.outerHeight(), top: e.css("top"), left: e.css("left") }).insertAfter(e), e.remove()), this.originalElement.css("resize", this.originalResizeStyle), i(this.originalElement), this }, _mouseCapture: function (e) { var i, s, n = !1; for (i in this.handles) s = t(this.handles[i])[0], (s === e.target || t.contains(s, e.target)) && (n = !0); return !this.options.disabled && n }, _mouseStart: function (i) { var s, n, a, o = this.options, r = this.element.position(), h = this.element; return this.resizing = !0, /absolute/.test(h.css("position")) ? h.css({ position: "absolute", top: h.css("top"), left: h.css("left") }) : h.is(".ui-draggable") && h.css({ position: "absolute", top: r.top, left: r.left }), this._renderProxy(), s = e(this.helper.css("left")), n = e(this.helper.css("top")), o.containment && (s += t(o.containment).scrollLeft() || 0, n += t(o.containment).scrollTop() || 0), this.offset = this.helper.offset(), this.position = { left: s, top: n }, this.size = this._helper ? { width: this.helper.width(), height: this.helper.height() } : { width: h.width(), height: h.height() }, this.originalSize = this._helper ? { width: h.outerWidth(), height: h.outerHeight() } : { width: h.width(), height: h.height() }, this.originalPosition = { left: s, top: n }, this.sizeDiff = { width: h.outerWidth() - h.width(), height: h.outerHeight() - h.height() }, this.originalMousePosition = { left: i.pageX, top: i.pageY }, this.aspectRatio = "number" == typeof o.aspectRatio ? o.aspectRatio : this.originalSize.width / this.originalSize.height || 1, a = t(".ui-resizable-" + this.axis).css("cursor"), t("body").css("cursor", "auto" === a ? this.axis + "-resize" : a), h.addClass("ui-resizable-resizing"), this._propagate("start", i), !0 }, _mouseDrag: function (e) { var i, s = this.helper, n = {}, a = this.originalMousePosition, o = this.axis, r = this.position.top, h = this.position.left, l = this.size.width, c = this.size.height, u = e.pageX - a.left || 0, d = e.pageY - a.top || 0, p = this._change[o]; return p ? (i = p.apply(this, [e, u, d]), this._updateVirtualBoundaries(e.shiftKey), (this._aspectRatio || e.shiftKey) && (i = this._updateRatio(i, e)), i = this._respectSize(i, e), this._updateCache(i), this._propagate("resize", e), this.position.top !== r && (n.top = this.position.top + "px"), this.position.left !== h && (n.left = this.position.left + "px"), this.size.width !== l && (n.width = this.size.width + "px"), this.size.height !== c && (n.height = this.size.height + "px"), s.css(n), !this._helper && this._proportionallyResizeElements.length && this._proportionallyResize(), t.isEmptyObject(n) || this._trigger("resize", e, this.ui()), !1) : !1 }, _mouseStop: function (e) { this.resizing = !1; var i, s, n, a, o, r, h, l = this.options, c = this; return this._helper && (i = this._proportionallyResizeElements, s = i.length && /textarea/i.test(i[0].nodeName), n = s && t.ui.hasScroll(i[0], "left") ? 0 : c.sizeDiff.height, a = s ? 0 : c.sizeDiff.width, o = { width: c.helper.width() - a, height: c.helper.height() - n }, r = parseInt(c.element.css("left"), 10) + (c.position.left - c.originalPosition.left) || null, h = parseInt(c.element.css("top"), 10) + (c.position.top - c.originalPosition.top) || null, l.animate || this.element.css(t.extend(o, { top: h, left: r })), c.helper.height(c.size.height), c.helper.width(c.size.width), this._helper && !l.animate && this._proportionallyResize()), t("body").css("cursor", "auto"), this.element.removeClass("ui-resizable-resizing"), this._propagate("stop", e), this._helper && this.helper.remove(), !1 }, _updateVirtualBoundaries: function (t) { var e, s, n, a, o, r = this.options; o = { minWidth: i(r.minWidth) ? r.minWidth : 0, maxWidth: i(r.maxWidth) ? r.maxWidth : 1 / 0, minHeight: i(r.minHeight) ? r.minHeight : 0, maxHeight: i(r.maxHeight) ? r.maxHeight : 1 / 0 }, (this._aspectRatio || t) && (e = o.minHeight * this.aspectRatio, n = o.minWidth / this.aspectRatio, s = o.maxHeight * this.aspectRatio, a = o.maxWidth / this.aspectRatio, e > o.minWidth && (o.minWidth = e), n > o.minHeight && (o.minHeight = n), o.maxWidth > s && (o.maxWidth = s), o.maxHeight > a && (o.maxHeight = a)), this._vBoundaries = o }, _updateCache: function (t) { this.offset = this.helper.offset(), i(t.left) && (this.position.left = t.left), i(t.top) && (this.position.top = t.top), i(t.height) && (this.size.height = t.height), i(t.width) && (this.size.width = t.width) }, _updateRatio: function (t) { var e = this.position, s = this.size, n = this.axis; return i(t.height) ? t.width = t.height * this.aspectRatio : i(t.width) && (t.height = t.width / this.aspectRatio), "sw" === n && (t.left = e.left + (s.width - t.width), t.top = null), "nw" === n && (t.top = e.top + (s.height - t.height), t.left = e.left + (s.width - t.width)), t }, _respectSize: function (t) { var e = this._vBoundaries, s = this.axis, n = i(t.width) && e.maxWidth && e.maxWidth < t.width, a = i(t.height) && e.maxHeight && e.maxHeight < t.height, o = i(t.width) && e.minWidth && e.minWidth > t.width, r = i(t.height) && e.minHeight && e.minHeight > t.height, h = this.originalPosition.left + this.originalSize.width, l = this.position.top + this.size.height, c = /sw|nw|w/.test(s), u = /nw|ne|n/.test(s); return o && (t.width = e.minWidth), r && (t.height = e.minHeight), n && (t.width = e.maxWidth), a && (t.height = e.maxHeight), o && c && (t.left = h - e.minWidth), n && c && (t.left = h - e.maxWidth), r && u && (t.top = l - e.minHeight), a && u && (t.top = l - e.maxHeight), t.width || t.height || t.left || !t.top ? t.width || t.height || t.top || !t.left || (t.left = null) : t.top = null, t }, _proportionallyResize: function () { if (this._proportionallyResizeElements.length) { var t, e, i, s, n, a = this.helper || this.element; for (t = 0; this._proportionallyResizeElements.length > t; t++) { if (n = this._proportionallyResizeElements[t], !this.borderDif) for (this.borderDif = [], i = [n.css("borderTopWidth"), n.css("borderRightWidth"), n.css("borderBottomWidth"), n.css("borderLeftWidth")], s = [n.css("paddingTop"), n.css("paddingRight"), n.css("paddingBottom"), n.css("paddingLeft")], e = 0; i.length > e; e++) this.borderDif[e] = (parseInt(i[e], 10) || 0) + (parseInt(s[e], 10) || 0); n.css({ height: a.height() - this.borderDif[0] - this.borderDif[2] || 0, width: a.width() - this.borderDif[1] - this.borderDif[3] || 0 }) } } }, _renderProxy: function () { var e = this.element, i = this.options; this.elementOffset = e.offset(), this._helper ? (this.helper = this.helper || t("<div style='overflow:hidden;'></div>"), this.helper.addClass(this._helper).css({ width: this.element.outerWidth() - 1, height: this.element.outerHeight() - 1, position: "absolute", left: this.elementOffset.left + "px", top: this.elementOffset.top + "px", zIndex: ++i.zIndex }), this.helper.appendTo("body").disableSelection()) : this.helper = this.element }, _change: { e: function (t, e) { return { width: this.originalSize.width + e } }, w: function (t, e) { var i = this.originalSize, s = this.originalPosition; return { left: s.left + e, width: i.width - e } }, n: function (t, e, i) { var s = this.originalSize, n = this.originalPosition; return { top: n.top + i, height: s.height - i } }, s: function (t, e, i) { return { height: this.originalSize.height + i } }, se: function (e, i, s) { return t.extend(this._change.s.apply(this, arguments), this._change.e.apply(this, [e, i, s])) }, sw: function (e, i, s) { return t.extend(this._change.s.apply(this, arguments), this._change.w.apply(this, [e, i, s])) }, ne: function (e, i, s) { return t.extend(this._change.n.apply(this, arguments), this._change.e.apply(this, [e, i, s])) }, nw: function (e, i, s) { return t.extend(this._change.n.apply(this, arguments), this._change.w.apply(this, [e, i, s])) } }, _propagate: function (e, i) { t.ui.plugin.call(this, e, [i, this.ui()]), "resize" !== e && this._trigger(e, i, this.ui()) }, plugins: {}, ui: function () { return { originalElement: this.originalElement, element: this.element, helper: this.helper, position: this.position, size: this.size, originalSize: this.originalSize, originalPosition: this.originalPosition } } }), t.ui.plugin.add("resizable", "animate", { stop: function (e) { var i = t(this).data("ui-resizable"), s = i.options, n = i._proportionallyResizeElements, a = n.length && /textarea/i.test(n[0].nodeName), o = a && t.ui.hasScroll(n[0], "left") ? 0 : i.sizeDiff.height, r = a ? 0 : i.sizeDiff.width, h = { width: i.size.width - r, height: i.size.height - o }, l = parseInt(i.element.css("left"), 10) + (i.position.left - i.originalPosition.left) || null, c = parseInt(i.element.css("top"), 10) + (i.position.top - i.originalPosition.top) || null; i.element.animate(t.extend(h, c && l ? { top: c, left: l } : {}), { duration: s.animateDuration, easing: s.animateEasing, step: function () { var s = { width: parseInt(i.element.css("width"), 10), height: parseInt(i.element.css("height"), 10), top: parseInt(i.element.css("top"), 10), left: parseInt(i.element.css("left"), 10) }; n && n.length && t(n[0]).css({ width: s.width, height: s.height }), i._updateCache(s), i._propagate("resize", e) } }) } }), t.ui.plugin.add("resizable", "containment", { start: function () { var i, s, n, a, o, r, h, l = t(this).data("ui-resizable"), c = l.options, u = l.element, d = c.containment, p = d instanceof t ? d.get(0) : /parent/.test(d) ? u.parent().get(0) : d; p && (l.containerElement = t(p), /document/.test(d) || d === document ? (l.containerOffset = { left: 0, top: 0 }, l.containerPosition = { left: 0, top: 0 }, l.parentData = { element: t(document), left: 0, top: 0, width: t(document).width(), height: t(document).height() || document.body.parentNode.scrollHeight }) : (i = t(p), s = [], t(["Top", "Right", "Left", "Bottom"]).each(function (t, n) { s[t] = e(i.css("padding" + n)) }), l.containerOffset = i.offset(), l.containerPosition = i.position(), l.containerSize = { height: i.innerHeight() - s[3], width: i.innerWidth() - s[1] }, n = l.containerOffset, a = l.containerSize.height, o = l.containerSize.width, r = t.ui.hasScroll(p, "left") ? p.scrollWidth : o, h = t.ui.hasScroll(p) ? p.scrollHeight : a, l.parentData = { element: p, left: n.left, top: n.top, width: r, height: h })) }, resize: function (e) { var i, s, n, a, o = t(this).data("ui-resizable"), r = o.options, h = o.containerOffset, l = o.position, c = o._aspectRatio || e.shiftKey, u = { top: 0, left: 0 }, d = o.containerElement; d[0] !== document && /static/.test(d.css("position")) && (u = h), l.left < (o._helper ? h.left : 0) && (o.size.width = o.size.width + (o._helper ? o.position.left - h.left : o.position.left - u.left), c && (o.size.height = o.size.width / o.aspectRatio), o.position.left = r.helper ? h.left : 0), l.top < (o._helper ? h.top : 0) && (o.size.height = o.size.height + (o._helper ? o.position.top - h.top : o.position.top), c && (o.size.width = o.size.height * o.aspectRatio), o.position.top = o._helper ? h.top : 0), o.offset.left = o.parentData.left + o.position.left, o.offset.top = o.parentData.top + o.position.top, i = Math.abs((o._helper ? o.offset.left - u.left : o.offset.left - u.left) + o.sizeDiff.width), s = Math.abs((o._helper ? o.offset.top - u.top : o.offset.top - h.top) + o.sizeDiff.height), n = o.containerElement.get(0) === o.element.parent().get(0), a = /relative|absolute/.test(o.containerElement.css("position")), n && a && (i -= Math.abs(o.parentData.left)), i + o.size.width >= o.parentData.width && (o.size.width = o.parentData.width - i, c && (o.size.height = o.size.width / o.aspectRatio)), s + o.size.height >= o.parentData.height && (o.size.height = o.parentData.height - s, c && (o.size.width = o.size.height * o.aspectRatio)) }, stop: function () { var e = t(this).data("ui-resizable"), i = e.options, s = e.containerOffset, n = e.containerPosition, a = e.containerElement, o = t(e.helper), r = o.offset(), h = o.outerWidth() - e.sizeDiff.width, l = o.outerHeight() - e.sizeDiff.height; e._helper && !i.animate && /relative/.test(a.css("position")) && t(this).css({ left: r.left - n.left - s.left, width: h, height: l }), e._helper && !i.animate && /static/.test(a.css("position")) && t(this).css({ left: r.left - n.left - s.left, width: h, height: l }) } }), t.ui.plugin.add("resizable", "alsoResize", { start: function () { var e = t(this).data("ui-resizable"), i = e.options, s = function (e) { t(e).each(function () { var e = t(this); e.data("ui-resizable-alsoresize", { width: parseInt(e.width(), 10), height: parseInt(e.height(), 10), left: parseInt(e.css("left"), 10), top: parseInt(e.css("top"), 10) }) }) }; "object" != typeof i.alsoResize || i.alsoResize.parentNode ? s(i.alsoResize) : i.alsoResize.length ? (i.alsoResize = i.alsoResize[0], s(i.alsoResize)) : t.each(i.alsoResize, function (t) { s(t) }) }, resize: function (e, i) { var s = t(this).data("ui-resizable"), n = s.options, a = s.originalSize, o = s.originalPosition, r = { height: s.size.height - a.height || 0, width: s.size.width - a.width || 0, top: s.position.top - o.top || 0, left: s.position.left - o.left || 0 }, h = function (e, s) { t(e).each(function () { var e = t(this), n = t(this).data("ui-resizable-alsoresize"), a = {}, o = s && s.length ? s : e.parents(i.originalElement[0]).length ? ["width", "height"] : ["width", "height", "top", "left"]; t.each(o, function (t, e) { var i = (n[e] || 0) + (r[e] || 0); i && i >= 0 && (a[e] = i || null) }), e.css(a) }) }; "object" != typeof n.alsoResize || n.alsoResize.nodeType ? h(n.alsoResize) : t.each(n.alsoResize, function (t, e) { h(t, e) }) }, stop: function () { t(this).removeData("resizable-alsoresize") } }), t.ui.plugin.add("resizable", "ghost", { start: function () { var e = t(this).data("ui-resizable"), i = e.options, s = e.size; e.ghost = e.originalElement.clone(), e.ghost.css({ opacity: .25, display: "block", position: "relative", height: s.height, width: s.width, margin: 0, left: 0, top: 0 }).addClass("ui-resizable-ghost").addClass("string" == typeof i.ghost ? i.ghost : ""), e.ghost.appendTo(e.helper) }, resize: function () { var e = t(this).data("ui-resizable"); e.ghost && e.ghost.css({ position: "relative", height: e.size.height, width: e.size.width }) }, stop: function () { var e = t(this).data("ui-resizable"); e.ghost && e.helper && e.helper.get(0).removeChild(e.ghost.get(0)) } }), t.ui.plugin.add("resizable", "grid", { resize: function () { var e = t(this).data("ui-resizable"), i = e.options, s = e.size, n = e.originalSize, a = e.originalPosition, o = e.axis, r = "number" == typeof i.grid ? [i.grid, i.grid] : i.grid, h = r[0] || 1, l = r[1] || 1, c = Math.round((s.width - n.width) / h) * h, u = Math.round((s.height - n.height) / l) * l, d = n.width + c, p = n.height + u, f = i.maxWidth && d > i.maxWidth, g = i.maxHeight && p > i.maxHeight, m = i.minWidth && i.minWidth > d, v = i.minHeight && i.minHeight > p; i.grid = r, m && (d += h), v && (p += l), f && (d -= h), g && (p -= l), /^(se|s|e)$/.test(o) ? (e.size.width = d, e.size.height = p) : /^(ne)$/.test(o) ? (e.size.width = d, e.size.height = p, e.position.top = a.top - u) : /^(sw)$/.test(o) ? (e.size.width = d, e.size.height = p, e.position.left = a.left - c) : (p - l > 0 ? (e.size.height = p, e.position.top = a.top - u) : (e.size.height = l, e.position.top = a.top + n.height - l), d - h > 0 ? (e.size.width = d, e.position.left = a.left - c) : (e.size.width = h, e.position.left = a.left + n.width - h)) } }) })(jQuery); (function (t) { t.widget("ui.selectable", t.ui.mouse, { version: "1.10.4", options: { appendTo: "body", autoRefresh: !0, distance: 0, filter: "*", tolerance: "touch", selected: null, selecting: null, start: null, stop: null, unselected: null, unselecting: null }, _create: function () { var e, i = this; this.element.addClass("ui-selectable"), this.dragged = !1, this.refresh = function () { e = t(i.options.filter, i.element[0]), e.addClass("ui-selectee"), e.each(function () { var e = t(this), i = e.offset(); t.data(this, "selectable-item", { element: this, $element: e, left: i.left, top: i.top, right: i.left + e.outerWidth(), bottom: i.top + e.outerHeight(), startselected: !1, selected: e.hasClass("ui-selected"), selecting: e.hasClass("ui-selecting"), unselecting: e.hasClass("ui-unselecting") }) }) }, this.refresh(), this.selectees = e.addClass("ui-selectee"), this._mouseInit(), this.helper = t("<div class='ui-selectable-helper'></div>") }, _destroy: function () { this.selectees.removeClass("ui-selectee").removeData("selectable-item"), this.element.removeClass("ui-selectable ui-selectable-disabled"), this._mouseDestroy() }, _mouseStart: function (e) { var i = this, s = this.options; this.opos = [e.pageX, e.pageY], this.options.disabled || (this.selectees = t(s.filter, this.element[0]), this._trigger("start", e), t(s.appendTo).append(this.helper), this.helper.css({ left: e.pageX, top: e.pageY, width: 0, height: 0 }), s.autoRefresh && this.refresh(), this.selectees.filter(".ui-selected").each(function () { var s = t.data(this, "selectable-item"); s.startselected = !0, e.metaKey || e.ctrlKey || (s.$element.removeClass("ui-selected"), s.selected = !1, s.$element.addClass("ui-unselecting"), s.unselecting = !0, i._trigger("unselecting", e, { unselecting: s.element })) }), t(e.target).parents().addBack().each(function () { var s, n = t.data(this, "selectable-item"); return n ? (s = !e.metaKey && !e.ctrlKey || !n.$element.hasClass("ui-selected"), n.$element.removeClass(s ? "ui-unselecting" : "ui-selected").addClass(s ? "ui-selecting" : "ui-unselecting"), n.unselecting = !s, n.selecting = s, n.selected = s, s ? i._trigger("selecting", e, { selecting: n.element }) : i._trigger("unselecting", e, { unselecting: n.element }), !1) : undefined })) }, _mouseDrag: function (e) { if (this.dragged = !0, !this.options.disabled) { var i, s = this, n = this.options, a = this.opos[0], o = this.opos[1], r = e.pageX, l = e.pageY; return a > r && (i = r, r = a, a = i), o > l && (i = l, l = o, o = i), this.helper.css({ left: a, top: o, width: r - a, height: l - o }), this.selectees.each(function () { var i = t.data(this, "selectable-item"), h = !1; i && i.element !== s.element[0] && ("touch" === n.tolerance ? h = !(i.left > r || a > i.right || i.top > l || o > i.bottom) : "fit" === n.tolerance && (h = i.left > a && r > i.right && i.top > o && l > i.bottom), h ? (i.selected && (i.$element.removeClass("ui-selected"), i.selected = !1), i.unselecting && (i.$element.removeClass("ui-unselecting"), i.unselecting = !1), i.selecting || (i.$element.addClass("ui-selecting"), i.selecting = !0, s._trigger("selecting", e, { selecting: i.element }))) : (i.selecting && ((e.metaKey || e.ctrlKey) && i.startselected ? (i.$element.removeClass("ui-selecting"), i.selecting = !1, i.$element.addClass("ui-selected"), i.selected = !0) : (i.$element.removeClass("ui-selecting"), i.selecting = !1, i.startselected && (i.$element.addClass("ui-unselecting"), i.unselecting = !0), s._trigger("unselecting", e, { unselecting: i.element }))), i.selected && (e.metaKey || e.ctrlKey || i.startselected || (i.$element.removeClass("ui-selected"), i.selected = !1, i.$element.addClass("ui-unselecting"), i.unselecting = !0, s._trigger("unselecting", e, { unselecting: i.element }))))) }), !1 } }, _mouseStop: function (e) { var i = this; return this.dragged = !1, t(".ui-unselecting", this.element[0]).each(function () { var s = t.data(this, "selectable-item"); s.$element.removeClass("ui-unselecting"), s.unselecting = !1, s.startselected = !1, i._trigger("unselected", e, { unselected: s.element }) }), t(".ui-selecting", this.element[0]).each(function () { var s = t.data(this, "selectable-item"); s.$element.removeClass("ui-selecting").addClass("ui-selected"), s.selecting = !1, s.selected = !0, s.startselected = !0, i._trigger("selected", e, { selected: s.element }) }), this._trigger("stop", e), this.helper.remove(), !1 } }) })(jQuery); (function (t) { var e = 5; t.widget("ui.slider", t.ui.mouse, { version: "1.10.4", widgetEventPrefix: "slide", options: { animate: !1, distance: 0, max: 100, min: 0, orientation: "horizontal", range: !1, step: 1, value: 0, values: null, change: null, slide: null, start: null, stop: null }, _create: function () { this._keySliding = !1, this._mouseSliding = !1, this._animateOff = !0, this._handleIndex = null, this._detectOrientation(), this._mouseInit(), this.element.addClass("ui-slider ui-slider-" + this.orientation + " ui-widget" + " ui-widget-content" + " ui-corner-all"), this._refresh(), this._setOption("disabled", this.options.disabled), this._animateOff = !1 }, _refresh: function () { this._createRange(), this._createHandles(), this._setupEvents(), this._refreshValue() }, _createHandles: function () { var e, i, s = this.options, n = this.element.find(".ui-slider-handle").addClass("ui-state-default ui-corner-all"), a = "<a class='ui-slider-handle ui-state-default ui-corner-all' href='#'></a>", o = []; for (i = s.values && s.values.length || 1, n.length > i && (n.slice(i).remove(), n = n.slice(0, i)), e = n.length; i > e; e++) o.push(a); this.handles = n.add(t(o.join("")).appendTo(this.element)), this.handle = this.handles.eq(0), this.handles.each(function (e) { t(this).data("ui-slider-handle-index", e) }) }, _createRange: function () { var e = this.options, i = ""; e.range ? (e.range === !0 && (e.values ? e.values.length && 2 !== e.values.length ? e.values = [e.values[0], e.values[0]] : t.isArray(e.values) && (e.values = e.values.slice(0)) : e.values = [this._valueMin(), this._valueMin()]), this.range && this.range.length ? this.range.removeClass("ui-slider-range-min ui-slider-range-max").css({ left: "", bottom: "" }) : (this.range = t("<div></div>").appendTo(this.element), i = "ui-slider-range ui-widget-header ui-corner-all"), this.range.addClass(i + ("min" === e.range || "max" === e.range ? " ui-slider-range-" + e.range : ""))) : (this.range && this.range.remove(), this.range = null) }, _setupEvents: function () { var t = this.handles.add(this.range).filter("a"); this._off(t), this._on(t, this._handleEvents), this._hoverable(t), this._focusable(t) }, _destroy: function () { this.handles.remove(), this.range && this.range.remove(), this.element.removeClass("ui-slider ui-slider-horizontal ui-slider-vertical ui-widget ui-widget-content ui-corner-all"), this._mouseDestroy() }, _mouseCapture: function (e) { var i, s, n, a, o, r, l, h, u = this, c = this.options; return c.disabled ? !1 : (this.elementSize = { width: this.element.outerWidth(), height: this.element.outerHeight() }, this.elementOffset = this.element.offset(), i = { x: e.pageX, y: e.pageY }, s = this._normValueFromMouse(i), n = this._valueMax() - this._valueMin() + 1, this.handles.each(function (e) { var i = Math.abs(s - u.values(e)); (n > i || n === i && (e === u._lastChangedValue || u.values(e) === c.min)) && (n = i, a = t(this), o = e) }), r = this._start(e, o), r === !1 ? !1 : (this._mouseSliding = !0, this._handleIndex = o, a.addClass("ui-state-active").focus(), l = a.offset(), h = !t(e.target).parents().addBack().is(".ui-slider-handle"), this._clickOffset = h ? { left: 0, top: 0 } : { left: e.pageX - l.left - a.width() / 2, top: e.pageY - l.top - a.height() / 2 - (parseInt(a.css("borderTopWidth"), 10) || 0) - (parseInt(a.css("borderBottomWidth"), 10) || 0) + (parseInt(a.css("marginTop"), 10) || 0) }, this.handles.hasClass("ui-state-hover") || this._slide(e, o, s), this._animateOff = !0, !0)) }, _mouseStart: function () { return !0 }, _mouseDrag: function (t) { var e = { x: t.pageX, y: t.pageY }, i = this._normValueFromMouse(e); return this._slide(t, this._handleIndex, i), !1 }, _mouseStop: function (t) { return this.handles.removeClass("ui-state-active"), this._mouseSliding = !1, this._stop(t, this._handleIndex), this._change(t, this._handleIndex), this._handleIndex = null, this._clickOffset = null, this._animateOff = !1, !1 }, _detectOrientation: function () { this.orientation = "vertical" === this.options.orientation ? "vertical" : "horizontal" }, _normValueFromMouse: function (t) { var e, i, s, n, a; return "horizontal" === this.orientation ? (e = this.elementSize.width, i = t.x - this.elementOffset.left - (this._clickOffset ? this._clickOffset.left : 0)) : (e = this.elementSize.height, i = t.y - this.elementOffset.top - (this._clickOffset ? this._clickOffset.top : 0)), s = i / e, s > 1 && (s = 1), 0 > s && (s = 0), "vertical" === this.orientation && (s = 1 - s), n = this._valueMax() - this._valueMin(), a = this._valueMin() + s * n, this._trimAlignValue(a) }, _start: function (t, e) { var i = { handle: this.handles[e], value: this.value() }; return this.options.values && this.options.values.length && (i.value = this.values(e), i.values = this.values()), this._trigger("start", t, i) }, _slide: function (t, e, i) { var s, n, a; this.options.values && this.options.values.length ? (s = this.values(e ? 0 : 1), 2 === this.options.values.length && this.options.range === !0 && (0 === e && i > s || 1 === e && s > i) && (i = s), i !== this.values(e) && (n = this.values(), n[e] = i, a = this._trigger("slide", t, { handle: this.handles[e], value: i, values: n }), s = this.values(e ? 0 : 1), a !== !1 && this.values(e, i))) : i !== this.value() && (a = this._trigger("slide", t, { handle: this.handles[e], value: i }), a !== !1 && this.value(i)) }, _stop: function (t, e) { var i = { handle: this.handles[e], value: this.value() }; this.options.values && this.options.values.length && (i.value = this.values(e), i.values = this.values()), this._trigger("stop", t, i) }, _change: function (t, e) { if (!this._keySliding && !this._mouseSliding) { var i = { handle: this.handles[e], value: this.value() }; this.options.values && this.options.values.length && (i.value = this.values(e), i.values = this.values()), this._lastChangedValue = e, this._trigger("change", t, i) } }, value: function (t) { return arguments.length ? (this.options.value = this._trimAlignValue(t), this._refreshValue(), this._change(null, 0), undefined) : this._value() }, values: function (e, i) { var s, n, a; if (arguments.length > 1) return this.options.values[e] = this._trimAlignValue(i), this._refreshValue(), this._change(null, e), undefined; if (!arguments.length) return this._values(); if (!t.isArray(arguments[0])) return this.options.values && this.options.values.length ? this._values(e) : this.value(); for (s = this.options.values, n = arguments[0], a = 0; s.length > a; a += 1) s[a] = this._trimAlignValue(n[a]), this._change(null, a); this._refreshValue() }, _setOption: function (e, i) { var s, n = 0; switch ("range" === e && this.options.range === !0 && ("min" === i ? (this.options.value = this._values(0), this.options.values = null) : "max" === i && (this.options.value = this._values(this.options.values.length - 1), this.options.values = null)), t.isArray(this.options.values) && (n = this.options.values.length), t.Widget.prototype._setOption.apply(this, arguments), e) { case "orientation": this._detectOrientation(), this.element.removeClass("ui-slider-horizontal ui-slider-vertical").addClass("ui-slider-" + this.orientation), this._refreshValue(); break; case "value": this._animateOff = !0, this._refreshValue(), this._change(null, 0), this._animateOff = !1; break; case "values": for (this._animateOff = !0, this._refreshValue(), s = 0; n > s; s += 1) this._change(null, s); this._animateOff = !1; break; case "min": case "max": this._animateOff = !0, this._refreshValue(), this._animateOff = !1; break; case "range": this._animateOff = !0, this._refresh(), this._animateOff = !1 } }, _value: function () { var t = this.options.value; return t = this._trimAlignValue(t) }, _values: function (t) { var e, i, s; if (arguments.length) return e = this.options.values[t], e = this._trimAlignValue(e); if (this.options.values && this.options.values.length) { for (i = this.options.values.slice(), s = 0; i.length > s; s += 1) i[s] = this._trimAlignValue(i[s]); return i } return [] }, _trimAlignValue: function (t) { if (this._valueMin() >= t) return this._valueMin(); if (t >= this._valueMax()) return this._valueMax(); var e = this.options.step > 0 ? this.options.step : 1, i = (t - this._valueMin()) % e, s = t - i; return 2 * Math.abs(i) >= e && (s += i > 0 ? e : -e), parseFloat(s.toFixed(5)) }, _valueMin: function () { return this.options.min }, _valueMax: function () { return this.options.max }, _refreshValue: function () { var e, i, s, n, a, o = this.options.range, r = this.options, l = this, h = this._animateOff ? !1 : r.animate, u = {}; this.options.values && this.options.values.length ? this.handles.each(function (s) { i = 100 * ((l.values(s) - l._valueMin()) / (l._valueMax() - l._valueMin())), u["horizontal" === l.orientation ? "left" : "bottom"] = i + "%", t(this).stop(1, 1)[h ? "animate" : "css"](u, r.animate), l.options.range === !0 && ("horizontal" === l.orientation ? (0 === s && l.range.stop(1, 1)[h ? "animate" : "css"]({ left: i + "%" }, r.animate), 1 === s && l.range[h ? "animate" : "css"]({ width: i - e + "%" }, { queue: !1, duration: r.animate })) : (0 === s && l.range.stop(1, 1)[h ? "animate" : "css"]({ bottom: i + "%" }, r.animate), 1 === s && l.range[h ? "animate" : "css"]({ height: i - e + "%" }, { queue: !1, duration: r.animate }))), e = i }) : (s = this.value(), n = this._valueMin(), a = this._valueMax(), i = a !== n ? 100 * ((s - n) / (a - n)) : 0, u["horizontal" === this.orientation ? "left" : "bottom"] = i + "%", this.handle.stop(1, 1)[h ? "animate" : "css"](u, r.animate), "min" === o && "horizontal" === this.orientation && this.range.stop(1, 1)[h ? "animate" : "css"]({ width: i + "%" }, r.animate), "max" === o && "horizontal" === this.orientation && this.range[h ? "animate" : "css"]({ width: 100 - i + "%" }, { queue: !1, duration: r.animate }), "min" === o && "vertical" === this.orientation && this.range.stop(1, 1)[h ? "animate" : "css"]({ height: i + "%" }, r.animate), "max" === o && "vertical" === this.orientation && this.range[h ? "animate" : "css"]({ height: 100 - i + "%" }, { queue: !1, duration: r.animate })) }, _handleEvents: { keydown: function (i) { var s, n, a, o, r = t(i.target).data("ui-slider-handle-index"); switch (i.keyCode) { case t.ui.keyCode.HOME: case t.ui.keyCode.END: case t.ui.keyCode.PAGE_UP: case t.ui.keyCode.PAGE_DOWN: case t.ui.keyCode.UP: case t.ui.keyCode.RIGHT: case t.ui.keyCode.DOWN: case t.ui.keyCode.LEFT: if (i.preventDefault(), !this._keySliding && (this._keySliding = !0, t(i.target).addClass("ui-state-active"), s = this._start(i, r), s === !1)) return } switch (o = this.options.step, n = a = this.options.values && this.options.values.length ? this.values(r) : this.value(), i.keyCode) { case t.ui.keyCode.HOME: a = this._valueMin(); break; case t.ui.keyCode.END: a = this._valueMax(); break; case t.ui.keyCode.PAGE_UP: a = this._trimAlignValue(n + (this._valueMax() - this._valueMin()) / e); break; case t.ui.keyCode.PAGE_DOWN: a = this._trimAlignValue(n - (this._valueMax() - this._valueMin()) / e); break; case t.ui.keyCode.UP: case t.ui.keyCode.RIGHT: if (n === this._valueMax()) return; a = this._trimAlignValue(n + o); break; case t.ui.keyCode.DOWN: case t.ui.keyCode.LEFT: if (n === this._valueMin()) return; a = this._trimAlignValue(n - o) } this._slide(i, r, a) }, click: function (t) { t.preventDefault() }, keyup: function (e) { var i = t(e.target).data("ui-slider-handle-index"); this._keySliding && (this._keySliding = !1, this._stop(e, i), this._change(e, i), t(e.target).removeClass("ui-state-active")) } } }) })(jQuery); (function (t) { function e(t, e, i) { return t > e && e + i > t } function i(t) { return /left|right/.test(t.css("float")) || /inline|table-cell/.test(t.css("display")) } t.widget("ui.sortable", t.ui.mouse, { version: "1.10.4", widgetEventPrefix: "sort", ready: !1, options: { appendTo: "parent", axis: !1, connectWith: !1, containment: !1, cursor: "auto", cursorAt: !1, dropOnEmpty: !0, forcePlaceholderSize: !1, forceHelperSize: !1, grid: !1, handle: !1, helper: "original", items: "> *", opacity: !1, placeholder: !1, revert: !1, scroll: !0, scrollSensitivity: 20, scrollSpeed: 20, scope: "default", tolerance: "intersect", zIndex: 1e3, activate: null, beforeStop: null, change: null, deactivate: null, out: null, over: null, receive: null, remove: null, sort: null, start: null, stop: null, update: null }, _create: function () { var t = this.options; this.containerCache = {}, this.element.addClass("ui-sortable"), this.refresh(), this.floating = this.items.length ? "x" === t.axis || i(this.items[0].item) : !1, this.offset = this.element.offset(), this._mouseInit(), this.ready = !0 }, _destroy: function () { this.element.removeClass("ui-sortable ui-sortable-disabled"), this._mouseDestroy(); for (var t = this.items.length - 1; t >= 0; t--) this.items[t].item.removeData(this.widgetName + "-item"); return this }, _setOption: function (e, i) { "disabled" === e ? (this.options[e] = i, this.widget().toggleClass("ui-sortable-disabled", !!i)) : t.Widget.prototype._setOption.apply(this, arguments) }, _mouseCapture: function (e, i) { var s = null, n = !1, o = this; return this.reverting ? !1 : this.options.disabled || "static" === this.options.type ? !1 : (this._refreshItems(e), t(e.target).parents().each(function () { return t.data(this, o.widgetName + "-item") === o ? (s = t(this), !1) : undefined }), t.data(e.target, o.widgetName + "-item") === o && (s = t(e.target)), s ? !this.options.handle || i || (t(this.options.handle, s).find("*").addBack().each(function () { this === e.target && (n = !0) }), n) ? (this.currentItem = s, this._removeCurrentsFromItems(), !0) : !1 : !1) }, _mouseStart: function (e, i, s) { var n, o, a = this.options; if (this.currentContainer = this, this.refreshPositions(), this.helper = this._createHelper(e), this._cacheHelperProportions(), this._cacheMargins(), this.scrollParent = this.helper.scrollParent(), this.offset = this.currentItem.offset(), this.offset = { top: this.offset.top - this.margins.top, left: this.offset.left - this.margins.left }, t.extend(this.offset, { click: { left: e.pageX - this.offset.left, top: e.pageY - this.offset.top }, parent: this._getParentOffset(), relative: this._getRelativeOffset() }), this.helper.css("position", "absolute"), this.cssPosition = this.helper.css("position"), this.originalPosition = this._generatePosition(e), this.originalPageX = e.pageX, this.originalPageY = e.pageY, a.cursorAt && this._adjustOffsetFromHelper(a.cursorAt), this.domPosition = { prev: this.currentItem.prev()[0], parent: this.currentItem.parent()[0] }, this.helper[0] !== this.currentItem[0] && this.currentItem.hide(), this._createPlaceholder(), a.containment && this._setContainment(), a.cursor && "auto" !== a.cursor && (o = this.document.find("body"), this.storedCursor = o.css("cursor"), o.css("cursor", a.cursor), this.storedStylesheet = t("<style>*{ cursor: " + a.cursor + " !important; }</style>").appendTo(o)), a.opacity && (this.helper.css("opacity") && (this._storedOpacity = this.helper.css("opacity")), this.helper.css("opacity", a.opacity)), a.zIndex && (this.helper.css("zIndex") && (this._storedZIndex = this.helper.css("zIndex")), this.helper.css("zIndex", a.zIndex)), this.scrollParent[0] !== document && "HTML" !== this.scrollParent[0].tagName && (this.overflowOffset = this.scrollParent.offset()), this._trigger("start", e, this._uiHash()), this._preserveHelperProportions || this._cacheHelperProportions(), !s) for (n = this.containers.length - 1; n >= 0; n--) this.containers[n]._trigger("activate", e, this._uiHash(this)); return t.ui.ddmanager && (t.ui.ddmanager.current = this), t.ui.ddmanager && !a.dropBehaviour && t.ui.ddmanager.prepareOffsets(this, e), this.dragging = !0, this.helper.addClass("ui-sortable-helper"), this._mouseDrag(e), !0 }, _mouseDrag: function (e) { var i, s, n, o, a = this.options, r = !1; for (this.position = this._generatePosition(e), this.positionAbs = this._convertPositionTo("absolute"), this.lastPositionAbs || (this.lastPositionAbs = this.positionAbs), this.options.scroll && (this.scrollParent[0] !== document && "HTML" !== this.scrollParent[0].tagName ? (this.overflowOffset.top + this.scrollParent[0].offsetHeight - e.pageY < a.scrollSensitivity ? this.scrollParent[0].scrollTop = r = this.scrollParent[0].scrollTop + a.scrollSpeed : e.pageY - this.overflowOffset.top < a.scrollSensitivity && (this.scrollParent[0].scrollTop = r = this.scrollParent[0].scrollTop - a.scrollSpeed), this.overflowOffset.left + this.scrollParent[0].offsetWidth - e.pageX < a.scrollSensitivity ? this.scrollParent[0].scrollLeft = r = this.scrollParent[0].scrollLeft + a.scrollSpeed : e.pageX - this.overflowOffset.left < a.scrollSensitivity && (this.scrollParent[0].scrollLeft = r = this.scrollParent[0].scrollLeft - a.scrollSpeed)) : (e.pageY - t(document).scrollTop() < a.scrollSensitivity ? r = t(document).scrollTop(t(document).scrollTop() - a.scrollSpeed) : t(window).height() - (e.pageY - t(document).scrollTop()) < a.scrollSensitivity && (r = t(document).scrollTop(t(document).scrollTop() + a.scrollSpeed)), e.pageX - t(document).scrollLeft() < a.scrollSensitivity ? r = t(document).scrollLeft(t(document).scrollLeft() - a.scrollSpeed) : t(window).width() - (e.pageX - t(document).scrollLeft()) < a.scrollSensitivity && (r = t(document).scrollLeft(t(document).scrollLeft() + a.scrollSpeed))), r !== !1 && t.ui.ddmanager && !a.dropBehaviour && t.ui.ddmanager.prepareOffsets(this, e)), this.positionAbs = this._convertPositionTo("absolute"), this.options.axis && "y" === this.options.axis || (this.helper[0].style.left = this.position.left + "px"), this.options.axis && "x" === this.options.axis || (this.helper[0].style.top = this.position.top + "px"), i = this.items.length - 1; i >= 0; i--) if (s = this.items[i], n = s.item[0], o = this._intersectsWithPointer(s), o && s.instance === this.currentContainer && n !== this.currentItem[0] && this.placeholder[1 === o ? "next" : "prev"]()[0] !== n && !t.contains(this.placeholder[0], n) && ("semi-dynamic" === this.options.type ? !t.contains(this.element[0], n) : !0)) { if (this.direction = 1 === o ? "down" : "up", "pointer" !== this.options.tolerance && !this._intersectsWithSides(s)) break; this._rearrange(e, s), this._trigger("change", e, this._uiHash()); break } return this._contactContainers(e), t.ui.ddmanager && t.ui.ddmanager.drag(this, e), this._trigger("sort", e, this._uiHash()), this.lastPositionAbs = this.positionAbs, !1 }, _mouseStop: function (e, i) { if (e) { if (t.ui.ddmanager && !this.options.dropBehaviour && t.ui.ddmanager.drop(this, e), this.options.revert) { var s = this, n = this.placeholder.offset(), o = this.options.axis, a = {}; o && "x" !== o || (a.left = n.left - this.offset.parent.left - this.margins.left + (this.offsetParent[0] === document.body ? 0 : this.offsetParent[0].scrollLeft)), o && "y" !== o || (a.top = n.top - this.offset.parent.top - this.margins.top + (this.offsetParent[0] === document.body ? 0 : this.offsetParent[0].scrollTop)), this.reverting = !0, t(this.helper).animate(a, parseInt(this.options.revert, 10) || 500, function () { s._clear(e) }) } else this._clear(e, i); return !1 } }, cancel: function () { if (this.dragging) { this._mouseUp({ target: null }), "original" === this.options.helper ? this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper") : this.currentItem.show(); for (var e = this.containers.length - 1; e >= 0; e--) this.containers[e]._trigger("deactivate", null, this._uiHash(this)), this.containers[e].containerCache.over && (this.containers[e]._trigger("out", null, this._uiHash(this)), this.containers[e].containerCache.over = 0) } return this.placeholder && (this.placeholder[0].parentNode && this.placeholder[0].parentNode.removeChild(this.placeholder[0]), "original" !== this.options.helper && this.helper && this.helper[0].parentNode && this.helper.remove(), t.extend(this, { helper: null, dragging: !1, reverting: !1, _noFinalSort: null }), this.domPosition.prev ? t(this.domPosition.prev).after(this.currentItem) : t(this.domPosition.parent).prepend(this.currentItem)), this }, serialize: function (e) { var i = this._getItemsAsjQuery(e && e.connected), s = []; return e = e || {}, t(i).each(function () { var i = (t(e.item || this).attr(e.attribute || "id") || "").match(e.expression || /(.+)[\-=_](.+)/); i && s.push((e.key || i[1] + "[]") + "=" + (e.key && e.expression ? i[1] : i[2])) }), !s.length && e.key && s.push(e.key + "="), s.join("&") }, toArray: function (e) { var i = this._getItemsAsjQuery(e && e.connected), s = []; return e = e || {}, i.each(function () { s.push(t(e.item || this).attr(e.attribute || "id") || "") }), s }, _intersectsWith: function (t) { var e = this.positionAbs.left, i = e + this.helperProportions.width, s = this.positionAbs.top, n = s + this.helperProportions.height, o = t.left, a = o + t.width, r = t.top, h = r + t.height, l = this.offset.click.top, c = this.offset.click.left, u = "x" === this.options.axis || s + l > r && h > s + l, d = "y" === this.options.axis || e + c > o && a > e + c, p = u && d; return "pointer" === this.options.tolerance || this.options.forcePointerForContainers || "pointer" !== this.options.tolerance && this.helperProportions[this.floating ? "width" : "height"] > t[this.floating ? "width" : "height"] ? p : e + this.helperProportions.width / 2 > o && a > i - this.helperProportions.width / 2 && s + this.helperProportions.height / 2 > r && h > n - this.helperProportions.height / 2 }, _intersectsWithPointer: function (t) { var i = "x" === this.options.axis || e(this.positionAbs.top + this.offset.click.top, t.top, t.height), s = "y" === this.options.axis || e(this.positionAbs.left + this.offset.click.left, t.left, t.width), n = i && s, o = this._getDragVerticalDirection(), a = this._getDragHorizontalDirection(); return n ? this.floating ? a && "right" === a || "down" === o ? 2 : 1 : o && ("down" === o ? 2 : 1) : !1 }, _intersectsWithSides: function (t) { var i = e(this.positionAbs.top + this.offset.click.top, t.top + t.height / 2, t.height), s = e(this.positionAbs.left + this.offset.click.left, t.left + t.width / 2, t.width), n = this._getDragVerticalDirection(), o = this._getDragHorizontalDirection(); return this.floating && o ? "right" === o && s || "left" === o && !s : n && ("down" === n && i || "up" === n && !i) }, _getDragVerticalDirection: function () { var t = this.positionAbs.top - this.lastPositionAbs.top; return 0 !== t && (t > 0 ? "down" : "up") }, _getDragHorizontalDirection: function () { var t = this.positionAbs.left - this.lastPositionAbs.left; return 0 !== t && (t > 0 ? "right" : "left") }, refresh: function (t) { return this._refreshItems(t), this.refreshPositions(), this }, _connectWith: function () { var t = this.options; return t.connectWith.constructor === String ? [t.connectWith] : t.connectWith }, _getItemsAsjQuery: function (e) { function i() { r.push(this) } var s, n, o, a, r = [], h = [], l = this._connectWith(); if (l && e) for (s = l.length - 1; s >= 0; s--) for (o = t(l[s]), n = o.length - 1; n >= 0; n--) a = t.data(o[n], this.widgetFullName), a && a !== this && !a.options.disabled && h.push([t.isFunction(a.options.items) ? a.options.items.call(a.element) : t(a.options.items, a.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"), a]); for (h.push([t.isFunction(this.options.items) ? this.options.items.call(this.element, null, { options: this.options, item: this.currentItem }) : t(this.options.items, this.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"), this]), s = h.length - 1; s >= 0; s--) h[s][0].each(i); return t(r) }, _removeCurrentsFromItems: function () { var e = this.currentItem.find(":data(" + this.widgetName + "-item)"); this.items = t.grep(this.items, function (t) { for (var i = 0; e.length > i; i++) if (e[i] === t.item[0]) return !1; return !0 }) }, _refreshItems: function (e) { this.items = [], this.containers = [this]; var i, s, n, o, a, r, h, l, c = this.items, u = [[t.isFunction(this.options.items) ? this.options.items.call(this.element[0], e, { item: this.currentItem }) : t(this.options.items, this.element), this]], d = this._connectWith(); if (d && this.ready) for (i = d.length - 1; i >= 0; i--) for (n = t(d[i]), s = n.length - 1; s >= 0; s--) o = t.data(n[s], this.widgetFullName), o && o !== this && !o.options.disabled && (u.push([t.isFunction(o.options.items) ? o.options.items.call(o.element[0], e, { item: this.currentItem }) : t(o.options.items, o.element), o]), this.containers.push(o)); for (i = u.length - 1; i >= 0; i--) for (a = u[i][1], r = u[i][0], s = 0, l = r.length; l > s; s++) h = t(r[s]), h.data(this.widgetName + "-item", a), c.push({ item: h, instance: a, width: 0, height: 0, left: 0, top: 0 }) }, refreshPositions: function (e) { this.offsetParent && this.helper && (this.offset.parent = this._getParentOffset()); var i, s, n, o; for (i = this.items.length - 1; i >= 0; i--) s = this.items[i], s.instance !== this.currentContainer && this.currentContainer && s.item[0] !== this.currentItem[0] || (n = this.options.toleranceElement ? t(this.options.toleranceElement, s.item) : s.item, e || (s.width = n.outerWidth(), s.height = n.outerHeight()), o = n.offset(), s.left = o.left, s.top = o.top); if (this.options.custom && this.options.custom.refreshContainers) this.options.custom.refreshContainers.call(this); else for (i = this.containers.length - 1; i >= 0; i--) o = this.containers[i].element.offset(), this.containers[i].containerCache.left = o.left, this.containers[i].containerCache.top = o.top, this.containers[i].containerCache.width = this.containers[i].element.outerWidth(), this.containers[i].containerCache.height = this.containers[i].element.outerHeight(); return this }, _createPlaceholder: function (e) { e = e || this; var i, s = e.options; s.placeholder && s.placeholder.constructor !== String || (i = s.placeholder, s.placeholder = { element: function () { var s = e.currentItem[0].nodeName.toLowerCase(), n = t("<" + s + ">", e.document[0]).addClass(i || e.currentItem[0].className + " ui-sortable-placeholder").removeClass("ui-sortable-helper"); return "tr" === s ? e.currentItem.children().each(function () { t("<td>&#160;</td>", e.document[0]).attr("colspan", t(this).attr("colspan") || 1).appendTo(n) }) : "img" === s && n.attr("src", e.currentItem.attr("src")), i || n.css("visibility", "hidden"), n }, update: function (t, n) { (!i || s.forcePlaceholderSize) && (n.height() || n.height(e.currentItem.innerHeight() - parseInt(e.currentItem.css("paddingTop") || 0, 10) - parseInt(e.currentItem.css("paddingBottom") || 0, 10)), n.width() || n.width(e.currentItem.innerWidth() - parseInt(e.currentItem.css("paddingLeft") || 0, 10) - parseInt(e.currentItem.css("paddingRight") || 0, 10))) } }), e.placeholder = t(s.placeholder.element.call(e.element, e.currentItem)), e.currentItem.after(e.placeholder), s.placeholder.update(e, e.placeholder) }, _contactContainers: function (s) { var n, o, a, r, h, l, c, u, d, p, f = null, g = null; for (n = this.containers.length - 1; n >= 0; n--) if (!t.contains(this.currentItem[0], this.containers[n].element[0])) if (this._intersectsWith(this.containers[n].containerCache)) { if (f && t.contains(this.containers[n].element[0], f.element[0])) continue; f = this.containers[n], g = n } else this.containers[n].containerCache.over && (this.containers[n]._trigger("out", s, this._uiHash(this)), this.containers[n].containerCache.over = 0); if (f) if (1 === this.containers.length) this.containers[g].containerCache.over || (this.containers[g]._trigger("over", s, this._uiHash(this)), this.containers[g].containerCache.over = 1); else { for (a = 1e4, r = null, p = f.floating || i(this.currentItem), h = p ? "left" : "top", l = p ? "width" : "height", c = this.positionAbs[h] + this.offset.click[h], o = this.items.length - 1; o >= 0; o--) t.contains(this.containers[g].element[0], this.items[o].item[0]) && this.items[o].item[0] !== this.currentItem[0] && (!p || e(this.positionAbs.top + this.offset.click.top, this.items[o].top, this.items[o].height)) && (u = this.items[o].item.offset()[h], d = !1, Math.abs(u - c) > Math.abs(u + this.items[o][l] - c) && (d = !0, u += this.items[o][l]), a > Math.abs(u - c) && (a = Math.abs(u - c), r = this.items[o], this.direction = d ? "up" : "down")); if (!r && !this.options.dropOnEmpty) return; if (this.currentContainer === this.containers[g]) return; r ? this._rearrange(s, r, null, !0) : this._rearrange(s, null, this.containers[g].element, !0), this._trigger("change", s, this._uiHash()), this.containers[g]._trigger("change", s, this._uiHash(this)), this.currentContainer = this.containers[g], this.options.placeholder.update(this.currentContainer, this.placeholder), this.containers[g]._trigger("over", s, this._uiHash(this)), this.containers[g].containerCache.over = 1 } }, _createHelper: function (e) { var i = this.options, s = t.isFunction(i.helper) ? t(i.helper.apply(this.element[0], [e, this.currentItem])) : "clone" === i.helper ? this.currentItem.clone() : this.currentItem; return s.parents("body").length || t("parent" !== i.appendTo ? i.appendTo : this.currentItem[0].parentNode)[0].appendChild(s[0]), s[0] === this.currentItem[0] && (this._storedCSS = { width: this.currentItem[0].style.width, height: this.currentItem[0].style.height, position: this.currentItem.css("position"), top: this.currentItem.css("top"), left: this.currentItem.css("left") }), (!s[0].style.width || i.forceHelperSize) && s.width(this.currentItem.width()), (!s[0].style.height || i.forceHelperSize) && s.height(this.currentItem.height()), s }, _adjustOffsetFromHelper: function (e) { "string" == typeof e && (e = e.split(" ")), t.isArray(e) && (e = { left: +e[0], top: +e[1] || 0 }), "left" in e && (this.offset.click.left = e.left + this.margins.left), "right" in e && (this.offset.click.left = this.helperProportions.width - e.right + this.margins.left), "top" in e && (this.offset.click.top = e.top + this.margins.top), "bottom" in e && (this.offset.click.top = this.helperProportions.height - e.bottom + this.margins.top) }, _getParentOffset: function () { this.offsetParent = this.helper.offsetParent(); var e = this.offsetParent.offset(); return "absolute" === this.cssPosition && this.scrollParent[0] !== document && t.contains(this.scrollParent[0], this.offsetParent[0]) && (e.left += this.scrollParent.scrollLeft(), e.top += this.scrollParent.scrollTop()), (this.offsetParent[0] === document.body || this.offsetParent[0].tagName && "html" === this.offsetParent[0].tagName.toLowerCase() && t.ui.ie) && (e = { top: 0, left: 0 }), { top: e.top + (parseInt(this.offsetParent.css("borderTopWidth"), 10) || 0), left: e.left + (parseInt(this.offsetParent.css("borderLeftWidth"), 10) || 0) } }, _getRelativeOffset: function () { if ("relative" === this.cssPosition) { var t = this.currentItem.position(); return { top: t.top - (parseInt(this.helper.css("top"), 10) || 0) + this.scrollParent.scrollTop(), left: t.left - (parseInt(this.helper.css("left"), 10) || 0) + this.scrollParent.scrollLeft() } } return { top: 0, left: 0 } }, _cacheMargins: function () { this.margins = { left: parseInt(this.currentItem.css("marginLeft"), 10) || 0, top: parseInt(this.currentItem.css("marginTop"), 10) || 0 } }, _cacheHelperProportions: function () { this.helperProportions = { width: this.helper.outerWidth(), height: this.helper.outerHeight() } }, _setContainment: function () { var e, i, s, n = this.options; "parent" === n.containment && (n.containment = this.helper[0].parentNode), ("document" === n.containment || "window" === n.containment) && (this.containment = [0 - this.offset.relative.left - this.offset.parent.left, 0 - this.offset.relative.top - this.offset.parent.top, t("document" === n.containment ? document : window).width() - this.helperProportions.width - this.margins.left, (t("document" === n.containment ? document : window).height() || document.body.parentNode.scrollHeight) - this.helperProportions.height - this.margins.top]), /^(document|window|parent)$/.test(n.containment) || (e = t(n.containment)[0], i = t(n.containment).offset(), s = "hidden" !== t(e).css("overflow"), this.containment = [i.left + (parseInt(t(e).css("borderLeftWidth"), 10) || 0) + (parseInt(t(e).css("paddingLeft"), 10) || 0) - this.margins.left, i.top + (parseInt(t(e).css("borderTopWidth"), 10) || 0) + (parseInt(t(e).css("paddingTop"), 10) || 0) - this.margins.top, i.left + (s ? Math.max(e.scrollWidth, e.offsetWidth) : e.offsetWidth) - (parseInt(t(e).css("borderLeftWidth"), 10) || 0) - (parseInt(t(e).css("paddingRight"), 10) || 0) - this.helperProportions.width - this.margins.left, i.top + (s ? Math.max(e.scrollHeight, e.offsetHeight) : e.offsetHeight) - (parseInt(t(e).css("borderTopWidth"), 10) || 0) - (parseInt(t(e).css("paddingBottom"), 10) || 0) - this.helperProportions.height - this.margins.top]) }, _convertPositionTo: function (e, i) { i || (i = this.position); var s = "absolute" === e ? 1 : -1, n = "absolute" !== this.cssPosition || this.scrollParent[0] !== document && t.contains(this.scrollParent[0], this.offsetParent[0]) ? this.scrollParent : this.offsetParent, o = /(html|body)/i.test(n[0].tagName); return { top: i.top + this.offset.relative.top * s + this.offset.parent.top * s - ("fixed" === this.cssPosition ? -this.scrollParent.scrollTop() : o ? 0 : n.scrollTop()) * s, left: i.left + this.offset.relative.left * s + this.offset.parent.left * s - ("fixed" === this.cssPosition ? -this.scrollParent.scrollLeft() : o ? 0 : n.scrollLeft()) * s } }, _generatePosition: function (e) { var i, s, n = this.options, o = e.pageX, a = e.pageY, r = "absolute" !== this.cssPosition || this.scrollParent[0] !== document && t.contains(this.scrollParent[0], this.offsetParent[0]) ? this.scrollParent : this.offsetParent, h = /(html|body)/i.test(r[0].tagName); return "relative" !== this.cssPosition || this.scrollParent[0] !== document && this.scrollParent[0] !== this.offsetParent[0] || (this.offset.relative = this._getRelativeOffset()), this.originalPosition && (this.containment && (e.pageX - this.offset.click.left < this.containment[0] && (o = this.containment[0] + this.offset.click.left), e.pageY - this.offset.click.top < this.containment[1] && (a = this.containment[1] + this.offset.click.top), e.pageX - this.offset.click.left > this.containment[2] && (o = this.containment[2] + this.offset.click.left), e.pageY - this.offset.click.top > this.containment[3] && (a = this.containment[3] + this.offset.click.top)), n.grid && (i = this.originalPageY + Math.round((a - this.originalPageY) / n.grid[1]) * n.grid[1], a = this.containment ? i - this.offset.click.top >= this.containment[1] && i - this.offset.click.top <= this.containment[3] ? i : i - this.offset.click.top >= this.containment[1] ? i - n.grid[1] : i + n.grid[1] : i, s = this.originalPageX + Math.round((o - this.originalPageX) / n.grid[0]) * n.grid[0], o = this.containment ? s - this.offset.click.left >= this.containment[0] && s - this.offset.click.left <= this.containment[2] ? s : s - this.offset.click.left >= this.containment[0] ? s - n.grid[0] : s + n.grid[0] : s)), { top: a - this.offset.click.top - this.offset.relative.top - this.offset.parent.top + ("fixed" === this.cssPosition ? -this.scrollParent.scrollTop() : h ? 0 : r.scrollTop()), left: o - this.offset.click.left - this.offset.relative.left - this.offset.parent.left + ("fixed" === this.cssPosition ? -this.scrollParent.scrollLeft() : h ? 0 : r.scrollLeft()) } }, _rearrange: function (t, e, i, s) { i ? i[0].appendChild(this.placeholder[0]) : e.item[0].parentNode.insertBefore(this.placeholder[0], "down" === this.direction ? e.item[0] : e.item[0].nextSibling), this.counter = this.counter ? ++this.counter : 1; var n = this.counter; this._delay(function () { n === this.counter && this.refreshPositions(!s) }) }, _clear: function (t, e) { function i(t, e, i) { return function (s) { i._trigger(t, s, e._uiHash(e)) } } this.reverting = !1; var s, n = []; if (!this._noFinalSort && this.currentItem.parent().length && this.placeholder.before(this.currentItem), this._noFinalSort = null, this.helper[0] === this.currentItem[0]) { for (s in this._storedCSS) ("auto" === this._storedCSS[s] || "static" === this._storedCSS[s]) && (this._storedCSS[s] = ""); this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper") } else this.currentItem.show(); for (this.fromOutside && !e && n.push(function (t) { this._trigger("receive", t, this._uiHash(this.fromOutside)) }), !this.fromOutside && this.domPosition.prev === this.currentItem.prev().not(".ui-sortable-helper")[0] && this.domPosition.parent === this.currentItem.parent()[0] || e || n.push(function (t) { this._trigger("update", t, this._uiHash()) }), this !== this.currentContainer && (e || (n.push(function (t) { this._trigger("remove", t, this._uiHash()) }), n.push(function (t) { return function (e) { t._trigger("receive", e, this._uiHash(this)) } }.call(this, this.currentContainer)), n.push(function (t) { return function (e) { t._trigger("update", e, this._uiHash(this)) } }.call(this, this.currentContainer)))), s = this.containers.length - 1; s >= 0; s--) e || n.push(i("deactivate", this, this.containers[s])), this.containers[s].containerCache.over && (n.push(i("out", this, this.containers[s])), this.containers[s].containerCache.over = 0); if (this.storedCursor && (this.document.find("body").css("cursor", this.storedCursor), this.storedStylesheet.remove()), this._storedOpacity && this.helper.css("opacity", this._storedOpacity), this._storedZIndex && this.helper.css("zIndex", "auto" === this._storedZIndex ? "" : this._storedZIndex), this.dragging = !1, this.cancelHelperRemoval) { if (!e) { for (this._trigger("beforeStop", t, this._uiHash()), s = 0; n.length > s; s++) n[s].call(this, t); this._trigger("stop", t, this._uiHash()) } return this.fromOutside = !1, !1 } if (e || this._trigger("beforeStop", t, this._uiHash()), this.placeholder[0].parentNode.removeChild(this.placeholder[0]), this.helper[0] !== this.currentItem[0] && this.helper.remove(), this.helper = null, !e) { for (s = 0; n.length > s; s++) n[s].call(this, t); this._trigger("stop", t, this._uiHash()) } return this.fromOutside = !1, !0 }, _trigger: function () { t.Widget.prototype._trigger.apply(this, arguments) === !1 && this.cancel() }, _uiHash: function (e) { var i = e || this; return { helper: i.helper, placeholder: i.placeholder || t([]), position: i.position, originalPosition: i.originalPosition, offset: i.positionAbs, item: i.currentItem, sender: e ? e.element : null } } }) })(jQuery); (function (t) { function e(t) { return function () { var e = this.element.val(); t.apply(this, arguments), this._refresh(), e !== this.element.val() && this._trigger("change") } } t.widget("ui.spinner", { version: "1.10.4", defaultElement: "<input>", widgetEventPrefix: "spin", options: { culture: null, icons: { down: "ui-icon-triangle-1-s", up: "ui-icon-triangle-1-n" }, incremental: !0, max: null, min: null, numberFormat: null, page: 10, step: 1, change: null, spin: null, start: null, stop: null }, _create: function () { this._setOption("max", this.options.max), this._setOption("min", this.options.min), this._setOption("step", this.options.step), "" !== this.value() && this._value(this.element.val(), !0), this._draw(), this._on(this._events), this._refresh(), this._on(this.window, { beforeunload: function () { this.element.removeAttr("autocomplete") } }) }, _getCreateOptions: function () { var e = {}, i = this.element; return t.each(["min", "max", "step"], function (t, s) { var n = i.attr(s); void 0 !== n && n.length && (e[s] = n) }), e }, _events: { keydown: function (t) { this._start(t) && this._keydown(t) && t.preventDefault() }, keyup: "_stop", focus: function () { this.previous = this.element.val() }, blur: function (t) { return this.cancelBlur ? (delete this.cancelBlur, void 0) : (this._stop(), this._refresh(), this.previous !== this.element.val() && this._trigger("change", t), void 0) }, mousewheel: function (t, e) { if (e) { if (!this.spinning && !this._start(t)) return !1; this._spin((e > 0 ? 1 : -1) * this.options.step, t), clearTimeout(this.mousewheelTimer), this.mousewheelTimer = this._delay(function () { this.spinning && this._stop(t) }, 100), t.preventDefault() } }, "mousedown .ui-spinner-button": function (e) { function i() { var t = this.element[0] === this.document[0].activeElement; t || (this.element.focus(), this.previous = s, this._delay(function () { this.previous = s })) } var s; s = this.element[0] === this.document[0].activeElement ? this.previous : this.element.val(), e.preventDefault(), i.call(this), this.cancelBlur = !0, this._delay(function () { delete this.cancelBlur, i.call(this) }), this._start(e) !== !1 && this._repeat(null, t(e.currentTarget).hasClass("ui-spinner-up") ? 1 : -1, e) }, "mouseup .ui-spinner-button": "_stop", "mouseenter .ui-spinner-button": function (e) { return t(e.currentTarget).hasClass("ui-state-active") ? this._start(e) === !1 ? !1 : (this._repeat(null, t(e.currentTarget).hasClass("ui-spinner-up") ? 1 : -1, e), void 0) : void 0 }, "mouseleave .ui-spinner-button": "_stop" }, _draw: function () { var t = this.uiSpinner = this.element.addClass("ui-spinner-input").attr("autocomplete", "off").wrap(this._uiSpinnerHtml()).parent().append(this._buttonHtml()); this.element.attr("role", "spinbutton"), this.buttons = t.find(".ui-spinner-button").attr("tabIndex", -1).button().removeClass("ui-corner-all"), this.buttons.height() > Math.ceil(.5 * t.height()) && t.height() > 0 && t.height(t.height()), this.options.disabled && this.disable() }, _keydown: function (e) { var i = this.options, s = t.ui.keyCode; switch (e.keyCode) { case s.UP: return this._repeat(null, 1, e), !0; case s.DOWN: return this._repeat(null, -1, e), !0; case s.PAGE_UP: return this._repeat(null, i.page, e), !0; case s.PAGE_DOWN: return this._repeat(null, -i.page, e), !0 } return !1 }, _uiSpinnerHtml: function () { return "<span class='ui-spinner ui-widget ui-widget-content ui-corner-all'></span>" }, _buttonHtml: function () { return "<a class='ui-spinner-button ui-spinner-up ui-corner-tr'><span class='ui-icon " + this.options.icons.up + "'>&#9650;</span>" + "</a>" + "<a class='ui-spinner-button ui-spinner-down ui-corner-br'>" + "<span class='ui-icon " + this.options.icons.down + "'>&#9660;</span>" + "</a>" }, _start: function (t) { return this.spinning || this._trigger("start", t) !== !1 ? (this.counter || (this.counter = 1), this.spinning = !0, !0) : !1 }, _repeat: function (t, e, i) { t = t || 500, clearTimeout(this.timer), this.timer = this._delay(function () { this._repeat(40, e, i) }, t), this._spin(e * this.options.step, i) }, _spin: function (t, e) { var i = this.value() || 0; this.counter || (this.counter = 1), i = this._adjustValue(i + t * this._increment(this.counter)), this.spinning && this._trigger("spin", e, { value: i }) === !1 || (this._value(i), this.counter++) }, _increment: function (e) { var i = this.options.incremental; return i ? t.isFunction(i) ? i(e) : Math.floor(e * e * e / 5e4 - e * e / 500 + 17 * e / 200 + 1) : 1 }, _precision: function () { var t = this._precisionOf(this.options.step); return null !== this.options.min && (t = Math.max(t, this._precisionOf(this.options.min))), t }, _precisionOf: function (t) { var e = "" + t, i = e.indexOf("."); return -1 === i ? 0 : e.length - i - 1 }, _adjustValue: function (t) { var e, i, s = this.options; return e = null !== s.min ? s.min : 0, i = t - e, i = Math.round(i / s.step) * s.step, t = e + i, t = parseFloat(t.toFixed(this._precision())), null !== s.max && t > s.max ? s.max : null !== s.min && s.min > t ? s.min : t }, _stop: function (t) { this.spinning && (clearTimeout(this.timer), clearTimeout(this.mousewheelTimer), this.counter = 0, this.spinning = !1, this._trigger("stop", t)) }, _setOption: function (t, e) { if ("culture" === t || "numberFormat" === t) { var i = this._parse(this.element.val()); return this.options[t] = e, this.element.val(this._format(i)), void 0 } ("max" === t || "min" === t || "step" === t) && "string" == typeof e && (e = this._parse(e)), "icons" === t && (this.buttons.first().find(".ui-icon").removeClass(this.options.icons.up).addClass(e.up), this.buttons.last().find(".ui-icon").removeClass(this.options.icons.down).addClass(e.down)), this._super(t, e), "disabled" === t && (e ? (this.element.prop("disabled", !0), this.buttons.button("disable")) : (this.element.prop("disabled", !1), this.buttons.button("enable"))) }, _setOptions: e(function (t) { this._super(t), this._value(this.element.val()) }), _parse: function (t) { return "string" == typeof t && "" !== t && (t = window.Globalize && this.options.numberFormat ? Globalize.parseFloat(t, 10, this.options.culture) : +t), "" === t || isNaN(t) ? null : t }, _format: function (t) { return "" === t ? "" : window.Globalize && this.options.numberFormat ? Globalize.format(t, this.options.numberFormat, this.options.culture) : t }, _refresh: function () { this.element.attr({ "aria-valuemin": this.options.min, "aria-valuemax": this.options.max, "aria-valuenow": this._parse(this.element.val()) }) }, _value: function (t, e) { var i; "" !== t && (i = this._parse(t), null !== i && (e || (i = this._adjustValue(i)), t = this._format(i))), this.element.val(t), this._refresh() }, _destroy: function () { this.element.removeClass("ui-spinner-input").prop("disabled", !1).removeAttr("autocomplete").removeAttr("role").removeAttr("aria-valuemin").removeAttr("aria-valuemax").removeAttr("aria-valuenow"), this.uiSpinner.replaceWith(this.element) }, stepUp: e(function (t) { this._stepUp(t) }), _stepUp: function (t) { this._start() && (this._spin((t || 1) * this.options.step), this._stop()) }, stepDown: e(function (t) { this._stepDown(t) }), _stepDown: function (t) { this._start() && (this._spin((t || 1) * -this.options.step), this._stop()) }, pageUp: e(function (t) { this._stepUp((t || 1) * this.options.page) }), pageDown: e(function (t) { this._stepDown((t || 1) * this.options.page) }), value: function (t) { return arguments.length ? (e(this._value).call(this, t), void 0) : this._parse(this.element.val()) }, widget: function () { return this.uiSpinner } }) })(jQuery); (function (t, e) { function i() { return ++n } function s(t) { return t = t.cloneNode(!1), t.hash.length > 1 && decodeURIComponent(t.href.replace(a, "")) === decodeURIComponent(location.href.replace(a, "")) } var n = 0, a = /#.*$/; t.widget("ui.tabs", { version: "1.10.4", delay: 300, options: { active: null, collapsible: !1, event: "click", heightStyle: "content", hide: null, show: null, activate: null, beforeActivate: null, beforeLoad: null, load: null }, _create: function () { var e = this, i = this.options; this.running = !1, this.element.addClass("ui-tabs ui-widget ui-widget-content ui-corner-all").toggleClass("ui-tabs-collapsible", i.collapsible).delegate(".ui-tabs-nav > li", "mousedown" + this.eventNamespace, function (e) { t(this).is(".ui-state-disabled") && e.preventDefault() }).delegate(".ui-tabs-anchor", "focus" + this.eventNamespace, function () { t(this).closest("li").is(".ui-state-disabled") && this.blur() }), this._processTabs(), i.active = this._initialActive(), t.isArray(i.disabled) && (i.disabled = t.unique(i.disabled.concat(t.map(this.tabs.filter(".ui-state-disabled"), function (t) { return e.tabs.index(t) }))).sort()), this.active = this.options.active !== !1 && this.anchors.length ? this._findActive(i.active) : t(), this._refresh(), this.active.length && this.load(i.active) }, _initialActive: function () { var i = this.options.active, s = this.options.collapsible, n = location.hash.substring(1); return null === i && (n && this.tabs.each(function (s, a) { return t(a).attr("aria-controls") === n ? (i = s, !1) : e }), null === i && (i = this.tabs.index(this.tabs.filter(".ui-tabs-active"))), (null === i || -1 === i) && (i = this.tabs.length ? 0 : !1)), i !== !1 && (i = this.tabs.index(this.tabs.eq(i)), -1 === i && (i = s ? !1 : 0)), !s && i === !1 && this.anchors.length && (i = 0), i }, _getCreateEventData: function () { return { tab: this.active, panel: this.active.length ? this._getPanelForTab(this.active) : t() } }, _tabKeydown: function (i) { var s = t(this.document[0].activeElement).closest("li"), n = this.tabs.index(s), a = !0; if (!this._handlePageNav(i)) { switch (i.keyCode) { case t.ui.keyCode.RIGHT: case t.ui.keyCode.DOWN: n++; break; case t.ui.keyCode.UP: case t.ui.keyCode.LEFT: a = !1, n--; break; case t.ui.keyCode.END: n = this.anchors.length - 1; break; case t.ui.keyCode.HOME: n = 0; break; case t.ui.keyCode.SPACE: return i.preventDefault(), clearTimeout(this.activating), this._activate(n), e; case t.ui.keyCode.ENTER: return i.preventDefault(), clearTimeout(this.activating), this._activate(n === this.options.active ? !1 : n), e; default: return } i.preventDefault(), clearTimeout(this.activating), n = this._focusNextTab(n, a), i.ctrlKey || (s.attr("aria-selected", "false"), this.tabs.eq(n).attr("aria-selected", "true"), this.activating = this._delay(function () { this.option("active", n) }, this.delay)) } }, _panelKeydown: function (e) { this._handlePageNav(e) || e.ctrlKey && e.keyCode === t.ui.keyCode.UP && (e.preventDefault(), this.active.focus()) }, _handlePageNav: function (i) { return i.altKey && i.keyCode === t.ui.keyCode.PAGE_UP ? (this._activate(this._focusNextTab(this.options.active - 1, !1)), !0) : i.altKey && i.keyCode === t.ui.keyCode.PAGE_DOWN ? (this._activate(this._focusNextTab(this.options.active + 1, !0)), !0) : e }, _findNextTab: function (e, i) { function s() { return e > n && (e = 0), 0 > e && (e = n), e } for (var n = this.tabs.length - 1; -1 !== t.inArray(s(), this.options.disabled) ;) e = i ? e + 1 : e - 1; return e }, _focusNextTab: function (t, e) { return t = this._findNextTab(t, e), this.tabs.eq(t).focus(), t }, _setOption: function (t, i) { return "active" === t ? (this._activate(i), e) : "disabled" === t ? (this._setupDisabled(i), e) : (this._super(t, i), "collapsible" === t && (this.element.toggleClass("ui-tabs-collapsible", i), i || this.options.active !== !1 || this._activate(0)), "event" === t && this._setupEvents(i), "heightStyle" === t && this._setupHeightStyle(i), e) }, _tabId: function (t) { return t.attr("aria-controls") || "ui-tabs-" + i() }, _sanitizeSelector: function (t) { return t ? t.replace(/[!"$%&'()*+,.\/:;<=>?@\[\]\^`{|}~]/g, "\\$&") : "" }, refresh: function () { var e = this.options, i = this.tablist.children(":has(a[href])"); e.disabled = t.map(i.filter(".ui-state-disabled"), function (t) { return i.index(t) }), this._processTabs(), e.active !== !1 && this.anchors.length ? this.active.length && !t.contains(this.tablist[0], this.active[0]) ? this.tabs.length === e.disabled.length ? (e.active = !1, this.active = t()) : this._activate(this._findNextTab(Math.max(0, e.active - 1), !1)) : e.active = this.tabs.index(this.active) : (e.active = !1, this.active = t()), this._refresh() }, _refresh: function () { this._setupDisabled(this.options.disabled), this._setupEvents(this.options.event), this._setupHeightStyle(this.options.heightStyle), this.tabs.not(this.active).attr({ "aria-selected": "false", tabIndex: -1 }), this.panels.not(this._getPanelForTab(this.active)).hide().attr({ "aria-expanded": "false", "aria-hidden": "true" }), this.active.length ? (this.active.addClass("ui-tabs-active ui-state-active").attr({ "aria-selected": "true", tabIndex: 0 }), this._getPanelForTab(this.active).show().attr({ "aria-expanded": "true", "aria-hidden": "false" })) : this.tabs.eq(0).attr("tabIndex", 0) }, _processTabs: function () { var e = this; this.tablist = this._getList().addClass("ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all").attr("role", "tablist"), this.tabs = this.tablist.find("> li:has(a[href])").addClass("ui-state-default ui-corner-top").attr({ role: "tab", tabIndex: -1 }), this.anchors = this.tabs.map(function () { return t("a", this)[0] }).addClass("ui-tabs-anchor").attr({ role: "presentation", tabIndex: -1 }), this.panels = t(), this.anchors.each(function (i, n) { var a, o, r, h = t(n).uniqueId().attr("id"), l = t(n).closest("li"), c = l.attr("aria-controls"); s(n) ? (a = n.hash, o = e.element.find(e._sanitizeSelector(a))) : (r = e._tabId(l), a = "#" + r, o = e.element.find(a), o.length || (o = e._createPanel(r), o.insertAfter(e.panels[i - 1] || e.tablist)), o.attr("aria-live", "polite")), o.length && (e.panels = e.panels.add(o)), c && l.data("ui-tabs-aria-controls", c), l.attr({ "aria-controls": a.substring(1), "aria-labelledby": h }), o.attr("aria-labelledby", h) }), this.panels.addClass("ui-tabs-panel ui-widget-content ui-corner-bottom").attr("role", "tabpanel") }, _getList: function () { return this.tablist || this.element.find("ol,ul").eq(0) }, _createPanel: function (e) { return t("<div>").attr("id", e).addClass("ui-tabs-panel ui-widget-content ui-corner-bottom").data("ui-tabs-destroy", !0) }, _setupDisabled: function (e) { t.isArray(e) && (e.length ? e.length === this.anchors.length && (e = !0) : e = !1); for (var i, s = 0; i = this.tabs[s]; s++) e === !0 || -1 !== t.inArray(s, e) ? t(i).addClass("ui-state-disabled").attr("aria-disabled", "true") : t(i).removeClass("ui-state-disabled").removeAttr("aria-disabled"); this.options.disabled = e }, _setupEvents: function (e) { var i = { click: function (t) { t.preventDefault() } }; e && t.each(e.split(" "), function (t, e) { i[e] = "_eventHandler" }), this._off(this.anchors.add(this.tabs).add(this.panels)), this._on(this.anchors, i), this._on(this.tabs, { keydown: "_tabKeydown" }), this._on(this.panels, { keydown: "_panelKeydown" }), this._focusable(this.tabs), this._hoverable(this.tabs) }, _setupHeightStyle: function (e) { var i, s = this.element.parent(); "fill" === e ? (i = s.height(), i -= this.element.outerHeight() - this.element.height(), this.element.siblings(":visible").each(function () { var e = t(this), s = e.css("position"); "absolute" !== s && "fixed" !== s && (i -= e.outerHeight(!0)) }), this.element.children().not(this.panels).each(function () { i -= t(this).outerHeight(!0) }), this.panels.each(function () { t(this).height(Math.max(0, i - t(this).innerHeight() + t(this).height())) }).css("overflow", "auto")) : "auto" === e && (i = 0, this.panels.each(function () { i = Math.max(i, t(this).height("").height()) }).height(i)) }, _eventHandler: function (e) { var i = this.options, s = this.active, n = t(e.currentTarget), a = n.closest("li"), o = a[0] === s[0], r = o && i.collapsible, h = r ? t() : this._getPanelForTab(a), l = s.length ? this._getPanelForTab(s) : t(), c = { oldTab: s, oldPanel: l, newTab: r ? t() : a, newPanel: h }; e.preventDefault(), a.hasClass("ui-state-disabled") || a.hasClass("ui-tabs-loading") || this.running || o && !i.collapsible || this._trigger("beforeActivate", e, c) === !1 || (i.active = r ? !1 : this.tabs.index(a), this.active = o ? t() : a, this.xhr && this.xhr.abort(), l.length || h.length || t.error("jQuery UI Tabs: Mismatching fragment identifier."), h.length && this.load(this.tabs.index(a), e), this._toggle(e, c)) }, _toggle: function (e, i) { function s() { a.running = !1, a._trigger("activate", e, i) } function n() { i.newTab.closest("li").addClass("ui-tabs-active ui-state-active"), o.length && a.options.show ? a._show(o, a.options.show, s) : (o.show(), s()) } var a = this, o = i.newPanel, r = i.oldPanel; this.running = !0, r.length && this.options.hide ? this._hide(r, this.options.hide, function () { i.oldTab.closest("li").removeClass("ui-tabs-active ui-state-active"), n() }) : (i.oldTab.closest("li").removeClass("ui-tabs-active ui-state-active"), r.hide(), n()), r.attr({ "aria-expanded": "false", "aria-hidden": "true" }), i.oldTab.attr("aria-selected", "false"), o.length && r.length ? i.oldTab.attr("tabIndex", -1) : o.length && this.tabs.filter(function () { return 0 === t(this).attr("tabIndex") }).attr("tabIndex", -1), o.attr({ "aria-expanded": "true", "aria-hidden": "false" }), i.newTab.attr({ "aria-selected": "true", tabIndex: 0 }) }, _activate: function (e) { var i, s = this._findActive(e); s[0] !== this.active[0] && (s.length || (s = this.active), i = s.find(".ui-tabs-anchor")[0], this._eventHandler({ target: i, currentTarget: i, preventDefault: t.noop })) }, _findActive: function (e) { return e === !1 ? t() : this.tabs.eq(e) }, _getIndex: function (t) { return "string" == typeof t && (t = this.anchors.index(this.anchors.filter("[href$='" + t + "']"))), t }, _destroy: function () { this.xhr && this.xhr.abort(), this.element.removeClass("ui-tabs ui-widget ui-widget-content ui-corner-all ui-tabs-collapsible"), this.tablist.removeClass("ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all").removeAttr("role"), this.anchors.removeClass("ui-tabs-anchor").removeAttr("role").removeAttr("tabIndex").removeUniqueId(), this.tabs.add(this.panels).each(function () { t.data(this, "ui-tabs-destroy") ? t(this).remove() : t(this).removeClass("ui-state-default ui-state-active ui-state-disabled ui-corner-top ui-corner-bottom ui-widget-content ui-tabs-active ui-tabs-panel").removeAttr("tabIndex").removeAttr("aria-live").removeAttr("aria-busy").removeAttr("aria-selected").removeAttr("aria-labelledby").removeAttr("aria-hidden").removeAttr("aria-expanded").removeAttr("role") }), this.tabs.each(function () { var e = t(this), i = e.data("ui-tabs-aria-controls"); i ? e.attr("aria-controls", i).removeData("ui-tabs-aria-controls") : e.removeAttr("aria-controls") }), this.panels.show(), "content" !== this.options.heightStyle && this.panels.css("height", "") }, enable: function (i) { var s = this.options.disabled; s !== !1 && (i === e ? s = !1 : (i = this._getIndex(i), s = t.isArray(s) ? t.map(s, function (t) { return t !== i ? t : null }) : t.map(this.tabs, function (t, e) { return e !== i ? e : null })), this._setupDisabled(s)) }, disable: function (i) { var s = this.options.disabled; if (s !== !0) { if (i === e) s = !0; else { if (i = this._getIndex(i), -1 !== t.inArray(i, s)) return; s = t.isArray(s) ? t.merge([i], s).sort() : [i] } this._setupDisabled(s) } }, load: function (e, i) { e = this._getIndex(e); var n = this, a = this.tabs.eq(e), o = a.find(".ui-tabs-anchor"), r = this._getPanelForTab(a), h = { tab: a, panel: r }; s(o[0]) || (this.xhr = t.ajax(this._ajaxSettings(o, i, h)), this.xhr && "canceled" !== this.xhr.statusText && (a.addClass("ui-tabs-loading"), r.attr("aria-busy", "true"), this.xhr.success(function (t) { setTimeout(function () { r.html(t), n._trigger("load", i, h) }, 1) }).complete(function (t, e) { setTimeout(function () { "abort" === e && n.panels.stop(!1, !0), a.removeClass("ui-tabs-loading"), r.removeAttr("aria-busy"), t === n.xhr && delete n.xhr }, 1) }))) }, _ajaxSettings: function (e, i, s) { var n = this; return { url: e.attr("href"), beforeSend: function (e, a) { return n._trigger("beforeLoad", i, t.extend({ jqXHR: e, ajaxSettings: a }, s)) } } }, _getPanelForTab: function (e) { var i = t(e).attr("aria-controls"); return this.element.find(this._sanitizeSelector("#" + i)) } }) })(jQuery); (function (t) { function e(e, i) { var s = (e.attr("aria-describedby") || "").split(/\s+/); s.push(i), e.data("ui-tooltip-id", i).attr("aria-describedby", t.trim(s.join(" "))) } function i(e) { var i = e.data("ui-tooltip-id"), s = (e.attr("aria-describedby") || "").split(/\s+/), n = t.inArray(i, s); -1 !== n && s.splice(n, 1), e.removeData("ui-tooltip-id"), s = t.trim(s.join(" ")), s ? e.attr("aria-describedby", s) : e.removeAttr("aria-describedby") } var s = 0; t.widget("ui.tooltip", { version: "1.10.4", options: { content: function () { var e = t(this).attr("title") || ""; return t("<a>").text(e).html() }, hide: !0, items: "[title]:not([disabled])", position: { my: "left top+15", at: "left bottom", collision: "flipfit flip" }, show: !0, tooltipClass: null, track: !1, close: null, open: null }, _create: function () { this._on({ mouseover: "open", focusin: "open" }), this.tooltips = {}, this.parents = {}, this.options.disabled && this._disable() }, _setOption: function (e, i) { var s = this; return "disabled" === e ? (this[i ? "_disable" : "_enable"](), this.options[e] = i, void 0) : (this._super(e, i), "content" === e && t.each(this.tooltips, function (t, e) { s._updateContent(e) }), void 0) }, _disable: function () { var e = this; t.each(this.tooltips, function (i, s) { var n = t.Event("blur"); n.target = n.currentTarget = s[0], e.close(n, !0) }), this.element.find(this.options.items).addBack().each(function () { var e = t(this); e.is("[title]") && e.data("ui-tooltip-title", e.attr("title")).attr("title", "") }) }, _enable: function () { this.element.find(this.options.items).addBack().each(function () { var e = t(this); e.data("ui-tooltip-title") && e.attr("title", e.data("ui-tooltip-title")) }) }, open: function (e) { var i = this, s = t(e ? e.target : this.element).closest(this.options.items); s.length && !s.data("ui-tooltip-id") && (s.attr("title") && s.data("ui-tooltip-title", s.attr("title")), s.data("ui-tooltip-open", !0), e && "mouseover" === e.type && s.parents().each(function () { var e, s = t(this); s.data("ui-tooltip-open") && (e = t.Event("blur"), e.target = e.currentTarget = this, i.close(e, !0)), s.attr("title") && (s.uniqueId(), i.parents[this.id] = { element: this, title: s.attr("title") }, s.attr("title", "")) }), this._updateContent(s, e)) }, _updateContent: function (t, e) { var i, s = this.options.content, n = this, o = e ? e.type : null; return "string" == typeof s ? this._open(e, t, s) : (i = s.call(t[0], function (i) { t.data("ui-tooltip-open") && n._delay(function () { e && (e.type = o), this._open(e, t, i) }) }), i && this._open(e, t, i), void 0) }, _open: function (i, s, n) { function o(t) { l.of = t, a.is(":hidden") || a.position(l) } var a, r, h, l = t.extend({}, this.options.position); if (n) { if (a = this._find(s), a.length) return a.find(".ui-tooltip-content").html(n), void 0; s.is("[title]") && (i && "mouseover" === i.type ? s.attr("title", "") : s.removeAttr("title")), a = this._tooltip(s), e(s, a.attr("id")), a.find(".ui-tooltip-content").html(n), this.options.track && i && /^mouse/.test(i.type) ? (this._on(this.document, { mousemove: o }), o(i)) : a.position(t.extend({ of: s }, this.options.position)), a.hide(), this._show(a, this.options.show), this.options.show && this.options.show.delay && (h = this.delayedShow = setInterval(function () { a.is(":visible") && (o(l.of), clearInterval(h)) }, t.fx.interval)), this._trigger("open", i, { tooltip: a }), r = { keyup: function (e) { if (e.keyCode === t.ui.keyCode.ESCAPE) { var i = t.Event(e); i.currentTarget = s[0], this.close(i, !0) } }, remove: function () { this._removeTooltip(a) } }, i && "mouseover" !== i.type || (r.mouseleave = "close"), i && "focusin" !== i.type || (r.focusout = "close"), this._on(!0, s, r) } }, close: function (e) { var s = this, n = t(e ? e.currentTarget : this.element), o = this._find(n); this.closing || (clearInterval(this.delayedShow), n.data("ui-tooltip-title") && n.attr("title", n.data("ui-tooltip-title")), i(n), o.stop(!0), this._hide(o, this.options.hide, function () { s._removeTooltip(t(this)) }), n.removeData("ui-tooltip-open"), this._off(n, "mouseleave focusout keyup"), n[0] !== this.element[0] && this._off(n, "remove"), this._off(this.document, "mousemove"), e && "mouseleave" === e.type && t.each(this.parents, function (e, i) { t(i.element).attr("title", i.title), delete s.parents[e] }), this.closing = !0, this._trigger("close", e, { tooltip: o }), this.closing = !1) }, _tooltip: function (e) { var i = "ui-tooltip-" + s++, n = t("<div>").attr({ id: i, role: "tooltip" }).addClass("ui-tooltip ui-widget ui-corner-all ui-widget-content " + (this.options.tooltipClass || "")); return t("<div>").addClass("ui-tooltip-content").appendTo(n), n.appendTo(this.document[0].body), this.tooltips[i] = e, n }, _find: function (e) { var i = e.data("ui-tooltip-id"); return i ? t("#" + i) : t() }, _removeTooltip: function (t) { t.remove(), delete this.tooltips[t.attr("id")] }, _destroy: function () { var e = this; t.each(this.tooltips, function (i, s) { var n = t.Event("blur"); n.target = n.currentTarget = s[0], e.close(n, !0), t("#" + i).remove(), s.data("ui-tooltip-title") && (s.attr("title", s.data("ui-tooltip-title")), s.removeData("ui-tooltip-title")) }) } }) })(jQuery);
/* ]]> */
						</script><script type="text/javascript">
							/* <![CDATA[ */
/*
 * File:        jquery.dataTables.js
 * Version:     1.8.1
 * Description: Paginate, search and sort HTML tables
 * Author:      Allan Jardine (www.sprymedia.co.uk)
 * Created:     28/3/2008
 * Language:    Javascript
 * License:     GPL v2 or BSD 3 point style
 * Project:     Mtaala
 * Contact:     allan.jardine@sprymedia.co.uk
 *
 * Copyright 2008-2011 Allan Jardine, all rights reserved.
 *
 * This source file is free software, under either the GPL v2 license or a
 * BSD style license, as supplied with this software.
 *
 * This source file is distributed in the hope that it will be useful, but
 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
 * or FITNESS FOR A PARTICULAR PURPOSE. See the license files for details.
 *
 * For details please refer to: http://www.datatables.net
 */

/*
 * When considering jsLint, we need to allow eval() as it it is used for reading cookies
 */
/*jslint evil: true, undef: true, browser: true */
/*globals $, jQuery,_fnExternApiFunc,_fnInitalise,_fnInitComplete,_fnLanguageProcess,_fnAddColumn,_fnColumnOptions,_fnAddData,_fnCreateTr,_fnGatherData,_fnBuildHead,_fnDrawHead,_fnDraw,_fnReDraw,_fnAjaxUpdate,_fnAjaxUpdateDraw,_fnAddOptionsHtml,_fnFeatureHtmlTable,_fnScrollDraw,_fnAjustColumnSizing,_fnFeatureHtmlFilter,_fnFilterComplete,_fnFilterCustom,_fnFilterColumn,_fnFilter,_fnBuildSearchArray,_fnBuildSearchRow,_fnFilterCreateSearch,_fnDataToSearch,_fnSort,_fnSortAttachListener,_fnSortingClasses,_fnFeatureHtmlPaginate,_fnPageChange,_fnFeatureHtmlInfo,_fnUpdateInfo,_fnFeatureHtmlLength,_fnFeatureHtmlProcessing,_fnProcessingDisplay,_fnVisibleToColumnIndex,_fnColumnIndexToVisible,_fnNodeToDataIndex,_fnVisbleColumns,_fnCalculateEnd,_fnConvertToWidth,_fnCalculateColumnWidths,_fnScrollingWidthAdjust,_fnGetWidestNode,_fnGetMaxLenString,_fnStringToCss,_fnArrayCmp,_fnDetectType,_fnSettingsFromNode,_fnGetDataMaster,_fnGetTrNodes,_fnGetTdNodes,_fnEscapeRegex,_fnDeleteIndex,_fnReOrderIndex,_fnColumnOrdering,_fnLog,_fnClearTable,_fnSaveState,_fnLoadState,_fnCreateCookie,_fnReadCookie,_fnDetectHeader,_fnGetUniqueThs,_fnScrollBarWidth,_fnApplyToChildren,_fnMap,_fnGetRowData,_fnGetCellData,_fnSetCellData,_fnGetObjectDataFn,_fnSetObjectDataFn*/

(function($, window, document) {
	/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
	 * Section - DataTables variables
	 * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */

	/*
	 * Variable: dataTableSettings
	 * Purpose:  Store the settings for each dataTables instance
	 * Scope:    jQuery.fn
	 */
	$.fn.dataTableSettings = [];
	var _aoSettings = $.fn.dataTableSettings; /* Short reference for fast internal lookup */

	/*
	 * Variable: dataTableExt
	 * Purpose:  Container for customisable parts of DataTables
	 * Scope:    jQuery.fn
	 */
	$.fn.dataTableExt = {};
	var _oExt = $.fn.dataTableExt;


	/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
	 * Section - DataTables extensible objects
	 *
	 * The _oExt object is used to provide an area where user dfined plugins can be
	 * added to DataTables. The following properties of the object are used:
	 *   oApi - Plug-in API functions
	 *   aTypes - Auto-detection of types
	 *   oSort - Sorting functions used by DataTables (based on the type)
	 *   oPagination - Pagination functions for different input styles
	 * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */

	/*
	 * Variable: sVersion
	 * Purpose:  Version string for plug-ins to check compatibility
	 * Scope:    jQuery.fn.dataTableExt
	 * Notes:    Allowed format is a.b.c.d.e where:
	 *   a:int, b:int, c:int, d:string(dev|beta), e:int. d and e are optional
	 */
	_oExt.sVersion = "1.8.1";

	/*
	 * Variable: sErrMode
	 * Purpose:  How should DataTables report an error. Can take the value 'alert' or 'throw'
	 * Scope:    jQuery.fn.dataTableExt
	 */
	_oExt.sErrMode = "alert";

	/*
	 * Variable: iApiIndex
	 * Purpose:  Index for what 'this' index API functions should use
	 * Scope:    jQuery.fn.dataTableExt
	 */
	_oExt.iApiIndex = 0;

	/*
	 * Variable: oApi
	 * Purpose:  Container for plugin API functions
	 * Scope:    jQuery.fn.dataTableExt
	 */
	_oExt.oApi = { };

	/*
	 * Variable: aFiltering
	 * Purpose:  Container for plugin filtering functions
	 * Scope:    jQuery.fn.dataTableExt
	 */
	_oExt.afnFiltering = [ ];

	/*
	 * Variable: aoFeatures
	 * Purpose:  Container for plugin function functions
	 * Scope:    jQuery.fn.dataTableExt
	 * Notes:    Array of objects with the following parameters:
	 *   fnInit: Function for initialisation of Feature. Takes oSettings and returns node
	 *   cFeature: Character that will be matched in sDom - case sensitive
	 *   sFeature: Feature name - just for completeness :-)
	 */
	_oExt.aoFeatures = [ ];

	/*
	 * Variable: ofnSearch
	 * Purpose:  Container for custom filtering functions
	 * Scope:    jQuery.fn.dataTableExt
	 * Notes:    This is an object (the name should match the type) for custom filtering function,
	 *   which can be used for live DOM checking or formatted text filtering
	 */
	_oExt.ofnSearch = { };

	/*
	 * Variable: afnSortData
	 * Purpose:  Container for custom sorting data source functions
	 * Scope:    jQuery.fn.dataTableExt
	 * Notes:    Array (associative) of functions which is run prior to a column of this
	 *   'SortDataType' being sorted upon.
	 *   Function input parameters:
	 *     object:oSettings-  DataTables settings object
	 *     int:iColumn - Target column number
	 *   Return value: Array of data which exactly matched the full data set size for the column to
	 *     be sorted upon
	 */
	_oExt.afnSortData = [ ];

	/*
	 * Variable: oStdClasses
	 * Purpose:  Storage for the various classes that DataTables uses
	 * Scope:    jQuery.fn.dataTableExt
	 */
	_oExt.oStdClasses = {
		/* Two buttons buttons */
		"sPagePrevEnabled": "paginate_enabled_previous",
		"sPagePrevDisabled": "paginate_disabled_previous",
		"sPageNextEnabled": "paginate_enabled_next",
		"sPageNextDisabled": "paginate_disabled_next",
		"sPageJUINext": "",
		"sPageJUIPrev": "",

		/* Full numbers paging buttons */
		"sPageButton": "paginate_button",
		"sPageButtonActive": "paginate_active",
		"sPageButtonStaticDisabled": "paginate_button paginate_button_disabled",
		"sPageFirst": "first",
		"sPagePrevious": "previous",
		"sPageNext": "next",
		"sPageLast": "last",

		/* Stripping classes */
		"sStripOdd": "odd",
		"sStripEven": "even",

		/* Empty row */
		"sRowEmpty": "dataTables_empty",

		/* Features */
		"sWrapper": "dataTables_wrapper",
		"sFilter": "dataTables_filter",
		"sInfo": "dataTables_info",
		"sPaging": "dataTables_paginate paging_", /* Note that the type is postfixed */
		"sLength": "dataTables_length",
		"sProcessing": "dataTables_processing",

		/* Sorting */
		"sSortAsc": "sorting_asc",
		"sSortDesc": "sorting_desc",
		"sSortable": "sorting", /* Sortable in both directions */
		"sSortableAsc": "sorting_asc_disabled",
		"sSortableDesc": "sorting_desc_disabled",
		"sSortableNone": "sorting_disabled",
		"sSortColumn": "sorting_", /* Note that an int is postfixed for the sorting order */
		"sSortJUIAsc": "",
		"sSortJUIDesc": "",
		"sSortJUI": "",
		"sSortJUIAscAllowed": "",
		"sSortJUIDescAllowed": "",
		"sSortJUIWrapper": "",
		"sSortIcon": "",

		/* Scrolling */
		"sScrollWrapper": "dataTables_scroll",
		"sScrollHead": "dataTables_scrollHead",
		"sScrollHeadInner": "dataTables_scrollHeadInner",
		"sScrollBody": "dataTables_scrollBody",
		"sScrollFoot": "dataTables_scrollFoot",
		"sScrollFootInner": "dataTables_scrollFootInner",

		/* Misc */
		"sFooterTH": ""
	};

	/*
	 * Variable: oJUIClasses
	 * Purpose:  Storage for the various classes that DataTables uses - jQuery UI suitable
	 * Scope:    jQuery.fn.dataTableExt
	 */
	_oExt.oJUIClasses = {
		/* Two buttons buttons */
		"sPagePrevEnabled": "fg-button ui-button ui-state-default ui-corner-left",
		"sPagePrevDisabled": "fg-button ui-button ui-state-default ui-corner-left ui-state-disabled",
		"sPageNextEnabled": "fg-button ui-button ui-state-default ui-corner-right",
		"sPageNextDisabled": "fg-button ui-button ui-state-default ui-corner-right ui-state-disabled",
		"sPageJUINext": "ui-icon ui-icon-circle-arrow-e",
		"sPageJUIPrev": "ui-icon ui-icon-circle-arrow-w",

		/* Full numbers paging buttons */
		"sPageButton": "fg-button ui-button ui-state-default",
		"sPageButtonActive": "fg-button ui-button ui-state-default ui-state-disabled",
		"sPageButtonStaticDisabled": "fg-button ui-button ui-state-default ui-state-disabled",
		"sPageFirst": "first ui-corner-tl ui-corner-bl",
		"sPagePrevious": "previous",
		"sPageNext": "next",
		"sPageLast": "last ui-corner-tr ui-corner-br",

		/* Stripping classes */
		"sStripOdd": "odd",
		"sStripEven": "even",

		/* Empty row */
		"sRowEmpty": "dataTables_empty",

		/* Features */
		"sWrapper": "dataTables_wrapper",
		"sFilter": "dataTables_filter",
		"sInfo": "dataTables_info",
		"sPaging": "dataTables_paginate fg-buttonset ui-buttonset fg-buttonset-multi "+
			"ui-buttonset-multi paging_", /* Note that the type is postfixed */
		"sLength": "dataTables_length",
		"sProcessing": "dataTables_processing",

		/* Sorting */
		"sSortAsc": "ui-state-default",
		"sSortDesc": "ui-state-default",
		"sSortable": "ui-state-default",
		"sSortableAsc": "ui-state-default",
		"sSortableDesc": "ui-state-default",
		"sSortableNone": "ui-state-default",
		"sSortColumn": "sorting_", /* Note that an int is postfixed for the sorting order */
		"sSortJUIAsc": "css_right ui-icon ui-icon-triangle-1-n",
		"sSortJUIDesc": "css_right ui-icon ui-icon-triangle-1-s",
		"sSortJUI": "css_right ui-icon ui-icon-carat-2-n-s",
		"sSortJUIAscAllowed": "css_right ui-icon ui-icon-carat-1-n",
		"sSortJUIDescAllowed": "css_right ui-icon ui-icon-carat-1-s",
		"sSortJUIWrapper": "DataTables_sort_wrapper",
		"sSortIcon": "DataTables_sort_icon",

		/* Scrolling */
		"sScrollWrapper": "dataTables_scroll",
		"sScrollHead": "dataTables_scrollHead ui-state-default",
		"sScrollHeadInner": "dataTables_scrollHeadInner",
		"sScrollBody": "dataTables_scrollBody",
		"sScrollFoot": "dataTables_scrollFoot ui-state-default",
		"sScrollFootInner": "dataTables_scrollFootInner",

		/* Misc */
		"sFooterTH": "ui-state-default"
	};

	/*
	 * Variable: oPagination
	 * Purpose:  Container for the various type of pagination that dataTables supports
	 * Scope:    jQuery.fn.dataTableExt
	 */
	_oExt.oPagination = {
		/*
		 * Variable: two_button
		 * Purpose:  Standard two button (forward/back) pagination
		 * Scope:    jQuery.fn.dataTableExt.oPagination
		 */
		"two_button": {
			/*
			 * Function: oPagination.two_button.fnInit
			 * Purpose:  Initalise dom elements required for pagination with forward/back buttons only
			 * Returns:  -
			 * Inputs:   object:oSettings - dataTables settings object
			 *           node:nPaging - the DIV which contains this pagination control
			 *           function:fnCallbackDraw - draw function which must be called on update
			 */
			"fnInit": function ( oSettings, nPaging, fnCallbackDraw )
			{
				var nPrevious, nNext, nPreviousInner, nNextInner;

				/* Store the next and previous elements in the oSettings object as they can be very
				 * usful for automation - particularly testing
				 */
				if ( !oSettings.bJUI )
				{
					nPrevious = document.createElement( 'div' );
					nNext = document.createElement( 'div' );
				}
				else
				{
					nPrevious = document.createElement( 'a' );
					nNext = document.createElement( 'a' );

					nNextInner = document.createElement('span');
					nNextInner.className = oSettings.oClasses.sPageJUINext;
					nNext.appendChild( nNextInner );

					nPreviousInner = document.createElement('span');
					nPreviousInner.className = oSettings.oClasses.sPageJUIPrev;
					nPrevious.appendChild( nPreviousInner );
				}

				nPrevious.className = oSettings.oClasses.sPagePrevDisabled;
				nNext.className = oSettings.oClasses.sPageNextDisabled;

				nPrevious.title = oSettings.oLanguage.oPaginate.sPrevious;
				nNext.title = oSettings.oLanguage.oPaginate.sNext;

				nPaging.appendChild( nPrevious );
				nPaging.appendChild( nNext );

				$(nPrevious).bind( 'click.DT', function() {
					if ( oSettings.oApi._fnPageChange( oSettings, "previous" ) )
					{
						/* Only draw when the page has actually changed */
						fnCallbackDraw( oSettings );
					}
				} );

				$(nNext).bind( 'click.DT', function() {
					if ( oSettings.oApi._fnPageChange( oSettings, "next" ) )
					{
						fnCallbackDraw( oSettings );
					}
				} );

				/* Take the brutal approach to cancelling text selection */
				$(nPrevious).bind( 'selectstart.DT', function () { return false; } );
				$(nNext).bind( 'selectstart.DT', function () { return false; } );

				/* ID the first elements only */
				if ( oSettings.sTableId !== '' && typeof oSettings.aanFeatures.p == "undefined" )
				{
					nPaging.setAttribute( 'id', oSettings.sTableId+'_paginate' );
					nPrevious.setAttribute( 'id', oSettings.sTableId+'_previous' );
					nNext.setAttribute( 'id', oSettings.sTableId+'_next' );
				}
			},

			/*
			 * Function: oPagination.two_button.fnUpdate
			 * Purpose:  Update the two button pagination at the end of the draw
			 * Returns:  -
			 * Inputs:   object:oSettings - dataTables settings object
			 *           function:fnCallbackDraw - draw function to call on page change
			 */
			"fnUpdate": function ( oSettings, fnCallbackDraw )
			{
				if ( !oSettings.aanFeatures.p )
				{
					return;
				}

				/* Loop over each instance of the pager */
				var an = oSettings.aanFeatures.p;
				for ( var i=0, iLen=an.length ; i<iLen ; i++ )
				{
					if ( an[i].childNodes.length !== 0 )
					{
						an[i].childNodes[0].className =
							( oSettings._iDisplayStart === 0 ) ?
							oSettings.oClasses.sPagePrevDisabled : oSettings.oClasses.sPagePrevEnabled;

						an[i].childNodes[1].className =
							( oSettings.fnDisplayEnd() == oSettings.fnRecordsDisplay() ) ?
							oSettings.oClasses.sPageNextDisabled : oSettings.oClasses.sPageNextEnabled;
					}
				}
			}
		},


		/*
		 * Variable: iFullNumbersShowPages
		 * Purpose:  Change the number of pages which can be seen
		 * Scope:    jQuery.fn.dataTableExt.oPagination
		 */
		"iFullNumbersShowPages": 5,

		/*
		 * Variable: full_numbers
		 * Purpose:  Full numbers pagination
		 * Scope:    jQuery.fn.dataTableExt.oPagination
		 */
		"full_numbers": {
			/*
			 * Function: oPagination.full_numbers.fnInit
			 * Purpose:  Initalise dom elements required for pagination with a list of the pages
			 * Returns:  -
			 * Inputs:   object:oSettings - dataTables settings object
			 *           node:nPaging - the DIV which contains this pagination control
			 *           function:fnCallbackDraw - draw function which must be called on update
			 */
			"fnInit": function ( oSettings, nPaging, fnCallbackDraw )
			{
				var nFirst = document.createElement( 'span' );
				var nPrevious = document.createElement( 'span' );
				var nList = document.createElement( 'span' );
				var nNext = document.createElement( 'span' );
				var nLast = document.createElement( 'span' );

				nFirst.innerHTML = oSettings.oLanguage.oPaginate.sFirst;
				nPrevious.innerHTML = oSettings.oLanguage.oPaginate.sPrevious;
				nNext.innerHTML = oSettings.oLanguage.oPaginate.sNext;
				nLast.innerHTML = oSettings.oLanguage.oPaginate.sLast;

				var oClasses = oSettings.oClasses;
				nFirst.className = oClasses.sPageButton+" "+oClasses.sPageFirst;
				nPrevious.className = oClasses.sPageButton+" "+oClasses.sPagePrevious;
				nNext.className= oClasses.sPageButton+" "+oClasses.sPageNext;
				nLast.className = oClasses.sPageButton+" "+oClasses.sPageLast;

				nPaging.appendChild( nFirst );
				nPaging.appendChild( nPrevious );
				nPaging.appendChild( nList );
				nPaging.appendChild( nNext );
				nPaging.appendChild( nLast );

				$(nFirst).bind( 'click.DT', function () {
					if ( oSettings.oApi._fnPageChange( oSettings, "first" ) )
					{
						fnCallbackDraw( oSettings );
					}
				} );

				$(nPrevious).bind( 'click.DT', function() {
					if ( oSettings.oApi._fnPageChange( oSettings, "previous" ) )
					{
						fnCallbackDraw( oSettings );
					}
				} );

				$(nNext).bind( 'click.DT', function() {
					if ( oSettings.oApi._fnPageChange( oSettings, "next" ) )
					{
						fnCallbackDraw( oSettings );
					}
				} );

				$(nLast).bind( 'click.DT', function() {
					if ( oSettings.oApi._fnPageChange( oSettings, "last" ) )
					{
						fnCallbackDraw( oSettings );
					}
				} );

				/* Take the brutal approach to cancelling text selection */
				$('span', nPaging)
					.bind( 'mousedown.DT', function () { return false; } )
					.bind( 'selectstart.DT', function () { return false; } );

				/* ID the first elements only */
				if ( oSettings.sTableId !== '' && typeof oSettings.aanFeatures.p == "undefined" )
				{
					nPaging.setAttribute( 'id', oSettings.sTableId+'_paginate' );
					nFirst.setAttribute( 'id', oSettings.sTableId+'_first' );
					nPrevious.setAttribute( 'id', oSettings.sTableId+'_previous' );
					nNext.setAttribute( 'id', oSettings.sTableId+'_next' );
					nLast.setAttribute( 'id', oSettings.sTableId+'_last' );
				}
			},

			/*
			 * Function: oPagination.full_numbers.fnUpdate
			 * Purpose:  Update the list of page buttons shows
			 * Returns:  -
			 * Inputs:   object:oSettings - dataTables settings object
			 *           function:fnCallbackDraw - draw function to call on page change
			 */
			"fnUpdate": function ( oSettings, fnCallbackDraw )
			{
				if ( !oSettings.aanFeatures.p )
				{
					return;
				}

				var iPageCount = _oExt.oPagination.iFullNumbersShowPages;
				var iPageCountHalf = Math.floor(iPageCount / 2);
				var iPages = Math.ceil((oSettings.fnRecordsDisplay()) / oSettings._iDisplayLength);
				var iCurrentPage = Math.ceil(oSettings._iDisplayStart / oSettings._iDisplayLength) + 1;
				var sList = "";
				var iStartButton, iEndButton, i, iLen;
				var oClasses = oSettings.oClasses;

				/* Pages calculation */
				if (iPages < iPageCount)
				{
					iStartButton = 1;
					iEndButton = iPages;
				}
				else
				{
					if (iCurrentPage <= iPageCountHalf)
					{
						iStartButton = 1;
						iEndButton = iPageCount;
					}
					else
					{
						if (iCurrentPage >= (iPages - iPageCountHalf))
						{
							iStartButton = iPages - iPageCount + 1;
							iEndButton = iPages;
						}
						else
						{
							iStartButton = iCurrentPage - Math.ceil(iPageCount / 2) + 1;
							iEndButton = iStartButton + iPageCount - 1;
						}
					}
				}

				/* Build the dynamic list */
				for ( i=iStartButton ; i<=iEndButton ; i++ )
				{
					if ( iCurrentPage != i )
					{
						sList += '<span class="'+oClasses.sPageButton+'">'+i+'</span>';
					}
					else
					{
						sList += '<span class="'+oClasses.sPageButtonActive+'">'+i+'</span>';
					}
				}

				/* Loop over each instance of the pager */
				var an = oSettings.aanFeatures.p;
				var anButtons, anStatic, nPaginateList;
				var fnClick = function(e) {
					/* Use the information in the element to jump to the required page */
					var iTarget = (this.innerHTML * 1) - 1;
					oSettings._iDisplayStart = iTarget * oSettings._iDisplayLength;
					fnCallbackDraw( oSettings );
					e.preventDefault();
				};
				var fnFalse = function () { return false; };

				for ( i=0, iLen=an.length ; i<iLen ; i++ )
				{
					if ( an[i].childNodes.length === 0 )
					{
						continue;
					}

					/* Build up the dynamic list forst - html and listeners */
					var qjPaginateList = $('span:eq(2)', an[i]);
					qjPaginateList.html( sList );
					$('span', qjPaginateList).bind( 'click.DT', fnClick ).bind( 'mousedown.DT', fnFalse )
						.bind( 'selectstart.DT', fnFalse );

					/* Update the 'premanent botton's classes */
					anButtons = an[i].getElementsByTagName('span');
					anStatic = [
						anButtons[0], anButtons[1],
						anButtons[anButtons.length-2], anButtons[anButtons.length-1]
					];
					$(anStatic).removeClass( oClasses.sPageButton+" "+oClasses.sPageButtonActive+" "+oClasses.sPageButtonStaticDisabled );
					if ( iCurrentPage == 1 )
					{
						anStatic[0].className += " "+oClasses.sPageButtonStaticDisabled;
						anStatic[1].className += " "+oClasses.sPageButtonStaticDisabled;
					}
					else
					{
						anStatic[0].className += " "+oClasses.sPageButton;
						anStatic[1].className += " "+oClasses.sPageButton;
					}

					if ( iPages === 0 || iCurrentPage == iPages || oSettings._iDisplayLength == -1 )
					{
						anStatic[2].className += " "+oClasses.sPageButtonStaticDisabled;
						anStatic[3].className += " "+oClasses.sPageButtonStaticDisabled;
					}
					else
					{
						anStatic[2].className += " "+oClasses.sPageButton;
						anStatic[3].className += " "+oClasses.sPageButton;
					}
				}
			}
		}
	};

	/*
	 * Variable: oSort
	 * Purpose:  Wrapper for the sorting functions that can be used in DataTables
	 * Scope:    jQuery.fn.dataTableExt
	 * Notes:    The functions provided in this object are basically standard javascript sort
	 *   functions - they expect two inputs which they then compare and then return a priority
	 *   result. For each sort method added, two functions need to be defined, an ascending sort and
	 *   a descending sort.
	 */
	_oExt.oSort = {
		/*
		 * text sorting
		 */
		"string-asc": function ( a, b )
		{
			if ( typeof a != 'string' ) { a = ''; }
			if ( typeof b != 'string' ) { b = ''; }
			var x = a.toLowerCase();
			var y = b.toLowerCase();
			return ((x < y) ? -1 : ((x > y) ? 1 : 0));
		},

		"string-desc": function ( a, b )
		{
			if ( typeof a != 'string' ) { a = ''; }
			if ( typeof b != 'string' ) { b = ''; }
			var x = a.toLowerCase();
			var y = b.toLowerCase();
			return ((x < y) ? 1 : ((x > y) ? -1 : 0));
		},


		/*
		 * html sorting (ignore html tags)
		 */
		"html-asc": function ( a, b )
		{
			var x = a.replace( /<.*?>/g, "" ).toLowerCase();
			var y = b.replace( /<.*?>/g, "" ).toLowerCase();
			return ((x < y) ? -1 : ((x > y) ? 1 : 0));
		},

		"html-desc": function ( a, b )
		{
			var x = a.replace( /<.*?>/g, "" ).toLowerCase();
			var y = b.replace( /<.*?>/g, "" ).toLowerCase();
			return ((x < y) ? 1 : ((x > y) ? -1 : 0));
		},


		/*
		 * date sorting
		 */
		"date-asc": function ( a, b )
		{
			var x = Date.parse( a );
			var y = Date.parse( b );

			if ( isNaN(x) || x==="" )
			{
			x = Date.parse( "01/01/1970 00:00:00" );
			}
			if ( isNaN(y) || y==="" )
			{
				y =	Date.parse( "01/01/1970 00:00:00" );
			}

			return x - y;
		},

		"date-desc": function ( a, b )
		{
			var x = Date.parse( a );
			var y = Date.parse( b );

			if ( isNaN(x) || x==="" )
			{
			x = Date.parse( "01/01/1970 00:00:00" );
			}
			if ( isNaN(y) || y==="" )
			{
				y =	Date.parse( "01/01/1970 00:00:00" );
			}

			return y - x;
		},


		/*
		 * numerical sorting
		 */
		"numeric-asc": function ( a, b )
		{
			var x = (a=="-" || a==="") ? 0 : a*1;
			var y = (b=="-" || b==="") ? 0 : b*1;
			return x - y;
		},

		"numeric-desc": function ( a, b )
		{
			var x = (a=="-" || a==="") ? 0 : a*1;
			var y = (b=="-" || b==="") ? 0 : b*1;
			return y - x;
		}
	};


	/*
	 * Variable: aTypes
	 * Purpose:  Container for the various type of type detection that dataTables supports
	 * Scope:    jQuery.fn.dataTableExt
	 * Notes:    The functions in this array are expected to parse a string to see if it is a data
	 *   type that it recognises. If so then the function should return the name of the type (a
	 *   corresponding sort function should be defined!), if the type is not recognised then the
	 *   function should return null such that the parser and move on to check the next type.
	 *   Note that ordering is important in this array - the functions are processed linearly,
	 *   starting at index 0.
	 *   Note that the input for these functions is always a string! It cannot be any other data
	 *   type
	 */
	_oExt.aTypes = [
		/*
		 * Function: -
		 * Purpose:  Check to see if a string is numeric
		 * Returns:  string:'numeric' or null
		 * Inputs:   mixed:sText - string to check
		 */
		function ( sData )
		{
			/* Allow zero length strings as a number */
			if ( typeof sData == 'number' )
			{
				return 'numeric';
			}
			else if ( typeof sData != 'string' )
			{
				return null;
			}

			var sValidFirstChars = "0123456789-";
			var sValidChars = "0123456789.";
			var Char;
			var bDecimal = false;

			/* Check for a valid first char (no period and allow negatives) */
			Char = sData.charAt(0);
			if (sValidFirstChars.indexOf(Char) == -1)
			{
				return null;
			}

			/* Check all the other characters are valid */
			for ( var i=1 ; i<sData.length ; i++ )
			{
				Char = sData.charAt(i);
				if (sValidChars.indexOf(Char) == -1)
				{
					return null;
				}

				/* Only allowed one decimal place... */
				if ( Char == "." )
				{
					if ( bDecimal )
					{
						return null;
					}
					bDecimal = true;
				}
			}

			return 'numeric';
		},

		/*
		 * Function: -
		 * Purpose:  Check to see if a string is actually a formatted date
		 * Returns:  string:'date' or null
		 * Inputs:   string:sText - string to check
		 */
		function ( sData )
		{
			var iParse = Date.parse(sData);
			if ( (iParse !== null && !isNaN(iParse)) || (typeof sData == 'string' && sData.length === 0) )
			{
				return 'date';
			}
			return null;
		},

		/*
		 * Function: -
		 * Purpose:  Check to see if a string should be treated as an HTML string
		 * Returns:  string:'html' or null
		 * Inputs:   string:sText - string to check
		 */
		function ( sData )
		{
			if ( typeof sData == 'string' && sData.indexOf('<') != -1 && sData.indexOf('>') != -1 )
			{
				return 'html';
			}
			return null;
		}
	];

	/*
	 * Function: fnVersionCheck
	 * Purpose:  Check a version string against this version of DataTables. Useful for plug-ins
	 * Returns:  bool:true -this version of DataTables is greater or equal to the required version
	 *                false -this version of DataTales is not suitable
	 * Inputs:   string:sVersion - the version to check against. May be in the following formats:
	 *             "a", "a.b" or "a.b.c"
	 * Notes:    This function will only check the first three parts of a version string. It is
	 *   assumed that beta and dev versions will meet the requirements. This might change in future
	 */
	_oExt.fnVersionCheck = function( sVersion )
	{
		/* This is cheap, but very effective */
		var fnZPad = function (Zpad, count)
		{
			while(Zpad.length < count) {
				Zpad += '0';
			}
			return Zpad;
		};
		var aThis = _oExt.sVersion.split('.');
		var aThat = sVersion.split('.');
		var sThis = '', sThat = '';

		for ( var i=0, iLen=aThat.length ; i<iLen ; i++ )
		{
			sThis += fnZPad( aThis[i], 3 );
			sThat += fnZPad( aThat[i], 3 );
		}

		return parseInt(sThis, 10) >= parseInt(sThat, 10);
	};

	/*
	 * Variable: _oExternConfig
	 * Purpose:  Store information for DataTables to access globally about other instances
	 * Scope:    jQuery.fn.dataTableExt
	 */
	_oExt._oExternConfig = {
		/* int:iNextUnique - next unique number for an instance */
		"iNextUnique": 0
	};


	/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
	 * Section - DataTables prototype
	 * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */

	/*
	 * Function: dataTable
	 * Purpose:  DataTables information
	 * Returns:  -
	 * Inputs:   object:oInit - initalisation options for the table
	 */
	$.fn.dataTable = function( oInit )
	{
		/*
		 * Function: classSettings
		 * Purpose:  Settings container function for all 'class' properties which are required
		 *   by dataTables
		 * Returns:  -
		 * Inputs:   -
		 */
		function classSettings ()
		{
			this.fnRecordsTotal = function ()
			{
				if ( this.oFeatures.bServerSide ) {
					return parseInt(this._iRecordsTotal, 10);
				} else {
					return this.aiDisplayMaster.length;
				}
			};

			this.fnRecordsDisplay = function ()
			{
				if ( this.oFeatures.bServerSide ) {
					return parseInt(this._iRecordsDisplay, 10);
				} else {
					return this.aiDisplay.length;
				}
			};

			this.fnDisplayEnd = function ()
			{
				if ( this.oFeatures.bServerSide ) {
					if ( this.oFeatures.bPaginate === false || this._iDisplayLength == -1 ) {
						return this._iDisplayStart+this.aiDisplay.length;
					} else {
						return Math.min( this._iDisplayStart+this._iDisplayLength,
							this._iRecordsDisplay );
					}
				} else {
					return this._iDisplayEnd;
				}
			};

			/*
			 * Variable: oInstance
			 * Purpose:  The DataTables object for this table
			 * Scope:    jQuery.dataTable.classSettings
			 */
			this.oInstance = null;

			/*
			 * Variable: sInstance
			 * Purpose:  Unique idendifier for each instance of the DataTables object
			 * Scope:    jQuery.dataTable.classSettings
			 */
			this.sInstance = null;

			/*
			 * Variable: oFeatures
			 * Purpose:  Indicate the enablement of key dataTable features
			 * Scope:    jQuery.dataTable.classSettings
			 */
			this.oFeatures = {
				"bPaginate": true,
				"bLengthChange": true,
				"bFilter": true,
				"bSort": true,
				"bInfo": true,
				"bAutoWidth": true,
				"bProcessing": false,
				"bSortClasses": true,
				"bStateSave": false,
				"bServerSide": false,
				"bDeferRender": false
			};

			/*
			 * Variable: oScroll
			 * Purpose:  Container for scrolling options
			 * Scope:    jQuery.dataTable.classSettings
			 */
			this.oScroll = {
				"sX": "",
				"sXInner": "",
				"sY": "",
				"bCollapse": false,
				"bInfinite": false,
				"iLoadGap": 100,
				"iBarWidth": 0,
				"bAutoCss": true
			};

			/*
			 * Variable: aanFeatures
			 * Purpose:  Array referencing the nodes which are used for the features
			 * Scope:    jQuery.dataTable.classSettings
			 * Notes:    The parameters of this object match what is allowed by sDom - i.e.
			 *   'l' - Length changing
			 *   'f' - Filtering input
			 *   't' - The table!
			 *   'i' - Information
			 *   'p' - Pagination
			 *   'r' - pRocessing
			 */
			this.aanFeatures = [];

			/*
			 * Variable: oLanguage
			 * Purpose:  Store the language strings used by dataTables
			 * Scope:    jQuery.dataTable.classSettings
			 * Notes:    The words in the format _VAR_ are variables which are dynamically replaced
			 *   by javascript
			 */
			this.oLanguage = {
			    "sProcessing": "Spracúva sa...",
			    "sLengthMenu": "Ukazuje sa _MENU_ položiek",
			    "sZeroRecords": "Nenašli sa zodpovedajúce záznamy",
			    "sEmptyTable": "Tabuľka nemá dáta",
			    "sLoadingRecords": "Moment prosím...",
			    "sInfo": "od _START_ do _END_ z celkových _TOTAL_ položiek",
			    "sInfoEmpty": "Od 0 do 0 z 0 položiek",
				"sInfoFiltered": "",
				"sInfoPostFix": "",
				"sSearch": "Search:",
				"sUrl": "",
				"oPaginate": {
					"sFirst":    "First",
					"sPrevious": "Previous",
					"sNext":     "Next",
					"sLast":     "Last"
				},
				"fnInfoCallback": null
			};

			/*
			 * Variable: aoData
			 * Purpose:  Store data information
			 * Scope:    jQuery.dataTable.classSettings
			 * Notes:    This is an array of objects with the following parameters:
			 *   int: _iId - internal id for tracking
			 *   array: _aData - internal data - used for sorting / filtering etc
			 *   node: nTr - display node
			 *   array node: _anHidden - hidden TD nodes
			 *   string: _sRowStripe
			 */
			this.aoData = [];

			/*
			 * Variable: aiDisplay
			 * Purpose:  Array of indexes which are in the current display (after filtering etc)
			 * Scope:    jQuery.dataTable.classSettings
			 */
			this.aiDisplay = [];

			/*
			 * Variable: aiDisplayMaster
			 * Purpose:  Array of indexes for display - no filtering
			 * Scope:    jQuery.dataTable.classSettings
			 */
			this.aiDisplayMaster = [];

			/*
			 * Variable: aoColumns
			 * Purpose:  Store information about each column that is in use
			 * Scope:    jQuery.dataTable.classSettings
			 */
			this.aoColumns = [];

			/*
			 * Variable: aoHeader
			 * Purpose:  Store information about the table's header
			 * Scope:    jQuery.dataTable.classSettings
			 */
			this.aoHeader = [];

			/*
			 * Variable: aoFooter
			 * Purpose:  Store information about the table's footer
			 * Scope:    jQuery.dataTable.classSettings
			 */
			this.aoFooter = [];

			/*
			 * Variable: iNextId
			 * Purpose:  Store the next unique id to be used for a new row
			 * Scope:    jQuery.dataTable.classSettings
			 */
			this.iNextId = 0;

			/*
			 * Variable: asDataSearch
			 * Purpose:  Search data array for regular expression searching
			 * Scope:    jQuery.dataTable.classSettings
			 */
			this.asDataSearch = [];

			/*
			 * Variable: oPreviousSearch
			 * Purpose:  Store the previous search incase we want to force a re-search
			 *   or compare the old search to a new one
			 * Scope:    jQuery.dataTable.classSettings
			 */
			this.oPreviousSearch = {
				"sSearch": "",
				"bRegex": false,
				"bSmart": true
			};

			/*
			 * Variable: aoPreSearchCols
			 * Purpose:  Store the previous search for each column
			 * Scope:    jQuery.dataTable.classSettings
			 */
			this.aoPreSearchCols = [];

			/*
			 * Variable: aaSorting
			 * Purpose:  Sorting information
			 * Scope:    jQuery.dataTable.classSettings
			 * Notes:    Index 0 - column number
			 *           Index 1 - current sorting direction
			 *           Index 2 - index of asSorting for this column
			 */
			this.aaSorting = [ [0, 'asc', 0] ];

			/*
			 * Variable: aaSortingFixed
			 * Purpose:  Sorting information that is always applied
			 * Scope:    jQuery.dataTable.classSettings
			 */
			this.aaSortingFixed = null;

			/*
			 * Variable: asStripClasses
			 * Purpose:  Classes to use for the striping of a table
			 * Scope:    jQuery.dataTable.classSettings
			 */
			this.asStripClasses = [];

			/*
			 * Variable: asDestoryStrips
			 * Purpose:  If restoring a table - we should restore it's striping classes as well
			 * Scope:    jQuery.dataTable.classSettings
			 */
			this.asDestoryStrips = [];

			/*
			 * Variable: sDestroyWidth
			 * Purpose:  If restoring a table - we should restore it's width
			 * Scope:    jQuery.dataTable.classSettings
			 */
			this.sDestroyWidth = 0;

			/*
			 * Variable: fnRowCallback
			 * Purpose:  Call this function every time a row is inserted (draw)
			 * Scope:    jQuery.dataTable.classSettings
			 */
			this.fnRowCallback = null;

			/*
			 * Variable: fnHeaderCallback
			 * Purpose:  Callback function for the header on each draw
			 * Scope:    jQuery.dataTable.classSettings
			 */
			this.fnHeaderCallback = null;

			/*
			 * Variable: fnFooterCallback
			 * Purpose:  Callback function for the footer on each draw
			 * Scope:    jQuery.dataTable.classSettings
			 */
			this.fnFooterCallback = null;

			/*
			 * Variable: aoDrawCallback
			 * Purpose:  Array of callback functions for draw callback functions
			 * Scope:    jQuery.dataTable.classSettings
			 * Notes:    Each array element is an object with the following parameters:
			 *   function:fn - function to call
			 *   string:sName - name callback (feature). useful for arranging array
			 */
			this.aoDrawCallback = [];

			/*
			 * Variable: fnPreDrawCallback
			 * Purpose:  Callback function for just before the table is redrawn. A return of false
			 *           will be used to cancel the draw.
			 * Scope:    jQuery.dataTable.classSettings
			 */
			this.fnPreDrawCallback = null;

			/*
			 * Variable: fnInitComplete
			 * Purpose:  Callback function for when the table has been initalised
			 * Scope:    jQuery.dataTable.classSettings
			 */
			this.fnInitComplete = null;

			/*
			 * Variable: sTableId
			 * Purpose:  Cache the table ID for quick access
			 * Scope:    jQuery.dataTable.classSettings
			 */
			this.sTableId = "";

			/*
			 * Variable: nTable
			 * Purpose:  Cache the table node for quick access
			 * Scope:    jQuery.dataTable.classSettings
			 */
			this.nTable = null;

			/*
			 * Variable: nTHead
			 * Purpose:  Permanent ref to the thead element
			 * Scope:    jQuery.dataTable.classSettings
			 */
			this.nTHead = null;

			/*
			 * Variable: nTFoot
			 * Purpose:  Permanent ref to the tfoot element - if it exists
			 * Scope:    jQuery.dataTable.classSettings
			 */
			this.nTFoot = null;

			/*
			 * Variable: nTBody
			 * Purpose:  Permanent ref to the tbody element
			 * Scope:    jQuery.dataTable.classSettings
			 */
			this.nTBody = null;

			/*
			 * Variable: nTableWrapper
			 * Purpose:  Cache the wrapper node (contains all DataTables controlled elements)
			 * Scope:    jQuery.dataTable.classSettings
			 */
			this.nTableWrapper = null;

			/*
			 * Variable: bDeferLoading
			 * Purpose:  Indicate if when using server-side processing the loading of data
			 *           should be deferred until the second draw
			 * Scope:    jQuery.dataTable.classSettings
			 */
			this.bDeferLoading = false;

			/*
			 * Variable: bInitialised
			 * Purpose:  Indicate if all required information has been read in
			 * Scope:    jQuery.dataTable.classSettings
			 */
			this.bInitialised = false;

			/*
			 * Variable: aoOpenRows
			 * Purpose:  Information about open rows
			 * Scope:    jQuery.dataTable.classSettings
			 * Notes:    Has the parameters 'nTr' and 'nParent'
			 */
			this.aoOpenRows = [];

			/*
			 * Variable: sDom
			 * Purpose:  Dictate the positioning that the created elements will take
			 * Scope:    jQuery.dataTable.classSettings
			 * Notes:
			 *   The following options are allowed:
			 *     'l' - Length changing
			 *     'f' - Filtering input
			 *     't' - The table!
			 *     'i' - Information
			 *     'p' - Pagination
			 *     'r' - pRocessing
			 *   The following constants are allowed:
			 *     'H' - jQueryUI theme "header" classes
			 *     'F' - jQueryUI theme "footer" classes
			 *   The following syntax is expected:
			 *     '<' and '>' - div elements
			 *     '<"class" and '>' - div with a class
			 *   Examples:
			 *     '<"wrapper"flipt>', '<lf<t>ip>'
			 */
			this.sDom = 'lfrtip';

			/*
			 * Variable: sPaginationType
			 * Purpose:  Note which type of sorting should be used
			 * Scope:    jQuery.dataTable.classSettings
			 */
			this.sPaginationType = "two_button";

			/*
			 * Variable: iCookieDuration
			 * Purpose:  The cookie duration (for bStateSave) in seconds - default 2 hours
			 * Scope:    jQuery.dataTable.classSettings
			 */
			this.iCookieDuration = 60 * 60 * 2;

			/*
			 * Variable: sCookiePrefix
			 * Purpose:  The cookie name prefix
			 * Scope:    jQuery.dataTable.classSettings
			 */
			this.sCookiePrefix = "SpryMedia_DataTables_";

			/*
			 * Variable: fnCookieCallback
			 * Purpose:  Callback function for cookie creation
			 * Scope:    jQuery.dataTable.classSettings
			 */
			this.fnCookieCallback = null;

			/*
			 * Variable: aoStateSave
			 * Purpose:  Array of callback functions for state saving
			 * Scope:    jQuery.dataTable.classSettings
			 * Notes:    Each array element is an object with the following parameters:
			 *   function:fn - function to call. Takes two parameters, oSettings and the JSON string to
			 *     save that has been thus far created. Returns a JSON string to be inserted into a
			 *     json object (i.e. '"param": [ 0, 1, 2]')
			 *   string:sName - name of callback
			 */
			this.aoStateSave = [];

			/*
			 * Variable: aoStateLoad
			 * Purpose:  Array of callback functions for state loading
			 * Scope:    jQuery.dataTable.classSettings
			 * Notes:    Each array element is an object with the following parameters:
			 *   function:fn - function to call. Takes two parameters, oSettings and the object stored.
			 *     May return false to cancel state loading.
			 *   string:sName - name of callback
			 */
			this.aoStateLoad = [];

			/*
			 * Variable: oLoadedState
			 * Purpose:  State that was loaded from the cookie. Useful for back reference
			 * Scope:    jQuery.dataTable.classSettings
			 */
			this.oLoadedState = null;

			/*
			 * Variable: sAjaxSource
			 * Purpose:  Source url for AJAX data for the table
			 * Scope:    jQuery.dataTable.classSettings
			 */
			this.sAjaxSource = null;

			/*
			 * Variable: sAjaxDataProp
			 * Purpose:  Property from a given object from which to read the table data from. This can
			 *           be an empty string (when not server-side processing), in which case it is
			 *           assumed an an array is given directly.
			 * Scope:    jQuery.dataTable.classSettings
			 */
			this.sAjaxDataProp = 'aaData';

			/*
			 * Variable: bAjaxDataGet
			 * Purpose:  Note if draw should be blocked while getting data
			 * Scope:    jQuery.dataTable.classSettings
			 */
			this.bAjaxDataGet = true;

			/*
			 * Variable: jqXHR
			 * Purpose:  The last jQuery XHR object that was used for server-side data gathering.
			 *           This can be used for working with the XHR information in one of the callbacks
			 * Scope:    jQuery.dataTable.classSettings
			 */
			this.jqXHR = null;

			/*
			 * Variable: fnServerData
			 * Purpose:  Function to get the server-side data - can be overruled by the developer
			 * Scope:    jQuery.dataTable.classSettings
			 */
			this.fnServerData = function ( url, data, callback, settings ) {
				settings.jqXHR = $.ajax( {
					"url": url,
					"data": data,
					"success": callback,
					"dataType": "json",
					"cache": false,
					"error": function (xhr, error, thrown) {
						if ( error == "parsererror" ) {
							alert( "DataTables warning: JSON data from server could not be parsed. "+
								"This is caused by a JSON formatting error." );
						}
					}
				} );
			};

			/*
			 * Variable: fnFormatNumber
			 * Purpose:  Format numbers for display
			 * Scope:    jQuery.dataTable.classSettings
			 */
			this.fnFormatNumber = function ( iIn )
			{
				if ( iIn < 1000 )
				{
					/* A small optimisation for what is likely to be the vast majority of use cases */
					return iIn;
				}
				else
				{
					var s=(iIn+""), a=s.split(""), out="", iLen=s.length;

					for ( var i=0 ; i<iLen ; i++ )
					{
						if ( i%3 === 0 && i !== 0 )
						{
							out = ','+out;
						}
						out = a[iLen-i-1]+out;
					}
				}
				return out;
			};

			/*
			 * Variable: aLengthMenu
			 * Purpose:  List of options that can be used for the user selectable length menu
			 * Scope:    jQuery.dataTable.classSettings
			 * Note:     This varaible can take for form of a 1D array, in which case the value and the
			 *   displayed value in the menu are the same, or a 2D array in which case the value comes
			 *   from the first array, and the displayed value to the end user comes from the second
			 *   array. 2D example: [ [ 10, 25, 50, 100, -1 ], [ 10, 25, 50, 100, 'All' ] ];
			 */
			this.aLengthMenu = [ 10, 25, 50, 100 ];

			/*
			 * Variable: iDraw
			 * Purpose:  Counter for the draws that the table does. Also used as a tracker for
			 *   server-side processing
			 * Scope:    jQuery.dataTable.classSettings
			 */
			this.iDraw = 0;

			/*
			 * Variable: bDrawing
			 * Purpose:  Indicate if a redraw is being done - useful for Ajax
			 * Scope:    jQuery.dataTable.classSettings
			 */
			this.bDrawing = 0;

			/*
			 * Variable: iDrawError
			 * Purpose:  Last draw error
			 * Scope:    jQuery.dataTable.classSettings
			 */
			this.iDrawError = -1;

			/*
			 * Variable: _iDisplayLength, _iDisplayStart, _iDisplayEnd
			 * Purpose:  Display length variables
			 * Scope:    jQuery.dataTable.classSettings
			 * Notes:    These variable must NOT be used externally to get the data length. Rather, use
			 *   the fnRecordsTotal() (etc) functions.
			 */
			this._iDisplayLength = 10;
			this._iDisplayStart = 0;
			this._iDisplayEnd = 10;

			/*
			 * Variable: _iRecordsTotal, _iRecordsDisplay
			 * Purpose:  Display length variables used for server side processing
			 * Scope:    jQuery.dataTable.classSettings
			 * Notes:    These variable must NOT be used externally to get the data length. Rather, use
			 *   the fnRecordsTotal() (etc) functions.
			 */
			this._iRecordsTotal = 0;
			this._iRecordsDisplay = 0;

			/*
			 * Variable: bJUI
			 * Purpose:  Should we add the markup needed for jQuery UI theming?
			 * Scope:    jQuery.dataTable.classSettings
			 */
			this.bJUI = false;

			/*
			 * Variable: oClasses
			 * Purpose:  Should we add the markup needed for jQuery UI theming?
			 * Scope:    jQuery.dataTable.classSettings
			 */
			this.oClasses = _oExt.oStdClasses;

			/*
			 * Variable: bFiltered and bSorted
			 * Purpose:  Flags to allow callback functions to see what actions have been performed
			 * Scope:    jQuery.dataTable.classSettings
			 */
			this.bFiltered = false;
			this.bSorted = false;

			/*
			 * Variable: bSortCellsTop
			 * Purpose:  Indicate that if multiple rows are in the header and there is more than one
			 *           unique cell per column, if the top one (true) or bottom one (false) should
			 *           be used for sorting / title by DataTables
			 * Scope:    jQuery.dataTable.classSettings
			 */
			this.bSortCellsTop = false;

			/*
			 * Variable: oInit
			 * Purpose:  Initialisation object that is used for the table
			 * Scope:    jQuery.dataTable.classSettings
			 */
			this.oInit = null;
		}

		/*
		 * Variable: oApi
		 * Purpose:  Container for publicly exposed 'private' functions
		 * Scope:    jQuery.dataTable
		 */
		this.oApi = {};


		/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
		 * Section - API functions
		 * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */

		/*
		 * Function: fnDraw
		 * Purpose:  Redraw the table
		 * Returns:  -
		 * Inputs:   bool:bComplete - Refilter and resort (if enabled) the table before the draw.
		 *             Optional: default - true
		 */
		this.fnDraw = function( bComplete )
		{
			var oSettings = _fnSettingsFromNode( this[_oExt.iApiIndex] );
			if ( typeof bComplete != 'undefined' && bComplete === false )
			{
				_fnCalculateEnd( oSettings );
				_fnDraw( oSettings );
			}
			else
			{
				_fnReDraw( oSettings );
			}
		};

		/*
		 * Function: fnFilter
		 * Purpose:  Filter the input based on data
		 * Returns:  -
		 * Inputs:   string:sInput - string to filter the table on
		 *           int:iColumn - optional - column to limit filtering to
		 *           bool:bRegex - optional - treat as regular expression or not - default false
		 *           bool:bSmart - optional - perform smart filtering or not - default true
		 *           bool:bShowGlobal - optional - show the input global filter in it's input box(es)
		 *              - default true
		 */
		this.fnFilter = function( sInput, iColumn, bRegex, bSmart, bShowGlobal )
		{
			var oSettings = _fnSettingsFromNode( this[_oExt.iApiIndex] );

			if ( !oSettings.oFeatures.bFilter )
			{
				return;
			}

			if ( typeof bRegex == 'undefined' )
			{
				bRegex = false;
			}

			if ( typeof bSmart == 'undefined' )
			{
				bSmart = true;
			}

			if ( typeof bShowGlobal == 'undefined' )
			{
				bShowGlobal = true;
			}

			if ( typeof iColumn == "undefined" || iColumn === null )
			{
				/* Global filter */
				_fnFilterComplete( oSettings, {
					"sSearch":sInput,
					"bRegex": bRegex,
					"bSmart": bSmart
				}, 1 );

				if ( bShowGlobal && typeof oSettings.aanFeatures.f != 'undefined' )
				{
					var n = oSettings.aanFeatures.f;
					for ( var i=0, iLen=n.length ; i<iLen ; i++ )
					{
						$('input', n[i]).val( sInput );
					}
				}
			}
			else
			{
				/* Single column filter */
				oSettings.aoPreSearchCols[ iColumn ].sSearch = sInput;
				oSettings.aoPreSearchCols[ iColumn ].bRegex = bRegex;
				oSettings.aoPreSearchCols[ iColumn ].bSmart = bSmart;
				_fnFilterComplete( oSettings, oSettings.oPreviousSearch, 1 );
			}
		};

		/*
		 * Function: fnSettings
		 * Purpose:  Get the settings for a particular table for extern. manipulation
		 * Returns:  -
		 * Inputs:   -
		 */
		this.fnSettings = function( nNode  )
		{
			return _fnSettingsFromNode( this[_oExt.iApiIndex] );
		};

		/*
		 * Function: fnVersionCheck
		 * Notes:    The function is the same as the 'static' function provided in the ext variable
		 */
		this.fnVersionCheck = _oExt.fnVersionCheck;

		/*
		 * Function: fnSort
		 * Purpose:  Sort the table by a particular row
		 * Returns:  -
		 * Inputs:   int:iCol - the data index to sort on. Note that this will
		 *   not match the 'display index' if you have hidden data entries
		 */
		this.fnSort = function( aaSort )
		{
			var oSettings = _fnSettingsFromNode( this[_oExt.iApiIndex] );
			oSettings.aaSorting = aaSort;
			_fnSort( oSettings );
		};

		/*
		 * Function: fnSortListener
		 * Purpose:  Attach a sort listener to an element for a given column
		 * Returns:  -
		 * Inputs:   node:nNode - the element to attach the sort listener to
		 *           int:iColumn - the column that a click on this node will sort on
		 *           function:fnCallback - callback function when sort is run - optional
		 */
		this.fnSortListener = function( nNode, iColumn, fnCallback )
		{
			_fnSortAttachListener( _fnSettingsFromNode( this[_oExt.iApiIndex] ), nNode, iColumn,
			 	fnCallback );
		};

		/*
		 * Function: fnAddData
		 * Purpose:  Add new row(s) into the table
		 * Returns:  array int: array of indexes (aoData) which have been added (zero length on error)
		 * Inputs:   array:mData - the data to be added. The length must match
		 *               the original data from the DOM
		 *             or
		 *             array array:mData - 2D array of data to be added
		 *           bool:bRedraw - redraw the table or not - default true
		 * Notes:    Warning - the refilter here will cause the table to redraw
		 *             starting at zero
		 * Notes:    Thanks to Yekimov Denis for contributing the basis for this function!
		 */
		this.fnAddData = function( mData, bRedraw )
		{
			if ( mData.length === 0 )
			{
				return [];
			}

			var aiReturn = [];
			var iTest;

			/* Find settings from table node */
			var oSettings = _fnSettingsFromNode( this[_oExt.iApiIndex] );

			/* Check if we want to add multiple rows or not */
			if ( typeof mData[0] == "object" )
			{
				for ( var i=0 ; i<mData.length ; i++ )
				{
					iTest = _fnAddData( oSettings, mData[i] );
					if ( iTest == -1 )
					{
						return aiReturn;
					}
					aiReturn.push( iTest );
				}
			}
			else
			{
				iTest = _fnAddData( oSettings, mData );
				if ( iTest == -1 )
				{
					return aiReturn;
				}
				aiReturn.push( iTest );
			}

			oSettings.aiDisplay = oSettings.aiDisplayMaster.slice();

			if ( typeof bRedraw == 'undefined' || bRedraw )
			{
				_fnReDraw( oSettings );
			}
			return aiReturn;
		};

		/*
		 * Function: fnDeleteRow
		 * Purpose:  Remove a row for the table
		 * Returns:  array:aReturn - the row that was deleted
		 * Inputs:   mixed:mTarget -
		 *             int: - index of aoData to be deleted, or
		 *             node(TR): - TR element you want to delete
		 *           function:fnCallBack - callback function - default null
		 *           bool:bRedraw - redraw the table or not - default true
		 */
		this.fnDeleteRow = function( mTarget, fnCallBack, bRedraw )
		{
			/* Find settings from table node */
			var oSettings = _fnSettingsFromNode( this[_oExt.iApiIndex] );
			var i, iAODataIndex;

			iAODataIndex = (typeof mTarget == 'object') ?
				_fnNodeToDataIndex(oSettings, mTarget) : mTarget;

			/* Return the data array from this row */
			var oData = oSettings.aoData.splice( iAODataIndex, 1 );

			/* Remove the target row from the search array */
			var iDisplayIndex = $.inArray( iAODataIndex, oSettings.aiDisplay );
			oSettings.asDataSearch.splice( iDisplayIndex, 1 );

			/* Delete from the display arrays */
			_fnDeleteIndex( oSettings.aiDisplayMaster, iAODataIndex );
			_fnDeleteIndex( oSettings.aiDisplay, iAODataIndex );

			/* If there is a user callback function - call it */
			if ( typeof fnCallBack == "function" )
			{
				fnCallBack.call( this, oSettings, oData );
			}

			/* Check for an 'overflow' they case for dislaying the table */
			if ( oSettings._iDisplayStart >= oSettings.aiDisplay.length )
			{
				oSettings._iDisplayStart -= oSettings._iDisplayLength;
				if ( oSettings._iDisplayStart < 0 )
				{
					oSettings._iDisplayStart = 0;
				}
			}

			if ( typeof bRedraw == 'undefined' || bRedraw )
			{
				_fnCalculateEnd( oSettings );
				_fnDraw( oSettings );
			}

			return oData;
		};

		/*
		 * Function: fnClearTable
		 * Purpose:  Quickly and simply clear a table
		 * Returns:  -
		 * Inputs:   bool:bRedraw - redraw the table or not - default true
		 * Notes:    Thanks to Yekimov Denis for contributing the basis for this function!
		 */
		this.fnClearTable = function( bRedraw )
		{
			/* Find settings from table node */
			var oSettings = _fnSettingsFromNode( this[_oExt.iApiIndex] );
			_fnClearTable( oSettings );

			if ( typeof bRedraw == 'undefined' || bRedraw )
			{
				_fnDraw( oSettings );
			}
		};

		/*
		 * Function: fnOpen
		 * Purpose:  Open a display row (append a row after the row in question)
		 * Returns:  node:nNewRow - the row opened
		 * Inputs:   node:nTr - the table row to 'open'
		 *           string|node|jQuery:mHtml - the HTML to put into the row
		 *           string:sClass - class to give the new TD cell
		 */
		this.fnOpen = function( nTr, mHtml, sClass )
		{
			/* Find settings from table node */
			var oSettings = _fnSettingsFromNode( this[_oExt.iApiIndex] );

			/* the old open one if there is one */
			this.fnClose( nTr );

			var nNewRow = document.createElement("tr");
			var nNewCell = document.createElement("td");
			nNewRow.appendChild( nNewCell );
			nNewCell.className = sClass;
			nNewCell.colSpan = _fnVisbleColumns( oSettings );

			if( typeof mHtml.jquery != 'undefined' || typeof mHtml == "object" )
			{
				nNewCell.appendChild( mHtml );
			}
			else
			{
				nNewCell.innerHTML = mHtml;
			}

			/* If the nTr isn't on the page at the moment - then we don't insert at the moment */
			var nTrs = $('tr', oSettings.nTBody);
			if ( $.inArray(nTr, nTrs) != -1 )
			{
				$(nNewRow).insertAfter(nTr);
			}

			oSettings.aoOpenRows.push( {
				"nTr": nNewRow,
				"nParent": nTr
			} );

			return nNewRow;
		};

		/*
		 * Function: fnClose
		 * Purpose:  Close a display row
		 * Returns:  int: 0 (success) or 1 (failed)
		 * Inputs:   node:nTr - the table row to 'close'
		 */
		this.fnClose = function( nTr )
		{
			/* Find settings from table node */
			var oSettings = _fnSettingsFromNode( this[_oExt.iApiIndex] );

			for ( var i=0 ; i<oSettings.aoOpenRows.length ; i++ )
			{
				if ( oSettings.aoOpenRows[i].nParent == nTr )
				{
					var nTrParent = oSettings.aoOpenRows[i].nTr.parentNode;
					if ( nTrParent )
					{
						/* Remove it if it is currently on display */
						nTrParent.removeChild( oSettings.aoOpenRows[i].nTr );
					}
					oSettings.aoOpenRows.splice( i, 1 );
					return 0;
				}
			}
			return 1;
		};

		/*
		 * Function: fnGetData
		 * Purpose:  Return an array with the data which is used to make up the table
		 * Returns:  array array string: 2d data array ([row][column]) or array string: 1d data array
		 *           or string if both row and column are given
		 * Inputs:   mixed:mRow - optional - if not present, then the full 2D array for the table
		 *             if given then:
		 *               int: - return data object for aoData entry of this index
		 *               node(TR): - return data object for this TR element
		 *           int:iCol - optional - the column that you want the data of. This will take into
		 *               account mDataProp and return the value DataTables uses for this column
		 */
		this.fnGetData = function( mRow, iCol )
		{
			var oSettings = _fnSettingsFromNode( this[_oExt.iApiIndex] );

			if ( typeof mRow != 'undefined' )
			{
				var iRow = (typeof mRow == 'object') ?
					_fnNodeToDataIndex(oSettings, mRow) : mRow;

				if ( typeof iCol != 'undefined' )
				{
					return _fnGetCellData( oSettings, iRow, iCol, '' );
				}
				return (typeof oSettings.aoData[iRow] != 'undefined') ?
					oSettings.aoData[iRow]._aData : null;
			}
			return _fnGetDataMaster( oSettings );
		};

		/*
		 * Function: fnGetNodes
		 * Purpose:  Return an array with the TR nodes used for drawing the table
		 * Returns:  array node: TR elements
		 *           or
		 *           node (if iRow specified)
		 * Inputs:   int:iRow - optional - if present then the array returned will be the node for
		 *             the row with the index 'iRow'
		 */
		this.fnGetNodes = function( iRow )
		{
			var oSettings = _fnSettingsFromNode( this[_oExt.iApiIndex] );

			if ( typeof iRow != 'undefined' )
			{
				return (typeof oSettings.aoData[iRow] != 'undefined') ? oSettings.aoData[iRow].nTr : null;
			}
			return _fnGetTrNodes( oSettings );
		};

		/*
		 * Function: fnGetPosition
		 * Purpose:  Get the array indexes of a particular cell from it's DOM element
		 * Returns:  int: - row index, or array[ int, int, int ]: - row index, column index (visible)
		 *             and column index including hidden columns
		 * Inputs:   node:nNode - this can either be a TR, TD or TH in the table's body, the return is
		 *             dependent on this input
		 */
		this.fnGetPosition = function( nNode )
		{
			var oSettings = _fnSettingsFromNode( this[_oExt.iApiIndex] );
			var sNodeName = nNode.nodeName.toUpperCase();

			if ( sNodeName == "TR" )
			{
				return _fnNodeToDataIndex(oSettings, nNode);
			}
			else if ( sNodeName == "TD" || sNodeName == "TH" )
			{
				var iDataIndex = _fnNodeToDataIndex(oSettings, nNode.parentNode);
				var anCells = _fnGetTdNodes( oSettings, iDataIndex );

				for ( var i=0 ; i<oSettings.aoColumns.length ; i++ )
				{
					if ( anCells[i] == nNode )
					{
						return [ iDataIndex, _fnColumnIndexToVisible(oSettings, i ), i ];
					}
				}
			}
			return null;
		};

		/*
		 * Function: fnUpdate
		 * Purpose:  Update a table cell or row - this method will accept either a single value to
		 *             update the cell with, an array of values with one element for each column or
		 *             an object in the same format as the original data source. The function is
		 *             self-referencing in order to make the multi column updates easier.
		 * Returns:  int: 0 okay, 1 error
		 * Inputs:   object | array string | string:mData - data to update the cell/row with
		 *           mixed:mRow -
		 *             int: - index of aoData to be updated, or
		 *             node(TR): - TR element you want to update
		 *           int:iColumn - the column to update - optional (not used of mData is an array or object)
		 *           bool:bRedraw - redraw the table or not - default true
		 *           bool:bAction - perform predraw actions or not (you will want this as 'true' if
		 *             you have bRedraw as true) - default true
		 */
		this.fnUpdate = function( mData, mRow, iColumn, bRedraw, bAction )
		{
			var oSettings = _fnSettingsFromNode( this[_oExt.iApiIndex] );
			var iVisibleColumn, i, iLen, sDisplay;
			var iRow = (typeof mRow == 'object') ?
				_fnNodeToDataIndex(oSettings, mRow) : mRow;

			if ( $.isArray(mData) && typeof mData == 'object' )
			{
				/* Array update - update the whole row */
				oSettings.aoData[iRow]._aData = mData.slice();

				for ( i=0 ; i<oSettings.aoColumns.length ; i++ )
				{
					this.fnUpdate( _fnGetCellData( oSettings, iRow, i ), iRow, i, false, false );
				}
			}
			else if ( typeof mData == 'object' )
			{
				/* Object update - update the whole row - assume the developer gets the object right */
				oSettings.aoData[iRow]._aData = $.extend( true, {}, mData );

				for ( i=0 ; i<oSettings.aoColumns.length ; i++ )
				{
					this.fnUpdate( _fnGetCellData( oSettings, iRow, i ), iRow, i, false, false );
				}
			}
			else
			{
				/* Individual cell update */
				sDisplay = mData;
				_fnSetCellData( oSettings, iRow, iColumn, sDisplay );

				if ( oSettings.aoColumns[iColumn].fnRender !== null )
				{
					sDisplay = oSettings.aoColumns[iColumn].fnRender( {
						"iDataRow": iRow,
						"iDataColumn": iColumn,
						"aData": oSettings.aoData[iRow]._aData,
						"oSettings": oSettings
					} );

					if ( oSettings.aoColumns[iColumn].bUseRendered )
					{
						_fnSetCellData( oSettings, iRow, iColumn, sDisplay );
					}
				}

				if ( oSettings.aoData[iRow].nTr !== null )
				{
					/* Do the actual HTML update */
					_fnGetTdNodes( oSettings, iRow )[iColumn].innerHTML = sDisplay;
				}
			}

			/* Modify the search index for this row (strictly this is likely not needed, since fnReDraw
			 * will rebuild the search array - however, the redraw might be disabled by the user)
			 */
			var iDisplayIndex = $.inArray( iRow, oSettings.aiDisplay );
			oSettings.asDataSearch[iDisplayIndex] = _fnBuildSearchRow( oSettings,
				_fnGetRowData( oSettings, iRow, 'filter' ) );

			/* Perform pre-draw actions */
			if ( typeof bAction == 'undefined' || bAction )
			{
				_fnAjustColumnSizing( oSettings );
			}

			/* Redraw the table */
			if ( typeof bRedraw == 'undefined' || bRedraw )
			{
				_fnReDraw( oSettings );
			}
			return 0;
		};


		/*
		 * Function: fnShowColoumn
		 * Purpose:  Show a particular column
		 * Returns:  -
		 * Inputs:   int:iCol - the column whose display should be changed
		 *           bool:bShow - show (true) or hide (false) the column
		 *           bool:bRedraw - redraw the table or not - default true
		 */
		this.fnSetColumnVis = function ( iCol, bShow, bRedraw )
		{
			var oSettings = _fnSettingsFromNode( this[_oExt.iApiIndex] );
			var i, iLen;
			var iColumns = oSettings.aoColumns.length;
			var nTd, nCell, anTrs, jqChildren, bAppend, iBefore;

			/* No point in doing anything if we are requesting what is already true */
			if ( oSettings.aoColumns[iCol].bVisible == bShow )
			{
				return;
			}

			/* Show the column */
			if ( bShow )
			{
				var iInsert = 0;
				for ( i=0 ; i<iCol ; i++ )
				{
					if ( oSettings.aoColumns[i].bVisible )
					{
						iInsert++;
					}
				}

				/* Need to decide if we should use appendChild or insertBefore */
				bAppend = (iInsert >= _fnVisbleColumns( oSettings ));

				/* Which coloumn should we be inserting before? */
				if ( !bAppend )
				{
					for ( i=iCol ; i<iColumns ; i++ )
					{
						if ( oSettings.aoColumns[i].bVisible )
						{
							iBefore = i;
							break;
						}
					}
				}

				for ( i=0, iLen=oSettings.aoData.length ; i<iLen ; i++ )
				{
					if ( oSettings.aoData[i].nTr !== null )
					{
						if ( bAppend )
						{
							oSettings.aoData[i].nTr.appendChild(
								oSettings.aoData[i]._anHidden[iCol]
							);
						}
						else
						{
							oSettings.aoData[i].nTr.insertBefore(
								oSettings.aoData[i]._anHidden[iCol],
								_fnGetTdNodes( oSettings, i )[iBefore] );
						}
					}
				}
			}
			else
			{
				/* Remove a column from display */
				for ( i=0, iLen=oSettings.aoData.length ; i<iLen ; i++ )
				{
					if ( oSettings.aoData[i].nTr !== null )
					{
						nTd = _fnGetTdNodes( oSettings, i )[iCol];
						oSettings.aoData[i]._anHidden[iCol] = nTd;
						nTd.parentNode.removeChild( nTd );
					}
				}
			}

			/* Clear to set the visible flag */
			oSettings.aoColumns[iCol].bVisible = bShow;

			/* Redraw the header and footer based on the new column visibility */
			_fnDrawHead( oSettings, oSettings.aoHeader );
			if ( oSettings.nTFoot )
			{
				_fnDrawHead( oSettings, oSettings.aoFooter );
			}

			/* If there are any 'open' rows, then we need to alter the colspan for this col change */
			for ( i=0, iLen=oSettings.aoOpenRows.length ; i<iLen ; i++ )
			{
				oSettings.aoOpenRows[i].nTr.colSpan = _fnVisbleColumns( oSettings );
			}

			/* Do a redraw incase anything depending on the table columns needs it
			 * (built-in: scrolling)
			 */
			if ( typeof bRedraw == 'undefined' || bRedraw )
			{
				_fnAjustColumnSizing( oSettings );
				_fnDraw( oSettings );
			}

			_fnSaveState( oSettings );
		};

		/*
		 * Function: fnPageChange
		 * Purpose:  Change the pagination
		 * Returns:  -
		 * Inputs:   string:sAction - paging action to take: "first", "previous", "next" or "last"
		 *           bool:bRedraw - redraw the table or not - optional - default true
		 */
		this.fnPageChange = function ( sAction, bRedraw )
		{
			var oSettings = _fnSettingsFromNode( this[_oExt.iApiIndex] );
			_fnPageChange( oSettings, sAction );
			_fnCalculateEnd( oSettings );

			if ( typeof bRedraw == 'undefined' || bRedraw )
			{
				_fnDraw( oSettings );
			}
		};

		/*
		 * Function: fnDestroy
		 * Purpose:  Destructor for the DataTable
		 * Returns:  -
		 * Inputs:   -
		 */
		this.fnDestroy = function ( )
		{
			var oSettings = _fnSettingsFromNode( this[_oExt.iApiIndex] );
			var nOrig = oSettings.nTableWrapper.parentNode;
			var nBody = oSettings.nTBody;
			var i, iLen;

			/* Flag to note that the table is currently being destoryed - no action should be taken */
			oSettings.bDestroying = true;

			/* Restore hidden columns */
			for ( i=0, iLen=oSettings.aoColumns.length ; i<iLen ; i++ )
			{
				if ( oSettings.aoColumns[i].bVisible === false )
				{
					this.fnSetColumnVis( i, true );
				}
			}

			/* Blitz all DT events */
			$(oSettings.nTableWrapper).find('*').andSelf().unbind('.DT');

			/* If there is an 'empty' indicator row, remove it */
			$('tbody>tr>td.'+oSettings.oClasses.sRowEmpty, oSettings.nTable).parent().remove();

			/* When scrolling we had to break the table up - restore it */
			if ( oSettings.nTable != oSettings.nTHead.parentNode )
			{
				$('>thead', oSettings.nTable).remove();
				oSettings.nTable.appendChild( oSettings.nTHead );
			}

			if ( oSettings.nTFoot && oSettings.nTable != oSettings.nTFoot.parentNode )
			{
				$('>tfoot', oSettings.nTable).remove();
				oSettings.nTable.appendChild( oSettings.nTFoot );
			}

			/* Remove the DataTables generated nodes, events and classes */
			oSettings.nTable.parentNode.removeChild( oSettings.nTable );
			$(oSettings.nTableWrapper).remove();

			oSettings.aaSorting = [];
			oSettings.aaSortingFixed = [];
			_fnSortingClasses( oSettings );

			$(_fnGetTrNodes( oSettings )).removeClass( oSettings.asStripClasses.join(' ') );

			if ( !oSettings.bJUI )
			{
				$('th', oSettings.nTHead).removeClass( [ _oExt.oStdClasses.sSortable,
					_oExt.oStdClasses.sSortableAsc,
					_oExt.oStdClasses.sSortableDesc,
					_oExt.oStdClasses.sSortableNone ].join(' ')
				);
			}
			else
			{
				$('th', oSettings.nTHead).removeClass( [ _oExt.oStdClasses.sSortable,
					_oExt.oJUIClasses.sSortableAsc,
					_oExt.oJUIClasses.sSortableDesc,
					_oExt.oJUIClasses.sSortableNone ].join(' ')
				);
				$('th span.'+_oExt.oJUIClasses.sSortIcon, oSettings.nTHead).remove();

				$('th', oSettings.nTHead).each( function () {
					var jqWrapper = $('div.'+_oExt.oJUIClasses.sSortJUIWrapper, this);
					var kids = jqWrapper.contents();
					$(this).append( kids );
					jqWrapper.remove();
				} );
			}

			/* Add the TR elements back into the table in their original order */
			if ( oSettings.nTableReinsertBefore )
			{
				nOrig.insertBefore( oSettings.nTable, oSettings.nTableReinsertBefore );
			}
			else
			{
				nOrig.appendChild( oSettings.nTable );
			}

			for ( i=0, iLen=oSettings.aoData.length ; i<iLen ; i++ )
			{
				if ( oSettings.aoData[i].nTr !== null )
				{
					nBody.appendChild( oSettings.aoData[i].nTr );
				}
			}

			/* Restore the width of the original table */
			if ( oSettings.oFeatures.bAutoWidth === true )
			{
			  oSettings.nTable.style.width = _fnStringToCss(oSettings.sDestroyWidth);
			}

			/* If the were originally odd/even type classes - then we add them back here. Note
			 * this is not fool proof (for example if not all rows as odd/even classes - but
			 * it's a good effort without getting carried away
			 */
			$('>tr:even', nBody).addClass( oSettings.asDestoryStrips[0] );
			$('>tr:odd', nBody).addClass( oSettings.asDestoryStrips[1] );

			/* Remove the settings object from the settings array */
			for ( i=0, iLen=_aoSettings.length ; i<iLen ; i++ )
			{
				if ( _aoSettings[i] == oSettings )
				{
					_aoSettings.splice( i, 1 );
				}
			}

			/* End it all */
			oSettings = null;
		};

		/*
		 * Function: fnAjustColumnSizing
		 * Purpose:  Update tale sizing based on content. This would most likely be used for scrolling
		 *   and will typically need a redraw after it.
		 * Returns:  -
		 * Inputs:   bool:bRedraw - redraw the table or not, you will typically want to - default true
		 */
		this.fnAdjustColumnSizing = function ( bRedraw )
		{
			var oSettings = _fnSettingsFromNode(this[_oExt.iApiIndex]);
			_fnAjustColumnSizing( oSettings );

			if ( typeof bRedraw == 'undefined' || bRedraw )
			{
				this.fnDraw( false );
			}
			else if ( oSettings.oScroll.sX !== "" || oSettings.oScroll.sY !== "" )
			{
				/* If not redrawing, but scrolling, we want to apply the new column sizes anyway */
				this.oApi._fnScrollDraw(oSettings);
			}
		};

		/*
		 * Plugin API functions
		 *
		 * This call will add the functions which are defined in _oExt.oApi to the
		 * DataTables object, providing a rather nice way to allow plug-in API functions. Note that
		 * this is done here, so that API function can actually override the built in API functions if
		 * required for a particular purpose.
		 */

		/*
		 * Function: _fnExternApiFunc
		 * Purpose:  Create a wrapper function for exporting an internal func to an external API func
		 * Returns:  function: - wrapped function
		 * Inputs:   string:sFunc - API function name
		 */
		function _fnExternApiFunc (sFunc)
		{
			return function() {
					var aArgs = [_fnSettingsFromNode(this[_oExt.iApiIndex])].concat(
						Array.prototype.slice.call(arguments) );
					return _oExt.oApi[sFunc].apply( this, aArgs );
				};
		}

		for ( var sFunc in _oExt.oApi )
		{
			if ( sFunc )
			{
				/*
				 * Function: anon
				 * Purpose:  Wrap the plug-in API functions in order to provide the settings as 1st arg
				 *   and execute in this scope
				 * Returns:  -
				 * Inputs:   -
				 */
				this[sFunc] = _fnExternApiFunc(sFunc);
			}
		}



		/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
		 * Section - Local functions
		 * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */

		/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
		 * Section - Initalisation
		 */

		/*
		 * Function: _fnInitalise
		 * Purpose:  Draw the table for the first time, adding all required features
		 * Returns:  -
		 * Inputs:   object:oSettings - dataTables settings object
		 */
		function _fnInitalise ( oSettings )
		{
			var i, iLen, iAjaxStart=oSettings.iInitDisplayStart;

			/* Ensure that the table data is fully initialised */
			if ( oSettings.bInitialised === false )
			{
				setTimeout( function(){ _fnInitalise( oSettings ); }, 200 );
				return;
			}

			/* Show the display HTML options */
			_fnAddOptionsHtml( oSettings );

			/* Build and draw the header / footer for the table */
			_fnBuildHead( oSettings );
			_fnDrawHead( oSettings, oSettings.aoHeader );
			if ( oSettings.nTFoot )
			{
				_fnDrawHead( oSettings, oSettings.aoFooter );
			}

			/* Okay to show that something is going on now */
			_fnProcessingDisplay( oSettings, true );

			/* Calculate sizes for columns */
			if ( oSettings.oFeatures.bAutoWidth )
			{
				_fnCalculateColumnWidths( oSettings );
			}

			for ( i=0, iLen=oSettings.aoColumns.length ; i<iLen ; i++ )
			{
				if ( oSettings.aoColumns[i].sWidth !== null )
				{
					oSettings.aoColumns[i].nTh.style.width = _fnStringToCss( oSettings.aoColumns[i].sWidth );
				}
			}

			/* If there is default sorting required - let's do it. The sort function will do the
			 * drawing for us. Otherwise we draw the table regardless of the Ajax source - this allows
			 * the table to look initialised for Ajax sourcing data (show 'loading' message possibly)
			 */
			if ( oSettings.oFeatures.bSort )
			{
				_fnSort( oSettings );
			}
			else if ( oSettings.oFeatures.bFilter )
			{
				_fnFilterComplete( oSettings, oSettings.oPreviousSearch );
			}
			else
			{
				oSettings.aiDisplay = oSettings.aiDisplayMaster.slice();
				_fnCalculateEnd( oSettings );
				_fnDraw( oSettings );
			}

			/* if there is an ajax source load the data */
			if ( oSettings.sAjaxSource !== null && !oSettings.oFeatures.bServerSide )
			{
				oSettings.fnServerData.call( oSettings.oInstance, oSettings.sAjaxSource, [], function(json) {
					var aData = json;
					if ( oSettings.sAjaxDataProp !== "" )
					{
						var fnDataSrc = _fnGetObjectDataFn( oSettings.sAjaxDataProp );
						aData = fnDataSrc( json );
					}

					/* Got the data - add it to the table */
					for ( i=0 ; i<aData.length ; i++ )
					{
						_fnAddData( oSettings, aData[i] );
					}

					/* Reset the init display for cookie saving. We've already done a filter, and
					 * therefore cleared it before. So we need to make it appear 'fresh'
					 */
					oSettings.iInitDisplayStart = iAjaxStart;

					if ( oSettings.oFeatures.bSort )
					{
						_fnSort( oSettings );
					}
					else
					{
						oSettings.aiDisplay = oSettings.aiDisplayMaster.slice();
						_fnCalculateEnd( oSettings );
						_fnDraw( oSettings );
					}

					_fnProcessingDisplay( oSettings, false );
					_fnInitComplete( oSettings, json );
				}, oSettings );
				return;
			}

			/* Server-side processing initialisation complete is done at the end of _fnDraw */
			if ( !oSettings.oFeatures.bServerSide )
			{
				_fnProcessingDisplay( oSettings, false );
				_fnInitComplete( oSettings );
			}
		}

		/*
		 * Function: _fnInitalise
		 * Purpose:  Draw the table for the first time, adding all required features
		 * Returns:  -
		 * Inputs:   object:oSettings - dataTables settings object
		 */
		function _fnInitComplete ( oSettings, json )
		{
			oSettings._bInitComplete = true;
			if ( typeof oSettings.fnInitComplete == 'function' )
			{
				if ( typeof json != 'undefined' )
				{
					oSettings.fnInitComplete.call( oSettings.oInstance, oSettings, json );
				}
				else
				{
					oSettings.fnInitComplete.call( oSettings.oInstance, oSettings );
				}
			}
		}

		/*
		 * Function: _fnLanguageProcess
		 * Purpose:  Copy language variables from remote object to a local one
		 * Returns:  -
		 * Inputs:   object:oSettings - dataTables settings object
		 *           object:oLanguage - Language information
		 *           bool:bInit - init once complete
		 */
		function _fnLanguageProcess( oSettings, oLanguage, bInit )
		{
			_fnMap( oSettings.oLanguage, oLanguage, 'sProcessing' );
			_fnMap( oSettings.oLanguage, oLanguage, 'sLengthMenu' );
			_fnMap( oSettings.oLanguage, oLanguage, 'sEmptyTable' );
			_fnMap( oSettings.oLanguage, oLanguage, 'sLoadingRecords' );
			_fnMap( oSettings.oLanguage, oLanguage, 'sZeroRecords' );
			_fnMap( oSettings.oLanguage, oLanguage, 'sInfo' );
			_fnMap( oSettings.oLanguage, oLanguage, 'sInfoEmpty' );
			_fnMap( oSettings.oLanguage, oLanguage, 'sInfoFiltered' );
			_fnMap( oSettings.oLanguage, oLanguage, 'sInfoPostFix' );
			_fnMap( oSettings.oLanguage, oLanguage, 'sSearch' );

			if ( typeof oLanguage.oPaginate != 'undefined' )
			{
				_fnMap( oSettings.oLanguage.oPaginate, oLanguage.oPaginate, 'sFirst' );
				_fnMap( oSettings.oLanguage.oPaginate, oLanguage.oPaginate, 'sPrevious' );
				_fnMap( oSettings.oLanguage.oPaginate, oLanguage.oPaginate, 'sNext' );
				_fnMap( oSettings.oLanguage.oPaginate, oLanguage.oPaginate, 'sLast' );
			}

			/* Backwards compatibility - if there is no sEmptyTable given, then use the same as
			 * sZeroRecords - assuming that is given.
			 */
			if ( typeof oLanguage.sEmptyTable == 'undefined' &&
			     typeof oLanguage.sZeroRecords != 'undefined' )
			{
				_fnMap( oSettings.oLanguage, oLanguage, 'sZeroRecords', 'sEmptyTable' );
			}

			/* Likewise with loading records */
			if ( typeof oLanguage.sLoadingRecords == 'undefined' &&
			     typeof oLanguage.sZeroRecords != 'undefined' )
			{
				_fnMap( oSettings.oLanguage, oLanguage, 'sZeroRecords', 'sLoadingRecords' );
			}

			if ( bInit )
			{
				_fnInitalise( oSettings );
			}
		}

		/*
		 * Function: _fnAddColumn
		 * Purpose:  Add a column to the list used for the table with default values
		 * Returns:  -
		 * Inputs:   object:oSettings - dataTables settings object
		 *           node:nTh - the th element for this column
		 */
		function _fnAddColumn( oSettings, nTh )
		{
			var iCol = oSettings.aoColumns.length;
			var oCol = {
				"sType": null,
				"_bAutoType": true,
				"bVisible": true,
				"bSearchable": true,
				"bSortable": true,
				"asSorting": [ 'asc', 'desc' ],
				"sSortingClass": oSettings.oClasses.sSortable,
				"sSortingClassJUI": oSettings.oClasses.sSortJUI,
				"sTitle": nTh ? nTh.innerHTML : '',
				"sName": '',
				"sWidth": null,
				"sWidthOrig": null,
				"sClass": null,
				"fnRender": null,
				"bUseRendered": true,
				"iDataSort": iCol,
				"mDataProp": iCol,
				"fnGetData": null,
				"fnSetData": null,
				"sSortDataType": 'std',
				"sDefaultContent": null,
				"sContentPadding": "",
				"nTh": nTh ? nTh : document.createElement('th'),
				"nTf": null
			};
			oSettings.aoColumns.push( oCol );

			/* Add a column specific filter */
			if ( typeof oSettings.aoPreSearchCols[ iCol ] == 'undefined' ||
			     oSettings.aoPreSearchCols[ iCol ] === null )
			{
				oSettings.aoPreSearchCols[ iCol ] = {
					"sSearch": "",
					"bRegex": false,
					"bSmart": true
				};
			}
			else
			{
				/* Don't require that the user must specify bRegex and / or bSmart */
				if ( typeof oSettings.aoPreSearchCols[ iCol ].bRegex == 'undefined' )
				{
					oSettings.aoPreSearchCols[ iCol ].bRegex = true;
				}

				if ( typeof oSettings.aoPreSearchCols[ iCol ].bSmart == 'undefined' )
				{
					oSettings.aoPreSearchCols[ iCol ].bSmart = true;
				}
			}

			/* Use the column options function to initialise classes etc */
			_fnColumnOptions( oSettings, iCol, null );
		}

		/*
		 * Function: _fnColumnOptions
		 * Purpose:  Apply options for a column
		 * Returns:  -
		 * Inputs:   object:oSettings - dataTables settings object
		 *           int:iCol - column index to consider
		 *           object:oOptions - object with sType, bVisible and bSearchable
		 */
		function _fnColumnOptions( oSettings, iCol, oOptions )
		{
			var oCol = oSettings.aoColumns[ iCol ];

			/* User specified column options */
			if ( typeof oOptions != 'undefined' && oOptions !== null )
			{
				if ( typeof oOptions.sType != 'undefined' )
				{
					oCol.sType = oOptions.sType;
					oCol._bAutoType = false;
				}

				_fnMap( oCol, oOptions, "bVisible" );
				_fnMap( oCol, oOptions, "bSearchable" );
				_fnMap( oCol, oOptions, "bSortable" );
				_fnMap( oCol, oOptions, "sTitle" );
				_fnMap( oCol, oOptions, "sName" );
				_fnMap( oCol, oOptions, "sWidth" );
				_fnMap( oCol, oOptions, "sWidth", "sWidthOrig" );
				_fnMap( oCol, oOptions, "sClass" );
				_fnMap( oCol, oOptions, "fnRender" );
				_fnMap( oCol, oOptions, "bUseRendered" );
				_fnMap( oCol, oOptions, "iDataSort" );
				_fnMap( oCol, oOptions, "mDataProp" );
				_fnMap( oCol, oOptions, "asSorting" );
				_fnMap( oCol, oOptions, "sSortDataType" );
				_fnMap( oCol, oOptions, "sDefaultContent" );
				_fnMap( oCol, oOptions, "sContentPadding" );
			}

			/* Cache the data get and set functions for speed */
			oCol.fnGetData = _fnGetObjectDataFn( oCol.mDataProp );
			oCol.fnSetData = _fnSetObjectDataFn( oCol.mDataProp );

			/* Feature sorting overrides column specific when off */
			if ( !oSettings.oFeatures.bSort )
			{
				oCol.bSortable = false;
			}

			/* Check that the class assignment is correct for sorting */
			if ( !oCol.bSortable ||
					 ($.inArray('asc', oCol.asSorting) == -1 && $.inArray('desc', oCol.asSorting) == -1) )
			{
				oCol.sSortingClass = oSettings.oClasses.sSortableNone;
				oCol.sSortingClassJUI = "";
			}
			else if ( oCol.bSortable ||
                ($.inArray('asc', oCol.asSorting) == -1 && $.inArray('desc', oCol.asSorting) == -1) )
      {
        oCol.sSortingClass = oSettings.oClasses.sSortable;
        oCol.sSortingClassJUI = oSettings.oClasses.sSortJUI;
      }
			else if ( $.inArray('asc', oCol.asSorting) != -1 && $.inArray('desc', oCol.asSorting) == -1 )
			{
				oCol.sSortingClass = oSettings.oClasses.sSortableAsc;
				oCol.sSortingClassJUI = oSettings.oClasses.sSortJUIAscAllowed;
			}
			else if ( $.inArray('asc', oCol.asSorting) == -1 && $.inArray('desc', oCol.asSorting) != -1 )
			{
				oCol.sSortingClass = oSettings.oClasses.sSortableDesc;
				oCol.sSortingClassJUI = oSettings.oClasses.sSortJUIDescAllowed;
			}
		}

		/*
		 * Function: _fnAddData
		 * Purpose:  Add a data array to the table, creating DOM node etc
		 * Returns:  int: - >=0 if successful (index of new aoData entry), -1 if failed
		 * Inputs:   object:oSettings - dataTables settings object
		 *           array:aData - data array to be added
		 * Notes:    There are two basic methods for DataTables to get data to display - a JS array
		 *   (which is dealt with by this function), and the DOM, which has it's own optimised
		 *   function (_fnGatherData). Be careful to make the same changes here as there and vice-versa
		 */
		function _fnAddData ( oSettings, aDataSupplied )
		{
			var oCol;

			/* Take an independent copy of the data source so we can bash it about as we wish */
			var aDataIn = (typeof aDataSupplied.length == 'number') ?
				aDataSupplied.slice() :
				$.extend( true, {}, aDataSupplied );

			/* Create the object for storing information about this new row */
			var iRow = oSettings.aoData.length;
			var oData = {
				"nTr": null,
				"_iId": oSettings.iNextId++,
				"_aData": aDataIn,
				"_anHidden": [],
				"_sRowStripe": ""
			};
			oSettings.aoData.push( oData );

			/* Create the cells */
			var nTd, sThisType;
			for ( var i=0, iLen=oSettings.aoColumns.length ; i<iLen ; i++ )
			{
				oCol = oSettings.aoColumns[i];

				/* Use rendered data for filtering/sorting */
				if ( typeof oCol.fnRender == 'function' && oCol.bUseRendered && oCol.mDataProp !== null )
				{
					_fnSetCellData( oSettings, iRow, i, oCol.fnRender( {
						"iDataRow": iRow,
						"iDataColumn": i,
						"aData": oData._aData,
						"oSettings": oSettings
					} ) );
				}

				/* See if we should auto-detect the column type */
				if ( oCol._bAutoType && oCol.sType != 'string' )
				{
					/* Attempt to auto detect the type - same as _fnGatherData() */
					var sVarType = _fnGetCellData( oSettings, iRow, i, 'type' );
					if ( sVarType !== null && sVarType !== '' )
					{
						sThisType = _fnDetectType( sVarType );
						if ( oCol.sType === null )
						{
							oCol.sType = sThisType;
						}
						else if ( oCol.sType != sThisType )
						{
							/* String is always the 'fallback' option */
							oCol.sType = 'string';
						}
					}
				}
			}

			/* Add to the display array */
			oSettings.aiDisplayMaster.push( iRow );

			/* Create the DOM imformation */
			if ( !oSettings.oFeatures.bDeferRender )
			{
				_fnCreateTr( oSettings, iRow );
			}

			return iRow;
		}

		/*
		 * Function: _fnCreateTr
		 * Purpose:  Create a new TR element (and it's TD children) for a row
		 * Returns:  void
		 * Inputs:   object:oSettings - dataTables settings object
		 *           int:iRow - Row to consider
		 */
		function _fnCreateTr ( oSettings, iRow )
		{
			var oData = oSettings.aoData[iRow];
			var nTd;

			if ( oData.nTr === null )
			{
				oData.nTr = document.createElement('tr');

				/* Special parameters can be given by the data source to be used on the row */
				if ( typeof oData._aData.DT_RowId != 'undefined' )
				{
					oData.nTr.setAttribute( 'id', oData._aData.DT_RowId );
				}

				if ( typeof oData._aData.DT_RowClass != 'undefined' )
				{
					$(oData.nTr).addClass( oData._aData.DT_RowClass );
				}

				/* Process each column */
				for ( var i=0, iLen=oSettings.aoColumns.length ; i<iLen ; i++ )
				{
					var oCol = oSettings.aoColumns[i];
					nTd = document.createElement('td');

					/* Render if needed - if bUseRendered is true then we already have the rendered
					 * value in the data source - so can just use that
					 */
					if ( typeof oCol.fnRender == 'function' && (!oCol.bUseRendered || oCol.mDataProp === null) )
					{
						nTd.innerHTML = oCol.fnRender( {
							"iDataRow": iRow,
							"iDataColumn": i,
							"aData": oData._aData,
							"oSettings": oSettings
						} );
					}
					else
					{
						nTd.innerHTML = _fnGetCellData( oSettings, iRow, i, 'display' );
					}

					/* Add user defined class */
					if ( oCol.sClass !== null )
					{
						nTd.className = oCol.sClass;
					}

					if ( oCol.bVisible )
					{
						oData.nTr.appendChild( nTd );
						oData._anHidden[i] = null;
					}
					else
					{
						oData._anHidden[i] = nTd;
					}
				}
			}
		}

		/*
		 * Function: _fnGatherData
		 * Purpose:  Read in the data from the target table from the DOM
		 * Returns:  -
		 * Inputs:   object:oSettings - dataTables settings object
		 * Notes:    This is a optimised version of _fnAddData (more or less) for reading information
		 *   from the DOM. The basic actions must be identical in the two functions.
		 */
		function _fnGatherData( oSettings )
		{
			var iLoop, i, iLen, j, jLen, jInner,
			 	nTds, nTrs, nTd, aLocalData, iThisIndex,
				iRow, iRows, iColumn, iColumns, sNodeName;

			/*
			 * Process by row first
			 * Add the data object for the whole table - storing the tr node. Note - no point in getting
			 * DOM based data if we are going to go and replace it with Ajax source data.
			 */
			if ( oSettings.bDeferLoading || oSettings.sAjaxSource === null )
			{
				nTrs = oSettings.nTBody.childNodes;
				for ( i=0, iLen=nTrs.length ; i<iLen ; i++ )
				{
					if ( nTrs[i].nodeName.toUpperCase() == "TR" )
					{
						iThisIndex = oSettings.aoData.length;
						oSettings.aoData.push( {
							"nTr": nTrs[i],
							"_iId": oSettings.iNextId++,
							"_aData": [],
							"_anHidden": [],
							"_sRowStripe": ''
						} );

						oSettings.aiDisplayMaster.push( iThisIndex );
						nTds = nTrs[i].childNodes;
						jInner = 0;

						for ( j=0, jLen=nTds.length ; j<jLen ; j++ )
						{
							sNodeName = nTds[j].nodeName.toUpperCase();
							if ( sNodeName == "TD" || sNodeName == "TH" )
							{
								_fnSetCellData( oSettings, iThisIndex, jInner, $.trim(nTds[j].innerHTML) );
								jInner++;
							}
						}
					}
				}
			}

			/* Gather in the TD elements of the Table - note that this is basically the same as
			 * fnGetTdNodes, but that function takes account of hidden columns, which we haven't yet
			 * setup!
			 */
			nTrs = _fnGetTrNodes( oSettings );
			nTds = [];
			for ( i=0, iLen=nTrs.length ; i<iLen ; i++ )
			{
				for ( j=0, jLen=nTrs[i].childNodes.length ; j<jLen ; j++ )
				{
					nTd = nTrs[i].childNodes[j];
					sNodeName = nTd.nodeName.toUpperCase();
					if ( sNodeName == "TD" || sNodeName == "TH" )
					{
						nTds.push( nTd );
					}
				}
			}

			/* Sanity check */
			if ( nTds.length != nTrs.length * oSettings.aoColumns.length )
			{
				_fnLog( oSettings, 1, "Unexpected number of TD elements. Expected "+
					(nTrs.length * oSettings.aoColumns.length)+" and got "+nTds.length+". DataTables does "+
					"not support rowspan / colspan in the table body, and there must be one cell for each "+
					"row/column combination." );
			}

			/* Now process by column */
			for ( iColumn=0, iColumns=oSettings.aoColumns.length ; iColumn<iColumns ; iColumn++ )
			{
				/* Get the title of the column - unless there is a user set one */
				if ( oSettings.aoColumns[iColumn].sTitle === null )
				{
					oSettings.aoColumns[iColumn].sTitle = oSettings.aoColumns[iColumn].nTh.innerHTML;
				}

				var
					bAutoType = oSettings.aoColumns[iColumn]._bAutoType,
					bRender = typeof oSettings.aoColumns[iColumn].fnRender == 'function',
					bClass = oSettings.aoColumns[iColumn].sClass !== null,
					bVisible = oSettings.aoColumns[iColumn].bVisible,
					nCell, sThisType, sRendered, sValType;

				/* A single loop to rule them all (and be more efficient) */
				if ( bAutoType || bRender || bClass || !bVisible )
				{
					for ( iRow=0, iRows=oSettings.aoData.length ; iRow<iRows ; iRow++ )
					{
						nCell = nTds[ (iRow*iColumns) + iColumn ];

						/* Type detection */
						if ( bAutoType && oSettings.aoColumns[iColumn].sType != 'string' )
						{
							sValType = _fnGetCellData( oSettings, iRow, iColumn, 'type' );
							if ( sValType !== '' )
							{
								sThisType = _fnDetectType( sValType );
								if ( oSettings.aoColumns[iColumn].sType === null )
								{
									oSettings.aoColumns[iColumn].sType = sThisType;
								}
								else if ( oSettings.aoColumns[iColumn].sType != sThisType )
								{
									/* String is always the 'fallback' option */
									oSettings.aoColumns[iColumn].sType = 'string';
								}
							}
						}

						/* Rendering */
						if ( bRender )
						{
							sRendered = oSettings.aoColumns[iColumn].fnRender( {
									"iDataRow": iRow,
									"iDataColumn": iColumn,
									"aData": oSettings.aoData[iRow]._aData,
									"oSettings": oSettings
								} );
							nCell.innerHTML = sRendered;
							if ( oSettings.aoColumns[iColumn].bUseRendered )
							{
								/* Use the rendered data for filtering/sorting */
								_fnSetCellData( oSettings, iRow, iColumn, sRendered );
							}
						}

						/* Classes */
						if ( bClass )
						{
							nCell.className += ' '+oSettings.aoColumns[iColumn].sClass;
						}

						/* Column visability */
						if ( !bVisible )
						{
							oSettings.aoData[iRow]._anHidden[iColumn] = nCell;
							nCell.parentNode.removeChild( nCell );
						}
						else
						{
							oSettings.aoData[iRow]._anHidden[iColumn] = null;
						}
					}
				}
			}
		}

		/*
		 * Function: _fnBuildHead
		 * Purpose:  Create the HTML header for the table
		 * Returns:  -
		 * Inputs:   object:oSettings - dataTables settings object
		 */
		function _fnBuildHead( oSettings )
		{
			var i, nTh, iLen, j, jLen;
			var anTr = oSettings.nTHead.getElementsByTagName('tr');
			var iThs = oSettings.nTHead.getElementsByTagName('th').length;
			var iCorrector = 0;
			var jqChildren;

			/* If there is a header in place - then use it - otherwise it's going to get nuked... */
			if ( iThs !== 0 )
			{
				/* We've got a thead from the DOM, so remove hidden columns and apply width to vis cols */
				for ( i=0, iLen=oSettings.aoColumns.length ; i<iLen ; i++ )
				{
					nTh = oSettings.aoColumns[i].nTh;

					if ( oSettings.aoColumns[i].sClass !== null )
					{
						$(nTh).addClass( oSettings.aoColumns[i].sClass );
					}

					/* Set the title of the column if it is user defined (not what was auto detected) */
					if ( oSettings.aoColumns[i].sTitle != nTh.innerHTML )
					{
						nTh.innerHTML = oSettings.aoColumns[i].sTitle;
					}
				}
			}
			else
			{
				/* We don't have a header in the DOM - so we are going to have to create one */
				var nTr = document.createElement( "tr" );

				for ( i=0, iLen=oSettings.aoColumns.length ; i<iLen ; i++ )
				{
					nTh = oSettings.aoColumns[i].nTh;
					nTh.innerHTML = oSettings.aoColumns[i].sTitle;

					if ( oSettings.aoColumns[i].sClass !== null )
					{
						$(nTh).addClass( oSettings.aoColumns[i].sClass );
					}

					nTr.appendChild( nTh );
				}
				$(oSettings.nTHead).html( '' )[0].appendChild( nTr );
				_fnDetectHeader( oSettings.aoHeader, oSettings.nTHead );
			}

			/* Add the extra markup needed by jQuery UI's themes */
			if ( oSettings.bJUI )
			{
				for ( i=0, iLen=oSettings.aoColumns.length ; i<iLen ; i++ )
				{
					nTh = oSettings.aoColumns[i].nTh;

					var nDiv = document.createElement('div');
					nDiv.className = oSettings.oClasses.sSortJUIWrapper;
					$(nTh).contents().appendTo(nDiv);

					var nSpan = document.createElement('span');
					nSpan.className = oSettings.oClasses.sSortIcon;
					nDiv.appendChild( nSpan );
					nTh.appendChild( nDiv );
				}
			}

			/* Add sort listener */
			var fnNoSelect = function (e) {
				this.onselectstart = function() { return false; };
				return false;
			};

			if ( oSettings.oFeatures.bSort )
			{
				for ( i=0 ; i<oSettings.aoColumns.length ; i++ )
				{
					if ( oSettings.aoColumns[i].bSortable !== false )
					{
						_fnSortAttachListener( oSettings, oSettings.aoColumns[i].nTh, i );

						/* Take the brutal approach to cancelling text selection in header */
						$(oSettings.aoColumns[i].nTh).bind( 'mousedown.DT', fnNoSelect );
					}
					else
					{
						$(oSettings.aoColumns[i].nTh).addClass( oSettings.oClasses.sSortableNone );
					}
				}
			}

			/* Deal with the footer - add classes if required */
			if ( oSettings.oClasses.sFooterTH !== "" )
			{
				$('>tr>th', oSettings.nTFoot).addClass( oSettings.oClasses.sFooterTH );
			}

			/* Cache the footer elements */
			if ( oSettings.nTFoot !== null )
			{
				var anCells = _fnGetUniqueThs( oSettings, null, oSettings.aoFooter );
				for ( i=0, iLen=oSettings.aoColumns.length ; i<iLen ; i++ )
				{
					if ( typeof anCells[i] != 'undefined' )
					{
						oSettings.aoColumns[i].nTf = anCells[i];
					}
				}
			}
		}


		/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
		 * Section - Drawing functions
		 */

		/*
		 * Function: _fnDrawHead
		 * Purpose:  Draw the header (or footer) element based on the column visibility states. The
		 *           methodology here is to use the layout array from _fnDetectHeader, modified for
		 *           the instantaneous column visibility, to construct the new layout. The grid is
		 *           traversed over cell at a time in a rows x columns grid fashion, although each
		 *           cell insert can cover multiple elements in the grid - which is tracks using the
		 *           aApplied array. Cell inserts in the grid will only occur where there isn't
		 *           already a cell in that position.
		 * Returns:  -
		 * Inputs:   object:oSettings - dataTables settings object
		 *           array objects:aoSource - Layout array from _fnDetectHeader
		 *           boolean:bIncludeHidden - If true then include the hidden columns in the calc,
		 *             - optional: default false
		 */
		function _fnDrawHead( oSettings, aoSource, bIncludeHidden )
		{
			var i, iLen, j, jLen, k, kLen;
			var aoLocal = [];
			var aApplied = [];
			var iColumns = oSettings.aoColumns.length;
			var iRowspan, iColspan;

			if ( typeof bIncludeHidden == 'undefined' )
			{
				bIncludeHidden = false;
			}

			/* Make a copy of the master layout array, but without the visible columns in it */
			for ( i=0, iLen=aoSource.length ; i<iLen ; i++ )
			{
				aoLocal[i] = aoSource[i].slice();
				aoLocal[i].nTr = aoSource[i].nTr;

				/* Remove any columns which are currently hidden */
				for ( j=iColumns-1 ; j>=0 ; j-- )
				{
					if ( !oSettings.aoColumns[j].bVisible && !bIncludeHidden )
					{
						aoLocal[i].splice( j, 1 );
					}
				}

				/* Prep the applied array - it needs an element for each row */
				aApplied.push( [] );
			}

			for ( i=0, iLen=aoLocal.length ; i<iLen ; i++ )
			{
				/* All cells are going to be replaced, so empty out the row */
				if ( aoLocal[i].nTr )
				{
					for ( k=0, kLen=aoLocal[i].nTr.childNodes.length ; k<kLen ; k++ )
					{
						aoLocal[i].nTr.removeChild( aoLocal[i].nTr.childNodes[0] );
					}
				}

				for ( j=0, jLen=aoLocal[i].length ; j<jLen ; j++ )
				{
					iRowspan = 1;
					iColspan = 1;

					/* Check to see if there is already a cell (row/colspan) covering our target
					 * insert point. If there is, then there is nothing to do.
					 */
					if ( typeof aApplied[i][j] == 'undefined' )
					{
						aoLocal[i].nTr.appendChild( aoLocal[i][j].cell );
						aApplied[i][j] = 1;

						/* Expand the cell to cover as many rows as needed */
						while ( typeof aoLocal[i+iRowspan] != 'undefined' &&
						        aoLocal[i][j].cell == aoLocal[i+iRowspan][j].cell )
						{
							aApplied[i+iRowspan][j] = 1;
							iRowspan++;
						}

						/* Expand the cell to cover as many columns as needed */
						while ( typeof aoLocal[i][j+iColspan] != 'undefined' &&
						        aoLocal[i][j].cell == aoLocal[i][j+iColspan].cell )
						{
							/* Must update the applied array over the rows for the columns */
							for ( k=0 ; k<iRowspan ; k++ )
							{
								aApplied[i+k][j+iColspan] = 1;
							}
							iColspan++;
						}

						/* Do the actual expansion in the DOM */
						aoLocal[i][j].cell.setAttribute('rowspan', iRowspan);
						aoLocal[i][j].cell.setAttribute('colspan', iColspan);
					}
				}
			}
		}

		/*
		 * Function: _fnDraw
		 * Purpose:  Insert the required TR nodes into the table for display
		 * Returns:  -
		 * Inputs:   object:oSettings - dataTables settings object
		 */
		function _fnDraw( oSettings )
		{
			var i, iLen;
			var anRows = [];
			var iRowCount = 0;
			var bRowError = false;
			var iStrips = oSettings.asStripClasses.length;
			var iOpenRows = oSettings.aoOpenRows.length;

			/* Provide a pre-callback function which can be used to cancel the draw is false is returned */
			if ( oSettings.fnPreDrawCallback !== null &&
			     oSettings.fnPreDrawCallback.call( oSettings.oInstance, oSettings ) === false )
			{
			     return;
			}

			oSettings.bDrawing = true;

			/* Check and see if we have an initial draw position from state saving */
			if ( typeof oSettings.iInitDisplayStart != 'undefined' && oSettings.iInitDisplayStart != -1 )
			{
				if ( oSettings.oFeatures.bServerSide )
				{
					oSettings._iDisplayStart = oSettings.iInitDisplayStart;
				}
				else
				{
					oSettings._iDisplayStart = (oSettings.iInitDisplayStart >= oSettings.fnRecordsDisplay()) ?
						0 : oSettings.iInitDisplayStart;
				}
				oSettings.iInitDisplayStart = -1;
				_fnCalculateEnd( oSettings );
			}

			/* Server-side processing draw intercept */
			if ( oSettings.bDeferLoading )
			{
				oSettings.bDeferLoading = false;
				oSettings.iDraw++;
			}
			else if ( !oSettings.oFeatures.bServerSide )
			{
				oSettings.iDraw++;
			}
			else if ( !oSettings.bDestroying && !_fnAjaxUpdate( oSettings ) )
			{
				return;
			}

			if ( oSettings.aiDisplay.length !== 0 )
			{
				var iStart = oSettings._iDisplayStart;
				var iEnd = oSettings._iDisplayEnd;

				if ( oSettings.oFeatures.bServerSide )
				{
					iStart = 0;
					iEnd = oSettings.aoData.length;
				}

				for ( var j=iStart ; j<iEnd ; j++ )
				{
					var aoData = oSettings.aoData[ oSettings.aiDisplay[j] ];
					if ( aoData.nTr === null )
					{
						_fnCreateTr( oSettings, oSettings.aiDisplay[j] );
					}

					var nRow = aoData.nTr;

					/* Remove the old stripping classes and then add the new one */
					if ( iStrips !== 0 )
					{
						var sStrip = oSettings.asStripClasses[ iRowCount % iStrips ];
						if ( aoData._sRowStripe != sStrip )
						{
							$(nRow).removeClass( aoData._sRowStripe ).addClass( sStrip );
							aoData._sRowStripe = sStrip;
						}
					}

					/* Custom row callback function - might want to manipule the row */
					if ( typeof oSettings.fnRowCallback == "function" )
					{
						nRow = oSettings.fnRowCallback.call( oSettings.oInstance, nRow,
							oSettings.aoData[ oSettings.aiDisplay[j] ]._aData, iRowCount, j );
						if ( !nRow && !bRowError )
						{
							_fnLog( oSettings, 0, "A node was not returned by fnRowCallback" );
							bRowError = true;
						}
					}

					anRows.push( nRow );
					iRowCount++;

					/* If there is an open row - and it is attached to this parent - attach it on redraw */
					if ( iOpenRows !== 0 )
					{
						for ( var k=0 ; k<iOpenRows ; k++ )
						{
							if ( nRow == oSettings.aoOpenRows[k].nParent )
							{
								anRows.push( oSettings.aoOpenRows[k].nTr );
							}
						}
					}
				}
			}
			else
			{
				/* Table is empty - create a row with an empty message in it */
				anRows[ 0 ] = document.createElement( 'tr' );

				if ( typeof oSettings.asStripClasses[0] != 'undefined' )
				{
					anRows[ 0 ].className = oSettings.asStripClasses[0];
				}

				var sZero = oSettings.oLanguage.sZeroRecords.replace(
					'_MAX_', oSettings.fnFormatNumber(oSettings.fnRecordsTotal()) );
				if ( oSettings.iDraw == 1 && oSettings.sAjaxSource !== null && !oSettings.oFeatures.bServerSide )
				{
					sZero = oSettings.oLanguage.sLoadingRecords;
				}
				else if ( typeof oSettings.oLanguage.sEmptyTable != 'undefined' &&
				     oSettings.fnRecordsTotal() === 0 )
				{
					sZero = oSettings.oLanguage.sEmptyTable;
				}

				var nTd = document.createElement( 'td' );
				nTd.setAttribute( 'valign', "top" );
				nTd.colSpan = _fnVisbleColumns( oSettings );
				nTd.className = oSettings.oClasses.sRowEmpty;
				nTd.innerHTML = sZero;

				anRows[ iRowCount ].appendChild( nTd );
			}

			/* Callback the header and footer custom funcation if there is one */
			if ( typeof oSettings.fnHeaderCallback == 'function' )
			{
				oSettings.fnHeaderCallback.call( oSettings.oInstance, $('>tr', oSettings.nTHead)[0],
					_fnGetDataMaster( oSettings ), oSettings._iDisplayStart, oSettings.fnDisplayEnd(),
					oSettings.aiDisplay );
			}

			if ( typeof oSettings.fnFooterCallback == 'function' )
			{
				oSettings.fnFooterCallback.call( oSettings.oInstance, $('>tr', oSettings.nTFoot)[0],
					_fnGetDataMaster( oSettings ), oSettings._iDisplayStart, oSettings.fnDisplayEnd(),
					oSettings.aiDisplay );
			}

			/*
			 * Need to remove any old row from the display - note we can't just empty the tbody using
			 * $().html('') since this will unbind the jQuery event handlers (even although the node
			 * still exists!) - equally we can't use innerHTML, since IE throws an exception.
			 */
			var
				nAddFrag = document.createDocumentFragment(),
				nRemoveFrag = document.createDocumentFragment(),
				nBodyPar, nTrs;

			if ( oSettings.nTBody )
			{
				nBodyPar = oSettings.nTBody.parentNode;
				nRemoveFrag.appendChild( oSettings.nTBody );

				/* When doing infinite scrolling, only remove child rows when sorting, filtering or start
				 * up. When not infinite scroll, always do it.
				 */
				if ( !oSettings.oScroll.bInfinite || !oSettings._bInitComplete ||
				 	oSettings.bSorted || oSettings.bFiltered )
				{
					nTrs = oSettings.nTBody.childNodes;
					for ( i=nTrs.length-1 ; i>=0 ; i-- )
					{
						nTrs[i].parentNode.removeChild( nTrs[i] );
					}
				}

				/* Put the draw table into the dom */
				for ( i=0, iLen=anRows.length ; i<iLen ; i++ )
				{
					nAddFrag.appendChild( anRows[i] );
				}

				oSettings.nTBody.appendChild( nAddFrag );
				if ( nBodyPar !== null )
				{
					nBodyPar.appendChild( oSettings.nTBody );
				}
			}

			/* Call all required callback functions for the end of a draw */
			for ( i=oSettings.aoDrawCallback.length-1 ; i>=0 ; i-- )
			{
				oSettings.aoDrawCallback[i].fn.call( oSettings.oInstance, oSettings );
			}

			/* Draw is complete, sorting and filtering must be as well */
			oSettings.bSorted = false;
			oSettings.bFiltered = false;
			oSettings.bDrawing = false;

			if ( oSettings.oFeatures.bServerSide )
			{
				_fnProcessingDisplay( oSettings, false );
				if ( typeof oSettings._bInitComplete == 'undefined' )
				{
					_fnInitComplete( oSettings );
				}
			}
		}

		/*
		 * Function: _fnReDraw
		 * Purpose:  Redraw the table - taking account of the various features which are enabled
		 * Returns:  -
		 * Inputs:   object:oSettings - dataTables settings object
		 */
		function _fnReDraw( oSettings )
		{
			if ( oSettings.oFeatures.bSort )
			{
				/* Sorting will refilter and draw for us */
				_fnSort( oSettings, oSettings.oPreviousSearch );
			}
			else if ( oSettings.oFeatures.bFilter )
			{
				/* Filtering will redraw for us */
				_fnFilterComplete( oSettings, oSettings.oPreviousSearch );
			}
			else
			{
				_fnCalculateEnd( oSettings );
				_fnDraw( oSettings );
			}
		}

		/*
		 * Function: _fnAjaxUpdate
		 * Purpose:  Update the table using an Ajax call
		 * Returns:  bool: block the table drawing or not
		 * Inputs:   object:oSettings - dataTables settings object
		 */
		function _fnAjaxUpdate( oSettings )
		{
			if ( oSettings.bAjaxDataGet )
			{
				_fnProcessingDisplay( oSettings, true );
				var iColumns = oSettings.aoColumns.length;
				var aoData = [], mDataProp;
				var i;

				/* Paging and general */
				oSettings.iDraw++;
				aoData.push( { "name": "sEcho",          "value": oSettings.iDraw } );
				aoData.push( { "name": "iColumns",       "value": iColumns } );
				aoData.push( { "name": "sColumns",       "value": _fnColumnOrdering(oSettings) } );
				aoData.push( { "name": "iDisplayStart",  "value": oSettings._iDisplayStart } );
				aoData.push( { "name": "iDisplayLength", "value": oSettings.oFeatures.bPaginate !== false ?
					oSettings._iDisplayLength : -1 } );

				for ( i=0 ; i<iColumns ; i++ )
				{
				  mDataProp = oSettings.aoColumns[i].mDataProp;
					aoData.push( { "name": "mDataProp_"+i, "value": typeof(mDataProp)=="function" ? 'function' : mDataProp } );
				}

				/* Filtering */
				if ( oSettings.oFeatures.bFilter !== false )
				{
					aoData.push( { "name": "sSearch", "value": oSettings.oPreviousSearch.sSearch } );
					aoData.push( { "name": "bRegex",  "value": oSettings.oPreviousSearch.bRegex } );
					for ( i=0 ; i<iColumns ; i++ )
					{
						aoData.push( { "name": "sSearch_"+i,     "value": oSettings.aoPreSearchCols[i].sSearch } );
						aoData.push( { "name": "bRegex_"+i,      "value": oSettings.aoPreSearchCols[i].bRegex } );
						aoData.push( { "name": "bSearchable_"+i, "value": oSettings.aoColumns[i].bSearchable } );
					}
				}

				/* Sorting */
				if ( oSettings.oFeatures.bSort !== false )
				{
					var iFixed = oSettings.aaSortingFixed !== null ? oSettings.aaSortingFixed.length : 0;
					var iUser = oSettings.aaSorting.length;
					aoData.push( { "name": "iSortingCols",   "value": iFixed+iUser } );
					for ( i=0 ; i<iFixed ; i++ )
					{
						aoData.push( { "name": "iSortCol_"+i,  "value": oSettings.aaSortingFixed[i][0] } );
						aoData.push( { "name": "sSortDir_"+i,  "value": oSettings.aaSortingFixed[i][1] } );
					}

					for ( i=0 ; i<iUser ; i++ )
					{
						aoData.push( { "name": "iSortCol_"+(i+iFixed),  "value": oSettings.aaSorting[i][0] } );
						aoData.push( { "name": "sSortDir_"+(i+iFixed),  "value": oSettings.aaSorting[i][1] } );
					}

					for ( i=0 ; i<iColumns ; i++ )
					{
						aoData.push( { "name": "bSortable_"+i,  "value": oSettings.aoColumns[i].bSortable } );
					}
				}

				oSettings.fnServerData.call( oSettings.oInstance, oSettings.sAjaxSource, aoData,
					function(json) {
						_fnAjaxUpdateDraw( oSettings, json );
					}, oSettings );
				return false;
			}
			else
			{
				return true;
			}
		}

		/*
		 * Function: _fnAjaxUpdateDraw
		 * Purpose:  Data the data from the server (nuking the old) and redraw the table
		 * Returns:  -
		 * Inputs:   object:oSettings - dataTables settings object
		 *           object:json - json data return from the server.
		 *             The following must be defined:
		 *               iTotalRecords, iTotalDisplayRecords, aaData
		 *             The following may be defined:
		 *               sColumns
		 */
		function _fnAjaxUpdateDraw ( oSettings, json )
		{
			if ( typeof json.sEcho != 'undefined' )
			{
				/* Protect against old returns over-writing a new one. Possible when you get
				 * very fast interaction, and later queires are completed much faster
				 */
				if ( json.sEcho*1 < oSettings.iDraw )
				{
					return;
				}
				else
				{
					oSettings.iDraw = json.sEcho * 1;
				}
			}

			if ( !oSettings.oScroll.bInfinite ||
				   (oSettings.oScroll.bInfinite && (oSettings.bSorted || oSettings.bFiltered)) )
			{
				_fnClearTable( oSettings );
			}
			oSettings._iRecordsTotal = json.iTotalRecords;
			oSettings._iRecordsDisplay = json.iTotalDisplayRecords;

			/* Determine if reordering is required */
			var sOrdering = _fnColumnOrdering(oSettings);
			var bReOrder = (typeof json.sColumns != 'undefined' && sOrdering !== "" && json.sColumns != sOrdering );
			if ( bReOrder )
			{
				var aiIndex = _fnReOrderIndex( oSettings, json.sColumns );
			}

			var fnDataSrc = _fnGetObjectDataFn( oSettings.sAjaxDataProp );
			var aData = fnDataSrc( json );

			for ( var i=0, iLen=aData.length ; i<iLen ; i++ )
			{
				if ( bReOrder )
				{
					/* If we need to re-order, then create a new array with the correct order and add it */
					var aDataSorted = [];
					for ( var j=0, jLen=oSettings.aoColumns.length ; j<jLen ; j++ )
					{
						aDataSorted.push( aData[i][ aiIndex[j] ] );
					}
					_fnAddData( oSettings, aDataSorted );
				}
				else
				{
					/* No re-order required, sever got it "right" - just straight add */
					_fnAddData( oSettings, aData[i] );
				}
			}
			oSettings.aiDisplay = oSettings.aiDisplayMaster.slice();

			oSettings.bAjaxDataGet = false;
			_fnDraw( oSettings );
			oSettings.bAjaxDataGet = true;
			_fnProcessingDisplay( oSettings, false );
		}


		/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
		 * Section - Options (features) HTML
		 */

		/*
		 * Function: _fnAddOptionsHtml
		 * Purpose:  Add the options to the page HTML for the table
		 * Returns:  -
		 * Inputs:   object:oSettings - dataTables settings object
		 */
		function _fnAddOptionsHtml ( oSettings )
		{
			/*
			 * Create a temporary, empty, div which we can later on replace with what we have generated
			 * we do it this way to rendering the 'options' html offline - speed :-)
			 */
			var nHolding = document.createElement( 'div' );
			oSettings.nTable.parentNode.insertBefore( nHolding, oSettings.nTable );

			/*
			 * All DataTables are wrapped in a div
			 */
			oSettings.nTableWrapper = document.createElement( 'div' );
			oSettings.nTableWrapper.className = oSettings.oClasses.sWrapper;
			if ( oSettings.sTableId !== '' )
			{
				oSettings.nTableWrapper.setAttribute( 'id', oSettings.sTableId+'_wrapper' );
			}

			oSettings.nTableReinsertBefore = oSettings.nTable.nextSibling;

			/* Track where we want to insert the option */
			var nInsertNode = oSettings.nTableWrapper;

			/* Loop over the user set positioning and place the elements as needed */
			var aDom = oSettings.sDom.split('');
			var nTmp, iPushFeature, cOption, nNewNode, cNext, sAttr, j;
			for ( var i=0 ; i<aDom.length ; i++ )
			{
				iPushFeature = 0;
				cOption = aDom[i];

				if ( cOption == '<' )
				{
					/* New container div */
					nNewNode = document.createElement( 'div' );

					/* Check to see if we should append an id and/or a class name to the container */
					cNext = aDom[i+1];
					if ( cNext == "'" || cNext == '"' )
					{
						sAttr = "";
						j = 2;
						while ( aDom[i+j] != cNext )
						{
							sAttr += aDom[i+j];
							j++;
						}

						/* Replace jQuery UI constants */
						if ( sAttr == "H" )
						{
							sAttr = "fg-toolbar ui-toolbar ui-widget-header ui-corner-tl ui-corner-tr ui-helper-clearfix";
						}
						else if ( sAttr == "F" )
						{
							sAttr = "fg-toolbar ui-toolbar ui-widget-header ui-corner-bl ui-corner-br ui-helper-clearfix";
						}

						/* The attribute can be in the format of "#id.class", "#id" or "class" This logic
						 * breaks the string into parts and applies them as needed
						 */
						if ( sAttr.indexOf('.') != -1 )
						{
							var aSplit = sAttr.split('.');
							nNewNode.setAttribute('id', aSplit[0].substr(1, aSplit[0].length-1) );
							nNewNode.className = aSplit[1];
						}
						else if ( sAttr.charAt(0) == "#" )
						{
							nNewNode.setAttribute('id', sAttr.substr(1, sAttr.length-1) );
						}
						else
						{
							nNewNode.className = sAttr;
						}

						i += j; /* Move along the position array */
					}

					nInsertNode.appendChild( nNewNode );
					nInsertNode = nNewNode;
				}
				else if ( cOption == '>' )
				{
					/* End container div */
					nInsertNode = nInsertNode.parentNode;
				}
				else if ( cOption == 'l' && oSettings.oFeatures.bPaginate && oSettings.oFeatures.bLengthChange )
				{
					/* Length */
					nTmp = _fnFeatureHtmlLength( oSettings );
					iPushFeature = 1;
				}
				else if ( cOption == 'f' && oSettings.oFeatures.bFilter )
				{
					/* Filter */
					nTmp = _fnFeatureHtmlFilter( oSettings );
					iPushFeature = 1;
				}
				else if ( cOption == 'r' && oSettings.oFeatures.bProcessing )
				{
					/* pRocessing */
					nTmp = _fnFeatureHtmlProcessing( oSettings );
					iPushFeature = 1;
				}
				else if ( cOption == 't' )
				{
					/* Table */
					nTmp = _fnFeatureHtmlTable( oSettings );
					iPushFeature = 1;
				}
				else if ( cOption ==  'i' && oSettings.oFeatures.bInfo )
				{
					/* Info */
					nTmp = _fnFeatureHtmlInfo( oSettings );
					iPushFeature = 1;
				}
				else if ( cOption == 'p' && oSettings.oFeatures.bPaginate )
				{
					/* Pagination */
					nTmp = _fnFeatureHtmlPaginate( oSettings );
					iPushFeature = 1;
				}
				else if ( _oExt.aoFeatures.length !== 0 )
				{
					/* Plug-in features */
					var aoFeatures = _oExt.aoFeatures;
					for ( var k=0, kLen=aoFeatures.length ; k<kLen ; k++ )
					{
						if ( cOption == aoFeatures[k].cFeature )
						{
							nTmp = aoFeatures[k].fnInit( oSettings );
							if ( nTmp )
							{
								iPushFeature = 1;
							}
							break;
						}
					}
				}

				/* Add to the 2D features array */
				if ( iPushFeature == 1 && nTmp !== null )
				{
					if ( typeof oSettings.aanFeatures[cOption] != 'object' )
					{
						oSettings.aanFeatures[cOption] = [];
					}
					oSettings.aanFeatures[cOption].push( nTmp );
					nInsertNode.appendChild( nTmp );
				}
			}

			/* Built our DOM structure - replace the holding div with what we want */
			nHolding.parentNode.replaceChild( oSettings.nTableWrapper, nHolding );
		}


		/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
		 * Section - Feature: Filtering
		 */

		/*
		 * Function: _fnFeatureHtmlTable
		 * Purpose:  Add any control elements for the table - specifically scrolling
		 * Returns:  node: - Node to add to the DOM
		 * Inputs:   object:oSettings - dataTables settings object
		 */
		function _fnFeatureHtmlTable ( oSettings )
		{
			/* Chack if scrolling is enabled or not - if not then leave the DOM unaltered */
			if ( oSettings.oScroll.sX === "" && oSettings.oScroll.sY === "" )
			{
				return oSettings.nTable;
			}

			/*
			 * The HTML structure that we want to generate in this function is:
			 *  div - nScroller
			 *    div - nScrollHead
			 *      div - nScrollHeadInner
			 *        table - nScrollHeadTable
			 *          thead - nThead
			 *    div - nScrollBody
			 *      table - oSettings.nTable
			 *        thead - nTheadSize
			 *        tbody - nTbody
			 *    div - nScrollFoot
			 *      div - nScrollFootInner
			 *        table - nScrollFootTable
			 *          tfoot - nTfoot
			 */
			var
			 	nScroller = document.createElement('div'),
			 	nScrollHead = document.createElement('div'),
			 	nScrollHeadInner = document.createElement('div'),
			 	nScrollBody = document.createElement('div'),
			 	nScrollFoot = document.createElement('div'),
			 	nScrollFootInner = document.createElement('div'),
			 	nScrollHeadTable = oSettings.nTable.cloneNode(false),
			 	nScrollFootTable = oSettings.nTable.cloneNode(false),
				nThead = oSettings.nTable.getElementsByTagName('thead')[0],
			 	nTfoot = oSettings.nTable.getElementsByTagName('tfoot').length === 0 ? null :
					oSettings.nTable.getElementsByTagName('tfoot')[0],
				oClasses = (typeof oInit.bJQueryUI != 'undefined' && oInit.bJQueryUI) ?
					_oExt.oJUIClasses : _oExt.oStdClasses;

			nScrollHead.appendChild( nScrollHeadInner );
			nScrollFoot.appendChild( nScrollFootInner );
			nScrollBody.appendChild( oSettings.nTable );
			nScroller.appendChild( nScrollHead );
			nScroller.appendChild( nScrollBody );
			nScrollHeadInner.appendChild( nScrollHeadTable );
			nScrollHeadTable.appendChild( nThead );
			if ( nTfoot !== null )
			{
				nScroller.appendChild( nScrollFoot );
				nScrollFootInner.appendChild( nScrollFootTable );
				nScrollFootTable.appendChild( nTfoot );
			}

			nScroller.className = oClasses.sScrollWrapper;
			nScrollHead.className = oClasses.sScrollHead;
			nScrollHeadInner.className = oClasses.sScrollHeadInner;
			nScrollBody.className = oClasses.sScrollBody;
			nScrollFoot.className = oClasses.sScrollFoot;
			nScrollFootInner.className = oClasses.sScrollFootInner;

			if ( oSettings.oScroll.bAutoCss )
			{
				nScrollHead.style.overflow = "hidden";
				nScrollHead.style.position = "relative";
				nScrollFoot.style.overflow = "hidden";
				nScrollBody.style.overflow = "auto";
			}

			nScrollHead.style.border = "0";
			nScrollHead.style.width = "100%";
			nScrollFoot.style.border = "0";
			nScrollHeadInner.style.width = "150%"; /* will be overwritten */

			/* Modify attributes to respect the clones */
			nScrollHeadTable.removeAttribute('id');
			nScrollHeadTable.style.marginLeft = "0";
			oSettings.nTable.style.marginLeft = "0";
			if ( nTfoot !== null )
			{
				nScrollFootTable.removeAttribute('id');
				nScrollFootTable.style.marginLeft = "0";
			}

			/* Move any caption elements from the body to the header */
			var nCaptions = $('>caption', oSettings.nTable);
			for ( var i=0, iLen=nCaptions.length ; i<iLen ; i++ )
			{
				nScrollHeadTable.appendChild( nCaptions[i] );
			}

			/*
			 * Sizing
			 */
			/* When xscrolling add the width and a scroller to move the header with the body */
			if ( oSettings.oScroll.sX !== "" )
			{
				nScrollHead.style.width = _fnStringToCss( oSettings.oScroll.sX );
				nScrollBody.style.width = _fnStringToCss( oSettings.oScroll.sX );

				if ( nTfoot !== null )
				{
					nScrollFoot.style.width = _fnStringToCss( oSettings.oScroll.sX );
				}

				/* When the body is scrolled, then we also want to scroll the headers */
				$(nScrollBody).scroll( function (e) {
					nScrollHead.scrollLeft = this.scrollLeft;

					if ( nTfoot !== null )
					{
						nScrollFoot.scrollLeft = this.scrollLeft;
					}
				} );
			}

			/* When yscrolling, add the height */
			if ( oSettings.oScroll.sY !== "" )
			{
				nScrollBody.style.height = _fnStringToCss( oSettings.oScroll.sY );
			}

			/* Redraw - align columns across the tables */
			oSettings.aoDrawCallback.push( {
				"fn": _fnScrollDraw,
				"sName": "scrolling"
			} );

			/* Infinite scrolling event handlers */
			if ( oSettings.oScroll.bInfinite )
			{
				$(nScrollBody).scroll( function() {
					/* Use a blocker to stop scrolling from loading more data while other data is still loading */
					if ( !oSettings.bDrawing )
					{
						/* Check if we should load the next data set */
						if ( $(this).scrollTop() + $(this).height() >
							$(oSettings.nTable).height() - oSettings.oScroll.iLoadGap )
						{
							/* Only do the redraw if we have to - we might be at the end of the data */
							if ( oSettings.fnDisplayEnd() < oSettings.fnRecordsDisplay() )
							{
								_fnPageChange( oSettings, 'next' );
								_fnCalculateEnd( oSettings );
								_fnDraw( oSettings );
							}
						}
					}
				} );
			}

			oSettings.nScrollHead = nScrollHead;
			oSettings.nScrollFoot = nScrollFoot;

			return nScroller;
		}

		/*
		 * Function: _fnScrollDraw
		 * Purpose:  Update the various tables for resizing
		 * Returns:  node: - Node to add to the DOM
		 * Inputs:   object:o - dataTables settings object
		 * Notes:    It's a bit of a pig this function, but basically the idea to:
		 *   1. Re-create the table inside the scrolling div
		 *   2. Take live measurements from the DOM
		 *   3. Apply the measurements
		 *   4. Clean up
		 */
		function _fnScrollDraw ( o )
		{
			var
				nScrollHeadInner = o.nScrollHead.getElementsByTagName('div')[0],
				nScrollHeadTable = nScrollHeadInner.getElementsByTagName('table')[0],
				nScrollBody = o.nTable.parentNode,
				i, iLen, j, jLen, anHeadToSize, anHeadSizers, anFootSizers, anFootToSize, oStyle, iVis,
				iWidth, aApplied=[], iSanityWidth;

			/*
			 * 1. Re-create the table inside the scrolling div
			 */

			/* Remove the old minimised thead and tfoot elements in the inner table */
			var nTheadSize = o.nTable.getElementsByTagName('thead');
			if ( nTheadSize.length > 0 )
			{
				o.nTable.removeChild( nTheadSize[0] );
			}

			if ( o.nTFoot !== null )
			{
				/* Remove the old minimised footer element in the cloned header */
				var nTfootSize = o.nTable.getElementsByTagName('tfoot');
				if ( nTfootSize.length > 0 )
				{
					o.nTable.removeChild( nTfootSize[0] );
				}
			}

			/* Clone the current header and footer elements and then place it into the inner table */
			nTheadSize = o.nTHead.cloneNode(true);
			o.nTable.insertBefore( nTheadSize, o.nTable.childNodes[0] );

			if ( o.nTFoot !== null )
			{
				nTfootSize = o.nTFoot.cloneNode(true);
				o.nTable.insertBefore( nTfootSize, o.nTable.childNodes[1] );
			}

			/*
			 * 2. Take live measurements from the DOM - do not alter the DOM itself!
			 */

			/* Remove old sizing and apply the calculated column widths
			 * Get the unique column headers in the newly created (cloned) header. We want to apply the
			 * calclated sizes to this header
			 */
			if ( o.oScroll.sX === "" )
			{
				nScrollBody.style.width = '100%';
				nScrollHeadInner.parentNode.style.width = '100%';
			}

			var nThs = _fnGetUniqueThs( o, nTheadSize );
			for ( i=0, iLen=nThs.length ; i<iLen ; i++ )
			{
				iVis = _fnVisibleToColumnIndex( o, i );
				nThs[i].style.width = o.aoColumns[iVis].sWidth;
			}

			if ( o.nTFoot !== null )
			{
				_fnApplyToChildren( function(n) {
					n.style.width = "";
				}, nTfootSize.getElementsByTagName('tr') );
			}

			/* Size the table as a whole */
			iSanityWidth = $(o.nTable).outerWidth();
			if ( o.oScroll.sX === "" )
			{
				/* No x scrolling */
				o.nTable.style.width = "100%";

				/* I know this is rubbish - but IE7 will make the width of the table when 100% include
				 * the scrollbar - which is shouldn't. This needs feature detection in future - to do
				 */
				if ( $.browser.msie && $.browser.version <= 7 )
				{
					o.nTable.style.width = _fnStringToCss( $(o.nTable).outerWidth()-o.oScroll.iBarWidth );
				}
			}
			else
			{
				if ( o.oScroll.sXInner !== "" )
				{
					/* x scroll inner has been given - use it */
					o.nTable.style.width = _fnStringToCss(o.oScroll.sXInner);
				}
				else if ( iSanityWidth == $(nScrollBody).width() &&
				   $(nScrollBody).height() < $(o.nTable).height() )
				{
					/* There is y-scrolling - try to take account of the y scroll bar */
					o.nTable.style.width = _fnStringToCss( iSanityWidth-o.oScroll.iBarWidth );
					if ( $(o.nTable).outerWidth() > iSanityWidth-o.oScroll.iBarWidth )
					{
						/* Not possible to take account of it */
						o.nTable.style.width = _fnStringToCss( iSanityWidth );
					}
				}
				else
				{
					/* All else fails */
					o.nTable.style.width = _fnStringToCss( iSanityWidth );
				}
			}

			/* Recalculate the sanity width - now that we've applied the required width, before it was
			 * a temporary variable. This is required because the column width calculation is done
			 * before this table DOM is created.
			 */
			iSanityWidth = $(o.nTable).outerWidth();

			/* If x-scrolling is disabled, then the viewport cannot be less than the sanity width */
			if ( o.oScroll.sX === "" )
			{
				nScrollBody.style.width = _fnStringToCss( iSanityWidth+o.oScroll.iBarWidth );
				nScrollHeadInner.parentNode.style.width = _fnStringToCss( iSanityWidth+o.oScroll.iBarWidth );
			}

			/* We want the hidden header to have zero height, so remove padding and borders. Then
			 * set the width based on the real headers
			 */
			anHeadToSize = o.nTHead.getElementsByTagName('tr');
			anHeadSizers = nTheadSize.getElementsByTagName('tr');

			_fnApplyToChildren( function(nSizer, nToSize) {
				oStyle = nSizer.style;
				oStyle.paddingTop = "0";
				oStyle.paddingBottom = "0";
				oStyle.borderTopWidth = "0";
				oStyle.borderBottomWidth = "0";
				oStyle.height = 0;

				iWidth = $(nSizer).width();
				nToSize.style.width = _fnStringToCss( iWidth );
				aApplied.push( iWidth );
			}, anHeadSizers, anHeadToSize );
			$(anHeadSizers).height(0);

			if ( o.nTFoot !== null )
			{
				/* Clone the current footer and then place it into the body table as a "hidden header" */
				anFootSizers = nTfootSize.getElementsByTagName('tr');
				anFootToSize = o.nTFoot.getElementsByTagName('tr');

				_fnApplyToChildren( function(nSizer, nToSize) {
					oStyle = nSizer.style;
					oStyle.paddingTop = "0";
					oStyle.paddingBottom = "0";
					oStyle.borderTopWidth = "0";
					oStyle.borderBottomWidth = "0";
					oStyle.height = 0;

					iWidth = $(nSizer).width();
					nToSize.style.width = _fnStringToCss( iWidth );
					aApplied.push( iWidth );
				}, anFootSizers, anFootToSize );
				$(anFootSizers).height(0);
			}

			/*
			 * 3. Apply the measurements
			 */

			/* "Hide" the header and footer that we used for the sizing. We want to also fix their width
			 * to what they currently are
			 */
			_fnApplyToChildren( function(nSizer) {
				nSizer.innerHTML = "";
				nSizer.style.width = _fnStringToCss( aApplied.shift() );
			}, anHeadSizers );

			if ( o.nTFoot !== null )
			{
				_fnApplyToChildren( function(nSizer) {
					nSizer.innerHTML = "";
					nSizer.style.width = _fnStringToCss( aApplied.shift() );
				}, anFootSizers );
			}

			/* Sanity check that the table is of a sensible width. If not then we are going to get
			 * misalignment
			 */
			if ( $(o.nTable).outerWidth() < iSanityWidth )
			{
				if ( o.oScroll.sX === "" )
				{
					_fnLog( o, 1, "The table cannot fit into the current element which will cause column"+
						" misalignment. It is suggested that you enable x-scrolling or increase the width"+
						" the table has in which to be drawn" );
				}
				else if ( o.oScroll.sXInner !== "" )
				{
					_fnLog( o, 1, "The table cannot fit into the current element which will cause column"+
						" misalignment. It is suggested that you increase the sScrollXInner property to"+
						" allow it to draw in a larger area, or simply remove that parameter to allow"+
						" automatic calculation" );
				}
			}


			/*
			 * 4. Clean up
			 */

			if ( o.oScroll.sY === "" )
			{
				/* IE7< puts a vertical scrollbar in place (when it shouldn't be) due to subtracting
				 * the scrollbar height from the visible display, rather than adding it on. We need to
				 * set the height in order to sort this. Don't want to do it in any other browsers.
				 */
				if ( $.browser.msie && $.browser.version <= 7 )
				{
					nScrollBody.style.height = _fnStringToCss( o.nTable.offsetHeight+o.oScroll.iBarWidth );
				}
			}

			if ( o.oScroll.sY !== "" && o.oScroll.bCollapse )
			{
				nScrollBody.style.height = _fnStringToCss( o.oScroll.sY );

				var iExtra = (o.oScroll.sX !== "" && o.nTable.offsetWidth > nScrollBody.offsetWidth) ?
				 	o.oScroll.iBarWidth : 0;
				if ( o.nTable.offsetHeight < nScrollBody.offsetHeight )
				{
					nScrollBody.style.height = _fnStringToCss( $(o.nTable).height()+iExtra );
				}
			}

			/* Finally set the width's of the header and footer tables */
			var iOuterWidth = $(o.nTable).outerWidth();
			nScrollHeadTable.style.width = _fnStringToCss( iOuterWidth );
			nScrollHeadInner.style.width = _fnStringToCss( iOuterWidth+o.oScroll.iBarWidth );

			if ( o.nTFoot !== null )
			{
				var
					nScrollFootInner = o.nScrollFoot.getElementsByTagName('div')[0],
					nScrollFootTable = nScrollFootInner.getElementsByTagName('table')[0];

				nScrollFootInner.style.width = _fnStringToCss( o.nTable.offsetWidth+o.oScroll.iBarWidth );
				nScrollFootTable.style.width = _fnStringToCss( o.nTable.offsetWidth );
			}

			/* If sorting or filtering has occured, jump the scrolling back to the top */
			if ( o.bSorted || o.bFiltered )
			{
				nScrollBody.scrollTop = 0;
			}
		}

		/*
		 * Function: _fnAjustColumnSizing
		 * Purpose:  Ajust the table column widths for new data
		 * Returns:  -
		 * Inputs:   object:oSettings - dataTables settings object
		 * Notes:    You would probably want to do a redraw after calling this function!
		 */
		function _fnAjustColumnSizing ( oSettings )
		{
			/* Not interested in doing column width calculation if autowidth is disabled */
			if ( oSettings.oFeatures.bAutoWidth === false )
			{
				return false;
			}

			_fnCalculateColumnWidths( oSettings );
			for ( var i=0 , iLen=oSettings.aoColumns.length ; i<iLen ; i++ )
			{
				oSettings.aoColumns[i].nTh.style.width = oSettings.aoColumns[i].sWidth;
			}
		}


		/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
		 * Section - Feature: Filtering
		 */

		/*
		 * Function: _fnFeatureHtmlFilter
		 * Purpose:  Generate the node required for filtering text
		 * Returns:  node
		 * Inputs:   object:oSettings - dataTables settings object
		 */
		function _fnFeatureHtmlFilter ( oSettings )
		{
			var sSearchStr = oSettings.oLanguage.sSearch;
			sSearchStr = (sSearchStr.indexOf('_INPUT_') !== -1) ?
			  sSearchStr.replace('_INPUT_', '<input type="text" />') :
			  sSearchStr==="" ? '<input type="text" />' : sSearchStr+' <input type="text" />';

			var nFilter = document.createElement( 'div' );
			nFilter.className = oSettings.oClasses.sFilter;
			nFilter.innerHTML = '<label>'+sSearchStr+'</label>';
			if ( oSettings.sTableId !== '' && typeof oSettings.aanFeatures.f == "undefined" )
			{
				nFilter.setAttribute( 'id', oSettings.sTableId+'_filter' );
			}

			var jqFilter = $("input", nFilter);
			jqFilter.val( oSettings.oPreviousSearch.sSearch.replace('"','&quot;') );
			jqFilter.bind( 'keyup.DT', function(e) {
				/* Update all other filter input elements for the new display */
				var n = oSettings.aanFeatures.f;
				for ( var i=0, iLen=n.length ; i<iLen ; i++ )
				{
					if ( n[i] != this.parentNode )
					{
						$('input', n[i]).val( this.value );
					}
				}

				/* Now do the filter */
				if ( this.value != oSettings.oPreviousSearch.sSearch )
				{
					_fnFilterComplete( oSettings, {
						"sSearch": this.value,
						"bRegex":  oSettings.oPreviousSearch.bRegex,
						"bSmart":  oSettings.oPreviousSearch.bSmart
					} );
				}
			} );

			jqFilter.bind( 'keypress.DT', function(e) {
				/* Prevent default */
				if ( e.keyCode == 13 )
				{
					return false;
				}
			} );

			return nFilter;
		}

		/*
		 * Function: _fnFilterComplete
		 * Purpose:  Filter the table using both the global filter and column based filtering
		 * Returns:  -
		 * Inputs:   object:oSettings - dataTables settings object
		 *           object:oSearch: search information
		 *           int:iForce - optional - force a research of the master array (1) or not (undefined or 0)
		 */
		function _fnFilterComplete ( oSettings, oInput, iForce )
		{
			/* Filter on everything */
			_fnFilter( oSettings, oInput.sSearch, iForce, oInput.bRegex, oInput.bSmart );

			/* Now do the individual column filter */
			for ( var i=0 ; i<oSettings.aoPreSearchCols.length ; i++ )
			{
				_fnFilterColumn( oSettings, oSettings.aoPreSearchCols[i].sSearch, i,
					oSettings.aoPreSearchCols[i].bRegex, oSettings.aoPreSearchCols[i].bSmart );
			}

			/* Custom filtering */
			if ( _oExt.afnFiltering.length !== 0 )
			{
				_fnFilterCustom( oSettings );
			}

			/* Tell the draw function we have been filtering */
			oSettings.bFiltered = true;

			/* Redraw the table */
			oSettings._iDisplayStart = 0;
			_fnCalculateEnd( oSettings );
			_fnDraw( oSettings );

			/* Rebuild search array 'offline' */
			_fnBuildSearchArray( oSettings, 0 );
		}

		/*
		 * Function: _fnFilterCustom
		 * Purpose:  Apply custom filtering functions
		 * Returns:  -
		 * Inputs:   object:oSettings - dataTables settings object
		 */
		function _fnFilterCustom( oSettings )
		{
			var afnFilters = _oExt.afnFiltering;
			for ( var i=0, iLen=afnFilters.length ; i<iLen ; i++ )
			{
				var iCorrector = 0;
				for ( var j=0, jLen=oSettings.aiDisplay.length ; j<jLen ; j++ )
				{
					var iDisIndex = oSettings.aiDisplay[j-iCorrector];

					/* Check if we should use this row based on the filtering function */
					if ( !afnFilters[i]( oSettings, _fnGetRowData( oSettings, iDisIndex, 'filter' ), iDisIndex ) )
					{
						oSettings.aiDisplay.splice( j-iCorrector, 1 );
						iCorrector++;
					}
				}
			}
		}

		/*
		 * Function: _fnFilterColumn
		 * Purpose:  Filter the table on a per-column basis
		 * Returns:  -
		 * Inputs:   object:oSettings - dataTables settings object
		 *           string:sInput - string to filter on
		 *           int:iColumn - column to filter
		 *           bool:bRegex - treat search string as a regular expression or not
		 *           bool:bSmart - use smart filtering or not
		 */
		function _fnFilterColumn ( oSettings, sInput, iColumn, bRegex, bSmart )
		{
			if ( sInput === "" )
			{
				return;
			}

			var iIndexCorrector = 0;
			var rpSearch = _fnFilterCreateSearch( sInput, bRegex, bSmart );

			for ( var i=oSettings.aiDisplay.length-1 ; i>=0 ; i-- )
			{
				var sData = _fnDataToSearch( _fnGetCellData( oSettings, oSettings.aiDisplay[i], iColumn, 'filter' ),
					oSettings.aoColumns[iColumn].sType );
				if ( ! rpSearch.test( sData ) )
				{
					oSettings.aiDisplay.splice( i, 1 );
					iIndexCorrector++;
				}
			}
		}

		/*
		 * Function: _fnFilter
		 * Purpose:  Filter the data table based on user input and draw the table
		 * Returns:  -
		 * Inputs:   object:oSettings - dataTables settings object
		 *           string:sInput - string to filter on
		 *           int:iForce - optional - force a research of the master array (1) or not (undefined or 0)
		 *           bool:bRegex - treat as a regular expression or not
		 *           bool:bSmart - perform smart filtering or not
		 */
		function _fnFilter( oSettings, sInput, iForce, bRegex, bSmart )
		{
			var i;
			var rpSearch = _fnFilterCreateSearch( sInput, bRegex, bSmart );

			/* Check if we are forcing or not - optional parameter */
			if ( typeof iForce == 'undefined' || iForce === null )
			{
				iForce = 0;
			}

			/* Need to take account of custom filtering functions - always filter */
			if ( _oExt.afnFiltering.length !== 0 )
			{
				iForce = 1;
			}

			/*
			 * If the input is blank - we want the full data set
			 */
			if ( sInput.length <= 0 )
			{
				oSettings.aiDisplay.splice( 0, oSettings.aiDisplay.length);
				oSettings.aiDisplay = oSettings.aiDisplayMaster.slice();
			}
			else
			{
				/*
				 * We are starting a new search or the new search string is smaller
				 * then the old one (i.e. delete). Search from the master array
			 	 */
				if ( oSettings.aiDisplay.length == oSettings.aiDisplayMaster.length ||
					   oSettings.oPreviousSearch.sSearch.length > sInput.length || iForce == 1 ||
					   sInput.indexOf(oSettings.oPreviousSearch.sSearch) !== 0 )
				{
					/* Nuke the old display array - we are going to rebuild it */
					oSettings.aiDisplay.splice( 0, oSettings.aiDisplay.length);

					/* Force a rebuild of the search array */
					_fnBuildSearchArray( oSettings, 1 );

					/* Search through all records to populate the search array
					 * The the oSettings.aiDisplayMaster and asDataSearch arrays have 1 to 1
					 * mapping
					 */
					for ( i=0 ; i<oSettings.aiDisplayMaster.length ; i++ )
					{
						if ( rpSearch.test(oSettings.asDataSearch[i]) )
						{
							oSettings.aiDisplay.push( oSettings.aiDisplayMaster[i] );
						}
					}
			  }
			  else
				{
			  	/* Using old search array - refine it - do it this way for speed
			  	 * Don't have to search the whole master array again
					 */
			  	var iIndexCorrector = 0;

			  	/* Search the current results */
			  	for ( i=0 ; i<oSettings.asDataSearch.length ; i++ )
					{
			  		if ( ! rpSearch.test(oSettings.asDataSearch[i]) )
						{
			  			oSettings.aiDisplay.splice( i-iIndexCorrector, 1 );
			  			iIndexCorrector++;
			  		}
			  	}
			  }
			}
			oSettings.oPreviousSearch.sSearch = sInput;
			oSettings.oPreviousSearch.bRegex = bRegex;
			oSettings.oPreviousSearch.bSmart = bSmart;
		}

		/*
		 * Function: _fnBuildSearchArray
		 * Purpose:  Create an array which can be quickly search through
		 * Returns:  -
		 * Inputs:   object:oSettings - dataTables settings object
		 *           int:iMaster - use the master data array - optional
		 */
		function _fnBuildSearchArray ( oSettings, iMaster )
		{
			/* Clear out the old data */
			oSettings.asDataSearch.splice( 0, oSettings.asDataSearch.length );

			var aArray = (typeof iMaster != 'undefined' && iMaster == 1) ?
			 	oSettings.aiDisplayMaster : oSettings.aiDisplay;

			for ( var i=0, iLen=aArray.length ; i<iLen ; i++ )
			{
				oSettings.asDataSearch[i] = _fnBuildSearchRow( oSettings,
					_fnGetRowData( oSettings, aArray[i], 'filter' ) );
			}
		}

		/*
		 * Function: _fnBuildSearchRow
		 * Purpose:  Create a searchable string from a single data row
		 * Returns:  -
		 * Inputs:   object:oSettings - dataTables settings object
		 *           array:aData - Row data array to use for the data to search
		 */
		function _fnBuildSearchRow( oSettings, aData )
		{
			var sSearch = '';
			if ( typeof oSettings.__nTmpFilter == 'undefined' ) {
				oSettings.__nTmpFilter = document.createElement('div');
			}
			var nTmp = oSettings.__nTmpFilter;

			for ( var j=0, jLen=oSettings.aoColumns.length ; j<jLen ; j++ )
			{
				if ( oSettings.aoColumns[j].bSearchable )
				{
					var sData = aData[j];
					sSearch += _fnDataToSearch( sData, oSettings.aoColumns[j].sType )+'  ';
				}
			}

			/* If it looks like there is an HTML entity in the string, attempt to decode it */
			if ( sSearch.indexOf('&') !== -1 )
			{
				nTmp.innerHTML = sSearch;
				sSearch = nTmp.textContent ? nTmp.textContent : nTmp.innerText;

				/* IE and Opera appear to put an newline where there is a <br> tag - remove it */
				sSearch = sSearch.replace(/\n/g," ").replace(/\r/g,"");
			}

			return sSearch;
		}

		/*
		 * Function: _fnFilterCreateSearch
		 * Purpose:  Build a regular expression object suitable for searching a table
		 * Returns:  RegExp: - constructed object
		 * Inputs:   string:sSearch - string to search for
		 *           bool:bRegex - treat as a regular expression or not
		 *           bool:bSmart - perform smart filtering or not
		 */
		function _fnFilterCreateSearch( sSearch, bRegex, bSmart )
		{
			var asSearch, sRegExpString;

			if ( bSmart )
			{
				/* Generate the regular expression to use. Something along the lines of:
				 * ^(?=.*?\bone\b)(?=.*?\btwo\b)(?=.*?\bthree\b).*$
				 */
				asSearch = bRegex ? sSearch.split( ' ' ) : _fnEscapeRegex( sSearch ).split( ' ' );
				sRegExpString = '^(?=.*?'+asSearch.join( ')(?=.*?' )+').*$';
				return new RegExp( sRegExpString, "i" );
			}
			else
			{
				sSearch = bRegex ? sSearch : _fnEscapeRegex( sSearch );
				return new RegExp( sSearch, "i" );
			}
		}

		/*
		 * Function: _fnDataToSearch
		 * Purpose:  Convert raw data into something that the user can search on
		 * Returns:  string: - search string
		 * Inputs:   string:sData - data to be modified
		 *           string:sType - data type
		 */
		function _fnDataToSearch ( sData, sType )
		{
			if ( typeof _oExt.ofnSearch[sType] == "function" )
			{
				return _oExt.ofnSearch[sType]( sData );
			}
			else if ( sType == "html" )
			{
				return sData.replace(/\n/g," ").replace( /<.*?>/g, "" );
			}
			else if ( typeof sData == "string" )
			{
				return sData.replace(/\n/g," ");
			}
			else if ( sData === null )
			{
				return '';
			}
			return sData;
		}


		/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
		 * Section - Feature: Sorting
		 */

		/*
	 	 * Function: _fnSort
		 * Purpose:  Change the order of the table
		 * Returns:  -
		 * Inputs:   object:oSettings - dataTables settings object
		 *           bool:bApplyClasses - optional - should we apply classes or not
		 * Notes:    We always sort the master array and then apply a filter again
		 *   if it is needed. This probably isn't optimal - but atm I can't think
		 *   of any other way which is (each has disadvantages). we want to sort aiDisplayMaster -
		 *   but according to aoData[]._aData
		 */
		function _fnSort ( oSettings, bApplyClasses )
		{
			var
				iDataSort, iDataType,
				i, iLen, j, jLen,
				aaSort = [],
			 	aiOrig = [],
				oSort = _oExt.oSort,
				aoData = oSettings.aoData,
				aoColumns = oSettings.aoColumns;

			/* No sorting required if server-side or no sorting array */
			if ( !oSettings.oFeatures.bServerSide &&
				(oSettings.aaSorting.length !== 0 || oSettings.aaSortingFixed !== null) )
			{
				if ( oSettings.aaSortingFixed !== null )
				{
					aaSort = oSettings.aaSortingFixed.concat( oSettings.aaSorting );
				}
				else
				{
					aaSort = oSettings.aaSorting.slice();
				}

				/* If there is a sorting data type, and a fuction belonging to it, then we need to
				 * get the data from the developer's function and apply it for this column
				 */
				for ( i=0 ; i<aaSort.length ; i++ )
				{
					var iColumn = aaSort[i][0];
					var iVisColumn = _fnColumnIndexToVisible( oSettings, iColumn );
					var sDataType = oSettings.aoColumns[ iColumn ].sSortDataType;
					if ( typeof _oExt.afnSortData[sDataType] != 'undefined' )
					{
						var aData = _oExt.afnSortData[sDataType]( oSettings, iColumn, iVisColumn );
						for ( j=0, jLen=aoData.length ; j<jLen ; j++ )
						{
							_fnSetCellData( oSettings, j, iColumn, aData[j] );
						}
					}
				}

				/* Create a value - key array of the current row positions such that we can use their
				 * current position during the sort, if values match, in order to perform stable sorting
				 */
				for ( i=0, iLen=oSettings.aiDisplayMaster.length ; i<iLen ; i++ )
				{
					aiOrig[ oSettings.aiDisplayMaster[i] ] = i;
				}

				/* Do the sort - here we want multi-column sorting based on a given data source (column)
				 * and sorting function (from oSort) in a certain direction. It's reasonably complex to
				 * follow on it's own, but this is what we want (example two column sorting):
				 *  fnLocalSorting = function(a,b){
				 *  	var iTest;
				 *  	iTest = oSort['string-asc']('data11', 'data12');
				 *  	if (iTest !== 0)
				 *  		return iTest;
				 *    iTest = oSort['numeric-desc']('data21', 'data22');
				 *    if (iTest !== 0)
				 *  		return iTest;
				 *  	return oSort['numeric-asc']( aiOrig[a], aiOrig[b] );
				 *  }
				 * Basically we have a test for each sorting column, if the data in that column is equal,
				 * test the next column. If all columns match, then we use a numeric sort on the row
				 * positions in the original data array to provide a stable sort.
				 */
				var iSortLen = aaSort.length;
				oSettings.aiDisplayMaster.sort( function ( a, b ) {
					var iTest, iDataSort, sDataType;
					for ( i=0 ; i<iSortLen ; i++ )
					{
						iDataSort = aoColumns[ aaSort[i][0] ].iDataSort;
						sDataType = aoColumns[ iDataSort ].sType;
						iTest = oSort[ (sDataType?sDataType:'string')+"-"+aaSort[i][1] ](
							_fnGetCellData( oSettings, a, iDataSort, 'sort' ),
							_fnGetCellData( oSettings, b, iDataSort, 'sort' )
						);

						if ( iTest !== 0 )
						{
							return iTest;
						}
					}

					return oSort['numeric-asc']( aiOrig[a], aiOrig[b] );
				} );
			}

			/* Alter the sorting classes to take account of the changes */
			if ( (typeof bApplyClasses == 'undefined' || bApplyClasses) && !oSettings.oFeatures.bDeferRender )
			{
				_fnSortingClasses( oSettings );
			}

			/* Tell the draw function that we have sorted the data */
			oSettings.bSorted = true;

			/* Copy the master data into the draw array and re-draw */
			if ( oSettings.oFeatures.bFilter )
			{
				/* _fnFilter() will redraw the table for us */
				_fnFilterComplete( oSettings, oSettings.oPreviousSearch, 1 );
			}
			else
			{
				oSettings.aiDisplay = oSettings.aiDisplayMaster.slice();
				oSettings._iDisplayStart = 0; /* reset display back to page 0 */
				_fnCalculateEnd( oSettings );
				_fnDraw( oSettings );
			}
		}

		/*
		 * Function: _fnSortAttachListener
		 * Purpose:  Attach a sort handler (click) to a node
		 * Returns:  -
		 * Inputs:   object:oSettings - dataTables settings object
		 *           node:nNode - node to attach the handler to
		 *           int:iDataIndex - column sorting index
		 *           function:fnCallback - callback function - optional
		 */
		function _fnSortAttachListener ( oSettings, nNode, iDataIndex, fnCallback )
		{
			$(nNode).bind( 'click.DT', function (e) {
				/* If the column is not sortable - don't to anything */
				if ( oSettings.aoColumns[iDataIndex].bSortable === false )
				{
					return;
				}

				/*
				 * This is a little bit odd I admit... I declare a temporary function inside the scope of
				 * _fnBuildHead and the click handler in order that the code presented here can be used
				 * twice - once for when bProcessing is enabled, and another time for when it is
				 * disabled, as we need to perform slightly different actions.
				 *   Basically the issue here is that the Javascript engine in modern browsers don't
				 * appear to allow the rendering engine to update the display while it is still excuting
				 * it's thread (well - it does but only after long intervals). This means that the
				 * 'processing' display doesn't appear for a table sort. To break the js thread up a bit
				 * I force an execution break by using setTimeout - but this breaks the expected
				 * thread continuation for the end-developer's point of view (their code would execute
				 * too early), so we on;y do it when we absolutely have to.
				 */
				var fnInnerSorting = function () {
					var iColumn, iNextSort;

					/* If the shift key is pressed then we are multipe column sorting */
					if ( e.shiftKey )
					{
						/* Are we already doing some kind of sort on this column? */
						var bFound = false;
						for ( var i=0 ; i<oSettings.aaSorting.length ; i++ )
						{
							if ( oSettings.aaSorting[i][0] == iDataIndex )
							{
								bFound = true;
								iColumn = oSettings.aaSorting[i][0];
								iNextSort = oSettings.aaSorting[i][2]+1;

								if ( typeof oSettings.aoColumns[iColumn].asSorting[iNextSort] == 'undefined' )
								{
									/* Reached the end of the sorting options, remove from multi-col sort */
									oSettings.aaSorting.splice( i, 1 );
								}
								else
								{
									/* Move onto next sorting direction */
									oSettings.aaSorting[i][1] = oSettings.aoColumns[iColumn].asSorting[iNextSort];
									oSettings.aaSorting[i][2] = iNextSort;
								}
								break;
							}
						}

						/* No sort yet - add it in */
						if ( bFound === false )
						{
							oSettings.aaSorting.push( [ iDataIndex,
								oSettings.aoColumns[iDataIndex].asSorting[0], 0 ] );
						}
					}
					else
					{
						/* If no shift key then single column sort */
						if ( oSettings.aaSorting.length == 1 && oSettings.aaSorting[0][0] == iDataIndex )
						{
							iColumn = oSettings.aaSorting[0][0];
							iNextSort = oSettings.aaSorting[0][2]+1;
							if ( typeof oSettings.aoColumns[iColumn].asSorting[iNextSort] == 'undefined' )
							{
								iNextSort = 0;
							}
							oSettings.aaSorting[0][1] = oSettings.aoColumns[iColumn].asSorting[iNextSort];
							oSettings.aaSorting[0][2] = iNextSort;
						}
						else
						{
							oSettings.aaSorting.splice( 0, oSettings.aaSorting.length );
							oSettings.aaSorting.push( [ iDataIndex,
								oSettings.aoColumns[iDataIndex].asSorting[0], 0 ] );
						}
					}

					/* Run the sort */
					_fnSort( oSettings );
				}; /* /fnInnerSorting */

				if ( !oSettings.oFeatures.bProcessing )
				{
					fnInnerSorting();
				}
				else
				{
					_fnProcessingDisplay( oSettings, true );
					setTimeout( function() {
						fnInnerSorting();
						if ( !oSettings.oFeatures.bServerSide )
						{
							_fnProcessingDisplay( oSettings, false );
						}
					}, 0 );
				}

				/* Call the user specified callback function - used for async user interaction */
				if ( typeof fnCallback == 'function' )
				{
					fnCallback( oSettings );
				}
			} );
		}

		/*
		 * Function: _fnSortingClasses
		 * Purpose:  Set the sortting classes on the header
		 * Returns:  -
		 * Inputs:   object:oSettings - dataTables settings object
		 * Notes:    It is safe to call this function when bSort and bSortClasses are false
		 */
		function _fnSortingClasses( oSettings )
		{
			var i, iLen, j, jLen, iFound;
			var aaSort, sClass;
			var iColumns = oSettings.aoColumns.length;
			var oClasses = oSettings.oClasses;

			for ( i=0 ; i<iColumns ; i++ )
			{
				if ( oSettings.aoColumns[i].bSortable )
				{
					$(oSettings.aoColumns[i].nTh).removeClass( oClasses.sSortAsc +" "+ oClasses.sSortDesc +
						" "+ oSettings.aoColumns[i].sSortingClass );
				}
			}

			if ( oSettings.aaSortingFixed !== null )
			{
				aaSort = oSettings.aaSortingFixed.concat( oSettings.aaSorting );
			}
			else
			{
				aaSort = oSettings.aaSorting.slice();
			}

			/* Apply the required classes to the header */
			for ( i=0 ; i<oSettings.aoColumns.length ; i++ )
			{
				if ( oSettings.aoColumns[i].bSortable )
				{
					sClass = oSettings.aoColumns[i].sSortingClass;
					iFound = -1;
					for ( j=0 ; j<aaSort.length ; j++ )
					{
						if ( aaSort[j][0] == i )
						{
							sClass = ( aaSort[j][1] == "asc" ) ?
								oClasses.sSortAsc : oClasses.sSortDesc;
							iFound = j;
							break;
						}
					}
					$(oSettings.aoColumns[i].nTh).addClass( sClass );

					if ( oSettings.bJUI )
					{
						/* jQuery UI uses extra markup */
						var jqSpan = $("span", oSettings.aoColumns[i].nTh);
						jqSpan.removeClass(oClasses.sSortJUIAsc +" "+ oClasses.sSortJUIDesc +" "+
							oClasses.sSortJUI +" "+ oClasses.sSortJUIAscAllowed +" "+ oClasses.sSortJUIDescAllowed );

						var sSpanClass;
						if ( iFound == -1 )
						{
						 	sSpanClass = oSettings.aoColumns[i].sSortingClassJUI;
						}
						else if ( aaSort[iFound][1] == "asc" )
						{
							sSpanClass = oClasses.sSortJUIAsc;
						}
						else
						{
							sSpanClass = oClasses.sSortJUIDesc;
						}

						jqSpan.addClass( sSpanClass );
					}
				}
				else
				{
					/* No sorting on this column, so add the base class. This will have been assigned by
					 * _fnAddColumn
					 */
					$(oSettings.aoColumns[i].nTh).addClass( oSettings.aoColumns[i].sSortingClass );
				}
			}

			/*
			 * Apply the required classes to the table body
			 * Note that this is given as a feature switch since it can significantly slow down a sort
			 * on large data sets (adding and removing of classes is always slow at the best of times..)
			 * Further to this, note that this code is admitadly fairly ugly. It could be made a lot
			 * simpiler using jQuery selectors and add/removeClass, but that is significantly slower
			 * (on the order of 5 times slower) - hence the direct DOM manipulation here.
			 * Note that for defered drawing we do use jQuery - the reason being that taking the first
			 * row found to see if the whole column needs processed can miss classes since the first
			 * column might be new.
			 */
			sClass = oClasses.sSortColumn;

			if ( oSettings.oFeatures.bSort && oSettings.oFeatures.bSortClasses )
			{
				var nTds = _fnGetTdNodes( oSettings );

				/* Remove the old classes */
				if ( oSettings.oFeatures.bDeferRender )
				{
					$(nTds).removeClass(sClass+'1 '+sClass+'2 '+sClass+'3');
				}
				else if ( nTds.length >= iColumns )
				{
					for ( i=0 ; i<iColumns ; i++ )
					{
						if ( nTds[i].className.indexOf(sClass+"1") != -1 )
						{
							for ( j=0, jLen=(nTds.length/iColumns) ; j<jLen ; j++ )
							{
								nTds[(iColumns*j)+i].className =
									$.trim( nTds[(iColumns*j)+i].className.replace( sClass+"1", "" ) );
							}
						}
						else if ( nTds[i].className.indexOf(sClass+"2") != -1 )
						{
							for ( j=0, jLen=(nTds.length/iColumns) ; j<jLen ; j++ )
							{
								nTds[(iColumns*j)+i].className =
									$.trim( nTds[(iColumns*j)+i].className.replace( sClass+"2", "" ) );
							}
						}
						else if ( nTds[i].className.indexOf(sClass+"3") != -1 )
						{
							for ( j=0, jLen=(nTds.length/iColumns) ; j<jLen ; j++ )
							{
								nTds[(iColumns*j)+i].className =
									$.trim( nTds[(iColumns*j)+i].className.replace( " "+sClass+"3", "" ) );
							}
						}
					}
				}

				/* Add the new classes to the table */
				var iClass = 1, iTargetCol;
				for ( i=0 ; i<aaSort.length ; i++ )
				{
					iTargetCol = parseInt( aaSort[i][0], 10 );
					for ( j=0, jLen=(nTds.length/iColumns) ; j<jLen ; j++ )
					{
						nTds[(iColumns*j)+iTargetCol].className += " "+sClass+iClass;
					}

					if ( iClass < 3 )
					{
						iClass++;
					}
				}
			}
		}


		/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
		 * Section - Feature: Pagination. Note that most of the paging logic is done in
		 * _oExt.oPagination
		 */

		/*
		 * Function: _fnFeatureHtmlPaginate
		 * Purpose:  Generate the node required for default pagination
		 * Returns:  node
		 * Inputs:   object:oSettings - dataTables settings object
		 */
		function _fnFeatureHtmlPaginate ( oSettings )
		{
			if ( oSettings.oScroll.bInfinite )
			{
				return null;
			}

			var nPaginate = document.createElement( 'div' );
			nPaginate.className = oSettings.oClasses.sPaging+oSettings.sPaginationType;

			_oExt.oPagination[ oSettings.sPaginationType ].fnInit( oSettings, nPaginate,
				function( oSettings ) {
					_fnCalculateEnd( oSettings );
					_fnDraw( oSettings );
				}
			);

			/* Add a draw callback for the pagination on first instance, to update the paging display */
			if ( typeof oSettings.aanFeatures.p == "undefined" )
			{
				oSettings.aoDrawCallback.push( {
					"fn": function( oSettings ) {
						_oExt.oPagination[ oSettings.sPaginationType ].fnUpdate( oSettings, function( oSettings ) {
							_fnCalculateEnd( oSettings );
							_fnDraw( oSettings );
						} );
					},
					"sName": "pagination"
				} );
			}
			return nPaginate;
		}

		/*
		 * Function: _fnPageChange
		 * Purpose:  Alter the display settings to change the page
		 * Returns:  bool:true - page has changed, false - no change (no effect) eg 'first' on page 1
		 * Inputs:   object:oSettings - dataTables settings object
		 *           string:sAction - paging action to take: "first", "previous", "next" or "last"
		 */
		function _fnPageChange ( oSettings, sAction )
		{
			var iOldStart = oSettings._iDisplayStart;

			if ( sAction == "first" )
			{
				oSettings._iDisplayStart = 0;
			}
			else if ( sAction == "previous" )
			{
				oSettings._iDisplayStart = oSettings._iDisplayLength>=0 ?
					oSettings._iDisplayStart - oSettings._iDisplayLength :
					0;

				/* Correct for underrun */
				if ( oSettings._iDisplayStart < 0 )
				{
				  oSettings._iDisplayStart = 0;
				}
			}
			else if ( sAction == "next" )
			{
				if ( oSettings._iDisplayLength >= 0 )
				{
					/* Make sure we are not over running the display array */
					if ( oSettings._iDisplayStart + oSettings._iDisplayLength < oSettings.fnRecordsDisplay() )
					{
						oSettings._iDisplayStart += oSettings._iDisplayLength;
					}
				}
				else
				{
					oSettings._iDisplayStart = 0;
				}
			}
			else if ( sAction == "last" )
			{
				if ( oSettings._iDisplayLength >= 0 )
				{
					var iPages = parseInt( (oSettings.fnRecordsDisplay()-1) / oSettings._iDisplayLength, 10 ) + 1;
					oSettings._iDisplayStart = (iPages-1) * oSettings._iDisplayLength;
				}
				else
				{
					oSettings._iDisplayStart = 0;
				}
			}
			else
			{
				_fnLog( oSettings, 0, "Unknown paging action: "+sAction );
			}

			return iOldStart != oSettings._iDisplayStart;
		}


		/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
		 * Section - Feature: HTML info
		 */

		/*
		 * Function: _fnFeatureHtmlInfo
		 * Purpose:  Generate the node required for the info display
		 * Returns:  node
		 * Inputs:   object:oSettings - dataTables settings object
		 */
		function _fnFeatureHtmlInfo ( oSettings )
		{
			var nInfo = document.createElement( 'div' );
			nInfo.className = oSettings.oClasses.sInfo;

			/* Actions that are to be taken once only for this feature */
			if ( typeof oSettings.aanFeatures.i == "undefined" )
			{
				/* Add draw callback */
				oSettings.aoDrawCallback.push( {
					"fn": _fnUpdateInfo,
					"sName": "information"
				} );

				/* Add id */
				if ( oSettings.sTableId !== '' )
				{
					nInfo.setAttribute( 'id', oSettings.sTableId+'_info' );
				}
			}

			return nInfo;
		}

		/*
		 * Function: _fnUpdateInfo
		 * Purpose:  Update the information elements in the display
		 * Returns:  -
		 * Inputs:   object:oSettings - dataTables settings object
		 */
		function _fnUpdateInfo ( oSettings )
		{
			/* Show information about the table */
			if ( !oSettings.oFeatures.bInfo || oSettings.aanFeatures.i.length === 0 )
			{
				return;
			}

			var
				iStart = oSettings._iDisplayStart+1, iEnd = oSettings.fnDisplayEnd(),
				iMax = oSettings.fnRecordsTotal(), iTotal = oSettings.fnRecordsDisplay(),
				sStart = oSettings.fnFormatNumber( iStart ), sEnd = oSettings.fnFormatNumber( iEnd ),
				sMax = oSettings.fnFormatNumber( iMax ), sTotal = oSettings.fnFormatNumber( iTotal ),
				sOut;

			/* When infinite scrolling, we are always starting at 1. _iDisplayStart is used only
			 * internally
			 */
			if ( oSettings.oScroll.bInfinite )
			{
				sStart = oSettings.fnFormatNumber( 1 );
			}

			if ( oSettings.fnRecordsDisplay() === 0 &&
				   oSettings.fnRecordsDisplay() == oSettings.fnRecordsTotal() )
			{
				/* Empty record set */
				sOut = oSettings.oLanguage.sInfoEmpty+ oSettings.oLanguage.sInfoPostFix;
			}
			else if ( oSettings.fnRecordsDisplay() === 0 )
			{
				/* Rmpty record set after filtering */
				sOut = oSettings.oLanguage.sInfoEmpty +' '+
					oSettings.oLanguage.sInfoFiltered.replace('_MAX_', sMax)+
						oSettings.oLanguage.sInfoPostFix;
			}
			else if ( oSettings.fnRecordsDisplay() == oSettings.fnRecordsTotal() )
			{
				/* Normal record set */
				sOut = oSettings.oLanguage.sInfo.
						replace('_START_', sStart).
						replace('_END_',   sEnd).
						replace('_TOTAL_', sTotal)+
					oSettings.oLanguage.sInfoPostFix;
			}
			else
			{
				/* Record set after filtering */
				sOut = oSettings.oLanguage.sInfo.
						replace('_START_', sStart).
						replace('_END_',   sEnd).
						replace('_TOTAL_', sTotal) +' '+
					oSettings.oLanguage.sInfoFiltered.replace('_MAX_',
						oSettings.fnFormatNumber(oSettings.fnRecordsTotal()))+
					oSettings.oLanguage.sInfoPostFix;
			}

			if ( oSettings.oLanguage.fnInfoCallback !== null )
			{
				sOut = oSettings.oLanguage.fnInfoCallback( oSettings, iStart, iEnd, iMax, iTotal, sOut );
			}

			var n = oSettings.aanFeatures.i;
			for ( var i=0, iLen=n.length ; i<iLen ; i++ )
			{
				$(n[i]).html( sOut );
			}
		}


		/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
		 * Section - Feature: Length change
		 */

		/*
		 * Function: _fnFeatureHtmlLength
		 * Purpose:  Generate the node required for user display length changing
		 * Returns:  node
		 * Inputs:   object:oSettings - dataTables settings object
		 */
		function _fnFeatureHtmlLength ( oSettings )
		{
			if ( oSettings.oScroll.bInfinite )
			{
				return null;
			}

			/* This can be overruled by not using the _MENU_ var/macro in the language variable */
			var sName = (oSettings.sTableId === "") ? "" : 'name="'+oSettings.sTableId+'_length"';
			var sStdMenu = '<select size="1" '+sName+'>';
			var i, iLen;

			if ( oSettings.aLengthMenu.length == 2 && typeof oSettings.aLengthMenu[0] == 'object' &&
					typeof oSettings.aLengthMenu[1] == 'object' )
			{
				for ( i=0, iLen=oSettings.aLengthMenu[0].length ; i<iLen ; i++ )
				{
					sStdMenu += '<option value="'+oSettings.aLengthMenu[0][i]+'">'+
						oSettings.aLengthMenu[1][i]+'</option>';
				}
			}
			else
			{
				for ( i=0, iLen=oSettings.aLengthMenu.length ; i<iLen ; i++ )
				{
					sStdMenu += '<option value="'+oSettings.aLengthMenu[i]+'">'+
						oSettings.aLengthMenu[i]+'</option>';
				}
			}
			sStdMenu += '</select>';

			var nLength = document.createElement( 'div' );
			if ( oSettings.sTableId !== '' && typeof oSettings.aanFeatures.l == "undefined" )
			{
				nLength.setAttribute( 'id', oSettings.sTableId+'_length' );
			}
			nLength.className = oSettings.oClasses.sLength;
			nLength.innerHTML = '<label>'+oSettings.oLanguage.sLengthMenu.replace( '_MENU_', sStdMenu )+'</label>';

			/*
			 * Set the length to the current display length - thanks to Andrea Pavlovic for this fix,
			 * and Stefan Skopnik for fixing the fix!
			 */
			$('select option[value="'+oSettings._iDisplayLength+'"]',nLength).attr("selected",true);

			$('select', nLength).bind( 'change.DT', function(e) {
				var iVal = $(this).val();

				/* Update all other length options for the new display */
				var n = oSettings.aanFeatures.l;
				for ( i=0, iLen=n.length ; i<iLen ; i++ )
				{
					if ( n[i] != this.parentNode )
					{
						$('select', n[i]).val( iVal );
					}
				}

				/* Redraw the table */
				oSettings._iDisplayLength = parseInt(iVal, 10);
				_fnCalculateEnd( oSettings );

				/* If we have space to show extra rows (backing up from the end point - then do so */
				if ( oSettings.fnDisplayEnd() == oSettings.fnRecordsDisplay() )
				{
					oSettings._iDisplayStart = oSettings.fnDisplayEnd() - oSettings._iDisplayLength;
					if ( oSettings._iDisplayStart < 0 )
					{
						oSettings._iDisplayStart = 0;
					}
				}

				if ( oSettings._iDisplayLength == -1 )
				{
					oSettings._iDisplayStart = 0;
				}

				_fnDraw( oSettings );
			} );

			return nLength;
		}


		/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
		 * Section - Feature: Processing incidator
		 */

		/*
		 * Function: _fnFeatureHtmlProcessing
		 * Purpose:  Generate the node required for the processing node
		 * Returns:  node
		 * Inputs:   object:oSettings - dataTables settings object
		 */
		function _fnFeatureHtmlProcessing ( oSettings )
		{
			var nProcessing = document.createElement( 'div' );

			if ( oSettings.sTableId !== '' && typeof oSettings.aanFeatures.r == "undefined" )
			{
				nProcessing.setAttribute( 'id', oSettings.sTableId+'_processing' );
			}
			nProcessing.innerHTML = oSettings.oLanguage.sProcessing;
			nProcessing.className = oSettings.oClasses.sProcessing;
			oSettings.nTable.parentNode.insertBefore( nProcessing, oSettings.nTable );

			return nProcessing;
		}

		/*
		 * Function: _fnProcessingDisplay
		 * Purpose:  Display or hide the processing indicator
		 * Returns:  -
		 * Inputs:   object:oSettings - dataTables settings object
		 *           bool:
		 *   true - show the processing indicator
		 *   false - don't show
		 */
		function _fnProcessingDisplay ( oSettings, bShow )
		{
			if ( oSettings.oFeatures.bProcessing )
			{
				var an = oSettings.aanFeatures.r;
				for ( var i=0, iLen=an.length ; i<iLen ; i++ )
				{
					an[i].style.visibility = bShow ? "visible" : "hidden";
				}
			}
		}


		/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
		 * Section - Support functions
		 */

		/*
		 * Function: _fnVisibleToColumnIndex
		 * Purpose:  Covert the index of a visible column to the index in the data array (take account
		 *   of hidden columns)
		 * Returns:  int:i - the data index
		 * Inputs:   object:oSettings - dataTables settings object
		 */
		function _fnVisibleToColumnIndex( oSettings, iMatch )
		{
			var iColumn = -1;

			for ( var i=0 ; i<oSettings.aoColumns.length ; i++ )
			{
				if ( oSettings.aoColumns[i].bVisible === true )
				{
					iColumn++;
				}

				if ( iColumn == iMatch )
				{
					return i;
				}
			}

			return null;
		}

		/*
		 * Function: _fnColumnIndexToVisible
		 * Purpose:  Covert the index of an index in the data array and convert it to the visible
		 *   column index (take account of hidden columns)
		 * Returns:  int:i - the data index
		 * Inputs:   object:oSettings - dataTables settings object
		 */
		function _fnColumnIndexToVisible( oSettings, iMatch )
		{
			var iVisible = -1;
			for ( var i=0 ; i<oSettings.aoColumns.length ; i++ )
			{
				if ( oSettings.aoColumns[i].bVisible === true )
				{
					iVisible++;
				}

				if ( i == iMatch )
				{
					return oSettings.aoColumns[i].bVisible === true ? iVisible : null;
				}
			}

			return null;
		}


		/*
		 * Function: _fnNodeToDataIndex
		 * Purpose:  Take a TR element and convert it to an index in aoData
		 * Returns:  int:i - index if found, null if not
		 * Inputs:   object:s - dataTables settings object
		 *           node:n - the TR element to find
		 */
		function _fnNodeToDataIndex( s, n )
		{
			var i, iLen;

			/* Optimisation - see if the nodes which are currently visible match, since that is
			 * the most likely node to be asked for (a selector or event for example)
			 */
			for ( i=s._iDisplayStart, iLen=s._iDisplayEnd ; i<iLen ; i++ )
			{
				if ( s.aoData[ s.aiDisplay[i] ].nTr == n )
				{
					return s.aiDisplay[i];
				}
			}

			/* Otherwise we are in for a slog through the whole data cache */
			for ( i=0, iLen=s.aoData.length ; i<iLen ; i++ )
			{
				if ( s.aoData[i].nTr == n )
				{
					return i;
				}
			}
			return null;
		}

		/*
		 * Function: _fnVisbleColumns
		 * Purpose:  Get the number of visible columns
		 * Returns:  int:i - the number of visible columns
		 * Inputs:   object:oS - dataTables settings object
		 */
		function _fnVisbleColumns( oS )
		{
			var iVis = 0;
			for ( var i=0 ; i<oS.aoColumns.length ; i++ )
			{
				if ( oS.aoColumns[i].bVisible === true )
				{
					iVis++;
				}
			}
			return iVis;
		}

		/*
		 * Function: _fnCalculateEnd
		 * Purpose:  Rcalculate the end point based on the start point
		 * Returns:  -
		 * Inputs:   object:oSettings - dataTables settings object
		 */
		function _fnCalculateEnd( oSettings )
		{
			if ( oSettings.oFeatures.bPaginate === false )
			{
				oSettings._iDisplayEnd = oSettings.aiDisplay.length;
			}
			else
			{
				/* Set the end point of the display - based on how many elements there are
				 * still to display
				 */
				if ( oSettings._iDisplayStart + oSettings._iDisplayLength > oSettings.aiDisplay.length ||
					   oSettings._iDisplayLength == -1 )
				{
					oSettings._iDisplayEnd = oSettings.aiDisplay.length;
				}
				else
				{
					oSettings._iDisplayEnd = oSettings._iDisplayStart + oSettings._iDisplayLength;
				}
			}
		}

		/*
		 * Function: _fnConvertToWidth
		 * Purpose:  Convert a CSS unit width to pixels (e.g. 2em)
		 * Returns:  int:iWidth - width in pixels
		 * Inputs:   string:sWidth - width to be converted
		 *           node:nParent - parent to get the with for (required for
		 *             relative widths) - optional
		 */
		function _fnConvertToWidth ( sWidth, nParent )
		{
			if ( !sWidth || sWidth === null || sWidth === '' )
			{
				return 0;
			}

			if ( typeof nParent == "undefined" )
			{
				nParent = document.getElementsByTagName('body')[0];
			}

			var iWidth;
			var nTmp = document.createElement( "div" );
			nTmp.style.width = _fnStringToCss( sWidth );

			nParent.appendChild( nTmp );
			iWidth = nTmp.offsetWidth;
			nParent.removeChild( nTmp );

			return ( iWidth );
		}

		/*
		 * Function: _fnCalculateColumnWidths
		 * Purpose:  Calculate the width of columns for the table
		 * Returns:  -
		 * Inputs:   object:oSettings - dataTables settings object
		 */
		function _fnCalculateColumnWidths ( oSettings )
		{
			var iTableWidth = oSettings.nTable.offsetWidth;
			var iUserInputs = 0;
			var iTmpWidth;
			var iVisibleColumns = 0;
			var iColums = oSettings.aoColumns.length;
			var i, iIndex, iCorrector, iWidth;
			var oHeaders = $('th', oSettings.nTHead);

			/* Convert any user input sizes into pixel sizes */
			for ( i=0 ; i<iColums ; i++ )
			{
				if ( oSettings.aoColumns[i].bVisible )
				{
					iVisibleColumns++;

					if ( oSettings.aoColumns[i].sWidth !== null )
					{
						iTmpWidth = _fnConvertToWidth( oSettings.aoColumns[i].sWidthOrig,
							oSettings.nTable.parentNode );
						if ( iTmpWidth !== null )
						{
							oSettings.aoColumns[i].sWidth = _fnStringToCss( iTmpWidth );
						}

						iUserInputs++;
					}
				}
			}

			/* If the number of columns in the DOM equals the number that we have to process in
			 * DataTables, then we can use the offsets that are created by the web-browser. No custom
			 * sizes can be set in order for this to happen, nor scrolling used
			 */
			if ( iColums == oHeaders.length && iUserInputs === 0 && iVisibleColumns == iColums &&
				oSettings.oScroll.sX === "" && oSettings.oScroll.sY === "" )
			{
				for ( i=0 ; i<oSettings.aoColumns.length ; i++ )
				{
					iTmpWidth = $(oHeaders[i]).width();
					if ( iTmpWidth !== null )
					{
						oSettings.aoColumns[i].sWidth = _fnStringToCss( iTmpWidth );
					}
				}
			}
			else
			{
				/* Otherwise we are going to have to do some calculations to get the width of each column.
				 * Construct a 1 row table with the widest node in the data, and any user defined widths,
				 * then insert it into the DOM and allow the browser to do all the hard work of
				 * calculating table widths.
				 */
				var
					nCalcTmp = oSettings.nTable.cloneNode( false ),
					nTheadClone = oSettings.nTHead.cloneNode(true),
					nBody = document.createElement( 'tbody' ),
					nTr = document.createElement( 'tr' ),
					nDivSizing;

				nCalcTmp.removeAttribute( "id" );
				nCalcTmp.appendChild( nTheadClone );
				if ( oSettings.nTFoot !== null )
				{
					nCalcTmp.appendChild( oSettings.nTFoot.cloneNode(true) );
					_fnApplyToChildren( function(n) {
						n.style.width = "";
					}, nCalcTmp.getElementsByTagName('tr') );
				}

				nCalcTmp.appendChild( nBody );
				nBody.appendChild( nTr );

				/* Remove any sizing that was previously applied by the styles */
				var jqColSizing = $('thead th', nCalcTmp);
				if ( jqColSizing.length === 0 )
				{
					jqColSizing = $('tbody tr:eq(0)>td', nCalcTmp);
				}

				/* Apply custom sizing to the cloned header */
				var nThs = _fnGetUniqueThs( oSettings, nTheadClone );
				iCorrector = 0;
				for ( i=0 ; i<iColums ; i++ )
				{
					var oColumn = oSettings.aoColumns[i];
					if ( oColumn.bVisible && oColumn.sWidthOrig !== null && oColumn.sWidthOrig !== "" )
					{
						nThs[i-iCorrector].style.width = _fnStringToCss( oColumn.sWidthOrig );
					}
					else if ( oColumn.bVisible )
					{
						nThs[i-iCorrector].style.width = "";
					}
					else
					{
						iCorrector++;
					}
				}

				/* Find the biggest td for each column and put it into the table */
				for ( i=0 ; i<iColums ; i++ )
				{
					if ( oSettings.aoColumns[i].bVisible )
					{
						var nTd = _fnGetWidestNode( oSettings, i );
						if ( nTd !== null )
						{
							nTd = nTd.cloneNode(true);
							if ( oSettings.aoColumns[i].sContentPadding !== "" )
							{
								nTd.innerHTML += oSettings.aoColumns[i].sContentPadding;
							}
							nTr.appendChild( nTd );
						}
					}
				}

				/* Build the table and 'display' it */
				var nWrapper = oSettings.nTable.parentNode;
				nWrapper.appendChild( nCalcTmp );

				/* When scrolling (X or Y) we want to set the width of the table as appropriate. However,
				 * when not scrolling leave the table width as it is. This results in slightly different,
				 * but I think correct behaviour
				 */
				if ( oSettings.oScroll.sX !== "" && oSettings.oScroll.sXInner !== "" )
				{
					nCalcTmp.style.width = _fnStringToCss(oSettings.oScroll.sXInner);
				}
				else if ( oSettings.oScroll.sX !== "" )
				{
					nCalcTmp.style.width = "";
					if ( $(nCalcTmp).width() < nWrapper.offsetWidth )
					{
						nCalcTmp.style.width = _fnStringToCss( nWrapper.offsetWidth );
					}
				}
				else if ( oSettings.oScroll.sY !== "" )
				{
					nCalcTmp.style.width = _fnStringToCss( nWrapper.offsetWidth );
				}
				nCalcTmp.style.visibility = "hidden";

				/* Scrolling considerations */
				_fnScrollingWidthAdjust( oSettings, nCalcTmp );

				/* Read the width's calculated by the browser and store them for use by the caller. We
				 * first of all try to use the elements in the body, but it is possible that there are
				 * no elements there, under which circumstances we use the header elements
				 */
				var oNodes = $("tbody tr:eq(0)", nCalcTmp).children();
				if ( oNodes.length === 0 )
				{
					oNodes = _fnGetUniqueThs( oSettings, $('thead', nCalcTmp)[0] );
				}

				/* Browsers need a bit of a hand when a width is assigned to any columns when
				 * x-scrolling as they tend to collapse the table to the min-width, even if
				 * we sent the column widths. So we need to keep track of what the table width
				 * should be by summing the user given values, and the automatic values
				 */
				if ( oSettings.oScroll.sX !== "" )
				{
					var iTotal = 0;
					iCorrector = 0;
					for ( i=0 ; i<oSettings.aoColumns.length ; i++ )
					{
						if ( oSettings.aoColumns[i].bVisible )
						{
							if ( oSettings.aoColumns[i].sWidthOrig === null )
							{
								iTotal += $(oNodes[iCorrector]).outerWidth();
							}
							else
							{
								iTotal += parseInt(oSettings.aoColumns[i].sWidth.replace('px',''), 10) +
									($(oNodes[iCorrector]).outerWidth() - $(oNodes[iCorrector]).width());
							}
							iCorrector++;
						}
					}

					nCalcTmp.style.width = _fnStringToCss( iTotal );
					oSettings.nTable.style.width = _fnStringToCss( iTotal );
				}

				iCorrector = 0;
				for ( i=0 ; i<oSettings.aoColumns.length ; i++ )
				{
					if ( oSettings.aoColumns[i].bVisible )
					{
						iWidth = $(oNodes[iCorrector]).width();
						if ( iWidth !== null && iWidth > 0 )
						{
							oSettings.aoColumns[i].sWidth = _fnStringToCss( iWidth );
						}
						iCorrector++;
					}
				}

				oSettings.nTable.style.width = _fnStringToCss( $(nCalcTmp).outerWidth() );
				nCalcTmp.parentNode.removeChild( nCalcTmp );
			}
		}

		/*
		 * Function: _fnScrollingWidthAdjust
		 * Purpose:  Adjust a table's width to take account of scrolling
		 * Returns:  -
		 * Inputs:   object:oSettings - dataTables settings object
		 *           node:n - table node
		 */
		function _fnScrollingWidthAdjust ( oSettings, n )
		{
			if ( oSettings.oScroll.sX === "" && oSettings.oScroll.sY !== "" )
			{
				/* When y-scrolling only, we want to remove the width of the scroll bar so the table
				 * + scroll bar will fit into the area avaialble.
				 */
				var iOrigWidth = $(n).width();
				n.style.width = _fnStringToCss( $(n).outerWidth()-oSettings.oScroll.iBarWidth );
			}
			else if ( oSettings.oScroll.sX !== "" )
			{
				/* When x-scrolling both ways, fix the table at it's current size, without adjusting */
				n.style.width = _fnStringToCss( $(n).outerWidth() );
			}
		}

		/*
		 * Function: _fnGetWidestNode
		 * Purpose:  Get the widest node
		 * Returns:  string: - max strlens for each column
		 * Inputs:   object:oSettings - dataTables settings object
		 *           int:iCol - column of interest
		 */
		function _fnGetWidestNode( oSettings, iCol )
		{
			var iMaxIndex = _fnGetMaxLenString( oSettings, iCol );
			if ( iMaxIndex < 0 )
			{
				return null;
			}

			if ( oSettings.aoData[iMaxIndex].nTr === null )
			{
				var n = document.createElement('td');
				n.innerHTML = _fnGetCellData( oSettings, iMaxIndex, iCol, '' );
				return n;
			}
			return _fnGetTdNodes(oSettings, iMaxIndex)[iCol];
		}

		/*
		 * Function: _fnGetMaxLenString
		 * Purpose:  Get the maximum strlen for each data column
		 * Returns:  string: - max strlens for each column
		 * Inputs:   object:oSettings - dataTables settings object
		 *           int:iCol - column of interest
		 */
		function _fnGetMaxLenString( oSettings, iCol )
		{
			var iMax = -1;
			var iMaxIndex = -1;

			for ( var i=0 ; i<oSettings.aoData.length ; i++ )
			{
				var s = _fnGetCellData( oSettings, i, iCol, 'display' )+"";
				s = s.replace( /<.*?>/g, "" );
				if ( s.length > iMax )
				{
					iMax = s.length;
					iMaxIndex = i;
				}
			}

			return iMaxIndex;
		}

		/*
		 * Function: _fnStringToCss
		 * Purpose:  Append a CSS unit (only if required) to a string
		 * Returns:  0 if match, 1 if length is different, 2 if no match
		 * Inputs:   array:aArray1 - first array
		 *           array:aArray2 - second array
		 */
		function _fnStringToCss( s )
		{
			if ( s === null )
			{
				return "0px";
			}

			if ( typeof s == 'number' )
			{
				if ( s < 0 )
				{
					return "0px";
				}
				return s+"px";
			}

			/* Check if the last character is not 0-9 */
			var c = s.charCodeAt( s.length-1 );
			if (c < 0x30 || c > 0x39)
			{
				return s;
			}
			return s+"px";
		}

		/*
		 * Function: _fnArrayCmp
		 * Purpose:  Compare two arrays
		 * Returns:  0 if match, 1 if length is different, 2 if no match
		 * Inputs:   array:aArray1 - first array
		 *           array:aArray2 - second array
		 */
		function _fnArrayCmp( aArray1, aArray2 )
		{
			if ( aArray1.length != aArray2.length )
			{
				return 1;
			}

			for ( var i=0 ; i<aArray1.length ; i++ )
			{
				if ( aArray1[i] != aArray2[i] )
				{
					return 2;
				}
			}

			return 0;
		}

		/*
		 * Function: _fnDetectType
		 * Purpose:  Get the sort type based on an input string
		 * Returns:  string: - type (defaults to 'string' if no type can be detected)
		 * Inputs:   string:sData - data we wish to know the type of
		 * Notes:    This function makes use of the DataTables plugin objct _oExt
		 *   (.aTypes) such that new types can easily be added.
		 */
		function _fnDetectType( sData )
		{
			var aTypes = _oExt.aTypes;
			var iLen = aTypes.length;

			for ( var i=0 ; i<iLen ; i++ )
			{
				var sType = aTypes[i]( sData );
				if ( sType !== null )
				{
					return sType;
				}
			}

			return 'string';
		}

		/*
		 * Function: _fnSettingsFromNode
		 * Purpose:  Return the settings object for a particular table
		 * Returns:  object: Settings object - or null if not found
		 * Inputs:   node:nTable - table we are using as a dataTable
		 */
		function _fnSettingsFromNode ( nTable )
		{
			for ( var i=0 ; i<_aoSettings.length ; i++ )
			{
				if ( _aoSettings[i].nTable == nTable )
				{
					return _aoSettings[i];
				}
			}

			return null;
		}

		/*
		 * Function: _fnGetDataMaster
		 * Purpose:  Return an array with the full table data
		 * Returns:  array array:aData - Master data array
		 * Inputs:   object:oSettings - dataTables settings object
		 */
		function _fnGetDataMaster ( oSettings )
		{
			var aData = [];
			var iLen = oSettings.aoData.length;
			for ( var i=0 ; i<iLen; i++ )
			{
				aData.push( oSettings.aoData[i]._aData );
			}
			return aData;
		}

		/*
		 * Function: _fnGetTrNodes
		 * Purpose:  Return an array with the TR nodes for the table
		 * Returns:  array: - TR array
		 * Inputs:   object:oSettings - dataTables settings object
		 */
		function _fnGetTrNodes ( oSettings )
		{
			var aNodes = [];
			for ( var i=0, iLen=oSettings.aoData.length ; i<iLen ; i++ )
			{
				if ( oSettings.aoData[i].nTr !== null )
				{
					aNodes.push( oSettings.aoData[i].nTr );
				}
			}
			return aNodes;
		}

		/*
		 * Function: _fnGetTdNodes
		 * Purpose:  Return an flat array with all TD nodes for the table, or row
		 * Returns:  array: - TD array
		 * Inputs:   object:oSettings - dataTables settings object
		 *           int:iIndividualRow - aoData index to get the nodes for - optional if not
		 *             given then the return array will contain all nodes for the table
		 */
		function _fnGetTdNodes ( oSettings, iIndividualRow )
		{
			var anReturn = [];
			var iCorrector;
			var anTds;
			var iRow, iRows=oSettings.aoData.length,
				iColumn, iColumns, oData, sNodeName, iStart=0, iEnd=iRows;

			/* Allow the collection to be limited to just one row */
			if ( typeof iIndividualRow != 'undefined' )
			{
				iStart = iIndividualRow;
				iEnd = iIndividualRow+1;
			}

			for ( iRow=iStart ; iRow<iEnd ; iRow++ )
			{
				oData = oSettings.aoData[iRow];
				if ( oData.nTr !== null )
				{
					/* get the TD child nodes - taking into account text etc nodes */
					anTds = [];
					for ( iColumn=0, iColumns=oData.nTr.childNodes.length ; iColumn<iColumns ; iColumn++ )
					{
						sNodeName = oData.nTr.childNodes[iColumn].nodeName.toLowerCase();
						if ( sNodeName == 'td' || sNodeName == 'th' )
						{
							anTds.push( oData.nTr.childNodes[iColumn] );
						}
					}

					iCorrector = 0;
					for ( iColumn=0, iColumns=oSettings.aoColumns.length ; iColumn<iColumns ; iColumn++ )
					{
						if ( oSettings.aoColumns[iColumn].bVisible )
						{
							anReturn.push( anTds[iColumn-iCorrector] );
						}
						else
						{
							anReturn.push( oData._anHidden[iColumn] );
							iCorrector++;
						}
					}
				}
			}

			return anReturn;
		}

		/*
		 * Function: _fnEscapeRegex
		 * Purpose:  scape a string stuch that it can be used in a regular expression
		 * Returns:  string: - escaped string
		 * Inputs:   string:sVal - string to escape
		 */
		function _fnEscapeRegex ( sVal )
		{
			var acEscape = [ '/', '.', '*', '+', '?', '|', '(', ')', '[', ']', '{', '}', '\\', '$', '^' ];
		  var reReplace = new RegExp( '(\\' + acEscape.join('|\\') + ')', 'g' );
		  return sVal.replace(reReplace, '\\$1');
		}

		/*
		 * Function: _fnDeleteIndex
		 * Purpose:  Take an array of integers (index array) and remove a target integer (value - not
		 *             the key!)
		 * Returns:  -
		 * Inputs:   a:array int - Index array to target
		 *           int:iTarget - value to find
		 */
		function _fnDeleteIndex( a, iTarget )
		{
			var iTargetIndex = -1;

			for ( var i=0, iLen=a.length ; i<iLen ; i++ )
			{
				if ( a[i] == iTarget )
				{
					iTargetIndex = i;
				}
				else if ( a[i] > iTarget )
				{
					a[i]--;
				}
			}

			if ( iTargetIndex != -1 )
			{
				a.splice( iTargetIndex, 1 );
			}
		}

		/*
		 * Function: _fnReOrderIndex
		 * Purpose:  Figure out how to reorder a display list
		 * Returns:  array int:aiReturn - index list for reordering
		 * Inputs:   object:oSettings - dataTables settings object
		 */
		function _fnReOrderIndex ( oSettings, sColumns )
		{
			var aColumns = sColumns.split(',');
			var aiReturn = [];

			for ( var i=0, iLen=oSettings.aoColumns.length ; i<iLen ; i++ )
			{
				for ( var j=0 ; j<iLen ; j++ )
				{
					if ( oSettings.aoColumns[i].sName == aColumns[j] )
					{
						aiReturn.push( j );
						break;
					}
				}
			}

			return aiReturn;
		}

		/*
		 * Function: _fnColumnOrdering
		 * Purpose:  Get the column ordering that DataTables expects
		 * Returns:  string: - comma separated list of names
		 * Inputs:   object:oSettings - dataTables settings object
		 */
		function _fnColumnOrdering ( oSettings )
		{
			var sNames = '';
			for ( var i=0, iLen=oSettings.aoColumns.length ; i<iLen ; i++ )
			{
				sNames += oSettings.aoColumns[i].sName+',';
			}
			if ( sNames.length == iLen )
			{
				return "";
			}
			return sNames.slice(0, -1);
		}

		/*
		 * Function: _fnLog
		 * Purpose:  Log an error message
		 * Returns:  -
		 * Inputs:   int:iLevel - log error messages, or display them to the user
		 *           string:sMesg - error message
		 */
		function _fnLog( oSettings, iLevel, sMesg )
		{
			var sAlert = oSettings.sTableId === "" ?
			 	"DataTables warning: " +sMesg :
			 	"DataTables warning (table id = '"+oSettings.sTableId+"'): " +sMesg;

			if ( iLevel === 0 )
			{
				if ( _oExt.sErrMode == 'alert' )
				{
					alert( sAlert );
				}
				else
				{
					throw sAlert;
				}
				return;
			}
			else if ( typeof console != 'undefined' && typeof console.log != 'undefined' )
			{
				console.log( sAlert );
			}
		}

		/*
		 * Function: _fnClearTable
		 * Purpose:  Nuke the table
		 * Returns:  -
		 * Inputs:   object:oSettings - dataTables settings object
		 */
		function _fnClearTable( oSettings )
		{
			oSettings.aoData.splice( 0, oSettings.aoData.length );
			oSettings.aiDisplayMaster.splice( 0, oSettings.aiDisplayMaster.length );
			oSettings.aiDisplay.splice( 0, oSettings.aiDisplay.length );
			_fnCalculateEnd( oSettings );
		}

		/*
		 * Function: _fnSaveState
		 * Purpose:  Save the state of a table in a cookie such that the page can be reloaded
		 * Returns:  -
		 * Inputs:   object:oSettings - dataTables settings object
		 */
		function _fnSaveState ( oSettings )
		{
			if ( !oSettings.oFeatures.bStateSave || typeof oSettings.bDestroying != 'undefined' )
			{
				return;
			}

			/* Store the interesting variables */
			var i, iLen, sTmp;
			var sValue = "{";
			sValue += '"iCreate":'+ new Date().getTime()+',';
			sValue += '"iStart":'+ (oSettings.oScroll.bInfinite ? 0 : oSettings._iDisplayStart)+',';
			sValue += '"iEnd":'+ (oSettings.oScroll.bInfinite ? oSettings._iDisplayLength : oSettings._iDisplayEnd)+',';
			sValue += '"iLength":'+ oSettings._iDisplayLength+',';
			sValue += '"sFilter":"'+ encodeURIComponent(oSettings.oPreviousSearch.sSearch)+'",';
			sValue += '"sFilterEsc":'+ !oSettings.oPreviousSearch.bRegex+',';

			sValue += '"aaSorting":[ ';
			for ( i=0 ; i<oSettings.aaSorting.length ; i++ )
			{
				sValue += '['+oSettings.aaSorting[i][0]+',"'+oSettings.aaSorting[i][1]+'"],';
			}
			sValue = sValue.substring(0, sValue.length-1);
			sValue += "],";

			sValue += '"aaSearchCols":[ ';
			for ( i=0 ; i<oSettings.aoPreSearchCols.length ; i++ )
			{
				sValue += '["'+encodeURIComponent(oSettings.aoPreSearchCols[i].sSearch)+
					'",'+!oSettings.aoPreSearchCols[i].bRegex+'],';
			}
			sValue = sValue.substring(0, sValue.length-1);
			sValue += "],";

			sValue += '"abVisCols":[ ';
			for ( i=0 ; i<oSettings.aoColumns.length ; i++ )
			{
				sValue += oSettings.aoColumns[i].bVisible+",";
			}
			sValue = sValue.substring(0, sValue.length-1);
			sValue += "]";

			/* Save state from any plug-ins */
			for ( i=0, iLen=oSettings.aoStateSave.length ; i<iLen ; i++ )
			{
				sTmp = oSettings.aoStateSave[i].fn( oSettings, sValue );
				if ( sTmp !== "" )
				{
					sValue = sTmp;
				}
			}

			sValue += "}";

			_fnCreateCookie( oSettings.sCookiePrefix+oSettings.sInstance, sValue,
				oSettings.iCookieDuration, oSettings.sCookiePrefix, oSettings.fnCookieCallback );
		}

		/*
		 * Function: _fnLoadState
		 * Purpose:  Attempt to load a saved table state from a cookie
		 * Returns:  -
		 * Inputs:   object:oSettings - dataTables settings object
		 *           object:oInit - DataTables init object so we can override settings
		 */
		function _fnLoadState ( oSettings, oInit )
		{
			if ( !oSettings.oFeatures.bStateSave )
			{
				return;
			}

			var oData, i, iLen;
			var sData = _fnReadCookie( oSettings.sCookiePrefix+oSettings.sInstance );
			if ( sData !== null && sData !== '' )
			{
				/* Try/catch the JSON eval - if it is bad then we ignore it - note that 1.7.0 and before
				 * incorrectly used single quotes for some strings - hence the replace below
				 */
				try
				{
					oData = (typeof $.parseJSON == 'function') ?
						$.parseJSON( sData.replace(/'/g, '"') ) : eval( '('+sData+')' );
				}
				catch( e )
				{
					return;
				}

				/* Allow custom and plug-in manipulation functions to alter the data set which was
				 * saved, and also reject any saved state by returning false
				 */
				for ( i=0, iLen=oSettings.aoStateLoad.length ; i<iLen ; i++ )
				{
					if ( !oSettings.aoStateLoad[i].fn( oSettings, oData ) )
					{
						return;
					}
				}

				/* Store the saved state so it might be accessed at any time (particualrly a plug-in */
				oSettings.oLoadedState = $.extend( true, {}, oData );

				/* Restore key features */
				oSettings._iDisplayStart = oData.iStart;
				oSettings.iInitDisplayStart = oData.iStart;
				oSettings._iDisplayEnd = oData.iEnd;
				oSettings._iDisplayLength = oData.iLength;
				oSettings.oPreviousSearch.sSearch = decodeURIComponent(oData.sFilter);
				oSettings.aaSorting = oData.aaSorting.slice();
				oSettings.saved_aaSorting = oData.aaSorting.slice();

				/*
				 * Search filtering - global reference added in 1.4.1
				 * Note that we use a 'not' for the value of the regular expression indicator to maintain
				 * compatibility with pre 1.7 versions, where this was basically inverted. Added in 1.7.0
				 */
				if ( typeof oData.sFilterEsc != 'undefined' )
				{
					oSettings.oPreviousSearch.bRegex = !oData.sFilterEsc;
				}

				/* Column filtering - added in 1.5.0 beta 6 */
				if ( typeof oData.aaSearchCols != 'undefined' )
				{
					for ( i=0 ; i<oData.aaSearchCols.length ; i++ )
					{
						oSettings.aoPreSearchCols[i] = {
							"sSearch": decodeURIComponent(oData.aaSearchCols[i][0]),
							"bRegex": !oData.aaSearchCols[i][1]
						};
					}
				}

				/* Column visibility state - added in 1.5.0 beta 10 */
				if ( typeof oData.abVisCols != 'undefined' )
				{
					/* Pass back visibiliy settings to the init handler, but to do not here override
					 * the init object that the user might have passed in
					 */
					oInit.saved_aoColumns = [];
					for ( i=0 ; i<oData.abVisCols.length ; i++ )
					{
						oInit.saved_aoColumns[i] = {};
						oInit.saved_aoColumns[i].bVisible = oData.abVisCols[i];
					}
				}
			}
		}

		/*
		 * Function: _fnCreateCookie
		 * Purpose:  Create a new cookie with a value to store the state of a table
		 * Returns:  -
		 * Inputs:   string:sName - name of the cookie to create
		 *           string:sValue - the value the cookie should take
		 *           int:iSecs - duration of the cookie
		 *           string:sBaseName - sName is made up of the base + file name - this is the base
		 *           function:fnCallback - User definable function to modify the cookie
		 */
		function _fnCreateCookie ( sName, sValue, iSecs, sBaseName, fnCallback )
		{
			var date = new Date();
			date.setTime( date.getTime()+(iSecs*1000) );

			/*
			 * Shocking but true - it would appear IE has major issues with having the path not having
			 * a trailing slash on it. We need the cookie to be available based on the path, so we
			 * have to append the file name to the cookie name. Appalling. Thanks to vex for adding the
			 * patch to use at least some of the path
			 */
			var aParts = window.location.pathname.split('/');
			var sNameFile = sName + '_' + aParts.pop().replace(/[\/:]/g,"").toLowerCase();
			var sFullCookie, oData;

			if ( fnCallback !== null )
			{
				oData = (typeof $.parseJSON == 'function') ?
					$.parseJSON( sValue ) : eval( '('+sValue+')' );
				sFullCookie = fnCallback( sNameFile, oData, date.toGMTString(),
					aParts.join('/')+"/" );
			}
			else
			{
				sFullCookie = sNameFile + "=" + encodeURIComponent(sValue) +
					"; expires=" + date.toGMTString() +"; path=" + aParts.join('/')+"/";
			}

			/* Are we going to go over the cookie limit of 4KiB? If so, try to delete a cookies
			 * belonging to DataTables. This is FAR from bullet proof
			 */
			var sOldName="", iOldTime=9999999999999;
			var iLength = _fnReadCookie( sNameFile )!==null ? document.cookie.length :
				sFullCookie.length + document.cookie.length;

			if ( iLength+10 > 4096 ) /* Magic 10 for padding */
			{
				var aCookies =document.cookie.split(';');
				for ( var i=0, iLen=aCookies.length ; i<iLen ; i++ )
				{
					if ( aCookies[i].indexOf( sBaseName ) != -1 )
					{
						/* It's a DataTables cookie, so eval it and check the time stamp */
						var aSplitCookie = aCookies[i].split('=');
						try { oData = eval( '('+decodeURIComponent(aSplitCookie[1])+')' ); }
						catch( e ) { continue; }

						if ( typeof oData.iCreate != 'undefined' && oData.iCreate < iOldTime )
						{
							sOldName = aSplitCookie[0];
							iOldTime = oData.iCreate;
						}
					}
				}

				if ( sOldName !== "" )
				{
					document.cookie = sOldName+"=; expires=Thu, 01-Jan-1970 00:00:01 GMT; path="+
						aParts.join('/') + "/";
				}
			}

			document.cookie = sFullCookie;
		}

		/*
		 * Function: _fnReadCookie
		 * Purpose:  Read an old cookie to get a cookie with an old table state
		 * Returns:  string: - contents of the cookie - or null if no cookie with that name found
		 * Inputs:   string:sName - name of the cookie to read
		 */
		function _fnReadCookie ( sName )
		{
			var
				aParts = window.location.pathname.split('/'),
				sNameEQ = sName + '_' + aParts[aParts.length-1].replace(/[\/:]/g,"").toLowerCase() + '=',
			 	sCookieContents = document.cookie.split(';');

			for( var i=0 ; i<sCookieContents.length ; i++ )
			{
				var c = sCookieContents[i];

				while (c.charAt(0)==' ')
				{
					c = c.substring(1,c.length);
				}

				if (c.indexOf(sNameEQ) === 0)
				{
					return decodeURIComponent( c.substring(sNameEQ.length,c.length) );
				}
			}
			return null;
		}

		/*
		 * Function: _fnDetectHeader
		 * Purpose:  Use the DOM source to create up an array of header cells. The idea here is to
		 *           create a layout grid (array) of rows x columns, which contains a reference
		 *           to the cell that that point in the grid (regardless of col/rowspan), such that
		 *           any column / row could be removed and the new grid constructed
		 * Returns:  void
		 * Outputs:  array object:aLayout - Array to store the calculated layout in
		 * Inputs:   node:nThead - The header/footer element for the table
		 */
		function _fnDetectHeader ( aLayout, nThead )
		{
			var nTrs = nThead.getElementsByTagName('tr');
			var nCell;
			var i, j, k, l, iLen, jLen, iColShifted;
			var fnShiftCol = function ( a, i, j ) {
				while ( typeof a[i][j] != 'undefined' ) {
					j++;
				}
				return j;
			};

			aLayout.splice( 0, aLayout.length );

			/* We know how many rows there are in the layout - so prep it */
			for ( i=0, iLen=nTrs.length ; i<iLen ; i++ )
			{
				aLayout.push( [] );
			}

			/* Calculate a layout array */
			for ( i=0, iLen=nTrs.length ; i<iLen ; i++ )
			{
				var iColumn = 0;

				/* For every cell in the row... */
				for ( j=0, jLen=nTrs[i].childNodes.length ; j<jLen ; j++ )
				{
					nCell = nTrs[i].childNodes[j];

					if ( nCell.nodeName.toUpperCase() == "TD" ||
					     nCell.nodeName.toUpperCase() == "TH" )
					{
						/* Get the col and rowspan attributes from the DOM and sanitise them */
						var iColspan = nCell.getAttribute('colspan') * 1;
						var iRowspan = nCell.getAttribute('rowspan') * 1;
						iColspan = (!iColspan || iColspan===0 || iColspan===1) ? 1 : iColspan;
						iRowspan = (!iRowspan || iRowspan===0 || iRowspan===1) ? 1 : iRowspan;

						/* There might be colspan cells already in this row, so shift our target
						 * accordingly
						 */
						iColShifted = fnShiftCol( aLayout, i, iColumn );

						/* If there is col / rowspan, copy the information into the layout grid */
						for ( l=0 ; l<iColspan ; l++ )
						{
							for ( k=0 ; k<iRowspan ; k++ )
							{
								aLayout[i+k][iColShifted+l] = {
									"cell": nCell,
									"unique": iColspan == 1 ? true : false
								};
								aLayout[i+k].nTr = nTrs[i];
							}
						}
					}
				}
			}
		}

		/*
		 * Function: _fnGetUniqueThs
		 * Purpose:  Get an array of unique th elements, one for each column
		 * Returns:  array node:aReturn - list of unique ths
		 * Inputs:   object:oSettings - dataTables settings object
		 *           node:nHeader - automatically detect the layout from this node - optional
		 *           array object:aLayout - thead/tfoot layout from _fnDetectHeader - optional
		 */
		function _fnGetUniqueThs ( oSettings, nHeader, aLayout )
		{
			var aReturn = [];
			if ( typeof aLayout == 'undefined' )
			{
				aLayout = oSettings.aoHeader;
				if ( typeof nHeader != 'undefined' )
				{
					aLayout = [];
					_fnDetectHeader( aLayout, nHeader );
				}
			}

			for ( var i=0, iLen=aLayout.length ; i<iLen ; i++ )
			{
				for ( var j=0, jLen=aLayout[i].length ; j<jLen ; j++ )
				{
					if ( aLayout[i][j].unique &&
						 (typeof aReturn[j] == 'undefined' || !oSettings.bSortCellsTop) )
					{
						aReturn[j] = aLayout[i][j].cell;
					}
				}
			}

			return aReturn;
		}

		/*
		 * Function: _fnScrollBarWidth
		 * Purpose:  Get the width of a scroll bar in this browser being used
		 * Returns:  int: - width in pixels
		 * Inputs:   -
		 * Notes:    All credit for this function belongs to Alexandre Gomes. Thanks for sharing!
		 *   http://www.alexandre-gomes.com/?p=115
		 */
		function _fnScrollBarWidth ()
		{
			var inner = document.createElement('p');
			var style = inner.style;
			style.width = "100%";
			style.height = "200px";

			var outer = document.createElement('div');
			style = outer.style;
			style.position = "absolute";
			style.top = "0px";
			style.left = "0px";
			style.visibility = "hidden";
			style.width = "200px";
			style.height = "150px";
			style.overflow = "hidden";
			outer.appendChild(inner);

			document.body.appendChild(outer);
			var w1 = inner.offsetWidth;
			outer.style.overflow = 'scroll';
			var w2 = inner.offsetWidth;
			if ( w1 == w2 )
			{
				w2 = outer.clientWidth;
			}

			document.body.removeChild(outer);
			return (w1 - w2);
		}

		/*
		 * Function: _fnApplyToChildren
		 * Purpose:  Apply a given function to the display child nodes of an element array (typically
		 *   TD children of TR rows
		 * Returns:  - (done by reference)
		 * Inputs:   function:fn - Method to apply to the objects
		 *           array nodes:an1 - List of elements to look through for display children
		 *           array nodes:an2 - Another list (identical structure to the first) - optional
		 */
		function _fnApplyToChildren( fn, an1, an2 )
		{
			for ( var i=0, iLen=an1.length ; i<iLen ; i++ )
			{
				for ( var j=0, jLen=an1[i].childNodes.length ; j<jLen ; j++ )
				{
					if ( an1[i].childNodes[j].nodeType == 1 )
					{
						if ( typeof an2 != 'undefined' )
						{
							fn( an1[i].childNodes[j], an2[i].childNodes[j] );
						}
						else
						{
							fn( an1[i].childNodes[j] );
						}
					}
				}
			}
		}

		/*
		 * Function: _fnMap
		 * Purpose:  See if a property is defined on one object, if so assign it to the other object
		 * Returns:  - (done by reference)
		 * Inputs:   object:oRet - target object
		 *           object:oSrc - source object
		 *           string:sName - property
		 *           string:sMappedName - name to map too - optional, sName used if not given
		 */
		function _fnMap( oRet, oSrc, sName, sMappedName )
		{
			if ( typeof sMappedName == 'undefined' )
			{
				sMappedName = sName;
			}
			if ( typeof oSrc[sName] != 'undefined' )
			{
				oRet[sMappedName] = oSrc[sName];
			}
		}

		/*
		 * Function: _fnGetRowData
		 * Purpose:  Get an array of data for a given row from the internal data cache
		 * Returns:  array: - Data array
		 * Inputs:   object:oSettings - dataTables settings object
		 *           int:iRow - aoData row id
		 *           string:sSpecific - data get type ('type' 'filter' 'sort')
		 */
		function _fnGetRowData( oSettings, iRow, sSpecific )
		{
			var out = [];
			for ( var i=0, iLen=oSettings.aoColumns.length ; i<iLen ; i++ )
			{
				out.push( _fnGetCellData( oSettings, iRow, i, sSpecific ) );
			}
			return out;
		}

		/*
		 * Function: _fnGetCellData
		 * Purpose:  Get the data for a given cell from the internal cache, taking into account data mapping
		 * Returns:  *: - Cell data
		 * Inputs:   object:oSettings - dataTables settings object
		 *           int:iRow - aoData row id
		 *           int:iCol - Column index
		 *           string:sSpecific - data get type ('display', 'type' 'filter' 'sort')
		 */
		function _fnGetCellData( oSettings, iRow, iCol, sSpecific )
		{
			var sData;
			var oCol = oSettings.aoColumns[iCol];
			var oData = oSettings.aoData[iRow]._aData;

			if ( (sData=oCol.fnGetData( oData )) === undefined )
			{
				if ( oSettings.iDrawError != oSettings.iDraw && oCol.sDefaultContent === null )
				{
					_fnLog( oSettings, 0, "Requested unknown parameter '"+oCol.mDataProp+
						"' from the data source for row "+iRow );
					oSettings.iDrawError = oSettings.iDraw;
				}
				return oCol.sDefaultContent;
			}

			/* When the data source is null, we can use default column data */
			if ( sData === null && oCol.sDefaultContent !== null )
			{
				sData = oCol.sDefaultContent;
			}

			if ( sSpecific == 'display' && sData === null )
			{
				return '';
			}
			return sData;
		}

		/*
		 * Function: _fnSetCellData
		 * Purpose:  Set the value for a specific cell, into the internal data cache
		 * Returns:  *: - Cell data
		 * Inputs:   object:oSettings - dataTables settings object
		 *           int:iRow - aoData row id
		 *           int:iCol - Column index
		 *           *:val - Value to set
		 */
		function _fnSetCellData( oSettings, iRow, iCol, val )
		{
			var oCol = oSettings.aoColumns[iCol];
			var oData = oSettings.aoData[iRow]._aData;

			oCol.fnSetData( oData, val );
		}

		/*
		 * Function: _fnGetObjectDataFn
		 * Purpose:  Return a function that can be used to get data from a source object, taking
		 *           into account the ability to use nested objects as a source
		 * Returns:  function: - Data get function
		 * Inputs:   string|int|function:mSource - The data source for the object
		 */
		function _fnGetObjectDataFn( mSource )
		{
			if ( mSource === null )
			{
				/* Give an empty string for rendering / sorting etc */
				return function (data) {
					return null;
				};
			}
			else if ( typeof mSource == 'function' )
			{
			    return function (data) {
			        return mSource( data );
			    };
			}
			else if ( typeof mSource == 'string' && mSource.indexOf('.') != -1 )
			{
				/* If there is a . in the source string then the data source is in a nested object
				 * we provide two 'quick' functions for the look up to speed up the most common
				 * operation, and a generalised one for when it is needed
				 */
				var a = mSource.split('.');
				if ( a.length == 2 )
				{
					return function (data) {
						return data[ a[0] ][ a[1] ];
					};
				}
				else if ( a.length == 3 )
				{
					return function (data) {
						return data[ a[0] ][ a[1] ][ a[2] ];
					};
				}
				else
				{
					return function (data) {
						for ( var i=0, iLen=a.length ; i<iLen ; i++ )
						{
							data = data[ a[i] ];
						}
						return data;
					};
				}
			}
			else
			{
				/* Array or flat object mapping */
				return function (data) {
					return data[mSource];
				};
			}
		}

		/*
		 * Function: _fnSetObjectDataFn
		 * Purpose:  Return a function that can be used to set data from a source object, taking
		 *           into account the ability to use nested objects as a source
		 * Returns:  function: - Data set function
		 * Inputs:   string|int|function:mSource - The data source for the object
		 */
		function _fnSetObjectDataFn( mSource )
		{
			if ( mSource === null )
			{
				/* Nothing to do when the data source is null */
				return function (data, val) {};
			}
			else if ( typeof mSource == 'function' )
			{
			    return function (data, val) {
			        return mSource( data, val );
			    };
			}
			else if ( typeof mSource == 'string' && mSource.indexOf('.') != -1 )
			{
				/* Like the get, we need to get data from a nested object. Again two fast lookup
				 * functions are provided, and a generalised one.
				 */
				var a = mSource.split('.');
				if ( a.length == 2 )
				{
					return function (data, val) {
						data[ a[0] ][ a[1] ] = val;
					};
				}
				else if ( a.length == 3 )
				{
					return function (data, val) {
						data[ a[0] ][ a[1] ][ a[2] ] = val;
					};
				}
				else
				{
					return function (data, val) {
						for ( var i=0, iLen=a.length-1 ; i<iLen ; i++ )
						{
							data = data[ a[i] ];
						}
						data[ a[a.length-1] ] = val;
					};
				}
			}
			else
			{
				/* Array or flat object mapping */
				return function (data, val) {
					data[mSource] = val;
				};
			}
		}


		/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
		 * Section - API
		 * I'm not happy with this solution... - To be fixed in 2.0
		 */
		this.oApi._fnExternApiFunc = _fnExternApiFunc;
		this.oApi._fnInitalise = _fnInitalise;
		this.oApi._fnInitComplete = _fnInitComplete;
		this.oApi._fnLanguageProcess = _fnLanguageProcess;
		this.oApi._fnAddColumn = _fnAddColumn;
		this.oApi._fnColumnOptions = _fnColumnOptions;
		this.oApi._fnAddData = _fnAddData;
		this.oApi._fnCreateTr = _fnCreateTr;
		this.oApi._fnGatherData = _fnGatherData;
		this.oApi._fnBuildHead = _fnBuildHead;
		this.oApi._fnDrawHead = _fnDrawHead;
		this.oApi._fnDraw = _fnDraw;
		this.oApi._fnReDraw = _fnReDraw;
		this.oApi._fnAjaxUpdate = _fnAjaxUpdate;
		this.oApi._fnAjaxUpdateDraw = _fnAjaxUpdateDraw;
		this.oApi._fnAddOptionsHtml = _fnAddOptionsHtml;
		this.oApi._fnFeatureHtmlTable = _fnFeatureHtmlTable;
		this.oApi._fnScrollDraw = _fnScrollDraw;
		this.oApi._fnAjustColumnSizing = _fnAjustColumnSizing;
		this.oApi._fnFeatureHtmlFilter = _fnFeatureHtmlFilter;
		this.oApi._fnFilterComplete = _fnFilterComplete;
		this.oApi._fnFilterCustom = _fnFilterCustom;
		this.oApi._fnFilterColumn = _fnFilterColumn;
		this.oApi._fnFilter = _fnFilter;
		this.oApi._fnBuildSearchArray = _fnBuildSearchArray;
		this.oApi._fnBuildSearchRow = _fnBuildSearchRow;
		this.oApi._fnFilterCreateSearch = _fnFilterCreateSearch;
		this.oApi._fnDataToSearch = _fnDataToSearch;
		this.oApi._fnSort = _fnSort;
		this.oApi._fnSortAttachListener = _fnSortAttachListener;
		this.oApi._fnSortingClasses = _fnSortingClasses;
		this.oApi._fnFeatureHtmlPaginate = _fnFeatureHtmlPaginate;
		this.oApi._fnPageChange = _fnPageChange;
		this.oApi._fnFeatureHtmlInfo = _fnFeatureHtmlInfo;
		this.oApi._fnUpdateInfo = _fnUpdateInfo;
		this.oApi._fnFeatureHtmlLength = _fnFeatureHtmlLength;
		this.oApi._fnFeatureHtmlProcessing = _fnFeatureHtmlProcessing;
		this.oApi._fnProcessingDisplay = _fnProcessingDisplay;
		this.oApi._fnVisibleToColumnIndex = _fnVisibleToColumnIndex;
		this.oApi._fnColumnIndexToVisible = _fnColumnIndexToVisible;
		this.oApi._fnNodeToDataIndex = _fnNodeToDataIndex;
		this.oApi._fnVisbleColumns = _fnVisbleColumns;
		this.oApi._fnCalculateEnd = _fnCalculateEnd;
		this.oApi._fnConvertToWidth = _fnConvertToWidth;
		this.oApi._fnCalculateColumnWidths = _fnCalculateColumnWidths;
		this.oApi._fnScrollingWidthAdjust = _fnScrollingWidthAdjust;
		this.oApi._fnGetWidestNode = _fnGetWidestNode;
		this.oApi._fnGetMaxLenString = _fnGetMaxLenString;
		this.oApi._fnStringToCss = _fnStringToCss;
		this.oApi._fnArrayCmp = _fnArrayCmp;
		this.oApi._fnDetectType = _fnDetectType;
		this.oApi._fnSettingsFromNode = _fnSettingsFromNode;
		this.oApi._fnGetDataMaster = _fnGetDataMaster;
		this.oApi._fnGetTrNodes = _fnGetTrNodes;
		this.oApi._fnGetTdNodes = _fnGetTdNodes;
		this.oApi._fnEscapeRegex = _fnEscapeRegex;
		this.oApi._fnDeleteIndex = _fnDeleteIndex;
		this.oApi._fnReOrderIndex = _fnReOrderIndex;
		this.oApi._fnColumnOrdering = _fnColumnOrdering;
		this.oApi._fnLog = _fnLog;
		this.oApi._fnClearTable = _fnClearTable;
		this.oApi._fnSaveState = _fnSaveState;
		this.oApi._fnLoadState = _fnLoadState;
		this.oApi._fnCreateCookie = _fnCreateCookie;
		this.oApi._fnReadCookie = _fnReadCookie;
		this.oApi._fnDetectHeader = _fnDetectHeader;
		this.oApi._fnGetUniqueThs = _fnGetUniqueThs;
		this.oApi._fnScrollBarWidth = _fnScrollBarWidth;
		this.oApi._fnApplyToChildren = _fnApplyToChildren;
		this.oApi._fnMap = _fnMap;
		this.oApi._fnGetRowData = _fnGetRowData;
		this.oApi._fnGetCellData = _fnGetCellData;
		this.oApi._fnSetCellData = _fnSetCellData;
		this.oApi._fnGetObjectDataFn = _fnGetObjectDataFn;
		this.oApi._fnSetObjectDataFn = _fnSetObjectDataFn;


		/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
		 * Section - Constructor
		 */

		/* Want to be able to reference "this" inside the this.each function */
		var _that = this;
		return this.each(function()
		{
			var i=0, iLen, j, jLen, k, kLen;

			/* Check to see if we are re-initalising a table */
			for ( i=0, iLen=_aoSettings.length ; i<iLen ; i++ )
			{
				/* Base check on table node */
				if ( _aoSettings[i].nTable == this )
				{
					if ( typeof oInit == 'undefined' ||
					   ( typeof oInit.bRetrieve != 'undefined' && oInit.bRetrieve === true ) )
					{
						return _aoSettings[i].oInstance;
					}
					else if ( typeof oInit.bDestroy != 'undefined' && oInit.bDestroy === true )
					{
						_aoSettings[i].oInstance.fnDestroy();
						break;
					}
					else
					{
						_fnLog( _aoSettings[i], 0, "Cannot reinitialise DataTable.\n\n"+
							"To retrieve the DataTables object for this table, please pass either no arguments "+
							"to the dataTable() function, or set bRetrieve to true. Alternatively, to destory "+
							"the old table and create a new one, set bDestroy to true (note that a lot of "+
							"changes to the configuration can be made through the API which is usually much "+
							"faster)." );
						return;
					}
				}

				/* If the element we are initialising has the same ID as a table which was previously
				 * initialised, but the table nodes don't match (from before) then we destory the old
				 * instance by simply deleting it. This is under the assumption that the table has been
				 * destroyed by other methods. Anyone using non-id selectors will need to do this manually
				 */
				if ( _aoSettings[i].sTableId !== "" && _aoSettings[i].sTableId == this.getAttribute('id') )
				{
					_aoSettings.splice( i, 1 );
					break;
				}
			}

			/* Make a complete and independent copy of the settings object */
			var oSettings = new classSettings();
			_aoSettings.push( oSettings );

			var bInitHandedOff = false;
			var bUsePassedData = false;

			/* Set the id */
			var sId = this.getAttribute( 'id' );
			if ( sId !== null )
			{
				oSettings.sTableId = sId;
				oSettings.sInstance = sId;
			}
			else
			{
				oSettings.sInstance = _oExt._oExternConfig.iNextUnique ++;
			}

			/* Sanity check */
			if ( this.nodeName.toLowerCase() != 'table' )
			{
				_fnLog( oSettings, 0, "Attempted to initialise DataTables on a node which is not a "+
					"table: "+this.nodeName );
				return;
			}

			/* Set the table node */
			oSettings.nTable = this;

			/* Keep a reference to the 'this' instance for the table. Note that if this table is being
			 * created with others, we retrieve a unique instance to ease API access.
			 */
			oSettings.oInstance = _that.length == 1 ? _that : $(this).dataTable();

			/* Bind the API functions to the settings, so we can perform actions whenever oSettings is
			 * available
			 */
			oSettings.oApi = _that.oApi;

			/* State the table's width for if a destroy is called at a later time */
			oSettings.sDestroyWidth = $(this).width();

			/* Store the features that we have available */
			if ( typeof oInit != 'undefined' && oInit !== null )
			{
				oSettings.oInit = oInit;
				_fnMap( oSettings.oFeatures, oInit, "bPaginate" );
				_fnMap( oSettings.oFeatures, oInit, "bLengthChange" );
				_fnMap( oSettings.oFeatures, oInit, "bFilter" );
				_fnMap( oSettings.oFeatures, oInit, "bSort" );
				_fnMap( oSettings.oFeatures, oInit, "bInfo" );
				_fnMap( oSettings.oFeatures, oInit, "bProcessing" );
				_fnMap( oSettings.oFeatures, oInit, "bAutoWidth" );
				_fnMap( oSettings.oFeatures, oInit, "bSortClasses" );
				_fnMap( oSettings.oFeatures, oInit, "bServerSide" );
				_fnMap( oSettings.oFeatures, oInit, "bDeferRender" );
				_fnMap( oSettings.oScroll, oInit, "sScrollX", "sX" );
				_fnMap( oSettings.oScroll, oInit, "sScrollXInner", "sXInner" );
				_fnMap( oSettings.oScroll, oInit, "sScrollY", "sY" );
				_fnMap( oSettings.oScroll, oInit, "bScrollCollapse", "bCollapse" );
				_fnMap( oSettings.oScroll, oInit, "bScrollInfinite", "bInfinite" );
				_fnMap( oSettings.oScroll, oInit, "iScrollLoadGap", "iLoadGap" );
				_fnMap( oSettings.oScroll, oInit, "bScrollAutoCss", "bAutoCss" );
				_fnMap( oSettings, oInit, "asStripClasses" );
				_fnMap( oSettings, oInit, "fnPreDrawCallback" );
				_fnMap( oSettings, oInit, "fnRowCallback" );
				_fnMap( oSettings, oInit, "fnHeaderCallback" );
				_fnMap( oSettings, oInit, "fnFooterCallback" );
				_fnMap( oSettings, oInit, "fnCookieCallback" );
				_fnMap( oSettings, oInit, "fnInitComplete" );
				_fnMap( oSettings, oInit, "fnServerData" );
				_fnMap( oSettings, oInit, "fnFormatNumber" );
				_fnMap( oSettings, oInit, "aaSorting" );
				_fnMap( oSettings, oInit, "aaSortingFixed" );
				_fnMap( oSettings, oInit, "aLengthMenu" );
				_fnMap( oSettings, oInit, "sPaginationType" );
				_fnMap( oSettings, oInit, "sAjaxSource" );
				_fnMap( oSettings, oInit, "sAjaxDataProp" );
				_fnMap( oSettings, oInit, "iCookieDuration" );
				_fnMap( oSettings, oInit, "sCookiePrefix" );
				_fnMap( oSettings, oInit, "sDom" );
				_fnMap( oSettings, oInit, "bSortCellsTop" );
				_fnMap( oSettings, oInit, "oSearch", "oPreviousSearch" );
				_fnMap( oSettings, oInit, "aoSearchCols", "aoPreSearchCols" );
				_fnMap( oSettings, oInit, "iDisplayLength", "_iDisplayLength" );
				_fnMap( oSettings, oInit, "bJQueryUI", "bJUI" );
				_fnMap( oSettings.oLanguage, oInit, "fnInfoCallback" );

				/* Callback functions which are array driven */
				if ( typeof oInit.fnDrawCallback == 'function' )
				{
					oSettings.aoDrawCallback.push( {
						"fn": oInit.fnDrawCallback,
						"sName": "user"
					} );
				}

				if ( typeof oInit.fnStateSaveCallback == 'function' )
				{
					oSettings.aoStateSave.push( {
						"fn": oInit.fnStateSaveCallback,
						"sName": "user"
					} );
				}

				if ( typeof oInit.fnStateLoadCallback == 'function' )
				{
					oSettings.aoStateLoad.push( {
						"fn": oInit.fnStateLoadCallback,
						"sName": "user"
					} );
				}

				if ( oSettings.oFeatures.bServerSide && oSettings.oFeatures.bSort &&
					   oSettings.oFeatures.bSortClasses )
				{
					/* Enable sort classes for server-side processing. Safe to do it here, since server-side
					 * processing must be enabled by the developer
					 */
					oSettings.aoDrawCallback.push( {
						"fn": _fnSortingClasses,
						"sName": "server_side_sort_classes"
					} );
				}
				else if ( oSettings.oFeatures.bDeferRender )
				{
					oSettings.aoDrawCallback.push( {
						"fn": _fnSortingClasses,
						"sName": "defer_sort_classes"
					} );
				}

				if ( typeof oInit.bJQueryUI != 'undefined' && oInit.bJQueryUI )
				{
					/* Use the JUI classes object for display. You could clone the oStdClasses object if
					 * you want to have multiple tables with multiple independent classes
					 */
					oSettings.oClasses = _oExt.oJUIClasses;

					if ( typeof oInit.sDom == 'undefined' )
					{
						/* Set the DOM to use a layout suitable for jQuery UI's theming */
						oSettings.sDom = '<"H"lfr>t<"F"ip>';
					}
				}

				/* Calculate the scroll bar width and cache it for use later on */
				if ( oSettings.oScroll.sX !== "" || oSettings.oScroll.sY !== "" )
				{
					oSettings.oScroll.iBarWidth = _fnScrollBarWidth();
				}

				if ( typeof oInit.iDisplayStart != 'undefined' &&
				     typeof oSettings.iInitDisplayStart == 'undefined' )
				{
					/* Display start point, taking into account the save saving */
					oSettings.iInitDisplayStart = oInit.iDisplayStart;
					oSettings._iDisplayStart = oInit.iDisplayStart;
				}

				/* Must be done after everything which can be overridden by a cookie! */
				if ( typeof oInit.bStateSave != 'undefined' )
				{
					oSettings.oFeatures.bStateSave = oInit.bStateSave;
					_fnLoadState( oSettings, oInit );
					oSettings.aoDrawCallback.push( {
						"fn": _fnSaveState,
						"sName": "state_save"
					} );
				}

				if ( typeof oInit.iDeferLoading != 'undefined' )
				{
					oSettings.bDeferLoading = true;
					oSettings._iRecordsTotal = oInit.iDeferLoading;
					oSettings._iRecordsDisplay = oInit.iDeferLoading;
				}

				if ( typeof oInit.aaData != 'undefined' )
				{
					bUsePassedData = true;
				}

				/* Backwards compatability */
				/* aoColumns / aoData - remove at some point... */
				if ( typeof oInit != 'undefined' && typeof oInit.aoData != 'undefined' )
				{
					oInit.aoColumns = oInit.aoData;
				}

				/* Language definitions */
				if ( typeof oInit.oLanguage != 'undefined' )
				{
					if ( typeof oInit.oLanguage.sUrl != 'undefined' && oInit.oLanguage.sUrl !== "" )
					{
						/* Get the language definitions from a file */
						oSettings.oLanguage.sUrl = oInit.oLanguage.sUrl;
						$.getJSON( oSettings.oLanguage.sUrl, null, function( json ) {
							_fnLanguageProcess( oSettings, json, true ); } );
						bInitHandedOff = true;
					}
					else
					{
						_fnLanguageProcess( oSettings, oInit.oLanguage, false );
					}
				}
				/* Warning: The _fnLanguageProcess function is async to the remainder of this function due
				 * to the XHR. We use _bInitialised in _fnLanguageProcess() to check this the processing
				 * below is complete. The reason for spliting it like this is optimisation - we can fire
				 * off the XHR (if needed) and then continue processing the data.
				 */
			}
			else
			{
				/* Create a dummy object for quick manipulation later on. */
				oInit = {};
			}

			/*
			 * Stripes
			 * Add the strip classes now that we know which classes to apply - unless overruled
			 */
			if ( typeof oInit.asStripClasses == 'undefined' )
			{
				oSettings.asStripClasses.push( oSettings.oClasses.sStripOdd );
				oSettings.asStripClasses.push( oSettings.oClasses.sStripEven );
			}

			/* Remove row stripe classes if they are already on the table row */
			var bStripeRemove = false;
			var anRows = $('>tbody>tr', this);
			for ( i=0, iLen=oSettings.asStripClasses.length ; i<iLen ; i++ )
			{
				if ( anRows.filter(":lt(2)").hasClass( oSettings.asStripClasses[i]) )
				{
					bStripeRemove = true;
					break;
				}
			}

			if ( bStripeRemove )
			{
				/* Store the classes which we are about to remove so they can be readded on destory */
				oSettings.asDestoryStrips = [ '', '' ];
				if ( $(anRows[0]).hasClass(oSettings.oClasses.sStripOdd) )
				{
					oSettings.asDestoryStrips[0] += oSettings.oClasses.sStripOdd+" ";
				}
				if ( $(anRows[0]).hasClass(oSettings.oClasses.sStripEven) )
				{
					oSettings.asDestoryStrips[0] += oSettings.oClasses.sStripEven;
				}
				if ( $(anRows[1]).hasClass(oSettings.oClasses.sStripOdd) )
				{
					oSettings.asDestoryStrips[1] += oSettings.oClasses.sStripOdd+" ";
				}
				if ( $(anRows[1]).hasClass(oSettings.oClasses.sStripEven) )
				{
					oSettings.asDestoryStrips[1] += oSettings.oClasses.sStripEven;
				}

				anRows.removeClass( oSettings.asStripClasses.join(' ') );
			}

			/*
			 * Columns
			 * See if we should load columns automatically or use defined ones
			 */
			var anThs = [];
			var aoColumnsInit;
			var nThead = this.getElementsByTagName('thead');
			if ( nThead.length !== 0 )
			{
				_fnDetectHeader( oSettings.aoHeader, nThead[0] );
				anThs = _fnGetUniqueThs( oSettings );
			}

			/* If not given a column array, generate one with nulls */
			if ( typeof oInit.aoColumns == 'undefined' )
			{
				aoColumnsInit = [];
				for ( i=0, iLen=anThs.length ; i<iLen ; i++ )
				{
					aoColumnsInit.push( null );
				}
			}
			else
			{
				aoColumnsInit = oInit.aoColumns;
			}

			/* Add the columns */
			for ( i=0, iLen=aoColumnsInit.length ; i<iLen ; i++ )
			{
				/* Check if we have column visibilty state to restore */
				if ( typeof oInit.saved_aoColumns != 'undefined' && oInit.saved_aoColumns.length == iLen )
				{
					if ( aoColumnsInit[i] === null )
					{
						aoColumnsInit[i] = {};
					}
					aoColumnsInit[i].bVisible = oInit.saved_aoColumns[i].bVisible;
				}

				_fnAddColumn( oSettings, anThs ? anThs[i] : null );
			}

			/* Add options from column definations */
			if ( typeof oInit.aoColumnDefs != 'undefined' )
			{
				/* Loop over the column defs array - loop in reverse so first instace has priority */
				for ( i=oInit.aoColumnDefs.length-1 ; i>=0 ; i-- )
				{
					/* Each column def can target multiple columns, as it is an array */
					var aTargets = oInit.aoColumnDefs[i].aTargets;
					if ( !$.isArray( aTargets ) )
					{
						_fnLog( oSettings, 1, 'aTargets must be an array of targets, not a '+(typeof aTargets) );
					}
					for ( j=0, jLen=aTargets.length ; j<jLen ; j++ )
					{
						if ( typeof aTargets[j] == 'number' && aTargets[j] >= 0 )
						{
							/* 0+ integer, left to right column counting. We add columns which are unknown
							 * automatically. Is this the right behaviour for this? We should at least
							 * log it in future. We cannot do this for the negative or class targets, only here.
							 */
							while( oSettings.aoColumns.length <= aTargets[j] )
							{
								_fnAddColumn( oSettings );
							}
							_fnColumnOptions( oSettings, aTargets[j], oInit.aoColumnDefs[i] );
						}
						else if ( typeof aTargets[j] == 'number' && aTargets[j] < 0 )
						{
							/* Negative integer, right to left column counting */
							_fnColumnOptions( oSettings, oSettings.aoColumns.length+aTargets[j],
								oInit.aoColumnDefs[i] );
						}
						else if ( typeof aTargets[j] == 'string' )
						{
							/* Class name matching on TH element */
							for ( k=0, kLen=oSettings.aoColumns.length ; k<kLen ; k++ )
							{
								if ( aTargets[j] == "_all" ||
								     $(oSettings.aoColumns[k].nTh).hasClass( aTargets[j] ) )
								{
									_fnColumnOptions( oSettings, k, oInit.aoColumnDefs[i] );
								}
							}
						}
					}
				}
			}

			/* Add options from column array - after the defs array so this has priority */
			if ( typeof aoColumnsInit != 'undefined' )
			{
				for ( i=0, iLen=aoColumnsInit.length ; i<iLen ; i++ )
				{
					_fnColumnOptions( oSettings, i, aoColumnsInit[i] );
				}
			}

			/*
			 * Sorting
			 * Check the aaSorting array
			 */
			for ( i=0, iLen=oSettings.aaSorting.length ; i<iLen ; i++ )
			{
				if ( oSettings.aaSorting[i][0] >= oSettings.aoColumns.length )
				{
					oSettings.aaSorting[i][0] = 0;
				}
				var oColumn = oSettings.aoColumns[ oSettings.aaSorting[i][0] ];

				/* Add a default sorting index */
				if ( typeof oSettings.aaSorting[i][2] == 'undefined' )
				{
					oSettings.aaSorting[i][2] = 0;
				}

				/* If aaSorting is not defined, then we use the first indicator in asSorting */
				if ( typeof oInit.aaSorting == "undefined" &&
						 typeof oSettings.saved_aaSorting == "undefined" )
				{
					oSettings.aaSorting[i][1] = oColumn.asSorting[0];
				}

				/* Set the current sorting index based on aoColumns.asSorting */
				for ( j=0, jLen=oColumn.asSorting.length ; j<jLen ; j++ )
				{
					if ( oSettings.aaSorting[i][1] == oColumn.asSorting[j] )
					{
						oSettings.aaSorting[i][2] = j;
						break;
					}
				}
			}

			/* Do a first pass on the sorting classes (allows any size changes to be taken into
			 * account, and also will apply sorting disabled classes if disabled
			 */
			_fnSortingClasses( oSettings );

			/*
			 * Final init
			 * Cache the header, body and footer as required, creating them if needed
			 */
			var thead = $('>thead', this);
			if ( thead.length === 0 )
			{
				thead = [ document.createElement( 'thead' ) ];
				this.appendChild( thead[0] );
			}
			oSettings.nTHead = thead[0];

			var tbody = $('>tbody', this);
			if ( tbody.length === 0 )
			{
				tbody = [ document.createElement( 'tbody' ) ];
				this.appendChild( tbody[0] );
			}
			oSettings.nTBody = tbody[0];

			var tfoot = $('>tfoot', this);
			if ( tfoot.length > 0 )
			{
				oSettings.nTFoot = tfoot[0];
				_fnDetectHeader( oSettings.aoFooter, oSettings.nTFoot );
			}

			/* Check if there is data passing into the constructor */
			if ( bUsePassedData )
			{
				for ( i=0 ; i<oInit.aaData.length ; i++ )
				{
					_fnAddData( oSettings, oInit.aaData[ i ] );
				}
			}
			else
			{
				/* Grab the data from the page */
				_fnGatherData( oSettings );
			}

			/* Copy the data index array */
			oSettings.aiDisplay = oSettings.aiDisplayMaster.slice();

			/* Initialisation complete - table can be drawn */
			oSettings.bInitialised = true;

			/* Check if we need to initialise the table (it might not have been handed off to the
			 * language processor)
			 */
			if ( bInitHandedOff === false )
			{
				_fnInitalise( oSettings );
			}
		});
	};
})(jQuery, window, document);

/* ]]> */
						</script><script type="text/javascript">
							/* <![CDATA[ */
/*! jQuery Timepicker Addon - v1.4.5 - 2014-05-26
* http://trentrichardson.com/examples/timepicker
* Copyright (c) 2014 Trent Richardson; Licensed MIT */
(function ($) {

    /*
	* Lets not redefine timepicker, Prevent "Uncaught RangeError: Maximum call stack size exceeded"
	*/
    $.ui.timepicker = $.ui.timepicker || {};
    if ($.ui.timepicker.version) {
        return;
    }

    /*
	* Extend jQueryUI, get it started with our version number
	*/
    $.extend($.ui, {
        timepicker: {
            version: "1.4.5"
        }
    });

    /*
	* Timepicker manager.
	* Use the singleton instance of this class, $.timepicker, to interact with the time picker.
	* Settings for (groups of) time pickers are maintained in an instance object,
	* allowing multiple different settings on the same page.
	*/
    var Timepicker = function () {
        this.regional = []; // Available regional settings, indexed by language code
        this.regional[''] = { // Default regional settings
            currentText: 'Now',
            closeText: 'Done',
            amNames: ['AM', 'A'],
            pmNames: ['PM', 'P'],
            timeFormat: 'HH:mm',
            timeSuffix: '',
            timeOnlyTitle: 'Choose Time',
            timeText: 'Time',
            hourText: 'Hour',
            minuteText: 'Minute',
            secondText: 'Second',
            millisecText: 'Millisecond',
            microsecText: 'Microsecond',
            timezoneText: 'Time Zone',
            isRTL: false
        };
        this._defaults = { // Global defaults for all the datetime picker instances
            showButtonPanel: true,
            timeOnly: false,
            timeOnlyShowDate: false,
            showHour: null,
            showMinute: null,
            showSecond: null,
            showMillisec: null,
            showMicrosec: null,
            showTimezone: null,
            showTime: true,
            stepHour: 1,
            stepMinute: 1,
            stepSecond: 1,
            stepMillisec: 1,
            stepMicrosec: 1,
            hour: 0,
            minute: 0,
            second: 0,
            millisec: 0,
            microsec: 0,
            timezone: null,
            hourMin: 0,
            minuteMin: 0,
            secondMin: 0,
            millisecMin: 0,
            microsecMin: 0,
            hourMax: 23,
            minuteMax: 59,
            secondMax: 59,
            millisecMax: 999,
            microsecMax: 999,
            minDateTime: null,
            maxDateTime: null,
            maxTime: null,
            minTime: null,
            onSelect: null,
            hourGrid: 0,
            minuteGrid: 0,
            secondGrid: 0,
            millisecGrid: 0,
            microsecGrid: 0,
            alwaysSetTime: true,
            separator: ' ',
            altFieldTimeOnly: true,
            altTimeFormat: null,
            altSeparator: null,
            altTimeSuffix: null,
            altRedirectFocus: true,
            pickerTimeFormat: null,
            pickerTimeSuffix: null,
            showTimepicker: true,
            timezoneList: null,
            addSliderAccess: false,
            sliderAccessArgs: null,
            controlType: 'slider',
            defaultValue: null,
            parse: 'strict'
        };
        $.extend(this._defaults, this.regional['']);
    };

    $.extend(Timepicker.prototype, {
        $input: null,
        $altInput: null,
        $timeObj: null,
        inst: null,
        hour_slider: null,
        minute_slider: null,
        second_slider: null,
        millisec_slider: null,
        microsec_slider: null,
        timezone_select: null,
        maxTime: null,
        minTime: null,
        hour: 0,
        minute: 0,
        second: 0,
        millisec: 0,
        microsec: 0,
        timezone: null,
        hourMinOriginal: null,
        minuteMinOriginal: null,
        secondMinOriginal: null,
        millisecMinOriginal: null,
        microsecMinOriginal: null,
        hourMaxOriginal: null,
        minuteMaxOriginal: null,
        secondMaxOriginal: null,
        millisecMaxOriginal: null,
        microsecMaxOriginal: null,
        ampm: '',
        formattedDate: '',
        formattedTime: '',
        formattedDateTime: '',
        timezoneList: null,
        units: ['hour', 'minute', 'second', 'millisec', 'microsec'],
        support: {},
        control: null,

        /*
		* Override the default settings for all instances of the time picker.
		* @param  {Object} settings  object - the new settings to use as defaults (anonymous object)
		* @return {Object} the manager object
		*/
        setDefaults: function (settings) {
            extendRemove(this._defaults, settings || {});
            return this;
        },

        /*
		* Create a new Timepicker instance
		*/
        _newInst: function ($input, opts) {
            var tp_inst = new Timepicker(),
				inlineSettings = {},
				fns = {},
				overrides, i;

            for (var attrName in this._defaults) {
                if (this._defaults.hasOwnProperty(attrName)) {
                    var attrValue = $input.attr('time:' + attrName);
                    if (attrValue) {
                        try {
                            inlineSettings[attrName] = eval(attrValue);
                        } catch (err) {
                            inlineSettings[attrName] = attrValue;
                        }
                    }
                }
            }

            overrides = {
                beforeShow: function (input, dp_inst) {
                    if ($.isFunction(tp_inst._defaults.evnts.beforeShow)) {
                        return tp_inst._defaults.evnts.beforeShow.call($input[0], input, dp_inst, tp_inst);
                    }
                },
                onChangeMonthYear: function (year, month, dp_inst) {
                    // Update the time as well : this prevents the time from disappearing from the $input field.
                    tp_inst._updateDateTime(dp_inst);
                    if ($.isFunction(tp_inst._defaults.evnts.onChangeMonthYear)) {
                        tp_inst._defaults.evnts.onChangeMonthYear.call($input[0], year, month, dp_inst, tp_inst);
                    }
                },
                onClose: function (dateText, dp_inst) {
                    if (tp_inst.timeDefined === true && $input.val() !== '') {
                        tp_inst._updateDateTime(dp_inst);
                    }
                    if ($.isFunction(tp_inst._defaults.evnts.onClose)) {
                        tp_inst._defaults.evnts.onClose.call($input[0], dateText, dp_inst, tp_inst);
                    }
                }
            };
            for (i in overrides) {
                if (overrides.hasOwnProperty(i)) {
                    fns[i] = opts[i] || null;
                }
            }

            tp_inst._defaults = $.extend({}, this._defaults, inlineSettings, opts, overrides, {
                evnts: fns,
                timepicker: tp_inst // add timepicker as a property of datepicker: $.datepicker._get(dp_inst, 'timepicker');
            });
            tp_inst.amNames = $.map(tp_inst._defaults.amNames, function (val) {
                return val.toUpperCase();
            });
            tp_inst.pmNames = $.map(tp_inst._defaults.pmNames, function (val) {
                return val.toUpperCase();
            });

            // detect which units are supported
            tp_inst.support = detectSupport(
					tp_inst._defaults.timeFormat +
					(tp_inst._defaults.pickerTimeFormat ? tp_inst._defaults.pickerTimeFormat : '') +
					(tp_inst._defaults.altTimeFormat ? tp_inst._defaults.altTimeFormat : ''));

            // controlType is string - key to our this._controls
            if (typeof (tp_inst._defaults.controlType) === 'string') {
                if (tp_inst._defaults.controlType === 'slider' && typeof ($.ui.slider) === 'undefined') {
                    tp_inst._defaults.controlType = 'select';
                }
                tp_inst.control = tp_inst._controls[tp_inst._defaults.controlType];
            }
                // controlType is an object and must implement create, options, value methods
            else {
                tp_inst.control = tp_inst._defaults.controlType;
            }

            // prep the timezone options
            var timezoneList = [-720, -660, -600, -570, -540, -480, -420, -360, -300, -270, -240, -210, -180, -120, -60,
					0, 60, 120, 180, 210, 240, 270, 300, 330, 345, 360, 390, 420, 480, 525, 540, 570, 600, 630, 660, 690, 720, 765, 780, 840];
            if (tp_inst._defaults.timezoneList !== null) {
                timezoneList = tp_inst._defaults.timezoneList;
            }
            var tzl = timezoneList.length, tzi = 0, tzv = null;
            if (tzl > 0 && typeof timezoneList[0] !== 'object') {
                for (; tzi < tzl; tzi++) {
                    tzv = timezoneList[tzi];
                    timezoneList[tzi] = { value: tzv, label: $.timepicker.timezoneOffsetString(tzv, tp_inst.support.iso8601) };
                }
            }
            tp_inst._defaults.timezoneList = timezoneList;

            // set the default units
            tp_inst.timezone = tp_inst._defaults.timezone !== null ? $.timepicker.timezoneOffsetNumber(tp_inst._defaults.timezone) :
							((new Date()).getTimezoneOffset() * -1);
            tp_inst.hour = tp_inst._defaults.hour < tp_inst._defaults.hourMin ? tp_inst._defaults.hourMin :
							tp_inst._defaults.hour > tp_inst._defaults.hourMax ? tp_inst._defaults.hourMax : tp_inst._defaults.hour;
            tp_inst.minute = tp_inst._defaults.minute < tp_inst._defaults.minuteMin ? tp_inst._defaults.minuteMin :
							tp_inst._defaults.minute > tp_inst._defaults.minuteMax ? tp_inst._defaults.minuteMax : tp_inst._defaults.minute;
            tp_inst.second = tp_inst._defaults.second < tp_inst._defaults.secondMin ? tp_inst._defaults.secondMin :
							tp_inst._defaults.second > tp_inst._defaults.secondMax ? tp_inst._defaults.secondMax : tp_inst._defaults.second;
            tp_inst.millisec = tp_inst._defaults.millisec < tp_inst._defaults.millisecMin ? tp_inst._defaults.millisecMin :
							tp_inst._defaults.millisec > tp_inst._defaults.millisecMax ? tp_inst._defaults.millisecMax : tp_inst._defaults.millisec;
            tp_inst.microsec = tp_inst._defaults.microsec < tp_inst._defaults.microsecMin ? tp_inst._defaults.microsecMin :
							tp_inst._defaults.microsec > tp_inst._defaults.microsecMax ? tp_inst._defaults.microsecMax : tp_inst._defaults.microsec;
            tp_inst.ampm = '';
            tp_inst.$input = $input;

            if (tp_inst._defaults.altField) {
                tp_inst.$altInput = $(tp_inst._defaults.altField);
                if (tp_inst._defaults.altRedirectFocus === true) {
                    tp_inst.$altInput.css({
                        cursor: 'pointer'
                    }).focus(function () {
                        $input.trigger("focus");
                    });
                }
            }

            if (tp_inst._defaults.minDate === 0 || tp_inst._defaults.minDateTime === 0) {
                tp_inst._defaults.minDate = new Date();
            }
            if (tp_inst._defaults.maxDate === 0 || tp_inst._defaults.maxDateTime === 0) {
                tp_inst._defaults.maxDate = new Date();
            }

            // datepicker needs minDate/maxDate, timepicker needs minDateTime/maxDateTime..
            if (tp_inst._defaults.minDate !== undefined && tp_inst._defaults.minDate instanceof Date) {
                tp_inst._defaults.minDateTime = new Date(tp_inst._defaults.minDate.getTime());
            }
            if (tp_inst._defaults.minDateTime !== undefined && tp_inst._defaults.minDateTime instanceof Date) {
                tp_inst._defaults.minDate = new Date(tp_inst._defaults.minDateTime.getTime());
            }
            if (tp_inst._defaults.maxDate !== undefined && tp_inst._defaults.maxDate instanceof Date) {
                tp_inst._defaults.maxDateTime = new Date(tp_inst._defaults.maxDate.getTime());
            }
            if (tp_inst._defaults.maxDateTime !== undefined && tp_inst._defaults.maxDateTime instanceof Date) {
                tp_inst._defaults.maxDate = new Date(tp_inst._defaults.maxDateTime.getTime());
            }
            tp_inst.$input.bind('focus', function () {
                tp_inst._onFocus();
            });

            return tp_inst;
        },

        /*
		* add our sliders to the calendar
		*/
        _addTimePicker: function (dp_inst) {
            var currDT = (this.$altInput && this._defaults.altFieldTimeOnly) ? this.$input.val() + ' ' + this.$altInput.val() : this.$input.val();

            this.timeDefined = this._parseTime(currDT);
            this._limitMinMaxDateTime(dp_inst, false);
            this._injectTimePicker();
        },

        /*
		* parse the time string from input value or _setTime
		*/
        _parseTime: function (timeString, withDate) {
            if (!this.inst) {
                this.inst = $.datepicker._getInst(this.$input[0]);
            }

            if (withDate || !this._defaults.timeOnly) {
                var dp_dateFormat = $.datepicker._get(this.inst, 'dateFormat');
                try {
                    var parseRes = parseDateTimeInternal(dp_dateFormat, this._defaults.timeFormat, timeString, $.datepicker._getFormatConfig(this.inst), this._defaults);
                    if (!parseRes.timeObj) {
                        return false;
                    }
                    $.extend(this, parseRes.timeObj);
                } catch (err) {
                    $.timepicker.log("Error parsing the date/time string: " + err +
									"\ndate/time string = " + timeString +
									"\ntimeFormat = " + this._defaults.timeFormat +
									"\ndateFormat = " + dp_dateFormat);
                    return false;
                }
                return true;
            } else {
                var timeObj = $.datepicker.parseTime(this._defaults.timeFormat, timeString, this._defaults);
                if (!timeObj) {
                    return false;
                }
                $.extend(this, timeObj);
                return true;
            }
        },

        /*
		* generate and inject html for timepicker into ui datepicker
		*/
        _injectTimePicker: function () {
            var $dp = this.inst.dpDiv,
				o = this.inst.settings,
				tp_inst = this,
				litem = '',
				uitem = '',
				show = null,
				max = {},
				gridSize = {},
				size = null,
				i = 0,
				l = 0;

            // Prevent displaying twice
            if ($dp.find("div.ui-timepicker-div").length === 0 && o.showTimepicker) {
                var noDisplay = ' style="display:none;"',
					html = '<div class="ui-timepicker-div' + (o.isRTL ? ' ui-timepicker-rtl' : '') + '"><dl>' + '<dt class="ui_tpicker_time_label"' + ((o.showTime) ? '' : noDisplay) + '>' + o.timeText + '</dt>' +
								'<dd class="ui_tpicker_time"' + ((o.showTime) ? '' : noDisplay) + '></dd>';

                // Create the markup
                for (i = 0, l = this.units.length; i < l; i++) {
                    litem = this.units[i];
                    uitem = litem.substr(0, 1).toUpperCase() + litem.substr(1);
                    show = o['show' + uitem] !== null ? o['show' + uitem] : this.support[litem];

                    // Added by Peter Medeiros:
                    // - Figure out what the hour/minute/second max should be based on the step values.
                    // - Example: if stepMinute is 15, then minMax is 45.
                    max[litem] = parseInt((o[litem + 'Max'] - ((o[litem + 'Max'] - o[litem + 'Min']) % o['step' + uitem])), 10);
                    gridSize[litem] = 0;

                    html += '<dt class="ui_tpicker_' + litem + '_label"' + (show ? '' : noDisplay) + '>' + o[litem + 'Text'] + '</dt>' +
								'<dd class="ui_tpicker_' + litem + '"><div class="ui_tpicker_' + litem + '_slider"' + (show ? '' : noDisplay) + '></div>';

                    if (show && o[litem + 'Grid'] > 0) {
                        html += '<div style="padding-left: 1px"><table class="ui-tpicker-grid-label"><tr>';

                        if (litem === 'hour') {
                            for (var h = o[litem + 'Min']; h <= max[litem]; h += parseInt(o[litem + 'Grid'], 10)) {
                                gridSize[litem]++;
                                var tmph = $.datepicker.formatTime(this.support.ampm ? 'hht' : 'HH', { hour: h }, o);
                                html += '<td data-for="' + litem + '">' + tmph + '</td>';
                            }
                        }
                        else {
                            for (var m = o[litem + 'Min']; m <= max[litem]; m += parseInt(o[litem + 'Grid'], 10)) {
                                gridSize[litem]++;
                                html += '<td data-for="' + litem + '">' + ((m < 10) ? '0' : '') + m + '</td>';
                            }
                        }

                        html += '</tr></table></div>';
                    }
                    html += '</dd>';
                }

                // Timezone
                var showTz = o.showTimezone !== null ? o.showTimezone : this.support.timezone;
                html += '<dt class="ui_tpicker_timezone_label"' + (showTz ? '' : noDisplay) + '>' + o.timezoneText + '</dt>';
                html += '<dd class="ui_tpicker_timezone" ' + (showTz ? '' : noDisplay) + '></dd>';

                // Create the elements from string
                html += '</dl></div>';
                var $tp = $(html);

                // if we only want time picker...
                if (o.timeOnly === true) {
                    $tp.prepend('<div class="ui-widget-header ui-helper-clearfix ui-corner-all">' + '<div class="ui-datepicker-title">' + o.timeOnlyTitle + '</div>' + '</div>');
                    $dp.find('.ui-datepicker-header, .ui-datepicker-calendar').hide();
                }

                // add sliders, adjust grids, add events
                for (i = 0, l = tp_inst.units.length; i < l; i++) {
                    litem = tp_inst.units[i];
                    uitem = litem.substr(0, 1).toUpperCase() + litem.substr(1);
                    show = o['show' + uitem] !== null ? o['show' + uitem] : this.support[litem];

                    // add the slider
                    tp_inst[litem + '_slider'] = tp_inst.control.create(tp_inst, $tp.find('.ui_tpicker_' + litem + '_slider'), litem, tp_inst[litem], o[litem + 'Min'], max[litem], o['step' + uitem]);

                    // adjust the grid and add click event
                    if (show && o[litem + 'Grid'] > 0) {
                        size = 100 * gridSize[litem] * o[litem + 'Grid'] / (max[litem] - o[litem + 'Min']);
                        $tp.find('.ui_tpicker_' + litem + ' table').css({
                            width: size + "%",
                            marginLeft: o.isRTL ? '0' : ((size / (-2 * gridSize[litem])) + "%"),
                            marginRight: o.isRTL ? ((size / (-2 * gridSize[litem])) + "%") : '0',
                            borderCollapse: 'collapse'
                        }).find("td").click(function (e) {
                            var $t = $(this),
                                h = $t.html(),
                                n = parseInt(h.replace(/[^0-9]/g), 10),
                                ap = h.replace(/[^apm]/ig),
                                f = $t.data('for'); // loses scope, so we use data-for

                            if (f === 'hour') {
                                if (ap.indexOf('p') !== -1 && n < 12) {
                                    n += 12;
                                }
                                else {
                                    if (ap.indexOf('a') !== -1 && n === 12) {
                                        n = 0;
                                    }
                                }
                            }

                            tp_inst.control.value(tp_inst, tp_inst[f + '_slider'], litem, n);

                            tp_inst._onTimeChange();
                            tp_inst._onSelectHandler();
                        }).css({
                            cursor: 'pointer',
                            width: (100 / gridSize[litem]) + '%',
                            textAlign: 'center',
                            overflow: 'hidden'
                        });
                    } // end if grid > 0
                } // end for loop

                // Add timezone options
                this.timezone_select = $tp.find('.ui_tpicker_timezone').append('<select></select>').find("select");
                $.fn.append.apply(this.timezone_select,
				$.map(o.timezoneList, function (val, idx) {
				    return $("<option />").val(typeof val === "object" ? val.value : val).text(typeof val === "object" ? val.label : val);
				}));
                if (typeof (this.timezone) !== "undefined" && this.timezone !== null && this.timezone !== "") {
                    var local_timezone = (new Date(this.inst.selectedYear, this.inst.selectedMonth, this.inst.selectedDay, 12)).getTimezoneOffset() * -1;
                    if (local_timezone === this.timezone) {
                        selectLocalTimezone(tp_inst);
                    } else {
                        this.timezone_select.val(this.timezone);
                    }
                } else {
                    if (typeof (this.hour) !== "undefined" && this.hour !== null && this.hour !== "") {
                        this.timezone_select.val(o.timezone);
                    } else {
                        selectLocalTimezone(tp_inst);
                    }
                }
                this.timezone_select.change(function () {
                    tp_inst._onTimeChange();
                    tp_inst._onSelectHandler();
                });
                // End timezone options

                // inject timepicker into datepicker
                var $buttonPanel = $dp.find('.ui-datepicker-buttonpane');
                if ($buttonPanel.length) {
                    $buttonPanel.before($tp);
                } else {
                    $dp.append($tp);
                }

                this.$timeObj = $tp.find('.ui_tpicker_time');

                if (this.inst !== null) {
                    var timeDefined = this.timeDefined;
                    this._onTimeChange();
                    this.timeDefined = timeDefined;
                }

                // slideAccess integration: http://trentrichardson.com/2011/11/11/jquery-ui-sliders-and-touch-accessibility/
                if (this._defaults.addSliderAccess) {
                    var sliderAccessArgs = this._defaults.sliderAccessArgs,
						rtl = this._defaults.isRTL;
                    sliderAccessArgs.isRTL = rtl;

                    setTimeout(function () { // fix for inline mode
                        if ($tp.find('.ui-slider-access').length === 0) {
                            $tp.find('.ui-slider:visible').sliderAccess(sliderAccessArgs);

                            // fix any grids since sliders are shorter
                            var sliderAccessWidth = $tp.find('.ui-slider-access:eq(0)').outerWidth(true);
                            if (sliderAccessWidth) {
                                $tp.find('table:visible').each(function () {
                                    var $g = $(this),
										oldWidth = $g.outerWidth(),
										oldMarginLeft = $g.css(rtl ? 'marginRight' : 'marginLeft').toString().replace('%', ''),
										newWidth = oldWidth - sliderAccessWidth,
										newMarginLeft = ((oldMarginLeft * newWidth) / oldWidth) + '%',
										css = { width: newWidth, marginRight: 0, marginLeft: 0 };
                                    css[rtl ? 'marginRight' : 'marginLeft'] = newMarginLeft;
                                    $g.css(css);
                                });
                            }
                        }
                    }, 10);
                }
                // end slideAccess integration

                tp_inst._limitMinMaxDateTime(this.inst, true);
            }
        },

        /*
		* This function tries to limit the ability to go outside the
		* min/max date range
		*/
        _limitMinMaxDateTime: function (dp_inst, adjustSliders) {
            var o = this._defaults,
				dp_date = new Date(dp_inst.selectedYear, dp_inst.selectedMonth, dp_inst.selectedDay);

            if (!this._defaults.showTimepicker) {
                return;
            } // No time so nothing to check here

            if ($.datepicker._get(dp_inst, 'minDateTime') !== null && $.datepicker._get(dp_inst, 'minDateTime') !== undefined && dp_date) {
                var minDateTime = $.datepicker._get(dp_inst, 'minDateTime'),
					minDateTimeDate = new Date(minDateTime.getFullYear(), minDateTime.getMonth(), minDateTime.getDate(), 0, 0, 0, 0);

                if (this.hourMinOriginal === null || this.minuteMinOriginal === null || this.secondMinOriginal === null || this.millisecMinOriginal === null || this.microsecMinOriginal === null) {
                    this.hourMinOriginal = o.hourMin;
                    this.minuteMinOriginal = o.minuteMin;
                    this.secondMinOriginal = o.secondMin;
                    this.millisecMinOriginal = o.millisecMin;
                    this.microsecMinOriginal = o.microsecMin;
                }

                if (dp_inst.settings.timeOnly || minDateTimeDate.getTime() === dp_date.getTime()) {
                    this._defaults.hourMin = minDateTime.getHours();
                    if (this.hour <= this._defaults.hourMin) {
                        this.hour = this._defaults.hourMin;
                        this._defaults.minuteMin = minDateTime.getMinutes();
                        if (this.minute <= this._defaults.minuteMin) {
                            this.minute = this._defaults.minuteMin;
                            this._defaults.secondMin = minDateTime.getSeconds();
                            if (this.second <= this._defaults.secondMin) {
                                this.second = this._defaults.secondMin;
                                this._defaults.millisecMin = minDateTime.getMilliseconds();
                                if (this.millisec <= this._defaults.millisecMin) {
                                    this.millisec = this._defaults.millisecMin;
                                    this._defaults.microsecMin = minDateTime.getMicroseconds();
                                } else {
                                    if (this.microsec < this._defaults.microsecMin) {
                                        this.microsec = this._defaults.microsecMin;
                                    }
                                    this._defaults.microsecMin = this.microsecMinOriginal;
                                }
                            } else {
                                this._defaults.millisecMin = this.millisecMinOriginal;
                                this._defaults.microsecMin = this.microsecMinOriginal;
                            }
                        } else {
                            this._defaults.secondMin = this.secondMinOriginal;
                            this._defaults.millisecMin = this.millisecMinOriginal;
                            this._defaults.microsecMin = this.microsecMinOriginal;
                        }
                    } else {
                        this._defaults.minuteMin = this.minuteMinOriginal;
                        this._defaults.secondMin = this.secondMinOriginal;
                        this._defaults.millisecMin = this.millisecMinOriginal;
                        this._defaults.microsecMin = this.microsecMinOriginal;
                    }
                } else {
                    this._defaults.hourMin = this.hourMinOriginal;
                    this._defaults.minuteMin = this.minuteMinOriginal;
                    this._defaults.secondMin = this.secondMinOriginal;
                    this._defaults.millisecMin = this.millisecMinOriginal;
                    this._defaults.microsecMin = this.microsecMinOriginal;
                }
            }

            if ($.datepicker._get(dp_inst, 'maxDateTime') !== null && $.datepicker._get(dp_inst, 'maxDateTime') !== undefined && dp_date) {
                var maxDateTime = $.datepicker._get(dp_inst, 'maxDateTime'),
					maxDateTimeDate = new Date(maxDateTime.getFullYear(), maxDateTime.getMonth(), maxDateTime.getDate(), 0, 0, 0, 0);

                if (this.hourMaxOriginal === null || this.minuteMaxOriginal === null || this.secondMaxOriginal === null || this.millisecMaxOriginal === null) {
                    this.hourMaxOriginal = o.hourMax;
                    this.minuteMaxOriginal = o.minuteMax;
                    this.secondMaxOriginal = o.secondMax;
                    this.millisecMaxOriginal = o.millisecMax;
                    this.microsecMaxOriginal = o.microsecMax;
                }

                if (dp_inst.settings.timeOnly || maxDateTimeDate.getTime() === dp_date.getTime()) {
                    this._defaults.hourMax = maxDateTime.getHours();
                    if (this.hour >= this._defaults.hourMax) {
                        this.hour = this._defaults.hourMax;
                        this._defaults.minuteMax = maxDateTime.getMinutes();
                        if (this.minute >= this._defaults.minuteMax) {
                            this.minute = this._defaults.minuteMax;
                            this._defaults.secondMax = maxDateTime.getSeconds();
                            if (this.second >= this._defaults.secondMax) {
                                this.second = this._defaults.secondMax;
                                this._defaults.millisecMax = maxDateTime.getMilliseconds();
                                if (this.millisec >= this._defaults.millisecMax) {
                                    this.millisec = this._defaults.millisecMax;
                                    this._defaults.microsecMax = maxDateTime.getMicroseconds();
                                } else {
                                    if (this.microsec > this._defaults.microsecMax) {
                                        this.microsec = this._defaults.microsecMax;
                                    }
                                    this._defaults.microsecMax = this.microsecMaxOriginal;
                                }
                            } else {
                                this._defaults.millisecMax = this.millisecMaxOriginal;
                                this._defaults.microsecMax = this.microsecMaxOriginal;
                            }
                        } else {
                            this._defaults.secondMax = this.secondMaxOriginal;
                            this._defaults.millisecMax = this.millisecMaxOriginal;
                            this._defaults.microsecMax = this.microsecMaxOriginal;
                        }
                    } else {
                        this._defaults.minuteMax = this.minuteMaxOriginal;
                        this._defaults.secondMax = this.secondMaxOriginal;
                        this._defaults.millisecMax = this.millisecMaxOriginal;
                        this._defaults.microsecMax = this.microsecMaxOriginal;
                    }
                } else {
                    this._defaults.hourMax = this.hourMaxOriginal;
                    this._defaults.minuteMax = this.minuteMaxOriginal;
                    this._defaults.secondMax = this.secondMaxOriginal;
                    this._defaults.millisecMax = this.millisecMaxOriginal;
                    this._defaults.microsecMax = this.microsecMaxOriginal;
                }
            }

            if (dp_inst.settings.minTime !== null) {
                var tempMinTime = new Date("01/01/1970 " + dp_inst.settings.minTime);
                if (this.hour < tempMinTime.getHours()) {
                    this.hour = this._defaults.hourMin = tempMinTime.getHours();
                    this.minute = this._defaults.minuteMin = tempMinTime.getMinutes();
                } else if (this.hour === tempMinTime.getHours() && this.minute < tempMinTime.getMinutes()) {
                    this.minute = this._defaults.minuteMin = tempMinTime.getMinutes();
                } else {
                    if (this._defaults.hourMin < tempMinTime.getHours()) {
                        this._defaults.hourMin = tempMinTime.getHours();
                        this._defaults.minuteMin = tempMinTime.getMinutes();
                    } else if (this._defaults.hourMin === tempMinTime.getHours() === this.hour && this._defaults.minuteMin < tempMinTime.getMinutes()) {
                        this._defaults.minuteMin = tempMinTime.getMinutes();
                    } else {
                        this._defaults.minuteMin = 0;
                    }
                }
            }

            if (dp_inst.settings.maxTime !== null) {
                var tempMaxTime = new Date("01/01/1970 " + dp_inst.settings.maxTime);
                if (this.hour > tempMaxTime.getHours()) {
                    this.hour = this._defaults.hourMax = tempMaxTime.getHours();
                    this.minute = this._defaults.minuteMax = tempMaxTime.getMinutes();
                } else if (this.hour === tempMaxTime.getHours() && this.minute > tempMaxTime.getMinutes()) {
                    this.minute = this._defaults.minuteMax = tempMaxTime.getMinutes();
                } else {
                    if (this._defaults.hourMax > tempMaxTime.getHours()) {
                        this._defaults.hourMax = tempMaxTime.getHours();
                        this._defaults.minuteMax = tempMaxTime.getMinutes();
                    } else if (this._defaults.hourMax === tempMaxTime.getHours() === this.hour && this._defaults.minuteMax > tempMaxTime.getMinutes()) {
                        this._defaults.minuteMax = tempMaxTime.getMinutes();
                    } else {
                        this._defaults.minuteMax = 59;
                    }
                }
            }

            if (adjustSliders !== undefined && adjustSliders === true) {
                var hourMax = parseInt((this._defaults.hourMax - ((this._defaults.hourMax - this._defaults.hourMin) % this._defaults.stepHour)), 10),
					minMax = parseInt((this._defaults.minuteMax - ((this._defaults.minuteMax - this._defaults.minuteMin) % this._defaults.stepMinute)), 10),
					secMax = parseInt((this._defaults.secondMax - ((this._defaults.secondMax - this._defaults.secondMin) % this._defaults.stepSecond)), 10),
					millisecMax = parseInt((this._defaults.millisecMax - ((this._defaults.millisecMax - this._defaults.millisecMin) % this._defaults.stepMillisec)), 10),
					microsecMax = parseInt((this._defaults.microsecMax - ((this._defaults.microsecMax - this._defaults.microsecMin) % this._defaults.stepMicrosec)), 10);

                if (this.hour_slider) {
                    this.control.options(this, this.hour_slider, 'hour', { min: this._defaults.hourMin, max: hourMax, step: this._defaults.stepHour });
                    this.control.value(this, this.hour_slider, 'hour', this.hour - (this.hour % this._defaults.stepHour));
                }
                if (this.minute_slider) {
                    this.control.options(this, this.minute_slider, 'minute', { min: this._defaults.minuteMin, max: minMax, step: this._defaults.stepMinute });
                    this.control.value(this, this.minute_slider, 'minute', this.minute - (this.minute % this._defaults.stepMinute));
                }
                if (this.second_slider) {
                    this.control.options(this, this.second_slider, 'second', { min: this._defaults.secondMin, max: secMax, step: this._defaults.stepSecond });
                    this.control.value(this, this.second_slider, 'second', this.second - (this.second % this._defaults.stepSecond));
                }
                if (this.millisec_slider) {
                    this.control.options(this, this.millisec_slider, 'millisec', { min: this._defaults.millisecMin, max: millisecMax, step: this._defaults.stepMillisec });
                    this.control.value(this, this.millisec_slider, 'millisec', this.millisec - (this.millisec % this._defaults.stepMillisec));
                }
                if (this.microsec_slider) {
                    this.control.options(this, this.microsec_slider, 'microsec', { min: this._defaults.microsecMin, max: microsecMax, step: this._defaults.stepMicrosec });
                    this.control.value(this, this.microsec_slider, 'microsec', this.microsec - (this.microsec % this._defaults.stepMicrosec));
                }
            }

        },

        /*
		* when a slider moves, set the internal time...
		* on time change is also called when the time is updated in the text field
		*/
        _onTimeChange: function () {
            if (!this._defaults.showTimepicker) {
                return;
            }
            var hour = (this.hour_slider) ? this.control.value(this, this.hour_slider, 'hour') : false,
				minute = (this.minute_slider) ? this.control.value(this, this.minute_slider, 'minute') : false,
				second = (this.second_slider) ? this.control.value(this, this.second_slider, 'second') : false,
				millisec = (this.millisec_slider) ? this.control.value(this, this.millisec_slider, 'millisec') : false,
				microsec = (this.microsec_slider) ? this.control.value(this, this.microsec_slider, 'microsec') : false,
				timezone = (this.timezone_select) ? this.timezone_select.val() : false,
				o = this._defaults,
				pickerTimeFormat = o.pickerTimeFormat || o.timeFormat,
				pickerTimeSuffix = o.pickerTimeSuffix || o.timeSuffix;

            if (typeof (hour) === 'object') {
                hour = false;
            }
            if (typeof (minute) === 'object') {
                minute = false;
            }
            if (typeof (second) === 'object') {
                second = false;
            }
            if (typeof (millisec) === 'object') {
                millisec = false;
            }
            if (typeof (microsec) === 'object') {
                microsec = false;
            }
            if (typeof (timezone) === 'object') {
                timezone = false;
            }

            if (hour !== false) {
                hour = parseInt(hour, 10);
            }
            if (minute !== false) {
                minute = parseInt(minute, 10);
            }
            if (second !== false) {
                second = parseInt(second, 10);
            }
            if (millisec !== false) {
                millisec = parseInt(millisec, 10);
            }
            if (microsec !== false) {
                microsec = parseInt(microsec, 10);
            }
            if (timezone !== false) {
                timezone = timezone.toString();
            }

            var ampm = o[hour < 12 ? 'amNames' : 'pmNames'][0];

            // If the update was done in the input field, the input field should not be updated.
            // If the update was done using the sliders, update the input field.
            var hasChanged = (
						hour !== parseInt(this.hour, 10) || // sliders should all be numeric
						minute !== parseInt(this.minute, 10) ||
						second !== parseInt(this.second, 10) ||
						millisec !== parseInt(this.millisec, 10) ||
						microsec !== parseInt(this.microsec, 10) ||
						(this.ampm.length > 0 && (hour < 12) !== ($.inArray(this.ampm.toUpperCase(), this.amNames) !== -1)) ||
						(this.timezone !== null && timezone !== this.timezone.toString()) // could be numeric or "EST" format, so use toString()
					);

            if (hasChanged) {

                if (hour !== false) {
                    this.hour = hour;
                }
                if (minute !== false) {
                    this.minute = minute;
                }
                if (second !== false) {
                    this.second = second;
                }
                if (millisec !== false) {
                    this.millisec = millisec;
                }
                if (microsec !== false) {
                    this.microsec = microsec;
                }
                if (timezone !== false) {
                    this.timezone = timezone;
                }

                if (!this.inst) {
                    this.inst = $.datepicker._getInst(this.$input[0]);
                }

                this._limitMinMaxDateTime(this.inst, true);
            }
            if (this.support.ampm) {
                this.ampm = ampm;
            }

            // Updates the time within the timepicker
            this.formattedTime = $.datepicker.formatTime(o.timeFormat, this, o);
            if (this.$timeObj) {
                if (pickerTimeFormat === o.timeFormat) {
                    this.$timeObj.text(this.formattedTime + pickerTimeSuffix);
                }
                else {
                    this.$timeObj.text($.datepicker.formatTime(pickerTimeFormat, this, o) + pickerTimeSuffix);
                }
            }

            this.timeDefined = true;
            if (hasChanged) {
                this._updateDateTime();
                //this.$input.focus(); // may automatically open the picker on setDate
            }
        },

        /*
		* call custom onSelect.
		* bind to sliders slidestop, and grid click.
		*/
        _onSelectHandler: function () {
            var onSelect = this._defaults.onSelect || this.inst.settings.onSelect;
            var inputEl = this.$input ? this.$input[0] : null;
            if (onSelect && inputEl) {
                onSelect.apply(inputEl, [this.formattedDateTime, this]);
            }
        },

        /*
		* update our input with the new date time..
		*/
        _updateDateTime: function (dp_inst) {
            dp_inst = this.inst || dp_inst;
            var dtTmp = (dp_inst.currentYear > 0 ?
							new Date(dp_inst.currentYear, dp_inst.currentMonth, dp_inst.currentDay) :
							new Date(dp_inst.selectedYear, dp_inst.selectedMonth, dp_inst.selectedDay)),
				dt = $.datepicker._daylightSavingAdjust(dtTmp),
				//dt = $.datepicker._daylightSavingAdjust(new Date(dp_inst.selectedYear, dp_inst.selectedMonth, dp_inst.selectedDay)),
				//dt = $.datepicker._daylightSavingAdjust(new Date(dp_inst.currentYear, dp_inst.currentMonth, dp_inst.currentDay)),
				dateFmt = $.datepicker._get(dp_inst, 'dateFormat'),
				formatCfg = $.datepicker._getFormatConfig(dp_inst),
				timeAvailable = dt !== null && this.timeDefined;
            this.formattedDate = $.datepicker.formatDate(dateFmt, (dt === null ? new Date() : dt), formatCfg);
            var formattedDateTime = this.formattedDate;

            // if a slider was changed but datepicker doesn't have a value yet, set it
            if (dp_inst.lastVal === "") {
                dp_inst.currentYear = dp_inst.selectedYear;
                dp_inst.currentMonth = dp_inst.selectedMonth;
                dp_inst.currentDay = dp_inst.selectedDay;
            }

            /*
			* remove following lines to force every changes in date picker to change the input value
			* Bug descriptions: when an input field has a default value, and click on the field to pop up the date picker.
			* If the user manually empty the value in the input field, the date picker will never change selected value.
			*/
            //if (dp_inst.lastVal !== undefined && (dp_inst.lastVal.length > 0 && this.$input.val().length === 0)) {
            //	return;
            //}

            if (this._defaults.timeOnly === true && this._defaults.timeOnlyShowDate === false) {
                formattedDateTime = this.formattedTime;
            } else if ((this._defaults.timeOnly !== true && (this._defaults.alwaysSetTime || timeAvailable)) || (this._defaults.timeOnly === true && this._defaults.timeOnlyShowDate === true)) {
                formattedDateTime += this._defaults.separator + this.formattedTime + this._defaults.timeSuffix;
            }

            this.formattedDateTime = formattedDateTime;

            if (!this._defaults.showTimepicker) {
                this.$input.val(this.formattedDate);
            } else if (this.$altInput && this._defaults.timeOnly === false && this._defaults.altFieldTimeOnly === true) {
                this.$altInput.val(this.formattedTime);
                this.$input.val(this.formattedDate);
            } else if (this.$altInput) {
                this.$input.val(formattedDateTime);
                var altFormattedDateTime = '',
					altSeparator = this._defaults.altSeparator !== null ? this._defaults.altSeparator : this._defaults.separator,
					altTimeSuffix = this._defaults.altTimeSuffix !== null ? this._defaults.altTimeSuffix : this._defaults.timeSuffix;

                if (!this._defaults.timeOnly) {
                    if (this._defaults.altFormat) {
                        altFormattedDateTime = $.datepicker.formatDate(this._defaults.altFormat, (dt === null ? new Date() : dt), formatCfg);
                    }
                    else {
                        altFormattedDateTime = this.formattedDate;
                    }

                    if (altFormattedDateTime) {
                        altFormattedDateTime += altSeparator;
                    }
                }

                if (this._defaults.altTimeFormat !== null) {
                    altFormattedDateTime += $.datepicker.formatTime(this._defaults.altTimeFormat, this, this._defaults) + altTimeSuffix;
                }
                else {
                    altFormattedDateTime += this.formattedTime + altTimeSuffix;
                }
                this.$altInput.val(altFormattedDateTime);
            } else {
                this.$input.val(formattedDateTime);
            }

            this.$input.trigger("change");
        },

        _onFocus: function () {
            if (!this.$input.val() && this._defaults.defaultValue) {
                this.$input.val(this._defaults.defaultValue);
                var inst = $.datepicker._getInst(this.$input.get(0)),
					tp_inst = $.datepicker._get(inst, 'timepicker');
                if (tp_inst) {
                    if (tp_inst._defaults.timeOnly && (inst.input.val() !== inst.lastVal)) {
                        try {
                            $.datepicker._updateDatepicker(inst);
                        } catch (err) {
                            $.timepicker.log(err);
                        }
                    }
                }
            }
        },

        /*
		* Small abstraction to control types
		* We can add more, just be sure to follow the pattern: create, options, value
		*/
        _controls: {
            // slider methods
            slider: {
                create: function (tp_inst, obj, unit, val, min, max, step) {
                    var rtl = tp_inst._defaults.isRTL; // if rtl go -60->0 instead of 0->60
                    return obj.prop('slide', null).slider({
                        orientation: "horizontal",
                        value: rtl ? val * -1 : val,
                        min: rtl ? max * -1 : min,
                        max: rtl ? min * -1 : max,
                        step: step,
                        slide: function (event, ui) {
                            tp_inst.control.value(tp_inst, $(this), unit, rtl ? ui.value * -1 : ui.value);
                            tp_inst._onTimeChange();
                        },
                        stop: function (event, ui) {
                            tp_inst._onSelectHandler();
                        }
                    });
                },
                options: function (tp_inst, obj, unit, opts, val) {
                    if (tp_inst._defaults.isRTL) {
                        if (typeof (opts) === 'string') {
                            if (opts === 'min' || opts === 'max') {
                                if (val !== undefined) {
                                    return obj.slider(opts, val * -1);
                                }
                                return Math.abs(obj.slider(opts));
                            }
                            return obj.slider(opts);
                        }
                        var min = opts.min,
							max = opts.max;
                        opts.min = opts.max = null;
                        if (min !== undefined) {
                            opts.max = min * -1;
                        }
                        if (max !== undefined) {
                            opts.min = max * -1;
                        }
                        return obj.slider(opts);
                    }
                    if (typeof (opts) === 'string' && val !== undefined) {
                        return obj.slider(opts, val);
                    }
                    return obj.slider(opts);
                },
                value: function (tp_inst, obj, unit, val) {
                    if (tp_inst._defaults.isRTL) {
                        if (val !== undefined) {
                            return obj.slider('value', val * -1);
                        }
                        return Math.abs(obj.slider('value'));
                    }
                    if (val !== undefined) {
                        return obj.slider('value', val);
                    }
                    return obj.slider('value');
                }
            },
            // select methods
            select: {
                create: function (tp_inst, obj, unit, val, min, max, step) {
                    var sel = '<select class="ui-timepicker-select" data-unit="' + unit + '" data-min="' + min + '" data-max="' + max + '" data-step="' + step + '">',
						format = tp_inst._defaults.pickerTimeFormat || tp_inst._defaults.timeFormat;

                    for (var i = min; i <= max; i += step) {
                        sel += '<option value="' + i + '"' + (i === val ? ' selected' : '') + '>';
                        if (unit === 'hour') {
                            sel += $.datepicker.formatTime($.trim(format.replace(/[^ht ]/ig, '')), { hour: i }, tp_inst._defaults);
                        }
                        else if (unit === 'millisec' || unit === 'microsec' || i >= 10) { sel += i; }
                        else { sel += '0' + i.toString(); }
                        sel += '</option>';
                    }
                    sel += '</select>';

                    obj.children('select').remove();

                    $(sel).appendTo(obj).change(function (e) {
                        tp_inst._onTimeChange();
                        tp_inst._onSelectHandler();
                    });

                    return obj;
                },
                options: function (tp_inst, obj, unit, opts, val) {
                    var o = {},
						$t = obj.children('select');
                    if (typeof (opts) === 'string') {
                        if (val === undefined) {
                            return $t.data(opts);
                        }
                        o[opts] = val;
                    }
                    else { o = opts; }
                    return tp_inst.control.create(tp_inst, obj, $t.data('unit'), $t.val(), o.min || $t.data('min'), o.max || $t.data('max'), o.step || $t.data('step'));
                },
                value: function (tp_inst, obj, unit, val) {
                    var $t = obj.children('select');
                    if (val !== undefined) {
                        return $t.val(val);
                    }
                    return $t.val();
                }
            }
        } // end _controls

    });

    $.fn.extend({
        /*
		* shorthand just to use timepicker.
		*/
        timepicker: function (o) {
            o = o || {};
            var tmp_args = Array.prototype.slice.call(arguments);

            if (typeof o === 'object') {
                tmp_args[0] = $.extend(o, {
                    timeOnly: true
                });
            }

            return $(this).each(function () {
                $.fn.datetimepicker.apply($(this), tmp_args);
            });
        },

        /*
		* extend timepicker to datepicker
		*/
        datetimepicker: function (o) {
            o = o || {};
            var tmp_args = arguments;

            if (typeof (o) === 'string') {
                if (o === 'getDate' || (o === 'option' && tmp_args.length === 2 && typeof (tmp_args[1]) === 'string')) {
                    return $.fn.datepicker.apply($(this[0]), tmp_args);
                } else {
                    return this.each(function () {
                        var $t = $(this);
                        $t.datepicker.apply($t, tmp_args);
                    });
                }
            } else {
                return this.each(function () {
                    var $t = $(this);
                    $t.datepicker($.timepicker._newInst($t, o)._defaults);
                });
            }
        }
    });

    /*
	* Public Utility to parse date and time
	*/
    $.datepicker.parseDateTime = function (dateFormat, timeFormat, dateTimeString, dateSettings, timeSettings) {
        var parseRes = parseDateTimeInternal(dateFormat, timeFormat, dateTimeString, dateSettings, timeSettings);
        if (parseRes.timeObj) {
            var t = parseRes.timeObj;
            parseRes.date.setHours(t.hour, t.minute, t.second, t.millisec);
            parseRes.date.setMicroseconds(t.microsec);
        }

        return parseRes.date;
    };

    /*
	* Public utility to parse time
	*/
    $.datepicker.parseTime = function (timeFormat, timeString, options) {
        var o = extendRemove(extendRemove({}, $.timepicker._defaults), options || {}),
			iso8601 = (timeFormat.replace(/\'.*?\'/g, '').indexOf('Z') !== -1);

        // Strict parse requires the timeString to match the timeFormat exactly
        var strictParse = function (f, s, o) {

            // pattern for standard and localized AM/PM markers
            var getPatternAmpm = function (amNames, pmNames) {
                var markers = [];
                if (amNames) {
                    $.merge(markers, amNames);
                }
                if (pmNames) {
                    $.merge(markers, pmNames);
                }
                markers = $.map(markers, function (val) {
                    return val.replace(/[.*+?|()\[\]{}\\]/g, '\\$&');
                });
                return '(' + markers.join('|') + ')?';
            };

            // figure out position of time elements.. cause js cant do named captures
            var getFormatPositions = function (timeFormat) {
                var finds = timeFormat.toLowerCase().match(/(h{1,2}|m{1,2}|s{1,2}|l{1}|c{1}|t{1,2}|z|'.*?')/g),
					orders = {
					    h: -1,
					    m: -1,
					    s: -1,
					    l: -1,
					    c: -1,
					    t: -1,
					    z: -1
					};

                if (finds) {
                    for (var i = 0; i < finds.length; i++) {
                        if (orders[finds[i].toString().charAt(0)] === -1) {
                            orders[finds[i].toString().charAt(0)] = i + 1;
                        }
                    }
                }
                return orders;
            };

            var regstr = '^' + f.toString()
					.replace(/([hH]{1,2}|mm?|ss?|[tT]{1,2}|[zZ]|[lc]|'.*?')/g, function (match) {
					    var ml = match.length;
					    switch (match.charAt(0).toLowerCase()) {
					        case 'h':
					            return ml === 1 ? '(\\d?\\d)' : '(\\d{' + ml + '})';
					        case 'm':
					            return ml === 1 ? '(\\d?\\d)' : '(\\d{' + ml + '})';
					        case 's':
					            return ml === 1 ? '(\\d?\\d)' : '(\\d{' + ml + '})';
					        case 'l':
					            return '(\\d?\\d?\\d)';
					        case 'c':
					            return '(\\d?\\d?\\d)';
					        case 'z':
					            return '(z|[-+]\\d\\d:?\\d\\d|\\S+)?';
					        case 't':
					            return getPatternAmpm(o.amNames, o.pmNames);
					        default:    // literal escaped in quotes
					            return '(' + match.replace(/\'/g, "").replace(/(\.|\$|\^|\\|\/|\(|\)|\[|\]|\?|\+|\*)/g, function (m) { return "\\" + m; }) + ')?';
					    }
					})
					.replace(/\s/g, '\\s?') +
					o.timeSuffix + '$',
				order = getFormatPositions(f),
				ampm = '',
				treg;

            treg = s.match(new RegExp(regstr, 'i'));

            var resTime = {
                hour: 0,
                minute: 0,
                second: 0,
                millisec: 0,
                microsec: 0
            };

            if (treg) {
                if (order.t !== -1) {
                    if (treg[order.t] === undefined || treg[order.t].length === 0) {
                        ampm = '';
                        resTime.ampm = '';
                    } else {
                        ampm = $.inArray(treg[order.t].toUpperCase(), o.amNames) !== -1 ? 'AM' : 'PM';
                        resTime.ampm = o[ampm === 'AM' ? 'amNames' : 'pmNames'][0];
                    }
                }

                if (order.h !== -1) {
                    if (ampm === 'AM' && treg[order.h] === '12') {
                        resTime.hour = 0; // 12am = 0 hour
                    } else {
                        if (ampm === 'PM' && treg[order.h] !== '12') {
                            resTime.hour = parseInt(treg[order.h], 10) + 12; // 12pm = 12 hour, any other pm = hour + 12
                        } else {
                            resTime.hour = Number(treg[order.h]);
                        }
                    }
                }

                if (order.m !== -1) {
                    resTime.minute = Number(treg[order.m]);
                }
                if (order.s !== -1) {
                    resTime.second = Number(treg[order.s]);
                }
                if (order.l !== -1) {
                    resTime.millisec = Number(treg[order.l]);
                }
                if (order.c !== -1) {
                    resTime.microsec = Number(treg[order.c]);
                }
                if (order.z !== -1 && treg[order.z] !== undefined) {
                    resTime.timezone = $.timepicker.timezoneOffsetNumber(treg[order.z]);
                }


                return resTime;
            }
            return false;
        };// end strictParse

        // First try JS Date, if that fails, use strictParse
        var looseParse = function (f, s, o) {
            try {
                var d = new Date('2012-01-01 ' + s);
                if (isNaN(d.getTime())) {
                    d = new Date('2012-01-01T' + s);
                    if (isNaN(d.getTime())) {
                        d = new Date('01/01/2012 ' + s);
                        if (isNaN(d.getTime())) {
                            throw "Unable to parse time with native Date: " + s;
                        }
                    }
                }

                return {
                    hour: d.getHours(),
                    minute: d.getMinutes(),
                    second: d.getSeconds(),
                    millisec: d.getMilliseconds(),
                    microsec: d.getMicroseconds(),
                    timezone: d.getTimezoneOffset() * -1
                };
            }
            catch (err) {
                try {
                    return strictParse(f, s, o);
                }
                catch (err2) {
                    $.timepicker.log("Unable to parse \ntimeString: " + s + "\ntimeFormat: " + f);
                }
            }
            return false;
        }; // end looseParse

        if (typeof o.parse === "function") {
            return o.parse(timeFormat, timeString, o);
        }
        if (o.parse === 'loose') {
            return looseParse(timeFormat, timeString, o);
        }
        return strictParse(timeFormat, timeString, o);
    };

    /**
	 * Public utility to format the time
	 * @param {string} format format of the time
	 * @param {Object} time Object not a Date for timezones
	 * @param {Object} [options] essentially the regional[].. amNames, pmNames, ampm
	 * @returns {string} the formatted time
	 */
    $.datepicker.formatTime = function (format, time, options) {
        options = options || {};
        options = $.extend({}, $.timepicker._defaults, options);
        time = $.extend({
            hour: 0,
            minute: 0,
            second: 0,
            millisec: 0,
            microsec: 0,
            timezone: null
        }, time);

        var tmptime = format,
			ampmName = options.amNames[0],
			hour = parseInt(time.hour, 10);

        if (hour > 11) {
            ampmName = options.pmNames[0];
        }

        tmptime = tmptime.replace(/(?:HH?|hh?|mm?|ss?|[tT]{1,2}|[zZ]|[lc]|'.*?')/g, function (match) {
            switch (match) {
                case 'HH':
                    return ('0' + hour).slice(-2);
                case 'H':
                    return hour;
                case 'hh':
                    return ('0' + convert24to12(hour)).slice(-2);
                case 'h':
                    return convert24to12(hour);
                case 'mm':
                    return ('0' + time.minute).slice(-2);
                case 'm':
                    return time.minute;
                case 'ss':
                    return ('0' + time.second).slice(-2);
                case 's':
                    return time.second;
                case 'l':
                    return ('00' + time.millisec).slice(-3);
                case 'c':
                    return ('00' + time.microsec).slice(-3);
                case 'z':
                    return $.timepicker.timezoneOffsetString(time.timezone === null ? options.timezone : time.timezone, false);
                case 'Z':
                    return $.timepicker.timezoneOffsetString(time.timezone === null ? options.timezone : time.timezone, true);
                case 'T':
                    return ampmName.charAt(0).toUpperCase();
                case 'TT':
                    return ampmName.toUpperCase();
                case 't':
                    return ampmName.charAt(0).toLowerCase();
                case 'tt':
                    return ampmName.toLowerCase();
                default:
                    return match.replace(/'/g, "");
            }
        });

        return tmptime;
    };

    /*
	* the bad hack :/ override datepicker so it doesn't close on select
	// inspired: http://stackoverflow.com/questions/1252512/jquery-datepicker-prevent-closing-picker-when-clicking-a-date/1762378#1762378
	*/
    $.datepicker._base_selectDate = $.datepicker._selectDate;
    $.datepicker._selectDate = function (id, dateStr) {
        var inst = this._getInst($(id)[0]),
			tp_inst = this._get(inst, 'timepicker');

        if (tp_inst && inst.settings.showTimepicker) {
            tp_inst._limitMinMaxDateTime(inst, true);
            inst.inline = inst.stay_open = true;
            //This way the onSelect handler called from calendarpicker get the full dateTime
            this._base_selectDate(id, dateStr);
            inst.inline = inst.stay_open = false;
            this._notifyChange(inst);
            this._updateDatepicker(inst);
        } else {
            this._base_selectDate(id, dateStr);
        }
    };

    /*
	* second bad hack :/ override datepicker so it triggers an event when changing the input field
	* and does not redraw the datepicker on every selectDate event
	*/
    $.datepicker._base_updateDatepicker = $.datepicker._updateDatepicker;
    $.datepicker._updateDatepicker = function (inst) {

        // don't popup the datepicker if there is another instance already opened
        var input = inst.input[0];
        if ($.datepicker._curInst && $.datepicker._curInst !== inst && $.datepicker._datepickerShowing && $.datepicker._lastInput !== input) {
            return;
        }

        if (typeof (inst.stay_open) !== 'boolean' || inst.stay_open === false) {

            this._base_updateDatepicker(inst);

            // Reload the time control when changing something in the input text field.
            var tp_inst = this._get(inst, 'timepicker');
            if (tp_inst) {
                tp_inst._addTimePicker(inst);
            }
        }
    };

    /*
	* third bad hack :/ override datepicker so it allows spaces and colon in the input field
	*/
    $.datepicker._base_doKeyPress = $.datepicker._doKeyPress;
    $.datepicker._doKeyPress = function (event) {
        var inst = $.datepicker._getInst(event.target),
			tp_inst = $.datepicker._get(inst, 'timepicker');

        if (tp_inst) {
            if ($.datepicker._get(inst, 'constrainInput')) {
                var ampm = tp_inst.support.ampm,
					tz = tp_inst._defaults.showTimezone !== null ? tp_inst._defaults.showTimezone : tp_inst.support.timezone,
					dateChars = $.datepicker._possibleChars($.datepicker._get(inst, 'dateFormat')),
					datetimeChars = tp_inst._defaults.timeFormat.toString()
											.replace(/[hms]/g, '')
											.replace(/TT/g, ampm ? 'APM' : '')
											.replace(/Tt/g, ampm ? 'AaPpMm' : '')
											.replace(/tT/g, ampm ? 'AaPpMm' : '')
											.replace(/T/g, ampm ? 'AP' : '')
											.replace(/tt/g, ampm ? 'apm' : '')
											.replace(/t/g, ampm ? 'ap' : '') +
											" " + tp_inst._defaults.separator +
											tp_inst._defaults.timeSuffix +
											(tz ? tp_inst._defaults.timezoneList.join('') : '') +
											(tp_inst._defaults.amNames.join('')) + (tp_inst._defaults.pmNames.join('')) +
											dateChars,
					chr = String.fromCharCode(event.charCode === undefined ? event.keyCode : event.charCode);
                return event.ctrlKey || (chr < ' ' || !dateChars || datetimeChars.indexOf(chr) > -1);
            }
        }

        return $.datepicker._base_doKeyPress(event);
    };

    /*
	* Fourth bad hack :/ override _updateAlternate function used in inline mode to init altField
	* Update any alternate field to synchronise with the main field.
	*/
    $.datepicker._base_updateAlternate = $.datepicker._updateAlternate;
    $.datepicker._updateAlternate = function (inst) {
        var tp_inst = this._get(inst, 'timepicker');
        if (tp_inst) {
            var altField = tp_inst._defaults.altField;
            if (altField) { // update alternate field too
                var altFormat = tp_inst._defaults.altFormat || tp_inst._defaults.dateFormat,
					date = this._getDate(inst),
					formatCfg = $.datepicker._getFormatConfig(inst),
					altFormattedDateTime = '',
					altSeparator = tp_inst._defaults.altSeparator ? tp_inst._defaults.altSeparator : tp_inst._defaults.separator,
					altTimeSuffix = tp_inst._defaults.altTimeSuffix ? tp_inst._defaults.altTimeSuffix : tp_inst._defaults.timeSuffix,
					altTimeFormat = tp_inst._defaults.altTimeFormat !== null ? tp_inst._defaults.altTimeFormat : tp_inst._defaults.timeFormat;

                altFormattedDateTime += $.datepicker.formatTime(altTimeFormat, tp_inst, tp_inst._defaults) + altTimeSuffix;
                if (!tp_inst._defaults.timeOnly && !tp_inst._defaults.altFieldTimeOnly && date !== null) {
                    if (tp_inst._defaults.altFormat) {
                        altFormattedDateTime = $.datepicker.formatDate(tp_inst._defaults.altFormat, date, formatCfg) + altSeparator + altFormattedDateTime;
                    }
                    else {
                        altFormattedDateTime = tp_inst.formattedDate + altSeparator + altFormattedDateTime;
                    }
                }
                $(altField).val(inst.input.val() ? altFormattedDateTime : "");
            }
        }
        else {
            $.datepicker._base_updateAlternate(inst);
        }
    };

    /*
	* Override key up event to sync manual input changes.
	*/
    $.datepicker._base_doKeyUp = $.datepicker._doKeyUp;
    $.datepicker._doKeyUp = function (event) {
        var inst = $.datepicker._getInst(event.target),
			tp_inst = $.datepicker._get(inst, 'timepicker');

        if (tp_inst) {
            if (tp_inst._defaults.timeOnly && (inst.input.val() !== inst.lastVal)) {
                try {
                    $.datepicker._updateDatepicker(inst);
                } catch (err) {
                    $.timepicker.log(err);
                }
            }
        }

        return $.datepicker._base_doKeyUp(event);
    };

    /*
	* override "Today" button to also grab the time.
	*/
    $.datepicker._base_gotoToday = $.datepicker._gotoToday;
    $.datepicker._gotoToday = function (id) {
        var inst = this._getInst($(id)[0]),
			$dp = inst.dpDiv;
        this._base_gotoToday(id);
        var tp_inst = this._get(inst, 'timepicker');
        selectLocalTimezone(tp_inst);
        var now = new Date();
        this._setTime(inst, now);
        $('.ui-datepicker-today', $dp).click();
    };

    /*
	* Disable & enable the Time in the datetimepicker
	*/
    $.datepicker._disableTimepickerDatepicker = function (target) {
        var inst = this._getInst(target);
        if (!inst) {
            return;
        }

        var tp_inst = this._get(inst, 'timepicker');
        $(target).datepicker('getDate'); // Init selected[Year|Month|Day]
        if (tp_inst) {
            inst.settings.showTimepicker = false;
            tp_inst._defaults.showTimepicker = false;
            tp_inst._updateDateTime(inst);
        }
    };

    $.datepicker._enableTimepickerDatepicker = function (target) {
        var inst = this._getInst(target);
        if (!inst) {
            return;
        }

        var tp_inst = this._get(inst, 'timepicker');
        $(target).datepicker('getDate'); // Init selected[Year|Month|Day]
        if (tp_inst) {
            inst.settings.showTimepicker = true;
            tp_inst._defaults.showTimepicker = true;
            tp_inst._addTimePicker(inst); // Could be disabled on page load
            tp_inst._updateDateTime(inst);
        }
    };

    /*
	* Create our own set time function
	*/
    $.datepicker._setTime = function (inst, date) {
        var tp_inst = this._get(inst, 'timepicker');
        if (tp_inst) {
            var defaults = tp_inst._defaults;

            // calling _setTime with no date sets time to defaults
            tp_inst.hour = date ? date.getHours() : defaults.hour;
            tp_inst.minute = date ? date.getMinutes() : defaults.minute;
            tp_inst.second = date ? date.getSeconds() : defaults.second;
            tp_inst.millisec = date ? date.getMilliseconds() : defaults.millisec;
            tp_inst.microsec = date ? date.getMicroseconds() : defaults.microsec;

            //check if within min/max times..
            tp_inst._limitMinMaxDateTime(inst, true);

            tp_inst._onTimeChange();
            tp_inst._updateDateTime(inst);
        }
    };

    /*
	* Create new public method to set only time, callable as $().datepicker('setTime', date)
	*/
    $.datepicker._setTimeDatepicker = function (target, date, withDate) {
        var inst = this._getInst(target);
        if (!inst) {
            return;
        }

        var tp_inst = this._get(inst, 'timepicker');

        if (tp_inst) {
            this._setDateFromField(inst);
            var tp_date;
            if (date) {
                if (typeof date === "string") {
                    tp_inst._parseTime(date, withDate);
                    tp_date = new Date();
                    tp_date.setHours(tp_inst.hour, tp_inst.minute, tp_inst.second, tp_inst.millisec);
                    tp_date.setMicroseconds(tp_inst.microsec);
                } else {
                    tp_date = new Date(date.getTime());
                    tp_date.setMicroseconds(date.getMicroseconds());
                }
                if (tp_date.toString() === 'Invalid Date') {
                    tp_date = undefined;
                }
                this._setTime(inst, tp_date);
            }
        }

    };

    /*
	* override setDate() to allow setting time too within Date object
	*/
    $.datepicker._base_setDateDatepicker = $.datepicker._setDateDatepicker;
    $.datepicker._setDateDatepicker = function (target, _date) {
        var inst = this._getInst(target);
        var date = _date;
        if (!inst) {
            return;
        }

        if (typeof (_date) === 'string') {
            date = new Date(_date);
            if (!date.getTime()) {
                this._base_setDateDatepicker.apply(this, arguments);
                date = $(target).datepicker('getDate');
            }
        }

        var tp_inst = this._get(inst, 'timepicker');
        var tp_date;
        if (date instanceof Date) {
            tp_date = new Date(date.getTime());
            tp_date.setMicroseconds(date.getMicroseconds());
        } else {
            tp_date = date;
        }

        // This is important if you are using the timezone option, javascript's Date
        // object will only return the timezone offset for the current locale, so we
        // adjust it accordingly.  If not using timezone option this won't matter..
        // If a timezone is different in tp, keep the timezone as is
        if (tp_inst && tp_date) {
            // look out for DST if tz wasn't specified
            if (!tp_inst.support.timezone && tp_inst._defaults.timezone === null) {
                tp_inst.timezone = tp_date.getTimezoneOffset() * -1;
            }
            date = $.timepicker.timezoneAdjust(date, tp_inst.timezone);
            tp_date = $.timepicker.timezoneAdjust(tp_date, tp_inst.timezone);
        }

        this._updateDatepicker(inst);
        this._base_setDateDatepicker.apply(this, arguments);
        this._setTimeDatepicker(target, tp_date, true);
    };

    /*
	* override getDate() to allow getting time too within Date object
	*/
    $.datepicker._base_getDateDatepicker = $.datepicker._getDateDatepicker;
    $.datepicker._getDateDatepicker = function (target, noDefault) {
        var inst = this._getInst(target);
        if (!inst) {
            return;
        }

        var tp_inst = this._get(inst, 'timepicker');

        if (tp_inst) {
            // if it hasn't yet been defined, grab from field
            if (inst.lastVal === undefined) {
                this._setDateFromField(inst, noDefault);
            }

            var date = this._getDate(inst);
            if (date && tp_inst._parseTime($(target).val(), tp_inst.timeOnly)) {
                date.setHours(tp_inst.hour, tp_inst.minute, tp_inst.second, tp_inst.millisec);
                date.setMicroseconds(tp_inst.microsec);

                // This is important if you are using the timezone option, javascript's Date
                // object will only return the timezone offset for the current locale, so we
                // adjust it accordingly.  If not using timezone option this won't matter..
                if (tp_inst.timezone != null) {
                    // look out for DST if tz wasn't specified
                    if (!tp_inst.support.timezone && tp_inst._defaults.timezone === null) {
                        tp_inst.timezone = date.getTimezoneOffset() * -1;
                    }
                    date = $.timepicker.timezoneAdjust(date, tp_inst.timezone);
                }
            }
            return date;
        }
        return this._base_getDateDatepicker(target, noDefault);
    };

    /*
	* override parseDate() because UI 1.8.14 throws an error about "Extra characters"
	* An option in datapicker to ignore extra format characters would be nicer.
	*/
    $.datepicker._base_parseDate = $.datepicker.parseDate;
    $.datepicker.parseDate = function (format, value, settings) {
        var date;
        try {
            date = this._base_parseDate(format, value, settings);
        } catch (err) {
            // Hack!  The error message ends with a colon, a space, and
            // the "extra" characters.  We rely on that instead of
            // attempting to perfectly reproduce the parsing algorithm.
            if (err.indexOf(":") >= 0) {
                date = this._base_parseDate(format, value.substring(0, value.length - (err.length - err.indexOf(':') - 2)), settings);
                $.timepicker.log("Error parsing the date string: " + err + "\ndate string = " + value + "\ndate format = " + format);
            } else {
                throw err;
            }
        }
        return date;
    };

    /*
	* override formatDate to set date with time to the input
	*/
    $.datepicker._base_formatDate = $.datepicker._formatDate;
    $.datepicker._formatDate = function (inst, day, month, year) {
        var tp_inst = this._get(inst, 'timepicker');
        if (tp_inst) {
            tp_inst._updateDateTime(inst);
            return tp_inst.$input.val();
        }
        return this._base_formatDate(inst);
    };

    /*
	* override options setter to add time to maxDate(Time) and minDate(Time). MaxDate
	*/
    $.datepicker._base_optionDatepicker = $.datepicker._optionDatepicker;
    $.datepicker._optionDatepicker = function (target, name, value) {
        var inst = this._getInst(target),
			name_clone;
        if (!inst) {
            return null;
        }

        var tp_inst = this._get(inst, 'timepicker');
        if (tp_inst) {
            var min = null,
				max = null,
				onselect = null,
				overrides = tp_inst._defaults.evnts,
				fns = {},
				prop;
            if (typeof name === 'string') { // if min/max was set with the string
                if (name === 'minDate' || name === 'minDateTime') {
                    min = value;
                } else if (name === 'maxDate' || name === 'maxDateTime') {
                    max = value;
                } else if (name === 'onSelect') {
                    onselect = value;
                } else if (overrides.hasOwnProperty(name)) {
                    if (typeof (value) === 'undefined') {
                        return overrides[name];
                    }
                    fns[name] = value;
                    name_clone = {}; //empty results in exiting function after overrides updated
                }
            } else if (typeof name === 'object') { //if min/max was set with the JSON
                if (name.minDate) {
                    min = name.minDate;
                } else if (name.minDateTime) {
                    min = name.minDateTime;
                } else if (name.maxDate) {
                    max = name.maxDate;
                } else if (name.maxDateTime) {
                    max = name.maxDateTime;
                }
                for (prop in overrides) {
                    if (overrides.hasOwnProperty(prop) && name[prop]) {
                        fns[prop] = name[prop];
                    }
                }
            }
            for (prop in fns) {
                if (fns.hasOwnProperty(prop)) {
                    overrides[prop] = fns[prop];
                    if (!name_clone) { name_clone = $.extend({}, name); }
                    delete name_clone[prop];
                }
            }
            if (name_clone && isEmptyObject(name_clone)) { return; }
            if (min) { //if min was set
                if (min === 0) {
                    min = new Date();
                } else {
                    min = new Date(min);
                }
                tp_inst._defaults.minDate = min;
                tp_inst._defaults.minDateTime = min;
            } else if (max) { //if max was set
                if (max === 0) {
                    max = new Date();
                } else {
                    max = new Date(max);
                }
                tp_inst._defaults.maxDate = max;
                tp_inst._defaults.maxDateTime = max;
            } else if (onselect) {
                tp_inst._defaults.onSelect = onselect;
            }
        }
        if (value === undefined) {
            return this._base_optionDatepicker.call($.datepicker, target, name);
        }
        return this._base_optionDatepicker.call($.datepicker, target, name_clone || name, value);
    };

    /*
	* jQuery isEmptyObject does not check hasOwnProperty - if someone has added to the object prototype,
	* it will return false for all objects
	*/
    var isEmptyObject = function (obj) {
        var prop;
        for (prop in obj) {
            if (obj.hasOwnProperty(prop)) {
                return false;
            }
        }
        return true;
    };

    /*
	* jQuery extend now ignores nulls!
	*/
    var extendRemove = function (target, props) {
        $.extend(target, props);
        for (var name in props) {
            if (props[name] === null || props[name] === undefined) {
                target[name] = props[name];
            }
        }
        return target;
    };

    /*
	* Determine by the time format which units are supported
	* Returns an object of booleans for each unit
	*/
    var detectSupport = function (timeFormat) {
        var tf = timeFormat.replace(/'.*?'/g, '').toLowerCase(), // removes literals
			isIn = function (f, t) { // does the format contain the token?
			    return f.indexOf(t) !== -1 ? true : false;
			};
        return {
            hour: isIn(tf, 'h'),
            minute: isIn(tf, 'm'),
            second: isIn(tf, 's'),
            millisec: isIn(tf, 'l'),
            microsec: isIn(tf, 'c'),
            timezone: isIn(tf, 'z'),
            ampm: isIn(tf, 't') && isIn(timeFormat, 'h'),
            iso8601: isIn(timeFormat, 'Z')
        };
    };

    /*
	* Converts 24 hour format into 12 hour
	* Returns 12 hour without leading 0
	*/
    var convert24to12 = function (hour) {
        hour %= 12;

        if (hour === 0) {
            hour = 12;
        }

        return String(hour);
    };

    var computeEffectiveSetting = function (settings, property) {
        return settings && settings[property] ? settings[property] : $.timepicker._defaults[property];
    };

    /*
	* Splits datetime string into date and time substrings.
	* Throws exception when date can't be parsed
	* Returns {dateString: dateString, timeString: timeString}
	*/
    var splitDateTime = function (dateTimeString, timeSettings) {
        // The idea is to get the number separator occurrences in datetime and the time format requested (since time has
        // fewer unknowns, mostly numbers and am/pm). We will use the time pattern to split.
        var separator = computeEffectiveSetting(timeSettings, 'separator'),
			format = computeEffectiveSetting(timeSettings, 'timeFormat'),
			timeParts = format.split(separator), // how many occurrences of separator may be in our format?
			timePartsLen = timeParts.length,
			allParts = dateTimeString.split(separator),
			allPartsLen = allParts.length;

        if (allPartsLen > 1) {
            return {
                dateString: allParts.splice(0, allPartsLen - timePartsLen).join(separator),
                timeString: allParts.splice(0, timePartsLen).join(separator)
            };
        }

        return {
            dateString: dateTimeString,
            timeString: ''
        };
    };

    /*
	* Internal function to parse datetime interval
	* Returns: {date: Date, timeObj: Object}, where
	*   date - parsed date without time (type Date)
	*   timeObj = {hour: , minute: , second: , millisec: , microsec: } - parsed time. Optional
	*/
    var parseDateTimeInternal = function (dateFormat, timeFormat, dateTimeString, dateSettings, timeSettings) {
        var date,
			parts,
			parsedTime;

        parts = splitDateTime(dateTimeString, timeSettings);
        date = $.datepicker._base_parseDate(dateFormat, parts.dateString, dateSettings);

        if (parts.timeString === '') {
            return {
                date: date
            };
        }

        parsedTime = $.datepicker.parseTime(timeFormat, parts.timeString, timeSettings);

        if (!parsedTime) {
            throw 'Wrong time format';
        }

        return {
            date: date,
            timeObj: parsedTime
        };
    };

    /*
	* Internal function to set timezone_select to the local timezone
	*/
    var selectLocalTimezone = function (tp_inst, date) {
        if (tp_inst && tp_inst.timezone_select) {
            var now = date || new Date();
            tp_inst.timezone_select.val(-now.getTimezoneOffset());
        }
    };

    /*
	* Create a Singleton Instance
	*/
    $.timepicker = new Timepicker();

    /**
	 * Get the timezone offset as string from a date object (eg '+0530' for UTC+5.5)
	 * @param {number} tzMinutes if not a number, less than -720 (-1200), or greater than 840 (+1400) this value is returned
	 * @param {boolean} iso8601 if true formats in accordance to iso8601 "+12:45"
	 * @return {string}
	 */
    $.timepicker.timezoneOffsetString = function (tzMinutes, iso8601) {
        if (isNaN(tzMinutes) || tzMinutes > 840 || tzMinutes < -720) {
            return tzMinutes;
        }

        var off = tzMinutes,
			minutes = off % 60,
			hours = (off - minutes) / 60,
			iso = iso8601 ? ':' : '',
			tz = (off >= 0 ? '+' : '-') + ('0' + Math.abs(hours)).slice(-2) + iso + ('0' + Math.abs(minutes)).slice(-2);

        if (tz === '+00:00') {
            return 'Z';
        }
        return tz;
    };

    /**
	 * Get the number in minutes that represents a timezone string
	 * @param  {string} tzString formatted like "+0500", "-1245", "Z"
	 * @return {number} the offset minutes or the original string if it doesn't match expectations
	 */
    $.timepicker.timezoneOffsetNumber = function (tzString) {
        var normalized = tzString.toString().replace(':', ''); // excuse any iso8601, end up with "+1245"

        if (normalized.toUpperCase() === 'Z') { // if iso8601 with Z, its 0 minute offset
            return 0;
        }

        if (!/^(\-|\+)\d{4}$/.test(normalized)) { // possibly a user defined tz, so just give it back
            return tzString;
        }

        return ((normalized.substr(0, 1) === '-' ? -1 : 1) * // plus or minus
					((parseInt(normalized.substr(1, 2), 10) * 60) + // hours (converted to minutes)
					parseInt(normalized.substr(3, 2), 10))); // minutes
    };

    /**
	 * No way to set timezone in js Date, so we must adjust the minutes to compensate. (think setDate, getDate)
	 * @param  {Date} date
	 * @param  {string} toTimezone formatted like "+0500", "-1245"
	 * @return {Date}
	 */
    $.timepicker.timezoneAdjust = function (date, toTimezone) {
        var toTz = $.timepicker.timezoneOffsetNumber(toTimezone);
        if (!isNaN(toTz)) {
            date.setMinutes(date.getMinutes() + -date.getTimezoneOffset() - toTz);
        }
        return date;
    };

    /**
	 * Calls `timepicker()` on the `startTime` and `endTime` elements, and configures them to
	 * enforce date range limits.
	 * n.b. The input value must be correctly formatted (reformatting is not supported)
	 * @param  {Element} startTime
	 * @param  {Element} endTime
	 * @param  {Object} options Options for the timepicker() call
	 * @return {jQuery}
	 */
    $.timepicker.timeRange = function (startTime, endTime, options) {
        return $.timepicker.handleRange('timepicker', startTime, endTime, options);
    };

    /**
	 * Calls `datetimepicker` on the `startTime` and `endTime` elements, and configures them to
	 * enforce date range limits.
	 * @param  {Element} startTime
	 * @param  {Element} endTime
	 * @param  {Object} options Options for the `timepicker()` call. Also supports `reformat`,
	 *   a boolean value that can be used to reformat the input values to the `dateFormat`.
	 * @param  {string} method Can be used to specify the type of picker to be added
	 * @return {jQuery}
	 */
    $.timepicker.datetimeRange = function (startTime, endTime, options) {
        $.timepicker.handleRange('datetimepicker', startTime, endTime, options);
    };

    /**
	 * Calls `datepicker` on the `startTime` and `endTime` elements, and configures them to
	 * enforce date range limits.
	 * @param  {Element} startTime
	 * @param  {Element} endTime
	 * @param  {Object} options Options for the `timepicker()` call. Also supports `reformat`,
	 *   a boolean value that can be used to reformat the input values to the `dateFormat`.
	 * @return {jQuery}
	 */
    $.timepicker.dateRange = function (startTime, endTime, options) {
        $.timepicker.handleRange('datepicker', startTime, endTime, options);
    };

    /**
	 * Calls `method` on the `startTime` and `endTime` elements, and configures them to
	 * enforce date range limits.
	 * @param  {string} method Can be used to specify the type of picker to be added
	 * @param  {Element} startTime
	 * @param  {Element} endTime
	 * @param  {Object} options Options for the `timepicker()` call. Also supports `reformat`,
	 *   a boolean value that can be used to reformat the input values to the `dateFormat`.
	 * @return {jQuery}
	 */
    $.timepicker.handleRange = function (method, startTime, endTime, options) {
        options = $.extend({}, {
            minInterval: 0, // min allowed interval in milliseconds
            maxInterval: 0, // max allowed interval in milliseconds
            start: {},      // options for start picker
            end: {}         // options for end picker
        }, options);

        // for the mean time this fixes an issue with calling getDate with timepicker()
        var timeOnly = false;
        if (method === 'timepicker') {
            timeOnly = true;
            method = 'datetimepicker';
        }

        function checkDates(changed, other) {
            var startdt = startTime[method]('getDate'),
				enddt = endTime[method]('getDate'),
				changeddt = changed[method]('getDate');

            if (startdt !== null) {
                var minDate = new Date(startdt.getTime()),
					maxDate = new Date(startdt.getTime());

                minDate.setMilliseconds(minDate.getMilliseconds() + options.minInterval);
                maxDate.setMilliseconds(maxDate.getMilliseconds() + options.maxInterval);

                if (options.minInterval > 0 && minDate > enddt) { // minInterval check
                    endTime[method]('setDate', minDate);
                }
                else if (options.maxInterval > 0 && maxDate < enddt) { // max interval check
                    endTime[method]('setDate', maxDate);
                }
                else if (startdt > enddt) {
                    other[method]('setDate', changeddt);
                }
            }
        }

        function selected(changed, other, option) {
            if (!changed.val()) {
                return;
            }
            var date = changed[method].call(changed, 'getDate');
            if (date !== null && options.minInterval > 0) {
                if (option === 'minDate') {
                    date.setMilliseconds(date.getMilliseconds() + options.minInterval);
                }
                if (option === 'maxDate') {
                    date.setMilliseconds(date.getMilliseconds() - options.minInterval);
                }
            }
            if (date.getTime) {
                other[method].call(other, 'option', option, date);
            }
        }

        $.fn[method].call(startTime, $.extend({
            timeOnly: timeOnly,
            onClose: function (dateText, inst) {
                checkDates($(this), endTime);
            },
            onSelect: function (selectedDateTime) {
                selected($(this), endTime, 'minDate');
            }
        }, options, options.start));
        $.fn[method].call(endTime, $.extend({
            timeOnly: timeOnly,
            onClose: function (dateText, inst) {
                checkDates($(this), startTime);
            },
            onSelect: function (selectedDateTime) {
                selected($(this), startTime, 'maxDate');
            }
        }, options, options.end));

        checkDates(startTime, endTime);
        selected(startTime, endTime, 'minDate');
        selected(endTime, startTime, 'maxDate');
        return $([startTime.get(0), endTime.get(0)]);
    };

    /**
	 * Log error or data to the console during error or debugging
	 * @param  {Object} err pass any type object to log to the console during error or debugging
	 * @return {void}
	 */
    $.timepicker.log = function (err) {
        if (window.console) {
            window.console.log(err);
        }
    };

    /*
	 * Add util object to allow access to private methods for testability.
	 */
    $.timepicker._util = {
        _extendRemove: extendRemove,
        _isEmptyObject: isEmptyObject,
        _convert24to12: convert24to12,
        _detectSupport: detectSupport,
        _selectLocalTimezone: selectLocalTimezone,
        _computeEffectiveSetting: computeEffectiveSetting,
        _splitDateTime: splitDateTime,
        _parseDateTimeInternal: parseDateTimeInternal
    };

    /*
	* Microsecond support
	*/
    if (!Date.prototype.getMicroseconds) {
        Date.prototype.microseconds = 0;
        Date.prototype.getMicroseconds = function () { return this.microseconds; };
        Date.prototype.setMicroseconds = function (m) {
            this.setMilliseconds(this.getMilliseconds() + Math.floor(m / 1000));
            this.microseconds = m % 1000;
            return this;
        };
    }

    /*
	* Keep up with the version
	*/
    $.timepicker.version = "1.4.5";

})(jQuery);
/* ]]> */
						</script><script type="text/javascript">
							/* <![CDATA[ */
/*
 * jQuery MultiSelect UI Widget Filtering Plugin 1.4
 * Copyright (c) 2011 Eric Hynds
 *
 * http://www.erichynds.com/jquery/jquery-ui-multiselect-widget/
 *
 * Depends:
 *   - jQuery UI MultiSelect widget
 *
 * Dual licensed under the MIT and GPL licenses:
 *   http://www.opensource.org/licenses/mit-license.php
 *   http://www.gnu.org/licenses/gpl.html
 *
*/
(function(a){var f=/[\-\[\]{}()*+?.,\\\^$|#\s]/g;a.widget("ech.multiselectfilter",{options:{label:"Filter:",width:null,placeholder:"Enter keywords",autoReset:!1},_create:function(){var e;var b=this,c=this.options,d=this.instance=a(this.element).data("multiselect");this.header=d.menu.find(".ui-multiselect-header").addClass("ui-multiselect-hasfilter");e=this.wrapper=a('<div class="ui-multiselect-filter">'+(c.label.length?c.label:"")+'<input placeholder="'+c.placeholder+'" type="search"'+(/\d/.test(c.width)?  'style="width:'+c.width+'px"':"")+" /></div>").prependTo(this.header),c=e;this.inputs=d.menu.find('input[type="checkbox"], input[type="radio"]');this.input=c.find("input").bind({keydown:function(a){13===a.which&&a.preventDefault()},keyup:a.proxy(b._handler,b),click:a.proxy(b._handler,b)});this.updateCache();d._toggleChecked=function(c,d){var e=d&&d.length?d:this.labels.find("input"),i=this,e=e.not(b.instance._isOpen?":disabled, :hidden":":disabled").each(this._toggleState("checked",c));this.update(); var j=e.map(function(){return this.value}).get();this.element.find("option").filter(function(){!this.disabled&&-1<a.inArray(this.value,j)&&i._toggleState("selected",c).call(this)})};d=a(document).bind("multiselectrefresh",function(){b.updateCache();b._handler()});this.options.autoReset&&d.bind("multiselectclose",a.proxy(this._reset,this))},_handler:function(b){var c=a.trim(this.input[0].value.toLowerCase()),d=this.rows,g=this.inputs,h=this.cache;if(c){d.hide();var e=RegExp(c.replace(f,"\\$&"),"gi"); this._trigger("filter",b,a.map(h,function(a,b){return-1!==a.search(e)?(d.eq(b).show(),g.get(b)):null}))}else d.show();this.instance.menu.find(".ui-multiselect-optgroup-label").each(function(){var b=a(this),c=b.nextUntil(".ui-multiselect-optgroup-label").filter(function(){return"none"!==a.css(this,"display")}).length;b[c?"show":"hide"]()})},_reset:function(){this.input.val("").trigger("keyup")},updateCache:function(){this.rows=this.instance.menu.find(".ui-multiselect-checkboxes li:not(.ui-multiselect-optgroup-label)");this.cache=this.element.children().map(function(){var b=a(this);"optgroup"===this.tagName.toLowerCase()&&(b=b.children());return b.map(function(){return this.innerHTML.toLowerCase()}).get()}).get()},widget:function(){return this.wrapper},destroy:function(){a.Widget.prototype.destroy.call(this);this.input.val("").trigger("keyup");this.wrapper.remove()}})})(jQuery);

/* ]]> */
						</script><script type="text/javascript">
							/* <![CDATA[ */
/*
 * jQuery MultiSelect UI Widget 1.13
 * Copyright (c) 2012 Eric Hynds
 *
 * http://www.erichynds.com/jquery/jquery-ui-multiselect-widget/
 *
 * Depends:
 *   - jQuery 1.4.2+
 *   - jQuery UI 1.8 widget factory
 *
 * Optional:
 *   - jQuery UI effects
 *   - jQuery UI position utility
 *
 * Dual licensed under the MIT and GPL licenses:
 *   http://www.opensource.org/licenses/mit-license.php
 *   http://www.gnu.org/licenses/gpl.html
 *
 */
(function(d){var k=0;d.widget("ech.multiselect",{options:{header:!0,height:175,minWidth:225,classes:"",checkAllText:"Check all",uncheckAllText:"Uncheck all",noneSelectedText:"Select options",selectedText:"# selected",selectedList:0,show:null,hide:null,autoOpen:!1,multiple:!0,position:{}},_create:function(){var a=this.element.hide(),b=this.options;this.speed=d.fx.speeds._default;this._isOpen=!1;a=(this.button=d('<button type="button"><span class="ui-icon ui-icon-triangle-2-n-s"></span></button>')).addClass("ui-multiselect ui-widget ui-state-default ui-corner-all").addClass(b.classes).attr({title:a.attr("title"),"aria-haspopup":!0,tabIndex:a.attr("tabIndex")}).insertAfter(a);(this.buttonlabel=d("<span />")).html(b.noneSelectedText).appendTo(a);var a=(this.menu=d("<div />")).addClass("ui-multiselect-menu ui-widget ui-widget-content ui-corner-all").addClass(b.classes).appendTo(document.body),c=(this.header=d("<div />")).addClass("ui-widget-header ui-corner-all ui-multiselect-header ui-helper-clearfix").appendTo(a);(this.headerLinkContainer=d("<ul />")).addClass("ui-helper-reset").html(function(){return!0===b.header?'<li><a class="ui-multiselect-all" href="#"><span class="ui-icon ui-icon-check"></span><span>'+b.checkAllText+'</span></a></li><li><a class="ui-multiselect-none" href="#"><span class="ui-icon ui-icon-closethick"></span><span>'+b.uncheckAllText+"</span></a></li>":"string"===typeof b.header?"<li>"+b.header+"</li>":""}).append('<li class="ui-multiselect-close"><a href="#" class="ui-multiselect-close"><span class="ui-icon ui-icon-circle-close"></span></a></li>').appendTo(c);(this.checkboxContainer=d("<ul />")).addClass("ui-multiselect-checkboxes ui-helper-reset").appendTo(a);this._bindEvents();this.refresh(!0);b.multiple||a.addClass("ui-multiselect-single")},_init:function(){!1===this.options.header&&this.header.hide();this.options.multiple||this.headerLinkContainer.find(".ui-multiselect-all, .ui-multiselect-none").hide();this.options.autoOpen&&this.open();this.element.is(":disabled")&&this.disable()},refresh:function(a){var b=this.element,c=this.options,f=this.menu,h=this.checkboxContainer,g=[],e="",i=b.attr("id")||k++;b.find("option").each(function(b){d(this);var a=this.parentNode,f=this.innerHTML,h=this.title,k=this.value,b="ui-multiselect-"+(this.id||i+"-option-"+b),l=this.disabled,n=this.selected,m=["ui-corner-all"],o=(l?"ui-multiselect-disabled ":" ")+this.className,j;"OPTGROUP"===a.tagName&&(j=a.getAttribute("label"),-1===d.inArray(j,g)&&(e+='<li class="ui-multiselect-optgroup-label '+a.className+'"><a href="#">'+j+"</a></li>",g.push(j)));l&&m.push("ui-state-disabled");n&&!c.multiple&&m.push("ui-state-active");e+='<li class="'+o+'">';e+='<label for="'+b+'" title="'+h+'" class="'+m.join(" ")+'">';e+='<input id="'+b+'" name="multiselect_'+i+'" type="'+(c.multiple?"checkbox":"radio")+'" value="'+k+'" title="'+f+'"';n&&(e+=' checked="checked"',e+=' aria-selected="true"');l&&(e+=' disabled="disabled"',e+=' aria-disabled="true"');e+=" /><span>"+f+"</span></label></li>"});h.html(e);this.labels=f.find("label");this.inputs=this.labels.children("input");this._setButtonWidth();this._setMenuWidth();this.button[0].defaultValue=this.update();a||this._trigger("refresh")},update:function(){var a=this.options,b=this.inputs,c=b.filter(":checked"),f=c.length,a=0===f?a.noneSelectedText:d.isFunction(a.selectedText)?a.selectedText.call(this,f,b.length,c.get()):/\d/.test(a.selectedList)&&0<a.selectedList&&f<=a.selectedList?c.map(function(){return d(this).next().html()}).get().join(", "):a.selectedText.replace("#",f).replace("#",b.length);this.buttonlabel.html(a);return a},_bindEvents:function(){function a(){b[b._isOpen? "close":"open"]();return!1}var b=this,c=this.button;c.find("span").bind("click.multiselect",a);c.bind({click:a,keypress:function(a){switch(a.which){case 27:case 38:case 37:b.close();break;case 39:case 40:b.open()}},mouseenter:function(){c.hasClass("ui-state-disabled")||d(this).addClass("ui-state-hover")},mouseleave:function(){d(this).removeClass("ui-state-hover")},focus:function(){c.hasClass("ui-state-disabled")||d(this).addClass("ui-state-focus")},blur:function(){d(this).removeClass("ui-state-focus")}});this.header.delegate("a","click.multiselect",function(a){if(d(this).hasClass("ui-multiselect-close"))b.close();else b[d(this).hasClass("ui-multiselect-all")?"checkAll":"uncheckAll"]();a.preventDefault()});this.menu.delegate("li.ui-multiselect-optgroup-label a","click.multiselect",function(a){a.preventDefault();var c=d(this),g=c.parent().nextUntil("li.ui-multiselect-optgroup-label").find("input:visible:not(:disabled)"),e=g.get(),c=c.parent().text();!1!==b._trigger("beforeoptgrouptoggle",a,{inputs:e,label:c})&&(b._toggleChecked(g.filter(":checked").length!==g.length,g),b._trigger("optgrouptoggle",a,{inputs:e,label:c,checked:e[0].checked}))}).delegate("label","mouseenter.multiselect",function(){d(this).hasClass("ui-state-disabled")||(b.labels.removeClass("ui-state-hover"),d(this).addClass("ui-state-hover").find("input").focus())}).delegate("label","keydown.multiselect",function(a){a.preventDefault();switch(a.which){case 9:case 27:b.close();break;case 38:case 40:case 37:case 39:b._traverse(a.which,this);break;case 13:d(this).find("input")[0].click()}}).delegate('input[type="checkbox"], input[type="radio"]',"click.multiselect",function(a){var c=d(this),g=this.value,e=this.checked,i=b.element.find("option");this.disabled||!1===b._trigger("click",a,{value:g,text:this.title,checked:e})?a.preventDefault():(c.focus(),c.attr("aria-selected",e),i.each(function(){this.value===g?this.selected=e:b.options.multiple||(this.selected=!1)}),b.options.multiple||(b.labels.removeClass("ui-state-active"),c.closest("label").toggleClass("ui-state-active",e),b.close()),b.element.trigger("change"),setTimeout(d.proxy(b.update,b),10))});d(document).bind("mousedown.multiselect",function(a){b._isOpen&&(!d.contains(b.menu[0],a.target)&&!d.contains(b.button[0],a.target)&&a.target!==b.button[0])&&b.close()});d(this.element[0].form).bind("reset.multiselect",function(){setTimeout(d.proxy(b.refresh,b),10)})},_setButtonWidth:function(){var a=this.element.outerWidth(),b=this.options;/\d/.test(b.minWidth)&&a<b.minWidth&&(a=b.minWidth);this.button.width(a)},_setMenuWidth:function(){var a=this.menu,b=this.button.outerWidth()-parseInt(a.css("padding-left"),10)-parseInt(a.css("padding-right"),10)-parseInt(a.css("border-right-width"),10)-parseInt(a.css("border-left-width"),10);a.width(b||this.button.outerWidth())},_traverse:function(a,b){var c=d(b),f=38===a||37===a,c=c.parent()[f?"prevAll":"nextAll"]("li:not(.ui-multiselect-disabled, .ui-multiselect-optgroup-label)")[f?"last":"first"]();c.length?c.find("label").trigger("mouseover"):(c=this.menu.find("ul").last(),this.menu.find("label")[f? "last":"first"]().trigger("mouseover"),c.scrollTop(f?c.height():0))},_toggleState:function(a,b){return function(){this.disabled||(this[a]=b);b?this.setAttribute("aria-selected",!0):this.removeAttribute("aria-selected")}},_toggleChecked:function(a,b){var c=b&&b.length?b:this.inputs,f=this;c.each(this._toggleState("checked",a));c.eq(0).focus();this.update();var h=c.map(function(){return this.value}).get();this.element.find("option").each(function(){!this.disabled&&-1<d.inArray(this.value,h)&&f._toggleState("selected",a).call(this)});c.length&&this.element.trigger("change")},_toggleDisabled:function(a){this.button.attr({disabled:a,"aria-disabled":a})[a?"addClass":"removeClass"]("ui-state-disabled");var b=this.menu.find("input"),b=a?b.filter(":enabled").data("ech-multiselect-disabled",!0):b.filter(function(){return!0===d.data(this,"ech-multiselect-disabled")}).removeData("ech-multiselect-disabled");b.attr({disabled:a,"arial-disabled":a}).parent()[a?"addClass":"removeClass"]("ui-state-disabled");this.element.attr({disabled:a,"aria-disabled":a})},open:function(){var a=this.button,b=this.menu,c=this.speed,f=this.options,h=[];if(!(!1===this._trigger("beforeopen")||a.hasClass("ui-state-disabled")||this._isOpen)){var g=b.find("ul").last(),e=f.show,i=a.offset();d.isArray(f.show)&&(e=f.show[0],c=f.show[1]||this.speed);e&&(h=[e,c]);g.scrollTop(0).height(f.height);d.ui.position&&!d.isEmptyObject(f.position)?(f.position.of=f.position.of||a,b.show().position(f.position).hide()):b.css({top:i.top+a.outerHeight(),left:i.left});d.fn.show.apply(b,h);this.labels.eq(0).trigger("mouseover").trigger("mouseenter").find("input").trigger("focus");a.addClass("ui-state-active");this._isOpen=!0;this._trigger("open")}},close:function(){if(!1!==this._trigger("beforeclose")){var a=this.options,b=a.hide,c=this.speed,f=[];d.isArray(a.hide)&&(b=a.hide[0],c=a.hide[1]||this.speed);b&&(f=[b,c]);d.fn.hide.apply(this.menu,f);this.button.removeClass("ui-state-active").trigger("blur").trigger("mouseleave");this._isOpen=!1;this._trigger("close")}},enable:function(){this._toggleDisabled(!1)},disable:function(){this._toggleDisabled(!0)},checkAll:function(){this._toggleChecked(!0);this._trigger("checkAll")},uncheckAll:function(){this._toggleChecked(!1);this._trigger("uncheckAll")},getChecked:function(){return this.menu.find("input").filter(":checked")},destroy:function(){d.Widget.prototype.destroy.call(this);this.button.remove();this.menu.remove();this.element.show();return this},isOpen:function(){return this._isOpen},widget:function(){return this.menu},getButton:function(){return this.button},_setOption:function(a,b){var c=this.menu;switch(a){case "header":c.find("div.ui-multiselect-header")[b?"show":"hide"]();break;case "checkAllText":c.find("a.ui-multiselect-all span").eq(-1).text(b);break;case "uncheckAllText":c.find("a.ui-multiselect-none span").eq(-1).text(b);break;case "height":c.find("ul").last().height(parseInt(b,10));break;case "minWidth":this.options[a]=parseInt(b,10);this._setButtonWidth();this._setMenuWidth();break;case "selectedText":case "selectedList":case "noneSelectedText":this.options[a]=b;this.update();break;case "classes":c.add(this.button).removeClass(this.options.classes).addClass(b);break;case "multiple":c.toggleClass("ui-multiselect-single",!b),this.options.multiple=b,this.element[0].multiple=b,this.refresh()}d.Widget.prototype._setOption.apply(this,arguments)}})})(jQuery);

/* ]]> */
						</script><script type="text/javascript">
							/* <![CDATA[ */
/*! jQuery Validation Plugin - v1.13.0 - 7/1/2014
 * http://jqueryvalidation.org/
 * Copyright (c) 2014 JA~¶rn Zaefferer; Licensed MIT */
!function (a) { "function" == typeof define && define.amd ? define(["jquery"], a) : a(jQuery) }(function (a) { a.extend(a.fn, { validate: function (b) { if (!this.length) return void (b && b.debug && window.console && console.warn("Nothing selected, can't validate, returning nothing.")); var c = a.data(this[0], "validator"); return c ? c : (this.attr("novalidate", "novalidate"), c = new a.validator(b, this[0]), a.data(this[0], "validator", c), c.settings.onsubmit && (this.validateDelegate(":submit", "click", function (b) { c.settings.submitHandler && (c.submitButton = b.target), a(b.target).hasClass("cancel") && (c.cancelSubmit = !0), void 0 !== a(b.target).attr("formnovalidate") && (c.cancelSubmit = !0) }), this.submit(function (b) { function d() { var d; return c.settings.submitHandler ? (c.submitButton && (d = a("<input type='hidden'/>").attr("name", c.submitButton.name).val(a(c.submitButton).val()).appendTo(c.currentForm)), c.settings.submitHandler.call(c, c.currentForm, b), c.submitButton && d.remove(), !1) : !0 } return c.settings.debug && b.preventDefault(), c.cancelSubmit ? (c.cancelSubmit = !1, d()) : c.form() ? c.pendingRequest ? (c.formSubmitted = !0, !1) : d() : (c.focusInvalid(), !1) })), c) }, valid: function () { var b, c; return a(this[0]).is("form") ? b = this.validate().form() : (b = !0, c = a(this[0].form).validate(), this.each(function () { b = c.element(this) && b })), b }, removeAttrs: function (b) { var c = {}, d = this; return a.each(b.split(/\s/), function (a, b) { c[b] = d.attr(b), d.removeAttr(b) }), c }, rules: function (b, c) { var d, e, f, g, h, i, j = this[0]; if (b) switch (d = a.data(j.form, "validator").settings, e = d.rules, f = a.validator.staticRules(j), b) { case "add": a.extend(f, a.validator.normalizeRule(c)), delete f.messages, e[j.name] = f, c.messages && (d.messages[j.name] = a.extend(d.messages[j.name], c.messages)); break; case "remove": return c ? (i = {}, a.each(c.split(/\s/), function (b, c) { i[c] = f[c], delete f[c], "required" === c && a(j).removeAttr("aria-required") }), i) : (delete e[j.name], f) } return g = a.validator.normalizeRules(a.extend({}, a.validator.classRules(j), a.validator.attributeRules(j), a.validator.dataRules(j), a.validator.staticRules(j)), j), g.required && (h = g.required, delete g.required, g = a.extend({ required: h }, g), a(j).attr("aria-required", "true")), g.remote && (h = g.remote, delete g.remote, g = a.extend(g, { remote: h })), g } }), a.extend(a.expr[":"], { blank: function (b) { return !a.trim("" + a(b).val()) }, filled: function (b) { return !!a.trim("" + a(b).val()) }, unchecked: function (b) { return !a(b).prop("checked") } }), a.validator = function (b, c) { this.settings = a.extend(!0, {}, a.validator.defaults, b), this.currentForm = c, this.init() }, a.validator.format = function (b, c) { return 1 === arguments.length ? function () { var c = a.makeArray(arguments); return c.unshift(b), a.validator.format.apply(this, c) } : (arguments.length > 2 && c.constructor !== Array && (c = a.makeArray(arguments).slice(1)), c.constructor !== Array && (c = [c]), a.each(c, function (a, c) { b = b.replace(new RegExp("\\{" + a + "\\}", "g"), function () { return c }) }), b) }, a.extend(a.validator, { defaults: { messages: {}, groups: {}, rules: {}, errorClass: "error", validClass: "valid", errorElement: "label", focusInvalid: !0, errorContainer: a([]), errorLabelContainer: a([]), onsubmit: !0, ignore: ":hidden", ignoreTitle: !1, onfocusin: function (a) { this.lastActive = a, this.settings.focusCleanup && !this.blockFocusCleanup && (this.settings.unhighlight && this.settings.unhighlight.call(this, a, this.settings.errorClass, this.settings.validClass), this.hideThese(this.errorsFor(a))) }, onfocusout: function (a) { this.checkable(a) || !(a.name in this.submitted) && this.optional(a) || this.element(a) }, onkeyup: function (a, b) { (9 !== b.which || "" !== this.elementValue(a)) && (a.name in this.submitted || a === this.lastElement) && this.element(a) }, onclick: function (a) { a.name in this.submitted ? this.element(a) : a.parentNode.name in this.submitted && this.element(a.parentNode) }, highlight: function (b, c, d) { "radio" === b.type ? this.findByName(b.name).addClass(c).removeClass(d) : a(b).addClass(c).removeClass(d) }, unhighlight: function (b, c, d) { "radio" === b.type ? this.findByName(b.name).removeClass(c).addClass(d) : a(b).removeClass(c).addClass(d) } }, setDefaults: function (b) { a.extend(a.validator.defaults, b) }, messages: { required: "This field is required.", remote: "Please fix this field.", email: "Please enter a valid email address.", url: "Please enter a valid URL.", date: "Please enter a valid date.", dateISO: "Please enter a valid date ( ISO ).", number: "Please enter a valid number.", digits: "Please enter only digits.", creditcard: "Please enter a valid credit card number.", equalTo: "Please enter the same value again.", maxlength: a.validator.format("Please enter no more than {0} characters."), minlength: a.validator.format("Please enter at least {0} characters."), rangelength: a.validator.format("Please enter a value between {0} and {1} characters long."), range: a.validator.format("Please enter a value between {0} and {1}."), max: a.validator.format("Please enter a value less than or equal to {0}."), min: a.validator.format("Please enter a value greater than or equal to {0}.") }, autoCreateRanges: !1, prototype: { init: function () { function b(b) { var c = a.data(this[0].form, "validator"), d = "on" + b.type.replace(/^validate/, ""), e = c.settings; e[d] && !this.is(e.ignore) && e[d].call(c, this[0], b) } this.labelContainer = a(this.settings.errorLabelContainer), this.errorContext = this.labelContainer.length && this.labelContainer || a(this.currentForm), this.containers = a(this.settings.errorContainer).add(this.settings.errorLabelContainer), this.submitted = {}, this.valueCache = {}, this.pendingRequest = 0, this.pending = {}, this.invalid = {}, this.reset(); var c, d = this.groups = {}; a.each(this.settings.groups, function (b, c) { "string" == typeof c && (c = c.split(/\s/)), a.each(c, function (a, c) { d[c] = b }) }), c = this.settings.rules, a.each(c, function (b, d) { c[b] = a.validator.normalizeRule(d) }), a(this.currentForm).validateDelegate(":text, [type='password'], [type='file'], select, textarea, [type='number'], [type='search'] ,[type='tel'], [type='url'], [type='email'], [type='datetime'], [type='date'], [type='month'], [type='week'], [type='time'], [type='datetime-local'], [type='range'], [type='color'], [type='radio'], [type='checkbox']", "focusin focusout keyup", b).validateDelegate("select, option, [type='radio'], [type='checkbox']", "click", b), this.settings.invalidHandler && a(this.currentForm).bind("invalid-form.validate", this.settings.invalidHandler), a(this.currentForm).find("[required], [data-rule-required], .required").attr("aria-required", "true") }, form: function () { return this.checkForm(), a.extend(this.submitted, this.errorMap), this.invalid = a.extend({}, this.errorMap), this.valid() || a(this.currentForm).triggerHandler("invalid-form", [this]), this.showErrors(), this.valid() }, checkForm: function () { this.prepareForm(); for (var a = 0, b = this.currentElements = this.elements() ; b[a]; a++) this.check(b[a]); return this.valid() }, element: function (b) { var c = this.clean(b), d = this.validationTargetFor(c), e = !0; return this.lastElement = d, void 0 === d ? delete this.invalid[c.name] : (this.prepareElement(d), this.currentElements = a(d), e = this.check(d) !== !1, e ? delete this.invalid[d.name] : this.invalid[d.name] = !0), a(b).attr("aria-invalid", !e), this.numberOfInvalids() || (this.toHide = this.toHide.add(this.containers)), this.showErrors(), e }, showErrors: function (b) { if (b) { a.extend(this.errorMap, b), this.errorList = []; for (var c in b) this.errorList.push({ message: b[c], element: this.findByName(c)[0] }); this.successList = a.grep(this.successList, function (a) { return !(a.name in b) }) } this.settings.showErrors ? this.settings.showErrors.call(this, this.errorMap, this.errorList) : this.defaultShowErrors() }, resetForm: function () { a.fn.resetForm && a(this.currentForm).resetForm(), this.submitted = {}, this.lastElement = null, this.prepareForm(), this.hideErrors(), this.elements().removeClass(this.settings.errorClass).removeData("previousValue").removeAttr("aria-invalid") }, numberOfInvalids: function () { return this.objectLength(this.invalid) }, objectLength: function (a) { var b, c = 0; for (b in a) c++; return c }, hideErrors: function () { this.hideThese(this.toHide) }, hideThese: function (a) { a.not(this.containers).text(""), this.addWrapper(a).hide() }, valid: function () { return 0 === this.size() }, size: function () { return this.errorList.length }, focusInvalid: function () { if (this.settings.focusInvalid) try { a(this.findLastActive() || this.errorList.length && this.errorList[0].element || []).filter(":visible").focus().trigger("focusin") } catch (b) { } }, findLastActive: function () { var b = this.lastActive; return b && 1 === a.grep(this.errorList, function (a) { return a.element.name === b.name }).length && b }, elements: function () { var b = this, c = {}; return a(this.currentForm).find("input, select, textarea").not(":submit, :reset, :image, [disabled]").not(this.settings.ignore).filter(function () { return !this.name && b.settings.debug && window.console && console.error("%o has no name assigned", this), this.name in c || !b.objectLength(a(this).rules()) ? !1 : (c[this.name] = !0, !0) }) }, clean: function (b) { return a(b)[0] }, errors: function () { var b = this.settings.errorClass.split(" ").join("."); return a(this.settings.errorElement + "." + b, this.errorContext) }, reset: function () { this.successList = [], this.errorList = [], this.errorMap = {}, this.toShow = a([]), this.toHide = a([]), this.currentElements = a([]) }, prepareForm: function () { this.reset(), this.toHide = this.errors().add(this.containers) }, prepareElement: function (a) { this.reset(), this.toHide = this.errorsFor(a) }, elementValue: function (b) { var c, d = a(b), e = b.type; return "radio" === e || "checkbox" === e ? a("input[name='" + b.name + "']:checked").val() : "number" === e && "undefined" != typeof b.validity ? b.validity.badInput ? !1 : d.val() : (c = d.val(), "string" == typeof c ? c.replace(/\r/g, "") : c) }, check: function (b) { b = this.validationTargetFor(this.clean(b)); var c, d, e, f = a(b).rules(), g = a.map(f, function (a, b) { return b }).length, h = !1, i = this.elementValue(b); for (d in f) { e = { method: d, parameters: f[d] }; try { if (c = a.validator.methods[d].call(this, i, b, e.parameters), "dependency-mismatch" === c && 1 === g) { h = !0; continue } if (h = !1, "pending" === c) return void (this.toHide = this.toHide.not(this.errorsFor(b))); if (!c) return this.formatAndAdd(b, e), !1 } catch (j) { throw this.settings.debug && window.console && console.log("Exception occurred when checking element " + b.id + ", check the '" + e.method + "' method.", j), j } } if (!h) return this.objectLength(f) && this.successList.push(b), !0 }, customDataMessage: function (b, c) { return a(b).data("msg" + c.charAt(0).toUpperCase() + c.substring(1).toLowerCase()) || a(b).data("msg") }, customMessage: function (a, b) { var c = this.settings.messages[a]; return c && (c.constructor === String ? c : c[b]) }, findDefined: function () { for (var a = 0; a < arguments.length; a++) if (void 0 !== arguments[a]) return arguments[a]; return void 0 }, defaultMessage: function (b, c) { return this.findDefined(this.customMessage(b.name, c), this.customDataMessage(b, c), !this.settings.ignoreTitle && b.title || void 0, a.validator.messages[c], "<strong>Warning: No message defined for " + b.name + "</strong>") }, 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 + ">").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"), 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 (a) { return this.checkable(a) && (a = this.findByName(a.name).not(this.settings.ignore)[0]), a }, 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 && (b.min && b.max && (b.range = [b.min, b.max], delete b.min, delete b.max), b.minlength && 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(a.trim(b), c); return this.optional(c) || e >= d }, maxlength: function (b, c, d) { var e = a.isArray(b) ? b.length : this.getLength(a.trim(b), c); return this.optional(c) || d >= e }, rangelength: function (b, c, d) { var e = a.isArray(b) ? b.length : this.getLength(a.trim(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 }) } }) });
/* ]]> */
						</script><script type="text/javascript">
							/* <![CDATA[ */
///////////////////////////// ML //////////////////////////

var errorValidateFocusOut = false;
var focusOutValidateList = [];

///////////////////////////////////////////////////////////

(function ($) {
    if (!$.validator) {
        throw '$.validator is missing.';
    }

    var custom = function (value, element, methodName) {
        if (!methodName) {
            throw 'Invalid method.';
        }

        var method = window[methodName];
        if (!method) {
            throw 'Invalid method ' + methodName + '.';
        }
        ///////////////////////////// ML //////////////////////////
        //return method.apply(this, [element, '-1', 1]);
        return method.apply(this, [element, this.validatorObject.sectionScope ? this.validatorObject.sectionScope.page - 1 : '-1', 1]);
        ///////////////////////////////////////////////////////////
    };
    $.validator.addMethod('customE', function (value, element, methodName) {
        return custom(value, element, methodName);
    });

    $.validator.addMethod('customW', function (value, element, methodName) {
        return custom(value, element, methodName);
    });

    $.validator.addMethod("date", function (value, element) {
        var check = false;
        if (!$("#" + element.id).hasClass("datetimepicker")) {
            var re = /^\d{1,2}\.\d{1,2}\.\d{4}$/;
            if (re.test(value)) {
                var adata = value.split('.');
                var day = parseInt(adata[0], 10);
                var month = parseInt(adata[1], 10);
                var year = parseInt(adata[2], 10);
                check = isValidDate(day, month, year);
            }
        }
        else {
            var re2 = /^\d{1,2}\.\d{1,2}\.\d{4}\s\d{1,2}:\d{1,2}$/;
            if (re2.test(value)) {
                var adata = value.split(' ');
                var dateParts = adata[0].split('.');

                var day = parseInt(dateParts[0], 10);
                var month = parseInt(dateParts[1], 10);
                var year = parseInt(dateParts[2], 10);

                var timeParts = adata[1].split(':');

                var hours = parseInt(timeParts[0], 10);
                var minutes = parseInt(timeParts[1], 10);
                check = isValidDateTime(day, month, year, hours, minutes);
            }
        }

        return this.optional(element) || check;
    }, "Please enter a correct date");


    $.validator.addMethod("maxValue", function (value, element, arg) {
        var check = true;
        var max = parseFloat(arg);
        if (value > max)
            check = false;

        return this.optional(element) || check;
    }, "Bad value");

    $.validator.addMethod("minValue", function (value, element, arg) {
        var check = true;
        var min = parseFloat(arg);
        if (value < min)
            check = false;

        return this.optional(element) || check;
    }, "Bad value");

}(jQuery));

function isValidDate(day, month, year) {
    if (month < 1 || month > 12) {
        return false;
    }
    if (day < 1 || day > 31) {
        return false;
    }
    if ((month == 4 || month == 6 || month == 9 || month == 11) && day == 31) {
        return false;
    }
    if (month == 2) { // check for february 29th
        var isleap = (year % 4 == 0 && (year % 100 != 0 || year % 400 == 0));
        if (day > 29 || (day == 29 && !isleap)) {
            return false;
        }
    }
    return true;  // date is valid
}

function isValidDateTime(day, month, year, hours, minutes) {
    if (!isValidDate(day, month, year)) {
        return false;
    }

    if (hours < 0 || hours > 23) {
        return false;
    }
    if (minutes < 0 || minutes > 59) {
        return false;
    }

    return true;  // date is valid
}
/* ]]> */
						</script><script type="text/javascript">
							/* <![CDATA[ */
var add = "add";
var remove = "remove";

$(document).ready(function () {
    InitValidation();
    ReindexElements();
    InitPopUpDialog();
    InitPickers();
    InitSectionAccordion();
    InitDataTablePlugIn();
    InitConditionalRules();
    InitRadio();
    InitButtons();
    LocalizeErrorMessages();
    CleanRepetitionButtons();
    InitRepetitionSections($(this));
    InitDebugCode();
    ResizeTextareaField();
    LayoutTempRepetitonSection();
    InitHelp();
    InitMultiCombobox();
    InitRemoteCombobox();
    // Init pageable section
    InitPageableSection();
    InitCloseBtns();
    InitHierarchicallyTree();
    expandLayoutRowsAndFocus();
});

$(window).load(function () {
    InitTabIndexes();
});

function InitCloseBtns(context) {
	if (context == null) context = $(":root");
    context.find("[id^='removeSectionlayoutRow']").each(function () {
        var removeBtn = $(this);
        var layoutRow = removeBtn.parent().parent();
		if (!layoutRow.hasClass("noCloseButton")) {
			var onClickFn = removeBtn.attr("onclick");
			var headerClass = "withHeader";
			var styleStr = "display: none;";
			var layoutRowId = layoutRow.attr("id").split('_');

			if (layoutRow.children("div[class^=caption]")[0] == null || layoutRow.children("div[class^=caption]").children("[class^=headercorrection]")[0] == null) {
			    headerClass = "noHeader";
			}



			if (layoutRow.parent().children("[id^=" + layoutRowId[0] + "]").length > 1)
				styleStr = "display: block;";

			//úprava keď je širší column ako rám sekcie
			var column = layoutRow.parent().parent();
			if (column[0].offsetWidth > column.parent()[0].offsetWidth) {
				styleStr = styleStr + " margin-left:" + (column.parent()[0].offsetWidth - 15).toString() + "px;";
				if (headerClass != "withHeader")
					headerClass = "";
			}

			var closeBtnClass = "closeButton ui-icon ui-icon-closethick " + headerClass;
			var spanStr = '<span class="' + closeBtnClass + '" onclick="' + onClickFn + '" style="' + styleStr + '"></span>';

			layoutRow.children(":first").before(spanStr);
		}
    });
}

function InitHierarchicallyTree() {
    $("form").InitHierarchicallyTree();
}

function InitPageableSection() {
    // Init all pageable section
    $('.section.pageableSection', 'form').pageableSection({
        validator: window.validatorObject
    });
}

function InitMultiCombobox() {
    $("form").InitMultiCombobox();
}

function DeleteMultiCombobox() {
    $("form").DeleteMultiCombobox();
}

function InitRemoteCombobox() {
    $("form").InitRemoteCombobox();
}

function InitHelp() {
    $("form").InitHelp();
}

function InitRepetitionSections(context) {
    var selector = 'div[id^=layoutRow]';
    var removeBtns = context.find('span[id^=removeSection]');
    removeBtns.each(function () {
        var layoutRow = $(this).closest(selector);
        $(layoutRow).each(function () {
            var hasVal = false;
            $(this).find('input, select, textarea').each(function () {
                var element = $(this)[0];
                if (element.type != 'radio' && element.value != '' && element.type != 'button')
                    hasVal = true;
            });
            if (!hasVal)
                removeSectionInit(this);
        });
    });

    IncrementDecrementInnerRepeatingIds(context);
}

function removeSectionInit(sender) {
    var layoutRow = $(sender);
    var layoutRowPrevious = $(layoutRow[0].id).prev('div[id^=layoutRow]');
    var id = sender.id;
    if (id.indexOf(repeatingPostfix) == -1) {
        var removeButton = layoutRow.find('#removeSection' + id);
        var string = removeButton.attr('onclick').toString();
        var minRepetition = string.substring(string.lastIndexOf("(") + 1, string.lastIndexOf(", this"));
        var sectionsCount = countSection(removeButton, 'removeSection');

        if (sectionsCount == minRepetition)
            return null;
        var children = layoutRowPrevious.children('div[id^=repetitionCommands]');
        if (sectionsCount == minRepetition && sectionsCount > 1)
            children.children('span[id^=removeSection]').hide();

        if (sectionsCount == 1) {
            layoutRow.attr("isEmpty", "true");
            layoutRow.children('div[id^=layoutRowContent]').hide().ToggleValidators(true);
            layoutRow.ReinitializeConditionalRules();

            var repetitionCommands = layoutRow.children('div[id^=repetitionCommands]');
            repetitionCommands.children('span[id^=addSection]').show();
            layoutRow.click();
            return repetitionCommands.children('span[id^=removeSection]').hide();
        }

        children.show();
        layoutRow.remove();
        layoutRowPrevious.ReinitializeConditionalRules();

        if ((sectionsCount - 1) == minRepetition) {
            children.children('span[id^=removeSection]').hide();
        }
    }
}

function compareByTabIndex(a, b) {
    var aTabIndex = isNaN($(a).attr('tabindex')) ? Number.POSITIVE_INFINITY : Number($(a).attr('tabindex'));
    var bTabIndex = isNaN($(b).attr('tabindex')) ? Number.POSITIVE_INFINITY : Number($(b).attr('tabindex'));

    if (aTabIndex < bTabIndex)
        return -1;
    if (aTabIndex > bTabIndex)
        return 1;
    return 0;
}

function UpAllTabIndex(up) {
    var focusables = $("input[ID], select, textarea, a, area, button, object");
    var jump = 0;

    focusables.sort(compareByTabIndex);

    focusables.each(function () {
        if ($(this).attr('tabindex') != undefined) {
            var newTabIndex = Number($(this).attr('tabindex')) + jump;
            $(this).attr('tabindex', newTabIndex);
            jump += up;
        }
    });
}

function ShringTabIndexRange() {
    var focusables = $("input[ID], select, textarea, a, area, button, object, .addRemoveSection, .lookupbutton, .infoIcon, .closeButton");
    var jump = 0;

    focusables.sort(compareByTabIndex);

    for (var i = 0; i < focusables.length; i++) {
        $(focusables[i]).attr('tabIndex', i + 1);
    }
}

function InitTabIndexes() {
    if ($('.addRemoveSection, .lookupbutton, .infoIcon, .closeButton').length != $('span[tabindex]').length) {
        var previousTabIndex = 0;
        var jump = 0;
        var focusables = $("input[ID], select, textarea, a, area, button, object");
        var allFocusables = $("input[ID], select, textarea, a, area, button, object, .addRemoveSection, .lookupbutton, .infoIcon, .closeButton");

        // Pomocna uprava tabIndexov
        UpAllTabIndex(100);

        focusables.sort(compareByTabIndex);

        focusables.each(function () {
            if ($(this).attr('tabindex') != undefined) {
                if ($(this).hasClass('remoteLookup')) {
                    var newTabIndex = Number($(this).attr('tabindex')) + jump;
                    $(this).attr('tabindex', newTabIndex);
                    $(this).siblings('.lookupbutton').attr('tabindex', newTabIndex + 1);
                    jump++;
                }
                else {
                    $(this).attr('tabindex', Number($(this).attr('tabindex')) + jump);
                }
            }
        });

        jump = 0;

        allFocusables.each(function (i) {
            var tabIndex = $(this).attr('tabindex');
            if ($(this).attr('id') == 'titulItemName')
                var pom;

            if (tabIndex == undefined) {
                previousTabIndex++;
                $(this).attr('tabindex', previousTabIndex);
                jump++;
            }
            else {
                previousTabIndex = Number(tabIndex) + jump;
                $(this).attr('tabindex', previousTabIndex);
            }
        });

        // Pomocna uprava tabIndexov
        ShringTabIndexRange();
    }

    $('.addRemoveSection, .lookupbutton, .infoIcon, .ui-dialog-content, .closeButton').live('keydown', function (data) {
        if (data.which == 13 || data.which == 32) {
            var focusables = $("input[ID], select, textarea, a, area, button, object, .addRemoveSection, .lookupbutton, .infoIcon, .closeButton");
            var current = focusables.index(this);
            var next;

            if ($(this).hasClass('infoIcon')) {
                $(this).delay(100).queue(function (next) {
                    $(this).mouseover().mousedown();
                    var closeButton = $('.ui-dialog-titlebar-close:visible');
                    closeButton.focusin();
                    next();
                });
            }
            else {
                var contentLayotRow = $(this).closest('[id^=layoutRow]').find('[id^=layoutRowContentlayoutRow]');
                var isFirstHiddenSection = this.id.indexOf('addSectionlayoutRow') != -1 && !contentLayotRow.is(':visible');
                this.click();

                if (this.id.indexOf('addSectionlayoutRow') != -1) {
                    focusables = $("input[ID], select, textarea, a, area, button, object, .addRemoveSection, .lookupbutton, .infoIcon, .closeButton");
                    current = focusables.index(this);

                    if (isFirstHiddenSection)
                        current -= contentLayotRow.find("input[ID], select, textarea, a, area, button, object, .addRemoveSection, .lookupbutton, .infoIcon, .closeButton").length;

                    while (current < focusables.length && focusables.eq(current + 1).length && (!focusables.eq(current).is(':visible') || focusables.eq(current).is('span'))) {
                        current++;
                    }

                    next = focusables.eq(current).length ? focusables.eq(current) : focusables.eq(0);
                    next.focus();
                }
                else if (this.id.indexOf('removeSectionlayoutRow') != -1 || $(this).hasClass('closeButton')) {
                    while (current > 0 && focusables.eq(current - 1).length && (!focusables.eq(current).is(':visible') || focusables.eq(current).is('span'))) {
                        current--;
                    }

                    next = focusables.eq(current).length ? focusables.eq(current) : focusables.eq(0);
                    next.focus();
                }
            }
        }
    });
}

function InitPickers() {
    ReadOnlyPickers();
    InitDatePickerValues();
    InitDatePickerDateFormat();
    InitDateTimePicker();
    InitTimePickerValues();
    InitDateRangePicker();
}

function ReindexElements() {
    var repetitionSections = new Array();
    var attributeName = "ID";
    $("div[id^=repetitionCommandslayoutRow]").each(function () {
        var layoutRow = $(this);
        var value = layoutRow.attr(attributeName);
        var indexOf = value.indexOf(repeatingPostfix);
        if (indexOf != -1) {
            value = value.substring(0, indexOf);
            layoutRow.attr(attributeName, value);
        }
        if ($.inArray(value, repetitionSections) == -1) {
            repetitionSections.push(value);
        }
    });

    for (var i = 0; i < repetitionSections.length; i++) {
        var sections = $("div[id^=" + repetitionSections[i].replace('repetitionCommands', '') + "]");
        if (sections.length > 1) {
            for (var j = 1; j < sections.length; j++) {
                var layoutRow = sections.eq(j);
                layoutRow.IncrementFieldIds();
            }
        }
    }
}

function ResizeTextareaField() {  // readOnly mode
    $("textarea[disabled]").each(function () {
        var textArea = $(this);
        textArea.attr('rows', (Math.round(textArea[0].scrollHeight / 15)));
    });
}

function CleanRepetitionButtons() {
    $('div[id^=repetitionCommandslayoutRow]').each(function () {
        var repetitionSection = $(this);
        if (repetitionSection[0].lastChild != null) {
            var parentRepetitionSection = repetitionSection.parent();
            var id = getOriginalId(parentRepetitionSection[0].id, '_');
            var addButton = repetitionSection.find('[id=addSection' + id + ']');
            if (addButton.length > 0) {
                var removeButton = repetitionSection.find('[id=removeSection' + id + ']');
                var string = addButton.attr('onclick').toString();
                var array = string.substring(string.lastIndexOf("(") + 1, string.lastIndexOf(", this")).split(',');
                var minRepetition = array[0];
                var maxRepetition = array[1];

                if (minRepetition == 0 && maxRepetition == 1) {
                    var hasVal = false;
                    parentRepetitionSection.find('input,select,textarea').each(function () {
                        var element = $(this);
                        var value = element.val();
                        if (value.length > 0 && element[0].type != 'radio')
                            hasVal = true;
                    });

                    if (hasVal) {
                        addButton.hide();
                        removeButton.show();
                    }

                } else {
                    var sectionsCount = countSection(addButton, 'addSection');
                    if (sectionsCount == maxRepetition) {
                        addButton.hide();
                        removeButton.show();
                    }

                    if (sectionsCount == minRepetition) {
                        addButton.show();
                        removeButton.hide();
                    }

                    if (sectionsCount > 0 && minRepetition == 0) {
                        removeButton.show();
                    }
                }
            }
        }
    });
}

function LayoutTempRepetitonSection() {
    $('div[adjustposition^=true]').each(Layout);
}

function InitDebugCode() {
    var ignoreClientErrors = $.GetUrlParam("ignoreClientErrors");
    if (ignoreClientErrors != 0)
        validatorObject.settings.ignoreClientErrors = true;
}

function InitExistingForm() {
    $("form :radio:checked").click();
}

function ReadOnlyPickers() {
    $(".datepicker[readonly='readonly'],.datepickerISO[readonly='readonly']").datepicker({ minDate: -1, maxDate: -2 });
    $(".timepicker[readonly='readonly']").timepicker({ hourMin: 0, hourMax: 0, minuteMin: 0, minuteMax: 0 });
    $(".datetimepicker[readonly='readonly']").datetimepicker({ minDate: -1, maxDate: -2, hourMin: 0, hourMax: 0, minuteMin: 0, minuteMax: 0 });
}

function InitDatePickerValues() {
    switch (GetFormLanguage()) {
        case 'en':
            // En is default
            break;

        default: // sk a default
            $.datepicker.regional['sk'] = {
                closeText: 'Zavrieť',
                prevText: '&#x3c;Predchádzajúci',
                nextText: 'Nasledujúci&#x3e;',
                currentText: 'Dnes',
                monthNames: ['Január', 'Február', 'Marec', 'Apríl', 'Máj', 'Jún',
                'Júl', 'August', 'September', 'Október', 'November', 'December'],
                monthNamesShort: ['Jan', 'Feb', 'Mar', 'Apr', 'Máj', 'Jún',
                'Júl', 'Aug', 'Sep', 'Okt', 'Nov', 'Dec'],
                dayNames: ['Nedeľa', 'Pondelok', 'Utorok', 'Streda', 'Štvrtok', 'Piatok', 'Sobota'],
                dayNamesShort: ['Ned', 'Pon', 'Uto', 'Str', 'Štv', 'Pia', 'Sob'],
                dayNamesMin: ['Ne', 'Po', 'Ut', 'St', 'Št', 'Pia', 'So'],
                weekHeader: 'Ty',
                //dateFormat: 'dd.mm.yy',
                firstDay: 1,
                isRTL: false,
                showMonthAfterYear: false,
                yearSuffix: ''
            };
    }

    $.datepicker.setDefaults($.datepicker.regional['sk']);
}

function InitTimePickerValues() {
    switch (GetFormLanguage()) {
        case 'en': // En is default
            $(".timepicker").timepicker({
                onClose: function (dateText, inst) {
                    $(this).focusout();
                }
            });
            break;

        default: // sk a default
            $(".timepicker").timepicker({
                timeOnlyTitle: 'Vyber čas',
                timeText: 'Čas',
                hourText: 'Hodina',
                minuteText: 'Мinúta',
                secondText: 'Sekunda',
                currentText: 'Aktuálny',
                closeText: 'Vybrať',
                onClose: function (dateText, inst) {
                    $(this).focusout();
                }
            });
    };

    $('.timepicker').live('keypress', function (e) {
        var newVal = $(this).val() + (e.which !== 0 ? String.fromCharCode(e.which) : '')
        var charPattern = /^[0-9]?$|^\:?$/;

        if (e.which != 8 && !e.ctrlKey && !charPattern.test(String.fromCharCode(e.which)) && newVal.length > $(this).val().length)
            e.preventDefault();
    });
}

// Potrebne pre DateRangePicker
$.datepicker._defaults.onAfterUpdate = null;

var datepicker__updateDatepicker = $.datepicker._updateDatepicker;
$.datepicker._updateDatepicker = function (inst) {
    datepicker__updateDatepicker.call(this, inst);

    var onAfterUpdate = this._get(inst, 'onAfterUpdate');

    if (onAfterUpdate)
        onAfterUpdate.apply((inst.input ? inst.input[0] : null), [(inst.input ? inst.input.val() : ''), inst]);
}
// ----

function InitDateRangePicker() {
    $(function () {
        var cur = new Array();
        var prv = new Array();
        var list = $('.daterangepickerdiv');
        var count = list.length;
        var numberOfMonthsVals = new Array();

        for (var i = 0; i < count; i++) {
            var dRPInput;

            if (list[i]) {
                var searchDiv = list[i].parentNode;
                dRPInput = $(searchDiv).find("input[ID]");
            }

            if (dRPInput[0].value != '') {
                var v = dRPInput[0].value;
                var d;

                try {
                    if (v.indexOf(' - ') != -1) {
                        d = v.split(' - ');
                        prv.push($.datepicker.parseDate('dd.mm.yy', d[0]).getTime());
                        cur.push($.datepicker.parseDate('dd.mm.yy', d[1]).getTime());
                    } else if (v.length > 0) {
                        var time = $.datepicker.parseDate('dd.mm.yy', v).getTime();
                        prv.push(time);
                        cur.push(time);
                    }
                } catch (e) {
                    cur.push(-1);
                    prv.push(-1);
                }
            }
            else {
                cur.push(-1);
                prv.push(-1);
            }

            numberOfMonthsVals.push(1);
        }

        function arrayObjectIndexOf(myArray, searchObject) {
            for (var i = 0; i < myArray.length; i++) {
                if (myArray[i] === searchObject)
                    return i;
            }
            return -1;
        }

        switch (GetFormLanguage()) {
            case 'en': // En is default
                $('.daterangepickerdiv')
                  .datepicker({
                      weekHeader: 'Ty',
                      dateFormat: 'dd.mm.yy',
                      firstDay: 1,
                      isRTL: false,
                      showMonthAfterYear: false,
                      yearSuffix: '',
                      changeMonth: true,
                      changeYear: true,
                      yearRange: "-100:+100",
                      showButtonPanel: true,

                      beforeShowDay: function (date) {
                          var index = arrayObjectIndexOf(list, this);

                          return [true, ((date.getTime() >= Math.min(prv[index], cur[index]) && date.getTime() <= Math.max(prv[index], cur[index])) ? 'date-range-selected' : '')];
                      },

                      onSelect: function (dateText, inst) {
                          var d1, d2;
                          var dRPInput;
                          var index = arrayObjectIndexOf(list, this);

                          if (this) {
                              var searchDiv = this.parentNode;
                              dRPInput = $(searchDiv).find("input[ID]");
                          }

                          if (dRPInput) {
                              prv[index] = cur[index];
                              cur[index] = (new Date(inst.selectedYear, inst.selectedMonth, inst.selectedDay)).getTime();

                              if (prv[index] == -1 || prv[index] == cur) {
                                  prv[index] = cur[index];
                                  $(dRPInput).val(dateText);
                              }
                              else {
                                  d1 = $.datepicker.formatDate('dd.mm.yy', new Date(Math.min(prv[index], cur[index])), {});
                                  d2 = $.datepicker.formatDate('dd.mm.yy', new Date(Math.max(prv[index], cur[index])), {});
                                  $(dRPInput).val(d1 + ' - ' + d2);
                              }
                          }
                      },

                      onChangeMonthYear: function (year, month, inst) {
                          // Reset date on month or year change
                          /*var index = arrayObjectIndexOf(list, this);

                          cur[index] = prv[index] = -1;*/
                      },

                      onAfterUpdate: function () {
                          var thisDRPDir = this;

                          $('<button type="button" class="ui-datepicker-close ui-state-default ui-priority-primary ui-corner-all" data-handler="hide" data-event="click">Select</button>')
                                 .appendTo($('.ui-datepicker-buttonpane'))
                                 .on('click', function () {
                                     var dRPInput;

                                     if (thisDRPDir) {
                                         var searchDiv = thisDRPDir.parentNode;
                                         dRPInput = $(searchDiv).find("input[ID]");
                                     }

                                     if (dRPInput[0].value == '') {
                                         var index = arrayObjectIndexOf(list, thisDRPDir);

                                         cur[index] = prv[index] = -1;
                                     }

                                     $(thisDRPDir).hide();
                                     dRPInput.focusout();
                                 });

                          $('<button type="button" class="ui-state-default ui-corner-all" data-event="click">Clear</button>')
                                 .appendTo($('.ui-datepicker-buttonpane'))
                                 .on('click', function () {
                                     var index = arrayObjectIndexOf(list, thisDRPDir);
                                     var dRPInput;

                                     if (thisDRPDir) {
                                         var searchDiv = thisDRPDir.parentNode;
                                         dRPInput = $(searchDiv).find("input[ID]");
                                     }

                                     if (dRPInput) {
                                         dRPInput[0].value = '';
                                         cur[index] = prv[index] = -1;
                                         $(thisDRPDir).datepicker("refresh");
                                     }
                                 });

                          $('<button type="button" class="ui-state-default ui-corner-all" data-event="click">></button>')
                              .appendTo($('.ui-datepicker-buttonpane'))
                              .on('click', function () {
                                  var index = arrayObjectIndexOf(list, thisDRPDir);

                                  if (numberOfMonthsVals[index] < 6) {
                                      numberOfMonthsVals[index] = numberOfMonthsVals[index] + 1;
                                  }
                                  var object = $(thisDRPDir);
                                  if (numberOfMonthsVals[index] < 5)
                                      object.datepicker("option", "numberOfMonths", [1, numberOfMonthsVals[index]]);
                                  else
                                      object.datepicker("option", "numberOfMonths", [numberOfMonthsVals[index] - 3, 4]);
                              });

                          $('<button type="button" class="ui-state-default ui-corner-all" data-event="click"><</button>')
                                 .appendTo($('.ui-datepicker-buttonpane'))
                                 .on('click', function () {
                                     var index = arrayObjectIndexOf(list, thisDRPDir);

                                     if (numberOfMonthsVals[index] > 1) {
                                         numberOfMonthsVals[index] = numberOfMonthsVals[index] - 1;
                                     }
                                     var object = $(thisDRPDir);
                                     if (numberOfMonthsVals[index] < 5)
                                         object.datepicker("option", "numberOfMonths", [1, numberOfMonthsVals[index]]);
                                     else
                                         object.datepicker("option", "numberOfMonths", [numberOfMonthsVals[index] - 3, 4]);
                                 });

                          $(document).on('click', function (e) {
                              var dRPInput;

                              if (thisDRPDir) {
                                  var searchDiv = thisDRPDir.parentNode;
                                  dRPInput = $(searchDiv).find("input[ID]");
                              }

                              function isDescendantOrUiDP(parent, child) {
                                  var node = child.parentNode;

                                  while (node != null) {
                                      try {
                                          if (node == parent || node.className.indexOf('ui-datepicker') != -1) {
                                              return true;
                                          }
                                      }
                                      catch (e) {
                                          return false;
                                      }
                                      node = node.parentNode;
                                  }
                                  return false;
                              }

                              if (e.target.id != dRPInput[0].id && !isDescendantOrUiDP(thisDRPDir, e.target)) {
                                  if (dRPInput[0].value == '') {
                                      var index = arrayObjectIndexOf(list, thisDRPDir);

                                      cur[index] = prv[index] = -1;
                                  }

                                  $(thisDRPDir).hide();
                                  dRPInput.focusout();
                              }
                          });
                          $(this).css({ position: 'absolute', zIndex: 1 });
                      }
                  }).hide();

                break;

            default: // sk a default
                $('.daterangepickerdiv')
                              .datepicker({
                                  closeText: 'Zavrieť',
                                  prevText: '&#x3c;Predchádzajúci',
                                  nextText: 'Nasledujúci&#x3e;',
                                  currentText: 'Dnes',
                                  monthNames: ['Január', 'Február', 'Marec', 'Apríl', 'Máj', 'Jún',
                                    'Júl', 'August', 'September', 'Október', 'November', 'December'],
                                  monthNamesShort: ['Jan', 'Feb', 'Mar', 'Apr', 'Máj', 'Jún',
                                    'Júl', 'Aug', 'Sep', 'Okt', 'Nov', 'Dec'],
                                  dayNames: ['Nedeľa', 'Pondelok', 'Utorok', 'Streda', 'Štvrtok', 'Piatok', 'Sobota'],
                                  dayNamesShort: ['Ned', 'Pon', 'Uto', 'Str', 'Štv', 'Pia', 'Sob'],
                                  dayNamesMin: ['Ne', 'Po', 'Ut', 'St', 'Št', 'Pia', 'So'],
                                  weekHeader: 'Ty',
                                  dateFormat: 'dd.mm.yy',
                                  firstDay: 1,
                                  isRTL: false,
                                  showMonthAfterYear: false,
                                  yearSuffix: '',
                                  changeMonth: true,
                                  changeYear: true,
                                  yearRange: "-100:+100",
                                  showButtonPanel: true,

                                  beforeShowDay: function (date) {
                                      var index = arrayObjectIndexOf(list, this);

                                      return [true, ((date.getTime() >= Math.min(prv[index], cur[index]) && date.getTime() <= Math.max(prv[index], cur[index])) ? 'date-range-selected' : '')];
                                  },

                                  onSelect: function (dateText, inst) {
                                      var d1, d2;
                                      var dRPInput;
                                      var index = arrayObjectIndexOf(list, this);

                                      if (this) {
                                          var searchDiv = this.parentNode;
                                          dRPInput = $(searchDiv).find("input[ID]");
                                      }

                                      if (dRPInput) {
                                          prv[index] = cur[index];
                                          cur[index] = (new Date(inst.selectedYear, inst.selectedMonth, inst.selectedDay)).getTime();

                                          if (prv[index] == -1 || prv[index] == cur) {
                                              prv[index] = cur[index];
                                              $(dRPInput).val(dateText);
                                          }
                                          else {
                                              d1 = $.datepicker.formatDate('dd.mm.yy', new Date(Math.min(prv[index], cur[index])), {});
                                              d2 = $.datepicker.formatDate('dd.mm.yy', new Date(Math.max(prv[index], cur[index])), {});
                                              $(dRPInput).val(d1 + ' - ' + d2);
                                          }
                                      }
                                  },

                                  onChangeMonthYear: function (year, month, inst) {
                                      // Reset date on month or year change
                                      /*var index = arrayObjectIndexOf(list, this);

                                      cur[index] = prv[index] = -1;*/
                                  },

                                  onAfterUpdate: function () {
                                      var thisDRPDir = this;

                                      $('<button type="button" class="ui-datepicker-close ui-state-default ui-priority-primary ui-corner-all" data-handler="hide" data-event="click">Vybrať</button>')
                                             .appendTo($('.ui-datepicker-buttonpane'))
                                             .on('click', function () {
                                                 var dRPInput;

                                                 if (thisDRPDir) {
                                                     var searchDiv = thisDRPDir.parentNode;
                                                     dRPInput = $(searchDiv).find("input[ID]");
                                                 }

                                                 if (dRPInput[0].value == '') {
                                                     var index = arrayObjectIndexOf(list, thisDRPDir);

                                                     cur[index] = prv[index] = -1;
                                                 }

                                                 $(thisDRPDir).hide();
                                                 dRPInput.focusout();
                                             });

                                      $('<button type="button" class="ui-state-default ui-corner-all" data-event="click">Vymaž</button>')
                                             .appendTo($('.ui-datepicker-buttonpane'))
                                             .on('click', function () {
                                                 var index = arrayObjectIndexOf(list, thisDRPDir);
                                                 var dRPInput;

                                                 if (thisDRPDir) {
                                                     var searchDiv = thisDRPDir.parentNode;
                                                     dRPInput = $(searchDiv).find("input[ID]");
                                                 }

                                                 if (dRPInput) {
                                                     dRPInput[0].value = '';
                                                     cur[index] = prv[index] = -1;
                                                     $(thisDRPDir).datepicker("refresh");
                                                 }
                                             });

                                      $('<button type="button" class="ui-state-default ui-corner-all" data-event="click">></button>')
                                          .appendTo($('.ui-datepicker-buttonpane'))
                                          .on('click', function () {
                                              var index = arrayObjectIndexOf(list, thisDRPDir);

                                              if (numberOfMonthsVals[index] < 6) {
                                                  numberOfMonthsVals[index] = numberOfMonthsVals[index] + 1;
                                              }
                                              var object = $(thisDRPDir);
                                              if (numberOfMonthsVals[index] < 5)
                                                  object.datepicker("option", "numberOfMonths", [1, numberOfMonthsVals[index]]);
                                              else
                                                  object.datepicker("option", "numberOfMonths", [numberOfMonthsVals[index] - 3, 4]);
                                          });

                                      $('<button type="button" class="ui-state-default ui-corner-all" data-event="click"><</button>')
                                             .appendTo($('.ui-datepicker-buttonpane'))
                                             .on('click', function () {
                                                 var index = arrayObjectIndexOf(list, thisDRPDir);

                                                 if (numberOfMonthsVals[index] > 1) {
                                                     numberOfMonthsVals[index] = numberOfMonthsVals[index] - 1;
                                                 }
                                                 var object = $(thisDRPDir);
                                                 if (numberOfMonthsVals[index] < 5)
                                                     object.datepicker("option", "numberOfMonths", [1, numberOfMonthsVals[index]]);
                                                 else
                                                     object.datepicker("option", "numberOfMonths", [numberOfMonthsVals[index] - 3, 4]);
                                             });

                                      $(document).on('click', function (e) {
                                          var dRPInput;

                                          if (thisDRPDir) {
                                              var searchDiv = thisDRPDir.parentNode;
                                              dRPInput = $(searchDiv).find("input[ID]");
                                          }

                                          function isDescendantOrUiDP(parent, child) {
                                              var node = child.parentNode;

                                              while (node != null) {
                                                  try {
                                                      if (node == parent || node.className.indexOf('ui-datepicker') != -1) {
                                                          return true;
                                                      }
                                                  }
                                                  catch (e) {
                                                      return false;
                                                  }
                                                  node = node.parentNode;
                                              }
                                              return false;
                                          }

                                          if (e.target.id != dRPInput[0].id && !isDescendantOrUiDP(thisDRPDir, e.target)) {
                                              if (dRPInput[0].value == '') {
                                                  var index = arrayObjectIndexOf(list, thisDRPDir);

                                                  cur[index] = prv[index] = -1;
                                              }

                                              $(thisDRPDir).hide();
                                              dRPInput.focusout();
                                          }
                                      });
                                      $(this).css({ position: 'absolute', zIndex: 1 });
                                  }
                              }).hide();
        }

        $('.daterangepicker').on('focus', function () {
            var v = this.value;
            var d;
            var index = arrayObjectIndexOf(list, this);

            try {
                if (v.indexOf(' - ') != -1) {
                    d = v.split(' - ');

                    prv[index] = $.datepicker.parseDate('dd.mm.yy', d[0]).getTime();
                    cur[index] = $.datepicker.parseDate('dd.mm.yy', d[1]).getTime();
                }
                else if (v.length > 0) {
                    prv[index] = cur[index] = $.datepicker.parseDate('dd.mm.yy', v).getTime();
                }
            } catch (e) {
                cur[index] = prv[index] = -1;
            }

            var dRPDiv;

            if (this) {
                var searchDiv = this.parentNode;
                dRPDiv = $(searchDiv).find(".daterangepickerdiv");
            }

            if (cur[index] > -1)
                $(dRPDiv).datepicker('setDate', new Date(cur[index]));

            $(dRPDiv).datepicker('refresh').show();
        });
    });
}

function LocalizeErrorMessages() {
    switch (GetFormLanguage()) {
        case 'en':
            // En is default
            break;

        default: // sk a default
            jQuery.extend(jQuery.validator.messages, {
                date: "Zadajte platný dátum.",
                dateISO: "Zadajte platný dátum (ISO)."
            });
    }
}

function InitDatePickerDateFormat() {
    $(".datepicker").datepicker({
        dateFormat: 'dd.mm.yy',
        onSelect: function (dateText, inst) {
            $(this).focusout();
        }
    });
    $(".datepickerISO").datepicker({
        dateFormat: 'yy-mm-dd',
        onSelect: function (dateText, inst) {
            $(this).focusout();
        }
    });
}

function InitDateTimePicker() {
    switch (GetFormLanguage()) {
        case 'en': // En is default
            $(".datetimepicker").datetimepicker({
                dateFormat: 'dd.mm.yy',
                onClose: function (dateText, inst) {
                    $(this).focusout();
                }
            });
            break;

        default: // sk a default
            $(".datetimepicker").datetimepicker({
                dateFormat: 'dd.mm.yy',
                timeOnlyTitle: 'Vyber dátum',
                timeText: 'Čas',
                hourText: 'Hodina',
                minuteText: 'Мinúta',
                secondText: 'Sekunda',
                currentText: 'Aktuálny',
                closeText: 'Vybrať',
                onClose: function (dateText, inst) {
                    $(this).focusout();
                }
            });
    }
}

function InitSectionAccordion() {
    $("form").InitSectionAccordion();
}

function InitRadio() {
    $("input[type='radio'][checked]").each(function() {
        var radio = $(this);
        if (radio.attr("disabled") !== undefined || radio.attr("readonly") !== undefined) {
            radio.attr("checked", "true");
        }

        radio.click();
    });
}

function InitButtons(context) {
	if (context == null) {
    $(".button").button();
    $("#cancelForm").click(TryRedirectToReturnUrl);
	} else {
		context.find(".button").button();
}
}

function InitPopUpDialog() {
    $("form").InitPopUpDialog();
}

var oTable;

function fnGetSelected(oTableLocal) {
    var aReturn = new Array();
    var aTrs = oTableLocal.fnGetNodes();

    for (var i = 0; i < aTrs.length; i++) {
        if ($(aTrs[i]).hasClass('row_selected')) {
            aReturn.push(aTrs[i]);
        }
    }
    return aReturn;
}

function InitDataTablePlugIn() {
    $.fn.dataTableExt.oApi.fnFilterOnReturn = function (oSettings) {
        var that = this;

        this.each(function (i) {
            $.fn.dataTableExt.iApiIndex = i;
            var anControl = $('input', that.fnSettings().aanFeatures.f);
            anControl.unbind('keyup').bind('keypress', function (e) {
                if (e.which == 13) {
                    $.fn.dataTableExt.iApiIndex = i;
                    that.fnFilter(anControl.val());
                }
            });
            return this;
        });
        return this;
    };
}

function initRepetitionSection(minRepetition, maxRepetition, sender) {
    if (minRepetition == 1) {
        var repetitiveCommands = $('div[id^=' + sender + ']').children('div[id^=repetitionCommands]');
        repetitiveCommands.children('span[id^=removeSection]').hide();
    }
    if (minRepetition > 1) {
        for (var i = 0; i < minRepetition; i++) {
            var addButton = $('div[id^=' + sender + ']').last().find('#addSection' + sender);
            addSection(minRepetition, maxRepetition, addButton);
        }
    }
    else if (minRepetition == 0 && ((projectType == "NEV" && $('div[id^=' + sender + ']').attr("isempty") != "false") || projectType != "NEV")) {
        var removeButton = $('div[id^=' + sender + ']').last().find('#removeSection' + sender);
        removeSection(minRepetition, removeButton);
    }
}

function parseId(sender, replaceText) {
    var id = sender.id;
    if (id == null) {
        id = sender[0].id;
    }
    return id.replace(replaceText, '');
}

function countSection(sender, replaceText) {
    if ($(sender).hasClass("closeButton") == true) {
        var layoutRow = $(sender).closest('div[id^=layoutRow]');
        var layoutRowId = layoutRow.attr("ID").split('_')[0];
        return layoutRow.parent().children().filter('div[id^=' + layoutRowId + ']').length;
    } else {
        return $(sender).parent().parent().parent().children().filter('div[id^=' + parseId(sender, replaceText) + ']').length;
    }
}

function RemoveDateRangePicker() {
    var dRPickerDivs = $(document).find(".daterangepickerdiv");
    var count = dRPickerDivs.length;
    // Odstranenie vsetkych potomkov vsetkym daterangepickerdivom
    for (var i = 0; i < count; i++) {
        if (dRPickerDivs[i]) {
            while (dRPickerDivs[i].firstChild && dRPickerDivs[i].children.length > 0) {
                dRPickerDivs[i].removeChild(dRPickerDivs[i].firstChild);
            }
        }
    }
    // Samotne odstranenie classy
    dRPickerDivs.removeClass("hasDatepicker");
}

function ReinitTabIndexIncrement(layoutRow) {
    var allLayoutRowElements = $(layoutRow).find("input[ID], select, textarea, a, area, button, object, .addRemoveSection, .lookupbutton, .infoIcon, .closeButton").sort(compareByTabIndex);
    var allPreviousLayoutRowElements = $(layoutRow).prev("[id^='" + $(layoutRow).attr('id') + "']").find("input[ID], select, textarea, a, area, button, object, .addRemoveSection, .lookupbutton, .infoIcon, .closeButton").sort(compareByTabIndex);

    if (allLayoutRowElements[0] && allLayoutRowElements[0].tabIndex && allPreviousLayoutRowElements[0] && allPreviousLayoutRowElements[0].tabIndex) {
        var allElements = $("input[ID], select, textarea, a, area, button, object, .addRemoveSection, .lookupbutton, .infoIcon, .closeButton").sort(compareByTabIndex);

        if (allElements) {
            var incrementRange = allLayoutRowElements[allLayoutRowElements.length - 1].tabIndex - allLayoutRowElements[0].tabIndex + 1;
            var incrementSubRepeatingRange = allPreviousLayoutRowElements[allPreviousLayoutRowElements.length - 1].tabIndex - allLayoutRowElements[allLayoutRowElements.length - 1].tabIndex;

            $(allElements).each(function () {
                if (this.tabIndex > allPreviousLayoutRowElements[allPreviousLayoutRowElements.length - 1].tabIndex)
                    this.tabIndex = this.tabIndex + incrementRange;
            });

            $(allLayoutRowElements).each(function () {
                this.tabIndex = this.tabIndex + incrementSubRepeatingRange + incrementRange;
            });
        }
    }
}

function ReinitTabIndexDecrement(layoutRow) {
    var allLayoutRowElements = $(layoutRow).find("input[ID], select, textarea, a, area, button, object, .addRemoveSection, .lookupbutton, .infoIcon, .closeButton").sort(compareByTabIndex);

    if (allLayoutRowElements[0] && allLayoutRowElements[0].tabIndex) {
        var allElements = $("input[ID], select, textarea, a, area, button, object, .addRemoveSection, .lookupbutton, .infoIcon, .closeButton").sort(compareByTabIndex);

        if (allElements) {
            var incrementRange = allLayoutRowElements[allLayoutRowElements.length - 1].tabIndex - allLayoutRowElements[0].tabIndex + 1;

            $(allElements).each(function () {
                if (this.tabIndex > allLayoutRowElements[allLayoutRowElements.length - 1].tabIndex)
                    this.tabIndex = this.tabIndex - incrementRange;
            });
        }
    }
}

function addSection(minRepetition, maxRepetition, sender) {
    DeleteMultiCombobox();
    // Potrebne odstranit daterangepicker este pred clone
    RemoveDateRangePicker();
    var layoutRow = $(sender).closest('div[id^=layoutRow]');
    var firstLayoutRow = GetRepeatingSections(layoutRow).first();
    var layoutRowCopy = firstLayoutRow.clone();

    if (firstLayoutRow.attr("isempty") == "true") {
        layoutRowCopy.removeAttr("isempty");
        layoutRowCopy.children("#layoutRowContent" + firstLayoutRow.attr("id")).show();
    }

	if (typeof LoadSectionHtmlFragment == 'vucAddSection') { // we are loaded in VUC configuration (function in p_vuc.js)
		vucAddSection(layoutRowCopy);
	}
    var sectionsCount = countSection(sender, 'addSection');
    var isSectionListEmpty = layoutRow.attr('isEmpty');
    var sectionCountForX = countSection(sender, "");

    if (sectionsCount == 1 && isSectionListEmpty == 'true')
        sectionsCount = 0;

    if (sectionsCount >= maxRepetition)
        return alert('Dosiahli ste maximálny počet opakovania zvolenej sekcie.');

    if (sectionsCount == 0) {
        layoutRow.children('div[id^=layoutRowContent]').show().ToggleValidators(false); //bug by "style" atribute
        layoutRow.children('div[id^=repetitionCommands]').children('span[id^=removeSection]').show(); //IE bug by "Odobrať" button
        layoutRow.children('.closeButton').show();
        layoutRow.attr("isEmpty", "false");
        layoutRow.find('input[type="radio"]:checked').each(function () {
            $(this).click();
        });
        layoutRow.IncrementFieldIds();
    }
    else {
        layoutRowCopy.ToggleValidators(false);
        layoutRowCopy.toggleClass('hiddenSection', false);
        layoutRowCopy.ClearFormElements()
            .ResetRepetitionSection()
            .InitSectionAccordion()
            .RemoveDatePickerClass()
            .InitRemoteCombobox()
            .InitPopUpDialog()
            .InitHelp()
            .InitHierarchicallyTree();
        layoutRow.after(layoutRowCopy);
        layoutRowCopy.IncrementFieldIds();
        ReinitTabIndexIncrement(layoutRowCopy);
    }

    InitPickers();
    InitHelp();
    InitMultiCombobox();
    IncrementDecrementSectionId(layoutRowCopy);

    //Ak pridavana sekcia je poslena mozna (maxrepetition) skryjem jej button Pridaj
    var repetitiveCommands = layoutRowCopy.children('div[id^=repetitionCommands]');
    var addButton = repetitiveCommands.children('span[id^=addSection]');
    var removeButton = repetitiveCommands.children('span[id^=removeSection]');
    if ((sectionsCount + 1) == maxRepetition) {
        if (minRepetition == 0 && maxRepetition == 1) {
            layoutRow.children('div[id^=repetitionCommands]').children('span[id^=addSection]').hide();
        } else {
            addButton.hide();
        }
    }

    if (sectionsCount > 0) {
        //Na pridanej sekcii zobrazim button Odober

        removeButton.show();
        //Na predchadzajucej sekcii skryjem command bar
        layoutRow.children('div[id^=repetitionCommands]').hide();
    }

    if ((sectionsCount + 1) == minRepetition)
        removeButton.hide();

    InitRepetitionSections(layoutRowCopy);
    layoutRowCopy.ReinitializeConditionalRules().ReinitRadioDefaultCheck();
    HideShowX(layoutRow, sectionCountForX + minRepetition, -1);
    InitXInCopySection(layoutRowCopy);
}

function removeSection(minRepetition, sender) {
    var layoutRow = $(sender).closest('div[id^=layoutRow]');
    var layoutRowPrevious = layoutRow.prev('div[id^=layoutRow]');
    var sectionsCount = countSection(sender, 'removeSection');
    var sectionCountForX = countSection(sender, "");
    var layoutRowIdClean = layoutRow.attr("id").split('_')[0].replace("removeSection", "");

    if (sectionsCount == minRepetition)
        return alert('Sekciu nie je možné odobrať.');

    var children = layoutRowPrevious.children('div[id^=repetitionCommands]');
    if (sectionsCount == minRepetition && sectionsCount > 1)
        children.children('span[id^=removeSection]').hide();

    if (sectionsCount == 1) {
        layoutRow.attr("isEmpty", "true");
        layoutRow.children('div[id^=layoutRowContent]').hide().ToggleValidators(true);
        layoutRow.IncrementFieldIds();
        layoutRow.ReinitializeConditionalRules();

        var repetitionCommands = layoutRow.children('div[id^=repetitionCommands]');
        layoutRow.children('.closeButton').hide();
        repetitionCommands.children('span[id^=addSection]').show();
        return repetitionCommands.children('span[id^=removeSection]').hide();
    }

    ReinitTabIndexDecrement(layoutRow);
    children.show();

    if ($(sender).hasClass("closeButton") || (sectionsCount - 1) == 1) {
        if (!$(sender).hasClass("closeButton")) { sectionCountForX = sectionsCount - 1; }
        HideShowX(layoutRow, sectionCountForX - 1, minRepetition);
    }

    if ($(sender).hasClass("closeButton")) {
        HideAndShowRemoveBtns(layoutRow.siblings("div[id^='" + layoutRowIdClean + "']"), sectionCountForX - 1, minRepetition);
    }

    layoutRow.remove();

    if ((sectionsCount - 1) == minRepetition) {
        children.children('span[id^=removeSection]').hide();
    }
    children.children('span[id^=addSection]').show();

    if (layoutRowPrevious[0]) {
        $(layoutRowPrevious).IncrementFieldIds();
        IncrementDecrementSectionId(layoutRowPrevious);
        IncrementDecrementInnerRepeatingIds(layoutRowPrevious);
    } else {
        var layoutRowPom = $("[id^='" + layoutRowIdClean + "']")[0];
        $(layoutRowPom).IncrementFieldIds().ReinitializeConditionalRules();
        RemoveRepSecClass(layoutRowPom);
        IncrementDecrementSectionId(layoutRowPom);
        IncrementDecrementInnerRepeatingIds(layoutRowPom);
    }

    var layoutRowAll = $("[id^='" + layoutRowIdClean + "']"); // vyber opakovacky
    $(layoutRowAll).each(function () {
        $(this).RemoveDatePickerClass();// resetne datepicker sekcie ktoru mazeme
    });
    InitPickers(); // opetovna inicializacia
}

function RemoveRepSecClass(sender) {
    var layoutRowIdClean = $(sender).attr("id").split('_')[0];
    var lr = $(document).find("div[id^='" + layoutRowIdClean + "']:first");
    lr.removeClass("repeatingSection");
    lr.find(".repeatingSection").each(function () {
        $(this).removeClass("repeatingSection");
    });
}

function HideShowX(sender, sectionCount, minRepetition) {
    var layoutRowIdClean = sender.attr("id").split('_')[0];
    var layoutRows = sender.parent().children("div[id^='" + layoutRowIdClean + "']");
    var layoutRowsCount = layoutRows.length;

    if ((layoutRowsCount - 1) == 1 && minRepetition != -1) {
        var lr = $(sender).children('div[id^=layoutRow]');
        layoutRows.children('.closeButton').hide();
    } else if (layoutRowsCount > 1)
        layoutRows.each(function () {
            $(this).children('.closeButton').show();
        });
}

function HideAndShowRemoveBtns(layoutRows, sectionCount, minRepetition) {
    if (minRepetition != -1) {
        var count = 0;
        layoutRows.each(function () {
            if (count != layoutRows.length - 1)
                $(this).children('div[id^=repetitionCommands]').hide();
            else {
                if ((layoutRows.length) == minRepetition) {
                    $(this).children('div[id^=repetitionCommands]').children('span[id^=removeSection]').hide();
                } else {
                    $(this).children('div[id^=repetitionCommands]').show();
                    $(this).children('div[id^=repetitionCommands]').children('span[id^=addSection]').show();
                }
            }
            count++;
        });
    }
}

function InitXInCopySection(sender) {
    var subSection = $(sender).children("[id^='layoutRowContentlayoutRow']");
    subSection.find('.closeButton').each(function () {
        $(this).hide();
    });
}

$.fn.NewGuid = function () {
    function p8(s) {
        var p = (Math.random().toString(16) + "000000000").substr(2, 8);
        return s ? "-" + p.substr(0, 4) + "-" + p.substr(4, 4) : p;
    }
    return p8() + p8(true) + p8(true) + p8();
};

function SwitchSections(switchesToSections, context, isCheckBoxList) {
    if (typeof context === "object")
        throw "kontext nemôže byť objekt";

    context = $('div[id^=' + context + ']');

    for (var singleSwitch in switchesToSections) {
        for (var section in switchesToSections[singleSwitch]) {
            if (switchesToSections[singleSwitch][section].indexOf('^=') == -1 && switchesToSections[singleSwitch][section] != '')
                switchesToSections[singleSwitch][section] = '[id^=' + switchesToSections[singleSwitch][section].replace('#', '') + ']';
        }
    }

    if (context[0] === "undefined")
        throw "neznámy kontext";

    if (isCheckBoxList == true)
        context.HideSwitchSections(switchesToSections);

    context.SwitchSections(switchesToSections, isCheckBoxList);
}

function FindValueInXml(elementName, xmlDoc) {
    var $xml = $(xmlDoc);
    var $xmlValue = $xml.find(elementName);
    return $xmlValue.text();
}

// WCF  Validation Service


function AddValidationMessage(index, item, valMsg) {
    var input = $(item);
    var key = input.attr("key");
    var order = (input.attr("order") == null || input.attr("order") == undefined) ? 0 : input.attr("order");

    if (key != null) {
        var postfix = order == 0 ? "" : "-" + order;
        var keyName = key + postfix;
        if ($("#" + keyName).length == 0) {
            return false;
        }

        if (valMsg[keyName] == undefined)
            valMsg[keyName] = input.text() + '</br>';
        else
            valMsg[keyName] += input.text() + '</br>';

        return true;
    }

    //ak je false, znamena, ze sa nedal najst ziaden input a treba to evidovat ako xslt error
    return false;
}

function TryRedirectToReturnUrl() {
    var returnUrl = $.GetUrlParam("ReturnUrl");

    if (returnUrl != 0)
        self.location.href = unescape(returnUrl);
}

function htmlEncode(value) {
    value = value.replace(/\n/gi, "%0A");
    value = value.replace(/\\/gi, "%0B");
    value = value.replace(/"/gi, "%0X");
    return $('<div/>').text(value).html();
}

var baseMargin = 4;
function Layout() {
    var templateSection = $(this);
    var parentCellCount = templateSection.parents("div[class^='cell ']").length;
    var margin = (parentCellCount + 1) * baseMargin;
    if (margin > baseMargin && templateSection.children().children("div[class^='caption ']").css('border-left-width') == '1px') {
        margin -= baseMargin;
    }
    templateSection.css('margin-left', '-' + margin + 'px');
    templateSection.find('label').each(Move);
}

function Move() {
    var label = $(this);
    label.css('margin-left', "-" + parseInt(label.parents("div[adjustposition^='true']").css('margin-left').replace("-", "").replace("px", "") - baseMargin) + 'px');
    label.width(label.width() + 16);
}

///////////////////////////////////////// ML /////////////////////////////////////////
///////////////////////////// Funkcia Hodnota pre ML /////////////////////////////////

function HodnotaTypPola(element, nazov) {
    var value = 0;

    var elements;

    if (!element) {
        elements = $('#' + nazov);
        if (!elements || elements.length == 0)
            elements = $("[name='" + nazov + "']");
        element = elements[0];
    }

    if (element.type == 'select-one') {
        value = document.getElementById(nazov).selectedIndex;
    }
    else if (element.type == 'radio') {
        //je radiobutton
        //je radiobuttonlist
        //kod je univerzalny, zafunguje aj aj
        value = 0;
        for (i = 0; i < elements.length; i++) {
            if (elements[i].checked) {
                value = i + 1; //vrat index oznaceneho pola od 1 - n
                break;
            }
        }
    }
    else if (element.type == 'checkbox') {
        //je checkbox
        if (element.checked) {
            value = 1;
        }
        else {
            value = 0;
        }
    }
    else {
        value = element.value;
    }

    return value;
}

function hodnota(element, nazov, opak_typ, sid, layoutNazov, dataType) { // sid je indexovany od 0..
    var tstr;

    ////////////////////////////////////////////////////////////////////////// zaciatok opakovana
    if (opak_typ == 'o') {
        if (element == null) {
            if (sid == 0 || sid == -1)
                tstr = HodnotaTypPola(null, nazov);  //document.getElementById(nazov).value;
            else
                tstr = HodnotaTypPola(null, GetElementIncrementalValue(nazov, sid)); //document.getElementById(GetIncrementalValue(nazov, sid)).value;
        } else {
            tstr = HodnotaTypPola(element, nazov);
        }
    } else
        ////////////////////////////////////////////////////////////////////////// koniec opakovana
        ////////////////////////////////////////////////////////////////////////// zaciatok strankovana
        if (opak_typ == 's' || opak_typ == 'p') {
            var section = $('#' + layoutNazov).pageableSection();
            if (section && section.currentPage != sid + 1) {
                var temp = section.getValueFor(nazov, sid + 1);
                if (typeof temp === 'boolean') {
                    tstr = temp ? 1 : 0;
                } else {
                    tstr = temp;
                }
            } else {
                tstr = HodnotaTypPola(element, nazov);
            }
        } else
            ////////////////////////////////////////////////////////////////////////// koniec strankovana
            ////////////////////////////////////////////////////////////////////////// zaciatok normalna
            if (opak_typ == 'n') {
                tstr = HodnotaTypPola(element, nazov);
            }
    ////////////////////////////////////////////////////////////////////////// koniec opakovania
    if (tstr == null && dataType == 'x')
        return '';
    if (tstr != null && dataType == 'x')
        return tstr.toString();
    if (tstr == null || tstr === undefined || tstr == '')
        return 0;
    //tstr = 0;

    //ak je datovy typ string, vrat dlzku retazca
    if (dataType == 's') {
        /*
        if (tstr == 0) {
        return 0;
        }
        */
        if (tstr.length) {
            return tstr.length;
        }
    }
    return parseFloat(tstr);
}

//////////////////////////////////////////////////////////////


/////////////////// Strankovacie sekcie //////////////////////


(function ($, undefined) {
    'use strict';

    function PageableSection() {

        if (!(this instanceof PageableSection)) {
            return new PageableSection();
        }

        this.section = null;
        this.pager = null;
        this.currentPageLabel = null;
        this.totalPagesLabel = null;
        this.prevPageButton = null;
        this.nextPageButton = null;
        this.addPageButton = null;
        this.removePageButton = null;

        this.currentPage = 1;
        this.totalPages = 1;

        this.pages = [];
        this.defaultValues = {};

        this.options = {
            namespace: '.pageable-section',
            validator: null,
            sectionName: '',
            xmlNodeName: '',
            min: 1,
            max: 5
        };
    }

    $.extend(PageableSection.prototype, {
        init: function (target, userOptions) {
            $.extend(true, this.options, userOptions);

            var self = this,
			    options = self.options,
			    namespace = options.namespace;

            // section
            this.section = $(target);

            if (!options.sectionName) {
                options.sectionName = this.section[0].id;
            }

            if (!options.xmlNodeName) {
                options.xmlNodeName = $('input:hidden', this.section)[0].name;
            }

            // min, max
            var min = this.section.data('section-min') * 1,
			    max = this.section.data('section-max') * 1;

            if (!isNaN(min)) {
                options.min = min;
            }
            if (!isNaN(max)) {
                options.max = max;
            }

            // pager
            this.pager = $('.sectionPager', this.section);
            this.currentPageLabel = $('.currentPage', this.pager);
            this.totalPagesLabel = $('.totalPage', this.pager);
            this.prevPageButton = $('.prevPageButton', this.pager);
            this.nextPageButton = $('.nextPageButton', this.pager);
            this.addPageButton = $('.addPageButton', this.pager);
            this.gotoPageButton = $('.gotoPageButton', this.pager);
            this.removePageButton = $('.removePageButton', this.pager);

            this.prevPageButton
				.unbind(namespace)
				.bind('click' + namespace, $.proxy(function (e) {
				    e.preventDefault();
				    this.previousPage();
				}, this));

            this.nextPageButton
				.unbind(namespace)
				.bind('click' + namespace, $.proxy(function (e) {
				    e.preventDefault();
				    this.nextPage();
				}, this));

            this.addPageButton
				.unbind(namespace)
				.bind('click' + namespace, $.proxy(function (e) {
				    e.preventDefault();
				    this.addPage();
				}, this));

            this.removePageButton
				.unbind(namespace)
				.bind('click' + namespace, $.proxy(function (e) {
				    e.preventDefault();
				    this.removePage();
				}, this));

            this.gotoPageButton
				.unbind(namespace)
				.bind('click' + namespace, $.proxy(function (e) {
				    e.preventDefault();
				    var currentInput = $(e.currentTarget).next();
				    if (isNaN(parseInt(currentInput.val()))) {
				        var strana = this.currentPage;
				        currentInput.val("");
				    } else {
				        var strana = parseInt(currentInput.val());
				        currentInput.val("");
				    }
				    this.goToPage(strana);
				}, this));

            this.currentPageLabel.text(this.currentPage);
            this.totalPagesLabel.text(this.totalPages);

            this.updateButtons();
            this.saveCurrentPage();
            this.saveDefaultValues();
        },

        previousPage: function () {
            if (this.currentPage <= 1) {
                return;
            }

            if (this.currentPage <= this.totalPages)
                this.saveCurrentPage();
            this.currentPage--;
            this.currentPageLabel.text(this.currentPage);

            this.resetLayout();

            this.loadCurrentPage();
        },

        nextPage: function () {
            if (this.currentPage >= this.totalPages) {
                return;
            }

            this.saveCurrentPage();

            this.currentPage++;
            this.currentPageLabel.text(this.currentPage);

            this.resetLayout();
            this.loadCurrentPage();
        },

        addPage: function () {
            if (this.totalPages >= this.options.max) {
                return;
            }

            this.totalPages++;
            this.totalPagesLabel.text(this.totalPages);
            this.updateButtons();

            this.saveCurrentPage();
            this.currentPage = this.totalPages;
            this.currentPageLabel.text(this.currentPage);

            this.resetLayout();
            this.saveCurrentPage();
        },

        removePage: function () {
            if (this.totalPages <= this.options.min) {
                return;
            }

            this.totalPages--;
            this.totalPagesLabel.text(this.totalPages);
            this.updateButtons();

            this.removeCurrentPage();
            this.resetLayout();
            if (this.currentPage > this.totalPages) {
                this.previousPage();
            } else {
                this.loadCurrentPage();
            }
        },

        updateButtons: function () {
            this.addPageButton.toggle(this.totalPages < this.options.max);
            this.removePageButton.toggle(this.totalPages > this.options.min);
        },

        resetLayout: function () {
            $(':text, :password, :file, select, textarea', this.section).each($.proxy(function (_, input) {
                if (input.id) {
                    $(input).val(this.defaultValues[input.id] || '');
                } else {
                    $(input).val('');
                }
            }, this));

            $(':radio, :checkbox', this.section).each($.proxy(function (_, input) {
                if (input.id) {
                    input.checked = this.defaultValues[input.id] || false;
                } else {
                    input.checked = false;
                }
            }, this));

            var validator = this.options.validator;
            if (validator && validator.settings) {
                var error = validator.settings.errorClass,
				    warning = validator.settings.warningClass;

                $('.' + error + ', .' + warning, this.section).removeClass(error + ' ' + warning);
            }
        },

        saveDefaultValues: function () {
            var inputs = $(':text, :password, :file, select, textarea', this.section);

            var defaults = {};
            $.each(inputs, function (_, input) {
                if (input.id) {
                    defaults[input.id] = input.value;
                }
            });

            var checkable = $(':radio, :checkbox', this.section);
            $.each(checkable, function (_, input) {
                if (input.id) {
                    defaults[input.id] = input.checked;
                }
            });

            this.defaultValues = defaults;
        },

        saveCurrentPage: function () {
            var radioButtonLists = [];

            var getErrorType = $.proxy(function ($element) {
                var validator = this.options.validator;
                if (validator && validator.settings) {
                    if ($element.hasClass(validator.settings.errorClass)) {
                        return 'e';
                    } else if ($element.hasClass(validator.settings.warningClass)) {
                        return 'w';
                    }
                }
            }, this);

            var values = $.map($(':input', this.section), $.proxy(function (input) {
                if (input.id) {
                    var $input = $(input),
					    result = { key: input.id, value: $input.val() };
                    if ($input.is(':radio')) {
                        var list = $input.closest('.radioButtonList');
                        if (list.length) {
                            var radioButtonListName = input.name;
                            if ($.inArray(radioButtonListName, radioButtonLists) >= 0) {
                                return;
                            }

                            var inputs = list.find(':radio');
                            var checked = inputs.filter(':checked');
                            var value = checked.val();
                            radioButtonLists.push(radioButtonListName);
                            result.value = value || '';
                            result.key = radioButtonListName;
                            result.rb = {
                                list: list,
                                name: radioButtonListName,
                                checked: checked
                            };

                            var errorTypes = [];
                            $.each(inputs, $.proxy(function (_, radio) {
                                var et = getErrorType($(radio));
                                if (et) {
                                    errorTypes.push(et);
                                }
                            }, this));

                            result.rb.errorTypes = errorTypes;
                        } else {
                            result.value = $input.is(':checked');
                        }
                    } else if ($input.is(':checkbox')) {
                        result.value = input.checked;
                    }

                    var errorType = getErrorType($input);
                    if (errorType) {
                        result.errorType = errorType;
                    }

                    return result;
                }
            }, this));

            if (this.pages.length) {
                var current = this.pages[this.currentPage - 1];
                if (current) {
                    current.values = values;
                    return;
                }
            }

            this.pages.splice(this.currentPage - 1, 0, { values: values });
        },

        removeCurrentPage: function () {
            if (this.pages.length && this.pages.length >= this.currentPage) {
                this.pages.splice(this.currentPage - 1, 1);
            }

            if (this.options.validator) {
                this.options.validator.removeAllSectionErrors(this.getSectionName(), this.currentPage);
            }
        },

        _loadRadioButtonList: function (value) {
            var list = value.rb.list;
            list.find(':radio').each(function (_, radio) {
                radio.checked = radio.value === value.value;
            });
        },

        loadCurrentPage: function () {
            if (this.pages.length && this.pages.length >= this.currentPage) {
                var current = this.pages[this.currentPage - 1];
                if (current && current.values) {
                    for (var j = 0; j < current.values.length; j++) {
                        var value = current.values[j],
						    rb = value.rb;

                        if (rb) {
                            this._loadRadioButtonList(value);
                            continue;
                        }

                        var $input = $('#' + value.key, this.section);
                        if (!$input || $input.length === 0) { //radio v strankovacich sekciach
                            if (value.value !== '0') {
                                $input = $('input[name="' + value.key + '"]', this.section);
                                $input[value.value - 1].checked = true;
                            }
                        }
                        else {
                            if ($input.is(':radio') || $input.is(':checkbox')) {
                                $input[0].checked = (value.value === true || value.value == '1');
                                continue;
                            }
                            $input.val(value.value);

                            if (value.errorType) {
                                var validator = this.options.validator;
                                if (validator && validator.settings) {
                                    if (value.errorType === 'e') {
                                        $input.addClass(validator.settings.errorClass);
                                    } else if (value.errorType === 'w') {
                                        $input.addClass(validator.settings.warningClass);
                                    }
                                }
                            }
                        }
                    }
                }
            }
        },

        goToPage: function (page) {
            if (page > this.totalPages) {
                page = this.totalPages;
            }

            if (page < 1) {
                page = 1;
            }

            this.saveCurrentPage();
            this.currentPage = page;
            this.currentPageLabel.text(this.currentPage);
            this.resetLayout();
            this.loadCurrentPage();
        },

        getSectionName: function () {
            return this.options.sectionName || '';
        },

        getSectionXmlNodeName: function () {
            return this.options.xmlNodeName || '';
        },

        getCurrentPage: function () {
            return this.currentPage;
        },

        focusin: function (elementId) {
            if (elementId) {
                $('#' + elementId, this.section).focus();
            }
        },

        getValueFor: function (elementId, page) {
            if (this.totalPages > 0 && page === this.currentPage) {
                this.saveCurrentPage();
            }

            if (this.pages.length) {
                page = page || 1;
                if (page > this.pages.length) {
                    return '';
                }

                var pageValues = this.pages[page - 1];

                for (var i = 0; i < pageValues.values.length; i++) {
                    var value = pageValues.values[i];
                    if (value.key === elementId) {
                        return value.value || '';
                    }
                }
            }

            return '';
        },

        getValuesFor: function (elementId) {
            var result = [];

            if (this.totalPages > 0) {
                this.saveCurrentPage();
            }

            for (var i = 0; i < this.pages.length; i++) {
                var pageValues = this.pages[i];

                for (var j = 0; j < pageValues.values.length; j++) {
                    var value = pageValues.values[j];
                    if (value.key === elementId) {
                        result.push(value.value || '');
                    }
                }
            }

            return result;
        },

        validatePage: function (page) {
            if (this.totalPages < page) {
                return;
            }

            var pageValues = this.pages[page - 1].values;

            var validator = this.options.validator;
            if (!validator) {
                return;
            }

            validator.sectionScope = {
                name: this.getSectionName(),
                page: page,
                values: pageValues
            };

            for (var i = 0; i < pageValues.length; i++) {
                var pageValue = pageValues[i];
                var elem = $('#' + pageValue.key, this.section)
                if (!elem || elem.length === 0) {
                    elem = $('input[name="' + pageValue.key + '"]', this.section)[0];
                }
                validator.check(elem);
            }

            delete validator.sectionScope;
        },

        validate: function () {
            if (this.totalPages > 0) {
                this.saveCurrentPage();
            }

            for (var i = 1; i <= this.totalPages; i++) {
                this.validatePage(i);
            }
        },

        validateElementOnPage: function (elementId, page, ruleName) {
            if (this.totalPages < page) {
                return;
            }

            if (this.totalPages > 0) {
                this.saveCurrentPage();
            }

            var pageValues = this.pages[page - 1].values;
            var validator = this.options.validator;
            if (!validator) {
                return;
            }

            validator.sectionScope = {
                name: this.getSectionName(),
                page: page,
                values: pageValues,
                ruleName: ruleName
            };

            validator.element($('#' + elementId, this.section));
            delete validator.sectionScope;
        },

        resetSection: function () {
            this.pages = [];

            this.totalPages = 1;
            this.totalPagesLabel.text(this.totalPages);

            this.currentPage = 1;
            this.currentPageLabel.text(this.currentPage);

            this.updateButtons();

            this.resetLayout();
        },

        structure: null,

        buildUpStructure: function () {
            var section = this.section;
            var rows = $('.layoutRow', section)
				.filter(function (_, row) {
				    return $(row).attr('isempty') !== 'true';
				}).map(function (_, row) {
				    var $row = $(row);
				    return { id: row.id, node: $row.children('input:hidden').attr('name'), parent: $row.parent().closest('.layoutRow')[0], element: row };
				});

            var sectionElement = section[0];

            this.structure = {
                id: sectionElement.id,
                node: section.children('input:hidden').attr('name'),
                parent: null,
                element: sectionElement
            };

            var buildRowsRecursive = function (parent) {
                parent.children = $.grep(rows, function (row) {
                    return row.parent === parent.element;
                });

                if (parent.children && parent.children.length) {
                    $.each(parent.children, function (_, child) {
                        buildRowsRecursive(child);
                    });
                }
            };

            if (rows.length) {
                buildRowsRecursive(this.structure);
            }

            var elements = $(':input:not(:hidden)', section).map(function (_, element) {
                var $element = $(element);
                return { id: element.id, name: element.name, element: element, parent: $element.closest('.layoutRow')[0] };
            });

            var buildElementsRecursive = function (parent) {
                parent.elements = $.grep(elements, function (element) {
                    return element.parent === parent.element;
                });

                if (parent.children && parent.children.length) {
                    $.each(parent.children, function (_, child) {
                        buildElementsRecursive(child);
                    });
                }
            };

            if (elements.length) {
                buildElementsRecursive(this.structure);
            }
        },

        writeXml: function (sb, page) {
            if (!this.structure) {
                this.buildUpStructure();
            }

            if (!sb) {
                sb = new $.StringBuilder();
            }

            var writeRecursive = function (parent) {

                sb.append('<' + parent.node + '>');

                var index = 0;
                var lastRadio = '$$$';
                var lastRadioEmpty = true;
                $.each(parent.elements, function (_, element) {
                    index++;
                    var pair = $.grep(page.values, function (value) {
                        return value.key === element.id;
                    })[0];
                    element = element.element;
                    if ($(element).is(':radio')) {
                        if (lastRadio != element.name) {
                            if (lastRadioEmpty && lastRadio != '$$$') {
                                sb.append('<' + lastRadio + '>' + 0 + '</' + lastRadio + '>');
                            }
                            lastRadio = element.name;
                            lastRadioEmpty = true;
                        }
                        if (pair && pair.value === true) {
                            sb.append('<' + element.name + '>' + index + '</' + element.name + '>');
                            lastRadioEmpty = false;
                        }
                    } else if ($(element).is(':checkbox')) {
                        sb.append('<' + pair.key + '>' + (pair.value !== undefined && (pair.value === true || pair.value == '1') ? 1 : 0) + '</' + pair.key + '>');
                    } else {
                        if (pair) {
                            if (pair.value && pair.value.length > 0) {
                                if ($(element).attr('isempty') == undefined || $(element).attr('isempty') == "false") {
                                    if ($(element).attr("class") && $(element).attr("class").indexOf("date") != -1) {
                                        var value = pair.value;
                                        if ($(element).is('[class*=date]')) {
                                            value = xmlHelper.toXmlDate(value);
                                        }
                                        sb.append('<' + pair.key + '>' + value + '</' + pair.key + '>');
                                    } else {
                                        sb.append('<' + pair.key + '>' + pair.value + '</' + pair.key + '>');
                                    }
                                }
                            } else {
                                //sb.append('<' + pair.key + ' />');
                            }
                        } else {
                            //sb.append('<' + element + ' />');
                        }
                    }
                });
                if (lastRadioEmpty && lastRadio != '$$$') {
                    sb.append('<' + lastRadio + '>' + 0 + '</' + lastRadio + '>');
                }

                if (parent.children) {
                    $.each(parent.children, function (_, child) {
                        writeRecursive(child);
                    });
                }

                sb.append('</' + parent.node + '>');

            };

            writeRecursive(this.structure);
        },

        loadXml: function (xmlNode, nodeName) {
            if (!xmlNode || !xmlNode.childNodes) {
                return;
            }

            this.resetSection();

            if (!this.structure) {
                this.buildUpStructure();
            }

            var loadXmlRecursive = function (structureNode, sectionNode, values) {
                if (!sectionNode || !sectionNode.childNodes) {
                    return;
                }
                for (var j = 0; j < sectionNode.childNodes.length; j++) {
                    var sectionChildNode = sectionNode.childNodes[j];

                    var possibleSections = $.grep(structureNode.children, function (child) {
                        return child.node === sectionChildNode.nodeName;
                    });

                    if (possibleSections.length) {
                        loadXmlRecursive(possibleSections[0], sectionChildNode, values);
                    }

                    var possibleElements = $.grep(structureNode.elements, function (element) {
                        if ($(element.element).is(':radio')) {
                            return element.name === sectionChildNode.nodeName;
                        }
                        else {
                            return element.id === sectionChildNode.nodeName;
                        }
                    });

                    if (possibleElements.length) {
                        var value = sectionChildNode.firstChild.nodeValue;
                        var element = possibleElements[0];
                        if ($(element.element).is('[class*=date]')) {
                            value = xmlHelper.fromXmlDate(value);
                        }
                        if ($(element.element).is(':checkbox'/*, :radio'*/)) {
                            value = value === '1';
                        }
                        values.push({ key: sectionChildNode.nodeName, value: value });
                    }
                }
            };

            for (var i = 0; i < xmlNode.childNodes.length; i++) {
                var childNode = xmlNode.childNodes[i];

                if (childNode.nodeName !== nodeName) {
                    continue;
                }

                var values = [];
                loadXmlRecursive(this.structure, childNode, values);
                this.pages.push({ values: values });
            }

            this.totalPages = this.pages.length || 1;
            this.totalPagesLabel.text(this.totalPages);

            this.loadCurrentPage();
        }
    });

    $.fn.pageableSection = function (options) {
        var self = this;

        if (!options) {
            return self.data('pageable-section');
        } else {
            return $.each(self, function (_, element) {
                var section = new PageableSection();
                section.init(element, options);

                $(element).data('pageable-section', section);
            });
        }
    };
})(jQuery);

/////////////////////////////////////////////////////////////////


//////////////////////// Funkcie pre ML //////////////////////////

function zaokruhli_dole(cislo, poc_desatin) {
    vrat = cislo;
    pomb = Math.pow(10, poc_desatin);
    poma = cislo * pomb;
    vrat = Math.floor(poma + 0.00000001) / pomb;
    return vrat.toFixed(poc_desatin);
}

function zaokruhli_dolemj(poc_desatin, cislo) {
    vrat = cislo;
    pomb = Math.pow(10, poc_desatin);
    poma = cislo * pomb;
    vrat = Math.floor(poma + 0.00000001) / pomb;
    return vrat.toFixed(poc_desatin);
}

function zaokruhli_hore(cislo, poc_desatin) {
    vrat = cislo;
    pomb = Math.pow(10, poc_desatin);
    poma = cislo * pomb;
    vrat = Math.ceil(poma) / pomb;
    return vrat.toFixed(poc_desatin);
}

function zaokruhli_horemj(poc_desatin, cislo) {
    vrat = cislo;
    pomb = Math.pow(10, poc_desatin);
    poma = cislo * pomb;
    vrat = Math.ceil(poma) / pomb;
    return vrat.toFixed(poc_desatin);
}


function zaokruhli_mate(cislo, poc_desatin) {
    vrat = cislo;
    pomb = Math.pow(10, poc_desatin);
    poma = cislo * pomb;
    vrat = Math.round(poma) / pomb;
    return vrat.toFixed(poc_desatin);
}

function zaokruhli_matmj(poc_desatin, cislo) {
    vrat = cislo;
    pomb = Math.pow(10, poc_desatin);
    poma = cislo * pomb;
    vrat = Math.round(poma) / pomb;
    return vrat.toFixed(poc_desatin);
}

function cislo_znamienko(cislo) {
    vrat = cislo;
    if (cislo > 0) { vrat = '+' + vrat; }
    return vrat;
}

function sum_opak(element) {
    var sum = '';

    $("[id^='" + element + "']").each(function () {
        if (!isNaN(this.value))
            sum = Number(sum) + Number(this.value);
    });

    return sum;
}

function count_opak(element) {
    return $("[id^='" + element + "']").length;
}

///////////////////////////////////////////////////////////////
/* ]]> */
						</script><script type="text/javascript">
							/* <![CDATA[ */
var disableValidatorPostfix = "_SectionIncrement_";
var disableValidatorPrefix = "DoNotValidate_";
var repeatingPostfix = "_Repeating_";
//////////////// ML //////////////
var repeatingElementPostfix = "-";
/////////////////////////////////

var count = 0;
var fieldIndex = 0;
var sign = "-";
var disableValidators = "disableValidators";

function GetLookupUri() {
    try {
        if (lookupUri != undefined) {
            return lookupUri;
        }
    } catch (err) { }

    return 'https://www.slovensko.sk/static/util/Filler/lookup.aspx';
}

$.fn.InitHierarchicallyTree = function () {
    //ak su nejake hierarchicke componenty
    var hierarchicalTries = this.find(".hierarchicalTree");

    if (hierarchicalTries.length == 0) {
        return this;
    }

    //ziskanie adresy sluzby
    var url = GetLookupUri();

    //nacitanie adresy sluzby
    var loadChildren = function (node, level, nodeId, callback, lookupID, lookupSource) {
        var data = 'id=' + lookupID + '&lookupSource=' + lookupSource;
        if (nodeId != null) {
            data += "&parentId=" + nodeId;
        }

        $.ajax({
            async: true,
            url: url,
            data: data,
            dataType: "jsonp"
        }).done(function (data) {
            if (data.iTotalDisplayRecords == 0) {
                node.has_children = false;
                node.busy = false;
                delete node.children[0];
            }
            else {

                for (var i = 0; i < data.aaData.length; i++) {
                    node.children.push({
                        id: data.aaData[i][0],
                        title: data.aaData[i][1],
                        has_children: true,
                        level: node.level + 1,
                        children: []
                    });
                }
            }

            callback(node);
        })
        .error(function (data) {

        });
    };

    hierarchicalTries.each(function () {
        var hierarchicalTree = $(this);
        if (!hierarchicalTree.hasClass("chosentree")) {
            hierarchicalTree.addClass("chosentree");
        }

        var spanLookupConfiguration = hierarchicalTree.siblings("span.lookupConfiguration");
        var remoteSourceIdentifier = spanLookupConfiguration.children("span.remoteSourceIdentifier");
        var remoteLookupCode = spanLookupConfiguration.children("span.remoteLookupCode");
        var remoteSourceId = spanLookupConfiguration.children("span.lookupComponentId");
        var remoteSourceName = spanLookupConfiguration.children("span.lookupComponentName");

        if (remoteSourceIdentifier.length > 0 && remoteLookupCode.length > 0 && remoteSourceId.length > 0 && remoteSourceName.length > 0) {
            hierarchicalTree.chosentree({
                inputId: remoteSourceId[0].innerHTML,
                inputName: remoteSourceName[0].innerHTML,
                width: 500,
                deepLoad: true,
                showtree: true,
                load: function (node, callback) {
                    var nodeId = node.id == 0 ? null : node.id;
                    loadChildren(node, 0, nodeId, callback, remoteLookupCode[0].innerHTML, remoteSourceIdentifier[0].innerHTML);
                }
            });
        }
    });

    return this;
}

$.fn.InitHelp = function () {

    var InfoDialog = function() {
        var infoIcon = $(this);
        var modal = infoIcon.find(".dialog-modal");
        modal.dialog({
            position: {
                my: "left",
                at: "right",
                of: infoIcon,
                offset: "20 20"
            },
            open: function (event, ui) {
                infoIcon.unbind('mouseout');
                infoIcon.mouseout(function () {
                    try {
                        var target = $(event.target);
                        target.dialog('destroy');
                        target.appendTo(modal);

                    } catch (e) {

                    }
                });
                infoIcon.mousedown(function () {
                    infoIcon.unbind('mouseout');
                });
            },
            close: function (event, ui) {
                var target = $(event.target);
                target.dialog('destroy');
                target.appendTo(modal);
            }
        });
    };

    this.find(".info").mouseover(InfoDialog);

    return this;
}

$.fn.InitMultiCombobox = function () {
    var elements = $(".multiCombobox");
    if (elements.length > 0) {
        elements.multiselect();
    }
}

$.fn.DeleteMultiCombobox = function () {
    var elements = $(".multiCombobox");
    if (elements.length > 0) {
        elements.multiselect("destroy");
    }
}

$.fn.InitRemoteCombobox = function () {
    var elements = this.find(".remoteComboBox");
    var layoutRow = this;
    if (elements.length > 0) {
        elements.change(function () {
            var remoteComboBox = $(this);

            if (remoteComboBox.attr("fieldID") == undefined) {
                RemoteComboboxNew(remoteComboBox, layoutRow);
            }
            else {
                RemoteComboboxOld(remoteComboBox, layoutRow);
            }
        });
    }

    return this;
}

function RemoteComboboxNew(remoteComboBox, layoutRow) {
    var remoteComboboxId = remoteComboBox.attr("id");
    var repetionsSectionId = "";
    var repetionsSectionIdPostfix = "";
    var idParts = remoteComboBox.attr("id").split('-');
    if (idParts.length > 1) {
        repetionsSectionId = idParts[idParts.length - 1];
        remoteComboboxId = idParts[0];
        repetionsSectionIdPostfix = "-" + repetionsSectionId;
    }

    //najdi najblizsi skryty span, ktory obsahuje informaciu o remoteComboboxe
    var spanLookupConfiguration = remoteComboBox.siblings("span.lookupConfiguration");
    var spanLookupComponentId = spanLookupConfiguration.children("span.lookupComponentId");
    var spanFieldId = spanLookupConfiguration.children("span.fieldId");

    if (spanLookupConfiguration.length > 0) {
        if (spanLookupComponentId.length > 0 && spanFieldId.length > 0 && spanLookupComponentId[0].innerHTML == remoteComboboxId) {
            var fieldId = spanFieldId[0].innerHTML + repetionsSectionIdPostfix;
            var fields = layoutRow.find("#" + fieldId);
            fields.first().val(remoteComboBox.val());
        }
    }
}

//todo obsolete
function RemoteComboboxOld(remoteComboBox, layoutRow) {
    var repetionsSectionId = "";
    var idParts = remoteComboBox.attr("id").split('-');
    if (idParts.length > 1) {
        repetionsSectionId = idParts[idParts.length - 1];
    }

    var fieldId = remoteComboBox.attr("fieldID");
    var fields = layoutRow.find("input[" + "fieldid" + "='" + fieldId + "']");
    if (repetionsSectionId != "") {
        fields.each(function () {
            var field = $(this);
            var idPartsFiles = field.attr("id").split('-');
            if (idPartsFiles[idPartsFiles.length - 1] == repetionsSectionId) {
                fields = field;
            }
        });
    }

    if (fields.length == 0) {
        fields = layoutRow.find("textarea[" + "fieldid" + "='" + fieldId + "']");
        if (repetionsSectionId != "") {
            fields.each(function () {
                var field = $(this);
                var idPartsFiles = field.attr("id").split('-');
                if (idPartsFiles[idPartsFiles.length - 1] == repetionsSectionId) {
                    fields = field;
                }
            });
        }
    }

    if (fields.length > 0)
        fields.first().val(remoteComboBox.val());
}

$.fn.InitSectionAccordion = function () {
    this.find(".caption").click(function () {
        var caption = $(this);
        var layoutRowContent = caption.next(".columns");
        //var layoutRow = layoutRowContent.parent();
        //var isEmpty = layoutRow.attr('isEmpty');

        //if (isEmpty == 'true'){
        //    return;
        //}

        var arrowSpan = caption.children("span.ui-icon");
        arrowSpan.toggleClass("ui-icon-carat-1-n").toggleClass("ui-icon-carat-1-s");
        //layoutRowContent.slideToggle(0);
        if (arrowSpan.hasClass("ui-icon-carat-1-n")) {
            layoutRowContent.show();
        } else if (arrowSpan.hasClass("ui-icon-carat-1-s")) {
            layoutRowContent.hide();
        }
    });

    return this;
};

// Skok na pozadovany element s pripadnym rozbalenim zbalenych sekcii interakciou chybovej hlasky
function expandLayoutRowsAndFocus() {
    $('.error[for], .warning[for]').live("focus click", function (e) {
        e.preventDefault();

        var closestLayotRow = $("[id='" + this.htmlFor + "']").closest('.layoutRow');
        var firstCaption;

        if (closestLayotRow[0]) {
            firstCaption = $(closestLayotRow[0]).find('.caption').first();

            if (firstCaption.children("span.ui-icon").hasClass("ui-icon-carat-1-s"))
                firstCaption.click();
        }

        while (closestLayotRow[0]) {
            if (closestLayotRow[0].parentElement) {
                closestLayotRow = $(closestLayotRow[0].parentElement).closest('.layoutRow');

                if (closestLayotRow[0]) {
                    firstCaption = $(closestLayotRow[0]).find('.caption').first();

                    if (firstCaption.children("span.ui-icon").hasClass("ui-icon-carat-1-s"))
                        firstCaption.click();
                }
            }
        }

        $("[id='" + this.htmlFor + "']").focus();
    });
}

$.fn.RemoveDatePickerClass = function () {
    this.find(".datepicker, .datepickerISO, .timepicker, .datetimepicker").removeClass("hasDatepicker");

    return this;
};

$.fn.InitDatePicker = function () {
    this.find(".datepicker").datepicker();

    return this;
};

$.fn.InitDateTimeControl = function () {
    this.find(".datetimepicker").datetimepicker();

    return this;
};

$.fn.InitPopUpDialog = function () {
    var elements = this.find(".remoteLookup");

    // vyhybka starej a novej verzie scriptu
    if (elements.length > 0) {
        RemoteLookupNew(this);
    }
    else {
        RemoteLookupOld(this);
    }

    return this;
}

function GetFormLanguage() {
    return $('meta[name=language]').attr("content");
}

//todo obsolete
function RemoteLookupOld(layoutRow) {
    layoutRow.find("div[LookupDetail]").dialog({
        autoOpen: false,
        modal: true
    });

    layoutRow.find("[LookupButton]").click(function () {
        var lookupBtn = $(this);
        var attributeName = "fieldID";
        var fieldId = lookupBtn.attr(attributeName);
        var lookupSource = lookupBtn.attr('lookupSource');
        fieldIndex = $("span.lookupbutton[" + attributeName + "='" + fieldId + "']").index(this);
        var nonPostfixFieldID = fieldId.split(disableValidatorPostfix)[0];
        var dialog = $("[LookupForm][" + attributeName + "='" + nonPostfixFieldID + "']").eq(0);
        dialog.attr("fieldID", fieldId);
        dialog.attr("lookupSource", lookupSource);
        dialog.closest(".ui-dialog").addClass("lookup-dialog");
        dialog.dialog("open");
    });

    layoutRow.find("[FieldInfo]").mouseover(function () {
        var fieldInfo = $(this);
        var attributeName = "fieldID";
        var infoIcon = fieldInfo.children("span");
        var targetField = infoIcon.parent().siblings("[class='fieldContent']").children("input[id]");
        var targetWidth = targetField.width();
        var fieldId = fieldInfo.attr(attributeName);
        var nonPostfixFieldID = fieldId.split(disableValidatorPostfix)[0];
        var fieldInfoIndex = $("[FieldInfo][" + attributeName + "='" + nonPostfixFieldID + "']").index(this);
        var infoText = $("input[LookupDetailInfo][" + attributeName + "='" + fieldId + "']").eq(fieldInfoIndex).val();
        $("div[LookupDetail][" + attributeName + "='" + nonPostfixFieldID + "']").text(infoText);
        var modal = $("div[LookupDetail][" + attributeName + "='" + nonPostfixFieldID + "']").eq(0);
        modal.dialog({
            autoOpen: true,
            modal: false,
            position: { my: "left bottom-3", at: "left top", of: targetField },
            width: targetWidth,
            open: function (event, ui) {
                infoIcon.unbind('mouseout');
                infoIcon.mouseout(function () {
                    var target = $(event.target);
                    target.dialog('close');
                    target.appendTo(modal);
                });
                infoIcon.mousedown(function () {
                    infoIcon.unbind('mouseout');
                });
            },
            close: function (event, ui) {
                var target = $(event.target);
                target.dialog('close');
                target.appendTo(modal);
            }
        });
    });

    layoutRow.find("[LookupForm]").dialog({
        autoOpen: false,
        height: 350,
        width: 420,
        modal: true,
        buttons: {
            "OK": SubmitLookup,
            "Zrušiť": function () {
                $(this).dialog("close");
            }
        },
        open: OpenLookup
    });

    switch (GetFormLanguage()) {
        case 'en':
            layoutRow.find("[LookupForm]").dialog({
                buttons: {
                    "OK": SubmitLookup,
                    "Cancel": function () {
                        $(this).dialog("close");
                    }
                }
            });
            break;

        default: // sk a default
            layoutRow.find("[LookupForm]").dialog({
                buttons: {
                    "OK": SubmitLookup,
                    "Zrušiť": function () {
                        $(this).dialog("close");
                    }
                }
            });
    }

    function SubmitLookup() {
        var lookup = $(this);
        var attributeName = "fieldID";
        var fieldId = lookup.attr(attributeName);
        var nonPostfixFieldId = fieldId.split(disableValidatorPostfix)[0];
        var anSelected = fnGetSelected(oTable);
        var field = $("[LookupField][" + attributeName + "='" + fieldId + "']").eq(fieldIndex);
        var turned = "turned";
        var lookupDetailInfo = $("input[LookupDetailInfo][" + attributeName + "='" + fieldId + "']").eq(fieldIndex);
        var lookupFieldValue = $("input[LookupFieldValue][" + attributeName + "='" + fieldId + "']").eq(fieldIndex);
        var aData;
        if (anSelected.length > 0) {
            var data;
            aData = oTable.fnGetData(anSelected[0]);
            if (field.hasClass(turned)) {
                field.val(aData[1]);
                data = aData[0];
                lookupDetailInfo.val(data);
                lookupFieldValue.val(data);
            } else {
                field.val(aData[0]);
                data = aData[1];
                lookupDetailInfo.val(data);
                lookupFieldValue.val(data);
            }
        }
        else {
            aData = oTable.fnGetData(anSelected[0]);
            field.val(field.hasClass(turned) ? aData[0][1] : aData[0][0]);
            lookupDetailInfo.val(field.hasClass(turned) ? aData[0][0] : aData[0][1]);
        }
        lookup.attr(attributeName, nonPostfixFieldId);
        field.focus();
        lookup.dialog("close");
    }

    function OpenLookup() {
        var lookup = $(this);
        var lookupId = lookup.attr('lookupID');
        var lookupSource = lookup.attr('lookupSource');

        oTable = lookup.find("table[id^='LookupTable']").dataTable({
            "bAutoWidth": true,
            "bFilter": true,
            "bServerSide": true,
            "bJQueryUI": true,
            "bProcessing": true,
            "bLengthChange": false,
            "iDisplayLength": 10,
            "bPaginate": true,
            "bInfo": false,
            "bRetrieve": true,
            "sAjaxSource": GetLookupUri() + '?id=' + lookupId + '&lookupSource=' + lookupSource + '&callback=?',
            "aoColumns": [{ "sName": "Kod" }, { "sName": "Hodnota" }]
        });

        oTable.fnFilterOnReturn();

        lookup.find("[id^='LookupTable'][id$='_filter']").hide();
        lookup.find("[id^='FilterButton']").button().click(function () {
            oTable.fnFilter($(this).prev().val());
        });

        lookup.find("table[id^='LookupTable'] tbody").click(function (event) {
            $(oTable.fnSettings().aoData).each(function () {
                $(this.nTr).removeClass('row_selected');
            });
            $(event.target.parentNode).addClass('row_selected');
        });
    }
}

function RemoteLookupNew(layoutRow) {

    var elements = layoutRow.find(".remoteLookup");
    elements.each(function () {
        var remoteLookup = $(this);

        var lookupDetailInfo = remoteLookup.siblings('.LookupDetailInfo');
        var lookupInfo = remoteLookup.parent().siblings(".fieldInfo");
        var lookupFieldValue = null;
        lookupDetailInfo.val("");

        //Nacitanie hodnot z konfiguracnej sekcie
        var spanLookupConfiguration = remoteLookup.siblings("span.lookupConfiguration");
        var spanLookupComponentId = spanLookupConfiguration.children("span.lookupComponentId");
        var spanFieldId = spanLookupConfiguration.children("span.fieldId");
        var remoteSourceIdentifier = spanLookupConfiguration.children("span.remoteSourceIdentifier");
        var remoteLookupCode = spanLookupConfiguration.children("span.remoteLookupCode");

        var closestLayoutRow = remoteLookup.closest(".layoutRow");

        if (spanFieldId.length > 0) {
            lookupFieldValue = closestLayoutRow.find('[id|="' + spanFieldId.html() + '"]');
        }

        //najdenie lookup Formu
        var lookupForms = $(".LookupForm");
        var lookupForm = null;
        lookupForms.each(function () {
            var lookupFormLocal = $(this);
            var spanLookupFormConfiguration = lookupFormLocal.children("span.lookupConfiguration");
            var spanLookupFormComponentId = spanLookupFormConfiguration.children("span.lookupComponentId");
            if (spanLookupFormComponentId[0].innerHTML == spanLookupComponentId[0].innerHTML) {
                lookupForm = lookupFormLocal;
                return false;
            }
        });

        //najdenie lookup detailu
        var lookupDetails = $(".LookupDetail");
        var lookupDetail = null;
        var lookupTable = null;
        lookupDetails.each(function () {
            var lookupDetailLocal = $(this);
            var spanLookupDetailConfiguration = lookupDetailLocal.children("span.lookupConfiguration");
            var spanLookupDetailComponentId = spanLookupDetailConfiguration.children("span.lookupComponentId");
            if (spanLookupDetailComponentId[0].innerHTML == spanLookupComponentId[0].innerHTML) {
                lookupDetail = lookupDetailLocal;
                return false;
            }
        });

        //nastavnie lookup table
        if (lookupForm != null) {
            lookupTable = lookupForm.find('.LookupTable');
        }

        if (lookupDetail!= null && lookupDetail.length > 0) {
            lookupDetail.dialog({
                autoOpen: false,
                modal: true
            });
        }

        remoteLookup.siblings(".lookupbutton").click(function () {
            lookupForm.dialog({
                autoOpen: false,
                height: 350,
                width: 420,
                modal: true,
                open: function (args, callback) {
                    OpenLookup(lookupForm, lookupTable, remoteSourceIdentifier[0].innerHTML, remoteLookupCode[0].innerHTML);
                }
            });
            lookupForm.closest(".ui-dialog").addClass("lookup-dialog");
            lookupForm.dialog("open");
        });

        switch (GetFormLanguage()) {
            case 'en':
                remoteLookup.siblings(".lookupbutton").click(function () {
                    lookupForm.dialog({
                        buttons: {
                            "OK": function (args, callback) {
                                SubmitLookup(lookupForm, remoteLookup, lookupDetailInfo, lookupFieldValue);
                            },
                            "Cancel": function () {
                                $(this).dialog("close");
                            }
                        }
                    });
                });
                break;

            default: // sk a default
                remoteLookup.siblings(".lookupbutton").click(function () {
                    lookupForm.dialog({
                        buttons: {
                            "OK": function (args, callback) {
                                SubmitLookup(lookupForm, remoteLookup, lookupDetailInfo, lookupFieldValue);
                            },
                            "Zrušiť": function () {
                                $(this).dialog("close");
                            }
                        }
                    });
                });
        }

        if (lookupInfo.length > 0) {
            lookupInfo.mouseover(function () {
                var infoIcon = lookupInfo.children("span");
                var targetWidth = remoteLookup.width();
                var infoText = lookupDetailInfo.val();
                lookupDetail.children('.LookupDetailInfoText').text(infoText);

                lookupDetail.dialog({
                    autoOpen: true,
                    modal: false,
                    position: { my: "left bottom-3", at: "left top", of: remoteLookup },
                    width: targetWidth,
                    open: function (event, ui) {
                        infoIcon.unbind('mouseout');
                        infoIcon.mouseout(function () {
                            var target = $(event.target);
                            target.dialog('close');
                            target.appendTo(lookupDetail);
                        });
                        infoIcon.mousedown(function () {
                            infoIcon.unbind('mouseout');
                        });
                    },
                    close: function (event, ui) {
                        var target = $(event.target);
                        target.dialog('close');
                        target.appendTo(lookupDetail);
                    }
                });
            });
        }

    });

    function SubmitLookup(lookupForm, field, lookupDetailInfo, lookupFieldValue) {
        var anSelected = fnGetSelected(oTable);
        var turned = "turned";
        var aData;
        if (anSelected.length > 0) {
            var data;
            aData = oTable.fnGetData(anSelected[0]);
            if (field.hasClass(turned)) {
                field.val(aData[1]);
                data = aData[0];
                lookupDetailInfo.val(data);
                if (lookupFieldValue != null)
                    lookupFieldValue.val(data);
            } else {
                field.val(aData[0]);
                data = aData[1];
                lookupDetailInfo.val(data);
                if (lookupFieldValue != null)
                    lookupFieldValue.val(data);
            }
        }
        else {
            aData = oTable.fnGetData(anSelected[0]);

            if (field.hasClass(turned)) {
                field.val(aData[0][1]);
                data = aData[0][0];
                lookupDetailInfo.val(data);
                if (lookupFieldValue != null)
                    lookupFieldValue.val(data);
            } else {
                field.val(aData[0][0]);
                data = aData[0][1];
                lookupDetailInfo.val(data);
                if (lookupFieldValue != null)
                    lookupFieldValue.val(data);
            }
        }

        field.focus();
        lookupForm.dialog("close");
    }

    function OpenLookup(lookupForm, lookupTable, lookupSource, lookupId) {

        switch (GetFormLanguage()) {
            case 'en':
                oTable = lookupTable.dataTable({
                    "bAutoWidth": true,
                    "bFilter": true,
                    "bServerSide": true,
                    "bJQueryUI": true,
                    "bProcessing": true,
                    "bLengthChange": false,
                    "iDisplayLength": 10,
                    "bPaginate": true,
                    "bInfo": false,
                    "bRetrieve": true,
                    "sAjaxSource": GetLookupUri() + '?id=' + lookupId + '&lookupSource=' + lookupSource + '&callback=?',
                    "aoColumns": [{ "sName": "Code" }, { "sName": "Value" }],
                    "oLanguage": {
                        "sEmptyTable": "No data available in table",
                        "sInfo": "Showing _START_ to _END_ of _TOTAL_ entries",
                        "sInfoEmpty": "Showing 0 to 0 of 0 entries",
                        "sInfoFiltered": "(filtered from _MAX_ total entries)",
                        "sInfoPostFix": "",
                        "sInfoThousands": ",",
                        "sLengthMenu": "Show _MENU_ entries",
                        "sLoadingRecords": "Loading...",
                        "sProcessing": "Processing...",
                        "sSearch": "Search:",
                        "sZeroRecords": "No matching records found",
                        "oPaginate": {
                            "sFirst": "First",
                            "sLast": "Last",
                            "sNext": "Next",
                            "sPrevious": "Previous"
                        },
                        "oAria": {
                            "sSortAscending": ": activate to sort column ascending",
                            "sSortDescending": ": activate to sort column descending"
                        }
                    }
                });
                break;

            default: // sk a default
                oTable = lookupTable.dataTable({
                    "bAutoWidth": true,
                    "bFilter": true,
                    "bServerSide": true,
                    "bJQueryUI": true,
                    "bProcessing": true,
                    "bLengthChange": false,
                    "iDisplayLength": 10,
                    "bPaginate": true,
                    "bInfo": false,
                    "bRetrieve": true,
                    "sAjaxSource": GetLookupUri() + '?id=' + lookupId + '&lookupSource=' + lookupSource + '&callback=?',
                    "aoColumns": [{ "sName": "Kod" }, { "sName": "Hodnota" }],
                    "oLanguage": {
                        "sEmptyTable": "Nie sú k dispozícii žiadne dáta",
                        "sInfo": "Záznamy _START_ až _END_ z celkom _TOTAL_",
                        "sInfoEmpty": "Záznamy 0 až 0 z celkom 0 ",
                        "sInfoFiltered": "(vyfiltrované spomedzi _MAX_ záznamov)",
                        "sInfoPostFix": "",
                        "sInfoThousands": ",",
                        "sLengthMenu": "Zobraz _MENU_ záznamov",
                        "sLoadingRecords": "Načítavam...",
                        "sProcessing": "Spracúvam...",
                        "sSearch": "Hľadať:",
                        "sZeroRecords": "Nenašli sa žiadne vyhovujúce záznamy",
                        "oPaginate": {
                            "sFirst": "Prvá",
                            "sLast": "Posledná",
                            "sNext": "Nasledujúca",
                            "sPrevious": "Predchádzajúca"
                        },
                        "oAria": {
                            "sSortAscending": ": aktivujte na zoradenie stĺpca vzostupne",
                            "sSortDescending": ": aktivujte na zoradenie stĺpca zostupne"
                        }
                    }
                });
        }

        oTable.fnFilterOnReturn();

        var filterButton = lookupForm.find(".FilterButton");
        var lookupTableTbody = lookupTable.find("tbody");
        filterButton.unbind("click");
        lookupTableTbody.unbind("click");

        lookupForm.find(".dataTables_filter").hide();
        filterButton.click(function () {
            var tableFilterIgnoreCaseSensitive = lookupForm.find(".tableFilterIgnoreCaseSensitive");
            if (tableFilterIgnoreCaseSensitive.length > 0) {
                var oSettings = oTable.fnSettings();
                oSettings.sAjaxSource = oSettings.sAjaxSource.replace('&ignoreCaseSensitivity=true', '');
                oSettings.sAjaxSource = oSettings.sAjaxSource.replace('&ignoreCaseSensitivity=false', '');
                oSettings.sAjaxSource = oSettings.sAjaxSource + '&ignoreCaseSensitivity=' + tableFilterIgnoreCaseSensitive.is(':checked');
            }

            oTable.fnFilter($(this).prev().val());
        });

        lookupTableTbody.click(function (event) {
            $(oTable.fnSettings().aoData).each(function () {
                $(this.nTr).removeClass('row_selected');
            });
            $(event.target.parentNode).addClass('row_selected');
        });
    }
}

function jsonLookupCallback(json, fieldId) {
    var options = '';

    $.each(json, function (key, val) {
        options += '<option value="' + val.optionValue + '">' + val.optionDisplay + '</option>';
    });

    $("select#" + fieldId + "SelectLookup").html(options);
}

$.fn.ClearFormElements = function () {
    this.find(':input').each(function () {
        var element = $(this);
        switch (this.type) {
            case 'password':
            case 'text':
            case 'textarea':
            case 'select-multiple':
                element.val('');
                break;
            case 'checkbox':
            case 'radio':
                this.checked = false;
                break;
        }

        var errorClass = "error";
        if (element.hasClass(errorClass)) {
            element.removeClass(errorClass);
        }
    });

    this.find('textarea').each(function () {
        $(this).html("");
    });
    this.find('select').each(function () {
        $(this).val("");
    });

    return this;
};

$.fn.ReinitRadioDefaultCheck = function () {
    this.find(':input').each(function () {
        switch (this.type) {
        case 'radio':
            var input = $(this);
            var defaultVal = input.attr('default');
            if (defaultVal == 'true') {
                this.checked = true;
                input.click();
            }
        }
    });

    return this;
};

$.fn.ResetRepetitionSection = function () {
    this.find('.layoutRow.repeatingSection').remove();
    this.find('.layoutRow.hiddenSection').toggleClass("hiddenSection");
    this.find('div[id^=repetitionCommands]').show();
    this.find('span[id^=removeSectionlayoutRow]').hide();

    return this;
};

function cleanSectionID(layoutRowID) {
    var regEx = new RegExp(repeatingPostfix + "\\d+$");
    return layoutRowID.replace(regEx, '');
}

function GetRepeatingSections(repeatSection) {
    var sections;
    var filterSection = [];

    if ($(repeatSection).hasClass("closeButton") == true) {
        var layoutRow = $(repeatSection).closest('div[id^=layoutRow]');
        var layoutRowId = layoutRow.attr("ID").split('_')[0];

        sections = $('div[id^=' + layoutRowId + ']');

        sections.each(function () {
            if (cleanSectionID($(this).attr('ID')) == layoutRowId)
                filterSection.push($(this));
        });
    } else {
        var cleanId = cleanSectionID(parseId(repeatSection, 'addSection'));
        sections = $('div[id^=' + cleanId + ']');

        sections.each(function () {
            if (cleanSectionID($(this).attr('ID')) == cleanId)
                filterSection.push($(this));
        });
    }

    return $($.map(filterSection, function (el) { return $.makeArray(el) }));
}

function IncrementDecrementSectionId(layoutRowCopy) {
    var repeatSection = layoutRowCopy[0];
    if (repeatSection == undefined) { repeatSection = layoutRowCopy; }
    var sections = GetRepeatingSections(repeatSection);

    if (sections.first()[0]) {
        $(sections.first()[0]).attr("ID", cleanSectionID($(sections.first()[0]).attr("ID")));
    }

    var i = 0;

    sections.slice(1).each(function () {
        var section = $(this);

        section.attr("ID", GetIncrementalValue(section.attr("ID"), ++i));
        section.addClass("repeatingSection");
    });
};

function IncrementDecrementInnerRepeatingIds(layoutRowCopy) {
    $(layoutRowCopy).find('div[id]').each(function () {
        IncrementDecrementSectionId($(this));
    });
}

$.fn.IncrementFieldIds = function () {
    var layoutRow = this;
    layoutRow.find('[ID].datepicker, [ID]:input, [ID].daterangepickerdiv').each(function () {
        IncrementElements(layoutRow, $(this), ["id", "name"]);
    });

    return layoutRow;
};

function IncrementElements(layoutRow, copyElement, attributes) {
    var attributeName = attributes[0];
    var oldId = copyElement.attr(attributeName);
    oldId = getOriginalId(oldId, sign);
    var selector = "[" + attributeName + "|='" + oldId + "']";
    var elements = $("#main").find(selector);

    if (elements.length > 0) {
        var suffix = "";

        switch (copyElement[0].type) {
        case 'checkbox':
        case 'radio':
            var countRadios = layoutRow.find(selector).length;
            var countGroups = elements.length / countRadios;
            for (var i = 0; i < countGroups; i++) {
                var start = i * countRadios;
                elements.slice(start, start + countRadios).each(function() {
                    var element = $(this);
                    if (i > 0) {
                        suffix = sign + i;
                    }

                    SetAttributeFor(element, oldId, suffix);
                    for (a = 0; a < attributes.length; a++) {
                        SetAttribute(element, attributes[a], suffix);
                    }
                });
            }
            break;
        default:
            i = 0;
            var firtsElement = elements.first();
            SetAttributeFor(firtsElement, oldId, suffix);
            for (var a = 0; a < attributes.length; a++) {
                SetAttribute(firtsElement, attributes[a], suffix);
            }

            elements.slice(1).each(function() {
                var element = $(this);
                suffix = sign + ++i;
                SetAttributeFor(element, oldId, suffix);
                for (a = 0; a < attributes.length; a++) {
                    SetAttribute(element, attributes[a], suffix);
                }
            });
        }

        var lastElement = elements.slice(elements.length - 1);
        if (lastElement != copyElement) {
            CopyValidationRules(oldId, lastElement);
        }
        CopyValidationRules(oldId, copyElement);
    }
}

function SetAttribute(input, attributeName, suffix) {
    var value = input.attr(attributeName);
    if (value != null) {
        value = getOriginalId(value, sign);

        input.attr(attributeName, value + suffix);
    }
}

function getOriginalId(value, sign) {
    var index = value.indexOf(sign);
    if (index > -1) {
        value = value.substring(0, index);
    }

    return value;
}

function SetAttributeFor(element, oldId, suffix) {
    var attributeName = "for";
    var selectorFor = "[" + attributeName + "|='" + oldId + "']";
    var label = element.closest('div').find(selectorFor);
    if (label != undefined) {
        SetAttribute(label, attributeName, suffix);
    }
}

function CopyValidationRules(oldId, copyElement) {
    if (copyElement.attr("name")) {
        var element = $('#' + oldId);
        var attributeName = "name";
        var elementName = element.attr(attributeName);
        if (elementName != null) {
            var backUpElementName = element[0].name;
            var backUpCopyElement = copyElement[0].name;
            element[0].name = element[0].name.replace(disableValidatorPrefix, '');
            copyElement[0].name = copyElement[0].name.replace(disableValidatorPrefix, '');
            var rules = element.rules();

            if (element[0] != copyElement[0])
                element[0].name = backUpElementName;

            element = element[0];
            var newRules = {};
            var newMessages = {};
            var settings = $.data(element.form, 'validator').settings;
            for (var method in rules) {
                var name = method.replace(elementName, copyElement.attr(attributeName));
                var validationObject = settings.messages[element.name.replace(disableValidatorPrefix, '')];
                if (validationObject != null) {
                    newRules[name] = rules[method];
                    var messages = validationObject[method];
                    newMessages[name] = messages;
                    $.validator.addMethod(name, $.validator.methods[method]);
                }
            }
            newRules.messages = newMessages;
            copyElement.rules('add', newRules);
            copyElement[0].name = backUpCopyElement;
        }
    }
}

function GetIncrementalValue(value, sectionIncrement) {
    var regEx = new RegExp(repeatingPostfix + "\\d+$");
    var cleanVal = value.replace(regEx, '');
    ////// ML vrati povodnu ////
    //if (sectionIncrement == '')
    //    return cleanVal;
    ////////////////////////////
    return cleanVal + repeatingPostfix + sectionIncrement;
}

function ReindexAddressInput(value) {
    var index = value.indexOf(sign);
    if (index > 0) {
        value = value.substring(0, index);
    }

    var count = 0;
    var selector = value;
    var element = $('#' + selector);

    while (element[0] != undefined) {
        count = count + 1;
        selector = value + sign + count;
        element = $('#' + selector);
    }

    return selector;
}

function GetValueWithoutIncremental(value) {
    var regEx = new RegExp(repeatingPostfix + "\\d+$");
    return value.replace(regEx, '');
}

function IncrementItemDelegate(context, sectionIncrement) {
    var attributeName = "name";
    context.attr(attributeName, GetIncrementalValue(context.attr(attributeName), sectionIncrement));
}

$.fn.ToggleValidators = function (toggle) {
    var attributeName;
    if (toggle == false) {
        attributeName = "name";
        this.find('[ID]:input').each(function () {
            var input = $(this);
            input.attr(attributeName, input.attr(attributeName).replace(disableValidatorPrefix, ''));
        });
        attributeName = "for";
        this.find('label').each(function () {
            var input = $(this);
            input.attr(attributeName, input.attr(attributeName).replace(disableValidatorPrefix, ''));
        });
        this.find("[id^='layoutRow'][isempty='true']").ToggleValidators(true);
        this.find("div.layoutRow.hiddenSection").ToggleValidators(true);
    } else {
        attributeName = "name";
        this.find('[ID]:input').each(function () {
            var input = $(this);
            if (input.attr(attributeName).indexOf(disableValidatorPrefix) == -1)
                input.attr(attributeName, disableValidatorPrefix + input.attr(attributeName));

            input.focusout();
        });
        attributeName = "for";
        this.find('label').each(function () {
            var input = $(this);
            if (input.attr(attributeName).indexOf(disableValidatorPrefix) == -1)
                input.attr(attributeName, disableValidatorPrefix + input.attr(attributeName));
        });
    }
    return this;
};

$.fn.ToggleValidatorsStyle = function (toggle) {
    var disablevalidators = disableValidators;
    this.find('[ID]:input').each(function () {
        var input = $(this);
        if (toggle == false) {
            input.removeClass(disablevalidators);
        } else {
            input.addClass(disablevalidators);
        }
        input.focusout();
    });

    return this;
};

$.fn.HideSwitchSections = function (switchesToSections) {
    for (var oneSwitch in switchesToSections) {
        var trigger = $(oneSwitch);
        for (var i = 0; i < trigger.length; i++) {
            var currentTrigger = $(trigger[i]);
            if (!currentTrigger.is(":checked")) {
                var sectionsCollection = switchesToSections[oneSwitch];
                var context = GetContext(currentTrigger, sectionsCollection);
                for (section in sectionsCollection) {
                    var section = context.find(sectionsCollection[section]).eq(0);
                    var hiddensection = "hiddenSection";
                    if (section.hasClass('cell')) {
                        var sectionChild = section.children().first();
                        sectionChild.toggleClass(hiddensection, true);
                        sectionChild.ToggleValidators(true);
                    }
                    section.toggleClass(hiddensection, true);
                    section.ToggleValidators(true);
                }
            }
        }
    }

    return this;
};

$.fn.SwitchSections = function (switchesToSections, isCheckBoxList) {
    var context = $(this);
    var isShowAll;
    var hasVal;

    $('form').find(context.selector).each(function () {
        var actualContext = $(this);
        hasVal = false;
        for (var singleSwitch in switchesToSections) {
            isShowAll = false;
            var target = switchesToSections[singleSwitch];
            var trigger = actualContext.find(singleSwitch);
            for (var section in target) {
                if (isShowAll)
                    return;

                actualContext.find(target[section]).find('input, select, textarea').each(function () {
                    var element = $(this)[0];
                    if (element.type != 'radio' && element.value != '')
                        hasVal = true;
                });
                isShowAll = trigger.is('[readonly]') && !hasVal;
            }
        }

        if (!isShowAll) {
            for (singleSwitch in switchesToSections) {
                trigger = actualContext.find(singleSwitch);
                if (trigger.length == 0)
                    return this;

                trigger.click(function () {
                    if (isCheckBoxList == true)
                        switchCheckboxClicked(switchesToSections, this);
                    else
                        switchRadioClicked(switchesToSections, this);
                });
            }
        }
    });

    return this;
};

$.fn.ReinitializeConditionalRules = function () {
    var context = $(this);

    InitConditionalRules(context);

    return this;
};

function GetContext(currentclick, target) {
    return recur($(currentclick), target[0]);
}

function findParent(element) {
    var patt = new RegExp("^layoutRow[0-9]+$");
    var patt2 = new RegExp("^layoutRow[0-9]+_Repeating_[0-9]+$");
    var id = element[0].id;
    if (patt.test(id) || patt2.test(id) || id == "main") {
        return element;
    } else {
        return findParent(element.parent());
    }
}

function recur(element, target) {
    var f;
    var children = element[0].children;

    for (var i = 0; i < children.length; i++) {
        var child = children[i];
        if (child.id == "main") {
            return $("form");
        }
        if (child.children.length > 0) {
            var a = $(child).find(target);
            if (a.length > 0) {
                f = findParent(a.parent());
            }
        }
    }

    if (f == null) {
        return recur(element.parent(), target);
    } else {
        return f;
    }
}

function customFunctionAfterSwitchSection(switchesToSections, currentclick) {
    // Override this function in custom p_PROJECT.js file
}

function switchRadioClicked(switchesToSections, currentclick) {
    for (var oneSwitch in switchesToSections) {
        var target = switchesToSections[oneSwitch];
        var context = GetContext(currentclick, target);
        oneSwitch = context.find(oneSwitch);

        for (var section in target) {
            section = context.find(target[section]);
            var sectionChild;
            var hiddensection = "hiddenSection";
            var cell = 'cell';
            if (oneSwitch[0] == currentclick) {
                if (section.hasClass(cell)) {
                    sectionChild = section.children().first();
                    sectionChild.toggleClass(hiddensection, false);
                    sectionChild.ToggleValidators(false);
                }
                section.toggleClass(hiddensection, false);
                section.ToggleValidators(false);
            } else {
                if (section.hasClass(cell)) {
                    sectionChild = section.children().first();
                    sectionChild.toggleClass(hiddensection, true);
                    sectionChild.ToggleValidators(true);
                }
                section.toggleClass(hiddensection, true);
                section.ToggleValidators(true);
            }

            $('[id^=' + GetValueWithoutIncremental(section.attr('id') + ']')).RemoveDatePickerClass();
            section.IncrementFieldIds();
            InitPickers();
        }
    }

    customFunctionAfterSwitchSection(switchesToSections, currentclick);
}

function switchCheckboxClicked(switchesToSections, currentclick) {
    var isCheckboxSelected = $(currentclick).is(':checked');
    var sectionsCollection = null;

    for (var sectionsKey in switchesToSections) {
        var target = switchesToSections[sectionsKey];
        var context = GetContext(currentclick, target);
        var oneSwitch = context.find(sectionsKey);
        if (oneSwitch[0] == currentclick) {
            sectionsCollection = target;
            break;
        }
    }

    if (sectionsCollection == null)
        return;

    for (var section in sectionsCollection) {
        section = context.find(sectionsCollection[section]).eq(0);
        var sectionChild;
        var hiddensection = "hiddenSection";
        var cell = 'cell';
        if (isCheckboxSelected) {
            if (section.hasClass(cell)) {
                sectionChild = section.children().first();
                sectionChild.toggleClass(hiddensection, false);
                sectionChild.ToggleValidators(false);
            }
            section.toggleClass(hiddensection, false);
            section.ToggleValidators(false);
        }
        else {
            if (section.hasClass(cell)) {
                sectionChild = section.children().first();
                sectionChild.toggleClass(hiddensection, true);
                sectionChild.ToggleValidators(true);
            }
            section.toggleClass(hiddensection, true);
            section.ToggleValidators(true);
        }
    }

    customFunctionAfterSwitchSection(switchesToSections, currentclick);
}

$.GetUrlParam = function (name) {
    var results = new RegExp('[\\?&]' + name + '=([^&#]*)').exec(window.location.href);

    if (results == null)
        return 0;

    return results[1] || 0;
}

/////////////////////////////// ML /////////////////////////////////////

function GetOnlyIncrementValue(value) {    //////////////////////////////////////////////////////////////////////////  rozsirenie

    var regEx = new RegExp(repeatingElementPostfix + "(\\d+)$")
    var cleanVal = regEx.exec(value);
    if (cleanVal == null)
        return '';
    else
        return parseInt(cleanVal[1]);
}

function getPagedSectionName(element) {  //////////////////////////////////////////////////////////////////////////  rozsirenie
    var lsecpg = $(element).closest('div.pageableSection');
    if (lsecpg != null)
        return lsecpg.attr('id');
    else
        return null;
}

function GetElementIncrementalValue(value, sectionIncrement) {
    var regEx = new RegExp(repeatingElementPostfix + "\\d+$");
    var cleanVal = value.replace(regEx, '');
    //// ML vrati povodnu ////
    if (sectionIncrement == '')
        return cleanVal;

    return cleanVal + repeatingElementPostfix + sectionIncrement;
}

///////////////////////////////////////////////////////////////////////
/* ]]> */
						</script><script type="text/javascript">
							/* <![CDATA[ */
/// <reference path="jquery-1.4.1-vsdoc.js" />
$(document).ready(function () {
    InitStatusDialog();
});

function InitStatusDialog() {
    statusDialog.initDialog();
}

var statusDialog = {

    getDialog: function () {
        return $("#statusDialog");
    },

    initDialog: function () {
        var dlg = statusDialog.getDialog();

        dlg.dialog({
            'autoOpen': false,
            'modal': true,
            'title': 'Dialog',
            'resizable': 'disable',
            'width': '350px',
            'height': 'auto'
        });
    },

    showDialog: function () {
        statusDialog.getDialog().dialog('open');
    },

    hideDialog: function () {
        statusDialog.getDialog().dialog('close');
    },

    showProgress: function () {
        statusDialog.getDialog().find("#statusLoader").show();
    },

    hideProgress: function () {
        statusDialog.getDialog().find("#statusLoader").hide();
    },

    setTitle: function (title) {
        statusDialog.getDialog().dialog("option", "title", title);
    },

    setMessage: function (message) {
        statusDialog.getDialog().find("#statusMessage").text(message);
    },

    setOptions: function (options) {
        statusDialog.getDialog().dialog("option", options);
    }

}


/* ]]> */
						</script><script type="text/javascript">
							/* <![CDATA[ */
(function($) {

  /**
   * This adds a Chosen style selector for the tree select widget.
   *
   * This widget requires chosen.css.
   */
  $.fn.chosentree = function(params) {

    // Setup the default parameters.
    params = $.extend({
      inputId: 'chosentree-select',     /** The input element ID and NAME. */
      label: '',                        /** The label to add to the input. */
      description: '',                  /** The description for the input. */
      input_placeholder: null, /** The input placeholder text. */
      input_type: 'text',               /** Define the input type. */
      autosearch: false,                /** If we would like to autosearch. */
      search_text: 'Search',            /** The search button text. */
      no_results_text: 'No results found', /** Shown when no results. */
      min_height: 100,                  /** The miniumum height. */
      more_text: '+%num% more',         /** The text to show in the more. */
      loaded: null,                     /** Called when all items are loaded. */
      collapsed: true,                  /** If the tree should be collapsed. */
      showtree: false,                   /** To show the tree. */
      inputName:'treeselect'
    }, params);

    // Iterate through each instance.
    return $(this).each(function() {

      // Keep track of the treeselect.
      var selector = null;
      var choices = null;
      var search = null;
      var input = null;
      var search_btn = null;
      var label = null;
      var description = null;
      var treeselect = null;
      var treewrapper = null;
      var selectedTimer = 0;
      var root = null;

      // Show or hide the tree.
      var showTree = function(show, tween) {
        tween = tween || 'fast';
        if (show && (!root || root.has_children)) {
          treewrapper.addClass('treevisible').show('fast');
        }
        else {
          treewrapper.removeClass('treevisible').hide('fast');
        }
      };

      if ($(this).find(".chzntree-container").length == 0) {

          // Create the selector element.
          selector = $(document.createElement('div'));
          selector.addClass('chzntree-container');
          selector.addClass('chzntree-container-multi');
          choices = $(document.createElement('ul'));
          choices.addClass('chzntree-choices chosentree-choices');

          // If they wish to have a label.
          label = $(document.createElement('label'));
          label.attr({
              'for': params.inputId
          });
          label.text(params.label);

          // If they wish to have a description.
          description = $(document.createElement('div'));
          description.attr({
              'class': 'description'
          });
          description.text(params.description);

          // Creat the chosen selector.
          if (choices) {
              selector.append(label).append(choices.append(search));
          }
          else {
              selector.append(label).append(search);
          }

          // Add the description.
          $(this).append(description);
      }
      else {
          treeselect = $(this).find('.treeselect');
          treewrapper = $(this).find('.treewrapper');
          selector = $(this).find('.chzntree-container');
          treeselect.remove();
          treewrapper.remove();;
      }

      treewrapper = $(document.createElement('div'));
      treewrapper.addClass('treewrapper');
      treewrapper.hide();

        // Get the tree select.
      treeselect = $(document.createElement('div'));
      treeselect.addClass('treeselect');

        // Setup the keyevents.
      $(this).keyup(function (event) {
          if (event.which == 27) {
              showTree(false);
          }
      });

        // Add the treeselect widget.
      treewrapper.append(treeselect);
      $(this).append(selector.append(treewrapper));

      // Now declare the treeselect.
      var treeparams = params;

      // Now declare our treeselect control.
      treeselect.treeselect(treeparams);
      root = treeselect.eq(0)[0].treenode;

      // Show the tree by default.
      if (treeparams.showtree || !treeparams.collapsed) {
        showTree(true, null);
      }
    });
  };
})(jQuery);

/* ]]> */
						</script><script type="text/javascript">
							/* <![CDATA[ */
(function($) {

  // From https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/keys
  if (!Object.keys) {
    Object.keys = (function () {
      'use strict';
      var hasOwnProperty = Object.prototype.hasOwnProperty,
        hasDontEnumBug = !({toString: null}).propertyIsEnumerable('toString'),
        dontEnums = [
          'toString',
          'toLocaleString',
          'valueOf',
          'hasOwnProperty',
          'isPrototypeOf',
          'propertyIsEnumerable',
          'constructor'
        ],
        dontEnumsLength = dontEnums.length;

      return function (obj) {
        if (typeof obj !== 'object' && (typeof obj !== 'function' || obj === null)) {
          throw new TypeError('Object.keys called on non-object');
        }

        var result = [], prop, i;

        for (prop in obj) {
          if (hasOwnProperty.call(obj, prop)) {
            result.push(prop);
          }
        }

        if (hasDontEnumBug) {
          for (i = 0; i < dontEnumsLength; i++) {
            if (hasOwnProperty.call(obj, dontEnums[i])) {
              result.push(dontEnums[i]);
            }
          }
        }
        return result;
      };
    }());
  }

  // The tree select control.
  $.fn.treeselect = function(params) {

    // Setup the default parameters for the tree select control.
    params = $.extend({
      colwidth: 18,               /** The width of the columns. */
      default_value: {},          /** An array of default values. */
      selected: null,             /** Callback when an item is selected. */
      treeloaded: null,           /** Called when the tree is loaded. */
      load: null,                 /** Callback to load new tree's */
      searcher: null,             /** Callback to search a tree */
      deepLoad: false,            /** Performs a deep load */
      onbuild: null,              /** Called when each node is building. */
      postbuild: null,            /** Called when the node is done building. */
      inputName: 'treeselect',    /** The input name. */
      autoSelectChildren: true,   /** Select chldrn when parent is selected. */
      showRoot: false,            /** Show the root item with a checkbox. */
      selectAll: false,           /** If we wish to see a select all. */
      selectAllText: 'Select All' /** The select all text. */
    }, params);

    /** Keep track of all loaded nodes */
    var loadedNodes = {};

    /** Variable for the busy states. */
    var busyloading = 'treebusy-loading';
    var busyloadingall = 'treebusy-loading-all';
    var busyselecting = 'treebusy-selecting';

    /**
     * Constructor.
     */
    var TreeNode = function(nodeparams, root) {

      // Determine if this is a root item.
      this.root = !!root;

      // Setup the parameters.
      nodeparams.title = nodeparams.title || 'anonymous';
      $.extend(this, {
        id: 0,                /** The ID of this node. */
        nodeloaded: false,    /** Flag to see if this node is loaded. */
        allLoaded: false,     /** Flag to see if we have loaded all nodes. */
        value: 0,             /** The input value for this node. */
        title: '',            /** The title of this node. */
        url: '',              /** The URL to this node. */
        has_children: true,   /** Boolean if this node has children. */
        children: [],         /** Array of children. */
        data: {},             /** Additional data to attach to the node. */
        level: 0,             /** The level of this node. */
        odd: false,           /** The odd/even state of this row. */
        checked: false,       /** If this node is checked. */
        busy: false,          /** If this node is busy. */
        display: $(),         /** The display of this node. */
        input: $(),           /** The input display. */
        link: $(),            /** The link display. */
        span: $(),            /** The span display. */
        childlist: $(),       /** The childlist display. */
        exclude: {}           /** An array of nodes to exclude for selection. */
      }, nodeparams);

      // Say that we are a TreeNode.
      this.isTreeNode = true;

      // Determine if a node is loading.
      this.loading = false;

      // The load callback queue.
      this.loadqueue = [];
    };

    /**
     * Set the busy cursor for this node.
     */
    TreeNode.prototype.setBusy = function(state, type) {

      // Make sure the state has changed.
      if (state != this.span.hasClass(type)) {
        this.busy = state;
        if (state) {

          // Set the busy type and treebusy.
          this.span.addClass(type);
          this.span.addClass('treebusy');
        }
        else {

          // Remove the busy type.
          this.span.removeClass(type);

          // Only remove the busy if the busy flags are empty.
          var othertype = (type == busyloading) ? busyselecting : busyloading;
          if (!this.span.hasClass(othertype)) {
            this.span.removeClass('treebusy');
          }
        }

      }
    };

    /**
     * Determines if this node is already loaded.
     */
    TreeNode.prototype.isLoaded = function() {
      var loaded = this.nodeloaded;
      loaded |= loadedNodes.hasOwnProperty(this.id);
      loaded |= !this.has_children;
      loaded |= (this.has_children && this.children.length > 0);
      return loaded;
    };

    /**
     * Loads the current node.
     *
     * @param {function} callback - The callback when the node is loaded.
     */
    TreeNode.prototype.loadNode = function(callback, hideBusy) {

      // If we are loading, then just add this callback to the queue and return.
      if (this.loading) {
        if (callback) {
          this.loadqueue.push(callback);
        }
        return;
      }

      // Trigger the callback when the node is done loading.
      var triggerCallback = function() {

        // Callback that we are loaded.
        if (callback) {
          callback(this);
        }

        // Process the loadqueue.
        for (var i in this.loadqueue) {
          this.loadqueue[i](this);
        }

        // Empty the loadqueue.
        this.loadqueue.length = 0;

        // Say we are not busy.
        if (!hideBusy) {
          this.setBusy(false, busyloading);
        }
      };

      // Say we are loading.
      this.loading = true;

      // Only load if we have not loaded yet.
      if (params.load && !this.isLoaded()) {

        // Make this node busy.
        if (!hideBusy) {
          this.setBusy(true, busyloading);
        }

        // Call the load function.
        params.load(this, (function(treenode) {
          return function(node) {

            // Only perform the merging and build if it hasn't loaded.
            if (!treenode.nodeloaded) {

              // Merge the result with this node.
              treenode = jQuery.extend(treenode, node);

              // Say this node is loaded.
              treenode.nodeloaded = true;

              // Add to the loaded nodes array.
              loadedNodes[treenode.id] = treenode.id;

              // Build the node.
              treenode.build(function() {

                // Callback that we are loaded.
                triggerCallback.call(treenode);
              });
            }
            else {

              // Callback that we are loaded.
              triggerCallback.call(treenode);
            }
          };
        })(this));
      }
      else if (callback) {

        // Just callback since we are already loaded.
        triggerCallback.call(this);
      }

      // Say that we are not loading anymore.
      this.loading = false;
    };

    /**
     * Recursively loads and builds all nodes beneath this node.
     *
     * @param {function} callback Called when the tree has loaded.
     * @param {function} operation Allow someone to perform an operation.
     */
    TreeNode.prototype.loadAll = function(callback, operation, hideBusy, ids) {
      ids = ids || {};

      // Make sure we are loaded first.
      this.loadNode(function(node) {

        // See if an operation needs to be performed.
        if (operation) {
          operation(node);
        }

        // Get our children count.
        var i = node.children.length, count = i;

        // If no children, then just call the callback immediately.
        if (!i || ids.hasOwnProperty(node.id)) {
          if (callback) {
            callback.call(node, node);
          }
          return;
        }

        // Add this to the ids to protect against recursion.
        ids[node.id] = node.id;

        // Make this node busy.
        if (!hideBusy) {
          node.setBusy(true, busyloadingall);
        }

        // Load children at a specific index.
        var loadChildren = function(index) {
          return function() {

            // Load this childs children...
            node.children[index].loadAll(function() {

              // Decrement the child count.
              count--;

              // If all children are done loading, call the callback.
              if (!count) {

                // Callback that we are done loading this tree.
                if (callback) {
                  callback.call(node, node);
                }

                // Make this node busy.
                if (!hideBusy) {
                  node.setBusy(false, busyloadingall);
                }
              }
            }, operation, hideBusy, ids);
          };
        };

        // Iterate through each child.
        while (i--) {

          // Load recurssion on a separate thread.
          setTimeout(loadChildren(i), 2);
        }
      });
    };

    /**
     * Expands the node.
     */
    TreeNode.prototype.expand = function(state) {
      if (state) {
        this.link.removeClass('collapsed').addClass('expanded');
        this.span.removeClass('collapsed').addClass('expanded');
        this.childlist.show('fast');

        // If this node is checked as including children, go through and select
        // all of it's children.
        if (!params.deepLoad && this.checked && this.include_children) {
          this.include_children = false;
          this.selectChildren(true);
        }
      }
      // Only collapse if they can open it back up.
      else if (this.span.length > 0) {
        this.link.removeClass('expanded').addClass('collapsed');
        this.span.removeClass('expanded').addClass('collapsed');
        this.childlist.hide('fast');
      }

      // If the state is expand, but the children have not been loaded.
      if (state && !this.isLoaded()) {

        // If there are no children, then we need to load them.
        this.loadNode(function(node) {
          if (node.checked) {
            node.selectChildren(node.checked);
          }
          node.expand(true);
        });
      }
    };

    /**
     * Selects all children of this node.
     *
     * @param {boolean} state The state of the selection or array of defaults.
     * @param {function} done Called when we are done selecting.
     */
    TreeNode.prototype.selectChildren = function(state, done, child) {

      // See if the state is a boolean.
      var defaults = (typeof state == 'object');

      // Create a function to call when we are done selecting.
      var doneSelecting = function() {
        if (!child) {

          // If they provided a selected parameter.
          if (params.selected) {
            params.selected(this, true);
          }

          // Say that we are done.
          if (done) {

            done.call(this);
          }
        }
      };

      if (params.deepLoad) {

        // Load all nodes underneath this node.
        this.loadAll(function() {

          // Set this node not busy.
          this.setBusy(false, busyselecting);

          // We are done selecting.
          doneSelecting.call(this);

        }, function(node) {

          var val = state;
          if (defaults) {
            val = state.hasOwnProperty(node.value);
            val |= state.hasOwnProperty(node.id);
          }

          // Select this node.
          node.select(val);
        });
      }
      else {

        // Select the current node.
        this.select(state);
        var name = params.inputName + '-' + this.value;
        $('input[name="' + name + '-include-below"]').attr(
          'name',
          name
        );

        // We should load children if the current node is expanded, or the
        // current node is being deselected and possibly has children selected
        // below them.
        if ((this.root === true) ||
            (state === false && !this.include_children) ||
            (this.link !== undefined && this.link[0] !== undefined &&
             this.link[0].className.indexOf('expanded') !== -1)
           ) {
          this.include_children = false;
          this.expand(state);
          var i = this.children.length;
          while (i--) {

            // Select all the children.
            this.children[i].selectChildren(state, done, true);
          }
        }
        else {
          // Flag this noad as including all children below if it has children.
          if (this.has_children > 0 && state) {
            this.include_children = true;
            $('input[name="' + name + '"]').attr(
              'name',
              name + '-include-below'
            );
          }
        }

        // We are done selecting.
        doneSelecting.call(this);
      }
    };

    /**
     * Selects default values of the TreeNode.
     *
     * @param {boolean} defaults Array of defaults.
     * @param {function} done Called when we are done selecting.
     */
    TreeNode.prototype.selectDefaults = function(defaults, done) {

      var defaultsLeft = Object.keys(defaults).length;

      var defaultsQueue = [];
      defaultsQueue.push(this);

      // Loop through nodes depth first to find the defaults.
      while (defaultsLeft > 0 && defaultsQueue.length > 0) {
        var queueItem = defaultsQueue.shift();
        var state = false;

        // Check if the queued item is listed in the defaults.
        if (defaults.hasOwnProperty(queueItem.value)) {
          delete defaults[queueItem.value];
          state = true;
          defaultsLeft--;
        }
        if (defaults.hasOwnProperty(queueItem.id)) {
          delete defaults[queueItem.id];
          state = true;
          defaultsLeft--;
        }

        // Check if the queued item is listed in the defaults and is flagged to
        // include defaults.
        if (defaults.hasOwnProperty(queueItem.value + '-include-below')) {
          delete defaults[queueItem.value + '-include-below'];
          queueItem.include_children = true;
          state = true;
          defaultsLeft--;
        }
        if (defaults.hasOwnProperty(queueItem.id + '-include-below')) {
          delete defaults[queueItem.id + '-include-below'];
          queueItem.include_children = true;
          state = true;
          defaultsLeft--;
        }

        // Select the queued item.
        queueItem.select(state);

        // Set the input name to the correct value.
        var name = params.inputName + '-' + queueItem.value;
        $('input[name="' + name + '-include-below"]').attr('name', name);
        if (!queueItem.root && state && queueItem.include_children) {
          $('input[name="' + name + '"]').attr('name', name + '-include-below');
        }
        else if (defaultsLeft > 0) {
          // Add this node's children to the queue.
          var i = queueItem.children.length;
          while (i--) {
            defaultsQueue.push(queueItem.children[i]);
          }
        }
        else if (queueItem.root && queueItem.include_children) {

          // Select the root node's children.
          queueItem.selectChildren(true);
        }
      }

      // Say this node is now fully selected.
      if (params.selected) {
        params.selected(this, true);
      }

      // Say we are now done.
      if (done) {
        done.call(this);
      }
    };

    /**
     * Sets the checked state for the input field depending on the state.
     *
     * @param {boolean} state
     */
    TreeNode.prototype.setChecked = function(state) {

      // Set the checked state.
      this.checked = state;

      // Set the checked state for this input.
      if (this.input.length > 0) {
        this.input.eq(0)[0].checked = state;
      }

      // Trigger the change event.
      this.input.change();
    };

    /**
     * Selects a node.
     *
     * @param {boolean} state The state of the selection.
     */
    TreeNode.prototype.select = function(state) {

      // Only check this node if it is a selectable input.
      if (!this.input.hasClass('treenode-no-select')) {

        // Convert state to a boolean.
        state = !!state;

        // Select the element unless the state is false and we are on the root
        // element which isn't unselectable.
        if (state || !this.root || (this.showRoot && this.has_children)) {

          // Set the checked state.
          this.setChecked(state);

          // Say that this node is selected.
          if (params.selected) {
            params.selected(this);
          }
        }
      }
    };

    /**
     * Build the treenode element.
     */
    TreeNode.prototype.build_treenode = function() {
      var treenode = $();
      treenode = $(document.createElement(this.root ? 'div' : 'li'));
      treenode.addClass('treenode');
      treenode.addClass(this.odd ? 'odd' : 'even');
      return treenode;
    };

    /**
     * Build the input and return.
     */
    TreeNode.prototype.build_input = function(left) {

      // Only add an input if the input name is defined.
      if (params.inputName) {

        // If this node is excluded or has no roles enabled in the group finder,
        // then add a dummy div tag.
        if ((typeof this.exclude[this.id] !== 'undefined') ||
          (params.inputName == 'group_finder' && !this.data.roles_enabled)) {
          this.input = $(document.createElement('div'));
          this.input.addClass('treenode-no-select');
        }
        else {

          // Create the input element.
          this.input = $(document.createElement('input'));

          // Get the value for this input item.
          var value = this.value || this.id;

          // Create the attributes for this input item.
          this.input.attr({
            'type': 'checkbox',
            'value': value,
            'name': params.inputName + '-' + value,
            'id': 'choice_' + this.id
          }).addClass('treenode-input');

          // Check the input.
          this.setChecked(this.checked);

          // Bind to the click on the input.
          this.input.bind('click', (function(node) {
            return function(event) {

              // Set the checked state based on input.
              node.checked = event.target.checked;

              // Only expand/collapse and select children if auto select
              // children is enabled.
              if (params.autoSelectChildren) {
                // Expand if deep loading. Collapse if unchecked.
                if (!node.checked || params.deepLoad) {
                  node.expand(node.checked);
                }

                // Call the select method.
                node.selectChildren(node.checked);
              }
            };
          })(this));

          // If this is a root item and we are not showing the root item, then
          // just hide the input.
          if (this.root && !params.showRoot) {
            this.input.hide();
          }
        }

        // Set the input left.
        this.input.css('left', left + 'px');
      }
      return this.input;
    };

    /**
     * Creates a node link.
     */
    TreeNode.prototype.build_link = function(element) {
      element.css('cursor', 'pointer').addClass('collapsed');
      element.bind('click', {node: this}, function(event) {
        event.preventDefault();
        event.data.node.expand($(event.target).hasClass('collapsed'));
      });
      return element;
    };

    /**
     * Build the span +/- symbol.
     */
    TreeNode.prototype.build_span = function(left) {

      // If we are showing the root item or we are not root, and we have
      // children, show a +/- symbol.
      if ((!this.root || this.showRoot) && this.has_children) {
        this.span = this.build_link($(document.createElement('span')).attr({
          'class': 'treeselect-expand'
        }));
        this.span.css('left', left + 'px');
      }
      return this.span;
    };

    /**
     * Build the title link.
     */
    TreeNode.prototype.build_title = function(left) {

      // If there is a title, then build it.
      if ((!this.root || this.showRoot) && this.title) {

        // Create a node link.
        this.nodeLink = $(document.createElement('a')).attr({
          'class': 'treeselect-title',
          'href': this.url,
          'target': '_blank'
        }).css('marginLeft', left + 'px').text(this.title);

        // If this node has children, then it should be a link.
        if (this.has_children) {
          this.link = this.build_link(this.nodeLink.clone());
        }
        else {
          this.link = $(document.createElement('div')).attr({
            'class': 'treeselect-title'
          }).css('marginLeft', left + 'px').text(this.title);
        }
      }

      // Return the link.
      return this.link;
    };

    /**
     * Build the children.
     */
    TreeNode.prototype.build_children = function(done) {

      // Create the childlist element.
      this.childlist = $();

      // If this node has children.
      if (this.children.length > 0) {

        // Create the child list.
        this.childlist = $(document.createElement('ul'));

        // Set the odd state.
        var odd = this.odd;

        // Get the number of children.
        var numChildren = this.children.length;

        // Function to append children.
        var appendChildren = function(treenode, index) {
          return function() {

            // Add the child tree to the list.
            treenode.children[index].build(function(child) {

              // Decrement the number of children loaded.
              numChildren--;

              // Append the child to the list.
              treenode.childlist.append(child.display);

              // If there are no more chlidren, then say we are done.
              if (!numChildren) {
                done.call(treenode, treenode.childlist);
              }
            });
          };
        };

        // Now if there are children, iterate and build them.
        for (var i in this.children) {

          // Make sure the child is a valid object in the list.
          if (this.children.hasOwnProperty(i)) {

            // Set the child.
            var child = this.children[i];

            // Alternate the odd state.
            odd = !odd;

            // Get the checked value.
            var isChecked = this.checked;
            if (child.hasOwnProperty('checked')) {
              isChecked = child.checked;
            }

            // Create a new TreeNode for this child.
            this.children[i] = new TreeNode($.extend(child, {
              level: this.level + 1,
              odd: odd,
              checked: isChecked,
              exclude: this.exclude
            }));

            // Set timeout to help with recursion.
            setTimeout(appendChildren(this, i), 2);
          }
        }
      }
      else {

        // Call that we are done loading this child.
        done.call(this, this.childlist);
      }
    };

    /**
     * Builds the DOM and the tree for this node.
     */
    TreeNode.prototype.build = function(done) {

      // Keep track of the left margin for each element.
      var left = 5, elem = null;

      // Create the list display.
      if (this.display.length === 0) {
        this.display = this.build_treenode();
      }
      else if (this.root) {
        var treenode = this.build_treenode();
        this.display.append(treenode);
        this.display = treenode;
      }

      // Now append the input.
      if ((this.input.length === 0) &&
          (elem = this.build_input(left)) &&
          (elem.length > 0)) {

        // Add the input to the display.
        this.display.append(elem);
        left += params.colwidth;
      }

      // Now create the +/- sign if needed.
      if (this.span.length === 0) {
        this.display.append(this.build_span(left));
        left += params.colwidth;
      }

      // Now append the node title.
      if (this.link.length === 0) {
        this.display.append(this.build_title(left));
      }

      // Called when the node is done building.
      var onDone = function() {

        // See if they wish to alter the build.
        if (params.onbuild) {
          params.onbuild(this);
        }

        // Create a search item.
        this.searchItem = this.display.clone();
        $('.treeselect-expand', this.searchItem).remove();

        // If the search title is not a link, then make it one...
        var searchTitle = $('div.treeselect-title', this.searchItem);
        if (searchTitle.length > 0) {
          searchTitle.replaceWith(this.nodeLink);
        }

        // See if they wish to hook into the postbuild process.
        if (params.postbuild) {
          params.postbuild(this);
        }

        // Check if this node is excluded, and hide if so.
        if (typeof this.exclude[this.id] !== 'undefined') {
          if ($('.treenode-input', this.display).length === 0) {
            this.display.hide();
          }
        }

        // If they wish to know when we are done building.
        if (done) {
          done.call(this, this);
        }
      };

      // Append the children.
      if (this.childlist.length === 0) {
        this.build_children(function(children) {
          if (children.length > 0) {
            this.display.append(children);
          }
          onDone.call(this);
        });
      }
      else {
        onDone.call(this);
      }
    };

    /**
     * Returns the selectAll text if that applies to this node.
     */
    TreeNode.prototype.getSelectAll = function() {
      if (this.root && this.selectAll) {
        return this.selectAllText;
      }
      return false;
    };

    /**
     * Search this node for matching text.
     *
     * @param {string} text The text to search for.
     * @param {function} callback Called with the results of this search.
     */
    TreeNode.prototype.search = function(text, callback) {
      // If no text was provided, then just return the root children.
      if (!text) {
        if (callback) {
          callback(this.children, false);
        }
      }
      else {

        // Initialize our results.
        var results = {};

        // Convert the text to lowercase.
        text = text.toLowerCase();

        // See if they provided a search endpoint.
        if (params.searcher) {

          // Call the searcher for the new nodes.
          params.searcher(this, text, function(nodes, getNode) {

            // Get the number of nodes.
            var numNodes = Object.keys(nodes).length;

            // If no nodes were returned then return nothing.
            if (numNodes === 0) {
              callback(results, true);
            }

            // Called when the tree node is built.
            var onBuilt = function(id) {

              // Return the method to call when the node is built.
              return function(treenode) {

                // Decrement the counter.
                numNodes--;

                // Add the node to the results.
                results[id] = treenode;

                // If no more nodes are loading, then callback.
                if (!numNodes) {

                  // Callback with the search results.
                  callback(results, true);
                }
              };
            };

            // Iterate through all the nodes.
            for (var id in nodes) {

              // Set the treenode.
              var treenode = new TreeNode(getNode ? getNode(nodes[id]) : nodes[id]);

              // Say this node is loaded.
              treenode.nodeloaded = true;

              // Add to the loaded nodes array.
              loadedNodes[treenode.id] = treenode.id;

              // Build the node.
              treenode.build(onBuilt(id));
            }
          });
        }
        else {

          // Load all nodes.
          this.loadAll(function(node) {

            // Callback with the results of this search.
            if (callback) {
              callback(results, true);
            }
          }, function(node) {

            // If we are not the root node, and the text matches the title.
            if (!node.root && node.title.toLowerCase().search(text) !== -1) {

              // Add this to our search results.
              results[node.id] = node;
            }
          }, true);
        }
      }
    };

    // Iterate through each instance.
    return $(this).each(function() {

      // Get the tree node parameters.
      var treeParams = $.extend(params, {display: $(this)});

      // Create a root tree node and load it.
      var root = this.treenode = new TreeNode(treeParams, true);

      // Add a select all link.
      var selectAll = root.getSelectAll();
      if (selectAll !== false && !root.showRoot) {

        // See if the select all button should be checked.
        var checked = false;
        var default_value = params.default_value;
        if (default_value.hasOwnProperty(root.value + '-include-below')) {
          checked = true;
        }

        // Create an input element.
        var inputElement = $(document.createElement('input')).attr({
          'type': 'checkbox'
        });

        // Set the checked state.
        inputElement.eq(0)[0].checked = checked;

        // Bind to the click event.
        inputElement.bind('click', function(event) {
          root.selectChildren(event.target.checked);
        });

        // Add the input item to the root.
        root.display.append(inputElement);

        // If they provided select all text, add it here.
        if (selectAll) {
          var span = $(document.createElement('span')).attr({
            'class': 'treeselect-select-all'
          }).html(selectAll);
          root.display.append(span);
        }
      }

      // Create a loading span.
      var initBusy = $(document.createElement('span')).addClass('treebusy');
      root.display.append(initBusy.css('display', 'block'));

      // Called when the root node is done loading.
      var doneLoading = function() {

        // Remove the init busy cursor.
        initBusy.remove();

        // Call the treeloaded params.
        if (params.treeloaded) {
          params.treeloaded(this);
        }
      };

      // Load the node.
      root.loadNode(function(node) {

        // Check the length of children in this node.
        if (node.children.length === 0) {

          // If the root node does not have any children, then hide.
          node.display.hide();
        }

        // Expand this root node.
        node.expand(true);

        // Select this node based on the default value.
        node.select(node.checked);

        // Set the defaults for all the children.
        var defaults = node.checked;
        if (!jQuery.isEmptyObject(params.default_value)) {
          defaults = params.default_value;
        }

        // If there are defaults, then select the children with them.
        if (defaults) {

          // Select the children based on the defaults.
          if (params.deepLoad) {
            node.selectChildren(defaults, function() {
              doneLoading.call(node);
            });
          }
          else {
            // When not deep loading, use selectDefaults to search for defaults
            // using breadth first check.
            node.selectDefaults(defaults, function() {
              doneLoading.call(node);
            });
          }
        }
        else {
          doneLoading.call(node);
        }
      });

      // If the root element doesn't have children, then hide the treeselect.
      if (!root.has_children) {
        this.parentElement.style.display = 'none';
      }
    });
  };
})(jQuery);

/* ]]> */
						</script><script type="text/javascript">
							/* <![CDATA[ */
/* FileSaver.js
* A saveAs() FileSaver implementation.
* 2013-10-21
*
* By Eli Grey, http://eligrey.com
* License: X11/MIT
*   See LICENSE.md
*/

/*global self */
/*jslint bitwise: true, regexp: true, confusion: true, es5: true, vars: true, white: true,
plusplus: true */

/*! @source http://purl.eligrey.com/github/FileSaver.js/blob/master/FileSaver.js */
(function ($, undefined) {
    $.saveAs = $.saveAs
	  || (typeof navigator !== 'undefined' && navigator.msSaveOrOpenBlob && navigator.msSaveOrOpenBlob.bind(navigator))
		  || (function (view) {
		      "use strict";
		      var
				  doc = view.document
		      // only get URL when necessary in case BlobBuilder.js hasn't overridden it yet
					  , get_URL = function () {
					      return view.URL || view.webkitURL || view;
					  }
				, URL = view.URL || view.webkitURL || view
				, save_link = /* CUSTOM CODE START */doc.createElementNS && /* CUSTOM CODE END */doc.createElementNS("http://www.w3.org/1999/xhtml", "a")
				, can_use_save_link = /* CUSTOM CODE START */save_link && /* CUSTOM CODE END */!view.externalHost && "download" in save_link
					  , click = function (node) {
					      var event = doc.createEvent("MouseEvents");
					      event.initMouseEvent(
							"click", true, false, view, 0, 0, 0, 0, 0
							, false, false, false, false, 0, null
						);
					      node.dispatchEvent(event);
					  }
				, webkit_req_fs = view.webkitRequestFileSystem
				, req_fs = view.requestFileSystem || webkit_req_fs || view.mozRequestFileSystem
				, throw_outside = function (ex) {
				    (view.setImmediate || view.setTimeout)(function () {
				        throw ex;
				    }, 0);
				}
				, force_saveable_type = "application/octet-stream"
				, fs_min_size = 0
				, deletion_queue = []
					  , process_deletion_queue = function () {
					      var i = deletion_queue.length;
					      while (i--) {
					          var file = deletion_queue[i];
					          if (typeof file === "string") { // file is an object URL
					              URL.revokeObjectURL(file);
					          } else { // file is a File
					              file.remove();
					          }
					      }
					      deletion_queue.length = 0; // clear queue
					  }
					  , dispatch = function (filesaver, event_types, event) {
					      event_types = [].concat(event_types);
					      var i = event_types.length;
					      while (i--) {
					          var listener = filesaver["on" + event_types[i]];
					          if (typeof listener === "function") {
					              try {
					                  listener.call(filesaver, event || filesaver);
					              } catch (ex) {
					                  throw_outside(ex);
					              }
					          }
					      }
					  }
					  , FileSaver = function (blob, name) {
					      // First try a.download, then web filesystem, then object URLs
					      var
							  filesaver = this
							, type = blob.type
							, blob_changed = false
							, object_url
							, target_view
								  , get_object_url = function () {
								      var object_url = get_URL().createObjectURL(blob);
								      deletion_queue.push(object_url);
								      return object_url;
								  }
								  , dispatch_all = function () {
								      dispatch(filesaver, "writestart progress write writeend".split(" "));
								  }
					      // on any filesys errors revert to saving with object URLs
								  , fs_error = function () {
								      // don't create more object URLs than needed
								      if (blob_changed || !object_url) {
								          object_url = get_object_url(blob);
								      }
								      if (target_view) {
								          target_view.location.href = object_url;
								      } else {
								          window.open(object_url, "_blank");
								      }
								      filesaver.readyState = filesaver.DONE;
								      dispatch_all();
								  }
								  , abortable = function (func) {
								      return function () {
								          if (filesaver.readyState !== filesaver.DONE) {
								              return func.apply(this, arguments);
								          }
								      };
								  }
								  , create_if_not_found = { create: true, exclusive: false }
							, slice
					      ;
					      filesaver.readyState = filesaver.INIT;
					      if (!name) {
					          name = "download";
					      }
					      if (can_use_save_link) {
					          object_url = get_object_url(blob);
					          // FF for Android has a nasty garbage collection mechanism
					          // that turns all objects that are not pure javascript into 'deadObject'
					          // this means `doc` and `save_link` are unusable and need to be recreated
					          // `view` is usable though:
					          doc = view.document;
					          save_link = doc.createElementNS("http://www.w3.org/1999/xhtml", "a");
					          save_link.href = object_url;
					          save_link.download = name;
					          var event = doc.createEvent("MouseEvents");
					          event.initMouseEvent(
								"click", true, false, view, 0, 0, 0, 0, 0
								, false, false, false, false, 0, null
							);
					          save_link.dispatchEvent(event);
					          filesaver.readyState = filesaver.DONE;
					          dispatch_all();
					          return;
					      }
					      // Object and web filesystem URLs have a problem saving in Google Chrome when
					      // viewed in a tab, so I force save with application/octet-stream
					      // http://code.google.com/p/chromium/issues/detail?id=91158
					      if (view.chrome && type && type !== force_saveable_type) {
					          slice = blob.slice || blob.webkitSlice;
					          blob = slice.call(blob, 0, blob.size, force_saveable_type);
					          blob_changed = true;
					      }
					      // Since I can't be sure that the guessed media type will trigger a download
					      // in WebKit, I append .download to the filename.
					      // https://bugs.webkit.org/show_bug.cgi?id=65440
					      if (webkit_req_fs && name !== "download") {
					          name += ".download";
					      }
					      if (type === force_saveable_type || webkit_req_fs) {
					          target_view = view;
					      }
					      if (!req_fs) {
					          fs_error();
					          return;
					      }
					      fs_min_size += blob.size;
					      req_fs(view.TEMPORARY, fs_min_size, abortable(function (fs) {
					          fs.root.getDirectory("saved", create_if_not_found, abortable(function (dir) {
					              var save = function () {
					                  dir.getFile(name, create_if_not_found, abortable(function (file) {
					                      file.createWriter(abortable(function (writer) {
					                          writer.onwriteend = function (event) {
					                              target_view.location.href = file.toURL();
					                              deletion_queue.push(file);
					                              filesaver.readyState = filesaver.DONE;
					                              dispatch(filesaver, "writeend", event);
					                          };
					                          writer.onerror = function () {
					                              var error = writer.error;
					                              if (error.code !== error.ABORT_ERR) {
					                                  fs_error();
					                              }
					                          };
					                          "writestart progress write abort".split(" ").forEach(function (event) {
					                              writer["on" + event] = filesaver["on" + event];
					                          });
					                          writer.write(blob);
					                          filesaver.abort = function () {
					                              writer.abort();
					                              filesaver.readyState = filesaver.DONE;
					                          };
					                          filesaver.readyState = filesaver.WRITING;
					                      }), fs_error);
					                  }), fs_error);
					              };
					              dir.getFile(name, { create: false }, abortable(function (file) {
					                  // delete file if it already exists
					                  file.remove();
					                  save();
					              }), abortable(function (ex) {
					                  if (ex.code === ex.NOT_FOUND_ERR) {
					                      save();
					                  } else {
					                      fs_error();
					                  }
					              }));
					          }), fs_error);
					      }), fs_error);
					  }
				, FS_proto = FileSaver.prototype
					  , saveAs = function (blob, name) {
					      return new FileSaver(blob, name);
					  }
		      ;
		      FS_proto.abort = function () {
		          var filesaver = this;
		          filesaver.readyState = filesaver.DONE;
		          dispatch(filesaver, "abort");
		      };
		      FS_proto.readyState = FS_proto.INIT = 0;
		      FS_proto.WRITING = 1;
		      FS_proto.DONE = 2;

		      FS_proto.error =
			FS_proto.onwritestart =
			FS_proto.onprogress =
			FS_proto.onwrite =
			FS_proto.onabort =
			FS_proto.onerror =
			FS_proto.onwriteend =
				null;
		      /* CUSTOM CODE REPLACE START */
		      if (view.addEventListener) {
		          view.addEventListener("unload", process_deletion_queue, false);
		      } else {
		          view.attachEvent("unload", process_deletion_queue);
		      }
		      // view.addEventListener("unload", process_deletion_queue, false);
		      /* CUSTOM CODE REPLACE END */
		      return saveAs;
		  }(this.self || this.window || this.content));
    // `self` is undefined in Firefox for Android content script context
    // while `this` is nsIContentFrameMessageManager
    // with an attribute `content` that corresponds to the window
}(jQuery));

if (typeof module !== 'undefined') module.exports = saveAs;
/* ]]> */
						</script><script type="text/javascript">
							/* <![CDATA[ */
var attachmentsDataArray = new Object();
var fillerUri = "http://localhost/eGO.Filler.WS/FillerService.svc/rest/";

function GetData(acceptEmptyForm) {

    if (acceptEmptyForm == undefined) {
        acceptEmptyForm = false;
    }

    var formId = GetFormId();
    var xmlns = GetMetadataNamespace();
    var xml = '<' + formId + xmlns + '>';
    var hasMetadata = $("#mtd_formMetaData").length > 0;
    function processHtml() {
        var element = $(this);
        var isempty = 'isempty';

        if (!acceptEmptyForm && element.attr(isempty) !== undefined && element.attr(isempty) == "true")
            return;

        var name = 'name';
        var layoutRow = 'layoutRow';
        var firstInput;
        if (element.hasClass(layoutRow)) {
            firstInput = element.children("input:first");
            if (firstInput.attr(name) != 'Attachments') {
                if (element.hasClass('hiddenSection')) {
                    xml += '<' + disableValidatorPrefix + firstInput.attr(name) + '>';
                } else {
                    xml += '<' + firstInput.attr(name) + '>';
                }
            }
        }

        if (element.is(':input')) {
            if (element.is(':file') || element.is(':button') || element.attr('LookupDetailInfo') == "true")
                return;

            if (element.parent().hasClass(layoutRow))
                return;

            var attr = element.attr(name);
            if (attr !== undefined) {
                var index = attr.indexOf(sign);
                if (index > -1) {
                    attr = attr.substr(0, index);
                }
                var checked = ':checked';
                var val;
                if (element.is(':radio')) {
                    if (element.is(checked)) {
                        var cleanName = GetValueWithoutIncremental(attr);

                        xml += '<' + cleanName + '>' + element.val() + '</' + cleanName + '>';
                    }
                } else if (element.is(':checkbox')) {
                    if (element.is(checked)) {
                        if (!hasMetadata) {
                            xml += '<' + attr + '>' + ((element.hasClass("checkBox")) ? 1 : element.val()) + '</' + attr + '>';
                        } else {
                            xml += '<' + attr + '>' + ((element.hasClass("checkBox") && element.hasClass("xsd_boolean")) ? 1 : element.val()) + '</' + attr + '>';
                        }
                    } else {
                        if (element.hasClass("checkBox")) {
                            if (!hasMetadata) {
                                xml += '<' + attr + '>' + 0 + '</' + attr + '>';
                            } else {
                                if (element.hasClass("xsd_boolean")) {
                                    xml += '<' + attr + '>' + 0 + '</' + attr + '>';
                                }
                            }
                        }
                    }
                } else if (element.attr("multiple")) {
                    val = element.val() === null ? "" : element.val();
                    for (var i = 0, j = val.length; i < j; i++) {
                        xml += '<' + attr + '>' + HtmlEncode(val[i]) + '</' + attr + '>';
                    }
                } else {
                    val = element.val() === null ? "" : element.val();

                    if (element.hasClass("xsd_decimal"))
                        val = val.replace(',', '.');
                    else if (element.hasClass("xsd_date"))
                        val = xmlHelper.toXmlDate(val);
                    else if (element.hasClass("xsd_time"))
                        val = xmlHelper.toXmlTime(val);
                    else if (element.hasClass("xsd_dateTime"))
                        val = xmlHelper.toXmlDateTime(val);

                    xml += '<' + attr + '>' + HtmlEncode(val) + '</' + attr + '>';
                }
            }
        }

        if (acceptEmptyForm)
            element.children().each(processHtml);
        else {
            if (element.attr(isempty) === undefined || element.attr(isempty) == "false")
                element.children().each(processHtml);
        }

        if (element.hasClass(layoutRow)) {
            firstInput = element.children("input:first");
            if (firstInput.attr(name) != 'Attachments') {
                if (element.hasClass('hiddenSection')) {
                    xml += '</' + disableValidatorPrefix + firstInput.attr(name) + '>';
                } else {
                    xml += '</' + firstInput.attr(name) + '>';
                }
            }
        }
    }

    $('#main').children('div').each(processHtml);

    xml += '</' + formId + '>';

    return xml;
}

var xmlHelper = (function (helper) {
    var toDateRegex = /^([0-9]{1,2})\.([0-9]{1,2})\.([0-9]{1,4})$/g,
	    fromDateRegex = /^([0-9]{1,4})\-([0-9]{1,2})\-([0-9]{1,2})$/g,
        toTimeRegex = /^([0-9]{1,2})\:([0-9]{1,2})$/g,
        fromTimeRegex = /^([0-9]{1,2})\:([0-9]{1,2})\:([0-9]{1,2})$/g,
        toDateTimeRegex = /^([0-9]{1,2})\.([0-9]{1,2})\.([0-9]{1,4}) ([0-9]{1,2})\:([0-9]{1,2})$/g,
	    fromDateTimeRegex = /^([0-9]{1,4})\-([0-9]{1,2})\-([0-9]{1,2})T([0-9]{1,2})\:([0-9]{1,2})\:([0-9]{1,2})$/g;

    helper.toXmlDate = function (value) {
        if (value) {
            toDateRegex.lastIndex = 0;
            var matches = toDateRegex.exec($.trim(value));
            if (matches && matches.length === 4) {
                value = matches[3] + '-' + matches[2] + '-' + matches[1];
            }
        }

        return value || '';
    };

    helper.fromXmlDate = function (value) {
        if (value) {
            fromDateRegex.lastIndex = 0;
            var matches = fromDateRegex.exec($.trim(value));
            if (matches && matches.length === 4) {
                value = matches[3] + '.' + matches[2] + '.' + matches[1];
            }
        }

        return value || '';
    };

    helper.toXmlTime = function (value) {
        if (value) {
            toTimeRegex.lastIndex = 0;
            var matches = toTimeRegex.exec($.trim(value));
            if (matches && matches.length === 3) {
                value = matches[1] + ':' + matches[2] + ':00';
            }
        }

        return value || '';
    };

    helper.fromXmlTime = function (value) {
        if (value) {
            fromTimeRegex.lastIndex = 0;
            var matches = fromTimeRegex.exec($.trim(value));
            if (matches && matches.length === 4) {
                value = matches[1] + ':' + matches[2];
            }
        }

        return value || '';
    };

    helper.toXmlDateTime = function (value) {
        if (value) {
            toDateTimeRegex.lastIndex = 0;
            var matches = toDateTimeRegex.exec($.trim(value));
            if (matches && matches.length === 6) {
                value = matches[3] + '-' + matches[2] + '-' + matches[1] + 'T' + matches[4] + ':' + matches[5] + ':00';
            }
        }

        return value || '';
    };

    helper.fromXmlDateTime = function (value) {
        if (value) {
            fromDateTimeRegex.lastIndex = 0;
            var matches = fromDateTimeRegex.exec($.trim(value));
            if (matches && matches.length === 7) {
                value = matches[3] + '.' + matches[2] + '.' + matches[1] + ' ' + matches[4] + ':' + matches[5];
            }
        }

        return value || '';
    };

    helper.fromXmlAnyURI = function (value) {
        if (value) {
            value = value.replace(/mailto:/gi, "");
        }

        return value || '';
    };

    return helper;
}({}));

function GetMetadataNamespace() {
    var xmlns = '';
    var mtdNamespace = $('form').find("#mtd_namespace")[0];
    if (mtdNamespace != undefined) {
        mtdNamespace = mtdNamespace.innerHTML;
        if (mtdNamespace != undefined && mtdNamespace != xmlns) {
            xmlns = " xmlns='" + mtdNamespace + "'";
        }
    }
    return xmlns;
}

function GetValueWithoutIncremental(value) {
    var regEx = new RegExp(repeatingPostfix + "\\d+$");
    return value.replace(regEx, '');
}

function ShowData() {
    var xml = GetData();
    alert(decodeURIComponent(xml));
}

function ShowDataWithAttachments() {
    var xml = GetData();
    var formId = GetFormId();
    var xmlWithAttachments = xml.replace('</' + formId + '>', '');

    var attachmentsData = '';
    for (var key in attachmentsDataArray) {
        attachmentsData = attachmentsData + attachmentsDataArray[key];
    }

    xmlWithAttachments += '<Attachments>' + attachmentsData + '</Attachments>';
    xmlWithAttachments += '</' + formId + '>';

    var parentWindow = window.opener;
    parentWindow.setFinalXml(xmlWithAttachments);
}

function SaveXml() {
    localStorage.setItem(GetFormStorageKey(), GetData());
    var message = '';

    switch (GetFormLanguage()) {
        case 'en':
            message = "Form " + "'" + GetFormStorageKey().replace('ego_', '') + "'" + " has been successfully stored in the repository";
            break;

        default: // sk a default
            message = "Formular " + "'" + GetFormStorageKey().replace('ego_', '') + "'" + " bol uspesne ulozeny do lokalneho uloziska";
    }

    alert(message);

    ShowSavedForms();
}

function ShowSavedForms() {
    var savedForms = "<span class='fieldContent'>";
    var savedFormsCount = 0;

    for (var i = 0; i < localStorage.length; i++) {
        if (localStorage.key(i) == GetFormStorageKey()) {
            savedForms += "<span>" + localStorage.key(i).substr(4) + "</span><br/>";
            savedFormsCount++;
        }
    }
    savedForms += "</span>";

    $('#lcellSavedForms').html(savedForms);
    var element = $("#savedFormsContainer");
    if (savedFormsCount > 0) {
        element.show();
    }
    else {
        element.hide();
    }
}

function PrintForm() {
    window.print();
}

function GetFormId() {
    return $("form:has(#main)").attr("ID");
}

//////////////////// ML /////////////////////////

function IsError() {
    var errors = $('.error');

    for (i = 0; i < errors.length; i++) {
        if ($(errors[i]).is(':visible'))
            return true
    }

    return false;
}

////////////////////////////////////////////////

function ValidateForm() {
    //////////////////// ML /////////////////////////

    errorValidateFocusOut = false;

    if ($('#' + GetFormId()).valid()) {
        /*switch (GetFormLanguage()) {
            case 'en':
                alert("Check the form was successful.");
                break;

            default: // sk a default
                alert("Kontrola formulára prebehla úspešne.");
        }*/

        return true;
    }
    else if (IsError()) {
        /*switch (GetFormLanguage()) {
            case 'en':
                alert("The form contains the validation errors.");
                break;

            default: // sk a default
                alert("Formulár obsahuje validačné chyby.");
        }*/

        return false;
    }
    else {
        /*switch (GetFormLanguage()) {
            case 'en':
                alert("Formulár obsahuje logické chyby. Naozaj chcete pokračovať?");
                break;

            default: // sk a default
                alert("The form contains a logic error. Are you sure?");
        }*/

        return true;
    }

    ////////////////////////////////////////////////

    //return $('#' + GetFormId()).valid();
}

function CloseForm(fillerUri) {
    var xml = GetData();
    var parentWindow = window.opener;

    try {
        var formId = parentWindow.getFormId();
        var eDoc = TranslateNativeToEDoc(xml, fillerUri + "TranslateNativeToEDoc", formId);

        parentWindow.setXmlData(eDoc);

        window.close();
    } catch (err) {
        switch (GetFormLanguage()) {
            case 'en':
                alert('workdesk was closed');
                break;

            default: // sk a default
                alert('workdesk bol uzavretý');
        }
    }
}

function CancelForm() {
    window.close();
}

function SaveAndCloseForm(fillerUri) {
    var form = $('#' + GetFormId());
    var $validator = form.validate();
    var confirmText = '';

    switch (GetFormLanguage()) {
        case 'en':
            confirmText = "The form contains errors. Are you sure you want to save?";
            break;

        default: // sk a default
            confirmText = "Formulár obsahuje chyby. Naozaj ho chcete uložiť?";
    }

    ValidateForm(form);

    if ($validator.numberOfInvalids() > 0) {
        if (confirm(confirmText)) {
            CloseForm(fillerUri);
        } else {
        }
    }
    else {
        CloseForm(fillerUri);
    }
}

function GetAttachments() {
    var files = $('input[type="file"]')[0].files;
    var attachements = "";
    for (var i = 0; i < files.length; i++) {
        attachements += files[i].name + "<br/>";
    }

    return attachements;
}

function ClearForm(element) {
    $(element).find(':input').each(function () {
        switch (this.type) {
            case 'password':
            case 'select-multiple':
            case 'select-one':
            case 'text':
            case 'textarea':
                $(this).val('');
                break;
            case 'checkbox':
            case 'radio':
                this.checked = false;
        }
    });
}

function GetFormStorageKey() {
    var formId = GetFormId();
    return 'ego_' + formId;
}

function HandleFileSelect(evt) {
    var files = evt.target.files;

    for (var i = 0, f; f = files[i]; i++) {
        var reader = new FileReader();

        reader.onload = (function (theFile) {
            return function (e) {
                attachmentsDataArray[evt.target.id] = '<Attachment><Name>' + theFile.name + '</Name><Type>' + theFile.type
                    + '</Type><Size>' + theFile.size + '</Size>' + '<Content>' + e.target.result + '</Content></Attachment>';
            };
        })(files[0]);

        reader.readAsDataURL(files[0]);
    }
}

function WrapXmlData(xml) {
    return "<FormDataXml><XmlData>" + xml + "</XmlData></FormDataXml>";
}

function TranslateNativeToEDoc(xml, url, formId) {
    var formDataXml = WrapXmlData(xml);
    var formData = '{"FormId": "' + formId + '", "FormDataXml": "' + formDataXml + '"}';

    var contentType = "application/json";

    var eDoc = "";
    $.ajax({
        type: 'POST',
        url: url,
        data: formData,
        contentType: contentType,
        success: function (result) {
            eDoc = result;
        },
        error: function (result) {
            alert(result);
        },
        async: false
    });

    return eDoc.Content;
}

function ValidateFormWithXsd(fillerUri) {
    var xml = GetData();
    var parentWindow = window.opener;

    try {
        var formId = parentWindow.getFormId();
        var valRes = CallValidateFormWithXsd(xml, fillerUri + "ValidateFormWithXsd", formId);

        ShowValidationResult(valRes, "xsdValidation");

    } catch (err) {
        alert(err);
    }
}

function ValidateFormWithServer(fillerUri) {
    var xml = GetData();
    var parentWindow = window.opener;

    try {
        var formId = parentWindow.getFormId();
        var valRes = CallValidateFormWithServer(xml, fillerUri + "ValidateForm", formId);

        ShowValidationResult(valRes, "serverValidation");

    } catch (err) {
        alert(err);
    }
}

function ShowValidationResult(result, validationType) {
    var valid = true;
    var resultXML = $.parseXML(result),
    resultXMLTraversable = $(resultXML);
    var responseCode = resultXMLTraversable.find("response > code").text();
    var responseErrors = resultXMLTraversable.find("response > errors > error");
    var responseXsltErrors = resultXMLTraversable.find("response > errors > xsltError");
    var localErrors = new Array();
    var ok = "ok";
    validatorObject.resetForm();

    if (responseCode == ok && responseErrors.length == 0 && responseXsltErrors.length == 0) {
        validatorObject.resetForm();
        statusDialog.hideProgress();

        switch (GetFormLanguage()) {
            case 'en': {
                statusDialog.setMessage(validationType === "xsdValidation" ? "The form is valid against XSD schema." : "The form is valid.");
                statusDialog.setOptions({ "buttons": { "Ok": function () { statusDialog.hideDialog(); } } });
            }
                break;

            default: { // sk a default
                statusDialog.setMessage(validationType === "xsdValidation" ? "Formulár je validný voči XSD schéme." : "Formulár je validný.");
                statusDialog.setOptions({ "buttons": { "Ok": function () { statusDialog.hideDialog(); } } });
            }

        }

        statusDialog.showDialog();
    }

    var valMsg = new Object;
    responseErrors.each(function (index, item) {
        if (!AddValidationMessage(index, item, valMsg)) {
            localErrors.push($(item).text());
        }
    });

    if (responseCode != ok || responseErrors.length != 0) {
        valid = false;
        validatorObject.settings.onfocusout = false;
        validatorObject.showErrors(valMsg);
        validatorObject.focusInvalid();
    }

    if (responseCode != ok || responseXsltErrors.length != 0 || localErrors.length != 0) {
        valid = false;
        var xsltErrorDiv = $("#xsltErrorContainer");

        if (!xsltErrorDiv.length) {
            $('#errorsContainerDiv').after('<div id="xsltErrorContainer"></div>');
            xsltErrorDiv = $("#xsltErrorContainer");
        }
        else {
            xsltErrorDiv.empty();
        }

        responseXsltErrors.each(function (index, item) {
            var input = $(item);
            xsltErrorDiv.append('<li>' + input.text() + '</li>');
        });

        for (var i = 0; i < localErrors.length; i++) {
            xsltErrorDiv.append('<li>' + localErrors[i] + '</li>');
        }
    }
    else {
        var xsltErrorDiv = $('#xsltErrorContainer');
        if (xsltErrorDiv.length) {
            xsltErrorDiv.remove();
        }
    }
    return valid;
}

function CallValidateFormWithXsd(xml, url, formId) {
    var formDataXml = WrapXmlData(xml);
    var formData = '{"FormId": "' + formId + '", "FormDataXml": "' + formDataXml + '"}';

    var contentType = "application/json";

    var response = "";
    $.ajax({
        type: 'POST',
        url: url,
        data: formData,
        contentType: contentType,
        success: function (result) {
            response = result;
        },
        error: function (result) {
            alert(result);
        },
        async: false
    });

    return response.Details;
}

function CallValidateFormWithServer(xml, url, formId) {
    var formDataXml = WrapXmlData(xml);
    var formData = '{"FormId": "' + formId + '", "FormDataXml": "' + formDataXml + '"}';

    var contentType = "application/json";

    var response = "";
    $.ajax({
        type: 'POST',
        url: url,
        data: formData,
        contentType: contentType,
        success: function (result) {
            response = result;
        },
        error: function (result) {
            alert(result);
        },
        async: false
    });

    return response.Content;
}

function GetConfigurationValue(key, url, callbackName) {
    var parentWindow = window.opener;
    try {
        var formId = parentWindow.getFormId();
        var values = "ConfigurationKey=" + key + "&FormId=" + formId;
        var contentType = "application/json";

        $.ajax({
            url: url,
            dataType: "jsonp",
            contentType: contentType,
            data: values,
            jsonpCallback: callbackName,
            jsonp: 'callback'
        });
    } catch (err) {
        switch (GetFormLanguage()) {
            case 'en':
                alert('workdesk was closed');
                break;

            default: // sk a default
                alert('workdesk bol uzavretý');
        }
    }
}

function HtmlEncode(value) {
    if (value == null) {
        return value;
    }

    value = $('<div/>').text(value).html();
    value = value.replace(/&nbsp;/g, "&#160;");

    var coding = Array();

    coding['92'] = '#92';
    coding['10'] = '#10';
    coding['34'] = 'quot';
    var finalText = "";

    for (var i = 0; i < value.length ; i++) {
        var char = value.charCodeAt(i);
        var characters = value.charAt(i);

        for (var key in coding) {
            if (key == char) {
                characters = '&' + coding[char] + ';';
                break;
            }
        }

        finalText += characters;
    }

    return finalText;
}

function DisableForm() { $('form :input').attr('disabled', 'disabled'); }

function EnableForm() {
    $('form :input').each(function () {
        var input = $(this);
        if (input.attr('isReadonly') == undefined) {
            input.removeAttr('disabled');
        }
    });
}

function SaveXmlAs() {
    try {
        var xml = GetData();
        var fileName = GetFormId() + ".xml";
        this.SaveToFile(xml, 'text/xml', fileName);
    }
    catch (exc) {
        alert(exc);
    }
}

function SaveToFile(content, type, filename) {
    if (window.Blob === 'undefined' || !window.Blob) {
        switch (GetFormLanguage()) {
            case 'en':
                throw "Save this browser is not supported, use a newer browser version";

            default: // sk a default
                throw "Ukladanie v tomto prehliadači nie je podporované, použite novšiu verziu prehliadača";
        }
    }

    try {
        var blob = new Blob([content], { type: type });
        $.saveAs(blob, filename);
    }
    catch (exc) {
        switch (GetFormLanguage()) {
            case 'en':
                throw "Error saving the file to disk";

            default: // sk a default
                throw "Chyba pri ukladaní súboru na disk";
        }
    }
}

function LoadFromFile() {
    if (!window.FileReader) {
        switch (GetFormLanguage()) {
            case 'en':
                throw "This functionality is not supported in this browser, use a newer browser version"

            default: // sk a default
                throw "Táto funkcionalita nie je podporovaná v tomto prehliadači, použite novšiu verziu prehliadača"
        }
    }
    var content = $("#form-buttons-load-dialog");
    var exist = true;

    if (content.length == 0) {
        exist = false;
        var file = $('<input type="file" id="form-buttons-input-file"/>');
        var submit = '';

        switch (GetFormLanguage()) {
            case 'en': {
                submit = $('<input type="button" name="form-buttons-load-dialog-confirm" class="button ui-button ui-widget ui-state-default ui-corner-all ui-button-text-onl" value="Load file" id="form-buttons-load-dialog-confirm" disabled = "disabled" />');
                content = $('<div id="form-buttons-load-dialog" />').attr('title', "Select the xml file").append(file).append(submit);
            }
                break;

            default: { // sk a default
                submit = $('<input type="button" name="form-buttons-load-dialog-confirm" class="button ui-button ui-widget ui-state-default ui-corner-all ui-button-text-onl" value="Nahrať súbor" id="form-buttons-load-dialog-confirm" disabled = "disabled" />');
                content = $('<div id="form-buttons-load-dialog" />').attr('title', "Vyberte xml súbor").append(file).append(submit);
            }

        }

        submit.bind('click', function (e) {
            var dialog = $('#form-buttons-load-dialog');
            var input = $('input:file', dialog)[0];
            var currentFile = input.files[0];

            if (currentFile) {
                if (!currentFile.name.match(/^.*\.xml$/i)) {
                    switch (GetFormLanguage()) {
                        case 'en':
                            alert('Incorrect file format.');
                            break;

                        default: // sk a default
                            alert('Nesprávny formát súboru.');
                    }

                    return;
                }

                if (!currentFile.size > 15 * 1024 * 1024) {
                    switch (GetFormLanguage()) {
                        case 'en':
                            alert('The file must not be greater than 15MB.');
                            break;

                        default: // sk a default
                            alert('Súbor nesmie byť väčší ako 15MB.');
                    }

                    return;
                }
            }

            LoadXmlFromInput(currentFile);
        });

        file.bind('change', function (e) {
            if ($(e.target).val()) {
                $('#form-buttons-load-dialog-confirm').removeAttr('disabled');
            } else {
                $('#form-buttons-load-dialog-confirm').attr('disabled', 'disabled');
            }
        });

        $('#' + GetFormId()).append(content);
    }
    else {
        $("#form-buttons-input-file").val('');
    }

    content.dialog({
        autoOpen: false,
        modal: true,
        width: 500
    });

    if (!exist) {
        $('#form-buttons-load-dialog').closest(".ui-dialog").addClass("load-dialog");
    }

    content.dialog('open');
}

function LoadXmlFromInput(file) {
    var reader = new FileReader();
    var readerHelp = new FileReader();
    reader.onload = function (e) {
        try {
            var xmlDoc = $.parseXML(e.target.result);
            var indexes = Array();
            var nodeWithContains = new Array();
            var emptyNativeTemplate = GetEmptyNativeTemplate();
            var emptyNativeTemplateDoc = $.parseXML(emptyNativeTemplate);
            AddMissingElements(xmlDoc.childNodes[0], emptyNativeTemplateDoc.childNodes[0], nodeWithContains);
            LoadXml(xmlDoc.childNodes[0], indexes);

            switch (GetFormLanguage()) {
                case 'en':
                    alert('Filling the form was successful');
                    break;

                default: // sk a default
                    alert('Naplnenie formulára bolo úspešné');

            }
        }
        catch (exc) {
            switch (GetFormLanguage()) {
                case 'en':
                    alert('Filling the form has been unsuccessful');
                    break;

                default: // sk a default
                    alert('Naplnenie formulára bolo neúspešné');
            }
        }
        $("form:has(#main)").trigger("loadedFromXmlCompleted");
    };

    reader.onerror = function () {
        switch (GetFormLanguage()) {
            case 'en':
                alert('Could not read file.');
                break;

            default: // sk a default
                alert('Nepodarilo sa prečítať súbor.');
        }
        $("form:has(#main)").trigger("loadedFromXmlCompleted");
    };

    readerHelp.onload = function (e) {
        if (e.target.result.search("encoding=\"ISO-8859-2\"") > 0 || e.target.result.search("encoding=\"iso-8859-2\"") > 0 || e.target.result.search("encoding=\"Iso-8859-2\"") > 0) {
            reader.readAsText(file, 'ISO-8859-2');
        }
        else if (e.target.result.search("encoding=\"WINDOWS-1250\"") > 0 || e.target.result.search("encoding=\"Windows-1250\"") > 0 || e.target.result.search("encoding=\"windows-1250\"") > 0) {
            reader.readAsText(file, 'Windows-1250');
        }
        else {
            reader.readAsText(file);
        }
    };

    readerHelp.onerror = function () {
        switch (GetFormLanguage()) {
            case 'en':
                alert('Could not read file.');
                break;

            default: // sk a default
                alert('Nepodarilo sa prečítať súbor.');
        }
    };

    readerHelp.readAsText(file);
}

function GetFieldNode(node) {
    if (node == null) {
        return null;
    }

    if (node.childNodes.length > 0) {
        for (var k = 0; k < node.childNodes.length; k++) {
            if (node.childNodes[k].nodeName == "#text") {
                return node.childNodes[k];
            }
        }
    }

    return null;
}

function LoadFromFileCallback(fileContent) {
    var xmlDoc = $.parseXML(fileContent);
    var indexes = Array();
    var nodeWithContains = new Array();
    var emptyNativeTemplate = GetEmptyNativeTemplate();
    var emptyNativeTemplateDoc = $.parseXML(emptyNativeTemplate);
    AddMissingElements(xmlDoc.childNodes[0], emptyNativeTemplateDoc.childNodes[0], nodeWithContains);
    LoadXml(xmlDoc.childNodes[0], indexes);

    var context = $("form:has(#main)");
    var selector = 'div[id^=layoutRow]';
    var removeBtns = context.find('span[id^=removeSection]');
    removeBtns.each(function () {
        var removeButton = $(this);
        var layoutRow = $(this).closest(selector);
        var string = removeButton.attr('onclick').toString();
        var minRepetition = string.substring(string.lastIndexOf("(") + 1, string.lastIndexOf(", this"));

        if (minRepetition == 0) {
            if (DefaultDataProvider.SectionIsEmpty(layoutRow)) {
                removeButton.click();
            }
        }
    });

    IncrementDecrementInnerRepeatingIds(context);

    context.trigger("loadedFromXmlCompleted");
}

function LoadFromFileXPathCallback(fileContent) {
    fileContent = fileContent.replace(/<!--.*?-->/g, "");
    var xmlDoc = $.parseXML(fileContent);
    var indexes = Array();
    LoadXPathXml(xmlDoc.childNodes[0], indexes);

    var context = $("form:has(#main)");
    var selector = 'div[id^=layoutRow]';
    var removeBtns = context.find('span[id^=removeSection]');
    removeBtns.each(function () {
        var removeButton = $(this);
        var layoutRow = $(this).closest(selector);
        var string = removeButton.attr('onclick').toString();
        var minRepetition = string.substring(string.lastIndexOf("(") + 1, string.lastIndexOf(", this"));

        if (minRepetition == 0) {
            if (DefaultDataProvider.SectionIsEmpty(layoutRow)) {
                removeButton.click();
            }
        }
    });

    IncrementDecrementInnerRepeatingIds(context);
    context.trigger("loadedFromXmlCompleted");
}

function LoadXml(rootNode, indexes) {

    function IsEmpty(node) {
        if (node.nodeName == "#text") {
            if (node.nodeValue != null || node.nodeValue !== "") {
                return false;
            }
        }
        else {
            for (var i = 0; i < node.childNodes.length; i++) {
                var result = IsEmpty(node.childNodes[i]);
                if (!result) {
                    return result;
                }
            }
        }

        return true;
    }

    var lastNode = null;

    for (var i = 0; i < rootNode.childNodes.length; i++) {

        var node = rootNode.childNodes[i];

        var nodeName = node.nodeName;
        nodeName = nodeName.replace("DoNotValidate_", "");

        var fieldNode = GetFieldNode(node);
        var lastFieldNode = GetFieldNode(lastNode);

        if (indexes[nodeName] === undefined) {
            indexes[nodeName] = 0;
        }
        else {
            //ak su oba fieldnody a maju rovnaky name, tak sa nebude zvysovat, lebo sa bude jednat o multi prvok
            if (fieldNode == null || lastFieldNode == null || fieldNode.parentNode.nodeName != lastFieldNode.parentNode.nodeName) {
                indexes[nodeName]++;
            }
        }

        lastNode = node;

        if (fieldNode == null) {
            var allLayoutRows = $('div[id^=layoutRow]');
            var repeatingIndex = indexes[nodeName];
            var repeatingPostfixText = repeatingIndex;
            if (repeatingIndex == 0) {
                repeatingPostfixText = '';
            }
            else {
                repeatingPostfixText = repeatingPostfix + repeatingIndex;
            }

            var foundSection = null;
            var layoutRowID = null;

            allLayoutRows.each(function () {
                var layoutRow = $(this);
                if (layoutRow.find('[name=' + nodeName + ']').length > 0) {
                    var layoutRowPostfix = layoutRow.attr('id').replace(GetValueWithoutIncremental(layoutRow.attr('id')), "");
                    layoutRowID = layoutRow.attr('id');
                    if (layoutRowPostfix == repeatingPostfixText) {
                        foundSection = layoutRow;
                    }
                }
            });

            if ((foundSection == null || (foundSection.attr("isempty") == "true") && !IsEmpty(node)) && layoutRowID != null) {
                var layoutRowIDWithoutIncremental = GetValueWithoutIncremental(layoutRowID);
                var addButton = $('div[id^=' + layoutRowID + ']').last().find('#addSection' + layoutRowIDWithoutIncremental);
                if (addButton[0] != null) {
                    addButton.click();
                }
            }

            LoadXml(node, indexes);
        }
        else {
            node = fieldNode;
            var repeatingIndex = indexes[nodeName];
            var repeatingPostfixText = repeatingIndex;
            if (repeatingIndex == 0) {
                repeatingPostfixText = '';
            }
            else {
                repeatingPostfixText = repeatingElementPostfix + repeatingIndex;
            }

            var field = $("[name=" + nodeName + repeatingPostfixText + "]");

            if (field.length > 0) {
                if (field.is(':checkbox')) {
                    if (field.hasClass("checkBox")) {
                        if (field.hasClass("xsd_boolean")) {
                            if (node.nodeValue == "1") {
                                var fieldCheckbox = $(field);
                                if (fieldCheckbox.attr("disabled") !== undefined || fieldCheckbox.attr("readonly") !== undefined) {
                                    fieldCheckbox.attr("checked", "true");
                                }
                                field.click();
                            }
                        }
                        else {
                            if (field.val() == node.nodeValue) {
                                var fieldCheckbox = $(field);
                                if (fieldCheckbox.attr("disabled") !== undefined || fieldCheckbox.attr("readonly") !== undefined) {
                                    fieldCheckbox.attr("checked", "true");
                                }
                                field.click();
                            }
                        }
                    }
                    else {
                        for (var index = 0; index < field.length; index++) {
                            var childNode = field[index];
                            if (childNode.value == node.nodeValue) {
                                var fieldCheckbox = $(childNode);
                                if (fieldCheckbox.attr("disabled") !== undefined || fieldCheckbox.attr("readonly") !== undefined) {
                                    fieldCheckbox.attr("checked", "true");
                                }
                                childNode.click();
                                break;
                            }
                        }
                    }

                }
                else if (field.is(':radio')) {
                    for (var index = 0; index < field.length; index++) {
                        var childNode = field[index];
                        if (childNode.value == node.nodeValue) {
                            var radio = $(childNode);
                            if (radio.attr("disabled") !== undefined || radio.attr("readonly") !== undefined) {
                                radio.attr("checked", "true");
                            }

                            childNode.click();
                            break;
                        }
                    }
                }
                else if (field.attr("multiple")) {
                    for (var index = 0; index < field[0].childNodes.length; index++) {
                        var childNode = field[0].childNodes[index];
                        if (childNode.value == node.nodeValue) {
                            childNode.selected = true;
                            break;
                        }
                    }
                } else {
                    val = node.nodeValue;
                    if (val != "") {
                        if (field.hasClass("xsd_decimal"))
                            val = val.replace('.', ',');
                        else if (field.hasClass("xsd_date"))
                            val = xmlHelper.fromXmlDate(val);
                        else if (field.hasClass("xsd_time"))
                            val = xmlHelper.fromXmlTime(val);
                        else if (field.hasClass("xsd_dateTime"))
                            val = xmlHelper.fromXmlDateTime(val);
                        else if (field.hasClass("xsd_anyURI"))
                            val = xmlHelper.fromXmlAnyURI(val);
                    }

                    field.val(val);
                }
            }
        }
    }
}

// Funkcie pre prekrytie ukladania a nacitavania
function GetXpath(elements) {
    var xpath = "";
    for (var i = 0; i < elements.length; i++) {
        xpath += "/" + elements[i].nodeName;

        if (elements[i].parentNode != null && elements[i].attributes != null) {
            //rootu sa preskakuju namespaces
            if (elements[i].attributes.length == 0 || i == 0) {
                continue;
            }

            xpath += "[";

            for (var j = 0; j < elements[i].attributes.length; j++) {
                xpath += "@" + elements[i].attributes[j].nodeName + "='" + elements[i].attributes[j].value + "'";
                if (j != elements[i].attributes.length - 1) {
                    xpath += " and ";
                }
            }

            xpath += "]";
        }
    }

    return xpath;
}

//vrati list nodov , ktory urcuje jeho absolutnu cestu az do rootu
function AncestorsAndSelf(element) {
    var parts = new Array();
    var actual = element;

    while (actual != null && actual.parentNode != null) {
        parts.push(actual);
        actual = actual.parentNode;
    }

    return parts.reverse();
}

//najde nod v zadanom roote na zaklade xpathu
function FoundNode(root, xPath) {

    var ancestorsAndSelfParent = AncestorsAndSelf(root);
    var xPathParent = GetXpath(ancestorsAndSelfParent);
    if (xPath == xPathParent) {
        return root;
    }

    for (var i = 0; i < root.childNodes.length; i++) {
        var foundNode = FoundNode(root.childNodes[i], xPath);
        if (foundNode != null) {
            return foundNode;
        }
    }

    return null;
}

//najde nod v zadanom roote na zaklade nazvu
function FoundNodeByName(root, name) {

    if (root.nodeName == name) {
        return root;
    }

    for (var i = 0; i < root.childNodes.length; i++) {
        var foundNode = FoundNodeByName(root.childNodes[i], name);
        if (foundNode != null) {
            return foundNode;
        }
    }

    return null;
}

//na zaklade xpathov dodrzi sibblings
function SortXmlByXPath(root) {
    var sibblings = Array();

    if (root.nodeName == "#text") {
        return;
    }

    for (var i = 0; i < root.childNodes.length; i++) {
        var ancestorAndSibblings = AncestorsAndSelf(root.childNodes[i]);
        var xPath = GetXpath(ancestorAndSibblings);

        //pozaznamenava si pozicie
        if (sibblings[xPath] == undefined) {
            sibblings[xPath] = new Array();
        }

        sibblings[xPath].push(i);
    }

    var newList = new Array();

    //na zaklade pozicii vysklada nove poradie elementov
    for (var sibbling in sibblings) {
        for (var i = 0; i < sibblings[sibbling].length; i++) {
            var pom = sibblings[sibbling];
            newList.push(root.childNodes[pom[i]]);
        }
    }

    //zmazanie aktualnych nodov
    while (root.childNodes.length > 0) {
        root.removeChild(root.childNodes[0]);
    }

    for (var i = 0; i < newList.length; i++) {
        root.appendChild(newList[i]);
    }

    for (var i = 0; i < root.childNodes.length; i++) {
        SortXmlByXPath(root.childNodes[i]);
    }
}

//na zaklade xpathov vytvara vysledne xml
function BuildXmlFromXpaths(xPath, root, document) {
    if (xPath == "") {
        return;
    }

    var xPathParts = xPath.split('/');
    if (xPathParts.length == 0) {
        return;
    }

    var xPathElementName = xPathParts[0];
    var foundNode = FoundNodeByName(root, xPathElementName);

    if (foundNode == null) {
        var element = document.createElement(xPathElementName);
        root.appendChild(element);
        root = element;
    } else {
        root = foundNode;
    }

    var newXPath = "";
    for (var j = 1; j < xPathParts.length; j++) {
        newXPath += xPathParts[j] + "/";
    }

    if (newXPath.length > 0) {
        newXPath = newXPath.substring(0, newXPath.length - 1);
    }

    BuildXmlFromXpaths(newXPath, root, document);
}

//prejde cez vsetky elementy a vrati xml ako string
function ElementToString(root) {
    var xml = "";
    for (var i = 0; i < root.childNodes.length; i++) {
        var attributes = "";

        for (var j = 0; j < root.childNodes[i].attributes.length; j++) {
            attributes += " " + root.childNodes[i].attributes[j].name + "=\"" + root.childNodes[i].attributes[j].value + "\"";
        }

        xml += "<" + root.childNodes[i].nodeName + attributes + ">";
        if (root.childNodes[i].childNodes.length == 1 && root.childNodes[i].childNodes[0].nodeName == "#text") {
            xml += root.childNodes[i].childNodes[0].nodeValue;
        } else {
            xml += ElementToString(root.childNodes[i]);
        }
        xml += "</" + root.childNodes[i].nodeName + ">";
    }

    return xml;
}

//zmaze vsetky vyplnene hodnoty
function EmptyXmlNodeRecursive(node) {
    if (node.nodeName == "#text") {
        node.nodeValue = "";
    } else {
        for (var i = 0; i < node.childNodes.length; i++) {
            EmptyXmlNodeRecursive(node.childNodes[i]);
        }
    }
}

//zmaze elementy, ktore nie su namapovane
function RemoveElementsByNameNotInMapping(node, mapping) {
    if (node.nodeName == "#text") {
        return;
    }

    var found = false;
    var actualNode = node;

    for (var map in mapping) {
        if (node.nodeName == map) {
            found = true;
        }
    }

    if (!found) {
        actualNode = node.parentNode;
        for (var i = 0; i < node.childNodes.length; i++) {
            actualNode.appendChild(node.childNodes[i]);
        }

        if (actualNode == null) {
            return;
        }

        actualNode.removeChild(node);
    }

    for (var i = 0; i < actualNode.childNodes.length; i++) {
        RemoveElementsByNameNotInMapping(actualNode.childNodes[i], mapping);
    }
}

//prelozi z nativu do business
function TranslateNativeToEdoc(nativeXml, skXmlTemplate, mapping, translateType) {

    function TranslateRecursive(xmlDocNode, skXmlDocNode, template, translateType) {
        var sibblings = Array();

        for (var i = 0; i < xmlDocNode.childNodes.length; i++) {
            var xmlNode = xmlDocNode.childNodes[i];

            if (xmlNode.nodeName == "#text") {
                if (xmlNode.nodeValue != null) {
                    var parentXmlNode = xmlNode.parentNode;
                    var xPathEdoc = mapping[parentXmlNode.nodeName];

                    if (xPathEdoc !== undefined) {
                        var foundNode = FoundNode(skXmlDocNode, xPathEdoc);
                        if (foundNode != null) {
                            if (foundNode.childNodes.length == 0) {
                                foundNode.appendChild(xmlNode.cloneNode());
                            } else {
                                foundNode.childNodes[0].nodeValue = xmlNode.nodeValue;
                            }
                        }
                    }
                }

                continue;
            }

            if (sibblings[xmlNode.nodeName] == undefined) {
                sibblings[xmlNode.nodeName] = 0;
            }

            sibblings[xmlNode.nodeName]++;

            //opakoavacia sekacia
            if (sibblings[xmlNode.nodeName] > 1) {
                //kedze opakovacie nody maju rovnaky nazov ako v natove, staci len podla nazvu
                var repetitionNode = null;
                var repetitionNodeTemplate = null;

                if (translateType == "Dictionary") {
                    repetitionNode = FoundNodeByName(skXmlDocNode, xmlNode.nodeName);
                    repetitionNodeTemplate = FoundNodeByName(template, xmlNode.nodeName);
                }
                if (translateType == "Mapper") {
                    var xPathEdoc = mapping[xmlNode.nodeName];
                    repetitionNode = FoundNode(skXmlDocNode, xPathEdoc);
                    repetitionNodeTemplate = FoundNode(template, xPathEdoc);
                }

                if (repetitionNodeTemplate != null && repetitionNode != null) {
                    var clonedNode = repetitionNodeTemplate.cloneNode(true);
                    repetitionNode.parentNode.appendChild(clonedNode);
                    TranslateRecursive(xmlNode, clonedNode, template, translateType);

                    continue;
                }
            }

            TranslateRecursive(xmlNode, skXmlDocNode, template, translateType);
        }
    }

    var nativeDoc = $.parseXML(nativeXml);
    var eDocDoc = $.parseXML(skXmlTemplate);
    var template = $.parseXML(skXmlTemplate);
    TranslateRecursive(nativeDoc.childNodes[0], eDocDoc.childNodes[0], template, translateType);
    SortXmlByXPath(eDocDoc.childNodes[0]);

    return ElementToString(eDocDoc);
}

//prelozi z edoc do nativu
function TranslateEdocToNative(edocXml, nativeXmlTemplate, mapping, translateType) {

    function TranslateRecursive(edocDocNode, nativeXmlDocNode, template, translateType) {
        var sibblings = Array();

        for (var i = 0; i < edocDocNode.childNodes.length; i++) {
            var xmlNode = edocDocNode.childNodes[i];
            var ancesorsAndSelf = AncestorsAndSelf(xmlNode);
            var eDocXpath = GetXpath(ancesorsAndSelf);

            if (xmlNode.nodeName == "#text") {
                eDocXpath = eDocXpath.substring(0, eDocXpath.length - 6); // orezem este /#text zname
                if (xmlNode.nodeValue != null) {
                    //edoc
                    var nativeName = null;
                    for (var map in mapping) {
                        if (mapping[map] == eDocXpath) {
                            nativeName = map;
                            var repetitionNodeTemplate = FoundNodeByName(template, nativeName);
                            //mozu byt rovnake xpathy, ale zaujimavy je len ten field
                            if (repetitionNodeTemplate.childNodes.length == 0 || repetitionNodeTemplate.childNodes[0].nodeName == "#text") {
                                break;
                            }
                        }
                    }

                    if (nativeName != null) {
                        var foundNode = FoundNodeByName(nativeXmlDocNode, nativeName);
                        if (foundNode != null) {
                            if (foundNode.childNodes.length == 0) {
                                foundNode.appendChild(xmlNode.cloneNode());
                            } else {
                                foundNode.childNodes[0].nodeValue = xmlNode.nodeValue;
                            }
                        }
                    }
                }

                continue;
            }

            if (sibblings[eDocXpath] == undefined) {
                sibblings[eDocXpath] = 0;
            }

            sibblings[eDocXpath]++;

            //opakoavacia sekacia
            if (sibblings[eDocXpath] > 1) {
                var repetitionNode = null;
                var repetitionNodeTemplate = null;

                if (translateType == "Dictionary") {
                    //kedze opakovacie nody maju rovnaky nazov ako v natove, staci len podla nazvu
                    repetitionNode = FoundNodeByName(nativeXmlDocNode, xmlNode.nodeName);
                    repetitionNodeTemplate = FoundNodeByName(template, xmlNode.nodeName);
                }
                if (translateType == "Mapper") {
                    var ancesorsAndSelf = AncestorsAndSelf(xmlNode);
                    var eDocXpath = GetXpath(ancesorsAndSelf);

                    //edoc
                    var nativeName = null;
                    for (var map in mapping) {
                        if (mapping[map] == eDocXpath) {
                            nativeName = map;
                            repetitionNodeTemplate = FoundNodeByName(template, nativeName);
                            //mozu byt rovnake xpathy, ale zaujimavy je len ten pre sekciu
                            if (repetitionNodeTemplate.childNodes.length > 0 && repetitionNodeTemplate.childNodes[0].nodeName != "#text") {
                                break;
                            }
                        }
                    }

                    repetitionNode = FoundNodeByName(nativeXmlDocNode, nativeName);
                }

                if (repetitionNodeTemplate != null && repetitionNode != null) {
                    var clonedNode = repetitionNodeTemplate.cloneNode(true);
                    repetitionNode.parentNode.appendChild(clonedNode);
                    TranslateRecursive(xmlNode, clonedNode, template, translateType);

                    continue;
                }
            }

            TranslateRecursive(xmlNode, nativeXmlDocNode, template, translateType);
        }
    }

    var edocDoc = $.parseXML(edocXml);
    var nativeDoc = $.parseXML(nativeXmlTemplate);
    var template = $.parseXML(nativeXmlTemplate);
    TranslateRecursive(edocDoc.childNodes[0], nativeDoc.childNodes[0], template, translateType);
    SortXmlByXPath(nativeDoc.childNodes[0]);

    return ElementToString(nativeDoc);
}

//prebrane z 2.0
function AddMissingElements(sourceRootNode, destinationRootNode, nodeWithContains) {

    //zisti, ktore casti stromu maju contains
    function GetContainsInformation(node, nodeWithContains) {
        if (node.nodeName != "#text") {
            for (var k = 0; k < nodeWithContains.length; k++) {
                if (nodeWithContains[k].node == node) {
                    return { containsValue: nodeWithContains[k].containsValue, containsElementXpath: nodeWithContains[k].containsElementXpath };
                }
            }

            for (var i = 0; i < node.childNodes.length; i++) {
                var pom = GetContainsInformation(node.childNodes[i], nodeWithContains);
                if (pom != null) {
                    return pom;
                }
            }
        }

        return null;
    }

    function GetMultipleElements(destinationRootNode) {
        var multipleNames = new Array();

        //najdem viac nasbne vyskyty na danej urovni
        for (var i = 0; i < destinationRootNode.childNodes.length; i++) {
            var ancestorsAndSelf = AncestorsAndSelf(destinationRootNode.childNodes[i]);
            var xPathSource = GetXpath(ancestorsAndSelf);

            if (multipleNames[xPathSource] == undefined) {
                multipleNames[xPathSource] = new Array();
            }

            multipleNames[xPathSource].push(destinationRootNode.childNodes[i]);
        }

        //vyberiem len tie, ktore sa viac krat opakuju
        var multiple = new Array();
        for (var multipleName in multipleNames) {
            if (multipleNames[multipleName].length > 1) {
                for (var k = 0; k < multipleNames[multipleName].length; k++) {
                    multiple.push(multipleNames[multipleName][k]);
                }
            }
        }

        return multiple;
    }

    //zisti, contains elementy
    function GetElementWithContains(destinationRootNode, nodeWithContains) {

        var multiple = GetMultipleElements(destinationRootNode);
        var elementWithContains = new Array();

        //najde s contains a vlozi ich
        for (var i = 0; i < multiple.length; i++) {
            var containsInformation = GetContainsInformation(multiple[i], nodeWithContains);
            if (containsInformation != null) {
                elementWithContains.push({ node: multiple[i], containsValue: containsInformation.containsValue, containsElementXpath: containsInformation.containsElementXpath });
            }
        }

        return elementWithContains;
    }

    function FindAllNodes(childrenNodes, xpath, containsValue, templateContainsXPath) {
        var foundNodes = new Array();

        for (var j = 0; j < childrenNodes.length; j++) {
            if (childrenNodes[j].nodeName == "#text") {
                continue;
            }

            var ancestorsAndSelf = AncestorsAndSelf(childrenNodes[j]);
            var xPathSource = GetXpath(ancestorsAndSelf);

            if (xpath == xPathSource) {
                //ak je predchadzajuci destination to iste, tak nesmie vlozit ale bude sa klonovat
                if (containsValue != null) {
                    var foundElement = FindNode(childrenNodes[j], templateContainsXPath);
                    if (foundElement == null) {
                        continue;
                    }

                    var fieldNode = GetFieldNode(foundElement);

                    if (fieldNode == null || fieldNode.nodeValue.indexOf(containsValue) == -1) {
                        continue;
                    }
                }

                foundNodes.push(childrenNodes[j]);
            }
        }

        return foundNodes;
    }

    var finalArray = new Array();
    var finalExistingDestination = new Array();

    var elementWithConstains = GetElementWithContains(destinationRootNode, nodeWithContains);
    var multipleElements = GetMultipleElements(destinationRootNode);

    var actualChildrenNodes = new Array();

    for (var i = 0; i < sourceRootNode.childNodes.length; i++) {
        actualChildrenNodes.push(sourceRootNode.childNodes[i]);
    }

    var indexis = new Array();

    for (var i = 0; i < destinationRootNode.childNodes.length; i++) {
        if (destinationRootNode.childNodes[i].nodeName == "#text") {
            continue;
        }

        var isMultiple = false;
        for (var h = 0; h < multipleElements.length; h++) {
            if (multipleElements[h] == destinationRootNode.childNodes[i]) {
                isMultiple = true;

                break;
            }
        }

        var ancestorsAndSelfDestination = AncestorsAndSelf(destinationRootNode.childNodes[i]);
        var xPathDestination = GetXpath(ancestorsAndSelfDestination);

        if (indexis[xPathDestination] == undefined) {
            indexis[xPathDestination] = 0;
        }

        indexis[xPathDestination]++;

        var templateContainsValue = null;
        var templateContainsXPath = null;

        //ak je templatovy element oznaceny, ze bude mat aj contains
        for (var k = 0; k < elementWithConstains.length; k++) {
            if (elementWithConstains[k].node == destinationRootNode.childNodes[i]) {
                templateContainsValue = elementWithConstains[k].containsValue;

                //ak je len na konci xpathu
                var xpathInContainsConditions = elementWithConstains[k].containsElementXpath;
                var connector = "/";
                if (xpathInContainsConditions == '.') {
                    xpathInContainsConditions = "";
                    connector = "";
                }

                templateContainsXPath = xPathDestination + connector + xpathInContainsConditions;

                break;
            }
        }

        //najde vsetky elementy, ktore prisluchaju template
        var foundBusiness = FindAllNodes(actualChildrenNodes, xPathDestination, templateContainsValue, templateContainsXPath);

        //ak sa jedna o variantu, ze je element odliseny pomocou konstanty, nie contains, tak sa zoberie podla indexu
        if (isMultiple && templateContainsXPath == null) {
            if (indexis[xPathDestination] <= foundBusiness.length) {
                var tempFoundBusiness = new Array();
                tempFoundBusiness.push(foundBusiness[indexis[xPathDestination] - 1]);
                foundBusiness = tempFoundBusiness;
            }
        }

        var usedNodes = new Array();

        //zisti, ktore nody sa pouzili
        for (var h = 0; h < foundBusiness.length; h++) {
            for (var k = 0; k < actualChildrenNodes.length; k++) {
                if (foundBusiness[h] == actualChildrenNodes[k]) {
                    usedNodes.push(actualChildrenNodes[k]);
                }
            }
        }

        //zmaze nody, ktore uz boli pouzite
        if (usedNodes.length > 0) {
            var clonedActualChildrenNodes = actualChildrenNodes;
            actualChildrenNodes = new Array();
            for (var l = 0; l < clonedActualChildrenNodes.length; l++) {
                var found = false;

                for (var m = 0; m < usedNodes.length; m++) {
                    if (usedNodes[m] == clonedActualChildrenNodes[l]) {
                        found = true;
                        break;
                    }
                }

                if (!found) {
                    actualChildrenNodes.push(clonedActualChildrenNodes[l]);
                }
            }
        }

        if (foundBusiness.length > 0) {
            for (var k = 0; k < foundBusiness.length; k++) {
                finalArray.push(foundBusiness[k]);
                finalExistingDestination.push(destinationRootNode.childNodes[i]);
            }
        } else {
            finalArray.push(destinationRootNode.childNodes[i].cloneNode(true));
            finalExistingDestination.push(destinationRootNode.childNodes[i]);
        }
    }

    //este treba do final array poslat aj ostatne neprejdene elementy
    if (finalArray.length == 0) {
        return;
    }

    //zmaz cele pole
    while (sourceRootNode.childNodes.length > 0) {
        sourceRootNode.removeChild(sourceRootNode.childNodes[0]);
    }

    //nahraj childy nanovo
    for (var i = 0; i < finalArray.length; i++) {
        sourceRootNode.appendChild(finalArray[i]);
    }

    for (var i = 0; i < finalArray.length; i++) {
        AddMissingElements(finalArray[i], finalExistingDestination[i], nodeWithContains);
    }
}

function GetEmptyNativeTemplate() {

    var formId = GetFormId();
    var xmlns = GetMetadataNamespace();
    var xml = '<' + formId + xmlns + '>';
    var usedXmlNames = new Array();

    function processHtml() {
        var element = $(this);
        var name = 'name';
        var layoutRow = 'layoutRow';
        var firstInput;
        if (element.hasClass(layoutRow)) {
            firstInput = element.children("input:first");
            if (firstInput.attr(name) != 'Attachments') {
                xml += '<' + firstInput.attr(name) + '>';
            }
        }

        if (element.is(':input')) {
            if (element.is(':file') || element.is(':button') || element.attr('LookupDetailInfo') == "true")
                return;

            if (element.parent().hasClass(layoutRow))
                return;

            var attr = element.attr(name);
            if (attr != undefined) {
                var index = attr.indexOf(sign);
                if (index == -1) {
                    if (usedXmlNames[attr] == undefined) {
                        attr = attr.replace(disableValidatorPrefix, "");
                        xml += '<' + attr + '>' + '</' + attr + '>';
                        usedXmlNames[attr] = "";
                    }
                }
            }
        }

        element.children().each(processHtml);

        if (element.hasClass(layoutRow)) {
            firstInput = element.children("input:first");
            if (firstInput.attr(name) != 'Attachments') {
                xml += '</' + firstInput.attr(name) + '>';
            }
        }
    }

    $('#main').children('div').each(processHtml);

    xml += '</' + formId + '>';

    return xml;
}

function FillLookup(element, lookupDetailInfo, lookupFieldValue) {
    var lookupItems = null;
    var lookupUri = GetLookupUri();

    $.ajax({
        type: "GET",
        url: GetLookupUri(),
        async: false
    }).done(function (data) {
        if (data != null) {
            lookupItems = $.parseJSON(data.replace("(", "").replace(");", ""));
        }
    });

    if (lookupItems != null && lookupItems.aaData != null) {
        var randIndex = Math.floor(Math.random() * lookupItems.aaData.length);
        var randLookupItem = lookupItems.aaData[randIndex];

        element.val(randLookupItem[1]);
        lookupDetailInfo.val(randLookupItem[1]);
        lookupFieldValue.val(randLookupItem[0]);
    }
}

function FillSpecificInput(element, rules, data) {
    var rule;
    var finalValue = "";
    var rIndex = Math.floor((Math.random() * data.length));

    for (rule in rules) {
        if (rules.hasOwnProperty(rule)) {
            if (rule == "date") {
                var dateValue = new Date();
                finalValue = $.datepicker.formatDate('dd.mm.yy', new Date());
                break;
            }
            if (rule.indexOf("RegEx") != -1) {
                finalValue = "";
                if (element.attr("id").toLowerCase().indexOf("email") != -1
                  || element.siblings("span.XPathClass").html().indexOf("InternetAddress[contains(Address,'@')]/Address") != -1) {
                    finalValue = data[rIndex] + "@" + data[rIndex] + ".com";
                    break;
                } else
                    if (element.attr("title").toLowerCase().indexOf("webovú adresu") != -1
                      || element.siblings("span.XPathClass").html().indexOf("InternetAddress[not(contains(Address,'@'))]/Address") != -1) {
                        finalValue = data[rIndex] + ".com";
                        break;
                    } else
                        if (element.attr("title").toLowerCase().indexOf("číslo telefónu") != -1
                          || element.siblings("span.XPathClass").html().indexOf("TelephoneAddress/Number/FormattedNumber") != -1) {
                            finalValue = "+421";
                            for (var i = 0; i <= 8; i++) {
                                var randNumber = Math.floor((Math.random() * 10));
                                finalValue += randNumber;
                            }
                            break;
                        } else
                            if (element.attr("title").toLowerCase().indexOf("ičo") != -1) {
                                for (var i = 0; i <= 7; i++) {
                                    var randNumber = Math.floor((Math.random() * 10));
                                    finalValue += randNumber;
                                }
                                break;
                            } else
                                if (element.attr("title").toLowerCase().indexOf("dič") != -1
                                   || element.attr("title").toLowerCase().indexOf("rodné číslo") != -1) {
                                    for (var i = 0; i <= 9; i++) {
                                        var randNumber = Math.floor((Math.random() * 10));
                                        finalValue += randNumber;
                                    }
                                    break;
                                } else
                                    if (element.attr("title").toLowerCase().indexOf("poštové smerovacie číslo") != -1
                                      || element.siblings("span.XPathClass").html().indexOf("DeliveryAddress/PostalCode") != -1) {
                                        for (var i = 0; i <= 4; i++) {
                                            var randNumber = Math.floor((Math.random() * 10));
                                            finalValue += randNumber;
                                        }
                                        break;
                                    } else
                                        if (element.attr("title").toLowerCase().indexOf("ič dph") != -1) {
                                            finalValue = "SK";
                                            for (var i = 0; i <= 9; i++) {
                                                var randNumber = Math.floor((Math.random() * 10));
                                                finalValue += randNumber;
                                            }
                                            break;
                                        } else
                                            if (element.hasClass("xsd_decimal")) {
                                                var randNumber = Math.floor((Math.random() * 100) + 1);
                                                finalValue += randNumber;
                                            } else {
                                                //finalValue = "regex";
                                            }
                break;
            }
            if (rule == "minlength") {
                var randomValue = data[rIndex];
                var minLength = parseInt(rules.minlength);

                while (randomValue.length < minLength) {
                    randomValue += Math.floor((Math.random() * 10));
                }
                finalValue = randomValue;
            }
            if (rule == "maxlength") {
                var randomValue = data[rIndex];
                var maxLength = parseInt(rules.maxlength);

                if (randomValue.length <= maxLength) {
                    finalValue = randomValue;
                } else {
                    finalValue = randomValue.substring(0, maxLength);
                }
            }
            if (element.attr("title").toLowerCase().indexOf("poštové smerovacie číslo") != -1
              || element.siblings("span.XPathClass").html().indexOf("DeliveryAddress/PostalCode") != -1) {
                finalValue = "";
                for (var i = 0; i <= 4; i++) {
                    var randNumber = Math.floor((Math.random() * 10));
                    finalValue += randNumber;
                }
            }
        }
    }

    element.val(finalValue).change();
}

function FillForm() {
    // random click tlačidla Pridať

    var elements = $("input:radio, input:checkbox, select, input:text, textarea");
    var data = ["lorem", "ipsum", "dolor", "sit", "amet", "consectetur", "adipiscing", "elit", "ut", "aliquam", "purus", "sit", "amet", "luctus", "venenatis", "lectus", "magna", "fringilla", "urna", "porttitor", "rhoncus", "dolor", "purus", "non", "enim", "praesent", "elementum", "facilisis", "leo", "vel", "fringilla", "est", "ullamcorper", "eget", "nulla", "facilisi", "etiam", "dignissim", "diam", "quis", "enim", "lobortis", "scelerisque", "fermentum", "dui", "faucibus", "in", "ornare", "quam", "viverra", "orci", "sagittis", "eu", "volutpat", "odio", "facilisis", "mauris", "sit", "amet", "massa", "vitae", "tortor", "condimentum", "lacinia", "quis", "vel", "eros", "donec", "ac", "odio", "tempor", "orci", "dapibus", "ultrices", "in", "iaculis", "nunc", "sed", "augue", "lacus", "viverra", "vitae", "congue", "eu", "consequat", "ac", "felis", "donec", "et", "odio", "pellentesque", "diam", "volutpat", "commodo", "sed", "egestas", "egestas", "fringilla", "phasellus", "faucibus", "scelerisque", "eleifend", "donec", "pretium", "vulputate", "sapien", "nec", "sagittis", "aliquam", "malesuada", "bibendum", "arcu", "vitae", "elementum"];
    var dataLength = data.length;

    elements.each(function () {
        var element = $(this);
        if (element.is(":visible") && !element.is(":disabled") && element.attr("readonly") != "readonly") {
            switch (this.type) {
                case 'radio': {
                    var elemName = element.attr("name");
                    var allRb = $("[name='" + elemName + "']");
                    if (!allRb.is(":checked")) {
                        var randIndex = Math.floor(Math.random() * allRb.length);
                        allRb.eq(randIndex).click();
                    }
                }
                    break;
                case 'checkbox': {
                    var randCheck = Math.floor(Math.random() * 2);
                    if (element.hasClass("xsd_required")) {
                        randCheck = 1;
                    }
                    if (randCheck && !element.is(":checked")) {
                        element.click();
                    }
                }
                    break;
                case 'select-one': {
                    if (element.is(":blank")) {
                        var options = element.find("option");
                        var randIndex = Math.floor((Math.random() * (options.length - 1)) + 1);
                        var selectedOption = options.eq(randIndex).val();
                        element.val(selectedOption).change();
                    }
                }
                    break;
                case 'text': {
                    if (element.is(":blank")) {
                        if (element.hasClass("remoteLookup")) {
                            var lookupDetailInfo = element.siblings(".LookupDetailInfo");
                            var fieldValueId = element.attr("id") + "ItemName";
                            var lookupFieldValue = $("[id='" + fieldValueId + "']");

                            FillLookup(element, lookupDetailInfo, lookupFieldValue);
                        } else {
                            FillSpecificInput(element, element.rules(), data);
                        }
                    }
                }
                    break;
                case 'textarea': {
                    if (element.is(":blank")) {
                        var randLength = Math.floor((Math.random() * dataLength - 1) + 1);
                        var genString = "";

                        for (var i = 0; i <= randLength; i++) {
                            var randIndex = Math.floor((Math.random() * dataLength - 1));
                            if (i == 0) {
                                genString = data[randIndex];
                            } else {
                                genString += " " + data[randIndex];
                            }
                        }

                        element.val(genString).change();
                    }
                }
                    break;
                default:
                    break;
            }
        }
    });
}
/* ]]> */
						</script><script type="text/javascript">
							/* <![CDATA[ */
$(document).ready(InitMultipleLineLabelStyle);

function InitMultipleLineLabelStyle() {
    $(document).find("label.fieldLabel,span.fieldLabel").each(function () {
        var element = $(this);
        var lines = (element.height() / 34);
        if (lines > 1) {
            var marginBottom = 5 * (lines - 1);
            var newStyle = element.attr("style") + "; margin-bottom: " + marginBottom.toString() + "px;";
            element.attr("style", newStyle);
        }
    });
}
/* ]]> */
						</script><script type="text/javascript">
							var projectType = 'UPVS';
							<xsl:text disable-output-escaping="yes">
								/* <![CDATA[ */
function nacitajObrazky() {

	const inputBarCode = document.getElementById('Payment_barcode');
	const inputQRCode = document.getElementById('Payment_qrcode');

	if (inputBarCode.value != '')
		$("#imgSpanBarCode").find('img').attr('src', 'data:image/png;base64,' + inputBarCode.value)
	else
		$("#imgSpanBarCode").find('img').attr('src', '')

	if (inputQRCode.value != '')
		$("#imgSpanQRCode").find('img').attr('src', 'data:image/png;base64,' + inputQRCode.value);
	else
		$("#imgSpanQRCode").find('img').attr('src', '')

	//alert("nacitajObrazky");
}

$.validator.addMethod
(
"SenderPropertyRegistrationNumberRegEx",
function(value, element)
{
if ($(element).hasClass('disableValidators')) { return true; }
if (value.length == 0) { return true; }
return value.match(new RegExp(/^$|^\d{1,10}$/));
}
);

$.validator.addMethod
(
"SenderBuildingNumberRegEx",
function(value, element)
{
if ($(element).hasClass('disableValidators')) { return true; }
return value.match(new RegExp(/^$|^.{1,20}$/));
}
);

$.validator.addMethod
(
"SenderPostalCodeRegEx",
function(value, element)
{
if ($(element).hasClass('disableValidators')) { return true; }
return value.match(new RegExp(/^$|^.{1,12}$/));
}
);

$.validator.addMethod
(
"RecipientPropertyRegistrationNumberRegEx",
function(value, element)
{
if ($(element).hasClass('disableValidators')) { return true; }
if (value.length == 0) { return true; }
return value.match(new RegExp(/^$|^\d{1,10}$/));
}
);

$.validator.addMethod
(
"RecipientBuildingNumberRegEx",
function(value, element)
{
if ($(element).hasClass('disableValidators')) { return true; }
return value.match(new RegExp(/^$|^.{1,20}$/));
}
);

$.validator.addMethod
(
"RecipientPostalCodeRegEx",
function(value, element)
{
if ($(element).hasClass('disableValidators')) { return true; }
return value.match(new RegExp(/^$|^.{1,12}$/));
}
);

$.validator.addMethod
(
"RecipientPropertyRegistrationNumberPORegEx",
function(value, element)
{
if ($(element).hasClass('disableValidators')) { return true; }
if (value.length == 0) { return true; }
return value.match(new RegExp(/^$|^\d{1,10}$/));
}
);

$.validator.addMethod
(
"RecipientBuildingNumberPORegEx",
function(value, element)
{
if ($(element).hasClass('disableValidators')) { return true; }
return value.match(new RegExp(/^$|^.{1,20}$/));
}
);

$.validator.addMethod
(
"RecipientPostalCodePORegEx",
function(value, element)
{
if ($(element).hasClass('disableValidators')) { return true; }
return value.match(new RegExp(/^$|^.{1,12}$/));
}
);

$.validator.addMethod
(
"FormattedNumberRegEx",
function(value, element)
{
if ($(element).hasClass('disableValidators')) { return true; }
if (value.length == 0) { return true; }
//return value.match(new RegExp(/^$|^(\+|%2b|00)\d{1,20}$/));
return value.match(new RegExp(/^$|^[0-9+/]+$/));
}
);

$.validator.addMethod
(
"EMailAddressRegEx",
function(value, element)
{
if ($(element).hasClass('disableValidators')) { return true; }
if (value.length == 0) { return true; }
return value.match(new RegExp(/^$|^[a-zA-Z0-9_.+-]+@[a-zA-Z0-9\-]+\.[a-zA-Z0-9\-.]+$/));
}
);

$.validator.addMethod
(
"IcoRegEx",
function(value, element)
{
if ($(element).hasClass('disableValidators')) { return true; }
if (value.length == 0) { return true; }
return value.match(new RegExp(/^$|^\d{8}$/));
}
);

function GetExternalResourceIndex(resourcetype) {
  switch (resourcetype) {
    case 3:
      return 'form.10.sk.xsd';
      break;
    case 4:
      return 'form.10.sb.xslt';
      break;
    case 7:
      return 'form.10.html.xslt';
      break;
    case 12:
      return 'form.10.fo.xsl';
      break;
    default:
      return null;
  }
  return null;
}

function GetExternalResource(resourcetype, index) {
  switch (resourcetype) {
    case 3:
      if (index == null || index =='form.10.sk.xsd') return 'form.10.sk.xsd';
      break;
    case 4:
      if (index == null || index =='form.10.sb.xslt') return 'form.10.sb.xslt';
      break;
    case 7:
      if (index == null || index =='form.10.html.xslt') return 'form.10.html.xslt';
      break;
    case 12:
      if (index == null || index =='form.10.fo.xsl') return 'form.10.fo.xsl';
      break;
    default:
      return null;
  }
  return null;
}

function SetDefaultValue(key, value) {
  if (value == '' || key == '') {
    return;
	}
}

function GetDefaultValue() {
  var retString = '';
  return retString;
}

function InitConditionalRules(context, sid) {
			if (sid == null) {



function ShowHideSectionLabel(sectionId, show) {
    var section = $('#' + sectionId);

    if (section.length > 0) {
        SectionLabel = section.find('.headercorrection');

        if (SectionLabel.length > 0) {
            if (show) {
                SectionLabel.show();
            }
            else {
                SectionLabel.hide();
            }
        }
    }
}


$("#addSectionlayoutRow5037").live("click", function () {
    //ShowHideSectionLabel('layoutRow5037', false);
});

$("#removeSectionlayoutRow5037").live("click", function () {
    //ShowHideSectionLabel('layoutRow5037', true);
});


$("#addSectionlayoutRow5040").live("click", function () {
    //ShowHideSectionLabel('layoutRow5040', false);
});

$("#removeSectionlayoutRow5040").live("click", function () {
    //ShowHideSectionLabel('layoutRow5040', true);
});


$(window).bind("load", function () {
    //ShowHideSectionLabel('layoutRow5037', true);
    //ShowHideSectionLabel('layoutRow5040', true);
});



$(window).bind("load", function () {
    // Uprava nazvu pola
    $(".fieldLabel").css('line-height', '16px');

    // Uprava info ikony
    $(".info").css('background', 'url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABIAAAASCAYAAABWzo5XAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAIVJREFUeNpiYBhsgJlIdfZQ+iMlltUD8X8gfk+pq/dDDfpPqUH2UMPiqRGW8kDMT6kBMK/dJ9cQfWgAw8JnPz7FTHjkNgDxAyA+gMQnC/BDvQZzkT65LgIlPgMo+wEU85NjEAg4QOkLUC9uoEZifI/Pe4Rc9AHJayDXXaQkwO0ZhiQACDAAbwwgXYBCZloAAAAASUVORK5CYII) 0 0 no-repeat');
/*
    // Uprava farby buttonov
    $(".ui-state-default, .ui-widget-content .ui-state-default, .ui-widget-header .ui-state-default").css({
        'background' : '50% 50% repeat-x #00823b !important',
        'border' : '#00823b solid 1px !important'
    });

    // Uprava farby buttonov
    $(".ui-state-hover, .ui-widget-content .ui-state-hover, .ui-widget-header .ui-state-hover, .ui-state-focus, .ui-widget-content .ui-state-focus, .ui-widget-header .ui-state-focus").css({
        'border' : '#08b255 solid 1px !important'
    });

    // Uprava farby buttonov
    $(".button:hover, .lookupbutton:hover, .ui-slider-handle ui-state-default ui-corner-all ui-state-hover").css({
        'background-color' : '#08b255 !important',
        'border' : '#08b255 solid 1px'
    });

    // Uprava farby buttonov
    $(".ui-dialog").css({
        'background' : '#00823b !important'
    });
*/

     // Uprava layoutRow
    $(".layoutRow").css({
        'margin' : '0 0 0 0 !important'
    });

	$(".layoutRow").css('margin', '0px 0px 0px 0px');


// Uprava cell
    $(".cell").css({
        'margin' : '0 0 0 5px !important'
    });

	$(".cell").css('margin', '0px 0px 0px 5px');

	$(".infoIcon").hide();

// Uprava lookupbutton
    $(".lookupbutton").css("cssText", "padding: 4px 1px 4px 1px !important;" );
    //$(".lookupbutton").css("cssText", "font-size: 0.60em !important;");

});


//SwitchSections({ '[name|="SubjectTypeFOPOOVM"]:eq(0)': ['#layoutRow5026'], '[name|="SubjectTypeFOPOOVM"]:eq(1)': ['#layoutRow5030'], '[name|="SubjectTypeFOPOOVM"]:eq(2)': ['#layoutRow5057'] }, 'layoutColumn5475', false);


// ShowHide SubjectTypeFOPO

(context == null ? $('form') : context).find("[name|='SubjectTypeFOPO']").live('click', function () {
    var elementType = $(this).prop('tagName');
    var FO = "Fyzická osoba";
    var PO = "Právnická osoba";

    if (elementType == "INPUT") {
        var hodnotaCislenika = $(this).val();
        var nadradenaSekcia = $(this).closest("div[id^='layoutRow5025']");
        var foSekcia = nadradenaSekcia.find("div[id^='layoutRow5026']");
        var poSekcia = nadradenaSekcia.find("div[id^='layoutRow5030']");

        if (hodnotaCislenika == FO) {
            foSekcia.removeClass("hiddenSection");
            foSekcia.ToggleValidators(false);
            poSekcia.addClass("hiddenSection");
            poSekcia.ToggleValidators(true);
        } else if (hodnotaCislenika == PO) {
            foSekcia.addClass("hiddenSection");
            foSekcia.ToggleValidators(true);
            poSekcia.removeClass("hiddenSection");
            poSekcia.ToggleValidators(false);
        }
    }
});

$(window).bind('load', function () {
    var nadradenaSekcia = $("div[id^='layoutRow5025']");

    nadradenaSekcia.each(function () {
        var radioOsoba = $(this).find("[name|='SubjectTypeFOPO']");
        var foSekcia = $(this).find("div[id^='layoutRow5026']");
        var poSekcia = $(this).find("div[id^='layoutRow5030']");

        if (radioOsoba.eq(0).is(':checked')) {
            foSekcia.removeClass("hiddenSection");
            foSekcia.ToggleValidators(false);
            poSekcia.addClass("hiddenSection");
            poSekcia.ToggleValidators(true);
        }
        else if (radioOsoba.eq(1).is(':checked')) {
            foSekcia.addClass("hiddenSection");
            foSekcia.ToggleValidators(true);
            poSekcia.removeClass("hiddenSection");
            poSekcia.ToggleValidators(false);
        }
        else {
            foSekcia.addClass("hiddenSection");
            foSekcia.ToggleValidators(true);
            poSekcia.addClass("hiddenSection");
            poSekcia.ToggleValidators(true);
        }
    });
});

(context == null ? $('form') : context).find("[id^='addSectionlayoutRow5025']").live('click', function () {
    var nadradenaSekcia = $("div[id^='layoutRow5025']:last");
    var foSekcia = nadradenaSekcia.find("div[id^='layoutRow5026']");
    var poSekcia = nadradenaSekcia.find("div[id^='layoutRow5030']");

    foSekcia.addClass("hiddenSection");
    foSekcia.ToggleValidators(true);
    poSekcia.addClass("hiddenSection");
    poSekcia.ToggleValidators(true);
});


// Vynechane schovane polia s prednastavenou hodnotou
function ClearFormNew(element) {
    $(element).find(':input').each(function () {
        if (this.id == 'TelephoneTypeCodelistCode' || this.id == 'TelephoneTypeItemCode' || this.id == 'TelephoneTypeItemName' || this.id == 'IdentifierTypeCodelistCode' || this.id == 'IdentifierTypeItemCode' || this.id == 'IdentifierTypeItemName' || this.id == 'RecipientAfixPrefixCodelistCode' || this.id == 'RecipientAfixPrefixItemCode' || this.id == 'RecipientAfixPostfixCodelistCode' || this.id == 'RecipientAfixPostfixItemCode' || this.id == 'RecipientMunicipalityCodelistCode' || this.id == 'RecipientMunicipalityItemCode' || this.id == 'RecipientMunicipalityItemName' || this.id == 'RecipientPostalCountryCodelistCode' || this.id == 'RecipientMunicipalityCodelistCodePO' || this.id == 'RecipientMunicipalityItemCodePO' || this.id == 'RecipientMunicipalityItemNamePO' || this.id == 'RecipientPostalCountryCodelistCodePO'
             || this.id == 'RecipientMunicipalityCodelistCodeOVM' || this.id == 'RecipientMunicipalityItemCodeOVM' || this.id == 'RecipientMunicipalityItemNameOVM' || this.id == 'RecipientPostalCountryCodelistCodeOVM') {
            // Odlozene pre pripadnu akciu
        }
        else {
            switch (this.type) {
                case 'password':
                case 'select-multiple':
                case 'select-one':
                case 'text':
                case 'textarea':
                    $(this).val('');
                    break;
                case 'checkbox':
                case 'radio':
                    this.checked = false;
            }
        }
    });

	const inputBarCode = document.getElementById('Payment_barcode');
	const inputQRCode = document.getElementById('Payment_qrcode');

	inputBarCode.value = '';
	inputQRCode.value = '';

	nacitajObrazky();
}


$("#cgClearForm").unbind("click");

// Nefunguje override, zavolat vlastnyClearFormNew
$("#cgClearForm").click(function () {
    ClearFormNew(this.form);
});


$(window).bind("load", function () {
    $('[id|=RecipientPostalCountryItemName]').each(function () {
        var ItemNameElement = $(this);
        var parent = $(this).closest("[id^='layoutRow5025']");

        if (parent.length != 0) {
            var ItemNameCode = parent.find("[id|='RecipientPostalCountryItemCode']");

            if (parent.length != 0) {
                if (ItemNameElement.val() == '') {
                    ItemNameElement.val('Slovenská republika');
                    ItemNameCode.val('703');
                }
            }
        }
    });

    $('[id|=RecipientPostalCountryCodelistCode]').each(function () {
        var CodelistCodeElement = $(this);

        if (CodelistCodeElement.val() == '') {
            CodelistCodeElement.val('CL000086');
        }
    });

    $('[id|=RecipientPostalCountryItemNamePO]').each(function () {
        var ItemNameElement = $(this);
        var parent = $(this).closest("[id^='layoutRow5025']");

        if (parent.length != 0) {
            var ItemNameCode = parent.find("[id|='RecipientPostalCountryItemCodePO']");

            if (parent.length != 0) {
                if (ItemNameElement.val() == '') {
                    ItemNameElement.val('Slovenská republika');
                    ItemNameCode.val('703');
                }
            }
        }
    });

    $('[id|=RecipientPostalCountryCodelistCodePO]').each(function () {
        var CodelistCodeElement = $(this);

        if (CodelistCodeElement.val() == '') {
            CodelistCodeElement.val('CL000086');
        }
    });

    $('[id|=RecipientAfixPrefixCodelistCode]').each(function () {
        var CodelistCodeElement = $(this);

        if (CodelistCodeElement.val() == '') {
            CodelistCodeElement.val('CL000062');
        }
    });

    $('[id|=RecipientAfixPostfixCodelistCode]').each(function () {
        var CodelistCodeElement = $(this);

        if (CodelistCodeElement.val() == '') {
            CodelistCodeElement.val('CL000063');
        }
    });

    if ($("#IdentifierTypeCodelistCode").val() == '') {
        $("#IdentifierTypeCodelistCode").val('CL004001');
    }

    if ($("#IdentifierTypeItemCode").val() == '') {
        $("#IdentifierTypeItemCode").val('7');
    }

    if ($("#IdentifierTypeItemName").val() == '') {
        $("#IdentifierTypeItemName").val('IČO (Identifikačné číslo organizácie)');
    }

    if ($("#TelephoneTypeCodelistCode").val() == '') {
        $("#TelephoneTypeCodelistCode").val('CL004005');
    }

    if ($("#TelephoneTypeItemCode").val() == '') {
        $("#TelephoneTypeItemCode").val('1');
    }

    if ($("#TelephoneTypeItemName").val() == '') {
        $("#TelephoneTypeItemName").val('Pevná sieť');
    }

    $('[name|="SubjectTypeFOPO"]').unbind('change');
    $('[name|="SubjectTypeFOPO"]').on('change', function () {
        $('[id|=RecipientPostalCountryCodelistCode]').each(function () {
            var CodelistCodeElement = $(this);

            if (CodelistCodeElement.val() == '') {
                CodelistCodeElement.val('CL000086');
            }
        });

        $('[id|=RecipientPostalCountryCodelistCodePO]').each(function () {
            var CodelistCodeElement = $(this);

            if (CodelistCodeElement.val() == '') {
                CodelistCodeElement.val('CL000086');
            }
        });

        $('[id|=RecipientAfixPrefixCodelistCode]').each(function () {
            var CodelistCodeElement = $(this);

            if (CodelistCodeElement.val() == '') {
                CodelistCodeElement.val('CL000062');
            }
        });

        $('[id|=RecipientAfixPostfixCodelistCode]').each(function () {
            var CodelistCodeElement = $(this);

            if (CodelistCodeElement.val() == '') {
                CodelistCodeElement.val('CL000063');
            }
        });
    });
});

(context == null ? $('form') : context).find("[id^='addSectionlayoutRow5025']").live('click', function () {
    $('[id|=RecipientPostalCountryItemName]').each(function () {
        var ItemNameElement = $(this);
        var parent = $(this).closest("[id^='layoutRow5025']");

        if (parent.length != 0) {
            var ItemNameCode = parent.find("[id|='RecipientPostalCountryItemCode']");

            if (parent.length != 0) {
                if (ItemNameElement.val() == '') {
                    ItemNameElement.val('Slovenská republika');
                    ItemNameCode.val('703');
                }
            }
        }
    });

    $('[id|=RecipientPostalCountryCodelistCode]').each(function () {
        var CodelistCodeElement = $(this);

        if (CodelistCodeElement.val() == '') {
            CodelistCodeElement.val('CL000086');
        }
    });

    $('[id|=RecipientPostalCountryItemNamePO]').each(function () {
        var ItemNameElement = $(this);
        var parent = $(this).closest("[id^='layoutRow5025']");

        if (parent.length != 0) {
            var ItemNameCode = parent.find("[id|='RecipientPostalCountryItemCodePO']");

            if (parent.length != 0) {
                if (ItemNameElement.val() == '') {
                    ItemNameElement.val('Slovenská republika');
                    ItemNameCode.val('703');
                }
            }
        }
    });

    $('[id|=RecipientPostalCountryCodelistCodePO]').each(function () {
        var CodelistCodeElement = $(this);

        if (CodelistCodeElement.val() == '') {
            CodelistCodeElement.val('CL000086');
        }
    });

    $('[id|=RecipientAfixPrefixCodelistCode]').each(function () {
        var CodelistCodeElement = $(this);

        if (CodelistCodeElement.val() == '') {
            CodelistCodeElement.val('CL000062');
        }
    });

    $('[id|=RecipientAfixPostfixCodelistCode]').each(function () {
        var CodelistCodeElement = $(this);

        if (CodelistCodeElement.val() == '') {
            CodelistCodeElement.val('CL000063');
        }
    });
});


$(window).bind('load', function () {
    var Footer = $("#layoutRow5067");

   // Footer.addClass("hiddenSection");
   // Footer.ToggleValidators(true);
});


$(window).bind("load", function () {
    var infoDialog = function () {
        var infoIcon = $(this);
        var modal = infoIcon.find(".dialog-modal");
        modal.dialog({
            position: {
                my: "right bottom",
                at: "left top",
                of: infoIcon,
                offset: "20 20"
            },
            minHeight: 0,
            open: function () {
                modal.css('display', 'inline');
            },
            close: function (event) {
                var target = $(event.target);
                target.dialog('destroy');
                target.appendTo(modal);
            }
        });
    };

    $('form').find(".info").unbind('mouseover');
    $('form').find(".info").click(infoDialog);
});



$("[id^='addSectionlayoutRow']").live('click', function () {
    var infoDialog = function () {
        var infoIcon = $(this);
        var modal = infoIcon.find(".dialog-modal");
        modal.dialog({
            position: {
                my: "right bottom",
                at: "left top",
                of: infoIcon,
                offset: "20 20"
            },
            minHeight: 0,
            open: function () {
                modal.css('display', 'inline');
            },
            close: function (event) {
                var target = $(event.target);
                target.dialog('destroy');
                target.appendTo(modal);
            }
        });
    };

    (context == null ? $('form') : context).find(".info").unbind('mouseover');
    (context == null ? $('form') : context).find(".info").click(infoDialog);
});


$(window).bind("load", function () {
    function InitDatePickerDateFormatNEW() {
        $(".datepickerISO").datepicker({
            dateFormat: 'yy-mm-dd',
            onSelect: function () {
                $(this).focusout();
            }
        });

        var datePickers = $(".datepicker");
        datePickers.datepicker({
            dateFormat: 'dd.mm.yy',
            onSelect: function () {
                $(this).focusout();
            }
        });

        datePickers.each(function () {
            if (this.value) {
                if (this.value.indexOf('-') != -1) {
                    var dateParts = this.value.split('-');
                    var day = parseInt(dateParts[2], 10);
                    var month = parseInt(dateParts[1], 10);
                    var year = parseInt(dateParts[0], 10);

                    if (day < 10) {
                        day = "0" + day;
                    }
                    if (month < 10) {
                        month = "0" + month;
                    }

                    this.value = day + "." + month + "." + year;
                }
            }
        });
    }

    function InitDatePickerAutoCorrectSKDateFormat() {
        $(".datepicker").live('change', function () {
            var date = this.value.split('.');

            if (date.length == 3) {
                var day = ('0' + (date[0])).slice(-2);
                var month = ('0' + (date[1])).slice(-2);
                var year = date[2];

                this.value = day + '.' + month + '.' + year;
            }
        });
    }

    InitDatePickerDateFormatNEW();
    InitDatePickerAutoCorrectSKDateFormat();
	nacitajObrazky();
});


// Pre opakovatelne ekcie

$('[name|="SubjectTypeFOPO"]').on('change', function () {
    var parent = $(this).closest("[id^='layoutRow5025']");

    if (parent.length != 0) {
        var Prefix = parent.find("[id|='RecipientAfixPrefixItemName']");
        var Postfix = parent.find("[id|='RecipientAfixPostfixItemName']");
        var CountryFO = parent.find("[id|='RecipientPostalCountryItemName']");
        var CountryPO = parent.find("[id|='RecipientPostalCountryItemNamePO']");

        Prefix.keydown(function (data) {
            if (data.which == 8 || data.which == 9 || data.which == 46) {
                //
            }
            else {
                data.preventDefault();
            }
        });

        Prefix.keyup(function (data) {
            if ($(this).val() == '') {
                parent.find("[id|='RecipientAfixPrefixItemCode']").val('');
            }
        });


        Postfix.keydown(function (data) {
            if (data.which == 8 || data.which == 9 || data.which == 46) {
                //
            }
            else {
                data.preventDefault();
            }
        });

        Postfix.keyup(function (data) {
            if ($(this).val() == '') {
                parent.find("[id|='RecipientAfixPostfixItemCode']").val('');
            }
        });

        CountryFO.keydown(function (data) {
            if (data.which == 8 || data.which == 9 || data.which == 46) {
                //
            }
            else {
                data.preventDefault();
            }
        });

        CountryFO.keyup(function (data) {
            if ($(this).val() == '') {
                parent.find("[id|='RecipientPostalCountryItemCode']").val('');
            }
        });


        CountryPO.keydown(function (data) {
            if (data.which == 8 || data.which == 9 || data.which == 46) {
                //
            }
            else {
                data.preventDefault();
            }
        });

        CountryPO.keyup(function (data) {
            if ($(this).val() == '') {
                parent.find("[id|='RecipientPostalCountryItemCodePO']").val('');
            }
        });
    }
});

$(window).bind("load", function () {
    $("[id^='layoutRow5025']").each(function () {
        var parent = $(this);

        if (parent.length != 0) {
            var Prefix = parent.find("[id|='RecipientAfixPrefixItemName']");
            var Postfix = parent.find("[id|='RecipientAfixPostfixItemName']");
            var CountryFO = parent.find("[id|='RecipientPostalCountryItemName']");
            var CountryPO = parent.find("[id|='RecipientPostalCountryItemNamePO']");

            Prefix.keydown(function (data) {
                if (data.which == 8 || data.which == 9 || data.which == 46) {
                    //
                }
                else {
                    data.preventDefault();
                }
            });

            Prefix.keyup(function (data) {
                if ($(this).val() == '') {
                    parent.find("[id|='RecipientAfixPrefixItemCode']").val('');
                }
            });


            Postfix.keydown(function (data) {
                if (data.which == 8 || data.which == 9 || data.which == 46) {
                    //
                }
                else {
                    data.preventDefault();
                }
            });

            Postfix.keyup(function (data) {
                if ($(this).val() == '') {
                    parent.find("[id|='RecipientAfixPostfixItemCode']").val('');
                }
            });

            CountryFO.keydown(function (data) {
                if (data.which == 8 || data.which == 9 || data.which == 46) {
                    //
                }
                else {
                    data.preventDefault();
                }
            });

            CountryFO.keyup(function (data) {
                if ($(this).val() == '') {
                    parent.find("[id|='RecipientPostalCountryItemCode']").val('');
                }
            });


            CountryPO.keydown(function (data) {
                if (data.which == 8 || data.which == 9 || data.which == 46) {
                    //
                }
                else {
                    data.preventDefault();
                }
            });

            CountryPO.keyup(function (data) {
                if ($(this).val() == '') {
                    parent.find("[id|='RecipientPostalCountryItemCodePO']").val('');
                }
            });
        }
    });
});

}
}


$(window).bind("DOMContentLoaded", function () {

var context = $("form:has(#main)");
context.bind("loadedFromXmlCompleted", function () {
	  nacitajObrazky();

});

var context = $("form:has(#main)");
context.bind("clearFormCompleted", function () {
	  nacitajObrazky();

});

});

var validatorObject = null;

function InitValidation() {
			validatorObject = $("#Dokument").validate({
							errorLabelContainer: $("#errorsContainer"),
				wrapper: "li",
				onkeyup: false,
				onclick: false,
		        ignore: ".disableValidators",
								rules: {
			  		HeadEmptyField :
{
maxValue: 4000.0000
},

LblSneder :
{
maxValue: 4000.0000
},

SenderStreetName :
{
required: false,
maxlength: 100
},

SenderPropertyRegistrationNumber :
{
required: true,
SenderPropertyRegistrationNumberRegEx: true,
maxlength: 10
},

SenderBuildingNumber :
{
required: false,
SenderBuildingNumberRegEx: true,
maxlength: 20
},

SenderMunicipalityNonCodelistData :
{
required: true,
maxlength: 128
},

SenderMunicipalityCodeList :
{
maxlength: 100
},

SenderMunicipalityItemCode :
{
maxlength: 128
},

SenderMunicipalityItemName :
{
maxlength: 128
},

SenderPostalCode :
{
required: true,
SenderPostalCodeRegEx: true,
maxlength: 12
},

Title :
{
required: true,
maxlength: 255
},

SenderOrganizationUnit :
{
maxlength: 255
},

LblEmptySection4EmptyLine :
{
maxValue: 4000.0000
},

LblEmptySectionEmptyLine :
{
maxValue: 4000.0000
},

FileReference :
{
required: true,
maxlength: 128
},

Equips :
{
required: true,
maxlength: 127
},

LblVybavujeEmptyLine :
{
maxValue: 4000.0000
},

MunicipalityPlace :
{
required: true,
maxlength: 127
},

Date :
{
required: true
},

AttachmentInfo :
{
maxlength: 2047
},

AttachmentVal :
{
maxlength: 4096
},

LblEmptySection5EmptyLine :
{
maxValue: 4000.0000
},

ForInformationInfo :
{
maxlength: 10000
},

ForInformationVal :
{
maxlength: 255
},

CreatorPersonDataEmptyLine1 :
{
maxValue: 4000.0000
},

CreatorPersonDataEmptyLine :
{
maxValue: 4000.0000
},

CreatorPersonName :
{
required: false,
maxlength: 255
},

Position :
{
required: false,
maxlength: 1023
},

CreatorPersonDataEmptyLine3 :
{
maxValue: 4000.0000
},

CreatorPersonDataEmptyLine4 :
{
maxValue: 4000.0000
},

LblEmptySection2EmptyLine :
{
maxValue: 4000.0000
},


LblEmptySection6EmptyLine :
{
maxValue: 4000.0000
},

LblRecipient :
{
maxValue: 4000.0000
},

RecipientEmpryField :
{
maxValue: 4000.0000
},

SubjectTypeFOPO :
{
required: true
},

RecipientStreetName :
{
required: false,
maxlength: 100
},

RecipientPropertyRegistrationNumber :
{
required: false,
RecipientPropertyRegistrationNumberRegEx: true,
maxlength: 10
},

RecipientBuildingNumber :
{
required: false,
RecipientBuildingNumberRegEx: true,
maxlength: 20
},

RecipientMunicipalityNonCodelistData :
{
required: true,
maxlength: 128
},

RecipientMunicipalityItemCode :
{
maxlength: 128
},

RecipientMunicipalityItemName :
{
maxlength: 128
},

RecipientMunicipalityCodelistCode :
{
maxlength: 100
},

RecipientPostalCode :
{
required: true,
RecipientPostalCodeRegEx: true,
maxlength: 12
},

RecipientPostalCountryItemName :
{
required: true
},

RecipientPostalCountryItemCode :
{
maxlength: 255
},

RecipientPostalCountryCodelistCode :
{
maxlength: 100
},


RecipientAfixPrefixItemCode :
{
maxlength: 256
},

RecipientAfixPrefixCodelistCode :
{
maxlength: 128
},

RecipientGivenName :
{
required: true,
maxlength: 255
},


RecipientAfixPostfixItemCode :
{
maxlength: 256
},

RecipientAfixPostfixCodelistCode :
{
maxlength: 128
},

RecipientFamilyName :
{
required: true,
maxlength: 255
},

RecipientCorporateBodyFullName :
{
required: true,
maxlength: 255
},

RecipientOrganizationUnit :
{
maxlength: 255
},
RecipientStreetNamePO :
{
required: false,
maxlength: 100
},

RecipientPropertyRegistrationNumberPO :
{
required: false,
RecipientPropertyRegistrationNumberPORegEx: true,
maxlength: 10
},

RecipientBuildingNumberPO :
{
required: false,
RecipientBuildingNumberPORegEx: true,
maxlength: 20
},

RecipientMunicipalityNonCodelistDataPO :
{
required: true,
maxlength: 128
},

RecipientMunicipalityItemCodePO :
{
maxlength: 128
},

RecipientMunicipalityItemNamePO :
{
maxlength: 128
},

RecipientMunicipalityCodelistCodePO :
{
maxlength: 100
},

RecipientPostalCodePO :
{
required: true,
RecipientPostalCodePORegEx: true,
maxlength: 12
},

RecipientPostalCountryItemNamePO :
{
required: true
},

RecipientPostalCountryItemCodePO :
{
maxlength: 256
},

RecipientPostalCountryCodelistCodePO :
{
maxlength: 100
},

LblEmptySection3EmptyLine :
{
maxValue: 4000.0000
},


LblLogoSectionEmptyLine :
{
maxValue: 4000.0000
},

Subject :
{
required: false,
maxlength: 1023
},

Rozhodnutie :
{
required: false
},

LblVyrokRozhodnutia :
{
maxValue: 4000.0000
},


LblOdovodnenie :
{
maxValue: 4000.0000
},


LblEmptySection7EmptyLine :
{
maxValue: 4000.0000
},

LblEmptySection8EmptyLine :
{
maxValue: 4000.0000
},

LblEmptySection9EmptyLine :
{
maxValue: 4000.0000
},

LblEmptySection10EmptyLine :
{
maxValue: 4000.0000
},

LblEmptySection11EmptyLine :
{
maxValue: 4000.0000
},

AdjudgementType :
{
maxlength: 127
},


ReferenceIdentifier :
{
maxlength: 2048
},

FormattedNumber :
{
FormattedNumberRegEx: true,
maxlength: 20
},

TelephoneTypeCodelistCode :
{
maxlength: 100
},

TelephoneTypeItemCode :
{
maxlength: 128
},

TelephoneTypeItemName :
{
maxlength: 128
},

EMailAddress :
{
EMailAddressRegEx: true,
maxlength: 254
},

InternetAddress :
{
maxlength: 2000
},

Ico :
{
IcoRegEx: true,
maxlength: 8
},

IdentifierTypeCodelistCode :
{
maxlength: 100
},

IdentifierTypeItemCode :
{
maxlength: 128
},

IdentifierTypeItemName :
{
maxlength: 128
},

LblUcastniciKonania :
{
maxValue: 4000.0000

}
			  	},
				messages: {
			   		HeadEmptyField :
{
maxValue: "Maximálna hodnota položky '&#160;' musí byť: 4000.0000"
},

LblSneder :
{
maxValue: "Maximálna hodnota položky 'Odosielateľ' musí byť: 4000.0000"
},

SenderStreetName :
{
required: "Položka 'Ulica' musí byť vyplnená",
maxlength: "Maximálna dĺžka položky 'Ulica' musí byť: 100 znakov"
},

SenderPropertyRegistrationNumber :
{
required: "Položka 'Súpisné číslo' musí byť vyplnená",
maxlength: "Maximálna dĺžka položky 'Súpisné číslo' musí byť: 10 znakov",
SenderPropertyRegistrationNumberRegEx: "Položka 'Súpisné číslo' má neplatný formát"
},

SenderBuildingNumber :
{
required: "Položka 'Orientačné číslo' musí byť vyplnená",
maxlength: "Maximálna dĺžka položky 'Orientačné číslo' musí byť: 20 znakov",
SenderBuildingNumberRegEx: "Položka 'Orientačné číslo' má neplatný formát"
},

SenderMunicipalityNonCodelistData :
{
required: "Položka 'Mesto' musí byť vyplnená",
maxlength: "Maximálna dĺžka položky 'Mesto' musí byť: 128 znakov"
},

SenderMunicipalityCodeList :
{
maxlength: "Maximálna dĺžka položky 'SenderMunicipalityCodeList' musí byť: 100 znakov"
},

SenderMunicipalityItemCode :
{
maxlength: "Maximálna dĺžka položky 'SenderMunicipalityItemCode' musí byť: 128 znakov"
},

SenderMunicipalityItemName :
{
maxlength: "Maximálna dĺžka položky 'SenderMunicipalityItemName' musí byť: 128 znakov"
},

SenderPostalCode :
{
required: "Položka 'PSČ' musí byť vyplnená",
maxlength: "Maximálna dĺžka položky 'PSČ' musí byť: 12 znakov",
SenderPostalCodeRegEx: "Položka 'PSČ' má neplatný formát"
},

Title :
{
required: "Položka 'Názov' musí byť vyplnená",
maxlength: "Maximálna dĺžka položky 'Názov' musí byť: 255 znakov"
},

SenderOrganizationUnit :
{
maxlength: "Maximálna dĺžka položky 'Organizačná zložka' musí byť: 255 znakov"
},

LblEmptySection4EmptyLine :
{
maxValue: "Maximálna hodnota položky '&#160;' musí byť: 4000.0000"
},

LblEmptySectionEmptyLine :
{
maxValue: "Maximálna hodnota položky '&#160;' musí byť: 4000.0000"
},

FileReference :
{
required: "Položka 'Číslo spisu (konania)' musí byť vyplnená",
maxlength: "Maximálna dĺžka položky 'Číslo spisu (konania)' musí byť: 128 znakov"
},

Equips :
{
required: "Položka 'Vybavuje' musí byť vyplnená",
maxlength: "Maximálna dĺžka položky 'Vybavuje' musí byť: 127 znakov"
},

LblVybavujeEmptyLine :
{
maxValue: "Maximálna hodnota položky '&#160;' musí byť: 4000.0000"
},

MunicipalityPlace :
{
required: "Položka 'Miesto' musí byť vyplnená",
maxlength: "Maximálna dĺžka položky 'Miesto' musí byť: 127 znakov"
},

Date :
{
required: "Položka 'Dátum' musí byť vyplnená",
date: "Položka 'Dátum' má neplatný formát"
},


AttachmentVal :
{
maxlength: "Maximálna dĺžka položky 'Príloha' musí byť: 4096 znakov"
},

LblEmptySection5EmptyLine :
{
maxValue: "Maximálna hodnota položky '&#160;' musí byť: 4000.0000"
},

ForInformationInfo :
{
maxlength: "Maximálna dĺžka položky 'Popis' musí byť: 10000 znakov"
},

ForInformationVal :
{
maxlength: "Maximálna dĺžka položky 'Na vedomie' musí byť: 255 znakov"
},

CreatorPersonDataEmptyLine1 :
{
maxValue: "Maximálna hodnota položky '&#160;' musí byť: 4000.0000"
},

CreatorPersonDataEmptyLine :
{
maxValue: "Maximálna hodnota položky '&#160;' musí byť: 4000.0000"
},

CreatorPersonName :
{
required: "Položka 'Meno a priezvisko autorizujúcej osoby' musí byť vyplnená",
maxlength: "Maximálna dĺžka položky 'Meno a priezvisko autorizujúcej osoby' musí byť: 255 znakov"
},

Position :
{
required: "Položka 'Funkcia autorizujúcej osoby' musí byť vyplnená",
maxlength: "Maximálna dĺžka položky 'Funkcia autorizujúcej osoby' musí byť: 1023 znakov"
},

CreatorPersonDataEmptyLine3 :
{
maxValue: "Maximálna hodnota položky '&#160;' musí byť: 4000.0000"
},

CreatorPersonDataEmptyLine4 :
{
maxValue: "Maximálna hodnota položky '&#160;' musí byť: 4000.0000"
},

LblEmptySection2EmptyLine :
{
maxValue: "Maximálna hodnota položky '&#160;' musí byť: 4000.0000"
},


LblEmptySection6EmptyLine :
{
maxValue: "Maximálna hodnota položky '&#160;' musí byť: 4000.0000"
},

LblRecipient :
{
maxValue: "Maximálna hodnota položky 'Adresát' musí byť: 4000.0000"
},

RecipientEmpryField :
{
maxValue: "Maximálna hodnota položky '&#160;' musí byť: 4000.0000"
},

SubjectTypeFOPO :
{
required: "Položka 'Fyzická osoba / Právnická osoba' musí byť vyplnená"
},

RecipientStreetName :
{
required: "Položka 'Ulica' musí byť vyplnená",
maxlength: "Maximálna dĺžka položky 'Ulica' musí byť: 100 znakov"
},

RecipientPropertyRegistrationNumber :
{
maxlength: "Maximálna dĺžka položky 'Súpisné číslo' musí byť: 10 znakov",
RecipientPropertyRegistrationNumberRegEx: "Položka 'Súpisné číslo' má neplatný formát"
},

RecipientBuildingNumber :
{
required: "Položka 'Orientačné číslo' musí byť vyplnená",
maxlength: "Maximálna dĺžka položky 'Orientačné číslo' musí byť: 20 znakov",
RecipientBuildingNumberRegEx: "Položka 'Orientačné číslo' má neplatný formát"
},

RecipientMunicipalityNonCodelistData :
{
required: "Položka 'Mesto' musí byť vyplnená",
maxlength: "Maximálna dĺžka položky 'Mesto' musí byť: 128 znakov"
},

RecipientMunicipalityItemCode :
{
maxlength: "Maximálna dĺžka položky 'RecipientMunicipalityItemCode' musí byť: 128 znakov"
},

RecipientMunicipalityItemName :
{
maxlength: "Maximálna dĺžka položky 'RecipientMunicipalityItemName' musí byť: 128 znakov"
},

RecipientMunicipalityCodelistCode :
{
maxlength: "Maximálna dĺžka položky 'RecipientMunicipalityCodelistCode' musí byť: 100 znakov"
},

RecipientPostalCode :
{
required: "Položka 'PSČ' musí byť vyplnená",
maxlength: "Maximálna dĺžka položky 'PSČ' musí byť: 12 znakov",
RecipientPostalCodeRegEx: "Položka 'PSČ' má neplatný formát"
},

RecipientPostalCountryItemName :
{
required: "Položka 'Štát' musí byť vyplnená"
},

RecipientPostalCountryItemCode :
{
maxlength: "Maximálna dĺžka položky 'Štát ItemCode' musí byť: 255 znakov"
},

RecipientPostalCountryCodelistCode :
{
maxlength: "Maximálna dĺžka položky 'RecipientPostalCountryCodelistCode' musí byť: 100 znakov"
},


RecipientAfixPrefixItemCode :
{
maxlength: "Maximálna dĺžka položky 'Titul pred ItemCode' musí byť: 256 znakov"
},

RecipientAfixPrefixCodelistCode :
{
maxlength: "Maximálna dĺžka položky 'RecipientAfixPrefixCodelistCode' musí byť: 128 znakov"
},

RecipientGivenName :
{
required: "Položka 'Meno' musí byť vyplnená",
maxlength: "Maximálna dĺžka položky 'Meno' musí byť: 255 znakov"
},


RecipientAfixPostfixItemCode :
{
maxlength: "Maximálna dĺžka položky 'Titul za ItemCode' musí byť: 256 znakov"
},

RecipientAfixPostfixCodelistCode :
{
maxlength: "Maximálna dĺžka položky 'RecipientAfixPostfixCodelistCode' musí byť: 128 znakov"
},

RecipientFamilyName :
{
required: "Položka 'Priezvisko' musí byť vyplnená",
maxlength: "Maximálna dĺžka položky 'Priezvisko' musí byť: 255 znakov"
},

RecipientCorporateBodyFullName :
{
required: "Položka 'Názov' musí byť vyplnená",
maxlength: "Maximálna dĺžka položky 'Názov' musí byť: 255 znakov"
},

RecipientOrganizationUnit :
{
maxlength: "Maximálna dĺžka položky 'Organizačná zložka' musí byť: 255 znakov"
},
RecipientStreetNamePO :
{
required: "Položka 'Ulica' musí byť vyplnená",
maxlength: "Maximálna dĺžka položky 'Ulica' musí byť: 100 znakov"
},

RecipientPropertyRegistrationNumberPO :
{
maxlength: "Maximálna dĺžka položky 'Súpisné číslo' musí byť: 10 znakov",
RecipientPropertyRegistrationNumberPORegEx: "Položka 'Súpisné číslo' má neplatný formát"
},

RecipientBuildingNumberPO :
{
required: "Položka 'Orientačné číslo' musí byť vyplnená",
maxlength: "Maximálna dĺžka položky 'Orientačné číslo' musí byť: 20 znakov",
RecipientBuildingNumberPORegEx: "Položka 'Orientačné číslo' má neplatný formát"
},

RecipientMunicipalityNonCodelistDataPO :
{
required: "Položka 'Mesto' musí byť vyplnená",
maxlength: "Maximálna dĺžka položky 'Mesto' musí byť: 128 znakov"
},

RecipientMunicipalityItemCodePO :
{
maxlength: "Maximálna dĺžka položky 'RecipientMunicipalityItemCode' musí byť: 128 znakov"
},

RecipientMunicipalityItemNamePO :
{
maxlength: "Maximálna dĺžka položky 'RecipientMunicipalityItemName' musí byť: 128 znakov"
},

RecipientMunicipalityCodelistCodePO :
{
maxlength: "Maximálna dĺžka položky 'RecipientMunicipalityCodelistCode' musí byť: 100 znakov"
},

RecipientPostalCodePO :
{
required: "Položka 'PSČ' musí byť vyplnená",
maxlength: "Maximálna dĺžka položky 'PSČ' musí byť: 12 znakov",
RecipientPostalCodePORegEx: "Položka 'PSČ' má neplatný formát"
},

RecipientPostalCountryItemNamePO :
{
required: "Položka 'Štát' musí byť vyplnená"
},

RecipientPostalCountryItemCodePO :
{
maxlength: "Maximálna dĺžka položky 'Štát ItemCode PO' musí byť: 256 znakov"
},

RecipientPostalCountryCodelistCodePO :
{
maxlength: "Maximálna dĺžka položky 'RecipientPostalCountryCodelistCode' musí byť: 100 znakov"
},

LblEmptySection3EmptyLine :
{
maxValue: "Maximálna hodnota položky '&#160;' musí byť: 4000.0000"
},


LblLogoSectionEmptyLine :
{
maxValue: "Maximálna hodnota položky '&#160;' musí byť: 4000.0000"
},

Subject :
{
required: "Položka 'Znenie' musí byť vyplnená",
maxlength: "Maximálna dĺžka položky 'Znenie' musí byť: 1023 znakov"
},

Rozhodnutie :
{
required: "Položka 'Rozhodnutie' musí byť vyplnená"
},

LblVyrokRozhodnutia :
{
maxValue: "Maximálna hodnota položky 'Výrok' musí byť: 4000.0000"
},


LblOdovodnenie :
{
maxValue: "Maximálna hodnota položky 'Odôvodnenie ' musí byť: 4000.0000"
},


LblEmptySection7EmptyLine :
{
maxValue: "Maximálna hodnota položky '&#160;' musí byť: 4000.0000"
},

LblEmptySection8EmptyLine :
{
maxValue: "Maximálna hodnota položky '&#160;' musí byť: 4000.0000"
},

LblEmptySection9EmptyLine :
{
maxValue: "Maximálna hodnota položky '&#160;' musí byť: 4000.0000"
},

LblEmptySection10EmptyLine :
{
maxValue: "Maximálna hodnota položky '&#160;' musí byť: 4000.0000"
},

LblEmptySection11EmptyLine :
{
maxValue: "Maximálna hodnota položky '&#160;' musí byť: 4000.0000"
},

AdjudgementType :
{
maxlength: "Maximálna dĺžka položky 'AdjudgementType' musí byť: 127 znakov"
},


ReferenceIdentifier :
{
maxlength: "Maximálna dĺžka položky 'ReferenceIdentifier' musí byť: 2048 znakov"
},

FormattedNumber :
{
maxlength: "Maximálna dĺžka položky 'Telefón' musí byť: 20 znakov",
FormattedNumberRegEx: "Položka 'Telefón' má neplatný formát"
},

TelephoneTypeCodelistCode :
{
maxlength: "Maximálna dĺžka položky 'TelephoneTypeCodelistCode' musí byť: 100 znakov"
},

TelephoneTypeItemCode :
{
maxlength: "Maximálna dĺžka položky 'TelephoneTypeItemCode' musí byť: 128 znakov"
},

TelephoneTypeItemName :
{
maxlength: "Maximálna dĺžka položky 'TelephoneTypeItemName' musí byť: 128 znakov"
},

EMailAddress :
{
maxlength: "Maximálna dĺžka položky 'E-mail' musí byť: 254 znakov",
EMailAddressRegEx: "Položka 'E-mail' má neplatný formát"
},

InternetAddress :
{
maxlength: "Maximálna dĺžka položky 'Internet' musí byť: 2000 znakov"
},

Ico :
{
maxlength: "Maximálna dĺžka položky 'IČO' musí byť: 8 znakov",
IcoRegEx: "Položka 'IČO' má neplatný formát"
},

IdentifierTypeCodelistCode :
{
maxlength: "Maximálna dĺžka položky 'IdentifierTypeCodelistCode' musí byť: 100 znakov"
},

IdentifierTypeItemCode :
{
maxlength: "Maximálna dĺžka položky 'IdentifierTypeItemCode' musí byť: 128 znakov"
},

IdentifierTypeItemName :
{
maxlength: "Maximálna dĺžka položky 'IdentifierTypeItemName' musí byť: 128 znakov"
},

LblUcastniciKonania :
{
maxValue: "Maximálna hodnota položky 'Popis konania / Účastníci konania ' musí byť: 4000.0000"

}
			  	}
			});
	  	}
	/* ]]> */
							</xsl:text></script><style type="text/css">
							.PozadieLightGreen {background:#f9fff7 ;}
							.bezOkrajaBezPozadiaHlavicky {border:0px;background:none;}
							.bezOkrajaBezPozadiaHlavicky > .caption {border:0px;background:none !important;}
							.dolava8px {position:relative;left:-8px;}
							.bezHlavicky > .caption {border:0px;background:none !important;}
							.PozadieLightBlue {background:#f6fcfe ;}
							.PozadieLightRedParent {background:#ffeaea ;}
							.PozadieLightRed {background:#fff7f7 ;}
							.tucnyText {font-weight:bold;}
							.tucnyText span {font-weight:bold;}
							.TextArea320x24pxNEW TEXTAREA {  width:370px; height: 24px}
							.TextArea320x24pxNEW INPUT {  width:370px; height: 24px}
							.TextArea150x24pNEWx TEXTAREA {  width:150px; height: 24px}
							.TextArea150x24pxNEW INPUT {  width:150px; height: 24px}
							.TextArea810x38px TEXTAREA {  width:810px; height: 38px }
							.TextArea810x38px INPUT {  width810px; height: 38px }
							.TextArea155x24pxNEW TEXTAREA {  width:155px; height: 24px}
							.TextArea155x24pxNEW INPUT {  width:155px; height: 24px}
							.TextArea812x52px TEXTAREA {  width:812px; height: 38px }
							.TextArea812x52px INPUT {  width:812px; height: 38px }
							.TextArea209x24px TEXTAREA {  width:209px; height: 24px}
							.TextArea209x24px INPUT {  width:209px; height: 24px}
							.TextBox370x26px INPUT { width:370px; }
							.hore5px {position:relative;top:-5px;}
							.TextArea300x24pxNEW TEXTAREA {  width:300px; height: 24px}
							.TextArea300x24pxNEW INPUT {  width:300px; height: 24px}
							.TextArea250x24pxNEW TEXTAREA {  width:250px; height: 24px}
							.TextArea250x24pxNEW INPUT {  width:250px; height: 24px}
							.TextArea50x24pxNEW TEXTAREA {  width:50px; height: 24px}
							.TextArea50x24pxNEW INPUT {  width:50px; height: 24px}
							.TextArea190x24pxNEW TEXTAREA {  width:190px; height: 24px}
							.TextArea190x24pxNEW INPUT {  width:190px; height: 24px}
							.Znenie LABEL {display: block; float: none; text-align: center; margin: 0 auto; font-size: 1.2em; font-weight: bold;
							}
							.Znenie .fieldContent {text-align: center;  float: none;
							width: 880px;
							display: block;
							margin-top: 10px;}
							.Znenie INPUT {min-width: 360px; text-align: center;}
							.tucnyCentrovanyTextVacsi {text-align:center;font-weight:bold;}
							.tucnyCentrovanyTextVacsi span {font-size:1.2em !important;}
							.tucnyCentrovanyTextVacsi .fieldLabel {margin: 5px 0 5px 0; width:100%}
							.TextArea812x38pxNEW TEXTAREA {  width:812px; height: 38px }
							.TextArea812x38pxNEW INPUT {  width:812px; height: 38px }
							.tucnyCentrovanyTextNormal {text-align:center;font-weight:bold;}
							.tucnyCentrovanyTextNormal span {font-size:0.75em !important;}
							.tucnyCentrovanyTextNormal .fieldLabel {margin: 5px 0 5px 0; width:100%}
							.TextArea812x300px TEXTAREA {  width:812px; height: 300px }
							.TextArea812x300px INPUT {  width:812px; height: 300px }
							.TextArea120x24px TEXTAREA {  width:120px; height: 24px}
							.TextArea120x24px INPUT {  width:120px; height: 24px}
							.TextArea64x24px TEXTAREA {  width:64px; height: 24px}
							.TextArea64x24px INPUT {  width:64px; height: 24px}
						</style></head><body><noscript><p class="noscript">Pre kompletnú funkčnosť aplikácie je potrebné povoliť JavaScript</p></noscript><div id="errorsContainerDiv" class="errorsContainerDiv"><ul id="errorsContainer" class="errorsContainer"><li /></ul></div><form id="Dokument" action=""><div id="main" class="layoutMain ui-widget-content"><xsl:for-each select="/egonp:Dokument/egonp:SecSender"><div id="layoutRow5020" class="layoutRow ui-tabs ui-widget-content   PozadieLightGreen nocaption " title=""><input type="hidden" name="SecSender" /><div id="layoutRowContentlayoutRow5020" class="columns"><div id="layoutColumn5468" class="column first"><div id="layoutCell7512" class="cell  tucnyText"><span class="fieldLabel" title=""><xsl:text disable-output-escaping="yes">Odosielateľ </xsl:text></span><div class="clear" /></div><div id="layoutCell7511" class="cell "><span class="fieldLabel" title=""><xsl:text disable-output-escaping="yes">&#160; </xsl:text></span><div class="clear" /></div><div id="layoutCell7519" class="cell "><xsl:for-each select="/egonp:Dokument/egonp:SecSender/egonp:SecSenderName"><div id="layoutRow5022" class="layoutRow ui-tabs ui-widget-content   bezOkrajaBezPozadiaHlavicky dolava8px nocaption " title=""><input type="hidden" name="SecSenderName" /><div id="layoutRowContentlayoutRow5022" class="columns"><div id="layoutColumn5472" class="column first"><div id="layoutCell7520" class="cell  TextArea810x38px"><label class="fieldLabel" title="" for="Title"><xsl:text disable-output-escaping="yes">Názov </xsl:text><em>*</em></label><span class="fieldContent"><textarea id="Title" name="Title" title="" class="xsd_string textArea " maxlength="255" cols="100" rows="5"><xsl:if test="boolean(./*[name() = 'Title']/@isReadOnly = 'true')"><xsl:attribute name="readonly">readonly</xsl:attribute><xsl:attribute name="disabled">disabled</xsl:attribute></xsl:if><xsl:choose><xsl:when test="./*[name() = 'Title']"><xsl:value-of select="./*[name() = 'Title']" /></xsl:when><xsl:otherwise><xsl:text /></xsl:otherwise></xsl:choose></textarea><div class="info"><div class="dialog-modal" title="Nápoveda"><p><style type="text/css">
																							p { margin-top: 0px;margin-bottom: 12px;line-height: 1.15; }
																							body { font-family: 'Verdana';font-size: 16px; }
																							.p_6AAD5060 { margin-top: 0px;margin-bottom: 12px;line-height: 1.15; }
																							.s_C1A2E899 { font-family: 'Arial';font-size: 14.6666666666667px;color: #00B050; }
																							.s_D3FCB7B8 { font-family: 'Verdana';font-size: 16px; } </style><p class="p_6AAD5060"><span class="s_C1A2E899">Uveďte úplný a presný názov orgánu, ktorý rozhodnutie vydáva (ako je vedený Štatistickým úradom SR v Registri organizácií). </span><span class="s_D3FCB7B8" /></p></p></div></div></span><div class="clear" /></div></div><div class="clear" /></div></div></xsl:for-each><div class="clear" /></div><div id="layoutCell7521" class="cell "><xsl:for-each select="/egonp:Dokument/egonp:SecSender/egonp:SecSenderOrganizationUnit"><div id="layoutRow5023" class="layoutRow ui-tabs ui-widget-content   bezOkrajaBezPozadiaHlavicky dolava8px nocaption " title=""><input type="hidden" name="SecSenderOrganizationUnit" /><div id="layoutRowContentlayoutRow5023" class="columns"><div id="layoutColumn5473" class="column first"><div id="layoutCell7522" class="cell  TextArea810x38px"><label class="fieldLabel" title="" for="SenderOrganizationUnit"><xsl:text disable-output-escaping="yes">Organizačná zložka </xsl:text></label><span class="fieldContent"><textarea id="SenderOrganizationUnit" name="SenderOrganizationUnit" title="" class="xsd_string textArea " maxlength="255" cols="100" rows="5"><xsl:if test="boolean(./*[name() = 'SenderOrganizationUnit']/@isReadOnly = 'true')"><xsl:attribute name="readonly">readonly</xsl:attribute><xsl:attribute name="disabled">disabled</xsl:attribute></xsl:if><xsl:choose><xsl:when test="./*[name() = 'SenderOrganizationUnit']"><xsl:value-of select="./*[name() = 'SenderOrganizationUnit']" /></xsl:when><xsl:otherwise><xsl:text /></xsl:otherwise></xsl:choose></textarea><div class="info"><div class="dialog-modal" title="Nápoveda"><p><style type="text/css">
																							p { margin-top: 0px;margin-bottom: 12px;line-height: 1.15; }
																							body { font-family: 'Verdana';font-size: 16px; }
																							.p_6AAD5060 { margin-top: 0px;margin-bottom: 12px;line-height: 1.15; }
																							.s_C1A2E899 { font-family: 'Arial';font-size: 14.6666666666667px;color: #00B050; }
																							.s_D3FCB7B8 { font-family: 'Verdana';font-size: 16px; } </style><p class="p_6AAD5060"><span class="s_C1A2E899">V prípade, že rozhodnutie vydáva konkrétna organizačná zložka, môžete uviesť jej úplný a presný názov. </span><span class="s_D3FCB7B8" /></p></p></div></div></span><div class="clear" /></div></div><div class="clear" /></div></div></xsl:for-each><div class="clear" /></div><div id="layoutCell7510" class="cell "><xsl:for-each select="/egonp:Dokument/egonp:SecSender/egonp:SecSenderAdressStreetAndNumber"><div id="layoutRow5019" class="layoutRow ui-tabs ui-widget-content   bezOkrajaBezPozadiaHlavicky dolava8px nocaption " title=""><input type="hidden" name="SecSenderAdressStreetAndNumber" /><div id="layoutRowContentlayoutRow5019" class="columns"><div id="layoutColumn5465" class="column first" style="width:440px;"><div id="layoutCell7506" class="cell  TextArea320x24pxNEW"><label class="fieldLabel" title="" for="SenderStreetName"><xsl:text disable-output-escaping="yes">Ulica </xsl:text></label><span class="fieldContent"><input id="SenderStreetName" name="SenderStreetName" title="" type="text" class="xsd_string textBox " maxlength="100" size="190" alt="" value=""><xsl:if test="boolean(./*[name() = 'SenderStreetName']/@isReadOnly = 'true')"><xsl:attribute name="readonly">readonly</xsl:attribute><xsl:attribute name="disabled">disabled</xsl:attribute></xsl:if><xsl:if test="./*[name() = 'SenderStreetName']"><xsl:attribute name="value"><xsl:value-of select="./*[name() = 'SenderStreetName']" /></xsl:attribute></xsl:if></input><div class="info"><div class="dialog-modal" title="Nápoveda"><p><style type="text/css">
																							p { margin-top: 0px;margin-bottom: 12px;line-height: 1.15; }
																							body { font-family: 'Verdana';font-size: 16px; }
																							.p_6AAD5060 { margin-top: 0px;margin-bottom: 12px;line-height: 1.15; }
																							.s_C1A2E899 { font-family: 'Arial';font-size: 14.6666666666667px;color: #00B050; }
																							.s_D3FCB7B8 { font-family: 'Verdana';font-size: 16px; } </style><p class="p_6AAD5060"><span class="s_C1A2E899">Uveďte názov ulice, kde orgán, ktorý rozhodnutie vydáva, sídli. </span><span class="s_D3FCB7B8" /></p></p></div></div></span><div class="clear" /></div></div><div id="layoutColumn5466" class="column " style="width:220px;"><div id="layoutCell7507" class="cell  TextArea150x24pxNEW"><label class="fieldLabel" title="" for="SenderPropertyRegistrationNumber"><xsl:text disable-output-escaping="yes">Súpisné číslo </xsl:text><em>*</em></label><span class="fieldContent"><input id="SenderPropertyRegistrationNumber" name="SenderPropertyRegistrationNumber" title="" type="text" class="xsd_string textBox " maxlength="10" size="190" alt="" value=""><xsl:if test="boolean(./*[name() = 'SenderPropertyRegistrationNumber']/@isReadOnly = 'true')"><xsl:attribute name="readonly">readonly</xsl:attribute><xsl:attribute name="disabled">disabled</xsl:attribute></xsl:if><xsl:if test="./*[name() = 'SenderPropertyRegistrationNumber']"><xsl:attribute name="value"><xsl:value-of select="./*[name() = 'SenderPropertyRegistrationNumber']" /></xsl:attribute></xsl:if></input><div class="info"><div class="dialog-modal" title="Nápoveda"><p><style type="text/css">
																							p { margin-top: 0px;margin-bottom: 12px;line-height: 1.15; }
																							body { font-family: 'Verdana';font-size: 16px; }
																							.p_6AAD5060 { margin-top: 0px;margin-bottom: 12px;line-height: 1.15; }
																							.s_C1A2E899 { font-family: 'Arial';font-size: 14.6666666666667px;color: #00B050; }
																							.s_A73DE0BF { font-family: 'Arial';font-size: 14.6666666666667px; }
																							.s_D3FCB7B8 { font-family: 'Verdana';font-size: 16px; } </style><p class="p_6AAD5060"><span class="s_C1A2E899">Môžete uviesť</span><span class="s_A73DE0BF" /><span class="s_C1A2E899">unikátne číslo pridelené budove v rámci katastrálneho územia. </span><span class="s_D3FCB7B8" /></p></p></div></div></span><div class="clear" /></div></div><div id="layoutColumn5467" class="column " style="width:190px;"><div id="layoutCell7508" class="cell  TextArea150x24pxNEW"><label class="fieldLabel" title="" for="SenderBuildingNumber"><xsl:text disable-output-escaping="yes">Orientačné číslo </xsl:text></label><span class="fieldContent"><input id="SenderBuildingNumber" name="SenderBuildingNumber" title="" type="text" class="xsd_string textBox " maxlength="20" size="190" alt="" value=""><xsl:if test="boolean(./*[name() = 'SenderBuildingNumber']/@isReadOnly = 'true')"><xsl:attribute name="readonly">readonly</xsl:attribute><xsl:attribute name="disabled">disabled</xsl:attribute></xsl:if><xsl:if test="./*[name() = 'SenderBuildingNumber']"><xsl:attribute name="value"><xsl:value-of select="./*[name() = 'SenderBuildingNumber']" /></xsl:attribute></xsl:if></input><div class="info"><div class="dialog-modal" title="Nápoveda"><p><style type="text/css">
																							p { margin-top: 0px;margin-bottom: 12px;line-height: 1.15; }
																							body { font-family: 'Verdana';font-size: 16px; }
																							.p_6AAD5060 { margin-top: 0px;margin-bottom: 12px;line-height: 1.15; }
																							.s_A4F101E { font-family: 'Arial';font-size: 14.67px;color: #00B050; }
																							.s_A0B393FA { font-family: 'Times New Roman';font-size: 16px;color: #00B050; } </style><p class="p_6AAD5060"><span class="s_A4F101E">Uveďte unikátne číslo pridelené budove v rámci ulice. </span><span class="s_A0B393FA" /></p></p></div></div></span><div class="clear" /></div></div><div class="clear" /></div></div></xsl:for-each><div class="clear" /></div><div id="layoutCell7513" class="cell "><xsl:for-each select="/egonp:Dokument/egonp:SecSender/egonp:SecSenderPostalCodeMunicipality"><div id="layoutRow5021" class="layoutRow ui-tabs ui-widget-content   bezOkrajaBezPozadiaHlavicky dolava8px nocaption " title=""><input type="hidden" name="SecSenderPostalCodeMunicipality" /><div id="layoutRowContentlayoutRow5021" class="columns"><div id="layoutColumn5470" class="column first" style="width:220px;"><div id="layoutCell7518" class="cell  TextArea150x24pxNEW"><label class="fieldLabel" title="" for="SenderPostalCode"><xsl:text disable-output-escaping="yes">PSČ </xsl:text><em>*</em></label><span class="fieldContent"><input id="SenderPostalCode" name="SenderPostalCode" title="" type="text" class="xsd_string textBox " maxlength="12" size="190" alt="" value=""><xsl:if test="boolean(./*[name() = 'SenderPostalCode']/@isReadOnly = 'true')"><xsl:attribute name="readonly">readonly</xsl:attribute><xsl:attribute name="disabled">disabled</xsl:attribute></xsl:if><xsl:if test="./*[name() = 'SenderPostalCode']"><xsl:attribute name="value"><xsl:value-of select="./*[name() = 'SenderPostalCode']" /></xsl:attribute></xsl:if></input><div class="info"><div class="dialog-modal" title="Nápoveda"><p><style type="text/css">
																							p { margin-top: 0px;margin-bottom: 12px;line-height: 1.15; }
																							body { font-family: 'Verdana';font-size: 16px; }
																							.p_6AAD5060 { margin-top: 0px;margin-bottom: 12px;line-height: 1.15; }
																							.s_C1A2E899 { font-family: 'Arial';font-size: 14.6666666666667px;color: #00B050; }
																							.s_D3FCB7B8 { font-family: 'Verdana';font-size: 16px; } </style><p class="p_6AAD5060"><span class="s_C1A2E899">Uveďte poštové smerovacie číslo obce/mesta bez medzier. </span><span class="s_D3FCB7B8" /></p></p></div></div></span><div class="clear" /></div></div><div id="layoutColumn5469" class="column " style="width:440px;"><div id="layoutCell7514" class="cell  TextArea320x24pxNEW"><label class="fieldLabel" title="" for="SenderMunicipalityNonCodelistData"><xsl:text disable-output-escaping="yes">Mesto </xsl:text><em>*</em></label><span class="fieldContent"><input id="SenderMunicipalityNonCodelistData" name="SenderMunicipalityNonCodelistData" title="" type="text" class="xsd_string textBox " maxlength="128" size="190" alt="" value=""><xsl:if test="boolean(./*[name() = 'SenderMunicipalityNonCodelistData']/@isReadOnly = 'true')"><xsl:attribute name="readonly">readonly</xsl:attribute><xsl:attribute name="disabled">disabled</xsl:attribute></xsl:if><xsl:if test="./*[name() = 'SenderMunicipalityNonCodelistData']"><xsl:attribute name="value"><xsl:value-of select="./*[name() = 'SenderMunicipalityNonCodelistData']" /></xsl:attribute></xsl:if></input><div class="info"><div class="dialog-modal" title="Nápoveda"><p><style type="text/css">
																							p { margin-top: 0px;margin-bottom: 12px;line-height: 1.15; }
																							body { font-family: 'Verdana';font-size: 16px; }
																							.p_6AAD5060 { margin-top: 0px;margin-bottom: 12px;line-height: 1.15; }
																							.s_A4F101E { font-family: 'Arial';font-size: 14.67px;color: #00B050; }
																							.s_A0B393FA { font-family: 'Times New Roman';font-size: 16px;color: #00B050; } </style><p class="p_6AAD5060"><span class="s_A4F101E">Uveďte názov obce/mesta. </span><span class="s_A0B393FA" /></p></p></div></div></span><div class="clear" /></div><div id="layoutCell7515" class="cell "><label class="fieldLabel" title="" for="SenderMunicipalityCodeList" style="display: none">SenderMunicipalityCodeList </label><span class="fieldContent" style="display: none"><input id="SenderMunicipalityCodeList" name="SenderMunicipalityCodeList" title="" type="text" class="xsd_string textBox " maxlength="100" size="190" alt="" value="CL000025"><xsl:if test="boolean(./*[name() = 'SenderMunicipalityCodeList']/@isReadOnly = 'true')"><xsl:attribute name="readonly">readonly</xsl:attribute><xsl:attribute name="disabled">disabled</xsl:attribute></xsl:if><xsl:if test="./*[name() = 'SenderMunicipalityCodeList']"><xsl:attribute name="value"><xsl:value-of select="./*[name() = 'SenderMunicipalityCodeList']" /></xsl:attribute></xsl:if></input></span><div class="clear" /></div><div id="layoutCell7516" class="cell "><label class="fieldLabel" title="" for="SenderMunicipalityItemCode" style="display: none">SenderMunicipalityItemCode </label><span class="fieldContent" style="display: none"><input id="SenderMunicipalityItemCode" name="SenderMunicipalityItemCode" title="" type="text" class="xsd_string textBox " maxlength="128" size="190" alt="" value=""><xsl:if test="boolean(./*[name() = 'SenderMunicipalityItemCode']/@isReadOnly = 'true')"><xsl:attribute name="readonly">readonly</xsl:attribute><xsl:attribute name="disabled">disabled</xsl:attribute></xsl:if><xsl:if test="./*[name() = 'SenderMunicipalityItemCode']"><xsl:attribute name="value"><xsl:value-of select="./*[name() = 'SenderMunicipalityItemCode']" /></xsl:attribute></xsl:if></input></span><div class="clear" /></div><div id="layoutCell7517" class="cell "><label class="fieldLabel" title="" for="SenderMunicipalityItemName" style="display: none">SenderMunicipalityItemName </label><span class="fieldContent" style="display: none"><input id="SenderMunicipalityItemName" name="SenderMunicipalityItemName" title="" type="text" class="xsd_string textBox " maxlength="128" size="190" alt="" value=""><xsl:if test="boolean(./*[name() = 'SenderMunicipalityItemName']/@isReadOnly = 'true')"><xsl:attribute name="readonly">readonly</xsl:attribute><xsl:attribute name="disabled">disabled</xsl:attribute></xsl:if><xsl:if test="./*[name() = 'SenderMunicipalityItemName']"><xsl:attribute name="value"><xsl:value-of select="./*[name() = 'SenderMunicipalityItemName']" /></xsl:attribute></xsl:if></input></span><div class="clear" /></div></div><div id="layoutColumn5471" class="column " style="width:190px;" /><div class="clear" /></div></div></xsl:for-each><div class="clear" /></div></div><div class="clear" /></div></div></xsl:for-each><xsl:for-each select="/egonp:Dokument/egonp:SecEmptySection9"><div id="layoutRow5061" class="layoutRow ui-tabs ui-widget-content   bezOkrajaBezPozadiaHlavicky nocaption " title=""><input type="hidden" name="SecEmptySection9" /><div id="layoutRowContentlayoutRow5061" class="columns"><div id="layoutColumn5536" class="column first"><div id="layoutCell7662" class="cell "><span class="fieldLabel" title=""><xsl:text disable-output-escaping="yes">&#160; </xsl:text></span><div class="clear" /></div></div><div class="clear" /></div></div></xsl:for-each><xsl:for-each select="/egonp:Dokument/egonp:SecHandled"><div id="layoutRow5035" class="layoutRow ui-tabs ui-widget-content   bezOkrajaBezPozadiaHlavicky nocaption " title=""><input type="hidden" name="SecHandled" /><div id="layoutRowContentlayoutRow5035" class="columns"><div id="layoutColumn5496" class="column first" style="width:445px;"><div id="layoutCell7571" class="cell  TextArea320x24pxNEW"><label class="fieldLabel" title="" for="FileReference"><xsl:text disable-output-escaping="yes">Číslo konania </xsl:text><em>*</em></label><span class="fieldContent"><input id="FileReference" name="FileReference" title="" type="text" class="xsd_string textBox " maxlength="128" size="190" alt="" value=""><xsl:if test="boolean(./*[name() = 'FileReference']/@isReadOnly = 'true')"><xsl:attribute name="readonly">readonly</xsl:attribute><xsl:attribute name="disabled">disabled</xsl:attribute></xsl:if><xsl:if test="./*[name() = 'FileReference']"><xsl:attribute name="value"><xsl:value-of select="./*[name() = 'FileReference']" /></xsl:attribute></xsl:if></input><div class="info"><div class="dialog-modal" title="Nápoveda"><p><style type="text/css">
																		p { margin-top: 0px;margin-bottom: 12px;line-height: 1.15; }
																		body { font-family: 'Verdana';font-size: 16px; }
																		.p_6AAD5060 { margin-top: 0px;margin-bottom: 12px;line-height: 1.15; }
																		.s_A4F101E { font-family: 'Arial';font-size: 14.67px;color: #00B050; }
																		.s_A0B393FA { font-family: 'Times New Roman';font-size: 16px;color: #00B050; } </style><p class="p_6AAD5060"><span class="s_A4F101E">Uveďte identifikačné číslo spisu, konania alebo inú registratúrnu značku. </span><span class="s_A0B393FA" /></p></p></div></div></span><div class="clear" /></div><div id="layoutCell7687" class="cell  TextArea320x24pxNEW"><label class="fieldLabel" title="" for="Equips"><xsl:text disable-output-escaping="yes">Vybavuje </xsl:text><em>*</em></label><span class="fieldContent"><input id="Equips" name="Equips" title="" type="text" class="xsd_string textBox " maxlength="127" size="190" alt="" value=""><xsl:if test="boolean(./*[name() = 'Equips']/@isReadOnly = 'true')"><xsl:attribute name="readonly">readonly</xsl:attribute><xsl:attribute name="disabled">disabled</xsl:attribute></xsl:if><xsl:if test="./*[name() = 'Equips']"><xsl:attribute name="value"><xsl:value-of select="./*[name() = 'Equips']" /></xsl:attribute></xsl:if></input><div class="info"><div class="dialog-modal" title="Nápoveda"><p><style type="text/css">
																		p { margin-top: 0px;margin-bottom: 12px;line-height: 1.15; }
																		body { font-family: 'Verdana';font-size: 16px; }
																		.p_6AAD5060 { margin-top: 0px;margin-bottom: 12px;line-height: 1.15; }
																		.s_C1A2E899 { font-family: 'Arial';font-size: 14.6666666666667px;color: #00B050; }
																		.s_D3FCB7B8 { font-family: 'Verdana';font-size: 16px; } </style><p class="p_6AAD5060"><span class="s_C1A2E899">Uveďte meno a priezvisko osoby zodpovednej za vybavenie rozhodnutia. </span><span class="s_D3FCB7B8" /></p></p></div></div></span><div class="clear" /></div><div id="layoutCell7687a" class="cell  TextArea320x24pxNEW"><label class="fieldLabel" title="" for="Equips_PhoneNumber"><xsl:text disable-output-escaping="yes">Číslo telefónu </xsl:text></label><span class="fieldContent"><input id="Equips_PhoneNumber" name="Equips_PhoneNumber" title="" type="text" class="xsd_string textBox " maxlength="127" size="190" alt="" value=""><xsl:if test="boolean(./*[name() = 'Equips_PhoneNumber']/@isReadOnly = 'true')"><xsl:attribute name="readonly">readonly</xsl:attribute><xsl:attribute name="disabled">disabled</xsl:attribute></xsl:if><xsl:if test="./*[name() = 'Equips_PhoneNumber']"><xsl:attribute name="value"><xsl:value-of select="./*[name() = 'Equips_PhoneNumber']" /></xsl:attribute></xsl:if></input><div class="info"><div class="dialog-modal" title="Nápoveda"><p><style type="text/css">
																		p { margin-top: 0px;margin-bottom: 12px;line-height: 1.15; }
																		body { font-family: 'Verdana';font-size: 16px; }
																		.p_6AAD5060 { margin-top: 0px;margin-bottom: 12px;line-height: 1.15; }
																		.s_C1A2E899 { font-family: 'Arial';font-size: 14.6666666666667px;color: #00B050; }
																		.s_D3FCB7B8 { font-family: 'Verdana';font-size: 16px; } </style><p class="p_6AAD5060"><span class="s_C1A2E899">Uveďte telefónne číslo osoby zodpovednej za vybavenie rozhodnutia. </span><span class="s_D3FCB7B8" /></p></p></div></div></span><div class="clear" /></div><div id="layoutCell7687b" class="cell  TextArea320x24pxNEW"><span class="fieldContent"><input id="Handled_Person" name="Handled_Person" title="" type="text" class="xsd_string textBox " maxlength="127" size="190" alt="" value=""><xsl:if test="boolean(./*[name() = 'Handled_Person']/@isReadOnly = 'true')"><xsl:attribute name="readonly">readonly</xsl:attribute><xsl:attribute name="disabled">disabled</xsl:attribute></xsl:if><xsl:if test="./*[name() = 'Handled_Person']"><xsl:attribute name="value"><xsl:value-of select="./*[name() = 'Handled_Person']" /></xsl:attribute></xsl:if></input><div class="info"><div class="dialog-modal" title="Nápoveda"><p><style type="text/css">
																		p { margin-top: 0px;margin-bottom: 12px;line-height: 1.15; }
																		body { font-family: 'Verdana';font-size: 16px; }
																		.p_6AAD5060 { margin-top: 0px;margin-bottom: 12px;line-height: 1.15; }
																		.s_C1A2E899 { font-family: 'Arial';font-size: 14.6666666666667px;color: #00B050; }
																		.s_D3FCB7B8 { font-family: 'Verdana';font-size: 16px; } </style><p class="p_6AAD5060"><span class="s_C1A2E899">Uveďte meno a priezvisko </span><span class="s_D3FCB7B8" /></p></p></div></div></span><div class="clear" /></div><div id="layoutCell7687c" class="cell  TextArea320x24pxNEW"><span class="fieldContent"><input id="Handled_Adress" name="Handled_Adress" title="" type="text" class="xsd_string textBox " maxlength="127" size="190" alt="" value=""><xsl:if test="boolean(./*[name() = 'Handled_Adress']/@isReadOnly = 'true')"><xsl:attribute name="readonly">readonly</xsl:attribute><xsl:attribute name="disabled">disabled</xsl:attribute></xsl:if><xsl:if test="./*[name() = 'Handled_Adress']"><xsl:attribute name="value"><xsl:value-of select="./*[name() = 'Handled_Adress']" /></xsl:attribute></xsl:if></input><div class="info"><div class="dialog-modal" title="Nápoveda"><p><style type="text/css">
																		p { margin-top: 0px;margin-bottom: 12px;line-height: 1.15; }
																		body { font-family: 'Verdana';font-size: 16px; }
																		.p_6AAD5060 { margin-top: 0px;margin-bottom: 12px;line-height: 1.15; }
																		.s_C1A2E899 { font-family: 'Arial';font-size: 14.6666666666667px;color: #00B050; }
																		.s_D3FCB7B8 { font-family: 'Verdana';font-size: 16px; } </style><p class="p_6AAD5060"><span class="s_C1A2E899">Uveďte adresu. </span><span class="s_D3FCB7B8" /></p></p></div></div></span><div class="clear" /></div></div><div id="layoutColumn5498" class="column " style="width:210px;"><div id="layoutCell7573" class="cell  TextArea155x24pxNEW"><span class="fieldLabel" title=""><xsl:text disable-output-escaping="yes">&#160; </xsl:text></span><div class="clear" /></div></div><div id="layoutColumn5500" class="column " style="width:195px;"><div id="layoutCell7575" class="cell  TextArea155x24pxNEW"><label class="fieldLabel" title="" for="MunicipalityPlace"><xsl:text disable-output-escaping="yes">Miesto </xsl:text><em>*</em></label><span class="fieldContent"><input id="MunicipalityPlace" name="MunicipalityPlace" title="" type="text" class="xsd_string textBox " maxlength="127" size="190" alt="" value=""><xsl:if test="boolean(./*[name() = 'MunicipalityPlace']/@isReadOnly = 'true')"><xsl:attribute name="readonly">readonly</xsl:attribute><xsl:attribute name="disabled">disabled</xsl:attribute></xsl:if><xsl:if test="./*[name() = 'MunicipalityPlace']"><xsl:attribute name="value"><xsl:value-of select="./*[name() = 'MunicipalityPlace']" /></xsl:attribute></xsl:if></input><div class="info"><div class="dialog-modal" title="Nápoveda"><p><style type="text/css">
																		p { margin-top: 0px;margin-bottom: 12px;line-height: 1.15; }
																		body { font-family: 'Verdana';font-size: 16px; }
																		.p_6AAD5060 { margin-top: 0px;margin-bottom: 12px;line-height: 1.15; }
																		.s_C1A2E899 { font-family: 'Arial';font-size: 14.6666666666667px;color: #00B050; }
																		.s_D3FCB7B8 { font-family: 'Verdana';font-size: 16px; } </style><p class="p_6AAD5060"><span class="s_C1A2E899">Uveďte názov obce/mesta vydania rozhodnutia. </span><span class="s_D3FCB7B8" /></p></p></div></div></span><div class="clear" /></div><div id="layoutCell7576" class="cell  TextArea155x24pxNEW"><label class="fieldLabel" title="" for="Date"><xsl:text disable-output-escaping="yes">Dátum </xsl:text><em>*</em></label><span class="fieldContent"><input alt="" id="Date" name="Date" title="" type="text" class="xsd_date date datepicker Date_internal" value="" maxlength="14" size="160"><xsl:if test="boolean(./*[name() = 'Date']/@isReadOnly = 'true')"><xsl:attribute name="readonly">readonly</xsl:attribute><xsl:attribute name="disabled">disabled</xsl:attribute></xsl:if><xsl:if test="./*[name() = 'Date']"><xsl:attribute name="value"><xsl:value-of select="./*[name() = 'Date']" /></xsl:attribute></xsl:if></input><div class="info"><div class="dialog-modal" title="Nápoveda"><p><style type="text/css">
																		p { margin-top: 0px;margin-bottom: 12px;line-height: 1.15; }
																		body { font-family: 'Verdana';font-size: 16px; }
																		.p_6AAD5060 { margin-top: 0px;margin-bottom: 12px;line-height: 1.15; }
																		.s_A4F101E { font-family: 'Arial';font-size: 14.67px;color: #00B050; }
																		.s_A0B393FA { font-family: 'Times New Roman';font-size: 16px;color: #00B050; } </style><p class="p_6AAD5060"><span class="s_A4F101E">Z kalendára vyberte deň, mesiac a rok vydania rozhodnutia. </span><span class="s_A0B393FA" /></p></p></div></div></span><div class="clear" /></div><div id="layoutCell7576x" class="cell  TextArea155x24pxNEW"><span class="fieldContent"><input alt="" id="I_O" name="I_O" title="" type="text" class="xsd_string textBox" value="" maxlength="14" size="160"><xsl:if test="boolean(./*[name() = 'I_O']/@isReadOnly = 'true')"><xsl:attribute name="readonly">readonly</xsl:attribute><xsl:attribute name="disabled">disabled</xsl:attribute></xsl:if><xsl:if test="./*[name() = 'I_O']"><xsl:attribute name="value"><xsl:value-of select="./*[name() = 'I_O']" /></xsl:attribute></xsl:if></input><div class="info"><div class="dialog-modal" title="Nápoveda"><p><style type="text/css">
																		p { margin-top: 0px;margin-bottom: 12px;line-height: 1.15; }
																		body { font-family: 'Verdana';font-size: 16px; }
																		.p_6AAD5060 { margin-top: 0px;margin-bottom: 12px;line-height: 1.15; }
																		.s_A4F101E { font-family: 'Arial';font-size: 14.67px;color: #00B050; }
																		.s_A0B393FA { font-family: 'Times New Roman';font-size: 16px;color: #00B050; } </style><p class="p_6AAD5060"><span class="s_A4F101E">ID osoby</span><span class="s_A0B393FA" /></p></p></div></div></span><div class="clear" /></div></div><div class="clear" /></div></div></xsl:for-each><xsl:for-each select="/egonp:Dokument/egonp:SecLogo"><div id="layoutRow5051" class="layoutRow ui-tabs ui-widget-content   bezOkrajaBezPozadiaHlavicky nocaption " title=""><input type="hidden" name="SecLogo" /><div id="layoutRowContentlayoutRow5051" class="columns"><div id="layoutColumn5527" class="column first" style="width:390px;"><div id="layoutCell7644" class="cell "><span class="fieldLabel" title=""><xsl:text disable-output-escaping="yes">&#160; </xsl:text></span><div class="clear" /></div></div><div id="layoutColumn5463" class="column " style="width:300px;"><div id="layoutCell7504" class="cell "><div class="clear" /></div></div><div class="clear" /></div></div></xsl:for-each><xsl:for-each select="/egonp:Dokument/egonp:SecEmptySection4"><div id="layoutRow5024" class="layoutRow ui-tabs ui-widget-content   bezOkrajaBezPozadiaHlavicky nocaption " title=""><input type="hidden" name="SecEmptySection4" /><div id="layoutRowContentlayoutRow5024" class="columns"><div id="layoutColumn5474" class="column first"><div id="layoutCell7524" class="cell "><span class="fieldLabel" title=""><xsl:text disable-output-escaping="yes">&#160; </xsl:text></span><div class="clear" /></div></div><div class="clear" /></div></div></xsl:for-each><xsl:for-each select="/egonp:Dokument/egonp:SecRozhodnutie"><div id="layoutRow5052" class="layoutRow ui-tabs ui-widget-content   bezOkrajaBezPozadiaHlavicky nocaption " title=""><input type="hidden" name="SecRozhodnutie" /><div id="layoutRowContentlayoutRow5052" class="columns"><div id="layoutColumn5522" class="column first"><div id="layoutCell7632" class="cell  Znenie"><label class="fieldLabel" title="" for="Subject"><xsl:text disable-output-escaping="yes">Znenie </xsl:text></label><span class="fieldContent"><input id="Subject" name="Subject" title="" type="text" class="xsd_string textBox " maxlength="1023" size="190" alt="" value="ROZHODNUTIE "><xsl:if test="boolean(./*[name() = 'Subject']/@isReadOnly = 'true')"><xsl:attribute name="readonly">readonly</xsl:attribute><xsl:attribute name="disabled">disabled</xsl:attribute></xsl:if><xsl:if test="./*[name() = 'Subject']"><xsl:attribute name="value"><xsl:value-of select="./*[name() = 'Subject']" /></xsl:attribute></xsl:if></input><div class="info"><div class="dialog-modal" title="Nápoveda"><p><style type="text/css">
																		p { margin-top: 0px;margin-bottom: 12px;line-height: 1.15; }
																		body { font-family: 'Verdana';font-size: 16px; }
																		.p_6AAD5060 { margin-top: 0px;margin-bottom: 12px;line-height: 1.15; }
																		.s_A4F101E { font-family: 'Arial';font-size: 14.67px;color: #00B050; }
																		.s_D3FCB7B8 { font-family: 'Verdana';font-size: 16px; } </style><p class="p_6AAD5060"><span class="s_A4F101E">Vpíšte úplné a presné znenie veľkými písmenami, napríklad ROZHODNUTIE alebo ROZKAZ. </span><span class="s_D3FCB7B8" /></p></p></div></div></span><div class="clear" /></div><div id="layoutCell7639" class="cell  TextArea812x38pxNEW"><label class="fieldLabel" title="" for="Rozhodnutie" style="display: none">Rozhodnutie <em>*</em></label><span class="fieldContent"><textarea id="Rozhodnutie" name="Rozhodnutie" title="" class="xsd_string textArea " cols="100" rows="5"><xsl:if test="boolean(./*[name() = 'Rozhodnutie']/@isReadOnly = 'true')"><xsl:attribute name="readonly">readonly</xsl:attribute><xsl:attribute name="disabled">disabled</xsl:attribute></xsl:if><xsl:choose><xsl:when test="./*[name() = 'Rozhodnutie']"><xsl:value-of select="./*[name() = 'Rozhodnutie']" /></xsl:when><xsl:otherwise><xsl:text /></xsl:otherwise></xsl:choose></textarea><div class="info"><div class="dialog-modal" title="Nápoveda"><p><style type="text/css">
																		p { margin-top: 0px;margin-bottom: 12px;line-height: 1.15; }
																		body { font-family: 'Verdana';font-size: 16px; }
																		.p_6AAD5060 { margin-top: 0px;margin-bottom: 12px;line-height: 1.15; }
																		.s_A4F101E { font-family: 'Arial';font-size: 14.67px;color: #00B050; }
																		.s_A0B393FA { font-family: 'Times New Roman';font-size: 16px;color: #00B050; } </style><p class="p_6AAD5060"><span class="s_A4F101E">Vpíšte úplný a presný názov rozhodnutia v zmysle osobitných právnych predpisov, na základe ktorých príslušný orgán pri vydaní rozhodnutia postupoval. </span><span class="s_A0B393FA" /></p></p></div></div></span><div class="clear" /></div></div><div class="clear" /></div></div></xsl:for-each><xsl:for-each select="/egonp:Dokument/egonp:SecEmptySection10"><div id="layoutRow5062" class="layoutRow ui-tabs ui-widget-content   bezOkrajaBezPozadiaHlavicky nocaption " title=""><input type="hidden" name="SecEmptySection10" /><div id="layoutRowContentlayoutRow5062" class="columns"><div id="layoutColumn5537" class="column first"><div id="layoutCell7664" class="cell "><span class="fieldLabel" title=""><xsl:text disable-output-escaping="yes">&#160; </xsl:text></span><div class="clear" /></div></div><div class="clear" /></div></div></xsl:for-each><xsl:for-each select="/egonp:Dokument/egonp:SecUcastniciKonania"><div id="layoutRow5068" class="layoutRow ui-tabs ui-widget-content   bezOkrajaBezPozadiaHlavicky nocaption " title=""><input type="hidden" name="SecUcastniciKonania" /><div id="layoutRowContentlayoutRow5068" class="columns"><div id="layoutColumn5546" class="column first"><div id="layoutCell7689" class="cell  tucnyCentrovanyTextNormal"><span class="fieldLabel" title=""><xsl:text disable-output-escaping="yes">Popis konania / Účastníci konania </xsl:text></span><div class="clear" /></div><div id="layoutCell7690" class="cell  TextArea812x300px"><label class="fieldLabel" title="" for="UcastniciKonania" style="display: none">Popis konania / Účastníci konania </label><span class="fieldContent"><textarea id="UcastniciKonania" name="UcastniciKonania" title="" class="xsd_string textArea " cols="100" rows="5"><xsl:if test="boolean(./*[name() = 'UcastniciKonania']/@isReadOnly = 'true')"><xsl:attribute name="readonly">readonly</xsl:attribute><xsl:attribute name="disabled">disabled</xsl:attribute></xsl:if><xsl:choose><xsl:when test="./*[name() = 'UcastniciKonania']"><xsl:value-of select="./*[name() = 'UcastniciKonania']" /></xsl:when><xsl:otherwise><xsl:text /></xsl:otherwise></xsl:choose></textarea><div class="info"><div class="dialog-modal" title="Nápoveda"><p><style type="text/css">
																		p { margin-top: 0px;margin-bottom: 12px;line-height: 1.15; }
																		body { font-family: 'Verdana';font-size: 16px; }
																		.p_6AAD5060 { margin-top: 0px;margin-bottom: 12px;line-height: 1.15; }
																		.s_C1A2E899 { font-family: 'Arial';font-size: 14.6666666666667px;color: #00B050; }
																		.s_D3FCB7B8 { font-family: 'Verdana';font-size: 16px; } </style><p class="p_6AAD5060"><span class="s_C1A2E899">Uveďte identifikačné údaje všetkých účastníkov konania (napr. meno, priezvisko, dátum narodenia, rodné číslo, adresu trvalého pobytu a pod.) a stručne popíšte samotné konanie, aby bolo zrejmé, v akej veci sa vydáva. </span><span class="s_D3FCB7B8" /></p></p></div></div></span><div class="clear" /></div></div><div class="clear" /></div></div></xsl:for-each><xsl:for-each select="/egonp:Dokument/egonp:SecEmptySection"><div id="layoutRow5034" class="layoutRow ui-tabs ui-widget-content   bezOkrajaBezPozadiaHlavicky nocaption " title=""><input type="hidden" name="SecEmptySection" /><div id="layoutRowContentlayoutRow5034" class="columns"><div id="layoutColumn5495" class="column first"><div id="layoutCell7569" class="cell "><span class="fieldLabel" title=""><xsl:text disable-output-escaping="yes">&#160; </xsl:text></span><div class="clear" /></div></div><div class="clear" /></div></div></xsl:for-each><xsl:for-each select="/egonp:Dokument/egonp:SecVyrokRozhodnutia"><div id="layoutRow5053" class="layoutRow ui-tabs ui-widget-content   bezOkrajaBezPozadiaHlavicky nocaption " title=""><input type="hidden" name="SecVyrokRozhodnutia" /><div id="layoutRowContentlayoutRow5053" class="columns"><div id="layoutColumn5523" class="column first"><div id="layoutCell7634" class="cell  tucnyCentrovanyTextNormal"><span class="fieldLabel" title=""><xsl:text disable-output-escaping="yes">Výrok </xsl:text></span><div class="clear" /></div><div id="layoutCell7637" class="cell  TextArea812x300px"><label class="fieldLabel" title="" for="VyrokRozhodnutia" style="display: none">Výrok </label><span class="fieldContent"><textarea id="VyrokRozhodnutia" name="VyrokRozhodnutia" title="" class="xsd_string textArea " cols="100" rows="5"><xsl:if test="boolean(./*[name() = 'VyrokRozhodnutia']/@isReadOnly = 'true')"><xsl:attribute name="readonly">readonly</xsl:attribute><xsl:attribute name="disabled">disabled</xsl:attribute></xsl:if><xsl:choose><xsl:when test="./*[name() = 'VyrokRozhodnutia']"><xsl:value-of select="./*[name() = 'VyrokRozhodnutia']" /></xsl:when><xsl:otherwise><xsl:text /></xsl:otherwise></xsl:choose></textarea><div class="info"><div class="dialog-modal" title="Nápoveda"><p><style type="text/css">
																		p { margin-top: 0px;margin-bottom: 12px;line-height: 1.15; }
																		body { font-family: 'Verdana';font-size: 16px; }
																		.p_6AAD5060 { margin-top: 0px;margin-bottom: 12px;line-height: 1.15; }
																		.s_A4F101E { font-family: 'Arial';font-size: 14.67px;color: #00B050; }
																		.s_A0B393FA { font-family: 'Times New Roman';font-size: 16px;color: #00B050; } </style><p class="p_6AAD5060"><span class="s_A4F101E">Uveďte text výroku rozhodnutia vo veci samej, z ktorého budú zrejmé priznané oprávnenia, povinnosti, aplikované právne ustanovenia, lehota na plnenie a pod. </span><span class="s_A0B393FA" /></p></p></div></div></span><div class="clear" /></div></div><div class="clear" /></div></div></xsl:for-each><xsl:for-each select="/egonp:Dokument/egonp:SecEmptySection7"><div id="layoutRow5055" class="layoutRow ui-tabs ui-widget-content   bezOkrajaBezPozadiaHlavicky nocaption " title=""><input type="hidden" name="SecEmptySection7" /><div id="layoutRowContentlayoutRow5055" class="columns"><div id="layoutColumn5525" class="column first"><div id="layoutCell7641" class="cell "><span class="fieldLabel" title=""><xsl:text disable-output-escaping="yes">&#160; </xsl:text></span><div class="clear" /></div></div><div class="clear" /></div></div></xsl:for-each><xsl:for-each select="/egonp:Dokument/egonp:SecOdovodnenie"><div id="layoutRow5054" class="layoutRow ui-tabs ui-widget-content   bezOkrajaBezPozadiaHlavicky nocaption " title=""><input type="hidden" name="SecOdovodnenie" /><div id="layoutRowContentlayoutRow5054" class="columns"><div id="layoutColumn5524" class="column first"><div id="layoutCell7636" class="cell  tucnyCentrovanyTextNormal"><span class="fieldLabel" title=""><xsl:text disable-output-escaping="yes">Odôvodnenie </xsl:text></span><div class="clear" /></div><div id="layoutCell7638" class="cell  TextArea812x300px"><label class="fieldLabel" title="" for="Odovodnenie" style="display: none">Odôvodnenie </label><span class="fieldContent"><textarea id="Odovodnenie" name="Odovodnenie" title="" class="xsd_string textArea " cols="100" rows="5"><xsl:if test="boolean(./*[name() = 'Odovodnenie']/@isReadOnly = 'true')"><xsl:attribute name="readonly">readonly</xsl:attribute><xsl:attribute name="disabled">disabled</xsl:attribute></xsl:if><xsl:choose><xsl:when test="./*[name() = 'Odovodnenie']"><xsl:value-of select="./*[name() = 'Odovodnenie']" /></xsl:when><xsl:otherwise><xsl:text /></xsl:otherwise></xsl:choose></textarea><div class="info"><div class="dialog-modal" title="Nápoveda"><p><style type="text/css">
																		p { margin-top: 0px;margin-bottom: 12px;line-height: 1.15; }
																		body { font-family: 'Verdana';font-size: 16px; }
																		.p_6AAD5060 { margin-top: 0px;margin-bottom: 12px;line-height: 1.15; }
																		.s_A4F101E { font-family: 'Arial';font-size: 14.67px;color: #00B050; }
																		.s_A0B393FA { font-family: 'Times New Roman';font-size: 16px;color: #00B050; } </style><p class="p_6AAD5060"><span class="s_A4F101E">Uveďte text odôvodnenia výroku rozhodnutia, ktorý zhodnotí skutkový stav, vyjadrenia účastníkov konania, zhrnie dokazovanie, zdôvodní posúdenie právneho stavu veci a pod.). </span><span class="s_A0B393FA" /></p></p></div></div></span><div class="clear" /></div></div><div class="clear" /></div></div></xsl:for-each><xsl:for-each select="/egonp:Dokument/egonp:SecEmptySection8"><div id="layoutRow5056" class="layoutRow ui-tabs ui-widget-content   bezOkrajaBezPozadiaHlavicky nocaption " title=""><input type="hidden" name="SecEmptySection8" /><div id="layoutRowContentlayoutRow5056" class="columns"><div id="layoutColumn5526" class="column first"><div id="layoutCell7643" class="cell "><span class="fieldLabel" title=""><xsl:text disable-output-escaping="yes">&#160; </xsl:text></span><div class="clear" /></div></div><div class="clear" /></div></div></xsl:for-each><xsl:for-each select="/egonp:Dokument/egonp:SecPoucenie"><div id="layoutRow5045" class="layoutRow ui-tabs ui-widget-content   bezHlavicky PozadieLightBlue " title=""><input type="hidden" name="SecPoucenie" /><div class="caption ui-widget-header"><div class="headercorrection" title="Poučenie">Poučenie			</div><span class="arrow ui-icon ui-icon-carat-1-n" /></div><div id="layoutRowContentlayoutRow5045" class="columns"><div id="layoutColumn5514" class="column first"><div id="layoutCell7613" class="cell  TextArea812x52px"><label class="fieldLabel" title="" for="Poucenie" style="display: none">Poučenie </label><span class="fieldContent"><textarea id="Poucenie" name="Poucenie" title="" class="xsd_string textArea " cols="100" rows="5"><xsl:if test="boolean(./*[name() = 'Poucenie']/@isReadOnly = 'true')"><xsl:attribute name="readonly">readonly</xsl:attribute><xsl:attribute name="disabled">disabled</xsl:attribute></xsl:if><xsl:choose><xsl:when test="./*[name() = 'Poucenie']"><xsl:value-of select="./*[name() = 'Poucenie']" /></xsl:when><xsl:otherwise><xsl:text /></xsl:otherwise></xsl:choose></textarea><div class="info"><div class="dialog-modal" title="Nápoveda"><p><style type="text/css">
																		p { margin-top: 0px;margin-bottom: 12px;line-height: 1.15; }
																		body { font-family: 'Verdana';font-size: 16px; }
																		.p_6AAD5060 { margin-top: 0px;margin-bottom: 12px;line-height: 1.15; }
																		.s_A4F101E { font-family: 'Arial';font-size: 14.67px;color: #00B050; }
																		.s_A0B393FA { font-family: 'Times New Roman';font-size: 16px;color: #00B050; } </style><p class="p_6AAD5060"><span class="s_A4F101E">Zadajte text poučenia rozhodnutia, ktorý bude obsahovať informáciu o prípustnosti alebo neprípustnosti podať opravný prostriedok, v akej lehote, akému orgánu a pod.. </span><span class="s_A0B393FA" /></p></p></div></div></span><div class="clear" /></div></div><div class="clear" /></div><div id="repetitionCommandslayoutRow5045" class="sectionPager"><xsl:if test="position() != last()"><xsl:attribute name="style"><xsl:text>display:none;</xsl:text></xsl:attribute></xsl:if><span id="addSectionlayoutRow5045" class="button addRemoveSection" onclick="addSection(0, 1, this)" title="Pridať sekciu Poučenie">Pridať</span><span id="removeSectionlayoutRow5045" class="button addRemoveSection" onclick="removeSection(0, this)" title="Odobrať sekciu Poučenie">Odobrať</span></div></div></xsl:for-each><xsl:if test="normalize-space(/egonp:Dokument/egonp:SecPoucenie) = ''"><xsl:if test="/egonp:Dokument/egonp:SecPoucenie/@notInFormData"><script type="text/javascript">$(document).ready(function () { initRepetitionSection(0, 1, 'layoutRow5045') })</script></xsl:if></xsl:if><xsl:for-each select="/egonp:Dokument/egonp:SecEmptySection2"><div id="layoutRow5044" class="layoutRow ui-tabs ui-widget-content   bezOkrajaBezPozadiaHlavicky nocaption " title=""><input type="hidden" name="SecEmptySection2" /><div id="layoutRowContentlayoutRow5044" class="columns"><div id="layoutColumn5513" class="column first"><div id="layoutCell7611" class="cell "><span class="fieldLabel" title=""><xsl:text disable-output-escaping="yes">&#160; </xsl:text></span><div class="clear" /></div></div><div class="clear" /></div></div></xsl:for-each><xsl:for-each select="/egonp:Dokument/egonp:Attachment"><div id="layoutRow5037" class="layoutRow ui-tabs ui-widget-content PozadieLightBlue" title=""><input type="hidden" name="Attachment" /><div class="caption ui-widget-header"><div class="headercorrection" title="Príloha">Príloha			</div><span class="arrow ui-icon ui-icon-carat-1-n" /></div><div id="layoutRowContentlayoutRow5037" class="columns"><div id="layoutColumn5502" class="column first"><div id="layoutCell7584" class="cell "><!--<xsl:for-each select="/egonp:Dokument/egonp:Attachment/egonp:SecAttachmentInner">--><!--<div id="layoutRow5038" class="layoutRow ui-tabs ui-widget-content   bezOkrajaBezPozadiaHlavicky dolava8px nocaption " title="">--><!--<input type="hidden" name="SecAttachmentInner"/>--><!--
															<div id="layoutRowContentlayoutRow5038" class="columns">
																<div id="layoutColumn5503" class="column first" style="width:294px;">
																	<div id="layoutCell7585" class="cell  TextArea209x24px">--><label class="fieldLabel" title="" for="AttachmentVal"><xsl:text disable-output-escaping="yes"><!--Príloha--></xsl:text></label><span class="fieldContent"><input id="AttachmentVal" name="AttachmentVal" title="" type="text" class="xsd_string textBox " maxlength="4096" size="190" alt="" value=""><xsl:if test="boolean(./*[name() = 'AttachmentVal']/@isReadOnly = 'true')"><xsl:attribute name="readonly">readonly</xsl:attribute><xsl:attribute name="disabled">disabled</xsl:attribute></xsl:if><xsl:if test="./*[name() = 'AttachmentVal']"><xsl:attribute name="value"><xsl:value-of select="./*[name() = 'AttachmentVal']" /></xsl:attribute></xsl:if></input><div class="info"><div class="dialog-modal" title="Nápoveda"><p><style type="text/css">
																		p { margin-top: 0px;margin-bottom: 12px;line-height: 1.15; }
																		body { font-family: 'Verdana';font-size: 16px; }
																		.p_6AAD5060 { margin-top: 0px;margin-bottom: 12px;line-height: 1.15; }
																		.s_C1A2E899 { font-family: 'Arial';font-size: 14.6666666666667px;color: #00B050; }
																		.s_D3FCB7B8 { font-family: 'Verdana';font-size: 16px; } </style><p class="p_6AAD5060"><span class="s_C1A2E899">Môžete vpísať číselný údaj predstavujúci počet priložených dokumentov, príklad: 2 prílohy. </span><span class="s_D3FCB7B8" /></p></p></div></div></span><div class="clear" /><!--</div>
																</div>
																<div class="clear"/>
															</div>--><!--</div>--><!--</xsl:for-each>--><!--<div class="clear"/>--></div><div id="layoutCell7583" class="cell  TextArea812x52px"><label class="fieldLabel" title="" for="AttachmentInfo"><xsl:text disable-output-escaping="yes">Popis prílohy</xsl:text></label><span class="fieldContent"><textarea id="AttachmentInfo" name="AttachmentInfo" title="" class="xsd_string textArea " cols="100" rows="5"><xsl:if test="boolean(./*[name() = 'AttachmentInfo']/@isReadOnly = 'true')"><xsl:attribute name="readonly">readonly</xsl:attribute><xsl:attribute name="disabled">disabled</xsl:attribute></xsl:if><xsl:choose><xsl:when test="./*[name() = 'AttachmentInfo']"><xsl:value-of select="./*[name() = 'AttachmentInfo']" /></xsl:when><xsl:otherwise><xsl:text /></xsl:otherwise></xsl:choose></textarea><div class="info"><div class="dialog-modal" title="Nápoveda"><p><style type="text/css">
																		p { margin-top: 0px;margin-bottom: 12px;line-height: 1.15; }
																		body { font-family: 'Verdana';font-size: 16px; }
																		.p_6AAD5060 { margin-top: 0px;margin-bottom: 12px;line-height: 1.15; }
																		.s_A4F101E { font-family: 'Arial';font-size: 14.67px;color: #00B050; }
																		.s_A0B393FA { font-family: 'Times New Roman';font-size: 16px;color: #00B050; } </style><p class="p_6AAD5060"><span class="s_A4F101E">Môžete zadať úplné a presné názvy priložených dokumentov, príklad: Diplom, Životopis. </span><span class="s_A0B393FA" /></p></p></div></div></span><div class="clear" /></div></div><div class="clear" /></div><div id="repetitionCommandslayoutRow5037" class="sectionPager"><xsl:if test="position() != last()"><xsl:attribute name="style"><xsl:text>display:none;</xsl:text></xsl:attribute></xsl:if><span id="addSectionlayoutRow5037" class="button addRemoveSection" onclick="addSection(0, 9, this)" title="Pridať sekciu Príloha">Pridať</span><span id="removeSectionlayoutRow5037" class="button addRemoveSection" onclick="removeSection(0, this)" title="Odobrať sekciu Príloha">Odobrať</span></div></div></xsl:for-each><xsl:if test="normalize-space(/egonp:Dokument/egonp:Attachment) = ''"><xsl:if test="/egonp:Dokument/egonp:Attachment/@notInFormData"><script type="text/javascript">$(document).ready(function () { initRepetitionSection(0, 9, 'layoutRow5037') })</script></xsl:if></xsl:if><xsl:for-each select="/egonp:Dokument/egonp:SecEmptySection5"><div id="layoutRow5039" class="layoutRow ui-tabs ui-widget-content   bezOkrajaBezPozadiaHlavicky nocaption " title=""><input type="hidden" name="SecEmptySection5" /><div id="layoutRowContentlayoutRow5039" class="columns"><div id="layoutColumn5504" class="column first"><div id="layoutCell7587" class="cell "><span class="fieldLabel" title=""><xsl:text disable-output-escaping="yes">&#160; </xsl:text></span><div class="clear" /></div></div><div class="clear" /></div></div></xsl:for-each><xsl:for-each select="/egonp:Dokument/egonp:SecCreatorPersonData"><div id="layoutRow5042" class="layoutRow ui-tabs ui-widget-content   bezOkrajaBezPozadiaHlavicky nocaption " title=""><input type="hidden" name="SecCreatorPersonData" /><div id="layoutRowContentlayoutRow5042" class="columns"><div id="layoutColumn5507" class="column first" style="width:436px;"><div id="layoutCell7594" class="cell "><span class="fieldLabel" title=""><xsl:text disable-output-escaping="yes">&#160; </xsl:text></span><div class="clear" /></div><div id="layoutCell7593" class="cell "><span class="fieldLabel" title=""><xsl:text disable-output-escaping="yes">&#160; </xsl:text></span><div class="clear" /></div></div><div id="layoutColumn5508" class="column " style="width:430px;"><div id="layoutCell7667" class="cell "><xsl:for-each select="./egonp:CreatorPerson"><div id="layoutRow5064" class="layoutRow ui-tabs ui-widget-content   bezOkrajaBezPozadiaHlavicky nocaption " title=""><xsl:variable name="nRowslayoutRow5064" select="position()" /><xsl:attribute name="id">layoutRow5064<xsl:if test="position() > 1"><xsl:text>_Repeating_</xsl:text><xsl:value-of select="position()-1" /></xsl:if></xsl:attribute><xsl:attribute name="class">layoutRow ui-tabs ui-widget-content  bezOkrajaBezPozadiaHlavicky nocaption  <xsl:if test="position() > 1"><xsl:text> repeatingSection</xsl:text></xsl:if></xsl:attribute><input type="hidden" name="CreatorPerson" /><div id="layoutRowContentlayoutRow5064" class="columns"><div id="layoutColumn5539" class="column first"><div id="layoutCell7597" class="cell "><span class="fieldLabel" title=""><xsl:text disable-output-escaping="yes">&#160; </xsl:text></span><div class="clear" /></div><div id="layoutCell7595" class="cell  TextBox370x26px hore5px"><label class="fieldLabel" title="" for="CreatorPersonName" style="width:240px;"><xsl:text disable-output-escaping="yes">Meno a priezvisko autorizujúcej osoby </xsl:text></label><span class="fieldContent"><input id="CreatorPersonName" name="CreatorPersonName" title="" type="text" class="xsd_string textBox " maxlength="255" size="190" alt="" value=""><xsl:if test="boolean(./*[name() = 'CreatorPersonName']/@isReadOnly = 'true')"><xsl:attribute name="readonly">readonly</xsl:attribute><xsl:attribute name="disabled">disabled</xsl:attribute></xsl:if><xsl:if test="./*[name() = 'CreatorPersonName']"><xsl:attribute name="value"><xsl:value-of select="./*[name() = 'CreatorPersonName']" /></xsl:attribute></xsl:if></input><div class="info"><div class="dialog-modal" title="Nápoveda"><p><style type="text/css">
																							p { margin-top: 0px;margin-bottom: 12px;line-height: 1.15; }
																							body { font-family: 'Verdana';font-size: 16px; }
																							.p_6AAD5060 { margin-top: 0px;margin-bottom: 12px;line-height: 1.15; }
																							.s_A4F101E { font-family: 'Arial';font-size: 14.67px;color: #00B050; }
																							.s_A0B393FA { font-family: 'Times New Roman';font-size: 16px;color: #00B050; } </style><p class="p_6AAD5060"><span class="s_A4F101E">Uveďte meno a priezvisko osoby oprávnenej rozhodnutie podpísať alebo zapečatiť. </span><span class="s_A0B393FA" /></p></p></div></div></span><div class="clear" /></div><div id="layoutCell7596" class="cell  TextBox370x26px"><label class="fieldLabel" title="" for="Position"><xsl:text disable-output-escaping="yes">Funkcia autorizujúcej osoby </xsl:text></label><span class="fieldContent"><input id="Position" name="Position" title="" type="text" class="xsd_string textBox " maxlength="1023" size="190" alt="" value=""><xsl:if test="boolean(./*[name() = 'Position']/@isReadOnly = 'true')"><xsl:attribute name="readonly">readonly</xsl:attribute><xsl:attribute name="disabled">disabled</xsl:attribute></xsl:if><xsl:if test="./*[name() = 'Position']"><xsl:attribute name="value"><xsl:value-of select="./*[name() = 'Position']" /></xsl:attribute></xsl:if></input><div class="info"><div class="dialog-modal" title="Nápoveda"><p><style type="text/css">
																							p { margin-top: 0px;margin-bottom: 12px;line-height: 1.15; }
																							body { font-family: 'Verdana';font-size: 16px; }
																							.p_6AAD5060 { margin-top: 0px;margin-bottom: 12px;line-height: 1.15; }
																							.s_A4F101E { font-family: 'Arial';font-size: 14.67px;color: #00B050; }
																							.s_A0B393FA { font-family: 'Times New Roman';font-size: 16px;color: #00B050; } </style><p class="p_6AAD5060"><span class="s_A4F101E">Uveďte pracovné zaradenie osoby oprávnenej rozhodnutie podpísať alebo zapečatiť, príklad: riaditeľ odboru verejného obstarávania. </span><span class="s_A0B393FA" /></p></p></div></div></span><div class="clear" /></div><div id="layoutCell7598" class="cell "><span class="fieldLabel" title=""><xsl:text disable-output-escaping="yes">&#160; </xsl:text></span><div class="clear" /></div></div><div class="clear" /></div><div id="repetitionCommandslayoutRow5064" class="sectionPager"><xsl:if test="position() != last()"><xsl:attribute name="style"><xsl:text>display:none;</xsl:text></xsl:attribute></xsl:if><span id="addSectionlayoutRow5064" class="button addRemoveSection" onclick="addSection(1, 99, this)" title="Pridať sekciu Osoby">Pridať</span><span id="removeSectionlayoutRow5064" class="button addRemoveSection" onclick="removeSection(1, this)" title="Odobrať sekciu Osoby">Odobrať</span></div></div></xsl:for-each><xsl:if test="normalize-space(./egonp:CreatorPerson) = ''"><xsl:if test="./egonp:CreatorPerson/@notInFormData"><script type="text/javascript">$(document).ready(function () { initRepetitionSection(1, 99, 'layoutRow5064') })</script></xsl:if></xsl:if><div class="clear" /></div></div><div class="clear" /></div></div></xsl:for-each><xsl:for-each select="/egonp:Dokument/egonp:SecEmptySection3"><div id="layoutRow5050" class="layoutRow ui-tabs ui-widget-content   bezOkrajaBezPozadiaHlavicky nocaption " title=""><input type="hidden" name="SecEmptySection3" /><div id="layoutRowContentlayoutRow5050" class="columns"><div id="layoutColumn5521" class="column first"><div id="layoutCell7625" class="cell "><span class="fieldLabel" title=""><xsl:text disable-output-escaping="yes">&#160; </xsl:text></span><div class="clear" /></div></div><div class="clear" /></div></div></xsl:for-each><xsl:for-each select="/egonp:Dokument/egonp:SecDorucujeSa"><div id="layoutRow5048" class="layoutRow ui-tabs ui-widget-content   bezHlavicky PozadieLightRedParent " title=""><input type="hidden" name="SecDorucujeSa" /><div class="caption ui-widget-header"><div class="headercorrection" title="Doručuje sa">Doručuje sa			</div><span class="arrow ui-icon ui-icon-carat-1-n" /></div><div id="layoutRowContentlayoutRow5048" class="columns"><div id="layoutColumn5518" class="column first" style="width:901px;"><div id="layoutCell7525" class="cell "><xsl:for-each select="./egonp:Recipient"><div id="layoutRow5025" class="layoutRow ui-tabs ui-widget-content   dolava8px PozadieLightRed nocaption " title=""><xsl:variable name="nRowslayoutRow5025" select="position()" /><xsl:attribute name="id">layoutRow5025<xsl:if test="position() > 1"><xsl:text>_Repeating_</xsl:text><xsl:value-of select="position()-1" /></xsl:if></xsl:attribute><xsl:attribute name="class">layoutRow ui-tabs ui-widget-content  dolava8px PozadieLightRed nocaption  <xsl:if test="position() > 1"><xsl:text> repeatingSection</xsl:text></xsl:if></xsl:attribute><input type="hidden" name="Recipient" /><div id="layoutRowContentlayoutRow5025" class="columns"><div id="layoutColumn5475" class="column first"><div id="layoutCell7526" class="cell  tucnyText"><span class="fieldLabel" title=""><xsl:text disable-output-escaping="yes">Adresát </xsl:text></span><div class="clear" /></div><div id="layoutCell7527" class="cell "><span class="fieldLabel" title=""><xsl:text disable-output-escaping="yes">&#160; </xsl:text></span><div class="clear" /></div><div id="layoutCell7528" class="cell "><fieldset><legend /><div class="xsd_string radioButtonList "><span><input id="SubjectTypeFOPO" name="SubjectTypeFOPO" class="xsd_string radioButtonList " title="" type="radio" alt="Fyzická osoba" value="Fyzická osoba"><xsl:attribute name="name">SubjectTypeFOPO</xsl:attribute><xsl:if test="boolean(./*[name() = 'SubjectTypeFOPO']/@isReadOnly = 'true')"><xsl:attribute name="readonly">readonly</xsl:attribute><xsl:attribute name="disabled">disabled</xsl:attribute></xsl:if><xsl:if test="./*[name() = 'SubjectTypeFOPO']='Fyzick&#225; osoba'"><xsl:attribute name="checked">checked</xsl:attribute></xsl:if></input><label for="SubjectTypeFOPO" class="optionLabel">Fyzická osoba</label></span><span><input id="SubjectTypeFOPOPostfixList1" name="SubjectTypeFOPO" class="xsd_string radioButtonList " title="" type="radio" alt="Právnická osoba" value="Právnická osoba"><xsl:attribute name="name">SubjectTypeFOPO</xsl:attribute><xsl:if test="boolean(./*[name() = 'SubjectTypeFOPO']/@isReadOnly = 'true')"><xsl:attribute name="readonly">readonly</xsl:attribute><xsl:attribute name="disabled">disabled</xsl:attribute></xsl:if><xsl:if test="./*[name() = 'SubjectTypeFOPO']='Pr&#225;vnick&#225; osoba'"><xsl:attribute name="checked">checked</xsl:attribute></xsl:if></input><label for="SubjectTypeFOPOPostfixList1" class="optionLabel">Právnická osoba</label></span></div></fieldset><div class="clear" /></div><div id="layoutCell7529" class="cell "><xsl:for-each select="./egonp:RecipientFO"><div id="layoutRow5026" class="layoutRow ui-tabs ui-widget-content   bezOkrajaBezPozadiaHlavicky dolava8px nocaption " title=""><input type="hidden" name="RecipientFO" /><div id="layoutRowContentlayoutRow5026" class="columns"><div id="layoutColumn5476" class="column first"><div id="layoutCell7543" class="cell "><xsl:for-each select="./egonp:SecRecipientNameFO"><div id="layoutRow5029" class="layoutRow ui-tabs ui-widget-content   bezOkrajaBezPozadiaHlavicky dolava8px nocaption " title=""><input type="hidden" name="SecRecipientNameFO" /><div id="layoutRowContentlayoutRow5029" class="columns"><div id="layoutColumn5483" class="column first" style="width:180px;"><div id="layoutCell7546" class="cell "><label class="fieldLabel" title="" for="RecipientAfixPrefixCodelistCode" style="display: none">RecipientAfixPrefixCodelistCode </label><span class="fieldContent" style="display: none"><input id="RecipientAfixPrefixCodelistCode" name="RecipientAfixPrefixCodelistCode" title="" type="text" class="xsd_string textBox " maxlength="128" size="190" disabled="disabled" readonly="readonly" alt="" value="CL000062"><xsl:if test="boolean(./*[name() = 'RecipientAfixPrefixCodelistCode']/@isReadOnly = 'true')"><xsl:attribute name="readonly">readonly</xsl:attribute><xsl:attribute name="disabled">disabled</xsl:attribute></xsl:if><xsl:if test="./*[name() = 'RecipientAfixPrefixCodelistCode']"><xsl:attribute name="value"><xsl:value-of select="./*[name() = 'RecipientAfixPrefixCodelistCode']" /></xsl:attribute></xsl:if></input></span><div class="clear" /></div><div id="layoutCell7544" class="cell  TextArea50x24pxNEW"><label class="fieldLabel" title="" for="RecipientAfixPrefixItemName"><xsl:text disable-output-escaping="yes">Titul pred </xsl:text></label><div class="fieldContent"><input id="RecipientAfixPrefixItemName" type="text" value="" alt="" name="RecipientAfixPrefixItemName" class="xsd_string remoteLookup  textBox turned" title=""><xsl:if test="boolean(./*[name() = 'RecipientAfixPrefixItemName']/@isReadOnly = 'true')"><xsl:attribute name="readonly">readonly</xsl:attribute><xsl:attribute name="disabled">disabled</xsl:attribute></xsl:if><xsl:if test="./*[name() = 'RecipientAfixPrefixItemName']"><xsl:attribute name="value"><xsl:value-of select="./*[name() = 'RecipientAfixPrefixItemName']" /></xsl:attribute></xsl:if></input><span class="lookupConfiguration" style="display: none;"><span class="lookupComponentId">RecipientAfixPrefixItemName</span><span class="fieldId">RecipientAfixPrefixItemCode</span><span class="remoteSourceIdentifier" /><span class="remoteLookupCode">SUSR_0062</span><span class="fieldId">ServiceID</span></span><div class="info"><div class="dialog-modal" title="Nápoveda"><p><style type="text/css">
																																	p { margin-top: 0px;margin-bottom: 12px;line-height: 1.15; }
																																	body { font-family: 'Verdana';font-size: 16px; }
																																	.p_6AAD5060 { margin-top: 0px;margin-bottom: 12px;line-height: 1.15; }
																																	.s_A4F101E { font-family: 'Arial';font-size: 14.67px;color: #00B050; }
																																	.s_A0B393FA { font-family: 'Times New Roman';font-size: 16px;color: #00B050; } </style><p class="p_6AAD5060"><span class="s_A4F101E">Zvoľte „Vybrať“, vpíšte konkrétny titul udelený adresátovi pred menom (príklad: Bc., Mgr., Ing., MUDr., JUDr.), kliknite na „Hľadať“, vyberte hodnotu z číselníka a prejdite na „OK“. </span><span class="s_A0B393FA" /></p></p></div></div><input class="LookupDetailInfo" type="hidden" /><span class="lookupbutton ui-button ui-widget ui-state-default ui-corner-all ui-button-text-only">Vybrať</span><div title="Info" class="LookupDetail"><div class="LookupDetailInfoText" /><span class="lookupConfiguration" style="display: none;"><span class="lookupComponentId">RecipientAfixPrefixItemName</span><span class="fieldId">RecipientAfixPrefixItemCode</span><span class="remoteSourceIdentifier" /><span class="remoteLookupCode">SUSR_0062</span><span class="fieldId">ServiceID</span></span></div><div title="Vyberte hodnotu" class="LookupForm" style="display: none;"><span class="lookupConfiguration" style="display: none;"><span class="lookupComponentId">RecipientAfixPrefixItemName</span><span class="fieldId">RecipientAfixPrefixItemCode</span><span class="remoteSourceIdentifier" /><span class="remoteLookupCode">SUSR_0062</span><span class="fieldId">ServiceID</span></span><div class="tableFilter">
																															Zadajte text:
																															<input class="tableFilterText ui-corner-all" type="text" /><input class="FilterButton ui-button ui-widget ui-state-default ui-corner-all" type="button" value="Hľadať" alt="Hľadať" />
																															Ignorovať diakritiku a veľké písmená
																															<input class="tableFilterIgnoreCaseSensitive" type="checkbox" title="Ignorovať diakritiku a veľké písmená" /></div><table cellpadding="0" cellspacing="0" border="0" class="display LookupTable"><thead><tr><th>Kód</th><th>Hodnota</th></tr></thead><tbody><tr><th /><th /></tr></tbody></table></div></div><span class="fieldInfo"><span class="infoIcon ui-icon ui-icon-info" /></span><div class="clear" /></div><div id="layoutCell7545" class="cell "><label class="fieldLabel" title="" for="RecipientAfixPrefixItemCode" style="display: none">Titul pred ItemCode </label><span class="fieldContent" style="display: none"><input id="RecipientAfixPrefixItemCode" name="RecipientAfixPrefixItemCode" title="" type="text" class="xsd_string textBox " maxlength="256" size="190" alt="" value=""><xsl:if test="boolean(./*[name() = 'RecipientAfixPrefixItemCode']/@isReadOnly = 'true')"><xsl:attribute name="readonly">readonly</xsl:attribute><xsl:attribute name="disabled">disabled</xsl:attribute></xsl:if><xsl:if test="./*[name() = 'RecipientAfixPrefixItemCode']"><xsl:attribute name="value"><xsl:value-of select="./*[name() = 'RecipientAfixPrefixItemCode']" /></xsl:attribute></xsl:if></input></span><div class="clear" /></div></div><div id="layoutColumn5484" class="column " style="width:260px;"><div id="layoutCell7547" class="cell  TextArea190x24pxNEW"><label class="fieldLabel" title="" for="RecipientGivenName"><xsl:text disable-output-escaping="yes">Meno </xsl:text><em>*</em></label><span class="fieldContent"><input id="RecipientGivenName" name="RecipientGivenName" title="" type="text" class="xsd_string textBox " maxlength="255" size="190" alt="" value=""><xsl:if test="boolean(./*[name() = 'RecipientGivenName']/@isReadOnly = 'true')"><xsl:attribute name="readonly">readonly</xsl:attribute><xsl:attribute name="disabled">disabled</xsl:attribute></xsl:if><xsl:if test="./*[name() = 'RecipientGivenName']"><xsl:attribute name="value"><xsl:value-of select="./*[name() = 'RecipientGivenName']" /></xsl:attribute></xsl:if></input><div class="info"><div class="dialog-modal" title="Nápoveda"><p><style type="text/css">
																																	p { margin-top: 0px;margin-bottom: 12px;line-height: 1.15; }
																																	body { font-family: 'Verdana';font-size: 16px; }
																																	.p_6AAD5060 { margin-top: 0px;margin-bottom: 12px;line-height: 1.15; }
																																	.s_A4F101E { font-family: 'Arial';font-size: 14.67px;color: #00B050; }
																																	.s_A0B393FA { font-family: 'Times New Roman';font-size: 16px;color: #00B050; } </style><p class="p_6AAD5060"><span class="s_A4F101E">Uveďte krstné meno adresáta. </span><span class="s_A0B393FA" /></p></p></div></div></span><div class="clear" /></div></div><div id="layoutColumn5486" class="column " style="width:260px;"><div id="layoutCell7551" class="cell  TextArea190x24pxNEW"><label class="fieldLabel" title="" for="RecipientFamilyName"><xsl:text disable-output-escaping="yes">Priezvisko </xsl:text><em>*</em></label><span class="fieldContent"><input id="RecipientFamilyName" name="RecipientFamilyName" title="" type="text" class="xsd_string textBox " maxlength="255" size="190" alt="" value=""><xsl:if test="boolean(./*[name() = 'RecipientFamilyName']/@isReadOnly = 'true')"><xsl:attribute name="readonly">readonly</xsl:attribute><xsl:attribute name="disabled">disabled</xsl:attribute></xsl:if><xsl:if test="./*[name() = 'RecipientFamilyName']"><xsl:attribute name="value"><xsl:value-of select="./*[name() = 'RecipientFamilyName']" /></xsl:attribute></xsl:if></input><div class="info"><div class="dialog-modal" title="Nápoveda"><p><style type="text/css">
																																	p { margin-top: 0px;margin-bottom: 12px;line-height: 1.15; }
																																	body { font-family: 'Verdana';font-size: 16px; }
																																	.p_6AAD5060 { margin-top: 0px;margin-bottom: 12px;line-height: 1.15; }
																																	.s_A4F101E { font-family: 'Arial';font-size: 14.67px;color: #00B050; }
																																	.s_A0B393FA { font-family: 'Times New Roman';font-size: 16px;color: #00B050; } </style><p class="p_6AAD5060"><span class="s_A4F101E">Uveďte priezvisko adresáta. </span><span class="s_A0B393FA" /></p></p></div></div></span><div class="clear" /></div></div><div id="layoutColumn5485" class="column " style="width:160px;"><div id="layoutCell7550" class="cell "><label class="fieldLabel" title="" for="RecipientAfixPostfixCodelistCode" style="display: none">RecipientAfixPostfixCodelistCode </label><span class="fieldContent" style="display: none"><input id="RecipientAfixPostfixCodelistCode" name="RecipientAfixPostfixCodelistCode" title="" type="text" class="xsd_string textBox " maxlength="128" size="190" disabled="disabled" readonly="readonly" alt="" value="CL000063"><xsl:if test="boolean(./*[name() = 'RecipientAfixPostfixCodelistCode']/@isReadOnly = 'true')"><xsl:attribute name="readonly">readonly</xsl:attribute><xsl:attribute name="disabled">disabled</xsl:attribute></xsl:if><xsl:if test="./*[name() = 'RecipientAfixPostfixCodelistCode']"><xsl:attribute name="value"><xsl:value-of select="./*[name() = 'RecipientAfixPostfixCodelistCode']" /></xsl:attribute></xsl:if></input></span><div class="clear" /></div><div id="layoutCell7548" class="cell  TextArea50x24pxNEW"><label class="fieldLabel" title="" for="RecipientAfixPostfixItemName"><xsl:text disable-output-escaping="yes">Titul za </xsl:text></label><div class="fieldContent"><input id="RecipientAfixPostfixItemName" type="text" value="" alt="" name="RecipientAfixPostfixItemName" class="xsd_string remoteLookup  textBox turned" title=""><xsl:if test="boolean(./*[name() = 'RecipientAfixPostfixItemName']/@isReadOnly = 'true')"><xsl:attribute name="readonly">readonly</xsl:attribute><xsl:attribute name="disabled">disabled</xsl:attribute></xsl:if><xsl:if test="./*[name() = 'RecipientAfixPostfixItemName']"><xsl:attribute name="value"><xsl:value-of select="./*[name() = 'RecipientAfixPostfixItemName']" /></xsl:attribute></xsl:if></input><span class="lookupConfiguration" style="display: none;"><span class="lookupComponentId">RecipientAfixPostfixItemName</span><span class="fieldId">RecipientAfixPostfixItemCode</span><span class="remoteSourceIdentifier" /><span class="remoteLookupCode">SUSR_0063</span><span class="fieldId">ServiceID</span></span><div class="info"><div class="dialog-modal" title="Nápoveda"><p><style type="text/css">
																																	p { margin-top: 0px;margin-bottom: 12px;line-height: 1.15; }
																																	body { font-family: 'Verdana';font-size: 16px; }
																																	.p_6AAD5060 { margin-top: 0px;margin-bottom: 12px;line-height: 1.15; }
																																	.s_A4F101E { font-family: 'Arial';font-size: 14.67px;color: #00B050; }
																																	.s_A0B393FA { font-family: 'Times New Roman';font-size: 16px;color: #00B050; } </style><p class="p_6AAD5060"><span class="s_A4F101E">Zvoľte „Vybrať“, vpíšte konkrétny titul uvedený adresátovi za priezviskom (príklad: PhD., CSc., DrSc.), kliknite na „Hľadať“, vyberte hodnotu z číselníka a prejdite na „OK“. </span><span class="s_A0B393FA" /></p></p></div></div><input class="LookupDetailInfo" type="hidden" /><span class="lookupbutton ui-button ui-widget ui-state-default ui-corner-all ui-button-text-only">Vybrať</span><div title="Info" class="LookupDetail"><div class="LookupDetailInfoText" /><span class="lookupConfiguration" style="display: none;"><span class="lookupComponentId">RecipientAfixPostfixItemName</span><span class="fieldId">RecipientAfixPostfixItemCode</span><span class="remoteSourceIdentifier" /><span class="remoteLookupCode">SUSR_0063</span><span class="fieldId">ServiceID</span></span></div><div title="Vyberte hodnotu" class="LookupForm" style="display: none;"><span class="lookupConfiguration" style="display: none;"><span class="lookupComponentId">RecipientAfixPostfixItemName</span><span class="fieldId">RecipientAfixPostfixItemCode</span><span class="remoteSourceIdentifier" /><span class="remoteLookupCode">SUSR_0063</span><span class="fieldId">ServiceID</span></span><div class="tableFilter">
																															Zadajte text:
																															<input class="tableFilterText ui-corner-all" type="text" /><input class="FilterButton ui-button ui-widget ui-state-default ui-corner-all" type="button" value="Hľadať" alt="Hľadať" />
																															Ignorovať diakritiku a veľké písmená
																															<input class="tableFilterIgnoreCaseSensitive" type="checkbox" title="Ignorovať diakritiku a veľké písmená" /></div><table cellpadding="0" cellspacing="0" border="0" class="display LookupTable"><thead><tr><th>Kód</th><th>Hodnota</th></tr></thead><tbody><tr><th /><th /></tr></tbody></table></div></div><span class="fieldInfo"><span class="infoIcon ui-icon ui-icon-info" /></span><div class="clear" /></div><div id="layoutCell7549" class="cell "><label class="fieldLabel" title="" for="RecipientAfixPostfixItemCode" style="display: none">Titul za ItemCode </label><span class="fieldContent" style="display: none"><input id="RecipientAfixPostfixItemCode" name="RecipientAfixPostfixItemCode" title="" type="text" class="xsd_string textBox " maxlength="256" size="190" alt="" value=""><xsl:if test="boolean(./*[name() = 'RecipientAfixPostfixItemCode']/@isReadOnly = 'true')"><xsl:attribute name="readonly">readonly</xsl:attribute><xsl:attribute name="disabled">disabled</xsl:attribute></xsl:if><xsl:if test="./*[name() = 'RecipientAfixPostfixItemCode']"><xsl:attribute name="value"><xsl:value-of select="./*[name() = 'RecipientAfixPostfixItemCode']" /></xsl:attribute></xsl:if></input></span><div class="clear" /></div></div><div class="clear" /></div></div></xsl:for-each><div class="clear" /></div><div id="layoutCell7530" class="cell "><xsl:for-each select="./egonp:SecRecipientAdressStreetAndNumberFO"><div id="layoutRow5027" class="layoutRow ui-tabs ui-widget-content   bezOkrajaBezPozadiaHlavicky dolava8px nocaption " title=""><input type="hidden" name="SecRecipientAdressStreetAndNumberFO" /><div id="layoutRowContentlayoutRow5027" class="columns"><div id="layoutColumn5477" class="column first" style="width:440px;"><div id="layoutCell7531" class="cell  TextArea320x24pxNEW"><label class="fieldLabel" title="" for="RecipientStreetName"><xsl:text disable-output-escaping="yes">Ulica </xsl:text></label><span class="fieldContent"><input id="RecipientStreetName" name="RecipientStreetName" title="" type="text" class="xsd_string textBox " maxlength="100" size="190" alt="" value=""><xsl:if test="boolean(./*[name() = 'RecipientStreetName']/@isReadOnly = 'true')"><xsl:attribute name="readonly">readonly</xsl:attribute><xsl:attribute name="disabled">disabled</xsl:attribute></xsl:if><xsl:if test="./*[name() = 'RecipientStreetName']"><xsl:attribute name="value"><xsl:value-of select="./*[name() = 'RecipientStreetName']" /></xsl:attribute></xsl:if></input><div class="info"><div class="dialog-modal" title="Nápoveda"><p><style type="text/css">
																																	p { margin-top: 0px;margin-bottom: 12px;line-height: 1.15; }
																																	body { font-family: 'Verdana';font-size: 16px; }
																																	.p_6AAD5060 { margin-top: 0px;margin-bottom: 12px;line-height: 1.15; }
																																	.s_A4F101E { font-family: 'Arial';font-size: 14.67px;color: #00B050; }
																																	.s_A0B393FA { font-family: 'Times New Roman';font-size: 16px;color: #00B050; } </style><p class="p_6AAD5060"><span class="s_A4F101E">Uveďte názov ulice, kde má adresát trvalý/prechodný pobyt. </span><span class="s_A0B393FA" /></p></p></div></div></span><div class="clear" /></div></div><div id="layoutColumn5478" class="column " style="width:220px;"><div id="layoutCell7532" class="cell  TextArea150x24pxNEW"><label class="fieldLabel" title="" for="RecipientPropertyRegistrationNumber"><xsl:text disable-output-escaping="yes">Súpisné číslo </xsl:text></label><span class="fieldContent"><input id="RecipientPropertyRegistrationNumber" name="RecipientPropertyRegistrationNumber" title="" type="text" class="xsd_string textBox " maxlength="10" size="190" alt="" value=""><xsl:if test="boolean(./*[name() = 'RecipientPropertyRegistrationNumber']/@isReadOnly = 'true')"><xsl:attribute name="readonly">readonly</xsl:attribute><xsl:attribute name="disabled">disabled</xsl:attribute></xsl:if><xsl:if test="./*[name() = 'RecipientPropertyRegistrationNumber']"><xsl:attribute name="value"><xsl:value-of select="./*[name() = 'RecipientPropertyRegistrationNumber']" /></xsl:attribute></xsl:if></input><div class="info"><div class="dialog-modal" title="Nápoveda"><p><style type="text/css">
																																	p { margin-top: 0px;margin-bottom: 12px;line-height: 1.15; }
																																	body { font-family: 'Verdana';font-size: 16px; }
																																	.p_6AAD5060 { margin-top: 0px;margin-bottom: 12px;line-height: 1.15; }
																																	.s_A0B393FA { font-family: 'Times New Roman';font-size: 16px;color: #00B050; }
																																	.s_489786FB { font-family: 'Times New Roman';font-size: 16px; }
																																	.s_D3FCB7B8 { font-family: 'Verdana';font-size: 16px; } </style><p class="p_6AAD5060"><span class="s_A0B393FA">Môžete uviesť</span><span class="s_489786FB" /><span class="s_A0B393FA">unikátne číslo pridelené budove v rámci katastrálneho územia. </span><span class="s_D3FCB7B8" /></p></p></div></div></span><div class="clear" /></div></div><div id="layoutColumn5479" class="column " style="width:190px;"><div id="layoutCell7533" class="cell  TextArea150x24pxNEW"><label class="fieldLabel" title="" for="RecipientBuildingNumber"><xsl:text disable-output-escaping="yes">Orientačné číslo </xsl:text></label><span class="fieldContent"><input id="RecipientBuildingNumber" name="RecipientBuildingNumber" title="" type="text" class="xsd_string textBox " maxlength="20" size="190" alt="" value=""><xsl:if test="boolean(./*[name() = 'RecipientBuildingNumber']/@isReadOnly = 'true')"><xsl:attribute name="readonly">readonly</xsl:attribute><xsl:attribute name="disabled">disabled</xsl:attribute></xsl:if><xsl:if test="./*[name() = 'RecipientBuildingNumber']"><xsl:attribute name="value"><xsl:value-of select="./*[name() = 'RecipientBuildingNumber']" /></xsl:attribute></xsl:if></input><div class="info"><div class="dialog-modal" title="Nápoveda"><p><style type="text/css">
																																	p { margin-top: 0px;margin-bottom: 12px;line-height: 1.15; }
																																	body { font-family: 'Verdana';font-size: 16px; }
																																	.p_6AAD5060 { margin-top: 0px;margin-bottom: 12px;line-height: 1.15; }
																																	.s_A4F101E { font-family: 'Arial';font-size: 14.67px;color: #00B050; }
																																	.s_A8B3B40B { font-family: 'Arial';font-size: 14.67px; }
																																	.s_A0B393FA { font-family: 'Times New Roman';font-size: 16px;color: #00B050; } </style><p class="p_6AAD5060"><span class="s_A4F101E">Uveďte</span><span class="s_A8B3B40B" /><span class="s_A4F101E">unikátne číslo pridelené budove v rámci ulice. </span><span class="s_A0B393FA" /></p></p></div></div></span><div class="clear" /></div></div><div class="clear" /></div></div></xsl:for-each><div class="clear" /></div><div id="layoutCell7534" class="cell "><xsl:for-each select="./egonp:SecRecipientPostalCodeMunicipalityCountryFO"><div id="layoutRow5028" class="layoutRow ui-tabs ui-widget-content   bezOkrajaBezPozadiaHlavicky dolava8px nocaption " title=""><input type="hidden" name="SecRecipientPostalCodeMunicipalityCountryFO" /><div id="layoutRowContentlayoutRow5028" class="columns"><div id="layoutColumn5481" class="column first" style="width:220px;"><div id="layoutCell7539" class="cell  TextArea150x24pxNEW"><label class="fieldLabel" title="" for="RecipientPostalCode"><xsl:text disable-output-escaping="yes">PSČ </xsl:text><em>*</em></label><span class="fieldContent"><input id="RecipientPostalCode" name="RecipientPostalCode" title="" type="text" class="xsd_string textBox " maxlength="12" size="190" alt="" value=""><xsl:if test="boolean(./*[name() = 'RecipientPostalCode']/@isReadOnly = 'true')"><xsl:attribute name="readonly">readonly</xsl:attribute><xsl:attribute name="disabled">disabled</xsl:attribute></xsl:if><xsl:if test="./*[name() = 'RecipientPostalCode']"><xsl:attribute name="value"><xsl:value-of select="./*[name() = 'RecipientPostalCode']" /></xsl:attribute></xsl:if></input><div class="info"><div class="dialog-modal" title="Nápoveda"><p><style type="text/css">
																																	p { margin-top: 0px;margin-bottom: 12px;line-height: 1.15; }
																																	body { font-family: 'Verdana';font-size: 16px; }
																																	.p_6AAD5060 { margin-top: 0px;margin-bottom: 12px;line-height: 1.15; }
																																	.s_A4F101E { font-family: 'Arial';font-size: 14.67px;color: #00B050; }
																																	.s_A0B393FA { font-family: 'Times New Roman';font-size: 16px;color: #00B050; } </style><p class="p_6AAD5060"><span class="s_A4F101E">Uveďte poštové smerovacie číslo obce/mesta bez medzier. </span><span class="s_A0B393FA" /></p></p></div></div></span><div class="clear" /></div></div><div id="layoutColumn5480" class="column " style="width:360px;"><div id="layoutCell7535" class="cell  TextArea300x24pxNEW"><label class="fieldLabel" title="" for="RecipientMunicipalityNonCodelistData"><xsl:text disable-output-escaping="yes">Mesto </xsl:text><em>*</em></label><span class="fieldContent"><input id="RecipientMunicipalityNonCodelistData" name="RecipientMunicipalityNonCodelistData" title="" type="text" class="xsd_string textBox " maxlength="128" size="190" alt="" value=""><xsl:if test="boolean(./*[name() = 'RecipientMunicipalityNonCodelistData']/@isReadOnly = 'true')"><xsl:attribute name="readonly">readonly</xsl:attribute><xsl:attribute name="disabled">disabled</xsl:attribute></xsl:if><xsl:if test="./*[name() = 'RecipientMunicipalityNonCodelistData']"><xsl:attribute name="value"><xsl:value-of select="./*[name() = 'RecipientMunicipalityNonCodelistData']" /></xsl:attribute></xsl:if></input><div class="info"><div class="dialog-modal" title="Nápoveda"><p><style type="text/css">
																																	p { margin-top: 0px;margin-bottom: 12px;line-height: 1.15; }
																																	body { font-family: 'Verdana';font-size: 16px; }
																																	.p_6AAD5060 { margin-top: 0px;margin-bottom: 12px;line-height: 1.15; }
																																	.s_A4F101E { font-family: 'Arial';font-size: 14.67px;color: #00B050; }
																																	.s_A0B393FA { font-family: 'Times New Roman';font-size: 16px;color: #00B050; } </style><p class="p_6AAD5060"><span class="s_A4F101E">Uveďte názov obce/mesta. </span><span class="s_A0B393FA" /></p></p></div></div></span><div class="clear" /></div><div id="layoutCell7538" class="cell "><label class="fieldLabel" title="" for="RecipientMunicipalityCodelistCode" style="display: none">RecipientMunicipalityCodelistCode </label><span class="fieldContent" style="display: none"><input id="RecipientMunicipalityCodelistCode" name="RecipientMunicipalityCodelistCode" title="" type="text" class="xsd_string textBox " maxlength="100" size="190" alt="" value="CL000025"><xsl:if test="boolean(./*[name() = 'RecipientMunicipalityCodelistCode']/@isReadOnly = 'true')"><xsl:attribute name="readonly">readonly</xsl:attribute><xsl:attribute name="disabled">disabled</xsl:attribute></xsl:if><xsl:if test="./*[name() = 'RecipientMunicipalityCodelistCode']"><xsl:attribute name="value"><xsl:value-of select="./*[name() = 'RecipientMunicipalityCodelistCode']" /></xsl:attribute></xsl:if></input></span><div class="clear" /></div><div id="layoutCell7536" class="cell "><label class="fieldLabel" title="" for="RecipientMunicipalityItemCode" style="display: none">RecipientMunicipalityItemCode </label><span class="fieldContent" style="display: none"><input id="RecipientMunicipalityItemCode" name="RecipientMunicipalityItemCode" title="" type="text" class="xsd_string textBox " maxlength="128" size="190" alt="" value=""><xsl:if test="boolean(./*[name() = 'RecipientMunicipalityItemCode']/@isReadOnly = 'true')"><xsl:attribute name="readonly">readonly</xsl:attribute><xsl:attribute name="disabled">disabled</xsl:attribute></xsl:if><xsl:if test="./*[name() = 'RecipientMunicipalityItemCode']"><xsl:attribute name="value"><xsl:value-of select="./*[name() = 'RecipientMunicipalityItemCode']" /></xsl:attribute></xsl:if></input></span><div class="clear" /></div><div id="layoutCell7537" class="cell "><label class="fieldLabel" title="" for="RecipientMunicipalityItemName" style="display: none">RecipientMunicipalityItemName </label><span class="fieldContent" style="display: none"><input id="RecipientMunicipalityItemName" name="RecipientMunicipalityItemName" title="" type="text" class="xsd_string textBox " maxlength="128" size="190" alt="" value=""><xsl:if test="boolean(./*[name() = 'RecipientMunicipalityItemName']/@isReadOnly = 'true')"><xsl:attribute name="readonly">readonly</xsl:attribute><xsl:attribute name="disabled">disabled</xsl:attribute></xsl:if><xsl:if test="./*[name() = 'RecipientMunicipalityItemName']"><xsl:attribute name="value"><xsl:value-of select="./*[name() = 'RecipientMunicipalityItemName']" /></xsl:attribute></xsl:if></input></span><div class="clear" /></div></div><div id="layoutColumn5482" class="column " style="width:270px;"><div id="layoutCell7540" class="cell  TextArea150x24pxNEW"><label class="fieldLabel" title="" for="RecipientPostalCountryItemName"><xsl:text disable-output-escaping="yes">Štát </xsl:text><em>*</em></label><div class="fieldContent"><input id="RecipientPostalCountryItemName" type="text" value="" alt="" name="RecipientPostalCountryItemName" class="xsd_string remoteLookup RecipientPostalCountryItemName_internal textBox turned" title=""><xsl:if test="boolean(./*[name() = 'RecipientPostalCountryItemName']/@isReadOnly = 'true')"><xsl:attribute name="readonly">readonly</xsl:attribute><xsl:attribute name="disabled">disabled</xsl:attribute></xsl:if><xsl:if test="./*[name() = 'RecipientPostalCountryItemName']"><xsl:attribute name="value"><xsl:value-of select="./*[name() = 'RecipientPostalCountryItemName']" /></xsl:attribute></xsl:if></input><span class="lookupConfiguration" style="display: none;"><span class="lookupComponentId">RecipientPostalCountryItemName</span><span class="fieldId">RecipientPostalCountryItemCode</span><span class="remoteSourceIdentifier" /><span class="remoteLookupCode">SUSR_0086</span><span class="fieldId">ServiceID</span></span><div class="info"><div class="dialog-modal" title="Nápoveda"><p><style type="text/css">
																																	p { margin-top: 0px;margin-bottom: 12px;line-height: 1.15; }
																																	body { font-family: 'Verdana';font-size: 16px; }
																																	.p_6AAD5060 { margin-top: 0px;margin-bottom: 12px;line-height: 1.15; }
																																	.s_A4F101E { font-family: 'Arial';font-size: 14.67px;color: #00B050; }
																																	.s_A0B393FA { font-family: 'Times New Roman';font-size: 16px;color: #00B050; } </style><p class="p_6AAD5060"><span class="s_A4F101E">Zvoľte „Vybrať“, vpíšte presný názov štátu (príklad: Slovenská republika), kliknite na „Hľadať“, vyberte hodnotu z číselníka a prejdite na „OK“. </span><span class="s_A0B393FA" /></p></p></div></div><input class="LookupDetailInfo" type="hidden" /><span class="lookupbutton ui-button ui-widget ui-state-default ui-corner-all ui-button-text-only">Vybrať</span><div title="Info" class="LookupDetail"><div class="LookupDetailInfoText" /><span class="lookupConfiguration" style="display: none;"><span class="lookupComponentId">RecipientPostalCountryItemName</span><span class="fieldId">RecipientPostalCountryItemCode</span><span class="remoteSourceIdentifier" /><span class="remoteLookupCode">SUSR_0086</span><span class="fieldId">ServiceID</span></span></div><div title="Vyberte hodnotu" class="LookupForm" style="display: none;"><span class="lookupConfiguration" style="display: none;"><span class="lookupComponentId">RecipientPostalCountryItemName</span><span class="fieldId">RecipientPostalCountryItemCode</span><span class="remoteSourceIdentifier" /><span class="remoteLookupCode">SUSR_0086</span><span class="fieldId">ServiceID</span></span><div class="tableFilter">
																															Zadajte text:
																															<input class="tableFilterText ui-corner-all" type="text" /><input class="FilterButton ui-button ui-widget ui-state-default ui-corner-all" type="button" value="Hľadať" alt="Hľadať" />
																															Ignorovať diakritiku a veľké písmená
																															<input class="tableFilterIgnoreCaseSensitive" type="checkbox" title="Ignorovať diakritiku a veľké písmená" /></div><table cellpadding="0" cellspacing="0" border="0" class="display LookupTable"><thead><tr><th>Kód</th><th>Hodnota</th></tr></thead><tbody><tr><th /><th /></tr></tbody></table></div></div><span class="fieldInfo"><span class="infoIcon ui-icon ui-icon-info" /></span><div class="clear" /></div><div id="layoutCell7541" class="cell "><label class="fieldLabel" title="" for="RecipientPostalCountryItemCode" style="display: none">Štát ItemCode </label><span class="fieldContent" style="display: none"><input id="RecipientPostalCountryItemCode" name="RecipientPostalCountryItemCode" title="" type="text" class="xsd_string textBox " maxlength="255" size="190" alt="" value=""><xsl:if test="boolean(./*[name() = 'RecipientPostalCountryItemCode']/@isReadOnly = 'true')"><xsl:attribute name="readonly">readonly</xsl:attribute><xsl:attribute name="disabled">disabled</xsl:attribute></xsl:if><xsl:if test="./*[name() = 'RecipientPostalCountryItemCode']"><xsl:attribute name="value"><xsl:value-of select="./*[name() = 'RecipientPostalCountryItemCode']" /></xsl:attribute></xsl:if></input></span><div class="clear" /></div><div id="layoutCell7542" class="cell "><label class="fieldLabel" title="" for="RecipientPostalCountryCodelistCode" style="display: none">RecipientPostalCountryCodelistCode </label><span class="fieldContent" style="display: none"><input id="RecipientPostalCountryCodelistCode" name="RecipientPostalCountryCodelistCode" title="" type="text" class="xsd_string textBox " maxlength="100" size="190" alt="" value="CL000086"><xsl:if test="boolean(./*[name() = 'RecipientPostalCountryCodelistCode']/@isReadOnly = 'true')"><xsl:attribute name="readonly">readonly</xsl:attribute><xsl:attribute name="disabled">disabled</xsl:attribute></xsl:if><xsl:if test="./*[name() = 'RecipientPostalCountryCodelistCode']"><xsl:attribute name="value"><xsl:value-of select="./*[name() = 'RecipientPostalCountryCodelistCode']" /></xsl:attribute></xsl:if></input></span><div class="clear" /></div></div><div class="clear" /></div></div></xsl:for-each><div class="clear" /></div></div><div class="clear" /></div></div></xsl:for-each><div class="clear" /></div><div id="layoutCell7552" class="cell "><xsl:for-each select="./egonp:RecipientPO"><div id="layoutRow5030" class="layoutRow ui-tabs ui-widget-content   bezOkrajaBezPozadiaHlavicky dolava8px nocaption " title=""><input type="hidden" name="RecipientPO" /><div id="layoutRowContentlayoutRow5030" class="columns"><div id="layoutColumn5487" class="column first"><div id="layoutCell7553" class="cell "><xsl:for-each select="./egonp:SecRecipientCorporateBodyFullNamePO"><div id="layoutRow5031" class="layoutRow ui-tabs ui-widget-content   bezOkrajaBezPozadiaHlavicky dolava8px nocaption " title=""><input type="hidden" name="SecRecipientCorporateBodyFullNamePO" /><div id="layoutRowContentlayoutRow5031" class="columns"><div id="layoutColumn5488" class="column first"><div id="layoutCell7554" class="cell  TextArea810x38px"><label class="fieldLabel" title="" for="RecipientCorporateBodyFullName"><xsl:text disable-output-escaping="yes">Názov </xsl:text><em>*</em></label><span class="fieldContent"><textarea id="RecipientCorporateBodyFullName" name="RecipientCorporateBodyFullName" title="" class="xsd_string textArea " maxlength="255" cols="100" rows="5"><xsl:if test="boolean(./*[name() = 'RecipientCorporateBodyFullName']/@isReadOnly = 'true')"><xsl:attribute name="readonly">readonly</xsl:attribute><xsl:attribute name="disabled">disabled</xsl:attribute></xsl:if><xsl:choose><xsl:when test="./*[name() = 'RecipientCorporateBodyFullName']"><xsl:value-of select="./*[name() = 'RecipientCorporateBodyFullName']" /></xsl:when><xsl:otherwise><xsl:text /></xsl:otherwise></xsl:choose></textarea><div class="info"><div class="dialog-modal" title="Nápoveda"><p><style type="text/css">
																																	p { margin-top: 0px;margin-bottom: 12px;line-height: 1.15; }
																																	body { font-family: 'Verdana';font-size: 16px; }
																																	.p_6AAD5060 { margin-top: 0px;margin-bottom: 12px;line-height: 1.15; }
																																	.s_A4F101E { font-family: 'Arial';font-size: 14.67px;color: #00B050; }
																																	.s_A0B393FA { font-family: 'Times New Roman';font-size: 16px;color: #00B050; } </style><p class="p_6AAD5060"><span class="s_A4F101E">Uveďte úplný a presný názov právnickej osoby tak, ako je uvedený v Obchodnom registri SR, prípadne v inej evidencii, ak sa právnická osoba nezapisuje do Obchodného registra SR. </span><span class="s_A0B393FA" /></p></p></div></div></span><div class="clear" /></div><div id="layoutCell7691" class="cell  TextArea810x38px"><label class="fieldLabel" title="" for="RecipientOrganizationUnit"><xsl:text disable-output-escaping="yes">Organizačná zložka </xsl:text></label><span class="fieldContent"><textarea id="RecipientOrganizationUnit" name="RecipientOrganizationUnit" title="" class="xsd_string textArea " maxlength="255" cols="100" rows="5"><xsl:if test="boolean(./*[name() = 'RecipientOrganizationUnit']/@isReadOnly = 'true')"><xsl:attribute name="readonly">readonly</xsl:attribute><xsl:attribute name="disabled">disabled</xsl:attribute></xsl:if><xsl:choose><xsl:when test="./*[name() = 'RecipientOrganizationUnit']"><xsl:value-of select="./*[name() = 'RecipientOrganizationUnit']" /></xsl:when><xsl:otherwise><xsl:text /></xsl:otherwise></xsl:choose></textarea><div class="info"><div class="dialog-modal" title="Nápoveda"><p><style type="text/css">
																																	p { margin-top: 0px;margin-bottom: 12px;line-height: 1.15; }
																																	body { font-family: 'Verdana';font-size: 16px; }
																																	.p_6AAD5060 { margin-top: 0px;margin-bottom: 12px;line-height: 1.15; }
																																	.s_C1A2E899 { font-family: 'Arial';font-size: 14.6666666666667px;color: #00B050; }
																																	.s_D3FCB7B8 { font-family: 'Verdana';font-size: 16px; } </style><p class="p_6AAD5060"><span class="s_C1A2E899">V prípade, že rozhodnutie vydáva konkrétna organizačná zložka, môžete uviesť jej úplný a presný názov. </span><span class="s_D3FCB7B8" /></p></p></div></div></span><div class="clear" /></div></div><div class="clear" /></div></div></xsl:for-each><div class="clear" /></div><div id="layoutCell7555" class="cell "><xsl:for-each select="./egonp:SecRecipientAdressStreetAndNumberPO"><div id="layoutRow5032" class="layoutRow ui-tabs ui-widget-content   bezOkrajaBezPozadiaHlavicky dolava8px nocaption " title=""><input type="hidden" name="SecRecipientAdressStreetAndNumberPO" /><div id="layoutRowContentlayoutRow5032" class="columns"><div id="layoutColumn5489" class="column first" style="width:440px;"><div id="layoutCell7556" class="cell  TextArea320x24pxNEW"><label class="fieldLabel" title="" for="RecipientStreetNamePO"><xsl:text disable-output-escaping="yes">Ulica </xsl:text></label><span class="fieldContent"><input id="RecipientStreetNamePO" name="RecipientStreetNamePO" title="" type="text" class="xsd_string textBox " maxlength="100" size="190" alt="" value=""><xsl:if test="boolean(./*[name() = 'RecipientStreetNamePO']/@isReadOnly = 'true')"><xsl:attribute name="readonly">readonly</xsl:attribute><xsl:attribute name="disabled">disabled</xsl:attribute></xsl:if><xsl:if test="./*[name() = 'RecipientStreetNamePO']"><xsl:attribute name="value"><xsl:value-of select="./*[name() = 'RecipientStreetNamePO']" /></xsl:attribute></xsl:if></input><div class="info"><div class="dialog-modal" title="Nápoveda"><p><style type="text/css">
																																	p { margin-top: 0px;margin-bottom: 12px;line-height: 1.15; }
																																	body { font-family: 'Verdana';font-size: 16px; }
																																	.p_6AAD5060 { margin-top: 0px;margin-bottom: 12px;line-height: 1.15; }
																																	.s_C1A2E899 { font-family: 'Arial';font-size: 14.6666666666667px;color: #00B050; }
																																	.s_D3FCB7B8 { font-family: 'Verdana';font-size: 16px; } </style><p class="p_6AAD5060"><span class="s_C1A2E899">Uveďte názov ulice, kde má právnická osoba sídlo. </span><span class="s_D3FCB7B8" /></p></p></div></div></span><div class="clear" /></div></div><div id="layoutColumn5490" class="column " style="width:220px;"><div id="layoutCell7557" class="cell  TextArea150x24pxNEW"><label class="fieldLabel" title="" for="RecipientPropertyRegistrationNumberPO"><xsl:text disable-output-escaping="yes">Súpisné číslo </xsl:text></label><span class="fieldContent"><input id="RecipientPropertyRegistrationNumberPO" name="RecipientPropertyRegistrationNumberPO" title="" type="text" class="xsd_string textBox " maxlength="10" size="190" alt="" value=""><xsl:if test="boolean(./*[name() = 'RecipientPropertyRegistrationNumberPO']/@isReadOnly = 'true')"><xsl:attribute name="readonly">readonly</xsl:attribute><xsl:attribute name="disabled">disabled</xsl:attribute></xsl:if><xsl:if test="./*[name() = 'RecipientPropertyRegistrationNumberPO']"><xsl:attribute name="value"><xsl:value-of select="./*[name() = 'RecipientPropertyRegistrationNumberPO']" /></xsl:attribute></xsl:if></input><div class="info"><div class="dialog-modal" title="Nápoveda"><p><style type="text/css">
																																	p { margin-top: 0px;margin-bottom: 12px;line-height: 1.15; }
																																	body { font-family: 'Verdana';font-size: 16px; }
																																	.p_6AAD5060 { margin-top: 0px;margin-bottom: 12px;line-height: 1.15; }
																																	.s_C1A2E899 { font-family: 'Arial';font-size: 14.6666666666667px;color: #00B050; }
																																	.s_D3FCB7B8 { font-family: 'Verdana';font-size: 16px; } </style><p class="p_6AAD5060"><span class="s_C1A2E899">Môžete uviesť unikátne číslo pridelené budove v rámci katastrálneho územia. </span><span class="s_D3FCB7B8" /></p></p></div></div></span><div class="clear" /></div></div><div id="layoutColumn5491" class="column " style="width:190px;"><div id="layoutCell7558" class="cell  TextArea150x24pxNEW"><label class="fieldLabel" title="" for="RecipientBuildingNumberPO"><xsl:text disable-output-escaping="yes">Orientačné číslo </xsl:text></label><span class="fieldContent"><input id="RecipientBuildingNumberPO" name="RecipientBuildingNumberPO" title="" type="text" class="xsd_string textBox " maxlength="20" size="190" alt="" value=""><xsl:if test="boolean(./*[name() = 'RecipientBuildingNumberPO']/@isReadOnly = 'true')"><xsl:attribute name="readonly">readonly</xsl:attribute><xsl:attribute name="disabled">disabled</xsl:attribute></xsl:if><xsl:if test="./*[name() = 'RecipientBuildingNumberPO']"><xsl:attribute name="value"><xsl:value-of select="./*[name() = 'RecipientBuildingNumberPO']" /></xsl:attribute></xsl:if></input><div class="info"><div class="dialog-modal" title="Nápoveda"><p><style type="text/css">
																																	p { margin-top: 0px;margin-bottom: 12px;line-height: 1.15; }
																																	body { font-family: 'Verdana';font-size: 16px; }
																																	.p_6AAD5060 { margin-top: 0px;margin-bottom: 12px;line-height: 1.15; }
																																	.s_A4F101E { font-family: 'Arial';font-size: 14.67px;color: #00B050; }
																																	.s_A8B3B40B { font-family: 'Arial';font-size: 14.67px; }
																																	.s_A0B393FA { font-family: 'Times New Roman';font-size: 16px;color: #00B050; } </style><p class="p_6AAD5060"><span class="s_A4F101E">Uveďte</span><span class="s_A8B3B40B" /><span class="s_A4F101E">unikátne číslo pridelené budove v rámci ulice. </span><span class="s_A0B393FA" /></p></p></div></div></span><div class="clear" /></div></div><div class="clear" /></div></div></xsl:for-each><div class="clear" /></div><div id="layoutCell7559" class="cell "><xsl:for-each select="./egonp:SecRecipientPostalCodeMunicipalityCountryPO"><div id="layoutRow5033" class="layoutRow ui-tabs ui-widget-content   bezOkrajaBezPozadiaHlavicky dolava8px nocaption " title=""><input type="hidden" name="SecRecipientPostalCodeMunicipalityCountryPO" /><div id="layoutRowContentlayoutRow5033" class="columns"><div id="layoutColumn5493" class="column first" style="width:220px;"><div id="layoutCell7564" class="cell  TextArea150x24pxNEW"><label class="fieldLabel" title="" for="RecipientPostalCodePO"><xsl:text disable-output-escaping="yes">PSČ </xsl:text><em>*</em></label><span class="fieldContent"><input id="RecipientPostalCodePO" name="RecipientPostalCodePO" title="" type="text" class="xsd_string textBox " maxlength="12" size="190" alt="" value=""><xsl:if test="boolean(./*[name() = 'RecipientPostalCodePO']/@isReadOnly = 'true')"><xsl:attribute name="readonly">readonly</xsl:attribute><xsl:attribute name="disabled">disabled</xsl:attribute></xsl:if><xsl:if test="./*[name() = 'RecipientPostalCodePO']"><xsl:attribute name="value"><xsl:value-of select="./*[name() = 'RecipientPostalCodePO']" /></xsl:attribute></xsl:if></input><div class="info"><div class="dialog-modal" title="Nápoveda"><p><style type="text/css">
																																	p { margin-top: 0px;margin-bottom: 12px;line-height: 1.15; }
																																	body { font-family: 'Verdana';font-size: 16px; }
																																	.p_6AAD5060 { margin-top: 0px;margin-bottom: 12px;line-height: 1.15; }
																																	.s_A4F101E { font-family: 'Arial';font-size: 14.67px;color: #00B050; }
																																	.s_A0B393FA { font-family: 'Times New Roman';font-size: 16px;color: #00B050; } </style><p class="p_6AAD5060"><span class="s_A4F101E">Uveďte poštové smerovacie číslo obce/mesta bez medzier. </span><span class="s_A0B393FA" /></p></p></div></div></span><div class="clear" /></div></div><div id="layoutColumn5492" class="column " style="width:360px;"><div id="layoutCell7560" class="cell  TextArea300x24pxNEW"><label class="fieldLabel" title="" for="RecipientMunicipalityNonCodelistDataPO"><xsl:text disable-output-escaping="yes">Mesto </xsl:text><em>*</em></label><span class="fieldContent"><input id="RecipientMunicipalityNonCodelistDataPO" name="RecipientMunicipalityNonCodelistDataPO" title="" type="text" class="xsd_string textBox " maxlength="128" size="190" alt="" value=""><xsl:if test="boolean(./*[name() = 'RecipientMunicipalityNonCodelistDataPO']/@isReadOnly = 'true')"><xsl:attribute name="readonly">readonly</xsl:attribute><xsl:attribute name="disabled">disabled</xsl:attribute></xsl:if><xsl:if test="./*[name() = 'RecipientMunicipalityNonCodelistDataPO']"><xsl:attribute name="value"><xsl:value-of select="./*[name() = 'RecipientMunicipalityNonCodelistDataPO']" /></xsl:attribute></xsl:if></input><div class="info"><div class="dialog-modal" title="Nápoveda"><p><style type="text/css">
																																	p { margin-top: 0px;margin-bottom: 12px;line-height: 1.15; }
																																	body { font-family: 'Verdana';font-size: 16px; }
																																	.p_6AAD5060 { margin-top: 0px;margin-bottom: 12px;line-height: 1.15; }
																																	.s_C1A2E899 { font-family: 'Arial';font-size: 14.6666666666667px;color: #00B050; }
																																	.s_D3FCB7B8 { font-family: 'Verdana';font-size: 16px; } </style><p class="p_6AAD5060"><span class="s_C1A2E899">Uveďte názov obce/mesta. </span><span class="s_D3FCB7B8" /></p></p></div></div></span><div class="clear" /></div><div id="layoutCell7563" class="cell "><label class="fieldLabel" title="" for="RecipientMunicipalityCodelistCodePO" style="display: none">RecipientMunicipalityCodelistCode </label><span class="fieldContent" style="display: none"><input id="RecipientMunicipalityCodelistCodePO" name="RecipientMunicipalityCodelistCodePO" title="" type="text" class="xsd_string textBox " maxlength="100" size="190" alt="" value="CL000025"><xsl:if test="boolean(./*[name() = 'RecipientMunicipalityCodelistCodePO']/@isReadOnly = 'true')"><xsl:attribute name="readonly">readonly</xsl:attribute><xsl:attribute name="disabled">disabled</xsl:attribute></xsl:if><xsl:if test="./*[name() = 'RecipientMunicipalityCodelistCodePO']"><xsl:attribute name="value"><xsl:value-of select="./*[name() = 'RecipientMunicipalityCodelistCodePO']" /></xsl:attribute></xsl:if></input></span><div class="clear" /></div><div id="layoutCell7561" class="cell "><label class="fieldLabel" title="" for="RecipientMunicipalityItemCodePO" style="display: none">RecipientMunicipalityItemCode </label><span class="fieldContent" style="display: none"><input id="RecipientMunicipalityItemCodePO" name="RecipientMunicipalityItemCodePO" title="" type="text" class="xsd_string textBox " maxlength="128" size="190" alt="" value=""><xsl:if test="boolean(./*[name() = 'RecipientMunicipalityItemCodePO']/@isReadOnly = 'true')"><xsl:attribute name="readonly">readonly</xsl:attribute><xsl:attribute name="disabled">disabled</xsl:attribute></xsl:if><xsl:if test="./*[name() = 'RecipientMunicipalityItemCodePO']"><xsl:attribute name="value"><xsl:value-of select="./*[name() = 'RecipientMunicipalityItemCodePO']" /></xsl:attribute></xsl:if></input></span><div class="clear" /></div><div id="layoutCell7562" class="cell "><label class="fieldLabel" title="" for="RecipientMunicipalityItemNamePO" style="display: none">RecipientMunicipalityItemName </label><span class="fieldContent" style="display: none"><input id="RecipientMunicipalityItemNamePO" name="RecipientMunicipalityItemNamePO" title="" type="text" class="xsd_string textBox " maxlength="128" size="190" alt="" value=""><xsl:if test="boolean(./*[name() = 'RecipientMunicipalityItemNamePO']/@isReadOnly = 'true')"><xsl:attribute name="readonly">readonly</xsl:attribute><xsl:attribute name="disabled">disabled</xsl:attribute></xsl:if><xsl:if test="./*[name() = 'RecipientMunicipalityItemNamePO']"><xsl:attribute name="value"><xsl:value-of select="./*[name() = 'RecipientMunicipalityItemNamePO']" /></xsl:attribute></xsl:if></input></span><div class="clear" /></div></div><div id="layoutColumn5494" class="column " style="width:270px;"><div id="layoutCell7565" class="cell  TextArea150x24pxNEW"><label class="fieldLabel" title="" for="RecipientPostalCountryItemNamePO"><xsl:text disable-output-escaping="yes">Štát </xsl:text><em>*</em></label><div class="fieldContent"><input id="RecipientPostalCountryItemNamePO" type="text" value="" alt="" name="RecipientPostalCountryItemNamePO" class="xsd_string remoteLookup RecipientPostalCountryItemNamePO_internal textBox turned" title=""><xsl:if test="boolean(./*[name() = 'RecipientPostalCountryItemNamePO']/@isReadOnly = 'true')"><xsl:attribute name="readonly">readonly</xsl:attribute><xsl:attribute name="disabled">disabled</xsl:attribute></xsl:if><xsl:if test="./*[name() = 'RecipientPostalCountryItemNamePO']"><xsl:attribute name="value"><xsl:value-of select="./*[name() = 'RecipientPostalCountryItemNamePO']" /></xsl:attribute></xsl:if></input><span class="lookupConfiguration" style="display: none;"><span class="lookupComponentId">RecipientPostalCountryItemNamePO</span><span class="fieldId">RecipientPostalCountryItemCodePO</span><span class="remoteSourceIdentifier" /><span class="remoteLookupCode">SUSR_0086</span><span class="fieldId">ServiceID</span></span><div class="info"><div class="dialog-modal" title="Nápoveda"><p><style type="text/css">
																																	p { margin-top: 0px;margin-bottom: 12px;line-height: 1.15; }
																																	body { font-family: 'Verdana';font-size: 16px; }
																																	.p_6AAD5060 { margin-top: 0px;margin-bottom: 12px;line-height: 1.15; }
																																	.s_C1A2E899 { font-family: 'Arial';font-size: 14.6666666666667px;color: #00B050; }
																																	.s_D3FCB7B8 { font-family: 'Verdana';font-size: 16px; } </style><p class="p_6AAD5060"><span class="s_C1A2E899">Zvoľte „Vybrať“, vpíšte presný názov štátu (príklad: Slovenská republika), kliknite na „Hľadať“, vyberte hodnotu z číselníka a prejdite na „OK“. </span><span class="s_D3FCB7B8" /></p></p></div></div><input class="LookupDetailInfo" type="hidden" /><span class="lookupbutton ui-button ui-widget ui-state-default ui-corner-all ui-button-text-only">Vybrať</span><div title="Info" class="LookupDetail"><div class="LookupDetailInfoText" /><span class="lookupConfiguration" style="display: none;"><span class="lookupComponentId">RecipientPostalCountryItemNamePO</span><span class="fieldId">RecipientPostalCountryItemCodePO</span><span class="remoteSourceIdentifier" /><span class="remoteLookupCode">SUSR_0086</span><span class="fieldId">ServiceID</span></span></div><div title="Vyberte hodnotu" class="LookupForm" style="display: none;"><span class="lookupConfiguration" style="display: none;"><span class="lookupComponentId">RecipientPostalCountryItemNamePO</span><span class="fieldId">RecipientPostalCountryItemCodePO</span><span class="remoteSourceIdentifier" /><span class="remoteLookupCode">SUSR_0086</span><span class="fieldId">ServiceID</span></span><div class="tableFilter">
																															Zadajte text:
																															<input class="tableFilterText ui-corner-all" type="text" /><input class="FilterButton ui-button ui-widget ui-state-default ui-corner-all" type="button" value="Hľadať" alt="Hľadať" />
																															Ignorovať diakritiku a veľké písmená
																															<input class="tableFilterIgnoreCaseSensitive" type="checkbox" title="Ignorovať diakritiku a veľké písmená" /></div><table cellpadding="0" cellspacing="0" border="0" class="display LookupTable"><thead><tr><th>Kód</th><th>Hodnota</th></tr></thead><tbody><tr><th /><th /></tr></tbody></table></div></div><span class="fieldInfo"><span class="infoIcon ui-icon ui-icon-info" /></span><div class="clear" /></div><div id="layoutCell7566" class="cell "><label class="fieldLabel" title="" for="RecipientPostalCountryItemCodePO" style="display: none">Štát ItemCode PO </label><span class="fieldContent" style="display: none"><input id="RecipientPostalCountryItemCodePO" name="RecipientPostalCountryItemCodePO" title="" type="text" class="xsd_string textBox " maxlength="256" size="190" alt="" value=""><xsl:if test="boolean(./*[name() = 'RecipientPostalCountryItemCodePO']/@isReadOnly = 'true')"><xsl:attribute name="readonly">readonly</xsl:attribute><xsl:attribute name="disabled">disabled</xsl:attribute></xsl:if><xsl:if test="./*[name() = 'RecipientPostalCountryItemCodePO']"><xsl:attribute name="value"><xsl:value-of select="./*[name() = 'RecipientPostalCountryItemCodePO']" /></xsl:attribute></xsl:if></input></span><div class="clear" /></div><div id="layoutCell7567" class="cell "><label class="fieldLabel" title="" for="RecipientPostalCountryCodelistCodePO" style="display: none">RecipientPostalCountryCodelistCode </label><span class="fieldContent" style="display: none"><input id="RecipientPostalCountryCodelistCodePO" name="RecipientPostalCountryCodelistCodePO" title="" type="text" class="xsd_string textBox " maxlength="100" size="190" alt="" value="CL000086"><xsl:if test="boolean(./*[name() = 'RecipientPostalCountryCodelistCodePO']/@isReadOnly = 'true')"><xsl:attribute name="readonly">readonly</xsl:attribute><xsl:attribute name="disabled">disabled</xsl:attribute></xsl:if><xsl:if test="./*[name() = 'RecipientPostalCountryCodelistCodePO']"><xsl:attribute name="value"><xsl:value-of select="./*[name() = 'RecipientPostalCountryCodelistCodePO']" /></xsl:attribute></xsl:if></input></span><div class="clear" /></div></div><div class="clear" /></div></div></xsl:for-each><div class="clear" /></div></div><div class="clear" /></div></div></xsl:for-each><div class="clear" /></div></div><div class="clear" /></div><div id="repetitionCommandslayoutRow5025" class="sectionPager"><xsl:if test="position() != last()"><xsl:attribute name="style"><xsl:text>display:none;</xsl:text></xsl:attribute></xsl:if><span id="addSectionlayoutRow5025" class="button addRemoveSection" onclick="addSection(1, 9999, this)" title="Pridať sekciu Adresát">Pridať</span><span id="removeSectionlayoutRow5025" class="button addRemoveSection" onclick="removeSection(1, this)" title="Odobrať sekciu Adresát">Odobrať</span></div></div></xsl:for-each><xsl:if test="normalize-space(./egonp:Recipient) = ''"><xsl:if test="./egonp:Recipient/@notInFormData"><script type="text/javascript">$(document).ready(function () { initRepetitionSection(1, 9999, 'layoutRow5025') })</script></xsl:if></xsl:if><div class="clear" /></div></div><div class="clear" /></div></div></xsl:for-each><xsl:for-each select="/egonp:Dokument/egonp:SecEmptySection6"><div id="layoutRow5047" class="layoutRow ui-tabs ui-widget-content   bezOkrajaBezPozadiaHlavicky nocaption " title=""><input type="hidden" name="SecEmptySection6" /><div id="layoutRowContentlayoutRow5047" class="columns"><div id="layoutColumn5517" class="column first"><div id="layoutCell7618" class="cell "><span class="fieldLabel" title=""><xsl:text disable-output-escaping="yes">&#160; </xsl:text></span><div class="clear" /></div></div><div class="clear" /></div></div></xsl:for-each><xsl:for-each select="/egonp:Dokument/egonp:ForInformation"><div id="layoutRow5040" class="layoutRow ui-tabs ui-widget-content PozadieLightBlue " title=""><div class="caption ui-widget-header"><div class="headercorrection" title="Na vedomie">Na vedomie </div><span class="arrow ui-icon ui-icon-carat-1-n" /></div><input type="hidden" name="ForInformation" /><div id="layoutRowContentlayoutRow5040" class="columns"><div id="layoutColumn5505" class="column first"><div id="layoutCell7590" class="cell "><xsl:for-each select="/egonp:Dokument/egonp:ForInformation/egonp:SecForInformationInner"><div id="layoutRow5041" class="layoutRow ui-tabs ui-widget-content   bezOkrajaBezPozadiaHlavicky dolava8px nocaption " title=""><input type="hidden" name="SecForInformationInner" /><div id="layoutRowContentlayoutRow5041" class="columns"><div id="layoutColumn5506" class="column first" style="width:294px;"><div id="layoutCell7591" class="cell  TextArea209x24px"><!--<label class="fieldLabel" title="" for="ForInformationVal">
																			<xsl:text disable-output-escaping="yes">Na vedomie </xsl:text>
																		</label>--><span class="fieldContent"><input id="ForInformationVal" name="ForInformationVal" title="" type="text" class="xsd_string textBox " maxlength="255" size="190" alt="" value=""><xsl:if test="boolean(./*[name() = 'ForInformationVal']/@isReadOnly = 'true')"><xsl:attribute name="readonly">readonly</xsl:attribute><xsl:attribute name="disabled">disabled</xsl:attribute></xsl:if><xsl:if test="./*[name() = 'ForInformationVal']"><xsl:attribute name="value"><xsl:value-of select="./*[name() = 'ForInformationVal']" /></xsl:attribute></xsl:if></input><div class="info"><div class="dialog-modal" title="Nápoveda"><p><style type="text/css">
																							p { margin-top: 0px;margin-bottom: 12px;line-height: 1.15; }
																							body { font-family: 'Verdana';font-size: 16px; }
																							.p_6AAD5060 { margin-top: 0px;margin-bottom: 12px;line-height: 1.15; }
																							.s_A4F101E { font-family: 'Arial';font-size: 14.67px;color: #00B050; }
																							.s_A0B393FA { font-family: 'Times New Roman';font-size: 16px;color: #00B050; } </style><p class="p_6AAD5060"><span class="s_A4F101E">Ak chcete adresáta informovať o doručení rozhodnutia ďalším osobám na vedomie, môžete vpísať číselný údaj predstavujúci počet týchto osôb. </span><span class="s_A0B393FA" /></p></p></div></div></span><div class="clear" /></div></div><div class="clear" /></div></div></xsl:for-each><div class="clear" /></div><div id="layoutCell7589" class="cell  TextArea812x52px"><label class="fieldLabel" title="" for="ForInformationInfo"><xsl:text disable-output-escaping="yes">Popis </xsl:text></label><span class="fieldContent"><textarea id="ForInformationInfo" name="ForInformationInfo" title="" class="xsd_string textArea " maxlength="10000" cols="100" rows="5"><xsl:if test="boolean(./*[name() = 'ForInformationInfo']/@isReadOnly = 'true')"><xsl:attribute name="readonly">readonly</xsl:attribute><xsl:attribute name="disabled">disabled</xsl:attribute></xsl:if><xsl:choose><xsl:when test="./*[name() = 'ForInformationInfo']"><xsl:value-of select="./*[name() = 'ForInformationInfo']" /></xsl:when><xsl:otherwise><xsl:text /></xsl:otherwise></xsl:choose></textarea><div class="info"><div class="dialog-modal" title="Nápoveda"><p><style type="text/css">
																		p { margin-top: 0px;margin-bottom: 12px;line-height: 1.15; }
																		body { font-family: 'Verdana';font-size: 16px; }
																		.p_6AAD5060 { margin-top: 0px;margin-bottom: 12px;line-height: 1.15; }
																		.s_A4F101E { font-family: 'Arial';font-size: 14.67px;color: #00B050; }
																		.s_A0B393FA { font-family: 'Times New Roman';font-size: 16px;color: #00B050; } </style><p class="p_6AAD5060"><span class="s_A4F101E">Ak chcete adresáta informovať o doručení rozhodnutia ďalším osobám na vedomie, môžete zadať ich úplné a presné mená a priezviská/názvy a adresy. </span><span class="s_A0B393FA" /></p></p></div></div></span><div class="clear" /></div></div><div class="clear" /></div><div id="repetitionCommandslayoutRow5040" class="sectionPager"><xsl:if test="position() != last()"><xsl:attribute name="style"><xsl:text>display:none;</xsl:text></xsl:attribute></xsl:if><span id="addSectionlayoutRow5040" class="button addRemoveSection" onclick="addSection(0, 1, this)" title="Pridať sekciu Na vedomie">Pridať</span><span id="removeSectionlayoutRow5040" class="button addRemoveSection" onclick="removeSection(0, this)" title="Odobrať sekciu Na vedomie">Odobrať</span></div></div></xsl:for-each><xsl:if test="normalize-space(/egonp:Dokument/egonp:ForInformation) = ''"><xsl:if test="/egonp:Dokument/egonp:ForInformation/@notInFormData"><script type="text/javascript">$(document).ready(function () { initRepetitionSection(0, 1, 'layoutRow5040') })</script></xsl:if></xsl:if><xsl:for-each select="/egonp:Dokument/egonp:SecEmptySection12"><div id="layoutRow59047" class="layoutRow ui-tabs ui-widget-content   bezOkrajaBezPozadiaHlavicky nocaption " title=""><input type="hidden" name="SecEmptySection12" /><div id="layoutRowContentlayoutRow59047" class="columns"><div id="layoutColumn5a517" class="column first"><div id="layoutCell7a618" class="cell "><span class="fieldLabel" title=""><xsl:text disable-output-escaping="yes">&#160; </xsl:text></span><div class="clear" /></div></div><div class="clear" /></div></div></xsl:for-each><xsl:for-each select="/egonp:Dokument/egonp:PaymentData"><div id="layoutRow590401" class="layoutRow ui-tabs ui-widget-content PozadieLightBlue " title=""><input type="hidden" name="PaymentData" /><div class="caption ui-widget-header"><div class="headercorrection" title="Platobne udaje">Platobné údaje</div><span class="arrow ui-icon ui-icon-carat-1-n" /></div><div id="layoutRowContentlayoutRow590401" class="columns"><div id="layoutColumn55051" class="column first"><div id="layoutCell75901" class="cell "><!-- <div id="layoutRow5041" class="layoutRow ui-tabs ui-widget-content   bezOkrajaBezPozadiaHlavicky dolava8px nocaption " title=""> --><div id="layoutRowContentlayoutRow50411" class="columns"><div id="layoutColumn5506" class="column first"><div id="layoutCell7591" class="cell  TextArea812x52px"><label class="fieldLabel" title="" for="Payment_text"><xsl:text disable-output-escaping="yes">Text </xsl:text></label><span class="fieldContent"><textarea id="Payment_text" name="Payment_text" title="" class="xsd_string textArea " maxlength="1024" cols="100" rows="5"><xsl:if test="boolean(./*[name() = 'Payment_text']/@isReadOnly = 'true')"><xsl:attribute name="readonly">readonly</xsl:attribute><xsl:attribute name="disabled">disabled</xsl:attribute></xsl:if><xsl:choose><xsl:when test="./*[name() = 'Payment_text']"><xsl:value-of select="./*[name() = 'Payment_text']" /></xsl:when><xsl:otherwise><xsl:text /></xsl:otherwise></xsl:choose></textarea><div class="info"><div class="dialog-modal" title="Nápoveda"><p><style type="text/css">
																					p { margin-top: 0px;margin-bottom: 12px;line-height: 1.15; }
																					body { font-family: 'Verdana';font-size: 16px; }
																					.p_6AAD5060 { margin-top: 0px;margin-bottom: 12px;line-height: 1.15; }
																					.s_A4F101E { font-family: 'Arial';font-size: 14.67px;color: #00B050; }
																					.s_A0B393FA { font-family: 'Times New Roman';font-size: 16px;color: #00B050; } </style><p class="p_6AAD5060"><span class="s_A4F101E">Doplňujúci text k platbe</span><span class="s_A0B393FA" /></p></p></div></div></span><div class="clear" /></div></div><div class="clear" /></div><!--</div>--></div><div class="clear" /><div id="layoutRowContentlayoutRow50291" class="columns"><div id="layoutColumn54837" class="column first" style="width:200px;"><div id="layoutCell75891" class="cell  TextArea150x24pxNEW"><label class="fieldLabel" title="" for="Payment_amount"><xsl:text disable-output-escaping="yes">Suma </xsl:text></label><span class="fieldContent"><input id="Payment_amount" name="Payment_amount" title="" type="text" class="xsd_string textBox " maxlength="20" alt="" value="" size="190"><xsl:if test="boolean(./*[name() = 'Payment_amount']/@isReadOnly = 'true')"><xsl:attribute name="readonly">readonly</xsl:attribute><xsl:attribute name="disabled">disabled</xsl:attribute></xsl:if><xsl:if test="./*[name() = 'Payment_amount']"><xsl:attribute name="value"><xsl:value-of select="./*[name() = 'Payment_amount']" /></xsl:attribute></xsl:if></input><div class="info"><div class="dialog-modal" title="Nápoveda"><p><style type="text/css">
																				p { margin-top: 0px;margin-bottom: 12px;line-height: 1.15; }
																				body { font-family: 'Verdana';font-size: 16px; }
																				.p_6AAD5060 { margin-top: 0px;margin-bottom: 12px;line-height: 1.15; }
																				.s_A4F101E { font-family: 'Arial';font-size: 14.67px;color: #00B050; }
																				.s_A0B393FA { font-family: 'Times New Roman';font-size: 16px;color: #00B050; } </style><p class="p_6AAD5060"><span class="s_A4F101E">Suma platby</span><span class="s_A0B393FA" /></p></p></div></div></span><div class="clear" /></div></div><div id="layoutColumn54847" class="column " style="width:100px;"><div id="layoutCell75892" class="cell  TextArea50x24pxNEW"><label class="fieldLabel" title="" for="Payment_currency"><xsl:text disable-output-escaping="yes">Mena </xsl:text></label><span class="fieldContent"><input id="Payment_currency" name="Payment_currency" title="" type="text" class="xsd_string textBox " maxlength="10" alt="" value="" size="190"><xsl:if test="boolean(./*[name() = 'Payment_currency']/@isReadOnly = 'true')"><xsl:attribute name="readonly">readonly</xsl:attribute><xsl:attribute name="disabled">disabled</xsl:attribute></xsl:if><xsl:if test="./*[name() = 'Payment_currency']"><xsl:attribute name="value"><xsl:value-of select="./*[name() = 'Payment_currency']" /></xsl:attribute></xsl:if></input><div class="info"><div class="dialog-modal" title="Nápoveda"><p><style type="text/css">
																				p { margin-top: 0px;margin-bottom: 12px;line-height: 1.15; }
																				body { font-family: 'Verdana';font-size: 16px; }
																				.p_6AAD5060 { margin-top: 0px;margin-bottom: 12px;line-height: 1.15; }
																				.s_A4F101E { font-family: 'Arial';font-size: 14.67px;color: #00B050; }
																				.s_A0B393FA { font-family: 'Times New Roman';font-size: 16px;color: #00B050; } </style><p class="p_6AAD5060"><span class="s_A4F101E">Mena platby</span><span class="s_A0B393FA" /></p></p></div></div></span><div class="clear" /></div></div><div id="layoutColumn54937" class="column" style="width:320px;"><div id="layoutCell75893" class="cell  TextArea250x24pxNEW"><label class="fieldLabel" title="" for="Payment_accountnumber_iban"><xsl:text disable-output-escaping="yes">Číslo účtu </xsl:text></label><span class="fieldContent"><input id="Payment_accountnumber_iban" name="Payment_accountnumber_iban" title="" type="text" class="xsd_string textBox " maxlength="100" alt="" value="" size="300"><xsl:if test="boolean(./*[name() = 'Payment_accountnumber_iban']/@isReadOnly = 'true')"><xsl:attribute name="readonly">readonly</xsl:attribute><xsl:attribute name="disabled">disabled</xsl:attribute></xsl:if><xsl:if test="./*[name() = 'Payment_accountnumber_iban']"><xsl:attribute name="value"><xsl:value-of select="./*[name() = 'Payment_accountnumber_iban']" /></xsl:attribute></xsl:if></input><div class="info"><div class="dialog-modal" title="Nápoveda"><p><style type="text/css">
																				p { margin-top: 0px;margin-bottom: 12px;line-height: 1.15; }
																				body { font-family: 'Verdana';font-size: 16px; }
																				.p_6AAD5060 { margin-top: 0px;margin-bottom: 12px;line-height: 1.15; }
																				.s_A4F101E { font-family: 'Arial';font-size: 14.67px;color: #00B050; }
																				.s_A0B393FA { font-family: 'Times New Roman';font-size: 16px;color: #00B050; } </style><p class="p_6AAD5060"><span class="s_A4F101E">Číslo účtu pre úhradu platby v tvare IBAN</span><span class="s_A0B393FA" /></p></p></div></div></span><div class="clear" /></div></div><div id="layoutColumn548371" class="column" style="width:250px;"><div id="layoutCell75894" class="cell  TextArea190x24pxNEW"><label class="fieldLabel" title="" for="Payment_swift_bic"><xsl:text disable-output-escaping="yes">SWIFT BIC </xsl:text></label><span class="fieldContent"><input id="Payment_swift_bic" name="Payment_swift_bic" title="" type="text" class="xsd_string textBox " maxlength="20" alt="" value="" size="190"><xsl:if test="boolean(./*[name() = 'Payment_swift_bic']/@isReadOnly = 'true')"><xsl:attribute name="readonly">readonly</xsl:attribute><xsl:attribute name="disabled">disabled</xsl:attribute></xsl:if><xsl:if test="./*[name() = 'Payment_swift_bic']"><xsl:attribute name="value"><xsl:value-of select="./*[name() = 'Payment_swift_bic']" /></xsl:attribute></xsl:if></input><div class="info"><div class="dialog-modal" title="Nápoveda"><p><style type="text/css">
																				p { margin-top: 0px;margin-bottom: 12px;line-height: 1.15; }
																				body { font-family: 'Verdana';font-size: 16px; }
																				.p_6AAD5060 { margin-top: 0px;margin-bottom: 12px;line-height: 1.15; }
																				.s_A4F101E { font-family: 'Arial';font-size: 14.67px;color: #00B050; }
																				.s_A0B393FA { font-family: 'Times New Roman';font-size: 16px;color: #00B050; } </style><p class="p_6AAD5060"><span class="s_A4F101E">SWIFT a BIC kód banky</span><span class="s_A0B393FA" /></p></p></div></div></span><div class="clear" /></div></div><div id="layoutColumn548372" class="column" style="width:250px;"><div id="layoutCell75895" class="cell  TextArea190x24pxNEW"><label class="fieldLabel" title="" for="Payment_vs"><xsl:text disable-output-escaping="yes">Variabilný symbol </xsl:text></label><span class="fieldContent"><input id="Payment_vs" name="Payment_vs" title="" type="text" class="xsd_string textBox " maxlength="10" alt="" value="" size="190"><xsl:if test="boolean(./*[name() = 'Payment_vs']/@isReadOnly = 'true')"><xsl:attribute name="readonly">readonly</xsl:attribute><xsl:attribute name="disabled">disabled</xsl:attribute></xsl:if><xsl:if test="./*[name() = 'Payment_vs']"><xsl:attribute name="value"><xsl:value-of select="./*[name() = 'Payment_vs']" /></xsl:attribute></xsl:if></input><div class="info"><div class="dialog-modal" title="Nápoveda"><p><style type="text/css">
																				p { margin-top: 0px;margin-bottom: 12px;line-height: 1.15; }
																				body { font-family: 'Verdana';font-size: 16px; }
																				.p_6AAD5060 { margin-top: 0px;margin-bottom: 12px;line-height: 1.15; }
																				.s_A4F101E { font-family: 'Arial';font-size: 14.67px;color: #00B050; }
																				.s_A0B393FA { font-family: 'Times New Roman';font-size: 16px;color: #00B050; } </style><p class="p_6AAD5060"><span class="s_A4F101E">Zadajte prosím variabilný symbol - maximálne 10 číslic bez medzier a znakov</span><span class="s_A0B393FA" /></p></p></div></div></span><div class="clear" /></div></div><div id="layoutColumn548373" class="column" style="width:250px;"><div id="layoutColumn54837" class="column first" style="width:250px;"><div id="layoutCell75896" class="cell  TextArea190x24pxNEW"><label class="fieldLabel" title="" for="Payment_ss"><xsl:text disable-output-escaping="yes">Špecifický symbol </xsl:text></label><span class="fieldContent"><input id="Payment_ss" name="Payment_ss" title="" type="text" class="xsd_string textBox " maxlength="10" alt="" value="" size="190"><xsl:if test="boolean(./*[name() = 'Payment_ss']/@isReadOnly = 'true')"><xsl:attribute name="readonly">readonly</xsl:attribute><xsl:attribute name="disabled">disabled</xsl:attribute></xsl:if><xsl:if test="./*[name() = 'Payment_ss']"><xsl:attribute name="value"><xsl:value-of select="./*[name() = 'Payment_ss']" /></xsl:attribute></xsl:if></input><div class="info"><div class="dialog-modal" title="Nápoveda"><p><style type="text/css">
																					p { margin-top: 0px;margin-bottom: 12px;line-height: 1.15; }
																					body { font-family: 'Verdana';font-size: 16px; }
																					.p_6AAD5060 { margin-top: 0px;margin-bottom: 12px;line-height: 1.15; }
																					.s_A4F101E { font-family: 'Arial';font-size: 14.67px;color: #00B050; }
																					.s_A0B393FA { font-family: 'Times New Roman';font-size: 16px;color: #00B050; } </style><p class="p_6AAD5060"><span class="s_A4F101E">Zadajte prosím špecifický symbol - maximálne 10 číslic bez medzier a znakov</span><span class="s_A0B393FA" /></p></p></div></div></span><div class="clear" /></div></div></div><div id="layoutColumn548374" class="column" style="width:250px;"><div id="layoutCell75897" class="cell  TextArea190x24pxNEW"><label class="fieldLabel" title="" for="Payment_cs"><xsl:text disable-output-escaping="yes">Konštantný symbol </xsl:text></label><span class="fieldContent"><input id="Payment_cs" name="Payment_cs" title="" type="text" class="xsd_string textBox " maxlength="4" alt="" value="" size="190"><xsl:if test="boolean(./*[name() = 'Payment_cs']/@isReadOnly = 'true')"><xsl:attribute name="readonly">readonly</xsl:attribute><xsl:attribute name="disabled">disabled</xsl:attribute></xsl:if><xsl:if test="./*[name() = 'Payment_cs']"><xsl:attribute name="value"><xsl:value-of select="./*[name() = 'Payment_cs']" /></xsl:attribute></xsl:if></input><div class="info"><div class="dialog-modal" title="Nápoveda"><p><style type="text/css">
																				p { margin-top: 0px;margin-bottom: 12px;line-height: 1.15; }
																				body { font-family: 'Verdana';font-size: 16px; }
																				.p_6AAD5060 { margin-top: 0px;margin-bottom: 12px;line-height: 1.15; }
																				.s_A4F101E { font-family: 'Arial';font-size: 14.67px;color: #00B050; }
																				.s_A0B393FA { font-family: 'Times New Roman';font-size: 16px;color: #00B050; } </style><p class="p_6AAD5060"><span class="s_A4F101E">Zadajte prosím špecifický symbol - maximálne 10 číslic bez medzier a znakov</span><span class="s_A0B393FA" /></p></p></div></div></span><div class="clear" /></div></div><div class="clear" /></div><div id="layoutCell75898" class="cell  "><!--<xsl:if test="/egonp:Dokument/egonp:PaymentData/egonp:Payment_barcode/text()">--><label class="fieldLabel" title="" for="Payment_barcode" style="width:120px;"><xsl:text disable-output-escaping="yes">Čiarový kód </xsl:text></label><div class="fieldContent" id="imgSpanBarCode"><xsl:if test="./*[name() = 'Payment_barcode']"><xsl:variable name="barcodeIMG_data" select="./*[name() = 'Payment_barcode']" /><xsl:choose><xsl:when test="string-length($barcodeIMG_data) > 0"><xsl:variable name="barcodeIMG" select="concat('data:image/png;base64,',$barcodeIMG_data)" /><img id="PlatbaHodn_barcode_img" src="{$barcodeIMG}" alt="" /></xsl:when><xsl:otherwise><img id="PlatbaHodn_barcode_img" src="" alt="" /></xsl:otherwise></xsl:choose></xsl:if></div><input id="Payment_barcode" name="Payment_barcode" type="hidden" class="xsd_string textBox" alt="" value=""><xsl:if test="boolean(./*[name() = 'Payment_barcode']/@isReadOnly = 'true')"><xsl:attribute name="readonly">readonly</xsl:attribute><xsl:attribute name="disabled">disabled</xsl:attribute></xsl:if><xsl:if test="./*[name() = 'Payment_barcode']"><xsl:variable name="barcodeIMG_data" select="./*[name() = 'Payment_barcode']" /><xsl:choose><xsl:when test="string-length($barcodeIMG_data) > 0"><xsl:variable name="barcodeIMG" select="concat('data:image/png;base64,',$barcodeIMG_data)" /><xsl:attribute name="value"><xsl:value-of select="concat($barcodeIMG,'')" /></xsl:attribute></xsl:when><xsl:otherwise><xsl:attribute name="value"><xsl:value-of select="./*[name() = 'Payment_barcode']" /></xsl:attribute></xsl:otherwise></xsl:choose></xsl:if></input><!--
														<span class="fieldContent">
															<xsl:if test="./*[name() = 'Payment_barcode']">
																<xsl:variable name="barcodeIMG_data" select="./*[name() = 'Payment_barcode']"/>
																<xsl:variable name="barcodeIMG" select="concat('data:image/png;base64,',$barcodeIMG_data)"/>
																<img src="{$barcodeIMG}" alt="barcode"/>
															</xsl:if>
														</span>--><div class="clear" /><!--</xsl:if>--></div><div id="layoutCell75899" class="cell  "><!--<xsl:if test="/egonp:Dokument/egonp:PaymentData/egonp:Payment_qrcode/text()">--><label class="fieldLabel" title="" for="Payment_qrcode" style="width:120px;"><xsl:text disable-output-escaping="yes">QR kód &#160;&#13;&#10;</xsl:text><xsl:text disable-output-escaping="yes">(načítaním v mobilnej aplikácii svojej banky vykonáte úhradu) &#160;</xsl:text></label><div class="fieldContent" id="imgSpanQRCode"><xsl:if test="./*[name() = 'Payment_qrcode']"><xsl:variable name="barcodeIMG_data" select="./*[name() = 'Payment_qrcode']" /><xsl:choose><xsl:when test="string-length($barcodeIMG_data) > 0"><xsl:variable name="barcodeIMG" select="concat('data:image/png;base64,',$barcodeIMG_data)" /><img id="PlatbaHodn_qrcode_img" height="200px" src="{$barcodeIMG}" alt="" /></xsl:when><xsl:otherwise><img id="PlatbaHodn_qrcode_img" height="200px" src="" alt="" /></xsl:otherwise></xsl:choose></xsl:if></div><input id="Payment_qrcode" name="Payment_qrcode" type="hidden" class="xsd_string textBox" alt="" value=""><xsl:if test="boolean(./*[name() = 'Payment_qrcode']/@isReadOnly = 'true')"><xsl:attribute name="readonly">readonly</xsl:attribute><xsl:attribute name="disabled">disabled</xsl:attribute></xsl:if><xsl:if test="./*[name() = 'Payment_qrcode']"><xsl:variable name="barcodeIMG_data" select="./*[name() = 'Payment_qrcode']" /><xsl:choose><xsl:when test="string-length($barcodeIMG_data) > 0"><xsl:variable name="barcodeIMG" select="concat('data:image/png;base64,',$barcodeIMG_data)" /><xsl:attribute name="value"><xsl:value-of select="concat($barcodeIMG,'')" /></xsl:attribute></xsl:when><xsl:otherwise><xsl:attribute name="value"><xsl:value-of select="./*[name() = 'Payment_qrcode']" /></xsl:attribute></xsl:otherwise></xsl:choose></xsl:if></input><!--
														<span class="fieldContent">
															<xsl:if test="./*[name() = 'Payment_qrcode']">
																<xsl:variable name="barcodeIMG_data" select="./*[name() = 'Payment_qrcode']"/>
																<xsl:variable name="barcodeIMG" select="concat('data:image/png;base64,',$barcodeIMG_data)"/>
																<img height="200px" src="{$barcodeIMG}" alt="qrcode"/>
															</xsl:if>
														</span>--><div class="clear" /><!--</xsl:if>--></div></div><div class="clear" /></div><div id="repetitionCommandslayoutRow590401" class="sectionPager"><xsl:if test="position() != last()"><xsl:attribute name="style"><xsl:text>display:none;</xsl:text></xsl:attribute></xsl:if><span id="addSectionlayoutRow590401" class="button addRemoveSection" onclick="addSection(0, 1, this)" title="Pridať sekciu Platobné údaje">Pridať</span><span id="removeSectionlayoutRow590401" class="button addRemoveSection" onclick="removeSection(0, this)" title="Odobrať sekciu Platobné údaje">Odobrať</span></div></div></xsl:for-each><xsl:if test="normalize-space(/egonp:Dokument/egonp:PaymentData) = ''"><xsl:if test="/egonp:Dokument/egonp:PaymentData/@notInFormData"><script type="text/javascript">$(document).ready(function () { initRepetitionSection(0, 9, 'layoutRow590401') })</script></xsl:if></xsl:if><xsl:for-each select="/egonp:Dokument/egonp:ZakonEGovInfo"><div id="layoutRow5054z" class="layoutRow ui-tabs ui-widget-content   bezOkrajaBezPozadiaHlavicky nocaption " title=""><input type="hidden" name="ZakonEGovInfo" /><div id="layoutRowContentlayoutRow5054z" class="columns"><div id="layoutColumn5524z" class="column first"><div id="layoutCell7638z" class="cell  TextArea812x38pxNEW"><span class="fieldContent"><textarea id="Info_Text" name="Info_Text" title="" class="xsd_string textArea " cols="100" rows="3"><xsl:if test="boolean(./*[name() = 'Info_Text']/@isReadOnly = 'true')"><xsl:attribute name="readonly">readonly</xsl:attribute><xsl:attribute name="disabled">disabled</xsl:attribute></xsl:if><xsl:choose><xsl:when test="./*[name() = 'Info_Text']"><xsl:value-of select="./*[name() = 'Info_Text']" /></xsl:when><xsl:otherwise><xsl:text /></xsl:otherwise></xsl:choose></textarea><div class="info"><div class="dialog-modal" title="Nápoveda"><p><style type="text/css">
																		p { margin-top: 0px;margin-bottom: 12px;line-height: 1.15; }
																		body { font-family: 'Verdana';font-size: 16px; }
																		.p_6AAD5060 { margin-top: 0px;margin-bottom: 12px;line-height: 1.15; }
																		.s_A4F101E { font-family: 'Arial';font-size: 14.67px;color: #00B050; }
																		.s_A0B393FA { font-family: 'Times New Roman';font-size: 16px;color: #00B050; } </style><p class="p_6AAD5060"><span class="s_A4F101E">Info_text k zakonu o eGOV</span><span class="s_A0B393FA" /></p></p></div></div></span><div class="clear" /></div></div><div class="clear" /></div></div></xsl:for-each><xsl:for-each select="/egonp:Dokument/egonp:SecFooter"><div id="layoutRow5067" class="layoutRow ui-tabs ui-widget-content   nocaption " title=""><input type="hidden" name="SecFooter" /><div id="layoutRowContentlayoutRow5067" class="columns"><div id="layoutColumn5542" class="column first" style="width:190px;"><div id="layoutCell7677" class="cell  TextArea120x24px"><label class="fieldLabel" title="" for="FormattedNumber"><xsl:text disable-output-escaping="yes">Telefón </xsl:text></label><span class="fieldContent"><input id="FormattedNumber" name="FormattedNumber" title="" type="text" class="xsd_string textBox " maxlength="20" size="190" alt="" value=""><xsl:if test="boolean(./*[name() = 'FormattedNumber']/@isReadOnly = 'true')"><xsl:attribute name="readonly">readonly</xsl:attribute><xsl:attribute name="disabled">disabled</xsl:attribute></xsl:if><xsl:if test="./*[name() = 'FormattedNumber']"><xsl:attribute name="value"><xsl:value-of select="./*[name() = 'FormattedNumber']" /></xsl:attribute></xsl:if></input><div class="info"><div class="dialog-modal" title="Nápoveda"><p><style type="text/css">
																		p { margin-top: 0px;margin-bottom: 12px;line-height: 1.15; }
																		body { font-family: 'Verdana';font-size: 16px; }
																		.p_6AAD5060 { margin-top: 0px;margin-bottom: 12px;line-height: 1.15; }
																		.s_D3FCB7B8 { font-family: 'Verdana';font-size: 16px; } </style><p class="p_6AAD5060"><span class="s_D3FCB7B8">Text nápovedy pre pole</span></p></p></div></div></span><div class="clear" /></div><div id="layoutCell7678" class="cell "><label class="fieldLabel" title="" for="TelephoneTypeCodelistCode" style="display: none">TelephoneTypeCodelistCode </label><span class="fieldContent" style="display: none"><input id="TelephoneTypeCodelistCode" name="TelephoneTypeCodelistCode" title="" type="text" class="xsd_string textBox " maxlength="100" size="190" alt="" value="CL004005"><xsl:if test="boolean(./*[name() = 'TelephoneTypeCodelistCode']/@isReadOnly = 'true')"><xsl:attribute name="readonly">readonly</xsl:attribute><xsl:attribute name="disabled">disabled</xsl:attribute></xsl:if><xsl:if test="./*[name() = 'TelephoneTypeCodelistCode']"><xsl:attribute name="value"><xsl:value-of select="./*[name() = 'TelephoneTypeCodelistCode']" /></xsl:attribute></xsl:if></input></span><div class="clear" /></div><div id="layoutCell7679" class="cell "><label class="fieldLabel" title="" for="TelephoneTypeItemCode" style="display: none">TelephoneTypeItemCode </label><span class="fieldContent" style="display: none"><input id="TelephoneTypeItemCode" name="TelephoneTypeItemCode" title="" type="text" class="xsd_string textBox " maxlength="128" size="190" alt="" value="1"><xsl:if test="boolean(./*[name() = 'TelephoneTypeItemCode']/@isReadOnly = 'true')"><xsl:attribute name="readonly">readonly</xsl:attribute><xsl:attribute name="disabled">disabled</xsl:attribute></xsl:if><xsl:if test="./*[name() = 'TelephoneTypeItemCode']"><xsl:attribute name="value"><xsl:value-of select="./*[name() = 'TelephoneTypeItemCode']" /></xsl:attribute></xsl:if></input></span><div class="clear" /></div><div id="layoutCell7680" class="cell "><label class="fieldLabel" title="" for="TelephoneTypeItemName" style="display: none">TelephoneTypeItemName </label><span class="fieldContent" style="display: none"><input id="TelephoneTypeItemName" name="TelephoneTypeItemName" title="" type="text" class="xsd_string textBox " maxlength="128" size="190" alt="" value="Pevná sieť"><xsl:if test="boolean(./*[name() = 'TelephoneTypeItemName']/@isReadOnly = 'true')"><xsl:attribute name="readonly">readonly</xsl:attribute><xsl:attribute name="disabled">disabled</xsl:attribute></xsl:if><xsl:if test="./*[name() = 'TelephoneTypeItemName']"><xsl:attribute name="value"><xsl:value-of select="./*[name() = 'TelephoneTypeItemName']" /></xsl:attribute></xsl:if></input></span><div class="clear" /></div></div><div id="layoutColumn5543" class="column " style="width:279px;"><div id="layoutCell7681" class="cell  TextArea209x24px"><label class="fieldLabel" title="" for="EMailAddress"><xsl:text disable-output-escaping="yes">E-mail </xsl:text></label><span class="fieldContent"><input id="EMailAddress" name="EMailAddress" title="" type="text" class="xsd_string textBox " maxlength="254" size="190" alt="" value=""><xsl:if test="boolean(./*[name() = 'EMailAddress']/@isReadOnly = 'true')"><xsl:attribute name="readonly">readonly</xsl:attribute><xsl:attribute name="disabled">disabled</xsl:attribute></xsl:if><xsl:if test="./*[name() = 'EMailAddress']"><xsl:attribute name="value"><xsl:value-of select="./*[name() = 'EMailAddress']" /></xsl:attribute></xsl:if></input><div class="info"><div class="dialog-modal" title="Nápoveda"><p><style type="text/css">
																		p { margin-top: 0px;margin-bottom: 12px;line-height: 1.15; }
																		body { font-family: 'Verdana';font-size: 16px; }
																		.p_6AAD5060 { margin-top: 0px;margin-bottom: 12px;line-height: 1.15; }
																		.s_D3FCB7B8 { font-family: 'Verdana';font-size: 16px; } </style><p class="p_6AAD5060"><span class="s_D3FCB7B8">Text nápovedy pre pole</span></p></p></div></div></span><div class="clear" /></div></div><div id="layoutColumn5544" class="column " style="width:279px;"><div id="layoutCell7682" class="cell  TextArea209x24px"><label class="fieldLabel" title="" for="InternetAddress"><xsl:text disable-output-escaping="yes">Internet </xsl:text></label><span class="fieldContent"><input id="InternetAddress" name="InternetAddress" title="" type="text" class="xsd_string textBox " maxlength="2000" size="190" alt="" value=""><xsl:if test="boolean(./*[name() = 'InternetAddress']/@isReadOnly = 'true')"><xsl:attribute name="readonly">readonly</xsl:attribute><xsl:attribute name="disabled">disabled</xsl:attribute></xsl:if><xsl:if test="./*[name() = 'InternetAddress']"><xsl:attribute name="value"><xsl:value-of select="./*[name() = 'InternetAddress']" /></xsl:attribute></xsl:if></input><div class="info"><div class="dialog-modal" title="Nápoveda"><p><style type="text/css">
																		p { margin-top: 0px;margin-bottom: 12px;line-height: 1.15; }
																		body { font-family: 'Verdana';font-size: 16px; }
																		.p_6AAD5060 { margin-top: 0px;margin-bottom: 12px;line-height: 1.15; }
																		.s_D3FCB7B8 { font-family: 'Verdana';font-size: 16px; } </style><p class="p_6AAD5060"><span class="s_D3FCB7B8">Text nápovedy pre pole</span></p></p></div></div></span><div class="clear" /></div></div><div id="layoutColumn5545" class="column " style="width:105px;"><div id="layoutCell7683" class="cell  TextArea64x24px"><label class="fieldLabel" title="" for="Ico"><xsl:text disable-output-escaping="yes">IČO </xsl:text></label><span class="fieldContent"><input id="Ico" name="Ico" title="" type="text" class="xsd_string textBox Ico_internal" maxlength="8" size="190" alt="" value=""><xsl:if test="boolean(./*[name() = 'Ico']/@isReadOnly = 'true')"><xsl:attribute name="readonly">readonly</xsl:attribute><xsl:attribute name="disabled">disabled</xsl:attribute></xsl:if><xsl:if test="./*[name() = 'Ico']"><xsl:attribute name="value"><xsl:value-of select="./*[name() = 'Ico']" /></xsl:attribute></xsl:if></input><div class="info"><div class="dialog-modal" title="Nápoveda"><p><style type="text/css">
																		p { margin-top: 0px;margin-bottom: 12px;line-height: 1.15; }
																		body { font-family: 'Verdana';font-size: 16px; }
																		.p_6AAD5060 { margin-top: 0px;margin-bottom: 12px;line-height: 1.15; }
																		.s_D3FCB7B8 { font-family: 'Verdana';font-size: 16px; } </style><p class="p_6AAD5060"><span class="s_D3FCB7B8">Text nápovedy pre pole</span></p></p></div></div></span><div class="clear" /></div><div id="layoutCell7684" class="cell "><label class="fieldLabel" title="" for="IdentifierTypeCodelistCode" style="display: none">IdentifierTypeCodelistCode </label><span class="fieldContent" style="display: none"><input id="IdentifierTypeCodelistCode" name="IdentifierTypeCodelistCode" title="" type="text" class="xsd_string textBox " maxlength="100" size="190" alt="" value="CL004001"><xsl:if test="boolean(./*[name() = 'IdentifierTypeCodelistCode']/@isReadOnly = 'true')"><xsl:attribute name="readonly">readonly</xsl:attribute><xsl:attribute name="disabled">disabled</xsl:attribute></xsl:if><xsl:if test="./*[name() = 'IdentifierTypeCodelistCode']"><xsl:attribute name="value"><xsl:value-of select="./*[name() = 'IdentifierTypeCodelistCode']" /></xsl:attribute></xsl:if></input></span><div class="clear" /></div><div id="layoutCell7685" class="cell "><label class="fieldLabel" title="" for="IdentifierTypeItemCode" style="display: none">IdentifierTypeItemCode </label><span class="fieldContent" style="display: none"><input id="IdentifierTypeItemCode" name="IdentifierTypeItemCode" title="" type="text" class="xsd_string textBox " maxlength="128" size="190" alt="" value="7"><xsl:if test="boolean(./*[name() = 'IdentifierTypeItemCode']/@isReadOnly = 'true')"><xsl:attribute name="readonly">readonly</xsl:attribute><xsl:attribute name="disabled">disabled</xsl:attribute></xsl:if><xsl:if test="./*[name() = 'IdentifierTypeItemCode']"><xsl:attribute name="value"><xsl:value-of select="./*[name() = 'IdentifierTypeItemCode']" /></xsl:attribute></xsl:if></input></span><div class="clear" /></div><div id="layoutCell7686" class="cell "><label class="fieldLabel" title="" for="IdentifierTypeItemName" style="display: none">IdentifierTypeItemName </label><span class="fieldContent" style="display: none"><input id="IdentifierTypeItemName" name="IdentifierTypeItemName" title="" type="text" class="xsd_string textBox " maxlength="128" size="190" alt="" value="IČO (Identifikačné číslo organizácie)"><xsl:if test="boolean(./*[name() = 'IdentifierTypeItemName']/@isReadOnly = 'true')"><xsl:attribute name="readonly">readonly</xsl:attribute><xsl:attribute name="disabled">disabled</xsl:attribute></xsl:if><xsl:if test="./*[name() = 'IdentifierTypeItemName']"><xsl:attribute name="value"><xsl:value-of select="./*[name() = 'IdentifierTypeItemName']" /></xsl:attribute></xsl:if></input></span><div class="clear" /></div></div><div class="clear" /></div></div></xsl:for-each><xsl:for-each select="/egonp:Dokument/egonp:SecEmptySection11"><div id="layoutRow5065" class="layoutRow ui-tabs ui-widget-content   bezOkrajaBezPozadiaHlavicky nocaption " title=""><input type="hidden" name="SecEmptySection11" /><div id="layoutRowContentlayoutRow5065" class="columns"><div id="layoutColumn5541" class="column first"><div id="layoutCell7670" class="cell "><span class="fieldLabel" title=""><xsl:text disable-output-escaping="yes">&#160; </xsl:text></span><div class="clear" /></div><div id="layoutCell7671" class="cell "><label class="fieldLabel" title="" for="AdjudgementType" style="display: none">AdjudgementType </label><span class="fieldContent" style="display: none"><input id="AdjudgementType" name="AdjudgementType" title="" type="text" class="xsd_string textBox " maxlength="127" size="190" disabled="disabled" readonly="readonly" alt="" value=""><xsl:if test="boolean(./*[name() = 'AdjudgementType']/@isReadOnly = 'true')"><xsl:attribute name="readonly">readonly</xsl:attribute><xsl:attribute name="disabled">disabled</xsl:attribute></xsl:if><xsl:if test="./*[name() = 'AdjudgementType']"><xsl:attribute name="value"><xsl:value-of select="./*[name() = 'AdjudgementType']" /></xsl:attribute></xsl:if></input></span><div class="clear" /></div><div id="layoutCell7672" class="cell "><label class="fieldLabel" title="" for="AdjudgementLogo" style="display: none">AdjudgementLogo </label><span class="fieldContent" style="display: none"><input id="AdjudgementLogo" name="AdjudgementLogo" title="" type="text" class="xsd_string textBox " maxlength="400" size="190" disabled="disabled" readonly="readonly" alt="" value=""><xsl:if test="boolean(./*[name() = 'AdjudgementLogo']/@isReadOnly = 'true')"><xsl:attribute name="readonly">readonly</xsl:attribute><xsl:attribute name="disabled">disabled</xsl:attribute></xsl:if><xsl:if test="./*[name() = 'AdjudgementLogo']"><xsl:attribute name="value"><xsl:value-of select="./*[name() = 'AdjudgementLogo']" /></xsl:attribute></xsl:if></input></span><div class="clear" /></div><div id="layoutCell7673" class="cell "><label class="fieldLabel" title="" for="ReferenceIdentifier" style="display: none">ReferenceIdentifier </label><span class="fieldContent" style="display: none"><input id="ReferenceIdentifier" name="ReferenceIdentifier" title="" type="text" class="xsd_string textBox " maxlength="2048" size="190" disabled="disabled" readonly="readonly" alt="" value=""><xsl:if test="boolean(./*[name() = 'ReferenceIdentifier']/@isReadOnly = 'true')"><xsl:attribute name="readonly">readonly</xsl:attribute><xsl:attribute name="disabled">disabled</xsl:attribute></xsl:if><xsl:if test="./*[name() = 'ReferenceIdentifier']"><xsl:attribute name="value"><xsl:value-of select="./*[name() = 'ReferenceIdentifier']" /></xsl:attribute></xsl:if></input></span><div class="clear" /></div></div><div class="clear" /></div></div></xsl:for-each><div id="buttonsPlaceholder"><input id="validateForm" type="button" class="button ui-button ui-widget ui-state-default ui-corner-all ui-button-text-only" value="Skontrolovať" alt="Skontrolovať" accesskey="S" /><input id="clearForm" type="button" class="button ui-button ui-widget ui-state-default ui-corner-all ui-button-text-only" value="Vyčisti" alt="Vyčisti" accesskey="V" /><input id="loadFormXml" type="button" class="button ui-button ui-widget ui-state-default ui-corner-all ui-button-text-only" value="Načítať" alt="Načítať" accesskey="N" /><input id="saveToXml" type="button" class="button ui-button ui-widget ui-state-default ui-corner-all ui-button-text-only" value="Uložiť" alt="Uložiť" accesskey="U" /><input id="cancelForm" type="button" class="button ui-button ui-widget ui-state-default ui-corner-all ui-button-text-only" value="Zrušiť" alt="Zrušiť" accesskey="Z" /></div></div><div id="statusDialog" title="Status"><img id="statusLoader" src="https://www.slovensko.sk/static/eForm/Designer/2.0.1.18/Images/ajax-loader.png" alt="Čakajte prosím" /><p id="statusMessage" class="statusMessage" /></div><div id="savedFormsContainer" class="layoutMain ui-widget-content" style="display:none"><div id="savedFormsContainerRow" class="layoutRow ui-tabs ui-widget-content" title=""><input type="hidden" name="Basic" /><div class="caption ui-widget-header"><div class="headercorrection" title="Uložené formuláre">Uložené formuláre</div><span class="arrow ui-icon ui-icon-carat-1-n" /></div><div id="layoutRowSavedForms" class="columns"><div id="lcolumnSavedForms" class="column first"><div id="lcellSavedForms" class="cell" /></div><div class="clear" /></div></div></div><div id="mtd_formMetaData" style="display:none"><span id="mtd_version">1.14</span><span id="mtd_idp">22004</span><span id="mtd_namespace">http://schemas.gov.sk/form/00326615.A9999999.000000404.ElektronickeRozhodnutie/1.14</span></div></form></body></html></xsl:template></xsl:stylesheet>