TagSpaces is an offline, open source, document manager with tagging support
- upgrading used js libraries to a newer versions
uggrock89521d862e86
diff --git a/data/about.html b/data/about.htmlindex 8523e36e8..6cee4394f 100644--- a/data/about.html+++ b/data/about.html@@ -9,13 +9,13 @@<title>TagSpaces Aboutbox</title><link rel="stylesheet" href="css/tagspaces.css"></head>-<body style="overflow: auto;">+<body><h1>Copyright</h1>Copyright (c) 2012 The Tagspaces Authors. All rights reserved. Use of this source code is governed by a AGPL3 license that can be found in the LICENSE file.<h1>About</h1><h1>Credits</h1><h2>jQuery - <a href="http://jquery.com" target="_new">Homepage</a> <a href="libs/jquery/MIT-LICENSE.txt">License</a></h2>-<h2>jQueryUI - <a href="http://jqueryui.com" target="_new">Homepage</a> <a href="libs/jquery/MIT-LICENSE.txt">License</a></h2>+<h2>jQueryUI - <a href="http://jqueryui.com" target="_new">Homepage</a> <a href="libs/jqueryui/MIT-LICENSE.txt">License</a></h2><h2>jQuery Layout - <a href="http://layout.jquery-dev.net" target="_new">Homepage</a> <a href="libs/jquerylayout/MIT-LICENSE.txt">License</a></h2><h2>DataTables - <a href="http://datatables.net/" target="_new">Homepage</a> <a href="libs/datatables/license-bsd.txt">License</a></h2><h2>Dynatree - <a href="http://code.google.com/p/dynatree/" target="_new">Homepage</a> <a href="libs/dynatree/MIT-License.txt">License</a></h2>diff --git a/data/index.html b/data/index.htmlindex e2d9a9dd7..a683124fc 100644--- a/data/index.html+++ b/data/index.html@@ -10,20 +10,20 @@<link rel="shortcut icon" type="image/x-icon" href="icons/icon16.png"><title>TagSpaces</title>- <link rel="stylesheet" type="text/css" href="libs/jquery/custom-theme/jquery-ui-1.9.1.custom.css">+ <link rel="stylesheet" type="text/css" href="libs/jqueryui/custom-theme/jquery-ui-1.9.1.custom.css"><link rel="stylesheet" type="text/css" href="libs/jquerylayout/layout-default-latest.css"><link rel="stylesheet" type="text/css" href="libs/dynatree/skin-vista/ui.dynatree.css"><link rel="stylesheet" type="text/css" href="libs/jsoneditor/jsoneditor.css">- <link rel="stylesheet" type="text/css" href="libs/datatables/jquery.dataTables.css">+ <link rel="stylesheet" type="text/css" href="libs/datatables/css/jquery.dataTables.css"><link rel="stylesheet/less" type="text/css" href="css/tagspaces.less"><script type="text/javascript" src="libs/less/less-1.3.1.min.js"></script>- <script type="text/javascript" src="libs/jquery/jquery-1.8.2.js"></script>- <script type="text/javascript" src="libs/jquery/jquery-ui-1.9.1.custom.js"></script>- <script type="text/javascript" src="libs/jquerylayout/jquery.layout-latest.js"></script>- <script type="text/javascript" src="libs/dynatree/jquery.dynatree-1.2.2.js"></script>+ <script type="text/javascript" src="libs/jquery/jquery-1.8.3.min.js"></script>+ <script type="text/javascript" src="libs/jqueryui/jquery-ui-1.9.2.custom.min.js"></script>+ <script type="text/javascript" src="libs/jquerylayout/jquery.layout-latest.min.js"></script>+ <script type="text/javascript" src="libs/dynatree/jquery.dynatree.min.js"></script><script type="text/javascript" src="libs/jsoneditor/jsoneditor.js"></script>- <script type="text/javascript" src="libs/datatables/jquery.dataTables.js"></script>+ <script type="text/javascript" src="libs/datatables/js/jquery.dataTables.min.js"></script><script type="text/javascript" data-main="loader" src="libs/requirejs/require.js"></script></head><body>diff --git a/data/libs/datatables/Sorting icons.psd b/data/libs/datatables/Sorting icons.psddeleted file mode 100644index 53b2e0685..000000000Binary files a/data/libs/datatables/Sorting icons.psd and /dev/null differdiff --git a/data/libs/datatables/jquery.dataTables.css b/data/libs/datatables/css/jquery.dataTables.csssimilarity index 76%rename from data/libs/datatables/jquery.dataTables.cssrename to data/libs/datatables/css/jquery.dataTables.cssindex 4d8ba8474..7da7faec8 100644--- a/data/libs/datatables/jquery.dataTables.css+++ b/data/libs/datatables/css/jquery.dataTables.css@@ -124,13 +124,13 @@ table.dataTable tr.even td.sorting_3 { background-color: #F9F9FF; }margin-left: 10px;}-.paginate_enabled_previous { background: url('back_enabled.png') no-repeat top left; }-.paginate_enabled_previous:hover { background: url('back_enabled_hover.png') no-repeat top left; }-.paginate_disabled_previous { background: url('back_disabled.png') no-repeat top left; }+.paginate_enabled_previous { background: url('../images/back_enabled.png') no-repeat top left; }+.paginate_enabled_previous:hover { background: url('../images/back_enabled_hover.png') no-repeat top left; }+.paginate_disabled_previous { background: url('../images/back_disabled.png') no-repeat top left; }-.paginate_enabled_next { background: url('forward_enabled.png') no-repeat top right; }-.paginate_enabled_next:hover { background: url('forward_enabled_hover.png') no-repeat top right; }-.paginate_disabled_next { background: url('forward_disabled.png') no-repeat top right; }+.paginate_enabled_next { background: url('../images/forward_enabled.png') no-repeat top right; }+.paginate_enabled_next:hover { background: url('../images/forward_enabled_hover.png') no-repeat top right; }+.paginate_disabled_next { background: url('../images/forward_disabled.png') no-repeat top right; }/* Full number pagination */.paging_full_numbers {@@ -194,12 +194,12 @@ table.dataTable tr.even td.sorting_3 { background-color: #F9F9FF; }/** Sorting*/-.sorting { background: url('sort_both.png') no-repeat center right; }-.sorting_asc { background: url('sort_asc.png') no-repeat center right; }-.sorting_desc { background: url('sort_desc.png') no-repeat center right; }+.sorting { background: url('../images/sort_both.png') no-repeat center right; }+.sorting_asc { background: url('../images/sort_asc.png') no-repeat center right; }+.sorting_desc { background: url('../images/sort_desc.png') no-repeat center right; }-.sorting_asc_disabled { background: url('sort_asc_disabled.png') no-repeat center right; }-.sorting_desc_disabled { background: url('sort_desc_disabled.png') no-repeat center right; }+.sorting_asc_disabled { background: url('../images/sort_asc_disabled.png') no-repeat center right; }+.sorting_desc_disabled { background: url('../images/sort_desc_disabled.png') no-repeat center right; }table.dataTable thead th:active,table.dataTable thead td:active {diff --git a/data/libs/datatables/demo_page.css b/data/libs/datatables/demo_page.cssdeleted file mode 100644index ba5b2a6c3..000000000--- a/data/libs/datatables/demo_page.css+++ /dev/null@@ -1,122 +0,0 @@--/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *- * General page setup- */-#dt_example {- font: 80%/1.45em "Lucida Grande", Verdana, Arial, Helvetica, sans-serif;- margin: 0;- padding: 0;- color: #333;- background-color: #fff;-}---#dt_example #container {- width: 800px;- margin: 30px auto;- padding: 0;-}---#dt_example #footer {- margin: 50px auto 0 auto;- padding: 0;-}--#dt_example #demo {- margin: 30px auto 0 auto;-}--#dt_example .demo_jui {- margin: 30px auto 0 auto;-}--#dt_example .big {- font-size: 1.3em;- font-weight: bold;- line-height: 1.6em;- color: #4E6CA3;-}--#dt_example .spacer {- height: 20px;- clear: both;-}--#dt_example .clear {- clear: both;-}--#dt_example pre {- padding: 15px;- background-color: #F5F5F5;- border: 1px solid #CCCCCC;-}--#dt_example h1 {- margin-top: 2em;- font-size: 1.3em;- font-weight: normal;- line-height: 1.6em;- color: #4E6CA3;- border-bottom: 1px solid #B0BED9;- clear: both;-}--#dt_example h2 {- font-size: 1.2em;- font-weight: normal;- line-height: 1.6em;- color: #4E6CA3;- clear: both;-}--#dt_example a {- color: #0063DC;- text-decoration: none;-}--#dt_example a:hover {- text-decoration: underline;-}--#dt_example ul {- color: #4E6CA3;-}--.css_right {- float: right;-}--.css_left {- float: left;-}--.demo_links {- float: left;- width: 50%;- margin-bottom: 1em;-}--#demo_info {- padding: 5px;- border: 1px solid #B0BED9;- height: 100px;- width: 100%;- overflow: auto;-}--#dt_example code {- font-family: Menlo, Monaco, Consolas, "Courier New", monospace;- padding: 2px 4px !important;- white-space: nowrap;- font-size: 0.9em;-- color: #D14;- background-color: #F7F7F9;-- border: 1px solid #E1E1E8;- -webkit-border-radius: 3px;- -moz-border-radius: 3px;- border-radius: 3px;-}diff --git a/data/libs/datatables/demo_table.css b/data/libs/datatables/demo_table.cssdeleted file mode 100644index 12f352dac..000000000--- a/data/libs/datatables/demo_table.css+++ /dev/null@@ -1,577 +0,0 @@-/*- * File: demo_table.css- * CVS: $Id$- * Description: CSS descriptions for DataTables demo pages- * Author: Allan Jardine- * Created: Tue May 12 06:47:22 BST 2009- * Modified: $Date$ by $Author$- * Language: CSS- * Project: DataTables- *- * Copyright 2009 Allan Jardine. All Rights Reserved.- *- * ***************************************************************************- * DESCRIPTION- *- * The styles given here are suitable for the demos that are used with the standard DataTables- * distribution (see www.datatables.net). You will most likely wish to modify these styles to- * meet the layout requirements of your site.- *- * Common issues:- * 'full_numbers' pagination - I use an extra selector on the body tag to ensure that there is- * no conflict between the two pagination types. If you want to use full_numbers pagination- * ensure that you either have "example_alt_pagination" as a body class name, or better yet,- * modify that selector.- * Note that the path used for Images is relative. All images are by default located in- * ../images/ - relative to this CSS file.- */--/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *- * DataTables features- */--.dataTables_wrapper {- position: relative;- clear: both;- zoom: 1; /* Feeling sorry for IE */-}--.dataTables_processing {- position: absolute;- top: 50%;- left: 50%;- width: 250px;- height: 30px;- margin-left: -125px;- margin-top: -15px;- padding: 14px 0 2px 0;- border: 1px solid #ddd;- text-align: center;- color: #999;- font-size: 14px;- background-color: white;-}--.dataTables_length {- width: 40%;- float: left;-}--.dataTables_filter {- width: 50%;- float: right;- text-align: right;-}--.dataTables_info {- width: 60%;- float: left;-}--.dataTables_paginate {- float: right;- text-align: right;-}--/* Pagination nested */-.paginate_disabled_previous, .paginate_enabled_previous,-.paginate_disabled_next, .paginate_enabled_next {- height: 19px;- float: left;- cursor: pointer;- *cursor: hand;- color: #111 !important;-}-.paginate_disabled_previous:hover, .paginate_enabled_previous:hover,-.paginate_disabled_next:hover, .paginate_enabled_next:hover {- text-decoration: none !important;-}-.paginate_disabled_previous:active, .paginate_enabled_previous:active,-.paginate_disabled_next:active, .paginate_enabled_next:active {- outline: none;-}--.paginate_disabled_previous,-.paginate_disabled_next {- color: #666 !important;-}-.paginate_disabled_previous, .paginate_enabled_previous {- padding-left: 23px;-}-.paginate_disabled_next, .paginate_enabled_next {- padding-right: 23px;- margin-left: 10px;-}--.paginate_disabled_previous {- background: url('../images/back_disabled.png') no-repeat top left;-}--.paginate_enabled_previous {- background: url('../images/back_enabled.png') no-repeat top left;-}-.paginate_enabled_previous:hover {- background: url('../images/back_enabled_hover.png') no-repeat top left;-}--.paginate_disabled_next {- background: url('../images/forward_disabled.png') no-repeat top right;-}--.paginate_enabled_next {- background: url('../images/forward_enabled.png') no-repeat top right;-}-.paginate_enabled_next:hover {- background: url('../images/forward_enabled_hover.png') no-repeat top right;-}----/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *- * DataTables display- */-table.display {- margin: 0 auto;- clear: both;- width: 100%;-- /* Note Firefox 3.5 and before have a bug with border-collapse- * ( https://bugzilla.mozilla.org/show%5Fbug.cgi?id=155955 )- * border-spacing: 0; is one possible option. Conditional-css.com is- * useful for this kind of thing- *- * Further note IE 6/7 has problems when calculating widths with border width.- * It subtracts one px relative to the other browsers from the first column, and- * adds one to the end...- *- * If you want that effect I'd suggest setting a border-top/left on th/td's and- * then filling in the gaps with other borders.- */-}--table.display thead th {- padding: 3px 18px 3px 10px;- border-bottom: 1px solid black;- font-weight: bold;- cursor: pointer;- * cursor: hand;-}--table.display tfoot th {- padding: 3px 18px 3px 10px;- border-top: 1px solid black;- font-weight: bold;-}--table.display tr.heading2 td {- border-bottom: 1px solid #aaa;-}--table.display td {- padding: 3px 10px;-}--table.display td.center {- text-align: center;-}----/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *- * DataTables sorting- */--.sorting_asc {- background: url('../images/sort_asc.png') no-repeat center right;-}--.sorting_desc {- background: url('../images/sort_desc.png') no-repeat center right;-}--.sorting {- background: url('../images/sort_both.png') no-repeat center right;-}--.sorting_asc_disabled {- background: url('../images/sort_asc_disabled.png') no-repeat center right;-}--.sorting_desc_disabled {- background: url('../images/sort_desc_disabled.png') no-repeat center right;-}--table.display thead th:active,-table.display thead td:active {- outline: none;-}-----/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *- * DataTables row classes- */-table.display tr.odd.gradeA {- background-color: #ddffdd;-}--table.display tr.even.gradeA {- background-color: #eeffee;-}--table.display tr.odd.gradeC {- background-color: #ddddff;-}--table.display tr.even.gradeC {- background-color: #eeeeff;-}--table.display tr.odd.gradeX {- background-color: #ffdddd;-}--table.display tr.even.gradeX {- background-color: #ffeeee;-}--table.display tr.odd.gradeU {- background-color: #ddd;-}--table.display tr.even.gradeU {- background-color: #eee;-}---tr.odd {- background-color: #E2E4FF;-}--tr.even {- background-color: white;-}------/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *- * Misc- */-.dataTables_scroll {- clear: both;-}--.dataTables_scrollBody {- *margin-top: -1px;- -webkit-overflow-scrolling: touch;-}--.top, .bottom {- padding: 15px;- background-color: #F5F5F5;- border: 1px solid #CCCCCC;-}--.top .dataTables_info {- float: none;-}--.clear {- clear: both;-}--.dataTables_empty {- text-align: center;-}--tfoot input {- margin: 0.5em 0;- width: 100%;- color: #444;-}--tfoot input.search_init {- color: #999;-}--td.group {- background-color: #d1cfd0;- border-bottom: 2px solid #A19B9E;- border-top: 2px solid #A19B9E;-}--td.details {- background-color: #d1cfd0;- border: 2px solid #A19B9E;-}---.example_alt_pagination div.dataTables_info {- width: 40%;-}--.paging_full_numbers {- width: 400px;- height: 22px;- line-height: 22px;-}--.paging_full_numbers a:active {- outline: none-}--.paging_full_numbers a:hover {- text-decoration: none;-}--.paging_full_numbers a.paginate_button,- .paging_full_numbers a.paginate_active {- border: 1px solid #aaa;- -webkit-border-radius: 5px;- -moz-border-radius: 5px;- padding: 2px 5px;- margin: 0 3px;- cursor: pointer;- *cursor: hand;- color: #333 !important;-}--.paging_full_numbers a.paginate_button {- background-color: #ddd;-}--.paging_full_numbers a.paginate_button:hover {- background-color: #ccc;- text-decoration: none !important;-}--.paging_full_numbers a.paginate_active {- background-color: #99B3FF;-}--table.display tr.even.row_selected td {- background-color: #B0BED9;-}--table.display tr.odd.row_selected td {- background-color: #9FAFD1;-}---/*- * Sorting classes for columns- */-/* For the standard odd/even */-tr.odd td.sorting_1 {- background-color: #D3D6FF;-}--tr.odd td.sorting_2 {- background-color: #DADCFF;-}--tr.odd td.sorting_3 {- background-color: #E0E2FF;-}--tr.even td.sorting_1 {- background-color: #EAEBFF;-}--tr.even td.sorting_2 {- background-color: #F2F3FF;-}--tr.even td.sorting_3 {- background-color: #F9F9FF;-}---/* For the Conditional-CSS grading rows */-/*- Colour calculations (based off the main row colours)- Level 1:- dd > c4- ee > d5- Level 2:- dd > d1- ee > e2- */-tr.odd.gradeA td.sorting_1 {- background-color: #c4ffc4;-}--tr.odd.gradeA td.sorting_2 {- background-color: #d1ffd1;-}--tr.odd.gradeA td.sorting_3 {- background-color: #d1ffd1;-}--tr.even.gradeA td.sorting_1 {- background-color: #d5ffd5;-}--tr.even.gradeA td.sorting_2 {- background-color: #e2ffe2;-}--tr.even.gradeA td.sorting_3 {- background-color: #e2ffe2;-}--tr.odd.gradeC td.sorting_1 {- background-color: #c4c4ff;-}--tr.odd.gradeC td.sorting_2 {- background-color: #d1d1ff;-}--tr.odd.gradeC td.sorting_3 {- background-color: #d1d1ff;-}--tr.even.gradeC td.sorting_1 {- background-color: #d5d5ff;-}--tr.even.gradeC td.sorting_2 {- background-color: #e2e2ff;-}--tr.even.gradeC td.sorting_3 {- background-color: #e2e2ff;-}--tr.odd.gradeX td.sorting_1 {- background-color: #ffc4c4;-}--tr.odd.gradeX td.sorting_2 {- background-color: #ffd1d1;-}--tr.odd.gradeX td.sorting_3 {- background-color: #ffd1d1;-}--tr.even.gradeX td.sorting_1 {- background-color: #ffd5d5;-}--tr.even.gradeX td.sorting_2 {- background-color: #ffe2e2;-}--tr.even.gradeX td.sorting_3 {- background-color: #ffe2e2;-}--tr.odd.gradeU td.sorting_1 {- background-color: #c4c4c4;-}--tr.odd.gradeU td.sorting_2 {- background-color: #d1d1d1;-}--tr.odd.gradeU td.sorting_3 {- background-color: #d1d1d1;-}--tr.even.gradeU td.sorting_1 {- background-color: #d5d5d5;-}--tr.even.gradeU td.sorting_2 {- background-color: #e2e2e2;-}--tr.even.gradeU td.sorting_3 {- background-color: #e2e2e2;-}---/*- * Row highlighting example- */-.ex_highlight #example tbody tr.even:hover, #example tbody tr.even td.highlighted {- background-color: #ECFFB3;-}--.ex_highlight #example tbody tr.odd:hover, #example tbody tr.odd td.highlighted {- background-color: #E6FF99;-}--.ex_highlight_row #example tr.even:hover {- background-color: #ECFFB3;-}--.ex_highlight_row #example tr.even:hover td.sorting_1 {- background-color: #DDFF75;-}--.ex_highlight_row #example tr.even:hover td.sorting_2 {- background-color: #E7FF9E;-}--.ex_highlight_row #example tr.even:hover td.sorting_3 {- background-color: #E2FF89;-}--.ex_highlight_row #example tr.odd:hover {- background-color: #E6FF99;-}--.ex_highlight_row #example tr.odd:hover td.sorting_1 {- background-color: #D6FF5C;-}--.ex_highlight_row #example tr.odd:hover td.sorting_2 {- background-color: #E0FF84;-}--.ex_highlight_row #example tr.odd:hover td.sorting_3 {- background-color: #DBFF70;-}---/*- * KeyTable- */-table.KeyTable td {- border: 3px solid transparent;-}--table.KeyTable td.focus {- border: 3px solid #3366FF;-}--table.display tr.gradeA {- background-color: #eeffee;-}--table.display tr.gradeC {- background-color: #ddddff;-}--table.display tr.gradeX {- background-color: #ffdddd;-}--table.display tr.gradeU {- background-color: #ddd;-}--div.box {- height: 100px;- padding: 10px;- overflow: auto;- border: 1px solid #8080FF;- background-color: #E5E5FF;-}diff --git a/data/libs/datatables/demo_table_jui.css b/data/libs/datatables/demo_table_jui.cssdeleted file mode 100644index a210af51a..000000000--- a/data/libs/datatables/demo_table_jui.css+++ /dev/null@@ -1,501 +0,0 @@-/*- * File: demo_table_jui.css- * CVS: $Id$- * Description: CSS descriptions for DataTables demo pages- * Author: Allan Jardine- * Created: Tue May 12 06:47:22 BST 2009- * Modified: $Date$ by $Author$- * Language: CSS- * Project: DataTables- *- * Copyright 2009 Allan Jardine. All Rights Reserved.- *- * ***************************************************************************- * DESCRIPTION- *- * The styles given here are suitable for the demos that are used with the standard DataTables- * distribution (see www.datatables.net). You will most likely wish to modify these styles to- * meet the layout requirements of your site.- *- * Common issues:- * 'full_numbers' pagination - I use an extra selector on the body tag to ensure that there is- * no conflict between the two pagination types. If you want to use full_numbers pagination- * ensure that you either have "example_alt_pagination" as a body class name, or better yet,- * modify that selector.- * Note that the path used for Images is relative. All images are by default located in- * ../images/ - relative to this CSS file.- */---/*- * jQuery UI specific styling- */--.paging_two_button .ui-button {- float: left;- cursor: pointer;- * cursor: hand;-}--.paging_full_numbers .ui-button {- padding: 2px 6px;- margin: 0;- cursor: pointer;- * cursor: hand;- color: #333 !important;-}--.dataTables_paginate .ui-button {- margin-right: -0.1em !important;-}--.paging_full_numbers {- width: 350px !important;-}--.dataTables_wrapper .ui-toolbar {- padding: 5px;-}--.dataTables_paginate {- width: auto;-}--.dataTables_info {- padding-top: 3px;-}--table.display thead th {- padding: 3px 0px 3px 10px;- cursor: pointer;- * cursor: hand;-}--div.dataTables_wrapper .ui-widget-header {- font-weight: normal;-}---/*- * Sort arrow icon positioning- */-table.display thead th div.DataTables_sort_wrapper {- position: relative;- padding-right: 20px;-}--table.display thead th div.DataTables_sort_wrapper span {- position: absolute;- top: 50%;- margin-top: -8px;- right: 0;-}-----/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *- *- * Everything below this line is the same as demo_table.css. This file is- * required for 'cleanliness' of the markup- *- * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */----/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *- * DataTables features- */--.dataTables_wrapper {- position: relative;- clear: both;-}--.dataTables_processing {- position: absolute;- top: 0px;- left: 50%;- width: 250px;- margin-left: -125px;- border: 1px solid #ddd;- text-align: center;- color: #999;- font-size: 11px;- padding: 2px 0;-}--.dataTables_length {- width: 40%;- float: left;-}--.dataTables_filter {- width: 50%;- float: right;- text-align: right;-}--.dataTables_info {- width: 50%;- float: left;-}--.dataTables_paginate {- float: right;- text-align: right;-}----/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *- * DataTables display- */-table.display {- margin: 0 auto;- width: 100%;- clear: both;- border-collapse: collapse;-}--table.display tfoot th {- padding: 3px 0px 3px 10px;- font-weight: bold;- font-weight: normal;-}--table.display tr.heading2 td {- border-bottom: 1px solid #aaa;-}--table.display td {- padding: 3px 10px;-}--table.display td.center {- text-align: center;-}----/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *- * DataTables sorting- */--.sorting_asc {- background: url('../images/sort_asc.png') no-repeat center right;-}--.sorting_desc {- background: url('../images/sort_desc.png') no-repeat center right;-}--.sorting {- background: url('../images/sort_both.png') no-repeat center right;-}--.sorting_asc_disabled {- background: url('../images/sort_asc_disabled.png') no-repeat center right;-}--.sorting_desc_disabled {- background: url('../images/sort_desc_disabled.png') no-repeat center right;-}-----/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *- * DataTables row classes- */-table.display tr.odd.gradeA {- background-color: #ddffdd;-}--table.display tr.even.gradeA {- background-color: #eeffee;-}-----table.display tr.odd.gradeA {- background-color: #ddffdd;-}--table.display tr.even.gradeA {- background-color: #eeffee;-}--table.display tr.odd.gradeC {- background-color: #ddddff;-}--table.display tr.even.gradeC {- background-color: #eeeeff;-}--table.display tr.odd.gradeX {- background-color: #ffdddd;-}--table.display tr.even.gradeX {- background-color: #ffeeee;-}--table.display tr.odd.gradeU {- background-color: #ddd;-}--table.display tr.even.gradeU {- background-color: #eee;-}---tr.odd {- background-color: #E2E4FF;-}--tr.even {- background-color: white;-}------/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *- * Misc- */-.dataTables_scroll {- clear: both;-}--.dataTables_scrollBody {- -webkit-overflow-scrolling: touch;-}--.top, .bottom {- padding: 15px;- background-color: #F5F5F5;- border: 1px solid #CCCCCC;-}--.top .dataTables_info {- float: none;-}--.clear {- clear: both;-}--.dataTables_empty {- text-align: center;-}--tfoot input {- margin: 0.5em 0;- width: 100%;- color: #444;-}--tfoot input.search_init {- color: #999;-}--td.group {- background-color: #d1cfd0;- border-bottom: 2px solid #A19B9E;- border-top: 2px solid #A19B9E;-}--td.details {- background-color: #d1cfd0;- border: 2px solid #A19B9E;-}---.example_alt_pagination div.dataTables_info {- width: 40%;-}--.paging_full_numbers a.paginate_button,- .paging_full_numbers a.paginate_active {- border: 1px solid #aaa;- -webkit-border-radius: 5px;- -moz-border-radius: 5px;- padding: 2px 5px;- margin: 0 3px;- cursor: pointer;- *cursor: hand;- color: #333 !important;-}--.paging_full_numbers a.paginate_button {- background-color: #ddd;-}--.paging_full_numbers a.paginate_button:hover {- background-color: #ccc;- text-decoration: none !important;-}--.paging_full_numbers a.paginate_active {- background-color: #99B3FF;-}--table.display tr.even.row_selected td {- background-color: #B0BED9;-}--table.display tr.odd.row_selected td {- background-color: #9FAFD1;-}---/*- * Sorting classes for columns- */-/* For the standard odd/even */-tr.odd td.sorting_1 {- background-color: #D3D6FF;-}--tr.odd td.sorting_2 {- background-color: #DADCFF;-}--tr.odd td.sorting_3 {- background-color: #E0E2FF;-}--tr.even td.sorting_1 {- background-color: #EAEBFF;-}--tr.even td.sorting_2 {- background-color: #F2F3FF;-}--tr.even td.sorting_3 {- background-color: #F9F9FF;-}---/* For the Conditional-CSS grading rows */-/*- Colour calculations (based off the main row colours)- Level 1:- dd > c4- ee > d5- Level 2:- dd > d1- ee > e2- */-tr.odd.gradeA td.sorting_1 {- background-color: #c4ffc4;-}--tr.odd.gradeA td.sorting_2 {- background-color: #d1ffd1;-}--tr.odd.gradeA td.sorting_3 {- background-color: #d1ffd1;-}--tr.even.gradeA td.sorting_1 {- background-color: #d5ffd5;-}--tr.even.gradeA td.sorting_2 {- background-color: #e2ffe2;-}--tr.even.gradeA td.sorting_3 {- background-color: #e2ffe2;-}--tr.odd.gradeC td.sorting_1 {- background-color: #c4c4ff;-}--tr.odd.gradeC td.sorting_2 {- background-color: #d1d1ff;-}--tr.odd.gradeC td.sorting_3 {- background-color: #d1d1ff;-}--tr.even.gradeC td.sorting_1 {- background-color: #d5d5ff;-}--tr.even.gradeC td.sorting_2 {- background-color: #e2e2ff;-}--tr.even.gradeC td.sorting_3 {- background-color: #e2e2ff;-}--tr.odd.gradeX td.sorting_1 {- background-color: #ffc4c4;-}--tr.odd.gradeX td.sorting_2 {- background-color: #ffd1d1;-}--tr.odd.gradeX td.sorting_3 {- background-color: #ffd1d1;-}--tr.even.gradeX td.sorting_1 {- background-color: #ffd5d5;-}--tr.even.gradeX td.sorting_2 {- background-color: #ffe2e2;-}--tr.even.gradeX td.sorting_3 {- background-color: #ffe2e2;-}--tr.odd.gradeU td.sorting_1 {- background-color: #c4c4c4;-}--tr.odd.gradeU td.sorting_2 {- background-color: #d1d1d1;-}--tr.odd.gradeU td.sorting_3 {- background-color: #d1d1d1;-}--tr.even.gradeU td.sorting_1 {- background-color: #d5d5d5;-}--tr.even.gradeU td.sorting_2 {- background-color: #e2e2e2;-}--tr.even.gradeU td.sorting_3 {- background-color: #e2e2e2;-}---/*- * Row highlighting example- */-.ex_highlight #example tbody tr.even:hover, #example tbody tr.even td.highlighted {- background-color: #ECFFB3;-}--.ex_highlight #example tbody tr.odd:hover, #example tbody tr.odd td.highlighted {- background-color: #E6FF99;-}\ No newline at end of filediff --git a/data/libs/datatables/back_disabled.png b/data/libs/datatables/images/back_disabled.pngsimilarity index 100%rename from data/libs/datatables/back_disabled.pngrename to data/libs/datatables/images/back_disabled.pngdiff --git a/data/libs/datatables/back_enabled.png b/data/libs/datatables/images/back_enabled.pngsimilarity index 100%rename from data/libs/datatables/back_enabled.pngrename to data/libs/datatables/images/back_enabled.pngdiff --git a/data/libs/datatables/back_enabled_hover.png b/data/libs/datatables/images/back_enabled_hover.pngsimilarity index 100%rename from data/libs/datatables/back_enabled_hover.pngrename to data/libs/datatables/images/back_enabled_hover.pngdiff --git a/data/libs/datatables/forward_disabled.png b/data/libs/datatables/images/forward_disabled.pngsimilarity index 100%rename from data/libs/datatables/forward_disabled.pngrename to data/libs/datatables/images/forward_disabled.pngdiff --git a/data/libs/datatables/forward_enabled.png b/data/libs/datatables/images/forward_enabled.pngsimilarity index 100%rename from data/libs/datatables/forward_enabled.pngrename to data/libs/datatables/images/forward_enabled.pngdiff --git a/data/libs/datatables/forward_enabled_hover.png b/data/libs/datatables/images/forward_enabled_hover.pngsimilarity index 100%rename from data/libs/datatables/forward_enabled_hover.pngrename to data/libs/datatables/images/forward_enabled_hover.pngdiff --git a/data/libs/datatables/sort_asc.png b/data/libs/datatables/images/sort_asc.pngsimilarity index 100%rename from data/libs/datatables/sort_asc.pngrename to data/libs/datatables/images/sort_asc.pngdiff --git a/data/libs/datatables/sort_asc_disabled.png b/data/libs/datatables/images/sort_asc_disabled.pngsimilarity index 100%rename from data/libs/datatables/sort_asc_disabled.pngrename to data/libs/datatables/images/sort_asc_disabled.pngdiff --git a/data/libs/datatables/sort_both.png b/data/libs/datatables/images/sort_both.pngsimilarity index 100%rename from data/libs/datatables/sort_both.pngrename to data/libs/datatables/images/sort_both.pngdiff --git a/data/libs/datatables/sort_desc.png b/data/libs/datatables/images/sort_desc.pngsimilarity index 100%rename from data/libs/datatables/sort_desc.pngrename to data/libs/datatables/images/sort_desc.pngdiff --git a/data/libs/datatables/sort_desc_disabled.png b/data/libs/datatables/images/sort_desc_disabled.pngsimilarity index 100%rename from data/libs/datatables/sort_desc_disabled.pngrename to data/libs/datatables/images/sort_desc_disabled.pngdiff --git a/data/libs/datatables/jquery.dataTables.js b/data/libs/datatables/jquery.dataTables.jsdeleted file mode 100644index 0ad7c54a2..000000000--- a/data/libs/datatables/jquery.dataTables.js+++ /dev/null@@ -1,12209 +0,0 @@-/**- * @summary DataTables- * @description Paginate, search and sort HTML tables- * @version 1.10.0.dev- * @file jquery.dataTables.js- * @author Allan Jardine (www.sprymedia.co.uk)- * @contact www.sprymedia.co.uk/contact- *- * @copyright Copyright 2008-2012 Allan Jardine, all rights reserved.- *- * This source file is free software, under either the GPL v2 license or a- * BSD style license, available at:- * http://datatables.net/license_gpl2- * http://datatables.net/license_bsd- *- * 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- */--/*jslint evil: true, undef: true, browser: true */-/*globals $, jQuery,define,_fnExternApiFunc,_fnInitialise,_fnInitComplete,_fnLanguageCompat,_fnAddColumn,_fnColumnOptions,_fnAddData,_fnCreateTr,_fnGatherData,_fnBuildHead,_fnDrawHead,_fnDraw,_fnReDraw,_fnAjaxUpdate,_fnAjaxParameters,_fnAjaxUpdateDraw,_fnServerParams,_fnAddOptionsHtml,_fnFeatureHtmlTable,_fnScrollDraw,_fnAdjustColumnSizing,_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,_fnDetectType,_fnSettingsFromNode,_fnGetDataMaster,_fnGetTrNodes,_fnGetTdNodes,_fnEscapeRegex,_fnDeleteIndex,_fnColumnOrdering,_fnLog,_fnClearTable,_fnSaveState,_fnLoadState,_fnCreateCookie,_fnReadCookie,_fnDetectHeader,_fnGetUniqueThs,_fnScrollBarWidth,_fnApplyToChildren,_fnMap,_fnGetRowData,_fnGetCellData,_fnSetCellData,_fnGetObjectDataFn,_fnSetObjectDataFn,_fnApplyColumnDefs,_fnBindAction,_fnCallbackReg,_fnCallbackFire,_fnJsonString,_fnNodeToColumnIndex,_fnInfoMacros,_fnBrowserDetect,_fnGetColumns,_fnHungarianMap,_fnCamelToHungarian*/--(/** @lends <global> */function( window, document, undefined ) {--(function( factory ) {- "use strict";-- // Define as an AMD module if possible- if ( typeof define === 'function' && define.amd )- {- define( ['jquery'], factory );- }- /* Define using browser globals otherwise- * Prevent multiple instantiations if the script is loaded twice- */- else if ( jQuery && !jQuery.fn.dataTable )- {- factory( jQuery );- }-}-(/** @lends <global> */function( $ ) {- "use strict";-- /**- * DataTables is a plug-in for the jQuery Javascript library. It is a- * highly flexible tool, based upon the foundations of progressive- * enhancement, which will add advanced interaction controls to any- * HTML table. For a full list of features please refer to- * <a href="http://datatables.net">DataTables.net</a>.- *- * Note that the <i>DataTable</i> object is not a global variable but is- * aliased to <i>jQuery.fn.DataTable</i> and <i>jQuery.fn.dataTable</i> through which- * it may be accessed.- *- * @class- * @param {object} [oInit={}] Configuration object for DataTables. Options- * are defined by {@link DataTable.defaults}- * @requires jQuery 1.3+- *- * @example- * // Basic initialisation- * $(document).ready( function {- * $('#example').dataTable();- * } );- *- * @example- * // Initialisation with configuration options - in this case, disable- * // pagination and sorting.- * $(document).ready( function {- * $('#example').dataTable( {- * "bPaginate": false,- * "bSort": false- * } );- * } );- */- var DataTable;---- /**- * Create a mapping object that allows camel case parameters to be looked up- * for their Hungarian counterparts. The mapping is stored in a private- * parameter called `_hungaianMap` which can be accessed on the source object.- * @param {object} o- * @memberof DataTable#oApi- */- function _fnHungarianMap ( o )- {- var- hungarian = 'a aa ao as b fn i m o s ',- match,- newKey,- map = {};-- $.each( o, function (key, val) {- match = key.match(/^([^A-Z]+?)([A-Z])/);-- if ( match && hungarian.indexOf(match[1]+' ') !== -1 )- {- newKey = key.replace( match[0], match[2].toLowerCase() );- map[ newKey ] = key;-- if ( match[1] === 'o' )- {- _fnHungarianMap( o[key] );- }- }- } );-- o._hungaianMap = map;- }--- /**- * Convert from camel case parameters to Hungarian, based on a Hungarian map- * created by _fnHungarianMap.- * @param {object} src The model object which holds all parameters can has- * previously been run through `_fnHungarianMap`.- * @param {object} user The object to convert from camel case to Hungarian.- * @param {boolean} force When set to `true`, properties which already have a- * Hungarian value in the `user` object will be overwritten. Otherwise they- * won't be.- * @memberof DataTable#oApi- */- function _fnCamelToHungarian ( src, user, force )- {- if ( ! src._hungaianMap )- {- return;- }-- var hungarianKey;-- $.each( user, function (key, val) {- hungarianKey = src._hungaianMap[ key ];-- if ( hungarianKey !== undefined && (force || user[hungarianKey] === undefined) )- {- user[hungarianKey] = user[ key ];-- if ( hungarianKey.charAt(0) === 'o' )- {- _fnCamelToHungarian( src[hungarianKey], user[key] );- }- }- } );- }--- /**- * Language compatibility - when certain options are given, and others aren't, we- * need to duplicate the values over, in order to provide backwards compatibility- * with older language files.- * @param {object} oSettings dataTables settings object- * @memberof DataTable#oApi- */- function _fnLanguageCompat( oLanguage )- {- var oDefaults = DataTable.defaults.oLanguage;-- /* Backwards compatibility - if there is no sEmptyTable given, then use the same as- * sZeroRecords - assuming that is given.- */- if ( !oLanguage.sEmptyTable && oLanguage.sZeroRecords &&- oDefaults.sEmptyTable === "No data available in table" )- {- _fnMap( oLanguage, oLanguage, 'sZeroRecords', 'sEmptyTable' );- }-- /* Likewise with loading records */- if ( !oLanguage.sLoadingRecords && oLanguage.sZeroRecords &&- oDefaults.sLoadingRecords === "Loading..." )- {- _fnMap( oLanguage, oLanguage, 'sZeroRecords', 'sLoadingRecords' );- }- }---- /**- * Add a column to the list used for the table with default values- * @param {object} oSettings dataTables settings object- * @param {node} nTh The th element for this column- * @memberof DataTable#oApi- */- function _fnAddColumn( oSettings, nTh )- {- var oDefaults = DataTable.defaults.column;- var iCol = oSettings.aoColumns.length;- var oCol = $.extend( {}, DataTable.models.oColumn, oDefaults, {- "sSortingClass": oSettings.oClasses.sSortable,- "sSortingClassJUI": oSettings.oClasses.sSortJUI,- "nTh": nTh ? nTh : document.createElement('th'),- "sTitle": oDefaults.sTitle ? oDefaults.sTitle : nTh ? nTh.innerHTML : '',- "aDataSort": oDefaults.aDataSort ? oDefaults.aDataSort : [iCol],- "mData": oDefaults.mData ? oDefaults.oDefaults : iCol- } );- oSettings.aoColumns.push( oCol );-- /* Add a column specific filter */- if ( oSettings.aoPreSearchCols[ iCol ] === undefined || oSettings.aoPreSearchCols[ iCol ] === null )- {- oSettings.aoPreSearchCols[ iCol ] = $.extend( {}, DataTable.models.oSearch );- }- else- {- var oPre = oSettings.aoPreSearchCols[ iCol ];-- /* Don't require that the user must specify bRegex, bSmart or bCaseInsensitive */- if ( oPre.bRegex === undefined )- {- oPre.bRegex = true;- }-- if ( oPre.bSmart === undefined )- {- oPre.bSmart = true;- }-- if ( oPre.bCaseInsensitive === undefined )- {- oPre.bCaseInsensitive = true;- }- }-- /* Use the column options function to initialise classes etc */- _fnColumnOptions( oSettings, iCol, null );- }--- /**- * Apply options for a column- * @param {object} oSettings dataTables settings object- * @param {int} iCol column index to consider- * @param {object} oOptions object with sType, bVisible and bSearchable etc- * @memberof DataTable#oApi- */- function _fnColumnOptions( oSettings, iCol, oOptions )- {- var oCol = oSettings.aoColumns[ iCol ];-- /* User specified column options */- if ( oOptions !== undefined && oOptions !== null )- {- // Map camel case parameters to their Hungarian counterparts- _fnCamelToHungarian( DataTable.defaults.column, oOptions );-- /* Backwards compatibility for mDataProp */- if ( oOptions.mDataProp && !oOptions.mData )- {- oOptions.mData = oOptions.mDataProp;- }-- if ( oOptions.sType !== undefined )- {- oCol.sType = oOptions.sType;- oCol._bAutoType = false;- }-- $.extend( oCol, oOptions );- _fnMap( oCol, oOptions, "sWidth", "sWidthOrig" );-- /* iDataSort to be applied (backwards compatibility), but aDataSort will take- * priority if defined- */- if ( oOptions.iDataSort !== undefined )- {- oCol.aDataSort = [ oOptions.iDataSort ];- }- _fnMap( oCol, oOptions, "aDataSort" );- }-- /* Cache the data get and set functions for speed */- var mRender = oCol.mRender ? _fnGetObjectDataFn( oCol.mRender ) : null;- var mData = _fnGetObjectDataFn( oCol.mData );-- oCol.fnGetData = function (oData, sSpecific) {- var innerData = mData( oData, sSpecific );-- if ( oCol.mRender && (sSpecific && sSpecific !== '') )- {- return mRender( innerData, sSpecific, oData );- }- return innerData;- };- oCol.fnSetData = _fnSetObjectDataFn( oCol.mData );-- /* 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 ( $.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;- }- }--- /**- * Adjust the table column widths for new data. Note: you would probably want to- * do a redraw after calling this function!- * @param {object} oSettings dataTables settings object- * @memberof DataTable#oApi- */- function _fnAdjustColumnSizing ( oSettings )- {- /* Not interested in doing column width calculation if auto-width 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;- }- }--- /**- * Covert the index of a visible column to the index in the data array (take account- * of hidden columns)- * @param {object} oSettings dataTables settings object- * @param {int} iMatch Visible column index to lookup- * @returns {int} i the data index- * @memberof DataTable#oApi- */- function _fnVisibleToColumnIndex( oSettings, iMatch )- {- var aiVis = _fnGetColumns( oSettings, 'bVisible' );-- return typeof aiVis[iMatch] === 'number' ?- aiVis[iMatch] :- null;- }--- /**- * Covert the index of an index in the data array and convert it to the visible- * column index (take account of hidden columns)- * @param {int} iMatch Column index to lookup- * @param {object} oSettings dataTables settings object- * @returns {int} i the data index- * @memberof DataTable#oApi- */- function _fnColumnIndexToVisible( oSettings, iMatch )- {- var aiVis = _fnGetColumns( oSettings, 'bVisible' );- var iPos = $.inArray( iMatch, aiVis );-- return iPos !== -1 ? iPos : null;- }--- /**- * Get the number of visible columns- * @param {object} oSettings dataTables settings object- * @returns {int} i the number of visible columns- * @memberof DataTable#oApi- */- function _fnVisbleColumns( oSettings )- {- return _fnGetColumns( oSettings, 'bVisible' ).length;- }--- /**- * Get an array of column indexes that match a given property- * @param {object} oSettings dataTables settings object- * @param {string} sParam Parameter in aoColumns to look for - typically- * bVisible or bSearchable- * @returns {array} Array of indexes with matched properties- * @memberof DataTable#oApi- */- function _fnGetColumns( oSettings, sParam )- {- var a = [];-- $.map( oSettings.aoColumns, function(val, i) {- if ( val[sParam] ) {- a.push( i );- }- } );-- return a;- }--- /**- * Get the sort type based on an input string- * @param {string} sData data we wish to know the type of- * @returns {string} type (defaults to 'string' if no type can be detected)- * @memberof DataTable#oApi- */- function _fnDetectType( sData )- {- var aTypes = DataTable.ext.aTypes;- var iLen = aTypes.length;-- for ( var i=0 ; i<iLen ; i++ )- {- var sType = aTypes[i]( sData );- if ( sType !== null )- {- return sType;- }- }-- return 'string';- }--- /**- * Get the column ordering that DataTables expects- * @param {object} oSettings dataTables settings object- * @returns {string} comma separated list of names- * @memberof DataTable#oApi- */- 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);- }--- /**- * Take the column definitions and static columns arrays and calculate how- * they relate to column indexes. The callback function will then apply the- * definition found for a column to a suitable configuration object.- * @param {object} oSettings dataTables settings object- * @param {array} aoColDefs The aoColumnDefs array that is to be applied- * @param {array} aoCols The aoColumns array that defines columns individually- * @param {function} fn Callback function - takes two parameters, the calculated- * column index and the definition for that column.- * @memberof DataTable#oApi- */- function _fnApplyColumnDefs( oSettings, aoColDefs, aoCols, fn )- {- var i, iLen, j, jLen, k, kLen;-- // Column definitions with aTargets- if ( aoColDefs )- {- /* Loop over the definitions array - loop in reverse so first instance has priority */- for ( i=aoColDefs.length-1 ; i>=0 ; i-- )- {- /* Each definition can target multiple columns, as it is an array */- var aTargets = aoColDefs[i].targets || aoColDefs[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 )- {- /* Add columns that we don't yet know about */- while( oSettings.aoColumns.length <= aTargets[j] )- {- _fnAddColumn( oSettings );- }-- /* Integer, basic index */- fn( aTargets[j], aoColDefs[i] );- }- else if ( typeof aTargets[j] === 'number' && aTargets[j] < 0 )- {- /* Negative integer, right to left column counting */- fn( oSettings.aoColumns.length+aTargets[j], aoColDefs[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] ) )- {- fn( k, aoColDefs[i] );- }- }- }- }- }- }-- // Statically defined columns array- if ( aoCols )- {- for ( i=0, iLen=aoCols.length ; i<iLen ; i++ )- {- fn( i, aoCols[i] );- }- }- }-- /**- * Add a data array to the table, creating DOM node etc. This is the parallel to- * _fnGatherData, but for adding rows from a Javascript source, rather than a- * DOM source.- * @param {object} oSettings dataTables settings object- * @param {array} aData data array to be added- * @returns {int} >=0 if successful (index of new aoData entry), -1 if failed- * @memberof DataTable#oApi- */- function _fnAddData ( oSettings, aDataIn )- {- var oCol;-- /* Create the object for storing information about this new row */- var iRow = oSettings.aoData.length;- var oData = $.extend( true, {}, DataTable.models.oRow );- oData._aData = aDataIn;- 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];-- _fnSetCellData( oSettings, iRow, i, _fnGetCellData( oSettings, iRow, i ) );-- /* 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 && oCol.sType != "html" )- {- /* String is always the 'fallback' option */- oCol.sType = 'string';- }- }- }- }-- /* Add to the display array */- oSettings.aiDisplayMaster.push( iRow );-- /* Create the DOM information */- if ( !oSettings.oFeatures.bDeferRender )- {- _fnCreateTr( oSettings, iRow );- }-- return iRow;- }--- /**- * Read in the data from the target table from the DOM- * @param {object} oSettings dataTables settings object- * @memberof DataTable#oApi- */- function _fnGatherData( oSettings )- {- var iLoop, i, iLen, j, jLen, jInner,- nTds, nTrs, nTd, nTr, aLocalData, iThisIndex,- iRow, iRows, iColumn, iColumns, sNodeName,- oCol, oData;-- /*- * 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 )- {- nTr = oSettings.nTBody.firstChild;- while ( nTr )- {- if ( nTr.nodeName.toUpperCase() == "TR" )- {- iThisIndex = oSettings.aoData.length;- nTr._DT_RowIndex = iThisIndex;- oSettings.aoData.push( $.extend( true, {}, DataTable.models.oRow, {- "nTr": nTr- } ) );-- oSettings.aiDisplayMaster.push( iThisIndex );- nTd = nTr.firstChild;- jInner = 0;- while ( nTd )- {- sNodeName = nTd.nodeName.toUpperCase();- if ( sNodeName == "TD" || sNodeName == "TH" )- {- _fnSetCellData( oSettings, iThisIndex, jInner, $.trim(nTd.innerHTML) );- jInner++;- }- nTd = nTd.nextSibling;- }- }- nTr = nTr.nextSibling;- }- }-- /* 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++ )- {- nTd = nTrs[i].firstChild;- while ( nTd )- {- sNodeName = nTd.nodeName.toUpperCase();- if ( sNodeName == "TD" || sNodeName == "TH" )- {- nTds.push( nTd );- }- nTd = nTd.nextSibling;- }- }-- /* Now process by column */- for ( iColumn=0, iColumns=oSettings.aoColumns.length ; iColumn<iColumns ; iColumn++ )- {- oCol = oSettings.aoColumns[iColumn];-- /* Get the title of the column - unless there is a user set one */- if ( oCol.sTitle === null )- {- oCol.sTitle = oCol.nTh.innerHTML;- }-- var- bAutoType = oCol._bAutoType,- bClass = oCol.sClass !== null,- bVisible = oCol.bVisible,- nCell, sThisType, sRendered, sValType;-- /* A single loop to rule them all (and be more efficient) */- if ( bAutoType || bClass || !bVisible )- {- for ( iRow=0, iRows=oSettings.aoData.length ; iRow<iRows ; iRow++ )- {- oData = oSettings.aoData[iRow];- nCell = nTds[ (iRow*iColumns) + iColumn ];-- /* Type detection */- if ( bAutoType && oCol.sType != 'string' )- {- sValType = _fnGetCellData( oSettings, iRow, iColumn, 'type' );- if ( sValType !== '' )- {- sThisType = _fnDetectType( sValType );- if ( oCol.sType === null )- {- oCol.sType = sThisType;- }- else if ( oCol.sType != sThisType &&- oCol.sType != "html" )- {- /* String is always the 'fallback' option */- oCol.sType = 'string';- }- }- }-- if ( oCol.mRender )- {- // mRender has been defined, so we need to get the value and set it- nCell.innerHTML = _fnGetCellData( oSettings, iRow, iColumn, 'display' );- }- else if ( oCol.mData !== iColumn )- {- // If mData is not the same as the column number, then we need to- // get the dev set value. If it is the column, no point in wasting- // time setting the value that is already there!- nCell.innerHTML = _fnGetCellData( oSettings, iRow, iColumn, 'display' );- }-- /* Classes */- if ( bClass )- {- nCell.className += ' '+oCol.sClass;- }-- /* Column visibility */- if ( !bVisible )- {- oData._anHidden[iColumn] = nCell;- nCell.parentNode.removeChild( nCell );- }- else- {- oData._anHidden[iColumn] = null;- }-- if ( oCol.fnCreatedCell )- {- oCol.fnCreatedCell.call( oSettings.oInstance,- nCell, _fnGetCellData( oSettings, iRow, iColumn, 'display' ), oData._aData, iRow, iColumn- );- }- }- }- }-- /* Row created callbacks */- if ( oSettings.aoRowCreatedCallback.length !== 0 )- {- for ( i=0, iLen=oSettings.aoData.length ; i<iLen ; i++ )- {- oData = oSettings.aoData[i];- _fnCallbackFire( oSettings, 'aoRowCreatedCallback', null, [oData.nTr, oData._aData, i] );- }- }- }--- /**- * Take a TR element and convert it to an index in aoData- * @param {object} oSettings dataTables settings object- * @param {node} n the TR element to find- * @returns {int} index if the node is found, null if not- * @memberof DataTable#oApi- */- function _fnNodeToDataIndex( oSettings, n )- {- return (n._DT_RowIndex!==undefined) ? n._DT_RowIndex : null;- }--- /**- * Take a TD element and convert it into a column data index (not the visible index)- * @param {object} oSettings dataTables settings object- * @param {int} iRow The row number the TD/TH can be found in- * @param {node} n The TD/TH element to find- * @returns {int} index if the node is found, -1 if not- * @memberof DataTable#oApi- */- function _fnNodeToColumnIndex( oSettings, iRow, n )- {- var anCells = _fnGetTdNodes( oSettings, iRow );-- for ( var i=0, iLen=oSettings.aoColumns.length ; i<iLen ; i++ )- {- if ( anCells[i] === n )- {- return i;- }- }- return -1;- }--- /**- * Get an array of data for a given row from the internal data cache- * @param {object} oSettings dataTables settings object- * @param {int} iRow aoData row id- * @param {string} sSpecific data get type ('type' 'filter' 'sort')- * @param {array} aiColumns Array of column indexes to get data from- * @returns {array} Data array- * @memberof DataTable#oApi- */- function _fnGetRowData( oSettings, iRow, sSpecific, aiColumns )- {- var out = [];- for ( var i=0, iLen=aiColumns.length ; i<iLen ; i++ )- {- out.push( _fnGetCellData( oSettings, iRow, aiColumns[i], sSpecific ) );- }- return out;- }--- /**- * Get the data for a given cell from the internal cache, taking into account data mapping- * @param {object} oSettings dataTables settings object- * @param {int} iRow aoData row id- * @param {int} iCol Column index- * @param {string} sSpecific data get type ('display', 'type' 'filter' 'sort')- * @returns {*} Cell data- * @memberof DataTable#oApi- */- function _fnGetCellData( oSettings, iRow, iCol, sSpecific )- {- var oCol = oSettings.aoColumns[iCol];- var oData = oSettings.aoData[iRow]._aData;- var sData = oCol.fnGetData( oData, sSpecific );-- if ( sData === undefined )- {- if ( oSettings.iDrawError != oSettings.iDraw && oCol.sDefaultContent === null )- {- _fnLog( oSettings, 0, "Requested unknown parameter "+- (typeof oCol.mData=='function' ? '{mData function}' : "'"+oCol.mData+"'")+- " 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;- }- else if ( typeof sData === 'function' )- {- /* If the data source is a function, then we run it and use the return */- return sData();- }-- if ( sSpecific == 'display' && sData === null )- {- return '';- }- return sData;- }--- /**- * Set the value for a specific cell, into the internal data cache- * @param {object} oSettings dataTables settings object- * @param {int} iRow aoData row id- * @param {int} iCol Column index- * @param {*} val Value to set- * @memberof DataTable#oApi- */- function _fnSetCellData( oSettings, iRow, iCol, val )- {- var oCol = oSettings.aoColumns[iCol];- var oData = oSettings.aoData[iRow]._aData;-- oCol.fnSetData( oData, val );- }--- // Private variable that is used to match array syntax in the data property object- var __reArray = /\[.*?\]$/;-- /**- * 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- * @param {string|int|function} mSource The data source for the object- * @returns {function} Data get function- * @memberof DataTable#oApi- */- function _fnGetObjectDataFn( mSource )- {- if ( mSource === null )- {- /* Give an empty string for rendering / sorting etc */- return function (data, type) {- return null;- };- }- else if ( typeof mSource === 'function' )- {- return function (data, type, extra) {- return mSource( data, type, extra );- };- }- else if ( typeof mSource === 'string' && (mSource.indexOf('.') !== -1 || mSource.indexOf('[') !== -1) )- {- /* If there is a . in the source string then the data source is in a- * nested object so we loop over the data for each level to get the next- * level down. On each loop we test for undefined, and if found immediately- * return. This allows entire objects to be missing and sDefaultContent to- * be used if defined, rather than throwing an error- */- var fetchData = function (data, type, src) {- var a = src.split('.');- var arrayNotation, out, innerSrc;-- if ( src !== "" )- {- for ( var i=0, iLen=a.length ; i<iLen ; i++ )- {- // Check if we are dealing with an array notation request- arrayNotation = a[i].match(__reArray);-- if ( arrayNotation ) {- a[i] = a[i].replace(__reArray, '');-- // Condition allows simply [] to be passed in- if ( a[i] !== "" ) {- data = data[ a[i] ];- }- out = [];-- // Get the remainder of the nested object to get- a.splice( 0, i+1 );- innerSrc = a.join('.');-- // Traverse each entry in the array getting the properties requested- for ( var j=0, jLen=data.length ; j<jLen ; j++ ) {- out.push( fetchData( data[j], type, innerSrc ) );- }-- // If a string is given in between the array notation indicators, that- // is used to join the strings together, otherwise an array is returned- var join = arrayNotation[0].substring(1, arrayNotation[0].length-1);- data = (join==="") ? out : out.join(join);-- // The inner call to fetchData has already traversed through the remainder- // of the source requested, so we exit from the loop- break;- }-- if ( data === null || data[ a[i] ] === undefined )- {- return undefined;- }- data = data[ a[i] ];- }- }-- return data;- };-- return function (data, type) {- return fetchData( data, type, mSource );- };- }- else- {- /* Array or flat object mapping */- return function (data, type) {- return data[mSource];- };- }- }--- /**- * 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- * @param {string|int|function} mSource The data source for the object- * @returns {function} Data set function- * @memberof DataTable#oApi- */- 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) {- mSource( data, 'set', val );- };- }- else if ( typeof mSource === 'string' && (mSource.indexOf('.') !== -1 || mSource.indexOf('[') !== -1) )- {- /* Like the get, we need to get data from a nested object */- var setData = function (data, val, src) {- var a = src.split('.'), b;- var arrayNotation, o, innerSrc;-- for ( var i=0, iLen=a.length-1 ; i<iLen ; i++ )- {- // Check if we are dealing with an array notation request- arrayNotation = a[i].match(__reArray);-- if ( arrayNotation )- {- a[i] = a[i].replace(__reArray, '');- data[ a[i] ] = [];-- // Get the remainder of the nested object to set so we can recurse- b = a.slice();- b.splice( 0, i+1 );- innerSrc = b.join('.');-- // Traverse each entry in the array setting the properties requested- for ( var j=0, jLen=val.length ; j<jLen ; j++ )- {- o = {};- setData( o, val[j], innerSrc );- data[ a[i] ].push( o );- }-- // The inner call to setData has already traversed through the remainder- // of the source and has set the data, thus we can exit here- return;- }-- // If the nested object doesn't currently exist - since we are- // trying to set the value - create it- if ( data[ a[i] ] === null || data[ a[i] ] === undefined )- {- data[ a[i] ] = {};- }- data = data[ a[i] ];- }-- // If array notation is used, we just want to strip it and use the property name- // and assign the value. If it isn't used, then we get the result we want anyway- data[ a[a.length-1].replace(__reArray, '') ] = val;- };-- return function (data, val) {- return setData( data, val, mSource );- };- }- else- {- /* Array or flat object mapping */- return function (data, val) {- data[mSource] = val;- };- }- }--- /**- * Return an array with the full table data- * @param {object} oSettings dataTables settings object- * @returns array {array} aData Master data array- * @memberof DataTable#oApi- */- 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;- }--- /**- * Nuke the table- * @param {object} oSettings dataTables settings object- * @memberof DataTable#oApi- */- 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 );- }--- /**- * Take an array of integers (index array) and remove a target integer (value - not- * the key!)- * @param {array} a Index array to target- * @param {int} iTarget value to find- * @memberof DataTable#oApi- */- 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 );- }- }-- /**- * Create a new TR element (and it's TD children) for a row- * @param {object} oSettings dataTables settings object- * @param {int} iRow Row to consider- * @memberof DataTable#oApi- */- function _fnCreateTr ( oSettings, iRow )- {- var oData = oSettings.aoData[iRow];- var nTd;-- if ( oData.nTr === null )- {- oData.nTr = document.createElement('tr');-- /* Use a private property on the node to allow reserve mapping from the node- * to the aoData array for fast look up- */- oData.nTr._DT_RowIndex = iRow;-- /* Special parameters can be given by the data source to be used on the row */- if ( oData._aData.DT_RowId )- {- oData.nTr.id = oData._aData.DT_RowId;- }-- if ( oData._aData.DT_RowClass )- {- oData.nTr.className = 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( oCol.sCellType );- 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;- }-- if ( oCol.fnCreatedCell )- {- oCol.fnCreatedCell.call( oSettings.oInstance,- nTd, _fnGetCellData( oSettings, iRow, i, 'display' ), oData._aData, iRow, i- );- }- }-- _fnCallbackFire( oSettings, 'aoRowCreatedCallback', null, [oData.nTr, oData._aData, iRow] );- }- }--- /**- * Create the HTML header for the table- * @param {object} oSettings dataTables settings object- * @memberof DataTable#oApi- */- function _fnBuildHead( oSettings )- {- var i, nTh, iLen, j, jLen;- var iThs = $('th, td', oSettings.nTHead).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;- nTh.setAttribute('role', 'columnheader');- if ( oSettings.aoColumns[i].bSortable )- {- nTh.setAttribute('tabindex', oSettings.iTabIndex);- nTh.setAttribute('aria-controls', oSettings.sTableId);- }-- 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;- nTh.setAttribute('tabindex', '0');-- 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 );- }-- /* ARIA role for the rows */- $(oSettings.nTHead).children('tr').attr('role', 'row');-- /* 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 );- }- }-- 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 );- }- else- {- $(oSettings.aoColumns[i].nTh).addClass( oSettings.oClasses.sSortableNone );- }- }- }-- /* Deal with the footer - add classes if required */- if ( oSettings.oClasses.sFooterTH !== "" )- {- $(oSettings.nTFoot).children('tr').children('th').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 ( anCells[i] )- {- oSettings.aoColumns[i].nTf = anCells[i];- if ( oSettings.aoColumns[i].sClass )- {- $(anCells[i]).addClass( oSettings.aoColumns[i].sClass );- }- }- }- }- }--- /**- * 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.- * @param {object} oSettings dataTables settings object- * @param array {objects} aoSource Layout array from _fnDetectHeader- * @param {boolean} [bIncludeHidden=false] If true then include the hidden columns in the calc,- * @memberof DataTable#oApi- */- function _fnDrawHead( oSettings, aoSource, bIncludeHidden )- {- var i, iLen, j, jLen, k, kLen, n, nLocalTr;- var aoLocal = [];- var aApplied = [];- var iColumns = oSettings.aoColumns.length;- var iRowspan, iColspan;-- if ( 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++ )- {- nLocalTr = aoLocal[i].nTr;-- /* All cells are going to be replaced, so empty out the row */- if ( nLocalTr )- {- while( (n = nLocalTr.firstChild) )- {- nLocalTr.removeChild( n );- }- }-- 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 ( aApplied[i][j] === undefined )- {- nLocalTr.appendChild( aoLocal[i][j].cell );- aApplied[i][j] = 1;-- /* Expand the cell to cover as many rows as needed */- while ( 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 ( 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.rowSpan = iRowspan;- aoLocal[i][j].cell.colSpan = iColspan;- }- }- }- }--- /**- * Insert the required TR nodes into the table for display- * @param {object} oSettings dataTables settings object- * @memberof DataTable#oApi- */- function _fnDraw( oSettings )- {- /* Provide a pre-callback function which can be used to cancel the draw is false is returned */- var aPreDraw = _fnCallbackFire( oSettings, 'aoPreDrawCallback', 'preDraw', [oSettings] );- if ( $.inArray( false, aPreDraw ) !== -1 )- {- _fnProcessingDisplay( oSettings, false );- return;- }-- var i, iLen, n;- var anRows = [];- var iRowCount = 0;- var iStripes = oSettings.asStripeClasses.length;- var iOpenRows = oSettings.aoOpenRows.length;-- oSettings.bDrawing = true;-- /* Check and see if we have an initial draw position from state saving */- if ( 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 striping classes and then add the new one */- if ( iStripes !== 0 )- {- var sStripe = oSettings.asStripeClasses[ iRowCount % iStripes ];- if ( aoData._sRowStripe != sStripe )- {- $(nRow).removeClass( aoData._sRowStripe ).addClass( sStripe );- aoData._sRowStripe = sStripe;- }- }-- /* Row callback functions - might want to manipulate the row */- _fnCallbackFire( oSettings, 'aoRowCallback', null,- [nRow, oSettings.aoData[ oSettings.aiDisplay[j] ]._aData, iRowCount, j] );-- anRows.push( nRow );- iRowCount++;-- /* If there is an open row - and it is attached to this parent - attach it on redraw */- for ( var k=0 ; k<iOpenRows ; k++ )- {- if ( nRow == oSettings.aoOpenRows[k].nParent )- {- anRows.push( oSettings.aoOpenRows[k].nTr );- break;- }- }- }- }- else- {- /* Table is empty - create a row with an empty message in it */- anRows[ 0 ] = document.createElement( 'tr' );-- if ( oSettings.asStripeClasses[0] )- {- anRows[ 0 ].className = oSettings.asStripeClasses[0];- }-- var oLang = oSettings.oLanguage;- var sZero = oLang.sZeroRecords;- if ( oSettings.iDraw == 1 && oSettings.sAjaxSource !== null && !oSettings.oFeatures.bServerSide )- {- sZero = oLang.sLoadingRecords;- }- else if ( oLang.sEmptyTable && oSettings.fnRecordsTotal() === 0 )- {- sZero = oLang.sEmptyTable;- }-- var nTd = document.createElement( 'td' );- nTd.setAttribute( 'valign', "top" );- nTd.colSpan = _fnVisbleColumns( oSettings );- nTd.className = oSettings.oClasses.sRowEmpty;- nTd.innerHTML = _fnInfoMacros( oSettings, sZero );-- anRows[ iRowCount ].appendChild( nTd );- }-- /* Header and footer callbacks */- _fnCallbackFire( oSettings, 'aoHeaderCallback', 'header', [ $(oSettings.nTHead).children('tr')[0],- _fnGetDataMaster( oSettings ), oSettings._iDisplayStart, oSettings.fnDisplayEnd(), oSettings.aiDisplay ] );-- _fnCallbackFire( oSettings, 'aoFooterCallback', 'footer', [ $(oSettings.nTFoot).children('tr')[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;-- 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 )- {- while( (n = oSettings.nTBody.firstChild) )- {- oSettings.nTBody.removeChild( n );- }- }-- /* 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 */- _fnCallbackFire( oSettings, 'aoDrawCallback', 'draw', [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 ( !oSettings._bInitComplete )- {- _fnInitComplete( oSettings );- }- }- }--- /**- * Redraw the table - taking account of the various features which are enabled- * @param {object} oSettings dataTables settings object- * @memberof DataTable#oApi- */- 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 );- }- }--- /**- * Add the options to the page HTML for the table- * @param {object} oSettings dataTables settings object- * @memberof DataTable#oApi- */- 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 = $('<div></div>')[0];- oSettings.nTable.parentNode.insertBefore( nHolding, oSettings.nTable );-- /*- * All DataTables are wrapped in a div- */- oSettings.nTableWrapper = $('<div id="'+oSettings.sTableId+'_wrapper" class="'+oSettings.oClasses.sWrapper+'" role="grid"></div>')[0];- 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 = $('<div></div>')[0];-- /* 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 = oSettings.oClasses.sJUIHeader;- }- else if ( sAttr == "F" )- {- sAttr = oSettings.oClasses.sJUIFooter;- }-- /* 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.id = aSplit[0].substr(1, aSplit[0].length-1);- nNewNode.className = aSplit[1];- }- else if ( sAttr.charAt(0) == "#" )- {- nNewNode.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 ( DataTable.ext.aoFeatures.length !== 0 )- {- /* Plug-in features */- var aoFeatures = DataTable.ext.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 );- }--- /**- * 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- * @param array {object} aLayout Array to store the calculated layout in- * @param {node} nThead The header/footer element for the table- * @memberof DataTable#oApi- */- function _fnDetectHeader ( aLayout, nThead )- {- var nTrs = $(nThead).children('tr');- var nTr, nCell;- var i, k, l, iLen, jLen, iColShifted, iColumn, iColspan, iRowspan;- var bUnique;- var fnShiftCol = function ( a, i, j ) {- var k = a[i];- while ( k[j] ) {- 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++ )- {- nTr = nTrs[i];- iColumn = 0;-- /* For every cell in the row... */- nCell = nTr.firstChild;- while ( nCell ) {- if ( nCell.nodeName.toUpperCase() == "TD" ||- nCell.nodeName.toUpperCase() == "TH" )- {- /* Get the col and rowspan attributes from the DOM and sanitise them */- iColspan = nCell.getAttribute('colspan') * 1;- 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 );-- /* Cache calculation for unique columns */- bUnique = iColspan === 1 ? true : false;-- /* 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": bUnique- };- aLayout[i+k].nTr = nTr;- }- }- }- nCell = nCell.nextSibling;- }- }- }--- /**- * Get an array of unique th elements, one for each column- * @param {object} oSettings dataTables settings object- * @param {node} nHeader automatically detect the layout from this node - optional- * @param {array} aLayout thead/tfoot layout from _fnDetectHeader - optional- * @returns array {node} aReturn list of unique th's- * @memberof DataTable#oApi- */- function _fnGetUniqueThs ( oSettings, nHeader, aLayout )- {- var aReturn = [];- if ( !aLayout )- {- aLayout = oSettings.aoHeader;- if ( nHeader )- {- 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 &&- (!aReturn[j] || !oSettings.bSortCellsTop) )- {- aReturn[j] = aLayout[i][j].cell;- }- }- }-- return aReturn;- }--- /**- * Update the table using an Ajax call- * @param {object} oSettings dataTables settings object- * @returns {boolean} Block the table drawing or not- * @memberof DataTable#oApi- */- function _fnAjaxUpdate( oSettings )- {- if ( oSettings.bAjaxDataGet )- {- oSettings.iDraw++;- _fnProcessingDisplay( oSettings, true );- var iColumns = oSettings.aoColumns.length;- var aoData = _fnAjaxParameters( oSettings );- _fnServerParams( oSettings, aoData );-- oSettings.fnServerData.call( oSettings.oInstance, oSettings.sAjaxSource, aoData,- function(json) {- _fnAjaxUpdateDraw( oSettings, json );- }, oSettings );- return false;- }- return true;- }--- /**- * Build up the parameters in an object needed for a server-side processing request- * @param {object} oSettings dataTables settings object- * @returns {bool} block the table drawing or not- * @memberof DataTable#oApi- */- function _fnAjaxParameters( oSettings )- {- var iColumns = oSettings.aoColumns.length;- var aoData = [], mDataProp, aaSort, aDataSort;- var i, j;-- 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].mData;- 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 iCounter = 0;-- aaSort = ( oSettings.aaSortingFixed !== null ) ?- oSettings.aaSortingFixed.concat( oSettings.aaSorting ) :- oSettings.aaSorting.slice();-- for ( i=0 ; i<aaSort.length ; i++ )- {- aDataSort = oSettings.aoColumns[ aaSort[i][0] ].aDataSort;-- for ( j=0 ; j<aDataSort.length ; j++ )- {- aoData.push( { "name": "iSortCol_"+iCounter, "value": aDataSort[j] } );- aoData.push( { "name": "sSortDir_"+iCounter, "value": aaSort[i][1] } );- iCounter++;- }- }- aoData.push( { "name": "iSortingCols", "value": iCounter } );-- for ( i=0 ; i<iColumns ; i++ )- {- aoData.push( { "name": "bSortable_"+i, "value": oSettings.aoColumns[i].bSortable } );- }- }-- return aoData;- }--- /**- * Add Ajax parameters from plug-ins- * @param {object} oSettings dataTables settings object- * @param array {objects} aoData name/value pairs to send to the server- * @memberof DataTable#oApi- */- function _fnServerParams( oSettings, aoData )- {- _fnCallbackFire( oSettings, 'aoServerParams', 'serverParams', [aoData] );- }--- /**- * Data the data from the server (nuking the old) and redraw the table- * @param {object} oSettings dataTables settings object- * @param {object} json json data return from the server.- * @param {string} json.sEcho Tracking flag for DataTables to match requests- * @param {int} json.iTotalRecords Number of records in the data set, not accounting for filtering- * @param {int} json.iTotalDisplayRecords Number of records in the data set, accounting for filtering- * @param {array} json.aaData The data to display on this page- * @param {string} [json.sColumns] Column ordering (sName, comma separated)- * @memberof DataTable#oApi- */- function _fnAjaxUpdateDraw ( oSettings, json )- {- if ( json.sEcho !== undefined )- {- /* Protect against old returns over-writing a new one. Possible when you get- * very fast interaction, and later queries are completed much faster- */- if ( json.sEcho*1 < oSettings.iDraw )- {- return;- }- oSettings.iDraw = json.sEcho * 1;- }-- if ( !oSettings.oScroll.bInfinite || oSettings.bSorted || oSettings.bFiltered )- {- _fnClearTable( oSettings );- }- oSettings._iRecordsTotal = parseInt(json.iTotalRecords, 10);- oSettings._iRecordsDisplay = parseInt(json.iTotalDisplayRecords, 10);-- var aData = _fnGetObjectDataFn( oSettings.sAjaxDataProp )( json );- for ( var i=0, iLen=aData.length ; i<iLen ; i++ )- {- _fnAddData( oSettings, aData[i] );- }- oSettings.aiDisplay = oSettings.aiDisplayMaster.slice();-- oSettings.bAjaxDataGet = false;- _fnDraw( oSettings );- oSettings.bAjaxDataGet = true;- _fnProcessingDisplay( oSettings, false );- }--- /**- * Generate the node required for filtering text- * @returns {node} Filter control element- * @param {object} oSettings dataTables settings object- * @memberof DataTable#oApi- */- function _fnFeatureHtmlFilter ( oSettings )- {- var oPreviousSearch = oSettings.oPreviousSearch;-- 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.aanFeatures.f )- {- nFilter.id = oSettings.sTableId+'_filter';- }-- var jqFilter = $('input[type="text"]', nFilter);-- // Store a reference to the input element, so other input elements could be- // added to the filter wrapper if needed (submit button for example)- nFilter._DT_Input = jqFilter[0];-- jqFilter.val( oPreviousSearch.sSearch.replace('"','"') );- jqFilter.bind( 'keyup.DT', function(e) {- /* Update all other filter input elements for the new display */- var n = oSettings.aanFeatures.f;- var val = this.value==="" ? "" : this.value; // mental IE8 fix :-(-- for ( var i=0, iLen=n.length ; i<iLen ; i++ )- {- if ( n[i] != $(this).parents('div.dataTables_filter')[0] )- {- $(n[i]._DT_Input).val( val );- }- }-- /* Now do the filter */- if ( val != oPreviousSearch.sSearch )- {- _fnFilterComplete( oSettings, {- "sSearch": val,- "bRegex": oPreviousSearch.bRegex,- "bSmart": oPreviousSearch.bSmart ,- "bCaseInsensitive": oPreviousSearch.bCaseInsensitive- } );- }- } );-- jqFilter- .attr('aria-controls', oSettings.sTableId)- .bind( 'keypress.DT', function(e) {- /* Prevent form submission */- if ( e.keyCode == 13 )- {- return false;- }- }- );-- return nFilter;- }--- /**- * Filter the table using both the global filter and column based filtering- * @param {object} oSettings dataTables settings object- * @param {object} oSearch search information- * @param {int} [iForce] force a research of the master array (1) or not (undefined or 0)- * @memberof DataTable#oApi- */- function _fnFilterComplete ( oSettings, oInput, iForce )- {- var oPrevSearch = oSettings.oPreviousSearch;- var aoPrevSearch = oSettings.aoPreSearchCols;- var fnSaveFilter = function ( oFilter ) {- /* Save the filtering values */- oPrevSearch.sSearch = oFilter.sSearch;- oPrevSearch.bRegex = oFilter.bRegex;- oPrevSearch.bSmart = oFilter.bSmart;- oPrevSearch.bCaseInsensitive = oFilter.bCaseInsensitive;- };-- /* In server-side processing all filtering is done by the server, so no point hanging around here */- if ( !oSettings.oFeatures.bServerSide )- {- /* Global filter */- _fnFilter( oSettings, oInput.sSearch, iForce, oInput.bRegex, oInput.bSmart, oInput.bCaseInsensitive );- fnSaveFilter( oInput );-- /* Now do the individual column filter */- for ( var i=0 ; i<oSettings.aoPreSearchCols.length ; i++ )- {- _fnFilterColumn( oSettings, aoPrevSearch[i].sSearch, i, aoPrevSearch[i].bRegex,- aoPrevSearch[i].bSmart, aoPrevSearch[i].bCaseInsensitive );- }-- /* Custom filtering */- _fnFilterCustom( oSettings );- }- else- {- fnSaveFilter( oInput );- }-- /* Tell the draw function we have been filtering */- oSettings.bFiltered = true;- $(oSettings.oInstance).trigger('filter', oSettings);-- /* Redraw the table */- oSettings._iDisplayStart = 0;- _fnCalculateEnd( oSettings );- _fnDraw( oSettings );-- /* Rebuild search array 'offline' */- _fnBuildSearchArray( oSettings, 0 );- }--- /**- * Apply custom filtering functions- * @param {object} oSettings dataTables settings object- * @memberof DataTable#oApi- */- function _fnFilterCustom( oSettings )- {- var afnFilters = DataTable.ext.afnFiltering;- var aiFilterColumns = _fnGetColumns( oSettings, 'bSearchable' );-- 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];- var bTest = afnFilters[i](- oSettings,- _fnGetRowData( oSettings, iDisIndex, 'filter', aiFilterColumns ),- iDisIndex- );-- /* Check if we should use this row based on the filtering function */- if ( !bTest )- {- oSettings.aiDisplay.splice( j-iCorrector, 1 );- iCorrector++;- }- }- }- }--- /**- * Filter the table on a per-column basis- * @param {object} oSettings dataTables settings object- * @param {string} sInput string to filter on- * @param {int} iColumn column to filter- * @param {bool} bRegex treat search string as a regular expression or not- * @param {bool} bSmart use smart filtering or not- * @param {bool} bCaseInsensitive Do case insenstive matching or not- * @memberof DataTable#oApi- */- function _fnFilterColumn ( oSettings, sInput, iColumn, bRegex, bSmart, bCaseInsensitive )- {- if ( sInput === "" )- {- return;- }-- var iIndexCorrector = 0;- var rpSearch = _fnFilterCreateSearch( sInput, bRegex, bSmart, bCaseInsensitive );-- 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++;- }- }- }--- /**- * Filter the data table based on user input and draw the table- * @param {object} oSettings dataTables settings object- * @param {string} sInput string to filter on- * @param {int} iForce optional - force a research of the master array (1) or not (undefined or 0)- * @param {bool} bRegex treat as a regular expression or not- * @param {bool} bSmart perform smart filtering or not- * @param {bool} bCaseInsensitive Do case insenstive matching or not- * @memberof DataTable#oApi- */- function _fnFilter( oSettings, sInput, iForce, bRegex, bSmart, bCaseInsensitive )- {- var i;- var rpSearch = _fnFilterCreateSearch( sInput, bRegex, bSmart, bCaseInsensitive );- var oPrevSearch = oSettings.oPreviousSearch;-- /* Check if we are forcing or not - optional parameter */- if ( !iForce )- {- iForce = 0;- }-- /* Need to take account of custom filtering functions - always filter */- if ( DataTable.ext.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 ||- oPrevSearch.sSearch.length > sInput.length || iForce == 1 ||- sInput.indexOf(oPrevSearch.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++;- }- }- }- }- }--- /**- * Create an array which can be quickly search through- * @param {object} oSettings dataTables settings object- * @param {int} iMaster use the master data array - optional- * @memberof DataTable#oApi- */- function _fnBuildSearchArray ( oSettings, iMaster )- {- if ( !oSettings.oFeatures.bServerSide )- {- /* Clear out the old data */- oSettings.asDataSearch = [];-- var aiFilterColumns = _fnGetColumns( oSettings, 'bSearchable' );- var aiIndex = (iMaster===1) ?- oSettings.aiDisplayMaster :- oSettings.aiDisplay;-- for ( var i=0, iLen=aiIndex.length ; i<iLen ; i++ )- {- oSettings.asDataSearch[i] = _fnBuildSearchRow(- oSettings,- _fnGetRowData( oSettings, aiIndex[i], 'filter', aiFilterColumns )- );- }- }- }--- /**- * Create a searchable string from a single data row- * @param {object} oSettings dataTables settings object- * @param {array} aData Row data array to use for the data to search- * @memberof DataTable#oApi- */- function _fnBuildSearchRow( oSettings, aData )- {- var sSearch = aData.join(' ');-- /* If it looks like there is an HTML entity in the string, attempt to decode it */- if ( sSearch.indexOf('&') !== -1 )- {- sSearch = $('<div>').html(sSearch).text();- }-- // Strip newline characters- return sSearch.replace( /[\n\r]/g, " " );- }-- /**- * Build a regular expression object suitable for searching a table- * @param {string} sSearch string to search for- * @param {bool} bRegex treat as a regular expression or not- * @param {bool} bSmart perform smart filtering or not- * @param {bool} bCaseInsensitive Do case insensitive matching or not- * @returns {RegExp} constructed object- * @memberof DataTable#oApi- */- function _fnFilterCreateSearch( sSearch, bRegex, bSmart, bCaseInsensitive )- {- var asSearch,- sRegExpString = bRegex ? sSearch : _fnEscapeRegex( sSearch );-- if ( bSmart )- {- /* Generate the regular expression to use. Something along the lines of:- * ^(?=.*?\bone\b)(?=.*?\btwo\b)(?=.*?\bthree\b).*$- */- asSearch = sRegExpString.split( ' ' );- sRegExpString = '^(?=.*?'+asSearch.join( ')(?=.*?' )+').*$';- }-- return new RegExp( sRegExpString, bCaseInsensitive ? "i" : "" );- }--- /**- * Convert raw data into something that the user can search on- * @param {string} sData data to be modified- * @param {string} sType data type- * @returns {string} search string- * @memberof DataTable#oApi- */- function _fnDataToSearch ( sData, sType )- {- if ( typeof DataTable.ext.ofnSearch[sType] === "function" )- {- return DataTable.ext.ofnSearch[sType]( sData );- }- else if ( sData === null )- {- return '';- }- else if ( sType == "html" )- {- return sData.replace(/[\r\n]/g," ").replace( /<.*?>/g, "" );- }- else if ( typeof sData === "string" )- {- return sData.replace(/[\r\n]/g," ");- }- return sData;- }--- /**- * scape a string such that it can be used in a regular expression- * @param {string} sVal string to escape- * @returns {string} escaped string- * @memberof DataTable#oApi- */- function _fnEscapeRegex ( sVal )- {- var acEscape = [ '/', '.', '*', '+', '?', '|', '(', ')', '[', ']', '{', '}', '\\', '$', '^', '-' ];- var reReplace = new RegExp( '(\\' + acEscape.join('|\\') + ')', 'g' );- return sVal.replace(reReplace, '\\$1');- }-- /**- * Generate the node required for the info display- * @param {object} oSettings dataTables settings object- * @returns {node} Information element- * @memberof DataTable#oApi- */- 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 ( !oSettings.aanFeatures.i )- {- /* Add draw callback */- oSettings.aoDrawCallback.push( {- "fn": _fnUpdateInfo,- "sName": "information"- } );-- /* Add id */- nInfo.id = oSettings.sTableId+'_info';- }- oSettings.nTable.setAttribute( 'aria-describedby', oSettings.sTableId+'_info' );-- return nInfo;- }--- /**- * Update the information elements in the display- * @param {object} oSettings dataTables settings object- * @memberof DataTable#oApi- */- function _fnUpdateInfo ( oSettings )- {- /* Show information about the table */- if ( !oSettings.oFeatures.bInfo || oSettings.aanFeatures.i.length === 0 )- {- return;- }-- var- oLang = oSettings.oLanguage,- iStart = oSettings._iDisplayStart+1,- iEnd = oSettings.fnDisplayEnd(),- iMax = oSettings.fnRecordsTotal(),- iTotal = oSettings.fnRecordsDisplay(),- sOut;-- if ( iTotal === 0 )- {- /* Empty record set */- sOut = oLang.sInfoEmpty;- }- else {- /* Normal record set */- sOut = oLang.sInfo;- }-- if ( iTotal != iMax )- {- /* Record set after filtering */- sOut += ' ' + oLang.sInfoFiltered;- }-- // Convert the macros- sOut += oLang.sInfoPostFix;- sOut = _fnInfoMacros( oSettings, sOut );-- if ( oLang.fnInfoCallback !== null )- {- sOut = oLang.fnInfoCallback.call( oSettings.oInstance,- 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 );- }- }--- function _fnInfoMacros ( oSettings, str )- {- // When infinite scrolling, we are always starting at 1. _iDisplayStart is used only- // internally- var- iStart = oSettings.oScroll.bInfinite ? 1 : oSettings._iDisplayStart+1,- sStart = oSettings.fnFormatNumber( iStart ),- iEnd = oSettings.fnDisplayEnd(),- sEnd = oSettings.fnFormatNumber( iEnd ),- iTotal = oSettings.fnRecordsDisplay(),- sTotal = oSettings.fnFormatNumber( iTotal ),- iMax = oSettings.fnRecordsTotal(),- sMax = oSettings.fnFormatNumber( iMax );-- return str.- replace(/_START_/g, sStart).- replace(/_END_/g, sEnd).- replace(/_TOTAL_/g, sTotal).- replace(/_MAX_/g, sMax);- }---- /**- * Draw the table for the first time, adding all required features- * @param {object} oSettings dataTables settings object- * @memberof DataTable#oApi- */- function _fnInitialise ( oSettings )- {- var i, iLen, iAjaxStart=oSettings.iInitDisplayStart;-- /* Ensure that the table data is fully initialised */- if ( oSettings.bInitialised === false )- {- setTimeout( function(){ _fnInitialise( 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 )- {- var aoData = [];- _fnServerParams( oSettings, aoData );- oSettings.fnServerData.call( oSettings.oInstance, oSettings.sAjaxSource, aoData, function(json) {- var aData = (oSettings.sAjaxDataProp !== "") ?- _fnGetObjectDataFn( oSettings.sAjaxDataProp )(json) : 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 );- }- }--- /**- * Draw the table for the first time, adding all required features- * @param {object} oSettings dataTables settings object- * @param {object} [json] JSON from the server that completed the table, if using Ajax source- * with client-side processing (optional)- * @memberof DataTable#oApi- */- function _fnInitComplete ( oSettings, json )- {- oSettings._bInitComplete = true;- _fnCallbackFire( oSettings, 'aoInitComplete', 'init', [oSettings, json] );- }---- /**- * Generate the node required for user display length changing- * @param {object} oSettings dataTables settings object- * @returns {node} Display length feature node- * @memberof DataTable#oApi- */- 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 = 'name="'+oSettings.sTableId+'_length"';- var sStdMenu = '<select size="1" '+sName+'>';- var i, iLen;- var aLengthMenu = oSettings.aLengthMenu;-- if ( aLengthMenu.length == 2 && typeof aLengthMenu[0] === 'object' &&- typeof aLengthMenu[1] === 'object' )- {- for ( i=0, iLen=aLengthMenu[0].length ; i<iLen ; i++ )- {- sStdMenu += '<option value="'+aLengthMenu[0][i]+'">'+aLengthMenu[1][i]+'</option>';- }- }- else- {- for ( i=0, iLen=aLengthMenu.length ; i<iLen ; i++ )- {- sStdMenu += '<option value="'+aLengthMenu[i]+'">'+aLengthMenu[i]+'</option>';- }- }- sStdMenu += '</select>';-- var nLength = document.createElement( 'div' );- if ( !oSettings.aanFeatures.l )- {- nLength.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 );- } );--- $('select', nLength).attr('aria-controls', oSettings.sTableId);-- return nLength;- }--- /**- * Recalculate the end point based on the start point- * @param {object} oSettings dataTables settings object- * @memberof DataTable#oApi- */- 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;- }- }- }---- /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *- * Note that most of the paging logic is done in- * DataTable.ext.oPagination- */-- /**- * Generate the node required for default pagination- * @param {object} oSettings dataTables settings object- * @returns {node} Pagination feature node- * @memberof DataTable#oApi- */- function _fnFeatureHtmlPaginate ( oSettings )- {- if ( oSettings.oScroll.bInfinite )- {- return null;- }-- var nPaginate = document.createElement( 'div' );- nPaginate.className = oSettings.oClasses.sPaging+oSettings.sPaginationType;-- DataTable.ext.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 ( !oSettings.aanFeatures.p )- {- oSettings.aoDrawCallback.push( {- "fn": function( oSettings ) {- DataTable.ext.oPagination[ oSettings.sPaginationType ].fnUpdate( oSettings, function( oSettings ) {- _fnCalculateEnd( oSettings );- _fnDraw( oSettings );- } );- },- "sName": "pagination"- } );- }- return nPaginate;- }--- /**- * Alter the display settings to change the page- * @param {object} oSettings dataTables settings object- * @param {string|int} mAction Paging action to take: "first", "previous", "next" or "last"- * or page number to jump to (integer)- * @returns {bool} true page has changed, false - no change (no effect) eg 'first' on page 1- * @memberof DataTable#oApi- */- function _fnPageChange ( oSettings, mAction )- {- var iOldStart = oSettings._iDisplayStart;-- if ( typeof mAction === "number" )- {- oSettings._iDisplayStart = mAction * oSettings._iDisplayLength;- if ( oSettings._iDisplayStart > oSettings.fnRecordsDisplay() )- {- oSettings._iDisplayStart = 0;- }- }- else if ( mAction == "first" )- {- oSettings._iDisplayStart = 0;- }- else if ( mAction == "previous" )- {- oSettings._iDisplayStart = oSettings._iDisplayLength>=0 ?- oSettings._iDisplayStart - oSettings._iDisplayLength :- 0;-- /* Correct for under-run */- if ( oSettings._iDisplayStart < 0 )- {- oSettings._iDisplayStart = 0;- }- }- else if ( mAction == "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 ( mAction == "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: "+mAction );- }- $(oSettings.oInstance).trigger('page', oSettings);-- return iOldStart != oSettings._iDisplayStart;- }---- /**- * Generate the node required for the processing node- * @param {object} oSettings dataTables settings object- * @returns {node} Processing element- * @memberof DataTable#oApi- */- function _fnFeatureHtmlProcessing ( oSettings )- {- var nProcessing = document.createElement( 'div' );-- if ( !oSettings.aanFeatures.r )- {- nProcessing.id = oSettings.sTableId+'_processing';- }- nProcessing.innerHTML = oSettings.oLanguage.sProcessing;- nProcessing.className = oSettings.oClasses.sProcessing;- oSettings.nTable.parentNode.insertBefore( nProcessing, oSettings.nTable );-- return nProcessing;- }--- /**- * Display or hide the processing indicator- * @param {object} oSettings dataTables settings object- * @param {bool} bShow Show the processing indicator (true) or not (false)- * @memberof DataTable#oApi- */- 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";- }- }-- $(oSettings.oInstance).trigger('processing', [oSettings, bShow]);- }-- /**- * Add any control elements for the table - specifically scrolling- * @param {object} oSettings dataTables settings object- * @returns {node} Node to add to the DOM- * @memberof DataTable#oApi- */- function _fnFeatureHtmlTable ( oSettings )- {- /* Check 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 = oSettings.oClasses;-- 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 = oSettings.oScroll.sXInner !== "" ?- oSettings.oScroll.sXInner : "100%"; /* 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 caption elements from the body to the header, footer or leave where it is- * depending on the configuration. Note that the DTD says there can be only one caption */- var nCaption = $(oSettings.nTable).children('caption');- if ( nCaption.length > 0 )- {- nCaption = nCaption[0];- if ( nCaption._captionSide === "top" )- {- nScrollHeadTable.appendChild( nCaption );- }- else if ( nCaption._captionSide === "bottom" && nTfoot )- {- nScrollFootTable.appendChild( nCaption );- }- }-- /*- * Sizing- */- /* When x-scrolling 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 && $(this).scrollTop() !== 0 )- {- /* 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;- }--- /**- * Update the various tables for resizing. 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- * @param {object} o dataTables settings object- * @returns {node} Node to add to the DOM- * @memberof DataTable#oApi- */- 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,- nTheadSize, nTfootSize,- iWidth, aApplied=[], aAppliedFooter=[], iSanityWidth,- nScrollFootInner = (o.nTFoot !== null) ? o.nScrollFoot.getElementsByTagName('div')[0] : null,- nScrollFootTable = (o.nTFoot !== null) ? nScrollFootInner.getElementsByTagName('table')[0] : null,- ie67 = o.oBrowser.bScrollOversize,- zeroOut = function(nSizer) {- oStyle = nSizer.style;- oStyle.paddingTop = "0";- oStyle.paddingBottom = "0";- oStyle.borderTopWidth = "0";- oStyle.borderBottomWidth = "0";- oStyle.height = 0;- };-- /*- * 1. Re-create the table inside the scrolling div- */-- /* Remove the old minimised thead and tfoot elements in the inner table */- $(o.nTable).children('thead, tfoot').remove();-- /* Clone the current header and footer elements and then place it into the inner table */- nTheadSize = $(o.nTHead).clone()[0];- o.nTable.insertBefore( nTheadSize, o.nTable.childNodes[0] );- anHeadToSize = o.nTHead.getElementsByTagName('tr');- anHeadSizers = nTheadSize.getElementsByTagName('tr');-- if ( o.nTFoot !== null )- {- nTfootSize = $(o.nTFoot).clone()[0];- o.nTable.insertBefore( nTfootSize, o.nTable.childNodes[1] );- anFootToSize = o.nTFoot.getElementsByTagName('tr');- anFootSizers = nTfootSize.getElementsByTagName('tr');- }-- /*- * 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- * calculated 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 = "";- }, anFootSizers );- }-- // If scroll collapse is enabled, when we put the headers back into the body for sizing, we- // will end up forcing the scrollbar to appear, making our measurements wrong for when we- // then hide it (end of this function), so add the header height to the body scroller.- if ( o.oScroll.bCollapse && o.oScroll.sY !== "" )- {- nScrollBody.style.height = (nScrollBody.offsetHeight + o.nTHead.offsetHeight)+"px";- }-- /* 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. When there is a scrollbar we need to take this- * into account.- */- if ( ie67 && ($('tbody', nScrollBody).height() > nScrollBody.offsetHeight ||- $(nScrollBody).css('overflow-y') == "scroll") )- {- 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();-- /* We want the hidden header to have zero height, so remove padding and borders. Then- * set the width based on the real headers- */-- // Apply all styles in one pass. Invalidates layout only once because we don't read any- // DOM properties.- _fnApplyToChildren( zeroOut, anHeadSizers );-- // Read all widths in next pass. Forces layout only once because we do not change- // any DOM properties.- _fnApplyToChildren( function(nSizer) {- aApplied.push( _fnStringToCss( $(nSizer).width() ) );- }, anHeadSizers );-- // Apply all widths in final pass. Invalidates layout only once because we do not- // read any DOM properties.- _fnApplyToChildren( function(nToSize, i) {- nToSize.style.width = aApplied[i];- }, anHeadToSize );-- $(anHeadSizers).height(0);-- /* Same again with the footer if we have one */- if ( o.nTFoot !== null )- {- _fnApplyToChildren( zeroOut, anFootSizers );-- _fnApplyToChildren( function(nSizer) {- aAppliedFooter.push( _fnStringToCss( $(nSizer).width() ) );- }, anFootSizers );-- _fnApplyToChildren( function(nToSize, i) {- nToSize.style.width = aAppliedFooter[i];- }, 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, i) {- nSizer.innerHTML = "";- nSizer.style.width = aApplied[i];- }, anHeadSizers );-- if ( o.nTFoot !== null )- {- _fnApplyToChildren( function(nSizer, i) {- nSizer.innerHTML = "";- nSizer.style.width = aAppliedFooter[i];- }, anFootSizers );- }-- /* Sanity check that the table is of a sensible width. If not then we are going to get- * misalignment - try to prevent this by not allowing the table to shrink below its min width- */- if ( $(o.nTable).outerWidth() < iSanityWidth )- {- /* The min width depends upon if we have a vertical scrollbar visible or not */- var iCorrection = ((nScrollBody.scrollHeight > nScrollBody.offsetHeight ||- $(nScrollBody).css('overflow-y') == "scroll")) ?- iSanityWidth+o.oScroll.iBarWidth : iSanityWidth;-- /* IE6/7 are a law unto themselves... */- if ( ie67 && (nScrollBody.scrollHeight >- nScrollBody.offsetHeight || $(nScrollBody).css('overflow-y') == "scroll") )- {- o.nTable.style.width = _fnStringToCss( iCorrection-o.oScroll.iBarWidth );- }-- /* Apply the calculated minimum width to the table wrappers */- nScrollBody.style.width = _fnStringToCss( iCorrection );- o.nScrollHead.style.width = _fnStringToCss( iCorrection );-- if ( o.nTFoot !== null )- {- o.nScrollFoot.style.width = _fnStringToCss( iCorrection );- }-- /* And give the user a warning that we've stopped the table getting too small */- if ( o.oScroll.sX === "" )- {- _fnLog( o, 1, "The table cannot fit into the current element which will cause column"+- " misalignment. The table has been drawn at its minimum possible width." );- }- else if ( o.oScroll.sXInner !== "" )- {- _fnLog( o, 1, "The table cannot fit into the current element which will cause column"+- " misalignment. Increase the sScrollXInner value or remove it to allow automatic"+- " calculation" );- }- }- else- {- nScrollBody.style.width = _fnStringToCss( '100%' );- o.nScrollHead.style.width = _fnStringToCss( '100%' );-- if ( o.nTFoot !== null )- {- o.nScrollFoot.style.width = _fnStringToCss( '100%' );- }- }--- /*- * 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 ( ie67 )- {- 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.offsetHeight+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 );-- // Figure out if there are scrollbar present - if so then we need a the header and footer to- // provide a bit more space to allow "overflow" scrolling (i.e. past the scrollbar)- var bScrolling = $(o.nTable).height() > nScrollBody.clientHeight || $(nScrollBody).css('overflow-y') == "scroll";- nScrollHeadInner.style.paddingRight = bScrolling ? o.oScroll.iBarWidth+"px" : "0px";-- if ( o.nTFoot !== null )- {- nScrollFootTable.style.width = _fnStringToCss( iOuterWidth );- nScrollFootInner.style.width = _fnStringToCss( iOuterWidth );- nScrollFootInner.style.paddingRight = bScrolling ? o.oScroll.iBarWidth+"px" : "0px";- }-- /* Adjust the position of the header in case we loose the y-scrollbar */- $(nScrollBody).scroll();-- /* If sorting or filtering has occurred, jump the scrolling back to the top */- if ( o.bSorted || o.bFiltered )- {- nScrollBody.scrollTop = 0;- }- }--- /**- * Apply a given function to the display child nodes of an element array (typically- * TD children of TR rows- * @param {function} fn Method to apply to the objects- * @param array {nodes} an1 List of elements to look through for display children- * @param array {nodes} an2 Another list (identical structure to the first) - optional- * @memberof DataTable#oApi- */- function _fnApplyToChildren( fn, an1, an2 )- {- var index=0, i=0, iLen=an1.length;- var nNode1, nNode2;-- while ( i < iLen )- {- nNode1 = an1[i].firstChild;- nNode2 = an2 ? an2[i].firstChild : null;- while ( nNode1 )- {- if ( nNode1.nodeType === 1 )- {- if ( an2 )- {- fn( nNode1, nNode2, index );- }- else- {- fn( nNode1, index );- }- index++;- }- nNode1 = nNode1.nextSibling;- nNode2 = an2 ? nNode2.nextSibling : null;- }- i++;- }- }-- /**- * Convert a CSS unit width to pixels (e.g. 2em)- * @param {string} sWidth width to be converted- * @param {node} nParent parent to get the with for (required for relative widths) - optional- * @returns {int} iWidth width in pixels- * @memberof DataTable#oApi- */- function _fnConvertToWidth ( sWidth, nParent )- {- if ( !sWidth || sWidth === null || sWidth === '' )- {- return 0;- }-- if ( !nParent )- {- nParent = document.body;- }-- var iWidth;- var nTmp = document.createElement( "div" );- nTmp.style.width = _fnStringToCss( sWidth );-- nParent.appendChild( nTmp );- iWidth = nTmp.offsetWidth;- nParent.removeChild( nTmp );-- return ( iWidth );- }--- /**- * Calculate the width of columns for the table- * @param {object} oSettings dataTables settings object- * @memberof DataTable#oApi- */- 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);- var widthAttr = oSettings.nTable.getAttribute('width');- var nWrapper = oSettings.nTable.parentNode;-- /* 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,- nWrapper );- 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 */- 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 );- }- else if ( widthAttr )- {- nCalcTmp.style.width = _fnStringToCss( widthAttr );- }- 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++;- }- }-- var cssWidth = $(nCalcTmp).css('width');- oSettings.nTable.style.width = (cssWidth.indexOf('%') !== -1) ?- cssWidth : _fnStringToCss( $(nCalcTmp).outerWidth() );- nCalcTmp.parentNode.removeChild( nCalcTmp );- }-- if ( widthAttr )- {- oSettings.nTable.style.width = _fnStringToCss( widthAttr );- }- }--- /**- * Adjust a table's width to take account of scrolling- * @param {object} oSettings dataTables settings object- * @param {node} n table node- * @memberof DataTable#oApi- */- 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() );- }- }--- /**- * Get the widest node- * @param {object} oSettings dataTables settings object- * @param {int} iCol column of interest- * @returns {node} widest table node- * @memberof DataTable#oApi- */- 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];- }--- /**- * Get the maximum strlen for each data column- * @param {object} oSettings dataTables settings object- * @param {int} iCol column of interest- * @returns {string} max string length for each column- * @memberof DataTable#oApi- */- 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;- }--- /**- * Append a CSS unit (only if required) to a string- * @param {array} aArray1 first array- * @param {array} aArray2 second array- * @returns {int} 0 if match, 1 if length is different, 2 if no match- * @memberof DataTable#oApi- */- 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";- }--- /**- * Get the width of a scroll bar in this browser being used- * @returns {int} width in pixels- * @memberof DataTable#oApi- */- function _fnScrollBarWidth ()- {- var inner = document.createElement('p');- var style = inner.style;- style.width = "100%";- style.height = "200px";- style.padding = "0px";-- 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.padding = "0px";- 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);- }-- /**- * Change the order of the table- * @param {object} oSettings dataTables settings object- * @param {bool} bApplyClasses optional - should we apply classes or not- * @memberof DataTable#oApi- * @todo This really needs split up!- */- function _fnSort ( oSettings, bApplyClasses )- {- var- i, iLen, j, jLen, k, kLen,- sDataType, nTh,- aSort = [],- aiOrig = [],- oExtSort = DataTable.ext.oSort,- aoData = oSettings.aoData,- aoColumns = oSettings.aoColumns,- oAria = oSettings.oLanguage.oAria,- fnFormatter, aDataSort, data, iCol, sType, oSort,- iFormatters = 0,- aaNestedSort = ( oSettings.aaSortingFixed !== null ) ?- oSettings.aaSortingFixed.concat( oSettings.aaSorting ) :- oSettings.aaSorting.slice();-- /* Flatten the aDataSort inner arrays into a single array, otherwise we have nested- * loops in multiple locations- */- for ( i=0 ; i<aaNestedSort.length ; i++ )- {- aDataSort = aoColumns[ aaNestedSort[i][0] ].aDataSort;-- for ( k=0, kLen=aDataSort.length ; k<kLen ; k++ )- {- iCol = aDataSort[k];- sType = aoColumns[ iCol ].sType || 'string';- fnFormatter = oExtSort[ sType+"-pre" ];-- aSort.push( {- col: iCol,- dir: aaNestedSort[i][1],- index: aaNestedSort[i][2],- type: sType,- format: fnFormatter- } );-- // Track if we can use the formatter method- if ( fnFormatter )- {- iFormatters++;- }- }- }-- /* No sorting required if server-side or no sorting array */- if ( !oSettings.oFeatures.bServerSide && aSort.length !== 0 )- {- /* If there is a sorting data type, and a function 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<aSort.length ; i++ )- {- var iColumn = aSort[i].col;- var iVisColumn = _fnColumnIndexToVisible( oSettings, iColumn );-- sDataType = oSettings.aoColumns[ iColumn ].sSortDataType;- if ( DataTable.ext.afnSortData[sDataType] )- {- var aData = DataTable.ext.afnSortData[sDataType].call(- oSettings.oInstance, oSettings, iColumn, iVisColumn- );- if ( aData.length === aoData.length )- {- for ( j=0, jLen=aoData.length ; j<jLen ; j++ )- {- _fnSetCellData( oSettings, j, iColumn, aData[j] );- }- }- else- {- _fnLog( oSettings, 0, "Returned data sort array (col "+iColumn+") is the wrong length" );- }- }- }--- /* 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;- }-- /* Build an internal data array which is specific to the sort, so we can get and prep- * the data to be sorted only once, rather than needing to do it every time the sorting- * function runs. This make the sorting function a very simple comparison- */- for ( j=0 ; j<aSort.length ; j++ )- {- oSort = aSort[j];-- for ( i=0, iLen=aoData.length ; i<iLen ; i++ )- {- data = _fnGetCellData( oSettings, i, oSort.col, 'sort' );-- aoData[i]._aSortData[ oSort.col ] = oSort.format ?- oSort.format( data ) :- data;- }- }-- /* 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.- *- * Note - I know it seems excessive to have two sorting methods, but the first is around- * 15% faster, so the second is only maintained for backwards compatibility with sorting- * methods which do not have a pre-sort formatting function.- */- if ( iFormatters === aSort.length ) {- // All sort types have formatting functions- oSettings.aiDisplayMaster.sort( function ( a, b ) {- var- x, y, k, test, sort,- len=aSort.length,- dataA = aoData[a]._aSortData,- dataB = aoData[b]._aSortData;-- for ( k=0 ; k<len ; k++ )- {- sort = aSort[k];-- x = dataA[ sort.col ];- y = dataB[ sort.col ];-- test = x<y ? -1 : x>y ? 1 : 0;- if ( test !== 0 )- {- return sort.dir === 'asc' ? test : -test;- }- }-- x = aiOrig[a];- y = aiOrig[b];- return x<y ? -1 : x>y ? 1 : 0;- } );- }- else {- // Depreciated - remove in 1.11 (providing a plug-in option)- // Not all sort types have formatting methods, so we have to call their sorting- // methods.- oSettings.aiDisplayMaster.sort( function ( a, b ) {- var- x, y, k, l, test, sort,- len=aSort.length,- dataA = aoData[a]._aSortData,- dataB = aoData[b]._aSortData;-- for ( k=0 ; k<len ; k++ )- {- sort = aSort[k];-- x = dataA[ sort.col ];- y = dataB[ sort.col ];-- test = oExtSort[ sort.type+"-"+sort.dir ]( x, y );- if ( test !== 0 )- {- return test;- }- }-- x = aiOrig[a];- y = aiOrig[b];- return x<y ? -1 : x>y ? 1 : 0;- } );- }- }-- /* Alter the sorting classes to take account of the changes */- if ( (bApplyClasses === undefined || bApplyClasses) && !oSettings.oFeatures.bDeferRender )- {- _fnSortingClasses( oSettings );- }-- for ( i=0, iLen=oSettings.aoColumns.length ; i<iLen ; i++ )- {- var sTitle = aoColumns[i].sTitle.replace( /<.*?>/g, "" );- nTh = aoColumns[i].nTh;- nTh.removeAttribute('aria-sort');- nTh.removeAttribute('aria-label');-- /* In ARIA only the first sorting column can be marked as sorting - no multi-sort option */- if ( aoColumns[i].bSortable )- {- if ( aSort.length > 0 && aSort[0].col == i )- {- nTh.setAttribute('aria-sort', aSort[0].dir=="asc" ? "ascending" : "descending" );-- var nextSort = (aoColumns[i].asSorting[ aSort[0].index+1 ]) ?- aoColumns[i].asSorting[ aSort[0].index+1 ] : aoColumns[i].asSorting[0];- nTh.setAttribute('aria-label', sTitle+- (nextSort=="asc" ? oAria.sSortAscending : oAria.sSortDescending) );- }- else- {- nTh.setAttribute('aria-label', sTitle+- (aoColumns[i].asSorting[0]=="asc" ? oAria.sSortAscending : oAria.sSortDescending) );- }- }- else- {- nTh.setAttribute('aria-label', sTitle);- }- }-- /* Tell the draw function that we have sorted the data */- oSettings.bSorted = true;- $(oSettings.oInstance).trigger('sort', oSettings);-- /* 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 );- }- }--- /**- * Attach a sort handler (click) to a node- * @param {object} oSettings dataTables settings object- * @param {node} nNode node to attach the handler to- * @param {int} iDataIndex column sorting index- * @param {function} [fnCallback] callback function- * @memberof DataTable#oApi- */- function _fnSortAttachListener ( oSettings, nNode, iDataIndex, fnCallback )- {- _fnBindAction( nNode, {}, 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 executing- * 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 only do it when we absolutely have to.- */- var fnInnerSorting = function () {- var iColumn, iNextSort;-- /* If the shift key is pressed then we are multiple 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 ( !oSettings.aoColumns[iColumn].asSorting[iNextSort] )- {- /* 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 ( !oSettings.aoColumns[iColumn].asSorting[iNextSort] )- {- 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 );- }- } );- }--- /**- * Set the sorting classes on the header, Note: it is safe to call this function- * when bSort and bSortClasses are false- * @param {object} oSettings dataTables settings object- * @memberof DataTable#oApi- */- 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."+oClasses.sSortIcon, 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 admittedly fairly ugly. It could be made a lot- * simpler 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 deferred 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 );-- /* Determine what the sorting class for each column should be */- var iClass, iTargetCol;- var asClasses = [];- for (i = 0; i < iColumns; i++)- {- asClasses.push("");- }- for (i = 0, iClass = 1; i < aaSort.length; i++)- {- iTargetCol = parseInt( aaSort[i][0], 10 );- asClasses[iTargetCol] = sClass + iClass;-- if ( iClass < 3 )- {- iClass++;- }- }-- /* Make changes to the classes for each cell as needed */- var reClass = new RegExp(sClass + "[123]");- var sTmpClass, sCurrentClass, sNewClass;- for ( i=0, iLen=nTds.length; i<iLen; i++ )- {- /* Determine which column we're looking at */- iTargetCol = i % iColumns;-- /* What is the full list of classes now */- sCurrentClass = nTds[i].className;- /* What sorting class should be applied? */- sNewClass = asClasses[iTargetCol];- /* What would the new full list be if we did a replacement? */- sTmpClass = sCurrentClass.replace(reClass, sNewClass);-- if ( sTmpClass != sCurrentClass )- {- /* We changed something */- nTds[i].className = $.trim( sTmpClass );- }- else if ( sNewClass.length > 0 && sCurrentClass.indexOf(sNewClass) == -1 )- {- /* We need to add a class */- nTds[i].className = sCurrentClass + " " + sNewClass;- }- }- }- }---- /**- * Save the state of a table in a cookie such that the page can be reloaded- * @param {object} oSettings dataTables settings object- * @memberof DataTable#oApi- */- function _fnSaveState ( oSettings )- {- if ( !oSettings.oFeatures.bStateSave || oSettings.bDestroying )- {- return;- }-- /* Store the interesting variables */- var i, iLen, bInfinite=oSettings.oScroll.bInfinite;- var oState = {- "iCreate": new Date().getTime(),- "iStart": (bInfinite ? 0 : oSettings._iDisplayStart),- "iEnd": (bInfinite ? oSettings._iDisplayLength : oSettings._iDisplayEnd),- "iLength": oSettings._iDisplayLength,- "aaSorting": $.extend( true, [], oSettings.aaSorting ),- "oSearch": $.extend( true, {}, oSettings.oPreviousSearch ),- "aoSearchCols": $.extend( true, [], oSettings.aoPreSearchCols ),- "abVisCols": []- };-- for ( i=0, iLen=oSettings.aoColumns.length ; i<iLen ; i++ )- {- oState.abVisCols.push( oSettings.aoColumns[i].bVisible );- }-- _fnCallbackFire( oSettings, "aoStateSaveParams", 'stateSaveParams', [oSettings, oState] );-- oSettings.fnStateSave.call( oSettings.oInstance, oSettings, oState );- }--- /**- * Attempt to load a saved table state from a cookie- * @param {object} oSettings dataTables settings object- * @param {object} oInit DataTables init object so we can override settings- * @memberof DataTable#oApi- */- function _fnLoadState ( oSettings, oInit )- {- if ( !oSettings.oFeatures.bStateSave )- {- return;- }-- var oData = oSettings.fnStateLoad.call( oSettings.oInstance, oSettings );- if ( !oData )- {- return;- }-- /* Allow custom and plug-in manipulation functions to alter the saved data set and- * cancelling of loading by returning false- */- var abStateLoad = _fnCallbackFire( oSettings, 'aoStateLoadParams', 'stateLoadParams', [oSettings, oData] );- if ( $.inArray( false, abStateLoad ) !== -1 )- {- return;- }-- /* Store the saved state so it might be accessed at any time */- 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.aaSorting = oData.aaSorting.slice();- oSettings.saved_aaSorting = oData.aaSorting.slice();-- /* Search filtering */- $.extend( oSettings.oPreviousSearch, oData.oSearch );- $.extend( true, oSettings.aoPreSearchCols, oData.aoSearchCols );-- /* Column visibility state- * Pass back visibility 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 ( var i=0 ; i<oData.abVisCols.length ; i++ )- {- oInit.saved_aoColumns[i] = {};- oInit.saved_aoColumns[i].bVisible = oData.abVisCols[i];- }-- _fnCallbackFire( oSettings, 'aoStateLoaded', 'stateLoaded', [oSettings, oData] );- }--- /**- * Create a new cookie with a value to store the state of a table- * @param {string} sName name of the cookie to create- * @param {string} sValue the value the cookie should take- * @param {int} iSecs duration of the cookie- * @param {string} sBaseName sName is made up of the base + file name - this is the base- * @param {function} fnCallback User definable function to modify the cookie- * @memberof DataTable#oApi- */- 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.- */- var- aCookies =document.cookie.split(';'),- iNewCookieLen = sFullCookie.split(';')[0].length,- aOldCookies = [];-- if ( iNewCookieLen+document.cookie.length+10 > 4096 ) /* Magic 10 for padding */- {- 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])+')' );-- if ( oData && oData.iCreate )- {- aOldCookies.push( {- "name": aSplitCookie[0],- "time": oData.iCreate- } );- }- }- catch( e ) {}- }- }-- // Make sure we delete the oldest ones first- aOldCookies.sort( function (a, b) {- return b.time - a.time;- } );-- // Eliminate as many old DataTables cookies as we need to- while ( iNewCookieLen + document.cookie.length + 10 > 4096 ) {- if ( aOldCookies.length === 0 ) {- // Deleted all DT cookies and still not enough space. Can't state save- return;- }-- var old = aOldCookies.pop();- document.cookie = old.name+"=; expires=Thu, 01-Jan-1970 00:00:01 GMT; path="+- aParts.join('/') + "/";- }- }-- document.cookie = sFullCookie;- }--- /**- * Read an old cookie to get a cookie with an old table state- * @param {string} sName name of the cookie to read- * @returns {string} contents of the cookie - or null if no cookie with that name found- * @memberof DataTable#oApi- */- 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;- }--- /**- * Return the settings object for a particular table- * @param {node} nTable table we are using as a dataTable- * @returns {object} Settings object - or null if not found- * @memberof DataTable#oApi- */- function _fnSettingsFromNode ( nTable )- {- for ( var i=0 ; i<DataTable.settings.length ; i++ )- {- if ( DataTable.settings[i].nTable === nTable )- {- return DataTable.settings[i];- }- }-- return null;- }--- /**- * Return an array with the TR nodes for the table- * @param {object} oSettings dataTables settings object- * @returns {array} TR array- * @memberof DataTable#oApi- */- function _fnGetTrNodes ( oSettings )- {- var aNodes = [];- var aoData = oSettings.aoData;- for ( var i=0, iLen=aoData.length ; i<iLen ; i++ )- {- if ( aoData[i].nTr !== null )- {- aNodes.push( aoData[i].nTr );- }- }- return aNodes;- }--- /**- * Return an flat array with all TD nodes for the table, or row- * @param {object} oSettings dataTables settings object- * @param {int} [iIndividualRow] aoData index to get the nodes for - optional- * if not given then the return array will contain all nodes for the table- * @returns {array} TD array- * @memberof DataTable#oApi- */- function _fnGetTdNodes ( oSettings, iIndividualRow )- {- var anReturn = [];- var iCorrector;- var anTds, nTd;- 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 ( 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 = [];- nTd = oData.nTr.firstChild;- while ( nTd )- {- sNodeName = nTd.nodeName.toLowerCase();- if ( sNodeName == 'td' || sNodeName == 'th' )- {- anTds.push( nTd );- }- nTd = nTd.nextSibling;- }-- 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;- }--- /**- * Log an error message- * @param {object} oSettings dataTables settings object- * @param {int} iLevel log error messages, or display them to the user- * @param {string} sMesg error message- * @memberof DataTable#oApi- */- function _fnLog( oSettings, iLevel, sMesg )- {- var sAlert = (oSettings===null) ?- "DataTables warning: "+sMesg :- "DataTables warning (table id = '"+oSettings.sTableId+"'): "+sMesg;-- if ( iLevel === 0 )- {- if ( DataTable.ext.sErrMode == 'alert' )- {- alert( sAlert );- }- else- {- throw new Error(sAlert);- }- return;- }- else if ( window.console && console.log )- {- console.log( sAlert );- }- }--- /**- * See if a property is defined on one object, if so assign it to the other object- * @param {object} oRet target object- * @param {object} oSrc source object- * @param {string} sName property- * @param {string} [sMappedName] name to map too - optional, sName used if not given- * @memberof DataTable#oApi- */- function _fnMap( oRet, oSrc, sName, sMappedName )- {- if ( sMappedName === undefined )- {- sMappedName = sName;- }- if ( oSrc[sName] !== undefined )- {- oRet[sMappedName] = oSrc[sName];- }- }--- /**- * Extend objects - very similar to jQuery.extend, but deep copy objects, and shallow- * copy arrays. The reason we need to do this, is that we don't want to deep copy array- * init values (such as aaSorting) since the dev wouldn't be able to override them, but- * we do want to deep copy arrays.- * @param {object} oOut Object to extend- * @param {object} oExtender Object from which the properties will be applied to oOut- * @returns {object} oOut Reference, just for convenience - oOut === the return.- * @memberof DataTable#oApi- * @todo This doesn't take account of arrays inside the deep copied objects.- */- function _fnExtend( oOut, oExtender )- {- var val;-- for ( var prop in oExtender )- {- if ( oExtender.hasOwnProperty(prop) )- {- val = oExtender[prop];-- if ( typeof oExtender[prop] === 'object' && val !== null && $.isArray(val) === false )- {- $.extend( true, oOut[prop], val );- }- else- {- oOut[prop] = val;- }- }- }-- return oOut;- }--- /**- * Bind an event handers to allow a click or return key to activate the callback.- * This is good for accessibility since a return on the keyboard will have the- * same effect as a click, if the element has focus.- * @param {element} n Element to bind the action to- * @param {object} oData Data object to pass to the triggered function- * @param {function} fn Callback function for when the event is triggered- * @memberof DataTable#oApi- */- function _fnBindAction( n, oData, fn )- {- $(n)- .bind( 'click.DT', oData, function (e) {- n.blur(); // Remove focus outline for mouse users- fn(e);- } )- .bind( 'keypress.DT', oData, function (e){- if ( e.which === 13 ) {- fn(e);- } } )- .bind( 'selectstart.DT', function () {- /* Take the brutal approach to cancelling text selection */- return false;- } );- }--- /**- * Register a callback function. Easily allows a callback function to be added to- * an array store of callback functions that can then all be called together.- * @param {object} oSettings dataTables settings object- * @param {string} sStore Name of the array storage for the callbacks in oSettings- * @param {function} fn Function to be called back- * @param {string} sName Identifying name for the callback (i.e. a label)- * @memberof DataTable#oApi- */- function _fnCallbackReg( oSettings, sStore, fn, sName )- {- if ( fn )- {- oSettings[sStore].push( {- "fn": fn,- "sName": sName- } );- }- }--- /**- * Fire callback functions and trigger events. Note that the loop over the callback- * array store is done backwards! Further note that you do not want to fire off triggers- * in time sensitive applications (for example cell creation) as its slow.- * @param {object} oSettings dataTables settings object- * @param {string} sStore Name of the array storage for the callbacks in oSettings- * @param {string} sTrigger Name of the jQuery custom event to trigger. If null no trigger- * is fired- * @param {array} aArgs Array of arguments to pass to the callback function / trigger- * @memberof DataTable#oApi- */- function _fnCallbackFire( oSettings, sStore, sTrigger, aArgs )- {- var aoStore = oSettings[sStore];- var aRet =[];-- for ( var i=aoStore.length-1 ; i>=0 ; i-- )- {- aRet.push( aoStore[i].fn.apply( oSettings.oInstance, aArgs ) );- }-- if ( sTrigger !== null )- {- $(oSettings.oInstance).trigger(sTrigger, aArgs);- }-- return aRet;- }--- /**- * JSON stringify. If JSON.stringify it provided by the browser, json2.js or any other- * library, then we use that as it is fast, safe and accurate. If the function isn't- * available then we need to built it ourselves - the inspiration for this function comes- * from Craig Buckler ( http://www.sitepoint.com/javascript-json-serialization/ ). It is- * not perfect and absolutely should not be used as a replacement to json2.js - but it does- * do what we need, without requiring a dependency for DataTables.- * @param {object} o JSON object to be converted- * @returns {string} JSON string- * @memberof DataTable#oApi- */- var _fnJsonString = (window.JSON) ? JSON.stringify : function( o )- {- /* Not an object or array */- var sType = typeof o;- if (sType !== "object" || o === null)- {- // simple data type- if (sType === "string")- {- o = '"'+o+'"';- }- return o+"";- }-- /* If object or array, need to recurse over it */- var- sProp, mValue,- json = [],- bArr = $.isArray(o);-- for (sProp in o)- {- mValue = o[sProp];- sType = typeof mValue;-- if (sType === "string")- {- mValue = '"'+mValue+'"';- }- else if (sType === "object" && mValue !== null)- {- mValue = _fnJsonString(mValue);- }-- json.push((bArr ? "" : '"'+sProp+'":') + mValue);- }-- return (bArr ? "[" : "{") + json + (bArr ? "]" : "}");- };--- /**- * From some browsers (specifically IE6/7) we need special handling to work around browser- * bugs - this function is used to detect when these workarounds are needed.- * @param {object} oSettings dataTables settings object- * @memberof DataTable#oApi- */- function _fnBrowserDetect( oSettings )- {- /* IE6/7 will oversize a width 100% element inside a scrolling element, to include the- * width of the scrollbar, while other browsers ensure the inner element is contained- * without forcing scrolling- */- var n = $(- '<div style="position:absolute; top:0; left:0; height:1px; width:1px; overflow:hidden">'+- '<div style="position:absolute; top:1px; left:1px; width:100px; overflow:scroll;">'+- '<div id="DT_BrowserTest" style="width:100%; height:10px;"></div>'+- '</div>'+- '</div>')[0];-- document.body.appendChild( n );- oSettings.oBrowser.bScrollOversize = $('#DT_BrowserTest', n)[0].offsetWidth === 100 ? true : false;- document.body.removeChild( n );- }--- DataTable = function( oInit )- {- /**- * Perform a jQuery selector action on the table's TR elements (from the tbody) and- * return the resulting jQuery object.- * @param {string|node|jQuery} sSelector jQuery selector or node collection to act on- * @param {object} [oOpts] Optional parameters for modifying the rows to be included- * @param {string} [oOpts.filter=none] Select TR elements that meet the current filter- * criterion ("applied") or all TR elements (i.e. no filter).- * @param {string} [oOpts.order=current] Order of the TR elements in the processed array.- * Can be either 'current', whereby the current sorting of the table is used, or- * 'original' whereby the original order the data was read into the table is used.- * @param {string} [oOpts.page=all] Limit the selection to the currently displayed page- * ("current") or not ("all"). If 'current' is given, then order is assumed to be- * 'current' and filter is 'applied', regardless of what they might be given as.- * @returns {object} jQuery object, filtered by the given selector.- * @dtopt API- *- * @example- * $(document).ready(function() {- * var oTable = $('#example').dataTable();- *- * // Highlight every second row- * oTable.$('tr:odd').css('backgroundColor', 'blue');- * } );- *- * @example- * $(document).ready(function() {- * var oTable = $('#example').dataTable();- *- * // Filter to rows with 'Webkit' in them, add a background colour and then- * // remove the filter, thus highlighting the 'Webkit' rows only.- * oTable.fnFilter('Webkit');- * oTable.$('tr', {"filter": "applied"}).css('backgroundColor', 'blue');- * oTable.fnFilter('');- * } );- */- this.$ = function ( sSelector, oOpts )- {- var i, iLen, a = [], tr;- var oSettings = _fnSettingsFromNode( this[DataTable.ext.iApiIndex] );- var aoData = oSettings.aoData;- var aiDisplay = oSettings.aiDisplay;- var aiDisplayMaster = oSettings.aiDisplayMaster;-- if ( !oOpts )- {- oOpts = {};- }-- oOpts = $.extend( {}, {- "filter": "none", // applied- "order": "current", // "original"- "page": "all" // current- }, oOpts );-- // Current page implies that order=current and fitler=applied, since it is fairly- // senseless otherwise- if ( oOpts.page == 'current' )- {- for ( i=oSettings._iDisplayStart, iLen=oSettings.fnDisplayEnd() ; i<iLen ; i++ )- {- tr = aoData[ aiDisplay[i] ].nTr;- if ( tr )- {- a.push( tr );- }- }- }- else if ( oOpts.order == "current" && oOpts.filter == "none" )- {- for ( i=0, iLen=aiDisplayMaster.length ; i<iLen ; i++ )- {- tr = aoData[ aiDisplayMaster[i] ].nTr;- if ( tr )- {- a.push( tr );- }- }- }- else if ( oOpts.order == "current" && oOpts.filter == "applied" )- {- for ( i=0, iLen=aiDisplay.length ; i<iLen ; i++ )- {- tr = aoData[ aiDisplay[i] ].nTr;- if ( tr )- {- a.push( tr );- }- }- }- else if ( oOpts.order == "original" && oOpts.filter == "none" )- {- for ( i=0, iLen=aoData.length ; i<iLen ; i++ )- {- tr = aoData[ i ].nTr ;- if ( tr )- {- a.push( tr );- }- }- }- else if ( oOpts.order == "original" && oOpts.filter == "applied" )- {- for ( i=0, iLen=aoData.length ; i<iLen ; i++ )- {- tr = aoData[ i ].nTr;- if ( $.inArray( i, aiDisplay ) !== -1 && tr )- {- a.push( tr );- }- }- }- else- {- _fnLog( oSettings, 1, "Unknown selection options" );- }-- /* We need to filter on the TR elements and also 'find' in their descendants- * to make the selector act like it would in a full table - so we need- * to build both results and then combine them together- */- var jqA = $(a);- var jqTRs = jqA.filter( sSelector );- var jqDescendants = jqA.find( sSelector );-- return $( [].concat($.makeArray(jqTRs), $.makeArray(jqDescendants)) );- };--- /**- * Almost identical to $ in operation, but in this case returns the data for the matched- * rows - as such, the jQuery selector used should match TR row nodes or TD/TH cell nodes- * rather than any descendants, so the data can be obtained for the row/cell. If matching- * rows are found, the data returned is the original data array/object that was used to- * create the row (or a generated array if from a DOM source).- *- * This method is often useful in-combination with $ where both functions are given the- * same parameters and the array indexes will match identically.- * @param {string|node|jQuery} sSelector jQuery selector or node collection to act on- * @param {object} [oOpts] Optional parameters for modifying the rows to be included- * @param {string} [oOpts.filter=none] Select elements that meet the current filter- * criterion ("applied") or all elements (i.e. no filter).- * @param {string} [oOpts.order=current] Order of the data in the processed array.- * Can be either 'current', whereby the current sorting of the table is used, or- * 'original' whereby the original order the data was read into the table is used.- * @param {string} [oOpts.page=all] Limit the selection to the currently displayed page- * ("current") or not ("all"). If 'current' is given, then order is assumed to be- * 'current' and filter is 'applied', regardless of what they might be given as.- * @returns {array} Data for the matched elements. If any elements, as a result of the- * selector, were not TR, TD or TH elements in the DataTable, they will have a null- * entry in the array.- * @dtopt API- *- * @example- * $(document).ready(function() {- * var oTable = $('#example').dataTable();- *- * // Get the data from the first row in the table- * var data = oTable._('tr:first');- *- * // Do something useful with the data- * alert( "First cell is: "+data[0] );- * } );- *- * @example- * $(document).ready(function() {- * var oTable = $('#example').dataTable();- *- * // Filter to 'Webkit' and get all data for- * oTable.fnFilter('Webkit');- * var data = oTable._('tr', {"filter": "applied"});- *- * // Do something with the data- * alert( data.length+" rows matched the filter" );- * } );- */- this._ = function ( sSelector, oOpts )- {- var aOut = [];- var i, iLen, iIndex;- var aTrs = this.$( sSelector, oOpts );-- for ( i=0, iLen=aTrs.length ; i<iLen ; i++ )- {- aOut.push( this.fnGetData(aTrs[i]) );- }-- return aOut;- };--- /**- * Add a single new row or multiple rows of data to the table. Please note- * that this is suitable for client-side processing only - if you are using- * server-side processing (i.e. "bServerSide": true), then to add data, you- * must add it to the data source, i.e. the server-side, through an Ajax call.- * @param {array|object} mData The data to be added to the table. This can be:- * <ul>- * <li>1D array of data - add a single row with the data provided</li>- * <li>2D array of arrays - add multiple rows in a single call</li>- * <li>object - data object when using <i>mData</i></li>- * <li>array of objects - multiple data objects when using <i>mData</i></li>- * </ul>- * @param {bool} [bRedraw=true] redraw the table or not- * @returns {array} An array of integers, representing the list of indexes in- * <i>aoData</i> ({@link DataTable.models.oSettings}) that have been added to- * the table.- * @dtopt API- *- * @example- * // Global var for counter- * var giCount = 2;- *- * $(document).ready(function() {- * $('#example').dataTable();- * } );- *- * function fnClickAddRow() {- * $('#example').dataTable().fnAddData( [- * giCount+".1",- * giCount+".2",- * giCount+".3",- * giCount+".4" ]- * );- *- * giCount++;- * }- */- this.fnAddData = function( mData, bRedraw )- {- if ( mData.length === 0 )- {- return [];- }-- var aiReturn = [];- var iTest;-- /* Find settings from table node */- var oSettings = _fnSettingsFromNode( this[DataTable.ext.iApiIndex] );-- /* Check if we want to add multiple rows or not */- if ( typeof mData[0] === "object" && mData[0] !== null )- {- 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 ( bRedraw === undefined || bRedraw )- {- _fnReDraw( oSettings );- }- return aiReturn;- };--- /**- * This function will make DataTables recalculate the column sizes, based on the data- * contained in the table and the sizes applied to the columns (in the DOM, CSS or- * through the sWidth parameter). This can be useful when the width of the table's- * parent element changes (for example a window resize).- * @param {boolean} [bRedraw=true] Redraw the table or not, you will typically want to- * @dtopt API- *- * @example- * $(document).ready(function() {- * var oTable = $('#example').dataTable( {- * "sScrollY": "200px",- * "bPaginate": false- * } );- *- * $(window).bind('resize', function () {- * oTable.fnAdjustColumnSizing();- * } );- * } );- */- this.fnAdjustColumnSizing = function ( bRedraw )- {- var oSettings = _fnSettingsFromNode(this[DataTable.ext.iApiIndex]);- _fnAdjustColumnSizing( oSettings );-- if ( 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);- }- };--- /**- * Quickly and simply clear a table- * @param {bool} [bRedraw=true] redraw the table or not- * @dtopt API- *- * @example- * $(document).ready(function() {- * var oTable = $('#example').dataTable();- *- * // Immediately 'nuke' the current rows (perhaps waiting for an Ajax callback...)- * oTable.fnClearTable();- * } );- */- this.fnClearTable = function( bRedraw )- {- /* Find settings from table node */- var oSettings = _fnSettingsFromNode( this[DataTable.ext.iApiIndex] );- _fnClearTable( oSettings );-- if ( bRedraw === undefined || bRedraw )- {- _fnDraw( oSettings );- }- };--- /**- * The exact opposite of 'opening' a row, this function will close any rows which- * are currently 'open'.- * @param {node} nTr the table row to 'close'- * @returns {int} 0 on success, or 1 if failed (can't find the row)- * @dtopt API- *- * @example- * $(document).ready(function() {- * var oTable;- *- * // 'open' an information row when a row is clicked on- * $('#example tbody tr').click( function () {- * if ( oTable.fnIsOpen(this) ) {- * oTable.fnClose( this );- * } else {- * oTable.fnOpen( this, "Temporary row opened", "info_row" );- * }- * } );- *- * oTable = $('#example').dataTable();- * } );- */- this.fnClose = function( nTr )- {- /* Find settings from table node */- var oSettings = _fnSettingsFromNode( this[DataTable.ext.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;- };--- /**- * Remove a row for the table- * @param {mixed} mTarget The index of the row from aoData to be deleted, or- * the TR element you want to delete- * @param {function|null} [fnCallBack] Callback function- * @param {bool} [bRedraw=true] Redraw the table or not- * @returns {array} The row that was deleted- * @dtopt API- *- * @example- * $(document).ready(function() {- * var oTable = $('#example').dataTable();- *- * // Immediately remove the first row- * oTable.fnDeleteRow( 0 );- * } );- */- this.fnDeleteRow = function( mTarget, fnCallBack, bRedraw )- {- /* Find settings from table node */- var oSettings = _fnSettingsFromNode( this[DataTable.ext.iApiIndex] );- var i, iLen, iAODataIndex;-- iAODataIndex = (typeof mTarget === 'object') ?- _fnNodeToDataIndex(oSettings, mTarget) : mTarget;-- /* Return the data array from this row */- var oData = oSettings.aoData.splice( iAODataIndex, 1 );-- /* Update the _DT_RowIndex parameter */- for ( i=0, iLen=oSettings.aoData.length ; i<iLen ; i++ )- {- if ( oSettings.aoData[i].nTr !== null )- {- oSettings.aoData[i].nTr._DT_RowIndex = i;- }- }-- /* 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 displaying the table */- if ( oSettings._iDisplayStart >= oSettings.fnRecordsDisplay() )- {- oSettings._iDisplayStart -= oSettings._iDisplayLength;- if ( oSettings._iDisplayStart < 0 )- {- oSettings._iDisplayStart = 0;- }- }-- if ( bRedraw === undefined || bRedraw )- {- _fnCalculateEnd( oSettings );- _fnDraw( oSettings );- }-- return oData;- };--- /**- * Restore the table to it's original state in the DOM by removing all of DataTables- * enhancements, alterations to the DOM structure of the table and event listeners.- * @param {boolean} [bRemove=false] Completely remove the table from the DOM- * @dtopt API- *- * @example- * $(document).ready(function() {- * // This example is fairly pointless in reality, but shows how fnDestroy can be used- * var oTable = $('#example').dataTable();- * oTable.fnDestroy();- * } );- */- this.fnDestroy = function ( bRemove )- {- var oSettings = _fnSettingsFromNode( this[DataTable.ext.iApiIndex] );- var nOrig = oSettings.nTableWrapper.parentNode;- var nBody = oSettings.nTBody;- var i, iLen;-- bRemove = (bRemove===undefined) ? false : bRemove;-- /* Flag to note that the table is currently being destroyed - no action should be taken */- oSettings.bDestroying = true;-- /* Fire off the destroy callbacks for plug-ins etc */- _fnCallbackFire( oSettings, "aoDestroyCallback", "destroy", [oSettings] );-- /* If the table is not being removed, restore the hidden columns */- if ( !bRemove )- {- 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 )- {- $(oSettings.nTable).children('thead').remove();- oSettings.nTable.appendChild( oSettings.nTHead );- }-- if ( oSettings.nTFoot && oSettings.nTable != oSettings.nTFoot.parentNode )- {- $(oSettings.nTable).children('tfoot').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.asStripeClasses.join(' ') );-- $('th, td', oSettings.nTHead).removeClass( [- oSettings.oClasses.sSortable,- oSettings.oClasses.sSortableAsc,- oSettings.oClasses.sSortableDesc,- oSettings.oClasses.sSortableNone ].join(' ')- );- if ( oSettings.bJUI )- {- $('th span.'+oSettings.oClasses.sSortIcon- + ', td span.'+oSettings.oClasses.sSortIcon, oSettings.nTHead).remove();-- $('th, td', oSettings.nTHead).each( function () {- var jqWrapper = $('div.'+oSettings.oClasses.sSortJUIWrapper, this);- var kids = jqWrapper.contents();- $(this).append( kids );- jqWrapper.remove();- } );- }-- /* Add the TR elements back into the table in their original order */- if ( !bRemove && oSettings.nTableReinsertBefore )- {- nOrig.insertBefore( oSettings.nTable, oSettings.nTableReinsertBefore );- }- else if ( !bRemove )- {- 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 stripe classes - then we add them back here. Note- * this is not fool proof (for example if not all rows had stripe classes - but- * it's a good effort without getting carried away- */- iLen = oSettings.asDestroyStripes.length;- if (iLen)- {- var anRows = $(nBody).children('tr');- for ( i=0 ; i<iLen ; i++ )- {- anRows.filter(':nth-child(' + iLen + 'n + ' + i + ')').addClass( oSettings.asDestroyStripes[i] );- }- }-- /* Remove the settings object from the settings array */- for ( i=0, iLen=DataTable.settings.length ; i<iLen ; i++ )- {- if ( DataTable.settings[i] == oSettings )- {- DataTable.settings.splice( i, 1 );- }- }-- /* End it all */- oSettings = null;- oInit = null;- };--- /**- * Redraw the table- * @param {bool} [bComplete=true] Re-filter and resort (if enabled) the table before the draw.- * @dtopt API- *- * @example- * $(document).ready(function() {- * var oTable = $('#example').dataTable();- *- * // Re-draw the table - you wouldn't want to do it here, but it's an example :-)- * oTable.fnDraw();- * } );- */- this.fnDraw = function( bComplete )- {- var oSettings = _fnSettingsFromNode( this[DataTable.ext.iApiIndex] );- if ( bComplete === false )- {- _fnCalculateEnd( oSettings );- _fnDraw( oSettings );- }- else- {- _fnReDraw( oSettings );- }- };--- /**- * Filter the input based on data- * @param {string} sInput String to filter the table on- * @param {int|null} [iColumn] Column to limit filtering to- * @param {bool} [bRegex=false] Treat as regular expression or not- * @param {bool} [bSmart=true] Perform smart filtering or not- * @param {bool} [bShowGlobal=true] Show the input global filter in it's input box(es)- * @param {bool} [bCaseInsensitive=true] Do case-insensitive matching (true) or not (false)- * @dtopt API- *- * @example- * $(document).ready(function() {- * var oTable = $('#example').dataTable();- *- * // Sometime later - filter...- * oTable.fnFilter( 'test string' );- * } );- */- this.fnFilter = function( sInput, iColumn, bRegex, bSmart, bShowGlobal, bCaseInsensitive )- {- var oSettings = _fnSettingsFromNode( this[DataTable.ext.iApiIndex] );-- if ( !oSettings.oFeatures.bFilter )- {- return;- }-- if ( bRegex === undefined || bRegex === null )- {- bRegex = false;- }-- if ( bSmart === undefined || bSmart === null )- {- bSmart = true;- }-- if ( bShowGlobal === undefined || bShowGlobal === null )- {- bShowGlobal = true;- }-- if ( bCaseInsensitive === undefined || bCaseInsensitive === null )- {- bCaseInsensitive = true;- }-- if ( iColumn === undefined || iColumn === null )- {- /* Global filter */- _fnFilterComplete( oSettings, {- "sSearch":sInput+"",- "bRegex": bRegex,- "bSmart": bSmart,- "bCaseInsensitive": bCaseInsensitive- }, 1 );-- if ( bShowGlobal && oSettings.aanFeatures.f )- {- var n = oSettings.aanFeatures.f;- for ( var i=0, iLen=n.length ; i<iLen ; i++ )- {- // IE9 throws an 'unknown error' if document.activeElement is used- // inside an iframe or frame...- try {- if ( n[i]._DT_Input != document.activeElement )- {- $(n[i]._DT_Input).val( sInput );- }- }- catch ( e ) {- $(n[i]._DT_Input).val( sInput );- }- }- }- }- else- {- /* Single column filter */- $.extend( oSettings.aoPreSearchCols[ iColumn ], {- "sSearch": sInput+"",- "bRegex": bRegex,- "bSmart": bSmart,- "bCaseInsensitive": bCaseInsensitive- } );- _fnFilterComplete( oSettings, oSettings.oPreviousSearch, 1 );- }- };--- /**- * Get the data for the whole table, an individual row or an individual cell based on the- * provided parameters.- * @param {int|node} [mRow] A TR row node, TD/TH cell node or an integer. If given as- * a TR node then the data source for the whole row will be returned. If given as a- * TD/TH cell node then iCol will be automatically calculated and the data for the- * cell returned. If given as an integer, then this is treated as the aoData internal- * data index for the row (see fnGetPosition) and the data for that row used.- * @param {int} [iCol] Optional column index that you want the data of.- * @returns {array|object|string} If mRow is undefined, then the data for all rows is- * returned. If mRow is defined, just data for that row, and is iCol is- * defined, only data for the designated cell is returned.- * @dtopt API- *- * @example- * // Row data- * $(document).ready(function() {- * oTable = $('#example').dataTable();- *- * oTable.$('tr').click( function () {- * var data = oTable.fnGetData( this );- * // ... do something with the array / object of data for the row- * } );- * } );- *- * @example- * // Individual cell data- * $(document).ready(function() {- * oTable = $('#example').dataTable();- *- * oTable.$('td').click( function () {- * var sData = oTable.fnGetData( this );- * alert( 'The cell clicked on had the value of '+sData );- * } );- * } );- */- this.fnGetData = function( mRow, iCol )- {- var oSettings = _fnSettingsFromNode( this[DataTable.ext.iApiIndex] );-- if ( mRow !== undefined )- {- var iRow = mRow;- if ( typeof mRow === 'object' )- {- var sNode = mRow.nodeName.toLowerCase();- if (sNode === "tr" )- {- iRow = _fnNodeToDataIndex(oSettings, mRow);- }- else if ( sNode === "td" )- {- iRow = _fnNodeToDataIndex(oSettings, mRow.parentNode);- iCol = _fnNodeToColumnIndex( oSettings, iRow, mRow );- }- }-- if ( iCol !== undefined )- {- return _fnGetCellData( oSettings, iRow, iCol, '' );- }- return (oSettings.aoData[iRow]!==undefined) ?- oSettings.aoData[iRow]._aData : null;- }- return _fnGetDataMaster( oSettings );- };--- /**- * Get an array of the TR nodes that are used in the table's body. Note that you will- * typically want to use the '$' API method in preference to this as it is more- * flexible.- * @param {int} [iRow] Optional row index for the TR element you want- * @returns {array|node} If iRow is undefined, returns an array of all TR elements- * in the table's body, or iRow is defined, just the TR element requested.- * @dtopt API- *- * @example- * $(document).ready(function() {- * var oTable = $('#example').dataTable();- *- * // Get the nodes from the table- * var nNodes = oTable.fnGetNodes( );- * } );- */- this.fnGetNodes = function( iRow )- {- var oSettings = _fnSettingsFromNode( this[DataTable.ext.iApiIndex] );-- if ( iRow !== undefined ) {- return (oSettings.aoData[iRow]!==undefined) ?- oSettings.aoData[iRow].nTr : null;- }- return _fnGetTrNodes( oSettings );- };--- /**- * Get the array indexes of a particular cell from it's DOM element- * and column index including hidden columns- * @param {node} nNode this can either be a TR, TD or TH in the table's body- * @returns {int} If nNode is given as a TR, then a single index is returned, or- * if given as a cell, an array of [row index, column index (visible),- * column index (all)] is given.- * @dtopt API- *- * @example- * $(document).ready(function() {- * $('#example tbody td').click( function () {- * // Get the position of the current data from the node- * var aPos = oTable.fnGetPosition( this );- *- * // Get the data array for this row- * var aData = oTable.fnGetData( aPos[0] );- *- * // Update the data array and return the value- * aData[ aPos[1] ] = 'clicked';- * this.innerHTML = 'clicked';- * } );- *- * // Init DataTables- * oTable = $('#example').dataTable();- * } );- */- this.fnGetPosition = function( nNode )- {- var oSettings = _fnSettingsFromNode( this[DataTable.ext.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 iColumnIndex = _fnNodeToColumnIndex( oSettings, iDataIndex, nNode );- return [ iDataIndex, _fnColumnIndexToVisible(oSettings, iColumnIndex ), iColumnIndex ];- }- return null;- };--- /**- * Check to see if a row is 'open' or not.- * @param {node} nTr the table row to check- * @returns {boolean} true if the row is currently open, false otherwise- * @dtopt API- *- * @example- * $(document).ready(function() {- * var oTable;- *- * // 'open' an information row when a row is clicked on- * $('#example tbody tr').click( function () {- * if ( oTable.fnIsOpen(this) ) {- * oTable.fnClose( this );- * } else {- * oTable.fnOpen( this, "Temporary row opened", "info_row" );- * }- * } );- *- * oTable = $('#example').dataTable();- * } );- */- this.fnIsOpen = function( nTr )- {- var oSettings = _fnSettingsFromNode( this[DataTable.ext.iApiIndex] );- var aoOpenRows = oSettings.aoOpenRows;-- for ( var i=0 ; i<oSettings.aoOpenRows.length ; i++ )- {- if ( oSettings.aoOpenRows[i].nParent == nTr )- {- return true;- }- }- return false;- };--- /**- * This function will place a new row directly after a row which is currently- * on display on the page, with the HTML contents that is passed into the- * function. This can be used, for example, to ask for confirmation that a- * particular record should be deleted.- * @param {node} nTr The table row to 'open'- * @param {string|node|jQuery} mHtml The HTML to put into the row- * @param {string} sClass Class to give the new TD cell- * @returns {node} The row opened. Note that if the table row passed in as the- * first parameter, is not found in the table, this method will silently- * return.- * @dtopt API- *- * @example- * $(document).ready(function() {- * var oTable;- *- * // 'open' an information row when a row is clicked on- * $('#example tbody tr').click( function () {- * if ( oTable.fnIsOpen(this) ) {- * oTable.fnClose( this );- * } else {- * oTable.fnOpen( this, "Temporary row opened", "info_row" );- * }- * } );- *- * oTable = $('#example').dataTable();- * } );- */- this.fnOpen = function( nTr, mHtml, sClass )- {- /* Find settings from table node */- var oSettings = _fnSettingsFromNode( this[DataTable.ext.iApiIndex] );-- /* Check that the row given is in the table */- var nTableRows = _fnGetTrNodes( oSettings );- if ( $.inArray(nTr, nTableRows) === -1 )- {- return;- }-- /* 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 === "string")- {- nNewCell.innerHTML = mHtml;- }- else- {- $(nNewCell).html( 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;- };--- /**- * Change the pagination - provides the internal logic for pagination in a simple API- * function. With this function you can have a DataTables table go to the next,- * previous, first or last pages.- * @param {string|int} mAction Paging action to take: "first", "previous", "next" or "last"- * or page number to jump to (integer), note that page 0 is the first page.- * @param {bool} [bRedraw=true] Redraw the table or not- * @dtopt API- *- * @example- * $(document).ready(function() {- * var oTable = $('#example').dataTable();- * oTable.fnPageChange( 'next' );- * } );- */- this.fnPageChange = function ( mAction, bRedraw )- {- var oSettings = _fnSettingsFromNode( this[DataTable.ext.iApiIndex] );- _fnPageChange( oSettings, mAction );- _fnCalculateEnd( oSettings );-- if ( bRedraw === undefined || bRedraw )- {- _fnDraw( oSettings );- }- };--- /**- * Show a particular column- * @param {int} iCol The column whose display should be changed- * @param {bool} bShow Show (true) or hide (false) the column- * @param {bool} [bRedraw=true] Redraw the table or not- * @dtopt API- *- * @example- * $(document).ready(function() {- * var oTable = $('#example').dataTable();- *- * // Hide the second column after initialisation- * oTable.fnSetColumnVis( 1, false );- * } );- */- this.fnSetColumnVis = function ( iCol, bShow, bRedraw )- {- var oSettings = _fnSettingsFromNode( this[DataTable.ext.iApiIndex] );- var i, iLen;- var aoColumns = oSettings.aoColumns;- var aoData = oSettings.aoData;- var nTd, bAppend, iBefore;-- /* No point in doing anything if we are requesting what is already true */- if ( aoColumns[iCol].bVisible == bShow )- {- return;- }-- /* Show the column */- if ( bShow )- {- var iInsert = 0;- for ( i=0 ; i<iCol ; i++ )- {- if ( 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<aoColumns.length ; i++ )- {- if ( aoColumns[i].bVisible )- {- iBefore = i;- break;- }- }- }-- for ( i=0, iLen=aoData.length ; i<iLen ; i++ )- {- if ( aoData[i].nTr !== null )- {- if ( bAppend )- {- aoData[i].nTr.appendChild(- aoData[i]._anHidden[iCol]- );- }- else- {- aoData[i].nTr.insertBefore(- aoData[i]._anHidden[iCol],- _fnGetTdNodes( oSettings, i )[iBefore] );- }- }- }- }- else- {- /* Remove a column from display */- for ( i=0, iLen=aoData.length ; i<iLen ; i++ )- {- if ( aoData[i].nTr !== null )- {- nTd = _fnGetTdNodes( oSettings, i )[iCol];- aoData[i]._anHidden[iCol] = nTd;- nTd.parentNode.removeChild( nTd );- }- }- }-- /* Clear to set the visible flag */- 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 ( bRedraw === undefined || bRedraw )- {- _fnAdjustColumnSizing( oSettings );- _fnDraw( oSettings );- }-- _fnSaveState( oSettings );- };--- /**- * Get the settings for a particular table for external manipulation- * @returns {object} DataTables settings object. See- * {@link DataTable.models.oSettings}- * @dtopt API- *- * @example- * $(document).ready(function() {- * var oTable = $('#example').dataTable();- * var oSettings = oTable.fnSettings();- *- * // Show an example parameter from the settings- * alert( oSettings._iDisplayStart );- * } );- */- this.fnSettings = function()- {- return _fnSettingsFromNode( this[DataTable.ext.iApiIndex] );- };--- /**- * Sort the table by a particular column- * @param {int} iCol the data index to sort on. Note that this will not match the- * 'display index' if you have hidden data entries- * @dtopt API- *- * @example- * $(document).ready(function() {- * var oTable = $('#example').dataTable();- *- * // Sort immediately with columns 0 and 1- * oTable.fnSort( [ [0,'asc'], [1,'asc'] ] );- * } );- */- this.fnSort = function( aaSort )- {- var oSettings = _fnSettingsFromNode( this[DataTable.ext.iApiIndex] );- oSettings.aaSorting = aaSort;- _fnSort( oSettings );- };--- /**- * Attach a sort listener to an element for a given column- * @param {node} nNode the element to attach the sort listener to- * @param {int} iColumn the column that a click on this node will sort on- * @param {function} [fnCallback] callback function when sort is run- * @dtopt API- *- * @example- * $(document).ready(function() {- * var oTable = $('#example').dataTable();- *- * // Sort on column 1, when 'sorter' is clicked on- * oTable.fnSortListener( document.getElementById('sorter'), 1 );- * } );- */- this.fnSortListener = function( nNode, iColumn, fnCallback )- {- _fnSortAttachListener( _fnSettingsFromNode( this[DataTable.ext.iApiIndex] ), nNode, iColumn,- fnCallback );- };--- /**- * 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.- * @param {object|array|string} mData Data to update the cell/row with- * @param {node|int} mRow TR element you want to update or the aoData index- * @param {int} [iColumn] The column to update (not used of mData is an array or object)- * @param {bool} [bRedraw=true] Redraw the table or not- * @param {bool} [bAction=true] Perform pre-draw actions or not- * @returns {int} 0 on success, 1 on error- * @dtopt API- *- * @example- * $(document).ready(function() {- * var oTable = $('#example').dataTable();- * oTable.fnUpdate( 'Example update', 0, 0 ); // Single cell- * oTable.fnUpdate( ['a', 'b', 'c', 'd', 'e'], 1, 0 ); // Row- * } );- */- this.fnUpdate = function( mData, mRow, iColumn, bRedraw, bAction )- {- var oSettings = _fnSettingsFromNode( this[DataTable.ext.iApiIndex] );- var i, iLen, sDisplay;- var iRow = (typeof mRow === 'object') ?- _fnNodeToDataIndex(oSettings, mRow) : mRow;-- if ( $.isArray(mData) && iColumn === undefined )- {- /* Array update - update the whole row */- oSettings.aoData[iRow]._aData = mData.slice();-- /* Flag to the function that we are recursing */- for ( i=0 ; i<oSettings.aoColumns.length ; i++ )- {- this.fnUpdate( _fnGetCellData( oSettings, iRow, i ), iRow, i, false, false );- }- }- else if ( $.isPlainObject(mData) && iColumn === undefined )- {- /* 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 */- _fnSetCellData( oSettings, iRow, iColumn, mData );- sDisplay = _fnGetCellData( oSettings, iRow, iColumn, 'display' );-- var oCol = oSettings.aoColumns[iColumn];- 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', _fnGetColumns( oSettings, 'bSearchable' ) )- );-- /* Perform pre-draw actions */- if ( bAction === undefined || bAction )- {- _fnAdjustColumnSizing( oSettings );- }-- /* Redraw the table */- if ( bRedraw === undefined || bRedraw )- {- _fnReDraw( oSettings );- }- return 0;- };--- /**- * Provide a common method for plug-ins to check the version of DataTables being used, in order- * to ensure compatibility.- * @param {string} sVersion Version string to check for, in the format "X.Y.Z". Note that the- * formats "X" and "X.Y" are also acceptable.- * @returns {boolean} true if this version of DataTables is greater or equal to the required- * version, or false if this version of DataTales is not suitable- * @method- * @dtopt API- *- * @example- * $(document).ready(function() {- * var oTable = $('#example').dataTable();- * alert( oTable.fnVersionCheck( '1.9.0' ) );- * } );- */- this.fnVersionCheck = DataTable.ext.fnVersionCheck;--- /*- * This is really a good bit rubbish this method of exposing the internal methods- * publicly... - To be fixed in 2.0 using methods on the prototype- */--- /**- * Create a wrapper function for exporting an internal functions to an external API.- * @param {string} sFunc API function name- * @returns {function} wrapped function- * @memberof DataTable#oApi- */- function _fnExternApiFunc (sFunc)- {- return function() {- var aArgs = [_fnSettingsFromNode(this[DataTable.ext.iApiIndex])].concat(- Array.prototype.slice.call(arguments) );- return DataTable.ext.oApi[sFunc].apply( this, aArgs );- };- }--- /**- * Reference to internal functions for use by plug-in developers. Note that these- * methods are references to internal functions and are considered to be private.- * If you use these methods, be aware that they are liable to change between versions- * (check the upgrade notes).- * @namespace- */- this.oApi = {- "_fnExternApiFunc": _fnExternApiFunc,- "_fnInitialise": _fnInitialise,- "_fnInitComplete": _fnInitComplete,- "_fnLanguageCompat": _fnLanguageCompat,- "_fnAddColumn": _fnAddColumn,- "_fnColumnOptions": _fnColumnOptions,- "_fnAddData": _fnAddData,- "_fnCreateTr": _fnCreateTr,- "_fnGatherData": _fnGatherData,- "_fnBuildHead": _fnBuildHead,- "_fnDrawHead": _fnDrawHead,- "_fnDraw": _fnDraw,- "_fnReDraw": _fnReDraw,- "_fnAjaxUpdate": _fnAjaxUpdate,- "_fnAjaxParameters": _fnAjaxParameters,- "_fnAjaxUpdateDraw": _fnAjaxUpdateDraw,- "_fnServerParams": _fnServerParams,- "_fnAddOptionsHtml": _fnAddOptionsHtml,- "_fnFeatureHtmlTable": _fnFeatureHtmlTable,- "_fnScrollDraw": _fnScrollDraw,- "_fnAdjustColumnSizing": _fnAdjustColumnSizing,- "_fnFeatureHtmlFilter": _fnFeatureHtmlFilter,- "_fnFilterComplete": _fnFilterComplete,- "_fnFilterCustom": _fnFilterCustom,- "_fnFilterColumn": _fnFilterColumn,- "_fnFilter": _fnFilter,- "_fnBuildSearchArray": _fnBuildSearchArray,- "_fnBuildSearchRow": _fnBuildSearchRow,- "_fnFilterCreateSearch": _fnFilterCreateSearch,- "_fnDataToSearch": _fnDataToSearch,- "_fnSort": _fnSort,- "_fnSortAttachListener": _fnSortAttachListener,- "_fnSortingClasses": _fnSortingClasses,- "_fnFeatureHtmlPaginate": _fnFeatureHtmlPaginate,- "_fnPageChange": _fnPageChange,- "_fnFeatureHtmlInfo": _fnFeatureHtmlInfo,- "_fnUpdateInfo": _fnUpdateInfo,- "_fnFeatureHtmlLength": _fnFeatureHtmlLength,- "_fnFeatureHtmlProcessing": _fnFeatureHtmlProcessing,- "_fnProcessingDisplay": _fnProcessingDisplay,- "_fnVisibleToColumnIndex": _fnVisibleToColumnIndex,- "_fnColumnIndexToVisible": _fnColumnIndexToVisible,- "_fnNodeToDataIndex": _fnNodeToDataIndex,- "_fnVisbleColumns": _fnVisbleColumns,- "_fnCalculateEnd": _fnCalculateEnd,- "_fnConvertToWidth": _fnConvertToWidth,- "_fnCalculateColumnWidths": _fnCalculateColumnWidths,- "_fnScrollingWidthAdjust": _fnScrollingWidthAdjust,- "_fnGetWidestNode": _fnGetWidestNode,- "_fnGetMaxLenString": _fnGetMaxLenString,- "_fnStringToCss": _fnStringToCss,- "_fnDetectType": _fnDetectType,- "_fnSettingsFromNode": _fnSettingsFromNode,- "_fnGetDataMaster": _fnGetDataMaster,- "_fnGetTrNodes": _fnGetTrNodes,- "_fnGetTdNodes": _fnGetTdNodes,- "_fnEscapeRegex": _fnEscapeRegex,- "_fnDeleteIndex": _fnDeleteIndex,- "_fnColumnOrdering": _fnColumnOrdering,- "_fnLog": _fnLog,- "_fnClearTable": _fnClearTable,- "_fnSaveState": _fnSaveState,- "_fnLoadState": _fnLoadState,- "_fnCreateCookie": _fnCreateCookie,- "_fnReadCookie": _fnReadCookie,- "_fnDetectHeader": _fnDetectHeader,- "_fnGetUniqueThs": _fnGetUniqueThs,- "_fnScrollBarWidth": _fnScrollBarWidth,- "_fnApplyToChildren": _fnApplyToChildren,- "_fnMap": _fnMap,- "_fnGetRowData": _fnGetRowData,- "_fnGetCellData": _fnGetCellData,- "_fnSetCellData": _fnSetCellData,- "_fnGetObjectDataFn": _fnGetObjectDataFn,- "_fnSetObjectDataFn": _fnSetObjectDataFn,- "_fnApplyColumnDefs": _fnApplyColumnDefs,- "_fnBindAction": _fnBindAction,- "_fnExtend": _fnExtend,- "_fnCallbackReg": _fnCallbackReg,- "_fnCallbackFire": _fnCallbackFire,- "_fnJsonString": _fnJsonString,- "_fnNodeToColumnIndex": _fnNodeToColumnIndex,- "_fnInfoMacros": _fnInfoMacros,- "_fnBrowserDetect": _fnBrowserDetect,- "_fnGetColumns": _fnGetColumns,- "_fnHungarianMap": _fnHungarianMap,- "_fnCamelToHungarian": _fnCamelToHungarian- };-- $.extend( DataTable.ext.oApi, this.oApi );-- for ( var sFunc in DataTable.ext.oApi )- {- if ( sFunc )- {- this[sFunc] = _fnExternApiFunc(sFunc);- }- }--- var _that = this;- this.each(function() {- var i=0, iLen, j, jLen, k, kLen;- var sId = this.getAttribute( 'id' );- var bInitHandedOff = false;- var bUsePassedData = false;--- /* Sanity check */- if ( this.nodeName.toLowerCase() != 'table' )- {- _fnLog( null, 0, "Attempted to initialise DataTables on a node which is not a "+- "table: "+this.nodeName );- return;- }-- /* Convert the camel-case defaults to Hungarian */- _fnCamelToHungarian( DataTable.defaults, DataTable.defaults, true );- _fnCamelToHungarian( DataTable.defaults.column, DataTable.defaults.column, true );-- /* Setting up the initialisation object */- if ( !oInit )- {- oInit = {};- }- _fnCamelToHungarian( DataTable.defaults, oInit );-- /* Check to see if we are re-initialising a table */- for ( i=0, iLen=DataTable.settings.length ; i<iLen ; i++ )- {- /* Base check on table node */- if ( DataTable.settings[i].nTable == this )- {- if ( oInit === undefined || oInit.bRetrieve )- {- return DataTable.settings[i].oInstance;- }- else if ( oInit.bDestroy )- {- DataTable.settings[i].oInstance.fnDestroy();- break;- }- else- {- _fnLog( DataTable.settings[i], 0, "Cannot reinitialise DataTable.\n\n"+- "To retrieve the DataTables object for this table, pass no arguments or see "+- "the docs for bRetrieve and bDestroy" );- 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 destroy 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 ( DataTable.settings[i].sTableId == this.id )- {- DataTable.settings.splice( i, 1 );- break;- }- }-- /* Ensure the table has an ID - required for accessibility */- if ( sId === null || sId === "" )- {- sId = "DataTables_Table_"+(DataTable.ext._oExternConfig.iNextUnique++);- this.id = sId;- }-- /* Create the settings object for this table and set some of the default parameters */- var oSettings = $.extend( true, {}, DataTable.models.oSettings, {- "nTable": this,- "oApi": _that.oApi,- "oInit": oInit,- "sDestroyWidth": $(this).width(),- "sInstance": sId,- "sTableId": sId- } );- DataTable.settings.push( oSettings );-- // Need to add the instance after the instance after the settings object has been added- // to the settings array, so we can self reference the table instance if more than one- oSettings.oInstance = (_that.length===1) ? _that : $(this).dataTable();-- // Backwards compatibility, before we apply all the defaults- if ( oInit.oLanguage )- {- _fnLanguageCompat( oInit.oLanguage );- }-- oInit = _fnExtend( $.extend(true, {}, DataTable.defaults), oInit );-- // Map the initialisation options onto the settings object- _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, "asStripeClasses" );- _fnMap( oSettings, oInit, "fnServerData" );- _fnMap( oSettings, oInit, "fnFormatNumber" );- _fnMap( oSettings, oInit, "sServerMethod" );- _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, "iTabIndex" );- _fnMap( oSettings, oInit, "oSearch", "oPreviousSearch" );- _fnMap( oSettings, oInit, "aoSearchCols", "aoPreSearchCols" );- _fnMap( oSettings, oInit, "iDisplayLength", "_iDisplayLength" );- _fnMap( oSettings, oInit, "bJQueryUI", "bJUI" );- _fnMap( oSettings, oInit, "fnCookieCallback" );- _fnMap( oSettings, oInit, "fnStateLoad" );- _fnMap( oSettings, oInit, "fnStateSave" );- _fnMap( oSettings.oLanguage, oInit, "fnInfoCallback" );-- /* Callback functions which are array driven */- _fnCallbackReg( oSettings, 'aoDrawCallback', oInit.fnDrawCallback, 'user' );- _fnCallbackReg( oSettings, 'aoServerParams', oInit.fnServerParams, 'user' );- _fnCallbackReg( oSettings, 'aoStateSaveParams', oInit.fnStateSaveParams, 'user' );- _fnCallbackReg( oSettings, 'aoStateLoadParams', oInit.fnStateLoadParams, 'user' );- _fnCallbackReg( oSettings, 'aoStateLoaded', oInit.fnStateLoaded, 'user' );- _fnCallbackReg( oSettings, 'aoRowCallback', oInit.fnRowCallback, 'user' );- _fnCallbackReg( oSettings, 'aoRowCreatedCallback', oInit.fnCreatedRow, 'user' );- _fnCallbackReg( oSettings, 'aoHeaderCallback', oInit.fnHeaderCallback, 'user' );- _fnCallbackReg( oSettings, 'aoFooterCallback', oInit.fnFooterCallback, 'user' );- _fnCallbackReg( oSettings, 'aoInitComplete', oInit.fnInitComplete, 'user' );- _fnCallbackReg( oSettings, 'aoPreDrawCallback', oInit.fnPreDrawCallback, '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- */- _fnCallbackReg( oSettings, 'aoDrawCallback', _fnSortingClasses, 'server_side_sort_classes' );- }- else if ( oSettings.oFeatures.bDeferRender )- {- _fnCallbackReg( oSettings, 'aoDrawCallback', _fnSortingClasses, 'defer_sort_classes' );- }-- if ( 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- */- $.extend( oSettings.oClasses, DataTable.ext.oJUIClasses );-- if ( oInit.sDom === DataTable.defaults.sDom && DataTable.defaults.sDom === "lfrtip" )- {- /* Set the DOM to use a layout suitable for jQuery UI's theming */- oSettings.sDom = '<"H"lfr>t<"F"ip>';- }- }- else- {- $.extend( oSettings.oClasses, DataTable.ext.oStdClasses );- }- $(this).addClass( oSettings.oClasses.sTable );-- /* Calculate the scroll bar width and cache it for use later on */- if ( oSettings.oScroll.sX !== "" || oSettings.oScroll.sY !== "" )- {- oSettings.oScroll.iBarWidth = _fnScrollBarWidth();- }-- if ( 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 ( oInit.bStateSave )- {- oSettings.oFeatures.bStateSave = true;- _fnLoadState( oSettings, oInit );- _fnCallbackReg( oSettings, 'aoDrawCallback', _fnSaveState, 'state_save' );- }-- if ( oInit.iDeferLoading !== null )- {- oSettings.bDeferLoading = true;- var tmp = $.isArray( oInit.iDeferLoading );- oSettings._iRecordsDisplay = tmp ? oInit.iDeferLoading[0] : oInit.iDeferLoading;- oSettings._iRecordsTotal = tmp ? oInit.iDeferLoading[1] : oInit.iDeferLoading;- }-- if ( oInit.aaData !== null )- {- bUsePassedData = true;- }-- /* Language definitions */- if ( oInit.oLanguage.sUrl !== "" )- {- /* Get the language definitions from a file - because this Ajax call makes the language- * get async to the remainder of this function we use bInitHandedOff to indicate that- * _fnInitialise will be fired by the returned Ajax handler, rather than the constructor- */- oSettings.oLanguage.sUrl = oInit.oLanguage.sUrl;- $.getJSON( oSettings.oLanguage.sUrl, null, function( json ) {- _fnLanguageCompat( json );- _fnCamelToHungarian( DataTable.defaults.oLanguage, json );- $.extend( true, oSettings.oLanguage, oInit.oLanguage, json );- _fnInitialise( oSettings );- } );- bInitHandedOff = true;- }- else- {- $.extend( true, oSettings.oLanguage, oInit.oLanguage );- }--- /*- * Stripes- */- if ( oInit.asStripeClasses === null )- {- oSettings.asStripeClasses =[- oSettings.oClasses.sStripeOdd,- oSettings.oClasses.sStripeEven- ];- }-- /* Remove row stripe classes if they are already on the table row */- var stripeClasses = oSettings.asStripeClasses;- if ( $.inArray( true, $.map( stripeClasses, function(el, i) {- return $('tbody tr:eq(0)', this).hasClass(el);- } ) ) !== -1 ) {- $('tbody tr', this).removeClass( stripeClasses.join(' ') );- oSettings.asDestroyStripes = stripeClasses.slice();- }-- /*- * 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 ( oInit.aoColumns === null )- {- 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++ )- {- /* Short cut - use the loop to check if we have column visibility state to restore */- if ( 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 );- }-- /* Apply the column definitions */- _fnApplyColumnDefs( oSettings, oInit.aoColumnDefs, aoColumnsInit, function (iCol, oDef) {- _fnColumnOptions( oSettings, iCol, oDef );- } );--- /*- * 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 ( oSettings.aaSorting[i][2] === undefined )- {- oSettings.aaSorting[i][2] = 0;- }-- /* If aaSorting is not defined, then we use the first indicator in asSorting */- if ( oInit.aaSorting === undefined && 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- */-- /* Browser support detection */- _fnBrowserDetect( oSettings );-- // Work around for Webkit bug 83867 - store the caption-side before removing from doc- var captions = $(this).children('caption').each( function () {- this._captionSide = $(this).css('caption-side');- } );-- var thead = $(this).children('thead');- if ( thead.length === 0 )- {- thead = [ document.createElement( 'thead' ) ];- this.appendChild( thead[0] );- }- oSettings.nTHead = thead[0];-- var tbody = $(this).children('tbody');- if ( tbody.length === 0 )- {- tbody = [ document.createElement( 'tbody' ) ];- this.appendChild( tbody[0] );- }- oSettings.nTBody = tbody[0];- oSettings.nTBody.setAttribute( "role", "alert" );- oSettings.nTBody.setAttribute( "aria-live", "polite" );- oSettings.nTBody.setAttribute( "aria-relevant", "all" );-- var tfoot = $(this).children('tfoot');- if ( tfoot.length === 0 && captions.length > 0 && (oSettings.oScroll.sX !== "" || oSettings.oScroll.sY !== "") )- {- // If we are a scrolling table, and no footer has been given, then we need to create- // a tfoot element for the caption element to be appended to- tfoot = [ document.createElement( 'tfoot' ) ];- this.appendChild( tfoot[0] );- }-- 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 )- {- _fnInitialise( oSettings );- }- } );- _that = null;- return this;- };-- /**- * Provide a common method for plug-ins to check the version of DataTables being used, in order- * to ensure compatibility.- * @param {string} sVersion Version string to check for, in the format "X.Y.Z". Note that the- * formats "X" and "X.Y" are also acceptable.- * @returns {boolean} true if this version of DataTables is greater or equal to the required- * version, or false if this version of DataTales is not suitable- * @static- * @dtopt API-Static- *- * @example- * alert( $.fn.dataTable.fnVersionCheck( '1.9.0' ) );- */- DataTable.fnVersionCheck = function( sVersion )- {- var aThis = DataTable.ext.sVersion.split('.');- var aThat = sVersion.split('.');- var iThis, iThat;-- for ( var i=0, iLen=aThat.length ; i<iLen ; i++ ){- iThis = parseInt( aThis[i], 10 ) || 0;- iThat = parseInt( aThat[i], 10 ) || 0;-- // Parts are the same, keep comparing- if (iThis === iThat)- {- continue;- }-- // Parts are different, return immediately- return iThis > iThat;- }- return true;- };--- /**- * Check if a TABLE node is a DataTable table already or not.- * @param {node} nTable The TABLE node to check if it is a DataTable or not (note that other- * node types can be passed in, but will always return false).- * @returns {boolean} true the table given is a DataTable, or false otherwise- * @static- * @dtopt API-Static- *- * @example- * var ex = document.getElementById('example');- * if ( ! $.fn.DataTable.fnIsDataTable( ex ) ) {- * $(ex).dataTable();- * }- */- DataTable.fnIsDataTable = function ( nTable )- {- var o = DataTable.settings;-- for ( var i=0 ; i<o.length ; i++ )- {- if ( o[i].nTable === nTable || o[i].nScrollHead === nTable || o[i].nScrollFoot === nTable )- {- return true;- }- }-- return false;- };--- /**- * Get all DataTable tables that have been initialised - optionally you can select to- * get only currently visible tables.- * @param {boolean} [bVisible=false] Flag to indicate if you want all (default) or- * visible tables only.- * @returns {array} Array of TABLE nodes (not DataTable instances) which are DataTables- * @static- * @dtopt API-Static- *- * @example- * var table = $.fn.dataTable.fnTables(true);- * if ( table.length > 0 ) {- * $(table).dataTable().fnAdjustColumnSizing();- * }- */- DataTable.fnTables = function ( bVisible )- {- var out = [];-- jQuery.each( DataTable.settings, function (i, o) {- if ( !bVisible || (bVisible === true && $(o.nTable).is(':visible')) )- {- out.push( o.nTable );- }- } );-- return out;- };--- /**- * Version string for plug-ins to check compatibility. 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- * @member- * @type string- * @default Version number- */- DataTable.version = "1.10.0.dev";-- /**- * Private data store, containing all of the settings objects that are created for the- * tables on a given page.- *- * Note that the <i>DataTable.settings</i> object is aliased to <i>jQuery.fn.dataTableExt</i>- * through which it may be accessed and manipulated, or <i>jQuery.fn.dataTable.settings</i>.- * @member- * @type array- * @default []- * @private- */- DataTable.settings = [];-- /**- * Object models container, for the various models that DataTables has available- * to it. These models define the objects that are used to hold the active state- * and configuration of the table.- * @namespace- */- DataTable.models = {};--- /**- * DataTables extension options and plug-ins. This namespace acts as a collection "area"- * for plug-ins that can be used to extend the default DataTables behaviour - indeed many- * of the build in methods use this method to provide their own capabilities (sorting methods- * for example).- *- * Note that this namespace is aliased to jQuery.fn.dataTableExt so it can be readily accessed- * and modified by plug-ins.- * @namespace- */- DataTable.models.ext = {- /**- * Plug-in filtering functions - this method of filtering is complimentary to the default- * type based filtering, and a lot more comprehensive as it allows you complete control- * over the filtering logic. Each element in this array is a function (parameters- * described below) that is called for every row in the table, and your logic decides if- * it should be included in the filtered data set or not.- * <ul>- * <li>- * Function input parameters:- * <ul>- * <li>{object} DataTables settings object: see {@link DataTable.models.oSettings}.</li>- * <li>{array|object} Data for the row to be processed (same as the original format- * that was passed in as the data source, or an array from a DOM data source</li>- * <li>{int} Row index in aoData ({@link DataTable.models.oSettings.aoData}), which can- * be useful to retrieve the TR element if you need DOM interaction.</li>- * </ul>- * </li>- * <li>- * Function return:- * <ul>- * <li>{boolean} Include the row in the filtered result set (true) or not (false)</li>- * </ul>- * </il>- * </ul>- * @type array- * @default []- *- * @example- * // The following example shows custom filtering being applied to the fourth column (i.e.- * // the aData[3] index) based on two input values from the end-user, matching the data in- * // a certain range.- * $.fn.dataTableExt.afnFiltering.push(- * function( oSettings, aData, iDataIndex ) {- * var iMin = document.getElementById('min').value * 1;- * var iMax = document.getElementById('max').value * 1;- * var iVersion = aData[3] == "-" ? 0 : aData[3]*1;- * if ( iMin == "" && iMax == "" ) {- * return true;- * }- * else if ( iMin == "" && iVersion < iMax ) {- * return true;- * }- * else if ( iMin < iVersion && "" == iMax ) {- * return true;- * }- * else if ( iMin < iVersion && iVersion < iMax ) {- * return true;- * }- * return false;- * }- * );- */- "afnFiltering": [],--- /**- * Plug-in sorting functions - this method of sorting is complimentary to the default type- * based sorting that DataTables does automatically, allowing much greater control over the- * the data that is being used to sort a column. This is useful if you want to do sorting- * based on live data (for example the contents of an 'input' element) rather than just the- * static string that DataTables knows of. The way these plug-ins work is that you create- * an array of the values you wish to be sorted for the column in question and then return- * that array. Which pre-sorting function is run here depends on the sSortDataType parameter- * that is used for the column (if any). This is the corollary of <i>ofnSearch</i> for sort- * data.- * <ul>- * <li>- * Function input parameters:- * <ul>- * <li>{object} DataTables settings object: see {@link DataTable.models.oSettings}.</li>- * <li>{int} Target column index</li>- * </ul>- * </li>- * <li>- * Function return:- * <ul>- * <li>{array} Data for the column to be sorted upon</li>- * </ul>- * </il>- * </ul>- *- * Note that as of v1.9, it is typically preferable to use <i>mData</i> to prepare data for- * the different uses that DataTables can put the data to. Specifically <i>mData</i> when- * used as a function will give you a 'type' (sorting, filtering etc) that you can use to- * prepare the data as required for the different types. As such, this method is deprecated.- * @type array- * @default []- * @deprecated- *- * @example- * // Updating the cached sorting information with user entered values in HTML input elements- * jQuery.fn.dataTableExt.afnSortData['dom-text'] = function ( oSettings, iColumn )- * {- * var aData = [];- * $( 'td:eq('+iColumn+') input', oSettings.oApi._fnGetTrNodes(oSettings) ).each( function () {- * aData.push( this.value );- * } );- * return aData;- * }- */- "afnSortData": [],--- /**- * Feature plug-ins - This is an array of objects which describe the feature plug-ins that are- * available to DataTables. These feature plug-ins are accessible through the sDom initialisation- * option. As such, each feature plug-in must describe a function that is used to initialise- * itself (fnInit), a character so the feature can be enabled by sDom (cFeature) and the name- * of the feature (sFeature). Thus the objects attached to this method must provide:- * <ul>- * <li>{function} fnInit Initialisation of the plug-in- * <ul>- * <li>- * Function input parameters:- * <ul>- * <li>{object} DataTables settings object: see {@link DataTable.models.oSettings}.</li>- * </ul>- * </li>- * <li>- * Function return:- * <ul>- * <li>{node|null} The element which contains your feature. Note that the return- * may also be void if your plug-in does not require to inject any DOM elements- * into DataTables control (sDom) - for example this might be useful when- * developing a plug-in which allows table control via keyboard entry.</li>- * </ul>- * </il>- * </ul>- * </li>- * <li>{character} cFeature Character that will be matched in sDom - case sensitive</li>- * <li>{string} sFeature Feature name</li>- * </ul>- * @type array- * @default []- *- * @example- * // How TableTools initialises itself.- * $.fn.dataTableExt.aoFeatures.push( {- * "fnInit": function( oSettings ) {- * return new TableTools( { "oDTSettings": oSettings } );- * },- * "cFeature": "T",- * "sFeature": "TableTools"- * } );- */- "aoFeatures": [],--- /**- * Type detection plug-in functions - DataTables utilises types to define how sorting and- * filtering behave, and types can be either be defined by the developer (sType for the- * column) or they can be automatically detected by the methods in this array. The functions- * defined in the array are quite simple, taking a single parameter (the data to analyse)- * and returning the type if it is a known type, or null otherwise.- * <ul>- * <li>- * Function input parameters:- * <ul>- * <li>{*} Data from the column cell to be analysed</li>- * </ul>- * </li>- * <li>- * Function return:- * <ul>- * <li>{string|null} Data type detected, or null if unknown (and thus pass it- * on to the other type detection functions.</li>- * </ul>- * </il>- * </ul>- * @type array- * @default []- *- * @example- * // Currency type detection plug-in:- * jQuery.fn.dataTableExt.aTypes.push(- * function ( sData ) {- * var sValidChars = "0123456789.-";- * var Char;- *- * // Check the numeric part- * for ( i=1 ; i<sData.length ; i++ ) {- * Char = sData.charAt(i);- * if (sValidChars.indexOf(Char) == -1) {- * return null;- * }- * }- *- * // Check prefixed by currency- * if ( sData.charAt(0) == '$' || sData.charAt(0) == '£' ) {- * return 'currency';- * }- * return null;- * }- * );- */- "aTypes": [],--- /**- * Provide a common method for plug-ins to check the version of DataTables being used,- * in order to ensure compatibility.- * @type function- * @param {string} sVersion Version string to check for, in the format "X.Y.Z". Note- * that the formats "X" and "X.Y" are also acceptable.- * @returns {boolean} true if this version of DataTables is greater or equal to the- * required version, or false if this version of DataTales is not suitable- *- * @example- * $(document).ready(function() {- * var oTable = $('#example').dataTable();- * alert( oTable.fnVersionCheck( '1.9.0' ) );- * } );- */- "fnVersionCheck": DataTable.fnVersionCheck,--- /**- * Index for what 'this' index API functions should use- * @type int- * @default 0- */- "iApiIndex": 0,--- /**- * Pre-processing of filtering data plug-ins - When you assign the sType for a column- * (or have it automatically detected for you by DataTables or a type detection plug-in),- * you will typically be using this for custom sorting, but it can also be used to provide- * custom filtering by allowing you to pre-processing the data and returning the data in- * the format that should be filtered upon. This is done by adding functions this object- * with a parameter name which matches the sType for that target column. This is the- * corollary of <i>afnSortData</i> for filtering data.- * <ul>- * <li>- * Function input parameters:- * <ul>- * <li>{*} Data from the column cell to be prepared for filtering</li>- * </ul>- * </li>- * <li>- * Function return:- * <ul>- * <li>{string|null} Formatted string that will be used for the filtering.</li>- * </ul>- * </il>- * </ul>- *- * Note that as of v1.9, it is typically preferable to use <i>mData</i> to prepare data for- * the different uses that DataTables can put the data to. Specifically <i>mData</i> when- * used as a function will give you a 'type' (sorting, filtering etc) that you can use to- * prepare the data as required for the different types. As such, this method is deprecated.- * @type object- * @default {}- * @deprecated- *- * @example- * $.fn.dataTableExt.ofnSearch['title-numeric'] = function ( sData ) {- * return sData.replace(/\n/g," ").replace( /<.*?>/g, "" );- * }- */- "ofnSearch": {},--- /**- * Container for all private functions in DataTables so they can be exposed externally- * @type object- * @default {}- */- "oApi": {},--- /**- * Storage for the various classes that DataTables uses- * @type object- * @default {}- */- "oStdClasses": {},--- /**- * Storage for the various classes that DataTables uses - jQuery UI suitable- * @type object- * @default {}- */- "oJUIClasses": {},--- /**- * Pagination plug-in methods - The style and controls of the pagination can significantly- * impact on how the end user interacts with the data in your table, and DataTables allows- * the addition of pagination controls by extending this object, which can then be enabled- * through the <i>sPaginationType</i> initialisation parameter. Each pagination type that- * is added is an object (the property name of which is what <i>sPaginationType</i> refers- * to) that has two properties, both methods that are used by DataTables to update the- * control's state.- * <ul>- * <li>- * fnInit - Initialisation of the paging controls. Called only during initialisation- * of the table. It is expected that this function will add the required DOM elements- * to the page for the paging controls to work. The element pointer- * 'oSettings.aanFeatures.p' array is provided by DataTables to contain the paging- * controls (note that this is a 2D array to allow for multiple instances of each- * DataTables DOM element). It is suggested that you add the controls to this element- * as children- * <ul>- * <li>- * Function input parameters:- * <ul>- * <li>{object} DataTables settings object: see {@link DataTable.models.oSettings}.</li>- * <li>{node} Container into which the pagination controls must be inserted</li>- * <li>{function} Draw callback function - whenever the controls cause a page- * change, this method must be called to redraw the table.</li>- * </ul>- * </li>- * <li>- * Function return:- * <ul>- * <li>No return required</li>- * </ul>- * </il>- * </ul>- * </il>- * <li>- * fnInit - This function is called whenever the paging status of the table changes and is- * typically used to update classes and/or text of the paging controls to reflex the new- * status.- * <ul>- * <li>- * Function input parameters:- * <ul>- * <li>{object} DataTables settings object: see {@link DataTable.models.oSettings}.</li>- * <li>{function} Draw callback function - in case you need to redraw the table again- * or attach new event listeners</li>- * </ul>- * </li>- * <li>- * Function return:- * <ul>- * <li>No return required</li>- * </ul>- * </il>- * </ul>- * </il>- * </ul>- * @type object- * @default {}- *- * @example- * $.fn.dataTableExt.oPagination.four_button = {- * "fnInit": function ( oSettings, nPaging, fnCallbackDraw ) {- * nFirst = document.createElement( 'span' );- * nPrevious = document.createElement( 'span' );- * nNext = document.createElement( 'span' );- * nLast = document.createElement( 'span' );- *- * nFirst.appendChild( document.createTextNode( oSettings.oLanguage.oPaginate.sFirst ) );- * nPrevious.appendChild( document.createTextNode( oSettings.oLanguage.oPaginate.sPrevious ) );- * nNext.appendChild( document.createTextNode( oSettings.oLanguage.oPaginate.sNext ) );- * nLast.appendChild( document.createTextNode( oSettings.oLanguage.oPaginate.sLast ) );- *- * nFirst.className = "paginate_button first";- * nPrevious.className = "paginate_button previous";- * nNext.className="paginate_button next";- * nLast.className = "paginate_button last";- *- * nPaging.appendChild( nFirst );- * nPaging.appendChild( nPrevious );- * nPaging.appendChild( nNext );- * nPaging.appendChild( nLast );- *- * $(nFirst).click( function () {- * oSettings.oApi._fnPageChange( oSettings, "first" );- * fnCallbackDraw( oSettings );- * } );- *- * $(nPrevious).click( function() {- * oSettings.oApi._fnPageChange( oSettings, "previous" );- * fnCallbackDraw( oSettings );- * } );- *- * $(nNext).click( function() {- * oSettings.oApi._fnPageChange( oSettings, "next" );- * fnCallbackDraw( oSettings );- * } );- *- * $(nLast).click( function() {- * oSettings.oApi._fnPageChange( oSettings, "last" );- * fnCallbackDraw( oSettings );- * } );- *- * $(nFirst).bind( 'selectstart', function () { return false; } );- * $(nPrevious).bind( 'selectstart', function () { return false; } );- * $(nNext).bind( 'selectstart', function () { return false; } );- * $(nLast).bind( 'selectstart', function () { return false; } );- * },- *- * "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++ ) {- * var buttons = an[i].getElementsByTagName('span');- * if ( oSettings._iDisplayStart === 0 ) {- * buttons[0].className = "paginate_disabled_previous";- * buttons[1].className = "paginate_disabled_previous";- * }- * else {- * buttons[0].className = "paginate_enabled_previous";- * buttons[1].className = "paginate_enabled_previous";- * }- *- * if ( oSettings.fnDisplayEnd() == oSettings.fnRecordsDisplay() ) {- * buttons[2].className = "paginate_disabled_next";- * buttons[3].className = "paginate_disabled_next";- * }- * else {- * buttons[2].className = "paginate_enabled_next";- * buttons[3].className = "paginate_enabled_next";- * }- * }- * }- * };- */- "oPagination": {},--- /**- * Sorting plug-in methods - Sorting in DataTables is based on the detected type of the- * data column (you can add your own type detection functions, or override automatic- * detection using sType). With this specific type given to the column, DataTables will- * apply the required sort from the functions in the object. Each sort type must provide- * two mandatory methods, one each for ascending and descending sorting, and can optionally- * provide a pre-formatting method that will help speed up sorting by allowing DataTables- * to pre-format the sort data only once (rather than every time the actual sort functions- * are run). The two sorting functions are typical Javascript sort methods:- * <ul>- * <li>- * Function input parameters:- * <ul>- * <li>{*} Data to compare to the second parameter</li>- * <li>{*} Data to compare to the first parameter</li>- * </ul>- * </li>- * <li>- * Function return:- * <ul>- * <li>{int} Sorting match: <0 if first parameter should be sorted lower than- * the second parameter, ===0 if the two parameters are equal and >0 if- * the first parameter should be sorted height than the second parameter.</li>- * </ul>- * </il>- * </ul>- * @type object- * @default {}- *- * @example- * // Case-sensitive string sorting, with no pre-formatting method- * $.extend( $.fn.dataTableExt.oSort, {- * "string-case-asc": function(x,y) {- * return ((x < y) ? -1 : ((x > y) ? 1 : 0));- * },- * "string-case-desc": function(x,y) {- * return ((x < y) ? 1 : ((x > y) ? -1 : 0));- * }- * } );- *- * @example- * // Case-insensitive string sorting, with pre-formatting- * $.extend( $.fn.dataTableExt.oSort, {- * "string-pre": function(x) {- * return x.toLowerCase();- * },- * "string-asc": function(x,y) {- * return ((x < y) ? -1 : ((x > y) ? 1 : 0));- * },- * "string-desc": function(x,y) {- * return ((x < y) ? 1 : ((x > y) ? -1 : 0));- * }- * } );- */- "oSort": {},--- /**- * Version string for plug-ins to check compatibility. 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- * @type string- * @default Version number- */- "sVersion": DataTable.version,--- /**- * How should DataTables report an error. Can take the value 'alert' or 'throw'- * @type string- * @default alert- */- "sErrMode": "alert",--- /**- * Store information for DataTables to access globally about other instances- * @namespace- * @private- */- "_oExternConfig": {- /* int:iNextUnique - next unique number for an instance */- "iNextUnique": 0- }- };----- /**- * Template object for the way in which DataTables holds information about- * search information for the global filter and individual column filters.- * @namespace- */- DataTable.models.oSearch = {- /**- * Flag to indicate if the filtering should be case insensitive or not- * @type boolean- * @default true- */- "bCaseInsensitive": true,-- /**- * Applied search term- * @type string- * @default <i>Empty string</i>- */- "sSearch": "",-- /**- * Flag to indicate if the search term should be interpreted as a- * regular expression (true) or not (false) and therefore and special- * regex characters escaped.- * @type boolean- * @default false- */- "bRegex": false,-- /**- * Flag to indicate if DataTables is to use its smart filtering or not.- * @type boolean- * @default true- */- "bSmart": true- };----- /**- * Template object for the way in which DataTables holds information about- * each individual row. This is the object format used for the settings- * aoData array.- * @namespace- */- DataTable.models.oRow = {- /**- * TR element for the row- * @type node- * @default null- */- "nTr": null,-- /**- * Data object from the original data source for the row. This is either- * an array if using the traditional form of DataTables, or an object if- * using mData options. The exact type will depend on the passed in- * data from the data source, or will be an array if using DOM a data- * source.- * @type array|object- * @default []- */- "_aData": [],-- /**- * Sorting data cache - this array is ostensibly the same length as the- * number of columns (although each index is generated only as it is- * needed), and holds the data that is used for sorting each column in the- * row. We do this cache generation at the start of the sort in order that- * the formatting of the sort data need be done only once for each cell- * per sort. This array should not be read from or written to by anything- * other than the master sorting methods.- * @type array- * @default []- * @private- */- "_aSortData": [],-- /**- * Array of TD elements that are cached for hidden rows, so they can be- * reinserted into the table if a column is made visible again (or to act- * as a store if a column is made hidden). Only hidden columns have a- * reference in the array. For non-hidden columns the value is either- * undefined or null.- * @type array nodes- * @default []- * @private- */- "_anHidden": [],-- /**- * Cache of the class name that DataTables has applied to the row, so we- * can quickly look at this variable rather than needing to do a DOM check- * on className for the nTr property.- * @type string- * @default <i>Empty string</i>- * @private- */- "_sRowStripe": ""- };---- /**- * Template object for the column information object in DataTables. This object- * is held in the settings aoColumns array and contains all the information that- * DataTables needs about each individual column.- *- * Note that this object is related to {@link DataTable.defaults.column}- * but this one is the internal data store for DataTables's cache of columns.- * It should NOT be manipulated outside of DataTables. Any configuration should- * be done through the initialisation options.- * @namespace- */- DataTable.models.oColumn = {- /**- * A list of the columns that sorting should occur on when this column- * is sorted. That this property is an array allows multi-column sorting- * to be defined for a column (for example first name / last name columns- * would benefit from this). The values are integers pointing to the- * columns to be sorted on (typically it will be a single integer pointing- * at itself, but that doesn't need to be the case).- * @type array- */- "aDataSort": null,-- /**- * Define the sorting directions that are applied to the column, in sequence- * as the column is repeatedly sorted upon - i.e. the first value is used- * as the sorting direction when the column if first sorted (clicked on).- * Sort it again (click again) and it will move on to the next index.- * Repeat until loop.- * @type array- */- "asSorting": null,-- /**- * Flag to indicate if the column is searchable, and thus should be included- * in the filtering or not.- * @type boolean- */- "bSearchable": null,-- /**- * Flag to indicate if the column is sortable or not.- * @type boolean- */- "bSortable": null,-- /**- * Flag to indicate if the column is currently visible in the table or not- * @type boolean- */- "bVisible": null,-- /**- * Flag to indicate to the type detection method if the automatic type- * detection should be used, or if a column type (sType) has been specified- * @type boolean- * @default true- * @private- */- "_bAutoType": true,-- /**- * Developer definable function that is called whenever a cell is created (Ajax source,- * etc) or processed for input (DOM source). This can be used as a compliment to mRender- * allowing you to modify the DOM element (add background colour for example) when the- * element is available.- * @type function- * @param {element} nTd The TD node that has been created- * @param {*} sData The Data for the cell- * @param {array|object} oData The data for the whole row- * @param {int} iRow The row index for the aoData data store- * @default null- */- "fnCreatedCell": null,-- /**- * Function to get data from a cell in a column. You should <b>never</b>- * access data directly through _aData internally in DataTables - always use- * the method attached to this property. It allows mData to function as- * required. This function is automatically assigned by the column- * initialisation method- * @type function- * @param {array|object} oData The data array/object for the array- * (i.e. aoData[]._aData)- * @param {string} sSpecific The specific data type you want to get -- * 'display', 'type' 'filter' 'sort'- * @returns {*} The data for the cell from the given row's data- * @default null- */- "fnGetData": null,-- /**- * Function to set data for a cell in the column. You should <b>never</b>- * set the data directly to _aData internally in DataTables - always use- * this method. It allows mData to function as required. This function- * is automatically assigned by the column initialisation method- * @type function- * @param {array|object} oData The data array/object for the array- * (i.e. aoData[]._aData)- * @param {*} sValue Value to set- * @default null- */- "fnSetData": null,-- /**- * Property to read the value for the cells in the column from the data- * source array / object. If null, then the default content is used, if a- * function is given then the return from the function is used.- * @type function|int|string|null- * @default null- */- "mData": null,-- /**- * Partner property to mData which is used (only when defined) to get- * the data - i.e. it is basically the same as mData, but without the- * 'set' option, and also the data fed to it is the result from mData.- * This is the rendering method to match the data method of mData.- * @type function|int|string|null- * @default null- */- "mRender": null,-- /**- * Unique header TH/TD element for this column - this is what the sorting- * listener is attached to (if sorting is enabled.)- * @type node- * @default null- */- "nTh": null,-- /**- * Unique footer TH/TD element for this column (if there is one). Not used- * in DataTables as such, but can be used for plug-ins to reference the- * footer for each column.- * @type node- * @default null- */- "nTf": null,-- /**- * The class to apply to all TD elements in the table's TBODY for the column- * @type string- * @default null- */- "sClass": null,-- /**- * When DataTables calculates the column widths to assign to each column,- * it finds the longest string in each column and then constructs a- * temporary table and reads the widths from that. The problem with this- * is that "mmm" is much wider then "iiii", but the latter is a longer- * string - thus the calculation can go wrong (doing it properly and putting- * it into an DOM object and measuring that is horribly(!) slow). Thus as- * a "work around" we provide this option. It will append its value to the- * text that is found to be the longest string for the column - i.e. padding.- * @type string- */- "sContentPadding": null,-- /**- * Allows a default value to be given for a column's data, and will be used- * whenever a null data source is encountered (this can be because mData- * is set to null, or because the data source itself is null).- * @type string- * @default null- */- "sDefaultContent": null,-- /**- * Name for the column, allowing reference to the column by name as well as- * by index (needs a lookup to work by name).- * @type string- */- "sName": null,-- /**- * Custom sorting data type - defines which of the available plug-ins in- * afnSortData the custom sorting will use - if any is defined.- * @type string- * @default std- */- "sSortDataType": 'std',-- /**- * Class to be applied to the header element when sorting on this column- * @type string- * @default null- */- "sSortingClass": null,-- /**- * Class to be applied to the header element when sorting on this column -- * when jQuery UI theming is used.- * @type string- * @default null- */- "sSortingClassJUI": null,-- /**- * Title of the column - what is seen in the TH element (nTh).- * @type string- */- "sTitle": null,-- /**- * Column sorting and filtering type- * @type string- * @default null- */- "sType": null,-- /**- * Width of the column- * @type string- * @default null- */- "sWidth": null,-- /**- * Width of the column when it was first "encountered"- * @type string- * @default null- */- "sWidthOrig": null- };--- /*- * Developer note: The properties of the object below are given in Hungarian- * notation, that was used as the interface for DataTables prior to v1.10, however- * from v1.10 onwards the primary interface is camel case. In order to avoid- * breaking backwards compatibility utterly with this change, the Hungarian- * version is still, internally the primary interface, but is is not documented- * - hence the @name tags in each doc comment. This allows a Javascript function- * to create a map from Hungarian notation to camel case (going the other direction- * would require each property to be listed, which would at around 3K to the size- * of DataTables, while this method is about a 0.5K hit.- *- * Ultimately this does pave the way for Hungarian notation to be dropped- * completely, but that is a massive amount of work and will break current- * installs (therefore is on-hold until v2).- */-- /**- * Initialisation options that can be given to DataTables at initialisation- * time.- * @namespace- */- DataTable.defaults = {- /**- * An array of data to use for the table, passed in at initialisation which- * will be used in preference to any data which is already in the DOM. This is- * particularly useful for constructing tables purely in Javascript, for- * example with a custom Ajax call.- * @type array- * @default null- *- * @dtopt Option- * @name DataTable.defaults.data- *- * @example- * // Using a 2D array data source- * $(document).ready( function () {- * $('#example').dataTable( {- * "data": [- * ['Trident', 'Internet Explorer 4.0', 'Win 95+', 4, 'X'],- * ['Trident', 'Internet Explorer 5.0', 'Win 95+', 5, 'C'],- * ],- * "columns": [- * { "title": "Engine" },- * { "title": "Browser" },- * { "title": "Platform" },- * { "title": "Version" },- * { "title": "Grade" }- * ]- * } );- * } );- *- * @example- * // Using an array of objects as a data source (`data`)- * $(document).ready( function () {- * $('#example').dataTable( {- * "data": [- * {- * "engine": "Trident",- * "browser": "Internet Explorer 4.0",- * "platform": "Win 95+",- * "version": 4,- * "grade": "X"- * },- * {- * "engine": "Trident",- * "browser": "Internet Explorer 5.0",- * "platform": "Win 95+",- * "version": 5,- * "grade": "C"- * }- * ],- * "columns": [- * { "title": "Engine", "data": "engine" },- * { "title": "Browser", "data": "browser" },- * { "title": "Platform", "data": "platform" },- * { "title": "Version", "data": "version" },- * { "title": "Grade", "data": "grade" }- * ]- * } );- * } );- */- "aaData": null,--- /**- * If sorting is enabled, then DataTables will perform a first pass sort on- * initialisation. You can define which column(s) the sort is performed upon,- * and the sorting direction, with this variable. The `sorting` array should- * contain an array for each column to be sorted initially containing the- * column's index and a direction string ('asc' or 'desc').- * @type array- * @default [[0,'asc']]- *- * @dtopt Option- * @name DataTable.defaults.sorting- *- * @example- * // Sort by 3rd column first, and then 4th column- * $(document).ready( function() {- * $('#example').dataTable( {- * "sorting": [[2,'asc'], [3,'desc']]- * } );- * } );- *- * // No initial sorting- * $(document).ready( function() {- * $('#example').dataTable( {- * "sorting": []- * } );- * } );- */- "aaSorting": [[0,'asc']],--- /**- * This parameter is basically identical to the `sorting` parameter, but- * cannot be overridden by user interaction with the table. What this means- * is that you could have a column (visible or hidden) which the sorting will- * always be forced on first - any sorting after that (from the user) will- * then be performed as required. This can be useful for grouping rows- * together.- * @type array- * @default null- *- * @dtopt Option- * @name DataTable.defaults.sortingFixed- *- * @example- * $(document).ready( function() {- * $('#example').dataTable( {- * "sortingFixed": [[0,'asc']]- * } );- * } )- */- "aaSortingFixed": null,--- /**- * This parameter allows you to readily specify the entries in the length drop- * down menu that DataTables shows when pagination is enabled. It can be- * either a 1D array of options which will be used for both the displayed- * option and the value, or a 2D array which will use the array in the first- * position as the value, and the array in the second position as the- * displayed options (useful for language strings such as 'All').- * @type array- * @default [ 10, 25, 50, 100 ]- *- * @dtopt Option- * @name DataTable.defaults.lengthMenu- *- * @example- * $(document).ready( function() {- * $('#example').dataTable( {- * "lengthMenu": [[10, 25, 50, -1], [10, 25, 50, "All"]]- * } );- * } );- *- * @example- * // Setting the default display length as well as length menu- * // This is likely to be wanted if you remove the '10' option which- * // is the displayLength default.- * $(document).ready( function() {- * $('#example').dataTable( {- * "displayLength": 25,- * "lengthMenu": [[25, 50, 100, -1], [25, 50, 100, "All"]]- * } );- * } );- */- "aLengthMenu": [ 10, 25, 50, 100 ],--- /**- * The `columns` option in the initialisation parameter allows you to define- * details about the way individual columns behave. For a full list of- * column options that can be set, please see- * {@link DataTable.defaults.column}. Note that if you use `columns` to- * define your columns, you must have an entry in the array for every single- * column that you have in your table (these can be null if you don't which- * to specify any options).- * @member- *- * @name DataTable.defaults.column- */- "aoColumns": null,-- /**- * Very similar to `columns`, `columnDefs` allows you to target a specific- * column, multiple columns, or all columns, using the `targets` property of- * each object in the array. This allows great flexibility when creating- * tables, as the `columnDefs` arrays can be of any length, targeting the- * columns you specifically want. `columnDefs` may use any of the column- * options available: {@link DataTable.defaults.column}, but it _must_- * have `targets` defined in each object in the array. Values in the `targets`- * array may be:- * <ul>- * <li>a string - class name will be matched on the TH for the column</li>- * <li>0 or a positive integer - column index counting from the left</li>- * <li>a negative integer - column index counting from the right</li>- * <li>the string "_all" - all columns (i.e. assign a default)</li>- * </ul>- * @member- *- * @name DataTable.defaults.columnDefs- */- "aoColumnDefs": null,--- /**- * Basically the same as `search`, this parameter defines the individual column- * filtering state at initialisation time. The array must be of the same size- * as the number of columns, and each element be an object with the parameters- * `search` and `escapeRegex` (the latter is optional). 'null' is also- * accepted and the default will be used.- * @type array- * @default []- *- * @dtopt Option- * @name DataTable.defaults.searchCols- *- * @example- * $(document).ready( function() {- * $('#example').dataTable( {- * "searchCols": [- * null,- * { "search": "My filter" },- * null,- * { "search": "^[0-9]", "escapeRegex": false }- * ]- * } );- * } )- */- "aoSearchCols": [],--- /**- * An array of CSS classes that should be applied to displayed rows. This- * array may be of any length, and DataTables will apply each class- * sequentially, looping when required.- * @type array- * @default null <i>Will take the values determined by the `oClasses.stripe*`- * options</i>- *- * @dtopt Option- * @name DataTable.defaults.stripeClasses- *- * @example- * $(document).ready( function() {- * $('#example').dataTable( {- * "stripeClasses": [ 'strip1', 'strip2', 'strip3' ]- * } );- * } )- */- "asStripeClasses": null,--- /**- * Enable or disable automatic column width calculation. This can be disabled- * as an optimisation (it takes some time to calculate the widths) if the- * tables widths are passed in using `columns`.- * @type boolean- * @default true- *- * @dtopt Features- * @name DataTable.defaults.autoWidth- *- * @example- * $(document).ready( function () {- * $('#example').dataTable( {- * "autoWidth": false- * } );- * } );- */- "bAutoWidth": true,--- /**- * Deferred rendering can provide DataTables with a huge speed boost when you- * are using an Ajax or JS data source for the table. This option, when set to- * true, will cause DataTables to defer the creation of the table elements for- * each row until they are needed for a draw - saving a significant amount of- * time.- * @type boolean- * @default false- *- * @dtopt Features- * @name DataTable.defaults.deferRender- *- * @example- * $(document).ready( function() {- * $('#example').dataTable( {- * "ajaxSource": "sources/arrays.txt",- * "deferRender": true- * } );- * } );- */- "bDeferRender": false,--- /**- * Replace a DataTable which matches the given selector and replace it with- * one which has the properties of the new initialisation object passed. If no- * table matches the selector, then the new DataTable will be constructed as- * per normal.- * @type boolean- * @default false- *- * @dtopt Options- * @name DataTable.defaults.destroy- *- * @example- * $(document).ready( function() {- * $('#example').dataTable( {- * "srollY": "200px",- * "paginate": false- * } );- *- * // Some time later....- * $('#example').dataTable( {- * "filter": false,- * "destroy": true- * } );- * } );- */- "bDestroy": false,--- /**- * Enable or disable filtering of data. Filtering in DataTables is "smart" in- * that it allows the end user to input multiple words (space separated) and- * will match a row containing those words, even if not in the order that was- * specified (this allow matching across multiple columns). Note that if you- * wish to use filtering in DataTables this must remain 'true' - to remove the- * default filtering input box and retain filtering abilities, please use- * {@link DataTable.defaults.dom}.- * @type boolean- * @default true- *- * @dtopt Features- * @name DataTable.defaults.filter- *- * @example- * $(document).ready( function () {- * $('#example').dataTable( {- * "filter": false- * } );- * } );- */- "bFilter": true,--- /**- * Enable or disable the table information display. This shows information- * about the data that is currently visible on the page, including information- * about filtered data if that action is being performed.- * @type boolean- * @default true- *- * @dtopt Features- * @name DataTable.defaults.info- *- * @example- * $(document).ready( function () {- * $('#example').dataTable( {- * "info": false- * } );- * } );- */- "bInfo": true,--- /**- * Enable jQuery UI ThemeRoller support (required as ThemeRoller requires some- * slightly different and additional mark-up from what DataTables has- * traditionally used).- * @type boolean- * @default false- *- * @dtopt Features- * @name DataTable.defaults.jQueryUI- *- * @example- * $(document).ready( function() {- * $('#example').dataTable( {- * "jQueryUI": true- * } );- * } );- */- "bJQueryUI": false,--- /**- * Allows the end user to select the size of a formatted page from a select- * menu (sizes are 10, 25, 50 and 100). Requires pagination (`paginate`).- * @type boolean- * @default true- *- * @dtopt Features- * @name DataTable.defaults.lengthChange- *- * @example- * $(document).ready( function () {- * $('#example').dataTable( {- * "lengthChange": false- * } );- * } );- */- "bLengthChange": true,--- /**- * Enable or disable pagination.- * @type boolean- * @default true- *- * @dtopt Features- * @name DataTable.defaults.paginate- *- * @example- * $(document).ready( function () {- * $('#example').dataTable( {- * "paginate": false- * } );- * } );- */- "bPaginate": true,--- /**- * Enable or disable the display of a 'processing' indicator when the table is- * being processed (e.g. a sort). This is particularly useful for tables with- * large amounts of data where it can take a noticeable amount of time to sort- * the entries.- * @type boolean- * @default false- *- * @dtopt Features- * @name DataTable.defaults.processing- *- * @example- * $(document).ready( function () {- * $('#example').dataTable( {- * "processing": true- * } );- * } );- */- "bProcessing": false,--- /**- * Retrieve the DataTables object for the given selector. Note that if the- * table has already been initialised, this parameter will cause DataTables- * to simply return the object that has already been set up - it will not take- * account of any changes you might have made to the initialisation object- * passed to DataTables (setting this parameter to true is an acknowledgement- * that you understand this). `destroy` can be used to reinitialise a table if- * you need.- * @type boolean- * @default false- *- * @dtopt Options- * @name DataTable.defaults.retrieve- *- * @example- * $(document).ready( function() {- * initTable();- * tableActions();- * } );- *- * function initTable ()- * {- * return $('#example').dataTable( {- * "scrollY": "200px",- * "paginate": false,- * "retrieve": true- * } );- * }- *- * function tableActions ()- * {- * var table = initTable();- * // perform API operations with oTable- * }- */- "bRetrieve": false,--- /**- * Indicate if DataTables should be allowed to set the padding / margin- * etc for the scrolling header elements or not. Typically you will want- * this.- * @type boolean- * @default true- *- * @dtopt Options- * @name DataTable.defaults.scrollAutoCss- *- * @example- * $(document).ready( function() {- * $('#example').dataTable( {- * "scrollAutoCss": false,- * "scrollY": "200px"- * } );- * } );- */- "bScrollAutoCss": true,--- /**- * When vertical (y) scrolling is enabled, DataTables will force the height of- * the table's viewport to the given height at all times (useful for layout).- * However, this can look odd when filtering data down to a small data set,- * and the footer is left "floating" further down. This parameter (when- * enabled) will cause DataTables to collapse the table's viewport down when- * the result set will fit within the given Y height.- * @type boolean- * @default false- *- * @dtopt Options- * @name DataTable.defaults.scrollCollapse- *- * @example- * $(document).ready( function() {- * $('#example').dataTable( {- * "scrollY": "200",- * "scrollCollapse": true- * } );- * } );- */- "bScrollCollapse": false,--- /**- * Enable infinite scrolling for DataTables (to be used in combination with- * `scrollY`). Infinite scrolling means that DataTables will continually load- * data as a user scrolls through a table, which is very useful for large- * dataset. This cannot be used with pagination, which is automatically- * disabled. *Note*: the Scroller extra for DataTables is recommended in- * in preference to this option.- * @type boolean- * @default false- *- * @dtopt Features- * @name DataTable.defaults.scrollInfinite- *- * @example- * $(document).ready( function() {- * $('#example').dataTable( {- * "scrollInfinite": true,- * "scrollCollapse": true,- * "scrollY": "200px"- * } );- * } );- */- "bScrollInfinite": false,--- /**- * Configure DataTables to use server-side processing. Note that the- * `ajaxSource` parameter must also be given in order to give DataTables a- * source to obtain the required data for each draw.- * @type boolean- * @default false- *- * @dtopt Features- * @dtopt Server-side- * @name DataTable.defaults.serverSide- *- * @example- * $(document).ready( function () {- * $('#example').dataTable( {- * "serverSide": true,- * "ajaxSource": "xhr.php"- * } );- * } );- */- "bServerSide": false,--- /**- * Enable or disable sorting of columns. Sorting of individual columns can be- * disabled by the `sortable` option for each column.- * @type boolean- * @default true- *- * @dtopt Features- * @name DataTable.defaults.sort- *- * @example- * $(document).ready( function () {- * $('#example').dataTable( {- * "sort": false- * } );- * } );- */- "bSort": true,--- /**- * Allows control over whether DataTables should use the top (true) unique- * cell that is found for a single column, or the bottom (false - default).- * This is useful when using complex headers.- * @type boolean- * @default false- *- * @dtopt Options- * @name DataTable.defaults.sortCellsTop- *- * @example- * $(document).ready( function() {- * $('#example').dataTable( {- * "sortCellsTop": true- * } );- * } );- */- "bSortCellsTop": false,--- /**- * Enable or disable the addition of the classes `sorting\_1`, `sorting\_2` and- * `sorting\_3` to the columns which are currently being sorted on. This is- * presented as a feature switch as it can increase processing time (while- * classes are removed and added) so for large data sets you might want to- * turn this off.- * @type boolean- * @default true- *- * @dtopt Features- * @name DataTable.defaults.sortClasses- *- * @example- * $(document).ready( function () {- * $('#example').dataTable( {- * "sortClasses": false- * } );- * } );- */- "bSortClasses": true,--- /**- * Enable or disable state saving. When enabled a cookie will be used to save- * table display information such as pagination information, display length,- * filtering and sorting. As such when the end user reloads the page the- * display display will match what thy had previously set up.- * @type boolean- * @default false- *- * @dtopt Features- * @name DataTable.defaults.stateSave- *- * @example- * $(document).ready( function () {- * $('#example').dataTable( {- * "stateSave": true- * } );- * } );- */- "bStateSave": false,--- /**- * Customise the cookie and / or the parameters being stored when using- * DataTables with state saving enabled. This function is called whenever- * the cookie is modified, and it expects a fully formed cookie string to be- * returned. Note that the data object passed in is a Javascript object which- * must be converted to a string (`JSON.stringify` for example).- * @type function- * @param {string} name Name of the cookie defined by DataTables- * @param {object} data Data to be stored in the cookie- * @param {string} expires Cookie expires string- * @param {string} path Path of the cookie to set- * @returns {string} Cookie formatted string (which should be encoded by- * using encodeURIComponent())- *- * @dtopt Callbacks- * @name DataTable.defaults.cookieCallback- *- * @example- * $(document).ready( function () {- * $('#example').dataTable( {- * "cookieCallback": function (name, data, expires, path) {- * // Customise data or name or whatever else here- * return name + "="+JSON.stringify(data)+"; expires=" + expires +"; path=" + path;- * }- * } );- * } );- */- "fnCookieCallback": null,--- /**- * This function is called when a TR element is created (and all TD child- * elements have been inserted), or registered if using a DOM source, allowing- * manipulation of the TR element (adding classes etc).- * @type function- * @param {node} row "TR" element for the current row- * @param {array} data Raw data array for this row- * @param {int} dataIndex The index of this row in the internal aoData array- *- * @dtopt Callbacks- * @name DataTable.defaults.createdRow- *- * @example- * $(document).ready( function() {- * $('#example').dataTable( {- * "createdRow": function( row, data, dataIndex ) {- * // Bold the grade for all 'A' grade browsers- * if ( data[4] == "A" )- * {- * $('td:eq(4)', row).html( '<b>A</b>' );- * }- * }- * } );- * } );- */- "fnCreatedRow": null,--- /**- * This function is called on every 'draw' event, and allows you to- * dynamically modify any aspect you want about the created DOM.- * @type function- * @param {object} settings DataTables settings object- *- * @dtopt Callbacks- * @name DataTable.defaults.drawCallback- *- * @example- * $(document).ready( function() {- * $('#example').dataTable( {- * "fnDrawCallback": function( settings ) {- * alert( 'DataTables has redrawn the table' );- * }- * } );- * } );- */- "fnDrawCallback": null,--- /**- * Identical to fnHeaderCallback() but for the table footer this function- * allows you to modify the table footer on every 'draw' even.- * @type function- * @param {node} foot "TR" element for the footer- * @param {array} data Full table data (as derived from the original HTML)- * @param {int} start Index for the current display starting point in the- * display array- * @param {int} end Index for the current display ending point in the- * display array- * @param {array int} display Index array to translate the visual position- * to the full data array- *- * @dtopt Callbacks- * @name DataTable.defaults.footerCallback- *- * @example- * $(document).ready( function() {- * $('#example').dataTable( {- * "footerCallback": function( foot, data, start, end, display ) {- * foot.getElementsByTagName('th')[0].innerHTML = "Starting index is "+start;- * }- * } );- * } )- */- "fnFooterCallback": null,--- /**- * When rendering large numbers in the information element for the table- * (i.e. "Showing 1 to 10 of 57 entries") DataTables will render large numbers- * to have a comma separator for the 'thousands' units (e.g. 1 million is- * rendered as "1,000,000") to help readability for the end user. This- * function will override the default method DataTables uses.- * @type function- * @member- * @param {int} toFormat number to be formatted- * @returns {string} formatted string for DataTables to show the number- *- * @dtopt Callbacks- * @name DataTable.defaults.formatNumber- *- * @example- * $(document).ready( function() {- * $('#example').dataTable( {- * "formatNumber": function ( toFormat ) {- * if ( toFormat < 1000 ) {- * return toFormat;- * } else {- * var- * s=(toFormat+""),- * 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;- * };- * } );- * } );- */- "fnFormatNumber": function ( toFormat ) {- if ( toFormat < 1000 )- {- // A small optimisation for what is likely to be the majority of use cases- return toFormat;- }-- var s=(toFormat+""), a=s.split(""), out="", iLen=s.length;-- for ( var i=0 ; i<iLen ; i++ )- {- if ( i%3 === 0 && i !== 0 )- {- out = this.language.infoThousands+out;- }- out = a[iLen-i-1]+out;- }- return out;- },--- /**- * This function is called on every 'draw' event, and allows you to- * dynamically modify the header row. This can be used to calculate and- * display useful information about the table.- * @type function- * @param {node} head "TR" element for the header- * @param {array} data Full table data (as derived from the original HTML)- * @param {int} start Index for the current display starting point in the- * display array- * @param {int} end Index for the current display ending point in the- * display array- * @param {array int} display Index array to translate the visual position- * to the full data array- *- * @dtopt Callbacks- * @name DataTable.defaults.headerCallback- *- * @example- * $(document).ready( function() {- * $('#example').dataTable( {- * "fheaderCallback": function( head, data, start, end, display ) {- * head.getElementsByTagName('th')[0].innerHTML = "Displaying "+(end-start)+" records";- * }- * } );- * } )- */- "fnHeaderCallback": null,--- /**- * The information element can be used to convey information about the current- * state of the table. Although the internationalisation options presented by- * DataTables are quite capable of dealing with most customisations, there may- * be times where you wish to customise the string further. This callback- * allows you to do exactly that.- * @type function- * @param {object} oSettings DataTables settings object- * @param {int} start Starting position in data for the draw- * @param {int} end End position in data for the draw- * @param {int} max Total number of rows in the table (regardless of- * filtering)- * @param {int} total Total number of rows in the data set, after filtering- * @param {string} pre The string that DataTables has formatted using it's- * own rules- * @returns {string} The string to be displayed in the information element.- *- * @dtopt Callbacks- * @name DataTable.defaults.infoCallback- *- * @example- * $('#example').dataTable( {- * "infoCallback": function( settings, start, end, nax, total, pre ) {- * return start +" to "+ end;- * }- * } );- */- "fnInfoCallback": null,--- /**- * Called when the table has been initialised. Normally DataTables will- * initialise sequentially and there will be no need for this function,- * however, this does not hold true when using external language information- * since that is obtained using an async XHR call.- * @type function- * @param {object} settings DataTables settings object- * @param {object} json The JSON object request from the server - only- * present if client-side Ajax sourced data is used- *- * @dtopt Callbacks- * @name DataTable.defaults.initComplete- *- * @example- * $(document).ready( function() {- * $('#example').dataTable( {- * "initComplete": function(settings, json) {- * alert( 'DataTables has finished its initialisation.' );- * }- * } );- * } )- */- "fnInitComplete": null,--- /**- * Called at the very start of each table draw and can be used to cancel the- * draw by returning false, any other return (including undefined) results in- * the full draw occurring).- * @type function- * @param {object} settings DataTables settings object- * @returns {boolean} False will cancel the draw, anything else (including no- * return) will allow it to complete.- *- * @dtopt Callbacks- * @name DataTable.defaults.preDrawCallback- *- * @example- * $(document).ready( function() {- * $('#example').dataTable( {- * "preDrawCallback": function( settings ) {- * if ( $('#test').val() == 1 ) {- * return false;- * }- * }- * } );- * } );- */- "fnPreDrawCallback": null,--- /**- * This function allows you to 'post process' each row after it have been- * generated for each table draw, but before it is rendered on screen. This- * function might be used for setting the row class name etc.- * @type function- * @param {node} row "TR" element for the current row- * @param {array} data Raw data array for this row- * @param {int} displayIndex The display index for the current table draw- * @param {int} displayIndexFull The index of the data in the full list of- * rows (after filtering)- *- * @dtopt Callbacks- * @name DataTable.defaults.rowCallback- *- * @example- * $(document).ready( function() {- * $('#example').dataTable( {- * "rowCallback": function( row, data, displayIndex, displayIndexFull ) {- * // Bold the grade for all 'A' grade browsers- * if ( data[4] == "A" ) {- * $('td:eq(4)', row).html( '<b>A</b>' );- * }- * }- * } );- * } );- */- "fnRowCallback": null,--- /**- * This parameter allows you to override the default function which obtains- * the data from the server so something more suitable for your application. For- * example you could use POST data, or pull information from a Gears or AIR- * database.- * @type function- * @member- * @param {string} source HTTP source to obtain the data from (`ajaxSource`)- * @param {array} data A key/value pair object containing the data to send- * to the server- * @param {function} callback to be called on completion of the data get- * process that will draw the data on the page.- * @param {object} settings DataTables settings object- *- * @dtopt Callbacks- * @dtopt Server-side- * @name DataTable.defaults.serverData- *- * @example- * // POST data to server (note you can use `serverMethod` to set the- * // HTTP method is that is all you want to use `serverData` for.- * $(document).ready( function() {- * $('#example').dataTable( {- * "processing": true,- * "serverSide": true,- * "ajaxSource": "xhr.php",- * "serverData": function ( source, data, callback, settings ) {- * settings.jqXHR = $.ajax( {- * "dataType": 'json',- * "type": "POST",- * "url": source,- * "data": data,- * "success": callback- * } );- * }- * } );- * } );- */- "fnServerData": function ( url, data, callback, settings ) {- settings.jqXHR = $.ajax( {- "url": url,- "data": data,- "success": function (json) {- if ( json.sError ) {- settings.oApi._fnLog( settings, 0, json.sError );- }-- $(settings.oInstance).trigger('xhr', [settings, json]);- callback( json );- },- "dataType": "json",- "cache": false,- "type": settings.sServerMethod,- "error": function (xhr, error, thrown) {- if ( error == "parsererror" ) {- settings.oApi._fnLog( settings, 0, "DataTables warning: JSON data from "+- "server could not be parsed. This is caused by a JSON formatting error." );- }- }- } );- },--- /**- * It is often useful to send extra data to the server when making an Ajax- * request - for example custom filtering information, and this callback- * function makes it trivial to send extra information to the server. The- * passed in parameter is the data set that has been constructed by- * DataTables, and you can add to this or modify it as you require.- * @type function- * @param {array} data Data array (array of objects which are name/value- * pairs) that has been constructed by DataTables and will be sent to the- * server. In the case of Ajax sourced data with server-side processing- * this will be an empty array, for server-side processing there will be a- * significant number of parameters!- * @returns {undefined} Ensure that you modify the data array passed in,- * as this is passed by reference.- *- * @dtopt Callbacks- * @dtopt Server-side- * @name DataTable.defaults.serverParams- *- * @example- * $(document).ready( function() {- * $('#example').dataTable( {- * "processing": true,- * "serverSide": true,- * "ajaxSource": "scripts/server_processing.php",- * "serverParams": function ( data ) {- * data.push( { "name": "more_data", "value": "my_value" } );- * }- * } );- * } );- */- "fnServerParams": null,--- /**- * Load the table state. With this function you can define from where, and how, the- * state of a table is loaded. By default DataTables will load from its state saving- * cookie, but you might wish to use local storage (HTML5) or a server-side database.- * @type function- * @member- * @param {object} settings DataTables settings object- * @return {object} The DataTables state object to be loaded- *- * @dtopt Callbacks- * @name DataTable.defaults.stateLoadCallback- *- * @example- * $(document).ready( function() {- * $('#example').dataTable( {- * "stateSave": true,- * "stateLoadCallback": function (settings) {- * var o;- *- * // Send an Ajax request to the server to get the data. Note that- * // this is a synchronous request.- * $.ajax( {- * "url": "/state_load",- * "async": false,- * "dataType": "json",- * "success": function (json) {- * o = json;- * }- * } );- *- * return o;- * }- * } );- * } );- */- "fnStateLoadCallback": function ( settings ) {- var sData = this.oApi._fnReadCookie( settings.sCookiePrefix+settings.sInstance );- var oData;-- try {- oData = (typeof $.parseJSON === 'function') ?- $.parseJSON(sData) : eval( '('+sData+')' );- } catch (e) {- oData = null;- }-- return oData;- },--- /**- * Callback which allows modification of the saved state prior to loading that state.- * This callback is called when the table is loading state from the stored data, but- * prior to the settings object being modified by the saved state. Note that for- * plug-in authors, you should use the `stateLoadParams` event to load parameters for- * a plug-in.- * @type function- * @param {object} settings DataTables settings object- * @param {object} data The state object that is to be loaded- *- * @dtopt Callbacks- * @name DataTable.defaults.stateLoadParams- *- * @example- * // Remove a saved filter, so filtering is never loaded- * $(document).ready( function() {- * $('#example').dataTable( {- * "stateSave": true,- * "stateLoadParams": function (settings, data) {- * data.oSearch.sSearch = "";- * }- * } );- * } );- *- * @example- * // Disallow state loading by returning false- * $(document).ready( function() {- * $('#example').dataTable( {- * "stateSave": true,- * "stateLoadParams": function (settings, data) {- * return false;- * }- * } );- * } );- */- "fnStateLoadParams": null,--- /**- * Callback that is called when the state has been loaded from the state saving method- * and the DataTables settings object has been modified as a result of the loaded state.- * @type function- * @param {object} settings DataTables settings object- * @param {object} data The state object that was loaded- *- * @dtopt Callbacks- * @name DataTable.defaults.stateLoaded- *- * @example- * // Show an alert with the filtering value that was saved- * $(document).ready( function() {- * $('#example').dataTable( {- * "stateSave": true,- * "stateLoaded": function (settings, data) {- * alert( 'Saved filter was: '+data.oSearch.sSearch );- * }- * } );- * } );- */- "fnStateLoaded": null,--- /**- * Save the table state. This function allows you to define where and how the state- * information for the table is stored - by default it will use a cookie, but you- * might want to use local storage (HTML5) or a server-side database.- * @type function- * @member- * @param {object} settings DataTables settings object- * @param {object} data The state object to be saved- *- * @dtopt Callbacks- * @name DataTable.defaults.stateSaveCallback- *- * @example- * $(document).ready( function() {- * $('#example').dataTable( {- * "stateSave": true,- * "stateSaveCallback": function (settings, data) {- * // Send an Ajax request to the server with the state object- * $.ajax( {- * "url": "/state_save",- * "data": data,- * "dataType": "json",- * "method": "POST"- * "success": function () {}- * } );- * }- * } );- * } );- */- "fnStateSaveCallback": function ( settings, data ) {- this.oApi._fnCreateCookie(- settings.sCookiePrefix+settings.sInstance,- this.oApi._fnJsonString(data),- settings.iCookieDuration,- settings.sCookiePrefix,- settings.fnCookieCallback- );- },--- /**- * Callback which allows modification of the state to be saved. Called when the table- * has changed state a new state save is required. This method allows modification of- * the state saving object prior to actually doing the save, including addition or- * other state properties or modification. Note that for plug-in authors, you should- * use the `stateSaveParams` event to save parameters for a plug-in.- * @type function- * @param {object} settings DataTables settings object- * @param {object} data The state object to be saved- *- * @dtopt Callbacks- * @name DataTable.defaults.stateSaveParams- *- * @example- * // Remove a saved filter, so filtering is never saved- * $(document).ready( function() {- * $('#example').dataTable( {- * "stateSave": true,- * "stateSaveParams": function (settings, data) {- * data.oSearch.sSearch = "";- * }- * } );- * } );- */- "fnStateSaveParams": null,--- /**- * Duration of the cookie which is used for storing session information. This- * value is given in seconds.- * @type int- * @default 7200 <i>(2 hours)</i>- *- * @dtopt Options- * @name DataTable.defaults.cookieDuration- *- * @example- * $(document).ready( function() {- * $('#example').dataTable( {- * "cookieDuration": 60*60*24; // 1 day- * } );- * } )- */- "fnCookieDuration": 7200,--- /**- * When enabled DataTables will not make a request to the server for the first- * page draw - rather it will use the data already on the page (no sorting etc- * will be applied to it), thus saving on an XHR at load time. `deferLoading`- * is used to indicate that deferred loading is required, but it is also used- * to tell DataTables how many records there are in the full table (allowing- * the information element and pagination to be displayed correctly). In the case- * where a filtering is applied to the table on initial load, this can be- * indicated by giving the parameter as an array, where the first element is- * the number of records available after filtering and the second element is the- * number of records without filtering (allowing the table information element- * to be shown correctly).- * @type int | array- * @default null- *- * @dtopt Options- * @name DataTable.defaults.deferLoading- *- * @example- * // 57 records available in the table, no filtering applied- * $(document).ready( function() {- * $('#example').dataTable( {- * "serverSide": true,- * "ajaxSource": "scripts/server_processing.php",- * "deferLoading": 57- * } );- * } );- *- * @example- * // 57 records after filtering, 100 without filtering (an initial filter applied)- * $(document).ready( function() {- * $('#example').dataTable( {- * "serverSide": true,- * "ajaxSource": "scripts/server_processing.php",- * "deferLoading": [ 57, 100 ],- * "search": {- * "search": "my_filter"- * }- * } );- * } );- */- "bDeferLoading": null,--- /**- * Number of rows to display on a single page when using pagination. If- * feature enabled (`lengthChange`) then the end user will be able to override- * this to a custom setting using a pop-up menu.- * @type int- * @default 10- *- * @dtopt Options- * @name DataTable.defaults.displayLength- *- * @example- * $(document).ready( function() {- * $('#example').dataTable( {- * "displayLength": 50- * } );- * } )- */- "iDisplayLength": 10,--- /**- * Define the starting point for data display when using DataTables with- * pagination. Note that this parameter is the number of records, rather than- * the page number, so if you have 10 records per page and want to start on- * the third page, it should be "20".- * @type int- * @default 0- *- * @dtopt Options- * @name DataTable.defaults.displayStart- *- * @example- * $(document).ready( function() {- * $('#example').dataTable( {- * "displayStart": 20- * } );- * } )- */- "iDisplayStart": 0,--- /**- * The scroll gap is the amount of scrolling that is left to go before- * DataTables will load the next 'page' of data automatically when using- * `scrollInfinite`. You typically want a gap which is big enough that the- * scrolling will be smooth for the user, while not so large that it will- * load more data than need.- * @type int- * @default 100- *- * @dtopt Options- * @name DataTable.defaults.scrollLoadGap- *- * @example- * $(document).ready( function() {- * $('#example').dataTable( {- * "scrollInfinite": true,- * "scrollCollapse": true,- * "scrollY": "200px",- * "scrollLoadGap": 50- * } );- * } );- */- "iScrollLoadGap": 100,--- /**- * By default DataTables allows keyboard navigation of the table (sorting, paging,- * and filtering) by adding a `tabindex` attribute to the required elements. This- * allows you to tab through the controls and press the enter key to activate them.- * The tabindex is default 0, meaning that the tab follows the flow of the document.- * You can overrule this using this parameter if you wish. Use a value of -1 to- * disable built-in keyboard navigation.- * @type int- * @default 0- *- * @dtopt Options- * @name DataTable.defaults.tabIndex- *- * @example- * $(document).ready( function() {- * $('#example').dataTable( {- * "tabIndex": 1- * } );- * } );- */- "iTabIndex": 0,--- /**- * All strings that DataTables uses in the user interface that it creates- * are defined in this object, allowing you to modified them individually or- * completely replace them all as required.- * @namespace- * @name DataTable.defaults.language- */- "oLanguage": {- /**- * Strings that are used for WAI-ARIA labels and controls only (these are not- * actually visible on the page, but will be read by screenreaders, and thus- * must be internationalised as well).- * @namespace- * @name DataTable.defaults.language.aria- */- "oAria": {- /**- * ARIA label that is added to the table headers when the column may be- * sorted ascending by activing the column (click or return when focused).- * Note that the column header is prefixed to this string.- * @type string- * @default : activate to sort column ascending- *- * @dtopt Language- * @name DataTable.defaults.language.aria.sortAscending- *- * @example- * $(document).ready( function() {- * $('#example').dataTable( {- * "language": {- * "aria": {- * "sortAscending": " - click/return to sort ascending"- * }- * }- * } );- * } );- */- "sSortAscending": ": activate to sort column ascending",-- /**- * ARIA label that is added to the table headers when the column may be- * sorted descending by activing the column (click or return when focused).- * Note that the column header is prefixed to this string.- * @type string- * @default : activate to sort column ascending- *- * @dtopt Language- * @name DataTable.defaults.language.aria.sortDescending- *- * @example- * $(document).ready( function() {- * $('#example').dataTable( {- * "language": {- * "aria": {- * "sortDescending": " - click/return to sort descending"- * }- * }- * } );- * } );- */- "sSortDescending": ": activate to sort column descending"- },-- /**- * Pagination string used by DataTables for the two built-in pagination- * control types ("two_button" and "full_numbers")- * @namespace- * @name DataTable.defaults.language.paginate- */- "oPaginate": {- /**- * Text to use when using the 'full_numbers' type of pagination for the- * button to take the user to the first page.- * @type string- * @default First- *- * @dtopt Language- * @name DataTable.defaults.language.paginate.first- *- * @example- * $(document).ready( function() {- * $('#example').dataTable( {- * "language": {- * "paginate": {- * "first": "First page"- * }- * }- * } );- * } );- */- "sFirst": "First",--- /**- * Text to use when using the 'full_numbers' type of pagination for the- * button to take the user to the last page.- * @type string- * @default Last- *- * @dtopt Language- * @name DataTable.defaults.language.paginate.last- *- * @example- * $(document).ready( function() {- * $('#example').dataTable( {- * "language": {- * "paginate": {- * "last": "Last page"- * }- * }- * } );- * } );- */- "sLast": "Last",--- /**- * Text to use for the 'next' pagination button (to take the user to the- * next page).- * @type string- * @default Next- *- * @dtopt Language- * @name DataTable.defaults.language.paginate.next- *- * @example- * $(document).ready( function() {- * $('#example').dataTable( {- * "language": {- * "paginate": {- * "next": "Next page"- * }- * }- * } );- * } );- */- "sNext": "Next",--- /**- * Text to use for the 'previous' pagination button (to take the user to- * the previous page).- * @type string- * @default Previous- *- * @dtopt Language- * @name DataTable.defaults.language.paginate.previous- *- * @example- * $(document).ready( function() {- * $('#example').dataTable( {- * "language": {- * "paginate": {- * "previous": "Previous page"- * }- * }- * } );- * } );- */- "sPrevious": "Previous"- },-- /**- * This string is shown in preference to `zeroRecords` when the table is- * empty of data (regardless of filtering). Note that this is an optional- * parameter - if it is not given, the value of `zeroRecords` will be used- * instead (either the default or given value).- * @type string- * @default No data available in table- *- * @dtopt Language- * @name DataTable.defaults.language.emptyTable- *- * @example- * $(document).ready( function() {- * $('#example').dataTable( {- * "language": {- * "emptyTable": "No data available in table"- * }- * } );- * } );- */- "sEmptyTable": "No data available in table",--- /**- * This string gives information to the end user about the information that- * is current on display on the page. The _START_, _END_ and _TOTAL_- * variables are all dynamically replaced as the table display updates, and- * can be freely moved or removed as the language requirements change.- * @type string- * @default Showing _START_ to _END_ of _TOTAL_ entries- *- * @dtopt Language- * @name DataTable.defaults.language.info- *- * @example- * $(document).ready( function() {- * $('#example').dataTable( {- * "language": {- * "info": "Got a total of _TOTAL_ entries to show (_START_ to _END_)"- * }- * } );- * } );- */- "sInfo": "Showing _START_ to _END_ of _TOTAL_ entries",--- /**- * Display information string for when the table is empty. Typically the- * format of this string should match `info`.- * @type string- * @default Showing 0 to 0 of 0 entries- *- * @dtopt Language- * @name DataTable.defaults.language.infoEmpty- *- * @example- * $(document).ready( function() {- * $('#example').dataTable( {- * "language": {- * "infoEmpty": "No entries to show"- * }- * } );- * } );- */- "sInfoEmpty": "Showing 0 to 0 of 0 entries",--- /**- * When a user filters the information in a table, this string is appended- * to the information (`info`) to give an idea of how strong the filtering- * is. The variable _MAX_ is dynamically updated.- * @type string- * @default (filtered from _MAX_ total entries)- *- * @dtopt Language- * @name DataTable.defaults.language.infoFiltered- *- * @example- * $(document).ready( function() {- * $('#example').dataTable( {- * "language": {- * "infoFiltered": " - filtering from _MAX_ records"- * }- * } );- * } );- */- "sInfoFiltered": "(filtered from _MAX_ total entries)",--- /**- * If can be useful to append extra information to the info string at times,- * and this variable does exactly that. This information will be appended to- * the `info` (`infoEmpty` and `infoFiltered` in whatever combination they are- * being used) at all times.- * @type string- * @default <i>Empty string</i>- *- * @dtopt Language- * @name DataTable.defaults.language.infoPostFix- *- * @example- * $(document).ready( function() {- * $('#example').dataTable( {- * "language": {- * "infoPostFix": "All records shown are derived from real information."- * }- * } );- * } );- */- "sInfoPostFix": "",--- /**- * DataTables has a build in number formatter (`formatNumber`) which is used- * to format large numbers that are used in the table information. By- * default a comma is used, but this can be trivially changed to any- * character you wish with this parameter.- * @type string- * @default ,- *- * @dtopt Language- * @name DataTable.defaults.language.infoThousands- *- * @example- * $(document).ready( function() {- * $('#example').dataTable( {- * "language": {- * "infoThousands": "'"- * }- * } );- * } );- */- "sInfoThousands": ",",--- /**- * Detail the action that will be taken when the drop down menu for the- * pagination length option is changed. The '_MENU_' variable is replaced- * with a default select list of 10, 25, 50 and 100, and can be replaced- * with a custom select box if required.- * @type string- * @default Show _MENU_ entries- *- * @dtopt Language- * @name DataTable.defaults.language.lengthMenu- *- * @example- * // Language change only- * $(document).ready( function() {- * $('#example').dataTable( {- * "language": {- * "lengthMenu": "Display _MENU_ records"- * }- * } );- * } );- *- * @example- * // Language and options change- * $(document).ready( function() {- * $('#example').dataTable( {- * "language": {- * "lengthMenu": 'Display <select>'+- * '<option value="10">10</option>'+- * '<option value="20">20</option>'+- * '<option value="30">30</option>'+- * '<option value="40">40</option>'+- * '<option value="50">50</option>'+- * '<option value="-1">All</option>'+- * '</select> records'- * }- * } );- * } );- */- "sLengthMenu": "Show _MENU_ entries",--- /**- * When using Ajax sourced data and during the first draw when DataTables is- * gathering the data, this message is shown in an empty row in the table to- * indicate to the end user the the data is being loaded. Note that this- * parameter is not used when loading data by server-side processing, just- * Ajax sourced data with client-side processing.- * @type string- * @default Loading...- *- * @dtopt Language- * @name DataTable.defaults.language.loadingRecords- *- * @example- * $(document).ready( function() {- * $('#example').dataTable( {- * "language": {- * "loadingRecords": "Please wait - loading..."- * }- * } );- * } );- */- "sLoadingRecords": "Loading...",--- /**- * Text which is displayed when the table is processing a user action- * (usually a sort command or similar).- * @type string- * @default Processing...- *- * @dtopt Language- * @name DataTable.defaults.language.processing- *- * @example- * $(document).ready( function() {- * $('#example').dataTable( {- * "language": {- * "processing": "DataTables is currently busy"- * }- * } );- * } );- */- "sProcessing": "Processing...",--- /**- * Details the actions that will be taken when the user types into the- * filtering input text box. The variable "_INPUT_", if used in the string,- * is replaced with the HTML text box for the filtering input allowing- * control over where it appears in the string. If "_INPUT_" is not given- * then the input box is appended to the string automatically.- * @type string- * @default Search:- *- * @dtopt Language- * @name DataTable.defaults.language.search- *- * @example- * // Input text box will be appended at the end automatically- * $(document).ready( function() {- * $('#example').dataTable( {- * "language": {- * "search": "Filter records:"- * }- * } );- * } );- *- * @example- * // Specify where the filter should appear- * $(document).ready( function() {- * $('#example').dataTable( {- * "language": {- * "search": "Apply filter _INPUT_ to table"- * }- * } );- * } );- */- "sSearch": "Search:",--- /**- * All of the language information can be stored in a file on the- * server-side, which DataTables will look up if this parameter is passed.- * It must store the URL of the language file, which is in a JSON format,- * and the object has the same properties as the oLanguage object in the- * initialiser object (i.e. the above parameters). Please refer to one of- * the example language files to see how this works in action.- * @type string- * @default <i>Empty string - i.e. disabled</i>- *- * @dtopt Language- * @name DataTable.defaults.language.url- *- * @example- * $(document).ready( function() {- * $('#example').dataTable( {- * "language": {- * "url": "http://www.sprymedia.co.uk/dataTables/lang.txt"- * }- * } );- * } );- */- "sUrl": "",--- /**- * Text shown inside the table records when the is no information to be- * displayed after filtering. `emptyTable` is shown when there is simply no- * information in the table at all (regardless of filtering).- * @type string- * @default No matching records found- *- * @dtopt Language- * @name DataTable.defaults.language.zeroRecords- *- * @example- * $(document).ready( function() {- * $('#example').dataTable( {- * "language": {- * "zeroRecords": "No records to display"- * }- * } );- * } );- */- "sZeroRecords": "No matching records found"- },--- /**- * This parameter allows you to have define the global filtering state at- * initialisation time. As an object the `search` parameter must be- * defined, but all other parameters are optional. When `regex` is true,- * the search string will be treated as a regular expression, when false- * (default) it will be treated as a straight string. When `smart`- * DataTables will use it's smart filtering methods (to word match at- * any point in the data), when false this will not be done.- * @namespace- * @extends DataTable.models.oSearch- *- * @dtopt Options- * @name DataTable.defaults.search- *- * @example- * $(document).ready( function() {- * $('#example').dataTable( {- * "search": {"search": "Initial search"}- * } );- * } )- */- "oSearch": $.extend( {}, DataTable.models.oSearch ),--- /**- * By default DataTables will look for the property 'aaData' when obtaining- * data from an Ajax source or for server-side processing - this parameter- * allows that property to be changed. You can use Javascript dotted object- * notation to get a data source for multiple levels of nesting.- * @type string- * @default aaData- *- * @dtopt Options- * @dtopt Server-side- * @name DataTable.defaults.ajaxDataProp- *- * @example- * // Get data from { "data": [...] }- * $(document).ready( function() {- * var oTable = $('#example').dataTable( {- * "ajaxSource": "sources/data.txt",- * "ajaxDataProp": "data"- * } );- * } );- *- * @example- * // Get data from { "data": { "inner": [...] } }- * $(document).ready( function() {- * var oTable = $('#example').dataTable( {- * "ajaxSource": "sources/data.txt",- * "ajaxDataProp": "data.inner"- * } );- * } );- */- "sAjaxDataProp": "aaData",--- /**- * You can instruct DataTables to load data from an external source using this- * parameter (use aData if you want to pass data in you already have). Simply- * provide a url a JSON object can be obtained from. This object must include- * the parameter `aaData` which is the data source for the table.- * @type string- * @default null- *- * @dtopt Options- * @dtopt Server-side- * @name DataTable.defaults.ajaxSource- *- * @example- * $(document).ready( function() {- * $('#example').dataTable( {- * "ajaxSource": "/dataTables/json.php"- * } );- * } )- */- "sAjaxSource": null,--- /**- * This parameter can be used to override the default prefix that DataTables- * assigns to a cookie when state saving is enabled.- * @type string- * @default SpryMedia_DataTables_- *- * @dtopt Options- * @name DataTable.defaults.cookiePrefix- *- * @example- * $(document).ready( function() {- * $('#example').dataTable( {- * "cookiePrefix": "my_datatable_",- * } );- * } );- */- "sCookiePrefix": "SpryMedia_DataTables_",--- /**- * This initialisation variable allows you to specify exactly where in the- * DOM you want DataTables to inject the various controls it adds to the page- * (for example you might want the pagination controls at the top of the- * table). DIV elements (with or without a custom class) can also be added to- * aid styling. The follow syntax is used:- * <ul>- * <li>The following options are allowed:- * <ul>- * <li>'l' - Length changing</li- * <li>'f' - Filtering input</li>- * <li>'t' - The table!</li>- * <li>'i' - Information</li>- * <li>'p' - Pagination</li>- * <li>'r' - pRocessing</li>- * </ul>- * </li>- * <li>The following constants are allowed:- * <ul>- * <li>'H' - jQueryUI theme "header" classes ('fg-toolbar ui-widget-header ui-corner-tl ui-corner-tr ui-helper-clearfix')</li>- * <li>'F' - jQueryUI theme "footer" classes ('fg-toolbar ui-widget-header ui-corner-bl ui-corner-br ui-helper-clearfix')</li>- * </ul>- * </li>- * <li>The following syntax is expected:- * <ul>- * <li>'<' and '>' - div elements</li>- * <li>'<"class" and '>' - div with a class</li>- * <li>'<"#id" and '>' - div with an ID</li>- * </ul>- * </li>- * <li>Examples:- * <ul>- * <li>'<"wrapper"flipt>'</li>- * <li>'<lf<t>ip>'</li>- * </ul>- * </li>- * </ul>- * @type string- * @default lfrtip <i>(when `jQueryUI` is false)</i> <b>or</b>- * <"H"lfr>t<"F"ip> <i>(when `jQueryUI` is true)</i>- *- * @dtopt Options- * @name DataTable.defaults.dom- *- * @example- * $(document).ready( function() {- * $('#example').dataTable( {- * "dom": '<"top"i>rt<"bottom"flp><"clear">'- * } );- * } );- */- "sDom": "lfrtip",--- /**- * DataTables features two different built-in pagination interaction methods- * ('two_button' or 'full_numbers') which present different page controls to- * the end user. Further methods can be added using the API (see below).- * @type string- * @default two_button- *- * @dtopt Options- * @name DataTable.defaults.paginationType- *- * @example- * $(document).ready( function() {- * $('#example').dataTable( {- * "paginationType": "full_numbers"- * } );- * } )- */- "sPaginationType": "two_button",--- /**- * Enable horizontal scrolling. When a table is too wide to fit into a certain- * layout, or you have a large number of columns in the table, you can enable- * x-scrolling to show the table in a viewport, which can be scrolled. This- * property can be any CSS unit, or a number (in which case it will be treated- * as a pixel measurement).- * @type string- * @default <i>blank string - i.e. disabled</i>- *- * @dtopt Features- * @name DataTable.defaults.scrollX- *- * @example- * $(document).ready( function() {- * $('#example').dataTable( {- * "scrollX": "100%",- * "scrollCollapse": true- * } );- * } );- */- "sScrollX": "",--- /**- * This property can be used to force a DataTable to use more width than it- * might otherwise do when x-scrolling is enabled. For example if you have a- * table which requires to be well spaced, this parameter is useful for- * "over-sizing" the table, and thus forcing scrolling. This property can by- * any CSS unit, or a number (in which case it will be treated as a pixel- * measurement).- * @type string- * @default <i>blank string - i.e. disabled</i>- *- * @dtopt Options- * @name DataTable.defaults.scrollXInner- *- * @example- * $(document).ready( function() {- * $('#example').dataTable( {- * "scrollX": "100%",- * "scrollXInner": "110%"- * } );- * } );- */- "sScrollXInner": "",--- /**- * Enable vertical scrolling. Vertical scrolling will constrain the DataTable- * to the given height, and enable scrolling for any data which overflows the- * current viewport. This can be used as an alternative to paging to display- * a lot of data in a small area (although paging and scrolling can both be- * enabled at the same time). This property can be any CSS unit, or a number- * (in which case it will be treated as a pixel measurement).- * @type string- * @default <i>blank string - i.e. disabled</i>- *- * @dtopt Features- * @name DataTable.defaults.scrollY- *- * @example- * $(document).ready( function() {- * $('#example').dataTable( {- * "scrollY": "200px",- * "paginate": false- * } );- * } );- */- "sScrollY": "",--- /**- * Set the HTTP method that is used to make the Ajax call for server-side- * processing or Ajax sourced data.- * @type string- * @default GET- *- * @dtopt Options- * @dtopt Server-side- * @name DataTable.defaults.serverMethod- *- * @example- * $(document).ready( function() {- * $('#example').dataTable( {- * "serverSide": true,- * "ajaxSource": "scripts/post.php",- * "serverMethod": "POST"- * } );- * } );- */- "sServerMethod": "GET"- };-- _fnHungarianMap( DataTable.defaults );---- /*- * Developer note - See note in model.defaults.js about the use of Hungarian- * notation and camel case.- */-- /**- * Column options that can be given to DataTables at initialisation time.- * @namespace- */- DataTable.defaults.column = {- /**- * Allows a column's sorting to take multiple columns into account when- * doing a sort. For example first name / last name columns make sense to- * do a multi-column sort over the two columns.- * @type array- * @default null <i>Takes the value of the column index automatically</i>- *- * @name DataTable.defaults.column.dataSort- * @dtopt Columns- *- * @example- * // Using `columnDefs`- * $(document).ready( function() {- * $('#example').dataTable( {- * "columnDefs": [- * { "dataSort": [ 0, 1 ], "targets": [ 0 ] },- * { "dataSort": [ 1, 0 ], "targets": [ 1 ] },- * { "dataSort": [ 2, 3, 4 ], "targets": [ 2 ] }- * ]- * } );- * } );- *- * @example- * // Using `columns`- * $(document).ready( function() {- * $('#example').dataTable( {- * "columns": [- * { "dataSort": [ 0, 1 ] },- * { "dataSort": [ 1, 0 ] },- * { "dataSort": [ 2, 3, 4 ] },- * null,- * null- * ]- * } );- * } );- */- "aDataSort": null,--- /**- * You can control the default sorting direction, and even alter the behaviour- * of the sort handler (i.e. only allow ascending sorting etc) using this- * parameter.- * @type array- * @default [ 'asc', 'desc' ]- *- * @name DataTable.defaults.column.sorting- * @dtopt Columns- *- * @example- * // Using `columnDefs`- * $(document).ready( function() {- * $('#example').dataTable( {- * "columnDefs": [- * { "sorting": [ "asc" ], "targets": [ 1 ] },- * { "sorting": [ "desc", "asc", "asc" ], "targets": [ 2 ] },- * { "sorting": [ "desc" ], "targets": [ 3 ] }- * ]- * } );- * } );- *- * @example- * // Using `columns`- * $(document).ready( function() {- * $('#example').dataTable( {- * "columns": [- * null,- * { "sorting": [ "asc" ] },- * { "sorting": [ "desc", "asc", "asc" ] },- * { "sorting": [ "desc" ] },- * null- * ]- * } );- * } );- */- "asSorting": [ 'asc', 'desc' ],--- /**- * Enable or disable filtering on the data in this column.- * @type boolean- * @default true- *- * @name DataTable.defaults.column.searchable- * @dtopt Columns- *- * @example- * // Using `columnDefs`- * $(document).ready( function() {- * $('#example').dataTable( {- * "columnDefs": [- * { "searchable": false, "targets": [ 0 ] }- * ] } );- * } );- *- * @example- * // Using `columns`- * $(document).ready( function() {- * $('#example').dataTable( {- * "columns": [- * { "searchable": false },- * null,- * null,- * null,- * null- * ] } );- * } );- */- "bSearchable": true,--- /**- * Enable or disable sorting on this column.- * @type boolean- * @default true- *- * @name DataTable.defaults.column.sortable- * @dtopt Columns- *- * @example- * // Using `columnDefs`- * $(document).ready( function() {- * $('#example').dataTable( {- * "columnDefs": [- * { "sortable": false, "targets": [ 0 ] }- * ] } );- * } );- *- * @example- * // Using `columns`- * $(document).ready( function() {- * $('#example').dataTable( {- * "columns": [- * { "sortable": false },- * null,- * null,- * null,- * null- * ] } );- * } );- */- "bSortable": true,--- /**- * Enable or disable the display of this column.- * @type boolean- * @default true- *- * @name DataTable.defaults.column.visible- * @dtopt Columns- *- * @example- * // Using `columnDefs`- * $(document).ready( function() {- * $('#example').dataTable( {- * "columnDefs": [- * { "visible": false, "targets": [ 0 ] }- * ] } );- * } );- *- * @example- * // Using `columns`- * $(document).ready( function() {- * $('#example').dataTable( {- * "columns": [- * { "visible": false },- * null,- * null,- * null,- * null- * ] } );- * } );- */- "bVisible": true,--- /**- * Developer definable function that is called whenever a cell is created (Ajax source,- * etc) or processed for input (DOM source). This can be used as a compliment to mRender- * allowing you to modify the DOM element (add background colour for example) when the- * element is available.- * @type function- * @param {element} td The TD node that has been created- * @param {*} cellData The Data for the cell- * @param {array|object} rowData The data for the whole row- * @param {int} row The row index for the aoData data store- * @param {int} col The column index for aoColumns- *- * @name DataTable.defaults.column.createdCell- * @dtopt Columns- *- * @example- * $(document).ready( function() {- * $('#example').dataTable( {- * "columnDefs": [ {- * "targets": [3],- * "createdCell": function (td, cellData, rowData, row, col) {- * if ( cellData == "1.7" ) {- * $(td).css('color', 'blue')- * }- * }- * } ]- * });- * } );- */- "fnCreatedCell": null,--- /**- * The column index (starting from 0!) that you wish a sort to be performed- * upon when this column is selected for sorting. This can be used for sorting- * on hidden columns for example.- * @type int- * @default -1 <i>Use automatically calculated column index</i>- *- * @name DataTable.defaults.column.dataSort- * @dtopt Columns- *- * @example- * // Using `columnDefs`- * $(document).ready( function() {- * $('#example').dataTable( {- * "columnDefs": [- * { "dataSort": 1, "targets": [ 0 ] }- * ]- * } );- * } );- *- * @example- * // Using `columns`- * $(document).ready( function() {- * $('#example').dataTable( {- * "columns": [- * { "dataSort": 1 },- * null,- * null,- * null,- * null- * ]- * } );- * } );- */- "iDataSort": -1,--- /**- * This parameter has been replaced by `data` in DataTables to ensure naming- * consistency. `dataProp` can still be used, as there is backwards compatibility- * in DataTables for this option, but it is strongly recommended that you use- * `data` in preference to `dataProp`.- * @name DataTable.defaults.column.dataProp- */--- /**- * This property can be used to read data from any JSON data source property,- * including deeply nested objects / properties. `data` can be given in a- * number of different ways which effect its behaviour:- *- * * integer - treated as an array index for the data source. This is the- * default that DataTables uses (incrementally increased for each column).- * * string - read an object property from the data source. Note that you can- * use Javascript dotted notation to read deep properties / arrays from the- * data source.- * * null - the sDefaultContent option will be used for the cell (null- * by default, so you will need to specify the default content you want -- * typically an empty string). This can be useful on generated columns such- * as edit / delete action columns.- * * function - the function given will be executed whenever DataTables- * needs to set or get the data for a cell in the column. The function- * takes three parameters:- * * {array|object} The data source for the row- * * {string} The type call data requested - this will be 'set' when- * setting data or 'filter', 'display', 'type', 'sort' or undefined when- * gathering data. Note that when `undefined` is given for the type- * DataTables expects to get the raw data for the object back<- * * {*} Data to set when the second parameter is 'set'.- * * The return value from the function is not required when 'set' is the type- * of call, but otherwise the return is what will be used for the data- * requested.- *- * Note that prior to DataTables 1.9.2 `data` was called `mDataProp`. The name change- * reflects the flexibility of this property and is consistent with the naming of- * mRender. If 'mDataProp' is given, then it will still be used by DataTables, as- * it automatically maps the old name to the new if required.- *- * @type string|int|function|null- * @default null <i>Use automatically calculated column index</i>- *- * @name DataTable.defaults.column.data- * @dtopt Columns- *- * @example- * // Read table data from objects- * $(document).ready( function() {- * $('#example').dataTable( {- * "ajaxSource": "sources/deep.txt",- * "columns": [- * { "data": "engine" },- * { "data": "browser" },- * { "data": "platform.inner" },- * { "data": "platform.details.0" },- * { "data": "platform.details.1" }- * ]- * } );- * } );- *- * @example- * // Using `data` as a function to provide different information for- * // sorting, filtering and display. In this case, currency (price)- * $(document).ready( function() {- * $('#example').dataTable( {- * "columnDefs": [ {- * "targets": [ 0 ],- * "data": function ( source, type, val ) {- * if (type === 'set') {- * source.price = val;- * // Store the computed dislay and filter values for efficiency- * source.price_display = val=="" ? "" : "$"+numberFormat(val);- * source.price_filter = val=="" ? "" : "$"+numberFormat(val)+" "+val;- * return;- * }- * else if (type === 'display') {- * return source.price_display;- * }- * else if (type === 'filter') {- * return source.price_filter;- * }- * // 'sort', 'type' and undefined all just use the integer- * return source.price;- * }- * } ]- * } );- * } );- */- "mData": null,--- /**- * This property is the rendering partner to `data` and it is suggested that- * when you want to manipulate data for display (including filtering, sorting etc)- * but not altering the underlying data for the table, use this property. `data`- * can actually do everything this property can and more, but this parameter is- * easier to use since there is no 'set' option. Like `data` this can be given- * in a number of different ways to effect its behaviour, with the addition of- * supporting array syntax for easy outputting of arrays (including arrays of- * objects):- *- * * integer - treated as an array index for the data source. This is the- * default that DataTables uses (incrementally increased for each column).- * * string - read an object property from the data source. Note that you can- * use Javascript dotted notation to read deep properties / arrays from the- * data source and also array brackets to indicate that the data reader should- * loop over the data source array. When characters are given between the array- * brackets, these characters are used to join the data source array together.- * For example: "accounts[, ].name" would result in a comma separated list with- * the 'name' value from the 'accounts' array of objects.- * * function - the function given will be executed whenever DataTables- * needs to set or get the data for a cell in the column. The function- * takes three parameters:- * * {array|object} The data source for the row (based on `data`)- * * {string} The type call data requested - this will be 'filter', 'display',- * 'type' or 'sort'.- * * {array|object} The full data source for the row (not based on `data`)- * * The return value from the function is what will be used for the data- * requested.- *- * @type string|int|function|null- * @default null _Use `data`_- *- * @name DataTable.defaults.column.render- * @dtopt Columns- *- * @example- * // Create a comma separated list from an array of objects- * $(document).ready( function() {- * $('#example').dataTable( {- * "ajaxSource": "sources/deep.txt",- * "columns": [- * { "data": "engine" },- * { "data": "browser" },- * {- * "data": "platform",- * "render": "[, ].name"- * }- * ]- * } );- * } );- *- * @example- * // Use as a function to create a link from the data source- * $(document).ready( function() {- * $('#example').dataTable( {- * "columnDefs": [- * {- * "targets": [ 0 ],- * "data": "download_link",- * "render": function ( data, type, full ) {- * return '<a href="'+data+'">Download</a>';- * }- * ]- * } );- * } );- */- "mRender": null,--- /**- * Change the cell type created for the column - either TD cells or TH cells. This- * can be useful as TH cells have semantic meaning in the table body, allowing them- * to act as a header for a row (you may wish to add scope='row' to the TH elements).- * @type string- * @default td- *- * @name DataTable.defaults.column.cellType- * @dtopt Columns- *- * @example- * // Make the first column use TH cells- * $(document).ready( function() {- * $('#example').dataTable( {- * "columnDefs": [ {- * "targets": [ 0 ],- * "cellType": "th"- * } ]- * } );- * } );- */- "sCellType": "td",--- /**- * Class to give to each cell in this column.- * @type string- * @default <i>Empty string</i>- *- * @name DataTable.defaults.column.class- * @dtopt Columns- *- * @example- * // Using `columnDefs`- * $(document).ready( function() {- * $('#example').dataTable( {- * "columnDefs": [- * { "class": "my_class", "targets": [ 0 ] }- * ]- * } );- * } );- *- * @example- * // Using `columns`- * $(document).ready( function() {- * $('#example').dataTable( {- * "columns": [- * { "class": "my_class" },- * null,- * null,- * null,- * null- * ]- * } );- * } );- */- "sClass": "",-- /**- * When DataTables calculates the column widths to assign to each column,- * it finds the longest string in each column and then constructs a- * temporary table and reads the widths from that. The problem with this- * is that "mmm" is much wider then "iiii", but the latter is a longer- * string - thus the calculation can go wrong (doing it properly and putting- * it into an DOM object and measuring that is horribly(!) slow). Thus as- * a "work around" we provide this option. It will append its value to the- * text that is found to be the longest string for the column - i.e. padding.- * Generally you shouldn't need this!- * @type string- * @default <i>Empty string<i>- *- * @name DataTable.defaults.column.contentPadding- * @dtopt Columns- *- * @example- * // Using `columns`- * $(document).ready( function() {- * $('#example').dataTable( {- * "columns": [- * null,- * null,- * null,- * {- * "contentPadding": "mmm"- * }- * ]- * } );- * } );- */- "sContentPadding": "",--- /**- * Allows a default value to be given for a column's data, and will be used- * whenever a null data source is encountered (this can be because `data`- * is set to null, or because the data source itself is null).- * @type string- * @default null- *- * @name DataTable.defaults.column.defaultContent- * @dtopt Columns- *- * @example- * // Using `columnDefs`- * $(document).ready( function() {- * $('#example').dataTable( {- * "columnDefs": [- * {- * "data": null,- * "defaultContent": "Edit",- * "targets": [ -1 ]- * }- * ]- * } );- * } );- *- * @example- * // Using `columns`- * $(document).ready( function() {- * $('#example').dataTable( {- * "columns": [- * null,- * null,- * null,- * {- * "data": null,- * "defaultContent": "Edit"- * }- * ]- * } );- * } );- */- "sDefaultContent": null,--- /**- * This parameter is only used in DataTables' server-side processing. It can- * be exceptionally useful to know what columns are being displayed on the- * client side, and to map these to database fields. When defined, the names- * also allow DataTables to reorder information from the server if it comes- * back in an unexpected order (i.e. if you switch your columns around on the- * client-side, your server-side code does not also need updating).- * @type string- * @default <i>Empty string</i>- *- * @name DataTable.defaults.column.name- * @dtopt Columns- *- * @example- * // Using `columnDefs`- * $(document).ready( function() {- * $('#example').dataTable( {- * "columnDefs": [- * { "name": "engine", "targets": [ 0 ] },- * { "name": "browser", "targets": [ 1 ] },- * { "name": "platform", "targets": [ 2 ] },- * { "name": "version", "targets": [ 3 ] },- * { "name": "grade", "targets": [ 4 ] }- * ]- * } );- * } );- *- * @example- * // Using `columns`- * $(document).ready( function() {- * $('#example').dataTable( {- * "columns": [- * { "name": "engine" },- * { "name": "browser" },- * { "name": "platform" },- * { "name": "version" },- * { "name": "grade" }- * ]- * } );- * } );- */- "sName": "",--- /**- * Defines a data source type for the sorting which can be used to read- * real-time information from the table (updating the internally cached- * version) prior to sorting. This allows sorting to occur on user editable- * elements such as form inputs.- * @type string- * @default std- *- * @name DataTable.defaults.column.sortDataType- * @dtopt Columns- *- * @example- * // Using `columnDefs`- * $(document).ready( function() {- * $('#example').dataTable( {- * "columnDefs": [- * { "sortDataType": "dom-text", "targets": [ 2, 3 ] },- * { "type": "numeric", "targets": [ 3 ] },- * { "sortDataType": "dom-select", "targets": [ 4 ] },- * { "sortDataType": "dom-checkbox", "targets": [ 5 ] }- * ]- * } );- * } );- *- * @example- * // Using `columns`- * $(document).ready( function() {- * $('#example').dataTable( {- * "columns": [- * null,- * null,- * { "sortDataType": "dom-text" },- * { "sortDataType": "dom-text", "type": "numeric" },- * { "sortDataType": "dom-select" },- * { "sortDataType": "dom-checkbox" }- * ]- * } );- * } );- */- "sSortDataType": "std",--- /**- * The title of this column.- * @type string- * @default null <i>Derived from the 'TH' value for this column in the- * original HTML table.</i>- *- * @name DataTable.defaults.column.title- * @dtopt Columns- *- * @example- * // Using `columnDefs`- * $(document).ready( function() {- * $('#example').dataTable( {- * "columnDefs": [- * { "title": "My column title", "targets": [ 0 ] }- * ]- * } );- * } );- *- * @example- * // Using `columns`- * $(document).ready( function() {- * $('#example').dataTable( {- * "columns": [- * { "title": "My column title" },- * null,- * null,- * null,- * null- * ]- * } );- * } );- */- "sTitle": null,--- /**- * The type allows you to specify how the data for this column will be sorted.- * Four types (string, numeric, date and html (which will strip HTML tags- * before sorting)) are currently available. Note that only date formats- * understood by Javascript's Date() object will be accepted as type date. For- * example: "Mar 26, 2008 5:03 PM". May take the values: 'string', 'numeric',- * 'date' or 'html' (by default). Further types can be adding through- * plug-ins.- * @type string- * @default null <i>Auto-detected from raw data</i>- *- * @name DataTable.defaults.column.type- * @dtopt Columns- *- * @example- * // Using `columnDefs`- * $(document).ready( function() {- * $('#example').dataTable( {- * "columnDefs": [- * { "type": "html", "targets": [ 0 ] }- * ]- * } );- * } );- *- * @example- * // Using `columns`- * $(document).ready( function() {- * $('#example').dataTable( {- * "columns": [- * { "type": "html" },- * null,- * null,- * null,- * null- * ]- * } );- * } );- */- "sType": null,--- /**- * Defining the width of the column, this parameter may take any CSS value- * (3em, 20px etc). DataTables apples 'smart' widths to columns which have not- * been given a specific width through this interface ensuring that the table- * remains readable.- * @type string- * @default null <i>Automatic</i>- *- * @name DataTable.defaults.column.width- * @dtopt Columns- *- * @example- * // Using `columnDefs`- * $(document).ready( function() {- * $('#example').dataTable( {- * "columnDefs": [- * { "width": "20%", "targets": [ 0 ] }- * ]- * } );- * } );- *- * @example- * // Using `columns`- * $(document).ready( function() {- * $('#example').dataTable( {- * "columns": [- * { "width": "20%" },- * null,- * null,- * null,- * null- * ]- * } );- * } );- */- "sWidth": null- };-- _fnHungarianMap( DataTable.defaults.column );---- /**- * DataTables settings object - this holds all the information needed for a- * given table, including configuration, data and current application of the- * table options. DataTables does not have a single instance for each DataTable- * with the settings attached to that instance, but rather instances of the- * DataTable "class" are created on-the-fly as needed (typically by a- * $().dataTable() call) and the settings object is then applied to that- * instance.- *- * Note that this object is related to {@link DataTable.defaults} but this- * one is the internal data store for DataTables's cache of columns. It should- * NOT be manipulated outside of DataTables. Any configuration should be done- * through the initialisation options.- * @namespace- * @todo Really should attach the settings object to individual instances so we- * don't need to create new instances on each $().dataTable() call (if the- * table already exists). It would also save passing oSettings around and- * into every single function. However, this is a very significant- * architecture change for DataTables and will almost certainly break- * backwards compatibility with older installations. This is something that- * will be done in 2.0.- */- DataTable.models.oSettings = {- /**- * Primary features of DataTables and their enablement state.- * @namespace- */- "oFeatures": {-- /**- * Flag to say if DataTables should automatically try to calculate the- * optimum table and columns widths (true) or not (false).- * Note that this parameter will be set by the initialisation routine. To- * set a default use {@link DataTable.defaults}.- * @type boolean- */- "bAutoWidth": null,-- /**- * Delay the creation of TR and TD elements until they are actually- * needed by a driven page draw. This can give a significant speed- * increase for Ajax source and Javascript source data, but makes no- * difference at all fro DOM and server-side processing tables.- * Note that this parameter will be set by the initialisation routine. To- * set a default use {@link DataTable.defaults}.- * @type boolean- */- "bDeferRender": null,-- /**- * Enable filtering on the table or not. Note that if this is disabled- * then there is no filtering at all on the table, including fnFilter.- * To just remove the filtering input use sDom and remove the 'f' option.- * Note that this parameter will be set by the initialisation routine. To- * set a default use {@link DataTable.defaults}.- * @type boolean- */- "bFilter": null,-- /**- * Table information element (the 'Showing x of y records' div) enable- * flag.- * Note that this parameter will be set by the initialisation routine. To- * set a default use {@link DataTable.defaults}.- * @type boolean- */- "bInfo": null,-- /**- * Present a user control allowing the end user to change the page size- * when pagination is enabled.- * Note that this parameter will be set by the initialisation routine. To- * set a default use {@link DataTable.defaults}.- * @type boolean- */- "bLengthChange": null,-- /**- * Pagination enabled or not. Note that if this is disabled then length- * changing must also be disabled.- * Note that this parameter will be set by the initialisation routine. To- * set a default use {@link DataTable.defaults}.- * @type boolean- */- "bPaginate": null,-- /**- * Processing indicator enable flag whenever DataTables is enacting a- * user request - typically an Ajax request for server-side processing.- * Note that this parameter will be set by the initialisation routine. To- * set a default use {@link DataTable.defaults}.- * @type boolean- */- "bProcessing": null,-- /**- * Server-side processing enabled flag - when enabled DataTables will- * get all data from the server for every draw - there is no filtering,- * sorting or paging done on the client-side.- * Note that this parameter will be set by the initialisation routine. To- * set a default use {@link DataTable.defaults}.- * @type boolean- */- "bServerSide": null,-- /**- * Sorting enablement flag.- * Note that this parameter will be set by the initialisation routine. To- * set a default use {@link DataTable.defaults}.- * @type boolean- */- "bSort": null,-- /**- * Apply a class to the columns which are being sorted to provide a- * visual highlight or not. This can slow things down when enabled since- * there is a lot of DOM interaction.- * Note that this parameter will be set by the initialisation routine. To- * set a default use {@link DataTable.defaults}.- * @type boolean- */- "bSortClasses": null,-- /**- * State saving enablement flag.- * Note that this parameter will be set by the initialisation routine. To- * set a default use {@link DataTable.defaults}.- * @type boolean- */- "bStateSave": null- },--- /**- * Scrolling settings for a table.- * @namespace- */- "oScroll": {- /**- * Indicate if DataTables should be allowed to set the padding / margin- * etc for the scrolling header elements or not. Typically you will want- * this.- * Note that this parameter will be set by the initialisation routine. To- * set a default use {@link DataTable.defaults}.- * @type boolean- */- "bAutoCss": null,-- /**- * When the table is shorter in height than sScrollY, collapse the- * table container down to the height of the table (when true).- * Note that this parameter will be set by the initialisation routine. To- * set a default use {@link DataTable.defaults}.- * @type boolean- */- "bCollapse": null,-- /**- * Infinite scrolling enablement flag. Now deprecated in favour of- * using the Scroller plug-in.- * Note that this parameter will be set by the initialisation routine. To- * set a default use {@link DataTable.defaults}.- * @type boolean- */- "bInfinite": null,-- /**- * Width of the scrollbar for the web-browser's platform. Calculated- * during table initialisation.- * @type int- * @default 0- */- "iBarWidth": 0,-- /**- * Space (in pixels) between the bottom of the scrolling container and- * the bottom of the scrolling viewport before the next page is loaded- * when using infinite scrolling.- * Note that this parameter will be set by the initialisation routine. To- * set a default use {@link DataTable.defaults}.- * @type int- */- "iLoadGap": null,-- /**- * Viewport width for horizontal scrolling. Horizontal scrolling is- * disabled if an empty string.- * Note that this parameter will be set by the initialisation routine. To- * set a default use {@link DataTable.defaults}.- * @type string- */- "sX": null,-- /**- * Width to expand the table to when using x-scrolling. Typically you- * should not need to use this.- * Note that this parameter will be set by the initialisation routine. To- * set a default use {@link DataTable.defaults}.- * @type string- * @deprecated- */- "sXInner": null,-- /**- * Viewport height for vertical scrolling. Vertical scrolling is disabled- * if an empty string.- * Note that this parameter will be set by the initialisation routine. To- * set a default use {@link DataTable.defaults}.- * @type string- */- "sY": null- },-- /**- * Language information for the table.- * @namespace- * @extends DataTable.defaults.oLanguage- */- "oLanguage": {- /**- * Information callback function. See- * {@link DataTable.defaults.fnInfoCallback}- * @type function- * @default null- */- "fnInfoCallback": null- },-- /**- * Browser support parameters- * @namespace- */- "oBrowser": {- /**- * Indicate if the browser incorrectly calculates width:100% inside a- * scrolling element (IE6/7)- * @type boolean- * @default false- */- "bScrollOversize": false- },-- /**- * Array referencing the nodes which are used for the features. The- * parameters of this object match what is allowed by sDom - i.e.- * <ul>- * <li>'l' - Length changing</li>- * <li>'f' - Filtering input</li>- * <li>'t' - The table!</li>- * <li>'i' - Information</li>- * <li>'p' - Pagination</li>- * <li>'r' - pRocessing</li>- * </ul>- * @type array- * @default []- */- "aanFeatures": [],-- /**- * Store data information - see {@link DataTable.models.oRow} for detailed- * information.- * @type array- * @default []- */- "aoData": [],-- /**- * Array of indexes which are in the current display (after filtering etc)- * @type array- * @default []- */- "aiDisplay": [],-- /**- * Array of indexes for display - no filtering- * @type array- * @default []- */- "aiDisplayMaster": [],-- /**- * Store information about each column that is in use- * @type array- * @default []- */- "aoColumns": [],-- /**- * Store information about the table's header- * @type array- * @default []- */- "aoHeader": [],-- /**- * Store information about the table's footer- * @type array- * @default []- */- "aoFooter": [],-- /**- * Search data array for regular expression searching- * @type array- * @default []- */- "asDataSearch": [],-- /**- * Store the applied global search information in case we want to force a- * research or compare the old search to a new one.- * Note that this parameter will be set by the initialisation routine. To- * set a default use {@link DataTable.defaults}.- * @namespace- * @extends DataTable.models.oSearch- */- "oPreviousSearch": {},-- /**- * Store the applied search for each column - see- * {@link DataTable.models.oSearch} for the format that is used for the- * filtering information for each column.- * @type array- * @default []- */- "aoPreSearchCols": [],-- /**- * Sorting that is applied to the table. Note that the inner arrays are- * used in the following manner:- * <ul>- * <li>Index 0 - column number</li>- * <li>Index 1 - current sorting direction</li>- * <li>Index 2 - index of asSorting for this column</li>- * </ul>- * Note that this parameter will be set by the initialisation routine. To- * set a default use {@link DataTable.defaults}.- * @type array- * @todo These inner arrays should really be objects- */- "aaSorting": null,-- /**- * Sorting that is always applied to the table (i.e. prefixed in front of- * aaSorting).- * Note that this parameter will be set by the initialisation routine. To- * set a default use {@link DataTable.defaults}.- * @type array|null- * @default null- */- "aaSortingFixed": null,-- /**- * Classes to use for the striping of a table.- * Note that this parameter will be set by the initialisation routine. To- * set a default use {@link DataTable.defaults}.- * @type array- * @default []- */- "asStripeClasses": null,-- /**- * If restoring a table - we should restore its striping classes as well- * @type array- * @default []- */- "asDestroyStripes": [],-- /**- * If restoring a table - we should restore its width- * @type int- * @default 0- */- "sDestroyWidth": 0,-- /**- * Callback functions array for every time a row is inserted (i.e. on a draw).- * @type array- * @default []- */- "aoRowCallback": [],-- /**- * Callback functions for the header on each draw.- * @type array- * @default []- */- "aoHeaderCallback": [],-- /**- * Callback function for the footer on each draw.- * @type array- * @default []- */- "aoFooterCallback": [],-- /**- * Array of callback functions for draw callback functions- * @type array- * @default []- */- "aoDrawCallback": [],-- /**- * Array of callback functions for row created function- * @type array- * @default []- */- "aoRowCreatedCallback": [],-- /**- * Callback functions for just before the table is redrawn. A return of- * false will be used to cancel the draw.- * @type array- * @default []- */- "aoPreDrawCallback": [],-- /**- * Callback functions for when the table has been initialised.- * @type array- * @default []- */- "aoInitComplete": [],--- /**- * Callbacks for modifying the settings to be stored for state saving, prior to- * saving state.- * @type array- * @default []- */- "aoStateSaveParams": [],-- /**- * Callbacks for modifying the settings that have been stored for state saving- * prior to using the stored values to restore the state.- * @type array- * @default []- */- "aoStateLoadParams": [],-- /**- * Callbacks for operating on the settings object once the saved state has been- * loaded- * @type array- * @default []- */- "aoStateLoaded": [],-- /**- * Cache the table ID for quick access- * @type string- * @default <i>Empty string</i>- */- "sTableId": "",-- /**- * The TABLE node for the main table- * @type node- * @default null- */- "nTable": null,-- /**- * Permanent ref to the thead element- * @type node- * @default null- */- "nTHead": null,-- /**- * Permanent ref to the tfoot element - if it exists- * @type node- * @default null- */- "nTFoot": null,-- /**- * Permanent ref to the tbody element- * @type node- * @default null- */- "nTBody": null,-- /**- * Cache the wrapper node (contains all DataTables controlled elements)- * @type node- * @default null- */- "nTableWrapper": null,-- /**- * Indicate if when using server-side processing the loading of data- * should be deferred until the second draw.- * Note that this parameter will be set by the initialisation routine. To- * set a default use {@link DataTable.defaults}.- * @type boolean- * @default false- */- "bDeferLoading": false,-- /**- * Indicate if all required information has been read in- * @type boolean- * @default false- */- "bInitialised": false,-- /**- * Information about open rows. Each object in the array has the parameters- * 'nTr' and 'nParent'- * @type array- * @default []- */- "aoOpenRows": [],-- /**- * Dictate the positioning of DataTables' control elements - see- * {@link DataTable.model.oInit.sDom}.- * Note that this parameter will be set by the initialisation routine. To- * set a default use {@link DataTable.defaults}.- * @type string- * @default null- */- "sDom": null,-- /**- * Which type of pagination should be used.- * Note that this parameter will be set by the initialisation routine. To- * set a default use {@link DataTable.defaults}.- * @type string- * @default two_button- */- "sPaginationType": "two_button",-- /**- * The cookie duration (for bStateSave) in seconds.- * Note that this parameter will be set by the initialisation routine. To- * set a default use {@link DataTable.defaults}.- * @type int- * @default 0- */- "iCookieDuration": 0,-- /**- * The cookie name prefix.- * Note that this parameter will be set by the initialisation routine. To- * set a default use {@link DataTable.defaults}.- * @type string- * @default <i>Empty string</i>- */- "sCookiePrefix": "",-- /**- * Callback function for cookie creation.- * Note that this parameter will be set by the initialisation routine. To- * set a default use {@link DataTable.defaults}.- * @type function- * @default null- */- "fnCookieCallback": null,-- /**- * Array of callback functions for state saving. Each array element is an- * object with the following parameters:- * <ul>- * <li>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]')</li>- * <li>string:sName - name of callback</li>- * </ul>- * @type array- * @default []- */- "aoStateSave": [],-- /**- * Array of callback functions for state loading. Each array element is an- * object with the following parameters:- * <ul>- * <li>function:fn - function to call. Takes two parameters, oSettings- * and the object stored. May return false to cancel state loading</li>- * <li>string:sName - name of callback</li>- * </ul>- * @type array- * @default []- */- "aoStateLoad": [],-- /**- * State that was loaded from the cookie. Useful for back reference- * @type object- * @default null- */- "oLoadedState": null,-- /**- * Source url for AJAX data for the table.- * Note that this parameter will be set by the initialisation routine. To- * set a default use {@link DataTable.defaults}.- * @type string- * @default null- */- "sAjaxSource": null,-- /**- * 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.- * Note that this parameter will be set by the initialisation routine. To- * set a default use {@link DataTable.defaults}.- * @type string- */- "sAjaxDataProp": null,-- /**- * Note if draw should be blocked while getting data- * @type boolean- * @default true- */- "bAjaxDataGet": true,-- /**- * 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- * @type object- * @default null- */- "jqXHR": null,-- /**- * Function to get the server-side data.- * Note that this parameter will be set by the initialisation routine. To- * set a default use {@link DataTable.defaults}.- * @type function- */- "fnServerData": null,-- /**- * Functions which are called prior to sending an Ajax request so extra- * parameters can easily be sent to the server- * @type array- * @default []- */- "aoServerParams": [],-- /**- * Send the XHR HTTP method - GET or POST (could be PUT or DELETE if- * required).- * Note that this parameter will be set by the initialisation routine. To- * set a default use {@link DataTable.defaults}.- * @type string- */- "sServerMethod": null,-- /**- * Format numbers for display.- * Note that this parameter will be set by the initialisation routine. To- * set a default use {@link DataTable.defaults}.- * @type function- */- "fnFormatNumber": null,-- /**- * List of options that can be used for the user selectable length menu.- * Note that this parameter will be set by the initialisation routine. To- * set a default use {@link DataTable.defaults}.- * @type array- * @default []- */- "aLengthMenu": null,-- /**- * Counter for the draws that the table does. Also used as a tracker for- * server-side processing- * @type int- * @default 0- */- "iDraw": 0,-- /**- * Indicate if a redraw is being done - useful for Ajax- * @type boolean- * @default false- */- "bDrawing": false,-- /**- * Draw index (iDraw) of the last error when parsing the returned data- * @type int- * @default -1- */- "iDrawError": -1,-- /**- * Paging display length- * @type int- * @default 10- */- "_iDisplayLength": 10,-- /**- * Paging start point - aiDisplay index- * @type int- * @default 0- */- "_iDisplayStart": 0,-- /**- * Paging end point - aiDisplay index. Use fnDisplayEnd rather than- * this property to get the end point- * @type int- * @default 10- * @private- */- "_iDisplayEnd": 10,-- /**- * Server-side processing - number of records in the result set- * (i.e. before filtering), Use fnRecordsTotal rather than- * this property to get the value of the number of records, regardless of- * the server-side processing setting.- * @type int- * @default 0- * @private- */- "_iRecordsTotal": 0,-- /**- * Server-side processing - number of records in the current display set- * (i.e. after filtering). Use fnRecordsDisplay rather than- * this property to get the value of the number of records, regardless of- * the server-side processing setting.- * @type boolean- * @default 0- * @private- */- "_iRecordsDisplay": 0,-- /**- * Flag to indicate if jQuery UI marking and classes should be used.- * Note that this parameter will be set by the initialisation routine. To- * set a default use {@link DataTable.defaults}.- * @type boolean- */- "bJUI": null,-- /**- * The classes to use for the table- * @type object- * @default {}- */- "oClasses": {},-- /**- * Flag attached to the settings object so you can check in the draw- * callback if filtering has been done in the draw. Deprecated in favour of- * events.- * @type boolean- * @default false- * @deprecated- */- "bFiltered": false,-- /**- * Flag attached to the settings object so you can check in the draw- * callback if sorting has been done in the draw. Deprecated in favour of- * events.- * @type boolean- * @default false- * @deprecated- */- "bSorted": false,-- /**- * 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.- * Note that this parameter will be set by the initialisation routine. To- * set a default use {@link DataTable.defaults}.- * @type boolean- */- "bSortCellsTop": null,-- /**- * Initialisation object that is used for the table- * @type object- * @default null- */- "oInit": null,-- /**- * Destroy callback functions - for plug-ins to attach themselves to the- * destroy so they can clean up markup and events.- * @type array- * @default []- */- "aoDestroyCallback": [],--- /**- * Get the number of records in the current record set, before filtering- * @type function- */- "fnRecordsTotal": function ()- {- if ( this.oFeatures.bServerSide ) {- return parseInt(this._iRecordsTotal, 10);- } else {- return this.aiDisplayMaster.length;- }- },-- /**- * Get the number of records in the current record set, after filtering- * @type function- */- "fnRecordsDisplay": function ()- {- if ( this.oFeatures.bServerSide ) {- return parseInt(this._iRecordsDisplay, 10);- } else {- return this.aiDisplay.length;- }- },-- /**- * Set the display end point - aiDisplay index- * @type function- * @todo Should do away with _iDisplayEnd and calculate it on-the-fly here- */- "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;- }- },-- /**- * The DataTables object for this table- * @type object- * @default null- */- "oInstance": null,-- /**- * Unique identifier for each instance of the DataTables object. If there- * is an ID on the table node, then it takes that value, otherwise an- * incrementing internal counter is used.- * @type string- * @default null- */- "sInstance": null,-- /**- * tabindex attribute value that is added to DataTables control elements, allowing- * keyboard navigation of the table and its controls.- */- "iTabIndex": 0,-- /**- * DIV container for the footer scrolling table if scrolling- */- "nScrollHead": null,-- /**- * DIV container for the footer scrolling table if scrolling- */- "nScrollFoot": null- };-- /**- * Extension object for DataTables that is used to provide all extension options.- *- * Note that the <i>DataTable.ext</i> object is available through- * <i>jQuery.fn.dataTable.ext</i> where it may be accessed and manipulated. It is- * also aliased to <i>jQuery.fn.dataTableExt</i> for historic reasons.- * @namespace- * @extends DataTable.models.ext- */- DataTable.ext = $.extend( true, {}, DataTable.models.ext );-- $.extend( DataTable.ext.oStdClasses, {- "sTable": "dataTable",-- /* 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",-- /* Striping classes */- "sStripeOdd": "odd",- "sStripeEven": "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": "",- "sJUIHeader": "",- "sJUIFooter": ""- } );--- $.extend( DataTable.ext.oJUIClasses, DataTable.ext.oStdClasses, {- /* 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",- "sPageLast": "last ui-corner-tr ui-corner-br",-- /* Features */- "sPaging": "dataTables_paginate fg-buttonset ui-buttonset fg-buttonset-multi "+- "ui-buttonset-multi paging_", /* Note that the type is postfixed */-- /* 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",- "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 */- "sScrollHead": "dataTables_scrollHead ui-state-default",- "sScrollFoot": "dataTables_scrollFoot ui-state-default",-- /* Misc */- "sFooterTH": "ui-state-default",- "sJUIHeader": "fg-toolbar ui-toolbar ui-widget-header ui-corner-tl ui-corner-tr ui-helper-clearfix",- "sJUIFooter": "fg-toolbar ui-toolbar ui-widget-header ui-corner-bl ui-corner-br ui-helper-clearfix"- } );-- /*- * Variable: oPagination- * Purpose:- * Scope: jQuery.fn.dataTableExt- */- $.extend( DataTable.ext.oPagination, {- /*- * Variable: two_button- * Purpose: Standard two button (forward/back) pagination- * Scope: jQuery.fn.dataTableExt.oPagination- */- "two_button": {- /*- * Function: oPagination.two_button.fnInit- * Purpose: Initialise 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 oLang = oSettings.oLanguage.oPaginate;- var oClasses = oSettings.oClasses;- var fnClickHandler = function ( e ) {- if ( oSettings.oApi._fnPageChange( oSettings, e.data.action ) )- {- fnCallbackDraw( oSettings );- }- };-- var sAppend = (!oSettings.bJUI) ?- '<a class="'+oSettings.oClasses.sPagePrevDisabled+'" tabindex="'+oSettings.iTabIndex+'" role="button">'+oLang.sPrevious+'</a>'+- '<a class="'+oSettings.oClasses.sPageNextDisabled+'" tabindex="'+oSettings.iTabIndex+'" role="button">'+oLang.sNext+'</a>'- :- '<a class="'+oSettings.oClasses.sPagePrevDisabled+'" tabindex="'+oSettings.iTabIndex+'" role="button"><span class="'+oSettings.oClasses.sPageJUIPrev+'"></span></a>'+- '<a class="'+oSettings.oClasses.sPageNextDisabled+'" tabindex="'+oSettings.iTabIndex+'" role="button"><span class="'+oSettings.oClasses.sPageJUINext+'"></span></a>';- $(nPaging).append( sAppend );-- var els = $('a', nPaging);- var nPrevious = els[0],- nNext = els[1];-- oSettings.oApi._fnBindAction( nPrevious, {action: "previous"}, fnClickHandler );- oSettings.oApi._fnBindAction( nNext, {action: "next"}, fnClickHandler );-- /* ID the first elements only */- if ( !oSettings.aanFeatures.p )- {- nPaging.id = oSettings.sTableId+'_paginate';- nPrevious.id = oSettings.sTableId+'_previous';- nNext.id = oSettings.sTableId+'_next';-- nPrevious.setAttribute('aria-controls', oSettings.sTableId);- nNext.setAttribute('aria-controls', oSettings.sTableId);- }- },-- /*- * 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;- }-- var oClasses = oSettings.oClasses;- var an = oSettings.aanFeatures.p;- var nNode;-- /* Loop over each instance of the pager */- for ( var i=0, iLen=an.length ; i<iLen ; i++ )- {- nNode = an[i].firstChild;- if ( nNode )- {- /* Previous page */- nNode.className = ( oSettings._iDisplayStart === 0 ) ?- oClasses.sPagePrevDisabled : oClasses.sPagePrevEnabled;-- /* Next page */- nNode = nNode.nextSibling;- nNode.className = ( oSettings.fnDisplayEnd() == oSettings.fnRecordsDisplay() ) ?- oClasses.sPageNextDisabled : 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: Initialise 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 oLang = oSettings.oLanguage.oPaginate;- var oClasses = oSettings.oClasses;- var fnClickHandler = function ( e ) {- if ( oSettings.oApi._fnPageChange( oSettings, e.data.action ) )- {- fnCallbackDraw( oSettings );- }- };-- $(nPaging).append(- '<a tabindex="'+oSettings.iTabIndex+'" class="'+oClasses.sPageButton+" "+oClasses.sPageFirst+'">'+oLang.sFirst+'</a>'+- '<a tabindex="'+oSettings.iTabIndex+'" class="'+oClasses.sPageButton+" "+oClasses.sPagePrevious+'">'+oLang.sPrevious+'</a>'+- '<span></span>'+- '<a tabindex="'+oSettings.iTabIndex+'" class="'+oClasses.sPageButton+" "+oClasses.sPageNext+'">'+oLang.sNext+'</a>'+- '<a tabindex="'+oSettings.iTabIndex+'" class="'+oClasses.sPageButton+" "+oClasses.sPageLast+'">'+oLang.sLast+'</a>'- );- var els = $('a', nPaging);- var nFirst = els[0],- nPrev = els[1],- nNext = els[2],- nLast = els[3];-- oSettings.oApi._fnBindAction( nFirst, {action: "first"}, fnClickHandler );- oSettings.oApi._fnBindAction( nPrev, {action: "previous"}, fnClickHandler );- oSettings.oApi._fnBindAction( nNext, {action: "next"}, fnClickHandler );- oSettings.oApi._fnBindAction( nLast, {action: "last"}, fnClickHandler );-- /* ID the first elements only */- if ( !oSettings.aanFeatures.p )- {- nPaging.id = oSettings.sTableId+'_paginate';- nFirst.id =oSettings.sTableId+'_first';- nPrev.id =oSettings.sTableId+'_previous';- nNext.id =oSettings.sTableId+'_next';- nLast.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 = DataTable.ext.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;- var anButtons, anStatic, nPaginateList, nNode;- var an = oSettings.aanFeatures.p;- var fnBind = function (j) {- oSettings.oApi._fnBindAction( this, {"page": j+iStartButton-1}, function(e) {- /* Use the information in the element to jump to the required page */- oSettings.oApi._fnPageChange( oSettings, e.data.page );- fnCallbackDraw( oSettings );- e.preventDefault();- } );- };-- /* Pages calculation */- if ( oSettings._iDisplayLength === -1 )- {- iStartButton = 1;- iEndButton = 1;- iCurrentPage = 1;- }- else 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++ )- {- sList += (iCurrentPage !== i) ?- '<a tabindex="'+oSettings.iTabIndex+'" class="'+oClasses.sPageButton+'">'+oSettings.fnFormatNumber(i)+'</a>' :- '<a tabindex="'+oSettings.iTabIndex+'" class="'+oClasses.sPageButtonActive+'">'+oSettings.fnFormatNumber(i)+'</a>';- }-- /* Loop over each instance of the pager */- for ( i=0, iLen=an.length ; i<iLen ; i++ )- {- nNode = an[i];- if ( !nNode.hasChildNodes() )- {- continue;- }-- /* Build up the dynamic list first - html and listeners */- $('span:eq(0)', nNode)- .html( sList )- .children('a').each( fnBind );-- /* Update the permanent button's classes */- anButtons = nNode.getElementsByTagName('a');- anStatic = [- anButtons[0], anButtons[1],- anButtons[anButtons.length-2], anButtons[anButtons.length-1]- ];-- $(anStatic).removeClass( oClasses.sPageButton+" "+oClasses.sPageButtonActive+" "+oClasses.sPageButtonStaticDisabled );- $([anStatic[0], anStatic[1]]).addClass(- (iCurrentPage==1) ?- oClasses.sPageButtonStaticDisabled :- oClasses.sPageButton- );- $([anStatic[2], anStatic[3]]).addClass(- (iPages===0 || iCurrentPage===iPages || oSettings._iDisplayLength===-1) ?- oClasses.sPageButtonStaticDisabled :- oClasses.sPageButton- );- }- }- }- } );- $.extend( DataTable.ext.oSort, {- /*- * text sorting- */- "string-pre": function ( a )- {- if ( typeof a != 'string' )- {- if (a === null || a === undefined || !a.toString)- {- return '';- }- a = a.toString();- }- return a.toLowerCase();- },-- // string-asc and -desc are retained only for compatibility with- "string-asc": function ( x, y )- {- return ((x < y) ? -1 : ((x > y) ? 1 : 0));- },-- "string-desc": function ( x, y )- {- return ((x < y) ? 1 : ((x > y) ? -1 : 0));- },--- /*- * html sorting (ignore html tags)- */- "html-pre": function ( a )- {- return a.replace( /<.*?>/g, "" ).toLowerCase();- },--- /*- * date sorting- */- "date-pre": function ( a )- {- var x = Date.parse( a );-- if ( isNaN(x) || x==="" )- {- x = Date.parse( "01/01/1970 00:00:00" );- }- return x;- },--- /*- * numerical sorting- */- "numeric-pre": function ( a )- {- return (a=="-" || a==="") ? 0 : a*1;- }- } );--- $.extend( DataTable.ext.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;- }- ] );--- // jQuery aliases- $.fn.DataTable = DataTable;- $.fn.dataTable = DataTable;- $.fn.dataTableSettings = DataTable.settings;- $.fn.dataTableExt = DataTable.ext;--- // Information about events fired by DataTables - for documentation.- /**- * Draw event, fired whenever the table is redrawn on the page, at the same point as- * fnDrawCallback. This may be useful for binding events or performing calculations when- * the table is altered at all.- * @name DataTable#draw- * @event- * @param {event} e jQuery event object- * @param {object} o DataTables settings object {@link DataTable.models.oSettings}- */-- /**- * Filter event, fired when the filtering applied to the table (using the build in global- * global filter, or column filters) is altered.- * @name DataTable#filter- * @event- * @param {event} e jQuery event object- * @param {object} o DataTables settings object {@link DataTable.models.oSettings}- */-- /**- * Page change event, fired when the paging of the table is altered.- * @name DataTable#page- * @event- * @param {event} e jQuery event object- * @param {object} o DataTables settings object {@link DataTable.models.oSettings}- */-- /**- * Sort event, fired when the sorting applied to the table is altered.- * @name DataTable#sort- * @event- * @param {event} e jQuery event object- * @param {object} o DataTables settings object {@link DataTable.models.oSettings}- */-- /**- * DataTables initialisation complete event, fired when the table is fully drawn,- * including Ajax data loaded, if Ajax data is required.- * @name DataTable#init- * @event- * @param {event} e jQuery event object- * @param {object} oSettings DataTables settings object- * @param {object} json The JSON object request from the server - only- * present if client-side Ajax sourced data is used</li></ol>- */-- /**- * State save event, fired when the table has changed state a new state save is required.- * This method allows modification of the state saving object prior to actually doing the- * save, including addition or other state properties (for plug-ins) or modification- * of a DataTables core property.- * @name DataTable#stateSaveParams- * @event- * @param {event} e jQuery event object- * @param {object} oSettings DataTables settings object- * @param {object} json The state information to be saved- */-- /**- * State load event, fired when the table is loading state from the stored data, but- * prior to the settings object being modified by the saved state - allowing modification- * of the saved state is required or loading of state for a plug-in.- * @name DataTable#stateLoadParams- * @event- * @param {event} e jQuery event object- * @param {object} oSettings DataTables settings object- * @param {object} json The saved state information- */-- /**- * State loaded event, fired when state has been loaded from stored data and the settings- * object has been modified by the loaded data.- * @name DataTable#stateLoaded- * @event- * @param {event} e jQuery event object- * @param {object} oSettings DataTables settings object- * @param {object} json The saved state information- */-- /**- * Processing event, fired when DataTables is doing some kind of processing (be it,- * sort, filter or anything else). Can be used to indicate to the end user that- * there is something happening, or that something has finished.- * @name DataTable#processing- * @event- * @param {event} e jQuery event object- * @param {object} oSettings DataTables settings object- * @param {boolean} bShow Flag for if DataTables is doing processing or not- */-- /**- * Ajax (XHR) event, fired whenever an Ajax request is completed from a request to- * made to the server for new data (note that this trigger is called in fnServerData,- * if you override fnServerData and which to use this event, you need to trigger it in- * you success function).- * @name DataTable#xhr- * @event- * @param {event} e jQuery event object- * @param {object} o DataTables settings object {@link DataTable.models.oSettings}- * @param {object} json JSON returned from the server- */-- /**- * Destroy event, fired when the DataTable is destroyed by calling fnDestroy or passing- * the bDestroy:true parameter in the initialisation object. This can be used to remove- * bound events, added DOM nodes, etc.- * @name DataTable#destroy- * @event- * @param {event} e jQuery event object- * @param {object} o DataTables settings object {@link DataTable.models.oSettings}- */-}));--}(window, document));-diff --git a/data/libs/datatables/jquery.dataTables_themeroller.css b/data/libs/datatables/jquery.dataTables_themeroller.cssdeleted file mode 100644index cf1d4ed79..000000000--- a/data/libs/datatables/jquery.dataTables_themeroller.css+++ /dev/null@@ -1,244 +0,0 @@---/*- * Table- */-table.dataTable {- margin: 0 auto;- clear: both;- width: 100%;- border-collapse: collapse;-}--table.dataTable thead th {- padding: 3px 0px 3px 10px;- cursor: pointer;- *cursor: hand;-}--table.dataTable tfoot th {- padding: 3px 10px;-}--table.dataTable td {- padding: 3px 10px;-}--table.dataTable td.center,-table.dataTable td.dataTables_empty {- text-align: center;-}--table.dataTable tr.odd { background-color: #E2E4FF; }-table.dataTable tr.even { background-color: white; }--table.dataTable tr.odd td.sorting_1 { background-color: #D3D6FF; }-table.dataTable tr.odd td.sorting_2 { background-color: #DADCFF; }-table.dataTable tr.odd td.sorting_3 { background-color: #E0E2FF; }-table.dataTable tr.even td.sorting_1 { background-color: #EAEBFF; }-table.dataTable tr.even td.sorting_2 { background-color: #F2F3FF; }-table.dataTable tr.even td.sorting_3 { background-color: #F9F9FF; }---/*- * Table wrapper- */-.dataTables_wrapper {- position: relative;- clear: both;- *zoom: 1;-}-.dataTables_wrapper .ui-widget-header {- font-weight: normal;-}-.dataTables_wrapper .ui-toolbar {- padding: 5px;-}---/*- * Page length menu- */-.dataTables_length {- float: left;-}---/*- * Filter- */-.dataTables_filter {- float: right;- text-align: right;-}---/*- * Table information- */-.dataTables_info {- padding-top: 3px;- clear: both;- float: left;-}---/*- * Pagination- */-.dataTables_paginate {- float: right;- text-align: right;-}--.dataTables_paginate .ui-button {- margin-right: -0.1em !important;-}--.paging_two_button .ui-button {- float: left;- cursor: pointer;- * cursor: hand;-}--.paging_full_numbers .ui-button {- padding: 2px 6px;- margin: 0;- cursor: pointer;- * cursor: hand;- color: #333 !important;-}--/* Two button pagination - previous / next */-.paginate_disabled_previous,-.paginate_enabled_previous,-.paginate_disabled_next,-.paginate_enabled_next {- height: 19px;- float: left;- cursor: pointer;- *cursor: hand;- color: #111 !important;-}-.paginate_disabled_previous:hover,-.paginate_enabled_previous:hover,-.paginate_disabled_next:hover,-.paginate_enabled_next:hover {- text-decoration: none !important;-}-.paginate_disabled_previous:active,-.paginate_enabled_previous:active,-.paginate_disabled_next:active,-.paginate_enabled_next:active {- outline: none;-}--.paginate_disabled_previous,-.paginate_disabled_next {- color: #666 !important;-}-.paginate_disabled_previous,-.paginate_enabled_previous {- padding-left: 23px;-}-.paginate_disabled_next,-.paginate_enabled_next {- padding-right: 23px;- margin-left: 10px;-}--.paginate_enabled_previous { background: url('../images/back_enabled.png') no-repeat top left; }-.paginate_enabled_previous:hover { background: url('../images/back_enabled_hover.png') no-repeat top left; }-.paginate_disabled_previous { background: url('../images/back_disabled.png') no-repeat top left; }--.paginate_enabled_next { background: url('../images/forward_enabled.png') no-repeat top right; }-.paginate_enabled_next:hover { background: url('../images/forward_enabled_hover.png') no-repeat top right; }-.paginate_disabled_next { background: url('../images/forward_disabled.png') no-repeat top right; }--/* Full number pagination */-.paging_full_numbers a:active {- outline: none-}-.paging_full_numbers a:hover {- text-decoration: none;-}--.paging_full_numbers a.paginate_button,-.paging_full_numbers a.paginate_active {- border: 1px solid #aaa;- -webkit-border-radius: 5px;- -moz-border-radius: 5px;- border-radius: 5px;- padding: 2px 5px;- margin: 0 3px;- cursor: pointer;- *cursor: hand;- color: #333 !important;-}--.paging_full_numbers a.paginate_button {- background-color: #ddd;-}--.paging_full_numbers a.paginate_button:hover {- background-color: #ccc;- text-decoration: none !important;-}--.paging_full_numbers a.paginate_active {- background-color: #99B3FF;-}---/*- * Processing indicator- */-.dataTables_processing {- position: absolute;- top: 50%;- left: 50%;- width: 250px;- height: 30px;- margin-left: -125px;- margin-top: -15px;- padding: 14px 0 2px 0;- border: 1px solid #ddd;- text-align: center;- color: #999;- font-size: 14px;- background-color: white;-}---/*- * Sorting- */-table.dataTable thead th div.DataTables_sort_wrapper {- position: relative;- padding-right: 20px;-}--table.dataTable thead th div.DataTables_sort_wrapper span {- position: absolute;- top: 50%;- margin-top: -8px;- right: 0;-}--table.dataTable th:active {- outline: none;-}---/*- * Scrolling- */-.dataTables_scroll {- clear: both;-}--.dataTables_scrollBody {- *margin-top: -1px;- -webkit-overflow-scrolling: touch;-}-diff --git a/data/libs/datatables/js/jquery.dataTables.min.js b/data/libs/datatables/js/jquery.dataTables.min.jsnew file mode 100644index 000000000..02694a4a5--- /dev/null+++ b/data/libs/datatables/js/jquery.dataTables.min.js@@ -0,0 +1,155 @@+/*+ * File: jquery.dataTables.min.js+ * Version: 1.9.4+ * Author: Allan Jardine (www.sprymedia.co.uk)+ * Info: www.datatables.net+ *+ * Copyright 2008-2012 Allan Jardine, all rights reserved.+ *+ * This source file is free software, under either the GPL v2 license or a+ * BSD style license, available at:+ * http://datatables.net/license_gpl2+ * http://datatables.net/license_bsd+ *+ * 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.+ */+(function(X,l,n){var L=function(h){var j=function(e){function o(a,b){var c=j.defaults.columns,d=a.aoColumns.length,c=h.extend({},j.models.oColumn,c,{sSortingClass:a.oClasses.sSortable,sSortingClassJUI:a.oClasses.sSortJUI,nTh:b?b:l.createElement("th"),sTitle:c.sTitle?c.sTitle:b?b.innerHTML:"",aDataSort:c.aDataSort?c.aDataSort:[d],mData:c.mData?c.oDefaults:d});a.aoColumns.push(c);if(a.aoPreSearchCols[d]===n||null===a.aoPreSearchCols[d])a.aoPreSearchCols[d]=h.extend({},j.models.oSearch);else if(c=a.aoPreSearchCols[d],+c.bRegex===n&&(c.bRegex=!0),c.bSmart===n&&(c.bSmart=!0),c.bCaseInsensitive===n)c.bCaseInsensitive=!0;m(a,d,null)}function m(a,b,c){var d=a.aoColumns[b];c!==n&&null!==c&&(c.mDataProp&&!c.mData&&(c.mData=c.mDataProp),c.sType!==n&&(d.sType=c.sType,d._bAutoType=!1),h.extend(d,c),p(d,c,"sWidth","sWidthOrig"),c.iDataSort!==n&&(d.aDataSort=[c.iDataSort]),p(d,c,"aDataSort"));var i=d.mRender?Q(d.mRender):null,f=Q(d.mData);d.fnGetData=function(a,b){var c=f(a,b);return d.mRender&&b&&""!==b?i(c,b,a):c};d.fnSetData=+L(d.mData);a.oFeatures.bSort||(d.bSortable=!1);!d.bSortable||-1==h.inArray("asc",d.asSorting)&&-1==h.inArray("desc",d.asSorting)?(d.sSortingClass=a.oClasses.sSortableNone,d.sSortingClassJUI=""):-1==h.inArray("asc",d.asSorting)&&-1==h.inArray("desc",d.asSorting)?(d.sSortingClass=a.oClasses.sSortable,d.sSortingClassJUI=a.oClasses.sSortJUI):-1!=h.inArray("asc",d.asSorting)&&-1==h.inArray("desc",d.asSorting)?(d.sSortingClass=a.oClasses.sSortableAsc,d.sSortingClassJUI=a.oClasses.sSortJUIAscAllowed):-1==+h.inArray("asc",d.asSorting)&&-1!=h.inArray("desc",d.asSorting)&&(d.sSortingClass=a.oClasses.sSortableDesc,d.sSortingClassJUI=a.oClasses.sSortJUIDescAllowed)}function k(a){if(!1===a.oFeatures.bAutoWidth)return!1;da(a);for(var b=0,c=a.aoColumns.length;b<c;b++)a.aoColumns[b].nTh.style.width=a.aoColumns[b].sWidth}function G(a,b){var c=r(a,"bVisible");return"number"===typeof c[b]?c[b]:null}function R(a,b){var c=r(a,"bVisible"),c=h.inArray(b,c);return-1!==c?c:null}function t(a){return r(a,"bVisible").length}+function r(a,b){var c=[];h.map(a.aoColumns,function(a,i){a[b]&&c.push(i)});return c}function B(a){for(var b=j.ext.aTypes,c=b.length,d=0;d<c;d++){var i=b[d](a);if(null!==i)return i}return"string"}function u(a,b){for(var c=b.split(","),d=[],i=0,f=a.aoColumns.length;i<f;i++)for(var g=0;g<f;g++)if(a.aoColumns[i].sName==c[g]){d.push(g);break}return d}function M(a){for(var b="",c=0,d=a.aoColumns.length;c<d;c++)b+=a.aoColumns[c].sName+",";return b.length==d?"":b.slice(0,-1)}function ta(a,b,c,d){var i,f,+g,e,w;if(b)for(i=b.length-1;0<=i;i--){var j=b[i].aTargets;h.isArray(j)||D(a,1,"aTargets must be an array of targets, not a "+typeof j);f=0;for(g=j.length;f<g;f++)if("number"===typeof j[f]&&0<=j[f]){for(;a.aoColumns.length<=j[f];)o(a);d(j[f],b[i])}else if("number"===typeof j[f]&&0>j[f])d(a.aoColumns.length+j[f],b[i]);else if("string"===typeof j[f]){e=0;for(w=a.aoColumns.length;e<w;e++)("_all"==j[f]||h(a.aoColumns[e].nTh).hasClass(j[f]))&&d(e,b[i])}}if(c){i=0;for(a=c.length;i<a;i++)d(i,c[i])}}function H(a,+b){var c;c=h.isArray(b)?b.slice():h.extend(!0,{},b);var d=a.aoData.length,i=h.extend(!0,{},j.models.oRow);i._aData=c;a.aoData.push(i);for(var f,i=0,g=a.aoColumns.length;i<g;i++)c=a.aoColumns[i],"function"===typeof c.fnRender&&c.bUseRendered&&null!==c.mData?F(a,d,i,S(a,d,i)):F(a,d,i,v(a,d,i)),c._bAutoType&&"string"!=c.sType&&(f=v(a,d,i,"type"),null!==f&&""!==f&&(f=B(f),null===c.sType?c.sType=f:c.sType!=f&&"html"!=c.sType&&(c.sType="string")));a.aiDisplayMaster.push(d);a.oFeatures.bDeferRender||ea(a,+d);return d}function ua(a){var b,c,d,i,f,g,e;if(a.bDeferLoading||null===a.sAjaxSource)for(b=a.nTBody.firstChild;b;){if("TR"==b.nodeName.toUpperCase()){c=a.aoData.length;b._DT_RowIndex=c;a.aoData.push(h.extend(!0,{},j.models.oRow,{nTr:b}));a.aiDisplayMaster.push(c);f=b.firstChild;for(d=0;f;){g=f.nodeName.toUpperCase();if("TD"==g||"TH"==g)F(a,c,d,h.trim(f.innerHTML)),d++;f=f.nextSibling}}b=b.nextSibling}i=T(a);d=[];b=0;for(c=i.length;b<c;b++)for(f=i[b].firstChild;f;)g=f.nodeName.toUpperCase(),("TD"==+g||"TH"==g)&&d.push(f),f=f.nextSibling;c=0;for(i=a.aoColumns.length;c<i;c++){e=a.aoColumns[c];null===e.sTitle&&(e.sTitle=e.nTh.innerHTML);var w=e._bAutoType,o="function"===typeof e.fnRender,k=null!==e.sClass,n=e.bVisible,m,p;if(w||o||k||!n){g=0;for(b=a.aoData.length;g<b;g++)f=a.aoData[g],m=d[g*i+c],w&&"string"!=e.sType&&(p=v(a,g,c,"type"),""!==p&&(p=B(p),null===e.sType?e.sType=p:e.sType!=p&&"html"!=e.sType&&(e.sType="string"))),e.mRender?m.innerHTML=v(a,g,c,"display"):e.mData!==c&&(m.innerHTML=v(a,+g,c,"display")),o&&(p=S(a,g,c),m.innerHTML=p,e.bUseRendered&&F(a,g,c,p)),k&&(m.className+=" "+e.sClass),n?f._anHidden[c]=null:(f._anHidden[c]=m,m.parentNode.removeChild(m)),e.fnCreatedCell&&e.fnCreatedCell.call(a.oInstance,m,v(a,g,c,"display"),f._aData,g,c)}}if(0!==a.aoRowCreatedCallback.length){b=0;for(c=a.aoData.length;b<c;b++)f=a.aoData[b],A(a,"aoRowCreatedCallback",null,[f.nTr,f._aData,b])}}function I(a,b){return b._DT_RowIndex!==n?b._DT_RowIndex:null}function fa(a,b,c){for(var b=J(a,b),d=0,a=+a.aoColumns.length;d<a;d++)if(b[d]===c)return d;return-1}function Y(a,b,c,d){for(var i=[],f=0,g=d.length;f<g;f++)i.push(v(a,b,d[f],c));return i}function v(a,b,c,d){var i=a.aoColumns[c];if((c=i.fnGetData(a.aoData[b]._aData,d))===n)return a.iDrawError!=a.iDraw&&null===i.sDefaultContent&&(D(a,0,"Requested unknown parameter "+("function"==typeof i.mData?"{mData function}":"'"+i.mData+"'")+" from the data source for row "+b),a.iDrawError=a.iDraw),i.sDefaultContent;if(null===c&&null!==i.sDefaultContent)c=+i.sDefaultContent;else if("function"===typeof c)return c();return"display"==d&&null===c?"":c}function F(a,b,c,d){a.aoColumns[c].fnSetData(a.aoData[b]._aData,d)}function Q(a){if(null===a)return function(){return null};if("function"===typeof a)return function(b,d,i){return a(b,d,i)};if("string"===typeof a&&(-1!==a.indexOf(".")||-1!==a.indexOf("["))){var b=function(a,d,i){var f=i.split("."),g;if(""!==i){var e=0;for(g=f.length;e<g;e++){if(i=f[e].match(U)){f[e]=f[e].replace(U,"");""!==f[e]&&(a=a[f[e]]);+g=[];f.splice(0,e+1);for(var f=f.join("."),e=0,h=a.length;e<h;e++)g.push(b(a[e],d,f));a=i[0].substring(1,i[0].length-1);a=""===a?g:g.join(a);break}if(null===a||a[f[e]]===n)return n;a=a[f[e]]}}return a};return function(c,d){return b(c,d,a)}}return function(b){return b[a]}}function L(a){if(null===a)return function(){};if("function"===typeof a)return function(b,d){a(b,"set",d)};if("string"===typeof a&&(-1!==a.indexOf(".")||-1!==a.indexOf("["))){var b=function(a,d,i){var i=i.split("."),f,g,e=0;for(g=+i.length-1;e<g;e++){if(f=i[e].match(U)){i[e]=i[e].replace(U,"");a[i[e]]=[];f=i.slice();f.splice(0,e+1);g=f.join(".");for(var h=0,j=d.length;h<j;h++)f={},b(f,d[h],g),a[i[e]].push(f);return}if(null===a[i[e]]||a[i[e]]===n)a[i[e]]={};a=a[i[e]]}a[i[i.length-1].replace(U,"")]=d};return function(c,d){return b(c,d,a)}}return function(b,d){b[a]=d}}function Z(a){for(var b=[],c=a.aoData.length,d=0;d<c;d++)b.push(a.aoData[d]._aData);return b}function ga(a){a.aoData.splice(0,a.aoData.length);a.aiDisplayMaster.splice(0,+a.aiDisplayMaster.length);a.aiDisplay.splice(0,a.aiDisplay.length);y(a)}function ha(a,b){for(var c=-1,d=0,i=a.length;d<i;d++)a[d]==b?c=d:a[d]>b&&a[d]--; -1!=c&&a.splice(c,1)}function S(a,b,c){var d=a.aoColumns[c];return d.fnRender({iDataRow:b,iDataColumn:c,oSettings:a,aData:a.aoData[b]._aData,mDataProp:d.mData},v(a,b,c,"display"))}function ea(a,b){var c=a.aoData[b],d;if(null===c.nTr){c.nTr=l.createElement("tr");c.nTr._DT_RowIndex=b;c._aData.DT_RowId&&(c.nTr.id=c._aData.DT_RowId);c._aData.DT_RowClass&&+(c.nTr.className=c._aData.DT_RowClass);for(var i=0,f=a.aoColumns.length;i<f;i++){var g=a.aoColumns[i];d=l.createElement(g.sCellType);d.innerHTML="function"===typeof g.fnRender&&(!g.bUseRendered||null===g.mData)?S(a,b,i):v(a,b,i,"display");null!==g.sClass&&(d.className=g.sClass);g.bVisible?(c.nTr.appendChild(d),c._anHidden[i]=null):c._anHidden[i]=d;g.fnCreatedCell&&g.fnCreatedCell.call(a.oInstance,d,v(a,b,i,"display"),c._aData,b,i)}A(a,"aoRowCreatedCallback",null,[c.nTr,c._aData,b])}}function va(a){var b,+c,d;if(0!==h("th, td",a.nTHead).length){b=0;for(d=a.aoColumns.length;b<d;b++)if(c=a.aoColumns[b].nTh,c.setAttribute("role","columnheader"),a.aoColumns[b].bSortable&&(c.setAttribute("tabindex",a.iTabIndex),c.setAttribute("aria-controls",a.sTableId)),null!==a.aoColumns[b].sClass&&h(c).addClass(a.aoColumns[b].sClass),a.aoColumns[b].sTitle!=c.innerHTML)c.innerHTML=a.aoColumns[b].sTitle}else{var i=l.createElement("tr");b=0;for(d=a.aoColumns.length;b<d;b++)c=a.aoColumns[b].nTh,c.innerHTML=a.aoColumns[b].sTitle,+c.setAttribute("tabindex","0"),null!==a.aoColumns[b].sClass&&h(c).addClass(a.aoColumns[b].sClass),i.appendChild(c);h(a.nTHead).html("")[0].appendChild(i);V(a.aoHeader,a.nTHead)}h(a.nTHead).children("tr").attr("role","row");if(a.bJUI){b=0;for(d=a.aoColumns.length;b<d;b++){c=a.aoColumns[b].nTh;i=l.createElement("div");i.className=a.oClasses.sSortJUIWrapper;h(c).contents().appendTo(i);var f=l.createElement("span");f.className=a.oClasses.sSortIcon;i.appendChild(f);c.appendChild(i)}}if(a.oFeatures.bSort)for(b=+0;b<a.aoColumns.length;b++)!1!==a.aoColumns[b].bSortable?ia(a,a.aoColumns[b].nTh,b):h(a.aoColumns[b].nTh).addClass(a.oClasses.sSortableNone);""!==a.oClasses.sFooterTH&&h(a.nTFoot).children("tr").children("th").addClass(a.oClasses.sFooterTH);if(null!==a.nTFoot){c=N(a,null,a.aoFooter);b=0;for(d=a.aoColumns.length;b<d;b++)c[b]&&(a.aoColumns[b].nTf=c[b],a.aoColumns[b].sClass&&h(c[b]).addClass(a.aoColumns[b].sClass))}}function W(a,b,c){var d,i,f,g=[],e=[],h=a.aoColumns.length,j;c===n&&(c=!1);d=0;for(i=+b.length;d<i;d++){g[d]=b[d].slice();g[d].nTr=b[d].nTr;for(f=h-1;0<=f;f--)!a.aoColumns[f].bVisible&&!c&&g[d].splice(f,1);e.push([])}d=0;for(i=g.length;d<i;d++){if(a=g[d].nTr)for(;f=a.firstChild;)a.removeChild(f);f=0;for(b=g[d].length;f<b;f++)if(j=h=1,e[d][f]===n){a.appendChild(g[d][f].cell);for(e[d][f]=1;g[d+h]!==n&&g[d][f].cell==g[d+h][f].cell;)e[d+h][f]=1,h++;for(;g[d][f+j]!==n&&g[d][f].cell==g[d][f+j].cell;){for(c=0;c<h;c++)e[d+c][f+j]=1;j++}g[d][f].cell.rowSpan=h;g[d][f].cell.colSpan=j}}}function x(a){var b=+A(a,"aoPreDrawCallback","preDraw",[a]);if(-1!==h.inArray(!1,b))E(a,!1);else{var c,d,b=[],i=0,f=a.asStripeClasses.length;c=a.aoOpenRows.length;a.bDrawing=!0;a.iInitDisplayStart!==n&&-1!=a.iInitDisplayStart&&(a._iDisplayStart=a.oFeatures.bServerSide?a.iInitDisplayStart:a.iInitDisplayStart>=a.fnRecordsDisplay()?0:a.iInitDisplayStart,a.iInitDisplayStart=-1,y(a));if(a.bDeferLoading)a.bDeferLoading=!1,a.iDraw++;else if(a.oFeatures.bServerSide){if(!a.bDestroying&&!wa(a))return}else a.iDraw++;if(0!==a.aiDisplay.length){var g=+a._iDisplayStart;d=a._iDisplayEnd;a.oFeatures.bServerSide&&(g=0,d=a.aoData.length);for(;g<d;g++){var e=a.aoData[a.aiDisplay[g]];null===e.nTr&&ea(a,a.aiDisplay[g]);var j=e.nTr;if(0!==f){var o=a.asStripeClasses[i%f];e._sRowStripe!=o&&(h(j).removeClass(e._sRowStripe).addClass(o),e._sRowStripe=o)}A(a,"aoRowCallback",null,[j,a.aoData[a.aiDisplay[g]]._aData,i,g]);b.push(j);i++;if(0!==c)for(e=0;e<c;e++)if(j==a.aoOpenRows[e].nParent){b.push(a.aoOpenRows[e].nTr);break}}}else b[0]=l.createElement("tr"),a.asStripeClasses[0]&&+(b[0].className=a.asStripeClasses[0]),c=a.oLanguage,f=c.sZeroRecords,1==a.iDraw&&null!==a.sAjaxSource&&!a.oFeatures.bServerSide?f=c.sLoadingRecords:c.sEmptyTable&&0===a.fnRecordsTotal()&&(f=c.sEmptyTable),c=l.createElement("td"),c.setAttribute("valign","top"),c.colSpan=t(a),c.className=a.oClasses.sRowEmpty,c.innerHTML=ja(a,f),b[i].appendChild(c);A(a,"aoHeaderCallback","header",[h(a.nTHead).children("tr")[0],Z(a),a._iDisplayStart,a.fnDisplayEnd(),a.aiDisplay]);A(a,"aoFooterCallback","footer",[h(a.nTFoot).children("tr")[0],+Z(a),a._iDisplayStart,a.fnDisplayEnd(),a.aiDisplay]);i=l.createDocumentFragment();c=l.createDocumentFragment();if(a.nTBody){f=a.nTBody.parentNode;c.appendChild(a.nTBody);if(!a.oScroll.bInfinite||!a._bInitComplete||a.bSorted||a.bFiltered)for(;c=a.nTBody.firstChild;)a.nTBody.removeChild(c);c=0;for(d=b.length;c<d;c++)i.appendChild(b[c]);a.nTBody.appendChild(i);null!==f&&f.appendChild(a.nTBody)}A(a,"aoDrawCallback","draw",[a]);a.bSorted=!1;a.bFiltered=!1;a.bDrawing=!1;a.oFeatures.bServerSide&&(E(a,!1),+a._bInitComplete||$(a))}}function aa(a){a.oFeatures.bSort?O(a,a.oPreviousSearch):a.oFeatures.bFilter?K(a,a.oPreviousSearch):(y(a),x(a))}function xa(a){var b=h("<div></div>")[0];a.nTable.parentNode.insertBefore(b,a.nTable);a.nTableWrapper=h('<div id="'+a.sTableId+'_wrapper" class="'+a.oClasses.sWrapper+'" role="grid"></div>')[0];a.nTableReinsertBefore=a.nTable.nextSibling;for(var c=a.nTableWrapper,d=a.sDom.split(""),i,f,g,e,w,o,k,m=0;m<d.length;m++){f=0;g=d[m];if("<"==g){e=h("<div></div>")[0];w=d[m++1];if("'"==w||'"'==w){o="";for(k=2;d[m+k]!=w;)o+=d[m+k],k++;"H"==o?o=a.oClasses.sJUIHeader:"F"==o&&(o=a.oClasses.sJUIFooter);-1!=o.indexOf(".")?(w=o.split("."),e.id=w[0].substr(1,w[0].length-1),e.className=w[1]):"#"==o.charAt(0)?e.id=o.substr(1,o.length-1):e.className=o;m+=k}c.appendChild(e);c=e}else if(">"==g)c=c.parentNode;else if("l"==g&&a.oFeatures.bPaginate&&a.oFeatures.bLengthChange)i=ya(a),f=1;else if("f"==g&&a.oFeatures.bFilter)i=za(a),f=1;else if("r"==g&&a.oFeatures.bProcessing)i=Aa(a),f=+1;else if("t"==g)i=Ba(a),f=1;else if("i"==g&&a.oFeatures.bInfo)i=Ca(a),f=1;else if("p"==g&&a.oFeatures.bPaginate)i=Da(a),f=1;else if(0!==j.ext.aoFeatures.length){e=j.ext.aoFeatures;k=0;for(w=e.length;k<w;k++)if(g==e[k].cFeature){(i=e[k].fnInit(a))&&(f=1);break}}1==f&&null!==i&&("object"!==typeof a.aanFeatures[g]&&(a.aanFeatures[g]=[]),a.aanFeatures[g].push(i),c.appendChild(i))}b.parentNode.replaceChild(a.nTableWrapper,b)}function V(a,b){var c=h(b).children("tr"),d,i,f,g,e,j,o,k,m,p;a.splice(0,a.length);+f=0;for(j=c.length;f<j;f++)a.push([]);f=0;for(j=c.length;f<j;f++){d=c[f];for(i=d.firstChild;i;){if("TD"==i.nodeName.toUpperCase()||"TH"==i.nodeName.toUpperCase()){k=1*i.getAttribute("colspan");m=1*i.getAttribute("rowspan");k=!k||0===k||1===k?1:k;m=!m||0===m||1===m?1:m;g=0;for(e=a[f];e[g];)g++;o=g;p=1===k?!0:!1;for(e=0;e<k;e++)for(g=0;g<m;g++)a[f+g][o+e]={cell:i,unique:p},a[f+g].nTr=d}i=i.nextSibling}}}function N(a,b,c){var d=[];c||(c=a.aoHeader,b&&(c=[],V(c,b)));for(var b=0,i=c.length;b<i;b++)for(var f=+0,g=c[b].length;f<g;f++)if(c[b][f].unique&&(!d[f]||!a.bSortCellsTop))d[f]=c[b][f].cell;return d}function wa(a){if(a.bAjaxDataGet){a.iDraw++;E(a,!0);var b=Ea(a);ka(a,b);a.fnServerData.call(a.oInstance,a.sAjaxSource,b,function(b){Fa(a,b)},a);return!1}return!0}function Ea(a){var b=a.aoColumns.length,c=[],d,i,f,g;c.push({name:"sEcho",value:a.iDraw});c.push({name:"iColumns",value:b});c.push({name:"sColumns",value:M(a)});c.push({name:"iDisplayStart",value:a._iDisplayStart});c.push({name:"iDisplayLength",+value:!1!==a.oFeatures.bPaginate?a._iDisplayLength:-1});for(f=0;f<b;f++)d=a.aoColumns[f].mData,c.push({name:"mDataProp_"+f,value:"function"===typeof d?"function":d});if(!1!==a.oFeatures.bFilter){c.push({name:"sSearch",value:a.oPreviousSearch.sSearch});c.push({name:"bRegex",value:a.oPreviousSearch.bRegex});for(f=0;f<b;f++)c.push({name:"sSearch_"+f,value:a.aoPreSearchCols[f].sSearch}),c.push({name:"bRegex_"+f,value:a.aoPreSearchCols[f].bRegex}),c.push({name:"bSearchable_"+f,value:a.aoColumns[f].bSearchable})}if(!1!==+a.oFeatures.bSort){var e=0;d=null!==a.aaSortingFixed?a.aaSortingFixed.concat(a.aaSorting):a.aaSorting.slice();for(f=0;f<d.length;f++){i=a.aoColumns[d[f][0]].aDataSort;for(g=0;g<i.length;g++)c.push({name:"iSortCol_"+e,value:i[g]}),c.push({name:"sSortDir_"+e,value:d[f][1]}),e++}c.push({name:"iSortingCols",value:e});for(f=0;f<b;f++)c.push({name:"bSortable_"+f,value:a.aoColumns[f].bSortable})}return c}function ka(a,b){A(a,"aoServerParams","serverParams",[b])}function Fa(a,b){if(b.sEcho!==n){if(1*b.sEcho<+a.iDraw)return;a.iDraw=1*b.sEcho}(!a.oScroll.bInfinite||a.oScroll.bInfinite&&(a.bSorted||a.bFiltered))&&ga(a);a._iRecordsTotal=parseInt(b.iTotalRecords,10);a._iRecordsDisplay=parseInt(b.iTotalDisplayRecords,10);var c=M(a),c=b.sColumns!==n&&""!==c&&b.sColumns!=c,d;c&&(d=u(a,b.sColumns));for(var i=Q(a.sAjaxDataProp)(b),f=0,g=i.length;f<g;f++)if(c){for(var e=[],h=0,j=a.aoColumns.length;h<j;h++)e.push(i[f][d[h]]);H(a,e)}else H(a,i[f]);a.aiDisplay=a.aiDisplayMaster.slice();a.bAjaxDataGet=!1;x(a);a.bAjaxDataGet=+!0;E(a,!1)}function za(a){var b=a.oPreviousSearch,c=a.oLanguage.sSearch,c=-1!==c.indexOf("_INPUT_")?c.replace("_INPUT_",'<input type="text" />'):""===c?'<input type="text" />':c+' <input type="text" />',d=l.createElement("div");d.className=a.oClasses.sFilter;d.innerHTML="<label>"+c+"</label>";a.aanFeatures.f||(d.id=a.sTableId+"_filter");c=h('input[type="text"]',d);d._DT_Input=c[0];c.val(b.sSearch.replace('"',"""));c.bind("keyup.DT",function(){for(var c=a.aanFeatures.f,d=this.value===""?"":this.value,+g=0,e=c.length;g<e;g++)c[g]!=h(this).parents("div.dataTables_filter")[0]&&h(c[g]._DT_Input).val(d);d!=b.sSearch&&K(a,{sSearch:d,bRegex:b.bRegex,bSmart:b.bSmart,bCaseInsensitive:b.bCaseInsensitive})});c.attr("aria-controls",a.sTableId).bind("keypress.DT",function(a){if(a.keyCode==13)return false});return d}function K(a,b,c){var d=a.oPreviousSearch,i=a.aoPreSearchCols,f=function(a){d.sSearch=a.sSearch;d.bRegex=a.bRegex;d.bSmart=a.bSmart;d.bCaseInsensitive=a.bCaseInsensitive};if(a.oFeatures.bServerSide)f(b);+else{Ga(a,b.sSearch,c,b.bRegex,b.bSmart,b.bCaseInsensitive);f(b);for(b=0;b<a.aoPreSearchCols.length;b++)Ha(a,i[b].sSearch,b,i[b].bRegex,i[b].bSmart,i[b].bCaseInsensitive);Ia(a)}a.bFiltered=!0;h(a.oInstance).trigger("filter",a);a._iDisplayStart=0;y(a);x(a);la(a,0)}function Ia(a){for(var b=j.ext.afnFiltering,c=r(a,"bSearchable"),d=0,i=b.length;d<i;d++)for(var f=0,g=0,e=a.aiDisplay.length;g<e;g++){var h=a.aiDisplay[g-f];b[d](a,Y(a,h,"filter",c),h)||(a.aiDisplay.splice(g-f,1),f++)}}function Ha(a,b,c,+d,i,f){if(""!==b)for(var g=0,b=ma(b,d,i,f),d=a.aiDisplay.length-1;0<=d;d--)i=Ja(v(a,a.aiDisplay[d],c,"filter"),a.aoColumns[c].sType),b.test(i)||(a.aiDisplay.splice(d,1),g++)}function Ga(a,b,c,d,i,f){d=ma(b,d,i,f);i=a.oPreviousSearch;c||(c=0);0!==j.ext.afnFiltering.length&&(c=1);if(0>=b.length)a.aiDisplay.splice(0,a.aiDisplay.length),a.aiDisplay=a.aiDisplayMaster.slice();else if(a.aiDisplay.length==a.aiDisplayMaster.length||i.sSearch.length>b.length||1==c||0!==b.indexOf(i.sSearch)){a.aiDisplay.splice(0,+a.aiDisplay.length);la(a,1);for(b=0;b<a.aiDisplayMaster.length;b++)d.test(a.asDataSearch[b])&&a.aiDisplay.push(a.aiDisplayMaster[b])}else for(b=c=0;b<a.asDataSearch.length;b++)d.test(a.asDataSearch[b])||(a.aiDisplay.splice(b-c,1),c++)}function la(a,b){if(!a.oFeatures.bServerSide){a.asDataSearch=[];for(var c=r(a,"bSearchable"),d=1===b?a.aiDisplayMaster:a.aiDisplay,i=0,f=d.length;i<f;i++)a.asDataSearch[i]=na(a,Y(a,d[i],"filter",c))}}function na(a,b){var c=b.join(" ");-1!==c.indexOf("&")&&(c=h("<div>").html(c).text());+return c.replace(/[\n\r]/g," ")}function ma(a,b,c,d){if(c)return a=b?a.split(" "):oa(a).split(" "),a="^(?=.*?"+a.join(")(?=.*?")+").*$",RegExp(a,d?"i":"");a=b?a:oa(a);return RegExp(a,d?"i":"")}function Ja(a,b){return"function"===typeof j.ext.ofnSearch[b]?j.ext.ofnSearch[b](a):null===a?"":"html"==b?a.replace(/[\r\n]/g," ").replace(/<.*?>/g,""):"string"===typeof a?a.replace(/[\r\n]/g," "):a}function oa(a){return a.replace(RegExp("(\\/|\\.|\\*|\\+|\\?|\\||\\(|\\)|\\[|\\]|\\{|\\}|\\\\|\\$|\\^|\\-)","g"),+"\\$1")}function Ca(a){var b=l.createElement("div");b.className=a.oClasses.sInfo;a.aanFeatures.i||(a.aoDrawCallback.push({fn:Ka,sName:"information"}),b.id=a.sTableId+"_info");a.nTable.setAttribute("aria-describedby",a.sTableId+"_info");return b}function Ka(a){if(a.oFeatures.bInfo&&0!==a.aanFeatures.i.length){var b=a.oLanguage,c=a._iDisplayStart+1,d=a.fnDisplayEnd(),i=a.fnRecordsTotal(),f=a.fnRecordsDisplay(),g;g=0===f?b.sInfoEmpty:b.sInfo;f!=i&&(g+=" "+b.sInfoFiltered);g+=b.sInfoPostFix;g=ja(a,g);+null!==b.fnInfoCallback&&(g=b.fnInfoCallback.call(a.oInstance,a,c,d,i,f,g));a=a.aanFeatures.i;b=0;for(c=a.length;b<c;b++)h(a[b]).html(g)}}function ja(a,b){var c=a.fnFormatNumber(a._iDisplayStart+1),d=a.fnDisplayEnd(),d=a.fnFormatNumber(d),i=a.fnRecordsDisplay(),i=a.fnFormatNumber(i),f=a.fnRecordsTotal(),f=a.fnFormatNumber(f);a.oScroll.bInfinite&&(c=a.fnFormatNumber(1));return b.replace(/_START_/g,c).replace(/_END_/g,d).replace(/_TOTAL_/g,i).replace(/_MAX_/g,f)}function ba(a){var b,c,d=a.iInitDisplayStart;+if(!1===a.bInitialised)setTimeout(function(){ba(a)},200);else{xa(a);va(a);W(a,a.aoHeader);a.nTFoot&&W(a,a.aoFooter);E(a,!0);a.oFeatures.bAutoWidth&&da(a);b=0;for(c=a.aoColumns.length;b<c;b++)null!==a.aoColumns[b].sWidth&&(a.aoColumns[b].nTh.style.width=q(a.aoColumns[b].sWidth));a.oFeatures.bSort?O(a):a.oFeatures.bFilter?K(a,a.oPreviousSearch):(a.aiDisplay=a.aiDisplayMaster.slice(),y(a),x(a));null!==a.sAjaxSource&&!a.oFeatures.bServerSide?(c=[],ka(a,c),a.fnServerData.call(a.oInstance,a.sAjaxSource,+c,function(c){var f=a.sAjaxDataProp!==""?Q(a.sAjaxDataProp)(c):c;for(b=0;b<f.length;b++)H(a,f[b]);a.iInitDisplayStart=d;if(a.oFeatures.bSort)O(a);else{a.aiDisplay=a.aiDisplayMaster.slice();y(a);x(a)}E(a,false);$(a,c)},a)):a.oFeatures.bServerSide||(E(a,!1),$(a))}}function $(a,b){a._bInitComplete=!0;A(a,"aoInitComplete","init",[a,b])}function pa(a){var b=j.defaults.oLanguage;!a.sEmptyTable&&(a.sZeroRecords&&"No data available in table"===b.sEmptyTable)&&p(a,a,"sZeroRecords","sEmptyTable");!a.sLoadingRecords&&+(a.sZeroRecords&&"Loading..."===b.sLoadingRecords)&&p(a,a,"sZeroRecords","sLoadingRecords")}function ya(a){if(a.oScroll.bInfinite)return null;var b='<select size="1" '+('name="'+a.sTableId+'_length"')+">",c,d,i=a.aLengthMenu;if(2==i.length&&"object"===typeof i[0]&&"object"===typeof i[1]){c=0;for(d=i[0].length;c<d;c++)b+='<option value="'+i[0][c]+'">'+i[1][c]+"</option>"}else{c=0;for(d=i.length;c<d;c++)b+='<option value="'+i[c]+'">'+i[c]+"</option>"}b+="</select>";i=l.createElement("div");a.aanFeatures.l||+(i.id=a.sTableId+"_length");i.className=a.oClasses.sLength;i.innerHTML="<label>"+a.oLanguage.sLengthMenu.replace("_MENU_",b)+"</label>";h('select option[value="'+a._iDisplayLength+'"]',i).attr("selected",!0);h("select",i).bind("change.DT",function(){var b=h(this).val(),i=a.aanFeatures.l;c=0;for(d=i.length;c<d;c++)i[c]!=this.parentNode&&h("select",i[c]).val(b);a._iDisplayLength=parseInt(b,10);y(a);if(a.fnDisplayEnd()==a.fnRecordsDisplay()){a._iDisplayStart=a.fnDisplayEnd()-a._iDisplayLength;if(a._iDisplayStart<+0)a._iDisplayStart=0}if(a._iDisplayLength==-1)a._iDisplayStart=0;x(a)});h("select",i).attr("aria-controls",a.sTableId);return i}function y(a){a._iDisplayEnd=!1===a.oFeatures.bPaginate?a.aiDisplay.length:a._iDisplayStart+a._iDisplayLength>a.aiDisplay.length||-1==a._iDisplayLength?a.aiDisplay.length:a._iDisplayStart+a._iDisplayLength}function Da(a){if(a.oScroll.bInfinite)return null;var b=l.createElement("div");b.className=a.oClasses.sPaging+a.sPaginationType;j.ext.oPagination[a.sPaginationType].fnInit(a,+b,function(a){y(a);x(a)});a.aanFeatures.p||a.aoDrawCallback.push({fn:function(a){j.ext.oPagination[a.sPaginationType].fnUpdate(a,function(a){y(a);x(a)})},sName:"pagination"});return b}function qa(a,b){var c=a._iDisplayStart;if("number"===typeof b)a._iDisplayStart=b*a._iDisplayLength,a._iDisplayStart>a.fnRecordsDisplay()&&(a._iDisplayStart=0);else if("first"==b)a._iDisplayStart=0;else if("previous"==b)a._iDisplayStart=0<=a._iDisplayLength?a._iDisplayStart-a._iDisplayLength:0,0>a._iDisplayStart&&(a._iDisplayStart=+0);else if("next"==b)0<=a._iDisplayLength?a._iDisplayStart+a._iDisplayLength<a.fnRecordsDisplay()&&(a._iDisplayStart+=a._iDisplayLength):a._iDisplayStart=0;else if("last"==b)if(0<=a._iDisplayLength){var d=parseInt((a.fnRecordsDisplay()-1)/a._iDisplayLength,10)+1;a._iDisplayStart=(d-1)*a._iDisplayLength}else a._iDisplayStart=0;else D(a,0,"Unknown paging action: "+b);h(a.oInstance).trigger("page",a);return c!=a._iDisplayStart}function Aa(a){var b=l.createElement("div");a.aanFeatures.r||(b.id=a.sTableId++"_processing");b.innerHTML=a.oLanguage.sProcessing;b.className=a.oClasses.sProcessing;a.nTable.parentNode.insertBefore(b,a.nTable);return b}function E(a,b){if(a.oFeatures.bProcessing)for(var c=a.aanFeatures.r,d=0,i=c.length;d<i;d++)c[d].style.visibility=b?"visible":"hidden";h(a.oInstance).trigger("processing",[a,b])}function Ba(a){if(""===a.oScroll.sX&&""===a.oScroll.sY)return a.nTable;var b=l.createElement("div"),c=l.createElement("div"),d=l.createElement("div"),i=l.createElement("div"),f=l.createElement("div"),+g=l.createElement("div"),e=a.nTable.cloneNode(!1),j=a.nTable.cloneNode(!1),o=a.nTable.getElementsByTagName("thead")[0],k=0===a.nTable.getElementsByTagName("tfoot").length?null:a.nTable.getElementsByTagName("tfoot")[0],m=a.oClasses;c.appendChild(d);f.appendChild(g);i.appendChild(a.nTable);b.appendChild(c);b.appendChild(i);d.appendChild(e);e.appendChild(o);null!==k&&(b.appendChild(f),g.appendChild(j),j.appendChild(k));b.className=m.sScrollWrapper;c.className=m.sScrollHead;d.className=m.sScrollHeadInner;+i.className=m.sScrollBody;f.className=m.sScrollFoot;g.className=m.sScrollFootInner;a.oScroll.bAutoCss&&(c.style.overflow="hidden",c.style.position="relative",f.style.overflow="hidden",i.style.overflow="auto");c.style.border="0";c.style.width="100%";f.style.border="0";d.style.width=""!==a.oScroll.sXInner?a.oScroll.sXInner:"100%";e.removeAttribute("id");e.style.marginLeft="0";a.nTable.style.marginLeft="0";null!==k&&(j.removeAttribute("id"),j.style.marginLeft="0");d=h(a.nTable).children("caption");0<+d.length&&(d=d[0],"top"===d._captionSide?e.appendChild(d):"bottom"===d._captionSide&&k&&j.appendChild(d));""!==a.oScroll.sX&&(c.style.width=q(a.oScroll.sX),i.style.width=q(a.oScroll.sX),null!==k&&(f.style.width=q(a.oScroll.sX)),h(i).scroll(function(){c.scrollLeft=this.scrollLeft;if(k!==null)f.scrollLeft=this.scrollLeft}));""!==a.oScroll.sY&&(i.style.height=q(a.oScroll.sY));a.aoDrawCallback.push({fn:La,sName:"scrolling"});a.oScroll.bInfinite&&h(i).scroll(function(){if(!a.bDrawing&&h(this).scrollTop()!==+0&&h(this).scrollTop()+h(this).height()>h(a.nTable).height()-a.oScroll.iLoadGap&&a.fnDisplayEnd()<a.fnRecordsDisplay()){qa(a,"next");y(a);x(a)}});a.nScrollHead=c;a.nScrollFoot=f;return b}function La(a){var b=a.nScrollHead.getElementsByTagName("div")[0],c=b.getElementsByTagName("table")[0],d=a.nTable.parentNode,i,f,g,e,j,o,k,m,p=[],n=[],l=null!==a.nTFoot?a.nScrollFoot.getElementsByTagName("div")[0]:null,R=null!==a.nTFoot?l.getElementsByTagName("table")[0]:null,r=a.oBrowser.bScrollOversize,s=function(a){k=+a.style;k.paddingTop="0";k.paddingBottom="0";k.borderTopWidth="0";k.borderBottomWidth="0";k.height=0};h(a.nTable).children("thead, tfoot").remove();i=h(a.nTHead).clone()[0];a.nTable.insertBefore(i,a.nTable.childNodes[0]);g=a.nTHead.getElementsByTagName("tr");e=i.getElementsByTagName("tr");null!==a.nTFoot&&(j=h(a.nTFoot).clone()[0],a.nTable.insertBefore(j,a.nTable.childNodes[1]),o=a.nTFoot.getElementsByTagName("tr"),j=j.getElementsByTagName("tr"));""===a.oScroll.sX&&(d.style.width="100%",b.parentNode.style.width=+"100%");var t=N(a,i);i=0;for(f=t.length;i<f;i++)m=G(a,i),t[i].style.width=a.aoColumns[m].sWidth;null!==a.nTFoot&&C(function(a){a.style.width=""},j);a.oScroll.bCollapse&&""!==a.oScroll.sY&&(d.style.height=d.offsetHeight+a.nTHead.offsetHeight+"px");i=h(a.nTable).outerWidth();if(""===a.oScroll.sX){if(a.nTable.style.width="100%",r&&(h("tbody",d).height()>d.offsetHeight||"scroll"==h(d).css("overflow-y")))a.nTable.style.width=q(h(a.nTable).outerWidth()-a.oScroll.iBarWidth)}else""!==a.oScroll.sXInner?a.nTable.style.width=+q(a.oScroll.sXInner):i==h(d).width()&&h(d).height()<h(a.nTable).height()?(a.nTable.style.width=q(i-a.oScroll.iBarWidth),h(a.nTable).outerWidth()>i-a.oScroll.iBarWidth&&(a.nTable.style.width=q(i))):a.nTable.style.width=q(i);i=h(a.nTable).outerWidth();C(s,e);C(function(a){p.push(q(h(a).width()))},e);C(function(a,b){a.style.width=p[b]},g);h(e).height(0);null!==a.nTFoot&&(C(s,j),C(function(a){n.push(q(h(a).width()))},j),C(function(a,b){a.style.width=n[b]},o),h(j).height(0));C(function(a,b){a.innerHTML=+"";a.style.width=p[b]},e);null!==a.nTFoot&&C(function(a,b){a.innerHTML="";a.style.width=n[b]},j);if(h(a.nTable).outerWidth()<i){g=d.scrollHeight>d.offsetHeight||"scroll"==h(d).css("overflow-y")?i+a.oScroll.iBarWidth:i;if(r&&(d.scrollHeight>d.offsetHeight||"scroll"==h(d).css("overflow-y")))a.nTable.style.width=q(g-a.oScroll.iBarWidth);d.style.width=q(g);a.nScrollHead.style.width=q(g);null!==a.nTFoot&&(a.nScrollFoot.style.width=q(g));""===a.oScroll.sX?D(a,1,"The table cannot fit into the current element which will cause column misalignment. The table has been drawn at its minimum possible width."):+""!==a.oScroll.sXInner&&D(a,1,"The table cannot fit into the current element which will cause column misalignment. Increase the sScrollXInner value or remove it to allow automatic calculation")}else d.style.width=q("100%"),a.nScrollHead.style.width=q("100%"),null!==a.nTFoot&&(a.nScrollFoot.style.width=q("100%"));""===a.oScroll.sY&&r&&(d.style.height=q(a.nTable.offsetHeight+a.oScroll.iBarWidth));""!==a.oScroll.sY&&a.oScroll.bCollapse&&(d.style.height=q(a.oScroll.sY),r=""!==a.oScroll.sX&&a.nTable.offsetWidth>+d.offsetWidth?a.oScroll.iBarWidth:0,a.nTable.offsetHeight<d.offsetHeight&&(d.style.height=q(a.nTable.offsetHeight+r)));r=h(a.nTable).outerWidth();c.style.width=q(r);b.style.width=q(r);c=h(a.nTable).height()>d.clientHeight||"scroll"==h(d).css("overflow-y");b.style.paddingRight=c?a.oScroll.iBarWidth+"px":"0px";null!==a.nTFoot&&(R.style.width=q(r),l.style.width=q(r),l.style.paddingRight=c?a.oScroll.iBarWidth+"px":"0px");h(d).scroll();if(a.bSorted||a.bFiltered)d.scrollTop=0}function C(a,b,c){for(var d=+0,i=0,f=b.length,g,e;i<f;){g=b[i].firstChild;for(e=c?c[i].firstChild:null;g;)1===g.nodeType&&(c?a(g,e,d):a(g,d),d++),g=g.nextSibling,e=c?e.nextSibling:null;i++}}function Ma(a,b){if(!a||null===a||""===a)return 0;b||(b=l.body);var c,d=l.createElement("div");d.style.width=q(a);b.appendChild(d);c=d.offsetWidth;b.removeChild(d);return c}function da(a){var b=0,c,d=0,i=a.aoColumns.length,f,e,j=h("th",a.nTHead),o=a.nTable.getAttribute("width");e=a.nTable.parentNode;for(f=0;f<i;f++)a.aoColumns[f].bVisible&&+(d++,null!==a.aoColumns[f].sWidth&&(c=Ma(a.aoColumns[f].sWidthOrig,e),null!==c&&(a.aoColumns[f].sWidth=q(c)),b++));if(i==j.length&&0===b&&d==i&&""===a.oScroll.sX&&""===a.oScroll.sY)for(f=0;f<a.aoColumns.length;f++)c=h(j[f]).width(),null!==c&&(a.aoColumns[f].sWidth=q(c));else{b=a.nTable.cloneNode(!1);f=a.nTHead.cloneNode(!0);d=l.createElement("tbody");c=l.createElement("tr");b.removeAttribute("id");b.appendChild(f);null!==a.nTFoot&&(b.appendChild(a.nTFoot.cloneNode(!0)),C(function(a){a.style.width=+""},b.getElementsByTagName("tr")));b.appendChild(d);d.appendChild(c);d=h("thead th",b);0===d.length&&(d=h("tbody tr:eq(0)>td",b));j=N(a,f);for(f=d=0;f<i;f++){var k=a.aoColumns[f];k.bVisible&&null!==k.sWidthOrig&&""!==k.sWidthOrig?j[f-d].style.width=q(k.sWidthOrig):k.bVisible?j[f-d].style.width="":d++}for(f=0;f<i;f++)a.aoColumns[f].bVisible&&(d=Na(a,f),null!==d&&(d=d.cloneNode(!0),""!==a.aoColumns[f].sContentPadding&&(d.innerHTML+=a.aoColumns[f].sContentPadding),c.appendChild(d)));e.appendChild(b);+""!==a.oScroll.sX&&""!==a.oScroll.sXInner?b.style.width=q(a.oScroll.sXInner):""!==a.oScroll.sX?(b.style.width="",h(b).width()<e.offsetWidth&&(b.style.width=q(e.offsetWidth))):""!==a.oScroll.sY?b.style.width=q(e.offsetWidth):o&&(b.style.width=q(o));b.style.visibility="hidden";Oa(a,b);i=h("tbody tr:eq(0)",b).children();0===i.length&&(i=N(a,h("thead",b)[0]));if(""!==a.oScroll.sX){for(f=d=e=0;f<a.aoColumns.length;f++)a.aoColumns[f].bVisible&&(e=null===a.aoColumns[f].sWidthOrig?e+h(i[d]).outerWidth():+e+(parseInt(a.aoColumns[f].sWidth.replace("px",""),10)+(h(i[d]).outerWidth()-h(i[d]).width())),d++);b.style.width=q(e);a.nTable.style.width=q(e)}for(f=d=0;f<a.aoColumns.length;f++)a.aoColumns[f].bVisible&&(e=h(i[d]).width(),null!==e&&0<e&&(a.aoColumns[f].sWidth=q(e)),d++);i=h(b).css("width");a.nTable.style.width=-1!==i.indexOf("%")?i:q(h(b).outerWidth());b.parentNode.removeChild(b)}o&&(a.nTable.style.width=q(o))}function Oa(a,b){""===a.oScroll.sX&&""!==a.oScroll.sY?(h(b).width(),b.style.width=q(h(b).outerWidth()-+a.oScroll.iBarWidth)):""!==a.oScroll.sX&&(b.style.width=q(h(b).outerWidth()))}function Na(a,b){var c=Pa(a,b);if(0>c)return null;if(null===a.aoData[c].nTr){var d=l.createElement("td");d.innerHTML=v(a,c,b,"");return d}return J(a,c)[b]}function Pa(a,b){for(var c=-1,d=-1,i=0;i<a.aoData.length;i++){var e=v(a,i,b,"display")+"",e=e.replace(/<.*?>/g,"");e.length>c&&(c=e.length,d=i)}return d}function q(a){if(null===a)return"0px";if("number"==typeof a)return 0>a?"0px":a+"px";var b=a.charCodeAt(a.length-1);+return 48>b||57<b?a:a+"px"}function Qa(){var a=l.createElement("p"),b=a.style;b.width="100%";b.height="200px";b.padding="0px";var c=l.createElement("div"),b=c.style;b.position="absolute";b.top="0px";b.left="0px";b.visibility="hidden";b.width="200px";b.height="150px";b.padding="0px";b.overflow="hidden";c.appendChild(a);l.body.appendChild(c);b=a.offsetWidth;c.style.overflow="scroll";a=a.offsetWidth;b==a&&(a=c.clientWidth);l.body.removeChild(c);return b-a}function O(a,b){var c,d,i,e,g,k,o=[],m=[],p=+j.ext.oSort,l=a.aoData,q=a.aoColumns,G=a.oLanguage.oAria;if(!a.oFeatures.bServerSide&&(0!==a.aaSorting.length||null!==a.aaSortingFixed)){o=null!==a.aaSortingFixed?a.aaSortingFixed.concat(a.aaSorting):a.aaSorting.slice();for(c=0;c<o.length;c++)if(d=o[c][0],i=R(a,d),e=a.aoColumns[d].sSortDataType,j.ext.afnSortData[e])if(g=j.ext.afnSortData[e].call(a.oInstance,a,d,i),g.length===l.length){i=0;for(e=l.length;i<e;i++)F(a,i,d,g[i])}else D(a,0,"Returned data sort array (col "+d+") is the wrong length");c=+0;for(d=a.aiDisplayMaster.length;c<d;c++)m[a.aiDisplayMaster[c]]=c;var r=o.length,s;c=0;for(d=l.length;c<d;c++)for(i=0;i<r;i++){s=q[o[i][0]].aDataSort;g=0;for(k=s.length;g<k;g++)e=q[s[g]].sType,e=p[(e?e:"string")+"-pre"],l[c]._aSortData[s[g]]=e?e(v(a,c,s[g],"sort")):v(a,c,s[g],"sort")}a.aiDisplayMaster.sort(function(a,b){var c,d,e,i,f;for(c=0;c<r;c++){f=q[o[c][0]].aDataSort;d=0;for(e=f.length;d<e;d++)if(i=q[f[d]].sType,i=p[(i?i:"string")+"-"+o[c][1]](l[a]._aSortData[f[d]],l[b]._aSortData[f[d]]),0!==+i)return i}return p["numeric-asc"](m[a],m[b])})}(b===n||b)&&!a.oFeatures.bDeferRender&&P(a);c=0;for(d=a.aoColumns.length;c<d;c++)e=q[c].sTitle.replace(/<.*?>/g,""),i=q[c].nTh,i.removeAttribute("aria-sort"),i.removeAttribute("aria-label"),q[c].bSortable?0<o.length&&o[0][0]==c?(i.setAttribute("aria-sort","asc"==o[0][1]?"ascending":"descending"),i.setAttribute("aria-label",e+("asc"==(q[c].asSorting[o[0][2]+1]?q[c].asSorting[o[0][2]+1]:q[c].asSorting[0])?G.sSortAscending:G.sSortDescending))):i.setAttribute("aria-label",+e+("asc"==q[c].asSorting[0]?G.sSortAscending:G.sSortDescending)):i.setAttribute("aria-label",e);a.bSorted=!0;h(a.oInstance).trigger("sort",a);a.oFeatures.bFilter?K(a,a.oPreviousSearch,1):(a.aiDisplay=a.aiDisplayMaster.slice(),a._iDisplayStart=0,y(a),x(a))}function ia(a,b,c,d){Ra(b,{},function(b){if(!1!==a.aoColumns[c].bSortable){var e=function(){var d,e;if(b.shiftKey){for(var f=!1,h=0;h<a.aaSorting.length;h++)if(a.aaSorting[h][0]==c){f=!0;d=a.aaSorting[h][0];e=a.aaSorting[h][2]+1;a.aoColumns[d].asSorting[e]?+(a.aaSorting[h][1]=a.aoColumns[d].asSorting[e],a.aaSorting[h][2]=e):a.aaSorting.splice(h,1);break}!1===f&&a.aaSorting.push([c,a.aoColumns[c].asSorting[0],0])}else 1==a.aaSorting.length&&a.aaSorting[0][0]==c?(d=a.aaSorting[0][0],e=a.aaSorting[0][2]+1,a.aoColumns[d].asSorting[e]||(e=0),a.aaSorting[0][1]=a.aoColumns[d].asSorting[e],a.aaSorting[0][2]=e):(a.aaSorting.splice(0,a.aaSorting.length),a.aaSorting.push([c,a.aoColumns[c].asSorting[0],0]));O(a)};a.oFeatures.bProcessing?(E(a,!0),setTimeout(function(){e();+a.oFeatures.bServerSide||E(a,!1)},0)):e();"function"==typeof d&&d(a)}})}function P(a){var b,c,d,e,f,g=a.aoColumns.length,j=a.oClasses;for(b=0;b<g;b++)a.aoColumns[b].bSortable&&h(a.aoColumns[b].nTh).removeClass(j.sSortAsc+" "+j.sSortDesc+" "+a.aoColumns[b].sSortingClass);c=null!==a.aaSortingFixed?a.aaSortingFixed.concat(a.aaSorting):a.aaSorting.slice();for(b=0;b<a.aoColumns.length;b++)if(a.aoColumns[b].bSortable){f=a.aoColumns[b].sSortingClass;e=-1;for(d=0;d<c.length;d++)if(c[d][0]==b){f="asc"==c[d][1]?+j.sSortAsc:j.sSortDesc;e=d;break}h(a.aoColumns[b].nTh).addClass(f);a.bJUI&&(f=h("span."+j.sSortIcon,a.aoColumns[b].nTh),f.removeClass(j.sSortJUIAsc+" "+j.sSortJUIDesc+" "+j.sSortJUI+" "+j.sSortJUIAscAllowed+" "+j.sSortJUIDescAllowed),f.addClass(-1==e?a.aoColumns[b].sSortingClassJUI:"asc"==c[e][1]?j.sSortJUIAsc:j.sSortJUIDesc))}else h(a.aoColumns[b].nTh).addClass(a.aoColumns[b].sSortingClass);f=j.sSortColumn;if(a.oFeatures.bSort&&a.oFeatures.bSortClasses){a=J(a);e=[];for(b=0;b<g;b++)e.push("");b=0;+for(d=1;b<c.length;b++)j=parseInt(c[b][0],10),e[j]=f+d,3>d&&d++;f=RegExp(f+"[123]");var o;b=0;for(c=a.length;b<c;b++)j=b%g,d=a[b].className,o=e[j],j=d.replace(f,o),j!=d?a[b].className=h.trim(j):0<o.length&&-1==d.indexOf(o)&&(a[b].className=d+" "+o)}}function ra(a){if(a.oFeatures.bStateSave&&!a.bDestroying){var b,c;b=a.oScroll.bInfinite;var d={iCreate:(new Date).getTime(),iStart:b?0:a._iDisplayStart,iEnd:b?a._iDisplayLength:a._iDisplayEnd,iLength:a._iDisplayLength,aaSorting:h.extend(!0,[],a.aaSorting),+oSearch:h.extend(!0,{},a.oPreviousSearch),aoSearchCols:h.extend(!0,[],a.aoPreSearchCols),abVisCols:[]};b=0;for(c=a.aoColumns.length;b<c;b++)d.abVisCols.push(a.aoColumns[b].bVisible);A(a,"aoStateSaveParams","stateSaveParams",[a,d]);a.fnStateSave.call(a.oInstance,a,d)}}function Sa(a,b){if(a.oFeatures.bStateSave){var c=a.fnStateLoad.call(a.oInstance,a);if(c){var d=A(a,"aoStateLoadParams","stateLoadParams",[a,c]);if(-1===h.inArray(!1,d)){a.oLoadedState=h.extend(!0,{},c);a._iDisplayStart=c.iStart;a.iInitDisplayStart=+c.iStart;a._iDisplayEnd=c.iEnd;a._iDisplayLength=c.iLength;a.aaSorting=c.aaSorting.slice();a.saved_aaSorting=c.aaSorting.slice();h.extend(a.oPreviousSearch,c.oSearch);h.extend(!0,a.aoPreSearchCols,c.aoSearchCols);b.saved_aoColumns=[];for(d=0;d<c.abVisCols.length;d++)b.saved_aoColumns[d]={},b.saved_aoColumns[d].bVisible=c.abVisCols[d];A(a,"aoStateLoaded","stateLoaded",[a,c])}}}}function s(a){for(var b=0;b<j.settings.length;b++)if(j.settings[b].nTable===a)return j.settings[b];return null}function T(a){for(var b=+[],a=a.aoData,c=0,d=a.length;c<d;c++)null!==a[c].nTr&&b.push(a[c].nTr);return b}function J(a,b){var c=[],d,e,f,g,h,j;e=0;var o=a.aoData.length;b!==n&&(e=b,o=b+1);for(f=e;f<o;f++)if(j=a.aoData[f],null!==j.nTr){e=[];for(d=j.nTr.firstChild;d;)g=d.nodeName.toLowerCase(),("td"==g||"th"==g)&&e.push(d),d=d.nextSibling;g=d=0;for(h=a.aoColumns.length;g<h;g++)a.aoColumns[g].bVisible?c.push(e[g-d]):(c.push(j._anHidden[g]),d++)}return c}function D(a,b,c){a=null===a?"DataTables warning: "+c:"DataTables warning (table id = '"++a.sTableId+"'): "+c;if(0===b)if("alert"==j.ext.sErrMode)alert(a);else throw Error(a);else X.console&&console.log&&console.log(a)}function p(a,b,c,d){d===n&&(d=c);b[c]!==n&&(a[d]=b[c])}function Ta(a,b){var c,d;for(d in b)b.hasOwnProperty(d)&&(c=b[d],"object"===typeof e[d]&&null!==c&&!1===h.isArray(c)?h.extend(!0,a[d],c):a[d]=c);return a}function Ra(a,b,c){h(a).bind("click.DT",b,function(b){a.blur();c(b)}).bind("keypress.DT",b,function(a){13===a.which&&c(a)}).bind("selectstart.DT",function(){return!1})}+function z(a,b,c,d){c&&a[b].push({fn:c,sName:d})}function A(a,b,c,d){for(var b=a[b],e=[],f=b.length-1;0<=f;f--)e.push(b[f].fn.apply(a.oInstance,d));null!==c&&h(a.oInstance).trigger(c,d);return e}function Ua(a){var b=h('<div style="position:absolute; top:0; left:0; height:1px; width:1px; overflow:hidden"><div style="position:absolute; top:1px; left:1px; width:100px; overflow:scroll;"><div id="DT_BrowserTest" style="width:100%; height:10px;"></div></div></div>')[0];l.body.appendChild(b);a.oBrowser.bScrollOversize=+100===h("#DT_BrowserTest",b)[0].offsetWidth?!0:!1;l.body.removeChild(b)}function Va(a){return function(){var b=[s(this[j.ext.iApiIndex])].concat(Array.prototype.slice.call(arguments));return j.ext.oApi[a].apply(this,b)}}var U=/\[.*?\]$/,Wa=X.JSON?JSON.stringify:function(a){var b=typeof a;if("object"!==b||null===a)return"string"===b&&(a='"'+a+'"'),a+"";var c,d,e=[],f=h.isArray(a);for(c in a)d=a[c],b=typeof d,"string"===b?d='"'+d+'"':"object"===b&&null!==d&&(d=Wa(d)),e.push((f?"":'"'+c+'":')+d);return(f?+"[":"{")+e+(f?"]":"}")};this.$=function(a,b){var c,d,e=[],f;d=s(this[j.ext.iApiIndex]);var g=d.aoData,o=d.aiDisplay,k=d.aiDisplayMaster;b||(b={});b=h.extend({},{filter:"none",order:"current",page:"all"},b);if("current"==b.page){c=d._iDisplayStart;for(d=d.fnDisplayEnd();c<d;c++)(f=g[o[c]].nTr)&&e.push(f)}else if("current"==b.order&&"none"==b.filter){c=0;for(d=k.length;c<d;c++)(f=g[k[c]].nTr)&&e.push(f)}else if("current"==b.order&&"applied"==b.filter){c=0;for(d=o.length;c<d;c++)(f=g[o[c]].nTr)&&e.push(f)}else if("original"==+b.order&&"none"==b.filter){c=0;for(d=g.length;c<d;c++)(f=g[c].nTr)&&e.push(f)}else if("original"==b.order&&"applied"==b.filter){c=0;for(d=g.length;c<d;c++)f=g[c].nTr,-1!==h.inArray(c,o)&&f&&e.push(f)}else D(d,1,"Unknown selection options");e=h(e);c=e.filter(a);e=e.find(a);return h([].concat(h.makeArray(c),h.makeArray(e)))};this._=function(a,b){var c=[],d,e,f=this.$(a,b);d=0;for(e=f.length;d<e;d++)c.push(this.fnGetData(f[d]));return c};this.fnAddData=function(a,b){if(0===a.length)return[];var c=[],+d,e=s(this[j.ext.iApiIndex]);if("object"===typeof a[0]&&null!==a[0])for(var f=0;f<a.length;f++){d=H(e,a[f]);if(-1==d)return c;c.push(d)}else{d=H(e,a);if(-1==d)return c;c.push(d)}e.aiDisplay=e.aiDisplayMaster.slice();(b===n||b)&&aa(e);return c};this.fnAdjustColumnSizing=function(a){var b=s(this[j.ext.iApiIndex]);k(b);a===n||a?this.fnDraw(!1):(""!==b.oScroll.sX||""!==b.oScroll.sY)&&this.oApi._fnScrollDraw(b)};this.fnClearTable=function(a){var b=s(this[j.ext.iApiIndex]);ga(b);(a===n||a)&&x(b)};this.fnClose=+function(a){for(var b=s(this[j.ext.iApiIndex]),c=0;c<b.aoOpenRows.length;c++)if(b.aoOpenRows[c].nParent==a)return(a=b.aoOpenRows[c].nTr.parentNode)&&a.removeChild(b.aoOpenRows[c].nTr),b.aoOpenRows.splice(c,1),0;return 1};this.fnDeleteRow=function(a,b,c){var d=s(this[j.ext.iApiIndex]),e,f,a="object"===typeof a?I(d,a):a,g=d.aoData.splice(a,1);e=0;for(f=d.aoData.length;e<f;e++)null!==d.aoData[e].nTr&&(d.aoData[e].nTr._DT_RowIndex=e);e=h.inArray(a,d.aiDisplay);d.asDataSearch.splice(e,1);ha(d.aiDisplayMaster,+a);ha(d.aiDisplay,a);"function"===typeof b&&b.call(this,d,g);d._iDisplayStart>=d.fnRecordsDisplay()&&(d._iDisplayStart-=d._iDisplayLength,0>d._iDisplayStart&&(d._iDisplayStart=0));if(c===n||c)y(d),x(d);return g};this.fnDestroy=function(a){var b=s(this[j.ext.iApiIndex]),c=b.nTableWrapper.parentNode,d=b.nTBody,i,f,a=a===n?!1:a;b.bDestroying=!0;A(b,"aoDestroyCallback","destroy",[b]);if(!a){i=0;for(f=b.aoColumns.length;i<f;i++)!1===b.aoColumns[i].bVisible&&this.fnSetColumnVis(i,!0)}h(b.nTableWrapper).find("*").andSelf().unbind(".DT");+h("tbody>tr>td."+b.oClasses.sRowEmpty,b.nTable).parent().remove();b.nTable!=b.nTHead.parentNode&&(h(b.nTable).children("thead").remove(),b.nTable.appendChild(b.nTHead));b.nTFoot&&b.nTable!=b.nTFoot.parentNode&&(h(b.nTable).children("tfoot").remove(),b.nTable.appendChild(b.nTFoot));b.nTable.parentNode.removeChild(b.nTable);h(b.nTableWrapper).remove();b.aaSorting=[];b.aaSortingFixed=[];P(b);h(T(b)).removeClass(b.asStripeClasses.join(" "));h("th, td",b.nTHead).removeClass([b.oClasses.sSortable,b.oClasses.sSortableAsc,+b.oClasses.sSortableDesc,b.oClasses.sSortableNone].join(" "));b.bJUI&&(h("th span."+b.oClasses.sSortIcon+", td span."+b.oClasses.sSortIcon,b.nTHead).remove(),h("th, td",b.nTHead).each(function(){var a=h("div."+b.oClasses.sSortJUIWrapper,this),c=a.contents();h(this).append(c);a.remove()}));!a&&b.nTableReinsertBefore?c.insertBefore(b.nTable,b.nTableReinsertBefore):a||c.appendChild(b.nTable);i=0;for(f=b.aoData.length;i<f;i++)null!==b.aoData[i].nTr&&d.appendChild(b.aoData[i].nTr);!0===b.oFeatures.bAutoWidth&&+(b.nTable.style.width=q(b.sDestroyWidth));if(f=b.asDestroyStripes.length){a=h(d).children("tr");for(i=0;i<f;i++)a.filter(":nth-child("+f+"n + "+i+")").addClass(b.asDestroyStripes[i])}i=0;for(f=j.settings.length;i<f;i++)j.settings[i]==b&&j.settings.splice(i,1);e=b=null};this.fnDraw=function(a){var b=s(this[j.ext.iApiIndex]);!1===a?(y(b),x(b)):aa(b)};this.fnFilter=function(a,b,c,d,e,f){var g=s(this[j.ext.iApiIndex]);if(g.oFeatures.bFilter){if(c===n||null===c)c=!1;if(d===n||null===d)d=!0;if(e===n||null===+e)e=!0;if(f===n||null===f)f=!0;if(b===n||null===b){if(K(g,{sSearch:a+"",bRegex:c,bSmart:d,bCaseInsensitive:f},1),e&&g.aanFeatures.f){b=g.aanFeatures.f;c=0;for(d=b.length;c<d;c++)try{b[c]._DT_Input!=l.activeElement&&h(b[c]._DT_Input).val(a)}catch(o){h(b[c]._DT_Input).val(a)}}}else h.extend(g.aoPreSearchCols[b],{sSearch:a+"",bRegex:c,bSmart:d,bCaseInsensitive:f}),K(g,g.oPreviousSearch,1)}};this.fnGetData=function(a,b){var c=s(this[j.ext.iApiIndex]);if(a!==n){var d=a;if("object"===typeof a){var e=a.nodeName.toLowerCase();+"tr"===e?d=I(c,a):"td"===e&&(d=I(c,a.parentNode),b=fa(c,d,a))}return b!==n?v(c,d,b,""):c.aoData[d]!==n?c.aoData[d]._aData:null}return Z(c)};this.fnGetNodes=function(a){var b=s(this[j.ext.iApiIndex]);return a!==n?b.aoData[a]!==n?b.aoData[a].nTr:null:T(b)};this.fnGetPosition=function(a){var b=s(this[j.ext.iApiIndex]),c=a.nodeName.toUpperCase();return"TR"==c?I(b,a):"TD"==c||"TH"==c?(c=I(b,a.parentNode),a=fa(b,c,a),[c,R(b,a),a]):null};this.fnIsOpen=function(a){for(var b=s(this[j.ext.iApiIndex]),c=0;c<+b.aoOpenRows.length;c++)if(b.aoOpenRows[c].nParent==a)return!0;return!1};this.fnOpen=function(a,b,c){var d=s(this[j.ext.iApiIndex]),e=T(d);if(-1!==h.inArray(a,e)){this.fnClose(a);var e=l.createElement("tr"),f=l.createElement("td");e.appendChild(f);f.className=c;f.colSpan=t(d);"string"===typeof b?f.innerHTML=b:h(f).html(b);b=h("tr",d.nTBody);-1!=h.inArray(a,b)&&h(e).insertAfter(a);d.aoOpenRows.push({nTr:e,nParent:a});return e}};this.fnPageChange=function(a,b){var c=s(this[j.ext.iApiIndex]);qa(c,a);+y(c);(b===n||b)&&x(c)};this.fnSetColumnVis=function(a,b,c){var d=s(this[j.ext.iApiIndex]),e,f,g=d.aoColumns,h=d.aoData,o,m;if(g[a].bVisible!=b){if(b){for(e=f=0;e<a;e++)g[e].bVisible&&f++;m=f>=t(d);if(!m)for(e=a;e<g.length;e++)if(g[e].bVisible){o=e;break}e=0;for(f=h.length;e<f;e++)null!==h[e].nTr&&(m?h[e].nTr.appendChild(h[e]._anHidden[a]):h[e].nTr.insertBefore(h[e]._anHidden[a],J(d,e)[o]))}else{e=0;for(f=h.length;e<f;e++)null!==h[e].nTr&&(o=J(d,e)[a],h[e]._anHidden[a]=o,o.parentNode.removeChild(o))}g[a].bVisible=+b;W(d,d.aoHeader);d.nTFoot&&W(d,d.aoFooter);e=0;for(f=d.aoOpenRows.length;e<f;e++)d.aoOpenRows[e].nTr.colSpan=t(d);if(c===n||c)k(d),x(d);ra(d)}};this.fnSettings=function(){return s(this[j.ext.iApiIndex])};this.fnSort=function(a){var b=s(this[j.ext.iApiIndex]);b.aaSorting=a;O(b)};this.fnSortListener=function(a,b,c){ia(s(this[j.ext.iApiIndex]),a,b,c)};this.fnUpdate=function(a,b,c,d,e){var f=s(this[j.ext.iApiIndex]),b="object"===typeof b?I(f,b):b;if(h.isArray(a)&&c===n){f.aoData[b]._aData=a.slice();+for(c=0;c<f.aoColumns.length;c++)this.fnUpdate(v(f,b,c),b,c,!1,!1)}else if(h.isPlainObject(a)&&c===n){f.aoData[b]._aData=h.extend(!0,{},a);for(c=0;c<f.aoColumns.length;c++)this.fnUpdate(v(f,b,c),b,c,!1,!1)}else{F(f,b,c,a);var a=v(f,b,c,"display"),g=f.aoColumns[c];null!==g.fnRender&&(a=S(f,b,c),g.bUseRendered&&F(f,b,c,a));null!==f.aoData[b].nTr&&(J(f,b)[c].innerHTML=a)}c=h.inArray(b,f.aiDisplay);f.asDataSearch[c]=na(f,Y(f,b,"filter",r(f,"bSearchable")));(e===n||e)&&k(f);(d===n||d)&&aa(f);return 0};+this.fnVersionCheck=j.ext.fnVersionCheck;this.oApi={_fnExternApiFunc:Va,_fnInitialise:ba,_fnInitComplete:$,_fnLanguageCompat:pa,_fnAddColumn:o,_fnColumnOptions:m,_fnAddData:H,_fnCreateTr:ea,_fnGatherData:ua,_fnBuildHead:va,_fnDrawHead:W,_fnDraw:x,_fnReDraw:aa,_fnAjaxUpdate:wa,_fnAjaxParameters:Ea,_fnAjaxUpdateDraw:Fa,_fnServerParams:ka,_fnAddOptionsHtml:xa,_fnFeatureHtmlTable:Ba,_fnScrollDraw:La,_fnAdjustColumnSizing:k,_fnFeatureHtmlFilter:za,_fnFilterComplete:K,_fnFilterCustom:Ia,_fnFilterColumn:Ha,+_fnFilter:Ga,_fnBuildSearchArray:la,_fnBuildSearchRow:na,_fnFilterCreateSearch:ma,_fnDataToSearch:Ja,_fnSort:O,_fnSortAttachListener:ia,_fnSortingClasses:P,_fnFeatureHtmlPaginate:Da,_fnPageChange:qa,_fnFeatureHtmlInfo:Ca,_fnUpdateInfo:Ka,_fnFeatureHtmlLength:ya,_fnFeatureHtmlProcessing:Aa,_fnProcessingDisplay:E,_fnVisibleToColumnIndex:G,_fnColumnIndexToVisible:R,_fnNodeToDataIndex:I,_fnVisbleColumns:t,_fnCalculateEnd:y,_fnConvertToWidth:Ma,_fnCalculateColumnWidths:da,_fnScrollingWidthAdjust:Oa,_fnGetWidestNode:Na,+_fnGetMaxLenString:Pa,_fnStringToCss:q,_fnDetectType:B,_fnSettingsFromNode:s,_fnGetDataMaster:Z,_fnGetTrNodes:T,_fnGetTdNodes:J,_fnEscapeRegex:oa,_fnDeleteIndex:ha,_fnReOrderIndex:u,_fnColumnOrdering:M,_fnLog:D,_fnClearTable:ga,_fnSaveState:ra,_fnLoadState:Sa,_fnCreateCookie:function(a,b,c,d,e){var f=new Date;f.setTime(f.getTime()+1E3*c);var c=X.location.pathname.split("/"),a=a+"_"+c.pop().replace(/[\/:]/g,"").toLowerCase(),g;null!==e?(g="function"===typeof h.parseJSON?h.parseJSON(b):eval("("+b+")"),+b=e(a,g,f.toGMTString(),c.join("/")+"/")):b=a+"="+encodeURIComponent(b)+"; expires="+f.toGMTString()+"; path="+c.join("/")+"/";a=l.cookie.split(";");e=b.split(";")[0].length;f=[];if(4096<e+l.cookie.length+10){for(var j=0,o=a.length;j<o;j++)if(-1!=a[j].indexOf(d)){var k=a[j].split("=");try{(g=eval("("+decodeURIComponent(k[1])+")"))&&g.iCreate&&f.push({name:k[0],time:g.iCreate})}catch(m){}}for(f.sort(function(a,b){return b.time-a.time});4096<e+l.cookie.length+10;){if(0===f.length)return;d=f.pop();l.cookie=+d.name+"=; expires=Thu, 01-Jan-1970 00:00:01 GMT; path="+c.join("/")+"/"}}l.cookie=b},_fnReadCookie:function(a){for(var b=X.location.pathname.split("/"),a=a+"_"+b[b.length-1].replace(/[\/:]/g,"").toLowerCase()+"=",b=l.cookie.split(";"),c=0;c<b.length;c++){for(var d=b[c];" "==d.charAt(0);)d=d.substring(1,d.length);if(0===d.indexOf(a))return decodeURIComponent(d.substring(a.length,d.length))}return null},_fnDetectHeader:V,_fnGetUniqueThs:N,_fnScrollBarWidth:Qa,_fnApplyToChildren:C,_fnMap:p,_fnGetRowData:Y,+_fnGetCellData:v,_fnSetCellData:F,_fnGetObjectDataFn:Q,_fnSetObjectDataFn:L,_fnApplyColumnDefs:ta,_fnBindAction:Ra,_fnExtend:Ta,_fnCallbackReg:z,_fnCallbackFire:A,_fnJsonString:Wa,_fnRender:S,_fnNodeToColumnIndex:fa,_fnInfoMacros:ja,_fnBrowserDetect:Ua,_fnGetColumns:r};h.extend(j.ext.oApi,this.oApi);for(var sa in j.ext.oApi)sa&&(this[sa]=Va(sa));var ca=this;this.each(function(){var a=0,b,c,d;c=this.getAttribute("id");var i=!1,f=!1;if("table"!=this.nodeName.toLowerCase())D(null,0,"Attempted to initialise DataTables on a node which is not a table: "++this.nodeName);else{a=0;for(b=j.settings.length;a<b;a++){if(j.settings[a].nTable==this){if(e===n||e.bRetrieve)return j.settings[a].oInstance;if(e.bDestroy){j.settings[a].oInstance.fnDestroy();break}else{D(j.settings[a],0,"Cannot reinitialise DataTable.\n\nTo retrieve the DataTables object for this table, pass no arguments or see the docs for bRetrieve and bDestroy");return}}if(j.settings[a].sTableId==this.id){j.settings.splice(a,1);break}}if(null===c||""===c)this.id=c="DataTables_Table_"+j.ext._oExternConfig.iNextUnique++;+var g=h.extend(!0,{},j.models.oSettings,{nTable:this,oApi:ca.oApi,oInit:e,sDestroyWidth:h(this).width(),sInstance:c,sTableId:c});j.settings.push(g);g.oInstance=1===ca.length?ca:h(this).dataTable();e||(e={});e.oLanguage&&pa(e.oLanguage);e=Ta(h.extend(!0,{},j.defaults),e);p(g.oFeatures,e,"bPaginate");p(g.oFeatures,e,"bLengthChange");p(g.oFeatures,e,"bFilter");p(g.oFeatures,e,"bSort");p(g.oFeatures,e,"bInfo");p(g.oFeatures,e,"bProcessing");p(g.oFeatures,e,"bAutoWidth");p(g.oFeatures,e,"bSortClasses");+p(g.oFeatures,e,"bServerSide");p(g.oFeatures,e,"bDeferRender");p(g.oScroll,e,"sScrollX","sX");p(g.oScroll,e,"sScrollXInner","sXInner");p(g.oScroll,e,"sScrollY","sY");p(g.oScroll,e,"bScrollCollapse","bCollapse");p(g.oScroll,e,"bScrollInfinite","bInfinite");p(g.oScroll,e,"iScrollLoadGap","iLoadGap");p(g.oScroll,e,"bScrollAutoCss","bAutoCss");p(g,e,"asStripeClasses");p(g,e,"asStripClasses","asStripeClasses");p(g,e,"fnServerData");p(g,e,"fnFormatNumber");p(g,e,"sServerMethod");p(g,e,"aaSorting");p(g,+e,"aaSortingFixed");p(g,e,"aLengthMenu");p(g,e,"sPaginationType");p(g,e,"sAjaxSource");p(g,e,"sAjaxDataProp");p(g,e,"iCookieDuration");p(g,e,"sCookiePrefix");p(g,e,"sDom");p(g,e,"bSortCellsTop");p(g,e,"iTabIndex");p(g,e,"oSearch","oPreviousSearch");p(g,e,"aoSearchCols","aoPreSearchCols");p(g,e,"iDisplayLength","_iDisplayLength");p(g,e,"bJQueryUI","bJUI");p(g,e,"fnCookieCallback");p(g,e,"fnStateLoad");p(g,e,"fnStateSave");p(g.oLanguage,e,"fnInfoCallback");z(g,"aoDrawCallback",e.fnDrawCallback,"user");+z(g,"aoServerParams",e.fnServerParams,"user");z(g,"aoStateSaveParams",e.fnStateSaveParams,"user");z(g,"aoStateLoadParams",e.fnStateLoadParams,"user");z(g,"aoStateLoaded",e.fnStateLoaded,"user");z(g,"aoRowCallback",e.fnRowCallback,"user");z(g,"aoRowCreatedCallback",e.fnCreatedRow,"user");z(g,"aoHeaderCallback",e.fnHeaderCallback,"user");z(g,"aoFooterCallback",e.fnFooterCallback,"user");z(g,"aoInitComplete",e.fnInitComplete,"user");z(g,"aoPreDrawCallback",e.fnPreDrawCallback,"user");g.oFeatures.bServerSide&&+g.oFeatures.bSort&&g.oFeatures.bSortClasses?z(g,"aoDrawCallback",P,"server_side_sort_classes"):g.oFeatures.bDeferRender&&z(g,"aoDrawCallback",P,"defer_sort_classes");e.bJQueryUI?(h.extend(g.oClasses,j.ext.oJUIClasses),e.sDom===j.defaults.sDom&&"lfrtip"===j.defaults.sDom&&(g.sDom='<"H"lfr>t<"F"ip>')):h.extend(g.oClasses,j.ext.oStdClasses);h(this).addClass(g.oClasses.sTable);if(""!==g.oScroll.sX||""!==g.oScroll.sY)g.oScroll.iBarWidth=Qa();g.iInitDisplayStart===n&&(g.iInitDisplayStart=e.iDisplayStart,+g._iDisplayStart=e.iDisplayStart);e.bStateSave&&(g.oFeatures.bStateSave=!0,Sa(g,e),z(g,"aoDrawCallback",ra,"state_save"));null!==e.iDeferLoading&&(g.bDeferLoading=!0,a=h.isArray(e.iDeferLoading),g._iRecordsDisplay=a?e.iDeferLoading[0]:e.iDeferLoading,g._iRecordsTotal=a?e.iDeferLoading[1]:e.iDeferLoading);null!==e.aaData&&(f=!0);""!==e.oLanguage.sUrl?(g.oLanguage.sUrl=e.oLanguage.sUrl,h.getJSON(g.oLanguage.sUrl,null,function(a){pa(a);h.extend(true,g.oLanguage,e.oLanguage,a);ba(g)}),i=!0):h.extend(!0,+g.oLanguage,e.oLanguage);null===e.asStripeClasses&&(g.asStripeClasses=[g.oClasses.sStripeOdd,g.oClasses.sStripeEven]);b=g.asStripeClasses.length;g.asDestroyStripes=[];if(b){c=!1;d=h(this).children("tbody").children("tr:lt("+b+")");for(a=0;a<b;a++)d.hasClass(g.asStripeClasses[a])&&(c=!0,g.asDestroyStripes.push(g.asStripeClasses[a]));c&&d.removeClass(g.asStripeClasses.join(" "))}c=[];a=this.getElementsByTagName("thead");0!==a.length&&(V(g.aoHeader,a[0]),c=N(g));if(null===e.aoColumns){d=[];a=0;for(b=+c.length;a<b;a++)d.push(null)}else d=e.aoColumns;a=0;for(b=d.length;a<b;a++)e.saved_aoColumns!==n&&e.saved_aoColumns.length==b&&(null===d[a]&&(d[a]={}),d[a].bVisible=e.saved_aoColumns[a].bVisible),o(g,c?c[a]:null);ta(g,e.aoColumnDefs,d,function(a,b){m(g,a,b)});a=0;for(b=g.aaSorting.length;a<b;a++){g.aaSorting[a][0]>=g.aoColumns.length&&(g.aaSorting[a][0]=0);var k=g.aoColumns[g.aaSorting[a][0]];g.aaSorting[a][2]===n&&(g.aaSorting[a][2]=0);e.aaSorting===n&&g.saved_aaSorting===n&&(g.aaSorting[a][1]=+k.asSorting[0]);c=0;for(d=k.asSorting.length;c<d;c++)if(g.aaSorting[a][1]==k.asSorting[c]){g.aaSorting[a][2]=c;break}}P(g);Ua(g);a=h(this).children("caption").each(function(){this._captionSide=h(this).css("caption-side")});b=h(this).children("thead");0===b.length&&(b=[l.createElement("thead")],this.appendChild(b[0]));g.nTHead=b[0];b=h(this).children("tbody");0===b.length&&(b=[l.createElement("tbody")],this.appendChild(b[0]));g.nTBody=b[0];g.nTBody.setAttribute("role","alert");g.nTBody.setAttribute("aria-live",+"polite");g.nTBody.setAttribute("aria-relevant","all");b=h(this).children("tfoot");if(0===b.length&&0<a.length&&(""!==g.oScroll.sX||""!==g.oScroll.sY))b=[l.createElement("tfoot")],this.appendChild(b[0]);0<b.length&&(g.nTFoot=b[0],V(g.aoFooter,g.nTFoot));if(f)for(a=0;a<e.aaData.length;a++)H(g,e.aaData[a]);else ua(g);g.aiDisplay=g.aiDisplayMaster.slice();g.bInitialised=!0;!1===i&&ba(g)}});ca=null;return this};j.fnVersionCheck=function(e){for(var h=function(e,h){for(;e.length<h;)e+="0";return e},m=j.ext.sVersion.split("."),+e=e.split("."),k="",n="",l=0,t=e.length;l<t;l++)k+=h(m[l],3),n+=h(e[l],3);return parseInt(k,10)>=parseInt(n,10)};j.fnIsDataTable=function(e){for(var h=j.settings,m=0;m<h.length;m++)if(h[m].nTable===e||h[m].nScrollHead===e||h[m].nScrollFoot===e)return!0;return!1};j.fnTables=function(e){var o=[];jQuery.each(j.settings,function(j,k){(!e||!0===e&&h(k.nTable).is(":visible"))&&o.push(k.nTable)});return o};j.version="1.9.4";j.settings=[];j.models={};j.models.ext={afnFiltering:[],afnSortData:[],aoFeatures:[],+aTypes:[],fnVersionCheck:j.fnVersionCheck,iApiIndex:0,ofnSearch:{},oApi:{},oStdClasses:{},oJUIClasses:{},oPagination:{},oSort:{},sVersion:j.version,sErrMode:"alert",_oExternConfig:{iNextUnique:0}};j.models.oSearch={bCaseInsensitive:!0,sSearch:"",bRegex:!1,bSmart:!0};j.models.oRow={nTr:null,_aData:[],_aSortData:[],_anHidden:[],_sRowStripe:""};j.models.oColumn={aDataSort:null,asSorting:null,bSearchable:null,bSortable:null,bUseRendered:null,bVisible:null,_bAutoType:!0,fnCreatedCell:null,fnGetData:null,+fnRender:null,fnSetData:null,mData:null,mRender:null,nTh:null,nTf:null,sClass:null,sContentPadding:null,sDefaultContent:null,sName:null,sSortDataType:"std",sSortingClass:null,sSortingClassJUI:null,sTitle:null,sType:null,sWidth:null,sWidthOrig:null};j.defaults={aaData:null,aaSorting:[[0,"asc"]],aaSortingFixed:null,aLengthMenu:[10,25,50,100],aoColumns:null,aoColumnDefs:null,aoSearchCols:[],asStripeClasses:null,bAutoWidth:!0,bDeferRender:!1,bDestroy:!1,bFilter:!0,bInfo:!0,bJQueryUI:!1,bLengthChange:!0,+bPaginate:!0,bProcessing:!1,bRetrieve:!1,bScrollAutoCss:!0,bScrollCollapse:!1,bScrollInfinite:!1,bServerSide:!1,bSort:!0,bSortCellsTop:!1,bSortClasses:!0,bStateSave:!1,fnCookieCallback:null,fnCreatedRow:null,fnDrawCallback:null,fnFooterCallback:null,fnFormatNumber:function(e){if(1E3>e)return e;for(var h=e+"",e=h.split(""),j="",h=h.length,k=0;k<h;k++)0===k%3&&0!==k&&(j=this.oLanguage.sInfoThousands+j),j=e[h-k-1]+j;return j},fnHeaderCallback:null,fnInfoCallback:null,fnInitComplete:null,fnPreDrawCallback:null,+fnRowCallback:null,fnServerData:function(e,j,m,k){k.jqXHR=h.ajax({url:e,data:j,success:function(e){e.sError&&k.oApi._fnLog(k,0,e.sError);h(k.oInstance).trigger("xhr",[k,e]);m(e)},dataType:"json",cache:!1,type:k.sServerMethod,error:function(e,h){"parsererror"==h&&k.oApi._fnLog(k,0,"DataTables warning: JSON data from server could not be parsed. This is caused by a JSON formatting error.")}})},fnServerParams:null,fnStateLoad:function(e){var e=this.oApi._fnReadCookie(e.sCookiePrefix+e.sInstance),j;try{j=+"function"===typeof h.parseJSON?h.parseJSON(e):eval("("+e+")")}catch(m){j=null}return j},fnStateLoadParams:null,fnStateLoaded:null,fnStateSave:function(e,h){this.oApi._fnCreateCookie(e.sCookiePrefix+e.sInstance,this.oApi._fnJsonString(h),e.iCookieDuration,e.sCookiePrefix,e.fnCookieCallback)},fnStateSaveParams:null,iCookieDuration:7200,iDeferLoading:null,iDisplayLength:10,iDisplayStart:0,iScrollLoadGap:100,iTabIndex:0,oLanguage:{oAria:{sSortAscending:": activate to sort column ascending",sSortDescending:": activate to sort column descending"},+oPaginate:{sFirst:"First",sLast:"Last",sNext:"Next",sPrevious:"Previous"},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:",sUrl:"",sZeroRecords:"No matching records found"},oSearch:h.extend({},j.models.oSearch),sAjaxDataProp:"aaData",+sAjaxSource:null,sCookiePrefix:"SpryMedia_DataTables_",sDom:"lfrtip",sPaginationType:"two_button",sScrollX:"",sScrollXInner:"",sScrollY:"",sServerMethod:"GET"};j.defaults.columns={aDataSort:null,asSorting:["asc","desc"],bSearchable:!0,bSortable:!0,bUseRendered:!0,bVisible:!0,fnCreatedCell:null,fnRender:null,iDataSort:-1,mData:null,mRender:null,sCellType:"td",sClass:"",sContentPadding:"",sDefaultContent:null,sName:"",sSortDataType:"std",sTitle:null,sType:null,sWidth:null};j.models.oSettings={oFeatures:{bAutoWidth:null,+bDeferRender:null,bFilter:null,bInfo:null,bLengthChange:null,bPaginate:null,bProcessing:null,bServerSide:null,bSort:null,bSortClasses:null,bStateSave:null},oScroll:{bAutoCss:null,bCollapse:null,bInfinite:null,iBarWidth:0,iLoadGap:null,sX:null,sXInner:null,sY:null},oLanguage:{fnInfoCallback:null},oBrowser:{bScrollOversize:!1},aanFeatures:[],aoData:[],aiDisplay:[],aiDisplayMaster:[],aoColumns:[],aoHeader:[],aoFooter:[],asDataSearch:[],oPreviousSearch:{},aoPreSearchCols:[],aaSorting:null,aaSortingFixed:null,+asStripeClasses:null,asDestroyStripes:[],sDestroyWidth:0,aoRowCallback:[],aoHeaderCallback:[],aoFooterCallback:[],aoDrawCallback:[],aoRowCreatedCallback:[],aoPreDrawCallback:[],aoInitComplete:[],aoStateSaveParams:[],aoStateLoadParams:[],aoStateLoaded:[],sTableId:"",nTable:null,nTHead:null,nTFoot:null,nTBody:null,nTableWrapper:null,bDeferLoading:!1,bInitialised:!1,aoOpenRows:[],sDom:null,sPaginationType:"two_button",iCookieDuration:0,sCookiePrefix:"",fnCookieCallback:null,aoStateSave:[],aoStateLoad:[],+oLoadedState:null,sAjaxSource:null,sAjaxDataProp:null,bAjaxDataGet:!0,jqXHR:null,fnServerData:null,aoServerParams:[],sServerMethod:null,fnFormatNumber:null,aLengthMenu:null,iDraw:0,bDrawing:!1,iDrawError:-1,_iDisplayLength:10,_iDisplayStart:0,_iDisplayEnd:10,_iRecordsTotal:0,_iRecordsDisplay:0,bJUI:null,oClasses:{},bFiltered:!1,bSorted:!1,bSortCellsTop:null,oInit:null,aoDestroyCallback:[],fnRecordsTotal:function(){return this.oFeatures.bServerSide?parseInt(this._iRecordsTotal,10):this.aiDisplayMaster.length},+fnRecordsDisplay:function(){return this.oFeatures.bServerSide?parseInt(this._iRecordsDisplay,10):this.aiDisplay.length},fnDisplayEnd:function(){return this.oFeatures.bServerSide?!1===this.oFeatures.bPaginate||-1==this._iDisplayLength?this._iDisplayStart+this.aiDisplay.length:Math.min(this._iDisplayStart+this._iDisplayLength,this._iRecordsDisplay):this._iDisplayEnd},oInstance:null,sInstance:null,iTabIndex:0,nScrollHead:null,nScrollFoot:null};j.ext=h.extend(!0,{},j.models.ext);h.extend(j.ext.oStdClasses,+{sTable:"dataTable",sPagePrevEnabled:"paginate_enabled_previous",sPagePrevDisabled:"paginate_disabled_previous",sPageNextEnabled:"paginate_enabled_next",sPageNextDisabled:"paginate_disabled_next",sPageJUINext:"",sPageJUIPrev:"",sPageButton:"paginate_button",sPageButtonActive:"paginate_active",sPageButtonStaticDisabled:"paginate_button paginate_button_disabled",sPageFirst:"first",sPagePrevious:"previous",sPageNext:"next",sPageLast:"last",sStripeOdd:"odd",sStripeEven:"even",sRowEmpty:"dataTables_empty",+sWrapper:"dataTables_wrapper",sFilter:"dataTables_filter",sInfo:"dataTables_info",sPaging:"dataTables_paginate paging_",sLength:"dataTables_length",sProcessing:"dataTables_processing",sSortAsc:"sorting_asc",sSortDesc:"sorting_desc",sSortable:"sorting",sSortableAsc:"sorting_asc_disabled",sSortableDesc:"sorting_desc_disabled",sSortableNone:"sorting_disabled",sSortColumn:"sorting_",sSortJUIAsc:"",sSortJUIDesc:"",sSortJUI:"",sSortJUIAscAllowed:"",sSortJUIDescAllowed:"",sSortJUIWrapper:"",sSortIcon:"",+sScrollWrapper:"dataTables_scroll",sScrollHead:"dataTables_scrollHead",sScrollHeadInner:"dataTables_scrollHeadInner",sScrollBody:"dataTables_scrollBody",sScrollFoot:"dataTables_scrollFoot",sScrollFootInner:"dataTables_scrollFootInner",sFooterTH:"",sJUIHeader:"",sJUIFooter:""});h.extend(j.ext.oJUIClasses,j.ext.oStdClasses,{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",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",sPageLast:"last ui-corner-tr ui-corner-br",sPaging:"dataTables_paginate fg-buttonset ui-buttonset fg-buttonset-multi ui-buttonset-multi paging_",+sSortAsc:"ui-state-default",sSortDesc:"ui-state-default",sSortable:"ui-state-default",sSortableAsc:"ui-state-default",sSortableDesc:"ui-state-default",sSortableNone:"ui-state-default",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",+sScrollHead:"dataTables_scrollHead ui-state-default",sScrollFoot:"dataTables_scrollFoot ui-state-default",sFooterTH:"ui-state-default",sJUIHeader:"fg-toolbar ui-toolbar ui-widget-header ui-corner-tl ui-corner-tr ui-helper-clearfix",sJUIFooter:"fg-toolbar ui-toolbar ui-widget-header ui-corner-bl ui-corner-br ui-helper-clearfix"});h.extend(j.ext.oPagination,{two_button:{fnInit:function(e,j,m){var k=e.oLanguage.oPaginate,n=function(h){e.oApi._fnPageChange(e,h.data.action)&&m(e)},k=!e.bJUI?'<a class="'++e.oClasses.sPagePrevDisabled+'" tabindex="'+e.iTabIndex+'" role="button">'+k.sPrevious+'</a><a class="'+e.oClasses.sPageNextDisabled+'" tabindex="'+e.iTabIndex+'" role="button">'+k.sNext+"</a>":'<a class="'+e.oClasses.sPagePrevDisabled+'" tabindex="'+e.iTabIndex+'" role="button"><span class="'+e.oClasses.sPageJUIPrev+'"></span></a><a class="'+e.oClasses.sPageNextDisabled+'" tabindex="'+e.iTabIndex+'" role="button"><span class="'+e.oClasses.sPageJUINext+'"></span></a>';h(j).append(k);var l=h("a",j),+k=l[0],l=l[1];e.oApi._fnBindAction(k,{action:"previous"},n);e.oApi._fnBindAction(l,{action:"next"},n);e.aanFeatures.p||(j.id=e.sTableId+"_paginate",k.id=e.sTableId+"_previous",l.id=e.sTableId+"_next",k.setAttribute("aria-controls",e.sTableId),l.setAttribute("aria-controls",e.sTableId))},fnUpdate:function(e){if(e.aanFeatures.p)for(var h=e.oClasses,j=e.aanFeatures.p,k,l=0,n=j.length;l<n;l++)if(k=j[l].firstChild)k.className=0===e._iDisplayStart?h.sPagePrevDisabled:h.sPagePrevEnabled,k=k.nextSibling,+k.className=e.fnDisplayEnd()==e.fnRecordsDisplay()?h.sPageNextDisabled:h.sPageNextEnabled}},iFullNumbersShowPages:5,full_numbers:{fnInit:function(e,j,m){var k=e.oLanguage.oPaginate,l=e.oClasses,n=function(h){e.oApi._fnPageChange(e,h.data.action)&&m(e)};h(j).append('<a tabindex="'+e.iTabIndex+'" class="'+l.sPageButton+" "+l.sPageFirst+'">'+k.sFirst+'</a><a tabindex="'+e.iTabIndex+'" class="'+l.sPageButton+" "+l.sPagePrevious+'">'+k.sPrevious+'</a><span></span><a tabindex="'+e.iTabIndex+'" class="'++l.sPageButton+" "+l.sPageNext+'">'+k.sNext+'</a><a tabindex="'+e.iTabIndex+'" class="'+l.sPageButton+" "+l.sPageLast+'">'+k.sLast+"</a>");var t=h("a",j),k=t[0],l=t[1],r=t[2],t=t[3];e.oApi._fnBindAction(k,{action:"first"},n);e.oApi._fnBindAction(l,{action:"previous"},n);e.oApi._fnBindAction(r,{action:"next"},n);e.oApi._fnBindAction(t,{action:"last"},n);e.aanFeatures.p||(j.id=e.sTableId+"_paginate",k.id=e.sTableId+"_first",l.id=e.sTableId+"_previous",r.id=e.sTableId+"_next",t.id=e.sTableId+"_last")},+fnUpdate:function(e,o){if(e.aanFeatures.p){var m=j.ext.oPagination.iFullNumbersShowPages,k=Math.floor(m/2),l=Math.ceil(e.fnRecordsDisplay()/e._iDisplayLength),n=Math.ceil(e._iDisplayStart/e._iDisplayLength)+1,t="",r,B=e.oClasses,u,M=e.aanFeatures.p,L=function(h){e.oApi._fnBindAction(this,{page:h+r-1},function(h){e.oApi._fnPageChange(e,h.data.page);o(e);h.preventDefault()})};-1===e._iDisplayLength?n=k=r=1:l<m?(r=1,k=l):n<=k?(r=1,k=m):n>=l-k?(r=l-m+1,k=l):(r=n-Math.ceil(m/2)+1,k=r+m-1);for(m=r;m<=k;m++)t+=+n!==m?'<a tabindex="'+e.iTabIndex+'" class="'+B.sPageButton+'">'+e.fnFormatNumber(m)+"</a>":'<a tabindex="'+e.iTabIndex+'" class="'+B.sPageButtonActive+'">'+e.fnFormatNumber(m)+"</a>";m=0;for(k=M.length;m<k;m++)u=M[m],u.hasChildNodes()&&(h("span:eq(0)",u).html(t).children("a").each(L),u=u.getElementsByTagName("a"),u=[u[0],u[1],u[u.length-2],u[u.length-1]],h(u).removeClass(B.sPageButton+" "+B.sPageButtonActive+" "+B.sPageButtonStaticDisabled),h([u[0],u[1]]).addClass(1==n?B.sPageButtonStaticDisabled:+B.sPageButton),h([u[2],u[3]]).addClass(0===l||n===l||-1===e._iDisplayLength?B.sPageButtonStaticDisabled:B.sPageButton))}}}});h.extend(j.ext.oSort,{"string-pre":function(e){"string"!=typeof e&&(e=null!==e&&e.toString?e.toString():"");return e.toLowerCase()},"string-asc":function(e,h){return e<h?-1:e>h?1:0},"string-desc":function(e,h){return e<h?1:e>h?-1:0},"html-pre":function(e){return e.replace(/<.*?>/g,"").toLowerCase()},"html-asc":function(e,h){return e<h?-1:e>h?1:0},"html-desc":function(e,h){return e<+h?1:e>h?-1:0},"date-pre":function(e){e=Date.parse(e);if(isNaN(e)||""===e)e=Date.parse("01/01/1970 00:00:00");return e},"date-asc":function(e,h){return e-h},"date-desc":function(e,h){return h-e},"numeric-pre":function(e){return"-"==e||""===e?0:1*e},"numeric-asc":function(e,h){return e-h},"numeric-desc":function(e,h){return h-e}});h.extend(j.ext.aTypes,[function(e){if("number"===typeof e)return"numeric";if("string"!==typeof e)return null;var h,j=!1;h=e.charAt(0);if(-1=="0123456789-".indexOf(h))return null;+for(var k=1;k<e.length;k++){h=e.charAt(k);if(-1=="0123456789.".indexOf(h))return null;if("."==h){if(j)return null;j=!0}}return"numeric"},function(e){var h=Date.parse(e);return null!==h&&!isNaN(h)||"string"===typeof e&&0===e.length?"date":null},function(e){return"string"===typeof e&&-1!=e.indexOf("<")&&-1!=e.indexOf(">")?"html":null}]);h.fn.DataTable=j;h.fn.dataTable=j;h.fn.dataTableSettings=j.settings;h.fn.dataTableExt=j.ext};"function"===typeof define&&define.amd?define(["jquery"],L):jQuery&&!jQuery.fn.dataTable&&+L(jQuery)})(window,document);diff --git a/data/libs/dynatree/jquery.dynatree-1.2.2.js b/data/libs/dynatree/jquery.dynatree-1.2.2.jsdeleted file mode 100644index 9fe7a9dad..000000000--- a/data/libs/dynatree/jquery.dynatree-1.2.2.js+++ /dev/null@@ -1,3336 +0,0 @@-/*! jQuery Dynatree Plugin - v1.2.2 - 2012-10-07-* http://dynatree.googlecode.com/-* Copyright (c) 2012 Martin Wendt; Licensed MIT, GPL */--/* jsHint options*/-// Note: We currently allow eval() to parse the 'data' attribtes, when initializing from HTML.-// TODO: pass jsHint with the options given in grunt.js only.-// The following should not be required:-/*global alert */-/*jshint nomen:false, smarttabs:true, eqeqeq:false, evil:true, regexp:false */--/*************************************************************************- * Debug functions- */--var _canLog = true;--function _log(mode, msg) {- /**- * Usage: logMsg("%o was toggled", this);- */- if( !_canLog ){- return;- }- // Remove first argument- var args = Array.prototype.slice.apply(arguments, [1]);- // Prepend timestamp- var dt = new Date();- var tag = dt.getHours()+":"+dt.getMinutes()+":"+dt.getSeconds()+"."+dt.getMilliseconds();- args[0] = tag + " - " + args[0];-- try {- switch( mode ) {- case "info":- window.console.info.apply(window.console, args);- break;- case "warn":- window.console.warn.apply(window.console, args);- break;- default:- window.console.log.apply(window.console, args);- break;- }- } catch(e) {- if( !window.console ){- _canLog = false; // Permanently disable, when logging is not supported by the browser- }- }-}--function logMsg(msg) {- Array.prototype.unshift.apply(arguments, ["debug"]);- _log.apply(this, arguments);-}---// Forward declaration-var getDynaTreePersistData = null;----/*************************************************************************- * Constants- */-var DTNodeStatus_Error = -1;-var DTNodeStatus_Loading = 1;-var DTNodeStatus_Ok = 0;---// Start of local namespace-(function($) {--/*************************************************************************- * Common tool functions.- */--var Class = {- create: function() {- return function() {- this.initialize.apply(this, arguments);- };- }-};--// Tool function to get dtnode from the event target:-function getDtNodeFromElement(el) {- alert("getDtNodeFromElement is deprecated");- return $.ui.dynatree.getNode(el);-/*- var iMax = 5;- while( el && iMax-- ) {- if(el.dtnode) { return el.dtnode; }- el = el.parentNode;- }- return null;-*/-}--function noop() {-}--/*************************************************************************- * Class DynaTreeNode- */-var DynaTreeNode = Class.create();--DynaTreeNode.prototype = {- initialize: function(parent, tree, data) {- /**- * @constructor- */- this.parent = parent;- this.tree = tree;- if ( typeof data === "string" ){- data = { title: data };- }- if( data.key === undefined ){- data.key = "_" + tree._nodeCount++;- }- this.data = $.extend({}, $.ui.dynatree.nodedatadefaults, data);- this.li = null; // not yet created- this.span = null; // not yet created- this.ul = null; // not yet created- this.childList = null; // no subnodes yet- this._isLoading = false; // Lazy content is being loaded- this.hasSubSel = false;- this.bExpanded = false;- this.bSelected = false;-- },-- toString: function() {- return "DynaTreeNode<" + this.data.key + ">: '" + this.data.title + "'";- },-- toDict: function(recursive, callback) {- var dict = $.extend({}, this.data);- dict.activate = ( this.tree.activeNode === this );- dict.focus = ( this.tree.focusNode === this );- dict.expand = this.bExpanded;- dict.select = this.bSelected;- if( callback ){- callback(dict);- }- if( recursive && this.childList ) {- dict.children = [];- for(var i=0, l=this.childList.length; i<l; i++ ){- dict.children.push(this.childList[i].toDict(true, callback));- }- } else {- delete dict.children;- }- return dict;- },-- fromDict: function(dict) {- /**- * Update node data. If dict contains 'children', then also replace- * the hole sub tree.- */- var children = dict.children;- if(children === undefined){- this.data = $.extend(this.data, dict);- this.render();- return;- }- dict = $.extend({}, dict);- dict.children = undefined;- this.data = $.extend(this.data, dict);- this.removeChildren();- this.addChild(children);- },-- _getInnerHtml: function() {- var tree = this.tree,- opts = tree.options,- cache = tree.cache,- level = this.getLevel(),- data = this.data,- res = "",- imageSrc;- // connector (expanded, expandable or simple)- if( level < opts.minExpandLevel ) {- if(level > 1){- res += cache.tagConnector;- }- // .. else (i.e. for root level) skip expander/connector altogether- } else if( this.hasChildren() !== false ) {- res += cache.tagExpander;- } else {- res += cache.tagConnector;- }- // Checkbox mode- if( opts.checkbox && data.hideCheckbox !== true && !data.isStatusNode ) {- res += cache.tagCheckbox;- }- // folder or doctype icon- if ( data.icon ) {- if (data.icon.charAt(0) === "/"){- imageSrc = data.icon;- }else{- imageSrc = opts.imagePath + data.icon;- }- res += "<img src='" + imageSrc + "' alt='' />";- } else if ( data.icon === false ) {- // icon == false means 'no icon'-// noop(); // keep JSLint happy- } else {- // icon == null means 'default icon'- res += cache.tagNodeIcon;- }- // node title- var nodeTitle = "";- if ( opts.onCustomRender ){- nodeTitle = opts.onCustomRender.call(tree, this) || "";- }- if(!nodeTitle){- var tooltip = data.tooltip ? ' title="' + data.tooltip.replace(/\"/g, '"') + '"' : '',- href = data.href || "#";- if( opts.noLink || data.noLink ) {- nodeTitle = '<span style="display:inline-block;" class="' + opts.classNames.title + '"' + tooltip + '>' + data.title + '</span>';-// this.tree.logDebug("nodeTitle: " + nodeTitle);- } else {- nodeTitle = '<a href="' + href + '" class="' + opts.classNames.title + '"' + tooltip + '>' + data.title + '</a>';- }- }- res += nodeTitle;- return res;- },--- _fixOrder: function() {- /**- * Make sure, that <li> order matches childList order.- */- var cl = this.childList;- if( !cl || !this.ul ){- return;- }- var childLI = this.ul.firstChild;- for(var i=0, l=cl.length-1; i<l; i++) {- var childNode1 = cl[i];- var childNode2 = childLI.dtnode;- if( childNode1 !== childNode2 ) {- this.tree.logDebug("_fixOrder: mismatch at index " + i + ": " + childNode1 + " != " + childNode2);- this.ul.insertBefore(childNode1.li, childNode2.li);- } else {- childLI = childLI.nextSibling;- }- }- },--- render: function(useEffects, includeInvisible) {- /**- * Create <li><span>..</span> .. </li> tags for this node.- *- * <li id='KEY' dtnode=NODE> // This div contains the node's span and list of child div's.- * <span class='title'>S S S A</span> // Span contains graphic spans and title <a> tag- * <ul> // only present, when node has children- * <li id='KEY' dtnode=NODE>child1</li>- * <li id='KEY' dtnode=NODE>child2</li>- * </ul>- * </li>- */-// this.tree.logDebug("%s.render(%s)", this, useEffects);- // ---- var tree = this.tree,- parent = this.parent,- data = this.data,- opts = tree.options,- cn = opts.classNames,- isLastSib = this.isLastSibling(),- firstTime = false;-- if( !parent && !this.ul ) {- // Root node has only a <ul>- this.li = this.span = null;- this.ul = document.createElement("ul");- if( opts.minExpandLevel > 1 ){- this.ul.className = cn.container + " " + cn.noConnector;- }else{- this.ul.className = cn.container;- }- } else if( parent ) {- // Create <li><span /> </li>- if( ! this.li ) {- firstTime = true;- this.li = document.createElement("li");- this.li.dtnode = this;- if( data.key && opts.generateIds ){- this.li.id = opts.idPrefix + data.key;- }- this.span = document.createElement("span");- this.span.className = cn.title;- this.li.appendChild(this.span);-- if( !parent.ul ) {- // This is the parent's first child: create UL tag- // (Hidden, because it will be- parent.ul = document.createElement("ul");- parent.ul.style.display = "none";- parent.li.appendChild(parent.ul);-// if( opts.minExpandLevel > this.getLevel() ){-// parent.ul.className = cn.noConnector;-// }- }- // set node connector images, links and text-// this.span.innerHTML = this._getInnerHtml();-- parent.ul.appendChild(this.li);- }- // set node connector images, links and text- this.span.innerHTML = this._getInnerHtml();- // Set classes for current status- var cnList = [];- cnList.push(cn.node);- if( data.isFolder ){- cnList.push(cn.folder);- }- if( this.bExpanded ){- cnList.push(cn.expanded);- }- if( this.hasChildren() !== false ){- cnList.push(cn.hasChildren);- }- if( data.isLazy && this.childList === null ){- cnList.push(cn.lazy);- }- if( isLastSib ){- cnList.push(cn.lastsib);- }- if( this.bSelected ){- cnList.push(cn.selected);- }- if( this.hasSubSel ){- cnList.push(cn.partsel);- }- if( tree.activeNode === this ){- cnList.push(cn.active);- }- if( data.addClass ){- cnList.push(data.addClass);- }- // IE6 doesn't correctly evaluate multiple class names,- // so we create combined class names that can be used in the CSS- cnList.push(cn.combinedExpanderPrefix- + (this.bExpanded ? "e" : "c")- + (data.isLazy && this.childList === null ? "d" : "")- + (isLastSib ? "l" : "")- );- cnList.push(cn.combinedIconPrefix- + (this.bExpanded ? "e" : "c")- + (data.isFolder ? "f" : "")- );- this.span.className = cnList.join(" ");-- // TODO: we should not set this in the <span> tag also, if we set it here:- this.li.className = isLastSib ? cn.lastsib : "";-- // Allow tweaking, binding, after node was created for the first time- if(firstTime && opts.onCreate){- opts.onCreate.call(tree, this, this.span);- }- // Hide children, if node is collapsed-// this.ul.style.display = ( this.bExpanded || !parent ) ? "" : "none";- // Allow tweaking after node state was rendered- if(opts.onRender){- opts.onRender.call(tree, this, this.span);- }- }- // Visit child nodes- if( (this.bExpanded || includeInvisible === true) && this.childList ) {- for(var i=0, l=this.childList.length; i<l; i++) {- this.childList[i].render(false, includeInvisible);- }- // Make sure the tag order matches the child array- this._fixOrder();- }- // Hide children, if node is collapsed- if( this.ul ) {- var isHidden = (this.ul.style.display === "none");- var isExpanded = !!this.bExpanded;-// logMsg("isHidden:%s", isHidden);- if( useEffects && opts.fx && (isHidden === isExpanded) ) {- var duration = opts.fx.duration || 200;- $(this.ul).animate(opts.fx, duration);- } else {- this.ul.style.display = ( this.bExpanded || !parent ) ? "" : "none";- }- }- },- /** Return '/id1/id2/id3'. */- getKeyPath: function(excludeSelf) {- var path = [];- this.visitParents(function(node){- if(node.parent){- path.unshift(node.data.key);- }- }, !excludeSelf);- return "/" + path.join(this.tree.options.keyPathSeparator);- },-- getParent: function() {- return this.parent;- },-- getChildren: function() {- if(this.hasChildren() === undefined){- return undefined; // Lazy node: unloaded, currently loading, or load error- }- return this.childList;- },-- /** Check if node has children (returns undefined, if not sure). */- hasChildren: function() {- if(this.data.isLazy){- if(this.childList === null || this.childList === undefined){- // Not yet loaded- return undefined;- }else if(this.childList.length === 0){- // Loaded, but response was empty- return false;- }else if(this.childList.length === 1 && this.childList[0].isStatusNode()){- // Currently loading or load error- return undefined;- }- return true;- }- return !!this.childList;- },-- isFirstSibling: function() {- var p = this.parent;- return !p || p.childList[0] === this;- },-- isLastSibling: function() {- var p = this.parent;- return !p || p.childList[p.childList.length-1] === this;- },-- isLoading: function() {- return !!this._isLoading;- },-- getPrevSibling: function() {- if( !this.parent ){- return null;- }- var ac = this.parent.childList;- for(var i=1, l=ac.length; i<l; i++){ // start with 1, so prev(first) = null- if( ac[i] === this ){- return ac[i-1];- }- }- return null;- },-- getNextSibling: function() {- if( !this.parent ){- return null;- }- var ac = this.parent.childList;- for(var i=0, l=ac.length-1; i<l; i++){ // up to length-2, so next(last) = null- if( ac[i] === this ){- return ac[i+1];- }- }- return null;- },-- isStatusNode: function() {- return (this.data.isStatusNode === true);- },-- isChildOf: function(otherNode) {- return (this.parent && this.parent === otherNode);- },-- isDescendantOf: function(otherNode) {- if(!otherNode){- return false;- }- var p = this.parent;- while( p ) {- if( p === otherNode ){- return true;- }- p = p.parent;- }- return false;- },-- countChildren: function() {- var cl = this.childList;- if( !cl ){- return 0;- }- var n = cl.length;- for(var i=0, l=n; i<l; i++){- var child = cl[i];- n += child.countChildren();- }- return n;- },-- /**Sort child list by title.- * cmd: optional compare function.- * deep: optional: pass true to sort all descendant nodes.- */- sortChildren: function(cmp, deep) {- var cl = this.childList;- if( !cl ){- return;- }- cmp = cmp || function(a, b) {-// return a.data.title === b.data.title ? 0 : a.data.title > b.data.title ? 1 : -1;- var x = a.data.title.toLowerCase(),- y = b.data.title.toLowerCase();- return x === y ? 0 : x > y ? 1 : -1;- };- cl.sort(cmp);- if( deep ){- for(var i=0, l=cl.length; i<l; i++){- if( cl[i].childList ){- cl[i].sortChildren(cmp, "$norender$");- }- }- }- if( deep !== "$norender$" ){- this.render();- }- },-- _setStatusNode: function(data) {- // Create, modify or remove the status child node (pass 'null', to remove it).- var firstChild = ( this.childList ? this.childList[0] : null );- if( !data ) {- if ( firstChild && firstChild.isStatusNode()) {- try{- // I've seen exceptions here with loadKeyPath...- if(this.ul){- this.ul.removeChild(firstChild.li);- firstChild.li = null; // avoid leaks (issue 215)- }- }catch(e){}- if( this.childList.length === 1 ){- this.childList = [];- }else{- this.childList.shift();- }- }- } else if ( firstChild ) {- data.isStatusNode = true;- data.key = "_statusNode";- firstChild.data = data;- firstChild.render();- } else {- data.isStatusNode = true;- data.key = "_statusNode";- firstChild = this.addChild(data);- }- },-- setLazyNodeStatus: function(lts, opts) {- var tooltip = (opts && opts.tooltip) ? opts.tooltip : null,- info = (opts && opts.info) ? " (" + opts.info + ")" : "";- switch( lts ) {- case DTNodeStatus_Ok:- this._setStatusNode(null);- $(this.span).removeClass(this.tree.options.classNames.nodeLoading);- this._isLoading = false;-// this.render();- if( this.tree.options.autoFocus ) {- if( this === this.tree.tnRoot && this.childList && this.childList.length > 0) {- // special case: using ajaxInit- this.childList[0].focus();- } else {- this.focus();- }- }- break;- case DTNodeStatus_Loading:- this._isLoading = true;- $(this.span).addClass(this.tree.options.classNames.nodeLoading);- // The root is hidden, so we set a temporary status child- if(!this.parent){- this._setStatusNode({- title: this.tree.options.strings.loading + info,- tooltip: tooltip,- addClass: this.tree.options.classNames.nodeWait- });- }- break;- case DTNodeStatus_Error:- this._isLoading = false;-// $(this.span).addClass(this.tree.options.classNames.nodeError);- this._setStatusNode({- title: this.tree.options.strings.loadError + info,- tooltip: tooltip,- addClass: this.tree.options.classNames.nodeError- });- break;- default:- throw "Bad LazyNodeStatus: '" + lts + "'.";- }- },-- _parentList: function(includeRoot, includeSelf) {- var l = [];- var dtn = includeSelf ? this : this.parent;- while( dtn ) {- if( includeRoot || dtn.parent ){- l.unshift(dtn);- }- dtn = dtn.parent;- }- return l;- },- getLevel: function() {- /**- * Return node depth. 0: System root node, 1: visible top-level node.- */- var level = 0;- var dtn = this.parent;- while( dtn ) {- level++;- dtn = dtn.parent;- }- return level;- },-- _getTypeForOuterNodeEvent: function(event) {- /** Return the inner node span (title, checkbox or expander) if- * event.target points to the outer span.- * This function should fix issue #93:- * FF2 ignores empty spans, when generating events (returning the parent instead).- */- var cns = this.tree.options.classNames;- var target = event.target;- // Only process clicks on an outer node span (probably due to a FF2 event handling bug)- if( target.className.indexOf(cns.node) < 0 ) {- return null;- }- // Event coordinates, relative to outer node span:- var eventX = event.pageX - target.offsetLeft;- var eventY = event.pageY - target.offsetTop;-- for(var i=0, l=target.childNodes.length; i<l; i++) {- var cn = target.childNodes[i];- var x = cn.offsetLeft - target.offsetLeft;- var y = cn.offsetTop - target.offsetTop;- var nx = cn.clientWidth, ny = cn.clientHeight;-// alert (cn.className + ": " + x + ", " + y + ", s:" + nx + ", " + ny);- if( eventX >= x && eventX <= (x+nx) && eventY >= y && eventY <= (y+ny) ) {-// alert("HIT "+ cn.className);- if( cn.className==cns.title ){- return "title";- }else if( cn.className==cns.expander ){- return "expander";- }else if( cn.className==cns.checkbox ){- return "checkbox";- }else if( cn.className==cns.nodeIcon ){- return "icon";- }- }- }- return "prefix";- },-- getEventTargetType: function(event) {- // Return the part of a node, that a click event occured on.- // Note: there is no check, if the event was fired on THIS node.- var tcn = event && event.target ? event.target.className : "",- cns = this.tree.options.classNames;-- if( tcn === cns.title ){- return "title";- }else if( tcn === cns.expander ){- return "expander";- }else if( tcn === cns.checkbox ){- return "checkbox";- }else if( tcn === cns.nodeIcon ){- return "icon";- }else if( tcn === cns.empty || tcn === cns.vline || tcn === cns.connector ){- return "prefix";- }else if( tcn.indexOf(cns.node) >= 0 ){- // FIX issue #93- return this._getTypeForOuterNodeEvent(event);- }- return null;- },-- isVisible: function() {- // Return true, if all parents are expanded.- var parents = this._parentList(true, false);- for(var i=0, l=parents.length; i<l; i++){- if( ! parents[i].bExpanded ){ return false; }- }- return true;- },-- makeVisible: function() {- // Make sure, all parents are expanded- var parents = this._parentList(true, false);- for(var i=0, l=parents.length; i<l; i++){- parents[i]._expand(true);- }- },-- focus: function() {- // TODO: check, if we already have focus-// this.tree.logDebug("dtnode.focus(): %o", this);- this.makeVisible();- try {- $(this.span).find(">a").focus();- } catch(e) { }- },-- isFocused: function() {- return (this.tree.tnFocused === this);- },-- _activate: function(flag, fireEvents) {- // (De)Activate - but not focus - this node.- this.tree.logDebug("dtnode._activate(%o, fireEvents=%o) - %o", flag, fireEvents, this);- var opts = this.tree.options;- if( this.data.isStatusNode ){- return;- }- if ( fireEvents && opts.onQueryActivate && opts.onQueryActivate.call(this.tree, flag, this) === false ){- return; // Callback returned false- }- if( flag ) {- // Activate- if( this.tree.activeNode ) {- if( this.tree.activeNode === this ){- return;- }- this.tree.activeNode.deactivate();- }- if( opts.activeVisible ){- this.makeVisible();- }- this.tree.activeNode = this;- if( opts.persist ){- $.cookie(opts.cookieId+"-active", this.data.key, opts.cookie);- }- this.tree.persistence.activeKey = this.data.key;- $(this.span).addClass(opts.classNames.active);- if ( fireEvents && opts.onActivate ){- opts.onActivate.call(this.tree, this);- }- } else {- // Deactivate- if( this.tree.activeNode === this ) {- if ( opts.onQueryActivate && opts.onQueryActivate.call(this.tree, false, this) === false ){- return; // Callback returned false- }- $(this.span).removeClass(opts.classNames.active);- if( opts.persist ) {- // Note: we don't pass null, but ''. So the cookie is not deleted.- // If we pass null, we also have to pass a COPY of opts, because $cookie will override opts.expires (issue 84)- $.cookie(opts.cookieId+"-active", "", opts.cookie);- }- this.tree.persistence.activeKey = null;- this.tree.activeNode = null;- if ( fireEvents && opts.onDeactivate ){- opts.onDeactivate.call(this.tree, this);- }- }- }- },-- activate: function() {- // Select - but not focus - this node.-// this.tree.logDebug("dtnode.activate(): %o", this);- this._activate(true, true);- },-- activateSilently: function() {- this._activate(true, false);- },-- deactivate: function() {-// this.tree.logDebug("dtnode.deactivate(): %o", this);- this._activate(false, true);- },-- isActive: function() {- return (this.tree.activeNode === this);- },-- _userActivate: function() {- // Handle user click / [space] / [enter], according to clickFolderMode.- var activate = true;- var expand = false;- if ( this.data.isFolder ) {- switch( this.tree.options.clickFolderMode ) {- case 2:- activate = false;- expand = true;- break;- case 3:- activate = expand = true;- break;- }- }- if( this.parent === null ) {- expand = false;- }- if( expand ) {- this.toggleExpand();- this.focus();- }- if( activate ) {- this.activate();- }- },-- _setSubSel: function(hasSubSel) {- if( hasSubSel ) {- this.hasSubSel = true;- $(this.span).addClass(this.tree.options.classNames.partsel);- } else {- this.hasSubSel = false;- $(this.span).removeClass(this.tree.options.classNames.partsel);- }- },- /**- * Fix selection and partsel status, of parent nodes, according to current status of- * end nodes.- */- _updatePartSelectionState: function() {-// alert("_updatePartSelectionState " + this);-// this.tree.logDebug("_updatePartSelectionState() - %o", this);- var sel;- // Return `true` or `false` for end nodes and remove part-sel flag- if( ! this.hasChildren() ){- sel = (this.bSelected && !this.data.unselectable && !this.data.isStatusNode);- this._setSubSel(false);- return sel;- }- // Return `true`, `false`, or `undefined` for parent nodes- var i, l,- cl = this.childList,- allSelected = true,- allDeselected = true;- for(i=0, l=cl.length; i<l; i++) {- var n = cl[i],- s = n._updatePartSelectionState();- if( s !== false){- allDeselected = false;- }- if( s !== true){- allSelected = false;- }- }- if( allSelected ){- sel = true;- } else if ( allDeselected ){- sel = false;- } else {- sel = undefined;- }- this._setSubSel(sel === undefined);- this.bSelected = (sel === true);- return sel;- },-- /**- * Fix selection status, after this node was (de)selected in multi-hier mode.- * This includes (de)selecting all children.- */- _fixSelectionState: function() {-// alert("_fixSelectionState " + this);-// this.tree.logDebug("_fixSelectionState(%s) - %o", this.bSelected, this);- var p, i, l;- if( this.bSelected ) {- // Select all children- this.visit(function(node){- node.parent._setSubSel(true);- if(!node.data.unselectable){- node._select(true, false, false);- }- });- // Select parents, if all children are selected- p = this.parent;- while( p ) {- p._setSubSel(true);- var allChildsSelected = true;- for(i=0, l=p.childList.length; i<l; i++) {- var n = p.childList[i];- if( !n.bSelected && !n.data.isStatusNode && !n.data.unselectable) {- // issue 305 proposes this:-// if( !n.bSelected && !n.data.isStatusNode ) {- allChildsSelected = false;- break;- }- }- if( allChildsSelected ){- p._select(true, false, false);- }- p = p.parent;- }- } else {- // Deselect all children- this._setSubSel(false);- this.visit(function(node){- node._setSubSel(false);- node._select(false, false, false);- });- // Deselect parents, and recalc hasSubSel- p = this.parent;- while( p ) {- p._select(false, false, false);- var isPartSel = false;- for(i=0, l=p.childList.length; i<l; i++) {- if( p.childList[i].bSelected || p.childList[i].hasSubSel ) {- isPartSel = true;- break;- }- }- p._setSubSel(isPartSel);- p = p.parent;- }- }- },-- _select: function(sel, fireEvents, deep) {- // Select - but not focus - this node.-// this.tree.logDebug("dtnode._select(%o) - %o", sel, this);- var opts = this.tree.options;- if( this.data.isStatusNode ){- return;- }- //- if( this.bSelected === sel ) {-// this.tree.logDebug("dtnode._select(%o) IGNORED - %o", sel, this);- return;- }- // Allow event listener to abort selection- if ( fireEvents && opts.onQuerySelect && opts.onQuerySelect.call(this.tree, sel, this) === false ){- return; // Callback returned false- }- // Force single-selection- if( opts.selectMode==1 && sel ) {- this.tree.visit(function(node){- if( node.bSelected ) {- // Deselect; assuming that in selectMode:1 there's max. one other selected node- node._select(false, false, false);- return false;- }- });- }-- this.bSelected = sel;-// this.tree._changeNodeList("select", this, sel);-- if( sel ) {- if( opts.persist ){- this.tree.persistence.addSelect(this.data.key);- }- $(this.span).addClass(opts.classNames.selected);-- if( deep && opts.selectMode === 3 ){- this._fixSelectionState();- }- if ( fireEvents && opts.onSelect ){- opts.onSelect.call(this.tree, true, this);- }- } else {- if( opts.persist ){- this.tree.persistence.clearSelect(this.data.key);- }- $(this.span).removeClass(opts.classNames.selected);-- if( deep && opts.selectMode === 3 ){- this._fixSelectionState();- }- if ( fireEvents && opts.onSelect ){- opts.onSelect.call(this.tree, false, this);- }- }- },-- select: function(sel) {- // Select - but not focus - this node.-// this.tree.logDebug("dtnode.select(%o) - %o", sel, this);- if( this.data.unselectable ){- return this.bSelected;- }- return this._select(sel!==false, true, true);- },-- toggleSelect: function() {-// this.tree.logDebug("dtnode.toggleSelect() - %o", this);- return this.select(!this.bSelected);- },-- isSelected: function() {- return this.bSelected;- },-- isLazy: function() {- return !!this.data.isLazy;- },-- _loadContent: function() {- try {- var opts = this.tree.options;- this.tree.logDebug("_loadContent: start - %o", this);- this.setLazyNodeStatus(DTNodeStatus_Loading);- if( true === opts.onLazyRead.call(this.tree, this) ) {- // If function returns 'true', we assume that the loading is done:- this.setLazyNodeStatus(DTNodeStatus_Ok);- // Otherwise (i.e. if the loading was started as an asynchronous process)- // the onLazyRead(dtnode) handler is expected to call dtnode.setLazyNodeStatus(DTNodeStatus_Ok/_Error) when done.- this.tree.logDebug("_loadContent: succeeded - %o", this);- }- } catch(e) {- this.tree.logWarning("_loadContent: failed - %o", e);- this.setLazyNodeStatus(DTNodeStatus_Error, {tooltip: ""+e});- }- },-- _expand: function(bExpand, forceSync) {- if( this.bExpanded === bExpand ) {- this.tree.logDebug("dtnode._expand(%o) IGNORED - %o", bExpand, this);- return;- }- this.tree.logDebug("dtnode._expand(%o) - %o", bExpand, this);- var opts = this.tree.options;- if( !bExpand && this.getLevel() < opts.minExpandLevel ) {- this.tree.logDebug("dtnode._expand(%o) prevented collapse - %o", bExpand, this);- return;- }- if ( opts.onQueryExpand && opts.onQueryExpand.call(this.tree, bExpand, this) === false ){- return; // Callback returned false- }- this.bExpanded = bExpand;-- // Persist expand state- if( opts.persist ) {- if( bExpand ){- this.tree.persistence.addExpand(this.data.key);- }else{- this.tree.persistence.clearExpand(this.data.key);- }- }- // Do not apply animations in init phase, or before lazy-loading- var allowEffects = !(this.data.isLazy && this.childList === null)- && !this._isLoading- && !forceSync;- this.render(allowEffects);-- // Auto-collapse mode: collapse all siblings- if( this.bExpanded && this.parent && opts.autoCollapse ) {- var parents = this._parentList(false, true);- for(var i=0, l=parents.length; i<l; i++){- parents[i].collapseSiblings();- }- }- // If the currently active node is now hidden, deactivate it- if( opts.activeVisible && this.tree.activeNode && ! this.tree.activeNode.isVisible() ) {- this.tree.activeNode.deactivate();- }- // Expanding a lazy node: set 'loading...' and call callback- if( bExpand && this.data.isLazy && this.childList === null && !this._isLoading ) {- this._loadContent();- return;- }- if ( opts.onExpand ){- opts.onExpand.call(this.tree, bExpand, this);- }- },-- isExpanded: function() {- return this.bExpanded;- },-- expand: function(flag) {- flag = (flag !== false);- if( !this.childList && !this.data.isLazy && flag ){- return; // Prevent expanding empty nodes- } else if( this.parent === null && !flag ){- return; // Prevent collapsing the root- }- this._expand(flag);- },-- scheduleAction: function(mode, ms) {- /** Schedule activity for delayed execution (cancel any pending request).- * scheduleAction('cancel') will cancel the request.- */- if( this.tree.timer ) {- clearTimeout(this.tree.timer);- this.tree.logDebug("clearTimeout(%o)", this.tree.timer);- }- var self = this; // required for closures- switch (mode) {- case "cancel":- // Simply made sure that timer was cleared- break;- case "expand":- this.tree.timer = setTimeout(function(){- self.tree.logDebug("setTimeout: trigger expand");- self.expand(true);- }, ms);- break;- case "activate":- this.tree.timer = setTimeout(function(){- self.tree.logDebug("setTimeout: trigger activate");- self.activate();- }, ms);- break;- default:- throw "Invalid mode " + mode;- }- this.tree.logDebug("setTimeout(%s, %s): %s", mode, ms, this.tree.timer);- },-- toggleExpand: function() {- this.expand(!this.bExpanded);- },-- collapseSiblings: function() {- if( this.parent === null ){- return;- }- var ac = this.parent.childList;- for (var i=0, l=ac.length; i<l; i++) {- if ( ac[i] !== this && ac[i].bExpanded ){- ac[i]._expand(false);- }- }- },-- _onClick: function(event) {-// this.tree.logDebug("dtnode.onClick(" + event.type + "): dtnode:" + this + ", button:" + event.button + ", which: " + event.which);- var targetType = this.getEventTargetType(event);- if( targetType === "expander" ) {- // Clicking the expander icon always expands/collapses- this.toggleExpand();- this.focus(); // issue 95- } else if( targetType === "checkbox" ) {- // Clicking the checkbox always (de)selects- this.toggleSelect();- this.focus(); // issue 95- } else {- this._userActivate();- var aTag = this.span.getElementsByTagName("a");- if(aTag[0]){- // issue 154, 313- if(!($.browser.msie && parseInt($.browser.version, 10) < 9)){- aTag[0].focus();- }- }else{- // 'noLink' option was set- return true;- }- }- // Make sure that clicks stop, otherwise <a href='#'> jumps to the top- event.preventDefault();- },-- _onDblClick: function(event) {-// this.tree.logDebug("dtnode.onDblClick(" + event.type + "): dtnode:" + this + ", button:" + event.button + ", which: " + event.which);- },-- _onKeydown: function(event) {-// this.tree.logDebug("dtnode.onKeydown(" + event.type + "): dtnode:" + this + ", charCode:" + event.charCode + ", keyCode: " + event.keyCode + ", which: " + event.which);- var handled = true,- sib;-// alert("keyDown" + event.which);-- switch( event.which ) {- // charCodes:-// case 43: // '+'- case 107: // '+'- case 187: // '+' @ Chrome, Safari- if( !this.bExpanded ){ this.toggleExpand(); }- break;-// case 45: // '-'- case 109: // '-'- case 189: // '+' @ Chrome, Safari- if( this.bExpanded ){ this.toggleExpand(); }- break;- //~ case 42: // '*'- //~ break;- //~ case 47: // '/'- //~ break;- // case 13: // <enter>- // <enter> on a focused <a> tag seems to generate a click-event.- // this._userActivate();- // break;- case 32: // <space>- this._userActivate();- break;- case 8: // <backspace>- if( this.parent ){- this.parent.focus();- }- break;- case 37: // <left>- if( this.bExpanded ) {- this.toggleExpand();- this.focus();-// } else if( this.parent && (this.tree.options.rootVisible || this.parent.parent) ) {- } else if( this.parent && this.parent.parent ) {- this.parent.focus();- }- break;- case 39: // <right>- if( !this.bExpanded && (this.childList || this.data.isLazy) ) {- this.toggleExpand();- this.focus();- } else if( this.childList ) {- this.childList[0].focus();- }- break;- case 38: // <up>- sib = this.getPrevSibling();- while( sib && sib.bExpanded && sib.childList ){- sib = sib.childList[sib.childList.length-1];- }-// if( !sib && this.parent && (this.tree.options.rootVisible || this.parent.parent) )- if( !sib && this.parent && this.parent.parent ){- sib = this.parent;- }- if( sib ){- sib.focus();- }- break;- case 40: // <down>- if( this.bExpanded && this.childList ) {- sib = this.childList[0];- } else {- var parents = this._parentList(false, true);- for(var i=parents.length-1; i>=0; i--) {- sib = parents[i].getNextSibling();- if( sib ){ break; }- }- }- if( sib ){- sib.focus();- }- break;- default:- handled = false;- }- // Return false, if handled, to prevent default processing-// return !handled;- if(handled){- event.preventDefault();- }- },-- _onKeypress: function(event) {- // onKeypress is only hooked to allow user callbacks.- // We don't process it, because IE and Safari don't fire keypress for cursor keys.-// this.tree.logDebug("dtnode.onKeypress(" + event.type + "): dtnode:" + this + ", charCode:" + event.charCode + ", keyCode: " + event.keyCode + ", which: " + event.which);- },-- _onFocus: function(event) {- // Handles blur and focus events.-// this.tree.logDebug("dtnode._onFocus(%o): %o", event, this);- var opts = this.tree.options;- if ( event.type == "blur" || event.type == "focusout" ) {- if ( opts.onBlur ){- opts.onBlur.call(this.tree, this);- }- if( this.tree.tnFocused ){- $(this.tree.tnFocused.span).removeClass(opts.classNames.focused);- }- this.tree.tnFocused = null;- if( opts.persist ){- $.cookie(opts.cookieId+"-focus", "", opts.cookie);- }- } else if ( event.type=="focus" || event.type=="focusin") {- // Fix: sometimes the blur event is not generated- if( this.tree.tnFocused && this.tree.tnFocused !== this ) {- this.tree.logDebug("dtnode.onFocus: out of sync: curFocus: %o", this.tree.tnFocused);- $(this.tree.tnFocused.span).removeClass(opts.classNames.focused);- }- this.tree.tnFocused = this;- if ( opts.onFocus ){- opts.onFocus.call(this.tree, this);- }- $(this.tree.tnFocused.span).addClass(opts.classNames.focused);- if( opts.persist ){- $.cookie(opts.cookieId+"-focus", this.data.key, opts.cookie);- }- }- // TODO: return anything?-// return false;- },-- visit: function(fn, includeSelf) {- // Call fn(node) for all child nodes. Stop iteration, if fn() returns false.- var res = true;- if( includeSelf === true ) {- res = fn(this);- if( res === false || res == "skip" ){- return res;- }- }- if(this.childList){- for(var i=0, l=this.childList.length; i<l; i++){- res = this.childList[i].visit(fn, true);- if( res === false ){- break;- }- }- }- return res;- },-- visitParents: function(fn, includeSelf) {- // Visit parent nodes (bottom up)- if(includeSelf && fn(this) === false){- return false;- }- var p = this.parent;- while( p ) {- if(fn(p) === false){- return false;- }- p = p.parent;- }- return true;- },-- remove: function() {- // Remove this node-// this.tree.logDebug ("%s.remove()", this);- if ( this === this.tree.root ){- throw "Cannot remove system root";- }- return this.parent.removeChild(this);- },-- removeChild: function(tn) {- // Remove tn from list of direct children.- var ac = this.childList;- if( ac.length == 1 ) {- if( tn !== ac[0] ){- throw "removeChild: invalid child";- }- return this.removeChildren();- }- if( tn === this.tree.activeNode ){- tn.deactivate();- }- if( this.tree.options.persist ) {- if( tn.bSelected ){- this.tree.persistence.clearSelect(tn.data.key);- }- if ( tn.bExpanded ){- this.tree.persistence.clearExpand(tn.data.key);- }- }- tn.removeChildren(true);-// this.div.removeChild(tn.div);- this.ul.removeChild(tn.li);- for(var i=0, l=ac.length; i<l; i++) {- if( ac[i] === tn ) {- this.childList.splice(i, 1);-// delete tn; // JSLint complained- break;- }- }- },-- removeChildren: function(isRecursiveCall, retainPersistence) {- // Remove all child nodes (more efficiently than recursive remove())- this.tree.logDebug("%s.removeChildren(%o)", this, isRecursiveCall);- var tree = this.tree;- var ac = this.childList;- if( ac ) {- for(var i=0, l=ac.length; i<l; i++) {- var tn = ac[i];- if ( tn === tree.activeNode && !retainPersistence ){- tn.deactivate();- }- if( this.tree.options.persist && !retainPersistence ) {- if( tn.bSelected ){- this.tree.persistence.clearSelect(tn.data.key);- }- if ( tn.bExpanded ){- this.tree.persistence.clearExpand(tn.data.key);- }- }- tn.removeChildren(true, retainPersistence);- if(this.ul){-// this.ul.removeChild(tn.li);- $("li", $(this.ul)).remove(); // issue 231- }-// delete tn; JSLint complained- }- // Set to 'null' which is interpreted as 'not yet loaded' for lazy- // nodes- this.childList = null;- }- if( ! isRecursiveCall ) {-// this._expand(false);-// this.isRead = false;- this._isLoading = false;- this.render();- }- },-- setTitle: function(title) {- this.fromDict({title: title});- },-- reload: function(force) {- throw "Use reloadChildren() instead";- },-- reloadChildren: function(callback) {- // Reload lazy content (expansion state is maintained).- if( this.parent === null ){- throw "Use tree.reload() instead";- }else if( ! this.data.isLazy ){- throw "node.reloadChildren() requires lazy nodes.";- }- // appendAjax triggers 'nodeLoaded' event.- // We listen to this, if a callback was passed to reloadChildren- if(callback){- var self = this;- var eventType = "nodeLoaded.dynatree." + this.tree.$tree.attr("id")- + "." + this.data.key;- this.tree.$tree.bind(eventType, function(e, node, isOk){- self.tree.$tree.unbind(eventType);- self.tree.logDebug("loaded %o, %o, %o", e, node, isOk);- if(node !== self){- throw "got invalid load event";- }- callback.call(self.tree, node, isOk);- });- }- // The expansion state is maintained- this.removeChildren();- this._loadContent();-// if( this.bExpanded ) {-// // Remove children first, to prevent effects being applied-// this.removeChildren();-// // then force re-expand to trigger lazy loading-//// this.expand(false);-//// this.expand(true);-// this._loadContent();-// } else {-// this.removeChildren();-// this._loadContent();-// }- },-- /**- * Make sure the node with a given key path is available in the tree.- */- _loadKeyPath: function(keyPath, callback) {- var tree = this.tree;- tree.logDebug("%s._loadKeyPath(%s)", this, keyPath);- if(keyPath === ""){- throw "Key path must not be empty";- }- var segList = keyPath.split(tree.options.keyPathSeparator);- if(segList[0] === ""){- throw "Key path must be relative (don't start with '/')";- }- var seg = segList.shift();- if(this.childList){- for(var i=0, l=this.childList.length; i < l; i++){- var child = this.childList[i];- if( child.data.key === seg ){- if(segList.length === 0) {- // Found the end node- callback.call(tree, child, "ok");-- }else if(child.data.isLazy && (child.childList === null || child.childList === undefined)){- tree.logDebug("%s._loadKeyPath(%s) -> reloading %s...", this, keyPath, child);- var self = this;- // Note: this line gives a JSLint warning (Don't make functions within a loop)- /*jshint loopfunc:true */- child.reloadChildren(function(node, isOk){- // After loading, look for direct child with that key- if(isOk){- tree.logDebug("%s._loadKeyPath(%s) -> reloaded %s.", node, keyPath, node);- callback.call(tree, child, "loaded");- node._loadKeyPath(segList.join(tree.options.keyPathSeparator), callback);- }else{- tree.logWarning("%s._loadKeyPath(%s) -> reloadChildren() failed.", self, keyPath);- callback.call(tree, child, "error");- }- });- // we can ignore it, since it will only be exectuted once, the the loop is ended- // See also http://stackoverflow.com/questions/3037598/how-to-get-around-the-jslint-error-dont-make-functions-within-a-loop- } else {- callback.call(tree, child, "loaded");- // Look for direct child with that key- child._loadKeyPath(segList.join(tree.options.keyPathSeparator), callback);- }- return;- }- }- }- // Could not find key- // Callback params: child: undefined, the segment, isEndNode (segList.length === 0)- callback.call(tree, undefined, "notfound", seg, segList.length === 0);- tree.logWarning("Node not found: " + seg);- return;- },-- resetLazy: function() {- // Discard lazy content.- if( this.parent === null ){- throw "Use tree.reload() instead";- }else if( ! this.data.isLazy ){- throw "node.resetLazy() requires lazy nodes.";- }- this.expand(false);- this.removeChildren();- },-- _addChildNode: function(dtnode, beforeNode) {- /**- * Internal function to add one single DynatreeNode as a child.- *- */- var tree = this.tree,- opts = tree.options,- pers = tree.persistence;--// tree.logDebug("%s._addChildNode(%o)", this, dtnode);-- // --- Update and fix dtnode attributes if necessary- dtnode.parent = this;-// if( beforeNode && (beforeNode.parent !== this || beforeNode === dtnode ) )-// throw "<beforeNode> must be another child of <this>";-- // --- Add dtnode as a child- if ( this.childList === null ) {- this.childList = [];- } else if( ! beforeNode ) {- // Fix 'lastsib'- if(this.childList.length > 0) {- $(this.childList[this.childList.length-1].span).removeClass(opts.classNames.lastsib);- }- }- if( beforeNode ) {- var iBefore = $.inArray(beforeNode, this.childList);- if( iBefore < 0 ){- throw "<beforeNode> must be a child of <this>";- }- this.childList.splice(iBefore, 0, dtnode);- } else {- // Append node- this.childList.push(dtnode);- }-- // --- Handle persistence- // Initial status is read from cookies, if persistence is active and- // cookies are already present.- // Otherwise the status is read from the data attributes and then persisted.- var isInitializing = tree.isInitializing();- if( opts.persist && pers.cookiesFound && isInitializing ) {- // Init status from cookies-// tree.logDebug("init from cookie, pa=%o, dk=%o", pers.activeKey, dtnode.data.key);- if( pers.activeKey === dtnode.data.key ){- tree.activeNode = dtnode;- }- if( pers.focusedKey === dtnode.data.key ){- tree.focusNode = dtnode;- }- dtnode.bExpanded = ($.inArray(dtnode.data.key, pers.expandedKeyList) >= 0);- dtnode.bSelected = ($.inArray(dtnode.data.key, pers.selectedKeyList) >= 0);-// tree.logDebug(" key=%o, bSelected=%o", dtnode.data.key, dtnode.bSelected);- } else {- // Init status from data (Note: we write the cookies after the init phase)-// tree.logDebug("init from data");- if( dtnode.data.activate ) {- tree.activeNode = dtnode;- if( opts.persist ){- pers.activeKey = dtnode.data.key;- }- }- if( dtnode.data.focus ) {- tree.focusNode = dtnode;- if( opts.persist ){- pers.focusedKey = dtnode.data.key;- }- }- dtnode.bExpanded = ( dtnode.data.expand === true ); // Collapsed by default- if( dtnode.bExpanded && opts.persist ){- pers.addExpand(dtnode.data.key);- }- dtnode.bSelected = ( dtnode.data.select === true ); // Deselected by default-/*- Doesn't work, cause pers.selectedKeyList may be null- if( dtnode.bSelected && opts.selectMode==1- && pers.selectedKeyList && pers.selectedKeyList.length>0 ) {- tree.logWarning("Ignored multi-selection in single-mode for %o", dtnode);- dtnode.bSelected = false; // Fixing bad input data (multi selection for mode:1)- }-*/- if( dtnode.bSelected && opts.persist ){- pers.addSelect(dtnode.data.key);- }- }-- // Always expand, if it's below minExpandLevel-// tree.logDebug ("%s._addChildNode(%o), l=%o", this, dtnode, dtnode.getLevel());- if ( opts.minExpandLevel >= dtnode.getLevel() ) {-// tree.logDebug ("Force expand for %o", dtnode);- this.bExpanded = true;- }-- // In multi-hier mode, update the parents selection state- // issue #82: only if not initializing, because the children may not exist yet-// if( !dtnode.data.isStatusNode && opts.selectMode==3 && !isInitializing )-// dtnode._fixSelectionState();-- // In multi-hier mode, update the parents selection state- if( dtnode.bSelected && opts.selectMode==3 ) {- var p = this;- while( p ) {- if( !p.hasSubSel ){- p._setSubSel(true);- }- p = p.parent;- }- }- // render this node and the new child- if ( tree.bEnableUpdate ){- this.render();- }- return dtnode;- },-- addChild: function(obj, beforeNode) {- /**- * Add a node object as child.- *- * This should be the only place, where a DynaTreeNode is constructed!- * (Except for the root node creation in the tree constructor)- *- * @param obj A JS object (may be recursive) or an array of those.- * @param {DynaTreeNode} beforeNode (optional) sibling node.- *- * Data format: array of node objects, with optional 'children' attributes.- * [- * { title: "t1", isFolder: true, ... }- * { title: "t2", isFolder: true, ...,- * children: [- * {title: "t2.1", ..},- * {..}- * ]- * }- * ]- * A simple object is also accepted instead of an array.- *- */-// this.tree.logDebug("%s.addChild(%o, %o)", this, obj, beforeNode);- if(typeof(obj) == "string"){- throw "Invalid data type for " + obj;- }else if( !obj || obj.length === 0 ){ // Passed null or undefined or empty array- return;- }else if( obj instanceof DynaTreeNode ){- return this._addChildNode(obj, beforeNode);- }-- if( !obj.length ){ // Passed a single data object- obj = [ obj ];- }- var prevFlag = this.tree.enableUpdate(false);-- var tnFirst = null;- for (var i=0, l=obj.length; i<l; i++) {- var data = obj[i];- var dtnode = this._addChildNode(new DynaTreeNode(this, this.tree, data), beforeNode);- if( !tnFirst ){- tnFirst = dtnode;- }- // Add child nodes recursively- if( data.children ){- dtnode.addChild(data.children, null);- }- }- this.tree.enableUpdate(prevFlag);- return tnFirst;- },-- append: function(obj) {- this.tree.logWarning("node.append() is deprecated (use node.addChild() instead).");- return this.addChild(obj, null);- },-- appendAjax: function(ajaxOptions) {- var self = this;- this.removeChildren(false, true);- this.setLazyNodeStatus(DTNodeStatus_Loading);- // Debug feature: force a delay, to simulate slow loading...- if(ajaxOptions.debugLazyDelay){- var ms = ajaxOptions.debugLazyDelay;- ajaxOptions.debugLazyDelay = 0;- this.tree.logInfo("appendAjax: waiting for debugLazyDelay " + ms);- setTimeout(function(){self.appendAjax(ajaxOptions);}, ms);- return;- }- // Ajax option inheritance: $.ajaxSetup < $.ui.dynatree.prototype.options.ajaxDefaults < tree.options.ajaxDefaults < ajaxOptions- var orgSuccess = ajaxOptions.success,- orgError = ajaxOptions.error,- eventType = "nodeLoaded.dynatree." + this.tree.$tree.attr("id") + "." + this.data.key;- var options = $.extend({}, this.tree.options.ajaxDefaults, ajaxOptions, {- success: function(data, textStatus, jqXHR){- // <this> is the request options-// self.tree.logDebug("appendAjax().success");- var prevPhase = self.tree.phase;- self.tree.phase = "init";- // postProcess is similar to the standard dataFilter hook,- // but it is also called for JSONP- if( options.postProcess ){- data = options.postProcess.call(this, data, this.dataType);- }- // Process ASPX WebMethod JSON object inside "d" property- // http://code.google.com/p/dynatree/issues/detail?id=202- else if (data && data.hasOwnProperty("d")) {- data = (typeof data.d) == "string" ? $.parseJSON(data.d) : data.d;- }- if(!$.isArray(data) || data.length !== 0){- self.addChild(data, null);- }- self.tree.phase = "postInit";- if( orgSuccess ){- orgSuccess.call(options, self, data, textStatus);- }- self.tree.logDebug("trigger " + eventType);- self.tree.$tree.trigger(eventType, [self, true]);- self.tree.phase = prevPhase;- // This should be the last command, so node._isLoading is true- // while the callbacks run- self.setLazyNodeStatus(DTNodeStatus_Ok);- if($.isArray(data) && data.length === 0){- // Set to [] which is interpreted as 'no children' for lazy- // nodes- self.childList = [];- self.render();- }- },- error: function(jqXHR, textStatus, errorThrown){- // <this> is the request options- self.tree.logWarning("appendAjax failed:", textStatus, ":\n", jqXHR, "\n", errorThrown);- if( orgError ){- orgError.call(options, self, jqXHR, textStatus, errorThrown);- }- self.tree.$tree.trigger(eventType, [self, false]);- self.setLazyNodeStatus(DTNodeStatus_Error, {info: textStatus, tooltip: "" + errorThrown});- }- });- $.ajax(options);- },-- move: function(targetNode, mode) {- /**Move this node to targetNode.- * mode 'child': append this node as last child of targetNode.- * This is the default. To be compatble with the D'n'd- * hitMode, we also accept 'over'.- * mode 'before': add this node as sibling before targetNode.- * mode 'after': add this node as sibling after targetNode.- */- var pos;- if(this === targetNode){- return;- }- if( !this.parent ){- throw "Cannot move system root";- }- if(mode === undefined || mode == "over"){- mode = "child";- }- var prevParent = this.parent;- var targetParent = (mode === "child") ? targetNode : targetNode.parent;- if( targetParent.isDescendantOf(this) ){- throw "Cannot move a node to it's own descendant";- }- // Unlink this node from current parent- if( this.parent.childList.length == 1 ) {- this.parent.childList = this.parent.data.isLazy ? [] : null;- this.parent.bExpanded = false;- } else {- pos = $.inArray(this, this.parent.childList);- if( pos < 0 ){- throw "Internal error";- }- this.parent.childList.splice(pos, 1);- }- // Remove from source DOM parent- if(this.parent.ul){- this.parent.ul.removeChild(this.li);- }-- // Insert this node to target parent's child list- this.parent = targetParent;- if( targetParent.hasChildren() ) {- switch(mode) {- case "child":- // Append to existing target children- targetParent.childList.push(this);- break;- case "before":- // Insert this node before target node- pos = $.inArray(targetNode, targetParent.childList);- if( pos < 0 ){- throw "Internal error";- }- targetParent.childList.splice(pos, 0, this);- break;- case "after":- // Insert this node after target node- pos = $.inArray(targetNode, targetParent.childList);- if( pos < 0 ){- throw "Internal error";- }- targetParent.childList.splice(pos+1, 0, this);- break;- default:- throw "Invalid mode " + mode;- }- } else {- targetParent.childList = [ this ];- }- // Parent has no <ul> tag yet:- if( !targetParent.ul ) {- // This is the parent's first child: create UL tag- // (Hidden, because it will be- targetParent.ul = document.createElement("ul");- targetParent.ul.style.display = "none";- targetParent.li.appendChild(targetParent.ul);- }- // Issue 319: Add to target DOM parent (only if node was already rendered(expanded))- if(this.li){- targetParent.ul.appendChild(this.li);- }-- if( this.tree !== targetNode.tree ) {- // Fix node.tree for all source nodes- this.visit(function(node){- node.tree = targetNode.tree;- }, null, true);- throw "Not yet implemented.";- }- // TODO: fix selection state- // TODO: fix active state- if( !prevParent.isDescendantOf(targetParent)) {- prevParent.render();- }- if( !targetParent.isDescendantOf(prevParent) ) {- targetParent.render();- }-// this.tree.redraw();-/*- var tree = this.tree;- var opts = tree.options;- var pers = tree.persistence;--- // Always expand, if it's below minExpandLevel-// tree.logDebug ("%s._addChildNode(%o), l=%o", this, dtnode, dtnode.getLevel());- if ( opts.minExpandLevel >= dtnode.getLevel() ) {-// tree.logDebug ("Force expand for %o", dtnode);- this.bExpanded = true;- }-- // In multi-hier mode, update the parents selection state- // issue #82: only if not initializing, because the children may not exist yet-// if( !dtnode.data.isStatusNode && opts.selectMode==3 && !isInitializing )-// dtnode._fixSelectionState();-- // In multi-hier mode, update the parents selection state- if( dtnode.bSelected && opts.selectMode==3 ) {- var p = this;- while( p ) {- if( !p.hasSubSel )- p._setSubSel(true);- p = p.parent;- }- }- // render this node and the new child- if ( tree.bEnableUpdate )- this.render();-- return dtnode;--*/- },-- // --- end of class- lastentry: undefined-};--/*************************************************************************- * class DynaTreeStatus- */--var DynaTreeStatus = Class.create();---DynaTreeStatus._getTreePersistData = function(cookieId, cookieOpts) {- // Static member: Return persistence information from cookies- var ts = new DynaTreeStatus(cookieId, cookieOpts);- ts.read();- return ts.toDict();-};-// Make available in global scope-getDynaTreePersistData = DynaTreeStatus._getTreePersistData; // TODO: deprecated---DynaTreeStatus.prototype = {- // Constructor- initialize: function(cookieId, cookieOpts) {-// this._log("DynaTreeStatus: initialize");- if( cookieId === undefined ){- cookieId = $.ui.dynatree.prototype.options.cookieId;- }- cookieOpts = $.extend({}, $.ui.dynatree.prototype.options.cookie, cookieOpts);-- this.cookieId = cookieId;- this.cookieOpts = cookieOpts;- this.cookiesFound = undefined;- this.activeKey = null;- this.focusedKey = null;- this.expandedKeyList = null;- this.selectedKeyList = null;- },- // member functions- _log: function(msg) {- // this.logDebug("_changeNodeList(%o): nodeList:%o, idx:%o", mode, nodeList, idx);- Array.prototype.unshift.apply(arguments, ["debug"]);- _log.apply(this, arguments);- },- read: function() {-// this._log("DynaTreeStatus: read");- // Read or init cookies.- this.cookiesFound = false;-- var cookie = $.cookie(this.cookieId + "-active");- this.activeKey = ( cookie === null ) ? "" : cookie;- if( cookie !== null ){- this.cookiesFound = true;- }- cookie = $.cookie(this.cookieId + "-focus");- this.focusedKey = ( cookie === null ) ? "" : cookie;- if( cookie !== null ){- this.cookiesFound = true;- }- cookie = $.cookie(this.cookieId + "-expand");- this.expandedKeyList = ( cookie === null ) ? [] : cookie.split(",");- if( cookie !== null ){- this.cookiesFound = true;- }- cookie = $.cookie(this.cookieId + "-select");- this.selectedKeyList = ( cookie === null ) ? [] : cookie.split(",");- if( cookie !== null ){- this.cookiesFound = true;- }- },- write: function() {-// this._log("DynaTreeStatus: write");- $.cookie(this.cookieId + "-active", ( this.activeKey === null ) ? "" : this.activeKey, this.cookieOpts);- $.cookie(this.cookieId + "-focus", ( this.focusedKey === null ) ? "" : this.focusedKey, this.cookieOpts);- $.cookie(this.cookieId + "-expand", ( this.expandedKeyList === null ) ? "" : this.expandedKeyList.join(","), this.cookieOpts);- $.cookie(this.cookieId + "-select", ( this.selectedKeyList === null ) ? "" : this.selectedKeyList.join(","), this.cookieOpts);- },- addExpand: function(key) {-// this._log("addExpand(%o)", key);- if( $.inArray(key, this.expandedKeyList) < 0 ) {- this.expandedKeyList.push(key);- $.cookie(this.cookieId + "-expand", this.expandedKeyList.join(","), this.cookieOpts);- }- },- clearExpand: function(key) {-// this._log("clearExpand(%o)", key);- var idx = $.inArray(key, this.expandedKeyList);- if( idx >= 0 ) {- this.expandedKeyList.splice(idx, 1);- $.cookie(this.cookieId + "-expand", this.expandedKeyList.join(","), this.cookieOpts);- }- },- addSelect: function(key) {-// this._log("addSelect(%o)", key);- if( $.inArray(key, this.selectedKeyList) < 0 ) {- this.selectedKeyList.push(key);- $.cookie(this.cookieId + "-select", this.selectedKeyList.join(","), this.cookieOpts);- }- },- clearSelect: function(key) {-// this._log("clearSelect(%o)", key);- var idx = $.inArray(key, this.selectedKeyList);- if( idx >= 0 ) {- this.selectedKeyList.splice(idx, 1);- $.cookie(this.cookieId + "-select", this.selectedKeyList.join(","), this.cookieOpts);- }- },- isReloading: function() {- return this.cookiesFound === true;- },- toDict: function() {- return {- cookiesFound: this.cookiesFound,- activeKey: this.activeKey,- focusedKey: this.activeKey,- expandedKeyList: this.expandedKeyList,- selectedKeyList: this.selectedKeyList- };- },- // --- end of class- lastentry: undefined-};---/*************************************************************************- * class DynaTree- */--var DynaTree = Class.create();--// --- Static members ------------------------------------------------------------DynaTree.version = "$Version:$";--/*-DynaTree._initTree = function() {-};--DynaTree._bind = function() {-};-*/-//--- Class members --------------------------------------------------------------DynaTree.prototype = {- // Constructor-// initialize: function(divContainer, options) {- initialize: function($widget) {- // instance members- this.phase = "init";- this.$widget = $widget;- this.options = $widget.options;- this.$tree = $widget.element;- this.timer = null;- // find container element- this.divTree = this.$tree.get(0);--// var parentPos = $(this.divTree).parent().offset();-// this.parentTop = parentPos.top;-// this.parentLeft = parentPos.left;-- _initDragAndDrop(this);- },-- // member functions-- _load: function(callback) {- var $widget = this.$widget;- var opts = this.options,- self = this;- this.bEnableUpdate = true;- this._nodeCount = 1;- this.activeNode = null;- this.focusNode = null;-- // Some deprecation warnings to help with migration- if( opts.rootVisible !== undefined ){- this.logWarning("Option 'rootVisible' is no longer supported.");- }- if( opts.minExpandLevel < 1 ) {- this.logWarning("Option 'minExpandLevel' must be >= 1.");- opts.minExpandLevel = 1;- }-// _log("warn", "jQuery.support.boxModel " + jQuery.support.boxModel);-- // If a 'options.classNames' dictionary was passed, still use defaults- // for undefined classes:- if( opts.classNames !== $.ui.dynatree.prototype.options.classNames ) {- opts.classNames = $.extend({}, $.ui.dynatree.prototype.options.classNames, opts.classNames);- }- if( opts.ajaxDefaults !== $.ui.dynatree.prototype.options.ajaxDefaults ) {- opts.ajaxDefaults = $.extend({}, $.ui.dynatree.prototype.options.ajaxDefaults, opts.ajaxDefaults);- }- if( opts.dnd !== $.ui.dynatree.prototype.options.dnd ) {- opts.dnd = $.extend({}, $.ui.dynatree.prototype.options.dnd, opts.dnd);- }- // Guess skin path, if not specified- if(!opts.imagePath) {- $("script").each( function () {- var _rexDtLibName = /.*dynatree[^\/]*\.js$/i;- if( this.src.search(_rexDtLibName) >= 0 ) {- if( this.src.indexOf("/")>=0 ){ // issue #47- opts.imagePath = this.src.slice(0, this.src.lastIndexOf("/")) + "/skin/";- }else{- opts.imagePath = "skin/";- }- self.logDebug("Guessing imagePath from '%s': '%s'", this.src, opts.imagePath);- return false; // first match- }- });- }-- this.persistence = new DynaTreeStatus(opts.cookieId, opts.cookie);- if( opts.persist ) {- if( !$.cookie ){- _log("warn", "Please include jquery.cookie.js to use persistence.");- }- this.persistence.read();- }- this.logDebug("DynaTree.persistence: %o", this.persistence.toDict());-- // Cached tag strings- this.cache = {- tagEmpty: "<span class='" + opts.classNames.empty + "'></span>",- tagVline: "<span class='" + opts.classNames.vline + "'></span>",- tagExpander: "<span class='" + opts.classNames.expander + "'></span>",- tagConnector: "<span class='" + opts.classNames.connector + "'></span>",- tagNodeIcon: "<span class='" + opts.classNames.nodeIcon + "'></span>",- tagCheckbox: "<span class='" + opts.classNames.checkbox + "'></span>",- lastentry: undefined- };-- // Clear container, in case it contained some 'waiting' or 'error' text- // for clients that don't support JS.- // We don't do this however, if we try to load from an embedded UL element.- if( opts.children || (opts.initAjax && opts.initAjax.url) || opts.initId ){- $(this.divTree).empty();- }- var $ulInitialize = this.$tree.find(">ul:first").hide();-- // Create the root element- this.tnRoot = new DynaTreeNode(null, this, {});- this.tnRoot.bExpanded = true;- this.tnRoot.render();- this.divTree.appendChild(this.tnRoot.ul);-- var root = this.tnRoot,- isReloading = ( opts.persist && this.persistence.isReloading() ),- isLazy = false,- prevFlag = this.enableUpdate(false);-- this.logDebug("Dynatree._load(): read tree structure...");-- // Init tree structure- if( opts.children ) {- // Read structure from node array- root.addChild(opts.children);-- } else if( opts.initAjax && opts.initAjax.url ) {- // Init tree from AJAX request- isLazy = true;- root.data.isLazy = true;- this._reloadAjax(callback);-- } else if( opts.initId ) {- // Init tree from another UL element- this._createFromTag(root, $("#"+opts.initId));-- } else {- // Init tree from the first UL element inside the container <div>-// var $ul = this.$tree.find(">ul:first").hide();- this._createFromTag(root, $ulInitialize);- $ulInitialize.remove();- }-- this._checkConsistency();- // Fix part-sel flags- if(!isLazy && opts.selectMode == 3){- root._updatePartSelectionState();- }- // Render html markup- this.logDebug("Dynatree._load(): render nodes...");- this.enableUpdate(prevFlag);-- // bind event handlers- this.logDebug("Dynatree._load(): bind events...");- this.$widget.bind();-- // --- Post-load processing- this.logDebug("Dynatree._load(): postInit...");- this.phase = "postInit";-- // In persist mode, make sure that cookies are written, even if they are empty- if( opts.persist ) {- this.persistence.write();- }- // Set focus, if possible (this will also fire an event and write a cookie)- if( this.focusNode && this.focusNode.isVisible() ) {- this.logDebug("Focus on init: %o", this.focusNode);- this.focusNode.focus();- }- if( !isLazy ) {- if( opts.onPostInit ) {- opts.onPostInit.call(this, isReloading, false);- }- if( callback ){- callback.call(this, "ok");- }- }- this.phase = "idle";- },-- _reloadAjax: function(callback) {- // Reload- var opts = this.options;- if( ! opts.initAjax || ! opts.initAjax.url ){- throw "tree.reload() requires 'initAjax' mode.";- }- var pers = this.persistence;- var ajaxOpts = $.extend({}, opts.initAjax);- // Append cookie info to the request-// this.logDebug("reloadAjax: key=%o, an.key:%o", pers.activeKey, this.activeNode?this.activeNode.data.key:"?");- if( ajaxOpts.addActiveKey ){- ajaxOpts.data.activeKey = pers.activeKey;- }- if( ajaxOpts.addFocusedKey ){- ajaxOpts.data.focusedKey = pers.focusedKey;- }- if( ajaxOpts.addExpandedKeyList ){- ajaxOpts.data.expandedKeyList = pers.expandedKeyList.join(",");- }- if( ajaxOpts.addSelectedKeyList ){- ajaxOpts.data.selectedKeyList = pers.selectedKeyList.join(",");- }- // Set up onPostInit callback to be called when Ajax returns- if( ajaxOpts.success ){- this.logWarning("initAjax: success callback is ignored; use onPostInit instead.");- }- if( ajaxOpts.error ){- this.logWarning("initAjax: error callback is ignored; use onPostInit instead.");- }- var isReloading = pers.isReloading();- ajaxOpts.success = function(dtnode, data, textStatus) {- if(opts.selectMode == 3){- dtnode.tree.tnRoot._updatePartSelectionState();- }- if(opts.onPostInit){- opts.onPostInit.call(dtnode.tree, isReloading, false);- }- if(callback){- callback.call(dtnode.tree, "ok");- }- };- ajaxOpts.error = function(dtnode, XMLHttpRequest, textStatus, errorThrown) {- if(opts.onPostInit){- opts.onPostInit.call(dtnode.tree, isReloading, true, XMLHttpRequest, textStatus, errorThrown);- }- if(callback){- callback.call(dtnode.tree, "error", XMLHttpRequest, textStatus, errorThrown);- }- };-// }- this.logDebug("Dynatree._init(): send Ajax request...");- this.tnRoot.appendAjax(ajaxOpts);- },-- toString: function() {-// return "DynaTree '" + this.options.title + "'";- return "Dynatree '" + this.$tree.attr("id") + "'";- },-- toDict: function() {- return this.tnRoot.toDict(true);- },-- serializeArray: function(stopOnParents) {- // Return a JavaScript array of objects, ready to be encoded as a JSON- // string for selected nodes- var nodeList = this.getSelectedNodes(stopOnParents),- name = this.$tree.attr("name") || this.$tree.attr("id"),- arr = [];- for(var i=0, l=nodeList.length; i<l; i++){- arr.push({name: name, value: nodeList[i].data.key});- }- return arr;- },-- getPersistData: function() {- return this.persistence.toDict();- },-- logDebug: function(msg) {- if( this.options.debugLevel >= 2 ) {- Array.prototype.unshift.apply(arguments, ["debug"]);- _log.apply(this, arguments);- }- },-- logInfo: function(msg) {- if( this.options.debugLevel >= 1 ) {- Array.prototype.unshift.apply(arguments, ["info"]);- _log.apply(this, arguments);- }- },-- logWarning: function(msg) {- Array.prototype.unshift.apply(arguments, ["warn"]);- _log.apply(this, arguments);- },-- isInitializing: function() {- return ( this.phase=="init" || this.phase=="postInit" );- },- isReloading: function() {- return ( this.phase=="init" || this.phase=="postInit" ) && this.options.persist && this.persistence.cookiesFound;- },- isUserEvent: function() {- return ( this.phase=="userEvent" );- },-- redraw: function() {-// this.logDebug("dynatree.redraw()...");- this.tnRoot.render(false, false);-// this.logDebug("dynatree.redraw() done.");- },- renderInvisibleNodes: function() {- this.tnRoot.render(false, true);- },- reload: function(callback) {- this._load(callback);- },-- getRoot: function() {- return this.tnRoot;- },-- enable: function() {- this.$widget.enable();- },-- disable: function() {- this.$widget.disable();- },-- getNodeByKey: function(key) {- // Search the DOM by element ID (assuming this is faster than traversing all nodes).- // $("#...") has problems, if the key contains '.', so we use getElementById()- var el = document.getElementById(this.options.idPrefix + key);- if( el ){- return el.dtnode ? el.dtnode : null;- }- // Not found in the DOM, but still may be in an unrendered part of tree- var match = null;- this.visit(function(node){-// window.console.log("%s", node);- if(node.data.key == key) {- match = node;- return false;- }- }, true);- return match;- },-- getActiveNode: function() {- return this.activeNode;- },-- reactivate: function(setFocus) {- // Re-fire onQueryActivate and onActivate events.- var node = this.activeNode;-// this.logDebug("reactivate %o", node);- if( node ) {- this.activeNode = null; // Force re-activating- node.activate();- if( setFocus ){- node.focus();- }- }- },-- getSelectedNodes: function(stopOnParents) {- var nodeList = [];- this.tnRoot.visit(function(node){- if( node.bSelected ) {- nodeList.push(node);- if( stopOnParents === true ){- return "skip"; // stop processing this branch- }- }- });- return nodeList;- },-- activateKey: function(key) {- var dtnode = (key === null) ? null : this.getNodeByKey(key);- if( !dtnode ) {- if( this.activeNode ){- this.activeNode.deactivate();- }- this.activeNode = null;- return null;- }- dtnode.focus();- dtnode.activate();- return dtnode;- },-- loadKeyPath: function(keyPath, callback) {- var segList = keyPath.split(this.options.keyPathSeparator);- // Remove leading '/'- if(segList[0] === ""){- segList.shift();- }- // Remove leading system root key- if(segList[0] == this.tnRoot.data.key){- this.logDebug("Removed leading root key.");- segList.shift();- }- keyPath = segList.join(this.options.keyPathSeparator);- return this.tnRoot._loadKeyPath(keyPath, callback);- },-- selectKey: function(key, select) {- var dtnode = this.getNodeByKey(key);- if( !dtnode ){- return null;- }- dtnode.select(select);- return dtnode;- },-- enableUpdate: function(bEnable) {- if ( this.bEnableUpdate==bEnable ){- return bEnable;- }- this.bEnableUpdate = bEnable;- if ( bEnable ){- this.redraw();- }- return !bEnable; // return previous value- },-- count: function() {- return this.tnRoot.countChildren();- },-- visit: function(fn, includeRoot) {- return this.tnRoot.visit(fn, includeRoot);- },-- _createFromTag: function(parentTreeNode, $ulParent) {- // Convert a <UL>...</UL> list into children of the parent tree node.- var self = this;-/*-TODO: better?- this.$lis = $("li:has(a[href])", this.element);- this.$tabs = this.$lis.map(function() { return $("a", this)[0]; });- */- $ulParent.find(">li").each(function() {- var $li = $(this),- $liSpan = $li.find(">span:first"),- $liA = $li.find(">a:first"),- title,- href = null,- target = null,- tooltip;- if( $liSpan.length ) {- // If a <li><span> tag is specified, use it literally.- title = $liSpan.html();- } else if( $liA.length ) {- title = $liA.html();- href = $liA.attr("href");- target = $liA.attr("target");- tooltip = $liA.attr("title");- } else {- // If only a <li> tag is specified, use the trimmed string up to- // the next child <ul> tag.- title = $li.html();- var iPos = title.search(/<ul/i);- if( iPos >= 0 ){- title = $.trim(title.substring(0, iPos));- }else{- title = $.trim(title);- }-// self.logDebug("%o", title);- }- // Parse node options from ID, title and class attributes- var data = {- title: title,- tooltip: tooltip,- isFolder: $li.hasClass("folder"),- isLazy: $li.hasClass("lazy"),- expand: $li.hasClass("expanded"),- select: $li.hasClass("selected"),- activate: $li.hasClass("active"),- focus: $li.hasClass("focused"),- noLink: $li.hasClass("noLink")- };- if( href ){- data.href = href;- data.target = target;- }- if( $li.attr("title") ){- data.tooltip = $li.attr("title"); // overrides <a title='...'>- }- if( $li.attr("id") ){- data.key = $li.attr("id");- }- // If a data attribute is present, evaluate as a JavaScript object- if( $li.attr("data") ) {- var dataAttr = $.trim($li.attr("data"));- if( dataAttr ) {- if( dataAttr.charAt(0) != "{" ){- dataAttr = "{" + dataAttr + "}";- }- try {- $.extend(data, eval("(" + dataAttr + ")"));- } catch(e) {- throw ("Error parsing node data: " + e + "\ndata:\n'" + dataAttr + "'");- }- }- }- var childNode = parentTreeNode.addChild(data);- // Recursive reading of child nodes, if LI tag contains an UL tag- var $ul = $li.find(">ul:first");- if( $ul.length ) {- self._createFromTag(childNode, $ul); // must use 'self', because 'this' is the each() context- }- });- },-- _checkConsistency: function() {-// this.logDebug("tree._checkConsistency() NOT IMPLEMENTED - %o", this);- },-- _setDndStatus: function(sourceNode, targetNode, helper, hitMode, accept) {- // hitMode: 'after', 'before', 'over', 'out', 'start', 'stop'- var $source = sourceNode ? $(sourceNode.span) : null,- $target = $(targetNode.span);- if( !this.$dndMarker ) {- this.$dndMarker = $("<div id='dynatree-drop-marker'></div>")- .hide()- .css({"z-index": 1000})- .prependTo($(this.divTree).parent());--// logMsg("Creating marker: %o", this.$dndMarker);- }-/*- if(hitMode === "start"){- }- if(hitMode === "stop"){-// sourceNode.removeClass("dynatree-drop-target");- }-*/- if(hitMode === "after" || hitMode === "before" || hitMode === "over"){-// $source && $source.addClass("dynatree-drag-source");-// $target.addClass("dynatree-drop-target");-- var markerOffset = "0 0";-- switch(hitMode){- case "before":- this.$dndMarker.removeClass("dynatree-drop-after dynatree-drop-over");- this.$dndMarker.addClass("dynatree-drop-before");- markerOffset = "0 -8";- break;- case "after":- this.$dndMarker.removeClass("dynatree-drop-before dynatree-drop-over");- this.$dndMarker.addClass("dynatree-drop-after");- markerOffset = "0 8";- break;- default:- this.$dndMarker.removeClass("dynatree-drop-after dynatree-drop-before");- this.$dndMarker.addClass("dynatree-drop-over");- $target.addClass("dynatree-drop-target");- markerOffset = "8 0";- }-// logMsg("Creating marker: %o", this.$dndMarker);-// logMsg(" $target.offset=%o", $target);-// logMsg(" pos/$target.offset=%o", pos);-// logMsg(" $target.position=%o", $target.position());-// logMsg(" $target.offsetParent=%o, ot:%o", $target.offsetParent(), $target.offsetParent().offset());-// logMsg(" $(this.divTree).offset=%o", $(this.divTree).offset());-// logMsg(" $(this.divTree).parent=%o", $(this.divTree).parent());-// var pos = $target.offset();-// var parentPos = $target.offsetParent().offset();-// var bodyPos = $target.offsetParent().offset();-- this.$dndMarker- .show()- .position({- my: "left top",- at: "left top",- of: $target,- offset: markerOffset- });--// helper.addClass("dynatree-drop-hover");- } else {-// $source && $source.removeClass("dynatree-drag-source");- $target.removeClass("dynatree-drop-target");- this.$dndMarker.hide();-// helper.removeClass("dynatree-drop-hover");- }- if(hitMode === "after"){- $target.addClass("dynatree-drop-after");- } else {- $target.removeClass("dynatree-drop-after");- }- if(hitMode === "before"){- $target.addClass("dynatree-drop-before");- } else {- $target.removeClass("dynatree-drop-before");- }- if(accept === true){- if($source){- $source.addClass("dynatree-drop-accept");- }- $target.addClass("dynatree-drop-accept");- helper.addClass("dynatree-drop-accept");- }else{- if($source){- $source.removeClass("dynatree-drop-accept");- }- $target.removeClass("dynatree-drop-accept");- helper.removeClass("dynatree-drop-accept");- }- if(accept === false){- if($source){- $source.addClass("dynatree-drop-reject");- }- $target.addClass("dynatree-drop-reject");- helper.addClass("dynatree-drop-reject");- }else{- if($source){- $source.removeClass("dynatree-drop-reject");- }- $target.removeClass("dynatree-drop-reject");- helper.removeClass("dynatree-drop-reject");- }- },-- _onDragEvent: function(eventName, node, otherNode, event, ui, draggable) {- /**- * Handles drag'n'drop functionality.- *- * A standard jQuery drag-and-drop process may generate these calls:- *- * draggable helper():- * _onDragEvent("helper", sourceNode, null, event, null, null);- * start:- * _onDragEvent("start", sourceNode, null, event, ui, draggable);- * drag:- * _onDragEvent("leave", prevTargetNode, sourceNode, event, ui, draggable);- * _onDragEvent("over", targetNode, sourceNode, event, ui, draggable);- * _onDragEvent("enter", targetNode, sourceNode, event, ui, draggable);- * stop:- * _onDragEvent("drop", targetNode, sourceNode, event, ui, draggable);- * _onDragEvent("leave", targetNode, sourceNode, event, ui, draggable);- * _onDragEvent("stop", sourceNode, null, event, ui, draggable);- */-// if(eventName !== "over"){-// this.logDebug("tree._onDragEvent(%s, %o, %o) - %o", eventName, node, otherNode, this);-// }- var opts = this.options,- dnd = this.options.dnd,- res = null,- nodeTag = $(node.span),- hitMode,- enterResponse;-- switch (eventName) {- case "helper":- // Only event and node argument is available- var $helper = $("<div class='dynatree-drag-helper'><span class='dynatree-drag-helper-img' /></div>")- .append($(event.target).closest('a').clone());- // issue 244: helper should be child of scrollParent- $("ul.dynatree-container", node.tree.divTree).append($helper);-// $(node.tree.divTree).append($helper);- // Attach node reference to helper object- $helper.data("dtSourceNode", node);-// this.logDebug("helper=%o", $helper);-// this.logDebug("helper.sourceNode=%o", $helper.data("dtSourceNode"));- res = $helper;- break;- case "start":- if(node.isStatusNode()) {- res = false;- } else if(dnd.onDragStart) {- res = dnd.onDragStart(node);- }- if(res === false) {- this.logDebug("tree.onDragStart() cancelled");- //draggable._clear();- // NOTE: the return value seems to be ignored (drag is not canceled, when false is returned)- ui.helper.trigger("mouseup");- ui.helper.hide();- } else {- nodeTag.addClass("dynatree-drag-source");- }- break;- case "enter":- res = dnd.onDragEnter ? dnd.onDragEnter(node, otherNode) : null;- if(!res){- // convert null, undefined, false to false- res = false;- }else{- res = {- over: ((res === true) || (res === "over") || $.inArray("over", res) >= 0),- before: ((res === true) || (res === "before") || $.inArray("before", res) >= 0),- after: ((res === true) || (res === "after") || $.inArray("after", res) >= 0)- };- }- ui.helper.data("enterResponse", res);-// this.logDebug("helper.enterResponse: %o", res);- break;- case "over":- enterResponse = ui.helper.data("enterResponse");- hitMode = null;- if(enterResponse === false){- // Don't call onDragOver if onEnter returned false.- // issue 332-// break;- } else if(typeof enterResponse === "string") {- // Use hitMode from onEnter if provided.- hitMode = enterResponse;- } else {- // Calculate hitMode from relative cursor position.- var nodeOfs = nodeTag.offset();-// var relPos = { x: event.clientX - nodeOfs.left,-// y: event.clientY - nodeOfs.top };-// nodeOfs.top += this.parentTop;-// nodeOfs.left += this.parentLeft;- var relPos = { x: event.pageX - nodeOfs.left,- y: event.pageY - nodeOfs.top };- var relPos2 = { x: relPos.x / nodeTag.width(),- y: relPos.y / nodeTag.height() };-// this.logDebug("event.page: %s/%s", event.pageX, event.pageY);-// this.logDebug("event.client: %s/%s", event.clientX, event.clientY);-// this.logDebug("nodeOfs: %s/%s", nodeOfs.left, nodeOfs.top);-//// this.logDebug("parent: %s/%s", this.parentLeft, this.parentTop);-// this.logDebug("relPos: %s/%s", relPos.x, relPos.y);-// this.logDebug("relPos2: %s/%s", relPos2.x, relPos2.y);- if( enterResponse.after && relPos2.y > 0.75 ){- hitMode = "after";- } else if(!enterResponse.over && enterResponse.after && relPos2.y > 0.5 ){- hitMode = "after";- } else if(enterResponse.before && relPos2.y <= 0.25) {- hitMode = "before";- } else if(!enterResponse.over && enterResponse.before && relPos2.y <= 0.5) {- hitMode = "before";- } else if(enterResponse.over) {- hitMode = "over";- }- // Prevent no-ops like 'before source node'- // TODO: these are no-ops when moving nodes, but not in copy mode- if( dnd.preventVoidMoves ){- if(node === otherNode){-// this.logDebug(" drop over source node prevented");- hitMode = null;- }else if(hitMode === "before" && otherNode && node === otherNode.getNextSibling()){-// this.logDebug(" drop after source node prevented");- hitMode = null;- }else if(hitMode === "after" && otherNode && node === otherNode.getPrevSibling()){-// this.logDebug(" drop before source node prevented");- hitMode = null;- }else if(hitMode === "over" && otherNode- && otherNode.parent === node && otherNode.isLastSibling() ){-// this.logDebug(" drop last child over own parent prevented");- hitMode = null;- }- }-// this.logDebug("hitMode: %s - %s - %s", hitMode, (node.parent === otherNode), node.isLastSibling());- ui.helper.data("hitMode", hitMode);- }- // Auto-expand node (only when 'over' the node, not 'before', or 'after')- if(hitMode === "over"- && dnd.autoExpandMS && node.hasChildren() !== false && !node.bExpanded) {- node.scheduleAction("expand", dnd.autoExpandMS);- }- if(hitMode && dnd.onDragOver){- res = dnd.onDragOver(node, otherNode, hitMode);- if(res === "over" || res === "before" || res === "after") {- hitMode = res;- }- }- // issue 332-// this._setDndStatus(otherNode, node, ui.helper, hitMode, res!==false);- this._setDndStatus(otherNode, node, ui.helper, hitMode, res!==false && hitMode !== null);- break;- case "drop":- // issue 286: don't trigger onDrop, if DnD status is 'reject'- var isForbidden = ui.helper.hasClass("dynatree-drop-reject");- hitMode = ui.helper.data("hitMode");- if(hitMode && dnd.onDrop && !isForbidden){- dnd.onDrop(node, otherNode, hitMode, ui, draggable);- }- break;- case "leave":- // Cancel pending expand request- node.scheduleAction("cancel");- ui.helper.data("enterResponse", null);- ui.helper.data("hitMode", null);- this._setDndStatus(otherNode, node, ui.helper, "out", undefined);- if(dnd.onDragLeave){- dnd.onDragLeave(node, otherNode);- }- break;- case "stop":- nodeTag.removeClass("dynatree-drag-source");- if(dnd.onDragStop){- dnd.onDragStop(node);- }- break;- default:- throw "Unsupported drag event: " + eventName;- }- return res;- },-- cancelDrag: function() {- var dd = $.ui.ddmanager.current;- if(dd){- dd.cancel();- }- },-- // --- end of class- lastentry: undefined-};--/*************************************************************************- * Widget $(..).dynatree- */--$.widget("ui.dynatree", {-/*- init: function() {- // ui.core 1.6 renamed init() to _init(): this stub assures backward compatibility- _log("warn", "ui.dynatree.init() was called; you should upgrade to jquery.ui.core.js v1.8 or higher.");- return this._init();- },- */- _init: function() {- if( parseFloat($.ui.version) < 1.8 ) {- // jquery.ui.core 1.8 renamed _init() to _create(): this stub assures backward compatibility- if(this.options.debugLevel >= 0){- _log("warn", "ui.dynatree._init() was called; you should upgrade to jquery.ui.core.js v1.8 or higher.");- }- return this._create();- }- // jquery.ui.core 1.8 still uses _init() to perform "default functionality"- if(this.options.debugLevel >= 2){- _log("debug", "ui.dynatree._init() was called; no current default functionality.");- }- },-- _create: function() {- var opts = this.options;- if(opts.debugLevel >= 1){- logMsg("Dynatree._create(): version='%s', debugLevel=%o.", $.ui.dynatree.version, this.options.debugLevel);- }- // The widget framework supplies this.element and this.options.- this.options.event += ".dynatree"; // namespace event-- var divTree = this.element.get(0);-/* // Clear container, in case it contained some 'waiting' or 'error' text- // for clients that don't support JS- if( opts.children || (opts.initAjax && opts.initAjax.url) || opts.initId )- $(divTree).empty();-*/- // Create the DynaTree object- this.tree = new DynaTree(this);- this.tree._load();- this.tree.logDebug("Dynatree._init(): done.");- },-- bind: function() {- // Prevent duplicate binding- this.unbind();-- var eventNames = "click.dynatree dblclick.dynatree";- if( this.options.keyboard ){- // Note: leading ' '!- eventNames += " keypress.dynatree keydown.dynatree";- }- this.element.bind(eventNames, function(event){- var dtnode = $.ui.dynatree.getNode(event.target);- if( !dtnode ){- return true; // Allow bubbling of other events- }- var tree = dtnode.tree;- var o = tree.options;- tree.logDebug("event(%s): dtnode: %s", event.type, dtnode);- var prevPhase = tree.phase;- tree.phase = "userEvent";- try {- switch(event.type) {- case "click":- return ( o.onClick && o.onClick.call(tree, dtnode, event)===false ) ? false : dtnode._onClick(event);- case "dblclick":- return ( o.onDblClick && o.onDblClick.call(tree, dtnode, event)===false ) ? false : dtnode._onDblClick(event);- case "keydown":- return ( o.onKeydown && o.onKeydown.call(tree, dtnode, event)===false ) ? false : dtnode._onKeydown(event);- case "keypress":- return ( o.onKeypress && o.onKeypress.call(tree, dtnode, event)===false ) ? false : dtnode._onKeypress(event);- }- } catch(e) {- var _ = null; // issue 117- tree.logWarning("bind(%o): dtnode: %o, error: %o", event, dtnode, e);- } finally {- tree.phase = prevPhase;- }- });-- // focus/blur don't bubble, i.e. are not delegated to parent <div> tags,- // so we use the addEventListener capturing phase.- // See http://www.howtocreate.co.uk/tutorials/javascript/domevents- function __focusHandler(event) {- // Handles blur and focus.- // Fix event for IE:- // doesn't pass JSLint:-// event = arguments[0] = $.event.fix( event || window.event );- // what jQuery does:-// var args = jQuery.makeArray( arguments );-// event = args[0] = jQuery.event.fix( event || window.event );- event = $.event.fix( event || window.event );- var dtnode = $.ui.dynatree.getNode(event.target);- return dtnode ? dtnode._onFocus(event) : false;- }- var div = this.tree.divTree;-- if( div.addEventListener ) {- div.addEventListener("focus", __focusHandler, true);- div.addEventListener("blur", __focusHandler, true);- } else {- div.onfocusin = div.onfocusout = __focusHandler;- }- // EVENTS- // disable click if event is configured to something else-// if (!(/^click/).test(o.event))-// this.$tabs.bind("click.tabs", function() { return false; });-- },-- unbind: function() {- this.element.unbind(".dynatree");- },--/* TODO: we could handle option changes during runtime here (maybe to re-render, ...)- setData: function(key, value) {- this.tree.logDebug("dynatree.setData('" + key + "', '" + value + "')");- },-*/- enable: function() {- this.bind();- // Call default disable(): remove -disabled from css:- $.Widget.prototype.enable.apply(this, arguments);- },-- disable: function() {- this.unbind();- // Call default disable(): add -disabled to css:- $.Widget.prototype.disable.apply(this, arguments);- },-- // --- getter methods (i.e. NOT returning a reference to $)- getTree: function() {- return this.tree;- },-- getRoot: function() {- return this.tree.getRoot();- },-- getActiveNode: function() {- return this.tree.getActiveNode();- },-- getSelectedNodes: function() {- return this.tree.getSelectedNodes();- },-- // ------------------------------------------------------------------------- lastentry: undefined-});---// The following methods return a value (thus breaking the jQuery call chain):-if( parseFloat($.ui.version) < 1.8 ) {- $.ui.dynatree.getter = "getTree getRoot getActiveNode getSelectedNodes";-}--/*******************************************************************************- * Tools in ui.dynatree namespace- */-$.ui.dynatree.version = "$Version:$";--/**- * Return a DynaTreeNode object for a given DOM element- */-$.ui.dynatree.getNode = function(el) {- if(el instanceof DynaTreeNode){- return el; // el already was a DynaTreeNode- }- if(el.selector !== undefined){- el = el[0]; // el was a jQuery object: use the DOM element- }- // TODO: for some reason $el.parents("[dtnode]") does not work (jQuery 1.6.1)- // maybe, because dtnode is a property, not an attribute- while( el ) {- if(el.dtnode) {- return el.dtnode;- }- el = el.parentNode;- }- return null;-/*- var $el = el.selector === undefined ? $(el) : el,-// parent = $el.closest("[dtnode]"),-// parent = $el.parents("[dtnode]").first(),- useProp = (typeof $el.prop == "function"),- node;- $el.parents().each(function(){- node = useProp ? $(this).prop("dtnode") : $(this).attr("dtnode");- if(node){- return false;- }- });- return node;-*/-};--/**Return persistence information from cookies.*/-$.ui.dynatree.getPersistData = DynaTreeStatus._getTreePersistData;--/*******************************************************************************- * Plugin default options:- */-$.ui.dynatree.prototype.options = {- title: "Dynatree", // Tree's name (only used for debug output)- minExpandLevel: 1, // 1: root node is not collapsible- imagePath: null, // Path to a folder containing icons. Defaults to 'skin/' subdirectory.- children: null, // Init tree structure from this object array.- initId: null, // Init tree structure from a <ul> element with this ID.- initAjax: null, // Ajax options used to initialize the tree strucuture.- autoFocus: true, // Set focus to first child, when expanding or lazy-loading.- keyboard: true, // Support keyboard navigation.- persist: false, // Persist expand-status to a cookie- autoCollapse: false, // Automatically collapse all siblings, when a node is expanded.- clickFolderMode: 3, // 1:activate, 2:expand, 3:activate and expand- activeVisible: true, // Make sure, active nodes are visible (expanded).- checkbox: false, // Show checkboxes.- selectMode: 2, // 1:single, 2:multi, 3:multi-hier- fx: null, // Animations, e.g. null or { height: "toggle", duration: 200 }- noLink: false, // Use <span> instead of <a> tags for all nodes- // Low level event handlers: onEvent(dtnode, event): return false, to stop default processing- onClick: null, // null: generate focus, expand, activate, select events.- onDblClick: null, // (No default actions.)- onKeydown: null, // null: generate keyboard navigation (focus, expand, activate).- onKeypress: null, // (No default actions.)- onFocus: null, // null: set focus to node.- onBlur: null, // null: remove focus from node.-- // Pre-event handlers onQueryEvent(flag, dtnode): return false, to stop processing- onQueryActivate: null, // Callback(flag, dtnode) before a node is (de)activated.- onQuerySelect: null, // Callback(flag, dtnode) before a node is (de)selected.- onQueryExpand: null, // Callback(flag, dtnode) before a node is expanded/collpsed.-- // High level event handlers- onPostInit: null, // Callback(isReloading, isError) when tree was (re)loaded.- onActivate: null, // Callback(dtnode) when a node is activated.- onDeactivate: null, // Callback(dtnode) when a node is deactivated.- onSelect: null, // Callback(flag, dtnode) when a node is (de)selected.- onExpand: null, // Callback(flag, dtnode) when a node is expanded/collapsed.- onLazyRead: null, // Callback(dtnode) when a lazy node is expanded for the first time.- onCustomRender: null, // Callback(dtnode) before a node is rendered. Return a HTML string to override.- onCreate: null, // Callback(dtnode, nodeSpan) after a node was rendered for the first time.- onRender: null, // Callback(dtnode, nodeSpan) after a node was rendered.- // postProcess is similar to the standard dataFilter hook,- // but it is also called for JSONP- postProcess: null, // Callback(data, dataType) before an Ajax result is passed to dynatree-- // Drag'n'drop support- dnd: {- // Make tree nodes draggable:- onDragStart: null, // Callback(sourceNode), return true, to enable dnd- onDragStop: null, // Callback(sourceNode)-// helper: null,- // Make tree nodes accept draggables- autoExpandMS: 1000, // Expand nodes after n milliseconds of hovering.- preventVoidMoves: true, // Prevent dropping nodes 'before self', etc.- onDragEnter: null, // Callback(targetNode, sourceNode)- onDragOver: null, // Callback(targetNode, sourceNode, hitMode)- onDrop: null, // Callback(targetNode, sourceNode, hitMode)- onDragLeave: null // Callback(targetNode, sourceNode)- },- ajaxDefaults: { // Used by initAjax option- cache: false, // false: Append random '_' argument to the request url to prevent caching.- timeout: 0, // >0: Make sure we get an ajax error for invalid URLs- dataType: "json" // Expect json format and pass json object to callbacks.- },- strings: {- loading: "Loading…",- loadError: "Load error!"- },- generateIds: false, // Generate id attributes like <span id='dynatree-id-KEY'>- idPrefix: "dynatree-id-", // Used to generate node id's like <span id="dynatree-id-<key>">.- keyPathSeparator: "/", // Used by node.getKeyPath() and tree.loadKeyPath().-// cookieId: "dynatree-cookie", // Choose a more unique name, to allow multiple trees.- cookieId: "dynatree", // Choose a more unique name, to allow multiple trees.- cookie: {- expires: null //7, // Days or Date; null: session cookie-// path: "/", // Defaults to current page-// domain: "jquery.com",-// secure: true- },- // Class names used, when rendering the HTML markup.- // Note: if only single entries are passed for options.classNames, all other- // values are still set to default.- classNames: {- container: "dynatree-container",- node: "dynatree-node",- folder: "dynatree-folder",-// document: "dynatree-document",-- empty: "dynatree-empty",- vline: "dynatree-vline",- expander: "dynatree-expander",- connector: "dynatree-connector",- checkbox: "dynatree-checkbox",- nodeIcon: "dynatree-icon",- title: "dynatree-title",- noConnector: "dynatree-no-connector",-- nodeError: "dynatree-statusnode-error",- nodeWait: "dynatree-statusnode-wait",- hidden: "dynatree-hidden",- combinedExpanderPrefix: "dynatree-exp-",- combinedIconPrefix: "dynatree-ico-",- nodeLoading: "dynatree-loading",-// disabled: "dynatree-disabled",- hasChildren: "dynatree-has-children",- active: "dynatree-active",- selected: "dynatree-selected",- expanded: "dynatree-expanded",- lazy: "dynatree-lazy",- focused: "dynatree-focused",- partsel: "dynatree-partsel",- lastsib: "dynatree-lastsib"- },- debugLevel: 2, // 0:quiet, 1:normal, 2:debug $REPLACE: debugLevel: 1,-- // ------------------------------------------------------------------------- lastentry: undefined-};-//-if( parseFloat($.ui.version) < 1.8 ) {- $.ui.dynatree.defaults = $.ui.dynatree.prototype.options;-}--/*******************************************************************************- * Reserved data attributes for a tree node.- */-$.ui.dynatree.nodedatadefaults = {- title: null, // (required) Displayed name of the node (html is allowed here)- key: null, // May be used with activate(), select(), find(), ...- isFolder: false, // Use a folder icon. Also the node is expandable but not selectable.- isLazy: false, // Call onLazyRead(), when the node is expanded for the first time to allow for delayed creation of children.- tooltip: null, // Show this popup text.- href: null, // Added to the generated <a> tag.- icon: null, // Use a custom image (filename relative to tree.options.imagePath). 'null' for default icon, 'false' for no icon.- addClass: null, // Class name added to the node's span tag.- noLink: false, // Use <span> instead of <a> tag for this node- activate: false, // Initial active status.- focus: false, // Initial focused status.- expand: false, // Initial expanded status.- select: false, // Initial selected status.- hideCheckbox: false, // Suppress checkbox display for this node.- unselectable: false, // Prevent selection.-// disabled: false,- // The following attributes are only valid if passed to some functions:- children: null, // Array of child nodes.- // NOTE: we can also add custom attributes here.- // This may then also be used in the onActivate(), onSelect() or onLazyTree() callbacks.- // ------------------------------------------------------------------------- lastentry: undefined-};--/*******************************************************************************- * Drag and drop support- */-function _initDragAndDrop(tree) {- var dnd = tree.options.dnd || null;- // Register 'connectToDynatree' option with ui.draggable- if(dnd && (dnd.onDragStart || dnd.onDrop)) {- _registerDnd();- }- // Attach ui.draggable to this Dynatree instance- if(dnd && dnd.onDragStart ) {- tree.$tree.draggable({- addClasses: false,- appendTo: "body",- containment: false,- delay: 0,- distance: 4,- revert: false,- scroll: true, // issue 244: enable scrolling (if ul.dynatree-container)- scrollSpeed: 7,- scrollSensitivity: 10,- // Delegate draggable.start, drag, and stop events to our handler- connectToDynatree: true,- // Let source tree create the helper element- helper: function(event) {- var sourceNode = $.ui.dynatree.getNode(event.target);- if(!sourceNode){ // issue 211- return "<div></div>";- }- return sourceNode.tree._onDragEvent("helper", sourceNode, null, event, null, null);- },- start: function(event, ui) {- // See issues 211, 268, 278-// var sourceNode = $.ui.dynatree.getNode(event.target);- var sourceNode = ui.helper.data("dtSourceNode");- return !!sourceNode; // Abort dragging if no Node could be found- },- _last: null- });- }- // Attach ui.droppable to this Dynatree instance- if(dnd && dnd.onDrop) {- tree.$tree.droppable({- addClasses: false,- tolerance: "intersect",- greedy: false,- _last: null- });- }-}--//--- Extend ui.draggable event handling ---------------------------------------var didRegisterDnd = false;-var _registerDnd = function() {- if(didRegisterDnd){- return;- }- // Register proxy-functions for draggable.start/drag/stop- $.ui.plugin.add("draggable", "connectToDynatree", {- start: function(event, ui) {- var draggable = $(this).data("draggable"),- sourceNode = ui.helper.data("dtSourceNode") || null;-// logMsg("draggable-connectToDynatree.start, %s", sourceNode);-// logMsg(" this: %o", this);-// logMsg(" event: %o", event);-// logMsg(" draggable: %o", draggable);-// logMsg(" ui: %o", ui);-- if(sourceNode) {- // Adjust helper offset, so cursor is slightly outside top/left corner-// draggable.offset.click.top -= event.target.offsetTop;-// draggable.offset.click.left -= event.target.offsetLeft;- draggable.offset.click.top = -2;- draggable.offset.click.left = + 16;-// logMsg(" draggable2: %o", draggable);-// logMsg(" draggable.offset.click FIXED: %s/%s", draggable.offset.click.left, draggable.offset.click.top);- // Trigger onDragStart event- // TODO: when called as connectTo..., the return value is ignored(?)- return sourceNode.tree._onDragEvent("start", sourceNode, null, event, ui, draggable);- }- },- drag: function(event, ui) {- var draggable = $(this).data("draggable"),- sourceNode = ui.helper.data("dtSourceNode") || null,- prevTargetNode = ui.helper.data("dtTargetNode") || null,- targetNode = $.ui.dynatree.getNode(event.target);-// logMsg("$.ui.dynatree.getNode(%o): %s", event.target, targetNode);-// logMsg("connectToDynatree.drag: helper: %o", ui.helper[0]);- if(event.target && !targetNode){- // We got a drag event, but the targetNode could not be found- // at the event location. This may happen,- // 1. if the mouse jumped over the drag helper,- // 2. or if non-dynatree element is dragged- // We ignore it:- var isHelper = $(event.target).closest("div.dynatree-drag-helper,#dynatree-drop-marker").length > 0;- if(isHelper){-// logMsg("Drag event over helper: ignored.");- return;- }- }-// logMsg("draggable-connectToDynatree.drag: targetNode(from event): %s, dtTargetNode: %s", targetNode, ui.helper.data("dtTargetNode"));- ui.helper.data("dtTargetNode", targetNode);- // Leaving a tree node- if(prevTargetNode && prevTargetNode !== targetNode ) {- prevTargetNode.tree._onDragEvent("leave", prevTargetNode, sourceNode, event, ui, draggable);- }- if(targetNode){- if(!targetNode.tree.options.dnd.onDrop) {- // not enabled as drop target-// noop(); // Keep JSLint happy- } else if(targetNode === prevTargetNode) {- // Moving over same node- targetNode.tree._onDragEvent("over", targetNode, sourceNode, event, ui, draggable);- }else{- // Entering this node first time- targetNode.tree._onDragEvent("enter", targetNode, sourceNode, event, ui, draggable);- }- }- // else go ahead with standard event handling- },- stop: function(event, ui) {- var draggable = $(this).data("draggable"),- sourceNode = ui.helper.data("dtSourceNode") || null,- targetNode = ui.helper.data("dtTargetNode") || null,- mouseDownEvent = draggable._mouseDownEvent,- eventType = event.type,- dropped = (eventType == "mouseup" && event.which == 1);-// logMsg("draggable-connectToDynatree.stop: targetNode(from event): %s, dtTargetNode: %s", targetNode, ui.helper.data("dtTargetNode"));-// logMsg("draggable-connectToDynatree.stop, %s", sourceNode);-// logMsg(" type: %o, downEvent: %o, upEvent: %o", eventType, mouseDownEvent, event);-// logMsg(" targetNode: %o", targetNode);- if(!dropped){- logMsg("Drag was cancelled");- }- if(targetNode) {- if(dropped){- targetNode.tree._onDragEvent("drop", targetNode, sourceNode, event, ui, draggable);- }- targetNode.tree._onDragEvent("leave", targetNode, sourceNode, event, ui, draggable);- }- if(sourceNode){- sourceNode.tree._onDragEvent("stop", sourceNode, null, event, ui, draggable);- }- }- });- didRegisterDnd = true;-};--// ----------------------------------------------------------------------------}(jQuery));diff --git a/data/libs/dynatree/skin/icons-rtl.gif b/data/libs/dynatree/skin/icons-rtl.gifdeleted file mode 100644index a29b5fbc9..000000000Binary files a/data/libs/dynatree/skin/icons-rtl.gif and /dev/null differdiff --git a/data/libs/dynatree/skin/icons.gif b/data/libs/dynatree/skin/icons.gifdeleted file mode 100644index a58eb93f1..000000000Binary files a/data/libs/dynatree/skin/icons.gif and /dev/null differdiff --git a/data/libs/dynatree/skin/loading.gif b/data/libs/dynatree/skin/loading.gifdeleted file mode 100644index 251df0544..000000000Binary files a/data/libs/dynatree/skin/loading.gif and /dev/null differdiff --git a/data/libs/dynatree/skin/ui.dynatree.css b/data/libs/dynatree/skin/ui.dynatree.cssdeleted file mode 100644index 8da01f515..000000000--- a/data/libs/dynatree/skin/ui.dynatree.css+++ /dev/null@@ -1,440 +0,0 @@-/*******************************************************************************- * Tree container- */-ul.dynatree-container-{- font-family: tahoma, arial, helvetica;- font-size: 10pt; /* font size should not be too big */- white-space: nowrap;- padding: 3px;- margin: 0; /* issue 201 */- background-color: white;- border: 1px dotted gray;- overflow: auto;- height: 100%; /* issue 263 */-}--ul.dynatree-container ul-{- padding: 0 0 0 16px;- margin: 0;-}--ul.dynatree-container li-{- list-style-image: none;- list-style-position: outside;- list-style-type: none;- -moz-background-clip:border;- -moz-background-inline-policy: continuous;- -moz-background-origin: padding;- background-attachment: scroll;- background-color: transparent;- background-repeat: repeat-y;- background-image: url("vline.gif");- background-position: 0 0;- /*- background-image: url("icons_96x256.gif");- background-position: -80px -64px;- */- margin: 0;- padding: 1px 0 0 0;-}-/* Suppress lines for last child node */-ul.dynatree-container li.dynatree-lastsib-{- background-image: none;-}-/* Suppress lines if level is fixed expanded (option minExpandLevel) */-ul.dynatree-no-connector > li-{- background-image: none;-}--/* Style, when control is disabled */-.ui-dynatree-disabled ul.dynatree-container-{- opacity: 0.5;-/* filter: alpha(opacity=50); /* Yields a css warning */- background-color: silver;-}--/*******************************************************************************- * Common icon definitions- */-span.dynatree-empty,-span.dynatree-vline,-span.dynatree-connector,-span.dynatree-expander,-span.dynatree-icon,-span.dynatree-checkbox,-span.dynatree-radio,-span.dynatree-drag-helper-img,-#dynatree-drop-marker-{- width: 16px;- height: 16px;-/* display: -moz-inline-box; /* @ FF 1+2 removed for issue 221 */-/* -moz-box-align: start; /* issue 221 */- display: inline-block; /* Required to make a span sizeable */- vertical-align: top;- background-repeat: no-repeat;- background-position: left;- background-image: url("icons.gif");- background-position: 0 0;-}--/** Used by 'icon' node option: */-ul.dynatree-container img-{- width: 16px;- height: 16px;- margin-left: 3px;- vertical-align: top;- border-style: none;-}---/*******************************************************************************- * Lines and connectors- */--span.dynatree-connector-{- background-position: -16px -64px;-}--/*******************************************************************************- * Expander icon- * Note: IE6 doesn't correctly evaluate multiples class names,- * so we create combined class names that can be used in the CSS.- *- * Prefix: dynatree-exp-- * 1st character: 'e': expanded, 'c': collapsed- * 2nd character (optional): 'd': lazy (Delayed)- * 3rd character (optional): 'l': Last sibling- */--span.dynatree-expander-{- background-position: 0px -80px;- cursor: pointer;-}-.dynatree-exp-cl span.dynatree-expander /* Collapsed, not delayed, last sibling */-{- background-position: 0px -96px;-}-.dynatree-exp-cd span.dynatree-expander /* Collapsed, delayed, not last sibling */-{- background-position: -64px -80px;-}-.dynatree-exp-cdl span.dynatree-expander /* Collapsed, delayed, last sibling */-{- background-position: -64px -96px;-}-.dynatree-exp-e span.dynatree-expander, /* Expanded, not delayed, not last sibling */-.dynatree-exp-ed span.dynatree-expander /* Expanded, delayed, not last sibling */-{- background-position: -32px -80px;-}-.dynatree-exp-el span.dynatree-expander, /* Expanded, not delayed, last sibling */-.dynatree-exp-edl span.dynatree-expander /* Expanded, delayed, last sibling */-{- background-position: -32px -96px;-}-.dynatree-loading span.dynatree-expander /* 'Loading' status overrides all others */-{- background-position: 0 0;- background-image: url("loading.gif");-}---/*******************************************************************************- * Checkbox icon- */-span.dynatree-checkbox-{- margin-left: 3px;- background-position: 0px -32px;-}-span.dynatree-checkbox:hover-{- background-position: -16px -32px;-}--.dynatree-partsel span.dynatree-checkbox-{- background-position: -64px -32px;-}-.dynatree-partsel span.dynatree-checkbox:hover-{- background-position: -80px -32px;-}--.dynatree-selected span.dynatree-checkbox-{- background-position: -32px -32px;-}-.dynatree-selected span.dynatree-checkbox:hover-{- background-position: -48px -32px;-}--/*******************************************************************************- * Radiobutton icon- * This is a customization, that may be activated by overriding the 'checkbox'- * class name as 'dynatree-radio' in the tree options.- */-span.dynatree-radio-{- margin-left: 3px;- background-position: 0px -48px;-}-span.dynatree-radio:hover-{- background-position: -16px -48px;-}--.dynatree-partsel span.dynatree-radio-{- background-position: -64px -48px;-}-.dynatree-partsel span.dynatree-radio:hover-{- background-position: -80px -48px;-}--.dynatree-selected span.dynatree-radio-{- background-position: -32px -48px;-}-.dynatree-selected span.dynatree-radio:hover-{- background-position: -48px -48px;-}--/*******************************************************************************- * Node type icon- * Note: IE6 doesn't correctly evaluate multiples class names,- * so we create combined class names that can be used in the CSS.- *- * Prefix: dynatree-ico-- * 1st character: 'e': expanded, 'c': collapsed- * 2nd character (optional): 'f': folder- */--span.dynatree-icon /* Default icon */-{- margin-left: 3px;- background-position: 0px 0px;-}--.dynatree-ico-cf span.dynatree-icon /* Collapsed Folder */-{- background-position: 0px -16px;-}--.dynatree-ico-ef span.dynatree-icon /* Expanded Folder */-{- background-position: -64px -16px;-}--/* Status node icons */--.dynatree-statusnode-wait span.dynatree-icon-{- background-image: url("loading.gif");-}--.dynatree-statusnode-error span.dynatree-icon-{- background-position: 0px -112px;-/* background-image: url("ltError.gif");*/-}--/*******************************************************************************- * Node titles- */--/* @Chrome: otherwise hit area of node titles is broken (issue 133)- Removed again for issue 165; (133 couldn't be reproduced) */-span.dynatree-node-{-/* display: -moz-inline-box; /* issue 133, 165, 172, 192. removed for issue 221*/-/* -moz-box-align: start; /* issue 221 */-/* display: inline-block; /* Required to make a span sizeable */-}---/* Remove blue color and underline from title links */-ul.dynatree-container a-/*, ul.dynatree-container a:visited*/-{- color: black; /* inherit doesn't work on IE */- text-decoration: none;- vertical-align: top;- margin: 0px;- margin-left: 3px;-/* outline: 0; /* @ Firefox, prevent dotted border after click */-}--ul.dynatree-container a:hover-{-/* text-decoration: underline; */- background-color: #F2F7FD; /* light blue */- border-color: #B8D6FB; /* darker light blue */-}--span.dynatree-node a-{- font-size: 10pt; /* required for IE, quirks mode */- display: inline-block; /* Better alignment, when title contains <br> */-/* vertical-align: top;*/- padding-left: 3px;- padding-right: 3px; /* Otherwise italic font will be outside bounds */- /* line-height: 16px; /* should be the same as img height, in case 16 px */-}-span.dynatree-folder a-{- font-weight: bold;-}--ul.dynatree-container a:focus,-span.dynatree-focused a:link /* @IE */-{- background-color: #EFEBDE; /* gray */-}--span.dynatree-has-children a-{-}--span.dynatree-expanded a-{-}--span.dynatree-selected a-{- color: green;- font-style: italic;-}--span.dynatree-active a-{- background-color: #3169C6 !important;- color: white !important; /* @ IE6 */-}--/*******************************************************************************- * Drag'n'drop support- */--/*** Helper object ************************************************************/-div.dynatree-drag-helper-{-}-div.dynatree-drag-helper a-{- border: 1px solid gray;- background-color: white;- padding-left: 5px;- padding-right: 5px;- opacity: 0.8;-}-span.dynatree-drag-helper-img-{- /*- position: relative;- left: -16px;- */-}-div.dynatree-drag-helper /*.dynatree-drop-accept*/-{--/* border-color: green;- background-color: red;*/-}-div.dynatree-drop-accept span.dynatree-drag-helper-img-{- background-position: -32px -112px;-}-div.dynatree-drag-helper.dynatree-drop-reject-{- border-color: red;-}-div.dynatree-drop-reject span.dynatree-drag-helper-img-{- background-position: -16px -112px;-}--/*** Drop marker icon *********************************************************/--#dynatree-drop-marker-{- width: 24px;- position: absolute;- background-position: 0 -128px;- margin: 0;-/* border: 1px solid red; */-}-#dynatree-drop-marker.dynatree-drop-after,-#dynatree-drop-marker.dynatree-drop-before-{- width:64px;- background-position: 0 -144px;-}-#dynatree-drop-marker.dynatree-drop-copy-{- background-position: -64px -128px;-}-#dynatree-drop-marker.dynatree-drop-move-{- background-position: -64px -128px;-}--/*** Source node while dragging ***********************************************/--span.dynatree-drag-source-{- /* border: 1px dotted gray; */- background-color: #e0e0e0;-}-span.dynatree-drag-source a-{- color: gray;-}--/*** Target node while dragging cursor is over it *****************************/--span.dynatree-drop-target-{- /*border: 1px solid gray;*/-}-span.dynatree-drop-target a-{-}-span.dynatree-drop-target.dynatree-drop-accept a-{- /*border: 1px solid green;*/- background-color: #3169C6 !important;- color: white !important; /* @ IE6 */- text-decoration: none;-}-span.dynatree-drop-target.dynatree-drop-reject-{- /*border: 1px solid red;*/-}-span.dynatree-drop-target.dynatree-drop-after a-{-}---/*******************************************************************************- * Custom node classes (sample)- */--span.custom1 a-{- background-color: maroon;- color: yellow;-}diff --git a/data/libs/dynatree/skin/vline-rtl.gif b/data/libs/dynatree/skin/vline-rtl.gifdeleted file mode 100644index 0400cb3ee..000000000Binary files a/data/libs/dynatree/skin/vline-rtl.gif and /dev/null differdiff --git a/data/libs/dynatree/skin/vline.gif b/data/libs/dynatree/skin/vline.gifdeleted file mode 100644index 1b00ae50e..000000000Binary files a/data/libs/dynatree/skin/vline.gif and /dev/null differdiff --git a/data/libs/jquery/jquery-1.8.2.js b/data/libs/jquery/jquery-1.8.2.jsdeleted file mode 100644index d4f3bb38c..000000000--- a/data/libs/jquery/jquery-1.8.2.js+++ /dev/null@@ -1,9440 +0,0 @@-/*!- * jQuery JavaScript Library v1.8.2- * http://jquery.com/- *- * Includes Sizzle.js- * http://sizzlejs.com/- *- * Copyright 2012 jQuery Foundation and other contributors- * Released under the MIT license- * http://jquery.org/license- *- * Date: Thu Sep 20 2012 21:13:05 GMT-0400 (Eastern Daylight Time)- */-(function( window, undefined ) {-var- // A central reference to the root jQuery(document)- rootjQuery,-- // The deferred used on DOM ready- readyList,-- // Use the correct document accordingly with window argument (sandbox)- document = window.document,- location = window.location,- navigator = window.navigator,-- // Map over jQuery in case of overwrite- _jQuery = window.jQuery,-- // Map over the $ in case of overwrite- _$ = window.$,-- // Save a reference to some core methods- core_push = Array.prototype.push,- core_slice = Array.prototype.slice,- core_indexOf = Array.prototype.indexOf,- core_toString = Object.prototype.toString,- core_hasOwn = Object.prototype.hasOwnProperty,- core_trim = String.prototype.trim,-- // Define a local copy of jQuery- jQuery = function( selector, context ) {- // The jQuery object is actually just the init constructor 'enhanced'- return new jQuery.fn.init( selector, context, rootjQuery );- },-- // Used for matching numbers- core_pnum = /[\-+]?(?:\d*\.|)\d+(?:[eE][\-+]?\d+|)/.source,-- // Used for detecting and trimming whitespace- core_rnotwhite = /\S/,- core_rspace = /\s+/,-- // Make sure we trim BOM and NBSP (here's looking at you, Safari 5.0 and IE)- rtrim = /^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,-- // A simple way to check for HTML strings- // Prioritize #id over <tag> to avoid XSS via location.hash (#9521)- rquickExpr = /^(?:[^#<]*(<[\w\W]+>)[^>]*$|#([\w\-]*)$)/,-- // Match a standalone tag- rsingleTag = /^<(\w+)\s*\/?>(?:<\/\1>|)$/,-- // JSON RegExp- rvalidchars = /^[\],:{}\s]*$/,- rvalidbraces = /(?:^|:|,)(?:\s*\[)+/g,- rvalidescape = /\\(?:["\\\/bfnrt]|u[\da-fA-F]{4})/g,- rvalidtokens = /"[^"\\\r\n]*"|true|false|null|-?(?:\d\d*\.|)\d+(?:[eE][\-+]?\d+|)/g,-- // Matches dashed string for camelizing- rmsPrefix = /^-ms-/,- rdashAlpha = /-([\da-z])/gi,-- // Used by jQuery.camelCase as callback to replace()- fcamelCase = function( all, letter ) {- return ( letter + "" ).toUpperCase();- },-- // The ready event handler and self cleanup method- DOMContentLoaded = function() {- if ( document.addEventListener ) {- document.removeEventListener( "DOMContentLoaded", DOMContentLoaded, false );- jQuery.ready();- } else if ( document.readyState === "complete" ) {- // we're here because readyState === "complete" in oldIE- // which is good enough for us to call the dom ready!- document.detachEvent( "onreadystatechange", DOMContentLoaded );- jQuery.ready();- }- },-- // [[Class]] -> type pairs- class2type = {};--jQuery.fn = jQuery.prototype = {- constructor: jQuery,- init: function( selector, context, rootjQuery ) {- var match, elem, ret, doc;-- // Handle $(""), $(null), $(undefined), $(false)- if ( !selector ) {- return this;- }-- // Handle $(DOMElement)- if ( selector.nodeType ) {- this.context = this[0] = selector;- this.length = 1;- return this;- }-- // Handle HTML strings- if ( typeof selector === "string" ) {- if ( selector.charAt(0) === "<" && selector.charAt( selector.length - 1 ) === ">" && selector.length >= 3 ) {- // Assume that strings that start and end with <> are HTML and skip the regex check- match = [ null, selector, null ];-- } else {- match = rquickExpr.exec( selector );- }-- // Match html or make sure no context is specified for #id- if ( match && (match[1] || !context) ) {-- // HANDLE: $(html) -> $(array)- if ( match[1] ) {- context = context instanceof jQuery ? context[0] : context;- doc = ( context && context.nodeType ? context.ownerDocument || context : document );-- // scripts is true for back-compat- selector = jQuery.parseHTML( match[1], doc, true );- if ( rsingleTag.test( match[1] ) && jQuery.isPlainObject( context ) ) {- this.attr.call( selector, context, true );- }-- return jQuery.merge( this, selector );-- // HANDLE: $(#id)- } else {- elem = document.getElementById( match[2] );-- // Check parentNode to catch when Blackberry 4.6 returns- // nodes that are no longer in the document #6963- if ( elem && elem.parentNode ) {- // Handle the case where IE and Opera return items- // by name instead of ID- if ( elem.id !== match[2] ) {- return rootjQuery.find( selector );- }-- // Otherwise, we inject the element directly into the jQuery object- this.length = 1;- this[0] = elem;- }-- this.context = document;- this.selector = selector;- return this;- }-- // HANDLE: $(expr, $(...))- } else if ( !context || context.jquery ) {- return ( context || rootjQuery ).find( selector );-- // HANDLE: $(expr, context)- // (which is just equivalent to: $(context).find(expr)- } else {- return this.constructor( context ).find( selector );- }-- // HANDLE: $(function)- // Shortcut for document ready- } else if ( jQuery.isFunction( selector ) ) {- return rootjQuery.ready( selector );- }-- if ( selector.selector !== undefined ) {- this.selector = selector.selector;- this.context = selector.context;- }-- return jQuery.makeArray( selector, this );- },-- // Start with an empty selector- selector: "",-- // The current version of jQuery being used- jquery: "1.8.2",-- // The default length of a jQuery object is 0- length: 0,-- // The number of elements contained in the matched element set- size: function() {- return this.length;- },-- toArray: function() {- return core_slice.call( this );- },-- // Get the Nth element in the matched element set OR- // Get the whole matched element set as a clean array- get: function( num ) {- return num == null ?-- // Return a 'clean' array- this.toArray() :-- // Return just the object- ( num < 0 ? this[ this.length + num ] : this[ num ] );- },-- // Take an array of elements and push it onto the stack- // (returning the new matched element set)- pushStack: function( elems, name, selector ) {-- // Build a new jQuery matched element set- var ret = jQuery.merge( this.constructor(), elems );-- // Add the old object onto the stack (as a reference)- ret.prevObject = this;-- ret.context = this.context;-- if ( name === "find" ) {- ret.selector = this.selector + ( this.selector ? " " : "" ) + selector;- } else if ( name ) {- ret.selector = this.selector + "." + name + "(" + selector + ")";- }-- // Return the newly-formed element set- return ret;- },-- // Execute a callback for every element in the matched set.- // (You can seed the arguments with an array of args, but this is- // only used internally.)- each: function( callback, args ) {- return jQuery.each( this, callback, args );- },-- ready: function( fn ) {- // Add the callback- jQuery.ready.promise().done( fn );-- return this;- },-- eq: function( i ) {- i = +i;- return i === -1 ?- this.slice( i ) :- this.slice( i, i + 1 );- },-- first: function() {- return this.eq( 0 );- },-- last: function() {- return this.eq( -1 );- },-- slice: function() {- return this.pushStack( core_slice.apply( this, arguments ),- "slice", core_slice.call(arguments).join(",") );- },-- map: function( callback ) {- return this.pushStack( jQuery.map(this, function( elem, i ) {- return callback.call( elem, i, elem );- }));- },-- end: function() {- return this.prevObject || this.constructor(null);- },-- // For internal use only.- // Behaves like an Array's method, not like a jQuery method.- push: core_push,- sort: [].sort,- splice: [].splice-};--// Give the init function the jQuery prototype for later instantiation-jQuery.fn.init.prototype = jQuery.fn;--jQuery.extend = jQuery.fn.extend = function() {- var options, name, src, copy, copyIsArray, clone,- target = arguments[0] || {},- i = 1,- length = arguments.length,- deep = false;-- // Handle a deep copy situation- if ( typeof target === "boolean" ) {- deep = target;- target = arguments[1] || {};- // skip the boolean and the target- i = 2;- }-- // Handle case when target is a string or something (possible in deep copy)- if ( typeof target !== "object" && !jQuery.isFunction(target) ) {- target = {};- }-- // extend jQuery itself if only one argument is passed- if ( length === i ) {- target = this;- --i;- }-- for ( ; i < length; i++ ) {- // Only deal with non-null/undefined values- if ( (options = arguments[ i ]) != null ) {- // Extend the base object- for ( name in options ) {- src = target[ name ];- copy = options[ name ];-- // Prevent never-ending loop- if ( target === copy ) {- continue;- }-- // Recurse if we're merging plain objects or arrays- if ( deep && copy && ( jQuery.isPlainObject(copy) || (copyIsArray = jQuery.isArray(copy)) ) ) {- if ( copyIsArray ) {- copyIsArray = false;- clone = src && jQuery.isArray(src) ? src : [];-- } else {- clone = src && jQuery.isPlainObject(src) ? src : {};- }-- // Never move original objects, clone them- target[ name ] = jQuery.extend( deep, clone, copy );-- // Don't bring in undefined values- } else if ( copy !== undefined ) {- target[ name ] = copy;- }- }- }- }-- // Return the modified object- return target;-};--jQuery.extend({- noConflict: function( deep ) {- if ( window.$ === jQuery ) {- window.$ = _$;- }-- if ( deep && window.jQuery === jQuery ) {- window.jQuery = _jQuery;- }-- return jQuery;- },-- // Is the DOM ready to be used? Set to true once it occurs.- isReady: false,-- // A counter to track how many items to wait for before- // the ready event fires. See #6781- readyWait: 1,-- // Hold (or release) the ready event- holdReady: function( hold ) {- if ( hold ) {- jQuery.readyWait++;- } else {- jQuery.ready( true );- }- },-- // Handle when the DOM is ready- ready: function( wait ) {-- // Abort if there are pending holds or we're already ready- if ( wait === true ? --jQuery.readyWait : jQuery.isReady ) {- return;- }-- // Make sure body exists, at least, in case IE gets a little overzealous (ticket #5443).- if ( !document.body ) {- return setTimeout( jQuery.ready, 1 );- }-- // Remember that the DOM is ready- jQuery.isReady = true;-- // If a normal DOM Ready event fired, decrement, and wait if need be- if ( wait !== true && --jQuery.readyWait > 0 ) {- return;- }-- // If there are functions bound, to execute- readyList.resolveWith( document, [ jQuery ] );-- // Trigger any bound ready events- if ( jQuery.fn.trigger ) {- jQuery( document ).trigger("ready").off("ready");- }- },-- // See test/unit/core.js for details concerning isFunction.- // Since version 1.3, DOM methods and functions like alert- // aren't supported. They return false on IE (#2968).- isFunction: function( obj ) {- return jQuery.type(obj) === "function";- },-- isArray: Array.isArray || function( obj ) {- return jQuery.type(obj) === "array";- },-- isWindow: function( obj ) {- return obj != null && obj == obj.window;- },-- isNumeric: function( obj ) {- return !isNaN( parseFloat(obj) ) && isFinite( obj );- },-- type: function( obj ) {- return obj == null ?- String( obj ) :- class2type[ core_toString.call(obj) ] || "object";- },-- isPlainObject: function( obj ) {- // Must be an Object.- // Because of IE, we also have to check the presence of the constructor property.- // Make sure that DOM nodes and window objects don't pass through, as well- if ( !obj || jQuery.type(obj) !== "object" || obj.nodeType || jQuery.isWindow( obj ) ) {- return false;- }-- try {- // Not own constructor property must be Object- if ( obj.constructor &&- !core_hasOwn.call(obj, "constructor") &&- !core_hasOwn.call(obj.constructor.prototype, "isPrototypeOf") ) {- return false;- }- } catch ( e ) {- // IE8,9 Will throw exceptions on certain host objects #9897- return false;- }-- // Own properties are enumerated firstly, so to speed up,- // if last one is own, then all properties are own.-- var key;- for ( key in obj ) {}-- return key === undefined || core_hasOwn.call( obj, key );- },-- isEmptyObject: function( obj ) {- var name;- for ( name in obj ) {- return false;- }- return true;- },-- error: function( msg ) {- throw new Error( msg );- },-- // data: string of html- // context (optional): If specified, the fragment will be created in this context, defaults to document- // scripts (optional): If true, will include scripts passed in the html string- parseHTML: function( data, context, scripts ) {- var parsed;- if ( !data || typeof data !== "string" ) {- return null;- }- if ( typeof context === "boolean" ) {- scripts = context;- context = 0;- }- context = context || document;-- // Single tag- if ( (parsed = rsingleTag.exec( data )) ) {- return [ context.createElement( parsed[1] ) ];- }-- parsed = jQuery.buildFragment( [ data ], context, scripts ? null : [] );- return jQuery.merge( [],- (parsed.cacheable ? jQuery.clone( parsed.fragment ) : parsed.fragment).childNodes );- },-- parseJSON: function( data ) {- if ( !data || typeof data !== "string") {- return null;- }-- // Make sure leading/trailing whitespace is removed (IE can't handle it)- data = jQuery.trim( data );-- // Attempt to parse using the native JSON parser first- if ( window.JSON && window.JSON.parse ) {- return window.JSON.parse( data );- }-- // Make sure the incoming data is actual JSON- // Logic borrowed from http://json.org/json2.js- if ( rvalidchars.test( data.replace( rvalidescape, "@" )- .replace( rvalidtokens, "]" )- .replace( rvalidbraces, "")) ) {-- return ( new Function( "return " + data ) )();-- }- jQuery.error( "Invalid JSON: " + data );- },-- // Cross-browser xml parsing- parseXML: function( data ) {- var xml, tmp;- if ( !data || typeof data !== "string" ) {- return null;- }- try {- if ( window.DOMParser ) { // Standard- tmp = new DOMParser();- xml = tmp.parseFromString( data , "text/xml" );- } else { // IE- xml = new ActiveXObject( "Microsoft.XMLDOM" );- xml.async = "false";- xml.loadXML( data );- }- } catch( e ) {- xml = undefined;- }- if ( !xml || !xml.documentElement || xml.getElementsByTagName( "parsererror" ).length ) {- jQuery.error( "Invalid XML: " + data );- }- return xml;- },-- noop: function() {},-- // Evaluates a script in a global context- // Workarounds based on findings by Jim Driscoll- // http://weblogs.java.net/blog/driscoll/archive/2009/09/08/eval-javascript-global-context- globalEval: function( data ) {- if ( data && core_rnotwhite.test( data ) ) {- // We use execScript on Internet Explorer- // We use an anonymous function so that context is window- // rather than jQuery in Firefox- ( window.execScript || function( data ) {- window[ "eval" ].call( window, data );- } )( data );- }- },-- // Convert dashed to camelCase; used by the css and data modules- // Microsoft forgot to hump their vendor prefix (#9572)- camelCase: function( string ) {- return string.replace( rmsPrefix, "ms-" ).replace( rdashAlpha, fcamelCase );- },-- nodeName: function( elem, name ) {- return elem.nodeName && elem.nodeName.toLowerCase() === name.toLowerCase();- },-- // args is for internal usage only- each: function( obj, callback, args ) {- var name,- i = 0,- length = obj.length,- isObj = length === undefined || jQuery.isFunction( obj );-- if ( args ) {- if ( isObj ) {- for ( name in obj ) {- if ( callback.apply( obj[ name ], args ) === false ) {- break;- }- }- } else {- for ( ; i < length; ) {- if ( callback.apply( obj[ i++ ], args ) === false ) {- break;- }- }- }-- // A special, fast, case for the most common use of each- } else {- if ( isObj ) {- for ( name in obj ) {- if ( callback.call( obj[ name ], name, obj[ name ] ) === false ) {- break;- }- }- } else {- for ( ; i < length; ) {- if ( callback.call( obj[ i ], i, obj[ i++ ] ) === false ) {- break;- }- }- }- }-- return obj;- },-- // Use native String.trim function wherever possible- trim: core_trim && !core_trim.call("\uFEFF\xA0") ?- function( text ) {- return text == null ?- "" :- core_trim.call( text );- } :-- // Otherwise use our own trimming functionality- function( text ) {- return text == null ?- "" :- ( text + "" ).replace( rtrim, "" );- },-- // results is for internal usage only- makeArray: function( arr, results ) {- var type,- ret = results || [];-- if ( arr != null ) {- // The window, strings (and functions) also have 'length'- // Tweaked logic slightly to handle Blackberry 4.7 RegExp issues #6930- type = jQuery.type( arr );-- if ( arr.length == null || type === "string" || type === "function" || type === "regexp" || jQuery.isWindow( arr ) ) {- core_push.call( ret, arr );- } else {- jQuery.merge( ret, arr );- }- }-- return ret;- },-- inArray: function( elem, arr, i ) {- var len;-- if ( arr ) {- if ( core_indexOf ) {- return core_indexOf.call( arr, elem, i );- }-- len = arr.length;- i = i ? i < 0 ? Math.max( 0, len + i ) : i : 0;-- for ( ; i < len; i++ ) {- // Skip accessing in sparse arrays- if ( i in arr && arr[ i ] === elem ) {- return i;- }- }- }-- return -1;- },-- merge: function( first, second ) {- var l = second.length,- i = first.length,- j = 0;-- if ( typeof l === "number" ) {- for ( ; j < l; j++ ) {- first[ i++ ] = second[ j ];- }-- } else {- while ( second[j] !== undefined ) {- first[ i++ ] = second[ j++ ];- }- }-- first.length = i;-- return first;- },-- grep: function( elems, callback, inv ) {- var retVal,- ret = [],- i = 0,- length = elems.length;- inv = !!inv;-- // Go through the array, only saving the items- // that pass the validator function- for ( ; i < length; i++ ) {- retVal = !!callback( elems[ i ], i );- if ( inv !== retVal ) {- ret.push( elems[ i ] );- }- }-- return ret;- },-- // arg is for internal usage only- map: function( elems, callback, arg ) {- var value, key,- ret = [],- i = 0,- length = elems.length,- // jquery objects are treated as arrays- isArray = elems instanceof jQuery || length !== undefined && typeof length === "number" && ( ( length > 0 && elems[ 0 ] && elems[ length -1 ] ) || length === 0 || jQuery.isArray( elems ) ) ;-- // Go through the array, translating each of the items to their- if ( isArray ) {- for ( ; i < length; i++ ) {- value = callback( elems[ i ], i, arg );-- if ( value != null ) {- ret[ ret.length ] = value;- }- }-- // Go through every key on the object,- } else {- for ( key in elems ) {- value = callback( elems[ key ], key, arg );-- if ( value != null ) {- ret[ ret.length ] = value;- }- }- }-- // Flatten any nested arrays- return ret.concat.apply( [], ret );- },-- // A global GUID counter for objects- guid: 1,-- // Bind a function to a context, optionally partially applying any- // arguments.- proxy: function( fn, context ) {- var tmp, args, proxy;-- if ( typeof context === "string" ) {- tmp = fn[ context ];- context = fn;- fn = tmp;- }-- // Quick check to determine if target is callable, in the spec- // this throws a TypeError, but we will just return undefined.- if ( !jQuery.isFunction( fn ) ) {- return undefined;- }-- // Simulated bind- args = core_slice.call( arguments, 2 );- proxy = function() {- return fn.apply( context, args.concat( core_slice.call( arguments ) ) );- };-- // Set the guid of unique handler to the same of original handler, so it can be removed- proxy.guid = fn.guid = fn.guid || jQuery.guid++;-- return proxy;- },-- // Multifunctional method to get and set values of a collection- // The value/s can optionally be executed if it's a function- access: function( elems, fn, key, value, chainable, emptyGet, pass ) {- var exec,- bulk = key == null,- i = 0,- length = elems.length;-- // Sets many values- if ( key && typeof key === "object" ) {- for ( i in key ) {- jQuery.access( elems, fn, i, key[i], 1, emptyGet, value );- }- chainable = 1;-- // Sets one value- } else if ( value !== undefined ) {- // Optionally, function values get executed if exec is true- exec = pass === undefined && jQuery.isFunction( value );-- if ( bulk ) {- // Bulk operations only iterate when executing function values- if ( exec ) {- exec = fn;- fn = function( elem, key, value ) {- return exec.call( jQuery( elem ), value );- };-- // Otherwise they run against the entire set- } else {- fn.call( elems, value );- fn = null;- }- }-- if ( fn ) {- for (; i < length; i++ ) {- fn( elems[i], key, exec ? value.call( elems[i], i, fn( elems[i], key ) ) : value, pass );- }- }-- chainable = 1;- }-- return chainable ?- elems :-- // Gets- bulk ?- fn.call( elems ) :- length ? fn( elems[0], key ) : emptyGet;- },-- now: function() {- return ( new Date() ).getTime();- }-});--jQuery.ready.promise = function( obj ) {- if ( !readyList ) {-- readyList = jQuery.Deferred();-- // Catch cases where $(document).ready() is called after the browser event has already occurred.- // we once tried to use readyState "interactive" here, but it caused issues like the one- // discovered by ChrisS here: http://bugs.jquery.com/ticket/12282#comment:15- if ( document.readyState === "complete" ) {- // Handle it asynchronously to allow scripts the opportunity to delay ready- setTimeout( jQuery.ready, 1 );-- // Standards-based browsers support DOMContentLoaded- } else if ( document.addEventListener ) {- // Use the handy event callback- document.addEventListener( "DOMContentLoaded", DOMContentLoaded, false );-- // A fallback to window.onload, that will always work- window.addEventListener( "load", jQuery.ready, false );-- // If IE event model is used- } else {- // Ensure firing before onload, maybe late but safe also for iframes- document.attachEvent( "onreadystatechange", DOMContentLoaded );-- // A fallback to window.onload, that will always work- window.attachEvent( "onload", jQuery.ready );-- // If IE and not a frame- // continually check to see if the document is ready- var top = false;-- try {- top = window.frameElement == null && document.documentElement;- } catch(e) {}-- if ( top && top.doScroll ) {- (function doScrollCheck() {- if ( !jQuery.isReady ) {-- try {- // Use the trick by Diego Perini- // http://javascript.nwbox.com/IEContentLoaded/- top.doScroll("left");- } catch(e) {- return setTimeout( doScrollCheck, 50 );- }-- // and execute any waiting functions- jQuery.ready();- }- })();- }- }- }- return readyList.promise( obj );-};--// Populate the class2type map-jQuery.each("Boolean Number String Function Array Date RegExp Object".split(" "), function(i, name) {- class2type[ "[object " + name + "]" ] = name.toLowerCase();-});--// All jQuery objects should point back to these-rootjQuery = jQuery(document);-// String to Object options format cache-var optionsCache = {};--// Convert String-formatted options into Object-formatted ones and store in cache-function createOptions( options ) {- var object = optionsCache[ options ] = {};- jQuery.each( options.split( core_rspace ), function( _, flag ) {- object[ flag ] = true;- });- return object;-}--/*- * Create a callback list using the following parameters:- *- * options: an optional list of space-separated options that will change how- * the callback list behaves or a more traditional option object- *- * By default a callback list will act like an event callback list and can be- * "fired" multiple times.- *- * Possible options:- *- * once: will ensure the callback list can only be fired once (like a Deferred)- *- * memory: will keep track of previous values and will call any callback added- * after the list has been fired right away with the latest "memorized"- * values (like a Deferred)- *- * unique: will ensure a callback can only be added once (no duplicate in the list)- *- * stopOnFalse: interrupt callings when a callback returns false- *- */-jQuery.Callbacks = function( options ) {-- // Convert options from String-formatted to Object-formatted if needed- // (we check in cache first)- options = typeof options === "string" ?- ( optionsCache[ options ] || createOptions( options ) ) :- jQuery.extend( {}, options );-- var // Last fire value (for non-forgettable lists)- memory,- // Flag to know if list was already fired- fired,- // Flag to know if list is currently firing- firing,- // First callback to fire (used internally by add and fireWith)- firingStart,- // End of the loop when firing- firingLength,- // Index of currently firing callback (modified by remove if needed)- firingIndex,- // Actual callback list- list = [],- // Stack of fire calls for repeatable lists- stack = !options.once && [],- // Fire callbacks- fire = function( data ) {- memory = options.memory && data;- fired = true;- firingIndex = firingStart || 0;- firingStart = 0;- firingLength = list.length;- firing = true;- for ( ; list && firingIndex < firingLength; firingIndex++ ) {- if ( list[ firingIndex ].apply( data[ 0 ], data[ 1 ] ) === false && options.stopOnFalse ) {- memory = false; // To prevent further calls using add- break;- }- }- firing = false;- if ( list ) {- if ( stack ) {- if ( stack.length ) {- fire( stack.shift() );- }- } else if ( memory ) {- list = [];- } else {- self.disable();- }- }- },- // Actual Callbacks object- self = {- // Add a callback or a collection of callbacks to the list- add: function() {- if ( list ) {- // First, we save the current length- var start = list.length;- (function add( args ) {- jQuery.each( args, function( _, arg ) {- var type = jQuery.type( arg );- if ( type === "function" && ( !options.unique || !self.has( arg ) ) ) {- list.push( arg );- } else if ( arg && arg.length && type !== "string" ) {- // Inspect recursively- add( arg );- }- });- })( arguments );- // Do we need to add the callbacks to the- // current firing batch?- if ( firing ) {- firingLength = list.length;- // With memory, if we're not firing then- // we should call right away- } else if ( memory ) {- firingStart = start;- fire( memory );- }- }- return this;- },- // Remove a callback from the list- remove: function() {- if ( list ) {- jQuery.each( arguments, function( _, arg ) {- var index;- while( ( index = jQuery.inArray( arg, list, index ) ) > -1 ) {- list.splice( index, 1 );- // Handle firing indexes- if ( firing ) {- if ( index <= firingLength ) {- firingLength--;- }- if ( index <= firingIndex ) {- firingIndex--;- }- }- }- });- }- return this;- },- // Control if a given callback is in the list- has: function( fn ) {- return jQuery.inArray( fn, list ) > -1;- },- // Remove all callbacks from the list- empty: function() {- list = [];- return this;- },- // Have the list do nothing anymore- disable: function() {- list = stack = memory = undefined;- return this;- },- // Is it disabled?- disabled: function() {- return !list;- },- // Lock the list in its current state- lock: function() {- stack = undefined;- if ( !memory ) {- self.disable();- }- return this;- },- // Is it locked?- locked: function() {- return !stack;- },- // Call all callbacks with the given context and arguments- fireWith: function( context, args ) {- args = args || [];- args = [ context, args.slice ? args.slice() : args ];- if ( list && ( !fired || stack ) ) {- if ( firing ) {- stack.push( args );- } else {- fire( args );- }- }- return this;- },- // Call all the callbacks with the given arguments- fire: function() {- self.fireWith( this, arguments );- return this;- },- // To know if the callbacks have already been called at least once- fired: function() {- return !!fired;- }- };-- return self;-};-jQuery.extend({-- Deferred: function( func ) {- var tuples = [- // action, add listener, listener list, final state- [ "resolve", "done", jQuery.Callbacks("once memory"), "resolved" ],- [ "reject", "fail", jQuery.Callbacks("once memory"), "rejected" ],- [ "notify", "progress", jQuery.Callbacks("memory") ]- ],- state = "pending",- promise = {- state: function() {- return state;- },- always: function() {- deferred.done( arguments ).fail( arguments );- return this;- },- then: function( /* fnDone, fnFail, fnProgress */ ) {- var fns = arguments;- return jQuery.Deferred(function( newDefer ) {- jQuery.each( tuples, function( i, tuple ) {- var action = tuple[ 0 ],- fn = fns[ i ];- // deferred[ done | fail | progress ] for forwarding actions to newDefer- deferred[ tuple[1] ]( jQuery.isFunction( fn ) ?- function() {- var returned = fn.apply( this, arguments );- if ( returned && jQuery.isFunction( returned.promise ) ) {- returned.promise()- .done( newDefer.resolve )- .fail( newDefer.reject )- .progress( newDefer.notify );- } else {- newDefer[ action + "With" ]( this === deferred ? newDefer : this, [ returned ] );- }- } :- newDefer[ action ]- );- });- fns = null;- }).promise();- },- // Get a promise for this deferred- // If obj is provided, the promise aspect is added to the object- promise: function( obj ) {- return obj != null ? jQuery.extend( obj, promise ) : promise;- }- },- deferred = {};-- // Keep pipe for back-compat- promise.pipe = promise.then;-- // Add list-specific methods- jQuery.each( tuples, function( i, tuple ) {- var list = tuple[ 2 ],- stateString = tuple[ 3 ];-- // promise[ done | fail | progress ] = list.add- promise[ tuple[1] ] = list.add;-- // Handle state- if ( stateString ) {- list.add(function() {- // state = [ resolved | rejected ]- state = stateString;-- // [ reject_list | resolve_list ].disable; progress_list.lock- }, tuples[ i ^ 1 ][ 2 ].disable, tuples[ 2 ][ 2 ].lock );- }-- // deferred[ resolve | reject | notify ] = list.fire- deferred[ tuple[0] ] = list.fire;- deferred[ tuple[0] + "With" ] = list.fireWith;- });-- // Make the deferred a promise- promise.promise( deferred );-- // Call given func if any- if ( func ) {- func.call( deferred, deferred );- }-- // All done!- return deferred;- },-- // Deferred helper- when: function( subordinate /* , ..., subordinateN */ ) {- var i = 0,- resolveValues = core_slice.call( arguments ),- length = resolveValues.length,-- // the count of uncompleted subordinates- remaining = length !== 1 || ( subordinate && jQuery.isFunction( subordinate.promise ) ) ? length : 0,-- // the master Deferred. If resolveValues consist of only a single Deferred, just use that.- deferred = remaining === 1 ? subordinate : jQuery.Deferred(),-- // Update function for both resolve and progress values- updateFunc = function( i, contexts, values ) {- return function( value ) {- contexts[ i ] = this;- values[ i ] = arguments.length > 1 ? core_slice.call( arguments ) : value;- if( values === progressValues ) {- deferred.notifyWith( contexts, values );- } else if ( !( --remaining ) ) {- deferred.resolveWith( contexts, values );- }- };- },-- progressValues, progressContexts, resolveContexts;-- // add listeners to Deferred subordinates; treat others as resolved- if ( length > 1 ) {- progressValues = new Array( length );- progressContexts = new Array( length );- resolveContexts = new Array( length );- for ( ; i < length; i++ ) {- if ( resolveValues[ i ] && jQuery.isFunction( resolveValues[ i ].promise ) ) {- resolveValues[ i ].promise()- .done( updateFunc( i, resolveContexts, resolveValues ) )- .fail( deferred.reject )- .progress( updateFunc( i, progressContexts, progressValues ) );- } else {- --remaining;- }- }- }-- // if we're not waiting on anything, resolve the master- if ( !remaining ) {- deferred.resolveWith( resolveContexts, resolveValues );- }-- return deferred.promise();- }-});-jQuery.support = (function() {-- var support,- all,- a,- select,- opt,- input,- fragment,- eventName,- i,- isSupported,- clickFn,- div = document.createElement("div");-- // Preliminary tests- div.setAttribute( "className", "t" );- div.innerHTML = " <link/><table></table><a href='/a'>a</a><input type='checkbox'/>";-- all = div.getElementsByTagName("*");- a = div.getElementsByTagName("a")[ 0 ];- a.style.cssText = "top:1px;float:left;opacity:.5";-- // Can't get basic test support- if ( !all || !all.length ) {- return {};- }-- // First batch of supports tests- select = document.createElement("select");- opt = select.appendChild( document.createElement("option") );- input = div.getElementsByTagName("input")[ 0 ];-- support = {- // IE strips leading whitespace when .innerHTML is used- leadingWhitespace: ( div.firstChild.nodeType === 3 ),-- // Make sure that tbody elements aren't automatically inserted- // IE will insert them into empty tables- tbody: !div.getElementsByTagName("tbody").length,-- // Make sure that link elements get serialized correctly by innerHTML- // This requires a wrapper element in IE- htmlSerialize: !!div.getElementsByTagName("link").length,-- // Get the style information from getAttribute- // (IE uses .cssText instead)- style: /top/.test( a.getAttribute("style") ),-- // Make sure that URLs aren't manipulated- // (IE normalizes it by default)- hrefNormalized: ( a.getAttribute("href") === "/a" ),-- // Make sure that element opacity exists- // (IE uses filter instead)- // Use a regex to work around a WebKit issue. See #5145- opacity: /^0.5/.test( a.style.opacity ),-- // Verify style float existence- // (IE uses styleFloat instead of cssFloat)- cssFloat: !!a.style.cssFloat,-- // Make sure that if no value is specified for a checkbox- // that it defaults to "on".- // (WebKit defaults to "" instead)- checkOn: ( input.value === "on" ),-- // Make sure that a selected-by-default option has a working selected property.- // (WebKit defaults to false instead of true, IE too, if it's in an optgroup)- optSelected: opt.selected,-- // Test setAttribute on camelCase class. If it works, we need attrFixes when doing get/setAttribute (ie6/7)- getSetAttribute: div.className !== "t",-- // Tests for enctype support on a form(#6743)- enctype: !!document.createElement("form").enctype,-- // Makes sure cloning an html5 element does not cause problems- // Where outerHTML is undefined, this still works- html5Clone: document.createElement("nav").cloneNode( true ).outerHTML !== "<:nav></:nav>",-- // jQuery.support.boxModel DEPRECATED in 1.8 since we don't support Quirks Mode- boxModel: ( document.compatMode === "CSS1Compat" ),-- // Will be defined later- submitBubbles: true,- changeBubbles: true,- focusinBubbles: false,- deleteExpando: true,- noCloneEvent: true,- inlineBlockNeedsLayout: false,- shrinkWrapBlocks: false,- reliableMarginRight: true,- boxSizingReliable: true,- pixelPosition: false- };-- // Make sure checked status is properly cloned- input.checked = true;- support.noCloneChecked = input.cloneNode( true ).checked;-- // Make sure that the options inside disabled selects aren't marked as disabled- // (WebKit marks them as disabled)- select.disabled = true;- support.optDisabled = !opt.disabled;-- // Test to see if it's possible to delete an expando from an element- // Fails in Internet Explorer- try {- delete div.test;- } catch( e ) {- support.deleteExpando = false;- }-- if ( !div.addEventListener && div.attachEvent && div.fireEvent ) {- div.attachEvent( "onclick", clickFn = function() {- // Cloning a node shouldn't copy over any- // bound event handlers (IE does this)- support.noCloneEvent = false;- });- div.cloneNode( true ).fireEvent("onclick");- div.detachEvent( "onclick", clickFn );- }-- // Check if a radio maintains its value- // after being appended to the DOM- input = document.createElement("input");- input.value = "t";- input.setAttribute( "type", "radio" );- support.radioValue = input.value === "t";-- input.setAttribute( "checked", "checked" );-- // #11217 - WebKit loses check when the name is after the checked attribute- input.setAttribute( "name", "t" );-- div.appendChild( input );- fragment = document.createDocumentFragment();- fragment.appendChild( div.lastChild );-- // WebKit doesn't clone checked state correctly in fragments- support.checkClone = fragment.cloneNode( true ).cloneNode( true ).lastChild.checked;-- // Check if a disconnected checkbox will retain its checked- // value of true after appended to the DOM (IE6/7)- support.appendChecked = input.checked;-- fragment.removeChild( input );- fragment.appendChild( div );-- // Technique from Juriy Zaytsev- // http://perfectionkills.com/detecting-event-support-without-browser-sniffing/- // We only care about the case where non-standard event systems- // are used, namely in IE. Short-circuiting here helps us to- // avoid an eval call (in setAttribute) which can cause CSP- // to go haywire. See: https://developer.mozilla.org/en/Security/CSP- if ( div.attachEvent ) {- for ( i in {- submit: true,- change: true,- focusin: true- }) {- eventName = "on" + i;- isSupported = ( eventName in div );- if ( !isSupported ) {- div.setAttribute( eventName, "return;" );- isSupported = ( typeof div[ eventName ] === "function" );- }- support[ i + "Bubbles" ] = isSupported;- }- }-- // Run tests that need a body at doc ready- jQuery(function() {- var container, div, tds, marginDiv,- divReset = "padding:0;margin:0;border:0;display:block;overflow:hidden;",- body = document.getElementsByTagName("body")[0];-- if ( !body ) {- // Return for frameset docs that don't have a body- return;- }-- container = document.createElement("div");- container.style.cssText = "visibility:hidden;border:0;width:0;height:0;position:static;top:0;margin-top:1px";- body.insertBefore( container, body.firstChild );-- // Construct the test element- div = document.createElement("div");- container.appendChild( div );-- // Check if table cells still have offsetWidth/Height when they are set- // to display:none and there are still other visible table cells in a- // table row; if so, offsetWidth/Height are not reliable for use when- // determining if an element has been hidden directly using- // display:none (it is still safe to use offsets if a parent element is- // hidden; don safety goggles and see bug #4512 for more information).- // (only IE 8 fails this test)- div.innerHTML = "<table><tr><td></td><td>t</td></tr></table>";- tds = div.getElementsByTagName("td");- tds[ 0 ].style.cssText = "padding:0;margin:0;border:0;display:none";- isSupported = ( tds[ 0 ].offsetHeight === 0 );-- tds[ 0 ].style.display = "";- tds[ 1 ].style.display = "none";-- // Check if empty table cells still have offsetWidth/Height- // (IE <= 8 fail this test)- support.reliableHiddenOffsets = isSupported && ( tds[ 0 ].offsetHeight === 0 );-- // Check box-sizing and margin behavior- div.innerHTML = "";- div.style.cssText = "box-sizing:border-box;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;padding:1px;border:1px;display:block;width:4px;margin-top:1%;position:absolute;top:1%;";- support.boxSizing = ( div.offsetWidth === 4 );- support.doesNotIncludeMarginInBodyOffset = ( body.offsetTop !== 1 );-- // NOTE: To any future maintainer, we've window.getComputedStyle- // because jsdom on node.js will break without it.- if ( window.getComputedStyle ) {- support.pixelPosition = ( window.getComputedStyle( div, null ) || {} ).top !== "1%";- support.boxSizingReliable = ( window.getComputedStyle( div, null ) || { width: "4px" } ).width === "4px";-- // Check if div with explicit width and no margin-right incorrectly- // gets computed margin-right based on width of container. For more- // info see bug #3333- // Fails in WebKit before Feb 2011 nightlies- // WebKit Bug 13343 - getComputedStyle returns wrong value for margin-right- marginDiv = document.createElement("div");- marginDiv.style.cssText = div.style.cssText = divReset;- marginDiv.style.marginRight = marginDiv.style.width = "0";- div.style.width = "1px";- div.appendChild( marginDiv );- support.reliableMarginRight =- !parseFloat( ( window.getComputedStyle( marginDiv, null ) || {} ).marginRight );- }-- if ( typeof div.style.zoom !== "undefined" ) {- // Check if natively block-level elements act like inline-block- // elements when setting their display to 'inline' and giving- // them layout- // (IE < 8 does this)- div.innerHTML = "";- div.style.cssText = divReset + "width:1px;padding:1px;display:inline;zoom:1";- support.inlineBlockNeedsLayout = ( div.offsetWidth === 3 );-- // Check if elements with layout shrink-wrap their children- // (IE 6 does this)- div.style.display = "block";- div.style.overflow = "visible";- div.innerHTML = "<div></div>";- div.firstChild.style.width = "5px";- support.shrinkWrapBlocks = ( div.offsetWidth !== 3 );-- container.style.zoom = 1;- }-- // Null elements to avoid leaks in IE- body.removeChild( container );- container = div = tds = marginDiv = null;- });-- // Null elements to avoid leaks in IE- fragment.removeChild( div );- all = a = select = opt = input = fragment = div = null;-- return support;-})();-var rbrace = /(?:\{[\s\S]*\}|\[[\s\S]*\])$/,- rmultiDash = /([A-Z])/g;--jQuery.extend({- cache: {},-- deletedIds: [],-- // Remove at next major release (1.9/2.0)- uuid: 0,-- // Unique for each copy of jQuery on the page- // Non-digits removed to match rinlinejQuery- expando: "jQuery" + ( jQuery.fn.jquery + Math.random() ).replace( /\D/g, "" ),-- // The following elements throw uncatchable exceptions if you- // attempt to add expando properties to them.- noData: {- "embed": true,- // Ban all objects except for Flash (which handle expandos)- "object": "clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",- "applet": true- },-- hasData: function( elem ) {- elem = elem.nodeType ? jQuery.cache[ elem[jQuery.expando] ] : elem[ jQuery.expando ];- return !!elem && !isEmptyDataObject( elem );- },-- data: function( elem, name, data, pvt /* Internal Use Only */ ) {- if ( !jQuery.acceptData( elem ) ) {- return;- }-- var thisCache, ret,- internalKey = jQuery.expando,- getByName = typeof name === "string",-- // We have to handle DOM nodes and JS objects differently because IE6-7- // can't GC object references properly across the DOM-JS boundary- isNode = elem.nodeType,-- // Only DOM nodes need the global jQuery cache; JS object data is- // attached directly to the object so GC can occur automatically- cache = isNode ? jQuery.cache : elem,-- // Only defining an ID for JS objects if its cache already exists allows- // the code to shortcut on the same path as a DOM node with no cache- id = isNode ? elem[ internalKey ] : elem[ internalKey ] && internalKey;-- // Avoid doing any more work than we need to when trying to get data on an- // object that has no data at all- if ( (!id || !cache[id] || (!pvt && !cache[id].data)) && getByName && data === undefined ) {- return;- }-- if ( !id ) {- // Only DOM nodes need a new unique ID for each element since their data- // ends up in the global cache- if ( isNode ) {- elem[ internalKey ] = id = jQuery.deletedIds.pop() || jQuery.guid++;- } else {- id = internalKey;- }- }-- if ( !cache[ id ] ) {- cache[ id ] = {};-- // Avoids exposing jQuery metadata on plain JS objects when the object- // is serialized using JSON.stringify- if ( !isNode ) {- cache[ id ].toJSON = jQuery.noop;- }- }-- // An object can be passed to jQuery.data instead of a key/value pair; this gets- // shallow copied over onto the existing cache- if ( typeof name === "object" || typeof name === "function" ) {- if ( pvt ) {- cache[ id ] = jQuery.extend( cache[ id ], name );- } else {- cache[ id ].data = jQuery.extend( cache[ id ].data, name );- }- }-- thisCache = cache[ id ];-- // jQuery data() is stored in a separate object inside the object's internal data- // cache in order to avoid key collisions between internal data and user-defined- // data.- if ( !pvt ) {- if ( !thisCache.data ) {- thisCache.data = {};- }-- thisCache = thisCache.data;- }-- if ( data !== undefined ) {- thisCache[ jQuery.camelCase( name ) ] = data;- }-- // Check for both converted-to-camel and non-converted data property names- // If a data property was specified- if ( getByName ) {-- // First Try to find as-is property data- ret = thisCache[ name ];-- // Test for null|undefined property data- if ( ret == null ) {-- // Try to find the camelCased property- ret = thisCache[ jQuery.camelCase( name ) ];- }- } else {- ret = thisCache;- }-- return ret;- },-- removeData: function( elem, name, pvt /* Internal Use Only */ ) {- if ( !jQuery.acceptData( elem ) ) {- return;- }-- var thisCache, i, l,-- isNode = elem.nodeType,-- // See jQuery.data for more information- cache = isNode ? jQuery.cache : elem,- id = isNode ? elem[ jQuery.expando ] : jQuery.expando;-- // If there is already no cache entry for this object, there is no- // purpose in continuing- if ( !cache[ id ] ) {- return;- }-- if ( name ) {-- thisCache = pvt ? cache[ id ] : cache[ id ].data;-- if ( thisCache ) {-- // Support array or space separated string names for data keys- if ( !jQuery.isArray( name ) ) {-- // try the string as a key before any manipulation- if ( name in thisCache ) {- name = [ name ];- } else {-- // split the camel cased version by spaces unless a key with the spaces exists- name = jQuery.camelCase( name );- if ( name in thisCache ) {- name = [ name ];- } else {- name = name.split(" ");- }- }- }-- for ( i = 0, l = name.length; i < l; i++ ) {- delete thisCache[ name[i] ];- }-- // If there is no data left in the cache, we want to continue- // and let the cache object itself get destroyed- if ( !( pvt ? isEmptyDataObject : jQuery.isEmptyObject )( thisCache ) ) {- return;- }- }- }-- // See jQuery.data for more information- if ( !pvt ) {- delete cache[ id ].data;-- // Don't destroy the parent cache unless the internal data object- // had been the only thing left in it- if ( !isEmptyDataObject( cache[ id ] ) ) {- return;- }- }-- // Destroy the cache- if ( isNode ) {- jQuery.cleanData( [ elem ], true );-- // Use delete when supported for expandos or `cache` is not a window per isWindow (#10080)- } else if ( jQuery.support.deleteExpando || cache != cache.window ) {- delete cache[ id ];-- // When all else fails, null- } else {- cache[ id ] = null;- }- },-- // For internal use only.- _data: function( elem, name, data ) {- return jQuery.data( elem, name, data, true );- },-- // A method for determining if a DOM node can handle the data expando- acceptData: function( elem ) {- var noData = elem.nodeName && jQuery.noData[ elem.nodeName.toLowerCase() ];-- // nodes accept data unless otherwise specified; rejection can be conditional- return !noData || noData !== true && elem.getAttribute("classid") === noData;- }-});--jQuery.fn.extend({- data: function( key, value ) {- var parts, part, attr, name, l,- elem = this[0],- i = 0,- data = null;-- // Gets all values- if ( key === undefined ) {- if ( this.length ) {- data = jQuery.data( elem );-- if ( elem.nodeType === 1 && !jQuery._data( elem, "parsedAttrs" ) ) {- attr = elem.attributes;- for ( l = attr.length; i < l; i++ ) {- name = attr[i].name;-- if ( !name.indexOf( "data-" ) ) {- name = jQuery.camelCase( name.substring(5) );-- dataAttr( elem, name, data[ name ] );- }- }- jQuery._data( elem, "parsedAttrs", true );- }- }-- return data;- }-- // Sets multiple values- if ( typeof key === "object" ) {- return this.each(function() {- jQuery.data( this, key );- });- }-- parts = key.split( ".", 2 );- parts[1] = parts[1] ? "." + parts[1] : "";- part = parts[1] + "!";-- return jQuery.access( this, function( value ) {-- if ( value === undefined ) {- data = this.triggerHandler( "getData" + part, [ parts[0] ] );-- // Try to fetch any internally stored data first- if ( data === undefined && elem ) {- data = jQuery.data( elem, key );- data = dataAttr( elem, key, data );- }-- return data === undefined && parts[1] ?- this.data( parts[0] ) :- data;- }-- parts[1] = value;- this.each(function() {- var self = jQuery( this );-- self.triggerHandler( "setData" + part, parts );- jQuery.data( this, key, value );- self.triggerHandler( "changeData" + part, parts );- });- }, null, value, arguments.length > 1, null, false );- },-- removeData: function( key ) {- return this.each(function() {- jQuery.removeData( this, key );- });- }-});--function dataAttr( elem, key, data ) {- // If nothing was found internally, try to fetch any- // data from the HTML5 data-* attribute- if ( data === undefined && elem.nodeType === 1 ) {-- var name = "data-" + key.replace( rmultiDash, "-$1" ).toLowerCase();-- data = elem.getAttribute( name );-- if ( typeof data === "string" ) {- try {- data = data === "true" ? true :- data === "false" ? false :- data === "null" ? null :- // Only convert to a number if it doesn't change the string- +data + "" === data ? +data :- rbrace.test( data ) ? jQuery.parseJSON( data ) :- data;- } catch( e ) {}-- // Make sure we set the data so it isn't changed later- jQuery.data( elem, key, data );-- } else {- data = undefined;- }- }-- return data;-}--// checks a cache object for emptiness-function isEmptyDataObject( obj ) {- var name;- for ( name in obj ) {-- // if the public data object is empty, the private is still empty- if ( name === "data" && jQuery.isEmptyObject( obj[name] ) ) {- continue;- }- if ( name !== "toJSON" ) {- return false;- }- }-- return true;-}-jQuery.extend({- queue: function( elem, type, data ) {- var queue;-- if ( elem ) {- type = ( type || "fx" ) + "queue";- queue = jQuery._data( elem, type );-- // Speed up dequeue by getting out quickly if this is just a lookup- if ( data ) {- if ( !queue || jQuery.isArray(data) ) {- queue = jQuery._data( elem, type, jQuery.makeArray(data) );- } else {- queue.push( data );- }- }- return queue || [];- }- },-- dequeue: function( elem, type ) {- type = type || "fx";-- var queue = jQuery.queue( elem, type ),- startLength = queue.length,- fn = queue.shift(),- hooks = jQuery._queueHooks( elem, type ),- next = function() {- jQuery.dequeue( elem, type );- };-- // If the fx queue is dequeued, always remove the progress sentinel- if ( fn === "inprogress" ) {- fn = queue.shift();- startLength--;- }-- if ( fn ) {-- // Add a progress sentinel to prevent the fx queue from being- // automatically dequeued- if ( type === "fx" ) {- queue.unshift( "inprogress" );- }-- // clear up the last queue stop function- delete hooks.stop;- fn.call( elem, next, hooks );- }-- if ( !startLength && hooks ) {- hooks.empty.fire();- }- },-- // not intended for public consumption - generates a queueHooks object, or returns the current one- _queueHooks: function( elem, type ) {- var key = type + "queueHooks";- return jQuery._data( elem, key ) || jQuery._data( elem, key, {- empty: jQuery.Callbacks("once memory").add(function() {- jQuery.removeData( elem, type + "queue", true );- jQuery.removeData( elem, key, true );- })- });- }-});--jQuery.fn.extend({- queue: function( type, data ) {- var setter = 2;-- if ( typeof type !== "string" ) {- data = type;- type = "fx";- setter--;- }-- if ( arguments.length < setter ) {- return jQuery.queue( this[0], type );- }-- return data === undefined ?- this :- this.each(function() {- var queue = jQuery.queue( this, type, data );-- // ensure a hooks for this queue- jQuery._queueHooks( this, type );-- if ( type === "fx" && queue[0] !== "inprogress" ) {- jQuery.dequeue( this, type );- }- });- },- dequeue: function( type ) {- return this.each(function() {- jQuery.dequeue( this, type );- });- },- // Based off of the plugin by Clint Helfers, with permission.- // http://blindsignals.com/index.php/2009/07/jquery-delay/- delay: function( time, type ) {- time = jQuery.fx ? jQuery.fx.speeds[ time ] || time : time;- type = type || "fx";-- return this.queue( type, function( next, hooks ) {- var timeout = setTimeout( next, time );- hooks.stop = function() {- clearTimeout( timeout );- };- });- },- clearQueue: function( type ) {- return this.queue( type || "fx", [] );- },- // Get a promise resolved when queues of a certain type- // are emptied (fx is the type by default)- promise: function( type, obj ) {- var tmp,- count = 1,- defer = jQuery.Deferred(),- elements = this,- i = this.length,- resolve = function() {- if ( !( --count ) ) {- defer.resolveWith( elements, [ elements ] );- }- };-- if ( typeof type !== "string" ) {- obj = type;- type = undefined;- }- type = type || "fx";-- while( i-- ) {- tmp = jQuery._data( elements[ i ], type + "queueHooks" );- if ( tmp && tmp.empty ) {- count++;- tmp.empty.add( resolve );- }- }- resolve();- return defer.promise( obj );- }-});-var nodeHook, boolHook, fixSpecified,- rclass = /[\t\r\n]/g,- rreturn = /\r/g,- rtype = /^(?:button|input)$/i,- rfocusable = /^(?:button|input|object|select|textarea)$/i,- rclickable = /^a(?:rea|)$/i,- rboolean = /^(?:autofocus|autoplay|async|checked|controls|defer|disabled|hidden|loop|multiple|open|readonly|required|scoped|selected)$/i,- getSetAttribute = jQuery.support.getSetAttribute;--jQuery.fn.extend({- attr: function( name, value ) {- return jQuery.access( this, jQuery.attr, name, value, arguments.length > 1 );- },-- removeAttr: function( name ) {- return this.each(function() {- jQuery.removeAttr( this, name );- });- },-- prop: function( name, value ) {- return jQuery.access( this, jQuery.prop, name, value, arguments.length > 1 );- },-- removeProp: function( name ) {- name = jQuery.propFix[ name ] || name;- return this.each(function() {- // try/catch handles cases where IE balks (such as removing a property on window)- try {- this[ name ] = undefined;- delete this[ name ];- } catch( e ) {}- });- },-- addClass: function( value ) {- var classNames, i, l, elem,- setClass, c, cl;-- if ( jQuery.isFunction( value ) ) {- return this.each(function( j ) {- jQuery( this ).addClass( value.call(this, j, this.className) );- });- }-- if ( value && typeof value === "string" ) {- classNames = value.split( core_rspace );-- for ( i = 0, l = this.length; i < l; i++ ) {- elem = this[ i ];-- if ( elem.nodeType === 1 ) {- if ( !elem.className && classNames.length === 1 ) {- elem.className = value;-- } else {- setClass = " " + elem.className + " ";-- for ( c = 0, cl = classNames.length; c < cl; c++ ) {- if ( setClass.indexOf( " " + classNames[ c ] + " " ) < 0 ) {- setClass += classNames[ c ] + " ";- }- }- elem.className = jQuery.trim( setClass );- }- }- }- }-- return this;- },-- removeClass: function( value ) {- var removes, className, elem, c, cl, i, l;-- if ( jQuery.isFunction( value ) ) {- return this.each(function( j ) {- jQuery( this ).removeClass( value.call(this, j, this.className) );- });- }- if ( (value && typeof value === "string") || value === undefined ) {- removes = ( value || "" ).split( core_rspace );-- for ( i = 0, l = this.length; i < l; i++ ) {- elem = this[ i ];- if ( elem.nodeType === 1 && elem.className ) {-- className = (" " + elem.className + " ").replace( rclass, " " );-- // loop over each item in the removal list- for ( c = 0, cl = removes.length; c < cl; c++ ) {- // Remove until there is nothing to remove,- while ( className.indexOf(" " + removes[ c ] + " ") >= 0 ) {- className = className.replace( " " + removes[ c ] + " " , " " );- }- }- elem.className = value ? jQuery.trim( className ) : "";- }- }- }-- return this;- },-- toggleClass: function( value, stateVal ) {- var type = typeof value,- isBool = typeof stateVal === "boolean";-- if ( jQuery.isFunction( value ) ) {- return this.each(function( i ) {- jQuery( this ).toggleClass( value.call(this, i, this.className, stateVal), stateVal );- });- }-- return this.each(function() {- if ( type === "string" ) {- // toggle individual class names- var className,- i = 0,- self = jQuery( this ),- state = stateVal,- classNames = value.split( core_rspace );-- while ( (className = classNames[ i++ ]) ) {- // check each className given, space separated list- state = isBool ? state : !self.hasClass( className );- self[ state ? "addClass" : "removeClass" ]( className );- }-- } else if ( type === "undefined" || type === "boolean" ) {- if ( this.className ) {- // store className if set- jQuery._data( this, "__className__", this.className );- }-- // toggle whole className- this.className = this.className || value === false ? "" : jQuery._data( this, "__className__" ) || "";- }- });- },-- hasClass: function( selector ) {- var className = " " + selector + " ",- i = 0,- l = this.length;- for ( ; i < l; i++ ) {- if ( this[i].nodeType === 1 && (" " + this[i].className + " ").replace(rclass, " ").indexOf( className ) >= 0 ) {- return true;- }- }-- return false;- },-- val: function( value ) {- var hooks, ret, isFunction,- elem = this[0];-- if ( !arguments.length ) {- if ( elem ) {- hooks = jQuery.valHooks[ elem.type ] || jQuery.valHooks[ elem.nodeName.toLowerCase() ];-- if ( hooks && "get" in hooks && (ret = hooks.get( elem, "value" )) !== undefined ) {- return ret;- }-- ret = elem.value;-- return typeof ret === "string" ?- // handle most common string cases- ret.replace(rreturn, "") :- // handle cases where value is null/undef or number- ret == null ? "" : ret;- }-- return;- }-- isFunction = jQuery.isFunction( value );-- return this.each(function( i ) {- var val,- self = jQuery(this);-- if ( this.nodeType !== 1 ) {- return;- }-- if ( isFunction ) {- val = value.call( this, i, self.val() );- } else {- val = value;- }-- // Treat null/undefined as ""; convert numbers to string- if ( val == null ) {- val = "";- } else if ( typeof val === "number" ) {- val += "";- } else if ( jQuery.isArray( val ) ) {- val = jQuery.map(val, function ( value ) {- return value == null ? "" : value + "";- });- }-- hooks = jQuery.valHooks[ this.type ] || jQuery.valHooks[ this.nodeName.toLowerCase() ];-- // If set returns undefined, fall back to normal setting- if ( !hooks || !("set" in hooks) || hooks.set( this, val, "value" ) === undefined ) {- this.value = val;- }- });- }-});--jQuery.extend({- valHooks: {- option: {- get: function( elem ) {- // attributes.value is undefined in Blackberry 4.7 but- // uses .value. See #6932- var val = elem.attributes.value;- return !val || val.specified ? elem.value : elem.text;- }- },- select: {- get: function( elem ) {- var value, i, max, option,- index = elem.selectedIndex,- values = [],- options = elem.options,- one = elem.type === "select-one";-- // Nothing was selected- if ( index < 0 ) {- return null;- }-- // Loop through all the selected options- i = one ? index : 0;- max = one ? index + 1 : options.length;- for ( ; i < max; i++ ) {- option = options[ i ];-- // Don't return options that are disabled or in a disabled optgroup- if ( option.selected && (jQuery.support.optDisabled ? !option.disabled : option.getAttribute("disabled") === null) &&- (!option.parentNode.disabled || !jQuery.nodeName( option.parentNode, "optgroup" )) ) {-- // Get the specific value for the option- value = jQuery( option ).val();-- // We don't need an array for one selects- if ( one ) {- return value;- }-- // Multi-Selects return an array- values.push( value );- }- }-- // Fixes Bug #2551 -- select.val() broken in IE after form.reset()- if ( one && !values.length && options.length ) {- return jQuery( options[ index ] ).val();- }-- return values;- },-- set: function( elem, value ) {- var values = jQuery.makeArray( value );-- jQuery(elem).find("option").each(function() {- this.selected = jQuery.inArray( jQuery(this).val(), values ) >= 0;- });-- if ( !values.length ) {- elem.selectedIndex = -1;- }- return values;- }- }- },-- // Unused in 1.8, left in so attrFn-stabbers won't die; remove in 1.9- attrFn: {},-- attr: function( elem, name, value, pass ) {- var ret, hooks, notxml,- nType = elem.nodeType;-- // don't get/set attributes on text, comment and attribute nodes- if ( !elem || nType === 3 || nType === 8 || nType === 2 ) {- return;- }-- if ( pass && jQuery.isFunction( jQuery.fn[ name ] ) ) {- return jQuery( elem )[ name ]( value );- }-- // Fallback to prop when attributes are not supported- if ( typeof elem.getAttribute === "undefined" ) {- return jQuery.prop( elem, name, value );- }-- notxml = nType !== 1 || !jQuery.isXMLDoc( elem );-- // All attributes are lowercase- // Grab necessary hook if one is defined- if ( notxml ) {- name = name.toLowerCase();- hooks = jQuery.attrHooks[ name ] || ( rboolean.test( name ) ? boolHook : nodeHook );- }-- if ( value !== undefined ) {-- if ( value === null ) {- jQuery.removeAttr( elem, name );- return;-- } else if ( hooks && "set" in hooks && notxml && (ret = hooks.set( elem, value, name )) !== undefined ) {- return ret;-- } else {- elem.setAttribute( name, value + "" );- return value;- }-- } else if ( hooks && "get" in hooks && notxml && (ret = hooks.get( elem, name )) !== null ) {- return ret;-- } else {-- ret = elem.getAttribute( name );-- // Non-existent attributes return null, we normalize to undefined- return ret === null ?- undefined :- ret;- }- },-- removeAttr: function( elem, value ) {- var propName, attrNames, name, isBool,- i = 0;-- if ( value && elem.nodeType === 1 ) {-- attrNames = value.split( core_rspace );-- for ( ; i < attrNames.length; i++ ) {- name = attrNames[ i ];-- if ( name ) {- propName = jQuery.propFix[ name ] || name;- isBool = rboolean.test( name );-- // See #9699 for explanation of this approach (setting first, then removal)- // Do not do this for boolean attributes (see #10870)- if ( !isBool ) {- jQuery.attr( elem, name, "" );- }- elem.removeAttribute( getSetAttribute ? name : propName );-- // Set corresponding property to false for boolean attributes- if ( isBool && propName in elem ) {- elem[ propName ] = false;- }- }- }- }- },-- attrHooks: {- type: {- set: function( elem, value ) {- // We can't allow the type property to be changed (since it causes problems in IE)- if ( rtype.test( elem.nodeName ) && elem.parentNode ) {- jQuery.error( "type property can't be changed" );- } else if ( !jQuery.support.radioValue && value === "radio" && jQuery.nodeName(elem, "input") ) {- // Setting the type on a radio button after the value resets the value in IE6-9- // Reset value to it's default in case type is set after value- // This is for element creation- var val = elem.value;- elem.setAttribute( "type", value );- if ( val ) {- elem.value = val;- }- return value;- }- }- },- // Use the value property for back compat- // Use the nodeHook for button elements in IE6/7 (#1954)- value: {- get: function( elem, name ) {- if ( nodeHook && jQuery.nodeName( elem, "button" ) ) {- return nodeHook.get( elem, name );- }- return name in elem ?- elem.value :- null;- },- set: function( elem, value, name ) {- if ( nodeHook && jQuery.nodeName( elem, "button" ) ) {- return nodeHook.set( elem, value, name );- }- // Does not return so that setAttribute is also used- elem.value = value;- }- }- },-- propFix: {- tabindex: "tabIndex",- readonly: "readOnly",- "for": "htmlFor",- "class": "className",- maxlength: "maxLength",- cellspacing: "cellSpacing",- cellpadding: "cellPadding",- rowspan: "rowSpan",- colspan: "colSpan",- usemap: "useMap",- frameborder: "frameBorder",- contenteditable: "contentEditable"- },-- prop: function( elem, name, value ) {- var ret, hooks, notxml,- nType = elem.nodeType;-- // don't get/set properties on text, comment and attribute nodes- if ( !elem || nType === 3 || nType === 8 || nType === 2 ) {- return;- }-- notxml = nType !== 1 || !jQuery.isXMLDoc( elem );-- if ( notxml ) {- // Fix name and attach hooks- name = jQuery.propFix[ name ] || name;- hooks = jQuery.propHooks[ name ];- }-- if ( value !== undefined ) {- if ( hooks && "set" in hooks && (ret = hooks.set( elem, value, name )) !== undefined ) {- return ret;-- } else {- return ( elem[ name ] = value );- }-- } else {- if ( hooks && "get" in hooks && (ret = hooks.get( elem, name )) !== null ) {- return ret;-- } else {- return elem[ name ];- }- }- },-- propHooks: {- tabIndex: {- get: function( elem ) {- // elem.tabIndex doesn't always return the correct value when it hasn't been explicitly set- // http://fluidproject.org/blog/2008/01/09/getting-setting-and-removing-tabindex-values-with-javascript/- var attributeNode = elem.getAttributeNode("tabindex");-- return attributeNode && attributeNode.specified ?- parseInt( attributeNode.value, 10 ) :- rfocusable.test( elem.nodeName ) || rclickable.test( elem.nodeName ) && elem.href ?- 0 :- undefined;- }- }- }-});--// Hook for boolean attributes-boolHook = {- get: function( elem, name ) {- // Align boolean attributes with corresponding properties- // Fall back to attribute presence where some booleans are not supported- var attrNode,- property = jQuery.prop( elem, name );- return property === true || typeof property !== "boolean" && ( attrNode = elem.getAttributeNode(name) ) && attrNode.nodeValue !== false ?- name.toLowerCase() :- undefined;- },- set: function( elem, value, name ) {- var propName;- if ( value === false ) {- // Remove boolean attributes when set to false- jQuery.removeAttr( elem, name );- } else {- // value is true since we know at this point it's type boolean and not false- // Set boolean attributes to the same name and set the DOM property- propName = jQuery.propFix[ name ] || name;- if ( propName in elem ) {- // Only set the IDL specifically if it already exists on the element- elem[ propName ] = true;- }-- elem.setAttribute( name, name.toLowerCase() );- }- return name;- }-};--// IE6/7 do not support getting/setting some attributes with get/setAttribute-if ( !getSetAttribute ) {-- fixSpecified = {- name: true,- id: true,- coords: true- };-- // Use this for any attribute in IE6/7- // This fixes almost every IE6/7 issue- nodeHook = jQuery.valHooks.button = {- get: function( elem, name ) {- var ret;- ret = elem.getAttributeNode( name );- return ret && ( fixSpecified[ name ] ? ret.value !== "" : ret.specified ) ?- ret.value :- undefined;- },- set: function( elem, value, name ) {- // Set the existing or create a new attribute node- var ret = elem.getAttributeNode( name );- if ( !ret ) {- ret = document.createAttribute( name );- elem.setAttributeNode( ret );- }- return ( ret.value = value + "" );- }- };-- // Set width and height to auto instead of 0 on empty string( Bug #8150 )- // This is for removals- jQuery.each([ "width", "height" ], function( i, name ) {- jQuery.attrHooks[ name ] = jQuery.extend( jQuery.attrHooks[ name ], {- set: function( elem, value ) {- if ( value === "" ) {- elem.setAttribute( name, "auto" );- return value;- }- }- });- });-- // Set contenteditable to false on removals(#10429)- // Setting to empty string throws an error as an invalid value- jQuery.attrHooks.contenteditable = {- get: nodeHook.get,- set: function( elem, value, name ) {- if ( value === "" ) {- value = "false";- }- nodeHook.set( elem, value, name );- }- };-}---// Some attributes require a special call on IE-if ( !jQuery.support.hrefNormalized ) {- jQuery.each([ "href", "src", "width", "height" ], function( i, name ) {- jQuery.attrHooks[ name ] = jQuery.extend( jQuery.attrHooks[ name ], {- get: function( elem ) {- var ret = elem.getAttribute( name, 2 );- return ret === null ? undefined : ret;- }- });- });-}--if ( !jQuery.support.style ) {- jQuery.attrHooks.style = {- get: function( elem ) {- // Return undefined in the case of empty string- // Normalize to lowercase since IE uppercases css property names- return elem.style.cssText.toLowerCase() || undefined;- },- set: function( elem, value ) {- return ( elem.style.cssText = value + "" );- }- };-}--// Safari mis-reports the default selected property of an option-// Accessing the parent's selectedIndex property fixes it-if ( !jQuery.support.optSelected ) {- jQuery.propHooks.selected = jQuery.extend( jQuery.propHooks.selected, {- get: function( elem ) {- var parent = elem.parentNode;-- if ( parent ) {- parent.selectedIndex;-- // Make sure that it also works with optgroups, see #5701- if ( parent.parentNode ) {- parent.parentNode.selectedIndex;- }- }- return null;- }- });-}--// IE6/7 call enctype encoding-if ( !jQuery.support.enctype ) {- jQuery.propFix.enctype = "encoding";-}--// Radios and checkboxes getter/setter-if ( !jQuery.support.checkOn ) {- jQuery.each([ "radio", "checkbox" ], function() {- jQuery.valHooks[ this ] = {- get: function( elem ) {- // Handle the case where in Webkit "" is returned instead of "on" if a value isn't specified- return elem.getAttribute("value") === null ? "on" : elem.value;- }- };- });-}-jQuery.each([ "radio", "checkbox" ], function() {- jQuery.valHooks[ this ] = jQuery.extend( jQuery.valHooks[ this ], {- set: function( elem, value ) {- if ( jQuery.isArray( value ) ) {- return ( elem.checked = jQuery.inArray( jQuery(elem).val(), value ) >= 0 );- }- }- });-});-var rformElems = /^(?:textarea|input|select)$/i,- rtypenamespace = /^([^\.]*|)(?:\.(.+)|)$/,- rhoverHack = /(?:^|\s)hover(\.\S+|)\b/,- rkeyEvent = /^key/,- rmouseEvent = /^(?:mouse|contextmenu)|click/,- rfocusMorph = /^(?:focusinfocus|focusoutblur)$/,- hoverHack = function( events ) {- return jQuery.event.special.hover ? events : events.replace( rhoverHack, "mouseenter$1 mouseleave$1" );- };--/*- * Helper functions for managing events -- not part of the public interface.- * Props to Dean Edwards' addEvent library for many of the ideas.- */-jQuery.event = {-- add: function( elem, types, handler, data, selector ) {-- var elemData, eventHandle, events,- t, tns, type, namespaces, handleObj,- handleObjIn, handlers, special;-- // Don't attach events to noData or text/comment nodes (allow plain objects tho)- if ( elem.nodeType === 3 || elem.nodeType === 8 || !types || !handler || !(elemData = jQuery._data( elem )) ) {- return;- }-- // Caller can pass in an object of custom data in lieu of the handler- if ( handler.handler ) {- handleObjIn = handler;- handler = handleObjIn.handler;- selector = handleObjIn.selector;- }-- // Make sure that the handler has a unique ID, used to find/remove it later- if ( !handler.guid ) {- handler.guid = jQuery.guid++;- }-- // Init the element's event structure and main handler, if this is the first- events = elemData.events;- if ( !events ) {- elemData.events = events = {};- }- eventHandle = elemData.handle;- if ( !eventHandle ) {- elemData.handle = eventHandle = function( e ) {- // Discard the second event of a jQuery.event.trigger() and- // when an event is called after a page has unloaded- return typeof jQuery !== "undefined" && (!e || jQuery.event.triggered !== e.type) ?- jQuery.event.dispatch.apply( eventHandle.elem, arguments ) :- undefined;- };- // Add elem as a property of the handle fn to prevent a memory leak with IE non-native events- eventHandle.elem = elem;- }-- // Handle multiple events separated by a space- // jQuery(...).bind("mouseover mouseout", fn);- types = jQuery.trim( hoverHack(types) ).split( " " );- for ( t = 0; t < types.length; t++ ) {-- tns = rtypenamespace.exec( types[t] ) || [];- type = tns[1];- namespaces = ( tns[2] || "" ).split( "." ).sort();-- // If event changes its type, use the special event handlers for the changed type- special = jQuery.event.special[ type ] || {};-- // If selector defined, determine special event api type, otherwise given type- type = ( selector ? special.delegateType : special.bindType ) || type;-- // Update special based on newly reset type- special = jQuery.event.special[ type ] || {};-- // handleObj is passed to all event handlers- handleObj = jQuery.extend({- type: type,- origType: tns[1],- data: data,- handler: handler,- guid: handler.guid,- selector: selector,- needsContext: selector && jQuery.expr.match.needsContext.test( selector ),- namespace: namespaces.join(".")- }, handleObjIn );-- // Init the event handler queue if we're the first- handlers = events[ type ];- if ( !handlers ) {- handlers = events[ type ] = [];- handlers.delegateCount = 0;-- // Only use addEventListener/attachEvent if the special events handler returns false- if ( !special.setup || special.setup.call( elem, data, namespaces, eventHandle ) === false ) {- // Bind the global event handler to the element- if ( elem.addEventListener ) {- elem.addEventListener( type, eventHandle, false );-- } else if ( elem.attachEvent ) {- elem.attachEvent( "on" + type, eventHandle );- }- }- }-- if ( special.add ) {- special.add.call( elem, handleObj );-- if ( !handleObj.handler.guid ) {- handleObj.handler.guid = handler.guid;- }- }-- // Add to the element's handler list, delegates in front- if ( selector ) {- handlers.splice( handlers.delegateCount++, 0, handleObj );- } else {- handlers.push( handleObj );- }-- // Keep track of which events have ever been used, for event optimization- jQuery.event.global[ type ] = true;- }-- // Nullify elem to prevent memory leaks in IE- elem = null;- },-- global: {},-- // Detach an event or set of events from an element- remove: function( elem, types, handler, selector, mappedTypes ) {-- var t, tns, type, origType, namespaces, origCount,- j, events, special, eventType, handleObj,- elemData = jQuery.hasData( elem ) && jQuery._data( elem );-- if ( !elemData || !(events = elemData.events) ) {- return;- }-- // Once for each type.namespace in types; type may be omitted- types = jQuery.trim( hoverHack( types || "" ) ).split(" ");- for ( t = 0; t < types.length; t++ ) {- tns = rtypenamespace.exec( types[t] ) || [];- type = origType = tns[1];- namespaces = tns[2];-- // Unbind all events (on this namespace, if provided) for the element- if ( !type ) {- for ( type in events ) {- jQuery.event.remove( elem, type + types[ t ], handler, selector, true );- }- continue;- }-- special = jQuery.event.special[ type ] || {};- type = ( selector? special.delegateType : special.bindType ) || type;- eventType = events[ type ] || [];- origCount = eventType.length;- namespaces = namespaces ? new RegExp("(^|\\.)" + namespaces.split(".").sort().join("\\.(?:.*\\.|)") + "(\\.|$)") : null;-- // Remove matching events- for ( j = 0; j < eventType.length; j++ ) {- handleObj = eventType[ j ];-- if ( ( mappedTypes || origType === handleObj.origType ) &&- ( !handler || handler.guid === handleObj.guid ) &&- ( !namespaces || namespaces.test( handleObj.namespace ) ) &&- ( !selector || selector === handleObj.selector || selector === "**" && handleObj.selector ) ) {- eventType.splice( j--, 1 );-- if ( handleObj.selector ) {- eventType.delegateCount--;- }- if ( special.remove ) {- special.remove.call( elem, handleObj );- }- }- }-- // Remove generic event handler if we removed something and no more handlers exist- // (avoids potential for endless recursion during removal of special event handlers)- if ( eventType.length === 0 && origCount !== eventType.length ) {- if ( !special.teardown || special.teardown.call( elem, namespaces, elemData.handle ) === false ) {- jQuery.removeEvent( elem, type, elemData.handle );- }-- delete events[ type ];- }- }-- // Remove the expando if it's no longer used- if ( jQuery.isEmptyObject( events ) ) {- delete elemData.handle;-- // removeData also checks for emptiness and clears the expando if empty- // so use it instead of delete- jQuery.removeData( elem, "events", true );- }- },-- // Events that are safe to short-circuit if no handlers are attached.- // Native DOM events should not be added, they may have inline handlers.- customEvent: {- "getData": true,- "setData": true,- "changeData": true- },-- trigger: function( event, data, elem, onlyHandlers ) {- // Don't do events on text and comment nodes- if ( elem && (elem.nodeType === 3 || elem.nodeType === 8) ) {- return;- }-- // Event object or event type- var cache, exclusive, i, cur, old, ontype, special, handle, eventPath, bubbleType,- type = event.type || event,- namespaces = [];-- // focus/blur morphs to focusin/out; ensure we're not firing them right now- if ( rfocusMorph.test( type + jQuery.event.triggered ) ) {- return;- }-- if ( type.indexOf( "!" ) >= 0 ) {- // Exclusive events trigger only for the exact event (no namespaces)- type = type.slice(0, -1);- exclusive = true;- }-- if ( type.indexOf( "." ) >= 0 ) {- // Namespaced trigger; create a regexp to match event type in handle()- namespaces = type.split(".");- type = namespaces.shift();- namespaces.sort();- }-- if ( (!elem || jQuery.event.customEvent[ type ]) && !jQuery.event.global[ type ] ) {- // No jQuery handlers for this event type, and it can't have inline handlers- return;- }-- // Caller can pass in an Event, Object, or just an event type string- event = typeof event === "object" ?- // jQuery.Event object- event[ jQuery.expando ] ? event :- // Object literal- new jQuery.Event( type, event ) :- // Just the event type (string)- new jQuery.Event( type );-- event.type = type;- event.isTrigger = true;- event.exclusive = exclusive;- event.namespace = namespaces.join( "." );- event.namespace_re = event.namespace? new RegExp("(^|\\.)" + namespaces.join("\\.(?:.*\\.|)") + "(\\.|$)") : null;- ontype = type.indexOf( ":" ) < 0 ? "on" + type : "";-- // Handle a global trigger- if ( !elem ) {-- // TODO: Stop taunting the data cache; remove global events and always attach to document- cache = jQuery.cache;- for ( i in cache ) {- if ( cache[ i ].events && cache[ i ].events[ type ] ) {- jQuery.event.trigger( event, data, cache[ i ].handle.elem, true );- }- }- return;- }-- // Clean up the event in case it is being reused- event.result = undefined;- if ( !event.target ) {- event.target = elem;- }-- // Clone any incoming data and prepend the event, creating the handler arg list- data = data != null ? jQuery.makeArray( data ) : [];- data.unshift( event );-- // Allow special events to draw outside the lines- special = jQuery.event.special[ type ] || {};- if ( special.trigger && special.trigger.apply( elem, data ) === false ) {- return;- }-- // Determine event propagation path in advance, per W3C events spec (#9951)- // Bubble up to document, then to window; watch for a global ownerDocument var (#9724)- eventPath = [[ elem, special.bindType || type ]];- if ( !onlyHandlers && !special.noBubble && !jQuery.isWindow( elem ) ) {-- bubbleType = special.delegateType || type;- cur = rfocusMorph.test( bubbleType + type ) ? elem : elem.parentNode;- for ( old = elem; cur; cur = cur.parentNode ) {- eventPath.push([ cur, bubbleType ]);- old = cur;- }-- // Only add window if we got to document (e.g., not plain obj or detached DOM)- if ( old === (elem.ownerDocument || document) ) {- eventPath.push([ old.defaultView || old.parentWindow || window, bubbleType ]);- }- }-- // Fire handlers on the event path- for ( i = 0; i < eventPath.length && !event.isPropagationStopped(); i++ ) {-- cur = eventPath[i][0];- event.type = eventPath[i][1];-- handle = ( jQuery._data( cur, "events" ) || {} )[ event.type ] && jQuery._data( cur, "handle" );- if ( handle ) {- handle.apply( cur, data );- }- // Note that this is a bare JS function and not a jQuery handler- handle = ontype && cur[ ontype ];- if ( handle && jQuery.acceptData( cur ) && handle.apply && handle.apply( cur, data ) === false ) {- event.preventDefault();- }- }- event.type = type;-- // If nobody prevented the default action, do it now- if ( !onlyHandlers && !event.isDefaultPrevented() ) {-- if ( (!special._default || special._default.apply( elem.ownerDocument, data ) === false) &&- !(type === "click" && jQuery.nodeName( elem, "a" )) && jQuery.acceptData( elem ) ) {-- // Call a native DOM method on the target with the same name name as the event.- // Can't use an .isFunction() check here because IE6/7 fails that test.- // Don't do default actions on window, that's where global variables be (#6170)- // IE<9 dies on focus/blur to hidden element (#1486)- if ( ontype && elem[ type ] && ((type !== "focus" && type !== "blur") || event.target.offsetWidth !== 0) && !jQuery.isWindow( elem ) ) {-- // Don't re-trigger an onFOO event when we call its FOO() method- old = elem[ ontype ];-- if ( old ) {- elem[ ontype ] = null;- }-- // Prevent re-triggering of the same event, since we already bubbled it above- jQuery.event.triggered = type;- elem[ type ]();- jQuery.event.triggered = undefined;-- if ( old ) {- elem[ ontype ] = old;- }- }- }- }-- return event.result;- },-- dispatch: function( event ) {-- // Make a writable jQuery.Event from the native event object- event = jQuery.event.fix( event || window.event );-- var i, j, cur, ret, selMatch, matched, matches, handleObj, sel, related,- handlers = ( (jQuery._data( this, "events" ) || {} )[ event.type ] || []),- delegateCount = handlers.delegateCount,- args = core_slice.call( arguments ),- run_all = !event.exclusive && !event.namespace,- special = jQuery.event.special[ event.type ] || {},- handlerQueue = [];-- // Use the fix-ed jQuery.Event rather than the (read-only) native event- args[0] = event;- event.delegateTarget = this;-- // Call the preDispatch hook for the mapped type, and let it bail if desired- if ( special.preDispatch && special.preDispatch.call( this, event ) === false ) {- return;- }-- // Determine handlers that should run if there are delegated events- // Avoid non-left-click bubbling in Firefox (#3861)- if ( delegateCount && !(event.button && event.type === "click") ) {-- for ( cur = event.target; cur != this; cur = cur.parentNode || this ) {-- // Don't process clicks (ONLY) on disabled elements (#6911, #8165, #11382, #11764)- if ( cur.disabled !== true || event.type !== "click" ) {- selMatch = {};- matches = [];- for ( i = 0; i < delegateCount; i++ ) {- handleObj = handlers[ i ];- sel = handleObj.selector;-- if ( selMatch[ sel ] === undefined ) {- selMatch[ sel ] = handleObj.needsContext ?- jQuery( sel, this ).index( cur ) >= 0 :- jQuery.find( sel, this, null, [ cur ] ).length;- }- if ( selMatch[ sel ] ) {- matches.push( handleObj );- }- }- if ( matches.length ) {- handlerQueue.push({ elem: cur, matches: matches });- }- }- }- }-- // Add the remaining (directly-bound) handlers- if ( handlers.length > delegateCount ) {- handlerQueue.push({ elem: this, matches: handlers.slice( delegateCount ) });- }-- // Run delegates first; they may want to stop propagation beneath us- for ( i = 0; i < handlerQueue.length && !event.isPropagationStopped(); i++ ) {- matched = handlerQueue[ i ];- event.currentTarget = matched.elem;-- for ( j = 0; j < matched.matches.length && !event.isImmediatePropagationStopped(); j++ ) {- handleObj = matched.matches[ j ];-- // Triggered event must either 1) be non-exclusive and have no namespace, or- // 2) have namespace(s) a subset or equal to those in the bound event (both can have no namespace).- if ( run_all || (!event.namespace && !handleObj.namespace) || event.namespace_re && event.namespace_re.test( handleObj.namespace ) ) {-- event.data = handleObj.data;- event.handleObj = handleObj;-- ret = ( (jQuery.event.special[ handleObj.origType ] || {}).handle || handleObj.handler )- .apply( matched.elem, args );-- if ( ret !== undefined ) {- event.result = ret;- if ( ret === false ) {- event.preventDefault();- event.stopPropagation();- }- }- }- }- }-- // Call the postDispatch hook for the mapped type- if ( special.postDispatch ) {- special.postDispatch.call( this, event );- }-- return event.result;- },-- // Includes some event props shared by KeyEvent and MouseEvent- // *** attrChange attrName relatedNode srcElement are not normalized, non-W3C, deprecated, will be removed in 1.8 ***- props: "attrChange attrName relatedNode srcElement altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),-- fixHooks: {},-- keyHooks: {- props: "char charCode key keyCode".split(" "),- filter: function( event, original ) {-- // Add which for key events- if ( event.which == null ) {- event.which = original.charCode != null ? original.charCode : original.keyCode;- }-- return event;- }- },-- mouseHooks: {- props: "button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement".split(" "),- filter: function( event, original ) {- var eventDoc, doc, body,- button = original.button,- fromElement = original.fromElement;-- // Calculate pageX/Y if missing and clientX/Y available- if ( event.pageX == null && original.clientX != null ) {- eventDoc = event.target.ownerDocument || document;- doc = eventDoc.documentElement;- body = eventDoc.body;-- event.pageX = original.clientX + ( doc && doc.scrollLeft || body && body.scrollLeft || 0 ) - ( doc && doc.clientLeft || body && body.clientLeft || 0 );- event.pageY = original.clientY + ( doc && doc.scrollTop || body && body.scrollTop || 0 ) - ( doc && doc.clientTop || body && body.clientTop || 0 );- }-- // Add relatedTarget, if necessary- if ( !event.relatedTarget && fromElement ) {- event.relatedTarget = fromElement === event.target ? original.toElement : fromElement;- }-- // Add which for click: 1 === left; 2 === middle; 3 === right- // Note: button is not normalized, so don't use it- if ( !event.which && button !== undefined ) {- event.which = ( button & 1 ? 1 : ( button & 2 ? 3 : ( button & 4 ? 2 : 0 ) ) );- }-- return event;- }- },-- fix: function( event ) {- if ( event[ jQuery.expando ] ) {- return event;- }-- // Create a writable copy of the event object and normalize some properties- var i, prop,- originalEvent = event,- fixHook = jQuery.event.fixHooks[ event.type ] || {},- copy = fixHook.props ? this.props.concat( fixHook.props ) : this.props;-- event = jQuery.Event( originalEvent );-- for ( i = copy.length; i; ) {- prop = copy[ --i ];- event[ prop ] = originalEvent[ prop ];- }-- // Fix target property, if necessary (#1925, IE 6/7/8 & Safari2)- if ( !event.target ) {- event.target = originalEvent.srcElement || document;- }-- // Target should not be a text node (#504, Safari)- if ( event.target.nodeType === 3 ) {- event.target = event.target.parentNode;- }-- // For mouse/key events, metaKey==false if it's undefined (#3368, #11328; IE6/7/8)- event.metaKey = !!event.metaKey;-- return fixHook.filter? fixHook.filter( event, originalEvent ) : event;- },-- special: {- load: {- // Prevent triggered image.load events from bubbling to window.load- noBubble: true- },-- focus: {- delegateType: "focusin"- },- blur: {- delegateType: "focusout"- },-- beforeunload: {- setup: function( data, namespaces, eventHandle ) {- // We only want to do this special case on windows- if ( jQuery.isWindow( this ) ) {- this.onbeforeunload = eventHandle;- }- },-- teardown: function( namespaces, eventHandle ) {- if ( this.onbeforeunload === eventHandle ) {- this.onbeforeunload = null;- }- }- }- },-- simulate: function( type, elem, event, bubble ) {- // Piggyback on a donor event to simulate a different one.- // Fake originalEvent to avoid donor's stopPropagation, but if the- // simulated event prevents default then we do the same on the donor.- var e = jQuery.extend(- new jQuery.Event(),- event,- { type: type,- isSimulated: true,- originalEvent: {}- }- );- if ( bubble ) {- jQuery.event.trigger( e, null, elem );- } else {- jQuery.event.dispatch.call( elem, e );- }- if ( e.isDefaultPrevented() ) {- event.preventDefault();- }- }-};--// Some plugins are using, but it's undocumented/deprecated and will be removed.-// The 1.7 special event interface should provide all the hooks needed now.-jQuery.event.handle = jQuery.event.dispatch;--jQuery.removeEvent = document.removeEventListener ?- function( elem, type, handle ) {- if ( elem.removeEventListener ) {- elem.removeEventListener( type, handle, false );- }- } :- function( elem, type, handle ) {- var name = "on" + type;-- if ( elem.detachEvent ) {-- // #8545, #7054, preventing memory leaks for custom events in IE6-8 –- // detachEvent needed property on element, by name of that event, to properly expose it to GC- if ( typeof elem[ name ] === "undefined" ) {- elem[ name ] = null;- }-- elem.detachEvent( name, handle );- }- };--jQuery.Event = function( src, props ) {- // Allow instantiation without the 'new' keyword- if ( !(this instanceof jQuery.Event) ) {- return new jQuery.Event( src, props );- }-- // Event object- if ( src && src.type ) {- this.originalEvent = src;- this.type = src.type;-- // Events bubbling up the document may have been marked as prevented- // by a handler lower down the tree; reflect the correct value.- this.isDefaultPrevented = ( src.defaultPrevented || src.returnValue === false ||- src.getPreventDefault && src.getPreventDefault() ) ? returnTrue : returnFalse;-- // Event type- } else {- this.type = src;- }-- // Put explicitly provided properties onto the event object- if ( props ) {- jQuery.extend( this, props );- }-- // Create a timestamp if incoming event doesn't have one- this.timeStamp = src && src.timeStamp || jQuery.now();-- // Mark it as fixed- this[ jQuery.expando ] = true;-};--function returnFalse() {- return false;-}-function returnTrue() {- return true;-}--// jQuery.Event is based on DOM3 Events as specified by the ECMAScript Language Binding-// http://www.w3.org/TR/2003/WD-DOM-Level-3-Events-20030331/ecma-script-binding.html-jQuery.Event.prototype = {- preventDefault: function() {- this.isDefaultPrevented = returnTrue;-- var e = this.originalEvent;- if ( !e ) {- return;- }-- // if preventDefault exists run it on the original event- if ( e.preventDefault ) {- e.preventDefault();-- // otherwise set the returnValue property of the original event to false (IE)- } else {- e.returnValue = false;- }- },- stopPropagation: function() {- this.isPropagationStopped = returnTrue;-- var e = this.originalEvent;- if ( !e ) {- return;- }- // if stopPropagation exists run it on the original event- if ( e.stopPropagation ) {- e.stopPropagation();- }- // otherwise set the cancelBubble property of the original event to true (IE)- e.cancelBubble = true;- },- stopImmediatePropagation: function() {- this.isImmediatePropagationStopped = returnTrue;- this.stopPropagation();- },- isDefaultPrevented: returnFalse,- isPropagationStopped: returnFalse,- isImmediatePropagationStopped: returnFalse-};--// Create mouseenter/leave events using mouseover/out and event-time checks-jQuery.each({- mouseenter: "mouseover",- mouseleave: "mouseout"-}, function( orig, fix ) {- jQuery.event.special[ orig ] = {- delegateType: fix,- bindType: fix,-- handle: function( event ) {- var ret,- target = this,- related = event.relatedTarget,- handleObj = event.handleObj,- selector = handleObj.selector;-- // For mousenter/leave call the handler if related is outside the target.- // NB: No relatedTarget if the mouse left/entered the browser window- if ( !related || (related !== target && !jQuery.contains( target, related )) ) {- event.type = handleObj.origType;- ret = handleObj.handler.apply( this, arguments );- event.type = fix;- }- return ret;- }- };-});--// IE submit delegation-if ( !jQuery.support.submitBubbles ) {-- jQuery.event.special.submit = {- setup: function() {- // Only need this for delegated form submit events- if ( jQuery.nodeName( this, "form" ) ) {- return false;- }-- // Lazy-add a submit handler when a descendant form may potentially be submitted- jQuery.event.add( this, "click._submit keypress._submit", function( e ) {- // Node name check avoids a VML-related crash in IE (#9807)- var elem = e.target,- form = jQuery.nodeName( elem, "input" ) || jQuery.nodeName( elem, "button" ) ? elem.form : undefined;- if ( form && !jQuery._data( form, "_submit_attached" ) ) {- jQuery.event.add( form, "submit._submit", function( event ) {- event._submit_bubble = true;- });- jQuery._data( form, "_submit_attached", true );- }- });- // return undefined since we don't need an event listener- },-- postDispatch: function( event ) {- // If form was submitted by the user, bubble the event up the tree- if ( event._submit_bubble ) {- delete event._submit_bubble;- if ( this.parentNode && !event.isTrigger ) {- jQuery.event.simulate( "submit", this.parentNode, event, true );- }- }- },-- teardown: function() {- // Only need this for delegated form submit events- if ( jQuery.nodeName( this, "form" ) ) {- return false;- }-- // Remove delegated handlers; cleanData eventually reaps submit handlers attached above- jQuery.event.remove( this, "._submit" );- }- };-}--// IE change delegation and checkbox/radio fix-if ( !jQuery.support.changeBubbles ) {-- jQuery.event.special.change = {-- setup: function() {-- if ( rformElems.test( this.nodeName ) ) {- // IE doesn't fire change on a check/radio until blur; trigger it on click- // after a propertychange. Eat the blur-change in special.change.handle.- // This still fires onchange a second time for check/radio after blur.- if ( this.type === "checkbox" || this.type === "radio" ) {- jQuery.event.add( this, "propertychange._change", function( event ) {- if ( event.originalEvent.propertyName === "checked" ) {- this._just_changed = true;- }- });- jQuery.event.add( this, "click._change", function( event ) {- if ( this._just_changed && !event.isTrigger ) {- this._just_changed = false;- }- // Allow triggered, simulated change events (#11500)- jQuery.event.simulate( "change", this, event, true );- });- }- return false;- }- // Delegated event; lazy-add a change handler on descendant inputs- jQuery.event.add( this, "beforeactivate._change", function( e ) {- var elem = e.target;-- if ( rformElems.test( elem.nodeName ) && !jQuery._data( elem, "_change_attached" ) ) {- jQuery.event.add( elem, "change._change", function( event ) {- if ( this.parentNode && !event.isSimulated && !event.isTrigger ) {- jQuery.event.simulate( "change", this.parentNode, event, true );- }- });- jQuery._data( elem, "_change_attached", true );- }- });- },-- handle: function( event ) {- var elem = event.target;-- // Swallow native change events from checkbox/radio, we already triggered them above- if ( this !== elem || event.isSimulated || event.isTrigger || (elem.type !== "radio" && elem.type !== "checkbox") ) {- return event.handleObj.handler.apply( this, arguments );- }- },-- teardown: function() {- jQuery.event.remove( this, "._change" );-- return !rformElems.test( this.nodeName );- }- };-}--// Create "bubbling" focus and blur events-if ( !jQuery.support.focusinBubbles ) {- jQuery.each({ focus: "focusin", blur: "focusout" }, function( orig, fix ) {-- // Attach a single capturing handler while someone wants focusin/focusout- var attaches = 0,- handler = function( event ) {- jQuery.event.simulate( fix, event.target, jQuery.event.fix( event ), true );- };-- jQuery.event.special[ fix ] = {- setup: function() {- if ( attaches++ === 0 ) {- document.addEventListener( orig, handler, true );- }- },- teardown: function() {- if ( --attaches === 0 ) {- document.removeEventListener( orig, handler, true );- }- }- };- });-}--jQuery.fn.extend({-- on: function( types, selector, data, fn, /*INTERNAL*/ one ) {- var origFn, type;-- // Types can be a map of types/handlers- if ( typeof types === "object" ) {- // ( types-Object, selector, data )- if ( typeof selector !== "string" ) { // && selector != null- // ( types-Object, data )- data = data || selector;- selector = undefined;- }- for ( type in types ) {- this.on( type, selector, data, types[ type ], one );- }- return this;- }-- if ( data == null && fn == null ) {- // ( types, fn )- fn = selector;- data = selector = undefined;- } else if ( fn == null ) {- if ( typeof selector === "string" ) {- // ( types, selector, fn )- fn = data;- data = undefined;- } else {- // ( types, data, fn )- fn = data;- data = selector;- selector = undefined;- }- }- if ( fn === false ) {- fn = returnFalse;- } else if ( !fn ) {- return this;- }-- if ( one === 1 ) {- origFn = fn;- fn = function( event ) {- // Can use an empty set, since event contains the info- jQuery().off( event );- return origFn.apply( this, arguments );- };- // Use same guid so caller can remove using origFn- fn.guid = origFn.guid || ( origFn.guid = jQuery.guid++ );- }- return this.each( function() {- jQuery.event.add( this, types, fn, data, selector );- });- },- one: function( types, selector, data, fn ) {- return this.on( types, selector, data, fn, 1 );- },- off: function( types, selector, fn ) {- var handleObj, type;- if ( types && types.preventDefault && types.handleObj ) {- // ( event ) dispatched jQuery.Event- handleObj = types.handleObj;- jQuery( types.delegateTarget ).off(- handleObj.namespace ? handleObj.origType + "." + handleObj.namespace : handleObj.origType,- handleObj.selector,- handleObj.handler- );- return this;- }- if ( typeof types === "object" ) {- // ( types-object [, selector] )- for ( type in types ) {- this.off( type, selector, types[ type ] );- }- return this;- }- if ( selector === false || typeof selector === "function" ) {- // ( types [, fn] )- fn = selector;- selector = undefined;- }- if ( fn === false ) {- fn = returnFalse;- }- return this.each(function() {- jQuery.event.remove( this, types, fn, selector );- });- },-- bind: function( types, data, fn ) {- return this.on( types, null, data, fn );- },- unbind: function( types, fn ) {- return this.off( types, null, fn );- },-- live: function( types, data, fn ) {- jQuery( this.context ).on( types, this.selector, data, fn );- return this;- },- die: function( types, fn ) {- jQuery( this.context ).off( types, this.selector || "**", fn );- return this;- },-- delegate: function( selector, types, data, fn ) {- return this.on( types, selector, data, fn );- },- undelegate: function( selector, types, fn ) {- // ( namespace ) or ( selector, types [, fn] )- return arguments.length === 1 ? this.off( selector, "**" ) : this.off( types, selector || "**", fn );- },-- trigger: function( type, data ) {- return this.each(function() {- jQuery.event.trigger( type, data, this );- });- },- triggerHandler: function( type, data ) {- if ( this[0] ) {- return jQuery.event.trigger( type, data, this[0], true );- }- },-- toggle: function( fn ) {- // Save reference to arguments for access in closure- var args = arguments,- guid = fn.guid || jQuery.guid++,- i = 0,- toggler = function( event ) {- // Figure out which function to execute- var lastToggle = ( jQuery._data( this, "lastToggle" + fn.guid ) || 0 ) % i;- jQuery._data( this, "lastToggle" + fn.guid, lastToggle + 1 );-- // Make sure that clicks stop- event.preventDefault();-- // and execute the function- return args[ lastToggle ].apply( this, arguments ) || false;- };-- // link all the functions, so any of them can unbind this click handler- toggler.guid = guid;- while ( i < args.length ) {- args[ i++ ].guid = guid;- }-- return this.click( toggler );- },-- hover: function( fnOver, fnOut ) {- return this.mouseenter( fnOver ).mouseleave( fnOut || fnOver );- }-});--jQuery.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( i, name ) {-- // Handle event binding- jQuery.fn[ name ] = function( data, fn ) {- if ( fn == null ) {- fn = data;- data = null;- }-- return arguments.length > 0 ?- this.on( name, null, data, fn ) :- this.trigger( name );- };-- if ( rkeyEvent.test( name ) ) {- jQuery.event.fixHooks[ name ] = jQuery.event.keyHooks;- }-- if ( rmouseEvent.test( name ) ) {- jQuery.event.fixHooks[ name ] = jQuery.event.mouseHooks;- }-});-/*!- * Sizzle CSS Selector Engine- * Copyright 2012 jQuery Foundation and other contributors- * Released under the MIT license- * http://sizzlejs.com/- */-(function( window, undefined ) {--var cachedruns,- assertGetIdNotName,- Expr,- getText,- isXML,- contains,- compile,- sortOrder,- hasDuplicate,- outermostContext,-- baseHasDuplicate = true,- strundefined = "undefined",-- expando = ( "sizcache" + Math.random() ).replace( ".", "" ),-- Token = String,- document = window.document,- docElem = document.documentElement,- dirruns = 0,- done = 0,- pop = [].pop,- push = [].push,- slice = [].slice,- // Use a stripped-down indexOf if a native one is unavailable- indexOf = [].indexOf || function( elem ) {- var i = 0,- len = this.length;- for ( ; i < len; i++ ) {- if ( this[i] === elem ) {- return i;- }- }- return -1;- },-- // Augment a function for special use by Sizzle- markFunction = function( fn, value ) {- fn[ expando ] = value == null || value;- return fn;- },-- createCache = function() {- var cache = {},- keys = [];-- return markFunction(function( key, value ) {- // Only keep the most recent entries- if ( keys.push( key ) > Expr.cacheLength ) {- delete cache[ keys.shift() ];- }-- return (cache[ key ] = value);- }, cache );- },-- classCache = createCache(),- tokenCache = createCache(),- compilerCache = createCache(),-- // Regex-- // Whitespace characters http://www.w3.org/TR/css3-selectors/#whitespace- whitespace = "[\\x20\\t\\r\\n\\f]",- // http://www.w3.org/TR/css3-syntax/#characters- characterEncoding = "(?:\\\\.|[-\\w]|[^\\x00-\\xa0])+",-- // Loosely modeled on CSS identifier characters- // An unquoted value should be a CSS identifier (http://www.w3.org/TR/css3-selectors/#attribute-selectors)- // Proper syntax: http://www.w3.org/TR/CSS21/syndata.html#value-def-identifier- identifier = characterEncoding.replace( "w", "w#" ),-- // Acceptable operators http://www.w3.org/TR/selectors/#attribute-selectors- operators = "([*^$|!~]?=)",- attributes = "\\[" + whitespace + "*(" + characterEncoding + ")" + whitespace +- "*(?:" + operators + whitespace + "*(?:(['\"])((?:\\\\.|[^\\\\])*?)\\3|(" + identifier + ")|)|)" + whitespace + "*\\]",-- // Prefer arguments not in parens/brackets,- // then attribute selectors and non-pseudos (denoted by :),- // then anything else- // These preferences are here to reduce the number of selectors- // needing tokenize in the PSEUDO preFilter- pseudos = ":(" + characterEncoding + ")(?:\\((?:(['\"])((?:\\\\.|[^\\\\])*?)\\2|([^()[\\]]*|(?:(?:" + attributes + ")|[^:]|\\\\.)*|.*))\\)|)",-- // For matchExpr.POS and matchExpr.needsContext- pos = ":(even|odd|eq|gt|lt|nth|first|last)(?:\\(" + whitespace +- "*((?:-\\d)?\\d*)" + whitespace + "*\\)|)(?=[^-]|$)",-- // Leading and non-escaped trailing whitespace, capturing some non-whitespace characters preceding the latter- rtrim = new RegExp( "^" + whitespace + "+|((?:^|[^\\\\])(?:\\\\.)*)" + whitespace + "+$", "g" ),-- rcomma = new RegExp( "^" + whitespace + "*," + whitespace + "*" ),- rcombinators = new RegExp( "^" + whitespace + "*([\\x20\\t\\r\\n\\f>+~])" + whitespace + "*" ),- rpseudo = new RegExp( pseudos ),-- // Easily-parseable/retrievable ID or TAG or CLASS selectors- rquickExpr = /^(?:#([\w\-]+)|(\w+)|\.([\w\-]+))$/,-- rnot = /^:not/,- rsibling = /[\x20\t\r\n\f]*[+~]/,- rendsWithNot = /:not\($/,-- rheader = /h\d/i,- rinputs = /input|select|textarea|button/i,-- rbackslash = /\\(?!\\)/g,-- matchExpr = {- "ID": new RegExp( "^#(" + characterEncoding + ")" ),- "CLASS": new RegExp( "^\\.(" + characterEncoding + ")" ),- "NAME": new RegExp( "^\\[name=['\"]?(" + characterEncoding + ")['\"]?\\]" ),- "TAG": new RegExp( "^(" + characterEncoding.replace( "w", "w*" ) + ")" ),- "ATTR": new RegExp( "^" + attributes ),- "PSEUDO": new RegExp( "^" + pseudos ),- "POS": new RegExp( pos, "i" ),- "CHILD": new RegExp( "^:(only|nth|first|last)-child(?:\\(" + whitespace +- "*(even|odd|(([+-]|)(\\d*)n|)" + whitespace + "*(?:([+-]|)" + whitespace +- "*(\\d+)|))" + whitespace + "*\\)|)", "i" ),- // For use in libraries implementing .is()- "needsContext": new RegExp( "^" + whitespace + "*[>+~]|" + pos, "i" )- },-- // Support-- // Used for testing something on an element- assert = function( fn ) {- var div = document.createElement("div");-- try {- return fn( div );- } catch (e) {- return false;- } finally {- // release memory in IE- div = null;- }- },-- // Check if getElementsByTagName("*") returns only elements- assertTagNameNoComments = assert(function( div ) {- div.appendChild( document.createComment("") );- return !div.getElementsByTagName("*").length;- }),-- // Check if getAttribute returns normalized href attributes- assertHrefNotNormalized = assert(function( div ) {- div.innerHTML = "<a href='#'></a>";- return div.firstChild && typeof div.firstChild.getAttribute !== strundefined &&- div.firstChild.getAttribute("href") === "#";- }),-- // Check if attributes should be retrieved by attribute nodes- assertAttributes = assert(function( div ) {- div.innerHTML = "<select></select>";- var type = typeof div.lastChild.getAttribute("multiple");- // IE8 returns a string for some attributes even when not present- return type !== "boolean" && type !== "string";- }),-- // Check if getElementsByClassName can be trusted- assertUsableClassName = assert(function( div ) {- // Opera can't find a second classname (in 9.6)- div.innerHTML = "<div class='hidden e'></div><div class='hidden'></div>";- if ( !div.getElementsByClassName || !div.getElementsByClassName("e").length ) {- return false;- }-- // Safari 3.2 caches class attributes and doesn't catch changes- div.lastChild.className = "e";- return div.getElementsByClassName("e").length === 2;- }),-- // Check if getElementById returns elements by name- // Check if getElementsByName privileges form controls or returns elements by ID- assertUsableName = assert(function( div ) {- // Inject content- div.id = expando + 0;- div.innerHTML = "<a name='" + expando + "'></a><div name='" + expando + "'></div>";- docElem.insertBefore( div, docElem.firstChild );-- // Test- var pass = document.getElementsByName &&- // buggy browsers will return fewer than the correct 2- document.getElementsByName( expando ).length === 2 +- // buggy browsers will return more than the correct 0- document.getElementsByName( expando + 0 ).length;- assertGetIdNotName = !document.getElementById( expando );-- // Cleanup- docElem.removeChild( div );-- return pass;- });--// If slice is not available, provide a backup-try {- slice.call( docElem.childNodes, 0 )[0].nodeType;-} catch ( e ) {- slice = function( i ) {- var elem,- results = [];- for ( ; (elem = this[i]); i++ ) {- results.push( elem );- }- return results;- };-}--function Sizzle( selector, context, results, seed ) {- results = results || [];- context = context || document;- var match, elem, xml, m,- nodeType = context.nodeType;-- if ( !selector || typeof selector !== "string" ) {- return results;- }-- if ( nodeType !== 1 && nodeType !== 9 ) {- return [];- }-- xml = isXML( context );-- if ( !xml && !seed ) {- if ( (match = rquickExpr.exec( selector )) ) {- // Speed-up: Sizzle("#ID")- if ( (m = match[1]) ) {- if ( nodeType === 9 ) {- elem = context.getElementById( m );- // Check parentNode to catch when Blackberry 4.6 returns- // nodes that are no longer in the document #6963- if ( elem && elem.parentNode ) {- // Handle the case where IE, Opera, and Webkit return items- // by name instead of ID- if ( elem.id === m ) {- results.push( elem );- return results;- }- } else {- return results;- }- } else {- // Context is not a document- if ( context.ownerDocument && (elem = context.ownerDocument.getElementById( m )) &&- contains( context, elem ) && elem.id === m ) {- results.push( elem );- return results;- }- }-- // Speed-up: Sizzle("TAG")- } else if ( match[2] ) {- push.apply( results, slice.call(context.getElementsByTagName( selector ), 0) );- return results;-- // Speed-up: Sizzle(".CLASS")- } else if ( (m = match[3]) && assertUsableClassName && context.getElementsByClassName ) {- push.apply( results, slice.call(context.getElementsByClassName( m ), 0) );- return results;- }- }- }-- // All others- return select( selector.replace( rtrim, "$1" ), context, results, seed, xml );-}--Sizzle.matches = function( expr, elements ) {- return Sizzle( expr, null, null, elements );-};--Sizzle.matchesSelector = function( elem, expr ) {- return Sizzle( expr, null, null, [ elem ] ).length > 0;-};--// Returns a function to use in pseudos for input types-function createInputPseudo( type ) {- return function( elem ) {- var name = elem.nodeName.toLowerCase();- return name === "input" && elem.type === type;- };-}--// Returns a function to use in pseudos for buttons-function createButtonPseudo( type ) {- return function( elem ) {- var name = elem.nodeName.toLowerCase();- return (name === "input" || name === "button") && elem.type === type;- };-}--// Returns a function to use in pseudos for positionals-function createPositionalPseudo( fn ) {- return markFunction(function( argument ) {- argument = +argument;- return markFunction(function( seed, matches ) {- var j,- matchIndexes = fn( [], seed.length, argument ),- i = matchIndexes.length;-- // Match elements found at the specified indexes- while ( i-- ) {- if ( seed[ (j = matchIndexes[i]) ] ) {- seed[j] = !(matches[j] = seed[j]);- }- }- });- });-}--/**- * Utility function for retrieving the text value of an array of DOM nodes- * @param {Array|Element} elem- */-getText = Sizzle.getText = function( elem ) {- var node,- ret = "",- i = 0,- nodeType = elem.nodeType;-- if ( nodeType ) {- if ( nodeType === 1 || nodeType === 9 || nodeType === 11 ) {- // Use textContent for elements- // innerText usage removed for consistency of new lines (see #11153)- if ( typeof elem.textContent === "string" ) {- return elem.textContent;- } else {- // Traverse its children- for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) {- ret += getText( elem );- }- }- } else if ( nodeType === 3 || nodeType === 4 ) {- return elem.nodeValue;- }- // Do not include comment or processing instruction nodes- } else {-- // If no nodeType, this is expected to be an array- for ( ; (node = elem[i]); i++ ) {- // Do not traverse comment nodes- ret += getText( node );- }- }- return ret;-};--isXML = Sizzle.isXML = function( elem ) {- // documentElement is verified for cases where it doesn't yet exist- // (such as loading iframes in IE - #4833)- var documentElement = elem && (elem.ownerDocument || elem).documentElement;- return documentElement ? documentElement.nodeName !== "HTML" : false;-};--// Element contains another-contains = Sizzle.contains = docElem.contains ?- function( a, b ) {- var adown = a.nodeType === 9 ? a.documentElement : a,- bup = b && b.parentNode;- return a === bup || !!( bup && bup.nodeType === 1 && adown.contains && adown.contains(bup) );- } :- docElem.compareDocumentPosition ?- function( a, b ) {- return b && !!( a.compareDocumentPosition( b ) & 16 );- } :- function( a, b ) {- while ( (b = b.parentNode) ) {- if ( b === a ) {- return true;- }- }- return false;- };--Sizzle.attr = function( elem, name ) {- var val,- xml = isXML( elem );-- if ( !xml ) {- name = name.toLowerCase();- }- if ( (val = Expr.attrHandle[ name ]) ) {- return val( elem );- }- if ( xml || assertAttributes ) {- return elem.getAttribute( name );- }- val = elem.getAttributeNode( name );- return val ?- typeof elem[ name ] === "boolean" ?- elem[ name ] ? name : null :- val.specified ? val.value : null :- null;-};--Expr = Sizzle.selectors = {-- // Can be adjusted by the user- cacheLength: 50,-- createPseudo: markFunction,-- match: matchExpr,-- // IE6/7 return a modified href- attrHandle: assertHrefNotNormalized ?- {} :- {- "href": function( elem ) {- return elem.getAttribute( "href", 2 );- },- "type": function( elem ) {- return elem.getAttribute("type");- }- },-- find: {- "ID": assertGetIdNotName ?- function( id, context, xml ) {- if ( typeof context.getElementById !== strundefined && !xml ) {- var m = context.getElementById( id );- // Check parentNode to catch when Blackberry 4.6 returns- // nodes that are no longer in the document #6963- return m && m.parentNode ? [m] : [];- }- } :- function( id, context, xml ) {- if ( typeof context.getElementById !== strundefined && !xml ) {- var m = context.getElementById( id );-- return m ?- m.id === id || typeof m.getAttributeNode !== strundefined && m.getAttributeNode("id").value === id ?- [m] :- undefined :- [];- }- },-- "TAG": assertTagNameNoComments ?- function( tag, context ) {- if ( typeof context.getElementsByTagName !== strundefined ) {- return context.getElementsByTagName( tag );- }- } :- function( tag, context ) {- var results = context.getElementsByTagName( tag );-- // Filter out possible comments- if ( tag === "*" ) {- var elem,- tmp = [],- i = 0;-- for ( ; (elem = results[i]); i++ ) {- if ( elem.nodeType === 1 ) {- tmp.push( elem );- }- }-- return tmp;- }- return results;- },-- "NAME": assertUsableName && function( tag, context ) {- if ( typeof context.getElementsByName !== strundefined ) {- return context.getElementsByName( name );- }- },-- "CLASS": assertUsableClassName && function( className, context, xml ) {- if ( typeof context.getElementsByClassName !== strundefined && !xml ) {- return context.getElementsByClassName( className );- }- }- },-- relative: {- ">": { dir: "parentNode", first: true },- " ": { dir: "parentNode" },- "+": { dir: "previousSibling", first: true },- "~": { dir: "previousSibling" }- },-- preFilter: {- "ATTR": function( match ) {- match[1] = match[1].replace( rbackslash, "" );-- // Move the given value to match[3] whether quoted or unquoted- match[3] = ( match[4] || match[5] || "" ).replace( rbackslash, "" );-- if ( match[2] === "~=" ) {- match[3] = " " + match[3] + " ";- }-- return match.slice( 0, 4 );- },-- "CHILD": function( match ) {- /* matches from matchExpr["CHILD"]- 1 type (only|nth|...)- 2 argument (even|odd|\d*|\d*n([+-]\d+)?|...)- 3 xn-component of xn+y argument ([+-]?\d*n|)- 4 sign of xn-component- 5 x of xn-component- 6 sign of y-component- 7 y of y-component- */- match[1] = match[1].toLowerCase();-- if ( match[1] === "nth" ) {- // nth-child requires argument- if ( !match[2] ) {- Sizzle.error( match[0] );- }-- // numeric x and y parameters for Expr.filter.CHILD- // remember that false/true cast respectively to 0/1- match[3] = +( match[3] ? match[4] + (match[5] || 1) : 2 * ( match[2] === "even" || match[2] === "odd" ) );- match[4] = +( ( match[6] + match[7] ) || match[2] === "odd" );-- // other types prohibit arguments- } else if ( match[2] ) {- Sizzle.error( match[0] );- }-- return match;- },-- "PSEUDO": function( match ) {- var unquoted, excess;- if ( matchExpr["CHILD"].test( match[0] ) ) {- return null;- }-- if ( match[3] ) {- match[2] = match[3];- } else if ( (unquoted = match[4]) ) {- // Only check arguments that contain a pseudo- if ( rpseudo.test(unquoted) &&- // Get excess from tokenize (recursively)- (excess = tokenize( unquoted, true )) &&- // advance to the next closing parenthesis- (excess = unquoted.indexOf( ")", unquoted.length - excess ) - unquoted.length) ) {-- // excess is a negative index- unquoted = unquoted.slice( 0, excess );- match[0] = match[0].slice( 0, excess );- }- match[2] = unquoted;- }-- // Return only captures needed by the pseudo filter method (type and argument)- return match.slice( 0, 3 );- }- },-- filter: {- "ID": assertGetIdNotName ?- function( id ) {- id = id.replace( rbackslash, "" );- return function( elem ) {- return elem.getAttribute("id") === id;- };- } :- function( id ) {- id = id.replace( rbackslash, "" );- return function( elem ) {- var node = typeof elem.getAttributeNode !== strundefined && elem.getAttributeNode("id");- return node && node.value === id;- };- },-- "TAG": function( nodeName ) {- if ( nodeName === "*" ) {- return function() { return true; };- }- nodeName = nodeName.replace( rbackslash, "" ).toLowerCase();-- return function( elem ) {- return elem.nodeName && elem.nodeName.toLowerCase() === nodeName;- };- },-- "CLASS": function( className ) {- var pattern = classCache[ expando ][ className ];- if ( !pattern ) {- pattern = classCache( className, new RegExp("(^|" + whitespace + ")" + className + "(" + whitespace + "|$)") );- }- return function( elem ) {- return pattern.test( elem.className || (typeof elem.getAttribute !== strundefined && elem.getAttribute("class")) || "" );- };- },-- "ATTR": function( name, operator, check ) {- return function( elem, context ) {- var result = Sizzle.attr( elem, name );-- if ( result == null ) {- return operator === "!=";- }- if ( !operator ) {- return true;- }-- result += "";-- return operator === "=" ? result === check :- operator === "!=" ? result !== check :- operator === "^=" ? check && result.indexOf( check ) === 0 :- operator === "*=" ? check && result.indexOf( check ) > -1 :- operator === "$=" ? check && result.substr( result.length - check.length ) === check :- operator === "~=" ? ( " " + result + " " ).indexOf( check ) > -1 :- operator === "|=" ? result === check || result.substr( 0, check.length + 1 ) === check + "-" :- false;- };- },-- "CHILD": function( type, argument, first, last ) {-- if ( type === "nth" ) {- return function( elem ) {- var node, diff,- parent = elem.parentNode;-- if ( first === 1 && last === 0 ) {- return true;- }-- if ( parent ) {- diff = 0;- for ( node = parent.firstChild; node; node = node.nextSibling ) {- if ( node.nodeType === 1 ) {- diff++;- if ( elem === node ) {- break;- }- }- }- }-- // Incorporate the offset (or cast to NaN), then check against cycle size- diff -= last;- return diff === first || ( diff % first === 0 && diff / first >= 0 );- };- }-- return function( elem ) {- var node = elem;-- switch ( type ) {- case "only":- case "first":- while ( (node = node.previousSibling) ) {- if ( node.nodeType === 1 ) {- return false;- }- }-- if ( type === "first" ) {- return true;- }-- node = elem;-- /* falls through */- case "last":- while ( (node = node.nextSibling) ) {- if ( node.nodeType === 1 ) {- return false;- }- }-- return true;- }- };- },-- "PSEUDO": function( pseudo, argument ) {- // pseudo-class names are case-insensitive- // http://www.w3.org/TR/selectors/#pseudo-classes- // Prioritize by case sensitivity in case custom pseudos are added with uppercase letters- // Remember that setFilters inherits from pseudos- var args,- fn = Expr.pseudos[ pseudo ] || Expr.setFilters[ pseudo.toLowerCase() ] ||- Sizzle.error( "unsupported pseudo: " + pseudo );-- // The user may use createPseudo to indicate that- // arguments are needed to create the filter function- // just as Sizzle does- if ( fn[ expando ] ) {- return fn( argument );- }-- // But maintain support for old signatures- if ( fn.length > 1 ) {- args = [ pseudo, pseudo, "", argument ];- return Expr.setFilters.hasOwnProperty( pseudo.toLowerCase() ) ?- markFunction(function( seed, matches ) {- var idx,- matched = fn( seed, argument ),- i = matched.length;- while ( i-- ) {- idx = indexOf.call( seed, matched[i] );- seed[ idx ] = !( matches[ idx ] = matched[i] );- }- }) :- function( elem ) {- return fn( elem, 0, args );- };- }-- return fn;- }- },-- pseudos: {- "not": markFunction(function( selector ) {- // Trim the selector passed to compile- // to avoid treating leading and trailing- // spaces as combinators- var input = [],- results = [],- matcher = compile( selector.replace( rtrim, "$1" ) );-- return matcher[ expando ] ?- markFunction(function( seed, matches, context, xml ) {- var elem,- unmatched = matcher( seed, null, xml, [] ),- i = seed.length;-- // Match elements unmatched by `matcher`- while ( i-- ) {- if ( (elem = unmatched[i]) ) {- seed[i] = !(matches[i] = elem);- }- }- }) :- function( elem, context, xml ) {- input[0] = elem;- matcher( input, null, xml, results );- return !results.pop();- };- }),-- "has": markFunction(function( selector ) {- return function( elem ) {- return Sizzle( selector, elem ).length > 0;- };- }),-- "contains": markFunction(function( text ) {- return function( elem ) {- return ( elem.textContent || elem.innerText || getText( elem ) ).indexOf( text ) > -1;- };- }),-- "enabled": function( elem ) {- return elem.disabled === false;- },-- "disabled": function( elem ) {- return elem.disabled === true;- },-- "checked": function( elem ) {- // In CSS3, :checked should return both checked and selected elements- // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked- var nodeName = elem.nodeName.toLowerCase();- return (nodeName === "input" && !!elem.checked) || (nodeName === "option" && !!elem.selected);- },-- "selected": function( elem ) {- // Accessing this property makes selected-by-default- // options in Safari work properly- if ( elem.parentNode ) {- elem.parentNode.selectedIndex;- }-- return elem.selected === true;- },-- "parent": function( elem ) {- return !Expr.pseudos["empty"]( elem );- },-- "empty": function( elem ) {- // http://www.w3.org/TR/selectors/#empty-pseudo- // :empty is only affected by element nodes and content nodes(including text(3), cdata(4)),- // not comment, processing instructions, or others- // Thanks to Diego Perini for the nodeName shortcut- // Greater than "@" means alpha characters (specifically not starting with "#" or "?")- var nodeType;- elem = elem.firstChild;- while ( elem ) {- if ( elem.nodeName > "@" || (nodeType = elem.nodeType) === 3 || nodeType === 4 ) {- return false;- }- elem = elem.nextSibling;- }- return true;- },-- "header": function( elem ) {- return rheader.test( elem.nodeName );- },-- "text": function( elem ) {- var type, attr;- // IE6 and 7 will map elem.type to 'text' for new HTML5 types (search, etc)- // use getAttribute instead to test this case- return elem.nodeName.toLowerCase() === "input" &&- (type = elem.type) === "text" &&- ( (attr = elem.getAttribute("type")) == null || attr.toLowerCase() === type );- },-- // Input types- "radio": createInputPseudo("radio"),- "checkbox": createInputPseudo("checkbox"),- "file": createInputPseudo("file"),- "password": createInputPseudo("password"),- "image": createInputPseudo("image"),-- "submit": createButtonPseudo("submit"),- "reset": createButtonPseudo("reset"),-- "button": function( elem ) {- var name = elem.nodeName.toLowerCase();- return name === "input" && elem.type === "button" || name === "button";- },-- "input": function( elem ) {- return rinputs.test( elem.nodeName );- },-- "focus": function( elem ) {- var doc = elem.ownerDocument;- return elem === doc.activeElement && (!doc.hasFocus || doc.hasFocus()) && !!(elem.type || elem.href);- },-- "active": function( elem ) {- return elem === elem.ownerDocument.activeElement;- },-- // Positional types- "first": createPositionalPseudo(function( matchIndexes, length, argument ) {- return [ 0 ];- }),-- "last": createPositionalPseudo(function( matchIndexes, length, argument ) {- return [ length - 1 ];- }),-- "eq": createPositionalPseudo(function( matchIndexes, length, argument ) {- return [ argument < 0 ? argument + length : argument ];- }),-- "even": createPositionalPseudo(function( matchIndexes, length, argument ) {- for ( var i = 0; i < length; i += 2 ) {- matchIndexes.push( i );- }- return matchIndexes;- }),-- "odd": createPositionalPseudo(function( matchIndexes, length, argument ) {- for ( var i = 1; i < length; i += 2 ) {- matchIndexes.push( i );- }- return matchIndexes;- }),-- "lt": createPositionalPseudo(function( matchIndexes, length, argument ) {- for ( var i = argument < 0 ? argument + length : argument; --i >= 0; ) {- matchIndexes.push( i );- }- return matchIndexes;- }),-- "gt": createPositionalPseudo(function( matchIndexes, length, argument ) {- for ( var i = argument < 0 ? argument + length : argument; ++i < length; ) {- matchIndexes.push( i );- }- return matchIndexes;- })- }-};--function siblingCheck( a, b, ret ) {- if ( a === b ) {- return ret;- }-- var cur = a.nextSibling;-- while ( cur ) {- if ( cur === b ) {- return -1;- }-- cur = cur.nextSibling;- }-- return 1;-}--sortOrder = docElem.compareDocumentPosition ?- function( a, b ) {- if ( a === b ) {- hasDuplicate = true;- return 0;- }-- return ( !a.compareDocumentPosition || !b.compareDocumentPosition ?- a.compareDocumentPosition :- a.compareDocumentPosition(b) & 4- ) ? -1 : 1;- } :- function( a, b ) {- // The nodes are identical, we can exit early- if ( a === b ) {- hasDuplicate = true;- return 0;-- // Fallback to using sourceIndex (in IE) if it's available on both nodes- } else if ( a.sourceIndex && b.sourceIndex ) {- return a.sourceIndex - b.sourceIndex;- }-- var al, bl,- ap = [],- bp = [],- aup = a.parentNode,- bup = b.parentNode,- cur = aup;-- // If the nodes are siblings (or identical) we can do a quick check- if ( aup === bup ) {- return siblingCheck( a, b );-- // If no parents were found then the nodes are disconnected- } else if ( !aup ) {- return -1;-- } else if ( !bup ) {- return 1;- }-- // Otherwise they're somewhere else in the tree so we need- // to build up a full list of the parentNodes for comparison- while ( cur ) {- ap.unshift( cur );- cur = cur.parentNode;- }-- cur = bup;-- while ( cur ) {- bp.unshift( cur );- cur = cur.parentNode;- }-- al = ap.length;- bl = bp.length;-- // Start walking down the tree looking for a discrepancy- for ( var i = 0; i < al && i < bl; i++ ) {- if ( ap[i] !== bp[i] ) {- return siblingCheck( ap[i], bp[i] );- }- }-- // We ended someplace up the tree so do a sibling check- return i === al ?- siblingCheck( a, bp[i], -1 ) :- siblingCheck( ap[i], b, 1 );- };--// Always assume the presence of duplicates if sort doesn't-// pass them to our comparison function (as in Google Chrome).-[0, 0].sort( sortOrder );-baseHasDuplicate = !hasDuplicate;--// Document sorting and removing duplicates-Sizzle.uniqueSort = function( results ) {- var elem,- i = 1;-- hasDuplicate = baseHasDuplicate;- results.sort( sortOrder );-- if ( hasDuplicate ) {- for ( ; (elem = results[i]); i++ ) {- if ( elem === results[ i - 1 ] ) {- results.splice( i--, 1 );- }- }- }-- return results;-};--Sizzle.error = function( msg ) {- throw new Error( "Syntax error, unrecognized expression: " + msg );-};--function tokenize( selector, parseOnly ) {- var matched, match, tokens, type, soFar, groups, preFilters,- cached = tokenCache[ expando ][ selector ];-- if ( cached ) {- return parseOnly ? 0 : cached.slice( 0 );- }-- soFar = selector;- groups = [];- preFilters = Expr.preFilter;-- while ( soFar ) {-- // Comma and first run- if ( !matched || (match = rcomma.exec( soFar )) ) {- if ( match ) {- soFar = soFar.slice( match[0].length );- }- groups.push( tokens = [] );- }-- matched = false;-- // Combinators- if ( (match = rcombinators.exec( soFar )) ) {- tokens.push( matched = new Token( match.shift() ) );- soFar = soFar.slice( matched.length );-- // Cast descendant combinators to space- matched.type = match[0].replace( rtrim, " " );- }-- // Filters- for ( type in Expr.filter ) {- if ( (match = matchExpr[ type ].exec( soFar )) && (!preFilters[ type ] ||- // The last two arguments here are (context, xml) for backCompat- (match = preFilters[ type ]( match, document, true ))) ) {-- tokens.push( matched = new Token( match.shift() ) );- soFar = soFar.slice( matched.length );- matched.type = type;- matched.matches = match;- }- }-- if ( !matched ) {- break;- }- }-- // Return the length of the invalid excess- // if we're just parsing- // Otherwise, throw an error or return tokens- return parseOnly ?- soFar.length :- soFar ?- Sizzle.error( selector ) :- // Cache the tokens- tokenCache( selector, groups ).slice( 0 );-}--function addCombinator( matcher, combinator, base ) {- var dir = combinator.dir,- checkNonElements = base && combinator.dir === "parentNode",- doneName = done++;-- return combinator.first ?- // Check against closest ancestor/preceding element- function( elem, context, xml ) {- while ( (elem = elem[ dir ]) ) {- if ( checkNonElements || elem.nodeType === 1 ) {- return matcher( elem, context, xml );- }- }- } :-- // Check against all ancestor/preceding elements- function( elem, context, xml ) {- // We can't set arbitrary data on XML nodes, so they don't benefit from dir caching- if ( !xml ) {- var cache,- dirkey = dirruns + " " + doneName + " ",- cachedkey = dirkey + cachedruns;- while ( (elem = elem[ dir ]) ) {- if ( checkNonElements || elem.nodeType === 1 ) {- if ( (cache = elem[ expando ]) === cachedkey ) {- return elem.sizset;- } else if ( typeof cache === "string" && cache.indexOf(dirkey) === 0 ) {- if ( elem.sizset ) {- return elem;- }- } else {- elem[ expando ] = cachedkey;- if ( matcher( elem, context, xml ) ) {- elem.sizset = true;- return elem;- }- elem.sizset = false;- }- }- }- } else {- while ( (elem = elem[ dir ]) ) {- if ( checkNonElements || elem.nodeType === 1 ) {- if ( matcher( elem, context, xml ) ) {- return elem;- }- }- }- }- };-}--function elementMatcher( matchers ) {- return matchers.length > 1 ?- function( elem, context, xml ) {- var i = matchers.length;- while ( i-- ) {- if ( !matchers[i]( elem, context, xml ) ) {- return false;- }- }- return true;- } :- matchers[0];-}--function condense( unmatched, map, filter, context, xml ) {- var elem,- newUnmatched = [],- i = 0,- len = unmatched.length,- mapped = map != null;-- for ( ; i < len; i++ ) {- if ( (elem = unmatched[i]) ) {- if ( !filter || filter( elem, context, xml ) ) {- newUnmatched.push( elem );- if ( mapped ) {- map.push( i );- }- }- }- }-- return newUnmatched;-}--function setMatcher( preFilter, selector, matcher, postFilter, postFinder, postSelector ) {- if ( postFilter && !postFilter[ expando ] ) {- postFilter = setMatcher( postFilter );- }- if ( postFinder && !postFinder[ expando ] ) {- postFinder = setMatcher( postFinder, postSelector );- }- return markFunction(function( seed, results, context, xml ) {- // Positional selectors apply to seed elements, so it is invalid to follow them with relative ones- if ( seed && postFinder ) {- return;- }-- var i, elem, postFilterIn,- preMap = [],- postMap = [],- preexisting = results.length,-- // Get initial elements from seed or context- elems = seed || multipleContexts( selector || "*", context.nodeType ? [ context ] : context, [], seed ),-- // Prefilter to get matcher input, preserving a map for seed-results synchronization- matcherIn = preFilter && ( seed || !selector ) ?- condense( elems, preMap, preFilter, context, xml ) :- elems,-- matcherOut = matcher ?- // If we have a postFinder, or filtered seed, or non-seed postFilter or preexisting results,- postFinder || ( seed ? preFilter : preexisting || postFilter ) ?-- // ...intermediate processing is necessary- [] :-- // ...otherwise use results directly- results :- matcherIn;-- // Find primary matches- if ( matcher ) {- matcher( matcherIn, matcherOut, context, xml );- }-- // Apply postFilter- if ( postFilter ) {- postFilterIn = condense( matcherOut, postMap );- postFilter( postFilterIn, [], context, xml );-- // Un-match failing elements by moving them back to matcherIn- i = postFilterIn.length;- while ( i-- ) {- if ( (elem = postFilterIn[i]) ) {- matcherOut[ postMap[i] ] = !(matcherIn[ postMap[i] ] = elem);- }- }- }-- // Keep seed and results synchronized- if ( seed ) {- // Ignore postFinder because it can't coexist with seed- i = preFilter && matcherOut.length;- while ( i-- ) {- if ( (elem = matcherOut[i]) ) {- seed[ preMap[i] ] = !(results[ preMap[i] ] = elem);- }- }- } else {- matcherOut = condense(- matcherOut === results ?- matcherOut.splice( preexisting, matcherOut.length ) :- matcherOut- );- if ( postFinder ) {- postFinder( null, results, matcherOut, xml );- } else {- push.apply( results, matcherOut );- }- }- });-}--function matcherFromTokens( tokens ) {- var checkContext, matcher, j,- len = tokens.length,- leadingRelative = Expr.relative[ tokens[0].type ],- implicitRelative = leadingRelative || Expr.relative[" "],- i = leadingRelative ? 1 : 0,-- // The foundational matcher ensures that elements are reachable from top-level context(s)- matchContext = addCombinator( function( elem ) {- return elem === checkContext;- }, implicitRelative, true ),- matchAnyContext = addCombinator( function( elem ) {- return indexOf.call( checkContext, elem ) > -1;- }, implicitRelative, true ),- matchers = [ function( elem, context, xml ) {- return ( !leadingRelative && ( xml || context !== outermostContext ) ) || (- (checkContext = context).nodeType ?- matchContext( elem, context, xml ) :- matchAnyContext( elem, context, xml ) );- } ];-- for ( ; i < len; i++ ) {- if ( (matcher = Expr.relative[ tokens[i].type ]) ) {- matchers = [ addCombinator( elementMatcher( matchers ), matcher ) ];- } else {- // The concatenated values are (context, xml) for backCompat- matcher = Expr.filter[ tokens[i].type ].apply( null, tokens[i].matches );-- // Return special upon seeing a positional matcher- if ( matcher[ expando ] ) {- // Find the next relative operator (if any) for proper handling- j = ++i;- for ( ; j < len; j++ ) {- if ( Expr.relative[ tokens[j].type ] ) {- break;- }- }- return setMatcher(- i > 1 && elementMatcher( matchers ),- i > 1 && tokens.slice( 0, i - 1 ).join("").replace( rtrim, "$1" ),- matcher,- i < j && matcherFromTokens( tokens.slice( i, j ) ),- j < len && matcherFromTokens( (tokens = tokens.slice( j )) ),- j < len && tokens.join("")- );- }- matchers.push( matcher );- }- }-- return elementMatcher( matchers );-}--function matcherFromGroupMatchers( elementMatchers, setMatchers ) {- var bySet = setMatchers.length > 0,- byElement = elementMatchers.length > 0,- superMatcher = function( seed, context, xml, results, expandContext ) {- var elem, j, matcher,- setMatched = [],- matchedCount = 0,- i = "0",- unmatched = seed && [],- outermost = expandContext != null,- contextBackup = outermostContext,- // We must always have either seed elements or context- elems = seed || byElement && Expr.find["TAG"]( "*", expandContext && context.parentNode || context ),- // Nested matchers should use non-integer dirruns- dirrunsUnique = (dirruns += contextBackup == null ? 1 : Math.E);-- if ( outermost ) {- outermostContext = context !== document && context;- cachedruns = superMatcher.el;- }-- // Add elements passing elementMatchers directly to results- for ( ; (elem = elems[i]) != null; i++ ) {- if ( byElement && elem ) {- for ( j = 0; (matcher = elementMatchers[j]); j++ ) {- if ( matcher( elem, context, xml ) ) {- results.push( elem );- break;- }- }- if ( outermost ) {- dirruns = dirrunsUnique;- cachedruns = ++superMatcher.el;- }- }-- // Track unmatched elements for set filters- if ( bySet ) {- // They will have gone through all possible matchers- if ( (elem = !matcher && elem) ) {- matchedCount--;- }-- // Lengthen the array for every element, matched or not- if ( seed ) {- unmatched.push( elem );- }- }- }-- // Apply set filters to unmatched elements- matchedCount += i;- if ( bySet && i !== matchedCount ) {- for ( j = 0; (matcher = setMatchers[j]); j++ ) {- matcher( unmatched, setMatched, context, xml );- }-- if ( seed ) {- // Reintegrate element matches to eliminate the need for sorting- if ( matchedCount > 0 ) {- while ( i-- ) {- if ( !(unmatched[i] || setMatched[i]) ) {- setMatched[i] = pop.call( results );- }- }- }-- // Discard index placeholder values to get only actual matches- setMatched = condense( setMatched );- }-- // Add matches to results- push.apply( results, setMatched );-- // Seedless set matches succeeding multiple successful matchers stipulate sorting- if ( outermost && !seed && setMatched.length > 0 &&- ( matchedCount + setMatchers.length ) > 1 ) {-- Sizzle.uniqueSort( results );- }- }-- // Override manipulation of globals by nested matchers- if ( outermost ) {- dirruns = dirrunsUnique;- outermostContext = contextBackup;- }-- return unmatched;- };-- superMatcher.el = 0;- return bySet ?- markFunction( superMatcher ) :- superMatcher;-}--compile = Sizzle.compile = function( selector, group /* Internal Use Only */ ) {- var i,- setMatchers = [],- elementMatchers = [],- cached = compilerCache[ expando ][ selector ];-- if ( !cached ) {- // Generate a function of recursive functions that can be used to check each element- if ( !group ) {- group = tokenize( selector );- }- i = group.length;- while ( i-- ) {- cached = matcherFromTokens( group[i] );- if ( cached[ expando ] ) {- setMatchers.push( cached );- } else {- elementMatchers.push( cached );- }- }-- // Cache the compiled function- cached = compilerCache( selector, matcherFromGroupMatchers( elementMatchers, setMatchers ) );- }- return cached;-};--function multipleContexts( selector, contexts, results, seed ) {- var i = 0,- len = contexts.length;- for ( ; i < len; i++ ) {- Sizzle( selector, contexts[i], results, seed );- }- return results;-}--function select( selector, context, results, seed, xml ) {- var i, tokens, token, type, find,- match = tokenize( selector ),- j = match.length;-- if ( !seed ) {- // Try to minimize operations if there is only one group- if ( match.length === 1 ) {-- // Take a shortcut and set the context if the root selector is an ID- tokens = match[0] = match[0].slice( 0 );- if ( tokens.length > 2 && (token = tokens[0]).type === "ID" &&- context.nodeType === 9 && !xml &&- Expr.relative[ tokens[1].type ] ) {-- context = Expr.find["ID"]( token.matches[0].replace( rbackslash, "" ), context, xml )[0];- if ( !context ) {- return results;- }-- selector = selector.slice( tokens.shift().length );- }-- // Fetch a seed set for right-to-left matching- for ( i = matchExpr["POS"].test( selector ) ? -1 : tokens.length - 1; i >= 0; i-- ) {- token = tokens[i];-- // Abort if we hit a combinator- if ( Expr.relative[ (type = token.type) ] ) {- break;- }- if ( (find = Expr.find[ type ]) ) {- // Search, expanding context for leading sibling combinators- if ( (seed = find(- token.matches[0].replace( rbackslash, "" ),- rsibling.test( tokens[0].type ) && context.parentNode || context,- xml- )) ) {-- // If seed is empty or no tokens remain, we can return early- tokens.splice( i, 1 );- selector = seed.length && tokens.join("");- if ( !selector ) {- push.apply( results, slice.call( seed, 0 ) );- return results;- }-- break;- }- }- }- }- }-- // Compile and execute a filtering function- // Provide `match` to avoid retokenization if we modified the selector above- compile( selector, match )(- seed,- context,- xml,- results,- rsibling.test( selector )- );- return results;-}--if ( document.querySelectorAll ) {- (function() {- var disconnectedMatch,- oldSelect = select,- rescape = /'|\\/g,- rattributeQuotes = /\=[\x20\t\r\n\f]*([^'"\]]*)[\x20\t\r\n\f]*\]/g,-- // qSa(:focus) reports false when true (Chrome 21),- // A support test would require too much code (would include document ready)- rbuggyQSA = [":focus"],-- // matchesSelector(:focus) reports false when true (Chrome 21),- // matchesSelector(:active) reports false when true (IE9/Opera 11.5)- // A support test would require too much code (would include document ready)- // just skip matchesSelector for :active- rbuggyMatches = [ ":active", ":focus" ],- matches = docElem.matchesSelector ||- docElem.mozMatchesSelector ||- docElem.webkitMatchesSelector ||- docElem.oMatchesSelector ||- docElem.msMatchesSelector;-- // Build QSA regex- // Regex strategy adopted from Diego Perini- assert(function( div ) {- // Select is set to empty string on purpose- // This is to test IE's treatment of not explictly- // setting a boolean content attribute,- // since its presence should be enough- // http://bugs.jquery.com/ticket/12359- div.innerHTML = "<select><option selected=''></option></select>";-- // IE8 - Some boolean attributes are not treated correctly- if ( !div.querySelectorAll("[selected]").length ) {- rbuggyQSA.push( "\\[" + whitespace + "*(?:checked|disabled|ismap|multiple|readonly|selected|value)" );- }-- // Webkit/Opera - :checked should return selected option elements- // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked- // IE8 throws error here (do not put tests after this one)- if ( !div.querySelectorAll(":checked").length ) {- rbuggyQSA.push(":checked");- }- });-- assert(function( div ) {-- // Opera 10-12/IE9 - ^= $= *= and empty values- // Should not select anything- div.innerHTML = "<p test=''></p>";- if ( div.querySelectorAll("[test^='']").length ) {- rbuggyQSA.push( "[*^$]=" + whitespace + "*(?:\"\"|'')" );- }-- // FF 3.5 - :enabled/:disabled and hidden elements (hidden elements are still enabled)- // IE8 throws error here (do not put tests after this one)- div.innerHTML = "<input type='hidden'/>";- if ( !div.querySelectorAll(":enabled").length ) {- rbuggyQSA.push(":enabled", ":disabled");- }- });-- // rbuggyQSA always contains :focus, so no need for a length check- rbuggyQSA = /* rbuggyQSA.length && */ new RegExp( rbuggyQSA.join("|") );-- select = function( selector, context, results, seed, xml ) {- // Only use querySelectorAll when not filtering,- // when this is not xml,- // and when no QSA bugs apply- if ( !seed && !xml && (!rbuggyQSA || !rbuggyQSA.test( selector )) ) {- var groups, i,- old = true,- nid = expando,- newContext = context,- newSelector = context.nodeType === 9 && selector;-- // qSA works strangely on Element-rooted queries- // We can work around this by specifying an extra ID on the root- // and working up from there (Thanks to Andrew Dupont for the technique)- // IE 8 doesn't work on object elements- if ( context.nodeType === 1 && context.nodeName.toLowerCase() !== "object" ) {- groups = tokenize( selector );-- if ( (old = context.getAttribute("id")) ) {- nid = old.replace( rescape, "\\$&" );- } else {- context.setAttribute( "id", nid );- }- nid = "[id='" + nid + "'] ";-- i = groups.length;- while ( i-- ) {- groups[i] = nid + groups[i].join("");- }- newContext = rsibling.test( selector ) && context.parentNode || context;- newSelector = groups.join(",");- }-- if ( newSelector ) {- try {- push.apply( results, slice.call( newContext.querySelectorAll(- newSelector- ), 0 ) );- return results;- } catch(qsaError) {- } finally {- if ( !old ) {- context.removeAttribute("id");- }- }- }- }-- return oldSelect( selector, context, results, seed, xml );- };-- if ( matches ) {- assert(function( div ) {- // Check to see if it's possible to do matchesSelector- // on a disconnected node (IE 9)- disconnectedMatch = matches.call( div, "div" );-- // This should fail with an exception- // Gecko does not error, returns false instead- try {- matches.call( div, "[test!='']:sizzle" );- rbuggyMatches.push( "!=", pseudos );- } catch ( e ) {}- });-- // rbuggyMatches always contains :active and :focus, so no need for a length check- rbuggyMatches = /* rbuggyMatches.length && */ new RegExp( rbuggyMatches.join("|") );-- Sizzle.matchesSelector = function( elem, expr ) {- // Make sure that attribute selectors are quoted- expr = expr.replace( rattributeQuotes, "='$1']" );-- // rbuggyMatches always contains :active, so no need for an existence check- if ( !isXML( elem ) && !rbuggyMatches.test( expr ) && (!rbuggyQSA || !rbuggyQSA.test( expr )) ) {- try {- var ret = matches.call( elem, expr );-- // IE 9's matchesSelector returns false on disconnected nodes- if ( ret || disconnectedMatch ||- // As well, disconnected nodes are said to be in a document- // fragment in IE 9- elem.document && elem.document.nodeType !== 11 ) {- return ret;- }- } catch(e) {}- }-- return Sizzle( expr, null, null, [ elem ] ).length > 0;- };- }- })();-}--// Deprecated-Expr.pseudos["nth"] = Expr.pseudos["eq"];--// Back-compat-function setFilters() {}-Expr.filters = setFilters.prototype = Expr.pseudos;-Expr.setFilters = new setFilters();--// Override sizzle attribute retrieval-Sizzle.attr = jQuery.attr;-jQuery.find = Sizzle;-jQuery.expr = Sizzle.selectors;-jQuery.expr[":"] = jQuery.expr.pseudos;-jQuery.unique = Sizzle.uniqueSort;-jQuery.text = Sizzle.getText;-jQuery.isXMLDoc = Sizzle.isXML;-jQuery.contains = Sizzle.contains;---})( window );-var runtil = /Until$/,- rparentsprev = /^(?:parents|prev(?:Until|All))/,- isSimple = /^.[^:#\[\.,]*$/,- rneedsContext = jQuery.expr.match.needsContext,- // methods guaranteed to produce a unique set when starting from a unique set- guaranteedUnique = {- children: true,- contents: true,- next: true,- prev: true- };--jQuery.fn.extend({- find: function( selector ) {- var i, l, length, n, r, ret,- self = this;-- if ( typeof selector !== "string" ) {- return jQuery( selector ).filter(function() {- for ( i = 0, l = self.length; i < l; i++ ) {- if ( jQuery.contains( self[ i ], this ) ) {- return true;- }- }- });- }-- ret = this.pushStack( "", "find", selector );-- for ( i = 0, l = this.length; i < l; i++ ) {- length = ret.length;- jQuery.find( selector, this[i], ret );-- if ( i > 0 ) {- // Make sure that the results are unique- for ( n = length; n < ret.length; n++ ) {- for ( r = 0; r < length; r++ ) {- if ( ret[r] === ret[n] ) {- ret.splice(n--, 1);- break;- }- }- }- }- }-- return ret;- },-- has: function( target ) {- var i,- targets = jQuery( target, this ),- len = targets.length;-- return this.filter(function() {- for ( i = 0; i < len; i++ ) {- if ( jQuery.contains( this, targets[i] ) ) {- return true;- }- }- });- },-- not: function( selector ) {- return this.pushStack( winnow(this, selector, false), "not", selector);- },-- filter: function( selector ) {- return this.pushStack( winnow(this, selector, true), "filter", selector );- },-- is: function( selector ) {- return !!selector && (- typeof selector === "string" ?- // If this is a positional/relative selector, check membership in the returned set- // so $("p:first").is("p:last") won't return true for a doc with two "p".- rneedsContext.test( selector ) ?- jQuery( selector, this.context ).index( this[0] ) >= 0 :- jQuery.filter( selector, this ).length > 0 :- this.filter( selector ).length > 0 );- },-- closest: function( selectors, context ) {- var cur,- i = 0,- l = this.length,- ret = [],- pos = rneedsContext.test( selectors ) || typeof selectors !== "string" ?- jQuery( selectors, context || this.context ) :- 0;-- for ( ; i < l; i++ ) {- cur = this[i];-- while ( cur && cur.ownerDocument && cur !== context && cur.nodeType !== 11 ) {- if ( pos ? pos.index(cur) > -1 : jQuery.find.matchesSelector(cur, selectors) ) {- ret.push( cur );- break;- }- cur = cur.parentNode;- }- }-- ret = ret.length > 1 ? jQuery.unique( ret ) : ret;-- return this.pushStack( ret, "closest", selectors );- },-- // Determine the position of an element within- // the matched set of elements- index: function( elem ) {-- // No argument, return index in parent- if ( !elem ) {- return ( this[0] && this[0].parentNode ) ? this.prevAll().length : -1;- }-- // index in selector- if ( typeof elem === "string" ) {- return jQuery.inArray( this[0], jQuery( elem ) );- }-- // Locate the position of the desired element- return jQuery.inArray(- // If it receives a jQuery object, the first element is used- elem.jquery ? elem[0] : elem, this );- },-- add: function( selector, context ) {- var set = typeof selector === "string" ?- jQuery( selector, context ) :- jQuery.makeArray( selector && selector.nodeType ? [ selector ] : selector ),- all = jQuery.merge( this.get(), set );-- return this.pushStack( isDisconnected( set[0] ) || isDisconnected( all[0] ) ?- all :- jQuery.unique( all ) );- },-- addBack: function( selector ) {- return this.add( selector == null ?- this.prevObject : this.prevObject.filter(selector)- );- }-});--jQuery.fn.andSelf = jQuery.fn.addBack;--// A painfully simple check to see if an element is disconnected-// from a document (should be improved, where feasible).-function isDisconnected( node ) {- return !node || !node.parentNode || node.parentNode.nodeType === 11;-}--function sibling( cur, dir ) {- do {- cur = cur[ dir ];- } while ( cur && cur.nodeType !== 1 );-- return cur;-}--jQuery.each({- parent: function( elem ) {- var parent = elem.parentNode;- return parent && parent.nodeType !== 11 ? parent : null;- },- parents: function( elem ) {- return jQuery.dir( elem, "parentNode" );- },- parentsUntil: function( elem, i, until ) {- return jQuery.dir( elem, "parentNode", until );- },- next: function( elem ) {- return sibling( elem, "nextSibling" );- },- prev: function( elem ) {- return sibling( elem, "previousSibling" );- },- nextAll: function( elem ) {- return jQuery.dir( elem, "nextSibling" );- },- prevAll: function( elem ) {- return jQuery.dir( elem, "previousSibling" );- },- nextUntil: function( elem, i, until ) {- return jQuery.dir( elem, "nextSibling", until );- },- prevUntil: function( elem, i, until ) {- return jQuery.dir( elem, "previousSibling", until );- },- siblings: function( elem ) {- return jQuery.sibling( ( elem.parentNode || {} ).firstChild, elem );- },- children: function( elem ) {- return jQuery.sibling( elem.firstChild );- },- contents: function( elem ) {- return jQuery.nodeName( elem, "iframe" ) ?- elem.contentDocument || elem.contentWindow.document :- jQuery.merge( [], elem.childNodes );- }-}, function( name, fn ) {- jQuery.fn[ name ] = function( until, selector ) {- var ret = jQuery.map( this, fn, until );-- if ( !runtil.test( name ) ) {- selector = until;- }-- if ( selector && typeof selector === "string" ) {- ret = jQuery.filter( selector, ret );- }-- ret = this.length > 1 && !guaranteedUnique[ name ] ? jQuery.unique( ret ) : ret;-- if ( this.length > 1 && rparentsprev.test( name ) ) {- ret = ret.reverse();- }-- return this.pushStack( ret, name, core_slice.call( arguments ).join(",") );- };-});--jQuery.extend({- filter: function( expr, elems, not ) {- if ( not ) {- expr = ":not(" + expr + ")";- }-- return elems.length === 1 ?- jQuery.find.matchesSelector(elems[0], expr) ? [ elems[0] ] : [] :- jQuery.find.matches(expr, elems);- },-- dir: function( elem, dir, until ) {- var matched = [],- cur = elem[ dir ];-- while ( cur && cur.nodeType !== 9 && (until === undefined || cur.nodeType !== 1 || !jQuery( cur ).is( until )) ) {- if ( cur.nodeType === 1 ) {- matched.push( cur );- }- cur = cur[dir];- }- return matched;- },-- sibling: function( n, elem ) {- var r = [];-- for ( ; n; n = n.nextSibling ) {- if ( n.nodeType === 1 && n !== elem ) {- r.push( n );- }- }-- return r;- }-});--// Implement the identical functionality for filter and not-function winnow( elements, qualifier, keep ) {-- // Can't pass null or undefined to indexOf in Firefox 4- // Set to 0 to skip string check- qualifier = qualifier || 0;-- if ( jQuery.isFunction( qualifier ) ) {- return jQuery.grep(elements, function( elem, i ) {- var retVal = !!qualifier.call( elem, i, elem );- return retVal === keep;- });-- } else if ( qualifier.nodeType ) {- return jQuery.grep(elements, function( elem, i ) {- return ( elem === qualifier ) === keep;- });-- } else if ( typeof qualifier === "string" ) {- var filtered = jQuery.grep(elements, function( elem ) {- return elem.nodeType === 1;- });-- if ( isSimple.test( qualifier ) ) {- return jQuery.filter(qualifier, filtered, !keep);- } else {- qualifier = jQuery.filter( qualifier, filtered );- }- }-- return jQuery.grep(elements, function( elem, i ) {- return ( jQuery.inArray( elem, qualifier ) >= 0 ) === keep;- });-}-function createSafeFragment( document ) {- var list = nodeNames.split( "|" ),- safeFrag = document.createDocumentFragment();-- if ( safeFrag.createElement ) {- while ( list.length ) {- safeFrag.createElement(- list.pop()- );- }- }- return safeFrag;-}--var nodeNames = "abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|" +- "header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",- rinlinejQuery = / jQuery\d+="(?:null|\d+)"/g,- rleadingWhitespace = /^\s+/,- rxhtmlTag = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,- rtagName = /<([\w:]+)/,- rtbody = /<tbody/i,- rhtml = /<|&#?\w+;/,- rnoInnerhtml = /<(?:script|style|link)/i,- rnocache = /<(?:script|object|embed|option|style)/i,- rnoshimcache = new RegExp("<(?:" + nodeNames + ")[\\s/>]", "i"),- rcheckableType = /^(?:checkbox|radio)$/,- // checked="checked" or checked- rchecked = /checked\s*(?:[^=]|=\s*.checked.)/i,- rscriptType = /\/(java|ecma)script/i,- rcleanScript = /^\s*<!(?:\[CDATA\[|\-\-)|[\]\-]{2}>\s*$/g,- wrapMap = {- option: [ 1, "<select multiple='multiple'>", "</select>" ],- legend: [ 1, "<fieldset>", "</fieldset>" ],- thead: [ 1, "<table>", "</table>" ],- tr: [ 2, "<table><tbody>", "</tbody></table>" ],- td: [ 3, "<table><tbody><tr>", "</tr></tbody></table>" ],- col: [ 2, "<table><tbody></tbody><colgroup>", "</colgroup></table>" ],- area: [ 1, "<map>", "</map>" ],- _default: [ 0, "", "" ]- },- safeFragment = createSafeFragment( document ),- fragmentDiv = safeFragment.appendChild( document.createElement("div") );--wrapMap.optgroup = wrapMap.option;-wrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.thead;-wrapMap.th = wrapMap.td;--// IE6-8 can't serialize link, script, style, or any html5 (NoScope) tags,-// unless wrapped in a div with non-breaking characters in front of it.-if ( !jQuery.support.htmlSerialize ) {- wrapMap._default = [ 1, "X<div>", "</div>" ];-}--jQuery.fn.extend({- text: function( value ) {- return jQuery.access( this, function( value ) {- return value === undefined ?- jQuery.text( this ) :- this.empty().append( ( this[0] && this[0].ownerDocument || document ).createTextNode( value ) );- }, null, value, arguments.length );- },-- wrapAll: function( html ) {- if ( jQuery.isFunction( html ) ) {- return this.each(function(i) {- jQuery(this).wrapAll( html.call(this, i) );- });- }-- if ( this[0] ) {- // The elements to wrap the target around- var wrap = jQuery( html, this[0].ownerDocument ).eq(0).clone(true);-- if ( this[0].parentNode ) {- wrap.insertBefore( this[0] );- }-- wrap.map(function() {- var elem = this;-- while ( elem.firstChild && elem.firstChild.nodeType === 1 ) {- elem = elem.firstChild;- }-- return elem;- }).append( this );- }-- return this;- },-- wrapInner: function( html ) {- if ( jQuery.isFunction( html ) ) {- return this.each(function(i) {- jQuery(this).wrapInner( html.call(this, i) );- });- }-- return this.each(function() {- var self = jQuery( this ),- contents = self.contents();-- if ( contents.length ) {- contents.wrapAll( html );-- } else {- self.append( html );- }- });- },-- wrap: function( html ) {- var isFunction = jQuery.isFunction( html );-- return this.each(function(i) {- jQuery( this ).wrapAll( isFunction ? html.call(this, i) : html );- });- },-- unwrap: function() {- return this.parent().each(function() {- if ( !jQuery.nodeName( this, "body" ) ) {- jQuery( this ).replaceWith( this.childNodes );- }- }).end();- },-- append: function() {- return this.domManip(arguments, true, function( elem ) {- if ( this.nodeType === 1 || this.nodeType === 11 ) {- this.appendChild( elem );- }- });- },-- prepend: function() {- return this.domManip(arguments, true, function( elem ) {- if ( this.nodeType === 1 || this.nodeType === 11 ) {- this.insertBefore( elem, this.firstChild );- }- });- },-- before: function() {- if ( !isDisconnected( this[0] ) ) {- return this.domManip(arguments, false, function( elem ) {- this.parentNode.insertBefore( elem, this );- });- }-- if ( arguments.length ) {- var set = jQuery.clean( arguments );- return this.pushStack( jQuery.merge( set, this ), "before", this.selector );- }- },-- after: function() {- if ( !isDisconnected( this[0] ) ) {- return this.domManip(arguments, false, function( elem ) {- this.parentNode.insertBefore( elem, this.nextSibling );- });- }-- if ( arguments.length ) {- var set = jQuery.clean( arguments );- return this.pushStack( jQuery.merge( this, set ), "after", this.selector );- }- },-- // keepData is for internal use only--do not document- remove: function( selector, keepData ) {- var elem,- i = 0;-- for ( ; (elem = this[i]) != null; i++ ) {- if ( !selector || jQuery.filter( selector, [ elem ] ).length ) {- if ( !keepData && elem.nodeType === 1 ) {- jQuery.cleanData( elem.getElementsByTagName("*") );- jQuery.cleanData( [ elem ] );- }-- if ( elem.parentNode ) {- elem.parentNode.removeChild( elem );- }- }- }-- return this;- },-- empty: function() {- var elem,- i = 0;-- for ( ; (elem = this[i]) != null; i++ ) {- // Remove element nodes and prevent memory leaks- if ( elem.nodeType === 1 ) {- jQuery.cleanData( elem.getElementsByTagName("*") );- }-- // Remove any remaining nodes- while ( elem.firstChild ) {- elem.removeChild( elem.firstChild );- }- }-- return this;- },-- clone: function( dataAndEvents, deepDataAndEvents ) {- dataAndEvents = dataAndEvents == null ? false : dataAndEvents;- deepDataAndEvents = deepDataAndEvents == null ? dataAndEvents : deepDataAndEvents;-- return this.map( function () {- return jQuery.clone( this, dataAndEvents, deepDataAndEvents );- });- },-- html: function( value ) {- return jQuery.access( this, function( value ) {- var elem = this[0] || {},- i = 0,- l = this.length;-- if ( value === undefined ) {- return elem.nodeType === 1 ?- elem.innerHTML.replace( rinlinejQuery, "" ) :- undefined;- }-- // See if we can take a shortcut and just use innerHTML- if ( typeof value === "string" && !rnoInnerhtml.test( value ) &&- ( jQuery.support.htmlSerialize || !rnoshimcache.test( value ) ) &&- ( jQuery.support.leadingWhitespace || !rleadingWhitespace.test( value ) ) &&- !wrapMap[ ( rtagName.exec( value ) || ["", ""] )[1].toLowerCase() ] ) {-- value = value.replace( rxhtmlTag, "<$1></$2>" );-- try {- for (; i < l; i++ ) {- // Remove element nodes and prevent memory leaks- elem = this[i] || {};- if ( elem.nodeType === 1 ) {- jQuery.cleanData( elem.getElementsByTagName( "*" ) );- elem.innerHTML = value;- }- }-- elem = 0;-- // If using innerHTML throws an exception, use the fallback method- } catch(e) {}- }-- if ( elem ) {- this.empty().append( value );- }- }, null, value, arguments.length );- },-- replaceWith: function( value ) {- if ( !isDisconnected( this[0] ) ) {- // Make sure that the elements are removed from the DOM before they are inserted- // this can help fix replacing a parent with child elements- if ( jQuery.isFunction( value ) ) {- return this.each(function(i) {- var self = jQuery(this), old = self.html();- self.replaceWith( value.call( this, i, old ) );- });- }-- if ( typeof value !== "string" ) {- value = jQuery( value ).detach();- }-- return this.each(function() {- var next = this.nextSibling,- parent = this.parentNode;-- jQuery( this ).remove();-- if ( next ) {- jQuery(next).before( value );- } else {- jQuery(parent).append( value );- }- });- }-- return this.length ?- this.pushStack( jQuery(jQuery.isFunction(value) ? value() : value), "replaceWith", value ) :- this;- },-- detach: function( selector ) {- return this.remove( selector, true );- },-- domManip: function( args, table, callback ) {-- // Flatten any nested arrays- args = [].concat.apply( [], args );-- var results, first, fragment, iNoClone,- i = 0,- value = args[0],- scripts = [],- l = this.length;-- // We can't cloneNode fragments that contain checked, in WebKit- if ( !jQuery.support.checkClone && l > 1 && typeof value === "string" && rchecked.test( value ) ) {- return this.each(function() {- jQuery(this).domManip( args, table, callback );- });- }-- if ( jQuery.isFunction(value) ) {- return this.each(function(i) {- var self = jQuery(this);- args[0] = value.call( this, i, table ? self.html() : undefined );- self.domManip( args, table, callback );- });- }-- if ( this[0] ) {- results = jQuery.buildFragment( args, this, scripts );- fragment = results.fragment;- first = fragment.firstChild;-- if ( fragment.childNodes.length === 1 ) {- fragment = first;- }-- if ( first ) {- table = table && jQuery.nodeName( first, "tr" );-- // Use the original fragment for the last item instead of the first because it can end up- // being emptied incorrectly in certain situations (#8070).- // Fragments from the fragment cache must always be cloned and never used in place.- for ( iNoClone = results.cacheable || l - 1; i < l; i++ ) {- callback.call(- table && jQuery.nodeName( this[i], "table" ) ?- findOrAppend( this[i], "tbody" ) :- this[i],- i === iNoClone ?- fragment :- jQuery.clone( fragment, true, true )- );- }- }-- // Fix #11809: Avoid leaking memory- fragment = first = null;-- if ( scripts.length ) {- jQuery.each( scripts, function( i, elem ) {- if ( elem.src ) {- if ( jQuery.ajax ) {- jQuery.ajax({- url: elem.src,- type: "GET",- dataType: "script",- async: false,- global: false,- "throws": true- });- } else {- jQuery.error("no ajax");- }- } else {- jQuery.globalEval( ( elem.text || elem.textContent || elem.innerHTML || "" ).replace( rcleanScript, "" ) );- }-- if ( elem.parentNode ) {- elem.parentNode.removeChild( elem );- }- });- }- }-- return this;- }-});--function findOrAppend( elem, tag ) {- return elem.getElementsByTagName( tag )[0] || elem.appendChild( elem.ownerDocument.createElement( tag ) );-}--function cloneCopyEvent( src, dest ) {-- if ( dest.nodeType !== 1 || !jQuery.hasData( src ) ) {- return;- }-- var type, i, l,- oldData = jQuery._data( src ),- curData = jQuery._data( dest, oldData ),- events = oldData.events;-- if ( events ) {- delete curData.handle;- curData.events = {};-- for ( type in events ) {- for ( i = 0, l = events[ type ].length; i < l; i++ ) {- jQuery.event.add( dest, type, events[ type ][ i ] );- }- }- }-- // make the cloned public data object a copy from the original- if ( curData.data ) {- curData.data = jQuery.extend( {}, curData.data );- }-}--function cloneFixAttributes( src, dest ) {- var nodeName;-- // We do not need to do anything for non-Elements- if ( dest.nodeType !== 1 ) {- return;- }-- // clearAttributes removes the attributes, which we don't want,- // but also removes the attachEvent events, which we *do* want- if ( dest.clearAttributes ) {- dest.clearAttributes();- }-- // mergeAttributes, in contrast, only merges back on the- // original attributes, not the events- if ( dest.mergeAttributes ) {- dest.mergeAttributes( src );- }-- nodeName = dest.nodeName.toLowerCase();-- if ( nodeName === "object" ) {- // IE6-10 improperly clones children of object elements using classid.- // IE10 throws NoModificationAllowedError if parent is null, #12132.- if ( dest.parentNode ) {- dest.outerHTML = src.outerHTML;- }-- // This path appears unavoidable for IE9. When cloning an object- // element in IE9, the outerHTML strategy above is not sufficient.- // If the src has innerHTML and the destination does not,- // copy the src.innerHTML into the dest.innerHTML. #10324- if ( jQuery.support.html5Clone && (src.innerHTML && !jQuery.trim(dest.innerHTML)) ) {- dest.innerHTML = src.innerHTML;- }-- } else if ( nodeName === "input" && rcheckableType.test( src.type ) ) {- // IE6-8 fails to persist the checked state of a cloned checkbox- // or radio button. Worse, IE6-7 fail to give the cloned element- // a checked appearance if the defaultChecked value isn't also set-- dest.defaultChecked = dest.checked = src.checked;-- // IE6-7 get confused and end up setting the value of a cloned- // checkbox/radio button to an empty string instead of "on"- if ( dest.value !== src.value ) {- dest.value = src.value;- }-- // IE6-8 fails to return the selected option to the default selected- // state when cloning options- } else if ( nodeName === "option" ) {- dest.selected = src.defaultSelected;-- // IE6-8 fails to set the defaultValue to the correct value when- // cloning other types of input fields- } else if ( nodeName === "input" || nodeName === "textarea" ) {- dest.defaultValue = src.defaultValue;-- // IE blanks contents when cloning scripts- } else if ( nodeName === "script" && dest.text !== src.text ) {- dest.text = src.text;- }-- // Event data gets referenced instead of copied if the expando- // gets copied too- dest.removeAttribute( jQuery.expando );-}--jQuery.buildFragment = function( args, context, scripts ) {- var fragment, cacheable, cachehit,- first = args[ 0 ];-- // Set context from what may come in as undefined or a jQuery collection or a node- // Updated to fix #12266 where accessing context[0] could throw an exception in IE9/10 &- // also doubles as fix for #8950 where plain objects caused createDocumentFragment exception- context = context || document;- context = !context.nodeType && context[0] || context;- context = context.ownerDocument || context;-- // Only cache "small" (1/2 KB) HTML strings that are associated with the main document- // Cloning options loses the selected state, so don't cache them- // IE 6 doesn't like it when you put <object> or <embed> elements in a fragment- // Also, WebKit does not clone 'checked' attributes on cloneNode, so don't cache- // Lastly, IE6,7,8 will not correctly reuse cached fragments that were created from unknown elems #10501- if ( args.length === 1 && typeof first === "string" && first.length < 512 && context === document &&- first.charAt(0) === "<" && !rnocache.test( first ) &&- (jQuery.support.checkClone || !rchecked.test( first )) &&- (jQuery.support.html5Clone || !rnoshimcache.test( first )) ) {-- // Mark cacheable and look for a hit- cacheable = true;- fragment = jQuery.fragments[ first ];- cachehit = fragment !== undefined;- }-- if ( !fragment ) {- fragment = context.createDocumentFragment();- jQuery.clean( args, context, fragment, scripts );-- // Update the cache, but only store false- // unless this is a second parsing of the same content- if ( cacheable ) {- jQuery.fragments[ first ] = cachehit && fragment;- }- }-- return { fragment: fragment, cacheable: cacheable };-};--jQuery.fragments = {};--jQuery.each({- appendTo: "append",- prependTo: "prepend",- insertBefore: "before",- insertAfter: "after",- replaceAll: "replaceWith"-}, function( name, original ) {- jQuery.fn[ name ] = function( selector ) {- var elems,- i = 0,- ret = [],- insert = jQuery( selector ),- l = insert.length,- parent = this.length === 1 && this[0].parentNode;-- if ( (parent == null || parent && parent.nodeType === 11 && parent.childNodes.length === 1) && l === 1 ) {- insert[ original ]( this[0] );- return this;- } else {- for ( ; i < l; i++ ) {- elems = ( i > 0 ? this.clone(true) : this ).get();- jQuery( insert[i] )[ original ]( elems );- ret = ret.concat( elems );- }-- return this.pushStack( ret, name, insert.selector );- }- };-});--function getAll( elem ) {- if ( typeof elem.getElementsByTagName !== "undefined" ) {- return elem.getElementsByTagName( "*" );-- } else if ( typeof elem.querySelectorAll !== "undefined" ) {- return elem.querySelectorAll( "*" );-- } else {- return [];- }-}--// Used in clean, fixes the defaultChecked property-function fixDefaultChecked( elem ) {- if ( rcheckableType.test( elem.type ) ) {- elem.defaultChecked = elem.checked;- }-}--jQuery.extend({- clone: function( elem, dataAndEvents, deepDataAndEvents ) {- var srcElements,- destElements,- i,- clone;-- if ( jQuery.support.html5Clone || jQuery.isXMLDoc(elem) || !rnoshimcache.test( "<" + elem.nodeName + ">" ) ) {- clone = elem.cloneNode( true );-- // IE<=8 does not properly clone detached, unknown element nodes- } else {- fragmentDiv.innerHTML = elem.outerHTML;- fragmentDiv.removeChild( clone = fragmentDiv.firstChild );- }-- if ( (!jQuery.support.noCloneEvent || !jQuery.support.noCloneChecked) &&- (elem.nodeType === 1 || elem.nodeType === 11) && !jQuery.isXMLDoc(elem) ) {- // IE copies events bound via attachEvent when using cloneNode.- // Calling detachEvent on the clone will also remove the events- // from the original. In order to get around this, we use some- // proprietary methods to clear the events. Thanks to MooTools- // guys for this hotness.-- cloneFixAttributes( elem, clone );-- // Using Sizzle here is crazy slow, so we use getElementsByTagName instead- srcElements = getAll( elem );- destElements = getAll( clone );-- // Weird iteration because IE will replace the length property- // with an element if you are cloning the body and one of the- // elements on the page has a name or id of "length"- for ( i = 0; srcElements[i]; ++i ) {- // Ensure that the destination node is not null; Fixes #9587- if ( destElements[i] ) {- cloneFixAttributes( srcElements[i], destElements[i] );- }- }- }-- // Copy the events from the original to the clone- if ( dataAndEvents ) {- cloneCopyEvent( elem, clone );-- if ( deepDataAndEvents ) {- srcElements = getAll( elem );- destElements = getAll( clone );-- for ( i = 0; srcElements[i]; ++i ) {- cloneCopyEvent( srcElements[i], destElements[i] );- }- }- }-- srcElements = destElements = null;-- // Return the cloned set- return clone;- },-- clean: function( elems, context, fragment, scripts ) {- var i, j, elem, tag, wrap, depth, div, hasBody, tbody, len, handleScript, jsTags,- safe = context === document && safeFragment,- ret = [];-- // Ensure that context is a document- if ( !context || typeof context.createDocumentFragment === "undefined" ) {- context = document;- }-- // Use the already-created safe fragment if context permits- for ( i = 0; (elem = elems[i]) != null; i++ ) {- if ( typeof elem === "number" ) {- elem += "";- }-- if ( !elem ) {- continue;- }-- // Convert html string into DOM nodes- if ( typeof elem === "string" ) {- if ( !rhtml.test( elem ) ) {- elem = context.createTextNode( elem );- } else {- // Ensure a safe container in which to render the html- safe = safe || createSafeFragment( context );- div = context.createElement("div");- safe.appendChild( div );-- // Fix "XHTML"-style tags in all browsers- elem = elem.replace(rxhtmlTag, "<$1></$2>");-- // Go to html and back, then peel off extra wrappers- tag = ( rtagName.exec( elem ) || ["", ""] )[1].toLowerCase();- wrap = wrapMap[ tag ] || wrapMap._default;- depth = wrap[0];- div.innerHTML = wrap[1] + elem + wrap[2];-- // Move to the right depth- while ( depth-- ) {- div = div.lastChild;- }-- // Remove IE's autoinserted <tbody> from table fragments- if ( !jQuery.support.tbody ) {-- // String was a <table>, *may* have spurious <tbody>- hasBody = rtbody.test(elem);- tbody = tag === "table" && !hasBody ?- div.firstChild && div.firstChild.childNodes :-- // String was a bare <thead> or <tfoot>- wrap[1] === "<table>" && !hasBody ?- div.childNodes :- [];-- for ( j = tbody.length - 1; j >= 0 ; --j ) {- if ( jQuery.nodeName( tbody[ j ], "tbody" ) && !tbody[ j ].childNodes.length ) {- tbody[ j ].parentNode.removeChild( tbody[ j ] );- }- }- }-- // IE completely kills leading whitespace when innerHTML is used- if ( !jQuery.support.leadingWhitespace && rleadingWhitespace.test( elem ) ) {- div.insertBefore( context.createTextNode( rleadingWhitespace.exec(elem)[0] ), div.firstChild );- }-- elem = div.childNodes;-- // Take out of fragment container (we need a fresh div each time)- div.parentNode.removeChild( div );- }- }-- if ( elem.nodeType ) {- ret.push( elem );- } else {- jQuery.merge( ret, elem );- }- }-- // Fix #11356: Clear elements from safeFragment- if ( div ) {- elem = div = safe = null;- }-- // Reset defaultChecked for any radios and checkboxes- // about to be appended to the DOM in IE 6/7 (#8060)- if ( !jQuery.support.appendChecked ) {- for ( i = 0; (elem = ret[i]) != null; i++ ) {- if ( jQuery.nodeName( elem, "input" ) ) {- fixDefaultChecked( elem );- } else if ( typeof elem.getElementsByTagName !== "undefined" ) {- jQuery.grep( elem.getElementsByTagName("input"), fixDefaultChecked );- }- }- }-- // Append elements to a provided document fragment- if ( fragment ) {- // Special handling of each script element- handleScript = function( elem ) {- // Check if we consider it executable- if ( !elem.type || rscriptType.test( elem.type ) ) {- // Detach the script and store it in the scripts array (if provided) or the fragment- // Return truthy to indicate that it has been handled- return scripts ?- scripts.push( elem.parentNode ? elem.parentNode.removeChild( elem ) : elem ) :- fragment.appendChild( elem );- }- };-- for ( i = 0; (elem = ret[i]) != null; i++ ) {- // Check if we're done after handling an executable script- if ( !( jQuery.nodeName( elem, "script" ) && handleScript( elem ) ) ) {- // Append to fragment and handle embedded scripts- fragment.appendChild( elem );- if ( typeof elem.getElementsByTagName !== "undefined" ) {- // handleScript alters the DOM, so use jQuery.merge to ensure snapshot iteration- jsTags = jQuery.grep( jQuery.merge( [], elem.getElementsByTagName("script") ), handleScript );-- // Splice the scripts into ret after their former ancestor and advance our index beyond them- ret.splice.apply( ret, [i + 1, 0].concat( jsTags ) );- i += jsTags.length;- }- }- }- }-- return ret;- },-- cleanData: function( elems, /* internal */ acceptData ) {- var data, id, elem, type,- i = 0,- internalKey = jQuery.expando,- cache = jQuery.cache,- deleteExpando = jQuery.support.deleteExpando,- special = jQuery.event.special;-- for ( ; (elem = elems[i]) != null; i++ ) {-- if ( acceptData || jQuery.acceptData( elem ) ) {-- id = elem[ internalKey ];- data = id && cache[ id ];-- if ( data ) {- if ( data.events ) {- for ( type in data.events ) {- if ( special[ type ] ) {- jQuery.event.remove( elem, type );-- // This is a shortcut to avoid jQuery.event.remove's overhead- } else {- jQuery.removeEvent( elem, type, data.handle );- }- }- }-- // Remove cache only if it was not already removed by jQuery.event.remove- if ( cache[ id ] ) {-- delete cache[ id ];-- // IE does not allow us to delete expando properties from nodes,- // nor does it have a removeAttribute function on Document nodes;- // we must handle all of these cases- if ( deleteExpando ) {- delete elem[ internalKey ];-- } else if ( elem.removeAttribute ) {- elem.removeAttribute( internalKey );-- } else {- elem[ internalKey ] = null;- }-- jQuery.deletedIds.push( id );- }- }- }- }- }-});-// Limit scope pollution from any deprecated API-(function() {--var matched, browser;--// Use of jQuery.browser is frowned upon.-// More details: http://api.jquery.com/jQuery.browser-// jQuery.uaMatch maintained for back-compat-jQuery.uaMatch = function( ua ) {- ua = ua.toLowerCase();-- var match = /(chrome)[ \/]([\w.]+)/.exec( ua ) ||- /(webkit)[ \/]([\w.]+)/.exec( ua ) ||- /(opera)(?:.*version|)[ \/]([\w.]+)/.exec( ua ) ||- /(msie) ([\w.]+)/.exec( ua ) ||- ua.indexOf("compatible") < 0 && /(mozilla)(?:.*? rv:([\w.]+)|)/.exec( ua ) ||- [];-- return {- browser: match[ 1 ] || "",- version: match[ 2 ] || "0"- };-};--matched = jQuery.uaMatch( navigator.userAgent );-browser = {};--if ( matched.browser ) {- browser[ matched.browser ] = true;- browser.version = matched.version;-}--// Chrome is Webkit, but Webkit is also Safari.-if ( browser.chrome ) {- browser.webkit = true;-} else if ( browser.webkit ) {- browser.safari = true;-}--jQuery.browser = browser;--jQuery.sub = function() {- function jQuerySub( selector, context ) {- return new jQuerySub.fn.init( selector, context );- }- jQuery.extend( true, jQuerySub, this );- jQuerySub.superclass = this;- jQuerySub.fn = jQuerySub.prototype = this();- jQuerySub.fn.constructor = jQuerySub;- jQuerySub.sub = this.sub;- jQuerySub.fn.init = function init( selector, context ) {- if ( context && context instanceof jQuery && !(context instanceof jQuerySub) ) {- context = jQuerySub( context );- }-- return jQuery.fn.init.call( this, selector, context, rootjQuerySub );- };- jQuerySub.fn.init.prototype = jQuerySub.fn;- var rootjQuerySub = jQuerySub(document);- return jQuerySub;-};--})();-var curCSS, iframe, iframeDoc,- ralpha = /alpha\([^)]*\)/i,- ropacity = /opacity=([^)]*)/,- rposition = /^(top|right|bottom|left)$/,- // swappable if display is none or starts with table except "table", "table-cell", or "table-caption"- // see here for display values: https://developer.mozilla.org/en-US/docs/CSS/display- rdisplayswap = /^(none|table(?!-c[ea]).+)/,- rmargin = /^margin/,- rnumsplit = new RegExp( "^(" + core_pnum + ")(.*)$", "i" ),- rnumnonpx = new RegExp( "^(" + core_pnum + ")(?!px)[a-z%]+$", "i" ),- rrelNum = new RegExp( "^([-+])=(" + core_pnum + ")", "i" ),- elemdisplay = {},-- cssShow = { position: "absolute", visibility: "hidden", display: "block" },- cssNormalTransform = {- letterSpacing: 0,- fontWeight: 400- },-- cssExpand = [ "Top", "Right", "Bottom", "Left" ],- cssPrefixes = [ "Webkit", "O", "Moz", "ms" ],-- eventsToggle = jQuery.fn.toggle;--// return a css property mapped to a potentially vendor prefixed property-function vendorPropName( style, name ) {-- // shortcut for names that are not vendor prefixed- if ( name in style ) {- return name;- }-- // check for vendor prefixed names- var capName = name.charAt(0).toUpperCase() + name.slice(1),- origName = name,- i = cssPrefixes.length;-- while ( i-- ) {- name = cssPrefixes[ i ] + capName;- if ( name in style ) {- return name;- }- }-- return origName;-}--function isHidden( elem, el ) {- elem = el || elem;- return jQuery.css( elem, "display" ) === "none" || !jQuery.contains( elem.ownerDocument, elem );-}--function showHide( elements, show ) {- var elem, display,- values = [],- index = 0,- length = elements.length;-- for ( ; index < length; index++ ) {- elem = elements[ index ];- if ( !elem.style ) {- continue;- }- values[ index ] = jQuery._data( elem, "olddisplay" );- if ( show ) {- // Reset the inline display of this element to learn if it is- // being hidden by cascaded rules or not- if ( !values[ index ] && elem.style.display === "none" ) {- elem.style.display = "";- }-- // Set elements which have been overridden with display: none- // in a stylesheet to whatever the default browser style is- // for such an element- if ( elem.style.display === "" && isHidden( elem ) ) {- values[ index ] = jQuery._data( elem, "olddisplay", css_defaultDisplay(elem.nodeName) );- }- } else {- display = curCSS( elem, "display" );-- if ( !values[ index ] && display !== "none" ) {- jQuery._data( elem, "olddisplay", display );- }- }- }-- // Set the display of most of the elements in a second loop- // to avoid the constant reflow- for ( index = 0; index < length; index++ ) {- elem = elements[ index ];- if ( !elem.style ) {- continue;- }- if ( !show || elem.style.display === "none" || elem.style.display === "" ) {- elem.style.display = show ? values[ index ] || "" : "none";- }- }-- return elements;-}--jQuery.fn.extend({- css: function( name, value ) {- return jQuery.access( this, function( elem, name, value ) {- return value !== undefined ?- jQuery.style( elem, name, value ) :- jQuery.css( elem, name );- }, name, value, arguments.length > 1 );- },- show: function() {- return showHide( this, true );- },- hide: function() {- return showHide( this );- },- toggle: function( state, fn2 ) {- var bool = typeof state === "boolean";-- if ( jQuery.isFunction( state ) && jQuery.isFunction( fn2 ) ) {- return eventsToggle.apply( this, arguments );- }-- return this.each(function() {- if ( bool ? state : isHidden( this ) ) {- jQuery( this ).show();- } else {- jQuery( this ).hide();- }- });- }-});--jQuery.extend({- // Add in style property hooks for overriding the default- // behavior of getting and setting a style property- cssHooks: {- opacity: {- get: function( elem, computed ) {- if ( computed ) {- // We should always get a number back from opacity- var ret = curCSS( elem, "opacity" );- return ret === "" ? "1" : ret;-- }- }- }- },-- // Exclude the following css properties to add px- cssNumber: {- "fillOpacity": true,- "fontWeight": true,- "lineHeight": true,- "opacity": true,- "orphans": true,- "widows": true,- "zIndex": true,- "zoom": true- },-- // Add in properties whose names you wish to fix before- // setting or getting the value- cssProps: {- // normalize float css property- "float": jQuery.support.cssFloat ? "cssFloat" : "styleFloat"- },-- // Get and set the style property on a DOM Node- style: function( elem, name, value, extra ) {- // Don't set styles on text and comment nodes- if ( !elem || elem.nodeType === 3 || elem.nodeType === 8 || !elem.style ) {- return;- }-- // Make sure that we're working with the right name- var ret, type, hooks,- origName = jQuery.camelCase( name ),- style = elem.style;-- name = jQuery.cssProps[ origName ] || ( jQuery.cssProps[ origName ] = vendorPropName( style, origName ) );-- // gets hook for the prefixed version- // followed by the unprefixed version- hooks = jQuery.cssHooks[ name ] || jQuery.cssHooks[ origName ];-- // Check if we're setting a value- if ( value !== undefined ) {- type = typeof value;-- // convert relative number strings (+= or -=) to relative numbers. #7345- if ( type === "string" && (ret = rrelNum.exec( value )) ) {- value = ( ret[1] + 1 ) * ret[2] + parseFloat( jQuery.css( elem, name ) );- // Fixes bug #9237- type = "number";- }-- // Make sure that NaN and null values aren't set. See: #7116- if ( value == null || type === "number" && isNaN( value ) ) {- return;- }-- // If a number was passed in, add 'px' to the (except for certain CSS properties)- if ( type === "number" && !jQuery.cssNumber[ origName ] ) {- value += "px";- }-- // If a hook was provided, use that value, otherwise just set the specified value- if ( !hooks || !("set" in hooks) || (value = hooks.set( elem, value, extra )) !== undefined ) {- // Wrapped to prevent IE from throwing errors when 'invalid' values are provided- // Fixes bug #5509- try {- style[ name ] = value;- } catch(e) {}- }-- } else {- // If a hook was provided get the non-computed value from there- if ( hooks && "get" in hooks && (ret = hooks.get( elem, false, extra )) !== undefined ) {- return ret;- }-- // Otherwise just get the value from the style object- return style[ name ];- }- },-- css: function( elem, name, numeric, extra ) {- var val, num, hooks,- origName = jQuery.camelCase( name );-- // Make sure that we're working with the right name- name = jQuery.cssProps[ origName ] || ( jQuery.cssProps[ origName ] = vendorPropName( elem.style, origName ) );-- // gets hook for the prefixed version- // followed by the unprefixed version- hooks = jQuery.cssHooks[ name ] || jQuery.cssHooks[ origName ];-- // If a hook was provided get the computed value from there- if ( hooks && "get" in hooks ) {- val = hooks.get( elem, true, extra );- }-- // Otherwise, if a way to get the computed value exists, use that- if ( val === undefined ) {- val = curCSS( elem, name );- }-- //convert "normal" to computed value- if ( val === "normal" && name in cssNormalTransform ) {- val = cssNormalTransform[ name ];- }-- // Return, converting to number if forced or a qualifier was provided and val looks numeric- if ( numeric || extra !== undefined ) {- num = parseFloat( val );- return numeric || jQuery.isNumeric( num ) ? num || 0 : val;- }- return val;- },-- // A method for quickly swapping in/out CSS properties to get correct calculations- swap: function( elem, options, callback ) {- var ret, name,- old = {};-- // Remember the old values, and insert the new ones- for ( name in options ) {- old[ name ] = elem.style[ name ];- elem.style[ name ] = options[ name ];- }-- ret = callback.call( elem );-- // Revert the old values- for ( name in options ) {- elem.style[ name ] = old[ name ];- }-- return ret;- }-});--// NOTE: To any future maintainer, we've window.getComputedStyle-// because jsdom on node.js will break without it.-if ( window.getComputedStyle ) {- curCSS = function( elem, name ) {- var ret, width, minWidth, maxWidth,- computed = window.getComputedStyle( elem, null ),- style = elem.style;-- if ( computed ) {-- ret = computed[ name ];- if ( ret === "" && !jQuery.contains( elem.ownerDocument, elem ) ) {- ret = jQuery.style( elem, name );- }-- // A tribute to the "awesome hack by Dean Edwards"- // Chrome < 17 and Safari 5.0 uses "computed value" instead of "used value" for margin-right- // Safari 5.1.7 (at least) returns percentage for a larger set of values, but width seems to be reliably pixels- // this is against the CSSOM draft spec: http://dev.w3.org/csswg/cssom/#resolved-values- if ( rnumnonpx.test( ret ) && rmargin.test( name ) ) {- width = style.width;- minWidth = style.minWidth;- maxWidth = style.maxWidth;-- style.minWidth = style.maxWidth = style.width = ret;- ret = computed.width;-- style.width = width;- style.minWidth = minWidth;- style.maxWidth = maxWidth;- }- }-- return ret;- };-} else if ( document.documentElement.currentStyle ) {- curCSS = function( elem, name ) {- var left, rsLeft,- ret = elem.currentStyle && elem.currentStyle[ name ],- style = elem.style;-- // Avoid setting ret to empty string here- // so we don't default to auto- if ( ret == null && style && style[ name ] ) {- ret = style[ name ];- }-- // From the awesome hack by Dean Edwards- // http://erik.eae.net/archives/2007/07/27/18.54.15/#comment-102291-- // If we're not dealing with a regular pixel number- // but a number that has a weird ending, we need to convert it to pixels- // but not position css attributes, as those are proportional to the parent element instead- // and we can't measure the parent instead because it might trigger a "stacking dolls" problem- if ( rnumnonpx.test( ret ) && !rposition.test( name ) ) {-- // Remember the original values- left = style.left;- rsLeft = elem.runtimeStyle && elem.runtimeStyle.left;-- // Put in the new values to get a computed value out- if ( rsLeft ) {- elem.runtimeStyle.left = elem.currentStyle.left;- }- style.left = name === "fontSize" ? "1em" : ret;- ret = style.pixelLeft + "px";-- // Revert the changed values- style.left = left;- if ( rsLeft ) {- elem.runtimeStyle.left = rsLeft;- }- }-- return ret === "" ? "auto" : ret;- };-}--function setPositiveNumber( elem, value, subtract ) {- var matches = rnumsplit.exec( value );- return matches ?- Math.max( 0, matches[ 1 ] - ( subtract || 0 ) ) + ( matches[ 2 ] || "px" ) :- value;-}--function augmentWidthOrHeight( elem, name, extra, isBorderBox ) {- var i = extra === ( isBorderBox ? "border" : "content" ) ?- // If we already have the right measurement, avoid augmentation- 4 :- // Otherwise initialize for horizontal or vertical properties- name === "width" ? 1 : 0,-- val = 0;-- for ( ; i < 4; i += 2 ) {- // both box models exclude margin, so add it if we want it- if ( extra === "margin" ) {- // we use jQuery.css instead of curCSS here- // because of the reliableMarginRight CSS hook!- val += jQuery.css( elem, extra + cssExpand[ i ], true );- }-- // From this point on we use curCSS for maximum performance (relevant in animations)- if ( isBorderBox ) {- // border-box includes padding, so remove it if we want content- if ( extra === "content" ) {- val -= parseFloat( curCSS( elem, "padding" + cssExpand[ i ] ) ) || 0;- }-- // at this point, extra isn't border nor margin, so remove border- if ( extra !== "margin" ) {- val -= parseFloat( curCSS( elem, "border" + cssExpand[ i ] + "Width" ) ) || 0;- }- } else {- // at this point, extra isn't content, so add padding- val += parseFloat( curCSS( elem, "padding" + cssExpand[ i ] ) ) || 0;-- // at this point, extra isn't content nor padding, so add border- if ( extra !== "padding" ) {- val += parseFloat( curCSS( elem, "border" + cssExpand[ i ] + "Width" ) ) || 0;- }- }- }-- return val;-}--function getWidthOrHeight( elem, name, extra ) {-- // Start with offset property, which is equivalent to the border-box value- var val = name === "width" ? elem.offsetWidth : elem.offsetHeight,- valueIsBorderBox = true,- isBorderBox = jQuery.support.boxSizing && jQuery.css( elem, "boxSizing" ) === "border-box";-- // some non-html elements return undefined for offsetWidth, so check for null/undefined- // svg - https://bugzilla.mozilla.org/show_bug.cgi?id=649285- // MathML - https://bugzilla.mozilla.org/show_bug.cgi?id=491668- if ( val <= 0 || val == null ) {- // Fall back to computed then uncomputed css if necessary- val = curCSS( elem, name );- if ( val < 0 || val == null ) {- val = elem.style[ name ];- }-- // Computed unit is not pixels. Stop here and return.- if ( rnumnonpx.test(val) ) {- return val;- }-- // we need the check for style in case a browser which returns unreliable values- // for getComputedStyle silently falls back to the reliable elem.style- valueIsBorderBox = isBorderBox && ( jQuery.support.boxSizingReliable || val === elem.style[ name ] );-- // Normalize "", auto, and prepare for extra- val = parseFloat( val ) || 0;- }-- // use the active box-sizing model to add/subtract irrelevant styles- return ( val +- augmentWidthOrHeight(- elem,- name,- extra || ( isBorderBox ? "border" : "content" ),- valueIsBorderBox- )- ) + "px";-}---// Try to determine the default display value of an element-function css_defaultDisplay( nodeName ) {- if ( elemdisplay[ nodeName ] ) {- return elemdisplay[ nodeName ];- }-- var elem = jQuery( "<" + nodeName + ">" ).appendTo( document.body ),- display = elem.css("display");- elem.remove();-- // If the simple way fails,- // get element's real default display by attaching it to a temp iframe- if ( display === "none" || display === "" ) {- // Use the already-created iframe if possible- iframe = document.body.appendChild(- iframe || jQuery.extend( document.createElement("iframe"), {- frameBorder: 0,- width: 0,- height: 0- })- );-- // Create a cacheable copy of the iframe document on first call.- // IE and Opera will allow us to reuse the iframeDoc without re-writing the fake HTML- // document to it; WebKit & Firefox won't allow reusing the iframe document.- if ( !iframeDoc || !iframe.createElement ) {- iframeDoc = ( iframe.contentWindow || iframe.contentDocument ).document;- iframeDoc.write("<!doctype html><html><body>");- iframeDoc.close();- }-- elem = iframeDoc.body.appendChild( iframeDoc.createElement(nodeName) );-- display = curCSS( elem, "display" );- document.body.removeChild( iframe );- }-- // Store the correct default display- elemdisplay[ nodeName ] = display;-- return display;-}--jQuery.each([ "height", "width" ], function( i, name ) {- jQuery.cssHooks[ name ] = {- get: function( elem, computed, extra ) {- if ( computed ) {- // certain elements can have dimension info if we invisibly show them- // however, it must have a current display style that would benefit from this- if ( elem.offsetWidth === 0 && rdisplayswap.test( curCSS( elem, "display" ) ) ) {- return jQuery.swap( elem, cssShow, function() {- return getWidthOrHeight( elem, name, extra );- });- } else {- return getWidthOrHeight( elem, name, extra );- }- }- },-- set: function( elem, value, extra ) {- return setPositiveNumber( elem, value, extra ?- augmentWidthOrHeight(- elem,- name,- extra,- jQuery.support.boxSizing && jQuery.css( elem, "boxSizing" ) === "border-box"- ) : 0- );- }- };-});--if ( !jQuery.support.opacity ) {- jQuery.cssHooks.opacity = {- get: function( elem, computed ) {- // IE uses filters for opacity- return ropacity.test( (computed && elem.currentStyle ? elem.currentStyle.filter : elem.style.filter) || "" ) ?- ( 0.01 * parseFloat( RegExp.$1 ) ) + "" :- computed ? "1" : "";- },-- set: function( elem, value ) {- var style = elem.style,- currentStyle = elem.currentStyle,- opacity = jQuery.isNumeric( value ) ? "alpha(opacity=" + value * 100 + ")" : "",- filter = currentStyle && currentStyle.filter || style.filter || "";-- // IE has trouble with opacity if it does not have layout- // Force it by setting the zoom level- style.zoom = 1;-- // if setting opacity to 1, and no other filters exist - attempt to remove filter attribute #6652- if ( value >= 1 && jQuery.trim( filter.replace( ralpha, "" ) ) === "" &&- style.removeAttribute ) {-- // Setting style.filter to null, "" & " " still leave "filter:" in the cssText- // if "filter:" is present at all, clearType is disabled, we want to avoid this- // style.removeAttribute is IE Only, but so apparently is this code path...- style.removeAttribute( "filter" );-- // if there there is no filter style applied in a css rule, we are done- if ( currentStyle && !currentStyle.filter ) {- return;- }- }-- // otherwise, set new filter values- style.filter = ralpha.test( filter ) ?- filter.replace( ralpha, opacity ) :- filter + " " + opacity;- }- };-}--// These hooks cannot be added until DOM ready because the support test-// for it is not run until after DOM ready-jQuery(function() {- if ( !jQuery.support.reliableMarginRight ) {- jQuery.cssHooks.marginRight = {- get: function( elem, computed ) {- // WebKit Bug 13343 - getComputedStyle returns wrong value for margin-right- // Work around by temporarily setting element display to inline-block- return jQuery.swap( elem, { "display": "inline-block" }, function() {- if ( computed ) {- return curCSS( elem, "marginRight" );- }- });- }- };- }-- // Webkit bug: https://bugs.webkit.org/show_bug.cgi?id=29084- // getComputedStyle returns percent when specified for top/left/bottom/right- // rather than make the css module depend on the offset module, we just check for it here- if ( !jQuery.support.pixelPosition && jQuery.fn.position ) {- jQuery.each( [ "top", "left" ], function( i, prop ) {- jQuery.cssHooks[ prop ] = {- get: function( elem, computed ) {- if ( computed ) {- var ret = curCSS( elem, prop );- // if curCSS returns percentage, fallback to offset- return rnumnonpx.test( ret ) ? jQuery( elem ).position()[ prop ] + "px" : ret;- }- }- };- });- }--});--if ( jQuery.expr && jQuery.expr.filters ) {- jQuery.expr.filters.hidden = function( elem ) {- return ( elem.offsetWidth === 0 && elem.offsetHeight === 0 ) || (!jQuery.support.reliableHiddenOffsets && ((elem.style && elem.style.display) || curCSS( elem, "display" )) === "none");- };-- jQuery.expr.filters.visible = function( elem ) {- return !jQuery.expr.filters.hidden( elem );- };-}--// These hooks are used by animate to expand properties-jQuery.each({- margin: "",- padding: "",- border: "Width"-}, function( prefix, suffix ) {- jQuery.cssHooks[ prefix + suffix ] = {- expand: function( value ) {- var i,-- // assumes a single number if not a string- parts = typeof value === "string" ? value.split(" ") : [ value ],- expanded = {};-- for ( i = 0; i < 4; i++ ) {- expanded[ prefix + cssExpand[ i ] + suffix ] =- parts[ i ] || parts[ i - 2 ] || parts[ 0 ];- }-- return expanded;- }- };-- if ( !rmargin.test( prefix ) ) {- jQuery.cssHooks[ prefix + suffix ].set = setPositiveNumber;- }-});-var r20 = /%20/g,- rbracket = /\[\]$/,- rCRLF = /\r?\n/g,- rinput = /^(?:color|date|datetime|datetime-local|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,- rselectTextarea = /^(?:select|textarea)/i;--jQuery.fn.extend({- serialize: function() {- return jQuery.param( this.serializeArray() );- },- serializeArray: function() {- return this.map(function(){- return this.elements ? jQuery.makeArray( this.elements ) : this;- })- .filter(function(){- return this.name && !this.disabled &&- ( this.checked || rselectTextarea.test( this.nodeName ) ||- rinput.test( this.type ) );- })- .map(function( i, elem ){- var val = jQuery( this ).val();-- return val == null ?- null :- jQuery.isArray( val ) ?- jQuery.map( val, function( val, i ){- return { name: elem.name, value: val.replace( rCRLF, "\r\n" ) };- }) :- { name: elem.name, value: val.replace( rCRLF, "\r\n" ) };- }).get();- }-});--//Serialize an array of form elements or a set of-//key/values into a query string-jQuery.param = function( a, traditional ) {- var prefix,- s = [],- add = function( key, value ) {- // If value is a function, invoke it and return its value- value = jQuery.isFunction( value ) ? value() : ( value == null ? "" : value );- s[ s.length ] = encodeURIComponent( key ) + "=" + encodeURIComponent( value );- };-- // Set traditional to true for jQuery <= 1.3.2 behavior.- if ( traditional === undefined ) {- traditional = jQuery.ajaxSettings && jQuery.ajaxSettings.traditional;- }-- // If an array was passed in, assume that it is an array of form elements.- if ( jQuery.isArray( a ) || ( a.jquery && !jQuery.isPlainObject( a ) ) ) {- // Serialize the form elements- jQuery.each( a, function() {- add( this.name, this.value );- });-- } else {- // If traditional, encode the "old" way (the way 1.3.2 or older- // did it), otherwise encode params recursively.- for ( prefix in a ) {- buildParams( prefix, a[ prefix ], traditional, add );- }- }-- // Return the resulting serialization- return s.join( "&" ).replace( r20, "+" );-};--function buildParams( prefix, obj, traditional, add ) {- var name;-- if ( jQuery.isArray( obj ) ) {- // Serialize array item.- jQuery.each( obj, function( i, v ) {- if ( traditional || rbracket.test( prefix ) ) {- // Treat each array item as a scalar.- add( prefix, v );-- } else {- // If array item is non-scalar (array or object), encode its- // numeric index to resolve deserialization ambiguity issues.- // Note that rack (as of 1.0.0) can't currently deserialize- // nested arrays properly, and attempting to do so may cause- // a server error. Possible fixes are to modify rack's- // deserialization algorithm or to provide an option or flag- // to force array serialization to be shallow.- buildParams( prefix + "[" + ( typeof v === "object" ? i : "" ) + "]", v, traditional, add );- }- });-- } else if ( !traditional && jQuery.type( obj ) === "object" ) {- // Serialize object item.- for ( name in obj ) {- buildParams( prefix + "[" + name + "]", obj[ name ], traditional, add );- }-- } else {- // Serialize scalar item.- add( prefix, obj );- }-}-var- // Document location- ajaxLocParts,- ajaxLocation,-- rhash = /#.*$/,- rheaders = /^(.*?):[ \t]*([^\r\n]*)\r?$/mg, // IE leaves an \r character at EOL- // #7653, #8125, #8152: local protocol detection- rlocalProtocol = /^(?:about|app|app\-storage|.+\-extension|file|res|widget):$/,- rnoContent = /^(?:GET|HEAD)$/,- rprotocol = /^\/\//,- rquery = /\?/,- rscript = /<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi,- rts = /([?&])_=[^&]*/,- rurl = /^([\w\+\.\-]+:)(?:\/\/([^\/?#:]*)(?::(\d+)|)|)/,-- // Keep a copy of the old load method- _load = jQuery.fn.load,-- /* Prefilters- * 1) They are useful to introduce custom dataTypes (see ajax/jsonp.js for an example)- * 2) These are called:- * - BEFORE asking for a transport- * - AFTER param serialization (s.data is a string if s.processData is true)- * 3) key is the dataType- * 4) the catchall symbol "*" can be used- * 5) execution will start with transport dataType and THEN continue down to "*" if needed- */- prefilters = {},-- /* Transports bindings- * 1) key is the dataType- * 2) the catchall symbol "*" can be used- * 3) selection will start with transport dataType and THEN go to "*" if needed- */- transports = {},-- // Avoid comment-prolog char sequence (#10098); must appease lint and evade compression- allTypes = ["*/"] + ["*"];--// #8138, IE may throw an exception when accessing-// a field from window.location if document.domain has been set-try {- ajaxLocation = location.href;-} catch( e ) {- // Use the href attribute of an A element- // since IE will modify it given document.location- ajaxLocation = document.createElement( "a" );- ajaxLocation.href = "";- ajaxLocation = ajaxLocation.href;-}--// Segment location into parts-ajaxLocParts = rurl.exec( ajaxLocation.toLowerCase() ) || [];--// Base "constructor" for jQuery.ajaxPrefilter and jQuery.ajaxTransport-function addToPrefiltersOrTransports( structure ) {-- // dataTypeExpression is optional and defaults to "*"- return function( dataTypeExpression, func ) {-- if ( typeof dataTypeExpression !== "string" ) {- func = dataTypeExpression;- dataTypeExpression = "*";- }-- var dataType, list, placeBefore,- dataTypes = dataTypeExpression.toLowerCase().split( core_rspace ),- i = 0,- length = dataTypes.length;-- if ( jQuery.isFunction( func ) ) {- // For each dataType in the dataTypeExpression- for ( ; i < length; i++ ) {- dataType = dataTypes[ i ];- // We control if we're asked to add before- // any existing element- placeBefore = /^\+/.test( dataType );- if ( placeBefore ) {- dataType = dataType.substr( 1 ) || "*";- }- list = structure[ dataType ] = structure[ dataType ] || [];- // then we add to the structure accordingly- list[ placeBefore ? "unshift" : "push" ]( func );- }- }- };-}--// Base inspection function for prefilters and transports-function inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR,- dataType /* internal */, inspected /* internal */ ) {-- dataType = dataType || options.dataTypes[ 0 ];- inspected = inspected || {};-- inspected[ dataType ] = true;-- var selection,- list = structure[ dataType ],- i = 0,- length = list ? list.length : 0,- executeOnly = ( structure === prefilters );-- for ( ; i < length && ( executeOnly || !selection ); i++ ) {- selection = list[ i ]( options, originalOptions, jqXHR );- // If we got redirected to another dataType- // we try there if executing only and not done already- if ( typeof selection === "string" ) {- if ( !executeOnly || inspected[ selection ] ) {- selection = undefined;- } else {- options.dataTypes.unshift( selection );- selection = inspectPrefiltersOrTransports(- structure, options, originalOptions, jqXHR, selection, inspected );- }- }- }- // If we're only executing or nothing was selected- // we try the catchall dataType if not done already- if ( ( executeOnly || !selection ) && !inspected[ "*" ] ) {- selection = inspectPrefiltersOrTransports(- structure, options, originalOptions, jqXHR, "*", inspected );- }- // unnecessary when only executing (prefilters)- // but it'll be ignored by the caller in that case- return selection;-}--// A special extend for ajax options-// that takes "flat" options (not to be deep extended)-// Fixes #9887-function ajaxExtend( target, src ) {- var key, deep,- flatOptions = jQuery.ajaxSettings.flatOptions || {};- for ( key in src ) {- if ( src[ key ] !== undefined ) {- ( flatOptions[ key ] ? target : ( deep || ( deep = {} ) ) )[ key ] = src[ key ];- }- }- if ( deep ) {- jQuery.extend( true, target, deep );- }-}--jQuery.fn.load = function( url, params, callback ) {- if ( typeof url !== "string" && _load ) {- return _load.apply( this, arguments );- }-- // Don't do a request if no elements are being requested- if ( !this.length ) {- return this;- }-- var selector, type, response,- self = this,- off = url.indexOf(" ");-- if ( off >= 0 ) {- selector = url.slice( off, url.length );- url = url.slice( 0, off );- }-- // If it's a function- if ( jQuery.isFunction( params ) ) {-- // We assume that it's the callback- callback = params;- params = undefined;-- // Otherwise, build a param string- } else if ( params && typeof params === "object" ) {- type = "POST";- }-- // Request the remote document- jQuery.ajax({- url: url,-- // if "type" variable is undefined, then "GET" method will be used- type: type,- dataType: "html",- data: params,- complete: function( jqXHR, status ) {- if ( callback ) {- self.each( callback, response || [ jqXHR.responseText, status, jqXHR ] );- }- }- }).done(function( responseText ) {-- // Save response for use in complete callback- response = arguments;-- // See if a selector was specified- self.html( selector ?-- // Create a dummy div to hold the results- jQuery("<div>")-- // inject the contents of the document in, removing the scripts- // to avoid any 'Permission Denied' errors in IE- .append( responseText.replace( rscript, "" ) )-- // Locate the specified elements- .find( selector ) :-- // If not, just inject the full result- responseText );-- });-- return this;-};--// Attach a bunch of functions for handling common AJAX events-jQuery.each( "ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split( " " ), function( i, o ){- jQuery.fn[ o ] = function( f ){- return this.on( o, f );- };-});--jQuery.each( [ "get", "post" ], function( i, method ) {- jQuery[ method ] = function( url, data, callback, type ) {- // shift arguments if data argument was omitted- if ( jQuery.isFunction( data ) ) {- type = type || callback;- callback = data;- data = undefined;- }-- return jQuery.ajax({- type: method,- url: url,- data: data,- success: callback,- dataType: type- });- };-});--jQuery.extend({-- getScript: function( url, callback ) {- return jQuery.get( url, undefined, callback, "script" );- },-- getJSON: function( url, data, callback ) {- return jQuery.get( url, data, callback, "json" );- },-- // Creates a full fledged settings object into target- // with both ajaxSettings and settings fields.- // If target is omitted, writes into ajaxSettings.- ajaxSetup: function( target, settings ) {- if ( settings ) {- // Building a settings object- ajaxExtend( target, jQuery.ajaxSettings );- } else {- // Extending ajaxSettings- settings = target;- target = jQuery.ajaxSettings;- }- ajaxExtend( target, settings );- return target;- },-- ajaxSettings: {- url: ajaxLocation,- isLocal: rlocalProtocol.test( ajaxLocParts[ 1 ] ),- global: true,- type: "GET",- contentType: "application/x-www-form-urlencoded; charset=UTF-8",- processData: true,- async: true,- /*- timeout: 0,- data: null,- dataType: null,- username: null,- password: null,- cache: null,- throws: false,- traditional: false,- headers: {},- */-- accepts: {- xml: "application/xml, text/xml",- html: "text/html",- text: "text/plain",- json: "application/json, text/javascript",- "*": allTypes- },-- contents: {- xml: /xml/,- html: /html/,- json: /json/- },-- responseFields: {- xml: "responseXML",- text: "responseText"- },-- // List of data converters- // 1) key format is "source_type destination_type" (a single space in-between)- // 2) the catchall symbol "*" can be used for source_type- converters: {-- // Convert anything to text- "* text": window.String,-- // Text to html (true = no transformation)- "text html": true,-- // Evaluate text as a json expression- "text json": jQuery.parseJSON,-- // Parse text as xml- "text xml": jQuery.parseXML- },-- // For options that shouldn't be deep extended:- // you can add your own custom options here if- // and when you create one that shouldn't be- // deep extended (see ajaxExtend)- flatOptions: {- context: true,- url: true- }- },-- ajaxPrefilter: addToPrefiltersOrTransports( prefilters ),- ajaxTransport: addToPrefiltersOrTransports( transports ),-- // Main method- ajax: function( url, options ) {-- // If url is an object, simulate pre-1.5 signature- if ( typeof url === "object" ) {- options = url;- url = undefined;- }-- // Force options to be an object- options = options || {};-- var // ifModified key- ifModifiedKey,- // Response headers- responseHeadersString,- responseHeaders,- // transport- transport,- // timeout handle- timeoutTimer,- // Cross-domain detection vars- parts,- // To know if global events are to be dispatched- fireGlobals,- // Loop variable- i,- // Create the final options object- s = jQuery.ajaxSetup( {}, options ),- // Callbacks context- callbackContext = s.context || s,- // Context for global events- // It's the callbackContext if one was provided in the options- // and if it's a DOM node or a jQuery collection- globalEventContext = callbackContext !== s &&- ( callbackContext.nodeType || callbackContext instanceof jQuery ) ?- jQuery( callbackContext ) : jQuery.event,- // Deferreds- deferred = jQuery.Deferred(),- completeDeferred = jQuery.Callbacks( "once memory" ),- // Status-dependent callbacks- statusCode = s.statusCode || {},- // Headers (they are sent all at once)- requestHeaders = {},- requestHeadersNames = {},- // The jqXHR state- state = 0,- // Default abort message- strAbort = "canceled",- // Fake xhr- jqXHR = {-- readyState: 0,-- // Caches the header- setRequestHeader: function( name, value ) {- if ( !state ) {- var lname = name.toLowerCase();- name = requestHeadersNames[ lname ] = requestHeadersNames[ lname ] || name;- requestHeaders[ name ] = value;- }- return this;- },-- // Raw string- getAllResponseHeaders: function() {- return state === 2 ? responseHeadersString : null;- },-- // Builds headers hashtable if needed- getResponseHeader: function( key ) {- var match;- if ( state === 2 ) {- if ( !responseHeaders ) {- responseHeaders = {};- while( ( match = rheaders.exec( responseHeadersString ) ) ) {- responseHeaders[ match[1].toLowerCase() ] = match[ 2 ];- }- }- match = responseHeaders[ key.toLowerCase() ];- }- return match === undefined ? null : match;- },-- // Overrides response content-type header- overrideMimeType: function( type ) {- if ( !state ) {- s.mimeType = type;- }- return this;- },-- // Cancel the request- abort: function( statusText ) {- statusText = statusText || strAbort;- if ( transport ) {- transport.abort( statusText );- }- done( 0, statusText );- return this;- }- };-- // Callback for when everything is done- // It is defined here because jslint complains if it is declared- // at the end of the function (which would be more logical and readable)- function done( status, nativeStatusText, responses, headers ) {- var isSuccess, success, error, response, modified,- statusText = nativeStatusText;-- // Called once- if ( state === 2 ) {- return;- }-- // State is "done" now- state = 2;-- // Clear timeout if it exists- if ( timeoutTimer ) {- clearTimeout( timeoutTimer );- }-- // Dereference transport for early garbage collection- // (no matter how long the jqXHR object will be used)- transport = undefined;-- // Cache response headers- responseHeadersString = headers || "";-- // Set readyState- jqXHR.readyState = status > 0 ? 4 : 0;-- // Get response data- if ( responses ) {- response = ajaxHandleResponses( s, jqXHR, responses );- }-- // If successful, handle type chaining- if ( status >= 200 && status < 300 || status === 304 ) {-- // Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode.- if ( s.ifModified ) {-- modified = jqXHR.getResponseHeader("Last-Modified");- if ( modified ) {- jQuery.lastModified[ ifModifiedKey ] = modified;- }- modified = jqXHR.getResponseHeader("Etag");- if ( modified ) {- jQuery.etag[ ifModifiedKey ] = modified;- }- }-- // If not modified- if ( status === 304 ) {-- statusText = "notmodified";- isSuccess = true;-- // If we have data- } else {-- isSuccess = ajaxConvert( s, response );- statusText = isSuccess.state;- success = isSuccess.data;- error = isSuccess.error;- isSuccess = !error;- }- } else {- // We extract error from statusText- // then normalize statusText and status for non-aborts- error = statusText;- if ( !statusText || status ) {- statusText = "error";- if ( status < 0 ) {- status = 0;- }- }- }-- // Set data for the fake xhr object- jqXHR.status = status;- jqXHR.statusText = ( nativeStatusText || statusText ) + "";-- // Success/Error- if ( isSuccess ) {- deferred.resolveWith( callbackContext, [ success, statusText, jqXHR ] );- } else {- deferred.rejectWith( callbackContext, [ jqXHR, statusText, error ] );- }-- // Status-dependent callbacks- jqXHR.statusCode( statusCode );- statusCode = undefined;-- if ( fireGlobals ) {- globalEventContext.trigger( "ajax" + ( isSuccess ? "Success" : "Error" ),- [ jqXHR, s, isSuccess ? success : error ] );- }-- // Complete- completeDeferred.fireWith( callbackContext, [ jqXHR, statusText ] );-- if ( fireGlobals ) {- globalEventContext.trigger( "ajaxComplete", [ jqXHR, s ] );- // Handle the global AJAX counter- if ( !( --jQuery.active ) ) {- jQuery.event.trigger( "ajaxStop" );- }- }- }-- // Attach deferreds- deferred.promise( jqXHR );- jqXHR.success = jqXHR.done;- jqXHR.error = jqXHR.fail;- jqXHR.complete = completeDeferred.add;-- // Status-dependent callbacks- jqXHR.statusCode = function( map ) {- if ( map ) {- var tmp;- if ( state < 2 ) {- for ( tmp in map ) {- statusCode[ tmp ] = [ statusCode[tmp], map[tmp] ];- }- } else {- tmp = map[ jqXHR.status ];- jqXHR.always( tmp );- }- }- return this;- };-- // Remove hash character (#7531: and string promotion)- // Add protocol if not provided (#5866: IE7 issue with protocol-less urls)- // We also use the url parameter if available- s.url = ( ( url || s.url ) + "" ).replace( rhash, "" ).replace( rprotocol, ajaxLocParts[ 1 ] + "//" );-- // Extract dataTypes list- s.dataTypes = jQuery.trim( s.dataType || "*" ).toLowerCase().split( core_rspace );-- // A cross-domain request is in order when we have a protocol:host:port mismatch- if ( s.crossDomain == null ) {- parts = rurl.exec( s.url.toLowerCase() ) || false;- s.crossDomain = parts && ( parts.join(":") + ( parts[ 3 ] ? "" : parts[ 1 ] === "http:" ? 80 : 443 ) ) !==- ( ajaxLocParts.join(":") + ( ajaxLocParts[ 3 ] ? "" : ajaxLocParts[ 1 ] === "http:" ? 80 : 443 ) );- }-- // Convert data if not already a string- if ( s.data && s.processData && typeof s.data !== "string" ) {- s.data = jQuery.param( s.data, s.traditional );- }-- // Apply prefilters- inspectPrefiltersOrTransports( prefilters, s, options, jqXHR );-- // If request was aborted inside a prefilter, stop there- if ( state === 2 ) {- return jqXHR;- }-- // We can fire global events as of now if asked to- fireGlobals = s.global;-- // Uppercase the type- s.type = s.type.toUpperCase();-- // Determine if request has content- s.hasContent = !rnoContent.test( s.type );-- // Watch for a new set of requests- if ( fireGlobals && jQuery.active++ === 0 ) {- jQuery.event.trigger( "ajaxStart" );- }-- // More options handling for requests with no content- if ( !s.hasContent ) {-- // If data is available, append data to url- if ( s.data ) {- s.url += ( rquery.test( s.url ) ? "&" : "?" ) + s.data;- // #9682: remove data so that it's not used in an eventual retry- delete s.data;- }-- // Get ifModifiedKey before adding the anti-cache parameter- ifModifiedKey = s.url;-- // Add anti-cache in url if needed- if ( s.cache === false ) {-- var ts = jQuery.now(),- // try replacing _= if it is there- ret = s.url.replace( rts, "$1_=" + ts );-- // if nothing was replaced, add timestamp to the end- s.url = ret + ( ( ret === s.url ) ? ( rquery.test( s.url ) ? "&" : "?" ) + "_=" + ts : "" );- }- }-- // Set the correct header, if data is being sent- if ( s.data && s.hasContent && s.contentType !== false || options.contentType ) {- jqXHR.setRequestHeader( "Content-Type", s.contentType );- }-- // Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode.- if ( s.ifModified ) {- ifModifiedKey = ifModifiedKey || s.url;- if ( jQuery.lastModified[ ifModifiedKey ] ) {- jqXHR.setRequestHeader( "If-Modified-Since", jQuery.lastModified[ ifModifiedKey ] );- }- if ( jQuery.etag[ ifModifiedKey ] ) {- jqXHR.setRequestHeader( "If-None-Match", jQuery.etag[ ifModifiedKey ] );- }- }-- // Set the Accepts header for the server, depending on the dataType- jqXHR.setRequestHeader(- "Accept",- s.dataTypes[ 0 ] && s.accepts[ s.dataTypes[0] ] ?- s.accepts[ s.dataTypes[0] ] + ( s.dataTypes[ 0 ] !== "*" ? ", " + allTypes + "; q=0.01" : "" ) :- s.accepts[ "*" ]- );-- // Check for headers option- for ( i in s.headers ) {- jqXHR.setRequestHeader( i, s.headers[ i ] );- }-- // Allow custom headers/mimetypes and early abort- if ( s.beforeSend && ( s.beforeSend.call( callbackContext, jqXHR, s ) === false || state === 2 ) ) {- // Abort if not done already and return- return jqXHR.abort();-- }-- // aborting is no longer a cancellation- strAbort = "abort";-- // Install callbacks on deferreds- for ( i in { success: 1, error: 1, complete: 1 } ) {- jqXHR[ i ]( s[ i ] );- }-- // Get transport- transport = inspectPrefiltersOrTransports( transports, s, options, jqXHR );-- // If no transport, we auto-abort- if ( !transport ) {- done( -1, "No Transport" );- } else {- jqXHR.readyState = 1;- // Send global event- if ( fireGlobals ) {- globalEventContext.trigger( "ajaxSend", [ jqXHR, s ] );- }- // Timeout- if ( s.async && s.timeout > 0 ) {- timeoutTimer = setTimeout( function(){- jqXHR.abort( "timeout" );- }, s.timeout );- }-- try {- state = 1;- transport.send( requestHeaders, done );- } catch (e) {- // Propagate exception as error if not done- if ( state < 2 ) {- done( -1, e );- // Simply rethrow otherwise- } else {- throw e;- }- }- }-- return jqXHR;- },-- // Counter for holding the number of active queries- active: 0,-- // Last-Modified header cache for next request- lastModified: {},- etag: {}--});--/* Handles responses to an ajax request:- * - sets all responseXXX fields accordingly- * - finds the right dataType (mediates between content-type and expected dataType)- * - returns the corresponding response- */-function ajaxHandleResponses( s, jqXHR, responses ) {-- var ct, type, finalDataType, firstDataType,- contents = s.contents,- dataTypes = s.dataTypes,- responseFields = s.responseFields;-- // Fill responseXXX fields- for ( type in responseFields ) {- if ( type in responses ) {- jqXHR[ responseFields[type] ] = responses[ type ];- }- }-- // Remove auto dataType and get content-type in the process- while( dataTypes[ 0 ] === "*" ) {- dataTypes.shift();- if ( ct === undefined ) {- ct = s.mimeType || jqXHR.getResponseHeader( "content-type" );- }- }-- // Check if we're dealing with a known content-type- if ( ct ) {- for ( type in contents ) {- if ( contents[ type ] && contents[ type ].test( ct ) ) {- dataTypes.unshift( type );- break;- }- }- }-- // Check to see if we have a response for the expected dataType- if ( dataTypes[ 0 ] in responses ) {- finalDataType = dataTypes[ 0 ];- } else {- // Try convertible dataTypes- for ( type in responses ) {- if ( !dataTypes[ 0 ] || s.converters[ type + " " + dataTypes[0] ] ) {- finalDataType = type;- break;- }- if ( !firstDataType ) {- firstDataType = type;- }- }- // Or just use first one- finalDataType = finalDataType || firstDataType;- }-- // If we found a dataType- // We add the dataType to the list if needed- // and return the corresponding response- if ( finalDataType ) {- if ( finalDataType !== dataTypes[ 0 ] ) {- dataTypes.unshift( finalDataType );- }- return responses[ finalDataType ];- }-}--// Chain conversions given the request and the original response-function ajaxConvert( s, response ) {-- var conv, conv2, current, tmp,- // Work with a copy of dataTypes in case we need to modify it for conversion- dataTypes = s.dataTypes.slice(),- prev = dataTypes[ 0 ],- converters = {},- i = 0;-- // Apply the dataFilter if provided- if ( s.dataFilter ) {- response = s.dataFilter( response, s.dataType );- }-- // Create converters map with lowercased keys- if ( dataTypes[ 1 ] ) {- for ( conv in s.converters ) {- converters[ conv.toLowerCase() ] = s.converters[ conv ];- }- }-- // Convert to each sequential dataType, tolerating list modification- for ( ; (current = dataTypes[++i]); ) {-- // There's only work to do if current dataType is non-auto- if ( current !== "*" ) {-- // Convert response if prev dataType is non-auto and differs from current- if ( prev !== "*" && prev !== current ) {-- // Seek a direct converter- conv = converters[ prev + " " + current ] || converters[ "* " + current ];-- // If none found, seek a pair- if ( !conv ) {- for ( conv2 in converters ) {-- // If conv2 outputs current- tmp = conv2.split(" ");- if ( tmp[ 1 ] === current ) {-- // If prev can be converted to accepted input- conv = converters[ prev + " " + tmp[ 0 ] ] ||- converters[ "* " + tmp[ 0 ] ];- if ( conv ) {- // Condense equivalence converters- if ( conv === true ) {- conv = converters[ conv2 ];-- // Otherwise, insert the intermediate dataType- } else if ( converters[ conv2 ] !== true ) {- current = tmp[ 0 ];- dataTypes.splice( i--, 0, current );- }-- break;- }- }- }- }-- // Apply converter (if not an equivalence)- if ( conv !== true ) {-- // Unless errors are allowed to bubble, catch and return them- if ( conv && s["throws"] ) {- response = conv( response );- } else {- try {- response = conv( response );- } catch ( e ) {- return { state: "parsererror", error: conv ? e : "No conversion from " + prev + " to " + current };- }- }- }- }-- // Update prev for next iteration- prev = current;- }- }-- return { state: "success", data: response };-}-var oldCallbacks = [],- rquestion = /\?/,- rjsonp = /(=)\?(?=&|$)|\?\?/,- nonce = jQuery.now();--// Default jsonp settings-jQuery.ajaxSetup({- jsonp: "callback",- jsonpCallback: function() {- var callback = oldCallbacks.pop() || ( jQuery.expando + "_" + ( nonce++ ) );- this[ callback ] = true;- return callback;- }-});--// Detect, normalize options and install callbacks for jsonp requests-jQuery.ajaxPrefilter( "json jsonp", function( s, originalSettings, jqXHR ) {-- var callbackName, overwritten, responseContainer,- data = s.data,- url = s.url,- hasCallback = s.jsonp !== false,- replaceInUrl = hasCallback && rjsonp.test( url ),- replaceInData = hasCallback && !replaceInUrl && typeof data === "string" &&- !( s.contentType || "" ).indexOf("application/x-www-form-urlencoded") &&- rjsonp.test( data );-- // Handle iff the expected data type is "jsonp" or we have a parameter to set- if ( s.dataTypes[ 0 ] === "jsonp" || replaceInUrl || replaceInData ) {-- // Get callback name, remembering preexisting value associated with it- callbackName = s.jsonpCallback = jQuery.isFunction( s.jsonpCallback ) ?- s.jsonpCallback() :- s.jsonpCallback;- overwritten = window[ callbackName ];-- // Insert callback into url or form data- if ( replaceInUrl ) {- s.url = url.replace( rjsonp, "$1" + callbackName );- } else if ( replaceInData ) {- s.data = data.replace( rjsonp, "$1" + callbackName );- } else if ( hasCallback ) {- s.url += ( rquestion.test( url ) ? "&" : "?" ) + s.jsonp + "=" + callbackName;- }-- // Use data converter to retrieve json after script execution- s.converters["script json"] = function() {- if ( !responseContainer ) {- jQuery.error( callbackName + " was not called" );- }- return responseContainer[ 0 ];- };-- // force json dataType- s.dataTypes[ 0 ] = "json";-- // Install callback- window[ callbackName ] = function() {- responseContainer = arguments;- };-- // Clean-up function (fires after converters)- jqXHR.always(function() {- // Restore preexisting value- window[ callbackName ] = overwritten;-- // Save back as free- if ( s[ callbackName ] ) {- // make sure that re-using the options doesn't screw things around- s.jsonpCallback = originalSettings.jsonpCallback;-- // save the callback name for future use- oldCallbacks.push( callbackName );- }-- // Call if it was a function and we have a response- if ( responseContainer && jQuery.isFunction( overwritten ) ) {- overwritten( responseContainer[ 0 ] );- }-- responseContainer = overwritten = undefined;- });-- // Delegate to script- return "script";- }-});-// Install script dataType-jQuery.ajaxSetup({- accepts: {- script: "text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"- },- contents: {- script: /javascript|ecmascript/- },- converters: {- "text script": function( text ) {- jQuery.globalEval( text );- return text;- }- }-});--// Handle cache's special case and global-jQuery.ajaxPrefilter( "script", function( s ) {- if ( s.cache === undefined ) {- s.cache = false;- }- if ( s.crossDomain ) {- s.type = "GET";- s.global = false;- }-});--// Bind script tag hack transport-jQuery.ajaxTransport( "script", function(s) {-- // This transport only deals with cross domain requests- if ( s.crossDomain ) {-- var script,- head = document.head || document.getElementsByTagName( "head" )[0] || document.documentElement;-- return {-- send: function( _, callback ) {-- script = document.createElement( "script" );-- script.async = "async";-- if ( s.scriptCharset ) {- script.charset = s.scriptCharset;- }-- script.src = s.url;-- // Attach handlers for all browsers- script.onload = script.onreadystatechange = function( _, isAbort ) {-- if ( isAbort || !script.readyState || /loaded|complete/.test( script.readyState ) ) {-- // Handle memory leak in IE- script.onload = script.onreadystatechange = null;-- // Remove the script- if ( head && script.parentNode ) {- head.removeChild( script );- }-- // Dereference the script- script = undefined;-- // Callback if not abort- if ( !isAbort ) {- callback( 200, "success" );- }- }- };- // Use insertBefore instead of appendChild to circumvent an IE6 bug.- // This arises when a base node is used (#2709 and #4378).- head.insertBefore( script, head.firstChild );- },-- abort: function() {- if ( script ) {- script.onload( 0, 1 );- }- }- };- }-});-var xhrCallbacks,- // #5280: Internet Explorer will keep connections alive if we don't abort on unload- xhrOnUnloadAbort = window.ActiveXObject ? function() {- // Abort all pending requests- for ( var key in xhrCallbacks ) {- xhrCallbacks[ key ]( 0, 1 );- }- } : false,- xhrId = 0;--// Functions to create xhrs-function createStandardXHR() {- try {- return new window.XMLHttpRequest();- } catch( e ) {}-}--function createActiveXHR() {- try {- return new window.ActiveXObject( "Microsoft.XMLHTTP" );- } catch( e ) {}-}--// Create the request object-// (This is still attached to ajaxSettings for backward compatibility)-jQuery.ajaxSettings.xhr = window.ActiveXObject ?- /* Microsoft failed to properly- * implement the XMLHttpRequest in IE7 (can't request local files),- * so we use the ActiveXObject when it is available- * Additionally XMLHttpRequest can be disabled in IE7/IE8 so- * we need a fallback.- */- function() {- return !this.isLocal && createStandardXHR() || createActiveXHR();- } :- // For all other browsers, use the standard XMLHttpRequest object- createStandardXHR;--// Determine support properties-(function( xhr ) {- jQuery.extend( jQuery.support, {- ajax: !!xhr,- cors: !!xhr && ( "withCredentials" in xhr )- });-})( jQuery.ajaxSettings.xhr() );--// Create transport if the browser can provide an xhr-if ( jQuery.support.ajax ) {-- jQuery.ajaxTransport(function( s ) {- // Cross domain only allowed if supported through XMLHttpRequest- if ( !s.crossDomain || jQuery.support.cors ) {-- var callback;-- return {- send: function( headers, complete ) {-- // Get a new xhr- var handle, i,- xhr = s.xhr();-- // Open the socket- // Passing null username, generates a login popup on Opera (#2865)- if ( s.username ) {- xhr.open( s.type, s.url, s.async, s.username, s.password );- } else {- xhr.open( s.type, s.url, s.async );- }-- // Apply custom fields if provided- if ( s.xhrFields ) {- for ( i in s.xhrFields ) {- xhr[ i ] = s.xhrFields[ i ];- }- }-- // Override mime type if needed- if ( s.mimeType && xhr.overrideMimeType ) {- xhr.overrideMimeType( s.mimeType );- }-- // X-Requested-With header- // For cross-domain requests, seeing as conditions for a preflight are- // akin to a jigsaw puzzle, we simply never set it to be sure.- // (it can always be set on a per-request basis or even using ajaxSetup)- // For same-domain requests, won't change header if already provided.- if ( !s.crossDomain && !headers["X-Requested-With"] ) {- headers[ "X-Requested-With" ] = "XMLHttpRequest";- }-- // Need an extra try/catch for cross domain requests in Firefox 3- try {- for ( i in headers ) {- xhr.setRequestHeader( i, headers[ i ] );- }- } catch( _ ) {}-- // Do send the request- // This may raise an exception which is actually- // handled in jQuery.ajax (so no try/catch here)- xhr.send( ( s.hasContent && s.data ) || null );-- // Listener- callback = function( _, isAbort ) {-- var status,- statusText,- responseHeaders,- responses,- xml;-- // Firefox throws exceptions when accessing properties- // of an xhr when a network error occurred- // http://helpful.knobs-dials.com/index.php/Component_returned_failure_code:_0x80040111_(NS_ERROR_NOT_AVAILABLE)- try {-- // Was never called and is aborted or complete- if ( callback && ( isAbort || xhr.readyState === 4 ) ) {-- // Only called once- callback = undefined;-- // Do not keep as active anymore- if ( handle ) {- xhr.onreadystatechange = jQuery.noop;- if ( xhrOnUnloadAbort ) {- delete xhrCallbacks[ handle ];- }- }-- // If it's an abort- if ( isAbort ) {- // Abort it manually if needed- if ( xhr.readyState !== 4 ) {- xhr.abort();- }- } else {- status = xhr.status;- responseHeaders = xhr.getAllResponseHeaders();- responses = {};- xml = xhr.responseXML;-- // Construct response list- if ( xml && xml.documentElement /* #4958 */ ) {- responses.xml = xml;- }-- // When requesting binary data, IE6-9 will throw an exception- // on any attempt to access responseText (#11426)- try {- responses.text = xhr.responseText;- } catch( _ ) {- }-- // Firefox throws an exception when accessing- // statusText for faulty cross-domain requests- try {- statusText = xhr.statusText;- } catch( e ) {- // We normalize with Webkit giving an empty statusText- statusText = "";- }-- // Filter status for non standard behaviors-- // If the request is local and we have data: assume a success- // (success with no data won't get notified, that's the best we- // can do given current implementations)- if ( !status && s.isLocal && !s.crossDomain ) {- status = responses.text ? 200 : 404;- // IE - #1450: sometimes returns 1223 when it should be 204- } else if ( status === 1223 ) {- status = 204;- }- }- }- } catch( firefoxAccessException ) {- if ( !isAbort ) {- complete( -1, firefoxAccessException );- }- }-- // Call complete if needed- if ( responses ) {- complete( status, statusText, responses, responseHeaders );- }- };-- if ( !s.async ) {- // if we're in sync mode we fire the callback- callback();- } else if ( xhr.readyState === 4 ) {- // (IE6 & IE7) if it's in cache and has been- // retrieved directly we need to fire the callback- setTimeout( callback, 0 );- } else {- handle = ++xhrId;- if ( xhrOnUnloadAbort ) {- // Create the active xhrs callbacks list if needed- // and attach the unload handler- if ( !xhrCallbacks ) {- xhrCallbacks = {};- jQuery( window ).unload( xhrOnUnloadAbort );- }- // Add to list of active xhrs callbacks- xhrCallbacks[ handle ] = callback;- }- xhr.onreadystatechange = callback;- }- },-- abort: function() {- if ( callback ) {- callback(0,1);- }- }- };- }- });-}-var fxNow, timerId,- rfxtypes = /^(?:toggle|show|hide)$/,- rfxnum = new RegExp( "^(?:([-+])=|)(" + core_pnum + ")([a-z%]*)$", "i" ),- rrun = /queueHooks$/,- animationPrefilters = [ defaultPrefilter ],- tweeners = {- "*": [function( prop, value ) {- var end, unit,- tween = this.createTween( prop, value ),- parts = rfxnum.exec( value ),- target = tween.cur(),- start = +target || 0,- scale = 1,- maxIterations = 20;-- if ( parts ) {- end = +parts[2];- unit = parts[3] || ( jQuery.cssNumber[ prop ] ? "" : "px" );-- // We need to compute starting value- if ( unit !== "px" && start ) {- // Iteratively approximate from a nonzero starting point- // Prefer the current property, because this process will be trivial if it uses the same units- // Fallback to end or a simple constant- start = jQuery.css( tween.elem, prop, true ) || end || 1;-- do {- // If previous iteration zeroed out, double until we get *something*- // Use a string for doubling factor so we don't accidentally see scale as unchanged below- scale = scale || ".5";-- // Adjust and apply- start = start / scale;- jQuery.style( tween.elem, prop, start + unit );-- // Update scale, tolerating zero or NaN from tween.cur()- // And breaking the loop if scale is unchanged or perfect, or if we've just had enough- } while ( scale !== (scale = tween.cur() / target) && scale !== 1 && --maxIterations );- }-- tween.unit = unit;- tween.start = start;- // If a +=/-= token was provided, we're doing a relative animation- tween.end = parts[1] ? start + ( parts[1] + 1 ) * end : end;- }- return tween;- }]- };--// Animations created synchronously will run synchronously-function createFxNow() {- setTimeout(function() {- fxNow = undefined;- }, 0 );- return ( fxNow = jQuery.now() );-}--function createTweens( animation, props ) {- jQuery.each( props, function( prop, value ) {- var collection = ( tweeners[ prop ] || [] ).concat( tweeners[ "*" ] ),- index = 0,- length = collection.length;- for ( ; index < length; index++ ) {- if ( collection[ index ].call( animation, prop, value ) ) {-- // we're done with this property- return;- }- }- });-}--function Animation( elem, properties, options ) {- var result,- index = 0,- tweenerIndex = 0,- length = animationPrefilters.length,- deferred = jQuery.Deferred().always( function() {- // don't match elem in the :animated selector- delete tick.elem;- }),- tick = function() {- var currentTime = fxNow || createFxNow(),- remaining = Math.max( 0, animation.startTime + animation.duration - currentTime ),- percent = 1 - ( remaining / animation.duration || 0 ),- index = 0,- length = animation.tweens.length;-- for ( ; index < length ; index++ ) {- animation.tweens[ index ].run( percent );- }-- deferred.notifyWith( elem, [ animation, percent, remaining ]);-- if ( percent < 1 && length ) {- return remaining;- } else {- deferred.resolveWith( elem, [ animation ] );- return false;- }- },- animation = deferred.promise({- elem: elem,- props: jQuery.extend( {}, properties ),- opts: jQuery.extend( true, { specialEasing: {} }, options ),- originalProperties: properties,- originalOptions: options,- startTime: fxNow || createFxNow(),- duration: options.duration,- tweens: [],- createTween: function( prop, end, easing ) {- var tween = jQuery.Tween( elem, animation.opts, prop, end,- animation.opts.specialEasing[ prop ] || animation.opts.easing );- animation.tweens.push( tween );- return tween;- },- stop: function( gotoEnd ) {- var index = 0,- // if we are going to the end, we want to run all the tweens- // otherwise we skip this part- length = gotoEnd ? animation.tweens.length : 0;-- for ( ; index < length ; index++ ) {- animation.tweens[ index ].run( 1 );- }-- // resolve when we played the last frame- // otherwise, reject- if ( gotoEnd ) {- deferred.resolveWith( elem, [ animation, gotoEnd ] );- } else {- deferred.rejectWith( elem, [ animation, gotoEnd ] );- }- return this;- }- }),- props = animation.props;-- propFilter( props, animation.opts.specialEasing );-- for ( ; index < length ; index++ ) {- result = animationPrefilters[ index ].call( animation, elem, props, animation.opts );- if ( result ) {- return result;- }- }-- createTweens( animation, props );-- if ( jQuery.isFunction( animation.opts.start ) ) {- animation.opts.start.call( elem, animation );- }-- jQuery.fx.timer(- jQuery.extend( tick, {- anim: animation,- queue: animation.opts.queue,- elem: elem- })- );-- // attach callbacks from options- return animation.progress( animation.opts.progress )- .done( animation.opts.done, animation.opts.complete )- .fail( animation.opts.fail )- .always( animation.opts.always );-}--function propFilter( props, specialEasing ) {- var index, name, easing, value, hooks;-- // camelCase, specialEasing and expand cssHook pass- for ( index in props ) {- name = jQuery.camelCase( index );- easing = specialEasing[ name ];- value = props[ index ];- if ( jQuery.isArray( value ) ) {- easing = value[ 1 ];- value = props[ index ] = value[ 0 ];- }-- if ( index !== name ) {- props[ name ] = value;- delete props[ index ];- }-- hooks = jQuery.cssHooks[ name ];- if ( hooks && "expand" in hooks ) {- value = hooks.expand( value );- delete props[ name ];-- // not quite $.extend, this wont overwrite keys already present.- // also - reusing 'index' from above because we have the correct "name"- for ( index in value ) {- if ( !( index in props ) ) {- props[ index ] = value[ index ];- specialEasing[ index ] = easing;- }- }- } else {- specialEasing[ name ] = easing;- }- }-}--jQuery.Animation = jQuery.extend( Animation, {-- tweener: function( props, callback ) {- if ( jQuery.isFunction( props ) ) {- callback = props;- props = [ "*" ];- } else {- props = props.split(" ");- }-- var prop,- index = 0,- length = props.length;-- for ( ; index < length ; index++ ) {- prop = props[ index ];- tweeners[ prop ] = tweeners[ prop ] || [];- tweeners[ prop ].unshift( callback );- }- },-- prefilter: function( callback, prepend ) {- if ( prepend ) {- animationPrefilters.unshift( callback );- } else {- animationPrefilters.push( callback );- }- }-});--function defaultPrefilter( elem, props, opts ) {- var index, prop, value, length, dataShow, tween, hooks, oldfire,- anim = this,- style = elem.style,- orig = {},- handled = [],- hidden = elem.nodeType && isHidden( elem );-- // handle queue: false promises- if ( !opts.queue ) {- hooks = jQuery._queueHooks( elem, "fx" );- if ( hooks.unqueued == null ) {- hooks.unqueued = 0;- oldfire = hooks.empty.fire;- hooks.empty.fire = function() {- if ( !hooks.unqueued ) {- oldfire();- }- };- }- hooks.unqueued++;-- anim.always(function() {- // doing this makes sure that the complete handler will be called- // before this completes- anim.always(function() {- hooks.unqueued--;- if ( !jQuery.queue( elem, "fx" ).length ) {- hooks.empty.fire();- }- });- });- }-- // height/width overflow pass- if ( elem.nodeType === 1 && ( "height" in props || "width" in props ) ) {- // Make sure that nothing sneaks out- // Record all 3 overflow attributes because IE does not- // change the overflow attribute when overflowX and- // overflowY are set to the same value- opts.overflow = [ style.overflow, style.overflowX, style.overflowY ];-- // Set display property to inline-block for height/width- // animations on inline elements that are having width/height animated- if ( jQuery.css( elem, "display" ) === "inline" &&- jQuery.css( elem, "float" ) === "none" ) {-- // inline-level elements accept inline-block;- // block-level elements need to be inline with layout- if ( !jQuery.support.inlineBlockNeedsLayout || css_defaultDisplay( elem.nodeName ) === "inline" ) {- style.display = "inline-block";-- } else {- style.zoom = 1;- }- }- }-- if ( opts.overflow ) {- style.overflow = "hidden";- if ( !jQuery.support.shrinkWrapBlocks ) {- anim.done(function() {- style.overflow = opts.overflow[ 0 ];- style.overflowX = opts.overflow[ 1 ];- style.overflowY = opts.overflow[ 2 ];- });- }- }--- // show/hide pass- for ( index in props ) {- value = props[ index ];- if ( rfxtypes.exec( value ) ) {- delete props[ index ];- if ( value === ( hidden ? "hide" : "show" ) ) {- continue;- }- handled.push( index );- }- }-- length = handled.length;- if ( length ) {- dataShow = jQuery._data( elem, "fxshow" ) || jQuery._data( elem, "fxshow", {} );- if ( hidden ) {- jQuery( elem ).show();- } else {- anim.done(function() {- jQuery( elem ).hide();- });- }- anim.done(function() {- var prop;- jQuery.removeData( elem, "fxshow", true );- for ( prop in orig ) {- jQuery.style( elem, prop, orig[ prop ] );- }- });- for ( index = 0 ; index < length ; index++ ) {- prop = handled[ index ];- tween = anim.createTween( prop, hidden ? dataShow[ prop ] : 0 );- orig[ prop ] = dataShow[ prop ] || jQuery.style( elem, prop );-- if ( !( prop in dataShow ) ) {- dataShow[ prop ] = tween.start;- if ( hidden ) {- tween.end = tween.start;- tween.start = prop === "width" || prop === "height" ? 1 : 0;- }- }- }- }-}--function Tween( elem, options, prop, end, easing ) {- return new Tween.prototype.init( elem, options, prop, end, easing );-}-jQuery.Tween = Tween;--Tween.prototype = {- constructor: Tween,- init: function( elem, options, prop, end, easing, unit ) {- this.elem = elem;- this.prop = prop;- this.easing = easing || "swing";- this.options = options;- this.start = this.now = this.cur();- this.end = end;- this.unit = unit || ( jQuery.cssNumber[ prop ] ? "" : "px" );- },- cur: function() {- var hooks = Tween.propHooks[ this.prop ];-- return hooks && hooks.get ?- hooks.get( this ) :- Tween.propHooks._default.get( this );- },- run: function( percent ) {- var eased,- hooks = Tween.propHooks[ this.prop ];-- if ( this.options.duration ) {- this.pos = eased = jQuery.easing[ this.easing ](- percent, this.options.duration * percent, 0, 1, this.options.duration- );- } else {- this.pos = eased = percent;- }- this.now = ( this.end - this.start ) * eased + this.start;-- if ( this.options.step ) {- this.options.step.call( this.elem, this.now, this );- }-- if ( hooks && hooks.set ) {- hooks.set( this );- } else {- Tween.propHooks._default.set( this );- }- return this;- }-};--Tween.prototype.init.prototype = Tween.prototype;--Tween.propHooks = {- _default: {- get: function( tween ) {- var result;-- if ( tween.elem[ tween.prop ] != null &&- (!tween.elem.style || tween.elem.style[ tween.prop ] == null) ) {- return tween.elem[ tween.prop ];- }-- // passing any value as a 4th parameter to .css will automatically- // attempt a parseFloat and fallback to a string if the parse fails- // so, simple values such as "10px" are parsed to Float.- // complex values such as "rotate(1rad)" are returned as is.- result = jQuery.css( tween.elem, tween.prop, false, "" );- // Empty strings, null, undefined and "auto" are converted to 0.- return !result || result === "auto" ? 0 : result;- },- set: function( tween ) {- // use step hook for back compat - use cssHook if its there - use .style if its- // available and use plain properties where available- if ( jQuery.fx.step[ tween.prop ] ) {- jQuery.fx.step[ tween.prop ]( tween );- } else if ( tween.elem.style && ( tween.elem.style[ jQuery.cssProps[ tween.prop ] ] != null || jQuery.cssHooks[ tween.prop ] ) ) {- jQuery.style( tween.elem, tween.prop, tween.now + tween.unit );- } else {- tween.elem[ tween.prop ] = tween.now;- }- }- }-};--// Remove in 2.0 - this supports IE8's panic based approach-// to setting things on disconnected nodes--Tween.propHooks.scrollTop = Tween.propHooks.scrollLeft = {- set: function( tween ) {- if ( tween.elem.nodeType && tween.elem.parentNode ) {- tween.elem[ tween.prop ] = tween.now;- }- }-};--jQuery.each([ "toggle", "show", "hide" ], function( i, name ) {- var cssFn = jQuery.fn[ name ];- jQuery.fn[ name ] = function( speed, easing, callback ) {- return speed == null || typeof speed === "boolean" ||- // special check for .toggle( handler, handler, ... )- ( !i && jQuery.isFunction( speed ) && jQuery.isFunction( easing ) ) ?- cssFn.apply( this, arguments ) :- this.animate( genFx( name, true ), speed, easing, callback );- };-});--jQuery.fn.extend({- fadeTo: function( speed, to, easing, callback ) {-- // show any hidden elements after setting opacity to 0- return this.filter( isHidden ).css( "opacity", 0 ).show()-- // animate to the value specified- .end().animate({ opacity: to }, speed, easing, callback );- },- animate: function( prop, speed, easing, callback ) {- var empty = jQuery.isEmptyObject( prop ),- optall = jQuery.speed( speed, easing, callback ),- doAnimation = function() {- // Operate on a copy of prop so per-property easing won't be lost- var anim = Animation( this, jQuery.extend( {}, prop ), optall );-- // Empty animations resolve immediately- if ( empty ) {- anim.stop( true );- }- };-- return empty || optall.queue === false ?- this.each( doAnimation ) :- this.queue( optall.queue, doAnimation );- },- stop: function( type, clearQueue, gotoEnd ) {- var stopQueue = function( hooks ) {- var stop = hooks.stop;- delete hooks.stop;- stop( gotoEnd );- };-- if ( typeof type !== "string" ) {- gotoEnd = clearQueue;- clearQueue = type;- type = undefined;- }- if ( clearQueue && type !== false ) {- this.queue( type || "fx", [] );- }-- return this.each(function() {- var dequeue = true,- index = type != null && type + "queueHooks",- timers = jQuery.timers,- data = jQuery._data( this );-- if ( index ) {- if ( data[ index ] && data[ index ].stop ) {- stopQueue( data[ index ] );- }- } else {- for ( index in data ) {- if ( data[ index ] && data[ index ].stop && rrun.test( index ) ) {- stopQueue( data[ index ] );- }- }- }-- for ( index = timers.length; index--; ) {- if ( timers[ index ].elem === this && (type == null || timers[ index ].queue === type) ) {- timers[ index ].anim.stop( gotoEnd );- dequeue = false;- timers.splice( index, 1 );- }- }-- // start the next in the queue if the last step wasn't forced- // timers currently will call their complete callbacks, which will dequeue- // but only if they were gotoEnd- if ( dequeue || !gotoEnd ) {- jQuery.dequeue( this, type );- }- });- }-});--// Generate parameters to create a standard animation-function genFx( type, includeWidth ) {- var which,- attrs = { height: type },- i = 0;-- // if we include width, step value is 1 to do all cssExpand values,- // if we don't include width, step value is 2 to skip over Left and Right- includeWidth = includeWidth? 1 : 0;- for( ; i < 4 ; i += 2 - includeWidth ) {- which = cssExpand[ i ];- attrs[ "margin" + which ] = attrs[ "padding" + which ] = type;- }-- if ( includeWidth ) {- attrs.opacity = attrs.width = type;- }-- return attrs;-}--// Generate shortcuts for custom animations-jQuery.each({- slideDown: genFx("show"),- slideUp: genFx("hide"),- slideToggle: genFx("toggle"),- fadeIn: { opacity: "show" },- fadeOut: { opacity: "hide" },- fadeToggle: { opacity: "toggle" }-}, function( name, props ) {- jQuery.fn[ name ] = function( speed, easing, callback ) {- return this.animate( props, speed, easing, callback );- };-});--jQuery.speed = function( speed, easing, fn ) {- var opt = speed && typeof speed === "object" ? jQuery.extend( {}, speed ) : {- complete: fn || !fn && easing ||- jQuery.isFunction( speed ) && speed,- duration: speed,- easing: fn && easing || easing && !jQuery.isFunction( easing ) && easing- };-- opt.duration = jQuery.fx.off ? 0 : typeof opt.duration === "number" ? opt.duration :- opt.duration in jQuery.fx.speeds ? jQuery.fx.speeds[ opt.duration ] : jQuery.fx.speeds._default;-- // normalize opt.queue - true/undefined/null -> "fx"- if ( opt.queue == null || opt.queue === true ) {- opt.queue = "fx";- }-- // Queueing- opt.old = opt.complete;-- opt.complete = function() {- if ( jQuery.isFunction( opt.old ) ) {- opt.old.call( this );- }-- if ( opt.queue ) {- jQuery.dequeue( this, opt.queue );- }- };-- return opt;-};--jQuery.easing = {- linear: function( p ) {- return p;- },- swing: function( p ) {- return 0.5 - Math.cos( p*Math.PI ) / 2;- }-};--jQuery.timers = [];-jQuery.fx = Tween.prototype.init;-jQuery.fx.tick = function() {- var timer,- timers = jQuery.timers,- i = 0;-- for ( ; i < timers.length; i++ ) {- timer = timers[ i ];- // Checks the timer has not already been removed- if ( !timer() && timers[ i ] === timer ) {- timers.splice( i--, 1 );- }- }-- if ( !timers.length ) {- jQuery.fx.stop();- }-};--jQuery.fx.timer = function( timer ) {- if ( timer() && jQuery.timers.push( timer ) && !timerId ) {- timerId = setInterval( jQuery.fx.tick, jQuery.fx.interval );- }-};--jQuery.fx.interval = 13;--jQuery.fx.stop = function() {- clearInterval( timerId );- timerId = null;-};--jQuery.fx.speeds = {- slow: 600,- fast: 200,- // Default speed- _default: 400-};--// Back Compat <1.8 extension point-jQuery.fx.step = {};--if ( jQuery.expr && jQuery.expr.filters ) {- jQuery.expr.filters.animated = function( elem ) {- return jQuery.grep(jQuery.timers, function( fn ) {- return elem === fn.elem;- }).length;- };-}-var rroot = /^(?:body|html)$/i;--jQuery.fn.offset = function( options ) {- if ( arguments.length ) {- return options === undefined ?- this :- this.each(function( i ) {- jQuery.offset.setOffset( this, options, i );- });- }-- var docElem, body, win, clientTop, clientLeft, scrollTop, scrollLeft,- box = { top: 0, left: 0 },- elem = this[ 0 ],- doc = elem && elem.ownerDocument;-- if ( !doc ) {- return;- }-- if ( (body = doc.body) === elem ) {- return jQuery.offset.bodyOffset( elem );- }-- docElem = doc.documentElement;-- // Make sure it's not a disconnected DOM node- if ( !jQuery.contains( docElem, elem ) ) {- return box;- }-- // If we don't have gBCR, just use 0,0 rather than error- // BlackBerry 5, iOS 3 (original iPhone)- if ( typeof elem.getBoundingClientRect !== "undefined" ) {- box = elem.getBoundingClientRect();- }- win = getWindow( doc );- clientTop = docElem.clientTop || body.clientTop || 0;- clientLeft = docElem.clientLeft || body.clientLeft || 0;- scrollTop = win.pageYOffset || docElem.scrollTop;- scrollLeft = win.pageXOffset || docElem.scrollLeft;- return {- top: box.top + scrollTop - clientTop,- left: box.left + scrollLeft - clientLeft- };-};--jQuery.offset = {-- bodyOffset: function( body ) {- var top = body.offsetTop,- left = body.offsetLeft;-- if ( jQuery.support.doesNotIncludeMarginInBodyOffset ) {- top += parseFloat( jQuery.css(body, "marginTop") ) || 0;- left += parseFloat( jQuery.css(body, "marginLeft") ) || 0;- }-- return { top: top, left: left };- },-- setOffset: function( elem, options, i ) {- var position = jQuery.css( elem, "position" );-- // set position first, in-case top/left are set even on static elem- if ( position === "static" ) {- elem.style.position = "relative";- }-- var curElem = jQuery( elem ),- curOffset = curElem.offset(),- curCSSTop = jQuery.css( elem, "top" ),- curCSSLeft = jQuery.css( elem, "left" ),- calculatePosition = ( position === "absolute" || position === "fixed" ) && jQuery.inArray("auto", [curCSSTop, curCSSLeft]) > -1,- props = {}, curPosition = {}, curTop, curLeft;-- // need to be able to calculate position if either top or left is auto and position is either absolute or fixed- if ( calculatePosition ) {- curPosition = curElem.position();- curTop = curPosition.top;- curLeft = curPosition.left;- } else {- curTop = parseFloat( curCSSTop ) || 0;- curLeft = parseFloat( curCSSLeft ) || 0;- }-- if ( jQuery.isFunction( options ) ) {- options = options.call( elem, i, curOffset );- }-- if ( options.top != null ) {- props.top = ( options.top - curOffset.top ) + curTop;- }- if ( options.left != null ) {- props.left = ( options.left - curOffset.left ) + curLeft;- }-- if ( "using" in options ) {- options.using.call( elem, props );- } else {- curElem.css( props );- }- }-};---jQuery.fn.extend({-- position: function() {- if ( !this[0] ) {- return;- }-- var elem = this[0],-- // Get *real* offsetParent- offsetParent = this.offsetParent(),-- // Get correct offsets- offset = this.offset(),- parentOffset = rroot.test(offsetParent[0].nodeName) ? { top: 0, left: 0 } : offsetParent.offset();-- // Subtract element margins- // note: when an element has margin: auto the offsetLeft and marginLeft- // are the same in Safari causing offset.left to incorrectly be 0- offset.top -= parseFloat( jQuery.css(elem, "marginTop") ) || 0;- offset.left -= parseFloat( jQuery.css(elem, "marginLeft") ) || 0;-- // Add offsetParent borders- parentOffset.top += parseFloat( jQuery.css(offsetParent[0], "borderTopWidth") ) || 0;- parentOffset.left += parseFloat( jQuery.css(offsetParent[0], "borderLeftWidth") ) || 0;-- // Subtract the two offsets- return {- top: offset.top - parentOffset.top,- left: offset.left - parentOffset.left- };- },-- offsetParent: function() {- return this.map(function() {- var offsetParent = this.offsetParent || document.body;- while ( offsetParent && (!rroot.test(offsetParent.nodeName) && jQuery.css(offsetParent, "position") === "static") ) {- offsetParent = offsetParent.offsetParent;- }- return offsetParent || document.body;- });- }-});---// Create scrollLeft and scrollTop methods-jQuery.each( {scrollLeft: "pageXOffset", scrollTop: "pageYOffset"}, function( method, prop ) {- var top = /Y/.test( prop );-- jQuery.fn[ method ] = function( val ) {- return jQuery.access( this, function( elem, method, val ) {- var win = getWindow( elem );-- if ( val === undefined ) {- return win ? (prop in win) ? win[ prop ] :- win.document.documentElement[ method ] :- elem[ method ];- }-- if ( win ) {- win.scrollTo(- !top ? val : jQuery( win ).scrollLeft(),- top ? val : jQuery( win ).scrollTop()- );-- } else {- elem[ method ] = val;- }- }, method, val, arguments.length, null );- };-});--function getWindow( elem ) {- return jQuery.isWindow( elem ) ?- elem :- elem.nodeType === 9 ?- elem.defaultView || elem.parentWindow :- false;-}-// Create innerHeight, innerWidth, height, width, outerHeight and outerWidth methods-jQuery.each( { Height: "height", Width: "width" }, function( name, type ) {- jQuery.each( { padding: "inner" + name, content: type, "": "outer" + name }, function( defaultExtra, funcName ) {- // margin is only for outerHeight, outerWidth- jQuery.fn[ funcName ] = function( margin, value ) {- var chainable = arguments.length && ( defaultExtra || typeof margin !== "boolean" ),- extra = defaultExtra || ( margin === true || value === true ? "margin" : "border" );-- return jQuery.access( this, function( elem, type, value ) {- var doc;-- if ( jQuery.isWindow( elem ) ) {- // As of 5/8/2012 this will yield incorrect results for Mobile Safari, but there- // isn't a whole lot we can do. See pull request at this URL for discussion:- // https://github.com/jquery/jquery/pull/764- return elem.document.documentElement[ "client" + name ];- }-- // Get document width or height- if ( elem.nodeType === 9 ) {- doc = elem.documentElement;-- // Either scroll[Width/Height] or offset[Width/Height] or client[Width/Height], whichever is greatest- // unfortunately, this causes bug #3838 in IE6/8 only, but there is currently no good, small way to fix it.- return Math.max(- elem.body[ "scroll" + name ], doc[ "scroll" + name ],- elem.body[ "offset" + name ], doc[ "offset" + name ],- doc[ "client" + name ]- );- }-- return value === undefined ?- // Get width or height on the element, requesting but not forcing parseFloat- jQuery.css( elem, type, value, extra ) :-- // Set width or height on the element- jQuery.style( elem, type, value, extra );- }, type, chainable ? margin : undefined, chainable, null );- };- });-});-// Expose jQuery to the global object-window.jQuery = window.$ = jQuery;--// Expose jQuery as an AMD module, but only for AMD loaders that-// understand the issues with loading multiple versions of jQuery-// in a page that all might call define(). The loader will indicate-// they have special allowances for multiple jQuery versions by-// specifying define.amd.jQuery = true. Register as a named module,-// since jQuery can be concatenated with other files that may use define,-// but not use a proper concatenation script that understands anonymous-// AMD modules. A named AMD is safest and most robust way to register.-// Lowercase jquery is used because AMD module names are derived from-// file names, and jQuery is normally delivered in a lowercase file name.-// Do this after creating the global so that if an AMD module wants to call-// noConflict to hide this version of jQuery, it will work.-if ( typeof define === "function" && define.amd && define.amd.jQuery ) {- define( "jquery", [], function () { return jQuery; } );-}--})( window );diff --git a/data/libs/jquery/jquery-1.8.3.min.js b/data/libs/jquery/jquery-1.8.3.min.jsnew file mode 100644index 000000000..388377952--- /dev/null+++ b/data/libs/jquery/jquery-1.8.3.min.js@@ -0,0 +1,2 @@+/*! jQuery v1.8.3 jquery.com | jquery.org/license */+(function(e,t){function _(e){var t=M[e]={};return v.each(e.split(y),function(e,n){t[n]=!0}),t}function H(e,n,r){if(r===t&&e.nodeType===1){var i="data-"+n.replace(P,"-$1").toLowerCase();r=e.getAttribute(i);if(typeof r=="string"){try{r=r==="true"?!0:r==="false"?!1:r==="null"?null:+r+""===r?+r:D.test(r)?v.parseJSON(r):r}catch(s){}v.data(e,n,r)}else r=t}return r}function B(e){var t;for(t in e){if(t==="data"&&v.isEmptyObject(e[t]))continue;if(t!=="toJSON")return!1}return!0}function et(){return!1}function tt(){return!0}function ut(e){return!e||!e.parentNode||e.parentNode.nodeType===11}function at(e,t){do e=e[t];while(e&&e.nodeType!==1);return e}function ft(e,t,n){t=t||0;if(v.isFunction(t))return v.grep(e,function(e,r){var i=!!t.call(e,r,e);return i===n});if(t.nodeType)return v.grep(e,function(e,r){return e===t===n});if(typeof t=="string"){var r=v.grep(e,function(e){return e.nodeType===1});if(it.test(t))return v.filter(t,r,!n);t=v.filter(t,r)}return v.grep(e,function(e,r){return v.inArray(e,t)>=0===n})}function lt(e){var t=ct.split("|"),n=e.createDocumentFragment();if(n.createElement)while(t.length)n.createElement(t.pop());return n}function Lt(e,t){return e.getElementsByTagName(t)[0]||e.appendChild(e.ownerDocument.createElement(t))}function At(e,t){if(t.nodeType!==1||!v.hasData(e))return;var n,r,i,s=v._data(e),o=v._data(t,s),u=s.events;if(u){delete o.handle,o.events={};for(n in u)for(r=0,i=u[n].length;r<i;r++)v.event.add(t,n,u[n][r])}o.data&&(o.data=v.extend({},o.data))}function Ot(e,t){var n;if(t.nodeType!==1)return;t.clearAttributes&&t.clearAttributes(),t.mergeAttributes&&t.mergeAttributes(e),n=t.nodeName.toLowerCase(),n==="object"?(t.parentNode&&(t.outerHTML=e.outerHTML),v.support.html5Clone&&e.innerHTML&&!v.trim(t.innerHTML)&&(t.innerHTML=e.innerHTML)):n==="input"&&Et.test(e.type)?(t.defaultChecked=t.checked=e.checked,t.value!==e.value&&(t.value=e.value)):n==="option"?t.selected=e.defaultSelected:n==="input"||n==="textarea"?t.defaultValue=e.defaultValue:n==="script"&&t.text!==e.text&&(t.text=e.text),t.removeAttribute(v.expando)}function Mt(e){return typeof e.getElementsByTagName!="undefined"?e.getElementsByTagName("*"):typeof e.querySelectorAll!="undefined"?e.querySelectorAll("*"):[]}function _t(e){Et.test(e.type)&&(e.defaultChecked=e.checked)}function Qt(e,t){if(t in e)return t;var n=t.charAt(0).toUpperCase()+t.slice(1),r=t,i=Jt.length;while(i--){t=Jt[i]+n;if(t in e)return t}return r}function Gt(e,t){return e=t||e,v.css(e,"display")==="none"||!v.contains(e.ownerDocument,e)}function Yt(e,t){var n,r,i=[],s=0,o=e.length;for(;s<o;s++){n=e[s];if(!n.style)continue;i[s]=v._data(n,"olddisplay"),t?(!i[s]&&n.style.display==="none"&&(n.style.display=""),n.style.display===""&&Gt(n)&&(i[s]=v._data(n,"olddisplay",nn(n.nodeName)))):(r=Dt(n,"display"),!i[s]&&r!=="none"&&v._data(n,"olddisplay",r))}for(s=0;s<o;s++){n=e[s];if(!n.style)continue;if(!t||n.style.display==="none"||n.style.display==="")n.style.display=t?i[s]||"":"none"}return e}function Zt(e,t,n){var r=Rt.exec(t);return r?Math.max(0,r[1]-(n||0))+(r[2]||"px"):t}function en(e,t,n,r){var i=n===(r?"border":"content")?4:t==="width"?1:0,s=0;for(;i<4;i+=2)n==="margin"&&(s+=v.css(e,n+$t[i],!0)),r?(n==="content"&&(s-=parseFloat(Dt(e,"padding"+$t[i]))||0),n!=="margin"&&(s-=parseFloat(Dt(e,"border"+$t[i]+"Width"))||0)):(s+=parseFloat(Dt(e,"padding"+$t[i]))||0,n!=="padding"&&(s+=parseFloat(Dt(e,"border"+$t[i]+"Width"))||0));return s}function tn(e,t,n){var r=t==="width"?e.offsetWidth:e.offsetHeight,i=!0,s=v.support.boxSizing&&v.css(e,"boxSizing")==="border-box";if(r<=0||r==null){r=Dt(e,t);if(r<0||r==null)r=e.style[t];if(Ut.test(r))return r;i=s&&(v.support.boxSizingReliable||r===e.style[t]),r=parseFloat(r)||0}return r+en(e,t,n||(s?"border":"content"),i)+"px"}function nn(e){if(Wt[e])return Wt[e];var t=v("<"+e+">").appendTo(i.body),n=t.css("display");t.remove();if(n==="none"||n===""){Pt=i.body.appendChild(Pt||v.extend(i.createElement("iframe"),{frameBorder:0,width:0,height:0}));if(!Ht||!Pt.createElement)Ht=(Pt.contentWindow||Pt.contentDocument).document,Ht.write("<!doctype html><html><body>"),Ht.close();t=Ht.body.appendChild(Ht.createElement(e)),n=Dt(t,"display"),i.body.removeChild(Pt)}return Wt[e]=n,n}function fn(e,t,n,r){var i;if(v.isArray(t))v.each(t,function(t,i){n||sn.test(e)?r(e,i):fn(e+"["+(typeof i=="object"?t:"")+"]",i,n,r)});else if(!n&&v.type(t)==="object")for(i in t)fn(e+"["+i+"]",t[i],n,r);else r(e,t)}function Cn(e){return function(t,n){typeof t!="string"&&(n=t,t="*");var r,i,s,o=t.toLowerCase().split(y),u=0,a=o.length;if(v.isFunction(n))for(;u<a;u++)r=o[u],s=/^\+/.test(r),s&&(r=r.substr(1)||"*"),i=e[r]=e[r]||[],i[s?"unshift":"push"](n)}}function kn(e,n,r,i,s,o){s=s||n.dataTypes[0],o=o||{},o[s]=!0;var u,a=e[s],f=0,l=a?a.length:0,c=e===Sn;for(;f<l&&(c||!u);f++)u=a[f](n,r,i),typeof u=="string"&&(!c||o[u]?u=t:(n.dataTypes.unshift(u),u=kn(e,n,r,i,u,o)));return(c||!u)&&!o["*"]&&(u=kn(e,n,r,i,"*",o)),u}function Ln(e,n){var r,i,s=v.ajaxSettings.flatOptions||{};for(r in n)n[r]!==t&&((s[r]?e:i||(i={}))[r]=n[r]);i&&v.extend(!0,e,i)}function An(e,n,r){var i,s,o,u,a=e.contents,f=e.dataTypes,l=e.responseFields;for(s in l)s in r&&(n[l[s]]=r[s]);while(f[0]==="*")f.shift(),i===t&&(i=e.mimeType||n.getResponseHeader("content-type"));if(i)for(s in a)if(a[s]&&a[s].test(i)){f.unshift(s);break}if(f[0]in r)o=f[0];else{for(s in r){if(!f[0]||e.converters[s+" "+f[0]]){o=s;break}u||(u=s)}o=o||u}if(o)return o!==f[0]&&f.unshift(o),r[o]}function On(e,t){var n,r,i,s,o=e.dataTypes.slice(),u=o[0],a={},f=0;e.dataFilter&&(t=e.dataFilter(t,e.dataType));if(o[1])for(n in e.converters)a[n.toLowerCase()]=e.converters[n];for(;i=o[++f];)if(i!=="*"){if(u!=="*"&&u!==i){n=a[u+" "+i]||a["* "+i];if(!n)for(r in a){s=r.split(" ");if(s[1]===i){n=a[u+" "+s[0]]||a["* "+s[0]];if(n){n===!0?n=a[r]:a[r]!==!0&&(i=s[0],o.splice(f--,0,i));break}}}if(n!==!0)if(n&&e["throws"])t=n(t);else try{t=n(t)}catch(l){return{state:"parsererror",error:n?l:"No conversion from "+u+" to "+i}}}u=i}return{state:"success",data:t}}function Fn(){try{return new e.XMLHttpRequest}catch(t){}}function In(){try{return new e.ActiveXObject("Microsoft.XMLHTTP")}catch(t){}}function $n(){return setTimeout(function(){qn=t},0),qn=v.now()}function Jn(e,t){v.each(t,function(t,n){var r=(Vn[t]||[]).concat(Vn["*"]),i=0,s=r.length;for(;i<s;i++)if(r[i].call(e,t,n))return})}function Kn(e,t,n){var r,i=0,s=0,o=Xn.length,u=v.Deferred().always(function(){delete a.elem}),a=function(){var t=qn||$n(),n=Math.max(0,f.startTime+f.duration-t),r=n/f.duration||0,i=1-r,s=0,o=f.tweens.length;for(;s<o;s++)f.tweens[s].run(i);return u.notifyWith(e,[f,i,n]),i<1&&o?n:(u.resolveWith(e,[f]),!1)},f=u.promise({elem:e,props:v.extend({},t),opts:v.extend(!0,{specialEasing:{}},n),originalProperties:t,originalOptions:n,startTime:qn||$n(),duration:n.duration,tweens:[],createTween:function(t,n,r){var i=v.Tween(e,f.opts,t,n,f.opts.specialEasing[t]||f.opts.easing);return f.tweens.push(i),i},stop:function(t){var n=0,r=t?f.tweens.length:0;for(;n<r;n++)f.tweens[n].run(1);return t?u.resolveWith(e,[f,t]):u.rejectWith(e,[f,t]),this}}),l=f.props;Qn(l,f.opts.specialEasing);for(;i<o;i++){r=Xn[i].call(f,e,l,f.opts);if(r)return r}return Jn(f,l),v.isFunction(f.opts.start)&&f.opts.start.call(e,f),v.fx.timer(v.extend(a,{anim:f,queue:f.opts.queue,elem:e})),f.progress(f.opts.progress).done(f.opts.done,f.opts.complete).fail(f.opts.fail).always(f.opts.always)}function Qn(e,t){var n,r,i,s,o;for(n in e){r=v.camelCase(n),i=t[r],s=e[n],v.isArray(s)&&(i=s[1],s=e[n]=s[0]),n!==r&&(e[r]=s,delete e[n]),o=v.cssHooks[r];if(o&&"expand"in o){s=o.expand(s),delete e[r];for(n in s)n in e||(e[n]=s[n],t[n]=i)}else t[r]=i}}function Gn(e,t,n){var r,i,s,o,u,a,f,l,c,h=this,p=e.style,d={},m=[],g=e.nodeType&&Gt(e);n.queue||(l=v._queueHooks(e,"fx"),l.unqueued==null&&(l.unqueued=0,c=l.empty.fire,l.empty.fire=function(){l.unqueued||c()}),l.unqueued++,h.always(function(){h.always(function(){l.unqueued--,v.queue(e,"fx").length||l.empty.fire()})})),e.nodeType===1&&("height"in t||"width"in t)&&(n.overflow=[p.overflow,p.overflowX,p.overflowY],v.css(e,"display")==="inline"&&v.css(e,"float")==="none"&&(!v.support.inlineBlockNeedsLayout||nn(e.nodeName)==="inline"?p.display="inline-block":p.zoom=1)),n.overflow&&(p.overflow="hidden",v.support.shrinkWrapBlocks||h.done(function(){p.overflow=n.overflow[0],p.overflowX=n.overflow[1],p.overflowY=n.overflow[2]}));for(r in t){s=t[r];if(Un.exec(s)){delete t[r],a=a||s==="toggle";if(s===(g?"hide":"show"))continue;m.push(r)}}o=m.length;if(o){u=v._data(e,"fxshow")||v._data(e,"fxshow",{}),"hidden"in u&&(g=u.hidden),a&&(u.hidden=!g),g?v(e).show():h.done(function(){v(e).hide()}),h.done(function(){var t;v.removeData(e,"fxshow",!0);for(t in d)v.style(e,t,d[t])});for(r=0;r<o;r++)i=m[r],f=h.createTween(i,g?u[i]:0),d[i]=u[i]||v.style(e,i),i in u||(u[i]=f.start,g&&(f.end=f.start,f.start=i==="width"||i==="height"?1:0))}}function Yn(e,t,n,r,i){return new Yn.prototype.init(e,t,n,r,i)}function Zn(e,t){var n,r={height:e},i=0;t=t?1:0;for(;i<4;i+=2-t)n=$t[i],r["margin"+n]=r["padding"+n]=e;return t&&(r.opacity=r.width=e),r}function tr(e){return v.isWindow(e)?e:e.nodeType===9?e.defaultView||e.parentWindow:!1}var n,r,i=e.document,s=e.location,o=e.navigator,u=e.jQuery,a=e.$,f=Array.prototype.push,l=Array.prototype.slice,c=Array.prototype.indexOf,h=Object.prototype.toString,p=Object.prototype.hasOwnProperty,d=String.prototype.trim,v=function(e,t){return new v.fn.init(e,t,n)},m=/[\-+]?(?:\d*\.|)\d+(?:[eE][\-+]?\d+|)/.source,g=/\S/,y=/\s+/,b=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,w=/^(?:[^#<]*(<[\w\W]+>)[^>]*$|#([\w\-]*)$)/,E=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,S=/^[\],:{}\s]*$/,x=/(?:^|:|,)(?:\s*\[)+/g,T=/\\(?:["\\\/bfnrt]|u[\da-fA-F]{4})/g,N=/"[^"\\\r\n]*"|true|false|null|-?(?:\d\d*\.|)\d+(?:[eE][\-+]?\d+|)/g,C=/^-ms-/,k=/-([\da-z])/gi,L=function(e,t){return(t+"").toUpperCase()},A=function(){i.addEventListener?(i.removeEventListener("DOMContentLoaded",A,!1),v.ready()):i.readyState==="complete"&&(i.detachEvent("onreadystatechange",A),v.ready())},O={};v.fn=v.prototype={constructor:v,init:function(e,n,r){var s,o,u,a;if(!e)return this;if(e.nodeType)return this.context=this[0]=e,this.length=1,this;if(typeof e=="string"){e.charAt(0)==="<"&&e.charAt(e.length-1)===">"&&e.length>=3?s=[null,e,null]:s=w.exec(e);if(s&&(s[1]||!n)){if(s[1])return n=n instanceof v?n[0]:n,a=n&&n.nodeType?n.ownerDocument||n:i,e=v.parseHTML(s[1],a,!0),E.test(s[1])&&v.isPlainObject(n)&&this.attr.call(e,n,!0),v.merge(this,e);o=i.getElementById(s[2]);if(o&&o.parentNode){if(o.id!==s[2])return r.find(e);this.length=1,this[0]=o}return this.context=i,this.selector=e,this}return!n||n.jquery?(n||r).find(e):this.constructor(n).find(e)}return v.isFunction(e)?r.ready(e):(e.selector!==t&&(this.selector=e.selector,this.context=e.context),v.makeArray(e,this))},selector:"",jquery:"1.8.3",length:0,size:function(){return this.length},toArray:function(){return l.call(this)},get:function(e){return e==null?this.toArray():e<0?this[this.length+e]:this[e]},pushStack:function(e,t,n){var r=v.merge(this.constructor(),e);return r.prevObject=this,r.context=this.context,t==="find"?r.selector=this.selector+(this.selector?" ":"")+n:t&&(r.selector=this.selector+"."+t+"("+n+")"),r},each:function(e,t){return v.each(this,e,t)},ready:function(e){return v.ready.promise().done(e),this},eq:function(e){return e=+e,e===-1?this.slice(e):this.slice(e,e+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},slice:function(){return this.pushStack(l.apply(this,arguments),"slice",l.call(arguments).join(","))},map:function(e){return this.pushStack(v.map(this,function(t,n){return e.call(t,n,t)}))},end:function(){return this.prevObject||this.constructor(null)},push:f,sort:[].sort,splice:[].splice},v.fn.init.prototype=v.fn,v.extend=v.fn.extend=function(){var e,n,r,i,s,o,u=arguments[0]||{},a=1,f=arguments.length,l=!1;typeof u=="boolean"&&(l=u,u=arguments[1]||{},a=2),typeof u!="object"&&!v.isFunction(u)&&(u={}),f===a&&(u=this,--a);for(;a<f;a++)if((e=arguments[a])!=null)for(n in e){r=u[n],i=e[n];if(u===i)continue;l&&i&&(v.isPlainObject(i)||(s=v.isArray(i)))?(s?(s=!1,o=r&&v.isArray(r)?r:[]):o=r&&v.isPlainObject(r)?r:{},u[n]=v.extend(l,o,i)):i!==t&&(u[n]=i)}return u},v.extend({noConflict:function(t){return e.$===v&&(e.$=a),t&&e.jQuery===v&&(e.jQuery=u),v},isReady:!1,readyWait:1,holdReady:function(e){e?v.readyWait++:v.ready(!0)},ready:function(e){if(e===!0?--v.readyWait:v.isReady)return;if(!i.body)return setTimeout(v.ready,1);v.isReady=!0;if(e!==!0&&--v.readyWait>0)return;r.resolveWith(i,[v]),v.fn.trigger&&v(i).trigger("ready").off("ready")},isFunction:function(e){return v.type(e)==="function"},isArray:Array.isArray||function(e){return v.type(e)==="array"},isWindow:function(e){return e!=null&&e==e.window},isNumeric:function(e){return!isNaN(parseFloat(e))&&isFinite(e)},type:function(e){return e==null?String(e):O[h.call(e)]||"object"},isPlainObject:function(e){if(!e||v.type(e)!=="object"||e.nodeType||v.isWindow(e))return!1;try{if(e.constructor&&!p.call(e,"constructor")&&!p.call(e.constructor.prototype,"isPrototypeOf"))return!1}catch(n){return!1}var r;for(r in e);return r===t||p.call(e,r)},isEmptyObject:function(e){var t;for(t in e)return!1;return!0},error:function(e){throw new Error(e)},parseHTML:function(e,t,n){var r;return!e||typeof e!="string"?null:(typeof t=="boolean"&&(n=t,t=0),t=t||i,(r=E.exec(e))?[t.createElement(r[1])]:(r=v.buildFragment([e],t,n?null:[]),v.merge([],(r.cacheable?v.clone(r.fragment):r.fragment).childNodes)))},parseJSON:function(t){if(!t||typeof t!="string")return null;t=v.trim(t);if(e.JSON&&e.JSON.parse)return e.JSON.parse(t);if(S.test(t.replace(T,"@").replace(N,"]").replace(x,"")))return(new Function("return "+t))();v.error("Invalid JSON: "+t)},parseXML:function(n){var r,i;if(!n||typeof n!="string")return null;try{e.DOMParser?(i=new DOMParser,r=i.parseFromString(n,"text/xml")):(r=new ActiveXObject("Microsoft.XMLDOM"),r.async="false",r.loadXML(n))}catch(s){r=t}return(!r||!r.documentElement||r.getElementsByTagName("parsererror").length)&&v.error("Invalid XML: "+n),r},noop:function(){},globalEval:function(t){t&&g.test(t)&&(e.execScript||function(t){e.eval.call(e,t)})(t)},camelCase:function(e){return e.replace(C,"ms-").replace(k,L)},nodeName:function(e,t){return e.nodeName&&e.nodeName.toLowerCase()===t.toLowerCase()},each:function(e,n,r){var i,s=0,o=e.length,u=o===t||v.isFunction(e);if(r){if(u){for(i in e)if(n.apply(e[i],r)===!1)break}else for(;s<o;)if(n.apply(e[s++],r)===!1)break}else if(u){for(i in e)if(n.call(e[i],i,e[i])===!1)break}else for(;s<o;)if(n.call(e[s],s,e[s++])===!1)break;return e},trim:d&&!d.call("\ufeff\u00a0")?function(e){return e==null?"":d.call(e)}:function(e){return e==null?"":(e+"").replace(b,"")},makeArray:function(e,t){var n,r=t||[];return e!=null&&(n=v.type(e),e.length==null||n==="string"||n==="function"||n==="regexp"||v.isWindow(e)?f.call(r,e):v.merge(r,e)),r},inArray:function(e,t,n){var r;if(t){if(c)return c.call(t,e,n);r=t.length,n=n?n<0?Math.max(0,r+n):n:0;for(;n<r;n++)if(n in t&&t[n]===e)return n}return-1},merge:function(e,n){var r=n.length,i=e.length,s=0;if(typeof r=="number")for(;s<r;s++)e[i++]=n[s];else while(n[s]!==t)e[i++]=n[s++];return e.length=i,e},grep:function(e,t,n){var r,i=[],s=0,o=e.length;n=!!n;for(;s<o;s++)r=!!t(e[s],s),n!==r&&i.push(e[s]);return i},map:function(e,n,r){var i,s,o=[],u=0,a=e.length,f=e instanceof v||a!==t&&typeof a=="number"&&(a>0&&e[0]&&e[a-1]||a===0||v.isArray(e));if(f)for(;u<a;u++)i=n(e[u],u,r),i!=null&&(o[o.length]=i);else for(s in e)i=n(e[s],s,r),i!=null&&(o[o.length]=i);return o.concat.apply([],o)},guid:1,proxy:function(e,n){var r,i,s;return typeof n=="string"&&(r=e[n],n=e,e=r),v.isFunction(e)?(i=l.call(arguments,2),s=function(){return e.apply(n,i.concat(l.call(arguments)))},s.guid=e.guid=e.guid||v.guid++,s):t},access:function(e,n,r,i,s,o,u){var a,f=r==null,l=0,c=e.length;if(r&&typeof r=="object"){for(l in r)v.access(e,n,l,r[l],1,o,i);s=1}else if(i!==t){a=u===t&&v.isFunction(i),f&&(a?(a=n,n=function(e,t,n){return a.call(v(e),n)}):(n.call(e,i),n=null));if(n)for(;l<c;l++)n(e[l],r,a?i.call(e[l],l,n(e[l],r)):i,u);s=1}return s?e:f?n.call(e):c?n(e[0],r):o},now:function(){return(new Date).getTime()}}),v.ready.promise=function(t){if(!r){r=v.Deferred();if(i.readyState==="complete")setTimeout(v.ready,1);else if(i.addEventListener)i.addEventListener("DOMContentLoaded",A,!1),e.addEventListener("load",v.ready,!1);else{i.attachEvent("onreadystatechange",A),e.attachEvent("onload",v.ready);var n=!1;try{n=e.frameElement==null&&i.documentElement}catch(s){}n&&n.doScroll&&function o(){if(!v.isReady){try{n.doScroll("left")}catch(e){return setTimeout(o,50)}v.ready()}}()}}return r.promise(t)},v.each("Boolean Number String Function Array Date RegExp Object".split(" "),function(e,t){O["[object "+t+"]"]=t.toLowerCase()}),n=v(i);var M={};v.Callbacks=function(e){e=typeof e=="string"?M[e]||_(e):v.extend({},e);var n,r,i,s,o,u,a=[],f=!e.once&&[],l=function(t){n=e.memory&&t,r=!0,u=s||0,s=0,o=a.length,i=!0;for(;a&&u<o;u++)if(a[u].apply(t[0],t[1])===!1&&e.stopOnFalse){n=!1;break}i=!1,a&&(f?f.length&&l(f.shift()):n?a=[]:c.disable())},c={add:function(){if(a){var t=a.length;(function r(t){v.each(t,function(t,n){var i=v.type(n);i==="function"?(!e.unique||!c.has(n))&&a.push(n):n&&n.length&&i!=="string"&&r(n)})})(arguments),i?o=a.length:n&&(s=t,l(n))}return this},remove:function(){return a&&v.each(arguments,function(e,t){var n;while((n=v.inArray(t,a,n))>-1)a.splice(n,1),i&&(n<=o&&o--,n<=u&&u--)}),this},has:function(e){return v.inArray(e,a)>-1},empty:function(){return a=[],this},disable:function(){return a=f=n=t,this},disabled:function(){return!a},lock:function(){return f=t,n||c.disable(),this},locked:function(){return!f},fireWith:function(e,t){return t=t||[],t=[e,t.slice?t.slice():t],a&&(!r||f)&&(i?f.push(t):l(t)),this},fire:function(){return c.fireWith(this,arguments),this},fired:function(){return!!r}};return c},v.extend({Deferred:function(e){var t=[["resolve","done",v.Callbacks("once memory"),"resolved"],["reject","fail",v.Callbacks("once memory"),"rejected"],["notify","progress",v.Callbacks("memory")]],n="pending",r={state:function(){return n},always:function(){return i.done(arguments).fail(arguments),this},then:function(){var e=arguments;return v.Deferred(function(n){v.each(t,function(t,r){var s=r[0],o=e[t];i[r[1]](v.isFunction(o)?function(){var e=o.apply(this,arguments);e&&v.isFunction(e.promise)?e.promise().done(n.resolve).fail(n.reject).progress(n.notify):n[s+"With"](this===i?n:this,[e])}:n[s])}),e=null}).promise()},promise:function(e){return e!=null?v.extend(e,r):r}},i={};return r.pipe=r.then,v.each(t,function(e,s){var o=s[2],u=s[3];r[s[1]]=o.add,u&&o.add(function(){n=u},t[e^1][2].disable,t[2][2].lock),i[s[0]]=o.fire,i[s[0]+"With"]=o.fireWith}),r.promise(i),e&&e.call(i,i),i},when:function(e){var t=0,n=l.call(arguments),r=n.length,i=r!==1||e&&v.isFunction(e.promise)?r:0,s=i===1?e:v.Deferred(),o=function(e,t,n){return function(r){t[e]=this,n[e]=arguments.length>1?l.call(arguments):r,n===u?s.notifyWith(t,n):--i||s.resolveWith(t,n)}},u,a,f;if(r>1){u=new Array(r),a=new Array(r),f=new Array(r);for(;t<r;t++)n[t]&&v.isFunction(n[t].promise)?n[t].promise().done(o(t,f,n)).fail(s.reject).progress(o(t,a,u)):--i}return i||s.resolveWith(f,n),s.promise()}}),v.support=function(){var t,n,r,s,o,u,a,f,l,c,h,p=i.createElement("div");p.setAttribute("className","t"),p.innerHTML=" <link/><table></table><a href='/a'>a</a><input type='checkbox'/>",n=p.getElementsByTagName("*"),r=p.getElementsByTagName("a")[0];if(!n||!r||!n.length)return{};s=i.createElement("select"),o=s.appendChild(i.createElement("option")),u=p.getElementsByTagName("input")[0],r.style.cssText="top:1px;float:left;opacity:.5",t={leadingWhitespace:p.firstChild.nodeType===3,tbody:!p.getElementsByTagName("tbody").length,htmlSerialize:!!p.getElementsByTagName("link").length,style:/top/.test(r.getAttribute("style")),hrefNormalized:r.getAttribute("href")==="/a",opacity:/^0.5/.test(r.style.opacity),cssFloat:!!r.style.cssFloat,checkOn:u.value==="on",optSelected:o.selected,getSetAttribute:p.className!=="t",enctype:!!i.createElement("form").enctype,html5Clone:i.createElement("nav").cloneNode(!0).outerHTML!=="<:nav></:nav>",boxModel:i.compatMode==="CSS1Compat",submitBubbles:!0,changeBubbles:!0,focusinBubbles:!1,deleteExpando:!0,noCloneEvent:!0,inlineBlockNeedsLayout:!1,shrinkWrapBlocks:!1,reliableMarginRight:!0,boxSizingReliable:!0,pixelPosition:!1},u.checked=!0,t.noCloneChecked=u.cloneNode(!0).checked,s.disabled=!0,t.optDisabled=!o.disabled;try{delete p.test}catch(d){t.deleteExpando=!1}!p.addEventListener&&p.attachEvent&&p.fireEvent&&(p.attachEvent("onclick",h=function(){t.noCloneEvent=!1}),p.cloneNode(!0).fireEvent("onclick"),p.detachEvent("onclick",h)),u=i.createElement("input"),u.value="t",u.setAttribute("type","radio"),t.radioValue=u.value==="t",u.setAttribute("checked","checked"),u.setAttribute("name","t"),p.appendChild(u),a=i.createDocumentFragment(),a.appendChild(p.lastChild),t.checkClone=a.cloneNode(!0).cloneNode(!0).lastChild.checked,t.appendChecked=u.checked,a.removeChild(u),a.appendChild(p);if(p.attachEvent)for(l in{submit:!0,change:!0,focusin:!0})f="on"+l,c=f in p,c||(p.setAttribute(f,"return;"),c=typeof p[f]=="function"),t[l+"Bubbles"]=c;return v(function(){var n,r,s,o,u="padding:0;margin:0;border:0;display:block;overflow:hidden;",a=i.getElementsByTagName("body")[0];if(!a)return;n=i.createElement("div"),n.style.cssText="visibility:hidden;border:0;width:0;height:0;position:static;top:0;margin-top:1px",a.insertBefore(n,a.firstChild),r=i.createElement("div"),n.appendChild(r),r.innerHTML="<table><tr><td></td><td>t</td></tr></table>",s=r.getElementsByTagName("td"),s[0].style.cssText="padding:0;margin:0;border:0;display:none",c=s[0].offsetHeight===0,s[0].style.display="",s[1].style.display="none",t.reliableHiddenOffsets=c&&s[0].offsetHeight===0,r.innerHTML="",r.style.cssText="box-sizing:border-box;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;padding:1px;border:1px;display:block;width:4px;margin-top:1%;position:absolute;top:1%;",t.boxSizing=r.offsetWidth===4,t.doesNotIncludeMarginInBodyOffset=a.offsetTop!==1,e.getComputedStyle&&(t.pixelPosition=(e.getComputedStyle(r,null)||{}).top!=="1%",t.boxSizingReliable=(e.getComputedStyle(r,null)||{width:"4px"}).width==="4px",o=i.createElement("div"),o.style.cssText=r.style.cssText=u,o.style.marginRight=o.style.width="0",r.style.width="1px",r.appendChild(o),t.reliableMarginRight=!parseFloat((e.getComputedStyle(o,null)||{}).marginRight)),typeof r.style.zoom!="undefined"&&(r.innerHTML="",r.style.cssText=u+"width:1px;padding:1px;display:inline;zoom:1",t.inlineBlockNeedsLayout=r.offsetWidth===3,r.style.display="block",r.style.overflow="visible",r.innerHTML="<div></div>",r.firstChild.style.width="5px",t.shrinkWrapBlocks=r.offsetWidth!==3,n.style.zoom=1),a.removeChild(n),n=r=s=o=null}),a.removeChild(p),n=r=s=o=u=a=p=null,t}();var D=/(?:\{[\s\S]*\}|\[[\s\S]*\])$/,P=/([A-Z])/g;v.extend({cache:{},deletedIds:[],uuid:0,expando:"jQuery"+(v.fn.jquery+Math.random()).replace(/\D/g,""),noData:{embed:!0,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",applet:!0},hasData:function(e){return e=e.nodeType?v.cache[e[v.expando]]:e[v.expando],!!e&&!B(e)},data:function(e,n,r,i){if(!v.acceptData(e))return;var s,o,u=v.expando,a=typeof n=="string",f=e.nodeType,l=f?v.cache:e,c=f?e[u]:e[u]&&u;if((!c||!l[c]||!i&&!l[c].data)&&a&&r===t)return;c||(f?e[u]=c=v.deletedIds.pop()||v.guid++:c=u),l[c]||(l[c]={},f||(l[c].toJSON=v.noop));if(typeof n=="object"||typeof n=="function")i?l[c]=v.extend(l[c],n):l[c].data=v.extend(l[c].data,n);return s=l[c],i||(s.data||(s.data={}),s=s.data),r!==t&&(s[v.camelCase(n)]=r),a?(o=s[n],o==null&&(o=s[v.camelCase(n)])):o=s,o},removeData:function(e,t,n){if(!v.acceptData(e))return;var r,i,s,o=e.nodeType,u=o?v.cache:e,a=o?e[v.expando]:v.expando;if(!u[a])return;if(t){r=n?u[a]:u[a].data;if(r){v.isArray(t)||(t in r?t=[t]:(t=v.camelCase(t),t in r?t=[t]:t=t.split(" ")));for(i=0,s=t.length;i<s;i++)delete r[t[i]];if(!(n?B:v.isEmptyObject)(r))return}}if(!n){delete u[a].data;if(!B(u[a]))return}o?v.cleanData([e],!0):v.support.deleteExpando||u!=u.window?delete u[a]:u[a]=null},_data:function(e,t,n){return v.data(e,t,n,!0)},acceptData:function(e){var t=e.nodeName&&v.noData[e.nodeName.toLowerCase()];return!t||t!==!0&&e.getAttribute("classid")===t}}),v.fn.extend({data:function(e,n){var r,i,s,o,u,a=this[0],f=0,l=null;if(e===t){if(this.length){l=v.data(a);if(a.nodeType===1&&!v._data(a,"parsedAttrs")){s=a.attributes;for(u=s.length;f<u;f++)o=s[f].name,o.indexOf("data-")||(o=v.camelCase(o.substring(5)),H(a,o,l[o]));v._data(a,"parsedAttrs",!0)}}return l}return typeof e=="object"?this.each(function(){v.data(this,e)}):(r=e.split(".",2),r[1]=r[1]?"."+r[1]:"",i=r[1]+"!",v.access(this,function(n){if(n===t)return l=this.triggerHandler("getData"+i,[r[0]]),l===t&&a&&(l=v.data(a,e),l=H(a,e,l)),l===t&&r[1]?this.data(r[0]):l;r[1]=n,this.each(function(){var t=v(this);t.triggerHandler("setData"+i,r),v.data(this,e,n),t.triggerHandler("changeData"+i,r)})},null,n,arguments.length>1,null,!1))},removeData:function(e){return this.each(function(){v.removeData(this,e)})}}),v.extend({queue:function(e,t,n){var r;if(e)return t=(t||"fx")+"queue",r=v._data(e,t),n&&(!r||v.isArray(n)?r=v._data(e,t,v.makeArray(n)):r.push(n)),r||[]},dequeue:function(e,t){t=t||"fx";var n=v.queue(e,t),r=n.length,i=n.shift(),s=v._queueHooks(e,t),o=function(){v.dequeue(e,t)};i==="inprogress"&&(i=n.shift(),r--),i&&(t==="fx"&&n.unshift("inprogress"),delete s.stop,i.call(e,o,s)),!r&&s&&s.empty.fire()},_queueHooks:function(e,t){var n=t+"queueHooks";return v._data(e,n)||v._data(e,n,{empty:v.Callbacks("once memory").add(function(){v.removeData(e,t+"queue",!0),v.removeData(e,n,!0)})})}}),v.fn.extend({queue:function(e,n){var r=2;return typeof e!="string"&&(n=e,e="fx",r--),arguments.length<r?v.queue(this[0],e):n===t?this:this.each(function(){var t=v.queue(this,e,n);v._queueHooks(this,e),e==="fx"&&t[0]!=="inprogress"&&v.dequeue(this,e)})},dequeue:function(e){return this.each(function(){v.dequeue(this,e)})},delay:function(e,t){return e=v.fx?v.fx.speeds[e]||e:e,t=t||"fx",this.queue(t,function(t,n){var r=setTimeout(t,e);n.stop=function(){clearTimeout(r)}})},clearQueue:function(e){return this.queue(e||"fx",[])},promise:function(e,n){var r,i=1,s=v.Deferred(),o=this,u=this.length,a=function(){--i||s.resolveWith(o,[o])};typeof e!="string"&&(n=e,e=t),e=e||"fx";while(u--)r=v._data(o[u],e+"queueHooks"),r&&r.empty&&(i++,r.empty.add(a));return a(),s.promise(n)}});var j,F,I,q=/[\t\r\n]/g,R=/\r/g,U=/^(?:button|input)$/i,z=/^(?:button|input|object|select|textarea)$/i,W=/^a(?:rea|)$/i,X=/^(?:autofocus|autoplay|async|checked|controls|defer|disabled|hidden|loop|multiple|open|readonly|required|scoped|selected)$/i,V=v.support.getSetAttribute;v.fn.extend({attr:function(e,t){return v.access(this,v.attr,e,t,arguments.length>1)},removeAttr:function(e){return this.each(function(){v.removeAttr(this,e)})},prop:function(e,t){return v.access(this,v.prop,e,t,arguments.length>1)},removeProp:function(e){return e=v.propFix[e]||e,this.each(function(){try{this[e]=t,delete this[e]}catch(n){}})},addClass:function(e){var t,n,r,i,s,o,u;if(v.isFunction(e))return this.each(function(t){v(this).addClass(e.call(this,t,this.className))});if(e&&typeof e=="string"){t=e.split(y);for(n=0,r=this.length;n<r;n++){i=this[n];if(i.nodeType===1)if(!i.className&&t.length===1)i.className=e;else{s=" "+i.className+" ";for(o=0,u=t.length;o<u;o++)s.indexOf(" "+t[o]+" ")<0&&(s+=t[o]+" ");i.className=v.trim(s)}}}return this},removeClass:function(e){var n,r,i,s,o,u,a;if(v.isFunction(e))return this.each(function(t){v(this).removeClass(e.call(this,t,this.className))});if(e&&typeof e=="string"||e===t){n=(e||"").split(y);for(u=0,a=this.length;u<a;u++){i=this[u];if(i.nodeType===1&&i.className){r=(" "+i.className+" ").replace(q," ");for(s=0,o=n.length;s<o;s++)while(r.indexOf(" "+n[s]+" ")>=0)r=r.replace(" "+n[s]+" "," ");i.className=e?v.trim(r):""}}}return this},toggleClass:function(e,t){var n=typeof e,r=typeof t=="boolean";return v.isFunction(e)?this.each(function(n){v(this).toggleClass(e.call(this,n,this.className,t),t)}):this.each(function(){if(n==="string"){var i,s=0,o=v(this),u=t,a=e.split(y);while(i=a[s++])u=r?u:!o.hasClass(i),o[u?"addClass":"removeClass"](i)}else if(n==="undefined"||n==="boolean")this.className&&v._data(this,"__className__",this.className),this.className=this.className||e===!1?"":v._data(this,"__className__")||""})},hasClass:function(e){var t=" "+e+" ",n=0,r=this.length;for(;n<r;n++)if(this[n].nodeType===1&&(" "+this[n].className+" ").replace(q," ").indexOf(t)>=0)return!0;return!1},val:function(e){var n,r,i,s=this[0];if(!arguments.length){if(s)return n=v.valHooks[s.type]||v.valHooks[s.nodeName.toLowerCase()],n&&"get"in n&&(r=n.get(s,"value"))!==t?r:(r=s.value,typeof r=="string"?r.replace(R,""):r==null?"":r);return}return i=v.isFunction(e),this.each(function(r){var s,o=v(this);if(this.nodeType!==1)return;i?s=e.call(this,r,o.val()):s=e,s==null?s="":typeof s=="number"?s+="":v.isArray(s)&&(s=v.map(s,function(e){return e==null?"":e+""})),n=v.valHooks[this.type]||v.valHooks[this.nodeName.toLowerCase()];if(!n||!("set"in n)||n.set(this,s,"value")===t)this.value=s})}}),v.extend({valHooks:{option:{get:function(e){var t=e.attributes.value;return!t||t.specified?e.value:e.text}},select:{get:function(e){var t,n,r=e.options,i=e.selectedIndex,s=e.type==="select-one"||i<0,o=s?null:[],u=s?i+1:r.length,a=i<0?u:s?i:0;for(;a<u;a++){n=r[a];if((n.selected||a===i)&&(v.support.optDisabled?!n.disabled:n.getAttribute("disabled")===null)&&(!n.parentNode.disabled||!v.nodeName(n.parentNode,"optgroup"))){t=v(n).val();if(s)return t;o.push(t)}}return o},set:function(e,t){var n=v.makeArray(t);return v(e).find("option").each(function(){this.selected=v.inArray(v(this).val(),n)>=0}),n.length||(e.selectedIndex=-1),n}}},attrFn:{},attr:function(e,n,r,i){var s,o,u,a=e.nodeType;if(!e||a===3||a===8||a===2)return;if(i&&v.isFunction(v.fn[n]))return v(e)[n](r);if(typeof e.getAttribute=="undefined")return v.prop(e,n,r);u=a!==1||!v.isXMLDoc(e),u&&(n=n.toLowerCase(),o=v.attrHooks[n]||(X.test(n)?F:j));if(r!==t){if(r===null){v.removeAttr(e,n);return}return o&&"set"in o&&u&&(s=o.set(e,r,n))!==t?s:(e.setAttribute(n,r+""),r)}return o&&"get"in o&&u&&(s=o.get(e,n))!==null?s:(s=e.getAttribute(n),s===null?t:s)},removeAttr:function(e,t){var n,r,i,s,o=0;if(t&&e.nodeType===1){r=t.split(y);for(;o<r.length;o++)i=r[o],i&&(n=v.propFix[i]||i,s=X.test(i),s||v.attr(e,i,""),e.removeAttribute(V?i:n),s&&n in e&&(e[n]=!1))}},attrHooks:{type:{set:function(e,t){if(U.test(e.nodeName)&&e.parentNode)v.error("type property can't be changed");else if(!v.support.radioValue&&t==="radio"&&v.nodeName(e,"input")){var n=e.value;return e.setAttribute("type",t),n&&(e.value=n),t}}},value:{get:function(e,t){return j&&v.nodeName(e,"button")?j.get(e,t):t in e?e.value:null},set:function(e,t,n){if(j&&v.nodeName(e,"button"))return j.set(e,t,n);e.value=t}}},propFix:{tabindex:"tabIndex",readonly:"readOnly","for":"htmlFor","class":"className",maxlength:"maxLength",cellspacing:"cellSpacing",cellpadding:"cellPadding",rowspan:"rowSpan",colspan:"colSpan",usemap:"useMap",frameborder:"frameBorder",contenteditable:"contentEditable"},prop:function(e,n,r){var i,s,o,u=e.nodeType;if(!e||u===3||u===8||u===2)return;return o=u!==1||!v.isXMLDoc(e),o&&(n=v.propFix[n]||n,s=v.propHooks[n]),r!==t?s&&"set"in s&&(i=s.set(e,r,n))!==t?i:e[n]=r:s&&"get"in s&&(i=s.get(e,n))!==null?i:e[n]},propHooks:{tabIndex:{get:function(e){var n=e.getAttributeNode("tabindex");return n&&n.specified?parseInt(n.value,10):z.test(e.nodeName)||W.test(e.nodeName)&&e.href?0:t}}}}),F={get:function(e,n){var r,i=v.prop(e,n);return i===!0||typeof i!="boolean"&&(r=e.getAttributeNode(n))&&r.nodeValue!==!1?n.toLowerCase():t},set:function(e,t,n){var r;return t===!1?v.removeAttr(e,n):(r=v.propFix[n]||n,r in e&&(e[r]=!0),e.setAttribute(n,n.toLowerCase())),n}},V||(I={name:!0,id:!0,coords:!0},j=v.valHooks.button={get:function(e,n){var r;return r=e.getAttributeNode(n),r&&(I[n]?r.value!=="":r.specified)?r.value:t},set:function(e,t,n){var r=e.getAttributeNode(n);return r||(r=i.createAttribute(n),e.setAttributeNode(r)),r.value=t+""}},v.each(["width","height"],function(e,t){v.attrHooks[t]=v.extend(v.attrHooks[t],{set:function(e,n){if(n==="")return e.setAttribute(t,"auto"),n}})}),v.attrHooks.contenteditable={get:j.get,set:function(e,t,n){t===""&&(t="false"),j.set(e,t,n)}}),v.support.hrefNormalized||v.each(["href","src","width","height"],function(e,n){v.attrHooks[n]=v.extend(v.attrHooks[n],{get:function(e){var r=e.getAttribute(n,2);return r===null?t:r}})}),v.support.style||(v.attrHooks.style={get:function(e){return e.style.cssText.toLowerCase()||t},set:function(e,t){return e.style.cssText=t+""}}),v.support.optSelected||(v.propHooks.selected=v.extend(v.propHooks.selected,{get:function(e){var t=e.parentNode;return t&&(t.selectedIndex,t.parentNode&&t.parentNode.selectedIndex),null}})),v.support.enctype||(v.propFix.enctype="encoding"),v.support.checkOn||v.each(["radio","checkbox"],function(){v.valHooks[this]={get:function(e){return e.getAttribute("value")===null?"on":e.value}}}),v.each(["radio","checkbox"],function(){v.valHooks[this]=v.extend(v.valHooks[this],{set:function(e,t){if(v.isArray(t))return e.checked=v.inArray(v(e).val(),t)>=0}})});var $=/^(?:textarea|input|select)$/i,J=/^([^\.]*|)(?:\.(.+)|)$/,K=/(?:^|\s)hover(\.\S+|)\b/,Q=/^key/,G=/^(?:mouse|contextmenu)|click/,Y=/^(?:focusinfocus|focusoutblur)$/,Z=function(e){return v.event.special.hover?e:e.replace(K,"mouseenter$1 mouseleave$1")};v.event={add:function(e,n,r,i,s){var o,u,a,f,l,c,h,p,d,m,g;if(e.nodeType===3||e.nodeType===8||!n||!r||!(o=v._data(e)))return;r.handler&&(d=r,r=d.handler,s=d.selector),r.guid||(r.guid=v.guid++),a=o.events,a||(o.events=a={}),u=o.handle,u||(o.handle=u=function(e){return typeof v=="undefined"||!!e&&v.event.triggered===e.type?t:v.event.dispatch.apply(u.elem,arguments)},u.elem=e),n=v.trim(Z(n)).split(" ");for(f=0;f<n.length;f++){l=J.exec(n[f])||[],c=l[1],h=(l[2]||"").split(".").sort(),g=v.event.special[c]||{},c=(s?g.delegateType:g.bindType)||c,g=v.event.special[c]||{},p=v.extend({type:c,origType:l[1],data:i,handler:r,guid:r.guid,selector:s,needsContext:s&&v.expr.match.needsContext.test(s),namespace:h.join(".")},d),m=a[c];if(!m){m=a[c]=[],m.delegateCount=0;if(!g.setup||g.setup.call(e,i,h,u)===!1)e.addEventListener?e.addEventListener(c,u,!1):e.attachEvent&&e.attachEvent("on"+c,u)}g.add&&(g.add.call(e,p),p.handler.guid||(p.handler.guid=r.guid)),s?m.splice(m.delegateCount++,0,p):m.push(p),v.event.global[c]=!0}e=null},global:{},remove:function(e,t,n,r,i){var s,o,u,a,f,l,c,h,p,d,m,g=v.hasData(e)&&v._data(e);if(!g||!(h=g.events))return;t=v.trim(Z(t||"")).split(" ");for(s=0;s<t.length;s++){o=J.exec(t[s])||[],u=a=o[1],f=o[2];if(!u){for(u in h)v.event.remove(e,u+t[s],n,r,!0);continue}p=v.event.special[u]||{},u=(r?p.delegateType:p.bindType)||u,d=h[u]||[],l=d.length,f=f?new RegExp("(^|\\.)"+f.split(".").sort().join("\\.(?:.*\\.|)")+"(\\.|$)"):null;for(c=0;c<d.length;c++)m=d[c],(i||a===m.origType)&&(!n||n.guid===m.guid)&&(!f||f.test(m.namespace))&&(!r||r===m.selector||r==="**"&&m.selector)&&(d.splice(c--,1),m.selector&&d.delegateCount--,p.remove&&p.remove.call(e,m));d.length===0&&l!==d.length&&((!p.teardown||p.teardown.call(e,f,g.handle)===!1)&&v.removeEvent(e,u,g.handle),delete h[u])}v.isEmptyObject(h)&&(delete g.handle,v.removeData(e,"events",!0))},customEvent:{getData:!0,setData:!0,changeData:!0},trigger:function(n,r,s,o){if(!s||s.nodeType!==3&&s.nodeType!==8){var u,a,f,l,c,h,p,d,m,g,y=n.type||n,b=[];if(Y.test(y+v.event.triggered))return;y.indexOf("!")>=0&&(y=y.slice(0,-1),a=!0),y.indexOf(".")>=0&&(b=y.split("."),y=b.shift(),b.sort());if((!s||v.event.customEvent[y])&&!v.event.global[y])return;n=typeof n=="object"?n[v.expando]?n:new v.Event(y,n):new v.Event(y),n.type=y,n.isTrigger=!0,n.exclusive=a,n.namespace=b.join("."),n.namespace_re=n.namespace?new RegExp("(^|\\.)"+b.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,h=y.indexOf(":")<0?"on"+y:"";if(!s){u=v.cache;for(f in u)u[f].events&&u[f].events[y]&&v.event.trigger(n,r,u[f].handle.elem,!0);return}n.result=t,n.target||(n.target=s),r=r!=null?v.makeArray(r):[],r.unshift(n),p=v.event.special[y]||{};if(p.trigger&&p.trigger.apply(s,r)===!1)return;m=[[s,p.bindType||y]];if(!o&&!p.noBubble&&!v.isWindow(s)){g=p.delegateType||y,l=Y.test(g+y)?s:s.parentNode;for(c=s;l;l=l.parentNode)m.push([l,g]),c=l;c===(s.ownerDocument||i)&&m.push([c.defaultView||c.parentWindow||e,g])}for(f=0;f<m.length&&!n.isPropagationStopped();f++)l=m[f][0],n.type=m[f][1],d=(v._data(l,"events")||{})[n.type]&&v._data(l,"handle"),d&&d.apply(l,r),d=h&&l[h],d&&v.acceptData(l)&&d.apply&&d.apply(l,r)===!1&&n.preventDefault();return n.type=y,!o&&!n.isDefaultPrevented()&&(!p._default||p._default.apply(s.ownerDocument,r)===!1)&&(y!=="click"||!v.nodeName(s,"a"))&&v.acceptData(s)&&h&&s[y]&&(y!=="focus"&&y!=="blur"||n.target.offsetWidth!==0)&&!v.isWindow(s)&&(c=s[h],c&&(s[h]=null),v.event.triggered=y,s[y](),v.event.triggered=t,c&&(s[h]=c)),n.result}return},dispatch:function(n){n=v.event.fix(n||e.event);var r,i,s,o,u,a,f,c,h,p,d=(v._data(this,"events")||{})[n.type]||[],m=d.delegateCount,g=l.call(arguments),y=!n.exclusive&&!n.namespace,b=v.event.special[n.type]||{},w=[];g[0]=n,n.delegateTarget=this;if(b.preDispatch&&b.preDispatch.call(this,n)===!1)return;if(m&&(!n.button||n.type!=="click"))for(s=n.target;s!=this;s=s.parentNode||this)if(s.disabled!==!0||n.type!=="click"){u={},f=[];for(r=0;r<m;r++)c=d[r],h=c.selector,u[h]===t&&(u[h]=c.needsContext?v(h,this).index(s)>=0:v.find(h,this,null,[s]).length),u[h]&&f.push(c);f.length&&w.push({elem:s,matches:f})}d.length>m&&w.push({elem:this,matches:d.slice(m)});for(r=0;r<w.length&&!n.isPropagationStopped();r++){a=w[r],n.currentTarget=a.elem;for(i=0;i<a.matches.length&&!n.isImmediatePropagationStopped();i++){c=a.matches[i];if(y||!n.namespace&&!c.namespace||n.namespace_re&&n.namespace_re.test(c.namespace))n.data=c.data,n.handleObj=c,o=((v.event.special[c.origType]||{}).handle||c.handler).apply(a.elem,g),o!==t&&(n.result=o,o===!1&&(n.preventDefault(),n.stopPropagation()))}}return b.postDispatch&&b.postDispatch.call(this,n),n.result},props:"attrChange attrName relatedNode srcElement altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),fixHooks:{},keyHooks:{props:"char charCode key keyCode".split(" "),filter:function(e,t){return e.which==null&&(e.which=t.charCode!=null?t.charCode:t.keyCode),e}},mouseHooks:{props:"button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement".split(" "),filter:function(e,n){var r,s,o,u=n.button,a=n.fromElement;return e.pageX==null&&n.clientX!=null&&(r=e.target.ownerDocument||i,s=r.documentElement,o=r.body,e.pageX=n.clientX+(s&&s.scrollLeft||o&&o.scrollLeft||0)-(s&&s.clientLeft||o&&o.clientLeft||0),e.pageY=n.clientY+(s&&s.scrollTop||o&&o.scrollTop||0)-(s&&s.clientTop||o&&o.clientTop||0)),!e.relatedTarget&&a&&(e.relatedTarget=a===e.target?n.toElement:a),!e.which&&u!==t&&(e.which=u&1?1:u&2?3:u&4?2:0),e}},fix:function(e){if(e[v.expando])return e;var t,n,r=e,s=v.event.fixHooks[e.type]||{},o=s.props?this.props.concat(s.props):this.props;e=v.Event(r);for(t=o.length;t;)n=o[--t],e[n]=r[n];return e.target||(e.target=r.srcElement||i),e.target.nodeType===3&&(e.target=e.target.parentNode),e.metaKey=!!e.metaKey,s.filter?s.filter(e,r):e},special:{load:{noBubble:!0},focus:{delegateType:"focusin"},blur:{delegateType:"focusout"},beforeunload:{setup:function(e,t,n){v.isWindow(this)&&(this.onbeforeunload=n)},teardown:function(e,t){this.onbeforeunload===t&&(this.onbeforeunload=null)}}},simulate:function(e,t,n,r){var i=v.extend(new v.Event,n,{type:e,isSimulated:!0,originalEvent:{}});r?v.event.trigger(i,null,t):v.event.dispatch.call(t,i),i.isDefaultPrevented()&&n.preventDefault()}},v.event.handle=v.event.dispatch,v.removeEvent=i.removeEventListener?function(e,t,n){e.removeEventListener&&e.removeEventListener(t,n,!1)}:function(e,t,n){var r="on"+t;e.detachEvent&&(typeof e[r]=="undefined"&&(e[r]=null),e.detachEvent(r,n))},v.Event=function(e,t){if(!(this instanceof v.Event))return new v.Event(e,t);e&&e.type?(this.originalEvent=e,this.type=e.type,this.isDefaultPrevented=e.defaultPrevented||e.returnValue===!1||e.getPreventDefault&&e.getPreventDefault()?tt:et):this.type=e,t&&v.extend(this,t),this.timeStamp=e&&e.timeStamp||v.now(),this[v.expando]=!0},v.Event.prototype={preventDefault:function(){this.isDefaultPrevented=tt;var e=this.originalEvent;if(!e)return;e.preventDefault?e.preventDefault():e.returnValue=!1},stopPropagation:function(){this.isPropagationStopped=tt;var e=this.originalEvent;if(!e)return;e.stopPropagation&&e.stopPropagation(),e.cancelBubble=!0},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=tt,this.stopPropagation()},isDefaultPrevented:et,isPropagationStopped:et,isImmediatePropagationStopped:et},v.each({mouseenter:"mouseover",mouseleave:"mouseout"},function(e,t){v.event.special[e]={delegateType:t,bindType:t,handle:function(e){var n,r=this,i=e.relatedTarget,s=e.handleObj,o=s.selector;if(!i||i!==r&&!v.contains(r,i))e.type=s.origType,n=s.handler.apply(this,arguments),e.type=t;return n}}}),v.support.submitBubbles||(v.event.special.submit={setup:function(){if(v.nodeName(this,"form"))return!1;v.event.add(this,"click._submit keypress._submit",function(e){var n=e.target,r=v.nodeName(n,"input")||v.nodeName(n,"button")?n.form:t;r&&!v._data(r,"_submit_attached")&&(v.event.add(r,"submit._submit",function(e){e._submit_bubble=!0}),v._data(r,"_submit_attached",!0))})},postDispatch:function(e){e._submit_bubble&&(delete e._submit_bubble,this.parentNode&&!e.isTrigger&&v.event.simulate("submit",this.parentNode,e,!0))},teardown:function(){if(v.nodeName(this,"form"))return!1;v.event.remove(this,"._submit")}}),v.support.changeBubbles||(v.event.special.change={setup:function(){if($.test(this.nodeName)){if(this.type==="checkbox"||this.type==="radio")v.event.add(this,"propertychange._change",function(e){e.originalEvent.propertyName==="checked"&&(this._just_changed=!0)}),v.event.add(this,"click._change",function(e){this._just_changed&&!e.isTrigger&&(this._just_changed=!1),v.event.simulate("change",this,e,!0)});return!1}v.event.add(this,"beforeactivate._change",function(e){var t=e.target;$.test(t.nodeName)&&!v._data(t,"_change_attached")&&(v.event.add(t,"change._change",function(e){this.parentNode&&!e.isSimulated&&!e.isTrigger&&v.event.simulate("change",this.parentNode,e,!0)}),v._data(t,"_change_attached",!0))})},handle:function(e){var t=e.target;if(this!==t||e.isSimulated||e.isTrigger||t.type!=="radio"&&t.type!=="checkbox")return e.handleObj.handler.apply(this,arguments)},teardown:function(){return v.event.remove(this,"._change"),!$.test(this.nodeName)}}),v.support.focusinBubbles||v.each({focus:"focusin",blur:"focusout"},function(e,t){var n=0,r=function(e){v.event.simulate(t,e.target,v.event.fix(e),!0)};v.event.special[t]={setup:function(){n++===0&&i.addEventListener(e,r,!0)},teardown:function(){--n===0&&i.removeEventListener(e,r,!0)}}}),v.fn.extend({on:function(e,n,r,i,s){var o,u;if(typeof e=="object"){typeof n!="string"&&(r=r||n,n=t);for(u in e)this.on(u,n,r,e[u],s);return this}r==null&&i==null?(i=n,r=n=t):i==null&&(typeof n=="string"?(i=r,r=t):(i=r,r=n,n=t));if(i===!1)i=et;else if(!i)return this;return s===1&&(o=i,i=function(e){return v().off(e),o.apply(this,arguments)},i.guid=o.guid||(o.guid=v.guid++)),this.each(function(){v.event.add(this,e,i,r,n)})},one:function(e,t,n,r){return this.on(e,t,n,r,1)},off:function(e,n,r){var i,s;if(e&&e.preventDefault&&e.handleObj)return i=e.handleObj,v(e.delegateTarget).off(i.namespace?i.origType+"."+i.namespace:i.origType,i.selector,i.handler),this;if(typeof e=="object"){for(s in e)this.off(s,n,e[s]);return this}if(n===!1||typeof n=="function")r=n,n=t;return r===!1&&(r=et),this.each(function(){v.event.remove(this,e,r,n)})},bind:function(e,t,n){return this.on(e,null,t,n)},unbind:function(e,t){return this.off(e,null,t)},live:function(e,t,n){return v(this.context).on(e,this.selector,t,n),this},die:function(e,t){return v(this.context).off(e,this.selector||"**",t),this},delegate:function(e,t,n,r){return this.on(t,e,n,r)},undelegate:function(e,t,n){return arguments.length===1?this.off(e,"**"):this.off(t,e||"**",n)},trigger:function(e,t){return this.each(function(){v.event.trigger(e,t,this)})},triggerHandler:function(e,t){if(this[0])return v.event.trigger(e,t,this[0],!0)},toggle:function(e){var t=arguments,n=e.guid||v.guid++,r=0,i=function(n){var i=(v._data(this,"lastToggle"+e.guid)||0)%r;return v._data(this,"lastToggle"+e.guid,i+1),n.preventDefault(),t[i].apply(this,arguments)||!1};i.guid=n;while(r<t.length)t[r++].guid=n;return this.click(i)},hover:function(e,t){return this.mouseenter(e).mouseleave(t||e)}}),v.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(e,t){v.fn[t]=function(e,n){return n==null&&(n=e,e=null),arguments.length>0?this.on(t,null,e,n):this.trigger(t)},Q.test(t)&&(v.event.fixHooks[t]=v.event.keyHooks),G.test(t)&&(v.event.fixHooks[t]=v.event.mouseHooks)}),function(e,t){function nt(e,t,n,r){n=n||[],t=t||g;var i,s,a,f,l=t.nodeType;if(!e||typeof e!="string")return n;if(l!==1&&l!==9)return[];a=o(t);if(!a&&!r)if(i=R.exec(e))if(f=i[1]){if(l===9){s=t.getElementById(f);if(!s||!s.parentNode)return n;if(s.id===f)return n.push(s),n}else if(t.ownerDocument&&(s=t.ownerDocument.getElementById(f))&&u(t,s)&&s.id===f)return n.push(s),n}else{if(i[2])return S.apply(n,x.call(t.getElementsByTagName(e),0)),n;if((f=i[3])&&Z&&t.getElementsByClassName)return S.apply(n,x.call(t.getElementsByClassName(f),0)),n}return vt(e.replace(j,"$1"),t,n,r,a)}function rt(e){return function(t){var n=t.nodeName.toLowerCase();return n==="input"&&t.type===e}}function it(e){return function(t){var n=t.nodeName.toLowerCase();return(n==="input"||n==="button")&&t.type===e}}function st(e){return N(function(t){return t=+t,N(function(n,r){var i,s=e([],n.length,t),o=s.length;while(o--)n[i=s[o]]&&(n[i]=!(r[i]=n[i]))})})}function ot(e,t,n){if(e===t)return n;var r=e.nextSibling;while(r){if(r===t)return-1;r=r.nextSibling}return 1}function ut(e,t){var n,r,s,o,u,a,f,l=L[d][e+" "];if(l)return t?0:l.slice(0);u=e,a=[],f=i.preFilter;while(u){if(!n||(r=F.exec(u)))r&&(u=u.slice(r[0].length)||u),a.push(s=[]);n=!1;if(r=I.exec(u))s.push(n=new m(r.shift())),u=u.slice(n.length),n.type=r[0].replace(j," ");for(o in i.filter)(r=J[o].exec(u))&&(!f[o]||(r=f[o](r)))&&(s.push(n=new m(r.shift())),u=u.slice(n.length),n.type=o,n.matches=r);if(!n)break}return t?u.length:u?nt.error(e):L(e,a).slice(0)}function at(e,t,r){var i=t.dir,s=r&&t.dir==="parentNode",o=w++;return t.first?function(t,n,r){while(t=t[i])if(s||t.nodeType===1)return e(t,n,r)}:function(t,r,u){if(!u){var a,f=b+" "+o+" ",l=f+n;while(t=t[i])if(s||t.nodeType===1){if((a=t[d])===l)return t.sizset;if(typeof a=="string"&&a.indexOf(f)===0){if(t.sizset)return t}else{t[d]=l;if(e(t,r,u))return t.sizset=!0,t;t.sizset=!1}}}else while(t=t[i])if(s||t.nodeType===1)if(e(t,r,u))return t}}function ft(e){return e.length>1?function(t,n,r){var i=e.length;while(i--)if(!e[i](t,n,r))return!1;return!0}:e[0]}function lt(e,t,n,r,i){var s,o=[],u=0,a=e.length,f=t!=null;for(;u<a;u++)if(s=e[u])if(!n||n(s,r,i))o.push(s),f&&t.push(u);return o}function ct(e,t,n,r,i,s){return r&&!r[d]&&(r=ct(r)),i&&!i[d]&&(i=ct(i,s)),N(function(s,o,u,a){var f,l,c,h=[],p=[],d=o.length,v=s||dt(t||"*",u.nodeType?[u]:u,[]),m=e&&(s||!t)?lt(v,h,e,u,a):v,g=n?i||(s?e:d||r)?[]:o:m;n&&n(m,g,u,a);if(r){f=lt(g,p),r(f,[],u,a),l=f.length;while(l--)if(c=f[l])g[p[l]]=!(m[p[l]]=c)}if(s){if(i||e){if(i){f=[],l=g.length;while(l--)(c=g[l])&&f.push(m[l]=c);i(null,g=[],f,a)}l=g.length;while(l--)(c=g[l])&&(f=i?T.call(s,c):h[l])>-1&&(s[f]=!(o[f]=c))}}else g=lt(g===o?g.splice(d,g.length):g),i?i(null,o,g,a):S.apply(o,g)})}function ht(e){var t,n,r,s=e.length,o=i.relative[e[0].type],u=o||i.relative[" "],a=o?1:0,f=at(function(e){return e===t},u,!0),l=at(function(e){return T.call(t,e)>-1},u,!0),h=[function(e,n,r){return!o&&(r||n!==c)||((t=n).nodeType?f(e,n,r):l(e,n,r))}];for(;a<s;a++)if(n=i.relative[e[a].type])h=[at(ft(h),n)];else{n=i.filter[e[a].type].apply(null,e[a].matches);if(n[d]){r=++a;for(;r<s;r++)if(i.relative[e[r].type])break;return ct(a>1&&ft(h),a>1&&e.slice(0,a-1).join("").replace(j,"$1"),n,a<r&&ht(e.slice(a,r)),r<s&&ht(e=e.slice(r)),r<s&&e.join(""))}h.push(n)}return ft(h)}function pt(e,t){var r=t.length>0,s=e.length>0,o=function(u,a,f,l,h){var p,d,v,m=[],y=0,w="0",x=u&&[],T=h!=null,N=c,C=u||s&&i.find.TAG("*",h&&a.parentNode||a),k=b+=N==null?1:Math.E;T&&(c=a!==g&&a,n=o.el);for(;(p=C[w])!=null;w++){if(s&&p){for(d=0;v=e[d];d++)if(v(p,a,f)){l.push(p);break}T&&(b=k,n=++o.el)}r&&((p=!v&&p)&&y--,u&&x.push(p))}y+=w;if(r&&w!==y){for(d=0;v=t[d];d++)v(x,m,a,f);if(u){if(y>0)while(w--)!x[w]&&!m[w]&&(m[w]=E.call(l));m=lt(m)}S.apply(l,m),T&&!u&&m.length>0&&y+t.length>1&&nt.uniqueSort(l)}return T&&(b=k,c=N),x};return o.el=0,r?N(o):o}function dt(e,t,n){var r=0,i=t.length;for(;r<i;r++)nt(e,t[r],n);return n}function vt(e,t,n,r,s){var o,u,f,l,c,h=ut(e),p=h.length;if(!r&&h.length===1){u=h[0]=h[0].slice(0);if(u.length>2&&(f=u[0]).type==="ID"&&t.nodeType===9&&!s&&i.relative[u[1].type]){t=i.find.ID(f.matches[0].replace($,""),t,s)[0];if(!t)return n;e=e.slice(u.shift().length)}for(o=J.POS.test(e)?-1:u.length-1;o>=0;o--){f=u[o];if(i.relative[l=f.type])break;if(c=i.find[l])if(r=c(f.matches[0].replace($,""),z.test(u[0].type)&&t.parentNode||t,s)){u.splice(o,1),e=r.length&&u.join("");if(!e)return S.apply(n,x.call(r,0)),n;break}}}return a(e,h)(r,t,s,n,z.test(e)),n}function mt(){}var n,r,i,s,o,u,a,f,l,c,h=!0,p="undefined",d=("sizcache"+Math.random()).replace(".",""),m=String,g=e.document,y=g.documentElement,b=0,w=0,E=[].pop,S=[].push,x=[].slice,T=[].indexOf||function(e){var t=0,n=this.length;for(;t<n;t++)if(this[t]===e)return t;return-1},N=function(e,t){return e[d]=t==null||t,e},C=function(){var e={},t=[];return N(function(n,r){return t.push(n)>i.cacheLength&&delete e[t.shift()],e[n+" "]=r},e)},k=C(),L=C(),A=C(),O="[\\x20\\t\\r\\n\\f]",M="(?:\\\\.|[-\\w]|[^\\x00-\\xa0])+",_=M.replace("w","w#"),D="([*^$|!~]?=)",P="\\["+O+"*("+M+")"+O+"*(?:"+D+O+"*(?:(['\"])((?:\\\\.|[^\\\\])*?)\\3|("+_+")|)|)"+O+"*\\]",H=":("+M+")(?:\\((?:(['\"])((?:\\\\.|[^\\\\])*?)\\2|([^()[\\]]*|(?:(?:"+P+")|[^:]|\\\\.)*|.*))\\)|)",B=":(even|odd|eq|gt|lt|nth|first|last)(?:\\("+O+"*((?:-\\d)?\\d*)"+O+"*\\)|)(?=[^-]|$)",j=new RegExp("^"+O+"+|((?:^|[^\\\\])(?:\\\\.)*)"+O+"+$","g"),F=new RegExp("^"+O+"*,"+O+"*"),I=new RegExp("^"+O+"*([\\x20\\t\\r\\n\\f>+~])"+O+"*"),q=new RegExp(H),R=/^(?:#([\w\-]+)|(\w+)|\.([\w\-]+))$/,U=/^:not/,z=/[\x20\t\r\n\f]*[+~]/,W=/:not\($/,X=/h\d/i,V=/input|select|textarea|button/i,$=/\\(?!\\)/g,J={ID:new RegExp("^#("+M+")"),CLASS:new RegExp("^\\.("+M+")"),NAME:new RegExp("^\\[name=['\"]?("+M+")['\"]?\\]"),TAG:new RegExp("^("+M.replace("w","w*")+")"),ATTR:new RegExp("^"+P),PSEUDO:new RegExp("^"+H),POS:new RegExp(B,"i"),CHILD:new RegExp("^:(only|nth|first|last)-child(?:\\("+O+"*(even|odd|(([+-]|)(\\d*)n|)"+O+"*(?:([+-]|)"+O+"*(\\d+)|))"+O+"*\\)|)","i"),needsContext:new RegExp("^"+O+"*[>+~]|"+B,"i")},K=function(e){var t=g.createElement("div");try{return e(t)}catch(n){return!1}finally{t=null}},Q=K(function(e){return e.appendChild(g.createComment("")),!e.getElementsByTagName("*").length}),G=K(function(e){return e.innerHTML="<a href='#'></a>",e.firstChild&&typeof e.firstChild.getAttribute!==p&&e.firstChild.getAttribute("href")==="#"}),Y=K(function(e){e.innerHTML="<select></select>";var t=typeof e.lastChild.getAttribute("multiple");return t!=="boolean"&&t!=="string"}),Z=K(function(e){return e.innerHTML="<div class='hidden e'></div><div class='hidden'></div>",!e.getElementsByClassName||!e.getElementsByClassName("e").length?!1:(e.lastChild.className="e",e.getElementsByClassName("e").length===2)}),et=K(function(e){e.id=d+0,e.innerHTML="<a name='"+d+"'></a><div name='"+d+"'></div>",y.insertBefore(e,y.firstChild);var t=g.getElementsByName&&g.getElementsByName(d).length===2+g.getElementsByName(d+0).length;return r=!g.getElementById(d),y.removeChild(e),t});try{x.call(y.childNodes,0)[0].nodeType}catch(tt){x=function(e){var t,n=[];for(;t=this[e];e++)n.push(t);return n}}nt.matches=function(e,t){return nt(e,null,null,t)},nt.matchesSelector=function(e,t){return nt(t,null,null,[e]).length>0},s=nt.getText=function(e){var t,n="",r=0,i=e.nodeType;if(i){if(i===1||i===9||i===11){if(typeof e.textContent=="string")return e.textContent;for(e=e.firstChild;e;e=e.nextSibling)n+=s(e)}else if(i===3||i===4)return e.nodeValue}else for(;t=e[r];r++)n+=s(t);return n},o=nt.isXML=function(e){var t=e&&(e.ownerDocument||e).documentElement;return t?t.nodeName!=="HTML":!1},u=nt.contains=y.contains?function(e,t){var n=e.nodeType===9?e.documentElement:e,r=t&&t.parentNode;return e===r||!!(r&&r.nodeType===1&&n.contains&&n.contains(r))}:y.compareDocumentPosition?function(e,t){return t&&!!(e.compareDocumentPosition(t)&16)}:function(e,t){while(t=t.parentNode)if(t===e)return!0;return!1},nt.attr=function(e,t){var n,r=o(e);return r||(t=t.toLowerCase()),(n=i.attrHandle[t])?n(e):r||Y?e.getAttribute(t):(n=e.getAttributeNode(t),n?typeof e[t]=="boolean"?e[t]?t:null:n.specified?n.value:null:null)},i=nt.selectors={cacheLength:50,createPseudo:N,match:J,attrHandle:G?{}:{href:function(e){return e.getAttribute("href",2)},type:function(e){return e.getAttribute("type")}},find:{ID:r?function(e,t,n){if(typeof t.getElementById!==p&&!n){var r=t.getElementById(e);return r&&r.parentNode?[r]:[]}}:function(e,n,r){if(typeof n.getElementById!==p&&!r){var i=n.getElementById(e);return i?i.id===e||typeof i.getAttributeNode!==p&&i.getAttributeNode("id").value===e?[i]:t:[]}},TAG:Q?function(e,t){if(typeof t.getElementsByTagName!==p)return t.getElementsByTagName(e)}:function(e,t){var n=t.getElementsByTagName(e);if(e==="*"){var r,i=[],s=0;for(;r=n[s];s++)r.nodeType===1&&i.push(r);return i}return n},NAME:et&&function(e,t){if(typeof t.getElementsByName!==p)return t.getElementsByName(name)},CLASS:Z&&function(e,t,n){if(typeof t.getElementsByClassName!==p&&!n)return t.getElementsByClassName(e)}},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace($,""),e[3]=(e[4]||e[5]||"").replace($,""),e[2]==="~="&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),e[1]==="nth"?(e[2]||nt.error(e[0]),e[3]=+(e[3]?e[4]+(e[5]||1):2*(e[2]==="even"||e[2]==="odd")),e[4]=+(e[6]+e[7]||e[2]==="odd")):e[2]&&nt.error(e[0]),e},PSEUDO:function(e){var t,n;if(J.CHILD.test(e[0]))return null;if(e[3])e[2]=e[3];else if(t=e[4])q.test(t)&&(n=ut(t,!0))&&(n=t.indexOf(")",t.length-n)-t.length)&&(t=t.slice(0,n),e[0]=e[0].slice(0,n)),e[2]=t;return e.slice(0,3)}},filter:{ID:r?function(e){return e=e.replace($,""),function(t){return t.getAttribute("id")===e}}:function(e){return e=e.replace($,""),function(t){var n=typeof t.getAttributeNode!==p&&t.getAttributeNode("id");return n&&n.value===e}},TAG:function(e){return e==="*"?function(){return!0}:(e=e.replace($,"").toLowerCase(),function(t){return t.nodeName&&t.nodeName.toLowerCase()===e})},CLASS:function(e){var t=k[d][e+" "];return t||(t=new RegExp("(^|"+O+")"+e+"("+O+"|$)"))&&k(e,function(e){return t.test(e.className||typeof e.getAttribute!==p&&e.getAttribute("class")||"")})},ATTR:function(e,t,n){return function(r,i){var s=nt.attr(r,e);return s==null?t==="!=":t?(s+="",t==="="?s===n:t==="!="?s!==n:t==="^="?n&&s.indexOf(n)===0:t==="*="?n&&s.indexOf(n)>-1:t==="$="?n&&s.substr(s.length-n.length)===n:t==="~="?(" "+s+" ").indexOf(n)>-1:t==="|="?s===n||s.substr(0,n.length+1)===n+"-":!1):!0}},CHILD:function(e,t,n,r){return e==="nth"?function(e){var t,i,s=e.parentNode;if(n===1&&r===0)return!0;if(s){i=0;for(t=s.firstChild;t;t=t.nextSibling)if(t.nodeType===1){i++;if(e===t)break}}return i-=r,i===n||i%n===0&&i/n>=0}:function(t){var n=t;switch(e){case"only":case"first":while(n=n.previousSibling)if(n.nodeType===1)return!1;if(e==="first")return!0;n=t;case"last":while(n=n.nextSibling)if(n.nodeType===1)return!1;return!0}}},PSEUDO:function(e,t){var n,r=i.pseudos[e]||i.setFilters[e.toLowerCase()]||nt.error("unsupported pseudo: "+e);return r[d]?r(t):r.length>1?(n=[e,e,"",t],i.setFilters.hasOwnProperty(e.toLowerCase())?N(function(e,n){var i,s=r(e,t),o=s.length;while(o--)i=T.call(e,s[o]),e[i]=!(n[i]=s[o])}):function(e){return r(e,0,n)}):r}},pseudos:{not:N(function(e){var t=[],n=[],r=a(e.replace(j,"$1"));return r[d]?N(function(e,t,n,i){var s,o=r(e,null,i,[]),u=e.length;while(u--)if(s=o[u])e[u]=!(t[u]=s)}):function(e,i,s){return t[0]=e,r(t,null,s,n),!n.pop()}}),has:N(function(e){return function(t){return nt(e,t).length>0}}),contains:N(function(e){return function(t){return(t.textContent||t.innerText||s(t)).indexOf(e)>-1}}),enabled:function(e){return e.disabled===!1},disabled:function(e){return e.disabled===!0},checked:function(e){var t=e.nodeName.toLowerCase();return t==="input"&&!!e.checked||t==="option"&&!!e.selected},selected:function(e){return e.parentNode&&e.parentNode.selectedIndex,e.selected===!0},parent:function(e){return!i.pseudos.empty(e)},empty:function(e){var t;e=e.firstChild;while(e){if(e.nodeName>"@"||(t=e.nodeType)===3||t===4)return!1;e=e.nextSibling}return!0},header:function(e){return X.test(e.nodeName)},text:function(e){var t,n;return e.nodeName.toLowerCase()==="input"&&(t=e.type)==="text"&&((n=e.getAttribute("type"))==null||n.toLowerCase()===t)},radio:rt("radio"),checkbox:rt("checkbox"),file:rt("file"),password:rt("password"),image:rt("image"),submit:it("submit"),reset:it("reset"),button:function(e){var t=e.nodeName.toLowerCase();return t==="input"&&e.type==="button"||t==="button"},input:function(e){return V.test(e.nodeName)},focus:function(e){var t=e.ownerDocument;return e===t.activeElement&&(!t.hasFocus||t.hasFocus())&&!!(e.type||e.href||~e.tabIndex)},active:function(e){return e===e.ownerDocument.activeElement},first:st(function(){return[0]}),last:st(function(e,t){return[t-1]}),eq:st(function(e,t,n){return[n<0?n+t:n]}),even:st(function(e,t){for(var n=0;n<t;n+=2)e.push(n);return e}),odd:st(function(e,t){for(var n=1;n<t;n+=2)e.push(n);return e}),lt:st(function(e,t,n){for(var r=n<0?n+t:n;--r>=0;)e.push(r);return e}),gt:st(function(e,t,n){for(var r=n<0?n+t:n;++r<t;)e.push(r);return e})}},f=y.compareDocumentPosition?function(e,t){return e===t?(l=!0,0):(!e.compareDocumentPosition||!t.compareDocumentPosition?e.compareDocumentPosition:e.compareDocumentPosition(t)&4)?-1:1}:function(e,t){if(e===t)return l=!0,0;if(e.sourceIndex&&t.sourceIndex)return e.sourceIndex-t.sourceIndex;var n,r,i=[],s=[],o=e.parentNode,u=t.parentNode,a=o;if(o===u)return ot(e,t);if(!o)return-1;if(!u)return 1;while(a)i.unshift(a),a=a.parentNode;a=u;while(a)s.unshift(a),a=a.parentNode;n=i.length,r=s.length;for(var f=0;f<n&&f<r;f++)if(i[f]!==s[f])return ot(i[f],s[f]);return f===n?ot(e,s[f],-1):ot(i[f],t,1)},[0,0].sort(f),h=!l,nt.uniqueSort=function(e){var t,n=[],r=1,i=0;l=h,e.sort(f);if(l){for(;t=e[r];r++)t===e[r-1]&&(i=n.push(r));while(i--)e.splice(n[i],1)}return e},nt.error=function(e){throw new Error("Syntax error, unrecognized expression: "+e)},a=nt.compile=function(e,t){var n,r=[],i=[],s=A[d][e+" "];if(!s){t||(t=ut(e)),n=t.length;while(n--)s=ht(t[n]),s[d]?r.push(s):i.push(s);s=A(e,pt(i,r))}return s},g.querySelectorAll&&function(){var e,t=vt,n=/'|\\/g,r=/\=[\x20\t\r\n\f]*([^'"\]]*)[\x20\t\r\n\f]*\]/g,i=[":focus"],s=[":active"],u=y.matchesSelector||y.mozMatchesSelector||y.webkitMatchesSelector||y.oMatchesSelector||y.msMatchesSelector;K(function(e){e.innerHTML="<select><option selected=''></option></select>",e.querySelectorAll("[selected]").length||i.push("\\["+O+"*(?:checked|disabled|ismap|multiple|readonly|selected|value)"),e.querySelectorAll(":checked").length||i.push(":checked")}),K(function(e){e.innerHTML="<p test=''></p>",e.querySelectorAll("[test^='']").length&&i.push("[*^$]="+O+"*(?:\"\"|'')"),e.innerHTML="<input type='hidden'/>",e.querySelectorAll(":enabled").length||i.push(":enabled",":disabled")}),i=new RegExp(i.join("|")),vt=function(e,r,s,o,u){if(!o&&!u&&!i.test(e)){var a,f,l=!0,c=d,h=r,p=r.nodeType===9&&e;if(r.nodeType===1&&r.nodeName.toLowerCase()!=="object"){a=ut(e),(l=r.getAttribute("id"))?c=l.replace(n,"\\$&"):r.setAttribute("id",c),c="[id='"+c+"'] ",f=a.length;while(f--)a[f]=c+a[f].join("");h=z.test(e)&&r.parentNode||r,p=a.join(",")}if(p)try{return S.apply(s,x.call(h.querySelectorAll(p),0)),s}catch(v){}finally{l||r.removeAttribute("id")}}return t(e,r,s,o,u)},u&&(K(function(t){e=u.call(t,"div");try{u.call(t,"[test!='']:sizzle"),s.push("!=",H)}catch(n){}}),s=new RegExp(s.join("|")),nt.matchesSelector=function(t,n){n=n.replace(r,"='$1']");if(!o(t)&&!s.test(n)&&!i.test(n))try{var a=u.call(t,n);if(a||e||t.document&&t.document.nodeType!==11)return a}catch(f){}return nt(n,null,null,[t]).length>0})}(),i.pseudos.nth=i.pseudos.eq,i.filters=mt.prototype=i.pseudos,i.setFilters=new mt,nt.attr=v.attr,v.find=nt,v.expr=nt.selectors,v.expr[":"]=v.expr.pseudos,v.unique=nt.uniqueSort,v.text=nt.getText,v.isXMLDoc=nt.isXML,v.contains=nt.contains}(e);var nt=/Until$/,rt=/^(?:parents|prev(?:Until|All))/,it=/^.[^:#\[\.,]*$/,st=v.expr.match.needsContext,ot={children:!0,contents:!0,next:!0,prev:!0};v.fn.extend({find:function(e){var t,n,r,i,s,o,u=this;if(typeof e!="string")return v(e).filter(function(){for(t=0,n=u.length;t<n;t++)if(v.contains(u[t],this))return!0});o=this.pushStack("","find",e);for(t=0,n=this.length;t<n;t++){r=o.length,v.find(e,this[t],o);if(t>0)for(i=r;i<o.length;i++)for(s=0;s<r;s++)if(o[s]===o[i]){o.splice(i--,1);break}}return o},has:function(e){var t,n=v(e,this),r=n.length;return this.filter(function(){for(t=0;t<r;t++)if(v.contains(this,n[t]))return!0})},not:function(e){return this.pushStack(ft(this,e,!1),"not",e)},filter:function(e){return this.pushStack(ft(this,e,!0),"filter",e)},is:function(e){return!!e&&(typeof e=="string"?st.test(e)?v(e,this.context).index(this[0])>=0:v.filter(e,this).length>0:this.filter(e).length>0)},closest:function(e,t){var n,r=0,i=this.length,s=[],o=st.test(e)||typeof e!="string"?v(e,t||this.context):0;for(;r<i;r++){n=this[r];while(n&&n.ownerDocument&&n!==t&&n.nodeType!==11){if(o?o.index(n)>-1:v.find.matchesSelector(n,e)){s.push(n);break}n=n.parentNode}}return s=s.length>1?v.unique(s):s,this.pushStack(s,"closest",e)},index:function(e){return e?typeof e=="string"?v.inArray(this[0],v(e)):v.inArray(e.jquery?e[0]:e,this):this[0]&&this[0].parentNode?this.prevAll().length:-1},add:function(e,t){var n=typeof e=="string"?v(e,t):v.makeArray(e&&e.nodeType?[e]:e),r=v.merge(this.get(),n);return this.pushStack(ut(n[0])||ut(r[0])?r:v.unique(r))},addBack:function(e){return this.add(e==null?this.prevObject:this.prevObject.filter(e))}}),v.fn.andSelf=v.fn.addBack,v.each({parent:function(e){var t=e.parentNode;return t&&t.nodeType!==11?t:null},parents:function(e){return v.dir(e,"parentNode")},parentsUntil:function(e,t,n){return v.dir(e,"parentNode",n)},next:function(e){return at(e,"nextSibling")},prev:function(e){return at(e,"previousSibling")},nextAll:function(e){return v.dir(e,"nextSibling")},prevAll:function(e){return v.dir(e,"previousSibling")},nextUntil:function(e,t,n){return v.dir(e,"nextSibling",n)},prevUntil:function(e,t,n){return v.dir(e,"previousSibling",n)},siblings:function(e){return v.sibling((e.parentNode||{}).firstChild,e)},children:function(e){return v.sibling(e.firstChild)},contents:function(e){return v.nodeName(e,"iframe")?e.contentDocument||e.contentWindow.document:v.merge([],e.childNodes)}},function(e,t){v.fn[e]=function(n,r){var i=v.map(this,t,n);return nt.test(e)||(r=n),r&&typeof r=="string"&&(i=v.filter(r,i)),i=this.length>1&&!ot[e]?v.unique(i):i,this.length>1&&rt.test(e)&&(i=i.reverse()),this.pushStack(i,e,l.call(arguments).join(","))}}),v.extend({filter:function(e,t,n){return n&&(e=":not("+e+")"),t.length===1?v.find.matchesSelector(t[0],e)?[t[0]]:[]:v.find.matches(e,t)},dir:function(e,n,r){var i=[],s=e[n];while(s&&s.nodeType!==9&&(r===t||s.nodeType!==1||!v(s).is(r)))s.nodeType===1&&i.push(s),s=s[n];return i},sibling:function(e,t){var n=[];for(;e;e=e.nextSibling)e.nodeType===1&&e!==t&&n.push(e);return n}});var ct="abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",ht=/ jQuery\d+="(?:null|\d+)"/g,pt=/^\s+/,dt=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,vt=/<([\w:]+)/,mt=/<tbody/i,gt=/<|&#?\w+;/,yt=/<(?:script|style|link)/i,bt=/<(?:script|object|embed|option|style)/i,wt=new RegExp("<(?:"+ct+")[\\s/>]","i"),Et=/^(?:checkbox|radio)$/,St=/checked\s*(?:[^=]|=\s*.checked.)/i,xt=/\/(java|ecma)script/i,Tt=/^\s*<!(?:\[CDATA\[|\-\-)|[\]\-]{2}>\s*$/g,Nt={option:[1,"<select multiple='multiple'>","</select>"],legend:[1,"<fieldset>","</fieldset>"],thead:[1,"<table>","</table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],area:[1,"<map>","</map>"],_default:[0,"",""]},Ct=lt(i),kt=Ct.appendChild(i.createElement("div"));Nt.optgroup=Nt.option,Nt.tbody=Nt.tfoot=Nt.colgroup=Nt.caption=Nt.thead,Nt.th=Nt.td,v.support.htmlSerialize||(Nt._default=[1,"X<div>","</div>"]),v.fn.extend({text:function(e){return v.access(this,function(e){return e===t?v.text(this):this.empty().append((this[0]&&this[0].ownerDocument||i).createTextNode(e))},null,e,arguments.length)},wrapAll:function(e){if(v.isFunction(e))return this.each(function(t){v(this).wrapAll(e.call(this,t))});if(this[0]){var t=v(e,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&t.insertBefore(this[0]),t.map(function(){var e=this;while(e.firstChild&&e.firstChild.nodeType===1)e=e.firstChild;return e}).append(this)}return this},wrapInner:function(e){return v.isFunction(e)?this.each(function(t){v(this).wrapInner(e.call(this,t))}):this.each(function(){var t=v(this),n=t.contents();n.length?n.wrapAll(e):t.append(e)})},wrap:function(e){var t=v.isFunction(e);return this.each(function(n){v(this).wrapAll(t?e.call(this,n):e)})},unwrap:function(){return this.parent().each(function(){v.nodeName(this,"body")||v(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,!0,function(e){(this.nodeType===1||this.nodeType===11)&&this.appendChild(e)})},prepend:function(){return this.domManip(arguments,!0,function(e){(this.nodeType===1||this.nodeType===11)&&this.insertBefore(e,this.firstChild)})},before:function(){if(!ut(this[0]))return this.domManip(arguments,!1,function(e){this.parentNode.insertBefore(e,this)});if(arguments.length){var e=v.clean(arguments);return this.pushStack(v.merge(e,this),"before",this.selector)}},after:function(){if(!ut(this[0]))return this.domManip(arguments,!1,function(e){this.parentNode.insertBefore(e,this.nextSibling)});if(arguments.length){var e=v.clean(arguments);return this.pushStack(v.merge(this,e),"after",this.selector)}},remove:function(e,t){var n,r=0;for(;(n=this[r])!=null;r++)if(!e||v.filter(e,[n]).length)!t&&n.nodeType===1&&(v.cleanData(n.getElementsByTagName("*")),v.cleanData([n])),n.parentNode&&n.parentNode.removeChild(n);return this},empty:function(){var e,t=0;for(;(e=this[t])!=null;t++){e.nodeType===1&&v.cleanData(e.getElementsByTagName("*"));while(e.firstChild)e.removeChild(e.firstChild)}return this},clone:function(e,t){return e=e==null?!1:e,t=t==null?e:t,this.map(function(){return v.clone(this,e,t)})},html:function(e){return v.access(this,function(e){var n=this[0]||{},r=0,i=this.length;if(e===t)return n.nodeType===1?n.innerHTML.replace(ht,""):t;if(typeof e=="string"&&!yt.test(e)&&(v.support.htmlSerialize||!wt.test(e))&&(v.support.leadingWhitespace||!pt.test(e))&&!Nt[(vt.exec(e)||["",""])[1].toLowerCase()]){e=e.replace(dt,"<$1></$2>");try{for(;r<i;r++)n=this[r]||{},n.nodeType===1&&(v.cleanData(n.getElementsByTagName("*")),n.innerHTML=e);n=0}catch(s){}}n&&this.empty().append(e)},null,e,arguments.length)},replaceWith:function(e){return ut(this[0])?this.length?this.pushStack(v(v.isFunction(e)?e():e),"replaceWith",e):this:v.isFunction(e)?this.each(function(t){var n=v(this),r=n.html();n.replaceWith(e.call(this,t,r))}):(typeof e!="string"&&(e=v(e).detach()),this.each(function(){var t=this.nextSibling,n=this.parentNode;v(this).remove(),t?v(t).before(e):v(n).append(e)}))},detach:function(e){return this.remove(e,!0)},domManip:function(e,n,r){e=[].concat.apply([],e);var i,s,o,u,a=0,f=e[0],l=[],c=this.length;if(!v.support.checkClone&&c>1&&typeof f=="string"&&St.test(f))return this.each(function(){v(this).domManip(e,n,r)});if(v.isFunction(f))return this.each(function(i){var s=v(this);e[0]=f.call(this,i,n?s.html():t),s.domManip(e,n,r)});if(this[0]){i=v.buildFragment(e,this,l),o=i.fragment,s=o.firstChild,o.childNodes.length===1&&(o=s);if(s){n=n&&v.nodeName(s,"tr");for(u=i.cacheable||c-1;a<c;a++)r.call(n&&v.nodeName(this[a],"table")?Lt(this[a],"tbody"):this[a],a===u?o:v.clone(o,!0,!0))}o=s=null,l.length&&v.each(l,function(e,t){t.src?v.ajax?v.ajax({url:t.src,type:"GET",dataType:"script",async:!1,global:!1,"throws":!0}):v.error("no ajax"):v.globalEval((t.text||t.textContent||t.innerHTML||"").replace(Tt,"")),t.parentNode&&t.parentNode.removeChild(t)})}return this}}),v.buildFragment=function(e,n,r){var s,o,u,a=e[0];return n=n||i,n=!n.nodeType&&n[0]||n,n=n.ownerDocument||n,e.length===1&&typeof a=="string"&&a.length<512&&n===i&&a.charAt(0)==="<"&&!bt.test(a)&&(v.support.checkClone||!St.test(a))&&(v.support.html5Clone||!wt.test(a))&&(o=!0,s=v.fragments[a],u=s!==t),s||(s=n.createDocumentFragment(),v.clean(e,n,s,r),o&&(v.fragments[a]=u&&s)),{fragment:s,cacheable:o}},v.fragments={},v.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(e,t){v.fn[e]=function(n){var r,i=0,s=[],o=v(n),u=o.length,a=this.length===1&&this[0].parentNode;if((a==null||a&&a.nodeType===11&&a.childNodes.length===1)&&u===1)return o[t](this[0]),this;for(;i<u;i++)r=(i>0?this.clone(!0):this).get(),v(o[i])[t](r),s=s.concat(r);return this.pushStack(s,e,o.selector)}}),v.extend({clone:function(e,t,n){var r,i,s,o;v.support.html5Clone||v.isXMLDoc(e)||!wt.test("<"+e.nodeName+">")?o=e.cloneNode(!0):(kt.innerHTML=e.outerHTML,kt.removeChild(o=kt.firstChild));if((!v.support.noCloneEvent||!v.support.noCloneChecked)&&(e.nodeType===1||e.nodeType===11)&&!v.isXMLDoc(e)){Ot(e,o),r=Mt(e),i=Mt(o);for(s=0;r[s];++s)i[s]&&Ot(r[s],i[s])}if(t){At(e,o);if(n){r=Mt(e),i=Mt(o);for(s=0;r[s];++s)At(r[s],i[s])}}return r=i=null,o},clean:function(e,t,n,r){var s,o,u,a,f,l,c,h,p,d,m,g,y=t===i&&Ct,b=[];if(!t||typeof t.createDocumentFragment=="undefined")t=i;for(s=0;(u=e[s])!=null;s++){typeof u=="number"&&(u+="");if(!u)continue;if(typeof u=="string")if(!gt.test(u))u=t.createTextNode(u);else{y=y||lt(t),c=t.createElement("div"),y.appendChild(c),u=u.replace(dt,"<$1></$2>"),a=(vt.exec(u)||["",""])[1].toLowerCase(),f=Nt[a]||Nt._default,l=f[0],c.innerHTML=f[1]+u+f[2];while(l--)c=c.lastChild;if(!v.support.tbody){h=mt.test(u),p=a==="table"&&!h?c.firstChild&&c.firstChild.childNodes:f[1]==="<table>"&&!h?c.childNodes:[];for(o=p.length-1;o>=0;--o)v.nodeName(p[o],"tbody")&&!p[o].childNodes.length&&p[o].parentNode.removeChild(p[o])}!v.support.leadingWhitespace&&pt.test(u)&&c.insertBefore(t.createTextNode(pt.exec(u)[0]),c.firstChild),u=c.childNodes,c.parentNode.removeChild(c)}u.nodeType?b.push(u):v.merge(b,u)}c&&(u=c=y=null);if(!v.support.appendChecked)for(s=0;(u=b[s])!=null;s++)v.nodeName(u,"input")?_t(u):typeof u.getElementsByTagName!="undefined"&&v.grep(u.getElementsByTagName("input"),_t);if(n){m=function(e){if(!e.type||xt.test(e.type))return r?r.push(e.parentNode?e.parentNode.removeChild(e):e):n.appendChild(e)};for(s=0;(u=b[s])!=null;s++)if(!v.nodeName(u,"script")||!m(u))n.appendChild(u),typeof u.getElementsByTagName!="undefined"&&(g=v.grep(v.merge([],u.getElementsByTagName("script")),m),b.splice.apply(b,[s+1,0].concat(g)),s+=g.length)}return b},cleanData:function(e,t){var n,r,i,s,o=0,u=v.expando,a=v.cache,f=v.support.deleteExpando,l=v.event.special;for(;(i=e[o])!=null;o++)if(t||v.acceptData(i)){r=i[u],n=r&&a[r];if(n){if(n.events)for(s in n.events)l[s]?v.event.remove(i,s):v.removeEvent(i,s,n.handle);a[r]&&(delete a[r],f?delete i[u]:i.removeAttribute?i.removeAttribute(u):i[u]=null,v.deletedIds.push(r))}}}}),function(){var e,t;v.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)||e.indexOf("compatible")<0&&/(mozilla)(?:.*? rv:([\w.]+)|)/.exec(e)||[];return{browser:t[1]||"",version:t[2]||"0"}},e=v.uaMatch(o.userAgent),t={},e.browser&&(t[e.browser]=!0,t.version=e.version),t.chrome?t.webkit=!0:t.webkit&&(t.safari=!0),v.browser=t,v.sub=function(){function e(t,n){return new e.fn.init(t,n)}v.extend(!0,e,this),e.superclass=this,e.fn=e.prototype=this(),e.fn.constructor=e,e.sub=this.sub,e.fn.init=function(r,i){return i&&i instanceof v&&!(i instanceof e)&&(i=e(i)),v.fn.init.call(this,r,i,t)},e.fn.init.prototype=e.fn;var t=e(i);return e}}();var Dt,Pt,Ht,Bt=/alpha\([^)]*\)/i,jt=/opacity=([^)]*)/,Ft=/^(top|right|bottom|left)$/,It=/^(none|table(?!-c[ea]).+)/,qt=/^margin/,Rt=new RegExp("^("+m+")(.*)$","i"),Ut=new RegExp("^("+m+")(?!px)[a-z%]+$","i"),zt=new RegExp("^([-+])=("+m+")","i"),Wt={BODY:"block"},Xt={position:"absolute",visibility:"hidden",display:"block"},Vt={letterSpacing:0,fontWeight:400},$t=["Top","Right","Bottom","Left"],Jt=["Webkit","O","Moz","ms"],Kt=v.fn.toggle;v.fn.extend({css:function(e,n){return v.access(this,function(e,n,r){return r!==t?v.style(e,n,r):v.css(e,n)},e,n,arguments.length>1)},show:function(){return Yt(this,!0)},hide:function(){return Yt(this)},toggle:function(e,t){var n=typeof e=="boolean";return v.isFunction(e)&&v.isFunction(t)?Kt.apply(this,arguments):this.each(function(){(n?e:Gt(this))?v(this).show():v(this).hide()})}}),v.extend({cssHooks:{opacity:{get:function(e,t){if(t){var n=Dt(e,"opacity");return n===""?"1":n}}}},cssNumber:{fillOpacity:!0,fontWeight:!0,lineHeight:!0,opacity:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":v.support.cssFloat?"cssFloat":"styleFloat"},style:function(e,n,r,i){if(!e||e.nodeType===3||e.nodeType===8||!e.style)return;var s,o,u,a=v.camelCase(n),f=e.style;n=v.cssProps[a]||(v.cssProps[a]=Qt(f,a)),u=v.cssHooks[n]||v.cssHooks[a];if(r===t)return u&&"get"in u&&(s=u.get(e,!1,i))!==t?s:f[n];o=typeof r,o==="string"&&(s=zt.exec(r))&&(r=(s[1]+1)*s[2]+parseFloat(v.css(e,n)),o="number");if(r==null||o==="number"&&isNaN(r))return;o==="number"&&!v.cssNumber[a]&&(r+="px");if(!u||!("set"in u)||(r=u.set(e,r,i))!==t)try{f[n]=r}catch(l){}},css:function(e,n,r,i){var s,o,u,a=v.camelCase(n);return n=v.cssProps[a]||(v.cssProps[a]=Qt(e.style,a)),u=v.cssHooks[n]||v.cssHooks[a],u&&"get"in u&&(s=u.get(e,!0,i)),s===t&&(s=Dt(e,n)),s==="normal"&&n in Vt&&(s=Vt[n]),r||i!==t?(o=parseFloat(s),r||v.isNumeric(o)?o||0:s):s},swap:function(e,t,n){var r,i,s={};for(i in t)s[i]=e.style[i],e.style[i]=t[i];r=n.call(e);for(i in t)e.style[i]=s[i];return r}}),e.getComputedStyle?Dt=function(t,n){var r,i,s,o,u=e.getComputedStyle(t,null),a=t.style;return u&&(r=u.getPropertyValue(n)||u[n],r===""&&!v.contains(t.ownerDocument,t)&&(r=v.style(t,n)),Ut.test(r)&&qt.test(n)&&(i=a.width,s=a.minWidth,o=a.maxWidth,a.minWidth=a.maxWidth=a.width=r,r=u.width,a.width=i,a.minWidth=s,a.maxWidth=o)),r}:i.documentElement.currentStyle&&(Dt=function(e,t){var n,r,i=e.currentStyle&&e.currentStyle[t],s=e.style;return i==null&&s&&s[t]&&(i=s[t]),Ut.test(i)&&!Ft.test(t)&&(n=s.left,r=e.runtimeStyle&&e.runtimeStyle.left,r&&(e.runtimeStyle.left=e.currentStyle.left),s.left=t==="fontSize"?"1em":i,i=s.pixelLeft+"px",s.left=n,r&&(e.runtimeStyle.left=r)),i===""?"auto":i}),v.each(["height","width"],function(e,t){v.cssHooks[t]={get:function(e,n,r){if(n)return e.offsetWidth===0&&It.test(Dt(e,"display"))?v.swap(e,Xt,function(){return tn(e,t,r)}):tn(e,t,r)},set:function(e,n,r){return Zt(e,n,r?en(e,t,r,v.support.boxSizing&&v.css(e,"boxSizing")==="border-box"):0)}}}),v.support.opacity||(v.cssHooks.opacity={get:function(e,t){return jt.test((t&&e.currentStyle?e.currentStyle.filter:e.style.filter)||"")?.01*parseFloat(RegExp.$1)+"":t?"1":""},set:function(e,t){var n=e.style,r=e.currentStyle,i=v.isNumeric(t)?"alpha(opacity="+t*100+")":"",s=r&&r.filter||n.filter||"";n.zoom=1;if(t>=1&&v.trim(s.replace(Bt,""))===""&&n.removeAttribute){n.removeAttribute("filter");if(r&&!r.filter)return}n.filter=Bt.test(s)?s.replace(Bt,i):s+" "+i}}),v(function(){v.support.reliableMarginRight||(v.cssHooks.marginRight={get:function(e,t){return v.swap(e,{display:"inline-block"},function(){if(t)return Dt(e,"marginRight")})}}),!v.support.pixelPosition&&v.fn.position&&v.each(["top","left"],function(e,t){v.cssHooks[t]={get:function(e,n){if(n){var r=Dt(e,t);return Ut.test(r)?v(e).position()[t]+"px":r}}}})}),v.expr&&v.expr.filters&&(v.expr.filters.hidden=function(e){return e.offsetWidth===0&&e.offsetHeight===0||!v.support.reliableHiddenOffsets&&(e.style&&e.style.display||Dt(e,"display"))==="none"},v.expr.filters.visible=function(e){return!v.expr.filters.hidden(e)}),v.each({margin:"",padding:"",border:"Width"},function(e,t){v.cssHooks[e+t]={expand:function(n){var r,i=typeof n=="string"?n.split(" "):[n],s={};for(r=0;r<4;r++)s[e+$t[r]+t]=i[r]||i[r-2]||i[0];return s}},qt.test(e)||(v.cssHooks[e+t].set=Zt)});var rn=/%20/g,sn=/\[\]$/,on=/\r?\n/g,un=/^(?:color|date|datetime|datetime-local|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,an=/^(?:select|textarea)/i;v.fn.extend({serialize:function(){return v.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?v.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||an.test(this.nodeName)||un.test(this.type))}).map(function(e,t){var n=v(this).val();return n==null?null:v.isArray(n)?v.map(n,function(e,n){return{name:t.name,value:e.replace(on,"\r\n")}}):{name:t.name,value:n.replace(on,"\r\n")}}).get()}}),v.param=function(e,n){var r,i=[],s=function(e,t){t=v.isFunction(t)?t():t==null?"":t,i[i.length]=encodeURIComponent(e)+"="+encodeURIComponent(t)};n===t&&(n=v.ajaxSettings&&v.ajaxSettings.traditional);if(v.isArray(e)||e.jquery&&!v.isPlainObject(e))v.each(e,function(){s(this.name,this.value)});else for(r in e)fn(r,e[r],n,s);return i.join("&").replace(rn,"+")};var ln,cn,hn=/#.*$/,pn=/^(.*?):[ \t]*([^\r\n]*)\r?$/mg,dn=/^(?:about|app|app\-storage|.+\-extension|file|res|widget):$/,vn=/^(?:GET|HEAD)$/,mn=/^\/\//,gn=/\?/,yn=/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi,bn=/([?&])_=[^&]*/,wn=/^([\w\+\.\-]+:)(?:\/\/([^\/?#:]*)(?::(\d+)|)|)/,En=v.fn.load,Sn={},xn={},Tn=["*/"]+["*"];try{cn=s.href}catch(Nn){cn=i.createElement("a"),cn.href="",cn=cn.href}ln=wn.exec(cn.toLowerCase())||[],v.fn.load=function(e,n,r){if(typeof e!="string"&&En)return En.apply(this,arguments);if(!this.length)return this;var i,s,o,u=this,a=e.indexOf(" ");return a>=0&&(i=e.slice(a,e.length),e=e.slice(0,a)),v.isFunction(n)?(r=n,n=t):n&&typeof n=="object"&&(s="POST"),v.ajax({url:e,type:s,dataType:"html",data:n,complete:function(e,t){r&&u.each(r,o||[e.responseText,t,e])}}).done(function(e){o=arguments,u.html(i?v("<div>").append(e.replace(yn,"")).find(i):e)}),this},v.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),function(e,t){v.fn[t]=function(e){return this.on(t,e)}}),v.each(["get","post"],function(e,n){v[n]=function(e,r,i,s){return v.isFunction(r)&&(s=s||i,i=r,r=t),v.ajax({type:n,url:e,data:r,success:i,dataType:s})}}),v.extend({getScript:function(e,n){return v.get(e,t,n,"script")},getJSON:function(e,t,n){return v.get(e,t,n,"json")},ajaxSetup:function(e,t){return t?Ln(e,v.ajaxSettings):(t=e,e=v.ajaxSettings),Ln(e,t),e},ajaxSettings:{url:cn,isLocal:dn.test(ln[1]),global:!0,type:"GET",contentType:"application/x-www-form-urlencoded; charset=UTF-8",processData:!0,async:!0,accepts:{xml:"application/xml, text/xml",html:"text/html",text:"text/plain",json:"application/json, text/javascript","*":Tn},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText"},converters:{"* text":e.String,"text html":!0,"text json":v.parseJSON,"text xml":v.parseXML},flatOptions:{context:!0,url:!0}},ajaxPrefilter:Cn(Sn),ajaxTransport:Cn(xn),ajax:function(e,n){function T(e,n,s,a){var l,y,b,w,S,T=n;if(E===2)return;E=2,u&&clearTimeout(u),o=t,i=a||"",x.readyState=e>0?4:0,s&&(w=An(c,x,s));if(e>=200&&e<300||e===304)c.ifModified&&(S=x.getResponseHeader("Last-Modified"),S&&(v.lastModified[r]=S),S=x.getResponseHeader("Etag"),S&&(v.etag[r]=S)),e===304?(T="notmodified",l=!0):(l=On(c,w),T=l.state,y=l.data,b=l.error,l=!b);else{b=T;if(!T||e)T="error",e<0&&(e=0)}x.status=e,x.statusText=(n||T)+"",l?d.resolveWith(h,[y,T,x]):d.rejectWith(h,[x,T,b]),x.statusCode(g),g=t,f&&p.trigger("ajax"+(l?"Success":"Error"),[x,c,l?y:b]),m.fireWith(h,[x,T]),f&&(p.trigger("ajaxComplete",[x,c]),--v.active||v.event.trigger("ajaxStop"))}typeof e=="object"&&(n=e,e=t),n=n||{};var r,i,s,o,u,a,f,l,c=v.ajaxSetup({},n),h=c.context||c,p=h!==c&&(h.nodeType||h instanceof v)?v(h):v.event,d=v.Deferred(),m=v.Callbacks("once memory"),g=c.statusCode||{},b={},w={},E=0,S="canceled",x={readyState:0,setRequestHeader:function(e,t){if(!E){var n=e.toLowerCase();e=w[n]=w[n]||e,b[e]=t}return this},getAllResponseHeaders:function(){return E===2?i:null},getResponseHeader:function(e){var n;if(E===2){if(!s){s={};while(n=pn.exec(i))s[n[1].toLowerCase()]=n[2]}n=s[e.toLowerCase()]}return n===t?null:n},overrideMimeType:function(e){return E||(c.mimeType=e),this},abort:function(e){return e=e||S,o&&o.abort(e),T(0,e),this}};d.promise(x),x.success=x.done,x.error=x.fail,x.complete=m.add,x.statusCode=function(e){if(e){var t;if(E<2)for(t in e)g[t]=[g[t],e[t]];else t=e[x.status],x.always(t)}return this},c.url=((e||c.url)+"").replace(hn,"").replace(mn,ln[1]+"//"),c.dataTypes=v.trim(c.dataType||"*").toLowerCase().split(y),c.crossDomain==null&&(a=wn.exec(c.url.toLowerCase()),c.crossDomain=!(!a||a[1]===ln[1]&&a[2]===ln[2]&&(a[3]||(a[1]==="http:"?80:443))==(ln[3]||(ln[1]==="http:"?80:443)))),c.data&&c.processData&&typeof c.data!="string"&&(c.data=v.param(c.data,c.traditional)),kn(Sn,c,n,x);if(E===2)return x;f=c.global,c.type=c.type.toUpperCase(),c.hasContent=!vn.test(c.type),f&&v.active++===0&&v.event.trigger("ajaxStart");if(!c.hasContent){c.data&&(c.url+=(gn.test(c.url)?"&":"?")+c.data,delete c.data),r=c.url;if(c.cache===!1){var N=v.now(),C=c.url.replace(bn,"$1_="+N);c.url=C+(C===c.url?(gn.test(c.url)?"&":"?")+"_="+N:"")}}(c.data&&c.hasContent&&c.contentType!==!1||n.contentType)&&x.setRequestHeader("Content-Type",c.contentType),c.ifModified&&(r=r||c.url,v.lastModified[r]&&x.setRequestHeader("If-Modified-Since",v.lastModified[r]),v.etag[r]&&x.setRequestHeader("If-None-Match",v.etag[r])),x.setRequestHeader("Accept",c.dataTypes[0]&&c.accepts[c.dataTypes[0]]?c.accepts[c.dataTypes[0]]+(c.dataTypes[0]!=="*"?", "+Tn+"; q=0.01":""):c.accepts["*"]);for(l in c.headers)x.setRequestHeader(l,c.headers[l]);if(!c.beforeSend||c.beforeSend.call(h,x,c)!==!1&&E!==2){S="abort";for(l in{success:1,error:1,complete:1})x[l](c[l]);o=kn(xn,c,n,x);if(!o)T(-1,"No Transport");else{x.readyState=1,f&&p.trigger("ajaxSend",[x,c]),c.async&&c.timeout>0&&(u=setTimeout(function(){x.abort("timeout")},c.timeout));try{E=1,o.send(b,T)}catch(k){if(!(E<2))throw k;T(-1,k)}}return x}return x.abort()},active:0,lastModified:{},etag:{}});var Mn=[],_n=/\?/,Dn=/(=)\?(?=&|$)|\?\?/,Pn=v.now();v.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var e=Mn.pop()||v.expando+"_"+Pn++;return this[e]=!0,e}}),v.ajaxPrefilter("json jsonp",function(n,r,i){var s,o,u,a=n.data,f=n.url,l=n.jsonp!==!1,c=l&&Dn.test(f),h=l&&!c&&typeof a=="string"&&!(n.contentType||"").indexOf("application/x-www-form-urlencoded")&&Dn.test(a);if(n.dataTypes[0]==="jsonp"||c||h)return s=n.jsonpCallback=v.isFunction(n.jsonpCallback)?n.jsonpCallback():n.jsonpCallback,o=e[s],c?n.url=f.replace(Dn,"$1"+s):h?n.data=a.replace(Dn,"$1"+s):l&&(n.url+=(_n.test(f)?"&":"?")+n.jsonp+"="+s),n.converters["script json"]=function(){return u||v.error(s+" was not called"),u[0]},n.dataTypes[0]="json",e[s]=function(){u=arguments},i.always(function(){e[s]=o,n[s]&&(n.jsonpCallback=r.jsonpCallback,Mn.push(s)),u&&v.isFunction(o)&&o(u[0]),u=o=t}),"script"}),v.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/javascript|ecmascript/},converters:{"text script":function(e){return v.globalEval(e),e}}}),v.ajaxPrefilter("script",function(e){e.cache===t&&(e.cache=!1),e.crossDomain&&(e.type="GET",e.global=!1)}),v.ajaxTransport("script",function(e){if(e.crossDomain){var n,r=i.head||i.getElementsByTagName("head")[0]||i.documentElement;return{send:function(s,o){n=i.createElement("script"),n.async="async",e.scriptCharset&&(n.charset=e.scriptCharset),n.src=e.url,n.onload=n.onreadystatechange=function(e,i){if(i||!n.readyState||/loaded|complete/.test(n.readyState))n.onload=n.onreadystatechange=null,r&&n.parentNode&&r.removeChild(n),n=t,i||o(200,"success")},r.insertBefore(n,r.firstChild)},abort:function(){n&&n.onload(0,1)}}}});var Hn,Bn=e.ActiveXObject?function(){for(var e in Hn)Hn[e](0,1)}:!1,jn=0;v.ajaxSettings.xhr=e.ActiveXObject?function(){return!this.isLocal&&Fn()||In()}:Fn,function(e){v.extend(v.support,{ajax:!!e,cors:!!e&&"withCredentials"in e})}(v.ajaxSettings.xhr()),v.support.ajax&&v.ajaxTransport(function(n){if(!n.crossDomain||v.support.cors){var r;return{send:function(i,s){var o,u,a=n.xhr();n.username?a.open(n.type,n.url,n.async,n.username,n.password):a.open(n.type,n.url,n.async);if(n.xhrFields)for(u in n.xhrFields)a[u]=n.xhrFields[u];n.mimeType&&a.overrideMimeType&&a.overrideMimeType(n.mimeType),!n.crossDomain&&!i["X-Requested-With"]&&(i["X-Requested-With"]="XMLHttpRequest");try{for(u in i)a.setRequestHeader(u,i[u])}catch(f){}a.send(n.hasContent&&n.data||null),r=function(e,i){var u,f,l,c,h;try{if(r&&(i||a.readyState===4)){r=t,o&&(a.onreadystatechange=v.noop,Bn&&delete Hn[o]);if(i)a.readyState!==4&&a.abort();else{u=a.status,l=a.getAllResponseHeaders(),c={},h=a.responseXML,h&&h.documentElement&&(c.xml=h);try{c.text=a.responseText}catch(p){}try{f=a.statusText}catch(p){f=""}!u&&n.isLocal&&!n.crossDomain?u=c.text?200:404:u===1223&&(u=204)}}}catch(d){i||s(-1,d)}c&&s(u,f,c,l)},n.async?a.readyState===4?setTimeout(r,0):(o=++jn,Bn&&(Hn||(Hn={},v(e).unload(Bn)),Hn[o]=r),a.onreadystatechange=r):r()},abort:function(){r&&r(0,1)}}}});var qn,Rn,Un=/^(?:toggle|show|hide)$/,zn=new RegExp("^(?:([-+])=|)("+m+")([a-z%]*)$","i"),Wn=/queueHooks$/,Xn=[Gn],Vn={"*":[function(e,t){var n,r,i=this.createTween(e,t),s=zn.exec(t),o=i.cur(),u=+o||0,a=1,f=20;if(s){n=+s[2],r=s[3]||(v.cssNumber[e]?"":"px");if(r!=="px"&&u){u=v.css(i.elem,e,!0)||n||1;do a=a||".5",u/=a,v.style(i.elem,e,u+r);while(a!==(a=i.cur()/o)&&a!==1&&--f)}i.unit=r,i.start=u,i.end=s[1]?u+(s[1]+1)*n:n}return i}]};v.Animation=v.extend(Kn,{tweener:function(e,t){v.isFunction(e)?(t=e,e=["*"]):e=e.split(" ");var n,r=0,i=e.length;for(;r<i;r++)n=e[r],Vn[n]=Vn[n]||[],Vn[n].unshift(t)},prefilter:function(e,t){t?Xn.unshift(e):Xn.push(e)}}),v.Tween=Yn,Yn.prototype={constructor:Yn,init:function(e,t,n,r,i,s){this.elem=e,this.prop=n,this.easing=i||"swing",this.options=t,this.start=this.now=this.cur(),this.end=r,this.unit=s||(v.cssNumber[n]?"":"px")},cur:function(){var e=Yn.propHooks[this.prop];return e&&e.get?e.get(this):Yn.propHooks._default.get(this)},run:function(e){var t,n=Yn.propHooks[this.prop];return this.options.duration?this.pos=t=v.easing[this.easing](e,this.options.duration*e,0,1,this.options.duration):this.pos=t=e,this.now=(this.end-this.start)*t+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),n&&n.set?n.set(this):Yn.propHooks._default.set(this),this}},Yn.prototype.init.prototype=Yn.prototype,Yn.propHooks={_default:{get:function(e){var t;return e.elem[e.prop]==null||!!e.elem.style&&e.elem.style[e.prop]!=null?(t=v.css(e.elem,e.prop,!1,""),!t||t==="auto"?0:t):e.elem[e.prop]},set:function(e){v.fx.step[e.prop]?v.fx.step[e.prop](e):e.elem.style&&(e.elem.style[v.cssProps[e.prop]]!=null||v.cssHooks[e.prop])?v.style(e.elem,e.prop,e.now+e.unit):e.elem[e.prop]=e.now}}},Yn.propHooks.scrollTop=Yn.propHooks.scrollLeft={set:function(e){e.elem.nodeType&&e.elem.parentNode&&(e.elem[e.prop]=e.now)}},v.each(["toggle","show","hide"],function(e,t){var n=v.fn[t];v.fn[t]=function(r,i,s){return r==null||typeof r=="boolean"||!e&&v.isFunction(r)&&v.isFunction(i)?n.apply(this,arguments):this.animate(Zn(t,!0),r,i,s)}}),v.fn.extend({fadeTo:function(e,t,n,r){return this.filter(Gt).css("opacity",0).show().end().animate({opacity:t},e,n,r)},animate:function(e,t,n,r){var i=v.isEmptyObject(e),s=v.speed(t,n,r),o=function(){var t=Kn(this,v.extend({},e),s);i&&t.stop(!0)};return i||s.queue===!1?this.each(o):this.queue(s.queue,o)},stop:function(e,n,r){var i=function(e){var t=e.stop;delete e.stop,t(r)};return typeof e!="string"&&(r=n,n=e,e=t),n&&e!==!1&&this.queue(e||"fx",[]),this.each(function(){var t=!0,n=e!=null&&e+"queueHooks",s=v.timers,o=v._data(this);if(n)o[n]&&o[n].stop&&i(o[n]);else for(n in o)o[n]&&o[n].stop&&Wn.test(n)&&i(o[n]);for(n=s.length;n--;)s[n].elem===this&&(e==null||s[n].queue===e)&&(s[n].anim.stop(r),t=!1,s.splice(n,1));(t||!r)&&v.dequeue(this,e)})}}),v.each({slideDown:Zn("show"),slideUp:Zn("hide"),slideToggle:Zn("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(e,t){v.fn[e]=function(e,n,r){return this.animate(t,e,n,r)}}),v.speed=function(e,t,n){var r=e&&typeof e=="object"?v.extend({},e):{complete:n||!n&&t||v.isFunction(e)&&e,duration:e,easing:n&&t||t&&!v.isFunction(t)&&t};r.duration=v.fx.off?0:typeof r.duration=="number"?r.duration:r.duration in v.fx.speeds?v.fx.speeds[r.duration]:v.fx.speeds._default;if(r.queue==null||r.queue===!0)r.queue="fx";return r.old=r.complete,r.complete=function(){v.isFunction(r.old)&&r.old.call(this),r.queue&&v.dequeue(this,r.queue)},r},v.easing={linear:function(e){return e},swing:function(e){return.5-Math.cos(e*Math.PI)/2}},v.timers=[],v.fx=Yn.prototype.init,v.fx.tick=function(){var e,n=v.timers,r=0;qn=v.now();for(;r<n.length;r++)e=n[r],!e()&&n[r]===e&&n.splice(r--,1);n.length||v.fx.stop(),qn=t},v.fx.timer=function(e){e()&&v.timers.push(e)&&!Rn&&(Rn=setInterval(v.fx.tick,v.fx.interval))},v.fx.interval=13,v.fx.stop=function(){clearInterval(Rn),Rn=null},v.fx.speeds={slow:600,fast:200,_default:400},v.fx.step={},v.expr&&v.expr.filters&&(v.expr.filters.animated=function(e){return v.grep(v.timers,function(t){return e===t.elem}).length});var er=/^(?:body|html)$/i;v.fn.offset=function(e){if(arguments.length)return e===t?this:this.each(function(t){v.offset.setOffset(this,e,t)});var n,r,i,s,o,u,a,f={top:0,left:0},l=this[0],c=l&&l.ownerDocument;if(!c)return;return(r=c.body)===l?v.offset.bodyOffset(l):(n=c.documentElement,v.contains(n,l)?(typeof l.getBoundingClientRect!="undefined"&&(f=l.getBoundingClientRect()),i=tr(c),s=n.clientTop||r.clientTop||0,o=n.clientLeft||r.clientLeft||0,u=i.pageYOffset||n.scrollTop,a=i.pageXOffset||n.scrollLeft,{top:f.top+u-s,left:f.left+a-o}):f)},v.offset={bodyOffset:function(e){var t=e.offsetTop,n=e.offsetLeft;return v.support.doesNotIncludeMarginInBodyOffset&&(t+=parseFloat(v.css(e,"marginTop"))||0,n+=parseFloat(v.css(e,"marginLeft"))||0),{top:t,left:n}},setOffset:function(e,t,n){var r=v.css(e,"position");r==="static"&&(e.style.position="relative");var i=v(e),s=i.offset(),o=v.css(e,"top"),u=v.css(e,"left"),a=(r==="absolute"||r==="fixed")&&v.inArray("auto",[o,u])>-1,f={},l={},c,h;a?(l=i.position(),c=l.top,h=l.left):(c=parseFloat(o)||0,h=parseFloat(u)||0),v.isFunction(t)&&(t=t.call(e,n,s)),t.top!=null&&(f.top=t.top-s.top+c),t.left!=null&&(f.left=t.left-s.left+h),"using"in t?t.using.call(e,f):i.css(f)}},v.fn.extend({position:function(){if(!this[0])return;var e=this[0],t=this.offsetParent(),n=this.offset(),r=er.test(t[0].nodeName)?{top:0,left:0}:t.offset();return n.top-=parseFloat(v.css(e,"marginTop"))||0,n.left-=parseFloat(v.css(e,"marginLeft"))||0,r.top+=parseFloat(v.css(t[0],"borderTopWidth"))||0,r.left+=parseFloat(v.css(t[0],"borderLeftWidth"))||0,{top:n.top-r.top,left:n.left-r.left}},offsetParent:function(){return this.map(function(){var e=this.offsetParent||i.body;while(e&&!er.test(e.nodeName)&&v.css(e,"position")==="static")e=e.offsetParent;return e||i.body})}}),v.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(e,n){var r=/Y/.test(n);v.fn[e]=function(i){return v.access(this,function(e,i,s){var o=tr(e);if(s===t)return o?n in o?o[n]:o.document.documentElement[i]:e[i];o?o.scrollTo(r?v(o).scrollLeft():s,r?s:v(o).scrollTop()):e[i]=s},e,i,arguments.length,null)}}),v.each({Height:"height",Width:"width"},function(e,n){v.each({padding:"inner"+e,content:n,"":"outer"+e},function(r,i){v.fn[i]=function(i,s){var o=arguments.length&&(r||typeof i!="boolean"),u=r||(i===!0||s===!0?"margin":"border");return v.access(this,function(n,r,i){var s;return v.isWindow(n)?n.document.documentElement["client"+e]:n.nodeType===9?(s=n.documentElement,Math.max(n.body["scroll"+e],s["scroll"+e],n.body["offset"+e],s["offset"+e],s["client"+e])):i===t?v.css(n,r,i,u):v.style(n,r,i,u)},n,o?i:t,o,null)}})}),e.jQuery=e.$=v,typeof define=="function"&&define.amd&&define.amd.jQuery&&define("jquery",[],function(){return v})})(window);\ No newline at end of filediff --git a/data/libs/jquery/jquery-ui-1.9.1.custom.js b/data/libs/jquery/jquery-ui-1.9.1.custom.jsdeleted file mode 100644index c1e59801e..000000000--- a/data/libs/jquery/jquery-ui-1.9.1.custom.js+++ /dev/null@@ -1,14823 +0,0 @@-/*! jQuery UI - v1.9.1 - 2012-11-15-* http://jqueryui.com-* Includes: jquery.ui.core.js, jquery.ui.widget.js, jquery.ui.mouse.js, jquery.ui.position.js, jquery.ui.draggable.js, jquery.ui.droppable.js, jquery.ui.resizable.js, jquery.ui.selectable.js, jquery.ui.sortable.js, jquery.ui.accordion.js, jquery.ui.autocomplete.js, jquery.ui.button.js, jquery.ui.datepicker.js, jquery.ui.dialog.js, jquery.ui.menu.js, jquery.ui.progressbar.js, jquery.ui.slider.js, jquery.ui.spinner.js, jquery.ui.tabs.js, jquery.ui.tooltip.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-* Copyright (c) 2012 jQuery Foundation and other contributors Licensed MIT */--(function( $, undefined ) {--var uuid = 0,- runiqueId = /^ui-id-\d+$/;--// prevent duplicate loading-// this is only a problem because we proxy existing functions-// and we don't want to double proxy them-$.ui = $.ui || {};-if ( $.ui.version ) {- return;-}--$.extend( $.ui, {- version: "1.9.1",-- 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- }-});--// plugins-$.fn.extend({- _focus: $.fn.focus,- focus: function( delay, fn ) {- return typeof delay === "number" ?- this.each(function() {- var elem = this;- setTimeout(function() {- $( elem ).focus();- if ( fn ) {- fn.call( elem );- }- }, delay );- }) :- this._focus.apply( this, arguments );- },-- scrollParent: function() {- var scrollParent;- if (($.ui.ie && (/(static|relative)/).test(this.css('position'))) || (/absolute/).test(this.css('position'))) {- scrollParent = this.parents().filter(function() {- return (/(relative|absolute|fixed)/).test($.css(this,'position')) && (/(auto|scroll)/).test($.css(this,'overflow')+$.css(this,'overflow-y')+$.css(this,'overflow-x'));- }).eq(0);- } else {- scrollParent = this.parents().filter(function() {- return (/(auto|scroll)/).test($.css(this,'overflow')+$.css(this,'overflow-y')+$.css(this,'overflow-x'));- }).eq(0);- }-- return (/fixed/).test(this.css('position')) || !scrollParent.length ? $(document) : scrollParent;- },-- zIndex: function( zIndex ) {- if ( zIndex !== undefined ) {- return this.css( "zIndex", zIndex );- }-- if ( this.length ) {- var elem = $( this[ 0 ] ), position, value;- while ( elem.length && elem[ 0 ] !== document ) {- // Ignore z-index if position is set to a value where z-index is ignored by the browser- // This makes behavior of this function consistent across browsers- // WebKit always returns auto if the element is positioned- position = elem.css( "position" );- if ( position === "absolute" || position === "relative" || position === "fixed" ) {- // IE returns 0 when zIndex is not specified- // other browsers return a string- // we ignore the case of nested elements with an explicit value of 0- // <div style="z-index: -10;"><div style="z-index: 0;"></div></div>- value = parseInt( elem.css( "zIndex" ), 10 );- if ( !isNaN( value ) && value !== 0 ) {- return value;- }- }- elem = elem.parent();- }- }-- return 0;- },-- uniqueId: function() {- return this.each(function() {- if ( !this.id ) {- this.id = "ui-id-" + (++uuid);- }- });- },-- removeUniqueId: function() {- return this.each(function() {- if ( runiqueId.test( this.id ) ) {- $( this ).removeAttr( "id" );- }- });- }-});--// support: jQuery <1.8-if ( !$( "<a>" ).outerWidth( 1 ).jquery ) {- $.each( [ "Width", "Height" ], function( i, name ) {- var side = name === "Width" ? [ "Left", "Right" ] : [ "Top", "Bottom" ],- type = name.toLowerCase(),- orig = {- innerWidth: $.fn.innerWidth,- innerHeight: $.fn.innerHeight,- outerWidth: $.fn.outerWidth,- outerHeight: $.fn.outerHeight- };-- function reduce( elem, size, border, margin ) {- $.each( side, function() {- size -= parseFloat( $.css( elem, "padding" + this ) ) || 0;- if ( border ) {- size -= parseFloat( $.css( elem, "border" + this + "Width" ) ) || 0;- }- if ( margin ) {- size -= parseFloat( $.css( elem, "margin" + this ) ) || 0;- }- });- return size;- }-- $.fn[ "inner" + name ] = function( size ) {- if ( size === undefined ) {- return orig[ "inner" + name ].call( this );- }-- return this.each(function() {- $( this ).css( type, reduce( this, size ) + "px" );- });- };-- $.fn[ "outer" + name] = function( size, margin ) {- if ( typeof size !== "number" ) {- return orig[ "outer" + name ].call( this, size );- }-- return this.each(function() {- $( this).css( type, reduce( this, size, true, margin ) + "px" );- });- };- });-}--// selectors-function focusable( element, isTabIndexNotNaN ) {- var map, mapName, img,- nodeName = element.nodeName.toLowerCase();- if ( "area" === nodeName ) {- map = element.parentNode;- mapName = map.name;- if ( !element.href || !mapName || map.nodeName.toLowerCase() !== "map" ) {- return false;- }- img = $( "img[usemap=#" + mapName + "]" )[0];- return !!img && visible( img );- }- return ( /input|select|textarea|button|object/.test( nodeName ) ?- !element.disabled :- "a" === nodeName ?- element.href || isTabIndexNotNaN :- isTabIndexNotNaN) &&- // the element and all of its ancestors must be visible- visible( element );-}--function visible( element ) {- return $.expr.filters.visible( element ) &&- !$( element ).parents().andSelf().filter(function() {- return $.css( this, "visibility" ) === "hidden";- }).length;-}--$.extend( $.expr[ ":" ], {- data: $.expr.createPseudo ?- $.expr.createPseudo(function( dataName ) {- return function( elem ) {- return !!$.data( elem, dataName );- };- }) :- // support: jQuery <1.8- function( elem, i, match ) {- return !!$.data( elem, match[ 3 ] );- },-- focusable: function( element ) {- return focusable( element, !isNaN( $.attr( element, "tabindex" ) ) );- },-- tabbable: function( element ) {- var tabIndex = $.attr( element, "tabindex" ),- isTabIndexNaN = isNaN( tabIndex );- return ( isTabIndexNaN || tabIndex >= 0 ) && focusable( element, !isTabIndexNaN );- }-});--// support-$(function() {- var body = document.body,- div = body.appendChild( div = document.createElement( "div" ) );-- // access offsetHeight before setting the style to prevent a layout bug- // in IE 9 which causes the element to continue to take up space even- // after it is removed from the DOM (#8026)- div.offsetHeight;-- $.extend( div.style, {- minHeight: "100px",- height: "auto",- padding: 0,- borderWidth: 0- });-- $.support.minHeight = div.offsetHeight === 100;- $.support.selectstart = "onselectstart" in div;-- // set display to none to avoid a layout bug in IE- // http://dev.jquery.com/ticket/4014- body.removeChild( div ).style.display = "none";-});------// deprecated--(function() {- var uaMatch = /msie ([\w.]+)/.exec( navigator.userAgent.toLowerCase() ) || [];- $.ui.ie = uaMatch.length ? true : false;- $.ui.ie6 = parseFloat( uaMatch[ 1 ], 10 ) === 6;-})();--$.fn.extend({- disableSelection: function() {- return this.bind( ( $.support.selectstart ? "selectstart" : "mousedown" ) +- ".ui-disableSelection", function( event ) {- event.preventDefault();- });- },-- enableSelection: function() {- return this.unbind( ".ui-disableSelection" );- }-});--$.extend( $.ui, {- // $.ui.plugin is deprecated. Use the proxy pattern instead.- plugin: {- add: function( module, option, set ) {- var i,- proto = $.ui[ module ].prototype;- for ( i in set ) {- proto.plugins[ i ] = proto.plugins[ i ] || [];- proto.plugins[ i ].push( [ option, set[ i ] ] );- }- },- call: function( instance, name, args ) {- var i,- set = instance.plugins[ name ];- if ( !set || !instance.element[ 0 ].parentNode || instance.element[ 0 ].parentNode.nodeType === 11 ) {- return;- }-- for ( i = 0; i < set.length; i++ ) {- if ( instance.options[ set[ i ][ 0 ] ] ) {- set[ i ][ 1 ].apply( instance.element, args );- }- }- }- },-- contains: $.contains,-- // only used by resizable- hasScroll: function( el, a ) {-- //If overflow is hidden, the element might have extra content, but the user wants to hide it- if ( $( el ).css( "overflow" ) === "hidden") {- return false;- }-- var scroll = ( a && a === "left" ) ? "scrollLeft" : "scrollTop",- has = false;-- if ( el[ scroll ] > 0 ) {- return true;- }-- // TODO: determine which cases actually cause this to happen- // if the element doesn't have the scroll set, see if it's possible to- // set the scroll- el[ scroll ] = 1;- has = ( el[ scroll ] > 0 );- el[ scroll ] = 0;- return has;- },-- // these are odd functions, fix the API or move into individual plugins- isOverAxis: function( x, reference, size ) {- //Determines when x coordinate is over "b" element axis- return ( x > reference ) && ( x < ( reference + size ) );- },- isOver: function( y, x, top, left, height, width ) {- //Determines when x, y coordinates is over "b" element- return $.ui.isOverAxis( y, top, height ) && $.ui.isOverAxis( x, left, width );- }-});--})( jQuery );-(function( $, undefined ) {--var uuid = 0,- slice = Array.prototype.slice,- _cleanData = $.cleanData;-$.cleanData = function( elems ) {- for ( var i = 0, elem; (elem = elems[i]) != null; i++ ) {- try {- $( elem ).triggerHandler( "remove" );- // http://bugs.jquery.com/ticket/8235- } catch( e ) {}- }- _cleanData( elems );-};--$.widget = function( name, base, prototype ) {- var fullName, existingConstructor, constructor, basePrototype,- namespace = name.split( "." )[ 0 ];-- name = name.split( "." )[ 1 ];- fullName = namespace + "-" + name;-- if ( !prototype ) {- prototype = base;- base = $.Widget;- }-- // create selector for plugin- $.expr[ ":" ][ fullName.toLowerCase() ] = function( elem ) {- return !!$.data( elem, fullName );- };-- $[ namespace ] = $[ namespace ] || {};- existingConstructor = $[ namespace ][ name ];- constructor = $[ namespace ][ name ] = function( options, element ) {- // allow instantiation without "new" keyword- if ( !this._createWidget ) {- return new constructor( options, element );- }-- // allow instantiation without initializing for simple inheritance- // must use "new" keyword (the code above always passes args)- if ( arguments.length ) {- this._createWidget( options, element );- }- };- // extend with the existing constructor to carry over any static properties- $.extend( constructor, existingConstructor, {- version: prototype.version,- // copy the object used to create the prototype in case we need to- // redefine the widget later- _proto: $.extend( {}, prototype ),- // track widgets that inherit from this widget in case this widget is- // redefined after a widget inherits from it- _childConstructors: []- });-- basePrototype = new base();- // we need to make the options hash a property directly on the new instance- // otherwise we'll modify the options hash on the prototype that we're- // inheriting from- basePrototype.options = $.widget.extend( {}, basePrototype.options );- $.each( prototype, function( prop, value ) {- if ( $.isFunction( value ) ) {- prototype[ prop ] = (function() {- var _super = function() {- return base.prototype[ prop ].apply( this, arguments );- },- _superApply = function( args ) {- return base.prototype[ prop ].apply( this, args );- };- return function() {- var __super = this._super,- __superApply = this._superApply,- returnValue;-- this._super = _super;- this._superApply = _superApply;-- returnValue = value.apply( this, arguments );-- this._super = __super;- this._superApply = __superApply;-- return returnValue;- };- })();- }- });- constructor.prototype = $.widget.extend( basePrototype, {- // TODO: remove support for widgetEventPrefix- // always use the name + a colon as the prefix, e.g., draggable:start- // don't prefix for widgets that aren't DOM-based- widgetEventPrefix: basePrototype.widgetEventPrefix || name- }, prototype, {- constructor: constructor,- namespace: namespace,- widgetName: name,- // TODO remove widgetBaseClass, see #8155- widgetBaseClass: fullName,- widgetFullName: fullName- });-- // If this widget is being redefined then we need to find all widgets that- // are inheriting from it and redefine all of them so that they inherit from- // the new version of this widget. We're essentially trying to replace one- // level in the prototype chain.- if ( existingConstructor ) {- $.each( existingConstructor._childConstructors, function( i, child ) {- var childPrototype = child.prototype;-- // redefine the child widget using the same prototype that was- // originally used, but inherit from the new version of the base- $.widget( childPrototype.namespace + "." + childPrototype.widgetName, constructor, child._proto );- });- // remove the list of existing child constructors from the old constructor- // so the old child constructors can be garbage collected- delete existingConstructor._childConstructors;- } else {- base._childConstructors.push( constructor );- }-- $.widget.bridge( name, constructor );-};--$.widget.extend = function( target ) {- var input = slice.call( arguments, 1 ),- inputIndex = 0,- inputLength = input.length,- key,- value;- for ( ; inputIndex < inputLength; inputIndex++ ) {- for ( key in input[ inputIndex ] ) {- value = input[ inputIndex ][ key ];- if ( input[ inputIndex ].hasOwnProperty( key ) && value !== undefined ) {- // Clone objects- if ( $.isPlainObject( value ) ) {- target[ key ] = $.isPlainObject( target[ key ] ) ?- $.widget.extend( {}, target[ key ], value ) :- // Don't extend strings, arrays, etc. with objects- $.widget.extend( {}, value );- // Copy everything else by reference- } else {- target[ key ] = value;- }- }- }- }- return target;-};--$.widget.bridge = function( name, object ) {- var fullName = object.prototype.widgetFullName;- $.fn[ name ] = function( options ) {- var isMethodCall = typeof options === "string",- args = slice.call( arguments, 1 ),- returnValue = this;-- // allow multiple hashes to be passed on init- options = !isMethodCall && args.length ?- $.widget.extend.apply( null, [ options ].concat(args) ) :- options;-- if ( isMethodCall ) {- this.each(function() {- var methodValue,- instance = $.data( this, fullName );- if ( !instance ) {- return $.error( "cannot call methods on " + name + " prior to initialization; " +- "attempted to call method '" + options + "'" );- }- if ( !$.isFunction( instance[options] ) || options.charAt( 0 ) === "_" ) {- return $.error( "no such method '" + options + "' for " + name + " widget instance" );- }- methodValue = instance[ options ].apply( instance, args );- if ( methodValue !== instance && methodValue !== undefined ) {- returnValue = methodValue && methodValue.jquery ?- returnValue.pushStack( methodValue.get() ) :- methodValue;- return false;- }- });- } else {- this.each(function() {- var instance = $.data( this, fullName );- if ( instance ) {- instance.option( options || {} )._init();- } else {- new object( options, this );- }- });- }-- return returnValue;- };-};--$.Widget = function( /* options, element */ ) {};-$.Widget._childConstructors = [];--$.Widget.prototype = {- widgetName: "widget",- widgetEventPrefix: "",- defaultElement: "<div>",- options: {- disabled: false,-- // callbacks- create: null- },- _createWidget: function( options, element ) {- element = $( element || this.defaultElement || this )[ 0 ];- this.element = $( element );- this.uuid = uuid++;- this.eventNamespace = "." + this.widgetName + this.uuid;- this.options = $.widget.extend( {},- this.options,- this._getCreateOptions(),- options );-- this.bindings = $();- this.hoverable = $();- this.focusable = $();-- if ( element !== this ) {- // 1.9 BC for #7810- // TODO remove dual storage- $.data( element, this.widgetName, this );- $.data( element, this.widgetFullName, this );- this._on( this.element, {- remove: function( event ) {- if ( event.target === element ) {- this.destroy();- }- }- });- this.document = $( element.style ?- // element within the document- element.ownerDocument :- // element is window or document- element.document || element );- this.window = $( this.document[0].defaultView || this.document[0].parentWindow );- }-- this._create();- this._trigger( "create", null, this._getCreateEventData() );- this._init();- },- _getCreateOptions: $.noop,- _getCreateEventData: $.noop,- _create: $.noop,- _init: $.noop,-- destroy: function() {- this._destroy();- // we can probably remove the unbind calls in 2.0- // all event bindings should go through this._on()- this.element- .unbind( this.eventNamespace )- // 1.9 BC for #7810- // TODO remove dual storage- .removeData( this.widgetName )- .removeData( this.widgetFullName )- // support: jquery <1.6.3- // http://bugs.jquery.com/ticket/9413- .removeData( $.camelCase( this.widgetFullName ) );- this.widget()- .unbind( this.eventNamespace )- .removeAttr( "aria-disabled" )- .removeClass(- this.widgetFullName + "-disabled " +- "ui-state-disabled" );-- // clean up events and states- this.bindings.unbind( this.eventNamespace );- this.hoverable.removeClass( "ui-state-hover" );- this.focusable.removeClass( "ui-state-focus" );- },- _destroy: $.noop,-- widget: function() {- return this.element;- },-- option: function( key, value ) {- var options = key,- parts,- curOption,- i;-- if ( arguments.length === 0 ) {- // don't return a reference to the internal hash- return $.widget.extend( {}, this.options );- }-- if ( typeof key === "string" ) {- // handle nested keys, e.g., "foo.bar" => { foo: { bar: ___ } }- options = {};- parts = key.split( "." );- key = parts.shift();- if ( parts.length ) {- curOption = options[ key ] = $.widget.extend( {}, this.options[ key ] );- for ( i = 0; i < parts.length - 1; i++ ) {- curOption[ parts[ i ] ] = curOption[ parts[ i ] ] || {};- curOption = curOption[ parts[ i ] ];- }- key = parts.pop();- if ( value === undefined ) {- return curOption[ key ] === undefined ? null : curOption[ key ];- }- curOption[ key ] = value;- } else {- if ( value === undefined ) {- return this.options[ key ] === undefined ? null : this.options[ key ];- }- options[ key ] = value;- }- }-- this._setOptions( options );-- return this;- },- _setOptions: function( options ) {- var key;-- for ( key in options ) {- this._setOption( key, options[ key ] );- }-- return this;- },- _setOption: function( key, value ) {- this.options[ key ] = value;-- if ( key === "disabled" ) {- this.widget()- .toggleClass( this.widgetFullName + "-disabled ui-state-disabled", !!value )- .attr( "aria-disabled", value );- this.hoverable.removeClass( "ui-state-hover" );- this.focusable.removeClass( "ui-state-focus" );- }-- return this;- },-- enable: function() {- return this._setOption( "disabled", false );- },- disable: function() {- return this._setOption( "disabled", true );- },-- _on: function( element, handlers ) {- var delegateElement,- instance = this;- // no element argument, shuffle and use this.element- if ( !handlers ) {- handlers = element;- element = this.element;- delegateElement = this.widget();- } else {- // accept selectors, DOM elements- element = delegateElement = $( element );- this.bindings = this.bindings.add( element );- }-- $.each( handlers, function( event, handler ) {- function handlerProxy() {- // allow widgets to customize the disabled handling- // - disabled as an array instead of boolean- // - disabled class as method for disabling individual parts- if ( instance.options.disabled === true ||- $( this ).hasClass( "ui-state-disabled" ) ) {- return;- }- return ( typeof handler === "string" ? instance[ handler ] : handler )- .apply( instance, arguments );- }-- // copy the guid so direct unbinding works- if ( typeof handler !== "string" ) {- handlerProxy.guid = handler.guid =- handler.guid || handlerProxy.guid || $.guid++;- }-- var match = event.match( /^(\w+)\s*(.*)$/ ),- eventName = match[1] + instance.eventNamespace,- selector = match[2];- if ( selector ) {- delegateElement.delegate( selector, eventName, handlerProxy );- } else {- element.bind( eventName, handlerProxy );- }- });- },-- _off: function( element, eventName ) {- eventName = (eventName || "").split( " " ).join( this.eventNamespace + " " ) + this.eventNamespace;- element.unbind( eventName ).undelegate( eventName );- },-- _delay: function( handler, delay ) {- function handlerProxy() {- return ( typeof handler === "string" ? instance[ handler ] : handler )- .apply( instance, arguments );- }- var instance = this;- return setTimeout( handlerProxy, delay || 0 );- },-- _hoverable: function( element ) {- this.hoverable = this.hoverable.add( element );- this._on( element, {- mouseenter: function( event ) {- $( event.currentTarget ).addClass( "ui-state-hover" );- },- mouseleave: function( event ) {- $( event.currentTarget ).removeClass( "ui-state-hover" );- }- });- },-- _focusable: function( element ) {- this.focusable = this.focusable.add( element );- this._on( element, {- focusin: function( event ) {- $( event.currentTarget ).addClass( "ui-state-focus" );- },- focusout: function( event ) {- $( event.currentTarget ).removeClass( "ui-state-focus" );- }- });- },-- _trigger: function( type, event, data ) {- var prop, orig,- callback = this.options[ type ];-- data = data || {};- event = $.Event( event );- event.type = ( type === this.widgetEventPrefix ?- type :- this.widgetEventPrefix + type ).toLowerCase();- // the original event may come from any element- // so we need to reset the target on the new event- event.target = this.element[ 0 ];-- // copy original event properties over to the new event- orig = event.originalEvent;- if ( orig ) {- for ( prop in orig ) {- if ( !( prop in event ) ) {- event[ prop ] = orig[ prop ];- }- }- }-- this.element.trigger( event, data );- return !( $.isFunction( callback ) &&- callback.apply( this.element[0], [ event ].concat( data ) ) === false ||- event.isDefaultPrevented() );- }-};--$.each( { show: "fadeIn", hide: "fadeOut" }, function( method, defaultEffect ) {- $.Widget.prototype[ "_" + method ] = function( element, options, callback ) {- if ( typeof options === "string" ) {- options = { effect: options };- }- var hasOptions,- effectName = !options ?- method :- options === true || typeof options === "number" ?- defaultEffect :- options.effect || defaultEffect;- options = options || {};- if ( typeof options === "number" ) {- options = { duration: options };- }- hasOptions = !$.isEmptyObject( options );- options.complete = callback;- if ( options.delay ) {- element.delay( options.delay );- }- if ( hasOptions && $.effects && ( $.effects.effect[ effectName ] || $.uiBackCompat !== false && $.effects[ effectName ] ) ) {- element[ method ]( options );- } else if ( effectName !== method && element[ effectName ] ) {- element[ effectName ]( options.duration, options.easing, callback );- } else {- element.queue(function( next ) {- $( this )[ method ]();- if ( callback ) {- callback.call( element[ 0 ] );- }- next();- });- }- };-});--// DEPRECATED-if ( $.uiBackCompat !== false ) {- $.Widget.prototype._getCreateOptions = function() {- return $.metadata && $.metadata.get( this.element[0] )[ this.widgetName ];- };-}--})( jQuery );-(function( $, undefined ) {--var mouseHandled = false;-$( document ).mouseup( function( e ) {- mouseHandled = false;-});--$.widget("ui.mouse", {- version: "1.9.1",- options: {- cancel: 'input,textarea,button,select,option',- distance: 1,- delay: 0- },- _mouseInit: function() {- var that = this;-- this.element- .bind('mousedown.'+this.widgetName, function(event) {- return that._mouseDown(event);- })- .bind('click.'+this.widgetName, function(event) {- if (true === $.data(event.target, that.widgetName + '.preventClickEvent')) {- $.removeData(event.target, that.widgetName + '.preventClickEvent');- event.stopImmediatePropagation();- return false;- }- });-- this.started = false;- },-- // TODO: make sure destroying one instance of mouse doesn't mess with- // other instances of mouse- _mouseDestroy: function() {- this.element.unbind('.'+this.widgetName);- if ( this._mouseMoveDelegate ) {- $(document)- .unbind('mousemove.'+this.widgetName, this._mouseMoveDelegate)- .unbind('mouseup.'+this.widgetName, this._mouseUpDelegate);- }- },-- _mouseDown: function(event) {- // don't let more than one widget handle mouseStart- if( mouseHandled ) { return; }-- // we may have missed mouseup (out of window)- (this._mouseStarted && this._mouseUp(event));-- this._mouseDownEvent = event;-- var that = this,- btnIsLeft = (event.which === 1),- // event.target.nodeName works around a bug in IE 8 with- // disabled inputs (#7620)- elIsCancel = (typeof this.options.cancel === "string" && event.target.nodeName ? $(event.target).closest(this.options.cancel).length : false);- if (!btnIsLeft || elIsCancel || !this._mouseCapture(event)) {- return true;- }-- this.mouseDelayMet = !this.options.delay;- if (!this.mouseDelayMet) {- this._mouseDelayTimer = setTimeout(function() {- that.mouseDelayMet = true;- }, this.options.delay);- }-- if (this._mouseDistanceMet(event) && this._mouseDelayMet(event)) {- this._mouseStarted = (this._mouseStart(event) !== false);- if (!this._mouseStarted) {- event.preventDefault();- return true;- }- }-- // Click event may never have fired (Gecko & Opera)- if (true === $.data(event.target, this.widgetName + '.preventClickEvent')) {- $.removeData(event.target, this.widgetName + '.preventClickEvent');- }-- // these delegates are required to keep context- this._mouseMoveDelegate = function(event) {- return that._mouseMove(event);- };- this._mouseUpDelegate = function(event) {- return that._mouseUp(event);- };- $(document)- .bind('mousemove.'+this.widgetName, this._mouseMoveDelegate)- .bind('mouseup.'+this.widgetName, this._mouseUpDelegate);-- event.preventDefault();-- mouseHandled = true;- return true;- },-- _mouseMove: function(event) {- // IE mouseup check - mouseup happened when mouse was out of window- if ($.ui.ie && !(document.documentMode >= 9) && !event.button) {- return this._mouseUp(event);- }-- if (this._mouseStarted) {- this._mouseDrag(event);- return event.preventDefault();- }-- if (this._mouseDistanceMet(event) && this._mouseDelayMet(event)) {- this._mouseStarted =- (this._mouseStart(this._mouseDownEvent, event) !== false);- (this._mouseStarted ? this._mouseDrag(event) : this._mouseUp(event));- }-- return !this._mouseStarted;- },-- _mouseUp: function(event) {- $(document)- .unbind('mousemove.'+this.widgetName, this._mouseMoveDelegate)- .unbind('mouseup.'+this.widgetName, this._mouseUpDelegate);-- if (this._mouseStarted) {- this._mouseStarted = false;-- if (event.target === this._mouseDownEvent.target) {- $.data(event.target, this.widgetName + '.preventClickEvent', true);- }-- this._mouseStop(event);- }-- return false;- },-- _mouseDistanceMet: function(event) {- return (Math.max(- Math.abs(this._mouseDownEvent.pageX - event.pageX),- Math.abs(this._mouseDownEvent.pageY - event.pageY)- ) >= this.options.distance- );- },-- _mouseDelayMet: function(event) {- return this.mouseDelayMet;- },-- // These are placeholder methods, to be overriden by extending plugin- _mouseStart: function(event) {},- _mouseDrag: function(event) {},- _mouseStop: function(event) {},- _mouseCapture: function(event) { return true; }-});--})(jQuery);-(function( $, undefined ) {--$.ui = $.ui || {};--var cachedScrollbarWidth,- max = Math.max,- abs = Math.abs,- round = Math.round,- rhorizontal = /left|center|right/,- rvertical = /top|center|bottom/,- roffset = /[\+\-]\d+%?/,- rposition = /^\w+/,- rpercent = /%$/,- _position = $.fn.position;--function getOffsets( offsets, width, height ) {- return [- parseInt( offsets[ 0 ], 10 ) * ( rpercent.test( offsets[ 0 ] ) ? width / 100 : 1 ),- parseInt( offsets[ 1 ], 10 ) * ( rpercent.test( offsets[ 1 ] ) ? height / 100 : 1 )- ];-}-function parseCss( element, property ) {- return parseInt( $.css( element, property ), 10 ) || 0;-}--$.position = {- scrollbarWidth: function() {- if ( cachedScrollbarWidth !== undefined ) {- return cachedScrollbarWidth;- }- var w1, w2,- div = $( "<div style='display:block;width:50px;height:50px;overflow:hidden;'><div style='height:100px;width:auto;'></div></div>" ),- innerDiv = div.children()[0];-- $( "body" ).append( div );- w1 = innerDiv.offsetWidth;- div.css( "overflow", "scroll" );-- w2 = innerDiv.offsetWidth;-- if ( w1 === w2 ) {- w2 = div[0].clientWidth;- }-- div.remove();-- return (cachedScrollbarWidth = w1 - w2);- },- getScrollInfo: function( within ) {- var overflowX = within.isWindow ? "" : within.element.css( "overflow-x" ),- overflowY = within.isWindow ? "" : within.element.css( "overflow-y" ),- hasOverflowX = overflowX === "scroll" ||- ( overflowX === "auto" && within.width < within.element[0].scrollWidth ),- hasOverflowY = overflowY === "scroll" ||- ( overflowY === "auto" && within.height < within.element[0].scrollHeight );- return {- width: hasOverflowX ? $.position.scrollbarWidth() : 0,- height: hasOverflowY ? $.position.scrollbarWidth() : 0- };- },- getWithinInfo: function( element ) {- var withinElement = $( element || window ),- isWindow = $.isWindow( withinElement[0] );- return {- element: withinElement,- isWindow: isWindow,- offset: withinElement.offset() || { left: 0, top: 0 },- scrollLeft: withinElement.scrollLeft(),- scrollTop: withinElement.scrollTop(),- width: isWindow ? withinElement.width() : withinElement.outerWidth(),- height: isWindow ? withinElement.height() : withinElement.outerHeight()- };- }-};--$.fn.position = function( options ) {- if ( !options || !options.of ) {- return _position.apply( this, arguments );- }-- // make a copy, we don't want to modify arguments- options = $.extend( {}, options );-- var atOffset, targetWidth, targetHeight, targetOffset, basePosition,- target = $( options.of ),- within = $.position.getWithinInfo( options.within ),- scrollInfo = $.position.getScrollInfo( within ),- targetElem = target[0],- collision = ( options.collision || "flip" ).split( " " ),- offsets = {};-- if ( targetElem.nodeType === 9 ) {- targetWidth = target.width();- targetHeight = target.height();- targetOffset = { top: 0, left: 0 };- } else if ( $.isWindow( targetElem ) ) {- targetWidth = target.width();- targetHeight = target.height();- targetOffset = { top: target.scrollTop(), left: target.scrollLeft() };- } else if ( targetElem.preventDefault ) {- // force left top to allow flipping- options.at = "left top";- targetWidth = targetHeight = 0;- targetOffset = { top: targetElem.pageY, left: targetElem.pageX };- } else {- targetWidth = target.outerWidth();- targetHeight = target.outerHeight();- targetOffset = target.offset();- }- // clone to reuse original targetOffset later- basePosition = $.extend( {}, targetOffset );-- // force my and at to have valid horizontal and vertical positions- // if a value is missing or invalid, it will be converted to center- $.each( [ "my", "at" ], function() {- var pos = ( options[ this ] || "" ).split( " " ),- horizontalOffset,- verticalOffset;-- if ( pos.length === 1) {- pos = rhorizontal.test( pos[ 0 ] ) ?- pos.concat( [ "center" ] ) :- rvertical.test( pos[ 0 ] ) ?- [ "center" ].concat( pos ) :- [ "center", "center" ];- }- pos[ 0 ] = rhorizontal.test( pos[ 0 ] ) ? pos[ 0 ] : "center";- pos[ 1 ] = rvertical.test( pos[ 1 ] ) ? pos[ 1 ] : "center";-- // calculate offsets- horizontalOffset = roffset.exec( pos[ 0 ] );- verticalOffset = roffset.exec( pos[ 1 ] );- offsets[ this ] = [- horizontalOffset ? horizontalOffset[ 0 ] : 0,- verticalOffset ? verticalOffset[ 0 ] : 0- ];-- // reduce to just the positions without the offsets- options[ this ] = [- rposition.exec( pos[ 0 ] )[ 0 ],- rposition.exec( pos[ 1 ] )[ 0 ]- ];- });-- // normalize collision option- if ( collision.length === 1 ) {- collision[ 1 ] = collision[ 0 ];- }-- if ( options.at[ 0 ] === "right" ) {- basePosition.left += targetWidth;- } else if ( options.at[ 0 ] === "center" ) {- basePosition.left += targetWidth / 2;- }-- if ( options.at[ 1 ] === "bottom" ) {- basePosition.top += targetHeight;- } else if ( options.at[ 1 ] === "center" ) {- basePosition.top += targetHeight / 2;- }-- atOffset = getOffsets( offsets.at, targetWidth, targetHeight );- basePosition.left += atOffset[ 0 ];- basePosition.top += atOffset[ 1 ];-- return this.each(function() {- var collisionPosition, using,- elem = $( this ),- elemWidth = elem.outerWidth(),- elemHeight = elem.outerHeight(),- marginLeft = parseCss( this, "marginLeft" ),- marginTop = parseCss( this, "marginTop" ),- collisionWidth = elemWidth + marginLeft + parseCss( this, "marginRight" ) + scrollInfo.width,- collisionHeight = elemHeight + marginTop + parseCss( this, "marginBottom" ) + scrollInfo.height,- position = $.extend( {}, basePosition ),- myOffset = getOffsets( offsets.my, elem.outerWidth(), elem.outerHeight() );-- if ( options.my[ 0 ] === "right" ) {- position.left -= elemWidth;- } else if ( options.my[ 0 ] === "center" ) {- position.left -= elemWidth / 2;- }-- if ( options.my[ 1 ] === "bottom" ) {- position.top -= elemHeight;- } else if ( options.my[ 1 ] === "center" ) {- position.top -= elemHeight / 2;- }-- position.left += myOffset[ 0 ];- position.top += myOffset[ 1 ];-- // if the browser doesn't support fractions, then round for consistent results- if ( !$.support.offsetFractions ) {- position.left = round( position.left );- position.top = round( position.top );- }-- collisionPosition = {- marginLeft: marginLeft,- marginTop: marginTop- };-- $.each( [ "left", "top" ], function( i, dir ) {- if ( $.ui.position[ collision[ i ] ] ) {- $.ui.position[ collision[ i ] ][ dir ]( position, {- targetWidth: targetWidth,- targetHeight: targetHeight,- elemWidth: elemWidth,- elemHeight: elemHeight,- collisionPosition: collisionPosition,- collisionWidth: collisionWidth,- collisionHeight: collisionHeight,- offset: [ atOffset[ 0 ] + myOffset[ 0 ], atOffset [ 1 ] + myOffset[ 1 ] ],- my: options.my,- at: options.at,- within: within,- elem : elem- });- }- });-- if ( $.fn.bgiframe ) {- elem.bgiframe();- }-- if ( options.using ) {- // adds feedback as second argument to using callback, if present- using = function( props ) {- var left = targetOffset.left - position.left,- right = left + targetWidth - elemWidth,- top = targetOffset.top - position.top,- bottom = top + targetHeight - elemHeight,- feedback = {- target: {- element: target,- left: targetOffset.left,- top: targetOffset.top,- width: targetWidth,- height: targetHeight- },- element: {- element: elem,- left: position.left,- top: position.top,- width: elemWidth,- height: elemHeight- },- horizontal: right < 0 ? "left" : left > 0 ? "right" : "center",- vertical: bottom < 0 ? "top" : top > 0 ? "bottom" : "middle"- };- if ( targetWidth < elemWidth && abs( left + right ) < targetWidth ) {- feedback.horizontal = "center";- }- if ( targetHeight < elemHeight && abs( top + bottom ) < targetHeight ) {- feedback.vertical = "middle";- }- if ( max( abs( left ), abs( right ) ) > max( abs( top ), abs( bottom ) ) ) {- feedback.important = "horizontal";- } else {- feedback.important = "vertical";- }- options.using.call( this, props, feedback );- };- }-- elem.offset( $.extend( position, { using: using } ) );- });-};--$.ui.position = {- fit: {- left: function( position, data ) {- var within = data.within,- withinOffset = within.isWindow ? within.scrollLeft : within.offset.left,- outerWidth = within.width,- collisionPosLeft = position.left - data.collisionPosition.marginLeft,- overLeft = withinOffset - collisionPosLeft,- overRight = collisionPosLeft + data.collisionWidth - outerWidth - withinOffset,- newOverRight;-- // element is wider than within- if ( data.collisionWidth > outerWidth ) {- // element is initially over the left side of within- if ( overLeft > 0 && overRight <= 0 ) {- newOverRight = position.left + overLeft + data.collisionWidth - outerWidth - withinOffset;- position.left += overLeft - newOverRight;- // element is initially over right side of within- } else if ( overRight > 0 && overLeft <= 0 ) {- position.left = withinOffset;- // element is initially over both left and right sides of within- } else {- if ( overLeft > overRight ) {- position.left = withinOffset + outerWidth - data.collisionWidth;- } else {- position.left = withinOffset;- }- }- // too far left -> align with left edge- } else if ( overLeft > 0 ) {- position.left += overLeft;- // too far right -> align with right edge- } else if ( overRight > 0 ) {- position.left -= overRight;- // adjust based on position and margin- } else {- position.left = max( position.left - collisionPosLeft, position.left );- }- },- top: function( position, data ) {- var within = data.within,- withinOffset = within.isWindow ? within.scrollTop : within.offset.top,- outerHeight = data.within.height,- collisionPosTop = position.top - data.collisionPosition.marginTop,- overTop = withinOffset - collisionPosTop,- overBottom = collisionPosTop + data.collisionHeight - outerHeight - withinOffset,- newOverBottom;-- // element is taller than within- if ( data.collisionHeight > outerHeight ) {- // element is initially over the top of within- if ( overTop > 0 && overBottom <= 0 ) {- newOverBottom = position.top + overTop + data.collisionHeight - outerHeight - withinOffset;- position.top += overTop - newOverBottom;- // element is initially over bottom of within- } else if ( overBottom > 0 && overTop <= 0 ) {- position.top = withinOffset;- // element is initially over both top and bottom of within- } else {- if ( overTop > overBottom ) {- position.top = withinOffset + outerHeight - data.collisionHeight;- } else {- position.top = withinOffset;- }- }- // too far up -> align with top- } else if ( overTop > 0 ) {- position.top += overTop;- // too far down -> align with bottom edge- } else if ( overBottom > 0 ) {- position.top -= overBottom;- // adjust based on position and margin- } else {- position.top = max( position.top - collisionPosTop, position.top );- }- }- },- flip: {- left: function( position, data ) {- var within = data.within,- withinOffset = within.offset.left + within.scrollLeft,- outerWidth = within.width,- offsetLeft = within.isWindow ? within.scrollLeft : within.offset.left,- collisionPosLeft = position.left - data.collisionPosition.marginLeft,- overLeft = collisionPosLeft - offsetLeft,- overRight = collisionPosLeft + data.collisionWidth - outerWidth - offsetLeft,- myOffset = data.my[ 0 ] === "left" ?- -data.elemWidth :- data.my[ 0 ] === "right" ?- data.elemWidth :- 0,- atOffset = data.at[ 0 ] === "left" ?- data.targetWidth :- data.at[ 0 ] === "right" ?- -data.targetWidth :- 0,- offset = -2 * data.offset[ 0 ],- newOverRight,- newOverLeft;-- if ( overLeft < 0 ) {- newOverRight = position.left + myOffset + atOffset + offset + data.collisionWidth - outerWidth - withinOffset;- if ( newOverRight < 0 || newOverRight < abs( overLeft ) ) {- position.left += myOffset + atOffset + offset;- }- }- else if ( overRight > 0 ) {- newOverLeft = position.left - data.collisionPosition.marginLeft + myOffset + atOffset + offset - offsetLeft;- if ( newOverLeft > 0 || abs( newOverLeft ) < overRight ) {- position.left += myOffset + atOffset + offset;- }- }- },- top: function( position, data ) {- var within = data.within,- withinOffset = within.offset.top + within.scrollTop,- outerHeight = within.height,- offsetTop = within.isWindow ? within.scrollTop : within.offset.top,- collisionPosTop = position.top - data.collisionPosition.marginTop,- overTop = collisionPosTop - offsetTop,- overBottom = collisionPosTop + data.collisionHeight - outerHeight - offsetTop,- top = data.my[ 1 ] === "top",- myOffset = top ?- -data.elemHeight :- data.my[ 1 ] === "bottom" ?- data.elemHeight :- 0,- atOffset = data.at[ 1 ] === "top" ?- data.targetHeight :- data.at[ 1 ] === "bottom" ?- -data.targetHeight :- 0,- offset = -2 * data.offset[ 1 ],- newOverTop,- newOverBottom;- if ( overTop < 0 ) {- newOverBottom = position.top + myOffset + atOffset + offset + data.collisionHeight - outerHeight - withinOffset;- if ( ( position.top + myOffset + atOffset + offset) > overTop && ( newOverBottom < 0 || newOverBottom < abs( overTop ) ) ) {- position.top += myOffset + atOffset + offset;- }- }- else if ( overBottom > 0 ) {- newOverTop = position.top - data.collisionPosition.marginTop + myOffset + atOffset + offset - offsetTop;- if ( ( position.top + myOffset + atOffset + offset) > overBottom && ( newOverTop > 0 || abs( newOverTop ) < overBottom ) ) {- position.top += myOffset + atOffset + offset;- }- }- }- },- flipfit: {- left: function() {- $.ui.position.flip.left.apply( this, arguments );- $.ui.position.fit.left.apply( this, arguments );- },- top: function() {- $.ui.position.flip.top.apply( this, arguments );- $.ui.position.fit.top.apply( this, arguments );- }- }-};--// fraction support test-(function () {- var testElement, testElementParent, testElementStyle, offsetLeft, i,- body = document.getElementsByTagName( "body" )[ 0 ],- div = document.createElement( "div" );-- //Create a "fake body" for testing based on method used in jQuery.support- testElement = document.createElement( body ? "div" : "body" );- testElementStyle = {- visibility: "hidden",- width: 0,- height: 0,- border: 0,- margin: 0,- background: "none"- };- if ( body ) {- $.extend( testElementStyle, {- position: "absolute",- left: "-1000px",- top: "-1000px"- });- }- for ( i in testElementStyle ) {- testElement.style[ i ] = testElementStyle[ i ];- }- testElement.appendChild( div );- testElementParent = body || document.documentElement;- testElementParent.insertBefore( testElement, testElementParent.firstChild );-- div.style.cssText = "position: absolute; left: 10.7432222px;";-- offsetLeft = $( div ).offset().left;- $.support.offsetFractions = offsetLeft > 10 && offsetLeft < 11;-- testElement.innerHTML = "";- testElementParent.removeChild( testElement );-})();--// DEPRECATED-if ( $.uiBackCompat !== false ) {- // offset option- (function( $ ) {- var _position = $.fn.position;- $.fn.position = function( options ) {- if ( !options || !options.offset ) {- return _position.call( this, options );- }- var offset = options.offset.split( " " ),- at = options.at.split( " " );- if ( offset.length === 1 ) {- offset[ 1 ] = offset[ 0 ];- }- if ( /^\d/.test( offset[ 0 ] ) ) {- offset[ 0 ] = "+" + offset[ 0 ];- }- if ( /^\d/.test( offset[ 1 ] ) ) {- offset[ 1 ] = "+" + offset[ 1 ];- }- if ( at.length === 1 ) {- if ( /left|center|right/.test( at[ 0 ] ) ) {- at[ 1 ] = "center";- } else {- at[ 1 ] = at[ 0 ];- at[ 0 ] = "center";- }- }- return _position.call( this, $.extend( options, {- at: at[ 0 ] + offset[ 0 ] + " " + at[ 1 ] + offset[ 1 ],- offset: undefined- } ) );- };- }( jQuery ) );-}--}( jQuery ) );-(function( $, undefined ) {--$.widget("ui.draggable", $.ui.mouse, {- version: "1.9.1",- widgetEventPrefix: "drag",- options: {- addClasses: true,- appendTo: "parent",- axis: false,- connectToSortable: false,- containment: false,- cursor: "auto",- cursorAt: false,- grid: false,- handle: false,- helper: "original",- iframeFix: false,- opacity: false,- refreshPositions: false,- revert: false,- revertDuration: 500,- scope: "default",- scroll: true,- scrollSensitivity: 20,- scrollSpeed: 20,- snap: false,- snapMode: "both",- snapTolerance: 20,- stack: false,- zIndex: false- },- _create: function() {-- if (this.options.helper == 'original' && !(/^(?: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(event) {-- var o = this.options;-- // among others, prevent a drag on a resizable-handle- if (this.helper || o.disabled || $(event.target).is('.ui-resizable-handle'))- return false;-- //Quit if we're not on a valid handle- this.handle = this._getHandle(event);- if (!this.handle)- return false;-- $(o.iframeFix === true ? "iframe" : o.iframeFix).each(function() {- $('<div class="ui-draggable-iframeFix" style="background: #fff;"></div>')- .css({- width: this.offsetWidth+"px", height: this.offsetHeight+"px",- position: "absolute", opacity: "0.001", zIndex: 1000- })- .css($(this).offset())- .appendTo("body");- });-- return true;-- },-- _mouseStart: function(event) {-- var o = this.options;-- //Create and append the visible helper- this.helper = this._createHelper(event);-- this.helper.addClass("ui-draggable-dragging");-- //Cache the helper size- this._cacheHelperProportions();-- //If ddmanager is used for droppables, set the global draggable- if($.ui.ddmanager)- $.ui.ddmanager.current = this;-- /*- * - Position generation -- * This block generates everything position related - it's the core of draggables.- */-- //Cache the margins of the original element- this._cacheMargins();-- //Store the helper's css position- this.cssPosition = this.helper.css("position");- this.scrollParent = this.helper.scrollParent();-- //The element's absolute position on the page minus margins- this.offset = this.positionAbs = this.element.offset();- this.offset = {- top: this.offset.top - this.margins.top,- left: this.offset.left - this.margins.left- };-- $.extend(this.offset, {- click: { //Where the click happened, relative to the element- left: event.pageX - this.offset.left,- top: event.pageY - this.offset.top- },- parent: this._getParentOffset(),- relative: this._getRelativeOffset() //This is a relative to absolute position minus the actual position calculation - only used for relative positioned helper- });-- //Generate the original position- this.originalPosition = this.position = this._generatePosition(event);- this.originalPageX = event.pageX;- this.originalPageY = event.pageY;-- //Adjust the mouse offset relative to the helper if 'cursorAt' is supplied- (o.cursorAt && this._adjustOffsetFromHelper(o.cursorAt));-- //Set a containment if given in the options- if(o.containment)- this._setContainment();-- //Trigger event + callbacks- if(this._trigger("start", event) === false) {- this._clear();- return false;- }-- //Recache the helper size- this._cacheHelperProportions();-- //Prepare the droppable offsets- if ($.ui.ddmanager && !o.dropBehaviour)- $.ui.ddmanager.prepareOffsets(this, event);--- this._mouseDrag(event, true); //Execute the drag once - this causes the helper not to be visible before getting its correct position-- //If the ddmanager is used for droppables, inform the manager that dragging has started (see #5003)- if ( $.ui.ddmanager ) $.ui.ddmanager.dragStart(this, event);-- return true;- },-- _mouseDrag: function(event, noPropagation) {-- //Compute the helpers position- this.position = this._generatePosition(event);- this.positionAbs = this._convertPositionTo("absolute");-- //Call plugins and callbacks and use the resulting position if something is returned- if (!noPropagation) {- var ui = this._uiHash();- if(this._trigger('drag', event, ui) === false) {- this._mouseUp({});- return false;- }- this.position = ui.position;- }-- if(!this.options.axis || this.options.axis != "y") this.helper[0].style.left = this.position.left+'px';- if(!this.options.axis || this.options.axis != "x") this.helper[0].style.top = this.position.top+'px';- if($.ui.ddmanager) $.ui.ddmanager.drag(this, event);-- return false;- },-- _mouseStop: function(event) {-- //If we are using droppables, inform the manager about the drop- var dropped = false;- if ($.ui.ddmanager && !this.options.dropBehaviour)- dropped = $.ui.ddmanager.drop(this, event);-- //if a drop comes from outside (a sortable)- if(this.dropped) {- dropped = this.dropped;- this.dropped = false;- }-- //if the original element is no longer in the DOM don't bother to continue (see #8269)- var element = this.element[0], elementInDom = false;- while ( element && (element = element.parentNode) ) {- if (element == document ) {- elementInDom = true;- }- }- if ( !elementInDom && this.options.helper === "original" )- return false;-- if((this.options.revert == "invalid" && !dropped) || (this.options.revert == "valid" && dropped) || this.options.revert === true || ($.isFunction(this.options.revert) && this.options.revert.call(this.element, dropped))) {- var that = this;- $(this.helper).animate(this.originalPosition, parseInt(this.options.revertDuration, 10), function() {- if(that._trigger("stop", event) !== false) {- that._clear();- }- });- } else {- if(this._trigger("stop", event) !== false) {- this._clear();- }- }-- return false;- },-- _mouseUp: function(event) {- //Remove frame helpers- $("div.ui-draggable-iframeFix").each(function() {- this.parentNode.removeChild(this);- });-- //If the ddmanager is used for droppables, inform the manager that dragging has stopped (see #5003)- if( $.ui.ddmanager ) $.ui.ddmanager.dragStop(this, event);-- return $.ui.mouse.prototype._mouseUp.call(this, event);- },-- cancel: function() {-- if(this.helper.is(".ui-draggable-dragging")) {- this._mouseUp({});- } else {- this._clear();- }-- return this;-- },-- _getHandle: function(event) {-- var handle = !this.options.handle || !$(this.options.handle, this.element).length ? true : false;- $(this.options.handle, this.element)- .find("*")- .andSelf()- .each(function() {- if(this == event.target) handle = true;- });-- return handle;-- },-- _createHelper: function(event) {-- var o = this.options;- var helper = $.isFunction(o.helper) ? $(o.helper.apply(this.element[0], [event])) : (o.helper == 'clone' ? this.element.clone().removeAttr('id') : this.element);-- if(!helper.parents('body').length)- helper.appendTo((o.appendTo == 'parent' ? this.element[0].parentNode : o.appendTo));-- if(helper[0] != this.element[0] && !(/(fixed|absolute)/).test(helper.css("position")))- helper.css("position", "absolute");-- return helper;-- },-- _adjustOffsetFromHelper: function(obj) {- if (typeof obj == 'string') {- obj = obj.split(' ');- }- if ($.isArray(obj)) {- obj = {left: +obj[0], top: +obj[1] || 0};- }- if ('left' in obj) {- this.offset.click.left = obj.left + this.margins.left;- }- if ('right' in obj) {- this.offset.click.left = this.helperProportions.width - obj.right + this.margins.left;- }- if ('top' in obj) {- this.offset.click.top = obj.top + this.margins.top;- }- if ('bottom' in obj) {- this.offset.click.top = this.helperProportions.height - obj.bottom + this.margins.top;- }- },-- _getParentOffset: function() {-- //Get the offsetParent and cache its position- this.offsetParent = this.helper.offsetParent();- var po = this.offsetParent.offset();-- // This is a special case where we need to modify a offset calculated on start, since the following happened:- // 1. The position of the helper is absolute, so it's position is calculated based on the next positioned parent- // 2. The actual offset parent is a child of the scroll parent, and the scroll parent isn't the document, which means that- // the scroll is included in the initial calculation of the offset of the parent, and never recalculated upon drag- if(this.cssPosition == 'absolute' && this.scrollParent[0] != document && $.contains(this.scrollParent[0], this.offsetParent[0])) {- po.left += this.scrollParent.scrollLeft();- po.top += this.scrollParent.scrollTop();- }-- if((this.offsetParent[0] == document.body) //This needs to be actually done for all browsers, since pageX/pageY includes this information- || (this.offsetParent[0].tagName && this.offsetParent[0].tagName.toLowerCase() == 'html' && $.ui.ie)) //Ugly IE fix- po = { top: 0, left: 0 };-- return {- top: po.top + (parseInt(this.offsetParent.css("borderTopWidth"),10) || 0),- left: po.left + (parseInt(this.offsetParent.css("borderLeftWidth"),10) || 0)- };-- },-- _getRelativeOffset: function() {-- if(this.cssPosition == "relative") {- var p = this.element.position();- return {- top: p.top - (parseInt(this.helper.css("top"),10) || 0) + this.scrollParent.scrollTop(),- left: p.left - (parseInt(this.helper.css("left"),10) || 0) + this.scrollParent.scrollLeft()- };- } else {- 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 o = this.options;- if(o.containment == 'parent') o.containment = this.helper[0].parentNode;- if(o.containment == 'document' || o.containment == 'window') this.containment = [- o.containment == 'document' ? 0 : $(window).scrollLeft() - this.offset.relative.left - this.offset.parent.left,- o.containment == 'document' ? 0 : $(window).scrollTop() - this.offset.relative.top - this.offset.parent.top,- (o.containment == 'document' ? 0 : $(window).scrollLeft()) + $(o.containment == 'document' ? document : window).width() - this.helperProportions.width - this.margins.left,- (o.containment == 'document' ? 0 : $(window).scrollTop()) + ($(o.containment == 'document' ? document : window).height() || document.body.parentNode.scrollHeight) - this.helperProportions.height - this.margins.top- ];-- if(!(/^(document|window|parent)$/).test(o.containment) && o.containment.constructor != Array) {- var c = $(o.containment);- var ce = c[0]; if(!ce) return;- var co = c.offset();- var over = ($(ce).css("overflow") != 'hidden');-- this.containment = [- (parseInt($(ce).css("borderLeftWidth"),10) || 0) + (parseInt($(ce).css("paddingLeft"),10) || 0),- (parseInt($(ce).css("borderTopWidth"),10) || 0) + (parseInt($(ce).css("paddingTop"),10) || 0),- (over ? Math.max(ce.scrollWidth,ce.offsetWidth) : ce.offsetWidth) - (parseInt($(ce).css("borderLeftWidth"),10) || 0) - (parseInt($(ce).css("paddingRight"),10) || 0) - this.helperProportions.width - this.margins.left - this.margins.right,- (over ? Math.max(ce.scrollHeight,ce.offsetHeight) : ce.offsetHeight) - (parseInt($(ce).css("borderTopWidth"),10) || 0) - (parseInt($(ce).css("paddingBottom"),10) || 0) - this.helperProportions.height - this.margins.top - this.margins.bottom- ];- this.relative_container = c;-- } else if(o.containment.constructor == Array) {- this.containment = o.containment;- }-- },-- _convertPositionTo: function(d, pos) {-- if(!pos) pos = this.position;- var mod = d == "absolute" ? 1 : -1;- var o = this.options, scroll = this.cssPosition == 'absolute' && !(this.scrollParent[0] != document && $.contains(this.scrollParent[0], this.offsetParent[0])) ? this.offsetParent : this.scrollParent, scrollIsRootNode = (/(html|body)/i).test(scroll[0].tagName);-- return {- top: (- pos.top // The absolute mouse position- + this.offset.relative.top * mod // Only for relative positioned nodes: Relative offset from element to offset parent- + this.offset.parent.top * mod // The offsetParent's offset without borders (offset + border)- - ( ( this.cssPosition == 'fixed' ? -this.scrollParent.scrollTop() : ( scrollIsRootNode ? 0 : scroll.scrollTop() ) ) * mod)- ),- left: (- pos.left // The absolute mouse position- + this.offset.relative.left * mod // Only for relative positioned nodes: Relative offset from element to offset parent- + this.offset.parent.left * mod // The offsetParent's offset without borders (offset + border)- - ( ( this.cssPosition == 'fixed' ? -this.scrollParent.scrollLeft() : scrollIsRootNode ? 0 : scroll.scrollLeft() ) * mod)- )- };-- },-- _generatePosition: function(event) {-- var o = this.options, scroll = this.cssPosition == 'absolute' && !(this.scrollParent[0] != document && $.contains(this.scrollParent[0], this.offsetParent[0])) ? this.offsetParent : this.scrollParent, scrollIsRootNode = (/(html|body)/i).test(scroll[0].tagName);- var pageX = event.pageX;- var pageY = event.pageY;-- /*- * - Position constraining -- * Constrain the position to a mix of grid, containment.- */-- if(this.originalPosition) { //If we are not dragging yet, we won't check for options- var containment;- if(this.containment) {- if (this.relative_container){- var co = this.relative_container.offset();- containment = [ this.containment[0] + co.left,- this.containment[1] + co.top,- this.containment[2] + co.left,- this.containment[3] + co.top ];- }- else {- containment = this.containment;- }-- if(event.pageX - this.offset.click.left < containment[0]) pageX = containment[0] + this.offset.click.left;- if(event.pageY - this.offset.click.top < containment[1]) pageY = containment[1] + this.offset.click.top;- if(event.pageX - this.offset.click.left > containment[2]) pageX = containment[2] + this.offset.click.left;- if(event.pageY - this.offset.click.top > containment[3]) pageY = containment[3] + this.offset.click.top;- }-- if(o.grid) {- //Check for grid elements set to 0 to prevent divide by 0 error causing invalid argument errors in IE (see ticket #6950)- var top = o.grid[1] ? this.originalPageY + Math.round((pageY - this.originalPageY) / o.grid[1]) * o.grid[1] : this.originalPageY;- pageY = containment ? (!(top - this.offset.click.top < containment[1] || top - this.offset.click.top > containment[3]) ? top : (!(top - this.offset.click.top < containment[1]) ? top - o.grid[1] : top + o.grid[1])) : top;-- var left = o.grid[0] ? this.originalPageX + Math.round((pageX - this.originalPageX) / o.grid[0]) * o.grid[0] : this.originalPageX;- pageX = containment ? (!(left - this.offset.click.left < containment[0] || left - this.offset.click.left > containment[2]) ? left : (!(left - this.offset.click.left < containment[0]) ? left - o.grid[0] : left + o.grid[0])) : left;- }-- }-- return {- top: (- pageY // The absolute mouse position- - this.offset.click.top // Click offset (relative to the element)- - this.offset.relative.top // Only for relative positioned nodes: Relative offset from element to offset parent- - this.offset.parent.top // The offsetParent's offset without borders (offset + border)- + ( ( this.cssPosition == 'fixed' ? -this.scrollParent.scrollTop() : ( scrollIsRootNode ? 0 : scroll.scrollTop() ) ))- ),- left: (- pageX // The absolute mouse position- - this.offset.click.left // Click offset (relative to the element)- - this.offset.relative.left // Only for relative positioned nodes: Relative offset from element to offset parent- - this.offset.parent.left // The offsetParent's offset without borders (offset + border)- + ( ( this.cssPosition == 'fixed' ? -this.scrollParent.scrollLeft() : scrollIsRootNode ? 0 : scroll.scrollLeft() ))- )- };-- },-- _clear: function() {- this.helper.removeClass("ui-draggable-dragging");- if(this.helper[0] != this.element[0] && !this.cancelHelperRemoval) this.helper.remove();- //if($.ui.ddmanager) $.ui.ddmanager.current = null;- this.helper = null;- this.cancelHelperRemoval = false;- },-- // From now on bulk stuff - mainly helpers-- _trigger: function(type, event, ui) {- ui = ui || this._uiHash();- $.ui.plugin.call(this, type, [event, ui]);- if(type == "drag") this.positionAbs = this._convertPositionTo("absolute"); //The absolute position has to be recalculated after plugins- return $.Widget.prototype._trigger.call(this, type, event, ui);- },-- plugins: {},-- _uiHash: function(event) {- return {- helper: this.helper,- position: this.position,- originalPosition: this.originalPosition,- offset: this.positionAbs- };- }--});--$.ui.plugin.add("draggable", "connectToSortable", {- start: function(event, ui) {-- var inst = $(this).data("draggable"), o = inst.options,- uiSortable = $.extend({}, ui, { item: inst.element });- inst.sortables = [];- $(o.connectToSortable).each(function() {- var sortable = $.data(this, 'sortable');- if (sortable && !sortable.options.disabled) {- inst.sortables.push({- instance: sortable,- shouldRevert: sortable.options.revert- });- sortable.refreshPositions(); // Call the sortable's refreshPositions at drag start to refresh the containerCache since the sortable container cache is used in drag and needs to be up to date (this will ensure it's initialised as well as being kept in step with any changes that might have happened on the page).- sortable._trigger("activate", event, uiSortable);- }- });-- },- stop: function(event, ui) {-- //If we are still over the sortable, we fake the stop event of the sortable, but also remove helper- var inst = $(this).data("draggable"),- uiSortable = $.extend({}, ui, { item: inst.element });-- $.each(inst.sortables, function() {- if(this.instance.isOver) {-- this.instance.isOver = 0;-- inst.cancelHelperRemoval = true; //Don't remove the helper in the draggable instance- this.instance.cancelHelperRemoval = false; //Remove it in the sortable instance (so sortable plugins like revert still work)-- //The sortable revert is supported, and we have to set a temporary dropped variable on the draggable to support revert: 'valid/invalid'- if(this.shouldRevert) this.instance.options.revert = true;-- //Trigger the stop of the sortable- this.instance._mouseStop(event);-- this.instance.options.helper = this.instance.options._helper;-- //If the helper has been the original item, restore properties in the sortable- if(inst.options.helper == 'original')- this.instance.currentItem.css({ top: 'auto', left: 'auto' });-- } else {- this.instance.cancelHelperRemoval = false; //Remove the helper in the sortable instance- this.instance._trigger("deactivate", event, uiSortable);- }-- });-- },- drag: function(event, ui) {-- var inst = $(this).data("draggable"), that = this;-- var checkPos = function(o) {- var dyClick = this.offset.click.top, dxClick = this.offset.click.left;- var helperTop = this.positionAbs.top, helperLeft = this.positionAbs.left;- var itemHeight = o.height, itemWidth = o.width;- var itemTop = o.top, itemLeft = o.left;-- return $.ui.isOver(helperTop + dyClick, helperLeft + dxClick, itemTop, itemLeft, itemHeight, itemWidth);- };-- $.each(inst.sortables, function(i) {-- var innermostIntersecting = false;- var thisSortable = this;- //Copy over some variables to allow calling the sortable's native _intersectsWith- this.instance.positionAbs = inst.positionAbs;- this.instance.helperProportions = inst.helperProportions;- this.instance.offset.click = inst.offset.click;-- if(this.instance._intersectsWith(this.instance.containerCache)) {- innermostIntersecting = true;- $.each(inst.sortables, function () {- this.instance.positionAbs = inst.positionAbs;- this.instance.helperProportions = inst.helperProportions;- this.instance.offset.click = inst.offset.click;- if (this != thisSortable- && this.instance._intersectsWith(this.instance.containerCache)- && $.ui.contains(thisSortable.instance.element[0], this.instance.element[0]))- innermostIntersecting = false;- return innermostIntersecting;- });- }--- if(innermostIntersecting) {- //If it intersects, we use a little isOver variable and set it once, so our move-in stuff gets fired only once- if(!this.instance.isOver) {-- this.instance.isOver = 1;- //Now we fake the start of dragging for the sortable instance,- //by cloning the list group item, appending it to the sortable and using it as inst.currentItem- //We can then fire the start event of the sortable with our passed browser event, and our own helper (so it doesn't create a new one)- this.instance.currentItem = $(that).clone().removeAttr('id').appendTo(this.instance.element).data("sortable-item", true);- this.instance.options._helper = this.instance.options.helper; //Store helper option to later restore it- this.instance.options.helper = function() { return ui.helper[0]; };-- event.target = this.instance.currentItem[0];- this.instance._mouseCapture(event, true);- this.instance._mouseStart(event, true, true);-- //Because the browser event is way off the new appended portlet, we modify a couple of variables to reflect the changes- this.instance.offset.click.top = inst.offset.click.top;- this.instance.offset.click.left = inst.offset.click.left;- this.instance.offset.parent.left -= inst.offset.parent.left - this.instance.offset.parent.left;- this.instance.offset.parent.top -= inst.offset.parent.top - this.instance.offset.parent.top;-- inst._trigger("toSortable", event);- inst.dropped = this.instance.element; //draggable revert needs that- //hack so receive/update callbacks work (mostly)- inst.currentItem = inst.element;- this.instance.fromOutside = inst;-- }-- //Provided we did all the previous steps, we can fire the drag event of the sortable on every draggable drag, when it intersects with the sortable- if(this.instance.currentItem) this.instance._mouseDrag(event);-- } else {-- //If it doesn't intersect with the sortable, and it intersected before,- //we fake the drag stop of the sortable, but make sure it doesn't remove the helper by using cancelHelperRemoval- if(this.instance.isOver) {-- this.instance.isOver = 0;- this.instance.cancelHelperRemoval = true;-- //Prevent reverting on this forced stop- this.instance.options.revert = false;-- // The out event needs to be triggered independently- this.instance._trigger('out', event, this.instance._uiHash(this.instance));-- this.instance._mouseStop(event, true);- this.instance.options.helper = this.instance.options._helper;-- //Now we remove our currentItem, the list group clone again, and the placeholder, and animate the helper back to it's original size- this.instance.currentItem.remove();- if(this.instance.placeholder) this.instance.placeholder.remove();-- inst._trigger("fromSortable", event);- inst.dropped = false; //draggable revert needs that- }-- };-- });-- }-});--$.ui.plugin.add("draggable", "cursor", {- start: function(event, ui) {- var t = $('body'), o = $(this).data('draggable').options;- if (t.css("cursor")) o._cursor = t.css("cursor");- t.css("cursor", o.cursor);- },- stop: function(event, ui) {- var o = $(this).data('draggable').options;- if (o._cursor) $('body').css("cursor", o._cursor);- }-});--$.ui.plugin.add("draggable", "opacity", {- start: function(event, ui) {- var t = $(ui.helper), o = $(this).data('draggable').options;- if(t.css("opacity")) o._opacity = t.css("opacity");- t.css('opacity', o.opacity);- },- stop: function(event, ui) {- var o = $(this).data('draggable').options;- if(o._opacity) $(ui.helper).css('opacity', o._opacity);- }-});--$.ui.plugin.add("draggable", "scroll", {- start: function(event, ui) {- var i = $(this).data("draggable");- if(i.scrollParent[0] != document && i.scrollParent[0].tagName != 'HTML') i.overflowOffset = i.scrollParent.offset();- },- drag: function(event, ui) {-- var i = $(this).data("draggable"), o = i.options, scrolled = false;-- if(i.scrollParent[0] != document && i.scrollParent[0].tagName != 'HTML') {-- if(!o.axis || o.axis != 'x') {- if((i.overflowOffset.top + i.scrollParent[0].offsetHeight) - event.pageY < o.scrollSensitivity)- i.scrollParent[0].scrollTop = scrolled = i.scrollParent[0].scrollTop + o.scrollSpeed;- else if(event.pageY - i.overflowOffset.top < o.scrollSensitivity)- i.scrollParent[0].scrollTop = scrolled = i.scrollParent[0].scrollTop - o.scrollSpeed;- }-- if(!o.axis || o.axis != 'y') {- if((i.overflowOffset.left + i.scrollParent[0].offsetWidth) - event.pageX < o.scrollSensitivity)- i.scrollParent[0].scrollLeft = scrolled = i.scrollParent[0].scrollLeft + o.scrollSpeed;- else if(event.pageX - i.overflowOffset.left < o.scrollSensitivity)- i.scrollParent[0].scrollLeft = scrolled = i.scrollParent[0].scrollLeft - o.scrollSpeed;- }-- } else {-- if(!o.axis || o.axis != 'x') {- if(event.pageY - $(document).scrollTop() < o.scrollSensitivity)- scrolled = $(document).scrollTop($(document).scrollTop() - o.scrollSpeed);- else if($(window).height() - (event.pageY - $(document).scrollTop()) < o.scrollSensitivity)- scrolled = $(document).scrollTop($(document).scrollTop() + o.scrollSpeed);- }-- if(!o.axis || o.axis != 'y') {- if(event.pageX - $(document).scrollLeft() < o.scrollSensitivity)- scrolled = $(document).scrollLeft($(document).scrollLeft() - o.scrollSpeed);- else if($(window).width() - (event.pageX - $(document).scrollLeft()) < o.scrollSensitivity)- scrolled = $(document).scrollLeft($(document).scrollLeft() + o.scrollSpeed);- }-- }-- if(scrolled !== false && $.ui.ddmanager && !o.dropBehaviour)- $.ui.ddmanager.prepareOffsets(i, event);-- }-});--$.ui.plugin.add("draggable", "snap", {- start: function(event, ui) {-- var i = $(this).data("draggable"), o = i.options;- i.snapElements = [];-- $(o.snap.constructor != String ? ( o.snap.items || ':data(draggable)' ) : o.snap).each(function() {- var $t = $(this); var $o = $t.offset();- if(this != i.element[0]) i.snapElements.push({- item: this,- width: $t.outerWidth(), height: $t.outerHeight(),- top: $o.top, left: $o.left- });- });-- },- drag: function(event, ui) {-- var inst = $(this).data("draggable"), o = inst.options;- var d = o.snapTolerance;-- var x1 = ui.offset.left, x2 = x1 + inst.helperProportions.width,- y1 = ui.offset.top, y2 = y1 + inst.helperProportions.height;-- for (var i = inst.snapElements.length - 1; i >= 0; i--){-- var l = inst.snapElements[i].left, r = l + inst.snapElements[i].width,- t = inst.snapElements[i].top, b = t + inst.snapElements[i].height;-- //Yes, I know, this is insane ;)- if(!((l-d < x1 && x1 < r+d && t-d < y1 && y1 < b+d) || (l-d < x1 && x1 < r+d && t-d < y2 && y2 < b+d) || (l-d < x2 && x2 < r+d && t-d < y1 && y1 < b+d) || (l-d < x2 && x2 < r+d && t-d < y2 && y2 < b+d))) {- if(inst.snapElements[i].snapping) (inst.options.snap.release && inst.options.snap.release.call(inst.element, event, $.extend(inst._uiHash(), { snapItem: inst.snapElements[i].item })));- inst.snapElements[i].snapping = false;- continue;- }-- if(o.snapMode != 'inner') {- var ts = Math.abs(t - y2) <= d;- var bs = Math.abs(b - y1) <= d;- var ls = Math.abs(l - x2) <= d;- var rs = Math.abs(r - x1) <= d;- if(ts) ui.position.top = inst._convertPositionTo("relative", { top: t - inst.helperProportions.height, left: 0 }).top - inst.margins.top;- if(bs) ui.position.top = inst._convertPositionTo("relative", { top: b, left: 0 }).top - inst.margins.top;- if(ls) ui.position.left = inst._convertPositionTo("relative", { top: 0, left: l - inst.helperProportions.width }).left - inst.margins.left;- if(rs) ui.position.left = inst._convertPositionTo("relative", { top: 0, left: r }).left - inst.margins.left;- }-- var first = (ts || bs || ls || rs);-- if(o.snapMode != 'outer') {- var ts = Math.abs(t - y1) <= d;- var bs = Math.abs(b - y2) <= d;- var ls = Math.abs(l - x1) <= d;- var rs = Math.abs(r - x2) <= d;- if(ts) ui.position.top = inst._convertPositionTo("relative", { top: t, left: 0 }).top - inst.margins.top;- if(bs) ui.position.top = inst._convertPositionTo("relative", { top: b - inst.helperProportions.height, left: 0 }).top - inst.margins.top;- if(ls) ui.position.left = inst._convertPositionTo("relative", { top: 0, left: l }).left - inst.margins.left;- if(rs) ui.position.left = inst._convertPositionTo("relative", { top: 0, left: r - inst.helperProportions.width }).left - inst.margins.left;- }-- if(!inst.snapElements[i].snapping && (ts || bs || ls || rs || first))- (inst.options.snap.snap && inst.options.snap.snap.call(inst.element, event, $.extend(inst._uiHash(), { snapItem: inst.snapElements[i].item })));- inst.snapElements[i].snapping = (ts || bs || ls || rs || first);-- };-- }-});--$.ui.plugin.add("draggable", "stack", {- start: function(event, ui) {-- var o = $(this).data("draggable").options;-- var group = $.makeArray($(o.stack)).sort(function(a,b) {- return (parseInt($(a).css("zIndex"),10) || 0) - (parseInt($(b).css("zIndex"),10) || 0);- });- if (!group.length) { return; }-- var min = parseInt(group[0].style.zIndex) || 0;- $(group).each(function(i) {- this.style.zIndex = min + i;- });-- this[0].style.zIndex = min + group.length;-- }-});--$.ui.plugin.add("draggable", "zIndex", {- start: function(event, ui) {- var t = $(ui.helper), o = $(this).data("draggable").options;- if(t.css("zIndex")) o._zIndex = t.css("zIndex");- t.css('zIndex', o.zIndex);- },- stop: function(event, ui) {- var o = $(this).data("draggable").options;- if(o._zIndex) $(ui.helper).css('zIndex', o._zIndex);- }-});--})(jQuery);-(function( $, undefined ) {--$.widget("ui.droppable", {- version: "1.9.1",- widgetEventPrefix: "drop",- options: {- accept: '*',- activeClass: false,- addClasses: true,- greedy: false,- hoverClass: false,- scope: 'default',- tolerance: 'intersect'- },- _create: function() {-- var o = this.options, accept = o.accept;- this.isover = 0; this.isout = 1;-- this.accept = $.isFunction(accept) ? accept : function(d) {- return d.is(accept);- };-- //Store the droppable's proportions- this.proportions = { width: this.element[0].offsetWidth, height: this.element[0].offsetHeight };-- // Add the reference and positions to the manager- $.ui.ddmanager.droppables[o.scope] = $.ui.ddmanager.droppables[o.scope] || [];- $.ui.ddmanager.droppables[o.scope].push(this);-- (o.addClasses && this.element.addClass("ui-droppable"));-- },-- _destroy: function() {- var drop = $.ui.ddmanager.droppables[this.options.scope];- for ( var i = 0; i < drop.length; i++ )- if ( drop[i] == this )- drop.splice(i, 1);-- this.element.removeClass("ui-droppable ui-droppable-disabled");- },-- _setOption: function(key, value) {-- if(key == 'accept') {- this.accept = $.isFunction(value) ? value : function(d) {- return d.is(value);- };- }- $.Widget.prototype._setOption.apply(this, arguments);- },-- _activate: function(event) {- var draggable = $.ui.ddmanager.current;- if(this.options.activeClass) this.element.addClass(this.options.activeClass);- (draggable && this._trigger('activate', event, this.ui(draggable)));- },-- _deactivate: function(event) {- var draggable = $.ui.ddmanager.current;- if(this.options.activeClass) this.element.removeClass(this.options.activeClass);- (draggable && this._trigger('deactivate', event, this.ui(draggable)));- },-- _over: function(event) {-- var draggable = $.ui.ddmanager.current;- if (!draggable || (draggable.currentItem || draggable.element)[0] == this.element[0]) return; // Bail if draggable and droppable are same element-- if (this.accept.call(this.element[0],(draggable.currentItem || draggable.element))) {- if(this.options.hoverClass) this.element.addClass(this.options.hoverClass);- this._trigger('over', event, this.ui(draggable));- }-- },-- _out: function(event) {-- var draggable = $.ui.ddmanager.current;- if (!draggable || (draggable.currentItem || draggable.element)[0] == this.element[0]) return; // Bail if draggable and droppable are same element-- if (this.accept.call(this.element[0],(draggable.currentItem || draggable.element))) {- if(this.options.hoverClass) this.element.removeClass(this.options.hoverClass);- this._trigger('out', event, this.ui(draggable));- }-- },-- _drop: function(event,custom) {-- var draggable = custom || $.ui.ddmanager.current;- if (!draggable || (draggable.currentItem || draggable.element)[0] == this.element[0]) return false; // Bail if draggable and droppable are same element-- var childrenIntersection = false;- this.element.find(":data(droppable)").not(".ui-draggable-dragging").each(function() {- var inst = $.data(this, 'droppable');- if(- inst.options.greedy- && !inst.options.disabled- && inst.options.scope == draggable.options.scope- && inst.accept.call(inst.element[0], (draggable.currentItem || draggable.element))- && $.ui.intersect(draggable, $.extend(inst, { offset: inst.element.offset() }), inst.options.tolerance)- ) { childrenIntersection = true; return false; }- });- if(childrenIntersection) return false;-- if(this.accept.call(this.element[0],(draggable.currentItem || draggable.element))) {- if(this.options.activeClass) this.element.removeClass(this.options.activeClass);- if(this.options.hoverClass) this.element.removeClass(this.options.hoverClass);- this._trigger('drop', event, this.ui(draggable));- return this.element;- }-- return false;-- },-- ui: function(c) {- return {- draggable: (c.currentItem || c.element),- helper: c.helper,- position: c.position,- offset: c.positionAbs- };- }--});--$.ui.intersect = function(draggable, droppable, toleranceMode) {-- if (!droppable.offset) return false;-- var x1 = (draggable.positionAbs || draggable.position.absolute).left, x2 = x1 + draggable.helperProportions.width,- y1 = (draggable.positionAbs || draggable.position.absolute).top, y2 = y1 + draggable.helperProportions.height;- var l = droppable.offset.left, r = l + droppable.proportions.width,- t = droppable.offset.top, b = t + droppable.proportions.height;-- switch (toleranceMode) {- case 'fit':- return (l <= x1 && x2 <= r- && t <= y1 && y2 <= b);- break;- case 'intersect':- return (l < x1 + (draggable.helperProportions.width / 2) // Right Half- && x2 - (draggable.helperProportions.width / 2) < r // Left Half- && t < y1 + (draggable.helperProportions.height / 2) // Bottom Half- && y2 - (draggable.helperProportions.height / 2) < b ); // Top Half- break;- case 'pointer':- var draggableLeft = ((draggable.positionAbs || draggable.position.absolute).left + (draggable.clickOffset || draggable.offset.click).left),- draggableTop = ((draggable.positionAbs || draggable.position.absolute).top + (draggable.clickOffset || draggable.offset.click).top),- isOver = $.ui.isOver(draggableTop, draggableLeft, t, l, droppable.proportions.height, droppable.proportions.width);- return isOver;- break;- case 'touch':- return (- (y1 >= t && y1 <= b) || // Top edge touching- (y2 >= t && y2 <= b) || // Bottom edge touching- (y1 < t && y2 > b) // Surrounded vertically- ) && (- (x1 >= l && x1 <= r) || // Left edge touching- (x2 >= l && x2 <= r) || // Right edge touching- (x1 < l && x2 > r) // Surrounded horizontally- );- break;- default:- return false;- break;- }--};--/*- This manager tracks offsets of draggables and droppables-*/-$.ui.ddmanager = {- current: null,- droppables: { 'default': [] },- prepareOffsets: function(t, event) {-- var m = $.ui.ddmanager.droppables[t.options.scope] || [];- var type = event ? event.type : null; // workaround for #2317- var list = (t.currentItem || t.element).find(":data(droppable)").andSelf();-- droppablesLoop: for (var i = 0; i < m.length; i++) {-- if(m[i].options.disabled || (t && !m[i].accept.call(m[i].element[0],(t.currentItem || t.element)))) continue; //No disabled and non-accepted- for (var j=0; j < list.length; j++) { if(list[j] == m[i].element[0]) { m[i].proportions.height = 0; continue droppablesLoop; } }; //Filter out elements in the current dragged item- m[i].visible = m[i].element.css("display") != "none"; if(!m[i].visible) continue; //If the element is not visible, continue-- if(type == "mousedown") m[i]._activate.call(m[i], event); //Activate the droppable if used directly from draggables-- m[i].offset = m[i].element.offset();- m[i].proportions = { width: m[i].element[0].offsetWidth, height: m[i].element[0].offsetHeight };-- }-- },- drop: function(draggable, event) {-- var dropped = false;- $.each($.ui.ddmanager.droppables[draggable.options.scope] || [], function() {-- if(!this.options) return;- if (!this.options.disabled && this.visible && $.ui.intersect(draggable, this, this.options.tolerance))- dropped = this._drop.call(this, event) || dropped;-- if (!this.options.disabled && this.visible && this.accept.call(this.element[0],(draggable.currentItem || draggable.element))) {- this.isout = 1; this.isover = 0;- this._deactivate.call(this, event);- }-- });- return dropped;-- },- dragStart: function( draggable, event ) {- //Listen for scrolling so that if the dragging causes scrolling the position of the droppables can be recalculated (see #5003)- draggable.element.parentsUntil( "body" ).bind( "scroll.droppable", function() {- if( !draggable.options.refreshPositions ) $.ui.ddmanager.prepareOffsets( draggable, event );- });- },- drag: function(draggable, event) {-- //If you have a highly dynamic page, you might try this option. It renders positions every time you move the mouse.- if(draggable.options.refreshPositions) $.ui.ddmanager.prepareOffsets(draggable, event);-- //Run through all droppables and check their positions based on specific tolerance options- $.each($.ui.ddmanager.droppables[draggable.options.scope] || [], function() {-- if(this.options.disabled || this.greedyChild || !this.visible) return;- var intersects = $.ui.intersect(draggable, this, this.options.tolerance);-- var c = !intersects && this.isover == 1 ? 'isout' : (intersects && this.isover == 0 ? 'isover' : null);- if(!c) return;-- var parentInstance;- if (this.options.greedy) {- // find droppable parents with same scope- var scope = this.options.scope;- var parent = this.element.parents(':data(droppable)').filter(function () {- return $.data(this, 'droppable').options.scope === scope;- });-- if (parent.length) {- parentInstance = $.data(parent[0], 'droppable');- parentInstance.greedyChild = (c == 'isover' ? 1 : 0);- }- }-- // we just moved into a greedy child- if (parentInstance && c == 'isover') {- parentInstance['isover'] = 0;- parentInstance['isout'] = 1;- parentInstance._out.call(parentInstance, event);- }-- this[c] = 1; this[c == 'isout' ? 'isover' : 'isout'] = 0;- this[c == "isover" ? "_over" : "_out"].call(this, event);-- // we just moved out of a greedy child- if (parentInstance && c == 'isout') {- parentInstance['isout'] = 0;- parentInstance['isover'] = 1;- parentInstance._over.call(parentInstance, event);- }- });-- },- dragStop: function( draggable, event ) {- draggable.element.parentsUntil( "body" ).unbind( "scroll.droppable" );- //Call prepareOffsets one final time since IE does not fire return scroll events when overflow was caused by drag (see #5003)- if( !draggable.options.refreshPositions ) $.ui.ddmanager.prepareOffsets( draggable, event );- }-};--})(jQuery);-(function( $, undefined ) {--$.widget("ui.resizable", $.ui.mouse, {- version: "1.9.1",- widgetEventPrefix: "resize",- options: {- alsoResize: false,- animate: false,- animateDuration: "slow",- animateEasing: "swing",- aspectRatio: false,- autoHide: false,- containment: false,- ghost: false,- grid: false,- handles: "e,s,se",- helper: false,- maxHeight: null,- maxWidth: null,- minHeight: 10,- minWidth: 10,- zIndex: 1000- },- _create: function() {-- var that = this, o = this.options;- this.element.addClass("ui-resizable");-- $.extend(this, {- _aspectRatio: !!(o.aspectRatio),- aspectRatio: o.aspectRatio,- originalElement: this.element,- _proportionallyResizeElements: [],- _helper: o.helper || o.ghost || o.animate ? o.helper || 'ui-resizable-helper' : null- });-- //Wrap the element if it cannot hold child nodes- if(this.element[0].nodeName.match(/canvas|textarea|input|select|button|img/i)) {-- //Create a wrapper element and set the wrapper to the new current internal element- this.element.wrap(- $('<div class="ui-wrapper" style="overflow: hidden;"></div>').css({- position: this.element.css('position'),- width: this.element.outerWidth(),- height: this.element.outerHeight(),- top: this.element.css('top'),- left: this.element.css('left')- })- );-- //Overwrite the original this.element- this.element = this.element.parent().data(- "resizable", this.element.data('resizable')- );-- this.elementIsWrapper = true;-- //Move margins to the wrapper- this.element.css({ marginLeft: this.originalElement.css("marginLeft"), marginTop: this.originalElement.css("marginTop"), marginRight: this.originalElement.css("marginRight"), marginBottom: this.originalElement.css("marginBottom") });- this.originalElement.css({ marginLeft: 0, marginTop: 0, marginRight: 0, marginBottom: 0});-- //Prevent Safari textarea resize- this.originalResizeStyle = this.originalElement.css('resize');- this.originalElement.css('resize', 'none');-- //Push the actual element to our proportionallyResize internal array- this._proportionallyResizeElements.push(this.originalElement.css({ position: 'static', zoom: 1, display: 'block' }));-- // avoid IE jump (hard set the margin)- this.originalElement.css({ margin: this.originalElement.css('margin') });-- // fix handlers offset- this._proportionallyResize();-- }-- this.handles = o.handles || (!$('.ui-resizable-handle', this.element).length ? "e,s,se" : { 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' });- if(this.handles.constructor == String) {-- if(this.handles == 'all') this.handles = 'n,e,s,w,se,sw,ne,nw';- var n = this.handles.split(","); this.handles = {};-- for(var i = 0; i < n.length; i++) {-- var handle = $.trim(n[i]), hname = 'ui-resizable-'+handle;- var axis = $('<div class="ui-resizable-handle ' + hname + '"></div>');-- // Apply zIndex to all handles - see #7960- axis.css({ zIndex: o.zIndex });-- //TODO : What's going on here?- if ('se' == handle) {- axis.addClass('ui-icon ui-icon-gripsmall-diagonal-se');- };-- //Insert into internal handles object and append to element- this.handles[handle] = '.ui-resizable-'+handle;- this.element.append(axis);- }-- }-- this._renderAxis = function(target) {-- target = target || this.element;-- for(var i in this.handles) {-- if(this.handles[i].constructor == String)- this.handles[i] = $(this.handles[i], this.element).show();-- //Apply pad to wrapper element, needed to fix axis position (textarea, inputs, scrolls)- if (this.elementIsWrapper && this.originalElement[0].nodeName.match(/textarea|input|select|button/i)) {-- var axis = $(this.handles[i], this.element), padWrapper = 0;-- //Checking the correct pad and border- padWrapper = /sw|ne|nw|se|n|s/.test(i) ? axis.outerHeight() : axis.outerWidth();-- //The padding type i have to apply...- var padPos = [ 'padding',- /ne|nw|n/.test(i) ? 'Top' :- /se|sw|s/.test(i) ? 'Bottom' :- /^e$/.test(i) ? 'Right' : 'Left' ].join("");-- target.css(padPos, padWrapper);-- this._proportionallyResize();-- }-- //TODO: What's that good for? There's not anything to be executed left- if(!$(this.handles[i]).length)- continue;-- }- };-- //TODO: make renderAxis a prototype function- this._renderAxis(this.element);-- this._handles = $('.ui-resizable-handle', this.element)- .disableSelection();-- //Matching axis name- this._handles.mouseover(function() {- if (!that.resizing) {- if (this.className)- var axis = this.className.match(/ui-resizable-(se|sw|ne|nw|n|e|s|w)/i);- //Axis, default = se- that.axis = axis && axis[1] ? axis[1] : 'se';- }- });-- //If we want to auto hide the elements- if (o.autoHide) {- this._handles.hide();- $(this.element)- .addClass("ui-resizable-autohide")- .mouseenter(function() {- if (o.disabled) return;- $(this).removeClass("ui-resizable-autohide");- that._handles.show();- })- .mouseleave(function(){- if (o.disabled) return;- if (!that.resizing) {- $(this).addClass("ui-resizable-autohide");- that._handles.hide();- }- });- }-- //Initialize the mouse interaction- this._mouseInit();-- },-- _destroy: function() {-- this._mouseDestroy();-- var _destroy = function(exp) {- $(exp).removeClass("ui-resizable ui-resizable-disabled ui-resizable-resizing")- .removeData("resizable").removeData("ui-resizable").unbind(".resizable").find('.ui-resizable-handle').remove();- };-- //TODO: Unwrap at same DOM position- if (this.elementIsWrapper) {- _destroy(this.element);- var wrapper = this.element;- this.originalElement.css({- position: wrapper.css('position'),- width: wrapper.outerWidth(),- height: wrapper.outerHeight(),- top: wrapper.css('top'),- left: wrapper.css('left')- }).insertAfter( wrapper );- wrapper.remove();- }-- this.originalElement.css('resize', this.originalResizeStyle);- _destroy(this.originalElement);-- return this;- },-- _mouseCapture: function(event) {- var handle = false;- for (var i in this.handles) {- if ($(this.handles[i])[0] == event.target) {- handle = true;- }- }-- return !this.options.disabled && handle;- },-- _mouseStart: function(event) {-- var o = this.options, iniPos = this.element.position(), el = this.element;-- this.resizing = true;- this.documentScroll = { top: $(document).scrollTop(), left: $(document).scrollLeft() };-- // bugfix for http://dev.jquery.com/ticket/1749- if (el.is('.ui-draggable') || (/absolute/).test(el.css('position'))) {- el.css({ position: 'absolute', top: iniPos.top, left: iniPos.left });- }-- this._renderProxy();-- var curleft = num(this.helper.css('left')), curtop = num(this.helper.css('top'));-- if (o.containment) {- curleft += $(o.containment).scrollLeft() || 0;- curtop += $(o.containment).scrollTop() || 0;- }-- //Store needed variables- this.offset = this.helper.offset();- this.position = { left: curleft, top: curtop };- this.size = this._helper ? { width: el.outerWidth(), height: el.outerHeight() } : { width: el.width(), height: el.height() };- this.originalSize = this._helper ? { width: el.outerWidth(), height: el.outerHeight() } : { width: el.width(), height: el.height() };- this.originalPosition = { left: curleft, top: curtop };- this.sizeDiff = { width: el.outerWidth() - el.width(), height: el.outerHeight() - el.height() };- this.originalMousePosition = { left: event.pageX, top: event.pageY };-- //Aspect Ratio- this.aspectRatio = (typeof o.aspectRatio == 'number') ? o.aspectRatio : ((this.originalSize.width / this.originalSize.height) || 1);-- var cursor = $('.ui-resizable-' + this.axis).css('cursor');- $('body').css('cursor', cursor == 'auto' ? this.axis + '-resize' : cursor);-- el.addClass("ui-resizable-resizing");- this._propagate("start", event);- return true;- },-- _mouseDrag: function(event) {-- //Increase performance, avoid regex- var el = this.helper, o = this.options, props = {},- that = this, smp = this.originalMousePosition, a = this.axis;-- var dx = (event.pageX-smp.left)||0, dy = (event.pageY-smp.top)||0;- var trigger = this._change[a];- if (!trigger) return false;-- // Calculate the attrs that will be change- var data = trigger.apply(this, [event, dx, dy]);-- // Put this in the mouseDrag handler since the user can start pressing shift while resizing- this._updateVirtualBoundaries(event.shiftKey);- if (this._aspectRatio || event.shiftKey)- data = this._updateRatio(data, event);-- data = this._respectSize(data, event);-- // plugins callbacks need to be called first- this._propagate("resize", event);-- el.css({- top: this.position.top + "px", left: this.position.left + "px",- width: this.size.width + "px", height: this.size.height + "px"- });-- if (!this._helper && this._proportionallyResizeElements.length)- this._proportionallyResize();-- this._updateCache(data);-- // calling the user callback at the end- this._trigger('resize', event, this.ui());-- return false;- },-- _mouseStop: function(event) {-- this.resizing = false;- var o = this.options, that = this;-- if(this._helper) {- var pr = this._proportionallyResizeElements, ista = pr.length && (/textarea/i).test(pr[0].nodeName),- soffseth = ista && $.ui.hasScroll(pr[0], 'left') /* TODO - jump height */ ? 0 : that.sizeDiff.height,- soffsetw = ista ? 0 : that.sizeDiff.width;-- var s = { width: (that.helper.width() - soffsetw), height: (that.helper.height() - soffseth) },- left = (parseInt(that.element.css('left'), 10) + (that.position.left - that.originalPosition.left)) || null,- top = (parseInt(that.element.css('top'), 10) + (that.position.top - that.originalPosition.top)) || null;-- if (!o.animate)- this.element.css($.extend(s, { top: top, left: left }));-- that.helper.height(that.size.height);- that.helper.width(that.size.width);-- if (this._helper && !o.animate) this._proportionallyResize();- }-- $('body').css('cursor', 'auto');-- this.element.removeClass("ui-resizable-resizing");-- this._propagate("stop", event);-- if (this._helper) this.helper.remove();- return false;-- },-- _updateVirtualBoundaries: function(forceAspectRatio) {- var o = this.options, pMinWidth, pMaxWidth, pMinHeight, pMaxHeight, b;-- b = {- minWidth: isNumber(o.minWidth) ? o.minWidth : 0,- maxWidth: isNumber(o.maxWidth) ? o.maxWidth : Infinity,- minHeight: isNumber(o.minHeight) ? o.minHeight : 0,- maxHeight: isNumber(o.maxHeight) ? o.maxHeight : Infinity- };-- if(this._aspectRatio || forceAspectRatio) {- // We want to create an enclosing box whose aspect ration is the requested one- // First, compute the "projected" size for each dimension based on the aspect ratio and other dimension- pMinWidth = b.minHeight * this.aspectRatio;- pMinHeight = b.minWidth / this.aspectRatio;- pMaxWidth = b.maxHeight * this.aspectRatio;- pMaxHeight = b.maxWidth / this.aspectRatio;-- if(pMinWidth > b.minWidth) b.minWidth = pMinWidth;- if(pMinHeight > b.minHeight) b.minHeight = pMinHeight;- if(pMaxWidth < b.maxWidth) b.maxWidth = pMaxWidth;- if(pMaxHeight < b.maxHeight) b.maxHeight = pMaxHeight;- }- this._vBoundaries = b;- },-- _updateCache: function(data) {- var o = this.options;- this.offset = this.helper.offset();- if (isNumber(data.left)) this.position.left = data.left;- if (isNumber(data.top)) this.position.top = data.top;- if (isNumber(data.height)) this.size.height = data.height;- if (isNumber(data.width)) this.size.width = data.width;- },-- _updateRatio: function(data, event) {-- var o = this.options, cpos = this.position, csize = this.size, a = this.axis;-- if (isNumber(data.height)) data.width = (data.height * this.aspectRatio);- else if (isNumber(data.width)) data.height = (data.width / this.aspectRatio);-- if (a == 'sw') {- data.left = cpos.left + (csize.width - data.width);- data.top = null;- }- if (a == 'nw') {- data.top = cpos.top + (csize.height - data.height);- data.left = cpos.left + (csize.width - data.width);- }-- return data;- },-- _respectSize: function(data, event) {-- var el = this.helper, o = this._vBoundaries, pRatio = this._aspectRatio || event.shiftKey, a = this.axis,- ismaxw = isNumber(data.width) && o.maxWidth && (o.maxWidth < data.width), ismaxh = isNumber(data.height) && o.maxHeight && (o.maxHeight < data.height),- isminw = isNumber(data.width) && o.minWidth && (o.minWidth > data.width), isminh = isNumber(data.height) && o.minHeight && (o.minHeight > data.height);-- if (isminw) data.width = o.minWidth;- if (isminh) data.height = o.minHeight;- if (ismaxw) data.width = o.maxWidth;- if (ismaxh) data.height = o.maxHeight;-- var dw = this.originalPosition.left + this.originalSize.width, dh = this.position.top + this.size.height;- var cw = /sw|nw|w/.test(a), ch = /nw|ne|n/.test(a);-- if (isminw && cw) data.left = dw - o.minWidth;- if (ismaxw && cw) data.left = dw - o.maxWidth;- if (isminh && ch) data.top = dh - o.minHeight;- if (ismaxh && ch) data.top = dh - o.maxHeight;-- // fixing jump error on top/left - bug #2330- var isNotwh = !data.width && !data.height;- if (isNotwh && !data.left && data.top) data.top = null;- else if (isNotwh && !data.top && data.left) data.left = null;-- return data;- },-- _proportionallyResize: function() {-- var o = this.options;- if (!this._proportionallyResizeElements.length) return;- var element = this.helper || this.element;-- for (var i=0; i < this._proportionallyResizeElements.length; i++) {-- var prel = this._proportionallyResizeElements[i];-- if (!this.borderDif) {- var b = [prel.css('borderTopWidth'), prel.css('borderRightWidth'), prel.css('borderBottomWidth'), prel.css('borderLeftWidth')],- p = [prel.css('paddingTop'), prel.css('paddingRight'), prel.css('paddingBottom'), prel.css('paddingLeft')];-- this.borderDif = $.map(b, function(v, i) {- var border = parseInt(v,10)||0, padding = parseInt(p[i],10)||0;- return border + padding;- });- }-- prel.css({- height: (element.height() - this.borderDif[0] - this.borderDif[2]) || 0,- width: (element.width() - this.borderDif[1] - this.borderDif[3]) || 0- });-- };-- },-- _renderProxy: function() {-- var el = this.element, o = this.options;- this.elementOffset = el.offset();-- if(this._helper) {-- this.helper = this.helper || $('<div style="overflow:hidden;"></div>');-- // fix ie6 offset TODO: This seems broken- var ie6offset = ($.ui.ie6 ? 1 : 0),- pxyoffset = ( $.ui.ie6 ? 2 : -1 );-- this.helper.addClass(this._helper).css({- width: this.element.outerWidth() + pxyoffset,- height: this.element.outerHeight() + pxyoffset,- position: 'absolute',- left: this.elementOffset.left - ie6offset +'px',- top: this.elementOffset.top - ie6offset +'px',- zIndex: ++o.zIndex //TODO: Don't modify option- });-- this.helper- .appendTo("body")- .disableSelection();-- } else {- this.helper = this.element;- }-- },-- _change: {- e: function(event, dx, dy) {- return { width: this.originalSize.width + dx };- },- w: function(event, dx, dy) {- var o = this.options, cs = this.originalSize, sp = this.originalPosition;- return { left: sp.left + dx, width: cs.width - dx };- },- n: function(event, dx, dy) {- var o = this.options, cs = this.originalSize, sp = this.originalPosition;- return { top: sp.top + dy, height: cs.height - dy };- },- s: function(event, dx, dy) {- return { height: this.originalSize.height + dy };- },- se: function(event, dx, dy) {- return $.extend(this._change.s.apply(this, arguments), this._change.e.apply(this, [event, dx, dy]));- },- sw: function(event, dx, dy) {- return $.extend(this._change.s.apply(this, arguments), this._change.w.apply(this, [event, dx, dy]));- },- ne: function(event, dx, dy) {- return $.extend(this._change.n.apply(this, arguments), this._change.e.apply(this, [event, dx, dy]));- },- nw: function(event, dx, dy) {- return $.extend(this._change.n.apply(this, arguments), this._change.w.apply(this, [event, dx, dy]));- }- },-- _propagate: function(n, event) {- $.ui.plugin.call(this, n, [event, this.ui()]);- (n != "resize" && this._trigger(n, event, 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- };- }--});--/*- * Resizable Extensions- */--$.ui.plugin.add("resizable", "alsoResize", {-- start: function (event, ui) {- var that = $(this).data("resizable"), o = that.options;-- var _store = function (exp) {- $(exp).each(function() {- var el = $(this);- el.data("resizable-alsoresize", {- width: parseInt(el.width(), 10), height: parseInt(el.height(), 10),- left: parseInt(el.css('left'), 10), top: parseInt(el.css('top'), 10)- });- });- };-- if (typeof(o.alsoResize) == 'object' && !o.alsoResize.parentNode) {- if (o.alsoResize.length) { o.alsoResize = o.alsoResize[0]; _store(o.alsoResize); }- else { $.each(o.alsoResize, function (exp) { _store(exp); }); }- }else{- _store(o.alsoResize);- }- },-- resize: function (event, ui) {- var that = $(this).data("resizable"), o = that.options, os = that.originalSize, op = that.originalPosition;-- var delta = {- height: (that.size.height - os.height) || 0, width: (that.size.width - os.width) || 0,- top: (that.position.top - op.top) || 0, left: (that.position.left - op.left) || 0- },-- _alsoResize = function (exp, c) {- $(exp).each(function() {- var el = $(this), start = $(this).data("resizable-alsoresize"), style = {},- css = c && c.length ? c : el.parents(ui.originalElement[0]).length ? ['width', 'height'] : ['width', 'height', 'top', 'left'];-- $.each(css, function (i, prop) {- var sum = (start[prop]||0) + (delta[prop]||0);- if (sum && sum >= 0)- style[prop] = sum || null;- });-- el.css(style);- });- };-- if (typeof(o.alsoResize) == 'object' && !o.alsoResize.nodeType) {- $.each(o.alsoResize, function (exp, c) { _alsoResize(exp, c); });- }else{- _alsoResize(o.alsoResize);- }- },-- stop: function (event, ui) {- $(this).removeData("resizable-alsoresize");- }-});--$.ui.plugin.add("resizable", "animate", {-- stop: function(event, ui) {- var that = $(this).data("resizable"), o = that.options;-- var pr = that._proportionallyResizeElements, ista = pr.length && (/textarea/i).test(pr[0].nodeName),- soffseth = ista && $.ui.hasScroll(pr[0], 'left') /* TODO - jump height */ ? 0 : that.sizeDiff.height,- soffsetw = ista ? 0 : that.sizeDiff.width;-- var style = { width: (that.size.width - soffsetw), height: (that.size.height - soffseth) },- left = (parseInt(that.element.css('left'), 10) + (that.position.left - that.originalPosition.left)) || null,- top = (parseInt(that.element.css('top'), 10) + (that.position.top - that.originalPosition.top)) || null;-- that.element.animate(- $.extend(style, top && left ? { top: top, left: left } : {}), {- duration: o.animateDuration,- easing: o.animateEasing,- step: function() {-- var data = {- width: parseInt(that.element.css('width'), 10),- height: parseInt(that.element.css('height'), 10),- top: parseInt(that.element.css('top'), 10),- left: parseInt(that.element.css('left'), 10)- };-- if (pr && pr.length) $(pr[0]).css({ width: data.width, height: data.height });-- // propagating resize, and updating values for each animation step- that._updateCache(data);- that._propagate("resize", event);-- }- }- );- }--});--$.ui.plugin.add("resizable", "containment", {-- start: function(event, ui) {- var that = $(this).data("resizable"), o = that.options, el = that.element;- var oc = o.containment, ce = (oc instanceof $) ? oc.get(0) : (/parent/.test(oc)) ? el.parent().get(0) : oc;- if (!ce) return;-- that.containerElement = $(ce);-- if (/document/.test(oc) || oc == document) {- that.containerOffset = { left: 0, top: 0 };- that.containerPosition = { left: 0, top: 0 };-- that.parentData = {- element: $(document), left: 0, top: 0,- width: $(document).width(), height: $(document).height() || document.body.parentNode.scrollHeight- };- }-- // i'm a node, so compute top, left, right, bottom- else {- var element = $(ce), p = [];- $([ "Top", "Right", "Left", "Bottom" ]).each(function(i, name) { p[i] = num(element.css("padding" + name)); });-- that.containerOffset = element.offset();- that.containerPosition = element.position();- that.containerSize = { height: (element.innerHeight() - p[3]), width: (element.innerWidth() - p[1]) };-- var co = that.containerOffset, ch = that.containerSize.height, cw = that.containerSize.width,- width = ($.ui.hasScroll(ce, "left") ? ce.scrollWidth : cw ), height = ($.ui.hasScroll(ce) ? ce.scrollHeight : ch);-- that.parentData = {- element: ce, left: co.left, top: co.top, width: width, height: height- };- }- },-- resize: function(event, ui) {- var that = $(this).data("resizable"), o = that.options,- ps = that.containerSize, co = that.containerOffset, cs = that.size, cp = that.position,- pRatio = that._aspectRatio || event.shiftKey, cop = { top:0, left:0 }, ce = that.containerElement;-- if (ce[0] != document && (/static/).test(ce.css('position'))) cop = co;-- if (cp.left < (that._helper ? co.left : 0)) {- that.size.width = that.size.width + (that._helper ? (that.position.left - co.left) : (that.position.left - cop.left));- if (pRatio) that.size.height = that.size.width / that.aspectRatio;- that.position.left = o.helper ? co.left : 0;- }-- if (cp.top < (that._helper ? co.top : 0)) {- that.size.height = that.size.height + (that._helper ? (that.position.top - co.top) : that.position.top);- if (pRatio) that.size.width = that.size.height * that.aspectRatio;- that.position.top = that._helper ? co.top : 0;- }-- that.offset.left = that.parentData.left+that.position.left;- that.offset.top = that.parentData.top+that.position.top;-- var woset = Math.abs( (that._helper ? that.offset.left - cop.left : (that.offset.left - cop.left)) + that.sizeDiff.width ),- hoset = Math.abs( (that._helper ? that.offset.top - cop.top : (that.offset.top - co.top)) + that.sizeDiff.height );-- var isParent = that.containerElement.get(0) == that.element.parent().get(0),- isOffsetRelative = /relative|absolute/.test(that.containerElement.css('position'));-- if(isParent && isOffsetRelative) woset -= that.parentData.left;-- if (woset + that.size.width >= that.parentData.width) {- that.size.width = that.parentData.width - woset;- if (pRatio) that.size.height = that.size.width / that.aspectRatio;- }-- if (hoset + that.size.height >= that.parentData.height) {- that.size.height = that.parentData.height - hoset;- if (pRatio) that.size.width = that.size.height * that.aspectRatio;- }- },-- stop: function(event, ui){- var that = $(this).data("resizable"), o = that.options, cp = that.position,- co = that.containerOffset, cop = that.containerPosition, ce = that.containerElement;-- var helper = $(that.helper), ho = helper.offset(), w = helper.outerWidth() - that.sizeDiff.width, h = helper.outerHeight() - that.sizeDiff.height;-- if (that._helper && !o.animate && (/relative/).test(ce.css('position')))- $(this).css({ left: ho.left - cop.left - co.left, width: w, height: h });-- if (that._helper && !o.animate && (/static/).test(ce.css('position')))- $(this).css({ left: ho.left - cop.left - co.left, width: w, height: h });-- }-});--$.ui.plugin.add("resizable", "ghost", {-- start: function(event, ui) {-- var that = $(this).data("resizable"), o = that.options, cs = that.size;-- that.ghost = that.originalElement.clone();- that.ghost- .css({ opacity: .25, display: 'block', position: 'relative', height: cs.height, width: cs.width, margin: 0, left: 0, top: 0 })- .addClass('ui-resizable-ghost')- .addClass(typeof o.ghost == 'string' ? o.ghost : '');-- that.ghost.appendTo(that.helper);-- },-- resize: function(event, ui){- var that = $(this).data("resizable"), o = that.options;- if (that.ghost) that.ghost.css({ position: 'relative', height: that.size.height, width: that.size.width });- },-- stop: function(event, ui){- var that = $(this).data("resizable"), o = that.options;- if (that.ghost && that.helper) that.helper.get(0).removeChild(that.ghost.get(0));- }--});--$.ui.plugin.add("resizable", "grid", {-- resize: function(event, ui) {- var that = $(this).data("resizable"), o = that.options, cs = that.size, os = that.originalSize, op = that.originalPosition, a = that.axis, ratio = o._aspectRatio || event.shiftKey;- o.grid = typeof o.grid == "number" ? [o.grid, o.grid] : o.grid;- var ox = Math.round((cs.width - os.width) / (o.grid[0]||1)) * (o.grid[0]||1), oy = Math.round((cs.height - os.height) / (o.grid[1]||1)) * (o.grid[1]||1);-- if (/^(se|s|e)$/.test(a)) {- that.size.width = os.width + ox;- that.size.height = os.height + oy;- }- else if (/^(ne)$/.test(a)) {- that.size.width = os.width + ox;- that.size.height = os.height + oy;- that.position.top = op.top - oy;- }- else if (/^(sw)$/.test(a)) {- that.size.width = os.width + ox;- that.size.height = os.height + oy;- that.position.left = op.left - ox;- }- else {- that.size.width = os.width + ox;- that.size.height = os.height + oy;- that.position.top = op.top - oy;- that.position.left = op.left - ox;- }- }--});--var num = function(v) {- return parseInt(v, 10) || 0;-};--var isNumber = function(value) {- return !isNaN(parseInt(value, 10));-};--})(jQuery);-(function( $, undefined ) {--$.widget("ui.selectable", $.ui.mouse, {- version: "1.9.1",- options: {- appendTo: 'body',- autoRefresh: true,- distance: 0,- filter: '*',- tolerance: 'touch'- },- _create: function() {- var that = this;-- this.element.addClass("ui-selectable");-- this.dragged = false;-- // cache selectee children based on filter- var selectees;- this.refresh = function() {- selectees = $(that.options.filter, that.element[0]);- selectees.addClass("ui-selectee");- selectees.each(function() {- var $this = $(this);- var pos = $this.offset();- $.data(this, "selectable-item", {- element: this,- $element: $this,- left: pos.left,- top: pos.top,- right: pos.left + $this.outerWidth(),- bottom: pos.top + $this.outerHeight(),- startselected: false,- selected: $this.hasClass('ui-selected'),- selecting: $this.hasClass('ui-selecting'),- unselecting: $this.hasClass('ui-unselecting')- });- });- };- this.refresh();-- this.selectees = selectees.addClass("ui-selectee");-- this._mouseInit();-- this.helper = $("<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(event) {- var that = this;-- this.opos = [event.pageX, event.pageY];-- if (this.options.disabled)- return;-- var options = this.options;-- this.selectees = $(options.filter, this.element[0]);-- this._trigger("start", event);-- $(options.appendTo).append(this.helper);- // position helper (lasso)- this.helper.css({- "left": event.clientX,- "top": event.clientY,- "width": 0,- "height": 0- });-- if (options.autoRefresh) {- this.refresh();- }-- this.selectees.filter('.ui-selected').each(function() {- var selectee = $.data(this, "selectable-item");- selectee.startselected = true;- if (!event.metaKey && !event.ctrlKey) {- selectee.$element.removeClass('ui-selected');- selectee.selected = false;- selectee.$element.addClass('ui-unselecting');- selectee.unselecting = true;- // selectable UNSELECTING callback- that._trigger("unselecting", event, {- unselecting: selectee.element- });- }- });-- $(event.target).parents().andSelf().each(function() {- var selectee = $.data(this, "selectable-item");- if (selectee) {- var doSelect = (!event.metaKey && !event.ctrlKey) || !selectee.$element.hasClass('ui-selected');- selectee.$element- .removeClass(doSelect ? "ui-unselecting" : "ui-selected")- .addClass(doSelect ? "ui-selecting" : "ui-unselecting");- selectee.unselecting = !doSelect;- selectee.selecting = doSelect;- selectee.selected = doSelect;- // selectable (UN)SELECTING callback- if (doSelect) {- that._trigger("selecting", event, {- selecting: selectee.element- });- } else {- that._trigger("unselecting", event, {- unselecting: selectee.element- });- }- return false;- }- });-- },-- _mouseDrag: function(event) {- var that = this;- this.dragged = true;-- if (this.options.disabled)- return;-- var options = this.options;-- var x1 = this.opos[0], y1 = this.opos[1], x2 = event.pageX, y2 = event.pageY;- if (x1 > x2) { var tmp = x2; x2 = x1; x1 = tmp; }- if (y1 > y2) { var tmp = y2; y2 = y1; y1 = tmp; }- this.helper.css({left: x1, top: y1, width: x2-x1, height: y2-y1});-- this.selectees.each(function() {- var selectee = $.data(this, "selectable-item");- //prevent helper from being selected if appendTo: selectable- if (!selectee || selectee.element == that.element[0])- return;- var hit = false;- if (options.tolerance == 'touch') {- hit = ( !(selectee.left > x2 || selectee.right < x1 || selectee.top > y2 || selectee.bottom < y1) );- } else if (options.tolerance == 'fit') {- hit = (selectee.left > x1 && selectee.right < x2 && selectee.top > y1 && selectee.bottom < y2);- }-- if (hit) {- // SELECT- if (selectee.selected) {- selectee.$element.removeClass('ui-selected');- selectee.selected = false;- }- if (selectee.unselecting) {- selectee.$element.removeClass('ui-unselecting');- selectee.unselecting = false;- }- if (!selectee.selecting) {- selectee.$element.addClass('ui-selecting');- selectee.selecting = true;- // selectable SELECTING callback- that._trigger("selecting", event, {- selecting: selectee.element- });- }- } else {- // UNSELECT- if (selectee.selecting) {- if ((event.metaKey || event.ctrlKey) && selectee.startselected) {- selectee.$element.removeClass('ui-selecting');- selectee.selecting = false;- selectee.$element.addClass('ui-selected');- selectee.selected = true;- } else {- selectee.$element.removeClass('ui-selecting');- selectee.selecting = false;- if (selectee.startselected) {- selectee.$element.addClass('ui-unselecting');- selectee.unselecting = true;- }- // selectable UNSELECTING callback- that._trigger("unselecting", event, {- unselecting: selectee.element- });- }- }- if (selectee.selected) {- if (!event.metaKey && !event.ctrlKey && !selectee.startselected) {- selectee.$element.removeClass('ui-selected');- selectee.selected = false;-- selectee.$element.addClass('ui-unselecting');- selectee.unselecting = true;- // selectable UNSELECTING callback- that._trigger("unselecting", event, {- unselecting: selectee.element- });- }- }- }- });-- return false;- },-- _mouseStop: function(event) {- var that = this;-- this.dragged = false;-- var options = this.options;-- $('.ui-unselecting', this.element[0]).each(function() {- var selectee = $.data(this, "selectable-item");- selectee.$element.removeClass('ui-unselecting');- selectee.unselecting = false;- selectee.startselected = false;- that._trigger("unselected", event, {- unselected: selectee.element- });- });- $('.ui-selecting', this.element[0]).each(function() {- var selectee = $.data(this, "selectable-item");- selectee.$element.removeClass('ui-selecting').addClass('ui-selected');- selectee.selecting = false;- selectee.selected = true;- selectee.startselected = true;- that._trigger("selected", event, {- selected: selectee.element- });- });- this._trigger("stop", event);-- this.helper.remove();-- return false;- }--});--})(jQuery);-(function( $, undefined ) {--$.widget("ui.sortable", $.ui.mouse, {- version: "1.9.1",- widgetEventPrefix: "sort",- ready: false,- options: {- appendTo: "parent",- axis: false,- connectWith: false,- containment: false,- cursor: 'auto',- cursorAt: false,- dropOnEmpty: true,- forcePlaceholderSize: false,- forceHelperSize: false,- grid: false,- handle: false,- helper: "original",- items: '> *',- opacity: false,- placeholder: false,- revert: false,- scroll: true,- scrollSensitivity: 20,- scrollSpeed: 20,- scope: "default",- tolerance: "intersect",- zIndex: 1000- },- _create: function() {-- var o = this.options;- this.containerCache = {};- this.element.addClass("ui-sortable");-- //Get the items- this.refresh();-- //Let's determine if the items are being displayed horizontally- this.floating = this.items.length ? o.axis === 'x' || (/left|right/).test(this.items[0].item.css('float')) || (/inline|table-cell/).test(this.items[0].item.css('display')) : false;-- //Let's determine the parent's offset- this.offset = this.element.offset();-- //Initialize mouse events for interaction- this._mouseInit();-- //We're ready to go- this.ready = true-- },-- _destroy: function() {- this.element- .removeClass("ui-sortable ui-sortable-disabled");- this._mouseDestroy();-- for ( var i = this.items.length - 1; i >= 0; i-- )- this.items[i].item.removeData(this.widgetName + "-item");-- return this;- },-- _setOption: function(key, value){- if ( key === "disabled" ) {- this.options[ key ] = value;-- this.widget().toggleClass( "ui-sortable-disabled", !!value );- } else {- // Don't call widget base _setOption for disable as it adds ui-state-disabled class- $.Widget.prototype._setOption.apply(this, arguments);- }- },-- _mouseCapture: function(event, overrideHandle) {- var that = this;-- if (this.reverting) {- return false;- }-- if(this.options.disabled || this.options.type == 'static') return false;-- //We have to refresh the items data once first- this._refreshItems(event);-- //Find out if the clicked node (or one of its parents) is a actual item in this.items- var currentItem = null, nodes = $(event.target).parents().each(function() {- if($.data(this, that.widgetName + '-item') == that) {- currentItem = $(this);- return false;- }- });- if($.data(event.target, that.widgetName + '-item') == that) currentItem = $(event.target);-- if(!currentItem) return false;- if(this.options.handle && !overrideHandle) {- var validHandle = false;-- $(this.options.handle, currentItem).find("*").andSelf().each(function() { if(this == event.target) validHandle = true; });- if(!validHandle) return false;- }-- this.currentItem = currentItem;- this._removeCurrentsFromItems();- return true;-- },-- _mouseStart: function(event, overrideHandle, noActivation) {-- var o = this.options;- this.currentContainer = this;-- //We only need to call refreshPositions, because the refreshItems call has been moved to mouseCapture- this.refreshPositions();-- //Create and append the visible helper- this.helper = this._createHelper(event);-- //Cache the helper size- this._cacheHelperProportions();-- /*- * - Position generation -- * This block generates everything position related - it's the core of draggables.- */-- //Cache the margins of the original element- this._cacheMargins();-- //Get the next scrolling parent- this.scrollParent = this.helper.scrollParent();-- //The element's absolute position on the page minus margins- this.offset = this.currentItem.offset();- this.offset = {- top: this.offset.top - this.margins.top,- left: this.offset.left - this.margins.left- };-- $.extend(this.offset, {- click: { //Where the click happened, relative to the element- left: event.pageX - this.offset.left,- top: event.pageY - this.offset.top- },- parent: this._getParentOffset(),- relative: this._getRelativeOffset() //This is a relative to absolute position minus the actual position calculation - only used for relative positioned helper- });-- // Only after we got the offset, we can change the helper's position to absolute- // TODO: Still need to figure out a way to make relative sorting possible- this.helper.css("position", "absolute");- this.cssPosition = this.helper.css("position");-- //Generate the original position- this.originalPosition = this._generatePosition(event);- this.originalPageX = event.pageX;- this.originalPageY = event.pageY;-- //Adjust the mouse offset relative to the helper if 'cursorAt' is supplied- (o.cursorAt && this._adjustOffsetFromHelper(o.cursorAt));-- //Cache the former DOM position- this.domPosition = { prev: this.currentItem.prev()[0], parent: this.currentItem.parent()[0] };-- //If the helper is not the original, hide the original so it's not playing any role during the drag, won't cause anything bad this way- if(this.helper[0] != this.currentItem[0]) {- this.currentItem.hide();- }-- //Create the placeholder- this._createPlaceholder();-- //Set a containment if given in the options- if(o.containment)- this._setContainment();-- if(o.cursor) { // cursor option- if ($('body').css("cursor")) this._storedCursor = $('body').css("cursor");- $('body').css("cursor", o.cursor);- }-- if(o.opacity) { // opacity option- if (this.helper.css("opacity")) this._storedOpacity = this.helper.css("opacity");- this.helper.css("opacity", o.opacity);- }-- if(o.zIndex) { // zIndex option- if (this.helper.css("zIndex")) this._storedZIndex = this.helper.css("zIndex");- this.helper.css("zIndex", o.zIndex);- }-- //Prepare scrolling- if(this.scrollParent[0] != document && this.scrollParent[0].tagName != 'HTML')- this.overflowOffset = this.scrollParent.offset();-- //Call callbacks- this._trigger("start", event, this._uiHash());-- //Recache the helper size- if(!this._preserveHelperProportions)- this._cacheHelperProportions();--- //Post 'activate' events to possible containers- if(!noActivation) {- for (var i = this.containers.length - 1; i >= 0; i--) { this.containers[i]._trigger("activate", event, this._uiHash(this)); }- }-- //Prepare possible droppables- if($.ui.ddmanager)- $.ui.ddmanager.current = this;-- if ($.ui.ddmanager && !o.dropBehaviour)- $.ui.ddmanager.prepareOffsets(this, event);-- this.dragging = true;-- this.helper.addClass("ui-sortable-helper");- this._mouseDrag(event); //Execute the drag once - this causes the helper not to be visible before getting its correct position- return true;-- },-- _mouseDrag: function(event) {-- //Compute the helpers position- this.position = this._generatePosition(event);- this.positionAbs = this._convertPositionTo("absolute");-- if (!this.lastPositionAbs) {- this.lastPositionAbs = this.positionAbs;- }-- //Do scrolling- if(this.options.scroll) {- var o = this.options, scrolled = false;- if(this.scrollParent[0] != document && this.scrollParent[0].tagName != 'HTML') {-- if((this.overflowOffset.top + this.scrollParent[0].offsetHeight) - event.pageY < o.scrollSensitivity)- this.scrollParent[0].scrollTop = scrolled = this.scrollParent[0].scrollTop + o.scrollSpeed;- else if(event.pageY - this.overflowOffset.top < o.scrollSensitivity)- this.scrollParent[0].scrollTop = scrolled = this.scrollParent[0].scrollTop - o.scrollSpeed;-- if((this.overflowOffset.left + this.scrollParent[0].offsetWidth) - event.pageX < o.scrollSensitivity)- this.scrollParent[0].scrollLeft = scrolled = this.scrollParent[0].scrollLeft + o.scrollSpeed;- else if(event.pageX - this.overflowOffset.left < o.scrollSensitivity)- this.scrollParent[0].scrollLeft = scrolled = this.scrollParent[0].scrollLeft - o.scrollSpeed;-- } else {-- if(event.pageY - $(document).scrollTop() < o.scrollSensitivity)- scrolled = $(document).scrollTop($(document).scrollTop() - o.scrollSpeed);- else if($(window).height() - (event.pageY - $(document).scrollTop()) < o.scrollSensitivity)- scrolled = $(document).scrollTop($(document).scrollTop() + o.scrollSpeed);-- if(event.pageX - $(document).scrollLeft() < o.scrollSensitivity)- scrolled = $(document).scrollLeft($(document).scrollLeft() - o.scrollSpeed);- else if($(window).width() - (event.pageX - $(document).scrollLeft()) < o.scrollSensitivity)- scrolled = $(document).scrollLeft($(document).scrollLeft() + o.scrollSpeed);-- }-- if(scrolled !== false && $.ui.ddmanager && !o.dropBehaviour)- $.ui.ddmanager.prepareOffsets(this, event);- }-- //Regenerate the absolute position used for position checks- this.positionAbs = this._convertPositionTo("absolute");-- //Set the helper position- if(!this.options.axis || this.options.axis != "y") this.helper[0].style.left = this.position.left+'px';- if(!this.options.axis || this.options.axis != "x") this.helper[0].style.top = this.position.top+'px';-- //Rearrange- for (var i = this.items.length - 1; i >= 0; i--) {-- //Cache variables and intersection, continue if no intersection- var item = this.items[i], itemElement = item.item[0], intersection = this._intersectsWithPointer(item);- if (!intersection) continue;-- // Only put the placeholder inside the current Container, skip all- // items form other containers. This works because when moving- // an item from one container to another the- // currentContainer is switched before the placeholder is moved.- //- // Without this moving items in "sub-sortables" can cause the placeholder to jitter- // beetween the outer and inner container.- if (item.instance !== this.currentContainer) continue;-- if (itemElement != this.currentItem[0] //cannot intersect with itself- && this.placeholder[intersection == 1 ? "next" : "prev"]()[0] != itemElement //no useless actions that have been done before- && !$.contains(this.placeholder[0], itemElement) //no action if the item moved is the parent of the item checked- && (this.options.type == 'semi-dynamic' ? !$.contains(this.element[0], itemElement) : true)- //&& itemElement.parentNode == this.placeholder[0].parentNode // only rearrange items within the same container- ) {-- this.direction = intersection == 1 ? "down" : "up";-- if (this.options.tolerance == "pointer" || this._intersectsWithSides(item)) {- this._rearrange(event, item);- } else {- break;- }-- this._trigger("change", event, this._uiHash());- break;- }- }-- //Post events to containers- this._contactContainers(event);-- //Interconnect with droppables- if($.ui.ddmanager) $.ui.ddmanager.drag(this, event);-- //Call callbacks- this._trigger('sort', event, this._uiHash());-- this.lastPositionAbs = this.positionAbs;- return false;-- },-- _mouseStop: function(event, noPropagation) {-- if(!event) return;-- //If we are using droppables, inform the manager about the drop- if ($.ui.ddmanager && !this.options.dropBehaviour)- $.ui.ddmanager.drop(this, event);-- if(this.options.revert) {- var that = this;- var cur = this.placeholder.offset();-- this.reverting = true;-- $(this.helper).animate({- left: cur.left - this.offset.parent.left - this.margins.left + (this.offsetParent[0] == document.body ? 0 : this.offsetParent[0].scrollLeft),- top: cur.top - this.offset.parent.top - this.margins.top + (this.offsetParent[0] == document.body ? 0 : this.offsetParent[0].scrollTop)- }, parseInt(this.options.revert, 10) || 500, function() {- that._clear(event);- });- } else {- this._clear(event, noPropagation);- }-- return false;-- },-- cancel: function() {-- if(this.dragging) {-- this._mouseUp({ target: null });-- if(this.options.helper == "original")- this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper");- else- this.currentItem.show();-- //Post deactivating events to containers- for (var i = this.containers.length - 1; i >= 0; i--){- this.containers[i]._trigger("deactivate", null, this._uiHash(this));- if(this.containers[i].containerCache.over) {- this.containers[i]._trigger("out", null, this._uiHash(this));- this.containers[i].containerCache.over = 0;- }- }-- }-- if (this.placeholder) {- //$(this.placeholder[0]).remove(); would have been the jQuery way - unfortunately, it unbinds ALL events from the original node!- if(this.placeholder[0].parentNode) this.placeholder[0].parentNode.removeChild(this.placeholder[0]);- if(this.options.helper != "original" && this.helper && this.helper[0].parentNode) this.helper.remove();-- $.extend(this, {- helper: null,- dragging: false,- reverting: false,- _noFinalSort: null- });-- if(this.domPosition.prev) {- $(this.domPosition.prev).after(this.currentItem);- } else {- $(this.domPosition.parent).prepend(this.currentItem);- }- }-- return this;-- },-- serialize: function(o) {-- var items = this._getItemsAsjQuery(o && o.connected);- var str = []; o = o || {};-- $(items).each(function() {- var res = ($(o.item || this).attr(o.attribute || 'id') || '').match(o.expression || (/(.+)[-=_](.+)/));- if(res) str.push((o.key || res[1]+'[]')+'='+(o.key && o.expression ? res[1] : res[2]));- });-- if(!str.length && o.key) {- str.push(o.key + '=');- }-- return str.join('&');-- },-- toArray: function(o) {-- var items = this._getItemsAsjQuery(o && o.connected);- var ret = []; o = o || {};-- items.each(function() { ret.push($(o.item || this).attr(o.attribute || 'id') || ''); });- return ret;-- },-- /* Be careful with the following core functions */- _intersectsWith: function(item) {-- var x1 = this.positionAbs.left,- x2 = x1 + this.helperProportions.width,- y1 = this.positionAbs.top,- y2 = y1 + this.helperProportions.height;-- var l = item.left,- r = l + item.width,- t = item.top,- b = t + item.height;-- var dyClick = this.offset.click.top,- dxClick = this.offset.click.left;-- var isOverElement = (y1 + dyClick) > t && (y1 + dyClick) < b && (x1 + dxClick) > l && (x1 + dxClick) < r;-- if( this.options.tolerance == "pointer"- || this.options.forcePointerForContainers- || (this.options.tolerance != "pointer" && this.helperProportions[this.floating ? 'width' : 'height'] > item[this.floating ? 'width' : 'height'])- ) {- return isOverElement;- } else {-- return (l < x1 + (this.helperProportions.width / 2) // Right Half- && x2 - (this.helperProportions.width / 2) < r // Left Half- && t < y1 + (this.helperProportions.height / 2) // Bottom Half- && y2 - (this.helperProportions.height / 2) < b ); // Top Half-- }- },-- _intersectsWithPointer: function(item) {-- var isOverElementHeight = (this.options.axis === 'x') || $.ui.isOverAxis(this.positionAbs.top + this.offset.click.top, item.top, item.height),- isOverElementWidth = (this.options.axis === 'y') || $.ui.isOverAxis(this.positionAbs.left + this.offset.click.left, item.left, item.width),- isOverElement = isOverElementHeight && isOverElementWidth,- verticalDirection = this._getDragVerticalDirection(),- horizontalDirection = this._getDragHorizontalDirection();-- if (!isOverElement)- return false;-- return this.floating ?- ( ((horizontalDirection && horizontalDirection == "right") || verticalDirection == "down") ? 2 : 1 )- : ( verticalDirection && (verticalDirection == "down" ? 2 : 1) );-- },-- _intersectsWithSides: function(item) {-- var isOverBottomHalf = $.ui.isOverAxis(this.positionAbs.top + this.offset.click.top, item.top + (item.height/2), item.height),- isOverRightHalf = $.ui.isOverAxis(this.positionAbs.left + this.offset.click.left, item.left + (item.width/2), item.width),- verticalDirection = this._getDragVerticalDirection(),- horizontalDirection = this._getDragHorizontalDirection();-- if (this.floating && horizontalDirection) {- return ((horizontalDirection == "right" && isOverRightHalf) || (horizontalDirection == "left" && !isOverRightHalf));- } else {- return verticalDirection && ((verticalDirection == "down" && isOverBottomHalf) || (verticalDirection == "up" && !isOverBottomHalf));- }-- },-- _getDragVerticalDirection: function() {- var delta = this.positionAbs.top - this.lastPositionAbs.top;- return delta != 0 && (delta > 0 ? "down" : "up");- },-- _getDragHorizontalDirection: function() {- var delta = this.positionAbs.left - this.lastPositionAbs.left;- return delta != 0 && (delta > 0 ? "right" : "left");- },-- refresh: function(event) {- this._refreshItems(event);- this.refreshPositions();- return this;- },-- _connectWith: function() {- var options = this.options;- return options.connectWith.constructor == String- ? [options.connectWith]- : options.connectWith;- },-- _getItemsAsjQuery: function(connected) {-- var items = [];- var queries = [];- var connectWith = this._connectWith();-- if(connectWith && connected) {- for (var i = connectWith.length - 1; i >= 0; i--){- var cur = $(connectWith[i]);- for (var j = cur.length - 1; j >= 0; j--){- var inst = $.data(cur[j], this.widgetName);- if(inst && inst != this && !inst.options.disabled) {- queries.push([$.isFunction(inst.options.items) ? inst.options.items.call(inst.element) : $(inst.options.items, inst.element).not(".ui-sortable-helper").not('.ui-sortable-placeholder'), inst]);- }- };- };- }-- queries.push([$.isFunction(this.options.items) ? this.options.items.call(this.element, null, { options: this.options, item: this.currentItem }) : $(this.options.items, this.element).not(".ui-sortable-helper").not('.ui-sortable-placeholder'), this]);-- for (var i = queries.length - 1; i >= 0; i--){- queries[i][0].each(function() {- items.push(this);- });- };-- return $(items);-- },-- _removeCurrentsFromItems: function() {-- var list = this.currentItem.find(":data(" + this.widgetName + "-item)");-- this.items = $.grep(this.items, function (item) {- for (var j=0; j < list.length; j++) {- if(list[j] == item.item[0])- return false;- };- return true;- });-- },-- _refreshItems: function(event) {-- this.items = [];- this.containers = [this];- var items = this.items;- var queries = [[$.isFunction(this.options.items) ? this.options.items.call(this.element[0], event, { item: this.currentItem }) : $(this.options.items, this.element), this]];- var connectWith = this._connectWith();-- if(connectWith && this.ready) { //Shouldn't be run the first time through due to massive slow-down- for (var i = connectWith.length - 1; i >= 0; i--){- var cur = $(connectWith[i]);- for (var j = cur.length - 1; j >= 0; j--){- var inst = $.data(cur[j], this.widgetName);- if(inst && inst != this && !inst.options.disabled) {- queries.push([$.isFunction(inst.options.items) ? inst.options.items.call(inst.element[0], event, { item: this.currentItem }) : $(inst.options.items, inst.element), inst]);- this.containers.push(inst);- }- };- };- }-- for (var i = queries.length - 1; i >= 0; i--) {- var targetData = queries[i][1];- var _queries = queries[i][0];-- for (var j=0, queriesLength = _queries.length; j < queriesLength; j++) {- var item = $(_queries[j]);-- item.data(this.widgetName + '-item', targetData); // Data for target checking (mouse manager)-- items.push({- item: item,- instance: targetData,- width: 0, height: 0,- left: 0, top: 0- });- };- };-- },-- refreshPositions: function(fast) {-- //This has to be redone because due to the item being moved out/into the offsetParent, the offsetParent's position will change- if(this.offsetParent && this.helper) {- this.offset.parent = this._getParentOffset();- }-- for (var i = this.items.length - 1; i >= 0; i--){- var item = this.items[i];-- //We ignore calculating positions of all connected containers when we're not over them- if(item.instance != this.currentContainer && this.currentContainer && item.item[0] != this.currentItem[0])- continue;-- var t = this.options.toleranceElement ? $(this.options.toleranceElement, item.item) : item.item;-- if (!fast) {- item.width = t.outerWidth();- item.height = t.outerHeight();- }-- var p = t.offset();- item.left = p.left;- item.top = p.top;- };-- if(this.options.custom && this.options.custom.refreshContainers) {- this.options.custom.refreshContainers.call(this);- } else {- for (var i = this.containers.length - 1; i >= 0; i--){- var p = this.containers[i].element.offset();- this.containers[i].containerCache.left = p.left;- this.containers[i].containerCache.top = p.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(that) {- that = that || this;- var o = that.options;-- if(!o.placeholder || o.placeholder.constructor == String) {- var className = o.placeholder;- o.placeholder = {- element: function() {-- var el = $(document.createElement(that.currentItem[0].nodeName))- .addClass(className || that.currentItem[0].className+" ui-sortable-placeholder")- .removeClass("ui-sortable-helper")[0];-- if(!className)- el.style.visibility = "hidden";-- return el;- },- update: function(container, p) {-- // 1. If a className is set as 'placeholder option, we don't force sizes - the class is responsible for that- // 2. The option 'forcePlaceholderSize can be enabled to force it even if a class name is specified- if(className && !o.forcePlaceholderSize) return;-- //If the element doesn't have a actual height by itself (without styles coming from a stylesheet), it receives the inline height from the dragged item- if(!p.height()) { p.height(that.currentItem.innerHeight() - parseInt(that.currentItem.css('paddingTop')||0, 10) - parseInt(that.currentItem.css('paddingBottom')||0, 10)); };- if(!p.width()) { p.width(that.currentItem.innerWidth() - parseInt(that.currentItem.css('paddingLeft')||0, 10) - parseInt(that.currentItem.css('paddingRight')||0, 10)); };- }- };- }-- //Create the placeholder- that.placeholder = $(o.placeholder.element.call(that.element, that.currentItem));-- //Append it after the actual current item- that.currentItem.after(that.placeholder);-- //Update the size of the placeholder (TODO: Logic to fuzzy, see line 316/317)- o.placeholder.update(that, that.placeholder);-- },-- _contactContainers: function(event) {-- // get innermost container that intersects with item- var innermostContainer = null, innermostIndex = null;--- for (var i = this.containers.length - 1; i >= 0; i--){-- // never consider a container that's located within the item itself- if($.contains(this.currentItem[0], this.containers[i].element[0]))- continue;-- if(this._intersectsWith(this.containers[i].containerCache)) {-- // if we've already found a container and it's more "inner" than this, then continue- if(innermostContainer && $.contains(this.containers[i].element[0], innermostContainer.element[0]))- continue;-- innermostContainer = this.containers[i];- innermostIndex = i;-- } else {- // container doesn't intersect. trigger "out" event if necessary- if(this.containers[i].containerCache.over) {- this.containers[i]._trigger("out", event, this._uiHash(this));- this.containers[i].containerCache.over = 0;- }- }-- }-- // if no intersecting containers found, return- if(!innermostContainer) return;-- // move the item into the container if it's not there already- if(this.containers.length === 1) {- this.containers[innermostIndex]._trigger("over", event, this._uiHash(this));- this.containers[innermostIndex].containerCache.over = 1;- } else {-- //When entering a new container, we will find the item with the least distance and append our item near it- var dist = 10000; var itemWithLeastDistance = null;- var posProperty = this.containers[innermostIndex].floating ? 'left' : 'top';- var sizeProperty = this.containers[innermostIndex].floating ? 'width' : 'height';- var base = this.positionAbs[posProperty] + this.offset.click[posProperty];- for (var j = this.items.length - 1; j >= 0; j--) {- if(!$.contains(this.containers[innermostIndex].element[0], this.items[j].item[0])) continue;- if(this.items[j].item[0] == this.currentItem[0]) continue;- var cur = this.items[j].item.offset()[posProperty];- var nearBottom = false;- if(Math.abs(cur - base) > Math.abs(cur + this.items[j][sizeProperty] - base)){- nearBottom = true;- cur += this.items[j][sizeProperty];- }-- if(Math.abs(cur - base) < dist) {- dist = Math.abs(cur - base); itemWithLeastDistance = this.items[j];- this.direction = nearBottom ? "up": "down";- }- }-- if(!itemWithLeastDistance && !this.options.dropOnEmpty) //Check if dropOnEmpty is enabled- return;-- this.currentContainer = this.containers[innermostIndex];- itemWithLeastDistance ? this._rearrange(event, itemWithLeastDistance, null, true) : this._rearrange(event, null, this.containers[innermostIndex].element, true);- this._trigger("change", event, this._uiHash());- this.containers[innermostIndex]._trigger("change", event, this._uiHash(this));-- //Update the placeholder- this.options.placeholder.update(this.currentContainer, this.placeholder);-- this.containers[innermostIndex]._trigger("over", event, this._uiHash(this));- this.containers[innermostIndex].containerCache.over = 1;- }--- },-- _createHelper: function(event) {-- var o = this.options;- var helper = $.isFunction(o.helper) ? $(o.helper.apply(this.element[0], [event, this.currentItem])) : (o.helper == 'clone' ? this.currentItem.clone() : this.currentItem);-- if(!helper.parents('body').length) //Add the helper to the DOM if that didn't happen already- $(o.appendTo != 'parent' ? o.appendTo : this.currentItem[0].parentNode)[0].appendChild(helper[0]);-- if(helper[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") };-- if(helper[0].style.width == '' || o.forceHelperSize) helper.width(this.currentItem.width());- if(helper[0].style.height == '' || o.forceHelperSize) helper.height(this.currentItem.height());-- return helper;-- },-- _adjustOffsetFromHelper: function(obj) {- if (typeof obj == 'string') {- obj = obj.split(' ');- }- if ($.isArray(obj)) {- obj = {left: +obj[0], top: +obj[1] || 0};- }- if ('left' in obj) {- this.offset.click.left = obj.left + this.margins.left;- }- if ('right' in obj) {- this.offset.click.left = this.helperProportions.width - obj.right + this.margins.left;- }- if ('top' in obj) {- this.offset.click.top = obj.top + this.margins.top;- }- if ('bottom' in obj) {- this.offset.click.top = this.helperProportions.height - obj.bottom + this.margins.top;- }- },-- _getParentOffset: function() {--- //Get the offsetParent and cache its position- this.offsetParent = this.helper.offsetParent();- var po = this.offsetParent.offset();-- // This is a special case where we need to modify a offset calculated on start, since the following happened:- // 1. The position of the helper is absolute, so it's position is calculated based on the next positioned parent- // 2. The actual offset parent is a child of the scroll parent, and the scroll parent isn't the document, which means that- // the scroll is included in the initial calculation of the offset of the parent, and never recalculated upon drag- if(this.cssPosition == 'absolute' && this.scrollParent[0] != document && $.contains(this.scrollParent[0], this.offsetParent[0])) {- po.left += this.scrollParent.scrollLeft();- po.top += this.scrollParent.scrollTop();- }-- if((this.offsetParent[0] == document.body) //This needs to be actually done for all browsers, since pageX/pageY includes this information- || (this.offsetParent[0].tagName && this.offsetParent[0].tagName.toLowerCase() == 'html' && $.ui.ie)) //Ugly IE fix- po = { top: 0, left: 0 };-- return {- top: po.top + (parseInt(this.offsetParent.css("borderTopWidth"),10) || 0),- left: po.left + (parseInt(this.offsetParent.css("borderLeftWidth"),10) || 0)- };-- },-- _getRelativeOffset: function() {-- if(this.cssPosition == "relative") {- var p = this.currentItem.position();- return {- top: p.top - (parseInt(this.helper.css("top"),10) || 0) + this.scrollParent.scrollTop(),- left: p.left - (parseInt(this.helper.css("left"),10) || 0) + this.scrollParent.scrollLeft()- };- } else {- 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 o = this.options;- if(o.containment == 'parent') o.containment = this.helper[0].parentNode;- if(o.containment == 'document' || o.containment == 'window') this.containment = [- 0 - this.offset.relative.left - this.offset.parent.left,- 0 - this.offset.relative.top - this.offset.parent.top,- $(o.containment == 'document' ? document : window).width() - this.helperProportions.width - this.margins.left,- ($(o.containment == 'document' ? document : window).height() || document.body.parentNode.scrollHeight) - this.helperProportions.height - this.margins.top- ];-- if(!(/^(document|window|parent)$/).test(o.containment)) {- var ce = $(o.containment)[0];- var co = $(o.containment).offset();- var over = ($(ce).css("overflow") != 'hidden');-- this.containment = [- co.left + (parseInt($(ce).css("borderLeftWidth"),10) || 0) + (parseInt($(ce).css("paddingLeft"),10) || 0) - this.margins.left,- co.top + (parseInt($(ce).css("borderTopWidth"),10) || 0) + (parseInt($(ce).css("paddingTop"),10) || 0) - this.margins.top,- co.left+(over ? Math.max(ce.scrollWidth,ce.offsetWidth) : ce.offsetWidth) - (parseInt($(ce).css("borderLeftWidth"),10) || 0) - (parseInt($(ce).css("paddingRight"),10) || 0) - this.helperProportions.width - this.margins.left,- co.top+(over ? Math.max(ce.scrollHeight,ce.offsetHeight) : ce.offsetHeight) - (parseInt($(ce).css("borderTopWidth"),10) || 0) - (parseInt($(ce).css("paddingBottom"),10) || 0) - this.helperProportions.height - this.margins.top- ];- }-- },-- _convertPositionTo: function(d, pos) {-- if(!pos) pos = this.position;- var mod = d == "absolute" ? 1 : -1;- var o = this.options, scroll = this.cssPosition == 'absolute' && !(this.scrollParent[0] != document && $.contains(this.scrollParent[0], this.offsetParent[0])) ? this.offsetParent : this.scrollParent, scrollIsRootNode = (/(html|body)/i).test(scroll[0].tagName);-- return {- top: (- pos.top // The absolute mouse position- + this.offset.relative.top * mod // Only for relative positioned nodes: Relative offset from element to offset parent- + this.offset.parent.top * mod // The offsetParent's offset without borders (offset + border)- - ( ( this.cssPosition == 'fixed' ? -this.scrollParent.scrollTop() : ( scrollIsRootNode ? 0 : scroll.scrollTop() ) ) * mod)- ),- left: (- pos.left // The absolute mouse position- + this.offset.relative.left * mod // Only for relative positioned nodes: Relative offset from element to offset parent- + this.offset.parent.left * mod // The offsetParent's offset without borders (offset + border)- - ( ( this.cssPosition == 'fixed' ? -this.scrollParent.scrollLeft() : scrollIsRootNode ? 0 : scroll.scrollLeft() ) * mod)- )- };-- },-- _generatePosition: function(event) {-- var o = this.options, scroll = this.cssPosition == 'absolute' && !(this.scrollParent[0] != document && $.contains(this.scrollParent[0], this.offsetParent[0])) ? this.offsetParent : this.scrollParent, scrollIsRootNode = (/(html|body)/i).test(scroll[0].tagName);-- // This is another very weird special case that only happens for relative elements:- // 1. If the css position is relative- // 2. and the scroll parent is the document or similar to the offset parent- // we have to refresh the relative offset during the scroll so there are no jumps- if(this.cssPosition == 'relative' && !(this.scrollParent[0] != document && this.scrollParent[0] != this.offsetParent[0])) {- this.offset.relative = this._getRelativeOffset();- }-- var pageX = event.pageX;- var pageY = event.pageY;-- /*- * - Position constraining -- * Constrain the position to a mix of grid, containment.- */-- if(this.originalPosition) { //If we are not dragging yet, we won't check for options-- if(this.containment) {- if(event.pageX - this.offset.click.left < this.containment[0]) pageX = this.containment[0] + this.offset.click.left;- if(event.pageY - this.offset.click.top < this.containment[1]) pageY = this.containment[1] + this.offset.click.top;- if(event.pageX - this.offset.click.left > this.containment[2]) pageX = this.containment[2] + this.offset.click.left;- if(event.pageY - this.offset.click.top > this.containment[3]) pageY = this.containment[3] + this.offset.click.top;- }-- if(o.grid) {- var top = this.originalPageY + Math.round((pageY - this.originalPageY) / o.grid[1]) * o.grid[1];- pageY = this.containment ? (!(top - this.offset.click.top < this.containment[1] || top - this.offset.click.top > this.containment[3]) ? top : (!(top - this.offset.click.top < this.containment[1]) ? top - o.grid[1] : top + o.grid[1])) : top;-- var left = this.originalPageX + Math.round((pageX - this.originalPageX) / o.grid[0]) * o.grid[0];- pageX = this.containment ? (!(left - this.offset.click.left < this.containment[0] || left - this.offset.click.left > this.containment[2]) ? left : (!(left - this.offset.click.left < this.containment[0]) ? left - o.grid[0] : left + o.grid[0])) : left;- }-- }-- return {- top: (- pageY // The absolute mouse position- - this.offset.click.top // Click offset (relative to the element)- - this.offset.relative.top // Only for relative positioned nodes: Relative offset from element to offset parent- - this.offset.parent.top // The offsetParent's offset without borders (offset + border)- + ( ( this.cssPosition == 'fixed' ? -this.scrollParent.scrollTop() : ( scrollIsRootNode ? 0 : scroll.scrollTop() ) ))- ),- left: (- pageX // The absolute mouse position- - this.offset.click.left // Click offset (relative to the element)- - this.offset.relative.left // Only for relative positioned nodes: Relative offset from element to offset parent- - this.offset.parent.left // The offsetParent's offset without borders (offset + border)- + ( ( this.cssPosition == 'fixed' ? -this.scrollParent.scrollLeft() : scrollIsRootNode ? 0 : scroll.scrollLeft() ))- )- };-- },-- _rearrange: function(event, i, a, hardRefresh) {-- a ? a[0].appendChild(this.placeholder[0]) : i.item[0].parentNode.insertBefore(this.placeholder[0], (this.direction == 'down' ? i.item[0] : i.item[0].nextSibling));-- //Various things done here to improve the performance:- // 1. we create a setTimeout, that calls refreshPositions- // 2. on the instance, we have a counter variable, that get's higher after every append- // 3. on the local scope, we copy the counter variable, and check in the timeout, if it's still the same- // 4. this lets only the last addition to the timeout stack through- this.counter = this.counter ? ++this.counter : 1;- var counter = this.counter;-- this._delay(function() {- if(counter == this.counter) this.refreshPositions(!hardRefresh); //Precompute after each DOM insertion, NOT on mousemove- });-- },-- _clear: function(event, noPropagation) {-- this.reverting = false;- // We delay all events that have to be triggered to after the point where the placeholder has been removed and- // everything else normalized again- var delayedTriggers = [];-- // We first have to update the dom position of the actual currentItem- // Note: don't do it if the current item is already removed (by a user), or it gets reappended (see #4088)- if(!this._noFinalSort && this.currentItem.parent().length) this.placeholder.before(this.currentItem);- this._noFinalSort = null;-- if(this.helper[0] == this.currentItem[0]) {- for(var i in this._storedCSS) {- if(this._storedCSS[i] == 'auto' || this._storedCSS[i] == 'static') this._storedCSS[i] = '';- }- this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper");- } else {- this.currentItem.show();- }-- if(this.fromOutside && !noPropagation) delayedTriggers.push(function(event) { this._trigger("receive", event, this._uiHash(this.fromOutside)); });- if((this.fromOutside || this.domPosition.prev != this.currentItem.prev().not(".ui-sortable-helper")[0] || this.domPosition.parent != this.currentItem.parent()[0]) && !noPropagation) delayedTriggers.push(function(event) { this._trigger("update", event, this._uiHash()); }); //Trigger update callback if the DOM position has changed-- // Check if the items Container has Changed and trigger appropriate- // events.- if (this !== this.currentContainer) {- if(!noPropagation) {- delayedTriggers.push(function(event) { this._trigger("remove", event, this._uiHash()); });- delayedTriggers.push((function(c) { return function(event) { c._trigger("receive", event, this._uiHash(this)); }; }).call(this, this.currentContainer));- delayedTriggers.push((function(c) { return function(event) { c._trigger("update", event, this._uiHash(this)); }; }).call(this, this.currentContainer));- }- }--- //Post events to containers- for (var i = this.containers.length - 1; i >= 0; i--){- if(!noPropagation) delayedTriggers.push((function(c) { return function(event) { c._trigger("deactivate", event, this._uiHash(this)); }; }).call(this, this.containers[i]));- if(this.containers[i].containerCache.over) {- delayedTriggers.push((function(c) { return function(event) { c._trigger("out", event, this._uiHash(this)); }; }).call(this, this.containers[i]));- this.containers[i].containerCache.over = 0;- }- }-- //Do what was originally in plugins- if(this._storedCursor) $('body').css("cursor", this._storedCursor); //Reset cursor- if(this._storedOpacity) this.helper.css("opacity", this._storedOpacity); //Reset opacity- if(this._storedZIndex) this.helper.css("zIndex", this._storedZIndex == 'auto' ? '' : this._storedZIndex); //Reset z-index-- this.dragging = false;- if(this.cancelHelperRemoval) {- if(!noPropagation) {- this._trigger("beforeStop", event, this._uiHash());- for (var i=0; i < delayedTriggers.length; i++) { delayedTriggers[i].call(this, event); }; //Trigger all delayed events- this._trigger("stop", event, this._uiHash());- }-- this.fromOutside = false;- return false;- }-- if(!noPropagation) this._trigger("beforeStop", event, this._uiHash());-- //$(this.placeholder[0]).remove(); would have been the jQuery way - unfortunately, it unbinds ALL events from the original node!- this.placeholder[0].parentNode.removeChild(this.placeholder[0]);-- if(this.helper[0] != this.currentItem[0]) this.helper.remove(); this.helper = null;-- if(!noPropagation) {- for (var i=0; i < delayedTriggers.length; i++) { delayedTriggers[i].call(this, event); }; //Trigger all delayed events- this._trigger("stop", event, this._uiHash());- }-- this.fromOutside = false;- return true;-- },-- _trigger: function() {- if ($.Widget.prototype._trigger.apply(this, arguments) === false) {- this.cancel();- }- },-- _uiHash: function(_inst) {- var inst = _inst || this;- return {- helper: inst.helper,- placeholder: inst.placeholder || $([]),- position: inst.position,- originalPosition: inst.originalPosition,- offset: inst.positionAbs,- item: inst.currentItem,- sender: _inst ? _inst.element : null- };- }--});--})(jQuery);-(function( $, undefined ) {--var uid = 0,- hideProps = {},- showProps = {};--hideProps.height = hideProps.paddingTop = hideProps.paddingBottom =- hideProps.borderTopWidth = hideProps.borderBottomWidth = "hide";-showProps.height = showProps.paddingTop = showProps.paddingBottom =- showProps.borderTopWidth = showProps.borderBottomWidth = "show";--$.widget( "ui.accordion", {- version: "1.9.1",- options: {- active: 0,- animate: {},- collapsible: false,- event: "click",- header: "> li > :first-child,> :not(li):even",- heightStyle: "auto",- icons: {- activeHeader: "ui-icon-triangle-1-s",- header: "ui-icon-triangle-1-e"- },-- // callbacks- activate: null,- beforeActivate: null- },-- _create: function() {- var accordionId = this.accordionId = "ui-accordion-" +- (this.element.attr( "id" ) || ++uid),- options = this.options;-- this.prevShow = this.prevHide = $();- this.element.addClass( "ui-accordion ui-widget ui-helper-reset" );-- this.headers = this.element.find( options.header )- .addClass( "ui-accordion-header ui-helper-reset ui-state-default ui-corner-all" );- this._hoverable( this.headers );- this._focusable( this.headers );-- this.headers.next()- .addClass( "ui-accordion-content ui-helper-reset ui-widget-content ui-corner-bottom" )- .hide();-- // don't allow collapsible: false and active: false / null- if ( !options.collapsible && (options.active === false || options.active == null) ) {- options.active = 0;- }- // handle negative values- if ( options.active < 0 ) {- options.active += this.headers.length;- }- this.active = this._findActive( options.active )- .addClass( "ui-accordion-header-active ui-state-active" )- .toggleClass( "ui-corner-all ui-corner-top" );- this.active.next()- .addClass( "ui-accordion-content-active" )- .show();-- this._createIcons();- this.refresh();-- // ARIA- this.element.attr( "role", "tablist" );-- this.headers- .attr( "role", "tab" )- .each(function( i ) {- var header = $( this ),- headerId = header.attr( "id" ),- panel = header.next(),- panelId = panel.attr( "id" );- if ( !headerId ) {- headerId = accordionId + "-header-" + i;- header.attr( "id", headerId );- }- if ( !panelId ) {- panelId = accordionId + "-panel-" + i;- panel.attr( "id", panelId );- }- header.attr( "aria-controls", panelId );- panel.attr( "aria-labelledby", headerId );- })- .next()- .attr( "role", "tabpanel" );-- this.headers- .not( this.active )- .attr({- "aria-selected": "false",- tabIndex: -1- })- .next()- .attr({- "aria-expanded": "false",- "aria-hidden": "true"- })- .hide();-- // make sure at least one header is in the tab order- if ( !this.active.length ) {- this.headers.eq( 0 ).attr( "tabIndex", 0 );- } else {- this.active.attr({- "aria-selected": "true",- tabIndex: 0- })- .next()- .attr({- "aria-expanded": "true",- "aria-hidden": "false"- });- }-- this._on( this.headers, { keydown: "_keydown" });- this._on( this.headers.next(), { keydown: "_panelKeyDown" });- this._setupEvents( options.event );- },-- _getCreateEventData: function() {- return {- header: this.active,- content: !this.active.length ? $() : this.active.next()- };- },-- _createIcons: function() {- var icons = this.options.icons;- if ( icons ) {- $( "<span>" )- .addClass( "ui-accordion-header-icon ui-icon " + icons.header )- .prependTo( this.headers );- this.active.children( ".ui-accordion-header-icon" )- .removeClass( icons.header )- .addClass( icons.activeHeader );- this.headers.addClass( "ui-accordion-icons" );- }- },-- _destroyIcons: function() {- this.headers- .removeClass( "ui-accordion-icons" )- .children( ".ui-accordion-header-icon" )- .remove();- },-- _destroy: function() {- var contents;-- // clean up main element- this.element- .removeClass( "ui-accordion ui-widget ui-helper-reset" )- .removeAttr( "role" );-- // clean up headers- 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-selected" )- .removeAttr( "aria-controls" )- .removeAttr( "tabIndex" )- .each(function() {- if ( /^ui-accordion/.test( this.id ) ) {- this.removeAttribute( "id" );- }- });- this._destroyIcons();-- // clean up content panels- contents = this.headers.next()- .css( "display", "" )- .removeAttr( "role" )- .removeAttr( "aria-expanded" )- .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() {- if ( /^ui-accordion/.test( this.id ) ) {- this.removeAttribute( "id" );- }- });- if ( this.options.heightStyle !== "content" ) {- contents.css( "height", "" );- }- },-- _setOption: function( key, value ) {- if ( key === "active" ) {- // _activate() will handle invalid values and update this.options- this._activate( value );- return;- }-- if ( key === "event" ) {- if ( this.options.event ) {- this._off( this.headers, this.options.event );- }- this._setupEvents( value );- }-- this._super( key, value );-- // setting collapsible: false while collapsed; open first panel- if ( key === "collapsible" && !value && this.options.active === false ) {- this._activate( 0 );- }-- if ( key === "icons" ) {- this._destroyIcons();- if ( value ) {- this._createIcons();- }- }-- // #5332 - opacity doesn't cascade to positioned elements in IE- // so we need to add the disabled class to the headers and panels- if ( key === "disabled" ) {- this.headers.add( this.headers.next() )- .toggleClass( "ui-state-disabled", !!value );- }- },-- _keydown: function( event ) {- if ( event.altKey || event.ctrlKey ) {- return;- }-- var keyCode = $.ui.keyCode,- length = this.headers.length,- currentIndex = this.headers.index( event.target ),- toFocus = false;-- switch ( event.keyCode ) {- case keyCode.RIGHT:- case keyCode.DOWN:- toFocus = this.headers[ ( currentIndex + 1 ) % length ];- break;- case keyCode.LEFT:- case keyCode.UP:- toFocus = this.headers[ ( currentIndex - 1 + length ) % length ];- break;- case keyCode.SPACE:- case keyCode.ENTER:- this._eventHandler( event );- break;- case keyCode.HOME:- toFocus = this.headers[ 0 ];- break;- case keyCode.END:- toFocus = this.headers[ length - 1 ];- break;- }-- if ( toFocus ) {- $( event.target ).attr( "tabIndex", -1 );- $( toFocus ).attr( "tabIndex", 0 );- toFocus.focus();- event.preventDefault();- }- },-- _panelKeyDown : function( event ) {- if ( event.keyCode === $.ui.keyCode.UP && event.ctrlKey ) {- $( event.currentTarget ).prev().focus();- }- },-- refresh: function() {- var maxHeight, overflow,- heightStyle = this.options.heightStyle,- parent = this.element.parent();--- if ( heightStyle === "fill" ) {- // IE 6 treats height like minHeight, so we need to turn off overflow- // in order to get a reliable height- // we use the minHeight support test because we assume that only- // browsers that don't support minHeight will treat height as minHeight- if ( !$.support.minHeight ) {- overflow = parent.css( "overflow" );- parent.css( "overflow", "hidden");- }- maxHeight = parent.height();- this.element.siblings( ":visible" ).each(function() {- var elem = $( this ),- position = elem.css( "position" );-- if ( position === "absolute" || position === "fixed" ) {- return;- }- maxHeight -= elem.outerHeight( true );- });- if ( overflow ) {- parent.css( "overflow", overflow );- }-- this.headers.each(function() {- maxHeight -= $( this ).outerHeight( true );- });-- this.headers.next()- .each(function() {- $( this ).height( Math.max( 0, maxHeight -- $( this ).innerHeight() + $( this ).height() ) );- })- .css( "overflow", "auto" );- } else if ( heightStyle === "auto" ) {- maxHeight = 0;- this.headers.next()- .each(function() {- maxHeight = Math.max( maxHeight, $( this ).height( "" ).height() );- })- .height( maxHeight );- }- },-- _activate: function( index ) {- var active = this._findActive( index )[ 0 ];-- // trying to activate the already active panel- if ( active === this.active[ 0 ] ) {- return;- }-- // trying to collapse, simulate a click on the currently active header- active = active || this.active[ 0 ];-- this._eventHandler({- target: active,- currentTarget: active,- preventDefault: $.noop- });- },-- _findActive: function( selector ) {- return typeof selector === "number" ? this.headers.eq( selector ) : $();- },-- _setupEvents: function( event ) {- var events = {};- if ( !event ) {- return;- }- $.each( event.split(" "), function( index, eventName ) {- events[ eventName ] = "_eventHandler";- });- this._on( this.headers, events );- },-- _eventHandler: function( event ) {- var options = this.options,- active = this.active,- clicked = $( event.currentTarget ),- clickedIsActive = clicked[ 0 ] === active[ 0 ],- collapsing = clickedIsActive && options.collapsible,- toShow = collapsing ? $() : clicked.next(),- toHide = active.next(),- eventData = {- oldHeader: active,- oldPanel: toHide,- newHeader: collapsing ? $() : clicked,- newPanel: toShow- };-- event.preventDefault();-- if (- // click on active header, but not collapsible- ( clickedIsActive && !options.collapsible ) ||- // allow canceling activation- ( this._trigger( "beforeActivate", event, eventData ) === false ) ) {- return;- }-- options.active = collapsing ? false : this.headers.index( clicked );-- // when the call to ._toggle() comes after the class changes- // it causes a very odd bug in IE 8 (see #6720)- this.active = clickedIsActive ? $() : clicked;- this._toggle( eventData );-- // switch classes- // corner classes on the previously active header stay after the animation- active.removeClass( "ui-accordion-header-active ui-state-active" );- if ( options.icons ) {- active.children( ".ui-accordion-header-icon" )- .removeClass( options.icons.activeHeader )- .addClass( options.icons.header );- }-- if ( !clickedIsActive ) {- clicked- .removeClass( "ui-corner-all" )- .addClass( "ui-accordion-header-active ui-state-active ui-corner-top" );- if ( options.icons ) {- clicked.children( ".ui-accordion-header-icon" )- .removeClass( options.icons.header )- .addClass( options.icons.activeHeader );- }-- clicked- .next()- .addClass( "ui-accordion-content-active" );- }- },-- _toggle: function( data ) {- var toShow = data.newPanel,- toHide = this.prevShow.length ? this.prevShow : data.oldPanel;-- // handle activating a panel during the animation for another activation- this.prevShow.add( this.prevHide ).stop( true, true );- this.prevShow = toShow;- this.prevHide = toHide;-- if ( this.options.animate ) {- this._animate( toShow, toHide, data );- } else {- toHide.hide();- toShow.show();- this._toggleComplete( data );- }-- toHide.attr({- "aria-expanded": "false",- "aria-hidden": "true"- });- toHide.prev().attr( "aria-selected", "false" );- // if we're switching panels, remove the old header from the tab order- // if we're opening from collapsed state, remove the previous header from the tab order- // if we're collapsing, then keep the collapsing header in the tab order- if ( toShow.length && toHide.length ) {- toHide.prev().attr( "tabIndex", -1 );- } else if ( toShow.length ) {- this.headers.filter(function() {- return $( this ).attr( "tabIndex" ) === 0;- })- .attr( "tabIndex", -1 );- }-- toShow- .attr({- "aria-expanded": "true",- "aria-hidden": "false"- })- .prev()- .attr({- "aria-selected": "true",- tabIndex: 0- });- },-- _animate: function( toShow, toHide, data ) {- var total, easing, duration,- that = this,- adjust = 0,- down = toShow.length &&- ( !toHide.length || ( toShow.index() < toHide.index() ) ),- animate = this.options.animate || {},- options = down && animate.down || animate,- complete = function() {- that._toggleComplete( data );- };-- if ( typeof options === "number" ) {- duration = options;- }- if ( typeof options === "string" ) {- easing = options;- }- // fall back from options to animation in case of partial down settings- easing = easing || options.easing || animate.easing;- duration = duration || options.duration || animate.duration;-- if ( !toHide.length ) {- return toShow.animate( showProps, duration, easing, complete );- }- if ( !toShow.length ) {- return toHide.animate( hideProps, duration, easing, complete );- }-- total = toShow.show().outerHeight();- toHide.animate( hideProps, {- duration: duration,- easing: easing,- step: function( now, fx ) {- fx.now = Math.round( now );- }- });- toShow- .hide()- .animate( showProps, {- duration: duration,- easing: easing,- complete: complete,- step: function( now, fx ) {- fx.now = Math.round( now );- if ( fx.prop !== "height" ) {- adjust += fx.now;- } else if ( that.options.heightStyle !== "content" ) {- fx.now = Math.round( total - toHide.outerHeight() - adjust );- adjust = 0;- }- }- });- },-- _toggleComplete: function( data ) {- var toHide = data.oldPanel;-- toHide- .removeClass( "ui-accordion-content-active" )- .prev()- .removeClass( "ui-corner-top" )- .addClass( "ui-corner-all" );-- // Work around for rendering bug in IE (#5421)- if ( toHide.length ) {- toHide.parent()[0].className = toHide.parent()[0].className;- }-- this._trigger( "activate", null, data );- }-});----// DEPRECATED-if ( $.uiBackCompat !== false ) {- // navigation options- (function( $, prototype ) {- $.extend( prototype.options, {- navigation: false,- navigationFilter: function() {- return this.href.toLowerCase() === location.href.toLowerCase();- }- });-- var _create = prototype._create;- prototype._create = function() {- if ( this.options.navigation ) {- var that = this,- headers = this.element.find( this.options.header ),- content = headers.next(),- current = headers.add( content )- .find( "a" )- .filter( this.options.navigationFilter )- [ 0 ];- if ( current ) {- headers.add( content ).each( function( index ) {- if ( $.contains( this, current ) ) {- that.options.active = Math.floor( index / 2 );- return false;- }- });- }- }- _create.call( this );- };- }( jQuery, jQuery.ui.accordion.prototype ) );-- // height options- (function( $, prototype ) {- $.extend( prototype.options, {- heightStyle: null, // remove default so we fall back to old values- autoHeight: true, // use heightStyle: "auto"- clearStyle: false, // use heightStyle: "content"- fillSpace: false // use heightStyle: "fill"- });-- var _create = prototype._create,- _setOption = prototype._setOption;-- $.extend( prototype, {- _create: function() {- this.options.heightStyle = this.options.heightStyle ||- this._mergeHeightStyle();-- _create.call( this );- },-- _setOption: function( key ) {- if ( key === "autoHeight" || key === "clearStyle" || key === "fillSpace" ) {- this.options.heightStyle = this._mergeHeightStyle();- }- _setOption.apply( this, arguments );- },-- _mergeHeightStyle: function() {- var options = this.options;-- if ( options.fillSpace ) {- return "fill";- }-- if ( options.clearStyle ) {- return "content";- }-- if ( options.autoHeight ) {- return "auto";- }- }- });- }( jQuery, jQuery.ui.accordion.prototype ) );-- // icon options- (function( $, prototype ) {- $.extend( prototype.options.icons, {- activeHeader: null, // remove default so we fall back to old values- headerSelected: "ui-icon-triangle-1-s"- });-- var _createIcons = prototype._createIcons;- prototype._createIcons = function() {- if ( this.options.icons ) {- this.options.icons.activeHeader = this.options.icons.activeHeader ||- this.options.icons.headerSelected;- }- _createIcons.call( this );- };- }( jQuery, jQuery.ui.accordion.prototype ) );-- // expanded active option, activate method- (function( $, prototype ) {- prototype.activate = prototype._activate;-- var _findActive = prototype._findActive;- prototype._findActive = function( index ) {- if ( index === -1 ) {- index = false;- }- if ( index && typeof index !== "number" ) {- index = this.headers.index( this.headers.filter( index ) );- if ( index === -1 ) {- index = false;- }- }- return _findActive.call( this, index );- };- }( jQuery, jQuery.ui.accordion.prototype ) );-- // resize method- jQuery.ui.accordion.prototype.resize = jQuery.ui.accordion.prototype.refresh;-- // change events- (function( $, prototype ) {- $.extend( prototype.options, {- change: null,- changestart: null- });-- var _trigger = prototype._trigger;- prototype._trigger = function( type, event, data ) {- var ret = _trigger.apply( this, arguments );- if ( !ret ) {- return false;- }-- if ( type === "beforeActivate" ) {- ret = _trigger.call( this, "changestart", event, {- oldHeader: data.oldHeader,- oldContent: data.oldPanel,- newHeader: data.newHeader,- newContent: data.newPanel- });- } else if ( type === "activate" ) {- ret = _trigger.call( this, "change", event, {- oldHeader: data.oldHeader,- oldContent: data.oldPanel,- newHeader: data.newHeader,- newContent: data.newPanel- });- }- return ret;- };- }( jQuery, jQuery.ui.accordion.prototype ) );-- // animated option- // NOTE: this only provides support for "slide", "bounceslide", and easings- // not the full $.ui.accordion.animations API- (function( $, prototype ) {- $.extend( prototype.options, {- animate: null,- animated: "slide"- });-- var _create = prototype._create;- prototype._create = function() {- var options = this.options;- if ( options.animate === null ) {- if ( !options.animated ) {- options.animate = false;- } else if ( options.animated === "slide" ) {- options.animate = 300;- } else if ( options.animated === "bounceslide" ) {- options.animate = {- duration: 200,- down: {- easing: "easeOutBounce",- duration: 1000- }- };- } else {- options.animate = options.animated;- }- }-- _create.call( this );- };- }( jQuery, jQuery.ui.accordion.prototype ) );-}--})( jQuery );-(function( $, undefined ) {--// used to prevent race conditions with remote data sources-var requestIndex = 0;--$.widget( "ui.autocomplete", {- version: "1.9.1",- defaultElement: "<input>",- options: {- appendTo: "body",- autoFocus: false,- delay: 300,- minLength: 1,- position: {- my: "left top",- at: "left bottom",- collision: "none"- },- source: null,-- // callbacks- change: null,- close: null,- focus: null,- open: null,- response: null,- search: null,- select: null- },-- pending: 0,-- _create: function() {- // Some browsers only repeat keydown events, not keypress events,- // so we use the suppressKeyPress flag to determine if we've already- // handled the keydown event. #7269- // Unfortunately the code for & in keypress is the same as the up arrow,- // so we use the suppressKeyPressRepeat flag to avoid handling keypress- // events when we know the keydown event was used to modify the- // search term. #7799- var suppressKeyPress, suppressKeyPressRepeat, suppressInput;-- this.isMultiLine = this._isMultiLine();- this.valueMethod = this.element[ this.element.is( "input,textarea" ) ? "val" : "text" ];- this.isNewMenu = true;-- this.element- .addClass( "ui-autocomplete-input" )- .attr( "autocomplete", "off" );-- this._on( this.element, {- keydown: function( event ) {- if ( this.element.prop( "readOnly" ) ) {- suppressKeyPress = true;- suppressInput = true;- suppressKeyPressRepeat = true;- return;- }-- suppressKeyPress = false;- suppressInput = false;- suppressKeyPressRepeat = false;- var keyCode = $.ui.keyCode;- switch( event.keyCode ) {- case keyCode.PAGE_UP:- suppressKeyPress = true;- this._move( "previousPage", event );- break;- case keyCode.PAGE_DOWN:- suppressKeyPress = true;- this._move( "nextPage", event );- break;- case keyCode.UP:- suppressKeyPress = true;- this._keyEvent( "previous", event );- break;- case keyCode.DOWN:- suppressKeyPress = true;- this._keyEvent( "next", event );- break;- case keyCode.ENTER:- case keyCode.NUMPAD_ENTER:- // when menu is open and has focus- if ( this.menu.active ) {- // #6055 - Opera still allows the keypress to occur- // which causes forms to submit- suppressKeyPress = true;- event.preventDefault();- this.menu.select( event );- }- break;- case keyCode.TAB:- if ( this.menu.active ) {- this.menu.select( event );- }- break;- case keyCode.ESCAPE:- if ( this.menu.element.is( ":visible" ) ) {- this._value( this.term );- this.close( event );- // Different browsers have different default behavior for escape- // Single press can mean undo or clear- // Double press in IE means clear the whole form- event.preventDefault();- }- break;- default:- suppressKeyPressRepeat = true;- // search timeout should be triggered before the input value is changed- this._searchTimeout( event );- break;- }- },- keypress: function( event ) {- if ( suppressKeyPress ) {- suppressKeyPress = false;- event.preventDefault();- return;- }- if ( suppressKeyPressRepeat ) {- return;- }-- // replicate some key handlers to allow them to repeat in Firefox and Opera- var keyCode = $.ui.keyCode;- switch( event.keyCode ) {- case keyCode.PAGE_UP:- this._move( "previousPage", event );- break;- case keyCode.PAGE_DOWN:- this._move( "nextPage", event );- break;- case keyCode.UP:- this._keyEvent( "previous", event );- break;- case keyCode.DOWN:- this._keyEvent( "next", event );- break;- }- },- input: function( event ) {- if ( suppressInput ) {- suppressInput = false;- event.preventDefault();- return;- }- this._searchTimeout( event );- },- focus: function() {- this.selectedItem = null;- this.previous = this._value();- },- blur: function( event ) {- if ( this.cancelBlur ) {- delete this.cancelBlur;- return;- }-- clearTimeout( this.searching );- this.close( event );- this._change( event );- }- });-- this._initSource();- this.menu = $( "<ul>" )- .addClass( "ui-autocomplete" )- .appendTo( this.document.find( this.options.appendTo || "body" )[ 0 ] )- .menu({- // custom key handling for now- input: $(),- // disable ARIA support, the live region takes care of that- role: null- })- .zIndex( this.element.zIndex() + 1 )- .hide()- .data( "menu" );-- this._on( this.menu.element, {- mousedown: function( event ) {- // prevent moving focus out of the text field- event.preventDefault();-- // IE doesn't prevent moving focus even with event.preventDefault()- // so we set a flag to know when we should ignore the blur event- this.cancelBlur = true;- this._delay(function() {- delete this.cancelBlur;- });-- // clicking on the scrollbar causes focus to shift to the body- // but we can't detect a mouseup or a click immediately afterward- // so we have to track the next mousedown and close the menu if- // the user clicks somewhere outside of the autocomplete- var menuElement = this.menu.element[ 0 ];- if ( !$( event.target ).closest( ".ui-menu-item" ).length ) {- this._delay(function() {- var that = this;- this.document.one( "mousedown", function( event ) {- if ( event.target !== that.element[ 0 ] &&- event.target !== menuElement &&- !$.contains( menuElement, event.target ) ) {- that.close();- }- });- });- }- },- menufocus: function( event, ui ) {- // #7024 - Prevent accidental activation of menu items in Firefox- if ( this.isNewMenu ) {- this.isNewMenu = false;- if ( event.originalEvent && /^mouse/.test( event.originalEvent.type ) ) {- this.menu.blur();-- this.document.one( "mousemove", function() {- $( event.target ).trigger( event.originalEvent );- });-- return;- }- }-- // back compat for _renderItem using item.autocomplete, via #7810- // TODO remove the fallback, see #8156- var item = ui.item.data( "ui-autocomplete-item" ) || ui.item.data( "item.autocomplete" );- if ( false !== this._trigger( "focus", event, { item: item } ) ) {- // use value to match what will end up in the input, if it was a key event- if ( event.originalEvent && /^key/.test( event.originalEvent.type ) ) {- this._value( item.value );- }- } else {- // Normally the input is populated with the item's value as the- // menu is navigated, causing screen readers to notice a change and- // announce the item. Since the focus event was canceled, this doesn't- // happen, so we update the live region so that screen readers can- // still notice the change and announce it.- this.liveRegion.text( item.value );- }- },- menuselect: function( event, ui ) {- // back compat for _renderItem using item.autocomplete, via #7810- // TODO remove the fallback, see #8156- var item = ui.item.data( "ui-autocomplete-item" ) || ui.item.data( "item.autocomplete" ),- previous = this.previous;-- // only trigger when focus was lost (click on menu)- if ( this.element[0] !== this.document[0].activeElement ) {- this.element.focus();- this.previous = previous;- // #6109 - IE triggers two focus events and the second- // is asynchronous, so we need to reset the previous- // term synchronously and asynchronously :-(- this._delay(function() {- this.previous = previous;- this.selectedItem = item;- });- }-- if ( false !== this._trigger( "select", event, { item: item } ) ) {- this._value( item.value );- }- // reset the term after the select event- // this allows custom select handling to work properly- this.term = this._value();-- this.close( event );- this.selectedItem = item;- }- });-- this.liveRegion = $( "<span>", {- role: "status",- "aria-live": "polite"- })- .addClass( "ui-helper-hidden-accessible" )- .insertAfter( this.element );-- if ( $.fn.bgiframe ) {- this.menu.element.bgiframe();- }-- // turning off autocomplete prevents the browser from remembering the- // value when navigating through history, so we re-enable autocomplete- // if the page is unloaded before the widget is destroyed. #7790- 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( key, value ) {- this._super( key, value );- if ( key === "source" ) {- this._initSource();- }- if ( key === "appendTo" ) {- this.menu.element.appendTo( this.document.find( value || "body" )[0] );- }- if ( key === "disabled" && value && this.xhr ) {- this.xhr.abort();- }- },-- _isMultiLine: function() {- // Textareas are always multi-line- if ( this.element.is( "textarea" ) ) {- return true;- }- // Inputs are always single-line, even if inside a contentEditable element- // IE also treats inputs as contentEditable- if ( this.element.is( "input" ) ) {- return false;- }- // All other element types are determined by whether or not they're contentEditable- return this.element.prop( "isContentEditable" );- },-- _initSource: function() {- var array, url,- that = this;- if ( $.isArray(this.options.source) ) {- array = this.options.source;- this.source = function( request, response ) {- response( $.ui.autocomplete.filter( array, request.term ) );- };- } else if ( typeof this.options.source === "string" ) {- url = this.options.source;- this.source = function( request, response ) {- if ( that.xhr ) {- that.xhr.abort();- }- that.xhr = $.ajax({- url: url,- data: request,- dataType: "json",- success: function( data ) {- response( data );- },- error: function() {- response( [] );- }- });- };- } else {- this.source = this.options.source;- }- },-- _searchTimeout: function( event ) {- clearTimeout( this.searching );- this.searching = this._delay(function() {- // only search if the value has changed- if ( this.term !== this._value() ) {- this.selectedItem = null;- this.search( null, event );- }- }, this.options.delay );- },-- search: function( value, event ) {- value = value != null ? value : this._value();-- // always save the actual value, not the one passed as an argument- this.term = this._value();-- if ( value.length < this.options.minLength ) {- return this.close( event );- }-- if ( this._trigger( "search", event ) === false ) {- return;- }-- return this._search( value );- },-- _search: function( value ) {- this.pending++;- this.element.addClass( "ui-autocomplete-loading" );- this.cancelSearch = false;-- this.source( { term: value }, this._response() );- },-- _response: function() {- var that = this,- index = ++requestIndex;-- return function( content ) {- if ( index === requestIndex ) {- that.__response( content );- }-- that.pending--;- if ( !that.pending ) {- that.element.removeClass( "ui-autocomplete-loading" );- }- };- },-- __response: function( content ) {- if ( content ) {- content = this._normalize( content );- }- this._trigger( "response", null, { content: content } );- if ( !this.options.disabled && content && content.length && !this.cancelSearch ) {- this._suggest( content );- this._trigger( "open" );- } else {- // use ._close() instead of .close() so we don't cancel future searches- this._close();- }- },-- close: function( event ) {- this.cancelSearch = true;- this._close( event );- },-- _close: function( event ) {- if ( this.menu.element.is( ":visible" ) ) {- this.menu.element.hide();- this.menu.blur();- this.isNewMenu = true;- this._trigger( "close", event );- }- },-- _change: function( event ) {- if ( this.previous !== this._value() ) {- this._trigger( "change", event, { item: this.selectedItem } );- }- },-- _normalize: function( items ) {- // assume all items have the right format when the first item is complete- if ( items.length && items[0].label && items[0].value ) {- return items;- }- return $.map( items, function( item ) {- if ( typeof item === "string" ) {- return {- label: item,- value: item- };- }- return $.extend({- label: item.label || item.value,- value: item.value || item.label- }, item );- });- },-- _suggest: function( items ) {- var ul = this.menu.element- .empty()- .zIndex( this.element.zIndex() + 1 );- this._renderMenu( ul, items );- this.menu.refresh();-- // size and position menu- ul.show();- this._resizeMenu();- ul.position( $.extend({- of: this.element- }, this.options.position ));-- if ( this.options.autoFocus ) {- this.menu.next();- }- },-- _resizeMenu: function() {- var ul = this.menu.element;- ul.outerWidth( Math.max(- // Firefox wraps long text (possibly a rounding bug)- // so we add 1px to avoid the wrapping (#7513)- ul.width( "" ).outerWidth() + 1,- this.element.outerWidth()- ) );- },-- _renderMenu: function( ul, items ) {- var that = this;- $.each( items, function( index, item ) {- that._renderItemData( ul, item );- });- },-- _renderItemData: function( ul, item ) {- return this._renderItem( ul, item ).data( "ui-autocomplete-item", item );- },-- _renderItem: function( ul, item ) {- return $( "<li>" )- .append( $( "<a>" ).text( item.label ) )- .appendTo( ul );- },-- _move: function( direction, event ) {- if ( !this.menu.element.is( ":visible" ) ) {- this.search( null, event );- return;- }- if ( this.menu.isFirstItem() && /^previous/.test( direction ) ||- this.menu.isLastItem() && /^next/.test( direction ) ) {- this._value( this.term );- this.menu.blur();- return;- }- this.menu[ direction ]( event );- },-- widget: function() {- return this.menu.element;- },-- _value: function() {- return this.valueMethod.apply( this.element, arguments );- },-- _keyEvent: function( keyEvent, event ) {- if ( !this.isMultiLine || this.menu.element.is( ":visible" ) ) {- this._move( keyEvent, event );-- // prevents moving cursor to beginning/end of the text field in some browsers- event.preventDefault();- }- }-});--$.extend( $.ui.autocomplete, {- escapeRegex: function( value ) {- return value.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g, "\\$&");- },- filter: function(array, term) {- var matcher = new RegExp( $.ui.autocomplete.escapeRegex(term), "i" );- return $.grep( array, function(value) {- return matcher.test( value.label || value.value || value );- });- }-});---// live region extension, adding a `messages` option-// NOTE: This is an experimental API. We are still investigating-// a full solution for string manipulation and internationalization.-$.widget( "ui.autocomplete", $.ui.autocomplete, {- options: {- messages: {- noResults: "No search results.",- results: function( amount ) {- return amount + ( amount > 1 ? " results are" : " result is" ) +- " available, use up and down arrow keys to navigate.";- }- }- },-- __response: function( content ) {- var message;- this._superApply( arguments );- if ( this.options.disabled || this.cancelSearch ) {- return;- }- if ( content && content.length ) {- message = this.options.messages.results( content.length );- } else {- message = this.options.messages.noResults;- }- this.liveRegion.text( message );- }-});---}( jQuery ));-(function( $, undefined ) {--var lastActive, startXPos, startYPos, clickDragged,- baseClasses = "ui-button ui-widget ui-state-default ui-corner-all",- stateClasses = "ui-state-hover ui-state-active ",- typeClasses = "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",- formResetHandler = function() {- var buttons = $( this ).find( ":ui-button" );- setTimeout(function() {- buttons.button( "refresh" );- }, 1 );- },- radioGroup = function( radio ) {- var name = radio.name,- form = radio.form,- radios = $( [] );- if ( name ) {- if ( form ) {- radios = $( form ).find( "[name='" + name + "']" );- } else {- radios = $( "[name='" + name + "']", radio.ownerDocument )- .filter(function() {- return !this.form;- });- }- }- return radios;- };--$.widget( "ui.button", {- version: "1.9.1",- defaultElement: "<button>",- options: {- disabled: null,- text: true,- label: null,- icons: {- primary: null,- secondary: null- }- },- _create: function() {- this.element.closest( "form" )- .unbind( "reset" + this.eventNamespace )- .bind( "reset" + this.eventNamespace, formResetHandler );-- if ( typeof this.options.disabled !== "boolean" ) {- this.options.disabled = !!this.element.prop( "disabled" );- } else {- this.element.prop( "disabled", this.options.disabled );- }-- this._determineButtonType();- this.hasTitle = !!this.buttonElement.attr( "title" );-- var that = this,- options = this.options,- toggleButton = this.type === "checkbox" || this.type === "radio",- hoverClass = "ui-state-hover" + ( !toggleButton ? " ui-state-active" : "" ),- focusClass = "ui-state-focus";-- if ( options.label === null ) {- options.label = (this.type === "input" ? this.buttonElement.val() : this.buttonElement.html());- }-- this.buttonElement- .addClass( baseClasses )- .attr( "role", "button" )- .bind( "mouseenter" + this.eventNamespace, function() {- if ( options.disabled ) {- return;- }- $( this ).addClass( "ui-state-hover" );- if ( this === lastActive ) {- $( this ).addClass( "ui-state-active" );- }- })- .bind( "mouseleave" + this.eventNamespace, function() {- if ( options.disabled ) {- return;- }- $( this ).removeClass( hoverClass );- })- .bind( "click" + this.eventNamespace, function( event ) {- if ( options.disabled ) {- event.preventDefault();- event.stopImmediatePropagation();- }- });-- this.element- .bind( "focus" + this.eventNamespace, function() {- // no need to check disabled, focus won't be triggered anyway- that.buttonElement.addClass( focusClass );- })- .bind( "blur" + this.eventNamespace, function() {- that.buttonElement.removeClass( focusClass );- });-- if ( toggleButton ) {- this.element.bind( "change" + this.eventNamespace, function() {- if ( clickDragged ) {- return;- }- that.refresh();- });- // if mouse moves between mousedown and mouseup (drag) set clickDragged flag- // prevents issue where button state changes but checkbox/radio checked state- // does not in Firefox (see ticket #6970)- this.buttonElement- .bind( "mousedown" + this.eventNamespace, function( event ) {- if ( options.disabled ) {- return;- }- clickDragged = false;- startXPos = event.pageX;- startYPos = event.pageY;- })- .bind( "mouseup" + this.eventNamespace, function( event ) {- if ( options.disabled ) {- return;- }- if ( startXPos !== event.pageX || startYPos !== event.pageY ) {- clickDragged = true;- }- });- }-- if ( this.type === "checkbox" ) {- this.buttonElement.bind( "click" + this.eventNamespace, function() {- if ( options.disabled || clickDragged ) {- return false;- }- $( this ).toggleClass( "ui-state-active" );- that.buttonElement.attr( "aria-pressed", that.element[0].checked );- });- } else if ( this.type === "radio" ) {- this.buttonElement.bind( "click" + this.eventNamespace, function() {- if ( options.disabled || clickDragged ) {- return false;- }- $( this ).addClass( "ui-state-active" );- that.buttonElement.attr( "aria-pressed", "true" );-- var radio = that.element[ 0 ];- radioGroup( radio )- .not( radio )- .map(function() {- return $( this ).button( "widget" )[ 0 ];- })- .removeClass( "ui-state-active" )- .attr( "aria-pressed", "false" );- });- } else {- this.buttonElement- .bind( "mousedown" + this.eventNamespace, function() {- if ( options.disabled ) {- return false;- }- $( this ).addClass( "ui-state-active" );- lastActive = this;- that.document.one( "mouseup", function() {- lastActive = null;- });- })- .bind( "mouseup" + this.eventNamespace, function() {- if ( options.disabled ) {- return false;- }- $( this ).removeClass( "ui-state-active" );- })- .bind( "keydown" + this.eventNamespace, function(event) {- if ( options.disabled ) {- return false;- }- if ( event.keyCode === $.ui.keyCode.SPACE || event.keyCode === $.ui.keyCode.ENTER ) {- $( this ).addClass( "ui-state-active" );- }- })- .bind( "keyup" + this.eventNamespace, function() {- $( this ).removeClass( "ui-state-active" );- });-- if ( this.buttonElement.is("a") ) {- this.buttonElement.keyup(function(event) {- if ( event.keyCode === $.ui.keyCode.SPACE ) {- // TODO pass through original event correctly (just as 2nd argument doesn't work)- $( this ).click();- }- });- }- }-- // TODO: pull out $.Widget's handling for the disabled option into- // $.Widget.prototype._setOptionDisabled so it's easy to proxy and can- // be overridden by individual plugins- this._setOption( "disabled", options.disabled );- this._resetButton();- },-- _determineButtonType: function() {- var ancestor, labelSelector, checked;-- if ( this.element.is("[type=checkbox]") ) {- this.type = "checkbox";- } else if ( this.element.is("[type=radio]") ) {- this.type = "radio";- } else if ( this.element.is("input") ) {- this.type = "input";- } else {- this.type = "button";- }-- if ( this.type === "checkbox" || this.type === "radio" ) {- // we don't search against the document in case the element- // is disconnected from the DOM- ancestor = this.element.parents().last();- labelSelector = "label[for='" + this.element.attr("id") + "']";- this.buttonElement = ancestor.find( labelSelector );- if ( !this.buttonElement.length ) {- ancestor = ancestor.length ? ancestor.siblings() : this.element.siblings();- this.buttonElement = ancestor.filter( labelSelector );- if ( !this.buttonElement.length ) {- this.buttonElement = ancestor.find( labelSelector );- }- }- this.element.addClass( "ui-helper-hidden-accessible" );-- checked = this.element.is( ":checked" );- if ( checked ) {- this.buttonElement.addClass( "ui-state-active" );- }- this.buttonElement.prop( "aria-pressed", checked );- } else {- this.buttonElement = this.element;- }- },-- widget: function() {- return this.buttonElement;- },-- _destroy: function() {- this.element- .removeClass( "ui-helper-hidden-accessible" );- this.buttonElement- .removeClass( baseClasses + " " + stateClasses + " " + typeClasses )- .removeAttr( "role" )- .removeAttr( "aria-pressed" )- .html( this.buttonElement.find(".ui-button-text").html() );-- if ( !this.hasTitle ) {- this.buttonElement.removeAttr( "title" );- }- },-- _setOption: function( key, value ) {- this._super( key, value );- if ( key === "disabled" ) {- if ( value ) {- this.element.prop( "disabled", true );- } else {- this.element.prop( "disabled", false );- }- return;- }- this._resetButton();- },-- refresh: function() {- var isDisabled = this.element.is( ":disabled" ) || this.element.hasClass( "ui-button-disabled" );- if ( isDisabled !== this.options.disabled ) {- this._setOption( "disabled", isDisabled );- }- if ( this.type === "radio" ) {- radioGroup( this.element[0] ).each(function() {- if ( $( this ).is( ":checked" ) ) {- $( this ).button( "widget" )- .addClass( "ui-state-active" )- .attr( "aria-pressed", "true" );- } else {- $( this ).button( "widget" )- .removeClass( "ui-state-active" )- .attr( "aria-pressed", "false" );- }- });- } else if ( this.type === "checkbox" ) {- if ( this.element.is( ":checked" ) ) {- this.buttonElement- .addClass( "ui-state-active" )- .attr( "aria-pressed", "true" );- } else {- this.buttonElement- .removeClass( "ui-state-active" )- .attr( "aria-pressed", "false" );- }- }- },-- _resetButton: function() {- if ( this.type === "input" ) {- if ( this.options.label ) {- this.element.val( this.options.label );- }- return;- }- var buttonElement = this.buttonElement.removeClass( typeClasses ),- buttonText = $( "<span></span>", this.document[0] )- .addClass( "ui-button-text" )- .html( this.options.label )- .appendTo( buttonElement.empty() )- .text(),- icons = this.options.icons,- multipleIcons = icons.primary && icons.secondary,- buttonClasses = [];-- if ( icons.primary || icons.secondary ) {- if ( this.options.text ) {- buttonClasses.push( "ui-button-text-icon" + ( multipleIcons ? "s" : ( icons.primary ? "-primary" : "-secondary" ) ) );- }-- if ( icons.primary ) {- buttonElement.prepend( "<span class='ui-button-icon-primary ui-icon " + icons.primary + "'></span>" );- }-- if ( icons.secondary ) {- buttonElement.append( "<span class='ui-button-icon-secondary ui-icon " + icons.secondary + "'></span>" );- }-- if ( !this.options.text ) {- buttonClasses.push( multipleIcons ? "ui-button-icons-only" : "ui-button-icon-only" );-- if ( !this.hasTitle ) {- buttonElement.attr( "title", $.trim( buttonText ) );- }- }- } else {- buttonClasses.push( "ui-button-text-only" );- }- buttonElement.addClass( buttonClasses.join( " " ) );- }-});--$.widget( "ui.buttonset", {- version: "1.9.1",- options: {- items: "button, input[type=button], input[type=submit], input[type=reset], input[type=checkbox], input[type=radio], a, :data(button)"- },-- _create: function() {- this.element.addClass( "ui-buttonset" );- },-- _init: function() {- this.refresh();- },-- _setOption: function( key, value ) {- if ( key === "disabled" ) {- this.buttons.button( "option", key, value );- }-- this._super( key, value );- },-- refresh: function() {- var rtl = this.element.css( "direction" ) === "rtl";-- this.buttons = this.element.find( this.options.items )- .filter( ":ui-button" )- .button( "refresh" )- .end()- .not( ":ui-button" )- .button()- .end()- .map(function() {- return $( this ).button( "widget" )[ 0 ];- })- .removeClass( "ui-corner-all ui-corner-left ui-corner-right" )- .filter( ":first" )- .addClass( rtl ? "ui-corner-right" : "ui-corner-left" )- .end()- .filter( ":last" )- .addClass( rtl ? "ui-corner-left" : "ui-corner-right" )- .end()- .end();- },-- _destroy: function() {- this.element.removeClass( "ui-buttonset" );- this.buttons- .map(function() {- return $( this ).button( "widget" )[ 0 ];- })- .removeClass( "ui-corner-left ui-corner-right" )- .end()- .button( "destroy" );- }-});--}( jQuery ) );-(function( $, undefined ) {--$.extend($.ui, { datepicker: { version: "1.9.1" } });--var PROP_NAME = 'datepicker';-var dpuuid = new Date().getTime();-var instActive;--/* Date picker manager.- Use the singleton instance of this class, $.datepicker, to interact with the date picker.- Settings for (groups of) date pickers are maintained in an instance object,- allowing multiple different settings on the same page. */--function Datepicker() {- this.debug = false; // Change this to true to start debugging- this._curInst = null; // The current instance in use- this._keyEvent = false; // If the last event was a key event- this._disabledInputs = []; // List of date picker inputs that have been disabled- this._datepickerShowing = false; // True if the popup picker is showing , false if not- this._inDialog = false; // True if showing within a "dialog", false if not- this._mainDivId = 'ui-datepicker-div'; // The ID of the main datepicker division- this._inlineClass = 'ui-datepicker-inline'; // The name of the inline marker class- this._appendClass = 'ui-datepicker-append'; // The name of the append marker class- this._triggerClass = 'ui-datepicker-trigger'; // The name of the trigger marker class- this._dialogClass = 'ui-datepicker-dialog'; // The name of the dialog marker class- this._disableClass = 'ui-datepicker-disabled'; // The name of the disabled covering marker class- this._unselectableClass = 'ui-datepicker-unselectable'; // The name of the unselectable cell marker class- this._currentClass = 'ui-datepicker-current-day'; // The name of the current day marker class- this._dayOverClass = 'ui-datepicker-days-cell-over'; // The name of the day hover marker class- this.regional = []; // Available regional settings, indexed by language code- this.regional[''] = { // Default regional settings- closeText: 'Done', // Display text for close link- prevText: 'Prev', // Display text for previous month link- nextText: 'Next', // Display text for next month link- currentText: 'Today', // Display text for current month link- monthNames: ['January','February','March','April','May','June',- 'July','August','September','October','November','December'], // Names of months for drop-down and formatting- monthNamesShort: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'], // For formatting- dayNames: ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'], // For formatting- dayNamesShort: ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'], // For formatting- dayNamesMin: ['Su','Mo','Tu','We','Th','Fr','Sa'], // Column headings for days starting at Sunday- weekHeader: 'Wk', // Column header for week of the year- dateFormat: 'mm/dd/yy', // See format options on parseDate- firstDay: 0, // The first day of the week, Sun = 0, Mon = 1, ...- isRTL: false, // True if right-to-left language, false if left-to-right- showMonthAfterYear: false, // True if the year select precedes month, false for month then year- yearSuffix: '' // Additional text to append to the year in the month headers- };- this._defaults = { // Global defaults for all the date picker instances- showOn: 'focus', // 'focus' for popup on focus,- // 'button' for trigger button, or 'both' for either- showAnim: 'fadeIn', // Name of jQuery animation for popup- showOptions: {}, // Options for enhanced animations- defaultDate: null, // Used when field is blank: actual date,- // +/-number for offset from today, null for today- appendText: '', // Display text following the input box, e.g. showing the format- buttonText: '...', // Text for trigger button- buttonImage: '', // URL for trigger button image- buttonImageOnly: false, // True if the image appears alone, false if it appears on a button- hideIfNoPrevNext: false, // True to hide next/previous month links- // if not applicable, false to just disable them- navigationAsDateFormat: false, // True if date formatting applied to prev/today/next links- gotoCurrent: false, // True if today link goes back to current selection instead- changeMonth: false, // True if month can be selected directly, false if only prev/next- changeYear: false, // True if year can be selected directly, false if only prev/next- yearRange: 'c-10:c+10', // Range of years to display in drop-down,- // either relative to today's year (-nn:+nn), relative to currently displayed year- // (c-nn:c+nn), absolute (nnnn:nnnn), or a combination of the above (nnnn:-n)- showOtherMonths: false, // True to show dates in other months, false to leave blank- selectOtherMonths: false, // True to allow selection of dates in other months, false for unselectable- showWeek: false, // True to show week of the year, false to not show it- calculateWeek: this.iso8601Week, // How to calculate the week of the year,- // takes a Date and returns the number of the week for it- shortYearCutoff: '+10', // Short year values < this are in the current century,- // > this are in the previous century,- // string value starting with '+' for current year + value- minDate: null, // The earliest selectable date, or null for no limit- maxDate: null, // The latest selectable date, or null for no limit- duration: 'fast', // Duration of display/closure- beforeShowDay: null, // Function that takes a date and returns an array with- // [0] = true if selectable, false if not, [1] = custom CSS class name(s) or '',- // [2] = cell title (optional), e.g. $.datepicker.noWeekends- beforeShow: null, // Function that takes an input field and- // returns a set of custom settings for the date picker- onSelect: null, // Define a callback function when a date is selected- onChangeMonthYear: null, // Define a callback function when the month or year is changed- onClose: null, // Define a callback function when the datepicker is closed- numberOfMonths: 1, // Number of months to show at a time- showCurrentAtPos: 0, // The position in multipe months at which to show the current month (starting at 0)- stepMonths: 1, // Number of months to step back/forward- stepBigMonths: 12, // Number of months to step back/forward for the big links- altField: '', // Selector for an alternate field to store selected dates into- altFormat: '', // The date format to use for the alternate field- constrainInput: true, // The input is constrained by the current date format- showButtonPanel: false, // True to show button panel, false to not show it- autoSize: false, // True to size the input for the date format, false to leave as is- disabled: false // The initial disabled state- };- $.extend(this._defaults, this.regional['']);- this.dpDiv = bindHover($('<div id="' + this._mainDivId + '" class="ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all"></div>'));-}--$.extend(Datepicker.prototype, {- /* Class name added to elements to indicate already configured with a date picker. */- markerClassName: 'hasDatepicker',-- //Keep track of the maximum number of rows displayed (see #7043)- maxRows: 4,-- /* Debug logging (if enabled). */- log: function () {- if (this.debug)- console.log.apply('', arguments);- },-- // TODO rename to "widget" when switching to widget factory- _widgetDatepicker: function() {- return this.dpDiv;- },-- /* Override the default settings for all instances of the date picker.- @param settings object - the new settings to use as defaults (anonymous object)- @return the manager object */- setDefaults: function(settings) {- extendRemove(this._defaults, settings || {});- return this;- },-- /* Attach the date picker to a jQuery selection.- @param target element - the target input field or division or span- @param settings object - the new settings to use for this date picker instance (anonymous) */- _attachDatepicker: function(target, settings) {- // check for settings on the control itself - in namespace 'date:'- var inlineSettings = null;- for (var attrName in this._defaults) {- var attrValue = target.getAttribute('date:' + attrName);- if (attrValue) {- inlineSettings = inlineSettings || {};- try {- inlineSettings[attrName] = eval(attrValue);- } catch (err) {- inlineSettings[attrName] = attrValue;- }- }- }- var nodeName = target.nodeName.toLowerCase();- var inline = (nodeName == 'div' || nodeName == 'span');- if (!target.id) {- this.uuid += 1;- target.id = 'dp' + this.uuid;- }- var inst = this._newInst($(target), inline);- inst.settings = $.extend({}, settings || {}, inlineSettings || {});- if (nodeName == 'input') {- this._connectDatepicker(target, inst);- } else if (inline) {- this._inlineDatepicker(target, inst);- }- },-- /* Create a new instance object. */- _newInst: function(target, inline) {- var id = target[0].id.replace(/([^A-Za-z0-9_-])/g, '\\\\$1'); // escape jQuery meta chars- return {id: id, input: target, // associated target- selectedDay: 0, selectedMonth: 0, selectedYear: 0, // current selection- drawMonth: 0, drawYear: 0, // month being drawn- inline: inline, // is datepicker inline or not- dpDiv: (!inline ? this.dpDiv : // presentation div- bindHover($('<div class="' + this._inlineClass + ' ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all"></div>')))};- },-- /* Attach the date picker to an input field. */- _connectDatepicker: function(target, inst) {- var input = $(target);- inst.append = $([]);- inst.trigger = $([]);- if (input.hasClass(this.markerClassName))- return;- this._attachments(input, inst);- input.addClass(this.markerClassName).keydown(this._doKeyDown).- keypress(this._doKeyPress).keyup(this._doKeyUp).- bind("setData.datepicker", function(event, key, value) {- inst.settings[key] = value;- }).bind("getData.datepicker", function(event, key) {- return this._get(inst, key);- });- this._autoSize(inst);- $.data(target, PROP_NAME, inst);- //If disabled option is true, disable the datepicker once it has been attached to the input (see ticket #5665)- if( inst.settings.disabled ) {- this._disableDatepicker( target );- }- },-- /* Make attachments based on settings. */- _attachments: function(input, inst) {- var appendText = this._get(inst, 'appendText');- var isRTL = this._get(inst, 'isRTL');- if (inst.append)- inst.append.remove();- if (appendText) {- inst.append = $('<span class="' + this._appendClass + '">' + appendText + '</span>');- input[isRTL ? 'before' : 'after'](inst.append);- }- input.unbind('focus', this._showDatepicker);- if (inst.trigger)- inst.trigger.remove();- var showOn = this._get(inst, 'showOn');- if (showOn == 'focus' || showOn == 'both') // pop-up date picker when in the marked field- input.focus(this._showDatepicker);- if (showOn == 'button' || showOn == 'both') { // pop-up date picker when button clicked- var buttonText = this._get(inst, 'buttonText');- var buttonImage = this._get(inst, 'buttonImage');- inst.trigger = $(this._get(inst, 'buttonImageOnly') ?- $('<img/>').addClass(this._triggerClass).- attr({ src: buttonImage, alt: buttonText, title: buttonText }) :- $('<button type="button"></button>').addClass(this._triggerClass).- html(buttonImage == '' ? buttonText : $('<img/>').attr(- { src:buttonImage, alt:buttonText, title:buttonText })));- input[isRTL ? 'before' : 'after'](inst.trigger);- inst.trigger.click(function() {- if ($.datepicker._datepickerShowing && $.datepicker._lastInput == input[0])- $.datepicker._hideDatepicker();- else if ($.datepicker._datepickerShowing && $.datepicker._lastInput != input[0]) {- $.datepicker._hideDatepicker();- $.datepicker._showDatepicker(input[0]);- } else- $.datepicker._showDatepicker(input[0]);- return false;- });- }- },-- /* Apply the maximum length for the date format. */- _autoSize: function(inst) {- if (this._get(inst, 'autoSize') && !inst.inline) {- var date = new Date(2009, 12 - 1, 20); // Ensure double digits- var dateFormat = this._get(inst, 'dateFormat');- if (dateFormat.match(/[DM]/)) {- var findMax = function(names) {- var max = 0;- var maxI = 0;- for (var i = 0; i < names.length; i++) {- if (names[i].length > max) {- max = names[i].length;- maxI = i;- }- }- return maxI;- };- date.setMonth(findMax(this._get(inst, (dateFormat.match(/MM/) ?- 'monthNames' : 'monthNamesShort'))));- date.setDate(findMax(this._get(inst, (dateFormat.match(/DD/) ?- 'dayNames' : 'dayNamesShort'))) + 20 - date.getDay());- }- inst.input.attr('size', this._formatDate(inst, date).length);- }- },-- /* Attach an inline date picker to a div. */- _inlineDatepicker: function(target, inst) {- var divSpan = $(target);- if (divSpan.hasClass(this.markerClassName))- return;- divSpan.addClass(this.markerClassName).append(inst.dpDiv).- bind("setData.datepicker", function(event, key, value){- inst.settings[key] = value;- }).bind("getData.datepicker", function(event, key){- return this._get(inst, key);- });- $.data(target, PROP_NAME, inst);- this._setDate(inst, this._getDefaultDate(inst), true);- this._updateDatepicker(inst);- this._updateAlternate(inst);- //If disabled option is true, disable the datepicker before showing it (see ticket #5665)- if( inst.settings.disabled ) {- this._disableDatepicker( target );- }- // Set display:block in place of inst.dpDiv.show() which won't work on disconnected elements- // http://bugs.jqueryui.com/ticket/7552 - A Datepicker created on a detached div has zero height- inst.dpDiv.css( "display", "block" );- },-- /* Pop-up the date picker in a "dialog" box.- @param input element - ignored- @param date string or Date - the initial date to display- @param onSelect function - the function to call when a date is selected- @param settings object - update the dialog date picker instance's settings (anonymous object)- @param pos int[2] - coordinates for the dialog's position within the screen or- event - with x/y coordinates or- leave empty for default (screen centre)- @return the manager object */- _dialogDatepicker: function(input, date, onSelect, settings, pos) {- var inst = this._dialogInst; // internal instance- if (!inst) {- this.uuid += 1;- var id = 'dp' + this.uuid;- this._dialogInput = $('<input type="text" id="' + id +- '" style="position: absolute; top: -100px; width: 0px;"/>');- this._dialogInput.keydown(this._doKeyDown);- $('body').append(this._dialogInput);- inst = this._dialogInst = this._newInst(this._dialogInput, false);- inst.settings = {};- $.data(this._dialogInput[0], PROP_NAME, inst);- }- extendRemove(inst.settings, settings || {});- date = (date && date.constructor == Date ? this._formatDate(inst, date) : date);- this._dialogInput.val(date);-- this._pos = (pos ? (pos.length ? pos : [pos.pageX, pos.pageY]) : null);- if (!this._pos) {- var browserWidth = document.documentElement.clientWidth;- var browserHeight = document.documentElement.clientHeight;- var scrollX = document.documentElement.scrollLeft || document.body.scrollLeft;- var scrollY = document.documentElement.scrollTop || document.body.scrollTop;- this._pos = // should use actual width/height below- [(browserWidth / 2) - 100 + scrollX, (browserHeight / 2) - 150 + scrollY];- }-- // move input on screen for focus, but hidden behind dialog- this._dialogInput.css('left', (this._pos[0] + 20) + 'px').css('top', this._pos[1] + 'px');- inst.settings.onSelect = onSelect;- this._inDialog = true;- this.dpDiv.addClass(this._dialogClass);- this._showDatepicker(this._dialogInput[0]);- if ($.blockUI)- $.blockUI(this.dpDiv);- $.data(this._dialogInput[0], PROP_NAME, inst);- return this;- },-- /* Detach a datepicker from its control.- @param target element - the target input field or division or span */- _destroyDatepicker: function(target) {- var $target = $(target);- var inst = $.data(target, PROP_NAME);- if (!$target.hasClass(this.markerClassName)) {- return;- }- var nodeName = target.nodeName.toLowerCase();- $.removeData(target, PROP_NAME);- if (nodeName == 'input') {- inst.append.remove();- inst.trigger.remove();- $target.removeClass(this.markerClassName).- unbind('focus', this._showDatepicker).- unbind('keydown', this._doKeyDown).- unbind('keypress', this._doKeyPress).- unbind('keyup', this._doKeyUp);- } else if (nodeName == 'div' || nodeName == 'span')- $target.removeClass(this.markerClassName).empty();- },-- /* Enable the date picker to a jQuery selection.- @param target element - the target input field or division or span */- _enableDatepicker: function(target) {- var $target = $(target);- var inst = $.data(target, PROP_NAME);- if (!$target.hasClass(this.markerClassName)) {- return;- }- var nodeName = target.nodeName.toLowerCase();- if (nodeName == 'input') {- target.disabled = false;- inst.trigger.filter('button').- each(function() { this.disabled = false; }).end().- filter('img').css({opacity: '1.0', cursor: ''});- }- else if (nodeName == 'div' || nodeName == 'span') {- var inline = $target.children('.' + this._inlineClass);- inline.children().removeClass('ui-state-disabled');- inline.find("select.ui-datepicker-month, select.ui-datepicker-year").- prop("disabled", false);- }- this._disabledInputs = $.map(this._disabledInputs,- function(value) { return (value == target ? null : value); }); // delete entry- },-- /* Disable the date picker to a jQuery selection.- @param target element - the target input field or division or span */- _disableDatepicker: function(target) {- var $target = $(target);- var inst = $.data(target, PROP_NAME);- if (!$target.hasClass(this.markerClassName)) {- return;- }- var nodeName = target.nodeName.toLowerCase();- if (nodeName == 'input') {- target.disabled = true;- inst.trigger.filter('button').- each(function() { this.disabled = true; }).end().- filter('img').css({opacity: '0.5', cursor: 'default'});- }- else if (nodeName == 'div' || nodeName == 'span') {- var inline = $target.children('.' + this._inlineClass);- inline.children().addClass('ui-state-disabled');- inline.find("select.ui-datepicker-month, select.ui-datepicker-year").- prop("disabled", true);- }- this._disabledInputs = $.map(this._disabledInputs,- function(value) { return (value == target ? null : value); }); // delete entry- this._disabledInputs[this._disabledInputs.length] = target;- },-- /* Is the first field in a jQuery collection disabled as a datepicker?- @param target element - the target input field or division or span- @return boolean - true if disabled, false if enabled */- _isDisabledDatepicker: function(target) {- if (!target) {- return false;- }- for (var i = 0; i < this._disabledInputs.length; i++) {- if (this._disabledInputs[i] == target)- return true;- }- return false;- },-- /* Retrieve the instance data for the target control.- @param target element - the target input field or division or span- @return object - the associated instance data- @throws error if a jQuery problem getting data */- _getInst: function(target) {- try {- return $.data(target, PROP_NAME);- }- catch (err) {- throw 'Missing instance data for this datepicker';- }- },-- /* Update or retrieve the settings for a date picker attached to an input field or division.- @param target element - the target input field or division or span- @param name object - the new settings to update or- string - the name of the setting to change or retrieve,- when retrieving also 'all' for all instance settings or- 'defaults' for all global defaults- @param value any - the new value for the setting- (omit if above is an object or to retrieve a value) */- _optionDatepicker: function(target, name, value) {- var inst = this._getInst(target);- if (arguments.length == 2 && typeof name == 'string') {- return (name == 'defaults' ? $.extend({}, $.datepicker._defaults) :- (inst ? (name == 'all' ? $.extend({}, inst.settings) :- this._get(inst, name)) : null));- }- var settings = name || {};- if (typeof name == 'string') {- settings = {};- settings[name] = value;- }- if (inst) {- if (this._curInst == inst) {- this._hideDatepicker();- }- var date = this._getDateDatepicker(target, true);- var minDate = this._getMinMaxDate(inst, 'min');- var maxDate = this._getMinMaxDate(inst, 'max');- extendRemove(inst.settings, settings);- // reformat the old minDate/maxDate values if dateFormat changes and a new minDate/maxDate isn't provided- if (minDate !== null && settings['dateFormat'] !== undefined && settings['minDate'] === undefined)- inst.settings.minDate = this._formatDate(inst, minDate);- if (maxDate !== null && settings['dateFormat'] !== undefined && settings['maxDate'] === undefined)- inst.settings.maxDate = this._formatDate(inst, maxDate);- this._attachments($(target), inst);- this._autoSize(inst);- this._setDate(inst, date);- this._updateAlternate(inst);- this._updateDatepicker(inst);- }- },-- // change method deprecated- _changeDatepicker: function(target, name, value) {- this._optionDatepicker(target, name, value);- },-- /* Redraw the date picker attached to an input field or division.- @param target element - the target input field or division or span */- _refreshDatepicker: function(target) {- var inst = this._getInst(target);- if (inst) {- this._updateDatepicker(inst);- }- },-- /* Set the dates for a jQuery selection.- @param target element - the target input field or division or span- @param date Date - the new date */- _setDateDatepicker: function(target, date) {- var inst = this._getInst(target);- if (inst) {- this._setDate(inst, date);- this._updateDatepicker(inst);- this._updateAlternate(inst);- }- },-- /* Get the date(s) for the first entry in a jQuery selection.- @param target element - the target input field or division or span- @param noDefault boolean - true if no default date is to be used- @return Date - the current date */- _getDateDatepicker: function(target, noDefault) {- var inst = this._getInst(target);- if (inst && !inst.inline)- this._setDateFromField(inst, noDefault);- return (inst ? this._getDate(inst) : null);- },-- /* Handle keystrokes. */- _doKeyDown: function(event) {- var inst = $.datepicker._getInst(event.target);- var handled = true;- var isRTL = inst.dpDiv.is('.ui-datepicker-rtl');- inst._keyEvent = true;- if ($.datepicker._datepickerShowing)- switch (event.keyCode) {- case 9: $.datepicker._hideDatepicker();- handled = false;- break; // hide on tab out- case 13: var sel = $('td.' + $.datepicker._dayOverClass + ':not(.' +- $.datepicker._currentClass + ')', inst.dpDiv);- if (sel[0])- $.datepicker._selectDay(event.target, inst.selectedMonth, inst.selectedYear, sel[0]);- var onSelect = $.datepicker._get(inst, 'onSelect');- if (onSelect) {- var dateStr = $.datepicker._formatDate(inst);-- // trigger custom callback- onSelect.apply((inst.input ? inst.input[0] : null), [dateStr, inst]);- }- else- $.datepicker._hideDatepicker();- return false; // don't submit the form- break; // select the value on enter- case 27: $.datepicker._hideDatepicker();- break; // hide on escape- case 33: $.datepicker._adjustDate(event.target, (event.ctrlKey ?- -$.datepicker._get(inst, 'stepBigMonths') :- -$.datepicker._get(inst, 'stepMonths')), 'M');- break; // previous month/year on page up/+ ctrl- case 34: $.datepicker._adjustDate(event.target, (event.ctrlKey ?- +$.datepicker._get(inst, 'stepBigMonths') :- +$.datepicker._get(inst, 'stepMonths')), 'M');- break; // next month/year on page down/+ ctrl- case 35: if (event.ctrlKey || event.metaKey) $.datepicker._clearDate(event.target);- handled = event.ctrlKey || event.metaKey;- break; // clear on ctrl or command +end- case 36: if (event.ctrlKey || event.metaKey) $.datepicker._gotoToday(event.target);- handled = event.ctrlKey || event.metaKey;- break; // current on ctrl or command +home- case 37: if (event.ctrlKey || event.metaKey) $.datepicker._adjustDate(event.target, (isRTL ? +1 : -1), 'D');- handled = event.ctrlKey || event.metaKey;- // -1 day on ctrl or command +left- if (event.originalEvent.altKey) $.datepicker._adjustDate(event.target, (event.ctrlKey ?- -$.datepicker._get(inst, 'stepBigMonths') :- -$.datepicker._get(inst, 'stepMonths')), 'M');- // next month/year on alt +left on Mac- break;- case 38: if (event.ctrlKey || event.metaKey) $.datepicker._adjustDate(event.target, -7, 'D');- handled = event.ctrlKey || event.metaKey;- break; // -1 week on ctrl or command +up- case 39: if (event.ctrlKey || event.metaKey) $.datepicker._adjustDate(event.target, (isRTL ? -1 : +1), 'D');- handled = event.ctrlKey || event.metaKey;- // +1 day on ctrl or command +right- if (event.originalEvent.altKey) $.datepicker._adjustDate(event.target, (event.ctrlKey ?- +$.datepicker._get(inst, 'stepBigMonths') :- +$.datepicker._get(inst, 'stepMonths')), 'M');- // next month/year on alt +right- break;- case 40: if (event.ctrlKey || event.metaKey) $.datepicker._adjustDate(event.target, +7, 'D');- handled = event.ctrlKey || event.metaKey;- break; // +1 week on ctrl or command +down- default: handled = false;- }- else if (event.keyCode == 36 && event.ctrlKey) // display the date picker on ctrl+home- $.datepicker._showDatepicker(this);- else {- handled = false;- }- if (handled) {- event.preventDefault();- event.stopPropagation();- }- },-- /* Filter entered characters - based on date format. */- _doKeyPress: function(event) {- var inst = $.datepicker._getInst(event.target);- if ($.datepicker._get(inst, 'constrainInput')) {- var chars = $.datepicker._possibleChars($.datepicker._get(inst, 'dateFormat'));- var chr = String.fromCharCode(event.charCode == undefined ? event.keyCode : event.charCode);- return event.ctrlKey || event.metaKey || (chr < ' ' || !chars || chars.indexOf(chr) > -1);- }- },-- /* Synchronise manual entry and field/alternate field. */- _doKeyUp: function(event) {- var inst = $.datepicker._getInst(event.target);- if (inst.input.val() != inst.lastVal) {- try {- var date = $.datepicker.parseDate($.datepicker._get(inst, 'dateFormat'),- (inst.input ? inst.input.val() : null),- $.datepicker._getFormatConfig(inst));- if (date) { // only if valid- $.datepicker._setDateFromField(inst);- $.datepicker._updateAlternate(inst);- $.datepicker._updateDatepicker(inst);- }- }- catch (err) {- $.datepicker.log(err);- }- }- return true;- },-- /* Pop-up the date picker for a given input field.- If false returned from beforeShow event handler do not show.- @param input element - the input field attached to the date picker or- event - if triggered by focus */- _showDatepicker: function(input) {- input = input.target || input;- if (input.nodeName.toLowerCase() != 'input') // find from button/image trigger- input = $('input', input.parentNode)[0];- if ($.datepicker._isDisabledDatepicker(input) || $.datepicker._lastInput == input) // already here- return;- var inst = $.datepicker._getInst(input);- if ($.datepicker._curInst && $.datepicker._curInst != inst) {- $.datepicker._curInst.dpDiv.stop(true, true);- if ( inst && $.datepicker._datepickerShowing ) {- $.datepicker._hideDatepicker( $.datepicker._curInst.input[0] );- }- }- var beforeShow = $.datepicker._get(inst, 'beforeShow');- var beforeShowSettings = beforeShow ? beforeShow.apply(input, [input, inst]) : {};- if(beforeShowSettings === false){- //false- return;- }- extendRemove(inst.settings, beforeShowSettings);- inst.lastVal = null;- $.datepicker._lastInput = input;- $.datepicker._setDateFromField(inst);- if ($.datepicker._inDialog) // hide cursor- input.value = '';- if (!$.datepicker._pos) { // position below input- $.datepicker._pos = $.datepicker._findPos(input);- $.datepicker._pos[1] += input.offsetHeight; // add the height- }- var isFixed = false;- $(input).parents().each(function() {- isFixed |= $(this).css('position') == 'fixed';- return !isFixed;- });- var offset = {left: $.datepicker._pos[0], top: $.datepicker._pos[1]};- $.datepicker._pos = null;- //to avoid flashes on Firefox- inst.dpDiv.empty();- // determine sizing offscreen- inst.dpDiv.css({position: 'absolute', display: 'block', top: '-1000px'});- $.datepicker._updateDatepicker(inst);- // fix width for dynamic number of date pickers- // and adjust position before showing- offset = $.datepicker._checkOffset(inst, offset, isFixed);- inst.dpDiv.css({position: ($.datepicker._inDialog && $.blockUI ?- 'static' : (isFixed ? 'fixed' : 'absolute')), display: 'none',- left: offset.left + 'px', top: offset.top + 'px'});- if (!inst.inline) {- var showAnim = $.datepicker._get(inst, 'showAnim');- var duration = $.datepicker._get(inst, 'duration');- var postProcess = function() {- var cover = inst.dpDiv.find('iframe.ui-datepicker-cover'); // IE6- only- if( !! cover.length ){- var borders = $.datepicker._getBorders(inst.dpDiv);- cover.css({left: -borders[0], top: -borders[1],- width: inst.dpDiv.outerWidth(), height: inst.dpDiv.outerHeight()});- }- };- inst.dpDiv.zIndex($(input).zIndex()+1);- $.datepicker._datepickerShowing = true;-- // DEPRECATED: after BC for 1.8.x $.effects[ showAnim ] is not needed- if ( $.effects && ( $.effects.effect[ showAnim ] || $.effects[ showAnim ] ) )- inst.dpDiv.show(showAnim, $.datepicker._get(inst, 'showOptions'), duration, postProcess);- else- inst.dpDiv[showAnim || 'show']((showAnim ? duration : null), postProcess);- if (!showAnim || !duration)- postProcess();- if (inst.input.is(':visible') && !inst.input.is(':disabled'))- inst.input.focus();- $.datepicker._curInst = inst;- }- },-- /* Generate the date picker content. */- _updateDatepicker: function(inst) {- this.maxRows = 4; //Reset the max number of rows being displayed (see #7043)- var borders = $.datepicker._getBorders(inst.dpDiv);- instActive = inst; // for delegate hover events- inst.dpDiv.empty().append(this._generateHTML(inst));- this._attachHandlers(inst);- var cover = inst.dpDiv.find('iframe.ui-datepicker-cover'); // IE6- only- if( !!cover.length ){ //avoid call to outerXXXX() when not in IE6- cover.css({left: -borders[0], top: -borders[1], width: inst.dpDiv.outerWidth(), height: inst.dpDiv.outerHeight()})- }- inst.dpDiv.find('.' + this._dayOverClass + ' a').mouseover();- var numMonths = this._getNumberOfMonths(inst);- var cols = numMonths[1];- var width = 17;- inst.dpDiv.removeClass('ui-datepicker-multi-2 ui-datepicker-multi-3 ui-datepicker-multi-4').width('');- if (cols > 1)- inst.dpDiv.addClass('ui-datepicker-multi-' + cols).css('width', (width * cols) + 'em');- inst.dpDiv[(numMonths[0] != 1 || numMonths[1] != 1 ? 'add' : 'remove') +- 'Class']('ui-datepicker-multi');- inst.dpDiv[(this._get(inst, 'isRTL') ? 'add' : 'remove') +- 'Class']('ui-datepicker-rtl');- if (inst == $.datepicker._curInst && $.datepicker._datepickerShowing && inst.input &&- // #6694 - don't focus the input if it's already focused- // this breaks the change event in IE- inst.input.is(':visible') && !inst.input.is(':disabled') && inst.input[0] != document.activeElement)- inst.input.focus();- // deffered render of the years select (to avoid flashes on Firefox)- if( inst.yearshtml ){- var origyearshtml = inst.yearshtml;- setTimeout(function(){- //assure that inst.yearshtml didn't change.- if( origyearshtml === inst.yearshtml && inst.yearshtml ){- inst.dpDiv.find('select.ui-datepicker-year:first').replaceWith(inst.yearshtml);- }- origyearshtml = inst.yearshtml = null;- }, 0);- }- },-- /* Retrieve the size of left and top borders for an element.- @param elem (jQuery object) the element of interest- @return (number[2]) the left and top borders */- _getBorders: function(elem) {- var convert = function(value) {- return {thin: 1, medium: 2, thick: 3}[value] || value;- };- return [parseFloat(convert(elem.css('border-left-width'))),- parseFloat(convert(elem.css('border-top-width')))];- },-- /* Check positioning to remain on screen. */- _checkOffset: function(inst, offset, isFixed) {- var dpWidth = inst.dpDiv.outerWidth();- var dpHeight = inst.dpDiv.outerHeight();- var inputWidth = inst.input ? inst.input.outerWidth() : 0;- var inputHeight = inst.input ? inst.input.outerHeight() : 0;- var viewWidth = document.documentElement.clientWidth + (isFixed ? 0 : $(document).scrollLeft());- var viewHeight = document.documentElement.clientHeight + (isFixed ? 0 : $(document).scrollTop());-- offset.left -= (this._get(inst, 'isRTL') ? (dpWidth - inputWidth) : 0);- offset.left -= (isFixed && offset.left == inst.input.offset().left) ? $(document).scrollLeft() : 0;- offset.top -= (isFixed && offset.top == (inst.input.offset().top + inputHeight)) ? $(document).scrollTop() : 0;-- // now check if datepicker is showing outside window viewport - move to a better place if so.- offset.left -= Math.min(offset.left, (offset.left + dpWidth > viewWidth && viewWidth > dpWidth) ?- Math.abs(offset.left + dpWidth - viewWidth) : 0);- offset.top -= Math.min(offset.top, (offset.top + dpHeight > viewHeight && viewHeight > dpHeight) ?- Math.abs(dpHeight + inputHeight) : 0);-- return offset;- },-- /* Find an object's position on the screen. */- _findPos: function(obj) {- var inst = this._getInst(obj);- var isRTL = this._get(inst, 'isRTL');- while (obj && (obj.type == 'hidden' || obj.nodeType != 1 || $.expr.filters.hidden(obj))) {- obj = obj[isRTL ? 'previousSibling' : 'nextSibling'];- }- var position = $(obj).offset();- return [position.left, position.top];- },-- /* Hide the date picker from view.- @param input element - the input field attached to the date picker */- _hideDatepicker: function(input) {- var inst = this._curInst;- if (!inst || (input && inst != $.data(input, PROP_NAME)))- return;- if (this._datepickerShowing) {- var showAnim = this._get(inst, 'showAnim');- var duration = this._get(inst, 'duration');- var postProcess = function() {- $.datepicker._tidyDialog(inst);- };-- // DEPRECATED: after BC for 1.8.x $.effects[ showAnim ] is not needed- if ( $.effects && ( $.effects.effect[ showAnim ] || $.effects[ showAnim ] ) )- inst.dpDiv.hide(showAnim, $.datepicker._get(inst, 'showOptions'), duration, postProcess);- else- inst.dpDiv[(showAnim == 'slideDown' ? 'slideUp' :- (showAnim == 'fadeIn' ? 'fadeOut' : 'hide'))]((showAnim ? duration : null), postProcess);- if (!showAnim)- postProcess();- this._datepickerShowing = false;- var onClose = this._get(inst, 'onClose');- if (onClose)- onClose.apply((inst.input ? inst.input[0] : null),- [(inst.input ? inst.input.val() : ''), inst]);- this._lastInput = null;- if (this._inDialog) {- this._dialogInput.css({ position: 'absolute', left: '0', top: '-100px' });- if ($.blockUI) {- $.unblockUI();- $('body').append(this.dpDiv);- }- }- this._inDialog = false;- }- },-- /* Tidy up after a dialog display. */- _tidyDialog: function(inst) {- inst.dpDiv.removeClass(this._dialogClass).unbind('.ui-datepicker-calendar');- },-- /* Close date picker if clicked elsewhere. */- _checkExternalClick: function(event) {- if (!$.datepicker._curInst)- return;-- var $target = $(event.target),- inst = $.datepicker._getInst($target[0]);-- if ( ( ( $target[0].id != $.datepicker._mainDivId &&- $target.parents('#' + $.datepicker._mainDivId).length == 0 &&- !$target.hasClass($.datepicker.markerClassName) &&- !$target.closest("." + $.datepicker._triggerClass).length &&- $.datepicker._datepickerShowing && !($.datepicker._inDialog && $.blockUI) ) ) ||- ( $target.hasClass($.datepicker.markerClassName) && $.datepicker._curInst != inst ) )- $.datepicker._hideDatepicker();- },-- /* Adjust one of the date sub-fields. */- _adjustDate: function(id, offset, period) {- var target = $(id);- var inst = this._getInst(target[0]);- if (this._isDisabledDatepicker(target[0])) {- return;- }- this._adjustInstDate(inst, offset +- (period == 'M' ? this._get(inst, 'showCurrentAtPos') : 0), // undo positioning- period);- this._updateDatepicker(inst);- },-- /* Action for current link. */- _gotoToday: function(id) {- var target = $(id);- var inst = this._getInst(target[0]);- if (this._get(inst, 'gotoCurrent') && inst.currentDay) {- inst.selectedDay = inst.currentDay;- inst.drawMonth = inst.selectedMonth = inst.currentMonth;- inst.drawYear = inst.selectedYear = inst.currentYear;- }- else {- var date = new Date();- inst.selectedDay = date.getDate();- inst.drawMonth = inst.selectedMonth = date.getMonth();- inst.drawYear = inst.selectedYear = date.getFullYear();- }- this._notifyChange(inst);- this._adjustDate(target);- },-- /* Action for selecting a new month/year. */- _selectMonthYear: function(id, select, period) {- var target = $(id);- var inst = this._getInst(target[0]);- inst['selected' + (period == 'M' ? 'Month' : 'Year')] =- inst['draw' + (period == 'M' ? 'Month' : 'Year')] =- parseInt(select.options[select.selectedIndex].value,10);- this._notifyChange(inst);- this._adjustDate(target);- },-- /* Action for selecting a day. */- _selectDay: function(id, month, year, td) {- var target = $(id);- if ($(td).hasClass(this._unselectableClass) || this._isDisabledDatepicker(target[0])) {- return;- }- var inst = this._getInst(target[0]);- inst.selectedDay = inst.currentDay = $('a', td).html();- inst.selectedMonth = inst.currentMonth = month;- inst.selectedYear = inst.currentYear = year;- this._selectDate(id, this._formatDate(inst,- inst.currentDay, inst.currentMonth, inst.currentYear));- },-- /* Erase the input field and hide the date picker. */- _clearDate: function(id) {- var target = $(id);- var inst = this._getInst(target[0]);- this._selectDate(target, '');- },-- /* Update the input field with the selected date. */- _selectDate: function(id, dateStr) {- var target = $(id);- var inst = this._getInst(target[0]);- dateStr = (dateStr != null ? dateStr : this._formatDate(inst));- if (inst.input)- inst.input.val(dateStr);- this._updateAlternate(inst);- var onSelect = this._get(inst, 'onSelect');- if (onSelect)- onSelect.apply((inst.input ? inst.input[0] : null), [dateStr, inst]); // trigger custom callback- else if (inst.input)- inst.input.trigger('change'); // fire the change event- if (inst.inline)- this._updateDatepicker(inst);- else {- this._hideDatepicker();- this._lastInput = inst.input[0];- if (typeof(inst.input[0]) != 'object')- inst.input.focus(); // restore focus- this._lastInput = null;- }- },-- /* Update any alternate field to synchronise with the main field. */- _updateAlternate: function(inst) {- var altField = this._get(inst, 'altField');- if (altField) { // update alternate field too- var altFormat = this._get(inst, 'altFormat') || this._get(inst, 'dateFormat');- var date = this._getDate(inst);- var dateStr = this.formatDate(altFormat, date, this._getFormatConfig(inst));- $(altField).each(function() { $(this).val(dateStr); });- }- },-- /* Set as beforeShowDay function to prevent selection of weekends.- @param date Date - the date to customise- @return [boolean, string] - is this date selectable?, what is its CSS class? */- noWeekends: function(date) {- var day = date.getDay();- return [(day > 0 && day < 6), ''];- },-- /* Set as calculateWeek to determine the week of the year based on the ISO 8601 definition.- @param date Date - the date to get the week for- @return number - the number of the week within the year that contains this date */- iso8601Week: function(date) {- var checkDate = new Date(date.getTime());- // Find Thursday of this week starting on Monday- checkDate.setDate(checkDate.getDate() + 4 - (checkDate.getDay() || 7));- var time = checkDate.getTime();- checkDate.setMonth(0); // Compare with Jan 1- checkDate.setDate(1);- return Math.floor(Math.round((time - checkDate) / 86400000) / 7) + 1;- },-- /* Parse a string value into a date object.- See formatDate below for the possible formats.-- @param format string - the expected format of the date- @param value string - the date in the above format- @param settings Object - attributes include:- shortYearCutoff number - the cutoff year for determining the century (optional)- dayNamesShort string[7] - abbreviated names of the days from Sunday (optional)- dayNames string[7] - names of the days from Sunday (optional)- monthNamesShort string[12] - abbreviated names of the months (optional)- monthNames string[12] - names of the months (optional)- @return Date - the extracted date value or null if value is blank */- parseDate: function (format, value, settings) {- if (format == null || value == null)- throw 'Invalid arguments';- value = (typeof value == 'object' ? value.toString() : value + '');- if (value == '')- return null;- var shortYearCutoff = (settings ? settings.shortYearCutoff : null) || this._defaults.shortYearCutoff;- shortYearCutoff = (typeof shortYearCutoff != 'string' ? shortYearCutoff :- new Date().getFullYear() % 100 + parseInt(shortYearCutoff, 10));- var dayNamesShort = (settings ? settings.dayNamesShort : null) || this._defaults.dayNamesShort;- var dayNames = (settings ? settings.dayNames : null) || this._defaults.dayNames;- var monthNamesShort = (settings ? settings.monthNamesShort : null) || this._defaults.monthNamesShort;- var monthNames = (settings ? settings.monthNames : null) || this._defaults.monthNames;- var year = -1;- var month = -1;- var day = -1;- var doy = -1;- var literal = false;- // Check whether a format character is doubled- var lookAhead = function(match) {- var matches = (iFormat + 1 < format.length && format.charAt(iFormat + 1) == match);- if (matches)- iFormat++;- return matches;- };- // Extract a number from the string value- var getNumber = function(match) {- var isDoubled = lookAhead(match);- var size = (match == '@' ? 14 : (match == '!' ? 20 :- (match == 'y' && isDoubled ? 4 : (match == 'o' ? 3 : 2))));- var digits = new RegExp('^\\d{1,' + size + '}');- var num = value.substring(iValue).match(digits);- if (!num)- throw 'Missing number at position ' + iValue;- iValue += num[0].length;- return parseInt(num[0], 10);- };- // Extract a name from the string value and convert to an index- var getName = function(match, shortNames, longNames) {- var names = $.map(lookAhead(match) ? longNames : shortNames, function (v, k) {- return [ [k, v] ];- }).sort(function (a, b) {- return -(a[1].length - b[1].length);- });- var index = -1;- $.each(names, function (i, pair) {- var name = pair[1];- if (value.substr(iValue, name.length).toLowerCase() == name.toLowerCase()) {- index = pair[0];- iValue += name.length;- return false;- }- });- if (index != -1)- return index + 1;- else- throw 'Unknown name at position ' + iValue;- };- // Confirm that a literal character matches the string value- var checkLiteral = function() {- if (value.charAt(iValue) != format.charAt(iFormat))- throw 'Unexpected literal at position ' + iValue;- iValue++;- };- var iValue = 0;- for (var iFormat = 0; iFormat < format.length; iFormat++) {- if (literal)- if (format.charAt(iFormat) == "'" && !lookAhead("'"))- literal = false;- else- checkLiteral();- else- switch (format.charAt(iFormat)) {- case 'd':- day = getNumber('d');- break;- case 'D':- getName('D', dayNamesShort, dayNames);- break;- case 'o':- doy = getNumber('o');- break;- case 'm':- month = getNumber('m');- break;- case 'M':- month = getName('M', monthNamesShort, monthNames);- break;- case 'y':- year = getNumber('y');- break;- case '@':- var date = new Date(getNumber('@'));- year = date.getFullYear();- month = date.getMonth() + 1;- day = date.getDate();- break;- case '!':- var date = new Date((getNumber('!') - this._ticksTo1970) / 10000);- year = date.getFullYear();- month = date.getMonth() + 1;- day = date.getDate();- break;- case "'":- if (lookAhead("'"))- checkLiteral();- else- literal = true;- break;- default:- checkLiteral();- }- }- if (iValue < value.length){- var extra = value.substr(iValue);- if (!/^\s+/.test(extra)) {- throw "Extra/unparsed characters found in date: " + extra;- }- }- if (year == -1)- year = new Date().getFullYear();- else if (year < 100)- year += new Date().getFullYear() - new Date().getFullYear() % 100 +- (year <= shortYearCutoff ? 0 : -100);- if (doy > -1) {- month = 1;- day = doy;- do {- var dim = this._getDaysInMonth(year, month - 1);- if (day <= dim)- break;- month++;- day -= dim;- } while (true);- }- var date = this._daylightSavingAdjust(new Date(year, month - 1, day));- if (date.getFullYear() != year || date.getMonth() + 1 != month || date.getDate() != day)- throw 'Invalid date'; // E.g. 31/02/00- return date;- },-- /* Standard date formats. */- ATOM: 'yy-mm-dd', // RFC 3339 (ISO 8601)- COOKIE: 'D, dd M yy',- ISO_8601: 'yy-mm-dd',- RFC_822: 'D, d M y',- RFC_850: 'DD, dd-M-y',- RFC_1036: 'D, d M y',- RFC_1123: 'D, d M yy',- RFC_2822: 'D, d M yy',- RSS: 'D, d M y', // RFC 822- TICKS: '!',- TIMESTAMP: '@',- W3C: 'yy-mm-dd', // ISO 8601-- _ticksTo1970: (((1970 - 1) * 365 + Math.floor(1970 / 4) - Math.floor(1970 / 100) +- Math.floor(1970 / 400)) * 24 * 60 * 60 * 10000000),-- /* Format a date object into a string value.- The format can be combinations of the following:- d - day of month (no leading zero)- dd - day of month (two digit)- o - day of year (no leading zeros)- oo - day of year (three digit)- D - day name short- DD - day name long- m - month of year (no leading zero)- mm - month of year (two digit)- M - month name short- MM - month name long- y - year (two digit)- yy - year (four digit)- @ - Unix timestamp (ms since 01/01/1970)- ! - Windows ticks (100ns since 01/01/0001)- '...' - literal text- '' - single quote-- @param format string - the desired format of the date- @param date Date - the date value to format- @param settings Object - attributes include:- dayNamesShort string[7] - abbreviated names of the days from Sunday (optional)- dayNames string[7] - names of the days from Sunday (optional)- monthNamesShort string[12] - abbreviated names of the months (optional)- monthNames string[12] - names of the months (optional)- @return string - the date in the above format */- formatDate: function (format, date, settings) {- if (!date)- return '';- var dayNamesShort = (settings ? settings.dayNamesShort : null) || this._defaults.dayNamesShort;- var dayNames = (settings ? settings.dayNames : null) || this._defaults.dayNames;- var monthNamesShort = (settings ? settings.monthNamesShort : null) || this._defaults.monthNamesShort;- var monthNames = (settings ? settings.monthNames : null) || this._defaults.monthNames;- // Check whether a format character is doubled- var lookAhead = function(match) {- var matches = (iFormat + 1 < format.length && format.charAt(iFormat + 1) == match);- if (matches)- iFormat++;- return matches;- };- // Format a number, with leading zero if necessary- var formatNumber = function(match, value, len) {- var num = '' + value;- if (lookAhead(match))- while (num.length < len)- num = '0' + num;- return num;- };- // Format a name, short or long as requested- var formatName = function(match, value, shortNames, longNames) {- return (lookAhead(match) ? longNames[value] : shortNames[value]);- };- var output = '';- var literal = false;- if (date)- for (var iFormat = 0; iFormat < format.length; iFormat++) {- if (literal)- if (format.charAt(iFormat) == "'" && !lookAhead("'"))- literal = false;- else- output += format.charAt(iFormat);- else- switch (format.charAt(iFormat)) {- case 'd':- output += formatNumber('d', date.getDate(), 2);- break;- case 'D':- output += formatName('D', date.getDay(), dayNamesShort, dayNames);- break;- case 'o':- output += formatNumber('o',- Math.round((new Date(date.getFullYear(), date.getMonth(), date.getDate()).getTime() - new Date(date.getFullYear(), 0, 0).getTime()) / 86400000), 3);- break;- case 'm':- output += formatNumber('m', date.getMonth() + 1, 2);- break;- case 'M':- output += formatName('M', date.getMonth(), monthNamesShort, monthNames);- break;- case 'y':- output += (lookAhead('y') ? date.getFullYear() :- (date.getYear() % 100 < 10 ? '0' : '') + date.getYear() % 100);- break;- case '@':- output += date.getTime();- break;- case '!':- output += date.getTime() * 10000 + this._ticksTo1970;- break;- case "'":- if (lookAhead("'"))- output += "'";- else- literal = true;- break;- default:- output += format.charAt(iFormat);- }- }- return output;- },-- /* Extract all possible characters from the date format. */- _possibleChars: function (format) {- var chars = '';- var literal = false;- // Check whether a format character is doubled- var lookAhead = function(match) {- var matches = (iFormat + 1 < format.length && format.charAt(iFormat + 1) == match);- if (matches)- iFormat++;- return matches;- };- for (var iFormat = 0; iFormat < format.length; iFormat++)- if (literal)- if (format.charAt(iFormat) == "'" && !lookAhead("'"))- literal = false;- else- chars += format.charAt(iFormat);- else- switch (format.charAt(iFormat)) {- case 'd': case 'm': case 'y': case '@':- chars += '0123456789';- break;- case 'D': case 'M':- return null; // Accept anything- case "'":- if (lookAhead("'"))- chars += "'";- else- literal = true;- break;- default:- chars += format.charAt(iFormat);- }- return chars;- },-- /* Get a setting value, defaulting if necessary. */- _get: function(inst, name) {- return inst.settings[name] !== undefined ?- inst.settings[name] : this._defaults[name];- },-- /* Parse existing date and initialise date picker. */- _setDateFromField: function(inst, noDefault) {- if (inst.input.val() == inst.lastVal) {- return;- }- var dateFormat = this._get(inst, 'dateFormat');- var dates = inst.lastVal = inst.input ? inst.input.val() : null;- var date, defaultDate;- date = defaultDate = this._getDefaultDate(inst);- var settings = this._getFormatConfig(inst);- try {- date = this.parseDate(dateFormat, dates, settings) || defaultDate;- } catch (event) {- this.log(event);- dates = (noDefault ? '' : dates);- }- inst.selectedDay = date.getDate();- inst.drawMonth = inst.selectedMonth = date.getMonth();- inst.drawYear = inst.selectedYear = date.getFullYear();- inst.currentDay = (dates ? date.getDate() : 0);- inst.currentMonth = (dates ? date.getMonth() : 0);- inst.currentYear = (dates ? date.getFullYear() : 0);- this._adjustInstDate(inst);- },-- /* Retrieve the default date shown on opening. */- _getDefaultDate: function(inst) {- return this._restrictMinMax(inst,- this._determineDate(inst, this._get(inst, 'defaultDate'), new Date()));- },-- /* A date may be specified as an exact value or a relative one. */- _determineDate: function(inst, date, defaultDate) {- var offsetNumeric = function(offset) {- var date = new Date();- date.setDate(date.getDate() + offset);- return date;- };- var offsetString = function(offset) {- try {- return $.datepicker.parseDate($.datepicker._get(inst, 'dateFormat'),- offset, $.datepicker._getFormatConfig(inst));- }- catch (e) {- // Ignore- }- var date = (offset.toLowerCase().match(/^c/) ?- $.datepicker._getDate(inst) : null) || new Date();- var year = date.getFullYear();- var month = date.getMonth();- var day = date.getDate();- var pattern = /([+-]?[0-9]+)\s*(d|D|w|W|m|M|y|Y)?/g;- var matches = pattern.exec(offset);- while (matches) {- switch (matches[2] || 'd') {- case 'd' : case 'D' :- day += parseInt(matches[1],10); break;- case 'w' : case 'W' :- day += parseInt(matches[1],10) * 7; break;- case 'm' : case 'M' :- month += parseInt(matches[1],10);- day = Math.min(day, $.datepicker._getDaysInMonth(year, month));- break;- case 'y': case 'Y' :- year += parseInt(matches[1],10);- day = Math.min(day, $.datepicker._getDaysInMonth(year, month));- break;- }- matches = pattern.exec(offset);- }- return new Date(year, month, day);- };- var newDate = (date == null || date === '' ? defaultDate : (typeof date == 'string' ? offsetString(date) :- (typeof date == 'number' ? (isNaN(date) ? defaultDate : offsetNumeric(date)) : new Date(date.getTime()))));- newDate = (newDate && newDate.toString() == 'Invalid Date' ? defaultDate : newDate);- if (newDate) {- newDate.setHours(0);- newDate.setMinutes(0);- newDate.setSeconds(0);- newDate.setMilliseconds(0);- }- return this._daylightSavingAdjust(newDate);- },-- /* Handle switch to/from daylight saving.- Hours may be non-zero on daylight saving cut-over:- > 12 when midnight changeover, but then cannot generate- midnight datetime, so jump to 1AM, otherwise reset.- @param date (Date) the date to check- @return (Date) the corrected date */- _daylightSavingAdjust: function(date) {- if (!date) return null;- date.setHours(date.getHours() > 12 ? date.getHours() + 2 : 0);- return date;- },-- /* Set the date(s) directly. */- _setDate: function(inst, date, noChange) {- var clear = !date;- var origMonth = inst.selectedMonth;- var origYear = inst.selectedYear;- var newDate = this._restrictMinMax(inst, this._determineDate(inst, date, new Date()));- inst.selectedDay = inst.currentDay = newDate.getDate();- inst.drawMonth = inst.selectedMonth = inst.currentMonth = newDate.getMonth();- inst.drawYear = inst.selectedYear = inst.currentYear = newDate.getFullYear();- if ((origMonth != inst.selectedMonth || origYear != inst.selectedYear) && !noChange)- this._notifyChange(inst);- this._adjustInstDate(inst);- if (inst.input) {- inst.input.val(clear ? '' : this._formatDate(inst));- }- },-- /* Retrieve the date(s) directly. */- _getDate: function(inst) {- var startDate = (!inst.currentYear || (inst.input && inst.input.val() == '') ? null :- this._daylightSavingAdjust(new Date(- inst.currentYear, inst.currentMonth, inst.currentDay)));- return startDate;- },-- /* Attach the onxxx handlers. These are declared statically so- * they work with static code transformers like Caja.- */- _attachHandlers: function(inst) {- var stepMonths = this._get(inst, 'stepMonths');- var id = '#' + inst.id.replace( /\\\\/g, "\\" );- inst.dpDiv.find('[data-handler]').map(function () {- var handler = {- prev: function () {- window['DP_jQuery_' + dpuuid].datepicker._adjustDate(id, -stepMonths, 'M');- },- next: function () {- window['DP_jQuery_' + dpuuid].datepicker._adjustDate(id, +stepMonths, 'M');- },- hide: function () {- window['DP_jQuery_' + dpuuid].datepicker._hideDatepicker();- },- today: function () {- window['DP_jQuery_' + dpuuid].datepicker._gotoToday(id);- },- selectDay: function () {- window['DP_jQuery_' + dpuuid].datepicker._selectDay(id, +this.getAttribute('data-month'), +this.getAttribute('data-year'), this);- return false;- },- selectMonth: function () {- window['DP_jQuery_' + dpuuid].datepicker._selectMonthYear(id, this, 'M');- return false;- },- selectYear: function () {- window['DP_jQuery_' + dpuuid].datepicker._selectMonthYear(id, this, 'Y');- return false;- }- };- $(this).bind(this.getAttribute('data-event'), handler[this.getAttribute('data-handler')]);- });- },-- /* Generate the HTML for the current state of the date picker. */- _generateHTML: function(inst) {- var today = new Date();- today = this._daylightSavingAdjust(- new Date(today.getFullYear(), today.getMonth(), today.getDate())); // clear time- var isRTL = this._get(inst, 'isRTL');- var showButtonPanel = this._get(inst, 'showButtonPanel');- var hideIfNoPrevNext = this._get(inst, 'hideIfNoPrevNext');- var navigationAsDateFormat = this._get(inst, 'navigationAsDateFormat');- var numMonths = this._getNumberOfMonths(inst);- var showCurrentAtPos = this._get(inst, 'showCurrentAtPos');- var stepMonths = this._get(inst, 'stepMonths');- var isMultiMonth = (numMonths[0] != 1 || numMonths[1] != 1);- var currentDate = this._daylightSavingAdjust((!inst.currentDay ? new Date(9999, 9, 9) :- new Date(inst.currentYear, inst.currentMonth, inst.currentDay)));- var minDate = this._getMinMaxDate(inst, 'min');- var maxDate = this._getMinMaxDate(inst, 'max');- var drawMonth = inst.drawMonth - showCurrentAtPos;- var drawYear = inst.drawYear;- if (drawMonth < 0) {- drawMonth += 12;- drawYear--;- }- if (maxDate) {- var maxDraw = this._daylightSavingAdjust(new Date(maxDate.getFullYear(),- maxDate.getMonth() - (numMonths[0] * numMonths[1]) + 1, maxDate.getDate()));- maxDraw = (minDate && maxDraw < minDate ? minDate : maxDraw);- while (this._daylightSavingAdjust(new Date(drawYear, drawMonth, 1)) > maxDraw) {- drawMonth--;- if (drawMonth < 0) {- drawMonth = 11;- drawYear--;- }- }- }- inst.drawMonth = drawMonth;- inst.drawYear = drawYear;- var prevText = this._get(inst, 'prevText');- prevText = (!navigationAsDateFormat ? prevText : this.formatDate(prevText,- this._daylightSavingAdjust(new Date(drawYear, drawMonth - stepMonths, 1)),- this._getFormatConfig(inst)));- var prev = (this._canAdjustMonth(inst, -1, drawYear, drawMonth) ?- '<a class="ui-datepicker-prev ui-corner-all" data-handler="prev" data-event="click"' +- ' title="' + prevText + '"><span class="ui-icon ui-icon-circle-triangle-' + ( isRTL ? 'e' : 'w') + '">' + prevText + '</span></a>' :- (hideIfNoPrevNext ? '' : '<a class="ui-datepicker-prev ui-corner-all ui-state-disabled" title="'+ prevText +'"><span class="ui-icon ui-icon-circle-triangle-' + ( isRTL ? 'e' : 'w') + '">' + prevText + '</span></a>'));- var nextText = this._get(inst, 'nextText');- nextText = (!navigationAsDateFormat ? nextText : this.formatDate(nextText,- this._daylightSavingAdjust(new Date(drawYear, drawMonth + stepMonths, 1)),- this._getFormatConfig(inst)));- var next = (this._canAdjustMonth(inst, +1, drawYear, drawMonth) ?- '<a class="ui-datepicker-next ui-corner-all" data-handler="next" data-event="click"' +- ' title="' + nextText + '"><span class="ui-icon ui-icon-circle-triangle-' + ( isRTL ? 'w' : 'e') + '">' + nextText + '</span></a>' :- (hideIfNoPrevNext ? '' : '<a class="ui-datepicker-next ui-corner-all ui-state-disabled" title="'+ nextText + '"><span class="ui-icon ui-icon-circle-triangle-' + ( isRTL ? 'w' : 'e') + '">' + nextText + '</span></a>'));- var currentText = this._get(inst, 'currentText');- var gotoDate = (this._get(inst, 'gotoCurrent') && inst.currentDay ? currentDate : today);- currentText = (!navigationAsDateFormat ? currentText :- this.formatDate(currentText, gotoDate, this._getFormatConfig(inst)));- var controls = (!inst.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(inst, 'closeText') + '</button>' : '');- var buttonPanel = (showButtonPanel) ? '<div class="ui-datepicker-buttonpane ui-widget-content">' + (isRTL ? controls : '') +- (this._isInRange(inst, gotoDate) ? '<button type="button" class="ui-datepicker-current ui-state-default ui-priority-secondary ui-corner-all" data-handler="today" data-event="click"' +- '>' + currentText + '</button>' : '') + (isRTL ? '' : controls) + '</div>' : '';- var firstDay = parseInt(this._get(inst, 'firstDay'),10);- firstDay = (isNaN(firstDay) ? 0 : firstDay);- var showWeek = this._get(inst, 'showWeek');- var dayNames = this._get(inst, 'dayNames');- var dayNamesShort = this._get(inst, 'dayNamesShort');- var dayNamesMin = this._get(inst, 'dayNamesMin');- var monthNames = this._get(inst, 'monthNames');- var monthNamesShort = this._get(inst, 'monthNamesShort');- var beforeShowDay = this._get(inst, 'beforeShowDay');- var showOtherMonths = this._get(inst, 'showOtherMonths');- var selectOtherMonths = this._get(inst, 'selectOtherMonths');- var calculateWeek = this._get(inst, 'calculateWeek') || this.iso8601Week;- var defaultDate = this._getDefaultDate(inst);- var html = '';- for (var row = 0; row < numMonths[0]; row++) {- var group = '';- this.maxRows = 4;- for (var col = 0; col < numMonths[1]; col++) {- var selectedDate = this._daylightSavingAdjust(new Date(drawYear, drawMonth, inst.selectedDay));- var cornerClass = ' ui-corner-all';- var calender = '';- if (isMultiMonth) {- calender += '<div class="ui-datepicker-group';- if (numMonths[1] > 1)- switch (col) {- case 0: calender += ' ui-datepicker-group-first';- cornerClass = ' ui-corner-' + (isRTL ? 'right' : 'left'); break;- case numMonths[1]-1: calender += ' ui-datepicker-group-last';- cornerClass = ' ui-corner-' + (isRTL ? 'left' : 'right'); break;- default: calender += ' ui-datepicker-group-middle'; cornerClass = ''; break;- }- calender += '">';- }- calender += '<div class="ui-datepicker-header ui-widget-header ui-helper-clearfix' + cornerClass + '">' +- (/all|left/.test(cornerClass) && row == 0 ? (isRTL ? next : prev) : '') +- (/all|right/.test(cornerClass) && row == 0 ? (isRTL ? prev : next) : '') +- this._generateMonthYearHeader(inst, drawMonth, drawYear, minDate, maxDate,- row > 0 || col > 0, monthNames, monthNamesShort) + // draw month headers- '</div><table class="ui-datepicker-calendar"><thead>' +- '<tr>';- var thead = (showWeek ? '<th class="ui-datepicker-week-col">' + this._get(inst, 'weekHeader') + '</th>' : '');- for (var dow = 0; dow < 7; dow++) { // days of the week- var day = (dow + firstDay) % 7;- thead += '<th' + ((dow + firstDay + 6) % 7 >= 5 ? ' class="ui-datepicker-week-end"' : '') + '>' +- '<span title="' + dayNames[day] + '">' + dayNamesMin[day] + '</span></th>';- }- calender += thead + '</tr></thead><tbody>';- var daysInMonth = this._getDaysInMonth(drawYear, drawMonth);- if (drawYear == inst.selectedYear && drawMonth == inst.selectedMonth)- inst.selectedDay = Math.min(inst.selectedDay, daysInMonth);- var leadDays = (this._getFirstDayOfMonth(drawYear, drawMonth) - firstDay + 7) % 7;- var curRows = Math.ceil((leadDays + daysInMonth) / 7); // calculate the number of rows to generate- var numRows = (isMultiMonth ? this.maxRows > curRows ? this.maxRows : curRows : curRows); //If multiple months, use the higher number of rows (see #7043)- this.maxRows = numRows;- var printDate = this._daylightSavingAdjust(new Date(drawYear, drawMonth, 1 - leadDays));- for (var dRow = 0; dRow < numRows; dRow++) { // create date picker rows- calender += '<tr>';- var tbody = (!showWeek ? '' : '<td class="ui-datepicker-week-col">' +- this._get(inst, 'calculateWeek')(printDate) + '</td>');- for (var dow = 0; dow < 7; dow++) { // create date picker days- var daySettings = (beforeShowDay ?- beforeShowDay.apply((inst.input ? inst.input[0] : null), [printDate]) : [true, '']);- var otherMonth = (printDate.getMonth() != drawMonth);- var unselectable = (otherMonth && !selectOtherMonths) || !daySettings[0] ||- (minDate && printDate < minDate) || (maxDate && printDate > maxDate);- tbody += '<td class="' +- ((dow + firstDay + 6) % 7 >= 5 ? ' ui-datepicker-week-end' : '') + // highlight weekends- (otherMonth ? ' ui-datepicker-other-month' : '') + // highlight days from other months- ((printDate.getTime() == selectedDate.getTime() && drawMonth == inst.selectedMonth && inst._keyEvent) || // user pressed key- (defaultDate.getTime() == printDate.getTime() && defaultDate.getTime() == selectedDate.getTime()) ?- // or defaultDate is current printedDate and defaultDate is selectedDate- ' ' + this._dayOverClass : '') + // highlight selected day- (unselectable ? ' ' + this._unselectableClass + ' ui-state-disabled': '') + // highlight unselectable days- (otherMonth && !showOtherMonths ? '' : ' ' + daySettings[1] + // highlight custom dates- (printDate.getTime() == currentDate.getTime() ? ' ' + this._currentClass : '') + // highlight selected day- (printDate.getTime() == today.getTime() ? ' ui-datepicker-today' : '')) + '"' + // highlight today (if different)- ((!otherMonth || showOtherMonths) && daySettings[2] ? ' title="' + daySettings[2] + '"' : '') + // cell title- (unselectable ? '' : ' data-handler="selectDay" data-event="click" data-month="' + printDate.getMonth() + '" data-year="' + printDate.getFullYear() + '"') + '>' + // actions- (otherMonth && !showOtherMonths ? ' ' : // display for other months- (unselectable ? '<span class="ui-state-default">' + printDate.getDate() + '</span>' : '<a class="ui-state-default' +- (printDate.getTime() == today.getTime() ? ' ui-state-highlight' : '') +- (printDate.getTime() == currentDate.getTime() ? ' ui-state-active' : '') + // highlight selected day- (otherMonth ? ' ui-priority-secondary' : '') + // distinguish dates from other months- '" href="#">' + printDate.getDate() + '</a>')) + '</td>'; // display selectable date- printDate.setDate(printDate.getDate() + 1);- printDate = this._daylightSavingAdjust(printDate);- }- calender += tbody + '</tr>';- }- drawMonth++;- if (drawMonth > 11) {- drawMonth = 0;- drawYear++;- }- calender += '</tbody></table>' + (isMultiMonth ? '</div>' +- ((numMonths[0] > 0 && col == numMonths[1]-1) ? '<div class="ui-datepicker-row-break"></div>' : '') : '');- group += calender;- }- html += group;- }- html += buttonPanel + ($.ui.ie6 && !inst.inline ?- '<iframe src="javascript:false;" class="ui-datepicker-cover" frameborder="0"></iframe>' : '');- inst._keyEvent = false;- return html;- },-- /* Generate the month and year header. */- _generateMonthYearHeader: function(inst, drawMonth, drawYear, minDate, maxDate,- secondary, monthNames, monthNamesShort) {- var changeMonth = this._get(inst, 'changeMonth');- var changeYear = this._get(inst, 'changeYear');- var showMonthAfterYear = this._get(inst, 'showMonthAfterYear');- var html = '<div class="ui-datepicker-title">';- var monthHtml = '';- // month selection- if (secondary || !changeMonth)- monthHtml += '<span class="ui-datepicker-month">' + monthNames[drawMonth] + '</span>';- else {- var inMinYear = (minDate && minDate.getFullYear() == drawYear);- var inMaxYear = (maxDate && maxDate.getFullYear() == drawYear);- monthHtml += '<select class="ui-datepicker-month" data-handler="selectMonth" data-event="change">';- for (var month = 0; month < 12; month++) {- if ((!inMinYear || month >= minDate.getMonth()) &&- (!inMaxYear || month <= maxDate.getMonth()))- monthHtml += '<option value="' + month + '"' +- (month == drawMonth ? ' selected="selected"' : '') +- '>' + monthNamesShort[month] + '</option>';- }- monthHtml += '</select>';- }- if (!showMonthAfterYear)- html += monthHtml + (secondary || !(changeMonth && changeYear) ? ' ' : '');- // year selection- if ( !inst.yearshtml ) {- inst.yearshtml = '';- if (secondary || !changeYear)- html += '<span class="ui-datepicker-year">' + drawYear + '</span>';- else {- // determine range of years to display- var years = this._get(inst, 'yearRange').split(':');- var thisYear = new Date().getFullYear();- var determineYear = function(value) {- var year = (value.match(/c[+-].*/) ? drawYear + parseInt(value.substring(1), 10) :- (value.match(/[+-].*/) ? thisYear + parseInt(value, 10) :- parseInt(value, 10)));- return (isNaN(year) ? thisYear : year);- };- var year = determineYear(years[0]);- var endYear = Math.max(year, determineYear(years[1] || ''));- year = (minDate ? Math.max(year, minDate.getFullYear()) : year);- endYear = (maxDate ? Math.min(endYear, maxDate.getFullYear()) : endYear);- inst.yearshtml += '<select class="ui-datepicker-year" data-handler="selectYear" data-event="change">';- for (; year <= endYear; year++) {- inst.yearshtml += '<option value="' + year + '"' +- (year == drawYear ? ' selected="selected"' : '') +- '>' + year + '</option>';- }- inst.yearshtml += '</select>';-- html += inst.yearshtml;- inst.yearshtml = null;- }- }- html += this._get(inst, 'yearSuffix');- if (showMonthAfterYear)- html += (secondary || !(changeMonth && changeYear) ? ' ' : '') + monthHtml;- html += '</div>'; // Close datepicker_header- return html;- },-- /* Adjust one of the date sub-fields. */- _adjustInstDate: function(inst, offset, period) {- var year = inst.drawYear + (period == 'Y' ? offset : 0);- var month = inst.drawMonth + (period == 'M' ? offset : 0);- var day = Math.min(inst.selectedDay, this._getDaysInMonth(year, month)) +- (period == 'D' ? offset : 0);- var date = this._restrictMinMax(inst,- this._daylightSavingAdjust(new Date(year, month, day)));- inst.selectedDay = date.getDate();- inst.drawMonth = inst.selectedMonth = date.getMonth();- inst.drawYear = inst.selectedYear = date.getFullYear();- if (period == 'M' || period == 'Y')- this._notifyChange(inst);- },-- /* Ensure a date is within any min/max bounds. */- _restrictMinMax: function(inst, date) {- var minDate = this._getMinMaxDate(inst, 'min');- var maxDate = this._getMinMaxDate(inst, 'max');- var newDate = (minDate && date < minDate ? minDate : date);- newDate = (maxDate && newDate > maxDate ? maxDate : newDate);- return newDate;- },-- /* Notify change of month/year. */- _notifyChange: function(inst) {- var onChange = this._get(inst, 'onChangeMonthYear');- if (onChange)- onChange.apply((inst.input ? inst.input[0] : null),- [inst.selectedYear, inst.selectedMonth + 1, inst]);- },-- /* Determine the number of months to show. */- _getNumberOfMonths: function(inst) {- var numMonths = this._get(inst, 'numberOfMonths');- return (numMonths == null ? [1, 1] : (typeof numMonths == 'number' ? [1, numMonths] : numMonths));- },-- /* Determine the current maximum date - ensure no time components are set. */- _getMinMaxDate: function(inst, minMax) {- return this._determineDate(inst, this._get(inst, minMax + 'Date'), null);- },-- /* Find the number of days in a given month. */- _getDaysInMonth: function(year, month) {- return 32 - this._daylightSavingAdjust(new Date(year, month, 32)).getDate();- },-- /* Find the day of the week of the first of a month. */- _getFirstDayOfMonth: function(year, month) {- return new Date(year, month, 1).getDay();- },-- /* Determines if we should allow a "next/prev" month display change. */- _canAdjustMonth: function(inst, offset, curYear, curMonth) {- var numMonths = this._getNumberOfMonths(inst);- var date = this._daylightSavingAdjust(new Date(curYear,- curMonth + (offset < 0 ? offset : numMonths[0] * numMonths[1]), 1));- if (offset < 0)- date.setDate(this._getDaysInMonth(date.getFullYear(), date.getMonth()));- return this._isInRange(inst, date);- },-- /* Is the given date in the accepted range? */- _isInRange: function(inst, date) {- var minDate = this._getMinMaxDate(inst, 'min');- var maxDate = this._getMinMaxDate(inst, 'max');- return ((!minDate || date.getTime() >= minDate.getTime()) &&- (!maxDate || date.getTime() <= maxDate.getTime()));- },-- /* Provide the configuration settings for formatting/parsing. */- _getFormatConfig: function(inst) {- var shortYearCutoff = this._get(inst, 'shortYearCutoff');- shortYearCutoff = (typeof shortYearCutoff != 'string' ? shortYearCutoff :- new Date().getFullYear() % 100 + parseInt(shortYearCutoff, 10));- return {shortYearCutoff: shortYearCutoff,- dayNamesShort: this._get(inst, 'dayNamesShort'), dayNames: this._get(inst, 'dayNames'),- monthNamesShort: this._get(inst, 'monthNamesShort'), monthNames: this._get(inst, 'monthNames')};- },-- /* Format the given date for display. */- _formatDate: function(inst, day, month, year) {- if (!day) {- inst.currentDay = inst.selectedDay;- inst.currentMonth = inst.selectedMonth;- inst.currentYear = inst.selectedYear;- }- var date = (day ? (typeof day == 'object' ? day :- this._daylightSavingAdjust(new Date(year, month, day))) :- this._daylightSavingAdjust(new Date(inst.currentYear, inst.currentMonth, inst.currentDay)));- return this.formatDate(this._get(inst, 'dateFormat'), date, this._getFormatConfig(inst));- }-});--/*- * Bind hover events for datepicker elements.- * Done via delegate so the binding only occurs once in the lifetime of the parent div.- * Global instActive, set by _updateDatepicker allows the handlers to find their way back to the active picker.- */-function bindHover(dpDiv) {- var selector = 'button, .ui-datepicker-prev, .ui-datepicker-next, .ui-datepicker-calendar td a';- return dpDiv.delegate(selector, 'mouseout', function() {- $(this).removeClass('ui-state-hover');- if (this.className.indexOf('ui-datepicker-prev') != -1) $(this).removeClass('ui-datepicker-prev-hover');- if (this.className.indexOf('ui-datepicker-next') != -1) $(this).removeClass('ui-datepicker-next-hover');- })- .delegate(selector, 'mouseover', function(){- if (!$.datepicker._isDisabledDatepicker( instActive.inline ? dpDiv.parent()[0] : instActive.input[0])) {- $(this).parents('.ui-datepicker-calendar').find('a').removeClass('ui-state-hover');- $(this).addClass('ui-state-hover');- if (this.className.indexOf('ui-datepicker-prev') != -1) $(this).addClass('ui-datepicker-prev-hover');- if (this.className.indexOf('ui-datepicker-next') != -1) $(this).addClass('ui-datepicker-next-hover');- }- });-}--/* jQuery extend now ignores nulls! */-function extendRemove(target, props) {- $.extend(target, props);- for (var name in props)- if (props[name] == null || props[name] == undefined)- target[name] = props[name];- return target;-};--/* Invoke the datepicker functionality.- @param options string - a command, optionally followed by additional parameters or- Object - settings for attaching new datepicker functionality- @return jQuery object */-$.fn.datepicker = function(options){-- /* Verify an empty collection wasn't passed - Fixes #6976 */- if ( !this.length ) {- return this;- }-- /* Initialise the date picker. */- if (!$.datepicker.initialized) {- $(document).mousedown($.datepicker._checkExternalClick).- find(document.body).append($.datepicker.dpDiv);- $.datepicker.initialized = true;- }-- var otherArgs = Array.prototype.slice.call(arguments, 1);- if (typeof options == 'string' && (options == 'isDisabled' || options == 'getDate' || options == 'widget'))- return $.datepicker['_' + options + 'Datepicker'].- apply($.datepicker, [this[0]].concat(otherArgs));- if (options == 'option' && arguments.length == 2 && typeof arguments[1] == 'string')- return $.datepicker['_' + options + 'Datepicker'].- apply($.datepicker, [this[0]].concat(otherArgs));- return this.each(function() {- typeof options == 'string' ?- $.datepicker['_' + options + 'Datepicker'].- apply($.datepicker, [this].concat(otherArgs)) :- $.datepicker._attachDatepicker(this, options);- });-};--$.datepicker = new Datepicker(); // singleton instance-$.datepicker.initialized = false;-$.datepicker.uuid = new Date().getTime();-$.datepicker.version = "1.9.1";--// Workaround for #4055-// Add another global to avoid noConflict issues with inline event handlers-window['DP_jQuery_' + dpuuid] = $;--})(jQuery);-(function( $, undefined ) {--var uiDialogClasses = "ui-dialog ui-widget ui-widget-content ui-corner-all ",- sizeRelatedOptions = {- buttons: true,- height: true,- maxHeight: true,- maxWidth: true,- minHeight: true,- minWidth: true,- width: true- },- resizableRelatedOptions = {- maxHeight: true,- maxWidth: true,- minHeight: true,- minWidth: true- };--$.widget("ui.dialog", {- version: "1.9.1",- options: {- autoOpen: true,- buttons: {},- closeOnEscape: true,- closeText: "close",- dialogClass: "",- draggable: true,- hide: null,- height: "auto",- maxHeight: false,- maxWidth: false,- minHeight: 150,- minWidth: 150,- modal: false,- position: {- my: "center",- at: "center",- of: window,- collision: "fit",- // ensure that the titlebar is never outside the document- using: function( pos ) {- var topOffset = $( this ).css( pos ).offset().top;- if ( topOffset < 0 ) {- $( this ).css( "top", pos.top - topOffset );- }- }- },- resizable: true,- show: null,- stack: true,- title: "",- width: 300,- zIndex: 1000- },-- _create: function() {- this.originalTitle = this.element.attr( "title" );- // #5742 - .attr() might return a DOMElement- if ( typeof this.originalTitle !== "string" ) {- this.originalTitle = "";- }- this.oldPosition = {- parent: this.element.parent(),- index: this.element.parent().children().index( this.element )- };- this.options.title = this.options.title || this.originalTitle;- var that = this,- options = this.options,-- title = options.title || " ",- uiDialog,- uiDialogTitlebar,- uiDialogTitlebarClose,- uiDialogTitle,- uiDialogButtonPane;-- uiDialog = ( this.uiDialog = $( "<div>" ) )- .addClass( uiDialogClasses + options.dialogClass )- .css({- display: "none",- outline: 0, // TODO: move to stylesheet- zIndex: options.zIndex- })- // setting tabIndex makes the div focusable- .attr( "tabIndex", -1)- .keydown(function( event ) {- if ( options.closeOnEscape && !event.isDefaultPrevented() && event.keyCode &&- event.keyCode === $.ui.keyCode.ESCAPE ) {- that.close( event );- event.preventDefault();- }- })- .mousedown(function( event ) {- that.moveToTop( false, event );- })- .appendTo( "body" );-- this.element- .show()- .removeAttr( "title" )- .addClass( "ui-dialog-content ui-widget-content" )- .appendTo( uiDialog );-- uiDialogTitlebar = ( this.uiDialogTitlebar = $( "<div>" ) )- .addClass( "ui-dialog-titlebar ui-widget-header " +- "ui-corner-all ui-helper-clearfix" )- .bind( "mousedown", function() {- // Dialog isn't getting focus when dragging (#8063)- uiDialog.focus();- })- .prependTo( uiDialog );-- uiDialogTitlebarClose = $( "<a href='#'></a>" )- .addClass( "ui-dialog-titlebar-close ui-corner-all" )- .attr( "role", "button" )- .click(function( event ) {- event.preventDefault();- that.close( event );- })- .appendTo( uiDialogTitlebar );-- ( this.uiDialogTitlebarCloseText = $( "<span>" ) )- .addClass( "ui-icon ui-icon-closethick" )- .text( options.closeText )- .appendTo( uiDialogTitlebarClose );-- uiDialogTitle = $( "<span>" )- .uniqueId()- .addClass( "ui-dialog-title" )- .html( title )- .prependTo( uiDialogTitlebar );-- uiDialogButtonPane = ( this.uiDialogButtonPane = $( "<div>" ) )- .addClass( "ui-dialog-buttonpane ui-widget-content ui-helper-clearfix" );-- ( this.uiButtonSet = $( "<div>" ) )- .addClass( "ui-dialog-buttonset" )- .appendTo( uiDialogButtonPane );-- uiDialog.attr({- role: "dialog",- "aria-labelledby": uiDialogTitle.attr( "id" )- });-- uiDialogTitlebar.find( "*" ).add( uiDialogTitlebar ).disableSelection();- this._hoverable( uiDialogTitlebarClose );- this._focusable( uiDialogTitlebarClose );-- if ( options.draggable && $.fn.draggable ) {- this._makeDraggable();- }- if ( options.resizable && $.fn.resizable ) {- this._makeResizable();- }-- this._createButtons( options.buttons );- this._isOpen = false;-- if ( $.fn.bgiframe ) {- uiDialog.bgiframe();- }-- // prevent tabbing out of modal dialogs- this._on( uiDialog, { keydown: function( event ) {- if ( !options.modal || event.keyCode !== $.ui.keyCode.TAB ) {- return;- }-- var tabbables = $( ":tabbable", uiDialog ),- first = tabbables.filter( ":first" ),- last = tabbables.filter( ":last" );-- if ( event.target === last[0] && !event.shiftKey ) {- first.focus( 1 );- return false;- } else if ( event.target === first[0] && event.shiftKey ) {- last.focus( 1 );- return false;- }- }});- },-- _init: function() {- if ( this.options.autoOpen ) {- this.open();- }- },-- _destroy: function() {- var next,- oldPosition = this.oldPosition;-- if ( this.overlay ) {- this.overlay.destroy();- }- this.uiDialog.hide();- this.element- .removeClass( "ui-dialog-content ui-widget-content" )- .hide()- .appendTo( "body" );- this.uiDialog.remove();-- if ( this.originalTitle ) {- this.element.attr( "title", this.originalTitle );- }-- next = oldPosition.parent.children().eq( oldPosition.index );- // Don't try to place the dialog next to itself (#8613)- if ( next.length && next[ 0 ] !== this.element[ 0 ] ) {- next.before( this.element );- } else {- oldPosition.parent.append( this.element );- }- },-- widget: function() {- return this.uiDialog;- },-- close: function( event ) {- var that = this,- maxZ, thisZ;-- if ( !this._isOpen ) {- return;- }-- if ( false === this._trigger( "beforeClose", event ) ) {- return;- }-- this._isOpen = false;-- if ( this.overlay ) {- this.overlay.destroy();- }-- if ( this.options.hide ) {- this._hide( this.uiDialog, this.options.hide, function() {- that._trigger( "close", event );- });- } else {- this.uiDialog.hide();- this._trigger( "close", event );- }-- $.ui.dialog.overlay.resize();-- // adjust the maxZ to allow other modal dialogs to continue to work (see #4309)- if ( this.options.modal ) {- maxZ = 0;- $( ".ui-dialog" ).each(function() {- if ( this !== that.uiDialog[0] ) {- thisZ = $( this ).css( "z-index" );- if ( !isNaN( thisZ ) ) {- maxZ = Math.max( maxZ, thisZ );- }- }- });- $.ui.dialog.maxZ = maxZ;- }-- return this;- },-- isOpen: function() {- return this._isOpen;- },-- // the force parameter allows us to move modal dialogs to their correct- // position on open- moveToTop: function( force, event ) {- var options = this.options,- saveScroll;-- if ( ( options.modal && !force ) ||- ( !options.stack && !options.modal ) ) {- return this._trigger( "focus", event );- }-- if ( options.zIndex > $.ui.dialog.maxZ ) {- $.ui.dialog.maxZ = options.zIndex;- }- if ( this.overlay ) {- $.ui.dialog.maxZ += 1;- $.ui.dialog.overlay.maxZ = $.ui.dialog.maxZ;- this.overlay.$el.css( "z-index", $.ui.dialog.overlay.maxZ );- }-- // Save and then restore scroll- // Opera 9.5+ resets when parent z-index is changed.- // http://bugs.jqueryui.com/ticket/3193- saveScroll = {- scrollTop: this.element.scrollTop(),- scrollLeft: this.element.scrollLeft()- };- $.ui.dialog.maxZ += 1;- this.uiDialog.css( "z-index", $.ui.dialog.maxZ );- this.element.attr( saveScroll );- this._trigger( "focus", event );-- return this;- },-- open: function() {- if ( this._isOpen ) {- return;- }-- var hasFocus,- options = this.options,- uiDialog = this.uiDialog;-- this._size();- this._position( options.position );- uiDialog.show( options.show );- this.overlay = options.modal ? new $.ui.dialog.overlay( this ) : null;- this.moveToTop( true );-- // set focus to the first tabbable element in the content area or the first button- // if there are no tabbable elements, set focus on the dialog itself- hasFocus = this.element.find( ":tabbable" );- if ( !hasFocus.length ) {- hasFocus = this.uiDialogButtonPane.find( ":tabbable" );- if ( !hasFocus.length ) {- hasFocus = uiDialog;- }- }- hasFocus.eq( 0 ).focus();-- this._isOpen = true;- this._trigger( "open" );-- return this;- },-- _createButtons: function( buttons ) {- var that = this,- hasButtons = false;-- // if we already have a button pane, remove it- this.uiDialogButtonPane.remove();- this.uiButtonSet.empty();-- if ( typeof buttons === "object" && buttons !== null ) {- $.each( buttons, function() {- return !(hasButtons = true);- });- }- if ( hasButtons ) {- $.each( buttons, function( name, props ) {- props = $.isFunction( props ) ?- { click: props, text: name } :- props;- var button = $( "<button type='button'></button>" )- .attr( props, true )- .unbind( "click" )- .click(function() {- props.click.apply( that.element[0], arguments );- })- .appendTo( that.uiButtonSet );- if ( $.fn.button ) {- button.button();- }- });- this.uiDialog.addClass( "ui-dialog-buttons" );- this.uiDialogButtonPane.appendTo( this.uiDialog );- } else {- this.uiDialog.removeClass( "ui-dialog-buttons" );- }- },-- _makeDraggable: function() {- var that = this,- options = this.options;-- function filteredUi( ui ) {- return {- position: ui.position,- offset: ui.offset- };- }-- this.uiDialog.draggable({- cancel: ".ui-dialog-content, .ui-dialog-titlebar-close",- handle: ".ui-dialog-titlebar",- containment: "document",- start: function( event, ui ) {- $( this )- .addClass( "ui-dialog-dragging" );- that._trigger( "dragStart", event, filteredUi( ui ) );- },- drag: function( event, ui ) {- that._trigger( "drag", event, filteredUi( ui ) );- },- stop: function( event, ui ) {- options.position = [- ui.position.left - that.document.scrollLeft(),- ui.position.top - that.document.scrollTop()- ];- $( this )- .removeClass( "ui-dialog-dragging" );- that._trigger( "dragStop", event, filteredUi( ui ) );- $.ui.dialog.overlay.resize();- }- });- },-- _makeResizable: function( handles ) {- handles = (handles === undefined ? this.options.resizable : handles);- var that = this,- options = this.options,- // .ui-resizable has position: relative defined in the stylesheet- // but dialogs have to use absolute or fixed positioning- position = this.uiDialog.css( "position" ),- resizeHandles = typeof handles === 'string' ?- handles :- "n,e,s,w,se,sw,ne,nw";-- function filteredUi( ui ) {- return {- originalPosition: ui.originalPosition,- originalSize: ui.originalSize,- position: ui.position,- size: ui.size- };- }-- this.uiDialog.resizable({- cancel: ".ui-dialog-content",- containment: "document",- alsoResize: this.element,- maxWidth: options.maxWidth,- maxHeight: options.maxHeight,- minWidth: options.minWidth,- minHeight: this._minHeight(),- handles: resizeHandles,- start: function( event, ui ) {- $( this ).addClass( "ui-dialog-resizing" );- that._trigger( "resizeStart", event, filteredUi( ui ) );- },- resize: function( event, ui ) {- that._trigger( "resize", event, filteredUi( ui ) );- },- stop: function( event, ui ) {- $( this ).removeClass( "ui-dialog-resizing" );- options.height = $( this ).height();- options.width = $( this ).width();- that._trigger( "resizeStop", event, filteredUi( ui ) );- $.ui.dialog.overlay.resize();- }- })- .css( "position", position )- .find( ".ui-resizable-se" )- .addClass( "ui-icon ui-icon-grip-diagonal-se" );- },-- _minHeight: function() {- var options = this.options;-- if ( options.height === "auto" ) {- return options.minHeight;- } else {- return Math.min( options.minHeight, options.height );- }- },-- _position: function( position ) {- var myAt = [],- offset = [ 0, 0 ],- isVisible;-- if ( position ) {- // deep extending converts arrays to objects in jQuery <= 1.3.2 :-(- // if (typeof position == 'string' || $.isArray(position)) {- // myAt = $.isArray(position) ? position : position.split(' ');-- if ( typeof position === "string" || (typeof position === "object" && "0" in position ) ) {- myAt = position.split ? position.split( " " ) : [ position[ 0 ], position[ 1 ] ];- if ( myAt.length === 1 ) {- myAt[ 1 ] = myAt[ 0 ];- }-- $.each( [ "left", "top" ], function( i, offsetPosition ) {- if ( +myAt[ i ] === myAt[ i ] ) {- offset[ i ] = myAt[ i ];- myAt[ i ] = offsetPosition;- }- });-- position = {- my: myAt[0] + (offset[0] < 0 ? offset[0] : "+" + offset[0]) + " " +- myAt[1] + (offset[1] < 0 ? offset[1] : "+" + offset[1]),- at: myAt.join( " " )- };- }-- position = $.extend( {}, $.ui.dialog.prototype.options.position, position );- } else {- position = $.ui.dialog.prototype.options.position;- }-- // need to show the dialog to get the actual offset in the position plugin- isVisible = this.uiDialog.is( ":visible" );- if ( !isVisible ) {- this.uiDialog.show();- }- this.uiDialog.position( position );- if ( !isVisible ) {- this.uiDialog.hide();- }- },-- _setOptions: function( options ) {- var that = this,- resizableOptions = {},- resize = false;-- $.each( options, function( key, value ) {- that._setOption( key, value );-- if ( key in sizeRelatedOptions ) {- resize = true;- }- if ( key in resizableRelatedOptions ) {- resizableOptions[ key ] = value;- }- });-- if ( resize ) {- this._size();- }- if ( this.uiDialog.is( ":data(resizable)" ) ) {- this.uiDialog.resizable( "option", resizableOptions );- }- },-- _setOption: function( key, value ) {- var isDraggable, isResizable,- uiDialog = this.uiDialog;-- switch ( key ) {- case "buttons":- this._createButtons( value );- break;- case "closeText":- // ensure that we always pass a string- this.uiDialogTitlebarCloseText.text( "" + value );- break;- case "dialogClass":- uiDialog- .removeClass( this.options.dialogClass )- .addClass( uiDialogClasses + value );- break;- case "disabled":- if ( value ) {- uiDialog.addClass( "ui-dialog-disabled" );- } else {- uiDialog.removeClass( "ui-dialog-disabled" );- }- break;- case "draggable":- isDraggable = uiDialog.is( ":data(draggable)" );- if ( isDraggable && !value ) {- uiDialog.draggable( "destroy" );- }-- if ( !isDraggable && value ) {- this._makeDraggable();- }- break;- case "position":- this._position( value );- break;- case "resizable":- // currently resizable, becoming non-resizable- isResizable = uiDialog.is( ":data(resizable)" );- if ( isResizable && !value ) {- uiDialog.resizable( "destroy" );- }-- // currently resizable, changing handles- if ( isResizable && typeof value === "string" ) {- uiDialog.resizable( "option", "handles", value );- }-- // currently non-resizable, becoming resizable- if ( !isResizable && value !== false ) {- this._makeResizable( value );- }- break;- case "title":- // convert whatever was passed in o a string, for html() to not throw up- $( ".ui-dialog-title", this.uiDialogTitlebar )- .html( "" + ( value || " " ) );- break;- }-- this._super( key, value );- },-- _size: function() {- /* If the user has resized the dialog, the .ui-dialog and .ui-dialog-content- * divs will both have width and height set, so we need to reset them- */- var nonContentHeight, minContentHeight, autoHeight,- options = this.options,- isVisible = this.uiDialog.is( ":visible" );-- // reset content sizing- this.element.show().css({- width: "auto",- minHeight: 0,- height: 0- });-- if ( options.minWidth > options.width ) {- options.width = options.minWidth;- }-- // reset wrapper sizing- // determine the height of all the non-content elements- nonContentHeight = this.uiDialog.css({- height: "auto",- width: options.width- })- .outerHeight();- minContentHeight = Math.max( 0, options.minHeight - nonContentHeight );-- if ( options.height === "auto" ) {- // only needed for IE6 support- if ( $.support.minHeight ) {- this.element.css({- minHeight: minContentHeight,- height: "auto"- });- } else {- this.uiDialog.show();- autoHeight = this.element.css( "height", "auto" ).height();- if ( !isVisible ) {- this.uiDialog.hide();- }- this.element.height( Math.max( autoHeight, minContentHeight ) );- }- } else {- this.element.height( Math.max( options.height - nonContentHeight, 0 ) );- }-- if (this.uiDialog.is( ":data(resizable)" ) ) {- this.uiDialog.resizable( "option", "minHeight", this._minHeight() );- }- }-});--$.extend($.ui.dialog, {- uuid: 0,- maxZ: 0,-- getTitleId: function($el) {- var id = $el.attr( "id" );- if ( !id ) {- this.uuid += 1;- id = this.uuid;- }- return "ui-dialog-title-" + id;- },-- overlay: function( dialog ) {- this.$el = $.ui.dialog.overlay.create( dialog );- }-});--$.extend( $.ui.dialog.overlay, {- instances: [],- // reuse old instances due to IE memory leak with alpha transparency (see #5185)- oldInstances: [],- maxZ: 0,- events: $.map(- "focus,mousedown,mouseup,keydown,keypress,click".split( "," ),- function( event ) {- return event + ".dialog-overlay";- }- ).join( " " ),- create: function( dialog ) {- if ( this.instances.length === 0 ) {- // prevent use of anchors and inputs- // we use a setTimeout in case the overlay is created from an- // event that we're going to be cancelling (see #2804)- setTimeout(function() {- // handle $(el).dialog().dialog('close') (see #4065)- if ( $.ui.dialog.overlay.instances.length ) {- $( document ).bind( $.ui.dialog.overlay.events, function( event ) {- // stop events if the z-index of the target is < the z-index of the overlay- // we cannot return true when we don't want to cancel the event (#3523)- if ( $( event.target ).zIndex() < $.ui.dialog.overlay.maxZ ) {- return false;- }- });- }- }, 1 );-- // handle window resize- $( window ).bind( "resize.dialog-overlay", $.ui.dialog.overlay.resize );- }-- var $el = ( this.oldInstances.pop() || $( "<div>" ).addClass( "ui-widget-overlay" ) );-- // allow closing by pressing the escape key- $( document ).bind( "keydown.dialog-overlay", function( event ) {- var instances = $.ui.dialog.overlay.instances;- // only react to the event if we're the top overlay- if ( instances.length !== 0 && instances[ instances.length - 1 ] === $el &&- dialog.options.closeOnEscape && !event.isDefaultPrevented() && event.keyCode &&- event.keyCode === $.ui.keyCode.ESCAPE ) {-- dialog.close( event );- event.preventDefault();- }- });-- $el.appendTo( document.body ).css({- width: this.width(),- height: this.height()- });-- if ( $.fn.bgiframe ) {- $el.bgiframe();- }-- this.instances.push( $el );- return $el;- },-- destroy: function( $el ) {- var indexOf = $.inArray( $el, this.instances ),- maxZ = 0;-- if ( indexOf !== -1 ) {- this.oldInstances.push( this.instances.splice( indexOf, 1 )[ 0 ] );- }-- if ( this.instances.length === 0 ) {- $( [ document, window ] ).unbind( ".dialog-overlay" );- }-- $el.height( 0 ).width( 0 ).remove();-- // adjust the maxZ to allow other modal dialogs to continue to work (see #4309)- $.each( this.instances, function() {- maxZ = Math.max( maxZ, this.css( "z-index" ) );- });- this.maxZ = maxZ;- },-- height: function() {- var scrollHeight,- offsetHeight;- // handle IE- if ( $.ui.ie ) {- scrollHeight = Math.max(- document.documentElement.scrollHeight,- document.body.scrollHeight- );- offsetHeight = Math.max(- document.documentElement.offsetHeight,- document.body.offsetHeight- );-- if ( scrollHeight < offsetHeight ) {- return $( window ).height() + "px";- } else {- return scrollHeight + "px";- }- // handle "good" browsers- } else {- return $( document ).height() + "px";- }- },-- width: function() {- var scrollWidth,- offsetWidth;- // handle IE- if ( $.ui.ie ) {- scrollWidth = Math.max(- document.documentElement.scrollWidth,- document.body.scrollWidth- );- offsetWidth = Math.max(- document.documentElement.offsetWidth,- document.body.offsetWidth- );-- if ( scrollWidth < offsetWidth ) {- return $( window ).width() + "px";- } else {- return scrollWidth + "px";- }- // handle "good" browsers- } else {- return $( document ).width() + "px";- }- },-- resize: function() {- /* If the dialog is draggable and the user drags it past the- * right edge of the window, the document becomes wider so we- * need to stretch the overlay. If the user then drags the- * dialog back to the left, the document will become narrower,- * so we need to shrink the overlay to the appropriate size.- * This is handled by shrinking the overlay before setting it- * to the full document size.- */- var $overlays = $( [] );- $.each( $.ui.dialog.overlay.instances, function() {- $overlays = $overlays.add( this );- });-- $overlays.css({- width: 0,- height: 0- }).css({- width: $.ui.dialog.overlay.width(),- height: $.ui.dialog.overlay.height()- });- }-});--$.extend( $.ui.dialog.overlay.prototype, {- destroy: function() {- $.ui.dialog.overlay.destroy( this.$el );- }-});--}( jQuery ) );-(function( $, undefined ) {--var mouseHandled = false;--$.widget( "ui.menu", {- version: "1.9.1",- defaultElement: "<ul>",- delay: 300,- options: {- icons: {- submenu: "ui-icon-carat-1-e"- },- menus: "ul",- position: {- my: "left top",- at: "right top"- },- role: "menu",-- // callbacks- blur: null,- focus: null,- select: null- },-- _create: function() {- this.activeMenu = this.element;- 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- })- // need to catch all clicks on disabled menu- // not possible through _on- .bind( "click" + this.eventNamespace, $.proxy(function( event ) {- if ( this.options.disabled ) {- event.preventDefault();- }- }, this ));-- if ( this.options.disabled ) {- this.element- .addClass( "ui-state-disabled" )- .attr( "aria-disabled", "true" );- }-- this._on({- // Prevent focus from sticking to links inside menu after clicking- // them (focus should always stay on UL during navigation).- "mousedown .ui-menu-item > a": function( event ) {- event.preventDefault();- },- "click .ui-state-disabled > a": function( event ) {- event.preventDefault();- },- "click .ui-menu-item:has(a)": function( event ) {- var target = $( event.target ).closest( ".ui-menu-item" );- if ( !mouseHandled && target.not( ".ui-state-disabled" ).length ) {- mouseHandled = true;-- this.select( event );- // Open submenu on click- if ( target.has( ".ui-menu" ).length ) {- this.expand( event );- } else if ( !this.element.is( ":focus" ) ) {- // Redirect focus to the menu- this.element.trigger( "focus", [ true ] );-- // If the active item is on the top level, let it stay active.- // Otherwise, blur the active item since it is no longer visible.- if ( this.active && this.active.parents( ".ui-menu" ).length === 1 ) {- clearTimeout( this.timer );- }- }- }- },- "mouseenter .ui-menu-item": function( event ) {- var target = $( event.currentTarget );- // Remove ui-state-active class from siblings of the newly focused menu item- // to avoid a jump caused by adjacent elements both having a class with a border- target.siblings().children( ".ui-state-active" ).removeClass( "ui-state-active" );- this.focus( event, target );- },- mouseleave: "collapseAll",- "mouseleave .ui-menu": "collapseAll",- focus: function( event, keepActiveItem ) {- // If there's already an active item, keep it active- // If not, activate the first item- var item = this.active || this.element.children( ".ui-menu-item" ).eq( 0 );-- if ( !keepActiveItem ) {- this.focus( event, item );- }- },- blur: function( event ) {- this._delay(function() {- if ( !$.contains( this.element[0], this.document[0].activeElement ) ) {- this.collapseAll( event );- }- });- },- keydown: "_keydown"- });-- this.refresh();-- // Clicks outside of a menu collapse any open menus- this._on( this.document, {- click: function( event ) {- if ( !$( event.target ).closest( ".ui-menu" ).length ) {- this.collapseAll( event );- }-- // Reset the mouseHandled flag- mouseHandled = false;- }- });- },-- _destroy: function() {- // Destroy (sub)menus- this.element- .removeAttr( "aria-activedescendant" )- .find( ".ui-menu" ).andSelf()- .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();-- // Destroy menu items- 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 elem = $( this );- if ( elem.data( "ui-menu-submenu-carat" ) ) {- elem.remove();- }- });-- // Destroy menu dividers- this.element.find( ".ui-menu-divider" ).removeClass( "ui-menu-divider ui-widget-content" );- },-- _keydown: function( event ) {- var match, prev, character, skip, regex,- preventDefault = true;-- function escape( value ) {- return value.replace( /[\-\[\]{}()*+?.,\\\^$|#\s]/g, "\\$&" );- }-- switch ( event.keyCode ) {- case $.ui.keyCode.PAGE_UP:- this.previousPage( event );- break;- case $.ui.keyCode.PAGE_DOWN:- this.nextPage( event );- break;- case $.ui.keyCode.HOME:- this._move( "first", "first", event );- break;- case $.ui.keyCode.END:- this._move( "last", "last", event );- break;- case $.ui.keyCode.UP:- this.previous( event );- break;- case $.ui.keyCode.DOWN:- this.next( event );- break;- case $.ui.keyCode.LEFT:- this.collapse( event );- break;- case $.ui.keyCode.RIGHT:- if ( this.active && !this.active.is( ".ui-state-disabled" ) ) {- this.expand( event );- }- break;- case $.ui.keyCode.ENTER:- case $.ui.keyCode.SPACE:- this._activate( event );- break;- case $.ui.keyCode.ESCAPE:- this.collapse( event );- break;- default:- preventDefault = false;- prev = this.previousFilter || "";- character = String.fromCharCode( event.keyCode );- skip = false;-- clearTimeout( this.filterTimer );-- if ( character === prev ) {- skip = true;- } else {- character = prev + character;- }-- regex = new RegExp( "^" + escape( character ), "i" );- match = this.activeMenu.children( ".ui-menu-item" ).filter(function() {- return regex.test( $( this ).children( "a" ).text() );- });- match = skip && match.index( this.active.next() ) !== -1 ?- this.active.nextAll( ".ui-menu-item" ) :- match;-- // If no matches on the current filter, reset to the last character pressed- // to move down the menu to the first item that starts with that character- if ( !match.length ) {- character = String.fromCharCode( event.keyCode );- regex = new RegExp( "^" + escape( character ), "i" );- match = this.activeMenu.children( ".ui-menu-item" ).filter(function() {- return regex.test( $( this ).children( "a" ).text() );- });- }-- if ( match.length ) {- this.focus( event, match );- if ( match.length > 1 ) {- this.previousFilter = character;- this.filterTimer = this._delay(function() {- delete this.previousFilter;- }, 1000 );- } else {- delete this.previousFilter;- }- } else {- delete this.previousFilter;- }- }-- if ( preventDefault ) {- event.preventDefault();- }- },-- _activate: function( event ) {- if ( !this.active.is( ".ui-state-disabled" ) ) {- if ( this.active.children( "a[aria-haspopup='true']" ).length ) {- this.expand( event );- } else {- this.select( event );- }- }- },-- refresh: function() {- // Initialize nested menus- var menus,- icon = this.options.icons.submenu,- submenus = this.element.find( this.options.menus + ":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"- });-- // Don't refresh list items that are already adapted- menus = submenus.add( this.element );-- menus.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()- });-- // Initialize unlinked menu-items containing spaces and/or dashes only as dividers- menus.children( ":not(.ui-menu-item)" ).each(function() {- var item = $( this );- // hyphen, em dash, en dash- if ( !/[^\-—–\s]/.test( item.text() ) ) {- item.addClass( "ui-widget-content ui-menu-divider" );- }- });-- // Add aria-disabled attribute to any disabled menu item- menus.children( ".ui-state-disabled" ).attr( "aria-disabled", "true" );-- submenus.each(function() {- var menu = $( this ),- item = menu.prev( "a" ),- submenuCarat = $( "<span>" )- .addClass( "ui-menu-icon ui-icon " + icon )- .data( "ui-menu-submenu-carat", true );-- item- .attr( "aria-haspopup", "true" )- .prepend( submenuCarat );- menu.attr( "aria-labelledby", item.attr( "id" ) );- });-- // If the active item has been removed, blur the menu- if ( this.active && !$.contains( this.element[ 0 ], this.active[ 0 ] ) ) {- this.blur();- }- },-- _itemRole: function() {- return {- menu: "menuitem",- listbox: "option"- }[ this.options.role ];- },-- focus: function( event, item ) {- var nested, focused;- this.blur( event, event && event.type === "focus" );-- this._scrollIntoView( item );-- this.active = item.first();- focused = this.active.children( "a" ).addClass( "ui-state-focus" );- // Only update aria-activedescendant if there's a role- // otherwise we assume focus is managed elsewhere- if ( this.options.role ) {- this.element.attr( "aria-activedescendant", focused.attr( "id" ) );- }-- // Highlight active parent menu item, if any- this.active- .parent()- .closest( ".ui-menu-item" )- .children( "a:first" )- .addClass( "ui-state-active" );-- if ( event && event.type === "keydown" ) {- this._close();- } else {- this.timer = this._delay(function() {- this._close();- }, this.delay );- }-- nested = item.children( ".ui-menu" );- if ( nested.length && ( /^mouse/.test( event.type ) ) ) {- this._startOpening(nested);- }- this.activeMenu = item.parent();-- this._trigger( "focus", event, { item: item } );- },-- _scrollIntoView: function( item ) {- var borderTop, paddingTop, offset, scroll, elementHeight, itemHeight;- if ( this._hasScroll() ) {- borderTop = parseFloat( $.css( this.activeMenu[0], "borderTopWidth" ) ) || 0;- paddingTop = parseFloat( $.css( this.activeMenu[0], "paddingTop" ) ) || 0;- offset = item.offset().top - this.activeMenu.offset().top - borderTop - paddingTop;- scroll = this.activeMenu.scrollTop();- elementHeight = this.activeMenu.height();- itemHeight = item.height();-- if ( offset < 0 ) {- this.activeMenu.scrollTop( scroll + offset );- } else if ( offset + itemHeight > elementHeight ) {- this.activeMenu.scrollTop( scroll + offset - elementHeight + itemHeight );- }- }- },-- blur: function( event, fromFocus ) {- if ( !fromFocus ) {- clearTimeout( this.timer );- }-- if ( !this.active ) {- return;- }-- this.active.children( "a" ).removeClass( "ui-state-focus" );- this.active = null;-- this._trigger( "blur", event, { item: this.active } );- },-- _startOpening: function( submenu ) {- clearTimeout( this.timer );-- // Don't open if already open fixes a Firefox bug that caused a .5 pixel- // shift in the submenu position when mousing over the carat icon- if ( submenu.attr( "aria-hidden" ) !== "true" ) {- return;- }-- this.timer = this._delay(function() {- this._close();- this._open( submenu );- }, this.delay );- },-- _open: function( submenu ) {- var position = $.extend({- of: this.active- }, this.options.position );-- clearTimeout( this.timer );- this.element.find( ".ui-menu" ).not( submenu.parents( ".ui-menu" ) )- .hide()- .attr( "aria-hidden", "true" );-- submenu- .show()- .removeAttr( "aria-hidden" )- .attr( "aria-expanded", "true" )- .position( position );- },-- collapseAll: function( event, all ) {- clearTimeout( this.timer );- this.timer = this._delay(function() {- // If we were passed an event, look for the submenu that contains the event- var currentMenu = all ? this.element :- $( event && event.target ).closest( this.element.find( ".ui-menu" ) );-- // If we found no valid submenu ancestor, use the main menu to close all sub menus anyway- if ( !currentMenu.length ) {- currentMenu = this.element;- }-- this._close( currentMenu );-- this.blur( event );- this.activeMenu = currentMenu;- }, this.delay );- },-- // With no arguments, closes the currently active menu - if nothing is active- // it closes all menus. If passed an argument, it will search for menus BELOW- _close: function( startMenu ) {- if ( !startMenu ) {- startMenu = this.active ? this.active.parent() : this.element;- }-- startMenu- .find( ".ui-menu" )- .hide()- .attr( "aria-hidden", "true" )- .attr( "aria-expanded", "false" )- .end()- .find( "a.ui-state-active" )- .removeClass( "ui-state-active" );- },-- collapse: function( event ) {- var newItem = this.active &&- this.active.parent().closest( ".ui-menu-item", this.element );- if ( newItem && newItem.length ) {- this._close();- this.focus( event, newItem );- }- },-- expand: function( event ) {- var newItem = this.active &&- this.active- .children( ".ui-menu " )- .children( ".ui-menu-item" )- .first();-- if ( newItem && newItem.length ) {- this._open( newItem.parent() );-- // Delay so Firefox will not hide activedescendant change in expanding submenu from AT- this._delay(function() {- this.focus( event, newItem );- });- }- },-- next: function( event ) {- this._move( "next", "first", event );- },-- previous: function( event ) {- this._move( "prev", "last", event );- },-- 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( direction, filter, event ) {- var next;- if ( this.active ) {- if ( direction === "first" || direction === "last" ) {- next = this.active- [ direction === "first" ? "prevAll" : "nextAll" ]( ".ui-menu-item" )- .eq( -1 );- } else {- next = this.active- [ direction + "All" ]( ".ui-menu-item" )- .eq( 0 );- }- }- if ( !next || !next.length || !this.active ) {- next = this.activeMenu.children( ".ui-menu-item" )[ filter ]();- }-- this.focus( event, next );- },-- nextPage: function( event ) {- var item, base, height;-- if ( !this.active ) {- this.next( event );- return;- }- if ( this.isLastItem() ) {- return;- }- if ( this._hasScroll() ) {- base = this.active.offset().top;- height = this.element.height();- this.active.nextAll( ".ui-menu-item" ).each(function() {- item = $( this );- return item.offset().top - base - height < 0;- });-- this.focus( event, item );- } else {- this.focus( event, this.activeMenu.children( ".ui-menu-item" )- [ !this.active ? "first" : "last" ]() );- }- },-- previousPage: function( event ) {- var item, base, height;- if ( !this.active ) {- this.next( event );- return;- }- if ( this.isFirstItem() ) {- return;- }- if ( this._hasScroll() ) {- base = this.active.offset().top;- height = this.element.height();- this.active.prevAll( ".ui-menu-item" ).each(function() {- item = $( this );- return item.offset().top - base + height > 0;- });-- this.focus( event, item );- } else {- this.focus( event, this.activeMenu.children( ".ui-menu-item" ).first() );- }- },-- _hasScroll: function() {- return this.element.outerHeight() < this.element.prop( "scrollHeight" );- },-- select: function( event ) {- // TODO: It should never be possible to not have an active item at this- // point, but the tests don't trigger mouseenter before click.- this.active = this.active || $( event.target ).closest( ".ui-menu-item" );- var ui = { item: this.active };- if ( !this.active.has( ".ui-menu" ).length ) {- this.collapseAll( event, true );- }- this._trigger( "select", event, ui );- }-});--}( jQuery ));-(function( $, undefined ) {--$.widget( "ui.progressbar", {- version: "1.9.1",- options: {- value: 0,- max: 100- },-- min: 0,-- _create: function() {- this.element- .addClass( "ui-progressbar ui-widget ui-widget-content ui-corner-all" )- .attr({- role: "progressbar",- "aria-valuemin": this.min,- "aria-valuemax": this.options.max,- "aria-valuenow": this._value()- });-- this.valueDiv = $( "<div class='ui-progressbar-value ui-widget-header ui-corner-left'></div>" )- .appendTo( this.element );-- this.oldValue = this._value();- 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( newValue ) {- if ( newValue === undefined ) {- return this._value();- }-- this._setOption( "value", newValue );- return this;- },-- _setOption: function( key, value ) {- if ( key === "value" ) {- this.options.value = value;- this._refreshValue();- if ( this._value() === this.options.max ) {- this._trigger( "complete" );- }- }-- this._super( key, value );- },-- _value: function() {- var val = this.options.value;- // normalize invalid value- if ( typeof val !== "number" ) {- val = 0;- }- return Math.min( this.options.max, Math.max( this.min, val ) );- },-- _percentage: function() {- return 100 * this._value() / this.options.max;- },-- _refreshValue: function() {- var value = this.value(),- percentage = this._percentage();-- if ( this.oldValue !== value ) {- this.oldValue = value;- this._trigger( "change" );- }-- this.valueDiv- .toggle( value > this.min )- .toggleClass( "ui-corner-right", value === this.options.max )- .width( percentage.toFixed(0) + "%" );- this.element.attr( "aria-valuenow", value );- }-});--})( jQuery );-(function( $, undefined ) {--// number of pages in a slider-// (how many times can you page up/down to go through the whole range)-var numPages = 5;--$.widget( "ui.slider", $.ui.mouse, {- version: "1.9.1",- widgetEventPrefix: "slide",-- options: {- animate: false,- distance: 0,- max: 100,- min: 0,- orientation: "horizontal",- range: false,- step: 1,- value: 0,- values: null- },-- _create: function() {- var i, handleCount,- o = this.options,- existingHandles = this.element.find( ".ui-slider-handle" ).addClass( "ui-state-default ui-corner-all" ),- handle = "<a class='ui-slider-handle ui-state-default ui-corner-all' href='#'></a>",- handles = [];-- this._keySliding = false;- this._mouseSliding = false;- this._animateOff = true;- this._handleIndex = null;- this._detectOrientation();- this._mouseInit();-- this.element- .addClass( "ui-slider" +- " ui-slider-" + this.orientation +- " ui-widget" +- " ui-widget-content" +- " ui-corner-all" +- ( o.disabled ? " ui-slider-disabled ui-disabled" : "" ) );-- this.range = $([]);-- if ( o.range ) {- if ( o.range === true ) {- if ( !o.values ) {- o.values = [ this._valueMin(), this._valueMin() ];- }- if ( o.values.length && o.values.length !== 2 ) {- o.values = [ o.values[0], o.values[0] ];- }- }-- this.range = $( "<div></div>" )- .appendTo( this.element )- .addClass( "ui-slider-range" +- // note: this isn't the most fittingly semantic framework class for this element,- // but worked best visually with a variety of themes- " ui-widget-header" +- ( ( o.range === "min" || o.range === "max" ) ? " ui-slider-range-" + o.range : "" ) );- }-- handleCount = ( o.values && o.values.length ) || 1;-- for ( i = existingHandles.length; i < handleCount; i++ ) {- handles.push( handle );- }-- this.handles = existingHandles.add( $( handles.join( "" ) ).appendTo( this.element ) );-- this.handle = this.handles.eq( 0 );-- this.handles.add( this.range ).filter( "a" )- .click(function( event ) {- event.preventDefault();- })- .mouseenter(function() {- if ( !o.disabled ) {- $( this ).addClass( "ui-state-hover" );- }- })- .mouseleave(function() {- $( this ).removeClass( "ui-state-hover" );- })- .focus(function() {- if ( !o.disabled ) {- $( ".ui-slider .ui-state-focus" ).removeClass( "ui-state-focus" );- $( this ).addClass( "ui-state-focus" );- } else {- $( this ).blur();- }- })- .blur(function() {- $( this ).removeClass( "ui-state-focus" );- });-- this.handles.each(function( i ) {- $( this ).data( "ui-slider-handle-index", i );- });-- this._on( this.handles, {- keydown: function( event ) {- var allowed, curVal, newVal, step,- index = $( event.target ).data( "ui-slider-handle-index" );-- switch ( event.keyCode ) {- case $.ui.keyCode.HOME:- case $.ui.keyCode.END:- case $.ui.keyCode.PAGE_UP:- case $.ui.keyCode.PAGE_DOWN:- case $.ui.keyCode.UP:- case $.ui.keyCode.RIGHT:- case $.ui.keyCode.DOWN:- case $.ui.keyCode.LEFT:- event.preventDefault();- if ( !this._keySliding ) {- this._keySliding = true;- $( event.target ).addClass( "ui-state-active" );- allowed = this._start( event, index );- if ( allowed === false ) {- return;- }- }- break;- }-- step = this.options.step;- if ( this.options.values && this.options.values.length ) {- curVal = newVal = this.values( index );- } else {- curVal = newVal = this.value();- }-- switch ( event.keyCode ) {- case $.ui.keyCode.HOME:- newVal = this._valueMin();- break;- case $.ui.keyCode.END:- newVal = this._valueMax();- break;- case $.ui.keyCode.PAGE_UP:- newVal = this._trimAlignValue( curVal + ( (this._valueMax() - this._valueMin()) / numPages ) );- break;- case $.ui.keyCode.PAGE_DOWN:- newVal = this._trimAlignValue( curVal - ( (this._valueMax() - this._valueMin()) / numPages ) );- break;- case $.ui.keyCode.UP:- case $.ui.keyCode.RIGHT:- if ( curVal === this._valueMax() ) {- return;- }- newVal = this._trimAlignValue( curVal + step );- break;- case $.ui.keyCode.DOWN:- case $.ui.keyCode.LEFT:- if ( curVal === this._valueMin() ) {- return;- }- newVal = this._trimAlignValue( curVal - step );- break;- }-- this._slide( event, index, newVal );- },- keyup: function( event ) {- var index = $( event.target ).data( "ui-slider-handle-index" );-- if ( this._keySliding ) {- this._keySliding = false;- this._stop( event, index );- this._change( event, index );- $( event.target ).removeClass( "ui-state-active" );- }- }- });-- this._refreshValue();-- this._animateOff = false;- },-- _destroy: function() {- this.handles.remove();- this.range.remove();-- this.element- .removeClass( "ui-slider" +- " ui-slider-horizontal" +- " ui-slider-vertical" +- " ui-slider-disabled" +- " ui-widget" +- " ui-widget-content" +- " ui-corner-all" );-- this._mouseDestroy();- },-- _mouseCapture: function( event ) {- var position, normValue, distance, closestHandle, index, allowed, offset, mouseOverHandle,- that = this,- o = this.options;-- if ( o.disabled ) {- return false;- }-- this.elementSize = {- width: this.element.outerWidth(),- height: this.element.outerHeight()- };- this.elementOffset = this.element.offset();-- position = { x: event.pageX, y: event.pageY };- normValue = this._normValueFromMouse( position );- distance = this._valueMax() - this._valueMin() + 1;- this.handles.each(function( i ) {- var thisDistance = Math.abs( normValue - that.values(i) );- if ( distance > thisDistance ) {- distance = thisDistance;- closestHandle = $( this );- index = i;- }- });-- // workaround for bug #3736 (if both handles of a range are at 0,- // the first is always used as the one with least distance,- // and moving it is obviously prevented by preventing negative ranges)- if( o.range === true && this.values(1) === o.min ) {- index += 1;- closestHandle = $( this.handles[index] );- }-- allowed = this._start( event, index );- if ( allowed === false ) {- return false;- }- this._mouseSliding = true;-- this._handleIndex = index;-- closestHandle- .addClass( "ui-state-active" )- .focus();-- offset = closestHandle.offset();- mouseOverHandle = !$( event.target ).parents().andSelf().is( ".ui-slider-handle" );- this._clickOffset = mouseOverHandle ? { left: 0, top: 0 } : {- left: event.pageX - offset.left - ( closestHandle.width() / 2 ),- top: event.pageY - offset.top -- ( closestHandle.height() / 2 ) -- ( parseInt( closestHandle.css("borderTopWidth"), 10 ) || 0 ) -- ( parseInt( closestHandle.css("borderBottomWidth"), 10 ) || 0) +- ( parseInt( closestHandle.css("marginTop"), 10 ) || 0)- };-- if ( !this.handles.hasClass( "ui-state-hover" ) ) {- this._slide( event, index, normValue );- }- this._animateOff = true;- return true;- },-- _mouseStart: function() {- return true;- },-- _mouseDrag: function( event ) {- var position = { x: event.pageX, y: event.pageY },- normValue = this._normValueFromMouse( position );-- this._slide( event, this._handleIndex, normValue );-- return false;- },-- _mouseStop: function( event ) {- this.handles.removeClass( "ui-state-active" );- this._mouseSliding = false;-- this._stop( event, this._handleIndex );- this._change( event, this._handleIndex );-- this._handleIndex = null;- this._clickOffset = null;- this._animateOff = false;-- return false;- },-- _detectOrientation: function() {- this.orientation = ( this.options.orientation === "vertical" ) ? "vertical" : "horizontal";- },-- _normValueFromMouse: function( position ) {- var pixelTotal,- pixelMouse,- percentMouse,- valueTotal,- valueMouse;-- if ( this.orientation === "horizontal" ) {- pixelTotal = this.elementSize.width;- pixelMouse = position.x - this.elementOffset.left - ( this._clickOffset ? this._clickOffset.left : 0 );- } else {- pixelTotal = this.elementSize.height;- pixelMouse = position.y - this.elementOffset.top - ( this._clickOffset ? this._clickOffset.top : 0 );- }-- percentMouse = ( pixelMouse / pixelTotal );- if ( percentMouse > 1 ) {- percentMouse = 1;- }- if ( percentMouse < 0 ) {- percentMouse = 0;- }- if ( this.orientation === "vertical" ) {- percentMouse = 1 - percentMouse;- }-- valueTotal = this._valueMax() - this._valueMin();- valueMouse = this._valueMin() + percentMouse * valueTotal;-- return this._trimAlignValue( valueMouse );- },-- _start: function( event, index ) {- var uiHash = {- handle: this.handles[ index ],- value: this.value()- };- if ( this.options.values && this.options.values.length ) {- uiHash.value = this.values( index );- uiHash.values = this.values();- }- return this._trigger( "start", event, uiHash );- },-- _slide: function( event, index, newVal ) {- var otherVal,- newValues,- allowed;-- if ( this.options.values && this.options.values.length ) {- otherVal = this.values( index ? 0 : 1 );-- if ( ( this.options.values.length === 2 && this.options.range === true ) &&- ( ( index === 0 && newVal > otherVal) || ( index === 1 && newVal < otherVal ) )- ) {- newVal = otherVal;- }-- if ( newVal !== this.values( index ) ) {- newValues = this.values();- newValues[ index ] = newVal;- // A slide can be canceled by returning false from the slide callback- allowed = this._trigger( "slide", event, {- handle: this.handles[ index ],- value: newVal,- values: newValues- } );- otherVal = this.values( index ? 0 : 1 );- if ( allowed !== false ) {- this.values( index, newVal, true );- }- }- } else {- if ( newVal !== this.value() ) {- // A slide can be canceled by returning false from the slide callback- allowed = this._trigger( "slide", event, {- handle: this.handles[ index ],- value: newVal- } );- if ( allowed !== false ) {- this.value( newVal );- }- }- }- },-- _stop: function( event, index ) {- var uiHash = {- handle: this.handles[ index ],- value: this.value()- };- if ( this.options.values && this.options.values.length ) {- uiHash.value = this.values( index );- uiHash.values = this.values();- }-- this._trigger( "stop", event, uiHash );- },-- _change: function( event, index ) {- if ( !this._keySliding && !this._mouseSliding ) {- var uiHash = {- handle: this.handles[ index ],- value: this.value()- };- if ( this.options.values && this.options.values.length ) {- uiHash.value = this.values( index );- uiHash.values = this.values();- }-- this._trigger( "change", event, uiHash );- }- },-- value: function( newValue ) {- if ( arguments.length ) {- this.options.value = this._trimAlignValue( newValue );- this._refreshValue();- this._change( null, 0 );- return;- }-- return this._value();- },-- values: function( index, newValue ) {- var vals,- newValues,- i;-- if ( arguments.length > 1 ) {- this.options.values[ index ] = this._trimAlignValue( newValue );- this._refreshValue();- this._change( null, index );- return;- }-- if ( arguments.length ) {- if ( $.isArray( arguments[ 0 ] ) ) {- vals = this.options.values;- newValues = arguments[ 0 ];- for ( i = 0; i < vals.length; i += 1 ) {- vals[ i ] = this._trimAlignValue( newValues[ i ] );- this._change( null, i );- }- this._refreshValue();- } else {- if ( this.options.values && this.options.values.length ) {- return this._values( index );- } else {- return this.value();- }- }- } else {- return this._values();- }- },-- _setOption: function( key, value ) {- var i,- valsLength = 0;-- if ( $.isArray( this.options.values ) ) {- valsLength = this.options.values.length;- }-- $.Widget.prototype._setOption.apply( this, arguments );-- switch ( key ) {- case "disabled":- if ( value ) {- this.handles.filter( ".ui-state-focus" ).blur();- this.handles.removeClass( "ui-state-hover" );- this.handles.prop( "disabled", true );- this.element.addClass( "ui-disabled" );- } else {- this.handles.prop( "disabled", false );- this.element.removeClass( "ui-disabled" );- }- break;- 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 = true;- this._refreshValue();- this._change( null, 0 );- this._animateOff = false;- break;- case "values":- this._animateOff = true;- this._refreshValue();- for ( i = 0; i < valsLength; i += 1 ) {- this._change( null, i );- }- this._animateOff = false;- break;- case "min":- case "max":- this._animateOff = true;- this._refreshValue();- this._animateOff = false;- break;- }- },-- //internal value getter- // _value() returns value trimmed by min and max, aligned by step- _value: function() {- var val = this.options.value;- val = this._trimAlignValue( val );-- return val;- },-- //internal values getter- // _values() returns array of values trimmed by min and max, aligned by step- // _values( index ) returns single value trimmed by min and max, aligned by step- _values: function( index ) {- var val,- vals,- i;-- if ( arguments.length ) {- val = this.options.values[ index ];- val = this._trimAlignValue( val );-- return val;- } else {- // .slice() creates a copy of the array- // this copy gets trimmed by min and max and then returned- vals = this.options.values.slice();- for ( i = 0; i < vals.length; i+= 1) {- vals[ i ] = this._trimAlignValue( vals[ i ] );- }-- return vals;- }- },-- // returns the step-aligned value that val is closest to, between (inclusive) min and max- _trimAlignValue: function( val ) {- if ( val <= this._valueMin() ) {- return this._valueMin();- }- if ( val >= this._valueMax() ) {- return this._valueMax();- }- var step = ( this.options.step > 0 ) ? this.options.step : 1,- valModStep = (val - this._valueMin()) % step,- alignValue = val - valModStep;-- if ( Math.abs(valModStep) * 2 >= step ) {- alignValue += ( valModStep > 0 ) ? step : ( -step );- }-- // Since JavaScript has problems with large floats, round- // the final value to 5 digits after the decimal point (see #4124)- return parseFloat( alignValue.toFixed(5) );- },-- _valueMin: function() {- return this.options.min;- },-- _valueMax: function() {- return this.options.max;- },-- _refreshValue: function() {- var lastValPercent, valPercent, value, valueMin, valueMax,- oRange = this.options.range,- o = this.options,- that = this,- animate = ( !this._animateOff ) ? o.animate : false,- _set = {};-- if ( this.options.values && this.options.values.length ) {- this.handles.each(function( i ) {- valPercent = ( that.values(i) - that._valueMin() ) / ( that._valueMax() - that._valueMin() ) * 100;- _set[ that.orientation === "horizontal" ? "left" : "bottom" ] = valPercent + "%";- $( this ).stop( 1, 1 )[ animate ? "animate" : "css" ]( _set, o.animate );- if ( that.options.range === true ) {- if ( that.orientation === "horizontal" ) {- if ( i === 0 ) {- that.range.stop( 1, 1 )[ animate ? "animate" : "css" ]( { left: valPercent + "%" }, o.animate );- }- if ( i === 1 ) {- that.range[ animate ? "animate" : "css" ]( { width: ( valPercent - lastValPercent ) + "%" }, { queue: false, duration: o.animate } );- }- } else {- if ( i === 0 ) {- that.range.stop( 1, 1 )[ animate ? "animate" : "css" ]( { bottom: ( valPercent ) + "%" }, o.animate );- }- if ( i === 1 ) {- that.range[ animate ? "animate" : "css" ]( { height: ( valPercent - lastValPercent ) + "%" }, { queue: false, duration: o.animate } );- }- }- }- lastValPercent = valPercent;- });- } else {- value = this.value();- valueMin = this._valueMin();- valueMax = this._valueMax();- valPercent = ( valueMax !== valueMin ) ?- ( value - valueMin ) / ( valueMax - valueMin ) * 100 :- 0;- _set[ this.orientation === "horizontal" ? "left" : "bottom" ] = valPercent + "%";- this.handle.stop( 1, 1 )[ animate ? "animate" : "css" ]( _set, o.animate );-- if ( oRange === "min" && this.orientation === "horizontal" ) {- this.range.stop( 1, 1 )[ animate ? "animate" : "css" ]( { width: valPercent + "%" }, o.animate );- }- if ( oRange === "max" && this.orientation === "horizontal" ) {- this.range[ animate ? "animate" : "css" ]( { width: ( 100 - valPercent ) + "%" }, { queue: false, duration: o.animate } );- }- if ( oRange === "min" && this.orientation === "vertical" ) {- this.range.stop( 1, 1 )[ animate ? "animate" : "css" ]( { height: valPercent + "%" }, o.animate );- }- if ( oRange === "max" && this.orientation === "vertical" ) {- this.range[ animate ? "animate" : "css" ]( { height: ( 100 - valPercent ) + "%" }, { queue: false, duration: o.animate } );- }- }- }--});--}(jQuery));-(function( $ ) {--function modifier( fn ) {- return function() {- var previous = this.element.val();- fn.apply( this, arguments );- this._refresh();- if ( previous !== this.element.val() ) {- this._trigger( "change" );- }- };-}--$.widget( "ui.spinner", {- version: "1.9.1",- defaultElement: "<input>",- widgetEventPrefix: "spin",- options: {- culture: null,- icons: {- down: "ui-icon-triangle-1-s",- up: "ui-icon-triangle-1-n"- },- incremental: true,- max: null,- min: null,- numberFormat: null,- page: 10,- step: 1,-- change: null,- spin: null,- start: null,- stop: null- },-- _create: function() {- // handle string values that need to be parsed- this._setOption( "max", this.options.max );- this._setOption( "min", this.options.min );- this._setOption( "step", this.options.step );-- // format the value, but don't constrain- this._value( this.element.val(), true );-- this._draw();- this._on( this._events );- this._refresh();-- // turning off autocomplete prevents the browser from remembering the- // value when navigating through history, so we re-enable autocomplete- // if the page is unloaded before the widget is destroyed. #7790- this._on( this.window, {- beforeunload: function() {- this.element.removeAttr( "autocomplete" );- }- });- },-- _getCreateOptions: function() {- var options = {},- element = this.element;-- $.each( [ "min", "max", "step" ], function( i, option ) {- var value = element.attr( option );- if ( value !== undefined && value.length ) {- options[ option ] = value;- }- });-- return options;- },-- _events: {- keydown: function( event ) {- if ( this._start( event ) && this._keydown( event ) ) {- event.preventDefault();- }- },- keyup: "_stop",- focus: function() {- this.previous = this.element.val();- },- blur: function( event ) {- if ( this.cancelBlur ) {- delete this.cancelBlur;- return;- }-- this._refresh();- if ( this.previous !== this.element.val() ) {- this._trigger( "change", event );- }- },- mousewheel: function( event, delta ) {- if ( !delta ) {- return;- }- if ( !this.spinning && !this._start( event ) ) {- return false;- }-- this._spin( (delta > 0 ? 1 : -1) * this.options.step, event );- clearTimeout( this.mousewheelTimer );- this.mousewheelTimer = this._delay(function() {- if ( this.spinning ) {- this._stop( event );- }- }, 100 );- event.preventDefault();- },- "mousedown .ui-spinner-button": function( event ) {- var previous;-- // We never want the buttons to have focus; whenever the user is- // interacting with the spinner, the focus should be on the input.- // If the input is focused then this.previous is properly set from- // when the input first received focus. If the input is not focused- // then we need to set this.previous based on the value before spinning.- previous = this.element[0] === this.document[0].activeElement ?- this.previous : this.element.val();- function checkFocus() {- var isActive = this.element[0] === this.document[0].activeElement;- if ( !isActive ) {- this.element.focus();- this.previous = previous;- // support: IE- // IE sets focus asynchronously, so we need to check if focus- // moved off of the input because the user clicked on the button.- this._delay(function() {- this.previous = previous;- });- }- }-- // ensure focus is on (or stays on) the text field- event.preventDefault();- checkFocus.call( this );-- // support: IE- // IE doesn't prevent moving focus even with event.preventDefault()- // so we set a flag to know when we should ignore the blur event- // and check (again) if focus moved off of the input.- this.cancelBlur = true;- this._delay(function() {- delete this.cancelBlur;- checkFocus.call( this );- });-- if ( this._start( event ) === false ) {- return;- }-- this._repeat( null, $( event.currentTarget ).hasClass( "ui-spinner-up" ) ? 1 : -1, event );- },- "mouseup .ui-spinner-button": "_stop",- "mouseenter .ui-spinner-button": function( event ) {- // button will add ui-state-active if mouse was down while mouseleave and kept down- if ( !$( event.currentTarget ).hasClass( "ui-state-active" ) ) {- return;- }-- if ( this._start( event ) === false ) {- return false;- }- this._repeat( null, $( event.currentTarget ).hasClass( "ui-spinner-up" ) ? 1 : -1, event );- },- // TODO: do we really want to consider this a stop?- // shouldn't we just stop the repeater and wait until mouseup before- // we trigger the stop event?- "mouseleave .ui-spinner-button": "_stop"- },-- _draw: function() {- var uiSpinner = this.uiSpinner = this.element- .addClass( "ui-spinner-input" )- .attr( "autocomplete", "off" )- .wrap( this._uiSpinnerHtml() )- .parent()- // add buttons- .append( this._buttonHtml() );-- this.element.attr( "role", "spinbutton" );-- // button bindings- this.buttons = uiSpinner.find( ".ui-spinner-button" )- .attr( "tabIndex", -1 )- .button()- .removeClass( "ui-corner-all" );-- // IE 6 doesn't understand height: 50% for the buttons- // unless the wrapper has an explicit height- if ( this.buttons.height() > Math.ceil( uiSpinner.height() * 0.5 ) &&- uiSpinner.height() > 0 ) {- uiSpinner.height( uiSpinner.height() );- }-- // disable spinner if element was already disabled- if ( this.options.disabled ) {- this.disable();- }- },-- _keydown: function( event ) {- var options = this.options,- keyCode = $.ui.keyCode;-- switch ( event.keyCode ) {- case keyCode.UP:- this._repeat( null, 1, event );- return true;- case keyCode.DOWN:- this._repeat( null, -1, event );- return true;- case keyCode.PAGE_UP:- this._repeat( null, options.page, event );- return true;- case keyCode.PAGE_DOWN:- this._repeat( null, -options.page, event );- return true;- }-- return false;- },-- _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 + "'>▲</span>" +- "</a>" +- "<a class='ui-spinner-button ui-spinner-down ui-corner-br'>" +- "<span class='ui-icon " + this.options.icons.down + "'>▼</span>" +- "</a>";- },-- _start: function( event ) {- if ( !this.spinning && this._trigger( "start", event ) === false ) {- return false;- }-- if ( !this.counter ) {- this.counter = 1;- }- this.spinning = true;- return true;- },-- _repeat: function( i, steps, event ) {- i = i || 500;-- clearTimeout( this.timer );- this.timer = this._delay(function() {- this._repeat( 40, steps, event );- }, i );-- this._spin( steps * this.options.step, event );- },-- _spin: function( step, event ) {- var value = this.value() || 0;-- if ( !this.counter ) {- this.counter = 1;- }-- value = this._adjustValue( value + step * this._increment( this.counter ) );-- if ( !this.spinning || this._trigger( "spin", event, { value: value } ) !== false) {- this._value( value );- this.counter++;- }- },-- _increment: function( i ) {- var incremental = this.options.incremental;-- if ( incremental ) {- return $.isFunction( incremental ) ?- incremental( i ) :- Math.floor( i*i*i/50000 - i*i/500 + 17*i/200 + 1 );- }-- return 1;- },-- _precision: function() {- var precision = this._precisionOf( this.options.step );- if ( this.options.min !== null ) {- precision = Math.max( precision, this._precisionOf( this.options.min ) );- }- return precision;- },-- _precisionOf: function( num ) {- var str = num.toString(),- decimal = str.indexOf( "." );- return decimal === -1 ? 0 : str.length - decimal - 1;- },-- _adjustValue: function( value ) {- var base, aboveMin,- options = this.options;-- // make sure we're at a valid step- // - find out where we are relative to the base (min or 0)- base = options.min !== null ? options.min : 0;- aboveMin = value - base;- // - round to the nearest step- aboveMin = Math.round(aboveMin / options.step) * options.step;- // - rounding is based on 0, so adjust back to our base- value = base + aboveMin;-- // fix precision from bad JS floating point math- value = parseFloat( value.toFixed( this._precision() ) );-- // clamp the value- if ( options.max !== null && value > options.max) {- return options.max;- }- if ( options.min !== null && value < options.min ) {- return options.min;- }-- return value;- },-- _stop: function( event ) {- if ( !this.spinning ) {- return;- }-- clearTimeout( this.timer );- clearTimeout( this.mousewheelTimer );- this.counter = 0;- this.spinning = false;- this._trigger( "stop", event );- },-- _setOption: function( key, value ) {- if ( key === "culture" || key === "numberFormat" ) {- var prevValue = this._parse( this.element.val() );- this.options[ key ] = value;- this.element.val( this._format( prevValue ) );- return;- }-- if ( key === "max" || key === "min" || key === "step" ) {- if ( typeof value === "string" ) {- value = this._parse( value );- }- }-- this._super( key, value );-- if ( key === "disabled" ) {- if ( value ) {- this.element.prop( "disabled", true );- this.buttons.button( "disable" );- } else {- this.element.prop( "disabled", false );- this.buttons.button( "enable" );- }- }- },-- _setOptions: modifier(function( options ) {- this._super( options );- this._value( this.element.val() );- }),-- _parse: function( val ) {- if ( typeof val === "string" && val !== "" ) {- val = window.Globalize && this.options.numberFormat ?- Globalize.parseFloat( val, 10, this.options.culture ) : +val;- }- return val === "" || isNaN( val ) ? null : val;- },-- _format: function( value ) {- if ( value === "" ) {- return "";- }- return window.Globalize && this.options.numberFormat ?- Globalize.format( value, this.options.numberFormat, this.options.culture ) :- value;- },-- _refresh: function() {- this.element.attr({- "aria-valuemin": this.options.min,- "aria-valuemax": this.options.max,- // TODO: what should we do with values that can't be parsed?- "aria-valuenow": this._parse( this.element.val() )- });- },-- // update the value without triggering change- _value: function( value, allowAny ) {- var parsed;- if ( value !== "" ) {- parsed = this._parse( value );- if ( parsed !== null ) {- if ( !allowAny ) {- parsed = this._adjustValue( parsed );- }- value = this._format( parsed );- }- }- this.element.val( value );- this._refresh();- },-- _destroy: function() {- this.element- .removeClass( "ui-spinner-input" )- .prop( "disabled", false )- .removeAttr( "autocomplete" )- .removeAttr( "role" )- .removeAttr( "aria-valuemin" )- .removeAttr( "aria-valuemax" )- .removeAttr( "aria-valuenow" );- this.uiSpinner.replaceWith( this.element );- },-- stepUp: modifier(function( steps ) {- this._stepUp( steps );- }),- _stepUp: function( steps ) {- this._spin( (steps || 1) * this.options.step );- },-- stepDown: modifier(function( steps ) {- this._stepDown( steps );- }),- _stepDown: function( steps ) {- this._spin( (steps || 1) * -this.options.step );- },-- pageUp: modifier(function( pages ) {- this._stepUp( (pages || 1) * this.options.page );- }),-- pageDown: modifier(function( pages ) {- this._stepDown( (pages || 1) * this.options.page );- }),-- value: function( newVal ) {- if ( !arguments.length ) {- return this._parse( this.element.val() );- }- modifier( this._value ).call( this, newVal );- },-- widget: function() {- return this.uiSpinner;- }-});--}( jQuery ) );-(function( $, undefined ) {--var tabId = 0,- rhash = /#.*$/;--function getNextTabId() {- return ++tabId;-}--function isLocal( anchor ) {- return anchor.hash.length > 1 &&- anchor.href.replace( rhash, "" ) === location.href.replace( rhash, "" );-}--$.widget( "ui.tabs", {- version: "1.9.1",- delay: 300,- options: {- active: null,- collapsible: false,- event: "click",- heightStyle: "content",- hide: null,- show: null,-- // callbacks- activate: null,- beforeActivate: null,- beforeLoad: null,- load: null- },-- _create: function() {- var that = this,- options = this.options,- active = options.active,- locationHash = location.hash.substring( 1 );-- this.running = false;-- this.element- .addClass( "ui-tabs ui-widget ui-widget-content ui-corner-all" )- .toggleClass( "ui-tabs-collapsible", options.collapsible )- // Prevent users from focusing disabled tabs via click- .delegate( ".ui-tabs-nav > li", "mousedown" + this.eventNamespace, function( event ) {- if ( $( this ).is( ".ui-state-disabled" ) ) {- event.preventDefault();- }- })- // support: IE <9- // Preventing the default action in mousedown doesn't prevent IE- // from focusing the element, so if the anchor gets focused, blur.- // We don't have to worry about focusing the previously focused- // element since clicking on a non-focusable element should focus- // the body anyway.- .delegate( ".ui-tabs-anchor", "focus" + this.eventNamespace, function() {- if ( $( this ).closest( "li" ).is( ".ui-state-disabled" ) ) {- this.blur();- }- });-- this._processTabs();-- if ( active === null ) {- // check the fragment identifier in the URL- if ( locationHash ) {- this.tabs.each(function( i, tab ) {- if ( $( tab ).attr( "aria-controls" ) === locationHash ) {- active = i;- return false;- }- });- }-- // check for a tab marked active via a class- if ( active === null ) {- active = this.tabs.index( this.tabs.filter( ".ui-tabs-active" ) );- }-- // no active tab, set to false- if ( active === null || active === -1 ) {- active = this.tabs.length ? 0 : false;- }- }-- // handle numbers: negative, out of range- if ( active !== false ) {- active = this.tabs.index( this.tabs.eq( active ) );- if ( active === -1 ) {- active = options.collapsible ? false : 0;- }- }- options.active = active;-- // don't allow collapsible: false and active: false- if ( !options.collapsible && options.active === false && this.anchors.length ) {- options.active = 0;- }-- // Take disabling tabs via class attribute from HTML- // into account and update option properly.- if ( $.isArray( options.disabled ) ) {- options.disabled = $.unique( options.disabled.concat(- $.map( this.tabs.filter( ".ui-state-disabled" ), function( li ) {- return that.tabs.index( li );- })- ) ).sort();- }-- // check for length avoids error when initializing empty list- if ( this.options.active !== false && this.anchors.length ) {- this.active = this._findActive( this.options.active );- } else {- this.active = $();- }-- this._refresh();-- if ( this.active.length ) {- this.load( options.active );- }- },-- _getCreateEventData: function() {- return {- tab: this.active,- panel: !this.active.length ? $() : this._getPanelForTab( this.active )- };- },-- _tabKeydown: function( event ) {- var focusedTab = $( this.document[0].activeElement ).closest( "li" ),- selectedIndex = this.tabs.index( focusedTab ),- goingForward = true;-- if ( this._handlePageNav( event ) ) {- return;- }-- switch ( event.keyCode ) {- case $.ui.keyCode.RIGHT:- case $.ui.keyCode.DOWN:- selectedIndex++;- break;- case $.ui.keyCode.UP:- case $.ui.keyCode.LEFT:- goingForward = false;- selectedIndex--;- break;- case $.ui.keyCode.END:- selectedIndex = this.anchors.length - 1;- break;- case $.ui.keyCode.HOME:- selectedIndex = 0;- break;- case $.ui.keyCode.SPACE:- // Activate only, no collapsing- event.preventDefault();- clearTimeout( this.activating );- this._activate( selectedIndex );- return;- case $.ui.keyCode.ENTER:- // Toggle (cancel delayed activation, allow collapsing)- event.preventDefault();- clearTimeout( this.activating );- // Determine if we should collapse or activate- this._activate( selectedIndex === this.options.active ? false : selectedIndex );- return;- default:- return;- }-- // Focus the appropriate tab, based on which key was pressed- event.preventDefault();- clearTimeout( this.activating );- selectedIndex = this._focusNextTab( selectedIndex, goingForward );-- // Navigating with control key will prevent automatic activation- if ( !event.ctrlKey ) {- // Update aria-selected immediately so that AT think the tab is already selected.- // Otherwise AT may confuse the user by stating that they need to activate the tab,- // but the tab will already be activated by the time the announcement finishes.- focusedTab.attr( "aria-selected", "false" );- this.tabs.eq( selectedIndex ).attr( "aria-selected", "true" );-- this.activating = this._delay(function() {- this.option( "active", selectedIndex );- }, this.delay );- }- },-- _panelKeydown: function( event ) {- if ( this._handlePageNav( event ) ) {- return;- }-- // Ctrl+up moves focus to the current tab- if ( event.ctrlKey && event.keyCode === $.ui.keyCode.UP ) {- event.preventDefault();- this.active.focus();- }- },-- // Alt+page up/down moves focus to the previous/next tab (and activates)- _handlePageNav: function( event ) {- if ( event.altKey && event.keyCode === $.ui.keyCode.PAGE_UP ) {- this._activate( this._focusNextTab( this.options.active - 1, false ) );- return true;- }- if ( event.altKey && event.keyCode === $.ui.keyCode.PAGE_DOWN ) {- this._activate( this._focusNextTab( this.options.active + 1, true ) );- return true;- }- },-- _findNextTab: function( index, goingForward ) {- var lastTabIndex = this.tabs.length - 1;-- function constrain() {- if ( index > lastTabIndex ) {- index = 0;- }- if ( index < 0 ) {- index = lastTabIndex;- }- return index;- }-- while ( $.inArray( constrain(), this.options.disabled ) !== -1 ) {- index = goingForward ? index + 1 : index - 1;- }-- return index;- },-- _focusNextTab: function( index, goingForward ) {- index = this._findNextTab( index, goingForward );- this.tabs.eq( index ).focus();- return index;- },-- _setOption: function( key, value ) {- if ( key === "active" ) {- // _activate() will handle invalid values and update this.options- this._activate( value );- return;- }-- if ( key === "disabled" ) {- // don't use the widget factory's disabled handling- this._setupDisabled( value );- return;- }-- this._super( key, value);-- if ( key === "collapsible" ) {- this.element.toggleClass( "ui-tabs-collapsible", value );- // Setting collapsible: false while collapsed; open first panel- if ( !value && this.options.active === false ) {- this._activate( 0 );- }- }-- if ( key === "event" ) {- this._setupEvents( value );- }-- if ( key === "heightStyle" ) {- this._setupHeightStyle( value );- }- },-- _tabId: function( tab ) {- return tab.attr( "aria-controls" ) || "ui-tabs-" + getNextTabId();- },-- _sanitizeSelector: function( hash ) {- return hash ? hash.replace( /[!"$%&'()*+,.\/:;<=>?@\[\]\^`{|}~]/g, "\\$&" ) : "";- },-- refresh: function() {- var options = this.options,- lis = this.tablist.children( ":has(a[href])" );-- // get disabled tabs from class attribute from HTML- // this will get converted to a boolean if needed in _refresh()- options.disabled = $.map( lis.filter( ".ui-state-disabled" ), function( tab ) {- return lis.index( tab );- });-- this._processTabs();-- // was collapsed or no tabs- if ( options.active === false || !this.anchors.length ) {- options.active = false;- this.active = $();- // was active, but active tab is gone- } else if ( this.active.length && !$.contains( this.tablist[ 0 ], this.active[ 0 ] ) ) {- // all remaining tabs are disabled- if ( this.tabs.length === options.disabled.length ) {- options.active = false;- this.active = $();- // activate previous tab- } else {- this._activate( this._findNextTab( Math.max( 0, options.active - 1 ), false ) );- }- // was active, active tab still exists- } else {- // make sure active index is correct- options.active = this.tabs.index( this.active );- }-- 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"- });-- // Make sure one tab is in the tab order- if ( !this.active.length ) {- this.tabs.eq( 0 ).attr( "tabIndex", 0 );- } else {- 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"- });- }- },-- _processTabs: function() {- var that = 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 $( "a", this )[ 0 ];- })- .addClass( "ui-tabs-anchor" )- .attr({- role: "presentation",- tabIndex: -1- });-- this.panels = $();-- this.anchors.each(function( i, anchor ) {- var selector, panel, panelId,- anchorId = $( anchor ).uniqueId().attr( "id" ),- tab = $( anchor ).closest( "li" ),- originalAriaControls = tab.attr( "aria-controls" );-- // inline tab- if ( isLocal( anchor ) ) {- selector = anchor.hash;- panel = that.element.find( that._sanitizeSelector( selector ) );- // remote tab- } else {- panelId = that._tabId( tab );- selector = "#" + panelId;- panel = that.element.find( selector );- if ( !panel.length ) {- panel = that._createPanel( panelId );- panel.insertAfter( that.panels[ i - 1 ] || that.tablist );- }- panel.attr( "aria-live", "polite" );- }-- if ( panel.length) {- that.panels = that.panels.add( panel );- }- if ( originalAriaControls ) {- tab.data( "ui-tabs-aria-controls", originalAriaControls );- }- tab.attr({- "aria-controls": selector.substring( 1 ),- "aria-labelledby": anchorId- });- panel.attr( "aria-labelledby", anchorId );- });-- this.panels- .addClass( "ui-tabs-panel ui-widget-content ui-corner-bottom" )- .attr( "role", "tabpanel" );- },-- // allow overriding how to find the list for rare usage scenarios (#7715)- _getList: function() {- return this.element.find( "ol,ul" ).eq( 0 );- },-- _createPanel: function( id ) {- return $( "<div>" )- .attr( "id", id )- .addClass( "ui-tabs-panel ui-widget-content ui-corner-bottom" )- .data( "ui-tabs-destroy", true );- },-- _setupDisabled: function( disabled ) {- if ( $.isArray( disabled ) ) {- if ( !disabled.length ) {- disabled = false;- } else if ( disabled.length === this.anchors.length ) {- disabled = true;- }- }-- // disable tabs- for ( var i = 0, li; ( li = this.tabs[ i ] ); i++ ) {- if ( disabled === true || $.inArray( i, disabled ) !== -1 ) {- $( li )- .addClass( "ui-state-disabled" )- .attr( "aria-disabled", "true" );- } else {- $( li )- .removeClass( "ui-state-disabled" )- .removeAttr( "aria-disabled" );- }- }-- this.options.disabled = disabled;- },-- _setupEvents: function( event ) {- var events = {- click: function( event ) {- event.preventDefault();- }- };- if ( event ) {- $.each( event.split(" "), function( index, eventName ) {- events[ eventName ] = "_eventHandler";- });- }-- this._off( this.anchors.add( this.tabs ).add( this.panels ) );- this._on( this.anchors, events );- this._on( this.tabs, { keydown: "_tabKeydown" } );- this._on( this.panels, { keydown: "_panelKeydown" } );-- this._focusable( this.tabs );- this._hoverable( this.tabs );- },-- _setupHeightStyle: function( heightStyle ) {- var maxHeight, overflow,- parent = this.element.parent();-- if ( heightStyle === "fill" ) {- // IE 6 treats height like minHeight, so we need to turn off overflow- // in order to get a reliable height- // we use the minHeight support test because we assume that only- // browsers that don't support minHeight will treat height as minHeight- if ( !$.support.minHeight ) {- overflow = parent.css( "overflow" );- parent.css( "overflow", "hidden");- }- maxHeight = parent.height();- this.element.siblings( ":visible" ).each(function() {- var elem = $( this ),- position = elem.css( "position" );-- if ( position === "absolute" || position === "fixed" ) {- return;- }- maxHeight -= elem.outerHeight( true );- });- if ( overflow ) {- parent.css( "overflow", overflow );- }-- this.element.children().not( this.panels ).each(function() {- maxHeight -= $( this ).outerHeight( true );- });-- this.panels.each(function() {- $( this ).height( Math.max( 0, maxHeight -- $( this ).innerHeight() + $( this ).height() ) );- })- .css( "overflow", "auto" );- } else if ( heightStyle === "auto" ) {- maxHeight = 0;- this.panels.each(function() {- maxHeight = Math.max( maxHeight, $( this ).height( "" ).height() );- }).height( maxHeight );- }- },-- _eventHandler: function( event ) {- var options = this.options,- active = this.active,- anchor = $( event.currentTarget ),- tab = anchor.closest( "li" ),- clickedIsActive = tab[ 0 ] === active[ 0 ],- collapsing = clickedIsActive && options.collapsible,- toShow = collapsing ? $() : this._getPanelForTab( tab ),- toHide = !active.length ? $() : this._getPanelForTab( active ),- eventData = {- oldTab: active,- oldPanel: toHide,- newTab: collapsing ? $() : tab,- newPanel: toShow- };-- event.preventDefault();-- if ( tab.hasClass( "ui-state-disabled" ) ||- // tab is already loading- tab.hasClass( "ui-tabs-loading" ) ||- // can't switch durning an animation- this.running ||- // click on active header, but not collapsible- ( clickedIsActive && !options.collapsible ) ||- // allow canceling activation- ( this._trigger( "beforeActivate", event, eventData ) === false ) ) {- return;- }-- options.active = collapsing ? false : this.tabs.index( tab );-- this.active = clickedIsActive ? $() : tab;- if ( this.xhr ) {- this.xhr.abort();- }-- if ( !toHide.length && !toShow.length ) {- $.error( "jQuery UI Tabs: Mismatching fragment identifier." );- }-- if ( toShow.length ) {- this.load( this.tabs.index( tab ), event );- }- this._toggle( event, eventData );- },-- // handles show/hide for selecting tabs- _toggle: function( event, eventData ) {- var that = this,- toShow = eventData.newPanel,- toHide = eventData.oldPanel;-- this.running = true;-- function complete() {- that.running = false;- that._trigger( "activate", event, eventData );- }-- function show() {- eventData.newTab.closest( "li" ).addClass( "ui-tabs-active ui-state-active" );-- if ( toShow.length && that.options.show ) {- that._show( toShow, that.options.show, complete );- } else {- toShow.show();- complete();- }- }-- // start out by hiding, then showing, then completing- if ( toHide.length && this.options.hide ) {- this._hide( toHide, this.options.hide, function() {- eventData.oldTab.closest( "li" ).removeClass( "ui-tabs-active ui-state-active" );- show();- });- } else {- eventData.oldTab.closest( "li" ).removeClass( "ui-tabs-active ui-state-active" );- toHide.hide();- show();- }-- toHide.attr({- "aria-expanded": "false",- "aria-hidden": "true"- });- eventData.oldTab.attr( "aria-selected", "false" );- // If we're switching tabs, remove the old tab from the tab order.- // If we're opening from collapsed state, remove the previous tab from the tab order.- // If we're collapsing, then keep the collapsing tab in the tab order.- if ( toShow.length && toHide.length ) {- eventData.oldTab.attr( "tabIndex", -1 );- } else if ( toShow.length ) {- this.tabs.filter(function() {- return $( this ).attr( "tabIndex" ) === 0;- })- .attr( "tabIndex", -1 );- }-- toShow.attr({- "aria-expanded": "true",- "aria-hidden": "false"- });- eventData.newTab.attr({- "aria-selected": "true",- tabIndex: 0- });- },-- _activate: function( index ) {- var anchor,- active = this._findActive( index );-- // trying to activate the already active panel- if ( active[ 0 ] === this.active[ 0 ] ) {- return;- }-- // trying to collapse, simulate a click on the current active header- if ( !active.length ) {- active = this.active;- }-- anchor = active.find( ".ui-tabs-anchor" )[ 0 ];- this._eventHandler({- target: anchor,- currentTarget: anchor,- preventDefault: $.noop- });- },-- _findActive: function( index ) {- return index === false ? $() : this.tabs.eq( index );- },-- _getIndex: function( index ) {- // meta-function to give users option to provide a href string instead of a numerical index.- if ( typeof index === "string" ) {- index = this.anchors.index( this.anchors.filter( "[href$='" + index + "']" ) );- }-- return index;- },-- _destroy: function() {- if ( 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" )- .removeData( "href.tabs" )- .removeData( "load.tabs" )- .removeUniqueId();-- this.tabs.add( this.panels ).each(function() {- if ( $.data( this, "ui-tabs-destroy" ) ) {- $( this ).remove();- } else {- $( 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 li = $( this ),- prev = li.data( "ui-tabs-aria-controls" );- if ( prev ) {- li.attr( "aria-controls", prev );- } else {- li.removeAttr( "aria-controls" );- }- });-- if ( this.options.heightStyle !== "content" ) {- this.panels.css( "height", "" );- }- },-- enable: function( index ) {- var disabled = this.options.disabled;- if ( disabled === false ) {- return;- }-- if ( index === undefined ) {- disabled = false;- } else {- index = this._getIndex( index );- if ( $.isArray( disabled ) ) {- disabled = $.map( disabled, function( num ) {- return num !== index ? num : null;- });- } else {- disabled = $.map( this.tabs, function( li, num ) {- return num !== index ? num : null;- });- }- }- this._setupDisabled( disabled );- },-- disable: function( index ) {- var disabled = this.options.disabled;- if ( disabled === true ) {- return;- }-- if ( index === undefined ) {- disabled = true;- } else {- index = this._getIndex( index );- if ( $.inArray( index, disabled ) !== -1 ) {- return;- }- if ( $.isArray( disabled ) ) {- disabled = $.merge( [ index ], disabled ).sort();- } else {- disabled = [ index ];- }- }- this._setupDisabled( disabled );- },-- load: function( index, event ) {- index = this._getIndex( index );- var that = this,- tab = this.tabs.eq( index ),- anchor = tab.find( ".ui-tabs-anchor" ),- panel = this._getPanelForTab( tab ),- eventData = {- tab: tab,- panel: panel- };-- // not remote- if ( isLocal( anchor[ 0 ] ) ) {- return;- }-- this.xhr = $.ajax( this._ajaxSettings( anchor, event, eventData ) );-- // support: jQuery <1.8- // jQuery <1.8 returns false if the request is canceled in beforeSend,- // but as of 1.8, $.ajax() always returns a jqXHR object.- if ( this.xhr && this.xhr.statusText !== "canceled" ) {- tab.addClass( "ui-tabs-loading" );- panel.attr( "aria-busy", "true" );-- this.xhr- .success(function( response ) {- // support: jQuery <1.8- // http://bugs.jquery.com/ticket/11778- setTimeout(function() {- panel.html( response );- that._trigger( "load", event, eventData );- }, 1 );- })- .complete(function( jqXHR, status ) {- // support: jQuery <1.8- // http://bugs.jquery.com/ticket/11778- setTimeout(function() {- if ( status === "abort" ) {- that.panels.stop( false, true );- }-- tab.removeClass( "ui-tabs-loading" );- panel.removeAttr( "aria-busy" );-- if ( jqXHR === that.xhr ) {- delete that.xhr;- }- }, 1 );- });- }- },-- // TODO: Remove this function in 1.10 when ajaxOptions is removed- _ajaxSettings: function( anchor, event, eventData ) {- var that = this;- return {- url: anchor.attr( "href" ),- beforeSend: function( jqXHR, settings ) {- return that._trigger( "beforeLoad", event,- $.extend( { jqXHR : jqXHR, ajaxSettings: settings }, eventData ) );- }- };- },-- _getPanelForTab: function( tab ) {- var id = $( tab ).attr( "aria-controls" );- return this.element.find( this._sanitizeSelector( "#" + id ) );- }-});--// DEPRECATED-if ( $.uiBackCompat !== false ) {-- // helper method for a lot of the back compat extensions- $.ui.tabs.prototype._ui = function( tab, panel ) {- return {- tab: tab,- panel: panel,- index: this.anchors.index( tab )- };- };-- // url method- $.widget( "ui.tabs", $.ui.tabs, {- url: function( index, url ) {- this.anchors.eq( index ).attr( "href", url );- }- });-- // TODO: Remove _ajaxSettings() method when removing this extension- // ajaxOptions and cache options- $.widget( "ui.tabs", $.ui.tabs, {- options: {- ajaxOptions: null,- cache: false- },-- _create: function() {- this._super();-- var that = this;-- this._on({ tabsbeforeload: function( event, ui ) {- // tab is already cached- if ( $.data( ui.tab[ 0 ], "cache.tabs" ) ) {- event.preventDefault();- return;- }-- ui.jqXHR.success(function() {- if ( that.options.cache ) {- $.data( ui.tab[ 0 ], "cache.tabs", true );- }- });- }});- },-- _ajaxSettings: function( anchor, event, ui ) {- var ajaxOptions = this.options.ajaxOptions;- return $.extend( {}, ajaxOptions, {- error: function( xhr, status ) {- try {- // Passing index avoid a race condition when this method is- // called after the user has selected another tab.- // Pass the anchor that initiated this request allows- // loadError to manipulate the tab content panel via $(a.hash)- ajaxOptions.error(- xhr, status, ui.tab.closest( "li" ).index(), ui.tab[ 0 ] );- }- catch ( error ) {}- }- }, this._superApply( arguments ) );- },-- _setOption: function( key, value ) {- // reset cache if switching from cached to not cached- if ( key === "cache" && value === false ) {- this.anchors.removeData( "cache.tabs" );- }- this._super( key, value );- },-- _destroy: function() {- this.anchors.removeData( "cache.tabs" );- this._super();- },-- url: function( index ){- this.anchors.eq( index ).removeData( "cache.tabs" );- this._superApply( arguments );- }- });-- // abort method- $.widget( "ui.tabs", $.ui.tabs, {- abort: function() {- if ( this.xhr ) {- this.xhr.abort();- }- }- });-- // spinner- $.widget( "ui.tabs", $.ui.tabs, {- options: {- spinner: "<em>Loading…</em>"- },- _create: function() {- this._super();- this._on({- tabsbeforeload: function( event, ui ) {- // Don't react to nested tabs or tabs that don't use a spinner- if ( event.target !== this.element[ 0 ] ||- !this.options.spinner ) {- return;- }-- var span = ui.tab.find( "span" ),- html = span.html();- span.html( this.options.spinner );- ui.jqXHR.complete(function() {- span.html( html );- });- }- });- }- });-- // enable/disable events- $.widget( "ui.tabs", $.ui.tabs, {- options: {- enable: null,- disable: null- },-- enable: function( index ) {- var options = this.options,- trigger;-- if ( index && options.disabled === true ||- ( $.isArray( options.disabled ) && $.inArray( index, options.disabled ) !== -1 ) ) {- trigger = true;- }-- this._superApply( arguments );-- if ( trigger ) {- this._trigger( "enable", null, this._ui( this.anchors[ index ], this.panels[ index ] ) );- }- },-- disable: function( index ) {- var options = this.options,- trigger;-- if ( index && options.disabled === false ||- ( $.isArray( options.disabled ) && $.inArray( index, options.disabled ) === -1 ) ) {- trigger = true;- }-- this._superApply( arguments );-- if ( trigger ) {- this._trigger( "disable", null, this._ui( this.anchors[ index ], this.panels[ index ] ) );- }- }- });-- // add/remove methods and events- $.widget( "ui.tabs", $.ui.tabs, {- options: {- add: null,- remove: null,- tabTemplate: "<li><a href='#{href}'><span>#{label}</span></a></li>"- },-- add: function( url, label, index ) {- if ( index === undefined ) {- index = this.anchors.length;- }-- var doInsertAfter, panel,- options = this.options,- li = $( options.tabTemplate- .replace( /#\{href\}/g, url )- .replace( /#\{label\}/g, label ) ),- id = !url.indexOf( "#" ) ?- url.replace( "#", "" ) :- this._tabId( li );-- li.addClass( "ui-state-default ui-corner-top" ).data( "ui-tabs-destroy", true );- li.attr( "aria-controls", id );-- doInsertAfter = index >= this.tabs.length;-- // try to find an existing element before creating a new one- panel = this.element.find( "#" + id );- if ( !panel.length ) {- panel = this._createPanel( id );- if ( doInsertAfter ) {- if ( index > 0 ) {- panel.insertAfter( this.panels.eq( -1 ) );- } else {- panel.appendTo( this.element );- }- } else {- panel.insertBefore( this.panels[ index ] );- }- }- panel.addClass( "ui-tabs-panel ui-widget-content ui-corner-bottom" ).hide();-- if ( doInsertAfter ) {- li.appendTo( this.tablist );- } else {- li.insertBefore( this.tabs[ index ] );- }-- options.disabled = $.map( options.disabled, function( n ) {- return n >= index ? ++n : n;- });-- this.refresh();- if ( this.tabs.length === 1 && options.active === false ) {- this.option( "active", 0 );- }-- this._trigger( "add", null, this._ui( this.anchors[ index ], this.panels[ index ] ) );- return this;- },-- remove: function( index ) {- index = this._getIndex( index );- var options = this.options,- tab = this.tabs.eq( index ).remove(),- panel = this._getPanelForTab( tab ).remove();-- // If selected tab was removed focus tab to the right or- // in case the last tab was removed the tab to the left.- // We check for more than 2 tabs, because if there are only 2,- // then when we remove this tab, there will only be one tab left- // so we don't need to detect which tab to activate.- if ( tab.hasClass( "ui-tabs-active" ) && this.anchors.length > 2 ) {- this._activate( index + ( index + 1 < this.anchors.length ? 1 : -1 ) );- }-- options.disabled = $.map(- $.grep( options.disabled, function( n ) {- return n !== index;- }),- function( n ) {- return n >= index ? --n : n;- });-- this.refresh();-- this._trigger( "remove", null, this._ui( tab.find( "a" )[ 0 ], panel[ 0 ] ) );- return this;- }- });-- // length method- $.widget( "ui.tabs", $.ui.tabs, {- length: function() {- return this.anchors.length;- }- });-- // panel ids (idPrefix option + title attribute)- $.widget( "ui.tabs", $.ui.tabs, {- options: {- idPrefix: "ui-tabs-"- },-- _tabId: function( tab ) {- var a = tab.is( "li" ) ? tab.find( "a[href]" ) : tab;- a = a[0];- return $( a ).closest( "li" ).attr( "aria-controls" ) ||- a.title && a.title.replace( /\s/g, "_" ).replace( /[^\w\u00c0-\uFFFF\-]/g, "" ) ||- this.options.idPrefix + getNextTabId();- }- });-- // _createPanel method- $.widget( "ui.tabs", $.ui.tabs, {- options: {- panelTemplate: "<div></div>"- },-- _createPanel: function( id ) {- return $( this.options.panelTemplate )- .attr( "id", id )- .addClass( "ui-tabs-panel ui-widget-content ui-corner-bottom" )- .data( "ui-tabs-destroy", true );- }- });-- // selected option- $.widget( "ui.tabs", $.ui.tabs, {- _create: function() {- var options = this.options;- if ( options.active === null && options.selected !== undefined ) {- options.active = options.selected === -1 ? false : options.selected;- }- this._super();- options.selected = options.active;- if ( options.selected === false ) {- options.selected = -1;- }- },-- _setOption: function( key, value ) {- if ( key !== "selected" ) {- return this._super( key, value );- }-- var options = this.options;- this._super( "active", value === -1 ? false : value );- options.selected = options.active;- if ( options.selected === false ) {- options.selected = -1;- }- },-- _eventHandler: function() {- this._superApply( arguments );- this.options.selected = this.options.active;- if ( this.options.selected === false ) {- this.options.selected = -1;- }- }- });-- // show and select event- $.widget( "ui.tabs", $.ui.tabs, {- options: {- show: null,- select: null- },- _create: function() {- this._super();- if ( this.options.active !== false ) {- this._trigger( "show", null, this._ui(- this.active.find( ".ui-tabs-anchor" )[ 0 ],- this._getPanelForTab( this.active )[ 0 ] ) );- }- },- _trigger: function( type, event, data ) {- var ret = this._superApply( arguments );- if ( !ret ) {- return false;- }- if ( type === "beforeActivate" && data.newTab.length ) {- ret = this._super( "select", event, {- tab: data.newTab.find( ".ui-tabs-anchor" )[ 0],- panel: data.newPanel[ 0 ],- index: data.newTab.closest( "li" ).index()- });- } else if ( type === "activate" && data.newTab.length ) {- ret = this._super( "show", event, {- tab: data.newTab.find( ".ui-tabs-anchor" )[ 0 ],- panel: data.newPanel[ 0 ],- index: data.newTab.closest( "li" ).index()- });- }- return ret;- }- });-- // select method- $.widget( "ui.tabs", $.ui.tabs, {- select: function( index ) {- index = this._getIndex( index );- if ( index === -1 ) {- if ( this.options.collapsible && this.options.selected !== -1 ) {- index = this.options.selected;- } else {- return;- }- }- this.anchors.eq( index ).trigger( this.options.event + this.eventNamespace );- }- });-- // cookie option- (function() {-- var listId = 0;-- $.widget( "ui.tabs", $.ui.tabs, {- options: {- cookie: null // e.g. { expires: 7, path: '/', domain: 'jquery.com', secure: true }- },- _create: function() {- var options = this.options,- active;- if ( options.active == null && options.cookie ) {- active = parseInt( this._cookie(), 10 );- if ( active === -1 ) {- active = false;- }- options.active = active;- }- this._super();- },- _cookie: function( active ) {- var cookie = [ this.cookie ||- ( this.cookie = this.options.cookie.name || "ui-tabs-" + (++listId) ) ];- if ( arguments.length ) {- cookie.push( active === false ? -1 : active );- cookie.push( this.options.cookie );- }- return $.cookie.apply( null, cookie );- },- _refresh: function() {- this._super();- if ( this.options.cookie ) {- this._cookie( this.options.active, this.options.cookie );- }- },- _eventHandler: function() {- this._superApply( arguments );- if ( this.options.cookie ) {- this._cookie( this.options.active, this.options.cookie );- }- },- _destroy: function() {- this._super();- if ( this.options.cookie ) {- this._cookie( null, this.options.cookie );- }- }- });-- })();-- // load event- $.widget( "ui.tabs", $.ui.tabs, {- _trigger: function( type, event, data ) {- var _data = $.extend( {}, data );- if ( type === "load" ) {- _data.panel = _data.panel[ 0 ];- _data.tab = _data.tab.find( ".ui-tabs-anchor" )[ 0 ];- }- return this._super( type, event, _data );- }- });-- // fx option- // The new animation options (show, hide) conflict with the old show callback.- // The old fx option wins over show/hide anyway (always favor back-compat).- // If a user wants to use the new animation API, they must give up the old API.- $.widget( "ui.tabs", $.ui.tabs, {- options: {- fx: null // e.g. { height: "toggle", opacity: "toggle", duration: 200 }- },-- _getFx: function() {- var hide, show,- fx = this.options.fx;-- if ( fx ) {- if ( $.isArray( fx ) ) {- hide = fx[ 0 ];- show = fx[ 1 ];- } else {- hide = show = fx;- }- }-- return fx ? { show: show, hide: hide } : null;- },-- _toggle: function( event, eventData ) {- var that = this,- toShow = eventData.newPanel,- toHide = eventData.oldPanel,- fx = this._getFx();-- if ( !fx ) {- return this._super( event, eventData );- }-- that.running = true;-- function complete() {- that.running = false;- that._trigger( "activate", event, eventData );- }-- function show() {- eventData.newTab.closest( "li" ).addClass( "ui-tabs-active ui-state-active" );-- if ( toShow.length && fx.show ) {- toShow- .animate( fx.show, fx.show.duration, function() {- complete();- });- } else {- toShow.show();- complete();- }- }-- // start out by hiding, then showing, then completing- if ( toHide.length && fx.hide ) {- toHide.animate( fx.hide, fx.hide.duration, function() {- eventData.oldTab.closest( "li" ).removeClass( "ui-tabs-active ui-state-active" );- show();- });- } else {- eventData.oldTab.closest( "li" ).removeClass( "ui-tabs-active ui-state-active" );- toHide.hide();- show();- }- }- });-}--})( jQuery );-(function( $ ) {--var increments = 0;--function addDescribedBy( elem, id ) {- var describedby = (elem.attr( "aria-describedby" ) || "").split( /\s+/ );- describedby.push( id );- elem- .data( "ui-tooltip-id", id )- .attr( "aria-describedby", $.trim( describedby.join( " " ) ) );-}--function removeDescribedBy( elem ) {- var id = elem.data( "ui-tooltip-id" ),- describedby = (elem.attr( "aria-describedby" ) || "").split( /\s+/ ),- index = $.inArray( id, describedby );- if ( index !== -1 ) {- describedby.splice( index, 1 );- }-- elem.removeData( "ui-tooltip-id" );- describedby = $.trim( describedby.join( " " ) );- if ( describedby ) {- elem.attr( "aria-describedby", describedby );- } else {- elem.removeAttr( "aria-describedby" );- }-}--$.widget( "ui.tooltip", {- version: "1.9.1",- options: {- content: function() {- return $( this ).attr( "title" );- },- hide: true,- // Disabled elements have inconsistent behavior across browsers (#8661)- items: "[title]:not([disabled])",- position: {- my: "left top+15",- at: "left bottom",- collision: "flipfit flipfit"- },- show: true,- tooltipClass: null,- track: false,-- // callbacks- close: null,- open: null- },-- _create: function() {- this._on({- mouseover: "open",- focusin: "open"- });-- // IDs of generated tooltips, needed for destroy- this.tooltips = {};- // IDs of parent tooltips where we removed the title attribute- this.parents = {};-- if ( this.options.disabled ) {- this._disable();- }- },-- _setOption: function( key, value ) {- var that = this;-- if ( key === "disabled" ) {- this[ value ? "_disable" : "_enable" ]();- this.options[ key ] = value;- // disable element style changes- return;- }-- this._super( key, value );-- if ( key === "content" ) {- $.each( this.tooltips, function( id, element ) {- that._updateContent( element );- });- }- },-- _disable: function() {- var that = this;-- // close open tooltips- $.each( this.tooltips, function( id, element ) {- var event = $.Event( "blur" );- event.target = event.currentTarget = element[0];- that.close( event, true );- });-- // remove title attributes to prevent native tooltips- this.element.find( this.options.items ).andSelf().each(function() {- var element = $( this );- if ( element.is( "[title]" ) ) {- element- .data( "ui-tooltip-title", element.attr( "title" ) )- .attr( "title", "" );- }- });- },-- _enable: function() {- // restore title attributes- this.element.find( this.options.items ).andSelf().each(function() {- var element = $( this );- if ( element.data( "ui-tooltip-title" ) ) {- element.attr( "title", element.data( "ui-tooltip-title" ) );- }- });- },-- open: function( event ) {- var that = this,- target = $( event ? event.target : this.element )- // we need closest here due to mouseover bubbling,- // but always pointing at the same event target- .closest( this.options.items );-- // No element to show a tooltip for- if ( !target.length ) {- return;- }-- // If the tooltip is open and we're tracking then reposition the tooltip.- // This makes sure that a tracking tooltip doesn't obscure a focused element- // if the user was hovering when the element gained focused.- if ( this.options.track && target.data( "ui-tooltip-id" ) ) {- this._find( target ).position( $.extend({- of: target- }, this.options.position ) );- // Stop tracking (#8622)- this._off( this.document, "mousemove" );- return;- }-- if ( target.attr( "title" ) ) {- target.data( "ui-tooltip-title", target.attr( "title" ) );- }-- target.data( "tooltip-open", true );-- // kill parent tooltips, custom or native, for hover- if ( event && event.type === "mouseover" ) {- target.parents().each(function() {- var blurEvent;- if ( $( this ).data( "tooltip-open" ) ) {- blurEvent = $.Event( "blur" );- blurEvent.target = blurEvent.currentTarget = this;- that.close( blurEvent, true );- }- if ( this.title ) {- $( this ).uniqueId();- that.parents[ this.id ] = {- element: this,- title: this.title- };- this.title = "";- }- });- }-- this._updateContent( target, event );- },-- _updateContent: function( target, event ) {- var content,- contentOption = this.options.content,- that = this;-- if ( typeof contentOption === "string" ) {- return this._open( event, target, contentOption );- }-- content = contentOption.call( target[0], function( response ) {- // ignore async response if tooltip was closed already- if ( !target.data( "tooltip-open" ) ) {- return;- }- // IE may instantly serve a cached response for ajax requests- // delay this call to _open so the other call to _open runs first- that._delay(function() {- this._open( event, target, response );- });- });- if ( content ) {- this._open( event, target, content );- }- },-- _open: function( event, target, content ) {- var tooltip, events, delayedShow,- positionOption = $.extend( {}, this.options.position );-- if ( !content ) {- return;- }-- // Content can be updated multiple times. If the tooltip already- // exists, then just update the content and bail.- tooltip = this._find( target );- if ( tooltip.length ) {- tooltip.find( ".ui-tooltip-content" ).html( content );- return;- }-- // if we have a title, clear it to prevent the native tooltip- // we have to check first to avoid defining a title if none exists- // (we don't want to cause an element to start matching [title])- //- // We use removeAttr only for key events, to allow IE to export the correct- // accessible attributes. For mouse events, set to empty string to avoid- // native tooltip showing up (happens only when removing inside mouseover).- if ( target.is( "[title]" ) ) {- if ( event && event.type === "mouseover" ) {- target.attr( "title", "" );- } else {- target.removeAttr( "title" );- }- }-- tooltip = this._tooltip( target );- addDescribedBy( target, tooltip.attr( "id" ) );- tooltip.find( ".ui-tooltip-content" ).html( content );-- function position( event ) {- positionOption.of = event;- if ( tooltip.is( ":hidden" ) ) {- return;- }- tooltip.position( positionOption );- }- if ( this.options.track && event && /^mouse/.test( event.originalEvent.type ) ) {- this._on( this.document, {- mousemove: position- });- // trigger once to override element-relative positioning- position( event );- } else {- tooltip.position( $.extend({- of: target- }, this.options.position ) );- }-- tooltip.hide();-- this._show( tooltip, this.options.show );- // Handle tracking tooltips that are shown with a delay (#8644). As soon- // as the tooltip is visible, position the tooltip using the most recent- // event.- if ( this.options.show && this.options.show.delay ) {- delayedShow = setInterval(function() {- if ( tooltip.is( ":visible" ) ) {- position( positionOption.of );- clearInterval( delayedShow );- }- }, $.fx.interval );- }-- this._trigger( "open", event, { tooltip: tooltip } );-- events = {- keyup: function( event ) {- if ( event.keyCode === $.ui.keyCode.ESCAPE ) {- var fakeEvent = $.Event(event);- fakeEvent.currentTarget = target[0];- this.close( fakeEvent, true );- }- },- remove: function() {- this._removeTooltip( tooltip );- }- };- if ( !event || event.type === "mouseover" ) {- events.mouseleave = "close";- }- if ( !event || event.type === "focusin" ) {- events.focusout = "close";- }- this._on( target, events );- },-- close: function( event ) {- var that = this,- target = $( event ? event.currentTarget : this.element ),- tooltip = this._find( target );-- // disabling closes the tooltip, so we need to track when we're closing- // to avoid an infinite loop in case the tooltip becomes disabled on close- if ( this.closing ) {- return;- }-- // only set title if we had one before (see comment in _open())- if ( target.data( "ui-tooltip-title" ) ) {- target.attr( "title", target.data( "ui-tooltip-title" ) );- }-- removeDescribedBy( target );-- tooltip.stop( true );- this._hide( tooltip, this.options.hide, function() {- that._removeTooltip( $( this ) );- });-- target.removeData( "tooltip-open" );- this._off( target, "mouseleave focusout keyup" );- // Remove 'remove' binding only on delegated targets- if ( target[0] !== this.element[0] ) {- this._off( target, "remove" );- }- this._off( this.document, "mousemove" );-- if ( event && event.type === "mouseleave" ) {- $.each( this.parents, function( id, parent ) {- parent.element.title = parent.title;- delete that.parents[ id ];- });- }-- this.closing = true;- this._trigger( "close", event, { tooltip: tooltip } );- this.closing = false;- },-- _tooltip: function( element ) {- var id = "ui-tooltip-" + increments++,- tooltip = $( "<div>" )- .attr({- id: id,- role: "tooltip"- })- .addClass( "ui-tooltip ui-widget ui-corner-all ui-widget-content " +- ( this.options.tooltipClass || "" ) );- $( "<div>" )- .addClass( "ui-tooltip-content" )- .appendTo( tooltip );- tooltip.appendTo( this.document[0].body );- if ( $.fn.bgiframe ) {- tooltip.bgiframe();- }- this.tooltips[ id ] = element;- return tooltip;- },-- _find: function( target ) {- var id = target.data( "ui-tooltip-id" );- return id ? $( "#" + id ) : $();- },-- _removeTooltip: function( tooltip ) {- tooltip.remove();- delete this.tooltips[ tooltip.attr( "id" ) ];- },-- _destroy: function() {- var that = this;-- // close open tooltips- $.each( this.tooltips, function( id, element ) {- // Delegate to close method to handle common cleanup- var event = $.Event( "blur" );- event.target = event.currentTarget = element[0];- that.close( event, true );-- // Remove immediately; destroying an open tooltip doesn't use the- // hide animation- $( "#" + id ).remove();-- // Restore the title- if ( element.data( "ui-tooltip-title" ) ) {- element.attr( "title", element.data( "ui-tooltip-title" ) );- element.removeData( "ui-tooltip-title" );- }- });- }-});--}( jQuery ) );-;(jQuery.effects || (function($, undefined) {--var backCompat = $.uiBackCompat !== false,- // prefix used for storing data on .data()- dataSpace = "ui-effects-";--$.effects = {- effect: {}-};--/*!- * jQuery Color Animations v2.0.0- * http://jquery.com/- *- * Copyright 2012 jQuery Foundation and other contributors- * Released under the MIT license.- * http://jquery.org/license- *- * Date: Mon Aug 13 13:41:02 2012 -0500- */-(function( jQuery, undefined ) {-- var stepHooks = "backgroundColor borderBottomColor borderLeftColor borderRightColor borderTopColor color columnRuleColor outlineColor textDecorationColor textEmphasisColor".split(" "),-- // plusequals test for += 100 -= 100- rplusequals = /^([\-+])=\s*(\d+\.?\d*)/,- // a set of RE's that can match strings and generate color tuples.- stringParsers = [{- re: /rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(?:,\s*(\d+(?:\.\d+)?)\s*)?\)/,- parse: function( execResult ) {- return [- execResult[ 1 ],- execResult[ 2 ],- execResult[ 3 ],- execResult[ 4 ]- ];- }- }, {- re: /rgba?\(\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*(?:,\s*(\d+(?:\.\d+)?)\s*)?\)/,- parse: function( execResult ) {- return [- execResult[ 1 ] * 2.55,- execResult[ 2 ] * 2.55,- execResult[ 3 ] * 2.55,- execResult[ 4 ]- ];- }- }, {- // this regex ignores A-F because it's compared against an already lowercased string- re: /#([a-f0-9]{2})([a-f0-9]{2})([a-f0-9]{2})/,- parse: function( execResult ) {- return [- parseInt( execResult[ 1 ], 16 ),- parseInt( execResult[ 2 ], 16 ),- parseInt( execResult[ 3 ], 16 )- ];- }- }, {- // this regex ignores A-F because it's compared against an already lowercased string- re: /#([a-f0-9])([a-f0-9])([a-f0-9])/,- parse: function( execResult ) {- return [- parseInt( execResult[ 1 ] + execResult[ 1 ], 16 ),- parseInt( execResult[ 2 ] + execResult[ 2 ], 16 ),- parseInt( execResult[ 3 ] + execResult[ 3 ], 16 )- ];- }- }, {- re: /hsla?\(\s*(\d+(?:\.\d+)?)\s*,\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*(?:,\s*(\d+(?:\.\d+)?)\s*)?\)/,- space: "hsla",- parse: function( execResult ) {- return [- execResult[ 1 ],- execResult[ 2 ] / 100,- execResult[ 3 ] / 100,- execResult[ 4 ]- ];- }- }],-- // jQuery.Color( )- color = jQuery.Color = function( color, green, blue, alpha ) {- return new jQuery.Color.fn.parse( color, green, blue, alpha );- },- spaces = {- 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"- }- }- }- },- propTypes = {- "byte": {- floor: true,- max: 255- },- "percent": {- max: 1- },- "degrees": {- mod: 360,- floor: true- }- },- support = color.support = {},-- // element for support tests- supportElem = jQuery( "<p>" )[ 0 ],-- // colors = jQuery.Color.names- colors,-- // local aliases of functions called often- each = jQuery.each;--// determine rgba support immediately-supportElem.style.cssText = "background-color:rgba(1,1,1,.5)";-support.rgba = supportElem.style.backgroundColor.indexOf( "rgba" ) > -1;--// define cache name and alpha properties-// for rgba and hsla spaces-each( spaces, function( spaceName, space ) {- space.cache = "_" + spaceName;- space.props.alpha = {- idx: 3,- type: "percent",- def: 1- };-});--function clamp( value, prop, allowEmpty ) {- var type = propTypes[ prop.type ] || {};-- if ( value == null ) {- return (allowEmpty || !prop.def) ? null : prop.def;- }-- // ~~ is an short way of doing floor for positive numbers- value = type.floor ? ~~value : parseFloat( value );-- // IE will pass in empty strings as value for alpha,- // which will hit this case- if ( isNaN( value ) ) {- return prop.def;- }-- if ( type.mod ) {- // we add mod before modding to make sure that negatives values- // get converted properly: -10 -> 350- return (value + type.mod) % type.mod;- }-- // for now all property types without mod have min and max- return 0 > value ? 0 : type.max < value ? type.max : value;-}--function stringParse( string ) {- var inst = color(),- rgba = inst._rgba = [];-- string = string.toLowerCase();-- each( stringParsers, function( i, parser ) {- var parsed,- match = parser.re.exec( string ),- values = match && parser.parse( match ),- spaceName = parser.space || "rgba";-- if ( values ) {- parsed = inst[ spaceName ]( values );-- // if this was an rgba parse the assignment might happen twice- // oh well....- inst[ spaces[ spaceName ].cache ] = parsed[ spaces[ spaceName ].cache ];- rgba = inst._rgba = parsed._rgba;-- // exit each( stringParsers ) here because we matched- return false;- }- });-- // Found a stringParser that handled it- if ( rgba.length ) {-- // if this came from a parsed string, force "transparent" when alpha is 0- // chrome, (and maybe others) return "transparent" as rgba(0,0,0,0)- if ( rgba.join() === "0,0,0,0" ) {- jQuery.extend( rgba, colors.transparent );- }- return inst;- }-- // named colors- return colors[ string ];-}--color.fn = jQuery.extend( color.prototype, {- parse: function( red, green, blue, alpha ) {- if ( red === undefined ) {- this._rgba = [ null, null, null, null ];- return this;- }- if ( red.jquery || red.nodeType ) {- red = jQuery( red ).css( green );- green = undefined;- }-- var inst = this,- type = jQuery.type( red ),- rgba = this._rgba = [];-- // more than 1 argument specified - assume ( red, green, blue, alpha )- if ( green !== undefined ) {- red = [ red, green, blue, alpha ];- type = "array";- }-- if ( type === "string" ) {- return this.parse( stringParse( red ) || colors._default );- }-- if ( type === "array" ) {- each( spaces.rgba.props, function( key, prop ) {- rgba[ prop.idx ] = clamp( red[ prop.idx ], prop );- });- return this;- }-- if ( type === "object" ) {- if ( red instanceof color ) {- each( spaces, function( spaceName, space ) {- if ( red[ space.cache ] ) {- inst[ space.cache ] = red[ space.cache ].slice();- }- });- } else {- each( spaces, function( spaceName, space ) {- var cache = space.cache;- each( space.props, function( key, prop ) {-- // if the cache doesn't exist, and we know how to convert- if ( !inst[ cache ] && space.to ) {-- // if the value was null, we don't need to copy it- // if the key was alpha, we don't need to copy it either- if ( key === "alpha" || red[ key ] == null ) {- return;- }- inst[ cache ] = space.to( inst._rgba );- }-- // this is the only case where we allow nulls for ALL properties.- // call clamp with alwaysAllowEmpty- inst[ cache ][ prop.idx ] = clamp( red[ key ], prop, true );- });-- // everything defined but alpha?- if ( inst[ cache ] && $.inArray( null, inst[ cache ].slice( 0, 3 ) ) < 0 ) {- // use the default of 1- inst[ cache ][ 3 ] = 1;- if ( space.from ) {- inst._rgba = space.from( inst[ cache ] );- }- }- });- }- return this;- }- },- is: function( compare ) {- var is = color( compare ),- same = true,- inst = this;-- each( spaces, function( _, space ) {- var localCache,- isCache = is[ space.cache ];- if (isCache) {- localCache = inst[ space.cache ] || space.to && space.to( inst._rgba ) || [];- each( space.props, function( _, prop ) {- if ( isCache[ prop.idx ] != null ) {- same = ( isCache[ prop.idx ] === localCache[ prop.idx ] );- return same;- }- });- }- return same;- });- return same;- },- _space: function() {- var used = [],- inst = this;- each( spaces, function( spaceName, space ) {- if ( inst[ space.cache ] ) {- used.push( spaceName );- }- });- return used.pop();- },- transition: function( other, distance ) {- var end = color( other ),- spaceName = end._space(),- space = spaces[ spaceName ],- startColor = this.alpha() === 0 ? color( "transparent" ) : this,- start = startColor[ space.cache ] || space.to( startColor._rgba ),- result = start.slice();-- end = end[ space.cache ];- each( space.props, function( key, prop ) {- var index = prop.idx,- startValue = start[ index ],- endValue = end[ index ],- type = propTypes[ prop.type ] || {};-- // if null, don't override start value- if ( endValue === null ) {- return;- }- // if null - use end- if ( startValue === null ) {- result[ index ] = endValue;- } else {- if ( type.mod ) {- if ( endValue - startValue > type.mod / 2 ) {- startValue += type.mod;- } else if ( startValue - endValue > type.mod / 2 ) {- startValue -= type.mod;- }- }- result[ index ] = clamp( ( endValue - startValue ) * distance + startValue, prop );- }- });- return this[ spaceName ]( result );- },- blend: function( opaque ) {- // if we are already opaque - return ourself- if ( this._rgba[ 3 ] === 1 ) {- return this;- }-- var rgb = this._rgba.slice(),- a = rgb.pop(),- blend = color( opaque )._rgba;-- return color( jQuery.map( rgb, function( v, i ) {- return ( 1 - a ) * blend[ i ] + a * v;- }));- },- toRgbaString: function() {- var prefix = "rgba(",- rgba = jQuery.map( this._rgba, function( v, i ) {- return v == null ? ( i > 2 ? 1 : 0 ) : v;- });-- if ( rgba[ 3 ] === 1 ) {- rgba.pop();- prefix = "rgb(";- }-- return prefix + rgba.join() + ")";- },- toHslaString: function() {- var prefix = "hsla(",- hsla = jQuery.map( this.hsla(), function( v, i ) {- if ( v == null ) {- v = i > 2 ? 1 : 0;- }-- // catch 1 and 2- if ( i && i < 3 ) {- v = Math.round( v * 100 ) + "%";- }- return v;- });-- if ( hsla[ 3 ] === 1 ) {- hsla.pop();- prefix = "hsl(";- }- return prefix + hsla.join() + ")";- },- toHexString: function( includeAlpha ) {- var rgba = this._rgba.slice(),- alpha = rgba.pop();-- if ( includeAlpha ) {- rgba.push( ~~( alpha * 255 ) );- }-- return "#" + jQuery.map( rgba, function( v ) {-- // default to 0 when nulls exist- v = ( v || 0 ).toString( 16 );- return v.length === 1 ? "0" + v : v;- }).join("");- },- toString: function() {- return this._rgba[ 3 ] === 0 ? "transparent" : this.toRgbaString();- }-});-color.fn.parse.prototype = color.fn;--// hsla conversions adapted from:-// https://code.google.com/p/maashaack/source/browse/packages/graphics/trunk/src/graphics/colors/HUE2RGB.as?r=5021--function hue2rgb( p, q, h ) {- h = ( h + 1 ) % 1;- if ( h * 6 < 1 ) {- return p + (q - p) * h * 6;- }- if ( h * 2 < 1) {- return q;- }- if ( h * 3 < 2 ) {- return p + (q - p) * ((2/3) - h) * 6;- }- return p;-}--spaces.hsla.to = function ( rgba ) {- if ( rgba[ 0 ] == null || rgba[ 1 ] == null || rgba[ 2 ] == null ) {- return [ null, null, null, rgba[ 3 ] ];- }- var r = rgba[ 0 ] / 255,- g = rgba[ 1 ] / 255,- b = rgba[ 2 ] / 255,- a = rgba[ 3 ],- max = Math.max( r, g, b ),- min = Math.min( r, g, b ),- diff = max - min,- add = max + min,- l = add * 0.5,- h, s;-- if ( min === max ) {- h = 0;- } else if ( r === max ) {- h = ( 60 * ( g - b ) / diff ) + 360;- } else if ( g === max ) {- h = ( 60 * ( b - r ) / diff ) + 120;- } else {- h = ( 60 * ( r - g ) / diff ) + 240;- }-- if ( l === 0 || l === 1 ) {- s = l;- } else if ( l <= 0.5 ) {- s = diff / add;- } else {- s = diff / ( 2 - add );- }- return [ Math.round(h) % 360, s, l, a == null ? 1 : a ];-};--spaces.hsla.from = function ( hsla ) {- if ( hsla[ 0 ] == null || hsla[ 1 ] == null || hsla[ 2 ] == null ) {- return [ null, null, null, hsla[ 3 ] ];- }- var h = hsla[ 0 ] / 360,- s = hsla[ 1 ],- l = hsla[ 2 ],- a = hsla[ 3 ],- q = l <= 0.5 ? l * ( 1 + s ) : l + s - l * s,- p = 2 * l - q;-- return [- Math.round( hue2rgb( p, q, h + ( 1 / 3 ) ) * 255 ),- Math.round( hue2rgb( p, q, h ) * 255 ),- Math.round( hue2rgb( p, q, h - ( 1 / 3 ) ) * 255 ),- a- ];-};---each( spaces, function( spaceName, space ) {- var props = space.props,- cache = space.cache,- to = space.to,- from = space.from;-- // makes rgba() and hsla()- color.fn[ spaceName ] = function( value ) {-- // generate a cache for this space if it doesn't exist- if ( to && !this[ cache ] ) {- this[ cache ] = to( this._rgba );- }- if ( value === undefined ) {- return this[ cache ].slice();- }-- var ret,- type = jQuery.type( value ),- arr = ( type === "array" || type === "object" ) ? value : arguments,- local = this[ cache ].slice();-- each( props, function( key, prop ) {- var val = arr[ type === "object" ? key : prop.idx ];- if ( val == null ) {- val = local[ prop.idx ];- }- local[ prop.idx ] = clamp( val, prop );- });-- if ( from ) {- ret = color( from( local ) );- ret[ cache ] = local;- return ret;- } else {- return color( local );- }- };-- // makes red() green() blue() alpha() hue() saturation() lightness()- each( props, function( key, prop ) {- // alpha is included in more than one space- if ( color.fn[ key ] ) {- return;- }- color.fn[ key ] = function( value ) {- var vtype = jQuery.type( value ),- fn = ( key === "alpha" ? ( this._hsla ? "hsla" : "rgba" ) : spaceName ),- local = this[ fn ](),- cur = local[ prop.idx ],- match;-- if ( vtype === "undefined" ) {- return cur;- }-- if ( vtype === "function" ) {- value = value.call( this, cur );- vtype = jQuery.type( value );- }- if ( value == null && prop.empty ) {- return this;- }- if ( vtype === "string" ) {- match = rplusequals.exec( value );- if ( match ) {- value = cur + parseFloat( match[ 2 ] ) * ( match[ 1 ] === "+" ? 1 : -1 );- }- }- local[ prop.idx ] = value;- return this[ fn ]( local );- };- });-});--// add .fx.step functions-each( stepHooks, function( i, hook ) {- jQuery.cssHooks[ hook ] = {- set: function( elem, value ) {- var parsed, curElem,- backgroundColor = "";-- if ( jQuery.type( value ) !== "string" || ( parsed = stringParse( value ) ) ) {- value = color( parsed || value );- if ( !support.rgba && value._rgba[ 3 ] !== 1 ) {- curElem = hook === "backgroundColor" ? elem.parentNode : elem;- while (- (backgroundColor === "" || backgroundColor === "transparent") &&- curElem && curElem.style- ) {- try {- backgroundColor = jQuery.css( curElem, "backgroundColor" );- curElem = curElem.parentNode;- } catch ( e ) {- }- }-- value = value.blend( backgroundColor && backgroundColor !== "transparent" ?- backgroundColor :- "_default" );- }-- value = value.toRgbaString();- }- try {- elem.style[ hook ] = value;- } catch( error ) {- // wrapped to prevent IE from throwing errors on "invalid" values like 'auto' or 'inherit'- }- }- };- jQuery.fx.step[ hook ] = function( fx ) {- if ( !fx.colorInit ) {- fx.start = color( fx.elem, hook );- fx.end = color( fx.end );- fx.colorInit = true;- }- jQuery.cssHooks[ hook ].set( fx.elem, fx.start.transition( fx.end, fx.pos ) );- };-});--jQuery.cssHooks.borderColor = {- expand: function( value ) {- var expanded = {};-- each( [ "Top", "Right", "Bottom", "Left" ], function( i, part ) {- expanded[ "border" + part + "Color" ] = value;- });- return expanded;- }-};--// Basic color names only.-// Usage of any of the other color names requires adding yourself or including-// jquery.color.svg-names.js.-colors = jQuery.Color.names = {- // 4.1. Basic color keywords- 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",-- // 4.2.3. "transparent" color keyword- transparent: [ null, null, null, 0 ],-- _default: "#ffffff"-};--})( jQuery );----/******************************************************************************/-/****************************** CLASS ANIMATIONS ******************************/-/******************************************************************************/-(function() {--var classAnimationActions = [ "add", "remove", "toggle" ],- shorthandStyles = {- border: 1,- borderBottom: 1,- borderColor: 1,- borderLeft: 1,- borderRight: 1,- borderTop: 1,- borderWidth: 1,- margin: 1,- padding: 1- };--$.each([ "borderLeftStyle", "borderRightStyle", "borderBottomStyle", "borderTopStyle" ], function( _, prop ) {- $.fx.step[ prop ] = function( fx ) {- if ( fx.end !== "none" && !fx.setAttr || fx.pos === 1 && !fx.setAttr ) {- jQuery.style( fx.elem, prop, fx.end );- fx.setAttr = true;- }- };-});--function getElementStyles() {- var style = this.ownerDocument.defaultView ?- this.ownerDocument.defaultView.getComputedStyle( this, null ) :- this.currentStyle,- newStyle = {},- key,- len;-- // webkit enumerates style porperties- if ( style && style.length && style[ 0 ] && style[ style[ 0 ] ] ) {- len = style.length;- while ( len-- ) {- key = style[ len ];- if ( typeof style[ key ] === "string" ) {- newStyle[ $.camelCase( key ) ] = style[ key ];- }- }- } else {- for ( key in style ) {- if ( typeof style[ key ] === "string" ) {- newStyle[ key ] = style[ key ];- }- }- }-- return newStyle;-}---function styleDifference( oldStyle, newStyle ) {- var diff = {},- name, value;-- for ( name in newStyle ) {- value = newStyle[ name ];- if ( oldStyle[ name ] !== value ) {- if ( !shorthandStyles[ name ] ) {- if ( $.fx.step[ name ] || !isNaN( parseFloat( value ) ) ) {- diff[ name ] = value;- }- }- }- }-- return diff;-}--$.effects.animateClass = function( value, duration, easing, callback ) {- var o = $.speed( duration, easing, callback );-- return this.queue( function() {- var animated = $( this ),- baseClass = animated.attr( "class" ) || "",- applyClassChange,- allAnimations = o.children ? animated.find( "*" ).andSelf() : animated;-- // map the animated objects to store the original styles.- allAnimations = allAnimations.map(function() {- var el = $( this );- return {- el: el,- start: getElementStyles.call( this )- };- });-- // apply class change- applyClassChange = function() {- $.each( classAnimationActions, function(i, action) {- if ( value[ action ] ) {- animated[ action + "Class" ]( value[ action ] );- }- });- };- applyClassChange();-- // map all animated objects again - calculate new styles and diff- allAnimations = allAnimations.map(function() {- this.end = getElementStyles.call( this.el[ 0 ] );- this.diff = styleDifference( this.start, this.end );- return this;- });-- // apply original class- animated.attr( "class", baseClass );-- // map all animated objects again - this time collecting a promise- allAnimations = allAnimations.map(function() {- var styleInfo = this,- dfd = $.Deferred(),- opts = jQuery.extend({}, o, {- queue: false,- complete: function() {- dfd.resolve( styleInfo );- }- });-- this.el.animate( this.diff, opts );- return dfd.promise();- });-- // once all animations have completed:- $.when.apply( $, allAnimations.get() ).done(function() {-- // set the final class- applyClassChange();-- // for each animated element,- // clear all css properties that were animated- $.each( arguments, function() {- var el = this.el;- $.each( this.diff, function(key) {- el.css( key, '' );- });- });-- // this is guarnteed to be there if you use jQuery.speed()- // it also handles dequeuing the next anim...- o.complete.call( animated[ 0 ] );- });- });-};--$.fn.extend({- _addClass: $.fn.addClass,- addClass: function( classNames, speed, easing, callback ) {- return speed ?- $.effects.animateClass.call( this,- { add: classNames }, speed, easing, callback ) :- this._addClass( classNames );- },-- _removeClass: $.fn.removeClass,- removeClass: function( classNames, speed, easing, callback ) {- return speed ?- $.effects.animateClass.call( this,- { remove: classNames }, speed, easing, callback ) :- this._removeClass( classNames );- },-- _toggleClass: $.fn.toggleClass,- toggleClass: function( classNames, force, speed, easing, callback ) {- if ( typeof force === "boolean" || force === undefined ) {- if ( !speed ) {- // without speed parameter- return this._toggleClass( classNames, force );- } else {- return $.effects.animateClass.call( this,- (force ? { add: classNames } : { remove: classNames }),- speed, easing, callback );- }- } else {- // without force parameter- return $.effects.animateClass.call( this,- { toggle: classNames }, force, speed, easing );- }- },-- switchClass: function( remove, add, speed, easing, callback) {- return $.effects.animateClass.call( this, {- add: add,- remove: remove- }, speed, easing, callback );- }-});--})();--/******************************************************************************/-/*********************************** EFFECTS **********************************/-/******************************************************************************/--(function() {--$.extend( $.effects, {- version: "1.9.1",-- // Saves a set of properties in a data storage- save: function( element, set ) {- for( var i=0; i < set.length; i++ ) {- if ( set[ i ] !== null ) {- element.data( dataSpace + set[ i ], element[ 0 ].style[ set[ i ] ] );- }- }- },-- // Restores a set of previously saved properties from a data storage- restore: function( element, set ) {- var val, i;- for( i=0; i < set.length; i++ ) {- if ( set[ i ] !== null ) {- val = element.data( dataSpace + set[ i ] );- // support: jQuery 1.6.2- // http://bugs.jquery.com/ticket/9917- // jQuery 1.6.2 incorrectly returns undefined for any falsy value.- // We can't differentiate between "" and 0 here, so we just assume- // empty string since it's likely to be a more common value...- if ( val === undefined ) {- val = "";- }- element.css( set[ i ], val );- }- }- },-- setMode: function( el, mode ) {- if (mode === "toggle") {- mode = el.is( ":hidden" ) ? "show" : "hide";- }- return mode;- },-- // Translates a [top,left] array into a baseline value- // this should be a little more flexible in the future to handle a string & hash- getBaseline: function( origin, original ) {- var y, x;- switch ( origin[ 0 ] ) {- case "top": y = 0; break;- case "middle": y = 0.5; break;- case "bottom": y = 1; break;- default: y = origin[ 0 ] / original.height;- }- switch ( origin[ 1 ] ) {- case "left": x = 0; break;- case "center": x = 0.5; break;- case "right": x = 1; break;- default: x = origin[ 1 ] / original.width;- }- return {- x: x,- y: y- };- },-- // Wraps the element around a wrapper that copies position properties- createWrapper: function( element ) {-- // if the element is already wrapped, return it- if ( element.parent().is( ".ui-effects-wrapper" )) {- return element.parent();- }-- // wrap the element- var props = {- width: element.outerWidth(true),- height: element.outerHeight(true),- "float": element.css( "float" )- },- wrapper = $( "<div></div>" )- .addClass( "ui-effects-wrapper" )- .css({- fontSize: "100%",- background: "transparent",- border: "none",- margin: 0,- padding: 0- }),- // Store the size in case width/height are defined in % - Fixes #5245- size = {- width: element.width(),- height: element.height()- },- active = document.activeElement;-- // support: Firefox- // Firefox incorrectly exposes anonymous content- // https://bugzilla.mozilla.org/show_bug.cgi?id=561664- try {- active.id;- } catch( e ) {- active = document.body;- }-- element.wrap( wrapper );-- // Fixes #7595 - Elements lose focus when wrapped.- if ( element[ 0 ] === active || $.contains( element[ 0 ], active ) ) {- $( active ).focus();- }-- wrapper = element.parent(); //Hotfix for jQuery 1.4 since some change in wrap() seems to actually lose the reference to the wrapped element-- // transfer positioning properties to the wrapper- if ( element.css( "position" ) === "static" ) {- wrapper.css({ position: "relative" });- element.css({ position: "relative" });- } else {- $.extend( props, {- position: element.css( "position" ),- zIndex: element.css( "z-index" )- });- $.each([ "top", "left", "bottom", "right" ], function(i, pos) {- props[ pos ] = element.css( pos );- if ( isNaN( parseInt( props[ pos ], 10 ) ) ) {- props[ pos ] = "auto";- }- });- element.css({- position: "relative",- top: 0,- left: 0,- right: "auto",- bottom: "auto"- });- }- element.css(size);-- return wrapper.css( props ).show();- },-- removeWrapper: function( element ) {- var active = document.activeElement;-- if ( element.parent().is( ".ui-effects-wrapper" ) ) {- element.parent().replaceWith( element );-- // Fixes #7595 - Elements lose focus when wrapped.- if ( element[ 0 ] === active || $.contains( element[ 0 ], active ) ) {- $( active ).focus();- }- }--- return element;- },-- setTransition: function( element, list, factor, value ) {- value = value || {};- $.each( list, function( i, x ) {- var unit = element.cssUnit( x );- if ( unit[ 0 ] > 0 ) {- value[ x ] = unit[ 0 ] * factor + unit[ 1 ];- }- });- return value;- }-});--// return an effect options object for the given parameters:-function _normalizeArguments( effect, options, speed, callback ) {-- // allow passing all options as the first parameter- if ( $.isPlainObject( effect ) ) {- options = effect;- effect = effect.effect;- }-- // convert to an object- effect = { effect: effect };-- // catch (effect, null, ...)- if ( options == null ) {- options = {};- }-- // catch (effect, callback)- if ( $.isFunction( options ) ) {- callback = options;- speed = null;- options = {};- }-- // catch (effect, speed, ?)- if ( typeof options === "number" || $.fx.speeds[ options ] ) {- callback = speed;- speed = options;- options = {};- }-- // catch (effect, options, callback)- if ( $.isFunction( speed ) ) {- callback = speed;- speed = null;- }-- // add options to effect- if ( options ) {- $.extend( effect, options );- }-- speed = speed || options.duration;- effect.duration = $.fx.off ? 0 :- typeof speed === "number" ? speed :- speed in $.fx.speeds ? $.fx.speeds[ speed ] :- $.fx.speeds._default;-- effect.complete = callback || options.complete;-- return effect;-}--function standardSpeed( speed ) {- // valid standard speeds- if ( !speed || typeof speed === "number" || $.fx.speeds[ speed ] ) {- return true;- }-- // invalid strings - treat as "normal" speed- if ( typeof speed === "string" && !$.effects.effect[ speed ] ) {- // TODO: remove in 2.0 (#7115)- if ( backCompat && $.effects[ speed ] ) {- return false;- }- return true;- }-- return false;-}--$.fn.extend({- effect: function( /* effect, options, speed, callback */ ) {- var args = _normalizeArguments.apply( this, arguments ),- mode = args.mode,- queue = args.queue,- effectMethod = $.effects.effect[ args.effect ],-- // DEPRECATED: remove in 2.0 (#7115)- oldEffectMethod = !effectMethod && backCompat && $.effects[ args.effect ];-- if ( $.fx.off || !( effectMethod || oldEffectMethod ) ) {- // delegate to the original method (e.g., .show()) if possible- if ( mode ) {- return this[ mode ]( args.duration, args.complete );- } else {- return this.each( function() {- if ( args.complete ) {- args.complete.call( this );- }- });- }- }-- function run( next ) {- var elem = $( this ),- complete = args.complete,- mode = args.mode;-- function done() {- if ( $.isFunction( complete ) ) {- complete.call( elem[0] );- }- if ( $.isFunction( next ) ) {- next();- }- }-- // if the element is hiddden and mode is hide,- // or element is visible and mode is show- if ( elem.is( ":hidden" ) ? mode === "hide" : mode === "show" ) {- done();- } else {- effectMethod.call( elem[0], args, done );- }- }-- // TODO: remove this check in 2.0, effectMethod will always be true- if ( effectMethod ) {- return queue === false ? this.each( run ) : this.queue( queue || "fx", run );- } else {- // DEPRECATED: remove in 2.0 (#7115)- return oldEffectMethod.call(this, {- options: args,- duration: args.duration,- callback: args.complete,- mode: args.mode- });- }- },-- _show: $.fn.show,- show: function( speed ) {- if ( standardSpeed( speed ) ) {- return this._show.apply( this, arguments );- } else {- var args = _normalizeArguments.apply( this, arguments );- args.mode = "show";- return this.effect.call( this, args );- }- },-- _hide: $.fn.hide,- hide: function( speed ) {- if ( standardSpeed( speed ) ) {- return this._hide.apply( this, arguments );- } else {- var args = _normalizeArguments.apply( this, arguments );- args.mode = "hide";- return this.effect.call( this, args );- }- },-- // jQuery core overloads toggle and creates _toggle- __toggle: $.fn.toggle,- toggle: function( speed ) {- if ( standardSpeed( speed ) || typeof speed === "boolean" || $.isFunction( speed ) ) {- return this.__toggle.apply( this, arguments );- } else {- var args = _normalizeArguments.apply( this, arguments );- args.mode = "toggle";- return this.effect.call( this, args );- }- },-- // helper functions- cssUnit: function(key) {- var style = this.css( key ),- val = [];-- $.each( [ "em", "px", "%", "pt" ], function( i, unit ) {- if ( style.indexOf( unit ) > 0 ) {- val = [ parseFloat( style ), unit ];- }- });- return val;- }-});--})();--/******************************************************************************/-/*********************************** EASING ***********************************/-/******************************************************************************/--(function() {--// based on easing equations from Robert Penner (http://www.robertpenner.com/easing)--var baseEasings = {};--$.each( [ "Quad", "Cubic", "Quart", "Quint", "Expo" ], function( i, name ) {- baseEasings[ name ] = function( p ) {- return Math.pow( p, i + 2 );- };-});--$.extend( baseEasings, {- Sine: function ( p ) {- return 1 - Math.cos( p * Math.PI / 2 );- },- Circ: function ( p ) {- return 1 - Math.sqrt( 1 - p * p );- },- Elastic: function( p ) {- return p === 0 || p === 1 ? p :- -Math.pow( 2, 8 * (p - 1) ) * Math.sin( ( (p - 1) * 80 - 7.5 ) * Math.PI / 15 );- },- Back: function( p ) {- return p * p * ( 3 * p - 2 );- },- Bounce: function ( p ) {- var pow2,- bounce = 4;-- while ( p < ( ( pow2 = Math.pow( 2, --bounce ) ) - 1 ) / 11 ) {}- return 1 / Math.pow( 4, 3 - bounce ) - 7.5625 * Math.pow( ( pow2 * 3 - 2 ) / 22 - p, 2 );- }-});--$.each( baseEasings, function( name, easeIn ) {- $.easing[ "easeIn" + name ] = easeIn;- $.easing[ "easeOut" + name ] = function( p ) {- return 1 - easeIn( 1 - p );- };- $.easing[ "easeInOut" + name ] = function( p ) {- return p < 0.5 ?- easeIn( p * 2 ) / 2 :- 1 - easeIn( p * -2 + 2 ) / 2;- };-});--})();--})(jQuery));-(function( $, undefined ) {--var rvertical = /up|down|vertical/,- rpositivemotion = /up|left|vertical|horizontal/;--$.effects.effect.blind = function( o, done ) {- // Create element- var el = $( this ),- props = [ "position", "top", "bottom", "left", "right", "height", "width" ],- mode = $.effects.setMode( el, o.mode || "hide" ),- direction = o.direction || "up",- vertical = rvertical.test( direction ),- ref = vertical ? "height" : "width",- ref2 = vertical ? "top" : "left",- motion = rpositivemotion.test( direction ),- animation = {},- show = mode === "show",- wrapper, distance, margin;-- // if already wrapped, the wrapper's properties are my property. #6245- if ( el.parent().is( ".ui-effects-wrapper" ) ) {- $.effects.save( el.parent(), props );- } else {- $.effects.save( el, props );- }- el.show();- wrapper = $.effects.createWrapper( el ).css({- overflow: "hidden"- });-- distance = wrapper[ ref ]();- margin = parseFloat( wrapper.css( ref2 ) ) || 0;-- animation[ ref ] = show ? distance : 0;- if ( !motion ) {- el- .css( vertical ? "bottom" : "right", 0 )- .css( vertical ? "top" : "left", "auto" )- .css({ position: "absolute" });-- animation[ ref2 ] = show ? margin : distance + margin;- }-- // start at 0 if we are showing- if ( show ) {- wrapper.css( ref, 0 );- if ( ! motion ) {- wrapper.css( ref2, margin + distance );- }- }-- // Animate- wrapper.animate( animation, {- duration: o.duration,- easing: o.easing,- queue: false,- complete: function() {- if ( mode === "hide" ) {- el.hide();- }- $.effects.restore( el, props );- $.effects.removeWrapper( el );- done();- }- });--};--})(jQuery);-(function( $, undefined ) {--$.effects.effect.bounce = function( o, done ) {- var el = $( this ),- props = [ "position", "top", "bottom", "left", "right", "height", "width" ],-- // defaults:- mode = $.effects.setMode( el, o.mode || "effect" ),- hide = mode === "hide",- show = mode === "show",- direction = o.direction || "up",- distance = o.distance,- times = o.times || 5,-- // number of internal animations- anims = times * 2 + ( show || hide ? 1 : 0 ),- speed = o.duration / anims,- easing = o.easing,-- // utility:- ref = ( direction === "up" || direction === "down" ) ? "top" : "left",- motion = ( direction === "up" || direction === "left" ),- i,- upAnim,- downAnim,-- // we will need to re-assemble the queue to stack our animations in place- queue = el.queue(),- queuelen = queue.length;-- // Avoid touching opacity to prevent clearType and PNG issues in IE- if ( show || hide ) {- props.push( "opacity" );- }-- $.effects.save( el, props );- el.show();- $.effects.createWrapper( el ); // Create Wrapper-- // default distance for the BIGGEST bounce is the outer Distance / 3- if ( !distance ) {- distance = el[ ref === "top" ? "outerHeight" : "outerWidth" ]() / 3;- }-- if ( show ) {- downAnim = { opacity: 1 };- downAnim[ ref ] = 0;-- // if we are showing, force opacity 0 and set the initial position- // then do the "first" animation- el.css( "opacity", 0 )- .css( ref, motion ? -distance * 2 : distance * 2 )- .animate( downAnim, speed, easing );- }-- // start at the smallest distance if we are hiding- if ( hide ) {- distance = distance / Math.pow( 2, times - 1 );- }-- downAnim = {};- downAnim[ ref ] = 0;- // Bounces up/down/left/right then back to 0 -- times * 2 animations happen here- for ( i = 0; i < times; i++ ) {- upAnim = {};- upAnim[ ref ] = ( motion ? "-=" : "+=" ) + distance;-- el.animate( upAnim, speed, easing )- .animate( downAnim, speed, easing );-- distance = hide ? distance * 2 : distance / 2;- }-- // Last Bounce when Hiding- if ( hide ) {- upAnim = { opacity: 0 };- upAnim[ ref ] = ( motion ? "-=" : "+=" ) + distance;-- el.animate( upAnim, speed, easing );- }-- el.queue(function() {- if ( hide ) {- el.hide();- }- $.effects.restore( el, props );- $.effects.removeWrapper( el );- done();- });-- // inject all the animations we just queued to be first in line (after "inprogress")- if ( queuelen > 1) {- queue.splice.apply( queue,- [ 1, 0 ].concat( queue.splice( queuelen, anims + 1 ) ) );- }- el.dequeue();--};--})(jQuery);-(function( $, undefined ) {--$.effects.effect.clip = function( o, done ) {- // Create element- var el = $( this ),- props = [ "position", "top", "bottom", "left", "right", "height", "width" ],- mode = $.effects.setMode( el, o.mode || "hide" ),- show = mode === "show",- direction = o.direction || "vertical",- vert = direction === "vertical",- size = vert ? "height" : "width",- position = vert ? "top" : "left",- animation = {},- wrapper, animate, distance;-- // Save & Show- $.effects.save( el, props );- el.show();-- // Create Wrapper- wrapper = $.effects.createWrapper( el ).css({- overflow: "hidden"- });- animate = ( el[0].tagName === "IMG" ) ? wrapper : el;- distance = animate[ size ]();-- // Shift- if ( show ) {- animate.css( size, 0 );- animate.css( position, distance / 2 );- }-- // Create Animation Object:- animation[ size ] = show ? distance : 0;- animation[ position ] = show ? 0 : distance / 2;-- // Animate- animate.animate( animation, {- queue: false,- duration: o.duration,- easing: o.easing,- complete: function() {- if ( !show ) {- el.hide();- }- $.effects.restore( el, props );- $.effects.removeWrapper( el );- done();- }- });--};--})(jQuery);-(function( $, undefined ) {--$.effects.effect.drop = function( o, done ) {-- var el = $( this ),- props = [ "position", "top", "bottom", "left", "right", "opacity", "height", "width" ],- mode = $.effects.setMode( el, o.mode || "hide" ),- show = mode === "show",- direction = o.direction || "left",- ref = ( direction === "up" || direction === "down" ) ? "top" : "left",- motion = ( direction === "up" || direction === "left" ) ? "pos" : "neg",- animation = {- opacity: show ? 1 : 0- },- distance;-- // Adjust- $.effects.save( el, props );- el.show();- $.effects.createWrapper( el );-- distance = o.distance || el[ ref === "top" ? "outerHeight": "outerWidth" ]( true ) / 2;-- if ( show ) {- el- .css( "opacity", 0 )- .css( ref, motion === "pos" ? -distance : distance );- }-- // Animation- animation[ ref ] = ( show ?- ( motion === "pos" ? "+=" : "-=" ) :- ( motion === "pos" ? "-=" : "+=" ) ) +- distance;-- // Animate- el.animate( animation, {- queue: false,- duration: o.duration,- easing: o.easing,- complete: function() {- if ( mode === "hide" ) {- el.hide();- }- $.effects.restore( el, props );- $.effects.removeWrapper( el );- done();- }- });-};--})(jQuery);-(function( $, undefined ) {--$.effects.effect.explode = function( o, done ) {-- var rows = o.pieces ? Math.round( Math.sqrt( o.pieces ) ) : 3,- cells = rows,- el = $( this ),- mode = $.effects.setMode( el, o.mode || "hide" ),- show = mode === "show",-- // show and then visibility:hidden the element before calculating offset- offset = el.show().css( "visibility", "hidden" ).offset(),-- // width and height of a piece- width = Math.ceil( el.outerWidth() / cells ),- height = Math.ceil( el.outerHeight() / rows ),- pieces = [],-- // loop- i, j, left, top, mx, my;-- // children animate complete:- function childComplete() {- pieces.push( this );- if ( pieces.length === rows * cells ) {- animComplete();- }- }-- // clone the element for each row and cell.- for( i = 0; i < rows ; i++ ) { // ===>- top = offset.top + i * height;- my = i - ( rows - 1 ) / 2 ;-- for( j = 0; j < cells ; j++ ) { // |||- left = offset.left + j * width;- mx = j - ( cells - 1 ) / 2 ;-- // Create a clone of the now hidden main element that will be absolute positioned- // within a wrapper div off the -left and -top equal to size of our pieces- el- .clone()- .appendTo( "body" )- .wrap( "<div></div>" )- .css({- position: "absolute",- visibility: "visible",- left: -j * width,- top: -i * height- })-- // select the wrapper - make it overflow: hidden and absolute positioned based on- // where the original was located +left and +top equal to the size of pieces- .parent()- .addClass( "ui-effects-explode" )- .css({- position: "absolute",- overflow: "hidden",- width: width,- height: height,- left: left + ( show ? mx * width : 0 ),- top: top + ( show ? my * height : 0 ),- opacity: show ? 0 : 1- }).animate({- left: left + ( show ? 0 : mx * width ),- top: top + ( show ? 0 : my * height ),- opacity: show ? 1 : 0- }, o.duration || 500, o.easing, childComplete );- }- }-- function animComplete() {- el.css({- visibility: "visible"- });- $( pieces ).remove();- if ( !show ) {- el.hide();- }- done();- }-};--})(jQuery);-(function( $, undefined ) {--$.effects.effect.fade = function( o, done ) {- var el = $( this ),- mode = $.effects.setMode( el, o.mode || "toggle" );-- el.animate({- opacity: mode- }, {- queue: false,- duration: o.duration,- easing: o.easing,- complete: done- });-};--})( jQuery );-(function( $, undefined ) {--$.effects.effect.fold = function( o, done ) {-- // Create element- var el = $( this ),- props = [ "position", "top", "bottom", "left", "right", "height", "width" ],- mode = $.effects.setMode( el, o.mode || "hide" ),- show = mode === "show",- hide = mode === "hide",- size = o.size || 15,- percent = /([0-9]+)%/.exec( size ),- horizFirst = !!o.horizFirst,- widthFirst = show !== horizFirst,- ref = widthFirst ? [ "width", "height" ] : [ "height", "width" ],- duration = o.duration / 2,- wrapper, distance,- animation1 = {},- animation2 = {};-- $.effects.save( el, props );- el.show();-- // Create Wrapper- wrapper = $.effects.createWrapper( el ).css({- overflow: "hidden"- });- distance = widthFirst ?- [ wrapper.width(), wrapper.height() ] :- [ wrapper.height(), wrapper.width() ];-- if ( percent ) {- size = parseInt( percent[ 1 ], 10 ) / 100 * distance[ hide ? 0 : 1 ];- }- if ( show ) {- wrapper.css( horizFirst ? {- height: 0,- width: size- } : {- height: size,- width: 0- });- }-- // Animation- animation1[ ref[ 0 ] ] = show ? distance[ 0 ] : size;- animation2[ ref[ 1 ] ] = show ? distance[ 1 ] : 0;-- // Animate- wrapper- .animate( animation1, duration, o.easing )- .animate( animation2, duration, o.easing, function() {- if ( hide ) {- el.hide();- }- $.effects.restore( el, props );- $.effects.removeWrapper( el );- done();- });--};--})(jQuery);-(function( $, undefined ) {--$.effects.effect.highlight = function( o, done ) {- var elem = $( this ),- props = [ "backgroundImage", "backgroundColor", "opacity" ],- mode = $.effects.setMode( elem, o.mode || "show" ),- animation = {- backgroundColor: elem.css( "backgroundColor" )- };-- if (mode === "hide") {- animation.opacity = 0;- }-- $.effects.save( elem, props );-- elem- .show()- .css({- backgroundImage: "none",- backgroundColor: o.color || "#ffff99"- })- .animate( animation, {- queue: false,- duration: o.duration,- easing: o.easing,- complete: function() {- if ( mode === "hide" ) {- elem.hide();- }- $.effects.restore( elem, props );- done();- }- });-};--})(jQuery);-(function( $, undefined ) {--$.effects.effect.pulsate = function( o, done ) {- var elem = $( this ),- mode = $.effects.setMode( elem, o.mode || "show" ),- show = mode === "show",- hide = mode === "hide",- showhide = ( show || mode === "hide" ),-- // showing or hiding leaves of the "last" animation- anims = ( ( o.times || 5 ) * 2 ) + ( showhide ? 1 : 0 ),- duration = o.duration / anims,- animateTo = 0,- queue = elem.queue(),- queuelen = queue.length,- i;-- if ( show || !elem.is(":visible")) {- elem.css( "opacity", 0 ).show();- animateTo = 1;- }-- // anims - 1 opacity "toggles"- for ( i = 1; i < anims; i++ ) {- elem.animate({- opacity: animateTo- }, duration, o.easing );- animateTo = 1 - animateTo;- }-- elem.animate({- opacity: animateTo- }, duration, o.easing);-- elem.queue(function() {- if ( hide ) {- elem.hide();- }- done();- });-- // We just queued up "anims" animations, we need to put them next in the queue- if ( queuelen > 1 ) {- queue.splice.apply( queue,- [ 1, 0 ].concat( queue.splice( queuelen, anims + 1 ) ) );- }- elem.dequeue();-};--})(jQuery);-(function( $, undefined ) {--$.effects.effect.puff = function( o, done ) {- var elem = $( this ),- mode = $.effects.setMode( elem, o.mode || "hide" ),- hide = mode === "hide",- percent = parseInt( o.percent, 10 ) || 150,- factor = percent / 100,- original = {- height: elem.height(),- width: elem.width()- };-- $.extend( o, {- effect: "scale",- queue: false,- fade: true,- mode: mode,- complete: done,- percent: hide ? percent : 100,- from: hide ?- original :- {- height: original.height * factor,- width: original.width * factor- }- });-- elem.effect( o );-};--$.effects.effect.scale = function( o, done ) {-- // Create element- var el = $( this ),- options = $.extend( true, {}, o ),- mode = $.effects.setMode( el, o.mode || "effect" ),- percent = parseInt( o.percent, 10 ) ||- ( parseInt( o.percent, 10 ) === 0 ? 0 : ( mode === "hide" ? 0 : 100 ) ),- direction = o.direction || "both",- origin = o.origin,- original = {- height: el.height(),- width: el.width(),- outerHeight: el.outerHeight(),- outerWidth: el.outerWidth()- },- factor = {- y: direction !== "horizontal" ? (percent / 100) : 1,- x: direction !== "vertical" ? (percent / 100) : 1- };-- // We are going to pass this effect to the size effect:- options.effect = "size";- options.queue = false;- options.complete = done;-- // Set default origin and restore for show/hide- if ( mode !== "effect" ) {- options.origin = origin || ["middle","center"];- options.restore = true;- }-- options.from = o.from || ( mode === "show" ? { height: 0, width: 0 } : original );- options.to = {- height: original.height * factor.y,- width: original.width * factor.x,- outerHeight: original.outerHeight * factor.y,- outerWidth: original.outerWidth * factor.x- };-- // Fade option to support puff- if ( options.fade ) {- if ( mode === "show" ) {- options.from.opacity = 0;- options.to.opacity = 1;- }- if ( mode === "hide" ) {- options.from.opacity = 1;- options.to.opacity = 0;- }- }-- // Animate- el.effect( options );--};--$.effects.effect.size = function( o, done ) {-- // Create element- var original, baseline, factor,- el = $( this ),- props0 = [ "position", "top", "bottom", "left", "right", "width", "height", "overflow", "opacity" ],-- // Always restore- props1 = [ "position", "top", "bottom", "left", "right", "overflow", "opacity" ],-- // Copy for children- props2 = [ "width", "height", "overflow" ],- cProps = [ "fontSize" ],- vProps = [ "borderTopWidth", "borderBottomWidth", "paddingTop", "paddingBottom" ],- hProps = [ "borderLeftWidth", "borderRightWidth", "paddingLeft", "paddingRight" ],-- // Set options- mode = $.effects.setMode( el, o.mode || "effect" ),- restore = o.restore || mode !== "effect",- scale = o.scale || "both",- origin = o.origin || [ "middle", "center" ],- position = el.css( "position" ),- props = restore ? props0 : props1,- zero = {- height: 0,- width: 0- };-- if ( mode === "show" ) {- el.show();- }- original = {- height: el.height(),- width: el.width(),- outerHeight: el.outerHeight(),- outerWidth: el.outerWidth()- };-- if ( o.mode === "toggle" && mode === "show" ) {- el.from = o.to || zero;- el.to = o.from || original;- } else {- el.from = o.from || ( mode === "show" ? zero : original );- el.to = o.to || ( mode === "hide" ? zero : original );- }-- // Set scaling factor- factor = {- from: {- y: el.from.height / original.height,- x: el.from.width / original.width- },- to: {- y: el.to.height / original.height,- x: el.to.width / original.width- }- };-- // Scale the css box- if ( scale === "box" || scale === "both" ) {-- // Vertical props scaling- if ( factor.from.y !== factor.to.y ) {- props = props.concat( vProps );- el.from = $.effects.setTransition( el, vProps, factor.from.y, el.from );- el.to = $.effects.setTransition( el, vProps, factor.to.y, el.to );- }-- // Horizontal props scaling- if ( factor.from.x !== factor.to.x ) {- props = props.concat( hProps );- el.from = $.effects.setTransition( el, hProps, factor.from.x, el.from );- el.to = $.effects.setTransition( el, hProps, factor.to.x, el.to );- }- }-- // Scale the content- if ( scale === "content" || scale === "both" ) {-- // Vertical props scaling- if ( factor.from.y !== factor.to.y ) {- props = props.concat( cProps ).concat( props2 );- el.from = $.effects.setTransition( el, cProps, factor.from.y, el.from );- el.to = $.effects.setTransition( el, cProps, factor.to.y, el.to );- }- }-- $.effects.save( el, props );- el.show();- $.effects.createWrapper( el );- el.css( "overflow", "hidden" ).css( el.from );-- // Adjust- if (origin) { // Calculate baseline shifts- baseline = $.effects.getBaseline( origin, original );- el.from.top = ( original.outerHeight - el.outerHeight() ) * baseline.y;- el.from.left = ( original.outerWidth - el.outerWidth() ) * baseline.x;- el.to.top = ( original.outerHeight - el.to.outerHeight ) * baseline.y;- el.to.left = ( original.outerWidth - el.to.outerWidth ) * baseline.x;- }- el.css( el.from ); // set top & left-- // Animate- if ( scale === "content" || scale === "both" ) { // Scale the children-- // Add margins/font-size- vProps = vProps.concat([ "marginTop", "marginBottom" ]).concat(cProps);- hProps = hProps.concat([ "marginLeft", "marginRight" ]);- props2 = props0.concat(vProps).concat(hProps);-- el.find( "*[width]" ).each( function(){- var child = $( this ),- c_original = {- height: child.height(),- width: child.width()- };- if (restore) {- $.effects.save(child, props2);- }-- child.from = {- height: c_original.height * factor.from.y,- width: c_original.width * factor.from.x- };- child.to = {- height: c_original.height * factor.to.y,- width: c_original.width * factor.to.x- };-- // Vertical props scaling- if ( factor.from.y !== factor.to.y ) {- child.from = $.effects.setTransition( child, vProps, factor.from.y, child.from );- child.to = $.effects.setTransition( child, vProps, factor.to.y, child.to );- }-- // Horizontal props scaling- if ( factor.from.x !== factor.to.x ) {- child.from = $.effects.setTransition( child, hProps, factor.from.x, child.from );- child.to = $.effects.setTransition( child, hProps, factor.to.x, child.to );- }-- // Animate children- child.css( child.from );- child.animate( child.to, o.duration, o.easing, function() {-- // Restore children- if ( restore ) {- $.effects.restore( child, props2 );- }- });- });- }-- // Animate- el.animate( el.to, {- queue: false,- duration: o.duration,- easing: o.easing,- complete: function() {- if ( el.to.opacity === 0 ) {- el.css( "opacity", el.from.opacity );- }- if( mode === "hide" ) {- el.hide();- }- $.effects.restore( el, props );- if ( !restore ) {-- // we need to calculate our new positioning based on the scaling- if ( position === "static" ) {- el.css({- position: "relative",- top: el.to.top,- left: el.to.left- });- } else {- $.each([ "top", "left" ], function( idx, pos ) {- el.css( pos, function( _, str ) {- var val = parseInt( str, 10 ),- toRef = idx ? el.to.left : el.to.top;-- // if original was "auto", recalculate the new value from wrapper- if ( str === "auto" ) {- return toRef + "px";- }-- return val + toRef + "px";- });- });- }- }-- $.effects.removeWrapper( el );- done();- }- });--};--})(jQuery);-(function( $, undefined ) {--$.effects.effect.shake = function( o, done ) {-- var el = $( this ),- props = [ "position", "top", "bottom", "left", "right", "height", "width" ],- mode = $.effects.setMode( el, o.mode || "effect" ),- direction = o.direction || "left",- distance = o.distance || 20,- times = o.times || 3,- anims = times * 2 + 1,- speed = Math.round(o.duration/anims),- ref = (direction === "up" || direction === "down") ? "top" : "left",- positiveMotion = (direction === "up" || direction === "left"),- animation = {},- animation1 = {},- animation2 = {},- i,-- // we will need to re-assemble the queue to stack our animations in place- queue = el.queue(),- queuelen = queue.length;-- $.effects.save( el, props );- el.show();- $.effects.createWrapper( el );-- // Animation- animation[ ref ] = ( positiveMotion ? "-=" : "+=" ) + distance;- animation1[ ref ] = ( positiveMotion ? "+=" : "-=" ) + distance * 2;- animation2[ ref ] = ( positiveMotion ? "-=" : "+=" ) + distance * 2;-- // Animate- el.animate( animation, speed, o.easing );-- // Shakes- for ( i = 1; i < times; i++ ) {- el.animate( animation1, speed, o.easing ).animate( animation2, speed, o.easing );- }- el- .animate( animation1, speed, o.easing )- .animate( animation, speed / 2, o.easing )- .queue(function() {- if ( mode === "hide" ) {- el.hide();- }- $.effects.restore( el, props );- $.effects.removeWrapper( el );- done();- });-- // inject all the animations we just queued to be first in line (after "inprogress")- if ( queuelen > 1) {- queue.splice.apply( queue,- [ 1, 0 ].concat( queue.splice( queuelen, anims + 1 ) ) );- }- el.dequeue();--};--})(jQuery);-(function( $, undefined ) {--$.effects.effect.slide = function( o, done ) {-- // Create element- var el = $( this ),- props = [ "position", "top", "bottom", "left", "right", "width", "height" ],- mode = $.effects.setMode( el, o.mode || "show" ),- show = mode === "show",- direction = o.direction || "left",- ref = (direction === "up" || direction === "down") ? "top" : "left",- positiveMotion = (direction === "up" || direction === "left"),- distance,- animation = {};-- // Adjust- $.effects.save( el, props );- el.show();- distance = o.distance || el[ ref === "top" ? "outerHeight" : "outerWidth" ]( true );-- $.effects.createWrapper( el ).css({- overflow: "hidden"- });-- if ( show ) {- el.css( ref, positiveMotion ? (isNaN(distance) ? "-" + distance : -distance) : distance );- }-- // Animation- animation[ ref ] = ( show ?- ( positiveMotion ? "+=" : "-=") :- ( positiveMotion ? "-=" : "+=")) +- distance;-- // Animate- el.animate( animation, {- queue: false,- duration: o.duration,- easing: o.easing,- complete: function() {- if ( mode === "hide" ) {- el.hide();- }- $.effects.restore( el, props );- $.effects.removeWrapper( el );- done();- }- });-};--})(jQuery);-(function( $, undefined ) {--$.effects.effect.transfer = function( o, done ) {- var elem = $( this ),- target = $( o.to ),- targetFixed = target.css( "position" ) === "fixed",- body = $("body"),- fixTop = targetFixed ? body.scrollTop() : 0,- fixLeft = targetFixed ? body.scrollLeft() : 0,- endPosition = target.offset(),- animation = {- top: endPosition.top - fixTop ,- left: endPosition.left - fixLeft ,- height: target.innerHeight(),- width: target.innerWidth()- },- startPosition = elem.offset(),- transfer = $( '<div class="ui-effects-transfer"></div>' )- .appendTo( document.body )- .addClass( o.className )- .css({- top: startPosition.top - fixTop ,- left: startPosition.left - fixLeft ,- height: elem.innerHeight(),- width: elem.innerWidth(),- position: targetFixed ? "fixed" : "absolute"- })- .animate( animation, o.duration, o.easing, function() {- transfer.remove();- done();- });-};--})(jQuery);diff --git a/data/libs/jquery/jquery-ui-1.9.1.custom.min.js b/data/libs/jquery/jquery-ui-1.9.1.custom.min.jsdeleted file mode 100644index 355964a9d..000000000--- a/data/libs/jquery/jquery-ui-1.9.1.custom.min.js+++ /dev/null@@ -1,6 +0,0 @@-/*! jQuery UI - v1.9.1 - 2012-11-15-* http://jqueryui.com-* Includes: jquery.ui.core.js, jquery.ui.widget.js, jquery.ui.mouse.js, jquery.ui.position.js, jquery.ui.draggable.js, jquery.ui.droppable.js, jquery.ui.resizable.js, jquery.ui.selectable.js, jquery.ui.sortable.js, jquery.ui.accordion.js, jquery.ui.autocomplete.js, jquery.ui.button.js, jquery.ui.datepicker.js, jquery.ui.dialog.js, jquery.ui.menu.js, jquery.ui.progressbar.js, jquery.ui.slider.js, jquery.ui.spinner.js, jquery.ui.tabs.js, jquery.ui.tooltip.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-* Copyright (c) 2012 jQuery Foundation and other contributors Licensed MIT */--(function(e,t){function i(t,n){var r,i,o,u=t.nodeName.toLowerCase();return"area"===u?(r=t.parentNode,i=r.name,!t.href||!i||r.nodeName.toLowerCase()!=="map"?!1:(o=e("img[usemap=#"+i+"]")[0],!!o&&s(o))):(/input|select|textarea|button|object/.test(u)?!t.disabled:"a"===u?t.href||n:n)&&s(t)}function s(t){return e.expr.filters.visible(t)&&!e(t).parents().andSelf().filter(function(){return e.css(this,"visibility")==="hidden"}).length}var n=0,r=/^ui-id-\d+$/;e.ui=e.ui||{};if(e.ui.version)return;e.extend(e.ui,{version:"1.9.1",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:e.fn.focus,focus:function(t,n){return typeof t=="number"?this.each(function(){var r=this;setTimeout(function(){e(r).focus(),n&&n.call(r)},t)}):this._focus.apply(this,arguments)},scrollParent:function(){var t;return e.ui.ie&&/(static|relative)/.test(this.css("position"))||/absolute/.test(this.css("position"))?t=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):t=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(n){if(n!==t)return this.css("zIndex",n);if(this.length){var r=e(this[0]),i,s;while(r.length&&r[0]!==document){i=r.css("position");if(i==="absolute"||i==="relative"||i==="fixed"){s=parseInt(r.css("zIndex"),10);if(!isNaN(s)&&s!==0)return s}r=r.parent()}}return 0},uniqueId:function(){return this.each(function(){this.id||(this.id="ui-id-"+ ++n)})},removeUniqueId:function(){return this.each(function(){r.test(this.id)&&e(this).removeAttr("id")})}}),e("<a>").outerWidth(1).jquery||e.each(["Width","Height"],function(n,r){function u(t,n,r,s){return e.each(i,function(){n-=parseFloat(e.css(t,"padding"+this))||0,r&&(n-=parseFloat(e.css(t,"border"+this+"Width"))||0),s&&(n-=parseFloat(e.css(t,"margin"+this))||0)}),n}var i=r==="Width"?["Left","Right"]:["Top","Bottom"],s=r.toLowerCase(),o={innerWidth:e.fn.innerWidth,innerHeight:e.fn.innerHeight,outerWidth:e.fn.outerWidth,outerHeight:e.fn.outerHeight};e.fn["inner"+r]=function(n){return n===t?o["inner"+r].call(this):this.each(function(){e(this).css(s,u(this,n)+"px")})},e.fn["outer"+r]=function(t,n){return typeof t!="number"?o["outer"+r].call(this,t):this.each(function(){e(this).css(s,u(this,t,!0,n)+"px")})}}),e.extend(e.expr[":"],{data:e.expr.createPseudo?e.expr.createPseudo(function(t){return function(n){return!!e.data(n,t)}}):function(t,n,r){return!!e.data(t,r[3])},focusable:function(t){return i(t,!isNaN(e.attr(t,"tabindex")))},tabbable:function(t){var n=e.attr(t,"tabindex"),r=isNaN(n);return(r||n>=0)&&i(t,!r)}}),e(function(){var t=document.body,n=t.appendChild(n=document.createElement("div"));n.offsetHeight,e.extend(n.style,{minHeight:"100px",height:"auto",padding:0,borderWidth:0}),e.support.minHeight=n.offsetHeight===100,e.support.selectstart="onselectstart"in n,t.removeChild(n).style.display="none"}),function(){var t=/msie ([\w.]+)/.exec(navigator.userAgent.toLowerCase())||[];e.ui.ie=t.length?!0:!1,e.ui.ie6=parseFloat(t[1],10)===6}(),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,n,r){var i,s=e.ui[t].prototype;for(i in r)s.plugins[i]=s.plugins[i]||[],s.plugins[i].push([n,r[i]])},call:function(e,t,n){var r,i=e.plugins[t];if(!i||!e.element[0].parentNode||e.element[0].parentNode.nodeType===11)return;for(r=0;r<i.length;r++)e.options[i[r][0]]&&i[r][1].apply(e.element,n)}},contains:e.contains,hasScroll:function(t,n){if(e(t).css("overflow")==="hidden")return!1;var r=n&&n==="left"?"scrollLeft":"scrollTop",i=!1;return t[r]>0?!0:(t[r]=1,i=t[r]>0,t[r]=0,i)},isOverAxis:function(e,t,n){return e>t&&e<t+n},isOver:function(t,n,r,i,s,o){return e.ui.isOverAxis(t,r,s)&&e.ui.isOverAxis(n,i,o)}})})(jQuery);(function(e,t){var n=0,r=Array.prototype.slice,i=e.cleanData;e.cleanData=function(t){for(var n=0,r;(r=t[n])!=null;n++)try{e(r).triggerHandler("remove")}catch(s){}i(t)},e.widget=function(t,n,r){var i,s,o,u,a=t.split(".")[0];t=t.split(".")[1],i=a+"-"+t,r||(r=n,n=e.Widget),e.expr[":"][i.toLowerCase()]=function(t){return!!e.data(t,i)},e[a]=e[a]||{},s=e[a][t],o=e[a][t]=function(e,t){if(!this._createWidget)return new o(e,t);arguments.length&&this._createWidget(e,t)},e.extend(o,s,{version:r.version,_proto:e.extend({},r),_childConstructors:[]}),u=new n,u.options=e.widget.extend({},u.options),e.each(r,function(t,i){e.isFunction(i)&&(r[t]=function(){var e=function(){return n.prototype[t].apply(this,arguments)},r=function(e){return n.prototype[t].apply(this,e)};return function(){var t=this._super,n=this._superApply,s;return this._super=e,this._superApply=r,s=i.apply(this,arguments),this._super=t,this._superApply=n,s}}())}),o.prototype=e.widget.extend(u,{widgetEventPrefix:u.widgetEventPrefix||t},r,{constructor:o,namespace:a,widgetName:t,widgetBaseClass:i,widgetFullName:i}),s?(e.each(s._childConstructors,function(t,n){var r=n.prototype;e.widget(r.namespace+"."+r.widgetName,o,n._proto)}),delete s._childConstructors):n._childConstructors.push(o),e.widget.bridge(t,o)},e.widget.extend=function(n){var i=r.call(arguments,1),s=0,o=i.length,u,a;for(;s<o;s++)for(u in i[s])a=i[s][u],i[s].hasOwnProperty(u)&&a!==t&&(e.isPlainObject(a)?n[u]=e.isPlainObject(n[u])?e.widget.extend({},n[u],a):e.widget.extend({},a):n[u]=a);return n},e.widget.bridge=function(n,i){var s=i.prototype.widgetFullName;e.fn[n]=function(o){var u=typeof o=="string",a=r.call(arguments,1),f=this;return o=!u&&a.length?e.widget.extend.apply(null,[o].concat(a)):o,u?this.each(function(){var r,i=e.data(this,s);if(!i)return e.error("cannot call methods on "+n+" prior to initialization; "+"attempted to call method '"+o+"'");if(!e.isFunction(i[o])||o.charAt(0)==="_")return e.error("no such method '"+o+"' for "+n+" widget instance");r=i[o].apply(i,a);if(r!==i&&r!==t)return f=r&&r.jquery?f.pushStack(r.get()):r,!1}):this.each(function(){var t=e.data(this,s);t?t.option(o||{})._init():new i(o,this)}),f}},e.Widget=function(){},e.Widget._childConstructors=[],e.Widget.prototype={widgetName:"widget",widgetEventPrefix:"",defaultElement:"<div>",options:{disabled:!1,create:null},_createWidget:function(t,r){r=e(r||this.defaultElement||this)[0],this.element=e(r),this.uuid=n++,this.eventNamespace="."+this.widgetName+this.uuid,this.options=e.widget.extend({},this.options,this._getCreateOptions(),t),this.bindings=e(),this.hoverable=e(),this.focusable=e(),r!==this&&(e.data(r,this.widgetName,this),e.data(r,this.widgetFullName,this),this._on(this.element,{remove:function(e){e.target===r&&this.destroy()}}),this.document=e(r.style?r.ownerDocument:r.document||r),this.window=e(this.document[0].defaultView||this.document[0].parentWindow)),this._create(),this._trigger("create",null,this._getCreateEventData()),this._init()},_getCreateOptions:e.noop,_getCreateEventData:e.noop,_create:e.noop,_init:e.noop,destroy:function(){this._destroy(),this.element.unbind(this.eventNamespace).removeData(this.widgetName).removeData(this.widgetFullName).removeData(e.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:e.noop,widget:function(){return this.element},option:function(n,r){var i=n,s,o,u;if(arguments.length===0)return e.widget.extend({},this.options);if(typeof n=="string"){i={},s=n.split("."),n=s.shift();if(s.length){o=i[n]=e.widget.extend({},this.options[n]);for(u=0;u<s.length-1;u++)o[s[u]]=o[s[u]]||{},o=o[s[u]];n=s.pop();if(r===t)return o[n]===t?null:o[n];o[n]=r}else{if(r===t)return this.options[n]===t?null:this.options[n];i[n]=r}}return this._setOptions(i),this},_setOptions:function(e){var t;for(t in e)this._setOption(t,e[t]);return this},_setOption:function(e,t){return this.options[e]=t,e==="disabled"&&(this.widget().toggleClass(this.widgetFullName+"-disabled ui-state-disabled",!!t).attr("aria-disabled",t),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(t,n){var r,i=this;n?(t=r=e(t),this.bindings=this.bindings.add(t)):(n=t,t=this.element,r=this.widget()),e.each(n,function(n,s){function o(){if(i.options.disabled===!0||e(this).hasClass("ui-state-disabled"))return;return(typeof s=="string"?i[s]:s).apply(i,arguments)}typeof s!="string"&&(o.guid=s.guid=s.guid||o.guid||e.guid++);var u=n.match(/^(\w+)\s*(.*)$/),a=u[1]+i.eventNamespace,f=u[2];f?r.delegate(f,a,o):t.bind(a,o)})},_off:function(e,t){t=(t||"").split(" ").join(this.eventNamespace+" ")+this.eventNamespace,e.unbind(t).undelegate(t)},_delay:function(e,t){function n(){return(typeof e=="string"?r[e]:e).apply(r,arguments)}var r=this;return setTimeout(n,t||0)},_hoverable:function(t){this.hoverable=this.hoverable.add(t),this._on(t,{mouseenter:function(t){e(t.currentTarget).addClass("ui-state-hover")},mouseleave:function(t){e(t.currentTarget).removeClass("ui-state-hover")}})},_focusable:function(t){this.focusable=this.focusable.add(t),this._on(t,{focusin:function(t){e(t.currentTarget).addClass("ui-state-focus")},focusout:function(t){e(t.currentTarget).removeClass("ui-state-focus")}})},_trigger:function(t,n,r){var i,s,o=this.options[t];r=r||{},n=e.Event(n),n.type=(t===this.widgetEventPrefix?t:this.widgetEventPrefix+t).toLowerCase(),n.target=this.element[0],s=n.originalEvent;if(s)for(i in s)i in n||(n[i]=s[i]);return this.element.trigger(n,r),!(e.isFunction(o)&&o.apply(this.element[0],[n].concat(r))===!1||n.isDefaultPrevented())}},e.each({show:"fadeIn",hide:"fadeOut"},function(t,n){e.Widget.prototype["_"+t]=function(r,i,s){typeof i=="string"&&(i={effect:i});var o,u=i?i===!0||typeof i=="number"?n:i.effect||n:t;i=i||{},typeof i=="number"&&(i={duration:i}),o=!e.isEmptyObject(i),i.complete=s,i.delay&&r.delay(i.delay),o&&e.effects&&(e.effects.effect[u]||e.uiBackCompat!==!1&&e.effects[u])?r[t](i):u!==t&&r[u]?r[u](i.duration,i.easing,s):r.queue(function(n){e(this)[t](),s&&s.call(r[0]),n()})}}),e.uiBackCompat!==!1&&(e.Widget.prototype._getCreateOptions=function(){return e.metadata&&e.metadata.get(this.element[0])[this.widgetName]})})(jQuery);(function(e,t){var n=!1;e(document).mouseup(function(e){n=!1}),e.widget("ui.mouse",{version:"1.9.1",options:{cancel:"input,textarea,button,select,option",distance:1,delay:0},_mouseInit:function(){var t=this;this.element.bind("mousedown."+this.widgetName,function(e){return t._mouseDown(e)}).bind("click."+this.widgetName,function(n){if(!0===e.data(n.target,t.widgetName+".preventClickEvent"))return e.removeData(n.target,t.widgetName+".preventClickEvent"),n.stopImmediatePropagation(),!1}),this.started=!1},_mouseDestroy:function(){this.element.unbind("."+this.widgetName),this._mouseMoveDelegate&&e(document).unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate)},_mouseDown:function(t){if(n)return;this._mouseStarted&&this._mouseUp(t),this._mouseDownEvent=t;var r=this,i=t.which===1,s=typeof this.options.cancel=="string"&&t.target.nodeName?e(t.target).closest(this.options.cancel).length:!1;if(!i||s||!this._mouseCapture(t))return!0;this.mouseDelayMet=!this.options.delay,this.mouseDelayMet||(this._mouseDelayTimer=setTimeout(function(){r.mouseDelayMet=!0},this.options.delay));if(this._mouseDistanceMet(t)&&this._mouseDelayMet(t)){this._mouseStarted=this._mouseStart(t)!==!1;if(!this._mouseStarted)return t.preventDefault(),!0}return!0===e.data(t.target,this.widgetName+".preventClickEvent")&&e.removeData(t.target,this.widgetName+".preventClickEvent"),this._mouseMoveDelegate=function(e){return r._mouseMove(e)},this._mouseUpDelegate=function(e){return r._mouseUp(e)},e(document).bind("mousemove."+this.widgetName,this._mouseMoveDelegate).bind("mouseup."+this.widgetName,this._mouseUpDelegate),t.preventDefault(),n=!0,!0},_mouseMove:function(t){return!e.ui.ie||document.documentMode>=9||!!t.button?this._mouseStarted?(this._mouseDrag(t),t.preventDefault()):(this._mouseDistanceMet(t)&&this._mouseDelayMet(t)&&(this._mouseStarted=this._mouseStart(this._mouseDownEvent,t)!==!1,this._mouseStarted?this._mouseDrag(t):this._mouseUp(t)),!this._mouseStarted):this._mouseUp(t)},_mouseUp:function(t){return e(document).unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate),this._mouseStarted&&(this._mouseStarted=!1,t.target===this._mouseDownEvent.target&&e.data(t.target,this.widgetName+".preventClickEvent",!0),this._mouseStop(t)),!1},_mouseDistanceMet:function(e){return Math.max(Math.abs(this._mouseDownEvent.pageX-e.pageX),Math.abs(this._mouseDownEvent.pageY-e.pageY))>=this.options.distance},_mouseDelayMet:function(e){return this.mouseDelayMet},_mouseStart:function(e){},_mouseDrag:function(e){},_mouseStop:function(e){},_mouseCapture:function(e){return!0}})})(jQuery);(function(e,t){function h(e,t,n){return[parseInt(e[0],10)*(l.test(e[0])?t/100:1),parseInt(e[1],10)*(l.test(e[1])?n/100:1)]}function p(t,n){return parseInt(e.css(t,n),10)||0}e.ui=e.ui||{};var n,r=Math.max,i=Math.abs,s=Math.round,o=/left|center|right/,u=/top|center|bottom/,a=/[\+\-]\d+%?/,f=/^\w+/,l=/%$/,c=e.fn.position;e.position={scrollbarWidth:function(){if(n!==t)return n;var r,i,s=e("<div style='display:block;width:50px;height:50px;overflow:hidden;'><div style='height:100px;width:auto;'></div></div>"),o=s.children()[0];return e("body").append(s),r=o.offsetWidth,s.css("overflow","scroll"),i=o.offsetWidth,r===i&&(i=s[0].clientWidth),s.remove(),n=r-i},getScrollInfo:function(t){var n=t.isWindow?"":t.element.css("overflow-x"),r=t.isWindow?"":t.element.css("overflow-y"),i=n==="scroll"||n==="auto"&&t.width<t.element[0].scrollWidth,s=r==="scroll"||r==="auto"&&t.height<t.element[0].scrollHeight;return{width:i?e.position.scrollbarWidth():0,height:s?e.position.scrollbarWidth():0}},getWithinInfo:function(t){var n=e(t||window),r=e.isWindow(n[0]);return{element:n,isWindow:r,offset:n.offset()||{left:0,top:0},scrollLeft:n.scrollLeft(),scrollTop:n.scrollTop(),width:r?n.width():n.outerWidth(),height:r?n.height():n.outerHeight()}}},e.fn.position=function(t){if(!t||!t.of)return c.apply(this,arguments);t=e.extend({},t);var n,l,d,v,m,g=e(t.of),y=e.position.getWithinInfo(t.within),b=e.position.getScrollInfo(y),w=g[0],E=(t.collision||"flip").split(" "),S={};return w.nodeType===9?(l=g.width(),d=g.height(),v={top:0,left:0}):e.isWindow(w)?(l=g.width(),d=g.height(),v={top:g.scrollTop(),left:g.scrollLeft()}):w.preventDefault?(t.at="left top",l=d=0,v={top:w.pageY,left:w.pageX}):(l=g.outerWidth(),d=g.outerHeight(),v=g.offset()),m=e.extend({},v),e.each(["my","at"],function(){var e=(t[this]||"").split(" "),n,r;e.length===1&&(e=o.test(e[0])?e.concat(["center"]):u.test(e[0])?["center"].concat(e):["center","center"]),e[0]=o.test(e[0])?e[0]:"center",e[1]=u.test(e[1])?e[1]:"center",n=a.exec(e[0]),r=a.exec(e[1]),S[this]=[n?n[0]:0,r?r[0]:0],t[this]=[f.exec(e[0])[0],f.exec(e[1])[0]]}),E.length===1&&(E[1]=E[0]),t.at[0]==="right"?m.left+=l:t.at[0]==="center"&&(m.left+=l/2),t.at[1]==="bottom"?m.top+=d:t.at[1]==="center"&&(m.top+=d/2),n=h(S.at,l,d),m.left+=n[0],m.top+=n[1],this.each(function(){var o,u,a=e(this),f=a.outerWidth(),c=a.outerHeight(),w=p(this,"marginLeft"),x=p(this,"marginTop"),T=f+w+p(this,"marginRight")+b.width,N=c+x+p(this,"marginBottom")+b.height,C=e.extend({},m),k=h(S.my,a.outerWidth(),a.outerHeight());t.my[0]==="right"?C.left-=f:t.my[0]==="center"&&(C.left-=f/2),t.my[1]==="bottom"?C.top-=c:t.my[1]==="center"&&(C.top-=c/2),C.left+=k[0],C.top+=k[1],e.support.offsetFractions||(C.left=s(C.left),C.top=s(C.top)),o={marginLeft:w,marginTop:x},e.each(["left","top"],function(r,i){e.ui.position[E[r]]&&e.ui.position[E[r]][i](C,{targetWidth:l,targetHeight:d,elemWidth:f,elemHeight:c,collisionPosition:o,collisionWidth:T,collisionHeight:N,offset:[n[0]+k[0],n[1]+k[1]],my:t.my,at:t.at,within:y,elem:a})}),e.fn.bgiframe&&a.bgiframe(),t.using&&(u=function(e){var n=v.left-C.left,s=n+l-f,o=v.top-C.top,u=o+d-c,h={target:{element:g,left:v.left,top:v.top,width:l,height:d},element:{element:a,left:C.left,top:C.top,width:f,height:c},horizontal:s<0?"left":n>0?"right":"center",vertical:u<0?"top":o>0?"bottom":"middle"};l<f&&i(n+s)<l&&(h.horizontal="center"),d<c&&i(o+u)<d&&(h.vertical="middle"),r(i(n),i(s))>r(i(o),i(u))?h.important="horizontal":h.important="vertical",t.using.call(this,e,h)}),a.offset(e.extend(C,{using:u}))})},e.ui.position={fit:{left:function(e,t){var n=t.within,i=n.isWindow?n.scrollLeft:n.offset.left,s=n.width,o=e.left-t.collisionPosition.marginLeft,u=i-o,a=o+t.collisionWidth-s-i,f;t.collisionWidth>s?u>0&&a<=0?(f=e.left+u+t.collisionWidth-s-i,e.left+=u-f):a>0&&u<=0?e.left=i:u>a?e.left=i+s-t.collisionWidth:e.left=i:u>0?e.left+=u:a>0?e.left-=a:e.left=r(e.left-o,e.left)},top:function(e,t){var n=t.within,i=n.isWindow?n.scrollTop:n.offset.top,s=t.within.height,o=e.top-t.collisionPosition.marginTop,u=i-o,a=o+t.collisionHeight-s-i,f;t.collisionHeight>s?u>0&&a<=0?(f=e.top+u+t.collisionHeight-s-i,e.top+=u-f):a>0&&u<=0?e.top=i:u>a?e.top=i+s-t.collisionHeight:e.top=i:u>0?e.top+=u:a>0?e.top-=a:e.top=r(e.top-o,e.top)}},flip:{left:function(e,t){var n=t.within,r=n.offset.left+n.scrollLeft,s=n.width,o=n.isWindow?n.scrollLeft:n.offset.left,u=e.left-t.collisionPosition.marginLeft,a=u-o,f=u+t.collisionWidth-s-o,l=t.my[0]==="left"?-t.elemWidth:t.my[0]==="right"?t.elemWidth:0,c=t.at[0]==="left"?t.targetWidth:t.at[0]==="right"?-t.targetWidth:0,h=-2*t.offset[0],p,d;if(a<0){p=e.left+l+c+h+t.collisionWidth-s-r;if(p<0||p<i(a))e.left+=l+c+h}else if(f>0){d=e.left-t.collisionPosition.marginLeft+l+c+h-o;if(d>0||i(d)<f)e.left+=l+c+h}},top:function(e,t){var n=t.within,r=n.offset.top+n.scrollTop,s=n.height,o=n.isWindow?n.scrollTop:n.offset.top,u=e.top-t.collisionPosition.marginTop,a=u-o,f=u+t.collisionHeight-s-o,l=t.my[1]==="top",c=l?-t.elemHeight:t.my[1]==="bottom"?t.elemHeight:0,h=t.at[1]==="top"?t.targetHeight:t.at[1]==="bottom"?-t.targetHeight:0,p=-2*t.offset[1],d,v;a<0?(v=e.top+c+h+p+t.collisionHeight-s-r,e.top+c+h+p>a&&(v<0||v<i(a))&&(e.top+=c+h+p)):f>0&&(d=e.top-t.collisionPosition.marginTop+c+h+p-o,e.top+c+h+p>f&&(d>0||i(d)<f)&&(e.top+=c+h+p))}},flipfit:{left:function(){e.ui.position.flip.left.apply(this,arguments),e.ui.position.fit.left.apply(this,arguments)},top:function(){e.ui.position.flip.top.apply(this,arguments),e.ui.position.fit.top.apply(this,arguments)}}},function(){var t,n,r,i,s,o=document.getElementsByTagName("body")[0],u=document.createElement("div");t=document.createElement(o?"div":"body"),r={visibility:"hidden",width:0,height:0,border:0,margin:0,background:"none"},o&&e.extend(r,{position:"absolute",left:"-1000px",top:"-1000px"});for(s in r)t.style[s]=r[s];t.appendChild(u),n=o||document.documentElement,n.insertBefore(t,n.firstChild),u.style.cssText="position: absolute; left: 10.7432222px;",i=e(u).offset().left,e.support.offsetFractions=i>10&&i<11,t.innerHTML="",n.removeChild(t)}(),e.uiBackCompat!==!1&&function(e){var n=e.fn.position;e.fn.position=function(r){if(!r||!r.offset)return n.call(this,r);var i=r.offset.split(" "),s=r.at.split(" ");return i.length===1&&(i[1]=i[0]),/^\d/.test(i[0])&&(i[0]="+"+i[0]),/^\d/.test(i[1])&&(i[1]="+"+i[1]),s.length===1&&(/left|center|right/.test(s[0])?s[1]="center":(s[1]=s[0],s[0]="center")),n.call(this,e.extend(r,{at:s[0]+i[0]+" "+s[1]+i[1],offset:t}))}}(jQuery)})(jQuery);(function(e,t){e.widget("ui.draggable",e.ui.mouse,{version:"1.9.1",widgetEventPrefix:"drag",options:{addClasses:!0,appendTo:"parent",axis:!1,connectToSortable:!1,containment:!1,cursor:"auto",cursorAt:!1,grid:!1,handle:!1,helper:"original",iframeFix:!1,opacity:!1,refreshPositions:!1,revert:!1,revertDuration:500,scope:"default",scroll:!0,scrollSensitivity:20,scrollSpeed:20,snap:!1,snapMode:"both",snapTolerance:20,stack:!1,zIndex:!1},_create:function(){this.options.helper=="original"&&!/^(?: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(t){var n=this.options;return this.helper||n.disabled||e(t.target).is(".ui-resizable-handle")?!1:(this.handle=this._getHandle(t),this.handle?(e(n.iframeFix===!0?"iframe":n.iframeFix).each(function(){e('<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(e(this).offset()).appendTo("body")}),!0):!1)},_mouseStart:function(t){var n=this.options;return this.helper=this._createHelper(t),this.helper.addClass("ui-draggable-dragging"),this._cacheHelperProportions(),e.ui.ddmanager&&(e.ui.ddmanager.current=this),this._cacheMargins(),this.cssPosition=this.helper.css("position"),this.scrollParent=this.helper.scrollParent(),this.offset=this.positionAbs=this.element.offset(),this.offset={top:this.offset.top-this.margins.top,left:this.offset.left-this.margins.left},e.extend(this.offset,{click:{left:t.pageX-this.offset.left,top:t.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()}),this.originalPosition=this.position=this._generatePosition(t),this.originalPageX=t.pageX,this.originalPageY=t.pageY,n.cursorAt&&this._adjustOffsetFromHelper(n.cursorAt),n.containment&&this._setContainment(),this._trigger("start",t)===!1?(this._clear(),!1):(this._cacheHelperProportions(),e.ui.ddmanager&&!n.dropBehaviour&&e.ui.ddmanager.prepareOffsets(this,t),this._mouseDrag(t,!0),e.ui.ddmanager&&e.ui.ddmanager.dragStart(this,t),!0)},_mouseDrag:function(t,n){this.position=this._generatePosition(t),this.positionAbs=this._convertPositionTo("absolute");if(!n){var r=this._uiHash();if(this._trigger("drag",t,r)===!1)return this._mouseUp({}),!1;this.position=r.position}if(!this.options.axis||this.options.axis!="y")this.helper[0].style.left=this.position.left+"px";if(!this.options.axis||this.options.axis!="x")this.helper[0].style.top=this.position.top+"px";return e.ui.ddmanager&&e.ui.ddmanager.drag(this,t),!1},_mouseStop:function(t){var n=!1;e.ui.ddmanager&&!this.options.dropBehaviour&&(n=e.ui.ddmanager.drop(this,t)),this.dropped&&(n=this.dropped,this.dropped=!1);var r=this.element[0],i=!1;while(r&&(r=r.parentNode))r==document&&(i=!0);if(!i&&this.options.helper==="original")return!1;if(this.options.revert=="invalid"&&!n||this.options.revert=="valid"&&n||this.options.revert===!0||e.isFunction(this.options.revert)&&this.options.revert.call(this.element,n)){var s=this;e(this.helper).animate(this.originalPosition,parseInt(this.options.revertDuration,10),function(){s._trigger("stop",t)!==!1&&s._clear()})}else this._trigger("stop",t)!==!1&&this._clear();return!1},_mouseUp:function(t){return e("div.ui-draggable-iframeFix").each(function(){this.parentNode.removeChild(this)}),e.ui.ddmanager&&e.ui.ddmanager.dragStop(this,t),e.ui.mouse.prototype._mouseUp.call(this,t)},cancel:function(){return this.helper.is(".ui-draggable-dragging")?this._mouseUp({}):this._clear(),this},_getHandle:function(t){var n=!this.options.handle||!e(this.options.handle,this.element).length?!0:!1;return e(this.options.handle,this.element).find("*").andSelf().each(function(){this==t.target&&(n=!0)}),n},_createHelper:function(t){var n=this.options,r=e.isFunction(n.helper)?e(n.helper.apply(this.element[0],[t])):n.helper=="clone"?this.element.clone().removeAttr("id"):this.element;return r.parents("body").length||r.appendTo(n.appendTo=="parent"?this.element[0].parentNode:n.appendTo),r[0]!=this.element[0]&&!/(fixed|absolute)/.test(r.css("position"))&&r.css("position","absolute"),r},_adjustOffsetFromHelper:function(t){typeof t=="string"&&(t=t.split(" ")),e.isArray(t)&&(t={left:+t[0],top:+t[1]||0}),"left"in t&&(this.offset.click.left=t.left+this.margins.left),"right"in t&&(this.offset.click.left=this.helperProportions.width-t.right+this.margins.left),"top"in t&&(this.offset.click.top=t.top+this.margins.top),"bottom"in t&&(this.offset.click.top=this.helperProportions.height-t.bottom+this.margins.top)},_getParentOffset:function(){this.offsetParent=this.helper.offsetParent();var t=this.offsetParent.offset();this.cssPosition=="absolute"&&this.scrollParent[0]!=document&&e.contains(this.scrollParent[0],this.offsetParent[0])&&(t.left+=this.scrollParent.scrollLeft(),t.top+=this.scrollParent.scrollTop());if(this.offsetParent[0]==document.body||this.offsetParent[0].tagName&&this.offsetParent[0].tagName.toLowerCase()=="html"&&e.ui.ie)t={top:0,left:0};return{top:t.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:t.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if(this.cssPosition=="relative"){var e=this.element.position();return{top:e.top-(parseInt(this.helper.css("top"),10)||0)+this.scrollParent.scrollTop(),left:e.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 t=this.options;t.containment=="parent"&&(t.containment=this.helper[0].parentNode);if(t.containment=="document"||t.containment=="window")this.containment=[t.containment=="document"?0:e(window).scrollLeft()-this.offset.relative.left-this.offset.parent.left,t.containment=="document"?0:e(window).scrollTop()-this.offset.relative.top-this.offset.parent.top,(t.containment=="document"?0:e(window).scrollLeft())+e(t.containment=="document"?document:window).width()-this.helperProportions.width-this.margins.left,(t.containment=="document"?0:e(window).scrollTop())+(e(t.containment=="document"?document:window).height()||document.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top];if(!/^(document|window|parent)$/.test(t.containment)&&t.containment.constructor!=Array){var n=e(t.containment),r=n[0];if(!r)return;var i=n.offset(),s=e(r).css("overflow")!="hidden";this.containment=[(parseInt(e(r).css("borderLeftWidth"),10)||0)+(parseInt(e(r).css("paddingLeft"),10)||0),(parseInt(e(r).css("borderTopWidth"),10)||0)+(parseInt(e(r).css("paddingTop"),10)||0),(s?Math.max(r.scrollWidth,r.offsetWidth):r.offsetWidth)-(parseInt(e(r).css("borderLeftWidth"),10)||0)-(parseInt(e(r).css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left-this.margins.right,(s?Math.max(r.scrollHeight,r.offsetHeight):r.offsetHeight)-(parseInt(e(r).css("borderTopWidth"),10)||0)-(parseInt(e(r).css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top-this.margins.bottom],this.relative_container=n}else t.containment.constructor==Array&&(this.containment=t.containment)},_convertPositionTo:function(t,n){n||(n=this.position);var r=t=="absolute"?1:-1,i=this.options,s=this.cssPosition!="absolute"||this.scrollParent[0]!=document&&!!e.contains(this.scrollParent[0],this.offsetParent[0])?this.scrollParent:this.offsetParent,o=/(html|body)/i.test(s[0].tagName);return{top:n.top+this.offset.relative.top*r+this.offset.parent.top*r-(this.cssPosition=="fixed"?-this.scrollParent.scrollTop():o?0:s.scrollTop())*r,left:n.left+this.offset.relative.left*r+this.offset.parent.left*r-(this.cssPosition=="fixed"?-this.scrollParent.scrollLeft():o?0:s.scrollLeft())*r}},_generatePosition:function(t){var n=this.options,r=this.cssPosition!="absolute"||this.scrollParent[0]!=document&&!!e.contains(this.scrollParent[0],this.offsetParent[0])?this.scrollParent:this.offsetParent,i=/(html|body)/i.test(r[0].tagName),s=t.pageX,o=t.pageY;if(this.originalPosition){var u;if(this.containment){if(this.relative_container){var a=this.relative_container.offset();u=[this.containment[0]+a.left,this.containment[1]+a.top,this.containment[2]+a.left,this.containment[3]+a.top]}else u=this.containment;t.pageX-this.offset.click.left<u[0]&&(s=u[0]+this.offset.click.left),t.pageY-this.offset.click.top<u[1]&&(o=u[1]+this.offset.click.top),t.pageX-this.offset.click.left>u[2]&&(s=u[2]+this.offset.click.left),t.pageY-this.offset.click.top>u[3]&&(o=u[3]+this.offset.click.top)}if(n.grid){var f=n.grid[1]?this.originalPageY+Math.round((o-this.originalPageY)/n.grid[1])*n.grid[1]:this.originalPageY;o=u?f-this.offset.click.top<u[1]||f-this.offset.click.top>u[3]?f-this.offset.click.top<u[1]?f+n.grid[1]:f-n.grid[1]:f:f;var l=n.grid[0]?this.originalPageX+Math.round((s-this.originalPageX)/n.grid[0])*n.grid[0]:this.originalPageX;s=u?l-this.offset.click.left<u[0]||l-this.offset.click.left>u[2]?l-this.offset.click.left<u[0]?l+n.grid[0]:l-n.grid[0]:l:l}}return{top:o-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+(this.cssPosition=="fixed"?-this.scrollParent.scrollTop():i?0:r.scrollTop()),left:s-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+(this.cssPosition=="fixed"?-this.scrollParent.scrollLeft():i?0:r.scrollLeft())}},_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(t,n,r){return r=r||this._uiHash(),e.ui.plugin.call(this,t,[n,r]),t=="drag"&&(this.positionAbs=this._convertPositionTo("absolute")),e.Widget.prototype._trigger.call(this,t,n,r)},plugins:{},_uiHash:function(e){return{helper:this.helper,position:this.position,originalPosition:this.originalPosition,offset:this.positionAbs}}}),e.ui.plugin.add("draggable","connectToSortable",{start:function(t,n){var r=e(this).data("draggable"),i=r.options,s=e.extend({},n,{item:r.element});r.sortables=[],e(i.connectToSortable).each(function(){var n=e.data(this,"sortable");n&&!n.options.disabled&&(r.sortables.push({instance:n,shouldRevert:n.options.revert}),n.refreshPositions(),n._trigger("activate",t,s))})},stop:function(t,n){var r=e(this).data("draggable"),i=e.extend({},n,{item:r.element});e.each(r.sortables,function(){this.instance.isOver?(this.instance.isOver=0,r.cancelHelperRemoval=!0,this.instance.cancelHelperRemoval=!1,this.shouldRevert&&(this.instance.options.revert=!0),this.instance._mouseStop(t),this.instance.options.helper=this.instance.options._helper,r.options.helper=="original"&&this.instance.currentItem.css({top:"auto",left:"auto"})):(this.instance.cancelHelperRemoval=!1,this.instance._trigger("deactivate",t,i))})},drag:function(t,n){var r=e(this).data("draggable"),i=this,s=function(t){var n=this.offset.click.top,r=this.offset.click.left,i=this.positionAbs.top,s=this.positionAbs.left,o=t.height,u=t.width,a=t.top,f=t.left;return e.ui.isOver(i+n,s+r,a,f,o,u)};e.each(r.sortables,function(s){var o=!1,u=this;this.instance.positionAbs=r.positionAbs,this.instance.helperProportions=r.helperProportions,this.instance.offset.click=r.offset.click,this.instance._intersectsWith(this.instance.containerCache)&&(o=!0,e.each(r.sortables,function(){return this.instance.positionAbs=r.positionAbs,this.instance.helperProportions=r.helperProportions,this.instance.offset.click=r.offset.click,this!=u&&this.instance._intersectsWith(this.instance.containerCache)&&e.ui.contains(u.instance.element[0],this.instance.element[0])&&(o=!1),o})),o?(this.instance.isOver||(this.instance.isOver=1,this.instance.currentItem=e(i).clone().removeAttr("id").appendTo(this.instance.element).data("sortable-item",!0),this.instance.options._helper=this.instance.options.helper,this.instance.options.helper=function(){return n.helper[0]},t.target=this.instance.currentItem[0],this.instance._mouseCapture(t,!0),this.instance._mouseStart(t,!0,!0),this.instance.offset.click.top=r.offset.click.top,this.instance.offset.click.left=r.offset.click.left,this.instance.offset.parent.left-=r.offset.parent.left-this.instance.offset.parent.left,this.instance.offset.parent.top-=r.offset.parent.top-this.instance.offset.parent.top,r._trigger("toSortable",t),r.dropped=this.instance.element,r.currentItem=r.element,this.instance.fromOutside=r),this.instance.currentItem&&this.instance._mouseDrag(t)):this.instance.isOver&&(this.instance.isOver=0,this.instance.cancelHelperRemoval=!0,this.instance.options.revert=!1,this.instance._trigger("out",t,this.instance._uiHash(this.instance)),this.instance._mouseStop(t,!0),this.instance.options.helper=this.instance.options._helper,this.instance.currentItem.remove(),this.instance.placeholder&&this.instance.placeholder.remove(),r._trigger("fromSortable",t),r.dropped=!1)})}}),e.ui.plugin.add("draggable","cursor",{start:function(t,n){var r=e("body"),i=e(this).data("draggable").options;r.css("cursor")&&(i._cursor=r.css("cursor")),r.css("cursor",i.cursor)},stop:function(t,n){var r=e(this).data("draggable").options;r._cursor&&e("body").css("cursor",r._cursor)}}),e.ui.plugin.add("draggable","opacity",{start:function(t,n){var r=e(n.helper),i=e(this).data("draggable").options;r.css("opacity")&&(i._opacity=r.css("opacity")),r.css("opacity",i.opacity)},stop:function(t,n){var r=e(this).data("draggable").options;r._opacity&&e(n.helper).css("opacity",r._opacity)}}),e.ui.plugin.add("draggable","scroll",{start:function(t,n){var r=e(this).data("draggable");r.scrollParent[0]!=document&&r.scrollParent[0].tagName!="HTML"&&(r.overflowOffset=r.scrollParent.offset())},drag:function(t,n){var r=e(this).data("draggable"),i=r.options,s=!1;if(r.scrollParent[0]!=document&&r.scrollParent[0].tagName!="HTML"){if(!i.axis||i.axis!="x")r.overflowOffset.top+r.scrollParent[0].offsetHeight-t.pageY<i.scrollSensitivity?r.scrollParent[0].scrollTop=s=r.scrollParent[0].scrollTop+i.scrollSpeed:t.pageY-r.overflowOffset.top<i.scrollSensitivity&&(r.scrollParent[0].scrollTop=s=r.scrollParent[0].scrollTop-i.scrollSpeed);if(!i.axis||i.axis!="y")r.overflowOffset.left+r.scrollParent[0].offsetWidth-t.pageX<i.scrollSensitivity?r.scrollParent[0].scrollLeft=s=r.scrollParent[0].scrollLeft+i.scrollSpeed:t.pageX-r.overflowOffset.left<i.scrollSensitivity&&(r.scrollParent[0].scrollLeft=s=r.scrollParent[0].scrollLeft-i.scrollSpeed)}else{if(!i.axis||i.axis!="x")t.pageY-e(document).scrollTop()<i.scrollSensitivity?s=e(document).scrollTop(e(document).scrollTop()-i.scrollSpeed):e(window).height()-(t.pageY-e(document).scrollTop())<i.scrollSensitivity&&(s=e(document).scrollTop(e(document).scrollTop()+i.scrollSpeed));if(!i.axis||i.axis!="y")t.pageX-e(document).scrollLeft()<i.scrollSensitivity?s=e(document).scrollLeft(e(document).scrollLeft()-i.scrollSpeed):e(window).width()-(t.pageX-e(document).scrollLeft())<i.scrollSensitivity&&(s=e(document).scrollLeft(e(document).scrollLeft()+i.scrollSpeed))}s!==!1&&e.ui.ddmanager&&!i.dropBehaviour&&e.ui.ddmanager.prepareOffsets(r,t)}}),e.ui.plugin.add("draggable","snap",{start:function(t,n){var r=e(this).data("draggable"),i=r.options;r.snapElements=[],e(i.snap.constructor!=String?i.snap.items||":data(draggable)":i.snap).each(function(){var t=e(this),n=t.offset();this!=r.element[0]&&r.snapElements.push({item:this,width:t.outerWidth(),height:t.outerHeight(),top:n.top,left:n.left})})},drag:function(t,n){var r=e(this).data("draggable"),i=r.options,s=i.snapTolerance,o=n.offset.left,u=o+r.helperProportions.width,a=n.offset.top,f=a+r.helperProportions.height;for(var l=r.snapElements.length-1;l>=0;l--){var c=r.snapElements[l].left,h=c+r.snapElements[l].width,p=r.snapElements[l].top,d=p+r.snapElements[l].height;if(!(c-s<o&&o<h+s&&p-s<a&&a<d+s||c-s<o&&o<h+s&&p-s<f&&f<d+s||c-s<u&&u<h+s&&p-s<a&&a<d+s||c-s<u&&u<h+s&&p-s<f&&f<d+s)){r.snapElements[l].snapping&&r.options.snap.release&&r.options.snap.release.call(r.element,t,e.extend(r._uiHash(),{snapItem:r.snapElements[l].item})),r.snapElements[l].snapping=!1;continue}if(i.snapMode!="inner"){var v=Math.abs(p-f)<=s,m=Math.abs(d-a)<=s,g=Math.abs(c-u)<=s,y=Math.abs(h-o)<=s;v&&(n.position.top=r._convertPositionTo("relative",{top:p-r.helperProportions.height,left:0}).top-r.margins.top),m&&(n.position.top=r._convertPositionTo("relative",{top:d,left:0}).top-r.margins.top),g&&(n.position.left=r._convertPositionTo("relative",{top:0,left:c-r.helperProportions.width}).left-r.margins.left),y&&(n.position.left=r._convertPositionTo("relative",{top:0,left:h}).left-r.margins.left)}var b=v||m||g||y;if(i.snapMode!="outer"){var v=Math.abs(p-a)<=s,m=Math.abs(d-f)<=s,g=Math.abs(c-o)<=s,y=Math.abs(h-u)<=s;v&&(n.position.top=r._convertPositionTo("relative",{top:p,left:0}).top-r.margins.top),m&&(n.position.top=r._convertPositionTo("relative",{top:d-r.helperProportions.height,left:0}).top-r.margins.top),g&&(n.position.left=r._convertPositionTo("relative",{top:0,left:c}).left-r.margins.left),y&&(n.position.left=r._convertPositionTo("relative",{top:0,left:h-r.helperProportions.width}).left-r.margins.left)}!r.snapElements[l].snapping&&(v||m||g||y||b)&&r.options.snap.snap&&r.options.snap.snap.call(r.element,t,e.extend(r._uiHash(),{snapItem:r.snapElements[l].item})),r.snapElements[l].snapping=v||m||g||y||b}}}),e.ui.plugin.add("draggable","stack",{start:function(t,n){var r=e(this).data("draggable").options,i=e.makeArray(e(r.stack)).sort(function(t,n){return(parseInt(e(t).css("zIndex"),10)||0)-(parseInt(e(n).css("zIndex"),10)||0)});if(!i.length)return;var s=parseInt(i[0].style.zIndex)||0;e(i).each(function(e){this.style.zIndex=s+e}),this[0].style.zIndex=s+i.length}}),e.ui.plugin.add("draggable","zIndex",{start:function(t,n){var r=e(n.helper),i=e(this).data("draggable").options;r.css("zIndex")&&(i._zIndex=r.css("zIndex")),r.css("zIndex",i.zIndex)},stop:function(t,n){var r=e(this).data("draggable").options;r._zIndex&&e(n.helper).css("zIndex",r._zIndex)}})})(jQuery);(function(e,t){e.widget("ui.droppable",{version:"1.9.1",widgetEventPrefix:"drop",options:{accept:"*",activeClass:!1,addClasses:!0,greedy:!1,hoverClass:!1,scope:"default",tolerance:"intersect"},_create:function(){var t=this.options,n=t.accept;this.isover=0,this.isout=1,this.accept=e.isFunction(n)?n:function(e){return e.is(n)},this.proportions={width:this.element[0].offsetWidth,height:this.element[0].offsetHeight},e.ui.ddmanager.droppables[t.scope]=e.ui.ddmanager.droppables[t.scope]||[],e.ui.ddmanager.droppables[t.scope].push(this),t.addClasses&&this.element.addClass("ui-droppable")},_destroy:function(){var t=e.ui.ddmanager.droppables[this.options.scope];for(var n=0;n<t.length;n++)t[n]==this&&t.splice(n,1);this.element.removeClass("ui-droppable ui-droppable-disabled")},_setOption:function(t,n){t=="accept"&&(this.accept=e.isFunction(n)?n:function(e){return e.is(n)}),e.Widget.prototype._setOption.apply(this,arguments)},_activate:function(t){var n=e.ui.ddmanager.current;this.options.activeClass&&this.element.addClass(this.options.activeClass),n&&this._trigger("activate",t,this.ui(n))},_deactivate:function(t){var n=e.ui.ddmanager.current;this.options.activeClass&&this.element.removeClass(this.options.activeClass),n&&this._trigger("deactivate",t,this.ui(n))},_over:function(t){var n=e.ui.ddmanager.current;if(!n||(n.currentItem||n.element)[0]==this.element[0])return;this.accept.call(this.element[0],n.currentItem||n.element)&&(this.options.hoverClass&&this.element.addClass(this.options.hoverClass),this._trigger("over",t,this.ui(n)))},_out:function(t){var n=e.ui.ddmanager.current;if(!n||(n.currentItem||n.element)[0]==this.element[0])return;this.accept.call(this.element[0],n.currentItem||n.element)&&(this.options.hoverClass&&this.element.removeClass(this.options.hoverClass),this._trigger("out",t,this.ui(n)))},_drop:function(t,n){var r=n||e.ui.ddmanager.current;if(!r||(r.currentItem||r.element)[0]==this.element[0])return!1;var i=!1;return this.element.find(":data(droppable)").not(".ui-draggable-dragging").each(function(){var t=e.data(this,"droppable");if(t.options.greedy&&!t.options.disabled&&t.options.scope==r.options.scope&&t.accept.call(t.element[0],r.currentItem||r.element)&&e.ui.intersect(r,e.extend(t,{offset:t.element.offset()}),t.options.tolerance))return i=!0,!1}),i?!1:this.accept.call(this.element[0],r.currentItem||r.element)?(this.options.activeClass&&this.element.removeClass(this.options.activeClass),this.options.hoverClass&&this.element.removeClass(this.options.hoverClass),this._trigger("drop",t,this.ui(r)),this.element):!1},ui:function(e){return{draggable:e.currentItem||e.element,helper:e.helper,position:e.position,offset:e.positionAbs}}}),e.ui.intersect=function(t,n,r){if(!n.offset)return!1;var i=(t.positionAbs||t.position.absolute).left,s=i+t.helperProportions.width,o=(t.positionAbs||t.position.absolute).top,u=o+t.helperProportions.height,a=n.offset.left,f=a+n.proportions.width,l=n.offset.top,c=l+n.proportions.height;switch(r){case"fit":return a<=i&&s<=f&&l<=o&&u<=c;case"intersect":return a<i+t.helperProportions.width/2&&s-t.helperProportions.width/2<f&&l<o+t.helperProportions.height/2&&u-t.helperProportions.height/2<c;case"pointer":var h=(t.positionAbs||t.position.absolute).left+(t.clickOffset||t.offset.click).left,p=(t.positionAbs||t.position.absolute).top+(t.clickOffset||t.offset.click).top,d=e.ui.isOver(p,h,l,a,n.proportions.height,n.proportions.width);return d;case"touch":return(o>=l&&o<=c||u>=l&&u<=c||o<l&&u>c)&&(i>=a&&i<=f||s>=a&&s<=f||i<a&&s>f);default:return!1}},e.ui.ddmanager={current:null,droppables:{"default":[]},prepareOffsets:function(t,n){var r=e.ui.ddmanager.droppables[t.options.scope]||[],i=n?n.type:null,s=(t.currentItem||t.element).find(":data(droppable)").andSelf();e:for(var o=0;o<r.length;o++){if(r[o].options.disabled||t&&!r[o].accept.call(r[o].element[0],t.currentItem||t.element))continue;for(var u=0;u<s.length;u++)if(s[u]==r[o].element[0]){r[o].proportions.height=0;continue e}r[o].visible=r[o].element.css("display")!="none";if(!r[o].visible)continue;i=="mousedown"&&r[o]._activate.call(r[o],n),r[o].offset=r[o].element.offset(),r[o].proportions={width:r[o].element[0].offsetWidth,height:r[o].element[0].offsetHeight}}},drop:function(t,n){var r=!1;return e.each(e.ui.ddmanager.droppables[t.options.scope]||[],function(){if(!this.options)return;!this.options.disabled&&this.visible&&e.ui.intersect(t,this,this.options.tolerance)&&(r=this._drop.call(this,n)||r),!this.options.disabled&&this.visible&&this.accept.call(this.element[0],t.currentItem||t.element)&&(this.isout=1,this.isover=0,this._deactivate.call(this,n))}),r},dragStart:function(t,n){t.element.parentsUntil("body").bind("scroll.droppable",function(){t.options.refreshPositions||e.ui.ddmanager.prepareOffsets(t,n)})},drag:function(t,n){t.options.refreshPositions&&e.ui.ddmanager.prepareOffsets(t,n),e.each(e.ui.ddmanager.droppables[t.options.scope]||[],function(){if(this.options.disabled||this.greedyChild||!this.visible)return;var r=e.ui.intersect(t,this,this.options.tolerance),i=!r&&this.isover==1?"isout":r&&this.isover==0?"isover":null;if(!i)return;var s;if(this.options.greedy){var o=this.options.scope,u=this.element.parents(":data(droppable)").filter(function(){return e.data(this,"droppable").options.scope===o});u.length&&(s=e.data(u[0],"droppable"),s.greedyChild=i=="isover"?1:0)}s&&i=="isover"&&(s.isover=0,s.isout=1,s._out.call(s,n)),this[i]=1,this[i=="isout"?"isover":"isout"]=0,this[i=="isover"?"_over":"_out"].call(this,n),s&&i=="isout"&&(s.isout=0,s.isover=1,s._over.call(s,n))})},dragStop:function(t,n){t.element.parentsUntil("body").unbind("scroll.droppable"),t.options.refreshPositions||e.ui.ddmanager.prepareOffsets(t,n)}}})(jQuery);(function(e,t){e.widget("ui.resizable",e.ui.mouse,{version:"1.9.1",widgetEventPrefix:"resize",options:{alsoResize:!1,animate:!1,animateDuration:"slow",animateEasing:"swing",aspectRatio:!1,autoHide:!1,containment:!1,ghost:!1,grid:!1,handles:"e,s,se",helper:!1,maxHeight:null,maxWidth:null,minHeight:10,minWidth:10,zIndex:1e3},_create:function(){var t=this,n=this.options;this.element.addClass("ui-resizable"),e.extend(this,{_aspectRatio:!!n.aspectRatio,aspectRatio:n.aspectRatio,originalElement:this.element,_proportionallyResizeElements:[],_helper:n.helper||n.ghost||n.animate?n.helper||"ui-resizable-helper":null}),this.element[0].nodeName.match(/canvas|textarea|input|select|button|img/i)&&(this.element.wrap(e('<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("resizable",this.element.data("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=n.handles||(e(".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");if(this.handles.constructor==String){this.handles=="all"&&(this.handles="n,e,s,w,se,sw,ne,nw");var r=this.handles.split(",");this.handles={};for(var i=0;i<r.length;i++){var s=e.trim(r[i]),o="ui-resizable-"+s,u=e('<div class="ui-resizable-handle '+o+'"></div>');u.css({zIndex:n.zIndex}),"se"==s&&u.addClass("ui-icon ui-icon-gripsmall-diagonal-se"),this.handles[s]=".ui-resizable-"+s,this.element.append(u)}}this._renderAxis=function(t){t=t||this.element;for(var n in this.handles){this.handles[n].constructor==String&&(this.handles[n]=e(this.handles[n],this.element).show());if(this.elementIsWrapper&&this.originalElement[0].nodeName.match(/textarea|input|select|button/i)){var r=e(this.handles[n],this.element),i=0;i=/sw|ne|nw|se|n|s/.test(n)?r.outerHeight():r.outerWidth();var s=["padding",/ne|nw|n/.test(n)?"Top":/se|sw|s/.test(n)?"Bottom":/^e$/.test(n)?"Right":"Left"].join("");t.css(s,i),this._proportionallyResize()}if(!e(this.handles[n]).length)continue}},this._renderAxis(this.element),this._handles=e(".ui-resizable-handle",this.element).disableSelection(),this._handles.mouseover(function(){if(!t.resizing){if(this.className)var e=this.className.match(/ui-resizable-(se|sw|ne|nw|n|e|s|w)/i);t.axis=e&&e[1]?e[1]:"se"}}),n.autoHide&&(this._handles.hide(),e(this.element).addClass("ui-resizable-autohide").mouseenter(function(){if(n.disabled)return;e(this).removeClass("ui-resizable-autohide"),t._handles.show()}).mouseleave(function(){if(n.disabled)return;t.resizing||(e(this).addClass("ui-resizable-autohide"),t._handles.hide())})),this._mouseInit()},_destroy:function(){this._mouseDestroy();var t=function(t){e(t).removeClass("ui-resizable ui-resizable-disabled ui-resizable-resizing").removeData("resizable").removeData("ui-resizable").unbind(".resizable").find(".ui-resizable-handle").remove()};if(this.elementIsWrapper){t(this.element);var n=this.element;this.originalElement.css({position:n.css("position"),width:n.outerWidth(),height:n.outerHeight(),top:n.css("top"),left:n.css("left")}).insertAfter(n),n.remove()}return this.originalElement.css("resize",this.originalResizeStyle),t(this.originalElement),this},_mouseCapture:function(t){var n=!1;for(var r in this.handles)e(this.handles[r])[0]==t.target&&(n=!0);return!this.options.disabled&&n},_mouseStart:function(t){var r=this.options,i=this.element.position(),s=this.element;this.resizing=!0,this.documentScroll={top:e(document).scrollTop(),left:e(document).scrollLeft()},(s.is(".ui-draggable")||/absolute/.test(s.css("position")))&&s.css({position:"absolute",top:i.top,left:i.left}),this._renderProxy();var o=n(this.helper.css("left")),u=n(this.helper.css("top"));r.containment&&(o+=e(r.containment).scrollLeft()||0,u+=e(r.containment).scrollTop()||0),this.offset=this.helper.offset(),this.position={left:o,top:u},this.size=this._helper?{width:s.outerWidth(),height:s.outerHeight()}:{width:s.width(),height:s.height()},this.originalSize=this._helper?{width:s.outerWidth(),height:s.outerHeight()}:{width:s.width(),height:s.height()},this.originalPosition={left:o,top:u},this.sizeDiff={width:s.outerWidth()-s.width(),height:s.outerHeight()-s.height()},this.originalMousePosition={left:t.pageX,top:t.pageY},this.aspectRatio=typeof r.aspectRatio=="number"?r.aspectRatio:this.originalSize.width/this.originalSize.height||1;var a=e(".ui-resizable-"+this.axis).css("cursor");return e("body").css("cursor",a=="auto"?this.axis+"-resize":a),s.addClass("ui-resizable-resizing"),this._propagate("start",t),!0},_mouseDrag:function(e){var t=this.helper,n=this.options,r={},i=this,s=this.originalMousePosition,o=this.axis,u=e.pageX-s.left||0,a=e.pageY-s.top||0,f=this._change[o];if(!f)return!1;var l=f.apply(this,[e,u,a]);this._updateVirtualBoundaries(e.shiftKey);if(this._aspectRatio||e.shiftKey)l=this._updateRatio(l,e);return l=this._respectSize(l,e),this._propagate("resize",e),t.css({top:this.position.top+"px",left:this.position.left+"px",width:this.size.width+"px",height:this.size.height+"px"}),!this._helper&&this._proportionallyResizeElements.length&&this._proportionallyResize(),this._updateCache(l),this._trigger("resize",e,this.ui()),!1},_mouseStop:function(t){this.resizing=!1;var n=this.options,r=this;if(this._helper){var i=this._proportionallyResizeElements,s=i.length&&/textarea/i.test(i[0].nodeName),o=s&&e.ui.hasScroll(i[0],"left")?0:r.sizeDiff.height,u=s?0:r.sizeDiff.width,a={width:r.helper.width()-u,height:r.helper.height()-o},f=parseInt(r.element.css("left"),10)+(r.position.left-r.originalPosition.left)||null,l=parseInt(r.element.css("top"),10)+(r.position.top-r.originalPosition.top)||null;n.animate||this.element.css(e.extend(a,{top:l,left:f})),r.helper.height(r.size.height),r.helper.width(r.size.width),this._helper&&!n.animate&&this._proportionallyResize()}return e("body").css("cursor","auto"),this.element.removeClass("ui-resizable-resizing"),this._propagate("stop",t),this._helper&&this.helper.remove(),!1},_updateVirtualBoundaries:function(e){var t=this.options,n,i,s,o,u;u={minWidth:r(t.minWidth)?t.minWidth:0,maxWidth:r(t.maxWidth)?t.maxWidth:Infinity,minHeight:r(t.minHeight)?t.minHeight:0,maxHeight:r(t.maxHeight)?t.maxHeight:Infinity};if(this._aspectRatio||e)n=u.minHeight*this.aspectRatio,s=u.minWidth/this.aspectRatio,i=u.maxHeight*this.aspectRatio,o=u.maxWidth/this.aspectRatio,n>u.minWidth&&(u.minWidth=n),s>u.minHeight&&(u.minHeight=s),i<u.maxWidth&&(u.maxWidth=i),o<u.maxHeight&&(u.maxHeight=o);this._vBoundaries=u},_updateCache:function(e){var t=this.options;this.offset=this.helper.offset(),r(e.left)&&(this.position.left=e.left),r(e.top)&&(this.position.top=e.top),r(e.height)&&(this.size.height=e.height),r(e.width)&&(this.size.width=e.width)},_updateRatio:function(e,t){var n=this.options,i=this.position,s=this.size,o=this.axis;return r(e.height)?e.width=e.height*this.aspectRatio:r(e.width)&&(e.height=e.width/this.aspectRatio),o=="sw"&&(e.left=i.left+(s.width-e.width),e.top=null),o=="nw"&&(e.top=i.top+(s.height-e.height),e.left=i.left+(s.width-e.width)),e},_respectSize:function(e,t){var n=this.helper,i=this._vBoundaries,s=this._aspectRatio||t.shiftKey,o=this.axis,u=r(e.width)&&i.maxWidth&&i.maxWidth<e.width,a=r(e.height)&&i.maxHeight&&i.maxHeight<e.height,f=r(e.width)&&i.minWidth&&i.minWidth>e.width,l=r(e.height)&&i.minHeight&&i.minHeight>e.height;f&&(e.width=i.minWidth),l&&(e.height=i.minHeight),u&&(e.width=i.maxWidth),a&&(e.height=i.maxHeight);var c=this.originalPosition.left+this.originalSize.width,h=this.position.top+this.size.height,p=/sw|nw|w/.test(o),d=/nw|ne|n/.test(o);f&&p&&(e.left=c-i.minWidth),u&&p&&(e.left=c-i.maxWidth),l&&d&&(e.top=h-i.minHeight),a&&d&&(e.top=h-i.maxHeight);var v=!e.width&&!e.height;return v&&!e.left&&e.top?e.top=null:v&&!e.top&&e.left&&(e.left=null),e},_proportionallyResize:function(){var t=this.options;if(!this._proportionallyResizeElements.length)return;var n=this.helper||this.element;for(var r=0;r<this._proportionallyResizeElements.length;r++){var i=this._proportionallyResizeElements[r];if(!this.borderDif){var s=[i.css("borderTopWidth"),i.css("borderRightWidth"),i.css("borderBottomWidth"),i.css("borderLeftWidth")],o=[i.css("paddingTop"),i.css("paddingRight"),i.css("paddingBottom"),i.css("paddingLeft")];this.borderDif=e.map(s,function(e,t){var n=parseInt(e,10)||0,r=parseInt(o[t],10)||0;return n+r})}i.css({height:n.height()-this.borderDif[0]-this.borderDif[2]||0,width:n.width()-this.borderDif[1]-this.borderDif[3]||0})}},_renderProxy:function(){var t=this.element,n=this.options;this.elementOffset=t.offset();if(this._helper){this.helper=this.helper||e('<div style="overflow:hidden;"></div>');var r=e.ui.ie6?1:0,i=e.ui.ie6?2:-1;this.helper.addClass(this._helper).css({width:this.element.outerWidth()+i,height:this.element.outerHeight()+i,position:"absolute",left:this.elementOffset.left-r+"px",top:this.elementOffset.top-r+"px",zIndex:++n.zIndex}),this.helper.appendTo("body").disableSelection()}else this.helper=this.element},_change:{e:function(e,t,n){return{width:this.originalSize.width+t}},w:function(e,t,n){var r=this.options,i=this.originalSize,s=this.originalPosition;return{left:s.left+t,width:i.width-t}},n:function(e,t,n){var r=this.options,i=this.originalSize,s=this.originalPosition;return{top:s.top+n,height:i.height-n}},s:function(e,t,n){return{height:this.originalSize.height+n}},se:function(t,n,r){return e.extend(this._change.s.apply(this,arguments),this._change.e.apply(this,[t,n,r]))},sw:function(t,n,r){return e.extend(this._change.s.apply(this,arguments),this._change.w.apply(this,[t,n,r]))},ne:function(t,n,r){return e.extend(this._change.n.apply(this,arguments),this._change.e.apply(this,[t,n,r]))},nw:function(t,n,r){return e.extend(this._change.n.apply(this,arguments),this._change.w.apply(this,[t,n,r]))}},_propagate:function(t,n){e.ui.plugin.call(this,t,[n,this.ui()]),t!="resize"&&this._trigger(t,n,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}}}),e.ui.plugin.add("resizable","alsoResize",{start:function(t,n){var r=e(this).data("resizable"),i=r.options,s=function(t){e(t).each(function(){var t=e(this);t.data("resizable-alsoresize",{width:parseInt(t.width(),10),height:parseInt(t.height(),10),left:parseInt(t.css("left"),10),top:parseInt(t.css("top"),10)})})};typeof i.alsoResize=="object"&&!i.alsoResize.parentNode?i.alsoResize.length?(i.alsoResize=i.alsoResize[0],s(i.alsoResize)):e.each(i.alsoResize,function(e){s(e)}):s(i.alsoResize)},resize:function(t,n){var r=e(this).data("resizable"),i=r.options,s=r.originalSize,o=r.originalPosition,u={height:r.size.height-s.height||0,width:r.size.width-s.width||0,top:r.position.top-o.top||0,left:r.position.left-o.left||0},a=function(t,r){e(t).each(function(){var t=e(this),i=e(this).data("resizable-alsoresize"),s={},o=r&&r.length?r:t.parents(n.originalElement[0]).length?["width","height"]:["width","height","top","left"];e.each(o,function(e,t){var n=(i[t]||0)+(u[t]||0);n&&n>=0&&(s[t]=n||null)}),t.css(s)})};typeof i.alsoResize=="object"&&!i.alsoResize.nodeType?e.each(i.alsoResize,function(e,t){a(e,t)}):a(i.alsoResize)},stop:function(t,n){e(this).removeData("resizable-alsoresize")}}),e.ui.plugin.add("resizable","animate",{stop:function(t,n){var r=e(this).data("resizable"),i=r.options,s=r._proportionallyResizeElements,o=s.length&&/textarea/i.test(s[0].nodeName),u=o&&e.ui.hasScroll(s[0],"left")?0:r.sizeDiff.height,a=o?0:r.sizeDiff.width,f={width:r.size.width-a,height:r.size.height-u},l=parseInt(r.element.css("left"),10)+(r.position.left-r.originalPosition.left)||null,c=parseInt(r.element.css("top"),10)+(r.position.top-r.originalPosition.top)||null;r.element.animate(e.extend(f,c&&l?{top:c,left:l}:{}),{duration:i.animateDuration,easing:i.animateEasing,step:function(){var n={width:parseInt(r.element.css("width"),10),height:parseInt(r.element.css("height"),10),top:parseInt(r.element.css("top"),10),left:parseInt(r.element.css("left"),10)};s&&s.length&&e(s[0]).css({width:n.width,height:n.height}),r._updateCache(n),r._propagate("resize",t)}})}}),e.ui.plugin.add("resizable","containment",{start:function(t,r){var i=e(this).data("resizable"),s=i.options,o=i.element,u=s.containment,a=u instanceof e?u.get(0):/parent/.test(u)?o.parent().get(0):u;if(!a)return;i.containerElement=e(a);if(/document/.test(u)||u==document)i.containerOffset={left:0,top:0},i.containerPosition={left:0,top:0},i.parentData={element:e(document),left:0,top:0,width:e(document).width(),height:e(document).height()||document.body.parentNode.scrollHeight};else{var f=e(a),l=[];e(["Top","Right","Left","Bottom"]).each(function(e,t){l[e]=n(f.css("padding"+t))}),i.containerOffset=f.offset(),i.containerPosition=f.position(),i.containerSize={height:f.innerHeight()-l[3],width:f.innerWidth()-l[1]};var c=i.containerOffset,h=i.containerSize.height,p=i.containerSize.width,d=e.ui.hasScroll(a,"left")?a.scrollWidth:p,v=e.ui.hasScroll(a)?a.scrollHeight:h;i.parentData={element:a,left:c.left,top:c.top,width:d,height:v}}},resize:function(t,n){var r=e(this).data("resizable"),i=r.options,s=r.containerSize,o=r.containerOffset,u=r.size,a=r.position,f=r._aspectRatio||t.shiftKey,l={top:0,left:0},c=r.containerElement;c[0]!=document&&/static/.test(c.css("position"))&&(l=o),a.left<(r._helper?o.left:0)&&(r.size.width=r.size.width+(r._helper?r.position.left-o.left:r.position.left-l.left),f&&(r.size.height=r.size.width/r.aspectRatio),r.position.left=i.helper?o.left:0),a.top<(r._helper?o.top:0)&&(r.size.height=r.size.height+(r._helper?r.position.top-o.top:r.position.top),f&&(r.size.width=r.size.height*r.aspectRatio),r.position.top=r._helper?o.top:0),r.offset.left=r.parentData.left+r.position.left,r.offset.top=r.parentData.top+r.position.top;var h=Math.abs((r._helper?r.offset.left-l.left:r.offset.left-l.left)+r.sizeDiff.width),p=Math.abs((r._helper?r.offset.top-l.top:r.offset.top-o.top)+r.sizeDiff.height),d=r.containerElement.get(0)==r.element.parent().get(0),v=/relative|absolute/.test(r.containerElement.css("position"));d&&v&&(h-=r.parentData.left),h+r.size.width>=r.parentData.width&&(r.size.width=r.parentData.width-h,f&&(r.size.height=r.size.width/r.aspectRatio)),p+r.size.height>=r.parentData.height&&(r.size.height=r.parentData.height-p,f&&(r.size.width=r.size.height*r.aspectRatio))},stop:function(t,n){var r=e(this).data("resizable"),i=r.options,s=r.position,o=r.containerOffset,u=r.containerPosition,a=r.containerElement,f=e(r.helper),l=f.offset(),c=f.outerWidth()-r.sizeDiff.width,h=f.outerHeight()-r.sizeDiff.height;r._helper&&!i.animate&&/relative/.test(a.css("position"))&&e(this).css({left:l.left-u.left-o.left,width:c,height:h}),r._helper&&!i.animate&&/static/.test(a.css("position"))&&e(this).css({left:l.left-u.left-o.left,width:c,height:h})}}),e.ui.plugin.add("resizable","ghost",{start:function(t,n){var r=e(this).data("resizable"),i=r.options,s=r.size;r.ghost=r.originalElement.clone(),r.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(typeof i.ghost=="string"?i.ghost:""),r.ghost.appendTo(r.helper)},resize:function(t,n){var r=e(this).data("resizable"),i=r.options;r.ghost&&r.ghost.css({position:"relative",height:r.size.height,width:r.size.width})},stop:function(t,n){var r=e(this).data("resizable"),i=r.options;r.ghost&&r.helper&&r.helper.get(0).removeChild(r.ghost.get(0))}}),e.ui.plugin.add("resizable","grid",{resize:function(t,n){var r=e(this).data("resizable"),i=r.options,s=r.size,o=r.originalSize,u=r.originalPosition,a=r.axis,f=i._aspectRatio||t.shiftKey;i.grid=typeof i.grid=="number"?[i.grid,i.grid]:i.grid;var l=Math.round((s.width-o.width)/(i.grid[0]||1))*(i.grid[0]||1),c=Math.round((s.height-o.height)/(i.grid[1]||1))*(i.grid[1]||1);/^(se|s|e)$/.test(a)?(r.size.width=o.width+l,r.size.height=o.height+c):/^(ne)$/.test(a)?(r.size.width=o.width+l,r.size.height=o.height+c,r.position.top=u.top-c):/^(sw)$/.test(a)?(r.size.width=o.width+l,r.size.height=o.height+c,r.position.left=u.left-l):(r.size.width=o.width+l,r.size.height=o.height+c,r.position.top=u.top-c,r.position.left=u.left-l)}});var n=function(e){return parseInt(e,10)||0},r=function(e){return!isNaN(parseInt(e,10))}})(jQuery);(function(e,t){e.widget("ui.selectable",e.ui.mouse,{version:"1.9.1",options:{appendTo:"body",autoRefresh:!0,distance:0,filter:"*",tolerance:"touch"},_create:function(){var t=this;this.element.addClass("ui-selectable"),this.dragged=!1;var n;this.refresh=function(){n=e(t.options.filter,t.element[0]),n.addClass("ui-selectee"),n.each(function(){var t=e(this),n=t.offset();e.data(this,"selectable-item",{element:this,$element:t,left:n.left,top:n.top,right:n.left+t.outerWidth(),bottom:n.top+t.outerHeight(),startselected:!1,selected:t.hasClass("ui-selected"),selecting:t.hasClass("ui-selecting"),unselecting:t.hasClass("ui-unselecting")})})},this.refresh(),this.selectees=n.addClass("ui-selectee"),this._mouseInit(),this.helper=e("<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(t){var n=this;this.opos=[t.pageX,t.pageY];if(this.options.disabled)return;var r=this.options;this.selectees=e(r.filter,this.element[0]),this._trigger("start",t),e(r.appendTo).append(this.helper),this.helper.css({left:t.clientX,top:t.clientY,width:0,height:0}),r.autoRefresh&&this.refresh(),this.selectees.filter(".ui-selected").each(function(){var r=e.data(this,"selectable-item");r.startselected=!0,!t.metaKey&&!t.ctrlKey&&(r.$element.removeClass("ui-selected"),r.selected=!1,r.$element.addClass("ui-unselecting"),r.unselecting=!0,n._trigger("unselecting",t,{unselecting:r.element}))}),e(t.target).parents().andSelf().each(function(){var r=e.data(this,"selectable-item");if(r){var i=!t.metaKey&&!t.ctrlKey||!r.$element.hasClass("ui-selected");return r.$element.removeClass(i?"ui-unselecting":"ui-selected").addClass(i?"ui-selecting":"ui-unselecting"),r.unselecting=!i,r.selecting=i,r.selected=i,i?n._trigger("selecting",t,{selecting:r.element}):n._trigger("unselecting",t,{unselecting:r.element}),!1}})},_mouseDrag:function(t){var n=this;this.dragged=!0;if(this.options.disabled)return;var r=this.options,i=this.opos[0],s=this.opos[1],o=t.pageX,u=t.pageY;if(i>o){var a=o;o=i,i=a}if(s>u){var a=u;u=s,s=a}return this.helper.css({left:i,top:s,width:o-i,height:u-s}),this.selectees.each(function(){var a=e.data(this,"selectable-item");if(!a||a.element==n.element[0])return;var f=!1;r.tolerance=="touch"?f=!(a.left>o||a.right<i||a.top>u||a.bottom<s):r.tolerance=="fit"&&(f=a.left>i&&a.right<o&&a.top>s&&a.bottom<u),f?(a.selected&&(a.$element.removeClass("ui-selected"),a.selected=!1),a.unselecting&&(a.$element.removeClass("ui-unselecting"),a.unselecting=!1),a.selecting||(a.$element.addClass("ui-selecting"),a.selecting=!0,n._trigger("selecting",t,{selecting:a.element}))):(a.selecting&&((t.metaKey||t.ctrlKey)&&a.startselected?(a.$element.removeClass("ui-selecting"),a.selecting=!1,a.$element.addClass("ui-selected"),a.selected=!0):(a.$element.removeClass("ui-selecting"),a.selecting=!1,a.startselected&&(a.$element.addClass("ui-unselecting"),a.unselecting=!0),n._trigger("unselecting",t,{unselecting:a.element}))),a.selected&&!t.metaKey&&!t.ctrlKey&&!a.startselected&&(a.$element.removeClass("ui-selected"),a.selected=!1,a.$element.addClass("ui-unselecting"),a.unselecting=!0,n._trigger("unselecting",t,{unselecting:a.element})))}),!1},_mouseStop:function(t){var n=this;this.dragged=!1;var r=this.options;return e(".ui-unselecting",this.element[0]).each(function(){var r=e.data(this,"selectable-item");r.$element.removeClass("ui-unselecting"),r.unselecting=!1,r.startselected=!1,n._trigger("unselected",t,{unselected:r.element})}),e(".ui-selecting",this.element[0]).each(function(){var r=e.data(this,"selectable-item");r.$element.removeClass("ui-selecting").addClass("ui-selected"),r.selecting=!1,r.selected=!0,r.startselected=!0,n._trigger("selected",t,{selected:r.element})}),this._trigger("stop",t),this.helper.remove(),!1}})})(jQuery);(function(e,t){e.widget("ui.sortable",e.ui.mouse,{version:"1.9.1",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},_create:function(){var e=this.options;this.containerCache={},this.element.addClass("ui-sortable"),this.refresh(),this.floating=this.items.length?e.axis==="x"||/left|right/.test(this.items[0].item.css("float"))||/inline|table-cell/.test(this.items[0].item.css("display")):!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 e=this.items.length-1;e>=0;e--)this.items[e].item.removeData(this.widgetName+"-item");return this},_setOption:function(t,n){t==="disabled"?(this.options[t]=n,this.widget().toggleClass("ui-sortable-disabled",!!n)):e.Widget.prototype._setOption.apply(this,arguments)},_mouseCapture:function(t,n){var r=this;if(this.reverting)return!1;if(this.options.disabled||this.options.type=="static")return!1;this._refreshItems(t);var i=null,s=e(t.target).parents().each(function(){if(e.data(this,r.widgetName+"-item")==r)return i=e(this),!1});e.data(t.target,r.widgetName+"-item")==r&&(i=e(t.target));if(!i)return!1;if(this.options.handle&&!n){var o=!1;e(this.options.handle,i).find("*").andSelf().each(function(){this==t.target&&(o=!0)});if(!o)return!1}return this.currentItem=i,this._removeCurrentsFromItems(),!0},_mouseStart:function(t,n,r){var i=this.options;this.currentContainer=this,this.refreshPositions(),this.helper=this._createHelper(t),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},e.extend(this.offset,{click:{left:t.pageX-this.offset.left,top:t.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(t),this.originalPageX=t.pageX,this.originalPageY=t.pageY,i.cursorAt&&this._adjustOffsetFromHelper(i.cursorAt),this.domPosition={prev:this.currentItem.prev()[0],parent:this.currentItem.parent()[0]},this.helper[0]!=this.currentItem[0]&&this.currentItem.hide(),this._createPlaceholder(),i.containment&&this._setContainment(),i.cursor&&(e("body").css("cursor")&&(this._storedCursor=e("body").css("cursor")),e("body").css("cursor",i.cursor)),i.opacity&&(this.helper.css("opacity")&&(this._storedOpacity=this.helper.css("opacity")),this.helper.css("opacity",i.opacity)),i.zIndex&&(this.helper.css("zIndex")&&(this._storedZIndex=this.helper.css("zIndex")),this.helper.css("zIndex",i.zIndex)),this.scrollParent[0]!=document&&this.scrollParent[0].tagName!="HTML"&&(this.overflowOffset=this.scrollParent.offset()),this._trigger("start",t,this._uiHash()),this._preserveHelperProportions||this._cacheHelperProportions();if(!r)for(var s=this.containers.length-1;s>=0;s--)this.containers[s]._trigger("activate",t,this._uiHash(this));return e.ui.ddmanager&&(e.ui.ddmanager.current=this),e.ui.ddmanager&&!i.dropBehaviour&&e.ui.ddmanager.prepareOffsets(this,t),this.dragging=!0,this.helper.addClass("ui-sortable-helper"),this._mouseDrag(t),!0},_mouseDrag:function(t){this.position=this._generatePosition(t),this.positionAbs=this._convertPositionTo("absolute"),this.lastPositionAbs||(this.lastPositionAbs=this.positionAbs);if(this.options.scroll){var n=this.options,r=!1;this.scrollParent[0]!=document&&this.scrollParent[0].tagName!="HTML"?(this.overflowOffset.top+this.scrollParent[0].offsetHeight-t.pageY<n.scrollSensitivity?this.scrollParent[0].scrollTop=r=this.scrollParent[0].scrollTop+n.scrollSpeed:t.pageY-this.overflowOffset.top<n.scrollSensitivity&&(this.scrollParent[0].scrollTop=r=this.scrollParent[0].scrollTop-n.scrollSpeed),this.overflowOffset.left+this.scrollParent[0].offsetWidth-t.pageX<n.scrollSensitivity?this.scrollParent[0].scrollLeft=r=this.scrollParent[0].scrollLeft+n.scrollSpeed:t.pageX-this.overflowOffset.left<n.scrollSensitivity&&(this.scrollParent[0].scrollLeft=r=this.scrollParent[0].scrollLeft-n.scrollSpeed)):(t.pageY-e(document).scrollTop()<n.scrollSensitivity?r=e(document).scrollTop(e(document).scrollTop()-n.scrollSpeed):e(window).height()-(t.pageY-e(document).scrollTop())<n.scrollSensitivity&&(r=e(document).scrollTop(e(document).scrollTop()+n.scrollSpeed)),t.pageX-e(document).scrollLeft()<n.scrollSensitivity?r=e(document).scrollLeft(e(document).scrollLeft()-n.scrollSpeed):e(window).width()-(t.pageX-e(document).scrollLeft())<n.scrollSensitivity&&(r=e(document).scrollLeft(e(document).scrollLeft()+n.scrollSpeed))),r!==!1&&e.ui.ddmanager&&!n.dropBehaviour&&e.ui.ddmanager.prepareOffsets(this,t)}this.positionAbs=this._convertPositionTo("absolute");if(!this.options.axis||this.options.axis!="y")this.helper[0].style.left=this.position.left+"px";if(!this.options.axis||this.options.axis!="x")this.helper[0].style.top=this.position.top+"px";for(var i=this.items.length-1;i>=0;i--){var s=this.items[i],o=s.item[0],u=this._intersectsWithPointer(s);if(!u)continue;if(s.instance!==this.currentContainer)continue;if(o!=this.currentItem[0]&&this.placeholder[u==1?"next":"prev"]()[0]!=o&&!e.contains(this.placeholder[0],o)&&(this.options.type=="semi-dynamic"?!e.contains(this.element[0],o):!0)){this.direction=u==1?"down":"up";if(this.options.tolerance!="pointer"&&!this._intersectsWithSides(s))break;this._rearrange(t,s),this._trigger("change",t,this._uiHash());break}}return this._contactContainers(t),e.ui.ddmanager&&e.ui.ddmanager.drag(this,t),this._trigger("sort",t,this._uiHash()),this.lastPositionAbs=this.positionAbs,!1},_mouseStop:function(t,n){if(!t)return;e.ui.ddmanager&&!this.options.dropBehaviour&&e.ui.ddmanager.drop(this,t);if(this.options.revert){var r=this,i=this.placeholder.offset();this.reverting=!0,e(this.helper).animate({left:i.left-this.offset.parent.left-this.margins.left+(this.offsetParent[0]==document.body?0:this.offsetParent[0].scrollLeft),top:i.top-this.offset.parent.top-this.margins.top+(this.offsetParent[0]==document.body?0:this.offsetParent[0].scrollTop)},parseInt(this.options.revert,10)||500,function(){r._clear(t)})}else this._clear(t,n);return!1},cancel:function(){if(this.dragging){this._mouseUp({target:null}),this.options.helper=="original"?this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper"):this.currentItem.show();for(var t=this.containers.length-1;t>=0;t--)this.containers[t]._trigger("deactivate",null,this._uiHash(this)),this.containers[t].containerCache.over&&(this.containers[t]._trigger("out",null,this._uiHash(this)),this.containers[t].containerCache.over=0)}return this.placeholder&&(this.placeholder[0].parentNode&&this.placeholder[0].parentNode.removeChild(this.placeholder[0]),this.options.helper!="original"&&this.helper&&this.helper[0].parentNode&&this.helper.remove(),e.extend(this,{helper:null,dragging:!1,reverting:!1,_noFinalSort:null}),this.domPosition.prev?e(this.domPosition.prev).after(this.currentItem):e(this.domPosition.parent).prepend(this.currentItem)),this},serialize:function(t){var n=this._getItemsAsjQuery(t&&t.connected),r=[];return t=t||{},e(n).each(function(){var n=(e(t.item||this).attr(t.attribute||"id")||"").match(t.expression||/(.+)[-=_](.+)/);n&&r.push((t.key||n[1]+"[]")+"="+(t.key&&t.expression?n[1]:n[2]))}),!r.length&&t.key&&r.push(t.key+"="),r.join("&")},toArray:function(t){var n=this._getItemsAsjQuery(t&&t.connected),r=[];return t=t||{},n.each(function(){r.push(e(t.item||this).attr(t.attribute||"id")||"")}),r},_intersectsWith:function(e){var t=this.positionAbs.left,n=t+this.helperProportions.width,r=this.positionAbs.top,i=r+this.helperProportions.height,s=e.left,o=s+e.width,u=e.top,a=u+e.height,f=this.offset.click.top,l=this.offset.click.left,c=r+f>u&&r+f<a&&t+l>s&&t+l<o;return this.options.tolerance=="pointer"||this.options.forcePointerForContainers||this.options.tolerance!="pointer"&&this.helperProportions[this.floating?"width":"height"]>e[this.floating?"width":"height"]?c:s<t+this.helperProportions.width/2&&n-this.helperProportions.width/2<o&&u<r+this.helperProportions.height/2&&i-this.helperProportions.height/2<a},_intersectsWithPointer:function(t){var n=this.options.axis==="x"||e.ui.isOverAxis(this.positionAbs.top+this.offset.click.top,t.top,t.height),r=this.options.axis==="y"||e.ui.isOverAxis(this.positionAbs.left+this.offset.click.left,t.left,t.width),i=n&&r,s=this._getDragVerticalDirection(),o=this._getDragHorizontalDirection();return i?this.floating?o&&o=="right"||s=="down"?2:1:s&&(s=="down"?2:1):!1},_intersectsWithSides:function(t){var n=e.ui.isOverAxis(this.positionAbs.top+this.offset.click.top,t.top+t.height/2,t.height),r=e.ui.isOverAxis(this.positionAbs.left+this.offset.click.left,t.left+t.width/2,t.width),i=this._getDragVerticalDirection(),s=this._getDragHorizontalDirection();return this.floating&&s?s=="right"&&r||s=="left"&&!r:i&&(i=="down"&&n||i=="up"&&!n)},_getDragVerticalDirection:function(){var e=this.positionAbs.top-this.lastPositionAbs.top;return e!=0&&(e>0?"down":"up")},_getDragHorizontalDirection:function(){var e=this.positionAbs.left-this.lastPositionAbs.left;return e!=0&&(e>0?"right":"left")},refresh:function(e){return this._refreshItems(e),this.refreshPositions(),this},_connectWith:function(){var e=this.options;return e.connectWith.constructor==String?[e.connectWith]:e.connectWith},_getItemsAsjQuery:function(t){var n=[],r=[],i=this._connectWith();if(i&&t)for(var s=i.length-1;s>=0;s--){var o=e(i[s]);for(var u=o.length-1;u>=0;u--){var a=e.data(o[u],this.widgetName);a&&a!=this&&!a.options.disabled&&r.push([e.isFunction(a.options.items)?a.options.items.call(a.element):e(a.options.items,a.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),a])}}r.push([e.isFunction(this.options.items)?this.options.items.call(this.element,null,{options:this.options,item:this.currentItem}):e(this.options.items,this.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),this]);for(var s=r.length-1;s>=0;s--)r[s][0].each(function(){n.push(this)});return e(n)},_removeCurrentsFromItems:function(){var t=this.currentItem.find(":data("+this.widgetName+"-item)");this.items=e.grep(this.items,function(e){for(var n=0;n<t.length;n++)if(t[n]==e.item[0])return!1;return!0})},_refreshItems:function(t){this.items=[],this.containers=[this];var n=this.items,r=[[e.isFunction(this.options.items)?this.options.items.call(this.element[0],t,{item:this.currentItem}):e(this.options.items,this.element),this]],i=this._connectWith();if(i&&this.ready)for(var s=i.length-1;s>=0;s--){var o=e(i[s]);for(var u=o.length-1;u>=0;u--){var a=e.data(o[u],this.widgetName);a&&a!=this&&!a.options.disabled&&(r.push([e.isFunction(a.options.items)?a.options.items.call(a.element[0],t,{item:this.currentItem}):e(a.options.items,a.element),a]),this.containers.push(a))}}for(var s=r.length-1;s>=0;s--){var f=r[s][1],l=r[s][0];for(var u=0,c=l.length;u<c;u++){var h=e(l[u]);h.data(this.widgetName+"-item",f),n.push({item:h,instance:f,width:0,height:0,left:0,top:0})}}},refreshPositions:function(t){this.offsetParent&&this.helper&&(this.offset.parent=this._getParentOffset());for(var n=this.items.length-1;n>=0;n--){var r=this.items[n];if(r.instance!=this.currentContainer&&this.currentContainer&&r.item[0]!=this.currentItem[0])continue;var i=this.options.toleranceElement?e(this.options.toleranceElement,r.item):r.item;t||(r.width=i.outerWidth(),r.height=i.outerHeight());var s=i.offset();r.left=s.left,r.top=s.top}if(this.options.custom&&this.options.custom.refreshContainers)this.options.custom.refreshContainers.call(this);else for(var n=this.containers.length-1;n>=0;n--){var s=this.containers[n].element.offset();this.containers[n].containerCache.left=s.left,this.containers[n].containerCache.top=s.top,this.containers[n].containerCache.width=this.containers[n].element.outerWidth(),this.containers[n].containerCache.height=this.containers[n].element.outerHeight()}return this},_createPlaceholder:function(t){t=t||this;var n=t.options;if(!n.placeholder||n.placeholder.constructor==String){var r=n.placeholder;n.placeholder={element:function(){var n=e(document.createElement(t.currentItem[0].nodeName)).addClass(r||t.currentItem[0].className+" ui-sortable-placeholder").removeClass("ui-sortable-helper")[0];return r||(n.style.visibility="hidden"),n},update:function(e,i){if(r&&!n.forcePlaceholderSize)return;i.height()||i.height(t.currentItem.innerHeight()-parseInt(t.currentItem.css("paddingTop")||0,10)-parseInt(t.currentItem.css("paddingBottom")||0,10)),i.width()||i.width(t.currentItem.innerWidth()-parseInt(t.currentItem.css("paddingLeft")||0,10)-parseInt(t.currentItem.css("paddingRight")||0,10))}}}t.placeholder=e(n.placeholder.element.call(t.element,t.currentItem)),t.currentItem.after(t.placeholder),n.placeholder.update(t,t.placeholder)},_contactContainers:function(t){var n=null,r=null;for(var i=this.containers.length-1;i>=0;i--){if(e.contains(this.currentItem[0],this.containers[i].element[0]))continue;if(this._intersectsWith(this.containers[i].containerCache)){if(n&&e.contains(this.containers[i].element[0],n.element[0]))continue;n=this.containers[i],r=i}else this.containers[i].containerCache.over&&(this.containers[i]._trigger("out",t,this._uiHash(this)),this.containers[i].containerCache.over=0)}if(!n)return;if(this.containers.length===1)this.containers[r]._trigger("over",t,this._uiHash(this)),this.containers[r].containerCache.over=1;else{var s=1e4,o=null,u=this.containers[r].floating?"left":"top",a=this.containers[r].floating?"width":"height",f=this.positionAbs[u]+this.offset.click[u];for(var l=this.items.length-1;l>=0;l--){if(!e.contains(this.containers[r].element[0],this.items[l].item[0]))continue;if(this.items[l].item[0]==this.currentItem[0])continue;var c=this.items[l].item.offset()[u],h=!1;Math.abs(c-f)>Math.abs(c+this.items[l][a]-f)&&(h=!0,c+=this.items[l][a]),Math.abs(c-f)<s&&(s=Math.abs(c-f),o=this.items[l],this.direction=h?"up":"down")}if(!o&&!this.options.dropOnEmpty)return;this.currentContainer=this.containers[r],o?this._rearrange(t,o,null,!0):this._rearrange(t,null,this.containers[r].element,!0),this._trigger("change",t,this._uiHash()),this.containers[r]._trigger("change",t,this._uiHash(this)),this.options.placeholder.update(this.currentContainer,this.placeholder),this.containers[r]._trigger("over",t,this._uiHash(this)),this.containers[r].containerCache.over=1}},_createHelper:function(t){var n=this.options,r=e.isFunction(n.helper)?e(n.helper.apply(this.element[0],[t,this.currentItem])):n.helper=="clone"?this.currentItem.clone():this.currentItem;return r.parents("body").length||e(n.appendTo!="parent"?n.appendTo:this.currentItem[0].parentNode)[0].appendChild(r[0]),r[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")}),(r[0].style.width==""||n.forceHelperSize)&&r.width(this.currentItem.width()),(r[0].style.height==""||n.forceHelperSize)&&r.height(this.currentItem.height()),r},_adjustOffsetFromHelper:function(t){typeof t=="string"&&(t=t.split(" ")),e.isArray(t)&&(t={left:+t[0],top:+t[1]||0}),"left"in t&&(this.offset.click.left=t.left+this.margins.left),"right"in t&&(this.offset.click.left=this.helperProportions.width-t.right+this.margins.left),"top"in t&&(this.offset.click.top=t.top+this.margins.top),"bottom"in t&&(this.offset.click.top=this.helperProportions.height-t.bottom+this.margins.top)},_getParentOffset:function(){this.offsetParent=this.helper.offsetParent();var t=this.offsetParent.offset();this.cssPosition=="absolute"&&this.scrollParent[0]!=document&&e.contains(this.scrollParent[0],this.offsetParent[0])&&(t.left+=this.scrollParent.scrollLeft(),t.top+=this.scrollParent.scrollTop());if(this.offsetParent[0]==document.body||this.offsetParent[0].tagName&&this.offsetParent[0].tagName.toLowerCase()=="html"&&e.ui.ie)t={top:0,left:0};return{top:t.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:t.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if(this.cssPosition=="relative"){var e=this.currentItem.position();return{top:e.top-(parseInt(this.helper.css("top"),10)||0)+this.scrollParent.scrollTop(),left:e.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 t=this.options;t.containment=="parent"&&(t.containment=this.helper[0].parentNode);if(t.containment=="document"||t.containment=="window")this.containment=[0-this.offset.relative.left-this.offset.parent.left,0-this.offset.relative.top-this.offset.parent.top,e(t.containment=="document"?document:window).width()-this.helperProportions.width-this.margins.left,(e(t.containment=="document"?document:window).height()||document.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top];if(!/^(document|window|parent)$/.test(t.containment)){var n=e(t.containment)[0],r=e(t.containment).offset(),i=e(n).css("overflow")!="hidden";this.containment=[r.left+(parseInt(e(n).css("borderLeftWidth"),10)||0)+(parseInt(e(n).css("paddingLeft"),10)||0)-this.margins.left,r.top+(parseInt(e(n).css("borderTopWidth"),10)||0)+(parseInt(e(n).css("paddingTop"),10)||0)-this.margins.top,r.left+(i?Math.max(n.scrollWidth,n.offsetWidth):n.offsetWidth)-(parseInt(e(n).css("borderLeftWidth"),10)||0)-(parseInt(e(n).css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left,r.top+(i?Math.max(n.scrollHeight,n.offsetHeight):n.offsetHeight)-(parseInt(e(n).css("borderTopWidth"),10)||0)-(parseInt(e(n).css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top]}},_convertPositionTo:function(t,n){n||(n=this.position);var r=t=="absolute"?1:-1,i=this.options,s=this.cssPosition!="absolute"||this.scrollParent[0]!=document&&!!e.contains(this.scrollParent[0],this.offsetParent[0])?this.scrollParent:this.offsetParent,o=/(html|body)/i.test(s[0].tagName);return{top:n.top+this.offset.relative.top*r+this.offset.parent.top*r-(this.cssPosition=="fixed"?-this.scrollParent.scrollTop():o?0:s.scrollTop())*r,left:n.left+this.offset.relative.left*r+this.offset.parent.left*r-(this.cssPosition=="fixed"?-this.scrollParent.scrollLeft():o?0:s.scrollLeft())*r}},_generatePosition:function(t){var n=this.options,r=this.cssPosition!="absolute"||this.scrollParent[0]!=document&&!!e.contains(this.scrollParent[0],this.offsetParent[0])?this.scrollParent:this.offsetParent,i=/(html|body)/i.test(r[0].tagName);this.cssPosition=="relative"&&(this.scrollParent[0]==document||this.scrollParent[0]==this.offsetParent[0])&&(this.offset.relative=this._getRelativeOffset());var s=t.pageX,o=t.pageY;if(this.originalPosition){this.containment&&(t.pageX-this.offset.click.left<this.containment[0]&&(s=this.containment[0]+this.offset.click.left),t.pageY-this.offset.click.top<this.containment[1]&&(o=this.containment[1]+this.offset.click.top),t.pageX-this.offset.click.left>this.containment[2]&&(s=this.containment[2]+this.offset.click.left),t.pageY-this.offset.click.top>this.containment[3]&&(o=this.containment[3]+this.offset.click.top));if(n.grid){var u=this.originalPageY+Math.round((o-this.originalPageY)/n.grid[1])*n.grid[1];o=this.containment?u-this.offset.click.top<this.containment[1]||u-this.offset.click.top>this.containment[3]?u-this.offset.click.top<this.containment[1]?u+n.grid[1]:u-n.grid[1]:u:u;var a=this.originalPageX+Math.round((s-this.originalPageX)/n.grid[0])*n.grid[0];s=this.containment?a-this.offset.click.left<this.containment[0]||a-this.offset.click.left>this.containment[2]?a-this.offset.click.left<this.containment[0]?a+n.grid[0]:a-n.grid[0]:a:a}}return{top:o-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+(this.cssPosition=="fixed"?-this.scrollParent.scrollTop():i?0:r.scrollTop()),left:s-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+(this.cssPosition=="fixed"?-this.scrollParent.scrollLeft():i?0:r.scrollLeft())}},_rearrange:function(e,t,n,r){n?n[0].appendChild(this.placeholder[0]):t.item[0].parentNode.insertBefore(this.placeholder[0],this.direction=="down"?t.item[0]:t.item[0].nextSibling),this.counter=this.counter?++this.counter:1;var i=this.counter;this._delay(function(){i==this.counter&&this.refreshPositions(!r)})},_clear:function(t,n){this.reverting=!1;var r=[];!this._noFinalSort&&this.currentItem.parent().length&&this.placeholder.before(this.currentItem),this._noFinalSort=null;if(this.helper[0]==this.currentItem[0]){for(var i in this._storedCSS)if(this._storedCSS[i]=="auto"||this._storedCSS[i]=="static")this._storedCSS[i]="";this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper")}else this.currentItem.show();this.fromOutside&&!n&&r.push(function(e){this._trigger("receive",e,this._uiHash(this.fromOutside))}),(this.fromOutside||this.domPosition.prev!=this.currentItem.prev().not(".ui-sortable-helper")[0]||this.domPosition.parent!=this.currentItem.parent()[0])&&!n&&r.push(function(e){this._trigger("update",e,this._uiHash())}),this!==this.currentContainer&&(n||(r.push(function(e){this._trigger("remove",e,this._uiHash())}),r.push(function(e){return function(t){e._trigger("receive",t,this._uiHash(this))}}.call(this,this.currentContainer)),r.push(function(e){return function(t){e._trigger("update",t,this._uiHash(this))}}.call(this,this.currentContainer))));for(var i=this.containers.length-1;i>=0;i--)n||r.push(function(e){return function(t){e._trigger("deactivate",t,this._uiHash(this))}}.call(this,this.containers[i])),this.containers[i].containerCache.over&&(r.push(function(e){return function(t){e._trigger("out",t,this._uiHash(this))}}.call(this,this.containers[i])),this.containers[i].containerCache.over=0);this._storedCursor&&e("body").css("cursor",this._storedCursor),this._storedOpacity&&this.helper.css("opacity",this._storedOpacity),this._storedZIndex&&this.helper.css("zIndex",this._storedZIndex=="auto"?"":this._storedZIndex),this.dragging=!1;if(this.cancelHelperRemoval){if(!n){this._trigger("beforeStop",t,this._uiHash());for(var i=0;i<r.length;i++)r[i].call(this,t);this._trigger("stop",t,this._uiHash())}return this.fromOutside=!1,!1}n||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;if(!n){for(var i=0;i<r.length;i++)r[i].call(this,t);this._trigger("stop",t,this._uiHash())}return this.fromOutside=!1,!0},_trigger:function(){e.Widget.prototype._trigger.apply(this,arguments)===!1&&this.cancel()},_uiHash:function(t){var n=t||this;return{helper:n.helper,placeholder:n.placeholder||e([]),position:n.position,originalPosition:n.originalPosition,offset:n.positionAbs,item:n.currentItem,sender:t?t.element:null}}})})(jQuery);(function(e,t){var n=0,r={},i={};r.height=r.paddingTop=r.paddingBottom=r.borderTopWidth=r.borderBottomWidth="hide",i.height=i.paddingTop=i.paddingBottom=i.borderTopWidth=i.borderBottomWidth="show",e.widget("ui.accordion",{version:"1.9.1",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.accordionId="ui-accordion-"+(this.element.attr("id")||++n),r=this.options;this.prevShow=this.prevHide=e(),this.element.addClass("ui-accordion ui-widget ui-helper-reset"),this.headers=this.element.find(r.header).addClass("ui-accordion-header ui-helper-reset ui-state-default ui-corner-all"),this._hoverable(this.headers),this._focusable(this.headers),this.headers.next().addClass("ui-accordion-content ui-helper-reset ui-widget-content ui-corner-bottom").hide(),!r.collapsible&&(r.active===!1||r.active==null)&&(r.active=0),r.active<0&&(r.active+=this.headers.length),this.active=this._findActive(r.active).addClass("ui-accordion-header-active ui-state-active").toggleClass("ui-corner-all ui-corner-top"),this.active.next().addClass("ui-accordion-content-active").show(),this._createIcons(),this.refresh(),this.element.attr("role","tablist"),this.headers.attr("role","tab").each(function(n){var r=e(this),i=r.attr("id"),s=r.next(),o=s.attr("id");i||(i=t+"-header-"+n,r.attr("id",i)),o||(o=t+"-panel-"+n,s.attr("id",o)),r.attr("aria-controls",o),s.attr("aria-labelledby",i)}).next().attr("role","tabpanel"),this.headers.not(this.active).attr({"aria-selected":"false",tabIndex:-1}).next().attr({"aria-expanded":"false","aria-hidden":"true"}).hide(),this.active.length?this.active.attr({"aria-selected":"true",tabIndex:0}).next().attr({"aria-expanded":"true","aria-hidden":"false"}):this.headers.eq(0).attr("tabIndex",0),this._on(this.headers,{keydown:"_keydown"}),this._on(this.headers.next(),{keydown:"_panelKeyDown"}),this._setupEvents(r.event)},_getCreateEventData:function(){return{header:this.active,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-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-expanded").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")}),this.options.heightStyle!=="content"&&e.css("height","")},_setOption:function(e,t){if(e==="active"){this._activate(t);return}e==="event"&&(this.options.event&&this._off(this.headers,this.options.event),this._setupEvents(t)),this._super(e,t),e==="collapsible"&&!t&&this.options.active===!1&&this._activate(0),e==="icons"&&(this._destroyIcons(),t&&this._createIcons()),e==="disabled"&&this.headers.add(this.headers.next()).toggleClass("ui-state-disabled",!!t)},_keydown:function(t){if(t.altKey||t.ctrlKey)return;var n=e.ui.keyCode,r=this.headers.length,i=this.headers.index(t.target),s=!1;switch(t.keyCode){case n.RIGHT:case n.DOWN:s=this.headers[(i+1)%r];break;case n.LEFT:case n.UP:s=this.headers[(i-1+r)%r];break;case n.SPACE:case n.ENTER:this._eventHandler(t);break;case n.HOME:s=this.headers[0];break;case n.END:s=this.headers[r-1]}s&&(e(t.target).attr("tabIndex",-1),e(s).attr("tabIndex",0),s.focus(),t.preventDefault())},_panelKeyDown:function(t){t.keyCode===e.ui.keyCode.UP&&t.ctrlKey&&e(t.currentTarget).prev().focus()},refresh:function(){var t,n,r=this.options.heightStyle,i=this.element.parent();r==="fill"?(e.support.minHeight||(n=i.css("overflow"),i.css("overflow","hidden")),t=i.height(),this.element.siblings(":visible").each(function(){var n=e(this),r=n.css("position");if(r==="absolute"||r==="fixed")return;t-=n.outerHeight(!0)}),n&&i.css("overflow",n),this.headers.each(function(){t-=e(this).outerHeight(!0)}),this.headers.next().each(function(){e(this).height(Math.max(0,t-e(this).innerHeight()+e(this).height()))}).css("overflow","auto")):r==="auto"&&(t=0,this.headers.next().each(function(){t=Math.max(t,e(this).height("").height())}).height(t))},_activate:function(t){var n=this._findActive(t)[0];if(n===this.active[0])return;n=n||this.active[0],this._eventHandler({target:n,currentTarget:n,preventDefault:e.noop})},_findActive:function(t){return typeof t=="number"?this.headers.eq(t):e()},_setupEvents:function(t){var n={};if(!t)return;e.each(t.split(" "),function(e,t){n[t]="_eventHandler"}),this._on(this.headers,n)},_eventHandler:function(t){var n=this.options,r=this.active,i=e(t.currentTarget),s=i[0]===r[0],o=s&&n.collapsible,u=o?e():i.next(),a=r.next(),f={oldHeader:r,oldPanel:a,newHeader:o?e():i,newPanel:u};t.preventDefault();if(s&&!n.collapsible||this._trigger("beforeActivate",t,f)===!1)return;n.active=o?!1:this.headers.index(i),this.active=s?e():i,this._toggle(f),r.removeClass("ui-accordion-header-active ui-state-active"),n.icons&&r.children(".ui-accordion-header-icon").removeClass(n.icons.activeHeader).addClass(n.icons.header),s||(i.removeClass("ui-corner-all").addClass("ui-accordion-header-active ui-state-active ui-corner-top"),n.icons&&i.children(".ui-accordion-header-icon").removeClass(n.icons.header).addClass(n.icons.activeHeader),i.next().addClass("ui-accordion-content-active"))},_toggle:function(t){var n=t.newPanel,r=this.prevShow.length?this.prevShow:t.oldPanel;this.prevShow.add(this.prevHide).stop(!0,!0),this.prevShow=n,this.prevHide=r,this.options.animate?this._animate(n,r,t):(r.hide(),n.show(),this._toggleComplete(t)),r.attr({"aria-expanded":"false","aria-hidden":"true"}),r.prev().attr("aria-selected","false"),n.length&&r.length?r.prev().attr("tabIndex",-1):n.length&&this.headers.filter(function(){return e(this).attr("tabIndex")===0}).attr("tabIndex",-1),n.attr({"aria-expanded":"true","aria-hidden":"false"}).prev().attr({"aria-selected":"true",tabIndex:0})},_animate:function(e,t,n){var s,o,u,a=this,f=0,l=e.length&&(!t.length||e.index()<t.index()),c=this.options.animate||{},h=l&&c.down||c,p=function(){a._toggleComplete(n)};typeof h=="number"&&(u=h),typeof h=="string"&&(o=h),o=o||h.easing||c.easing,u=u||h.duration||c.duration;if(!t.length)return e.animate(i,u,o,p);if(!e.length)return t.animate(r,u,o,p);s=e.show().outerHeight(),t.animate(r,{duration:u,easing:o,step:function(e,t){t.now=Math.round(e)}}),e.hide().animate(i,{duration:u,easing:o,complete:p,step:function(e,n){n.now=Math.round(e),n.prop!=="height"?f+=n.now:a.options.heightStyle!=="content"&&(n.now=Math.round(s-t.outerHeight()-f),f=0)}})},_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)}}),e.uiBackCompat!==!1&&(function(e,t){e.extend(t.options,{navigation:!1,navigationFilter:function(){return this.href.toLowerCase()===location.href.toLowerCase()}});var n=t._create;t._create=function(){if(this.options.navigation){var t=this,r=this.element.find(this.options.header),i=r.next(),s=r.add(i).find("a").filter(this.options.navigationFilter)[0];s&&r.add(i).each(function(n){if(e.contains(this,s))return t.options.active=Math.floor(n/2),!1})}n.call(this)}}(jQuery,jQuery.ui.accordion.prototype),function(e,t){e.extend(t.options,{heightStyle:null,autoHeight:!0,clearStyle:!1,fillSpace:!1});var n=t._create,r=t._setOption;e.extend(t,{_create:function(){this.options.heightStyle=this.options.heightStyle||this._mergeHeightStyle(),n.call(this)},_setOption:function(e){if(e==="autoHeight"||e==="clearStyle"||e==="fillSpace")this.options.heightStyle=this._mergeHeightStyle();r.apply(this,arguments)},_mergeHeightStyle:function(){var e=this.options;if(e.fillSpace)return"fill";if(e.clearStyle)return"content";if(e.autoHeight)return"auto"}})}(jQuery,jQuery.ui.accordion.prototype),function(e,t){e.extend(t.options.icons,{activeHeader:null,headerSelected:"ui-icon-triangle-1-s"});var n=t._createIcons;t._createIcons=function(){this.options.icons&&(this.options.icons.activeHeader=this.options.icons.activeHeader||this.options.icons.headerSelected),n.call(this)}}(jQuery,jQuery.ui.accordion.prototype),function(e,t){t.activate=t._activate;var n=t._findActive;t._findActive=function(e){return e===-1&&(e=!1),e&&typeof e!="number"&&(e=this.headers.index(this.headers.filter(e)),e===-1&&(e=!1)),n.call(this,e)}}(jQuery,jQuery.ui.accordion.prototype),jQuery.ui.accordion.prototype.resize=jQuery.ui.accordion.prototype.refresh,function(e,t){e.extend(t.options,{change:null,changestart:null});var n=t._trigger;t._trigger=function(e,t,r){var i=n.apply(this,arguments);return i?(e==="beforeActivate"?i=n.call(this,"changestart",t,{oldHeader:r.oldHeader,oldContent:r.oldPanel,newHeader:r.newHeader,newContent:r.newPanel}):e==="activate"&&(i=n.call(this,"change",t,{oldHeader:r.oldHeader,oldContent:r.oldPanel,newHeader:r.newHeader,newContent:r.newPanel})),i):!1}}(jQuery,jQuery.ui.accordion.prototype),function(e,t){e.extend(t.options,{animate:null,animated:"slide"});var n=t._create;t._create=function(){var e=this.options;e.animate===null&&(e.animated?e.animated==="slide"?e.animate=300:e.animated==="bounceslide"?e.animate={duration:200,down:{easing:"easeOutBounce",duration:1e3}}:e.animate=e.animated:e.animate=!1),n.call(this)}}(jQuery,jQuery.ui.accordion.prototype))})(jQuery);(function(e,t){var n=0;e.widget("ui.autocomplete",{version:"1.9.1",defaultElement:"<input>",options:{appendTo:"body",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},pending:0,_create:function(){var t,n,r;this.isMultiLine=this._isMultiLine(),this.valueMethod=this.element[this.element.is("input,textarea")?"val":"text"],this.isNewMenu=!0,this.element.addClass("ui-autocomplete-input").attr("autocomplete","off"),this._on(this.element,{keydown:function(i){if(this.element.prop("readOnly")){t=!0,r=!0,n=!0;return}t=!1,r=!1,n=!1;var s=e.ui.keyCode;switch(i.keyCode){case s.PAGE_UP:t=!0,this._move("previousPage",i);break;case s.PAGE_DOWN:t=!0,this._move("nextPage",i);break;case s.UP:t=!0,this._keyEvent("previous",i);break;case s.DOWN:t=!0,this._keyEvent("next",i);break;case s.ENTER:case s.NUMPAD_ENTER:this.menu.active&&(t=!0,i.preventDefault(),this.menu.select(i));break;case s.TAB:this.menu.active&&this.menu.select(i);break;case s.ESCAPE:this.menu.element.is(":visible")&&(this._value(this.term),this.close(i),i.preventDefault());break;default:n=!0,this._searchTimeout(i)}},keypress:function(r){if(t){t=!1,r.preventDefault();return}if(n)return;var i=e.ui.keyCode;switch(r.keyCode){case i.PAGE_UP:this._move("previousPage",r);break;case i.PAGE_DOWN:this._move("nextPage",r);break;case i.UP:this._keyEvent("previous",r);break;case i.DOWN:this._keyEvent("next",r)}},input:function(e){if(r){r=!1,e.preventDefault();return}this._searchTimeout(e)},focus:function(){this.selectedItem=null,this.previous=this._value()},blur:function(e){if(this.cancelBlur){delete this.cancelBlur;return}clearTimeout(this.searching),this.close(e),this._change(e)}}),this._initSource(),this.menu=e("<ul>").addClass("ui-autocomplete").appendTo(this.document.find(this.options.appendTo||"body")[0]).menu({input:e(),role:null}).zIndex(this.element.zIndex()+1).hide().data("menu"),this._on(this.menu.element,{mousedown:function(t){t.preventDefault(),this.cancelBlur=!0,this._delay(function(){delete this.cancelBlur});var n=this.menu.element[0];e(t.target).closest(".ui-menu-item").length||this._delay(function(){var t=this;this.document.one("mousedown",function(r){r.target!==t.element[0]&&r.target!==n&&!e.contains(n,r.target)&&t.close()})})},menufocus:function(t,n){if(this.isNewMenu){this.isNewMenu=!1;if(t.originalEvent&&/^mouse/.test(t.originalEvent.type)){this.menu.blur(),this.document.one("mousemove",function(){e(t.target).trigger(t.originalEvent)});return}}var r=n.item.data("ui-autocomplete-item")||n.item.data("item.autocomplete");!1!==this._trigger("focus",t,{item:r})?t.originalEvent&&/^key/.test(t.originalEvent.type)&&this._value(r.value):this.liveRegion.text(r.value)},menuselect:function(e,t){var n=t.item.data("ui-autocomplete-item")||t.item.data("item.autocomplete"),r=this.previous;this.element[0]!==this.document[0].activeElement&&(this.element.focus(),this.previous=r,this._delay(function(){this.previous=r,this.selectedItem=n})),!1!==this._trigger("select",e,{item:n})&&this._value(n.value),this.term=this._value(),this.close(e),this.selectedItem=n}}),this.liveRegion=e("<span>",{role:"status","aria-live":"polite"}).addClass("ui-helper-hidden-accessible").insertAfter(this.element),e.fn.bgiframe&&this.menu.element.bgiframe(),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),e==="source"&&this._initSource(),e==="appendTo"&&this.menu.element.appendTo(this.document.find(t||"body")[0]),e==="disabled"&&t&&this.xhr&&this.xhr.abort()},_isMultiLine:function(){return this.element.is("textarea")?!0:this.element.is("input")?!1:this.element.prop("isContentEditable")},_initSource:function(){var t,n,r=this;e.isArray(this.options.source)?(t=this.options.source,this.source=function(n,r){r(e.ui.autocomplete.filter(t,n.term))}):typeof this.options.source=="string"?(n=this.options.source,this.source=function(t,i){r.xhr&&r.xhr.abort(),r.xhr=e.ajax({url:n,data:t,dataType:"json",success:function(e){i(e)},error:function(){i([])}})}):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){e=e!=null?e:this._value(),this.term=this._value();if(e.length<this.options.minLength)return this.close(t);if(this._trigger("search",t)===!1)return;return this._search(e)},_search:function(e){this.pending++,this.element.addClass("ui-autocomplete-loading"),this.cancelSearch=!1,this.source({term:e},this._response())},_response:function(){var e=this,t=++n;return function(r){t===n&&e.__response(r),e.pending--,e.pending||e.element.removeClass("ui-autocomplete-loading")}},__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 typeof t=="string"?{label:t,value:t}:e.extend({label:t.label||t.value,value:t.value||t.label},t)})},_suggest:function(t){var n=this.menu.element.empty().zIndex(this.element.zIndex()+1);this._renderMenu(n,t),this.menu.refresh(),n.show(),this._resizeMenu(),n.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,n){var r=this;e.each(n,function(e,n){r._renderItemData(t,n)})},_renderItemData:function(e,t){return this._renderItem(e,t).data("ui-autocomplete-item",t)},_renderItem:function(t,n){return e("<li>").append(e("<a>").text(n.label)).appendTo(t)},_move:function(e,t){if(!this.menu.element.is(":visible")){this.search(null,t);return}if(this.menu.isFirstItem()&&/^previous/.test(e)||this.menu.isLastItem()&&/^next/.test(e)){this._value(this.term),this.menu.blur();return}this.menu[e](t)},widget:function(){return this.menu.element},_value:function(){return this.valueMethod.apply(this.element,arguments)},_keyEvent:function(e,t){if(!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,n){var r=new RegExp(e.ui.autocomplete.escapeRegex(n),"i");return e.grep(t,function(e){return r.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);if(this.options.disabled||this.cancelSearch)return;e&&e.length?t=this.options.messages.results(e.length):t=this.options.messages.noResults,this.liveRegion.text(t)}})})(jQuery);(function(e,t){var n,r,i,s,o="ui-button ui-widget ui-state-default ui-corner-all",u="ui-state-hover ui-state-active ",a="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",f=function(){var t=e(this).find(":ui-button");setTimeout(function(){t.button("refresh")},1)},l=function(t){var n=t.name,r=t.form,i=e([]);return n&&(r?i=e(r).find("[name='"+n+"']"):i=e("[name='"+n+"']",t.ownerDocument).filter(function(){return!this.form})),i};e.widget("ui.button",{version:"1.9.1",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,f),typeof this.options.disabled!="boolean"?this.options.disabled=!!this.element.prop("disabled"):this.element.prop("disabled",this.options.disabled),this._determineButtonType(),this.hasTitle=!!this.buttonElement.attr("title");var t=this,u=this.options,a=this.type==="checkbox"||this.type==="radio",c="ui-state-hover"+(a?"":" ui-state-active"),h="ui-state-focus";u.label===null&&(u.label=this.type==="input"?this.buttonElement.val():this.buttonElement.html()),this.buttonElement.addClass(o).attr("role","button").bind("mouseenter"+this.eventNamespace,function(){if(u.disabled)return;e(this).addClass("ui-state-hover"),this===n&&e(this).addClass("ui-state-active")}).bind("mouseleave"+this.eventNamespace,function(){if(u.disabled)return;e(this).removeClass(c)}).bind("click"+this.eventNamespace,function(e){u.disabled&&(e.preventDefault(),e.stopImmediatePropagation())}),this.element.bind("focus"+this.eventNamespace,function(){t.buttonElement.addClass(h)}).bind("blur"+this.eventNamespace,function(){t.buttonElement.removeClass(h)}),a&&(this.element.bind("change"+this.eventNamespace,function(){if(s)return;t.refresh()}),this.buttonElement.bind("mousedown"+this.eventNamespace,function(e){if(u.disabled)return;s=!1,r=e.pageX,i=e.pageY}).bind("mouseup"+this.eventNamespace,function(e){if(u.disabled)return;if(r!==e.pageX||i!==e.pageY)s=!0})),this.type==="checkbox"?this.buttonElement.bind("click"+this.eventNamespace,function(){if(u.disabled||s)return!1;e(this).toggleClass("ui-state-active"),t.buttonElement.attr("aria-pressed",t.element[0].checked)}):this.type==="radio"?this.buttonElement.bind("click"+this.eventNamespace,function(){if(u.disabled||s)return!1;e(this).addClass("ui-state-active"),t.buttonElement.attr("aria-pressed","true");var n=t.element[0];l(n).not(n).map(function(){return e(this).button("widget")[0]}).removeClass("ui-state-active").attr("aria-pressed","false")}):(this.buttonElement.bind("mousedown"+this.eventNamespace,function(){if(u.disabled)return!1;e(this).addClass("ui-state-active"),n=this,t.document.one("mouseup",function(){n=null})}).bind("mouseup"+this.eventNamespace,function(){if(u.disabled)return!1;e(this).removeClass("ui-state-active")}).bind("keydown"+this.eventNamespace,function(t){if(u.disabled)return!1;(t.keyCode===e.ui.keyCode.SPACE||t.keyCode===e.ui.keyCode.ENTER)&&e(this).addClass("ui-state-active")}).bind("keyup"+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",u.disabled),this._resetButton()},_determineButtonType:function(){var e,t,n;this.element.is("[type=checkbox]")?this.type="checkbox":this.element.is("[type=radio]")?this.type="radio":this.element.is("input")?this.type="input":this.type="button",this.type==="checkbox"||this.type==="radio"?(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"),n=this.element.is(":checked"),n&&this.buttonElement.addClass("ui-state-active"),this.buttonElement.prop("aria-pressed",n)):this.buttonElement=this.element},widget:function(){return this.buttonElement},_destroy:function(){this.element.removeClass("ui-helper-hidden-accessible"),this.buttonElement.removeClass(o+" "+u+" "+a).removeAttr("role").removeAttr("aria-pressed").html(this.buttonElement.find(".ui-button-text").html()),this.hasTitle||this.buttonElement.removeAttr("title")},_setOption:function(e,t){this._super(e,t);if(e==="disabled"){t?this.element.prop("disabled",!0):this.element.prop("disabled",!1);return}this._resetButton()},refresh:function(){var t=this.element.is(":disabled")||this.element.hasClass("ui-button-disabled");t!==this.options.disabled&&this._setOption("disabled",t),this.type==="radio"?l(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")}):this.type==="checkbox"&&(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(this.type==="input"){this.options.label&&this.element.val(this.options.label);return}var t=this.buttonElement.removeClass(a),n=e("<span></span>",this.document[0]).addClass("ui-button-text").html(this.options.label).appendTo(t.empty()).text(),r=this.options.icons,i=r.primary&&r.secondary,s=[];r.primary||r.secondary?(this.options.text&&s.push("ui-button-text-icon"+(i?"s":r.primary?"-primary":"-secondary")),r.primary&&t.prepend("<span class='ui-button-icon-primary ui-icon "+r.primary+"'></span>"),r.secondary&&t.append("<span class='ui-button-icon-secondary ui-icon "+r.secondary+"'></span>"),this.options.text||(s.push(i?"ui-button-icons-only":"ui-button-icon-only"),this.hasTitle||t.attr("title",e.trim(n)))):s.push("ui-button-text-only"),t.addClass(s.join(" "))}}),e.widget("ui.buttonset",{version:"1.9.1",options:{items:"button, input[type=button], input[type=submit], input[type=reset], input[type=checkbox], input[type=radio], a, :data(button)"},_create:function(){this.element.addClass("ui-buttonset")},_init:function(){this.refresh()},_setOption:function(e,t){e==="disabled"&&this.buttons.button("option",e,t),this._super(e,t)},refresh:function(){var t=this.element.css("direction")==="rtl";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($,undefined){function Datepicker(){this.debug=!1,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},$.extend(this._defaults,this.regional[""]),this.dpDiv=bindHover($('<div id="'+this._mainDivId+'" class="ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all"></div>'))}function bindHover(e){var t="button, .ui-datepicker-prev, .ui-datepicker-next, .ui-datepicker-calendar td a";return e.delegate(t,"mouseout",function(){$(this).removeClass("ui-state-hover"),this.className.indexOf("ui-datepicker-prev")!=-1&&$(this).removeClass("ui-datepicker-prev-hover"),this.className.indexOf("ui-datepicker-next")!=-1&&$(this).removeClass("ui-datepicker-next-hover")}).delegate(t,"mouseover",function(){$.datepicker._isDisabledDatepicker(instActive.inline?e.parent()[0]:instActive.input[0])||($(this).parents(".ui-datepicker-calendar").find("a").removeClass("ui-state-hover"),$(this).addClass("ui-state-hover"),this.className.indexOf("ui-datepicker-prev")!=-1&&$(this).addClass("ui-datepicker-prev-hover"),this.className.indexOf("ui-datepicker-next")!=-1&&$(this).addClass("ui-datepicker-next-hover"))})}function extendRemove(e,t){$.extend(e,t);for(var n in t)if(t[n]==null||t[n]==undefined)e[n]=t[n];return e}$.extend($.ui,{datepicker:{version:"1.9.1"}});var PROP_NAME="datepicker",dpuuid=(new Date).getTime(),instActive;$.extend(Datepicker.prototype,{markerClassName:"hasDatepicker",maxRows:4,log:function(){this.debug&&console.log.apply("",arguments)},_widgetDatepicker:function(){return this.dpDiv},setDefaults:function(e){return extendRemove(this._defaults,e||{}),this},_attachDatepicker:function(target,settings){var inlineSettings=null;for(var attrName in this._defaults){var attrValue=target.getAttribute("date:"+attrName);if(attrValue){inlineSettings=inlineSettings||{};try{inlineSettings[attrName]=eval(attrValue)}catch(err){inlineSettings[attrName]=attrValue}}}var nodeName=target.nodeName.toLowerCase(),inline=nodeName=="div"||nodeName=="span";target.id||(this.uuid+=1,target.id="dp"+this.uuid);var inst=this._newInst($(target),inline);inst.settings=$.extend({},settings||{},inlineSettings||{}),nodeName=="input"?this._connectDatepicker(target,inst):inline&&this._inlineDatepicker(target,inst)},_newInst:function(e,t){var n=e[0].id.replace(/([^A-Za-z0-9_-])/g,"\\\\$1");return{id:n,input:e,selectedDay:0,selectedMonth:0,selectedYear:0,drawMonth:0,drawYear:0,inline:t,dpDiv:t?bindHover($('<div class="'+this._inlineClass+' ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all"></div>')):this.dpDiv}},_connectDatepicker:function(e,t){var n=$(e);t.append=$([]),t.trigger=$([]);if(n.hasClass(this.markerClassName))return;this._attachments(n,t),n.addClass(this.markerClassName).keydown(this._doKeyDown).keypress(this._doKeyPress).keyup(this._doKeyUp).bind("setData.datepicker",function(e,n,r){t.settings[n]=r}).bind("getData.datepicker",function(e,n){return this._get(t,n)}),this._autoSize(t),$.data(e,PROP_NAME,t),t.settings.disabled&&this._disableDatepicker(e)},_attachments:function(e,t){var n=this._get(t,"appendText"),r=this._get(t,"isRTL");t.append&&t.append.remove(),n&&(t.append=$('<span class="'+this._appendClass+'">'+n+"</span>"),e[r?"before":"after"](t.append)),e.unbind("focus",this._showDatepicker),t.trigger&&t.trigger.remove();var i=this._get(t,"showOn");(i=="focus"||i=="both")&&e.focus(this._showDatepicker);if(i=="button"||i=="both"){var s=this._get(t,"buttonText"),o=this._get(t,"buttonImage");t.trigger=$(this._get(t,"buttonImageOnly")?$("<img/>").addClass(this._triggerClass).attr({src:o,alt:s,title:s}):$('<button type="button"></button>').addClass(this._triggerClass).html(o==""?s:$("<img/>").attr({src:o,alt:s,title:s}))),e[r?"before":"after"](t.trigger),t.trigger.click(function(){return $.datepicker._datepickerShowing&&$.datepicker._lastInput==e[0]?$.datepicker._hideDatepicker():$.datepicker._datepickerShowing&&$.datepicker._lastInput!=e[0]?($.datepicker._hideDatepicker(),$.datepicker._showDatepicker(e[0])):$.datepicker._showDatepicker(e[0]),!1})}},_autoSize:function(e){if(this._get(e,"autoSize")&&!e.inline){var t=new Date(2009,11,20),n=this._get(e,"dateFormat");if(n.match(/[DM]/)){var r=function(e){var t=0,n=0;for(var r=0;r<e.length;r++)e[r].length>t&&(t=e[r].length,n=r);return n};t.setMonth(r(this._get(e,n.match(/MM/)?"monthNames":"monthNamesShort"))),t.setDate(r(this._get(e,n.match(/DD/)?"dayNames":"dayNamesShort"))+20-t.getDay())}e.input.attr("size",this._formatDate(e,t).length)}},_inlineDatepicker:function(e,t){var n=$(e);if(n.hasClass(this.markerClassName))return;n.addClass(this.markerClassName).append(t.dpDiv).bind("setData.datepicker",function(e,n,r){t.settings[n]=r}).bind("getData.datepicker",function(e,n){return this._get(t,n)}),$.data(e,PROP_NAME,t),this._setDate(t,this._getDefaultDate(t),!0),this._updateDatepicker(t),this._updateAlternate(t),t.settings.disabled&&this._disableDatepicker(e),t.dpDiv.css("display","block")},_dialogDatepicker:function(e,t,n,r,i){var s=this._dialogInst;if(!s){this.uuid+=1;var o="dp"+this.uuid;this._dialogInput=$('<input type="text" id="'+o+'" style="position: absolute; top: -100px; width: 0px;"/>'),this._dialogInput.keydown(this._doKeyDown),$("body").append(this._dialogInput),s=this._dialogInst=this._newInst(this._dialogInput,!1),s.settings={},$.data(this._dialogInput[0],PROP_NAME,s)}extendRemove(s.settings,r||{}),t=t&&t.constructor==Date?this._formatDate(s,t):t,this._dialogInput.val(t),this._pos=i?i.length?i:[i.pageX,i.pageY]:null;if(!this._pos){var u=document.documentElement.clientWidth,a=document.documentElement.clientHeight,f=document.documentElement.scrollLeft||document.body.scrollLeft,l=document.documentElement.scrollTop||document.body.scrollTop;this._pos=[u/2-100+f,a/2-150+l]}return this._dialogInput.css("left",this._pos[0]+20+"px").css("top",this._pos[1]+"px"),s.settings.onSelect=n,this._inDialog=!0,this.dpDiv.addClass(this._dialogClass),this._showDatepicker(this._dialogInput[0]),$.blockUI&&$.blockUI(this.dpDiv),$.data(this._dialogInput[0],PROP_NAME,s),this},_destroyDatepicker:function(e){var t=$(e),n=$.data(e,PROP_NAME);if(!t.hasClass(this.markerClassName))return;var r=e.nodeName.toLowerCase();$.removeData(e,PROP_NAME),r=="input"?(n.append.remove(),n.trigger.remove(),t.removeClass(this.markerClassName).unbind("focus",this._showDatepicker).unbind("keydown",this._doKeyDown).unbind("keypress",this._doKeyPress).unbind("keyup",this._doKeyUp)):(r=="div"||r=="span")&&t.removeClass(this.markerClassName).empty()},_enableDatepicker:function(e){var t=$(e),n=$.data(e,PROP_NAME);if(!t.hasClass(this.markerClassName))return;var r=e.nodeName.toLowerCase();if(r=="input")e.disabled=!1,n.trigger.filter("button").each(function(){this.disabled=!1}).end().filter("img").css({opacity:"1.0",cursor:""});else if(r=="div"||r=="span"){var i=t.children("."+this._inlineClass);i.children().removeClass("ui-state-disabled"),i.find("select.ui-datepicker-month, select.ui-datepicker-year").prop("disabled",!1)}this._disabledInputs=$.map(this._disabledInputs,function(t){return t==e?null:t})},_disableDatepicker:function(e){var t=$(e),n=$.data(e,PROP_NAME);if(!t.hasClass(this.markerClassName))return;var r=e.nodeName.toLowerCase();if(r=="input")e.disabled=!0,n.trigger.filter("button").each(function(){this.disabled=!0}).end().filter("img").css({opacity:"0.5",cursor:"default"});else if(r=="div"||r=="span"){var i=t.children("."+this._inlineClass);i.children().addClass("ui-state-disabled"),i.find("select.ui-datepicker-month, select.ui-datepicker-year").prop("disabled",!0)}this._disabledInputs=$.map(this._disabledInputs,function(t){return t==e?null:t}),this._disabledInputs[this._disabledInputs.length]=e},_isDisabledDatepicker:function(e){if(!e)return!1;for(var t=0;t<this._disabledInputs.length;t++)if(this._disabledInputs[t]==e)return!0;return!1},_getInst:function(e){try{return $.data(e,PROP_NAME)}catch(t){throw"Missing instance data for this datepicker"}},_optionDatepicker:function(e,t,n){var r=this._getInst(e);if(arguments.length==2&&typeof t=="string")return t=="defaults"?$.extend({},$.datepicker._defaults):r?t=="all"?$.extend({},r.settings):this._get(r,t):null;var i=t||{};typeof t=="string"&&(i={},i[t]=n);if(r){this._curInst==r&&this._hideDatepicker();var s=this._getDateDatepicker(e,!0),o=this._getMinMaxDate(r,"min"),u=this._getMinMaxDate(r,"max");extendRemove(r.settings,i),o!==null&&i.dateFormat!==undefined&&i.minDate===undefined&&(r.settings.minDate=this._formatDate(r,o)),u!==null&&i.dateFormat!==undefined&&i.maxDate===undefined&&(r.settings.maxDate=this._formatDate(r,u)),this._attachments($(e),r),this._autoSize(r),this._setDate(r,s),this._updateAlternate(r),this._updateDatepicker(r)}},_changeDatepicker:function(e,t,n){this._optionDatepicker(e,t,n)},_refreshDatepicker:function(e){var t=this._getInst(e);t&&this._updateDatepicker(t)},_setDateDatepicker:function(e,t){var n=this._getInst(e);n&&(this._setDate(n,t),this._updateDatepicker(n),this._updateAlternate(n))},_getDateDatepicker:function(e,t){var n=this._getInst(e);return n&&!n.inline&&this._setDateFromField(n,t),n?this._getDate(n):null},_doKeyDown:function(e){var t=$.datepicker._getInst(e.target),n=!0,r=t.dpDiv.is(".ui-datepicker-rtl");t._keyEvent=!0;if($.datepicker._datepickerShowing)switch(e.keyCode){case 9:$.datepicker._hideDatepicker(),n=!1;break;case 13:var i=$("td."+$.datepicker._dayOverClass+":not(."+$.datepicker._currentClass+")",t.dpDiv);i[0]&&$.datepicker._selectDay(e.target,t.selectedMonth,t.selectedYear,i[0]);var s=$.datepicker._get(t,"onSelect");if(s){var o=$.datepicker._formatDate(t);s.apply(t.input?t.input[0]:null,[o,t])}else $.datepicker._hideDatepicker();return!1;case 27:$.datepicker._hideDatepicker();break;case 33:$.datepicker._adjustDate(e.target,e.ctrlKey?-$.datepicker._get(t,"stepBigMonths"):-$.datepicker._get(t,"stepMonths"),"M");break;case 34:$.datepicker._adjustDate(e.target,e.ctrlKey?+$.datepicker._get(t,"stepBigMonths"):+$.datepicker._get(t,"stepMonths"),"M");break;case 35:(e.ctrlKey||e.metaKey)&&$.datepicker._clearDate(e.target),n=e.ctrlKey||e.metaKey;break;case 36:(e.ctrlKey||e.metaKey)&&$.datepicker._gotoToday(e.target),n=e.ctrlKey||e.metaKey;break;case 37:(e.ctrlKey||e.metaKey)&&$.datepicker._adjustDate(e.target,r?1:-1,"D"),n=e.ctrlKey||e.metaKey,e.originalEvent.altKey&&$.datepicker._adjustDate(e.target,e.ctrlKey?-$.datepicker._get(t,"stepBigMonths"):-$.datepicker._get(t,"stepMonths"),"M");break;case 38:(e.ctrlKey||e.metaKey)&&$.datepicker._adjustDate(e.target,-7,"D"),n=e.ctrlKey||e.metaKey;break;case 39:(e.ctrlKey||e.metaKey)&&$.datepicker._adjustDate(e.target,r?-1:1,"D"),n=e.ctrlKey||e.metaKey,e.originalEvent.altKey&&$.datepicker._adjustDate(e.target,e.ctrlKey?+$.datepicker._get(t,"stepBigMonths"):+$.datepicker._get(t,"stepMonths"),"M");break;case 40:(e.ctrlKey||e.metaKey)&&$.datepicker._adjustDate(e.target,7,"D"),n=e.ctrlKey||e.metaKey;break;default:n=!1}else e.keyCode==36&&e.ctrlKey?$.datepicker._showDatepicker(this):n=!1;n&&(e.preventDefault(),e.stopPropagation())},_doKeyPress:function(e){var t=$.datepicker._getInst(e.target);if($.datepicker._get(t,"constrainInput")){var n=$.datepicker._possibleChars($.datepicker._get(t,"dateFormat")),r=String.fromCharCode(e.charCode==undefined?e.keyCode:e.charCode);return e.ctrlKey||e.metaKey||r<" "||!n||n.indexOf(r)>-1}},_doKeyUp:function(e){var t=$.datepicker._getInst(e.target);if(t.input.val()!=t.lastVal)try{var n=$.datepicker.parseDate($.datepicker._get(t,"dateFormat"),t.input?t.input.val():null,$.datepicker._getFormatConfig(t));n&&($.datepicker._setDateFromField(t),$.datepicker._updateAlternate(t),$.datepicker._updateDatepicker(t))}catch(r){$.datepicker.log(r)}return!0},_showDatepicker:function(e){e=e.target||e,e.nodeName.toLowerCase()!="input"&&(e=$("input",e.parentNode)[0]);if($.datepicker._isDisabledDatepicker(e)||$.datepicker._lastInput==e)return;var t=$.datepicker._getInst(e);$.datepicker._curInst&&$.datepicker._curInst!=t&&($.datepicker._curInst.dpDiv.stop(!0,!0),t&&$.datepicker._datepickerShowing&&$.datepicker._hideDatepicker($.datepicker._curInst.input[0]));var n=$.datepicker._get(t,"beforeShow"),r=n?n.apply(e,[e,t]):{};if(r===!1)return;extendRemove(t.settings,r),t.lastVal=null,$.datepicker._lastInput=e,$.datepicker._setDateFromField(t),$.datepicker._inDialog&&(e.value=""),$.datepicker._pos||($.datepicker._pos=$.datepicker._findPos(e),$.datepicker._pos[1]+=e.offsetHeight);var i=!1;$(e).parents().each(function(){return i|=$(this).css("position")=="fixed",!i});var s={left:$.datepicker._pos[0],top:$.datepicker._pos[1]};$.datepicker._pos=null,t.dpDiv.empty(),t.dpDiv.css({position:"absolute",display:"block",top:"-1000px"}),$.datepicker._updateDatepicker(t),s=$.datepicker._checkOffset(t,s,i),t.dpDiv.css({position:$.datepicker._inDialog&&$.blockUI?"static":i?"fixed":"absolute",display:"none",left:s.left+"px",top:s.top+"px"});if(!t.inline){var o=$.datepicker._get(t,"showAnim"),u=$.datepicker._get(t,"duration"),a=function(){var e=t.dpDiv.find("iframe.ui-datepicker-cover");if(!!e.length){var n=$.datepicker._getBorders(t.dpDiv);e.css({left:-n[0],top:-n[1],width:t.dpDiv.outerWidth(),height:t.dpDiv.outerHeight()})}};t.dpDiv.zIndex($(e).zIndex()+1),$.datepicker._datepickerShowing=!0,$.effects&&($.effects.effect[o]||$.effects[o])?t.dpDiv.show(o,$.datepicker._get(t,"showOptions"),u,a):t.dpDiv[o||"show"](o?u:null,a),(!o||!u)&&a(),t.input.is(":visible")&&!t.input.is(":disabled")&&t.input.focus(),$.datepicker._curInst=t}},_updateDatepicker:function(e){this.maxRows=4;var t=$.datepicker._getBorders(e.dpDiv);instActive=e,e.dpDiv.empty().append(this._generateHTML(e)),this._attachHandlers(e);var n=e.dpDiv.find("iframe.ui-datepicker-cover");!n.length||n.css({left:-t[0],top:-t[1],width:e.dpDiv.outerWidth(),height:e.dpDiv.outerHeight()}),e.dpDiv.find("."+this._dayOverClass+" a").mouseover();var r=this._getNumberOfMonths(e),i=r[1],s=17;e.dpDiv.removeClass("ui-datepicker-multi-2 ui-datepicker-multi-3 ui-datepicker-multi-4").width(""),i>1&&e.dpDiv.addClass("ui-datepicker-multi-"+i).css("width",s*i+"em"),e.dpDiv[(r[0]!=1||r[1]!=1?"add":"remove")+"Class"]("ui-datepicker-multi"),e.dpDiv[(this._get(e,"isRTL")?"add":"remove")+"Class"]("ui-datepicker-rtl"),e==$.datepicker._curInst&&$.datepicker._datepickerShowing&&e.input&&e.input.is(":visible")&&!e.input.is(":disabled")&&e.input[0]!=document.activeElement&&e.input.focus();if(e.yearshtml){var o=e.yearshtml;setTimeout(function(){o===e.yearshtml&&e.yearshtml&&e.dpDiv.find("select.ui-datepicker-year:first").replaceWith(e.yearshtml),o=e.yearshtml=null},0)}},_getBorders:function(e){var t=function(e){return{thin:1,medium:2,thick:3}[e]||e};return[parseFloat(t(e.css("border-left-width"))),parseFloat(t(e.css("border-top-width")))]},_checkOffset:function(e,t,n){var r=e.dpDiv.outerWidth(),i=e.dpDiv.outerHeight(),s=e.input?e.input.outerWidth():0,o=e.input?e.input.outerHeight():0,u=document.documentElement.clientWidth+(n?0:$(document).scrollLeft()),a=document.documentElement.clientHeight+(n?0:$(document).scrollTop());return t.left-=this._get(e,"isRTL")?r-s:0,t.left-=n&&t.left==e.input.offset().left?$(document).scrollLeft():0,t.top-=n&&t.top==e.input.offset().top+o?$(document).scrollTop():0,t.left-=Math.min(t.left,t.left+r>u&&u>r?Math.abs(t.left+r-u):0),t.top-=Math.min(t.top,t.top+i>a&&a>i?Math.abs(i+o):0),t},_findPos:function(e){var t=this._getInst(e),n=this._get(t,"isRTL");while(e&&(e.type=="hidden"||e.nodeType!=1||$.expr.filters.hidden(e)))e=e[n?"previousSibling":"nextSibling"];var r=$(e).offset();return[r.left,r.top]},_hideDatepicker:function(e){var t=this._curInst;if(!t||e&&t!=$.data(e,PROP_NAME))return;if(this._datepickerShowing){var n=this._get(t,"showAnim"),r=this._get(t,"duration"),i=function(){$.datepicker._tidyDialog(t)};$.effects&&($.effects.effect[n]||$.effects[n])?t.dpDiv.hide(n,$.datepicker._get(t,"showOptions"),r,i):t.dpDiv[n=="slideDown"?"slideUp":n=="fadeIn"?"fadeOut":"hide"](n?r:null,i),n||i(),this._datepickerShowing=!1;var s=this._get(t,"onClose");s&&s.apply(t.input?t.input[0]:null,[t.input?t.input.val():"",t]),this._lastInput=null,this._inDialog&&(this._dialogInput.css({position:"absolute",left:"0",top:"-100px"}),$.blockUI&&($.unblockUI(),$("body").append(this.dpDiv))),this._inDialog=!1}},_tidyDialog:function(e){e.dpDiv.removeClass(this._dialogClass).unbind(".ui-datepicker-calendar")},_checkExternalClick:function(e){if(!$.datepicker._curInst)return;var t=$(e.target),n=$.datepicker._getInst(t[0]);(t[0].id!=$.datepicker._mainDivId&&t.parents("#"+$.datepicker._mainDivId).length==0&&!t.hasClass($.datepicker.markerClassName)&&!t.closest("."+$.datepicker._triggerClass).length&&$.datepicker._datepickerShowing&&(!$.datepicker._inDialog||!$.blockUI)||t.hasClass($.datepicker.markerClassName)&&$.datepicker._curInst!=n)&&$.datepicker._hideDatepicker()},_adjustDate:function(e,t,n){var r=$(e),i=this._getInst(r[0]);if(this._isDisabledDatepicker(r[0]))return;this._adjustInstDate(i,t+(n=="M"?this._get(i,"showCurrentAtPos"):0),n),this._updateDatepicker(i)},_gotoToday:function(e){var t=$(e),n=this._getInst(t[0]);if(this._get(n,"gotoCurrent")&&n.currentDay)n.selectedDay=n.currentDay,n.drawMonth=n.selectedMonth=n.currentMonth,n.drawYear=n.selectedYear=n.currentYear;else{var r=new Date;n.selectedDay=r.getDate(),n.drawMonth=n.selectedMonth=r.getMonth(),n.drawYear=n.selectedYear=r.getFullYear()}this._notifyChange(n),this._adjustDate(t)},_selectMonthYear:function(e,t,n){var r=$(e),i=this._getInst(r[0]);i["selected"+(n=="M"?"Month":"Year")]=i["draw"+(n=="M"?"Month":"Year")]=parseInt(t.options[t.selectedIndex].value,10),this._notifyChange(i),this._adjustDate(r)},_selectDay:function(e,t,n,r){var i=$(e);if($(r).hasClass(this._unselectableClass)||this._isDisabledDatepicker(i[0]))return;var s=this._getInst(i[0]);s.selectedDay=s.currentDay=$("a",r).html(),s.selectedMonth=s.currentMonth=t,s.selectedYear=s.currentYear=n,this._selectDate(e,this._formatDate(s,s.currentDay,s.currentMonth,s.currentYear))},_clearDate:function(e){var t=$(e),n=this._getInst(t[0]);this._selectDate(t,"")},_selectDate:function(e,t){var n=$(e),r=this._getInst(n[0]);t=t!=null?t:this._formatDate(r),r.input&&r.input.val(t),this._updateAlternate(r);var i=this._get(r,"onSelect");i?i.apply(r.input?r.input[0]:null,[t,r]):r.input&&r.input.trigger("change"),r.inline?this._updateDatepicker(r):(this._hideDatepicker(),this._lastInput=r.input[0],typeof r.input[0]!="object"&&r.input.focus(),this._lastInput=null)},_updateAlternate:function(e){var t=this._get(e,"altField");if(t){var n=this._get(e,"altFormat")||this._get(e,"dateFormat"),r=this._getDate(e),i=this.formatDate(n,r,this._getFormatConfig(e));$(t).each(function(){$(this).val(i)})}},noWeekends:function(e){var t=e.getDay();return[t>0&&t<6,""]},iso8601Week:function(e){var t=new Date(e.getTime());t.setDate(t.getDate()+4-(t.getDay()||7));var n=t.getTime();return t.setMonth(0),t.setDate(1),Math.floor(Math.round((n-t)/864e5)/7)+1},parseDate:function(e,t,n){if(e==null||t==null)throw"Invalid arguments";t=typeof t=="object"?t.toString():t+"";if(t=="")return null;var r=(n?n.shortYearCutoff:null)||this._defaults.shortYearCutoff;r=typeof r!="string"?r:(new Date).getFullYear()%100+parseInt(r,10);var i=(n?n.dayNamesShort:null)||this._defaults.dayNamesShort,s=(n?n.dayNames:null)||this._defaults.dayNames,o=(n?n.monthNamesShort:null)||this._defaults.monthNamesShort,u=(n?n.monthNames:null)||this._defaults.monthNames,a=-1,f=-1,l=-1,c=-1,h=!1,p=function(t){var n=y+1<e.length&&e.charAt(y+1)==t;return n&&y++,n},d=function(e){var n=p(e),r=e=="@"?14:e=="!"?20:e=="y"&&n?4:e=="o"?3:2,i=new RegExp("^\\d{1,"+r+"}"),s=t.substring(g).match(i);if(!s)throw"Missing number at position "+g;return g+=s[0].length,parseInt(s[0],10)},v=function(e,n,r){var i=$.map(p(e)?r:n,function(e,t){return[[t,e]]}).sort(function(e,t){return-(e[1].length-t[1].length)}),s=-1;$.each(i,function(e,n){var r=n[1];if(t.substr(g,r.length).toLowerCase()==r.toLowerCase())return s=n[0],g+=r.length,!1});if(s!=-1)return s+1;throw"Unknown name at position "+g},m=function(){if(t.charAt(g)!=e.charAt(y))throw"Unexpected literal at position "+g;g++},g=0;for(var y=0;y<e.length;y++)if(h)e.charAt(y)=="'"&&!p("'")?h=!1:m();else switch(e.charAt(y)){case"d":l=d("d");break;case"D":v("D",i,s);break;case"o":c=d("o");break;case"m":f=d("m");break;case"M":f=v("M",o,u);break;case"y":a=d("y");break;case"@":var b=new Date(d("@"));a=b.getFullYear(),f=b.getMonth()+1,l=b.getDate();break;case"!":var b=new Date((d("!")-this._ticksTo1970)/1e4);a=b.getFullYear(),f=b.getMonth()+1,l=b.getDate();break;case"'":p("'")?m():h=!0;break;default:m()}if(g<t.length){var w=t.substr(g);if(!/^\s+/.test(w))throw"Extra/unparsed characters found in date: "+w}a==-1?a=(new Date).getFullYear():a<100&&(a+=(new Date).getFullYear()-(new Date).getFullYear()%100+(a<=r?0:-100));if(c>-1){f=1,l=c;do{var E=this._getDaysInMonth(a,f-1);if(l<=E)break;f++,l-=E}while(!0)}var b=this._daylightSavingAdjust(new Date(a,f-1,l));if(b.getFullYear()!=a||b.getMonth()+1!=f||b.getDate()!=l)throw"Invalid date";return b},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:(718685+Math.floor(492.5)-Math.floor(19.7)+Math.floor(4.925))*24*60*60*1e7,formatDate:function(e,t,n){if(!t)return"";var r=(n?n.dayNamesShort:null)||this._defaults.dayNamesShort,i=(n?n.dayNames:null)||this._defaults.dayNames,s=(n?n.monthNamesShort:null)||this._defaults.monthNamesShort,o=(n?n.monthNames:null)||this._defaults.monthNames,u=function(t){var n=h+1<e.length&&e.charAt(h+1)==t;return n&&h++,n},a=function(e,t,n){var r=""+t;if(u(e))while(r.length<n)r="0"+r;return r},f=function(e,t,n,r){return u(e)?r[t]:n[t]},l="",c=!1;if(t)for(var h=0;h<e.length;h++)if(c)e.charAt(h)=="'"&&!u("'")?c=!1:l+=e.charAt(h);else switch(e.charAt(h)){case"d":l+=a("d",t.getDate(),2);break;case"D":l+=f("D",t.getDay(),r,i);break;case"o":l+=a("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+=a("m",t.getMonth()+1,2);break;case"M":l+=f("M",t.getMonth(),s,o);break;case"y":l+=u("y")?t.getFullYear():(t.getYear()%100<10?"0":"")+t.getYear()%100;break;case"@":l+=t.getTime();break;case"!":l+=t.getTime()*1e4+this._ticksTo1970;break;case"'":u("'")?l+="'":c=!0;break;default:l+=e.charAt(h)}return l},_possibleChars:function(e){var t="",n=!1,r=function(t){var n=i+1<e.length&&e.charAt(i+1)==t;return n&&i++,n};for(var i=0;i<e.length;i++)if(n)e.charAt(i)=="'"&&!r("'")?n=!1:t+=e.charAt(i);else switch(e.charAt(i)){case"d":case"m":case"y":case"@":t+="0123456789";break;case"D":case"M":return null;case"'":r("'")?t+="'":n=!0;break;default:t+=e.charAt(i)}return t},_get:function(e,t){return e.settings[t]!==undefined?e.settings[t]:this._defaults[t]},_setDateFromField:function(e,t){if(e.input.val()==e.lastVal)return;var n=this._get(e,"dateFormat"),r=e.lastVal=e.input?e.input.val():null,i,s;i=s=this._getDefaultDate(e);var o=this._getFormatConfig(e);try{i=this.parseDate(n,r,o)||s}catch(u){this.log(u),r=t?"":r}e.selectedDay=i.getDate(),e.drawMonth=e.selectedMonth=i.getMonth(),e.drawYear=e.selectedYear=i.getFullYear(),e.currentDay=r?i.getDate():0,e.currentMonth=r?i.getMonth():0,e.currentYear=r?i.getFullYear():0,this._adjustInstDate(e)},_getDefaultDate:function(e){return this._restrictMinMax(e,this._determineDate(e,this._get(e,"defaultDate"),new Date))},_determineDate:function(e,t,n){var r=function(e){var t=new Date;return t.setDate(t.getDate()+e),t},i=function(t){try{return $.datepicker.parseDate($.datepicker._get(e,"dateFormat"),t,$.datepicker._getFormatConfig(e))}catch(n){}var r=(t.toLowerCase().match(/^c/)?$.datepicker._getDate(e):null)||new Date,i=r.getFullYear(),s=r.getMonth(),o=r.getDate(),u=/([+-]?[0-9]+)\s*(d|D|w|W|m|M|y|Y)?/g,a=u.exec(t);while(a){switch(a[2]||"d"){case"d":case"D":o+=parseInt(a[1],10);break;case"w":case"W":o+=parseInt(a[1],10)*7;break;case"m":case"M":s+=parseInt(a[1],10),o=Math.min(o,$.datepicker._getDaysInMonth(i,s));break;case"y":case"Y":i+=parseInt(a[1],10),o=Math.min(o,$.datepicker._getDaysInMonth(i,s))}a=u.exec(t)}return new Date(i,s,o)},s=t==null||t===""?n:typeof t=="string"?i(t):typeof t=="number"?isNaN(t)?n:r(t):new Date(t.getTime());return s=s&&s.toString()=="Invalid Date"?n:s,s&&(s.setHours(0),s.setMinutes(0),s.setSeconds(0),s.setMilliseconds(0)),this._daylightSavingAdjust(s)},_daylightSavingAdjust:function(e){return e?(e.setHours(e.getHours()>12?e.getHours()+2:0),e):null},_setDate:function(e,t,n){var r=!t,i=e.selectedMonth,s=e.selectedYear,o=this._restrictMinMax(e,this._determineDate(e,t,new Date));e.selectedDay=e.currentDay=o.getDate(),e.drawMonth=e.selectedMonth=e.currentMonth=o.getMonth(),e.drawYear=e.selectedYear=e.currentYear=o.getFullYear(),(i!=e.selectedMonth||s!=e.selectedYear)&&!n&&this._notifyChange(e),this._adjustInstDate(e),e.input&&e.input.val(r?"":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(e){var t=this._get(e,"stepMonths"),n="#"+e.id.replace(/\\\\/g,"\\");e.dpDiv.find("[data-handler]").map(function(){var e={prev:function(){window["DP_jQuery_"+dpuuid].datepicker._adjustDate(n,-t,"M")},next:function(){window["DP_jQuery_"+dpuuid].datepicker._adjustDate(n,+t,"M")},hide:function(){window["DP_jQuery_"+dpuuid].datepicker._hideDatepicker()},today:function(){window["DP_jQuery_"+dpuuid].datepicker._gotoToday(n)},selectDay:function(){return window["DP_jQuery_"+dpuuid].datepicker._selectDay(n,+this.getAttribute("data-month"),+this.getAttribute("data-year"),this),!1},selectMonth:function(){return window["DP_jQuery_"+dpuuid].datepicker._selectMonthYear(n,this,"M"),!1},selectYear:function(){return window["DP_jQuery_"+dpuuid].datepicker._selectMonthYear(n,this,"Y"),!1}};$(this).bind(this.getAttribute("data-event"),e[this.getAttribute("data-handler")])})},_generateHTML:function(e){var t=new Date;t=this._daylightSavingAdjust(new Date(t.getFullYear(),t.getMonth(),t.getDate()));var n=this._get(e,"isRTL"),r=this._get(e,"showButtonPanel"),i=this._get(e,"hideIfNoPrevNext"),s=this._get(e,"navigationAsDateFormat"),o=this._getNumberOfMonths(e),u=this._get(e,"showCurrentAtPos"),a=this._get(e,"stepMonths"),f=o[0]!=1||o[1]!=1,l=this._daylightSavingAdjust(e.currentDay?new Date(e.currentYear,e.currentMonth,e.currentDay):new Date(9999,9,9)),c=this._getMinMaxDate(e,"min"),h=this._getMinMaxDate(e,"max"),p=e.drawMonth-u,d=e.drawYear;p<0&&(p+=12,d--);if(h){var v=this._daylightSavingAdjust(new Date(h.getFullYear(),h.getMonth()-o[0]*o[1]+1,h.getDate()));v=c&&v<c?c:v;while(this._daylightSavingAdjust(new Date(d,p,1))>v)p--,p<0&&(p=11,d--)}e.drawMonth=p,e.drawYear=d;var m=this._get(e,"prevText");m=s?this.formatDate(m,this._daylightSavingAdjust(new Date(d,p-a,1)),this._getFormatConfig(e)):m;var g=this._canAdjustMonth(e,-1,d,p)?'<a class="ui-datepicker-prev ui-corner-all" data-handler="prev" data-event="click" title="'+m+'"><span class="ui-icon ui-icon-circle-triangle-'+(n?"e":"w")+'">'+m+"</span></a>":i?"":'<a class="ui-datepicker-prev ui-corner-all ui-state-disabled" title="'+m+'"><span class="ui-icon ui-icon-circle-triangle-'+(n?"e":"w")+'">'+m+"</span></a>",y=this._get(e,"nextText");y=s?this.formatDate(y,this._daylightSavingAdjust(new Date(d,p+a,1)),this._getFormatConfig(e)):y;var b=this._canAdjustMonth(e,1,d,p)?'<a class="ui-datepicker-next ui-corner-all" data-handler="next" data-event="click" title="'+y+'"><span class="ui-icon ui-icon-circle-triangle-'+(n?"w":"e")+'">'+y+"</span></a>":i?"":'<a class="ui-datepicker-next ui-corner-all ui-state-disabled" title="'+y+'"><span class="ui-icon ui-icon-circle-triangle-'+(n?"w":"e")+'">'+y+"</span></a>",w=this._get(e,"currentText"),E=this._get(e,"gotoCurrent")&&e.currentDay?l:t;w=s?this.formatDate(w,E,this._getFormatConfig(e)):w;var S=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>",x=r?'<div class="ui-datepicker-buttonpane ui-widget-content">'+(n?S:"")+(this._isInRange(e,E)?'<button type="button" class="ui-datepicker-current ui-state-default ui-priority-secondary ui-corner-all" data-handler="today" data-event="click">'+w+"</button>":"")+(n?"":S)+"</div>":"",T=parseInt(this._get(e,"firstDay"),10);T=isNaN(T)?0:T;var N=this._get(e,"showWeek"),C=this._get(e,"dayNames"),k=this._get(e,"dayNamesShort"),L=this._get(e,"dayNamesMin"),A=this._get(e,"monthNames"),O=this._get(e,"monthNamesShort"),M=this._get(e,"beforeShowDay"),_=this._get(e,"showOtherMonths"),D=this._get(e,"selectOtherMonths"),P=this._get(e,"calculateWeek")||this.iso8601Week,H=this._getDefaultDate(e),B="";for(var j=0;j<o[0];j++){var F="";this.maxRows=4;for(var I=0;I<o[1];I++){var q=this._daylightSavingAdjust(new Date(d,p,e.selectedDay)),R=" ui-corner-all",U="";if(f){U+='<div class="ui-datepicker-group';if(o[1]>1)switch(I){case 0:U+=" ui-datepicker-group-first",R=" ui-corner-"+(n?"right":"left");break;case o[1]-1:U+=" ui-datepicker-group-last",R=" ui-corner-"+(n?"left":"right");break;default:U+=" ui-datepicker-group-middle",R=""}U+='">'}U+='<div class="ui-datepicker-header ui-widget-header ui-helper-clearfix'+R+'">'+(/all|left/.test(R)&&j==0?n?b:g:"")+(/all|right/.test(R)&&j==0?n?g:b:"")+this._generateMonthYearHeader(e,p,d,c,h,j>0||I>0,A,O)+'</div><table class="ui-datepicker-calendar"><thead>'+"<tr>";var z=N?'<th class="ui-datepicker-week-col">'+this._get(e,"weekHeader")+"</th>":"";for(var W=0;W<7;W++){var X=(W+T)%7;z+="<th"+((W+T+6)%7>=5?' class="ui-datepicker-week-end"':"")+">"+'<span title="'+C[X]+'">'+L[X]+"</span></th>"}U+=z+"</tr></thead><tbody>";var V=this._getDaysInMonth(d,p);d==e.selectedYear&&p==e.selectedMonth&&(e.selectedDay=Math.min(e.selectedDay,V));var J=(this._getFirstDayOfMonth(d,p)-T+7)%7,K=Math.ceil((J+V)/7),Q=f?this.maxRows>K?this.maxRows:K:K;this.maxRows=Q;var G=this._daylightSavingAdjust(new Date(d,p,1-J));for(var Y=0;Y<Q;Y++){U+="<tr>";var Z=N?'<td class="ui-datepicker-week-col">'+this._get(e,"calculateWeek")(G)+"</td>":"";for(var W=0;W<7;W++){var et=M?M.apply(e.input?e.input[0]:null,[G]):[!0,""],tt=G.getMonth()!=p,nt=tt&&!D||!et[0]||c&&G<c||h&&G>h;Z+='<td class="'+((W+T+6)%7>=5?" ui-datepicker-week-end":"")+(tt?" ui-datepicker-other-month":"")+(G.getTime()==q.getTime()&&p==e.selectedMonth&&e._keyEvent||H.getTime()==G.getTime()&&H.getTime()==q.getTime()?" "+this._dayOverClass:"")+(nt?" "+this._unselectableClass+" ui-state-disabled":"")+(tt&&!_?"":" "+et[1]+(G.getTime()==l.getTime()?" "+this._currentClass:"")+(G.getTime()==t.getTime()?" ui-datepicker-today":""))+'"'+((!tt||_)&&et[2]?' title="'+et[2]+'"':"")+(nt?"":' data-handler="selectDay" data-event="click" data-month="'+G.getMonth()+'" data-year="'+G.getFullYear()+'"')+">"+(tt&&!_?" ":nt?'<span class="ui-state-default">'+G.getDate()+"</span>":'<a class="ui-state-default'+(G.getTime()==t.getTime()?" ui-state-highlight":"")+(G.getTime()==l.getTime()?" ui-state-active":"")+(tt?" ui-priority-secondary":"")+'" href="#">'+G.getDate()+"</a>")+"</td>",G.setDate(G.getDate()+1),G=this._daylightSavingAdjust(G)}U+=Z+"</tr>"}p++,p>11&&(p=0,d++),U+="</tbody></table>"+(f?"</div>"+(o[0]>0&&I==o[1]-1?'<div class="ui-datepicker-row-break"></div>':""):""),F+=U}B+=F}return B+=x+($.ui.ie6&&!e.inline?'<iframe src="javascript:false;" class="ui-datepicker-cover" frameborder="0"></iframe>':""),e._keyEvent=!1,B},_generateMonthYearHeader:function(e,t,n,r,i,s,o,u){var a=this._get(e,"changeMonth"),f=this._get(e,"changeYear"),l=this._get(e,"showMonthAfterYear"),c='<div class="ui-datepicker-title">',h="";if(s||!a)h+='<span class="ui-datepicker-month">'+o[t]+"</span>";else{var p=r&&r.getFullYear()==n,d=i&&i.getFullYear()==n;h+='<select class="ui-datepicker-month" data-handler="selectMonth" data-event="change">';for(var v=0;v<12;v++)(!p||v>=r.getMonth())&&(!d||v<=i.getMonth())&&(h+='<option value="'+v+'"'+(v==t?' selected="selected"':"")+">"+u[v]+"</option>");h+="</select>"}l||(c+=h+(s||!a||!f?" ":""));if(!e.yearshtml){e.yearshtml="";if(s||!f)c+='<span class="ui-datepicker-year">'+n+"</span>";else{var m=this._get(e,"yearRange").split(":"),g=(new Date).getFullYear(),y=function(e){var t=e.match(/c[+-].*/)?n+parseInt(e.substring(1),10):e.match(/[+-].*/)?g+parseInt(e,10):parseInt(e,10);return isNaN(t)?g:t},b=y(m[0]),w=Math.max(b,y(m[1]||""));b=r?Math.max(b,r.getFullYear()):b,w=i?Math.min(w,i.getFullYear()):w,e.yearshtml+='<select class="ui-datepicker-year" data-handler="selectYear" data-event="change">';for(;b<=w;b++)e.yearshtml+='<option value="'+b+'"'+(b==n?' selected="selected"':"")+">"+b+"</option>";e.yearshtml+="</select>",c+=e.yearshtml,e.yearshtml=null}}return c+=this._get(e,"yearSuffix"),l&&(c+=(s||!a||!f?" ":"")+h),c+="</div>",c},_adjustInstDate:function(e,t,n){var r=e.drawYear+(n=="Y"?t:0),i=e.drawMonth+(n=="M"?t:0),s=Math.min(e.selectedDay,this._getDaysInMonth(r,i))+(n=="D"?t:0),o=this._restrictMinMax(e,this._daylightSavingAdjust(new Date(r,i,s)));e.selectedDay=o.getDate(),e.drawMonth=e.selectedMonth=o.getMonth(),e.drawYear=e.selectedYear=o.getFullYear(),(n=="M"||n=="Y")&&this._notifyChange(e)},_restrictMinMax:function(e,t){var n=this._getMinMaxDate(e,"min"),r=this._getMinMaxDate(e,"max"),i=n&&t<n?n:t;return i=r&&i>r?r:i,i},_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 t==null?[1,1]:typeof t=="number"?[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,n,r){var i=this._getNumberOfMonths(e),s=this._daylightSavingAdjust(new Date(n,r+(t<0?t:i[0]*i[1]),1));return t<0&&s.setDate(this._getDaysInMonth(s.getFullYear(),s.getMonth())),this._isInRange(e,s)},_isInRange:function(e,t){var n=this._getMinMaxDate(e,"min"),r=this._getMinMaxDate(e,"max");return(!n||t.getTime()>=n.getTime())&&(!r||t.getTime()<=r.getTime())},_getFormatConfig:function(e){var t=this._get(e,"shortYearCutoff");return t=typeof t!="string"?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,n,r){t||(e.currentDay=e.selectedDay,e.currentMonth=e.selectedMonth,e.currentYear=e.selectedYear);var i=t?typeof t=="object"?t:this._daylightSavingAdjust(new Date(r,n,t)):this._daylightSavingAdjust(new Date(e.currentYear,e.currentMonth,e.currentDay));return this.formatDate(this._get(e,"dateFormat"),i,this._getFormatConfig(e))}}),$.fn.datepicker=function(e){if(!this.length)return this;$.datepicker.initialized||($(document).mousedown($.datepicker._checkExternalClick).find(document.body).append($.datepicker.dpDiv),$.datepicker.initialized=!0);var t=Array.prototype.slice.call(arguments,1);return typeof e!="string"||e!="isDisabled"&&e!="getDate"&&e!="widget"?e=="option"&&arguments.length==2&&typeof arguments[1]=="string"?$.datepicker["_"+e+"Datepicker"].apply($.datepicker,[this[0]].concat(t)):this.each(function(){typeof e=="string"?$.datepicker["_"+e+"Datepicker"].apply($.datepicker,[this].concat(t)):$.datepicker._attachDatepicker(this,e)}):$.datepicker["_"+e+"Datepicker"].apply($.datepicker,[this[0]].concat(t))},$.datepicker=new Datepicker,$.datepicker.initialized=!1,$.datepicker.uuid=(new Date).getTime(),$.datepicker.version="1.9.1",window["DP_jQuery_"+dpuuid]=$})(jQuery);(function(e,t){var n="ui-dialog ui-widget ui-widget-content ui-corner-all ",r={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.9.1",options:{autoOpen:!0,buttons:{},closeOnEscape:!0,closeText:"close",dialogClass:"",draggable:!0,hide:null,height:"auto",maxHeight:!1,maxWidth:!1,minHeight:150,minWidth:150,modal:!1,position:{my:"center",at:"center",of:window,collision:"fit",using:function(t){var n=e(this).css(t).offset().top;n<0&&e(this).css("top",t.top-n)}},resizable:!0,show:null,stack:!0,title:"",width:300,zIndex:1e3},_create:function(){this.originalTitle=this.element.attr("title"),typeof this.originalTitle!="string"&&(this.originalTitle=""),this.oldPosition={parent:this.element.parent(),index:this.element.parent().children().index(this.element)},this.options.title=this.options.title||this.originalTitle;var t=this,r=this.options,i=r.title||" ",s,o,u,a,f;s=(this.uiDialog=e("<div>")).addClass(n+r.dialogClass).css({display:"none",outline:0,zIndex:r.zIndex}).attr("tabIndex",-1).keydown(function(n){r.closeOnEscape&&!n.isDefaultPrevented()&&n.keyCode&&n.keyCode===e.ui.keyCode.ESCAPE&&(t.close(n),n.preventDefault())}).mousedown(function(e){t.moveToTop(!1,e)}).appendTo("body"),this.element.show().removeAttr("title").addClass("ui-dialog-content ui-widget-content").appendTo(s),o=(this.uiDialogTitlebar=e("<div>")).addClass("ui-dialog-titlebar ui-widget-header ui-corner-all ui-helper-clearfix").bind("mousedown",function(){s.focus()}).prependTo(s),u=e("<a href='#'></a>").addClass("ui-dialog-titlebar-close ui-corner-all").attr("role","button").click(function(e){e.preventDefault(),t.close(e)}).appendTo(o),(this.uiDialogTitlebarCloseText=e("<span>")).addClass("ui-icon ui-icon-closethick").text(r.closeText).appendTo(u),a=e("<span>").uniqueId().addClass("ui-dialog-title").html(i).prependTo(o),f=(this.uiDialogButtonPane=e("<div>")).addClass("ui-dialog-buttonpane ui-widget-content ui-helper-clearfix"),(this.uiButtonSet=e("<div>")).addClass("ui-dialog-buttonset").appendTo(f),s.attr({role:"dialog","aria-labelledby":a.attr("id")}),o.find("*").add(o).disableSelection(),this._hoverable(u),this._focusable(u),r.draggable&&e.fn.draggable&&this._makeDraggable(),r.resizable&&e.fn.resizable&&this._makeResizable(),this._createButtons(r.buttons),this._isOpen=!1,e.fn.bgiframe&&s.bgiframe(),this._on(s,{keydown:function(t){if(!r.modal||t.keyCode!==e.ui.keyCode.TAB)return;var n=e(":tabbable",s),i=n.filter(":first"),o=n.filter(":last");if(t.target===o[0]&&!t.shiftKey)return i.focus(1),!1;if(t.target===i[0]&&t.shiftKey)return o.focus(1),!1}})},_init:function(){this.options.autoOpen&&this.open()},_destroy:function(){var e,t=this.oldPosition;this.overlay&&this.overlay.destroy(),this.uiDialog.hide(),this.element.removeClass("ui-dialog-content ui-widget-content").hide().appendTo("body"),this.uiDialog.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},close:function(t){var n=this,r,i;if(!this._isOpen)return;if(!1===this._trigger("beforeClose",t))return;return this._isOpen=!1,this.overlay&&this.overlay.destroy(),this.options.hide?this._hide(this.uiDialog,this.options.hide,function(){n._trigger("close",t)}):(this.uiDialog.hide(),this._trigger("close",t)),e.ui.dialog.overlay.resize(),this.options.modal&&(r=0,e(".ui-dialog").each(function(){this!==n.uiDialog[0]&&(i=e(this).css("z-index"),isNaN(i)||(r=Math.max(r,i)))}),e.ui.dialog.maxZ=r),this},isOpen:function(){return this._isOpen},moveToTop:function(t,n){var r=this.options,i;return r.modal&&!t||!r.stack&&!r.modal?this._trigger("focus",n):(r.zIndex>e.ui.dialog.maxZ&&(e.ui.dialog.maxZ=r.zIndex),this.overlay&&(e.ui.dialog.maxZ+=1,e.ui.dialog.overlay.maxZ=e.ui.dialog.maxZ,this.overlay.$el.css("z-index",e.ui.dialog.overlay.maxZ)),i={scrollTop:this.element.scrollTop(),scrollLeft:this.element.scrollLeft()},e.ui.dialog.maxZ+=1,this.uiDialog.css("z-index",e.ui.dialog.maxZ),this.element.attr(i),this._trigger("focus",n),this)},open:function(){if(this._isOpen)return;var t,n=this.options,r=this.uiDialog;return this._size(),this._position(n.position),r.show(n.show),this.overlay=n.modal?new e.ui.dialog.overlay(this):null,this.moveToTop(!0),t=this.element.find(":tabbable"),t.length||(t=this.uiDialogButtonPane.find(":tabbable"),t.length||(t=r)),t.eq(0).focus(),this._isOpen=!0,this._trigger("open"),this},_createButtons:function(t){var n=this,r=!1;this.uiDialogButtonPane.remove(),this.uiButtonSet.empty(),typeof t=="object"&&t!==null&&e.each(t,function(){return!(r=!0)}),r?(e.each(t,function(t,r){r=e.isFunction(r)?{click:r,text:t}:r;var i=e("<button type='button'></button>").attr(r,!0).unbind("click").click(function(){r.click.apply(n.element[0],arguments)}).appendTo(n.uiButtonSet);e.fn.button&&i.button()}),this.uiDialog.addClass("ui-dialog-buttons"),this.uiDialogButtonPane.appendTo(this.uiDialog)):this.uiDialog.removeClass("ui-dialog-buttons")},_makeDraggable:function(){function r(e){return{position:e.position,offset:e.offset}}var t=this,n=this.options;this.uiDialog.draggable({cancel:".ui-dialog-content, .ui-dialog-titlebar-close",handle:".ui-dialog-titlebar",containment:"document",start:function(n,i){e(this).addClass("ui-dialog-dragging"),t._trigger("dragStart",n,r(i))},drag:function(e,n){t._trigger("drag",e,r(n))},stop:function(i,s){n.position=[s.position.left-t.document.scrollLeft(),s.position.top-t.document.scrollTop()],e(this).removeClass("ui-dialog-dragging"),t._trigger("dragStop",i,r(s)),e.ui.dialog.overlay.resize()}})},_makeResizable:function(n){function u(e){return{originalPosition:e.originalPosition,originalSize:e.originalSize,position:e.position,size:e.size}}n=n===t?this.options.resizable:n;var r=this,i=this.options,s=this.uiDialog.css("position"),o=typeof n=="string"?n:"n,e,s,w,se,sw,ne,nw";this.uiDialog.resizable({cancel:".ui-dialog-content",containment:"document",alsoResize:this.element,maxWidth:i.maxWidth,maxHeight:i.maxHeight,minWidth:i.minWidth,minHeight:this._minHeight(),handles:o,start:function(t,n){e(this).addClass("ui-dialog-resizing"),r._trigger("resizeStart",t,u(n))},resize:function(e,t){r._trigger("resize",e,u(t))},stop:function(t,n){e(this).removeClass("ui-dialog-resizing"),i.height=e(this).height(),i.width=e(this).width(),r._trigger("resizeStop",t,u(n)),e.ui.dialog.overlay.resize()}}).css("position",s).find(".ui-resizable-se").addClass("ui-icon ui-icon-grip-diagonal-se")},_minHeight:function(){var e=this.options;return e.height==="auto"?e.minHeight:Math.min(e.minHeight,e.height)},_position:function(t){var n=[],r=[0,0],i;if(t){if(typeof t=="string"||typeof t=="object"&&"0"in t)n=t.split?t.split(" "):[t[0],t[1]],n.length===1&&(n[1]=n[0]),e.each(["left","top"],function(e,t){+n[e]===n[e]&&(r[e]=n[e],n[e]=t)}),t={my:n[0]+(r[0]<0?r[0]:"+"+r[0])+" "+n[1]+(r[1]<0?r[1]:"+"+r[1]),at:n.join(" ")};t=e.extend({},e.ui.dialog.prototype.options.position,t)}else t=e.ui.dialog.prototype.options.position;i=this.uiDialog.is(":visible"),i||this.uiDialog.show(),this.uiDialog.position(t),i||this.uiDialog.hide()},_setOptions:function(t){var n=this,s={},o=!1;e.each(t,function(e,t){n._setOption(e,t),e in r&&(o=!0),e in i&&(s[e]=t)}),o&&this._size(),this.uiDialog.is(":data(resizable)")&&this.uiDialog.resizable("option",s)},_setOption:function(t,r){var i,s,o=this.uiDialog;switch(t){case"buttons":this._createButtons(r);break;case"closeText":this.uiDialogTitlebarCloseText.text(""+r);break;case"dialogClass":o.removeClass(this.options.dialogClass).addClass(n+r);break;case"disabled":r?o.addClass("ui-dialog-disabled"):o.removeClass("ui-dialog-disabled");break;case"draggable":i=o.is(":data(draggable)"),i&&!r&&o.draggable("destroy"),!i&&r&&this._makeDraggable();break;case"position":this._position(r);break;case"resizable":s=o.is(":data(resizable)"),s&&!r&&o.resizable("destroy"),s&&typeof r=="string"&&o.resizable("option","handles",r),!s&&r!==!1&&this._makeResizable(r);break;case"title":e(".ui-dialog-title",this.uiDialogTitlebar).html(""+(r||" "))}this._super(t,r)},_size:function(){var t,n,r,i=this.options,s=this.uiDialog.is(":visible");this.element.show().css({width:"auto",minHeight:0,height:0}),i.minWidth>i.width&&(i.width=i.minWidth),t=this.uiDialog.css({height:"auto",width:i.width}).outerHeight(),n=Math.max(0,i.minHeight-t),i.height==="auto"?e.support.minHeight?this.element.css({minHeight:n,height:"auto"}):(this.uiDialog.show(),r=this.element.css("height","auto").height(),s||this.uiDialog.hide(),this.element.height(Math.max(r,n))):this.element.height(Math.max(i.height-t,0)),this.uiDialog.is(":data(resizable)")&&this.uiDialog.resizable("option","minHeight",this._minHeight())}}),e.extend(e.ui.dialog,{uuid:0,maxZ:0,getTitleId:function(e){var t=e.attr("id");return t||(this.uuid+=1,t=this.uuid),"ui-dialog-title-"+t},overlay:function(t){this.$el=e.ui.dialog.overlay.create(t)}}),e.extend(e.ui.dialog.overlay,{instances:[],oldInstances:[],maxZ:0,events:e.map("focus,mousedown,mouseup,keydown,keypress,click".split(","),function(e){return e+".dialog-overlay"}).join(" "),create:function(t){this.instances.length===0&&(setTimeout(function(){e.ui.dialog.overlay.instances.length&&e(document).bind(e.ui.dialog.overlay.events,function(t){if(e(t.target).zIndex()<e.ui.dialog.overlay.maxZ)return!1})},1),e(window).bind("resize.dialog-overlay",e.ui.dialog.overlay.resize));var n=this.oldInstances.pop()||e("<div>").addClass("ui-widget-overlay");return e(document).bind("keydown.dialog-overlay",function(r){var i=e.ui.dialog.overlay.instances;i.length!==0&&i[i.length-1]===n&&t.options.closeOnEscape&&!r.isDefaultPrevented()&&r.keyCode&&r.keyCode===e.ui.keyCode.ESCAPE&&(t.close(r),r.preventDefault())}),n.appendTo(document.body).css({width:this.width(),height:this.height()}),e.fn.bgiframe&&n.bgiframe(),this.instances.push(n),n},destroy:function(t){var n=e.inArray(t,this.instances),r=0;n!==-1&&this.oldInstances.push(this.instances.splice(n,1)[0]),this.instances.length===0&&e([document,window]).unbind(".dialog-overlay"),t.height(0).width(0).remove(),e.each(this.instances,function(){r=Math.max(r,this.css("z-index"))}),this.maxZ=r},height:function(){var t,n;return e.ui.ie?(t=Math.max(document.documentElement.scrollHeight,document.body.scrollHeight),n=Math.max(document.documentElement.offsetHeight,document.body.offsetHeight),t<n?e(window).height()+"px":t+"px"):e(document).height()+"px"},width:function(){var t,n;return e.ui.ie?(t=Math.max(document.documentElement.scrollWidth,document.body.scrollWidth),n=Math.max(document.documentElement.offsetWidth,document.body.offsetWidth),t<n?e(window).width()+"px":t+"px"):e(document).width()+"px"},resize:function(){var t=e([]);e.each(e.ui.dialog.overlay.instances,function(){t=t.add(this)}),t.css({width:0,height:0}).css({width:e.ui.dialog.overlay.width(),height:e.ui.dialog.overlay.height()})}}),e.extend(e.ui.dialog.overlay.prototype,{destroy:function(){e.ui.dialog.overlay.destroy(this.$el)}})})(jQuery);(function(e,t){var n=!1;e.widget("ui.menu",{version:"1.9.1",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.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,e.proxy(function(e){this.options.disabled&&e.preventDefault()},this)),this.options.disabled&&this.element.addClass("ui-state-disabled").attr("aria-disabled","true"),this._on({"mousedown .ui-menu-item > a":function(e){e.preventDefault()},"click .ui-state-disabled > a":function(e){e.preventDefault()},"click .ui-menu-item:has(a)":function(t){var r=e(t.target).closest(".ui-menu-item");!n&&r.not(".ui-state-disabled").length&&(n=!0,this.select(t),r.has(".ui-menu").length?this.expand(t):this.element.is(":focus")||(this.element.trigger("focus",[!0]),this.active&&this.active.parents(".ui-menu").length===1&&clearTimeout(this.timer)))},"mouseenter .ui-menu-item":function(t){var n=e(t.currentTarget);n.siblings().children(".ui-state-active").removeClass("ui-state-active"),this.focus(t,n)},mouseleave:"collapseAll","mouseleave .ui-menu":"collapseAll",focus:function(e,t){var n=this.active||this.element.children(".ui-menu-item").eq(0);t||this.focus(e,n)},blur:function(t){this._delay(function(){e.contains(this.element[0],this.document[0].activeElement)||this.collapseAll(t)})},keydown:"_keydown"}),this.refresh(),this._on(this.document,{click:function(t){e(t.target).closest(".ui-menu").length||this.collapseAll(t),n=!1}})},_destroy:function(){this.element.removeAttr("aria-activedescendant").find(".ui-menu").andSelf().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 t=e(this);t.data("ui-menu-submenu-carat")&&t.remove()}),this.element.find(".ui-menu-divider").removeClass("ui-menu-divider ui-widget-content")},_keydown:function(t){function a(e){return e.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}var n,r,i,s,o,u=!0;switch(t.keyCode){case e.ui.keyCode.PAGE_UP:this.previousPage(t);break;case e.ui.keyCode.PAGE_DOWN:this.nextPage(t);break;case e.ui.keyCode.HOME:this._move("first","first",t);break;case e.ui.keyCode.END:this._move("last","last",t);break;case e.ui.keyCode.UP:this.previous(t);break;case e.ui.keyCode.DOWN:this.next(t);break;case e.ui.keyCode.LEFT:this.collapse(t);break;case e.ui.keyCode.RIGHT:this.active&&!this.active.is(".ui-state-disabled")&&this.expand(t);break;case e.ui.keyCode.ENTER:case e.ui.keyCode.SPACE:this._activate(t);break;case e.ui.keyCode.ESCAPE:this.collapse(t);break;default:u=!1,r=this.previousFilter||"",i=String.fromCharCode(t.keyCode),s=!1,clearTimeout(this.filterTimer),i===r?s=!0:i=r+i,o=new RegExp("^"+a(i),"i"),n=this.activeMenu.children(".ui-menu-item").filter(function(){return o.test(e(this).children("a").text())}),n=s&&n.index(this.active.next())!==-1?this.active.nextAll(".ui-menu-item"):n,n.length||(i=String.fromCharCode(t.keyCode),o=new RegExp("^"+a(i),"i"),n=this.activeMenu.children(".ui-menu-item").filter(function(){return o.test(e(this).children("a").text())})),n.length?(this.focus(t,n),n.length>1?(this.previousFilter=i,this.filterTimer=this._delay(function(){delete this.previousFilter},1e3)):delete this.previousFilter):delete this.previousFilter}u&&t.preventDefault()},_activate:function(e){this.active.is(".ui-state-disabled")||(this.active.children("a[aria-haspopup='true']").length?this.expand(e):this.select(e))},refresh:function(){var t,n=this.options.icons.submenu,r=this.element.find(this.options.menus+":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"});t=r.add(this.element),t.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()}),t.children(":not(.ui-menu-item)").each(function(){var t=e(this);/[^\-—–\s]/.test(t.text())||t.addClass("ui-widget-content ui-menu-divider")}),t.children(".ui-state-disabled").attr("aria-disabled","true"),r.each(function(){var t=e(this),r=t.prev("a"),i=e("<span>").addClass("ui-menu-icon ui-icon "+n).data("ui-menu-submenu-carat",!0);r.attr("aria-haspopup","true").prepend(i),t.attr("aria-labelledby",r.attr("id"))}),this.active&&!e.contains(this.element[0],this.active[0])&&this.blur()},_itemRole:function(){return{menu:"menuitem",listbox:"option"}[this.options.role]},focus:function(e,t){var n,r;this.blur(e,e&&e.type==="focus"),this._scrollIntoView(t),this.active=t.first(),r=this.active.children("a").addClass("ui-state-focus"),this.options.role&&this.element.attr("aria-activedescendant",r.attr("id")),this.active.parent().closest(".ui-menu-item").children("a:first").addClass("ui-state-active"),e&&e.type==="keydown"?this._close():this.timer=this._delay(function(){this._close()},this.delay),n=t.children(".ui-menu"),n.length&&/^mouse/.test(e.type)&&this._startOpening(n),this.activeMenu=t.parent(),this._trigger("focus",e,{item:t})},_scrollIntoView:function(t){var n,r,i,s,o,u;this._hasScroll()&&(n=parseFloat(e.css(this.activeMenu[0],"borderTopWidth"))||0,r=parseFloat(e.css(this.activeMenu[0],"paddingTop"))||0,i=t.offset().top-this.activeMenu.offset().top-n-r,s=this.activeMenu.scrollTop(),o=this.activeMenu.height(),u=t.height(),i<0?this.activeMenu.scrollTop(s+i):i+u>o&&this.activeMenu.scrollTop(s+i-o+u))},blur:function(e,t){t||clearTimeout(this.timer);if(!this.active)return;this.active.children("a").removeClass("ui-state-focus"),this.active=null,this._trigger("blur",e,{item:this.active})},_startOpening:function(e){clearTimeout(this.timer);if(e.attr("aria-hidden")!=="true")return;this.timer=this._delay(function(){this._close(),this._open(e)},this.delay)},_open:function(t){var n=e.extend({of:this.active},this.options.position);clearTimeout(this.timer),this.element.find(".ui-menu").not(t.parents(".ui-menu")).hide().attr("aria-hidden","true"),t.show().removeAttr("aria-hidden").attr("aria-expanded","true").position(n)},collapseAll:function(t,n){clearTimeout(this.timer),this.timer=this._delay(function(){var r=n?this.element:e(t&&t.target).closest(this.element.find(".ui-menu"));r.length||(r=this.element),this._close(r),this.blur(t),this.activeMenu=r},this.delay)},_close:function(e){e||(e=this.active?this.active.parent():this.element),e.find(".ui-menu").hide().attr("aria-hidden","true").attr("aria-expanded","false").end().find("a.ui-state-active").removeClass("ui-state-active")},collapse:function(e){var t=this.active&&this.active.parent().closest(".ui-menu-item",this.element);t&&t.length&&(this._close(),this.focus(e,t))},expand:function(e){var t=this.active&&this.active.children(".ui-menu ").children(".ui-menu-item").first();t&&t.length&&(this._open(t.parent()),this._delay(function(){this.focus(e,t)}))},next:function(e){this._move("next","first",e)},previous:function(e){this._move("prev","last",e)},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(e,t,n){var r;this.active&&(e==="first"||e==="last"?r=this.active[e==="first"?"prevAll":"nextAll"](".ui-menu-item").eq(-1):r=this.active[e+"All"](".ui-menu-item").eq(0));if(!r||!r.length||!this.active)r=this.activeMenu.children(".ui-menu-item")[t]();this.focus(n,r)},nextPage:function(t){var n,r,i;if(!this.active){this.next(t);return}if(this.isLastItem())return;this._hasScroll()?(r=this.active.offset().top,i=this.element.height(),this.active.nextAll(".ui-menu-item").each(function(){return n=e(this),n.offset().top-r-i<0}),this.focus(t,n)):this.focus(t,this.activeMenu.children(".ui-menu-item")[this.active?"last":"first"]())},previousPage:function(t){var n,r,i;if(!this.active){this.next(t);return}if(this.isFirstItem())return;this._hasScroll()?(r=this.active.offset().top,i=this.element.height(),this.active.prevAll(".ui-menu-item").each(function(){return n=e(this),n.offset().top-r+i>0}),this.focus(t,n)):this.focus(t,this.activeMenu.children(".ui-menu-item").first())},_hasScroll:function(){return this.element.outerHeight()<this.element.prop("scrollHeight")},select:function(t){this.active=this.active||e(t.target).closest(".ui-menu-item");var n={item:this.active};this.active.has(".ui-menu").length||this.collapseAll(t,!0),this._trigger("select",t,n)}})})(jQuery);(function(e,t){e.widget("ui.progressbar",{version:"1.9.1",options:{value:0,max:100},min:0,_create:function(){this.element.addClass("ui-progressbar ui-widget ui-widget-content ui-corner-all").attr({role:"progressbar","aria-valuemin":this.min,"aria-valuemax":this.options.max,"aria-valuenow":this._value()}),this.valueDiv=e("<div class='ui-progressbar-value ui-widget-header ui-corner-left'></div>").appendTo(this.element),this.oldValue=this._value(),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(e){return e===t?this._value():(this._setOption("value",e),this)},_setOption:function(e,t){e==="value"&&(this.options.value=t,this._refreshValue(),this._value()===this.options.max&&this._trigger("complete")),this._super(e,t)},_value:function(){var e=this.options.value;return typeof e!="number"&&(e=0),Math.min(this.options.max,Math.max(this.min,e))},_percentage:function(){return 100*this._value()/this.options.max},_refreshValue:function(){var e=this.value(),t=this._percentage();this.oldValue!==e&&(this.oldValue=e,this._trigger("change")),this.valueDiv.toggle(e>this.min).toggleClass("ui-corner-right",e===this.options.max).width(t.toFixed(0)+"%"),this.element.attr("aria-valuenow",e)}})})(jQuery);(function(e,t){var n=5;e.widget("ui.slider",e.ui.mouse,{version:"1.9.1",widgetEventPrefix:"slide",options:{animate:!1,distance:0,max:100,min:0,orientation:"horizontal",range:!1,step:1,value:0,values:null},_create:function(){var t,r,i=this.options,s=this.element.find(".ui-slider-handle").addClass("ui-state-default ui-corner-all"),o="<a class='ui-slider-handle ui-state-default ui-corner-all' href='#'></a>",u=[];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"+(i.disabled?" ui-slider-disabled ui-disabled":"")),this.range=e([]),i.range&&(i.range===!0&&(i.values||(i.values=[this._valueMin(),this._valueMin()]),i.values.length&&i.values.length!==2&&(i.values=[i.values[0],i.values[0]])),this.range=e("<div></div>").appendTo(this.element).addClass("ui-slider-range ui-widget-header"+(i.range==="min"||i.range==="max"?" ui-slider-range-"+i.range:""))),r=i.values&&i.values.length||1;for(t=s.length;t<r;t++)u.push(o);this.handles=s.add(e(u.join("")).appendTo(this.element)),this.handle=this.handles.eq(0),this.handles.add(this.range).filter("a").click(function(e){e.preventDefault()}).mouseenter(function(){i.disabled||e(this).addClass("ui-state-hover")}).mouseleave(function(){e(this).removeClass("ui-state-hover")}).focus(function(){i.disabled?e(this).blur():(e(".ui-slider .ui-state-focus").removeClass("ui-state-focus"),e(this).addClass("ui-state-focus"))}).blur(function(){e(this).removeClass("ui-state-focus")}),this.handles.each(function(t){e(this).data("ui-slider-handle-index",t)}),this._on(this.handles,{keydown:function(t){var r,i,s,o,u=e(t.target).data("ui-slider-handle-index");switch(t.keyCode){case e.ui.keyCode.HOME:case e.ui.keyCode.END:case e.ui.keyCode.PAGE_UP:case e.ui.keyCode.PAGE_DOWN:case e.ui.keyCode.UP:case e.ui.keyCode.RIGHT:case e.ui.keyCode.DOWN:case e.ui.keyCode.LEFT:t.preventDefault();if(!this._keySliding){this._keySliding=!0,e(t.target).addClass("ui-state-active"),r=this._start(t,u);if(r===!1)return}}o=this.options.step,this.options.values&&this.options.values.length?i=s=this.values(u):i=s=this.value();switch(t.keyCode){case e.ui.keyCode.HOME:s=this._valueMin();break;case e.ui.keyCode.END:s=this._valueMax();break;case e.ui.keyCode.PAGE_UP:s=this._trimAlignValue(i+(this._valueMax()-this._valueMin())/n);break;case e.ui.keyCode.PAGE_DOWN:s=this._trimAlignValue(i-(this._valueMax()-this._valueMin())/n);break;case e.ui.keyCode.UP:case e.ui.keyCode.RIGHT:if(i===this._valueMax())return;s=this._trimAlignValue(i+o);break;case e.ui.keyCode.DOWN:case e.ui.keyCode.LEFT:if(i===this._valueMin())return;s=this._trimAlignValue(i-o)}this._slide(t,u,s)},keyup:function(t){var n=e(t.target).data("ui-slider-handle-index");this._keySliding&&(this._keySliding=!1,this._stop(t,n),this._change(t,n),e(t.target).removeClass("ui-state-active"))}}),this._refreshValue(),this._animateOff=!1},_destroy:function(){this.handles.remove(),this.range.remove(),this.element.removeClass("ui-slider ui-slider-horizontal ui-slider-vertical ui-slider-disabled ui-widget ui-widget-content ui-corner-all"),this._mouseDestroy()},_mouseCapture:function(t){var n,r,i,s,o,u,a,f,l=this,c=this.options;return c.disabled?!1:(this.elementSize={width:this.element.outerWidth(),height:this.element.outerHeight()},this.elementOffset=this.element.offset(),n={x:t.pageX,y:t.pageY},r=this._normValueFromMouse(n),i=this._valueMax()-this._valueMin()+1,this.handles.each(function(t){var n=Math.abs(r-l.values(t));i>n&&(i=n,s=e(this),o=t)}),c.range===!0&&this.values(1)===c.min&&(o+=1,s=e(this.handles[o])),u=this._start(t,o),u===!1?!1:(this._mouseSliding=!0,this._handleIndex=o,s.addClass("ui-state-active").focus(),a=s.offset(),f=!e(t.target).parents().andSelf().is(".ui-slider-handle"),this._clickOffset=f?{left:0,top:0}:{left:t.pageX-a.left-s.width()/2,top:t.pageY-a.top-s.height()/2-(parseInt(s.css("borderTopWidth"),10)||0)-(parseInt(s.css("borderBottomWidth"),10)||0)+(parseInt(s.css("marginTop"),10)||0)},this.handles.hasClass("ui-state-hover")||this._slide(t,o,r),this._animateOff=!0,!0))},_mouseStart:function(){return!0},_mouseDrag:function(e){var t={x:e.pageX,y:e.pageY},n=this._normValueFromMouse(t);return this._slide(e,this._handleIndex,n),!1},_mouseStop:function(e){return this.handles.removeClass("ui-state-active"),this._mouseSliding=!1,this._stop(e,this._handleIndex),this._change(e,this._handleIndex),this._handleIndex=null,this._clickOffset=null,this._animateOff=!1,!1},_detectOrientation:function(){this.orientation=this.options.orientation==="vertical"?"vertical":"horizontal"},_normValueFromMouse:function(e){var t,n,r,i,s;return this.orientation==="horizontal"?(t=this.elementSize.width,n=e.x-this.elementOffset.left-(this._clickOffset?this._clickOffset.left:0)):(t=this.elementSize.height,n=e.y-this.elementOffset.top-(this._clickOffset?this._clickOffset.top:0)),r=n/t,r>1&&(r=1),r<0&&(r=0),this.orientation==="vertical"&&(r=1-r),i=this._valueMax()-this._valueMin(),s=this._valueMin()+r*i,this._trimAlignValue(s)},_start:function(e,t){var n={handle:this.handles[t],value:this.value()};return this.options.values&&this.options.values.length&&(n.value=this.values(t),n.values=this.values()),this._trigger("start",e,n)},_slide:function(e,t,n){var r,i,s;this.options.values&&this.options.values.length?(r=this.values(t?0:1),this.options.values.length===2&&this.options.range===!0&&(t===0&&n>r||t===1&&n<r)&&(n=r),n!==this.values(t)&&(i=this.values(),i[t]=n,s=this._trigger("slide",e,{handle:this.handles[t],value:n,values:i}),r=this.values(t?0:1),s!==!1&&this.values(t,n,!0))):n!==this.value()&&(s=this._trigger("slide",e,{handle:this.handles[t],value:n}),s!==!1&&this.value(n))},_stop:function(e,t){var n={handle:this.handles[t],value:this.value()};this.options.values&&this.options.values.length&&(n.value=this.values(t),n.values=this.values()),this._trigger("stop",e,n)},_change:function(e,t){if(!this._keySliding&&!this._mouseSliding){var n={handle:this.handles[t],value:this.value()};this.options.values&&this.options.values.length&&(n.value=this.values(t),n.values=this.values()),this._trigger("change",e,n)}},value:function(e){if(arguments.length){this.options.value=this._trimAlignValue(e),this._refreshValue(),this._change(null,0);return}return this._value()},values:function(t,n){var r,i,s;if(arguments.length>1){this.options.values[t]=this._trimAlignValue(n),this._refreshValue(),this._change(null,t);return}if(!arguments.length)return this._values();if(!e.isArray(arguments[0]))return this.options.values&&this.options.values.length?this._values(t):this.value();r=this.options.values,i=arguments[0];for(s=0;s<r.length;s+=1)r[s]=this._trimAlignValue(i[s]),this._change(null,s);this._refreshValue()},_setOption:function(t,n){var r,i=0;e.isArray(this.options.values)&&(i=this.options.values.length),e.Widget.prototype._setOption.apply(this,arguments);switch(t){case"disabled":n?(this.handles.filter(".ui-state-focus").blur(),this.handles.removeClass("ui-state-hover"),this.handles.prop("disabled",!0),this.element.addClass("ui-disabled")):(this.handles.prop("disabled",!1),this.element.removeClass("ui-disabled"));break;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":this._animateOff=!0,this._refreshValue();for(r=0;r<i;r+=1)this._change(null,r);this._animateOff=!1;break;case"min":case"max":this._animateOff=!0,this._refreshValue(),this._animateOff=!1}},_value:function(){var e=this.options.value;return e=this._trimAlignValue(e),e},_values:function(e){var t,n,r;if(arguments.length)return t=this.options.values[e],t=this._trimAlignValue(t),t;n=this.options.values.slice();for(r=0;r<n.length;r+=1)n[r]=this._trimAlignValue(n[r]);return n},_trimAlignValue:function(e){if(e<=this._valueMin())return this._valueMin();if(e>=this._valueMax())return this._valueMax();var t=this.options.step>0?this.options.step:1,n=(e-this._valueMin())%t,r=e-n;return Math.abs(n)*2>=t&&(r+=n>0?t:-t),parseFloat(r.toFixed(5))},_valueMin:function(){return this.options.min},_valueMax:function(){return this.options.max},_refreshValue:function(){var t,n,r,i,s,o=this.options.range,u=this.options,a=this,f=this._animateOff?!1:u.animate,l={};this.options.values&&this.options.values.length?this.handles.each(function(r){n=(a.values(r)-a._valueMin())/(a._valueMax()-a._valueMin())*100,l[a.orientation==="horizontal"?"left":"bottom"]=n+"%",e(this).stop(1,1)[f?"animate":"css"](l,u.animate),a.options.range===!0&&(a.orientation==="horizontal"?(r===0&&a.range.stop(1,1)[f?"animate":"css"]({left:n+"%"},u.animate),r===1&&a.range[f?"animate":"css"]({width:n-t+"%"},{queue:!1,duration:u.animate})):(r===0&&a.range.stop(1,1)[f?"animate":"css"]({bottom:n+"%"},u.animate),r===1&&a.range[f?"animate":"css"]({height:n-t+"%"},{queue:!1,duration:u.animate}))),t=n}):(r=this.value(),i=this._valueMin(),s=this._valueMax(),n=s!==i?(r-i)/(s-i)*100:0,l[this.orientation==="horizontal"?"left":"bottom"]=n+"%",this.handle.stop(1,1)[f?"animate":"css"](l,u.animate),o==="min"&&this.orientation==="horizontal"&&this.range.stop(1,1)[f?"animate":"css"]({width:n+"%"},u.animate),o==="max"&&this.orientation==="horizontal"&&this.range[f?"animate":"css"]({width:100-n+"%"},{queue:!1,duration:u.animate}),o==="min"&&this.orientation==="vertical"&&this.range.stop(1,1)[f?"animate":"css"]({height:n+"%"},u.animate),o==="max"&&this.orientation==="vertical"&&this.range[f?"animate":"css"]({height:100-n+"%"},{queue:!1,duration:u.animate}))}})})(jQuery);(function(e){function t(e){return function(){var t=this.element.val();e.apply(this,arguments),this._refresh(),t!==this.element.val()&&this._trigger("change")}}e.widget("ui.spinner",{version:"1.9.1",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.element.val(),!0),this._draw(),this._on(this._events),this._refresh(),this._on(this.window,{beforeunload:function(){this.element.removeAttr("autocomplete")}})},_getCreateOptions:function(){var t={},n=this.element;return e.each(["min","max","step"],function(e,r){var i=n.attr(r);i!==undefined&&i.length&&(t[r]=i)}),t},_events:{keydown:function(e){this._start(e)&&this._keydown(e)&&e.preventDefault()},keyup:"_stop",focus:function(){this.previous=this.element.val()},blur:function(e){if(this.cancelBlur){delete this.cancelBlur;return}this._refresh(),this.previous!==this.element.val()&&this._trigger("change",e)},mousewheel:function(e,t){if(!t)return;if(!this.spinning&&!this._start(e))return!1;this._spin((t>0?1:-1)*this.options.step,e),clearTimeout(this.mousewheelTimer),this.mousewheelTimer=this._delay(function(){this.spinning&&this._stop(e)},100),e.preventDefault()},"mousedown .ui-spinner-button":function(t){function r(){var e=this.element[0]===this.document[0].activeElement;e||(this.element.focus(),this.previous=n,this._delay(function(){this.previous=n}))}var n;n=this.element[0]===this.document[0].activeElement?this.previous:this.element.val(),t.preventDefault(),r.call(this),this.cancelBlur=!0,this._delay(function(){delete this.cancelBlur,r.call(this)});if(this._start(t)===!1)return;this._repeat(null,e(t.currentTarget).hasClass("ui-spinner-up")?1:-1,t)},"mouseup .ui-spinner-button":"_stop","mouseenter .ui-spinner-button":function(t){if(!e(t.currentTarget).hasClass("ui-state-active"))return;if(this._start(t)===!1)return!1;this._repeat(null,e(t.currentTarget).hasClass("ui-spinner-up")?1:-1,t)},"mouseleave .ui-spinner-button":"_stop"},_draw:function(){var e=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=e.find(".ui-spinner-button").attr("tabIndex",-1).button().removeClass("ui-corner-all"),this.buttons.height()>Math.ceil(e.height()*.5)&&e.height()>0&&e.height(e.height()),this.options.disabled&&this.disable()},_keydown:function(t){var n=this.options,r=e.ui.keyCode;switch(t.keyCode){case r.UP:return this._repeat(null,1,t),!0;case r.DOWN:return this._repeat(null,-1,t),!0;case r.PAGE_UP:return this._repeat(null,n.page,t),!0;case r.PAGE_DOWN:return this._repeat(null,-n.page,t),!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+"'>▲</span>"+"</a>"+"<a class='ui-spinner-button ui-spinner-down ui-corner-br'>"+"<span class='ui-icon "+this.options.icons.down+"'>▼</span>"+"</a>"},_start:function(e){return!this.spinning&&this._trigger("start",e)===!1?!1:(this.counter||(this.counter=1),this.spinning=!0,!0)},_repeat:function(e,t,n){e=e||500,clearTimeout(this.timer),this.timer=this._delay(function(){this._repeat(40,t,n)},e),this._spin(t*this.options.step,n)},_spin:function(e,t){var n=this.value()||0;this.counter||(this.counter=1),n=this._adjustValue(n+e*this._increment(this.counter));if(!this.spinning||this._trigger("spin",t,{value:n})!==!1)this._value(n),this.counter++},_increment:function(t){var n=this.options.incremental;return n?e.isFunction(n)?n(t):Math.floor(t*t*t/5e4-t*t/500+17*t/200+1):1},_precision:function(){var e=this._precisionOf(this.options.step);return this.options.min!==null&&(e=Math.max(e,this._precisionOf(this.options.min))),e},_precisionOf:function(e){var t=e.toString(),n=t.indexOf(".");return n===-1?0:t.length-n-1},_adjustValue:function(e){var t,n,r=this.options;return t=r.min!==null?r.min:0,n=e-t,n=Math.round(n/r.step)*r.step,e=t+n,e=parseFloat(e.toFixed(this._precision())),r.max!==null&&e>r.max?r.max:r.min!==null&&e<r.min?r.min:e},_stop:function(e){if(!this.spinning)return;clearTimeout(this.timer),clearTimeout(this.mousewheelTimer),this.counter=0,this.spinning=!1,this._trigger("stop",e)},_setOption:function(e,t){if(e==="culture"||e==="numberFormat"){var n=this._parse(this.element.val());this.options[e]=t,this.element.val(this._format(n));return}(e==="max"||e==="min"||e==="step")&&typeof t=="string"&&(t=this._parse(t)),this._super(e,t),e==="disabled"&&(t?(this.element.prop("disabled",!0),this.buttons.button("disable")):(this.element.prop("disabled",!1),this.buttons.button("enable")))},_setOptions:t(function(e){this._super(e),this._value(this.element.val())}),_parse:function(e){return typeof e=="string"&&e!==""&&(e=window.Globalize&&this.options.numberFormat?Globalize.parseFloat(e,10,this.options.culture):+e),e===""||isNaN(e)?null:e},_format:function(e){return e===""?"":window.Globalize&&this.options.numberFormat?Globalize.format(e,this.options.numberFormat,this.options.culture):e},_refresh:function(){this.element.attr({"aria-valuemin":this.options.min,"aria-valuemax":this.options.max,"aria-valuenow":this._parse(this.element.val())})},_value:function(e,t){var n;e!==""&&(n=this._parse(e),n!==null&&(t||(n=this._adjustValue(n)),e=this._format(n))),this.element.val(e),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:t(function(e){this._stepUp(e)}),_stepUp:function(e){this._spin((e||1)*this.options.step)},stepDown:t(function(e){this._stepDown(e)}),_stepDown:function(e){this._spin((e||1)*-this.options.step)},pageUp:t(function(e){this._stepUp((e||1)*this.options.page)}),pageDown:t(function(e){this._stepDown((e||1)*this.options.page)}),value:function(e){if(!arguments.length)return this._parse(this.element.val());t(this._value).call(this,e)},widget:function(){return this.uiSpinner}})})(jQuery);(function(e,t){function i(){return++n}function s(e){return e.hash.length>1&&e.href.replace(r,"")===location.href.replace(r,"")}var n=0,r=/#.*$/;e.widget("ui.tabs",{version:"1.9.1",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 t=this,n=this.options,r=n.active,i=location.hash.substring(1);this.running=!1,this.element.addClass("ui-tabs ui-widget ui-widget-content ui-corner-all").toggleClass("ui-tabs-collapsible",n.collapsible).delegate(".ui-tabs-nav > li","mousedown"+this.eventNamespace,function(t){e(this).is(".ui-state-disabled")&&t.preventDefault()}).delegate(".ui-tabs-anchor","focus"+this.eventNamespace,function(){e(this).closest("li").is(".ui-state-disabled")&&this.blur()}),this._processTabs();if(r===null){i&&this.tabs.each(function(t,n){if(e(n).attr("aria-controls")===i)return r=t,!1}),r===null&&(r=this.tabs.index(this.tabs.filter(".ui-tabs-active")));if(r===null||r===-1)r=this.tabs.length?0:!1}r!==!1&&(r=this.tabs.index(this.tabs.eq(r)),r===-1&&(r=n.collapsible?!1:0)),n.active=r,!n.collapsible&&n.active===!1&&this.anchors.length&&(n.active=0),e.isArray(n.disabled)&&(n.disabled=e.unique(n.disabled.concat(e.map(this.tabs.filter(".ui-state-disabled"),function(e){return t.tabs.index(e)}))).sort()),this.options.active!==!1&&this.anchors.length?this.active=this._findActive(this.options.active):this.active=e(),this._refresh(),this.active.length&&this.load(n.active)},_getCreateEventData:function(){return{tab:this.active,panel:this.active.length?this._getPanelForTab(this.active):e()}},_tabKeydown:function(t){var n=e(this.document[0].activeElement).closest("li"),r=this.tabs.index(n),i=!0;if(this._handlePageNav(t))return;switch(t.keyCode){case e.ui.keyCode.RIGHT:case e.ui.keyCode.DOWN:r++;break;case e.ui.keyCode.UP:case e.ui.keyCode.LEFT:i=!1,r--;break;case e.ui.keyCode.END:r=this.anchors.length-1;break;case e.ui.keyCode.HOME:r=0;break;case e.ui.keyCode.SPACE:t.preventDefault(),clearTimeout(this.activating),this._activate(r);return;case e.ui.keyCode.ENTER:t.preventDefault(),clearTimeout(this.activating),this._activate(r===this.options.active?!1:r);return;default:return}t.preventDefault(),clearTimeout(this.activating),r=this._focusNextTab(r,i),t.ctrlKey||(n.attr("aria-selected","false"),this.tabs.eq(r).attr("aria-selected","true"),this.activating=this._delay(function(){this.option("active",r)},this.delay))},_panelKeydown:function(t){if(this._handlePageNav(t))return;t.ctrlKey&&t.keyCode===e.ui.keyCode.UP&&(t.preventDefault(),this.active.focus())},_handlePageNav:function(t){if(t.altKey&&t.keyCode===e.ui.keyCode.PAGE_UP)return this._activate(this._focusNextTab(this.options.active-1,!1)),!0;if(t.altKey&&t.keyCode===e.ui.keyCode.PAGE_DOWN)return this._activate(this._focusNextTab(this.options.active+1,!0)),!0},_findNextTab:function(t,n){function i(){return t>r&&(t=0),t<0&&(t=r),t}var r=this.tabs.length-1;while(e.inArray(i(),this.options.disabled)!==-1)t=n?t+1:t-1;return t},_focusNextTab:function(e,t){return e=this._findNextTab(e,t),this.tabs.eq(e).focus(),e},_setOption:function(e,t){if(e==="active"){this._activate(t);return}if(e==="disabled"){this._setupDisabled(t);return}this._super(e,t),e==="collapsible"&&(this.element.toggleClass("ui-tabs-collapsible",t),!t&&this.options.active===!1&&this._activate(0)),e==="event"&&this._setupEvents(t),e==="heightStyle"&&this._setupHeightStyle(t)},_tabId:function(e){return e.attr("aria-controls")||"ui-tabs-"+i()},_sanitizeSelector:function(e){return e?e.replace(/[!"$%&'()*+,.\/:;<=>?@\[\]\^`{|}~]/g,"\\$&"):""},refresh:function(){var t=this.options,n=this.tablist.children(":has(a[href])");t.disabled=e.map(n.filter(".ui-state-disabled"),function(e){return n.index(e)}),this._processTabs(),t.active===!1||!this.anchors.length?(t.active=!1,this.active=e()):this.active.length&&!e.contains(this.tablist[0],this.active[0])?this.tabs.length===t.disabled.length?(t.active=!1,this.active=e()):this._activate(this._findNextTab(Math.max(0,t.active-1),!1)):t.active=this.tabs.index(this.active),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 t=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 e("a",this)[0]}).addClass("ui-tabs-anchor").attr({role:"presentation",tabIndex:-1}),this.panels=e(),this.anchors.each(function(n,r){var i,o,u,a=e(r).uniqueId().attr("id"),f=e(r).closest("li"),l=f.attr("aria-controls");s(r)?(i=r.hash,o=t.element.find(t._sanitizeSelector(i))):(u=t._tabId(f),i="#"+u,o=t.element.find(i),o.length||(o=t._createPanel(u),o.insertAfter(t.panels[n-1]||t.tablist)),o.attr("aria-live","polite")),o.length&&(t.panels=t.panels.add(o)),l&&f.data("ui-tabs-aria-controls",l),f.attr({"aria-controls":i.substring(1),"aria-labelledby":a}),o.attr("aria-labelledby",a)}),this.panels.addClass("ui-tabs-panel ui-widget-content ui-corner-bottom").attr("role","tabpanel")},_getList:function(){return this.element.find("ol,ul").eq(0)},_createPanel:function(t){return e("<div>").attr("id",t).addClass("ui-tabs-panel ui-widget-content ui-corner-bottom").data("ui-tabs-destroy",!0)},_setupDisabled:function(t){e.isArray(t)&&(t.length?t.length===this.anchors.length&&(t=!0):t=!1);for(var n=0,r;r=this.tabs[n];n++)t===!0||e.inArray(n,t)!==-1?e(r).addClass("ui-state-disabled").attr("aria-disabled","true"):e(r).removeClass("ui-state-disabled").removeAttr("aria-disabled");this.options.disabled=t},_setupEvents:function(t){var n={click:function(e){e.preventDefault()}};t&&e.each(t.split(" "),function(e,t){n[t]="_eventHandler"}),this._off(this.anchors.add(this.tabs).add(this.panels)),this._on(this.anchors,n),this._on(this.tabs,{keydown:"_tabKeydown"}),this._on(this.panels,{keydown:"_panelKeydown"}),this._focusable(this.tabs),this._hoverable(this.tabs)},_setupHeightStyle:function(t){var n,r,i=this.element.parent();t==="fill"?(e.support.minHeight||(r=i.css("overflow"),i.css("overflow","hidden")),n=i.height(),this.element.siblings(":visible").each(function(){var t=e(this),r=t.css("position");if(r==="absolute"||r==="fixed")return;n-=t.outerHeight(!0)}),r&&i.css("overflow",r),this.element.children().not(this.panels).each(function(){n-=e(this).outerHeight(!0)}),this.panels.each(function(){e(this).height(Math.max(0,n-e(this).innerHeight()+e(this).height()))}).css("overflow","auto")):t==="auto"&&(n=0,this.panels.each(function(){n=Math.max(n,e(this).height("").height())}).height(n))},_eventHandler:function(t){var n=this.options,r=this.active,i=e(t.currentTarget),s=i.closest("li"),o=s[0]===r[0],u=o&&n.collapsible,a=u?e():this._getPanelForTab(s),f=r.length?this._getPanelForTab(r):e(),l={oldTab:r,oldPanel:f,newTab:u?e():s,newPanel:a};t.preventDefault();if(s.hasClass("ui-state-disabled")||s.hasClass("ui-tabs-loading")||this.running||o&&!n.collapsible||this._trigger("beforeActivate",t,l)===!1)return;n.active=u?!1:this.tabs.index(s),this.active=o?e():s,this.xhr&&this.xhr.abort(),!f.length&&!a.length&&e.error("jQuery UI Tabs: Mismatching fragment identifier."),a.length&&this.load(this.tabs.index(s),t),this._toggle(t,l)},_toggle:function(t,n){function o(){r.running=!1,r._trigger("activate",t,n)}function u(){n.newTab.closest("li").addClass("ui-tabs-active ui-state-active"),i.length&&r.options.show?r._show(i,r.options.show,o):(i.show(),o())}var r=this,i=n.newPanel,s=n.oldPanel;this.running=!0,s.length&&this.options.hide?this._hide(s,this.options.hide,function(){n.oldTab.closest("li").removeClass("ui-tabs-active ui-state-active"),u()}):(n.oldTab.closest("li").removeClass("ui-tabs-active ui-state-active"),s.hide(),u()),s.attr({"aria-expanded":"false","aria-hidden":"true"}),n.oldTab.attr("aria-selected","false"),i.length&&s.length?n.oldTab.attr("tabIndex",-1):i.length&&this.tabs.filter(function(){return e(this).attr("tabIndex")===0}).attr("tabIndex",-1),i.attr({"aria-expanded":"true","aria-hidden":"false"}),n.newTab.attr({"aria-selected":"true",tabIndex:0})},_activate:function(t){var n,r=this._findActive(t);if(r[0]===this.active[0])return;r.length||(r=this.active),n=r.find(".ui-tabs-anchor")[0],this._eventHandler({target:n,currentTarget:n,preventDefault:e.noop})},_findActive:function(t){return t===!1?e():this.tabs.eq(t)},_getIndex:function(e){return typeof e=="string"&&(e=this.anchors.index(this.anchors.filter("[href$='"+e+"']"))),e},_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").removeData("href.tabs").removeData("load.tabs").removeUniqueId(),this.tabs.add(this.panels).each(function(){e.data(this,"ui-tabs-destroy")?e(this).remove():e(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 t=e(this),n=t.data("ui-tabs-aria-controls");n?t.attr("aria-controls",n):t.removeAttr("aria-controls")}),this.options.heightStyle!=="content"&&this.panels.css("height","")},enable:function(n){var r=this.options.disabled;if(r===!1)return;n===t?r=!1:(n=this._getIndex(n),e.isArray(r)?r=e.map(r,function(e){return e!==n?e:null}):r=e.map(this.tabs,function(e,t){return t!==n?t:null})),this._setupDisabled(r)},disable:function(n){var r=this.options.disabled;if(r===!0)return;if(n===t)r=!0;else{n=this._getIndex(n);if(e.inArray(n,r)!==-1)return;e.isArray(r)?r=e.merge([n],r).sort():r=[n]}this._setupDisabled(r)},load:function(t,n){t=this._getIndex(t);var r=this,i=this.tabs.eq(t),o=i.find(".ui-tabs-anchor"),u=this._getPanelForTab(i),a={tab:i,panel:u};if(s(o[0]))return;this.xhr=e.ajax(this._ajaxSettings(o,n,a)),this.xhr&&this.xhr.statusText!=="canceled"&&(i.addClass("ui-tabs-loading"),u.attr("aria-busy","true"),this.xhr.success(function(e){setTimeout(function(){u.html(e),r._trigger("load",n,a)},1)}).complete(function(e,t){setTimeout(function(){t==="abort"&&r.panels.stop(!1,!0),i.removeClass("ui-tabs-loading"),u.removeAttr("aria-busy"),e===r.xhr&&delete r.xhr},1)}))},_ajaxSettings:function(t,n,r){var i=this;return{url:t.attr("href"),beforeSend:function(t,s){return i._trigger("beforeLoad",n,e.extend({jqXHR:t,ajaxSettings:s},r))}}},_getPanelForTab:function(t){var n=e(t).attr("aria-controls");return this.element.find(this._sanitizeSelector("#"+n))}}),e.uiBackCompat!==!1&&(e.ui.tabs.prototype._ui=function(e,t){return{tab:e,panel:t,index:this.anchors.index(e)}},e.widget("ui.tabs",e.ui.tabs,{url:function(e,t){this.anchors.eq(e).attr("href",t)}}),e.widget("ui.tabs",e.ui.tabs,{options:{ajaxOptions:null,cache:!1},_create:function(){this._super();var t=this;this._on({tabsbeforeload:function(n,r){if(e.data(r.tab[0],"cache.tabs")){n.preventDefault();return}r.jqXHR.success(function(){t.options.cache&&e.data(r.tab[0],"cache.tabs",!0)})}})},_ajaxSettings:function(t,n,r){var i=this.options.ajaxOptions;return e.extend({},i,{error:function(e,t){try{i.error(e,t,r.tab.closest("li").index(),r.tab[0])}catch(n){}}},this._superApply(arguments))},_setOption:function(e,t){e==="cache"&&t===!1&&this.anchors.removeData("cache.tabs"),this._super(e,t)},_destroy:function(){this.anchors.removeData("cache.tabs"),this._super()},url:function(e){this.anchors.eq(e).removeData("cache.tabs"),this._superApply(arguments)}}),e.widget("ui.tabs",e.ui.tabs,{abort:function(){this.xhr&&this.xhr.abort()}}),e.widget("ui.tabs",e.ui.tabs,{options:{spinner:"<em>Loading…</em>"},_create:function(){this._super(),this._on({tabsbeforeload:function(e,t){if(e.target!==this.element[0]||!this.options.spinner)return;var n=t.tab.find("span"),r=n.html();n.html(this.options.spinner),t.jqXHR.complete(function(){n.html(r)})}})}}),e.widget("ui.tabs",e.ui.tabs,{options:{enable:null,disable:null},enable:function(t){var n=this.options,r;if(t&&n.disabled===!0||e.isArray(n.disabled)&&e.inArray(t,n.disabled)!==-1)r=!0;this._superApply(arguments),r&&this._trigger("enable",null,this._ui(this.anchors[t],this.panels[t]))},disable:function(t){var n=this.options,r;if(t&&n.disabled===!1||e.isArray(n.disabled)&&e.inArray(t,n.disabled)===-1)r=!0;this._superApply(arguments),r&&this._trigger("disable",null,this._ui(this.anchors[t],this.panels[t]))}}),e.widget("ui.tabs",e.ui.tabs,{options:{add:null,remove:null,tabTemplate:"<li><a href='#{href}'><span>#{label}</span></a></li>"},add:function(n,r,i){i===t&&(i=this.anchors.length);var s,o,u=this.options,a=e(u.tabTemplate.replace(/#\{href\}/g,n).replace(/#\{label\}/g,r)),f=n.indexOf("#")?this._tabId(a):n.replace("#","");return a.addClass("ui-state-default ui-corner-top").data("ui-tabs-destroy",!0),a.attr("aria-controls",f),s=i>=this.tabs.length,o=this.element.find("#"+f),o.length||(o=this._createPanel(f),s?i>0?o.insertAfter(this.panels.eq(-1)):o.appendTo(this.element):o.insertBefore(this.panels[i])),o.addClass("ui-tabs-panel ui-widget-content ui-corner-bottom").hide(),s?a.appendTo(this.tablist):a.insertBefore(this.tabs[i]),u.disabled=e.map(u.disabled,function(e){return e>=i?++e:e}),this.refresh(),this.tabs.length===1&&u.active===!1&&this.option("active",0),this._trigger("add",null,this._ui(this.anchors[i],this.panels[i])),this},remove:function(t){t=this._getIndex(t);var n=this.options,r=this.tabs.eq(t).remove(),i=this._getPanelForTab(r).remove();return r.hasClass("ui-tabs-active")&&this.anchors.length>2&&this._activate(t+(t+1<this.anchors.length?1:-1)),n.disabled=e.map(e.grep(n.disabled,function(e){return e!==t}),function(e){return e>=t?--e:e}),this.refresh(),this._trigger("remove",null,this._ui(r.find("a")[0],i[0])),this}}),e.widget("ui.tabs",e.ui.tabs,{length:function(){return this.anchors.length}}),e.widget("ui.tabs",e.ui.tabs,{options:{idPrefix:"ui-tabs-"},_tabId:function(t){var n=t.is("li")?t.find("a[href]"):t;return n=n[0],e(n).closest("li").attr("aria-controls")||n.title&&n.title.replace(/\s/g,"_").replace(/[^\w\u00c0-\uFFFF\-]/g,"")||this.options.idPrefix+i()}}),e.widget("ui.tabs",e.ui.tabs,{options:{panelTemplate:"<div></div>"},_createPanel:function(t){return e(this.options.panelTemplate).attr("id",t).addClass("ui-tabs-panel ui-widget-content ui-corner-bottom").data("ui-tabs-destroy",!0)}}),e.widget("ui.tabs",e.ui.tabs,{_create:function(){var e=this.options;e.active===null&&e.selected!==t&&(e.active=e.selected===-1?!1:e.selected),this._super(),e.selected=e.active,e.selected===!1&&(e.selected=-1)},_setOption:function(e,t){if(e!=="selected")return this._super(e,t);var n=this.options;this._super("active",t===-1?!1:t),n.selected=n.active,n.selected===!1&&(n.selected=-1)},_eventHandler:function(){this._superApply(arguments),this.options.selected=this.options.active,this.options.selected===!1&&(this.options.selected=-1)}}),e.widget("ui.tabs",e.ui.tabs,{options:{show:null,select:null},_create:function(){this._super(),this.options.active!==!1&&this._trigger("show",null,this._ui(this.active.find(".ui-tabs-anchor")[0],this._getPanelForTab(this.active)[0]))},_trigger:function(e,t,n){var r=this._superApply(arguments);return r?(e==="beforeActivate"&&n.newTab.length?r=this._super("select",t,{tab:n.newTab.find(".ui-tabs-anchor")[0],panel:n.newPanel[0],index:n.newTab.closest("li").index()}):e==="activate"&&n.newTab.length&&(r=this._super("show",t,{tab:n.newTab.find(".ui-tabs-anchor")[0],panel:n.newPanel[0],index:n.newTab.closest("li").index()})),r):!1}}),e.widget("ui.tabs",e.ui.tabs,{select:function(e){e=this._getIndex(e);if(e===-1){if(!this.options.collapsible||this.options.selected===-1)return;e=this.options.selected}this.anchors.eq(e).trigger(this.options.event+this.eventNamespace)}}),function(){var t=0;e.widget("ui.tabs",e.ui.tabs,{options:{cookie:null},_create:function(){var e=this.options,t;e.active==null&&e.cookie&&(t=parseInt(this._cookie(),10),t===-1&&(t=!1),e.active=t),this._super()},_cookie:function(n){var r=[this.cookie||(this.cookie=this.options.cookie.name||"ui-tabs-"+ ++t)];return arguments.length&&(r.push(n===!1?-1:n),r.push(this.options.cookie)),e.cookie.apply(null,r)},_refresh:function(){this._super(),this.options.cookie&&this._cookie(this.options.active,this.options.cookie)},_eventHandler:function(){this._superApply(arguments),this.options.cookie&&this._cookie(this.options.active,this.options.cookie)},_destroy:function(){this._super(),this.options.cookie&&this._cookie(null,this.options.cookie)}})}(),e.widget("ui.tabs",e.ui.tabs,{_trigger:function(t,n,r){var i=e.extend({},r);return t==="load"&&(i.panel=i.panel[0],i.tab=i.tab.find(".ui-tabs-anchor")[0]),this._super(t,n,i)}}),e.widget("ui.tabs",e.ui.tabs,{options:{fx:null},_getFx:function(){var t,n,r=this.options.fx;return r&&(e.isArray(r)?(t=r[0],n=r[1]):t=n=r),r?{show:n,hide:t}:null},_toggle:function(e,t){function o(){n.running=!1,n._trigger("activate",e,t)}function u(){t.newTab.closest("li").addClass("ui-tabs-active ui-state-active"),r.length&&s.show?r.animate(s.show,s.show.duration,function(){o()}):(r.show(),o())}var n=this,r=t.newPanel,i=t.oldPanel,s=this._getFx();if(!s)return this._super(e,t);n.running=!0,i.length&&s.hide?i.animate(s.hide,s.hide.duration,function(){t.oldTab.closest("li").removeClass("ui-tabs-active ui-state-active"),u()}):(t.oldTab.closest("li").removeClass("ui-tabs-active ui-state-active"),i.hide(),u())}}))})(jQuery);(function(e){function n(t,n){var r=(t.attr("aria-describedby")||"").split(/\s+/);r.push(n),t.data("ui-tooltip-id",n).attr("aria-describedby",e.trim(r.join(" ")))}function r(t){var n=t.data("ui-tooltip-id"),r=(t.attr("aria-describedby")||"").split(/\s+/),i=e.inArray(n,r);i!==-1&&r.splice(i,1),t.removeData("ui-tooltip-id"),r=e.trim(r.join(" ")),r?t.attr("aria-describedby",r):t.removeAttr("aria-describedby")}var t=0;e.widget("ui.tooltip",{version:"1.9.1",options:{content:function(){return e(this).attr("title")},hide:!0,items:"[title]:not([disabled])",position:{my:"left top+15",at:"left bottom",collision:"flipfit flipfit"},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(t,n){var r=this;if(t==="disabled"){this[n?"_disable":"_enable"](),this.options[t]=n;return}this._super(t,n),t==="content"&&e.each(this.tooltips,function(e,t){r._updateContent(t)})},_disable:function(){var t=this;e.each(this.tooltips,function(n,r){var i=e.Event("blur");i.target=i.currentTarget=r[0],t.close(i,!0)}),this.element.find(this.options.items).andSelf().each(function(){var t=e(this);t.is("[title]")&&t.data("ui-tooltip-title",t.attr("title")).attr("title","")})},_enable:function(){this.element.find(this.options.items).andSelf().each(function(){var t=e(this);t.data("ui-tooltip-title")&&t.attr("title",t.data("ui-tooltip-title"))})},open:function(t){var n=this,r=e(t?t.target:this.element).closest(this.options.items);if(!r.length)return;if(this.options.track&&r.data("ui-tooltip-id")){this._find(r).position(e.extend({of:r},this.options.position)),this._off(this.document,"mousemove");return}r.attr("title")&&r.data("ui-tooltip-title",r.attr("title")),r.data("tooltip-open",!0),t&&t.type==="mouseover"&&r.parents().each(function(){var t;e(this).data("tooltip-open")&&(t=e.Event("blur"),t.target=t.currentTarget=this,n.close(t,!0)),this.title&&(e(this).uniqueId(),n.parents[this.id]={element:this,title:this.title},this.title="")}),this._updateContent(r,t)},_updateContent:function(e,t){var n,r=this.options.content,i=this;if(typeof r=="string")return this._open(t,e,r);n=r.call(e[0],function(n){if(!e.data("tooltip-open"))return;i._delay(function(){this._open(t,e,n)})}),n&&this._open(t,e,n)},_open:function(t,r,i){function f(e){a.of=e;if(s.is(":hidden"))return;s.position(a)}var s,o,u,a=e.extend({},this.options.position);if(!i)return;s=this._find(r);if(s.length){s.find(".ui-tooltip-content").html(i);return}r.is("[title]")&&(t&&t.type==="mouseover"?r.attr("title",""):r.removeAttr("title")),s=this._tooltip(r),n(r,s.attr("id")),s.find(".ui-tooltip-content").html(i),this.options.track&&t&&/^mouse/.test(t.originalEvent.type)?(this._on(this.document,{mousemove:f}),f(t)):s.position(e.extend({of:r},this.options.position)),s.hide(),this._show(s,this.options.show),this.options.show&&this.options.show.delay&&(u=setInterval(function(){s.is(":visible")&&(f(a.of),clearInterval(u))},e.fx.interval)),this._trigger("open",t,{tooltip:s}),o={keyup:function(t){if(t.keyCode===e.ui.keyCode.ESCAPE){var n=e.Event(t);n.currentTarget=r[0],this.close(n,!0)}},remove:function(){this._removeTooltip(s)}};if(!t||t.type==="mouseover")o.mouseleave="close";if(!t||t.type==="focusin")o.focusout="close";this._on(r,o)},close:function(t){var n=this,i=e(t?t.currentTarget:this.element),s=this._find(i);if(this.closing)return;i.data("ui-tooltip-title")&&i.attr("title",i.data("ui-tooltip-title")),r(i),s.stop(!0),this._hide(s,this.options.hide,function(){n._removeTooltip(e(this))}),i.removeData("tooltip-open"),this._off(i,"mouseleave focusout keyup"),i[0]!==this.element[0]&&this._off(i,"remove"),this._off(this.document,"mousemove"),t&&t.type==="mouseleave"&&e.each(this.parents,function(e,t){t.element.title=t.title,delete n.parents[e]}),this.closing=!0,this._trigger("close",t,{tooltip:s}),this.closing=!1},_tooltip:function(n){var r="ui-tooltip-"+t++,i=e("<div>").attr({id:r,role:"tooltip"}).addClass("ui-tooltip ui-widget ui-corner-all ui-widget-content "+(this.options.tooltipClass||""));return e("<div>").addClass("ui-tooltip-content").appendTo(i),i.appendTo(this.document[0].body),e.fn.bgiframe&&i.bgiframe(),this.tooltips[r]=n,i},_find:function(t){var n=t.data("ui-tooltip-id");return n?e("#"+n):e()},_removeTooltip:function(e){e.remove(),delete this.tooltips[e.attr("id")]},_destroy:function(){var t=this;e.each(this.tooltips,function(n,r){var i=e.Event("blur");i.target=i.currentTarget=r[0],t.close(i,!0),e("#"+n).remove(),r.data("ui-tooltip-title")&&(r.attr("title",r.data("ui-tooltip-title")),r.removeData("ui-tooltip-title"))})}})})(jQuery);jQuery.effects||function(e,t){var n=e.uiBackCompat!==!1,r="ui-effects-";e.effects={effect:{}},function(t,n){function p(e,t,n){var r=a[t.type]||{};return e==null?n||!t.def?null:t.def:(e=r.floor?~~e:parseFloat(e),isNaN(e)?t.def:r.mod?(e+r.mod)%r.mod:0>e?0:r.max<e?r.max:e)}function d(e){var n=o(),r=n._rgba=[];return e=e.toLowerCase(),h(s,function(t,i){var s,o=i.re.exec(e),a=o&&i.parse(o),f=i.space||"rgba";if(a)return s=n[f](a),n[u[f].cache]=s[u[f].cache],r=n._rgba=s._rgba,!1}),r.length?(r.join()==="0,0,0,0"&&t.extend(r,c.transparent),n):c[e]}function v(e,t,n){return n=(n+1)%1,n*6<1?e+(t-e)*n*6:n*2<1?t:n*3<2?e+(t-e)*(2/3-n)*6:e}var r="backgroundColor borderBottomColor borderLeftColor borderRightColor borderTopColor color columnRuleColor outlineColor textDecorationColor textEmphasisColor".split(" "),i=/^([\-+])=\s*(\d+\.?\d*)/,s=[{re:/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(?:,\s*(\d+(?:\.\d+)?)\s*)?\)/,parse:function(e){return[e[1],e[2],e[3],e[4]]}},{re:/rgba?\(\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*(?:,\s*(\d+(?:\.\d+)?)\s*)?\)/,parse:function(e){return[e[1]*2.55,e[2]*2.55,e[3]*2.55,e[4]]}},{re:/#([a-f0-9]{2})([a-f0-9]{2})([a-f0-9]{2})/,parse:function(e){return[parseInt(e[1],16),parseInt(e[2],16),parseInt(e[3],16)]}},{re:/#([a-f0-9])([a-f0-9])([a-f0-9])/,parse:function(e){return[parseInt(e[1]+e[1],16),parseInt(e[2]+e[2],16),parseInt(e[3]+e[3],16)]}},{re:/hsla?\(\s*(\d+(?:\.\d+)?)\s*,\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*(?:,\s*(\d+(?:\.\d+)?)\s*)?\)/,space:"hsla",parse:function(e){return[e[1],e[2]/100,e[3]/100,e[4]]}}],o=t.Color=function(e,n,r,i){return new t.Color.fn.parse(e,n,r,i)},u={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"}}}},a={"byte":{floor:!0,max:255},percent:{max:1},degrees:{mod:360,floor:!0}},f=o.support={},l=t("<p>")[0],c,h=t.each;l.style.cssText="background-color:rgba(1,1,1,.5)",f.rgba=l.style.backgroundColor.indexOf("rgba")>-1,h(u,function(e,t){t.cache="_"+e,t.props.alpha={idx:3,type:"percent",def:1}}),o.fn=t.extend(o.prototype,{parse:function(r,i,s,a){if(r===n)return this._rgba=[null,null,null,null],this;if(r.jquery||r.nodeType)r=t(r).css(i),i=n;var f=this,l=t.type(r),v=this._rgba=[];i!==n&&(r=[r,i,s,a],l="array");if(l==="string")return this.parse(d(r)||c._default);if(l==="array")return h(u.rgba.props,function(e,t){v[t.idx]=p(r[t.idx],t)}),this;if(l==="object")return r instanceof o?h(u,function(e,t){r[t.cache]&&(f[t.cache]=r[t.cache].slice())}):h(u,function(t,n){var i=n.cache;h(n.props,function(e,t){if(!f[i]&&n.to){if(e==="alpha"||r[e]==null)return;f[i]=n.to(f._rgba)}f[i][t.idx]=p(r[e],t,!0)}),f[i]&&e.inArray(null,f[i].slice(0,3))<0&&(f[i][3]=1,n.from&&(f._rgba=n.from(f[i])))}),this},is:function(e){var t=o(e),n=!0,r=this;return h(u,function(e,i){var s,o=t[i.cache];return o&&(s=r[i.cache]||i.to&&i.to(r._rgba)||[],h(i.props,function(e,t){if(o[t.idx]!=null)return n=o[t.idx]===s[t.idx],n})),n}),n},_space:function(){var e=[],t=this;return h(u,function(n,r){t[r.cache]&&e.push(n)}),e.pop()},transition:function(e,t){var n=o(e),r=n._space(),i=u[r],s=this.alpha()===0?o("transparent"):this,f=s[i.cache]||i.to(s._rgba),l=f.slice();return n=n[i.cache],h(i.props,function(e,r){var i=r.idx,s=f[i],o=n[i],u=a[r.type]||{};if(o===null)return;s===null?l[i]=o:(u.mod&&(o-s>u.mod/2?s+=u.mod:s-o>u.mod/2&&(s-=u.mod)),l[i]=p((o-s)*t+s,r))}),this[r](l)},blend:function(e){if(this._rgba[3]===1)return this;var n=this._rgba.slice(),r=n.pop(),i=o(e)._rgba;return o(t.map(n,function(e,t){return(1-r)*i[t]+r*e}))},toRgbaString:function(){var e="rgba(",n=t.map(this._rgba,function(e,t){return e==null?t>2?1:0:e});return n[3]===1&&(n.pop(),e="rgb("),e+n.join()+")"},toHslaString:function(){var e="hsla(",n=t.map(this.hsla(),function(e,t){return e==null&&(e=t>2?1:0),t&&t<3&&(e=Math.round(e*100)+"%"),e});return n[3]===1&&(n.pop(),e="hsl("),e+n.join()+")"},toHexString:function(e){var n=this._rgba.slice(),r=n.pop();return e&&n.push(~~(r*255)),"#"+t.map(n,function(e){return e=(e||0).toString(16),e.length===1?"0"+e:e}).join("")},toString:function(){return this._rgba[3]===0?"transparent":this.toRgbaString()}}),o.fn.parse.prototype=o.fn,u.hsla.to=function(e){if(e[0]==null||e[1]==null||e[2]==null)return[null,null,null,e[3]];var t=e[0]/255,n=e[1]/255,r=e[2]/255,i=e[3],s=Math.max(t,n,r),o=Math.min(t,n,r),u=s-o,a=s+o,f=a*.5,l,c;return o===s?l=0:t===s?l=60*(n-r)/u+360:n===s?l=60*(r-t)/u+120:l=60*(t-n)/u+240,f===0||f===1?c=f:f<=.5?c=u/a:c=u/(2-a),[Math.round(l)%360,c,f,i==null?1:i]},u.hsla.from=function(e){if(e[0]==null||e[1]==null||e[2]==null)return[null,null,null,e[3]];var t=e[0]/360,n=e[1],r=e[2],i=e[3],s=r<=.5?r*(1+n):r+n-r*n,o=2*r-s;return[Math.round(v(o,s,t+1/3)*255),Math.round(v(o,s,t)*255),Math.round(v(o,s,t-1/3)*255),i]},h(u,function(e,r){var s=r.props,u=r.cache,a=r.to,f=r.from;o.fn[e]=function(e){a&&!this[u]&&(this[u]=a(this._rgba));if(e===n)return this[u].slice();var r,i=t.type(e),l=i==="array"||i==="object"?e:arguments,c=this[u].slice();return h(s,function(e,t){var n=l[i==="object"?e:t.idx];n==null&&(n=c[t.idx]),c[t.idx]=p(n,t)}),f?(r=o(f(c)),r[u]=c,r):o(c)},h(s,function(n,r){if(o.fn[n])return;o.fn[n]=function(s){var o=t.type(s),u=n==="alpha"?this._hsla?"hsla":"rgba":e,a=this[u](),f=a[r.idx],l;return o==="undefined"?f:(o==="function"&&(s=s.call(this,f),o=t.type(s)),s==null&&r.empty?this:(o==="string"&&(l=i.exec(s),l&&(s=f+parseFloat(l[2])*(l[1]==="+"?1:-1))),a[r.idx]=s,this[u](a)))}})}),h(r,function(e,n){t.cssHooks[n]={set:function(e,r){var i,s,u="";if(t.type(r)!=="string"||(i=d(r))){r=o(i||r);if(!f.rgba&&r._rgba[3]!==1){s=n==="backgroundColor"?e.parentNode:e;while((u===""||u==="transparent")&&s&&s.style)try{u=t.css(s,"backgroundColor"),s=s.parentNode}catch(a){}r=r.blend(u&&u!=="transparent"?u:"_default")}r=r.toRgbaString()}try{e.style[n]=r}catch(l){}}},t.fx.step[n]=function(e){e.colorInit||(e.start=o(e.elem,n),e.end=o(e.end),e.colorInit=!0),t.cssHooks[n].set(e.elem,e.start.transition(e.end,e.pos))}}),t.cssHooks.borderColor={expand:function(e){var t={};return h(["Top","Right","Bottom","Left"],function(n,r){t["border"+r+"Color"]=e}),t}},c=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(){var t=this.ownerDocument.defaultView?this.ownerDocument.defaultView.getComputedStyle(this,null):this.currentStyle,n={},r,i;if(t&&t.length&&t[0]&&t[t[0]]){i=t.length;while(i--)r=t[i],typeof t[r]=="string"&&(n[e.camelCase(r)]=t[r])}else for(r in t)typeof t[r]=="string"&&(n[r]=t[r]);return n}function s(t,n){var i={},s,o;for(s in n)o=n[s],t[s]!==o&&!r[s]&&(e.fx.step[s]||!isNaN(parseFloat(o)))&&(i[s]=o);return i}var n=["add","remove","toggle"],r={border:1,borderBottom:1,borderColor:1,borderLeft:1,borderRight:1,borderTop:1,borderWidth:1,margin:1,padding:1};e.each(["borderLeftStyle","borderRightStyle","borderBottomStyle","borderTopStyle"],function(t,n){e.fx.step[n]=function(e){if(e.end!=="none"&&!e.setAttr||e.pos===1&&!e.setAttr)jQuery.style(e.elem,n,e.end),e.setAttr=!0}}),e.effects.animateClass=function(t,r,o,u){var a=e.speed(r,o,u);return this.queue(function(){var r=e(this),o=r.attr("class")||"",u,f=a.children?r.find("*").andSelf():r;f=f.map(function(){var t=e(this);return{el:t,start:i.call(this)}}),u=function(){e.each(n,function(e,n){t[n]&&r[n+"Class"](t[n])})},u(),f=f.map(function(){return this.end=i.call(this.el[0]),this.diff=s(this.start,this.end),this}),r.attr("class",o),f=f.map(function(){var t=this,n=e.Deferred(),r=jQuery.extend({},a,{queue:!1,complete:function(){n.resolve(t)}});return this.el.animate(this.diff,r),n.promise()}),e.when.apply(e,f.get()).done(function(){u(),e.each(arguments,function(){var t=this.el;e.each(this.diff,function(e){t.css(e,"")})}),a.complete.call(r[0])})})},e.fn.extend({_addClass:e.fn.addClass,addClass:function(t,n,r,i){return n?e.effects.animateClass.call(this,{add:t},n,r,i):this._addClass(t)},_removeClass:e.fn.removeClass,removeClass:function(t,n,r,i){return n?e.effects.animateClass.call(this,{remove:t},n,r,i):this._removeClass(t)},_toggleClass:e.fn.toggleClass,toggleClass:function(n,r,i,s,o){return typeof r=="boolean"||r===t?i?e.effects.animateClass.call(this,r?{add:n}:{remove:n},i,s,o):this._toggleClass(n,r):e.effects.animateClass.call(this,{toggle:n},r,i,s)},switchClass:function(t,n,r,i,s){return e.effects.animateClass.call(this,{add:n,remove:t},r,i,s)}})}(),function(){function i(t,n,r,i){e.isPlainObject(t)&&(n=t,t=t.effect),t={effect:t},n==null&&(n={}),e.isFunction(n)&&(i=n,r=null,n={});if(typeof n=="number"||e.fx.speeds[n])i=r,r=n,n={};return e.isFunction(r)&&(i=r,r=null),n&&e.extend(t,n),r=r||n.duration,t.duration=e.fx.off?0:typeof r=="number"?r:r in e.fx.speeds?e.fx.speeds[r]:e.fx.speeds._default,t.complete=i||n.complete,t}function s(t){return!t||typeof t=="number"||e.fx.speeds[t]?!0:typeof t=="string"&&!e.effects.effect[t]?n&&e.effects[t]?!1:!0:!1}e.extend(e.effects,{version:"1.9.1",save:function(e,t){for(var n=0;n<t.length;n++)t[n]!==null&&e.data(r+t[n],e[0].style[t[n]])},restore:function(e,n){var i,s;for(s=0;s<n.length;s++)n[s]!==null&&(i=e.data(r+n[s]),i===t&&(i=""),e.css(n[s],i))},setMode:function(e,t){return t==="toggle"&&(t=e.is(":hidden")?"show":"hide"),t},getBaseline:function(e,t){var n,r;switch(e[0]){case"top":n=0;break;case"middle":n=.5;break;case"bottom":n=1;break;default:n=e[0]/t.height}switch(e[1]){case"left":r=0;break;case"center":r=.5;break;case"right":r=1;break;default:r=e[1]/t.width}return{x:r,y:n}},createWrapper:function(t){if(t.parent().is(".ui-effects-wrapper"))return t.parent();var n={width:t.outerWidth(!0),height:t.outerHeight(!0),"float":t.css("float")},r=e("<div></div>").addClass("ui-effects-wrapper").css({fontSize:"100%",background:"transparent",border:"none",margin:0,padding:0}),i={width:t.width(),height:t.height()},s=document.activeElement;try{s.id}catch(o){s=document.body}return t.wrap(r),(t[0]===s||e.contains(t[0],s))&&e(s).focus(),r=t.parent(),t.css("position")==="static"?(r.css({position:"relative"}),t.css({position:"relative"})):(e.extend(n,{position:t.css("position"),zIndex:t.css("z-index")}),e.each(["top","left","bottom","right"],function(e,r){n[r]=t.css(r),isNaN(parseInt(n[r],10))&&(n[r]="auto")}),t.css({position:"relative",top:0,left:0,right:"auto",bottom:"auto"})),t.css(i),r.css(n).show()},removeWrapper:function(t){var n=document.activeElement;return t.parent().is(".ui-effects-wrapper")&&(t.parent().replaceWith(t),(t[0]===n||e.contains(t[0],n))&&e(n).focus()),t},setTransition:function(t,n,r,i){return i=i||{},e.each(n,function(e,n){var s=t.cssUnit(n);s[0]>0&&(i[n]=s[0]*r+s[1])}),i}}),e.fn.extend({effect:function(){function a(n){function u(){e.isFunction(i)&&i.call(r[0]),e.isFunction(n)&&n()}var r=e(this),i=t.complete,s=t.mode;(r.is(":hidden")?s==="hide":s==="show")?u():o.call(r[0],t,u)}var t=i.apply(this,arguments),r=t.mode,s=t.queue,o=e.effects.effect[t.effect],u=!o&&n&&e.effects[t.effect];return e.fx.off||!o&&!u?r?this[r](t.duration,t.complete):this.each(function(){t.complete&&t.complete.call(this)}):o?s===!1?this.each(a):this.queue(s||"fx",a):u.call(this,{options:t,duration:t.duration,callback:t.complete,mode:t.mode})},_show:e.fn.show,show:function(e){if(s(e))return this._show.apply(this,arguments);var t=i.apply(this,arguments);return t.mode="show",this.effect.call(this,t)},_hide:e.fn.hide,hide:function(e){if(s(e))return this._hide.apply(this,arguments);var t=i.apply(this,arguments);return t.mode="hide",this.effect.call(this,t)},__toggle:e.fn.toggle,toggle:function(t){if(s(t)||typeof t=="boolean"||e.isFunction(t))return this.__toggle.apply(this,arguments);var n=i.apply(this,arguments);return n.mode="toggle",this.effect.call(this,n)},cssUnit:function(t){var n=this.css(t),r=[];return e.each(["em","px","%","pt"],function(e,t){n.indexOf(t)>0&&(r=[parseFloat(n),t])}),r}})}(),function(){var t={};e.each(["Quad","Cubic","Quart","Quint","Expo"],function(e,n){t[n]=function(t){return Math.pow(t,e+2)}}),e.extend(t,{Sine:function(e){return 1-Math.cos(e*Math.PI/2)},Circ:function(e){return 1-Math.sqrt(1-e*e)},Elastic:function(e){return e===0||e===1?e:-Math.pow(2,8*(e-1))*Math.sin(((e-1)*80-7.5)*Math.PI/15)},Back:function(e){return e*e*(3*e-2)},Bounce:function(e){var t,n=4;while(e<((t=Math.pow(2,--n))-1)/11);return 1/Math.pow(4,3-n)-7.5625*Math.pow((t*3-2)/22-e,2)}}),e.each(t,function(t,n){e.easing["easeIn"+t]=n,e.easing["easeOut"+t]=function(e){return 1-n(1-e)},e.easing["easeInOut"+t]=function(e){return e<.5?n(e*2)/2:1-n(e*-2+2)/2}})}()}(jQuery);(function(e,t){var n=/up|down|vertical/,r=/up|left|vertical|horizontal/;e.effects.effect.blind=function(t,i){var s=e(this),o=["position","top","bottom","left","right","height","width"],u=e.effects.setMode(s,t.mode||"hide"),a=t.direction||"up",f=n.test(a),l=f?"height":"width",c=f?"top":"left",h=r.test(a),p={},d=u==="show",v,m,g;s.parent().is(".ui-effects-wrapper")?e.effects.save(s.parent(),o):e.effects.save(s,o),s.show(),v=e.effects.createWrapper(s).css({overflow:"hidden"}),m=v[l](),g=parseFloat(v.css(c))||0,p[l]=d?m:0,h||(s.css(f?"bottom":"right",0).css(f?"top":"left","auto").css({position:"absolute"}),p[c]=d?g:m+g),d&&(v.css(l,0),h||v.css(c,g+m)),v.animate(p,{duration:t.duration,easing:t.easing,queue:!1,complete:function(){u==="hide"&&s.hide(),e.effects.restore(s,o),e.effects.removeWrapper(s),i()}})}})(jQuery);(function(e,t){e.effects.effect.bounce=function(t,n){var r=e(this),i=["position","top","bottom","left","right","height","width"],s=e.effects.setMode(r,t.mode||"effect"),o=s==="hide",u=s==="show",a=t.direction||"up",f=t.distance,l=t.times||5,c=l*2+(u||o?1:0),h=t.duration/c,p=t.easing,d=a==="up"||a==="down"?"top":"left",v=a==="up"||a==="left",m,g,y,b=r.queue(),w=b.length;(u||o)&&i.push("opacity"),e.effects.save(r,i),r.show(),e.effects.createWrapper(r),f||(f=r[d==="top"?"outerHeight":"outerWidth"]()/3),u&&(y={opacity:1},y[d]=0,r.css("opacity",0).css(d,v?-f*2:f*2).animate(y,h,p)),o&&(f/=Math.pow(2,l-1)),y={},y[d]=0;for(m=0;m<l;m++)g={},g[d]=(v?"-=":"+=")+f,r.animate(g,h,p).animate(y,h,p),f=o?f*2:f/2;o&&(g={opacity:0},g[d]=(v?"-=":"+=")+f,r.animate(g,h,p)),r.queue(function(){o&&r.hide(),e.effects.restore(r,i),e.effects.removeWrapper(r),n()}),w>1&&b.splice.apply(b,[1,0].concat(b.splice(w,c+1))),r.dequeue()}})(jQuery);(function(e,t){e.effects.effect.clip=function(t,n){var r=e(this),i=["position","top","bottom","left","right","height","width"],s=e.effects.setMode(r,t.mode||"hide"),o=s==="show",u=t.direction||"vertical",a=u==="vertical",f=a?"height":"width",l=a?"top":"left",c={},h,p,d;e.effects.save(r,i),r.show(),h=e.effects.createWrapper(r).css({overflow:"hidden"}),p=r[0].tagName==="IMG"?h:r,d=p[f](),o&&(p.css(f,0),p.css(l,d/2)),c[f]=o?d:0,c[l]=o?0:d/2,p.animate(c,{queue:!1,duration:t.duration,easing:t.easing,complete:function(){o||r.hide(),e.effects.restore(r,i),e.effects.removeWrapper(r),n()}})}})(jQuery);(function(e,t){e.effects.effect.drop=function(t,n){var r=e(this),i=["position","top","bottom","left","right","opacity","height","width"],s=e.effects.setMode(r,t.mode||"hide"),o=s==="show",u=t.direction||"left",a=u==="up"||u==="down"?"top":"left",f=u==="up"||u==="left"?"pos":"neg",l={opacity:o?1:0},c;e.effects.save(r,i),r.show(),e.effects.createWrapper(r),c=t.distance||r[a==="top"?"outerHeight":"outerWidth"](!0)/2,o&&r.css("opacity",0).css(a,f==="pos"?-c:c),l[a]=(o?f==="pos"?"+=":"-=":f==="pos"?"-=":"+=")+c,r.animate(l,{queue:!1,duration:t.duration,easing:t.easing,complete:function(){s==="hide"&&r.hide(),e.effects.restore(r,i),e.effects.removeWrapper(r),n()}})}})(jQuery);(function(e,t){e.effects.effect.explode=function(t,n){function y(){c.push(this),c.length===r*i&&b()}function b(){s.css({visibility:"visible"}),e(c).remove(),u||s.hide(),n()}var r=t.pieces?Math.round(Math.sqrt(t.pieces)):3,i=r,s=e(this),o=e.effects.setMode(s,t.mode||"hide"),u=o==="show",a=s.show().css("visibility","hidden").offset(),f=Math.ceil(s.outerWidth()/i),l=Math.ceil(s.outerHeight()/r),c=[],h,p,d,v,m,g;for(h=0;h<r;h++){v=a.top+h*l,g=h-(r-1)/2;for(p=0;p<i;p++)d=a.left+p*f,m=p-(i-1)/2,s.clone().appendTo("body").wrap("<div></div>").css({position:"absolute",visibility:"visible",left:-p*f,top:-h*l}).parent().addClass("ui-effects-explode").css({position:"absolute",overflow:"hidden",width:f,height:l,left:d+(u?m*f:0),top:v+(u?g*l:0),opacity:u?0:1}).animate({left:d+(u?0:m*f),top:v+(u?0:g*l),opacity:u?1:0},t.duration||500,t.easing,y)}}})(jQuery);(function(e,t){e.effects.effect.fade=function(t,n){var r=e(this),i=e.effects.setMode(r,t.mode||"toggle");r.animate({opacity:i},{queue:!1,duration:t.duration,easing:t.easing,complete:n})}})(jQuery);(function(e,t){e.effects.effect.fold=function(t,n){var r=e(this),i=["position","top","bottom","left","right","height","width"],s=e.effects.setMode(r,t.mode||"hide"),o=s==="show",u=s==="hide",a=t.size||15,f=/([0-9]+)%/.exec(a),l=!!t.horizFirst,c=o!==l,h=c?["width","height"]:["height","width"],p=t.duration/2,d,v,m={},g={};e.effects.save(r,i),r.show(),d=e.effects.createWrapper(r).css({overflow:"hidden"}),v=c?[d.width(),d.height()]:[d.height(),d.width()],f&&(a=parseInt(f[1],10)/100*v[u?0:1]),o&&d.css(l?{height:0,width:a}:{height:a,width:0}),m[h[0]]=o?v[0]:a,g[h[1]]=o?v[1]:0,d.animate(m,p,t.easing).animate(g,p,t.easing,function(){u&&r.hide(),e.effects.restore(r,i),e.effects.removeWrapper(r),n()})}})(jQuery);(function(e,t){e.effects.effect.highlight=function(t,n){var r=e(this),i=["backgroundImage","backgroundColor","opacity"],s=e.effects.setMode(r,t.mode||"show"),o={backgroundColor:r.css("backgroundColor")};s==="hide"&&(o.opacity=0),e.effects.save(r,i),r.show().css({backgroundImage:"none",backgroundColor:t.color||"#ffff99"}).animate(o,{queue:!1,duration:t.duration,easing:t.easing,complete:function(){s==="hide"&&r.hide(),e.effects.restore(r,i),n()}})}})(jQuery);(function(e,t){e.effects.effect.pulsate=function(t,n){var r=e(this),i=e.effects.setMode(r,t.mode||"show"),s=i==="show",o=i==="hide",u=s||i==="hide",a=(t.times||5)*2+(u?1:0),f=t.duration/a,l=0,c=r.queue(),h=c.length,p;if(s||!r.is(":visible"))r.css("opacity",0).show(),l=1;for(p=1;p<a;p++)r.animate({opacity:l},f,t.easing),l=1-l;r.animate({opacity:l},f,t.easing),r.queue(function(){o&&r.hide(),n()}),h>1&&c.splice.apply(c,[1,0].concat(c.splice(h,a+1))),r.dequeue()}})(jQuery);(function(e,t){e.effects.effect.puff=function(t,n){var r=e(this),i=e.effects.setMode(r,t.mode||"hide"),s=i==="hide",o=parseInt(t.percent,10)||150,u=o/100,a={height:r.height(),width:r.width()};e.extend(t,{effect:"scale",queue:!1,fade:!0,mode:i,complete:n,percent:s?o:100,from:s?a:{height:a.height*u,width:a.width*u}}),r.effect(t)},e.effects.effect.scale=function(t,n){var r=e(this),i=e.extend(!0,{},t),s=e.effects.setMode(r,t.mode||"effect"),o=parseInt(t.percent,10)||(parseInt(t.percent,10)===0?0:s==="hide"?0:100),u=t.direction||"both",a=t.origin,f={height:r.height(),width:r.width(),outerHeight:r.outerHeight(),outerWidth:r.outerWidth()},l={y:u!=="horizontal"?o/100:1,x:u!=="vertical"?o/100:1};i.effect="size",i.queue=!1,i.complete=n,s!=="effect"&&(i.origin=a||["middle","center"],i.restore=!0),i.from=t.from||(s==="show"?{height:0,width:0}:f),i.to={height:f.height*l.y,width:f.width*l.x,outerHeight:f.outerHeight*l.y,outerWidth:f.outerWidth*l.x},i.fade&&(s==="show"&&(i.from.opacity=0,i.to.opacity=1),s==="hide"&&(i.from.opacity=1,i.to.opacity=0)),r.effect(i)},e.effects.effect.size=function(t,n){var r,i,s,o=e(this),u=["position","top","bottom","left","right","width","height","overflow","opacity"],a=["position","top","bottom","left","right","overflow","opacity"],f=["width","height","overflow"],l=["fontSize"],c=["borderTopWidth","borderBottomWidth","paddingTop","paddingBottom"],h=["borderLeftWidth","borderRightWidth","paddingLeft","paddingRight"],p=e.effects.setMode(o,t.mode||"effect"),d=t.restore||p!=="effect",v=t.scale||"both",m=t.origin||["middle","center"],g=o.css("position"),y=d?u:a,b={height:0,width:0};p==="show"&&o.show(),r={height:o.height(),width:o.width(),outerHeight:o.outerHeight(),outerWidth:o.outerWidth()},t.mode==="toggle"&&p==="show"?(o.from=t.to||b,o.to=t.from||r):(o.from=t.from||(p==="show"?b:r),o.to=t.to||(p==="hide"?b:r)),s={from:{y:o.from.height/r.height,x:o.from.width/r.width},to:{y:o.to.height/r.height,x:o.to.width/r.width}};if(v==="box"||v==="both")s.from.y!==s.to.y&&(y=y.concat(c),o.from=e.effects.setTransition(o,c,s.from.y,o.from),o.to=e.effects.setTransition(o,c,s.to.y,o.to)),s.from.x!==s.to.x&&(y=y.concat(h),o.from=e.effects.setTransition(o,h,s.from.x,o.from),o.to=e.effects.setTransition(o,h,s.to.x,o.to));(v==="content"||v==="both")&&s.from.y!==s.to.y&&(y=y.concat(l).concat(f),o.from=e.effects.setTransition(o,l,s.from.y,o.from),o.to=e.effects.setTransition(o,l,s.to.y,o.to)),e.effects.save(o,y),o.show(),e.effects.createWrapper(o),o.css("overflow","hidden").css(o.from),m&&(i=e.effects.getBaseline(m,r),o.from.top=(r.outerHeight-o.outerHeight())*i.y,o.from.left=(r.outerWidth-o.outerWidth())*i.x,o.to.top=(r.outerHeight-o.to.outerHeight)*i.y,o.to.left=(r.outerWidth-o.to.outerWidth)*i.x),o.css(o.from);if(v==="content"||v==="both")c=c.concat(["marginTop","marginBottom"]).concat(l),h=h.concat(["marginLeft","marginRight"]),f=u.concat(c).concat(h),o.find("*[width]").each(function(){var n=e(this),r={height:n.height(),width:n.width()};d&&e.effects.save(n,f),n.from={height:r.height*s.from.y,width:r.width*s.from.x},n.to={height:r.height*s.to.y,width:r.width*s.to.x},s.from.y!==s.to.y&&(n.from=e.effects.setTransition(n,c,s.from.y,n.from),n.to=e.effects.setTransition(n,c,s.to.y,n.to)),s.from.x!==s.to.x&&(n.from=e.effects.setTransition(n,h,s.from.x,n.from),n.to=e.effects.setTransition(n,h,s.to.x,n.to)),n.css(n.from),n.animate(n.to,t.duration,t.easing,function(){d&&e.effects.restore(n,f)})});o.animate(o.to,{queue:!1,duration:t.duration,easing:t.easing,complete:function(){o.to.opacity===0&&o.css("opacity",o.from.opacity),p==="hide"&&o.hide(),e.effects.restore(o,y),d||(g==="static"?o.css({position:"relative",top:o.to.top,left:o.to.left}):e.each(["top","left"],function(e,t){o.css(t,function(t,n){var r=parseInt(n,10),i=e?o.to.left:o.to.top;return n==="auto"?i+"px":r+i+"px"})})),e.effects.removeWrapper(o),n()}})}})(jQuery);(function(e,t){e.effects.effect.shake=function(t,n){var r=e(this),i=["position","top","bottom","left","right","height","width"],s=e.effects.setMode(r,t.mode||"effect"),o=t.direction||"left",u=t.distance||20,a=t.times||3,f=a*2+1,l=Math.round(t.duration/f),c=o==="up"||o==="down"?"top":"left",h=o==="up"||o==="left",p={},d={},v={},m,g=r.queue(),y=g.length;e.effects.save(r,i),r.show(),e.effects.createWrapper(r),p[c]=(h?"-=":"+=")+u,d[c]=(h?"+=":"-=")+u*2,v[c]=(h?"-=":"+=")+u*2,r.animate(p,l,t.easing);for(m=1;m<a;m++)r.animate(d,l,t.easing).animate(v,l,t.easing);r.animate(d,l,t.easing).animate(p,l/2,t.easing).queue(function(){s==="hide"&&r.hide(),e.effects.restore(r,i),e.effects.removeWrapper(r),n()}),y>1&&g.splice.apply(g,[1,0].concat(g.splice(y,f+1))),r.dequeue()}})(jQuery);(function(e,t){e.effects.effect.slide=function(t,n){var r=e(this),i=["position","top","bottom","left","right","width","height"],s=e.effects.setMode(r,t.mode||"show"),o=s==="show",u=t.direction||"left",a=u==="up"||u==="down"?"top":"left",f=u==="up"||u==="left",l,c={};e.effects.save(r,i),r.show(),l=t.distance||r[a==="top"?"outerHeight":"outerWidth"](!0),e.effects.createWrapper(r).css({overflow:"hidden"}),o&&r.css(a,f?isNaN(l)?"-"+l:-l:l),c[a]=(o?f?"+=":"-=":f?"-=":"+=")+l,r.animate(c,{queue:!1,duration:t.duration,easing:t.easing,complete:function(){s==="hide"&&r.hide(),e.effects.restore(r,i),e.effects.removeWrapper(r),n()}})}})(jQuery);(function(e,t){e.effects.effect.transfer=function(t,n){var r=e(this),i=e(t.to),s=i.css("position")==="fixed",o=e("body"),u=s?o.scrollTop():0,a=s?o.scrollLeft():0,f=i.offset(),l={top:f.top-u,left:f.left-a,height:i.innerHeight(),width:i.innerWidth()},c=r.offset(),h=e('<div class="ui-effects-transfer"></div>').appendTo(document.body).addClass(t.className).css({top:c.top-u,left:c.left-a,height:r.innerHeight(),width:r.innerWidth(),position:s?"fixed":"absolute"}).animate(l,t.duration,t.easing,function(){h.remove(),n()})}})(jQuery);\ No newline at end of filediff --git a/data/libs/jquerylayout/jquery.layout-latest.js b/data/libs/jquerylayout/jquery.layout-latest.jsdeleted file mode 100644index 6836f646e..000000000--- a/data/libs/jquerylayout/jquery.layout-latest.js+++ /dev/null@@ -1,5922 +0,0 @@-/**- * @preserve- * jquery.layout 1.3.0 - Release Candidate 30.7- * $Date: 2012-10-13 08:00:00 (Sat, 13 Oct 2012) $- * $Rev: 303007 $- *- * Copyright (c) 2012- * Fabrizio Balliano (http://www.fabrizioballiano.net)- * Kevin Dalman (http://allpro.net)- *- * Dual licensed under the GPL (http://www.gnu.org/licenses/gpl.html)- * and MIT (http://www.opensource.org/licenses/mit-license.php) licenses.- *- * Changelog: http://layout.jquery-dev.net/changelog.cfm#1.3.0.rc30.7- *- * Docs: http://layout.jquery-dev.net/documentation.html- * Tips: http://layout.jquery-dev.net/tips.html- * Help: http://groups.google.com/group/jquery-ui-layout- */--/* JavaDoc Info: http://code.google.com/closure/compiler/docs/js-for-compiler.html- * {!Object} non-nullable type (never NULL)- * {?string} nullable type (sometimes NULL) - default for {Object}- * {number=} optional parameter- * {*} ALL types- */--// NOTE: For best readability, view with a fixed-width font and tabs equal to 4-chars--;(function ($) {--// alias Math methods - used a lot!-var min = Math.min-, max = Math.max-, round = Math.floor--, isStr = function (v) { return $.type(v) === "string"; }-- /**- * @param {!Object} Instance- * @param {Array.<string>} a_fn- */-, runPluginCallbacks = function (Instance, a_fn) {- if ($.isArray(a_fn))- for (var i=0, c=a_fn.length; i<c; i++) {- var fn = a_fn[i];- try {- if (isStr(fn)) // 'name' of a function- fn = eval(fn);- if ($.isFunction(fn))- g(fn)( Instance );- } catch (ex) {}- }- function g (f) { return f; }; // compiler hack- }--;---/*- * GENERIC $.layout METHODS - used by all layouts- */-$.layout = {-- version: "1.3.rc30.7"-, revision: 0.033007 // 1.3.0 final = 1.0300 - major(n+).minor(nn)+patch(nn+)-- // can update code here if $.browser is phased out or logic changes-, browser: {- mozilla: !!$.browser.mozilla- , webkit: !!$.browser.webkit || !!$.browser.safari // webkit = jQ 1.4- , msie: !!$.browser.msie- , isIE6: $.browser.msie && $.browser.version == 6- , boxModel: $.support.boxModel !== false || !$.browser.msie // ONLY IE reverts to old box-model - update for older jQ onReady- , version: $.browser.version // not used in Layout core, but may be used by plugins- }-- // *PREDEFINED* EFFECTS & DEFAULTS- // MUST list effect here - OR MUST set an fxSettings option (can be an empty hash: {})-, effects: {-- // Pane Open/Close Animations- slide: {- all: { duration: "fast" } // eg: duration: 1000, easing: "easeOutBounce"- , north: { direction: "up" }- , south: { direction: "down" }- , east: { direction: "right"}- , west: { direction: "left" }- }- , drop: {- all: { duration: "slow" }- , north: { direction: "up" }- , south: { direction: "down" }- , east: { direction: "right"}- , west: { direction: "left" }- }- , scale: {- all: { duration: "fast" }- }- // these are not recommended, but can be used- , blind: {}- , clip: {}- , explode: {}- , fade: {}- , fold: {}- , puff: {}-- // Pane Resize Animations- , size: {- all: { easing: "swing" }- }- }-- // INTERNAL CONFIG DATA - DO NOT CHANGE THIS!-, config: {- optionRootKeys: "effects,panes,north,south,west,east,center".split(",")- , allPanes: "north,south,west,east,center".split(",")- , borderPanes: "north,south,west,east".split(",")- , oppositeEdge: {- north: "south"- , south: "north"- , east: "west"- , west: "east"- }- // offscreen data- , offscreenCSS: { left: "-99999px", right: "auto" } // used by hide/close if useOffscreenClose=true- , offscreenReset: "offscreenReset" // key used for data- // CSS used in multiple places- , hidden: { visibility: "hidden" }- , visible: { visibility: "visible" }- // layout element settings- , resizers: {- cssReq: {- position: "absolute"- , padding: 0- , margin: 0- , fontSize: "1px"- , textAlign: "left" // to counter-act "center" alignment!- , overflow: "hidden" // prevent toggler-button from overflowing- // SEE $.layout.defaults.zIndexes.resizer_normal- }- , cssDemo: { // DEMO CSS - applied if: options.PANE.applyDemoStyles=true- background: "#DDD"- , border: "none"- }- }- , togglers: {- cssReq: {- position: "absolute"- , display: "block"- , padding: 0- , margin: 0- , overflow: "hidden"- , textAlign: "center"- , fontSize: "1px"- , cursor: "pointer"- , zIndex: 1- }- , cssDemo: { // DEMO CSS - applied if: options.PANE.applyDemoStyles=true- background: "#AAA"- }- }- , content: {- cssReq: {- position: "relative" /* contain floated or positioned elements */- }- , cssDemo: { // DEMO CSS - applied if: options.PANE.applyDemoStyles=true- overflow: "auto"- , padding: "10px"- }- , cssDemoPane: { // DEMO CSS - REMOVE scrolling from 'pane' when it has a content-div- overflow: "hidden"- , padding: 0- }- }- , panes: { // defaults for ALL panes - overridden by 'per-pane settings' below- cssReq: {- position: "absolute"- , margin: 0- // $.layout.defaults.zIndexes.pane_normal- }- , cssDemo: { // DEMO CSS - applied if: options.PANE.applyDemoStyles=true- padding: "10px"- , background: "#FFF"- , border: "1px solid #BBB"- , overflow: "auto"- }- }- , north: {- side: "top"- , sizeType: "Height"- , dir: "horz"- , cssReq: {- top: 0- , bottom: "auto"- , left: 0- , right: 0- , width: "auto"- // height: DYNAMIC- }- }- , south: {- side: "bottom"- , sizeType: "Height"- , dir: "horz"- , cssReq: {- top: "auto"- , bottom: 0- , left: 0- , right: 0- , width: "auto"- // height: DYNAMIC- }- }- , east: {- side: "right"- , sizeType: "Width"- , dir: "vert"- , cssReq: {- left: "auto"- , right: 0- , top: "auto" // DYNAMIC- , bottom: "auto" // DYNAMIC- , height: "auto"- // width: DYNAMIC- }- }- , west: {- side: "left"- , sizeType: "Width"- , dir: "vert"- , cssReq: {- left: 0- , right: "auto"- , top: "auto" // DYNAMIC- , bottom: "auto" // DYNAMIC- , height: "auto"- // width: DYNAMIC- }- }- , center: {- dir: "center"- , cssReq: {- left: "auto" // DYNAMIC- , right: "auto" // DYNAMIC- , top: "auto" // DYNAMIC- , bottom: "auto" // DYNAMIC- , height: "auto"- , width: "auto"- }- }- }-- // CALLBACK FUNCTION NAMESPACE - used to store reusable callback functions-, callbacks: {}--, getParentPaneElem: function (el) {- // must pass either a container or pane element- var $el = $(el)- , layout = $el.data("layout") || $el.data("parentLayout");- if (layout) {- var $cont = layout.container;- // see if this container is directly-nested inside an outer-pane- if ($cont.data("layoutPane")) return $cont;- var $pane = $cont.closest("."+ $.layout.defaults.panes.paneClass);- // if a pane was found, return it- if ($pane.data("layoutPane")) return $pane;- }- return null;- }--, getParentPaneInstance: function (el) {- // must pass either a container or pane element- var $pane = $.layout.getParentPaneElem(el);- return $pane ? $pane.data("layoutPane") : null;- }--, getParentLayoutInstance: function (el) {- // must pass either a container or pane element- var $pane = $.layout.getParentPaneElem(el);- return $pane ? $pane.data("parentLayout") : null;- }--, getEventObject: function (evt) {- return typeof evt === "object" && evt.stopPropagation ? evt : null;- }-, parsePaneName: function (evt_or_pane) {- // getEventObject() automatically calls .stopPropagation(), WHICH MUST BE DONE!- var evt = $.layout.getEventObject( evt_or_pane );- if (evt) {- // ALWAYS stop propagation of events triggered in Layout!- evt.stopPropagation();- return $(this).data("layoutEdge");- }- else- return evt_or_pane;- }--- // LAYOUT-PLUGIN REGISTRATION- // more plugins can added beyond this default list-, plugins: {- draggable: !!$.fn.draggable // resizing- , effects: {- core: !!$.effects // animimations (specific effects tested by initOptions)- , slide: $.effects && ($.effects.slide || $.effects.effect.slide) // default effect- }- }--// arrays of plugin or other methods to be triggered for events in *each layout* - will be passed 'Instance'-, onCreate: [] // runs when layout is just starting to be created - right after options are set-, onLoad: [] // runs after layout container and global events init, but before initPanes is called-, onReady: [] // runs after initialization *completes* - ie, after initPanes completes successfully-, onDestroy: [] // runs after layout is destroyed-, onUnload: [] // runs after layout is destroyed OR when page unloads-, afterOpen: [] // runs after setAsOpen() completes-, afterClose: [] // runs after setAsClosed() completes-- /*- * GENERIC UTILITY METHODS- */-- // calculate and return the scrollbar width, as an integer-, scrollbarWidth: function () { return window.scrollbarWidth || $.layout.getScrollbarSize('width'); }-, scrollbarHeight: function () { return window.scrollbarHeight || $.layout.getScrollbarSize('height'); }-, getScrollbarSize: function (dim) {- var $c = $('<div style="position: absolute; top: -10000px; left: -10000px; width: 100px; height: 100px; overflow: scroll;"></div>').appendTo("body");- var d = { width: $c.css("width") - $c[0].clientWidth, height: $c.height() - $c[0].clientHeight };- $c.remove();- window.scrollbarWidth = d.width;- window.scrollbarHeight = d.height;- return dim.match(/^(width|height)$/) ? d[dim] : d;- }--- /**- * Returns hash container 'display' and 'visibility'- *- * @see $.swap() - swaps CSS, runs callback, resets CSS- * @param {!Object} $E jQuery element- * @param {boolean=} [force=false] Run even if display != none- * @return {!Object} Returns current style props, if applicable- */-, showInvisibly: function ($E, force) {- if ($E && $E.length && (force || $E.css("display") === "none")) { // only if not *already hidden*- var s = $E[0].style- // save ONLY the 'style' props because that is what we must restore- , CSS = { display: s.display || '', visibility: s.visibility || '' };- // show element 'invisibly' so can be measured- $E.css({ display: "block", visibility: "hidden" });- return CSS;- }- return {};- }-- /**- * Returns data for setting size of an element (container or a pane).- *- * @see _create(), onWindowResize() for container, plus others for pane- * @return JSON Returns a hash of all dimensions: top, bottom, left, right, outerWidth, innerHeight, etc- */-, getElementDimensions: function ($E, inset) {- var- // dimensions hash - start with current data IF passed- d = { css: {}, inset: {} }- , x = d.css // CSS hash- , i = { bottom: 0 } // TEMP insets (bottom = complier hack)- , N = $.layout.cssNum- , off = $E.offset()- , b, p, ei // TEMP border, padding- ;- d.offsetLeft = off.left;- d.offsetTop = off.top;-- if (!inset) inset = {}; // simplify logic below-- $.each("Left,Right,Top,Bottom".split(","), function (idx, e) { // e = edge- b = x["border" + e] = $.layout.borderWidth($E, e);- p = x["padding"+ e] = $.layout.cssNum($E, "padding"+e);- ei = e.toLowerCase();- d.inset[ei] = inset[ei] >= 0 ? inset[ei] : p; // any missing insetX value = paddingX- i[ei] = d.inset[ei] + b; // total offset of content from outer side- });-- x.width = $E.css("width");- x.height = $E.height();- x.top = N($E,"top",true);- x.bottom = N($E,"bottom",true);- x.left = N($E,"left",true);- x.right = N($E,"right",true);-- d.outerWidth = $E.outerWidth();- d.outerHeight = $E.outerHeight();- // calc the TRUE inner-dimensions, even in quirks-mode!- d.innerWidth = max(0, d.outerWidth - i.left - i.right);- d.innerHeight = max(0, d.outerHeight - i.top - i.bottom);- // layoutWidth/Height is used in calcs for manual resizing- // layoutW/H only differs from innerW/H when in quirks-mode - then is like outerW/H- d.layoutWidth = $E.innerWidth();- d.layoutHeight = $E.innerHeight();-- //if ($E.prop('tagName') === 'BODY') { debugData( d, $E.prop('tagName') ); } // DEBUG-- //d.visible = $E.is(":visible");// && x.width > 0 && x.height > 0;-- return d;- }--, getElementStyles: function ($E, list) {- var- CSS = {}- , style = $E[0].style- , props = list.split(",")- , sides = "Top,Bottom,Left,Right".split(",")- , attrs = "Color,Style,Width".split(",")- , p, s, a, i, j, k- ;- for (i=0; i < props.length; i++) {- p = props[i];- if (p.match(/(border|padding|margin)$/))- for (j=0; j < 4; j++) {- s = sides[j];- if (p === "border")- for (k=0; k < 3; k++) {- a = attrs[k];- CSS[p+s+a] = style[p+s+a];- }- else- CSS[p+s] = style[p+s];- }- else- CSS[p] = style[p];- };- return CSS- }-- /**- * Return the innerWidth for the current browser/doctype- *- * @see initPanes(), sizeMidPanes(), initHandles(), sizeHandles()- * @param {Array.<Object>} $E Must pass a jQuery object - first element is processed- * @param {number=} outerWidth (optional) Can pass a width, allowing calculations BEFORE element is resized- * @return {number} Returns the innerWidth of the elem by subtracting padding and borders- */-, cssWidth: function ($E, outerWidth) {- // a 'calculated' outerHeight can be passed so borders and/or padding are removed if needed- if (outerWidth <= 0) return 0;-- if (!$.layout.browser.boxModel) return outerWidth;-- // strip border and padding from outerWidth to get CSS Width- var b = $.layout.borderWidth- , n = $.layout.cssNum- , W = outerWidth- - b($E, "Left")- - b($E, "Right")- - n($E, "paddingLeft")- - n($E, "paddingRight");-- return max(0,W);- }-- /**- * Return the innerHeight for the current browser/doctype- *- * @see initPanes(), sizeMidPanes(), initHandles(), sizeHandles()- * @param {Array.<Object>} $E Must pass a jQuery object - first element is processed- * @param {number=} outerHeight (optional) Can pass a width, allowing calculations BEFORE element is resized- * @return {number} Returns the innerHeight of the elem by subtracting padding and borders- */-, cssHeight: function ($E, outerHeight) {- // a 'calculated' outerHeight can be passed so borders and/or padding are removed if needed- if (outerHeight <= 0) return 0;-- if (!$.layout.browser.boxModel) return outerHeight;-- // strip border and padding from outerHeight to get CSS Height- var b = $.layout.borderWidth- , n = $.layout.cssNum- , H = outerHeight- - b($E, "Top")- - b($E, "Bottom")- - n($E, "paddingTop")- - n($E, "paddingBottom");-- return max(0,H);- }-- /**- * Returns the 'current CSS numeric value' for a CSS property - 0 if property does not exist- *- * @see Called by many methods- * @param {Array.<Object>} $E Must pass a jQuery object - first element is processed- * @param {string} prop The name of the CSS property, eg: top, width, etc.- * @param {boolean=} [allowAuto=false] true = return 'auto' if that is value; false = return 0- * @return {(string|number)} Usually used to get an integer value for position (top, left) or size (height, width)- */-, cssNum: function ($E, prop, allowAuto) {- if (!$E.jquery) $E = $($E);- var CSS = $.layout.showInvisibly($E)- , p = $.css($E[0], prop, true)- , v = allowAuto && p=="auto" ? p : Math.round(parseFloat(p) || 0);- $E.css( CSS ); // RESET- return v;- }--, borderWidth: function (el, side) {- if (el.jquery) el = el[0];- var b = "border"+ side.substr(0,1).toUpperCase() + side.substr(1); // left => Left- return $.css(el, b+"Style", true) === "none" ? 0 : Math.round(parseFloat($.css(el, b+"Width", true)) || 0);- }-- /**- * Mouse-tracking utility - FUTURE REFERENCE- *- * init: if (!window.mouse) {- * window.mouse = { x: 0, y: 0 };- * $(document).mousemove( $.layout.trackMouse );- * }- *- * @param {Object} evt- *-, trackMouse: function (evt) {- window.mouse = { x: evt.clientX, y: evt.clientY };- }- */-- /**- * SUBROUTINE for preventPrematureSlideClose option- *- * @param {Object} evt- * @param {Object=} el- */-, isMouseOverElem: function (evt, el) {- var- $E = $(el || this)- , d = $E.offset()- , T = d.top- , L = d.left- , R = L + $E.outerWidth()- , B = T + $E.outerHeight()- , x = evt.pageX // evt.clientX ?- , y = evt.pageY // evt.clientY ?- ;- // if X & Y are < 0, probably means is over an open SELECT- return ($.layout.browser.msie && x < 0 && y < 0) || ((x >= L && x <= R) && (y >= T && y <= B));- }-- /**- * Message/Logging Utility- *- * @example $.layout.msg("My message"); // log text- * @example $.layout.msg("My message", true); // alert text- * @example $.layout.msg({ foo: "bar" }, "Title"); // log hash-data, with custom title- * @example $.layout.msg({ foo: "bar" }, true, "Title", { sort: false }); -OR-- * @example $.layout.msg({ foo: "bar" }, "Title", { sort: false, display: true }); // alert hash-data- *- * @param {(Object|string)} info String message OR Hash/Array- * @param {(Boolean|string|Object)=} [popup=false] True means alert-box - can be skipped- * @param {(Object|string)=} [debugTitle=""] Title for Hash data - can be skipped- * @param {Object=} [debugOpts] Extra options for debug output- */-, msg: function (info, popup, debugTitle, debugOpts) {- if ($.isPlainObject(info) && window.debugData) {- if (typeof popup === "string") {- debugOpts = debugTitle;- debugTitle = popup;- }- else if (typeof debugTitle === "object") {- debugOpts = debugTitle;- debugTitle = null;- }- var t = debugTitle || "log( <object> )"- , o = $.extend({ sort: false, returnHTML: false, display: false }, debugOpts);- if (popup === true || o.display)- debugData( info, t, o );- else if (window.console)- console.log(debugData( info, t, o ));- }- else if (popup)- alert(info);- else if (window.console)- console.log(info);- else {- var id = "#layoutLogger"- , $l = $(id);- if (!$l.length)- $l = createLog();- $l.children("ul").append('<li style="padding: 4px 10px; margin: 0; border-top: 1px solid #CCC;">'+ info.replace(/\</g,"<").replace(/\>/g,">") +'</li>');- }-- function createLog () {- var pos = $.support.fixedPosition ? 'fixed' : 'absolute'- , $e = $('<div id="layoutLogger" style="position: '+ pos +'; top: 5px; z-index: 999999; max-width: 25%; overflow: hidden; border: 1px solid #000; border-radius: 5px; background: #FBFBFB; box-shadow: 0 2px 10px rgba(0,0,0,0.3);">'- + '<div style="font-size: 13px; font-weight: bold; padding: 5px 10px; background: #F6F6F6; border-radius: 5px 5px 0 0; cursor: move;">'- + '<span style="float: right; padding-left: 7px; cursor: pointer;" title="Remove Console" onclick="$(this).closest(\'#layoutLogger\').remove()">X</span>Layout console.log</div>'- + '<ul style="font-size: 13px; font-weight: none; list-style: none; margin: 0; padding: 0 0 2px;"></ul>'- + '</div>'- ).appendTo("body");- $e.css('left', $(window).width() - $e.outerWidth() - 5)- if ($.ui.draggable) $e.draggable({ handle: ':first-child' });- return $e;- };- }--};--// DEFAULT OPTIONS-$.layout.defaults = {-/*- * LAYOUT & LAYOUT-CONTAINER OPTIONS- * - none of these options are applicable to individual panes- */- name: "" // Not required, but useful for buttons and used for the state-cookie-, containerClass: "ui-layout-container" // layout-container element-, inset: null // custom container-inset values (override padding)-, scrollToBookmarkOnLoad: true // after creating a layout, scroll to bookmark in URL (.../page.htm#myBookmark)-, resizeWithWindow: true // bind thisLayout.resizeAll() to the window.resize event-, resizeWithWindowDelay: 200 // delay calling resizeAll because makes window resizing very jerky-, resizeWithWindowMaxDelay: 0 // 0 = none - force resize every XX ms while window is being resized-, maskPanesEarly: false // true = create pane-masks on resizer.mouseDown instead of waiting for resizer.dragstart-, onresizeall_start: null // CALLBACK when resizeAll() STARTS - NOT pane-specific-, onresizeall_end: null // CALLBACK when resizeAll() ENDS - NOT pane-specific-, onload_start: null // CALLBACK when Layout inits - after options initialized, but before elements-, onload_end: null // CALLBACK when Layout inits - after EVERYTHING has been initialized-, onunload_start: null // CALLBACK when Layout is destroyed OR onWindowUnload-, onunload_end: null // CALLBACK when Layout is destroyed OR onWindowUnload-, initPanes: true // false = DO NOT initialize the panes onLoad - will init later-, showErrorMessages: true // enables fatal error messages to warn developers of common errors-, showDebugMessages: false // display console-and-alert debug msgs - IF this Layout version _has_ debugging code!-// Changing this zIndex value will cause other zIndex values to automatically change-, zIndex: null // the PANE zIndex - resizers and masks will be +1-// DO NOT CHANGE the zIndex values below unless you clearly understand their relationships-, zIndexes: { // set _default_ z-index values here...- pane_normal: 0 // normal z-index for panes- , content_mask: 1 // applied to overlays used to mask content INSIDE panes during resizing- , resizer_normal: 2 // normal z-index for resizer-bars- , pane_sliding: 100 // applied to *BOTH* the pane and its resizer when a pane is 'slid open'- , pane_animate: 1000 // applied to the pane when being animated - not applied to the resizer- , resizer_drag: 10000 // applied to the CLONED resizer-bar when being 'dragged'- }-, errors: {- pane: "pane" // description of "layout pane element" - used only in error messages- , selector: "selector" // description of "jQuery-selector" - used only in error messages- , addButtonError: "Error Adding Button \n\nInvalid "- , containerMissing: "UI Layout Initialization Error\n\nThe specified layout-container does not exist."- , centerPaneMissing: "UI Layout Initialization Error\n\nThe center-pane element does not exist.\n\nThe center-pane is a required element."- , noContainerHeight: "UI Layout Initialization Warning\n\nThe layout-container \"CONTAINER\" has no height.\n\nTherefore the layout is 0-height and hence 'invisible'!"- , callbackError: "UI Layout Callback Error\n\nThe EVENT callback is not a valid function."- }-/*- * PANE DEFAULT SETTINGS- * - settings under the 'panes' key become the default settings for *all panes*- * - ALL pane-options can also be set specifically for each panes, which will override these 'default values'- */-, panes: { // default options for 'all panes' - will be overridden by 'per-pane settings'- applyDemoStyles: false // NOTE: renamed from applyDefaultStyles for clarity- , closable: true // pane can open & close- , resizable: true // when open, pane can be resized- , slidable: true // when closed, pane can 'slide open' over other panes - closes on mouse-out- , initClosed: false // true = init pane as 'closed'- , initHidden: false // true = init pane as 'hidden' - no resizer-bar/spacing- // SELECTORS- //, paneSelector: "" // MUST be pane-specific - jQuery selector for pane- , contentSelector: ".ui-layout-content" // INNER div/element to auto-size so only it scrolls, not the entire pane!- , contentIgnoreSelector: ".ui-layout-ignore" // element(s) to 'ignore' when measuring 'content'- , findNestedContent: false // true = $P.find(contentSelector), false = $P.children(contentSelector)- // GENERIC ROOT-CLASSES - for auto-generated classNames- , paneClass: "ui-layout-pane" // Layout Pane- , resizerClass: "ui-layout-resizer" // Resizer Bar- , togglerClass: "ui-layout-toggler" // Toggler Button- , buttonClass: "ui-layout-button" // CUSTOM Buttons - eg: '[ui-layout-button]-toggle/-open/-close/-pin'- // ELEMENT SIZE & SPACING- //, size: 100 // MUST be pane-specific -initial size of pane- , minSize: 0 // when manually resizing a pane- , maxSize: 0 // ditto, 0 = no limit- , spacing_open: 6 // space between pane and adjacent panes - when pane is 'open'- , spacing_closed: 6 // ditto - when pane is 'closed'- , togglerLength_open: 50 // Length = WIDTH of toggler button on north/south sides - HEIGHT on east/west sides- , togglerLength_closed: 50 // 100% OR -1 means 'full height/width of resizer bar' - 0 means 'hidden'- , togglerAlign_open: "center" // top/left, bottom/right, center, OR...- , togglerAlign_closed: "center" // 1 => nn = offset from top/left, -1 => -nn == offset from bottom/right- , togglerContent_open: "" // text or HTML to put INSIDE the toggler- , togglerContent_closed: "" // ditto- // RESIZING OPTIONS- , resizerDblClickToggle: true //- , autoResize: true // IF size is 'auto' or a percentage, then recalc 'pixel size' whenever the layout resizes- , autoReopen: true // IF a pane was auto-closed due to noRoom, reopen it when there is room? False = leave it closed- , resizerDragOpacity: 1 // option for ui.draggable- //, resizerCursor: "" // MUST be pane-specific - cursor when over resizer-bar- , maskContents: false // true = add DIV-mask over-or-inside this pane so can 'drag' over IFRAMES- , maskObjects: false // true = add IFRAME-mask over-or-inside this pane to cover objects/applets - content-mask will overlay this mask- , maskZindex: null // will override zIndexes.content_mask if specified - not applicable to iframe-panes- , resizingGrid: false // grid size that the resizers will snap-to during resizing, eg: [20,20]- , livePaneResizing: false // true = LIVE Resizing as resizer is dragged- , liveContentResizing: false // true = re-measure header/footer heights as resizer is dragged- , liveResizingTolerance: 1 // how many px change before pane resizes, to control performance- // SLIDING OPTIONS- , sliderCursor: "pointer" // cursor when resizer-bar will trigger 'sliding'- , slideTrigger_open: "click" // click, dblclick, mouseenter- , slideTrigger_close: "mouseleave"// click, mouseleave- , slideDelay_open: 300 // applies only for mouseenter event - 0 = instant open- , slideDelay_close: 300 // applies only for mouseleave event (300ms is the minimum!)- , hideTogglerOnSlide: false // when pane is slid-open, should the toggler show?- , preventQuickSlideClose: $.layout.browser.webkit // Chrome triggers slideClosed as it is opening- , preventPrematureSlideClose: false // handle incorrect mouseleave trigger, like when over a SELECT-list in IE- // PANE-SPECIFIC TIPS & MESSAGES- , tips: {- Open: "Open" // eg: "Open Pane"- , Close: "Close"- , Resize: "Resize"- , Slide: "Slide Open"- , Pin: "Pin"- , Unpin: "Un-Pin"- , noRoomToOpen: "Not enough room to show this panel." // alert if user tries to open a pane that cannot- , minSizeWarning: "Panel has reached its minimum size" // displays in browser statusbar- , maxSizeWarning: "Panel has reached its maximum size" // ditto- }- // HOT-KEYS & MISC- , showOverflowOnHover: false // will bind allowOverflow() utility to pane.onMouseOver- , enableCursorHotkey: true // enabled 'cursor' hotkeys- //, customHotkey: "" // MUST be pane-specific - EITHER a charCode OR a character- , customHotkeyModifier: "SHIFT" // either 'SHIFT', 'CTRL' or 'CTRL+SHIFT' - NOT 'ALT'- // PANE ANIMATION- // NOTE: fxSss_open, fxSss_close & fxSss_size options (eg: fxName_open) are auto-generated if not passed- , fxName: "slide" // ('none' or blank), slide, drop, scale -- only relevant to 'open' & 'close', NOT 'size'- , fxSpeed: null // slow, normal, fast, 200, nnn - if passed, will OVERRIDE fxSettings.duration- , fxSettings: {} // can be passed, eg: { easing: "easeOutBounce", duration: 1500 }- , fxOpacityFix: true // tries to fix opacity in IE to restore anti-aliasing after animation- , animatePaneSizing: false // true = animate resizing after dragging resizer-bar OR sizePane() is called- /* NOTE: Action-specific FX options are auto-generated from the options above if not specifically set:- fxName_open: "slide" // 'Open' pane animation- fnName_close: "slide" // 'Close' pane animation- fxName_size: "slide" // 'Size' pane animation - when animatePaneSizing = true- fxSpeed_open: null- fxSpeed_close: null- fxSpeed_size: null- fxSettings_open: {}- fxSettings_close: {}- fxSettings_size: {}- */- // CHILD/NESTED LAYOUTS- , children: null // Layout-options for nested/child layout - even {} is valid as options- , containerSelector: '' // if child is NOT 'directly nested', a selector to find it/them (can have more than one child layout!)- , initChildren: true // true = child layout will be created as soon as _this_ layout completes initialization- , destroyChildren: true // true = destroy child-layout if this pane is destroyed- , resizeChildren: true // true = trigger child-layout.resizeAll() when this pane is resized- // EVENT TRIGGERING- , triggerEventsOnLoad: false // true = trigger onopen OR onclose callbacks when layout initializes- , triggerEventsDuringLiveResize: true // true = trigger onresize callback REPEATEDLY if livePaneResizing==true- // PANE CALLBACKS- , onshow_start: null // CALLBACK when pane STARTS to Show - BEFORE onopen/onhide_start- , onshow_end: null // CALLBACK when pane ENDS being Shown - AFTER onopen/onhide_end- , onhide_start: null // CALLBACK when pane STARTS to Close - BEFORE onclose_start- , onhide_end: null // CALLBACK when pane ENDS being Closed - AFTER onclose_end- , onopen_start: null // CALLBACK when pane STARTS to Open- , onopen_end: null // CALLBACK when pane ENDS being Opened- , onclose_start: null // CALLBACK when pane STARTS to Close- , onclose_end: null // CALLBACK when pane ENDS being Closed- , onresize_start: null // CALLBACK when pane STARTS being Resized ***FOR ANY REASON***- , onresize_end: null // CALLBACK when pane ENDS being Resized ***FOR ANY REASON***- , onsizecontent_start: null // CALLBACK when sizing of content-element STARTS- , onsizecontent_end: null // CALLBACK when sizing of content-element ENDS- , onswap_start: null // CALLBACK when pane STARTS to Swap- , onswap_end: null // CALLBACK when pane ENDS being Swapped- , ondrag_start: null // CALLBACK when pane STARTS being ***MANUALLY*** Resized- , ondrag_end: null // CALLBACK when pane ENDS being ***MANUALLY*** Resized- }-/*- * PANE-SPECIFIC SETTINGS- * - options listed below MUST be specified per-pane - they CANNOT be set under 'panes'- * - all options under the 'panes' key can also be set specifically for any pane- * - most options under the 'panes' key apply only to 'border-panes' - NOT the the center-pane- */-, north: {- paneSelector: ".ui-layout-north"- , size: "auto" // eg: "auto", "30%", .30, 200- , resizerCursor: "n-resize" // custom = url(myCursor.cur)- , customHotkey: "" // EITHER a charCode (43) OR a character ("o")- }-, south: {- paneSelector: ".ui-layout-south"- , size: "auto"- , resizerCursor: "s-resize"- , customHotkey: ""- }-, east: {- paneSelector: ".ui-layout-east"- , size: 200- , resizerCursor: "e-resize"- , customHotkey: ""- }-, west: {- paneSelector: ".ui-layout-west"- , size: 200- , resizerCursor: "w-resize"- , customHotkey: ""- }-, center: {- paneSelector: ".ui-layout-center"- , minWidth: 0- , minHeight: 0- }-};--$.layout.optionsMap = {- // layout/global options - NOT pane-options- layout: ("name,instanceKey,stateManagement,effects,inset,zIndexes,errors,"- + "zIndex,scrollToBookmarkOnLoad,showErrorMessages,maskPanesEarly,"- + "outset,resizeWithWindow,resizeWithWindowDelay,resizeWithWindowMaxDelay,"- + "onresizeall,onresizeall_start,onresizeall_end,onload,onunload").split(",")-// borderPanes: [ ALL options that are NOT specified as 'layout' ]- // default.panes options that apply to the center-pane (most options apply _only_ to border-panes)-, center: ("paneClass,contentSelector,contentIgnoreSelector,findNestedContent,applyDemoStyles,triggerEventsOnLoad,"- + "showOverflowOnHover,maskContents,maskObjects,liveContentResizing,"- + "containerSelector,children,initChildren,resizeChildren,destroyChildren,"- + "onresize,onresize_start,onresize_end,onsizecontent,onsizecontent_start,onsizecontent_end").split(",")- // options that MUST be specifically set 'per-pane' - CANNOT set in the panes (defaults) key-, noDefault: ("paneSelector,resizerCursor,customHotkey").split(",")-};--/**- * Processes options passed in converts flat-format data into subkey (JSON) format- * In flat-format, subkeys are _currently_ separated with 2 underscores, like north__optName- * Plugins may also call this method so they can transform their own data- *- * @param {!Object} hash Data/options passed by user - may be a single level or nested levels- * @param {boolean=} [addKeys=false] Should the primary layout.options keys be added if they do not exist?- * @return {Object} Returns hash of minWidth & minHeight- */-$.layout.transformData = function (hash, addKeys) {- var json = addKeys ? { panes: {}, center: {} } : {} // init return object- , branch, optKey, keys, key, val, i, c;-- if (typeof hash !== "object") return json; // no options passed-- // convert all 'flat-keys' to 'sub-key' format- for (optKey in hash) {- branch = json;- val = hash[ optKey ];- keys = optKey.split("__"); // eg: west__size or north__fxSettings__duration- c = keys.length - 1;- // convert underscore-delimited to subkeys- for (i=0; i <= c; i++) {- key = keys[i];- if (i === c) { // last key = value- if ($.isPlainObject( val ))- branch[key] = $.layout.transformData( val ); // RECURSE- else- branch[key] = val;- }- else {- if (!branch[key])- branch[key] = {}; // create the subkey- // recurse to sub-key for next loop - if not done- branch = branch[key];- }- }- }- return json;-};--// INTERNAL CONFIG DATA - DO NOT CHANGE THIS!-$.layout.backwardCompatibility = {- // data used by renameOldOptions()- map: {- // OLD Option Name: NEW Option Name- applyDefaultStyles: "applyDemoStyles"- // CHILD/NESTED LAYOUTS- , childOptions: "children"- , initChildLayout: "initChildren"- , destroyChildLayout: "destroyChildren"- , resizeChildLayout: "resizeChildren"- , resizeNestedLayout: "resizeChildren"- // MISC Options- , resizeWhileDragging: "livePaneResizing"- , resizeContentWhileDragging: "liveContentResizing"- , triggerEventsWhileDragging: "triggerEventsDuringLiveResize"- , maskIframesOnResize: "maskContents"- // STATE MANAGEMENT- , useStateCookie: "stateManagement.enabled"- , "cookie.autoLoad": "stateManagement.autoLoad"- , "cookie.autoSave": "stateManagement.autoSave"- , "cookie.keys": "stateManagement.stateKeys"- , "cookie.name": "stateManagement.cookie.name"- , "cookie.domain": "stateManagement.cookie.domain"- , "cookie.path": "stateManagement.cookie.path"- , "cookie.expires": "stateManagement.cookie.expires"- , "cookie.secure": "stateManagement.cookie.secure"- // OLD Language options- , noRoomToOpenTip: "tips.noRoomToOpen"- , togglerTip_open: "tips.Close" // open = Close- , togglerTip_closed: "tips.Open" // closed = Open- , resizerTip: "tips.Resize"- , sliderTip: "tips.Slide"- }--/**-* @param {Object} opts-*/-, renameOptions: function (opts) {- var map = $.layout.backwardCompatibility.map- , oldData, newData, value- ;- for (var itemPath in map) {- oldData = getBranch( itemPath );- value = oldData.branch[ oldData.key ];- if (value !== undefined) {- newData = getBranch( map[itemPath], true );- newData.branch[ newData.key ] = value;- delete oldData.branch[ oldData.key ];- }- }-- /**- * @param {string} path- * @param {boolean=} [create=false] Create path if does not exist- */- function getBranch (path, create) {- var a = path.split(".") // split keys into array- , c = a.length - 1- , D = { branch: opts, key: a[c] } // init branch at top & set key (last item)- , i = 0, k, undef;- for (; i<c; i++) { // skip the last key (data)- k = a[i];- if (D.branch[ k ] == undefined) { // child-key does not exist- if (create) {- D.branch = D.branch[ k ] = {}; // create child-branch- }- else // can't go any farther- D.branch = {}; // branch is undefined- }- else- D.branch = D.branch[ k ]; // get child-branch- }- return D;- };- }--/**-* @param {Object} opts-*/-, renameAllOptions: function (opts) {- var ren = $.layout.backwardCompatibility.renameOptions;- // rename root (layout) options- ren( opts );- // rename 'defaults' to 'panes'- if (opts.defaults) {- if (typeof opts.panes !== "object")- opts.panes = {};- $.extend(true, opts.panes, opts.defaults);- delete opts.defaults;- }- // rename options in the the options.panes key- if (opts.panes) ren( opts.panes );- // rename options inside *each pane key*, eg: options.west- $.each($.layout.config.allPanes, function (i, pane) {- if (opts[pane]) ren( opts[pane] );- });- return opts;- }-};-----/* ============================================================- * BEGIN WIDGET: $( selector ).layout( {options} );- * ============================================================- */-$.fn.layout = function (opts) {- var-- // local aliases to global data- browser = $.layout.browser-, _c = $.layout.config-- // local aliases to utlity methods-, cssW = $.layout.cssWidth-, cssH = $.layout.cssHeight-, elDims = $.layout.getElementDimensions-, styles = $.layout.getElementStyles-, evtObj = $.layout.getEventObject-, evtPane = $.layout.parsePaneName--/**- * options - populated by initOptions()- */-, options = $.extend(true, {}, $.layout.defaults)-, effects = options.effects = $.extend(true, {}, $.layout.effects)--/**- * layout-state object- */-, state = {- // generate unique ID to use for event.namespace so can unbind only events added by 'this layout'- id: "layout"+ $.now() // code uses alias: sID- , initialized: false- , paneResizing: false- , panesSliding: {}- , container: { // list all keys referenced in code to avoid compiler error msgs- innerWidth: 0- , innerHeight: 0- , outerWidth: 0- , outerHeight: 0- , layoutWidth: 0- , layoutHeight: 0- }- , north: { childIdx: 0 }- , south: { childIdx: 0 }- , east: { childIdx: 0 }- , west: { childIdx: 0 }- , center: { childIdx: 0 }- }--/**- * parent/child-layout pointers- */-//, hasParentLayout = false - exists ONLY inside Instance so can be set externally-, children = {- north: null- , south: null- , east: null- , west: null- , center: null- }--/*- * ###########################- * INTERNAL HELPER FUNCTIONS- * ###########################- */-- /**- * Manages all internal timers- */-, timer = {- data: {}- , set: function (s, fn, ms) { timer.clear(s); timer.data[s] = setTimeout(fn, ms); }- , clear: function (s) { var t=timer.data; if (t[s]) {clearTimeout(t[s]); delete t[s];} }- }-- /**- * Alert or console.log a message - IF option is enabled.- *- * @param {(string|!Object)} msg Message (or debug-data) to display- * @param {boolean=} [popup=false] True by default, means 'alert', false means use console.log- * @param {boolean=} [debug=false] True means is a widget debugging message- */-, _log = function (msg, popup, debug) {- var o = options;- if ((o.showErrorMessages && !debug) || (debug && o.showDebugMessages))- $.layout.msg( o.name +' / '+ msg, (popup !== false) );- return false;- }-- /**- * Executes a Callback function after a trigger event, like resize, open or close- *- * @param {string} evtName Name of the layout callback, eg "onresize_start"- * @param {(string|boolean)=} [pane=""] This is passed only so we can pass the 'pane object' to the callback- * @param {(string|boolean)=} [skipBoundEvents=false] True = do not run events bound to the elements - only the callbacks set in options- */-, _runCallbacks = function (evtName, pane, skipBoundEvents) {- var hasPane = pane && isStr(pane)- , s = hasPane ? state[pane] : state- , o = hasPane ? options[pane] : options- , lName = options.name- // names like onopen and onopen_end separate are interchangeable in options...- , lng = evtName + (evtName.match(/_/) ? "" : "_end")- , shrt = lng.match(/_end$/) ? lng.substr(0, lng.length - 4) : ""- , fn = o[lng] || o[shrt]- , retVal = "NC" // NC = No Callback- , args = []- , $P- ;- if ( !hasPane && $.type(pane) === 'boolean' ) {- skipBoundEvents = pane; // allow pane param to be skipped for Layout callback- pane = "";- }-- // first trigger the callback set in the options- if (fn) {- try {- // convert function name (string) to function object- if (isStr( fn )) {- if (fn.match(/,/)) {- // function name cannot contain a comma,- // so must be a function name AND a parameter to pass- args = fn.split(",")- , fn = eval(args[0]);- }- else // just the name of an external function?- fn = eval(fn);- }- // execute the callback, if exists- if ($.isFunction( fn )) {- if (args.length)- retVal = g(fn)(args[1]); // pass the argument parsed from 'list'- else if ( hasPane )- // pass data: pane-name, pane-element, pane-state, pane-options, and layout-name- retVal = g(fn)( pane, $Ps[pane], s, o, lName );- else // must be a layout/container callback - pass suitable info- retVal = g(fn)( Instance, s, o, lName );- }- }- catch (ex) {- _log( options.errors.callbackError.replace(/EVENT/, $.trim((pane || "") +" "+ lng)), false );- }- }-- // trigger additional events bound directly to the pane- if (!skipBoundEvents && retVal !== false) {- if ( hasPane ) { // PANE events can be bound to each pane-elements- $P = $Ps[pane];- o = options[pane];- s = state[pane];- $P.triggerHandler('layoutpane'+ lng, [ pane, $P, s, o, lName ]);- if (shrt)- $P.triggerHandler('layoutpane'+ shrt, [ pane, $P, s, o, lName ]);- }- else { // LAYOUT events can be bound to the container-element- $N.triggerHandler('layout'+ lng, [ Instance, s, o, lName ]);- if (shrt)- $N.triggerHandler('layout'+ shrt, [ Instance, s, o, lName ]);- }- }-- // ALWAYS resizeChildren after a resize event - even during initialization- if (hasPane && evtName === "onresize_end" || evtName === "onsizecontent_end")- resizeChildren(pane+"", true); // compiler hack -force string-- return retVal;-- function g (f) { return f; }; // compiler hack- }--- /**- * cure iframe display issues in IE & other browsers- */-, _fixIframe = function (pane) {- if (browser.mozilla) return; // skip FireFox - it auto-refreshes iframes onShow- var $P = $Ps[pane];- // if the 'pane' is an iframe, do it- if (state[pane].tagName === "IFRAME")- $P.css(_c.hidden).css(_c.visible);- else // ditto for any iframes INSIDE the pane- $P.find('IFRAME').css(_c.hidden).css(_c.visible);- }-- /**- * @param {string} pane Can accept ONLY a 'pane' (east, west, etc)- * @param {number=} outerSize (optional) Can pass a width, allowing calculations BEFORE element is resized- * @return {number} Returns the innerHeight/Width of el by subtracting padding and borders- */-, cssSize = function (pane, outerSize) {- var fn = _c[pane].dir=="horz" ? cssH : cssW;- return fn($Ps[pane], outerSize);- }-- /**- * @param {string} pane Can accept ONLY a 'pane' (east, west, etc)- * @return {Object} Returns hash of minWidth & minHeight- */-, cssMinDims = function (pane) {- // minWidth/Height means CSS width/height = 1px- var $P = $Ps[pane]- , dir = _c[pane].dir- , d = {- minWidth: 1001 - cssW($P, 1000)- , minHeight: 1001 - cssH($P, 1000)- }- ;- if (dir === "horz") d.minSize = d.minHeight;- if (dir === "vert") d.minSize = d.minWidth;- return d;- }-- // TODO: see if these methods can be made more useful...- // TODO: *maybe* return cssW/H from these so caller can use this info-- /**- * @param {(string|!Object)} el- * @param {number=} outerWidth- * @param {boolean=} [autoHide=false]- */-, setOuterWidth = function (el, outerWidth, autoHide) {- var $E = el, w;- if (isStr(el)) $E = $Ps[el]; // west- else if (!el.jquery) $E = $(el);- w = cssW($E, outerWidth);- $E.css({ width: w });- if (w > 0) {- if (autoHide && $E.data('autoHidden') && $E.innerHeight() > 0) {- $E.show().data('autoHidden', false);- if (!browser.mozilla) // FireFox refreshes iframes - IE does not- // make hidden, then visible to 'refresh' display after animation- $E.css(_c.hidden).css(_c.visible);- }- }- else if (autoHide && !$E.data('autoHidden'))- $E.hide().data('autoHidden', true);- }-- /**- * @param {(string|!Object)} el- * @param {number=} outerHeight- * @param {boolean=} [autoHide=false]- */-, setOuterHeight = function (el, outerHeight, autoHide) {- var $E = el, h;- if (isStr(el)) $E = $Ps[el]; // west- else if (!el.jquery) $E = $(el);- h = cssH($E, outerHeight);- $E.css({ height: h, visibility: "visible" }); // may have been 'hidden' by sizeContent- if (h > 0 && $E.innerWidth() > 0) {- if (autoHide && $E.data('autoHidden')) {- $E.show().data('autoHidden', false);- if (!browser.mozilla) // FireFox refreshes iframes - IE does not- $E.css(_c.hidden).css(_c.visible);- }- }- else if (autoHide && !$E.data('autoHidden'))- $E.hide().data('autoHidden', true);- }--- /**- * Converts any 'size' params to a pixel/integer size, if not already- * If 'auto' or a decimal/percentage is passed as 'size', a pixel-size is calculated- *- /**- * @param {string} pane- * @param {(string|number)=} size- * @param {string=} [dir]- * @return {number}- */-, _parseSize = function (pane, size, dir) {- if (!dir) dir = _c[pane].dir;-- if (isStr(size) && size.match(/%/))- size = (size === '100%') ? -1 : parseInt(size, 10) / 100; // convert % to decimal-- if (size === 0)- return 0;- else if (size >= 1)- return parseInt(size, 10);-- var o = options, avail = 0;- if (dir=="horz") // north or south or center.minHeight- avail = sC.innerHeight - ($Ps.north ? o.north.spacing_open : 0) - ($Ps.south ? o.south.spacing_open : 0);- else if (dir=="vert") // east or west or center.minWidth- avail = sC.innerWidth - ($Ps.west ? o.west.spacing_open : 0) - ($Ps.east ? o.east.spacing_open : 0);-- if (size === -1) // -1 == 100%- return avail;- else if (size > 0) // percentage, eg: .25- return round(avail * size);- else if (pane=="center")- return 0;- else { // size < 0 || size=='auto' || size==Missing || size==Invalid- // auto-size the pane- var dim = (dir === "horz" ? "height" : "width")- , $P = $Ps[pane]- , $C = dim === 'height' ? $Cs[pane] : false- , vis = $.layout.showInvisibly($P) // show pane invisibly if hidden- , szP = $P.css(dim) // SAVE current pane size- , szC = $C ? $C.css(dim) : 0 // SAVE current content size- ;- $P.css(dim, "auto");- if ($C) $C.css(dim, "auto");- size = (dim === "height") ? $P.outerHeight() : $P.outerWidth(); // MEASURE- $P.css(dim, szP).css(vis); // RESET size & visibility- if ($C) $C.css(dim, szC);- return size;- }- }-- /**- * Calculates current 'size' (outer-width or outer-height) of a border-pane - optionally with 'pane-spacing' added- *- * @param {(string|!Object)} pane- * @param {boolean=} [inclSpace=false]- * @return {number} Returns EITHER Width for east/west panes OR Height for north/south panes- */-, getPaneSize = function (pane, inclSpace) {- var- $P = $Ps[pane]- , o = options[pane]- , s = state[pane]- , oSp = (inclSpace ? o.spacing_open : 0)- , cSp = (inclSpace ? o.spacing_closed : 0)- ;- if (!$P || s.isHidden)- return 0;- else if (s.isClosed || (s.isSliding && inclSpace))- return cSp;- else if (_c[pane].dir === "horz")- return $P.outerHeight() + oSp;- else // dir === "vert"- return $P.outerWidth() + oSp;- }-- /**- * Calculate min/max pane dimensions and limits for resizing- *- * @param {string} pane- * @param {boolean=} [slide=false]- */-, setSizeLimits = function (pane, slide) {- if (!isInitialized()) return;- var- o = options[pane]- , s = state[pane]- , c = _c[pane]- , dir = c.dir- , type = c.sizeType.toLowerCase()- , isSliding = (slide != undefined ? slide : s.isSliding) // only open() passes 'slide' param- , $P = $Ps[pane]- , paneSpacing = o.spacing_open- // measure the pane on the *opposite side* from this pane- , altPane = _c.oppositeEdge[pane]- , altS = state[altPane]- , $altP = $Ps[altPane]- , altPaneSize = (!$altP || altS.isVisible===false || altS.isSliding ? 0 : (dir=="horz" ? $altP.outerHeight() : $altP.outerWidth()))- , altPaneSpacing = ((!$altP || altS.isHidden ? 0 : options[altPane][ altS.isClosed !== false ? "spacing_closed" : "spacing_open" ]) || 0)- // limitSize prevents this pane from 'overlapping' opposite pane- , containerSize = (dir=="horz" ? sC.innerHeight : sC.innerWidth)- , minCenterDims = cssMinDims("center")- , minCenterSize = dir=="horz" ? max(options.center.minHeight, minCenterDims.minHeight) : max(options.center.minWidth, minCenterDims.minWidth)- // if pane is 'sliding', then ignore center and alt-pane sizes - because 'overlays' them- , limitSize = (containerSize - paneSpacing - (isSliding ? 0 : (_parseSize("center", minCenterSize, dir) + altPaneSize + altPaneSpacing)))- , minSize = s.minSize = max( _parseSize(pane, o.minSize), cssMinDims(pane).minSize )- , maxSize = s.maxSize = min( (o.maxSize ? _parseSize(pane, o.maxSize) : 100000), limitSize )- , r = s.resizerPosition = {} // used to set resizing limits- , top = sC.inset.top- , left = sC.inset.left- , W = sC.innerWidth- , H = sC.innerHeight- , rW = o.spacing_open // subtract resizer-width to get top/left position for south/east- ;- switch (pane) {- case "north": r.min = top + minSize;- r.max = top + maxSize;- break;- case "west": r.min = left + minSize;- r.max = left + maxSize;- break;- case "south": r.min = top + H - maxSize - rW;- r.max = top + H - minSize - rW;- break;- case "east": r.min = left + W - maxSize - rW;- r.max = left + W - minSize - rW;- break;- };- }-- /**- * Returns data for setting the size/position of center pane. Also used to set Height for east/west panes- *- * @return JSON Returns a hash of all dimensions: top, bottom, left, right, (outer) width and (outer) height- */-, calcNewCenterPaneDims = function () {- var d = {- top: getPaneSize("north", true) // true = include 'spacing' value for pane- , bottom: getPaneSize("south", true)- , left: getPaneSize("west", true)- , right: getPaneSize("east", true)- , width: 0- , height: 0- };-- // NOTE: sC = state.container- // calc center-pane outer dimensions- d.width = sC.innerWidth - d.left - d.right; // outerWidth- d.height = sC.innerHeight - d.bottom - d.top; // outerHeight- // add the 'container border/padding' to get final positions relative to the container- d.top += sC.inset.top;- d.bottom += sC.inset.bottom;- d.left += sC.inset.left;- d.right += sC.inset.right;-- return d;- }--- /**- * @param {!Object} el- * @param {boolean=} [allStates=false]- */-, getHoverClasses = function (el, allStates) {- var- $El = $(el)- , type = $El.data("layoutRole")- , pane = $El.data("layoutEdge")- , o = options[pane]- , root = o[type +"Class"]- , _pane = "-"+ pane // eg: "-west"- , _open = "-open"- , _closed = "-closed"- , _slide = "-sliding"- , _hover = "-hover " // NOTE the trailing space- , _state = $El.hasClass(root+_closed) ? _closed : _open- , _alt = _state === _closed ? _open : _closed- , classes = (root+_hover) + (root+_pane+_hover) + (root+_state+_hover) + (root+_pane+_state+_hover)- ;- if (allStates) // when 'removing' classes, also remove alternate-state classes- classes += (root+_alt+_hover) + (root+_pane+_alt+_hover);-- if (type=="resizer" && $El.hasClass(root+_slide))- classes += (root+_slide+_hover) + (root+_pane+_slide+_hover);-- return $.trim(classes);- }-, addHover = function (evt, el) {- var $E = $(el || this);- if (evt && $E.data("layoutRole") === "toggler")- evt.stopPropagation(); // prevent triggering 'slide' on Resizer-bar- $E.addClass( getHoverClasses($E) );- }-, removeHover = function (evt, el) {- var $E = $(el || this);- $E.removeClass( getHoverClasses($E, true) );- }--, onResizerEnter = function (evt) { // ALSO called by toggler.mouseenter- var pane = $(this).data("layoutEdge")- , s = state[pane]- ;- // ignore closed-panes and mouse moving back & forth over resizer!- // also ignore if ANY pane is currently resizing- if ( s.isClosed || s.isResizing || state.paneResizing ) return;-- if ($.fn.disableSelection)- $("body").disableSelection();- if (options.maskPanesEarly)- showMasks( pane );- }-, onResizerLeave = function (evt, el) {- var e = el || this // el is only passed when called by the timer- , pane = $(e).data("layoutEdge")- , name = pane +"ResizerLeave"- ;- timer.clear(pane+"_openSlider"); // cancel slideOpen timer, if set- timer.clear(name); // cancel enableSelection timer - may re/set below- // this method calls itself on a timer because it needs to allow- // enough time for dragging to kick-in and set the isResizing flag- // dragging has a 100ms delay set, so this delay must be >100- if (!el) // 1st call - mouseleave event- timer.set(name, function(){ onResizerLeave(evt, e); }, 200);- // if user is resizing, then dragStop will enableSelection(), so can skip it here- else if ( !state.paneResizing ) { // 2nd call - by timer- if ($.fn.enableSelection)- $("body").enableSelection();- if (options.maskPanesEarly)- hideMasks();- }- }--/*- * ###########################- * INITIALIZATION METHODS- * ###########################- */-- /**- * Initialize the layout - called automatically whenever an instance of layout is created- *- * @see none - triggered onInit- * @return mixed true = fully initialized | false = panes not initialized (yet) | 'cancel' = abort- */-, _create = function () {- // initialize config/options- initOptions();- var o = options- , s = state;-- // TEMP state so isInitialized returns true during init process- s.creatingLayout = true;-- // init plugins for this layout, if there are any (eg: stateManagement)- runPluginCallbacks( Instance, $.layout.onCreate );-- // options & state have been initialized, so now run beforeLoad callback- // onload will CANCEL layout creation if it returns false- if (false === _runCallbacks("onload_start"))- return 'cancel';-- // initialize the container element- _initContainer();-- // bind hotkey function - keyDown - if required- initHotkeys();-- // bind window.onunload- $(window).bind("unload."+ sID, unload);-- // init plugins for this layout, if there are any (eg: customButtons)- runPluginCallbacks( Instance, $.layout.onLoad );-- // if layout elements are hidden, then layout WILL NOT complete initialization!- // initLayoutElements will set initialized=true and run the onload callback IF successful- if (o.initPanes) _initLayoutElements();-- delete s.creatingLayout;-- return state.initialized;- }-- /**- * Initialize the layout IF not already- *- * @see All methods in Instance run this test- * @return boolean true = layoutElements have been initialized | false = panes are not initialized (yet)- */-, isInitialized = function () {- if (state.initialized || state.creatingLayout) return true; // already initialized- else return _initLayoutElements(); // try to init panes NOW- }-- /**- * Initialize the layout - called automatically whenever an instance of layout is created- *- * @see _create() & isInitialized- * @param {boolean=} [retry=false] // indicates this is a 2nd try- * @return An object pointer to the instance created- */-, _initLayoutElements = function (retry) {- // initialize config/options- var o = options;- // CANNOT init panes inside a hidden container!- if (!$N.is(":visible")) {- // handle Chrome bug where popup window 'has no height'- // if layout is BODY element, try again in 50ms- // SEE: http://layout.jquery-dev.net/samples/test_popup_window.html- if ( !retry && browser.webkit && $N[0].tagName === "BODY" )- setTimeout(function(){ _initLayoutElements(true); }, 50);- return false;- }-- // a center pane is required, so make sure it exists- if (!getPane("center").length) {- return _log( o.errors.centerPaneMissing );- }-- // TEMP state so isInitialized returns true during init process- state.creatingLayout = true;-- // update Container dims- $.extend(sC, elDims( $N, o.inset )); // passing inset means DO NOT include insetX values-- // initialize all layout elements- initPanes(); // size & position panes - calls initHandles() - which calls initResizable()-- if (o.scrollToBookmarkOnLoad) {- var l = self.location;- if (l.hash) l.replace( l.hash ); // scrollTo Bookmark- }-- // check to see if this layout 'nested' inside a pane- if (Instance.hasParentLayout)- o.resizeWithWindow = false;- // bind resizeAll() for 'this layout instance' to window.resize event- else if (o.resizeWithWindow)- $(window).bind("resize."+ sID, windowResize);-- delete state.creatingLayout;- state.initialized = true;-- // init plugins for this layout, if there are any- runPluginCallbacks( Instance, $.layout.onReady );-- // now run the onload callback, if exists- _runCallbacks("onload_end");-- return true; // elements initialized successfully- }-- /**- * Initialize nested layouts for a specific pane - can optionally pass layout-options- *- * @param {(string|Object)} evt_or_pane The pane being opened, ie: north, south, east, or west- * @param {Object=} [opts] Layout-options - if passed, will OVERRRIDE options[pane].children- * @return An object pointer to the layout instance created - or null- */-, createChildren = function (evt_or_pane, opts) {- var pane = evtPane.call(this, evt_or_pane)- , $P = $Ps[pane]- ;- if (!$P) return;- var $C = $Cs[pane]- , s = state[pane]- , o = options[pane]- , sm = options.stateManagement || {}- , cos = opts ? (o.children = opts) : o.children- ;- if ( $.isPlainObject( cos ) )- cos = [ cos ]; // convert a hash to a 1-elem array- else if (!cos || !$.isArray( cos ))- return;-- $.each( cos, function (idx, co) {- if ( !$.isPlainObject( co ) ) return;-- // determine which element is supposed to be the 'child container'- // if pane has a 'containerSelector' OR a 'content-div', use those instead of the pane- var $containers = co.containerSelector ? $P.find( co.containerSelector ) : ($C || $P);-- $containers.each(function(){- var $cont = $(this)- , child = $cont.data("layout") // see if a child-layout ALREADY exists on this element- ;- // if no layout exists, but children are set, try to create the layout now- if (!child) {- // TODO: see about moving this to the stateManagement plugin, as a method- // set a unique child-instance key for this layout, if not already set- setInstanceKey({ container: $cont, options: co }, s );- // If THIS layout has a hash in stateManagement.autoLoad,- // then see if it also contains state-data for this child-layout- // If so, copy the stateData to child.options.stateManagement.autoLoad- if ( sm.includeChildren && state.stateData[pane] ) {- // THIS layout's state was cached when its state was loaded- var paneChildren = state.stateData[pane].children || {}- , childState = paneChildren[ co.instanceKey ]- , co_sm = co.stateManagement || (co.stateManagement = { autoLoad: true })- ;- // COPY the stateData into the autoLoad key- if ( co_sm.autoLoad === true && childState ) {- co_sm.autoSave = false; // disable autoSave because saving handled by parent-layout- co_sm.includeChildren = true; // cascade option - FOR NOW- co_sm.autoLoad = $.extend(true, {}, childState); // COPY the state-hash- }- }-- // create the layout- child = $cont.layout( co );-- // if successful, update data- if (child) {- // add the child and update all layout-pointers- // MAY have already been done by child-layout calling parent.refreshChildren()- refreshChildren( pane, child );- }- }- });- });- }--, setInstanceKey = function (child, parentPaneState) {- // create a named key for use in state and instance branches- var $c = child.container- , o = child.options- , sm = o.stateManagement- , key = o.instanceKey || $c.data("layoutInstanceKey")- ;- if (!key) key = (sm && sm.cookie ? sm.cookie.name : '') || o.name; // look for a name/key- if (!key) key = "layout"+ (++parentPaneState.childIdx); // if no name/key found, generate one- else key = key.replace(/[^\w-]/gi, '_').replace(/_{2,}/g, '_'); // ensure is valid as a hash key- o.instanceKey = key;- $c.data("layoutInstanceKey", key); // useful if layout is destroyed and then recreated- return key;- }-- /**- * @param {string} pane The pane being opened, ie: north, south, east, or west- * @param {Object=} newChild New child-layout Instance to add to this pane- */-, refreshChildren = function (pane, newChild) {- var $P = $Ps[pane]- , pC = children[pane]- , s = state[pane]- , o- ;- // check for destroy()ed layouts and update the child pointers & arrays- if ($.isPlainObject( pC )) {- $.each( pC, function (key, child) {- if (child.destroyed) delete pC[key]- });- // if no more children, remove the children hash- if ($.isEmptyObject( pC ))- pC = children[pane] = null; // clear children hash- }-- // see if there is a directly-nested layout inside this pane- // if there is, then there can be only ONE child-layout, so check that...- if (!newChild && !pC) {- newChild = $P.data("layout");- }-- // if a newChild instance was passed, add it to children[pane]- if (newChild) {- // update child.state- newChild.hasParentLayout = true; // set parent-flag in child- // instanceKey is a key-name used in both state and children- o = newChild.options;- // set a unique child-instance key for this layout, if not already set- setInstanceKey( newChild, s );- // add pointer to pane.children hash- if (!pC) pC = children[pane] = {}; // create an empty children hash- pC[ o.instanceKey ] = newChild.container.data("layout"); // add childLayout instance- }-- // ALWAYS refresh the pane.children alias, even if null- Instance[pane].children = children[pane];-- // if newChild was NOT passed - see if there is a child layout NOW- if (!newChild) {- createChildren(pane); // MAY create a child and re-call this method- }- }--, windowResize = function () {- var o = options- , delay = Number(o.resizeWithWindowDelay);- if (delay < 10) delay = 100; // MUST have a delay!- // resizing uses a delay-loop because the resize event fires repeatly - except in FF, but delay anyway- timer.clear("winResize"); // if already running- timer.set("winResize", function(){- timer.clear("winResize");- timer.clear("winResizeRepeater");- var dims = elDims( $N, o.inset );- // only trigger resizeAll() if container has changed size- if (dims.innerWidth !== sC.innerWidth || dims.innerHeight !== sC.innerHeight)- resizeAll();- }, delay);- // ALSO set fixed-delay timer, if not already running- if (!timer.data["winResizeRepeater"]) setWindowResizeRepeater();- }--, setWindowResizeRepeater = function () {- var delay = Number(options.resizeWithWindowMaxDelay);- if (delay > 0)- timer.set("winResizeRepeater", function(){ setWindowResizeRepeater(); resizeAll(); }, delay);- }--, unload = function () {- var o = options;-- _runCallbacks("onunload_start");-- // trigger plugin callabacks for this layout (eg: stateManagement)- runPluginCallbacks( Instance, $.layout.onUnload );-- _runCallbacks("onunload_end");- }-- /**- * Validate and initialize container CSS and events- *- * @see _create()- */-, _initContainer = function () {- var- N = $N[0]- , $H = $("html")- , tag = sC.tagName = N.tagName- , id = sC.id = N.id- , cls = sC.className = N.className- , o = options- , name = o.name- , props = "position,margin,padding,border"- , css = "layoutCSS"- , CSS = {}- , hid = "hidden" // used A LOT!- // see if this container is a 'pane' inside an outer-layout- , parent = $N.data("parentLayout") // parent-layout Instance- , pane = $N.data("layoutEdge") // pane-name in parent-layout- , isChild = parent && pane- , num = $.layout.cssNum- , $parent, n- ;- // sC = state.container- sC.selector = $N.selector.split(".slice")[0];- sC.ref = (o.name ? o.name +' layout / ' : '') + tag + (id ? "#"+id : cls ? '.['+cls+']' : ''); // used in messages- sC.isBody = (tag === "BODY");-- // try to find a parent-layout- if (!isChild && !sC.isBody) {- $parent = $N.closest("."+ $.layout.defaults.panes.paneClass);- parent = $parent.data("parentLayout");- pane = $parent.data("layoutEdge");- isChild = parent && pane;- }-- $N .data({- layout: Instance- , layoutContainer: sID // FLAG to indicate this is a layout-container - contains unique internal ID- })- .addClass(o.containerClass)- ;- var layoutMethods = {- destroy: ''- , initPanes: ''- , resizeAll: 'resizeAll'- , resize: 'resizeAll'- };- // loop hash and bind all methods - include layoutID namespacing- for (name in layoutMethods) {- $N.bind("layout"+ name.toLowerCase() +"."+ sID, Instance[ layoutMethods[name] || name ]);- }-- // if this container is another layout's 'pane', then set child/parent pointers- if (isChild) {- // update parent flag- Instance.hasParentLayout = true;- // set pointers to THIS child-layout (Instance) in parent-layout- parent.refreshChildren( pane, Instance );- }-- // SAVE original container CSS for use in destroy()- if (!$N.data(css)) {- // handle props like overflow different for BODY & HTML - has 'system default' values- if (sC.isBody) {- // SAVE <BODY> CSS- $N.data(css, $.extend( styles($N, props), {- height: $N.css("height")- , overflow: $N.css("overflow")- , overflowX: $N.css("overflowX")- , overflowY: $N.css("overflowY")- }));- // ALSO SAVE <HTML> CSS- $H.data(css, $.extend( styles($H, 'padding'), {- height: "auto" // FF would return a fixed px-size!- , overflow: $H.css("overflow")- , overflowX: $H.css("overflowX")- , overflowY: $H.css("overflowY")- }));- }- else // handle props normally for non-body elements- $N.data(css, styles($N, props+",top,bottom,left,right,width,height,overflow,overflowX,overflowY") );- }-- try {- // common container CSS- CSS = {- overflow: hid- , overflowX: hid- , overflowY: hid- };- $N.css( CSS );-- if (o.inset && !$.isPlainObject(o.inset)) {- // can specify a single number for equal outset all-around- n = parseInt(o.inset, 10) || 0- o.inset = {- top: n- , bottom: n- , left: n- , right: n- };- }-- // format html & body if this is a full page layout- if (sC.isBody) {- // if HTML has padding, use this as an outer-spacing around BODY- if (!o.outset) {- // use padding from parent-elem (HTML) as outset- o.outset = {- top: num($H, "paddingTop")- , bottom: num($H, "paddingBottom")- , left: num($H, "paddingLeft")- , right: num($H, "paddingRight")- };- }- else if (!$.isPlainObject(o.outset)) {- // can specify a single number for equal outset all-around- n = parseInt(o.outset, 10) || 0- o.outset = {- top: n- , bottom: n- , left: n- , right: n- };- }- // HTML- $H.css( CSS ).css({- height: "100%"- , border: "none" // no border or padding allowed when using height = 100%- , padding: 0 // ditto- , margin: 0- });- // BODY- if (browser.isIE6) {- // IE6 CANNOT use the trick of setting absolute positioning on all 4 sides - must have 'height'- $N.css({- width: "100%"- , height: "100%"- , border: "none" // no border or padding allowed when using height = 100%- , padding: 0 // ditto- , margin: 0- , position: "relative"- });- // convert body padding to an inset option - the border cannot be measured in IE6!- if (!o.inset) o.inset = elDims( $N ).inset;- }- else { // use absolute positioning for BODY to allow borders & padding without overflow- $N.css({- width: "auto"- , height: "auto"- , margin: 0- , position: "absolute" // allows for border and padding on BODY- });- // apply edge-positioning created above- $N.css( o.outset );- }- // set current layout-container dimensions- $.extend(sC, elDims( $N, o.inset )); // passing inset means DO NOT include insetX values- }- else {- // container MUST have 'position'- var p = $N.css("position");- if (!p || !p.match(/(fixed|absolute|relative)/))- $N.css("position","relative");-- // set current layout-container dimensions- if ( $N.is(":visible") ) {- $.extend(sC, elDims( $N, o.inset )); // passing inset means DO NOT change insetX (padding) values- if (sC.innerHeight < 1) // container has no 'height' - warn developer- _log( o.errors.noContainerHeight.replace(/CONTAINER/, sC.ref) );- }- }-- // if container has min-width/height, then enable scrollbar(s)- if ( num($N, "minWidth") ) $N.parent().css("overflowX","auto");- if ( num($N, "minHeight") ) $N.parent().css("overflowY","auto");-- } catch (ex) {}- }-- /**- * Bind layout hotkeys - if options enabled- *- * @see _create() and addPane()- * @param {string=} [panes=""] The edge(s) to process- */-, initHotkeys = function (panes) {- panes = panes ? panes.split(",") : _c.borderPanes;- // bind keyDown to capture hotkeys, if option enabled for ANY pane- $.each(panes, function (i, pane) {- var o = options[pane];- if (o.enableCursorHotkey || o.customHotkey) {- $(document).bind("keydown."+ sID, keyDown); // only need to bind this ONCE- return false; // BREAK - binding was done- }- });- }-- /**- * Build final OPTIONS data- *- * @see _create()- */-, initOptions = function () {- var data, d, pane, key, val, i, c, o;-- // reprocess user's layout-options to have correct options sub-key structure- opts = $.layout.transformData( opts, true ); // panes = default subkey-- // auto-rename old options for backward compatibility- opts = $.layout.backwardCompatibility.renameAllOptions( opts );-- // if user-options has 'panes' key (pane-defaults), clean it...- if (!$.isEmptyObject(opts.panes)) {- // REMOVE any pane-defaults that MUST be set per-pane- data = $.layout.optionsMap.noDefault;- for (i=0, c=data.length; i<c; i++) {- key = data[i];- delete opts.panes[key]; // OK if does not exist- }- // REMOVE any layout-options specified under opts.panes- data = $.layout.optionsMap.layout;- for (i=0, c=data.length; i<c; i++) {- key = data[i];- delete opts.panes[key]; // OK if does not exist- }- }-- // MOVE any NON-layout-options from opts-root to opts.panes- data = $.layout.optionsMap.layout;- var rootKeys = $.layout.config.optionRootKeys;- for (key in opts) {- val = opts[key];- if ($.inArray(key, rootKeys) < 0 && $.inArray(key, data) < 0) {- if (!opts.panes[key])- opts.panes[key] = $.isPlainObject(val) ? $.extend(true, {}, val) : val;- delete opts[key]- }- }-- // START by updating ALL options from opts- $.extend(true, options, opts);-- // CREATE final options (and config) for EACH pane- $.each(_c.allPanes, function (i, pane) {-- // apply 'pane-defaults' to CONFIG.[PANE]- _c[pane] = $.extend(true, {}, _c.panes, _c[pane]);-- d = options.panes;- o = options[pane];-- // center-pane uses SOME keys in defaults.panes branch- if (pane === 'center') {- // ONLY copy keys from opts.panes listed in: $.layout.optionsMap.center- data = $.layout.optionsMap.center; // list of 'center-pane keys'- for (i=0, c=data.length; i<c; i++) { // loop the list...- key = data[i];- // only need to use pane-default if pane-specific value not set- if (!opts.center[key] && (opts.panes[key] || !o[key]))- o[key] = d[key]; // pane-default- }- }- else {- // border-panes use ALL keys in defaults.panes branch- o = options[pane] = $.extend(true, {}, d, o); // re-apply pane-specific opts AFTER pane-defaults- createFxOptions( pane );- // ensure all border-pane-specific base-classes exist- if (!o.resizerClass) o.resizerClass = "ui-layout-resizer";- if (!o.togglerClass) o.togglerClass = "ui-layout-toggler";- }- // ensure we have base pane-class (ALL panes)- if (!o.paneClass) o.paneClass = "ui-layout-pane";- });-- // update options.zIndexes if a zIndex-option specified- var zo = opts.zIndex- , z = options.zIndexes;- if (zo > 0) {- z.pane_normal = zo;- z.content_mask = max(zo+1, z.content_mask); // MIN = +1- z.resizer_normal = max(zo+2, z.resizer_normal); // MIN = +2- }-- // DELETE 'panes' key now that we are done - values were copied to EACH pane- delete options.panes;--- function createFxOptions ( pane ) {- var o = options[pane]- , d = options.panes;- // ensure fxSettings key to avoid errors- if (!o.fxSettings) o.fxSettings = {};- if (!d.fxSettings) d.fxSettings = {};-- $.each(["_open","_close","_size"], function (i,n) {- var- sName = "fxName"+ n- , sSpeed = "fxSpeed"+ n- , sSettings = "fxSettings"+ n- // recalculate fxName according to specificity rules- , fxName = o[sName] =- o[sName] // options.west.fxName_open- || d[sName] // options.panes.fxName_open- || o.fxName // options.west.fxName- || d.fxName // options.panes.fxName- || "none" // MEANS $.layout.defaults.panes.fxName == "" || false || null || 0- ;- // validate fxName to ensure is valid effect - MUST have effect-config data in options.effects- if (fxName === "none" || !options.effects[fxName] || !$.effects || (!$.effects[fxName] && !$.effects.effect[fxName]))- fxName = o[sName] = "none"; // effect not loaded OR unrecognized fxName-- // set vars for effects subkeys to simplify logic- var fx = options.effects[fxName] || {} // effects.slide- , fx_all = fx.all || null // effects.slide.all- , fx_pane = fx[pane] || null // effects.slide.west- ;- // create fxSpeed[_open|_close|_size]- o[sSpeed] =- o[sSpeed] // options.west.fxSpeed_open- || d[sSpeed] // options.west.fxSpeed_open- || o.fxSpeed // options.west.fxSpeed- || d.fxSpeed // options.panes.fxSpeed- || null // DEFAULT - let fxSetting.duration control speed- ;- // create fxSettings[_open|_close|_size]- o[sSettings] = $.extend(- true- , {}- , fx_all // effects.slide.all- , fx_pane // effects.slide.west- , d.fxSettings // options.panes.fxSettings- , o.fxSettings // options.west.fxSettings- , d[sSettings] // options.panes.fxSettings_open- , o[sSettings] // options.west.fxSettings_open- );- });-- // DONE creating action-specific-settings for this pane,- // so DELETE generic options - are no longer meaningful- delete o.fxName;- delete o.fxSpeed;- delete o.fxSettings;- }- }-- /**- * Initialize module objects, styling, size and position for all panes- *- * @see _initElements()- * @param {string} pane The pane to process- */-, getPane = function (pane) {- var sel = options[pane].paneSelector- if (sel.substr(0,1)==="#") // ID selector- // NOTE: elements selected 'by ID' DO NOT have to be 'children'- return $N.find(sel).eq(0);- else { // class or other selector- var $P = $N.children(sel).eq(0);- // look for the pane nested inside a 'form' element- return $P.length ? $P : $N.children("form:first").children(sel).eq(0);- }- }-- /**- * @param {Object=} evt- */-, initPanes = function (evt) {- // stopPropagation if called by trigger("layoutinitpanes") - use evtPane utility- evtPane(evt);-- // NOTE: do north & south FIRST so we can measure their height - do center LAST- $.each(_c.allPanes, function (idx, pane) {- addPane( pane, true );- });-- // init the pane-handles NOW in case we have to hide or close the pane below- initHandles();-- // now that all panes have been initialized and initially-sized,- // make sure there is really enough space available for each pane- $.each(_c.borderPanes, function (i, pane) {- if ($Ps[pane] && state[pane].isVisible) { // pane is OPEN- setSizeLimits(pane);- makePaneFit(pane); // pane may be Closed, Hidden or Resized by makePaneFit()- }- });- // size center-pane AGAIN in case we 'closed' a border-pane in loop above- sizeMidPanes("center");-- // Chrome/Webkit sometimes fires callbacks BEFORE it completes resizing!- // Before RC30.3, there was a 10ms delay here, but that caused layout- // to load asynchrously, which is BAD, so try skipping delay for now-- // process pane contents and callbacks, and init/resize child-layout if exists- $.each(_c.allPanes, function (idx, pane) {- afterInitPane(pane);- });- }-- /**- * Add a pane to the layout - subroutine of initPanes()- *- * @see initPanes()- * @param {string} pane The pane to process- * @param {boolean=} [force=false] Size content after init- */-, addPane = function (pane, force) {- if (!force && !isInitialized()) return;- var- o = options[pane]- , s = state[pane]- , c = _c[pane]- , dir = c.dir- , fx = s.fx- , spacing = o.spacing_open || 0- , isCenter = (pane === "center")- , CSS = {}- , $P = $Ps[pane]- , size, minSize, maxSize, child- ;- // if pane-pointer already exists, remove the old one first- if ($P)- removePane( pane, false, true, false );- else- $Cs[pane] = false; // init-- $P = $Ps[pane] = getPane(pane);- if (!$P.length) {- $Ps[pane] = false; // logic- return;- }-- // SAVE original Pane CSS- if (!$P.data("layoutCSS")) {- var props = "position,top,left,bottom,right,width,height,overflow,zIndex,display,backgroundColor,padding,margin,border";- $P.data("layoutCSS", styles($P, props));- }-- // create alias for pane data in Instance - initHandles will add more- Instance[pane] = {- name: pane- , pane: $Ps[pane]- , content: $Cs[pane]- , options: options[pane]- , state: state[pane]- , children: children[pane]- };-- // add classes, attributes & events- $P .data({- parentLayout: Instance // pointer to Layout Instance- , layoutPane: Instance[pane] // NEW pointer to pane-alias-object- , layoutEdge: pane- , layoutRole: "pane"- })- .css(c.cssReq).css("zIndex", options.zIndexes.pane_normal)- .css(o.applyDemoStyles ? c.cssDemo : {}) // demo styles- .addClass( o.paneClass +" "+ o.paneClass+"-"+pane ) // default = "ui-layout-pane ui-layout-pane-west" - may be a dupe of 'paneSelector'- .bind("mouseenter."+ sID, addHover )- .bind("mouseleave."+ sID, removeHover )- ;- var paneMethods = {- hide: ''- , show: ''- , toggle: ''- , close: ''- , open: ''- , slideOpen: ''- , slideClose: ''- , slideToggle: ''- , size: 'sizePane'- , sizePane: 'sizePane'- , sizeContent: ''- , sizeHandles: ''- , enableClosable: ''- , disableClosable: ''- , enableSlideable: ''- , disableSlideable: ''- , enableResizable: ''- , disableResizable: ''- , swapPanes: 'swapPanes'- , swap: 'swapPanes'- , move: 'swapPanes'- , removePane: 'removePane'- , remove: 'removePane'- , createChildren: ''- , resizeChildren: ''- , resizeAll: 'resizeAll'- , resizeLayout: 'resizeAll'- }- , name;- // loop hash and bind all methods - include layoutID namespacing- for (name in paneMethods) {- $P.bind("layoutpane"+ name.toLowerCase() +"."+ sID, Instance[ paneMethods[name] || name ]);- }-- // see if this pane has a 'scrolling-content element'- initContent(pane, false); // false = do NOT sizeContent() - called later-- if (!isCenter) {- // call _parseSize AFTER applying pane classes & styles - but before making visible (if hidden)- // if o.size is auto or not valid, then MEASURE the pane and use that as its 'size'- size = s.size = _parseSize(pane, o.size);- minSize = _parseSize(pane,o.minSize) || 1;- maxSize = _parseSize(pane,o.maxSize) || 100000;- if (size > 0) size = max(min(size, maxSize), minSize);- s.autoResize = o.autoResize; // used with percentage sizes-- // state for border-panes- s.isClosed = false; // true = pane is closed- s.isSliding = false; // true = pane is currently open by 'sliding' over adjacent panes- s.isResizing= false; // true = pane is in process of being resized- s.isHidden = false; // true = pane is hidden - no spacing, resizer or toggler is visible!-- // array for 'pin buttons' whose classNames are auto-updated on pane-open/-close- if (!s.pins) s.pins = [];- }- // states common to ALL panes- s.tagName = $P[0].tagName;- s.edge = pane; // useful if pane is (or about to be) 'swapped' - easy find out where it is (or is going)- s.noRoom = false; // true = pane 'automatically' hidden due to insufficient room - will unhide automatically- s.isVisible = true; // false = pane is invisible - closed OR hidden - simplify logic-- // init pane positioning- setPanePosition( pane );-- // if pane is not visible,- if (dir === "horz") // north or south pane- CSS.height = cssH($P, size);- else if (dir === "vert") // east or west pane- CSS.width = cssW($P, size);- //else if (isCenter) {}-- $P.css(CSS); // apply size -- top, bottom & height will be set by sizeMidPanes- if (dir != "horz") sizeMidPanes(pane, true); // true = skipCallback-- // close or hide the pane if specified in settings- if (o.initClosed && o.closable && !o.initHidden)- close(pane, true, true); // true, true = force, noAnimation- else if (o.initHidden || o.initClosed)- hide(pane); // will be completely invisible - no resizer or spacing- else if (!s.noRoom)- // make the pane visible - in case was initially hidden- $P.css("display","block");- // ELSE setAsOpen() - called later by initHandles()-- // RESET visibility now - pane will appear IF display:block- $P.css("visibility","visible");-- // check option for auto-handling of pop-ups & drop-downs- if (o.showOverflowOnHover)- $P.hover( allowOverflow, resetOverflow );-- // if manually adding a pane AFTER layout initialization, then...- if (state.initialized) {- initHandles( pane );- initHotkeys( pane );- afterInitPane( pane );- }- }--, afterInitPane = function (pane) {- var $P = $Ps[pane]- , s = state[pane]- , o = options[pane]- ;- if (!$P) return;-- // see if there is a directly-nested layout inside this pane- if ($P.data("layout"))- refreshChildren( pane, $P.data("layout") );-- // process pane contents and callbacks, and init/resize child-layout if exists- if (s.isVisible) { // pane is OPEN- if (state.initialized) // this pane was added AFTER layout was created- resizeAll(); // will also sizeContent- else- sizeContent(pane);-- if (o.triggerEventsOnLoad)- _runCallbacks("onresize_end", pane);- else // automatic if onresize called, otherwise call it specifically- // resize child - IF inner-layout already exists (created before this layout)- resizeChildren(pane, true); // a previously existing childLayout- }-- // init childLayouts - even if pane is not visible- if (o.initChildren && o.children)- createChildren(pane);- }-- /**- * @param {string=} panes The pane(s) to process- */-, setPanePosition = function (panes) {- panes = panes ? panes.split(",") : _c.borderPanes;-- // create toggler DIVs for each pane, and set object pointers for them, eg: $R.north = north toggler DIV- $.each(panes, function (i, pane) {- var $P = $Ps[pane]- , $R = $Rs[pane]- , o = options[pane]- , s = state[pane]- , side = _c[pane].side- , CSS = {}- ;- if (!$P) return; // pane does not exist - skip-- // set css-position to account for container borders & padding- switch (pane) {- case "north": CSS.top = sC.inset.top;- CSS.left = sC.inset.left;- CSS.right = sC.inset.right;- break;- case "south": CSS.bottom = sC.inset.bottom;- CSS.left = sC.inset.left;- CSS.right = sC.inset.right;- break;- case "west": CSS.left = sC.inset.left; // top, bottom & height set by sizeMidPanes()- break;- case "east": CSS.right = sC.inset.right; // ditto- break;- case "center": // top, left, width & height set by sizeMidPanes()- }- // apply position- $P.css(CSS);-- // update resizer position- if ($R && s.isClosed)- $R.css(side, sC.inset[side]);- else if ($R && !s.isHidden)- $R.css(side, sC.inset[side] + getPaneSize(pane));- });- }-- /**- * Initialize module objects, styling, size and position for all resize bars and toggler buttons- *- * @see _create()- * @param {string=} [panes=""] The edge(s) to process- */-, initHandles = function (panes) {- panes = panes ? panes.split(",") : _c.borderPanes;-- // create toggler DIVs for each pane, and set object pointers for them, eg: $R.north = north toggler DIV- $.each(panes, function (i, pane) {- var $P = $Ps[pane];- $Rs[pane] = false; // INIT- $Ts[pane] = false;- if (!$P) return; // pane does not exist - skip-- var- o = options[pane]- , s = state[pane]- , c = _c[pane]- , paneId = o.paneSelector.substr(0,1) === "#" ? o.paneSelector.substr(1) : ""- , rClass = o.resizerClass- , tClass = o.togglerClass- , spacing = (s.isVisible ? o.spacing_open : o.spacing_closed)- , _pane = "-"+ pane // used for classNames- , _state = (s.isVisible ? "-open" : "-closed") // used for classNames- , I = Instance[pane]- // INIT RESIZER BAR- , $R = I.resizer = $Rs[pane] = $("<div></div>")- // INIT TOGGLER BUTTON- , $T = I.toggler = (o.closable ? $Ts[pane] = $("<div></div>") : false)- ;-- //if (s.isVisible && o.resizable) ... handled by initResizable- if (!s.isVisible && o.slidable)- $R.attr("title", o.tips.Slide).css("cursor", o.sliderCursor);-- $R // if paneSelector is an ID, then create a matching ID for the resizer, eg: "#paneLeft" => "paneLeft-resizer"- .attr("id", paneId ? paneId +"-resizer" : "" )- .data({- parentLayout: Instance- , layoutPane: Instance[pane] // NEW pointer to pane-alias-object- , layoutEdge: pane- , layoutRole: "resizer"- })- .css(_c.resizers.cssReq).css("zIndex", options.zIndexes.resizer_normal)- .css(o.applyDemoStyles ? _c.resizers.cssDemo : {}) // add demo styles- .addClass(rClass +" "+ rClass+_pane)- .hover(addHover, removeHover) // ALWAYS add hover-classes, even if resizing is not enabled - handle with CSS instead- .hover(onResizerEnter, onResizerLeave) // ALWAYS NEED resizer.mouseleave to balance toggler.mouseenter- .appendTo($N) // append DIV to container- ;- if (o.resizerDblClickToggle)- $R.bind("dblclick."+ sID, toggle );-- if ($T) {- $T // if paneSelector is an ID, then create a matching ID for the resizer, eg: "#paneLeft" => "#paneLeft-toggler"- .attr("id", paneId ? paneId +"-toggler" : "" )- .data({- parentLayout: Instance- , layoutPane: Instance[pane] // NEW pointer to pane-alias-object- , layoutEdge: pane- , layoutRole: "toggler"- })- .css(_c.togglers.cssReq) // add base/required styles- .css(o.applyDemoStyles ? _c.togglers.cssDemo : {}) // add demo styles- .addClass(tClass +" "+ tClass+_pane)- .hover(addHover, removeHover) // ALWAYS add hover-classes, even if toggling is not enabled - handle with CSS instead- .bind("mouseenter", onResizerEnter) // NEED toggler.mouseenter because mouseenter MAY NOT fire on resizer- .appendTo($R) // append SPAN to resizer DIV- ;- // ADD INNER-SPANS TO TOGGLER- if (o.togglerContent_open) // ui-layout-open- $("<span>"+ o.togglerContent_open +"</span>")- .data({- layoutEdge: pane- , layoutRole: "togglerContent"- })- .data("layoutRole", "togglerContent")- .data("layoutEdge", pane)- .addClass("content content-open")- .css("display","none")- .appendTo( $T )- //.hover( addHover, removeHover ) // use ui-layout-toggler-west-hover .content-open instead!- ;- if (o.togglerContent_closed) // ui-layout-closed- $("<span>"+ o.togglerContent_closed +"</span>")- .data({- layoutEdge: pane- , layoutRole: "togglerContent"- })- .addClass("content content-closed")- .css("display","none")- .appendTo( $T )- //.hover( addHover, removeHover ) // use ui-layout-toggler-west-hover .content-closed instead!- ;- // ADD TOGGLER.click/.hover- enableClosable(pane);- }-- // add Draggable events- initResizable(pane);-- // ADD CLASSNAMES & SLIDE-BINDINGS - eg: class="resizer resizer-west resizer-open"- if (s.isVisible)- setAsOpen(pane); // onOpen will be called, but NOT onResize- else {- setAsClosed(pane); // onClose will be called- bindStartSlidingEvents(pane, true); // will enable events IF option is set- }-- });-- // SET ALL HANDLE DIMENSIONS- sizeHandles();- }--- /**- * Initialize scrolling ui-layout-content div - if exists- *- * @see initPane() - or externally after an Ajax injection- * @param {string} pane The pane to process- * @param {boolean=} [resize=true] Size content after init- */-, initContent = function (pane, resize) {- if (!isInitialized()) return;- var- o = options[pane]- , sel = o.contentSelector- , I = Instance[pane]- , $P = $Ps[pane]- , $C- ;- if (sel) $C = I.content = $Cs[pane] = (o.findNestedContent)- ? $P.find(sel).eq(0) // match 1-element only- : $P.children(sel).eq(0)- ;- if ($C && $C.length) {- $C.data("layoutRole", "content");- // SAVE original Content CSS- if (!$C.data("layoutCSS"))- $C.data("layoutCSS", styles($C, "height"));- $C.css( _c.content.cssReq );- if (o.applyDemoStyles) {- $C.css( _c.content.cssDemo ); // add padding & overflow: auto to content-div- $P.css( _c.content.cssDemoPane ); // REMOVE padding/scrolling from pane- }- // ensure no vertical scrollbar on pane - will mess up measurements- if ($P.css("overflowX").match(/(scroll|auto)/)) {- $P.css("overflow", "hidden");- }- state[pane].content = {}; // init content state- if (resize !== false) sizeContent(pane);- // sizeContent() is called AFTER init of all elements- }- else- I.content = $Cs[pane] = false;- }--- /**- * Add resize-bars to all panes that specify it in options- * -dependancy: $.fn.resizable - will skip if not found- *- * @see _create()- * @param {string=} [panes=""] The edge(s) to process- */-, initResizable = function (panes) {- var draggingAvailable = $.layout.plugins.draggable- , side // set in start()- ;- panes = panes ? panes.split(",") : _c.borderPanes;-- $.each(panes, function (idx, pane) {- var o = options[pane];- if (!draggingAvailable || !$Ps[pane] || !o.resizable) {- o.resizable = false;- return true; // skip to next- }-- var s = state[pane]- , z = options.zIndexes- , c = _c[pane]- , side = c.dir=="horz" ? "top" : "left"- , $P = $Ps[pane]- , $R = $Rs[pane]- , base = o.resizerClass- , lastPos = 0 // used when live-resizing- , r, live // set in start because may change- // 'drag' classes are applied to the ORIGINAL resizer-bar while dragging is in process- , resizerClass = base+"-drag" // resizer-drag- , resizerPaneClass = base+"-"+pane+"-drag" // resizer-north-drag- // 'helper' class is applied to the CLONED resizer-bar while it is being dragged- , helperClass = base+"-dragging" // resizer-dragging- , helperPaneClass = base+"-"+pane+"-dragging" // resizer-north-dragging- , helperLimitClass = base+"-dragging-limit" // resizer-drag- , helperPaneLimitClass = base+"-"+pane+"-dragging-limit" // resizer-north-drag- , helperClassesSet = false // logic var- ;-- if (!s.isClosed)- $R.attr("title", o.tips.Resize)- .css("cursor", o.resizerCursor); // n-resize, s-resize, etc-- $R.draggable({- containment: $N[0] // limit resizing to layout container- , axis: (c.dir=="horz" ? "y" : "x") // limit resizing to horz or vert axis- , delay: 0- , distance: 1- , grid: o.resizingGrid- // basic format for helper - style it using class: .ui-draggable-dragging- , helper: "clone"- , opacity: o.resizerDragOpacity- , addClasses: false // avoid ui-state-disabled class when disabled- //, iframeFix: o.draggableIframeFix // TODO: consider using when bug is fixed- , zIndex: z.resizer_drag-- , start: function (e, ui) {- // REFRESH options & state pointers in case we used swapPanes- o = options[pane];- s = state[pane];- // re-read options- live = o.livePaneResizing;-- // ondrag_start callback - will CANCEL hide if returns false- // TODO: dragging CANNOT be cancelled like this, so see if there is a way?- if (false === _runCallbacks("ondrag_start", pane)) return false;-- s.isResizing = true; // prevent pane from closing while resizing- state.paneResizing = pane; // easy to see if ANY pane is resizing- timer.clear(pane+"_closeSlider"); // just in case already triggered-- // SET RESIZER LIMITS - used in drag()- setSizeLimits(pane); // update pane/resizer state- r = s.resizerPosition;- lastPos = ui.position[ side ]-- $R.addClass( resizerClass +" "+ resizerPaneClass ); // add drag classes- helperClassesSet = false; // reset logic var - see drag()-- // DISABLE TEXT SELECTION (probably already done by resizer.mouseOver)- $('body').disableSelection();-- // MASK PANES CONTAINING IFRAMES, APPLETS OR OTHER TROUBLESOME ELEMENTS- showMasks( pane );- }-- , drag: function (e, ui) {- if (!helperClassesSet) { // can only add classes after clone has been added to the DOM- //$(".ui-draggable-dragging")- ui.helper- .addClass( helperClass +" "+ helperPaneClass ) // add helper classes- .css({ right: "auto", bottom: "auto" }) // fix dir="rtl" issue- .children().css("visibility","hidden") // hide toggler inside dragged resizer-bar- ;- helperClassesSet = true;- // draggable bug!? RE-SET zIndex to prevent E/W resize-bar showing through N/S pane!- if (s.isSliding) $Ps[pane].css("zIndex", z.pane_sliding);- }- // CONTAIN RESIZER-BAR TO RESIZING LIMITS- var limit = 0;- if (ui.position[side] < r.min) {- ui.position[side] = r.min;- limit = -1;- }- else if (ui.position[side] > r.max) {- ui.position[side] = r.max;- limit = 1;- }- // ADD/REMOVE dragging-limit CLASS- if (limit) {- ui.helper.addClass( helperLimitClass +" "+ helperPaneLimitClass ); // at dragging-limit- window.defaultStatus = (limit>0 && pane.match(/(north|west)/)) || (limit<0 && pane.match(/(south|east)/)) ? o.tips.maxSizeWarning : o.tips.minSizeWarning;- }- else {- ui.helper.removeClass( helperLimitClass +" "+ helperPaneLimitClass ); // not at dragging-limit- window.defaultStatus = "";- }- // DYNAMICALLY RESIZE PANES IF OPTION ENABLED- // won't trigger unless resizer has actually moved!- if (live && Math.abs(ui.position[side] - lastPos) >= o.liveResizingTolerance) {- lastPos = ui.position[side];- resizePanes(e, ui, pane)- }- }-- , stop: function (e, ui) {- $('body').enableSelection(); // RE-ENABLE TEXT SELECTION- window.defaultStatus = ""; // clear 'resizing limit' message from statusbar- $R.removeClass( resizerClass +" "+ resizerPaneClass ); // remove drag classes from Resizer- s.isResizing = false;- state.paneResizing = false; // easy to see if ANY pane is resizing- resizePanes(e, ui, pane, true); // true = resizingDone- }-- });- });-- /**- * resizePanes- *- * Sub-routine called from stop() - and drag() if livePaneResizing- *- * @param {!Object} evt- * @param {!Object} ui- * @param {string} pane- * @param {boolean=} [resizingDone=false]- */- var resizePanes = function (evt, ui, pane, resizingDone) {- var dragPos = ui.position- , c = _c[pane]- , o = options[pane]- , s = state[pane]- , resizerPos- ;- switch (pane) {- case "north": resizerPos = dragPos.top; break;- case "west": resizerPos = dragPos.left; break;- case "south": resizerPos = sC.layoutHeight - dragPos.top - o.spacing_open; break;- case "east": resizerPos = sC.layoutWidth - dragPos.left - o.spacing_open; break;- };- // remove container margin from resizer position to get the pane size- var newSize = resizerPos - sC.inset[c.side];-- // Disable OR Resize Mask(s) created in drag.start- if (!resizingDone) {- // ensure we meet liveResizingTolerance criteria- if (Math.abs(newSize - s.size) < o.liveResizingTolerance)- return; // SKIP resize this time- // resize the pane- manualSizePane(pane, newSize, false, true); // true = noAnimation- sizeMasks(); // resize all visible masks- }- else { // resizingDone- // ondrag_end callback- if (false !== _runCallbacks("ondrag_end", pane))- manualSizePane(pane, newSize, false, true); // true = noAnimation- hideMasks(true); // true = force hiding all masks even if one is 'sliding'- if (s.isSliding) // RE-SHOW 'object-masks' so objects won't show through sliding pane- showMasks( pane );- }- };- }-- /**- * sizeMask- *- * Needed to overlay a DIV over an IFRAME-pane because mask CANNOT be *inside* the pane- * Called when mask created, and during livePaneResizing- */-, sizeMask = function () {- var $M = $(this)- , pane = $M.data("layoutMask") // eg: "west"- , s = state[pane]- ;- // only masks over an IFRAME-pane need manual resizing- if (s.tagName == "IFRAME" && s.isVisible) // no need to mask closed/hidden panes- $M.css({- top: s.offsetTop- , left: s.offsetLeft- , width: s.outerWidth- , height: s.outerHeight- });- /* ALT Method...- var $P = $Ps[pane];- $M.css( $P.position() ).css({ width: $P[0].offsetWidth, height: $P[0].offsetHeight });- */- }-, sizeMasks = function () {- $Ms.each( sizeMask ); // resize all 'visible' masks- }-- /**- * @param {string} pane The pane being resized, animated or isSliding- * @param {Object=} [args] (optional) Options: which masks to apply, and to which panes- */-, showMasks = function (pane, args) {- var c = _c[pane]- , panes = ["center"]- , z = options.zIndexes- , a = $.extend({ objectsOnly: false, forSliding: state[pane].isSliding }, args )- , o, s- ;- if (a.forSliding)- panes.push( _c.oppositeEdge[pane] ); // ADD the oppositeEdge-pane-- if (c.dir === "horz") {- panes.push("west");- panes.push("east");- }- $.each(panes, function(i,p){- s = state[p];- o = options[p];- if (s.isVisible && ( o.maskObjects || (!a.objectsOnly && o.maskContents) )) {- getMasks(p).each(function(){- sizeMask.call(this);- this.style.zIndex = s.isSliding ? z.pane_sliding+1 : z.pane_normal+1- this.style.display = "block";- });- }- });- }-- /**- * @param {boolean=} force Hide masks even if a pane is sliding- */-, hideMasks = function (force) {- // ensure no pane is resizing - could be a timing issue- if (force || !state.paneResizing) {- $Ms.hide(); // hide ALL masks- }- // if ANY pane is sliding, then DO NOT remove masks from panes with maskObjects enabled- else if (!force && !$.isEmptyObject( state.panesSliding )) {- var i = $Ms.length - 1- , p, $M;- for (; i >= 0; i--) {- $M = $Ms.eq(i);- p = $M.data("layoutMask");- if (!options[p].maskObjects) {- $M.hide();- }- }- }- }-- /**- * @param {string} pane- */-, getMasks = function (pane) {- var $Masks = $([])- , $M, i = 0, c = $Ms.length- ;- for (; i<c; i++) {- $M = $Ms.eq(i);- if ($M.data("layoutMask") === pane)- $Masks = $Masks.add( $M );- }- if ($Masks.length)- return $Masks;- else- return createMasks(pane);- }-- /**- * createMasks- *- * Generates both DIV (ALWAYS used) and IFRAME (optional) elements as masks- * An IFRAME mask is created *under* the DIV when maskObjects=true, because a DIV cannot mask an applet- *- * @param {string} pane- */-, createMasks = function (pane) {- var- $P = $Ps[pane]- , s = state[pane]- , o = options[pane]- , z = options.zIndexes- //, objMask = o.maskObjects && s.tagName != "IFRAME" // check for option- , $Masks = $([])- , isIframe, el, $M, css, i- ;- if (!o.maskContents && !o.maskObjects) return $Masks;- // if o.maskObjects=true, then loop TWICE to create BOTH kinds of mask, else only create a DIV- for (i=0; i < (o.maskObjects ? 2 : 1); i++) {- isIframe = o.maskObjects && i==0;- el = document.createElement( isIframe ? "iframe" : "div" );- $M = $(el).data("layoutMask", pane); // add data to relate mask to pane- el.className = "ui-layout-mask ui-layout-mask-"+ pane; // for user styling- css = el.style;- // styles common to both DIVs and IFRAMES- css.display = "block";- css.position = "absolute";- css.background = "#FFF";- if (isIframe) { // IFRAME-only props- el.frameborder = 0;- el.src = "about:blank";- //el.allowTransparency = true; - for IE, but breaks masking ability!- css.opacity = 0;- css.filter = "Alpha(Opacity='0')";- css.border = 0;- }- // if pane is an IFRAME, then must mask the pane itself- if (s.tagName == "IFRAME") {- // NOTE sizing done by a subroutine so can be called during live-resizing- css.zIndex = z.pane_normal+1; // 1-higher than pane- $N.append( el ); // append to LAYOUT CONTAINER- }- // otherwise put masks *inside the pane* to mask its contents- else {- $M.addClass("ui-layout-mask-inside-pane");- css.zIndex = o.maskZindex || z.content_mask; // usually 1, but customizable- css.top = 0;- css.left = 0;- css.width = "100%";- css.height = "100%";- $P.append( el ); // append INSIDE pane element- }- // add to return object- $Masks = $Masks.add( el );- // add Mask to cached array so can be resized & reused- $Ms = $Ms.add( el );- }- return $Masks;- }--- /**- * Destroy this layout and reset all elements- *- * @param {boolean=} [destroyChildren=false] Destory Child-Layouts first?- */-, destroy = function (evt_or_destroyChildren, destroyChildren) {- // UNBIND layout events and remove global object- $(window).unbind("."+ sID); // resize & unload- $(document).unbind("."+ sID); // keyDown (hotkeys)-- if (typeof evt_or_destroyChildren === "object")- // stopPropagation if called by trigger("layoutdestroy") - use evtPane utility- evtPane(evt_or_destroyChildren);- else // no event, so transfer 1st param to destroyChildren param- destroyChildren = evt_or_destroyChildren;-- // need to look for parent layout BEFORE we remove the container data, else skips a level- //var parentPane = Instance.hasParentLayout ? $.layout.getParentPaneInstance( $N ) : null;-- // reset layout-container- $N .clearQueue()- .removeData("layout")- .removeData("layoutContainer")- .removeClass(options.containerClass)- .unbind("."+ sID) // remove ALL Layout events- ;-- // remove all mask elements that have been created- $Ms.remove();-- // loop all panes to remove layout classes, attributes and bindings- $.each(_c.allPanes, function (i, pane) {- removePane( pane, false, true, destroyChildren ); // true = skipResize- });-- // do NOT reset container CSS if is a 'pane' (or 'content') in an outer-layout - ie, THIS layout is 'nested'- var css = "layoutCSS";- if ($N.data(css) && !$N.data("layoutRole")) // RESET CSS- $N.css( $N.data(css) ).removeData(css);-- // for full-page layouts, also reset the <HTML> CSS- if (sC.tagName === "BODY" && ($N = $("html")).data(css)) // RESET <HTML> CSS- $N.css( $N.data(css) ).removeData(css);-- // trigger plugins for this layout, if there are any- runPluginCallbacks( Instance, $.layout.onDestroy );-- // trigger state-management and onunload callback- unload();-- // clear the Instance of everything except for container & options (so could recreate)- // RE-CREATE: myLayout = myLayout.container.layout( myLayout.options );- for (var n in Instance)- if (!n.match(/^(container|options)$/)) delete Instance[ n ];- // add a 'destroyed' flag to make it easy to check- Instance.destroyed = true;-- // if this is a child layout, CLEAR the child-pointer in the parent- /* for now the pointer REMAINS, but with only container, options and destroyed keys- if (parentPane) {- var layout = parentPane.pane.data("parentLayout")- , key = layout.options.instanceKey || 'error';- // THIS SYNTAX MAY BE WRONG!- parentPane.children[key] = layout.children[ parentPane.name ].children[key] = null;- }- */-- return Instance; // for coding convenience- }-- /**- * Remove a pane from the layout - subroutine of destroy()- *- * @see destroy()- * @param {(string|Object)} evt_or_pane The pane to process- * @param {boolean=} [remove=false] Remove the DOM element?- * @param {boolean=} [skipResize=false] Skip calling resizeAll()?- * @param {boolean=} [destroyChild=true] Destroy Child-layouts? If not passed, obeys options setting- */-, removePane = function (evt_or_pane, remove, skipResize, destroyChild) {- if (!isInitialized()) return;- var pane = evtPane.call(this, evt_or_pane)- , $P = $Ps[pane]- , $C = $Cs[pane]- , $R = $Rs[pane]- , $T = $Ts[pane]- ;- // NOTE: elements can still exist even after remove()- // so check for missing data(), which is cleared by removed()- if ($P && $.isEmptyObject( $P.data() )) $P = false;- if ($C && $.isEmptyObject( $C.data() )) $C = false;- if ($R && $.isEmptyObject( $R.data() )) $R = false;- if ($T && $.isEmptyObject( $T.data() )) $T = false;-- if ($P) $P.stop(true, true);-- var o = options[pane]- , s = state[pane]- , d = "layout"- , css = "layoutCSS"- , pC = children[pane]- , hasChildren = $.isPlainObject( pC ) && !$.isEmptyObject( pC )- , destroy = destroyChild !== undefined ? destroyChild : o.destroyChildren- ;- // FIRST destroy the child-layout(s)- if (hasChildren && destroy) {- $.each( pC, function (key, child) {- if (!child.destroyed)- child.destroy(true);// tell child-layout to destroy ALL its child-layouts too- if (child.destroyed) // destroy was successful- delete pC[key];- });- // if no more children, remove the children hash- if ($.isEmptyObject( pC )) {- pC = children[pane] = null; // clear children hash- hasChildren = false;- }- }-- // Note: can't 'remove' a pane element with non-destroyed children- if ($P && remove && !hasChildren)- $P.remove(); // remove the pane-element and everything inside it- else if ($P && $P[0]) {- // create list of ALL pane-classes that need to be removed- var root = o.paneClass // default="ui-layout-pane"- , pRoot = root +"-"+ pane // eg: "ui-layout-pane-west"- , _open = "-open"- , _sliding= "-sliding"- , _closed = "-closed"- , classes = [ root, root+_open, root+_closed, root+_sliding, // generic classes- pRoot, pRoot+_open, pRoot+_closed, pRoot+_sliding ] // pane-specific classes- ;- $.merge(classes, getHoverClasses($P, true)); // ADD hover-classes- // remove all Layout classes from pane-element- $P .removeClass( classes.join(" ") ) // remove ALL pane-classes- .removeData("parentLayout")- .removeData("layoutPane")- .removeData("layoutRole")- .removeData("layoutEdge")- .removeData("autoHidden") // in case set- .unbind("."+ sID) // remove ALL Layout events- // TODO: remove these extra unbind commands when jQuery is fixed- //.unbind("mouseenter"+ sID)- //.unbind("mouseleave"+ sID)- ;- // do NOT reset CSS if this pane/content is STILL the container of a nested layout!- // the nested layout will reset its 'container' CSS when/if it is destroyed- if (hasChildren && $C) {- // a content-div may not have a specific width, so give it one to contain the Layout- $C.width( $C.width() );- $.each( pC, function (key, child) {- child.resizeAll(); // resize the Layout- });- }- else if ($C)- $C.css( $C.data(css) ).removeData(css).removeData("layoutRole");- // remove pane AFTER content in case there was a nested layout- if (!$P.data(d))- $P.css( $P.data(css) ).removeData(css);- }-- // REMOVE pane resizer and toggler elements- if ($T) $T.remove();- if ($R) $R.remove();-- // CLEAR all pointers and state data- Instance[pane] = $Ps[pane] = $Cs[pane] = $Rs[pane] = $Ts[pane] = false;- s = { removed: true };-- if (!skipResize)- resizeAll();- }---/*- * ###########################- * ACTION METHODS- * ###########################- */-- /**- * @param {string} pane- */-, _hidePane = function (pane) {- var $P = $Ps[pane]- , o = options[pane]- , s = $P[0].style- ;- if (o.useOffscreenClose) {- if (!$P.data(_c.offscreenReset))- $P.data(_c.offscreenReset, { left: s.left, right: s.right });- $P.css( _c.offscreenCSS );- }- else- $P.hide().removeData(_c.offscreenReset);- }-- /**- * @param {string} pane- */-, _showPane = function (pane) {- var $P = $Ps[pane]- , o = options[pane]- , off = _c.offscreenCSS- , old = $P.data(_c.offscreenReset)- , s = $P[0].style- ;- $P .show() // ALWAYS show, just in case- .removeData(_c.offscreenReset);- if (o.useOffscreenClose && old) {- if (s.left == off.left)- s.left = old.left;- if (s.right == off.right)- s.right = old.right;- }- }--- /**- * Completely 'hides' a pane, including its spacing - as if it does not exist- * The pane is not actually 'removed' from the source, so can use 'show' to un-hide it- *- * @param {(string|Object)} evt_or_pane The pane being hidden, ie: north, south, east, or west- * @param {boolean=} [noAnimation=false]- */-, hide = function (evt_or_pane, noAnimation) {- if (!isInitialized()) return;- var pane = evtPane.call(this, evt_or_pane)- , o = options[pane]- , s = state[pane]- , $P = $Ps[pane]- , $R = $Rs[pane]- ;- if (!$P || s.isHidden) return; // pane does not exist OR is already hidden-- // onhide_start callback - will CANCEL hide if returns false- if (state.initialized && false === _runCallbacks("onhide_start", pane)) return;-- s.isSliding = false; // just in case- delete state.panesSliding[pane];-- // now hide the elements- if ($R) $R.hide(); // hide resizer-bar- if (!state.initialized || s.isClosed) {- s.isClosed = true; // to trigger open-animation on show()- s.isHidden = true;- s.isVisible = false;- if (!state.initialized)- _hidePane(pane); // no animation when loading page- sizeMidPanes(_c[pane].dir === "horz" ? "" : "center");- if (state.initialized || o.triggerEventsOnLoad)- _runCallbacks("onhide_end", pane);- }- else {- s.isHiding = true; // used by onclose- close(pane, false, noAnimation); // adjust all panes to fit- }- }-- /**- * Show a hidden pane - show as 'closed' by default unless openPane = true- *- * @param {(string|Object)} evt_or_pane The pane being opened, ie: north, south, east, or west- * @param {boolean=} [openPane=false]- * @param {boolean=} [noAnimation=false]- * @param {boolean=} [noAlert=false]- */-, show = function (evt_or_pane, openPane, noAnimation, noAlert) {- if (!isInitialized()) return;- var pane = evtPane.call(this, evt_or_pane)- , o = options[pane]- , s = state[pane]- , $P = $Ps[pane]- , $R = $Rs[pane]- ;- if (!$P || !s.isHidden) return; // pane does not exist OR is not hidden-- // onshow_start callback - will CANCEL show if returns false- if (false === _runCallbacks("onshow_start", pane)) return;-- s.isShowing = true; // used by onopen/onclose- //s.isHidden = false; - will be set by open/close - if not cancelled- s.isSliding = false; // just in case- delete state.panesSliding[pane];-- // now show the elements- //if ($R) $R.show(); - will be shown by open/close- if (openPane === false)- close(pane, true); // true = force- else- open(pane, false, noAnimation, noAlert); // adjust all panes to fit- }--- /**- * Toggles a pane open/closed by calling either open or close- *- * @param {(string|Object)} evt_or_pane The pane being toggled, ie: north, south, east, or west- * @param {boolean=} [slide=false]- */-, toggle = function (evt_or_pane, slide) {- if (!isInitialized()) return;- var evt = evtObj(evt_or_pane)- , pane = evtPane.call(this, evt_or_pane)- , s = state[pane]- ;- if (evt) // called from to $R.dblclick OR triggerPaneEvent- evt.stopImmediatePropagation();- if (s.isHidden)- show(pane); // will call 'open' after unhiding it- else if (s.isClosed)- open(pane, !!slide);- else- close(pane);- }--- /**- * Utility method used during init or other auto-processes- *- * @param {string} pane The pane being closed- * @param {boolean=} [setHandles=false]- */-, _closePane = function (pane, setHandles) {- var- $P = $Ps[pane]- , s = state[pane]- ;- _hidePane(pane);- s.isClosed = true;- s.isVisible = false;- // UNUSED: if (setHandles) setAsClosed(pane, true); // true = force- }-- /**- * Close the specified pane (animation optional), and resize all other panes as needed- *- * @param {(string|Object)} evt_or_pane The pane being closed, ie: north, south, east, or west- * @param {boolean=} [force=false]- * @param {boolean=} [noAnimation=false]- * @param {boolean=} [skipCallback=false]- */-, close = function (evt_or_pane, force, noAnimation, skipCallback) {- var pane = evtPane.call(this, evt_or_pane);- // if pane has been initialized, but NOT the complete layout, close pane instantly- if (!state.initialized && $Ps[pane]) {- _closePane(pane); // INIT pane as closed- return;- }- if (!isInitialized()) return;-- var- $P = $Ps[pane]- , $R = $Rs[pane]- , $T = $Ts[pane]- , o = options[pane]- , s = state[pane]- , c = _c[pane]- , doFX, isShowing, isHiding, wasSliding;-- // QUEUE in case another action/animation is in progress- $N.queue(function( queueNext ){-- if ( !$P- || (!o.closable && !s.isShowing && !s.isHiding) // invalid request // (!o.resizable && !o.closable) ???- || (!force && s.isClosed && !s.isShowing) // already closed- ) return queueNext();-- // onclose_start callback - will CANCEL hide if returns false- // SKIP if just 'showing' a hidden pane as 'closed'- var abort = !s.isShowing && false === _runCallbacks("onclose_start", pane);-- // transfer logic vars to temp vars- isShowing = s.isShowing;- isHiding = s.isHiding;- wasSliding = s.isSliding;- // now clear the logic vars (REQUIRED before aborting)- delete s.isShowing;- delete s.isHiding;-- if (abort) return queueNext();-- doFX = !noAnimation && !s.isClosed && (o.fxName_close != "none");- s.isMoving = true;- s.isClosed = true;- s.isVisible = false;- // update isHidden BEFORE sizing panes- if (isHiding) s.isHidden = true;- else if (isShowing) s.isHidden = false;-- if (s.isSliding) // pane is being closed, so UNBIND trigger events- bindStopSlidingEvents(pane, false); // will set isSliding=false- else // resize panes adjacent to this one- sizeMidPanes(_c[pane].dir === "horz" ? "" : "center", false); // false = NOT skipCallback-- // if this pane has a resizer bar, move it NOW - before animation- setAsClosed(pane);-- // CLOSE THE PANE- if (doFX) { // animate the close- lockPaneForFX(pane, true); // need to set left/top so animation will work- $P.hide( o.fxName_close, o.fxSettings_close, o.fxSpeed_close, function () {- lockPaneForFX(pane, false); // undo- if (s.isClosed) close_2();- queueNext();- });- }- else { // hide the pane without animation- _hidePane(pane);- close_2();- queueNext();- };- });-- // SUBROUTINE- function close_2 () {- s.isMoving = false;- bindStartSlidingEvents(pane, true); // will enable if o.slidable = true-- // if opposite-pane was autoClosed, see if it can be autoOpened now- var altPane = _c.oppositeEdge[pane];- if (state[ altPane ].noRoom) {- setSizeLimits( altPane );- makePaneFit( altPane );- }-- if (!skipCallback && (state.initialized || o.triggerEventsOnLoad)) {- // onclose callback - UNLESS just 'showing' a hidden pane as 'closed'- if (!isShowing) _runCallbacks("onclose_end", pane);- // onhide OR onshow callback- if (isShowing) _runCallbacks("onshow_end", pane);- if (isHiding) _runCallbacks("onhide_end", pane);- }- }- }-- /**- * @param {string} pane The pane just closed, ie: north, south, east, or west- */-, setAsClosed = function (pane) {- var- $P = $Ps[pane]- , $R = $Rs[pane]- , $T = $Ts[pane]- , o = options[pane]- , s = state[pane]- , side = _c[pane].side- , rClass = o.resizerClass- , tClass = o.togglerClass- , _pane = "-"+ pane // used for classNames- , _open = "-open"- , _sliding= "-sliding"- , _closed = "-closed"- ;- $R- .css(side, sC.inset[side]) // move the resizer- .removeClass( rClass+_open +" "+ rClass+_pane+_open )- .removeClass( rClass+_sliding +" "+ rClass+_pane+_sliding )- .addClass( rClass+_closed +" "+ rClass+_pane+_closed )- ;- // DISABLE 'resizing' when closed - do this BEFORE bindStartSlidingEvents?- if (o.resizable && $.layout.plugins.draggable)- $R- .draggable("disable")- .removeClass("ui-state-disabled") // do NOT apply disabled styling - not suitable here- .css("cursor", "default")- .attr("title","")- ;-- // if pane has a toggler button, adjust that too- if ($T) {- $T- .removeClass( tClass+_open +" "+ tClass+_pane+_open )- .addClass( tClass+_closed +" "+ tClass+_pane+_closed )- .attr("title", o.tips.Open) // may be blank- ;- // toggler-content - if exists- $T.children(".content-open").hide();- $T.children(".content-closed").css("display","block");- }-- // sync any 'pin buttons'- syncPinBtns(pane, false);-- if (state.initialized) {- // resize 'length' and position togglers for adjacent panes- sizeHandles();- }- }-- /**- * Open the specified pane (animation optional), and resize all other panes as needed- *- * @param {(string|Object)} evt_or_pane The pane being opened, ie: north, south, east, or west- * @param {boolean=} [slide=false]- * @param {boolean=} [noAnimation=false]- * @param {boolean=} [noAlert=false]- */-, open = function (evt_or_pane, slide, noAnimation, noAlert) {- if (!isInitialized()) return;- var pane = evtPane.call(this, evt_or_pane)- , $P = $Ps[pane]- , $R = $Rs[pane]- , $T = $Ts[pane]- , o = options[pane]- , s = state[pane]- , c = _c[pane]- , doFX, isShowing- ;- // QUEUE in case another action/animation is in progress- $N.queue(function( queueNext ){-- if ( !$P- || (!o.resizable && !o.closable && !s.isShowing) // invalid request- || (s.isVisible && !s.isSliding) // already open- ) return queueNext();-- // pane can ALSO be unhidden by just calling show(), so handle this scenario- if (s.isHidden && !s.isShowing) {- queueNext(); // call before show() because it needs the queue free- show(pane, true);- return;- }-- if (s.autoResize && s.size != o.size) // resize pane to original size set in options- sizePane(pane, o.size, true, true, true); // true=skipCallback/noAnimation/forceResize- else- // make sure there is enough space available to open the pane- setSizeLimits(pane, slide);-- // onopen_start callback - will CANCEL open if returns false- var cbReturn = _runCallbacks("onopen_start", pane);-- if (cbReturn === "abort")- return queueNext();-- // update pane-state again in case options were changed in onopen_start- if (cbReturn !== "NC") // NC = "No Callback"- setSizeLimits(pane, slide);-- if (s.minSize > s.maxSize) { // INSUFFICIENT ROOM FOR PANE TO OPEN!- syncPinBtns(pane, false); // make sure pin-buttons are reset- if (!noAlert && o.tips.noRoomToOpen)- alert(o.tips.noRoomToOpen);- return queueNext(); // ABORT- }-- if (slide) // START Sliding - will set isSliding=true- bindStopSlidingEvents(pane, true); // BIND trigger events to close sliding-pane- else if (s.isSliding) // PIN PANE (stop sliding) - open pane 'normally' instead- bindStopSlidingEvents(pane, false); // UNBIND trigger events - will set isSliding=false- else if (o.slidable)- bindStartSlidingEvents(pane, false); // UNBIND trigger events-- s.noRoom = false; // will be reset by makePaneFit if 'noRoom'- makePaneFit(pane);-- // transfer logic var to temp var- isShowing = s.isShowing;- // now clear the logic var- delete s.isShowing;-- doFX = !noAnimation && s.isClosed && (o.fxName_open != "none");- s.isMoving = true;- s.isVisible = true;- s.isClosed = false;- // update isHidden BEFORE sizing panes - WHY??? Old?- if (isShowing) s.isHidden = false;-- if (doFX) { // ANIMATE- // mask adjacent panes with objects- lockPaneForFX(pane, true); // need to set left/top so animation will work- $P.show( o.fxName_open, o.fxSettings_open, o.fxSpeed_open, function() {- lockPaneForFX(pane, false); // undo- if (s.isVisible) open_2(); // continue- queueNext();- });- }- else { // no animation- _showPane(pane);// just show pane and...- open_2(); // continue- queueNext();- };- });-- // SUBROUTINE- function open_2 () {- s.isMoving = false;-- // cure iframe display issues- _fixIframe(pane);-- // NOTE: if isSliding, then other panes are NOT 'resized'- if (!s.isSliding) { // resize all panes adjacent to this one- sizeMidPanes(_c[pane].dir=="vert" ? "center" : "", false); // false = NOT skipCallback- }-- // set classes, position handles and execute callbacks...- setAsOpen(pane);- };-- }-- /**- * @param {string} pane The pane just opened, ie: north, south, east, or west- * @param {boolean=} [skipCallback=false]- */-, setAsOpen = function (pane, skipCallback) {- var- $P = $Ps[pane]- , $R = $Rs[pane]- , $T = $Ts[pane]- , o = options[pane]- , s = state[pane]- , side = _c[pane].side- , rClass = o.resizerClass- , tClass = o.togglerClass- , _pane = "-"+ pane // used for classNames- , _open = "-open"- , _closed = "-closed"- , _sliding= "-sliding"- ;- $R- .css(side, sC.inset[side] + getPaneSize(pane)) // move the resizer- .removeClass( rClass+_closed +" "+ rClass+_pane+_closed )- .addClass( rClass+_open +" "+ rClass+_pane+_open )- ;- if (s.isSliding)- $R.addClass( rClass+_sliding +" "+ rClass+_pane+_sliding )- else // in case 'was sliding'- $R.removeClass( rClass+_sliding +" "+ rClass+_pane+_sliding )-- removeHover( 0, $R ); // remove hover classes- if (o.resizable && $.layout.plugins.draggable)- $R .draggable("enable")- .css("cursor", o.resizerCursor)- .attr("title", o.tips.Resize);- else if (!s.isSliding)- $R.css("cursor", "default"); // n-resize, s-resize, etc-- // if pane also has a toggler button, adjust that too- if ($T) {- $T .removeClass( tClass+_closed +" "+ tClass+_pane+_closed )- .addClass( tClass+_open +" "+ tClass+_pane+_open )- .attr("title", o.tips.Close); // may be blank- removeHover( 0, $T ); // remove hover classes- // toggler-content - if exists- $T.children(".content-closed").hide();- $T.children(".content-open").css("display","block");- }-- // sync any 'pin buttons'- syncPinBtns(pane, !s.isSliding);-- // update pane-state dimensions - BEFORE resizing content- $.extend(s, elDims($P));-- if (state.initialized) {- // resize resizer & toggler sizes for all panes- sizeHandles();- // resize content every time pane opens - to be sure- sizeContent(pane, true); // true = remeasure headers/footers, even if 'pane.isMoving'- }-- if (!skipCallback && (state.initialized || o.triggerEventsOnLoad) && $P.is(":visible")) {- // onopen callback- _runCallbacks("onopen_end", pane);- // onshow callback - TODO: should this be here?- if (s.isShowing) _runCallbacks("onshow_end", pane);-- // ALSO call onresize because layout-size *may* have changed while pane was closed- if (state.initialized)- _runCallbacks("onresize_end", pane);- }-- // TODO: Somehow sizePane("north") is being called after this point???- }--- /**- * slideOpen / slideClose / slideToggle- *- * Pass-though methods for sliding- */-, slideOpen = function (evt_or_pane) {- if (!isInitialized()) return;- var evt = evtObj(evt_or_pane)- , pane = evtPane.call(this, evt_or_pane)- , s = state[pane]- , delay = options[pane].slideDelay_open- ;- // prevent event from triggering on NEW resizer binding created below- if (evt) evt.stopImmediatePropagation();-- if (s.isClosed && evt && evt.type === "mouseenter" && delay > 0)- // trigger = mouseenter - use a delay- timer.set(pane+"_openSlider", open_NOW, delay);- else- open_NOW(); // will unbind events if is already open-- /**- * SUBROUTINE for timed open- */- function open_NOW () {- if (!s.isClosed) // skip if no longer closed!- bindStopSlidingEvents(pane, true); // BIND trigger events to close sliding-pane- else if (!s.isMoving)- open(pane, true); // true = slide - open() will handle binding- };- }--, slideClose = function (evt_or_pane) {- if (!isInitialized()) return;- var evt = evtObj(evt_or_pane)- , pane = evtPane.call(this, evt_or_pane)- , o = options[pane]- , s = state[pane]- , delay = s.isMoving ? 1000 : 300 // MINIMUM delay - option may override- ;- if (s.isClosed || s.isResizing)- return; // skip if already closed OR in process of resizing- else if (o.slideTrigger_close === "click")- close_NOW(); // close immediately onClick- else if (o.preventQuickSlideClose && s.isMoving)- return; // handle Chrome quick-close on slide-open- else if (o.preventPrematureSlideClose && evt && $.layout.isMouseOverElem(evt, $Ps[pane]))- return; // handle incorrect mouseleave trigger, like when over a SELECT-list in IE- else if (evt) // trigger = mouseleave - use a delay- // 1 sec delay if 'opening', else .3 sec- timer.set(pane+"_closeSlider", close_NOW, max(o.slideDelay_close, delay));- else // called programically- close_NOW();-- /**- * SUBROUTINE for timed close- */- function close_NOW () {- if (s.isClosed) // skip 'close' if already closed!- bindStopSlidingEvents(pane, false); // UNBIND trigger events - TODO: is this needed here?- else if (!s.isMoving)- close(pane); // close will handle unbinding- };- }-- /**- * @param {(string|Object)} evt_or_pane The pane being opened, ie: north, south, east, or west- */-, slideToggle = function (evt_or_pane) {- var pane = evtPane.call(this, evt_or_pane);- toggle(pane, true);- }--- /**- * Must set left/top on East/South panes so animation will work properly- *- * @param {string} pane The pane to lock, 'east' or 'south' - any other is ignored!- * @param {boolean} doLock true = set left/top, false = remove- */-, lockPaneForFX = function (pane, doLock) {- var $P = $Ps[pane]- , s = state[pane]- , o = options[pane]- , z = options.zIndexes- ;- if (doLock) {- showMasks( pane, { objectsOnly: true });- $P.css({ zIndex: z.pane_animate }); // overlay all elements during animation- if (pane=="south")- $P.css({ top: sC.inset.top + sC.innerHeight - $P.outerHeight() });- else if (pane=="east")- $P.css({ left: sC.inset.left + sC.innerWidth - $P.outerWidth() });- }- else { // animation DONE - RESET CSS- hideMasks();- $P.css({ zIndex: (s.isSliding ? z.pane_sliding : z.pane_normal) });- if (pane=="south")- $P.css({ top: "auto" });- // if pane is positioned 'off-screen', then DO NOT screw with it!- else if (pane=="east" && !$P.css("left").match(/\-99999/))- $P.css({ left: "auto" });- // fix anti-aliasing in IE - only needed for animations that change opacity- if (browser.msie && o.fxOpacityFix && o.fxName_open != "slide" && $P.css("filter") && $P.css("opacity") == 1)- $P[0].style.removeAttribute('filter');- }- }--- /**- * Toggle sliding functionality of a specific pane on/off by adding removing 'slide open' trigger- *- * @see open(), close()- * @param {string} pane The pane to enable/disable, 'north', 'south', etc.- * @param {boolean} enable Enable or Disable sliding?- */-, bindStartSlidingEvents = function (pane, enable) {- var o = options[pane]- , $P = $Ps[pane]- , $R = $Rs[pane]- , evtName = o.slideTrigger_open.toLowerCase()- ;- if (!$R || (enable && !o.slidable)) return;-- // make sure we have a valid event- if (evtName.match(/mouseover/))- evtName = o.slideTrigger_open = "mouseenter";- else if (!evtName.match(/(click|dblclick|mouseenter)/))- evtName = o.slideTrigger_open = "click";-- // must remove double-click-toggle when using dblclick-slide- if (o.resizerDblClickToggle && evtName.match(/click/)) {- $R[enable ? "unbind" : "bind"]('dblclick.'+ sID, toggle)- }-- $R- // add or remove event- [enable ? "bind" : "unbind"](evtName +'.'+ sID, slideOpen)- // set the appropriate cursor & title/tip- .css("cursor", enable ? o.sliderCursor : "default")- .attr("title", enable ? o.tips.Slide : "")- ;- }-- /**- * Add or remove 'mouseleave' events to 'slide close' when pane is 'sliding' open or closed- * Also increases zIndex when pane is sliding open- * See bindStartSlidingEvents for code to control 'slide open'- *- * @see slideOpen(), slideClose()- * @param {string} pane The pane to process, 'north', 'south', etc.- * @param {boolean} enable Enable or Disable events?- */-, bindStopSlidingEvents = function (pane, enable) {- var o = options[pane]- , s = state[pane]- , c = _c[pane]- , z = options.zIndexes- , evtName = o.slideTrigger_close.toLowerCase()- , action = (enable ? "bind" : "unbind")- , $P = $Ps[pane]- , $R = $Rs[pane]- ;- timer.clear(pane+"_closeSlider"); // just in case-- if (enable) {- s.isSliding = true;- state.panesSliding[pane] = true;- // remove 'slideOpen' event from resizer- // ALSO will raise the zIndex of the pane & resizer- bindStartSlidingEvents(pane, false);- }- else {- s.isSliding = false;- delete state.panesSliding[pane];- }-- // RE/SET zIndex - increases when pane is sliding-open, resets to normal when not- $P.css("zIndex", enable ? z.pane_sliding : z.pane_normal);- $R.css("zIndex", enable ? z.pane_sliding+2 : z.resizer_normal); // NOTE: mask = pane_sliding+1-- // make sure we have a valid event- if (!evtName.match(/(click|mouseleave)/))- evtName = o.slideTrigger_close = "mouseleave"; // also catches 'mouseout'-- // add/remove slide triggers- $R[action](evtName, slideClose); // base event on resize- // need extra events for mouseleave- if (evtName === "mouseleave") {- // also close on pane.mouseleave- $P[action]("mouseleave."+ sID, slideClose);- // cancel timer when mouse moves between 'pane' and 'resizer'- $R[action]("mouseenter."+ sID, cancelMouseOut);- $P[action]("mouseenter."+ sID, cancelMouseOut);- }-- if (!enable)- timer.clear(pane+"_closeSlider");- else if (evtName === "click" && !o.resizable) {- // IF pane is not resizable (which already has a cursor and tip)- // then set the a cursor & title/tip on resizer when sliding- $R.css("cursor", enable ? o.sliderCursor : "default");- $R.attr("title", enable ? o.tips.Close : ""); // use Toggler-tip, eg: "Close Pane"- }-- // SUBROUTINE for mouseleave timer clearing- function cancelMouseOut (evt) {- timer.clear(pane+"_closeSlider");- evt.stopPropagation();- }- }--- /**- * Hides/closes a pane if there is insufficient room - reverses this when there is room again- * MUST have already called setSizeLimits() before calling this method- *- * @param {string} pane The pane being resized- * @param {boolean=} [isOpening=false] Called from onOpen?- * @param {boolean=} [skipCallback=false] Should the onresize callback be run?- * @param {boolean=} [force=false]- */-, makePaneFit = function (pane, isOpening, skipCallback, force) {- var- o = options[pane]- , s = state[pane]- , c = _c[pane]- , $P = $Ps[pane]- , $R = $Rs[pane]- , isSidePane = c.dir==="vert"- , hasRoom = false- ;- // special handling for center & east/west panes- if (pane === "center" || (isSidePane && s.noVerticalRoom)) {- // see if there is enough room to display the pane- // ERROR: hasRoom = s.minHeight <= s.maxHeight && (isSidePane || s.minWidth <= s.maxWidth);- hasRoom = (s.maxHeight >= 0);- if (hasRoom && s.noRoom) { // previously hidden due to noRoom, so show now- _showPane(pane);- if ($R) $R.show();- s.isVisible = true;- s.noRoom = false;- if (isSidePane) s.noVerticalRoom = false;- _fixIframe(pane);- }- else if (!hasRoom && !s.noRoom) { // not currently hidden, so hide now- _hidePane(pane);- if ($R) $R.hide();- s.isVisible = false;- s.noRoom = true;- }- }-- // see if there is enough room to fit the border-pane- if (pane === "center") {- // ignore center in this block- }- else if (s.minSize <= s.maxSize) { // pane CAN fit- hasRoom = true;- if (s.size > s.maxSize) // pane is too big - shrink it- sizePane(pane, s.maxSize, skipCallback, true, force); // true = noAnimation- else if (s.size < s.minSize) // pane is too small - enlarge it- sizePane(pane, s.minSize, skipCallback, true, force); // true = noAnimation- // need s.isVisible because new pseudoClose method keeps pane visible, but off-screen- else if ($R && s.isVisible && $P.is(":visible")) {- // make sure resizer-bar is positioned correctly- // handles situation where nested layout was 'hidden' when initialized- var pos = s.size + sC.inset[c.side];- if ($.layout.cssNum( $R, c.side ) != pos) $R.css( c.side, pos );- }-- // if was previously hidden due to noRoom, then RESET because NOW there is room- if (s.noRoom) {- // s.noRoom state will be set by open or show- if (s.wasOpen && o.closable) {- if (o.autoReopen)- open(pane, false, true, true); // true = noAnimation, true = noAlert- else // leave the pane closed, so just update state- s.noRoom = false;- }- else- show(pane, s.wasOpen, true, true); // true = noAnimation, true = noAlert- }- }- else { // !hasRoom - pane CANNOT fit- if (!s.noRoom) { // pane not set as noRoom yet, so hide or close it now...- s.noRoom = true; // update state- s.wasOpen = !s.isClosed && !s.isSliding;- if (s.isClosed){} // SKIP- else if (o.closable) // 'close' if possible- close(pane, true, true); // true = force, true = noAnimation- else // 'hide' pane if cannot just be closed- hide(pane, true); // true = noAnimation- }- }- }--- /**- * sizePane / manualSizePane- * sizePane is called only by internal methods whenever a pane needs to be resized- * manualSizePane is an exposed flow-through method allowing extra code when pane is 'manually resized'- *- * @param {(string|Object)} evt_or_pane The pane being resized- * @param {number} size The *desired* new size for this pane - will be validated- * @param {boolean=} [skipCallback=false] Should the onresize callback be run?- * @param {boolean=} [noAnimation=false]- * @param {boolean=} [force=false] Force resizing even if does not seem necessary- */-, manualSizePane = function (evt_or_pane, size, skipCallback, noAnimation, force) {- if (!isInitialized()) return;- var pane = evtPane.call(this, evt_or_pane)- , o = options[pane]- , s = state[pane]- // if resizing callbacks have been delayed and resizing is now DONE, force resizing to complete...- , forceResize = force || (o.livePaneResizing && !s.isResizing)- ;- // ANY call to manualSizePane disables autoResize - ie, percentage sizing- s.autoResize = false;- // flow-through...- sizePane(pane, size, skipCallback, noAnimation, forceResize); // will animate resize if option enabled- }-- /**- * @param {(string|Object)} evt_or_pane The pane being resized- * @param {number} size The *desired* new size for this pane - will be validated- * @param {boolean=} [skipCallback=false] Should the onresize callback be run?- * @param {boolean=} [noAnimation=false]- * @param {boolean=} [force=false] Force resizing even if does not seem necessary- */-, sizePane = function (evt_or_pane, size, skipCallback, noAnimation, force) {- if (!isInitialized()) return;- var pane = evtPane.call(this, evt_or_pane) // probably NEVER called from event?- , o = options[pane]- , s = state[pane]- , $P = $Ps[pane]- , $R = $Rs[pane]- , side = _c[pane].side- , dimName = _c[pane].sizeType.toLowerCase()- , skipResizeWhileDragging = s.isResizing && !o.triggerEventsDuringLiveResize- , doFX = noAnimation !== true && o.animatePaneSizing- , oldSize, newSize- ;- // QUEUE in case another action/animation is in progress- $N.queue(function( queueNext ){- // calculate 'current' min/max sizes- setSizeLimits(pane); // update pane-state- oldSize = s.size;- size = _parseSize(pane, size); // handle percentages & auto- size = max(size, _parseSize(pane, o.minSize));- size = min(size, s.maxSize);- if (size < s.minSize) { // not enough room for pane!- queueNext(); // call before makePaneFit() because it needs the queue free- makePaneFit(pane, false, skipCallback); // will hide or close pane- return;- }-- // IF newSize is same as oldSize, then nothing to do - abort- if (!force && size === oldSize)- return queueNext();-- // onresize_start callback CANNOT cancel resizing because this would break the layout!- if (!skipCallback && state.initialized && s.isVisible)- _runCallbacks("onresize_start", pane);-- // resize the pane, and make sure its visible- newSize = cssSize(pane, size);-- if (doFX && $P.is(":visible")) { // ANIMATE- var fx = $.layout.effects.size[pane] || $.layout.effects.size.all- , easing = o.fxSettings_size.easing || fx.easing- , z = options.zIndexes- , props = {};- props[ dimName ] = newSize +'px';- s.isMoving = true;- // overlay all elements during animation- $P.css({ zIndex: z.pane_animate })- .show().animate( props, o.fxSpeed_size, easing, function(){- // reset zIndex after animation- $P.css({ zIndex: (s.isSliding ? z.pane_sliding : z.pane_normal) });- s.isMoving = false;- sizePane_2(); // continue- queueNext();- });- }- else { // no animation- $P.css( dimName, newSize ); // resize pane- // if pane is visible, then- if ($P.is(":visible"))- sizePane_2(); // continue- else {- // pane is NOT VISIBLE, so just update state data...- // when pane is *next opened*, it will have the new size- s.size = size; // update state.size- $.extend(s, elDims($P)); // update state dimensions- }- queueNext();- };-- });-- // SUBROUTINE- function sizePane_2 () {- /* Panes are sometimes not sized precisely in some browsers!?- * This code will resize the pane up to 3 times to nudge the pane to the correct size- */- var actual = dimName==='width' ? $P.outerWidth() : $P.outerHeight()- , tries = [{- pane: pane- , count: 1- , target: size- , actual: actual- , correct: (size === actual)- , attempt: size- , cssSize: newSize- }]- , lastTry = tries[0]- , thisTry = {}- , msg = 'Inaccurate size after resizing the '+ pane +'-pane.'- ;- while ( !lastTry.correct ) {- thisTry = { pane: pane, count: lastTry.count+1, target: size };-- if (lastTry.actual > size)- thisTry.attempt = max(0, lastTry.attempt - (lastTry.actual - size));- else // lastTry.actual < size- thisTry.attempt = max(0, lastTry.attempt + (size - lastTry.actual));-- thisTry.cssSize = cssSize(pane, thisTry.attempt);- $P.css( dimName, thisTry.cssSize );-- thisTry.actual = dimName=='width' ? $P.outerWidth() : $P.outerHeight();- thisTry.correct = (size === thisTry.actual);-- // log attempts and alert the user of this *non-fatal error* (if showDebugMessages)- if ( tries.length === 1) {- _log(msg, false, true);- _log(lastTry, false, true);- }- _log(thisTry, false, true);- // after 4 tries, is as close as its gonna get!- if (tries.length > 3) break;-- tries.push( thisTry );- lastTry = tries[ tries.length - 1 ];- }- // END TESTING CODE-- // update pane-state dimensions- s.size = size;- $.extend(s, elDims($P));-- if (s.isVisible && $P.is(":visible")) {- // reposition the resizer-bar- if ($R) $R.css( side, size + sC.inset[side] );- // resize the content-div- sizeContent(pane);- }-- if (!skipCallback && !skipResizeWhileDragging && state.initialized && s.isVisible)- _runCallbacks("onresize_end", pane);-- // resize all the adjacent panes, and adjust their toggler buttons- // when skipCallback passed, it means the controlling method will handle 'other panes'- if (!skipCallback) {- // also no callback if live-resize is in progress and NOT triggerEventsDuringLiveResize- if (!s.isSliding) sizeMidPanes(_c[pane].dir=="horz" ? "" : "center", skipResizeWhileDragging, force);- sizeHandles();- }-- // if opposite-pane was autoClosed, see if it can be autoOpened now- var altPane = _c.oppositeEdge[pane];- if (size < oldSize && state[ altPane ].noRoom) {- setSizeLimits( altPane );- makePaneFit( altPane, false, skipCallback );- }-- // DEBUG - ALERT user/developer so they know there was a sizing problem- if (tries.length > 1)- _log(msg +'\nSee the Error Console for details.', true, true);- }- }-- /**- * @see initPanes(), sizePane(), resizeAll(), open(), close(), hide()- * @param {(Array.<string>|string)} panes The pane(s) being resized, comma-delmited string- * @param {boolean=} [skipCallback=false] Should the onresize callback be run?- * @param {boolean=} [force=false]- */-, sizeMidPanes = function (panes, skipCallback, force) {- panes = (panes ? panes : "east,west,center").split(",");-- $.each(panes, function (i, pane) {- if (!$Ps[pane]) return; // NO PANE - skip- var- o = options[pane]- , s = state[pane]- , $P = $Ps[pane]- , $R = $Rs[pane]- , isCenter= (pane=="center")- , hasRoom = true- , CSS = {}- // if pane is not visible, show it invisibly NOW rather than for *each call* in this script- , visCSS = $.layout.showInvisibly($P)-- , newCenter = calcNewCenterPaneDims()- ;-- // update pane-state dimensions- $.extend(s, elDims($P));-- if (pane === "center") {- if (!force && s.isVisible && newCenter.width === s.outerWidth && newCenter.height === s.outerHeight) {- $P.css(visCSS);- return true; // SKIP - pane already the correct size- }- // set state for makePaneFit() logic- $.extend(s, cssMinDims(pane), {- maxWidth: newCenter.width- , maxHeight: newCenter.height- });- CSS = newCenter;- // convert OUTER width/height to CSS width/height- CSS.width = cssW($P, CSS.width);- // NEW - allow pane to extend 'below' visible area rather than hide it- CSS.height = cssH($P, CSS.height);- hasRoom = CSS.width >= 0 && CSS.height >= 0; // height >= 0 = ALWAYS TRUE NOW-- // during layout init, try to shrink east/west panes to make room for center- if (!state.initialized && o.minWidth > newCenter.width) {- var- reqPx = o.minWidth - s.outerWidth- , minE = options.east.minSize || 0- , minW = options.west.minSize || 0- , sizeE = state.east.size- , sizeW = state.west.size- , newE = sizeE- , newW = sizeW- ;- if (reqPx > 0 && state.east.isVisible && sizeE > minE) {- newE = max( sizeE-minE, sizeE-reqPx );- reqPx -= sizeE-newE;- }- if (reqPx > 0 && state.west.isVisible && sizeW > minW) {- newW = max( sizeW-minW, sizeW-reqPx );- reqPx -= sizeW-newW;- }- // IF we found enough extra space, then resize the border panes as calculated- if (reqPx === 0) {- if (sizeE && sizeE != minE)- sizePane('east', newE, true, true, force); // true = skipCallback/noAnimation - initPanes will handle when done- if (sizeW && sizeW != minW)- sizePane('west', newW, true, true, force); // true = skipCallback/noAnimation- // now start over!- sizeMidPanes('center', skipCallback, force);- $P.css(visCSS);- return; // abort this loop- }- }- }- else { // for east and west, set only the height, which is same as center height- // set state.min/maxWidth/Height for makePaneFit() logic- if (s.isVisible && !s.noVerticalRoom)- $.extend(s, elDims($P), cssMinDims(pane))- if (!force && !s.noVerticalRoom && newCenter.height === s.outerHeight) {- $P.css(visCSS);- return true; // SKIP - pane already the correct size- }- // east/west have same top, bottom & height as center- CSS.top = newCenter.top;- CSS.bottom = newCenter.bottom;- // NEW - allow pane to extend 'below' visible area rather than hide it- CSS.height = cssH($P, newCenter.height);- s.maxHeight = CSS.height;- hasRoom = (s.maxHeight >= 0); // ALWAYS TRUE NOW- if (!hasRoom) s.noVerticalRoom = true; // makePaneFit() logic- }-- if (hasRoom) {- // resizeAll passes skipCallback because it triggers callbacks after ALL panes are resized- if (!skipCallback && state.initialized)- _runCallbacks("onresize_start", pane);-- $P.css(CSS); // apply the CSS to pane- if (pane !== "center")- sizeHandles(pane); // also update resizer length- if (s.noRoom && !s.isClosed && !s.isHidden)- makePaneFit(pane); // will re-open/show auto-closed/hidden pane- if (s.isVisible) {- $.extend(s, elDims($P)); // update pane dimensions- if (state.initialized) sizeContent(pane); // also resize the contents, if exists- }- }- else if (!s.noRoom && s.isVisible) // no room for pane- makePaneFit(pane); // will hide or close pane-- // reset visibility, if necessary- $P.css(visCSS);-- if (!s.isVisible)- return true; // DONE - next pane-- /*- * Extra CSS for IE6 or IE7 in Quirks-mode - add 'width' to NORTH/SOUTH panes- * Normally these panes have only 'left' & 'right' positions so pane auto-sizes- * ALSO required when pane is an IFRAME because will NOT default to 'full width'- * TODO: Can I use width:100% for a north/south iframe?- * TODO: Sounds like a job for $P.outerWidth( sC.innerWidth ) SETTER METHOD- */- if (pane === "center") { // finished processing midPanes- var fix = browser.isIE6 || !browser.boxModel;- if ($Ps.north && (fix || state.north.tagName=="IFRAME"))- $Ps.north.css("width", cssW($Ps.north, sC.innerWidth));- if ($Ps.south && (fix || state.south.tagName=="IFRAME"))- $Ps.south.css("width", cssW($Ps.south, sC.innerWidth));- }-- // resizeAll passes skipCallback because it triggers callbacks after ALL panes are resized- if (!skipCallback && state.initialized)- _runCallbacks("onresize_end", pane);- });- }--- /**- * @see window.onresize(), callbacks or custom code- * @param {(Object|boolean)=} evt_or_refresh If 'true', then also reset pane-positioning- */-, resizeAll = function (evt_or_refresh) {- var oldW = sC.innerWidth- , oldH = sC.innerHeight- ;- // stopPropagation if called by trigger("layoutdestroy") - use evtPane utility- evtPane(evt_or_refresh);-- // cannot size layout when 'container' is hidden or collapsed- if (!$N.is(":visible")) return;-- if (!state.initialized) {- _initLayoutElements();- return; // no need to resize since we just initialized!- }-- $.extend(sC, elDims( $N, options.inset )); // UPDATE container dimensions- if (!sC.outerHeight) return;-- // if 'true' passed, refresh pane & handle positioning too- if (evt_or_refresh === true)- setPanePosition();-- // onresizeall_start will CANCEL resizing if returns false- // state.container has already been set, so user can access this info for calcuations- if (false === _runCallbacks("onresizeall_start")) return false;-- var // see if container is now 'smaller' than before- shrunkH = (sC.innerHeight < oldH)- , shrunkW = (sC.innerWidth < oldW)- , $P, o, s- ;- // NOTE special order for sizing: S-N-E-W- $.each(["south","north","east","west"], function (i, pane) {- if (!$Ps[pane]) return; // no pane - SKIP- o = options[pane];- s = state[pane];- if (s.autoResize && s.size != o.size) // resize pane to original size set in options- sizePane(pane, o.size, true, true, true); // true=skipCallback/noAnimation/forceResize- else {- setSizeLimits(pane);- makePaneFit(pane, false, true, true); // true=skipCallback/forceResize- }- });-- sizeMidPanes("", true, true); // true=skipCallback/forceResize- sizeHandles(); // reposition the toggler elements-- // trigger all individual pane callbacks AFTER layout has finished resizing- $.each(_c.allPanes, function (i, pane) {- $P = $Ps[pane];- if (!$P) return; // SKIP- if (state[pane].isVisible) // undefined for non-existent panes- _runCallbacks("onresize_end", pane); // callback - if exists- });-- _runCallbacks("onresizeall_end");- //_triggerLayoutEvent(pane, 'resizeall');- }-- /**- * Whenever a pane resizes or opens that has a nested layout, trigger resizeAll- *- * @param {(string|Object)} evt_or_pane The pane just resized or opened- */-, resizeChildren = function (evt_or_pane, skipRefresh) {- var pane = evtPane.call(this, evt_or_pane);-- if (!options[pane].resizeChildren) return;-- // ensure the pane-children are up-to-date- if (!skipRefresh) refreshChildren( pane );- var pC = children[pane];- if ($.isPlainObject( pC )) {- // resize one or more children- $.each( pC, function (key, child) {- child.resizeAll();- });- }- }-- /**- * IF pane has a content-div, then resize all elements inside pane to fit pane-height- *- * @param {(string|Object)} evt_or_panes The pane(s) being resized- * @param {boolean=} [remeasure=false] Should the content (header/footer) be remeasured?- */-, sizeContent = function (evt_or_panes, remeasure) {- if (!isInitialized()) return;-- var panes = evtPane.call(this, evt_or_panes);- panes = panes ? panes.split(",") : _c.allPanes;-- $.each(panes, function (idx, pane) {- var- $P = $Ps[pane]- , $C = $Cs[pane]- , o = options[pane]- , s = state[pane]- , m = s.content // m = measurements- ;- if (!$P || !$C || !$P.is(":visible")) return true; // NOT VISIBLE - skip-- // if content-element was REMOVED, update OR remove the pointer- if (!$C.length) {- initContent(pane, false); // false = do NOT sizeContent() - already there!- if (!$C) return; // no replacement element found - pointer have been removed- }-- // onsizecontent_start will CANCEL resizing if returns false- if (false === _runCallbacks("onsizecontent_start", pane)) return;-- // skip re-measuring offsets if live-resizing- if ((!s.isMoving && !s.isResizing) || o.liveContentResizing || remeasure || m.top == undefined) {- _measure();- // if any footers are below pane-bottom, they may not measure correctly,- // so allow pane overflow and re-measure- if (m.hiddenFooters > 0 && $P.css("overflow") === "hidden") {- $P.css("overflow", "visible");- _measure(); // remeasure while overflowing- $P.css("overflow", "hidden");- }- }- // NOTE: spaceAbove/Below *includes* the pane paddingTop/Bottom, but not pane.borders- var newH = s.innerHeight - (m.spaceAbove - s.css.paddingTop) - (m.spaceBelow - s.css.paddingBottom);-- if (!$C.is(":visible") || m.height != newH) {- // size the Content element to fit new pane-size - will autoHide if not enough room- setOuterHeight($C, newH, true); // true=autoHide- m.height = newH; // save new height- };-- if (state.initialized)- _runCallbacks("onsizecontent_end", pane);-- function _below ($E) {- return max(s.css.paddingBottom, (parseInt($E.css("marginBottom"), 10) || 0));- };-- function _measure () {- var- ignore = options[pane].contentIgnoreSelector- , $Fs = $C.nextAll().not(".ui-layout-mask").not(ignore || ":lt(0)") // not :lt(0) = ALL- , $Fs_vis = $Fs.filter(':visible')- , $F = $Fs_vis.filter(':last')- ;- m = {- top: $C[0].offsetTop- , height: $C.outerHeight()- , numFooters: $Fs.length- , hiddenFooters: $Fs.length - $Fs_vis.length- , spaceBelow: 0 // correct if no content footer ($E)- }- m.spaceAbove = m.top; // just for state - not used in calc- m.bottom = m.top + m.height;- if ($F.length)- //spaceBelow = (LastFooter.top + LastFooter.height) [footerBottom] - Content.bottom + max(LastFooter.marginBottom, pane.paddingBotom)- m.spaceBelow = ($F[0].offsetTop + $F.outerHeight()) - m.bottom + _below($F);- else // no footer - check marginBottom on Content element itself- m.spaceBelow = _below($C);- };- });- }--- /**- * Called every time a pane is opened, closed, or resized to slide the togglers to 'center' and adjust their length if necessary- *- * @see initHandles(), open(), close(), resizeAll()- * @param {(string|Object)=} evt_or_panes The pane(s) being resized- */-, sizeHandles = function (evt_or_panes) {- var panes = evtPane.call(this, evt_or_panes)- panes = panes ? panes.split(",") : _c.borderPanes;-- $.each(panes, function (i, pane) {- var- o = options[pane]- , s = state[pane]- , $P = $Ps[pane]- , $R = $Rs[pane]- , $T = $Ts[pane]- , $TC- ;- if (!$P || !$R) return;-- var- dir = _c[pane].dir- , _state = (s.isClosed ? "_closed" : "_open")- , spacing = o["spacing"+ _state]- , togAlign = o["togglerAlign"+ _state]- , togLen = o["togglerLength"+ _state]- , paneLen- , left- , offset- , CSS = {}- ;-- if (spacing === 0) {- $R.hide();- return;- }- else if (!s.noRoom && !s.isHidden) // skip if resizer was hidden for any reason- $R.show(); // in case was previously hidden-- // Resizer Bar is ALWAYS same width/height of pane it is attached to- if (dir === "horz") { // north/south- //paneLen = $P.outerWidth(); // s.outerWidth ||- paneLen = sC.innerWidth; // handle offscreen-panes- s.resizerLength = paneLen;- left = $.layout.cssNum($P, "left")- $R.css({- width: cssW($R, paneLen) // account for borders & padding- , height: cssH($R, spacing) // ditto- , left: left > -9999 ? left : sC.inset.left // handle offscreen-panes- });- }- else { // east/west- paneLen = $P.outerHeight(); // s.outerHeight ||- s.resizerLength = paneLen;- $R.css({- height: cssH($R, paneLen) // account for borders & padding- , width: cssW($R, spacing) // ditto- , top: sC.inset.top + getPaneSize("north", true) // TODO: what if no North pane?- //, top: $.layout.cssNum($Ps["center"], "top")- });- }-- // remove hover classes- removeHover( o, $R );-- if ($T) {- if (togLen === 0 || (s.isSliding && o.hideTogglerOnSlide)) {- $T.hide(); // always HIDE the toggler when 'sliding'- return;- }- else- $T.show(); // in case was previously hidden-- if (!(togLen > 0) || togLen === "100%" || togLen > paneLen) {- togLen = paneLen;- offset = 0;- }- else { // calculate 'offset' based on options.PANE.togglerAlign_open/closed- if (isStr(togAlign)) {- switch (togAlign) {- case "top":- case "left": offset = 0;- break;- case "bottom":- case "right": offset = paneLen - togLen;- break;- case "middle":- case "center":- default: offset = round((paneLen - togLen) / 2); // 'default' catches typos- }- }- else { // togAlign = number- var x = parseInt(togAlign, 10); //- if (togAlign >= 0) offset = x;- else offset = paneLen - togLen + x; // NOTE: x is negative!- }- }-- if (dir === "horz") { // north/south- var width = cssW($T, togLen);- $T.css({- width: width // account for borders & padding- , height: cssH($T, spacing) // ditto- , left: offset // TODO: VERIFY that toggler positions correctly for ALL values- , top: 0- });- // CENTER the toggler content SPAN- $T.children(".content").each(function(){- $TC = $(this);- $TC.css("marginLeft", round((width-$TC.outerWidth())/2)); // could be negative- });- }- else { // east/west- var height = cssH($T, togLen);- $T.css({- height: height // account for borders & padding- , width: cssW($T, spacing) // ditto- , top: offset // POSITION the toggler- , left: 0- });- // CENTER the toggler content SPAN- $T.children(".content").each(function(){- $TC = $(this);- $TC.css("marginTop", round((height-$TC.outerHeight())/2)); // could be negative- });- }-- // remove ALL hover classes- removeHover( 0, $T );- }-- // DONE measuring and sizing this resizer/toggler, so can be 'hidden' now- if (!state.initialized && (o.initHidden || s.noRoom)) {- $R.hide();- if ($T) $T.hide();- }- });- }--- /**- * @param {(string|Object)} evt_or_pane- */-, enableClosable = function (evt_or_pane) {- if (!isInitialized()) return;- var pane = evtPane.call(this, evt_or_pane)- , $T = $Ts[pane]- , o = options[pane]- ;- if (!$T) return;- o.closable = true;- $T .bind("click."+ sID, function(evt){ evt.stopPropagation(); toggle(pane); })- .css("visibility", "visible")- .css("cursor", "pointer")- .attr("title", state[pane].isClosed ? o.tips.Open : o.tips.Close) // may be blank- .show();- }- /**- * @param {(string|Object)} evt_or_pane- * @param {boolean=} [hide=false]- */-, disableClosable = function (evt_or_pane, hide) {- if (!isInitialized()) return;- var pane = evtPane.call(this, evt_or_pane)- , $T = $Ts[pane]- ;- if (!$T) return;- options[pane].closable = false;- // is closable is disable, then pane MUST be open!- if (state[pane].isClosed) open(pane, false, true);- $T .unbind("."+ sID)- .css("visibility", hide ? "hidden" : "visible") // instead of hide(), which creates logic issues- .css("cursor", "default")- .attr("title", "");- }--- /**- * @param {(string|Object)} evt_or_pane- */-, enableSlidable = function (evt_or_pane) {- if (!isInitialized()) return;- var pane = evtPane.call(this, evt_or_pane)- , $R = $Rs[pane]- ;- if (!$R || !$R.data('draggable')) return;- options[pane].slidable = true;- if (state[pane].isClosed)- bindStartSlidingEvents(pane, true);- }- /**- * @param {(string|Object)} evt_or_pane- */-, disableSlidable = function (evt_or_pane) {- if (!isInitialized()) return;- var pane = evtPane.call(this, evt_or_pane)- , $R = $Rs[pane]- ;- if (!$R) return;- options[pane].slidable = false;- if (state[pane].isSliding)- close(pane, false, true);- else {- bindStartSlidingEvents(pane, false);- $R .css("cursor", "default")- .attr("title", "");- removeHover(null, $R[0]); // in case currently hovered- }- }--- /**- * @param {(string|Object)} evt_or_pane- */-, enableResizable = function (evt_or_pane) {- if (!isInitialized()) return;- var pane = evtPane.call(this, evt_or_pane)- , $R = $Rs[pane]- , o = options[pane]- ;- if (!$R || !$R.data('draggable')) return;- o.resizable = true;- $R.draggable("enable");- if (!state[pane].isClosed)- $R .css("cursor", o.resizerCursor)- .attr("title", o.tips.Resize);- }- /**- * @param {(string|Object)} evt_or_pane- */-, disableResizable = function (evt_or_pane) {- if (!isInitialized()) return;- var pane = evtPane.call(this, evt_or_pane)- , $R = $Rs[pane]- ;- if (!$R || !$R.data('draggable')) return;- options[pane].resizable = false;- $R .draggable("disable")- .css("cursor", "default")- .attr("title", "");- removeHover(null, $R[0]); // in case currently hovered- }--- /**- * Move a pane from source-side (eg, west) to target-side (eg, east)- * If pane exists on target-side, move that to source-side, ie, 'swap' the panes- *- * @param {(string|Object)} evt_or_pane1 The pane/edge being swapped- * @param {string} pane2 ditto- */-, swapPanes = function (evt_or_pane1, pane2) {- if (!isInitialized()) return;- var pane1 = evtPane.call(this, evt_or_pane1);- // change state.edge NOW so callbacks can know where pane is headed...- state[pane1].edge = pane2;- state[pane2].edge = pane1;- // run these even if NOT state.initialized- if (false === _runCallbacks("onswap_start", pane1)- || false === _runCallbacks("onswap_start", pane2)- ) {- state[pane1].edge = pane1; // reset- state[pane2].edge = pane2;- return;- }-- var- oPane1 = copy( pane1 )- , oPane2 = copy( pane2 )- , sizes = {}- ;- sizes[pane1] = oPane1 ? oPane1.state.size : 0;- sizes[pane2] = oPane2 ? oPane2.state.size : 0;-- // clear pointers & state- $Ps[pane1] = false;- $Ps[pane2] = false;- state[pane1] = {};- state[pane2] = {};-- // ALWAYS remove the resizer & toggler elements- if ($Ts[pane1]) $Ts[pane1].remove();- if ($Ts[pane2]) $Ts[pane2].remove();- if ($Rs[pane1]) $Rs[pane1].remove();- if ($Rs[pane2]) $Rs[pane2].remove();- $Rs[pane1] = $Rs[pane2] = $Ts[pane1] = $Ts[pane2] = false;-- // transfer element pointers and data to NEW Layout keys- move( oPane1, pane2 );- move( oPane2, pane1 );-- // cleanup objects- oPane1 = oPane2 = sizes = null;-- // make panes 'visible' again- if ($Ps[pane1]) $Ps[pane1].css(_c.visible);- if ($Ps[pane2]) $Ps[pane2].css(_c.visible);-- // fix any size discrepancies caused by swap- resizeAll();-- // run these even if NOT state.initialized- _runCallbacks("onswap_end", pane1);- _runCallbacks("onswap_end", pane2);-- return;-- function copy (n) { // n = pane- var- $P = $Ps[n]- , $C = $Cs[n]- ;- return !$P ? false : {- pane: n- , P: $P ? $P[0] : false- , C: $C ? $C[0] : false- , state: $.extend(true, {}, state[n])- , options: $.extend(true, {}, options[n])- }- };-- function move (oPane, pane) {- if (!oPane) return;- var- P = oPane.P- , C = oPane.C- , oldPane = oPane.pane- , c = _c[pane]- // save pane-options that should be retained- , s = $.extend(true, {}, state[pane])- , o = options[pane]- // RETAIN side-specific FX Settings - more below- , fx = { resizerCursor: o.resizerCursor }- , re, size, pos- ;- $.each("fxName,fxSpeed,fxSettings".split(","), function (i, k) {- fx[k +"_open"] = o[k +"_open"];- fx[k +"_close"] = o[k +"_close"];- fx[k +"_size"] = o[k +"_size"];- });-- // update object pointers and attributes- $Ps[pane] = $(P)- .data({- layoutPane: Instance[pane] // NEW pointer to pane-alias-object- , layoutEdge: pane- })- .css(_c.hidden)- .css(c.cssReq)- ;- $Cs[pane] = C ? $(C) : false;-- // set options and state- options[pane] = $.extend(true, {}, oPane.options, fx);- state[pane] = $.extend(true, {}, oPane.state);-- // change classNames on the pane, eg: ui-layout-pane-east ==> ui-layout-pane-west- re = new RegExp(o.paneClass +"-"+ oldPane, "g");- P.className = P.className.replace(re, o.paneClass +"-"+ pane);-- // ALWAYS regenerate the resizer & toggler elements- initHandles(pane); // create the required resizer & toggler-- // if moving to different orientation, then keep 'target' pane size- if (c.dir != _c[oldPane].dir) {- size = sizes[pane] || 0;- setSizeLimits(pane); // update pane-state- size = max(size, state[pane].minSize);- // use manualSizePane to disable autoResize - not useful after panes are swapped- manualSizePane(pane, size, true, true); // true/true = skipCallback/noAnimation- }- else // move the resizer here- $Rs[pane].css(c.side, sC.inset[c.side] + (state[pane].isVisible ? getPaneSize(pane) : 0));--- // ADD CLASSNAMES & SLIDE-BINDINGS- if (oPane.state.isVisible && !s.isVisible)- setAsOpen(pane, true); // true = skipCallback- else {- setAsClosed(pane);- bindStartSlidingEvents(pane, true); // will enable events IF option is set- }-- // DESTROY the object- oPane = null;- };- }--- /**- * INTERNAL method to sync pin-buttons when pane is opened or closed- * Unpinned means the pane is 'sliding' - ie, over-top of the adjacent panes- *- * @see open(), setAsOpen(), setAsClosed()- * @param {string} pane These are the params returned to callbacks by layout()- * @param {boolean} doPin True means set the pin 'down', False means 'up'- */-, syncPinBtns = function (pane, doPin) {- if ($.layout.plugins.buttons)- $.each(state[pane].pins, function (i, selector) {- $.layout.buttons.setPinState(Instance, $(selector), pane, doPin);- });- }--; // END var DECLARATIONS-- /**- * Capture keys when enableCursorHotkey - toggle pane if hotkey pressed- *- * @see document.keydown()- */- function keyDown (evt) {- if (!evt) return true;- var code = evt.keyCode;- if (code < 33) return true; // ignore special keys: ENTER, TAB, etc-- var- PANE = {- 38: "north" // Up Cursor - $.ui.keyCode.UP- , 40: "south" // Down Cursor - $.ui.keyCode.DOWN- , 37: "west" // Left Cursor - $.ui.keyCode.LEFT- , 39: "east" // Right Cursor - $.ui.keyCode.RIGHT- }- , ALT = evt.altKey // no worky!- , SHIFT = evt.shiftKey- , CTRL = evt.ctrlKey- , CURSOR = (CTRL && code >= 37 && code <= 40)- , o, k, m, pane- ;-- if (CURSOR && options[PANE[code]].enableCursorHotkey) // valid cursor-hotkey- pane = PANE[code];- else if (CTRL || SHIFT) // check to see if this matches a custom-hotkey- $.each(_c.borderPanes, function (i, p) { // loop each pane to check its hotkey- o = options[p];- k = o.customHotkey;- m = o.customHotkeyModifier; // if missing or invalid, treated as "CTRL+SHIFT"- if ((SHIFT && m=="SHIFT") || (CTRL && m=="CTRL") || (CTRL && SHIFT)) { // Modifier matches- if (k && code === (isNaN(k) || k <= 9 ? k.toUpperCase().charCodeAt(0) : k)) { // Key matches- pane = p;- return false; // BREAK- }- }- });-- // validate pane- if (!pane || !$Ps[pane] || !options[pane].closable || state[pane].isHidden)- return true;-- toggle(pane);-- evt.stopPropagation();- evt.returnValue = false; // CANCEL key- return false;- };---/*- * ######################################- * UTILITY METHODS- * called externally or by initButtons- * ######################################- */-- /**- * Change/reset a pane overflow setting & zIndex to allow popups/drop-downs to work- *- * @param {Object=} [el] (optional) Can also be 'bound' to a click, mouseOver, or other event- */- function allowOverflow (el) {- if (!isInitialized()) return;- if (this && this.tagName) el = this; // BOUND to element- var $P;- if (isStr(el))- $P = $Ps[el];- else if ($(el).data("layoutRole"))- $P = $(el);- else- $(el).parents().each(function(){- if ($(this).data("layoutRole")) {- $P = $(this);- return false; // BREAK- }- });- if (!$P || !$P.length) return; // INVALID-- var- pane = $P.data("layoutEdge")- , s = state[pane]- ;-- // if pane is already raised, then reset it before doing it again!- // this would happen if allowOverflow is attached to BOTH the pane and an element- if (s.cssSaved)- resetOverflow(pane); // reset previous CSS before continuing-- // if pane is raised by sliding or resizing, or its closed, then abort- if (s.isSliding || s.isResizing || s.isClosed) {- s.cssSaved = false;- return;- }-- var- newCSS = { zIndex: (options.zIndexes.resizer_normal + 1) }- , curCSS = {}- , of = $P.css("overflow")- , ofX = $P.css("overflowX")- , ofY = $P.css("overflowY")- ;- // determine which, if any, overflow settings need to be changed- if (of != "visible") {- curCSS.overflow = of;- newCSS.overflow = "visible";- }- if (ofX && !ofX.match(/(visible|auto)/)) {- curCSS.overflowX = ofX;- newCSS.overflowX = "visible";- }- if (ofY && !ofY.match(/(visible|auto)/)) {- curCSS.overflowY = ofX;- newCSS.overflowY = "visible";- }-- // save the current overflow settings - even if blank!- s.cssSaved = curCSS;-- // apply new CSS to raise zIndex and, if necessary, make overflow 'visible'- $P.css( newCSS );-- // make sure the zIndex of all other panes is normal- $.each(_c.allPanes, function(i, p) {- if (p != pane) resetOverflow(p);- });-- };- /**- * @param {Object=} [el] (optional) Can also be 'bound' to a click, mouseOver, or other event- */- function resetOverflow (el) {- if (!isInitialized()) return;- if (this && this.tagName) el = this; // BOUND to element- var $P;- if (isStr(el))- $P = $Ps[el];- else if ($(el).data("layoutRole"))- $P = $(el);- else- $(el).parents().each(function(){- if ($(this).data("layoutRole")) {- $P = $(this);- return false; // BREAK- }- });- if (!$P || !$P.length) return; // INVALID-- var- pane = $P.data("layoutEdge")- , s = state[pane]- , CSS = s.cssSaved || {}- ;- // reset the zIndex- if (!s.isSliding && !s.isResizing)- $P.css("zIndex", options.zIndexes.pane_normal);-- // reset Overflow - if necessary- $P.css( CSS );-- // clear var- s.cssSaved = false;- };--/*- * #####################- * CREATE/RETURN LAYOUT- * #####################- */-- // validate that container exists- var $N = $(this).eq(0); // FIRST matching Container element- if (!$N.length) {- return _log( options.errors.containerMissing );- };-- // Users retrieve Instance of a layout with: $N.layout() OR $N.data("layout")- // return the Instance-pointer if layout has already been initialized- if ($N.data("layoutContainer") && $N.data("layout"))- return $N.data("layout"); // cached pointer-- // init global vars- var- $Ps = {} // Panes x5 - set in initPanes()- , $Cs = {} // Content x5 - set in initPanes()- , $Rs = {} // Resizers x4 - set in initHandles()- , $Ts = {} // Togglers x4 - set in initHandles()- , $Ms = $([]) // Masks - up to 2 masks per pane (IFRAME + DIV)- // aliases for code brevity- , sC = state.container // alias for easy access to 'container dimensions'- , sID = state.id // alias for unique layout ID/namespace - eg: "layout435"- ;-- // create Instance object to expose data & option Properties, and primary action Methods- var Instance = {- // layout data- options: options // property - options hash- , state: state // property - dimensions hash- // object pointers- , container: $N // property - object pointers for layout container- , panes: $Ps // property - object pointers for ALL Panes: panes.north, panes.center- , contents: $Cs // property - object pointers for ALL Content: contents.north, contents.center- , resizers: $Rs // property - object pointers for ALL Resizers, eg: resizers.north- , togglers: $Ts // property - object pointers for ALL Togglers, eg: togglers.north- // border-pane open/close- , hide: hide // method - ditto- , show: show // method - ditto- , toggle: toggle // method - pass a 'pane' ("north", "west", etc)- , open: open // method - ditto- , close: close // method - ditto- , slideOpen: slideOpen // method - ditto- , slideClose: slideClose // method - ditto- , slideToggle: slideToggle // method - ditto- // pane actions- , setSizeLimits: setSizeLimits // method - pass a 'pane' - update state min/max data- , _sizePane: sizePane // method -intended for user by plugins only!- , sizePane: manualSizePane // method - pass a 'pane' AND an 'outer-size' in pixels or percent, or 'auto'- , sizeContent: sizeContent // method - pass a 'pane'- , swapPanes: swapPanes // method - pass TWO 'panes' - will swap them- , showMasks: showMasks // method - pass a 'pane' OR list of panes - default = all panes with mask option set- , hideMasks: hideMasks // method - ditto'- // pane element methods- , initContent: initContent // method - ditto- , addPane: addPane // method - pass a 'pane'- , removePane: removePane // method - pass a 'pane' to remove from layout, add 'true' to delete the pane-elem- , createChildren: createChildren // method - pass a 'pane' and (optional) layout-options (OVERRIDES options[pane].children- , refreshChildren: refreshChildren // method - pass a 'pane' and a layout-instance- // special pane option setting- , enableClosable: enableClosable // method - pass a 'pane'- , disableClosable: disableClosable // method - ditto- , enableSlidable: enableSlidable // method - ditto- , disableSlidable: disableSlidable // method - ditto- , enableResizable: enableResizable // method - ditto- , disableResizable: disableResizable// method - ditto- // utility methods for panes- , allowOverflow: allowOverflow // utility - pass calling element (this)- , resetOverflow: resetOverflow // utility - ditto- // layout control- , destroy: destroy // method - no parameters- , initPanes: isInitialized // method - no parameters- , resizeAll: resizeAll // method - no parameters- // callback triggering- , runCallbacks: _runCallbacks // method - pass evtName & pane (if a pane-event), eg: trigger("onopen", "west")- // alias collections of options, state and children - created in addPane and extended elsewhere- , hasParentLayout: false // set by initContainer()- , children: children // pointers to child-layouts, eg: Instance.children.west.layoutName- , north: false // alias group: { name: pane, pane: $Ps[pane], options: options[pane], state: state[pane], children: children[pane] }- , south: false // ditto- , west: false // ditto- , east: false // ditto- , center: false // ditto- };-- // create the border layout NOW- if (_create() === 'cancel') // onload_start callback returned false to CANCEL layout creation- return null;- else // true OR false -- if layout-elements did NOT init (hidden or do not exist), can auto-init later- return Instance; // return the Instance object--}---/* OLD versions of jQuery only set $.support.boxModel after page is loaded- * so if this is IE, use support.boxModel to test for quirks-mode (ONLY IE changes boxModel).- */-$(function(){- var b = $.layout.browser;- if (b.msie) b.boxModel = $.support.boxModel;-});---})( jQuery );-// END Layout - keep internal vars internal!----// START Plugins - shared wrapper, no global vars-(function ($) {---/**- * jquery.layout.state 1.0- * $Date: 2011-07-16 08:00:00 (Sat, 16 July 2011) $- *- * Copyright (c) 2012- * Kevin Dalman (http://allpro.net)- *- * Dual licensed under the GPL (http://www.gnu.org/licenses/gpl.html)- * and MIT (http://www.opensource.org/licenses/mit-license.php) licenses.- *- * @requires: UI Layout 1.3.0.rc30.1 or higher- * @requires: $.ui.cookie (above)- *- * @see: http://groups.google.com/group/jquery-ui-layout- */-/*- * State-management options stored in options.stateManagement, which includes a .cookie hash- * Default options saves ALL KEYS for ALL PANES, ie: pane.size, pane.isClosed, pane.isHidden- *- * // STATE/COOKIE OPTIONS- * @example $(el).layout({- stateManagement: {- enabled: true- , stateKeys: "east.size,west.size,east.isClosed,west.isClosed"- , cookie: { name: "appLayout", path: "/" }- }- })- * @example $(el).layout({ stateManagement__enabled: true }) // enable auto-state-management using cookies- * @example $(el).layout({ stateManagement__cookie: { name: "appLayout", path: "/" } })- * @example $(el).layout({ stateManagement__cookie__name: "appLayout", stateManagement__cookie__path: "/" })- *- * // STATE/COOKIE METHODS- * @example myLayout.saveCookie( "west.isClosed,north.size,south.isHidden", {expires: 7} );- * @example myLayout.loadCookie();- * @example myLayout.deleteCookie();- * @example var JSON = myLayout.readState(); // CURRENT Layout State- * @example var JSON = myLayout.readCookie(); // SAVED Layout State (from cookie)- * @example var JSON = myLayout.state.stateData; // LAST LOADED Layout State (cookie saved in layout.state hash)- *- * CUSTOM STATE-MANAGEMENT (eg, saved in a database)- * @example var JSON = myLayout.readState( "west.isClosed,north.size,south.isHidden" );- * @example myLayout.loadState( JSON );- */--/**- * UI COOKIE UTILITY- *- * A $.cookie OR $.ui.cookie namespace *should be standard*, but until then...- * This creates $.ui.cookie so Layout does not need the cookie.jquery.js plugin- * NOTE: This utility is REQUIRED by the layout.state plugin- *- * Cookie methods in Layout are created as part of State Management- */-if (!$.ui) $.ui = {};-$.ui.cookie = {-- // cookieEnabled is not in DOM specs, but DOES works in all browsers,including IE6- acceptsCookies: !!navigator.cookieEnabled--, read: function (name) {- var- c = document.cookie- , cs = c ? c.split(';') : []- , pair // loop var- ;- for (var i=0, n=cs.length; i < n; i++) {- pair = $.trim(cs[i]).split('='); // name=value pair- if (pair[0] == name) // found the layout cookie- return decodeURIComponent(pair[1]);-- }- return null;- }--, write: function (name, val, cookieOpts) {- var- params = ''- , date = ''- , clear = false- , o = cookieOpts || {}- , x = o.expires- ;- if (x && x.toUTCString)- date = x;- else if (x === null || typeof x === 'number') {- date = new Date();- if (x > 0)- date.setDate(date.getDate() + x);- else {- date.setFullYear(1970);- clear = true;- }- }- if (date) params += ';expires='+ date.toUTCString();- if (o.path) params += ';path='+ o.path;- if (o.domain) params += ';domain='+ o.domain;- if (o.secure) params += ';secure';- document.cookie = name +'='+ (clear ? "" : encodeURIComponent( val )) + params; // write or clear cookie- }--, clear: function (name) {- $.ui.cookie.write(name, '', {expires: -1});- }--};-// if cookie.jquery.js is not loaded, create an alias to replicate it-// this may be useful to other plugins or code dependent on that plugin-if (!$.cookie) $.cookie = function (k, v, o) {- var C = $.ui.cookie;- if (v === null)- C.clear(k);- else if (v === undefined)- return C.read(k);- else- C.write(k, v, o);-};---// tell Layout that the state plugin is available-$.layout.plugins.stateManagement = true;--// Add State-Management options to layout.defaults-$.layout.config.optionRootKeys.push("stateManagement");-$.layout.defaults.stateManagement = {- enabled: false // true = enable state-management, even if not using cookies-, autoSave: true // Save a state-cookie when page exits?-, autoLoad: true // Load the state-cookie when Layout inits?-, includeChildren: true // recurse into child layouts to include their state as well- // List state-data to save - must be pane-specific-, stateKeys: "north.size,south.size,east.size,west.size,"+- "north.isClosed,south.isClosed,east.isClosed,west.isClosed,"+- "north.isHidden,south.isHidden,east.isHidden,west.isHidden"-, cookie: {- name: "" // If not specified, will use Layout.name, else just "Layout"- , domain: "" // blank = current domain- , path: "" // blank = current page, '/' = entire website- , expires: "" // 'days' to keep cookie - leave blank for 'session cookie'- , secure: false- }-};-// Set stateManagement as a layout-option, NOT a pane-option-$.layout.optionsMap.layout.push("stateManagement");--/*- * State Management methods- */-$.layout.state = {-- /**- * Get the current layout state and save it to a cookie- *- * myLayout.saveCookie( keys, cookieOpts )- *- * @param {Object} inst- * @param {(string|Array)=} keys- * @param {Object=} cookieOpts- */- saveCookie: function (inst, keys, cookieOpts) {- var o = inst.options- , sm = o.stateManagement- , oC = $.extend(true, {}, sm.cookie, cookieOpts || null)- , data = inst.state.stateData = inst.readState( keys || sm.stateKeys ) // read current panes-state- ;- $.ui.cookie.write( oC.name || o.name || "Layout", $.layout.state.encodeJSON(data), oC );- return $.extend(true, {}, data); // return COPY of state.stateData data- }-- /**- * Remove the state cookie- *- * @param {Object} inst- */-, deleteCookie: function (inst) {- var o = inst.options;- $.ui.cookie.clear( o.stateManagement.cookie.name || o.name || "Layout" );- }-- /**- * Read & return data from the cookie - as JSON- *- * @param {Object} inst- */-, readCookie: function (inst) {- var o = inst.options;- var c = $.ui.cookie.read( o.stateManagement.cookie.name || o.name || "Layout" );- // convert cookie string back to a hash and return it- return c ? $.layout.state.decodeJSON(c) : {};- }-- /**- * Get data from the cookie and USE IT to loadState- *- * @param {Object} inst- */-, loadCookie: function (inst) {- var c = $.layout.state.readCookie(inst); // READ the cookie- if (c) {- inst.state.stateData = $.extend(true, {}, c); // SET state.stateData- inst.loadState(c); // LOAD the retrieved state- }- return c;- }-- /**- * Update layout options from the cookie, if one exists- *- * @param {Object} inst- * @param {Object=} stateData- * @param {boolean=} animate- */-, loadState: function (inst, stateData, opts) {- stateData = $.layout.transformData( stateData ); // panes = default subkey-- if (!$.isPlainObject( stateData ) || $.isEmptyObject( stateData )) return;- // cache in the state object- inst.state.stateData = stateData;-- // MUST remove any pane.children keys before applying to options- var s = $.extend(true, {}, stateData);- $.each($.layout.config.allPanes, function (idx, pane) {- if (s[pane]) delete s[pane].children;- });- // update CURRENT layout-options with saved state data- $.extend(true, inst.options, s);--- if (1 === 1) return; // avoid compiler warning about unreachable code--console.data( stateData, 'loadState - stateData' );---- // add missing/default options- opts = $.extend({- animate: true- , children: false- }, opts );-- var vis, lo, co, sm, h, c, o, state // ,s- , childState, childOpts- , noAnimate = !opts.animate- , s_sm = "stateManagement"- ;-- /* WAS WORKING - TEMPORARILY DISABLED- *- * If layout has already been initialized, then UPDATE layout state- */- if (inst.state.initialized) {- $.each($.layout.config.borderPanes, function (idx, pane) {- state = inst.state[pane];- o = stateData[ pane ];- if (typeof o != 'object') return; // no key, continue- s = o.size;- c = o.initClosed;- h = o.initHidden;- vis = state.isVisible;- // reset autoResize- state.autoResize = o.autoResize;- // resize BEFORE opening- if (!vis)- inst._sizePane(pane, s, false, false, false); // false=skipCallback/noAnimation/forceResize- if (h === true) inst.hide(pane, noAnimate);- else if (c === false) inst.open (pane, false, noAnimate);- else if (c === true) inst.close(pane, false, noAnimate);- else if (h === false) inst.show (pane, false, noAnimate);- // resize AFTER any other actions- if (vis)- inst._sizePane(pane, s, false, false, noAnimate); // animate resize if option passed- });- };-- // TODO: Add recursion for child-layouts- /*- // if layout has already been initialized, then UPDATE layout state- if (inst.state.initialized) {- $.each( $.layout.config.borderPanes, resetLayout );- // TODO: Add recursion for child-layouts- if (opts.includeChildren) // || true- $.each($.layout.config.allPanes, function (idx, pane) {- if (children[pane])- resetLayout.call( children[pane] );- });- };-- function resetLayout (layout) {- var layout = this- , noAnimate = !opts.animate- , vis, state, o, s, h, c- ;- $.each($.layout.config.borderPanes, function (idx, pane) {- state = layout.state[pane];- o = stateData[ pane ];- if (typeof o != 'object') return; // no key, continue- s = o.size;- c = o.initClosed;- h = o.initHidden;- vis = state.isVisible;- // reset autoResize- state.autoResize = o.autoResize;- // resize BEFORE opening- if (!vis)- layout._sizePane(pane, s, false, false, false); // false=skipCallback/noAnimation/forceResize- if (h === true) layout.hide(pane, noAnimate);- else if (c === false) layout.open (pane, false, noAnimate);- else if (c === true) layout.close(pane, false, noAnimate);- else if (h === false) layout.show (pane, false, noAnimate);- // resize AFTER any other actions- if (vis)- layout._sizePane(pane, s, false, false, noAnimate); // animate resize if option passed- });- // reset autoResize- state.autoResize = o.autoResize;- // resize BEFORE opening- if (!vis)- layout._sizePane(pane, s, false, false, false); // false=skipCallback/noAnimation/forceResize- if (h === true) layout.hide(pane, noAnimate);- else if (c === false) layout.open (pane, false, noAnimate);- else if (c === true) layout.close(pane, false, noAnimate);- else if (h === false) layout.show (pane, false, noAnimate);- // resize AFTER any other actions- if (vis)- layout._sizePane(pane, s, false, false, noAnimate); // animate resize if option passed- };- */- }-- /**- * Get the *current layout state* and return it as a hash- *- * @param {Object=} inst // Layout instance to get state for- * @param {object=} [opts] // State-Managements override options- */-, readState: function (inst, opts) {- // backward compatility- if ($.type(opts) === 'string') opts = { keys: opts };- if (!opts) opts = {};- var sm = inst.options.stateManagement- , ic = opts.includeChildren- , recurse = ic !== undefined ? ic : sm.includeChildren- , keys = opts.stateKeys || sm.stateKeys- , alt = { isClosed: 'initClosed', isHidden: 'initHidden' }- , state = inst.state- , panes = $.layout.config.allPanes- , data = {}- , pair, pane, key, val- , ps, pC, child, array, count, branch- ;- if ($.isArray(keys)) keys = keys.join(",");- // convert keys to an array and change delimiters from '__' to '.'- keys = keys.replace(/__/g, ".").split(',');- // loop keys and create a data hash- for (var i=0, n=keys.length; i < n; i++) {- pair = keys[i].split(".");- pane = pair[0];- key = pair[1];- if ($.inArray(pane, panes) < 0) continue; // bad pane!- val = state[ pane ][ key ];- if (val == undefined) continue;- if (key=="isClosed" && state[pane]["isSliding"])- val = true; // if sliding, then *really* isClosed- ( data[pane] || (data[pane]={}) )[ alt[key] ? alt[key] : key ] = val;- }-- // recurse into the child-layouts for each pane- if (recurse) {- $.each(panes, function (idx, pane) {- pC = inst.children[pane];- ps = state.stateData[pane];- if ($.isPlainObject( pC ) && !$.isEmptyObject( pC )) {- // ensure a key exists for this 'pane', eg: branch = data.center- branch = data[pane] || (data[pane] = {});- if (!branch.children) branch.children = {};- $.each( pC, function (key, child) {- // ONLY read state from an initialize layout- if ( child.state.initialized )- branch.children[ key ] = $.layout.state.readState( child );- // if we have PREVIOUS (onLoad) state for this child-layout, KEEP IT!- else if ( ps && ps.children && ps.children[ key ] ) {- branch.children[ key ] = $.extend(true, {}, ps.children[ key ] );- }- });- }- });- }-- return data;- }-- /**- * Stringify a JSON hash so can save in a cookie or db-field- */-, encodeJSON: function (JSON) {- return parse(JSON);- function parse (h) {- var D=[], i=0, k, v, t // k = key, v = value- , a = $.isArray(h)- ;- for (k in h) {- v = h[k];- t = typeof v;- if (t == 'string') // STRING - add quotes- v = '"'+ v +'"';- else if (t == 'object') // SUB-KEY - recurse into it- v = parse(v);- D[i++] = (!a ? '"'+ k +'":' : '') + v;- }- return (a ? '[' : '{') + D.join(',') + (a ? ']' : '}');- };- }-- /**- * Convert stringified JSON back to a hash object- * @see $.parseJSON(), adding in jQuery 1.4.1- */-, decodeJSON: function (str) {- try { return $.parseJSON ? $.parseJSON(str) : window["eval"]("("+ str +")") || {}; }- catch (e) { return {}; }- }---, _create: function (inst) {- var _ = $.layout.state- , o = inst.options- , sm = o.stateManagement- ;- // ADD State-Management plugin methods to inst- $.extend( inst, {- // readCookie - update options from cookie - returns hash of cookie data- readCookie: function () { return _.readCookie(inst); }- // deleteCookie- , deleteCookie: function () { _.deleteCookie(inst); }- // saveCookie - optionally pass keys-list and cookie-options (hash)- , saveCookie: function (keys, cookieOpts) { return _.saveCookie(inst, keys, cookieOpts); }- // loadCookie - readCookie and use to loadState() - returns hash of cookie data- , loadCookie: function () { return _.loadCookie(inst); }- // loadState - pass a hash of state to use to update options- , loadState: function (stateData, animate) { _.loadState(inst, stateData, animate); }- // readState - returns hash of current layout-state- , readState: function (keys) { return _.readState(inst, keys); }- // add JSON utility methods too...- , encodeJSON: _.encodeJSON- , decodeJSON: _.decodeJSON- });-- // init state.stateData key, even if plugin is initially disabled- inst.state.stateData = {};-- // autoLoad MUST BE one of: data-array, data-hash, callback-function, or TRUE- if ( !sm.autoLoad ) return;-- // When state-data exists in the autoLoad key USE IT,- // even if stateManagement.enabled == false- if ($.isPlainObject( sm.autoLoad )) {- if (!$.isEmptyObject( sm.autoLoad )) {- inst.loadState( sm.autoLoad );- }- }- else if ( sm.enabled ) {- // update the options from cookie or callback- // if options is a function, call it to get stateData- if ($.isFunction( sm.autoLoad )) {- var d = {};- try {- d = sm.autoLoad( inst, inst.state, inst.options, inst.options.name || '' ); // try to get data from fn- } catch (e) {}- if (d && $.isPlainObject( d ) && !$.isEmptyObject( d ))- inst.loadState(d);- }- else // any other truthy value will trigger loadCookie- inst.loadCookie();- }- }--, _unload: function (inst) {- var sm = inst.options.stateManagement;- if (sm.enabled && sm.autoSave) {- // if options is a function, call it to save the stateData- if ($.isFunction( sm.autoSave )) {- try {- sm.autoSave( inst, inst.state, inst.options, inst.options.name || '' ); // try to get data from fn- } catch (e) {}- }- else // any truthy value will trigger saveCookie- inst.saveCookie();- }- }--};--// add state initialization method to Layout's onCreate array of functions-$.layout.onCreate.push( $.layout.state._create );-$.layout.onUnload.push( $.layout.state._unload );-----/**- * jquery.layout.buttons 1.0- * $Date: 2011-07-16 08:00:00 (Sat, 16 July 2011) $- *- * Copyright (c) 2012- * Kevin Dalman (http://allpro.net)- *- * Dual licensed under the GPL (http://www.gnu.org/licenses/gpl.html)- * and MIT (http://www.opensource.org/licenses/mit-license.php) licenses.- *- * @requires: UI Layout 1.3.0.rc30.1 or higher- *- * @see: http://groups.google.com/group/jquery-ui-layout- *- * Docs: [ to come ]- * Tips: [ to come ]- */--// tell Layout that the state plugin is available-$.layout.plugins.buttons = true;--// Add buttons options to layout.defaults-$.layout.defaults.autoBindCustomButtons = false;-// Specify autoBindCustomButtons as a layout-option, NOT a pane-option-$.layout.optionsMap.layout.push("autoBindCustomButtons");--/*- * Button methods- */-$.layout.buttons = {-- /**- * Searches for .ui-layout-button-xxx elements and auto-binds them as layout-buttons- *- * @see _create()- *- * @param {Object} inst Layout Instance object- */- init: function (inst) {- var pre = "ui-layout-button-"- , layout = inst.options.name || ""- , name;- $.each("toggle,open,close,pin,toggle-slide,open-slide".split(","), function (i, action) {- $.each($.layout.config.borderPanes, function (ii, pane) {- $("."+pre+action+"-"+pane).each(function(){- // if button was previously 'bound', data.layoutName was set, but is blank if layout has no 'name'- name = $(this).data("layoutName") || $(this).attr("layoutName");- if (name == undefined || name === layout)- inst.bindButton(this, action, pane);- });- });- });- }-- /**- * Helper function to validate params received by addButton utilities- *- * Two classes are added to the element, based on the buttonClass...- * The type of button is appended to create the 2nd className:- * - ui-layout-button-pin // action btnClass- * - ui-layout-button-pin-west // action btnClass + pane- * - ui-layout-button-toggle- * - ui-layout-button-open- * - ui-layout-button-close- *- * @param {Object} inst Layout Instance object- * @param {(string|!Object)} selector jQuery selector (or element) for button, eg: ".ui-layout-north .toggle-button"- * @param {string} pane Name of the pane the button is for: 'north', 'south', etc.- *- * @return {Array.<Object>} If both params valid, the element matching 'selector' in a jQuery wrapper - otherwise returns null- */-, get: function (inst, selector, pane, action) {- var $E = $(selector)- , o = inst.options- , err = o.errors.addButtonError- ;- if (!$E.length) { // element not found- $.layout.msg(err +" "+ o.errors.selector +": "+ selector, true);- }- else if ($.inArray(pane, $.layout.config.borderPanes) < 0) { // invalid 'pane' sepecified- $.layout.msg(err +" "+ o.errors.pane +": "+ pane, true);- $E = $(""); // NO BUTTON- }- else { // VALID- var btn = o[pane].buttonClass +"-"+ action;- $E .addClass( btn +" "+ btn +"-"+ pane )- .data("layoutName", o.name); // add layout identifier - even if blank!- }- return $E;- }--- /**- * NEW syntax for binding layout-buttons - will eventually replace addToggle, addOpen, etc.- *- * @param {Object} inst Layout Instance object- * @param {(string|!Object)} selector jQuery selector (or element) for button, eg: ".ui-layout-north .toggle-button"- * @param {string} action- * @param {string} pane- */-, bind: function (inst, selector, action, pane) {- var _ = $.layout.buttons;- switch (action.toLowerCase()) {- case "toggle": _.addToggle (inst, selector, pane); break;- case "open": _.addOpen (inst, selector, pane); break;- case "close": _.addClose (inst, selector, pane); break;- case "pin": _.addPin (inst, selector, pane); break;- case "toggle-slide": _.addToggle (inst, selector, pane, true); break;- case "open-slide": _.addOpen (inst, selector, pane, true); break;- }- return inst;- }-- /**- * Add a custom Toggler button for a pane- *- * @param {Object} inst Layout Instance object- * @param {(string|!Object)} selector jQuery selector (or element) for button, eg: ".ui-layout-north .toggle-button"- * @param {string} pane Name of the pane the button is for: 'north', 'south', etc.- * @param {boolean=} slide true = slide-open, false = pin-open- */-, addToggle: function (inst, selector, pane, slide) {- $.layout.buttons.get(inst, selector, pane, "toggle")- .click(function(evt){- inst.toggle(pane, !!slide);- evt.stopPropagation();- });- return inst;- }-- /**- * Add a custom Open button for a pane- *- * @param {Object} inst Layout Instance object- * @param {(string|!Object)} selector jQuery selector (or element) for button, eg: ".ui-layout-north .toggle-button"- * @param {string} pane Name of the pane the button is for: 'north', 'south', etc.- * @param {boolean=} slide true = slide-open, false = pin-open- */-, addOpen: function (inst, selector, pane, slide) {- $.layout.buttons.get(inst, selector, pane, "open")- .attr("title", inst.options[pane].tips.Open)- .click(function (evt) {- inst.open(pane, !!slide);- evt.stopPropagation();- });- return inst;- }-- /**- * Add a custom Close button for a pane- *- * @param {Object} inst Layout Instance object- * @param {(string|!Object)} selector jQuery selector (or element) for button, eg: ".ui-layout-north .toggle-button"- * @param {string} pane Name of the pane the button is for: 'north', 'south', etc.- */-, addClose: function (inst, selector, pane) {- $.layout.buttons.get(inst, selector, pane, "close")- .attr("title", inst.options[pane].tips.Close)- .click(function (evt) {- inst.close(pane);- evt.stopPropagation();- });- return inst;- }-- /**- * Add a custom Pin button for a pane- *- * Four classes are added to the element, based on the paneClass for the associated pane...- * Assuming the default paneClass and the pin is 'up', these classes are added for a west-pane pin:- * - ui-layout-pane-pin- * - ui-layout-pane-west-pin- * - ui-layout-pane-pin-up- * - ui-layout-pane-west-pin-up- *- * @param {Object} inst Layout Instance object- * @param {(string|!Object)} selector jQuery selector (or element) for button, eg: ".ui-layout-north .toggle-button"- * @param {string} pane Name of the pane the pin is for: 'north', 'south', etc.- */-, addPin: function (inst, selector, pane) {- var _ = $.layout.buttons- , $E = _.get(inst, selector, pane, "pin");- if ($E.length) {- var s = inst.state[pane];- $E.click(function (evt) {- _.setPinState(inst, $(this), pane, (s.isSliding || s.isClosed));- if (s.isSliding || s.isClosed) inst.open( pane ); // change from sliding to open- else inst.close( pane ); // slide-closed- evt.stopPropagation();- });- // add up/down pin attributes and classes- _.setPinState(inst, $E, pane, (!s.isClosed && !s.isSliding));- // add this pin to the pane data so we can 'sync it' automatically- // PANE.pins key is an array so we can store multiple pins for each pane- s.pins.push( selector ); // just save the selector string- }- return inst;- }-- /**- * Change the class of the pin button to make it look 'up' or 'down'- *- * @see addPin(), syncPins()- *- * @param {Object} inst Layout Instance object- * @param {Array.<Object>} $Pin The pin-span element in a jQuery wrapper- * @param {string} pane These are the params returned to callbacks by layout()- * @param {boolean} doPin true = set the pin 'down', false = set it 'up'- */-, setPinState: function (inst, $Pin, pane, doPin) {- var updown = $Pin.attr("pin");- if (updown && doPin === (updown=="down")) return; // already in correct state- var- o = inst.options[pane]- , pin = o.buttonClass +"-pin"- , side = pin +"-"+ pane- , UP = pin +"-up "+ side +"-up"- , DN = pin +"-down "+side +"-down"- ;- $Pin- .attr("pin", doPin ? "down" : "up") // logic- .attr("title", doPin ? o.tips.Unpin : o.tips.Pin)- .removeClass( doPin ? UP : DN )- .addClass( doPin ? DN : UP )- ;- }-- /**- * INTERNAL function to sync 'pin buttons' when pane is opened or closed- * Unpinned means the pane is 'sliding' - ie, over-top of the adjacent panes- *- * @see open(), close()- *- * @param {Object} inst Layout Instance object- * @param {string} pane These are the params returned to callbacks by layout()- * @param {boolean} doPin True means set the pin 'down', False means 'up'- */-, syncPinBtns: function (inst, pane, doPin) {- // REAL METHOD IS _INSIDE_ LAYOUT - THIS IS HERE JUST FOR REFERENCE- $.each(inst.state[pane].pins, function (i, selector) {- $.layout.buttons.setPinState(inst, $(selector), pane, doPin);- });- }---, _load: function (inst) {- var _ = $.layout.buttons;- // ADD Button methods to Layout Instance- // Note: sel = jQuery Selector string- $.extend( inst, {- bindButton: function (sel, action, pane) { return _.bind(inst, sel, action, pane); }- // DEPRECATED METHODS- , addToggleBtn: function (sel, pane, slide) { return _.addToggle(inst, sel, pane, slide); }- , addOpenBtn: function (sel, pane, slide) { return _.addOpen(inst, sel, pane, slide); }- , addCloseBtn: function (sel, pane) { return _.addClose(inst, sel, pane); }- , addPinBtn: function (sel, pane) { return _.addPin(inst, sel, pane); }- });-- // init state array to hold pin-buttons- for (var i=0; i<4; i++) {- var pane = $.layout.config.borderPanes[i];- inst.state[pane].pins = [];- }-- // auto-init buttons onLoad if option is enabled- if ( inst.options.autoBindCustomButtons )- _.init(inst);- }--, _unload: function (inst) {- // TODO: unbind all buttons???- }--};--// add initialization method to Layout's onLoad array of functions-$.layout.onLoad.push( $.layout.buttons._load );-//$.layout.onUnload.push( $.layout.buttons._unload );----/**- * jquery.layout.browserZoom 1.0- * $Date: 2011-12-29 08:00:00 (Thu, 29 Dec 2011) $- *- * Copyright (c) 2012- * Kevin Dalman (http://allpro.net)- *- * Dual licensed under the GPL (http://www.gnu.org/licenses/gpl.html)- * and MIT (http://www.opensource.org/licenses/mit-license.php) licenses.- *- * @requires: UI Layout 1.3.0.rc30.1 or higher- *- * @see: http://groups.google.com/group/jquery-ui-layout- *- * TODO: Extend logic to handle other problematic zooming in browsers- * TODO: Add hotkey/mousewheel bindings to _instantly_ respond to these zoom event- */--// tell Layout that the plugin is available-$.layout.plugins.browserZoom = true;--$.layout.defaults.browserZoomCheckInterval = 1000;-$.layout.optionsMap.layout.push("browserZoomCheckInterval");--/*- * browserZoom methods- */-$.layout.browserZoom = {-- _init: function (inst) {- // abort if browser does not need this check- if ($.layout.browserZoom.ratio() !== false)- $.layout.browserZoom._setTimer(inst);- }--, _setTimer: function (inst) {- // abort if layout destroyed or browser does not need this check- if (inst.destroyed) return;- var o = inst.options- , s = inst.state- // don't need check if inst has parentLayout, but check occassionally in case parent destroyed!- // MINIMUM 100ms interval, for performance- , ms = inst.hasParentLayout ? 5000 : Math.max( o.browserZoomCheckInterval, 100 )- ;- // set the timer- setTimeout(function(){- if (inst.destroyed || !o.resizeWithWindow) return;- var d = $.layout.browserZoom.ratio();- if (d !== s.browserZoom) {- s.browserZoom = d;- inst.resizeAll();- }- // set a NEW timeout- $.layout.browserZoom._setTimer(inst);- }- , ms );- }--, ratio: function () {- var w = window- , s = screen- , d = document- , dE = d.documentElement || d.body- , b = $.layout.browser- , v = b.version- , r, sW, cW- ;- // we can ignore all browsers that fire window.resize event onZoom- if ((b.msie && v > 8)- || !b.msie- ) return false; // don't need to track zoom-- if (s.deviceXDPI && s.systemXDPI) // syntax compiler hack- return calc(s.deviceXDPI, s.systemXDPI);- // everything below is just for future reference!- if (b.webkit && (r = d.body.getBoundingClientRect))- return calc((r.left - r.right), d.body.offsetWidth);- if (b.webkit && (sW = w.outerWidth))- return calc(sW, w.innerWidth);- if ((sW = s.width) && (cW = dE.clientWidth))- return calc(sW, cW);- return false; // no match, so cannot - or don't need to - track zoom-- function calc (x,y) { return (parseInt(x,10) / parseInt(y,10) * 100).toFixed(); }- }--};-// add initialization method to Layout's onLoad array of functions-$.layout.onReady.push( $.layout.browserZoom._init );---})( jQuery );\ No newline at end of filediff --git a/data/libs/jqueryui/MIT-LICENSE.txt b/data/libs/jqueryui/MIT-LICENSE.txtnew file mode 100644index 000000000..741585591--- /dev/null+++ b/data/libs/jqueryui/MIT-LICENSE.txt@@ -0,0 +1,26 @@+Copyright 2012 jQuery Foundation and other contributors,+http://jqueryui.com/++This software consists of voluntary contributions made by many+individuals (AUTHORS.txt, http://jqueryui.com/about) For exact+contribution history, see the revision history and logs, available+at http://jquery-ui.googlecode.com/svn/++Permission is hereby granted, free of charge, to any person obtaining+a copy of this software and associated documentation files (the+"Software"), to deal in the Software without restriction, including+without limitation the rights to use, copy, modify, merge, publish,+distribute, sublicense, and/or sell copies of the Software, and to+permit persons to whom the Software is furnished to do so, subject to+the following conditions:++The above copyright notice and this permission notice shall be+included in all copies or substantial portions of the Software.++THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND+NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE+LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION+WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.diff --git a/data/libs/jquery/custom-theme/images/ui-bg_flat_0_aaaaaa_40x100.png b/data/libs/jqueryui/custom-theme/images/ui-bg_flat_0_aaaaaa_40x100.pngsimilarity index 100%rename from data/libs/jquery/custom-theme/images/ui-bg_flat_0_aaaaaa_40x100.pngrename to data/libs/jqueryui/custom-theme/images/ui-bg_flat_0_aaaaaa_40x100.pngdiff --git a/data/libs/jquery/custom-theme/images/ui-bg_flat_75_00ae00_40x100.png b/data/libs/jqueryui/custom-theme/images/ui-bg_flat_75_00ae00_40x100.pngsimilarity index 100%rename from data/libs/jquery/custom-theme/images/ui-bg_flat_75_00ae00_40x100.pngrename to data/libs/jqueryui/custom-theme/images/ui-bg_flat_75_00ae00_40x100.pngdiff --git a/data/libs/jquery/custom-theme/images/ui-bg_flat_75_ffffff_40x100.png b/data/libs/jqueryui/custom-theme/images/ui-bg_flat_75_ffffff_40x100.pngsimilarity index 100%rename from data/libs/jquery/custom-theme/images/ui-bg_flat_75_ffffff_40x100.pngrename to data/libs/jqueryui/custom-theme/images/ui-bg_flat_75_ffffff_40x100.pngdiff --git a/data/libs/jquery/custom-theme/images/ui-bg_flat_80_aaaaaa_40x100.png b/data/libs/jqueryui/custom-theme/images/ui-bg_flat_80_aaaaaa_40x100.pngsimilarity index 100%rename from data/libs/jquery/custom-theme/images/ui-bg_flat_80_aaaaaa_40x100.pngrename to data/libs/jqueryui/custom-theme/images/ui-bg_flat_80_aaaaaa_40x100.pngdiff --git a/data/libs/jquery/custom-theme/images/ui-bg_glass_55_fbf9ee_1x400.png b/data/libs/jqueryui/custom-theme/images/ui-bg_glass_55_fbf9ee_1x400.pngsimilarity index 100%rename from data/libs/jquery/custom-theme/images/ui-bg_glass_55_fbf9ee_1x400.pngrename to data/libs/jqueryui/custom-theme/images/ui-bg_glass_55_fbf9ee_1x400.pngdiff --git a/data/libs/jquery/custom-theme/images/ui-bg_glass_65_ffffff_1x400.png b/data/libs/jqueryui/custom-theme/images/ui-bg_glass_65_ffffff_1x400.pngsimilarity index 100%rename from data/libs/jquery/custom-theme/images/ui-bg_glass_65_ffffff_1x400.pngrename to data/libs/jqueryui/custom-theme/images/ui-bg_glass_65_ffffff_1x400.pngdiff --git a/data/libs/jquery/custom-theme/images/ui-bg_glass_75_dadada_1x400.png b/data/libs/jqueryui/custom-theme/images/ui-bg_glass_75_dadada_1x400.pngsimilarity index 100%rename from data/libs/jquery/custom-theme/images/ui-bg_glass_75_dadada_1x400.pngrename to data/libs/jqueryui/custom-theme/images/ui-bg_glass_75_dadada_1x400.pngdiff --git a/data/libs/jquery/custom-theme/images/ui-bg_glass_75_e6e6e6_1x400.png b/data/libs/jqueryui/custom-theme/images/ui-bg_glass_75_e6e6e6_1x400.pngsimilarity index 100%rename from data/libs/jquery/custom-theme/images/ui-bg_glass_75_e6e6e6_1x400.pngrename to data/libs/jqueryui/custom-theme/images/ui-bg_glass_75_e6e6e6_1x400.pngdiff --git a/data/libs/jquery/custom-theme/images/ui-bg_glass_95_fef1ec_1x400.png b/data/libs/jqueryui/custom-theme/images/ui-bg_glass_95_fef1ec_1x400.pngsimilarity index 100%rename from data/libs/jquery/custom-theme/images/ui-bg_glass_95_fef1ec_1x400.pngrename to data/libs/jqueryui/custom-theme/images/ui-bg_glass_95_fef1ec_1x400.pngdiff --git a/data/libs/jquery/custom-theme/images/ui-bg_highlight-soft_75_cccccc_1x100.png b/data/libs/jqueryui/custom-theme/images/ui-bg_highlight-soft_75_cccccc_1x100.pngsimilarity index 100%rename from data/libs/jquery/custom-theme/images/ui-bg_highlight-soft_75_cccccc_1x100.pngrename to data/libs/jqueryui/custom-theme/images/ui-bg_highlight-soft_75_cccccc_1x100.pngdiff --git a/data/libs/jquery/custom-theme/images/ui-icons_222222_256x240.png b/data/libs/jqueryui/custom-theme/images/ui-icons_222222_256x240.pngsimilarity index 100%rename from data/libs/jquery/custom-theme/images/ui-icons_222222_256x240.pngrename to data/libs/jqueryui/custom-theme/images/ui-icons_222222_256x240.pngdiff --git a/data/libs/jquery/custom-theme/images/ui-icons_2e83ff_256x240.png b/data/libs/jqueryui/custom-theme/images/ui-icons_2e83ff_256x240.pngsimilarity index 100%rename from data/libs/jquery/custom-theme/images/ui-icons_2e83ff_256x240.pngrename to data/libs/jqueryui/custom-theme/images/ui-icons_2e83ff_256x240.pngdiff --git a/data/libs/jquery/custom-theme/images/ui-icons_454545_256x240.png b/data/libs/jqueryui/custom-theme/images/ui-icons_454545_256x240.pngsimilarity index 100%rename from data/libs/jquery/custom-theme/images/ui-icons_454545_256x240.pngrename to data/libs/jqueryui/custom-theme/images/ui-icons_454545_256x240.pngdiff --git a/data/libs/jquery/custom-theme/images/ui-icons_888888_256x240.png b/data/libs/jqueryui/custom-theme/images/ui-icons_888888_256x240.pngsimilarity index 100%rename from data/libs/jquery/custom-theme/images/ui-icons_888888_256x240.pngrename to data/libs/jqueryui/custom-theme/images/ui-icons_888888_256x240.pngdiff --git a/data/libs/jquery/custom-theme/images/ui-icons_cd0a0a_256x240.png b/data/libs/jqueryui/custom-theme/images/ui-icons_cd0a0a_256x240.pngsimilarity index 100%rename from data/libs/jquery/custom-theme/images/ui-icons_cd0a0a_256x240.pngrename to data/libs/jqueryui/custom-theme/images/ui-icons_cd0a0a_256x240.pngdiff --git a/data/libs/jquery/custom-theme/jquery-ui-1.9.0.custom.css b/data/libs/jqueryui/custom-theme/jquery-ui-1.9.0.custom.csssimilarity index 100%rename from data/libs/jquery/custom-theme/jquery-ui-1.9.0.custom.cssrename to data/libs/jqueryui/custom-theme/jquery-ui-1.9.0.custom.cssdiff --git a/data/libs/jquery/custom-theme/jquery-ui-1.9.0.custom.min.css b/data/libs/jqueryui/custom-theme/jquery-ui-1.9.0.custom.min.csssimilarity index 100%rename from data/libs/jquery/custom-theme/jquery-ui-1.9.0.custom.min.cssrename to data/libs/jqueryui/custom-theme/jquery-ui-1.9.0.custom.min.cssdiff --git a/data/libs/jquery/custom-theme/jquery-ui-1.9.1.custom.css b/data/libs/jqueryui/custom-theme/jquery-ui-1.9.1.custom.csssimilarity index 100%rename from data/libs/jquery/custom-theme/jquery-ui-1.9.1.custom.cssrename to data/libs/jqueryui/custom-theme/jquery-ui-1.9.1.custom.cssdiff --git a/data/libs/jquery/custom-theme/jquery-ui-1.9.1.custom.min.css b/data/libs/jqueryui/custom-theme/jquery-ui-1.9.1.custom.min.csssimilarity index 100%rename from data/libs/jquery/custom-theme/jquery-ui-1.9.1.custom.min.cssrename to data/libs/jqueryui/custom-theme/jquery-ui-1.9.1.custom.min.cssdiff --git a/data/libs/jquery/custom-theme/themedesignerParams.txt b/data/libs/jqueryui/custom-theme/themedesignerParams.txtsimilarity index 100%rename from data/libs/jquery/custom-theme/themedesignerParams.txtrename to data/libs/jqueryui/custom-theme/themedesignerParams.txtdiff --git a/data/libs/jqueryui/jquery-ui-1.9.2.custom.min.js b/data/libs/jqueryui/jquery-ui-1.9.2.custom.min.jsnew file mode 100644index 000000000..9b3b84deb--- /dev/null+++ b/data/libs/jqueryui/jquery-ui-1.9.2.custom.min.js@@ -0,0 +1,6 @@+/*! jQuery UI - v1.9.2 - 2012-11-23+* 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 (c) 2012 jQuery Foundation and other contributors Licensed MIT */++(function(e,t){function i(t,n){var r,i,o,u=t.nodeName.toLowerCase();return"area"===u?(r=t.parentNode,i=r.name,!t.href||!i||r.nodeName.toLowerCase()!=="map"?!1:(o=e("img[usemap=#"+i+"]")[0],!!o&&s(o))):(/input|select|textarea|button|object/.test(u)?!t.disabled:"a"===u?t.href||n:n)&&s(t)}function s(t){return e.expr.filters.visible(t)&&!e(t).parents().andSelf().filter(function(){return e.css(this,"visibility")==="hidden"}).length}var n=0,r=/^ui-id-\d+$/;e.ui=e.ui||{};if(e.ui.version)return;e.extend(e.ui,{version:"1.9.2",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:e.fn.focus,focus:function(t,n){return typeof t=="number"?this.each(function(){var r=this;setTimeout(function(){e(r).focus(),n&&n.call(r)},t)}):this._focus.apply(this,arguments)},scrollParent:function(){var t;return e.ui.ie&&/(static|relative)/.test(this.css("position"))||/absolute/.test(this.css("position"))?t=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):t=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(n){if(n!==t)return this.css("zIndex",n);if(this.length){var r=e(this[0]),i,s;while(r.length&&r[0]!==document){i=r.css("position");if(i==="absolute"||i==="relative"||i==="fixed"){s=parseInt(r.css("zIndex"),10);if(!isNaN(s)&&s!==0)return s}r=r.parent()}}return 0},uniqueId:function(){return this.each(function(){this.id||(this.id="ui-id-"+ ++n)})},removeUniqueId:function(){return this.each(function(){r.test(this.id)&&e(this).removeAttr("id")})}}),e.extend(e.expr[":"],{data:e.expr.createPseudo?e.expr.createPseudo(function(t){return function(n){return!!e.data(n,t)}}):function(t,n,r){return!!e.data(t,r[3])},focusable:function(t){return i(t,!isNaN(e.attr(t,"tabindex")))},tabbable:function(t){var n=e.attr(t,"tabindex"),r=isNaN(n);return(r||n>=0)&&i(t,!r)}}),e(function(){var t=document.body,n=t.appendChild(n=document.createElement("div"));n.offsetHeight,e.extend(n.style,{minHeight:"100px",height:"auto",padding:0,borderWidth:0}),e.support.minHeight=n.offsetHeight===100,e.support.selectstart="onselectstart"in n,t.removeChild(n).style.display="none"}),e("<a>").outerWidth(1).jquery||e.each(["Width","Height"],function(n,r){function u(t,n,r,s){return e.each(i,function(){n-=parseFloat(e.css(t,"padding"+this))||0,r&&(n-=parseFloat(e.css(t,"border"+this+"Width"))||0),s&&(n-=parseFloat(e.css(t,"margin"+this))||0)}),n}var i=r==="Width"?["Left","Right"]:["Top","Bottom"],s=r.toLowerCase(),o={innerWidth:e.fn.innerWidth,innerHeight:e.fn.innerHeight,outerWidth:e.fn.outerWidth,outerHeight:e.fn.outerHeight};e.fn["inner"+r]=function(n){return n===t?o["inner"+r].call(this):this.each(function(){e(this).css(s,u(this,n)+"px")})},e.fn["outer"+r]=function(t,n){return typeof t!="number"?o["outer"+r].call(this,t):this.each(function(){e(this).css(s,u(this,t,!0,n)+"px")})}}),e("<a>").data("a-b","a").removeData("a-b").data("a-b")&&(e.fn.removeData=function(t){return function(n){return arguments.length?t.call(this,e.camelCase(n)):t.call(this)}}(e.fn.removeData)),function(){var t=/msie ([\w.]+)/.exec(navigator.userAgent.toLowerCase())||[];e.ui.ie=t.length?!0:!1,e.ui.ie6=parseFloat(t[1],10)===6}(),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,n,r){var i,s=e.ui[t].prototype;for(i in r)s.plugins[i]=s.plugins[i]||[],s.plugins[i].push([n,r[i]])},call:function(e,t,n){var r,i=e.plugins[t];if(!i||!e.element[0].parentNode||e.element[0].parentNode.nodeType===11)return;for(r=0;r<i.length;r++)e.options[i[r][0]]&&i[r][1].apply(e.element,n)}},contains:e.contains,hasScroll:function(t,n){if(e(t).css("overflow")==="hidden")return!1;var r=n&&n==="left"?"scrollLeft":"scrollTop",i=!1;return t[r]>0?!0:(t[r]=1,i=t[r]>0,t[r]=0,i)},isOverAxis:function(e,t,n){return e>t&&e<t+n},isOver:function(t,n,r,i,s,o){return e.ui.isOverAxis(t,r,s)&&e.ui.isOverAxis(n,i,o)}})})(jQuery);(function(e,t){var n=0,r=Array.prototype.slice,i=e.cleanData;e.cleanData=function(t){for(var n=0,r;(r=t[n])!=null;n++)try{e(r).triggerHandler("remove")}catch(s){}i(t)},e.widget=function(t,n,r){var i,s,o,u,a=t.split(".")[0];t=t.split(".")[1],i=a+"-"+t,r||(r=n,n=e.Widget),e.expr[":"][i.toLowerCase()]=function(t){return!!e.data(t,i)},e[a]=e[a]||{},s=e[a][t],o=e[a][t]=function(e,t){if(!this._createWidget)return new o(e,t);arguments.length&&this._createWidget(e,t)},e.extend(o,s,{version:r.version,_proto:e.extend({},r),_childConstructors:[]}),u=new n,u.options=e.widget.extend({},u.options),e.each(r,function(t,i){e.isFunction(i)&&(r[t]=function(){var e=function(){return n.prototype[t].apply(this,arguments)},r=function(e){return n.prototype[t].apply(this,e)};return function(){var t=this._super,n=this._superApply,s;return this._super=e,this._superApply=r,s=i.apply(this,arguments),this._super=t,this._superApply=n,s}}())}),o.prototype=e.widget.extend(u,{widgetEventPrefix:s?u.widgetEventPrefix:t},r,{constructor:o,namespace:a,widgetName:t,widgetBaseClass:i,widgetFullName:i}),s?(e.each(s._childConstructors,function(t,n){var r=n.prototype;e.widget(r.namespace+"."+r.widgetName,o,n._proto)}),delete s._childConstructors):n._childConstructors.push(o),e.widget.bridge(t,o)},e.widget.extend=function(n){var i=r.call(arguments,1),s=0,o=i.length,u,a;for(;s<o;s++)for(u in i[s])a=i[s][u],i[s].hasOwnProperty(u)&&a!==t&&(e.isPlainObject(a)?n[u]=e.isPlainObject(n[u])?e.widget.extend({},n[u],a):e.widget.extend({},a):n[u]=a);return n},e.widget.bridge=function(n,i){var s=i.prototype.widgetFullName||n;e.fn[n]=function(o){var u=typeof o=="string",a=r.call(arguments,1),f=this;return o=!u&&a.length?e.widget.extend.apply(null,[o].concat(a)):o,u?this.each(function(){var r,i=e.data(this,s);if(!i)return e.error("cannot call methods on "+n+" prior to initialization; "+"attempted to call method '"+o+"'");if(!e.isFunction(i[o])||o.charAt(0)==="_")return e.error("no such method '"+o+"' for "+n+" widget instance");r=i[o].apply(i,a);if(r!==i&&r!==t)return f=r&&r.jquery?f.pushStack(r.get()):r,!1}):this.each(function(){var t=e.data(this,s);t?t.option(o||{})._init():e.data(this,s,new i(o,this))}),f}},e.Widget=function(){},e.Widget._childConstructors=[],e.Widget.prototype={widgetName:"widget",widgetEventPrefix:"",defaultElement:"<div>",options:{disabled:!1,create:null},_createWidget:function(t,r){r=e(r||this.defaultElement||this)[0],this.element=e(r),this.uuid=n++,this.eventNamespace="."+this.widgetName+this.uuid,this.options=e.widget.extend({},this.options,this._getCreateOptions(),t),this.bindings=e(),this.hoverable=e(),this.focusable=e(),r!==this&&(e.data(r,this.widgetName,this),e.data(r,this.widgetFullName,this),this._on(!0,this.element,{remove:function(e){e.target===r&&this.destroy()}}),this.document=e(r.style?r.ownerDocument:r.document||r),this.window=e(this.document[0].defaultView||this.document[0].parentWindow)),this._create(),this._trigger("create",null,this._getCreateEventData()),this._init()},_getCreateOptions:e.noop,_getCreateEventData:e.noop,_create:e.noop,_init:e.noop,destroy:function(){this._destroy(),this.element.unbind(this.eventNamespace).removeData(this.widgetName).removeData(this.widgetFullName).removeData(e.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:e.noop,widget:function(){return this.element},option:function(n,r){var i=n,s,o,u;if(arguments.length===0)return e.widget.extend({},this.options);if(typeof n=="string"){i={},s=n.split("."),n=s.shift();if(s.length){o=i[n]=e.widget.extend({},this.options[n]);for(u=0;u<s.length-1;u++)o[s[u]]=o[s[u]]||{},o=o[s[u]];n=s.pop();if(r===t)return o[n]===t?null:o[n];o[n]=r}else{if(r===t)return this.options[n]===t?null:this.options[n];i[n]=r}}return this._setOptions(i),this},_setOptions:function(e){var t;for(t in e)this._setOption(t,e[t]);return this},_setOption:function(e,t){return this.options[e]=t,e==="disabled"&&(this.widget().toggleClass(this.widgetFullName+"-disabled ui-state-disabled",!!t).attr("aria-disabled",t),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(t,n,r){var i,s=this;typeof t!="boolean"&&(r=n,n=t,t=!1),r?(n=i=e(n),this.bindings=this.bindings.add(n)):(r=n,n=this.element,i=this.widget()),e.each(r,function(r,o){function u(){if(!t&&(s.options.disabled===!0||e(this).hasClass("ui-state-disabled")))return;return(typeof o=="string"?s[o]:o).apply(s,arguments)}typeof o!="string"&&(u.guid=o.guid=o.guid||u.guid||e.guid++);var a=r.match(/^(\w+)\s*(.*)$/),f=a[1]+s.eventNamespace,l=a[2];l?i.delegate(l,f,u):n.bind(f,u)})},_off:function(e,t){t=(t||"").split(" ").join(this.eventNamespace+" ")+this.eventNamespace,e.unbind(t).undelegate(t)},_delay:function(e,t){function n(){return(typeof e=="string"?r[e]:e).apply(r,arguments)}var r=this;return setTimeout(n,t||0)},_hoverable:function(t){this.hoverable=this.hoverable.add(t),this._on(t,{mouseenter:function(t){e(t.currentTarget).addClass("ui-state-hover")},mouseleave:function(t){e(t.currentTarget).removeClass("ui-state-hover")}})},_focusable:function(t){this.focusable=this.focusable.add(t),this._on(t,{focusin:function(t){e(t.currentTarget).addClass("ui-state-focus")},focusout:function(t){e(t.currentTarget).removeClass("ui-state-focus")}})},_trigger:function(t,n,r){var i,s,o=this.options[t];r=r||{},n=e.Event(n),n.type=(t===this.widgetEventPrefix?t:this.widgetEventPrefix+t).toLowerCase(),n.target=this.element[0],s=n.originalEvent;if(s)for(i in s)i in n||(n[i]=s[i]);return this.element.trigger(n,r),!(e.isFunction(o)&&o.apply(this.element[0],[n].concat(r))===!1||n.isDefaultPrevented())}},e.each({show:"fadeIn",hide:"fadeOut"},function(t,n){e.Widget.prototype["_"+t]=function(r,i,s){typeof i=="string"&&(i={effect:i});var o,u=i?i===!0||typeof i=="number"?n:i.effect||n:t;i=i||{},typeof i=="number"&&(i={duration:i}),o=!e.isEmptyObject(i),i.complete=s,i.delay&&r.delay(i.delay),o&&e.effects&&(e.effects.effect[u]||e.uiBackCompat!==!1&&e.effects[u])?r[t](i):u!==t&&r[u]?r[u](i.duration,i.easing,s):r.queue(function(n){e(this)[t](),s&&s.call(r[0]),n()})}}),e.uiBackCompat!==!1&&(e.Widget.prototype._getCreateOptions=function(){return e.metadata&&e.metadata.get(this.element[0])[this.widgetName]})})(jQuery);(function(e,t){var n=!1;e(document).mouseup(function(e){n=!1}),e.widget("ui.mouse",{version:"1.9.2",options:{cancel:"input,textarea,button,select,option",distance:1,delay:0},_mouseInit:function(){var t=this;this.element.bind("mousedown."+this.widgetName,function(e){return t._mouseDown(e)}).bind("click."+this.widgetName,function(n){if(!0===e.data(n.target,t.widgetName+".preventClickEvent"))return e.removeData(n.target,t.widgetName+".preventClickEvent"),n.stopImmediatePropagation(),!1}),this.started=!1},_mouseDestroy:function(){this.element.unbind("."+this.widgetName),this._mouseMoveDelegate&&e(document).unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate)},_mouseDown:function(t){if(n)return;this._mouseStarted&&this._mouseUp(t),this._mouseDownEvent=t;var r=this,i=t.which===1,s=typeof this.options.cancel=="string"&&t.target.nodeName?e(t.target).closest(this.options.cancel).length:!1;if(!i||s||!this._mouseCapture(t))return!0;this.mouseDelayMet=!this.options.delay,this.mouseDelayMet||(this._mouseDelayTimer=setTimeout(function(){r.mouseDelayMet=!0},this.options.delay));if(this._mouseDistanceMet(t)&&this._mouseDelayMet(t)){this._mouseStarted=this._mouseStart(t)!==!1;if(!this._mouseStarted)return t.preventDefault(),!0}return!0===e.data(t.target,this.widgetName+".preventClickEvent")&&e.removeData(t.target,this.widgetName+".preventClickEvent"),this._mouseMoveDelegate=function(e){return r._mouseMove(e)},this._mouseUpDelegate=function(e){return r._mouseUp(e)},e(document).bind("mousemove."+this.widgetName,this._mouseMoveDelegate).bind("mouseup."+this.widgetName,this._mouseUpDelegate),t.preventDefault(),n=!0,!0},_mouseMove:function(t){return!e.ui.ie||document.documentMode>=9||!!t.button?this._mouseStarted?(this._mouseDrag(t),t.preventDefault()):(this._mouseDistanceMet(t)&&this._mouseDelayMet(t)&&(this._mouseStarted=this._mouseStart(this._mouseDownEvent,t)!==!1,this._mouseStarted?this._mouseDrag(t):this._mouseUp(t)),!this._mouseStarted):this._mouseUp(t)},_mouseUp:function(t){return e(document).unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate),this._mouseStarted&&(this._mouseStarted=!1,t.target===this._mouseDownEvent.target&&e.data(t.target,this.widgetName+".preventClickEvent",!0),this._mouseStop(t)),!1},_mouseDistanceMet:function(e){return Math.max(Math.abs(this._mouseDownEvent.pageX-e.pageX),Math.abs(this._mouseDownEvent.pageY-e.pageY))>=this.options.distance},_mouseDelayMet:function(e){return this.mouseDelayMet},_mouseStart:function(e){},_mouseDrag:function(e){},_mouseStop:function(e){},_mouseCapture:function(e){return!0}})})(jQuery);(function(e,t){function h(e,t,n){return[parseInt(e[0],10)*(l.test(e[0])?t/100:1),parseInt(e[1],10)*(l.test(e[1])?n/100:1)]}function p(t,n){return parseInt(e.css(t,n),10)||0}e.ui=e.ui||{};var n,r=Math.max,i=Math.abs,s=Math.round,o=/left|center|right/,u=/top|center|bottom/,a=/[\+\-]\d+%?/,f=/^\w+/,l=/%$/,c=e.fn.position;e.position={scrollbarWidth:function(){if(n!==t)return n;var r,i,s=e("<div style='display:block;width:50px;height:50px;overflow:hidden;'><div style='height:100px;width:auto;'></div></div>"),o=s.children()[0];return e("body").append(s),r=o.offsetWidth,s.css("overflow","scroll"),i=o.offsetWidth,r===i&&(i=s[0].clientWidth),s.remove(),n=r-i},getScrollInfo:function(t){var n=t.isWindow?"":t.element.css("overflow-x"),r=t.isWindow?"":t.element.css("overflow-y"),i=n==="scroll"||n==="auto"&&t.width<t.element[0].scrollWidth,s=r==="scroll"||r==="auto"&&t.height<t.element[0].scrollHeight;return{width:i?e.position.scrollbarWidth():0,height:s?e.position.scrollbarWidth():0}},getWithinInfo:function(t){var n=e(t||window),r=e.isWindow(n[0]);return{element:n,isWindow:r,offset:n.offset()||{left:0,top:0},scrollLeft:n.scrollLeft(),scrollTop:n.scrollTop(),width:r?n.width():n.outerWidth(),height:r?n.height():n.outerHeight()}}},e.fn.position=function(t){if(!t||!t.of)return c.apply(this,arguments);t=e.extend({},t);var n,l,d,v,m,g=e(t.of),y=e.position.getWithinInfo(t.within),b=e.position.getScrollInfo(y),w=g[0],E=(t.collision||"flip").split(" "),S={};return w.nodeType===9?(l=g.width(),d=g.height(),v={top:0,left:0}):e.isWindow(w)?(l=g.width(),d=g.height(),v={top:g.scrollTop(),left:g.scrollLeft()}):w.preventDefault?(t.at="left top",l=d=0,v={top:w.pageY,left:w.pageX}):(l=g.outerWidth(),d=g.outerHeight(),v=g.offset()),m=e.extend({},v),e.each(["my","at"],function(){var e=(t[this]||"").split(" "),n,r;e.length===1&&(e=o.test(e[0])?e.concat(["center"]):u.test(e[0])?["center"].concat(e):["center","center"]),e[0]=o.test(e[0])?e[0]:"center",e[1]=u.test(e[1])?e[1]:"center",n=a.exec(e[0]),r=a.exec(e[1]),S[this]=[n?n[0]:0,r?r[0]:0],t[this]=[f.exec(e[0])[0],f.exec(e[1])[0]]}),E.length===1&&(E[1]=E[0]),t.at[0]==="right"?m.left+=l:t.at[0]==="center"&&(m.left+=l/2),t.at[1]==="bottom"?m.top+=d:t.at[1]==="center"&&(m.top+=d/2),n=h(S.at,l,d),m.left+=n[0],m.top+=n[1],this.each(function(){var o,u,a=e(this),f=a.outerWidth(),c=a.outerHeight(),w=p(this,"marginLeft"),x=p(this,"marginTop"),T=f+w+p(this,"marginRight")+b.width,N=c+x+p(this,"marginBottom")+b.height,C=e.extend({},m),k=h(S.my,a.outerWidth(),a.outerHeight());t.my[0]==="right"?C.left-=f:t.my[0]==="center"&&(C.left-=f/2),t.my[1]==="bottom"?C.top-=c:t.my[1]==="center"&&(C.top-=c/2),C.left+=k[0],C.top+=k[1],e.support.offsetFractions||(C.left=s(C.left),C.top=s(C.top)),o={marginLeft:w,marginTop:x},e.each(["left","top"],function(r,i){e.ui.position[E[r]]&&e.ui.position[E[r]][i](C,{targetWidth:l,targetHeight:d,elemWidth:f,elemHeight:c,collisionPosition:o,collisionWidth:T,collisionHeight:N,offset:[n[0]+k[0],n[1]+k[1]],my:t.my,at:t.at,within:y,elem:a})}),e.fn.bgiframe&&a.bgiframe(),t.using&&(u=function(e){var n=v.left-C.left,s=n+l-f,o=v.top-C.top,u=o+d-c,h={target:{element:g,left:v.left,top:v.top,width:l,height:d},element:{element:a,left:C.left,top:C.top,width:f,height:c},horizontal:s<0?"left":n>0?"right":"center",vertical:u<0?"top":o>0?"bottom":"middle"};l<f&&i(n+s)<l&&(h.horizontal="center"),d<c&&i(o+u)<d&&(h.vertical="middle"),r(i(n),i(s))>r(i(o),i(u))?h.important="horizontal":h.important="vertical",t.using.call(this,e,h)}),a.offset(e.extend(C,{using:u}))})},e.ui.position={fit:{left:function(e,t){var n=t.within,i=n.isWindow?n.scrollLeft:n.offset.left,s=n.width,o=e.left-t.collisionPosition.marginLeft,u=i-o,a=o+t.collisionWidth-s-i,f;t.collisionWidth>s?u>0&&a<=0?(f=e.left+u+t.collisionWidth-s-i,e.left+=u-f):a>0&&u<=0?e.left=i:u>a?e.left=i+s-t.collisionWidth:e.left=i:u>0?e.left+=u:a>0?e.left-=a:e.left=r(e.left-o,e.left)},top:function(e,t){var n=t.within,i=n.isWindow?n.scrollTop:n.offset.top,s=t.within.height,o=e.top-t.collisionPosition.marginTop,u=i-o,a=o+t.collisionHeight-s-i,f;t.collisionHeight>s?u>0&&a<=0?(f=e.top+u+t.collisionHeight-s-i,e.top+=u-f):a>0&&u<=0?e.top=i:u>a?e.top=i+s-t.collisionHeight:e.top=i:u>0?e.top+=u:a>0?e.top-=a:e.top=r(e.top-o,e.top)}},flip:{left:function(e,t){var n=t.within,r=n.offset.left+n.scrollLeft,s=n.width,o=n.isWindow?n.scrollLeft:n.offset.left,u=e.left-t.collisionPosition.marginLeft,a=u-o,f=u+t.collisionWidth-s-o,l=t.my[0]==="left"?-t.elemWidth:t.my[0]==="right"?t.elemWidth:0,c=t.at[0]==="left"?t.targetWidth:t.at[0]==="right"?-t.targetWidth:0,h=-2*t.offset[0],p,d;if(a<0){p=e.left+l+c+h+t.collisionWidth-s-r;if(p<0||p<i(a))e.left+=l+c+h}else if(f>0){d=e.left-t.collisionPosition.marginLeft+l+c+h-o;if(d>0||i(d)<f)e.left+=l+c+h}},top:function(e,t){var n=t.within,r=n.offset.top+n.scrollTop,s=n.height,o=n.isWindow?n.scrollTop:n.offset.top,u=e.top-t.collisionPosition.marginTop,a=u-o,f=u+t.collisionHeight-s-o,l=t.my[1]==="top",c=l?-t.elemHeight:t.my[1]==="bottom"?t.elemHeight:0,h=t.at[1]==="top"?t.targetHeight:t.at[1]==="bottom"?-t.targetHeight:0,p=-2*t.offset[1],d,v;a<0?(v=e.top+c+h+p+t.collisionHeight-s-r,e.top+c+h+p>a&&(v<0||v<i(a))&&(e.top+=c+h+p)):f>0&&(d=e.top-t.collisionPosition.marginTop+c+h+p-o,e.top+c+h+p>f&&(d>0||i(d)<f)&&(e.top+=c+h+p))}},flipfit:{left:function(){e.ui.position.flip.left.apply(this,arguments),e.ui.position.fit.left.apply(this,arguments)},top:function(){e.ui.position.flip.top.apply(this,arguments),e.ui.position.fit.top.apply(this,arguments)}}},function(){var t,n,r,i,s,o=document.getElementsByTagName("body")[0],u=document.createElement("div");t=document.createElement(o?"div":"body"),r={visibility:"hidden",width:0,height:0,border:0,margin:0,background:"none"},o&&e.extend(r,{position:"absolute",left:"-1000px",top:"-1000px"});for(s in r)t.style[s]=r[s];t.appendChild(u),n=o||document.documentElement,n.insertBefore(t,n.firstChild),u.style.cssText="position: absolute; left: 10.7432222px;",i=e(u).offset().left,e.support.offsetFractions=i>10&&i<11,t.innerHTML="",n.removeChild(t)}(),e.uiBackCompat!==!1&&function(e){var n=e.fn.position;e.fn.position=function(r){if(!r||!r.offset)return n.call(this,r);var i=r.offset.split(" "),s=r.at.split(" ");return i.length===1&&(i[1]=i[0]),/^\d/.test(i[0])&&(i[0]="+"+i[0]),/^\d/.test(i[1])&&(i[1]="+"+i[1]),s.length===1&&(/left|center|right/.test(s[0])?s[1]="center":(s[1]=s[0],s[0]="center")),n.call(this,e.extend(r,{at:s[0]+i[0]+" "+s[1]+i[1],offset:t}))}}(jQuery)})(jQuery);(function(e,t){var n=0,r={},i={};r.height=r.paddingTop=r.paddingBottom=r.borderTopWidth=r.borderBottomWidth="hide",i.height=i.paddingTop=i.paddingBottom=i.borderTopWidth=i.borderBottomWidth="show",e.widget("ui.accordion",{version:"1.9.2",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.accordionId="ui-accordion-"+(this.element.attr("id")||++n),r=this.options;this.prevShow=this.prevHide=e(),this.element.addClass("ui-accordion ui-widget ui-helper-reset"),this.headers=this.element.find(r.header).addClass("ui-accordion-header ui-helper-reset ui-state-default ui-corner-all"),this._hoverable(this.headers),this._focusable(this.headers),this.headers.next().addClass("ui-accordion-content ui-helper-reset ui-widget-content ui-corner-bottom").hide(),!r.collapsible&&(r.active===!1||r.active==null)&&(r.active=0),r.active<0&&(r.active+=this.headers.length),this.active=this._findActive(r.active).addClass("ui-accordion-header-active ui-state-active").toggleClass("ui-corner-all ui-corner-top"),this.active.next().addClass("ui-accordion-content-active").show(),this._createIcons(),this.refresh(),this.element.attr("role","tablist"),this.headers.attr("role","tab").each(function(n){var r=e(this),i=r.attr("id"),s=r.next(),o=s.attr("id");i||(i=t+"-header-"+n,r.attr("id",i)),o||(o=t+"-panel-"+n,s.attr("id",o)),r.attr("aria-controls",o),s.attr("aria-labelledby",i)}).next().attr("role","tabpanel"),this.headers.not(this.active).attr({"aria-selected":"false",tabIndex:-1}).next().attr({"aria-expanded":"false","aria-hidden":"true"}).hide(),this.active.length?this.active.attr({"aria-selected":"true",tabIndex:0}).next().attr({"aria-expanded":"true","aria-hidden":"false"}):this.headers.eq(0).attr("tabIndex",0),this._on(this.headers,{keydown:"_keydown"}),this._on(this.headers.next(),{keydown:"_panelKeyDown"}),this._setupEvents(r.event)},_getCreateEventData:function(){return{header:this.active,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-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-expanded").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")}),this.options.heightStyle!=="content"&&e.css("height","")},_setOption:function(e,t){if(e==="active"){this._activate(t);return}e==="event"&&(this.options.event&&this._off(this.headers,this.options.event),this._setupEvents(t)),this._super(e,t),e==="collapsible"&&!t&&this.options.active===!1&&this._activate(0),e==="icons"&&(this._destroyIcons(),t&&this._createIcons()),e==="disabled"&&this.headers.add(this.headers.next()).toggleClass("ui-state-disabled",!!t)},_keydown:function(t){if(t.altKey||t.ctrlKey)return;var n=e.ui.keyCode,r=this.headers.length,i=this.headers.index(t.target),s=!1;switch(t.keyCode){case n.RIGHT:case n.DOWN:s=this.headers[(i+1)%r];break;case n.LEFT:case n.UP:s=this.headers[(i-1+r)%r];break;case n.SPACE:case n.ENTER:this._eventHandler(t);break;case n.HOME:s=this.headers[0];break;case n.END:s=this.headers[r-1]}s&&(e(t.target).attr("tabIndex",-1),e(s).attr("tabIndex",0),s.focus(),t.preventDefault())},_panelKeyDown:function(t){t.keyCode===e.ui.keyCode.UP&&t.ctrlKey&&e(t.currentTarget).prev().focus()},refresh:function(){var t,n,r=this.options.heightStyle,i=this.element.parent();r==="fill"?(e.support.minHeight||(n=i.css("overflow"),i.css("overflow","hidden")),t=i.height(),this.element.siblings(":visible").each(function(){var n=e(this),r=n.css("position");if(r==="absolute"||r==="fixed")return;t-=n.outerHeight(!0)}),n&&i.css("overflow",n),this.headers.each(function(){t-=e(this).outerHeight(!0)}),this.headers.next().each(function(){e(this).height(Math.max(0,t-e(this).innerHeight()+e(this).height()))}).css("overflow","auto")):r==="auto"&&(t=0,this.headers.next().each(function(){t=Math.max(t,e(this).css("height","").height())}).height(t))},_activate:function(t){var n=this._findActive(t)[0];if(n===this.active[0])return;n=n||this.active[0],this._eventHandler({target:n,currentTarget:n,preventDefault:e.noop})},_findActive:function(t){return typeof t=="number"?this.headers.eq(t):e()},_setupEvents:function(t){var n={};if(!t)return;e.each(t.split(" "),function(e,t){n[t]="_eventHandler"}),this._on(this.headers,n)},_eventHandler:function(t){var n=this.options,r=this.active,i=e(t.currentTarget),s=i[0]===r[0],o=s&&n.collapsible,u=o?e():i.next(),a=r.next(),f={oldHeader:r,oldPanel:a,newHeader:o?e():i,newPanel:u};t.preventDefault();if(s&&!n.collapsible||this._trigger("beforeActivate",t,f)===!1)return;n.active=o?!1:this.headers.index(i),this.active=s?e():i,this._toggle(f),r.removeClass("ui-accordion-header-active ui-state-active"),n.icons&&r.children(".ui-accordion-header-icon").removeClass(n.icons.activeHeader).addClass(n.icons.header),s||(i.removeClass("ui-corner-all").addClass("ui-accordion-header-active ui-state-active ui-corner-top"),n.icons&&i.children(".ui-accordion-header-icon").removeClass(n.icons.header).addClass(n.icons.activeHeader),i.next().addClass("ui-accordion-content-active"))},_toggle:function(t){var n=t.newPanel,r=this.prevShow.length?this.prevShow:t.oldPanel;this.prevShow.add(this.prevHide).stop(!0,!0),this.prevShow=n,this.prevHide=r,this.options.animate?this._animate(n,r,t):(r.hide(),n.show(),this._toggleComplete(t)),r.attr({"aria-expanded":"false","aria-hidden":"true"}),r.prev().attr("aria-selected","false"),n.length&&r.length?r.prev().attr("tabIndex",-1):n.length&&this.headers.filter(function(){return e(this).attr("tabIndex")===0}).attr("tabIndex",-1),n.attr({"aria-expanded":"true","aria-hidden":"false"}).prev().attr({"aria-selected":"true",tabIndex:0})},_animate:function(e,t,n){var s,o,u,a=this,f=0,l=e.length&&(!t.length||e.index()<t.index()),c=this.options.animate||{},h=l&&c.down||c,p=function(){a._toggleComplete(n)};typeof h=="number"&&(u=h),typeof h=="string"&&(o=h),o=o||h.easing||c.easing,u=u||h.duration||c.duration;if(!t.length)return e.animate(i,u,o,p);if(!e.length)return t.animate(r,u,o,p);s=e.show().outerHeight(),t.animate(r,{duration:u,easing:o,step:function(e,t){t.now=Math.round(e)}}),e.hide().animate(i,{duration:u,easing:o,complete:p,step:function(e,n){n.now=Math.round(e),n.prop!=="height"?f+=n.now:a.options.heightStyle!=="content"&&(n.now=Math.round(s-t.outerHeight()-f),f=0)}})},_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)}}),e.uiBackCompat!==!1&&(function(e,t){e.extend(t.options,{navigation:!1,navigationFilter:function(){return this.href.toLowerCase()===location.href.toLowerCase()}});var n=t._create;t._create=function(){if(this.options.navigation){var t=this,r=this.element.find(this.options.header),i=r.next(),s=r.add(i).find("a").filter(this.options.navigationFilter)[0];s&&r.add(i).each(function(n){if(e.contains(this,s))return t.options.active=Math.floor(n/2),!1})}n.call(this)}}(jQuery,jQuery.ui.accordion.prototype),function(e,t){e.extend(t.options,{heightStyle:null,autoHeight:!0,clearStyle:!1,fillSpace:!1});var n=t._create,r=t._setOption;e.extend(t,{_create:function(){this.options.heightStyle=this.options.heightStyle||this._mergeHeightStyle(),n.call(this)},_setOption:function(e){if(e==="autoHeight"||e==="clearStyle"||e==="fillSpace")this.options.heightStyle=this._mergeHeightStyle();r.apply(this,arguments)},_mergeHeightStyle:function(){var e=this.options;if(e.fillSpace)return"fill";if(e.clearStyle)return"content";if(e.autoHeight)return"auto"}})}(jQuery,jQuery.ui.accordion.prototype),function(e,t){e.extend(t.options.icons,{activeHeader:null,headerSelected:"ui-icon-triangle-1-s"});var n=t._createIcons;t._createIcons=function(){this.options.icons&&(this.options.icons.activeHeader=this.options.icons.activeHeader||this.options.icons.headerSelected),n.call(this)}}(jQuery,jQuery.ui.accordion.prototype),function(e,t){t.activate=t._activate;var n=t._findActive;t._findActive=function(e){return e===-1&&(e=!1),e&&typeof e!="number"&&(e=this.headers.index(this.headers.filter(e)),e===-1&&(e=!1)),n.call(this,e)}}(jQuery,jQuery.ui.accordion.prototype),jQuery.ui.accordion.prototype.resize=jQuery.ui.accordion.prototype.refresh,function(e,t){e.extend(t.options,{change:null,changestart:null});var n=t._trigger;t._trigger=function(e,t,r){var i=n.apply(this,arguments);return i?(e==="beforeActivate"?i=n.call(this,"changestart",t,{oldHeader:r.oldHeader,oldContent:r.oldPanel,newHeader:r.newHeader,newContent:r.newPanel}):e==="activate"&&(i=n.call(this,"change",t,{oldHeader:r.oldHeader,oldContent:r.oldPanel,newHeader:r.newHeader,newContent:r.newPanel})),i):!1}}(jQuery,jQuery.ui.accordion.prototype),function(e,t){e.extend(t.options,{animate:null,animated:"slide"});var n=t._create;t._create=function(){var e=this.options;e.animate===null&&(e.animated?e.animated==="slide"?e.animate=300:e.animated==="bounceslide"?e.animate={duration:200,down:{easing:"easeOutBounce",duration:1e3}}:e.animate=e.animated:e.animate=!1),n.call(this)}}(jQuery,jQuery.ui.accordion.prototype))})(jQuery);(function(e,t){var n=0;e.widget("ui.autocomplete",{version:"1.9.2",defaultElement:"<input>",options:{appendTo:"body",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},pending:0,_create:function(){var t,n,r;this.isMultiLine=this._isMultiLine(),this.valueMethod=this.element[this.element.is("input,textarea")?"val":"text"],this.isNewMenu=!0,this.element.addClass("ui-autocomplete-input").attr("autocomplete","off"),this._on(this.element,{keydown:function(i){if(this.element.prop("readOnly")){t=!0,r=!0,n=!0;return}t=!1,r=!1,n=!1;var s=e.ui.keyCode;switch(i.keyCode){case s.PAGE_UP:t=!0,this._move("previousPage",i);break;case s.PAGE_DOWN:t=!0,this._move("nextPage",i);break;case s.UP:t=!0,this._keyEvent("previous",i);break;case s.DOWN:t=!0,this._keyEvent("next",i);break;case s.ENTER:case s.NUMPAD_ENTER:this.menu.active&&(t=!0,i.preventDefault(),this.menu.select(i));break;case s.TAB:this.menu.active&&this.menu.select(i);break;case s.ESCAPE:this.menu.element.is(":visible")&&(this._value(this.term),this.close(i),i.preventDefault());break;default:n=!0,this._searchTimeout(i)}},keypress:function(r){if(t){t=!1,r.preventDefault();return}if(n)return;var i=e.ui.keyCode;switch(r.keyCode){case i.PAGE_UP:this._move("previousPage",r);break;case i.PAGE_DOWN:this._move("nextPage",r);break;case i.UP:this._keyEvent("previous",r);break;case i.DOWN:this._keyEvent("next",r)}},input:function(e){if(r){r=!1,e.preventDefault();return}this._searchTimeout(e)},focus:function(){this.selectedItem=null,this.previous=this._value()},blur:function(e){if(this.cancelBlur){delete this.cancelBlur;return}clearTimeout(this.searching),this.close(e),this._change(e)}}),this._initSource(),this.menu=e("<ul>").addClass("ui-autocomplete").appendTo(this.document.find(this.options.appendTo||"body")[0]).menu({input:e(),role:null}).zIndex(this.element.zIndex()+1).hide().data("menu"),this._on(this.menu.element,{mousedown:function(t){t.preventDefault(),this.cancelBlur=!0,this._delay(function(){delete this.cancelBlur});var n=this.menu.element[0];e(t.target).closest(".ui-menu-item").length||this._delay(function(){var t=this;this.document.one("mousedown",function(r){r.target!==t.element[0]&&r.target!==n&&!e.contains(n,r.target)&&t.close()})})},menufocus:function(t,n){if(this.isNewMenu){this.isNewMenu=!1;if(t.originalEvent&&/^mouse/.test(t.originalEvent.type)){this.menu.blur(),this.document.one("mousemove",function(){e(t.target).trigger(t.originalEvent)});return}}var r=n.item.data("ui-autocomplete-item")||n.item.data("item.autocomplete");!1!==this._trigger("focus",t,{item:r})?t.originalEvent&&/^key/.test(t.originalEvent.type)&&this._value(r.value):this.liveRegion.text(r.value)},menuselect:function(e,t){var n=t.item.data("ui-autocomplete-item")||t.item.data("item.autocomplete"),r=this.previous;this.element[0]!==this.document[0].activeElement&&(this.element.focus(),this.previous=r,this._delay(function(){this.previous=r,this.selectedItem=n})),!1!==this._trigger("select",e,{item:n})&&this._value(n.value),this.term=this._value(),this.close(e),this.selectedItem=n}}),this.liveRegion=e("<span>",{role:"status","aria-live":"polite"}).addClass("ui-helper-hidden-accessible").insertAfter(this.element),e.fn.bgiframe&&this.menu.element.bgiframe(),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),e==="source"&&this._initSource(),e==="appendTo"&&this.menu.element.appendTo(this.document.find(t||"body")[0]),e==="disabled"&&t&&this.xhr&&this.xhr.abort()},_isMultiLine:function(){return this.element.is("textarea")?!0:this.element.is("input")?!1:this.element.prop("isContentEditable")},_initSource:function(){var t,n,r=this;e.isArray(this.options.source)?(t=this.options.source,this.source=function(n,r){r(e.ui.autocomplete.filter(t,n.term))}):typeof this.options.source=="string"?(n=this.options.source,this.source=function(t,i){r.xhr&&r.xhr.abort(),r.xhr=e.ajax({url:n,data:t,dataType:"json",success:function(e){i(e)},error:function(){i([])}})}):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){e=e!=null?e:this._value(),this.term=this._value();if(e.length<this.options.minLength)return this.close(t);if(this._trigger("search",t)===!1)return;return this._search(e)},_search:function(e){this.pending++,this.element.addClass("ui-autocomplete-loading"),this.cancelSearch=!1,this.source({term:e},this._response())},_response:function(){var e=this,t=++n;return function(r){t===n&&e.__response(r),e.pending--,e.pending||e.element.removeClass("ui-autocomplete-loading")}},__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 typeof t=="string"?{label:t,value:t}:e.extend({label:t.label||t.value,value:t.value||t.label},t)})},_suggest:function(t){var n=this.menu.element.empty().zIndex(this.element.zIndex()+1);this._renderMenu(n,t),this.menu.refresh(),n.show(),this._resizeMenu(),n.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,n){var r=this;e.each(n,function(e,n){r._renderItemData(t,n)})},_renderItemData:function(e,t){return this._renderItem(e,t).data("ui-autocomplete-item",t)},_renderItem:function(t,n){return e("<li>").append(e("<a>").text(n.label)).appendTo(t)},_move:function(e,t){if(!this.menu.element.is(":visible")){this.search(null,t);return}if(this.menu.isFirstItem()&&/^previous/.test(e)||this.menu.isLastItem()&&/^next/.test(e)){this._value(this.term),this.menu.blur();return}this.menu[e](t)},widget:function(){return this.menu.element},_value:function(){return this.valueMethod.apply(this.element,arguments)},_keyEvent:function(e,t){if(!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,n){var r=new RegExp(e.ui.autocomplete.escapeRegex(n),"i");return e.grep(t,function(e){return r.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);if(this.options.disabled||this.cancelSearch)return;e&&e.length?t=this.options.messages.results(e.length):t=this.options.messages.noResults,this.liveRegion.text(t)}})})(jQuery);(function(e,t){var n,r,i,s,o="ui-button ui-widget ui-state-default ui-corner-all",u="ui-state-hover ui-state-active ",a="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",f=function(){var t=e(this).find(":ui-button");setTimeout(function(){t.button("refresh")},1)},l=function(t){var n=t.name,r=t.form,i=e([]);return n&&(r?i=e(r).find("[name='"+n+"']"):i=e("[name='"+n+"']",t.ownerDocument).filter(function(){return!this.form})),i};e.widget("ui.button",{version:"1.9.2",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,f),typeof this.options.disabled!="boolean"?this.options.disabled=!!this.element.prop("disabled"):this.element.prop("disabled",this.options.disabled),this._determineButtonType(),this.hasTitle=!!this.buttonElement.attr("title");var t=this,u=this.options,a=this.type==="checkbox"||this.type==="radio",c=a?"":"ui-state-active",h="ui-state-focus";u.label===null&&(u.label=this.type==="input"?this.buttonElement.val():this.buttonElement.html()),this._hoverable(this.buttonElement),this.buttonElement.addClass(o).attr("role","button").bind("mouseenter"+this.eventNamespace,function(){if(u.disabled)return;this===n&&e(this).addClass("ui-state-active")}).bind("mouseleave"+this.eventNamespace,function(){if(u.disabled)return;e(this).removeClass(c)}).bind("click"+this.eventNamespace,function(e){u.disabled&&(e.preventDefault(),e.stopImmediatePropagation())}),this.element.bind("focus"+this.eventNamespace,function(){t.buttonElement.addClass(h)}).bind("blur"+this.eventNamespace,function(){t.buttonElement.removeClass(h)}),a&&(this.element.bind("change"+this.eventNamespace,function(){if(s)return;t.refresh()}),this.buttonElement.bind("mousedown"+this.eventNamespace,function(e){if(u.disabled)return;s=!1,r=e.pageX,i=e.pageY}).bind("mouseup"+this.eventNamespace,function(e){if(u.disabled)return;if(r!==e.pageX||i!==e.pageY)s=!0})),this.type==="checkbox"?this.buttonElement.bind("click"+this.eventNamespace,function(){if(u.disabled||s)return!1;e(this).toggleClass("ui-state-active"),t.buttonElement.attr("aria-pressed",t.element[0].checked)}):this.type==="radio"?this.buttonElement.bind("click"+this.eventNamespace,function(){if(u.disabled||s)return!1;e(this).addClass("ui-state-active"),t.buttonElement.attr("aria-pressed","true");var n=t.element[0];l(n).not(n).map(function(){return e(this).button("widget")[0]}).removeClass("ui-state-active").attr("aria-pressed","false")}):(this.buttonElement.bind("mousedown"+this.eventNamespace,function(){if(u.disabled)return!1;e(this).addClass("ui-state-active"),n=this,t.document.one("mouseup",function(){n=null})}).bind("mouseup"+this.eventNamespace,function(){if(u.disabled)return!1;e(this).removeClass("ui-state-active")}).bind("keydown"+this.eventNamespace,function(t){if(u.disabled)return!1;(t.keyCode===e.ui.keyCode.SPACE||t.keyCode===e.ui.keyCode.ENTER)&&e(this).addClass("ui-state-active")}).bind("keyup"+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",u.disabled),this._resetButton()},_determineButtonType:function(){var e,t,n;this.element.is("[type=checkbox]")?this.type="checkbox":this.element.is("[type=radio]")?this.type="radio":this.element.is("input")?this.type="input":this.type="button",this.type==="checkbox"||this.type==="radio"?(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"),n=this.element.is(":checked"),n&&this.buttonElement.addClass("ui-state-active"),this.buttonElement.prop("aria-pressed",n)):this.buttonElement=this.element},widget:function(){return this.buttonElement},_destroy:function(){this.element.removeClass("ui-helper-hidden-accessible"),this.buttonElement.removeClass(o+" "+u+" "+a).removeAttr("role").removeAttr("aria-pressed").html(this.buttonElement.find(".ui-button-text").html()),this.hasTitle||this.buttonElement.removeAttr("title")},_setOption:function(e,t){this._super(e,t);if(e==="disabled"){t?this.element.prop("disabled",!0):this.element.prop("disabled",!1);return}this._resetButton()},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),this.type==="radio"?l(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")}):this.type==="checkbox"&&(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(this.type==="input"){this.options.label&&this.element.val(this.options.label);return}var t=this.buttonElement.removeClass(a),n=e("<span></span>",this.document[0]).addClass("ui-button-text").html(this.options.label).appendTo(t.empty()).text(),r=this.options.icons,i=r.primary&&r.secondary,s=[];r.primary||r.secondary?(this.options.text&&s.push("ui-button-text-icon"+(i?"s":r.primary?"-primary":"-secondary")),r.primary&&t.prepend("<span class='ui-button-icon-primary ui-icon "+r.primary+"'></span>"),r.secondary&&t.append("<span class='ui-button-icon-secondary ui-icon "+r.secondary+"'></span>"),this.options.text||(s.push(i?"ui-button-icons-only":"ui-button-icon-only"),this.hasTitle||t.attr("title",e.trim(n)))):s.push("ui-button-text-only"),t.addClass(s.join(" "))}}),e.widget("ui.buttonset",{version:"1.9.2",options:{items:"button, input[type=button], input[type=submit], input[type=reset], input[type=checkbox], input[type=radio], a, :data(button)"},_create:function(){this.element.addClass("ui-buttonset")},_init:function(){this.refresh()},_setOption:function(e,t){e==="disabled"&&this.buttons.button("option",e,t),this._super(e,t)},refresh:function(){var t=this.element.css("direction")==="rtl";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($,undefined){function Datepicker(){this.debug=!1,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},$.extend(this._defaults,this.regional[""]),this.dpDiv=bindHover($('<div id="'+this._mainDivId+'" class="ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all"></div>'))}function bindHover(e){var t="button, .ui-datepicker-prev, .ui-datepicker-next, .ui-datepicker-calendar td a";return e.delegate(t,"mouseout",function(){$(this).removeClass("ui-state-hover"),this.className.indexOf("ui-datepicker-prev")!=-1&&$(this).removeClass("ui-datepicker-prev-hover"),this.className.indexOf("ui-datepicker-next")!=-1&&$(this).removeClass("ui-datepicker-next-hover")}).delegate(t,"mouseover",function(){$.datepicker._isDisabledDatepicker(instActive.inline?e.parent()[0]:instActive.input[0])||($(this).parents(".ui-datepicker-calendar").find("a").removeClass("ui-state-hover"),$(this).addClass("ui-state-hover"),this.className.indexOf("ui-datepicker-prev")!=-1&&$(this).addClass("ui-datepicker-prev-hover"),this.className.indexOf("ui-datepicker-next")!=-1&&$(this).addClass("ui-datepicker-next-hover"))})}function extendRemove(e,t){$.extend(e,t);for(var n in t)if(t[n]==null||t[n]==undefined)e[n]=t[n];return e}$.extend($.ui,{datepicker:{version:"1.9.2"}});var PROP_NAME="datepicker",dpuuid=(new Date).getTime(),instActive;$.extend(Datepicker.prototype,{markerClassName:"hasDatepicker",maxRows:4,log:function(){this.debug&&console.log.apply("",arguments)},_widgetDatepicker:function(){return this.dpDiv},setDefaults:function(e){return extendRemove(this._defaults,e||{}),this},_attachDatepicker:function(target,settings){var inlineSettings=null;for(var attrName in this._defaults){var attrValue=target.getAttribute("date:"+attrName);if(attrValue){inlineSettings=inlineSettings||{};try{inlineSettings[attrName]=eval(attrValue)}catch(err){inlineSettings[attrName]=attrValue}}}var nodeName=target.nodeName.toLowerCase(),inline=nodeName=="div"||nodeName=="span";target.id||(this.uuid+=1,target.id="dp"+this.uuid);var inst=this._newInst($(target),inline);inst.settings=$.extend({},settings||{},inlineSettings||{}),nodeName=="input"?this._connectDatepicker(target,inst):inline&&this._inlineDatepicker(target,inst)},_newInst:function(e,t){var n=e[0].id.replace(/([^A-Za-z0-9_-])/g,"\\\\$1");return{id:n,input:e,selectedDay:0,selectedMonth:0,selectedYear:0,drawMonth:0,drawYear:0,inline:t,dpDiv:t?bindHover($('<div class="'+this._inlineClass+' ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all"></div>')):this.dpDiv}},_connectDatepicker:function(e,t){var n=$(e);t.append=$([]),t.trigger=$([]);if(n.hasClass(this.markerClassName))return;this._attachments(n,t),n.addClass(this.markerClassName).keydown(this._doKeyDown).keypress(this._doKeyPress).keyup(this._doKeyUp).bind("setData.datepicker",function(e,n,r){t.settings[n]=r}).bind("getData.datepicker",function(e,n){return this._get(t,n)}),this._autoSize(t),$.data(e,PROP_NAME,t),t.settings.disabled&&this._disableDatepicker(e)},_attachments:function(e,t){var n=this._get(t,"appendText"),r=this._get(t,"isRTL");t.append&&t.append.remove(),n&&(t.append=$('<span class="'+this._appendClass+'">'+n+"</span>"),e[r?"before":"after"](t.append)),e.unbind("focus",this._showDatepicker),t.trigger&&t.trigger.remove();var i=this._get(t,"showOn");(i=="focus"||i=="both")&&e.focus(this._showDatepicker);if(i=="button"||i=="both"){var s=this._get(t,"buttonText"),o=this._get(t,"buttonImage");t.trigger=$(this._get(t,"buttonImageOnly")?$("<img/>").addClass(this._triggerClass).attr({src:o,alt:s,title:s}):$('<button type="button"></button>').addClass(this._triggerClass).html(o==""?s:$("<img/>").attr({src:o,alt:s,title:s}))),e[r?"before":"after"](t.trigger),t.trigger.click(function(){return $.datepicker._datepickerShowing&&$.datepicker._lastInput==e[0]?$.datepicker._hideDatepicker():$.datepicker._datepickerShowing&&$.datepicker._lastInput!=e[0]?($.datepicker._hideDatepicker(),$.datepicker._showDatepicker(e[0])):$.datepicker._showDatepicker(e[0]),!1})}},_autoSize:function(e){if(this._get(e,"autoSize")&&!e.inline){var t=new Date(2009,11,20),n=this._get(e,"dateFormat");if(n.match(/[DM]/)){var r=function(e){var t=0,n=0;for(var r=0;r<e.length;r++)e[r].length>t&&(t=e[r].length,n=r);return n};t.setMonth(r(this._get(e,n.match(/MM/)?"monthNames":"monthNamesShort"))),t.setDate(r(this._get(e,n.match(/DD/)?"dayNames":"dayNamesShort"))+20-t.getDay())}e.input.attr("size",this._formatDate(e,t).length)}},_inlineDatepicker:function(e,t){var n=$(e);if(n.hasClass(this.markerClassName))return;n.addClass(this.markerClassName).append(t.dpDiv).bind("setData.datepicker",function(e,n,r){t.settings[n]=r}).bind("getData.datepicker",function(e,n){return this._get(t,n)}),$.data(e,PROP_NAME,t),this._setDate(t,this._getDefaultDate(t),!0),this._updateDatepicker(t),this._updateAlternate(t),t.settings.disabled&&this._disableDatepicker(e),t.dpDiv.css("display","block")},_dialogDatepicker:function(e,t,n,r,i){var s=this._dialogInst;if(!s){this.uuid+=1;var o="dp"+this.uuid;this._dialogInput=$('<input type="text" id="'+o+'" style="position: absolute; top: -100px; width: 0px;"/>'),this._dialogInput.keydown(this._doKeyDown),$("body").append(this._dialogInput),s=this._dialogInst=this._newInst(this._dialogInput,!1),s.settings={},$.data(this._dialogInput[0],PROP_NAME,s)}extendRemove(s.settings,r||{}),t=t&&t.constructor==Date?this._formatDate(s,t):t,this._dialogInput.val(t),this._pos=i?i.length?i:[i.pageX,i.pageY]:null;if(!this._pos){var u=document.documentElement.clientWidth,a=document.documentElement.clientHeight,f=document.documentElement.scrollLeft||document.body.scrollLeft,l=document.documentElement.scrollTop||document.body.scrollTop;this._pos=[u/2-100+f,a/2-150+l]}return this._dialogInput.css("left",this._pos[0]+20+"px").css("top",this._pos[1]+"px"),s.settings.onSelect=n,this._inDialog=!0,this.dpDiv.addClass(this._dialogClass),this._showDatepicker(this._dialogInput[0]),$.blockUI&&$.blockUI(this.dpDiv),$.data(this._dialogInput[0],PROP_NAME,s),this},_destroyDatepicker:function(e){var t=$(e),n=$.data(e,PROP_NAME);if(!t.hasClass(this.markerClassName))return;var r=e.nodeName.toLowerCase();$.removeData(e,PROP_NAME),r=="input"?(n.append.remove(),n.trigger.remove(),t.removeClass(this.markerClassName).unbind("focus",this._showDatepicker).unbind("keydown",this._doKeyDown).unbind("keypress",this._doKeyPress).unbind("keyup",this._doKeyUp)):(r=="div"||r=="span")&&t.removeClass(this.markerClassName).empty()},_enableDatepicker:function(e){var t=$(e),n=$.data(e,PROP_NAME);if(!t.hasClass(this.markerClassName))return;var r=e.nodeName.toLowerCase();if(r=="input")e.disabled=!1,n.trigger.filter("button").each(function(){this.disabled=!1}).end().filter("img").css({opacity:"1.0",cursor:""});else if(r=="div"||r=="span"){var i=t.children("."+this._inlineClass);i.children().removeClass("ui-state-disabled"),i.find("select.ui-datepicker-month, select.ui-datepicker-year").prop("disabled",!1)}this._disabledInputs=$.map(this._disabledInputs,function(t){return t==e?null:t})},_disableDatepicker:function(e){var t=$(e),n=$.data(e,PROP_NAME);if(!t.hasClass(this.markerClassName))return;var r=e.nodeName.toLowerCase();if(r=="input")e.disabled=!0,n.trigger.filter("button").each(function(){this.disabled=!0}).end().filter("img").css({opacity:"0.5",cursor:"default"});else if(r=="div"||r=="span"){var i=t.children("."+this._inlineClass);i.children().addClass("ui-state-disabled"),i.find("select.ui-datepicker-month, select.ui-datepicker-year").prop("disabled",!0)}this._disabledInputs=$.map(this._disabledInputs,function(t){return t==e?null:t}),this._disabledInputs[this._disabledInputs.length]=e},_isDisabledDatepicker:function(e){if(!e)return!1;for(var t=0;t<this._disabledInputs.length;t++)if(this._disabledInputs[t]==e)return!0;return!1},_getInst:function(e){try{return $.data(e,PROP_NAME)}catch(t){throw"Missing instance data for this datepicker"}},_optionDatepicker:function(e,t,n){var r=this._getInst(e);if(arguments.length==2&&typeof t=="string")return t=="defaults"?$.extend({},$.datepicker._defaults):r?t=="all"?$.extend({},r.settings):this._get(r,t):null;var i=t||{};typeof t=="string"&&(i={},i[t]=n);if(r){this._curInst==r&&this._hideDatepicker();var s=this._getDateDatepicker(e,!0),o=this._getMinMaxDate(r,"min"),u=this._getMinMaxDate(r,"max");extendRemove(r.settings,i),o!==null&&i.dateFormat!==undefined&&i.minDate===undefined&&(r.settings.minDate=this._formatDate(r,o)),u!==null&&i.dateFormat!==undefined&&i.maxDate===undefined&&(r.settings.maxDate=this._formatDate(r,u)),this._attachments($(e),r),this._autoSize(r),this._setDate(r,s),this._updateAlternate(r),this._updateDatepicker(r)}},_changeDatepicker:function(e,t,n){this._optionDatepicker(e,t,n)},_refreshDatepicker:function(e){var t=this._getInst(e);t&&this._updateDatepicker(t)},_setDateDatepicker:function(e,t){var n=this._getInst(e);n&&(this._setDate(n,t),this._updateDatepicker(n),this._updateAlternate(n))},_getDateDatepicker:function(e,t){var n=this._getInst(e);return n&&!n.inline&&this._setDateFromField(n,t),n?this._getDate(n):null},_doKeyDown:function(e){var t=$.datepicker._getInst(e.target),n=!0,r=t.dpDiv.is(".ui-datepicker-rtl");t._keyEvent=!0;if($.datepicker._datepickerShowing)switch(e.keyCode){case 9:$.datepicker._hideDatepicker(),n=!1;break;case 13:var i=$("td."+$.datepicker._dayOverClass+":not(."+$.datepicker._currentClass+")",t.dpDiv);i[0]&&$.datepicker._selectDay(e.target,t.selectedMonth,t.selectedYear,i[0]);var s=$.datepicker._get(t,"onSelect");if(s){var o=$.datepicker._formatDate(t);s.apply(t.input?t.input[0]:null,[o,t])}else $.datepicker._hideDatepicker();return!1;case 27:$.datepicker._hideDatepicker();break;case 33:$.datepicker._adjustDate(e.target,e.ctrlKey?-$.datepicker._get(t,"stepBigMonths"):-$.datepicker._get(t,"stepMonths"),"M");break;case 34:$.datepicker._adjustDate(e.target,e.ctrlKey?+$.datepicker._get(t,"stepBigMonths"):+$.datepicker._get(t,"stepMonths"),"M");break;case 35:(e.ctrlKey||e.metaKey)&&$.datepicker._clearDate(e.target),n=e.ctrlKey||e.metaKey;break;case 36:(e.ctrlKey||e.metaKey)&&$.datepicker._gotoToday(e.target),n=e.ctrlKey||e.metaKey;break;case 37:(e.ctrlKey||e.metaKey)&&$.datepicker._adjustDate(e.target,r?1:-1,"D"),n=e.ctrlKey||e.metaKey,e.originalEvent.altKey&&$.datepicker._adjustDate(e.target,e.ctrlKey?-$.datepicker._get(t,"stepBigMonths"):-$.datepicker._get(t,"stepMonths"),"M");break;case 38:(e.ctrlKey||e.metaKey)&&$.datepicker._adjustDate(e.target,-7,"D"),n=e.ctrlKey||e.metaKey;break;case 39:(e.ctrlKey||e.metaKey)&&$.datepicker._adjustDate(e.target,r?-1:1,"D"),n=e.ctrlKey||e.metaKey,e.originalEvent.altKey&&$.datepicker._adjustDate(e.target,e.ctrlKey?+$.datepicker._get(t,"stepBigMonths"):+$.datepicker._get(t,"stepMonths"),"M");break;case 40:(e.ctrlKey||e.metaKey)&&$.datepicker._adjustDate(e.target,7,"D"),n=e.ctrlKey||e.metaKey;break;default:n=!1}else e.keyCode==36&&e.ctrlKey?$.datepicker._showDatepicker(this):n=!1;n&&(e.preventDefault(),e.stopPropagation())},_doKeyPress:function(e){var t=$.datepicker._getInst(e.target);if($.datepicker._get(t,"constrainInput")){var n=$.datepicker._possibleChars($.datepicker._get(t,"dateFormat")),r=String.fromCharCode(e.charCode==undefined?e.keyCode:e.charCode);return e.ctrlKey||e.metaKey||r<" "||!n||n.indexOf(r)>-1}},_doKeyUp:function(e){var t=$.datepicker._getInst(e.target);if(t.input.val()!=t.lastVal)try{var n=$.datepicker.parseDate($.datepicker._get(t,"dateFormat"),t.input?t.input.val():null,$.datepicker._getFormatConfig(t));n&&($.datepicker._setDateFromField(t),$.datepicker._updateAlternate(t),$.datepicker._updateDatepicker(t))}catch(r){$.datepicker.log(r)}return!0},_showDatepicker:function(e){e=e.target||e,e.nodeName.toLowerCase()!="input"&&(e=$("input",e.parentNode)[0]);if($.datepicker._isDisabledDatepicker(e)||$.datepicker._lastInput==e)return;var t=$.datepicker._getInst(e);$.datepicker._curInst&&$.datepicker._curInst!=t&&($.datepicker._curInst.dpDiv.stop(!0,!0),t&&$.datepicker._datepickerShowing&&$.datepicker._hideDatepicker($.datepicker._curInst.input[0]));var n=$.datepicker._get(t,"beforeShow"),r=n?n.apply(e,[e,t]):{};if(r===!1)return;extendRemove(t.settings,r),t.lastVal=null,$.datepicker._lastInput=e,$.datepicker._setDateFromField(t),$.datepicker._inDialog&&(e.value=""),$.datepicker._pos||($.datepicker._pos=$.datepicker._findPos(e),$.datepicker._pos[1]+=e.offsetHeight);var i=!1;$(e).parents().each(function(){return i|=$(this).css("position")=="fixed",!i});var s={left:$.datepicker._pos[0],top:$.datepicker._pos[1]};$.datepicker._pos=null,t.dpDiv.empty(),t.dpDiv.css({position:"absolute",display:"block",top:"-1000px"}),$.datepicker._updateDatepicker(t),s=$.datepicker._checkOffset(t,s,i),t.dpDiv.css({position:$.datepicker._inDialog&&$.blockUI?"static":i?"fixed":"absolute",display:"none",left:s.left+"px",top:s.top+"px"});if(!t.inline){var o=$.datepicker._get(t,"showAnim"),u=$.datepicker._get(t,"duration"),a=function(){var e=t.dpDiv.find("iframe.ui-datepicker-cover");if(!!e.length){var n=$.datepicker._getBorders(t.dpDiv);e.css({left:-n[0],top:-n[1],width:t.dpDiv.outerWidth(),height:t.dpDiv.outerHeight()})}};t.dpDiv.zIndex($(e).zIndex()+1),$.datepicker._datepickerShowing=!0,$.effects&&($.effects.effect[o]||$.effects[o])?t.dpDiv.show(o,$.datepicker._get(t,"showOptions"),u,a):t.dpDiv[o||"show"](o?u:null,a),(!o||!u)&&a(),t.input.is(":visible")&&!t.input.is(":disabled")&&t.input.focus(),$.datepicker._curInst=t}},_updateDatepicker:function(e){this.maxRows=4;var t=$.datepicker._getBorders(e.dpDiv);instActive=e,e.dpDiv.empty().append(this._generateHTML(e)),this._attachHandlers(e);var n=e.dpDiv.find("iframe.ui-datepicker-cover");!n.length||n.css({left:-t[0],top:-t[1],width:e.dpDiv.outerWidth(),height:e.dpDiv.outerHeight()}),e.dpDiv.find("."+this._dayOverClass+" a").mouseover();var r=this._getNumberOfMonths(e),i=r[1],s=17;e.dpDiv.removeClass("ui-datepicker-multi-2 ui-datepicker-multi-3 ui-datepicker-multi-4").width(""),i>1&&e.dpDiv.addClass("ui-datepicker-multi-"+i).css("width",s*i+"em"),e.dpDiv[(r[0]!=1||r[1]!=1?"add":"remove")+"Class"]("ui-datepicker-multi"),e.dpDiv[(this._get(e,"isRTL")?"add":"remove")+"Class"]("ui-datepicker-rtl"),e==$.datepicker._curInst&&$.datepicker._datepickerShowing&&e.input&&e.input.is(":visible")&&!e.input.is(":disabled")&&e.input[0]!=document.activeElement&&e.input.focus();if(e.yearshtml){var o=e.yearshtml;setTimeout(function(){o===e.yearshtml&&e.yearshtml&&e.dpDiv.find("select.ui-datepicker-year:first").replaceWith(e.yearshtml),o=e.yearshtml=null},0)}},_getBorders:function(e){var t=function(e){return{thin:1,medium:2,thick:3}[e]||e};return[parseFloat(t(e.css("border-left-width"))),parseFloat(t(e.css("border-top-width")))]},_checkOffset:function(e,t,n){var r=e.dpDiv.outerWidth(),i=e.dpDiv.outerHeight(),s=e.input?e.input.outerWidth():0,o=e.input?e.input.outerHeight():0,u=document.documentElement.clientWidth+(n?0:$(document).scrollLeft()),a=document.documentElement.clientHeight+(n?0:$(document).scrollTop());return t.left-=this._get(e,"isRTL")?r-s:0,t.left-=n&&t.left==e.input.offset().left?$(document).scrollLeft():0,t.top-=n&&t.top==e.input.offset().top+o?$(document).scrollTop():0,t.left-=Math.min(t.left,t.left+r>u&&u>r?Math.abs(t.left+r-u):0),t.top-=Math.min(t.top,t.top+i>a&&a>i?Math.abs(i+o):0),t},_findPos:function(e){var t=this._getInst(e),n=this._get(t,"isRTL");while(e&&(e.type=="hidden"||e.nodeType!=1||$.expr.filters.hidden(e)))e=e[n?"previousSibling":"nextSibling"];var r=$(e).offset();return[r.left,r.top]},_hideDatepicker:function(e){var t=this._curInst;if(!t||e&&t!=$.data(e,PROP_NAME))return;if(this._datepickerShowing){var n=this._get(t,"showAnim"),r=this._get(t,"duration"),i=function(){$.datepicker._tidyDialog(t)};$.effects&&($.effects.effect[n]||$.effects[n])?t.dpDiv.hide(n,$.datepicker._get(t,"showOptions"),r,i):t.dpDiv[n=="slideDown"?"slideUp":n=="fadeIn"?"fadeOut":"hide"](n?r:null,i),n||i(),this._datepickerShowing=!1;var s=this._get(t,"onClose");s&&s.apply(t.input?t.input[0]:null,[t.input?t.input.val():"",t]),this._lastInput=null,this._inDialog&&(this._dialogInput.css({position:"absolute",left:"0",top:"-100px"}),$.blockUI&&($.unblockUI(),$("body").append(this.dpDiv))),this._inDialog=!1}},_tidyDialog:function(e){e.dpDiv.removeClass(this._dialogClass).unbind(".ui-datepicker-calendar")},_checkExternalClick:function(e){if(!$.datepicker._curInst)return;var t=$(e.target),n=$.datepicker._getInst(t[0]);(t[0].id!=$.datepicker._mainDivId&&t.parents("#"+$.datepicker._mainDivId).length==0&&!t.hasClass($.datepicker.markerClassName)&&!t.closest("."+$.datepicker._triggerClass).length&&$.datepicker._datepickerShowing&&(!$.datepicker._inDialog||!$.blockUI)||t.hasClass($.datepicker.markerClassName)&&$.datepicker._curInst!=n)&&$.datepicker._hideDatepicker()},_adjustDate:function(e,t,n){var r=$(e),i=this._getInst(r[0]);if(this._isDisabledDatepicker(r[0]))return;this._adjustInstDate(i,t+(n=="M"?this._get(i,"showCurrentAtPos"):0),n),this._updateDatepicker(i)},_gotoToday:function(e){var t=$(e),n=this._getInst(t[0]);if(this._get(n,"gotoCurrent")&&n.currentDay)n.selectedDay=n.currentDay,n.drawMonth=n.selectedMonth=n.currentMonth,n.drawYear=n.selectedYear=n.currentYear;else{var r=new Date;n.selectedDay=r.getDate(),n.drawMonth=n.selectedMonth=r.getMonth(),n.drawYear=n.selectedYear=r.getFullYear()}this._notifyChange(n),this._adjustDate(t)},_selectMonthYear:function(e,t,n){var r=$(e),i=this._getInst(r[0]);i["selected"+(n=="M"?"Month":"Year")]=i["draw"+(n=="M"?"Month":"Year")]=parseInt(t.options[t.selectedIndex].value,10),this._notifyChange(i),this._adjustDate(r)},_selectDay:function(e,t,n,r){var i=$(e);if($(r).hasClass(this._unselectableClass)||this._isDisabledDatepicker(i[0]))return;var s=this._getInst(i[0]);s.selectedDay=s.currentDay=$("a",r).html(),s.selectedMonth=s.currentMonth=t,s.selectedYear=s.currentYear=n,this._selectDate(e,this._formatDate(s,s.currentDay,s.currentMonth,s.currentYear))},_clearDate:function(e){var t=$(e),n=this._getInst(t[0]);this._selectDate(t,"")},_selectDate:function(e,t){var n=$(e),r=this._getInst(n[0]);t=t!=null?t:this._formatDate(r),r.input&&r.input.val(t),this._updateAlternate(r);var i=this._get(r,"onSelect");i?i.apply(r.input?r.input[0]:null,[t,r]):r.input&&r.input.trigger("change"),r.inline?this._updateDatepicker(r):(this._hideDatepicker(),this._lastInput=r.input[0],typeof r.input[0]!="object"&&r.input.focus(),this._lastInput=null)},_updateAlternate:function(e){var t=this._get(e,"altField");if(t){var n=this._get(e,"altFormat")||this._get(e,"dateFormat"),r=this._getDate(e),i=this.formatDate(n,r,this._getFormatConfig(e));$(t).each(function(){$(this).val(i)})}},noWeekends:function(e){var t=e.getDay();return[t>0&&t<6,""]},iso8601Week:function(e){var t=new Date(e.getTime());t.setDate(t.getDate()+4-(t.getDay()||7));var n=t.getTime();return t.setMonth(0),t.setDate(1),Math.floor(Math.round((n-t)/864e5)/7)+1},parseDate:function(e,t,n){if(e==null||t==null)throw"Invalid arguments";t=typeof t=="object"?t.toString():t+"";if(t=="")return null;var r=(n?n.shortYearCutoff:null)||this._defaults.shortYearCutoff;r=typeof r!="string"?r:(new Date).getFullYear()%100+parseInt(r,10);var i=(n?n.dayNamesShort:null)||this._defaults.dayNamesShort,s=(n?n.dayNames:null)||this._defaults.dayNames,o=(n?n.monthNamesShort:null)||this._defaults.monthNamesShort,u=(n?n.monthNames:null)||this._defaults.monthNames,a=-1,f=-1,l=-1,c=-1,h=!1,p=function(t){var n=y+1<e.length&&e.charAt(y+1)==t;return n&&y++,n},d=function(e){var n=p(e),r=e=="@"?14:e=="!"?20:e=="y"&&n?4:e=="o"?3:2,i=new RegExp("^\\d{1,"+r+"}"),s=t.substring(g).match(i);if(!s)throw"Missing number at position "+g;return g+=s[0].length,parseInt(s[0],10)},v=function(e,n,r){var i=$.map(p(e)?r:n,function(e,t){return[[t,e]]}).sort(function(e,t){return-(e[1].length-t[1].length)}),s=-1;$.each(i,function(e,n){var r=n[1];if(t.substr(g,r.length).toLowerCase()==r.toLowerCase())return s=n[0],g+=r.length,!1});if(s!=-1)return s+1;throw"Unknown name at position "+g},m=function(){if(t.charAt(g)!=e.charAt(y))throw"Unexpected literal at position "+g;g++},g=0;for(var y=0;y<e.length;y++)if(h)e.charAt(y)=="'"&&!p("'")?h=!1:m();else switch(e.charAt(y)){case"d":l=d("d");break;case"D":v("D",i,s);break;case"o":c=d("o");break;case"m":f=d("m");break;case"M":f=v("M",o,u);break;case"y":a=d("y");break;case"@":var b=new Date(d("@"));a=b.getFullYear(),f=b.getMonth()+1,l=b.getDate();break;case"!":var b=new Date((d("!")-this._ticksTo1970)/1e4);a=b.getFullYear(),f=b.getMonth()+1,l=b.getDate();break;case"'":p("'")?m():h=!0;break;default:m()}if(g<t.length){var w=t.substr(g);if(!/^\s+/.test(w))throw"Extra/unparsed characters found in date: "+w}a==-1?a=(new Date).getFullYear():a<100&&(a+=(new Date).getFullYear()-(new Date).getFullYear()%100+(a<=r?0:-100));if(c>-1){f=1,l=c;do{var E=this._getDaysInMonth(a,f-1);if(l<=E)break;f++,l-=E}while(!0)}var b=this._daylightSavingAdjust(new Date(a,f-1,l));if(b.getFullYear()!=a||b.getMonth()+1!=f||b.getDate()!=l)throw"Invalid date";return b},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:(718685+Math.floor(492.5)-Math.floor(19.7)+Math.floor(4.925))*24*60*60*1e7,formatDate:function(e,t,n){if(!t)return"";var r=(n?n.dayNamesShort:null)||this._defaults.dayNamesShort,i=(n?n.dayNames:null)||this._defaults.dayNames,s=(n?n.monthNamesShort:null)||this._defaults.monthNamesShort,o=(n?n.monthNames:null)||this._defaults.monthNames,u=function(t){var n=h+1<e.length&&e.charAt(h+1)==t;return n&&h++,n},a=function(e,t,n){var r=""+t;if(u(e))while(r.length<n)r="0"+r;return r},f=function(e,t,n,r){return u(e)?r[t]:n[t]},l="",c=!1;if(t)for(var h=0;h<e.length;h++)if(c)e.charAt(h)=="'"&&!u("'")?c=!1:l+=e.charAt(h);else switch(e.charAt(h)){case"d":l+=a("d",t.getDate(),2);break;case"D":l+=f("D",t.getDay(),r,i);break;case"o":l+=a("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+=a("m",t.getMonth()+1,2);break;case"M":l+=f("M",t.getMonth(),s,o);break;case"y":l+=u("y")?t.getFullYear():(t.getYear()%100<10?"0":"")+t.getYear()%100;break;case"@":l+=t.getTime();break;case"!":l+=t.getTime()*1e4+this._ticksTo1970;break;case"'":u("'")?l+="'":c=!0;break;default:l+=e.charAt(h)}return l},_possibleChars:function(e){var t="",n=!1,r=function(t){var n=i+1<e.length&&e.charAt(i+1)==t;return n&&i++,n};for(var i=0;i<e.length;i++)if(n)e.charAt(i)=="'"&&!r("'")?n=!1:t+=e.charAt(i);else switch(e.charAt(i)){case"d":case"m":case"y":case"@":t+="0123456789";break;case"D":case"M":return null;case"'":r("'")?t+="'":n=!0;break;default:t+=e.charAt(i)}return t},_get:function(e,t){return e.settings[t]!==undefined?e.settings[t]:this._defaults[t]},_setDateFromField:function(e,t){if(e.input.val()==e.lastVal)return;var n=this._get(e,"dateFormat"),r=e.lastVal=e.input?e.input.val():null,i,s;i=s=this._getDefaultDate(e);var o=this._getFormatConfig(e);try{i=this.parseDate(n,r,o)||s}catch(u){this.log(u),r=t?"":r}e.selectedDay=i.getDate(),e.drawMonth=e.selectedMonth=i.getMonth(),e.drawYear=e.selectedYear=i.getFullYear(),e.currentDay=r?i.getDate():0,e.currentMonth=r?i.getMonth():0,e.currentYear=r?i.getFullYear():0,this._adjustInstDate(e)},_getDefaultDate:function(e){return this._restrictMinMax(e,this._determineDate(e,this._get(e,"defaultDate"),new Date))},_determineDate:function(e,t,n){var r=function(e){var t=new Date;return t.setDate(t.getDate()+e),t},i=function(t){try{return $.datepicker.parseDate($.datepicker._get(e,"dateFormat"),t,$.datepicker._getFormatConfig(e))}catch(n){}var r=(t.toLowerCase().match(/^c/)?$.datepicker._getDate(e):null)||new Date,i=r.getFullYear(),s=r.getMonth(),o=r.getDate(),u=/([+-]?[0-9]+)\s*(d|D|w|W|m|M|y|Y)?/g,a=u.exec(t);while(a){switch(a[2]||"d"){case"d":case"D":o+=parseInt(a[1],10);break;case"w":case"W":o+=parseInt(a[1],10)*7;break;case"m":case"M":s+=parseInt(a[1],10),o=Math.min(o,$.datepicker._getDaysInMonth(i,s));break;case"y":case"Y":i+=parseInt(a[1],10),o=Math.min(o,$.datepicker._getDaysInMonth(i,s))}a=u.exec(t)}return new Date(i,s,o)},s=t==null||t===""?n:typeof t=="string"?i(t):typeof t=="number"?isNaN(t)?n:r(t):new Date(t.getTime());return s=s&&s.toString()=="Invalid Date"?n:s,s&&(s.setHours(0),s.setMinutes(0),s.setSeconds(0),s.setMilliseconds(0)),this._daylightSavingAdjust(s)},_daylightSavingAdjust:function(e){return e?(e.setHours(e.getHours()>12?e.getHours()+2:0),e):null},_setDate:function(e,t,n){var r=!t,i=e.selectedMonth,s=e.selectedYear,o=this._restrictMinMax(e,this._determineDate(e,t,new Date));e.selectedDay=e.currentDay=o.getDate(),e.drawMonth=e.selectedMonth=e.currentMonth=o.getMonth(),e.drawYear=e.selectedYear=e.currentYear=o.getFullYear(),(i!=e.selectedMonth||s!=e.selectedYear)&&!n&&this._notifyChange(e),this._adjustInstDate(e),e.input&&e.input.val(r?"":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(e){var t=this._get(e,"stepMonths"),n="#"+e.id.replace(/\\\\/g,"\\");e.dpDiv.find("[data-handler]").map(function(){var e={prev:function(){window["DP_jQuery_"+dpuuid].datepicker._adjustDate(n,-t,"M")},next:function(){window["DP_jQuery_"+dpuuid].datepicker._adjustDate(n,+t,"M")},hide:function(){window["DP_jQuery_"+dpuuid].datepicker._hideDatepicker()},today:function(){window["DP_jQuery_"+dpuuid].datepicker._gotoToday(n)},selectDay:function(){return window["DP_jQuery_"+dpuuid].datepicker._selectDay(n,+this.getAttribute("data-month"),+this.getAttribute("data-year"),this),!1},selectMonth:function(){return window["DP_jQuery_"+dpuuid].datepicker._selectMonthYear(n,this,"M"),!1},selectYear:function(){return window["DP_jQuery_"+dpuuid].datepicker._selectMonthYear(n,this,"Y"),!1}};$(this).bind(this.getAttribute("data-event"),e[this.getAttribute("data-handler")])})},_generateHTML:function(e){var t=new Date;t=this._daylightSavingAdjust(new Date(t.getFullYear(),t.getMonth(),t.getDate()));var n=this._get(e,"isRTL"),r=this._get(e,"showButtonPanel"),i=this._get(e,"hideIfNoPrevNext"),s=this._get(e,"navigationAsDateFormat"),o=this._getNumberOfMonths(e),u=this._get(e,"showCurrentAtPos"),a=this._get(e,"stepMonths"),f=o[0]!=1||o[1]!=1,l=this._daylightSavingAdjust(e.currentDay?new Date(e.currentYear,e.currentMonth,e.currentDay):new Date(9999,9,9)),c=this._getMinMaxDate(e,"min"),h=this._getMinMaxDate(e,"max"),p=e.drawMonth-u,d=e.drawYear;p<0&&(p+=12,d--);if(h){var v=this._daylightSavingAdjust(new Date(h.getFullYear(),h.getMonth()-o[0]*o[1]+1,h.getDate()));v=c&&v<c?c:v;while(this._daylightSavingAdjust(new Date(d,p,1))>v)p--,p<0&&(p=11,d--)}e.drawMonth=p,e.drawYear=d;var m=this._get(e,"prevText");m=s?this.formatDate(m,this._daylightSavingAdjust(new Date(d,p-a,1)),this._getFormatConfig(e)):m;var g=this._canAdjustMonth(e,-1,d,p)?'<a class="ui-datepicker-prev ui-corner-all" data-handler="prev" data-event="click" title="'+m+'"><span class="ui-icon ui-icon-circle-triangle-'+(n?"e":"w")+'">'+m+"</span></a>":i?"":'<a class="ui-datepicker-prev ui-corner-all ui-state-disabled" title="'+m+'"><span class="ui-icon ui-icon-circle-triangle-'+(n?"e":"w")+'">'+m+"</span></a>",y=this._get(e,"nextText");y=s?this.formatDate(y,this._daylightSavingAdjust(new Date(d,p+a,1)),this._getFormatConfig(e)):y;var b=this._canAdjustMonth(e,1,d,p)?'<a class="ui-datepicker-next ui-corner-all" data-handler="next" data-event="click" title="'+y+'"><span class="ui-icon ui-icon-circle-triangle-'+(n?"w":"e")+'">'+y+"</span></a>":i?"":'<a class="ui-datepicker-next ui-corner-all ui-state-disabled" title="'+y+'"><span class="ui-icon ui-icon-circle-triangle-'+(n?"w":"e")+'">'+y+"</span></a>",w=this._get(e,"currentText"),E=this._get(e,"gotoCurrent")&&e.currentDay?l:t;w=s?this.formatDate(w,E,this._getFormatConfig(e)):w;var S=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>",x=r?'<div class="ui-datepicker-buttonpane ui-widget-content">'+(n?S:"")+(this._isInRange(e,E)?'<button type="button" class="ui-datepicker-current ui-state-default ui-priority-secondary ui-corner-all" data-handler="today" data-event="click">'+w+"</button>":"")+(n?"":S)+"</div>":"",T=parseInt(this._get(e,"firstDay"),10);T=isNaN(T)?0:T;var N=this._get(e,"showWeek"),C=this._get(e,"dayNames"),k=this._get(e,"dayNamesShort"),L=this._get(e,"dayNamesMin"),A=this._get(e,"monthNames"),O=this._get(e,"monthNamesShort"),M=this._get(e,"beforeShowDay"),_=this._get(e,"showOtherMonths"),D=this._get(e,"selectOtherMonths"),P=this._get(e,"calculateWeek")||this.iso8601Week,H=this._getDefaultDate(e),B="";for(var j=0;j<o[0];j++){var F="";this.maxRows=4;for(var I=0;I<o[1];I++){var q=this._daylightSavingAdjust(new Date(d,p,e.selectedDay)),R=" ui-corner-all",U="";if(f){U+='<div class="ui-datepicker-group';if(o[1]>1)switch(I){case 0:U+=" ui-datepicker-group-first",R=" ui-corner-"+(n?"right":"left");break;case o[1]-1:U+=" ui-datepicker-group-last",R=" ui-corner-"+(n?"left":"right");break;default:U+=" ui-datepicker-group-middle",R=""}U+='">'}U+='<div class="ui-datepicker-header ui-widget-header ui-helper-clearfix'+R+'">'+(/all|left/.test(R)&&j==0?n?b:g:"")+(/all|right/.test(R)&&j==0?n?g:b:"")+this._generateMonthYearHeader(e,p,d,c,h,j>0||I>0,A,O)+'</div><table class="ui-datepicker-calendar"><thead>'+"<tr>";var z=N?'<th class="ui-datepicker-week-col">'+this._get(e,"weekHeader")+"</th>":"";for(var W=0;W<7;W++){var X=(W+T)%7;z+="<th"+((W+T+6)%7>=5?' class="ui-datepicker-week-end"':"")+">"+'<span title="'+C[X]+'">'+L[X]+"</span></th>"}U+=z+"</tr></thead><tbody>";var V=this._getDaysInMonth(d,p);d==e.selectedYear&&p==e.selectedMonth&&(e.selectedDay=Math.min(e.selectedDay,V));var J=(this._getFirstDayOfMonth(d,p)-T+7)%7,K=Math.ceil((J+V)/7),Q=f?this.maxRows>K?this.maxRows:K:K;this.maxRows=Q;var G=this._daylightSavingAdjust(new Date(d,p,1-J));for(var Y=0;Y<Q;Y++){U+="<tr>";var Z=N?'<td class="ui-datepicker-week-col">'+this._get(e,"calculateWeek")(G)+"</td>":"";for(var W=0;W<7;W++){var et=M?M.apply(e.input?e.input[0]:null,[G]):[!0,""],tt=G.getMonth()!=p,nt=tt&&!D||!et[0]||c&&G<c||h&&G>h;Z+='<td class="'+((W+T+6)%7>=5?" ui-datepicker-week-end":"")+(tt?" ui-datepicker-other-month":"")+(G.getTime()==q.getTime()&&p==e.selectedMonth&&e._keyEvent||H.getTime()==G.getTime()&&H.getTime()==q.getTime()?" "+this._dayOverClass:"")+(nt?" "+this._unselectableClass+" ui-state-disabled":"")+(tt&&!_?"":" "+et[1]+(G.getTime()==l.getTime()?" "+this._currentClass:"")+(G.getTime()==t.getTime()?" ui-datepicker-today":""))+'"'+((!tt||_)&&et[2]?' title="'+et[2]+'"':"")+(nt?"":' data-handler="selectDay" data-event="click" data-month="'+G.getMonth()+'" data-year="'+G.getFullYear()+'"')+">"+(tt&&!_?" ":nt?'<span class="ui-state-default">'+G.getDate()+"</span>":'<a class="ui-state-default'+(G.getTime()==t.getTime()?" ui-state-highlight":"")+(G.getTime()==l.getTime()?" ui-state-active":"")+(tt?" ui-priority-secondary":"")+'" href="#">'+G.getDate()+"</a>")+"</td>",G.setDate(G.getDate()+1),G=this._daylightSavingAdjust(G)}U+=Z+"</tr>"}p++,p>11&&(p=0,d++),U+="</tbody></table>"+(f?"</div>"+(o[0]>0&&I==o[1]-1?'<div class="ui-datepicker-row-break"></div>':""):""),F+=U}B+=F}return B+=x+($.ui.ie6&&!e.inline?'<iframe src="javascript:false;" class="ui-datepicker-cover" frameborder="0"></iframe>':""),e._keyEvent=!1,B},_generateMonthYearHeader:function(e,t,n,r,i,s,o,u){var a=this._get(e,"changeMonth"),f=this._get(e,"changeYear"),l=this._get(e,"showMonthAfterYear"),c='<div class="ui-datepicker-title">',h="";if(s||!a)h+='<span class="ui-datepicker-month">'+o[t]+"</span>";else{var p=r&&r.getFullYear()==n,d=i&&i.getFullYear()==n;h+='<select class="ui-datepicker-month" data-handler="selectMonth" data-event="change">';for(var v=0;v<12;v++)(!p||v>=r.getMonth())&&(!d||v<=i.getMonth())&&(h+='<option value="'+v+'"'+(v==t?' selected="selected"':"")+">"+u[v]+"</option>");h+="</select>"}l||(c+=h+(s||!a||!f?" ":""));if(!e.yearshtml){e.yearshtml="";if(s||!f)c+='<span class="ui-datepicker-year">'+n+"</span>";else{var m=this._get(e,"yearRange").split(":"),g=(new Date).getFullYear(),y=function(e){var t=e.match(/c[+-].*/)?n+parseInt(e.substring(1),10):e.match(/[+-].*/)?g+parseInt(e,10):parseInt(e,10);return isNaN(t)?g:t},b=y(m[0]),w=Math.max(b,y(m[1]||""));b=r?Math.max(b,r.getFullYear()):b,w=i?Math.min(w,i.getFullYear()):w,e.yearshtml+='<select class="ui-datepicker-year" data-handler="selectYear" data-event="change">';for(;b<=w;b++)e.yearshtml+='<option value="'+b+'"'+(b==n?' selected="selected"':"")+">"+b+"</option>";e.yearshtml+="</select>",c+=e.yearshtml,e.yearshtml=null}}return c+=this._get(e,"yearSuffix"),l&&(c+=(s||!a||!f?" ":"")+h),c+="</div>",c},_adjustInstDate:function(e,t,n){var r=e.drawYear+(n=="Y"?t:0),i=e.drawMonth+(n=="M"?t:0),s=Math.min(e.selectedDay,this._getDaysInMonth(r,i))+(n=="D"?t:0),o=this._restrictMinMax(e,this._daylightSavingAdjust(new Date(r,i,s)));e.selectedDay=o.getDate(),e.drawMonth=e.selectedMonth=o.getMonth(),e.drawYear=e.selectedYear=o.getFullYear(),(n=="M"||n=="Y")&&this._notifyChange(e)},_restrictMinMax:function(e,t){var n=this._getMinMaxDate(e,"min"),r=this._getMinMaxDate(e,"max"),i=n&&t<n?n:t;return i=r&&i>r?r:i,i},_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 t==null?[1,1]:typeof t=="number"?[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,n,r){var i=this._getNumberOfMonths(e),s=this._daylightSavingAdjust(new Date(n,r+(t<0?t:i[0]*i[1]),1));return t<0&&s.setDate(this._getDaysInMonth(s.getFullYear(),s.getMonth())),this._isInRange(e,s)},_isInRange:function(e,t){var n=this._getMinMaxDate(e,"min"),r=this._getMinMaxDate(e,"max");return(!n||t.getTime()>=n.getTime())&&(!r||t.getTime()<=r.getTime())},_getFormatConfig:function(e){var t=this._get(e,"shortYearCutoff");return t=typeof t!="string"?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,n,r){t||(e.currentDay=e.selectedDay,e.currentMonth=e.selectedMonth,e.currentYear=e.selectedYear);var i=t?typeof t=="object"?t:this._daylightSavingAdjust(new Date(r,n,t)):this._daylightSavingAdjust(new Date(e.currentYear,e.currentMonth,e.currentDay));return this.formatDate(this._get(e,"dateFormat"),i,this._getFormatConfig(e))}}),$.fn.datepicker=function(e){if(!this.length)return this;$.datepicker.initialized||($(document).mousedown($.datepicker._checkExternalClick).find(document.body).append($.datepicker.dpDiv),$.datepicker.initialized=!0);var t=Array.prototype.slice.call(arguments,1);return typeof e!="string"||e!="isDisabled"&&e!="getDate"&&e!="widget"?e=="option"&&arguments.length==2&&typeof arguments[1]=="string"?$.datepicker["_"+e+"Datepicker"].apply($.datepicker,[this[0]].concat(t)):this.each(function(){typeof e=="string"?$.datepicker["_"+e+"Datepicker"].apply($.datepicker,[this].concat(t)):$.datepicker._attachDatepicker(this,e)}):$.datepicker["_"+e+"Datepicker"].apply($.datepicker,[this[0]].concat(t))},$.datepicker=new Datepicker,$.datepicker.initialized=!1,$.datepicker.uuid=(new Date).getTime(),$.datepicker.version="1.9.2",window["DP_jQuery_"+dpuuid]=$})(jQuery);(function(e,t){var n="ui-dialog ui-widget ui-widget-content ui-corner-all ",r={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.9.2",options:{autoOpen:!0,buttons:{},closeOnEscape:!0,closeText:"close",dialogClass:"",draggable:!0,hide:null,height:"auto",maxHeight:!1,maxWidth:!1,minHeight:150,minWidth:150,modal:!1,position:{my:"center",at:"center",of:window,collision:"fit",using:function(t){var n=e(this).css(t).offset().top;n<0&&e(this).css("top",t.top-n)}},resizable:!0,show:null,stack:!0,title:"",width:300,zIndex:1e3},_create:function(){this.originalTitle=this.element.attr("title"),typeof this.originalTitle!="string"&&(this.originalTitle=""),this.oldPosition={parent:this.element.parent(),index:this.element.parent().children().index(this.element)},this.options.title=this.options.title||this.originalTitle;var t=this,r=this.options,i=r.title||" ",s,o,u,a,f;s=(this.uiDialog=e("<div>")).addClass(n+r.dialogClass).css({display:"none",outline:0,zIndex:r.zIndex}).attr("tabIndex",-1).keydown(function(n){r.closeOnEscape&&!n.isDefaultPrevented()&&n.keyCode&&n.keyCode===e.ui.keyCode.ESCAPE&&(t.close(n),n.preventDefault())}).mousedown(function(e){t.moveToTop(!1,e)}).appendTo("body"),this.element.show().removeAttr("title").addClass("ui-dialog-content ui-widget-content").appendTo(s),o=(this.uiDialogTitlebar=e("<div>")).addClass("ui-dialog-titlebar ui-widget-header ui-corner-all ui-helper-clearfix").bind("mousedown",function(){s.focus()}).prependTo(s),u=e("<a href='#'></a>").addClass("ui-dialog-titlebar-close ui-corner-all").attr("role","button").click(function(e){e.preventDefault(),t.close(e)}).appendTo(o),(this.uiDialogTitlebarCloseText=e("<span>")).addClass("ui-icon ui-icon-closethick").text(r.closeText).appendTo(u),a=e("<span>").uniqueId().addClass("ui-dialog-title").html(i).prependTo(o),f=(this.uiDialogButtonPane=e("<div>")).addClass("ui-dialog-buttonpane ui-widget-content ui-helper-clearfix"),(this.uiButtonSet=e("<div>")).addClass("ui-dialog-buttonset").appendTo(f),s.attr({role:"dialog","aria-labelledby":a.attr("id")}),o.find("*").add(o).disableSelection(),this._hoverable(u),this._focusable(u),r.draggable&&e.fn.draggable&&this._makeDraggable(),r.resizable&&e.fn.resizable&&this._makeResizable(),this._createButtons(r.buttons),this._isOpen=!1,e.fn.bgiframe&&s.bgiframe(),this._on(s,{keydown:function(t){if(!r.modal||t.keyCode!==e.ui.keyCode.TAB)return;var n=e(":tabbable",s),i=n.filter(":first"),o=n.filter(":last");if(t.target===o[0]&&!t.shiftKey)return i.focus(1),!1;if(t.target===i[0]&&t.shiftKey)return o.focus(1),!1}})},_init:function(){this.options.autoOpen&&this.open()},_destroy:function(){var e,t=this.oldPosition;this.overlay&&this.overlay.destroy(),this.uiDialog.hide(),this.element.removeClass("ui-dialog-content ui-widget-content").hide().appendTo("body"),this.uiDialog.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},close:function(t){var n=this,r,i;if(!this._isOpen)return;if(!1===this._trigger("beforeClose",t))return;return this._isOpen=!1,this.overlay&&this.overlay.destroy(),this.options.hide?this._hide(this.uiDialog,this.options.hide,function(){n._trigger("close",t)}):(this.uiDialog.hide(),this._trigger("close",t)),e.ui.dialog.overlay.resize(),this.options.modal&&(r=0,e(".ui-dialog").each(function(){this!==n.uiDialog[0]&&(i=e(this).css("z-index"),isNaN(i)||(r=Math.max(r,i)))}),e.ui.dialog.maxZ=r),this},isOpen:function(){return this._isOpen},moveToTop:function(t,n){var r=this.options,i;return r.modal&&!t||!r.stack&&!r.modal?this._trigger("focus",n):(r.zIndex>e.ui.dialog.maxZ&&(e.ui.dialog.maxZ=r.zIndex),this.overlay&&(e.ui.dialog.maxZ+=1,e.ui.dialog.overlay.maxZ=e.ui.dialog.maxZ,this.overlay.$el.css("z-index",e.ui.dialog.overlay.maxZ)),i={scrollTop:this.element.scrollTop(),scrollLeft:this.element.scrollLeft()},e.ui.dialog.maxZ+=1,this.uiDialog.css("z-index",e.ui.dialog.maxZ),this.element.attr(i),this._trigger("focus",n),this)},open:function(){if(this._isOpen)return;var t,n=this.options,r=this.uiDialog;return this._size(),this._position(n.position),r.show(n.show),this.overlay=n.modal?new e.ui.dialog.overlay(this):null,this.moveToTop(!0),t=this.element.find(":tabbable"),t.length||(t=this.uiDialogButtonPane.find(":tabbable"),t.length||(t=r)),t.eq(0).focus(),this._isOpen=!0,this._trigger("open"),this},_createButtons:function(t){var n=this,r=!1;this.uiDialogButtonPane.remove(),this.uiButtonSet.empty(),typeof t=="object"&&t!==null&&e.each(t,function(){return!(r=!0)}),r?(e.each(t,function(t,r){var i,s;r=e.isFunction(r)?{click:r,text:t}:r,r=e.extend({type:"button"},r),s=r.click,r.click=function(){s.apply(n.element[0],arguments)},i=e("<button></button>",r).appendTo(n.uiButtonSet),e.fn.button&&i.button()}),this.uiDialog.addClass("ui-dialog-buttons"),this.uiDialogButtonPane.appendTo(this.uiDialog)):this.uiDialog.removeClass("ui-dialog-buttons")},_makeDraggable:function(){function r(e){return{position:e.position,offset:e.offset}}var t=this,n=this.options;this.uiDialog.draggable({cancel:".ui-dialog-content, .ui-dialog-titlebar-close",handle:".ui-dialog-titlebar",containment:"document",start:function(n,i){e(this).addClass("ui-dialog-dragging"),t._trigger("dragStart",n,r(i))},drag:function(e,n){t._trigger("drag",e,r(n))},stop:function(i,s){n.position=[s.position.left-t.document.scrollLeft(),s.position.top-t.document.scrollTop()],e(this).removeClass("ui-dialog-dragging"),t._trigger("dragStop",i,r(s)),e.ui.dialog.overlay.resize()}})},_makeResizable:function(n){function u(e){return{originalPosition:e.originalPosition,originalSize:e.originalSize,position:e.position,size:e.size}}n=n===t?this.options.resizable:n;var r=this,i=this.options,s=this.uiDialog.css("position"),o=typeof n=="string"?n:"n,e,s,w,se,sw,ne,nw";this.uiDialog.resizable({cancel:".ui-dialog-content",containment:"document",alsoResize:this.element,maxWidth:i.maxWidth,maxHeight:i.maxHeight,minWidth:i.minWidth,minHeight:this._minHeight(),handles:o,start:function(t,n){e(this).addClass("ui-dialog-resizing"),r._trigger("resizeStart",t,u(n))},resize:function(e,t){r._trigger("resize",e,u(t))},stop:function(t,n){e(this).removeClass("ui-dialog-resizing"),i.height=e(this).height(),i.width=e(this).width(),r._trigger("resizeStop",t,u(n)),e.ui.dialog.overlay.resize()}}).css("position",s).find(".ui-resizable-se").addClass("ui-icon ui-icon-grip-diagonal-se")},_minHeight:function(){var e=this.options;return e.height==="auto"?e.minHeight:Math.min(e.minHeight,e.height)},_position:function(t){var n=[],r=[0,0],i;if(t){if(typeof t=="string"||typeof t=="object"&&"0"in t)n=t.split?t.split(" "):[t[0],t[1]],n.length===1&&(n[1]=n[0]),e.each(["left","top"],function(e,t){+n[e]===n[e]&&(r[e]=n[e],n[e]=t)}),t={my:n[0]+(r[0]<0?r[0]:"+"+r[0])+" "+n[1]+(r[1]<0?r[1]:"+"+r[1]),at:n.join(" ")};t=e.extend({},e.ui.dialog.prototype.options.position,t)}else t=e.ui.dialog.prototype.options.position;i=this.uiDialog.is(":visible"),i||this.uiDialog.show(),this.uiDialog.position(t),i||this.uiDialog.hide()},_setOptions:function(t){var n=this,s={},o=!1;e.each(t,function(e,t){n._setOption(e,t),e in r&&(o=!0),e in i&&(s[e]=t)}),o&&this._size(),this.uiDialog.is(":data(resizable)")&&this.uiDialog.resizable("option",s)},_setOption:function(t,r){var i,s,o=this.uiDialog;switch(t){case"buttons":this._createButtons(r);break;case"closeText":this.uiDialogTitlebarCloseText.text(""+r);break;case"dialogClass":o.removeClass(this.options.dialogClass).addClass(n+r);break;case"disabled":r?o.addClass("ui-dialog-disabled"):o.removeClass("ui-dialog-disabled");break;case"draggable":i=o.is(":data(draggable)"),i&&!r&&o.draggable("destroy"),!i&&r&&this._makeDraggable();break;case"position":this._position(r);break;case"resizable":s=o.is(":data(resizable)"),s&&!r&&o.resizable("destroy"),s&&typeof r=="string"&&o.resizable("option","handles",r),!s&&r!==!1&&this._makeResizable(r);break;case"title":e(".ui-dialog-title",this.uiDialogTitlebar).html(""+(r||" "))}this._super(t,r)},_size:function(){var t,n,r,i=this.options,s=this.uiDialog.is(":visible");this.element.show().css({width:"auto",minHeight:0,height:0}),i.minWidth>i.width&&(i.width=i.minWidth),t=this.uiDialog.css({height:"auto",width:i.width}).outerHeight(),n=Math.max(0,i.minHeight-t),i.height==="auto"?e.support.minHeight?this.element.css({minHeight:n,height:"auto"}):(this.uiDialog.show(),r=this.element.css("height","auto").height(),s||this.uiDialog.hide(),this.element.height(Math.max(r,n))):this.element.height(Math.max(i.height-t,0)),this.uiDialog.is(":data(resizable)")&&this.uiDialog.resizable("option","minHeight",this._minHeight())}}),e.extend(e.ui.dialog,{uuid:0,maxZ:0,getTitleId:function(e){var t=e.attr("id");return t||(this.uuid+=1,t=this.uuid),"ui-dialog-title-"+t},overlay:function(t){this.$el=e.ui.dialog.overlay.create(t)}}),e.extend(e.ui.dialog.overlay,{instances:[],oldInstances:[],maxZ:0,events:e.map("focus,mousedown,mouseup,keydown,keypress,click".split(","),function(e){return e+".dialog-overlay"}).join(" "),create:function(t){this.instances.length===0&&(setTimeout(function(){e.ui.dialog.overlay.instances.length&&e(document).bind(e.ui.dialog.overlay.events,function(t){if(e(t.target).zIndex()<e.ui.dialog.overlay.maxZ)return!1})},1),e(window).bind("resize.dialog-overlay",e.ui.dialog.overlay.resize));var n=this.oldInstances.pop()||e("<div>").addClass("ui-widget-overlay");return e(document).bind("keydown.dialog-overlay",function(r){var i=e.ui.dialog.overlay.instances;i.length!==0&&i[i.length-1]===n&&t.options.closeOnEscape&&!r.isDefaultPrevented()&&r.keyCode&&r.keyCode===e.ui.keyCode.ESCAPE&&(t.close(r),r.preventDefault())}),n.appendTo(document.body).css({width:this.width(),height:this.height()}),e.fn.bgiframe&&n.bgiframe(),this.instances.push(n),n},destroy:function(t){var n=e.inArray(t,this.instances),r=0;n!==-1&&this.oldInstances.push(this.instances.splice(n,1)[0]),this.instances.length===0&&e([document,window]).unbind(".dialog-overlay"),t.height(0).width(0).remove(),e.each(this.instances,function(){r=Math.max(r,this.css("z-index"))}),this.maxZ=r},height:function(){var t,n;return e.ui.ie?(t=Math.max(document.documentElement.scrollHeight,document.body.scrollHeight),n=Math.max(document.documentElement.offsetHeight,document.body.offsetHeight),t<n?e(window).height()+"px":t+"px"):e(document).height()+"px"},width:function(){var t,n;return e.ui.ie?(t=Math.max(document.documentElement.scrollWidth,document.body.scrollWidth),n=Math.max(document.documentElement.offsetWidth,document.body.offsetWidth),t<n?e(window).width()+"px":t+"px"):e(document).width()+"px"},resize:function(){var t=e([]);e.each(e.ui.dialog.overlay.instances,function(){t=t.add(this)}),t.css({width:0,height:0}).css({width:e.ui.dialog.overlay.width(),height:e.ui.dialog.overlay.height()})}}),e.extend(e.ui.dialog.overlay.prototype,{destroy:function(){e.ui.dialog.overlay.destroy(this.$el)}})})(jQuery);(function(e,t){e.widget("ui.draggable",e.ui.mouse,{version:"1.9.2",widgetEventPrefix:"drag",options:{addClasses:!0,appendTo:"parent",axis:!1,connectToSortable:!1,containment:!1,cursor:"auto",cursorAt:!1,grid:!1,handle:!1,helper:"original",iframeFix:!1,opacity:!1,refreshPositions:!1,revert:!1,revertDuration:500,scope:"default",scroll:!0,scrollSensitivity:20,scrollSpeed:20,snap:!1,snapMode:"both",snapTolerance:20,stack:!1,zIndex:!1},_create:function(){this.options.helper=="original"&&!/^(?: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(t){var n=this.options;return this.helper||n.disabled||e(t.target).is(".ui-resizable-handle")?!1:(this.handle=this._getHandle(t),this.handle?(e(n.iframeFix===!0?"iframe":n.iframeFix).each(function(){e('<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(e(this).offset()).appendTo("body")}),!0):!1)},_mouseStart:function(t){var n=this.options;return this.helper=this._createHelper(t),this.helper.addClass("ui-draggable-dragging"),this._cacheHelperProportions(),e.ui.ddmanager&&(e.ui.ddmanager.current=this),this._cacheMargins(),this.cssPosition=this.helper.css("position"),this.scrollParent=this.helper.scrollParent(),this.offset=this.positionAbs=this.element.offset(),this.offset={top:this.offset.top-this.margins.top,left:this.offset.left-this.margins.left},e.extend(this.offset,{click:{left:t.pageX-this.offset.left,top:t.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()}),this.originalPosition=this.position=this._generatePosition(t),this.originalPageX=t.pageX,this.originalPageY=t.pageY,n.cursorAt&&this._adjustOffsetFromHelper(n.cursorAt),n.containment&&this._setContainment(),this._trigger("start",t)===!1?(this._clear(),!1):(this._cacheHelperProportions(),e.ui.ddmanager&&!n.dropBehaviour&&e.ui.ddmanager.prepareOffsets(this,t),this._mouseDrag(t,!0),e.ui.ddmanager&&e.ui.ddmanager.dragStart(this,t),!0)},_mouseDrag:function(t,n){this.position=this._generatePosition(t),this.positionAbs=this._convertPositionTo("absolute");if(!n){var r=this._uiHash();if(this._trigger("drag",t,r)===!1)return this._mouseUp({}),!1;this.position=r.position}if(!this.options.axis||this.options.axis!="y")this.helper[0].style.left=this.position.left+"px";if(!this.options.axis||this.options.axis!="x")this.helper[0].style.top=this.position.top+"px";return e.ui.ddmanager&&e.ui.ddmanager.drag(this,t),!1},_mouseStop:function(t){var n=!1;e.ui.ddmanager&&!this.options.dropBehaviour&&(n=e.ui.ddmanager.drop(this,t)),this.dropped&&(n=this.dropped,this.dropped=!1);var r=this.element[0],i=!1;while(r&&(r=r.parentNode))r==document&&(i=!0);if(!i&&this.options.helper==="original")return!1;if(this.options.revert=="invalid"&&!n||this.options.revert=="valid"&&n||this.options.revert===!0||e.isFunction(this.options.revert)&&this.options.revert.call(this.element,n)){var s=this;e(this.helper).animate(this.originalPosition,parseInt(this.options.revertDuration,10),function(){s._trigger("stop",t)!==!1&&s._clear()})}else this._trigger("stop",t)!==!1&&this._clear();return!1},_mouseUp:function(t){return e("div.ui-draggable-iframeFix").each(function(){this.parentNode.removeChild(this)}),e.ui.ddmanager&&e.ui.ddmanager.dragStop(this,t),e.ui.mouse.prototype._mouseUp.call(this,t)},cancel:function(){return this.helper.is(".ui-draggable-dragging")?this._mouseUp({}):this._clear(),this},_getHandle:function(t){var n=!this.options.handle||!e(this.options.handle,this.element).length?!0:!1;return e(this.options.handle,this.element).find("*").andSelf().each(function(){this==t.target&&(n=!0)}),n},_createHelper:function(t){var n=this.options,r=e.isFunction(n.helper)?e(n.helper.apply(this.element[0],[t])):n.helper=="clone"?this.element.clone().removeAttr("id"):this.element;return r.parents("body").length||r.appendTo(n.appendTo=="parent"?this.element[0].parentNode:n.appendTo),r[0]!=this.element[0]&&!/(fixed|absolute)/.test(r.css("position"))&&r.css("position","absolute"),r},_adjustOffsetFromHelper:function(t){typeof t=="string"&&(t=t.split(" ")),e.isArray(t)&&(t={left:+t[0],top:+t[1]||0}),"left"in t&&(this.offset.click.left=t.left+this.margins.left),"right"in t&&(this.offset.click.left=this.helperProportions.width-t.right+this.margins.left),"top"in t&&(this.offset.click.top=t.top+this.margins.top),"bottom"in t&&(this.offset.click.top=this.helperProportions.height-t.bottom+this.margins.top)},_getParentOffset:function(){this.offsetParent=this.helper.offsetParent();var t=this.offsetParent.offset();this.cssPosition=="absolute"&&this.scrollParent[0]!=document&&e.contains(this.scrollParent[0],this.offsetParent[0])&&(t.left+=this.scrollParent.scrollLeft(),t.top+=this.scrollParent.scrollTop());if(this.offsetParent[0]==document.body||this.offsetParent[0].tagName&&this.offsetParent[0].tagName.toLowerCase()=="html"&&e.ui.ie)t={top:0,left:0};return{top:t.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:t.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if(this.cssPosition=="relative"){var e=this.element.position();return{top:e.top-(parseInt(this.helper.css("top"),10)||0)+this.scrollParent.scrollTop(),left:e.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 t=this.options;t.containment=="parent"&&(t.containment=this.helper[0].parentNode);if(t.containment=="document"||t.containment=="window")this.containment=[t.containment=="document"?0:e(window).scrollLeft()-this.offset.relative.left-this.offset.parent.left,t.containment=="document"?0:e(window).scrollTop()-this.offset.relative.top-this.offset.parent.top,(t.containment=="document"?0:e(window).scrollLeft())+e(t.containment=="document"?document:window).width()-this.helperProportions.width-this.margins.left,(t.containment=="document"?0:e(window).scrollTop())+(e(t.containment=="document"?document:window).height()||document.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top];if(!/^(document|window|parent)$/.test(t.containment)&&t.containment.constructor!=Array){var n=e(t.containment),r=n[0];if(!r)return;var i=n.offset(),s=e(r).css("overflow")!="hidden";this.containment=[(parseInt(e(r).css("borderLeftWidth"),10)||0)+(parseInt(e(r).css("paddingLeft"),10)||0),(parseInt(e(r).css("borderTopWidth"),10)||0)+(parseInt(e(r).css("paddingTop"),10)||0),(s?Math.max(r.scrollWidth,r.offsetWidth):r.offsetWidth)-(parseInt(e(r).css("borderLeftWidth"),10)||0)-(parseInt(e(r).css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left-this.margins.right,(s?Math.max(r.scrollHeight,r.offsetHeight):r.offsetHeight)-(parseInt(e(r).css("borderTopWidth"),10)||0)-(parseInt(e(r).css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top-this.margins.bottom],this.relative_container=n}else t.containment.constructor==Array&&(this.containment=t.containment)},_convertPositionTo:function(t,n){n||(n=this.position);var r=t=="absolute"?1:-1,i=this.options,s=this.cssPosition!="absolute"||this.scrollParent[0]!=document&&!!e.contains(this.scrollParent[0],this.offsetParent[0])?this.scrollParent:this.offsetParent,o=/(html|body)/i.test(s[0].tagName);return{top:n.top+this.offset.relative.top*r+this.offset.parent.top*r-(this.cssPosition=="fixed"?-this.scrollParent.scrollTop():o?0:s.scrollTop())*r,left:n.left+this.offset.relative.left*r+this.offset.parent.left*r-(this.cssPosition=="fixed"?-this.scrollParent.scrollLeft():o?0:s.scrollLeft())*r}},_generatePosition:function(t){var n=this.options,r=this.cssPosition!="absolute"||this.scrollParent[0]!=document&&!!e.contains(this.scrollParent[0],this.offsetParent[0])?this.scrollParent:this.offsetParent,i=/(html|body)/i.test(r[0].tagName),s=t.pageX,o=t.pageY;if(this.originalPosition){var u;if(this.containment){if(this.relative_container){var a=this.relative_container.offset();u=[this.containment[0]+a.left,this.containment[1]+a.top,this.containment[2]+a.left,this.containment[3]+a.top]}else u=this.containment;t.pageX-this.offset.click.left<u[0]&&(s=u[0]+this.offset.click.left),t.pageY-this.offset.click.top<u[1]&&(o=u[1]+this.offset.click.top),t.pageX-this.offset.click.left>u[2]&&(s=u[2]+this.offset.click.left),t.pageY-this.offset.click.top>u[3]&&(o=u[3]+this.offset.click.top)}if(n.grid){var f=n.grid[1]?this.originalPageY+Math.round((o-this.originalPageY)/n.grid[1])*n.grid[1]:this.originalPageY;o=u?f-this.offset.click.top<u[1]||f-this.offset.click.top>u[3]?f-this.offset.click.top<u[1]?f+n.grid[1]:f-n.grid[1]:f:f;var l=n.grid[0]?this.originalPageX+Math.round((s-this.originalPageX)/n.grid[0])*n.grid[0]:this.originalPageX;s=u?l-this.offset.click.left<u[0]||l-this.offset.click.left>u[2]?l-this.offset.click.left<u[0]?l+n.grid[0]:l-n.grid[0]:l:l}}return{top:o-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+(this.cssPosition=="fixed"?-this.scrollParent.scrollTop():i?0:r.scrollTop()),left:s-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+(this.cssPosition=="fixed"?-this.scrollParent.scrollLeft():i?0:r.scrollLeft())}},_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(t,n,r){return r=r||this._uiHash(),e.ui.plugin.call(this,t,[n,r]),t=="drag"&&(this.positionAbs=this._convertPositionTo("absolute")),e.Widget.prototype._trigger.call(this,t,n,r)},plugins:{},_uiHash:function(e){return{helper:this.helper,position:this.position,originalPosition:this.originalPosition,offset:this.positionAbs}}}),e.ui.plugin.add("draggable","connectToSortable",{start:function(t,n){var r=e(this).data("draggable"),i=r.options,s=e.extend({},n,{item:r.element});r.sortables=[],e(i.connectToSortable).each(function(){var n=e.data(this,"sortable");n&&!n.options.disabled&&(r.sortables.push({instance:n,shouldRevert:n.options.revert}),n.refreshPositions(),n._trigger("activate",t,s))})},stop:function(t,n){var r=e(this).data("draggable"),i=e.extend({},n,{item:r.element});e.each(r.sortables,function(){this.instance.isOver?(this.instance.isOver=0,r.cancelHelperRemoval=!0,this.instance.cancelHelperRemoval=!1,this.shouldRevert&&(this.instance.options.revert=!0),this.instance._mouseStop(t),this.instance.options.helper=this.instance.options._helper,r.options.helper=="original"&&this.instance.currentItem.css({top:"auto",left:"auto"})):(this.instance.cancelHelperRemoval=!1,this.instance._trigger("deactivate",t,i))})},drag:function(t,n){var r=e(this).data("draggable"),i=this,s=function(t){var n=this.offset.click.top,r=this.offset.click.left,i=this.positionAbs.top,s=this.positionAbs.left,o=t.height,u=t.width,a=t.top,f=t.left;return e.ui.isOver(i+n,s+r,a,f,o,u)};e.each(r.sortables,function(s){var o=!1,u=this;this.instance.positionAbs=r.positionAbs,this.instance.helperProportions=r.helperProportions,this.instance.offset.click=r.offset.click,this.instance._intersectsWith(this.instance.containerCache)&&(o=!0,e.each(r.sortables,function(){return this.instance.positionAbs=r.positionAbs,this.instance.helperProportions=r.helperProportions,this.instance.offset.click=r.offset.click,this!=u&&this.instance._intersectsWith(this.instance.containerCache)&&e.ui.contains(u.instance.element[0],this.instance.element[0])&&(o=!1),o})),o?(this.instance.isOver||(this.instance.isOver=1,this.instance.currentItem=e(i).clone().removeAttr("id").appendTo(this.instance.element).data("sortable-item",!0),this.instance.options._helper=this.instance.options.helper,this.instance.options.helper=function(){return n.helper[0]},t.target=this.instance.currentItem[0],this.instance._mouseCapture(t,!0),this.instance._mouseStart(t,!0,!0),this.instance.offset.click.top=r.offset.click.top,this.instance.offset.click.left=r.offset.click.left,this.instance.offset.parent.left-=r.offset.parent.left-this.instance.offset.parent.left,this.instance.offset.parent.top-=r.offset.parent.top-this.instance.offset.parent.top,r._trigger("toSortable",t),r.dropped=this.instance.element,r.currentItem=r.element,this.instance.fromOutside=r),this.instance.currentItem&&this.instance._mouseDrag(t)):this.instance.isOver&&(this.instance.isOver=0,this.instance.cancelHelperRemoval=!0,this.instance.options.revert=!1,this.instance._trigger("out",t,this.instance._uiHash(this.instance)),this.instance._mouseStop(t,!0),this.instance.options.helper=this.instance.options._helper,this.instance.currentItem.remove(),this.instance.placeholder&&this.instance.placeholder.remove(),r._trigger("fromSortable",t),r.dropped=!1)})}}),e.ui.plugin.add("draggable","cursor",{start:function(t,n){var r=e("body"),i=e(this).data("draggable").options;r.css("cursor")&&(i._cursor=r.css("cursor")),r.css("cursor",i.cursor)},stop:function(t,n){var r=e(this).data("draggable").options;r._cursor&&e("body").css("cursor",r._cursor)}}),e.ui.plugin.add("draggable","opacity",{start:function(t,n){var r=e(n.helper),i=e(this).data("draggable").options;r.css("opacity")&&(i._opacity=r.css("opacity")),r.css("opacity",i.opacity)},stop:function(t,n){var r=e(this).data("draggable").options;r._opacity&&e(n.helper).css("opacity",r._opacity)}}),e.ui.plugin.add("draggable","scroll",{start:function(t,n){var r=e(this).data("draggable");r.scrollParent[0]!=document&&r.scrollParent[0].tagName!="HTML"&&(r.overflowOffset=r.scrollParent.offset())},drag:function(t,n){var r=e(this).data("draggable"),i=r.options,s=!1;if(r.scrollParent[0]!=document&&r.scrollParent[0].tagName!="HTML"){if(!i.axis||i.axis!="x")r.overflowOffset.top+r.scrollParent[0].offsetHeight-t.pageY<i.scrollSensitivity?r.scrollParent[0].scrollTop=s=r.scrollParent[0].scrollTop+i.scrollSpeed:t.pageY-r.overflowOffset.top<i.scrollSensitivity&&(r.scrollParent[0].scrollTop=s=r.scrollParent[0].scrollTop-i.scrollSpeed);if(!i.axis||i.axis!="y")r.overflowOffset.left+r.scrollParent[0].offsetWidth-t.pageX<i.scrollSensitivity?r.scrollParent[0].scrollLeft=s=r.scrollParent[0].scrollLeft+i.scrollSpeed:t.pageX-r.overflowOffset.left<i.scrollSensitivity&&(r.scrollParent[0].scrollLeft=s=r.scrollParent[0].scrollLeft-i.scrollSpeed)}else{if(!i.axis||i.axis!="x")t.pageY-e(document).scrollTop()<i.scrollSensitivity?s=e(document).scrollTop(e(document).scrollTop()-i.scrollSpeed):e(window).height()-(t.pageY-e(document).scrollTop())<i.scrollSensitivity&&(s=e(document).scrollTop(e(document).scrollTop()+i.scrollSpeed));if(!i.axis||i.axis!="y")t.pageX-e(document).scrollLeft()<i.scrollSensitivity?s=e(document).scrollLeft(e(document).scrollLeft()-i.scrollSpeed):e(window).width()-(t.pageX-e(document).scrollLeft())<i.scrollSensitivity&&(s=e(document).scrollLeft(e(document).scrollLeft()+i.scrollSpeed))}s!==!1&&e.ui.ddmanager&&!i.dropBehaviour&&e.ui.ddmanager.prepareOffsets(r,t)}}),e.ui.plugin.add("draggable","snap",{start:function(t,n){var r=e(this).data("draggable"),i=r.options;r.snapElements=[],e(i.snap.constructor!=String?i.snap.items||":data(draggable)":i.snap).each(function(){var t=e(this),n=t.offset();this!=r.element[0]&&r.snapElements.push({item:this,width:t.outerWidth(),height:t.outerHeight(),top:n.top,left:n.left})})},drag:function(t,n){var r=e(this).data("draggable"),i=r.options,s=i.snapTolerance,o=n.offset.left,u=o+r.helperProportions.width,a=n.offset.top,f=a+r.helperProportions.height;for(var l=r.snapElements.length-1;l>=0;l--){var c=r.snapElements[l].left,h=c+r.snapElements[l].width,p=r.snapElements[l].top,d=p+r.snapElements[l].height;if(!(c-s<o&&o<h+s&&p-s<a&&a<d+s||c-s<o&&o<h+s&&p-s<f&&f<d+s||c-s<u&&u<h+s&&p-s<a&&a<d+s||c-s<u&&u<h+s&&p-s<f&&f<d+s)){r.snapElements[l].snapping&&r.options.snap.release&&r.options.snap.release.call(r.element,t,e.extend(r._uiHash(),{snapItem:r.snapElements[l].item})),r.snapElements[l].snapping=!1;continue}if(i.snapMode!="inner"){var v=Math.abs(p-f)<=s,m=Math.abs(d-a)<=s,g=Math.abs(c-u)<=s,y=Math.abs(h-o)<=s;v&&(n.position.top=r._convertPositionTo("relative",{top:p-r.helperProportions.height,left:0}).top-r.margins.top),m&&(n.position.top=r._convertPositionTo("relative",{top:d,left:0}).top-r.margins.top),g&&(n.position.left=r._convertPositionTo("relative",{top:0,left:c-r.helperProportions.width}).left-r.margins.left),y&&(n.position.left=r._convertPositionTo("relative",{top:0,left:h}).left-r.margins.left)}var b=v||m||g||y;if(i.snapMode!="outer"){var v=Math.abs(p-a)<=s,m=Math.abs(d-f)<=s,g=Math.abs(c-o)<=s,y=Math.abs(h-u)<=s;v&&(n.position.top=r._convertPositionTo("relative",{top:p,left:0}).top-r.margins.top),m&&(n.position.top=r._convertPositionTo("relative",{top:d-r.helperProportions.height,left:0}).top-r.margins.top),g&&(n.position.left=r._convertPositionTo("relative",{top:0,left:c}).left-r.margins.left),y&&(n.position.left=r._convertPositionTo("relative",{top:0,left:h-r.helperProportions.width}).left-r.margins.left)}!r.snapElements[l].snapping&&(v||m||g||y||b)&&r.options.snap.snap&&r.options.snap.snap.call(r.element,t,e.extend(r._uiHash(),{snapItem:r.snapElements[l].item})),r.snapElements[l].snapping=v||m||g||y||b}}}),e.ui.plugin.add("draggable","stack",{start:function(t,n){var r=e(this).data("draggable").options,i=e.makeArray(e(r.stack)).sort(function(t,n){return(parseInt(e(t).css("zIndex"),10)||0)-(parseInt(e(n).css("zIndex"),10)||0)});if(!i.length)return;var s=parseInt(i[0].style.zIndex)||0;e(i).each(function(e){this.style.zIndex=s+e}),this[0].style.zIndex=s+i.length}}),e.ui.plugin.add("draggable","zIndex",{start:function(t,n){var r=e(n.helper),i=e(this).data("draggable").options;r.css("zIndex")&&(i._zIndex=r.css("zIndex")),r.css("zIndex",i.zIndex)},stop:function(t,n){var r=e(this).data("draggable").options;r._zIndex&&e(n.helper).css("zIndex",r._zIndex)}})})(jQuery);(function(e,t){e.widget("ui.droppable",{version:"1.9.2",widgetEventPrefix:"drop",options:{accept:"*",activeClass:!1,addClasses:!0,greedy:!1,hoverClass:!1,scope:"default",tolerance:"intersect"},_create:function(){var t=this.options,n=t.accept;this.isover=0,this.isout=1,this.accept=e.isFunction(n)?n:function(e){return e.is(n)},this.proportions={width:this.element[0].offsetWidth,height:this.element[0].offsetHeight},e.ui.ddmanager.droppables[t.scope]=e.ui.ddmanager.droppables[t.scope]||[],e.ui.ddmanager.droppables[t.scope].push(this),t.addClasses&&this.element.addClass("ui-droppable")},_destroy:function(){var t=e.ui.ddmanager.droppables[this.options.scope];for(var n=0;n<t.length;n++)t[n]==this&&t.splice(n,1);this.element.removeClass("ui-droppable ui-droppable-disabled")},_setOption:function(t,n){t=="accept"&&(this.accept=e.isFunction(n)?n:function(e){return e.is(n)}),e.Widget.prototype._setOption.apply(this,arguments)},_activate:function(t){var n=e.ui.ddmanager.current;this.options.activeClass&&this.element.addClass(this.options.activeClass),n&&this._trigger("activate",t,this.ui(n))},_deactivate:function(t){var n=e.ui.ddmanager.current;this.options.activeClass&&this.element.removeClass(this.options.activeClass),n&&this._trigger("deactivate",t,this.ui(n))},_over:function(t){var n=e.ui.ddmanager.current;if(!n||(n.currentItem||n.element)[0]==this.element[0])return;this.accept.call(this.element[0],n.currentItem||n.element)&&(this.options.hoverClass&&this.element.addClass(this.options.hoverClass),this._trigger("over",t,this.ui(n)))},_out:function(t){var n=e.ui.ddmanager.current;if(!n||(n.currentItem||n.element)[0]==this.element[0])return;this.accept.call(this.element[0],n.currentItem||n.element)&&(this.options.hoverClass&&this.element.removeClass(this.options.hoverClass),this._trigger("out",t,this.ui(n)))},_drop:function(t,n){var r=n||e.ui.ddmanager.current;if(!r||(r.currentItem||r.element)[0]==this.element[0])return!1;var i=!1;return this.element.find(":data(droppable)").not(".ui-draggable-dragging").each(function(){var t=e.data(this,"droppable");if(t.options.greedy&&!t.options.disabled&&t.options.scope==r.options.scope&&t.accept.call(t.element[0],r.currentItem||r.element)&&e.ui.intersect(r,e.extend(t,{offset:t.element.offset()}),t.options.tolerance))return i=!0,!1}),i?!1:this.accept.call(this.element[0],r.currentItem||r.element)?(this.options.activeClass&&this.element.removeClass(this.options.activeClass),this.options.hoverClass&&this.element.removeClass(this.options.hoverClass),this._trigger("drop",t,this.ui(r)),this.element):!1},ui:function(e){return{draggable:e.currentItem||e.element,helper:e.helper,position:e.position,offset:e.positionAbs}}}),e.ui.intersect=function(t,n,r){if(!n.offset)return!1;var i=(t.positionAbs||t.position.absolute).left,s=i+t.helperProportions.width,o=(t.positionAbs||t.position.absolute).top,u=o+t.helperProportions.height,a=n.offset.left,f=a+n.proportions.width,l=n.offset.top,c=l+n.proportions.height;switch(r){case"fit":return a<=i&&s<=f&&l<=o&&u<=c;case"intersect":return a<i+t.helperProportions.width/2&&s-t.helperProportions.width/2<f&&l<o+t.helperProportions.height/2&&u-t.helperProportions.height/2<c;case"pointer":var h=(t.positionAbs||t.position.absolute).left+(t.clickOffset||t.offset.click).left,p=(t.positionAbs||t.position.absolute).top+(t.clickOffset||t.offset.click).top,d=e.ui.isOver(p,h,l,a,n.proportions.height,n.proportions.width);return d;case"touch":return(o>=l&&o<=c||u>=l&&u<=c||o<l&&u>c)&&(i>=a&&i<=f||s>=a&&s<=f||i<a&&s>f);default:return!1}},e.ui.ddmanager={current:null,droppables:{"default":[]},prepareOffsets:function(t,n){var r=e.ui.ddmanager.droppables[t.options.scope]||[],i=n?n.type:null,s=(t.currentItem||t.element).find(":data(droppable)").andSelf();e:for(var o=0;o<r.length;o++){if(r[o].options.disabled||t&&!r[o].accept.call(r[o].element[0],t.currentItem||t.element))continue;for(var u=0;u<s.length;u++)if(s[u]==r[o].element[0]){r[o].proportions.height=0;continue e}r[o].visible=r[o].element.css("display")!="none";if(!r[o].visible)continue;i=="mousedown"&&r[o]._activate.call(r[o],n),r[o].offset=r[o].element.offset(),r[o].proportions={width:r[o].element[0].offsetWidth,height:r[o].element[0].offsetHeight}}},drop:function(t,n){var r=!1;return e.each(e.ui.ddmanager.droppables[t.options.scope]||[],function(){if(!this.options)return;!this.options.disabled&&this.visible&&e.ui.intersect(t,this,this.options.tolerance)&&(r=this._drop.call(this,n)||r),!this.options.disabled&&this.visible&&this.accept.call(this.element[0],t.currentItem||t.element)&&(this.isout=1,this.isover=0,this._deactivate.call(this,n))}),r},dragStart:function(t,n){t.element.parentsUntil("body").bind("scroll.droppable",function(){t.options.refreshPositions||e.ui.ddmanager.prepareOffsets(t,n)})},drag:function(t,n){t.options.refreshPositions&&e.ui.ddmanager.prepareOffsets(t,n),e.each(e.ui.ddmanager.droppables[t.options.scope]||[],function(){if(this.options.disabled||this.greedyChild||!this.visible)return;var r=e.ui.intersect(t,this,this.options.tolerance),i=!r&&this.isover==1?"isout":r&&this.isover==0?"isover":null;if(!i)return;var s;if(this.options.greedy){var o=this.options.scope,u=this.element.parents(":data(droppable)").filter(function(){return e.data(this,"droppable").options.scope===o});u.length&&(s=e.data(u[0],"droppable"),s.greedyChild=i=="isover"?1:0)}s&&i=="isover"&&(s.isover=0,s.isout=1,s._out.call(s,n)),this[i]=1,this[i=="isout"?"isover":"isout"]=0,this[i=="isover"?"_over":"_out"].call(this,n),s&&i=="isout"&&(s.isout=0,s.isover=1,s._over.call(s,n))})},dragStop:function(t,n){t.element.parentsUntil("body").unbind("scroll.droppable"),t.options.refreshPositions||e.ui.ddmanager.prepareOffsets(t,n)}}})(jQuery);jQuery.effects||function(e,t){var n=e.uiBackCompat!==!1,r="ui-effects-";e.effects={effect:{}},function(t,n){function p(e,t,n){var r=a[t.type]||{};return e==null?n||!t.def?null:t.def:(e=r.floor?~~e:parseFloat(e),isNaN(e)?t.def:r.mod?(e+r.mod)%r.mod:0>e?0:r.max<e?r.max:e)}function d(e){var n=o(),r=n._rgba=[];return e=e.toLowerCase(),h(s,function(t,i){var s,o=i.re.exec(e),a=o&&i.parse(o),f=i.space||"rgba";if(a)return s=n[f](a),n[u[f].cache]=s[u[f].cache],r=n._rgba=s._rgba,!1}),r.length?(r.join()==="0,0,0,0"&&t.extend(r,c.transparent),n):c[e]}function v(e,t,n){return n=(n+1)%1,n*6<1?e+(t-e)*n*6:n*2<1?t:n*3<2?e+(t-e)*(2/3-n)*6:e}var r="backgroundColor borderBottomColor borderLeftColor borderRightColor borderTopColor color columnRuleColor outlineColor textDecorationColor textEmphasisColor".split(" "),i=/^([\-+])=\s*(\d+\.?\d*)/,s=[{re:/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(?:,\s*(\d+(?:\.\d+)?)\s*)?\)/,parse:function(e){return[e[1],e[2],e[3],e[4]]}},{re:/rgba?\(\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*(?:,\s*(\d+(?:\.\d+)?)\s*)?\)/,parse:function(e){return[e[1]*2.55,e[2]*2.55,e[3]*2.55,e[4]]}},{re:/#([a-f0-9]{2})([a-f0-9]{2})([a-f0-9]{2})/,parse:function(e){return[parseInt(e[1],16),parseInt(e[2],16),parseInt(e[3],16)]}},{re:/#([a-f0-9])([a-f0-9])([a-f0-9])/,parse:function(e){return[parseInt(e[1]+e[1],16),parseInt(e[2]+e[2],16),parseInt(e[3]+e[3],16)]}},{re:/hsla?\(\s*(\d+(?:\.\d+)?)\s*,\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*(?:,\s*(\d+(?:\.\d+)?)\s*)?\)/,space:"hsla",parse:function(e){return[e[1],e[2]/100,e[3]/100,e[4]]}}],o=t.Color=function(e,n,r,i){return new t.Color.fn.parse(e,n,r,i)},u={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"}}}},a={"byte":{floor:!0,max:255},percent:{max:1},degrees:{mod:360,floor:!0}},f=o.support={},l=t("<p>")[0],c,h=t.each;l.style.cssText="background-color:rgba(1,1,1,.5)",f.rgba=l.style.backgroundColor.indexOf("rgba")>-1,h(u,function(e,t){t.cache="_"+e,t.props.alpha={idx:3,type:"percent",def:1}}),o.fn=t.extend(o.prototype,{parse:function(r,i,s,a){if(r===n)return this._rgba=[null,null,null,null],this;if(r.jquery||r.nodeType)r=t(r).css(i),i=n;var f=this,l=t.type(r),v=this._rgba=[];i!==n&&(r=[r,i,s,a],l="array");if(l==="string")return this.parse(d(r)||c._default);if(l==="array")return h(u.rgba.props,function(e,t){v[t.idx]=p(r[t.idx],t)}),this;if(l==="object")return r instanceof o?h(u,function(e,t){r[t.cache]&&(f[t.cache]=r[t.cache].slice())}):h(u,function(t,n){var i=n.cache;h(n.props,function(e,t){if(!f[i]&&n.to){if(e==="alpha"||r[e]==null)return;f[i]=n.to(f._rgba)}f[i][t.idx]=p(r[e],t,!0)}),f[i]&&e.inArray(null,f[i].slice(0,3))<0&&(f[i][3]=1,n.from&&(f._rgba=n.from(f[i])))}),this},is:function(e){var t=o(e),n=!0,r=this;return h(u,function(e,i){var s,o=t[i.cache];return o&&(s=r[i.cache]||i.to&&i.to(r._rgba)||[],h(i.props,function(e,t){if(o[t.idx]!=null)return n=o[t.idx]===s[t.idx],n})),n}),n},_space:function(){var e=[],t=this;return h(u,function(n,r){t[r.cache]&&e.push(n)}),e.pop()},transition:function(e,t){var n=o(e),r=n._space(),i=u[r],s=this.alpha()===0?o("transparent"):this,f=s[i.cache]||i.to(s._rgba),l=f.slice();return n=n[i.cache],h(i.props,function(e,r){var i=r.idx,s=f[i],o=n[i],u=a[r.type]||{};if(o===null)return;s===null?l[i]=o:(u.mod&&(o-s>u.mod/2?s+=u.mod:s-o>u.mod/2&&(s-=u.mod)),l[i]=p((o-s)*t+s,r))}),this[r](l)},blend:function(e){if(this._rgba[3]===1)return this;var n=this._rgba.slice(),r=n.pop(),i=o(e)._rgba;return o(t.map(n,function(e,t){return(1-r)*i[t]+r*e}))},toRgbaString:function(){var e="rgba(",n=t.map(this._rgba,function(e,t){return e==null?t>2?1:0:e});return n[3]===1&&(n.pop(),e="rgb("),e+n.join()+")"},toHslaString:function(){var e="hsla(",n=t.map(this.hsla(),function(e,t){return e==null&&(e=t>2?1:0),t&&t<3&&(e=Math.round(e*100)+"%"),e});return n[3]===1&&(n.pop(),e="hsl("),e+n.join()+")"},toHexString:function(e){var n=this._rgba.slice(),r=n.pop();return e&&n.push(~~(r*255)),"#"+t.map(n,function(e){return e=(e||0).toString(16),e.length===1?"0"+e:e}).join("")},toString:function(){return this._rgba[3]===0?"transparent":this.toRgbaString()}}),o.fn.parse.prototype=o.fn,u.hsla.to=function(e){if(e[0]==null||e[1]==null||e[2]==null)return[null,null,null,e[3]];var t=e[0]/255,n=e[1]/255,r=e[2]/255,i=e[3],s=Math.max(t,n,r),o=Math.min(t,n,r),u=s-o,a=s+o,f=a*.5,l,c;return o===s?l=0:t===s?l=60*(n-r)/u+360:n===s?l=60*(r-t)/u+120:l=60*(t-n)/u+240,f===0||f===1?c=f:f<=.5?c=u/a:c=u/(2-a),[Math.round(l)%360,c,f,i==null?1:i]},u.hsla.from=function(e){if(e[0]==null||e[1]==null||e[2]==null)return[null,null,null,e[3]];var t=e[0]/360,n=e[1],r=e[2],i=e[3],s=r<=.5?r*(1+n):r+n-r*n,o=2*r-s;return[Math.round(v(o,s,t+1/3)*255),Math.round(v(o,s,t)*255),Math.round(v(o,s,t-1/3)*255),i]},h(u,function(e,r){var s=r.props,u=r.cache,a=r.to,f=r.from;o.fn[e]=function(e){a&&!this[u]&&(this[u]=a(this._rgba));if(e===n)return this[u].slice();var r,i=t.type(e),l=i==="array"||i==="object"?e:arguments,c=this[u].slice();return h(s,function(e,t){var n=l[i==="object"?e:t.idx];n==null&&(n=c[t.idx]),c[t.idx]=p(n,t)}),f?(r=o(f(c)),r[u]=c,r):o(c)},h(s,function(n,r){if(o.fn[n])return;o.fn[n]=function(s){var o=t.type(s),u=n==="alpha"?this._hsla?"hsla":"rgba":e,a=this[u](),f=a[r.idx],l;return o==="undefined"?f:(o==="function"&&(s=s.call(this,f),o=t.type(s)),s==null&&r.empty?this:(o==="string"&&(l=i.exec(s),l&&(s=f+parseFloat(l[2])*(l[1]==="+"?1:-1))),a[r.idx]=s,this[u](a)))}})}),h(r,function(e,n){t.cssHooks[n]={set:function(e,r){var i,s,u="";if(t.type(r)!=="string"||(i=d(r))){r=o(i||r);if(!f.rgba&&r._rgba[3]!==1){s=n==="backgroundColor"?e.parentNode:e;while((u===""||u==="transparent")&&s&&s.style)try{u=t.css(s,"backgroundColor"),s=s.parentNode}catch(a){}r=r.blend(u&&u!=="transparent"?u:"_default")}r=r.toRgbaString()}try{e.style[n]=r}catch(l){}}},t.fx.step[n]=function(e){e.colorInit||(e.start=o(e.elem,n),e.end=o(e.end),e.colorInit=!0),t.cssHooks[n].set(e.elem,e.start.transition(e.end,e.pos))}}),t.cssHooks.borderColor={expand:function(e){var t={};return h(["Top","Right","Bottom","Left"],function(n,r){t["border"+r+"Color"]=e}),t}},c=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(){var t=this.ownerDocument.defaultView?this.ownerDocument.defaultView.getComputedStyle(this,null):this.currentStyle,n={},r,i;if(t&&t.length&&t[0]&&t[t[0]]){i=t.length;while(i--)r=t[i],typeof t[r]=="string"&&(n[e.camelCase(r)]=t[r])}else for(r in t)typeof t[r]=="string"&&(n[r]=t[r]);return n}function s(t,n){var i={},s,o;for(s in n)o=n[s],t[s]!==o&&!r[s]&&(e.fx.step[s]||!isNaN(parseFloat(o)))&&(i[s]=o);return i}var n=["add","remove","toggle"],r={border:1,borderBottom:1,borderColor:1,borderLeft:1,borderRight:1,borderTop:1,borderWidth:1,margin:1,padding:1};e.each(["borderLeftStyle","borderRightStyle","borderBottomStyle","borderTopStyle"],function(t,n){e.fx.step[n]=function(e){if(e.end!=="none"&&!e.setAttr||e.pos===1&&!e.setAttr)jQuery.style(e.elem,n,e.end),e.setAttr=!0}}),e.effects.animateClass=function(t,r,o,u){var a=e.speed(r,o,u);return this.queue(function(){var r=e(this),o=r.attr("class")||"",u,f=a.children?r.find("*").andSelf():r;f=f.map(function(){var t=e(this);return{el:t,start:i.call(this)}}),u=function(){e.each(n,function(e,n){t[n]&&r[n+"Class"](t[n])})},u(),f=f.map(function(){return this.end=i.call(this.el[0]),this.diff=s(this.start,this.end),this}),r.attr("class",o),f=f.map(function(){var t=this,n=e.Deferred(),r=jQuery.extend({},a,{queue:!1,complete:function(){n.resolve(t)}});return this.el.animate(this.diff,r),n.promise()}),e.when.apply(e,f.get()).done(function(){u(),e.each(arguments,function(){var t=this.el;e.each(this.diff,function(e){t.css(e,"")})}),a.complete.call(r[0])})})},e.fn.extend({_addClass:e.fn.addClass,addClass:function(t,n,r,i){return n?e.effects.animateClass.call(this,{add:t},n,r,i):this._addClass(t)},_removeClass:e.fn.removeClass,removeClass:function(t,n,r,i){return n?e.effects.animateClass.call(this,{remove:t},n,r,i):this._removeClass(t)},_toggleClass:e.fn.toggleClass,toggleClass:function(n,r,i,s,o){return typeof r=="boolean"||r===t?i?e.effects.animateClass.call(this,r?{add:n}:{remove:n},i,s,o):this._toggleClass(n,r):e.effects.animateClass.call(this,{toggle:n},r,i,s)},switchClass:function(t,n,r,i,s){return e.effects.animateClass.call(this,{add:n,remove:t},r,i,s)}})}(),function(){function i(t,n,r,i){e.isPlainObject(t)&&(n=t,t=t.effect),t={effect:t},n==null&&(n={}),e.isFunction(n)&&(i=n,r=null,n={});if(typeof n=="number"||e.fx.speeds[n])i=r,r=n,n={};return e.isFunction(r)&&(i=r,r=null),n&&e.extend(t,n),r=r||n.duration,t.duration=e.fx.off?0:typeof r=="number"?r:r in e.fx.speeds?e.fx.speeds[r]:e.fx.speeds._default,t.complete=i||n.complete,t}function s(t){return!t||typeof t=="number"||e.fx.speeds[t]?!0:typeof t=="string"&&!e.effects.effect[t]?n&&e.effects[t]?!1:!0:!1}e.extend(e.effects,{version:"1.9.2",save:function(e,t){for(var n=0;n<t.length;n++)t[n]!==null&&e.data(r+t[n],e[0].style[t[n]])},restore:function(e,n){var i,s;for(s=0;s<n.length;s++)n[s]!==null&&(i=e.data(r+n[s]),i===t&&(i=""),e.css(n[s],i))},setMode:function(e,t){return t==="toggle"&&(t=e.is(":hidden")?"show":"hide"),t},getBaseline:function(e,t){var n,r;switch(e[0]){case"top":n=0;break;case"middle":n=.5;break;case"bottom":n=1;break;default:n=e[0]/t.height}switch(e[1]){case"left":r=0;break;case"center":r=.5;break;case"right":r=1;break;default:r=e[1]/t.width}return{x:r,y:n}},createWrapper:function(t){if(t.parent().is(".ui-effects-wrapper"))return t.parent();var n={width:t.outerWidth(!0),height:t.outerHeight(!0),"float":t.css("float")},r=e("<div></div>").addClass("ui-effects-wrapper").css({fontSize:"100%",background:"transparent",border:"none",margin:0,padding:0}),i={width:t.width(),height:t.height()},s=document.activeElement;try{s.id}catch(o){s=document.body}return t.wrap(r),(t[0]===s||e.contains(t[0],s))&&e(s).focus(),r=t.parent(),t.css("position")==="static"?(r.css({position:"relative"}),t.css({position:"relative"})):(e.extend(n,{position:t.css("position"),zIndex:t.css("z-index")}),e.each(["top","left","bottom","right"],function(e,r){n[r]=t.css(r),isNaN(parseInt(n[r],10))&&(n[r]="auto")}),t.css({position:"relative",top:0,left:0,right:"auto",bottom:"auto"})),t.css(i),r.css(n).show()},removeWrapper:function(t){var n=document.activeElement;return t.parent().is(".ui-effects-wrapper")&&(t.parent().replaceWith(t),(t[0]===n||e.contains(t[0],n))&&e(n).focus()),t},setTransition:function(t,n,r,i){return i=i||{},e.each(n,function(e,n){var s=t.cssUnit(n);s[0]>0&&(i[n]=s[0]*r+s[1])}),i}}),e.fn.extend({effect:function(){function a(n){function u(){e.isFunction(i)&&i.call(r[0]),e.isFunction(n)&&n()}var r=e(this),i=t.complete,s=t.mode;(r.is(":hidden")?s==="hide":s==="show")?u():o.call(r[0],t,u)}var t=i.apply(this,arguments),r=t.mode,s=t.queue,o=e.effects.effect[t.effect],u=!o&&n&&e.effects[t.effect];return e.fx.off||!o&&!u?r?this[r](t.duration,t.complete):this.each(function(){t.complete&&t.complete.call(this)}):o?s===!1?this.each(a):this.queue(s||"fx",a):u.call(this,{options:t,duration:t.duration,callback:t.complete,mode:t.mode})},_show:e.fn.show,show:function(e){if(s(e))return this._show.apply(this,arguments);var t=i.apply(this,arguments);return t.mode="show",this.effect.call(this,t)},_hide:e.fn.hide,hide:function(e){if(s(e))return this._hide.apply(this,arguments);var t=i.apply(this,arguments);return t.mode="hide",this.effect.call(this,t)},__toggle:e.fn.toggle,toggle:function(t){if(s(t)||typeof t=="boolean"||e.isFunction(t))return this.__toggle.apply(this,arguments);var n=i.apply(this,arguments);return n.mode="toggle",this.effect.call(this,n)},cssUnit:function(t){var n=this.css(t),r=[];return e.each(["em","px","%","pt"],function(e,t){n.indexOf(t)>0&&(r=[parseFloat(n),t])}),r}})}(),function(){var t={};e.each(["Quad","Cubic","Quart","Quint","Expo"],function(e,n){t[n]=function(t){return Math.pow(t,e+2)}}),e.extend(t,{Sine:function(e){return 1-Math.cos(e*Math.PI/2)},Circ:function(e){return 1-Math.sqrt(1-e*e)},Elastic:function(e){return e===0||e===1?e:-Math.pow(2,8*(e-1))*Math.sin(((e-1)*80-7.5)*Math.PI/15)},Back:function(e){return e*e*(3*e-2)},Bounce:function(e){var t,n=4;while(e<((t=Math.pow(2,--n))-1)/11);return 1/Math.pow(4,3-n)-7.5625*Math.pow((t*3-2)/22-e,2)}}),e.each(t,function(t,n){e.easing["easeIn"+t]=n,e.easing["easeOut"+t]=function(e){return 1-n(1-e)},e.easing["easeInOut"+t]=function(e){return e<.5?n(e*2)/2:1-n(e*-2+2)/2}})}()}(jQuery);(function(e,t){var n=/up|down|vertical/,r=/up|left|vertical|horizontal/;e.effects.effect.blind=function(t,i){var s=e(this),o=["position","top","bottom","left","right","height","width"],u=e.effects.setMode(s,t.mode||"hide"),a=t.direction||"up",f=n.test(a),l=f?"height":"width",c=f?"top":"left",h=r.test(a),p={},d=u==="show",v,m,g;s.parent().is(".ui-effects-wrapper")?e.effects.save(s.parent(),o):e.effects.save(s,o),s.show(),v=e.effects.createWrapper(s).css({overflow:"hidden"}),m=v[l](),g=parseFloat(v.css(c))||0,p[l]=d?m:0,h||(s.css(f?"bottom":"right",0).css(f?"top":"left","auto").css({position:"absolute"}),p[c]=d?g:m+g),d&&(v.css(l,0),h||v.css(c,g+m)),v.animate(p,{duration:t.duration,easing:t.easing,queue:!1,complete:function(){u==="hide"&&s.hide(),e.effects.restore(s,o),e.effects.removeWrapper(s),i()}})}})(jQuery);(function(e,t){e.effects.effect.bounce=function(t,n){var r=e(this),i=["position","top","bottom","left","right","height","width"],s=e.effects.setMode(r,t.mode||"effect"),o=s==="hide",u=s==="show",a=t.direction||"up",f=t.distance,l=t.times||5,c=l*2+(u||o?1:0),h=t.duration/c,p=t.easing,d=a==="up"||a==="down"?"top":"left",v=a==="up"||a==="left",m,g,y,b=r.queue(),w=b.length;(u||o)&&i.push("opacity"),e.effects.save(r,i),r.show(),e.effects.createWrapper(r),f||(f=r[d==="top"?"outerHeight":"outerWidth"]()/3),u&&(y={opacity:1},y[d]=0,r.css("opacity",0).css(d,v?-f*2:f*2).animate(y,h,p)),o&&(f/=Math.pow(2,l-1)),y={},y[d]=0;for(m=0;m<l;m++)g={},g[d]=(v?"-=":"+=")+f,r.animate(g,h,p).animate(y,h,p),f=o?f*2:f/2;o&&(g={opacity:0},g[d]=(v?"-=":"+=")+f,r.animate(g,h,p)),r.queue(function(){o&&r.hide(),e.effects.restore(r,i),e.effects.removeWrapper(r),n()}),w>1&&b.splice.apply(b,[1,0].concat(b.splice(w,c+1))),r.dequeue()}})(jQuery);(function(e,t){e.effects.effect.clip=function(t,n){var r=e(this),i=["position","top","bottom","left","right","height","width"],s=e.effects.setMode(r,t.mode||"hide"),o=s==="show",u=t.direction||"vertical",a=u==="vertical",f=a?"height":"width",l=a?"top":"left",c={},h,p,d;e.effects.save(r,i),r.show(),h=e.effects.createWrapper(r).css({overflow:"hidden"}),p=r[0].tagName==="IMG"?h:r,d=p[f](),o&&(p.css(f,0),p.css(l,d/2)),c[f]=o?d:0,c[l]=o?0:d/2,p.animate(c,{queue:!1,duration:t.duration,easing:t.easing,complete:function(){o||r.hide(),e.effects.restore(r,i),e.effects.removeWrapper(r),n()}})}})(jQuery);(function(e,t){e.effects.effect.drop=function(t,n){var r=e(this),i=["position","top","bottom","left","right","opacity","height","width"],s=e.effects.setMode(r,t.mode||"hide"),o=s==="show",u=t.direction||"left",a=u==="up"||u==="down"?"top":"left",f=u==="up"||u==="left"?"pos":"neg",l={opacity:o?1:0},c;e.effects.save(r,i),r.show(),e.effects.createWrapper(r),c=t.distance||r[a==="top"?"outerHeight":"outerWidth"](!0)/2,o&&r.css("opacity",0).css(a,f==="pos"?-c:c),l[a]=(o?f==="pos"?"+=":"-=":f==="pos"?"-=":"+=")+c,r.animate(l,{queue:!1,duration:t.duration,easing:t.easing,complete:function(){s==="hide"&&r.hide(),e.effects.restore(r,i),e.effects.removeWrapper(r),n()}})}})(jQuery);(function(e,t){e.effects.effect.explode=function(t,n){function y(){c.push(this),c.length===r*i&&b()}function b(){s.css({visibility:"visible"}),e(c).remove(),u||s.hide(),n()}var r=t.pieces?Math.round(Math.sqrt(t.pieces)):3,i=r,s=e(this),o=e.effects.setMode(s,t.mode||"hide"),u=o==="show",a=s.show().css("visibility","hidden").offset(),f=Math.ceil(s.outerWidth()/i),l=Math.ceil(s.outerHeight()/r),c=[],h,p,d,v,m,g;for(h=0;h<r;h++){v=a.top+h*l,g=h-(r-1)/2;for(p=0;p<i;p++)d=a.left+p*f,m=p-(i-1)/2,s.clone().appendTo("body").wrap("<div></div>").css({position:"absolute",visibility:"visible",left:-p*f,top:-h*l}).parent().addClass("ui-effects-explode").css({position:"absolute",overflow:"hidden",width:f,height:l,left:d+(u?m*f:0),top:v+(u?g*l:0),opacity:u?0:1}).animate({left:d+(u?0:m*f),top:v+(u?0:g*l),opacity:u?1:0},t.duration||500,t.easing,y)}}})(jQuery);(function(e,t){e.effects.effect.fade=function(t,n){var r=e(this),i=e.effects.setMode(r,t.mode||"toggle");r.animate({opacity:i},{queue:!1,duration:t.duration,easing:t.easing,complete:n})}})(jQuery);(function(e,t){e.effects.effect.fold=function(t,n){var r=e(this),i=["position","top","bottom","left","right","height","width"],s=e.effects.setMode(r,t.mode||"hide"),o=s==="show",u=s==="hide",a=t.size||15,f=/([0-9]+)%/.exec(a),l=!!t.horizFirst,c=o!==l,h=c?["width","height"]:["height","width"],p=t.duration/2,d,v,m={},g={};e.effects.save(r,i),r.show(),d=e.effects.createWrapper(r).css({overflow:"hidden"}),v=c?[d.width(),d.height()]:[d.height(),d.width()],f&&(a=parseInt(f[1],10)/100*v[u?0:1]),o&&d.css(l?{height:0,width:a}:{height:a,width:0}),m[h[0]]=o?v[0]:a,g[h[1]]=o?v[1]:0,d.animate(m,p,t.easing).animate(g,p,t.easing,function(){u&&r.hide(),e.effects.restore(r,i),e.effects.removeWrapper(r),n()})}})(jQuery);(function(e,t){e.effects.effect.highlight=function(t,n){var r=e(this),i=["backgroundImage","backgroundColor","opacity"],s=e.effects.setMode(r,t.mode||"show"),o={backgroundColor:r.css("backgroundColor")};s==="hide"&&(o.opacity=0),e.effects.save(r,i),r.show().css({backgroundImage:"none",backgroundColor:t.color||"#ffff99"}).animate(o,{queue:!1,duration:t.duration,easing:t.easing,complete:function(){s==="hide"&&r.hide(),e.effects.restore(r,i),n()}})}})(jQuery);(function(e,t){e.effects.effect.pulsate=function(t,n){var r=e(this),i=e.effects.setMode(r,t.mode||"show"),s=i==="show",o=i==="hide",u=s||i==="hide",a=(t.times||5)*2+(u?1:0),f=t.duration/a,l=0,c=r.queue(),h=c.length,p;if(s||!r.is(":visible"))r.css("opacity",0).show(),l=1;for(p=1;p<a;p++)r.animate({opacity:l},f,t.easing),l=1-l;r.animate({opacity:l},f,t.easing),r.queue(function(){o&&r.hide(),n()}),h>1&&c.splice.apply(c,[1,0].concat(c.splice(h,a+1))),r.dequeue()}})(jQuery);(function(e,t){e.effects.effect.puff=function(t,n){var r=e(this),i=e.effects.setMode(r,t.mode||"hide"),s=i==="hide",o=parseInt(t.percent,10)||150,u=o/100,a={height:r.height(),width:r.width(),outerHeight:r.outerHeight(),outerWidth:r.outerWidth()};e.extend(t,{effect:"scale",queue:!1,fade:!0,mode:i,complete:n,percent:s?o:100,from:s?a:{height:a.height*u,width:a.width*u,outerHeight:a.outerHeight*u,outerWidth:a.outerWidth*u}}),r.effect(t)},e.effects.effect.scale=function(t,n){var r=e(this),i=e.extend(!0,{},t),s=e.effects.setMode(r,t.mode||"effect"),o=parseInt(t.percent,10)||(parseInt(t.percent,10)===0?0:s==="hide"?0:100),u=t.direction||"both",a=t.origin,f={height:r.height(),width:r.width(),outerHeight:r.outerHeight(),outerWidth:r.outerWidth()},l={y:u!=="horizontal"?o/100:1,x:u!=="vertical"?o/100:1};i.effect="size",i.queue=!1,i.complete=n,s!=="effect"&&(i.origin=a||["middle","center"],i.restore=!0),i.from=t.from||(s==="show"?{height:0,width:0,outerHeight:0,outerWidth:0}:f),i.to={height:f.height*l.y,width:f.width*l.x,outerHeight:f.outerHeight*l.y,outerWidth:f.outerWidth*l.x},i.fade&&(s==="show"&&(i.from.opacity=0,i.to.opacity=1),s==="hide"&&(i.from.opacity=1,i.to.opacity=0)),r.effect(i)},e.effects.effect.size=function(t,n){var r,i,s,o=e(this),u=["position","top","bottom","left","right","width","height","overflow","opacity"],a=["position","top","bottom","left","right","overflow","opacity"],f=["width","height","overflow"],l=["fontSize"],c=["borderTopWidth","borderBottomWidth","paddingTop","paddingBottom"],h=["borderLeftWidth","borderRightWidth","paddingLeft","paddingRight"],p=e.effects.setMode(o,t.mode||"effect"),d=t.restore||p!=="effect",v=t.scale||"both",m=t.origin||["middle","center"],g=o.css("position"),y=d?u:a,b={height:0,width:0,outerHeight:0,outerWidth:0};p==="show"&&o.show(),r={height:o.height(),width:o.width(),outerHeight:o.outerHeight(),outerWidth:o.outerWidth()},t.mode==="toggle"&&p==="show"?(o.from=t.to||b,o.to=t.from||r):(o.from=t.from||(p==="show"?b:r),o.to=t.to||(p==="hide"?b:r)),s={from:{y:o.from.height/r.height,x:o.from.width/r.width},to:{y:o.to.height/r.height,x:o.to.width/r.width}};if(v==="box"||v==="both")s.from.y!==s.to.y&&(y=y.concat(c),o.from=e.effects.setTransition(o,c,s.from.y,o.from),o.to=e.effects.setTransition(o,c,s.to.y,o.to)),s.from.x!==s.to.x&&(y=y.concat(h),o.from=e.effects.setTransition(o,h,s.from.x,o.from),o.to=e.effects.setTransition(o,h,s.to.x,o.to));(v==="content"||v==="both")&&s.from.y!==s.to.y&&(y=y.concat(l).concat(f),o.from=e.effects.setTransition(o,l,s.from.y,o.from),o.to=e.effects.setTransition(o,l,s.to.y,o.to)),e.effects.save(o,y),o.show(),e.effects.createWrapper(o),o.css("overflow","hidden").css(o.from),m&&(i=e.effects.getBaseline(m,r),o.from.top=(r.outerHeight-o.outerHeight())*i.y,o.from.left=(r.outerWidth-o.outerWidth())*i.x,o.to.top=(r.outerHeight-o.to.outerHeight)*i.y,o.to.left=(r.outerWidth-o.to.outerWidth)*i.x),o.css(o.from);if(v==="content"||v==="both")c=c.concat(["marginTop","marginBottom"]).concat(l),h=h.concat(["marginLeft","marginRight"]),f=u.concat(c).concat(h),o.find("*[width]").each(function(){var n=e(this),r={height:n.height(),width:n.width(),outerHeight:n.outerHeight(),outerWidth:n.outerWidth()};d&&e.effects.save(n,f),n.from={height:r.height*s.from.y,width:r.width*s.from.x,outerHeight:r.outerHeight*s.from.y,outerWidth:r.outerWidth*s.from.x},n.to={height:r.height*s.to.y,width:r.width*s.to.x,outerHeight:r.height*s.to.y,outerWidth:r.width*s.to.x},s.from.y!==s.to.y&&(n.from=e.effects.setTransition(n,c,s.from.y,n.from),n.to=e.effects.setTransition(n,c,s.to.y,n.to)),s.from.x!==s.to.x&&(n.from=e.effects.setTransition(n,h,s.from.x,n.from),n.to=e.effects.setTransition(n,h,s.to.x,n.to)),n.css(n.from),n.animate(n.to,t.duration,t.easing,function(){d&&e.effects.restore(n,f)})});o.animate(o.to,{queue:!1,duration:t.duration,easing:t.easing,complete:function(){o.to.opacity===0&&o.css("opacity",o.from.opacity),p==="hide"&&o.hide(),e.effects.restore(o,y),d||(g==="static"?o.css({position:"relative",top:o.to.top,left:o.to.left}):e.each(["top","left"],function(e,t){o.css(t,function(t,n){var r=parseInt(n,10),i=e?o.to.left:o.to.top;return n==="auto"?i+"px":r+i+"px"})})),e.effects.removeWrapper(o),n()}})}})(jQuery);(function(e,t){e.effects.effect.shake=function(t,n){var r=e(this),i=["position","top","bottom","left","right","height","width"],s=e.effects.setMode(r,t.mode||"effect"),o=t.direction||"left",u=t.distance||20,a=t.times||3,f=a*2+1,l=Math.round(t.duration/f),c=o==="up"||o==="down"?"top":"left",h=o==="up"||o==="left",p={},d={},v={},m,g=r.queue(),y=g.length;e.effects.save(r,i),r.show(),e.effects.createWrapper(r),p[c]=(h?"-=":"+=")+u,d[c]=(h?"+=":"-=")+u*2,v[c]=(h?"-=":"+=")+u*2,r.animate(p,l,t.easing);for(m=1;m<a;m++)r.animate(d,l,t.easing).animate(v,l,t.easing);r.animate(d,l,t.easing).animate(p,l/2,t.easing).queue(function(){s==="hide"&&r.hide(),e.effects.restore(r,i),e.effects.removeWrapper(r),n()}),y>1&&g.splice.apply(g,[1,0].concat(g.splice(y,f+1))),r.dequeue()}})(jQuery);(function(e,t){e.effects.effect.slide=function(t,n){var r=e(this),i=["position","top","bottom","left","right","width","height"],s=e.effects.setMode(r,t.mode||"show"),o=s==="show",u=t.direction||"left",a=u==="up"||u==="down"?"top":"left",f=u==="up"||u==="left",l,c={};e.effects.save(r,i),r.show(),l=t.distance||r[a==="top"?"outerHeight":"outerWidth"](!0),e.effects.createWrapper(r).css({overflow:"hidden"}),o&&r.css(a,f?isNaN(l)?"-"+l:-l:l),c[a]=(o?f?"+=":"-=":f?"-=":"+=")+l,r.animate(c,{queue:!1,duration:t.duration,easing:t.easing,complete:function(){s==="hide"&&r.hide(),e.effects.restore(r,i),e.effects.removeWrapper(r),n()}})}})(jQuery);(function(e,t){e.effects.effect.transfer=function(t,n){var r=e(this),i=e(t.to),s=i.css("position")==="fixed",o=e("body"),u=s?o.scrollTop():0,a=s?o.scrollLeft():0,f=i.offset(),l={top:f.top-u,left:f.left-a,height:i.innerHeight(),width:i.innerWidth()},c=r.offset(),h=e('<div class="ui-effects-transfer"></div>').appendTo(document.body).addClass(t.className).css({top:c.top-u,left:c.left-a,height:r.innerHeight(),width:r.innerWidth(),position:s?"fixed":"absolute"}).animate(l,t.duration,t.easing,function(){h.remove(),n()})}})(jQuery);(function(e,t){var n=!1;e.widget("ui.menu",{version:"1.9.2",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.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,e.proxy(function(e){this.options.disabled&&e.preventDefault()},this)),this.options.disabled&&this.element.addClass("ui-state-disabled").attr("aria-disabled","true"),this._on({"mousedown .ui-menu-item > a":function(e){e.preventDefault()},"click .ui-state-disabled > a":function(e){e.preventDefault()},"click .ui-menu-item:has(a)":function(t){var r=e(t.target).closest(".ui-menu-item");!n&&r.not(".ui-state-disabled").length&&(n=!0,this.select(t),r.has(".ui-menu").length?this.expand(t):this.element.is(":focus")||(this.element.trigger("focus",[!0]),this.active&&this.active.parents(".ui-menu").length===1&&clearTimeout(this.timer)))},"mouseenter .ui-menu-item":function(t){var n=e(t.currentTarget);n.siblings().children(".ui-state-active").removeClass("ui-state-active"),this.focus(t,n)},mouseleave:"collapseAll","mouseleave .ui-menu":"collapseAll",focus:function(e,t){var n=this.active||this.element.children(".ui-menu-item").eq(0);t||this.focus(e,n)},blur:function(t){this._delay(function(){e.contains(this.element[0],this.document[0].activeElement)||this.collapseAll(t)})},keydown:"_keydown"}),this.refresh(),this._on(this.document,{click:function(t){e(t.target).closest(".ui-menu").length||this.collapseAll(t),n=!1}})},_destroy:function(){this.element.removeAttr("aria-activedescendant").find(".ui-menu").andSelf().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 t=e(this);t.data("ui-menu-submenu-carat")&&t.remove()}),this.element.find(".ui-menu-divider").removeClass("ui-menu-divider ui-widget-content")},_keydown:function(t){function a(e){return e.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}var n,r,i,s,o,u=!0;switch(t.keyCode){case e.ui.keyCode.PAGE_UP:this.previousPage(t);break;case e.ui.keyCode.PAGE_DOWN:this.nextPage(t);break;case e.ui.keyCode.HOME:this._move("first","first",t);break;case e.ui.keyCode.END:this._move("last","last",t);break;case e.ui.keyCode.UP:this.previous(t);break;case e.ui.keyCode.DOWN:this.next(t);break;case e.ui.keyCode.LEFT:this.collapse(t);break;case e.ui.keyCode.RIGHT:this.active&&!this.active.is(".ui-state-disabled")&&this.expand(t);break;case e.ui.keyCode.ENTER:case e.ui.keyCode.SPACE:this._activate(t);break;case e.ui.keyCode.ESCAPE:this.collapse(t);break;default:u=!1,r=this.previousFilter||"",i=String.fromCharCode(t.keyCode),s=!1,clearTimeout(this.filterTimer),i===r?s=!0:i=r+i,o=new RegExp("^"+a(i),"i"),n=this.activeMenu.children(".ui-menu-item").filter(function(){return o.test(e(this).children("a").text())}),n=s&&n.index(this.active.next())!==-1?this.active.nextAll(".ui-menu-item"):n,n.length||(i=String.fromCharCode(t.keyCode),o=new RegExp("^"+a(i),"i"),n=this.activeMenu.children(".ui-menu-item").filter(function(){return o.test(e(this).children("a").text())})),n.length?(this.focus(t,n),n.length>1?(this.previousFilter=i,this.filterTimer=this._delay(function(){delete this.previousFilter},1e3)):delete this.previousFilter):delete this.previousFilter}u&&t.preventDefault()},_activate:function(e){this.active.is(".ui-state-disabled")||(this.active.children("a[aria-haspopup='true']").length?this.expand(e):this.select(e))},refresh:function(){var t,n=this.options.icons.submenu,r=this.element.find(this.options.menus);r.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 t=e(this),r=t.prev("a"),i=e("<span>").addClass("ui-menu-icon ui-icon "+n).data("ui-menu-submenu-carat",!0);r.attr("aria-haspopup","true").prepend(i),t.attr("aria-labelledby",r.attr("id"))}),t=r.add(this.element),t.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()}),t.children(":not(.ui-menu-item)").each(function(){var t=e(this);/[^\-—–\s]/.test(t.text())||t.addClass("ui-widget-content ui-menu-divider")}),t.children(".ui-state-disabled").attr("aria-disabled","true"),this.active&&!e.contains(this.element[0],this.active[0])&&this.blur()},_itemRole:function(){return{menu:"menuitem",listbox:"option"}[this.options.role]},focus:function(e,t){var n,r;this.blur(e,e&&e.type==="focus"),this._scrollIntoView(t),this.active=t.first(),r=this.active.children("a").addClass("ui-state-focus"),this.options.role&&this.element.attr("aria-activedescendant",r.attr("id")),this.active.parent().closest(".ui-menu-item").children("a:first").addClass("ui-state-active"),e&&e.type==="keydown"?this._close():this.timer=this._delay(function(){this._close()},this.delay),n=t.children(".ui-menu"),n.length&&/^mouse/.test(e.type)&&this._startOpening(n),this.activeMenu=t.parent(),this._trigger("focus",e,{item:t})},_scrollIntoView:function(t){var n,r,i,s,o,u;this._hasScroll()&&(n=parseFloat(e.css(this.activeMenu[0],"borderTopWidth"))||0,r=parseFloat(e.css(this.activeMenu[0],"paddingTop"))||0,i=t.offset().top-this.activeMenu.offset().top-n-r,s=this.activeMenu.scrollTop(),o=this.activeMenu.height(),u=t.height(),i<0?this.activeMenu.scrollTop(s+i):i+u>o&&this.activeMenu.scrollTop(s+i-o+u))},blur:function(e,t){t||clearTimeout(this.timer);if(!this.active)return;this.active.children("a").removeClass("ui-state-focus"),this.active=null,this._trigger("blur",e,{item:this.active})},_startOpening:function(e){clearTimeout(this.timer);if(e.attr("aria-hidden")!=="true")return;this.timer=this._delay(function(){this._close(),this._open(e)},this.delay)},_open:function(t){var n=e.extend({of:this.active},this.options.position);clearTimeout(this.timer),this.element.find(".ui-menu").not(t.parents(".ui-menu")).hide().attr("aria-hidden","true"),t.show().removeAttr("aria-hidden").attr("aria-expanded","true").position(n)},collapseAll:function(t,n){clearTimeout(this.timer),this.timer=this._delay(function(){var r=n?this.element:e(t&&t.target).closest(this.element.find(".ui-menu"));r.length||(r=this.element),this._close(r),this.blur(t),this.activeMenu=r},this.delay)},_close:function(e){e||(e=this.active?this.active.parent():this.element),e.find(".ui-menu").hide().attr("aria-hidden","true").attr("aria-expanded","false").end().find("a.ui-state-active").removeClass("ui-state-active")},collapse:function(e){var t=this.active&&this.active.parent().closest(".ui-menu-item",this.element);t&&t.length&&(this._close(),this.focus(e,t))},expand:function(e){var t=this.active&&this.active.children(".ui-menu ").children(".ui-menu-item").first();t&&t.length&&(this._open(t.parent()),this._delay(function(){this.focus(e,t)}))},next:function(e){this._move("next","first",e)},previous:function(e){this._move("prev","last",e)},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(e,t,n){var r;this.active&&(e==="first"||e==="last"?r=this.active[e==="first"?"prevAll":"nextAll"](".ui-menu-item").eq(-1):r=this.active[e+"All"](".ui-menu-item").eq(0));if(!r||!r.length||!this.active)r=this.activeMenu.children(".ui-menu-item")[t]();this.focus(n,r)},nextPage:function(t){var n,r,i;if(!this.active){this.next(t);return}if(this.isLastItem())return;this._hasScroll()?(r=this.active.offset().top,i=this.element.height(),this.active.nextAll(".ui-menu-item").each(function(){return n=e(this),n.offset().top-r-i<0}),this.focus(t,n)):this.focus(t,this.activeMenu.children(".ui-menu-item")[this.active?"last":"first"]())},previousPage:function(t){var n,r,i;if(!this.active){this.next(t);return}if(this.isFirstItem())return;this._hasScroll()?(r=this.active.offset().top,i=this.element.height(),this.active.prevAll(".ui-menu-item").each(function(){return n=e(this),n.offset().top-r+i>0}),this.focus(t,n)):this.focus(t,this.activeMenu.children(".ui-menu-item").first())},_hasScroll:function(){return this.element.outerHeight()<this.element.prop("scrollHeight")},select:function(t){this.active=this.active||e(t.target).closest(".ui-menu-item");var n={item:this.active};this.active.has(".ui-menu").length||this.collapseAll(t,!0),this._trigger("select",t,n)}})})(jQuery);(function(e,t){e.widget("ui.progressbar",{version:"1.9.2",options:{value:0,max:100},min:0,_create:function(){this.element.addClass("ui-progressbar ui-widget ui-widget-content ui-corner-all").attr({role:"progressbar","aria-valuemin":this.min,"aria-valuemax":this.options.max,"aria-valuenow":this._value()}),this.valueDiv=e("<div class='ui-progressbar-value ui-widget-header ui-corner-left'></div>").appendTo(this.element),this.oldValue=this._value(),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(e){return e===t?this._value():(this._setOption("value",e),this)},_setOption:function(e,t){e==="value"&&(this.options.value=t,this._refreshValue(),this._value()===this.options.max&&this._trigger("complete")),this._super(e,t)},_value:function(){var e=this.options.value;return typeof e!="number"&&(e=0),Math.min(this.options.max,Math.max(this.min,e))},_percentage:function(){return 100*this._value()/this.options.max},_refreshValue:function(){var e=this.value(),t=this._percentage();this.oldValue!==e&&(this.oldValue=e,this._trigger("change")),this.valueDiv.toggle(e>this.min).toggleClass("ui-corner-right",e===this.options.max).width(t.toFixed(0)+"%"),this.element.attr("aria-valuenow",e)}})})(jQuery);(function(e,t){e.widget("ui.resizable",e.ui.mouse,{version:"1.9.2",widgetEventPrefix:"resize",options:{alsoResize:!1,animate:!1,animateDuration:"slow",animateEasing:"swing",aspectRatio:!1,autoHide:!1,containment:!1,ghost:!1,grid:!1,handles:"e,s,se",helper:!1,maxHeight:null,maxWidth:null,minHeight:10,minWidth:10,zIndex:1e3},_create:function(){var t=this,n=this.options;this.element.addClass("ui-resizable"),e.extend(this,{_aspectRatio:!!n.aspectRatio,aspectRatio:n.aspectRatio,originalElement:this.element,_proportionallyResizeElements:[],_helper:n.helper||n.ghost||n.animate?n.helper||"ui-resizable-helper":null}),this.element[0].nodeName.match(/canvas|textarea|input|select|button|img/i)&&(this.element.wrap(e('<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("resizable",this.element.data("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=n.handles||(e(".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");if(this.handles.constructor==String){this.handles=="all"&&(this.handles="n,e,s,w,se,sw,ne,nw");var r=this.handles.split(",");this.handles={};for(var i=0;i<r.length;i++){var s=e.trim(r[i]),o="ui-resizable-"+s,u=e('<div class="ui-resizable-handle '+o+'"></div>');u.css({zIndex:n.zIndex}),"se"==s&&u.addClass("ui-icon ui-icon-gripsmall-diagonal-se"),this.handles[s]=".ui-resizable-"+s,this.element.append(u)}}this._renderAxis=function(t){t=t||this.element;for(var n in this.handles){this.handles[n].constructor==String&&(this.handles[n]=e(this.handles[n],this.element).show());if(this.elementIsWrapper&&this.originalElement[0].nodeName.match(/textarea|input|select|button/i)){var r=e(this.handles[n],this.element),i=0;i=/sw|ne|nw|se|n|s/.test(n)?r.outerHeight():r.outerWidth();var s=["padding",/ne|nw|n/.test(n)?"Top":/se|sw|s/.test(n)?"Bottom":/^e$/.test(n)?"Right":"Left"].join("");t.css(s,i),this._proportionallyResize()}if(!e(this.handles[n]).length)continue}},this._renderAxis(this.element),this._handles=e(".ui-resizable-handle",this.element).disableSelection(),this._handles.mouseover(function(){if(!t.resizing){if(this.className)var e=this.className.match(/ui-resizable-(se|sw|ne|nw|n|e|s|w)/i);t.axis=e&&e[1]?e[1]:"se"}}),n.autoHide&&(this._handles.hide(),e(this.element).addClass("ui-resizable-autohide").mouseenter(function(){if(n.disabled)return;e(this).removeClass("ui-resizable-autohide"),t._handles.show()}).mouseleave(function(){if(n.disabled)return;t.resizing||(e(this).addClass("ui-resizable-autohide"),t._handles.hide())})),this._mouseInit()},_destroy:function(){this._mouseDestroy();var t=function(t){e(t).removeClass("ui-resizable ui-resizable-disabled ui-resizable-resizing").removeData("resizable").removeData("ui-resizable").unbind(".resizable").find(".ui-resizable-handle").remove()};if(this.elementIsWrapper){t(this.element);var n=this.element;this.originalElement.css({position:n.css("position"),width:n.outerWidth(),height:n.outerHeight(),top:n.css("top"),left:n.css("left")}).insertAfter(n),n.remove()}return this.originalElement.css("resize",this.originalResizeStyle),t(this.originalElement),this},_mouseCapture:function(t){var n=!1;for(var r in this.handles)e(this.handles[r])[0]==t.target&&(n=!0);return!this.options.disabled&&n},_mouseStart:function(t){var r=this.options,i=this.element.position(),s=this.element;this.resizing=!0,this.documentScroll={top:e(document).scrollTop(),left:e(document).scrollLeft()},(s.is(".ui-draggable")||/absolute/.test(s.css("position")))&&s.css({position:"absolute",top:i.top,left:i.left}),this._renderProxy();var o=n(this.helper.css("left")),u=n(this.helper.css("top"));r.containment&&(o+=e(r.containment).scrollLeft()||0,u+=e(r.containment).scrollTop()||0),this.offset=this.helper.offset(),this.position={left:o,top:u},this.size=this._helper?{width:s.outerWidth(),height:s.outerHeight()}:{width:s.width(),height:s.height()},this.originalSize=this._helper?{width:s.outerWidth(),height:s.outerHeight()}:{width:s.width(),height:s.height()},this.originalPosition={left:o,top:u},this.sizeDiff={width:s.outerWidth()-s.width(),height:s.outerHeight()-s.height()},this.originalMousePosition={left:t.pageX,top:t.pageY},this.aspectRatio=typeof r.aspectRatio=="number"?r.aspectRatio:this.originalSize.width/this.originalSize.height||1;var a=e(".ui-resizable-"+this.axis).css("cursor");return e("body").css("cursor",a=="auto"?this.axis+"-resize":a),s.addClass("ui-resizable-resizing"),this._propagate("start",t),!0},_mouseDrag:function(e){var t=this.helper,n=this.options,r={},i=this,s=this.originalMousePosition,o=this.axis,u=e.pageX-s.left||0,a=e.pageY-s.top||0,f=this._change[o];if(!f)return!1;var l=f.apply(this,[e,u,a]);this._updateVirtualBoundaries(e.shiftKey);if(this._aspectRatio||e.shiftKey)l=this._updateRatio(l,e);return l=this._respectSize(l,e),this._propagate("resize",e),t.css({top:this.position.top+"px",left:this.position.left+"px",width:this.size.width+"px",height:this.size.height+"px"}),!this._helper&&this._proportionallyResizeElements.length&&this._proportionallyResize(),this._updateCache(l),this._trigger("resize",e,this.ui()),!1},_mouseStop:function(t){this.resizing=!1;var n=this.options,r=this;if(this._helper){var i=this._proportionallyResizeElements,s=i.length&&/textarea/i.test(i[0].nodeName),o=s&&e.ui.hasScroll(i[0],"left")?0:r.sizeDiff.height,u=s?0:r.sizeDiff.width,a={width:r.helper.width()-u,height:r.helper.height()-o},f=parseInt(r.element.css("left"),10)+(r.position.left-r.originalPosition.left)||null,l=parseInt(r.element.css("top"),10)+(r.position.top-r.originalPosition.top)||null;n.animate||this.element.css(e.extend(a,{top:l,left:f})),r.helper.height(r.size.height),r.helper.width(r.size.width),this._helper&&!n.animate&&this._proportionallyResize()}return e("body").css("cursor","auto"),this.element.removeClass("ui-resizable-resizing"),this._propagate("stop",t),this._helper&&this.helper.remove(),!1},_updateVirtualBoundaries:function(e){var t=this.options,n,i,s,o,u;u={minWidth:r(t.minWidth)?t.minWidth:0,maxWidth:r(t.maxWidth)?t.maxWidth:Infinity,minHeight:r(t.minHeight)?t.minHeight:0,maxHeight:r(t.maxHeight)?t.maxHeight:Infinity};if(this._aspectRatio||e)n=u.minHeight*this.aspectRatio,s=u.minWidth/this.aspectRatio,i=u.maxHeight*this.aspectRatio,o=u.maxWidth/this.aspectRatio,n>u.minWidth&&(u.minWidth=n),s>u.minHeight&&(u.minHeight=s),i<u.maxWidth&&(u.maxWidth=i),o<u.maxHeight&&(u.maxHeight=o);this._vBoundaries=u},_updateCache:function(e){var t=this.options;this.offset=this.helper.offset(),r(e.left)&&(this.position.left=e.left),r(e.top)&&(this.position.top=e.top),r(e.height)&&(this.size.height=e.height),r(e.width)&&(this.size.width=e.width)},_updateRatio:function(e,t){var n=this.options,i=this.position,s=this.size,o=this.axis;return r(e.height)?e.width=e.height*this.aspectRatio:r(e.width)&&(e.height=e.width/this.aspectRatio),o=="sw"&&(e.left=i.left+(s.width-e.width),e.top=null),o=="nw"&&(e.top=i.top+(s.height-e.height),e.left=i.left+(s.width-e.width)),e},_respectSize:function(e,t){var n=this.helper,i=this._vBoundaries,s=this._aspectRatio||t.shiftKey,o=this.axis,u=r(e.width)&&i.maxWidth&&i.maxWidth<e.width,a=r(e.height)&&i.maxHeight&&i.maxHeight<e.height,f=r(e.width)&&i.minWidth&&i.minWidth>e.width,l=r(e.height)&&i.minHeight&&i.minHeight>e.height;f&&(e.width=i.minWidth),l&&(e.height=i.minHeight),u&&(e.width=i.maxWidth),a&&(e.height=i.maxHeight);var c=this.originalPosition.left+this.originalSize.width,h=this.position.top+this.size.height,p=/sw|nw|w/.test(o),d=/nw|ne|n/.test(o);f&&p&&(e.left=c-i.minWidth),u&&p&&(e.left=c-i.maxWidth),l&&d&&(e.top=h-i.minHeight),a&&d&&(e.top=h-i.maxHeight);var v=!e.width&&!e.height;return v&&!e.left&&e.top?e.top=null:v&&!e.top&&e.left&&(e.left=null),e},_proportionallyResize:function(){var t=this.options;if(!this._proportionallyResizeElements.length)return;var n=this.helper||this.element;for(var r=0;r<this._proportionallyResizeElements.length;r++){var i=this._proportionallyResizeElements[r];if(!this.borderDif){var s=[i.css("borderTopWidth"),i.css("borderRightWidth"),i.css("borderBottomWidth"),i.css("borderLeftWidth")],o=[i.css("paddingTop"),i.css("paddingRight"),i.css("paddingBottom"),i.css("paddingLeft")];this.borderDif=e.map(s,function(e,t){var n=parseInt(e,10)||0,r=parseInt(o[t],10)||0;return n+r})}i.css({height:n.height()-this.borderDif[0]-this.borderDif[2]||0,width:n.width()-this.borderDif[1]-this.borderDif[3]||0})}},_renderProxy:function(){var t=this.element,n=this.options;this.elementOffset=t.offset();if(this._helper){this.helper=this.helper||e('<div style="overflow:hidden;"></div>');var r=e.ui.ie6?1:0,i=e.ui.ie6?2:-1;this.helper.addClass(this._helper).css({width:this.element.outerWidth()+i,height:this.element.outerHeight()+i,position:"absolute",left:this.elementOffset.left-r+"px",top:this.elementOffset.top-r+"px",zIndex:++n.zIndex}),this.helper.appendTo("body").disableSelection()}else this.helper=this.element},_change:{e:function(e,t,n){return{width:this.originalSize.width+t}},w:function(e,t,n){var r=this.options,i=this.originalSize,s=this.originalPosition;return{left:s.left+t,width:i.width-t}},n:function(e,t,n){var r=this.options,i=this.originalSize,s=this.originalPosition;return{top:s.top+n,height:i.height-n}},s:function(e,t,n){return{height:this.originalSize.height+n}},se:function(t,n,r){return e.extend(this._change.s.apply(this,arguments),this._change.e.apply(this,[t,n,r]))},sw:function(t,n,r){return e.extend(this._change.s.apply(this,arguments),this._change.w.apply(this,[t,n,r]))},ne:function(t,n,r){return e.extend(this._change.n.apply(this,arguments),this._change.e.apply(this,[t,n,r]))},nw:function(t,n,r){return e.extend(this._change.n.apply(this,arguments),this._change.w.apply(this,[t,n,r]))}},_propagate:function(t,n){e.ui.plugin.call(this,t,[n,this.ui()]),t!="resize"&&this._trigger(t,n,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}}}),e.ui.plugin.add("resizable","alsoResize",{start:function(t,n){var r=e(this).data("resizable"),i=r.options,s=function(t){e(t).each(function(){var t=e(this);t.data("resizable-alsoresize",{width:parseInt(t.width(),10),height:parseInt(t.height(),10),left:parseInt(t.css("left"),10),top:parseInt(t.css("top"),10)})})};typeof i.alsoResize=="object"&&!i.alsoResize.parentNode?i.alsoResize.length?(i.alsoResize=i.alsoResize[0],s(i.alsoResize)):e.each(i.alsoResize,function(e){s(e)}):s(i.alsoResize)},resize:function(t,n){var r=e(this).data("resizable"),i=r.options,s=r.originalSize,o=r.originalPosition,u={height:r.size.height-s.height||0,width:r.size.width-s.width||0,top:r.position.top-o.top||0,left:r.position.left-o.left||0},a=function(t,r){e(t).each(function(){var t=e(this),i=e(this).data("resizable-alsoresize"),s={},o=r&&r.length?r:t.parents(n.originalElement[0]).length?["width","height"]:["width","height","top","left"];e.each(o,function(e,t){var n=(i[t]||0)+(u[t]||0);n&&n>=0&&(s[t]=n||null)}),t.css(s)})};typeof i.alsoResize=="object"&&!i.alsoResize.nodeType?e.each(i.alsoResize,function(e,t){a(e,t)}):a(i.alsoResize)},stop:function(t,n){e(this).removeData("resizable-alsoresize")}}),e.ui.plugin.add("resizable","animate",{stop:function(t,n){var r=e(this).data("resizable"),i=r.options,s=r._proportionallyResizeElements,o=s.length&&/textarea/i.test(s[0].nodeName),u=o&&e.ui.hasScroll(s[0],"left")?0:r.sizeDiff.height,a=o?0:r.sizeDiff.width,f={width:r.size.width-a,height:r.size.height-u},l=parseInt(r.element.css("left"),10)+(r.position.left-r.originalPosition.left)||null,c=parseInt(r.element.css("top"),10)+(r.position.top-r.originalPosition.top)||null;r.element.animate(e.extend(f,c&&l?{top:c,left:l}:{}),{duration:i.animateDuration,easing:i.animateEasing,step:function(){var n={width:parseInt(r.element.css("width"),10),height:parseInt(r.element.css("height"),10),top:parseInt(r.element.css("top"),10),left:parseInt(r.element.css("left"),10)};s&&s.length&&e(s[0]).css({width:n.width,height:n.height}),r._updateCache(n),r._propagate("resize",t)}})}}),e.ui.plugin.add("resizable","containment",{start:function(t,r){var i=e(this).data("resizable"),s=i.options,o=i.element,u=s.containment,a=u instanceof e?u.get(0):/parent/.test(u)?o.parent().get(0):u;if(!a)return;i.containerElement=e(a);if(/document/.test(u)||u==document)i.containerOffset={left:0,top:0},i.containerPosition={left:0,top:0},i.parentData={element:e(document),left:0,top:0,width:e(document).width(),height:e(document).height()||document.body.parentNode.scrollHeight};else{var f=e(a),l=[];e(["Top","Right","Left","Bottom"]).each(function(e,t){l[e]=n(f.css("padding"+t))}),i.containerOffset=f.offset(),i.containerPosition=f.position(),i.containerSize={height:f.innerHeight()-l[3],width:f.innerWidth()-l[1]};var c=i.containerOffset,h=i.containerSize.height,p=i.containerSize.width,d=e.ui.hasScroll(a,"left")?a.scrollWidth:p,v=e.ui.hasScroll(a)?a.scrollHeight:h;i.parentData={element:a,left:c.left,top:c.top,width:d,height:v}}},resize:function(t,n){var r=e(this).data("resizable"),i=r.options,s=r.containerSize,o=r.containerOffset,u=r.size,a=r.position,f=r._aspectRatio||t.shiftKey,l={top:0,left:0},c=r.containerElement;c[0]!=document&&/static/.test(c.css("position"))&&(l=o),a.left<(r._helper?o.left:0)&&(r.size.width=r.size.width+(r._helper?r.position.left-o.left:r.position.left-l.left),f&&(r.size.height=r.size.width/r.aspectRatio),r.position.left=i.helper?o.left:0),a.top<(r._helper?o.top:0)&&(r.size.height=r.size.height+(r._helper?r.position.top-o.top:r.position.top),f&&(r.size.width=r.size.height*r.aspectRatio),r.position.top=r._helper?o.top:0),r.offset.left=r.parentData.left+r.position.left,r.offset.top=r.parentData.top+r.position.top;var h=Math.abs((r._helper?r.offset.left-l.left:r.offset.left-l.left)+r.sizeDiff.width),p=Math.abs((r._helper?r.offset.top-l.top:r.offset.top-o.top)+r.sizeDiff.height),d=r.containerElement.get(0)==r.element.parent().get(0),v=/relative|absolute/.test(r.containerElement.css("position"));d&&v&&(h-=r.parentData.left),h+r.size.width>=r.parentData.width&&(r.size.width=r.parentData.width-h,f&&(r.size.height=r.size.width/r.aspectRatio)),p+r.size.height>=r.parentData.height&&(r.size.height=r.parentData.height-p,f&&(r.size.width=r.size.height*r.aspectRatio))},stop:function(t,n){var r=e(this).data("resizable"),i=r.options,s=r.position,o=r.containerOffset,u=r.containerPosition,a=r.containerElement,f=e(r.helper),l=f.offset(),c=f.outerWidth()-r.sizeDiff.width,h=f.outerHeight()-r.sizeDiff.height;r._helper&&!i.animate&&/relative/.test(a.css("position"))&&e(this).css({left:l.left-u.left-o.left,width:c,height:h}),r._helper&&!i.animate&&/static/.test(a.css("position"))&&e(this).css({left:l.left-u.left-o.left,width:c,height:h})}}),e.ui.plugin.add("resizable","ghost",{start:function(t,n){var r=e(this).data("resizable"),i=r.options,s=r.size;r.ghost=r.originalElement.clone(),r.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(typeof i.ghost=="string"?i.ghost:""),r.ghost.appendTo(r.helper)},resize:function(t,n){var r=e(this).data("resizable"),i=r.options;r.ghost&&r.ghost.css({position:"relative",height:r.size.height,width:r.size.width})},stop:function(t,n){var r=e(this).data("resizable"),i=r.options;r.ghost&&r.helper&&r.helper.get(0).removeChild(r.ghost.get(0))}}),e.ui.plugin.add("resizable","grid",{resize:function(t,n){var r=e(this).data("resizable"),i=r.options,s=r.size,o=r.originalSize,u=r.originalPosition,a=r.axis,f=i._aspectRatio||t.shiftKey;i.grid=typeof i.grid=="number"?[i.grid,i.grid]:i.grid;var l=Math.round((s.width-o.width)/(i.grid[0]||1))*(i.grid[0]||1),c=Math.round((s.height-o.height)/(i.grid[1]||1))*(i.grid[1]||1);/^(se|s|e)$/.test(a)?(r.size.width=o.width+l,r.size.height=o.height+c):/^(ne)$/.test(a)?(r.size.width=o.width+l,r.size.height=o.height+c,r.position.top=u.top-c):/^(sw)$/.test(a)?(r.size.width=o.width+l,r.size.height=o.height+c,r.position.left=u.left-l):(r.size.width=o.width+l,r.size.height=o.height+c,r.position.top=u.top-c,r.position.left=u.left-l)}});var n=function(e){return parseInt(e,10)||0},r=function(e){return!isNaN(parseInt(e,10))}})(jQuery);(function(e,t){e.widget("ui.selectable",e.ui.mouse,{version:"1.9.2",options:{appendTo:"body",autoRefresh:!0,distance:0,filter:"*",tolerance:"touch"},_create:function(){var t=this;this.element.addClass("ui-selectable"),this.dragged=!1;var n;this.refresh=function(){n=e(t.options.filter,t.element[0]),n.addClass("ui-selectee"),n.each(function(){var t=e(this),n=t.offset();e.data(this,"selectable-item",{element:this,$element:t,left:n.left,top:n.top,right:n.left+t.outerWidth(),bottom:n.top+t.outerHeight(),startselected:!1,selected:t.hasClass("ui-selected"),selecting:t.hasClass("ui-selecting"),unselecting:t.hasClass("ui-unselecting")})})},this.refresh(),this.selectees=n.addClass("ui-selectee"),this._mouseInit(),this.helper=e("<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(t){var n=this;this.opos=[t.pageX,t.pageY];if(this.options.disabled)return;var r=this.options;this.selectees=e(r.filter,this.element[0]),this._trigger("start",t),e(r.appendTo).append(this.helper),this.helper.css({left:t.clientX,top:t.clientY,width:0,height:0}),r.autoRefresh&&this.refresh(),this.selectees.filter(".ui-selected").each(function(){var r=e.data(this,"selectable-item");r.startselected=!0,!t.metaKey&&!t.ctrlKey&&(r.$element.removeClass("ui-selected"),r.selected=!1,r.$element.addClass("ui-unselecting"),r.unselecting=!0,n._trigger("unselecting",t,{unselecting:r.element}))}),e(t.target).parents().andSelf().each(function(){var r=e.data(this,"selectable-item");if(r){var i=!t.metaKey&&!t.ctrlKey||!r.$element.hasClass("ui-selected");return r.$element.removeClass(i?"ui-unselecting":"ui-selected").addClass(i?"ui-selecting":"ui-unselecting"),r.unselecting=!i,r.selecting=i,r.selected=i,i?n._trigger("selecting",t,{selecting:r.element}):n._trigger("unselecting",t,{unselecting:r.element}),!1}})},_mouseDrag:function(t){var n=this;this.dragged=!0;if(this.options.disabled)return;var r=this.options,i=this.opos[0],s=this.opos[1],o=t.pageX,u=t.pageY;if(i>o){var a=o;o=i,i=a}if(s>u){var a=u;u=s,s=a}return this.helper.css({left:i,top:s,width:o-i,height:u-s}),this.selectees.each(function(){var a=e.data(this,"selectable-item");if(!a||a.element==n.element[0])return;var f=!1;r.tolerance=="touch"?f=!(a.left>o||a.right<i||a.top>u||a.bottom<s):r.tolerance=="fit"&&(f=a.left>i&&a.right<o&&a.top>s&&a.bottom<u),f?(a.selected&&(a.$element.removeClass("ui-selected"),a.selected=!1),a.unselecting&&(a.$element.removeClass("ui-unselecting"),a.unselecting=!1),a.selecting||(a.$element.addClass("ui-selecting"),a.selecting=!0,n._trigger("selecting",t,{selecting:a.element}))):(a.selecting&&((t.metaKey||t.ctrlKey)&&a.startselected?(a.$element.removeClass("ui-selecting"),a.selecting=!1,a.$element.addClass("ui-selected"),a.selected=!0):(a.$element.removeClass("ui-selecting"),a.selecting=!1,a.startselected&&(a.$element.addClass("ui-unselecting"),a.unselecting=!0),n._trigger("unselecting",t,{unselecting:a.element}))),a.selected&&!t.metaKey&&!t.ctrlKey&&!a.startselected&&(a.$element.removeClass("ui-selected"),a.selected=!1,a.$element.addClass("ui-unselecting"),a.unselecting=!0,n._trigger("unselecting",t,{unselecting:a.element})))}),!1},_mouseStop:function(t){var n=this;this.dragged=!1;var r=this.options;return e(".ui-unselecting",this.element[0]).each(function(){var r=e.data(this,"selectable-item");r.$element.removeClass("ui-unselecting"),r.unselecting=!1,r.startselected=!1,n._trigger("unselected",t,{unselected:r.element})}),e(".ui-selecting",this.element[0]).each(function(){var r=e.data(this,"selectable-item");r.$element.removeClass("ui-selecting").addClass("ui-selected"),r.selecting=!1,r.selected=!0,r.startselected=!0,n._trigger("selected",t,{selected:r.element})}),this._trigger("stop",t),this.helper.remove(),!1}})})(jQuery);(function(e,t){var n=5;e.widget("ui.slider",e.ui.mouse,{version:"1.9.2",widgetEventPrefix:"slide",options:{animate:!1,distance:0,max:100,min:0,orientation:"horizontal",range:!1,step:1,value:0,values:null},_create:function(){var t,r,i=this.options,s=this.element.find(".ui-slider-handle").addClass("ui-state-default ui-corner-all"),o="<a class='ui-slider-handle ui-state-default ui-corner-all' href='#'></a>",u=[];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"+(i.disabled?" ui-slider-disabled ui-disabled":"")),this.range=e([]),i.range&&(i.range===!0&&(i.values||(i.values=[this._valueMin(),this._valueMin()]),i.values.length&&i.values.length!==2&&(i.values=[i.values[0],i.values[0]])),this.range=e("<div></div>").appendTo(this.element).addClass("ui-slider-range ui-widget-header"+(i.range==="min"||i.range==="max"?" ui-slider-range-"+i.range:""))),r=i.values&&i.values.length||1;for(t=s.length;t<r;t++)u.push(o);this.handles=s.add(e(u.join("")).appendTo(this.element)),this.handle=this.handles.eq(0),this.handles.add(this.range).filter("a").click(function(e){e.preventDefault()}).mouseenter(function(){i.disabled||e(this).addClass("ui-state-hover")}).mouseleave(function(){e(this).removeClass("ui-state-hover")}).focus(function(){i.disabled?e(this).blur():(e(".ui-slider .ui-state-focus").removeClass("ui-state-focus"),e(this).addClass("ui-state-focus"))}).blur(function(){e(this).removeClass("ui-state-focus")}),this.handles.each(function(t){e(this).data("ui-slider-handle-index",t)}),this._on(this.handles,{keydown:function(t){var r,i,s,o,u=e(t.target).data("ui-slider-handle-index");switch(t.keyCode){case e.ui.keyCode.HOME:case e.ui.keyCode.END:case e.ui.keyCode.PAGE_UP:case e.ui.keyCode.PAGE_DOWN:case e.ui.keyCode.UP:case e.ui.keyCode.RIGHT:case e.ui.keyCode.DOWN:case e.ui.keyCode.LEFT:t.preventDefault();if(!this._keySliding){this._keySliding=!0,e(t.target).addClass("ui-state-active"),r=this._start(t,u);if(r===!1)return}}o=this.options.step,this.options.values&&this.options.values.length?i=s=this.values(u):i=s=this.value();switch(t.keyCode){case e.ui.keyCode.HOME:s=this._valueMin();break;case e.ui.keyCode.END:s=this._valueMax();break;case e.ui.keyCode.PAGE_UP:s=this._trimAlignValue(i+(this._valueMax()-this._valueMin())/n);break;case e.ui.keyCode.PAGE_DOWN:s=this._trimAlignValue(i-(this._valueMax()-this._valueMin())/n);break;case e.ui.keyCode.UP:case e.ui.keyCode.RIGHT:if(i===this._valueMax())return;s=this._trimAlignValue(i+o);break;case e.ui.keyCode.DOWN:case e.ui.keyCode.LEFT:if(i===this._valueMin())return;s=this._trimAlignValue(i-o)}this._slide(t,u,s)},keyup:function(t){var n=e(t.target).data("ui-slider-handle-index");this._keySliding&&(this._keySliding=!1,this._stop(t,n),this._change(t,n),e(t.target).removeClass("ui-state-active"))}}),this._refreshValue(),this._animateOff=!1},_destroy:function(){this.handles.remove(),this.range.remove(),this.element.removeClass("ui-slider ui-slider-horizontal ui-slider-vertical ui-slider-disabled ui-widget ui-widget-content ui-corner-all"),this._mouseDestroy()},_mouseCapture:function(t){var n,r,i,s,o,u,a,f,l=this,c=this.options;return c.disabled?!1:(this.elementSize={width:this.element.outerWidth(),height:this.element.outerHeight()},this.elementOffset=this.element.offset(),n={x:t.pageX,y:t.pageY},r=this._normValueFromMouse(n),i=this._valueMax()-this._valueMin()+1,this.handles.each(function(t){var n=Math.abs(r-l.values(t));i>n&&(i=n,s=e(this),o=t)}),c.range===!0&&this.values(1)===c.min&&(o+=1,s=e(this.handles[o])),u=this._start(t,o),u===!1?!1:(this._mouseSliding=!0,this._handleIndex=o,s.addClass("ui-state-active").focus(),a=s.offset(),f=!e(t.target).parents().andSelf().is(".ui-slider-handle"),this._clickOffset=f?{left:0,top:0}:{left:t.pageX-a.left-s.width()/2,top:t.pageY-a.top-s.height()/2-(parseInt(s.css("borderTopWidth"),10)||0)-(parseInt(s.css("borderBottomWidth"),10)||0)+(parseInt(s.css("marginTop"),10)||0)},this.handles.hasClass("ui-state-hover")||this._slide(t,o,r),this._animateOff=!0,!0))},_mouseStart:function(){return!0},_mouseDrag:function(e){var t={x:e.pageX,y:e.pageY},n=this._normValueFromMouse(t);return this._slide(e,this._handleIndex,n),!1},_mouseStop:function(e){return this.handles.removeClass("ui-state-active"),this._mouseSliding=!1,this._stop(e,this._handleIndex),this._change(e,this._handleIndex),this._handleIndex=null,this._clickOffset=null,this._animateOff=!1,!1},_detectOrientation:function(){this.orientation=this.options.orientation==="vertical"?"vertical":"horizontal"},_normValueFromMouse:function(e){var t,n,r,i,s;return this.orientation==="horizontal"?(t=this.elementSize.width,n=e.x-this.elementOffset.left-(this._clickOffset?this._clickOffset.left:0)):(t=this.elementSize.height,n=e.y-this.elementOffset.top-(this._clickOffset?this._clickOffset.top:0)),r=n/t,r>1&&(r=1),r<0&&(r=0),this.orientation==="vertical"&&(r=1-r),i=this._valueMax()-this._valueMin(),s=this._valueMin()+r*i,this._trimAlignValue(s)},_start:function(e,t){var n={handle:this.handles[t],value:this.value()};return this.options.values&&this.options.values.length&&(n.value=this.values(t),n.values=this.values()),this._trigger("start",e,n)},_slide:function(e,t,n){var r,i,s;this.options.values&&this.options.values.length?(r=this.values(t?0:1),this.options.values.length===2&&this.options.range===!0&&(t===0&&n>r||t===1&&n<r)&&(n=r),n!==this.values(t)&&(i=this.values(),i[t]=n,s=this._trigger("slide",e,{handle:this.handles[t],value:n,values:i}),r=this.values(t?0:1),s!==!1&&this.values(t,n,!0))):n!==this.value()&&(s=this._trigger("slide",e,{handle:this.handles[t],value:n}),s!==!1&&this.value(n))},_stop:function(e,t){var n={handle:this.handles[t],value:this.value()};this.options.values&&this.options.values.length&&(n.value=this.values(t),n.values=this.values()),this._trigger("stop",e,n)},_change:function(e,t){if(!this._keySliding&&!this._mouseSliding){var n={handle:this.handles[t],value:this.value()};this.options.values&&this.options.values.length&&(n.value=this.values(t),n.values=this.values()),this._trigger("change",e,n)}},value:function(e){if(arguments.length){this.options.value=this._trimAlignValue(e),this._refreshValue(),this._change(null,0);return}return this._value()},values:function(t,n){var r,i,s;if(arguments.length>1){this.options.values[t]=this._trimAlignValue(n),this._refreshValue(),this._change(null,t);return}if(!arguments.length)return this._values();if(!e.isArray(arguments[0]))return this.options.values&&this.options.values.length?this._values(t):this.value();r=this.options.values,i=arguments[0];for(s=0;s<r.length;s+=1)r[s]=this._trimAlignValue(i[s]),this._change(null,s);this._refreshValue()},_setOption:function(t,n){var r,i=0;e.isArray(this.options.values)&&(i=this.options.values.length),e.Widget.prototype._setOption.apply(this,arguments);switch(t){case"disabled":n?(this.handles.filter(".ui-state-focus").blur(),this.handles.removeClass("ui-state-hover"),this.handles.prop("disabled",!0),this.element.addClass("ui-disabled")):(this.handles.prop("disabled",!1),this.element.removeClass("ui-disabled"));break;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":this._animateOff=!0,this._refreshValue();for(r=0;r<i;r+=1)this._change(null,r);this._animateOff=!1;break;case"min":case"max":this._animateOff=!0,this._refreshValue(),this._animateOff=!1}},_value:function(){var e=this.options.value;return e=this._trimAlignValue(e),e},_values:function(e){var t,n,r;if(arguments.length)return t=this.options.values[e],t=this._trimAlignValue(t),t;n=this.options.values.slice();for(r=0;r<n.length;r+=1)n[r]=this._trimAlignValue(n[r]);return n},_trimAlignValue:function(e){if(e<=this._valueMin())return this._valueMin();if(e>=this._valueMax())return this._valueMax();var t=this.options.step>0?this.options.step:1,n=(e-this._valueMin())%t,r=e-n;return Math.abs(n)*2>=t&&(r+=n>0?t:-t),parseFloat(r.toFixed(5))},_valueMin:function(){return this.options.min},_valueMax:function(){return this.options.max},_refreshValue:function(){var t,n,r,i,s,o=this.options.range,u=this.options,a=this,f=this._animateOff?!1:u.animate,l={};this.options.values&&this.options.values.length?this.handles.each(function(r){n=(a.values(r)-a._valueMin())/(a._valueMax()-a._valueMin())*100,l[a.orientation==="horizontal"?"left":"bottom"]=n+"%",e(this).stop(1,1)[f?"animate":"css"](l,u.animate),a.options.range===!0&&(a.orientation==="horizontal"?(r===0&&a.range.stop(1,1)[f?"animate":"css"]({left:n+"%"},u.animate),r===1&&a.range[f?"animate":"css"]({width:n-t+"%"},{queue:!1,duration:u.animate})):(r===0&&a.range.stop(1,1)[f?"animate":"css"]({bottom:n+"%"},u.animate),r===1&&a.range[f?"animate":"css"]({height:n-t+"%"},{queue:!1,duration:u.animate}))),t=n}):(r=this.value(),i=this._valueMin(),s=this._valueMax(),n=s!==i?(r-i)/(s-i)*100:0,l[this.orientation==="horizontal"?"left":"bottom"]=n+"%",this.handle.stop(1,1)[f?"animate":"css"](l,u.animate),o==="min"&&this.orientation==="horizontal"&&this.range.stop(1,1)[f?"animate":"css"]({width:n+"%"},u.animate),o==="max"&&this.orientation==="horizontal"&&this.range[f?"animate":"css"]({width:100-n+"%"},{queue:!1,duration:u.animate}),o==="min"&&this.orientation==="vertical"&&this.range.stop(1,1)[f?"animate":"css"]({height:n+"%"},u.animate),o==="max"&&this.orientation==="vertical"&&this.range[f?"animate":"css"]({height:100-n+"%"},{queue:!1,duration:u.animate}))}})})(jQuery);(function(e,t){e.widget("ui.sortable",e.ui.mouse,{version:"1.9.2",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},_create:function(){var e=this.options;this.containerCache={},this.element.addClass("ui-sortable"),this.refresh(),this.floating=this.items.length?e.axis==="x"||/left|right/.test(this.items[0].item.css("float"))||/inline|table-cell/.test(this.items[0].item.css("display")):!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 e=this.items.length-1;e>=0;e--)this.items[e].item.removeData(this.widgetName+"-item");return this},_setOption:function(t,n){t==="disabled"?(this.options[t]=n,this.widget().toggleClass("ui-sortable-disabled",!!n)):e.Widget.prototype._setOption.apply(this,arguments)},_mouseCapture:function(t,n){var r=this;if(this.reverting)return!1;if(this.options.disabled||this.options.type=="static")return!1;this._refreshItems(t);var i=null,s=e(t.target).parents().each(function(){if(e.data(this,r.widgetName+"-item")==r)return i=e(this),!1});e.data(t.target,r.widgetName+"-item")==r&&(i=e(t.target));if(!i)return!1;if(this.options.handle&&!n){var o=!1;e(this.options.handle,i).find("*").andSelf().each(function(){this==t.target&&(o=!0)});if(!o)return!1}return this.currentItem=i,this._removeCurrentsFromItems(),!0},_mouseStart:function(t,n,r){var i=this.options;this.currentContainer=this,this.refreshPositions(),this.helper=this._createHelper(t),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},e.extend(this.offset,{click:{left:t.pageX-this.offset.left,top:t.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(t),this.originalPageX=t.pageX,this.originalPageY=t.pageY,i.cursorAt&&this._adjustOffsetFromHelper(i.cursorAt),this.domPosition={prev:this.currentItem.prev()[0],parent:this.currentItem.parent()[0]},this.helper[0]!=this.currentItem[0]&&this.currentItem.hide(),this._createPlaceholder(),i.containment&&this._setContainment(),i.cursor&&(e("body").css("cursor")&&(this._storedCursor=e("body").css("cursor")),e("body").css("cursor",i.cursor)),i.opacity&&(this.helper.css("opacity")&&(this._storedOpacity=this.helper.css("opacity")),this.helper.css("opacity",i.opacity)),i.zIndex&&(this.helper.css("zIndex")&&(this._storedZIndex=this.helper.css("zIndex")),this.helper.css("zIndex",i.zIndex)),this.scrollParent[0]!=document&&this.scrollParent[0].tagName!="HTML"&&(this.overflowOffset=this.scrollParent.offset()),this._trigger("start",t,this._uiHash()),this._preserveHelperProportions||this._cacheHelperProportions();if(!r)for(var s=this.containers.length-1;s>=0;s--)this.containers[s]._trigger("activate",t,this._uiHash(this));return e.ui.ddmanager&&(e.ui.ddmanager.current=this),e.ui.ddmanager&&!i.dropBehaviour&&e.ui.ddmanager.prepareOffsets(this,t),this.dragging=!0,this.helper.addClass("ui-sortable-helper"),this._mouseDrag(t),!0},_mouseDrag:function(t){this.position=this._generatePosition(t),this.positionAbs=this._convertPositionTo("absolute"),this.lastPositionAbs||(this.lastPositionAbs=this.positionAbs);if(this.options.scroll){var n=this.options,r=!1;this.scrollParent[0]!=document&&this.scrollParent[0].tagName!="HTML"?(this.overflowOffset.top+this.scrollParent[0].offsetHeight-t.pageY<n.scrollSensitivity?this.scrollParent[0].scrollTop=r=this.scrollParent[0].scrollTop+n.scrollSpeed:t.pageY-this.overflowOffset.top<n.scrollSensitivity&&(this.scrollParent[0].scrollTop=r=this.scrollParent[0].scrollTop-n.scrollSpeed),this.overflowOffset.left+this.scrollParent[0].offsetWidth-t.pageX<n.scrollSensitivity?this.scrollParent[0].scrollLeft=r=this.scrollParent[0].scrollLeft+n.scrollSpeed:t.pageX-this.overflowOffset.left<n.scrollSensitivity&&(this.scrollParent[0].scrollLeft=r=this.scrollParent[0].scrollLeft-n.scrollSpeed)):(t.pageY-e(document).scrollTop()<n.scrollSensitivity?r=e(document).scrollTop(e(document).scrollTop()-n.scrollSpeed):e(window).height()-(t.pageY-e(document).scrollTop())<n.scrollSensitivity&&(r=e(document).scrollTop(e(document).scrollTop()+n.scrollSpeed)),t.pageX-e(document).scrollLeft()<n.scrollSensitivity?r=e(document).scrollLeft(e(document).scrollLeft()-n.scrollSpeed):e(window).width()-(t.pageX-e(document).scrollLeft())<n.scrollSensitivity&&(r=e(document).scrollLeft(e(document).scrollLeft()+n.scrollSpeed))),r!==!1&&e.ui.ddmanager&&!n.dropBehaviour&&e.ui.ddmanager.prepareOffsets(this,t)}this.positionAbs=this._convertPositionTo("absolute");if(!this.options.axis||this.options.axis!="y")this.helper[0].style.left=this.position.left+"px";if(!this.options.axis||this.options.axis!="x")this.helper[0].style.top=this.position.top+"px";for(var i=this.items.length-1;i>=0;i--){var s=this.items[i],o=s.item[0],u=this._intersectsWithPointer(s);if(!u)continue;if(s.instance!==this.currentContainer)continue;if(o!=this.currentItem[0]&&this.placeholder[u==1?"next":"prev"]()[0]!=o&&!e.contains(this.placeholder[0],o)&&(this.options.type=="semi-dynamic"?!e.contains(this.element[0],o):!0)){this.direction=u==1?"down":"up";if(this.options.tolerance!="pointer"&&!this._intersectsWithSides(s))break;this._rearrange(t,s),this._trigger("change",t,this._uiHash());break}}return this._contactContainers(t),e.ui.ddmanager&&e.ui.ddmanager.drag(this,t),this._trigger("sort",t,this._uiHash()),this.lastPositionAbs=this.positionAbs,!1},_mouseStop:function(t,n){if(!t)return;e.ui.ddmanager&&!this.options.dropBehaviour&&e.ui.ddmanager.drop(this,t);if(this.options.revert){var r=this,i=this.placeholder.offset();this.reverting=!0,e(this.helper).animate({left:i.left-this.offset.parent.left-this.margins.left+(this.offsetParent[0]==document.body?0:this.offsetParent[0].scrollLeft),top:i.top-this.offset.parent.top-this.margins.top+(this.offsetParent[0]==document.body?0:this.offsetParent[0].scrollTop)},parseInt(this.options.revert,10)||500,function(){r._clear(t)})}else this._clear(t,n);return!1},cancel:function(){if(this.dragging){this._mouseUp({target:null}),this.options.helper=="original"?this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper"):this.currentItem.show();for(var t=this.containers.length-1;t>=0;t--)this.containers[t]._trigger("deactivate",null,this._uiHash(this)),this.containers[t].containerCache.over&&(this.containers[t]._trigger("out",null,this._uiHash(this)),this.containers[t].containerCache.over=0)}return this.placeholder&&(this.placeholder[0].parentNode&&this.placeholder[0].parentNode.removeChild(this.placeholder[0]),this.options.helper!="original"&&this.helper&&this.helper[0].parentNode&&this.helper.remove(),e.extend(this,{helper:null,dragging:!1,reverting:!1,_noFinalSort:null}),this.domPosition.prev?e(this.domPosition.prev).after(this.currentItem):e(this.domPosition.parent).prepend(this.currentItem)),this},serialize:function(t){var n=this._getItemsAsjQuery(t&&t.connected),r=[];return t=t||{},e(n).each(function(){var n=(e(t.item||this).attr(t.attribute||"id")||"").match(t.expression||/(.+)[-=_](.+)/);n&&r.push((t.key||n[1]+"[]")+"="+(t.key&&t.expression?n[1]:n[2]))}),!r.length&&t.key&&r.push(t.key+"="),r.join("&")},toArray:function(t){var n=this._getItemsAsjQuery(t&&t.connected),r=[];return t=t||{},n.each(function(){r.push(e(t.item||this).attr(t.attribute||"id")||"")}),r},_intersectsWith:function(e){var t=this.positionAbs.left,n=t+this.helperProportions.width,r=this.positionAbs.top,i=r+this.helperProportions.height,s=e.left,o=s+e.width,u=e.top,a=u+e.height,f=this.offset.click.top,l=this.offset.click.left,c=r+f>u&&r+f<a&&t+l>s&&t+l<o;return this.options.tolerance=="pointer"||this.options.forcePointerForContainers||this.options.tolerance!="pointer"&&this.helperProportions[this.floating?"width":"height"]>e[this.floating?"width":"height"]?c:s<t+this.helperProportions.width/2&&n-this.helperProportions.width/2<o&&u<r+this.helperProportions.height/2&&i-this.helperProportions.height/2<a},_intersectsWithPointer:function(t){var n=this.options.axis==="x"||e.ui.isOverAxis(this.positionAbs.top+this.offset.click.top,t.top,t.height),r=this.options.axis==="y"||e.ui.isOverAxis(this.positionAbs.left+this.offset.click.left,t.left,t.width),i=n&&r,s=this._getDragVerticalDirection(),o=this._getDragHorizontalDirection();return i?this.floating?o&&o=="right"||s=="down"?2:1:s&&(s=="down"?2:1):!1},_intersectsWithSides:function(t){var n=e.ui.isOverAxis(this.positionAbs.top+this.offset.click.top,t.top+t.height/2,t.height),r=e.ui.isOverAxis(this.positionAbs.left+this.offset.click.left,t.left+t.width/2,t.width),i=this._getDragVerticalDirection(),s=this._getDragHorizontalDirection();return this.floating&&s?s=="right"&&r||s=="left"&&!r:i&&(i=="down"&&n||i=="up"&&!n)},_getDragVerticalDirection:function(){var e=this.positionAbs.top-this.lastPositionAbs.top;return e!=0&&(e>0?"down":"up")},_getDragHorizontalDirection:function(){var e=this.positionAbs.left-this.lastPositionAbs.left;return e!=0&&(e>0?"right":"left")},refresh:function(e){return this._refreshItems(e),this.refreshPositions(),this},_connectWith:function(){var e=this.options;return e.connectWith.constructor==String?[e.connectWith]:e.connectWith},_getItemsAsjQuery:function(t){var n=[],r=[],i=this._connectWith();if(i&&t)for(var s=i.length-1;s>=0;s--){var o=e(i[s]);for(var u=o.length-1;u>=0;u--){var a=e.data(o[u],this.widgetName);a&&a!=this&&!a.options.disabled&&r.push([e.isFunction(a.options.items)?a.options.items.call(a.element):e(a.options.items,a.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),a])}}r.push([e.isFunction(this.options.items)?this.options.items.call(this.element,null,{options:this.options,item:this.currentItem}):e(this.options.items,this.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),this]);for(var s=r.length-1;s>=0;s--)r[s][0].each(function(){n.push(this)});return e(n)},_removeCurrentsFromItems:function(){var t=this.currentItem.find(":data("+this.widgetName+"-item)");this.items=e.grep(this.items,function(e){for(var n=0;n<t.length;n++)if(t[n]==e.item[0])return!1;return!0})},_refreshItems:function(t){this.items=[],this.containers=[this];var n=this.items,r=[[e.isFunction(this.options.items)?this.options.items.call(this.element[0],t,{item:this.currentItem}):e(this.options.items,this.element),this]],i=this._connectWith();if(i&&this.ready)for(var s=i.length-1;s>=0;s--){var o=e(i[s]);for(var u=o.length-1;u>=0;u--){var a=e.data(o[u],this.widgetName);a&&a!=this&&!a.options.disabled&&(r.push([e.isFunction(a.options.items)?a.options.items.call(a.element[0],t,{item:this.currentItem}):e(a.options.items,a.element),a]),this.containers.push(a))}}for(var s=r.length-1;s>=0;s--){var f=r[s][1],l=r[s][0];for(var u=0,c=l.length;u<c;u++){var h=e(l[u]);h.data(this.widgetName+"-item",f),n.push({item:h,instance:f,width:0,height:0,left:0,top:0})}}},refreshPositions:function(t){this.offsetParent&&this.helper&&(this.offset.parent=this._getParentOffset());for(var n=this.items.length-1;n>=0;n--){var r=this.items[n];if(r.instance!=this.currentContainer&&this.currentContainer&&r.item[0]!=this.currentItem[0])continue;var i=this.options.toleranceElement?e(this.options.toleranceElement,r.item):r.item;t||(r.width=i.outerWidth(),r.height=i.outerHeight());var s=i.offset();r.left=s.left,r.top=s.top}if(this.options.custom&&this.options.custom.refreshContainers)this.options.custom.refreshContainers.call(this);else for(var n=this.containers.length-1;n>=0;n--){var s=this.containers[n].element.offset();this.containers[n].containerCache.left=s.left,this.containers[n].containerCache.top=s.top,this.containers[n].containerCache.width=this.containers[n].element.outerWidth(),this.containers[n].containerCache.height=this.containers[n].element.outerHeight()}return this},_createPlaceholder:function(t){t=t||this;var n=t.options;if(!n.placeholder||n.placeholder.constructor==String){var r=n.placeholder;n.placeholder={element:function(){var n=e(document.createElement(t.currentItem[0].nodeName)).addClass(r||t.currentItem[0].className+" ui-sortable-placeholder").removeClass("ui-sortable-helper")[0];return r||(n.style.visibility="hidden"),n},update:function(e,i){if(r&&!n.forcePlaceholderSize)return;i.height()||i.height(t.currentItem.innerHeight()-parseInt(t.currentItem.css("paddingTop")||0,10)-parseInt(t.currentItem.css("paddingBottom")||0,10)),i.width()||i.width(t.currentItem.innerWidth()-parseInt(t.currentItem.css("paddingLeft")||0,10)-parseInt(t.currentItem.css("paddingRight")||0,10))}}}t.placeholder=e(n.placeholder.element.call(t.element,t.currentItem)),t.currentItem.after(t.placeholder),n.placeholder.update(t,t.placeholder)},_contactContainers:function(t){var n=null,r=null;for(var i=this.containers.length-1;i>=0;i--){if(e.contains(this.currentItem[0],this.containers[i].element[0]))continue;if(this._intersectsWith(this.containers[i].containerCache)){if(n&&e.contains(this.containers[i].element[0],n.element[0]))continue;n=this.containers[i],r=i}else this.containers[i].containerCache.over&&(this.containers[i]._trigger("out",t,this._uiHash(this)),this.containers[i].containerCache.over=0)}if(!n)return;if(this.containers.length===1)this.containers[r]._trigger("over",t,this._uiHash(this)),this.containers[r].containerCache.over=1;else{var s=1e4,o=null,u=this.containers[r].floating?"left":"top",a=this.containers[r].floating?"width":"height",f=this.positionAbs[u]+this.offset.click[u];for(var l=this.items.length-1;l>=0;l--){if(!e.contains(this.containers[r].element[0],this.items[l].item[0]))continue;if(this.items[l].item[0]==this.currentItem[0])continue;var c=this.items[l].item.offset()[u],h=!1;Math.abs(c-f)>Math.abs(c+this.items[l][a]-f)&&(h=!0,c+=this.items[l][a]),Math.abs(c-f)<s&&(s=Math.abs(c-f),o=this.items[l],this.direction=h?"up":"down")}if(!o&&!this.options.dropOnEmpty)return;this.currentContainer=this.containers[r],o?this._rearrange(t,o,null,!0):this._rearrange(t,null,this.containers[r].element,!0),this._trigger("change",t,this._uiHash()),this.containers[r]._trigger("change",t,this._uiHash(this)),this.options.placeholder.update(this.currentContainer,this.placeholder),this.containers[r]._trigger("over",t,this._uiHash(this)),this.containers[r].containerCache.over=1}},_createHelper:function(t){var n=this.options,r=e.isFunction(n.helper)?e(n.helper.apply(this.element[0],[t,this.currentItem])):n.helper=="clone"?this.currentItem.clone():this.currentItem;return r.parents("body").length||e(n.appendTo!="parent"?n.appendTo:this.currentItem[0].parentNode)[0].appendChild(r[0]),r[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")}),(r[0].style.width==""||n.forceHelperSize)&&r.width(this.currentItem.width()),(r[0].style.height==""||n.forceHelperSize)&&r.height(this.currentItem.height()),r},_adjustOffsetFromHelper:function(t){typeof t=="string"&&(t=t.split(" ")),e.isArray(t)&&(t={left:+t[0],top:+t[1]||0}),"left"in t&&(this.offset.click.left=t.left+this.margins.left),"right"in t&&(this.offset.click.left=this.helperProportions.width-t.right+this.margins.left),"top"in t&&(this.offset.click.top=t.top+this.margins.top),"bottom"in t&&(this.offset.click.top=this.helperProportions.height-t.bottom+this.margins.top)},_getParentOffset:function(){this.offsetParent=this.helper.offsetParent();var t=this.offsetParent.offset();this.cssPosition=="absolute"&&this.scrollParent[0]!=document&&e.contains(this.scrollParent[0],this.offsetParent[0])&&(t.left+=this.scrollParent.scrollLeft(),t.top+=this.scrollParent.scrollTop());if(this.offsetParent[0]==document.body||this.offsetParent[0].tagName&&this.offsetParent[0].tagName.toLowerCase()=="html"&&e.ui.ie)t={top:0,left:0};return{top:t.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:t.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if(this.cssPosition=="relative"){var e=this.currentItem.position();return{top:e.top-(parseInt(this.helper.css("top"),10)||0)+this.scrollParent.scrollTop(),left:e.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 t=this.options;t.containment=="parent"&&(t.containment=this.helper[0].parentNode);if(t.containment=="document"||t.containment=="window")this.containment=[0-this.offset.relative.left-this.offset.parent.left,0-this.offset.relative.top-this.offset.parent.top,e(t.containment=="document"?document:window).width()-this.helperProportions.width-this.margins.left,(e(t.containment=="document"?document:window).height()||document.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top];if(!/^(document|window|parent)$/.test(t.containment)){var n=e(t.containment)[0],r=e(t.containment).offset(),i=e(n).css("overflow")!="hidden";this.containment=[r.left+(parseInt(e(n).css("borderLeftWidth"),10)||0)+(parseInt(e(n).css("paddingLeft"),10)||0)-this.margins.left,r.top+(parseInt(e(n).css("borderTopWidth"),10)||0)+(parseInt(e(n).css("paddingTop"),10)||0)-this.margins.top,r.left+(i?Math.max(n.scrollWidth,n.offsetWidth):n.offsetWidth)-(parseInt(e(n).css("borderLeftWidth"),10)||0)-(parseInt(e(n).css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left,r.top+(i?Math.max(n.scrollHeight,n.offsetHeight):n.offsetHeight)-(parseInt(e(n).css("borderTopWidth"),10)||0)-(parseInt(e(n).css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top]}},_convertPositionTo:function(t,n){n||(n=this.position);var r=t=="absolute"?1:-1,i=this.options,s=this.cssPosition!="absolute"||this.scrollParent[0]!=document&&!!e.contains(this.scrollParent[0],this.offsetParent[0])?this.scrollParent:this.offsetParent,o=/(html|body)/i.test(s[0].tagName);return{top:n.top+this.offset.relative.top*r+this.offset.parent.top*r-(this.cssPosition=="fixed"?-this.scrollParent.scrollTop():o?0:s.scrollTop())*r,left:n.left+this.offset.relative.left*r+this.offset.parent.left*r-(this.cssPosition=="fixed"?-this.scrollParent.scrollLeft():o?0:s.scrollLeft())*r}},_generatePosition:function(t){var n=this.options,r=this.cssPosition!="absolute"||this.scrollParent[0]!=document&&!!e.contains(this.scrollParent[0],this.offsetParent[0])?this.scrollParent:this.offsetParent,i=/(html|body)/i.test(r[0].tagName);this.cssPosition=="relative"&&(this.scrollParent[0]==document||this.scrollParent[0]==this.offsetParent[0])&&(this.offset.relative=this._getRelativeOffset());var s=t.pageX,o=t.pageY;if(this.originalPosition){this.containment&&(t.pageX-this.offset.click.left<this.containment[0]&&(s=this.containment[0]+this.offset.click.left),t.pageY-this.offset.click.top<this.containment[1]&&(o=this.containment[1]+this.offset.click.top),t.pageX-this.offset.click.left>this.containment[2]&&(s=this.containment[2]+this.offset.click.left),t.pageY-this.offset.click.top>this.containment[3]&&(o=this.containment[3]+this.offset.click.top));if(n.grid){var u=this.originalPageY+Math.round((o-this.originalPageY)/n.grid[1])*n.grid[1];o=this.containment?u-this.offset.click.top<this.containment[1]||u-this.offset.click.top>this.containment[3]?u-this.offset.click.top<this.containment[1]?u+n.grid[1]:u-n.grid[1]:u:u;var a=this.originalPageX+Math.round((s-this.originalPageX)/n.grid[0])*n.grid[0];s=this.containment?a-this.offset.click.left<this.containment[0]||a-this.offset.click.left>this.containment[2]?a-this.offset.click.left<this.containment[0]?a+n.grid[0]:a-n.grid[0]:a:a}}return{top:o-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+(this.cssPosition=="fixed"?-this.scrollParent.scrollTop():i?0:r.scrollTop()),left:s-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+(this.cssPosition=="fixed"?-this.scrollParent.scrollLeft():i?0:r.scrollLeft())}},_rearrange:function(e,t,n,r){n?n[0].appendChild(this.placeholder[0]):t.item[0].parentNode.insertBefore(this.placeholder[0],this.direction=="down"?t.item[0]:t.item[0].nextSibling),this.counter=this.counter?++this.counter:1;var i=this.counter;this._delay(function(){i==this.counter&&this.refreshPositions(!r)})},_clear:function(t,n){this.reverting=!1;var r=[];!this._noFinalSort&&this.currentItem.parent().length&&this.placeholder.before(this.currentItem),this._noFinalSort=null;if(this.helper[0]==this.currentItem[0]){for(var i in this._storedCSS)if(this._storedCSS[i]=="auto"||this._storedCSS[i]=="static")this._storedCSS[i]="";this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper")}else this.currentItem.show();this.fromOutside&&!n&&r.push(function(e){this._trigger("receive",e,this._uiHash(this.fromOutside))}),(this.fromOutside||this.domPosition.prev!=this.currentItem.prev().not(".ui-sortable-helper")[0]||this.domPosition.parent!=this.currentItem.parent()[0])&&!n&&r.push(function(e){this._trigger("update",e,this._uiHash())}),this!==this.currentContainer&&(n||(r.push(function(e){this._trigger("remove",e,this._uiHash())}),r.push(function(e){return function(t){e._trigger("receive",t,this._uiHash(this))}}.call(this,this.currentContainer)),r.push(function(e){return function(t){e._trigger("update",t,this._uiHash(this))}}.call(this,this.currentContainer))));for(var i=this.containers.length-1;i>=0;i--)n||r.push(function(e){return function(t){e._trigger("deactivate",t,this._uiHash(this))}}.call(this,this.containers[i])),this.containers[i].containerCache.over&&(r.push(function(e){return function(t){e._trigger("out",t,this._uiHash(this))}}.call(this,this.containers[i])),this.containers[i].containerCache.over=0);this._storedCursor&&e("body").css("cursor",this._storedCursor),this._storedOpacity&&this.helper.css("opacity",this._storedOpacity),this._storedZIndex&&this.helper.css("zIndex",this._storedZIndex=="auto"?"":this._storedZIndex),this.dragging=!1;if(this.cancelHelperRemoval){if(!n){this._trigger("beforeStop",t,this._uiHash());for(var i=0;i<r.length;i++)r[i].call(this,t);this._trigger("stop",t,this._uiHash())}return this.fromOutside=!1,!1}n||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;if(!n){for(var i=0;i<r.length;i++)r[i].call(this,t);this._trigger("stop",t,this._uiHash())}return this.fromOutside=!1,!0},_trigger:function(){e.Widget.prototype._trigger.apply(this,arguments)===!1&&this.cancel()},_uiHash:function(t){var n=t||this;return{helper:n.helper,placeholder:n.placeholder||e([]),position:n.position,originalPosition:n.originalPosition,offset:n.positionAbs,item:n.currentItem,sender:t?t.element:null}}})})(jQuery);(function(e){function t(e){return function(){var t=this.element.val();e.apply(this,arguments),this._refresh(),t!==this.element.val()&&this._trigger("change")}}e.widget("ui.spinner",{version:"1.9.2",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.element.val(),!0),this._draw(),this._on(this._events),this._refresh(),this._on(this.window,{beforeunload:function(){this.element.removeAttr("autocomplete")}})},_getCreateOptions:function(){var t={},n=this.element;return e.each(["min","max","step"],function(e,r){var i=n.attr(r);i!==undefined&&i.length&&(t[r]=i)}),t},_events:{keydown:function(e){this._start(e)&&this._keydown(e)&&e.preventDefault()},keyup:"_stop",focus:function(){this.previous=this.element.val()},blur:function(e){if(this.cancelBlur){delete this.cancelBlur;return}this._refresh(),this.previous!==this.element.val()&&this._trigger("change",e)},mousewheel:function(e,t){if(!t)return;if(!this.spinning&&!this._start(e))return!1;this._spin((t>0?1:-1)*this.options.step,e),clearTimeout(this.mousewheelTimer),this.mousewheelTimer=this._delay(function(){this.spinning&&this._stop(e)},100),e.preventDefault()},"mousedown .ui-spinner-button":function(t){function r(){var e=this.element[0]===this.document[0].activeElement;e||(this.element.focus(),this.previous=n,this._delay(function(){this.previous=n}))}var n;n=this.element[0]===this.document[0].activeElement?this.previous:this.element.val(),t.preventDefault(),r.call(this),this.cancelBlur=!0,this._delay(function(){delete this.cancelBlur,r.call(this)});if(this._start(t)===!1)return;this._repeat(null,e(t.currentTarget).hasClass("ui-spinner-up")?1:-1,t)},"mouseup .ui-spinner-button":"_stop","mouseenter .ui-spinner-button":function(t){if(!e(t.currentTarget).hasClass("ui-state-active"))return;if(this._start(t)===!1)return!1;this._repeat(null,e(t.currentTarget).hasClass("ui-spinner-up")?1:-1,t)},"mouseleave .ui-spinner-button":"_stop"},_draw:function(){var e=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=e.find(".ui-spinner-button").attr("tabIndex",-1).button().removeClass("ui-corner-all"),this.buttons.height()>Math.ceil(e.height()*.5)&&e.height()>0&&e.height(e.height()),this.options.disabled&&this.disable()},_keydown:function(t){var n=this.options,r=e.ui.keyCode;switch(t.keyCode){case r.UP:return this._repeat(null,1,t),!0;case r.DOWN:return this._repeat(null,-1,t),!0;case r.PAGE_UP:return this._repeat(null,n.page,t),!0;case r.PAGE_DOWN:return this._repeat(null,-n.page,t),!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+"'>▲</span>"+"</a>"+"<a class='ui-spinner-button ui-spinner-down ui-corner-br'>"+"<span class='ui-icon "+this.options.icons.down+"'>▼</span>"+"</a>"},_start:function(e){return!this.spinning&&this._trigger("start",e)===!1?!1:(this.counter||(this.counter=1),this.spinning=!0,!0)},_repeat:function(e,t,n){e=e||500,clearTimeout(this.timer),this.timer=this._delay(function(){this._repeat(40,t,n)},e),this._spin(t*this.options.step,n)},_spin:function(e,t){var n=this.value()||0;this.counter||(this.counter=1),n=this._adjustValue(n+e*this._increment(this.counter));if(!this.spinning||this._trigger("spin",t,{value:n})!==!1)this._value(n),this.counter++},_increment:function(t){var n=this.options.incremental;return n?e.isFunction(n)?n(t):Math.floor(t*t*t/5e4-t*t/500+17*t/200+1):1},_precision:function(){var e=this._precisionOf(this.options.step);return this.options.min!==null&&(e=Math.max(e,this._precisionOf(this.options.min))),e},_precisionOf:function(e){var t=e.toString(),n=t.indexOf(".");return n===-1?0:t.length-n-1},_adjustValue:function(e){var t,n,r=this.options;return t=r.min!==null?r.min:0,n=e-t,n=Math.round(n/r.step)*r.step,e=t+n,e=parseFloat(e.toFixed(this._precision())),r.max!==null&&e>r.max?r.max:r.min!==null&&e<r.min?r.min:e},_stop:function(e){if(!this.spinning)return;clearTimeout(this.timer),clearTimeout(this.mousewheelTimer),this.counter=0,this.spinning=!1,this._trigger("stop",e)},_setOption:function(e,t){if(e==="culture"||e==="numberFormat"){var n=this._parse(this.element.val());this.options[e]=t,this.element.val(this._format(n));return}(e==="max"||e==="min"||e==="step")&&typeof t=="string"&&(t=this._parse(t)),this._super(e,t),e==="disabled"&&(t?(this.element.prop("disabled",!0),this.buttons.button("disable")):(this.element.prop("disabled",!1),this.buttons.button("enable")))},_setOptions:t(function(e){this._super(e),this._value(this.element.val())}),_parse:function(e){return typeof e=="string"&&e!==""&&(e=window.Globalize&&this.options.numberFormat?Globalize.parseFloat(e,10,this.options.culture):+e),e===""||isNaN(e)?null:e},_format:function(e){return e===""?"":window.Globalize&&this.options.numberFormat?Globalize.format(e,this.options.numberFormat,this.options.culture):e},_refresh:function(){this.element.attr({"aria-valuemin":this.options.min,"aria-valuemax":this.options.max,"aria-valuenow":this._parse(this.element.val())})},_value:function(e,t){var n;e!==""&&(n=this._parse(e),n!==null&&(t||(n=this._adjustValue(n)),e=this._format(n))),this.element.val(e),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:t(function(e){this._stepUp(e)}),_stepUp:function(e){this._spin((e||1)*this.options.step)},stepDown:t(function(e){this._stepDown(e)}),_stepDown:function(e){this._spin((e||1)*-this.options.step)},pageUp:t(function(e){this._stepUp((e||1)*this.options.page)}),pageDown:t(function(e){this._stepDown((e||1)*this.options.page)}),value:function(e){if(!arguments.length)return this._parse(this.element.val());t(this._value).call(this,e)},widget:function(){return this.uiSpinner}})})(jQuery);(function(e,t){function i(){return++n}function s(e){return e.hash.length>1&&e.href.replace(r,"")===location.href.replace(r,"").replace(/\s/g,"%20")}var n=0,r=/#.*$/;e.widget("ui.tabs",{version:"1.9.2",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 t=this,n=this.options,r=n.active,i=location.hash.substring(1);this.running=!1,this.element.addClass("ui-tabs ui-widget ui-widget-content ui-corner-all").toggleClass("ui-tabs-collapsible",n.collapsible).delegate(".ui-tabs-nav > li","mousedown"+this.eventNamespace,function(t){e(this).is(".ui-state-disabled")&&t.preventDefault()}).delegate(".ui-tabs-anchor","focus"+this.eventNamespace,function(){e(this).closest("li").is(".ui-state-disabled")&&this.blur()}),this._processTabs();if(r===null){i&&this.tabs.each(function(t,n){if(e(n).attr("aria-controls")===i)return r=t,!1}),r===null&&(r=this.tabs.index(this.tabs.filter(".ui-tabs-active")));if(r===null||r===-1)r=this.tabs.length?0:!1}r!==!1&&(r=this.tabs.index(this.tabs.eq(r)),r===-1&&(r=n.collapsible?!1:0)),n.active=r,!n.collapsible&&n.active===!1&&this.anchors.length&&(n.active=0),e.isArray(n.disabled)&&(n.disabled=e.unique(n.disabled.concat(e.map(this.tabs.filter(".ui-state-disabled"),function(e){return t.tabs.index(e)}))).sort()),this.options.active!==!1&&this.anchors.length?this.active=this._findActive(this.options.active):this.active=e(),this._refresh(),this.active.length&&this.load(n.active)},_getCreateEventData:function(){return{tab:this.active,panel:this.active.length?this._getPanelForTab(this.active):e()}},_tabKeydown:function(t){var n=e(this.document[0].activeElement).closest("li"),r=this.tabs.index(n),i=!0;if(this._handlePageNav(t))return;switch(t.keyCode){case e.ui.keyCode.RIGHT:case e.ui.keyCode.DOWN:r++;break;case e.ui.keyCode.UP:case e.ui.keyCode.LEFT:i=!1,r--;break;case e.ui.keyCode.END:r=this.anchors.length-1;break;case e.ui.keyCode.HOME:r=0;break;case e.ui.keyCode.SPACE:t.preventDefault(),clearTimeout(this.activating),this._activate(r);return;case e.ui.keyCode.ENTER:t.preventDefault(),clearTimeout(this.activating),this._activate(r===this.options.active?!1:r);return;default:return}t.preventDefault(),clearTimeout(this.activating),r=this._focusNextTab(r,i),t.ctrlKey||(n.attr("aria-selected","false"),this.tabs.eq(r).attr("aria-selected","true"),this.activating=this._delay(function(){this.option("active",r)},this.delay))},_panelKeydown:function(t){if(this._handlePageNav(t))return;t.ctrlKey&&t.keyCode===e.ui.keyCode.UP&&(t.preventDefault(),this.active.focus())},_handlePageNav:function(t){if(t.altKey&&t.keyCode===e.ui.keyCode.PAGE_UP)return this._activate(this._focusNextTab(this.options.active-1,!1)),!0;if(t.altKey&&t.keyCode===e.ui.keyCode.PAGE_DOWN)return this._activate(this._focusNextTab(this.options.active+1,!0)),!0},_findNextTab:function(t,n){function i(){return t>r&&(t=0),t<0&&(t=r),t}var r=this.tabs.length-1;while(e.inArray(i(),this.options.disabled)!==-1)t=n?t+1:t-1;return t},_focusNextTab:function(e,t){return e=this._findNextTab(e,t),this.tabs.eq(e).focus(),e},_setOption:function(e,t){if(e==="active"){this._activate(t);return}if(e==="disabled"){this._setupDisabled(t);return}this._super(e,t),e==="collapsible"&&(this.element.toggleClass("ui-tabs-collapsible",t),!t&&this.options.active===!1&&this._activate(0)),e==="event"&&this._setupEvents(t),e==="heightStyle"&&this._setupHeightStyle(t)},_tabId:function(e){return e.attr("aria-controls")||"ui-tabs-"+i()},_sanitizeSelector:function(e){return e?e.replace(/[!"$%&'()*+,.\/:;<=>?@\[\]\^`{|}~]/g,"\\$&"):""},refresh:function(){var t=this.options,n=this.tablist.children(":has(a[href])");t.disabled=e.map(n.filter(".ui-state-disabled"),function(e){return n.index(e)}),this._processTabs(),t.active===!1||!this.anchors.length?(t.active=!1,this.active=e()):this.active.length&&!e.contains(this.tablist[0],this.active[0])?this.tabs.length===t.disabled.length?(t.active=!1,this.active=e()):this._activate(this._findNextTab(Math.max(0,t.active-1),!1)):t.active=this.tabs.index(this.active),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 t=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 e("a",this)[0]}).addClass("ui-tabs-anchor").attr({role:"presentation",tabIndex:-1}),this.panels=e(),this.anchors.each(function(n,r){var i,o,u,a=e(r).uniqueId().attr("id"),f=e(r).closest("li"),l=f.attr("aria-controls");s(r)?(i=r.hash,o=t.element.find(t._sanitizeSelector(i))):(u=t._tabId(f),i="#"+u,o=t.element.find(i),o.length||(o=t._createPanel(u),o.insertAfter(t.panels[n-1]||t.tablist)),o.attr("aria-live","polite")),o.length&&(t.panels=t.panels.add(o)),l&&f.data("ui-tabs-aria-controls",l),f.attr({"aria-controls":i.substring(1),"aria-labelledby":a}),o.attr("aria-labelledby",a)}),this.panels.addClass("ui-tabs-panel ui-widget-content ui-corner-bottom").attr("role","tabpanel")},_getList:function(){return this.element.find("ol,ul").eq(0)},_createPanel:function(t){return e("<div>").attr("id",t).addClass("ui-tabs-panel ui-widget-content ui-corner-bottom").data("ui-tabs-destroy",!0)},_setupDisabled:function(t){e.isArray(t)&&(t.length?t.length===this.anchors.length&&(t=!0):t=!1);for(var n=0,r;r=this.tabs[n];n++)t===!0||e.inArray(n,t)!==-1?e(r).addClass("ui-state-disabled").attr("aria-disabled","true"):e(r).removeClass("ui-state-disabled").removeAttr("aria-disabled");this.options.disabled=t},_setupEvents:function(t){var n={click:function(e){e.preventDefault()}};t&&e.each(t.split(" "),function(e,t){n[t]="_eventHandler"}),this._off(this.anchors.add(this.tabs).add(this.panels)),this._on(this.anchors,n),this._on(this.tabs,{keydown:"_tabKeydown"}),this._on(this.panels,{keydown:"_panelKeydown"}),this._focusable(this.tabs),this._hoverable(this.tabs)},_setupHeightStyle:function(t){var n,r,i=this.element.parent();t==="fill"?(e.support.minHeight||(r=i.css("overflow"),i.css("overflow","hidden")),n=i.height(),this.element.siblings(":visible").each(function(){var t=e(this),r=t.css("position");if(r==="absolute"||r==="fixed")return;n-=t.outerHeight(!0)}),r&&i.css("overflow",r),this.element.children().not(this.panels).each(function(){n-=e(this).outerHeight(!0)}),this.panels.each(function(){e(this).height(Math.max(0,n-e(this).innerHeight()+e(this).height()))}).css("overflow","auto")):t==="auto"&&(n=0,this.panels.each(function(){n=Math.max(n,e(this).height("").height())}).height(n))},_eventHandler:function(t){var n=this.options,r=this.active,i=e(t.currentTarget),s=i.closest("li"),o=s[0]===r[0],u=o&&n.collapsible,a=u?e():this._getPanelForTab(s),f=r.length?this._getPanelForTab(r):e(),l={oldTab:r,oldPanel:f,newTab:u?e():s,newPanel:a};t.preventDefault();if(s.hasClass("ui-state-disabled")||s.hasClass("ui-tabs-loading")||this.running||o&&!n.collapsible||this._trigger("beforeActivate",t,l)===!1)return;n.active=u?!1:this.tabs.index(s),this.active=o?e():s,this.xhr&&this.xhr.abort(),!f.length&&!a.length&&e.error("jQuery UI Tabs: Mismatching fragment identifier."),a.length&&this.load(this.tabs.index(s),t),this._toggle(t,l)},_toggle:function(t,n){function o(){r.running=!1,r._trigger("activate",t,n)}function u(){n.newTab.closest("li").addClass("ui-tabs-active ui-state-active"),i.length&&r.options.show?r._show(i,r.options.show,o):(i.show(),o())}var r=this,i=n.newPanel,s=n.oldPanel;this.running=!0,s.length&&this.options.hide?this._hide(s,this.options.hide,function(){n.oldTab.closest("li").removeClass("ui-tabs-active ui-state-active"),u()}):(n.oldTab.closest("li").removeClass("ui-tabs-active ui-state-active"),s.hide(),u()),s.attr({"aria-expanded":"false","aria-hidden":"true"}),n.oldTab.attr("aria-selected","false"),i.length&&s.length?n.oldTab.attr("tabIndex",-1):i.length&&this.tabs.filter(function(){return e(this).attr("tabIndex")===0}).attr("tabIndex",-1),i.attr({"aria-expanded":"true","aria-hidden":"false"}),n.newTab.attr({"aria-selected":"true",tabIndex:0})},_activate:function(t){var n,r=this._findActive(t);if(r[0]===this.active[0])return;r.length||(r=this.active),n=r.find(".ui-tabs-anchor")[0],this._eventHandler({target:n,currentTarget:n,preventDefault:e.noop})},_findActive:function(t){return t===!1?e():this.tabs.eq(t)},_getIndex:function(e){return typeof e=="string"&&(e=this.anchors.index(this.anchors.filter("[href$='"+e+"']"))),e},_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").removeData("href.tabs").removeData("load.tabs").removeUniqueId(),this.tabs.add(this.panels).each(function(){e.data(this,"ui-tabs-destroy")?e(this).remove():e(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 t=e(this),n=t.data("ui-tabs-aria-controls");n?t.attr("aria-controls",n):t.removeAttr("aria-controls")}),this.panels.show(),this.options.heightStyle!=="content"&&this.panels.css("height","")},enable:function(n){var r=this.options.disabled;if(r===!1)return;n===t?r=!1:(n=this._getIndex(n),e.isArray(r)?r=e.map(r,function(e){return e!==n?e:null}):r=e.map(this.tabs,function(e,t){return t!==n?t:null})),this._setupDisabled(r)},disable:function(n){var r=this.options.disabled;if(r===!0)return;if(n===t)r=!0;else{n=this._getIndex(n);if(e.inArray(n,r)!==-1)return;e.isArray(r)?r=e.merge([n],r).sort():r=[n]}this._setupDisabled(r)},load:function(t,n){t=this._getIndex(t);var r=this,i=this.tabs.eq(t),o=i.find(".ui-tabs-anchor"),u=this._getPanelForTab(i),a={tab:i,panel:u};if(s(o[0]))return;this.xhr=e.ajax(this._ajaxSettings(o,n,a)),this.xhr&&this.xhr.statusText!=="canceled"&&(i.addClass("ui-tabs-loading"),u.attr("aria-busy","true"),this.xhr.success(function(e){setTimeout(function(){u.html(e),r._trigger("load",n,a)},1)}).complete(function(e,t){setTimeout(function(){t==="abort"&&r.panels.stop(!1,!0),i.removeClass("ui-tabs-loading"),u.removeAttr("aria-busy"),e===r.xhr&&delete r.xhr},1)}))},_ajaxSettings:function(t,n,r){var i=this;return{url:t.attr("href"),beforeSend:function(t,s){return i._trigger("beforeLoad",n,e.extend({jqXHR:t,ajaxSettings:s},r))}}},_getPanelForTab:function(t){var n=e(t).attr("aria-controls");return this.element.find(this._sanitizeSelector("#"+n))}}),e.uiBackCompat!==!1&&(e.ui.tabs.prototype._ui=function(e,t){return{tab:e,panel:t,index:this.anchors.index(e)}},e.widget("ui.tabs",e.ui.tabs,{url:function(e,t){this.anchors.eq(e).attr("href",t)}}),e.widget("ui.tabs",e.ui.tabs,{options:{ajaxOptions:null,cache:!1},_create:function(){this._super();var t=this;this._on({tabsbeforeload:function(n,r){if(e.data(r.tab[0],"cache.tabs")){n.preventDefault();return}r.jqXHR.success(function(){t.options.cache&&e.data(r.tab[0],"cache.tabs",!0)})}})},_ajaxSettings:function(t,n,r){var i=this.options.ajaxOptions;return e.extend({},i,{error:function(e,t){try{i.error(e,t,r.tab.closest("li").index(),r.tab[0])}catch(n){}}},this._superApply(arguments))},_setOption:function(e,t){e==="cache"&&t===!1&&this.anchors.removeData("cache.tabs"),this._super(e,t)},_destroy:function(){this.anchors.removeData("cache.tabs"),this._super()},url:function(e){this.anchors.eq(e).removeData("cache.tabs"),this._superApply(arguments)}}),e.widget("ui.tabs",e.ui.tabs,{abort:function(){this.xhr&&this.xhr.abort()}}),e.widget("ui.tabs",e.ui.tabs,{options:{spinner:"<em>Loading…</em>"},_create:function(){this._super(),this._on({tabsbeforeload:function(e,t){if(e.target!==this.element[0]||!this.options.spinner)return;var n=t.tab.find("span"),r=n.html();n.html(this.options.spinner),t.jqXHR.complete(function(){n.html(r)})}})}}),e.widget("ui.tabs",e.ui.tabs,{options:{enable:null,disable:null},enable:function(t){var n=this.options,r;if(t&&n.disabled===!0||e.isArray(n.disabled)&&e.inArray(t,n.disabled)!==-1)r=!0;this._superApply(arguments),r&&this._trigger("enable",null,this._ui(this.anchors[t],this.panels[t]))},disable:function(t){var n=this.options,r;if(t&&n.disabled===!1||e.isArray(n.disabled)&&e.inArray(t,n.disabled)===-1)r=!0;this._superApply(arguments),r&&this._trigger("disable",null,this._ui(this.anchors[t],this.panels[t]))}}),e.widget("ui.tabs",e.ui.tabs,{options:{add:null,remove:null,tabTemplate:"<li><a href='#{href}'><span>#{label}</span></a></li>"},add:function(n,r,i){i===t&&(i=this.anchors.length);var s,o,u=this.options,a=e(u.tabTemplate.replace(/#\{href\}/g,n).replace(/#\{label\}/g,r)),f=n.indexOf("#")?this._tabId(a):n.replace("#","");return a.addClass("ui-state-default ui-corner-top").data("ui-tabs-destroy",!0),a.attr("aria-controls",f),s=i>=this.tabs.length,o=this.element.find("#"+f),o.length||(o=this._createPanel(f),s?i>0?o.insertAfter(this.panels.eq(-1)):o.appendTo(this.element):o.insertBefore(this.panels[i])),o.addClass("ui-tabs-panel ui-widget-content ui-corner-bottom").hide(),s?a.appendTo(this.tablist):a.insertBefore(this.tabs[i]),u.disabled=e.map(u.disabled,function(e){return e>=i?++e:e}),this.refresh(),this.tabs.length===1&&u.active===!1&&this.option("active",0),this._trigger("add",null,this._ui(this.anchors[i],this.panels[i])),this},remove:function(t){t=this._getIndex(t);var n=this.options,r=this.tabs.eq(t).remove(),i=this._getPanelForTab(r).remove();return r.hasClass("ui-tabs-active")&&this.anchors.length>2&&this._activate(t+(t+1<this.anchors.length?1:-1)),n.disabled=e.map(e.grep(n.disabled,function(e){return e!==t}),function(e){return e>=t?--e:e}),this.refresh(),this._trigger("remove",null,this._ui(r.find("a")[0],i[0])),this}}),e.widget("ui.tabs",e.ui.tabs,{length:function(){return this.anchors.length}}),e.widget("ui.tabs",e.ui.tabs,{options:{idPrefix:"ui-tabs-"},_tabId:function(t){var n=t.is("li")?t.find("a[href]"):t;return n=n[0],e(n).closest("li").attr("aria-controls")||n.title&&n.title.replace(/\s/g,"_").replace(/[^\w\u00c0-\uFFFF\-]/g,"")||this.options.idPrefix+i()}}),e.widget("ui.tabs",e.ui.tabs,{options:{panelTemplate:"<div></div>"},_createPanel:function(t){return e(this.options.panelTemplate).attr("id",t).addClass("ui-tabs-panel ui-widget-content ui-corner-bottom").data("ui-tabs-destroy",!0)}}),e.widget("ui.tabs",e.ui.tabs,{_create:function(){var e=this.options;e.active===null&&e.selected!==t&&(e.active=e.selected===-1?!1:e.selected),this._super(),e.selected=e.active,e.selected===!1&&(e.selected=-1)},_setOption:function(e,t){if(e!=="selected")return this._super(e,t);var n=this.options;this._super("active",t===-1?!1:t),n.selected=n.active,n.selected===!1&&(n.selected=-1)},_eventHandler:function(){this._superApply(arguments),this.options.selected=this.options.active,this.options.selected===!1&&(this.options.selected=-1)}}),e.widget("ui.tabs",e.ui.tabs,{options:{show:null,select:null},_create:function(){this._super(),this.options.active!==!1&&this._trigger("show",null,this._ui(this.active.find(".ui-tabs-anchor")[0],this._getPanelForTab(this.active)[0]))},_trigger:function(e,t,n){var r,i,s=this._superApply(arguments);return s?(e==="beforeActivate"?(r=n.newTab.length?n.newTab:n.oldTab,i=n.newPanel.length?n.newPanel:n.oldPanel,s=this._super("select",t,{tab:r.find(".ui-tabs-anchor")[0],panel:i[0],index:r.closest("li").index()})):e==="activate"&&n.newTab.length&&(s=this._super("show",t,{tab:n.newTab.find(".ui-tabs-anchor")[0],panel:n.newPanel[0],index:n.newTab.closest("li").index()})),s):!1}}),e.widget("ui.tabs",e.ui.tabs,{select:function(e){e=this._getIndex(e);if(e===-1){if(!this.options.collapsible||this.options.selected===-1)return;e=this.options.selected}this.anchors.eq(e).trigger(this.options.event+this.eventNamespace)}}),function(){var t=0;e.widget("ui.tabs",e.ui.tabs,{options:{cookie:null},_create:function(){var e=this.options,t;e.active==null&&e.cookie&&(t=parseInt(this._cookie(),10),t===-1&&(t=!1),e.active=t),this._super()},_cookie:function(n){var r=[this.cookie||(this.cookie=this.options.cookie.name||"ui-tabs-"+ ++t)];return arguments.length&&(r.push(n===!1?-1:n),r.push(this.options.cookie)),e.cookie.apply(null,r)},_refresh:function(){this._super(),this.options.cookie&&this._cookie(this.options.active,this.options.cookie)},_eventHandler:function(){this._superApply(arguments),this.options.cookie&&this._cookie(this.options.active,this.options.cookie)},_destroy:function(){this._super(),this.options.cookie&&this._cookie(null,this.options.cookie)}})}(),e.widget("ui.tabs",e.ui.tabs,{_trigger:function(t,n,r){var i=e.extend({},r);return t==="load"&&(i.panel=i.panel[0],i.tab=i.tab.find(".ui-tabs-anchor")[0]),this._super(t,n,i)}}),e.widget("ui.tabs",e.ui.tabs,{options:{fx:null},_getFx:function(){var t,n,r=this.options.fx;return r&&(e.isArray(r)?(t=r[0],n=r[1]):t=n=r),r?{show:n,hide:t}:null},_toggle:function(e,t){function o(){n.running=!1,n._trigger("activate",e,t)}function u(){t.newTab.closest("li").addClass("ui-tabs-active ui-state-active"),r.length&&s.show?r.animate(s.show,s.show.duration,function(){o()}):(r.show(),o())}var n=this,r=t.newPanel,i=t.oldPanel,s=this._getFx();if(!s)return this._super(e,t);n.running=!0,i.length&&s.hide?i.animate(s.hide,s.hide.duration,function(){t.oldTab.closest("li").removeClass("ui-tabs-active ui-state-active"),u()}):(t.oldTab.closest("li").removeClass("ui-tabs-active ui-state-active"),i.hide(),u())}}))})(jQuery);(function(e){function n(t,n){var r=(t.attr("aria-describedby")||"").split(/\s+/);r.push(n),t.data("ui-tooltip-id",n).attr("aria-describedby",e.trim(r.join(" ")))}function r(t){var n=t.data("ui-tooltip-id"),r=(t.attr("aria-describedby")||"").split(/\s+/),i=e.inArray(n,r);i!==-1&&r.splice(i,1),t.removeData("ui-tooltip-id"),r=e.trim(r.join(" ")),r?t.attr("aria-describedby",r):t.removeAttr("aria-describedby")}var t=0;e.widget("ui.tooltip",{version:"1.9.2",options:{content:function(){return e(this).attr("title")},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(t,n){var r=this;if(t==="disabled"){this[n?"_disable":"_enable"](),this.options[t]=n;return}this._super(t,n),t==="content"&&e.each(this.tooltips,function(e,t){r._updateContent(t)})},_disable:function(){var t=this;e.each(this.tooltips,function(n,r){var i=e.Event("blur");i.target=i.currentTarget=r[0],t.close(i,!0)}),this.element.find(this.options.items).andSelf().each(function(){var t=e(this);t.is("[title]")&&t.data("ui-tooltip-title",t.attr("title")).attr("title","")})},_enable:function(){this.element.find(this.options.items).andSelf().each(function(){var t=e(this);t.data("ui-tooltip-title")&&t.attr("title",t.data("ui-tooltip-title"))})},open:function(t){var n=this,r=e(t?t.target:this.element).closest(this.options.items);if(!r.length||r.data("ui-tooltip-id"))return;r.attr("title")&&r.data("ui-tooltip-title",r.attr("title")),r.data("ui-tooltip-open",!0),t&&t.type==="mouseover"&&r.parents().each(function(){var t=e(this),r;t.data("ui-tooltip-open")&&(r=e.Event("blur"),r.target=r.currentTarget=this,n.close(r,!0)),t.attr("title")&&(t.uniqueId(),n.parents[this.id]={element:this,title:t.attr("title")},t.attr("title",""))}),this._updateContent(r,t)},_updateContent:function(e,t){var n,r=this.options.content,i=this,s=t?t.type:null;if(typeof r=="string")return this._open(t,e,r);n=r.call(e[0],function(n){if(!e.data("ui-tooltip-open"))return;i._delay(function(){t&&(t.type=s),this._open(t,e,n)})}),n&&this._open(t,e,n)},_open:function(t,r,i){function f(e){a.of=e;if(s.is(":hidden"))return;s.position(a)}var s,o,u,a=e.extend({},this.options.position);if(!i)return;s=this._find(r);if(s.length){s.find(".ui-tooltip-content").html(i);return}r.is("[title]")&&(t&&t.type==="mouseover"?r.attr("title",""):r.removeAttr("title")),s=this._tooltip(r),n(r,s.attr("id")),s.find(".ui-tooltip-content").html(i),this.options.track&&t&&/^mouse/.test(t.type)?(this._on(this.document,{mousemove:f}),f(t)):s.position(e.extend({of:r},this.options.position)),s.hide(),this._show(s,this.options.show),this.options.show&&this.options.show.delay&&(u=setInterval(function(){s.is(":visible")&&(f(a.of),clearInterval(u))},e.fx.interval)),this._trigger("open",t,{tooltip:s}),o={keyup:function(t){if(t.keyCode===e.ui.keyCode.ESCAPE){var n=e.Event(t);n.currentTarget=r[0],this.close(n,!0)}},remove:function(){this._removeTooltip(s)}};if(!t||t.type==="mouseover")o.mouseleave="close";if(!t||t.type==="focusin")o.focusout="close";this._on(!0,r,o)},close:function(t){var n=this,i=e(t?t.currentTarget:this.element),s=this._find(i);if(this.closing)return;i.data("ui-tooltip-title")&&i.attr("title",i.data("ui-tooltip-title")),r(i),s.stop(!0),this._hide(s,this.options.hide,function(){n._removeTooltip(e(this))}),i.removeData("ui-tooltip-open"),this._off(i,"mouseleave focusout keyup"),i[0]!==this.element[0]&&this._off(i,"remove"),this._off(this.document,"mousemove"),t&&t.type==="mouseleave"&&e.each(this.parents,function(t,r){e(r.element).attr("title",r.title),delete n.parents[t]}),this.closing=!0,this._trigger("close",t,{tooltip:s}),this.closing=!1},_tooltip:function(n){var r="ui-tooltip-"+t++,i=e("<div>").attr({id:r,role:"tooltip"}).addClass("ui-tooltip ui-widget ui-corner-all ui-widget-content "+(this.options.tooltipClass||""));return e("<div>").addClass("ui-tooltip-content").appendTo(i),i.appendTo(this.document[0].body),e.fn.bgiframe&&i.bgiframe(),this.tooltips[r]=n,i},_find:function(t){var n=t.data("ui-tooltip-id");return n?e("#"+n):e()},_removeTooltip:function(e){e.remove(),delete this.tooltips[e.attr("id")]},_destroy:function(){var t=this;e.each(this.tooltips,function(n,r){var i=e.Event("blur");i.target=i.currentTarget=r[0],t.close(i,!0),e("#"+n).remove(),r.data("ui-tooltip-title")&&(r.attr("title",r.data("ui-tooltip-title")),r.removeData("ui-tooltip-title"))})}})})(jQuery);\ No newline at end of filediff --git a/data/libs/jsoneditor/demo.html b/data/libs/jsoneditor/demo.htmldeleted file mode 100644index bb104eadd..000000000--- a/data/libs/jsoneditor/demo.html+++ /dev/null@@ -1,40 +0,0 @@-<!DOCTYPE HTML>-<html>-<head>- <link rel="stylesheet" type="text/css" href="jsoneditor.css">- <script type="text/javascript" src="jsoneditor.js"></script>-</head>-<body>-<p>- <button onclick="setJSON();">Set JSON</button>- <button onclick="getJSON();">Get JSON</button>-</p>-<div id="jsoneditor1" style="width: 500px; height: 400px;"></div>--<script type="text/javascript" >- // create the editor. Optionally, parameters json and options can be- // specified in the constructor.- var container = document.getElementById("jsoneditor1");- var editor = new JSONEditor(container);-- // set json- function setJSON () {- var json = {- "Array": [1, 2, 3],- "Boolean": true,- "Null": null,- "Number": 123,- "Object": {"a": "b", "c": "d"},- "String": "Hello World"- };- editor.set(json);- }-- // get json- function getJSON() {- var json = editor.get();- alert(JSON.stringify(json, null, 2));- }-</script>-</body>-</html>diff --git a/data/libs/requirejs/require_max.js b/data/libs/requirejs/require_max.jsdeleted file mode 100644index 39dbad8e3..000000000--- a/data/libs/requirejs/require_max.js+++ /dev/null@@ -1,1981 +0,0 @@-/** vim: et:ts=4:sw=4:sts=4- * @license RequireJS 2.1.1 Copyright (c) 2010-2012, The Dojo Foundation All Rights Reserved.- * Available via the MIT or new BSD license.- * see: http://github.com/jrburke/requirejs for details- */-//Not using strict: uneven strict support in browsers, #392, and causes-//problems with requirejs.exec()/transpiler plugins that may not be strict.-/*jslint regexp: true, nomen: true, sloppy: true */-/*global window, navigator, document, importScripts, jQuery, setTimeout, opera */--var requirejs, require, define;-(function (global) {- var req, s, head, baseElement, dataMain, src,- interactiveScript, currentlyAddingScript, mainScript, subPath,- version = '2.1.1',- commentRegExp = /(\/\*([\s\S]*?)\*\/|([^:]|^)\/\/(.*)$)/mg,- cjsRequireRegExp = /[^.]\s*require\s*\(\s*["']([^'"\s]+)["']\s*\)/g,- jsSuffixRegExp = /\.js$/,- currDirRegExp = /^\.\//,- op = Object.prototype,- ostring = op.toString,- hasOwn = op.hasOwnProperty,- ap = Array.prototype,- aps = ap.slice,- apsp = ap.splice,- isBrowser = !!(typeof window !== 'undefined' && navigator && document),- isWebWorker = !isBrowser && typeof importScripts !== 'undefined',- //PS3 indicates loaded and complete, but need to wait for complete- //specifically. Sequence is 'loading', 'loaded', execution,- // then 'complete'. The UA check is unfortunate, but not sure how- //to feature test w/o causing perf issues.- readyRegExp = isBrowser && navigator.platform === 'PLAYSTATION 3' ?- /^complete$/ : /^(complete|loaded)$/,- defContextName = '_',- //Oh the tragedy, detecting opera. See the usage of isOpera for reason.- isOpera = typeof opera !== 'undefined' && opera.toString() === '[object Opera]',- contexts = {},- cfg = {},- globalDefQueue = [],- useInteractive = false;-- function isFunction(it) {- return ostring.call(it) === '[object Function]';- }-- function isArray(it) {- return ostring.call(it) === '[object Array]';- }-- /**- * Helper function for iterating over an array. If the func returns- * a true value, it will break out of the loop.- */- function each(ary, func) {- if (ary) {- var i;- for (i = 0; i < ary.length; i += 1) {- if (ary[i] && func(ary[i], i, ary)) {- break;- }- }- }- }-- /**- * Helper function for iterating over an array backwards. If the func- * returns a true value, it will break out of the loop.- */- function eachReverse(ary, func) {- if (ary) {- var i;- for (i = ary.length - 1; i > -1; i -= 1) {- if (ary[i] && func(ary[i], i, ary)) {- break;- }- }- }- }-- function hasProp(obj, prop) {- return hasOwn.call(obj, prop);- }-- /**- * Cycles over properties in an object and calls a function for each- * property value. If the function returns a truthy value, then the- * iteration is stopped.- */- function eachProp(obj, func) {- var prop;- for (prop in obj) {- if (obj.hasOwnProperty(prop)) {- if (func(obj[prop], prop)) {- break;- }- }- }- }-- /**- * Simple function to mix in properties from source into target,- * but only if target does not already have a property of the same name.- */- function mixin(target, source, force, deepStringMixin) {- if (source) {- eachProp(source, function (value, prop) {- if (force || !hasProp(target, prop)) {- if (deepStringMixin && typeof value !== 'string') {- if (!target[prop]) {- target[prop] = {};- }- mixin(target[prop], value, force, deepStringMixin);- } else {- target[prop] = value;- }- }- });- }- return target;- }-- //Similar to Function.prototype.bind, but the 'this' object is specified- //first, since it is easier to read/figure out what 'this' will be.- function bind(obj, fn) {- return function () {- return fn.apply(obj, arguments);- };- }-- function scripts() {- return document.getElementsByTagName('script');- }-- //Allow getting a global that expressed in- //dot notation, like 'a.b.c'.- function getGlobal(value) {- if (!value) {- return value;- }- var g = global;- each(value.split('.'), function (part) {- g = g[part];- });- return g;- }-- /**- * Constructs an error with a pointer to an URL with more information.- * @param {String} id the error ID that maps to an ID on a web page.- * @param {String} message human readable error.- * @param {Error} [err] the original error, if there is one.- *- * @returns {Error}- */- function makeError(id, msg, err, requireModules) {- var e = new Error(msg + '\nhttp://requirejs.org/docs/errors.html#' + id);- e.requireType = id;- e.requireModules = requireModules;- if (err) {- e.originalError = err;- }- return e;- }-- if (typeof define !== 'undefined') {- //If a define is already in play via another AMD loader,- //do not overwrite.- return;- }-- if (typeof requirejs !== 'undefined') {- if (isFunction(requirejs)) {- //Do not overwrite and existing requirejs instance.- return;- }- cfg = requirejs;- requirejs = undefined;- }-- //Allow for a require config object- if (typeof require !== 'undefined' && !isFunction(require)) {- //assume it is a config object.- cfg = require;- require = undefined;- }-- function newContext(contextName) {- var inCheckLoaded, Module, context, handlers,- checkLoadedTimeoutId,- config = {- waitSeconds: 7,- baseUrl: './',- paths: {},- pkgs: {},- shim: {},- map: {},- config: {}- },- registry = {},- undefEvents = {},- defQueue = [],- defined = {},- urlFetched = {},- requireCounter = 1,- unnormalizedCounter = 1;-- /**- * Trims the . and .. from an array of path segments.- * It will keep a leading path segment if a .. will become- * the first path segment, to help with module name lookups,- * which act like paths, but can be remapped. But the end result,- * all paths that use this function should look normalized.- * NOTE: this method MODIFIES the input array.- * @param {Array} ary the array of path segments.- */- function trimDots(ary) {- var i, part;- for (i = 0; ary[i]; i += 1) {- part = ary[i];- if (part === '.') {- ary.splice(i, 1);- i -= 1;- } else if (part === '..') {- if (i === 1 && (ary[2] === '..' || ary[0] === '..')) {- //End of the line. Keep at least one non-dot- //path segment at the front so it can be mapped- //correctly to disk. Otherwise, there is likely- //no path mapping for a path starting with '..'.- //This can still fail, but catches the most reasonable- //uses of ..- break;- } else if (i > 0) {- ary.splice(i - 1, 2);- i -= 2;- }- }- }- }-- /**- * Given a relative module name, like ./something, normalize it to- * a real name that can be mapped to a path.- * @param {String} name the relative name- * @param {String} baseName a real name that the name arg is relative- * to.- * @param {Boolean} applyMap apply the map config to the value. Should- * only be done if this normalization is for a dependency ID.- * @returns {String} normalized name- */- function normalize(name, baseName, applyMap) {- var pkgName, pkgConfig, mapValue, nameParts, i, j, nameSegment,- foundMap, foundI, foundStarMap, starI,- baseParts = baseName && baseName.split('/'),- normalizedBaseParts = baseParts,- map = config.map,- starMap = map && map['*'];-- //Adjust any relative paths.- if (name && name.charAt(0) === '.') {- //If have a base name, try to normalize against it,- //otherwise, assume it is a top-level require that will- //be relative to baseUrl in the end.- if (baseName) {- if (config.pkgs[baseName]) {- //If the baseName is a package name, then just treat it as one- //name to concat the name with.- normalizedBaseParts = baseParts = [baseName];- } else {- //Convert baseName to array, and lop off the last part,- //so that . matches that 'directory' and not name of the baseName's- //module. For instance, baseName of 'one/two/three', maps to- //'one/two/three.js', but we want the directory, 'one/two' for- //this normalization.- normalizedBaseParts = baseParts.slice(0, baseParts.length - 1);- }-- name = normalizedBaseParts.concat(name.split('/'));- trimDots(name);-- //Some use of packages may use a . path to reference the- //'main' module name, so normalize for that.- pkgConfig = config.pkgs[(pkgName = name[0])];- name = name.join('/');- if (pkgConfig && name === pkgName + '/' + pkgConfig.main) {- name = pkgName;- }- } else if (name.indexOf('./') === 0) {- // No baseName, so this is ID is resolved relative- // to baseUrl, pull off the leading dot.- name = name.substring(2);- }- }-- //Apply map config if available.- if (applyMap && (baseParts || starMap) && map) {- nameParts = name.split('/');-- for (i = nameParts.length; i > 0; i -= 1) {- nameSegment = nameParts.slice(0, i).join('/');-- if (baseParts) {- //Find the longest baseName segment match in the config.- //So, do joins on the biggest to smallest lengths of baseParts.- for (j = baseParts.length; j > 0; j -= 1) {- mapValue = map[baseParts.slice(0, j).join('/')];-- //baseName segment has config, find if it has one for- //this name.- if (mapValue) {- mapValue = mapValue[nameSegment];- if (mapValue) {- //Match, update name to the new value.- foundMap = mapValue;- foundI = i;- break;- }- }- }- }-- if (foundMap) {- break;- }-- //Check for a star map match, but just hold on to it,- //if there is a shorter segment match later in a matching- //config, then favor over this star map.- if (!foundStarMap && starMap && starMap[nameSegment]) {- foundStarMap = starMap[nameSegment];- starI = i;- }- }-- if (!foundMap && foundStarMap) {- foundMap = foundStarMap;- foundI = starI;- }-- if (foundMap) {- nameParts.splice(0, foundI, foundMap);- name = nameParts.join('/');- }- }-- return name;- }-- function removeScript(name) {- if (isBrowser) {- each(scripts(), function (scriptNode) {- if (scriptNode.getAttribute('data-requiremodule') === name &&- scriptNode.getAttribute('data-requirecontext') === context.contextName) {- scriptNode.parentNode.removeChild(scriptNode);- return true;- }- });- }- }-- function hasPathFallback(id) {- var pathConfig = config.paths[id];- if (pathConfig && isArray(pathConfig) && pathConfig.length > 1) {- removeScript(id);- //Pop off the first array value, since it failed, and- //retry- pathConfig.shift();- context.require.undef(id);- context.require([id]);- return true;- }- }-- //Turns a plugin!resource to [plugin, resource]- //with the plugin being undefined if the name- //did not have a plugin prefix.- function splitPrefix(name) {- var prefix,- index = name ? name.indexOf('!') : -1;- if (index > -1) {- prefix = name.substring(0, index);- name = name.substring(index + 1, name.length);- }- return [prefix, name];- }-- /**- * Creates a module mapping that includes plugin prefix, module- * name, and path. If parentModuleMap is provided it will- * also normalize the name via require.normalize()- *- * @param {String} name the module name- * @param {String} [parentModuleMap] parent module map- * for the module name, used to resolve relative names.- * @param {Boolean} isNormalized: is the ID already normalized.- * This is true if this call is done for a define() module ID.- * @param {Boolean} applyMap: apply the map config to the ID.- * Should only be true if this map is for a dependency.- *- * @returns {Object}- */- function makeModuleMap(name, parentModuleMap, isNormalized, applyMap) {- var url, pluginModule, suffix, nameParts,- prefix = null,- parentName = parentModuleMap ? parentModuleMap.name : null,- originalName = name,- isDefine = true,- normalizedName = '';-- //If no name, then it means it is a require call, generate an- //internal name.- if (!name) {- isDefine = false;- name = '_@r' + (requireCounter += 1);- }-- nameParts = splitPrefix(name);- prefix = nameParts[0];- name = nameParts[1];-- if (prefix) {- prefix = normalize(prefix, parentName, applyMap);- pluginModule = defined[prefix];- }-- //Account for relative paths if there is a base name.- if (name) {- if (prefix) {- if (pluginModule && pluginModule.normalize) {- //Plugin is loaded, use its normalize method.- normalizedName = pluginModule.normalize(name, function (name) {- return normalize(name, parentName, applyMap);- });- } else {- normalizedName = normalize(name, parentName, applyMap);- }- } else {- //A regular module.- normalizedName = normalize(name, parentName, applyMap);-- //Normalized name may be a plugin ID due to map config- //application in normalize. The map config values must- //already be normalized, so do not need to redo that part.- nameParts = splitPrefix(normalizedName);- prefix = nameParts[0];- normalizedName = nameParts[1];- isNormalized = true;-- url = context.nameToUrl(normalizedName);- }- }-- //If the id is a plugin id that cannot be determined if it needs- //normalization, stamp it with a unique ID so two matching relative- //ids that may conflict can be separate.- suffix = prefix && !pluginModule && !isNormalized ?- '_unnormalized' + (unnormalizedCounter += 1) :- '';-- return {- prefix: prefix,- name: normalizedName,- parentMap: parentModuleMap,- unnormalized: !!suffix,- url: url,- originalName: originalName,- isDefine: isDefine,- id: (prefix ?- prefix + '!' + normalizedName :- normalizedName) + suffix- };- }-- function getModule(depMap) {- var id = depMap.id,- mod = registry[id];-- if (!mod) {- mod = registry[id] = new context.Module(depMap);- }-- return mod;- }-- function on(depMap, name, fn) {- var id = depMap.id,- mod = registry[id];-- if (hasProp(defined, id) &&- (!mod || mod.defineEmitComplete)) {- if (name === 'defined') {- fn(defined[id]);- }- } else {- getModule(depMap).on(name, fn);- }- }-- function onError(err, errback) {- var ids = err.requireModules,- notified = false;-- if (errback) {- errback(err);- } else {- each(ids, function (id) {- var mod = registry[id];- if (mod) {- //Set error on module, so it skips timeout checks.- mod.error = err;- if (mod.events.error) {- notified = true;- mod.emit('error', err);- }- }- });-- if (!notified) {- req.onError(err);- }- }- }-- /**- * Internal method to transfer globalQueue items to this context's- * defQueue.- */- function takeGlobalQueue() {- //Push all the globalDefQueue items into the context's defQueue- if (globalDefQueue.length) {- //Array splice in the values since the context code has a- //local var ref to defQueue, so cannot just reassign the one- //on context.- apsp.apply(defQueue,- [defQueue.length - 1, 0].concat(globalDefQueue));- globalDefQueue = [];- }- }-- handlers = {- 'require': function (mod) {- if (mod.require) {- return mod.require;- } else {- return (mod.require = context.makeRequire(mod.map));- }- },- 'exports': function (mod) {- mod.usingExports = true;- if (mod.map.isDefine) {- if (mod.exports) {- return mod.exports;- } else {- return (mod.exports = defined[mod.map.id] = {});- }- }- },- 'module': function (mod) {- if (mod.module) {- return mod.module;- } else {- return (mod.module = {- id: mod.map.id,- uri: mod.map.url,- config: function () {- return (config.config && config.config[mod.map.id]) || {};- },- exports: defined[mod.map.id]- });- }- }- };-- function cleanRegistry(id) {- //Clean up machinery used for waiting modules.- delete registry[id];- }-- function breakCycle(mod, traced, processed) {- var id = mod.map.id;-- if (mod.error) {- mod.emit('error', mod.error);- } else {- traced[id] = true;- each(mod.depMaps, function (depMap, i) {- var depId = depMap.id,- dep = registry[depId];-- //Only force things that have not completed- //being defined, so still in the registry,- //and only if it has not been matched up- //in the module already.- if (dep && !mod.depMatched[i] && !processed[depId]) {- if (traced[depId]) {- mod.defineDep(i, defined[depId]);- mod.check(); //pass false?- } else {- breakCycle(dep, traced, processed);- }- }- });- processed[id] = true;- }- }-- function checkLoaded() {- var map, modId, err, usingPathFallback,- waitInterval = config.waitSeconds * 1000,- //It is possible to disable the wait interval by using waitSeconds of 0.- expired = waitInterval && (context.startTime + waitInterval) < new Date().getTime(),- noLoads = [],- reqCalls = [],- stillLoading = false,- needCycleCheck = true;-- //Do not bother if this call was a result of a cycle break.- if (inCheckLoaded) {- return;- }-- inCheckLoaded = true;-- //Figure out the state of all the modules.- eachProp(registry, function (mod) {- map = mod.map;- modId = map.id;-- //Skip things that are not enabled or in error state.- if (!mod.enabled) {- return;- }-- if (!map.isDefine) {- reqCalls.push(mod);- }-- if (!mod.error) {- //If the module should be executed, and it has not- //been inited and time is up, remember it.- if (!mod.inited && expired) {- if (hasPathFallback(modId)) {- usingPathFallback = true;- stillLoading = true;- } else {- noLoads.push(modId);- removeScript(modId);- }- } else if (!mod.inited && mod.fetched && map.isDefine) {- stillLoading = true;- if (!map.prefix) {- //No reason to keep looking for unfinished- //loading. If the only stillLoading is a- //plugin resource though, keep going,- //because it may be that a plugin resource- //is waiting on a non-plugin cycle.- return (needCycleCheck = false);- }- }- }- });-- if (expired && noLoads.length) {- //If wait time expired, throw error of unloaded modules.- err = makeError('timeout', 'Load timeout for modules: ' + noLoads, null, noLoads);- err.contextName = context.contextName;- return onError(err);- }-- //Not expired, check for a cycle.- if (needCycleCheck) {- each(reqCalls, function (mod) {- breakCycle(mod, {}, {});- });- }-- //If still waiting on loads, and the waiting load is something- //other than a plugin resource, or there are still outstanding- //scripts, then just try back later.- if ((!expired || usingPathFallback) && stillLoading) {- //Something is still waiting to load. Wait for it, but only- //if a timeout is not already in effect.- if ((isBrowser || isWebWorker) && !checkLoadedTimeoutId) {- checkLoadedTimeoutId = setTimeout(function () {- checkLoadedTimeoutId = 0;- checkLoaded();- }, 50);- }- }-- inCheckLoaded = false;- }-- Module = function (map) {- this.events = undefEvents[map.id] || {};- this.map = map;- this.shim = config.shim[map.id];- this.depExports = [];- this.depMaps = [];- this.depMatched = [];- this.pluginMaps = {};- this.depCount = 0;-- /* this.exports this.factory- this.depMaps = [],- this.enabled, this.fetched- */- };-- Module.prototype = {- init: function (depMaps, factory, errback, options) {- options = options || {};-- //Do not do more inits if already done. Can happen if there- //are multiple define calls for the same module. That is not- //a normal, common case, but it is also not unexpected.- if (this.inited) {- return;- }-- this.factory = factory;-- if (errback) {- //Register for errors on this module.- this.on('error', errback);- } else if (this.events.error) {- //If no errback already, but there are error listeners- //on this module, set up an errback to pass to the deps.- errback = bind(this, function (err) {- this.emit('error', err);- });- }-- //Do a copy of the dependency array, so that- //source inputs are not modified. For example- //"shim" deps are passed in here directly, and- //doing a direct modification of the depMaps array- //would affect that config.- this.depMaps = depMaps && depMaps.slice(0);-- this.errback = errback;-- //Indicate this module has be initialized- this.inited = true;-- this.ignore = options.ignore;-- //Could have option to init this module in enabled mode,- //or could have been previously marked as enabled. However,- //the dependencies are not known until init is called. So- //if enabled previously, now trigger dependencies as enabled.- if (options.enabled || this.enabled) {- //Enable this module and dependencies.- //Will call this.check()- this.enable();- } else {- this.check();- }- },-- defineDep: function (i, depExports) {- //Because of cycles, defined callback for a given- //export can be called more than once.- if (!this.depMatched[i]) {- this.depMatched[i] = true;- this.depCount -= 1;- this.depExports[i] = depExports;- }- },-- fetch: function () {- if (this.fetched) {- return;- }- this.fetched = true;-- context.startTime = (new Date()).getTime();-- var map = this.map;-- //If the manager is for a plugin managed resource,- //ask the plugin to load it now.- if (this.shim) {- context.makeRequire(this.map, {- enableBuildCallback: true- })(this.shim.deps || [], bind(this, function () {- return map.prefix ? this.callPlugin() : this.load();- }));- } else {- //Regular dependency.- return map.prefix ? this.callPlugin() : this.load();- }- },-- load: function () {- var url = this.map.url;-- //Regular dependency.- if (!urlFetched[url]) {- urlFetched[url] = true;- context.load(this.map.id, url);- }- },-- /**- * Checks is the module is ready to define itself, and if so,- * define it.- */- check: function () {- if (!this.enabled || this.enabling) {- return;- }-- var err, cjsModule,- id = this.map.id,- depExports = this.depExports,- exports = this.exports,- factory = this.factory;-- if (!this.inited) {- this.fetch();- } else if (this.error) {- this.emit('error', this.error);- } else if (!this.defining) {- //The factory could trigger another require call- //that would result in checking this module to- //define itself again. If already in the process- //of doing that, skip this work.- this.defining = true;-- if (this.depCount < 1 && !this.defined) {- if (isFunction(factory)) {- //If there is an error listener, favor passing- //to that instead of throwing an error.- if (this.events.error) {- try {- exports = context.execCb(id, factory, depExports, exports);- } catch (e) {- err = e;- }- } else {- exports = context.execCb(id, factory, depExports, exports);- }-- if (this.map.isDefine) {- //If setting exports via 'module' is in play,- //favor that over return value and exports. After that,- //favor a non-undefined return value over exports use.- cjsModule = this.module;- if (cjsModule &&- cjsModule.exports !== undefined &&- //Make sure it is not already the exports value- cjsModule.exports !== this.exports) {- exports = cjsModule.exports;- } else if (exports === undefined && this.usingExports) {- //exports already set the defined value.- exports = this.exports;- }- }-- if (err) {- err.requireMap = this.map;- err.requireModules = [this.map.id];- err.requireType = 'define';- return onError((this.error = err));- }-- } else {- //Just a literal value- exports = factory;- }-- this.exports = exports;-- if (this.map.isDefine && !this.ignore) {- defined[id] = exports;-- if (req.onResourceLoad) {- req.onResourceLoad(context, this.map, this.depMaps);- }- }-- //Clean up- delete registry[id];-- this.defined = true;- }-- //Finished the define stage. Allow calling check again- //to allow define notifications below in the case of a- //cycle.- this.defining = false;-- if (this.defined && !this.defineEmitted) {- this.defineEmitted = true;- this.emit('defined', this.exports);- this.defineEmitComplete = true;- }-- }- },-- callPlugin: function () {- var map = this.map,- id = map.id,- //Map already normalized the prefix.- pluginMap = makeModuleMap(map.prefix);-- //Mark this as a dependency for this plugin, so it- //can be traced for cycles.- this.depMaps.push(pluginMap);-- on(pluginMap, 'defined', bind(this, function (plugin) {- var load, normalizedMap, normalizedMod,- name = this.map.name,- parentName = this.map.parentMap ? this.map.parentMap.name : null,- localRequire = context.makeRequire(map.parentMap, {- enableBuildCallback: true,- skipMap: true- });-- //If current map is not normalized, wait for that- //normalized name to load instead of continuing.- if (this.map.unnormalized) {- //Normalize the ID if the plugin allows it.- if (plugin.normalize) {- name = plugin.normalize(name, function (name) {- return normalize(name, parentName, true);- }) || '';- }-- //prefix and name should already be normalized, no need- //for applying map config again either.- normalizedMap = makeModuleMap(map.prefix + '!' + name,- this.map.parentMap);- on(normalizedMap,- 'defined', bind(this, function (value) {- this.init([], function () { return value; }, null, {- enabled: true,- ignore: true- });- }));-- normalizedMod = registry[normalizedMap.id];- if (normalizedMod) {- //Mark this as a dependency for this plugin, so it- //can be traced for cycles.- this.depMaps.push(normalizedMap);-- if (this.events.error) {- normalizedMod.on('error', bind(this, function (err) {- this.emit('error', err);- }));- }- normalizedMod.enable();- }-- return;- }-- load = bind(this, function (value) {- this.init([], function () { return value; }, null, {- enabled: true- });- });-- load.error = bind(this, function (err) {- this.inited = true;- this.error = err;- err.requireModules = [id];-- //Remove temp unnormalized modules for this module,- //since they will never be resolved otherwise now.- eachProp(registry, function (mod) {- if (mod.map.id.indexOf(id + '_unnormalized') === 0) {- cleanRegistry(mod.map.id);- }- });-- onError(err);- });-- //Allow plugins to load other code without having to know the- //context or how to 'complete' the load.- load.fromText = bind(this, function (text, textAlt) {- /*jslint evil: true */- var moduleName = map.name,- moduleMap = makeModuleMap(moduleName),- hasInteractive = useInteractive;-- //As of 2.1.0, support just passing the text, to reinforce- //fromText only being called once per resource. Still- //support old style of passing moduleName but discard- //that moduleName in favor of the internal ref.- if (textAlt) {- text = textAlt;- }-- //Turn off interactive script matching for IE for any define- //calls in the text, then turn it back on at the end.- if (hasInteractive) {- useInteractive = false;- }-- //Prime the system by creating a module instance for- //it.- getModule(moduleMap);-- try {- req.exec(text);- } catch (e) {- throw new Error('fromText eval for ' + moduleName +- ' failed: ' + e);- }-- if (hasInteractive) {- useInteractive = true;- }-- //Mark this as a dependency for the plugin- //resource- this.depMaps.push(moduleMap);-- //Support anonymous modules.- context.completeLoad(moduleName);-- //Bind the value of that module to the value for this- //resource ID.- localRequire([moduleName], load);- });-- //Use parentName here since the plugin's name is not reliable,- //could be some weird string with no path that actually wants to- //reference the parentName's path.- plugin.load(map.name, localRequire, load, config);- }));-- context.enable(pluginMap, this);- this.pluginMaps[pluginMap.id] = pluginMap;- },-- enable: function () {- this.enabled = true;-- //Set flag mentioning that the module is enabling,- //so that immediate calls to the defined callbacks- //for dependencies do not trigger inadvertent load- //with the depCount still being zero.- this.enabling = true;-- //Enable each dependency- each(this.depMaps, bind(this, function (depMap, i) {- var id, mod, handler;-- if (typeof depMap === 'string') {- //Dependency needs to be converted to a depMap- //and wired up to this module.- depMap = makeModuleMap(depMap,- (this.map.isDefine ? this.map : this.map.parentMap),- false,- !this.skipMap);- this.depMaps[i] = depMap;-- handler = handlers[depMap.id];-- if (handler) {- this.depExports[i] = handler(this);- return;- }-- this.depCount += 1;-- on(depMap, 'defined', bind(this, function (depExports) {- this.defineDep(i, depExports);- this.check();- }));-- if (this.errback) {- on(depMap, 'error', this.errback);- }- }-- id = depMap.id;- mod = registry[id];-- //Skip special modules like 'require', 'exports', 'module'- //Also, don't call enable if it is already enabled,- //important in circular dependency cases.- if (!handlers[id] && mod && !mod.enabled) {- context.enable(depMap, this);- }- }));-- //Enable each plugin that is used in- //a dependency- eachProp(this.pluginMaps, bind(this, function (pluginMap) {- var mod = registry[pluginMap.id];- if (mod && !mod.enabled) {- context.enable(pluginMap, this);- }- }));-- this.enabling = false;-- this.check();- },-- on: function (name, cb) {- var cbs = this.events[name];- if (!cbs) {- cbs = this.events[name] = [];- }- cbs.push(cb);- },-- emit: function (name, evt) {- each(this.events[name], function (cb) {- cb(evt);- });- if (name === 'error') {- //Now that the error handler was triggered, remove- //the listeners, since this broken Module instance- //can stay around for a while in the registry.- delete this.events[name];- }- }- };-- function callGetModule(args) {- getModule(makeModuleMap(args[0], null, true)).init(args[1], args[2]);- }-- function removeListener(node, func, name, ieName) {- //Favor detachEvent because of IE9- //issue, see attachEvent/addEventListener comment elsewhere- //in this file.- if (node.detachEvent && !isOpera) {- //Probably IE. If not it will throw an error, which will be- //useful to know.- if (ieName) {- node.detachEvent(ieName, func);- }- } else {- node.removeEventListener(name, func, false);- }- }-- /**- * Given an event from a script node, get the requirejs info from it,- * and then removes the event listeners on the node.- * @param {Event} evt- * @returns {Object}- */- function getScriptData(evt) {- //Using currentTarget instead of target for Firefox 2.0's sake. Not- //all old browsers will be supported, but this one was easy enough- //to support and still makes sense.- var node = evt.currentTarget || evt.srcElement;-- //Remove the listeners once here.- removeListener(node, context.onScriptLoad, 'load', 'onreadystatechange');- removeListener(node, context.onScriptError, 'error');-- return {- node: node,- id: node && node.getAttribute('data-requiremodule')- };- }-- function intakeDefines() {- var args;-- //Any defined modules in the global queue, intake them now.- takeGlobalQueue();-- //Make sure any remaining defQueue items get properly processed.- while (defQueue.length) {- args = defQueue.shift();- if (args[0] === null) {- return onError(makeError('mismatch', 'Mismatched anonymous define() module: ' + args[args.length - 1]));- } else {- //args are id, deps, factory. Should be normalized by the- //define() function.- callGetModule(args);- }- }- }-- context = {- config: config,- contextName: contextName,- registry: registry,- defined: defined,- urlFetched: urlFetched,- defQueue: defQueue,- Module: Module,- makeModuleMap: makeModuleMap,- nextTick: req.nextTick,-- /**- * Set a configuration for the context.- * @param {Object} cfg config object to integrate.- */- configure: function (cfg) {- //Make sure the baseUrl ends in a slash.- if (cfg.baseUrl) {- if (cfg.baseUrl.charAt(cfg.baseUrl.length - 1) !== '/') {- cfg.baseUrl += '/';- }- }-- //Save off the paths and packages since they require special processing,- //they are additive.- var pkgs = config.pkgs,- shim = config.shim,- objs = {- paths: true,- config: true,- map: true- };-- eachProp(cfg, function (value, prop) {- if (objs[prop]) {- if (prop === 'map') {- mixin(config[prop], value, true, true);- } else {- mixin(config[prop], value, true);- }- } else {- config[prop] = value;- }- });-- //Merge shim- if (cfg.shim) {- eachProp(cfg.shim, function (value, id) {- //Normalize the structure- if (isArray(value)) {- value = {- deps: value- };- }- if (value.exports && !value.exportsFn) {- value.exportsFn = context.makeShimExports(value);- }- shim[id] = value;- });- config.shim = shim;- }-- //Adjust packages if necessary.- if (cfg.packages) {- each(cfg.packages, function (pkgObj) {- var location;-- pkgObj = typeof pkgObj === 'string' ? { name: pkgObj } : pkgObj;- location = pkgObj.location;-- //Create a brand new object on pkgs, since currentPackages can- //be passed in again, and config.pkgs is the internal transformed- //state for all package configs.- pkgs[pkgObj.name] = {- name: pkgObj.name,- location: location || pkgObj.name,- //Remove leading dot in main, so main paths are normalized,- //and remove any trailing .js, since different package- //envs have different conventions: some use a module name,- //some use a file name.- main: (pkgObj.main || 'main')- .replace(currDirRegExp, '')- .replace(jsSuffixRegExp, '')- };- });-- //Done with modifications, assing packages back to context config- config.pkgs = pkgs;- }-- //If there are any "waiting to execute" modules in the registry,- //update the maps for them, since their info, like URLs to load,- //may have changed.- eachProp(registry, function (mod, id) {- //If module already has init called, since it is too- //late to modify them, and ignore unnormalized ones- //since they are transient.- if (!mod.inited && !mod.map.unnormalized) {- mod.map = makeModuleMap(id);- }- });-- //If a deps array or a config callback is specified, then call- //require with those args. This is useful when require is defined as a- //config object before require.js is loaded.- if (cfg.deps || cfg.callback) {- context.require(cfg.deps || [], cfg.callback);- }- },-- makeShimExports: function (value) {- function fn() {- var ret;- if (value.init) {- ret = value.init.apply(global, arguments);- }- return ret || getGlobal(value.exports);- }- return fn;- },-- makeRequire: function (relMap, options) {- options = options || {};-- function localRequire(deps, callback, errback) {- var id, map, requireMod;-- if (options.enableBuildCallback && callback && isFunction(callback)) {- callback.__requireJsBuild = true;- }-- if (typeof deps === 'string') {- if (isFunction(callback)) {- //Invalid call- return onError(makeError('requireargs', 'Invalid require call'), errback);- }-- //If require|exports|module are requested, get the- //value for them from the special handlers. Caveat:- //this only works while module is being defined.- if (relMap && handlers[deps]) {- return handlers[deps](registry[relMap.id]);- }-- //Synchronous access to one module. If require.get is- //available (as in the Node adapter), prefer that.- if (req.get) {- return req.get(context, deps, relMap);- }-- //Normalize module name, if it contains . or ..- map = makeModuleMap(deps, relMap, false, true);- id = map.id;-- if (!hasProp(defined, id)) {- return onError(makeError('notloaded', 'Module name "' +- id +- '" has not been loaded yet for context: ' +- contextName +- (relMap ? '' : '. Use require([])')));- }- return defined[id];- }-- //Grab defines waiting in the global queue.- intakeDefines();-- //Mark all the dependencies as needing to be loaded.- context.nextTick(function () {- //Some defines could have been added since the- //require call, collect them.- intakeDefines();-- requireMod = getModule(makeModuleMap(null, relMap));-- //Store if map config should be applied to this require- //call for dependencies.- requireMod.skipMap = options.skipMap;-- requireMod.init(deps, callback, errback, {- enabled: true- });-- checkLoaded();- });-- return localRequire;- }-- mixin(localRequire, {- isBrowser: isBrowser,-- /**- * Converts a module name + .extension into an URL path.- * *Requires* the use of a module name. It does not support using- * plain URLs like nameToUrl.- */- toUrl: function (moduleNamePlusExt) {- var index = moduleNamePlusExt.lastIndexOf('.'),- ext = null;-- if (index !== -1) {- ext = moduleNamePlusExt.substring(index, moduleNamePlusExt.length);- moduleNamePlusExt = moduleNamePlusExt.substring(0, index);- }-- return context.nameToUrl(normalize(moduleNamePlusExt,- relMap && relMap.id, true), ext);- },-- defined: function (id) {- return hasProp(defined, makeModuleMap(id, relMap, false, true).id);- },-- specified: function (id) {- id = makeModuleMap(id, relMap, false, true).id;- return hasProp(defined, id) || hasProp(registry, id);- }- });-- //Only allow undef on top level require calls- if (!relMap) {- localRequire.undef = function (id) {- //Bind any waiting define() calls to this context,- //fix for #408- takeGlobalQueue();-- var map = makeModuleMap(id, relMap, true),- mod = registry[id];-- delete defined[id];- delete urlFetched[map.url];- delete undefEvents[id];-- if (mod) {- //Hold on to listeners in case the- //module will be attempted to be reloaded- //using a different config.- if (mod.events.defined) {- undefEvents[id] = mod.events;- }-- cleanRegistry(id);- }- };- }-- return localRequire;- },-- /**- * Called to enable a module if it is still in the registry- * awaiting enablement. parent module is passed in for context,- * used by the optimizer.- */- enable: function (depMap, parent) {- var mod = registry[depMap.id];- if (mod) {- getModule(depMap).enable();- }- },-- /**- * Internal method used by environment adapters to complete a load event.- * A load event could be a script load or just a load pass from a synchronous- * load call.- * @param {String} moduleName the name of the module to potentially complete.- */- completeLoad: function (moduleName) {- var found, args, mod,- shim = config.shim[moduleName] || {},- shExports = shim.exports;-- takeGlobalQueue();-- while (defQueue.length) {- args = defQueue.shift();- if (args[0] === null) {- args[0] = moduleName;- //If already found an anonymous module and bound it- //to this name, then this is some other anon module- //waiting for its completeLoad to fire.- if (found) {- break;- }- found = true;- } else if (args[0] === moduleName) {- //Found matching define call for this script!- found = true;- }-- callGetModule(args);- }-- //Do this after the cycle of callGetModule in case the result- //of those calls/init calls changes the registry.- mod = registry[moduleName];-- if (!found && !defined[moduleName] && mod && !mod.inited) {- if (config.enforceDefine && (!shExports || !getGlobal(shExports))) {- if (hasPathFallback(moduleName)) {- return;- } else {- return onError(makeError('nodefine',- 'No define call for ' + moduleName,- null,- [moduleName]));- }- } else {- //A script that does not call define(), so just simulate- //the call for it.- callGetModule([moduleName, (shim.deps || []), shim.exportsFn]);- }- }-- checkLoaded();- },-- /**- * Converts a module name to a file path. Supports cases where- * moduleName may actually be just an URL.- * Note that it **does not** call normalize on the moduleName,- * it is assumed to have already been normalized. This is an- * internal API, not a public one. Use toUrl for the public API.- */- nameToUrl: function (moduleName, ext) {- var paths, pkgs, pkg, pkgPath, syms, i, parentModule, url,- parentPath;-- //If a colon is in the URL, it indicates a protocol is used and it is just- //an URL to a file, or if it starts with a slash, contains a query arg (i.e. ?)- //or ends with .js, then assume the user meant to use an url and not a module id.- //The slash is important for protocol-less URLs as well as full paths.- if (req.jsExtRegExp.test(moduleName)) {- //Just a plain path, not module name lookup, so just return it.- //Add extension if it is included. This is a bit wonky, only non-.js things pass- //an extension, this method probably needs to be reworked.- url = moduleName + (ext || '');- } else {- //A module that needs to be converted to a path.- paths = config.paths;- pkgs = config.pkgs;-- syms = moduleName.split('/');- //For each module name segment, see if there is a path- //registered for it. Start with most specific name- //and work up from it.- for (i = syms.length; i > 0; i -= 1) {- parentModule = syms.slice(0, i).join('/');- pkg = pkgs[parentModule];- parentPath = paths[parentModule];- if (parentPath) {- //If an array, it means there are a few choices,- //Choose the one that is desired- if (isArray(parentPath)) {- parentPath = parentPath[0];- }- syms.splice(0, i, parentPath);- break;- } else if (pkg) {- //If module name is just the package name, then looking- //for the main module.- if (moduleName === pkg.name) {- pkgPath = pkg.location + '/' + pkg.main;- } else {- pkgPath = pkg.location;- }- syms.splice(0, i, pkgPath);- break;- }- }-- //Join the path parts together, then figure out if baseUrl is needed.- url = syms.join('/');- url += (ext || (/\?/.test(url) ? '' : '.js'));- url = (url.charAt(0) === '/' || url.match(/^[\w\+\.\-]+:/) ? '' : config.baseUrl) + url;- }-- return config.urlArgs ? url +- ((url.indexOf('?') === -1 ? '?' : '&') +- config.urlArgs) : url;- },-- //Delegates to req.load. Broken out as a separate function to- //allow overriding in the optimizer.- load: function (id, url) {- req.load(context, id, url);- },-- /**- * Executes a module callack function. Broken out as a separate function- * solely to allow the build system to sequence the files in the built- * layer in the right sequence.- *- * @private- */- execCb: function (name, callback, args, exports) {- return callback.apply(exports, args);- },-- /**- * callback for script loads, used to check status of loading.- *- * @param {Event} evt the event from the browser for the script- * that was loaded.- */- onScriptLoad: function (evt) {- //Using currentTarget instead of target for Firefox 2.0's sake. Not- //all old browsers will be supported, but this one was easy enough- //to support and still makes sense.- if (evt.type === 'load' ||- (readyRegExp.test((evt.currentTarget || evt.srcElement).readyState))) {- //Reset interactive script so a script node is not held onto for- //to long.- interactiveScript = null;-- //Pull out the name of the module and the context.- var data = getScriptData(evt);- context.completeLoad(data.id);- }- },-- /**- * Callback for script errors.- */- onScriptError: function (evt) {- var data = getScriptData(evt);- if (!hasPathFallback(data.id)) {- return onError(makeError('scripterror', 'Script error', evt, [data.id]));- }- }- };-- context.require = context.makeRequire();- return context;- }-- /**- * Main entry point.- *- * If the only argument to require is a string, then the module that- * is represented by that string is fetched for the appropriate context.- *- * If the first argument is an array, then it will be treated as an array- * of dependency string names to fetch. An optional function callback can- * be specified to execute when all of those dependencies are available.- *- * Make a local req variable to help Caja compliance (it assumes things- * on a require that are not standardized), and to give a short- * name for minification/local scope use.- */- req = requirejs = function (deps, callback, errback, optional) {-- //Find the right context, use default- var context, config,- contextName = defContextName;-- // Determine if have config object in the call.- if (!isArray(deps) && typeof deps !== 'string') {- // deps is a config object- config = deps;- if (isArray(callback)) {- // Adjust args if there are dependencies- deps = callback;- callback = errback;- errback = optional;- } else {- deps = [];- }- }-- if (config && config.context) {- contextName = config.context;- }-- context = contexts[contextName];- if (!context) {- context = contexts[contextName] = req.s.newContext(contextName);- }-- if (config) {- context.configure(config);- }-- return context.require(deps, callback, errback);- };-- /**- * Support require.config() to make it easier to cooperate with other- * AMD loaders on globally agreed names.- */- req.config = function (config) {- return req(config);- };-- /**- * Execute something after the current tick- * of the event loop. Override for other envs- * that have a better solution than setTimeout.- * @param {Function} fn function to execute later.- */- req.nextTick = typeof setTimeout !== 'undefined' ? function (fn) {- setTimeout(fn, 4);- } : function (fn) { fn(); };-- /**- * Export require as a global, but only if it does not already exist.- */- if (!require) {- require = req;- }-- req.version = version;-- //Used to filter out dependencies that are already paths.- req.jsExtRegExp = /^\/|:|\?|\.js$/;- req.isBrowser = isBrowser;- s = req.s = {- contexts: contexts,- newContext: newContext- };-- //Create default context.- req({});-- //Exports some context-sensitive methods on global require.- each([- 'toUrl',- 'undef',- 'defined',- 'specified'- ], function (prop) {- //Reference from contexts instead of early binding to default context,- //so that during builds, the latest instance of the default context- //with its config gets used.- req[prop] = function () {- var ctx = contexts[defContextName];- return ctx.require[prop].apply(ctx, arguments);- };- });-- if (isBrowser) {- head = s.head = document.getElementsByTagName('head')[0];- //If BASE tag is in play, using appendChild is a problem for IE6.- //When that browser dies, this can be removed. Details in this jQuery bug:- //http://dev.jquery.com/ticket/2709- baseElement = document.getElementsByTagName('base')[0];- if (baseElement) {- head = s.head = baseElement.parentNode;- }- }-- /**- * Any errors that require explicitly generates will be passed to this- * function. Intercept/override it if you want custom error handling.- * @param {Error} err the error object.- */- req.onError = function (err) {- throw err;- };-- /**- * Does the request to load a module for the browser case.- * Make this a separate function to allow other environments- * to override it.- *- * @param {Object} context the require context to find state.- * @param {String} moduleName the name of the module.- * @param {Object} url the URL to the module.- */- req.load = function (context, moduleName, url) {- var config = (context && context.config) || {},- node;- if (isBrowser) {- //In the browser so use a script tag- node = config.xhtml ?- document.createElementNS('http://www.w3.org/1999/xhtml', 'html:script') :- document.createElement('script');- node.type = config.scriptType || 'text/javascript';- node.charset = 'utf-8';- node.async = true;-- node.setAttribute('data-requirecontext', context.contextName);- node.setAttribute('data-requiremodule', moduleName);-- //Set up load listener. Test attachEvent first because IE9 has- //a subtle issue in its addEventListener and script onload firings- //that do not match the behavior of all other browsers with- //addEventListener support, which fire the onload event for a- //script right after the script execution. See:- //https://connect.microsoft.com/IE/feedback/details/648057/script-onload-event-is-not-fired-immediately-after-script-execution- //UNFORTUNATELY Opera implements attachEvent but does not follow the script- //script execution mode.- if (node.attachEvent &&- //Check if node.attachEvent is artificially added by custom script or- //natively supported by browser- //read https://github.com/jrburke/requirejs/issues/187- //if we can NOT find [native code] then it must NOT natively supported.- //in IE8, node.attachEvent does not have toString()- //Note the test for "[native code" with no closing brace, see:- //https://github.com/jrburke/requirejs/issues/273- !(node.attachEvent.toString && node.attachEvent.toString().indexOf('[native code') < 0) &&- !isOpera) {- //Probably IE. IE (at least 6-8) do not fire- //script onload right after executing the script, so- //we cannot tie the anonymous define call to a name.- //However, IE reports the script as being in 'interactive'- //readyState at the time of the define call.- useInteractive = true;-- node.attachEvent('onreadystatechange', context.onScriptLoad);- //It would be great to add an error handler here to catch- //404s in IE9+. However, onreadystatechange will fire before- //the error handler, so that does not help. If addEvenListener- //is used, then IE will fire error before load, but we cannot- //use that pathway given the connect.microsoft.com issue- //mentioned above about not doing the 'script execute,- //then fire the script load event listener before execute- //next script' that other browsers do.- //Best hope: IE10 fixes the issues,- //and then destroys all installs of IE 6-9.- //node.attachEvent('onerror', context.onScriptError);- } else {- node.addEventListener('load', context.onScriptLoad, false);- node.addEventListener('error', context.onScriptError, false);- }- node.src = url;-- //For some cache cases in IE 6-8, the script executes before the end- //of the appendChild execution, so to tie an anonymous define- //call to the module name (which is stored on the node), hold on- //to a reference to this node, but clear after the DOM insertion.- currentlyAddingScript = node;- if (baseElement) {- head.insertBefore(node, baseElement);- } else {- head.appendChild(node);- }- currentlyAddingScript = null;-- return node;- } else if (isWebWorker) {- //In a web worker, use importScripts. This is not a very- //efficient use of importScripts, importScripts will block until- //its script is downloaded and evaluated. However, if web workers- //are in play, the expectation that a build has been done so that- //only one script needs to be loaded anyway. This may need to be- //reevaluated if other use cases become common.- importScripts(url);-- //Account for anonymous modules- context.completeLoad(moduleName);- }- };-- function getInteractiveScript() {- if (interactiveScript && interactiveScript.readyState === 'interactive') {- return interactiveScript;- }-- eachReverse(scripts(), function (script) {- if (script.readyState === 'interactive') {- return (interactiveScript = script);- }- });- return interactiveScript;- }-- //Look for a data-main script attribute, which could also adjust the baseUrl.- if (isBrowser) {- //Figure out baseUrl. Get it from the script tag with require.js in it.- eachReverse(scripts(), function (script) {- //Set the 'head' where we can append children by- //using the script's parent.- if (!head) {- head = script.parentNode;- }-- //Look for a data-main attribute to set main script for the page- //to load. If it is there, the path to data main becomes the- //baseUrl, if it is not already set.- dataMain = script.getAttribute('data-main');- if (dataMain) {- //Set final baseUrl if there is not already an explicit one.- if (!cfg.baseUrl) {- //Pull off the directory of data-main for use as the- //baseUrl.- src = dataMain.split('/');- mainScript = src.pop();- subPath = src.length ? src.join('/') + '/' : './';-- cfg.baseUrl = subPath;- dataMain = mainScript;- }-- //Strip off any trailing .js since dataMain is now- //like a module name.- dataMain = dataMain.replace(jsSuffixRegExp, '');-- //Put the data-main script in the files to load.- cfg.deps = cfg.deps ? cfg.deps.concat(dataMain) : [dataMain];-- return true;- }- });- }-- /**- * The function that handles definitions of modules. Differs from- * require() in that a string for the module should be the first argument,- * and the function to execute after dependencies are loaded should- * return a value to define the module corresponding to the first argument's- * name.- */- define = function (name, deps, callback) {- var node, context;-- //Allow for anonymous modules- if (typeof name !== 'string') {- //Adjust args appropriately- callback = deps;- deps = name;- name = null;- }-- //This module may not have dependencies- if (!isArray(deps)) {- callback = deps;- deps = [];- }-- //If no name, and callback is a function, then figure out if it a- //CommonJS thing with dependencies.- if (!deps.length && isFunction(callback)) {- //Remove comments from the callback string,- //look for require calls, and pull them into the dependencies,- //but only if there are function args.- if (callback.length) {- callback- .toString()- .replace(commentRegExp, '')- .replace(cjsRequireRegExp, function (match, dep) {- deps.push(dep);- });-- //May be a CommonJS thing even without require calls, but still- //could use exports, and module. Avoid doing exports and module- //work though if it just needs require.- //REQUIRES the function to expect the CommonJS variables in the- //order listed below.- deps = (callback.length === 1 ? ['require'] : ['require', 'exports', 'module']).concat(deps);- }- }-- //If in IE 6-8 and hit an anonymous define() call, do the interactive- //work.- if (useInteractive) {- node = currentlyAddingScript || getInteractiveScript();- if (node) {- if (!name) {- name = node.getAttribute('data-requiremodule');- }- context = contexts[node.getAttribute('data-requirecontext')];- }- }-- //Always save off evaluating the def call until the script onload handler.- //This allows multiple modules to be in a file without prematurely- //tracing dependencies, and allows for anonymous module support,- //where the module name is not known until the script onload event- //occurs. If no context, use the global queue, and get it processed- //in the onscript load callback.- (context ? context.defQueue : globalDefQueue).push([name, deps, callback]);- };-- define.amd = {- jQuery: true- };--- /**- * Executes the text. Normally just uses eval, but can be modified- * to use a better, environment-specific call. Only used for transpiling- * loader plugins, not for plain JS modules.- * @param {String} text the text to execute/evaluate.- */- req.exec = function (text) {- /*jslint evil: true */- return eval(text);- };-- //Set up with config info.- req(cfg);-}(this));