azkaban-developers

Changes

Details

diff --git a/azkaban-web-server/src/web/css/bootstrap.css b/azkaban-web-server/src/web/css/bootstrap.css
index fb50e38..9b21ce7 100644
--- a/azkaban-web-server/src/web/css/bootstrap.css
+++ b/azkaban-web-server/src/web/css/bootstrap.css
@@ -42,7 +42,7 @@ template {
 html {
   font-family: sans-serif;
   -webkit-text-size-adjust: 100%;
-      -ms-text-size-adjust: 100%;
+  -ms-text-size-adjust: 100%;
 }
 
 body {
@@ -83,7 +83,7 @@ dfn {
 hr {
   height: 0;
   -moz-box-sizing: content-box;
-       box-sizing: content-box;
+  box-sizing: content-box;
 }
 
 mark {
@@ -190,8 +190,8 @@ input[type="radio"] {
 
 input[type="search"] {
   -webkit-box-sizing: content-box;
-     -moz-box-sizing: content-box;
-          box-sizing: content-box;
+  -moz-box-sizing: content-box;
+  box-sizing: content-box;
   -webkit-appearance: textfield;
 }
 
@@ -223,68 +223,86 @@ table {
     background: transparent !important;
     box-shadow: none !important;
   }
+
   a,
   a:visited {
     text-decoration: underline;
   }
+
   a[href]:after {
     content: " (" attr(href) ")";
   }
+
   abbr[title]:after {
     content: " (" attr(title) ")";
   }
+
   a[href^="javascript:"]:after,
   a[href^="#"]:after {
     content: "";
   }
+
   pre,
   blockquote {
     border: 1px solid #999;
     page-break-inside: avoid;
   }
+
   thead {
     display: table-header-group;
   }
+
   tr,
   img {
     page-break-inside: avoid;
   }
+
   img {
     max-width: 100% !important;
   }
-  @page  {
+
+  @page {
     margin: 2cm .5cm;
   }
+
   p,
   h2,
   h3 {
     orphans: 3;
     widows: 3;
   }
+
   h2,
   h3 {
     page-break-after: avoid;
   }
+
   select {
     background: #fff !important;
   }
+
   .navbar {
     display: none;
   }
+
   .table td,
   .table th {
     background-color: #fff !important;
   }
+
   .btn > .caret,
   .dropup > .btn > .caret {
     border-top-color: #000 !important;
   }
+
   .label {
     border: 1px solid #000;
   }
+
   .table {
     border-collapse: collapse !important;
   }
+
   .table-bordered th,
   .table-bordered td {
     border: 1px solid #ddd !important;
@@ -295,8 +313,8 @@ table {
 *:before,
 *:after {
   -webkit-box-sizing: border-box;
-     -moz-box-sizing: border-box;
-          box-sizing: border-box;
+  -moz-box-sizing: border-box;
+  box-sizing: border-box;
 }
 
 html {
@@ -362,7 +380,7 @@ img {
   border: 1px solid #dddddd;
   border-radius: 4px;
   -webkit-transition: all 0.2s ease-in-out;
-          transition: all 0.2s ease-in-out;
+  transition: all 0.2s ease-in-out;
 }
 
 .img-circle {
@@ -644,22 +662,27 @@ dd {
     text-overflow: ellipsis;
     white-space: nowrap;
   }
+
   .dl-horizontal dd {
     margin-left: 180px;
   }
+
   .dl-horizontal dd:before,
   .dl-horizontal dd:after {
     display: table;
     content: " ";
   }
+
   .dl-horizontal dd:after {
     clear: both;
   }
+
   .dl-horizontal dd:before,
   .dl-horizontal dd:after {
     display: table;
     content: " ";
   }
+
   .dl-horizontal dd:after {
     clear: both;
   }
@@ -1108,6 +1131,7 @@ pre code {
   .container {
     width: 750px;
   }
+
   .col-sm-1,
   .col-sm-2,
   .col-sm-3,
@@ -1121,156 +1145,207 @@ pre code {
   .col-sm-11 {
     float: left;
   }
+
   .col-sm-12 {
     width: 100%;
   }
+
   .col-sm-11 {
     width: 91.66666666666666%;
   }
+
   .col-sm-10 {
     width: 83.33333333333334%;
   }
+
   .col-sm-9 {
     width: 75%;
   }
+
   .col-sm-8 {
     width: 66.66666666666666%;
   }
+
   .col-sm-7 {
     width: 58.333333333333336%;
   }
+
   .col-sm-6 {
     width: 50%;
   }
+
   .col-sm-5 {
     width: 41.66666666666667%;
   }
+
   .col-sm-4 {
     width: 33.33333333333333%;
   }
+
   .col-sm-3 {
     width: 25%;
   }
+
   .col-sm-2 {
     width: 16.666666666666664%;
   }
+
   .col-sm-1 {
     width: 8.333333333333332%;
   }
+
   .col-sm-pull-12 {
     right: 100%;
   }
+
   .col-sm-pull-11 {
     right: 91.66666666666666%;
   }
+
   .col-sm-pull-10 {
     right: 83.33333333333334%;
   }
+
   .col-sm-pull-9 {
     right: 75%;
   }
+
   .col-sm-pull-8 {
     right: 66.66666666666666%;
   }
+
   .col-sm-pull-7 {
     right: 58.333333333333336%;
   }
+
   .col-sm-pull-6 {
     right: 50%;
   }
+
   .col-sm-pull-5 {
     right: 41.66666666666667%;
   }
+
   .col-sm-pull-4 {
     right: 33.33333333333333%;
   }
+
   .col-sm-pull-3 {
     right: 25%;
   }
+
   .col-sm-pull-2 {
     right: 16.666666666666664%;
   }
+
   .col-sm-pull-1 {
     right: 8.333333333333332%;
   }
+
   .col-sm-pull-0 {
     right: 0;
   }
+
   .col-sm-push-12 {
     left: 100%;
   }
+
   .col-sm-push-11 {
     left: 91.66666666666666%;
   }
+
   .col-sm-push-10 {
     left: 83.33333333333334%;
   }
+
   .col-sm-push-9 {
     left: 75%;
   }
+
   .col-sm-push-8 {
     left: 66.66666666666666%;
   }
+
   .col-sm-push-7 {
     left: 58.333333333333336%;
   }
+
   .col-sm-push-6 {
     left: 50%;
   }
+
   .col-sm-push-5 {
     left: 41.66666666666667%;
   }
+
   .col-sm-push-4 {
     left: 33.33333333333333%;
   }
+
   .col-sm-push-3 {
     left: 25%;
   }
+
   .col-sm-push-2 {
     left: 16.666666666666664%;
   }
+
   .col-sm-push-1 {
     left: 8.333333333333332%;
   }
+
   .col-sm-push-0 {
     left: 0;
   }
+
   .col-sm-offset-12 {
     margin-left: 100%;
   }
+
   .col-sm-offset-11 {
     margin-left: 91.66666666666666%;
   }
+
   .col-sm-offset-10 {
     margin-left: 83.33333333333334%;
   }
+
   .col-sm-offset-9 {
     margin-left: 75%;
   }
+
   .col-sm-offset-8 {
     margin-left: 66.66666666666666%;
   }
+
   .col-sm-offset-7 {
     margin-left: 58.333333333333336%;
   }
+
   .col-sm-offset-6 {
     margin-left: 50%;
   }
+
   .col-sm-offset-5 {
     margin-left: 41.66666666666667%;
   }
+
   .col-sm-offset-4 {
     margin-left: 33.33333333333333%;
   }
+
   .col-sm-offset-3 {
     margin-left: 25%;
   }
+
   .col-sm-offset-2 {
     margin-left: 16.666666666666664%;
   }
+
   .col-sm-offset-1 {
     margin-left: 8.333333333333332%;
   }
+
   .col-sm-offset-0 {
     margin-left: 0;
   }
@@ -1280,6 +1355,7 @@ pre code {
   .container {
     width: 970px;
   }
+
   .col-md-1,
   .col-md-2,
   .col-md-3,
@@ -1293,156 +1369,207 @@ pre code {
   .col-md-11 {
     float: left;
   }
+
   .col-md-12 {
     width: 100%;
   }
+
   .col-md-11 {
     width: 91.66666666666666%;
   }
+
   .col-md-10 {
     width: 83.33333333333334%;
   }
+
   .col-md-9 {
     width: 75%;
   }
+
   .col-md-8 {
     width: 66.66666666666666%;
   }
+
   .col-md-7 {
     width: 58.333333333333336%;
   }
+
   .col-md-6 {
     width: 50%;
   }
+
   .col-md-5 {
     width: 41.66666666666667%;
   }
+
   .col-md-4 {
     width: 33.33333333333333%;
   }
+
   .col-md-3 {
     width: 25%;
   }
+
   .col-md-2 {
     width: 16.666666666666664%;
   }
+
   .col-md-1 {
     width: 8.333333333333332%;
   }
+
   .col-md-pull-12 {
     right: 100%;
   }
+
   .col-md-pull-11 {
     right: 91.66666666666666%;
   }
+
   .col-md-pull-10 {
     right: 83.33333333333334%;
   }
+
   .col-md-pull-9 {
     right: 75%;
   }
+
   .col-md-pull-8 {
     right: 66.66666666666666%;
   }
+
   .col-md-pull-7 {
     right: 58.333333333333336%;
   }
+
   .col-md-pull-6 {
     right: 50%;
   }
+
   .col-md-pull-5 {
     right: 41.66666666666667%;
   }
+
   .col-md-pull-4 {
     right: 33.33333333333333%;
   }
+
   .col-md-pull-3 {
     right: 25%;
   }
+
   .col-md-pull-2 {
     right: 16.666666666666664%;
   }
+
   .col-md-pull-1 {
     right: 8.333333333333332%;
   }
+
   .col-md-pull-0 {
     right: 0;
   }
+
   .col-md-push-12 {
     left: 100%;
   }
+
   .col-md-push-11 {
     left: 91.66666666666666%;
   }
+
   .col-md-push-10 {
     left: 83.33333333333334%;
   }
+
   .col-md-push-9 {
     left: 75%;
   }
+
   .col-md-push-8 {
     left: 66.66666666666666%;
   }
+
   .col-md-push-7 {
     left: 58.333333333333336%;
   }
+
   .col-md-push-6 {
     left: 50%;
   }
+
   .col-md-push-5 {
     left: 41.66666666666667%;
   }
+
   .col-md-push-4 {
     left: 33.33333333333333%;
   }
+
   .col-md-push-3 {
     left: 25%;
   }
+
   .col-md-push-2 {
     left: 16.666666666666664%;
   }
+
   .col-md-push-1 {
     left: 8.333333333333332%;
   }
+
   .col-md-push-0 {
     left: 0;
   }
+
   .col-md-offset-12 {
     margin-left: 100%;
   }
+
   .col-md-offset-11 {
     margin-left: 91.66666666666666%;
   }
+
   .col-md-offset-10 {
     margin-left: 83.33333333333334%;
   }
+
   .col-md-offset-9 {
     margin-left: 75%;
   }
+
   .col-md-offset-8 {
     margin-left: 66.66666666666666%;
   }
+
   .col-md-offset-7 {
     margin-left: 58.333333333333336%;
   }
+
   .col-md-offset-6 {
     margin-left: 50%;
   }
+
   .col-md-offset-5 {
     margin-left: 41.66666666666667%;
   }
+
   .col-md-offset-4 {
     margin-left: 33.33333333333333%;
   }
+
   .col-md-offset-3 {
     margin-left: 25%;
   }
+
   .col-md-offset-2 {
     margin-left: 16.666666666666664%;
   }
+
   .col-md-offset-1 {
     margin-left: 8.333333333333332%;
   }
+
   .col-md-offset-0 {
     margin-left: 0;
   }
@@ -1452,6 +1579,7 @@ pre code {
   .container {
     width: 1170px;
   }
+
   .col-lg-1,
   .col-lg-2,
   .col-lg-3,
@@ -1465,156 +1593,207 @@ pre code {
   .col-lg-11 {
     float: left;
   }
+
   .col-lg-12 {
     width: 100%;
   }
+
   .col-lg-11 {
     width: 91.66666666666666%;
   }
+
   .col-lg-10 {
     width: 83.33333333333334%;
   }
+
   .col-lg-9 {
     width: 75%;
   }
+
   .col-lg-8 {
     width: 66.66666666666666%;
   }
+
   .col-lg-7 {
     width: 58.333333333333336%;
   }
+
   .col-lg-6 {
     width: 50%;
   }
+
   .col-lg-5 {
     width: 41.66666666666667%;
   }
+
   .col-lg-4 {
     width: 33.33333333333333%;
   }
+
   .col-lg-3 {
     width: 25%;
   }
+
   .col-lg-2 {
     width: 16.666666666666664%;
   }
+
   .col-lg-1 {
     width: 8.333333333333332%;
   }
+
   .col-lg-pull-12 {
     right: 100%;
   }
+
   .col-lg-pull-11 {
     right: 91.66666666666666%;
   }
+
   .col-lg-pull-10 {
     right: 83.33333333333334%;
   }
+
   .col-lg-pull-9 {
     right: 75%;
   }
+
   .col-lg-pull-8 {
     right: 66.66666666666666%;
   }
+
   .col-lg-pull-7 {
     right: 58.333333333333336%;
   }
+
   .col-lg-pull-6 {
     right: 50%;
   }
+
   .col-lg-pull-5 {
     right: 41.66666666666667%;
   }
+
   .col-lg-pull-4 {
     right: 33.33333333333333%;
   }
+
   .col-lg-pull-3 {
     right: 25%;
   }
+
   .col-lg-pull-2 {
     right: 16.666666666666664%;
   }
+
   .col-lg-pull-1 {
     right: 8.333333333333332%;
   }
+
   .col-lg-pull-0 {
     right: 0;
   }
+
   .col-lg-push-12 {
     left: 100%;
   }
+
   .col-lg-push-11 {
     left: 91.66666666666666%;
   }
+
   .col-lg-push-10 {
     left: 83.33333333333334%;
   }
+
   .col-lg-push-9 {
     left: 75%;
   }
+
   .col-lg-push-8 {
     left: 66.66666666666666%;
   }
+
   .col-lg-push-7 {
     left: 58.333333333333336%;
   }
+
   .col-lg-push-6 {
     left: 50%;
   }
+
   .col-lg-push-5 {
     left: 41.66666666666667%;
   }
+
   .col-lg-push-4 {
     left: 33.33333333333333%;
   }
+
   .col-lg-push-3 {
     left: 25%;
   }
+
   .col-lg-push-2 {
     left: 16.666666666666664%;
   }
+
   .col-lg-push-1 {
     left: 8.333333333333332%;
   }
+
   .col-lg-push-0 {
     left: 0;
   }
+
   .col-lg-offset-12 {
     margin-left: 100%;
   }
+
   .col-lg-offset-11 {
     margin-left: 91.66666666666666%;
   }
+
   .col-lg-offset-10 {
     margin-left: 83.33333333333334%;
   }
+
   .col-lg-offset-9 {
     margin-left: 75%;
   }
+
   .col-lg-offset-8 {
     margin-left: 66.66666666666666%;
   }
+
   .col-lg-offset-7 {
     margin-left: 58.333333333333336%;
   }
+
   .col-lg-offset-6 {
     margin-left: 50%;
   }
+
   .col-lg-offset-5 {
     margin-left: 41.66666666666667%;
   }
+
   .col-lg-offset-4 {
     margin-left: 33.33333333333333%;
   }
+
   .col-lg-offset-3 {
     margin-left: 25%;
   }
+
   .col-lg-offset-2 {
     margin-left: 16.666666666666664%;
   }
+
   .col-lg-offset-1 {
     margin-left: 8.333333333333332%;
   }
+
   .col-lg-offset-0 {
     margin-left: 0;
   }
@@ -1807,9 +1986,11 @@ table th[class*="col-"] {
     -ms-overflow-style: -ms-autohiding-scrollbar;
     -webkit-overflow-scrolling: touch;
   }
+
   .table-responsive > .table {
     margin-bottom: 0;
   }
+
   .table-responsive > .table > thead > tr > th,
   .table-responsive > .table > tbody > tr > th,
   .table-responsive > .table > tfoot > tr > th,
@@ -1818,9 +1999,11 @@ table th[class*="col-"] {
   .table-responsive > .table > tfoot > tr > td {
     white-space: nowrap;
   }
+
   .table-responsive > .table-bordered {
     border: 0;
   }
+
   .table-responsive > .table-bordered > thead > tr > th:first-child,
   .table-responsive > .table-bordered > tbody > tr > th:first-child,
   .table-responsive > .table-bordered > tfoot > tr > th:first-child,
@@ -1829,6 +2012,7 @@ table th[class*="col-"] {
   .table-responsive > .table-bordered > tfoot > tr > td:first-child {
     border-left: 0;
   }
+
   .table-responsive > .table-bordered > thead > tr > th:last-child,
   .table-responsive > .table-bordered > tbody > tr > th:last-child,
   .table-responsive > .table-bordered > tfoot > tr > th:last-child,
@@ -1837,6 +2021,7 @@ table th[class*="col-"] {
   .table-responsive > .table-bordered > tfoot > tr > td:last-child {
     border-right: 0;
   }
+
   .table-responsive > .table-bordered > tbody > tr:last-child > th,
   .table-responsive > .table-bordered > tfoot > tr:last-child > th,
   .table-responsive > .table-bordered > tbody > tr:last-child > td,
@@ -1871,8 +2056,8 @@ label {
 
 input[type="search"] {
   -webkit-box-sizing: border-box;
-     -moz-box-sizing: border-box;
-          box-sizing: border-box;
+  -moz-box-sizing: border-box;
+  box-sizing: border-box;
 }
 
 input[type="radio"],
@@ -1935,16 +2120,16 @@ output {
   border: 1px solid #cccccc;
   border-radius: 4px;
   -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
-          box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
+  box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
   -webkit-transition: border-color ease-in-out 0.15s, box-shadow ease-in-out 0.15s;
-          transition: border-color ease-in-out 0.15s, box-shadow ease-in-out 0.15s;
+  transition: border-color ease-in-out 0.15s, box-shadow ease-in-out 0.15s;
 }
 
 .form-control:focus {
   border-color: #66afe9;
   outline: 0;
   -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 8px rgba(102, 175, 233, 0.6);
-          box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 8px rgba(102, 175, 233, 0.6);
+  box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 8px rgba(102, 175, 233, 0.6);
 }
 
 .form-control:-moz-placeholder {
@@ -2086,13 +2271,13 @@ textarea.input-lg {
 .has-warning .form-control {
   border-color: #c09853;
   -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
-          box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
+  box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
 }
 
 .has-warning .form-control:focus {
   border-color: #a47e3c;
   -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #dbc59e;
-          box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #dbc59e;
+  box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #dbc59e;
 }
 
 .has-warning .input-group-addon {
@@ -2113,13 +2298,13 @@ textarea.input-lg {
 .has-error .form-control {
   border-color: #b94a48;
   -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
-          box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
+  box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
 }
 
 .has-error .form-control:focus {
   border-color: #953b39;
   -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #d59392;
-          box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #d59392;
+  box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #d59392;
 }
 
 .has-error .input-group-addon {
@@ -2140,13 +2325,13 @@ textarea.input-lg {
 .has-success .form-control {
   border-color: #468847;
   -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
-          box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
+  box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
 }
 
 .has-success .form-control:focus {
   border-color: #356635;
   -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #7aba7b;
-          box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #7aba7b;
+  box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #7aba7b;
 }
 
 .has-success .input-group-addon {
@@ -2172,9 +2357,11 @@ textarea.input-lg {
     margin-bottom: 0;
     vertical-align: middle;
   }
+
   .form-inline .form-control {
     display: inline-block;
   }
+
   .form-inline .radio,
   .form-inline .checkbox {
     display: inline-block;
@@ -2182,6 +2369,7 @@ textarea.input-lg {
     margin-top: 0;
     margin-bottom: 0;
   }
+
   .form-inline .radio input[type="radio"],
   .form-inline .checkbox input[type="checkbox"] {
     float: none;
@@ -2249,10 +2437,10 @@ textarea.input-lg {
   border: 1px solid transparent;
   border-radius: 4px;
   -webkit-user-select: none;
-     -moz-user-select: none;
-      -ms-user-select: none;
-       -o-user-select: none;
-          user-select: none;
+  -moz-user-select: none;
+  -ms-user-select: none;
+  -o-user-select: none;
+  user-select: none;
 }
 
 .btn:focus {
@@ -2272,7 +2460,7 @@ textarea.input-lg {
   background-image: none;
   outline: 0;
   -webkit-box-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125);
-          box-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125);
+  box-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125);
 }
 
 .btn.disabled,
@@ -2283,7 +2471,7 @@ fieldset[disabled] .btn {
   opacity: 0.65;
   filter: alpha(opacity=65);
   -webkit-box-shadow: none;
-          box-shadow: none;
+  box-shadow: none;
 }
 
 .btn-default {
@@ -2545,7 +2733,7 @@ fieldset[disabled] .btn-info.active {
 fieldset[disabled] .btn-link {
   background-color: transparent;
   -webkit-box-shadow: none;
-          box-shadow: none;
+  box-shadow: none;
 }
 
 .btn-link,
@@ -2609,7 +2797,7 @@ input[type="button"].btn-block {
 .fade {
   opacity: 0;
   -webkit-transition: opacity 0.15s linear;
-          transition: opacity 0.15s linear;
+  transition: opacity 0.15s linear;
 }
 
 .fade.in {
@@ -2629,7 +2817,7 @@ input[type="button"].btn-block {
   height: 0;
   overflow: hidden;
   -webkit-transition: height 0.35s ease;
-          transition: height 0.35s ease;
+  transition: height 0.35s ease;
 }
 
 @font-face {
@@ -3491,7 +3679,7 @@ input[type="button"].btn-block {
   border: 1px solid rgba(0, 0, 0, 0.15);
   border-radius: 4px;
   -webkit-box-shadow: 0 6px 12px rgba(0, 0, 0, 0.175);
-          box-shadow: 0 6px 12px rgba(0, 0, 0, 0.175);
+  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.175);
   background-clip: padding-box;
 }
 
@@ -3767,12 +3955,12 @@ input[type="button"].btn-block {
 
 .btn-group.open .dropdown-toggle {
   -webkit-box-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125);
-          box-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125);
+  box-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125);
 }
 
 .btn-group.open .dropdown-toggle.btn-link {
   -webkit-box-shadow: none;
-          box-shadow: none;
+  box-shadow: none;
 }
 
 .btn .caret {
@@ -4174,6 +4362,7 @@ textarea.input-group-sm > .input-group-btn > .btn {
     display: table-cell;
     width: 1%;
   }
+
   .nav-tabs.nav-justified > li > a {
     margin-bottom: 0;
   }
@@ -4195,6 +4384,7 @@ textarea.input-group-sm > .input-group-btn > .btn {
     border-bottom: 1px solid #dddddd;
     border-radius: 4px 4px 0 0;
   }
+
   .nav-tabs.nav-justified > .active > a,
   .nav-tabs.nav-justified > .active > a:hover,
   .nav-tabs.nav-justified > .active > a:focus {
@@ -4260,6 +4450,7 @@ textarea.input-group-sm > .input-group-btn > .btn {
     display: table-cell;
     width: 1%;
   }
+
   .nav-justified > li > a {
     margin-bottom: 0;
   }
@@ -4285,6 +4476,7 @@ textarea.input-group-sm > .input-group-btn > .btn {
     border-bottom: 1px solid #dddddd;
     border-radius: 4px 4px 0 0;
   }
+
   .nav-tabs-justified > .active > a,
   .nav-tabs-justified > .active > a:hover,
   .nav-tabs-justified > .active > a:focus {
@@ -4415,21 +4607,26 @@ textarea.input-group-sm > .input-group-btn > .btn {
     border-top: 0;
     box-shadow: none;
   }
+
   .navbar-collapse.collapse {
     display: block !important;
     height: auto !important;
     padding-bottom: 0;
     overflow: visible !important;
   }
+
   .navbar-collapse.in {
     overflow-y: auto;
   }
+
   .navbar-collapse .navbar-nav.navbar-left:first-child {
     margin-left: -15px;
   }
+
   .navbar-collapse .navbar-nav.navbar-right:last-child {
     margin-right: -15px;
   }
+
   .navbar-collapse .navbar-text:last-child {
     margin-right: 0;
   }
@@ -4553,13 +4750,16 @@ textarea.input-group-sm > .input-group-btn > .btn {
     border: 0;
     box-shadow: none;
   }
+
   .navbar-nav .open .dropdown-menu > li > a,
   .navbar-nav .open .dropdown-menu .dropdown-header {
     padding: 5px 15px 5px 25px;
   }
+
   .navbar-nav .open .dropdown-menu > li > a {
     line-height: 20px;
   }
+
   .navbar-nav .open .dropdown-menu > li > a:hover,
   .navbar-nav .open .dropdown-menu > li > a:focus {
     background-image: none;
@@ -4571,9 +4771,11 @@ textarea.input-group-sm > .input-group-btn > .btn {
     float: left;
     margin: 0;
   }
+
   .navbar-nav > li {
     float: left;
   }
+
   .navbar-nav > li > a {
     padding-top: 15px;
     padding-bottom: 15px;
@@ -4584,6 +4786,7 @@ textarea.input-group-sm > .input-group-btn > .btn {
   .navbar-left {
     float: left !important;
   }
+
   .navbar-right {
     float: right !important;
   }
@@ -4598,7 +4801,7 @@ textarea.input-group-sm > .input-group-btn > .btn {
   border-top: 1px solid transparent;
   border-bottom: 1px solid transparent;
   -webkit-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 1px 0 rgba(255, 255, 255, 0.1);
-          box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 1px 0 rgba(255, 255, 255, 0.1);
+  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 1px 0 rgba(255, 255, 255, 0.1);
 }
 
 @media (min-width: 768px) {
@@ -4607,9 +4810,11 @@ textarea.input-group-sm > .input-group-btn > .btn {
     margin-bottom: 0;
     vertical-align: middle;
   }
+
   .navbar-form .form-control {
     display: inline-block;
   }
+
   .navbar-form .radio,
   .navbar-form .checkbox {
     display: inline-block;
@@ -4617,6 +4822,7 @@ textarea.input-group-sm > .input-group-btn > .btn {
     margin-top: 0;
     margin-bottom: 0;
   }
+
   .navbar-form .radio input[type="radio"],
   .navbar-form .checkbox input[type="checkbox"] {
     float: none;
@@ -4639,7 +4845,7 @@ textarea.input-group-sm > .input-group-btn > .btn {
     margin-left: 0;
     border: 0;
     -webkit-box-shadow: none;
-            box-shadow: none;
+    box-shadow: none;
   }
 }
 
@@ -4768,17 +4974,20 @@ textarea.input-group-sm > .input-group-btn > .btn {
   .navbar-default .navbar-nav .open .dropdown-menu > li > a {
     color: #777777;
   }
+
   .navbar-default .navbar-nav .open .dropdown-menu > li > a:hover,
   .navbar-default .navbar-nav .open .dropdown-menu > li > a:focus {
     color: #333333;
     background-color: transparent;
   }
+
   .navbar-default .navbar-nav .open .dropdown-menu > .active > a,
   .navbar-default .navbar-nav .open .dropdown-menu > .active > a:hover,
   .navbar-default .navbar-nav .open .dropdown-menu > .active > a:focus {
     color: #555555;
     background-color: #e7e7e7;
   }
+
   .navbar-default .navbar-nav .open .dropdown-menu > .disabled > a,
   .navbar-default .navbar-nav .open .dropdown-menu > .disabled > a:hover,
   .navbar-default .navbar-nav .open .dropdown-menu > .disabled > a:focus {
@@ -4884,20 +5093,24 @@ textarea.input-group-sm > .input-group-btn > .btn {
   .navbar-inverse .navbar-nav .open .dropdown-menu > .dropdown-header {
     border-color: #080808;
   }
+
   .navbar-inverse .navbar-nav .open .dropdown-menu > li > a {
     color: #999999;
   }
+
   .navbar-inverse .navbar-nav .open .dropdown-menu > li > a:hover,
   .navbar-inverse .navbar-nav .open .dropdown-menu > li > a:focus {
     color: #ffffff;
     background-color: transparent;
   }
+
   .navbar-inverse .navbar-nav .open .dropdown-menu > .active > a,
   .navbar-inverse .navbar-nav .open .dropdown-menu > .active > a:hover,
   .navbar-inverse .navbar-nav .open .dropdown-menu > .active > a:focus {
     color: #ffffff;
     background-color: #080808;
   }
+
   .navbar-inverse .navbar-nav .open .dropdown-menu > .disabled > a,
   .navbar-inverse .navbar-nav .open .dropdown-menu > .disabled > a:hover,
   .navbar-inverse .navbar-nav .open .dropdown-menu > .disabled > a:focus {
@@ -5252,10 +5465,12 @@ a.list-group-item.active > .badge,
     padding-top: 48px;
     padding-bottom: 48px;
   }
+
   .container .jumbotron {
     padding-right: 60px;
     padding-left: 60px;
   }
+
   .jumbotron h1 {
     font-size: 63px;
   }
@@ -5273,7 +5488,7 @@ a.list-group-item.active > .badge,
   border: 1px solid #dddddd;
   border-radius: 4px;
   -webkit-transition: all 0.2s ease-in-out;
-          transition: all 0.2s ease-in-out;
+  transition: all 0.2s ease-in-out;
 }
 
 .thumbnail > img {
@@ -5430,7 +5645,7 @@ a.thumbnail.active {
   background-color: #f5f5f5;
   border-radius: 4px;
   -webkit-box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1);
-          box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1);
+  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1);
 }
 
 .progress-bar {
@@ -5443,9 +5658,9 @@ a.thumbnail.active {
   text-align: center;
   background-color: #428bca;
   -webkit-box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.15);
-          box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.15);
+  box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.15);
   -webkit-transition: width 0.6s ease;
-          transition: width 0.6s ease;
+  transition: width 0.6s ease;
 }
 
 .progress-striped .progress-bar {
@@ -5458,7 +5673,7 @@ a.thumbnail.active {
 
 .progress.active .progress-bar {
   -webkit-animation: progress-bar-stripes 2s linear infinite;
-          animation: progress-bar-stripes 2s linear infinite;
+  animation: progress-bar-stripes 2s linear infinite;
 }
 
 .progress-bar-success {
@@ -5625,7 +5840,7 @@ a.list-group-item.active:focus .list-group-item-text {
   border: 1px solid transparent;
   border-radius: 4px;
   -webkit-box-shadow: 0 1px 1px rgba(0, 0, 0, 0.05);
-          box-shadow: 0 1px 1px rgba(0, 0, 0, 0.05);
+  box-shadow: 0 1px 1px rgba(0, 0, 0, 0.05);
 }
 
 .panel-body {
@@ -5928,7 +6143,7 @@ a.list-group-item.active:focus .list-group-item-text {
   border: 1px solid #e3e3e3;
   border-radius: 4px;
   -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.05);
-          box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.05);
+  box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.05);
 }
 
 .well blockquote {
@@ -5992,18 +6207,18 @@ button.close {
 
 .modal.fade .modal-dialog {
   -webkit-transform: translate(0, -25%);
-      -ms-transform: translate(0, -25%);
-          transform: translate(0, -25%);
+  -ms-transform: translate(0, -25%);
+  transform: translate(0, -25%);
   -webkit-transition: -webkit-transform 0.3s ease-out;
-     -moz-transition: -moz-transform 0.3s ease-out;
-       -o-transition: -o-transform 0.3s ease-out;
-          transition: transform 0.3s ease-out;
+  -moz-transition: -moz-transform 0.3s ease-out;
+  -o-transition: -o-transform 0.3s ease-out;
+  transition: transform 0.3s ease-out;
 }
 
 .modal.in .modal-dialog {
   -webkit-transform: translate(0, 0);
-      -ms-transform: translate(0, 0);
-          transform: translate(0, 0);
+  -ms-transform: translate(0, 0);
+  transform: translate(0, 0);
 }
 
 .modal-dialog {
@@ -6023,7 +6238,7 @@ button.close {
   border-radius: 6px;
   outline: none;
   -webkit-box-shadow: 0 3px 9px rgba(0, 0, 0, 0.5);
-          box-shadow: 0 3px 9px rgba(0, 0, 0, 0.5);
+  box-shadow: 0 3px 9px rgba(0, 0, 0, 0.5);
   background-clip: padding-box;
 }
 
@@ -6113,9 +6328,10 @@ button.close {
     padding-top: 30px;
     padding-bottom: 30px;
   }
+
   .modal-content {
     -webkit-box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5);
-            box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5);
+    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5);
   }
 }
 
@@ -6248,7 +6464,7 @@ button.close {
   border: 1px solid rgba(0, 0, 0, 0.2);
   border-radius: 6px;
   -webkit-box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2);
-          box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2);
+  box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2);
   background-clip: padding-box;
 }
 
@@ -6384,7 +6600,7 @@ button.close {
   position: relative;
   display: none;
   -webkit-transition: 0.6s ease-in-out left;
-          transition: 0.6s ease-in-out left;
+  transition: 0.6s ease-in-out left;
 }
 
 .carousel-inner > .item > img,
@@ -6572,11 +6788,13 @@ button.close {
     margin-left: -15px;
     font-size: 30px;
   }
+
   .carousel-caption {
     right: 20%;
     left: 20%;
     padding-bottom: 30px;
   }
+
   .carousel-indicators {
     bottom: 20px;
   }
@@ -6650,9 +6868,11 @@ td.visible-xs {
   .visible-xs {
     display: block !important;
   }
+
   tr.visible-xs {
     display: table-row !important;
   }
+
   th.visible-xs,
   td.visible-xs {
     display: table-cell !important;
@@ -6663,9 +6883,11 @@ td.visible-xs {
   .visible-xs.visible-sm {
     display: block !important;
   }
+
   tr.visible-xs.visible-sm {
     display: table-row !important;
   }
+
   th.visible-xs.visible-sm,
   td.visible-xs.visible-sm {
     display: table-cell !important;
@@ -6676,9 +6898,11 @@ td.visible-xs {
   .visible-xs.visible-md {
     display: block !important;
   }
+
   tr.visible-xs.visible-md {
     display: table-row !important;
   }
+
   th.visible-xs.visible-md,
   td.visible-xs.visible-md {
     display: table-cell !important;
@@ -6689,9 +6913,11 @@ td.visible-xs {
   .visible-xs.visible-lg {
     display: block !important;
   }
+
   tr.visible-xs.visible-lg {
     display: table-row !important;
   }
+
   th.visible-xs.visible-lg,
   td.visible-xs.visible-lg {
     display: table-cell !important;
@@ -6709,9 +6935,11 @@ td.visible-sm {
   .visible-sm.visible-xs {
     display: block !important;
   }
+
   tr.visible-sm.visible-xs {
     display: table-row !important;
   }
+
   th.visible-sm.visible-xs,
   td.visible-sm.visible-xs {
     display: table-cell !important;
@@ -6722,9 +6950,11 @@ td.visible-sm {
   .visible-sm {
     display: block !important;
   }
+
   tr.visible-sm {
     display: table-row !important;
   }
+
   th.visible-sm,
   td.visible-sm {
     display: table-cell !important;
@@ -6735,9 +6965,11 @@ td.visible-sm {
   .visible-sm.visible-md {
     display: block !important;
   }
+
   tr.visible-sm.visible-md {
     display: table-row !important;
   }
+
   th.visible-sm.visible-md,
   td.visible-sm.visible-md {
     display: table-cell !important;
@@ -6748,9 +6980,11 @@ td.visible-sm {
   .visible-sm.visible-lg {
     display: block !important;
   }
+
   tr.visible-sm.visible-lg {
     display: table-row !important;
   }
+
   th.visible-sm.visible-lg,
   td.visible-sm.visible-lg {
     display: table-cell !important;
@@ -6768,9 +7002,11 @@ td.visible-md {
   .visible-md.visible-xs {
     display: block !important;
   }
+
   tr.visible-md.visible-xs {
     display: table-row !important;
   }
+
   th.visible-md.visible-xs,
   td.visible-md.visible-xs {
     display: table-cell !important;
@@ -6781,9 +7017,11 @@ td.visible-md {
   .visible-md.visible-sm {
     display: block !important;
   }
+
   tr.visible-md.visible-sm {
     display: table-row !important;
   }
+
   th.visible-md.visible-sm,
   td.visible-md.visible-sm {
     display: table-cell !important;
@@ -6794,9 +7032,11 @@ td.visible-md {
   .visible-md {
     display: block !important;
   }
+
   tr.visible-md {
     display: table-row !important;
   }
+
   th.visible-md,
   td.visible-md {
     display: table-cell !important;
@@ -6807,9 +7047,11 @@ td.visible-md {
   .visible-md.visible-lg {
     display: block !important;
   }
+
   tr.visible-md.visible-lg {
     display: table-row !important;
   }
+
   th.visible-md.visible-lg,
   td.visible-md.visible-lg {
     display: table-cell !important;
@@ -6827,9 +7069,11 @@ td.visible-lg {
   .visible-lg.visible-xs {
     display: block !important;
   }
+
   tr.visible-lg.visible-xs {
     display: table-row !important;
   }
+
   th.visible-lg.visible-xs,
   td.visible-lg.visible-xs {
     display: table-cell !important;
@@ -6840,9 +7084,11 @@ td.visible-lg {
   .visible-lg.visible-sm {
     display: block !important;
   }
+
   tr.visible-lg.visible-sm {
     display: table-row !important;
   }
+
   th.visible-lg.visible-sm,
   td.visible-lg.visible-sm {
     display: table-cell !important;
@@ -6853,9 +7099,11 @@ td.visible-lg {
   .visible-lg.visible-md {
     display: block !important;
   }
+
   tr.visible-lg.visible-md {
     display: table-row !important;
   }
+
   th.visible-lg.visible-md,
   td.visible-lg.visible-md {
     display: table-cell !important;
@@ -6866,9 +7114,11 @@ td.visible-lg {
   .visible-lg {
     display: block !important;
   }
+
   tr.visible-lg {
     display: table-row !important;
   }
+
   th.visible-lg,
   td.visible-lg {
     display: table-cell !important;
@@ -7082,13 +7332,16 @@ td.visible-print {
   .visible-print {
     display: block !important;
   }
+
   tr.visible-print {
     display: table-row !important;
   }
+
   th.visible-print,
   td.visible-print {
     display: table-cell !important;
   }
+
   .hidden-print,
   tr.hidden-print,
   th.hidden-print,
diff --git a/azkaban-web-server/src/web/css/bootstrap-datetimepicker.css b/azkaban-web-server/src/web/css/bootstrap-datetimepicker.css
index e5eb7a6..503e149 100644
--- a/azkaban-web-server/src/web/css/bootstrap-datetimepicker.css
+++ b/azkaban-web-server/src/web/css/bootstrap-datetimepicker.css
@@ -21,9 +21,11 @@
   border-top: 1px solid #ddd !important;
   }*/
 }
+
 .bootstrap-datetimepicker-widget .btn {
   padding: 6px;
 }
+
 .bootstrap-datetimepicker-widget:before {
   content: '';
   display: inline-block;
@@ -35,6 +37,7 @@
   top: -7px;
   left: 6px;
 }
+
 .bootstrap-datetimepicker-widget:after {
   content: '';
   display: inline-block;
@@ -45,18 +48,22 @@
   top: -6px;
   left: 7px;
 }
+
 .bootstrap-datetimepicker-widget.pull-right:before {
   left: auto;
   right: 6px;
 }
+
 .bootstrap-datetimepicker-widget.pull-right:after {
   left: auto;
   right: 7px;
 }
+
 .bootstrap-datetimepicker-widget > ul {
   list-style-type: none;
   margin: 0;
 }
+
 .bootstrap-datetimepicker-widget .timepicker-hour,
 .bootstrap-datetimepicker-widget .timepicker-minute,
 .bootstrap-datetimepicker-widget .timepicker-second {
@@ -64,21 +71,26 @@
   font-weight: bold;
   font-size: 1.2em;
 }
+
 .bootstrap-datetimepicker-widget table[data-hour-format="12"] .separator {
   width: 4px;
   padding: 0;
   margin: 0;
 }
+
 .bootstrap-datetimepicker-widget .datepicker > div {
   display: none;
 }
+
 .bootstrap-datetimepicker-widget .picker-switch {
   text-align: center;
 }
+
 .bootstrap-datetimepicker-widget table {
   width: 100%;
   margin: 0;
 }
+
 .bootstrap-datetimepicker-widget td,
 .bootstrap-datetimepicker-widget th {
   text-align: center;
@@ -86,6 +98,7 @@
   height: 20px;
   border-radius: 4px;
 }
+
 .bootstrap-datetimepicker-widget td.day:hover,
 .bootstrap-datetimepicker-widget td.hour:hover,
 .bootstrap-datetimepicker-widget td.minute:hover,
@@ -93,22 +106,26 @@
   background: #eeeeee;
   cursor: pointer;
 }
+
 .bootstrap-datetimepicker-widget td.old,
 .bootstrap-datetimepicker-widget td.new {
   color: #999999;
 }
+
 .bootstrap-datetimepicker-widget td.active,
 .bootstrap-datetimepicker-widget td.active:hover {
   background-color: #428bca;
   color: #fff;
   text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25);
 }
+
 .bootstrap-datetimepicker-widget td.disabled,
 .bootstrap-datetimepicker-widget td.disabled:hover {
   background: none;
   color: #999999;
   cursor: not-allowed;
 }
+
 .bootstrap-datetimepicker-widget td span {
   display: block;
   width: 47px;
@@ -119,56 +136,69 @@
   cursor: pointer;
   border-radius: 4px;
 }
+
 .bootstrap-datetimepicker-widget td span:hover {
   background: #eeeeee;
 }
+
 .bootstrap-datetimepicker-widget td span.active {
   background-color: #428bca;
   color: #fff;
   text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25);
 }
+
 .bootstrap-datetimepicker-widget td span.old {
   color: #999999;
 }
+
 .bootstrap-datetimepicker-widget td span.disabled,
 .bootstrap-datetimepicker-widget td span.disabled:hover {
   background: none;
   color: #999999;
   cursor: not-allowed;
 }
+
 .bootstrap-datetimepicker-widget th.switch {
   width: 145px;
 }
+
 .bootstrap-datetimepicker-widget th.next,
 .bootstrap-datetimepicker-widget th.prev {
   font-size: 21px;
 }
+
 .bootstrap-datetimepicker-widget th.disabled,
 .bootstrap-datetimepicker-widget th.disabled:hover {
   background: none;
   color: #999999;
   cursor: not-allowed;
 }
+
 .bootstrap-datetimepicker-widget thead tr:first-child th {
   cursor: pointer;
 }
+
 .bootstrap-datetimepicker-widget thead tr:first-child th:hover {
   background: #eeeeee;
 }
+
 .input-group.date .input-group-addon span {
   display: block;
   cursor: pointer;
   width: 16px;
   height: 16px;
 }
+
 .bootstrap-datetimepicker-widget.left-oriented:before {
   left: auto;
   right: 6px;
 }
+
 .bootstrap-datetimepicker-widget.left-oriented:after {
   left: auto;
   right: 7px;
 }
+
 .bootstrap-datetimepicker-widget ul.list-unstyled li.in div.timepicker div.timepicker-picker table.table-condensed tbody > tr > td {
   padding: 0px !important;
 }
diff --git a/azkaban-web-server/src/web/css/jquery.svg.css b/azkaban-web-server/src/web/css/jquery.svg.css
index 1ff48b1..e46dd95 100644
--- a/azkaban-web-server/src/web/css/jquery.svg.css
+++ b/azkaban-web-server/src/web/css/jquery.svg.css
@@ -1,15 +1,15 @@
 /* http://keith-wood.name/svg.html
    SVG for jQuery v1.4.5.
    Written by Keith Wood (kbwood{at}iinet.com.au) August 2007.
-   Dual licensed under the GPL (http://dev.jquery.com/browser/trunk/jquery/GPL-LICENSE.txt) and 
-   MIT (http://dev.jquery.com/browser/trunk/jquery/MIT-LICENSE.txt) licenses. 
+   Dual licensed under the GPL (http://dev.jquery.com/browser/trunk/jquery/GPL-LICENSE.txt) and
+   MIT (http://dev.jquery.com/browser/trunk/jquery/MIT-LICENSE.txt) licenses.
    Please attribute the author if you use it. */
 
 svg\:svg {
-	display: none;
+  display: none;
 }
 
 .svg_error {
-	color: red;
-	font-weight: bold;
+  color: red;
+  font-weight: bold;
 }
diff --git a/azkaban-web-server/src/web/css/jquery-ui.css b/azkaban-web-server/src/web/css/jquery-ui.css
index cdab8a4..1558c25 100644
--- a/azkaban-web-server/src/web/css/jquery-ui.css
+++ b/azkaban-web-server/src/web/css/jquery-ui.css
@@ -5,469 +5,1804 @@
 
 /* Layout helpers
 ----------------------------------*/
-.ui-helper-hidden { display: none; }
-.ui-helper-hidden-accessible { position: absolute !important; clip: rect(1px 1px 1px 1px); clip: rect(1px,1px,1px,1px); }
-.ui-helper-reset { margin: 0; padding: 0; border: 0; outline: 0; line-height: 1.3; text-decoration: none; font-size: 100%; list-style: none; }
-.ui-helper-clearfix:before, .ui-helper-clearfix:after { content: ""; display: table; }
-.ui-helper-clearfix:after { clear: both; }
-.ui-helper-clearfix { zoom: 1; }
-.ui-helper-zfix { width: 100%; height: 100%; top: 0; left: 0; position: absolute; opacity: 0; filter:Alpha(Opacity=0); }
+.ui-helper-hidden {
+  display: none;
+}
+
+.ui-helper-hidden-accessible {
+  position: absolute !important;
+  clip: rect(1px 1px 1px 1px);
+  clip: rect(1px, 1px, 1px, 1px);
+}
+
+.ui-helper-reset {
+  margin: 0;
+  padding: 0;
+  border: 0;
+  outline: 0;
+  line-height: 1.3;
+  text-decoration: none;
+  font-size: 100%;
+  list-style: none;
+}
+
+.ui-helper-clearfix:before, .ui-helper-clearfix:after {
+  content: "";
+  display: table;
+}
+
+.ui-helper-clearfix:after {
+  clear: both;
+}
+
+.ui-helper-clearfix {
+  zoom: 1;
+}
 
+.ui-helper-zfix {
+  width: 100%;
+  height: 100%;
+  top: 0;
+  left: 0;
+  position: absolute;
+  opacity: 0;
+  filter: Alpha(Opacity=0);
+}
 
 /* Interaction Cues
 ----------------------------------*/
-.ui-state-disabled { cursor: default !important; }
-
+.ui-state-disabled {
+  cursor: default !important;
+}
 
 /* Icons
 ----------------------------------*/
 
 /* states and images */
-.ui-icon { display: block; text-indent: -99999px; overflow: hidden; background-repeat: no-repeat; }
-
+.ui-icon {
+  display: block;
+  text-indent: -99999px;
+  overflow: hidden;
+  background-repeat: no-repeat;
+}
 
 /* Misc visuals
 ----------------------------------*/
 
 /* Overlays */
-.ui-widget-overlay { position: absolute; top: 0; left: 0; width: 100%; height: 100%; }
+.ui-widget-overlay {
+  position: absolute;
+  top: 0;
+  left: 0;
+  width: 100%;
+  height: 100%;
+}
+
+.ui-accordion .ui-accordion-header {
+  display: block;
+  cursor: pointer;
+  position: relative;
+  margin-top: 2px;
+  padding: .5em .5em .5em .7em;
+  zoom: 1;
+}
+
+.ui-accordion .ui-accordion-icons {
+  padding-left: 2.2em;
+}
+
+.ui-accordion .ui-accordion-noicons {
+  padding-left: .7em;
+}
+
+.ui-accordion .ui-accordion-icons .ui-accordion-icons {
+  padding-left: 2.2em;
+}
+
+.ui-accordion .ui-accordion-header .ui-accordion-header-icon {
+  position: absolute;
+  left: .5em;
+  top: 50%;
+  margin-top: -8px;
+}
 
-.ui-accordion .ui-accordion-header { display: block; cursor: pointer; position: relative; margin-top: 2px; padding: .5em .5em .5em .7em; zoom: 1; }
-.ui-accordion .ui-accordion-icons { padding-left: 2.2em; }
-.ui-accordion .ui-accordion-noicons { padding-left: .7em; }
-.ui-accordion .ui-accordion-icons .ui-accordion-icons { padding-left: 2.2em; }
-.ui-accordion .ui-accordion-header .ui-accordion-header-icon { position: absolute; left: .5em; top: 50%; margin-top: -8px; }
-.ui-accordion .ui-accordion-content { padding: 1em 2.2em; border-top: 0; overflow: auto; zoom: 1; }
+.ui-accordion .ui-accordion-content {
+  padding: 1em 2.2em;
+  border-top: 0;
+  overflow: auto;
+  zoom: 1;
+}
 
 .ui-autocomplete {
-	position: absolute;
-	top: 0; /* #8656 */
-	cursor: default;
+  position: absolute;
+  top: 0; /* #8656 */
+  cursor: default;
 }
 
 /* workarounds */
-* html .ui-autocomplete { width:1px; } /* without this, the menu expands to 100% in IE6 */
+* html .ui-autocomplete {
+  width: 1px;
+}
+
+/* without this, the menu expands to 100% in IE6 */
+
+.ui-button {
+  display: inline-block;
+  position: relative;
+  padding: 0;
+  margin-right: .1em;
+  cursor: pointer;
+  text-align: center;
+  zoom: 1;
+  overflow: visible;
+}
 
-.ui-button { display: inline-block; position: relative; padding: 0; margin-right: .1em; cursor: pointer; text-align: center; zoom: 1; overflow: visible; } /* the overflow property removes extra width in IE */
-.ui-button, .ui-button:link, .ui-button:visited, .ui-button:hover, .ui-button:active { text-decoration: none; }
-.ui-button-icon-only { width: 2.2em; } /* to make room for the icon, a width needs to be set here */
-button.ui-button-icon-only { width: 2.4em; } /* button elements seem to need a little more width */
-.ui-button-icons-only { width: 3.4em; } 
-button.ui-button-icons-only { width: 3.7em; } 
+/* the overflow property removes extra width in IE */
+.ui-button, .ui-button:link, .ui-button:visited, .ui-button:hover, .ui-button:active {
+  text-decoration: none;
+}
+
+.ui-button-icon-only {
+  width: 2.2em;
+}
+
+/* to make room for the icon, a width needs to be set here */
+button.ui-button-icon-only {
+  width: 2.4em;
+}
+
+/* button elements seem to need a little more width */
+.ui-button-icons-only {
+  width: 3.4em;
+}
+
+button.ui-button-icons-only {
+  width: 3.7em;
+}
 
 /*button text element */
-.ui-button .ui-button-text { display: block; line-height: 1.4;  }
-.ui-button-text-only .ui-button-text { padding: .4em 1em; }
-.ui-button-icon-only .ui-button-text, .ui-button-icons-only .ui-button-text { padding: .4em; text-indent: -9999999px; }
-.ui-button-text-icon-primary .ui-button-text, .ui-button-text-icons .ui-button-text { padding: .4em 1em .4em 2.1em; }
-.ui-button-text-icon-secondary .ui-button-text, .ui-button-text-icons .ui-button-text { padding: .4em 2.1em .4em 1em; }
-.ui-button-text-icons .ui-button-text { padding-left: 2.1em; padding-right: 2.1em; }
+.ui-button .ui-button-text {
+  display: block;
+  line-height: 1.4;
+}
+
+.ui-button-text-only .ui-button-text {
+  padding: .4em 1em;
+}
+
+.ui-button-icon-only .ui-button-text, .ui-button-icons-only .ui-button-text {
+  padding: .4em;
+  text-indent: -9999999px;
+}
+
+.ui-button-text-icon-primary .ui-button-text, .ui-button-text-icons .ui-button-text {
+  padding: .4em 1em .4em 2.1em;
+}
+
+.ui-button-text-icon-secondary .ui-button-text, .ui-button-text-icons .ui-button-text {
+  padding: .4em 2.1em .4em 1em;
+}
+
+.ui-button-text-icons .ui-button-text {
+  padding-left: 2.1em;
+  padding-right: 2.1em;
+}
+
 /* no icon support for input elements, provide padding by default */
-input.ui-button { padding: .4em 1em; }
+input.ui-button {
+  padding: .4em 1em;
+}
 
 /*button icon element(s) */
-.ui-button-icon-only .ui-icon, .ui-button-text-icon-primary .ui-icon, .ui-button-text-icon-secondary .ui-icon, .ui-button-text-icons .ui-icon, .ui-button-icons-only .ui-icon { position: absolute; top: 50%; margin-top: -8px; }
-.ui-button-icon-only .ui-icon { left: 50%; margin-left: -8px; }
-.ui-button-text-icon-primary .ui-button-icon-primary, .ui-button-text-icons .ui-button-icon-primary, .ui-button-icons-only .ui-button-icon-primary { left: .5em; }
-.ui-button-text-icon-secondary .ui-button-icon-secondary, .ui-button-text-icons .ui-button-icon-secondary, .ui-button-icons-only .ui-button-icon-secondary { right: .5em; }
-.ui-button-text-icons .ui-button-icon-secondary, .ui-button-icons-only .ui-button-icon-secondary { right: .5em; }
+.ui-button-icon-only .ui-icon, .ui-button-text-icon-primary .ui-icon, .ui-button-text-icon-secondary .ui-icon, .ui-button-text-icons .ui-icon, .ui-button-icons-only .ui-icon {
+  position: absolute;
+  top: 50%;
+  margin-top: -8px;
+}
+
+.ui-button-icon-only .ui-icon {
+  left: 50%;
+  margin-left: -8px;
+}
+
+.ui-button-text-icon-primary .ui-button-icon-primary, .ui-button-text-icons .ui-button-icon-primary, .ui-button-icons-only .ui-button-icon-primary {
+  left: .5em;
+}
+
+.ui-button-text-icon-secondary .ui-button-icon-secondary, .ui-button-text-icons .ui-button-icon-secondary, .ui-button-icons-only .ui-button-icon-secondary {
+  right: .5em;
+}
+
+.ui-button-text-icons .ui-button-icon-secondary, .ui-button-icons-only .ui-button-icon-secondary {
+  right: .5em;
+}
 
 /*button sets*/
-.ui-buttonset { margin-right: 7px; }
-.ui-buttonset .ui-button { margin-left: 0; margin-right: -.3em; }
+.ui-buttonset {
+  margin-right: 7px;
+}
+
+.ui-buttonset .ui-button {
+  margin-left: 0;
+  margin-right: -.3em;
+}
 
 /* workarounds */
-button.ui-button::-moz-focus-inner { border: 0; padding: 0; } /* reset extra padding in Firefox */
-
-.ui-datepicker { width: 17em; padding: .2em .2em 0; display: none; }
-.ui-datepicker .ui-datepicker-header { position:relative; padding:.2em 0; }
-.ui-datepicker .ui-datepicker-prev, .ui-datepicker .ui-datepicker-next { position:absolute; top: 2px; width: 1.8em; height: 1.8em; }
-.ui-datepicker .ui-datepicker-prev-hover, .ui-datepicker .ui-datepicker-next-hover { top: 1px; }
-.ui-datepicker .ui-datepicker-prev { left:2px; }
-.ui-datepicker .ui-datepicker-next { right:2px; }
-.ui-datepicker .ui-datepicker-prev-hover { left:1px; }
-.ui-datepicker .ui-datepicker-next-hover { right:1px; }
-.ui-datepicker .ui-datepicker-prev span, .ui-datepicker .ui-datepicker-next span { display: block; position: absolute; left: 50%; margin-left: -8px; top: 50%; margin-top: -8px;  }
-.ui-datepicker .ui-datepicker-title { margin: 0 2.3em; line-height: 1.8em; text-align: center; }
-.ui-datepicker .ui-datepicker-title select { font-size:1em; margin:1px 0; }
-.ui-datepicker select.ui-datepicker-month-year {width: 100%;}
-.ui-datepicker select.ui-datepicker-month, 
-.ui-datepicker select.ui-datepicker-year { width: 49%;}
-.ui-datepicker table {width: 100%; font-size: .9em; border-collapse: collapse; margin:0 0 .4em; }
-.ui-datepicker th { padding: .7em .3em; text-align: center; font-weight: bold; border: 0;  }
-.ui-datepicker td { border: 0; padding: 1px; }
-.ui-datepicker td span, .ui-datepicker td a { display: block; padding: .2em; text-align: right; text-decoration: none; }
-.ui-datepicker .ui-datepicker-buttonpane { background-image: none; margin: .7em 0 0 0; padding:0 .2em; border-left: 0; border-right: 0; border-bottom: 0; }
-.ui-datepicker .ui-datepicker-buttonpane button { float: right; margin: .5em .2em .4em; cursor: pointer; padding: .2em .6em .3em .6em; width:auto; overflow:visible; }
-.ui-datepicker .ui-datepicker-buttonpane button.ui-datepicker-current { float:left; }
+button.ui-button::-moz-focus-inner {
+  border: 0;
+  padding: 0;
+}
+
+/* reset extra padding in Firefox */
+
+.ui-datepicker {
+  width: 17em;
+  padding: .2em .2em 0;
+  display: none;
+}
+
+.ui-datepicker .ui-datepicker-header {
+  position: relative;
+  padding: .2em 0;
+}
+
+.ui-datepicker .ui-datepicker-prev, .ui-datepicker .ui-datepicker-next {
+  position: absolute;
+  top: 2px;
+  width: 1.8em;
+  height: 1.8em;
+}
+
+.ui-datepicker .ui-datepicker-prev-hover, .ui-datepicker .ui-datepicker-next-hover {
+  top: 1px;
+}
+
+.ui-datepicker .ui-datepicker-prev {
+  left: 2px;
+}
+
+.ui-datepicker .ui-datepicker-next {
+  right: 2px;
+}
+
+.ui-datepicker .ui-datepicker-prev-hover {
+  left: 1px;
+}
+
+.ui-datepicker .ui-datepicker-next-hover {
+  right: 1px;
+}
+
+.ui-datepicker .ui-datepicker-prev span, .ui-datepicker .ui-datepicker-next span {
+  display: block;
+  position: absolute;
+  left: 50%;
+  margin-left: -8px;
+  top: 50%;
+  margin-top: -8px;
+}
+
+.ui-datepicker .ui-datepicker-title {
+  margin: 0 2.3em;
+  line-height: 1.8em;
+  text-align: center;
+}
+
+.ui-datepicker .ui-datepicker-title select {
+  font-size: 1em;
+  margin: 1px 0;
+}
+
+.ui-datepicker select.ui-datepicker-month-year {
+  width: 100%;
+}
+
+.ui-datepicker select.ui-datepicker-month,
+.ui-datepicker select.ui-datepicker-year {
+  width: 49%;
+}
+
+.ui-datepicker table {
+  width: 100%;
+  font-size: .9em;
+  border-collapse: collapse;
+  margin: 0 0 .4em;
+}
+
+.ui-datepicker th {
+  padding: .7em .3em;
+  text-align: center;
+  font-weight: bold;
+  border: 0;
+}
+
+.ui-datepicker td {
+  border: 0;
+  padding: 1px;
+}
+
+.ui-datepicker td span, .ui-datepicker td a {
+  display: block;
+  padding: .2em;
+  text-align: right;
+  text-decoration: none;
+}
+
+.ui-datepicker .ui-datepicker-buttonpane {
+  background-image: none;
+  margin: .7em 0 0 0;
+  padding: 0 .2em;
+  border-left: 0;
+  border-right: 0;
+  border-bottom: 0;
+}
+
+.ui-datepicker .ui-datepicker-buttonpane button {
+  float: right;
+  margin: .5em .2em .4em;
+  cursor: pointer;
+  padding: .2em .6em .3em .6em;
+  width: auto;
+  overflow: visible;
+}
+
+.ui-datepicker .ui-datepicker-buttonpane button.ui-datepicker-current {
+  float: left;
+}
 
 /* with multiple calendars */
-.ui-datepicker.ui-datepicker-multi { width:auto; }
-.ui-datepicker-multi .ui-datepicker-group { float:left; }
-.ui-datepicker-multi .ui-datepicker-group table { width:95%; margin:0 auto .4em; }
-.ui-datepicker-multi-2 .ui-datepicker-group { width:50%; }
-.ui-datepicker-multi-3 .ui-datepicker-group { width:33.3%; }
-.ui-datepicker-multi-4 .ui-datepicker-group { width:25%; }
-.ui-datepicker-multi .ui-datepicker-group-last .ui-datepicker-header { border-left-width:0; }
-.ui-datepicker-multi .ui-datepicker-group-middle .ui-datepicker-header { border-left-width:0; }
-.ui-datepicker-multi .ui-datepicker-buttonpane { clear:left; }
-.ui-datepicker-row-break { clear:both; width:100%; font-size:0em; }
+.ui-datepicker.ui-datepicker-multi {
+  width: auto;
+}
+
+.ui-datepicker-multi .ui-datepicker-group {
+  float: left;
+}
+
+.ui-datepicker-multi .ui-datepicker-group table {
+  width: 95%;
+  margin: 0 auto .4em;
+}
+
+.ui-datepicker-multi-2 .ui-datepicker-group {
+  width: 50%;
+}
+
+.ui-datepicker-multi-3 .ui-datepicker-group {
+  width: 33.3%;
+}
+
+.ui-datepicker-multi-4 .ui-datepicker-group {
+  width: 25%;
+}
+
+.ui-datepicker-multi .ui-datepicker-group-last .ui-datepicker-header {
+  border-left-width: 0;
+}
+
+.ui-datepicker-multi .ui-datepicker-group-middle .ui-datepicker-header {
+  border-left-width: 0;
+}
+
+.ui-datepicker-multi .ui-datepicker-buttonpane {
+  clear: left;
+}
+
+.ui-datepicker-row-break {
+  clear: both;
+  width: 100%;
+  font-size: 0em;
+}
 
 /* RTL support */
-.ui-datepicker-rtl { direction: rtl; }
-.ui-datepicker-rtl .ui-datepicker-prev { right: 2px; left: auto; }
-.ui-datepicker-rtl .ui-datepicker-next { left: 2px; right: auto; }
-.ui-datepicker-rtl .ui-datepicker-prev:hover { right: 1px; left: auto; }
-.ui-datepicker-rtl .ui-datepicker-next:hover { left: 1px; right: auto; }
-.ui-datepicker-rtl .ui-datepicker-buttonpane { clear:right; }
-.ui-datepicker-rtl .ui-datepicker-buttonpane button { float: left; }
-.ui-datepicker-rtl .ui-datepicker-buttonpane button.ui-datepicker-current { float:right; }
-.ui-datepicker-rtl .ui-datepicker-group { float:right; }
-.ui-datepicker-rtl .ui-datepicker-group-last .ui-datepicker-header { border-right-width:0; border-left-width:1px; }
-.ui-datepicker-rtl .ui-datepicker-group-middle .ui-datepicker-header { border-right-width:0; border-left-width:1px; }
+.ui-datepicker-rtl {
+  direction: rtl;
+}
+
+.ui-datepicker-rtl .ui-datepicker-prev {
+  right: 2px;
+  left: auto;
+}
+
+.ui-datepicker-rtl .ui-datepicker-next {
+  left: 2px;
+  right: auto;
+}
+
+.ui-datepicker-rtl .ui-datepicker-prev:hover {
+  right: 1px;
+  left: auto;
+}
+
+.ui-datepicker-rtl .ui-datepicker-next:hover {
+  left: 1px;
+  right: auto;
+}
+
+.ui-datepicker-rtl .ui-datepicker-buttonpane {
+  clear: right;
+}
+
+.ui-datepicker-rtl .ui-datepicker-buttonpane button {
+  float: left;
+}
+
+.ui-datepicker-rtl .ui-datepicker-buttonpane button.ui-datepicker-current {
+  float: right;
+}
+
+.ui-datepicker-rtl .ui-datepicker-group {
+  float: right;
+}
+
+.ui-datepicker-rtl .ui-datepicker-group-last .ui-datepicker-header {
+  border-right-width: 0;
+  border-left-width: 1px;
+}
+
+.ui-datepicker-rtl .ui-datepicker-group-middle .ui-datepicker-header {
+  border-right-width: 0;
+  border-left-width: 1px;
+}
 
 /* IE6 IFRAME FIX (taken from datepicker 1.5.3 */
 .ui-datepicker-cover {
-    position: absolute; /*must have*/
-    z-index: -1; /*must have*/
-    filter: mask(); /*must have*/
-    top: -4px; /*must have*/
-    left: -4px; /*must have*/
-    width: 200px; /*must have*/
-    height: 200px; /*must have*/
-}
-.ui-dialog { position: absolute; padding: .2em; width: 300px; overflow: hidden; }
-.ui-dialog .ui-dialog-titlebar { padding: .4em 1em; position: relative;  }
-.ui-dialog .ui-dialog-title { float: left; margin: .1em 16px .1em 0; }
-.ui-dialog .ui-dialog-titlebar-close { position: absolute; right: .3em; top: 50%; width: 19px; margin: -10px 0 0 0; padding: 1px; height: 18px; }
-.ui-dialog .ui-dialog-titlebar-close span { display: block; margin: 1px; }
-.ui-dialog .ui-dialog-titlebar-close:hover, .ui-dialog .ui-dialog-titlebar-close:focus { padding: 0; }
-.ui-dialog .ui-dialog-content { position: relative; border: 0; padding: .5em 1em; background: none; overflow: auto; zoom: 1; }
-.ui-dialog .ui-dialog-buttonpane { text-align: left; border-width: 1px 0 0 0; background-image: none; margin: .5em 0 0 0; padding: .3em 1em .5em .4em; }
-.ui-dialog .ui-dialog-buttonpane .ui-dialog-buttonset { float: right; }
-.ui-dialog .ui-dialog-buttonpane button { margin: .5em .4em .5em 0; cursor: pointer; }
-.ui-dialog .ui-resizable-se { width: 14px; height: 14px; right: 3px; bottom: 3px; }
-.ui-draggable .ui-dialog-titlebar { cursor: move; }
-
-.ui-menu { list-style:none; padding: 2px; margin: 0; display:block; outline: none; }
-.ui-menu .ui-menu { margin-top: -3px; position: absolute; }
-.ui-menu .ui-menu-item { margin: 0; padding: 0; zoom: 1; width: 100%; }
-.ui-menu .ui-menu-divider { margin: 5px -2px 5px -2px; height: 0; font-size: 0; line-height: 0; border-width: 1px 0 0 0; }
-.ui-menu .ui-menu-item a { text-decoration: none; display: block; padding: 2px .4em; line-height: 1.5; zoom: 1; font-weight: normal; }
+  position: absolute; /*must have*/
+  z-index: -1; /*must have*/
+  filter: mask(); /*must have*/
+  top: -4px; /*must have*/
+  left: -4px; /*must have*/
+  width: 200px; /*must have*/
+  height: 200px; /*must have*/
+}
+
+.ui-dialog {
+  position: absolute;
+  padding: .2em;
+  width: 300px;
+  overflow: hidden;
+}
+
+.ui-dialog .ui-dialog-titlebar {
+  padding: .4em 1em;
+  position: relative;
+}
+
+.ui-dialog .ui-dialog-title {
+  float: left;
+  margin: .1em 16px .1em 0;
+}
+
+.ui-dialog .ui-dialog-titlebar-close {
+  position: absolute;
+  right: .3em;
+  top: 50%;
+  width: 19px;
+  margin: -10px 0 0 0;
+  padding: 1px;
+  height: 18px;
+}
+
+.ui-dialog .ui-dialog-titlebar-close span {
+  display: block;
+  margin: 1px;
+}
+
+.ui-dialog .ui-dialog-titlebar-close:hover, .ui-dialog .ui-dialog-titlebar-close:focus {
+  padding: 0;
+}
+
+.ui-dialog .ui-dialog-content {
+  position: relative;
+  border: 0;
+  padding: .5em 1em;
+  background: none;
+  overflow: auto;
+  zoom: 1;
+}
+
+.ui-dialog .ui-dialog-buttonpane {
+  text-align: left;
+  border-width: 1px 0 0 0;
+  background-image: none;
+  margin: .5em 0 0 0;
+  padding: .3em 1em .5em .4em;
+}
+
+.ui-dialog .ui-dialog-buttonpane .ui-dialog-buttonset {
+  float: right;
+}
+
+.ui-dialog .ui-dialog-buttonpane button {
+  margin: .5em .4em .5em 0;
+  cursor: pointer;
+}
+
+.ui-dialog .ui-resizable-se {
+  width: 14px;
+  height: 14px;
+  right: 3px;
+  bottom: 3px;
+}
+
+.ui-draggable .ui-dialog-titlebar {
+  cursor: move;
+}
+
+.ui-menu {
+  list-style: none;
+  padding: 2px;
+  margin: 0;
+  display: block;
+  outline: none;
+}
+
+.ui-menu .ui-menu {
+  margin-top: -3px;
+  position: absolute;
+}
+
+.ui-menu .ui-menu-item {
+  margin: 0;
+  padding: 0;
+  zoom: 1;
+  width: 100%;
+}
+
+.ui-menu .ui-menu-divider {
+  margin: 5px -2px 5px -2px;
+  height: 0;
+  font-size: 0;
+  line-height: 0;
+  border-width: 1px 0 0 0;
+}
+
+.ui-menu .ui-menu-item a {
+  text-decoration: none;
+  display: block;
+  padding: 2px .4em;
+  line-height: 1.5;
+  zoom: 1;
+  font-weight: normal;
+}
+
 .ui-menu .ui-menu-item a.ui-state-focus,
-.ui-menu .ui-menu-item a.ui-state-active { font-weight: normal; margin: -1px; }
+.ui-menu .ui-menu-item a.ui-state-active {
+  font-weight: normal;
+  margin: -1px;
+}
+
+.ui-menu .ui-state-disabled {
+  font-weight: normal;
+  margin: .4em 0 .2em;
+  line-height: 1.5;
+}
 
-.ui-menu .ui-state-disabled { font-weight: normal; margin: .4em 0 .2em; line-height: 1.5; }
-.ui-menu .ui-state-disabled a { cursor: default; }
+.ui-menu .ui-state-disabled a {
+  cursor: default;
+}
 
 /* icon support */
-.ui-menu-icons { position: relative; }
-.ui-menu-icons .ui-menu-item a { position: relative; padding-left: 2em; }
+.ui-menu-icons {
+  position: relative;
+}
+
+.ui-menu-icons .ui-menu-item a {
+  position: relative;
+  padding-left: 2em;
+}
 
 /* left-aligned */
-.ui-menu .ui-icon { position: absolute; top: .2em; left: .2em; }
+.ui-menu .ui-icon {
+  position: absolute;
+  top: .2em;
+  left: .2em;
+}
 
 /* right-aligned */
-.ui-menu .ui-menu-icon { position: static; float: right; }
-
-.ui-progressbar { height:2em; text-align: left; overflow: hidden; }
-.ui-progressbar .ui-progressbar-value {margin: -1px; height:100%; }
-.ui-resizable { position: relative;}
-.ui-resizable-handle { position: absolute;font-size: 0.1px; display: block; }
-.ui-resizable-disabled .ui-resizable-handle, .ui-resizable-autohide .ui-resizable-handle { display: none; }
-.ui-resizable-n { cursor: n-resize; height: 7px; width: 100%; top: -5px; left: 0; }
-.ui-resizable-s { cursor: s-resize; height: 7px; width: 100%; bottom: -5px; left: 0; }
-.ui-resizable-e { cursor: e-resize; width: 7px; right: -5px; top: 0; height: 100%; }
-.ui-resizable-w { cursor: w-resize; width: 7px; left: -5px; top: 0; height: 100%; }
-.ui-resizable-se { cursor: se-resize; width: 12px; height: 12px; right: 1px; bottom: 1px; }
-.ui-resizable-sw { cursor: sw-resize; width: 9px; height: 9px; left: -5px; bottom: -5px; }
-.ui-resizable-nw { cursor: nw-resize; width: 9px; height: 9px; left: -5px; top: -5px; }
-.ui-resizable-ne { cursor: ne-resize; width: 9px; height: 9px; right: -5px; top: -5px;}
-.ui-selectable-helper { position: absolute; z-index: 100; border:1px dotted black; }
-
-.ui-slider { position: relative; text-align: left; }
-.ui-slider .ui-slider-handle { position: absolute; z-index: 2; width: 1.2em; height: 1.2em; cursor: default; }
-.ui-slider .ui-slider-range { position: absolute; z-index: 1; font-size: .7em; display: block; border: 0; background-position: 0 0; }
-
-.ui-slider-horizontal { height: .8em; }
-.ui-slider-horizontal .ui-slider-handle { top: -.3em; margin-left: -.6em; }
-.ui-slider-horizontal .ui-slider-range { top: 0; height: 100%; }
-.ui-slider-horizontal .ui-slider-range-min { left: 0; }
-.ui-slider-horizontal .ui-slider-range-max { right: 0; }
-
-.ui-slider-vertical { width: .8em; height: 100px; }
-.ui-slider-vertical .ui-slider-handle { left: -.3em; margin-left: 0; margin-bottom: -.6em; }
-.ui-slider-vertical .ui-slider-range { left: 0; width: 100%; }
-.ui-slider-vertical .ui-slider-range-min { bottom: 0; }
-.ui-slider-vertical .ui-slider-range-max { top: 0; }
-.ui-spinner { position:relative; display: inline-block; overflow: hidden; padding: 0; vertical-align: middle; }
-.ui-spinner-input { border: none; background: none; padding: 0; margin: .2em 0; vertical-align: middle; margin-left: .4em; margin-right: 22px; }
-.ui-spinner-button { width: 16px; height: 50%; font-size: .5em; padding: 0; margin: 0; text-align: center; position: absolute; cursor: default; display: block; overflow: hidden; right: 0; }
-.ui-spinner a.ui-spinner-button { border-top: none; border-bottom: none; border-right: none; } /* more specificity required here to overide default borders */
-.ui-spinner .ui-icon { position: absolute; margin-top: -8px; top: 50%; left: 0; } /* vertical centre icon */
-.ui-spinner-up { top: 0; }
-.ui-spinner-down { bottom: 0; }
+.ui-menu .ui-menu-icon {
+  position: static;
+  float: right;
+}
 
-/* TR overrides */
-.ui-spinner .ui-icon-triangle-1-s {
-	/* need to fix icons sprite */
-	background-position:-65px -16px;
+.ui-progressbar {
+  height: 2em;
+  text-align: left;
+  overflow: hidden;
 }
 
-.ui-tabs { position: relative; padding: .2em; zoom: 1; } /* position: relative prevents IE scroll bug (element with position: relative inside container with overflow: auto appear as "fixed") */
-.ui-tabs .ui-tabs-nav { margin: 0; padding: .2em .2em 0; }
-.ui-tabs .ui-tabs-nav li { list-style: none; float: left; position: relative; top: 0; margin: 1px .2em 0 0; border-bottom: 0; padding: 0; white-space: nowrap; }
-.ui-tabs .ui-tabs-nav li a { float: left; padding: .5em 1em; text-decoration: none; }
-.ui-tabs .ui-tabs-nav li.ui-tabs-active { margin-bottom: -1px; padding-bottom: 1px; }
-.ui-tabs .ui-tabs-nav li.ui-tabs-active a, .ui-tabs .ui-tabs-nav li.ui-state-disabled a, .ui-tabs .ui-tabs-nav li.ui-tabs-loading a { cursor: text; }
-.ui-tabs .ui-tabs-nav li a, .ui-tabs-collapsible .ui-tabs-nav li.ui-tabs-active a { cursor: pointer; } /* first selector in group seems obsolete, but required to overcome bug in Opera applying cursor: text overall if defined elsewhere... */
-.ui-tabs .ui-tabs-panel { display: block; border-width: 0; padding: 1em 1.4em; background: none; }
+.ui-progressbar .ui-progressbar-value {
+  margin: -1px;
+  height: 100%;
+}
 
-.ui-tooltip {
-	padding: 8px;
-	position: absolute;
-	z-index: 9999;
-	max-width: 300px;
-	-webkit-box-shadow: 0 0 5px #aaa;
-	box-shadow: 0 0 5px #aaa;
+.ui-resizable {
+  position: relative;
 }
-/* Fades and background-images don't work well together in IE6, drop the image */
-* html .ui-tooltip {
-	background-image: none;
+
+.ui-resizable-handle {
+  position: absolute;
+  font-size: 0.1px;
+  display: block;
 }
-body .ui-tooltip { border-width: 2px; }
 
-/* Component containers
-----------------------------------*/
-.ui-widget { font-family: Verdana,Arial,sans-serif; font-size: 1.1em; }
-.ui-widget .ui-widget { font-size: 1em; }
-.ui-widget input, .ui-widget select, .ui-widget textarea, .ui-widget button { font-family: Verdana,Arial,sans-serif; font-size: 1em; }
-.ui-widget-content { border: 1px solid #aaaaaa; background: #ffffff url(images/ui-bg_flat_75_ffffff_40x100.png) 50% 50% repeat-x; color: #222222; }
-.ui-widget-content a { color: #222222; }
-.ui-widget-header { border: 1px solid #aaaaaa; background: #cccccc url(images/ui-bg_highlight-soft_75_cccccc_1x100.png) 50% 50% repeat-x; color: #222222; font-weight: bold; }
-.ui-widget-header a { color: #222222; }
+.ui-resizable-disabled .ui-resizable-handle, .ui-resizable-autohide .ui-resizable-handle {
+  display: none;
+}
 
-/* Interaction states
-----------------------------------*/
-.ui-state-default, .ui-widget-content .ui-state-default, .ui-widget-header .ui-state-default { border: 1px solid #d3d3d3; background: #e6e6e6 url(images/ui-bg_glass_75_e6e6e6_1x400.png) 50% 50% repeat-x; font-weight: normal; color: #555555; }
-.ui-state-default a, .ui-state-default a:link, .ui-state-default a:visited { color: #555555; text-decoration: none; }
-.ui-state-hover, .ui-widget-content .ui-state-hover, .ui-widget-header .ui-state-hover, .ui-state-focus, .ui-widget-content .ui-state-focus, .ui-widget-header .ui-state-focus { border: 1px solid #999999; background: #dadada url(images/ui-bg_glass_75_dadada_1x400.png) 50% 50% repeat-x; font-weight: normal; color: #212121; }
-.ui-state-hover a, .ui-state-hover a:hover, .ui-state-hover a:link, .ui-state-hover a:visited { color: #212121; text-decoration: none; }
-.ui-state-active, .ui-widget-content .ui-state-active, .ui-widget-header .ui-state-active { border: 1px solid #aaaaaa; background: #ffffff url(images/ui-bg_glass_65_ffffff_1x400.png) 50% 50% repeat-x; font-weight: normal; color: #212121; }
-.ui-state-active a, .ui-state-active a:link, .ui-state-active a:visited { color: #212121; text-decoration: none; }
+.ui-resizable-n {
+  cursor: n-resize;
+  height: 7px;
+  width: 100%;
+  top: -5px;
+  left: 0;
+}
 
-/* Interaction Cues
-----------------------------------*/
-.ui-state-highlight, .ui-widget-content .ui-state-highlight, .ui-widget-header .ui-state-highlight  {border: 1px solid #fcefa1; background: #fbf9ee url(images/ui-bg_glass_55_fbf9ee_1x400.png) 50% 50% repeat-x; color: #363636; }
-.ui-state-highlight a, .ui-widget-content .ui-state-highlight a,.ui-widget-header .ui-state-highlight a { color: #363636; }
-.ui-state-error, .ui-widget-content .ui-state-error, .ui-widget-header .ui-state-error {border: 1px solid #cd0a0a; background: #fef1ec url(images/ui-bg_glass_95_fef1ec_1x400.png) 50% 50% repeat-x; color: #cd0a0a; }
-.ui-state-error a, .ui-widget-content .ui-state-error a, .ui-widget-header .ui-state-error a { color: #cd0a0a; }
-.ui-state-error-text, .ui-widget-content .ui-state-error-text, .ui-widget-header .ui-state-error-text { color: #cd0a0a; }
-.ui-priority-primary, .ui-widget-content .ui-priority-primary, .ui-widget-header .ui-priority-primary { font-weight: bold; }
-.ui-priority-secondary, .ui-widget-content .ui-priority-secondary,  .ui-widget-header .ui-priority-secondary { opacity: .7; filter:Alpha(Opacity=70); font-weight: normal; }
-.ui-state-disabled, .ui-widget-content .ui-state-disabled, .ui-widget-header .ui-state-disabled { opacity: .35; filter:Alpha(Opacity=35); background-image: none; }
-.ui-state-disabled .ui-icon { filter:Alpha(Opacity=35); } /* For IE8 - See #6059 */
+.ui-resizable-s {
+  cursor: s-resize;
+  height: 7px;
+  width: 100%;
+  bottom: -5px;
+  left: 0;
+}
 
-/* Icons
-----------------------------------*/
+.ui-resizable-e {
+  cursor: e-resize;
+  width: 7px;
+  right: -5px;
+  top: 0;
+  height: 100%;
+}
 
-/* states and images */
-.ui-icon { width: 16px; height: 16px; background-image: url(images/ui-icons_222222_256x240.png); }
-.ui-widget-content .ui-icon {background-image: url(images/ui-icons_222222_256x240.png); }
-.ui-widget-header .ui-icon {background-image: url(images/ui-icons_222222_256x240.png); }
-.ui-state-default .ui-icon { background-image: url(images/ui-icons_888888_256x240.png); }
-.ui-state-hover .ui-icon, .ui-state-focus .ui-icon {background-image: url(images/ui-icons_454545_256x240.png); }
-.ui-state-active .ui-icon {background-image: url(images/ui-icons_454545_256x240.png); }
-.ui-state-highlight .ui-icon {background-image: url(images/ui-icons_2e83ff_256x240.png); }
-.ui-state-error .ui-icon, .ui-state-error-text .ui-icon {background-image: url(images/ui-icons_cd0a0a_256x240.png); }
+.ui-resizable-w {
+  cursor: w-resize;
+  width: 7px;
+  left: -5px;
+  top: 0;
+  height: 100%;
+}
 
-/* positioning */
-.ui-icon-carat-1-n { background-position: 0 0; }
-.ui-icon-carat-1-ne { background-position: -16px 0; }
-.ui-icon-carat-1-e { background-position: -32px 0; }
-.ui-icon-carat-1-se { background-position: -48px 0; }
-.ui-icon-carat-1-s { background-position: -64px 0; }
-.ui-icon-carat-1-sw { background-position: -80px 0; }
-.ui-icon-carat-1-w { background-position: -96px 0; }
-.ui-icon-carat-1-nw { background-position: -112px 0; }
-.ui-icon-carat-2-n-s { background-position: -128px 0; }
-.ui-icon-carat-2-e-w { background-position: -144px 0; }
-.ui-icon-triangle-1-n { background-position: 0 -16px; }
-.ui-icon-triangle-1-ne { background-position: -16px -16px; }
-.ui-icon-triangle-1-e { background-position: -32px -16px; }
-.ui-icon-triangle-1-se { background-position: -48px -16px; }
-.ui-icon-triangle-1-s { background-position: -64px -16px; }
-.ui-icon-triangle-1-sw { background-position: -80px -16px; }
-.ui-icon-triangle-1-w { background-position: -96px -16px; }
-.ui-icon-triangle-1-nw { background-position: -112px -16px; }
-.ui-icon-triangle-2-n-s { background-position: -128px -16px; }
-.ui-icon-triangle-2-e-w { background-position: -144px -16px; }
-.ui-icon-arrow-1-n { background-position: 0 -32px; }
-.ui-icon-arrow-1-ne { background-position: -16px -32px; }
-.ui-icon-arrow-1-e { background-position: -32px -32px; }
-.ui-icon-arrow-1-se { background-position: -48px -32px; }
-.ui-icon-arrow-1-s { background-position: -64px -32px; }
-.ui-icon-arrow-1-sw { background-position: -80px -32px; }
-.ui-icon-arrow-1-w { background-position: -96px -32px; }
-.ui-icon-arrow-1-nw { background-position: -112px -32px; }
-.ui-icon-arrow-2-n-s { background-position: -128px -32px; }
-.ui-icon-arrow-2-ne-sw { background-position: -144px -32px; }
-.ui-icon-arrow-2-e-w { background-position: -160px -32px; }
-.ui-icon-arrow-2-se-nw { background-position: -176px -32px; }
-.ui-icon-arrowstop-1-n { background-position: -192px -32px; }
-.ui-icon-arrowstop-1-e { background-position: -208px -32px; }
-.ui-icon-arrowstop-1-s { background-position: -224px -32px; }
-.ui-icon-arrowstop-1-w { background-position: -240px -32px; }
-.ui-icon-arrowthick-1-n { background-position: 0 -48px; }
-.ui-icon-arrowthick-1-ne { background-position: -16px -48px; }
-.ui-icon-arrowthick-1-e { background-position: -32px -48px; }
-.ui-icon-arrowthick-1-se { background-position: -48px -48px; }
-.ui-icon-arrowthick-1-s { background-position: -64px -48px; }
-.ui-icon-arrowthick-1-sw { background-position: -80px -48px; }
-.ui-icon-arrowthick-1-w { background-position: -96px -48px; }
-.ui-icon-arrowthick-1-nw { background-position: -112px -48px; }
-.ui-icon-arrowthick-2-n-s { background-position: -128px -48px; }
-.ui-icon-arrowthick-2-ne-sw { background-position: -144px -48px; }
-.ui-icon-arrowthick-2-e-w { background-position: -160px -48px; }
-.ui-icon-arrowthick-2-se-nw { background-position: -176px -48px; }
-.ui-icon-arrowthickstop-1-n { background-position: -192px -48px; }
-.ui-icon-arrowthickstop-1-e { background-position: -208px -48px; }
-.ui-icon-arrowthickstop-1-s { background-position: -224px -48px; }
-.ui-icon-arrowthickstop-1-w { background-position: -240px -48px; }
-.ui-icon-arrowreturnthick-1-w { background-position: 0 -64px; }
-.ui-icon-arrowreturnthick-1-n { background-position: -16px -64px; }
-.ui-icon-arrowreturnthick-1-e { background-position: -32px -64px; }
-.ui-icon-arrowreturnthick-1-s { background-position: -48px -64px; }
-.ui-icon-arrowreturn-1-w { background-position: -64px -64px; }
-.ui-icon-arrowreturn-1-n { background-position: -80px -64px; }
-.ui-icon-arrowreturn-1-e { background-position: -96px -64px; }
-.ui-icon-arrowreturn-1-s { background-position: -112px -64px; }
-.ui-icon-arrowrefresh-1-w { background-position: -128px -64px; }
-.ui-icon-arrowrefresh-1-n { background-position: -144px -64px; }
-.ui-icon-arrowrefresh-1-e { background-position: -160px -64px; }
-.ui-icon-arrowrefresh-1-s { background-position: -176px -64px; }
-.ui-icon-arrow-4 { background-position: 0 -80px; }
-.ui-icon-arrow-4-diag { background-position: -16px -80px; }
-.ui-icon-extlink { background-position: -32px -80px; }
-.ui-icon-newwin { background-position: -48px -80px; }
-.ui-icon-refresh { background-position: -64px -80px; }
-.ui-icon-shuffle { background-position: -80px -80px; }
-.ui-icon-transfer-e-w { background-position: -96px -80px; }
-.ui-icon-transferthick-e-w { background-position: -112px -80px; }
-.ui-icon-folder-collapsed { background-position: 0 -96px; }
-.ui-icon-folder-open { background-position: -16px -96px; }
-.ui-icon-document { background-position: -32px -96px; }
-.ui-icon-document-b { background-position: -48px -96px; }
-.ui-icon-note { background-position: -64px -96px; }
-.ui-icon-mail-closed { background-position: -80px -96px; }
-.ui-icon-mail-open { background-position: -96px -96px; }
-.ui-icon-suitcase { background-position: -112px -96px; }
-.ui-icon-comment { background-position: -128px -96px; }
-.ui-icon-person { background-position: -144px -96px; }
-.ui-icon-print { background-position: -160px -96px; }
-.ui-icon-trash { background-position: -176px -96px; }
-.ui-icon-locked { background-position: -192px -96px; }
-.ui-icon-unlocked { background-position: -208px -96px; }
-.ui-icon-bookmark { background-position: -224px -96px; }
-.ui-icon-tag { background-position: -240px -96px; }
-.ui-icon-home { background-position: 0 -112px; }
-.ui-icon-flag { background-position: -16px -112px; }
-.ui-icon-calendar { background-position: -32px -112px; }
-.ui-icon-cart { background-position: -48px -112px; }
-.ui-icon-pencil { background-position: -64px -112px; }
-.ui-icon-clock { background-position: -80px -112px; }
-.ui-icon-disk { background-position: -96px -112px; }
-.ui-icon-calculator { background-position: -112px -112px; }
-.ui-icon-zoomin { background-position: -128px -112px; }
-.ui-icon-zoomout { background-position: -144px -112px; }
-.ui-icon-search { background-position: -160px -112px; }
-.ui-icon-wrench { background-position: -176px -112px; }
-.ui-icon-gear { background-position: -192px -112px; }
-.ui-icon-heart { background-position: -208px -112px; }
-.ui-icon-star { background-position: -224px -112px; }
-.ui-icon-link { background-position: -240px -112px; }
-.ui-icon-cancel { background-position: 0 -128px; }
-.ui-icon-plus { background-position: -16px -128px; }
-.ui-icon-plusthick { background-position: -32px -128px; }
-.ui-icon-minus { background-position: -48px -128px; }
-.ui-icon-minusthick { background-position: -64px -128px; }
-.ui-icon-close { background-position: -80px -128px; }
-.ui-icon-closethick { background-position: -96px -128px; }
-.ui-icon-key { background-position: -112px -128px; }
-.ui-icon-lightbulb { background-position: -128px -128px; }
-.ui-icon-scissors { background-position: -144px -128px; }
-.ui-icon-clipboard { background-position: -160px -128px; }
-.ui-icon-copy { background-position: -176px -128px; }
-.ui-icon-contact { background-position: -192px -128px; }
-.ui-icon-image { background-position: -208px -128px; }
-.ui-icon-video { background-position: -224px -128px; }
-.ui-icon-script { background-position: -240px -128px; }
-.ui-icon-alert { background-position: 0 -144px; }
-.ui-icon-info { background-position: -16px -144px; }
-.ui-icon-notice { background-position: -32px -144px; }
-.ui-icon-help { background-position: -48px -144px; }
-.ui-icon-check { background-position: -64px -144px; }
-.ui-icon-bullet { background-position: -80px -144px; }
-.ui-icon-radio-on { background-position: -96px -144px; }
-.ui-icon-radio-off { background-position: -112px -144px; }
-.ui-icon-pin-w { background-position: -128px -144px; }
-.ui-icon-pin-s { background-position: -144px -144px; }
-.ui-icon-play { background-position: 0 -160px; }
-.ui-icon-pause { background-position: -16px -160px; }
-.ui-icon-seek-next { background-position: -32px -160px; }
-.ui-icon-seek-prev { background-position: -48px -160px; }
-.ui-icon-seek-end { background-position: -64px -160px; }
-.ui-icon-seek-start { background-position: -80px -160px; }
-/* ui-icon-seek-first is deprecated, use ui-icon-seek-start instead */
-.ui-icon-seek-first { background-position: -80px -160px; }
-.ui-icon-stop { background-position: -96px -160px; }
-.ui-icon-eject { background-position: -112px -160px; }
-.ui-icon-volume-off { background-position: -128px -160px; }
-.ui-icon-volume-on { background-position: -144px -160px; }
-.ui-icon-power { background-position: 0 -176px; }
-.ui-icon-signal-diag { background-position: -16px -176px; }
-.ui-icon-signal { background-position: -32px -176px; }
-.ui-icon-battery-0 { background-position: -48px -176px; }
-.ui-icon-battery-1 { background-position: -64px -176px; }
-.ui-icon-battery-2 { background-position: -80px -176px; }
-.ui-icon-battery-3 { background-position: -96px -176px; }
-.ui-icon-circle-plus { background-position: 0 -192px; }
-.ui-icon-circle-minus { background-position: -16px -192px; }
-.ui-icon-circle-close { background-position: -32px -192px; }
-.ui-icon-circle-triangle-e { background-position: -48px -192px; }
-.ui-icon-circle-triangle-s { background-position: -64px -192px; }
-.ui-icon-circle-triangle-w { background-position: -80px -192px; }
-.ui-icon-circle-triangle-n { background-position: -96px -192px; }
-.ui-icon-circle-arrow-e { background-position: -112px -192px; }
-.ui-icon-circle-arrow-s { background-position: -128px -192px; }
-.ui-icon-circle-arrow-w { background-position: -144px -192px; }
-.ui-icon-circle-arrow-n { background-position: -160px -192px; }
-.ui-icon-circle-zoomin { background-position: -176px -192px; }
-.ui-icon-circle-zoomout { background-position: -192px -192px; }
-.ui-icon-circle-check { background-position: -208px -192px; }
-.ui-icon-circlesmall-plus { background-position: 0 -208px; }
-.ui-icon-circlesmall-minus { background-position: -16px -208px; }
-.ui-icon-circlesmall-close { background-position: -32px -208px; }
-.ui-icon-squaresmall-plus { background-position: -48px -208px; }
-.ui-icon-squaresmall-minus { background-position: -64px -208px; }
-.ui-icon-squaresmall-close { background-position: -80px -208px; }
-.ui-icon-grip-dotted-vertical { background-position: 0 -224px; }
-.ui-icon-grip-dotted-horizontal { background-position: -16px -224px; }
-.ui-icon-grip-solid-vertical { background-position: -32px -224px; }
-.ui-icon-grip-solid-horizontal { background-position: -48px -224px; }
-.ui-icon-gripsmall-diagonal-se { background-position: -64px -224px; }
-.ui-icon-grip-diagonal-se { background-position: -80px -224px; }
+.ui-resizable-se {
+  cursor: se-resize;
+  width: 12px;
+  height: 12px;
+  right: 1px;
+  bottom: 1px;
+}
 
+.ui-resizable-sw {
+  cursor: sw-resize;
+  width: 9px;
+  height: 9px;
+  left: -5px;
+  bottom: -5px;
+}
 
-/* Misc visuals
-----------------------------------*/
+.ui-resizable-nw {
+  cursor: nw-resize;
+  width: 9px;
+  height: 9px;
+  left: -5px;
+  top: -5px;
+}
 
-/* Corner radius */
-.ui-corner-all, .ui-corner-top, .ui-corner-left, .ui-corner-tl { -moz-border-radius-topleft: 4px; -webkit-border-top-left-radius: 4px; -khtml-border-top-left-radius: 4px; border-top-left-radius: 4px; }
-.ui-corner-all, .ui-corner-top, .ui-corner-right, .ui-corner-tr { -moz-border-radius-topright: 4px; -webkit-border-top-right-radius: 4px; -khtml-border-top-right-radius: 4px; border-top-right-radius: 4px; }
-.ui-corner-all, .ui-corner-bottom, .ui-corner-left, .ui-corner-bl { -moz-border-radius-bottomleft: 4px; -webkit-border-bottom-left-radius: 4px; -khtml-border-bottom-left-radius: 4px; border-bottom-left-radius: 4px; }
-.ui-corner-all, .ui-corner-bottom, .ui-corner-right, .ui-corner-br { -moz-border-radius-bottomright: 4px; -webkit-border-bottom-right-radius: 4px; -khtml-border-bottom-right-radius: 4px; border-bottom-right-radius: 4px; }
+.ui-resizable-ne {
+  cursor: ne-resize;
+  width: 9px;
+  height: 9px;
+  right: -5px;
+  top: -5px;
+}
 
-/* Overlays */
-.ui-widget-overlay { background: #aaaaaa url(images/ui-bg_flat_0_aaaaaa_40x100.png) 50% 50% repeat-x; opacity: .3;filter:Alpha(Opacity=30); }
-.ui-widget-shadow { margin: -8px 0 0 -8px; padding: 8px; background: #aaaaaa url(images/ui-bg_flat_0_aaaaaa_40x100.png) 50% 50% repeat-x; opacity: .3;filter:Alpha(Opacity=30); -moz-border-radius: 8px; -khtml-border-radius: 8px; -webkit-border-radius: 8px; border-radius: 8px; }
\ No newline at end of file
+.ui-selectable-helper {
+  position: absolute;
+  z-index: 100;
+  border: 1px dotted black;
+}
+
+.ui-slider {
+  position: relative;
+  text-align: left;
+}
+
+.ui-slider .ui-slider-handle {
+  position: absolute;
+  z-index: 2;
+  width: 1.2em;
+  height: 1.2em;
+  cursor: default;
+}
+
+.ui-slider .ui-slider-range {
+  position: absolute;
+  z-index: 1;
+  font-size: .7em;
+  display: block;
+  border: 0;
+  background-position: 0 0;
+}
+
+.ui-slider-horizontal {
+  height: .8em;
+}
+
+.ui-slider-horizontal .ui-slider-handle {
+  top: -.3em;
+  margin-left: -.6em;
+}
+
+.ui-slider-horizontal .ui-slider-range {
+  top: 0;
+  height: 100%;
+}
+
+.ui-slider-horizontal .ui-slider-range-min {
+  left: 0;
+}
+
+.ui-slider-horizontal .ui-slider-range-max {
+  right: 0;
+}
+
+.ui-slider-vertical {
+  width: .8em;
+  height: 100px;
+}
+
+.ui-slider-vertical .ui-slider-handle {
+  left: -.3em;
+  margin-left: 0;
+  margin-bottom: -.6em;
+}
+
+.ui-slider-vertical .ui-slider-range {
+  left: 0;
+  width: 100%;
+}
+
+.ui-slider-vertical .ui-slider-range-min {
+  bottom: 0;
+}
+
+.ui-slider-vertical .ui-slider-range-max {
+  top: 0;
+}
+
+.ui-spinner {
+  position: relative;
+  display: inline-block;
+  overflow: hidden;
+  padding: 0;
+  vertical-align: middle;
+}
+
+.ui-spinner-input {
+  border: none;
+  background: none;
+  padding: 0;
+  margin: .2em 0;
+  vertical-align: middle;
+  margin-left: .4em;
+  margin-right: 22px;
+}
+
+.ui-spinner-button {
+  width: 16px;
+  height: 50%;
+  font-size: .5em;
+  padding: 0;
+  margin: 0;
+  text-align: center;
+  position: absolute;
+  cursor: default;
+  display: block;
+  overflow: hidden;
+  right: 0;
+}
+
+.ui-spinner a.ui-spinner-button {
+  border-top: none;
+  border-bottom: none;
+  border-right: none;
+}
+
+/* more specificity required here to overide default borders */
+.ui-spinner .ui-icon {
+  position: absolute;
+  margin-top: -8px;
+  top: 50%;
+  left: 0;
+}
+
+/* vertical centre icon */
+.ui-spinner-up {
+  top: 0;
+}
+
+.ui-spinner-down {
+  bottom: 0;
+}
+
+/* TR overrides */
+.ui-spinner .ui-icon-triangle-1-s {
+  /* need to fix icons sprite */
+  background-position: -65px -16px;
+}
+
+.ui-tabs {
+  position: relative;
+  padding: .2em;
+  zoom: 1;
+}
+
+/* position: relative prevents IE scroll bug (element with position: relative inside container with overflow: auto appear as "fixed") */
+.ui-tabs .ui-tabs-nav {
+  margin: 0;
+  padding: .2em .2em 0;
+}
+
+.ui-tabs .ui-tabs-nav li {
+  list-style: none;
+  float: left;
+  position: relative;
+  top: 0;
+  margin: 1px .2em 0 0;
+  border-bottom: 0;
+  padding: 0;
+  white-space: nowrap;
+}
+
+.ui-tabs .ui-tabs-nav li a {
+  float: left;
+  padding: .5em 1em;
+  text-decoration: none;
+}
+
+.ui-tabs .ui-tabs-nav li.ui-tabs-active {
+  margin-bottom: -1px;
+  padding-bottom: 1px;
+}
+
+.ui-tabs .ui-tabs-nav li.ui-tabs-active a, .ui-tabs .ui-tabs-nav li.ui-state-disabled a, .ui-tabs .ui-tabs-nav li.ui-tabs-loading a {
+  cursor: text;
+}
+
+.ui-tabs .ui-tabs-nav li a, .ui-tabs-collapsible .ui-tabs-nav li.ui-tabs-active a {
+  cursor: pointer;
+}
+
+/* first selector in group seems obsolete, but required to overcome bug in Opera applying cursor: text overall if defined elsewhere... */
+.ui-tabs .ui-tabs-panel {
+  display: block;
+  border-width: 0;
+  padding: 1em 1.4em;
+  background: none;
+}
+
+.ui-tooltip {
+  padding: 8px;
+  position: absolute;
+  z-index: 9999;
+  max-width: 300px;
+  -webkit-box-shadow: 0 0 5px #aaa;
+  box-shadow: 0 0 5px #aaa;
+}
+
+/* Fades and background-images don't work well together in IE6, drop the image */
+* html .ui-tooltip {
+  background-image: none;
+}
+
+body .ui-tooltip {
+  border-width: 2px;
+}
+
+/* Component containers
+----------------------------------*/
+.ui-widget {
+  font-family: Verdana, Arial, sans-serif;
+  font-size: 1.1em;
+}
+
+.ui-widget .ui-widget {
+  font-size: 1em;
+}
+
+.ui-widget input, .ui-widget select, .ui-widget textarea, .ui-widget button {
+  font-family: Verdana, Arial, sans-serif;
+  font-size: 1em;
+}
+
+.ui-widget-content {
+  border: 1px solid #aaaaaa;
+  background: #ffffff url(images/ui-bg_flat_75_ffffff_40x100.png) 50% 50% repeat-x;
+  color: #222222;
+}
+
+.ui-widget-content a {
+  color: #222222;
+}
+
+.ui-widget-header {
+  border: 1px solid #aaaaaa;
+  background: #cccccc url(images/ui-bg_highlight-soft_75_cccccc_1x100.png) 50% 50% repeat-x;
+  color: #222222;
+  font-weight: bold;
+}
+
+.ui-widget-header a {
+  color: #222222;
+}
+
+/* Interaction states
+----------------------------------*/
+.ui-state-default, .ui-widget-content .ui-state-default, .ui-widget-header .ui-state-default {
+  border: 1px solid #d3d3d3;
+  background: #e6e6e6 url(images/ui-bg_glass_75_e6e6e6_1x400.png) 50% 50% repeat-x;
+  font-weight: normal;
+  color: #555555;
+}
+
+.ui-state-default a, .ui-state-default a:link, .ui-state-default a:visited {
+  color: #555555;
+  text-decoration: none;
+}
+
+.ui-state-hover, .ui-widget-content .ui-state-hover, .ui-widget-header .ui-state-hover, .ui-state-focus, .ui-widget-content .ui-state-focus, .ui-widget-header .ui-state-focus {
+  border: 1px solid #999999;
+  background: #dadada url(images/ui-bg_glass_75_dadada_1x400.png) 50% 50% repeat-x;
+  font-weight: normal;
+  color: #212121;
+}
+
+.ui-state-hover a, .ui-state-hover a:hover, .ui-state-hover a:link, .ui-state-hover a:visited {
+  color: #212121;
+  text-decoration: none;
+}
+
+.ui-state-active, .ui-widget-content .ui-state-active, .ui-widget-header .ui-state-active {
+  border: 1px solid #aaaaaa;
+  background: #ffffff url(images/ui-bg_glass_65_ffffff_1x400.png) 50% 50% repeat-x;
+  font-weight: normal;
+  color: #212121;
+}
+
+.ui-state-active a, .ui-state-active a:link, .ui-state-active a:visited {
+  color: #212121;
+  text-decoration: none;
+}
+
+/* Interaction Cues
+----------------------------------*/
+.ui-state-highlight, .ui-widget-content .ui-state-highlight, .ui-widget-header .ui-state-highlight {
+  border: 1px solid #fcefa1;
+  background: #fbf9ee url(images/ui-bg_glass_55_fbf9ee_1x400.png) 50% 50% repeat-x;
+  color: #363636;
+}
+
+.ui-state-highlight a, .ui-widget-content .ui-state-highlight a, .ui-widget-header .ui-state-highlight a {
+  color: #363636;
+}
+
+.ui-state-error, .ui-widget-content .ui-state-error, .ui-widget-header .ui-state-error {
+  border: 1px solid #cd0a0a;
+  background: #fef1ec url(images/ui-bg_glass_95_fef1ec_1x400.png) 50% 50% repeat-x;
+  color: #cd0a0a;
+}
+
+.ui-state-error a, .ui-widget-content .ui-state-error a, .ui-widget-header .ui-state-error a {
+  color: #cd0a0a;
+}
+
+.ui-state-error-text, .ui-widget-content .ui-state-error-text, .ui-widget-header .ui-state-error-text {
+  color: #cd0a0a;
+}
+
+.ui-priority-primary, .ui-widget-content .ui-priority-primary, .ui-widget-header .ui-priority-primary {
+  font-weight: bold;
+}
+
+.ui-priority-secondary, .ui-widget-content .ui-priority-secondary, .ui-widget-header .ui-priority-secondary {
+  opacity: .7;
+  filter: Alpha(Opacity=70);
+  font-weight: normal;
+}
+
+.ui-state-disabled, .ui-widget-content .ui-state-disabled, .ui-widget-header .ui-state-disabled {
+  opacity: .35;
+  filter: Alpha(Opacity=35);
+  background-image: none;
+}
+
+.ui-state-disabled .ui-icon {
+  filter: Alpha(Opacity=35);
+}
+
+/* For IE8 - See #6059 */
+
+/* Icons
+----------------------------------*/
+
+/* states and images */
+.ui-icon {
+  width: 16px;
+  height: 16px;
+  background-image: url(images/ui-icons_222222_256x240.png);
+}
+
+.ui-widget-content .ui-icon {
+  background-image: url(images/ui-icons_222222_256x240.png);
+}
+
+.ui-widget-header .ui-icon {
+  background-image: url(images/ui-icons_222222_256x240.png);
+}
+
+.ui-state-default .ui-icon {
+  background-image: url(images/ui-icons_888888_256x240.png);
+}
+
+.ui-state-hover .ui-icon, .ui-state-focus .ui-icon {
+  background-image: url(images/ui-icons_454545_256x240.png);
+}
+
+.ui-state-active .ui-icon {
+  background-image: url(images/ui-icons_454545_256x240.png);
+}
+
+.ui-state-highlight .ui-icon {
+  background-image: url(images/ui-icons_2e83ff_256x240.png);
+}
+
+.ui-state-error .ui-icon, .ui-state-error-text .ui-icon {
+  background-image: url(images/ui-icons_cd0a0a_256x240.png);
+}
+
+/* positioning */
+.ui-icon-carat-1-n {
+  background-position: 0 0;
+}
+
+.ui-icon-carat-1-ne {
+  background-position: -16px 0;
+}
+
+.ui-icon-carat-1-e {
+  background-position: -32px 0;
+}
+
+.ui-icon-carat-1-se {
+  background-position: -48px 0;
+}
+
+.ui-icon-carat-1-s {
+  background-position: -64px 0;
+}
+
+.ui-icon-carat-1-sw {
+  background-position: -80px 0;
+}
+
+.ui-icon-carat-1-w {
+  background-position: -96px 0;
+}
+
+.ui-icon-carat-1-nw {
+  background-position: -112px 0;
+}
+
+.ui-icon-carat-2-n-s {
+  background-position: -128px 0;
+}
+
+.ui-icon-carat-2-e-w {
+  background-position: -144px 0;
+}
+
+.ui-icon-triangle-1-n {
+  background-position: 0 -16px;
+}
+
+.ui-icon-triangle-1-ne {
+  background-position: -16px -16px;
+}
+
+.ui-icon-triangle-1-e {
+  background-position: -32px -16px;
+}
+
+.ui-icon-triangle-1-se {
+  background-position: -48px -16px;
+}
+
+.ui-icon-triangle-1-s {
+  background-position: -64px -16px;
+}
+
+.ui-icon-triangle-1-sw {
+  background-position: -80px -16px;
+}
+
+.ui-icon-triangle-1-w {
+  background-position: -96px -16px;
+}
+
+.ui-icon-triangle-1-nw {
+  background-position: -112px -16px;
+}
+
+.ui-icon-triangle-2-n-s {
+  background-position: -128px -16px;
+}
+
+.ui-icon-triangle-2-e-w {
+  background-position: -144px -16px;
+}
+
+.ui-icon-arrow-1-n {
+  background-position: 0 -32px;
+}
+
+.ui-icon-arrow-1-ne {
+  background-position: -16px -32px;
+}
+
+.ui-icon-arrow-1-e {
+  background-position: -32px -32px;
+}
+
+.ui-icon-arrow-1-se {
+  background-position: -48px -32px;
+}
+
+.ui-icon-arrow-1-s {
+  background-position: -64px -32px;
+}
+
+.ui-icon-arrow-1-sw {
+  background-position: -80px -32px;
+}
+
+.ui-icon-arrow-1-w {
+  background-position: -96px -32px;
+}
+
+.ui-icon-arrow-1-nw {
+  background-position: -112px -32px;
+}
+
+.ui-icon-arrow-2-n-s {
+  background-position: -128px -32px;
+}
+
+.ui-icon-arrow-2-ne-sw {
+  background-position: -144px -32px;
+}
+
+.ui-icon-arrow-2-e-w {
+  background-position: -160px -32px;
+}
+
+.ui-icon-arrow-2-se-nw {
+  background-position: -176px -32px;
+}
+
+.ui-icon-arrowstop-1-n {
+  background-position: -192px -32px;
+}
+
+.ui-icon-arrowstop-1-e {
+  background-position: -208px -32px;
+}
+
+.ui-icon-arrowstop-1-s {
+  background-position: -224px -32px;
+}
+
+.ui-icon-arrowstop-1-w {
+  background-position: -240px -32px;
+}
+
+.ui-icon-arrowthick-1-n {
+  background-position: 0 -48px;
+}
+
+.ui-icon-arrowthick-1-ne {
+  background-position: -16px -48px;
+}
+
+.ui-icon-arrowthick-1-e {
+  background-position: -32px -48px;
+}
+
+.ui-icon-arrowthick-1-se {
+  background-position: -48px -48px;
+}
+
+.ui-icon-arrowthick-1-s {
+  background-position: -64px -48px;
+}
+
+.ui-icon-arrowthick-1-sw {
+  background-position: -80px -48px;
+}
+
+.ui-icon-arrowthick-1-w {
+  background-position: -96px -48px;
+}
+
+.ui-icon-arrowthick-1-nw {
+  background-position: -112px -48px;
+}
+
+.ui-icon-arrowthick-2-n-s {
+  background-position: -128px -48px;
+}
+
+.ui-icon-arrowthick-2-ne-sw {
+  background-position: -144px -48px;
+}
+
+.ui-icon-arrowthick-2-e-w {
+  background-position: -160px -48px;
+}
+
+.ui-icon-arrowthick-2-se-nw {
+  background-position: -176px -48px;
+}
+
+.ui-icon-arrowthickstop-1-n {
+  background-position: -192px -48px;
+}
+
+.ui-icon-arrowthickstop-1-e {
+  background-position: -208px -48px;
+}
+
+.ui-icon-arrowthickstop-1-s {
+  background-position: -224px -48px;
+}
+
+.ui-icon-arrowthickstop-1-w {
+  background-position: -240px -48px;
+}
+
+.ui-icon-arrowreturnthick-1-w {
+  background-position: 0 -64px;
+}
+
+.ui-icon-arrowreturnthick-1-n {
+  background-position: -16px -64px;
+}
+
+.ui-icon-arrowreturnthick-1-e {
+  background-position: -32px -64px;
+}
+
+.ui-icon-arrowreturnthick-1-s {
+  background-position: -48px -64px;
+}
+
+.ui-icon-arrowreturn-1-w {
+  background-position: -64px -64px;
+}
+
+.ui-icon-arrowreturn-1-n {
+  background-position: -80px -64px;
+}
+
+.ui-icon-arrowreturn-1-e {
+  background-position: -96px -64px;
+}
+
+.ui-icon-arrowreturn-1-s {
+  background-position: -112px -64px;
+}
+
+.ui-icon-arrowrefresh-1-w {
+  background-position: -128px -64px;
+}
+
+.ui-icon-arrowrefresh-1-n {
+  background-position: -144px -64px;
+}
+
+.ui-icon-arrowrefresh-1-e {
+  background-position: -160px -64px;
+}
+
+.ui-icon-arrowrefresh-1-s {
+  background-position: -176px -64px;
+}
+
+.ui-icon-arrow-4 {
+  background-position: 0 -80px;
+}
+
+.ui-icon-arrow-4-diag {
+  background-position: -16px -80px;
+}
+
+.ui-icon-extlink {
+  background-position: -32px -80px;
+}
+
+.ui-icon-newwin {
+  background-position: -48px -80px;
+}
+
+.ui-icon-refresh {
+  background-position: -64px -80px;
+}
+
+.ui-icon-shuffle {
+  background-position: -80px -80px;
+}
+
+.ui-icon-transfer-e-w {
+  background-position: -96px -80px;
+}
+
+.ui-icon-transferthick-e-w {
+  background-position: -112px -80px;
+}
+
+.ui-icon-folder-collapsed {
+  background-position: 0 -96px;
+}
+
+.ui-icon-folder-open {
+  background-position: -16px -96px;
+}
+
+.ui-icon-document {
+  background-position: -32px -96px;
+}
+
+.ui-icon-document-b {
+  background-position: -48px -96px;
+}
+
+.ui-icon-note {
+  background-position: -64px -96px;
+}
+
+.ui-icon-mail-closed {
+  background-position: -80px -96px;
+}
+
+.ui-icon-mail-open {
+  background-position: -96px -96px;
+}
+
+.ui-icon-suitcase {
+  background-position: -112px -96px;
+}
+
+.ui-icon-comment {
+  background-position: -128px -96px;
+}
+
+.ui-icon-person {
+  background-position: -144px -96px;
+}
+
+.ui-icon-print {
+  background-position: -160px -96px;
+}
+
+.ui-icon-trash {
+  background-position: -176px -96px;
+}
+
+.ui-icon-locked {
+  background-position: -192px -96px;
+}
+
+.ui-icon-unlocked {
+  background-position: -208px -96px;
+}
+
+.ui-icon-bookmark {
+  background-position: -224px -96px;
+}
+
+.ui-icon-tag {
+  background-position: -240px -96px;
+}
+
+.ui-icon-home {
+  background-position: 0 -112px;
+}
+
+.ui-icon-flag {
+  background-position: -16px -112px;
+}
+
+.ui-icon-calendar {
+  background-position: -32px -112px;
+}
+
+.ui-icon-cart {
+  background-position: -48px -112px;
+}
+
+.ui-icon-pencil {
+  background-position: -64px -112px;
+}
+
+.ui-icon-clock {
+  background-position: -80px -112px;
+}
+
+.ui-icon-disk {
+  background-position: -96px -112px;
+}
+
+.ui-icon-calculator {
+  background-position: -112px -112px;
+}
+
+.ui-icon-zoomin {
+  background-position: -128px -112px;
+}
+
+.ui-icon-zoomout {
+  background-position: -144px -112px;
+}
+
+.ui-icon-search {
+  background-position: -160px -112px;
+}
+
+.ui-icon-wrench {
+  background-position: -176px -112px;
+}
+
+.ui-icon-gear {
+  background-position: -192px -112px;
+}
+
+.ui-icon-heart {
+  background-position: -208px -112px;
+}
+
+.ui-icon-star {
+  background-position: -224px -112px;
+}
+
+.ui-icon-link {
+  background-position: -240px -112px;
+}
+
+.ui-icon-cancel {
+  background-position: 0 -128px;
+}
+
+.ui-icon-plus {
+  background-position: -16px -128px;
+}
+
+.ui-icon-plusthick {
+  background-position: -32px -128px;
+}
+
+.ui-icon-minus {
+  background-position: -48px -128px;
+}
+
+.ui-icon-minusthick {
+  background-position: -64px -128px;
+}
+
+.ui-icon-close {
+  background-position: -80px -128px;
+}
+
+.ui-icon-closethick {
+  background-position: -96px -128px;
+}
+
+.ui-icon-key {
+  background-position: -112px -128px;
+}
+
+.ui-icon-lightbulb {
+  background-position: -128px -128px;
+}
+
+.ui-icon-scissors {
+  background-position: -144px -128px;
+}
+
+.ui-icon-clipboard {
+  background-position: -160px -128px;
+}
+
+.ui-icon-copy {
+  background-position: -176px -128px;
+}
+
+.ui-icon-contact {
+  background-position: -192px -128px;
+}
+
+.ui-icon-image {
+  background-position: -208px -128px;
+}
+
+.ui-icon-video {
+  background-position: -224px -128px;
+}
+
+.ui-icon-script {
+  background-position: -240px -128px;
+}
+
+.ui-icon-alert {
+  background-position: 0 -144px;
+}
+
+.ui-icon-info {
+  background-position: -16px -144px;
+}
+
+.ui-icon-notice {
+  background-position: -32px -144px;
+}
+
+.ui-icon-help {
+  background-position: -48px -144px;
+}
+
+.ui-icon-check {
+  background-position: -64px -144px;
+}
+
+.ui-icon-bullet {
+  background-position: -80px -144px;
+}
+
+.ui-icon-radio-on {
+  background-position: -96px -144px;
+}
+
+.ui-icon-radio-off {
+  background-position: -112px -144px;
+}
+
+.ui-icon-pin-w {
+  background-position: -128px -144px;
+}
+
+.ui-icon-pin-s {
+  background-position: -144px -144px;
+}
+
+.ui-icon-play {
+  background-position: 0 -160px;
+}
+
+.ui-icon-pause {
+  background-position: -16px -160px;
+}
+
+.ui-icon-seek-next {
+  background-position: -32px -160px;
+}
+
+.ui-icon-seek-prev {
+  background-position: -48px -160px;
+}
+
+.ui-icon-seek-end {
+  background-position: -64px -160px;
+}
+
+.ui-icon-seek-start {
+  background-position: -80px -160px;
+}
+
+/* ui-icon-seek-first is deprecated, use ui-icon-seek-start instead */
+.ui-icon-seek-first {
+  background-position: -80px -160px;
+}
+
+.ui-icon-stop {
+  background-position: -96px -160px;
+}
+
+.ui-icon-eject {
+  background-position: -112px -160px;
+}
+
+.ui-icon-volume-off {
+  background-position: -128px -160px;
+}
+
+.ui-icon-volume-on {
+  background-position: -144px -160px;
+}
+
+.ui-icon-power {
+  background-position: 0 -176px;
+}
+
+.ui-icon-signal-diag {
+  background-position: -16px -176px;
+}
+
+.ui-icon-signal {
+  background-position: -32px -176px;
+}
+
+.ui-icon-battery-0 {
+  background-position: -48px -176px;
+}
+
+.ui-icon-battery-1 {
+  background-position: -64px -176px;
+}
+
+.ui-icon-battery-2 {
+  background-position: -80px -176px;
+}
+
+.ui-icon-battery-3 {
+  background-position: -96px -176px;
+}
+
+.ui-icon-circle-plus {
+  background-position: 0 -192px;
+}
+
+.ui-icon-circle-minus {
+  background-position: -16px -192px;
+}
+
+.ui-icon-circle-close {
+  background-position: -32px -192px;
+}
+
+.ui-icon-circle-triangle-e {
+  background-position: -48px -192px;
+}
+
+.ui-icon-circle-triangle-s {
+  background-position: -64px -192px;
+}
+
+.ui-icon-circle-triangle-w {
+  background-position: -80px -192px;
+}
+
+.ui-icon-circle-triangle-n {
+  background-position: -96px -192px;
+}
+
+.ui-icon-circle-arrow-e {
+  background-position: -112px -192px;
+}
+
+.ui-icon-circle-arrow-s {
+  background-position: -128px -192px;
+}
+
+.ui-icon-circle-arrow-w {
+  background-position: -144px -192px;
+}
+
+.ui-icon-circle-arrow-n {
+  background-position: -160px -192px;
+}
+
+.ui-icon-circle-zoomin {
+  background-position: -176px -192px;
+}
+
+.ui-icon-circle-zoomout {
+  background-position: -192px -192px;
+}
+
+.ui-icon-circle-check {
+  background-position: -208px -192px;
+}
+
+.ui-icon-circlesmall-plus {
+  background-position: 0 -208px;
+}
+
+.ui-icon-circlesmall-minus {
+  background-position: -16px -208px;
+}
+
+.ui-icon-circlesmall-close {
+  background-position: -32px -208px;
+}
+
+.ui-icon-squaresmall-plus {
+  background-position: -48px -208px;
+}
+
+.ui-icon-squaresmall-minus {
+  background-position: -64px -208px;
+}
+
+.ui-icon-squaresmall-close {
+  background-position: -80px -208px;
+}
+
+.ui-icon-grip-dotted-vertical {
+  background-position: 0 -224px;
+}
+
+.ui-icon-grip-dotted-horizontal {
+  background-position: -16px -224px;
+}
+
+.ui-icon-grip-solid-vertical {
+  background-position: -32px -224px;
+}
+
+.ui-icon-grip-solid-horizontal {
+  background-position: -48px -224px;
+}
+
+.ui-icon-gripsmall-diagonal-se {
+  background-position: -64px -224px;
+}
+
+.ui-icon-grip-diagonal-se {
+  background-position: -80px -224px;
+}
+
+/* Misc visuals
+----------------------------------*/
+
+/* Corner radius */
+.ui-corner-all, .ui-corner-top, .ui-corner-left, .ui-corner-tl {
+  -moz-border-radius-topleft: 4px;
+  -webkit-border-top-left-radius: 4px;
+  -khtml-border-top-left-radius: 4px;
+  border-top-left-radius: 4px;
+}
+
+.ui-corner-all, .ui-corner-top, .ui-corner-right, .ui-corner-tr {
+  -moz-border-radius-topright: 4px;
+  -webkit-border-top-right-radius: 4px;
+  -khtml-border-top-right-radius: 4px;
+  border-top-right-radius: 4px;
+}
+
+.ui-corner-all, .ui-corner-bottom, .ui-corner-left, .ui-corner-bl {
+  -moz-border-radius-bottomleft: 4px;
+  -webkit-border-bottom-left-radius: 4px;
+  -khtml-border-bottom-left-radius: 4px;
+  border-bottom-left-radius: 4px;
+}
+
+.ui-corner-all, .ui-corner-bottom, .ui-corner-right, .ui-corner-br {
+  -moz-border-radius-bottomright: 4px;
+  -webkit-border-bottom-right-radius: 4px;
+  -khtml-border-bottom-right-radius: 4px;
+  border-bottom-right-radius: 4px;
+}
+
+/* Overlays */
+.ui-widget-overlay {
+  background: #aaaaaa url(images/ui-bg_flat_0_aaaaaa_40x100.png) 50% 50% repeat-x;
+  opacity: .3;
+  filter: Alpha(Opacity=30);
+}
+
+.ui-widget-shadow {
+  margin: -8px 0 0 -8px;
+  padding: 8px;
+  background: #aaaaaa url(images/ui-bg_flat_0_aaaaaa_40x100.png) 50% 50% repeat-x;
+  opacity: .3;
+  filter: Alpha(Opacity=30);
+  -moz-border-radius: 8px;
+  -khtml-border-radius: 8px;
+  -webkit-border-radius: 8px;
+  border-radius: 8px;
+}
diff --git a/azkaban-web-server/src/web/css/jquery-ui-1.10.1.custom.css b/azkaban-web-server/src/web/css/jquery-ui-1.10.1.custom.css
index 93b2177..8e92eca 100644
--- a/azkaban-web-server/src/web/css/jquery-ui-1.10.1.custom.css
+++ b/azkaban-web-server/src/web/css/jquery-ui-1.10.1.custom.css
@@ -7,253 +7,287 @@
 /* Layout helpers
 ----------------------------------*/
 .ui-helper-hidden {
-	display: none;
+  display: none;
 }
+
 .ui-helper-hidden-accessible {
-	border: 0;
-	clip: rect(0 0 0 0);
-	height: 1px;
-	margin: -1px;
-	overflow: hidden;
-	padding: 0;
-	position: absolute;
-	width: 1px;
+  border: 0;
+  clip: rect(0 0 0 0);
+  height: 1px;
+  margin: -1px;
+  overflow: hidden;
+  padding: 0;
+  position: absolute;
+  width: 1px;
 }
+
 .ui-helper-reset {
-	margin: 0;
-	padding: 0;
-	border: 0;
-	outline: 0;
-	line-height: 1.3;
-	text-decoration: none;
-	font-size: 100%;
-	list-style: none;
+  margin: 0;
+  padding: 0;
+  border: 0;
+  outline: 0;
+  line-height: 1.3;
+  text-decoration: none;
+  font-size: 100%;
+  list-style: none;
 }
+
 .ui-helper-clearfix:before,
 .ui-helper-clearfix:after {
-	content: "";
-	display: table;
-	border-collapse: collapse;
+  content: "";
+  display: table;
+  border-collapse: collapse;
 }
+
 .ui-helper-clearfix:after {
-	clear: both;
+  clear: both;
 }
+
 .ui-helper-clearfix {
-	min-height: 0; /* support: IE7 */
+  min-height: 0; /* support: IE7 */
 }
+
 .ui-helper-zfix {
-	width: 100%;
-	height: 100%;
-	top: 0;
-	left: 0;
-	position: absolute;
-	opacity: 0;
-	filter:Alpha(Opacity=0);
+  width: 100%;
+  height: 100%;
+  top: 0;
+  left: 0;
+  position: absolute;
+  opacity: 0;
+  filter: Alpha(Opacity=0);
 }
 
 .ui-front {
-	z-index: 100;
+  z-index: 100;
 }
 
-
 /* Interaction Cues
 ----------------------------------*/
 .ui-state-disabled {
-	cursor: default !important;
+  cursor: default !important;
 }
 
-
 /* Icons
 ----------------------------------*/
 
 /* states and images */
 .ui-icon {
-	display: block;
-	text-indent: -99999px;
-	overflow: hidden;
-	background-repeat: no-repeat;
+  display: block;
+  text-indent: -99999px;
+  overflow: hidden;
+  background-repeat: no-repeat;
 }
 
-
 /* Misc visuals
 ----------------------------------*/
 
 /* Overlays */
 .ui-widget-overlay {
-	position: fixed;
-	top: 0;
-	left: 0;
-	width: 100%;
-	height: 100%;
+  position: fixed;
+  top: 0;
+  left: 0;
+  width: 100%;
+  height: 100%;
 }
+
 .ui-resizable {
-	position: relative;
+  position: relative;
 }
+
 .ui-resizable-handle {
-	position: absolute;
-	font-size: 0.1px;
-	display: block;
+  position: absolute;
+  font-size: 0.1px;
+  display: block;
 }
+
 .ui-resizable-disabled .ui-resizable-handle,
 .ui-resizable-autohide .ui-resizable-handle {
-	display: none;
+  display: none;
 }
+
 .ui-resizable-n {
-	cursor: n-resize;
-	height: 7px;
-	width: 100%;
-	top: -5px;
-	left: 0;
+  cursor: n-resize;
+  height: 7px;
+  width: 100%;
+  top: -5px;
+  left: 0;
 }
+
 .ui-resizable-s {
-	cursor: s-resize;
-	height: 7px;
-	width: 100%;
-	bottom: -5px;
-	left: 0;
+  cursor: s-resize;
+  height: 7px;
+  width: 100%;
+  bottom: -5px;
+  left: 0;
 }
+
 .ui-resizable-e {
-	cursor: e-resize;
-	width: 7px;
-	right: -5px;
-	top: 0;
-	height: 100%;
+  cursor: e-resize;
+  width: 7px;
+  right: -5px;
+  top: 0;
+  height: 100%;
 }
+
 .ui-resizable-w {
-	cursor: w-resize;
-	width: 7px;
-	left: -5px;
-	top: 0;
-	height: 100%;
+  cursor: w-resize;
+  width: 7px;
+  left: -5px;
+  top: 0;
+  height: 100%;
 }
+
 .ui-resizable-se {
-	cursor: se-resize;
-	width: 12px;
-	height: 12px;
-	right: 1px;
-	bottom: 1px;
+  cursor: se-resize;
+  width: 12px;
+  height: 12px;
+  right: 1px;
+  bottom: 1px;
 }
+
 .ui-resizable-sw {
-	cursor: sw-resize;
-	width: 9px;
-	height: 9px;
-	left: -5px;
-	bottom: -5px;
+  cursor: sw-resize;
+  width: 9px;
+  height: 9px;
+  left: -5px;
+  bottom: -5px;
 }
+
 .ui-resizable-nw {
-	cursor: nw-resize;
-	width: 9px;
-	height: 9px;
-	left: -5px;
-	top: -5px;
+  cursor: nw-resize;
+  width: 9px;
+  height: 9px;
+  left: -5px;
+  top: -5px;
 }
+
 .ui-resizable-ne {
-	cursor: ne-resize;
-	width: 9px;
-	height: 9px;
-	right: -5px;
-	top: -5px;
+  cursor: ne-resize;
+  width: 9px;
+  height: 9px;
+  right: -5px;
+  top: -5px;
 }
+
 .ui-selectable-helper {
-	position: absolute;
-	z-index: 100;
-	border: 1px dotted black;
+  position: absolute;
+  z-index: 100;
+  border: 1px dotted black;
 }
+
 .ui-accordion .ui-accordion-header {
-	display: block;
-	cursor: pointer;
-	position: relative;
-	margin-top: 2px;
-	padding: .5em .5em .5em .7em;
-	min-height: 0; /* support: IE7 */
+  display: block;
+  cursor: pointer;
+  position: relative;
+  margin-top: 2px;
+  padding: .5em .5em .5em .7em;
+  min-height: 0; /* support: IE7 */
 }
+
 .ui-accordion .ui-accordion-icons {
-	padding-left: 2.2em;
+  padding-left: 2.2em;
 }
+
 .ui-accordion .ui-accordion-noicons {
-	padding-left: .7em;
+  padding-left: .7em;
 }
+
 .ui-accordion .ui-accordion-icons .ui-accordion-icons {
-	padding-left: 2.2em;
+  padding-left: 2.2em;
 }
+
 .ui-accordion .ui-accordion-header .ui-accordion-header-icon {
-	position: absolute;
-	left: .5em;
-	top: 50%;
-	margin-top: -8px;
+  position: absolute;
+  left: .5em;
+  top: 50%;
+  margin-top: -8px;
 }
+
 .ui-accordion .ui-accordion-content {
-	padding: 1em 2.2em;
-	border-top: 0;
-	overflow: auto;
+  padding: 1em 2.2em;
+  border-top: 0;
+  overflow: auto;
 }
+
 .ui-autocomplete {
-	position: absolute;
-	top: 0;
-	left: 0;
-	cursor: default;
+  position: absolute;
+  top: 0;
+  left: 0;
+  cursor: default;
 }
+
 .ui-button {
-	display: inline-block;
-	position: relative;
-	padding: 0;
-	line-height: normal;
-	margin-right: .1em;
-	cursor: pointer;
-	vertical-align: middle;
-	text-align: center;
-	overflow: visible; /* removes extra width in IE */
+  display: inline-block;
+  position: relative;
+  padding: 0;
+  line-height: normal;
+  margin-right: .1em;
+  cursor: pointer;
+  vertical-align: middle;
+  text-align: center;
+  overflow: visible; /* removes extra width in IE */
 }
+
 .ui-button,
 .ui-button:link,
 .ui-button:visited,
 .ui-button:hover,
 .ui-button:active {
-	text-decoration: none;
+  text-decoration: none;
 }
+
 /* to make room for the icon, a width needs to be set here */
 .ui-button-icon-only {
-	width: 2.2em;
+  width: 2.2em;
 }
+
 /* button elements seem to need a little more width */
 button.ui-button-icon-only {
-	width: 2.4em;
+  width: 2.4em;
 }
+
 .ui-button-icons-only {
-	width: 3.4em;
+  width: 3.4em;
 }
+
 button.ui-button-icons-only {
-	width: 3.7em;
+  width: 3.7em;
 }
 
 /* button text element */
 .ui-button .ui-button-text {
-	display: block;
-	line-height: normal;
+  display: block;
+  line-height: normal;
 }
+
 .ui-button-text-only .ui-button-text {
-	padding: .4em 1em;
+  padding: .4em 1em;
 }
+
 .ui-button-icon-only .ui-button-text,
 .ui-button-icons-only .ui-button-text {
-	padding: .4em;
-	text-indent: -9999999px;
+  padding: .4em;
+  text-indent: -9999999px;
 }
+
 .ui-button-text-icon-primary .ui-button-text,
 .ui-button-text-icons .ui-button-text {
-	padding: .4em 1em .4em 2.1em;
+  padding: .4em 1em .4em 2.1em;
 }
+
 .ui-button-text-icon-secondary .ui-button-text,
 .ui-button-text-icons .ui-button-text {
-	padding: .4em 2.1em .4em 1em;
+  padding: .4em 2.1em .4em 1em;
 }
+
 .ui-button-text-icons .ui-button-text {
-	padding-left: 2.1em;
-	padding-right: 2.1em;
+  padding-left: 2.1em;
+  padding-right: 2.1em;
 }
+
 /* no icon support for input elements, provide padding by default */
 input.ui-button {
-	padding: .4em 1em;
+  padding: .4em 1em;
 }
 
 /* button icon element(s) */
@@ -262,557 +296,653 @@ input.ui-button {
 .ui-button-text-icon-secondary .ui-icon,
 .ui-button-text-icons .ui-icon,
 .ui-button-icons-only .ui-icon {
-	position: absolute;
-	top: 50%;
-	margin-top: -8px;
+  position: absolute;
+  top: 50%;
+  margin-top: -8px;
 }
+
 .ui-button-icon-only .ui-icon {
-	left: 50%;
-	margin-left: -8px;
+  left: 50%;
+  margin-left: -8px;
 }
+
 .ui-button-text-icon-primary .ui-button-icon-primary,
 .ui-button-text-icons .ui-button-icon-primary,
 .ui-button-icons-only .ui-button-icon-primary {
-	left: .5em;
+  left: .5em;
 }
+
 .ui-button-text-icon-secondary .ui-button-icon-secondary,
 .ui-button-text-icons .ui-button-icon-secondary,
 .ui-button-icons-only .ui-button-icon-secondary {
-	right: .5em;
+  right: .5em;
 }
 
 /* button sets */
 .ui-buttonset {
-	margin-right: 7px;
+  margin-right: 7px;
 }
+
 .ui-buttonset .ui-button {
-	margin-left: 0;
-	margin-right: -.3em;
+  margin-left: 0;
+  margin-right: -.3em;
 }
 
 /* workarounds */
 /* reset extra padding in Firefox, see h5bp.com/l */
 input.ui-button::-moz-focus-inner,
 button.ui-button::-moz-focus-inner {
-	border: 0;
-	padding: 0;
+  border: 0;
+  padding: 0;
 }
+
 .ui-datepicker {
-	width: 17em;
-	padding: .2em .2em 0;
-	display: none;
+  width: 17em;
+  padding: .2em .2em 0;
+  display: none;
 }
+
 .ui-datepicker .ui-datepicker-header {
-	position: relative;
-	padding: .2em 0;
+  position: relative;
+  padding: .2em 0;
 }
+
 .ui-datepicker .ui-datepicker-prev,
 .ui-datepicker .ui-datepicker-next {
-	position: absolute;
-	top: 2px;
-	width: 1.8em;
-	height: 1.8em;
+  position: absolute;
+  top: 2px;
+  width: 1.8em;
+  height: 1.8em;
 }
+
 .ui-datepicker .ui-datepicker-prev-hover,
 .ui-datepicker .ui-datepicker-next-hover {
-	top: 1px;
+  top: 1px;
 }
+
 .ui-datepicker .ui-datepicker-prev {
-	left: 2px;
+  left: 2px;
 }
+
 .ui-datepicker .ui-datepicker-next {
-	right: 2px;
+  right: 2px;
 }
+
 .ui-datepicker .ui-datepicker-prev-hover {
-	left: 1px;
+  left: 1px;
 }
+
 .ui-datepicker .ui-datepicker-next-hover {
-	right: 1px;
+  right: 1px;
 }
+
 .ui-datepicker .ui-datepicker-prev span,
 .ui-datepicker .ui-datepicker-next span {
-	display: block;
-	position: absolute;
-	left: 50%;
-	margin-left: -8px;
-	top: 50%;
-	margin-top: -8px;
+  display: block;
+  position: absolute;
+  left: 50%;
+  margin-left: -8px;
+  top: 50%;
+  margin-top: -8px;
 }
+
 .ui-datepicker .ui-datepicker-title {
-	margin: 0 2.3em;
-	line-height: 1.8em;
-	text-align: center;
+  margin: 0 2.3em;
+  line-height: 1.8em;
+  text-align: center;
 }
+
 .ui-datepicker .ui-datepicker-title select {
-	font-size: 1em;
-	margin: 1px 0;
+  font-size: 1em;
+  margin: 1px 0;
 }
+
 .ui-datepicker select.ui-datepicker-month-year {
-	width: 100%;
+  width: 100%;
 }
+
 .ui-datepicker select.ui-datepicker-month,
 .ui-datepicker select.ui-datepicker-year {
-	width: 49%;
+  width: 49%;
 }
+
 .ui-datepicker table {
-	width: 100%;
-	font-size: .9em;
-	border-collapse: collapse;
-	margin: 0 0 .4em;
+  width: 100%;
+  font-size: .9em;
+  border-collapse: collapse;
+  margin: 0 0 .4em;
 }
+
 .ui-datepicker th {
-	padding: .7em .3em;
-	text-align: center;
-	font-weight: bold;
-	border: 0;
+  padding: .7em .3em;
+  text-align: center;
+  font-weight: bold;
+  border: 0;
 }
+
 .ui-datepicker td {
-	border: 0;
-	padding: 1px;
+  border: 0;
+  padding: 1px;
 }
+
 .ui-datepicker td span,
 .ui-datepicker td a {
-	display: block;
-	padding: .2em;
-	text-align: right;
-	text-decoration: none;
+  display: block;
+  padding: .2em;
+  text-align: right;
+  text-decoration: none;
 }
+
 .ui-datepicker .ui-datepicker-buttonpane {
-	background-image: none;
-	margin: .7em 0 0 0;
-	padding: 0 .2em;
-	border-left: 0;
-	border-right: 0;
-	border-bottom: 0;
+  background-image: none;
+  margin: .7em 0 0 0;
+  padding: 0 .2em;
+  border-left: 0;
+  border-right: 0;
+  border-bottom: 0;
 }
+
 .ui-datepicker .ui-datepicker-buttonpane button {
-	float: right;
-	margin: .5em .2em .4em;
-	cursor: pointer;
-	padding: .2em .6em .3em .6em;
-	width: auto;
-	overflow: visible;
+  float: right;
+  margin: .5em .2em .4em;
+  cursor: pointer;
+  padding: .2em .6em .3em .6em;
+  width: auto;
+  overflow: visible;
 }
+
 .ui-datepicker .ui-datepicker-buttonpane button.ui-datepicker-current {
-	float: left;
+  float: left;
 }
 
 /* with multiple calendars */
 .ui-datepicker.ui-datepicker-multi {
-	width: auto;
+  width: auto;
 }
+
 .ui-datepicker-multi .ui-datepicker-group {
-	float: left;
+  float: left;
 }
+
 .ui-datepicker-multi .ui-datepicker-group table {
-	width: 95%;
-	margin: 0 auto .4em;
+  width: 95%;
+  margin: 0 auto .4em;
 }
+
 .ui-datepicker-multi-2 .ui-datepicker-group {
-	width: 50%;
+  width: 50%;
 }
+
 .ui-datepicker-multi-3 .ui-datepicker-group {
-	width: 33.3%;
+  width: 33.3%;
 }
+
 .ui-datepicker-multi-4 .ui-datepicker-group {
-	width: 25%;
+  width: 25%;
 }
+
 .ui-datepicker-multi .ui-datepicker-group-last .ui-datepicker-header,
 .ui-datepicker-multi .ui-datepicker-group-middle .ui-datepicker-header {
-	border-left-width: 0;
+  border-left-width: 0;
 }
+
 .ui-datepicker-multi .ui-datepicker-buttonpane {
-	clear: left;
+  clear: left;
 }
+
 .ui-datepicker-row-break {
-	clear: both;
-	width: 100%;
-	font-size: 0;
+  clear: both;
+  width: 100%;
+  font-size: 0;
 }
 
 /* RTL support */
 .ui-datepicker-rtl {
-	direction: rtl;
+  direction: rtl;
 }
+
 .ui-datepicker-rtl .ui-datepicker-prev {
-	right: 2px;
-	left: auto;
+  right: 2px;
+  left: auto;
 }
+
 .ui-datepicker-rtl .ui-datepicker-next {
-	left: 2px;
-	right: auto;
+  left: 2px;
+  right: auto;
 }
+
 .ui-datepicker-rtl .ui-datepicker-prev:hover {
-	right: 1px;
-	left: auto;
+  right: 1px;
+  left: auto;
 }
+
 .ui-datepicker-rtl .ui-datepicker-next:hover {
-	left: 1px;
-	right: auto;
+  left: 1px;
+  right: auto;
 }
+
 .ui-datepicker-rtl .ui-datepicker-buttonpane {
-	clear: right;
+  clear: right;
 }
+
 .ui-datepicker-rtl .ui-datepicker-buttonpane button {
-	float: left;
+  float: left;
 }
+
 .ui-datepicker-rtl .ui-datepicker-buttonpane button.ui-datepicker-current,
 .ui-datepicker-rtl .ui-datepicker-group {
-	float: right;
+  float: right;
 }
+
 .ui-datepicker-rtl .ui-datepicker-group-last .ui-datepicker-header,
 .ui-datepicker-rtl .ui-datepicker-group-middle .ui-datepicker-header {
-	border-right-width: 0;
-	border-left-width: 1px;
+  border-right-width: 0;
+  border-left-width: 1px;
 }
+
 .ui-dialog {
-	position: absolute;
-	top: 0;
-	left: 0;
-	padding: .2em;
-	outline: 0;
+  position: absolute;
+  top: 0;
+  left: 0;
+  padding: .2em;
+  outline: 0;
 }
+
 .ui-dialog .ui-dialog-titlebar {
-	padding: .4em 1em;
-	position: relative;
+  padding: .4em 1em;
+  position: relative;
 }
+
 .ui-dialog .ui-dialog-title {
-	float: left;
-	margin: .1em 0;
-	white-space: nowrap;
-	width: 90%;
-	overflow: hidden;
-	text-overflow: ellipsis;
+  float: left;
+  margin: .1em 0;
+  white-space: nowrap;
+  width: 90%;
+  overflow: hidden;
+  text-overflow: ellipsis;
 }
+
 .ui-dialog .ui-dialog-titlebar-close {
-	position: absolute;
-	right: .3em;
-	top: 50%;
-	width: 21px;
-	margin: -10px 0 0 0;
-	padding: 1px;
-	height: 20px;
+  position: absolute;
+  right: .3em;
+  top: 50%;
+  width: 21px;
+  margin: -10px 0 0 0;
+  padding: 1px;
+  height: 20px;
 }
+
 .ui-dialog .ui-dialog-content {
-	position: relative;
-	border: 0;
-	padding: .5em 1em;
-	background: none;
-	overflow: auto;
+  position: relative;
+  border: 0;
+  padding: .5em 1em;
+  background: none;
+  overflow: auto;
 }
+
 .ui-dialog .ui-dialog-buttonpane {
-	text-align: left;
-	border-width: 1px 0 0 0;
-	background-image: none;
-	margin-top: .5em;
-	padding: .3em 1em .5em .4em;
+  text-align: left;
+  border-width: 1px 0 0 0;
+  background-image: none;
+  margin-top: .5em;
+  padding: .3em 1em .5em .4em;
 }
+
 .ui-dialog .ui-dialog-buttonpane .ui-dialog-buttonset {
-	float: right;
+  float: right;
 }
+
 .ui-dialog .ui-dialog-buttonpane button {
-	margin: .5em .4em .5em 0;
-	cursor: pointer;
+  margin: .5em .4em .5em 0;
+  cursor: pointer;
 }
+
 .ui-dialog .ui-resizable-se {
-	width: 12px;
-	height: 12px;
-	right: -5px;
-	bottom: -5px;
-	background-position: 16px 16px;
+  width: 12px;
+  height: 12px;
+  right: -5px;
+  bottom: -5px;
+  background-position: 16px 16px;
 }
+
 .ui-draggable .ui-dialog-titlebar {
-	cursor: move;
+  cursor: move;
 }
+
 .ui-menu {
-	list-style: none;
-	padding: 2px;
-	margin: 0;
-	display: block;
-	outline: none;
+  list-style: none;
+  padding: 2px;
+  margin: 0;
+  display: block;
+  outline: none;
 }
+
 .ui-menu .ui-menu {
-	margin-top: -3px;
-	position: absolute;
+  margin-top: -3px;
+  position: absolute;
 }
+
 .ui-menu .ui-menu-item {
-	margin: 0;
-	padding: 0;
-	width: 100%;
+  margin: 0;
+  padding: 0;
+  width: 100%;
 }
+
 .ui-menu .ui-menu-divider {
-	margin: 5px -2px 5px -2px;
-	height: 0;
-	font-size: 0;
-	line-height: 0;
-	border-width: 1px 0 0 0;
+  margin: 5px -2px 5px -2px;
+  height: 0;
+  font-size: 0;
+  line-height: 0;
+  border-width: 1px 0 0 0;
 }
+
 .ui-menu .ui-menu-item a {
-	text-decoration: none;
-	display: block;
-	padding: 2px .4em;
-	line-height: 1.5;
-	min-height: 0; /* support: IE7 */
-	font-weight: normal;
+  text-decoration: none;
+  display: block;
+  padding: 2px .4em;
+  line-height: 1.5;
+  min-height: 0; /* support: IE7 */
+  font-weight: normal;
 }
+
 .ui-menu .ui-menu-item a.ui-state-focus,
 .ui-menu .ui-menu-item a.ui-state-active {
-	font-weight: normal;
-	margin: -1px;
+  font-weight: normal;
+  margin: -1px;
 }
 
 .ui-menu .ui-state-disabled {
-	font-weight: normal;
-	margin: .4em 0 .2em;
-	line-height: 1.5;
+  font-weight: normal;
+  margin: .4em 0 .2em;
+  line-height: 1.5;
 }
+
 .ui-menu .ui-state-disabled a {
-	cursor: default;
+  cursor: default;
 }
 
 /* icon support */
 .ui-menu-icons {
-	position: relative;
+  position: relative;
 }
+
 .ui-menu-icons .ui-menu-item a {
-	position: relative;
-	padding-left: 2em;
+  position: relative;
+  padding-left: 2em;
 }
 
 /* left-aligned */
 .ui-menu .ui-icon {
-	position: absolute;
-	top: .2em;
-	left: .2em;
+  position: absolute;
+  top: .2em;
+  left: .2em;
 }
 
 /* right-aligned */
 .ui-menu .ui-menu-icon {
-	position: static;
-	float: right;
+  position: static;
+  float: right;
 }
+
 .ui-progressbar {
-	height: 2em;
-	text-align: left;
-	overflow: hidden;
+  height: 2em;
+  text-align: left;
+  overflow: hidden;
 }
+
 .ui-progressbar .ui-progressbar-value {
-	margin: -1px;
-	height: 100%;
+  margin: -1px;
+  height: 100%;
 }
+
 .ui-progressbar .ui-progressbar-overlay {
-	background: url("images/animated-overlay.gif");
-	height: 100%;
-	filter: alpha(opacity=25);
-	opacity: 0.25;
+  background: url("images/animated-overlay.gif");
+  height: 100%;
+  filter: alpha(opacity=25);
+  opacity: 0.25;
 }
+
 .ui-progressbar-indeterminate .ui-progressbar-value {
-	background-image: none;
+  background-image: none;
 }
+
 .ui-slider {
-	position: relative;
-	text-align: left;
+  position: relative;
+  text-align: left;
 }
+
 .ui-slider .ui-slider-handle {
-	position: absolute;
-	z-index: 2;
-	width: 1.2em;
-	height: 1.2em;
-	cursor: default;
+  position: absolute;
+  z-index: 2;
+  width: 1.2em;
+  height: 1.2em;
+  cursor: default;
 }
+
 .ui-slider .ui-slider-range {
-	position: absolute;
-	z-index: 1;
-	font-size: .7em;
-	display: block;
-	border: 0;
-	background-position: 0 0;
+  position: absolute;
+  z-index: 1;
+  font-size: .7em;
+  display: block;
+  border: 0;
+  background-position: 0 0;
 }
 
 /* For IE8 - See #6727 */
 .ui-slider.ui-state-disabled .ui-slider-handle,
 .ui-slider.ui-state-disabled .ui-slider-range {
-	filter: inherit;
+  filter: inherit;
 }
 
 .ui-slider-horizontal {
-	height: .8em;
+  height: .8em;
 }
+
 .ui-slider-horizontal .ui-slider-handle {
-	top: -.3em;
-	margin-left: -.6em;
+  top: -.3em;
+  margin-left: -.6em;
 }
+
 .ui-slider-horizontal .ui-slider-range {
-	top: 0;
-	height: 100%;
+  top: 0;
+  height: 100%;
 }
+
 .ui-slider-horizontal .ui-slider-range-min {
-	left: 0;
+  left: 0;
 }
+
 .ui-slider-horizontal .ui-slider-range-max {
-	right: 0;
+  right: 0;
 }
 
 .ui-slider-vertical {
-	width: .8em;
-	height: 100px;
+  width: .8em;
+  height: 100px;
 }
+
 .ui-slider-vertical .ui-slider-handle {
-	left: -.3em;
-	margin-left: 0;
-	margin-bottom: -.6em;
+  left: -.3em;
+  margin-left: 0;
+  margin-bottom: -.6em;
 }
+
 .ui-slider-vertical .ui-slider-range {
-	left: 0;
-	width: 100%;
+  left: 0;
+  width: 100%;
 }
+
 .ui-slider-vertical .ui-slider-range-min {
-	bottom: 0;
+  bottom: 0;
 }
+
 .ui-slider-vertical .ui-slider-range-max {
-	top: 0;
+  top: 0;
 }
+
 .ui-spinner {
-	position: relative;
-	display: inline-block;
-	overflow: hidden;
-	padding: 0;
-	vertical-align: middle;
+  position: relative;
+  display: inline-block;
+  overflow: hidden;
+  padding: 0;
+  vertical-align: middle;
 }
+
 .ui-spinner-input {
-	border: none;
-	background: none;
-	color: inherit;
-	padding: 0;
-	margin: .2em 0;
-	vertical-align: middle;
-	margin-left: .4em;
-	margin-right: 22px;
+  border: none;
+  background: none;
+  color: inherit;
+  padding: 0;
+  margin: .2em 0;
+  vertical-align: middle;
+  margin-left: .4em;
+  margin-right: 22px;
 }
+
 .ui-spinner-button {
-	width: 16px;
-	height: 50%;
-	font-size: .5em;
-	padding: 0;
-	margin: 0;
-	text-align: center;
-	position: absolute;
-	cursor: default;
-	display: block;
-	overflow: hidden;
-	right: 0;
+  width: 16px;
+  height: 50%;
+  font-size: .5em;
+  padding: 0;
+  margin: 0;
+  text-align: center;
+  position: absolute;
+  cursor: default;
+  display: block;
+  overflow: hidden;
+  right: 0;
 }
+
 /* more specificity required here to overide default borders */
 .ui-spinner a.ui-spinner-button {
-	border-top: none;
-	border-bottom: none;
-	border-right: none;
+  border-top: none;
+  border-bottom: none;
+  border-right: none;
 }
+
 /* vertical centre icon */
 .ui-spinner .ui-icon {
-	position: absolute;
-	margin-top: -8px;
-	top: 50%;
-	left: 0;
+  position: absolute;
+  margin-top: -8px;
+  top: 50%;
+  left: 0;
 }
+
 .ui-spinner-up {
-	top: 0;
+  top: 0;
 }
+
 .ui-spinner-down {
-	bottom: 0;
+  bottom: 0;
 }
 
 /* TR overrides */
 .ui-spinner .ui-icon-triangle-1-s {
-	/* need to fix icons sprite */
-	background-position: -65px -16px;
+  /* need to fix icons sprite */
+  background-position: -65px -16px;
 }
+
 .ui-tabs {
-	position: relative;/* position: relative prevents IE scroll bug (element with position: relative inside container with overflow: auto appear as "fixed") */
-	padding: .2em;
+  position: relative; /* position: relative prevents IE scroll bug (element with position: relative inside container with overflow: auto appear as "fixed") */
+  padding: .2em;
 }
+
 .ui-tabs .ui-tabs-nav {
-	margin: 0;
-	padding: .2em .2em 0;
+  margin: 0;
+  padding: .2em .2em 0;
 }
+
 .ui-tabs .ui-tabs-nav li {
-	list-style: none;
-	float: left;
-	position: relative;
-	top: 0;
-	margin: 1px .2em 0 0;
-	border-bottom: 0;
-	padding: 0;
-	white-space: nowrap;
+  list-style: none;
+  float: left;
+  position: relative;
+  top: 0;
+  margin: 1px .2em 0 0;
+  border-bottom: 0;
+  padding: 0;
+  white-space: nowrap;
 }
+
 .ui-tabs .ui-tabs-nav li a {
-	float: left;
-	padding: .5em 1em;
-	text-decoration: none;
+  float: left;
+  padding: .5em 1em;
+  text-decoration: none;
 }
+
 .ui-tabs .ui-tabs-nav li.ui-tabs-active {
-	margin-bottom: -1px;
-	padding-bottom: 1px;
+  margin-bottom: -1px;
+  padding-bottom: 1px;
 }
+
 .ui-tabs .ui-tabs-nav li.ui-tabs-active a,
 .ui-tabs .ui-tabs-nav li.ui-state-disabled a,
 .ui-tabs .ui-tabs-nav li.ui-tabs-loading a {
-	cursor: text;
+  cursor: text;
 }
+
 .ui-tabs .ui-tabs-nav li a, /* first selector in group seems obsolete, but required to overcome bug in Opera applying cursor: text overall if defined elsewhere... */
 .ui-tabs-collapsible .ui-tabs-nav li.ui-tabs-active a {
-	cursor: pointer;
+  cursor: pointer;
 }
+
 .ui-tabs .ui-tabs-panel {
-	display: block;
-	border-width: 0;
-	padding: 1em 1.4em;
-	background: none;
+  display: block;
+  border-width: 0;
+  padding: 1em 1.4em;
+  background: none;
 }
+
 .ui-tooltip {
-	padding: 8px;
-	position: absolute;
-	z-index: 9999;
-	max-width: 300px;
-	-webkit-box-shadow: 0 0 5px #aaa;
-	box-shadow: 0 0 5px #aaa;
+  padding: 8px;
+  position: absolute;
+  z-index: 9999;
+  max-width: 300px;
+  -webkit-box-shadow: 0 0 5px #aaa;
+  box-shadow: 0 0 5px #aaa;
 }
+
 body .ui-tooltip {
-	border-width: 2px;
+  border-width: 2px;
 }
 
 /* Component containers
 ----------------------------------*/
 .ui-widget {
-	font-family: Trebuchet MS,Helvetica,Arial,sans-serif;
-	font-size: 1.1em;
+  font-family: Trebuchet MS, Helvetica, Arial, sans-serif;
+  font-size: 1.1em;
 }
+
 .ui-widget .ui-widget {
-	font-size: 1em;
+  font-size: 1em;
 }
+
 .ui-widget input,
 .ui-widget select,
 .ui-widget textarea,
 .ui-widget button {
-	font-family: Trebuchet MS,Helvetica,Arial,sans-serif;
-	font-size: 1em;
+  font-family: Trebuchet MS, Helvetica, Arial, sans-serif;
+  font-size: 1em;
 }
+
 .ui-widget-content {
-	border: 1px solid #aaaaaa;
-	background: #c9c9c9 url(images/ui-bg_inset-soft_50_c9c9c9_1x100.png) 50% bottom repeat-x;
-	color: #333333;
+  border: 1px solid #aaaaaa;
+  background: #c9c9c9 url(images/ui-bg_inset-soft_50_c9c9c9_1x100.png) 50% bottom repeat-x;
+  color: #333333;
 }
+
 .ui-widget-content a {
-	color: #333333;
+  color: #333333;
 }
+
 .ui-widget-header {
-	border: 1px solid #bbbbbb;
-	background: #dddddd url(images/ui-bg_flat_35_dddddd_40x100.png) 50% 50% repeat-x;
-	color: #444444;
-	font-weight: bold;
+  border: 1px solid #bbbbbb;
+  background: #dddddd url(images/ui-bg_flat_35_dddddd_40x100.png) 50% 50% repeat-x;
+  color: #444444;
+  font-weight: bold;
 }
+
 .ui-widget-header a {
-	color: #444444;
+  color: #444444;
 }
 
 /* Interaction states
@@ -820,48 +950,53 @@ body .ui-tooltip {
 .ui-state-default,
 .ui-widget-content .ui-state-default,
 .ui-widget-header .ui-state-default {
-	border: 1px solid #cccccc;
-	background: #eeeeee url(images/ui-bg_glass_60_eeeeee_1x400.png) 50% 50% repeat-x;
-	font-weight: bold;
-	color: #3383bb;
+  border: 1px solid #cccccc;
+  background: #eeeeee url(images/ui-bg_glass_60_eeeeee_1x400.png) 50% 50% repeat-x;
+  font-weight: bold;
+  color: #3383bb;
 }
+
 .ui-state-default a,
 .ui-state-default a:link,
 .ui-state-default a:visited {
-	color: #3383bb;
-	text-decoration: none;
+  color: #3383bb;
+  text-decoration: none;
 }
+
 .ui-state-hover,
 .ui-widget-content .ui-state-hover,
 .ui-widget-header .ui-state-hover,
 .ui-state-focus,
 .ui-widget-content .ui-state-focus,
 .ui-widget-header .ui-state-focus {
-	border: 1px solid #bbbbbb;
-	background: #f8f8f8 url(images/ui-bg_glass_100_f8f8f8_1x400.png) 50% 50% repeat-x;
-	font-weight: bold;
-	color: #599fcf;
+  border: 1px solid #bbbbbb;
+  background: #f8f8f8 url(images/ui-bg_glass_100_f8f8f8_1x400.png) 50% 50% repeat-x;
+  font-weight: bold;
+  color: #599fcf;
 }
+
 .ui-state-hover a,
 .ui-state-hover a:hover,
 .ui-state-hover a:link,
 .ui-state-hover a:visited {
-	color: #599fcf;
-	text-decoration: none;
+  color: #599fcf;
+  text-decoration: none;
 }
+
 .ui-state-active,
 .ui-widget-content .ui-state-active,
 .ui-widget-header .ui-state-active {
-	border: 1px solid #999999;
-	background: #999999 url(images/ui-bg_inset-hard_75_999999_1x100.png) 50% 50% repeat-x;
-	font-weight: bold;
-	color: #ffffff;
+  border: 1px solid #999999;
+  background: #999999 url(images/ui-bg_inset-hard_75_999999_1x100.png) 50% 50% repeat-x;
+  font-weight: bold;
+  color: #ffffff;
 }
+
 .ui-state-active a,
 .ui-state-active a:link,
 .ui-state-active a:visited {
-	color: #ffffff;
-	text-decoration: none;
+  color: #ffffff;
+  text-decoration: none;
 }
 
 /* Interaction Cues
@@ -869,53 +1004,61 @@ body .ui-tooltip {
 .ui-state-highlight,
 .ui-widget-content .ui-state-highlight,
 .ui-widget-header .ui-state-highlight {
-	border: 1px solid #ffffff;
-	background: #eeeeee url(images/ui-bg_flat_55_eeeeee_40x100.png) 50% 50% repeat-x;
-	color: #444444;
+  border: 1px solid #ffffff;
+  background: #eeeeee url(images/ui-bg_flat_55_eeeeee_40x100.png) 50% 50% repeat-x;
+  color: #444444;
 }
+
 .ui-state-highlight a,
 .ui-widget-content .ui-state-highlight a,
 .ui-widget-header .ui-state-highlight a {
-	color: #444444;
+  color: #444444;
 }
+
 .ui-state-error,
 .ui-widget-content .ui-state-error,
 .ui-widget-header .ui-state-error {
-	border: 1px solid #c0402a;
-	background: #c0402a url(images/ui-bg_flat_55_c0402a_40x100.png) 50% 50% repeat-x;
-	color: #ffffff;
+  border: 1px solid #c0402a;
+  background: #c0402a url(images/ui-bg_flat_55_c0402a_40x100.png) 50% 50% repeat-x;
+  color: #ffffff;
 }
+
 .ui-state-error a,
 .ui-widget-content .ui-state-error a,
 .ui-widget-header .ui-state-error a {
-	color: #ffffff;
+  color: #ffffff;
 }
+
 .ui-state-error-text,
 .ui-widget-content .ui-state-error-text,
 .ui-widget-header .ui-state-error-text {
-	color: #ffffff;
+  color: #ffffff;
 }
+
 .ui-priority-primary,
 .ui-widget-content .ui-priority-primary,
 .ui-widget-header .ui-priority-primary {
-	font-weight: bold;
+  font-weight: bold;
 }
+
 .ui-priority-secondary,
 .ui-widget-content .ui-priority-secondary,
 .ui-widget-header .ui-priority-secondary {
-	opacity: .7;
-	filter:Alpha(Opacity=70);
-	font-weight: normal;
+  opacity: .7;
+  filter: Alpha(Opacity=70);
+  font-weight: normal;
 }
+
 .ui-state-disabled,
 .ui-widget-content .ui-state-disabled,
 .ui-widget-header .ui-state-disabled {
-	opacity: .35;
-	filter:Alpha(Opacity=35);
-	background-image: none;
+  opacity: .35;
+  filter: Alpha(Opacity=35);
+  background-image: none;
 }
+
 .ui-state-disabled .ui-icon {
-	filter:Alpha(Opacity=35); /* For IE8 - See #6059 */
+  filter: Alpha(Opacity=35); /* For IE8 - See #6059 */
 }
 
 /* Icons
@@ -923,212 +1066,739 @@ body .ui-tooltip {
 
 /* states and images */
 .ui-icon {
-	width: 16px;
-	height: 16px;
-	background-position: 16px 16px;
+  width: 16px;
+  height: 16px;
+  background-position: 16px 16px;
 }
+
 .ui-icon,
 .ui-widget-content .ui-icon {
-	background-image: url(images/ui-icons_999999_256x240.png);
+  background-image: url(images/ui-icons_999999_256x240.png);
 }
+
 .ui-widget-header .ui-icon {
-	background-image: url(images/ui-icons_999999_256x240.png);
+  background-image: url(images/ui-icons_999999_256x240.png);
 }
+
 .ui-state-default .ui-icon {
-	background-image: url(images/ui-icons_70b2e1_256x240.png);
+  background-image: url(images/ui-icons_70b2e1_256x240.png);
 }
+
 .ui-state-hover .ui-icon,
 .ui-state-focus .ui-icon {
-	background-image: url(images/ui-icons_3383bb_256x240.png);
+  background-image: url(images/ui-icons_3383bb_256x240.png);
 }
+
 .ui-state-active .ui-icon {
-	background-image: url(images/ui-icons_454545_256x240.png);
+  background-image: url(images/ui-icons_454545_256x240.png);
 }
+
 .ui-state-highlight .ui-icon {
-	background-image: url(images/ui-icons_3383bb_256x240.png);
+  background-image: url(images/ui-icons_3383bb_256x240.png);
 }
+
 .ui-state-error .ui-icon,
 .ui-state-error-text .ui-icon {
-	background-image: url(images/ui-icons_fbc856_256x240.png);
+  background-image: url(images/ui-icons_fbc856_256x240.png);
 }
 
 /* positioning */
-.ui-icon-carat-1-n { background-position: 0 0; }
-.ui-icon-carat-1-ne { background-position: -16px 0; }
-.ui-icon-carat-1-e { background-position: -32px 0; }
-.ui-icon-carat-1-se { background-position: -48px 0; }
-.ui-icon-carat-1-s { background-position: -64px 0; }
-.ui-icon-carat-1-sw { background-position: -80px 0; }
-.ui-icon-carat-1-w { background-position: -96px 0; }
-.ui-icon-carat-1-nw { background-position: -112px 0; }
-.ui-icon-carat-2-n-s { background-position: -128px 0; }
-.ui-icon-carat-2-e-w { background-position: -144px 0; }
-.ui-icon-triangle-1-n { background-position: 0 -16px; }
-.ui-icon-triangle-1-ne { background-position: -16px -16px; }
-.ui-icon-triangle-1-e { background-position: -32px -16px; }
-.ui-icon-triangle-1-se { background-position: -48px -16px; }
-.ui-icon-triangle-1-s { background-position: -64px -16px; }
-.ui-icon-triangle-1-sw { background-position: -80px -16px; }
-.ui-icon-triangle-1-w { background-position: -96px -16px; }
-.ui-icon-triangle-1-nw { background-position: -112px -16px; }
-.ui-icon-triangle-2-n-s { background-position: -128px -16px; }
-.ui-icon-triangle-2-e-w { background-position: -144px -16px; }
-.ui-icon-arrow-1-n { background-position: 0 -32px; }
-.ui-icon-arrow-1-ne { background-position: -16px -32px; }
-.ui-icon-arrow-1-e { background-position: -32px -32px; }
-.ui-icon-arrow-1-se { background-position: -48px -32px; }
-.ui-icon-arrow-1-s { background-position: -64px -32px; }
-.ui-icon-arrow-1-sw { background-position: -80px -32px; }
-.ui-icon-arrow-1-w { background-position: -96px -32px; }
-.ui-icon-arrow-1-nw { background-position: -112px -32px; }
-.ui-icon-arrow-2-n-s { background-position: -128px -32px; }
-.ui-icon-arrow-2-ne-sw { background-position: -144px -32px; }
-.ui-icon-arrow-2-e-w { background-position: -160px -32px; }
-.ui-icon-arrow-2-se-nw { background-position: -176px -32px; }
-.ui-icon-arrowstop-1-n { background-position: -192px -32px; }
-.ui-icon-arrowstop-1-e { background-position: -208px -32px; }
-.ui-icon-arrowstop-1-s { background-position: -224px -32px; }
-.ui-icon-arrowstop-1-w { background-position: -240px -32px; }
-.ui-icon-arrowthick-1-n { background-position: 0 -48px; }
-.ui-icon-arrowthick-1-ne { background-position: -16px -48px; }
-.ui-icon-arrowthick-1-e { background-position: -32px -48px; }
-.ui-icon-arrowthick-1-se { background-position: -48px -48px; }
-.ui-icon-arrowthick-1-s { background-position: -64px -48px; }
-.ui-icon-arrowthick-1-sw { background-position: -80px -48px; }
-.ui-icon-arrowthick-1-w { background-position: -96px -48px; }
-.ui-icon-arrowthick-1-nw { background-position: -112px -48px; }
-.ui-icon-arrowthick-2-n-s { background-position: -128px -48px; }
-.ui-icon-arrowthick-2-ne-sw { background-position: -144px -48px; }
-.ui-icon-arrowthick-2-e-w { background-position: -160px -48px; }
-.ui-icon-arrowthick-2-se-nw { background-position: -176px -48px; }
-.ui-icon-arrowthickstop-1-n { background-position: -192px -48px; }
-.ui-icon-arrowthickstop-1-e { background-position: -208px -48px; }
-.ui-icon-arrowthickstop-1-s { background-position: -224px -48px; }
-.ui-icon-arrowthickstop-1-w { background-position: -240px -48px; }
-.ui-icon-arrowreturnthick-1-w { background-position: 0 -64px; }
-.ui-icon-arrowreturnthick-1-n { background-position: -16px -64px; }
-.ui-icon-arrowreturnthick-1-e { background-position: -32px -64px; }
-.ui-icon-arrowreturnthick-1-s { background-position: -48px -64px; }
-.ui-icon-arrowreturn-1-w { background-position: -64px -64px; }
-.ui-icon-arrowreturn-1-n { background-position: -80px -64px; }
-.ui-icon-arrowreturn-1-e { background-position: -96px -64px; }
-.ui-icon-arrowreturn-1-s { background-position: -112px -64px; }
-.ui-icon-arrowrefresh-1-w { background-position: -128px -64px; }
-.ui-icon-arrowrefresh-1-n { background-position: -144px -64px; }
-.ui-icon-arrowrefresh-1-e { background-position: -160px -64px; }
-.ui-icon-arrowrefresh-1-s { background-position: -176px -64px; }
-.ui-icon-arrow-4 { background-position: 0 -80px; }
-.ui-icon-arrow-4-diag { background-position: -16px -80px; }
-.ui-icon-extlink { background-position: -32px -80px; }
-.ui-icon-newwin { background-position: -48px -80px; }
-.ui-icon-refresh { background-position: -64px -80px; }
-.ui-icon-shuffle { background-position: -80px -80px; }
-.ui-icon-transfer-e-w { background-position: -96px -80px; }
-.ui-icon-transferthick-e-w { background-position: -112px -80px; }
-.ui-icon-folder-collapsed { background-position: 0 -96px; }
-.ui-icon-folder-open { background-position: -16px -96px; }
-.ui-icon-document { background-position: -32px -96px; }
-.ui-icon-document-b { background-position: -48px -96px; }
-.ui-icon-note { background-position: -64px -96px; }
-.ui-icon-mail-closed { background-position: -80px -96px; }
-.ui-icon-mail-open { background-position: -96px -96px; }
-.ui-icon-suitcase { background-position: -112px -96px; }
-.ui-icon-comment { background-position: -128px -96px; }
-.ui-icon-person { background-position: -144px -96px; }
-.ui-icon-print { background-position: -160px -96px; }
-.ui-icon-trash { background-position: -176px -96px; }
-.ui-icon-locked { background-position: -192px -96px; }
-.ui-icon-unlocked { background-position: -208px -96px; }
-.ui-icon-bookmark { background-position: -224px -96px; }
-.ui-icon-tag { background-position: -240px -96px; }
-.ui-icon-home { background-position: 0 -112px; }
-.ui-icon-flag { background-position: -16px -112px; }
-.ui-icon-calendar { background-position: -32px -112px; }
-.ui-icon-cart { background-position: -48px -112px; }
-.ui-icon-pencil { background-position: -64px -112px; }
-.ui-icon-clock { background-position: -80px -112px; }
-.ui-icon-disk { background-position: -96px -112px; }
-.ui-icon-calculator { background-position: -112px -112px; }
-.ui-icon-zoomin { background-position: -128px -112px; }
-.ui-icon-zoomout { background-position: -144px -112px; }
-.ui-icon-search { background-position: -160px -112px; }
-.ui-icon-wrench { background-position: -176px -112px; }
-.ui-icon-gear { background-position: -192px -112px; }
-.ui-icon-heart { background-position: -208px -112px; }
-.ui-icon-star { background-position: -224px -112px; }
-.ui-icon-link { background-position: -240px -112px; }
-.ui-icon-cancel { background-position: 0 -128px; }
-.ui-icon-plus { background-position: -16px -128px; }
-.ui-icon-plusthick { background-position: -32px -128px; }
-.ui-icon-minus { background-position: -48px -128px; }
-.ui-icon-minusthick { background-position: -64px -128px; }
-.ui-icon-close { background-position: -80px -128px; }
-.ui-icon-closethick { background-position: -96px -128px; }
-.ui-icon-key { background-position: -112px -128px; }
-.ui-icon-lightbulb { background-position: -128px -128px; }
-.ui-icon-scissors { background-position: -144px -128px; }
-.ui-icon-clipboard { background-position: -160px -128px; }
-.ui-icon-copy { background-position: -176px -128px; }
-.ui-icon-contact { background-position: -192px -128px; }
-.ui-icon-image { background-position: -208px -128px; }
-.ui-icon-video { background-position: -224px -128px; }
-.ui-icon-script { background-position: -240px -128px; }
-.ui-icon-alert { background-position: 0 -144px; }
-.ui-icon-info { background-position: -16px -144px; }
-.ui-icon-notice { background-position: -32px -144px; }
-.ui-icon-help { background-position: -48px -144px; }
-.ui-icon-check { background-position: -64px -144px; }
-.ui-icon-bullet { background-position: -80px -144px; }
-.ui-icon-radio-on { background-position: -96px -144px; }
-.ui-icon-radio-off { background-position: -112px -144px; }
-.ui-icon-pin-w { background-position: -128px -144px; }
-.ui-icon-pin-s { background-position: -144px -144px; }
-.ui-icon-play { background-position: 0 -160px; }
-.ui-icon-pause { background-position: -16px -160px; }
-.ui-icon-seek-next { background-position: -32px -160px; }
-.ui-icon-seek-prev { background-position: -48px -160px; }
-.ui-icon-seek-end { background-position: -64px -160px; }
-.ui-icon-seek-start { background-position: -80px -160px; }
+.ui-icon-carat-1-n {
+  background-position: 0 0;
+}
+
+.ui-icon-carat-1-ne {
+  background-position: -16px 0;
+}
+
+.ui-icon-carat-1-e {
+  background-position: -32px 0;
+}
+
+.ui-icon-carat-1-se {
+  background-position: -48px 0;
+}
+
+.ui-icon-carat-1-s {
+  background-position: -64px 0;
+}
+
+.ui-icon-carat-1-sw {
+  background-position: -80px 0;
+}
+
+.ui-icon-carat-1-w {
+  background-position: -96px 0;
+}
+
+.ui-icon-carat-1-nw {
+  background-position: -112px 0;
+}
+
+.ui-icon-carat-2-n-s {
+  background-position: -128px 0;
+}
+
+.ui-icon-carat-2-e-w {
+  background-position: -144px 0;
+}
+
+.ui-icon-triangle-1-n {
+  background-position: 0 -16px;
+}
+
+.ui-icon-triangle-1-ne {
+  background-position: -16px -16px;
+}
+
+.ui-icon-triangle-1-e {
+  background-position: -32px -16px;
+}
+
+.ui-icon-triangle-1-se {
+  background-position: -48px -16px;
+}
+
+.ui-icon-triangle-1-s {
+  background-position: -64px -16px;
+}
+
+.ui-icon-triangle-1-sw {
+  background-position: -80px -16px;
+}
+
+.ui-icon-triangle-1-w {
+  background-position: -96px -16px;
+}
+
+.ui-icon-triangle-1-nw {
+  background-position: -112px -16px;
+}
+
+.ui-icon-triangle-2-n-s {
+  background-position: -128px -16px;
+}
+
+.ui-icon-triangle-2-e-w {
+  background-position: -144px -16px;
+}
+
+.ui-icon-arrow-1-n {
+  background-position: 0 -32px;
+}
+
+.ui-icon-arrow-1-ne {
+  background-position: -16px -32px;
+}
+
+.ui-icon-arrow-1-e {
+  background-position: -32px -32px;
+}
+
+.ui-icon-arrow-1-se {
+  background-position: -48px -32px;
+}
+
+.ui-icon-arrow-1-s {
+  background-position: -64px -32px;
+}
+
+.ui-icon-arrow-1-sw {
+  background-position: -80px -32px;
+}
+
+.ui-icon-arrow-1-w {
+  background-position: -96px -32px;
+}
+
+.ui-icon-arrow-1-nw {
+  background-position: -112px -32px;
+}
+
+.ui-icon-arrow-2-n-s {
+  background-position: -128px -32px;
+}
+
+.ui-icon-arrow-2-ne-sw {
+  background-position: -144px -32px;
+}
+
+.ui-icon-arrow-2-e-w {
+  background-position: -160px -32px;
+}
+
+.ui-icon-arrow-2-se-nw {
+  background-position: -176px -32px;
+}
+
+.ui-icon-arrowstop-1-n {
+  background-position: -192px -32px;
+}
+
+.ui-icon-arrowstop-1-e {
+  background-position: -208px -32px;
+}
+
+.ui-icon-arrowstop-1-s {
+  background-position: -224px -32px;
+}
+
+.ui-icon-arrowstop-1-w {
+  background-position: -240px -32px;
+}
+
+.ui-icon-arrowthick-1-n {
+  background-position: 0 -48px;
+}
+
+.ui-icon-arrowthick-1-ne {
+  background-position: -16px -48px;
+}
+
+.ui-icon-arrowthick-1-e {
+  background-position: -32px -48px;
+}
+
+.ui-icon-arrowthick-1-se {
+  background-position: -48px -48px;
+}
+
+.ui-icon-arrowthick-1-s {
+  background-position: -64px -48px;
+}
+
+.ui-icon-arrowthick-1-sw {
+  background-position: -80px -48px;
+}
+
+.ui-icon-arrowthick-1-w {
+  background-position: -96px -48px;
+}
+
+.ui-icon-arrowthick-1-nw {
+  background-position: -112px -48px;
+}
+
+.ui-icon-arrowthick-2-n-s {
+  background-position: -128px -48px;
+}
+
+.ui-icon-arrowthick-2-ne-sw {
+  background-position: -144px -48px;
+}
+
+.ui-icon-arrowthick-2-e-w {
+  background-position: -160px -48px;
+}
+
+.ui-icon-arrowthick-2-se-nw {
+  background-position: -176px -48px;
+}
+
+.ui-icon-arrowthickstop-1-n {
+  background-position: -192px -48px;
+}
+
+.ui-icon-arrowthickstop-1-e {
+  background-position: -208px -48px;
+}
+
+.ui-icon-arrowthickstop-1-s {
+  background-position: -224px -48px;
+}
+
+.ui-icon-arrowthickstop-1-w {
+  background-position: -240px -48px;
+}
+
+.ui-icon-arrowreturnthick-1-w {
+  background-position: 0 -64px;
+}
+
+.ui-icon-arrowreturnthick-1-n {
+  background-position: -16px -64px;
+}
+
+.ui-icon-arrowreturnthick-1-e {
+  background-position: -32px -64px;
+}
+
+.ui-icon-arrowreturnthick-1-s {
+  background-position: -48px -64px;
+}
+
+.ui-icon-arrowreturn-1-w {
+  background-position: -64px -64px;
+}
+
+.ui-icon-arrowreturn-1-n {
+  background-position: -80px -64px;
+}
+
+.ui-icon-arrowreturn-1-e {
+  background-position: -96px -64px;
+}
+
+.ui-icon-arrowreturn-1-s {
+  background-position: -112px -64px;
+}
+
+.ui-icon-arrowrefresh-1-w {
+  background-position: -128px -64px;
+}
+
+.ui-icon-arrowrefresh-1-n {
+  background-position: -144px -64px;
+}
+
+.ui-icon-arrowrefresh-1-e {
+  background-position: -160px -64px;
+}
+
+.ui-icon-arrowrefresh-1-s {
+  background-position: -176px -64px;
+}
+
+.ui-icon-arrow-4 {
+  background-position: 0 -80px;
+}
+
+.ui-icon-arrow-4-diag {
+  background-position: -16px -80px;
+}
+
+.ui-icon-extlink {
+  background-position: -32px -80px;
+}
+
+.ui-icon-newwin {
+  background-position: -48px -80px;
+}
+
+.ui-icon-refresh {
+  background-position: -64px -80px;
+}
+
+.ui-icon-shuffle {
+  background-position: -80px -80px;
+}
+
+.ui-icon-transfer-e-w {
+  background-position: -96px -80px;
+}
+
+.ui-icon-transferthick-e-w {
+  background-position: -112px -80px;
+}
+
+.ui-icon-folder-collapsed {
+  background-position: 0 -96px;
+}
+
+.ui-icon-folder-open {
+  background-position: -16px -96px;
+}
+
+.ui-icon-document {
+  background-position: -32px -96px;
+}
+
+.ui-icon-document-b {
+  background-position: -48px -96px;
+}
+
+.ui-icon-note {
+  background-position: -64px -96px;
+}
+
+.ui-icon-mail-closed {
+  background-position: -80px -96px;
+}
+
+.ui-icon-mail-open {
+  background-position: -96px -96px;
+}
+
+.ui-icon-suitcase {
+  background-position: -112px -96px;
+}
+
+.ui-icon-comment {
+  background-position: -128px -96px;
+}
+
+.ui-icon-person {
+  background-position: -144px -96px;
+}
+
+.ui-icon-print {
+  background-position: -160px -96px;
+}
+
+.ui-icon-trash {
+  background-position: -176px -96px;
+}
+
+.ui-icon-locked {
+  background-position: -192px -96px;
+}
+
+.ui-icon-unlocked {
+  background-position: -208px -96px;
+}
+
+.ui-icon-bookmark {
+  background-position: -224px -96px;
+}
+
+.ui-icon-tag {
+  background-position: -240px -96px;
+}
+
+.ui-icon-home {
+  background-position: 0 -112px;
+}
+
+.ui-icon-flag {
+  background-position: -16px -112px;
+}
+
+.ui-icon-calendar {
+  background-position: -32px -112px;
+}
+
+.ui-icon-cart {
+  background-position: -48px -112px;
+}
+
+.ui-icon-pencil {
+  background-position: -64px -112px;
+}
+
+.ui-icon-clock {
+  background-position: -80px -112px;
+}
+
+.ui-icon-disk {
+  background-position: -96px -112px;
+}
+
+.ui-icon-calculator {
+  background-position: -112px -112px;
+}
+
+.ui-icon-zoomin {
+  background-position: -128px -112px;
+}
+
+.ui-icon-zoomout {
+  background-position: -144px -112px;
+}
+
+.ui-icon-search {
+  background-position: -160px -112px;
+}
+
+.ui-icon-wrench {
+  background-position: -176px -112px;
+}
+
+.ui-icon-gear {
+  background-position: -192px -112px;
+}
+
+.ui-icon-heart {
+  background-position: -208px -112px;
+}
+
+.ui-icon-star {
+  background-position: -224px -112px;
+}
+
+.ui-icon-link {
+  background-position: -240px -112px;
+}
+
+.ui-icon-cancel {
+  background-position: 0 -128px;
+}
+
+.ui-icon-plus {
+  background-position: -16px -128px;
+}
+
+.ui-icon-plusthick {
+  background-position: -32px -128px;
+}
+
+.ui-icon-minus {
+  background-position: -48px -128px;
+}
+
+.ui-icon-minusthick {
+  background-position: -64px -128px;
+}
+
+.ui-icon-close {
+  background-position: -80px -128px;
+}
+
+.ui-icon-closethick {
+  background-position: -96px -128px;
+}
+
+.ui-icon-key {
+  background-position: -112px -128px;
+}
+
+.ui-icon-lightbulb {
+  background-position: -128px -128px;
+}
+
+.ui-icon-scissors {
+  background-position: -144px -128px;
+}
+
+.ui-icon-clipboard {
+  background-position: -160px -128px;
+}
+
+.ui-icon-copy {
+  background-position: -176px -128px;
+}
+
+.ui-icon-contact {
+  background-position: -192px -128px;
+}
+
+.ui-icon-image {
+  background-position: -208px -128px;
+}
+
+.ui-icon-video {
+  background-position: -224px -128px;
+}
+
+.ui-icon-script {
+  background-position: -240px -128px;
+}
+
+.ui-icon-alert {
+  background-position: 0 -144px;
+}
+
+.ui-icon-info {
+  background-position: -16px -144px;
+}
+
+.ui-icon-notice {
+  background-position: -32px -144px;
+}
+
+.ui-icon-help {
+  background-position: -48px -144px;
+}
+
+.ui-icon-check {
+  background-position: -64px -144px;
+}
+
+.ui-icon-bullet {
+  background-position: -80px -144px;
+}
+
+.ui-icon-radio-on {
+  background-position: -96px -144px;
+}
+
+.ui-icon-radio-off {
+  background-position: -112px -144px;
+}
+
+.ui-icon-pin-w {
+  background-position: -128px -144px;
+}
+
+.ui-icon-pin-s {
+  background-position: -144px -144px;
+}
+
+.ui-icon-play {
+  background-position: 0 -160px;
+}
+
+.ui-icon-pause {
+  background-position: -16px -160px;
+}
+
+.ui-icon-seek-next {
+  background-position: -32px -160px;
+}
+
+.ui-icon-seek-prev {
+  background-position: -48px -160px;
+}
+
+.ui-icon-seek-end {
+  background-position: -64px -160px;
+}
+
+.ui-icon-seek-start {
+  background-position: -80px -160px;
+}
+
 /* ui-icon-seek-first is deprecated, use ui-icon-seek-start instead */
-.ui-icon-seek-first { background-position: -80px -160px; }
-.ui-icon-stop { background-position: -96px -160px; }
-.ui-icon-eject { background-position: -112px -160px; }
-.ui-icon-volume-off { background-position: -128px -160px; }
-.ui-icon-volume-on { background-position: -144px -160px; }
-.ui-icon-power { background-position: 0 -176px; }
-.ui-icon-signal-diag { background-position: -16px -176px; }
-.ui-icon-signal { background-position: -32px -176px; }
-.ui-icon-battery-0 { background-position: -48px -176px; }
-.ui-icon-battery-1 { background-position: -64px -176px; }
-.ui-icon-battery-2 { background-position: -80px -176px; }
-.ui-icon-battery-3 { background-position: -96px -176px; }
-.ui-icon-circle-plus { background-position: 0 -192px; }
-.ui-icon-circle-minus { background-position: -16px -192px; }
-.ui-icon-circle-close { background-position: -32px -192px; }
-.ui-icon-circle-triangle-e { background-position: -48px -192px; }
-.ui-icon-circle-triangle-s { background-position: -64px -192px; }
-.ui-icon-circle-triangle-w { background-position: -80px -192px; }
-.ui-icon-circle-triangle-n { background-position: -96px -192px; }
-.ui-icon-circle-arrow-e { background-position: -112px -192px; }
-.ui-icon-circle-arrow-s { background-position: -128px -192px; }
-.ui-icon-circle-arrow-w { background-position: -144px -192px; }
-.ui-icon-circle-arrow-n { background-position: -160px -192px; }
-.ui-icon-circle-zoomin { background-position: -176px -192px; }
-.ui-icon-circle-zoomout { background-position: -192px -192px; }
-.ui-icon-circle-check { background-position: -208px -192px; }
-.ui-icon-circlesmall-plus { background-position: 0 -208px; }
-.ui-icon-circlesmall-minus { background-position: -16px -208px; }
-.ui-icon-circlesmall-close { background-position: -32px -208px; }
-.ui-icon-squaresmall-plus { background-position: -48px -208px; }
-.ui-icon-squaresmall-minus { background-position: -64px -208px; }
-.ui-icon-squaresmall-close { background-position: -80px -208px; }
-.ui-icon-grip-dotted-vertical { background-position: 0 -224px; }
-.ui-icon-grip-dotted-horizontal { background-position: -16px -224px; }
-.ui-icon-grip-solid-vertical { background-position: -32px -224px; }
-.ui-icon-grip-solid-horizontal { background-position: -48px -224px; }
-.ui-icon-gripsmall-diagonal-se { background-position: -64px -224px; }
-.ui-icon-grip-diagonal-se { background-position: -80px -224px; }
+.ui-icon-seek-first {
+  background-position: -80px -160px;
+}
+
+.ui-icon-stop {
+  background-position: -96px -160px;
+}
+
+.ui-icon-eject {
+  background-position: -112px -160px;
+}
+
+.ui-icon-volume-off {
+  background-position: -128px -160px;
+}
+
+.ui-icon-volume-on {
+  background-position: -144px -160px;
+}
+
+.ui-icon-power {
+  background-position: 0 -176px;
+}
+
+.ui-icon-signal-diag {
+  background-position: -16px -176px;
+}
+
+.ui-icon-signal {
+  background-position: -32px -176px;
+}
 
+.ui-icon-battery-0 {
+  background-position: -48px -176px;
+}
+
+.ui-icon-battery-1 {
+  background-position: -64px -176px;
+}
+
+.ui-icon-battery-2 {
+  background-position: -80px -176px;
+}
+
+.ui-icon-battery-3 {
+  background-position: -96px -176px;
+}
+
+.ui-icon-circle-plus {
+  background-position: 0 -192px;
+}
+
+.ui-icon-circle-minus {
+  background-position: -16px -192px;
+}
+
+.ui-icon-circle-close {
+  background-position: -32px -192px;
+}
+
+.ui-icon-circle-triangle-e {
+  background-position: -48px -192px;
+}
+
+.ui-icon-circle-triangle-s {
+  background-position: -64px -192px;
+}
+
+.ui-icon-circle-triangle-w {
+  background-position: -80px -192px;
+}
+
+.ui-icon-circle-triangle-n {
+  background-position: -96px -192px;
+}
+
+.ui-icon-circle-arrow-e {
+  background-position: -112px -192px;
+}
+
+.ui-icon-circle-arrow-s {
+  background-position: -128px -192px;
+}
+
+.ui-icon-circle-arrow-w {
+  background-position: -144px -192px;
+}
+
+.ui-icon-circle-arrow-n {
+  background-position: -160px -192px;
+}
+
+.ui-icon-circle-zoomin {
+  background-position: -176px -192px;
+}
+
+.ui-icon-circle-zoomout {
+  background-position: -192px -192px;
+}
+
+.ui-icon-circle-check {
+  background-position: -208px -192px;
+}
+
+.ui-icon-circlesmall-plus {
+  background-position: 0 -208px;
+}
+
+.ui-icon-circlesmall-minus {
+  background-position: -16px -208px;
+}
+
+.ui-icon-circlesmall-close {
+  background-position: -32px -208px;
+}
+
+.ui-icon-squaresmall-plus {
+  background-position: -48px -208px;
+}
+
+.ui-icon-squaresmall-minus {
+  background-position: -64px -208px;
+}
+
+.ui-icon-squaresmall-close {
+  background-position: -80px -208px;
+}
+
+.ui-icon-grip-dotted-vertical {
+  background-position: 0 -224px;
+}
+
+.ui-icon-grip-dotted-horizontal {
+  background-position: -16px -224px;
+}
+
+.ui-icon-grip-solid-vertical {
+  background-position: -32px -224px;
+}
+
+.ui-icon-grip-solid-horizontal {
+  background-position: -48px -224px;
+}
+
+.ui-icon-gripsmall-diagonal-se {
+  background-position: -64px -224px;
+}
+
+.ui-icon-grip-diagonal-se {
+  background-position: -80px -224px;
+}
 
 /* Misc visuals
 ----------------------------------*/
@@ -1138,38 +1808,42 @@ body .ui-tooltip {
 .ui-corner-top,
 .ui-corner-left,
 .ui-corner-tl {
-	border-top-left-radius: 6px;
+  border-top-left-radius: 6px;
 }
+
 .ui-corner-all,
 .ui-corner-top,
 .ui-corner-right,
 .ui-corner-tr {
-	border-top-right-radius: 6px;
+  border-top-right-radius: 6px;
 }
+
 .ui-corner-all,
 .ui-corner-bottom,
 .ui-corner-left,
 .ui-corner-bl {
-	border-bottom-left-radius: 6px;
+  border-bottom-left-radius: 6px;
 }
+
 .ui-corner-all,
 .ui-corner-bottom,
 .ui-corner-right,
 .ui-corner-br {
-	border-bottom-right-radius: 6px;
+  border-bottom-right-radius: 6px;
 }
 
 /* Overlays */
 .ui-widget-overlay {
-	background: #eeeeee url(images/ui-bg_flat_0_eeeeee_40x100.png) 50% 50% repeat-x;
-	opacity: .8;
-	filter: Alpha(Opacity=80);
+  background: #eeeeee url(images/ui-bg_flat_0_eeeeee_40x100.png) 50% 50% repeat-x;
+  opacity: .8;
+  filter: Alpha(Opacity=80);
 }
+
 .ui-widget-shadow {
-	margin: -4px 0 0 -4px;
-	padding: 4px;
-	background: #aaaaaa url(images/ui-bg_flat_0_aaaaaa_40x100.png) 50% 50% repeat-x;
-	opacity: .6;
-	filter: Alpha(Opacity=60);
-	border-radius: 0px;
+  margin: -4px 0 0 -4px;
+  padding: 4px;
+  background: #aaaaaa url(images/ui-bg_flat_0_aaaaaa_40x100.png) 50% 50% repeat-x;
+  opacity: .6;
+  filter: Alpha(Opacity=60);
+  border-radius: 0px;
 }
diff --git a/azkaban-web-server/src/web/css/jquery-ui-timepicker-addon.css b/azkaban-web-server/src/web/css/jquery-ui-timepicker-addon.css
index becbd7b..19e6759 100644
--- a/azkaban-web-server/src/web/css/jquery-ui-timepicker-addon.css
+++ b/azkaban-web-server/src/web/css/jquery-ui-timepicker-addon.css
@@ -1,10 +1,39 @@
-.ui-timepicker-div .ui-widget-header { margin-bottom: 8px; }
-.ui-timepicker-div dl { text-align: left; }
-.ui-timepicker-div dl dt { height: 25px; margin-bottom: -25px; }
-.ui-timepicker-div dl dd { margin: 0 10px 10px 65px; }
-.ui-timepicker-div td { font-size: 90%; }
-.ui-tpicker-grid-label { background: none; border: none; margin: 0; padding: 0; }
-
-.ui-timepicker-rtl{ direction: rtl; }
-.ui-timepicker-rtl dl { text-align: right; }
-.ui-timepicker-rtl dl dd { margin: 0 65px 10px 10px; }
+.ui-timepicker-div .ui-widget-header {
+  margin-bottom: 8px;
+}
+
+.ui-timepicker-div dl {
+  text-align: left;
+}
+
+.ui-timepicker-div dl dt {
+  height: 25px;
+  margin-bottom: -25px;
+}
+
+.ui-timepicker-div dl dd {
+  margin: 0 10px 10px 65px;
+}
+
+.ui-timepicker-div td {
+  font-size: 90%;
+}
+
+.ui-tpicker-grid-label {
+  background: none;
+  border: none;
+  margin: 0;
+  padding: 0;
+}
+
+.ui-timepicker-rtl {
+  direction: rtl;
+}
+
+.ui-timepicker-rtl dl {
+  text-align: right;
+}
+
+.ui-timepicker-rtl dl dd {
+  margin: 0 65px 10px 10px;
+}
diff --git a/azkaban-web-server/src/web/js/azkaban/model/job-log.js b/azkaban-web-server/src/web/js/azkaban/model/job-log.js
index 7727d71..05b3c9e 100644
--- a/azkaban-web-server/src/web/js/azkaban/model/job-log.js
+++ b/azkaban-web-server/src/web/js/azkaban/model/job-log.js
@@ -17,12 +17,12 @@
 $.namespace('azkaban');
 
 azkaban.JobLogModel = Backbone.Model.extend({
-  initialize: function() {
+  initialize: function () {
     this.set("offset", 0);
     this.set("logData", "");
   },
 
-  refresh: function() {
+  refresh: function () {
     var requestURL = contextURL + "/executor";
     var finished = false;
 
@@ -30,7 +30,7 @@ azkaban.JobLogModel = Backbone.Model.extend({
       var requestData = {
         "execid": execId,
         "jobId": jobId,
-        "ajax":"fetchExecJobLogs",
+        "ajax": "fetchExecJobLogs",
         "offset": this.get("offset"),
         "length": 50000,
         "attempt": attempt
@@ -38,7 +38,7 @@ azkaban.JobLogModel = Backbone.Model.extend({
 
       var self = this;
 
-      var successHandler = function(data) {
+      var successHandler = function (data) {
         console.log("fetchLogs");
         if (data.error) {
           console.log(data.error);
@@ -59,7 +59,7 @@ azkaban.JobLogModel = Backbone.Model.extend({
         async: false,
         data: requestData,
         dataType: "json",
-        error: function(data) {
+        error: function (data) {
           console.log(data);
           finished = true;
         },
diff --git a/azkaban-web-server/src/web/js/azkaban/model/svg-graph.js b/azkaban-web-server/src/web/js/azkaban/model/svg-graph.js
index 580b747..c84c80b 100644
--- a/azkaban-web-server/src/web/js/azkaban/model/svg-graph.js
+++ b/azkaban-web-server/src/web/js/azkaban/model/svg-graph.js
@@ -17,19 +17,19 @@
 $.namespace('azkaban');
 
 azkaban.GraphModel = Backbone.Model.extend({
-  initialize: function() {
+  initialize: function () {
 
   },
 
   /*
    * Process and add data from JSON.
    */
-  addFlow: function(data) {
+  addFlow: function (data) {
     this.processFlowData(data);
     this.set({'data': data});
   },
 
-  processFlowData: function(data) {
+  processFlowData: function (data) {
     var nodes = {};
     var edges = new Array();
 
diff --git a/azkaban-web-server/src/web/js/azkaban/namespace.js b/azkaban-web-server/src/web/js/azkaban/namespace.js
index ba614ab..e1e48bf 100644
--- a/azkaban-web-server/src/web/js/azkaban/namespace.js
+++ b/azkaban-web-server/src/web/js/azkaban/namespace.js
@@ -1,13 +1,13 @@
-$.namespace = function() {
-  var a=arguments, o=window, i, j, d;
-  for (i=0; i<a.length; i=i+1) {
-    d=(""+a[i]).split(".");
+$.namespace = function () {
+  var a = arguments, o = window, i, j, d;
+  for (i = 0; i < a.length; i = i + 1) {
+    d = ("" + a[i]).split(".");
     //o=YAHOO;
     // YAHOO is implied, so it is ignored if it is included
-    for (j=0; j<d.length; j=j+1) {
-        o[d[j]]=o[d[j]] || {};
-        o=o[d[j]];
+    for (j = 0; j < d.length; j = j + 1) {
+      o[d[j]] = o[d[j]] || {};
+      o = o[d[j]];
     }
   }
   return o;
-};
\ No newline at end of file
+};
diff --git a/azkaban-web-server/src/web/js/azkaban/test/test.js b/azkaban-web-server/src/web/js/azkaban/test/test.js
index 7bd9730..6e746df 100644
--- a/azkaban-web-server/src/web/js/azkaban/test/test.js
+++ b/azkaban-web-server/src/web/js/azkaban/test/test.js
@@ -1,7 +1,7 @@
 function addClass(el, newClass) {
- if(el.className.indexOf(newClass) === -1) {
-   el.className += newClass;
- }
+  if (el.className.indexOf(newClass) === -1) {
+    el.className += newClass;
+  }
 }
 
 var rewire = require('rewire'),
@@ -12,85 +12,86 @@ var moment = require('moment-timezone');
 var chai = require('chai'),
     assert = chai.assert;
 
-
 //Some Test instances
-describe('addClass', function() {
- it('should add class into element', function() {
-   var element = { className: '' };
+describe('addClass', function () {
+  it('should add class into element', function () {
+    var element = {className: ''};
 
-   addClass(element, 'test-class');
+    addClass(element, 'test-class');
 
-   assert.equal(element.className, 'test-class');
- });
+    assert.equal(element.className, 'test-class');
+  });
 
- it('should not add a class which already exists in element', function() {
-   var element = { className: 'exists' };
+  it('should not add a class which already exists in element', function () {
+    var element = {className: 'exists'};
 
-   addClass(element, 'exists');
+    addClass(element, 'exists');
 
-   var numClasses = element.className.split(' ').length;
-   assert.equal(numClasses, 1);
- });
+    var numClasses = element.className.split(' ').length;
+    assert.equal(numClasses, 1);
+  });
 
- // it('should append new class after existing one', function() {
- //    var element = { className: 'exists' };
- //    addClass(element, 'new-class');
- //    var classes = element.className.split(' ');
- //    assert.equal(classes[1], 'new-class');
- //  });
+  // it('should append new class after existing one', function() {
+  //    var element = { className: 'exists' };
+  //    addClass(element, 'new-class');
+  //    var classes = element.className.split(' ');
+  //    assert.equal(classes[1], 'new-class');
+  //  });
 });
 
-
 //Test the functionality from Unix Cron to Quartz
-describe('CronTransformation', function() {
+describe('CronTransformation', function () {
 
   var testStrFromCronToQuartz = dateJs.__get__('transformFromQuartzToUnixCron');
 
-  it('should transfer correctly', function() {
+  it('should transfer correctly', function () {
 
-   assert.equal(testStrFromCronToQuartz('0 3 * * 5'), '0 3 * * 4');
-   assert.equal(testStrFromCronToQuartz('0 3 * * 5-7'), '0 3 * * 4-6');
-   assert.equal(testStrFromCronToQuartz('0 3 * * 1,3-5 2016'), '0 3 * * 0,2-4 2016');
-   assert.equal(testStrFromCronToQuartz('0 3 * * 5#3'), '0 3 * * 4#3');
-   assert.equal(testStrFromCronToQuartz('0 3 * * 5-7#3'), '0 3 * * 4-6#3');
-   assert.equal(testStrFromCronToQuartz('0 3 * * 1,3-5#3 2016'), '0 3 * * 0,2-4#3 2016');
+    assert.equal(testStrFromCronToQuartz('0 3 * * 5'), '0 3 * * 4');
+    assert.equal(testStrFromCronToQuartz('0 3 * * 5-7'), '0 3 * * 4-6');
+    assert.equal(testStrFromCronToQuartz('0 3 * * 1,3-5 2016'),
+        '0 3 * * 0,2-4 2016');
+    assert.equal(testStrFromCronToQuartz('0 3 * * 5#3'), '0 3 * * 4#3');
+    assert.equal(testStrFromCronToQuartz('0 3 * * 5-7#3'), '0 3 * * 4-6#3');
+    assert.equal(testStrFromCronToQuartz('0 3 * * 1,3-5#3 2016'),
+        '0 3 * * 0,2-4#3 2016');
   });
 });
 
 //Test the Validity of a Quartz Cron String
-describe('ValidateQuartzStr', function() {
+describe('ValidateQuartzStr', function () {
 
   var validateQuartzStr = dateJs.__get__('validateQuartzStr');
 
-  it('validate Quartz String corretly', function() {
+  it('validate Quartz String corretly', function () {
 
-   assert.equal(validateQuartzStr('0 3 * * 5'), 'NUM_FIELDS_ERROR');
-   assert.equal(validateQuartzStr('0 3 * *'), 'NUM_FIELDS_ERROR');
-   assert.equal(validateQuartzStr('0 3 * * 5 23 3 2017'), 'NUM_FIELDS_ERROR');
-   assert.equal(validateQuartzStr('0 3 * * 5 *'), 'DOW_DOM_STAR_ERROR');
-   assert.equal(validateQuartzStr('0 3 * * 5 *'), 'DOW_DOM_STAR_ERROR');
-   assert.equal(validateQuartzStr('0 3 * 5 5 * 2019'), 'DOW_DOM_STAR_ERROR');
-   assert.equal(validateQuartzStr('0 3 * 5 5 ? 2018'), 'VALID');
-   assert.equal(validateQuartzStr('0 3 * ? 5 FRI'), 'VALID');
-   assert.equal(validateQuartzStr('0 3 * ? 5 3-6'), 'VALID');
+    assert.equal(validateQuartzStr('0 3 * * 5'), 'NUM_FIELDS_ERROR');
+    assert.equal(validateQuartzStr('0 3 * *'), 'NUM_FIELDS_ERROR');
+    assert.equal(validateQuartzStr('0 3 * * 5 23 3 2017'), 'NUM_FIELDS_ERROR');
+    assert.equal(validateQuartzStr('0 3 * * 5 *'), 'DOW_DOM_STAR_ERROR');
+    assert.equal(validateQuartzStr('0 3 * * 5 *'), 'DOW_DOM_STAR_ERROR');
+    assert.equal(validateQuartzStr('0 3 * 5 5 * 2019'), 'DOW_DOM_STAR_ERROR');
+    assert.equal(validateQuartzStr('0 3 * 5 5 ? 2018'), 'VALID');
+    assert.equal(validateQuartzStr('0 3 * ? 5 FRI'), 'VALID');
+    assert.equal(validateQuartzStr('0 3 * ? 5 3-6'), 'VALID');
 
   });
 });
 
 //Test moment js and moment timezone js
-describe('momentJSTest', function() {
+describe('momentJSTest', function () {
 
-  var momentObj= moment();
+  var momentObj = moment();
 
-  it('momentJSTest', function() {
+  it('momentJSTest', function () {
     assert.equal(moment('20170411', 'YYYYMMDD').format('MM-YYYY'), '04-2017');
   });
 
-  it('momentTimezoneTest', function() {
+  it('momentTimezoneTest', function () {
 
     // Refer to https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/UTC
     // month: 3 represents April
     var dateTime = Date.UTC(2017, 3, 11, 11, 17, 0);
-    assert.equal(moment(dateTime).tz('America/Los_Angeles').format("LLL"), 'April 11, 2017 4:17 AM');
+    assert.equal(moment(dateTime).tz('America/Los_Angeles').format("LLL"),
+        'April 11, 2017 4:17 AM');
   });
 });
diff --git a/azkaban-web-server/src/web/js/azkaban/util/ajax.js b/azkaban-web-server/src/web/js/azkaban/util/ajax.js
index 1194d85..62c7b95 100644
--- a/azkaban-web-server/src/web/js/azkaban/util/ajax.js
+++ b/azkaban-web-server/src/web/js/azkaban/util/ajax.js
@@ -15,7 +15,7 @@
  */
 
 function ajaxCall(requestURL, data, callback) {
-  var successHandler = function(data) {
+  var successHandler = function (data) {
     if (data.error == "session") {
       // We need to relogin.
       var errorDialog = document.getElementById("invalid-session");
@@ -35,7 +35,7 @@ function ajaxCall(requestURL, data, callback) {
       }
     }
     else {
-      callback.call(this,data);
+      callback.call(this, data);
     }
   };
   $.get(requestURL, data, successHandler, "json");
@@ -43,7 +43,7 @@ function ajaxCall(requestURL, data, callback) {
 
 function executeFlow(executingData) {
   executeURL = contextURL + "/executor";
-  var successHandler = function(data) {
+  var successHandler = function (data) {
     if (data.error) {
       flowExecuteDialogView.hideExecutionOptionPanel();
       messageDialogView.show("Error Executing Flow", data.error);
@@ -51,10 +51,10 @@ function executeFlow(executingData) {
     else {
       flowExecuteDialogView.hideExecutionOptionPanel();
       messageDialogView.show("Flow submitted", data.message,
-        function() {
-          var redirectURL = contextURL + "/executor?execid=" + data.execid;
-          window.location.href = redirectURL;
-        }
+          function () {
+            var redirectURL = contextURL + "/executor?execid=" + data.execid;
+            window.location.href = redirectURL;
+          }
       );
     }
   };
@@ -63,13 +63,13 @@ function executeFlow(executingData) {
 }
 
 function fetchFlowInfo(model, projectName, flowId, execId) {
-  var fetchData = {"project": projectName, "ajax":"flowInfo", "flow":flowId};
+  var fetchData = {"project": projectName, "ajax": "flowInfo", "flow": flowId};
   if (execId) {
     fetchData.execid = execId;
   }
 
   var executeURL = contextURL + "/executor";
-  var successHandler = function(data) {
+  var successHandler = function (data) {
     if (data.error) {
       alert(data.error);
     }
@@ -88,7 +88,7 @@ function fetchFlowInfo(model, projectName, flowId, execId) {
         "concurrentOption": data.concurrentOptions,
         "pipelineLevel": data.pipelineLevel,
         "pipelineExecution": data.pipelineExecution,
-        "queueLevel":data.queueLevel
+        "queueLevel": data.queueLevel
       });
     }
     model.trigger("change:flowinfo");
@@ -108,11 +108,11 @@ function fetchFlow(model, projectName, flowId, sync) {
   sync = sync ? true : false;
   var managerUrl = contextURL + "/manager";
   var fetchData = {
-    "ajax" : "fetchflowgraph",
-    "project" : projectName,
-    "flow" : flowId
+    "ajax": "fetchflowgraph",
+    "project": projectName,
+    "flow": flowId
   };
-  var successHandler = function(data) {
+  var successHandler = function (data) {
     if (data.error) {
       alert(data.error);
     }
@@ -131,19 +131,19 @@ function fetchFlow(model, projectName, flowId, sync) {
       }
 
       for (var i = 0; i < data.edges.length; ++i) {
-         var edge = data.edges[i];
+        var edge = data.edges[i];
 
-         if (!nodeMap[edge.target].in) {
+        if (!nodeMap[edge.target].in) {
           nodeMap[edge.target].in = {};
-         }
-         var targetInMap = nodeMap[edge.target].in;
-         targetInMap[edge.from] = nodeMap[edge.from];
+        }
+        var targetInMap = nodeMap[edge.target].in;
+        targetInMap[edge.from] = nodeMap[edge.from];
 
-         if (!nodeMap[edge.from].out) {
+        if (!nodeMap[edge.from].out) {
           nodeMap[edge.from].out = {};
-         }
-         var sourceOutMap = nodeMap[edge.from].out;
-         sourceOutMap[edge.target] = nodeMap[edge.target];
+        }
+        var sourceOutMap = nodeMap[edge.from].out;
+        sourceOutMap[edge.target] = nodeMap[edge.target];
       }
 
       model.set({nodeMap: nodeMap});
@@ -160,14 +160,14 @@ function fetchFlow(model, projectName, flowId, sync) {
 }
 
 /**
-* Checks to see if a flow is running.
-*
-*/
+ * Checks to see if a flow is running.
+ *
+ */
 function flowExecutingStatus(projectName, flowId) {
   var requestURL = contextURL + "/executor";
 
   var executionIds;
-  var successHandler = function(data) {
+  var successHandler = function (data) {
     if (data.error == "session") {
       // We need to relogin.
       var errorDialog = document.getElementById("invalid-session");
@@ -198,7 +198,8 @@ function flowExecutingStatus(projectName, flowId) {
       "project": projectName,
       "flow": flowId
     },
-    error: function(data) {},
+    error: function (data) {
+    },
     success: successHandler
   });
 
diff --git a/azkaban-web-server/src/web/js/azkaban/util/common.js b/azkaban-web-server/src/web/js/azkaban/util/common.js
index a295218..016fc95 100644
--- a/azkaban-web-server/src/web/js/azkaban/util/common.js
+++ b/azkaban-web-server/src/web/js/azkaban/util/common.js
@@ -17,7 +17,7 @@
 function addClass(el, name) {
   if (!hasClass(el, name)) {
     var classes = el.getAttribute("class");
-    classes += classes ? ' ' + name : '' +name;
+    classes += classes ? ' ' + name : '' + name;
     el.setAttribute("class", classes);
   }
 }
@@ -25,7 +25,9 @@ function addClass(el, name) {
 function removeClass(el, name) {
   if (hasClass(el, name)) {
     var classes = el.getAttribute("class");
-    el.setAttribute("class", classes.replace(new RegExp('(\\s|^)'+name+'(\\s|$)'),' ').replace(/^\s+|\s+$/g, ''));
+    el.setAttribute("class",
+        classes.replace(new RegExp('(\\s|^)' + name + '(\\s|$)'), ' ').replace(
+            /^\s+|\s+$/g, ''));
   }
 }
 
@@ -34,7 +36,7 @@ function hasClass(el, name) {
   if (classes == null) {
     return false;
   }
-  return new RegExp('(\\s|^)'+name+'(\\s|$)').test(classes);
+  return new RegExp('(\\s|^)' + name + '(\\s|$)').test(classes);
 }
 
 function sizeStrToBytes(str) {
diff --git a/azkaban-web-server/src/web/js/azkaban/util/date.js b/azkaban-web-server/src/web/js/azkaban/util/date.js
index f9a31a4..655de09 100644
--- a/azkaban-web-server/src/web/js/azkaban/util/date.js
+++ b/azkaban-web-server/src/web/js/azkaban/util/date.js
@@ -16,7 +16,7 @@
 
 var TIMESTAMP_LENGTH = 13;
 
-var getDuration = function(startMs, endMs) {
+var getDuration = function (startMs, endMs) {
   if (startMs) {
     if (startMs == -1) {
       return "-";
@@ -32,7 +32,7 @@ var getDuration = function(startMs, endMs) {
   return "-";
 }
 
-var formatDuration = function(duration, millisecSig) {
+var formatDuration = function (duration, millisecSig) {
   var diff = duration;
   var seconds = Math.floor(diff / 1000);
 
@@ -63,7 +63,7 @@ var formatDuration = function(duration, millisecSig) {
   return days + "d " + hours + "h " + mins + "m";
 }
 
-var getDateFormat = function(date) {
+var getDateFormat = function (date) {
   var year = date.getFullYear();
   var month = getTwoDigitStr(date.getMonth() + 1);
   var day = getTwoDigitStr(date.getDate());
@@ -77,7 +77,7 @@ var getDateFormat = function(date) {
   return datestring;
 }
 
-var getHourMinSec = function(date) {
+var getHourMinSec = function (date) {
   var hours = getTwoDigitStr(date.getHours());
   var minutes = getTwoDigitStr(date.getMinutes());
   var second = getTwoDigitStr(date.getSeconds());
@@ -86,7 +86,7 @@ var getHourMinSec = function(date) {
   return timestring;
 }
 
-var getTwoDigitStr = function(value) {
+var getTwoDigitStr = function (value) {
   if (value < 10) {
     return "0" + value;
   }
@@ -95,16 +95,20 @@ var getTwoDigitStr = function(value) {
 }
 
 // Verify if a cron String meets the requirement of Quartz Cron Expression.
-var validateQuartzStr = function (str){
-  var res = str.split(" "), len=res.length;
+var validateQuartzStr = function (str) {
+  var res = str.split(" "), len = res.length;
 
   // A valid Quartz Cron Expression should have 6 or 7 fields.
-  if(len<6 || len>=8) return "NUM_FIELDS_ERROR";
+  if (len < 6 || len >= 8) {
+    return "NUM_FIELDS_ERROR";
+  }
 
   // Quartz currently doesn't support specifying both a day-of-week and a day-of-month value
   // (you must currently use the ‘?’ character in one of these fields).
   // http://www.quartz-scheduler.org/documentation/quartz-2.x/tutorials/crontrigger.html#notes
-  if(res[3] != '?' && res[5] != '?') return "DOW_DOM_STAR_ERROR";
+  if (res[3] != '?' && res[5] != '?') {
+    return "DOW_DOM_STAR_ERROR";
+  }
 
   //valid string
   return "VALID";
@@ -112,11 +116,11 @@ var validateQuartzStr = function (str){
 
 // Users enter values 1-7 for day of week, but UnixCronSyntax requires
 // day of week to be values 0-6. However, when using "#" syntax, we
-// do not want to apply the modulo operation to the number following "#" 
-var modifyStrToUnixCronSyntax = function (str){
+// do not want to apply the modulo operation to the number following "#"
+var modifyStrToUnixCronSyntax = function (str) {
   var res = str.split("#");
   res[0] = res[0].replace(/[0-7]/g, function upperToHyphenLower(match) {
-    return (parseInt(match)+6)%7;
+    return (parseInt(match) + 6) % 7;
   });
   return res.join("#");
 }
@@ -124,15 +128,16 @@ var modifyStrToUnixCronSyntax = function (str){
 // Unix Cron use 0-6 as Sun--Sat, but Quartz use 1-7. Due to later.js only supporting Unix Cron, we have to make this transition.
 // The detailed Unix Cron Syntax: https://en.wikipedia.org/wiki/Cron
 // The input is a 5 field string (without year) or 6 field String (with year).
-var transformFromQuartzToUnixCron = function (str){
+var transformFromQuartzToUnixCron = function (str) {
   var res = str.split(" ");
 
   // If the cron doesn't include year field
-  if(res.length == 5)
-    res[res.length -1] = modifyStrToUnixCronSyntax(res[res.length - 1]);
-  // If the cron Str does include year field
-  else if(res.length == 6)
+  if (res.length == 5) {
+    res[res.length - 1] = modifyStrToUnixCronSyntax(res[res.length - 1]);
+  }// If the cron Str does include year field
+  else if (res.length == 6) {
     res[res.length - 2] = modifyStrToUnixCronSyntax(res[res.length - 2]);
+  }
 
   return res.join(" ");
 }
diff --git a/azkaban-web-server/src/web/js/azkaban/util/flow-loader.js b/azkaban-web-server/src/web/js/azkaban/util/flow-loader.js
index 015f02a..b260fca 100644
--- a/azkaban-web-server/src/web/js/azkaban/util/flow-loader.js
+++ b/azkaban-web-server/src/web/js/azkaban/util/flow-loader.js
@@ -16,7 +16,7 @@
 
 var extendedViewPanels = {};
 var extendedDataModels = {};
-var openJobDisplayCallback = function(nodeId, flowId, evt) {
+var openJobDisplayCallback = function (nodeId, flowId, evt) {
   console.log("Open up data");
 
   /*
@@ -45,25 +45,27 @@ var openJobDisplayCallback = function(nodeId, flowId, evt) {
     */
 }
 
-var createNewPanel = function(node, model, evt) {
+var createNewPanel = function (node, model, evt) {
   var parentPath = node.parentPath;
 
-  var nodeInfoPanelID = parentPath ? parentPath + ":" + node.id + "-info" : node.id + "-info";
+  var nodeInfoPanelID = parentPath ? parentPath + ":" + node.id + "-info"
+      : node.id + "-info";
   var cloneStuff = $("#flowInfoBase").clone();
   cloneStuff.data = node;
   $(cloneStuff).attr("id", nodeInfoPanelID);
   $("#flowInfoBase").before(cloneStuff);
 
-  var backboneView = new azkaban.FlowExtendedViewPanel({el:cloneStuff, model: model});
+  var backboneView = new azkaban.FlowExtendedViewPanel(
+      {el: cloneStuff, model: model});
   node.panel = backboneView;
   backboneView.showExtendedView(evt);
 }
 
-var closeAllSubDisplays = function() {
+var closeAllSubDisplays = function () {
   $(".flowExtendedView").hide();
 }
 
-var nodeClickCallback = function(event, model, node) {
+var nodeClickCallback = function (event, model, node) {
   console.log("Node clicked callback");
 
   var target = event.currentTarget;
@@ -71,95 +73,184 @@ var nodeClickCallback = function(event, model, node) {
   var flowId = node.parent.flow;
   var jobId = node.id;
 
-  var requestURL = contextURL + "/manager?project=" + projectName + "&flow=" + flowId + "&job=" + jobId;
+  var requestURL = contextURL + "/manager?project=" + projectName + "&flow="
+      + flowId + "&job=" + jobId;
   var menu = [];
 
   if (type == "flow") {
-    var flowRequestURL = contextURL + "/manager?project=" + projectName + "&flow=" + node.flowId;
+    var flowRequestURL = contextURL + "/manager?project=" + projectName
+        + "&flow=" + node.flowId;
     if (node.expanded) {
-      menu = [{title: "Collapse Flow...", callback: function() {model.trigger("collapseFlow", node);}}];
+      menu = [{
+        title: "Collapse Flow...", callback: function () {
+          model.trigger("collapseFlow", node);
+        }
+      }];
     }
     else {
-      menu = [{title: "Expand Flow...", callback: function() {model.trigger("expandFlow", node);}}];
+      menu = [{
+        title: "Expand Flow...", callback: function () {
+          model.trigger("expandFlow", node);
+        }
+      }];
     }
 
     $.merge(menu, [
-    //  {title: "View Properties...", callback: function() {openJobDisplayCallback(jobId, flowId, event)}},
+      //  {title: "View Properties...", callback: function() {openJobDisplayCallback(jobId, flowId, event)}},
       {break: 1},
-      {title: "Open Flow...", callback: function() {window.location.href=flowRequestURL;}},
-      {title: "Open Flow in New Window...", callback: function() {window.open(flowRequestURL);}},
+      {
+        title: "Open Flow...", callback: function () {
+        window.location.href = flowRequestURL;
+      }
+      },
+      {
+        title: "Open Flow in New Window...", callback: function () {
+        window.open(flowRequestURL);
+      }
+      },
       {break: 1},
-      {title: "Open Properties...", callback: function() {window.location.href=requestURL;}},
-      {title: "Open Properties in New Window...", callback: function() {window.open(requestURL);}},
+      {
+        title: "Open Properties...", callback: function () {
+        window.location.href = requestURL;
+      }
+      },
+      {
+        title: "Open Properties in New Window...", callback: function () {
+        window.open(requestURL);
+      }
+      },
       {break: 1},
-      {title: "Center Flow", callback: function() {model.trigger("centerNode", node);}}
+      {
+        title: "Center Flow", callback: function () {
+        model.trigger("centerNode", node);
+      }
+      }
     ]);
   }
   else {
     menu = [
-    //  {title: "View Properties...", callback: function() {openJobDisplayCallback(jobId, flowId, event)}},
-    //  {break: 1},
-      {title: "Open Job...", callback: function() {window.location.href=requestURL;}},
-      {title: "Open Job in New Window...", callback: function() {window.open(requestURL);}},
+      //  {title: "View Properties...", callback: function() {openJobDisplayCallback(jobId, flowId, event)}},
+      //  {break: 1},
+      {
+        title: "Open Job...", callback: function () {
+        window.location.href = requestURL;
+      }
+      },
+      {
+        title: "Open Job in New Window...", callback: function () {
+        window.open(requestURL);
+      }
+      },
       {break: 1},
-      {title: "Center Job", callback: function() {model.trigger("centerNode", node)}}
+      {
+        title: "Center Job", callback: function () {
+        model.trigger("centerNode", node)
+      }
+      }
     ];
   }
   contextMenuView.show(event, menu);
 }
 
-var jobClickCallback = function(event, model, node) {
+var jobClickCallback = function (event, model, node) {
   console.log("Node clicked callback");
   var target = event.currentTarget;
   var type = node.type;
   var flowId = node.parent.flow;
   var jobId = node.id;
 
-  var requestURL = contextURL + "/manager?project=" + projectName + "&flow=" + flowId + "&job=" + node.id;
+  var requestURL = contextURL + "/manager?project=" + projectName + "&flow="
+      + flowId + "&job=" + node.id;
 
   var menu;
   if (type == "flow") {
-    var flowRequestURL = contextURL + "/manager?project=" + projectName + "&flow=" + node.flowId;
+    var flowRequestURL = contextURL + "/manager?project=" + projectName
+        + "&flow=" + node.flowId;
     menu = [
-    //  {title: "View Properties...", callback: function() {openJobDisplayCallback(jobId, flowId, event)}},
-    //  {break: 1},
-      {title: "Open Flow...", callback: function() {window.location.href=flowRequestURL;}},
-      {title: "Open Flow in New Window...", callback: function() {window.open(flowRequestURL);}},
+      //  {title: "View Properties...", callback: function() {openJobDisplayCallback(jobId, flowId, event)}},
+      //  {break: 1},
+      {
+        title: "Open Flow...", callback: function () {
+        window.location.href = flowRequestURL;
+      }
+      },
+      {
+        title: "Open Flow in New Window...", callback: function () {
+        window.open(flowRequestURL);
+      }
+      },
       {break: 1},
-      {title: "Open Properties...", callback: function() {window.location.href=requestURL;}},
-      {title: "Open Properties in New Window...", callback: function() {window.open(requestURL);}},
+      {
+        title: "Open Properties...", callback: function () {
+        window.location.href = requestURL;
+      }
+      },
+      {
+        title: "Open Properties in New Window...", callback: function () {
+        window.open(requestURL);
+      }
+      },
       {break: 1},
-      {title: "Center Flow", callback: function() {model.trigger("centerNode", node)}}
+      {
+        title: "Center Flow", callback: function () {
+        model.trigger("centerNode", node)
+      }
+      }
     ];
   }
   else {
     menu = [
-    //  {title: "View Job...", callback: function() {openJobDisplayCallback(jobId, flowId, event)}},
-    //  {break: 1},
-      {title: "Open Job...", callback: function() {window.location.href=requestURL;}},
-      {title: "Open Job in New Window...", callback: function() {window.open(requestURL);}},
+      //  {title: "View Job...", callback: function() {openJobDisplayCallback(jobId, flowId, event)}},
+      //  {break: 1},
+      {
+        title: "Open Job...", callback: function () {
+        window.location.href = requestURL;
+      }
+      },
+      {
+        title: "Open Job in New Window...", callback: function () {
+        window.open(requestURL);
+      }
+      },
       {break: 1},
-      {title: "Center Job", callback: function() {graphModel.trigger("centerNode", node)}}
+      {
+        title: "Center Job", callback: function () {
+        graphModel.trigger("centerNode", node)
+      }
+      }
     ];
   }
   contextMenuView.show(event, menu);
 }
 
-var edgeClickCallback = function(event, model) {
+var edgeClickCallback = function (event, model) {
   console.log("Edge clicked callback");
 }
 
-var graphClickCallback = function(event, model) {
+var graphClickCallback = function (event, model) {
   console.log("Graph clicked callback");
   var data = model.get("data");
   var flowId = data.flow;
-  var requestURL = contextURL + "/manager?project=" + projectName + "&flow=" + flowId;
+  var requestURL = contextURL + "/manager?project=" + projectName + "&flow="
+      + flowId;
 
   var menu = [
-    {title: "Open Flow...", callback: function() {window.location.href=requestURL;}},
-    {title: "Open Flow in New Window...", callback: function() {window.open(requestURL);}},
+    {
+      title: "Open Flow...", callback: function () {
+      window.location.href = requestURL;
+    }
+    },
+    {
+      title: "Open Flow in New Window...", callback: function () {
+      window.open(requestURL);
+    }
+    },
     {break: 1},
-    {title: "Center Graph", callback: function() {model.trigger("resetPanZoom");}}
+    {
+      title: "Center Graph", callback: function () {
+      model.trigger("resetPanZoom");
+    }
+    }
   ];
 
   contextMenuView.show(event, menu);
diff --git a/azkaban-web-server/src/web/js/azkaban/util/job-status.js b/azkaban-web-server/src/web/js/azkaban/util/job-status.js
index fd61693..c6c2fa0 100644
--- a/azkaban-web-server/src/web/js/azkaban/util/job-status.js
+++ b/azkaban-web-server/src/web/js/azkaban/util/job-status.js
@@ -14,7 +14,9 @@
  * the License.
  */
 
-var statusList = ["FAILED", "FAILED_FINISHING", "SUCCEEDED", "RUNNING", "WAITING", "KILLED", "DISABLED", "READY", "CANCELLED", "UNKNOWN", "PAUSED", "SKIPPED", "QUEUED"];
+var statusList = ["FAILED", "FAILED_FINISHING", "SUCCEEDED", "RUNNING",
+  "WAITING", "KILLED", "DISABLED", "READY", "CANCELLED", "UNKNOWN", "PAUSED",
+  "SKIPPED", "QUEUED"];
 var statusStringMap = {
   "QUEUED": "Queued",
   "SKIPPED": "Skipped",
diff --git a/azkaban-web-server/src/web/js/azkaban/util/layout.js b/azkaban-web-server/src/web/js/azkaban/util/layout.js
index acdb832..137a067 100644
--- a/azkaban-web-server/src/web/js/azkaban/util/layout.js
+++ b/azkaban-web-server/src/web/js/azkaban/util/layout.js
@@ -16,15 +16,15 @@
 
 var maxTextSize = 32;
 var reductionSize = 26;
-var degreeRatio = 1/8;
+var degreeRatio = 1 / 8;
 var maxHeight = 200;
 var cornerGap = 10;
 
-var idSort = function(a, b) {
-  if ( a.id < b.id ) {
+var idSort = function (a, b) {
+  if (a.id < b.id) {
     return -1;
   }
-  else if ( a.id > b.id ) {
+  else if (a.id > b.id) {
     return 1;
   }
   else {
@@ -36,7 +36,7 @@ function prepareLayout(nodes, hmargin, layers, nodeMap) {
   var maxLayer = 0;
   var nodeQueue = new Array();
   // Find start layers first
-  for (var i=0; i < nodes.length; ++i) {
+  for (var i = 0; i < nodes.length; ++i) {
     var node = nodes[i];
     if (node.inNodes) {
       // We sort here. Why? To keep the node drawing consistent
@@ -53,7 +53,7 @@ function prepareLayout(nodes, hmargin, layers, nodeMap) {
   // calculate level
   // breath first search the sucker
   var index = 0;
-  while(index < nodeQueue.length) {
+  while (index < nodeQueue.length) {
     var node = nodeQueue[index];
     if (node.inNodes) {
       var level = 0;
@@ -76,12 +76,22 @@ function prepareLayout(nodes, hmargin, layers, nodeMap) {
 
   // Assign to layers
   for (var i = 0; i < nodes.length; ++i) {
-    var width = nodes[i].width ? nodes[i].width : nodes[i].label.length * 11.5 + 4;
+    var width = nodes[i].width ? nodes[i].width : nodes[i].label.length * 11.5
+        + 4;
     var height = nodes[i].height ? nodes[i].height : 1;
-    var node = { id: nodes[i].id, node: nodes[i], level: nodes[i].level, in:[], out:[], width: width + hmargin, x:0, height:height };
+    var node = {
+      id: nodes[i].id,
+      node: nodes[i],
+      level: nodes[i].level,
+      in: [],
+      out: [],
+      width: width + hmargin,
+      x: 0,
+      height: height
+    };
     nodeMap[nodes[i].id] = node;
     maxLayer = Math.max(node.level, maxLayer);
-    if(!layers[node.level]) {
+    if (!layers[node.level]) {
       layers[node.level] = [];
     }
 
@@ -110,7 +120,7 @@ function layoutGraph(nodes, edges, hmargin) {
 
   // Create dummy nodes
   var edgeDummies = {};
-  for (var i=0; i < edges.length; ++i ) {
+  for (var i = 0; i < edges.length; ++i) {
     var edge = edges[i];
     var src = edges[i].from;
     var dest = edges[i].to;
@@ -125,7 +135,16 @@ function layoutGraph(nodes, edges, hmargin) {
     var guides = [];
 
     for (var j = srcNode.level + 1; j < destNode.level; ++j) {
-      var dummyNode = {level: j, in: [], x: lastNode.x, out: [], realSrc: srcNode, realDest: destNode, width: 10, height: 10};
+      var dummyNode = {
+        level: j,
+        in: [],
+        x: lastNode.x,
+        out: [],
+        realSrc: srcNode,
+        realDest: destNode,
+        width: 10,
+        height: 10
+      };
       layers[j].push(dummyNode);
       dummyNode.in.push(lastNode);
       lastNode.out.push(dummyNode);
@@ -144,7 +163,7 @@ function layoutGraph(nodes, edges, hmargin) {
 
   spreadLayerSmart(layers[maxLayer]);
   sort(layers[maxLayer]);
-  for (var i=maxLayer - 1; i >=0; --i) {
+  for (var i = maxLayer - 1; i >= 0; --i) {
     uncrossWithOut(layers[i]);
     sort(layers[i]);
 
@@ -164,7 +183,7 @@ function layoutGraph(nodes, edges, hmargin) {
   }
 
   // Uncross down
-  for (var i=1; i <= maxLayer; ++i) {
+  for (var i = 1; i <= maxLayer; ++i) {
     uncrossWithIn(layers[i]);
     sort(layers[i]);
     spreadLayerSmart(layers[i]);
@@ -194,15 +213,15 @@ function layoutGraph(nodes, edges, hmargin) {
 
       var guides = [];
       var dummies = edgeDummies[edgeId];
-      for (var j=0; j< dummies.length; ++j) {
+      for (var j = 0; j < dummies.length; ++j) {
         var point = {x: dummies[j].x, y: dummies[j].y};
         guides.push(point);
 
-        var nextX = j == dummies.length - 1 ? destX: dummies[j + 1].x;
+        var nextX = j == dummies.length - 1 ? destX : dummies[j + 1].x;
         if (point.x != prevX && point.x != nextX) {
           // Add gap
           if ((point.x > prevX) == (point.x > nextX)) {
-            guides.push({x: point.x, y:point.y + cornerGap});
+            guides.push({x: point.x, y: point.y + cornerGap});
           }
         }
         prevX = point.x;
@@ -231,7 +250,7 @@ function spreadLayerSmart(layer) {
   var totalWidth = layer[0].width;
   var count = 1;
 
-  for (var i = 1; i < layer.length; ++i ) {
+  for (var i = 1; i < layer.length; ++i) {
     var prevRange = ranges[ranges.length - 1];
     var delta = layer[i].x - prevRange.x;
 
@@ -263,21 +282,21 @@ function spreadLayerSmart(layer) {
     endIndex = 1;
   }
   else if ((ranges.length % 2) == 1) {
-    var index = Math.ceil(ranges.length/2);
+    var index = Math.ceil(ranges.length / 2);
     startIndex = index - 1;
     endIndex = index + 1;
   }
   else {
-    var e = ranges.length/2;
+    var e = ranges.length / 2;
     var s = e - 1;
 
-    var crossPointS = ranges[s].x + ranges[s].width/2;
-    var crossPointE = ranges[e].x - ranges[e].width/2;
+    var crossPointS = ranges[s].x + ranges[s].width / 2;
+    var crossPointE = ranges[e].x - ranges[e].width / 2;
 
     if (crossPointS > crossPointE) {
-      var midPoint = (ranges[s].x + ranges[e].x)/2;
-      ranges[s].x = midPoint - ranges[s].width/2;
-      ranges[e].x = midPoint + ranges[e].width/2;
+      var midPoint = (ranges[s].x + ranges[e].x) / 2;
+      ranges[s].x = midPoint - ranges[s].width / 2;
+      ranges[e].x = midPoint + ranges[e].width / 2;
     }
 
     startIndex = s - 1;
@@ -286,8 +305,8 @@ function spreadLayerSmart(layer) {
 
   for (var i = startIndex; i >= 0; --i) {
     var range = ranges[i];
-    var crossPointS = range.x + range.width/2;
-    var crossPointE = ranges[i + 1].x - ranges[i + 1].width/2;
+    var crossPointS = range.x + range.width / 2;
+    var crossPointE = ranges[i + 1].x - ranges[i + 1].width / 2;
     if (crossPointE < crossPointS) {
       range.x -= crossPointS - crossPointE;
     }
@@ -295,8 +314,8 @@ function spreadLayerSmart(layer) {
 
   for (var i = endIndex; i < ranges.length; ++i) {
     var range = ranges[i];
-    var crossPointE = range.x - range.width/2;
-    var crossPointS = ranges[i - 1].x + ranges[i - 1].width/2;
+    var crossPointE = range.x - range.width / 2;
+    var crossPointS = ranges[i - 1].x + ranges[i - 1].width / 2;
     if (crossPointE < crossPointS) {
       range.x += crossPointS - crossPointE;
     }
@@ -308,9 +327,9 @@ function spreadLayerSmart(layer) {
       layer[range.start].x = range.x;
     }
     else {
-      var start = range.x - range.width/2;
-      for (var j=range.start;j <=range.end; ++j) {
-        layer[j].x = start + layer[j].width/2;
+      var start = range.x - range.width / 2;
+      for (var j = range.start; j <= range.end; ++j) {
+        layer[j].x = start + layer[j].width / 2;
         start += layer[j].width;
       }
     }
@@ -321,21 +340,21 @@ function spaceVertically(layers, maxLayer) {
   var startY = 0;
   var startLayer = layers[0];
   var startMaxHeight = 1;
-  for (var i=0; i < startLayer.length; ++i) {
+  for (var i = 0; i < startLayer.length; ++i) {
     startLayer[i].y = startY;
     startMaxHeight = Math.max(startMaxHeight, startLayer[i].height);
   }
 
   var minHeight = 40;
-  for (var a=1; a <= maxLayer; ++a) {
+  for (var a = 1; a <= maxLayer; ++a) {
     var maxDelta = 0;
     var layer = layers[a];
 
     var layerMaxHeight = 1;
-    for (var i=0; i < layer.length; ++i) {
+    for (var i = 0; i < layer.length; ++i) {
       layerMaxHeight = Math.max(layerMaxHeight, layer[i].height);
 
-      for (var j=0; j < layer[i].in.length; ++j) {
+      for (var j = 0; j < layer[i].in.length; ++j) {
         var upper = layer[i].in[j];
         var delta = Math.abs(upper.x - layer[i].x);
         maxDelta = Math.max(maxDelta, delta);
@@ -343,14 +362,14 @@ function spaceVertically(layers, maxLayer) {
     }
 
     console.log("Max " + maxDelta);
-    var calcHeight = maxDelta*degreeRatio;
+    var calcHeight = maxDelta * degreeRatio;
 
-    var newMinHeight = minHeight + startMaxHeight/2 + layerMaxHeight / 2;
+    var newMinHeight = minHeight + startMaxHeight / 2 + layerMaxHeight / 2;
     startMaxHeight = layerMaxHeight;
 
     startY += Math.max(calcHeight, newMinHeight);
-    for (var i=0; i < layer.length; ++i) {
-      layer[i].y=startY;
+    for (var i = 0; i < layer.length; ++i) {
+      layer[i].y = startY;
     }
   }
 }
@@ -367,7 +386,7 @@ function findAverage(nodes) {
   for (var i = 0; i < nodes.length; ++i) {
     sum += nodes[i].x;
   }
-  return sum/nodes.length;
+  return sum / nodes.length;
 }
 
 function uncrossWithOut(layer) {
@@ -378,7 +397,7 @@ function uncrossWithOut(layer) {
 }
 
 function sort(layer) {
-  layer.sort(function(a, b) {
+  layer.sort(function (a, b) {
     return a.x - b.x;
   });
 }
diff --git a/azkaban-web-server/src/web/js/azkaban/util/schedule.js b/azkaban-web-server/src/web/js/azkaban/util/schedule.js
index de3da39..fc6e645 100644
--- a/azkaban-web-server/src/web/js/azkaban/util/schedule.js
+++ b/azkaban-web-server/src/web/js/azkaban/util/schedule.js
@@ -19,9 +19,9 @@ function removeSched(scheduleId) {
   var redirectURL = contextURL + "/schedule"
   var requestData = {
     "action": "removeSched",
-    "scheduleId":scheduleId
+    "scheduleId": scheduleId
   };
-  var successHandler = function(data) {
+  var successHandler = function (data) {
     if (data.error) {
       $('#errorMsg').text(data.error);
     }
@@ -39,7 +39,7 @@ function removeSla(scheduleId) {
     "action": "removeSla",
     "scheduleId": scheduleId
   };
-  var successHandler = function(data) {
+  var successHandler = function (data) {
     if (data.error) {
       $('#errorMsg').text(data.error)
     }
diff --git a/azkaban-web-server/src/web/js/azkaban/util/svg-navigate.js b/azkaban-web-server/src/web/js/azkaban/util/svg-navigate.js
index dbe16ce..5dd2938 100644
--- a/azkaban-web-server/src/web/js/azkaban/util/svg-navigate.js
+++ b/azkaban-web-server/src/web/js/azkaban/util/svg-navigate.js
@@ -14,8 +14,8 @@
  * the License.
  */
 
-(function($) {
-  var mouseUp = function(evt) {
+(function ($) {
+  var mouseUp = function (evt) {
     if (evt.button > 1) {
       return;
     }
@@ -25,7 +25,7 @@
     target.mDown = false;
   }
 
-  var mouseDown = function(evt) {
+  var mouseDown = function (evt) {
     if (evt.button > 1) {
       return;
     }
@@ -36,14 +36,14 @@
     target.mDown = true;
   }
 
-  var mouseOut = function(evt) {
+  var mouseOut = function (evt) {
     var target = evt.target;
     target.mx = evt.clientX;
     target.my = evt.clientY;
     target.mDown = false;
   }
 
-  var mouseMove = function(evt) {
+  var mouseMove = function (evt) {
     var target = evt.target;
     if (target.mDown) {
       var dx = evt.clientX - target.mx;
@@ -58,11 +58,11 @@
     target.my = evt.clientY;
   }
 
-  var mouseDrag = function(evt) {
+  var mouseDrag = function (evt) {
     translateDeltaGraph(evt.target, evt.dragX, evt.dragY);
   }
 
-  var mouseScrolled = function(evt) {
+  var mouseScrolled = function (evt) {
     if (!evt) {
       evt = window.event;
     }
@@ -115,7 +115,7 @@
     scaleGraph(target, scale, x, y);
   }
 
-  this.boundZoomLevel = function(target, level) {
+  this.boundZoomLevel = function (target, level) {
     if (level >= target.settings.zoomNumLevels) {
       return target.settings.zoomNumLevels - 1;
     }
@@ -126,7 +126,7 @@
     return level;
   }
 
-  this.scaleGraph = function(target, scale, x, y) {
+  this.scaleGraph = function (target, scale, x, y) {
     var sfactor = scale / target.scale;
     target.scale = scale;
 
@@ -139,7 +139,7 @@
     retransform(target);
   }
 
-  this.translateDeltaGraph = function(target, x, y) {
+  this.translateDeltaGraph = function (target, x, y) {
     target.translateX += x;
     target.translateY += y;
     if (target.model) {
@@ -148,11 +148,12 @@
     retransform(target);
   }
 
-  this.retransform = function(target) {
+  this.retransform = function (target) {
     var gs = target.childNodes;
 
-    var transformString = "translate(" + target.translateX + "," + target.translateY +
-                ") scale(" + target.scale + ")";
+    var transformString = "translate(" + target.translateX + ","
+        + target.translateY +
+        ") scale(" + target.scale + ")";
 
     for (var i = 0; i < gs.length; ++i) {
       var g = gs[i];
@@ -176,7 +177,7 @@
     }
   }
 
-  this.resetTransform = function(target) {
+  this.resetTransform = function (target) {
     var settings = target.settings;
     target.translateX = settings.x;
     target.translateY = settings.y;
@@ -194,8 +195,8 @@
       var aspectRatioDiv = divHeight / divWidth;
 
       var scale = aspectRatioGraph > aspectRatioDiv
-              ? (divHeight / height) * factor
-              : (divWidth / width) * factor;
+          ? (divHeight / height) * factor
+          : (divWidth / width) * factor;
       target.scale = scale;
     }
     else {
@@ -204,7 +205,7 @@
     }
   }
 
-  this.animateTransform = function(target, scale, x, y, duration) {
+  this.animateTransform = function (target, scale, x, y, duration) {
     var zoomLevel = calculateZoomLevel(scale, target.zoomLevels);
     target.fromScaleLevel = target.zoomIndex;
     target.toScaleLevel = zoomLevel;
@@ -220,17 +221,18 @@
     this.animateTick(target);
   }
 
-  this.animateTick = function(target) {
+  this.animateTick = function (target) {
     var time = new Date().getTime();
     if (time < target.endTime) {
       var timeDiff = time - target.startTime;
       var progress = timeDiff / (target.endTime - target.startTime);
 
-      target.scale = (target.toScale - target.fromScale) * progress + target.fromScale;
+      target.scale = (target.toScale - target.fromScale) * progress
+          + target.fromScale;
       target.translateX = (target.toX - target.fromX) * progress + target.fromX;
       target.translateY = (target.toY - target.fromY) * progress + target.fromY;
       retransform(target);
-      setTimeout(function() {
+      setTimeout(function () {
         this.animateTick(target)
       }, 1);
     }
@@ -243,7 +245,7 @@
     }
   }
 
-  this.calculateZoomScale = function(scaleLevel, numLevels, points) {
+  this.calculateZoomScale = function (scaleLevel, numLevels, points) {
     if (scaleLevel <= 0) {
       return points[0];
     }
@@ -259,7 +261,7 @@
     return b * (points[ceilingIdx] - points[floorIdx]) + points[floorIdx];
   }
 
-  this.calculateZoomLevel = function(scale, zoomLevels) {
+  this.calculateZoomLevel = function (scale, zoomLevels) {
     if (scale >= zoomLevels[zoomLevels.length - 1]) {
       return zoomLevels.length - 1;
     }
@@ -284,30 +286,30 @@
   }
 
   var methods = {
-    init : function(options) {
+    init: function (options) {
       var settings = {
-        x : 0,
-        y : 0,
-        x2 : 0,
-        y2 : 0,
-        minX : -1000,
-        minY : -1000,
-        maxX : 1000,
-        maxY : 1000,
-        zoomIndex : 24,
-        zoomPoints : [ 0.1, 0.14, 0.2, 0.4, 0.8, 1, 1.6, 2.4, 4, 8, 16 ],
-        zoomNumLevels : 48
+        x: 0,
+        y: 0,
+        x2: 0,
+        y2: 0,
+        minX: -1000,
+        minY: -1000,
+        maxX: 1000,
+        maxY: 1000,
+        zoomIndex: 24,
+        zoomPoints: [0.1, 0.14, 0.2, 0.4, 0.8, 1, 1.6, 2.4, 4, 8, 16],
+        zoomNumLevels: 48
       };
       if (options) {
         $.extend(settings, options);
       }
-      return this.each(function() {
+      return this.each(function () {
         var $this = $(this);
         this.settings = settings;
         this.marker = true;
 
         if (window.addEventListener) {
-          this.addEventListener('wheel', mouseScrolled,false);
+          this.addEventListener('wheel', mouseScrolled, false);
         }
         this.onmousewheel = mouseScrolled;
         this.onmousedown = mouseDown;
@@ -316,14 +318,15 @@
         this.onmouseout = mouseOut;
 
         this.zoomLevels = new Array(settings.zoomNumLevels);
-        for ( var i = 0; i < settings.zoomNumLevels; ++i) {
-          var scale = calculateZoomScale(i, settings.zoomNumLevels, settings.zoomPoints);
+        for (var i = 0; i < settings.zoomNumLevels; ++i) {
+          var scale = calculateZoomScale(i, settings.zoomNumLevels,
+              settings.zoomPoints);
           this.zoomLevels[i] = scale;
         }
         resetTransform(this);
       });
     },
-    transformToBox : function(arguments) {
+    transformToBox: function (arguments) {
       var $this = $(this);
       var target = ($this)[0];
       var x = arguments.x;
@@ -341,8 +344,8 @@
       var aspectRatioDiv = divHeight / divWidth;
 
       var scale = aspectRatioGraph > aspectRatioDiv
-              ? (divHeight / height) * factor
-              : (divWidth / width) * factor;
+          ? (divHeight / height) * factor
+          : (divWidth / width) * factor;
 
       if (arguments.maxScale) {
         if (scale > arguments.maxScale) {
@@ -369,7 +372,7 @@
 
       animateTransform(target, scale, sx, sy, duration);
     },
-    attachNavigateModel : function(arguments) {
+    attachNavigateModel: function (arguments) {
       var $this = $(this);
       var target = ($this)[0];
       target.model = arguments;
@@ -386,16 +389,17 @@
         obj.y2 = obj.y1 + obj.width * obj.scale;
 
         target.model.set({
-          transform : obj
+          transform: obj
         });
       }
     }
   };
 
   // Main Constructor
-  $.fn.svgNavigate = function(method) {
+  $.fn.svgNavigate = function (method) {
     if (methods[method]) {
-      return methods[method].apply(this, Array.prototype.slice.call(arguments, 1));
+      return methods[method].apply(this,
+          Array.prototype.slice.call(arguments, 1));
     }
     else if (typeof method === 'object' || !method) {
       return methods.init.apply(this, arguments);
diff --git a/azkaban-web-server/src/web/js/azkaban/util/svgutils.js b/azkaban-web-server/src/web/js/azkaban/util/svgutils.js
index 3802f86..fe31794 100644
--- a/azkaban-web-server/src/web/js/azkaban/util/svgutils.js
+++ b/azkaban-web-server/src/web/js/azkaban/util/svgutils.js
@@ -3,7 +3,7 @@ function hasClass(el, name) {
   if (classes == null) {
     return false;
   }
-  return new RegExp('(\\s|^)'+name+'(\\s|$)').test(classes);
+  return new RegExp('(\\s|^)' + name + '(\\s|$)').test(classes);
 }
 
 function addClass(el, name) {
@@ -22,7 +22,9 @@ function addClass(el, name) {
 function removeClass(el, name) {
   if (hasClass(el, name)) {
     var classes = el.getAttribute("class");
-    el.setAttribute("class", classes.replace(new RegExp('(\\s|^)'+name+'(\\s|$)'),' ').replace(/^\s+|\s+$/g, ''));
+    el.setAttribute("class",
+        classes.replace(new RegExp('(\\s|^)' + name + '(\\s|$)'), ' ').replace(
+            /^\s+|\s+$/g, ''));
   }
 }
 
@@ -34,15 +36,15 @@ function animatePolylineEdge(svg, edge, newPoints, time) {
   var oldEdgeGuides = edge.oldpoints;
 
   var interval = 10;
-  var numsteps = time/interval;
+  var numsteps = time / interval;
 
   var deltaEdges = new Array();
-  for (var i=0; i < oldEdgeGuides.length; ++i) {
+  for (var i = 0; i < oldEdgeGuides.length; ++i) {
     var startPoint = oldEdgeGuides[i];
     var endPoint = newPoints[i];
 
-    var deltaX = (endPoint[0] - startPoint[0])/numsteps;
-    var deltaY = (endPoint[1] - startPoint[1])/numsteps;
+    var deltaX = (endPoint[0] - startPoint[0]) / numsteps;
+    var deltaY = (endPoint[1] - startPoint[1]) / numsteps;
     deltaEdges.push([deltaX, deltaY]);
   }
 
@@ -50,7 +52,7 @@ function animatePolylineEdge(svg, edge, newPoints, time) {
 }
 
 function animatePolyLineLoop(svg, edge, lastPoints, deltaEdges, step, time) {
-  for (var i=0; i < deltaEdges.length; ++i) {
+  for (var i = 0; i < deltaEdges.length; ++i) {
     lastPoints[i][0] += deltaEdges[i][0];
     lastPoints[i][1] += deltaEdges[i][1];
   }
@@ -58,10 +60,10 @@ function animatePolyLineLoop(svg, edge, lastPoints, deltaEdges, step, time) {
   svg.change(edge.line, {points: lastPoints});
   if (step > 0) {
     setTimeout(
-      function(){
-        animatePolyLineLoop(svg, edge, lastPoints, deltaEdges, step - 1);
-      },
-      time
+        function () {
+          animatePolyLineLoop(svg, edge, lastPoints, deltaEdges, step - 1);
+        },
+        time
     );
   }
 }
diff --git a/azkaban-web-server/src/web/js/azkaban/view/admin-setup.js b/azkaban-web-server/src/web/js/azkaban/view/admin-setup.js
index c3730da..8c4213e 100644
--- a/azkaban-web-server/src/web/js/azkaban/view/admin-setup.js
+++ b/azkaban-web-server/src/web/js/azkaban/view/admin-setup.js
@@ -17,32 +17,36 @@
 $.namespace('azkaban');
 
 var dbUploadPanel;
-azkaban.DBUploadPanel= Backbone.View.extend({
-  events : {
-    "click #upload-jar-btn" : "handleUpload"
+azkaban.DBUploadPanel = Backbone.View.extend({
+  events: {
+    "click #upload-jar-btn": "handleUpload"
   },
-  initialize : function(settings) {
+  initialize: function (settings) {
   },
-  render: function() {
+  render: function () {
   },
-  handleUpload: function(){
+  handleUpload: function () {
     var filename = $("#file").val();
     if (filename.length > 4) {
       var lastIndexOf = filename.lastIndexOf('.');
       var lastIndexOfForwardSlash = filename.lastIndexOf('\\');
       var lastIndexOfBackwardSlash = filename.lastIndexOf('/');
 
-      var startIndex = Math.max(lastIndexOfForwardSlash, lastIndexOfBackwardSlash);
+      var startIndex = Math.max(lastIndexOfForwardSlash,
+          lastIndexOfBackwardSlash);
       startIndex += 1;
 
       var subfilename = filename.substring(startIndex, filename.length);
       var end = filename.substring(lastIndexOf, filename.length);
       if (end != ".jar") {
-        alert("File "+ subfilename + " doesn't appear to be a jar. Looking for mysql-connector*.jar");
+        alert("File " + subfilename
+            + " doesn't appear to be a jar. Looking for mysql-connector*.jar");
         return;
       }
-      else if (subfilename.substr(0, "mysql-connector".length) != "mysql-connector") {
-        alert("File "+ subfilename + " doesn't appear to be a mysql connector jar. Looking for mysql-connector*.jar");
+      else if (subfilename.substr(0, "mysql-connector".length)
+          != "mysql-connector") {
+        alert("File " + subfilename
+            + " doesn't appear to be a mysql connector jar. Looking for mysql-connector*.jar");
         return;
       }
 
@@ -52,14 +56,15 @@ azkaban.DBUploadPanel= Backbone.View.extend({
       var contextUrl = contextURL;
 
       var xhr = new XMLHttpRequest();
-      xhr.onreadystatechange=function() {
-        if (xhr.readyState==4) {
+      xhr.onreadystatechange = function () {
+        if (xhr.readyState == 4) {
           var data = JSON.parse(xhr.responseText);
           if (data.error) {
             alert(data.error);
           }
           else {
-            $("#installed").html("Uploaded <span class=bold>" + data.jarname + "</span>");
+            $("#installed").html("Uploaded <span class=bold>" + data.jarname
+                + "</span>");
           }
         }
       }
@@ -75,11 +80,11 @@ azkaban.DBUploadPanel= Backbone.View.extend({
 });
 
 var dbConnectionsPanel;
-azkaban.DBConnectionPanel= Backbone.View.extend({
-  events : {
-    "click #save-connection-button" : "handleSaveConnection"
+azkaban.DBConnectionPanel = Backbone.View.extend({
+  events: {
+    "click #save-connection-button": "handleSaveConnection"
   },
-  initialize : function(settings) {
+  initialize: function (settings) {
     if (verified) {
       $("#save-results").text(message);
       $("#save-results").css("color", "#00CC00");
@@ -87,9 +92,9 @@ azkaban.DBConnectionPanel= Backbone.View.extend({
       $("#save-results").hide();
     }
   },
-  render: function() {
+  render: function () {
   },
-  handleSaveConnection: function(){
+  handleSaveConnection: function () {
     var host = $("#host").val();
     var port = $("#port").val();
     var database = $("#database").val();
@@ -98,42 +103,43 @@ azkaban.DBConnectionPanel= Backbone.View.extend({
 
     var contextUrl = contextURL;
     $.post(
-      contextUrl,
-      {
-        ajax: "saveDbConnection",
-        host: host,
-        port: port,
-        database: database,
-        username: username,
-        password: password
-      },
-      function(data) {
-        if (data.error) {
-          verified = false;
-          $("#save-results").text(data.error);
-          $("#save-results").css("color", "#FF0000");
-        }
-        else if (data.success) {
-          verified = true;
-          $("#save-results").text(data.success);
-          $("#save-results").css("color", "#00CC00");
+        contextUrl,
+        {
+          ajax: "saveDbConnection",
+          host: host,
+          port: port,
+          database: database,
+          username: username,
+          password: password
+        },
+        function (data) {
+          if (data.error) {
+            verified = false;
+            $("#save-results").text(data.error);
+            $("#save-results").css("color", "#FF0000");
+          }
+          else if (data.success) {
+            verified = true;
+            $("#save-results").text(data.success);
+            $("#save-results").css("color", "#00CC00");
+          }
+          $("#save-results").show();
         }
-        $("#save-results").show();
-      }
     );
   }
 });
 
-$(function() {
-  dbUploadPanel = new azkaban.DBUploadPanel({el:$( '#dbuploadpanel')});
-  dbConnectionPanel = new azkaban.DBConnectionPanel({el:$( '#dbsettingspanel')});
+$(function () {
+  dbUploadPanel = new azkaban.DBUploadPanel({el: $('#dbuploadpanel')});
+  dbConnectionPanel = new azkaban.DBConnectionPanel(
+      {el: $('#dbsettingspanel')});
 
-  $("#saveAndContinue").click(function(data) {
+  $("#saveAndContinue").click(function (data) {
     if (!verified) {
       alert("The database connection hasn't been verified.");
     }
     else {
-      window.location="/?usersetup";
+      window.location = "/?usersetup";
     }
   });
 });
diff --git a/azkaban-web-server/src/web/js/azkaban/view/context-menu.js b/azkaban-web-server/src/web/js/azkaban/view/context-menu.js
index 486817e..83c9bd5 100644
--- a/azkaban-web-server/src/web/js/azkaban/view/context-menu.js
+++ b/azkaban-web-server/src/web/js/azkaban/view/context-menu.js
@@ -17,18 +17,19 @@
 $.namespace('azkaban');
 
 azkaban.ContextMenuView = Backbone.View.extend({
-  events: {
-  },
+  events: {},
 
-  initialize: function(settings) {
+  initialize: function (settings) {
     var div = this.el;
-    $('body').click(function(e) {
+    $('body').click(function (e) {
       $(".contextMenu").remove();
     });
-    $('body').bind("contextmenu", function(e) {$(".contextMenu").remove()});
+    $('body').bind("contextmenu", function (e) {
+      $(".contextMenu").remove()
+    });
   },
 
-  show: function(evt, menu) {
+  show: function (evt, menu) {
     console.log("Show context menu");
     $(".contextMenu").remove();
     var x = evt.pageX;
@@ -39,16 +40,16 @@ azkaban.ContextMenuView = Backbone.View.extend({
     $(this.el).after(contextMenu);
   },
 
-  hide: function(evt) {
+  hide: function (evt) {
     console.log("Hide context menu");
     $(".contextMenu").remove();
   },
 
-  handleClick: function(evt) {
+  handleClick: function (evt) {
     console.log("handling click");
   },
 
-  setupMenu: function(menu) {
+  setupMenu: function (menu) {
     var contextMenu = document.createElement("div");
     $(contextMenu).addClass("contextMenu");
     var ul = document.createElement("ul");
@@ -66,7 +67,7 @@ azkaban.ContextMenuView = Backbone.View.extend({
       $(menuItem).addClass("menuitem");
       $(menuItem).text(title);
       menuItem.callback = callback;
-      $(menuItem).click(function() {
+      $(menuItem).click(function () {
         $(contextMenu).hide();
         this.callback.call();
       });
@@ -83,11 +84,11 @@ azkaban.ContextMenuView = Backbone.View.extend({
         $(subMenu).hide();
         $(this.el).after(subMenu);
 
-        $(menuItem).mouseenter(function() {
+        $(menuItem).mouseenter(function () {
           $(".subMenu").hide();
           var menuItem = this;
           menuItem.selected = true;
-          setTimeout(function() {
+          setTimeout(function () {
             if (menuItem.selected) {
               var offset = $(menuItem).offset();
               var left = offset.left;
@@ -101,7 +102,9 @@ azkaban.ContextMenuView = Backbone.View.extend({
             }
           }, 500);
         });
-        $(menuItem).mouseleave(function() {this.selected = false;});
+        $(menuItem).mouseleave(function () {
+          this.selected = false;
+        });
       }
       $(ul).append(menuItem);
     }
@@ -111,7 +114,7 @@ azkaban.ContextMenuView = Backbone.View.extend({
 });
 
 var contextMenuView;
-$(function() {
-  contextMenuView = new azkaban.ContextMenuView({el:$('#contextMenu')});
+$(function () {
+  contextMenuView = new azkaban.ContextMenuView({el: $('#contextMenu')});
   contextMenuView.hide();
 });
diff --git a/azkaban-web-server/src/web/js/azkaban/view/executions.js b/azkaban-web-server/src/web/js/azkaban/view/executions.js
index 28f0757..02ac278 100644
--- a/azkaban-web-server/src/web/js/azkaban/view/executions.js
+++ b/azkaban-web-server/src/web/js/azkaban/view/executions.js
@@ -15,25 +15,27 @@
  */
 
 $.namespace('azkaban');
+
 function killFlow(execId) {
-	  var requestURL=document.location.href.replace("#currently-running","");	  
-	  var requestData = {"execid": execId, "ajax": "cancelFlow"};
-	  var successHandler = function(data) {
-		  console.log("cancel clicked");
-		  if (data.error) {
-			  showDialog("Error", data.error);
-		  }
-		  else {
-			  showDialog("Cancelled", "Flow has been cancelled.");
-			 
-		  }
-	  };
-	  ajaxCall(requestURL, requestData, successHandler);	 
+  var requestURL = document.location.href.replace("#currently-running", "");
+  var requestData = {"execid": execId, "ajax": "cancelFlow"};
+  var successHandler = function (data) {
+    console.log("cancel clicked");
+    if (data.error) {
+      showDialog("Error", data.error);
+    }
+    else {
+      showDialog("Cancelled", "Flow has been cancelled.");
+
+    }
+  };
+  ajaxCall(requestURL, requestData, successHandler);
 }
-var showDialog = function(title, message) {
-	$('#messageTitle').text(title);
-	$('#messageBox').text(message);
-	$('#messageDialog').modal();
+
+var showDialog = function (title, message) {
+  $('#messageTitle').text(title);
+  $('#messageBox').text(message);
+  $('#messageDialog').modal();
 }
 var executionsTabView;
 azkaban.ExecutionsTabView = Backbone.View.extend({
@@ -42,7 +44,7 @@ azkaban.ExecutionsTabView = Backbone.View.extend({
     'click #recently-finished-view-link': 'handleRecentlyFinishedViewLinkClick'
   },
 
-  initialize: function(settings) {
+  initialize: function (settings) {
     var selectedView = settings.selectedView;
     if (selectedView == 'recently-finished') {
       this.handleRecentlyFinishedViewLinkClick();
@@ -52,17 +54,17 @@ azkaban.ExecutionsTabView = Backbone.View.extend({
     }
   },
 
-  render: function() {
+  render: function () {
   },
 
-  handleCurrentlyRunningViewLinkClick: function() {
+  handleCurrentlyRunningViewLinkClick: function () {
     $('#recently-finished-view-link').removeClass('active');
     $('#recently-finished-view').hide();
     $('#currently-running-view-link').addClass('active');
     $('#currently-running-view').show();
   },
 
-  handleRecentlyFinishedViewLinkClick: function() {
+  handleRecentlyFinishedViewLinkClick: function () {
     $('#currently-running-view-link').removeClass('active');
     $('#currently-running-view').hide();
     $('#recently-finished-view-link').addClass('active');
@@ -70,7 +72,7 @@ azkaban.ExecutionsTabView = Backbone.View.extend({
   }
 });
 
-$(function() {
+$(function () {
   executionsTabView = new azkaban.ExecutionsTabView({el: $('#header-tabs')});
   if (window.location.hash) {
     var hash = window.location.hash;
diff --git a/azkaban-web-server/src/web/js/azkaban/view/exflow.js b/azkaban-web-server/src/web/js/azkaban/view/exflow.js
index 026a946..4b0d4fd 100644
--- a/azkaban-web-server/src/web/js/azkaban/view/exflow.js
+++ b/azkaban-web-server/src/web/js/azkaban/view/exflow.js
@@ -16,281 +16,290 @@
 
 $.namespace('azkaban');
 
-var handleJobMenuClick = function(action, el, pos) {
-	var jobid = el[0].jobid;
-	var requestURL = contextURL + "/manager?project=" + projectName + "&flow=" + flowName + "&job=" + jobid;
-	if (action == "open") {
-		window.location.href = requestURL;
-	}
-	else if(action == "openwindow") {
-		window.open(requestURL);
-	}
+var handleJobMenuClick = function (action, el, pos) {
+  var jobid = el[0].jobid;
+  var requestURL = contextURL + "/manager?project=" + projectName + "&flow="
+      + flowName + "&job=" + jobid;
+  if (action == "open") {
+    window.location.href = requestURL;
+  }
+  else if (action == "openwindow") {
+    window.open(requestURL);
+  }
 }
 
 var statusView;
 azkaban.StatusView = Backbone.View.extend({
-	initialize: function(settings) {
-		this.model.bind('change:graph', this.render, this);
-		this.model.bind('change:update', this.statusUpdate, this);
-	},
-	render: function(evt) {
-		var data = this.model.get("data");
-
-		var user = data.submitUser;
-		$("#submitUser").text(user);
-
-		this.statusUpdate(evt);
-	},
-
-	statusUpdate: function(evt) {
-		var data = this.model.get("data");
-
-		statusItem = $("#flowStatus");
-		for (var j = 0; j < statusList.length; ++j) {
-			var status = statusList[j];
-			statusItem.removeClass(status);
-		}
-		$("#flowStatus").addClass(data.status);
-		$("#flowStatus").text(data.status);
-
-		var startTime = data.startTime;
-		var endTime = data.endTime;
-
-		if (!startTime || startTime == -1) {
-			$("#startTime").text("-");
-		}
-		else {
-			var date = new Date(startTime);
-			$("#startTime").text(getDateFormat(date));
-
-			var lastTime = endTime;
-			if (endTime == -1) {
-				var currentDate = new Date();
-				lastTime = currentDate.getTime();
-			}
-
-			var durationString = getDuration(startTime, lastTime);
-			$("#duration").text(durationString);
-		}
-
-		if (!endTime || endTime == -1) {
-			$("#endTime").text("-");
-		}
-		else {
-			var date = new Date(endTime);
-			$("#endTime").text(getDateFormat(date));
-		}
-	}
+  initialize: function (settings) {
+    this.model.bind('change:graph', this.render, this);
+    this.model.bind('change:update', this.statusUpdate, this);
+  },
+  render: function (evt) {
+    var data = this.model.get("data");
+
+    var user = data.submitUser;
+    $("#submitUser").text(user);
+
+    this.statusUpdate(evt);
+  },
+
+  statusUpdate: function (evt) {
+    var data = this.model.get("data");
+
+    statusItem = $("#flowStatus");
+    for (var j = 0; j < statusList.length; ++j) {
+      var status = statusList[j];
+      statusItem.removeClass(status);
+    }
+    $("#flowStatus").addClass(data.status);
+    $("#flowStatus").text(data.status);
+
+    var startTime = data.startTime;
+    var endTime = data.endTime;
+
+    if (!startTime || startTime == -1) {
+      $("#startTime").text("-");
+    }
+    else {
+      var date = new Date(startTime);
+      $("#startTime").text(getDateFormat(date));
+
+      var lastTime = endTime;
+      if (endTime == -1) {
+        var currentDate = new Date();
+        lastTime = currentDate.getTime();
+      }
+
+      var durationString = getDuration(startTime, lastTime);
+      $("#duration").text(durationString);
+    }
+
+    if (!endTime || endTime == -1) {
+      $("#endTime").text("-");
+    }
+    else {
+      var date = new Date(endTime);
+      $("#endTime").text(getDateFormat(date));
+    }
+  }
 });
 
 var flowTabView;
 azkaban.FlowTabView = Backbone.View.extend({
-	events: {
-		"click #graphViewLink": "handleGraphLinkClick",
-		"click #jobslistViewLink": "handleJobslistLinkClick",
-		"click #flowLogViewLink": "handleLogLinkClick",
-		"click #statsViewLink": "handleStatsLinkClick",
-		"click #cancelbtn": "handleCancelClick",
-		"click #executebtn": "handleRestartClick",
-		"click #pausebtn": "handlePauseClick",
-		"click #resumebtn": "handleResumeClick",
-		"click #retrybtn": "handleRetryClick"
-	},
-
-	initialize: function(settings) {
-		$("#cancelbtn").hide();
-		$("#executebtn").hide();
-		$("#pausebtn").hide();
-		$("#resumebtn").hide();
-		$("#retrybtn").hide();
-
-		this.model.bind('change:graph', this.handleFlowStatusChange, this);
-		this.model.bind('change:update', this.handleFlowStatusChange, this);
-
-		var selectedView = settings.selectedView;
-		if (selectedView == "jobslist") {
-			this.handleJobslistLinkClick();
-		}
-		else {
-			this.handleGraphLinkClick();
-		}
-	},
-
-	render: function() {
-		console.log("render graph");
-	},
-
-	handleGraphLinkClick: function(){
-		$("#jobslistViewLink").removeClass("active");
-		$("#graphViewLink").addClass("active");
-		$("#flowLogViewLink").removeClass("active");
-		$("#statsViewLink").removeClass("active");
-
-		$("#jobListView").hide();
-		$("#graphView").show();
-		$("#flowLogView").hide();
-		$("#statsView").hide();
-	},
-
-	handleJobslistLinkClick: function() {
-		$("#graphViewLink").removeClass("active");
-		$("#jobslistViewLink").addClass("active");
-		$("#flowLogViewLink").removeClass("active");
-		$("#statsViewLink").removeClass("active");
-
-		$("#graphView").hide();
-		$("#jobListView").show();
-		$("#flowLogView").hide();
-		$("#statsView").hide();
-	},
-
-	handleLogLinkClick: function() {
-		$("#graphViewLink").removeClass("active");
-		$("#jobslistViewLink").removeClass("active");
-		$("#flowLogViewLink").addClass("active");
-		$("#statsViewLink").removeClass("active");
-
-		$("#graphView").hide();
-		$("#jobListView").hide();
-		$("#flowLogView").show();
-		$("#statsView").hide();
-	},
-
-  handleStatsLinkClick: function() {
-		$("#graphViewLink").removeClass("active");
-		$("#jobslistViewLink").removeClass("active");
-		$("#flowLogViewLink").removeClass("active");
-		$("#statsViewLink").addClass("active");
-
-		$("#graphView").hide();
-		$("#jobListView").hide();
-		$("#flowLogView").hide();
+  events: {
+    "click #graphViewLink": "handleGraphLinkClick",
+    "click #jobslistViewLink": "handleJobslistLinkClick",
+    "click #flowLogViewLink": "handleLogLinkClick",
+    "click #statsViewLink": "handleStatsLinkClick",
+    "click #cancelbtn": "handleCancelClick",
+    "click #executebtn": "handleRestartClick",
+    "click #pausebtn": "handlePauseClick",
+    "click #resumebtn": "handleResumeClick",
+    "click #retrybtn": "handleRetryClick"
+  },
+
+  initialize: function (settings) {
+    $("#cancelbtn").hide();
+    $("#executebtn").hide();
+    $("#pausebtn").hide();
+    $("#resumebtn").hide();
+    $("#retrybtn").hide();
+
+    this.model.bind('change:graph', this.handleFlowStatusChange, this);
+    this.model.bind('change:update', this.handleFlowStatusChange, this);
+
+    var selectedView = settings.selectedView;
+    if (selectedView == "jobslist") {
+      this.handleJobslistLinkClick();
+    }
+    else {
+      this.handleGraphLinkClick();
+    }
+  },
+
+  render: function () {
+    console.log("render graph");
+  },
+
+  handleGraphLinkClick: function () {
+    $("#jobslistViewLink").removeClass("active");
+    $("#graphViewLink").addClass("active");
+    $("#flowLogViewLink").removeClass("active");
+    $("#statsViewLink").removeClass("active");
+
+    $("#jobListView").hide();
+    $("#graphView").show();
+    $("#flowLogView").hide();
+    $("#statsView").hide();
+  },
+
+  handleJobslistLinkClick: function () {
+    $("#graphViewLink").removeClass("active");
+    $("#jobslistViewLink").addClass("active");
+    $("#flowLogViewLink").removeClass("active");
+    $("#statsViewLink").removeClass("active");
+
+    $("#graphView").hide();
+    $("#jobListView").show();
+    $("#flowLogView").hide();
+    $("#statsView").hide();
+  },
+
+  handleLogLinkClick: function () {
+    $("#graphViewLink").removeClass("active");
+    $("#jobslistViewLink").removeClass("active");
+    $("#flowLogViewLink").addClass("active");
+    $("#statsViewLink").removeClass("active");
+
+    $("#graphView").hide();
+    $("#jobListView").hide();
+    $("#flowLogView").show();
+    $("#statsView").hide();
+  },
+
+  handleStatsLinkClick: function () {
+    $("#graphViewLink").removeClass("active");
+    $("#jobslistViewLink").removeClass("active");
+    $("#flowLogViewLink").removeClass("active");
+    $("#statsViewLink").addClass("active");
+
+    $("#graphView").hide();
+    $("#jobListView").hide();
+    $("#flowLogView").hide();
     statsView.show();
-		$("#statsView").show();
-	},
-
-	handleFlowStatusChange: function() {
-		var data = this.model.get("data");
-		$("#cancelbtn").hide();
-		$("#executebtn").hide();
-		$("#pausebtn").hide();
-		$("#resumebtn").hide();
-		$("#retrybtn").hide();
-
-		if (data.status == "SUCCEEDED") {
-                        $("#executebtn").show();
-		}
-                else if (data.status == "PREPARING") {
-                        $("#cancelbtn").show();
-                }
-		else if (data.status == "FAILED") {
-			$("#executebtn").show();
-		}
-		else if (data.status == "FAILED_FINISHING") {
-			$("#cancelbtn").show();
-			$("#executebtn").hide();
-			$("#retrybtn").show();
-		}
-		else if (data.status == "RUNNING") {
-			$("#cancelbtn").show();
-			$("#pausebtn").show();
-		}
-		else if (data.status == "PAUSED") {
-			$("#cancelbtn").show();
-			$("#resumebtn").show();
-		}
-		else if (data.status == "WAITING") {
-			$("#cancelbtn").show();
-		}
-		else if (data.status == "KILLED") {
-			$("#executebtn").show();
-		}
-	},
-
-	handleCancelClick: function(evt) {
-		var requestURL = contextURL + "/executor";
-		var requestData = {"execid": execId, "ajax": "cancelFlow"};
-		var successHandler = function(data) {
-			console.log("cancel clicked");
-			if (data.error) {
-				showDialog("Error", data.error);
-			}
-			else {
-				showDialog("Cancelled", "Flow has been cancelled.");
-				setTimeout(function() {updateStatus();}, 1100);
-			}
-		};
-		ajaxCall(requestURL, requestData, successHandler);
-	},
-
-	handleRetryClick: function(evt) {
-		var graphData = graphModel.get("data");
-		var requestURL = contextURL + "/executor";
-		var requestData = {"execid": execId, "ajax": "retryFailedJobs"};
-		var successHandler = function(data) {
-			console.log("cancel clicked");
-			if (data.error) {
-				showDialog("Error", data.error);
-			}
-			else {
-				showDialog("Retry", "Flow has been retried.");
-				setTimeout(function() {updateStatus();}, 1100);
-			}
-		};
-		ajaxCall(requestURL, requestData, successHandler);
-	},
-
-	handleRestartClick: function(evt) {
-		console.log("handleRestartClick");
-		var data = graphModel.get("data");
-
-		var executingData = {
-			project: projectName,
-			ajax: "executeFlow",
-			flow: flowId,
-			execid: execId,
-			exgraph: data
-		};
-		flowExecuteDialogView.show(executingData);
-	},
-
-	handlePauseClick: function(evt) {
-		var requestURL = contextURL + "/executor";
-		var requestData = {"execid": execId, "ajax":"pauseFlow"};
-		var successHandler = function(data) {
-			console.log("pause clicked");
-			if (data.error) {
-				showDialog("Error", data.error);
-			}
-			else {
-				showDialog("Paused", "Flow has been paused.");
-				setTimeout(function() {updateStatus();}, 1100);
-			}
-		};
-		ajaxCall(requestURL, requestData, successHandler);
-	},
-
-	handleResumeClick: function(evt) {
-		var requestURL = contextURL + "/executor";
-		var requestData = {"execid": execId, "ajax":"resumeFlow"};
-		var successHandler = function(data) {
-			console.log("pause clicked");
-			if (data.error) {
-				showDialog("Error", data.error);
-			}
-			else {
-				showDialog("Resumed", "Flow has been resumed.");
-				setTimeout(function() {updateStatus();}, 1100);
-			}
-		};
-		ajaxCall(requestURL, requestData, successHandler);
-	}
+    $("#statsView").show();
+  },
+
+  handleFlowStatusChange: function () {
+    var data = this.model.get("data");
+    $("#cancelbtn").hide();
+    $("#executebtn").hide();
+    $("#pausebtn").hide();
+    $("#resumebtn").hide();
+    $("#retrybtn").hide();
+
+    if (data.status == "SUCCEEDED") {
+      $("#executebtn").show();
+    }
+    else if (data.status == "PREPARING") {
+      $("#cancelbtn").show();
+    }
+    else if (data.status == "FAILED") {
+      $("#executebtn").show();
+    }
+    else if (data.status == "FAILED_FINISHING") {
+      $("#cancelbtn").show();
+      $("#executebtn").hide();
+      $("#retrybtn").show();
+    }
+    else if (data.status == "RUNNING") {
+      $("#cancelbtn").show();
+      $("#pausebtn").show();
+    }
+    else if (data.status == "PAUSED") {
+      $("#cancelbtn").show();
+      $("#resumebtn").show();
+    }
+    else if (data.status == "WAITING") {
+      $("#cancelbtn").show();
+    }
+    else if (data.status == "KILLED") {
+      $("#executebtn").show();
+    }
+  },
+
+  handleCancelClick: function (evt) {
+    var requestURL = contextURL + "/executor";
+    var requestData = {"execid": execId, "ajax": "cancelFlow"};
+    var successHandler = function (data) {
+      console.log("cancel clicked");
+      if (data.error) {
+        showDialog("Error", data.error);
+      }
+      else {
+        showDialog("Cancelled", "Flow has been cancelled.");
+        setTimeout(function () {
+          updateStatus();
+        }, 1100);
+      }
+    };
+    ajaxCall(requestURL, requestData, successHandler);
+  },
+
+  handleRetryClick: function (evt) {
+    var graphData = graphModel.get("data");
+    var requestURL = contextURL + "/executor";
+    var requestData = {"execid": execId, "ajax": "retryFailedJobs"};
+    var successHandler = function (data) {
+      console.log("cancel clicked");
+      if (data.error) {
+        showDialog("Error", data.error);
+      }
+      else {
+        showDialog("Retry", "Flow has been retried.");
+        setTimeout(function () {
+          updateStatus();
+        }, 1100);
+      }
+    };
+    ajaxCall(requestURL, requestData, successHandler);
+  },
+
+  handleRestartClick: function (evt) {
+    console.log("handleRestartClick");
+    var data = graphModel.get("data");
+
+    var executingData = {
+      project: projectName,
+      ajax: "executeFlow",
+      flow: flowId,
+      execid: execId,
+      exgraph: data
+    };
+    flowExecuteDialogView.show(executingData);
+  },
+
+  handlePauseClick: function (evt) {
+    var requestURL = contextURL + "/executor";
+    var requestData = {"execid": execId, "ajax": "pauseFlow"};
+    var successHandler = function (data) {
+      console.log("pause clicked");
+      if (data.error) {
+        showDialog("Error", data.error);
+      }
+      else {
+        showDialog("Paused", "Flow has been paused.");
+        setTimeout(function () {
+          updateStatus();
+        }, 1100);
+      }
+    };
+    ajaxCall(requestURL, requestData, successHandler);
+  },
+
+  handleResumeClick: function (evt) {
+    var requestURL = contextURL + "/executor";
+    var requestData = {"execid": execId, "ajax": "resumeFlow"};
+    var successHandler = function (data) {
+      console.log("pause clicked");
+      if (data.error) {
+        showDialog("Error", data.error);
+      }
+      else {
+        showDialog("Resumed", "Flow has been resumed.");
+        setTimeout(function () {
+          updateStatus();
+        }, 1100);
+      }
+    };
+    ajaxCall(requestURL, requestData, successHandler);
+  }
 });
 
-var showDialog = function(title, message) {
-	$('#messageTitle').text(title);
-	$('#messageBox').text(message);
-	$('#messageDialog').modal();
+var showDialog = function (title, message) {
+  $('#messageTitle').text(title);
+  $('#messageBox').text(message);
+  $('#messageDialog').modal();
 }
 
 var jobListView;
@@ -298,76 +307,75 @@ var mainSvgGraphView;
 
 var flowLogView;
 azkaban.FlowLogView = Backbone.View.extend({
-	events: {
-		"click #updateLogBtn" : "handleUpdate"
-	},
-	initialize: function(settings) {
-		this.model.set({"offset": 0});
-		this.handleUpdate();
-	},
-	handleUpdate: function(evt) {
-		var offset = this.model.get("offset");
-		var requestURL = contextURL + "/executor";
-		var model = this.model;
-		console.log("fetchLogs offset is " + offset)
-
-		$.ajax({
-			async: false,
-			url: requestURL,
-			data: {
-				"execid": execId,
-				"ajax": "fetchExecFlowLogs",
-				"offset": offset,
-				"length": 50000
-			},
-			success: function(data) {
-				console.log("fetchLogs");
-				if (data.error) {
-					console.log(data.error);
-				}
-				else {
-					var log = $("#logSection").text();
-					if (!log) {
-						log = data.data;
-					}
-					else {
-						log += data.data;
-					}
-
-					var newOffset = data.offset + data.length;
-
-					$("#logSection").text(log);
-					model.set({"offset": newOffset, "log": log});
-					$(".logViewer").scrollTop(9999);
-				}
-			}
-		});
-	}
+  events: {
+    "click #updateLogBtn": "handleUpdate"
+  },
+  initialize: function (settings) {
+    this.model.set({"offset": 0});
+    this.handleUpdate();
+  },
+  handleUpdate: function (evt) {
+    var offset = this.model.get("offset");
+    var requestURL = contextURL + "/executor";
+    var model = this.model;
+    console.log("fetchLogs offset is " + offset)
+
+    $.ajax({
+      async: false,
+      url: requestURL,
+      data: {
+        "execid": execId,
+        "ajax": "fetchExecFlowLogs",
+        "offset": offset,
+        "length": 50000
+      },
+      success: function (data) {
+        console.log("fetchLogs");
+        if (data.error) {
+          console.log(data.error);
+        }
+        else {
+          var log = $("#logSection").text();
+          if (!log) {
+            log = data.data;
+          }
+          else {
+            log += data.data;
+          }
+
+          var newOffset = data.offset + data.length;
+
+          $("#logSection").text(log);
+          model.set({"offset": newOffset, "log": log});
+          $(".logViewer").scrollTop(9999);
+        }
+      }
+    });
+  }
 });
 
 var statsView;
 azkaban.StatsView = Backbone.View.extend({
-	events: {
-	},
+  events: {},
 
-  initialize: function(settings) {
+  initialize: function (settings) {
     this.model.bind('change:graph', this.statusUpdate, this);
     this.model.bind('change:update', this.statusUpdate, this);
-		this.model.bind('render', this.render, this);
+    this.model.bind('render', this.render, this);
     this.status = null;
     this.rendered = false;
   },
 
-  statusUpdate: function(evt) {
+  statusUpdate: function (evt) {
     var data = this.model.get('data');
     this.status = data.status;
   },
 
-  show: function() {
+  show: function () {
     this.model.trigger("render");
   },
 
-  render: function(evt) {
+  render: function (evt) {
     if (this.rendered == true) {
       return;
     }
@@ -384,232 +392,281 @@ var graphModel;
 var logModel;
 azkaban.LogModel = Backbone.Model.extend({});
 
-var updateStatus = function(updateTime) {
-	var requestURL = contextURL + "/executor";
-	var oldData = graphModel.get("data");
-	var nodeMap = graphModel.get("nodeMap");
-
-	if (!updateTime) {
-		updateTime = oldData.updateTime ? oldData.updateTime : 0;
-	}
-
-	var requestData = {
-		"execid": execId,
-		"ajax": "fetchexecflowupdate",
-		"lastUpdateTime": updateTime
-	};
-
-	var successHandler = function(data) {
-		console.log("data updated");
-		if (data.updateTime) {
-			updateGraph(oldData, data);
-
-			graphModel.set({"update": data});
-			graphModel.trigger("change:update");
-		}
-	};
-	ajaxCall(requestURL, requestData, successHandler);
+var updateStatus = function (updateTime) {
+  var requestURL = contextURL + "/executor";
+  var oldData = graphModel.get("data");
+  var nodeMap = graphModel.get("nodeMap");
+
+  if (!updateTime) {
+    updateTime = oldData.updateTime ? oldData.updateTime : 0;
+  }
+
+  var requestData = {
+    "execid": execId,
+    "ajax": "fetchexecflowupdate",
+    "lastUpdateTime": updateTime
+  };
+
+  var successHandler = function (data) {
+    console.log("data updated");
+    if (data.updateTime) {
+      updateGraph(oldData, data);
+
+      graphModel.set({"update": data});
+      graphModel.trigger("change:update");
+    }
+  };
+  ajaxCall(requestURL, requestData, successHandler);
 }
 
-var updateGraph = function(data, update) {
-	var nodeMap = data.nodeMap;
-	data.startTime = update.startTime;
-	data.endTime = update.endTime;
-	data.updateTime = update.updateTime;
-	data.status = update.status;
-	update.changedNode = data;
-
-	if (update.nodes) {
-		for (var i = 0; i < update.nodes.length; ++i) {
-			var newNode = update.nodes[i];
-			var oldNode = nodeMap[newNode.id];
-
-			updateGraph(oldNode, newNode);
-		}
-	}
+var updateGraph = function (data, update) {
+  var nodeMap = data.nodeMap;
+  data.startTime = update.startTime;
+  data.endTime = update.endTime;
+  data.updateTime = update.updateTime;
+  data.status = update.status;
+  update.changedNode = data;
+
+  if (update.nodes) {
+    for (var i = 0; i < update.nodes.length; ++i) {
+      var newNode = update.nodes[i];
+      var oldNode = nodeMap[newNode.id];
+
+      updateGraph(oldNode, newNode);
+    }
+  }
 }
 
 var updateTime = -1;
-var updaterFunction = function() {
-	var oldData = graphModel.get("data");
-	var keepRunning =
-			oldData.status != "SUCCEEDED" &&
-			oldData.status != "FAILED" &&
-			oldData.status != "KILLED";
-
-	if (keepRunning) {
-		updateStatus();
-
-		var data = graphModel.get("data");
-		if (data.status == "UNKNOWN" ||
-			data.status == "WAITING" ||
-			data.status == "PREPARING") {
-			// 2 min updates
-			setTimeout(function() {updaterFunction();}, 2*60*1000);
-		}
-		else if (data.status != "SUCCEEDED" && data.status != "FAILED") {
-			// 2 min updates
-			setTimeout(function() {updaterFunction();}, 2*60*1000);
-		}
-		else {
-			console.log("Flow finished, so no more updates");
-			setTimeout(function() {updateStatus(0);}, 500);
-		}
-	}
-	else {
-		console.log("Flow finished, so no more updates");
-	}
+var updaterFunction = function () {
+  var oldData = graphModel.get("data");
+  var keepRunning =
+      oldData.status != "SUCCEEDED" &&
+      oldData.status != "FAILED" &&
+      oldData.status != "KILLED";
+
+  if (keepRunning) {
+    updateStatus();
+
+    var data = graphModel.get("data");
+    if (data.status == "UNKNOWN" ||
+        data.status == "WAITING" ||
+        data.status == "PREPARING") {
+      // 2 min updates
+      setTimeout(function () {
+        updaterFunction();
+      }, 2 * 60 * 1000);
+    }
+    else if (data.status != "SUCCEEDED" && data.status != "FAILED") {
+      // 2 min updates
+      setTimeout(function () {
+        updaterFunction();
+      }, 2 * 60 * 1000);
+    }
+    else {
+      console.log("Flow finished, so no more updates");
+      setTimeout(function () {
+        updateStatus(0);
+      }, 500);
+    }
+  }
+  else {
+    console.log("Flow finished, so no more updates");
+  }
 }
 
-var logUpdaterFunction = function() {
-	var oldData = graphModel.get("data");
-	var keepRunning =
-			oldData.status != "SUCCEEDED" &&
-			oldData.status != "FAILED" &&
-			oldData.status != "KILLED";
-	if (keepRunning) {
-		// update every 2 min for the logs until finished
-		flowLogView.handleUpdate();
-		setTimeout(function() {logUpdaterFunction();}, 2*60*1000);
-	}
-	else {
-		flowLogView.handleUpdate();
-	}
+var logUpdaterFunction = function () {
+  var oldData = graphModel.get("data");
+  var keepRunning =
+      oldData.status != "SUCCEEDED" &&
+      oldData.status != "FAILED" &&
+      oldData.status != "KILLED";
+  if (keepRunning) {
+    // update every 2 min for the logs until finished
+    flowLogView.handleUpdate();
+    setTimeout(function () {
+      logUpdaterFunction();
+    }, 2 * 60 * 1000);
+  }
+  else {
+    flowLogView.handleUpdate();
+  }
 }
 
-var exNodeClickCallback = function(event) {
-	console.log("Node clicked callback");
-	var jobId = event.currentTarget.jobid;
-	var requestURL = contextURL + "/manager?project=" + projectName + "&flow=" + flowId + "&job=" + jobId;
-	var visualizerURL = contextURL + "/pigvisualizer?execid=" + execId + "&jobid=" + jobId;
-
-	var menu = [
-		{title: "Open Job...", callback: function() {window.location.href = requestURL;}},
-		{title: "Open Job in New Window...", callback: function() {window.open(requestURL);}},
-		{title: "Visualize Job...", callback: function() {window.location.href = visualizerURL;}}
-	];
+var exNodeClickCallback = function (event) {
+  console.log("Node clicked callback");
+  var jobId = event.currentTarget.jobid;
+  var requestURL = contextURL + "/manager?project=" + projectName + "&flow="
+      + flowId + "&job=" + jobId;
+  var visualizerURL = contextURL + "/pigvisualizer?execid=" + execId + "&jobid="
+      + jobId;
+
+  var menu = [
+    {
+      title: "Open Job...", callback: function () {
+      window.location.href = requestURL;
+    }
+    },
+    {
+      title: "Open Job in New Window...", callback: function () {
+      window.open(requestURL);
+    }
+    },
+    {
+      title: "Visualize Job...", callback: function () {
+      window.location.href = visualizerURL;
+    }
+    }
+  ];
 
-	contextMenuView.show(event, menu);
+  contextMenuView.show(event, menu);
 }
 
-var exJobClickCallback = function(event) {
-	console.log("Node clicked callback");
-	var jobId = event.currentTarget.jobid;
-	var requestURL = contextURL + "/manager?project=" + projectName + "&flow=" + flowId + "&job=" + jobId;
-	var visualizerURL = contextURL + "/pigvisualizer?execid=" + execId + "&jobid=" + jobId;
-
-	var menu = [
-		{title: "Open Job...", callback: function() {window.location.href = requestURL;}},
-		{title: "Open Job in New Window...", callback: function() {window.open(requestURL);}},
-		{title: "Visualize Job...", callback: function() {window.location.href = visualizerURL;}}
-	];
+var exJobClickCallback = function (event) {
+  console.log("Node clicked callback");
+  var jobId = event.currentTarget.jobid;
+  var requestURL = contextURL + "/manager?project=" + projectName + "&flow="
+      + flowId + "&job=" + jobId;
+  var visualizerURL = contextURL + "/pigvisualizer?execid=" + execId + "&jobid="
+      + jobId;
+
+  var menu = [
+    {
+      title: "Open Job...", callback: function () {
+      window.location.href = requestURL;
+    }
+    },
+    {
+      title: "Open Job in New Window...", callback: function () {
+      window.open(requestURL);
+    }
+    },
+    {
+      title: "Visualize Job...", callback: function () {
+      window.location.href = visualizerURL;
+    }
+    }
+  ];
 
-	contextMenuView.show(event, menu);
+  contextMenuView.show(event, menu);
 }
 
-var exEdgeClickCallback = function(event) {
-	console.log("Edge clicked callback");
+var exEdgeClickCallback = function (event) {
+  console.log("Edge clicked callback");
 }
 
-var exGraphClickCallback = function(event) {
-	console.log("Graph clicked callback");
-	var requestURL = contextURL + "/manager?project=" + projectName + "&flow=" + flowId;
+var exGraphClickCallback = function (event) {
+  console.log("Graph clicked callback");
+  var requestURL = contextURL + "/manager?project=" + projectName + "&flow="
+      + flowId;
 
-	var menu = [
-		{title: "Open Flow...", callback: function() {window.location.href=requestURL;}},
-		{title: "Open Flow in New Window...", callback: function() {window.open(requestURL);}},
-		{break: 1},
-		{title: "Center Graph", callback: function() {graphModel.trigger("resetPanZoom");}}
-	];
+  var menu = [
+    {
+      title: "Open Flow...", callback: function () {
+      window.location.href = requestURL;
+    }
+    },
+    {
+      title: "Open Flow in New Window...", callback: function () {
+      window.open(requestURL);
+    }
+    },
+    {break: 1},
+    {
+      title: "Center Graph", callback: function () {
+      graphModel.trigger("resetPanZoom");
+    }
+    }
+  ];
 
-	contextMenuView.show(event, menu);
+  contextMenuView.show(event, menu);
 }
 
 var flowStatsView;
 var flowStatsModel;
 
-$(function() {
-	var selected;
-
-	graphModel = new azkaban.GraphModel();
-	logModel = new azkaban.LogModel();
-
-	flowTabView = new azkaban.FlowTabView({
-		el: $('#headertabs'),
-		model: graphModel
-	});
-
-	mainSvgGraphView = new azkaban.SvgGraphView({
-		el: $('#svgDiv'),
-		model: graphModel,
-		rightClick:	{
-			"node": nodeClickCallback,
-			"edge": edgeClickCallback,
-			"graph": graphClickCallback
-		}
-	});
-
-	jobsListView = new azkaban.JobListView({
-		el: $('#joblist-panel'),
-		model: graphModel,
-		contextMenuCallback: jobClickCallback
-	});
-
-	flowLogView = new azkaban.FlowLogView({
-		el: $('#flowLogView'),
-		model: logModel
-	});
-
-	statusView = new azkaban.StatusView({
-		el: $('#flow-status'),
-		model: graphModel
-	});
+$(function () {
+  var selected;
+
+  graphModel = new azkaban.GraphModel();
+  logModel = new azkaban.LogModel();
+
+  flowTabView = new azkaban.FlowTabView({
+    el: $('#headertabs'),
+    model: graphModel
+  });
+
+  mainSvgGraphView = new azkaban.SvgGraphView({
+    el: $('#svgDiv'),
+    model: graphModel,
+    rightClick: {
+      "node": nodeClickCallback,
+      "edge": edgeClickCallback,
+      "graph": graphClickCallback
+    }
+  });
+
+  jobsListView = new azkaban.JobListView({
+    el: $('#joblist-panel'),
+    model: graphModel,
+    contextMenuCallback: jobClickCallback
+  });
+
+  flowLogView = new azkaban.FlowLogView({
+    el: $('#flowLogView'),
+    model: logModel
+  });
+
+  statusView = new azkaban.StatusView({
+    el: $('#flow-status'),
+    model: graphModel
+  });
 
   flowStatsModel = new azkaban.FlowStatsModel();
-	flowStatsView = new azkaban.FlowStatsView({
-		el: $('#flow-stats-container'),
-		model: flowStatsModel,
+  flowStatsView = new azkaban.FlowStatsView({
+    el: $('#flow-stats-container'),
+    model: flowStatsModel,
     histogram: false
-	});
+  });
 
   statsView = new azkaban.StatsView({
-		el: $('#statsView'),
-		model: graphModel
-	});
-
-	executionListView = new azkaban.ExecutionListView({
-		el: $('#jobListView'),
-		model: graphModel
-	});
-
-	var requestURL = contextURL + "/executor";
-	var requestData = {"execid": execId, "ajax":"fetchexecflow"};
-	var successHandler = function(data) {
-		console.log("data fetched");
-		graphModel.addFlow(data);
-		graphModel.trigger("change:graph");
-
-		updateTime = Math.max(updateTime, data.submitTime);
-		updateTime = Math.max(updateTime, data.startTime);
-		updateTime = Math.max(updateTime, data.endTime);
-
-		if (window.location.hash) {
-			var hash = window.location.hash;
-			if (hash == "#jobslist") {
-				flowTabView.handleJobslistLinkClick();
-			}
-			else if (hash == "#log") {
-				flowTabView.handleLogLinkClick();
-			}
-			else if (hash == "#stats") {
-				flowTabView.handleStatsLinkClick();
-			}
-		}
-		else {
-			flowTabView.handleGraphLinkClick();
-		}
-		updaterFunction();
-		logUpdaterFunction();
-	};
-	ajaxCall(requestURL, requestData, successHandler);
+    el: $('#statsView'),
+    model: graphModel
+  });
+
+  executionListView = new azkaban.ExecutionListView({
+    el: $('#jobListView'),
+    model: graphModel
+  });
+
+  var requestURL = contextURL + "/executor";
+  var requestData = {"execid": execId, "ajax": "fetchexecflow"};
+  var successHandler = function (data) {
+    console.log("data fetched");
+    graphModel.addFlow(data);
+    graphModel.trigger("change:graph");
+
+    updateTime = Math.max(updateTime, data.submitTime);
+    updateTime = Math.max(updateTime, data.startTime);
+    updateTime = Math.max(updateTime, data.endTime);
+
+    if (window.location.hash) {
+      var hash = window.location.hash;
+      if (hash == "#jobslist") {
+        flowTabView.handleJobslistLinkClick();
+      }
+      else if (hash == "#log") {
+        flowTabView.handleLogLinkClick();
+      }
+      else if (hash == "#stats") {
+        flowTabView.handleStatsLinkClick();
+      }
+    }
+    else {
+      flowTabView.handleGraphLinkClick();
+    }
+    updaterFunction();
+    logUpdaterFunction();
+  };
+  ajaxCall(requestURL, requestData, successHandler);
 });
diff --git a/azkaban-web-server/src/web/js/azkaban/view/flow.js b/azkaban-web-server/src/web/js/azkaban/view/flow.js
index 8feca89..6d5b669 100644
--- a/azkaban-web-server/src/web/js/azkaban/view/flow.js
+++ b/azkaban-web-server/src/web/js/azkaban/view/flow.js
@@ -16,7 +16,7 @@
 
 $.namespace('azkaban');
 
-var handleJobMenuClick = function(action, el, pos) {
+var handleJobMenuClick = function (action, el, pos) {
   var jobid = el[0].jobid;
   var requestURL = contextURL + "/manager?project=" + projectName + "&flow=" +
       flowId + "&job=" + jobid;
@@ -36,7 +36,7 @@ azkaban.FlowTabView = Backbone.View.extend({
     "click #summaryViewLink": "handleSummaryLinkClick"
   },
 
-  initialize: function(settings) {
+  initialize: function (settings) {
     var selectedView = settings.selectedView;
     if (selectedView == "executions") {
       this.handleExecutionLinkClick();
@@ -46,11 +46,11 @@ azkaban.FlowTabView = Backbone.View.extend({
     }
   },
 
-  render: function() {
+  render: function () {
     console.log("render graph");
   },
 
-  handleGraphLinkClick: function(){
+  handleGraphLinkClick: function () {
     $("#executionsViewLink").removeClass("active");
     $("#graphViewLink").addClass("active");
     $('#summaryViewLink').removeClass('active');
@@ -60,7 +60,7 @@ azkaban.FlowTabView = Backbone.View.extend({
     $('#summaryView').hide();
   },
 
-  handleExecutionLinkClick: function() {
+  handleExecutionLinkClick: function () {
     $("#graphViewLink").removeClass("active");
     $("#executionsViewLink").addClass("active");
     $('#summaryViewLink').removeClass('active');
@@ -71,7 +71,7 @@ azkaban.FlowTabView = Backbone.View.extend({
     executionModel.trigger("change:view");
   },
 
-  handleSummaryLinkClick: function() {
+  handleSummaryLinkClick: function () {
     $('#graphViewLink').removeClass('active');
     $('#executionsViewLink').removeClass('active');
     $('#summaryViewLink').addClass('active');
@@ -91,14 +91,14 @@ azkaban.ExecutionsView = Backbone.View.extend({
     "click #pageSelection li": "handleChangePageSelection"
   },
 
-  initialize: function(settings) {
+  initialize: function (settings) {
     this.model.bind('change:view', this.handleChangeView, this);
     this.model.bind('render', this.render, this);
     this.model.set({page: 1, pageSize: 16});
     this.model.bind('change:page', this.handlePageChange, this);
   },
 
-  render: function(evt) {
+  render: function (evt) {
     console.log("render");
     // Render page selections
     var tbody = $("#execTableBody");
@@ -110,7 +110,8 @@ azkaban.ExecutionsView = Backbone.View.extend({
 
       var tdId = document.createElement("td");
       var execA = document.createElement("a");
-      $(execA).attr("href", contextURL + "/executor?execid=" + executions[i].execId);
+      $(execA).attr("href", contextURL + "/executor?execid="
+          + executions[i].execId);
       $(execA).text(executions[i].execId);
       tdId.appendChild(execA);
       row.appendChild(tdId);
@@ -144,7 +145,7 @@ azkaban.ExecutionsView = Backbone.View.extend({
       row.appendChild(tdEndTime);
 
       var tdElapsed = document.createElement("td");
-      $(tdElapsed).text( getDuration(executions[i].startTime, lastTime));
+      $(tdElapsed).text(getDuration(executions[i].startTime, lastTime));
       row.appendChild(tdElapsed);
 
       var tdStatus = document.createElement("td");
@@ -164,9 +165,9 @@ azkaban.ExecutionsView = Backbone.View.extend({
     this.renderPagination(evt);
   },
 
-  renderPagination: function(evt) {
+  renderPagination: function (evt) {
     var total = this.model.get("total");
-    total = total? total : 1;
+    total = total ? total : 1;
     var pageSize = this.model.get("pageSize");
     var numPages = Math.ceil(total / pageSize);
 
@@ -226,15 +227,15 @@ azkaban.ExecutionsView = Backbone.View.extend({
       startPage = page - 2;
     }
 
-    $("#page"+selectionPosition).addClass("active");
-    $("#page"+selectionPosition)[0].page = page;
+    $("#page" + selectionPosition).addClass("active");
+    $("#page" + selectionPosition)[0].page = page;
     var selecta = $("#page" + selectionPosition + " a");
     selecta.text(page);
     selecta.attr("href", "#page" + page);
 
     for (var j = 0; j < 5; ++j) {
       var realPage = startPage + j;
-      var elementId = "#page" + (j+1);
+      var elementId = "#page" + (j + 1);
 
       $(elementId)[0].page = realPage;
       var a = $(elementId + " a");
@@ -243,7 +244,7 @@ azkaban.ExecutionsView = Backbone.View.extend({
     }
   },
 
-  handleChangePageSelection: function(evt) {
+  handleChangePageSelection: function (evt) {
     if ($(evt.currentTarget).hasClass("disabled")) {
       return;
     }
@@ -251,7 +252,7 @@ azkaban.ExecutionsView = Backbone.View.extend({
     this.model.set({"page": page});
   },
 
-  handleChangeView: function(evt) {
+  handleChangeView: function (evt) {
     if (this.init) {
       return;
     }
@@ -260,7 +261,7 @@ azkaban.ExecutionsView = Backbone.View.extend({
     this.init = true;
   },
 
-  handlePageChange: function(evt) {
+  handlePageChange: function (evt) {
     var page = this.model.get("page") - 1;
     var pageSize = this.model.get("pageSize");
     var requestURL = contextURL + "/manager";
@@ -273,7 +274,7 @@ azkaban.ExecutionsView = Backbone.View.extend({
       "start": page * pageSize,
       "length": pageSize
     };
-    var successHandler = function(data) {
+    var successHandler = function (data) {
       model.set({
         "executions": data.executions,
         "total": data.total
@@ -290,7 +291,7 @@ azkaban.SummaryView = Backbone.View.extend({
     'click #analyze-btn': 'fetchLastRun'
   },
 
-  initialize: function(settings) {
+  initialize: function (settings) {
     this.model.bind('change:view', this.handleChangeView, this);
     this.model.bind('render', this.render, this);
 
@@ -299,7 +300,7 @@ azkaban.SummaryView = Backbone.View.extend({
     this.model.trigger('render');
   },
 
-  fetchDetails: function() {
+  fetchDetails: function () {
     var requestURL = contextURL + "/manager";
     var requestData = {
       'ajax': 'fetchflowdetails',
@@ -309,7 +310,7 @@ azkaban.SummaryView = Backbone.View.extend({
 
     var model = this.model;
 
-    var successHandler = function(data) {
+    var successHandler = function (data) {
       console.log(data);
       model.set({
         'jobTypes': data.jobTypes
@@ -319,7 +320,7 @@ azkaban.SummaryView = Backbone.View.extend({
     $.get(requestURL, requestData, successHandler, 'json');
   },
 
-  fetchSchedule: function() {
+  fetchSchedule: function () {
     var requestURL = contextURL + "/schedule"
     var requestData = {
       'ajax': 'fetchSchedule',
@@ -328,7 +329,7 @@ azkaban.SummaryView = Backbone.View.extend({
     };
     var model = this.model;
     var view = this;
-    var successHandler = function(data) {
+    var successHandler = function (data) {
       model.set({'schedule': data.schedule});
       model.trigger('render');
       view.fetchSla();
@@ -336,7 +337,7 @@ azkaban.SummaryView = Backbone.View.extend({
     $.get(requestURL, requestData, successHandler, 'json');
   },
 
-  fetchSla: function() {
+  fetchSla: function () {
     var schedule = this.model.get('schedule');
     if (schedule == null || schedule.scheduleId == null) {
       return;
@@ -348,7 +349,7 @@ azkaban.SummaryView = Backbone.View.extend({
       "ajax": "slaInfo"
     };
     var model = this.model;
-    var successHandler = function(data) {
+    var successHandler = function (data) {
       if (data == null || data.settings == null || data.settings.length == 0) {
         return;
       }
@@ -359,7 +360,7 @@ azkaban.SummaryView = Backbone.View.extend({
     $.get(requestURL, requestData, successHandler, 'json');
   },
 
-  fetchLastRun: function() {
+  fetchLastRun: function () {
     var requestURL = contextURL + "/manager";
     var requestData = {
       'ajax': 'fetchLastSuccessfulFlowExecution',
@@ -367,9 +368,9 @@ azkaban.SummaryView = Backbone.View.extend({
       'flow': flowId
     };
     var view = this;
-    var successHandler = function(data) {
+    var successHandler = function (data) {
       if (data.success == "false" || data.execId == null) {
-        dust.render("flowstats-no-data", data, function(err, out) {
+        dust.render("flowstats-no-data", data, function (err, out) {
           $('#flow-stats-container').html(out);
         });
         return;
@@ -379,17 +380,17 @@ azkaban.SummaryView = Backbone.View.extend({
     $.get(requestURL, requestData, successHandler, 'json');
   },
 
-  handleChangeView: function(evt) {
+  handleChangeView: function (evt) {
   },
 
-  render: function(evt) {
+  render: function (evt) {
     var data = {
       projectName: projectName,
       flowName: flowId,
-          jobTypes: this.model.get('jobTypes'),
+      jobTypes: this.model.get('jobTypes'),
       schedule: this.model.get('schedule'),
     };
-    dust.render("flowsummary", data, function(err, out) {
+    dust.render("flowsummary", data, function (err, out) {
       $('#summary-view-content').html(out);
     });
   },
@@ -410,7 +411,7 @@ var flowStatsModel;
 var executionsTimeGraphView;
 var slaView;
 
-$(function() {
+$(function () {
   var selected;
   // Execution model has to be created before the window switches the tabs.
   executionModel = new azkaban.ExecutionModel();
@@ -459,11 +460,11 @@ $(function() {
     modelField: 'executions'
   });
 
-  slaView = new azkaban.ChangeSlaView({el:$('#sla-options')});
+  slaView = new azkaban.ChangeSlaView({el: $('#sla-options')});
 
   var requestURL = contextURL + "/manager";
   // Set up the Flow options view. Create a new one every time :p
-  $('#executebtn').click(function() {
+  $('#executebtn').click(function () {
     var data = graphModel.get("data");
     var nodes = data.nodes;
     var executingData = {
@@ -480,7 +481,7 @@ $(function() {
     "ajax": "fetchflowgraph",
     "flow": flowId
   };
-  var successHandler = function(data) {
+  var successHandler = function (data) {
     console.log("data fetched");
     graphModel.addFlow(data);
     graphModel.trigger("change:graph");
diff --git a/azkaban-web-server/src/web/js/azkaban/view/flow-execute-dialog.js b/azkaban-web-server/src/web/js/azkaban/view/flow-execute-dialog.js
index 9fc85eb..7464f41 100644
--- a/azkaban-web-server/src/web/js/azkaban/view/flow-execute-dialog.js
+++ b/azkaban-web-server/src/web/js/azkaban/view/flow-execute-dialog.js
@@ -24,9 +24,9 @@ azkaban.FlowExecuteDialogView = Backbone.View.extend({
     "click #execute-btn": "handleExecuteFlow"
   },
 
-  initialize: function(settings) {
+  initialize: function (settings) {
     this.model.bind('change:flowinfo', this.changeFlowInfo, this);
-    $("#override-success-emails").click(function(evt) {
+    $("#override-success-emails").click(function (evt) {
       if ($(this).is(':checked')) {
         $('#success-emails').attr('disabled', null);
       }
@@ -35,7 +35,7 @@ azkaban.FlowExecuteDialogView = Backbone.View.extend({
       }
     });
 
-    $("#override-failure-emails").click(function(evt) {
+    $("#override-failure-emails").click(function (evt) {
       if ($(this).is(':checked')) {
         $('#failure-emails').attr('disabled', null);
       }
@@ -45,10 +45,10 @@ azkaban.FlowExecuteDialogView = Backbone.View.extend({
     });
   },
 
-  render: function() {
+  render: function () {
   },
 
-  getExecutionOptionData: function() {
+  getExecutionOptionData: function () {
     var failureAction = $('#failure-action').val();
     var failureEmails = $('#failure-emails').val();
     var successEmails = $('#success-emails').val();
@@ -104,7 +104,7 @@ azkaban.FlowExecuteDialogView = Backbone.View.extend({
     return executingData;
   },
 
-  changeFlowInfo: function() {
+  changeFlowInfo: function () {
     var successEmails = this.model.get("successEmails");
     var failureEmails = this.model.get("failureEmails");
     var failureActions = this.model.get("failureAction");
@@ -123,13 +123,13 @@ azkaban.FlowExecuteDialogView = Backbone.View.extend({
       $('#override-success-emails').attr('checked', true);
     }
     else {
-      $('#success-emails').attr('disabled','disabled');
+      $('#success-emails').attr('disabled', 'disabled');
     }
     if (overrideFailureEmails) {
       $('#override-failure-emails').attr('checked', true);
     }
     else {
-      $('#failure-emails').attr('disabled','disabled');
+      $('#failure-emails').attr('disabled', 'disabled');
     }
 
     if (successEmails) {
@@ -152,7 +152,8 @@ azkaban.FlowExecuteDialogView = Backbone.View.extend({
     }
 
     if (concurrentOption) {
-      $('input[value='+concurrentOption+'][name="concurrent"]').attr('checked', true);
+      $('input[value=' + concurrentOption + '][name="concurrent"]').attr(
+          'checked', true);
     }
     if (pipelineLevel) {
       $('#pipeline-level').val(pipelineLevel);
@@ -171,7 +172,7 @@ azkaban.FlowExecuteDialogView = Backbone.View.extend({
     }
   },
 
-  show: function(data) {
+  show: function (data) {
     var projectName = data.project;
     var flowId = data.flow;
     var jobId = data.job;
@@ -184,7 +185,7 @@ azkaban.FlowExecuteDialogView = Backbone.View.extend({
     this.flowId = flowId;
 
     var self = this;
-    var loadCallback = function() {
+    var loadCallback = function () {
       if (jobId) {
         self.showExecuteJob(projectName, flowId, jobId, data.withDep);
       }
@@ -198,7 +199,7 @@ azkaban.FlowExecuteDialogView = Backbone.View.extend({
     this.loadFlowInfo(projectName, flowId, execId);
   },
 
-  showExecuteFlow: function(projectName, flowId) {
+  showExecuteFlow: function (projectName, flowId) {
     $("#execute-flow-panel-title").text("Execute Flow " + flowId);
     this.showExecutionOptionPanel();
 
@@ -206,7 +207,7 @@ azkaban.FlowExecuteDialogView = Backbone.View.extend({
     this.model.trigger("change:graph");
   },
 
-  showExecuteJob: function(projectName, flowId, jobId, withDep) {
+  showExecuteJob: function (projectName, flowId, jobId, withDep) {
     sideMenuDialogView.menuSelect($("#flow-option"));
     $("#execute-flow-panel-title").text("Execute Flow " + flowId);
 
@@ -227,39 +228,39 @@ azkaban.FlowExecuteDialogView = Backbone.View.extend({
     this.model.trigger("change:graph");
   },
 
-  showExecutionOptionPanel: function() {
+  showExecutionOptionPanel: function () {
     sideMenuDialogView.menuSelect($("#flow-option"));
     $('#execute-flow-panel').modal();
   },
 
-  hideExecutionOptionPanel: function() {
+  hideExecutionOptionPanel: function () {
     $('#execute-flow-panel').modal("hide");
   },
 
-  scheduleClick: function() {
+  scheduleClick: function () {
     console.log("click schedule button.");
     this.hideExecutionOptionPanel();
     schedulePanelView.showSchedulePanel();
   },
 
-  loadFlowInfo: function(projectName, flowId, execId) {
+  loadFlowInfo: function (projectName, flowId, execId) {
     console.log("Loading flow " + flowId);
     fetchFlowInfo(this.model, projectName, flowId, execId);
   },
 
-  loadGraph: function(projectName, flowId, exgraph, callback) {
+  loadGraph: function (projectName, flowId, exgraph, callback) {
     console.log("Loading flow " + flowId);
     var requestURL = contextURL + "/executor";
 
     var graphModel = executableGraphModel;
     // fetchFlow(this.model, projectName, flowId, true);
     var requestData = {
-        "project": projectName,
-        "ajax": "fetchscheduledflowgraph",
-        "flow": flowId
-      };
+      "project": projectName,
+      "ajax": "fetchscheduledflowgraph",
+      "flow": flowId
+    };
     var self = this;
-    var successHandler = function(data) {
+    var successHandler = function (data) {
       console.log("data fetched");
       graphModel.addFlow(data);
 
@@ -288,11 +289,11 @@ azkaban.FlowExecuteDialogView = Backbone.View.extend({
     $.get(requestURL, requestData, successHandler, "json");
   },
 
-  assignInitialStatus: function(data, statusData) {
+  assignInitialStatus: function (data, statusData) {
     // Copies statuses over from the previous execution if it exists.
     var statusNodeMap = statusData.nodeMap;
     var nodes = data.nodes;
-    for (var i = 0; i<nodes.length; ++i) {
+    for (var i = 0; i < nodes.length; ++i) {
       var node = nodes[i];
       var statusNode = statusNodeMap[node.id];
       if (statusNode) {
@@ -307,7 +308,7 @@ azkaban.FlowExecuteDialogView = Backbone.View.extend({
     }
   },
 
-  handleExecuteFlow: function(evt) {
+  handleExecuteFlow: function (evt) {
     console.log("click schedule button.");
     var executeURL = contextURL + "/executor";
     var executingData = this.getExecutionOptionData();
@@ -323,10 +324,10 @@ azkaban.EditTableView = Backbone.View.extend({
     "click table .remove-btn": "handleRemoveColumn"
   },
 
-  initialize: function(setting) {
+  initialize: function (setting) {
   },
 
-  handleAddRow: function(data) {
+  handleAddRow: function (data) {
     var name = "";
     if (data.paramkey) {
       name = data.paramkey;
@@ -372,7 +373,7 @@ azkaban.EditTableView = Backbone.View.extend({
     return tr;
   },
 
-  handleEditColumn: function(evt) {
+  handleEditColumn: function (evt) {
     var curTarget = evt.currentTarget;
 
     var text = $(curTarget).children(".spanValue").text();
@@ -388,25 +389,25 @@ azkaban.EditTableView = Backbone.View.extend({
     $(input).focus();
 
     var obj = this;
-    $(input).focusout(function(evt) {
+    $(input).focusout(function (evt) {
       obj.closeEditingTarget(evt);
     });
 
-    $(input).keypress(function(evt) {
+    $(input).keypress(function (evt) {
       if (evt.which == 13) {
         obj.closeEditingTarget(evt);
       }
     });
   },
 
-  handleRemoveColumn: function(evt) {
+  handleRemoveColumn: function (evt) {
     var curTarget = evt.currentTarget;
     // Should be the table
     var row = curTarget.parentElement.parentElement;
     $(row).remove();
   },
 
-  closeEditingTarget: function(evt) {
+  closeEditingTarget: function (evt) {
     var input = evt.currentTarget;
     var text = $(input).val();
     var parent = $(input).parent();
@@ -438,9 +439,9 @@ azkaban.SideMenuDialogView = Backbone.View.extend({
     "click .menu-header": "menuClick"
   },
 
-  initialize: function(settings) {
+  initialize: function (settings) {
     var children = $(this.el).children();
-    for (var i = 0; i < children.length; ++i ) {
+    for (var i = 0; i < children.length; ++i) {
       var child = children[i];
       $(child).addClass("menu-header");
       var caption = $(child).find(".menu-caption");
@@ -449,20 +450,20 @@ azkaban.SideMenuDialogView = Backbone.View.extend({
     this.menuSelect($("#flow-option"));
   },
 
-  menuClick: function(evt) {
+  menuClick: function (evt) {
     this.menuSelect(evt.currentTarget);
   },
 
-  menuSelect: function(target) {
+  menuSelect: function (target) {
     if ($(target).hasClass("active")) {
       return;
     }
 
-    $(".side-panel").each(function() {
+    $(".side-panel").each(function () {
       $(this).hide();
     });
 
-    $(".menu-header").each(function() {
+    $(".menu-header").each(function () {
       $(this).find(".menu-caption").slideUp("fast");
       $(this).removeClass("active");
     });
@@ -474,10 +475,11 @@ azkaban.SideMenuDialogView = Backbone.View.extend({
   }
 });
 
-var handleJobMenuClick = function(action, el, pos) {
+var handleJobMenuClick = function (action, el, pos) {
   var jobid = el[0].jobid;
 
-  var requestURL = contextURL + "/manager?project=" + projectName + "&flow=" + flowName + "&job=" + jobid;
+  var requestURL = contextURL + "/manager?project=" + projectName + "&flow="
+      + flowName + "&job=" + jobid;
   if (action == "open") {
     window.location.href = requestURL;
   }
@@ -491,7 +493,7 @@ var executableGraphModel;
 /**
  * Disable jobs that need to be disabled
  */
-var disableFinishedJobs = function(data) {
+var disableFinishedJobs = function (data) {
   for (var i = 0; i < data.nodes.length; ++i) {
     var node = data.nodes[i];
 
@@ -514,17 +516,17 @@ var disableFinishedJobs = function(data) {
 /**
  * Enable all jobs. Recurse
  */
-var enableAll = function() {
+var enableAll = function () {
   recurseTree(executableGraphModel.get("data"), false, false);
   executableGraphModel.trigger("change:disabled");
 }
 
-var disableAll = function() {
+var disableAll = function () {
   recurseTree(executableGraphModel.get("data"), true, false);
   executableGraphModel.trigger("change:disabled");
 }
 
-var recurseTree = function(data, disabled, recurse) {
+var recurseTree = function (data, disabled, recurse) {
   for (var i = 0; i < data.nodes.length; ++i) {
     var node = data.nodes[i];
     node.disabled = disabled;
@@ -535,12 +537,12 @@ var recurseTree = function(data, disabled, recurse) {
   }
 }
 
-var touchNode = function(node, disable) {
+var touchNode = function (node, disable) {
   node.disabled = disable;
   executableGraphModel.trigger("change:disabled");
 }
 
-var touchParents = function(node, disable) {
+var touchParents = function (node, disable) {
   var inNodes = node.inNodes;
 
   if (inNodes) {
@@ -552,7 +554,7 @@ var touchParents = function(node, disable) {
   executableGraphModel.trigger("change:disabled");
 }
 
-var touchChildren = function(node, disable) {
+var touchChildren = function (node, disable) {
   var outNodes = node.outNodes;
 
   if (outNodes) {
@@ -564,19 +566,19 @@ var touchChildren = function(node, disable) {
   executableGraphModel.trigger("change:disabled");
 }
 
-var touchAncestors = function(node, disable) {
+var touchAncestors = function (node, disable) {
   recurseAllAncestors(node, disable);
 
   executableGraphModel.trigger("change:disabled");
 }
 
-var touchDescendents = function(node, disable) {
+var touchDescendents = function (node, disable) {
   recurseAllDescendents(node, disable);
 
   executableGraphModel.trigger("change:disabled");
 }
 
-var gatherDisabledNodes = function(data) {
+var gatherDisabledNodes = function (data) {
   var nodes = data.nodes;
   var disabled = [];
 
@@ -618,7 +620,7 @@ function recurseAllDescendents(node, disable) {
   }
 }
 
-var expanelNodeClickCallback = function(event, model, node) {
+var expanelNodeClickCallback = function (event, model, node) {
   console.log("Node clicked callback");
   var jobId = node.id;
   var flowId = executableGraphModel.get("flowId");
@@ -626,74 +628,164 @@ var expanelNodeClickCallback = function(event, model, node) {
 
   var menu;
   if (type == "flow") {
-    var flowRequestURL = contextURL + "/manager?project=" + projectName + "&flow=" + node.flowId;
+    var flowRequestURL = contextURL + "/manager?project=" + projectName
+        + "&flow=" + node.flowId;
     if (node.expanded) {
       menu = [
-        {title: "Collapse Flow...", callback: function() {model.trigger("collapseFlow", node);}},
-        {title: "Open Flow in New Window...", callback: function() {window.open(flowRequestURL);}}
+        {
+          title: "Collapse Flow...", callback: function () {
+          model.trigger("collapseFlow", node);
+        }
+        },
+        {
+          title: "Open Flow in New Window...", callback: function () {
+          window.open(flowRequestURL);
+        }
+        }
       ];
 
     }
     else {
       menu = [
-        {title: "Expand Flow...", callback: function() {model.trigger("expandFlow", node);}},
-        {title: "Open Flow in New Window...", callback: function() {window.open(flowRequestURL);}}
+        {
+          title: "Expand Flow...", callback: function () {
+          model.trigger("expandFlow", node);
+        }
+        },
+        {
+          title: "Open Flow in New Window...", callback: function () {
+          window.open(flowRequestURL);
+        }
+        }
       ];
     }
   }
   else {
-    var requestURL = contextURL + "/manager?project=" + projectName + "&flow=" + flowId + "&job=" + jobId;
+    var requestURL = contextURL + "/manager?project=" + projectName + "&flow="
+        + flowId + "&job=" + jobId;
     menu = [
-        {title: "Open Job in New Window...", callback: function() {window.open(requestURL);}},
-      ];
+      {
+        title: "Open Job in New Window...", callback: function () {
+        window.open(requestURL);
+      }
+      },
+    ];
   }
 
   $.merge(menu, [
     {break: 1},
-    {title: "Enable", callback: function() {touchNode(node, false);}, submenu: [
-      {title: "Parents", callback: function(){touchParents(node, false);}},
-      {title: "Ancestors", callback: function(){touchAncestors(node, false);}},
-      {title: "Children", callback: function(){touchChildren(node, false);}},
-      {title: "Descendents", callback: function(){touchDescendents(node, false);}},
-      {title: "Enable All", callback: function(){enableAll();}}
-    ]},
-    {title: "Disable", callback: function() {touchNode(node, true)}, submenu: [
-      {title: "Parents", callback: function(){touchParents(node, true);}},
-      {title: "Ancestors", callback: function(){touchAncestors(node, true);}},
-      {title: "Children", callback: function(){touchChildren(node, true);}},
-      {title: "Descendents", callback: function(){touchDescendents(node, true);}},
-      {title: "Disable All", callback: function(){disableAll();}}
-    ]},
-    {title: "Center Job", callback: function() {model.trigger("centerNode", node);}}
+    {
+      title: "Enable", callback: function () {
+      touchNode(node, false);
+    }, submenu: [
+      {
+        title: "Parents", callback: function () {
+        touchParents(node, false);
+      }
+      },
+      {
+        title: "Ancestors", callback: function () {
+        touchAncestors(node, false);
+      }
+      },
+      {
+        title: "Children", callback: function () {
+        touchChildren(node, false);
+      }
+      },
+      {
+        title: "Descendents", callback: function () {
+        touchDescendents(node, false);
+      }
+      },
+      {
+        title: "Enable All", callback: function () {
+        enableAll();
+      }
+      }
+    ]
+    },
+    {
+      title: "Disable", callback: function () {
+      touchNode(node, true)
+    }, submenu: [
+      {
+        title: "Parents", callback: function () {
+        touchParents(node, true);
+      }
+      },
+      {
+        title: "Ancestors", callback: function () {
+        touchAncestors(node, true);
+      }
+      },
+      {
+        title: "Children", callback: function () {
+        touchChildren(node, true);
+      }
+      },
+      {
+        title: "Descendents", callback: function () {
+        touchDescendents(node, true);
+      }
+      },
+      {
+        title: "Disable All", callback: function () {
+        disableAll();
+      }
+      }
+    ]
+    },
+    {
+      title: "Center Job", callback: function () {
+      model.trigger("centerNode", node);
+    }
+    }
   ]);
 
-
   contextMenuView.show(event, menu);
 }
 
-var expanelEdgeClickCallback = function(event) {
+var expanelEdgeClickCallback = function (event) {
   console.log("Edge clicked callback");
 }
 
-var expanelGraphClickCallback = function(event) {
+var expanelGraphClickCallback = function (event) {
   console.log("Graph clicked callback");
   var flowId = executableGraphModel.get("flowId");
-  var requestURL = contextURL + "/manager?project=" + projectName + "&flow=" + flowId;
+  var requestURL = contextURL + "/manager?project=" + projectName + "&flow="
+      + flowId;
 
   var menu = [
-    {title: "Open Flow in New Window...", callback: function() {window.open(requestURL);}},
+    {
+      title: "Open Flow in New Window...", callback: function () {
+      window.open(requestURL);
+    }
+    },
     {break: 1},
-    {title: "Enable All", callback: function() {enableAll();}},
-    {title: "Disable All", callback: function() {disableAll();}},
+    {
+      title: "Enable All", callback: function () {
+      enableAll();
+    }
+    },
+    {
+      title: "Disable All", callback: function () {
+      disableAll();
+    }
+    },
     {break: 1},
-    {title: "Center Graph", callback: function() {executableGraphModel.trigger("resetPanZoom");}}
+    {
+      title: "Center Graph", callback: function () {
+      executableGraphModel.trigger("resetPanZoom");
+    }
+    }
   ];
 
   contextMenuView.show(event, menu);
 }
 
 var contextMenuView;
-$(function() {
+$(function () {
   executableGraphModel = new azkaban.GraphModel();
   flowExecuteDialogView = new azkaban.FlowExecuteDialogView({
     el: $('#execute-flow-panel'),
@@ -711,7 +803,7 @@ $(function() {
     el: $('#contextMenu')
   });
 
-  $(document).keyup(function(e) {
+  $(document).keyup(function (e) {
     // escape key maps to keycode `27`
     if (e.keyCode == 27) {
       flowExecuteDialogView.hideExecutionOptionPanel();
diff --git a/azkaban-web-server/src/web/js/azkaban/view/flow-execution-list.js b/azkaban-web-server/src/web/js/azkaban/view/flow-execution-list.js
index 9fe9b0f..ff6acff 100644
--- a/azkaban-web-server/src/web/js/azkaban/view/flow-execution-list.js
+++ b/azkaban-web-server/src/web/js/azkaban/view/flow-execution-list.js
@@ -24,7 +24,7 @@ azkaban.ExecutionListView = Backbone.View.extend({
     //"contextmenu .flow-progress-bar": "handleProgressBoxClick"
   },
 
-  initialize: function(settings) {
+  initialize: function (settings) {
     this.model.bind('change:graph', this.renderJobs, this);
     this.model.bind('change:update', this.updateJobs, this);
 
@@ -33,13 +33,14 @@ azkaban.ExecutionListView = Backbone.View.extend({
     executingBody.level = 0;
   },
 
-  renderJobs: function(evt) {
+  renderJobs: function (evt) {
     var data = this.model.get("data");
     var lastTime = data.endTime == -1 ? (new Date()).getTime() : data.endTime;
     var executingBody = $("#executableBody");
     this.updateJobRow(data.nodes, executingBody);
 
-    var flowLastTime = data.endTime == -1 ? (new Date()).getTime() : data.endTime;
+    var flowLastTime = data.endTime == -1 ? (new Date()).getTime()
+        : data.endTime;
     var flowStartTime = data.startTime;
     this.updateProgressBar(data, flowStartTime, flowLastTime);
   },
@@ -64,7 +65,7 @@ azkaban.ExecutionListView = Backbone.View.extend({
 //    contextMenuView.show(evt, menu);
 //  },
 
-  updateJobs: function(evt) {
+  updateJobs: function (evt) {
     var update = this.model.get("update");
     var lastTime = update.endTime == -1
         ? (new Date()).getTime()
@@ -83,12 +84,14 @@ azkaban.ExecutionListView = Backbone.View.extend({
     this.updateProgressBar(data, flowStartTime, flowLastTime);
   },
 
-  updateJobRow: function(nodes, body) {
+  updateJobRow: function (nodes, body) {
     if (!nodes) {
       return;
     }
 
-    nodes.sort(function(a,b) { return a.startTime - b.startTime; });
+    nodes.sort(function (a, b) {
+      return a.startTime - b.startTime;
+    });
     for (var i = 0; i < nodes.length; ++i) {
       var node = nodes[i].changedNode ? nodes[i].changedNode : nodes[i];
 
@@ -119,7 +122,8 @@ azkaban.ExecutionListView = Backbone.View.extend({
         $(endTimeTd).text(getDateFormat(enddate));
       }
 
-      var progressBar = $(row).find("> td.timeline > .flow-progress > .main-progress");
+      var progressBar = $(row).find(
+          "> td.timeline > .flow-progress > .main-progress");
       if (!progressBar.hasClass(node.status)) {
         for (var j = 0; j < statusList.length; ++j) {
           var status = statusList[j];
@@ -141,7 +145,7 @@ azkaban.ExecutionListView = Backbone.View.extend({
             $(attemptBox).addClass("flow-progress-bar");
             $(attemptBox).addClass("attempt");
 
-            $(attemptBox).css("float","left");
+            $(attemptBox).css("float", "left");
             $(attemptBox).bind("contextmenu", attemptRightClick);
 
             $(progressBar).before(attemptBox);
@@ -153,7 +157,8 @@ azkaban.ExecutionListView = Backbone.View.extend({
 
       var elapsedTime = $(row).find("> td.elapsedTime");
       if (node.endTime == -1) {
-        $(elapsedTime).text(getDuration(node.startTime, (new Date()).getTime()));
+        $(elapsedTime).text(
+            getDuration(node.startTime, (new Date()).getTime()));
       }
       else {
         $(elapsedTime).text(getDuration(node.startTime, node.endTime));
@@ -167,20 +172,22 @@ azkaban.ExecutionListView = Backbone.View.extend({
     }
   },
 
-  updateProgressBar: function(data, flowStartTime, flowLastTime) {
+  updateProgressBar: function (data, flowStartTime, flowLastTime) {
     if (data.startTime == -1) {
       return;
     }
 
     var outerWidth = $(".flow-progress").css("width");
     if (outerWidth) {
-      if (outerWidth.substring(outerWidth.length - 2, outerWidth.length) == "px") {
+      if (outerWidth.substring(outerWidth.length - 2, outerWidth.length)
+          == "px") {
         outerWidth = outerWidth.substring(0, outerWidth.length - 2);
       }
       outerWidth = parseInt(outerWidth);
     }
 
-    var parentLastTime = data.endTime == -1 ? (new Date()).getTime() : data.endTime;
+    var parentLastTime = data.endTime == -1 ? (new Date()).getTime()
+        : data.endTime;
     var parentStartTime = data.startTime;
 
     var factor = outerWidth / (flowLastTime - flowStartTime);
@@ -194,7 +201,8 @@ azkaban.ExecutionListView = Backbone.View.extend({
       // calculate the progress
       var tr = node.joblistrow;
       var outerProgressBar = $(tr).find("> td.timeline > .flow-progress");
-      var progressBar = $(tr).find("> td.timeline > .flow-progress > .main-progress");
+      var progressBar = $(tr).find(
+          "> td.timeline > .flow-progress > .main-progress");
       var offsetLeft = 0;
       var minOffset = 0;
       progressBar.attempt = 0;
@@ -205,7 +213,8 @@ azkaban.ExecutionListView = Backbone.View.extend({
 
       // Add all the attempts
       if (node.pastAttempts) {
-        var logURL = contextURL + "/executor?execid=" + execId + "&job=" + node.nestedId + "&attempt=" +  node.pastAttempts.length;
+        var logURL = contextURL + "/executor?execid=" + execId + "&job="
+            + node.nestedId + "&attempt=" + node.pastAttempts.length;
         var anchor = $(tr).find("> td.details > a");
         if (anchor.length != 0) {
           $(anchor).attr("href", logURL);
@@ -217,27 +226,34 @@ azkaban.ExecutionListView = Backbone.View.extend({
           var pastAttempt = node.pastAttempts[p];
           var pastAttemptBox = pastAttempt.attemptBox;
 
-          var left = (pastAttempt.startTime - flowStartTime)*factor;
-          var width =  Math.max((pastAttempt.endTime - pastAttempt.startTime)*factor, 3);
+          var left = (pastAttempt.startTime - flowStartTime) * factor;
+          var width = Math.max((pastAttempt.endTime - pastAttempt.startTime)
+              * factor, 3);
 
           var margin = left - offsetLeft;
           $(pastAttemptBox).css("margin-left", left - offsetLeft);
           $(pastAttemptBox).css("width", width);
 
-          $(pastAttemptBox).attr("title", "attempt:" + p + "  start:" + getHourMinSec(new Date(pastAttempt.startTime)) + "  end:" + getHourMinSec(new Date(pastAttempt.endTime)));
+          $(pastAttemptBox).attr("title", "attempt:" + p + "  start:"
+              + getHourMinSec(new Date(pastAttempt.startTime)) + "  end:"
+              + getHourMinSec(new Date(pastAttempt.endTime)));
           offsetLeft += width + margin;
         }
       }
 
-      var nodeLastTime = node.endTime == -1 ? (new Date()).getTime() : node.endTime;
-      var left = Math.max((node.startTime-parentStartTime)*factor, minOffset);
+      var nodeLastTime = node.endTime == -1 ? (new Date()).getTime()
+          : node.endTime;
+      var left = Math.max((node.startTime - parentStartTime) * factor,
+          minOffset);
       var margin = left - offsetLeft;
-      var width = Math.max((nodeLastTime - node.startTime)*factor, 3);
+      var width = Math.max((nodeLastTime - node.startTime) * factor, 3);
       width = Math.min(width, outerWidth);
 
       progressBar.css("margin-left", left)
       progressBar.css("width", width);
-      progressBar.attr("title", "attempt:" + progressBar.attempt + "  start:" + getHourMinSec(new Date(node.startTime)) + "  end:" + getHourMinSec(new Date(node.endTime)));
+      progressBar.attr("title", "attempt:" + progressBar.attempt + "  start:"
+          + getHourMinSec(new Date(node.startTime)) + "  end:" + getHourMinSec(
+              new Date(node.endTime)));
 
       if (node.nodes) {
         this.updateProgressBar(node, flowStartTime, flowLastTime);
@@ -245,7 +261,7 @@ azkaban.ExecutionListView = Backbone.View.extend({
     }
   },
 
-  toggleExpandFlow: function(flow) {
+  toggleExpandFlow: function (flow) {
     console.log("Toggle Expand");
     var tr = flow.joblistrow;
     var subFlowRow = tr.subflowrow;
@@ -267,7 +283,7 @@ azkaban.ExecutionListView = Backbone.View.extend({
     }
   },
 
-  addNodeRow: function(node, body) {
+  addNodeRow: function (node, body) {
     var self = this;
     var tr = document.createElement("tr");
     var tdName = document.createElement("td");
@@ -280,7 +296,7 @@ azkaban.ExecutionListView = Backbone.View.extend({
     var tdDetails = document.createElement("td");
     node.joblistrow = tr;
     tr.node = node;
-    var padding = 15*$(body)[0].level;
+    var padding = 15 * $(body)[0].level;
 
     $(tr).append(tdName);
     $(tr).append(tdType);
@@ -318,17 +334,18 @@ azkaban.ExecutionListView = Backbone.View.extend({
     $(outerProgressBar).append(progressBox);
     $(tdTimeline).append(outerProgressBar);
 
-    var requestURL = contextURL + "/manager?project=" + projectName + "&job=" + node.id + "&history";
+    var requestURL = contextURL + "/manager?project=" + projectName + "&job="
+        + node.id + "&history";
     var a = document.createElement("a");
     $(a).attr("href", requestURL);
     $(a).text(node.id);
     $(tdName).append(a);
-    if (node.type=="flow") {
+    if (node.type == "flow") {
       var expandIcon = document.createElement("div");
       $(expandIcon).addClass("listExpand");
       $(tdName).append(expandIcon);
       $(expandIcon).addClass("expandarrow glyphicon glyphicon-chevron-down");
-      $(expandIcon).click(function(evt) {
+      $(expandIcon).click(function (evt) {
         var parent = $(evt.currentTarget).parents("tr")[0];
         self.toggleExpandFlow(parent.node);
       });
@@ -339,7 +356,8 @@ azkaban.ExecutionListView = Backbone.View.extend({
     //$(status).attr("id", node.id + "-status-div");
     tdStatus.appendChild(status);
 
-    var logURL = contextURL + "/executor?execid=" + execId + "&job=" + node.nestedId;
+    var logURL = contextURL + "/executor?execid=" + execId + "&job="
+        + node.nestedId;
     if (node.attempt) {
       logURL += "&attempt=" + node.attempt;
     }
@@ -375,17 +393,26 @@ azkaban.ExecutionListView = Backbone.View.extend({
   }
 });
 
-var attemptRightClick = function(event) {
+var attemptRightClick = function (event) {
   var target = event.currentTarget;
   var job = target.job;
   var attempt = target.attempt;
 
   var jobId = event.currentTarget.jobid;
-  var requestURL = contextURL + "/executor?project=" + projectName + "&execid=" + execId + "&job=" + job + "&attempt=" + attempt;
+  var requestURL = contextURL + "/executor?project=" + projectName + "&execid="
+      + execId + "&job=" + job + "&attempt=" + attempt;
 
   var menu = [
-    {title: "Open Attempt Log...", callback: function() {window.location.href=requestURL;}},
-    {title: "Open Attempt Log in New Window...", callback: function() {window.open(requestURL);}}
+    {
+      title: "Open Attempt Log...", callback: function () {
+      window.location.href = requestURL;
+    }
+    },
+    {
+      title: "Open Attempt Log in New Window...", callback: function () {
+      window.open(requestURL);
+    }
+    }
   ];
 
   contextMenuView.show(event, menu);
diff --git a/azkaban-web-server/src/web/js/azkaban/view/flow-extended.js b/azkaban-web-server/src/web/js/azkaban/view/flow-extended.js
index 686d0a1..12ae3b1 100644
--- a/azkaban-web-server/src/web/js/azkaban/view/flow-extended.js
+++ b/azkaban-web-server/src/web/js/azkaban/view/flow-extended.js
@@ -1,8 +1,8 @@
 azkaban.FlowExtendedViewPanel = Backbone.View.extend({
   events: {
-    "click .closeInfoPanel" : "handleClosePanel"
+    "click .closeInfoPanel": "handleClosePanel"
   },
-  initialize: function(settings) {
+  initialize: function (settings) {
     //this.model.bind('change:flowinfo', this.changeFlowInfo, this);
     $(this.el).show();
     $(this.el).draggable({cancel: ".dataContent", containment: "document"});
@@ -10,13 +10,13 @@ azkaban.FlowExtendedViewPanel = Backbone.View.extend({
     this.render();
     $(this.el).hide();
   },
-  showExtendedView: function(evt) {
+  showExtendedView: function (evt) {
     var event = evt;
 
     $(this.el).css({top: evt.pageY, left: evt.pageX});
     $(this.el).show();
   },
-  render: function(self) {
+  render: function (self) {
     console.log("Changing title");
     $(this.el).find(".nodeId").text(this.model.get("id"));
     $(this.el).find(".nodeType").text(this.model.get("type"));
@@ -50,13 +50,18 @@ azkaban.FlowExtendedViewPanel = Backbone.View.extend({
       $(svgDataFlow).append(svgGraph);
       $(svgDataFlow).resizable();
 
-      this.graphView = new azkaban.SvgGraphView({el: svgDataFlow, model: this.model, render: true, rightClick:  { "node": nodeClickCallback, "graph": graphClickCallback }})
+      this.graphView = new azkaban.SvgGraphView({
+        el: svgDataFlow,
+        model: this.model,
+        render: true,
+        rightClick: {"node": nodeClickCallback, "graph": graphClickCallback}
+      })
     }
     else {
       $(this.el).find(".dataFlow").hide();
     }
   },
-  handleClosePanel: function(self) {
+  handleClosePanel: function (self) {
     $(this.el).hide();
   }
 });
diff --git a/azkaban-web-server/src/web/js/azkaban/view/flow-stats.js b/azkaban-web-server/src/web/js/azkaban/view/flow-stats.js
index a77c3f8..0239eaf 100644
--- a/azkaban-web-server/src/web/js/azkaban/view/flow-stats.js
+++ b/azkaban-web-server/src/web/js/azkaban/view/flow-stats.js
@@ -18,12 +18,11 @@ $.namespace('azkaban');
 
 azkaban.FlowStatsModel = Backbone.Model.extend({});
 azkaban.FlowStatsView = Backbone.View.extend({
-  events: {
-  },
+  events: {},
 
   histogram: true,
 
-  initialize: function(settings) {
+  initialize: function (settings) {
     this.model.bind('change:view', this.handleChangeView, this);
     this.model.bind('render', this.render, this);
     if (settings.histogram != null) {
@@ -31,19 +30,19 @@ azkaban.FlowStatsView = Backbone.View.extend({
     }
   },
 
-  render: function(evt) {
+  render: function (evt) {
   },
 
-  show: function(execId) {
+  show: function (execId) {
     this.analyzeExecution(execId);
   },
 
-  fetchJobs: function(execId) {
+  fetchJobs: function (execId) {
     var requestURL = contextURL + "/executor";
-    var requestData = {"execid": execId, "ajax":"fetchexecflow"};
+    var requestData = {"execid": execId, "ajax": "fetchexecflow"};
     var jobs = [];
-    var successHandler = function(data) {
-      data.nodes.sort(function(a, b) {
+    var successHandler = function (data) {
+      data.nodes.sort(function (a, b) {
         return a.startTime - b.startTime;
       });
       jobs = data.nodes;
@@ -58,7 +57,7 @@ azkaban.FlowStatsView = Backbone.View.extend({
     return jobs;
   },
 
-  fetchJobStats: function(jobId, execId) {
+  fetchJobStats: function (jobId, execId) {
     var requestURL = contextURL + "/executor";
     var requestData = {
       "execid": execId,
@@ -67,7 +66,7 @@ azkaban.FlowStatsView = Backbone.View.extend({
       "ajax": "fetchExecJobStats"
     };
     var stats = null;
-    var successHandler = function(data) {
+    var successHandler = function (data) {
       stats = data;
     };
     $.ajax({
@@ -80,7 +79,7 @@ azkaban.FlowStatsView = Backbone.View.extend({
     return stats;
   },
 
-  updateStatsMapred: function(state, data, job) {
+  updateStatsMapred: function (state, data, job) {
     var stats = data.stats;
     var mappers = parseInt(state.totalMappers);
     var reducers = parseInt(state.totalReducers);
@@ -97,7 +96,7 @@ azkaban.FlowStatsView = Backbone.View.extend({
 
   },
 
-  updateStatsConf: function(conf, data, job) {
+  updateStatsConf: function (conf, data, job) {
     var stats = data.stats;
     if (conf == null) {
       data.warnings.push("No job conf available for job " + job);
@@ -162,7 +161,7 @@ azkaban.FlowStatsView = Backbone.View.extend({
     }
   },
 
-  updateStatsCounters: function(state, data, job) {
+  updateStatsCounters: function (state, data, job) {
     var stats = data.stats;
     if (state.counters == null) {
       data.warnings.push("No job counters available for job " + job);
@@ -198,7 +197,7 @@ azkaban.FlowStatsView = Backbone.View.extend({
     }
   },
 
-  updateStats: function(jobStats, data, job) {
+  updateStats: function (jobStats, data, job) {
     var stats = data.stats;
     var state = jobStats.state;
     var conf = jobStats.conf;
@@ -208,11 +207,11 @@ azkaban.FlowStatsView = Backbone.View.extend({
     this.updateStatsCounters(state, data, job);
   },
 
-  finalizeStats: function(data) {
+  finalizeStats: function (data) {
     data.success = true;
   },
 
-  analyzeExecution: function(execId) {
+  analyzeExecution: function (execId) {
     var jobs = this.fetchJobs(execId);
     if (jobs == null) {
       this.model.set({'data': null});
@@ -316,26 +315,26 @@ azkaban.FlowStatsView = Backbone.View.extend({
     this.model.trigger('render');
   },
 
-  render: function(evt) {
+  render: function (evt) {
     var view = this;
     var data = this.model.get('data');
     if (data == null) {
-      var msg = { message: "Error retrieving flow stats."};
-      dust.render("flowstats-no-data", msg, function(err, out) {
+      var msg = {message: "Error retrieving flow stats."};
+      dust.render("flowstats-no-data", msg, function (err, out) {
         view.display(out);
       });
     }
     else if (data.success == false) {
-      dust.render("flowstats-no-data", data, function(err, out) {
+      dust.render("flowstats-no-data", data, function (err, out) {
         view.display(out);
       });
     }
     else {
       var histogram = this.histogram;
-      dust.render("flowstats", data, function(err, out) {
+      dust.render("flowstats", data, function (err, out) {
         view.display(out);
         if (histogram == true) {
-          var yLabelFormatCallback = function(y) {
+          var yLabelFormatCallback = function (y) {
             var seconds = y / 1000.0;
             return seconds.toString() + " s";
           };
@@ -353,7 +352,7 @@ azkaban.FlowStatsView = Backbone.View.extend({
     }
   },
 
-  display: function(out) {
+  display: function (out) {
     $('#flow-stats-container').html(out);
   },
 });
diff --git a/azkaban-web-server/src/web/js/azkaban/view/history.js b/azkaban-web-server/src/web/js/azkaban/view/history.js
index 11401b1..9803c9f 100644
--- a/azkaban-web-server/src/web/js/azkaban/view/history.js
+++ b/azkaban-web-server/src/web/js/azkaban/view/history.js
@@ -22,33 +22,35 @@ azkaban.AdvFilterView = Backbone.View.extend({
     "click #filter-btn": "handleAdvFilter"
   },
 
-  initialize: function(settings) {
+  initialize: function (settings) {
     $('#datetimebegin').datetimepicker();
     $('#datetimeend').datetimepicker();
-    $('#datetimebegin').on('change.dp', function(e) {
+    $('#datetimebegin').on('change.dp', function (e) {
       $('#datetimeend').data('DateTimePicker').setStartDate(e.date);
     });
-    $('#datetimeend').on('change.dp', function(e) {
+    $('#datetimeend').on('change.dp', function (e) {
       $('#datetimebegin').data('DateTimePicker').setEndDate(e.date);
     });
     $('#adv-filter-error-msg').hide();
   },
 
-  handleAdvFilter: function(evt) {
+  handleAdvFilter: function (evt) {
     console.log("handleAdv");
     var projcontain = $('#projcontain').val();
     var flowcontain = $('#flowcontain').val();
     var usercontain = $('#usercontain').val();
     var status = $('#status').val();
-    var begin  = $('#datetimebegin').val();
-    var end    = $('#datetimeend').val();
+    var begin = $('#datetimebegin').val();
+    var end = $('#datetimeend').val();
 
     console.log("filtering history");
 
     var historyURL = contextURL + "/history"
     var redirectURL = contextURL + "/schedule"
 
-    var requestURL = historyURL + "?advfilter=true" + "&projcontain=" + projcontain + "&flowcontain=" + flowcontain + "&usercontain=" + usercontain + "&status=" + status + "&begin=" + begin + "&end=" + end ;
+    var requestURL = historyURL + "?advfilter=true" + "&projcontain="
+        + projcontain + "&flowcontain=" + flowcontain + "&usercontain="
+        + usercontain + "&status=" + status + "&begin=" + begin + "&end=" + end;
     window.location = requestURL;
 
     /*
@@ -67,13 +69,13 @@ azkaban.AdvFilterView = Backbone.View.extend({
   */
   },
 
-  render: function() {
+  render: function () {
   }
 });
 
-$(function() {
+$(function () {
   filterView = new azkaban.AdvFilterView({el: $('#adv-filter')});
-  $('#adv-filter-btn').click( function() {
+  $('#adv-filter-btn').click(function () {
     $('#adv-filter').modal();
   });
 });
diff --git a/azkaban-web-server/src/web/js/azkaban/view/history-day.js b/azkaban-web-server/src/web/js/azkaban/view/history-day.js
index 732028b..cee7090 100644
--- a/azkaban-web-server/src/web/js/azkaban/view/history-day.js
+++ b/azkaban-web-server/src/web/js/azkaban/view/history-day.js
@@ -21,18 +21,17 @@ azkaban.DayDataModel = Backbone.Model.extend({});
 
 var dayByDayView;
 azkaban.DayByDayView = Backbone.View.extend({
-  events: {
-  },
-  initialize: function(settings) {
+  events: {},
+  initialize: function (settings) {
     this.svgns = "http://www.w3.org/2000/svg";
     this.svg = $(this.el).find('svg')[0];
     this.columnDayWidth = 100;
     this.columnHourHeight = 50;
-    this.columnHeight = 50*24;
+    this.columnHeight = 50 * 24;
 
     this.render(this);
   },
-  prepareData: function(self) {
+  prepareData: function (self) {
     var response = model.get("data");
     var start = data.start;
     var end = data.end;
@@ -52,7 +51,7 @@ azkaban.DayByDayView = Backbone.View.extend({
 
     }
   },
-  render: function(self) {
+  render: function (self) {
     var svg = self.svg;
     var svgns = self.svgns;
     var width = $(svg).width();
@@ -63,7 +62,7 @@ azkaban.DayByDayView = Backbone.View.extend({
   }
 });
 
-var showDialog = function(title, message) {
+var showDialog = function (title, message) {
   $('#messageTitle').text(title);
   $('#messageBox').text(message);
 
@@ -80,8 +79,7 @@ var showDialog = function(title, message) {
   });
 }
 
-
-$(function() {
+$(function () {
   var requestURL = contextURL + "/history";
 
   var start = new Date();
@@ -98,13 +96,14 @@ $(function() {
   console.log(end.getTime());
 
   dayDataModel = new azkaban.DayDataModel();
-  dayByDayView = new azkaban.DayByDayView({el:$('#dayByDayPanel'), model: dayDataModel});
+  dayByDayView = new azkaban.DayByDayView(
+      {el: $('#dayByDayPanel'), model: dayDataModel});
 
   $.get(
-    requestURL,
-    {"ajax":"fetch", "start": start.getTime(), "end": end.getTime()},
-    function(data) {
-      dayDataModel.set({data:data});
-    },
-    "json");
+      requestURL,
+      {"ajax": "fetch", "start": start.getTime(), "end": end.getTime()},
+      function (data) {
+        dayDataModel.set({data: data});
+      },
+      "json");
 });
diff --git a/azkaban-web-server/src/web/js/azkaban/view/jmx.js b/azkaban-web-server/src/web/js/azkaban/view/jmx.js
index 8f12f1e..ba6c9cc 100644
--- a/azkaban-web-server/src/web/js/azkaban/view/jmx.js
+++ b/azkaban-web-server/src/web/js/azkaban/view/jmx.js
@@ -23,10 +23,10 @@ azkaban.JMXTableView = Backbone.View.extend({
     "click .collapse-btn": "collapseRow"
   },
 
-  initialize: function(settings) {
+  initialize: function (settings) {
   },
 
-  formatValue: function(value) {
+  formatValue: function (value) {
     if (String(value).length != TIMESTAMP_LENGTH) {
       return value;
     }
@@ -40,7 +40,7 @@ azkaban.JMXTableView = Backbone.View.extend({
     return value + " (" + date.toISOString() + ")";
   },
 
-  queryJMX: function(evt) {
+  queryJMX: function (evt) {
     var target = evt.currentTarget;
     var id = target.id;
 
@@ -48,7 +48,8 @@ azkaban.JMXTableView = Backbone.View.extend({
     var tbody = id + "-tbody";
 
     var requestURL = contextURL + "/jmx";
-    var canonicalName=$(target).attr("domain") + ":name=" + $(target).attr("name");
+    var canonicalName = $(target).attr("domain") + ":name=" + $(target).attr(
+        "name");
 
     var data = {
       "ajax": "getAllMBeanAttributes",
@@ -59,7 +60,7 @@ azkaban.JMXTableView = Backbone.View.extend({
       data.hostPort = $(target).attr("hostPort");
     }
     var view = this;
-    var successHandler = function(data) {
+    var successHandler = function (data) {
       var table = $('#' + tbody);
       $(table).empty();
 
@@ -88,7 +89,7 @@ azkaban.JMXTableView = Backbone.View.extend({
     $.get(requestURL, data, successHandler);
   },
 
-  queryRemote: function(evt) {
+  queryRemote: function (evt) {
     var target = evt.currentTarget;
     var id = target.id;
 
@@ -96,7 +97,8 @@ azkaban.JMXTableView = Backbone.View.extend({
     var tbody = id + "-tbody";
 
     var requestURL = contextURL + "/jmx";
-    var canonicalName = $(target).attr("domain") + ":name=" + $(target).attr("name");
+    var canonicalName = $(target).attr("domain") + ":name=" + $(target).attr(
+        "name");
     var hostPort = $(target).attr("hostport");
     var requestData = {
       "ajax": "getAllExecutorAttributes",
@@ -104,7 +106,7 @@ azkaban.JMXTableView = Backbone.View.extend({
       "hostPort": hostPort
     };
     var view = this;
-    var successHandler = function(data) {
+    var successHandler = function (data) {
       var table = $('#' + tbody);
       $(table).empty();
 
@@ -128,25 +130,25 @@ azkaban.JMXTableView = Backbone.View.extend({
       }
 
       var child = $("#" + childID);
-        $(child).fadeIn();
+      $(child).fadeIn();
     };
     $.get(requestURL, requestData, successHandler);
   },
 
-  collapseRow: function(evt) {
+  collapseRow: function (evt) {
     $(evt.currentTarget).parent().parent().fadeOut();
   },
 
-  render: function() {
+  render: function () {
   }
 });
 
 var remoteTables = new Array();
-$(function() {
-  jmxTableView = new azkaban.JMXTableView({el:$('#all-jmx')});
+$(function () {
+  jmxTableView = new azkaban.JMXTableView({el: $('#all-jmx')});
 
-  $(".remoteJMX").each(function(item) {
-    var newTableView = new azkaban.JMXTableView({el:$(this)});
+  $(".remoteJMX").each(function (item) {
+    var newTableView = new azkaban.JMXTableView({el: $(this)});
     remoteTables.push(newTableView);
   });
 });
diff --git a/azkaban-web-server/src/web/js/azkaban/view/job-details.js b/azkaban-web-server/src/web/js/azkaban/view/job-details.js
index 8063797..f4e00cd 100644
--- a/azkaban-web-server/src/web/js/azkaban/view/job-details.js
+++ b/azkaban-web-server/src/web/js/azkaban/view/job-details.js
@@ -19,18 +19,18 @@ $.namespace('azkaban');
 var jobLogView;
 azkaban.JobLogView = Backbone.View.extend({
   events: {
-    "click #updateLogBtn" : "refresh"
+    "click #updateLogBtn": "refresh"
   },
 
-  initialize: function() {
+  initialize: function () {
     this.listenTo(this.model, "change:logData", this.render);
   },
 
-  refresh: function() {
+  refresh: function () {
     this.model.refresh();
   },
 
-  render: function() {
+  render: function () {
     var re = /(https?:\/\/(([-\w\.]+)+(:\d+)?(\/([\w/_\.]*(\?\S+)?)?)?))/g;
     var log = this.model.get("logData");
     log = log.replace(re, "<a href=\"$1\" title=\"\">$1</a>");
@@ -38,7 +38,7 @@ azkaban.JobLogView = Backbone.View.extend({
   }
 });
 
-var showDialog = function(title, message) {
+var showDialog = function (title, message) {
   $('#messageTitle').text(title);
   $('#messageBox').text(message);
   $('#messageDialog').modal({
@@ -54,7 +54,7 @@ var showDialog = function(title, message) {
   });
 }
 
-$(function() {
+$(function () {
   var jobLogModel = new azkaban.JobLogModel();
   jobLogView = new azkaban.JobLogView({
     el: $('#jobLogView'),
diff --git a/azkaban-web-server/src/web/js/azkaban/view/job-edit.js b/azkaban-web-server/src/web/js/azkaban/view/job-edit.js
index 073515e..3a02762 100644
--- a/azkaban-web-server/src/web/js/azkaban/view/job-edit.js
+++ b/azkaban-web-server/src/web/js/azkaban/view/job-edit.js
@@ -18,8 +18,8 @@ $.namespace('azkaban');
 
 var jobEditView;
 azkaban.JobEditView = Backbone.View.extend({
-  events : {
-    "click" : "closeEditingTarget",
+  events: {
+    "click": "closeEditingTarget",
     "click #set-btn": "handleSet",
     "click #cancel-btn": "handleCancel",
     "click #close-btn": "handleCancel",
@@ -28,23 +28,23 @@ azkaban.JobEditView = Backbone.View.extend({
     "click table .remove-btn": "handleRemoveColumn"
   },
 
-  initialize: function(setting) {
+  initialize: function (setting) {
     this.projectURL = contextURL + "manager"
     this.generalParams = {}
     this.overrideParams = {}
   },
 
-  handleCancel: function(evt) {
+  handleCancel: function (evt) {
     $('#job-edit-pane').hide();
     var tbl = document.getElementById("generalProps").tBodies[0];
     var rows = tbl.rows;
     var len = rows.length;
-    for (var i = 0; i < len-1; i++) {
+    for (var i = 0; i < len - 1; i++) {
       tbl.deleteRow(0);
     }
   },
 
-  show: function(projectName, flowName, jobName) {
+  show: function (projectName, flowName, jobName) {
     this.projectName = projectName;
     this.flowName = flowName;
     this.jobName = jobName;
@@ -66,7 +66,7 @@ azkaban.JobEditView = Backbone.View.extend({
       "jobName": this.jobName
     };
     var mythis = this;
-    var fetchJobSuccessHandler = function(data) {
+    var fetchJobSuccessHandler = function (data) {
       if (data.error) {
         alert(data.error);
         return;
@@ -99,7 +99,7 @@ azkaban.JobEditView = Backbone.View.extend({
     $.get(projectURL, fetchJobInfo, fetchJobSuccessHandler, "json");
   },
 
-  handleSet: function(evt) {
+  handleSet: function (evt) {
     this.closeEditingTarget(evt);
     var jobOverride = {};
     var editRows = $(".editRow");
@@ -135,8 +135,9 @@ azkaban.JobEditView = Backbone.View.extend({
     };
 
     var projectURL = this.projectURL
-    var redirectURL = projectURL+'?project='+project+'&flow='+flowName+'&job='+jobName;
-    var jobOverrideSuccessHandler = function(data) {
+    var redirectURL = projectURL + '?project=' + project + '&flow=' + flowName
+        + '&job=' + jobName;
+    var jobOverrideSuccessHandler = function (data) {
       if (data.error) {
         alert(data.error);
       }
@@ -148,7 +149,7 @@ azkaban.JobEditView = Backbone.View.extend({
     $.get(projectURL, jobOverrideData, jobOverrideSuccessHandler, "json");
   },
 
-  handleAddRow: function(evt) {
+  handleAddRow: function (evt) {
     var tr = document.createElement("tr");
     var tdName = document.createElement("td");
     $(tdName).addClass('property-key');
@@ -185,7 +186,7 @@ azkaban.JobEditView = Backbone.View.extend({
     return tr;
   },
 
-  handleEditColumn: function(evt) {
+  handleEditColumn: function (evt) {
     var curTarget = evt.currentTarget;
     if (this.editingTarget != curTarget) {
       this.closeEditingTarget(evt);
@@ -202,7 +203,7 @@ azkaban.JobEditView = Backbone.View.extend({
       $(curTarget).append(input);
       $(input).focus();
       var obj = this;
-      $(input).keypress(function(evt) {
+      $(input).keypress(function (evt) {
         if (evt.which == 13) {
           obj.closeEditingTarget(evt);
         }
@@ -214,14 +215,14 @@ azkaban.JobEditView = Backbone.View.extend({
     evt.stopPropagation();
   },
 
-  handleRemoveColumn: function(evt) {
+  handleRemoveColumn: function (evt) {
     var curTarget = evt.currentTarget;
     // Should be the table
     var row = curTarget.parentElement.parentElement;
     $(row).remove();
   },
 
-  closeEditingTarget: function(evt) {
+  closeEditingTarget: function (evt) {
     if (this.editingTarget == null ||
         this.editingTarget == evt.target ||
         this.editingTarget == evt.target.myparent) {
@@ -253,7 +254,7 @@ azkaban.JobEditView = Backbone.View.extend({
   }
 });
 
-$(function() {
+$(function () {
   jobEditView = new azkaban.JobEditView({
     el: $('#job-edit-pane')
   });
diff --git a/azkaban-web-server/src/web/js/azkaban/view/job-history.js b/azkaban-web-server/src/web/js/azkaban/view/job-history.js
index f2119f5..c52a0ff 100644
--- a/azkaban-web-server/src/web/js/azkaban/view/job-history.js
+++ b/azkaban-web-server/src/web/js/azkaban/view/job-history.js
@@ -14,7 +14,6 @@
  * the License.
  */
 
-
 $.namespace('azkaban');
 
 var jobHistoryView;
@@ -22,7 +21,7 @@ var jobHistoryView;
 var dataModel;
 azkaban.DataModel = Backbone.Model.extend({});
 
-$(function() {
+$(function () {
   var selected;
   var series = dataSeries;
   dataModel = new azkaban.DataModel();
diff --git a/azkaban-web-server/src/web/js/azkaban/view/job-list.js b/azkaban-web-server/src/web/js/azkaban/view/job-list.js
index b9b7f8b..7e17b69 100644
--- a/azkaban-web-server/src/web/js/azkaban/view/job-list.js
+++ b/azkaban-web-server/src/web/js/azkaban/view/job-list.js
@@ -26,10 +26,10 @@ azkaban.JobListView = Backbone.View.extend({
     "click #autoPanZoomBtn": "handleAutoPanZoom",
     "contextmenu li.listElement": "handleContextMenuClick",
     "click .expandarrow": "handleToggleMenuExpand",
-    "click #close-btn" : "handleClose"
+    "click #close-btn": "handleClose"
   },
 
-  initialize: function(settings) {
+  initialize: function (settings) {
     this.model.bind('change:selected', this.handleSelectionChange, this);
     this.model.bind('change:disabled', this.handleDisabledChange, this);
     this.model.bind('change:graph', this.render, this);
@@ -44,7 +44,7 @@ azkaban.JobListView = Backbone.View.extend({
     this.listNodes = {};
   },
 
-  filterJobs: function(self) {
+  filterJobs: function (self) {
     var filter = this.filterInput.val();
     // Clear all filters first
     if (!filter || filter.trim() == "") {
@@ -70,7 +70,8 @@ azkaban.JobListView = Backbone.View.extend({
       var spanlabel = $(li).find("> a > span");
 
       var endIndex = index + filter.length;
-      var newHTML = nodeName.substring(0, index) + "<span class=\"filterHighlight\">" +
+      var newHTML = nodeName.substring(0, index)
+          + "<span class=\"filterHighlight\">" +
           nodeName.substring(index, endIndex) + "</span>" +
           nodeName.substring(endIndex, nodeName.length);
       $(spanlabel).html(newHTML);
@@ -88,7 +89,7 @@ azkaban.JobListView = Backbone.View.extend({
     }
   },
 
-  hideAll: function(self) {
+  hideAll: function (self) {
     for (var key in this.listNodes) {
       var li = this.listNodes[key];
       var label = $(li).find("> a > span");
@@ -98,7 +99,7 @@ azkaban.JobListView = Backbone.View.extend({
     }
   },
 
-  unfilterAll: function(self) {
+  unfilterAll: function (self) {
     for (var key in this.listNodes) {
       var li = this.listNodes[key];
       var label = $(li).find("> a > span");
@@ -108,12 +109,12 @@ azkaban.JobListView = Backbone.View.extend({
     }
   },
 
-  handleStatusUpdate: function(evt) {
+  handleStatusUpdate: function (evt) {
     var data = this.model.get("data");
     this.changeStatuses(data);
   },
 
-  changeStatuses: function(data) {
+  changeStatuses: function (data) {
     for (var i = 0; i < data.nodes.length; ++i) {
       var node = data.nodes[i];
 
@@ -131,7 +132,7 @@ azkaban.JobListView = Backbone.View.extend({
     }
   },
 
-  render: function(self) {
+  render: function (self) {
     var data = this.model.get("data");
     var nodes = data.nodes;
 
@@ -142,18 +143,19 @@ azkaban.JobListView = Backbone.View.extend({
     this.changeStatuses(data);
   },
 
-  renderTree: function(el, data, prefix) {
+  renderTree: function (el, data, prefix) {
     var nodes = data.nodes;
     if (nodes.length == 0) {
       console.log("No results");
       return;
-    };
+    }
+    ;
     if (!prefix) {
       prefix = "";
     }
 
     var nodeArray = nodes.slice(0);
-    nodeArray.sort(function(a, b) {
+    nodeArray.sort(function (a, b) {
       var diff = a.y - b.y;
       if (diff == 0) {
         return a.x - b.x;
@@ -172,7 +174,7 @@ azkaban.JobListView = Backbone.View.extend({
 
       // This is used for the filter step.
       var listNodeName = prefix + nodeArray[i].id;
-      this.listNodes[listNodeName]=li;
+      this.listNodes[listNodeName] = li;
       li.node = nodeArray[i];
       li.node.listElement = li;
 
@@ -205,7 +207,7 @@ azkaban.JobListView = Backbone.View.extend({
     return ul;
   },
 
-  handleMenuExpand: function(li) {
+  handleMenuExpand: function (li) {
     var expandArrow = $(li).find("> a > .expandarrow");
     var submenu = $(li).find("> ul");
 
@@ -214,7 +216,7 @@ azkaban.JobListView = Backbone.View.extend({
     $(submenu).slideDown();
   },
 
-  handleMenuCollapse: function(li) {
+  handleMenuCollapse: function (li) {
     var expandArrow = $(li).find("> a > .expandarrow");
     var submenu = $(li).find("> ul");
 
@@ -223,7 +225,7 @@ azkaban.JobListView = Backbone.View.extend({
     $(submenu).slideUp();
   },
 
-  handleToggleMenuExpand: function(evt) {
+  handleToggleMenuExpand: function (evt) {
     var expandarrow = evt.currentTarget;
     var li = $(evt.currentTarget).closest("li.listElement");
     var submenu = $(li).find("> ul");
@@ -238,14 +240,14 @@ azkaban.JobListView = Backbone.View.extend({
     evt.stopImmediatePropagation();
   },
 
-  handleContextMenuClick: function(evt) {
+  handleContextMenuClick: function (evt) {
     if (this.contextMenu) {
       this.contextMenu(evt, this.model, evt.currentTarget.node);
       return false;
     }
   },
 
-  handleJobClick: function(evt) {
+  handleJobClick: function (evt) {
     console.log("Job clicked");
     var li = $(evt.currentTarget).closest("li.listElement");
     var node = li[0].node;
@@ -270,16 +272,16 @@ azkaban.JobListView = Backbone.View.extend({
     evt.cancelBubble = true;
   },
 
-  handleDisabledChange: function(evt) {
+  handleDisabledChange: function (evt) {
     this.changeDisabled(this.model.get('data'));
   },
 
-  changeDisabled: function(data) {
-    for (var i =0; i < data.nodes; ++i) {
+  changeDisabled: function (data) {
+    for (var i = 0; i < data.nodes; ++i) {
       var node = data.nodes[i];
       if (node.disabled = true) {
         removeClass(node.listElement, "nodedisabled");
-        if (node.type=='flow') {
+        if (node.type == 'flow') {
           this.changeDisabled(node);
         }
       }
@@ -289,7 +291,7 @@ azkaban.JobListView = Backbone.View.extend({
     }
   },
 
-  handleSelectionChange: function(evt) {
+  handleSelectionChange: function (evt) {
     if (!this.model.hasChanged("selected")) {
       return;
     }
@@ -307,7 +309,7 @@ azkaban.JobListView = Backbone.View.extend({
     }
   },
 
-  propagateExpansion: function(li) {
+  propagateExpansion: function (li) {
     var li = $(li).parent().closest("li.listElement")[0];
     if (li) {
       this.propagateExpansion(li);
@@ -315,11 +317,11 @@ azkaban.JobListView = Backbone.View.extend({
     }
   },
 
-  handleResetPanZoom: function(evt) {
+  handleResetPanZoom: function (evt) {
     this.model.trigger("resetPanZoom");
   },
 
-  handleAutoPanZoom: function(evt) {
+  handleAutoPanZoom: function (evt) {
     var target = evt.currentTarget;
     if ($(target).hasClass('btn-default')) {
       $(target).removeClass('btn-default');
@@ -335,10 +337,10 @@ azkaban.JobListView = Backbone.View.extend({
     this.model.set({"autoPanZoom": $(target).hasClass('btn-info')});
   },
 
-  handleClose: function(evt) {
+  handleClose: function (evt) {
     $("#joblist-panel").fadeOut();
   },
-  handleOpen: function(evt) {
+  handleOpen: function (evt) {
     $("#joblist-panel").fadeIn();
   }
 });
diff --git a/azkaban-web-server/src/web/js/azkaban/view/login.js b/azkaban-web-server/src/web/js/azkaban/view/login.js
index 685153a..fdcfdfb 100644
--- a/azkaban-web-server/src/web/js/azkaban/view/login.js
+++ b/azkaban-web-server/src/web/js/azkaban/view/login.js
@@ -23,11 +23,11 @@ azkaban.LoginView = Backbone.View.extend({
     'keypress input': 'handleKeyPress'
   },
 
-  initialize: function(settings) {
+  initialize: function (settings) {
     $('#error-msg').hide();
   },
 
-  handleLogin: function(evt) {
+  handleLogin: function (evt) {
     console.log("Logging in.");
     var username = $("#username").val();
     var password = $("#password").val();
@@ -42,7 +42,7 @@ azkaban.LoginView = Backbone.View.extend({
         username: username,
         password: password
       },
-      success: function(data) {
+      success: function (data) {
         if (data.error) {
           $('#error-msg').text(data.error);
           $('#error-msg').slideDown('fast');
@@ -54,16 +54,16 @@ azkaban.LoginView = Backbone.View.extend({
     });
   },
 
-  handleKeyPress: function(evt) {
+  handleKeyPress: function (evt) {
     if (evt.charCode == 13 || evt.keyCode == 13) {
       this.handleLogin();
     }
   },
 
-  render: function() {
+  render: function () {
   }
 });
 
-$(function() {
+$(function () {
   loginView = new azkaban.LoginView({el: $('#login-form')});
 });
diff --git a/azkaban-web-server/src/web/js/azkaban/view/main.js b/azkaban-web-server/src/web/js/azkaban/view/main.js
index 8ba3851..49542db 100644
--- a/azkaban-web-server/src/web/js/azkaban/view/main.js
+++ b/azkaban-web-server/src/web/js/azkaban/view/main.js
@@ -22,10 +22,10 @@ azkaban.ProjectTableView = Backbone.View.extend({
     "click .project-expander": "expandProject"
   },
 
-  initialize: function(settings) {
+  initialize: function (settings) {
   },
 
-  expandProject: function(evt) {
+  expandProject: function (evt) {
     if (evt.target.tagName == "A") {
       return;
     }
@@ -59,7 +59,8 @@ azkaban.ProjectTableView = Backbone.View.extend({
     }
     else {
       // projectId is available
-      $(target).addClass('wait').removeClass('collapsed').removeClass('expanded');
+      $(target).addClass('wait').removeClass('collapsed').removeClass(
+          'expanded');
       target.loading = true;
 
       var request = {
@@ -67,7 +68,7 @@ azkaban.ProjectTableView = Backbone.View.extend({
         "ajax": "fetchprojectflows"
       };
 
-      var successHandler = function(data) {
+      var successHandler = function (data) {
         console.log("Success");
         target.loaded = true;
         target.loading = false;
@@ -85,12 +86,12 @@ azkaban.ProjectTableView = Backbone.View.extend({
     }
   },
 
-  render: function() {
+  render: function () {
   },
 
-  createFlowListTable: function(data, innerTable) {
+  createFlowListTable: function (data, innerTable) {
     var flows = data.flows;
-    flows.sort(function(a,b) {
+    flows.sort(function (a, b) {
       return a.flowId.localeCompare(b.flowId);
     });
     var requestURL = contextURL + "/manager?project=" + data.project + "&flow=";
@@ -112,7 +113,7 @@ azkaban.ProjectHeaderView = Backbone.View.extend({
     "click #create-project-btn": "handleCreateProjectJob"
   },
 
-  initialize: function(settings) {
+  initialize: function (settings) {
     console.log("project header view initialize.");
     if (settings.errorMsg && settings.errorMsg != "null") {
       $('#messaging').addClass("alert-danger");
@@ -130,11 +131,11 @@ azkaban.ProjectHeaderView = Backbone.View.extend({
     }
   },
 
-  handleCreateProjectJob: function(evt) {
+  handleCreateProjectJob: function (evt) {
     $('#create-project-modal').modal();
   },
 
-  render: function() {
+  render: function () {
   }
 });
 
@@ -144,11 +145,11 @@ azkaban.CreateProjectView = Backbone.View.extend({
     "click #create-btn": "handleCreateProject"
   },
 
-  initialize: function(settings) {
+  initialize: function (settings) {
     $("#modal-error-msg").hide();
   },
 
-  handleCreateProject: function(evt) {
+  handleCreateProject: function (evt) {
     // First make sure we can upload
     var projectName = $('#path').val();
     var description = $('#description').val();
@@ -163,7 +164,7 @@ azkaban.CreateProjectView = Backbone.View.extend({
         name: projectName,
         description: description
       },
-      success: function(data) {
+      success: function (data) {
         if (data.status == "success") {
           if (data.action == "redirect") {
             window.location = data.path;
@@ -182,12 +183,12 @@ azkaban.CreateProjectView = Backbone.View.extend({
     });
   },
 
-  render: function() {
+  render: function () {
   }
 });
 
 var tableSorterView;
-$(function() {
+$(function () {
   projectHeaderView = new azkaban.ProjectHeaderView({
     el: $('#create-project'),
     successMsg: successMessage,
diff --git a/azkaban-web-server/src/web/js/azkaban/view/message-dialog.js b/azkaban-web-server/src/web/js/azkaban/view/message-dialog.js
index d4db850..3f95a10 100644
--- a/azkaban-web-server/src/web/js/azkaban/view/message-dialog.js
+++ b/azkaban-web-server/src/web/js/azkaban/view/message-dialog.js
@@ -18,17 +18,16 @@ $.namespace('azkaban');
 
 var messageDialogView;
 azkaban.MessageDialogView = Backbone.View.extend({
-  events: {
-  },
+  events: {},
 
-  initialize: function(settings) {
+  initialize: function (settings) {
   },
 
-  show: function(title, message, callback) {
+  show: function (title, message, callback) {
     $("#azkaban-message-dialog-title").text(title);
     $("#azkaban-message-dialog-text").html(message);
     this.callback = callback;
-    $(this.el).on('hidden.bs.modal', function() {
+    $(this.el).on('hidden.bs.modal', function () {
       if (callback) {
         callback.call();
       }
@@ -37,7 +36,7 @@ azkaban.MessageDialogView = Backbone.View.extend({
   }
 });
 
-$(function() {
+$(function () {
   messageDialogView = new azkaban.MessageDialogView({
     el: $('#azkaban-message-dialog')
   });
diff --git a/azkaban-web-server/src/web/js/azkaban/view/note.js b/azkaban-web-server/src/web/js/azkaban/view/note.js
index 018af48..2bb43ea 100644
--- a/azkaban-web-server/src/web/js/azkaban/view/note.js
+++ b/azkaban-web-server/src/web/js/azkaban/view/note.js
@@ -13,9 +13,9 @@
  * License for the specific language governing permissions and limitations under
  * the License.
  */
-$(function() {
+$(function () {
 
-  $("#submit-button").click(function(){
+  $("#submit-button").click(function () {
     console.log("======create note=====")
     var radioValue = $("input[name='note-type']:checked").val();
     var message = $('#message').val();
@@ -23,8 +23,13 @@ $(function() {
 
     var triggerURL = "/notes";
     var redirectURL = "/notes";
-    var requestData = {"ajax": "addNote", "type": radioValue, "message": message, "url": url};
-    var successHandler = function(data) {
+    var requestData = {
+      "ajax": "addNote",
+      "type": radioValue,
+      "message": message,
+      "url": url
+    };
+    var successHandler = function (data) {
       if (data.error) {
         $('#errorMsg').text(data.error);
       }
@@ -35,13 +40,13 @@ $(function() {
     $.post(triggerURL, requestData, successHandler, "json");
   });
 
-  $("#clear-button").click(function(){
+  $("#clear-button").click(function () {
 
     console.log("======form clear=====")
     var requestData = {"ajax": "removeNote"};
     var triggerURL = "/notes";
     var redirectURL = "/notes";
-    var successHandler = function(data) {
+    var successHandler = function (data) {
       if (data.error) {
         $('#errorMsg').text(data.error);
       }
diff --git a/azkaban-web-server/src/web/js/azkaban/view/project.js b/azkaban-web-server/src/web/js/azkaban/view/project.js
index d076be9..ddad2bb 100644
--- a/azkaban-web-server/src/web/js/azkaban/view/project.js
+++ b/azkaban-web-server/src/web/js/azkaban/view/project.js
@@ -18,7 +18,7 @@ $.namespace('azkaban');
 
 var flowTableView;
 azkaban.FlowTableView = Backbone.View.extend({
-  events : {
+  events: {
     "click .flow-expander": "expandFlowProject",
     "mouseover .expanded-flow-job-list li": "highlight",
     "mouseout .expanded-flow-job-list li": "unhighlight",
@@ -29,10 +29,10 @@ azkaban.FlowTableView = Backbone.View.extend({
     "click .viewJob": "viewJob"
   },
 
-  initialize: function(settings) {
+  initialize: function (settings) {
   },
 
-  expandFlowProject: function(evt) {
+  expandFlowProject: function (evt) {
     if (evt.target.tagName == "A" || evt.target.tagName == "BUTTON") {
       return;
     }
@@ -68,7 +68,7 @@ azkaban.FlowTableView = Backbone.View.extend({
         "ajax": "fetchflowjobs",
         "flow": targetId
       };
-      var successHandler = function(data) {
+      var successHandler = function (data) {
         console.log("Success");
         target.loaded = true;
         target.loading = false;
@@ -82,11 +82,12 @@ azkaban.FlowTableView = Backbone.View.extend({
     }
   },
 
-  createJobListTable: function(data, innerTable) {
+  createJobListTable: function (data, innerTable) {
     var nodes = data.nodes;
     var flowId = data.flowId;
     var project = data.project;
-    var requestURL = contextURL + "/manager?project=" + project + "&flow=" + flowId + "&job=";
+    var requestURL = contextURL + "/manager?project=" + project + "&flow="
+        + flowId + "&job=";
     for (var i = 0; i < nodes.length; i++) {
       var job = nodes[i];
       var name = job.id;
@@ -142,20 +143,20 @@ azkaban.FlowTableView = Backbone.View.extend({
     }
   },
 
-  unhighlight: function(evt) {
+  unhighlight: function (evt) {
     var currentTarget = evt.currentTarget;
     $(".dependent").removeClass("dependent");
     $(".dependency").removeClass("dependency");
   },
 
-  highlight: function(evt) {
+  highlight: function (evt) {
     var currentTarget = evt.currentTarget;
     $(".dependent").removeClass("dependent");
     $(".dependency").removeClass("dependency");
     this.highlightJob(currentTarget);
   },
 
-  highlightJob: function(currentTarget) {
+  highlightJob: function (currentTarget) {
     var dependents = currentTarget.dependents;
     var dependencies = currentTarget.dependencies;
     var flowid = currentTarget.flowId;
@@ -163,32 +164,34 @@ azkaban.FlowTableView = Backbone.View.extend({
     if (dependents) {
       for (var i = 0; i < dependents.length; ++i) {
         var depId = flowid + "-" + dependents[i];
-        $("#"+depId).toggleClass("dependent");
+        $("#" + depId).toggleClass("dependent");
       }
     }
 
     if (dependencies) {
       for (var i = 0; i < dependencies.length; ++i) {
         var depId = flowid + "-" + dependencies[i];
-        $("#"+depId).toggleClass("dependency");
+        $("#" + depId).toggleClass("dependency");
       }
     }
   },
 
-  viewFlow: function(evt) {
+  viewFlow: function (evt) {
     console.log("View Flow");
     var flowId = evt.currentTarget.flowId;
-    location.href = contextURL + "/manager?project=" + projectName + "&flow=" + flowId;
+    location.href = contextURL + "/manager?project=" + projectName + "&flow="
+        + flowId;
   },
 
-  viewJob: function(evt) {
+  viewJob: function (evt) {
     console.log("View Job");
     var flowId = evt.currentTarget.flowId;
     var jobId = evt.currentTarget.jobId;
-    location.href = contextURL + "/manager?project=" + projectName + "&flow=" + flowId + "&job=" + jobId;
+    location.href = contextURL + "/manager?project=" + projectName + "&flow="
+        + flowId + "&job=" + jobId;
   },
 
-  runJob: function(evt) {
+  runJob: function (evt) {
     console.log("Run Job");
     var jobId = evt.currentTarget.jobName;
     var flowId = evt.currentTarget.flowId;
@@ -203,7 +206,7 @@ azkaban.FlowTableView = Backbone.View.extend({
     this.executeFlowDialog(executingData);
   },
 
-  runWithDep: function(evt) {
+  runWithDep: function (evt) {
     var jobId = evt.currentTarget.jobName;
     var flowId = evt.currentTarget.flowId;
     console.log("Run With Dep");
@@ -218,7 +221,7 @@ azkaban.FlowTableView = Backbone.View.extend({
     this.executeFlowDialog(executingData);
   },
 
-  executeFlow: function(evt) {
+  executeFlow: function (evt) {
     console.log("Execute Flow");
     var flowId = $(evt.currentTarget).attr('flowid');
 
@@ -231,14 +234,14 @@ azkaban.FlowTableView = Backbone.View.extend({
     this.executeFlowDialog(executingData);
   },
 
-  executeFlowDialog: function(executingData) {
+  executeFlowDialog: function (executingData) {
     flowExecuteDialogView.show(executingData);
   },
 
-  render: function() {
+  render: function () {
   }
 });
 
-$(function() {
-  flowTableView = new azkaban.FlowTableView({el:$('#flow-tabs')});
+$(function () {
+  flowTableView = new azkaban.FlowTableView({el: $('#flow-tabs')});
 });
diff --git a/azkaban-web-server/src/web/js/azkaban/view/project-logs.js b/azkaban-web-server/src/web/js/azkaban/view/project-logs.js
index 178b678..e85af97 100644
--- a/azkaban-web-server/src/web/js/azkaban/view/project-logs.js
+++ b/azkaban-web-server/src/web/js/azkaban/view/project-logs.js
@@ -25,9 +25,9 @@ var typeMapping = {
   "ERROR": "Error",
   "CREATED": "Project Created",
   "DELETED": "Project Deleted",
-  "USER_PERMISSION" : "User Permission",
-  "GROUP_PERMISSION" : "Group Permission",
-  "DESCRIPTION" : "Description Set",
+  "USER_PERMISSION": "User Permission",
+  "GROUP_PERMISSION": "Group Permission",
+  "DESCRIPTION": "Description Set",
   "SCHEDULE": "Schedule",
   "UPLOADED": "Uploaded",
   "PROPERTY_OVERRIDE": "Property Override"
@@ -39,12 +39,12 @@ azkaban.ProjectLogView = Backbone.View.extend({
     "click #updateLogBtn": "handleUpdate"
   },
 
-  initialize: function(settings) {
+  initialize: function (settings) {
     this.model.set({"current": 0});
     this.handleUpdate();
   },
 
-  handleUpdate: function(evt) {
+  handleUpdate: function (evt) {
     var current = this.model.get("current");
     var requestURL = contextURL + "/manager";
     var model = this.model;
@@ -55,7 +55,7 @@ azkaban.ProjectLogView = Backbone.View.extend({
       "skip": 0
     };
 
-    var successHandler = function(data) {
+    var successHandler = function (data) {
       console.log("fetchLogs");
       if (data.error) {
         showDialog("Error", data.error);
@@ -64,7 +64,7 @@ azkaban.ProjectLogView = Backbone.View.extend({
       // Get the columns to map to the values.
       var columns = data.columns;
       var columnMap = {};
-      for (var i =0; i < columns.length; ++i) {
+      for (var i = 0; i < columns.length; ++i) {
         columnMap[columns[i]] = i;
       }
       var logSection = $("#logTable").find("tbody")[0];
@@ -92,7 +92,7 @@ azkaban.ProjectLogView = Backbone.View.extend({
         var containerMessage = document.createElement("td");
 
         // If the event is a property override change, highlight by red color.
-        if(type == "PROPERTY_OVERRIDE"){
+        if (type == "PROPERTY_OVERRIDE") {
           $(containerMessage).css("color", "red");
           $(containerMessage).css("white-space", "pre-wrap");
           $(containerType).css("color", "red");
@@ -118,7 +118,7 @@ azkaban.ProjectLogView = Backbone.View.extend({
   }
 });
 
-var showDialog = function(title, message) {
+var showDialog = function (title, message) {
   $('#messageTitle').text(title);
 
   $('#messageBox').text(message);
@@ -128,18 +128,18 @@ var showDialog = function(title, message) {
     position: ["20%",],
     containerId: 'confirm-container',
     containerCss: {
-    'height': '220px',
-    'width': '565px'
+      'height': '220px',
+      'width': '565px'
     },
     onShow: function (dialog) {
     }
   });
 }
 
-
-$(function() {
+$(function () {
   var selected;
 
   logModel = new azkaban.LogModel();
-  projectLogView = new azkaban.ProjectLogView({el:$('#projectLogView'), model: logModel});
+  projectLogView = new azkaban.ProjectLogView(
+      {el: $('#projectLogView'), model: logModel});
 });
diff --git a/azkaban-web-server/src/web/js/azkaban/view/project-modals.js b/azkaban-web-server/src/web/js/azkaban/view/project-modals.js
index 302cbfe..8afca49 100644
--- a/azkaban-web-server/src/web/js/azkaban/view/project-modals.js
+++ b/azkaban-web-server/src/web/js/azkaban/view/project-modals.js
@@ -23,20 +23,20 @@ azkaban.ProjectView = Backbone.View.extend({
     "click #project-delete-btn": "handleDeleteProject"
   },
 
-  initialize: function(settings) {
+  initialize: function (settings) {
   },
 
-  handleUploadProjectJob: function(evt) {
+  handleUploadProjectJob: function (evt) {
     console.log("click upload project");
     $('#upload-project-modal').modal();
   },
 
-  handleDeleteProject: function(evt) {
+  handleDeleteProject: function (evt) {
     console.log("click delete project");
     $('#delete-project-modal').modal();
   },
 
-  render: function() {
+  render: function () {
   }
 });
 
@@ -46,17 +46,17 @@ azkaban.UploadProjectView = Backbone.View.extend({
     "click #upload-project-btn": "handleCreateProject"
   },
 
-  initialize: function(settings) {
+  initialize: function (settings) {
     console.log("Hide upload project modal error msg");
     $("#upload-project-modal-error-msg").hide();
   },
 
-  handleCreateProject: function(evt) {
+  handleCreateProject: function (evt) {
     console.log("Upload project button.");
     $("#upload-project-form").submit();
   },
 
-  render: function() {
+  render: function () {
   }
 });
 
@@ -66,14 +66,14 @@ azkaban.DeleteProjectView = Backbone.View.extend({
     "click #delete-btn": "handleDeleteProject"
   },
 
-  initialize: function(settings) {
+  initialize: function (settings) {
   },
 
-  handleDeleteProject: function(evt) {
+  handleDeleteProject: function (evt) {
     $("#delete-form").submit();
   },
 
-  render: function() {
+  render: function () {
   }
 });
 
@@ -84,11 +84,11 @@ azkaban.ProjectDescriptionView = Backbone.View.extend({
     "click #project-description-btn": "handleDescriptionSave"
   },
 
-  initialize: function(settings) {
+  initialize: function (settings) {
     console.log("project description initialize");
   },
 
-  handleDescriptionEdit: function(evt) {
+  handleDescriptionEdit: function (evt) {
     console.log("Edit description");
     var description = null;
     if ($('#project-description').hasClass('editable-placeholder')) {
@@ -103,7 +103,7 @@ azkaban.ProjectDescriptionView = Backbone.View.extend({
     $('#project-description-form').show();
   },
 
-  handleDescriptionSave: function(evt) {
+  handleDescriptionSave: function (evt) {
     var newText = $('#project-description-edit').val();
     if ($('#project-description-edit').hasClass('has-error')) {
       $('#project-description-edit').removeClass('has-error');
@@ -111,10 +111,10 @@ azkaban.ProjectDescriptionView = Backbone.View.extend({
     var requestURL = contextURL + "/manager";
     var requestData = {
       "project": projectName,
-      "ajax":"changeDescription",
+      "ajax": "changeDescription",
       "description": newText
     };
-    var successHandler = function(data) {
+    var successHandler = function (data) {
       if (data.error) {
         $('#project-description-edit').addClass('has-error');
         alert(data.error);
@@ -133,11 +133,11 @@ azkaban.ProjectDescriptionView = Backbone.View.extend({
     $.get(requestURL, requestData, successHandler, "json");
   },
 
-  render: function() {
+  render: function () {
   }
 });
 
-$(function() {
+$(function () {
   projectView = new azkaban.ProjectView({
     el: $('#project-options')
   });
diff --git a/azkaban-web-server/src/web/js/azkaban/view/project-permissions.js b/azkaban-web-server/src/web/js/azkaban/view/project-permissions.js
index 2cdce28..6f58876 100644
--- a/azkaban-web-server/src/web/js/azkaban/view/project-permissions.js
+++ b/azkaban-web-server/src/web/js/azkaban/view/project-permissions.js
@@ -20,37 +20,38 @@ var permissionTableView;
 var groupPermissionTableView;
 
 azkaban.PermissionTableView = Backbone.View.extend({
-  events : {
+  events: {
     "click button": "handleChangePermission"
   },
 
-  initialize : function(settings) {
+  initialize: function (settings) {
     this.group = settings.group;
     this.proxy = settings.proxy;
   },
 
-  render: function() {
+  render: function () {
   },
 
-  handleChangePermission: function(evt) {
+  handleChangePermission: function (evt) {
     var currentTarget = evt.currentTarget;
-    changePermissionView.display(currentTarget.id, false, this.group, this.proxy);
+    changePermissionView.display(currentTarget.id, false, this.group,
+        this.proxy);
   }
 });
 
 var proxyTableView;
-azkaban.ProxyTableView= Backbone.View.extend({
-  events : {
+azkaban.ProxyTableView = Backbone.View.extend({
+  events: {
     "click button": "handleRemoveProxy"
   },
 
-  initialize : function(settings) {
+  initialize: function (settings) {
   },
 
-  render: function() {
+  render: function () {
   },
 
-  handleRemoveProxy: function(evt) {
+  handleRemoveProxy: function (evt) {
     removeProxyView.display($(evt.currentTarget).attr("name"));
   }
 });
@@ -61,19 +62,19 @@ azkaban.RemoveProxyView = Backbone.View.extend({
     "click #remove-proxy-btn": "handleRemoveProxy"
   },
 
-  initialize : function(settings) {
+  initialize: function (settings) {
     $('#remove-proxy-error-msg').hide();
   },
 
-  display: function(proxyName) {
+  display: function (proxyName) {
     this.el.proxyName = proxyName;
     $("#remove-proxy-msg").text("Removing proxy user '" + proxyName + "'");
-    $(this.el).modal().on('hide.bs.modal', function(e) {
+    $(this.el).modal().on('hide.bs.modal', function (e) {
       $('#remove-proxy-error-msg').hide();
     });
   },
 
-  handleRemoveProxy: function() {
+  handleRemoveProxy: function () {
     var requestURL = contextURL + "/manager";
     var proxyName = this.el.proxyName;
     var requestData = {
@@ -81,14 +82,14 @@ azkaban.RemoveProxyView = Backbone.View.extend({
       "name": proxyName,
       "ajax": "removeProxyUser"
     };
-    var successHandler = function(data) {
+    var successHandler = function (data) {
       console.log("Output");
       if (data.error) {
         $("#remove-proxy-error-msg").text(data.error);
         $("#remove-proxy-error-msg").slideDown();
         return;
       }
-      var replaceURL = requestURL + "?project=" + projectName +"&permissions";
+      var replaceURL = requestURL + "?project=" + projectName + "&permissions";
       window.location.replace(replaceURL);
     };
 
@@ -102,26 +103,26 @@ azkaban.AddProxyView = Backbone.View.extend({
     "click #add-proxy-btn": "handleAddProxy"
   },
 
-  initialize : function(settings) {
+  initialize: function (settings) {
     $('#add-proxy-error-msg').hide();
   },
 
-  display: function() {
-    $(this.el).modal().on('hide.bs.modal', function(e) {
+  display: function () {
+    $(this.el).modal().on('hide.bs.modal', function (e) {
       $('#add-proxy-error-msg').hide();
     });
   },
 
-  handleAddProxy: function() {
+  handleAddProxy: function () {
     var requestURL = contextURL + "/manager";
     var name = $('#proxy-user-box').val().trim();
     var requestData = {
       "project": projectName,
       "name": name,
-      "ajax":"addProxyUser"
+      "ajax": "addProxyUser"
     };
 
-    var successHandler = function(data) {
+    var successHandler = function (data) {
       console.log("Output");
       if (data.error) {
         $("#add-proxy-error-msg").text(data.error);
@@ -129,7 +130,7 @@ azkaban.AddProxyView = Backbone.View.extend({
         return;
       }
 
-      var replaceURL = requestURL + "?project=" + projectName +"&permissions";
+      var replaceURL = requestURL + "?project=" + projectName + "&permissions";
       window.location.replace(replaceURL);
     };
     $.get(requestURL, requestData, successHandler, "json");
@@ -137,20 +138,20 @@ azkaban.AddProxyView = Backbone.View.extend({
 });
 
 var changePermissionView;
-azkaban.ChangePermissionView= Backbone.View.extend({
+azkaban.ChangePermissionView = Backbone.View.extend({
   events: {
     "click input[type=checkbox]": "handleCheckboxClick",
     "click #change-btn": "handleChangePermissions"
   },
 
-  initialize: function(settings) {
+  initialize: function (settings) {
     $('#change-permission-error-msg').hide();
   },
 
-  display: function(userid, newPerm, group, proxy) {
+  display: function (userid, newPerm, group, proxy) {
     // 6 is the length of the prefix "group-"
     this.userid = group ? userid.substring(6, userid.length) : userid;
-    if(group == true) {
+    if (group == true) {
       this.userid = userid.substring(6, userid.length)
     } else if (proxy == true) {
       this.userid = userid.substring(6, userid.length)
@@ -174,10 +175,10 @@ azkaban.ChangePermissionView= Backbone.View.extend({
       if (group) {
         $('#change-title').text("Add New Group Permissions");
       }
-      else if(proxy){
+      else if (proxy) {
         $('#change-title').text("Add New Proxy User Permissions");
       }
-      else{
+      else {
         $('#change-title').text("Add New User Permissions");
       }
       $('#user-box').attr("disabled", null);
@@ -209,18 +210,18 @@ azkaban.ChangePermissionView= Backbone.View.extend({
     this.changeCheckbox();
 
     changePermissionView.render();
-    $('#change-permission').modal().on('hide.bs.modal', function(e) {
+    $('#change-permission').modal().on('hide.bs.modal', function (e) {
       $('#change-permission-error-msg').hide();
     });
   },
 
-  render: function() {
+  render: function () {
   },
 
-  handleCheckboxClick: function(evt) {
+  handleCheckboxClick: function (evt) {
     console.log("click");
     var targetName = evt.currentTarget.name;
-    if(targetName == "proxy") {
+    if (targetName == "proxy") {
       this.doProxy = evt.currentTarget.checked;
     }
     else {
@@ -229,7 +230,7 @@ azkaban.ChangePermissionView= Backbone.View.extend({
     this.changeCheckbox(evt);
   },
 
-  changeCheckbox: function(evt) {
+  changeCheckbox: function (evt) {
     var perm = this.permission;
 
     if (perm.admin) {
@@ -259,13 +260,14 @@ azkaban.ChangePermissionView= Backbone.View.extend({
       $("#execute-change").attr("disabled", null);
 
       $("#schedule-change").attr("checked", perm.schedule);
-    $("#schedule-change").attr("disabled", null);
+      $("#schedule-change").attr("disabled", null);
     }
 
     $("#change-btn").removeClass("btn-disabled");
     $("#change-btn").attr("disabled", null);
 
-    if (perm.admin || perm.read || perm.write || perm.execute || perm.schedule) {
+    if (perm.admin || perm.read || perm.write || perm.execute
+        || perm.schedule) {
       $("#change-btn").text("Commit");
     }
     else {
@@ -279,7 +281,7 @@ azkaban.ChangePermissionView= Backbone.View.extend({
     }
   },
 
-  handleChangePermissions : function(evt) {
+  handleChangePermissions: function (evt) {
     var requestURL = contextURL + "/manager";
     var name = $('#user-box').val().trim();
     var command = this.newPerm ? "addPermission" : "changePermission";
@@ -299,7 +301,7 @@ azkaban.ChangePermissionView= Backbone.View.extend({
       "permissions": this.permission,
       "group": group
     };
-    var successHandler = function(data) {
+    var successHandler = function (data) {
       console.log("Output");
       if (data.error) {
         $("#change-permission-error-msg").text(data.error);
@@ -307,7 +309,7 @@ azkaban.ChangePermissionView= Backbone.View.extend({
         return;
       }
 
-      var replaceURL = requestURL + "?project=" + projectName +"&permissions";
+      var replaceURL = requestURL + "?project=" + projectName + "&permissions";
       window.location.replace(replaceURL);
     };
 
@@ -315,7 +317,7 @@ azkaban.ChangePermissionView= Backbone.View.extend({
   }
 });
 
-$(function() {
+$(function () {
   permissionTableView = new azkaban.PermissionTableView({
     el: $('#permissions-table'),
     group: false,
@@ -340,15 +342,15 @@ $(function() {
   removeProxyView = new azkaban.RemoveProxyView({
     el: $('#remove-proxy')
   });
-  $('#addUser').bind('click', function() {
+  $('#addUser').bind('click', function () {
     changePermissionView.display("", true, false, false);
   });
 
-  $('#addGroup').bind('click', function() {
+  $('#addGroup').bind('click', function () {
     changePermissionView.display("", true, true, false);
   });
 
-  $('#addProxyUser').bind('click', function() {
+  $('#addProxyUser').bind('click', function () {
     addProxyView.display();
   });
 });
diff --git a/azkaban-web-server/src/web/js/azkaban/view/scheduled.js b/azkaban-web-server/src/web/js/azkaban/view/scheduled.js
index d470aac..912ab6f 100644
--- a/azkaban-web-server/src/web/js/azkaban/view/scheduled.js
+++ b/azkaban-web-server/src/web/js/azkaban/view/scheduled.js
@@ -18,9 +18,9 @@ $.namespace('azkaban');
 
 var slaView;
 var tableSorterView;
-$(function() {
-  slaView = new azkaban.ChangeSlaView({el:$('#sla-options')});
-  tableSorterView = new azkaban.TableSorter({el:$('#scheduledFlowsTbl')});
+$(function () {
+  slaView = new azkaban.ChangeSlaView({el: $('#sla-options')});
+  tableSorterView = new azkaban.TableSorter({el: $('#scheduledFlowsTbl')});
   //var requestURL = contextURL + "/manager";
 
   // Set up the Flow options view. Create a new one every time :p
diff --git a/azkaban-web-server/src/web/js/azkaban/view/schedule-options.js b/azkaban-web-server/src/web/js/azkaban/view/schedule-options.js
index f899f05..90064f3 100644
--- a/azkaban-web-server/src/web/js/azkaban/view/schedule-options.js
+++ b/azkaban-web-server/src/web/js/azkaban/view/schedule-options.js
@@ -46,44 +46,44 @@ var scheduleFlowData;
 //}
 //
 azkaban.ScheduleContextMenu = Backbone.View.extend({
-  events : {
-    "click #scheduleDisableArrow" : "handleDisabledClick",
-    "click #scheduleEnableArrow" : "handleEnabledClick"
+  events: {
+    "click #scheduleDisableArrow": "handleDisabledClick",
+    "click #scheduleEnableArrow": "handleEnabledClick"
   },
-  initialize: function(settings) {
+  initialize: function (settings) {
     $('#scheduleDisableSub').hide();
     $('#scheduleEnableSub').hide();
   },
-  handleEnabledClick: function(evt) {
-    if(evt.stopPropagation) {
+  handleEnabledClick: function (evt) {
+    if (evt.stopPropagation) {
       evt.stopPropagation();
     }
-    evt.cancelBubble=true;
+    evt.cancelBubble = true;
 
     if (evt.currentTarget.expanded) {
-      evt.currentTarget.expanded=false;
+      evt.currentTarget.expanded = false;
       $('#scheduleEnableArrow').removeClass('collapse');
       $('#scheduleEnableSub').hide();
     }
     else {
-      evt.currentTarget.expanded=true;
+      evt.currentTarget.expanded = true;
       $('#scheduleEnableArrow').addClass('collapse');
       $('#scheduleEnableSub').show();
     }
   },
-  handleDisabledClick: function(evt) {
-    if(evt.stopPropagation) {
+  handleDisabledClick: function (evt) {
+    if (evt.stopPropagation) {
       evt.stopPropagation();
     }
-    evt.cancelBubble=true;
+    evt.cancelBubble = true;
 
     if (evt.currentTarget.expanded) {
-      evt.currentTarget.expanded=false;
+      evt.currentTarget.expanded = false;
       $('#scheduleDisableArrow').removeClass('collapse');
       $('#scheduleDisableSub').hide();
     }
     else {
-      evt.currentTarget.expanded=true;
+      evt.currentTarget.expanded = true;
       $('#scheduleDisableArrow').addClass('collapse');
       $('#scheduleDisableSub').show();
     }
@@ -91,84 +91,88 @@ azkaban.ScheduleContextMenu = Backbone.View.extend({
 });
 
 azkaban.ScheduleFlowView = Backbone.View.extend({
-  events : {
-  "click #schedule-btn": "handleScheduleFlow",
-  "click #adv-schedule-opt-btn": "handleAdvancedSchedule"
+  events: {
+    "click #schedule-btn": "handleScheduleFlow",
+    "click #adv-schedule-opt-btn": "handleAdvancedSchedule"
   },
-  initialize : function(settings) {
-    $( "#datepicker" ).datepicker();
-    $( "#datepicker" ).datepicker('setDate', new Date());
+  initialize: function (settings) {
+    $("#datepicker").datepicker();
+    $("#datepicker").datepicker('setDate', new Date());
     $("#errorMsg").hide();
   },
-  handleAdvancedSchedule : function(evt) {
+  handleAdvancedSchedule: function (evt) {
     console.log("Clicked advanced schedule options button");
     //$('#confirm-container').hide();
     $.modal.close();
     advancedScheduleView.show();
   },
-  handleScheduleFlow : function(evt) {
-
-  var hourVal = $('#hour').val();
-  var minutesVal = $('#minutes').val();
-  var ampmVal = $('#am_pm').val();
-  var timezoneVal = $('#timezone').val();
-  var dateVal = $('#datepicker').val();
-  var is_recurringVal = $('#is_recurring').val();
-  var periodVal = $('#period').val();
-  var periodUnits = $('#period_units').val();
-
-  console.log("Creating schedule for "+projectName+"."+flowName);
-  $.ajax({
-    async: "false",
-    url: "schedule",
-    dataType: "json",
-    type: "POST",
-    data: {
-      action:"scheduleFlow",
-      projectId:projectId,
-      projectName:projectName,
-      flowName:flowName,
-      hour:hourVal,
-      minutes:minutesVal,
-      am_pm:ampmVal,
-      timezone:timezoneVal,
-      date:dateVal,
-      userExec:"dummy",
-      is_recurring:is_recurringVal,
-      period:periodVal,
-      period_units:periodUnits
+  handleScheduleFlow: function (evt) {
+
+    var hourVal = $('#hour').val();
+    var minutesVal = $('#minutes').val();
+    var ampmVal = $('#am_pm').val();
+    var timezoneVal = $('#timezone').val();
+    var dateVal = $('#datepicker').val();
+    var is_recurringVal = $('#is_recurring').val();
+    var periodVal = $('#period').val();
+    var periodUnits = $('#period_units').val();
+
+    console.log("Creating schedule for " + projectName + "." + flowName);
+    $.ajax({
+      async: "false",
+      url: "schedule",
+      dataType: "json",
+      type: "POST",
+      data: {
+        action: "scheduleFlow",
+        projectId: projectId,
+        projectName: projectName,
+        flowName: flowName,
+        hour: hourVal,
+        minutes: minutesVal,
+        am_pm: ampmVal,
+        timezone: timezoneVal,
+        date: dateVal,
+        userExec: "dummy",
+        is_recurring: is_recurringVal,
+        period: periodVal,
+        period_units: periodUnits
       },
-    success: function(data) {
-      if (data.status == "success") {
-        console.log("Successfully scheduled for "+projectName+"."+flowName);
-        if (data.action == "redirect") {
-          window.location = contextURL + "/manager?project=" + projectName + "&flow=" + flowName ;
-        }
-        else{
-          $("#success_message").text("Flow " + projectName + "." + flowName + " scheduled!" );
-           window.location = contextURL + "/manager?project=" + projectName + "&flow=" + flowName ;
-        }
-      }
-      else {
-        if (data.action == "login") {
-          window.location = "";
+      success: function (data) {
+        if (data.status == "success") {
+          console.log("Successfully scheduled for " + projectName + "."
+              + flowName);
+          if (data.action == "redirect") {
+            window.location = contextURL + "/manager?project=" + projectName
+                + "&flow=" + flowName;
+          }
+          else {
+            $("#success_message").text("Flow " + projectName + "." + flowName
+                + " scheduled!");
+            window.location = contextURL + "/manager?project=" + projectName
+                + "&flow=" + flowName;
+          }
         }
         else {
-          $("#errorMsg").text("ERROR: " + data.message);
-          $("#errorMsg").slideDown("fast");
+          if (data.action == "login") {
+            window.location = "";
+          }
+          else {
+            $("#errorMsg").text("ERROR: " + data.message);
+            $("#errorMsg").slideDown("fast");
+          }
         }
       }
-    }
-  });
+    });
 
   },
-  render: function() {
+  render: function () {
   }
 });
 
 azkaban.AdvancedScheduleView = Backbone.View.extend({
-  events : {
-    "click" : "closeEditingTarget",
+  events: {
+    "click": "closeEditingTarget",
     "click #adv-schedule-btn": "handleAdvSchedule",
     "click #schedule-cancel-btn": "handleCancel",
     "click .modal-close": "handleCancel",
@@ -178,13 +182,14 @@ azkaban.AdvancedScheduleView = Backbone.View.extend({
     "click table .editable": "handleEditColumn",
     "click table .removeIcon": "handleRemoveColumn"
   },
-  initialize: function(setting) {
-    this.contextMenu = new azkaban.ScheduleContextMenu({el:$('#scheduleDisableJobMenu')});
+  initialize: function (setting) {
+    this.contextMenu = new azkaban.ScheduleContextMenu(
+        {el: $('#scheduleDisableJobMenu')});
     this.handleGeneralOptionsSelect();
-    $( "#advdatepicker" ).datepicker();
-    $( "#advdatepicker" ).datepicker('setDate', new Date());
+    $("#advdatepicker").datepicker();
+    $("#advdatepicker").datepicker('setDate', new Date());
   },
-  show: function() {
+  show: function () {
     $('#scheduleModalBackground').show();
     $('#schedule-options').show();
     this.handleGeneralOptionsSelect();
@@ -193,7 +198,11 @@ azkaban.AdvancedScheduleView = Backbone.View.extend({
     this.flowData = scheduleFlowData;
     var flowData = scheduleFlowData;
 
-    var fetchData = {"project": projectName, "ajax":"flowInfo", "flow":flowName};
+    var fetchData = {
+      "project": projectName,
+      "ajax": "flowInfo",
+      "flow": flowName
+    };
 
     var executeURL = contextURL + "/executor";
     this.executeURL = executeURL;
@@ -203,12 +212,12 @@ azkaban.AdvancedScheduleView = Backbone.View.extend({
 
     var data = flowData.get("data");
     var nodes = {};
-    for (var i=0; i < data.nodes.length; ++i) {
+    for (var i = 0; i < data.nodes.length; ++i) {
       var node = data.nodes[i];
       nodes[node.id] = node;
     }
 
-    for (var i=0; i < data.edges.length; ++i) {
+    for (var i = 0; i < data.edges.length; ++i) {
       var edge = data.edges[i];
       var fromNode = nodes[edge.from];
       var toNode = nodes[edge.target];
@@ -232,67 +241,67 @@ azkaban.AdvancedScheduleView = Backbone.View.extend({
         updateNode.status = "READY";
         disabled[updateNode.id] = true;
       }
-      if (updateNode.status == "SUCCEEDED" || updateNode.status=="RUNNING") {
+      if (updateNode.status == "SUCCEEDED" || updateNode.status == "RUNNING") {
         disabled[updateNode.id] = true;
       }
     }
     flowData.set({disabled: disabled});
 
     $.get(
-      executeURL,
-      fetchData,
-      function(data) {
-        if (data.error) {
-          alert(data.error);
-        }
-        else {
-          if (data.successEmails) {
-            $('#scheduleSuccessEmails').val(data.successEmails.join());
-          }
-          if (data.failureEmails) {
-            $('#scheduleFailureEmails').val(data.failureEmails.join());
+        executeURL,
+        fetchData,
+        function (data) {
+          if (data.error) {
+            alert(data.error);
           }
+          else {
+            if (data.successEmails) {
+              $('#scheduleSuccessEmails').val(data.successEmails.join());
+            }
+            if (data.failureEmails) {
+              $('#scheduleFailureEmails').val(data.failureEmails.join());
+            }
 
-          if (data.failureAction) {
-            $('#scheduleFailureAction').val(data.failureAction);
-          }
-          if (data.notifyFailureFirst) {
-            $('#scheduleNotifyFailureFirst').attr('checked', true);
-          }
-          if (data.notifyFailureLast) {
-            $('#scheduleNotifyFailureLast').attr('checked', true);
-          }
-          if (data.flowParam) {
-            var flowParam = data.flowParam;
-            for (var key in flowParam) {
-              var row = handleAddRow();
-              var td = $(row).find('td');
-              $(td[0]).text(key);
-              $(td[1]).text(flowParam[key]);
+            if (data.failureAction) {
+              $('#scheduleFailureAction').val(data.failureAction);
+            }
+            if (data.notifyFailureFirst) {
+              $('#scheduleNotifyFailureFirst').attr('checked', true);
+            }
+            if (data.notifyFailureLast) {
+              $('#scheduleNotifyFailureLast').attr('checked', true);
+            }
+            if (data.flowParam) {
+              var flowParam = data.flowParam;
+              for (var key in flowParam) {
+                var row = handleAddRow();
+                var td = $(row).find('td');
+                $(td[0]).text(key);
+                $(td[1]).text(flowParam[key]);
+              }
             }
-          }
 
-          if (!data.running || data.running.length == 0) {
-            $(".radio").attr("disabled", "disabled");
-            $(".radioLabel").addClass("disabled", "disabled");
+            if (!data.running || data.running.length == 0) {
+              $(".radio").attr("disabled", "disabled");
+              $(".radioLabel").addClass("disabled", "disabled");
+            }
           }
-        }
-      },
-      "json"
+        },
+        "json"
     );
   },
-  handleCancel: function(evt) {
+  handleCancel: function (evt) {
     $('#scheduleModalBackground').hide();
     $('#schedule-options').hide();
   },
-  handleGeneralOptionsSelect: function(evt) {
+  handleGeneralOptionsSelect: function (evt) {
     $('#scheduleFlowOptions').removeClass('selected');
     $('#scheduleGeneralOptions').addClass('selected');
 
     $('#scheduleGeneralPanel').show();
     $('#scheduleGraphPanel').hide();
   },
-  handleFlowOptionsSelect: function(evt) {
+  handleFlowOptionsSelect: function (evt) {
     $('#scheduleGeneralOptions').removeClass('selected');
     $('#scheduleFlowOptions').addClass('selected');
 
@@ -303,18 +312,32 @@ azkaban.AdvancedScheduleView = Backbone.View.extend({
       return;
     }
 
-    scheduleCustomSvgGraphView = new azkaban.SvgGraphView({el:$('#scheduleSvgDivCustom'), model: scheduleFlowData, rightClick: {id: 'scheduleDisableJobMenu', callback: this.handleDisableMenuClick}});
-    scheduleCustomJobsListView = new azkaban.JobListView({el:$('#scheduleJobListCustom'), model: scheduleFlowData, rightClick: {id: 'scheduleDisableJobMenu', callback: this.handleDisableMenuClick}});
+    scheduleCustomSvgGraphView = new azkaban.SvgGraphView({
+      el: $('#scheduleSvgDivCustom'),
+      model: scheduleFlowData,
+      rightClick: {
+        id: 'scheduleDisableJobMenu',
+        callback: this.handleDisableMenuClick
+      }
+    });
+    scheduleCustomJobsListView = new azkaban.JobListView({
+      el: $('#scheduleJobListCustom'),
+      model: scheduleFlowData,
+      rightClick: {
+        id: 'scheduleDisableJobMenu',
+        callback: this.handleDisableMenuClick
+      }
+    });
     scheduleFlowData.trigger("change:graph");
 
     this.flowSetup = true;
   },
-  handleAdvSchedule: function(evt) {
+  handleAdvSchedule: function (evt) {
     var scheduleURL = this.scheduleURL;
     var disabled = this.flowData.get("disabled");
     var disabledJobs = "";
-    for(var job in disabled) {
-      if(disabled[job] == true) {
+    for (var job in disabled) {
+      if (disabled[job] == true) {
         disabledJobs += "," + job;
       }
     }
@@ -325,8 +348,8 @@ azkaban.AdvancedScheduleView = Backbone.View.extend({
     var notifyFailureLast = $('#scheduleNotifyFailureLast').is(':checked');
     var executingJobOption = $('input:radio[name=gender]:checked').val();
 
-
-    var scheduleTime = $('#advhour').val() + "," + $('#advminutes').val() + "," + $('#advam_pm').val() + "," + $('#advtimezone').val();
+    var scheduleTime = $('#advhour').val() + "," + $('#advminutes').val() + ","
+        + $('#advam_pm').val() + "," + $('#advtimezone').val();
     var scheduleDate = $('#advdatepicker').val();
     var is_recurring = $('#advis_recurring').val();
     var period = $('#advperiod').val() + $('#advperiod_units').val();
@@ -345,7 +368,7 @@ azkaban.AdvancedScheduleView = Backbone.View.extend({
     }
 
     var scheduleData = {
-      projectId:projectId,
+      projectId: projectId,
       projectName: projectName,
       ajax: "advSchedule",
       flowName: flowName,
@@ -366,7 +389,7 @@ azkaban.AdvancedScheduleView = Backbone.View.extend({
     $.post(
         scheduleURL,
         scheduleData,
-        function(data) {
+        function (data) {
           if (data.error) {
             alert(data.error);
           }
@@ -377,7 +400,7 @@ azkaban.AdvancedScheduleView = Backbone.View.extend({
         "json"
     )
   },
-  handleAddRow: function(evt) {
+  handleAddRow: function (evt) {
     var tr = document.createElement("tr");
     var tdName = document.createElement("td");
     var tdValue = document.createElement("td");
@@ -404,7 +427,7 @@ azkaban.AdvancedScheduleView = Backbone.View.extend({
     $(tr).insertBefore("#scheduleAddRow");
     return tr;
   },
-  handleEditColumn : function(evt) {
+  handleEditColumn: function (evt) {
     var curTarget = evt.currentTarget;
 
     if (this.editingTarget != curTarget) {
@@ -421,16 +444,17 @@ azkaban.AdvancedScheduleView = Backbone.View.extend({
       $(curTarget).append(input);
       $(input).focus();
       this.editingTarget = curTarget;
-      }
+    }
   },
-  handleRemoveColumn : function(evt) {
+  handleRemoveColumn: function (evt) {
     var curTarget = evt.currentTarget;
     // Should be the table
     var row = curTarget.parentElement.parentElement;
     $(row).remove();
   },
-  closeEditingTarget: function(evt) {
-    if (this.editingTarget != null && this.editingTarget != evt.target && this.editingTarget != evt.target.parentElement ) {
+  closeEditingTarget: function (evt) {
+    if (this.editingTarget != null && this.editingTarget != evt.target
+        && this.editingTarget != evt.target.parentElement) {
       var input = $(this.editingTarget).children("input")[0];
       var text = $(input).val();
       $(input).remove();
@@ -450,24 +474,25 @@ azkaban.AdvancedScheduleView = Backbone.View.extend({
       this.editingTarget = null;
     }
   },
-  handleDisableMenuClick : function(action, el, pos) {
+  handleDisableMenuClick: function (action, el, pos) {
     var flowData = scheduleFlowData;
     var jobid = el[0].jobid;
-    var requestURL = contextURL + "/manager?project=" + projectName + "&flow=" + flowName + "&job=" + jobid;
+    var requestURL = contextURL + "/manager?project=" + projectName + "&flow="
+        + flowName + "&job=" + jobid;
     if (action == "open") {
       window.location.href = requestURL;
     }
-    else if(action == "openwindow") {
+    else if (action == "openwindow") {
       window.open(requestURL);
     }
-    else if(action == "disable") {
+    else if (action == "disable") {
       var disabled = flowData.get("disabled");
 
       disabled[jobid] = true;
       flowData.set({disabled: disabled});
       flowData.trigger("change:disabled");
     }
-    else if(action == "disableAll") {
+    else if (action == "disableAll") {
       var disabled = flowData.get("disabled");
 
       var nodes = flowData.get("nodes");
@@ -524,14 +549,14 @@ azkaban.AdvancedScheduleView = Backbone.View.extend({
       flowData.set({disabled: disabled});
       flowData.trigger("change:disabled");
     }
-    else if(action == "enable") {
+    else if (action == "enable") {
       var disabled = flowData.get("disabled");
 
       disabled[jobid] = false;
       flowData.set({disabled: disabled});
       flowData.trigger("change:disabled");
     }
-    else if(action == "enableAll") {
+    else if (action == "enableAll") {
       disabled = {};
       flowData.set({disabled: disabled});
       flowData.trigger("change:disabled");
diff --git a/azkaban-web-server/src/web/js/azkaban/view/schedule-panel.js b/azkaban-web-server/src/web/js/azkaban/view/schedule-panel.js
index 5478637..2245d20 100644
--- a/azkaban-web-server/src/web/js/azkaban/view/schedule-panel.js
+++ b/azkaban-web-server/src/web/js/azkaban/view/schedule-panel.js
@@ -22,28 +22,29 @@ azkaban.SchedulePanelView = Backbone.View.extend({
     "click #schedule-button": "scheduleFlow"
   },
 
-  initialize: function(settings) {
+  initialize: function (settings) {
   },
 
-  render: function() {
+  render: function () {
   },
 
-  showSchedulePanel: function() {
+  showSchedulePanel: function () {
     $('#schedule-modal').modal();
   },
 
-  hideSchedulePanel: function() {
+  hideSchedulePanel: function () {
     $('#schedule-modal').modal("hide");
   },
 
-  scheduleFlow: function() {
+  scheduleFlow: function () {
     var scheduleURL = contextURL + "/schedule"
     var scheduleData = flowExecuteDialogView.getExecutionOptionData();
 
-    console.log("Creating schedule for " + projectName + "." + scheduleData.flow);
+    console.log("Creating schedule for " + projectName + "."
+        + scheduleData.flow);
 
     var currentMomentTime = moment();
-    var scheduleTime = currentMomentTime.utc().format('h,mm,A,')+"UTC";
+    var scheduleTime = currentMomentTime.utc().format('h,mm,A,') + "UTC";
     var scheduleDate = currentMomentTime.format('MM/DD/YYYY');
 
     scheduleData.ajax = "scheduleCronFlow";
@@ -54,27 +55,29 @@ azkaban.SchedulePanelView = Backbone.View.extend({
     // Later we might implement a feature support cron under various timezones, depending on the future use cases.
     // scheduleData.cronTimezone = timezone;
 
-    console.log("current Time = " + scheduleDate + "  " + scheduleTime );
-    console.log("cronExpression = " +  scheduleData.cronExpression);
+    console.log("current Time = " + scheduleDate + "  " + scheduleTime);
+    console.log("cronExpression = " + scheduleData.cronExpression);
     var retSignal = validateQuartzStr(scheduleData.cronExpression);
 
-    if(retSignal == "NUM_FIELDS_ERROR") {
-      messageDialogView.show("Cron Syntax Error", "A valid Quartz Cron Expression should have 6 or 7 fields.");
+    if (retSignal == "NUM_FIELDS_ERROR") {
+      messageDialogView.show("Cron Syntax Error",
+          "A valid Quartz Cron Expression should have 6 or 7 fields.");
       return;
     } else if (retSignal == "DOW_DOM_STAR_ERROR") {
-      messageDialogView.show("Cron Syntax Error", "Currently Quartz doesn't support specifying both a day-of-week and a day-of-month value"
+      messageDialogView.show(
+          "Cron Syntax Error", "Currently Quartz doesn't support specifying both a day-of-week and a day-of-month value"
           + "(you must use the ‘?’ character in one of these fields). <a href=\"http://www.quartz-scheduler.org/documentation/quartz-2.x/tutorials/crontrigger.html\">Detailed Explanation</a>");
       return;
     }
 
-    var successHandler = function(data) {
+    var successHandler = function (data) {
       if (data.error) {
         schedulePanelView.hideSchedulePanel();
         messageDialogView.show("Error Scheduling Flow", data.error);
       }
       else {
         schedulePanelView.hideSchedulePanel();
-        messageDialogView.show("Flow Scheduled", data.message, function() {
+        messageDialogView.show("Flow Scheduled", data.message, function () {
           window.location.href = scheduleURL;
         });
       }
@@ -84,18 +87,18 @@ azkaban.SchedulePanelView = Backbone.View.extend({
   }
 });
 
-$(function() {
-  schedulePanelView =  new azkaban.SchedulePanelView({
+$(function () {
+  schedulePanelView = new azkaban.SchedulePanelView({
     el: $('#schedule-modal')
   });
 
-  $(document).keyup(function(e) {
+  $(document).keyup(function (e) {
     // escape key maps to keycode `27`
     if (e.keyCode == 27) {
       schedulePanelView.hideSchedulePanel();
     }
   });
-  
+
   // To compute the current timezone's time offset against UTC.
   // Currently not useful.
   // var TimeZoneOffset = new Date().toString().match(/([-\+][0-9]+)\s/)[1];
@@ -186,7 +189,7 @@ $(function() {
   });
 });
 
-function resetLabelColor(){
+function resetLabelColor() {
   $("#min_label").css("color", "black");
   $("#hour_label").css("color", "black");
   $("#dom_label").css("color", "black");
@@ -195,17 +198,19 @@ function resetLabelColor(){
 }
 
 var cron_minutes_id = "#minute_input";
-var cron_hours_id   = "#hour_input";
-var cron_dom_id     = "#dom_input";
-var cron_months_id  = "#month_input";
-var cron_dow_id     = "#dow_input";
-var cron_output_id  = "#cron-output";
-var cron_translate_id  = "#cronTranslate";
-var cron_translate_warning_id  = "#translationWarning";
+var cron_hours_id = "#hour_input";
+var cron_dom_id = "#dom_input";
+var cron_months_id = "#month_input";
+var cron_dow_id = "#dow_input";
+var cron_output_id = "#cron-output";
+var cron_translate_id = "#cronTranslate";
+var cron_translate_warning_id = "#translationWarning";
 
 function updateOutput() {
-  $(cron_output_id).val( $(cron_minutes_id).val() + " " +  $(cron_hours_id).val() + " " +
-      $(cron_dom_id).val() + " " + $(cron_months_id).val() + " " + $(cron_dow_id).val()
+  $(cron_output_id).val($(cron_minutes_id).val() + " " + $(cron_hours_id).val()
+      + " " +
+      $(cron_dom_id).val() + " " + $(cron_months_id).val() + " " + $(
+          cron_dow_id).val()
   );
   updateExpression();
 }
@@ -229,22 +234,26 @@ function updateExpression() {
 
   //Transform the moment time to UTC Date time (required by later.js)
   var serverTimeInJsDateFormat = new Date();
-  serverTimeInJsDateFormat.setUTCHours(serverTime.get('hour'), serverTime.get('minute'), 0, 0);
-  serverTimeInJsDateFormat.setUTCMonth(serverTime.get('month'), serverTime.get('date'));
+  serverTimeInJsDateFormat.setUTCHours(serverTime.get('hour'),
+      serverTime.get('minute'), 0, 0);
+  serverTimeInJsDateFormat.setUTCMonth(serverTime.get('month'),
+      serverTime.get('date'));
 
   // Calculate the following 10 occurences based on the current server time.
   // The logic is a bit tricky here. since later.js only support UTC Date (javascript raw library).
   // We transform from current browser-timezone-time to Server timezone.
   // Then we let serverTimeInJsDateFormat is equal to the server time.
-  var occurrences = later.schedule(laterCron).next(10, serverTimeInJsDateFormat);
+  var occurrences = later.schedule(laterCron).next(10,
+      serverTimeInJsDateFormat);
 
   //The following component below displays a list of next 10 triggering timestamp.
-  for(var i = 9; i >= 0; i--) {
+  for (var i = 9; i >= 0; i--) {
     var strTime = JSON.stringify(occurrences[i]);
 
     // Get the time. The original occurance time string is like: "2016-09-09T05:00:00.999",
     // We trim the string to ignore milliseconds.
-    var nextTime = '<li style="color:DarkGreen">' + strTime.substring(1, strTime.length-6) + '</li>';
+    var nextTime = '<li style="color:DarkGreen">' + strTime.substring(
+        1, strTime.length - 6) + '</li>';
     $('#nextRecurId').prepend(nextTime);
   }
 }
diff --git a/azkaban-web-server/src/web/js/azkaban/view/schedule-sla.js b/azkaban-web-server/src/web/js/azkaban/view/schedule-sla.js
index 891e76a..d8905c8 100644
--- a/azkaban-web-server/src/web/js/azkaban/view/schedule-sla.js
+++ b/azkaban-web-server/src/web/js/azkaban/view/schedule-sla.js
@@ -24,24 +24,24 @@ azkaban.ChangeSlaView = Backbone.View.extend({
     "click #add-btn": "handleAddRow"
   },
 
-  initialize: function(setting) {
-    $('#sla-options').on('hidden.bs.modal', function() {
+  initialize: function (setting) {
+    $('#sla-options').on('hidden.bs.modal', function () {
       slaView.handleSlaCancel();
     });
   },
 
-  handleSlaCancel: function() {
+  handleSlaCancel: function () {
     console.log("Clicked cancel button");
     var scheduleURL = contextURL + "/schedule";
     var tFlowRules = document.getElementById("flowRulesTbl").tBodies[0];
     var rows = tFlowRules.rows;
     var rowLength = rows.length
-    for (var i = 0; i < rowLength-1; i++) {
+    for (var i = 0; i < rowLength - 1; i++) {
       tFlowRules.deleteRow(0);
     }
   },
 
-  initFromSched: function(scheduleId, flowName) {
+  initFromSched: function (scheduleId, flowName) {
     this.scheduleId = scheduleId;
     var scheduleURL = contextURL + "/schedule"
     this.scheduleURL = scheduleURL;
@@ -61,7 +61,7 @@ azkaban.ChangeSlaView = Backbone.View.extend({
       "ajax": "slaInfo"
     };
 
-    var successHandler = function(data) {
+    var successHandler = function (data) {
       if (data.error) {
         alert(data.error);
         return;
@@ -76,9 +76,9 @@ azkaban.ChangeSlaView = Backbone.View.extend({
       nameToIndex[flowName] = 0;
       indexToText[0] = "flow " + flowName;
       for (var i = 1; i <= allJobNames.length; i++) {
-        indexToName[i] = allJobNames[i-1];
-        nameToIndex[allJobNames[i-1]] = i;
-        indexToText[i] = "job " + allJobNames[i-1];
+        indexToName[i] = allJobNames[i - 1];
+        nameToIndex[allJobNames[i - 1]] = i;
+        indexToText[i] = "job " + allJobNames[i - 1];
       }
 
       // populate with existing settings
@@ -102,7 +102,8 @@ azkaban.ChangeSlaView = Backbone.View.extend({
           var ruleSelect = document.createElement("select");
           ruleSelect.setAttribute("class", "form-control");
           for (var i in ruleBoxOptions) {
-            ruleSelect.options[i] = new Option(ruleBoxOptions[i], ruleBoxOptions[i]);
+            ruleSelect.options[i] = new Option(ruleBoxOptions[i],
+                ruleBoxOptions[i]);
             if (data.settings[setting].rule == ruleBoxOptions[i]) {
               ruleSelect.options[i].selected = true;
             }
@@ -114,7 +115,7 @@ azkaban.ChangeSlaView = Backbone.View.extend({
           duration.type = "text";
           duration.setAttribute("class", "form-control durationpick");
           var rawMinutes = data.settings[setting].duration;
-          var intMinutes = rawMinutes.substring(0, rawMinutes.length-1);
+          var intMinutes = rawMinutes.substring(0, rawMinutes.length - 1);
           var minutes = parseInt(intMinutes);
           var hours = Math.floor(minutes / 60);
           minutes = minutes % 60;
@@ -158,7 +159,7 @@ azkaban.ChangeSlaView = Backbone.View.extend({
     console.log("Loaded schedule info. Ready to set SLA.");
   },
 
-  handleRemoveSla: function(evt) {
+  handleRemoveSla: function (evt) {
     console.log("Clicked remove sla button");
     var scheduleURL = this.scheduleURL;
     var redirectURL = this.scheduleURL;
@@ -166,7 +167,7 @@ azkaban.ChangeSlaView = Backbone.View.extend({
       "action": "removeSla",
       "scheduleId": this.scheduleId
     };
-    var successHandler = function(data) {
+    var successHandler = function (data) {
       if (data.error) {
         $('#errorMsg').text(data.error)
       }
@@ -177,18 +178,19 @@ azkaban.ChangeSlaView = Backbone.View.extend({
     $.post(scheduleURL, requestData, successHanlder, "json");
   },
 
-  handleSetSla: function(evt) {
+  handleSetSla: function (evt) {
     var slaEmails = $('#slaEmails').val();
     var settings = {};
     var tFlowRules = document.getElementById("flowRulesTbl").tBodies[0];
-    for (var row = 0; row < tFlowRules.rows.length-1; row++) {
+    for (var row = 0; row < tFlowRules.rows.length - 1; row++) {
       var rFlowRule = tFlowRules.rows[row];
       var id = rFlowRule.cells[0].firstChild.value;
       var rule = rFlowRule.cells[1].firstChild.value;
       var duration = rFlowRule.cells[2].firstChild.value;
       var email = rFlowRule.cells[3].firstChild.checked;
       var kill = rFlowRule.cells[4].firstChild.checked;
-      settings[row] = id + "," + rule + "," + duration + "," + email + "," + kill;
+      settings[row] = id + "," + rule + "," + duration + "," + email + ","
+          + kill;
     }
 
     var slaData = {
@@ -199,7 +201,7 @@ azkaban.ChangeSlaView = Backbone.View.extend({
     };
 
     var scheduleURL = this.scheduleURL;
-    var successHandler = function(data) {
+    var successHandler = function (data) {
       if (data.error) {
         alert(data.error);
       }
@@ -211,14 +213,14 @@ azkaban.ChangeSlaView = Backbone.View.extend({
     $.post(scheduleURL, slaData, successHandler, "json");
   },
 
-  handleAddRow: function(evt) {
+  handleAddRow: function (evt) {
     var indexToName = this.indexToName;
     var nameToIndex = this.nameToIndex;
     var indexToText = this.indexToText;
     var ruleBoxOptions = this.ruleBoxOptions;
 
     var tFlowRules = document.getElementById("flowRulesTbl").tBodies[0];
-    var rFlowRule = tFlowRules.insertRow(tFlowRules.rows.length-1);
+    var rFlowRule = tFlowRules.insertRow(tFlowRules.rows.length - 1);
 
     var cId = rFlowRule.insertCell(-1);
     var idSelect = document.createElement("select");
@@ -258,7 +260,7 @@ azkaban.ChangeSlaView = Backbone.View.extend({
     return rFlowRule;
   },
 
-  handleEditColumn: function(evt) {
+  handleEditColumn: function (evt) {
     var curTarget = evt.currentTarget;
     if (this.editingTarget != curTarget) {
       this.closeEditingTarget();
@@ -277,13 +279,13 @@ azkaban.ChangeSlaView = Backbone.View.extend({
     }
   },
 
-  handleRemoveColumn: function(evt) {
+  handleRemoveColumn: function (evt) {
     var curTarget = evt.currentTarget;
     // Should be the table
     var row = curTarget.parentElement.parentElement;
     $(row).remove();
   },
 
-  closeEditingTarget: function(evt) {
+  closeEditingTarget: function (evt) {
   }
 });
diff --git a/azkaban-web-server/src/web/js/azkaban/view/svg-graph.js b/azkaban-web-server/src/web/js/azkaban/view/svg-graph.js
index c1d81ff..a90f9e5 100644
--- a/azkaban-web-server/src/web/js/azkaban/view/svg-graph.js
+++ b/azkaban-web-server/src/web/js/azkaban/view/svg-graph.js
@@ -21,10 +21,9 @@
 $.namespace('azkaban');
 
 azkaban.SvgGraphView = Backbone.View.extend({
-  events: {
-  },
+  events: {},
 
-  initialize: function(settings) {
+  initialize: function (settings) {
     this.model.bind('change:selected', this.changeSelected, this);
     this.model.bind('centerNode', this.centerNode, this);
     this.model.bind('change:graph', this.render, this);
@@ -65,7 +64,7 @@ azkaban.SvgGraphView = Backbone.View.extend({
 
     var self = this;
     if (self.rightClick && self.rightClick.graph) {
-      $(svg).on("contextmenu", function(evt) {
+      $(svg).on("contextmenu", function (evt) {
         console.log("graph click");
         var currentTarget = evt.currentTarget;
 
@@ -74,13 +73,14 @@ azkaban.SvgGraphView = Backbone.View.extend({
       });
     }
 
-    this.tooltipcontainer = settings.tooltipcontainer ? settings.tooltipcontainer : "body";
+    this.tooltipcontainer = settings.tooltipcontainer
+        ? settings.tooltipcontainer : "body";
     if (settings.render) {
       this.render();
     }
   },
 
-  render: function() {
+  render: function () {
     console.log("graph render");
     $(this.mainG).empty();
 
@@ -88,7 +88,7 @@ azkaban.SvgGraphView = Backbone.View.extend({
     this.resetPanZoom(0);
   },
 
-  renderGraph: function(data, g) {
+  renderGraph: function (data, g) {
     g.data = data;
     var nodes = data.nodes;
     var edges = data.edges;
@@ -99,7 +99,8 @@ azkaban.SvgGraphView = Backbone.View.extend({
     if (nodes.length == 0) {
       console.log("No results");
       return;
-    };
+    }
+    ;
 
     // Assign labels
     for (var i = 0; i < nodes.length; ++i) {
@@ -109,13 +110,13 @@ azkaban.SvgGraphView = Backbone.View.extend({
     var self = this;
     for (var i = 0; i < nodes.length; ++i) {
       this.drawNode(this, nodes[i], g);
-      $(nodes[i].gNode).click(function(evt) {
+      $(nodes[i].gNode).click(function (evt) {
         var selected = self.model.get("selected");
         if (selected == evt.currentTarget.data) {
           self.model.unset("selected");
         }
         else {
-          self.model.set({"selected":evt.currentTarget.data});
+          self.model.set({"selected": evt.currentTarget.data});
         }
 
         evt.stopPropagation();
@@ -134,7 +135,7 @@ azkaban.SvgGraphView = Backbone.View.extend({
       this.drawEdge(this, edges[i], edgeG);
     }
 
-    this.model.set({"flowId":data.flowId, "edges": edges});
+    this.model.set({"flowId": data.flowId, "edges": edges});
 
     var margin = this.graphMargin;
     bounds.minX = bounds.minX ? bounds.minX - margin : -margin;
@@ -148,7 +149,7 @@ azkaban.SvgGraphView = Backbone.View.extend({
       if (self.rightClick.node) {
         // Proper children selectors don't work properly on svg
         for (var i = 0; i < nodes.length; ++i) {
-          $(nodes[i].gNode).on("contextmenu", function(evt) {
+          $(nodes[i].gNode).on("contextmenu", function (evt) {
             console.log("node click");
             var currentTarget = evt.currentTarget;
             self.rightClick.node(evt, self.model, currentTarget.data);
@@ -157,7 +158,7 @@ azkaban.SvgGraphView = Backbone.View.extend({
         }
       }
       if (this.rightClick.graph) {
-        $(g).on("contextmenu", function(evt) {
+        $(g).on("contextmenu", function (evt) {
           console.log("graph click");
           var currentTarget = evt.currentTarget;
 
@@ -165,9 +166,10 @@ azkaban.SvgGraphView = Backbone.View.extend({
           return false;
         });
       }
-    };
+    }
+    ;
 
-    $(".node").each(function(d,i) {
+    $(".node").each(function (d, i) {
       $(this).tooltip({
         container: self.tooltipcontainer,
         delay: {
@@ -180,32 +182,34 @@ azkaban.SvgGraphView = Backbone.View.extend({
     return bounds;
   },
 
-  handleDisabledChange: function(evt) {
+  handleDisabledChange: function (evt) {
     this.changeDisabled(this.model.get('data'));
   },
 
-  changeDisabled: function(data) {
+  changeDisabled: function (data) {
     for (var i = 0; i < data.nodes.length; ++i) {
       var node = data.nodes[i];
       if (node.disabled) {
         if (node.gNode) {
           addClass(node.gNode, "nodeDisabled");
-          $(node.gNode).attr("title", "DISABLED (" + node.type + ")").tooltip('fixTitle');
+          $(node.gNode).attr("title", "DISABLED (" + node.type + ")").tooltip(
+              'fixTitle');
         }
       }
       else {
         if (node.gNode) {
           removeClass(node.gNode, "nodeDisabled");
-          $(node.gNode).attr("title", node.status + " (" + node.type + ")").tooltip('fixTitle');
+          $(node.gNode).attr("title", node.status + " (" + node.type
+              + ")").tooltip('fixTitle');
         }
-        if (node.type=='flow') {
+        if (node.type == 'flow') {
           this.changeDisabled(node);
         }
       }
     }
   },
 
-  assignInitialStatus: function(evt, data) {
+  assignInitialStatus: function (evt, data) {
     for (var i = 0; i < data.nodes.length; ++i) {
       var updateNode = data.nodes[i];
       var g = updateNode.gNode;
@@ -222,7 +226,7 @@ azkaban.SvgGraphView = Backbone.View.extend({
     }
   },
 
-  changeSelected: function(self) {
+  changeSelected: function (self) {
     console.log("change selected");
     var selected = this.model.get("selected");
     var previous = this.model.previous("selected");
@@ -244,20 +248,20 @@ azkaban.SvgGraphView = Backbone.View.extend({
     }
   },
 
-  propagateExpansion: function(node) {
+  propagateExpansion: function (node) {
     if (node.parent.type) {
       this.propagateExpansion(node.parent);
       this.expandFlow(node.parent);
     }
   },
 
-  handleStatusUpdate: function(evt) {
+  handleStatusUpdate: function (evt) {
     var updateData = this.model.get("update");
     var data = this.model.get("data");
     this.updateStatusChanges(updateData, data);
   },
 
-  updateStatusChanges: function(updateData, data) {
+  updateStatusChanges: function (updateData, data) {
     // Assumes all changes have been applied.
     if (updateData.nodes) {
       var nodeMap = data.nodeMap;
@@ -285,14 +289,14 @@ azkaban.SvgGraphView = Backbone.View.extend({
     }
   },
 
-  handleRemoveAllStatus: function(gNode) {
+  handleRemoveAllStatus: function (gNode) {
     for (var j = 0; j < statusList.length; ++j) {
       var status = statusList[j];
       removeClass(gNode, status);
     }
   },
 
-  handleRightClick: function(self) {
+  handleRightClick: function (self) {
     if (this.rightClick) {
       var callbacks = this.rightClick;
       var currentTarget = self.currentTarget;
@@ -301,7 +305,7 @@ azkaban.SvgGraphView = Backbone.View.extend({
       }
       else if (callbacks.edge &&
           (currentTarget.nodeName == "polyline" ||
-           currentTarget.nodeName == "line")) {
+              currentTarget.nodeName == "line")) {
         callbacks.edge(self, this.model);
       }
       else if (callbacks.graph) {
@@ -312,37 +316,38 @@ azkaban.SvgGraphView = Backbone.View.extend({
     return true;
   },
 
-  drawEdge: function(self, edge, g) {
+  drawEdge: function (self, edge, g) {
     var svg = this.svg;
     var svgns = self.svgns;
 
     var startNode = edge.fromNode;
     var endNode = edge.toNode;
 
-    var startPointY = startNode.y + startNode.height/2;
-    var endPointY = endNode.y - endNode.height/2;
+    var startPointY = startNode.y + startNode.height / 2;
+    var endPointY = endNode.y - endNode.height / 2;
 
     if (edge.guides) {
       // Create guide array
       var pointArray = new Array();
       pointArray.push([startNode.x, startPointY]);
-      for (var i = 0; i < edge.guides.length; ++i ) {
+      for (var i = 0; i < edge.guides.length; ++i) {
         var edgeGuidePoint = edge.guides[i];
         pointArray.push([edgeGuidePoint.x, edgeGuidePoint.y]);
       }
       pointArray.push([endNode.x, endPointY]);
 
-      edge.line = svg.polyline(g, pointArray, {class:"edge", fill:"none"});
+      edge.line = svg.polyline(g, pointArray, {class: "edge", fill: "none"});
       edge.line.data = edge;
       edge.oldpoints = pointArray;
     }
     else {
-      edge.line = svg.line(g, startNode.x, startPointY, endNode.x, endPointY, {class:"edge"});
+      edge.line = svg.line(g, startNode.x, startPointY, endNode.x, endPointY,
+          {class: "edge"});
       edge.line.data = edge;
     }
   },
 
-  drawNode: function(self, node, g) {
+  drawNode: function (self, node, g) {
     if (node.type == 'flow') {
       this.drawFlowNode(self, node, g);
     }
@@ -351,7 +356,7 @@ azkaban.SvgGraphView = Backbone.View.extend({
     }
   },
 
-  moveNodes: function(nodes) {
+  moveNodes: function (nodes) {
     var svg = this.svg;
     for (var i = 0; i < nodes.length; ++i) {
       var node = nodes[i];
@@ -361,7 +366,7 @@ azkaban.SvgGraphView = Backbone.View.extend({
     }
   },
 
-  expandFlow: function(node) {
+  expandFlow: function (node) {
     var svg = this.svg;
     var gnode = node.gNode;
     node.expanded = true;
@@ -372,7 +377,7 @@ azkaban.SvgGraphView = Backbone.View.extend({
 
     var bbox;
     if (!innerG.expandedFlow) {
-      var topmargin= 30, bottommargin=5;
+      var topmargin = 30, bottommargin = 5;
       var hmargin = 10;
 
       var expandedFlow = svg.group(innerG, "", {class: "expandedGraph"});
@@ -403,7 +408,7 @@ azkaban.SvgGraphView = Backbone.View.extend({
     this.graphBounds = bounds;
   },
 
-  collapseFlow: function(node) {
+  collapseFlow: function (node) {
     console.log("Collapsing flow");
     var svg = this.svg;
     var gnode = node.gNode;
@@ -432,7 +437,7 @@ azkaban.SvgGraphView = Backbone.View.extend({
     this.graphBounds = bounds;
   },
 
-  relayoutFlow: function(node) {
+  relayoutFlow: function (node) {
     if (node.expanded) {
       this.layoutExpandedFlowNode(node);
     }
@@ -447,7 +452,7 @@ azkaban.SvgGraphView = Backbone.View.extend({
     }
   },
 
-  moveNodeEdges: function(nodes, edges) {
+  moveNodeEdges: function (nodes, edges) {
     var svg = this.svg;
     for (var i = 0; i < nodes.length; ++i) {
       var node = nodes[i];
@@ -462,14 +467,14 @@ azkaban.SvgGraphView = Backbone.View.extend({
       var endNode = edge.toNode;
       var line = edge.line;
 
-      var startPointY = startNode.y + startNode.height/2;
-      var endPointY = endNode.y - endNode.height/2;
+      var startPointY = startNode.y + startNode.height / 2;
+      var endPointY = endNode.y - endNode.height / 2;
 
       if (edge.guides) {
         // Create guide array
         var pointArray = new Array();
         pointArray.push([startNode.x, startPointY]);
-        for (var i = 0; i < edge.guides.length; ++i ) {
+        for (var i = 0; i < edge.guides.length; ++i) {
           var edgeGuidePoint = edge.guides[i];
           pointArray.push([edgeGuidePoint.x, edgeGuidePoint.y]);
         }
@@ -489,7 +494,7 @@ azkaban.SvgGraphView = Backbone.View.extend({
     }
   },
 
-  calculateBounds: function(nodes) {
+  calculateBounds: function (nodes) {
     var bounds = {};
     var node = nodes[0];
     bounds.minX = node.x - 10;
@@ -499,8 +504,8 @@ azkaban.SvgGraphView = Backbone.View.extend({
 
     for (var i = 0; i < nodes.length; ++i) {
       node = nodes[i];
-      var centerX = node.width/2;
-      var centerY = node.height/2;
+      var centerX = node.width / 2;
+      var centerY = node.height / 2;
 
       var minX = node.x - centerX;
       var minY = node.y - centerY;
@@ -518,34 +523,35 @@ azkaban.SvgGraphView = Backbone.View.extend({
     return bounds;
   },
 
-  drawBoxNode: function(self, node, g) {
+  drawBoxNode: function (self, node, g) {
     var svg = this.svg;
     var horizontalMargin = 8;
     var verticalMargin = 2;
 
-    var nodeG = svg.group(g, "", {class:"node jobnode"});
+    var nodeG = svg.group(g, "", {class: "node jobnode"});
 
-    var innerG = svg.group(nodeG, "", {class:"nodebox"});
+    var innerG = svg.group(nodeG, "", {class: "nodebox"});
     var borderRect = svg.rect(innerG, 0, 0, 10, 10, 3, 3, {class: "border"});
     var jobNameText = svg.text(innerG, horizontalMargin, 16, node.label);
     nodeG.innerG = innerG;
     innerG.borderRect = borderRect;
 
     var labelBBox = jobNameText.getBBox();
-    var totalWidth = labelBBox.width + 2*horizontalMargin;
-    var totalHeight = labelBBox.height + 2*verticalMargin;
+    var totalWidth = labelBBox.width + 2 * horizontalMargin;
+    var totalHeight = labelBBox.height + 2 * verticalMargin;
     svg.change(borderRect, {width: totalWidth, height: totalHeight});
-    svg.change(jobNameText, {y: (totalHeight + labelBBox.height)/2 - 3});
-    svg.change(innerG, {transform: translateStr(-totalWidth/2, -totalHeight/2)});
+    svg.change(jobNameText, {y: (totalHeight + labelBBox.height) / 2 - 3});
+    svg.change(innerG,
+        {transform: translateStr(-totalWidth / 2, -totalHeight / 2)});
 
-    node.width=totalWidth;
-    node.height=totalHeight;
+    node.width = totalWidth;
+    node.height = totalHeight;
 
     node.gNode = nodeG;
     nodeG.data = node;
   },
 
-  drawFlowNode: function(self, node, g) {
+  drawFlowNode: function (self, node, g) {
     var svg = this.svg;
 
     // Base flow node
@@ -553,7 +559,8 @@ azkaban.SvgGraphView = Backbone.View.extend({
 
     // Create all the elements
     var innerG = svg.group(nodeG, "", {class: "nodebox collapsed"});
-    var borderRect = svg.rect(innerG, 0, 0, 10, 10, 3, 3, {class: "flowborder"});
+    var borderRect = svg.rect(innerG, 0, 0, 10, 10, 3, 3,
+        {class: "flowborder"});
 
     // Create label
     var labelG = svg.group(innerG);
@@ -561,15 +568,16 @@ azkaban.SvgGraphView = Backbone.View.extend({
     var iconWidth = 21;
     var textOffset = iconWidth + 4;
     var jobNameText = svg.text(labelG, textOffset, 1, node.label);
-    var flowIdText = svg.text(labelG, textOffset, 11, node.flowId, {"font-size": 8})
+    var flowIdText = svg.text(labelG, textOffset, 11, node.flowId,
+        {"font-size": 8})
     var tempLabelG = labelG.getBBox();
     var iconImage = svg.image(
-        labelG, 0, -iconHeight/2, iconWidth, iconHeight,
+        labelG, 0, -iconHeight / 2, iconWidth, iconHeight,
         contextURL + "/images/graph-icon.png", {});
 
     // Assign key values to make searching quicker
-    node.gNode=nodeG;
-    nodeG.data=node;
+    node.gNode = nodeG;
+    nodeG.data = node;
 
     // Do this because jquery svg selectors don't work
     nodeG.innerG = innerG;
@@ -580,7 +588,7 @@ azkaban.SvgGraphView = Backbone.View.extend({
     this.layoutFlowNode(self, node);
   },
 
-  layoutFlowNode: function(self, node) {
+  layoutFlowNode: function (self, node) {
     var svg = this.svg;
     var horizontalMargin = 8;
     var verticalMargin = 2;
@@ -591,11 +599,15 @@ azkaban.SvgGraphView = Backbone.View.extend({
     var labelG = innerG.labelG;
 
     var labelBBox = labelG.getBBox();
-    var totalWidth = labelBBox.width + 2*horizontalMargin;
-    var totalHeight = labelBBox.height + 2*verticalMargin;
+    var totalWidth = labelBBox.width + 2 * horizontalMargin;
+    var totalHeight = labelBBox.height + 2 * verticalMargin;
 
-    svg.change(labelG, {transform: translateStr(horizontalMargin, labelBBox.height/2 + verticalMargin)});
-    svg.change(innerG, {transform: translateStr(-totalWidth/2, -totalHeight/2)});
+    svg.change(labelG, {
+      transform: translateStr(horizontalMargin, labelBBox.height / 2
+          + verticalMargin)
+    });
+    svg.change(innerG,
+        {transform: translateStr(-totalWidth / 2, -totalHeight / 2)});
     svg.change(borderRect, {width: totalWidth, height: totalHeight});
 
     node.height = totalHeight;
@@ -604,9 +616,9 @@ azkaban.SvgGraphView = Backbone.View.extend({
     node.collapsedWidth = totalWidth;
   },
 
-  layoutExpandedFlowNode: function(node) {
+  layoutExpandedFlowNode: function (node) {
     var svg = this.svg;
-    var topmargin= 30, bottommargin=5;
+    var topmargin = 30, bottommargin = 5;
     var hmargin = 10;
 
     var gNode = node.gNode;
@@ -618,23 +630,26 @@ azkaban.SvgGraphView = Backbone.View.extend({
     var bound = this.calculateBounds(node.nodes);
 
     node.height = bound.height + topmargin + bottommargin;
-    node.width = bound.width + hmargin*2;
-    svg.change(expandedFlow, {transform: translateStr(-bound.minX + hmargin, -bound.minY + topmargin)});
+    node.width = bound.width + hmargin * 2;
+    svg.change(expandedFlow, {
+      transform: translateStr(-bound.minX + hmargin, -bound.minY + topmargin)
+    });
     //$(innerG).animate({svgTransform: translateStr(-node.width/2, -node.height/2)}, 50);
     //$(borderRect).animate({svgWidth: node.width, svgHeight: node.height}, 50);
   },
 
-  animateExpandedFlowNode: function(node, time) {
+  animateExpandedFlowNode: function (node, time) {
     var gNode = node.gNode;
     var innerG = gNode.innerG;
     var borderRect = innerG.borderRect;
 
-    $(innerG).animate({svgTransform: translateStr(-node.width/2, -node.height/2)}, time);
+    $(innerG).animate(
+        {svgTransform: translateStr(-node.width / 2, -node.height / 2)}, time);
     $(borderRect).animate({svgWidth: node.width, svgHeight: node.height}, time);
     $(borderRect).animate({svgFill: 'white'}, time);
   },
 
-  resetPanZoom: function(duration) {
+  resetPanZoom: function (duration) {
     var bounds = this.graphBounds;
     var param = {
       x: bounds.minX,
@@ -646,7 +661,7 @@ azkaban.SvgGraphView = Backbone.View.extend({
     this.panZoom(param);
   },
 
-  centerNode: function(node) {
+  centerNode: function (node) {
     // The magic of affine transformation.
     // Multiply the inverse root matrix with the current matrix to get the node
     // position.
@@ -656,13 +671,13 @@ azkaban.SvgGraphView = Backbone.View.extend({
     var otherTransform = globalCTM.multiply(ctm);
     // Also a beauty of affine transformation. The translate is always the
     // left most column of the matrix.
-    var x = otherTransform.e - node.width/2;
-    var y = otherTransform.f - node.height/2;
+    var x = otherTransform.e - node.width / 2;
+    var y = otherTransform.f - node.height / 2;
 
     this.panZoom({x: x, y: y, width: node.width, height: node.height});
   },
 
-  globalNodePosition: function(gNode) {
+  globalNodePosition: function (gNode) {
     if (node.parent) {
 
       var parentPos = this.globalNodePosition(node.parent);
@@ -673,7 +688,7 @@ azkaban.SvgGraphView = Backbone.View.extend({
     }
   },
 
-  panZoom: function(params) {
+  panZoom: function (params) {
     params.maxScale = 2;
     $(this.svgGraph).svgNavigate("transformToBox", params);
   }
diff --git a/azkaban-web-server/src/web/js/azkaban/view/table-sort.js b/azkaban-web-server/src/web/js/azkaban/view/table-sort.js
index 968b7af..7c11a9f 100644
--- a/azkaban-web-server/src/web/js/azkaban/view/table-sort.js
+++ b/azkaban-web-server/src/web/js/azkaban/view/table-sort.js
@@ -21,7 +21,7 @@ azkaban.TableSorter = Backbone.View.extend({
     "click .sortable": "handleClickSort"
   },
 
-  initialize: function(settings) {
+  initialize: function (settings) {
     $(this.el).addClass("sortableTable");
 
     var thead = $(this.el).children("thead");
@@ -39,7 +39,7 @@ azkaban.TableSorter = Backbone.View.extend({
     var rows = $(tbody).children("tr");
 
     var row;
-    for (var i = 0; i < rows.length; ++i ) {
+    for (var i = 0; i < rows.length; ++i) {
       var nextRow = rows[i];
       if (row && $(nextRow).hasClass("childrow")) {
         if (!row.childRows) {
@@ -57,11 +57,11 @@ azkaban.TableSorter = Backbone.View.extend({
     }
   },
 
-  handleClickSort: function(evt) {
+  handleClickSort: function (evt) {
     this.toggleSort(evt.currentTarget);
   },
 
-  toggleSort: function(th) {
+  toggleSort: function (th) {
     console.log("sorting by index " + $(th).index());
     if ($(th).hasClass("asc")) {
       $(th).removeClass("asc");
@@ -77,14 +77,15 @@ azkaban.TableSorter = Backbone.View.extend({
       this.sort($(th).index(), false);
     }
     else {
-      $(th).parent().children(".sortable").removeClass("asc").removeClass("desc");
+      $(th).parent().children(".sortable").removeClass("asc").removeClass(
+          "desc");
       $(th).addClass("asc");
 
       this.sort($(th).index(), false);
     }
   },
 
-  sort: function(index, desc) {
+  sort: function (index, desc) {
     var tbody = $(this.el).children("tbody");
     var rows = $(tbody).children("tr");
 
@@ -98,7 +99,7 @@ azkaban.TableSorter = Backbone.View.extend({
     }
 
     if (desc) {
-      tdToSort.sort(function(a,b) {
+      tdToSort.sort(function (a, b) {
         var texta = $(a).text().trim().toLowerCase();
         var textb = $(b).text().trim().toLowerCase();
 
@@ -114,7 +115,7 @@ azkaban.TableSorter = Backbone.View.extend({
       });
     }
     else {
-      tdToSort.sort(function(a,b) {
+      tdToSort.sort(function (a, b) {
         var texta = $(a).text().trim().toLowerCase();
         var textb = $(b).text().trim().toLowerCase();
 
@@ -137,7 +138,7 @@ azkaban.TableSorter = Backbone.View.extend({
 
       var childRows = tr[0].childRows;
       if (childRows) {
-        for(var j=0; j < childRows.length; ++j) {
+        for (var j = 0; j < childRows.length; ++j) {
           sortedTR.push(childRows[j]);
         }
       }
@@ -148,7 +149,7 @@ azkaban.TableSorter = Backbone.View.extend({
     }
   },
 
-  render: function() {
+  render: function () {
     console.log("render sorted table");
   }
 });
diff --git a/azkaban-web-server/src/web/js/azkaban/view/time-graph.js b/azkaban-web-server/src/web/js/azkaban/view/time-graph.js
index a74a49c..fe8a2b6 100644
--- a/azkaban-web-server/src/web/js/azkaban/view/time-graph.js
+++ b/azkaban-web-server/src/web/js/azkaban/view/time-graph.js
@@ -17,10 +17,9 @@
 $.namespace('azkaban');
 
 azkaban.TimeGraphView = Backbone.View.extend({
-  events: {
-  },
+  events: {},
 
-  initialize: function(settings) {
+  initialize: function (settings) {
     this.model.bind('render', this.render, this);
     this.model.bind('change:page', this.render, this);
     this.modelField = settings.modelField;
@@ -28,7 +27,7 @@ azkaban.TimeGraphView = Backbone.View.extend({
     this.render();
   },
 
-  render: function(self) {
+  render: function (self) {
     var series = this.model.get(this.modelField);
     if (series == null) {
       return;
@@ -48,7 +47,8 @@ azkaban.TimeGraphView = Backbone.View.extend({
       var startTime = series[i].startTime;
       var endTime = series[i].endTime;
       if (startTime == -1 && endTime == -1) {
-        console.log("Ignoring data point with both start and end time invalid.");
+        console.log(
+            "Ignoring data point with both start and end time invalid.");
         continue;
       }
 
@@ -75,7 +75,7 @@ azkaban.TimeGraphView = Backbone.View.extend({
     var graphDiv = document.createElement('div');
     $(this.graphContainer).html(graphDiv);
 
-    var lineColorsCallback = function(row, sidx, type) {
+    var lineColorsCallback = function (row, sidx, type) {
       if (type != 'point') {
         return "#000000";
       }
@@ -103,12 +103,12 @@ azkaban.TimeGraphView = Backbone.View.extend({
       }
     };
 
-    var yLabelFormatCallback = function(y) {
+    var yLabelFormatCallback = function (y) {
       var seconds = y / 1000.0;
       return seconds.toString() + " s";
     };
 
-    var hoverCallback = function(index, options, content) {
+    var hoverCallback = function (index, options, content) {
       // Note: series contains the data points in descending order and index
       // is the index into Morris's internal array of data sorted in ascending
       // x order.
diff --git a/azkaban-web-server/src/web/js/azkaban/view/triggers.js b/azkaban-web-server/src/web/js/azkaban/view/triggers.js
index a9c15a8..8b6ed22 100644
--- a/azkaban-web-server/src/web/js/azkaban/view/triggers.js
+++ b/azkaban-web-server/src/web/js/azkaban/view/triggers.js
@@ -20,7 +20,7 @@ function expireTrigger(triggerId) {
   var triggerURL = contextURL + "/triggers"
   var redirectURL = contextURL + "/triggers"
   var requestData = {"ajax": "expireTrigger", "triggerId": triggerId};
-  var successHandler = function(data) {
+  var successHandler = function (data) {
     if (data.error) {
       //alert(data.error)
       $('#errorMsg').text(data.error);
@@ -37,7 +37,7 @@ function removeSched(scheduleId) {
   var scheduleURL = contextURL + "/schedule"
   var redirectURL = contextURL + "/schedule"
   var requestData = {"action": "removeSched", "scheduleId": scheduleId};
-  var successHandler = function(data) {
+  var successHandler = function (data) {
     if (data.error) {
       //alert(data.error)
       $('#errorMsg').text(data.error);
@@ -54,7 +54,7 @@ function removeSla(scheduleId) {
   var scheduleURL = contextURL + "/schedule"
   var redirectURL = contextURL + "/schedule"
   var requestData = {"action": "removeSla", "scheduleId": scheduleId};
-  var successHandler = function(data) {
+  var successHandler = function (data) {
     if (data.error) {
       //alert(data.error)
       $('#errorMsg').text(data.error)
@@ -69,7 +69,7 @@ function removeSla(scheduleId) {
 
 azkaban.ChangeSlaView = Backbone.View.extend({
   events: {
-    "click" : "closeEditingTarget",
+    "click": "closeEditingTarget",
     "click #set-sla-btn": "handleSetSla",
     "click #remove-sla-btn": "handleRemoveSla",
     "click #sla-cancel-btn": "handleSlaCancel",
@@ -77,10 +77,10 @@ azkaban.ChangeSlaView = Backbone.View.extend({
     "click #addRow": "handleAddRow"
   },
 
-  initialize: function(setting) {
+  initialize: function (setting) {
   },
 
-  handleSlaCancel: function(evt) {
+  handleSlaCancel: function (evt) {
     console.log("Clicked cancel button");
     var scheduleURL = contextURL + "/schedule";
 
@@ -90,12 +90,12 @@ azkaban.ChangeSlaView = Backbone.View.extend({
     var tFlowRules = document.getElementById("flowRulesTbl").tBodies[0];
     var rows = tFlowRules.rows;
     var rowLength = rows.length
-    for (var i = 0; i < rowLength-1; i++) {
+    for (var i = 0; i < rowLength - 1; i++) {
       tFlowRules.deleteRow(0);
     }
   },
 
-  initFromSched: function(scheduleId, flowName) {
+  initFromSched: function (scheduleId, flowName) {
     this.scheduleId = scheduleId;
 
     var scheduleURL = contextURL + "/schedule"
@@ -110,7 +110,7 @@ azkaban.ChangeSlaView = Backbone.View.extend({
     this.ruleBoxOptions = ruleBoxOptions;
 
     var fetchScheduleData = {"scheduleId": this.scheduleId, "ajax": "slaInfo"};
-    var successHandler = function(data) {
+    var successHandler = function (data) {
       if (data.error) {
         alert(data.error);
         return;
@@ -125,9 +125,9 @@ azkaban.ChangeSlaView = Backbone.View.extend({
       nameToIndex[flowName] = 0;
       indexToText[0] = "flow " + flowName;
       for (var i = 1; i <= allJobNames.length; i++) {
-        indexToName[i] = allJobNames[i-1];
-        nameToIndex[allJobNames[i-1]] = i;
-        indexToText[i] = "job " + allJobNames[i-1];
+        indexToName[i] = allJobNames[i - 1];
+        nameToIndex[allJobNames[i - 1]] = i;
+        indexToText[i] = "job " + allJobNames[i - 1];
       }
 
       // populate with existing settings
@@ -153,7 +153,8 @@ azkaban.ChangeSlaView = Backbone.View.extend({
         var cRule = rFlowRule.insertCell(-1);
         var ruleSelect = document.createElement("select");
         for (var i in ruleBoxOptions) {
-          ruleSelect.options[i] = new Option(ruleBoxOptions[i], ruleBoxOptions[i]);
+          ruleSelect.options[i] = new Option(ruleBoxOptions[i],
+              ruleBoxOptions[i]);
           if (data.settings[setting].rule == ruleBoxOptions[i]) {
             ruleSelect.options[i].selected = true;
           }
@@ -165,7 +166,7 @@ azkaban.ChangeSlaView = Backbone.View.extend({
         duration.type = "text";
         duration.setAttribute("class", "durationpick");
         var rawMinutes = data.settings[setting].duration;
-        var intMinutes = rawMinutes.substring(0, rawMinutes.length-1);
+        var intMinutes = rawMinutes.substring(0, rawMinutes.length - 1);
         var minutes = parseInt(intMinutes);
         var hours = Math.floor(minutes / 60);
         minutes = minutes % 60;
@@ -204,12 +205,12 @@ azkaban.ChangeSlaView = Backbone.View.extend({
     console.log("Loaded schedule info. Ready to set SLA.");
   },
 
-  handleRemoveSla: function(evt) {
+  handleRemoveSla: function (evt) {
     console.log("Clicked remove sla button");
     var scheduleURL = this.scheduleURL;
     var redirectURL = this.scheduleURL;
     var requestData = {"action": "removeSla", "scheduleId": this.scheduleId};
-    var successHandler = function(data) {
+    var successHandler = function (data) {
       if (data.error) {
         $('#errorMsg').text(data.error)
       }
@@ -220,7 +221,7 @@ azkaban.ChangeSlaView = Backbone.View.extend({
     $.post(scheduleURL, requestData, successHandler, "json");
   },
 
-  handleSetSla: function(evt) {
+  handleSetSla: function (evt) {
     var slaEmails = $('#slaEmails').val();
     var settings = {};
 
@@ -232,7 +233,8 @@ azkaban.ChangeSlaView = Backbone.View.extend({
       var duration = rFlowRule.cells[2].firstChild.value;
       var email = rFlowRule.cells[3].firstChild.checked;
       var kill = rFlowRule.cells[4].firstChild.checked;
-      settings[row] = id + "," + rule + "," + duration + "," + email + "," + kill;
+      settings[row] = id + "," + rule + "," + duration + "," + email + ","
+          + kill;
     }
 
     var slaData = {
@@ -243,7 +245,7 @@ azkaban.ChangeSlaView = Backbone.View.extend({
     };
 
     var scheduleURL = this.scheduleURL;
-    var successHandler = function(data) {
+    var successHandler = function (data) {
       if (data.error) {
         alert(data.error);
       }
@@ -256,14 +258,14 @@ azkaban.ChangeSlaView = Backbone.View.extend({
     $.post(scheduleURL, slaData, successHandler, "json");
   },
 
-  handleAddRow: function(evt) {
+  handleAddRow: function (evt) {
     var indexToName = this.indexToName;
     var nameToIndex = this.nameToIndex;
     var indexToText = this.indexToText;
     var ruleBoxOptions = this.ruleBoxOptions;
 
     var tFlowRules = document.getElementById("flowRulesTbl").tBodies[0];
-    var rFlowRule = tFlowRules.insertRow(tFlowRules.rows.length-1);
+    var rFlowRule = tFlowRules.insertRow(tFlowRules.rows.length - 1);
 
     var cId = rFlowRule.insertCell(-1);
     var idSelect = document.createElement("select");
@@ -300,7 +302,7 @@ azkaban.ChangeSlaView = Backbone.View.extend({
     return rFlowRule;
   },
 
-  handleEditColumn: function(evt) {
+  handleEditColumn: function (evt) {
     var curTarget = evt.currentTarget;
 
     if (this.editingTarget != curTarget) {
@@ -320,24 +322,24 @@ azkaban.ChangeSlaView = Backbone.View.extend({
     }
   },
 
-  handleRemoveColumn: function(evt) {
+  handleRemoveColumn: function (evt) {
     var curTarget = evt.currentTarget;
     // Should be the table
     var row = curTarget.parentElement.parentElement;
     $(row).remove();
   },
 
-  closeEditingTarget: function(evt) {
+  closeEditingTarget: function (evt) {
   }
 });
 
 var slaView;
 var tableSorterView;
-$(function() {
+$(function () {
   var selected;
 
-  slaView = new azkaban.ChangeSlaView({el:$('#sla-options')});
-  tableSorterView = new azkaban.TableSorter({el:$('#scheduledFlowsTbl')});
+  slaView = new azkaban.ChangeSlaView({el: $('#sla-options')});
+  tableSorterView = new azkaban.TableSorter({el: $('#scheduledFlowsTbl')});
   /*
   var requestURL = contextURL + "/manager";
 
diff --git a/azkaban-web-server/src/web/js/jquery.svg.js b/azkaban-web-server/src/web/js/jquery.svg.js
index dcbf95f..be79533 100644
--- a/azkaban-web-server/src/web/js/jquery.svg.js
+++ b/azkaban-web-server/src/web/js/jquery.svg.js
@@ -1,1394 +1,1487 @@
 /* http://keith-wood.name/svg.html
    SVG for jQuery v1.4.5.
    Written by Keith Wood (kbwood{at}iinet.com.au) August 2007.
-   Dual licensed under the GPL (http://dev.jquery.com/browser/trunk/jquery/GPL-LICENSE.txt) and 
-   MIT (http://dev.jquery.com/browser/trunk/jquery/MIT-LICENSE.txt) licenses. 
+   Dual licensed under the GPL (http://dev.jquery.com/browser/trunk/jquery/GPL-LICENSE.txt) and
+   MIT (http://dev.jquery.com/browser/trunk/jquery/MIT-LICENSE.txt) licenses.
    Please attribute the author if you use it. */
 
-(function($) { // Hide scope, no $ conflict
-
-/* SVG manager.
-   Use the singleton instance of this class, $.svg, 
-   to interact with the SVG functionality. */
-function SVGManager() {
-	this._settings = []; // Settings to be remembered per SVG object
-	this._extensions = []; // List of SVG extensions added to SVGWrapper
-		// for each entry [0] is extension name, [1] is extension class (function)
-		// the function takes one parameter - the SVGWrapper instance
-	this.regional = []; // Localisations, indexed by language, '' for default (English)
-	this.regional[''] = {errorLoadingText: 'Error loading',
-		notSupportedText: 'This browser does not support SVG'};
-	this.local = this.regional['']; // Current localisation
-	this._uuid = new Date().getTime();
-	this._renesis = detectActiveX('RenesisX.RenesisCtrl');
-}
-
-/* Determine whether a given ActiveX control is available.
-   @param  classId  (string) the ID for the ActiveX control
-   @return  (boolean) true if found, false if not */
-function detectActiveX(classId) {
-	try {
-		return !!(window.ActiveXObject && new ActiveXObject(classId));
-	}
-	catch (e) {
-		return false;
-	}
-}
-
-var PROP_NAME = 'svgwrapper';
-
-$.extend(SVGManager.prototype, {
-	/* Class name added to elements to indicate already configured with SVG. */
-	markerClassName: 'hasSVG',
-
-	/* SVG namespace. */
-	svgNS: 'http://www.w3.org/2000/svg',
-	/* XLink namespace. */
-	xlinkNS: 'http://www.w3.org/1999/xlink',
-
-	/* SVG wrapper class. */
-	_wrapperClass: SVGWrapper,
-
-	/* Camel-case versions of attribute names containing dashes or are reserved words. */
-	_attrNames: {class_: 'class', in_: 'in',
-		alignmentBaseline: 'alignment-baseline', baselineShift: 'baseline-shift',
-		clipPath: 'clip-path', clipRule: 'clip-rule',
-		colorInterpolation: 'color-interpolation',
-		colorInterpolationFilters: 'color-interpolation-filters',
-		colorRendering: 'color-rendering', dominantBaseline: 'dominant-baseline',
-		enableBackground: 'enable-background', fillOpacity: 'fill-opacity',
-		fillRule: 'fill-rule', floodColor: 'flood-color',
-		floodOpacity: 'flood-opacity', fontFamily: 'font-family',
-		fontSize: 'font-size', fontSizeAdjust: 'font-size-adjust',
-		fontStretch: 'font-stretch', fontStyle: 'font-style',
-		fontVariant: 'font-variant', fontWeight: 'font-weight',
-		glyphOrientationHorizontal: 'glyph-orientation-horizontal',
-		glyphOrientationVertical: 'glyph-orientation-vertical',
-		horizAdvX: 'horiz-adv-x', horizOriginX: 'horiz-origin-x',
-		imageRendering: 'image-rendering', letterSpacing: 'letter-spacing',
-		lightingColor: 'lighting-color', markerEnd: 'marker-end',
-		markerMid: 'marker-mid', markerStart: 'marker-start',
-		stopColor: 'stop-color', stopOpacity: 'stop-opacity',
-		strikethroughPosition: 'strikethrough-position',
-		strikethroughThickness: 'strikethrough-thickness',
-		strokeDashArray: 'stroke-dasharray', strokeDashOffset: 'stroke-dashoffset',
-		strokeLineCap: 'stroke-linecap', strokeLineJoin: 'stroke-linejoin',
-		strokeMiterLimit: 'stroke-miterlimit', strokeOpacity: 'stroke-opacity',
-		strokeWidth: 'stroke-width', textAnchor: 'text-anchor',
-		textDecoration: 'text-decoration', textRendering: 'text-rendering',
-		underlinePosition: 'underline-position', underlineThickness: 'underline-thickness',
-		vertAdvY: 'vert-adv-y', vertOriginY: 'vert-origin-y',
-		wordSpacing: 'word-spacing', writingMode: 'writing-mode'},
-
-	/* Add the SVG object to its container. */
-	_attachSVG: function(container, settings) {
-		var svg = (container.namespaceURI == this.svgNS ? container : null);
-		var container = (svg ? null : container);
-		if ($(container || svg).hasClass(this.markerClassName)) {
-			return;
-		}
-		if (typeof settings == 'string') {
-			settings = {loadURL: settings};
-		}
-		else if (typeof settings == 'function') {
-			settings = {onLoad: settings};
-		}
-		$(container || svg).addClass(this.markerClassName);
-		try {
-			if (!svg) {
-				svg = document.createElementNS(this.svgNS, 'svg');
-				svg.setAttribute('version', '1.1');
-				if (container.clientWidth > 0) {
-					svg.setAttribute('width', container.clientWidth);
-				}
-				if (container.clientHeight > 0) {
-					svg.setAttribute('height', container.clientHeight);
-				}
-				container.appendChild(svg);
-			}
-			this._afterLoad(container, svg, settings || {});
-		}
-		catch (e) {
-			if ($.browser.msie) {
-				if (!container.id) {
-					container.id = 'svg' + (this._uuid++);
-				}
-				this._settings[container.id] = settings;
-				container.innerHTML = '<embed type="image/svg+xml" width="100%" ' +
-					'height="100%" src="' + (settings.initPath || '') + 'blank.svg" ' +
-					'pluginspage="http://www.adobe.com/svg/viewer/install/main.html"/>';
-			}
-			else {
-				container.innerHTML = '<p class="svg_error">' +
-					this.local.notSupportedText + '</p>';
-			}
-		}
-	},
-
-	/* SVG callback after loading - register SVG root. */
-	_registerSVG: function() {
-		for (var i = 0; i < document.embeds.length; i++) { // Check all
-			var container = document.embeds[i].parentNode;
-			if (!$(container).hasClass($.svg.markerClassName) || // Not SVG
-					$.data(container, PROP_NAME)) { // Already done
-				continue;
-			}
-			var svg = null;
-			try {
-				svg = document.embeds[i].getSVGDocument();
-			}
-			catch(e) {
-				setTimeout($.svg._registerSVG, 250); // Renesis takes longer to load
-				return;
-			}
-			svg = (svg ? svg.documentElement : null);
-			if (svg) {
-				$.svg._afterLoad(container, svg);
-			}
-		}
-	},
-
-	/* Post-processing once loaded. */
-	_afterLoad: function(container, svg, settings) {
-		var settings = settings || this._settings[container.id];
-		this._settings[container ? container.id : ''] = null;
-		var wrapper = new this._wrapperClass(svg, container);
-		$.data(container || svg, PROP_NAME, wrapper);
-		try {
-			if (settings.loadURL) { // Load URL
-				wrapper.load(settings.loadURL, settings);
-			}
-			if (settings.settings) { // Additional settings
-				wrapper.configure(settings.settings);
-			}
-			if (settings.onLoad && !settings.loadURL) { // Onload callback
-				settings.onLoad.apply(container || svg, [wrapper]);
-			}
-		}
-		catch (e) {
-			alert(e);
-		}
-	},
-
-	/* Return the SVG wrapper created for a given container.
-	   @param  container  (string) selector for the container or
-	                      (element) the container for the SVG object or
-	                      jQuery collection - first entry is the container
-	   @return  (SVGWrapper) the corresponding SVG wrapper element, or null if not attached */
-	_getSVG: function(container) {
-		container = (typeof container == 'string' ? $(container)[0] :
-			(container.jquery ? container[0] : container));
-		return $.data(container, PROP_NAME);
-	},
-
-	/* Remove the SVG functionality from a div.
-	   @param  container  (element) the container for the SVG object */
-	_destroySVG: function(container) {
-		var $container = $(container);
-		if (!$container.hasClass(this.markerClassName)) {
-			return;
-		}
-		$container.removeClass(this.markerClassName);
-		if (container.namespaceURI != this.svgNS) {
-			$container.empty();
-		}
-		$.removeData(container, PROP_NAME);
-	},
-
-	/* Extend the SVGWrapper object with an embedded class.
-	   The constructor function must take a single parameter that is
-	   a reference to the owning SVG root object. This allows the 
-	   extension to access the basic SVG functionality.
-	   @param  name      (string) the name of the SVGWrapper attribute to access the new class
-	   @param  extClass  (function) the extension class constructor */
-	addExtension: function(name, extClass) {
-		this._extensions.push([name, extClass]);
-	},
-
-	/* Does this node belong to SVG?
-	   @param  node  (element) the node to be tested
-	   @return  (boolean) true if an SVG node, false if not */
-	isSVGElem: function(node) {
-		return (node.nodeType == 1 && node.namespaceURI == $.svg.svgNS);
-	}
-});
-
-/* The main SVG interface, which encapsulates the SVG element.
-   Obtain a reference from $().svg('get') */
-function SVGWrapper(svg, container) {
-	this._svg = svg; // The SVG root node
-	this._container = container; // The containing div
-	for (var i = 0; i < $.svg._extensions.length; i++) {
-		var extension = $.svg._extensions[i];
-		this[extension[0]] = new extension[1](this);
-	}
-}
-
-$.extend(SVGWrapper.prototype, {
-
-	/* Retrieve the width of the SVG object. */
-	_width: function() {
-		return (this._container ? this._container.clientWidth : this._svg.width);
-	},
-
-	/* Retrieve the height of the SVG object. */
-	_height: function() {
-		return (this._container ? this._container.clientHeight : this._svg.height);
-	},
-
-	/* Retrieve the root SVG element.
-	   @return  the top-level SVG element */
-	root: function() {
-		return this._svg;
-	},
-
-	/* Configure a SVG node.
-	   @param  node      (element, optional) the node to configure
-	   @param  settings  (object) additional settings for the root
-	   @param  clear     (boolean) true to remove existing attributes first,
-	                     false to add to what is already there (optional)
-	   @return  (SVGWrapper) this root */
-	configure: function(node, settings, clear) {
-		if (!node.nodeName) {
-			clear = settings;
-			settings = node;
-			node = this._svg;
-		}
-		if (clear) {
-			for (var i = node.attributes.length - 1; i >= 0; i--) {
-				var attr = node.attributes.item(i);
-				if (!(attr.nodeName == 'onload' || attr.nodeName == 'version' || 
-						attr.nodeName.substring(0, 5) == 'xmlns')) {
-					node.attributes.removeNamedItem(attr.nodeName);
-				}
-			}
-		}
-		for (var attrName in settings) {
-			node.setAttribute($.svg._attrNames[attrName] || attrName, settings[attrName]);
-		}
-		return this;
-	},
-
-	/* Locate a specific element in the SVG document.
-	   @param  id  (string) the element's identifier
-	   @return  (element) the element reference, or null if not found */
-	getElementById: function(id) {
-		return this._svg.ownerDocument.getElementById(id);
-	},
-
-	/* Change the attributes for a SVG node.
-	   @param  element   (SVG element) the node to change
-	   @param  settings  (object) the new settings
-	   @return  (SVGWrapper) this root */
-	change: function(element, settings) {
-		if (element) {
-			for (var name in settings) {
-				if (settings[name] == null) {
-					element.removeAttribute($.svg._attrNames[name] || name);
-				}
-				else {
-					element.setAttribute($.svg._attrNames[name] || name, settings[name]);
-				}
-			}
-		}
-		return this;
-	},
-
-	/* Check for parent being absent and adjust arguments accordingly. */
-	_args: function(values, names, optSettings) {
-		names.splice(0, 0, 'parent');
-		names.splice(names.length, 0, 'settings');
-		var args = {};
-		var offset = 0;
-		if (values[0] != null && values[0].jquery) {
-			values[0] = values[0][0];
-		}
-		if (values[0] != null && !(typeof values[0] == 'object' && values[0].nodeName)) {
-			args['parent'] = null;
-			offset = 1;
-		}
-		for (var i = 0; i < values.length; i++) {
-			args[names[i + offset]] = values[i];
-		}
-		if (optSettings) {
-			$.each(optSettings, function(i, value) {
-				if (typeof args[value] == 'object') {
-					args.settings = args[value];
-					args[value] = null;
-				}
-			});
-		}
-		return args;
-	},
-
-	/* Add a title.
-	   @param  parent    (element or jQuery) the parent node for the new title (optional)
-	   @param  text      (string) the text of the title
-	   @param  settings  (object) additional settings for the title (optional)
-	   @return  (element) the new title node */
-	title: function(parent, text, settings) {
-		var args = this._args(arguments, ['text']);
-		var node = this._makeNode(args.parent, 'title', args.settings || {});
-		node.appendChild(this._svg.ownerDocument.createTextNode(args.text));
-		return node;
-	},
-
-	/* Add a description.
-	   @param  parent    (element or jQuery) the parent node for the new description (optional)
-	   @param  text      (string) the text of the description
-	   @param  settings  (object) additional settings for the description (optional)
-	   @return  (element) the new description node */
-	describe: function(parent, text, settings) {
-		var args = this._args(arguments, ['text']);
-		var node = this._makeNode(args.parent, 'desc', args.settings || {});
-		node.appendChild(this._svg.ownerDocument.createTextNode(args.text));
-		return node;
-	},
-
-	/* Add a definitions node.
-	   @param  parent    (element or jQuery) the parent node for the new definitions (optional)
-	   @param  id        (string) the ID of this definitions (optional)
-	   @param  settings  (object) additional settings for the definitions (optional)
-	   @return  (element) the new definitions node */
-	defs: function(parent, id, settings) {
-		var args = this._args(arguments, ['id'], ['id']);
-		return this._makeNode(args.parent, 'defs', $.extend(
-			(args.id ? {id: args.id} : {}), args.settings || {}));
-	},
-
-	/* Add a symbol definition.
-	   @param  parent    (element or jQuery) the parent node for the new symbol (optional)
-	   @param  id        (string) the ID of this symbol
-	   @param  x1        (number) the left coordinate for this symbol
-	   @param  y1        (number) the top coordinate for this symbol
-	   @param  width     (number) the width of this symbol
-	   @param  height    (number) the height of this symbol
-	   @param  settings  (object) additional settings for the symbol (optional)
-	   @return  (element) the new symbol node */
-	symbol: function(parent, id, x1, y1, width, height, settings) {
-		var args = this._args(arguments, ['id', 'x1', 'y1', 'width', 'height']);
-		return this._makeNode(args.parent, 'symbol', $.extend({id: args.id,
-			viewBox: args.x1 + ' ' + args.y1 + ' ' + args.width + ' ' + args.height},
-			args.settings || {}));
-	},
-
-	/* Add a marker definition.
-	   @param  parent    (element or jQuery) the parent node for the new marker (optional)
-	   @param  id        (string) the ID of this marker
-	   @param  refX      (number) the x-coordinate for the reference point
-	   @param  refY      (number) the y-coordinate for the reference point
-	   @param  mWidth    (number) the marker viewport width
-	   @param  mHeight   (number) the marker viewport height
-	   @param  orient    (string or int) 'auto' or angle (degrees) (optional)
-	   @param  settings  (object) additional settings for the marker (optional)
-	   @return  (element) the new marker node */
-	marker: function(parent, id, refX, refY, mWidth, mHeight, orient, settings) {
-		var args = this._args(arguments, ['id', 'refX', 'refY',
-			'mWidth', 'mHeight', 'orient'], ['orient']);
-		return this._makeNode(args.parent, 'marker', $.extend(
-			{id: args.id, refX: args.refX, refY: args.refY, markerWidth: args.mWidth, 
-			markerHeight: args.mHeight, orient: args.orient || 'auto'}, args.settings || {}));
-	},
-
-	/* Add a style node.
-	   @param  parent    (element or jQuery) the parent node for the new node (optional)
-	   @param  styles    (string) the CSS styles
-	   @param  settings  (object) additional settings for the node (optional)
-	   @return  (element) the new style node */
-	style: function(parent, styles, settings) {
-		var args = this._args(arguments, ['styles']);
-		var node = this._makeNode(args.parent, 'style', $.extend(
-			{type: 'text/css'}, args.settings || {}));
-		node.appendChild(this._svg.ownerDocument.createTextNode(args.styles));
-		if ($.browser.opera) {
-			$('head').append('<style type="text/css">' + args.styles + '</style>');
-		}
-		return node;
-	},
-
-	/* Add a script node.
-	   @param  parent    (element or jQuery) the parent node for the new node (optional)
-	   @param  script    (string) the JavaScript code
-	   @param  type      (string) the MIME type for the code (optional, default 'text/javascript')
-	   @param  settings  (object) additional settings for the node (optional)
-	   @return  (element) the new script node */
-	script: function(parent, script, type, settings) {
-		var args = this._args(arguments, ['script', 'type'], ['type']);
-		var node = this._makeNode(args.parent, 'script', $.extend(
-			{type: args.type || 'text/javascript'}, args.settings || {}));
-		node.appendChild(this._svg.ownerDocument.createTextNode(args.script));
-		if (!$.browser.mozilla) {
-			$.globalEval(args.script);
-		}
-		return node;
-	},
-
-	/* Add a linear gradient definition.
-	   Specify all of x1, y1, x2, y2 or none of them.
-	   @param  parent    (element or jQuery) the parent node for the new gradient (optional)
-	   @param  id        (string) the ID for this gradient
-	   @param  stops     (string[][]) the gradient stops, each entry is
-	                     [0] is offset (0.0-1.0 or 0%-100%), [1] is colour, 
-						 [2] is opacity (optional)
-	   @param  x1        (number) the x-coordinate of the gradient start (optional)
-	   @param  y1        (number) the y-coordinate of the gradient start (optional)
-	   @param  x2        (number) the x-coordinate of the gradient end (optional)
-	   @param  y2        (number) the y-coordinate of the gradient end (optional)
-	   @param  settings  (object) additional settings for the gradient (optional)
-	   @return  (element) the new gradient node */
-	linearGradient: function(parent, id, stops, x1, y1, x2, y2, settings) {
-		var args = this._args(arguments,
-			['id', 'stops', 'x1', 'y1', 'x2', 'y2'], ['x1']);
-		var sets = $.extend({id: args.id}, 
-			(args.x1 != null ? {x1: args.x1, y1: args.y1, x2: args.x2, y2: args.y2} : {}));
-		return this._gradient(args.parent, 'linearGradient', 
-			$.extend(sets, args.settings || {}), args.stops);
-	},
-
-	/* Add a radial gradient definition.
-	   Specify all of cx, cy, r, fx, fy or none of them.
-	   @param  parent    (element or jQuery) the parent node for the new gradient (optional)
-	   @param  id        (string) the ID for this gradient
-	   @param  stops     (string[][]) the gradient stops, each entry
-	                     [0] is offset, [1] is colour, [2] is opacity (optional)
-	   @param  cx        (number) the x-coordinate of the largest circle centre (optional)
-	   @param  cy        (number) the y-coordinate of the largest circle centre (optional)
-	   @param  r         (number) the radius of the largest circle (optional)
-	   @param  fx        (number) the x-coordinate of the gradient focus (optional)
-	   @param  fy        (number) the y-coordinate of the gradient focus (optional)
-	   @param  settings  (object) additional settings for the gradient (optional)
-	   @return  (element) the new gradient node */
-	radialGradient: function(parent, id, stops, cx, cy, r, fx, fy, settings) {
-		var args = this._args(arguments,
-			['id', 'stops', 'cx', 'cy', 'r', 'fx', 'fy'], ['cx']);
-		var sets = $.extend({id: args.id}, (args.cx != null ?
-			{cx: args.cx, cy: args.cy, r: args.r, fx: args.fx, fy: args.fy} : {}));
-		return this._gradient(args.parent, 'radialGradient', 
-			$.extend(sets, args.settings || {}), args.stops);
-	},
-
-	/* Add a gradient node. */
-	_gradient: function(parent, name, settings, stops) {
-		var node = this._makeNode(parent, name, settings);
-		for (var i = 0; i < stops.length; i++) {
-			var stop = stops[i];
-			this._makeNode(node, 'stop', $.extend(
-				{offset: stop[0], stopColor: stop[1]}, 
-				(stop[2] != null ? {stopOpacity: stop[2]} : {})));
-		}
-		return node;
-	},
-
-	/* Add a pattern definition.
-	   Specify all of vx, vy, xwidth, vheight or none of them.
-	   @param  parent    (element or jQuery) the parent node for the new pattern (optional)
-	   @param  id        (string) the ID for this pattern
-	   @param  x         (number) the x-coordinate for the left edge of the pattern
-	   @param  y         (number) the y-coordinate for the top edge of the pattern
-	   @param  width     (number) the width of the pattern
-	   @param  height    (number) the height of the pattern
-	   @param  vx        (number) the minimum x-coordinate for view box (optional)
-	   @param  vy        (number) the minimum y-coordinate for the view box (optional)
-	   @param  vwidth    (number) the width of the view box (optional)
-	   @param  vheight   (number) the height of the view box (optional)
-	   @param  settings  (object) additional settings for the pattern (optional)
-	   @return  (element) the new pattern node */
-	pattern: function(parent, id, x, y, width, height, vx, vy, vwidth, vheight, settings) {
-		var args = this._args(arguments, ['id', 'x', 'y', 'width', 'height',
-			'vx', 'vy', 'vwidth', 'vheight'], ['vx']);
-		var sets = $.extend({id: args.id, x: args.x, y: args.y,
-			width: args.width, height: args.height}, (args.vx != null ?
-			{viewBox: args.vx + ' ' + args.vy + ' ' + args.vwidth + ' ' + args.vheight} : {}));
-		return this._makeNode(args.parent, 'pattern', $.extend(sets, args.settings || {}));
-	},
-
-	/* Add a clip path definition.
-	   @param  parent  (element) the parent node for the new element (optional)
-	   @param  id      (string) the ID for this path
-	   @param  units   (string) either 'userSpaceOnUse' (default) or 'objectBoundingBox' (optional)
-	   @return  (element) the new clipPath node */
-	clipPath: function(parent, id, units, settings) {
-		var args = this._args(arguments, ['id', 'units']);
-		args.units = args.units || 'userSpaceOnUse';
-		return this._makeNode(args.parent, 'clipPath', $.extend(
-			{id: args.id, clipPathUnits: args.units}, args.settings || {}));
-	},
-
-	/* Add a mask definition.
-	   @param  parent    (element or jQuery) the parent node for the new mask (optional)
-	   @param  id        (string) the ID for this mask
-	   @param  x         (number) the x-coordinate for the left edge of the mask
-	   @param  y         (number) the y-coordinate for the top edge of the mask
-	   @param  width     (number) the width of the mask
-	   @param  height    (number) the height of the mask
-	   @param  settings  (object) additional settings for the mask (optional)
-	   @return  (element) the new mask node */
-	mask: function(parent, id, x, y, width, height, settings) {
-		var args = this._args(arguments, ['id', 'x', 'y', 'width', 'height']);
-		return this._makeNode(args.parent, 'mask', $.extend(
-			{id: args.id, x: args.x, y: args.y, width: args.width, height: args.height},
-			args.settings || {}));
-	},
-
-	/* Create a new path object.
-	   @return  (SVGPath) a new path object */
-	createPath: function() {
-		return new SVGPath();
-	},
-
-	/* Create a new text object.
-	   @return  (SVGText) a new text object */
-	createText: function() {
-		return new SVGText();
-	},
-
-	/* Add an embedded SVG element.
-	   Specify all of vx, vy, vwidth, vheight or none of them.
-	   @param  parent    (element or jQuery) the parent node for the new node (optional)
-	   @param  x         (number) the x-coordinate for the left edge of the node
-	   @param  y         (number) the y-coordinate for the top edge of the node
-	   @param  width     (number) the width of the node
-	   @param  height    (number) the height of the node
-	   @param  vx        (number) the minimum x-coordinate for view box (optional)
-	   @param  vy        (number) the minimum y-coordinate for the view box (optional)
-	   @param  vwidth    (number) the width of the view box (optional)
-	   @param  vheight   (number) the height of the view box (optional)
-	   @param  settings  (object) additional settings for the node (optional)
-	   @return  (element) the new node */
-	svg: function(parent, x, y, width, height, vx, vy, vwidth, vheight, settings) {
-		var args = this._args(arguments, ['x', 'y', 'width', 'height',
-			'vx', 'vy', 'vwidth', 'vheight'], ['vx']);
-		var sets = $.extend({x: args.x, y: args.y, width: args.width, height: args.height}, 
-			(args.vx != null ? {viewBox: args.vx + ' ' + args.vy + ' ' +
-			args.vwidth + ' ' + args.vheight} : {}));
-		return this._makeNode(args.parent, 'svg', $.extend(sets, args.settings || {}));
-	},
-
-	/* Create a group.
-	   @param  parent    (element or jQuery) the parent node for the new group (optional)
-	   @param  id        (string) the ID of this group (optional)
-	   @param  settings  (object) additional settings for the group (optional)
-	   @return  (element) the new group node */
-	group: function(parent, id, settings) {
-		var args = this._args(arguments, ['id'], ['id']);
-		return this._makeNode(args.parent, 'g', $.extend({id: args.id}, args.settings || {}));
-	},
-
-	/* Add a usage reference.
-	   Specify all of x, y, width, height or none of them.
-	   @param  parent    (element or jQuery) the parent node for the new node (optional)
-	   @param  x         (number) the x-coordinate for the left edge of the node (optional)
-	   @param  y         (number) the y-coordinate for the top edge of the node (optional)
-	   @param  width     (number) the width of the node (optional)
-	   @param  height    (number) the height of the node (optional)
-	   @param  ref       (string) the ID of the definition node
-	   @param  settings  (object) additional settings for the node (optional)
-	   @return  (element) the new node */
-	use: function(parent, x, y, width, height, ref, settings) {
-		var args = this._args(arguments, ['x', 'y', 'width', 'height', 'ref']);
-		if (typeof args.x == 'string') {
-			args.ref = args.x;
-			args.settings = args.y;
-			args.x = args.y = args.width = args.height = null;
-		}
-		var node = this._makeNode(args.parent, 'use', $.extend(
-			{x: args.x, y: args.y, width: args.width, height: args.height},
-			args.settings || {}));
-		node.setAttributeNS($.svg.xlinkNS, 'href', args.ref);
-		return node;
-	},
-
-	/* Add a link, which applies to all child elements.
-	   @param  parent    (element or jQuery) the parent node for the new link (optional)
-	   @param  ref       (string) the target URL
-	   @param  settings  (object) additional settings for the link (optional)
-	   @return  (element) the new link node */
-	link: function(parent, ref, settings) {
-		var args = this._args(arguments, ['ref']);
-		var node = this._makeNode(args.parent, 'a', args.settings);
-		node.setAttributeNS($.svg.xlinkNS, 'href', args.ref);
-		return node;
-	},
-
-	/* Add an image.
-	   @param  parent    (element or jQuery) the parent node for the new image (optional)
-	   @param  x         (number) the x-coordinate for the left edge of the image
-	   @param  y         (number) the y-coordinate for the top edge of the image
-	   @param  width     (number) the width of the image
-	   @param  height    (number) the height of the image
-	   @param  ref       (string) the path to the image
-	   @param  settings  (object) additional settings for the image (optional)
-	   @return  (element) the new image node */
-	image: function(parent, x, y, width, height, ref, settings) {
-		var args = this._args(arguments, ['x', 'y', 'width', 'height', 'ref']);
-		var node = this._makeNode(args.parent, 'image', $.extend(
-			{x: args.x, y: args.y, width: args.width, height: args.height},
-			args.settings || {}));
-		node.setAttributeNS($.svg.xlinkNS, 'href', args.ref);
-		return node;
-	},
-
-	/* Draw a path.
-	   @param  parent    (element or jQuery) the parent node for the new shape (optional)
-	   @param  path      (string or SVGPath) the path to draw
-	   @param  settings  (object) additional settings for the shape (optional)
-	   @return  (element) the new shape node */
-	path: function(parent, path, settings) {
-		var args = this._args(arguments, ['path']);
-		return this._makeNode(args.parent, 'path', $.extend(
-			{d: (args.path.path ? args.path.path() : args.path)}, args.settings || {}));
-	},
-
-	/* Draw a rectangle.
-	   Specify both of rx and ry or neither.
-	   @param  parent    (element or jQuery) the parent node for the new shape (optional)
-	   @param  x         (number) the x-coordinate for the left edge of the rectangle
-	   @param  y         (number) the y-coordinate for the top edge of the rectangle
-	   @param  width     (number) the width of the rectangle
-	   @param  height    (number) the height of the rectangle
-	   @param  rx        (number) the x-radius of the ellipse for the rounded corners (optional)
-	   @param  ry        (number) the y-radius of the ellipse for the rounded corners (optional)
-	   @param  settings  (object) additional settings for the shape (optional)
-	   @return  (element) the new shape node */
-	rect: function(parent, x, y, width, height, rx, ry, settings) {
-		var args = this._args(arguments, ['x', 'y', 'width', 'height', 'rx', 'ry'], ['rx']);
-		return this._makeNode(args.parent, 'rect', $.extend(
-			{x: args.x, y: args.y, width: args.width, height: args.height},
-			(args.rx ? {rx: args.rx, ry: args.ry} : {}), args.settings || {}));
-	},
-
-	/* Draw a circle.
-	   @param  parent    (element or jQuery) the parent node for the new shape (optional)
-	   @param  cx        (number) the x-coordinate for the centre of the circle
-	   @param  cy        (number) the y-coordinate for the centre of the circle
-	   @param  r         (number) the radius of the circle
-	   @param  settings  (object) additional settings for the shape (optional)
-	   @return  (element) the new shape node */
-	circle: function(parent, cx, cy, r, settings) {
-		var args = this._args(arguments, ['cx', 'cy', 'r']);
-		return this._makeNode(args.parent, 'circle', $.extend(
-			{cx: args.cx, cy: args.cy, r: args.r}, args.settings || {}));
-	},
-
-	/* Draw an ellipse.
-	   @param  parent    (element or jQuery) the parent node for the new shape (optional)
-	   @param  cx        (number) the x-coordinate for the centre of the ellipse
-	   @param  cy        (number) the y-coordinate for the centre of the ellipse
-	   @param  rx        (number) the x-radius of the ellipse
-	   @param  ry        (number) the y-radius of the ellipse
-	   @param  settings  (object) additional settings for the shape (optional)
-	   @return  (element) the new shape node */
-	ellipse: function(parent, cx, cy, rx, ry, settings) {
-		var args = this._args(arguments, ['cx', 'cy', 'rx', 'ry']);
-		return this._makeNode(args.parent, 'ellipse', $.extend(
-			{cx: args.cx, cy: args.cy, rx: args.rx, ry: args.ry}, args.settings || {}));
-	},
-
-	/* Draw a line.
-	   @param  parent    (element or jQuery) the parent node for the new shape (optional)
-	   @param  x1        (number) the x-coordinate for the start of the line
-	   @param  y1        (number) the y-coordinate for the start of the line
-	   @param  x2        (number) the x-coordinate for the end of the line
-	   @param  y2        (number) the y-coordinate for the end of the line
-	   @param  settings  (object) additional settings for the shape (optional)
-	   @return  (element) the new shape node */
-	line: function(parent, x1, y1, x2, y2, settings) {
-		var args = this._args(arguments, ['x1', 'y1', 'x2', 'y2']);
-		return this._makeNode(args.parent, 'line', $.extend(
-			{x1: args.x1, y1: args.y1, x2: args.x2, y2: args.y2}, args.settings || {}));
-	},
-
-	/* Draw a polygonal line.
-	   @param  parent    (element or jQuery) the parent node for the new shape (optional)
-	   @param  points    (number[][]) the x-/y-coordinates for the points on the line
-	   @param  settings  (object) additional settings for the shape (optional)
-	   @return  (element) the new shape node */
-	polyline: function(parent, points, settings) {
-		var args = this._args(arguments, ['points']);
-		return this._poly(args.parent, 'polyline', args.points, args.settings);
-	},
-
-	/* Draw a polygonal shape.
-	   @param  parent    (element or jQuery) the parent node for the new shape (optional)
-	   @param  points    (number[][]) the x-/y-coordinates for the points on the shape
-	   @param  settings  (object) additional settings for the shape (optional)
-	   @return  (element) the new shape node */
-	polygon: function(parent, points, settings) {
-		var args = this._args(arguments, ['points']);
-		return this._poly(args.parent, 'polygon', args.points, args.settings);
-	},
-
-	/* Draw a polygonal line or shape. */
-	_poly: function(parent, name, points, settings) {
-		var ps = '';
-		for (var i = 0; i < points.length; i++) {
-			ps += points[i].join() + ' ';
-		}
-		return this._makeNode(parent, name, $.extend(
-			{points: $.trim(ps)}, settings || {}));
-	},
-
-	/* Draw text.
-	   Specify both of x and y or neither of them.
-	   @param  parent    (element or jQuery) the parent node for the text (optional)
-	   @param  x         (number or number[]) the x-coordinate(s) for the text (optional)
-	   @param  y         (number or number[]) the y-coordinate(s) for the text (optional)
-	   @param  value     (string) the text content or
-	                     (SVGText) text with spans and references
-	   @param  settings  (object) additional settings for the text (optional)
-	   @return  (element) the new text node */
-	text: function(parent, x, y, value, settings) {
-		var args = this._args(arguments, ['x', 'y', 'value']);
-		if (typeof args.x == 'string' && arguments.length < 4) {
-			args.value = args.x;
-			args.settings = args.y;
-			args.x = args.y = null;
-		}
-		return this._text(args.parent, 'text', args.value, $.extend(
-			{x: (args.x && isArray(args.x) ? args.x.join(' ') : args.x),
-			y: (args.y && isArray(args.y) ? args.y.join(' ') : args.y)}, 
-			args.settings || {}));
-	},
-
-	/* Draw text along a path.
-	   @param  parent    (element or jQuery) the parent node for the text (optional)
-	   @param  path      (string) the ID of the path
-	   @param  value     (string) the text content or
-	                     (SVGText) text with spans and references
-	   @param  settings  (object) additional settings for the text (optional)
-	   @return  (element) the new text node */
-	textpath: function(parent, path, value, settings) {
-		var args = this._args(arguments, ['path', 'value']);
-		var node = this._text(args.parent, 'textPath', args.value, args.settings || {});
-		node.setAttributeNS($.svg.xlinkNS, 'href', args.path);
-		return node;
-	},
-
-	/* Draw text. */
-	_text: function(parent, name, value, settings) {
-		var node = this._makeNode(parent, name, settings);
-		if (typeof value == 'string') {
-			node.appendChild(node.ownerDocument.createTextNode(value));
-		}
-		else {
-			for (var i = 0; i < value._parts.length; i++) {
-				var part = value._parts[i];
-				if (part[0] == 'tspan') {
-					var child = this._makeNode(node, part[0], part[2]);
-					child.appendChild(node.ownerDocument.createTextNode(part[1]));
-					node.appendChild(child);
-				}
-				else if (part[0] == 'tref') {
-					var child = this._makeNode(node, part[0], part[2]);
-					child.setAttributeNS($.svg.xlinkNS, 'href', part[1]);
-					node.appendChild(child);
-				}
-				else if (part[0] == 'textpath') {
-					var set = $.extend({}, part[2]);
-					set.href = null;
-					var child = this._makeNode(node, part[0], set);
-					child.setAttributeNS($.svg.xlinkNS, 'href', part[2].href);
-					child.appendChild(node.ownerDocument.createTextNode(part[1]));
-					node.appendChild(child);
-				}
-				else { // straight text
-					node.appendChild(node.ownerDocument.createTextNode(part[1]));
-				}
-			}
-		}
-		return node;
-	},
-
-	/* Add a custom SVG element.
-	   @param  parent    (element or jQuery) the parent node for the new element (optional)
-	   @param  name      (string) the name of the element
-	   @param  settings  (object) additional settings for the element (optional)
-	   @return  (element) the new custom node */
-	other: function(parent, name, settings) {
-		var args = this._args(arguments, ['name']);
-		return this._makeNode(args.parent, args.name, args.settings || {});
-	},
-
-	/* Create a shape node with the given settings. */
-	_makeNode: function(parent, name, settings) {
-		parent = parent || this._svg;
-		var node = this._svg.ownerDocument.createElementNS($.svg.svgNS, name);
-		for (var name in settings) {
-			var value = settings[name];
-			if (value != null && value != null && 
-					(typeof value != 'string' || value != '')) {
-				node.setAttribute($.svg._attrNames[name] || name, value);
-			}
-		}
-		parent.appendChild(node);
-		return node;
-	},
-
-	/* Add an existing SVG node to the diagram.
-	   @param  parent  (element or jQuery) the parent node for the new node (optional)
-	   @param  node    (element) the new node to add or
-	                   (string) the jQuery selector for the node or
-	                   (jQuery collection) set of nodes to add
-	   @return  (SVGWrapper) this wrapper */
-	add: function(parent, node) {
-		var args = this._args((arguments.length == 1 ? [null, parent] : arguments), ['node']);
-		var svg = this;
-		args.parent = args.parent || this._svg;
-		args.node = (args.node.jquery ? args.node : $(args.node));
-		try {
-			if ($.svg._renesis) {
-				throw 'Force traversal';
-			}
-			args.parent.appendChild(args.node.cloneNode(true));
-		}
-		catch (e) {
-			args.node.each(function() {
-				var child = svg._cloneAsSVG(this);
-				if (child) {
-					args.parent.appendChild(child);
-				}
-			});
-		}
-		return this;
-	},
-
-	/* Clone an existing SVG node and add it to the diagram.
-	   @param  parent  (element or jQuery) the parent node for the new node (optional)
-	   @param  node    (element) the new node to add or
-	                   (string) the jQuery selector for the node or
-	                   (jQuery collection) set of nodes to add
-	   @return  (element[]) collection of new nodes */
-	clone: function(parent, node) {
-		var svg = this;
-		var args = this._args((arguments.length == 1 ? [null, parent] : arguments), ['node']);
-		args.parent = args.parent || this._svg;
-		args.node = (args.node.jquery ? args.node : $(args.node));
-		var newNodes = [];
-		args.node.each(function() {
-			var child = svg._cloneAsSVG(this);
-			if (child) {
-				child.id = '';
-				args.parent.appendChild(child);
-				newNodes.push(child);
-			}
-		});
-		return newNodes;
-	},
-
-	/* SVG nodes must belong to the SVG namespace, so clone and ensure this is so.
-	   @param  node  (element) the SVG node to clone
-	   @return  (element) the cloned node */
-	_cloneAsSVG: function(node) {
-		var newNode = null;
-		if (node.nodeType == 1) { // element
-			newNode = this._svg.ownerDocument.createElementNS(
-				$.svg.svgNS, this._checkName(node.nodeName));
-			for (var i = 0; i < node.attributes.length; i++) {
-				var attr = node.attributes.item(i);
-				if (attr.nodeName != 'xmlns' && attr.nodeValue) {
-					if (attr.prefix == 'xlink') {
-						newNode.setAttributeNS($.svg.xlinkNS,
-							attr.localName || attr.baseName, attr.nodeValue);
-					}
-					else {
-						newNode.setAttribute(this._checkName(attr.nodeName), attr.nodeValue);
-					}
-				}
-			}
-			for (var i = 0; i < node.childNodes.length; i++) {
-				var child = this._cloneAsSVG(node.childNodes[i]);
-				if (child) {
-					newNode.appendChild(child);
-				}
-			}
-		}
-		else if (node.nodeType == 3) { // text
-			if ($.trim(node.nodeValue)) {
-				newNode = this._svg.ownerDocument.createTextNode(node.nodeValue);
-			}
-		}
-		else if (node.nodeType == 4) { // CDATA
-			if ($.trim(node.nodeValue)) {
-				try {
-					newNode = this._svg.ownerDocument.createCDATASection(node.nodeValue);
-				}
-				catch (e) {
-					newNode = this._svg.ownerDocument.createTextNode(
-						node.nodeValue.replace(/&/g, '&amp;').
-						replace(/</g, '&lt;').replace(/>/g, '&gt;'));
-				}
-			}
-		}
-		return newNode;
-	},
-
-	/* Node names must be lower case and without SVG namespace prefix. */
-	_checkName: function(name) {
-		name = (name.substring(0, 1) >= 'A' && name.substring(0, 1) <= 'Z' ?
-			name.toLowerCase() : name);
-		return (name.substring(0, 4) == 'svg:' ? name.substring(4) : name);
-	},
-
-	/* Load an external SVG document.
-	   @param  url       (string) the location of the SVG document or
-	                     the actual SVG content
-	   @param  settings  (boolean) see addTo below or
-	                     (function) see onLoad below or
-	                     (object) additional settings for the load with attributes below:
-	                       addTo       (boolean) true to add to what's already there,
-	                                   or false to clear the canvas first
-						   changeSize  (boolean) true to allow the canvas size to change,
-	                                   or false to retain the original
-	                       onLoad      (function) callback after the document has loaded,
-	                                   'this' is the container, receives SVG object and
-	                                   optional error message as a parameter
-	                       parent      (string or element or jQuery) the parent to load
-	                                   into, defaults to top-level svg element
-	   @return  (SVGWrapper) this root */
-	load: function(url, settings) {
-		settings = (typeof settings == 'boolean' ? {addTo: settings} :
-			(typeof settings == 'function' ? {onLoad: settings} :
-			(typeof settings == 'string' ? {parent: settings} : 
-			(typeof settings == 'object' && settings.nodeName ? {parent: settings} :
-			(typeof settings == 'object' && settings.jquery ? {parent: settings} :
-			settings || {})))));
-		if (!settings.parent && !settings.addTo) {
-			this.clear(false);
-		}
-		var size = [this._svg.getAttribute('width'), this._svg.getAttribute('height')];
-		var wrapper = this;
-		// Report a problem with the load
-		var reportError = function(message) {
-			message = $.svg.local.errorLoadingText + ': ' + message;
-			if (settings.onLoad) {
-				settings.onLoad.apply(wrapper._container || wrapper._svg, [wrapper, message]);
-			}
-			else {
-				wrapper.text(null, 10, 20, message);
-			}
-		};
-		// Create a DOM from SVG content
-		var loadXML4IE = function(data) {
-			var xml = new ActiveXObject('Microsoft.XMLDOM');
-			xml.validateOnParse = false;
-			xml.resolveExternals = false;
-			xml.async = false;
-			xml.loadXML(data);
-			if (xml.parseError.errorCode != 0) {
-				reportError(xml.parseError.reason);
-				return null;
-			}
-			return xml;
-		};
-		// Load the SVG DOM
-		var loadSVG = function(data) {
-			if (!data) {
-				return;
-			}
-			if (data.documentElement.nodeName != 'svg') {
-				var errors = data.getElementsByTagName('parsererror');
-				var messages = (errors.length ? errors[0].getElementsByTagName('div') : []); // Safari
-				reportError(!errors.length ? '???' :
-					(messages.length ? messages[0] : errors[0]).firstChild.nodeValue);
-				return;
-			}
-			var parent = (settings.parent ? $(settings.parent)[0] : wrapper._svg);
-			var attrs = {};
-			for (var i = 0; i < data.documentElement.attributes.length; i++) {
-				var attr = data.documentElement.attributes.item(i);
-				if (!(attr.nodeName == 'version' || attr.nodeName.substring(0, 5) == 'xmlns')) {
-					attrs[attr.nodeName] = attr.nodeValue;
-				}
-			}
-			wrapper.configure(parent, attrs, !settings.parent);
-			var nodes = data.documentElement.childNodes;
-			for (var i = 0; i < nodes.length; i++) {
-				try {
-					if ($.svg._renesis) {
-						throw 'Force traversal';
-					}
-					parent.appendChild(wrapper._svg.ownerDocument.importNode(nodes[i], true));
-					if (nodes[i].nodeName == 'script') {
-						$.globalEval(nodes[i].textContent);
-					}
-				}
-				catch (e) {
-					wrapper.add(parent, nodes[i]);
-				}
-			}
-			if (!settings.changeSize) {
-				wrapper.configure(parent, {width: size[0], height: size[1]});
-			}
-			if (settings.onLoad) {
-				settings.onLoad.apply(wrapper._container || wrapper._svg, [wrapper]);
-			}
-		};
-		if (url.match('<svg')) { // Inline SVG
-			loadSVG($.browser.msie ? loadXML4IE(url) :
-				new DOMParser().parseFromString(url, 'text/xml'));
-		}
-		else { // Remote SVG
-			$.ajax({url: url, dataType: ($.browser.msie ? 'text' : 'xml'),
-				success: function(xml) {
-					loadSVG($.browser.msie ? loadXML4IE(xml) : xml);
-				}, error: function(http, message, exc) {
-					reportError(message + (exc ? ' ' + exc.message : ''));
-				}});
-		}
-		return this;
-	},
-
-	/* Delete a specified node.
-	   @param  node  (element or jQuery) the drawing node to remove
-	   @return  (SVGWrapper) this root */
-	remove: function(node) {
-		node = (node.jquery ? node[0] : node);
-		node.parentNode.removeChild(node);
-		return this;
-	},
-
-	/* Delete everything in the current document.
-	   @param  attrsToo  (boolean) true to clear any root attributes as well,
-	                     false to leave them (optional)
-	   @return  (SVGWrapper) this root */
-	clear: function(attrsToo) {
-		if (attrsToo) {
-			this.configure({}, true);
-		}
-		while (this._svg.firstChild) {
-			this._svg.removeChild(this._svg.firstChild);
-		}
-		return this;
-	},
-
-	/* Serialise the current diagram into an SVG text document.
-	   @param  node  (SVG element) the starting node (optional)
-	   @return  (string) the SVG as text */
-	toSVG: function(node) {
-		node = node || this._svg;
-		return (typeof XMLSerializer == 'undefined' ? this._toSVG(node) :
-			new XMLSerializer().serializeToString(node));
-	},
-
-	/* Serialise one node in the SVG hierarchy. */
-	_toSVG: function(node) {
-		var svgDoc = '';
-		if (!node) {
-			return svgDoc;
-		}
-		if (node.nodeType == 3) { // Text
-			svgDoc = node.nodeValue;
-		}
-		else if (node.nodeType == 4) { // CDATA
-			svgDoc = '<![CDATA[' + node.nodeValue + ']]>';
-		}
-		else { // Element
-			svgDoc = '<' + node.nodeName;
-			if (node.attributes) {
-				for (var i = 0; i < node.attributes.length; i++) {
-					var attr = node.attributes.item(i);
-					if (!($.trim(attr.nodeValue) == '' || attr.nodeValue.match(/^\[object/) ||
-							attr.nodeValue.match(/^function/))) {
-						svgDoc += ' ' + (attr.namespaceURI == $.svg.xlinkNS ? 'xlink:' : '') + 
-							attr.nodeName + '="' + attr.nodeValue + '"';
-					}
-				}
-			}	
-			if (node.firstChild) {
-				svgDoc += '>';
-				var child = node.firstChild;
-				while (child) {
-					svgDoc += this._toSVG(child);
-					child = child.nextSibling;
-				}
-				svgDoc += '</' + node.nodeName + '>';
-			}
-				else {
-				svgDoc += '/>';
-			}
-		}
-		return svgDoc;
-	}
-});
-
-/* Helper to generate an SVG path.
-   Obtain an instance from the SVGWrapper object.
-   String calls together to generate the path and use its value:
-   var path = root.createPath();
-   root.path(null, path.move(100, 100).line(300, 100).line(200, 300).close(), {fill: 'red'});
-   or
-   root.path(null, path.move(100, 100).line([[300, 100], [200, 300]]).close(), {fill: 'red'}); */
-function SVGPath() {
-	this._path = '';
-}
-
-$.extend(SVGPath.prototype, {
-	/* Prepare to create a new path.
-	   @return  (SVGPath) this path */
-	reset: function() {
-		this._path = '';
-		return this;
-	},
-
-	/* Move the pointer to a position.
-	   @param  x         (number) x-coordinate to move to or
-	                     (number[][]) x-/y-coordinates to move to
-	   @param  y         (number) y-coordinate to move to (omitted if x is array)
-	   @param  relative  (boolean) true for coordinates relative to the current point,
-	                     false for coordinates being absolute
-	   @return  (SVGPath) this path */
-	move: function(x, y, relative) {
-		relative = (isArray(x) ? y : relative);
-		return this._coords((relative ? 'm' : 'M'), x, y);
-	},
-
-	/* Draw a line to a position.
-	   @param  x         (number) x-coordinate to move to or
-	                     (number[][]) x-/y-coordinates to move to
-	   @param  y         (number) y-coordinate to move to (omitted if x is array)
-	   @param  relative  (boolean) true for coordinates relative to the current point,
-	                     false for coordinates being absolute
-	   @return  (SVGPath) this path */
-	line: function(x, y, relative) {
-		relative = (isArray(x) ? y : relative);
-		return this._coords((relative ? 'l' : 'L'), x, y);
-	},
-
-	/* Draw a horizontal line to a position.
-	   @param  x         (number) x-coordinate to draw to or
-	                     (number[]) x-coordinates to draw to
-	   @param  relative  (boolean) true for coordinates relative to the current point,
-	                     false for coordinates being absolute
-	   @return  (SVGPath) this path */
-	horiz: function(x, relative) {
-		this._path += (relative ? 'h' : 'H') + (isArray(x) ? x.join(' ') : x);
-		return this;
-	},
-
-	/* Draw a vertical line to a position.
-	   @param  y         (number) y-coordinate to draw to or
-	                     (number[]) y-coordinates to draw to
-	   @param  relative  (boolean) true for coordinates relative to the current point,
-	                     false for coordinates being absolute
-	   @return  (SVGPath) this path */
-	vert: function(y, relative) {
-		this._path += (relative ? 'v' : 'V') + (isArray(y) ? y.join(' ') : y);
-		return this;
-	},
-
-	/* Draw a cubic Bézier curve.
-	   @param  x1        (number) x-coordinate of beginning control point or
-	                     (number[][]) x-/y-coordinates of control and end points to draw to
-	   @param  y1        (number) y-coordinate of beginning control point (omitted if x1 is array)
-	   @param  x2        (number) x-coordinate of ending control point (omitted if x1 is array)
-	   @param  y2        (number) y-coordinate of ending control point (omitted if x1 is array)
-	   @param  x         (number) x-coordinate of curve end (omitted if x1 is array)
-	   @param  y         (number) y-coordinate of curve end (omitted if x1 is array)
-	   @param  relative  (boolean) true for coordinates relative to the current point,
-	                     false for coordinates being absolute
-	   @return  (SVGPath) this path */
-	curveC: function(x1, y1, x2, y2, x, y, relative) {
-		relative = (isArray(x1) ? y1 : relative);
-		return this._coords((relative ? 'c' : 'C'), x1, y1, x2, y2, x, y);
-	},
-
-	/* Continue a cubic Bézier curve.
-	   Starting control point is the reflection of the previous end control point.
-	   @param  x2        (number) x-coordinate of ending control point or
-	                     (number[][]) x-/y-coordinates of control and end points to draw to
-	   @param  y2        (number) y-coordinate of ending control point (omitted if x2 is array)
-	   @param  x         (number) x-coordinate of curve end (omitted if x2 is array)
-	   @param  y         (number) y-coordinate of curve end (omitted if x2 is array)
-	   @param  relative  (boolean) true for coordinates relative to the current point,
-	                     false for coordinates being absolute
-	   @return  (SVGPath) this path */
-	smoothC: function(x2, y2, x, y, relative) {
-		relative = (isArray(x2) ? y2 : relative);
-		return this._coords((relative ? 's' : 'S'), x2, y2, x, y);
-	},
-
-	/* Draw a quadratic Bézier curve.
-	   @param  x1        (number) x-coordinate of control point or
-	                     (number[][]) x-/y-coordinates of control and end points to draw to
-	   @param  y1        (number) y-coordinate of control point (omitted if x1 is array)
-	   @param  x         (number) x-coordinate of curve end (omitted if x1 is array)
-	   @param  y         (number) y-coordinate of curve end (omitted if x1 is array)
-	   @param  relative  (boolean) true for coordinates relative to the current point,
-	                     false for coordinates being absolute
-	   @return  (SVGPath) this path */
-	curveQ: function(x1, y1, x, y, relative) {
-		relative = (isArray(x1) ? y1 : relative);
-		return this._coords((relative ? 'q' : 'Q'), x1, y1, x, y);
-	},
-
-	/* Continue a quadratic Bézier curve.
-	   Control point is the reflection of the previous control point.
-	   @param  x         (number) x-coordinate of curve end or
-	                     (number[][]) x-/y-coordinates of points to draw to
-	   @param  y         (number) y-coordinate of curve end (omitted if x is array)
-	   @param  relative  (boolean) true for coordinates relative to the current point,
-	                     false for coordinates being absolute
-	   @return  (SVGPath) this path */
-	smoothQ: function(x, y, relative) {
-		relative = (isArray(x) ? y : relative);
-		return this._coords((relative ? 't' : 'T'), x, y);
-	},
-
-	/* Generate a path command with (a list of) coordinates. */
-	_coords: function(cmd, x1, y1, x2, y2, x3, y3) {
-		if (isArray(x1)) {
-			for (var i = 0; i < x1.length; i++) {
-				var cs = x1[i];
-				this._path += (i == 0 ? cmd : ' ') + cs[0] + ',' + cs[1] +
-					(cs.length < 4 ? '' : ' ' + cs[2] + ',' + cs[3] +
-					(cs.length < 6 ? '': ' ' + cs[4] + ',' + cs[5]));
-			}
-		}
-		else {
-			this._path += cmd + x1 + ',' + y1 + 
-				(x2 == null ? '' : ' ' + x2 + ',' + y2 +
-				(x3 == null ? '' : ' ' + x3 + ',' + y3));
-		}
-		return this;
-	},
-
-	/* Draw an arc to a position.
-	   @param  rx         (number) x-radius of arc or
-	                      (number/boolean[][]) x-/y-coordinates and flags for points to draw to
-	   @param  ry         (number) y-radius of arc (omitted if rx is array)
-	   @param  xRotate    (number) x-axis rotation (degrees, clockwise) (omitted if rx is array)
-	   @param  large      (boolean) true to draw the large part of the arc,
-	                      false to draw the small part (omitted if rx is array)
-	   @param  clockwise  (boolean) true to draw the clockwise arc,
-	                      false to draw the anti-clockwise arc (omitted if rx is array)
-	   @param  x          (number) x-coordinate of arc end (omitted if rx is array)
-	   @param  y          (number) y-coordinate of arc end (omitted if rx is array)
-	   @param  relative   (boolean) true for coordinates relative to the current point,
-	                      false for coordinates being absolute
-	   @return  (SVGPath) this path */
-	arc: function(rx, ry, xRotate, large, clockwise, x, y, relative) {
-		relative = (isArray(rx) ? ry : relative);
-		this._path += (relative ? 'a' : 'A');
-		if (isArray(rx)) {
-			for (var i = 0; i < rx.length; i++) {
-				var cs = rx[i];
-				this._path += (i == 0 ? '' : ' ') + cs[0] + ',' + cs[1] + ' ' +
-					cs[2] + ' ' + (cs[3] ? '1' : '0') + ',' +
-					(cs[4] ? '1' : '0') + ' ' + cs[5] + ',' + cs[6];
-			}
-		}
-		else {
-			this._path += rx + ',' + ry + ' ' + xRotate + ' ' +
-				(large ? '1' : '0') + ',' + (clockwise ? '1' : '0') + ' ' + x + ',' + y;
-		}
-		return this;
-	},
-
-	/* Close the current path.
-	   @return  (SVGPath) this path */
-	close: function() {
-		this._path += 'z';
-		return this;
-	},
-
-	/* Return the string rendering of the specified path.
-	   @return  (string) stringified path */
-	path: function() {
-		return this._path;
-	}
-});
-
-SVGPath.prototype.moveTo = SVGPath.prototype.move;
-SVGPath.prototype.lineTo = SVGPath.prototype.line;
-SVGPath.prototype.horizTo = SVGPath.prototype.horiz;
-SVGPath.prototype.vertTo = SVGPath.prototype.vert;
-SVGPath.prototype.curveCTo = SVGPath.prototype.curveC;
-SVGPath.prototype.smoothCTo = SVGPath.prototype.smoothC;
-SVGPath.prototype.curveQTo = SVGPath.prototype.curveQ;
-SVGPath.prototype.smoothQTo = SVGPath.prototype.smoothQ;
-SVGPath.prototype.arcTo = SVGPath.prototype.arc;
-
-/* Helper to generate an SVG text object.
-   Obtain an instance from the SVGWrapper object.
-   String calls together to generate the text and use its value:
-   var text = root.createText();
-   root.text(null, x, y, text.string('This is ').
-     span('red', {fill: 'red'}).string('!'), {fill: 'blue'}); */
-function SVGText() {
-	this._parts = []; // The components of the text object
-}
-
-$.extend(SVGText.prototype, {
-	/* Prepare to create a new text object.
-	   @return  (SVGText) this text */
-	reset: function() {
-		this._parts = [];
-		return this;
-	},
-
-	/* Add a straight string value.
-	   @param  value  (string) the actual text
-	   @return  (SVGText) this text object */
-	string: function(value) {
-		this._parts[this._parts.length] = ['text', value];
-		return this;
-	},
-
-	/* Add a separate text span that has its own settings.
-	   @param  value     (string) the actual text
-	   @param  settings  (object) the settings for this text
-	   @return  (SVGText) this text object */
-	span: function(value, settings) {
-		this._parts[this._parts.length] = ['tspan', value, settings];
-		return this;
-	},
-
-	/* Add a reference to a previously defined text string.
-	   @param  id        (string) the ID of the actual text
-	   @param  settings  (object) the settings for this text
-	   @return  (SVGText) this text object */
-	ref: function(id, settings) {
-		this._parts[this._parts.length] = ['tref', id, settings];
-		return this;
-	},
-
-	/* Add text drawn along a path.
-	   @param  id        (string) the ID of the path
-	   @param  value     (string) the actual text
-	   @param  settings  (object) the settings for this text
-	   @return  (SVGText) this text object */
-	path: function(id, value, settings) {
-		this._parts[this._parts.length] = ['textpath', value, 
-			$.extend({href: id}, settings || {})];
-		return this;
-	}
-});
-
-/* Attach the SVG functionality to a jQuery selection.
-   @param  command  (string) the command to run (optional, default 'attach')
-   @param  options  (object) the new settings to use for these SVG instances
-   @return jQuery (object) for chaining further calls */
-$.fn.svg = function(options) {
-	var otherArgs = Array.prototype.slice.call(arguments, 1);
-	if (typeof options == 'string' && options == 'get') {
-		return $.svg['_' + options + 'SVG'].apply($.svg, [this[0]].concat(otherArgs));
-	}
-	return this.each(function() {
-		if (typeof options == 'string') {
-			$.svg['_' + options + 'SVG'].apply($.svg, [this].concat(otherArgs));
-		}
-		else {
-			$.svg._attachSVG(this, options || {});
-		} 
-	});
-};
-
-/* Determine whether an object is an array. */
-function isArray(a) {
-	return (a && a.constructor == Array);
-}
+(function ($) { // Hide scope, no $ conflict
+
+  /* SVG manager.
+     Use the singleton instance of this class, $.svg,
+     to interact with the SVG functionality. */
+  function SVGManager() {
+    this._settings = []; // Settings to be remembered per SVG object
+    this._extensions = []; // List of SVG extensions added to SVGWrapper
+    // for each entry [0] is extension name, [1] is extension class (function)
+    // the function takes one parameter - the SVGWrapper instance
+    this.regional = []; // Localisations, indexed by language, '' for default (English)
+    this.regional[''] = {
+      errorLoadingText: 'Error loading',
+      notSupportedText: 'This browser does not support SVG'
+    };
+    this.local = this.regional['']; // Current localisation
+    this._uuid = new Date().getTime();
+    this._renesis = detectActiveX('RenesisX.RenesisCtrl');
+  }
+
+  /* Determine whether a given ActiveX control is available.
+     @param  classId  (string) the ID for the ActiveX control
+     @return  (boolean) true if found, false if not */
+  function detectActiveX(classId) {
+    try {
+      return !!(window.ActiveXObject && new ActiveXObject(classId));
+    }
+    catch (e) {
+      return false;
+    }
+  }
+
+  var PROP_NAME = 'svgwrapper';
+
+  $.extend(SVGManager.prototype, {
+    /* Class name added to elements to indicate already configured with SVG. */
+    markerClassName: 'hasSVG',
+
+    /* SVG namespace. */
+    svgNS: 'http://www.w3.org/2000/svg',
+    /* XLink namespace. */
+    xlinkNS: 'http://www.w3.org/1999/xlink',
+
+    /* SVG wrapper class. */
+    _wrapperClass: SVGWrapper,
+
+    /* Camel-case versions of attribute names containing dashes or are reserved words. */
+    _attrNames: {
+      class_: 'class',
+      in_: 'in',
+      alignmentBaseline: 'alignment-baseline',
+      baselineShift: 'baseline-shift',
+      clipPath: 'clip-path',
+      clipRule: 'clip-rule',
+      colorInterpolation: 'color-interpolation',
+      colorInterpolationFilters: 'color-interpolation-filters',
+      colorRendering: 'color-rendering',
+      dominantBaseline: 'dominant-baseline',
+      enableBackground: 'enable-background',
+      fillOpacity: 'fill-opacity',
+      fillRule: 'fill-rule',
+      floodColor: 'flood-color',
+      floodOpacity: 'flood-opacity',
+      fontFamily: 'font-family',
+      fontSize: 'font-size',
+      fontSizeAdjust: 'font-size-adjust',
+      fontStretch: 'font-stretch',
+      fontStyle: 'font-style',
+      fontVariant: 'font-variant',
+      fontWeight: 'font-weight',
+      glyphOrientationHorizontal: 'glyph-orientation-horizontal',
+      glyphOrientationVertical: 'glyph-orientation-vertical',
+      horizAdvX: 'horiz-adv-x',
+      horizOriginX: 'horiz-origin-x',
+      imageRendering: 'image-rendering',
+      letterSpacing: 'letter-spacing',
+      lightingColor: 'lighting-color',
+      markerEnd: 'marker-end',
+      markerMid: 'marker-mid',
+      markerStart: 'marker-start',
+      stopColor: 'stop-color',
+      stopOpacity: 'stop-opacity',
+      strikethroughPosition: 'strikethrough-position',
+      strikethroughThickness: 'strikethrough-thickness',
+      strokeDashArray: 'stroke-dasharray',
+      strokeDashOffset: 'stroke-dashoffset',
+      strokeLineCap: 'stroke-linecap',
+      strokeLineJoin: 'stroke-linejoin',
+      strokeMiterLimit: 'stroke-miterlimit',
+      strokeOpacity: 'stroke-opacity',
+      strokeWidth: 'stroke-width',
+      textAnchor: 'text-anchor',
+      textDecoration: 'text-decoration',
+      textRendering: 'text-rendering',
+      underlinePosition: 'underline-position',
+      underlineThickness: 'underline-thickness',
+      vertAdvY: 'vert-adv-y',
+      vertOriginY: 'vert-origin-y',
+      wordSpacing: 'word-spacing',
+      writingMode: 'writing-mode'
+    },
+
+    /* Add the SVG object to its container. */
+    _attachSVG: function (container, settings) {
+      var svg = (container.namespaceURI == this.svgNS ? container : null);
+      var container = (svg ? null : container);
+      if ($(container || svg).hasClass(this.markerClassName)) {
+        return;
+      }
+      if (typeof settings == 'string') {
+        settings = {loadURL: settings};
+      }
+      else if (typeof settings == 'function') {
+        settings = {onLoad: settings};
+      }
+      $(container || svg).addClass(this.markerClassName);
+      try {
+        if (!svg) {
+          svg = document.createElementNS(this.svgNS, 'svg');
+          svg.setAttribute('version', '1.1');
+          if (container.clientWidth > 0) {
+            svg.setAttribute('width', container.clientWidth);
+          }
+          if (container.clientHeight > 0) {
+            svg.setAttribute('height', container.clientHeight);
+          }
+          container.appendChild(svg);
+        }
+        this._afterLoad(container, svg, settings || {});
+      }
+      catch (e) {
+        if ($.browser.msie) {
+          if (!container.id) {
+            container.id = 'svg' + (this._uuid++);
+          }
+          this._settings[container.id] = settings;
+          container.innerHTML = '<embed type="image/svg+xml" width="100%" ' +
+              'height="100%" src="' + (settings.initPath || '') + 'blank.svg" '
+              +
+              'pluginspage="http://www.adobe.com/svg/viewer/install/main.html"/>';
+        }
+        else {
+          container.innerHTML = '<p class="svg_error">' +
+              this.local.notSupportedText + '</p>';
+        }
+      }
+    },
+
+    /* SVG callback after loading - register SVG root. */
+    _registerSVG: function () {
+      for (var i = 0; i < document.embeds.length; i++) { // Check all
+        var container = document.embeds[i].parentNode;
+        if (!$(container).hasClass($.svg.markerClassName) || // Not SVG
+            $.data(container, PROP_NAME)) { // Already done
+          continue;
+        }
+        var svg = null;
+        try {
+          svg = document.embeds[i].getSVGDocument();
+        }
+        catch (e) {
+          setTimeout($.svg._registerSVG, 250); // Renesis takes longer to load
+          return;
+        }
+        svg = (svg ? svg.documentElement : null);
+        if (svg) {
+          $.svg._afterLoad(container, svg);
+        }
+      }
+    },
+
+    /* Post-processing once loaded. */
+    _afterLoad: function (container, svg, settings) {
+      var settings = settings || this._settings[container.id];
+      this._settings[container ? container.id : ''] = null;
+      var wrapper = new this._wrapperClass(svg, container);
+      $.data(container || svg, PROP_NAME, wrapper);
+      try {
+        if (settings.loadURL) { // Load URL
+          wrapper.load(settings.loadURL, settings);
+        }
+        if (settings.settings) { // Additional settings
+          wrapper.configure(settings.settings);
+        }
+        if (settings.onLoad && !settings.loadURL) { // Onload callback
+          settings.onLoad.apply(container || svg, [wrapper]);
+        }
+      }
+      catch (e) {
+        alert(e);
+      }
+    },
+
+    /* Return the SVG wrapper created for a given container.
+       @param  container  (string) selector for the container or
+                          (element) the container for the SVG object or
+                          jQuery collection - first entry is the container
+       @return  (SVGWrapper) the corresponding SVG wrapper element, or null if not attached */
+    _getSVG: function (container) {
+      container = (typeof container == 'string' ? $(container)[0]
+          : (container.jquery ? container[0] : container));
+      return $.data(container, PROP_NAME);
+    },
+
+    /* Remove the SVG functionality from a div.
+       @param  container  (element) the container for the SVG object */
+    _destroySVG: function (container) {
+      var $container = $(container);
+      if (!$container.hasClass(this.markerClassName)) {
+        return;
+      }
+      $container.removeClass(this.markerClassName);
+      if (container.namespaceURI != this.svgNS) {
+        $container.empty();
+      }
+      $.removeData(container, PROP_NAME);
+    },
+
+    /* Extend the SVGWrapper object with an embedded class.
+       The constructor function must take a single parameter that is
+       a reference to the owning SVG root object. This allows the
+       extension to access the basic SVG functionality.
+       @param  name      (string) the name of the SVGWrapper attribute to access the new class
+       @param  extClass  (function) the extension class constructor */
+    addExtension: function (name, extClass) {
+      this._extensions.push([name, extClass]);
+    },
+
+    /* Does this node belong to SVG?
+       @param  node  (element) the node to be tested
+       @return  (boolean) true if an SVG node, false if not */
+    isSVGElem: function (node) {
+      return (node.nodeType == 1 && node.namespaceURI == $.svg.svgNS);
+    }
+  });
+
+  /* The main SVG interface, which encapsulates the SVG element.
+     Obtain a reference from $().svg('get') */
+  function SVGWrapper(svg, container) {
+    this._svg = svg; // The SVG root node
+    this._container = container; // The containing div
+    for (var i = 0; i < $.svg._extensions.length; i++) {
+      var extension = $.svg._extensions[i];
+      this[extension[0]] = new extension[1](this);
+    }
+  }
+
+  $.extend(SVGWrapper.prototype, {
+
+    /* Retrieve the width of the SVG object. */
+    _width: function () {
+      return (this._container ? this._container.clientWidth : this._svg.width);
+    },
+
+    /* Retrieve the height of the SVG object. */
+    _height: function () {
+      return (this._container ? this._container.clientHeight
+          : this._svg.height);
+    },
+
+    /* Retrieve the root SVG element.
+       @return  the top-level SVG element */
+    root: function () {
+      return this._svg;
+    },
+
+    /* Configure a SVG node.
+       @param  node      (element, optional) the node to configure
+       @param  settings  (object) additional settings for the root
+       @param  clear     (boolean) true to remove existing attributes first,
+                         false to add to what is already there (optional)
+       @return  (SVGWrapper) this root */
+    configure: function (node, settings, clear) {
+      if (!node.nodeName) {
+        clear = settings;
+        settings = node;
+        node = this._svg;
+      }
+      if (clear) {
+        for (var i = node.attributes.length - 1; i >= 0; i--) {
+          var attr = node.attributes.item(i);
+          if (!(attr.nodeName == 'onload' || attr.nodeName == 'version' ||
+                  attr.nodeName.substring(0, 5) == 'xmlns')) {
+            node.attributes.removeNamedItem(attr.nodeName);
+          }
+        }
+      }
+      for (var attrName in settings) {
+        node.setAttribute($.svg._attrNames[attrName] || attrName,
+            settings[attrName]);
+      }
+      return this;
+    },
+
+    /* Locate a specific element in the SVG document.
+       @param  id  (string) the element's identifier
+       @return  (element) the element reference, or null if not found */
+    getElementById: function (id) {
+      return this._svg.ownerDocument.getElementById(id);
+    },
+
+    /* Change the attributes for a SVG node.
+       @param  element   (SVG element) the node to change
+       @param  settings  (object) the new settings
+       @return  (SVGWrapper) this root */
+    change: function (element, settings) {
+      if (element) {
+        for (var name in settings) {
+          if (settings[name] == null) {
+            element.removeAttribute($.svg._attrNames[name] || name);
+          }
+          else {
+            element.setAttribute($.svg._attrNames[name] || name,
+                settings[name]);
+          }
+        }
+      }
+      return this;
+    },
+
+    /* Check for parent being absent and adjust arguments accordingly. */
+    _args: function (values, names, optSettings) {
+      names.splice(0, 0, 'parent');
+      names.splice(names.length, 0, 'settings');
+      var args = {};
+      var offset = 0;
+      if (values[0] != null && values[0].jquery) {
+        values[0] = values[0][0];
+      }
+      if (values[0] != null && !(typeof values[0] == 'object'
+              && values[0].nodeName)) {
+        args['parent'] = null;
+        offset = 1;
+      }
+      for (var i = 0; i < values.length; i++) {
+        args[names[i + offset]] = values[i];
+      }
+      if (optSettings) {
+        $.each(optSettings, function (i, value) {
+          if (typeof args[value] == 'object') {
+            args.settings = args[value];
+            args[value] = null;
+          }
+        });
+      }
+      return args;
+    },
+
+    /* Add a title.
+       @param  parent    (element or jQuery) the parent node for the new title (optional)
+       @param  text      (string) the text of the title
+       @param  settings  (object) additional settings for the title (optional)
+       @return  (element) the new title node */
+    title: function (parent, text, settings) {
+      var args = this._args(arguments, ['text']);
+      var node = this._makeNode(args.parent, 'title', args.settings || {});
+      node.appendChild(this._svg.ownerDocument.createTextNode(args.text));
+      return node;
+    },
+
+    /* Add a description.
+       @param  parent    (element or jQuery) the parent node for the new description (optional)
+       @param  text      (string) the text of the description
+       @param  settings  (object) additional settings for the description (optional)
+       @return  (element) the new description node */
+    describe: function (parent, text, settings) {
+      var args = this._args(arguments, ['text']);
+      var node = this._makeNode(args.parent, 'desc', args.settings || {});
+      node.appendChild(this._svg.ownerDocument.createTextNode(args.text));
+      return node;
+    },
+
+    /* Add a definitions node.
+       @param  parent    (element or jQuery) the parent node for the new definitions (optional)
+       @param  id        (string) the ID of this definitions (optional)
+       @param  settings  (object) additional settings for the definitions (optional)
+       @return  (element) the new definitions node */
+    defs: function (parent, id, settings) {
+      var args = this._args(arguments, ['id'], ['id']);
+      return this._makeNode(args.parent, 'defs', $.extend(
+          (args.id ? {id: args.id} : {}), args.settings || {}));
+    },
+
+    /* Add a symbol definition.
+       @param  parent    (element or jQuery) the parent node for the new symbol (optional)
+       @param  id        (string) the ID of this symbol
+       @param  x1        (number) the left coordinate for this symbol
+       @param  y1        (number) the top coordinate for this symbol
+       @param  width     (number) the width of this symbol
+       @param  height    (number) the height of this symbol
+       @param  settings  (object) additional settings for the symbol (optional)
+       @return  (element) the new symbol node */
+    symbol: function (parent, id, x1, y1, width, height, settings) {
+      var args = this._args(arguments, ['id', 'x1', 'y1', 'width', 'height']);
+      return this._makeNode(args.parent, 'symbol', $.extend({
+            id: args.id,
+            viewBox: args.x1 + ' ' + args.y1 + ' ' + args.width + ' ' + args.height
+          },
+          args.settings || {}));
+    },
+
+    /* Add a marker definition.
+       @param  parent    (element or jQuery) the parent node for the new marker (optional)
+       @param  id        (string) the ID of this marker
+       @param  refX      (number) the x-coordinate for the reference point
+       @param  refY      (number) the y-coordinate for the reference point
+       @param  mWidth    (number) the marker viewport width
+       @param  mHeight   (number) the marker viewport height
+       @param  orient    (string or int) 'auto' or angle (degrees) (optional)
+       @param  settings  (object) additional settings for the marker (optional)
+       @return  (element) the new marker node */
+    marker: function (parent, id, refX, refY, mWidth, mHeight, orient,
+        settings) {
+      var args = this._args(arguments, ['id', 'refX', 'refY',
+        'mWidth', 'mHeight', 'orient'], ['orient']);
+      return this._makeNode(args.parent, 'marker', $.extend(
+          {
+            id: args.id,
+            refX: args.refX,
+            refY: args.refY,
+            markerWidth: args.mWidth,
+            markerHeight: args.mHeight,
+            orient: args.orient || 'auto'
+          }, args.settings || {}));
+    },
+
+    /* Add a style node.
+       @param  parent    (element or jQuery) the parent node for the new node (optional)
+       @param  styles    (string) the CSS styles
+       @param  settings  (object) additional settings for the node (optional)
+       @return  (element) the new style node */
+    style: function (parent, styles, settings) {
+      var args = this._args(arguments, ['styles']);
+      var node = this._makeNode(args.parent, 'style', $.extend(
+          {type: 'text/css'}, args.settings || {}));
+      node.appendChild(this._svg.ownerDocument.createTextNode(args.styles));
+      if ($.browser.opera) {
+        $('head').append('<style type="text/css">' + args.styles + '</style>');
+      }
+      return node;
+    },
+
+    /* Add a script node.
+       @param  parent    (element or jQuery) the parent node for the new node (optional)
+       @param  script    (string) the JavaScript code
+       @param  type      (string) the MIME type for the code (optional, default 'text/javascript')
+       @param  settings  (object) additional settings for the node (optional)
+       @return  (element) the new script node */
+    script: function (parent, script, type, settings) {
+      var args = this._args(arguments, ['script', 'type'], ['type']);
+      var node = this._makeNode(args.parent, 'script', $.extend(
+          {type: args.type || 'text/javascript'}, args.settings || {}));
+      node.appendChild(this._svg.ownerDocument.createTextNode(args.script));
+      if (!$.browser.mozilla) {
+        $.globalEval(args.script);
+      }
+      return node;
+    },
+
+    /* Add a linear gradient definition.
+       Specify all of x1, y1, x2, y2 or none of them.
+       @param  parent    (element or jQuery) the parent node for the new gradient (optional)
+       @param  id        (string) the ID for this gradient
+       @param  stops     (string[][]) the gradient stops, each entry is
+                         [0] is offset (0.0-1.0 or 0%-100%), [1] is colour,
+               [2] is opacity (optional)
+       @param  x1        (number) the x-coordinate of the gradient start (optional)
+       @param  y1        (number) the y-coordinate of the gradient start (optional)
+       @param  x2        (number) the x-coordinate of the gradient end (optional)
+       @param  y2        (number) the y-coordinate of the gradient end (optional)
+       @param  settings  (object) additional settings for the gradient (optional)
+       @return  (element) the new gradient node */
+    linearGradient: function (parent, id, stops, x1, y1, x2, y2, settings) {
+      var args = this._args(arguments,
+          ['id', 'stops', 'x1', 'y1', 'x2', 'y2'], ['x1']);
+      var sets = $.extend({id: args.id},
+          (args.x1 != null ? {
+            x1: args.x1,
+            y1: args.y1,
+            x2: args.x2,
+            y2: args.y2
+          } : {}));
+      return this._gradient(args.parent, 'linearGradient',
+          $.extend(sets, args.settings || {}), args.stops);
+    },
+
+    /* Add a radial gradient definition.
+       Specify all of cx, cy, r, fx, fy or none of them.
+       @param  parent    (element or jQuery) the parent node for the new gradient (optional)
+       @param  id        (string) the ID for this gradient
+       @param  stops     (string[][]) the gradient stops, each entry
+                         [0] is offset, [1] is colour, [2] is opacity (optional)
+       @param  cx        (number) the x-coordinate of the largest circle centre (optional)
+       @param  cy        (number) the y-coordinate of the largest circle centre (optional)
+       @param  r         (number) the radius of the largest circle (optional)
+       @param  fx        (number) the x-coordinate of the gradient focus (optional)
+       @param  fy        (number) the y-coordinate of the gradient focus (optional)
+       @param  settings  (object) additional settings for the gradient (optional)
+       @return  (element) the new gradient node */
+    radialGradient: function (parent, id, stops, cx, cy, r, fx, fy, settings) {
+      var args = this._args(arguments,
+          ['id', 'stops', 'cx', 'cy', 'r', 'fx', 'fy'], ['cx']);
+      var sets = $.extend({id: args.id}, (args.cx != null ? {
+        cx: args.cx,
+        cy: args.cy,
+        r: args.r,
+        fx: args.fx,
+        fy: args.fy
+      } : {}));
+      return this._gradient(args.parent, 'radialGradient',
+          $.extend(sets, args.settings || {}), args.stops);
+    },
+
+    /* Add a gradient node. */
+    _gradient: function (parent, name, settings, stops) {
+      var node = this._makeNode(parent, name, settings);
+      for (var i = 0; i < stops.length; i++) {
+        var stop = stops[i];
+        this._makeNode(node, 'stop', $.extend(
+            {offset: stop[0], stopColor: stop[1]},
+            (stop[2] != null ? {stopOpacity: stop[2]} : {})));
+      }
+      return node;
+    },
+
+    /* Add a pattern definition.
+       Specify all of vx, vy, xwidth, vheight or none of them.
+       @param  parent    (element or jQuery) the parent node for the new pattern (optional)
+       @param  id        (string) the ID for this pattern
+       @param  x         (number) the x-coordinate for the left edge of the pattern
+       @param  y         (number) the y-coordinate for the top edge of the pattern
+       @param  width     (number) the width of the pattern
+       @param  height    (number) the height of the pattern
+       @param  vx        (number) the minimum x-coordinate for view box (optional)
+       @param  vy        (number) the minimum y-coordinate for the view box (optional)
+       @param  vwidth    (number) the width of the view box (optional)
+       @param  vheight   (number) the height of the view box (optional)
+       @param  settings  (object) additional settings for the pattern (optional)
+       @return  (element) the new pattern node */
+    pattern: function (parent, id, x, y, width, height, vx, vy, vwidth, vheight,
+        settings) {
+      var args = this._args(arguments, ['id', 'x', 'y', 'width', 'height',
+        'vx', 'vy', 'vwidth', 'vheight'], ['vx']);
+      var sets = $.extend({
+        id: args.id, x: args.x, y: args.y,
+        width: args.width, height: args.height
+      }, (args.vx != null ? {
+        viewBox: args.vx + ' ' + args.vy + ' ' + args.vwidth + ' '
+        + args.vheight
+      } : {}));
+      return this._makeNode(args.parent, 'pattern',
+          $.extend(sets, args.settings || {}));
+    },
+
+    /* Add a clip path definition.
+       @param  parent  (element) the parent node for the new element (optional)
+       @param  id      (string) the ID for this path
+       @param  units   (string) either 'userSpaceOnUse' (default) or 'objectBoundingBox' (optional)
+       @return  (element) the new clipPath node */
+    clipPath: function (parent, id, units, settings) {
+      var args = this._args(arguments, ['id', 'units']);
+      args.units = args.units || 'userSpaceOnUse';
+      return this._makeNode(args.parent, 'clipPath', $.extend(
+          {id: args.id, clipPathUnits: args.units}, args.settings || {}));
+    },
+
+    /* Add a mask definition.
+       @param  parent    (element or jQuery) the parent node for the new mask (optional)
+       @param  id        (string) the ID for this mask
+       @param  x         (number) the x-coordinate for the left edge of the mask
+       @param  y         (number) the y-coordinate for the top edge of the mask
+       @param  width     (number) the width of the mask
+       @param  height    (number) the height of the mask
+       @param  settings  (object) additional settings for the mask (optional)
+       @return  (element) the new mask node */
+    mask: function (parent, id, x, y, width, height, settings) {
+      var args = this._args(arguments, ['id', 'x', 'y', 'width', 'height']);
+      return this._makeNode(args.parent, 'mask', $.extend(
+          {
+            id: args.id,
+            x: args.x,
+            y: args.y,
+            width: args.width,
+            height: args.height
+          },
+          args.settings || {}));
+    },
+
+    /* Create a new path object.
+       @return  (SVGPath) a new path object */
+    createPath: function () {
+      return new SVGPath();
+    },
+
+    /* Create a new text object.
+       @return  (SVGText) a new text object */
+    createText: function () {
+      return new SVGText();
+    },
+
+    /* Add an embedded SVG element.
+       Specify all of vx, vy, vwidth, vheight or none of them.
+       @param  parent    (element or jQuery) the parent node for the new node (optional)
+       @param  x         (number) the x-coordinate for the left edge of the node
+       @param  y         (number) the y-coordinate for the top edge of the node
+       @param  width     (number) the width of the node
+       @param  height    (number) the height of the node
+       @param  vx        (number) the minimum x-coordinate for view box (optional)
+       @param  vy        (number) the minimum y-coordinate for the view box (optional)
+       @param  vwidth    (number) the width of the view box (optional)
+       @param  vheight   (number) the height of the view box (optional)
+       @param  settings  (object) additional settings for the node (optional)
+       @return  (element) the new node */
+    svg: function (parent, x, y, width, height, vx, vy, vwidth, vheight,
+        settings) {
+      var args = this._args(arguments, ['x', 'y', 'width', 'height',
+        'vx', 'vy', 'vwidth', 'vheight'], ['vx']);
+      var sets = $.extend(
+          {x: args.x, y: args.y, width: args.width, height: args.height},
+          (args.vx != null ? {
+            viewBox: args.vx + ' ' + args.vy + ' ' +
+            args.vwidth + ' ' + args.vheight
+          } : {}));
+      return this._makeNode(args.parent, 'svg',
+          $.extend(sets, args.settings || {}));
+    },
+
+    /* Create a group.
+       @param  parent    (element or jQuery) the parent node for the new group (optional)
+       @param  id        (string) the ID of this group (optional)
+       @param  settings  (object) additional settings for the group (optional)
+       @return  (element) the new group node */
+    group: function (parent, id, settings) {
+      var args = this._args(arguments, ['id'], ['id']);
+      return this._makeNode(args.parent, 'g',
+          $.extend({id: args.id}, args.settings || {}));
+    },
+
+    /* Add a usage reference.
+       Specify all of x, y, width, height or none of them.
+       @param  parent    (element or jQuery) the parent node for the new node (optional)
+       @param  x         (number) the x-coordinate for the left edge of the node (optional)
+       @param  y         (number) the y-coordinate for the top edge of the node (optional)
+       @param  width     (number) the width of the node (optional)
+       @param  height    (number) the height of the node (optional)
+       @param  ref       (string) the ID of the definition node
+       @param  settings  (object) additional settings for the node (optional)
+       @return  (element) the new node */
+    use: function (parent, x, y, width, height, ref, settings) {
+      var args = this._args(arguments, ['x', 'y', 'width', 'height', 'ref']);
+      if (typeof args.x == 'string') {
+        args.ref = args.x;
+        args.settings = args.y;
+        args.x = args.y = args.width = args.height = null;
+      }
+      var node = this._makeNode(args.parent, 'use', $.extend(
+          {x: args.x, y: args.y, width: args.width, height: args.height},
+          args.settings || {}));
+      node.setAttributeNS($.svg.xlinkNS, 'href', args.ref);
+      return node;
+    },
+
+    /* Add a link, which applies to all child elements.
+       @param  parent    (element or jQuery) the parent node for the new link (optional)
+       @param  ref       (string) the target URL
+       @param  settings  (object) additional settings for the link (optional)
+       @return  (element) the new link node */
+    link: function (parent, ref, settings) {
+      var args = this._args(arguments, ['ref']);
+      var node = this._makeNode(args.parent, 'a', args.settings);
+      node.setAttributeNS($.svg.xlinkNS, 'href', args.ref);
+      return node;
+    },
+
+    /* Add an image.
+       @param  parent    (element or jQuery) the parent node for the new image (optional)
+       @param  x         (number) the x-coordinate for the left edge of the image
+       @param  y         (number) the y-coordinate for the top edge of the image
+       @param  width     (number) the width of the image
+       @param  height    (number) the height of the image
+       @param  ref       (string) the path to the image
+       @param  settings  (object) additional settings for the image (optional)
+       @return  (element) the new image node */
+    image: function (parent, x, y, width, height, ref, settings) {
+      var args = this._args(arguments, ['x', 'y', 'width', 'height', 'ref']);
+      var node = this._makeNode(args.parent, 'image', $.extend(
+          {x: args.x, y: args.y, width: args.width, height: args.height},
+          args.settings || {}));
+      node.setAttributeNS($.svg.xlinkNS, 'href', args.ref);
+      return node;
+    },
+
+    /* Draw a path.
+       @param  parent    (element or jQuery) the parent node for the new shape (optional)
+       @param  path      (string or SVGPath) the path to draw
+       @param  settings  (object) additional settings for the shape (optional)
+       @return  (element) the new shape node */
+    path: function (parent, path, settings) {
+      var args = this._args(arguments, ['path']);
+      return this._makeNode(args.parent, 'path', $.extend(
+          {d: (args.path.path ? args.path.path() : args.path)}, args.settings
+          || {}));
+    },
+
+    /* Draw a rectangle.
+       Specify both of rx and ry or neither.
+       @param  parent    (element or jQuery) the parent node for the new shape (optional)
+       @param  x         (number) the x-coordinate for the left edge of the rectangle
+       @param  y         (number) the y-coordinate for the top edge of the rectangle
+       @param  width     (number) the width of the rectangle
+       @param  height    (number) the height of the rectangle
+       @param  rx        (number) the x-radius of the ellipse for the rounded corners (optional)
+       @param  ry        (number) the y-radius of the ellipse for the rounded corners (optional)
+       @param  settings  (object) additional settings for the shape (optional)
+       @return  (element) the new shape node */
+    rect: function (parent, x, y, width, height, rx, ry, settings) {
+      var args = this._args(arguments,
+          ['x', 'y', 'width', 'height', 'rx', 'ry'], ['rx']);
+      return this._makeNode(args.parent, 'rect', $.extend(
+          {x: args.x, y: args.y, width: args.width, height: args.height},
+          (args.rx ? {rx: args.rx, ry: args.ry} : {}), args.settings || {}));
+    },
+
+    /* Draw a circle.
+       @param  parent    (element or jQuery) the parent node for the new shape (optional)
+       @param  cx        (number) the x-coordinate for the centre of the circle
+       @param  cy        (number) the y-coordinate for the centre of the circle
+       @param  r         (number) the radius of the circle
+       @param  settings  (object) additional settings for the shape (optional)
+       @return  (element) the new shape node */
+    circle: function (parent, cx, cy, r, settings) {
+      var args = this._args(arguments, ['cx', 'cy', 'r']);
+      return this._makeNode(args.parent, 'circle', $.extend(
+          {cx: args.cx, cy: args.cy, r: args.r}, args.settings || {}));
+    },
+
+    /* Draw an ellipse.
+       @param  parent    (element or jQuery) the parent node for the new shape (optional)
+       @param  cx        (number) the x-coordinate for the centre of the ellipse
+       @param  cy        (number) the y-coordinate for the centre of the ellipse
+       @param  rx        (number) the x-radius of the ellipse
+       @param  ry        (number) the y-radius of the ellipse
+       @param  settings  (object) additional settings for the shape (optional)
+       @return  (element) the new shape node */
+    ellipse: function (parent, cx, cy, rx, ry, settings) {
+      var args = this._args(arguments, ['cx', 'cy', 'rx', 'ry']);
+      return this._makeNode(args.parent, 'ellipse', $.extend(
+          {cx: args.cx, cy: args.cy, rx: args.rx, ry: args.ry}, args.settings
+          || {}));
+    },
+
+    /* Draw a line.
+       @param  parent    (element or jQuery) the parent node for the new shape (optional)
+       @param  x1        (number) the x-coordinate for the start of the line
+       @param  y1        (number) the y-coordinate for the start of the line
+       @param  x2        (number) the x-coordinate for the end of the line
+       @param  y2        (number) the y-coordinate for the end of the line
+       @param  settings  (object) additional settings for the shape (optional)
+       @return  (element) the new shape node */
+    line: function (parent, x1, y1, x2, y2, settings) {
+      var args = this._args(arguments, ['x1', 'y1', 'x2', 'y2']);
+      return this._makeNode(args.parent, 'line', $.extend(
+          {x1: args.x1, y1: args.y1, x2: args.x2, y2: args.y2}, args.settings
+          || {}));
+    },
+
+    /* Draw a polygonal line.
+       @param  parent    (element or jQuery) the parent node for the new shape (optional)
+       @param  points    (number[][]) the x-/y-coordinates for the points on the line
+       @param  settings  (object) additional settings for the shape (optional)
+       @return  (element) the new shape node */
+    polyline: function (parent, points, settings) {
+      var args = this._args(arguments, ['points']);
+      return this._poly(args.parent, 'polyline', args.points, args.settings);
+    },
+
+    /* Draw a polygonal shape.
+       @param  parent    (element or jQuery) the parent node for the new shape (optional)
+       @param  points    (number[][]) the x-/y-coordinates for the points on the shape
+       @param  settings  (object) additional settings for the shape (optional)
+       @return  (element) the new shape node */
+    polygon: function (parent, points, settings) {
+      var args = this._args(arguments, ['points']);
+      return this._poly(args.parent, 'polygon', args.points, args.settings);
+    },
+
+    /* Draw a polygonal line or shape. */
+    _poly: function (parent, name, points, settings) {
+      var ps = '';
+      for (var i = 0; i < points.length; i++) {
+        ps += points[i].join() + ' ';
+      }
+      return this._makeNode(parent, name, $.extend(
+          {points: $.trim(ps)}, settings || {}));
+    },
+
+    /* Draw text.
+       Specify both of x and y or neither of them.
+       @param  parent    (element or jQuery) the parent node for the text (optional)
+       @param  x         (number or number[]) the x-coordinate(s) for the text (optional)
+       @param  y         (number or number[]) the y-coordinate(s) for the text (optional)
+       @param  value     (string) the text content or
+                         (SVGText) text with spans and references
+       @param  settings  (object) additional settings for the text (optional)
+       @return  (element) the new text node */
+    text: function (parent, x, y, value, settings) {
+      var args = this._args(arguments, ['x', 'y', 'value']);
+      if (typeof args.x == 'string' && arguments.length < 4) {
+        args.value = args.x;
+        args.settings = args.y;
+        args.x = args.y = null;
+      }
+      return this._text(args.parent, 'text', args.value, $.extend(
+          {
+            x: (args.x && isArray(args.x) ? args.x.join(' ') : args.x),
+            y: (args.y && isArray(args.y) ? args.y.join(' ') : args.y)
+          },
+          args.settings || {}));
+    },
+
+    /* Draw text along a path.
+       @param  parent    (element or jQuery) the parent node for the text (optional)
+       @param  path      (string) the ID of the path
+       @param  value     (string) the text content or
+                         (SVGText) text with spans and references
+       @param  settings  (object) additional settings for the text (optional)
+       @return  (element) the new text node */
+    textpath: function (parent, path, value, settings) {
+      var args = this._args(arguments, ['path', 'value']);
+      var node = this._text(args.parent, 'textPath', args.value, args.settings
+          || {});
+      node.setAttributeNS($.svg.xlinkNS, 'href', args.path);
+      return node;
+    },
+
+    /* Draw text. */
+    _text: function (parent, name, value, settings) {
+      var node = this._makeNode(parent, name, settings);
+      if (typeof value == 'string') {
+        node.appendChild(node.ownerDocument.createTextNode(value));
+      }
+      else {
+        for (var i = 0; i < value._parts.length; i++) {
+          var part = value._parts[i];
+          if (part[0] == 'tspan') {
+            var child = this._makeNode(node, part[0], part[2]);
+            child.appendChild(node.ownerDocument.createTextNode(part[1]));
+            node.appendChild(child);
+          }
+          else if (part[0] == 'tref') {
+            var child = this._makeNode(node, part[0], part[2]);
+            child.setAttributeNS($.svg.xlinkNS, 'href', part[1]);
+            node.appendChild(child);
+          }
+          else if (part[0] == 'textpath') {
+            var set = $.extend({}, part[2]);
+            set.href = null;
+            var child = this._makeNode(node, part[0], set);
+            child.setAttributeNS($.svg.xlinkNS, 'href', part[2].href);
+            child.appendChild(node.ownerDocument.createTextNode(part[1]));
+            node.appendChild(child);
+          }
+          else { // straight text
+            node.appendChild(node.ownerDocument.createTextNode(part[1]));
+          }
+        }
+      }
+      return node;
+    },
+
+    /* Add a custom SVG element.
+       @param  parent    (element or jQuery) the parent node for the new element (optional)
+       @param  name      (string) the name of the element
+       @param  settings  (object) additional settings for the element (optional)
+       @return  (element) the new custom node */
+    other: function (parent, name, settings) {
+      var args = this._args(arguments, ['name']);
+      return this._makeNode(args.parent, args.name, args.settings || {});
+    },
+
+    /* Create a shape node with the given settings. */
+    _makeNode: function (parent, name, settings) {
+      parent = parent || this._svg;
+      var node = this._svg.ownerDocument.createElementNS($.svg.svgNS, name);
+      for (var name in settings) {
+        var value = settings[name];
+        if (value != null && value != null &&
+            (typeof value != 'string' || value != '')) {
+          node.setAttribute($.svg._attrNames[name] || name, value);
+        }
+      }
+      parent.appendChild(node);
+      return node;
+    },
+
+    /* Add an existing SVG node to the diagram.
+       @param  parent  (element or jQuery) the parent node for the new node (optional)
+       @param  node    (element) the new node to add or
+                       (string) the jQuery selector for the node or
+                       (jQuery collection) set of nodes to add
+       @return  (SVGWrapper) this wrapper */
+    add: function (parent, node) {
+      var args = this._args(
+          (arguments.length == 1 ? [null, parent] : arguments), ['node']);
+      var svg = this;
+      args.parent = args.parent || this._svg;
+      args.node = (args.node.jquery ? args.node : $(args.node));
+      try {
+        if ($.svg._renesis) {
+          throw 'Force traversal';
+        }
+        args.parent.appendChild(args.node.cloneNode(true));
+      }
+      catch (e) {
+        args.node.each(function () {
+          var child = svg._cloneAsSVG(this);
+          if (child) {
+            args.parent.appendChild(child);
+          }
+        });
+      }
+      return this;
+    },
+
+    /* Clone an existing SVG node and add it to the diagram.
+       @param  parent  (element or jQuery) the parent node for the new node (optional)
+       @param  node    (element) the new node to add or
+                       (string) the jQuery selector for the node or
+                       (jQuery collection) set of nodes to add
+       @return  (element[]) collection of new nodes */
+    clone: function (parent, node) {
+      var svg = this;
+      var args = this._args(
+          (arguments.length == 1 ? [null, parent] : arguments), ['node']);
+      args.parent = args.parent || this._svg;
+      args.node = (args.node.jquery ? args.node : $(args.node));
+      var newNodes = [];
+      args.node.each(function () {
+        var child = svg._cloneAsSVG(this);
+        if (child) {
+          child.id = '';
+          args.parent.appendChild(child);
+          newNodes.push(child);
+        }
+      });
+      return newNodes;
+    },
+
+    /* SVG nodes must belong to the SVG namespace, so clone and ensure this is so.
+       @param  node  (element) the SVG node to clone
+       @return  (element) the cloned node */
+    _cloneAsSVG: function (node) {
+      var newNode = null;
+      if (node.nodeType == 1) { // element
+        newNode = this._svg.ownerDocument.createElementNS(
+            $.svg.svgNS, this._checkName(node.nodeName));
+        for (var i = 0; i < node.attributes.length; i++) {
+          var attr = node.attributes.item(i);
+          if (attr.nodeName != 'xmlns' && attr.nodeValue) {
+            if (attr.prefix == 'xlink') {
+              newNode.setAttributeNS($.svg.xlinkNS,
+                  attr.localName || attr.baseName, attr.nodeValue);
+            }
+            else {
+              newNode.setAttribute(this._checkName(attr.nodeName),
+                  attr.nodeValue);
+            }
+          }
+        }
+        for (var i = 0; i < node.childNodes.length; i++) {
+          var child = this._cloneAsSVG(node.childNodes[i]);
+          if (child) {
+            newNode.appendChild(child);
+          }
+        }
+      }
+      else if (node.nodeType == 3) { // text
+        if ($.trim(node.nodeValue)) {
+          newNode = this._svg.ownerDocument.createTextNode(node.nodeValue);
+        }
+      }
+      else if (node.nodeType == 4) { // CDATA
+        if ($.trim(node.nodeValue)) {
+          try {
+            newNode = this._svg.ownerDocument.createCDATASection(
+                node.nodeValue);
+          }
+          catch (e) {
+            newNode = this._svg.ownerDocument.createTextNode(
+                node.nodeValue.replace(/&/g, '&amp;').replace(/</g,
+                    '&lt;').replace(/>/g, '&gt;'));
+          }
+        }
+      }
+      return newNode;
+    },
+
+    /* Node names must be lower case and without SVG namespace prefix. */
+    _checkName: function (name) {
+      name = (name.substring(0, 1) >= 'A' && name.substring(0, 1) <= 'Z'
+          ? name.toLowerCase() : name);
+      return (name.substring(0, 4) == 'svg:' ? name.substring(4) : name);
+    },
+
+    /* Load an external SVG document.
+       @param  url       (string) the location of the SVG document or
+                         the actual SVG content
+       @param  settings  (boolean) see addTo below or
+                         (function) see onLoad below or
+                         (object) additional settings for the load with attributes below:
+                           addTo       (boolean) true to add to what's already there,
+                                       or false to clear the canvas first
+                 changeSize  (boolean) true to allow the canvas size to change,
+                                       or false to retain the original
+                           onLoad      (function) callback after the document has loaded,
+                                       'this' is the container, receives SVG object and
+                                       optional error message as a parameter
+                           parent      (string or element or jQuery) the parent to load
+                                       into, defaults to top-level svg element
+       @return  (SVGWrapper) this root */
+    load: function (url, settings) {
+      settings = (typeof settings == 'boolean' ? {addTo: settings}
+          : (typeof settings == 'function' ? {onLoad: settings}
+              : (typeof settings == 'string' ? {parent: settings}
+                  : (typeof settings == 'object' && settings.nodeName
+                      ? {parent: settings} : (typeof settings == 'object'
+                      && settings.jquery ? {parent: settings} : settings
+                          || {})))));
+      if (!settings.parent && !settings.addTo) {
+        this.clear(false);
+      }
+      var size = [this._svg.getAttribute('width'),
+        this._svg.getAttribute('height')];
+      var wrapper = this;
+      // Report a problem with the load
+      var reportError = function (message) {
+        message = $.svg.local.errorLoadingText + ': ' + message;
+        if (settings.onLoad) {
+          settings.onLoad.apply(wrapper._container || wrapper._svg,
+              [wrapper, message]);
+        }
+        else {
+          wrapper.text(null, 10, 20, message);
+        }
+      };
+      // Create a DOM from SVG content
+      var loadXML4IE = function (data) {
+        var xml = new ActiveXObject('Microsoft.XMLDOM');
+        xml.validateOnParse = false;
+        xml.resolveExternals = false;
+        xml.async = false;
+        xml.loadXML(data);
+        if (xml.parseError.errorCode != 0) {
+          reportError(xml.parseError.reason);
+          return null;
+        }
+        return xml;
+      };
+      // Load the SVG DOM
+      var loadSVG = function (data) {
+        if (!data) {
+          return;
+        }
+        if (data.documentElement.nodeName != 'svg') {
+          var errors = data.getElementsByTagName('parsererror');
+          var messages = (errors.length ? errors[0].getElementsByTagName('div')
+              : []); // Safari
+          reportError(!errors.length ? '???' : (messages.length ? messages[0]
+              : errors[0]).firstChild.nodeValue);
+          return;
+        }
+        var parent = (settings.parent ? $(settings.parent)[0] : wrapper._svg);
+        var attrs = {};
+        for (var i = 0; i < data.documentElement.attributes.length; i++) {
+          var attr = data.documentElement.attributes.item(i);
+          if (!(attr.nodeName == 'version' || attr.nodeName.substring(0, 5)
+                  == 'xmlns')) {
+            attrs[attr.nodeName] = attr.nodeValue;
+          }
+        }
+        wrapper.configure(parent, attrs, !settings.parent);
+        var nodes = data.documentElement.childNodes;
+        for (var i = 0; i < nodes.length; i++) {
+          try {
+            if ($.svg._renesis) {
+              throw 'Force traversal';
+            }
+            parent.appendChild(
+                wrapper._svg.ownerDocument.importNode(nodes[i], true));
+            if (nodes[i].nodeName == 'script') {
+              $.globalEval(nodes[i].textContent);
+            }
+          }
+          catch (e) {
+            wrapper.add(parent, nodes[i]);
+          }
+        }
+        if (!settings.changeSize) {
+          wrapper.configure(parent, {width: size[0], height: size[1]});
+        }
+        if (settings.onLoad) {
+          settings.onLoad.apply(wrapper._container || wrapper._svg, [wrapper]);
+        }
+      };
+      if (url.match('<svg')) { // Inline SVG
+        loadSVG(
+            $.browser.msie ? loadXML4IE(url) : new DOMParser().parseFromString(
+                url, 'text/xml'));
+      }
+      else { // Remote SVG
+        $.ajax({
+          url: url, dataType: ($.browser.msie ? 'text' : 'xml'),
+          success: function (xml) {
+            loadSVG($.browser.msie ? loadXML4IE(xml) : xml);
+          }, error: function (http, message, exc) {
+            reportError(message + (exc ? ' ' + exc.message : ''));
+          }
+        });
+      }
+      return this;
+    },
+
+    /* Delete a specified node.
+       @param  node  (element or jQuery) the drawing node to remove
+       @return  (SVGWrapper) this root */
+    remove: function (node) {
+      node = (node.jquery ? node[0] : node);
+      node.parentNode.removeChild(node);
+      return this;
+    },
+
+    /* Delete everything in the current document.
+       @param  attrsToo  (boolean) true to clear any root attributes as well,
+                         false to leave them (optional)
+       @return  (SVGWrapper) this root */
+    clear: function (attrsToo) {
+      if (attrsToo) {
+        this.configure({}, true);
+      }
+      while (this._svg.firstChild) {
+        this._svg.removeChild(this._svg.firstChild);
+      }
+      return this;
+    },
+
+    /* Serialise the current diagram into an SVG text document.
+       @param  node  (SVG element) the starting node (optional)
+       @return  (string) the SVG as text */
+    toSVG: function (node) {
+      node = node || this._svg;
+      return (typeof XMLSerializer == 'undefined' ? this._toSVG(node)
+          : new XMLSerializer().serializeToString(node));
+    },
+
+    /* Serialise one node in the SVG hierarchy. */
+    _toSVG: function (node) {
+      var svgDoc = '';
+      if (!node) {
+        return svgDoc;
+      }
+      if (node.nodeType == 3) { // Text
+        svgDoc = node.nodeValue;
+      }
+      else if (node.nodeType == 4) { // CDATA
+        svgDoc = '<![CDATA[' + node.nodeValue + ']]>';
+      }
+      else { // Element
+        svgDoc = '<' + node.nodeName;
+        if (node.attributes) {
+          for (var i = 0; i < node.attributes.length; i++) {
+            var attr = node.attributes.item(i);
+            if (!($.trim(attr.nodeValue) == '' || attr.nodeValue.match(
+                    /^\[object/) ||
+                    attr.nodeValue.match(/^function/))) {
+              svgDoc += ' ' + (attr.namespaceURI == $.svg.xlinkNS ? 'xlink:'
+                  : '') +
+                  attr.nodeName + '="' + attr.nodeValue + '"';
+            }
+          }
+        }
+        if (node.firstChild) {
+          svgDoc += '>';
+          var child = node.firstChild;
+          while (child) {
+            svgDoc += this._toSVG(child);
+            child = child.nextSibling;
+          }
+          svgDoc += '</' + node.nodeName + '>';
+        }
+        else {
+          svgDoc += '/>';
+        }
+      }
+      return svgDoc;
+    }
+  });
+
+  /* Helper to generate an SVG path.
+     Obtain an instance from the SVGWrapper object.
+     String calls together to generate the path and use its value:
+     var path = root.createPath();
+     root.path(null, path.move(100, 100).line(300, 100).line(200, 300).close(), {fill: 'red'});
+     or
+     root.path(null, path.move(100, 100).line([[300, 100], [200, 300]]).close(), {fill: 'red'}); */
+  function SVGPath() {
+    this._path = '';
+  }
+
+  $.extend(SVGPath.prototype, {
+    /* Prepare to create a new path.
+       @return  (SVGPath) this path */
+    reset: function () {
+      this._path = '';
+      return this;
+    },
+
+    /* Move the pointer to a position.
+       @param  x         (number) x-coordinate to move to or
+                         (number[][]) x-/y-coordinates to move to
+       @param  y         (number) y-coordinate to move to (omitted if x is array)
+       @param  relative  (boolean) true for coordinates relative to the current point,
+                         false for coordinates being absolute
+       @return  (SVGPath) this path */
+    move: function (x, y, relative) {
+      relative = (isArray(x) ? y : relative);
+      return this._coords((relative ? 'm' : 'M'), x, y);
+    },
+
+    /* Draw a line to a position.
+       @param  x         (number) x-coordinate to move to or
+                         (number[][]) x-/y-coordinates to move to
+       @param  y         (number) y-coordinate to move to (omitted if x is array)
+       @param  relative  (boolean) true for coordinates relative to the current point,
+                         false for coordinates being absolute
+       @return  (SVGPath) this path */
+    line: function (x, y, relative) {
+      relative = (isArray(x) ? y : relative);
+      return this._coords((relative ? 'l' : 'L'), x, y);
+    },
+
+    /* Draw a horizontal line to a position.
+       @param  x         (number) x-coordinate to draw to or
+                         (number[]) x-coordinates to draw to
+       @param  relative  (boolean) true for coordinates relative to the current point,
+                         false for coordinates being absolute
+       @return  (SVGPath) this path */
+    horiz: function (x, relative) {
+      this._path += (relative ? 'h' : 'H') + (isArray(x) ? x.join(' ') : x);
+      return this;
+    },
+
+    /* Draw a vertical line to a position.
+       @param  y         (number) y-coordinate to draw to or
+                         (number[]) y-coordinates to draw to
+       @param  relative  (boolean) true for coordinates relative to the current point,
+                         false for coordinates being absolute
+       @return  (SVGPath) this path */
+    vert: function (y, relative) {
+      this._path += (relative ? 'v' : 'V') + (isArray(y) ? y.join(' ') : y);
+      return this;
+    },
+
+    /* Draw a cubic Bézier curve.
+       @param  x1        (number) x-coordinate of beginning control point or
+                         (number[][]) x-/y-coordinates of control and end points to draw to
+       @param  y1        (number) y-coordinate of beginning control point (omitted if x1 is array)
+       @param  x2        (number) x-coordinate of ending control point (omitted if x1 is array)
+       @param  y2        (number) y-coordinate of ending control point (omitted if x1 is array)
+       @param  x         (number) x-coordinate of curve end (omitted if x1 is array)
+       @param  y         (number) y-coordinate of curve end (omitted if x1 is array)
+       @param  relative  (boolean) true for coordinates relative to the current point,
+                         false for coordinates being absolute
+       @return  (SVGPath) this path */
+    curveC: function (x1, y1, x2, y2, x, y, relative) {
+      relative = (isArray(x1) ? y1 : relative);
+      return this._coords((relative ? 'c' : 'C'), x1, y1, x2, y2, x, y);
+    },
+
+    /* Continue a cubic Bézier curve.
+       Starting control point is the reflection of the previous end control point.
+       @param  x2        (number) x-coordinate of ending control point or
+                         (number[][]) x-/y-coordinates of control and end points to draw to
+       @param  y2        (number) y-coordinate of ending control point (omitted if x2 is array)
+       @param  x         (number) x-coordinate of curve end (omitted if x2 is array)
+       @param  y         (number) y-coordinate of curve end (omitted if x2 is array)
+       @param  relative  (boolean) true for coordinates relative to the current point,
+                         false for coordinates being absolute
+       @return  (SVGPath) this path */
+    smoothC: function (x2, y2, x, y, relative) {
+      relative = (isArray(x2) ? y2 : relative);
+      return this._coords((relative ? 's' : 'S'), x2, y2, x, y);
+    },
+
+    /* Draw a quadratic Bézier curve.
+       @param  x1        (number) x-coordinate of control point or
+                         (number[][]) x-/y-coordinates of control and end points to draw to
+       @param  y1        (number) y-coordinate of control point (omitted if x1 is array)
+       @param  x         (number) x-coordinate of curve end (omitted if x1 is array)
+       @param  y         (number) y-coordinate of curve end (omitted if x1 is array)
+       @param  relative  (boolean) true for coordinates relative to the current point,
+                         false for coordinates being absolute
+       @return  (SVGPath) this path */
+    curveQ: function (x1, y1, x, y, relative) {
+      relative = (isArray(x1) ? y1 : relative);
+      return this._coords((relative ? 'q' : 'Q'), x1, y1, x, y);
+    },
+
+    /* Continue a quadratic Bézier curve.
+       Control point is the reflection of the previous control point.
+       @param  x         (number) x-coordinate of curve end or
+                         (number[][]) x-/y-coordinates of points to draw to
+       @param  y         (number) y-coordinate of curve end (omitted if x is array)
+       @param  relative  (boolean) true for coordinates relative to the current point,
+                         false for coordinates being absolute
+       @return  (SVGPath) this path */
+    smoothQ: function (x, y, relative) {
+      relative = (isArray(x) ? y : relative);
+      return this._coords((relative ? 't' : 'T'), x, y);
+    },
+
+    /* Generate a path command with (a list of) coordinates. */
+    _coords: function (cmd, x1, y1, x2, y2, x3, y3) {
+      if (isArray(x1)) {
+        for (var i = 0; i < x1.length; i++) {
+          var cs = x1[i];
+          this._path += (i == 0 ? cmd : ' ') + cs[0] + ',' + cs[1] +
+              (cs.length < 4 ? '' : ' ' + cs[2] + ',' + cs[3] +
+                  (cs.length < 6 ? '' : ' ' + cs[4] + ',' + cs[5]));
+        }
+      }
+      else {
+        this._path += cmd + x1 + ',' + y1 +
+            (x2 == null ? '' : ' ' + x2 + ',' + y2 +
+                (x3 == null ? '' : ' ' + x3 + ',' + y3));
+      }
+      return this;
+    },
+
+    /* Draw an arc to a position.
+       @param  rx         (number) x-radius of arc or
+                          (number/boolean[][]) x-/y-coordinates and flags for points to draw to
+       @param  ry         (number) y-radius of arc (omitted if rx is array)
+       @param  xRotate    (number) x-axis rotation (degrees, clockwise) (omitted if rx is array)
+       @param  large      (boolean) true to draw the large part of the arc,
+                          false to draw the small part (omitted if rx is array)
+       @param  clockwise  (boolean) true to draw the clockwise arc,
+                          false to draw the anti-clockwise arc (omitted if rx is array)
+       @param  x          (number) x-coordinate of arc end (omitted if rx is array)
+       @param  y          (number) y-coordinate of arc end (omitted if rx is array)
+       @param  relative   (boolean) true for coordinates relative to the current point,
+                          false for coordinates being absolute
+       @return  (SVGPath) this path */
+    arc: function (rx, ry, xRotate, large, clockwise, x, y, relative) {
+      relative = (isArray(rx) ? ry : relative);
+      this._path += (relative ? 'a' : 'A');
+      if (isArray(rx)) {
+        for (var i = 0; i < rx.length; i++) {
+          var cs = rx[i];
+          this._path += (i == 0 ? '' : ' ') + cs[0] + ',' + cs[1] + ' ' +
+              cs[2] + ' ' + (cs[3] ? '1' : '0') + ',' +
+              (cs[4] ? '1' : '0') + ' ' + cs[5] + ',' + cs[6];
+        }
+      }
+      else {
+        this._path += rx + ',' + ry + ' ' + xRotate + ' ' +
+            (large ? '1' : '0') + ',' + (clockwise ? '1' : '0') + ' ' + x + ','
+            + y;
+      }
+      return this;
+    },
+
+    /* Close the current path.
+       @return  (SVGPath) this path */
+    close: function () {
+      this._path += 'z';
+      return this;
+    },
+
+    /* Return the string rendering of the specified path.
+       @return  (string) stringified path */
+    path: function () {
+      return this._path;
+    }
+  });
+
+  SVGPath.prototype.moveTo = SVGPath.prototype.move;
+  SVGPath.prototype.lineTo = SVGPath.prototype.line;
+  SVGPath.prototype.horizTo = SVGPath.prototype.horiz;
+  SVGPath.prototype.vertTo = SVGPath.prototype.vert;
+  SVGPath.prototype.curveCTo = SVGPath.prototype.curveC;
+  SVGPath.prototype.smoothCTo = SVGPath.prototype.smoothC;
+  SVGPath.prototype.curveQTo = SVGPath.prototype.curveQ;
+  SVGPath.prototype.smoothQTo = SVGPath.prototype.smoothQ;
+  SVGPath.prototype.arcTo = SVGPath.prototype.arc;
+
+  /* Helper to generate an SVG text object.
+     Obtain an instance from the SVGWrapper object.
+     String calls together to generate the text and use its value:
+     var text = root.createText();
+     root.text(null, x, y, text.string('This is ').
+       span('red', {fill: 'red'}).string('!'), {fill: 'blue'}); */
+  function SVGText() {
+    this._parts = []; // The components of the text object
+  }
+
+  $.extend(SVGText.prototype, {
+    /* Prepare to create a new text object.
+       @return  (SVGText) this text */
+    reset: function () {
+      this._parts = [];
+      return this;
+    },
+
+    /* Add a straight string value.
+       @param  value  (string) the actual text
+       @return  (SVGText) this text object */
+    string: function (value) {
+      this._parts[this._parts.length] = ['text', value];
+      return this;
+    },
+
+    /* Add a separate text span that has its own settings.
+       @param  value     (string) the actual text
+       @param  settings  (object) the settings for this text
+       @return  (SVGText) this text object */
+    span: function (value, settings) {
+      this._parts[this._parts.length] = ['tspan', value, settings];
+      return this;
+    },
+
+    /* Add a reference to a previously defined text string.
+       @param  id        (string) the ID of the actual text
+       @param  settings  (object) the settings for this text
+       @return  (SVGText) this text object */
+    ref: function (id, settings) {
+      this._parts[this._parts.length] = ['tref', id, settings];
+      return this;
+    },
+
+    /* Add text drawn along a path.
+       @param  id        (string) the ID of the path
+       @param  value     (string) the actual text
+       @param  settings  (object) the settings for this text
+       @return  (SVGText) this text object */
+    path: function (id, value, settings) {
+      this._parts[this._parts.length] = ['textpath', value,
+        $.extend({href: id}, settings || {})];
+      return this;
+    }
+  });
+
+  /* Attach the SVG functionality to a jQuery selection.
+     @param  command  (string) the command to run (optional, default 'attach')
+     @param  options  (object) the new settings to use for these SVG instances
+     @return jQuery (object) for chaining further calls */
+  $.fn.svg = function (options) {
+    var otherArgs = Array.prototype.slice.call(arguments, 1);
+    if (typeof options == 'string' && options == 'get') {
+      return $.svg['_' + options + 'SVG'].apply($.svg,
+          [this[0]].concat(otherArgs));
+    }
+    return this.each(function () {
+      if (typeof options == 'string') {
+        $.svg['_' + options + 'SVG'].apply($.svg, [this].concat(otherArgs));
+      }
+      else {
+        $.svg._attachSVG(this, options || {});
+      }
+    });
+  };
+
+  /* Determine whether an object is an array. */
+  function isArray(a) {
+    return (a && a.constructor == Array);
+  }
 
 // Singleton primary SVG interface
-$.svg = new SVGManager();
+  $.svg = new SVGManager();
 
 })(jQuery);
diff --git a/azkaban-web-server/src/web/js/jquery.svgdom.js b/azkaban-web-server/src/web/js/jquery.svgdom.js
index b5ad8af..da19c58 100644
--- a/azkaban-web-server/src/web/js/jquery.svgdom.js
+++ b/azkaban-web-server/src/web/js/jquery.svgdom.js
@@ -1,406 +1,427 @@
 /* http://keith-wood.name/svg.html
    jQuery DOM compatibility for jQuery SVG v1.4.5.
    Written by Keith Wood (kbwood{at}iinet.com.au) April 2009.
-   Dual licensed under the GPL (http://dev.jquery.com/browser/trunk/jquery/GPL-LICENSE.txt) and 
-   MIT (http://dev.jquery.com/browser/trunk/jquery/MIT-LICENSE.txt) licenses. 
+   Dual licensed under the GPL (http://dev.jquery.com/browser/trunk/jquery/GPL-LICENSE.txt) and
+   MIT (http://dev.jquery.com/browser/trunk/jquery/MIT-LICENSE.txt) licenses.
    Please attribute the author if you use it. */
 
-(function($) { // Hide scope, no $ conflict
-
-/* Support adding class names to SVG nodes. */
-$.fn.addClass = function(origAddClass) {
-	return function(classNames) {
-		classNames = classNames || '';
-		return this.each(function() {
-			if ($.svg.isSVGElem(this)) {
-				var node = this;
-				$.each(classNames.split(/\s+/), function(i, className) {
-					var classes = (node.className ? node.className.baseVal : node.getAttribute('class'));
-					if ($.inArray(className, classes.split(/\s+/)) == -1) {
-						classes += (classes ? ' ' : '') + className;
-						(node.className ? node.className.baseVal = classes :
-							node.setAttribute('class',  classes));
-					}
-				});
-			}
-			else {
-				origAddClass.apply($(this), [classNames]);
-			}
-		});
-	};
-}($.fn.addClass);
-
-/* Support removing class names from SVG nodes. */
-$.fn.removeClass = function(origRemoveClass) {
-	return function(classNames) {
-		classNames = classNames || '';
-		return this.each(function() {
-			if ($.svg.isSVGElem(this)) {
-				var node = this;
-				$.each(classNames.split(/\s+/), function(i, className) {
-					var classes = (node.className ? node.className.baseVal : node.getAttribute('class'));
-					classes = $.grep(classes.split(/\s+/), function(n, i) { return n != className; }).
-						join(' ');
-					(node.className ? node.className.baseVal = classes :
-						node.setAttribute('class', classes));
-				});
-			}
-			else {
-				origRemoveClass.apply($(this), [classNames]);
-			}
-		});
-	};
-}($.fn.removeClass);
-
-/* Support toggling class names on SVG nodes. */
-$.fn.toggleClass = function(origToggleClass) {
-	return function(className, state) {
-		return this.each(function() {
-			if ($.svg.isSVGElem(this)) {
-				if (typeof state !== 'boolean') {
-					state = !$(this).hasClass(className);
-				}
-				$(this)[(state ? 'add' : 'remove') + 'Class'](className);
-			}
-			else {
-				origToggleClass.apply($(this), [className, state]);
-			}
-		});
-	};
-}($.fn.toggleClass);
-
-/* Support checking class names on SVG nodes. */
-$.fn.hasClass = function(origHasClass) {
-	return function(className) {
-		className = className || '';
-		var found = false;
-		this.each(function() {
-			if ($.svg.isSVGElem(this)) {
-				var classes = (this.className ? this.className.baseVal :
-					this.getAttribute('class')).split(/\s+/);
-				found = ($.inArray(className, classes) > -1);
-			}
-			else {
-				found = (origHasClass.apply($(this), [className]));
-			}
-			return !found;
-		});
-		return found;
-	};
-}($.fn.hasClass);
-
-/* Support attributes on SVG nodes. */
-$.fn.attr = function(origAttr) {
-	return function(name, value, type) {
-		if (typeof name === 'string' && value === undefined) {
-			var val = origAttr.apply(this, [name]);
-			if (val && val.baseVal && val.baseVal.numberOfItems != null) { // Multiple values
-				value = '';
-				val = val.baseVal;
-				if (name == 'transform') {
-					for (var i = 0; i < val.numberOfItems; i++) {
-						var item = val.getItem(i);
-						switch (item.type) {
-							case 1: value += ' matrix(' + item.matrix.a + ',' + item.matrix.b + ',' +
-										item.matrix.c + ',' + item.matrix.d + ',' +
-										item.matrix.e + ',' + item.matrix.f + ')';
-									break;
-							case 2: value += ' translate(' + item.matrix.e + ',' + item.matrix.f + ')'; break;
-							case 3: value += ' scale(' + item.matrix.a + ',' + item.matrix.d + ')'; break;
-							case 4: value += ' rotate(' + item.angle + ')'; break; // Doesn't handle new origin
-							case 5: value += ' skewX(' + item.angle + ')'; break;
-							case 6: value += ' skewY(' + item.angle + ')'; break;
-						}
-					}
-					val = value.substring(1);
-				}
-				else {
-					val = val.getItem(0).valueAsString;
-				}
-			}
-			return (val && val.baseVal ? val.baseVal.valueAsString : val);
-		}
-
-		var options = name;
-		if (typeof name === 'string') {
-			options = {};
-			options[name] = value;
-		}
-		return this.each(function() {
-			if ($.svg.isSVGElem(this)) {
-				for (var n in options) {
-					var val = ($.isFunction(options[n]) ? options[n]() : options[n]);
-					(type ? this.style[n] = val : this.setAttribute(n, val));
-				}
-			}
-			else {
-				origAttr.apply($(this), [name, value, type]);
-			}
-		});
-	};
-}($.fn.attr);
-
-/* Support removing attributes on SVG nodes. */
-$.fn.removeAttr = function(origRemoveAttr) {
-	return function(name) {
-		return this.each(function() {
-			if ($.svg.isSVGElem(this)) {
-				(this[name] && this[name].baseVal ? this[name].baseVal.value = '' :
-					this.setAttribute(name, ''));
-			}
-			else {
-				origRemoveAttr.apply($(this), [name]);
-			}
-		});
-	};
-}($.fn.removeAttr);
-
-/* Add numeric only properties. */
-$.extend($.cssNumber, {
-	'stopOpacity': true,
-	'strokeMitrelimit': true,
-	'strokeOpacity': true
-});
-
-/* Support retrieving CSS/attribute values on SVG nodes. */
-if ($.cssProps) {
-	$.css = function(origCSS) {
-		return function(elem, name, extra) {
-			var value = (name.match(/^svg.*/) ? $(elem).attr($.cssProps[name] || name) : '');
-			return value || origCSS(elem, name, extra);
-		};
-	}($.css);
-}
-  
-/* Determine if any nodes are SVG nodes. */
-function anySVG(checkSet) {
-	for (var i = 0; i < checkSet.length; i++) {
-		if (checkSet[i].nodeType == 1 && checkSet[i].namespaceURI == $.svg.svgNS) {
-			return true;
-		}
-	}
-	return false;
-}
-
-/* Update Sizzle selectors. */
-
-$.expr.relative['+'] = function(origRelativeNext) {
-	return function(checkSet, part, isXML) {
-		origRelativeNext(checkSet, part, isXML || anySVG(checkSet));
-	};
-}($.expr.relative['+']);
-
-$.expr.relative['>'] = function(origRelativeChild) {
-	return function(checkSet, part, isXML) {
-		origRelativeChild(checkSet, part, isXML || anySVG(checkSet));
-	};
-}($.expr.relative['>']);
-
-$.expr.relative[''] = function(origRelativeDescendant) {
-	return function(checkSet, part, isXML) {
-		origRelativeDescendant(checkSet, part, isXML || anySVG(checkSet));
-	};
-}($.expr.relative['']);
-
-$.expr.relative['~'] = function(origRelativeSiblings) {
-	return function(checkSet, part, isXML) {
-		origRelativeSiblings(checkSet, part, isXML || anySVG(checkSet));
-	};
-}($.expr.relative['~']);
-
-$.expr.find.ID = function(origFindId) {
-	return function(match, context, isXML) {
-		return ($.svg.isSVGElem(context) ?
-			[context.ownerDocument.getElementById(match[1])] :
-			origFindId(match, context, isXML));
-	};
-}($.expr.find.ID);
-
-var div = document.createElement('div');
-div.appendChild(document.createComment(''));
-if (div.getElementsByTagName('*').length > 0) { // Make sure no comments are found
-	$.expr.find.TAG = function(match, context) {
-		var results = context.getElementsByTagName(match[1]);
-		if (match[1] === '*') { // Filter out possible comments
-			var tmp = [];
-			for (var i = 0; results[i] || results.item(i); i++) {
-				if ((results[i] || results.item(i)).nodeType === 1) {
-					tmp.push(results[i] || results.item(i));
-				}
-			}
-			results = tmp;
-		}
-		return results;
-	};
-}
-
-$.expr.preFilter.CLASS = function(match, curLoop, inplace, result, not, isXML) {
-	match = ' ' + match[1].replace(/\\/g, '') + ' ';
-	if (isXML) {
-		return match;
-	}
-	for (var i = 0, elem = {}; elem != null; i++) {
-		elem = curLoop[i];
-		if (!elem) {
-			try {
-				elem = curLoop.item(i);
-			}
-			catch (e) {
-				// Ignore
-			}
-		}
-		if (elem) {
-			var className = (!$.svg.isSVGElem(elem) ? elem.className :
-				(elem.className ? elem.className.baseVal : '') || elem.getAttribute('class'));
-			if (not ^ (className && (' ' + className + ' ').indexOf(match) > -1)) {
-				if (!inplace)
-					result.push(elem);
-			}
-			else if (inplace) {
-				curLoop[i] = false;
-			}
-		}
-	}
-	return false;
-};
-
-$.expr.filter.CLASS = function(elem, match) {
-	var className = (!$.svg.isSVGElem(elem) ? elem.className :
-		(elem.className ? elem.className.baseVal : elem.getAttribute('class')));
-	return (' ' + className + ' ').indexOf(match) > -1;
-};
-
-$.expr.filter.ATTR = function(origFilterAttr) {
-	return function(elem, match) {
-		var handler = null;
-		if ($.svg.isSVGElem(elem)) {
-			handler = match[1];
-			$.expr.attrHandle[handler] = function(elem){
-				var attr = elem.getAttribute(handler);
-				return attr && attr.baseVal || attr;
-			};
-		}
-		var filter = origFilterAttr(elem, match);
-		if (handler) {
-			$.expr.attrHandle[handler] = null;
-		}
-		return filter;
-	};
-}($.expr.filter.ATTR);
-
-/*
-	In the removeData function (line 1881, v1.7.2):
-
-				if ( jQuery.support.deleteExpando ) {
-					delete elem[ internalKey ];
-				} else {
-					try { // SVG
-						elem.removeAttribute( internalKey );
-					} catch (e) {
-						elem[ internalKey ] = null;
-					}
-				}
-
-	In the event.add function (line 2985, v1.7.2):
-
-				if ( !special.setup || special.setup.call( elem, data, namespaces, eventHandle ) === false ) {
-					// Bind the global event handler to the element
-					try { // SVG
-						elem.addEventListener( type, eventHandle, false );
-					} catch(e) {
-						if ( elem.attachEvent ) {
-							elem.attachEvent( "on" + type, eventHandle );
-						}
-					}
-				}
-
-	In the event.remove function (line 3074, v1.7.2):
-
-			if ( !special.teardown || special.teardown.call( elem, namespaces ) === false ) {
-				try { // SVG
-					elem.removeEventListener(type, elemData.handle, false);
-				}
-				catch (e) {
-					if (elem.detachEvent) {
-						elem.detachEvent("on" + type, elemData.handle);
-					}
-				}
-			}
-
-	In the event.fix function (line 3394, v1.7.2):
-
-		if (event.target.namespaceURI == 'http://www.w3.org/2000/svg') { // SVG
-			event.button = [1, 4, 2][event.button];
-		}
-
-		// 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 ) ) );
-		}
-
-	In the Sizzle function (line 4083, v1.7.2):
-
-	if ( toString.call(checkSet) === "[object Array]" ) {
-		if ( !prune ) {
-			results.push.apply( results, checkSet );
-
-		} else if ( context && context.nodeType === 1 ) {
-			for ( i = 0; checkSet[i] != null; i++ ) {
-				if ( checkSet[i] && (checkSet[i] === true || checkSet[i].nodeType === 1 && Sizzle.contains(context, checkSet[i])) ) {
-				results.push( set[i] || set.item(i) ); // SVG
-				}
-			}
-
-		} else {
-			for ( i = 0; checkSet[i] != null; i++ ) {
-				if ( checkSet[i] && checkSet[i].nodeType === 1 ) {
-					results.push( set[i] || set.item(i) ); // SVG
-				}
-			}
-		}
-	} else {...
-
-	In the fallback for the Sizzle makeArray function (line 4877, v1.7.2):
-
-	if ( toString.call(array) === "[object Array]" ) {
-		Array.prototype.push.apply( ret, array );
-
-	} else {
-		if ( typeof array.length === "number" ) {
-			for ( var l = array.length; i &lt; l; i++ ) {
-				ret.push( array[i] || array.item(i) ); // SVG
-			}
-
-		} else {
-			for ( ; array[i]; i++ ) {
-				ret.push( array[i] );
-			}
-		}
-	}
-
-	In the jQuery.cleandata function (line 6538, v1.7.2):
-
-				if ( deleteExpando ) {
-					delete elem[ jQuery.expando ];
-
-				} else {
-					try { // SVG
-						elem.removeAttribute( jQuery.expando );
-					} catch (e) {
-						// Ignore
-					}
-				}
-
-	In the fallback getComputedStyle function (line 6727, v1.7.2):
-
-		defaultView = (elem.ownerDocument ? elem.ownerDocument.defaultView : elem.defaultView); // SVG
-		if ( defaultView &&
-		(computedStyle = defaultView.getComputedStyle( elem, null )) ) {
-
-			ret = computedStyle.getPropertyValue( name );
-			...
-
-*/
+(function ($) { // Hide scope, no $ conflict
+
+  /* Support adding class names to SVG nodes. */
+  $.fn.addClass = function (origAddClass) {
+    return function (classNames) {
+      classNames = classNames || '';
+      return this.each(function () {
+        if ($.svg.isSVGElem(this)) {
+          var node = this;
+          $.each(classNames.split(/\s+/), function (i, className) {
+            var classes = (node.className ? node.className.baseVal
+                : node.getAttribute('class'));
+            if ($.inArray(className, classes.split(/\s+/)) == -1) {
+              classes += (classes ? ' ' : '') + className;
+              (node.className ? node.className.baseVal = classes
+                  : node.setAttribute('class', classes));
+            }
+          });
+        }
+        else {
+          origAddClass.apply($(this), [classNames]);
+        }
+      });
+    };
+  }($.fn.addClass);
+
+  /* Support removing class names from SVG nodes. */
+  $.fn.removeClass = function (origRemoveClass) {
+    return function (classNames) {
+      classNames = classNames || '';
+      return this.each(function () {
+        if ($.svg.isSVGElem(this)) {
+          var node = this;
+          $.each(classNames.split(/\s+/), function (i, className) {
+            var classes = (node.className ? node.className.baseVal
+                : node.getAttribute('class'));
+            classes = $.grep(classes.split(/\s+/), function (n, i) {
+              return n != className;
+            }).join(' ');
+            (node.className ? node.className.baseVal = classes
+                : node.setAttribute('class', classes));
+          });
+        }
+        else {
+          origRemoveClass.apply($(this), [classNames]);
+        }
+      });
+    };
+  }($.fn.removeClass);
+
+  /* Support toggling class names on SVG nodes. */
+  $.fn.toggleClass = function (origToggleClass) {
+    return function (className, state) {
+      return this.each(function () {
+        if ($.svg.isSVGElem(this)) {
+          if (typeof state !== 'boolean') {
+            state = !$(this).hasClass(className);
+          }
+          $(this)[(state ? 'add' : 'remove') + 'Class'](className);
+        }
+        else {
+          origToggleClass.apply($(this), [className, state]);
+        }
+      });
+    };
+  }($.fn.toggleClass);
+
+  /* Support checking class names on SVG nodes. */
+  $.fn.hasClass = function (origHasClass) {
+    return function (className) {
+      className = className || '';
+      var found = false;
+      this.each(function () {
+        if ($.svg.isSVGElem(this)) {
+          var classes = (this.className ? this.className.baseVal
+              : this.getAttribute('class')).split(/\s+/);
+          found = ($.inArray(className, classes) > -1);
+        }
+        else {
+          found = (origHasClass.apply($(this), [className]));
+        }
+        return !found;
+      });
+      return found;
+    };
+  }($.fn.hasClass);
+
+  /* Support attributes on SVG nodes. */
+  $.fn.attr = function (origAttr) {
+    return function (name, value, type) {
+      if (typeof name === 'string' && value === undefined) {
+        var val = origAttr.apply(this, [name]);
+        if (val && val.baseVal && val.baseVal.numberOfItems != null) { // Multiple values
+          value = '';
+          val = val.baseVal;
+          if (name == 'transform') {
+            for (var i = 0; i < val.numberOfItems; i++) {
+              var item = val.getItem(i);
+              switch (item.type) {
+                case 1:
+                  value += ' matrix(' + item.matrix.a + ',' + item.matrix.b
+                      + ',' +
+                      item.matrix.c + ',' + item.matrix.d + ',' +
+                      item.matrix.e + ',' + item.matrix.f + ')';
+                  break;
+                case 2:
+                  value += ' translate(' + item.matrix.e + ',' + item.matrix.f
+                      + ')';
+                  break;
+                case 3:
+                  value += ' scale(' + item.matrix.a + ',' + item.matrix.d
+                      + ')';
+                  break;
+                case 4:
+                  value += ' rotate(' + item.angle + ')';
+                  break; // Doesn't handle new origin
+                case 5:
+                  value += ' skewX(' + item.angle + ')';
+                  break;
+                case 6:
+                  value += ' skewY(' + item.angle + ')';
+                  break;
+              }
+            }
+            val = value.substring(1);
+          }
+          else {
+            val = val.getItem(0).valueAsString;
+          }
+        }
+        return (val && val.baseVal ? val.baseVal.valueAsString : val);
+      }
+
+      var options = name;
+      if (typeof name === 'string') {
+        options = {};
+        options[name] = value;
+      }
+      return this.each(function () {
+        if ($.svg.isSVGElem(this)) {
+          for (var n in options) {
+            var val = ($.isFunction(options[n]) ? options[n]() : options[n]);
+            (type ? this.style[n] = val : this.setAttribute(n, val));
+          }
+        }
+        else {
+          origAttr.apply($(this), [name, value, type]);
+        }
+      });
+    };
+  }($.fn.attr);
+
+  /* Support removing attributes on SVG nodes. */
+  $.fn.removeAttr = function (origRemoveAttr) {
+    return function (name) {
+      return this.each(function () {
+        if ($.svg.isSVGElem(this)) {
+          (this[name] && this[name].baseVal ? this[name].baseVal.value = ''
+              : this.setAttribute(name, ''));
+        }
+        else {
+          origRemoveAttr.apply($(this), [name]);
+        }
+      });
+    };
+  }($.fn.removeAttr);
+
+  /* Add numeric only properties. */
+  $.extend($.cssNumber, {
+    'stopOpacity': true,
+    'strokeMitrelimit': true,
+    'strokeOpacity': true
+  });
+
+  /* Support retrieving CSS/attribute values on SVG nodes. */
+  if ($.cssProps) {
+    $.css = function (origCSS) {
+      return function (elem, name, extra) {
+        var value = (name.match(/^svg.*/) ? $(elem).attr($.cssProps[name]
+            || name) : '');
+        return value || origCSS(elem, name, extra);
+      };
+    }($.css);
+  }
+
+  /* Determine if any nodes are SVG nodes. */
+  function anySVG(checkSet) {
+    for (var i = 0; i < checkSet.length; i++) {
+      if (checkSet[i].nodeType == 1 && checkSet[i].namespaceURI
+          == $.svg.svgNS) {
+        return true;
+      }
+    }
+    return false;
+  }
+
+  /* Update Sizzle selectors. */
+
+  $.expr.relative['+'] = function (origRelativeNext) {
+    return function (checkSet, part, isXML) {
+      origRelativeNext(checkSet, part, isXML || anySVG(checkSet));
+    };
+  }($.expr.relative['+']);
+
+  $.expr.relative['>'] = function (origRelativeChild) {
+    return function (checkSet, part, isXML) {
+      origRelativeChild(checkSet, part, isXML || anySVG(checkSet));
+    };
+  }($.expr.relative['>']);
+
+  $.expr.relative[''] = function (origRelativeDescendant) {
+    return function (checkSet, part, isXML) {
+      origRelativeDescendant(checkSet, part, isXML || anySVG(checkSet));
+    };
+  }($.expr.relative['']);
+
+  $.expr.relative['~'] = function (origRelativeSiblings) {
+    return function (checkSet, part, isXML) {
+      origRelativeSiblings(checkSet, part, isXML || anySVG(checkSet));
+    };
+  }($.expr.relative['~']);
+
+  $.expr.find.ID = function (origFindId) {
+    return function (match, context, isXML) {
+      return ($.svg.isSVGElem(context) ? [context.ownerDocument.getElementById(
+          match[1])] : origFindId(match, context, isXML));
+    };
+  }($.expr.find.ID);
+
+  var div = document.createElement('div');
+  div.appendChild(document.createComment(''));
+  if (div.getElementsByTagName('*').length > 0) { // Make sure no comments are found
+    $.expr.find.TAG = function (match, context) {
+      var results = context.getElementsByTagName(match[1]);
+      if (match[1] === '*') { // Filter out possible comments
+        var tmp = [];
+        for (var i = 0; results[i] || results.item(i); i++) {
+          if ((results[i] || results.item(i)).nodeType === 1) {
+            tmp.push(results[i] || results.item(i));
+          }
+        }
+        results = tmp;
+      }
+      return results;
+    };
+  }
+
+  $.expr.preFilter.CLASS = function (match, curLoop, inplace, result, not,
+      isXML) {
+    match = ' ' + match[1].replace(/\\/g, '') + ' ';
+    if (isXML) {
+      return match;
+    }
+    for (var i = 0, elem = {}; elem != null; i++) {
+      elem = curLoop[i];
+      if (!elem) {
+        try {
+          elem = curLoop.item(i);
+        }
+        catch (e) {
+          // Ignore
+        }
+      }
+      if (elem) {
+        var className = (!$.svg.isSVGElem(elem) ? elem.className
+            : (elem.className ? elem.className.baseVal : '')
+            || elem.getAttribute('class'));
+        if (not ^ (className && (' ' + className + ' ').indexOf(match) > -1)) {
+          if (!inplace) {
+            result.push(elem);
+          }
+        }
+        else if (inplace) {
+          curLoop[i] = false;
+        }
+      }
+    }
+    return false;
+  };
+
+  $.expr.filter.CLASS = function (elem, match) {
+    var className = (!$.svg.isSVGElem(elem) ? elem.className : (elem.className
+        ? elem.className.baseVal : elem.getAttribute('class')));
+    return (' ' + className + ' ').indexOf(match) > -1;
+  };
+
+  $.expr.filter.ATTR = function (origFilterAttr) {
+    return function (elem, match) {
+      var handler = null;
+      if ($.svg.isSVGElem(elem)) {
+        handler = match[1];
+        $.expr.attrHandle[handler] = function (elem) {
+          var attr = elem.getAttribute(handler);
+          return attr && attr.baseVal || attr;
+        };
+      }
+      var filter = origFilterAttr(elem, match);
+      if (handler) {
+        $.expr.attrHandle[handler] = null;
+      }
+      return filter;
+    };
+  }($.expr.filter.ATTR);
+
+  /*
+    In the removeData function (line 1881, v1.7.2):
+
+          if ( jQuery.support.deleteExpando ) {
+            delete elem[ internalKey ];
+          } else {
+            try { // SVG
+              elem.removeAttribute( internalKey );
+            } catch (e) {
+              elem[ internalKey ] = null;
+            }
+          }
+
+    In the event.add function (line 2985, v1.7.2):
+
+          if ( !special.setup || special.setup.call( elem, data, namespaces, eventHandle ) === false ) {
+            // Bind the global event handler to the element
+            try { // SVG
+              elem.addEventListener( type, eventHandle, false );
+            } catch(e) {
+              if ( elem.attachEvent ) {
+                elem.attachEvent( "on" + type, eventHandle );
+              }
+            }
+          }
+
+    In the event.remove function (line 3074, v1.7.2):
+
+        if ( !special.teardown || special.teardown.call( elem, namespaces ) === false ) {
+          try { // SVG
+            elem.removeEventListener(type, elemData.handle, false);
+          }
+          catch (e) {
+            if (elem.detachEvent) {
+              elem.detachEvent("on" + type, elemData.handle);
+            }
+          }
+        }
+
+    In the event.fix function (line 3394, v1.7.2):
+
+      if (event.target.namespaceURI == 'http://www.w3.org/2000/svg') { // SVG
+        event.button = [1, 4, 2][event.button];
+      }
+
+      // 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 ) ) );
+      }
+
+    In the Sizzle function (line 4083, v1.7.2):
+
+    if ( toString.call(checkSet) === "[object Array]" ) {
+      if ( !prune ) {
+        results.push.apply( results, checkSet );
+
+      } else if ( context && context.nodeType === 1 ) {
+        for ( i = 0; checkSet[i] != null; i++ ) {
+          if ( checkSet[i] && (checkSet[i] === true || checkSet[i].nodeType === 1 && Sizzle.contains(context, checkSet[i])) ) {
+          results.push( set[i] || set.item(i) ); // SVG
+          }
+        }
+
+      } else {
+        for ( i = 0; checkSet[i] != null; i++ ) {
+          if ( checkSet[i] && checkSet[i].nodeType === 1 ) {
+            results.push( set[i] || set.item(i) ); // SVG
+          }
+        }
+      }
+    } else {...
+
+    In the fallback for the Sizzle makeArray function (line 4877, v1.7.2):
+
+    if ( toString.call(array) === "[object Array]" ) {
+      Array.prototype.push.apply( ret, array );
+
+    } else {
+      if ( typeof array.length === "number" ) {
+        for ( var l = array.length; i &lt; l; i++ ) {
+          ret.push( array[i] || array.item(i) ); // SVG
+        }
+
+      } else {
+        for ( ; array[i]; i++ ) {
+          ret.push( array[i] );
+        }
+      }
+    }
+
+    In the jQuery.cleandata function (line 6538, v1.7.2):
+
+          if ( deleteExpando ) {
+            delete elem[ jQuery.expando ];
+
+          } else {
+            try { // SVG
+              elem.removeAttribute( jQuery.expando );
+            } catch (e) {
+              // Ignore
+            }
+          }
+
+    In the fallback getComputedStyle function (line 6727, v1.7.2):
+
+      defaultView = (elem.ownerDocument ? elem.ownerDocument.defaultView : elem.defaultView); // SVG
+      if ( defaultView &&
+      (computedStyle = defaultView.getComputedStyle( elem, null )) ) {
+
+        ret = computedStyle.getPropertyValue( name );
+        ...
+
+  */
 
 })(jQuery);
diff --git a/azkaban-web-server/src/web/js/jquery/jquery.autocomplete.css b/azkaban-web-server/src/web/js/jquery/jquery.autocomplete.css
index 91b6228..f00c511 100644
--- a/azkaban-web-server/src/web/js/jquery/jquery.autocomplete.css
+++ b/azkaban-web-server/src/web/js/jquery/jquery.autocomplete.css
@@ -1,48 +1,48 @@
 .ac_results {
-	padding: 0px;
-	border: 1px solid black;
-	background-color: white;
-	overflow: hidden;
-	z-index: 99999;
+  padding: 0px;
+  border: 1px solid black;
+  background-color: white;
+  overflow: hidden;
+  z-index: 99999;
 }
 
 .ac_results ul {
-	width: 100%;
-	list-style-position: outside;
-	list-style: none;
-	padding: 0;
-	margin: 0;
+  width: 100%;
+  list-style-position: outside;
+  list-style: none;
+  padding: 0;
+  margin: 0;
 }
 
 .ac_results li {
-	margin: 0px;
-	padding: 2px 5px;
-	cursor: default;
-	display: block;
-	/* 
-	if width will be 100% horizontal scrollbar will apear 
-	when scroll mode will be used
-	*/
-	/*width: 100%;*/
-	font: menu;
-	font-size: 12px;
-	/* 
-	it is very important, if line-height not setted or setted 
-	in relative units scroll will be broken in firefox
-	*/
-	line-height: 16px;
-	overflow: hidden;
+  margin: 0px;
+  padding: 2px 5px;
+  cursor: default;
+  display: block;
+  /*
+  if width will be 100% horizontal scrollbar will apear
+  when scroll mode will be used
+  */
+  /*width: 100%;*/
+  font: menu;
+  font-size: 12px;
+  /*
+  it is very important, if line-height not setted or setted
+  in relative units scroll will be broken in firefox
+  */
+  line-height: 16px;
+  overflow: hidden;
 }
 
 .ac_loading {
-	background: white url('indicator.gif') right center no-repeat;
+  background: white url('indicator.gif') right center no-repeat;
 }
 
 .ac_odd {
-	background-color: #eee;
+  background-color: #eee;
 }
 
 .ac_over {
-	background-color: #0A246A;
-	color: white;
+  background-color: #0A246A;
+  color: white;
 }
diff --git a/azkaban-web-server/src/web/js/jquery/jquery.contextMenu.css b/azkaban-web-server/src/web/js/jquery/jquery.contextMenu.css
index 229349a..d725b1a 100644
--- a/azkaban-web-server/src/web/js/jquery/jquery.contextMenu.css
+++ b/azkaban-web-server/src/web/js/jquery/jquery.contextMenu.css
@@ -1,62 +1,79 @@
 /* Generic context menu styles */
 .contextMenu {
-	position: absolute;
-	width: 250px;
-	z-index: 99999;
-	border: solid 1px #CCC;
-	background: #EEE;
-	padding: 0px;
-	margin: 0px;
-	display: none;
+  position: absolute;
+  width: 250px;
+  z-index: 99999;
+  border: solid 1px #CCC;
+  background: #EEE;
+  padding: 0px;
+  margin: 0px;
+  display: none;
 }
 
 .contextMenu li {
-	list-style: none;
-	padding: 0px;
-	margin: 0px;
+  list-style: none;
+  padding: 0px;
+  margin: 0px;
 }
 
 .contextMenu a {
-	color: #333;
-	text-decoration: none;
-	display: block;
-	line-height: 20px;
-	height: 20px;
-	background-position: 6px center;
-	background-repeat: no-repeat;
-	outline: none;
-	padding: 1px 5px;
-	padding-left: 28px;
+  color: #333;
+  text-decoration: none;
+  display: block;
+  line-height: 20px;
+  height: 20px;
+  background-position: 6px center;
+  background-repeat: no-repeat;
+  outline: none;
+  padding: 1px 5px;
+  padding-left: 28px;
 }
 
 .contextMenu li.hover a {
-	color: #FFF;
-	background-color: #3399FF;
+  color: #FFF;
+  background-color: #3399FF;
 }
 
 .contextMenu LI.disabled A {
-	color: #AAA;
-	cursor: default;
+  color: #AAA;
+  cursor: default;
 }
 
 .contextMenu LI.hover.disabled A {
-	background-color: transparent;
+  background-color: transparent;
 }
 
 .contextMenu LI.separator {
-	border-top: solid 1px #CCC;
+  border-top: solid 1px #CCC;
 }
 
 /*
 	Adding Icons
-	
+
 	You can add icons to the context menu by adding
 	classes to the respective LI element(s)
 */
 
-.contextMenu LI.edit A { background-image: url(images/page_white_edit.png); }
-.contextMenu LI.cut A { background-image: url(images/cut.png); }
-.contextMenu LI.copy A { background-image: url(images/page_white_copy.png); }
-.contextMenu LI.paste A { background-image: url(images/page_white_paste.png); }
-.contextMenu LI.delete A { background-image: url(images/page_white_delete.png); }
-.contextMenu LI.quit A { background-image: url(images/door.png); }
+.contextMenu LI.edit A {
+  background-image: url(images/page_white_edit.png);
+}
+
+.contextMenu LI.cut A {
+  background-image: url(images/cut.png);
+}
+
+.contextMenu LI.copy A {
+  background-image: url(images/page_white_copy.png);
+}
+
+.contextMenu LI.paste A {
+  background-image: url(images/page_white_paste.png);
+}
+
+.contextMenu LI.delete A {
+  background-image: url(images/page_white_delete.png);
+}
+
+.contextMenu LI.quit A {
+  background-image: url(images/door.png);
+}
diff --git a/azkaban-web-server/src/web/js/jquery/jquery.contextMenu.js b/azkaban-web-server/src/web/js/jquery/jquery.contextMenu.js
index dea2e41..91f897e 100644
--- a/azkaban-web-server/src/web/js/jquery/jquery.contextMenu.js
+++ b/azkaban-web-server/src/web/js/jquery/jquery.contextMenu.js
@@ -12,206 +12,251 @@
 // This plugin is dual-licensed under the GNU General Public License
 //   and the MIT License and is copyright A Beautiful Site, LLC.
 //
-if(jQuery)( function() {
-	$.extend($.fn, {
-		
-		contextMenu: function(o, callback) {
-			// Defaults
-			if( o.menu == undefined ) return false;
-			if( o.inSpeed == undefined ) o.inSpeed = 150;
-			if( o.outSpeed == undefined ) o.outSpeed = 75;
-			// 0 needs to be -1 for expected results (no fade)
-			if( o.inSpeed == 0 ) o.inSpeed = -1;
-			if( o.outSpeed == 0 ) o.outSpeed = -1;
-			// Loop each context menu
-			$(this).each( function() {
-				var el = $(this);
-				var offset = $(el).offset();
-				// Add contextMenu class
-				$('#' + o.menu).addClass('contextMenu');
-				// Simulate a true right click
-				$(this).mousedown( function(e) {
-					var evt = e;
-					if( evt.button == 2 ) {
-						evt.stopPropagation();
-					}
-
-					$(this).mouseup( function(e) {
-						if( e.button == 2 ) {
-							e.stopPropagation();
-						}
-	
-						var srcElement = $(this);
-						$(this).unbind('mouseup');
-						if( evt.button == 2 ) {
-							// Hide context menus that may be showing
-							$(".contextMenu").hide();
-							// Get this context menu
-							var menu = $('#' + o.menu);
-							
-							if( $(el).hasClass('disabled') ) return false;
-							
-							// Detect mouse position
-							var d = {}, x, y;
-							if( self.innerHeight ) {
-								d.pageYOffset = self.pageYOffset;
-								d.pageXOffset = self.pageXOffset;
-								d.innerHeight = self.innerHeight;
-								d.innerWidth = self.innerWidth;
-							} else if( document.documentElement &&
-								document.documentElement.clientHeight ) {
-								d.pageYOffset = document.documentElement.scrollTop;
-								d.pageXOffset = document.documentElement.scrollLeft;
-								d.innerHeight = document.documentElement.clientHeight;
-								d.innerWidth = document.documentElement.clientWidth;
-							} else if( document.body ) {
-								d.pageYOffset = document.body.scrollTop;
-								d.pageXOffset = document.body.scrollLeft;
-								d.innerHeight = document.body.clientHeight;
-								d.innerWidth = document.body.clientWidth;
-							}
-							(e.pageX) ? x = e.pageX : x = e.clientX + d.scrollLeft;
-							(e.pageY) ? y = e.pageY : y = e.clientY + d.scrollTop;
-							
-							// Show the menu
-							$(document).unbind('click');
-							$(menu).css({ top: y, left: x }).fadeIn(o.inSpeed);
-							// Hover events
-							$(menu).find('a').mouseover( function() {
-								$(menu).find('li.hover').removeClass('hover');
-								$(this).parent().addClass('hover');
-							}).mouseout( function() {
-								$(menu).find('li.hover').removeClass('hover');
-							});
-							
-							// Keyboard
-							$(document).keypress( function(e) {
-								switch( e.keyCode ) {
-									case 38: // up
-										if( $(menu).find('li.hover').size() == 0 ) {
-											$(menu).find('li:last').addClass('hover');
-										} else {
-											$(menu).find('li.hover').removeClass('hover').prevAll('li:not(.disabled)').eq(0).addClass('hover');
-											if( $(menu).find('li.hover').size() == 0 ) $(menu).find('li:last').addClass('hover');
-										}
-									break;
-									case 40: // down
-										if( $(menu).find('li.hover').size() == 0 ) {
-											$(menu).find('li:first').addClass('hover');
-										} else {
-											$(menu).find('li.hover').removeClass('hover').nextAll('li:not(.disabled)').eq(0).addClass('hover');
-											if( $(menu).find('li.hover').size() == 0 ) $(menu).find('li:first').addClass('hover');
-										}
-									break;
-									case 13: // enter
-										$(menu).find('li.hover a').trigger('click');
-									break;
-									case 27: // esc
-										$(document).trigger('click');
-									break
-								}
-							});
-							
-							// When items are selected
-							$('#' + o.menu).find('a').unbind('click');
-							$('#' + o.menu).find('li:not(.disabled) a').click( function() {
-								$(document).unbind('click').unbind('keypress');
-								$(".contextMenu").hide();
-								// Callback
-								if( callback ) callback( $(this).attr('href').substr(1), $(srcElement), {x: x - offset.left, y: y - offset.top, docX: x, docY: y} );
-								return false;
-							});
-							
-							// Hide bindings
-							setTimeout( function() { // Delay for Mozilla
-								$(document).click( function() {
-									$(document).unbind('click').unbind('keypress');
-									$(menu).fadeOut(o.outSpeed);
-									return false;
-								});
-							}, 0);
-						}
-					});
-				});
-				
-				// Disable text selection
-				if( $.browser.mozilla ) {
-					$('#' + o.menu).each( function() { $(this).css({ 'MozUserSelect' : 'none' }); });
-				} else if( $.browser.msie ) {
-					$('#' + o.menu).each( function() { $(this).bind('selectstart.disableTextSelect', function() { return false; }); });
-				} else {
-					$('#' + o.menu).each(function() { $(this).bind('mousedown.disableTextSelect', function() { return false; }); });
-				}
-				// Disable browser context menu (requires both selectors to work in IE/Safari + FF/Chrome)
-				$(el).add($('UL.contextMenu')).bind('contextmenu', function() { return false; });
-				
-			});
-			return $(this);
-		},
-		
-		// Disable context menu items on the fly
-		disableContextMenuItems: function(o) {
-			if( o == undefined ) {
-				// Disable all
-				$(this).find('li').addClass('disabled');
-				return( $(this) );
-			}
-			$(this).each( function() {
-				if( o != undefined ) {
-					var d = o.split(',');
-					for( var i = 0; i < d.length; i++ ) {
-						$(this).find('A[href="' + d[i] + '"]').parent().addClass('disabled');
-						
-					}
-				}
-			});
-			return( $(this) );
-		},
-		
-		// Enable context menu items on the fly
-		enableContextMenuItems: function(o) {
-			if( o == undefined ) {
-				// Enable all
-				$(this).find('li.disabled').removeClass('disabled');
-				return( $(this) );
-			}
-			$(this).each( function() {
-				if( o != undefined ) {
-					var d = o.split(',');
-					for( var i = 0; i < d.length; i++ ) {
-						$(this).find('A[href="' + d[i] + '"]').parent().removeClass('disabled');
-						
-					}
-				}
-			});
-			return( $(this) );
-		},
-		
-		// Disable context menu(s)
-		disableContextMenu: function() {
-			$(this).each( function() {
-				$(this).addClass('disabled');
-			});
-			return( $(this) );
-		},
-		
-		// Enable context menu(s)
-		enableContextMenu: function() {
-			$(this).each( function() {
-				$(this).removeClass('disabled');
-			});
-			return( $(this) );
-		},
-		
-		// Destroy context menu(s)
-		destroyContextMenu: function() {
-			// Destroy specified context menus
-			$(this).each( function() {
-				// Disable action
-				$(this).unbind('mousedown').unbind('mouseup');
-			});
-			return( $(this) );
-		}
-		
-	});
-})(jQuery);
\ No newline at end of file
+if (jQuery) {
+  (function () {
+    $.extend($.fn, {
+
+      contextMenu: function (o, callback) {
+        // Defaults
+        if (o.menu == undefined) {
+          return false;
+        }
+        if (o.inSpeed == undefined) {
+          o.inSpeed = 150;
+        }
+        if (o.outSpeed == undefined) {
+          o.outSpeed = 75;
+        }
+        // 0 needs to be -1 for expected results (no fade)
+        if (o.inSpeed == 0) {
+          o.inSpeed = -1;
+        }
+        if (o.outSpeed == 0) {
+          o.outSpeed = -1;
+        }
+        // Loop each context menu
+        $(this).each(function () {
+          var el = $(this);
+          var offset = $(el).offset();
+          // Add contextMenu class
+          $('#' + o.menu).addClass('contextMenu');
+          // Simulate a true right click
+          $(this).mousedown(function (e) {
+            var evt = e;
+            if (evt.button == 2) {
+              evt.stopPropagation();
+            }
+
+            $(this).mouseup(function (e) {
+              if (e.button == 2) {
+                e.stopPropagation();
+              }
+
+              var srcElement = $(this);
+              $(this).unbind('mouseup');
+              if (evt.button == 2) {
+                // Hide context menus that may be showing
+                $(".contextMenu").hide();
+                // Get this context menu
+                var menu = $('#' + o.menu);
+
+                if ($(el).hasClass('disabled')) {
+                  return false;
+                }
+
+                // Detect mouse position
+                var d = {}, x, y;
+                if (self.innerHeight) {
+                  d.pageYOffset = self.pageYOffset;
+                  d.pageXOffset = self.pageXOffset;
+                  d.innerHeight = self.innerHeight;
+                  d.innerWidth = self.innerWidth;
+                } else if (document.documentElement &&
+                    document.documentElement.clientHeight) {
+                  d.pageYOffset = document.documentElement.scrollTop;
+                  d.pageXOffset = document.documentElement.scrollLeft;
+                  d.innerHeight = document.documentElement.clientHeight;
+                  d.innerWidth = document.documentElement.clientWidth;
+                } else if (document.body) {
+                  d.pageYOffset = document.body.scrollTop;
+                  d.pageXOffset = document.body.scrollLeft;
+                  d.innerHeight = document.body.clientHeight;
+                  d.innerWidth = document.body.clientWidth;
+                }
+                (e.pageX) ? x = e.pageX : x = e.clientX + d.scrollLeft;
+                (e.pageY) ? y = e.pageY : y = e.clientY + d.scrollTop;
+
+                // Show the menu
+                $(document).unbind('click');
+                $(menu).css({top: y, left: x}).fadeIn(o.inSpeed);
+                // Hover events
+                $(menu).find('a').mouseover(function () {
+                  $(menu).find('li.hover').removeClass('hover');
+                  $(this).parent().addClass('hover');
+                }).mouseout(function () {
+                  $(menu).find('li.hover').removeClass('hover');
+                });
+
+                // Keyboard
+                $(document).keypress(function (e) {
+                  switch (e.keyCode) {
+                    case 38: // up
+                      if ($(menu).find('li.hover').size() == 0) {
+                        $(menu).find('li:last').addClass('hover');
+                      } else {
+                        $(menu).find('li.hover').removeClass('hover').prevAll(
+                            'li:not(.disabled)').eq(0).addClass('hover');
+                        if ($(menu).find('li.hover').size() == 0) {
+                          $(menu).find(
+                              'li:last').addClass('hover');
+                        }
+                      }
+                      break;
+                    case 40: // down
+                      if ($(menu).find('li.hover').size() == 0) {
+                        $(menu).find('li:first').addClass('hover');
+                      } else {
+                        $(menu).find('li.hover').removeClass('hover').nextAll(
+                            'li:not(.disabled)').eq(0).addClass('hover');
+                        if ($(menu).find('li.hover').size() == 0) {
+                          $(menu).find(
+                              'li:first').addClass('hover');
+                        }
+                      }
+                      break;
+                    case 13: // enter
+                      $(menu).find('li.hover a').trigger('click');
+                      break;
+                    case 27: // esc
+                      $(document).trigger('click');
+                      break
+                  }
+                });
+
+                // When items are selected
+                $('#' + o.menu).find('a').unbind('click');
+                $('#' + o.menu).find('li:not(.disabled) a').click(function () {
+                  $(document).unbind('click').unbind('keypress');
+                  $(".contextMenu").hide();
+                  // Callback
+                  if (callback) {
+                    callback($(this).attr('href').substr(1),
+                        $(srcElement),
+                        {
+                          x: x - offset.left,
+                          y: y - offset.top,
+                          docX: x,
+                          docY: y
+                        });
+                  }
+                  return false;
+                });
+
+                // Hide bindings
+                setTimeout(function () { // Delay for Mozilla
+                  $(document).click(function () {
+                    $(document).unbind('click').unbind('keypress');
+                    $(menu).fadeOut(o.outSpeed);
+                    return false;
+                  });
+                }, 0);
+              }
+            });
+          });
+
+          // Disable text selection
+          if ($.browser.mozilla) {
+            $('#' + o.menu).each(function () {
+              $(this).css({'MozUserSelect': 'none'});
+            });
+          } else if ($.browser.msie) {
+            $('#' + o.menu).each(function () {
+              $(this).bind('selectstart.disableTextSelect', function () {
+                return false;
+              });
+            });
+          } else {
+            $('#' + o.menu).each(function () {
+              $(this).bind('mousedown.disableTextSelect', function () {
+                return false;
+              });
+            });
+          }
+          // Disable browser context menu (requires both selectors to work in IE/Safari + FF/Chrome)
+          $(el).add($('UL.contextMenu')).bind('contextmenu', function () {
+            return false;
+          });
+
+        });
+        return $(this);
+      },
+
+      // Disable context menu items on the fly
+      disableContextMenuItems: function (o) {
+        if (o == undefined) {
+          // Disable all
+          $(this).find('li').addClass('disabled');
+          return ( $(this) );
+        }
+        $(this).each(function () {
+          if (o != undefined) {
+            var d = o.split(',');
+            for (var i = 0; i < d.length; i++) {
+              $(this).find('A[href="' + d[i] + '"]').parent().addClass(
+                  'disabled');
+
+            }
+          }
+        });
+        return ( $(this) );
+      },
+
+      // Enable context menu items on the fly
+      enableContextMenuItems: function (o) {
+        if (o == undefined) {
+          // Enable all
+          $(this).find('li.disabled').removeClass('disabled');
+          return ( $(this) );
+        }
+        $(this).each(function () {
+          if (o != undefined) {
+            var d = o.split(',');
+            for (var i = 0; i < d.length; i++) {
+              $(this).find('A[href="' + d[i] + '"]').parent().removeClass(
+                  'disabled');
+
+            }
+          }
+        });
+        return ( $(this) );
+      },
+
+      // Disable context menu(s)
+      disableContextMenu: function () {
+        $(this).each(function () {
+          $(this).addClass('disabled');
+        });
+        return ( $(this) );
+      },
+
+      // Enable context menu(s)
+      enableContextMenu: function () {
+        $(this).each(function () {
+          $(this).removeClass('disabled');
+        });
+        return ( $(this) );
+      },
+
+      // Destroy context menu(s)
+      destroyContextMenu: function () {
+        // Destroy specified context menus
+        $(this).each(function () {
+          // Disable action
+          $(this).unbind('mousedown').unbind('mouseup');
+        });
+        return ( $(this) );
+      }
+
+    });
+  })(jQuery);
+}
diff --git a/azkaban-web-server/src/web/js/jquery/jquery.cookie.js b/azkaban-web-server/src/web/js/jquery/jquery.cookie.js
index 6036754..44e4b1a 100644
--- a/azkaban-web-server/src/web/js/jquery/jquery.cookie.js
+++ b/azkaban-web-server/src/web/js/jquery/jquery.cookie.js
@@ -53,44 +53,46 @@
  * @cat Plugins/Cookie
  * @author Klaus Hartl/klaus.hartl@stilbuero.de
  */
-jQuery.cookie = function(name, value, options) {
-    if (typeof value != 'undefined') { // name and value given, set cookie
-        options = options || {};
-        if (value === null) {
-            value = '';
-            options.expires = -1;
-        }
-        var expires = '';
-        if (options.expires && (typeof options.expires == 'number' || options.expires.toUTCString)) {
-            var date;
-            if (typeof options.expires == 'number') {
-                date = new Date();
-                date.setTime(date.getTime() + (options.expires * 24 * 60 * 60 * 1000));
-            } else {
-                date = options.expires;
-            }
-            expires = '; expires=' + date.toUTCString(); // use expires attribute, max-age is not supported by IE
-        }
-        // CAUTION: Needed to parenthesize options.path and options.domain
-        // in the following expressions, otherwise they evaluate to undefined
-        // in the packed version for some reason...
-        var path = options.path ? '; path=' + (options.path) : '';
-        var domain = options.domain ? '; domain=' + (options.domain) : '';
-        var secure = options.secure ? '; secure' : '';
-        document.cookie = [name, '=', encodeURIComponent(value), expires, path, domain, secure].join('');
-    } else { // only name given, get cookie
-        var cookieValue = null;
-        if (document.cookie && document.cookie != '') {
-            var cookies = document.cookie.split(';');
-            for (var i = 0; i < cookies.length; i++) {
-                var cookie = jQuery.trim(cookies[i]);
-                // Does this cookie string begin with the name we want?
-                if (cookie.substring(0, name.length + 1) == (name + '=')) {
-                    cookieValue = decodeURIComponent(cookie.substring(name.length + 1));
-                    break;
-                }
-            }
+jQuery.cookie = function (name, value, options) {
+  if (typeof value != 'undefined') { // name and value given, set cookie
+    options = options || {};
+    if (value === null) {
+      value = '';
+      options.expires = -1;
+    }
+    var expires = '';
+    if (options.expires && (typeof options.expires == 'number'
+            || options.expires.toUTCString)) {
+      var date;
+      if (typeof options.expires == 'number') {
+        date = new Date();
+        date.setTime(date.getTime() + (options.expires * 24 * 60 * 60 * 1000));
+      } else {
+        date = options.expires;
+      }
+      expires = '; expires=' + date.toUTCString(); // use expires attribute, max-age is not supported by IE
+    }
+    // CAUTION: Needed to parenthesize options.path and options.domain
+    // in the following expressions, otherwise they evaluate to undefined
+    // in the packed version for some reason...
+    var path = options.path ? '; path=' + (options.path) : '';
+    var domain = options.domain ? '; domain=' + (options.domain) : '';
+    var secure = options.secure ? '; secure' : '';
+    document.cookie = [name, '=', encodeURIComponent(value), expires, path,
+      domain, secure].join('');
+  } else { // only name given, get cookie
+    var cookieValue = null;
+    if (document.cookie && document.cookie != '') {
+      var cookies = document.cookie.split(';');
+      for (var i = 0; i < cookies.length; i++) {
+        var cookie = jQuery.trim(cookies[i]);
+        // Does this cookie string begin with the name we want?
+        if (cookie.substring(0, name.length + 1) == (name + '=')) {
+          cookieValue = decodeURIComponent(cookie.substring(name.length + 1));
+          break;
         }
-        return cookieValue;
+      }
     }
-};
\ No newline at end of file
+    return cookieValue;
+  }
+};
diff --git a/azkaban-web-server/src/web/js/jquery/jquery.hotkeys.js b/azkaban-web-server/src/web/js/jquery/jquery.hotkeys.js
index cd62905..1580d23 100644
--- a/azkaban-web-server/src/web/js/jquery/jquery.hotkeys.js
+++ b/azkaban-web-server/src/web/js/jquery/jquery.hotkeys.js
@@ -10,90 +10,152 @@
  * Binny V A, http://www.openjs.com/scripts/events/keyboard_shortcuts/
 */
 
-(function(jQuery){
-	
-	jQuery.hotkeys = {
-		version: "0.8",
-
-		specialKeys: {
-			8: "backspace", 9: "tab", 13: "return", 16: "shift", 17: "ctrl", 18: "alt", 19: "pause",
-			20: "capslock", 27: "esc", 32: "space", 33: "pageup", 34: "pagedown", 35: "end", 36: "home",
-			37: "left", 38: "up", 39: "right", 40: "down", 45: "insert", 46: "del", 
-			96: "0", 97: "1", 98: "2", 99: "3", 100: "4", 101: "5", 102: "6", 103: "7",
-			104: "8", 105: "9", 106: "*", 107: "+", 109: "-", 110: ".", 111 : "/", 
-			112: "f1", 113: "f2", 114: "f3", 115: "f4", 116: "f5", 117: "f6", 118: "f7", 119: "f8", 
-			120: "f9", 121: "f10", 122: "f11", 123: "f12", 144: "numlock", 145: "scroll", 191: "/", 224: "meta"
-		},
-	
-		shiftNums: {
-			"`": "~", "1": "!", "2": "@", "3": "#", "4": "$", "5": "%", "6": "^", "7": "&", 
-			"8": "*", "9": "(", "0": ")", "-": "_", "=": "+", ";": ": ", "'": "\"", ",": "<", 
-			".": ">",  "/": "?",  "\\": "|"
-		}
-	};
-
-	function keyHandler( handleObj ) {
-		// Only care when a possible input has been specified
-		if ( typeof handleObj.data !== "string" ) {
-			return;
-		}
-		
-		var origHandler = handleObj.handler,
-			keys = handleObj.data.toLowerCase().split(" ");
-	
-		handleObj.handler = function( event ) {
-			// Don't fire in text-accepting inputs that we didn't directly bind to
-			if ( this !== event.target && (/textarea|select/i.test( event.target.nodeName ) ||
-				 event.target.type === "text") ) {
-				return;
-			}
-			
-			// Keypress represents characters, not special keys
-			var special = event.type !== "keypress" && jQuery.hotkeys.specialKeys[ event.which ],
-				character = String.fromCharCode( event.which ).toLowerCase(),
-				key, modif = "", possible = {};
-
-			// check combinations (alt|ctrl|shift+anything)
-			if ( event.altKey && special !== "alt" ) {
-				modif += "alt+";
-			}
-
-			if ( event.ctrlKey && special !== "ctrl" ) {
-				modif += "ctrl+";
-			}
-			
-			// TODO: Need to make sure this works consistently across platforms
-			if ( event.metaKey && !event.ctrlKey && special !== "meta" ) {
-				modif += "meta+";
-			}
-
-			if ( event.shiftKey && special !== "shift" ) {
-				modif += "shift+";
-			}
-
-			if ( special ) {
-				possible[ modif + special ] = true;
-
-			} else {
-				possible[ modif + character ] = true;
-				possible[ modif + jQuery.hotkeys.shiftNums[ character ] ] = true;
-
-				// "$" can be triggered as "Shift+4" or "Shift+$" or just "$"
-				if ( modif === "shift+" ) {
-					possible[ jQuery.hotkeys.shiftNums[ character ] ] = true;
-				}
-			}
-
-			for ( var i = 0, l = keys.length; i < l; i++ ) {
-				if ( possible[ keys[i] ] ) {
-					return origHandler.apply( this, arguments );
-				}
-			}
-		};
-	}
-
-	jQuery.each([ "keydown", "keyup", "keypress" ], function() {
-		jQuery.event.special[ this ] = { add: keyHandler };
-	});
-
-})( jQuery );
\ No newline at end of file
+(function (jQuery) {
+
+  jQuery.hotkeys = {
+    version: "0.8",
+
+    specialKeys: {
+      8: "backspace",
+      9: "tab",
+      13: "return",
+      16: "shift",
+      17: "ctrl",
+      18: "alt",
+      19: "pause",
+      20: "capslock",
+      27: "esc",
+      32: "space",
+      33: "pageup",
+      34: "pagedown",
+      35: "end",
+      36: "home",
+      37: "left",
+      38: "up",
+      39: "right",
+      40: "down",
+      45: "insert",
+      46: "del",
+      96: "0",
+      97: "1",
+      98: "2",
+      99: "3",
+      100: "4",
+      101: "5",
+      102: "6",
+      103: "7",
+      104: "8",
+      105: "9",
+      106: "*",
+      107: "+",
+      109: "-",
+      110: ".",
+      111: "/",
+      112: "f1",
+      113: "f2",
+      114: "f3",
+      115: "f4",
+      116: "f5",
+      117: "f6",
+      118: "f7",
+      119: "f8",
+      120: "f9",
+      121: "f10",
+      122: "f11",
+      123: "f12",
+      144: "numlock",
+      145: "scroll",
+      191: "/",
+      224: "meta"
+    },
+
+    shiftNums: {
+      "`": "~",
+      "1": "!",
+      "2": "@",
+      "3": "#",
+      "4": "$",
+      "5": "%",
+      "6": "^",
+      "7": "&",
+      "8": "*",
+      "9": "(",
+      "0": ")",
+      "-": "_",
+      "=": "+",
+      ";": ": ",
+      "'": "\"",
+      ",": "<",
+      ".": ">",
+      "/": "?",
+      "\\": "|"
+    }
+  };
+
+  function keyHandler(handleObj) {
+    // Only care when a possible input has been specified
+    if (typeof handleObj.data !== "string") {
+      return;
+    }
+
+    var origHandler = handleObj.handler,
+        keys = handleObj.data.toLowerCase().split(" ");
+
+    handleObj.handler = function (event) {
+      // Don't fire in text-accepting inputs that we didn't directly bind to
+      if (this !== event.target && (/textarea|select/i.test(
+              event.target.nodeName) ||
+              event.target.type === "text")) {
+        return;
+      }
+
+      // Keypress represents characters, not special keys
+      var special = event.type !== "keypress"
+          && jQuery.hotkeys.specialKeys[event.which],
+          character = String.fromCharCode(event.which).toLowerCase(),
+          key, modif = "", possible = {};
+
+      // check combinations (alt|ctrl|shift+anything)
+      if (event.altKey && special !== "alt") {
+        modif += "alt+";
+      }
+
+      if (event.ctrlKey && special !== "ctrl") {
+        modif += "ctrl+";
+      }
+
+      // TODO: Need to make sure this works consistently across platforms
+      if (event.metaKey && !event.ctrlKey && special !== "meta") {
+        modif += "meta+";
+      }
+
+      if (event.shiftKey && special !== "shift") {
+        modif += "shift+";
+      }
+
+      if (special) {
+        possible[modif + special] = true;
+
+      } else {
+        possible[modif + character] = true;
+        possible[modif + jQuery.hotkeys.shiftNums[character]] = true;
+
+        // "$" can be triggered as "Shift+4" or "Shift+$" or just "$"
+        if (modif === "shift+") {
+          possible[jQuery.hotkeys.shiftNums[character]] = true;
+        }
+      }
+
+      for (var i = 0, l = keys.length; i < l; i++) {
+        if (possible[keys[i]]) {
+          return origHandler.apply(this, arguments);
+        }
+      }
+    };
+  }
+
+  jQuery.each(["keydown", "keyup", "keypress"], function () {
+    jQuery.event.special[this] = {add: keyHandler};
+  });
+
+})(jQuery);
diff --git a/azkaban-web-server/src/web/js/jquery/jquery.js b/azkaban-web-server/src/web/js/jquery/jquery.js
index 5c4c146..48b7699 100644
--- a/azkaban-web-server/src/web/js/jquery/jquery.js
+++ b/azkaban-web-server/src/web/js/jquery/jquery.js
@@ -13,6228 +13,6348 @@
  *
  * Date: Sat Feb 13 22:33:48 2010 -0500
  */
-(function( window, undefined ) {
+(function (window, undefined) {
 
 // Define a local copy of jQuery
-var jQuery = function( selector, context ) {
-		// The jQuery object is actually just the init constructor 'enhanced'
-		return new jQuery.fn.init( selector, context );
-	},
-
-	// Map over jQuery in case of overwrite
-	_jQuery = window.jQuery,
-
-	// Map over the $ in case of overwrite
-	_$ = window.$,
-
-	// Use the correct document accordingly with window argument (sandbox)
-	document = window.document,
-
-	// A central reference to the root jQuery(document)
-	rootjQuery,
-
-	// A simple way to check for HTML strings or ID strings
-	// (both of which we optimize for)
-	quickExpr = /^[^<]*(<[\w\W]+>)[^>]*$|^#([\w-]+)$/,
-
-	// Is it a simple selector
-	isSimple = /^.[^:#\[\.,]*$/,
-
-	// Check if a string has a non-whitespace character in it
-	rnotwhite = /\S/,
-
-	// Used for trimming whitespace
-	rtrim = /^(\s|\u00A0)+|(\s|\u00A0)+$/g,
-
-	// Match a standalone tag
-	rsingleTag = /^<(\w+)\s*\/?>(?:<\/\1>)?$/,
-
-	// Keep a UserAgent string for use with jQuery.browser
-	userAgent = navigator.userAgent,
-
-	// For matching the engine and version of the browser
-	browserMatch,
-	
-	// Has the ready events already been bound?
-	readyBound = false,
-	
-	// The functions to execute on DOM ready
-	readyList = [],
-
-	// The ready event handler
-	DOMContentLoaded,
-
-	// Save a reference to some core methods
-	toString = Object.prototype.toString,
-	hasOwnProperty = Object.prototype.hasOwnProperty,
-	push = Array.prototype.push,
-	slice = Array.prototype.slice,
-	indexOf = Array.prototype.indexOf;
-
-jQuery.fn = jQuery.prototype = {
-	init: function( selector, context ) {
-		var match, elem, ret, doc;
-
-		// Handle $(""), $(null), or $(undefined)
-		if ( !selector ) {
-			return this;
-		}
-
-		// Handle $(DOMElement)
-		if ( selector.nodeType ) {
-			this.context = this[0] = selector;
-			this.length = 1;
-			return this;
-		}
-		
-		// The body element only exists once, optimize finding it
-		if ( selector === "body" && !context ) {
-			this.context = document;
-			this[0] = document.body;
-			this.selector = "body";
-			this.length = 1;
-			return this;
-		}
-
-		// Handle HTML strings
-		if ( typeof selector === "string" ) {
-			// Are we dealing with HTML string or an ID?
-			match = quickExpr.exec( selector );
-
-			// Verify a match, and that no context was specified for #id
-			if ( match && (match[1] || !context) ) {
-
-				// HANDLE: $(html) -> $(array)
-				if ( match[1] ) {
-					doc = (context ? context.ownerDocument || context : document);
-
-					// If a single string is passed in and it's a single tag
-					// just do a createElement and skip the rest
-					ret = rsingleTag.exec( selector );
-
-					if ( ret ) {
-						if ( jQuery.isPlainObject( context ) ) {
-							selector = [ document.createElement( ret[1] ) ];
-							jQuery.fn.attr.call( selector, context, true );
-
-						} else {
-							selector = [ doc.createElement( ret[1] ) ];
-						}
-
-					} else {
-						ret = buildFragment( [ match[1] ], [ doc ] );
-						selector = (ret.cacheable ? ret.fragment.cloneNode(true) : ret.fragment).childNodes;
-					}
-					
-					return jQuery.merge( this, selector );
-					
-				// HANDLE: $("#id")
-				} else {
-					elem = document.getElementById( match[2] );
-
-					if ( elem ) {
-						// 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: $("TAG")
-			} else if ( !context && /^\w+$/.test( selector ) ) {
-				this.selector = selector;
-				this.context = document;
-				selector = document.getElementsByTagName( selector );
-				return jQuery.merge( this, selector );
-
-			// 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 jQuery( 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.4.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 slice.call( this, 0 );
-	},
-
-	// 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.slice(num)[ 0 ] : 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();
-
-		if ( jQuery.isArray( elems ) ) {
-			push.apply( ret, elems );
-		
-		} else {
-			jQuery.merge( ret, 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 ) {
-		// Attach the listeners
-		jQuery.bindReady();
-
-		// If the DOM is already ready
-		if ( jQuery.isReady ) {
-			// Execute the function immediately
-			fn.call( document, jQuery );
-
-		// Otherwise, remember the function for later
-		} else if ( readyList ) {
-			// Add the function to the wait list
-			readyList.push( fn );
-		}
-
-		return this;
-	},
-	
-	eq: function( 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( slice.apply( this, arguments ),
-			"slice", 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 || jQuery(null);
-	},
-
-	// For internal use only.
-	// Behaves like an Array's method, not like a jQuery method.
-	push: push,
-	sort: [].sort,
-	splice: [].splice
-};
+  var jQuery = function (selector, context) {
+        // The jQuery object is actually just the init constructor 'enhanced'
+        return new jQuery.fn.init(selector, context);
+      },
+
+      // Map over jQuery in case of overwrite
+      _jQuery = window.jQuery,
+
+      // Map over the $ in case of overwrite
+      _$ = window.$,
+
+      // Use the correct document accordingly with window argument (sandbox)
+      document = window.document,
+
+      // A central reference to the root jQuery(document)
+      rootjQuery,
+
+      // A simple way to check for HTML strings or ID strings
+      // (both of which we optimize for)
+      quickExpr = /^[^<]*(<[\w\W]+>)[^>]*$|^#([\w-]+)$/,
+
+      // Is it a simple selector
+      isSimple = /^.[^:#\[\.,]*$/,
+
+      // Check if a string has a non-whitespace character in it
+      rnotwhite = /\S/,
+
+      // Used for trimming whitespace
+      rtrim = /^(\s|\u00A0)+|(\s|\u00A0)+$/g,
+
+      // Match a standalone tag
+      rsingleTag = /^<(\w+)\s*\/?>(?:<\/\1>)?$/,
+
+      // Keep a UserAgent string for use with jQuery.browser
+      userAgent = navigator.userAgent,
+
+      // For matching the engine and version of the browser
+      browserMatch,
+
+      // Has the ready events already been bound?
+      readyBound = false,
+
+      // The functions to execute on DOM ready
+      readyList = [],
+
+      // The ready event handler
+      DOMContentLoaded,
+
+      // Save a reference to some core methods
+      toString = Object.prototype.toString,
+      hasOwnProperty = Object.prototype.hasOwnProperty,
+      push = Array.prototype.push,
+      slice = Array.prototype.slice,
+      indexOf = Array.prototype.indexOf;
+
+  jQuery.fn = jQuery.prototype = {
+    init: function (selector, context) {
+      var match, elem, ret, doc;
+
+      // Handle $(""), $(null), or $(undefined)
+      if (!selector) {
+        return this;
+      }
+
+      // Handle $(DOMElement)
+      if (selector.nodeType) {
+        this.context = this[0] = selector;
+        this.length = 1;
+        return this;
+      }
+
+      // The body element only exists once, optimize finding it
+      if (selector === "body" && !context) {
+        this.context = document;
+        this[0] = document.body;
+        this.selector = "body";
+        this.length = 1;
+        return this;
+      }
+
+      // Handle HTML strings
+      if (typeof selector === "string") {
+        // Are we dealing with HTML string or an ID?
+        match = quickExpr.exec(selector);
+
+        // Verify a match, and that no context was specified for #id
+        if (match && (match[1] || !context)) {
+
+          // HANDLE: $(html) -> $(array)
+          if (match[1]) {
+            doc = (context ? context.ownerDocument || context : document);
+
+            // If a single string is passed in and it's a single tag
+            // just do a createElement and skip the rest
+            ret = rsingleTag.exec(selector);
+
+            if (ret) {
+              if (jQuery.isPlainObject(context)) {
+                selector = [document.createElement(ret[1])];
+                jQuery.fn.attr.call(selector, context, true);
+
+              } else {
+                selector = [doc.createElement(ret[1])];
+              }
+
+            } else {
+              ret = buildFragment([match[1]], [doc]);
+              selector = (ret.cacheable ? ret.fragment.cloneNode(true)
+                  : ret.fragment).childNodes;
+            }
+
+            return jQuery.merge(this, selector);
+
+            // HANDLE: $("#id")
+          } else {
+            elem = document.getElementById(match[2]);
+
+            if (elem) {
+              // 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: $("TAG")
+        } else if (!context && /^\w+$/.test(selector)) {
+          this.selector = selector;
+          this.context = document;
+          selector = document.getElementsByTagName(selector);
+          return jQuery.merge(this, selector);
+
+          // 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 jQuery(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.4.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 slice.call(this, 0);
+    },
+
+    // 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.slice(num)[0] : 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();
+
+      if (jQuery.isArray(elems)) {
+        push.apply(ret, elems);
+
+      } else {
+        jQuery.merge(ret, 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) {
+      // Attach the listeners
+      jQuery.bindReady();
+
+      // If the DOM is already ready
+      if (jQuery.isReady) {
+        // Execute the function immediately
+        fn.call(document, jQuery);
+
+        // Otherwise, remember the function for later
+      } else if (readyList) {
+        // Add the function to the wait list
+        readyList.push(fn);
+      }
+
+      return this;
+    },
+
+    eq: function (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(slice.apply(this, arguments),
+          "slice", 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 || jQuery(null);
+    },
+
+    // For internal use only.
+    // Behaves like an Array's method, not like a jQuery method.
+    push: 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() {
-	// copy reference to target object
-	var target = arguments[0] || {}, i = 1, length = arguments.length, deep = false, options, name, src, copy;
-
-	// 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 object literal values or arrays
-				if ( deep && copy && ( jQuery.isPlainObject(copy) || jQuery.isArray(copy) ) ) {
-					var clone = src && ( jQuery.isPlainObject(src) || jQuery.isArray(src) ) ? src
-						: jQuery.isArray(copy) ? [] : {};
-
-					// 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 ) {
-		window.$ = _$;
-
-		if ( deep ) {
-			window.jQuery = _jQuery;
-		}
-
-		return jQuery;
-	},
-	
-	// Is the DOM ready to be used? Set to true once it occurs.
-	isReady: false,
-	
-	// Handle when the DOM is ready
-	ready: function() {
-		// Make sure that the DOM is not already loaded
-		if ( !jQuery.isReady ) {
-			// Make sure body exists, at least, in case IE gets a little overzealous (ticket #5443).
-			if ( !document.body ) {
-				return setTimeout( jQuery.ready, 13 );
-			}
-
-			// Remember that the DOM is ready
-			jQuery.isReady = true;
-
-			// If there are functions bound, to execute
-			if ( readyList ) {
-				// Execute all of them
-				var fn, i = 0;
-				while ( (fn = readyList[ i++ ]) ) {
-					fn.call( document, jQuery );
-				}
-
-				// Reset the list of functions
-				readyList = null;
-			}
-
-			// Trigger any bound ready events
-			if ( jQuery.fn.triggerHandler ) {
-				jQuery( document ).triggerHandler( "ready" );
-			}
-		}
-	},
-	
-	bindReady: function() {
-		if ( readyBound ) {
-			return;
-		}
-
-		readyBound = true;
-
-		// Catch cases where $(document).ready() is called after the
-		// browser event has already occurred.
-		if ( document.readyState === "complete" ) {
-			return jQuery.ready();
-		}
-
-		// Mozilla, Opera and webkit nightlies currently support this event
-		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 if ( document.attachEvent ) {
-			// 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 toplevel = false;
-
-			try {
-				toplevel = window.frameElement == null;
-			} catch(e) {}
-
-			if ( document.documentElement.doScroll && toplevel ) {
-				doScrollCheck();
-			}
-		}
-	},
-
-	// 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 toString.call(obj) === "[object Function]";
-	},
-
-	isArray: function( obj ) {
-		return toString.call(obj) === "[object Array]";
-	},
-
-	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 || toString.call(obj) !== "[object Object]" || obj.nodeType || obj.setInterval ) {
-			return false;
-		}
-		
-		// Not own constructor property must be Object
-		if ( obj.constructor
-			&& !hasOwnProperty.call(obj, "constructor")
-			&& !hasOwnProperty.call(obj.constructor.prototype, "isPrototypeOf") ) {
-			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 || hasOwnProperty.call( obj, key );
-	},
-
-	isEmptyObject: function( obj ) {
-		for ( var name in obj ) {
-			return false;
-		}
-		return true;
-	},
-	
-	error: function( msg ) {
-		throw msg;
-	},
-	
-	parseJSON: function( data ) {
-		if ( typeof data !== "string" || !data ) {
-			return null;
-		}
-
-		// Make sure leading/trailing whitespace is removed (IE can't handle it)
-		data = jQuery.trim( data );
-		
-		// Make sure the incoming data is actual JSON
-		// Logic borrowed from http://json.org/json2.js
-		if ( /^[\],:{}\s]*$/.test(data.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g, "@")
-			.replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g, "]")
-			.replace(/(?:^|:|,)(?:\s*\[)+/g, "")) ) {
-
-			// Try to use the native JSON parser first
-			return window.JSON && window.JSON.parse ?
-				window.JSON.parse( data ) :
-				(new Function("return " + data))();
-
-		} else {
-			jQuery.error( "Invalid JSON: " + data );
-		}
-	},
-
-	noop: function() {},
-
-	// Evalulates a script in a global context
-	globalEval: function( data ) {
-		if ( data && rnotwhite.test(data) ) {
-			// Inspired by code by Andrea Giammarchi
-			// http://webreflection.blogspot.com/2007/08/global-scope-evaluation-and-dom.html
-			var head = document.getElementsByTagName("head")[0] || document.documentElement,
-				script = document.createElement("script");
-
-			script.type = "text/javascript";
-
-			if ( jQuery.support.scriptEval ) {
-				script.appendChild( document.createTextNode( data ) );
-			} else {
-				script.text = data;
-			}
-
-			// Use insertBefore instead of appendChild to circumvent an IE6 bug.
-			// This arises when a base node is used (#2709).
-			head.insertBefore( script, head.firstChild );
-			head.removeChild( script );
-		}
-	},
-
-	nodeName: function( elem, name ) {
-		return elem.nodeName && elem.nodeName.toUpperCase() === name.toUpperCase();
-	},
-
-	// args is for internal usage only
-	each: function( object, callback, args ) {
-		var name, i = 0,
-			length = object.length,
-			isObj = length === undefined || jQuery.isFunction(object);
-
-		if ( args ) {
-			if ( isObj ) {
-				for ( name in object ) {
-					if ( callback.apply( object[ name ], args ) === false ) {
-						break;
-					}
-				}
-			} else {
-				for ( ; i < length; ) {
-					if ( callback.apply( object[ i++ ], args ) === false ) {
-						break;
-					}
-				}
-			}
-
-		// A special, fast, case for the most common use of each
-		} else {
-			if ( isObj ) {
-				for ( name in object ) {
-					if ( callback.call( object[ name ], name, object[ name ] ) === false ) {
-						break;
-					}
-				}
-			} else {
-				for ( var value = object[0];
-					i < length && callback.call( value, i, value ) !== false; value = object[++i] ) {}
-			}
-		}
-
-		return object;
-	},
-
-	trim: function( text ) {
-		return (text || "").replace( rtrim, "" );
-	},
-
-	// results is for internal usage only
-	makeArray: function( array, results ) {
-		var ret = results || [];
-
-		if ( array != null ) {
-			// The window, strings (and functions) also have 'length'
-			// The extra typeof function check is to prevent crashes
-			// in Safari 2 (See: #3039)
-			if ( array.length == null || typeof array === "string" || jQuery.isFunction(array) || (typeof array !== "function" && array.setInterval) ) {
-				push.call( ret, array );
-			} else {
-				jQuery.merge( ret, array );
-			}
-		}
-
-		return ret;
-	},
-
-	inArray: function( elem, array ) {
-		if ( array.indexOf ) {
-			return array.indexOf( elem );
-		}
-
-		for ( var i = 0, length = array.length; i < length; i++ ) {
-			if ( array[ i ] === elem ) {
-				return i;
-			}
-		}
-
-		return -1;
-	},
-
-	merge: function( first, second ) {
-		var i = first.length, j = 0;
-
-		if ( typeof second.length === "number" ) {
-			for ( var l = second.length; 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 ret = [];
-
-		// Go through the array, only saving the items
-		// that pass the validator function
-		for ( var i = 0, length = elems.length; i < length; i++ ) {
-			if ( !inv !== !callback( elems[ i ], i ) ) {
-				ret.push( elems[ i ] );
-			}
-		}
-
-		return ret;
-	},
-
-	// arg is for internal usage only
-	map: function( elems, callback, arg ) {
-		var ret = [], value;
-
-		// Go through the array, translating each of the items to their
-		// new value (or values).
-		for ( var i = 0, length = elems.length; i < length; i++ ) {
-			value = callback( elems[ i ], i, arg );
-
-			if ( value != null ) {
-				ret[ ret.length ] = value;
-			}
-		}
-
-		return ret.concat.apply( [], ret );
-	},
-
-	// A global GUID counter for objects
-	guid: 1,
-
-	proxy: function( fn, proxy, thisObject ) {
-		if ( arguments.length === 2 ) {
-			if ( typeof proxy === "string" ) {
-				thisObject = fn;
-				fn = thisObject[ proxy ];
-				proxy = undefined;
-
-			} else if ( proxy && !jQuery.isFunction( proxy ) ) {
-				thisObject = proxy;
-				proxy = undefined;
-			}
-		}
-
-		if ( !proxy && fn ) {
-			proxy = function() {
-				return fn.apply( thisObject || this, arguments );
-			};
-		}
-
-		// Set the guid of unique handler to the same of original handler, so it can be removed
-		if ( fn ) {
-			proxy.guid = fn.guid = fn.guid || proxy.guid || jQuery.guid++;
-		}
-
-		// So proxy can be declared as an argument
-		return proxy;
-	},
-
-	// Use of jQuery.browser is frowned upon.
-	// More details: http://docs.jquery.com/Utilities/jQuery.browser
-	uaMatch: function( ua ) {
-		ua = ua.toLowerCase();
-
-		var match = /(webkit)[ \/]([\w.]+)/.exec( ua ) ||
-			/(opera)(?:.*version)?[ \/]([\w.]+)/.exec( ua ) ||
-			/(msie) ([\w.]+)/.exec( ua ) ||
-			!/compatible/.test( ua ) && /(mozilla)(?:.*? rv:([\w.]+))?/.exec( ua ) ||
-		  	[];
-
-		return { browser: match[1] || "", version: match[2] || "0" };
-	},
-
-	browser: {}
-});
-
-browserMatch = jQuery.uaMatch( userAgent );
-if ( browserMatch.browser ) {
-	jQuery.browser[ browserMatch.browser ] = true;
-	jQuery.browser.version = browserMatch.version;
-}
+  jQuery.fn.init.prototype = jQuery.fn;
+
+  jQuery.extend = jQuery.fn.extend = function () {
+    // copy reference to target object
+    var target = arguments[0] || {}, i = 1, length = arguments.length,
+        deep = false, options, name, src, copy;
+
+    // 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 object literal values or arrays
+          if (deep && copy && ( jQuery.isPlainObject(copy) || jQuery.isArray(
+                  copy) )) {
+            var clone = src && ( jQuery.isPlainObject(src) || jQuery.isArray(
+                src) ) ? src
+                : jQuery.isArray(copy) ? [] : {};
+
+            // 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) {
+      window.$ = _$;
+
+      if (deep) {
+        window.jQuery = _jQuery;
+      }
+
+      return jQuery;
+    },
+
+    // Is the DOM ready to be used? Set to true once it occurs.
+    isReady: false,
+
+    // Handle when the DOM is ready
+    ready: function () {
+      // Make sure that the DOM is not already loaded
+      if (!jQuery.isReady) {
+        // Make sure body exists, at least, in case IE gets a little overzealous (ticket #5443).
+        if (!document.body) {
+          return setTimeout(jQuery.ready, 13);
+        }
+
+        // Remember that the DOM is ready
+        jQuery.isReady = true;
+
+        // If there are functions bound, to execute
+        if (readyList) {
+          // Execute all of them
+          var fn, i = 0;
+          while ((fn = readyList[i++])) {
+            fn.call(document, jQuery);
+          }
+
+          // Reset the list of functions
+          readyList = null;
+        }
+
+        // Trigger any bound ready events
+        if (jQuery.fn.triggerHandler) {
+          jQuery(document).triggerHandler("ready");
+        }
+      }
+    },
+
+    bindReady: function () {
+      if (readyBound) {
+        return;
+      }
+
+      readyBound = true;
+
+      // Catch cases where $(document).ready() is called after the
+      // browser event has already occurred.
+      if (document.readyState === "complete") {
+        return jQuery.ready();
+      }
+
+      // Mozilla, Opera and webkit nightlies currently support this event
+      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 if (document.attachEvent) {
+        // 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 toplevel = false;
+
+        try {
+          toplevel = window.frameElement == null;
+        } catch (e) {
+        }
+
+        if (document.documentElement.doScroll && toplevel) {
+          doScrollCheck();
+        }
+      }
+    },
+
+    // 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 toString.call(obj) === "[object Function]";
+    },
+
+    isArray: function (obj) {
+      return toString.call(obj) === "[object Array]";
+    },
+
+    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 || toString.call(obj) !== "[object Object]" || obj.nodeType
+          || obj.setInterval) {
+        return false;
+      }
+
+      // Not own constructor property must be Object
+      if (obj.constructor
+          && !hasOwnProperty.call(obj, "constructor")
+          && !hasOwnProperty.call(obj.constructor.prototype, "isPrototypeOf")) {
+        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 || hasOwnProperty.call(obj, key);
+    },
+
+    isEmptyObject: function (obj) {
+      for (var name in obj) {
+        return false;
+      }
+      return true;
+    },
+
+    error: function (msg) {
+      throw msg;
+    },
+
+    parseJSON: function (data) {
+      if (typeof data !== "string" || !data) {
+        return null;
+      }
+
+      // Make sure leading/trailing whitespace is removed (IE can't handle it)
+      data = jQuery.trim(data);
+
+      // Make sure the incoming data is actual JSON
+      // Logic borrowed from http://json.org/json2.js
+      if (/^[\],:{}\s]*$/.test(
+              data.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g, "@")
+              .replace(
+                  /"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,
+                  "]")
+              .replace(/(?:^|:|,)(?:\s*\[)+/g, ""))) {
+
+        // Try to use the native JSON parser first
+        return window.JSON && window.JSON.parse ? window.JSON.parse(data)
+            : (new Function("return " + data))();
+
+      } else {
+        jQuery.error("Invalid JSON: " + data);
+      }
+    },
+
+    noop: function () {
+    },
+
+    // Evalulates a script in a global context
+    globalEval: function (data) {
+      if (data && rnotwhite.test(data)) {
+        // Inspired by code by Andrea Giammarchi
+        // http://webreflection.blogspot.com/2007/08/global-scope-evaluation-and-dom.html
+        var head = document.getElementsByTagName("head")[0]
+            || document.documentElement,
+            script = document.createElement("script");
+
+        script.type = "text/javascript";
+
+        if (jQuery.support.scriptEval) {
+          script.appendChild(document.createTextNode(data));
+        } else {
+          script.text = data;
+        }
+
+        // Use insertBefore instead of appendChild to circumvent an IE6 bug.
+        // This arises when a base node is used (#2709).
+        head.insertBefore(script, head.firstChild);
+        head.removeChild(script);
+      }
+    },
+
+    nodeName: function (elem, name) {
+      return elem.nodeName && elem.nodeName.toUpperCase()
+          === name.toUpperCase();
+    },
+
+    // args is for internal usage only
+    each: function (object, callback, args) {
+      var name, i = 0,
+          length = object.length,
+          isObj = length === undefined || jQuery.isFunction(object);
+
+      if (args) {
+        if (isObj) {
+          for (name in object) {
+            if (callback.apply(object[name], args) === false) {
+              break;
+            }
+          }
+        } else {
+          for (; i < length;) {
+            if (callback.apply(object[i++], args) === false) {
+              break;
+            }
+          }
+        }
+
+        // A special, fast, case for the most common use of each
+      } else {
+        if (isObj) {
+          for (name in object) {
+            if (callback.call(object[name], name, object[name]) === false) {
+              break;
+            }
+          }
+        } else {
+          for (var value = object[0];
+              i < length && callback.call(value, i, value) !== false;
+              value = object[++i]) {
+          }
+        }
+      }
+
+      return object;
+    },
+
+    trim: function (text) {
+      return (text || "").replace(rtrim, "");
+    },
+
+    // results is for internal usage only
+    makeArray: function (array, results) {
+      var ret = results || [];
+
+      if (array != null) {
+        // The window, strings (and functions) also have 'length'
+        // The extra typeof function check is to prevent crashes
+        // in Safari 2 (See: #3039)
+        if (array.length == null || typeof array === "string"
+            || jQuery.isFunction(array) || (typeof array !== "function"
+                && array.setInterval)) {
+          push.call(ret, array);
+        } else {
+          jQuery.merge(ret, array);
+        }
+      }
+
+      return ret;
+    },
+
+    inArray: function (elem, array) {
+      if (array.indexOf) {
+        return array.indexOf(elem);
+      }
+
+      for (var i = 0, length = array.length; i < length; i++) {
+        if (array[i] === elem) {
+          return i;
+        }
+      }
+
+      return -1;
+    },
+
+    merge: function (first, second) {
+      var i = first.length, j = 0;
+
+      if (typeof second.length === "number") {
+        for (var l = second.length; 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 ret = [];
+
+      // Go through the array, only saving the items
+      // that pass the validator function
+      for (var i = 0, length = elems.length; i < length; i++) {
+        if (!inv !== !callback(elems[i], i)) {
+          ret.push(elems[i]);
+        }
+      }
+
+      return ret;
+    },
+
+    // arg is for internal usage only
+    map: function (elems, callback, arg) {
+      var ret = [], value;
+
+      // Go through the array, translating each of the items to their
+      // new value (or values).
+      for (var i = 0, length = elems.length; i < length; i++) {
+        value = callback(elems[i], i, arg);
+
+        if (value != null) {
+          ret[ret.length] = value;
+        }
+      }
+
+      return ret.concat.apply([], ret);
+    },
+
+    // A global GUID counter for objects
+    guid: 1,
+
+    proxy: function (fn, proxy, thisObject) {
+      if (arguments.length === 2) {
+        if (typeof proxy === "string") {
+          thisObject = fn;
+          fn = thisObject[proxy];
+          proxy = undefined;
+
+        } else if (proxy && !jQuery.isFunction(proxy)) {
+          thisObject = proxy;
+          proxy = undefined;
+        }
+      }
+
+      if (!proxy && fn) {
+        proxy = function () {
+          return fn.apply(thisObject || this, arguments);
+        };
+      }
+
+      // Set the guid of unique handler to the same of original handler, so it can be removed
+      if (fn) {
+        proxy.guid = fn.guid = fn.guid || proxy.guid || jQuery.guid++;
+      }
+
+      // So proxy can be declared as an argument
+      return proxy;
+    },
+
+    // Use of jQuery.browser is frowned upon.
+    // More details: http://docs.jquery.com/Utilities/jQuery.browser
+    uaMatch: function (ua) {
+      ua = ua.toLowerCase();
+
+      var match = /(webkit)[ \/]([\w.]+)/.exec(ua) ||
+          /(opera)(?:.*version)?[ \/]([\w.]+)/.exec(ua) ||
+          /(msie) ([\w.]+)/.exec(ua) ||
+          !/compatible/.test(ua) && /(mozilla)(?:.*? rv:([\w.]+))?/.exec(ua) ||
+          [];
+
+      return {browser: match[1] || "", version: match[2] || "0"};
+    },
+
+    browser: {}
+  });
+
+  browserMatch = jQuery.uaMatch(userAgent);
+  if (browserMatch.browser) {
+    jQuery.browser[browserMatch.browser] = true;
+    jQuery.browser.version = browserMatch.version;
+  }
 
 // Deprecated, use jQuery.browser.webkit instead
-if ( jQuery.browser.webkit ) {
-	jQuery.browser.safari = true;
-}
+  if (jQuery.browser.webkit) {
+    jQuery.browser.safari = true;
+  }
 
-if ( indexOf ) {
-	jQuery.inArray = function( elem, array ) {
-		return indexOf.call( array, elem );
-	};
-}
+  if (indexOf) {
+    jQuery.inArray = function (elem, array) {
+      return indexOf.call(array, elem);
+    };
+  }
 
 // All jQuery objects should point back to these
-rootjQuery = jQuery(document);
+  rootjQuery = jQuery(document);
 
 // Cleanup functions for the document ready method
-if ( document.addEventListener ) {
-	DOMContentLoaded = function() {
-		document.removeEventListener( "DOMContentLoaded", DOMContentLoaded, false );
-		jQuery.ready();
-	};
-
-} else if ( document.attachEvent ) {
-	DOMContentLoaded = function() {
-		// Make sure body exists, at least, in case IE gets a little overzealous (ticket #5443).
-		if ( document.readyState === "complete" ) {
-			document.detachEvent( "onreadystatechange", DOMContentLoaded );
-			jQuery.ready();
-		}
-	};
-}
+  if (document.addEventListener) {
+    DOMContentLoaded = function () {
+      document.removeEventListener("DOMContentLoaded", DOMContentLoaded, false);
+      jQuery.ready();
+    };
+
+  } else if (document.attachEvent) {
+    DOMContentLoaded = function () {
+      // Make sure body exists, at least, in case IE gets a little overzealous (ticket #5443).
+      if (document.readyState === "complete") {
+        document.detachEvent("onreadystatechange", DOMContentLoaded);
+        jQuery.ready();
+      }
+    };
+  }
 
 // The DOM ready check for Internet Explorer
-function doScrollCheck() {
-	if ( jQuery.isReady ) {
-		return;
-	}
-
-	try {
-		// If IE is used, use the trick by Diego Perini
-		// http://javascript.nwbox.com/IEContentLoaded/
-		document.documentElement.doScroll("left");
-	} catch( error ) {
-		setTimeout( doScrollCheck, 1 );
-		return;
-	}
-
-	// and execute any waiting functions
-	jQuery.ready();
-}
-
-function evalScript( i, elem ) {
-	if ( elem.src ) {
-		jQuery.ajax({
-			url: elem.src,
-			async: false,
-			dataType: "script"
-		});
-	} else {
-		jQuery.globalEval( elem.text || elem.textContent || elem.innerHTML || "" );
-	}
-
-	if ( elem.parentNode ) {
-		elem.parentNode.removeChild( elem );
-	}
-}
+  function doScrollCheck() {
+    if (jQuery.isReady) {
+      return;
+    }
+
+    try {
+      // If IE is used, use the trick by Diego Perini
+      // http://javascript.nwbox.com/IEContentLoaded/
+      document.documentElement.doScroll("left");
+    } catch (error) {
+      setTimeout(doScrollCheck, 1);
+      return;
+    }
+
+    // and execute any waiting functions
+    jQuery.ready();
+  }
+
+  function evalScript(i, elem) {
+    if (elem.src) {
+      jQuery.ajax({
+        url: elem.src,
+        async: false,
+        dataType: "script"
+      });
+    } else {
+      jQuery.globalEval(elem.text || elem.textContent || elem.innerHTML || "");
+    }
+
+    if (elem.parentNode) {
+      elem.parentNode.removeChild(elem);
+    }
+  }
 
 // Mutifunctional method to get and set values to a collection
 // The value/s can be optionally by executed if its a function
-function access( elems, key, value, exec, fn, pass ) {
-	var length = elems.length;
-	
-	// Setting many attributes
-	if ( typeof key === "object" ) {
-		for ( var k in key ) {
-			access( elems, k, key[k], exec, fn, value );
-		}
-		return elems;
-	}
-	
-	// Setting one attribute
-	if ( value !== undefined ) {
-		// Optionally, function values get executed if exec is true
-		exec = !pass && exec && jQuery.isFunction(value);
-		
-		for ( var i = 0; i < length; i++ ) {
-			fn( elems[i], key, exec ? value.call( elems[i], i, fn( elems[i], key ) ) : value, pass );
-		}
-		
-		return elems;
-	}
-	
-	// Getting an attribute
-	return length ? fn( elems[0], key ) : undefined;
-}
-
-function now() {
-	return (new Date).getTime();
-}
-(function() {
-
-	jQuery.support = {};
-
-	var root = document.documentElement,
-		script = document.createElement("script"),
-		div = document.createElement("div"),
-		id = "script" + now();
-
-	div.style.display = "none";
-	div.innerHTML = "   <link/><table></table><a href='/a' style='color:red;float:left;opacity:.55;'>a</a><input type='checkbox'/>";
-
-	var all = div.getElementsByTagName("*"),
-		a = div.getElementsByTagName("a")[0];
-
-	// Can't get basic test support
-	if ( !all || !all.length || !a ) {
-		return;
-	}
-
-	jQuery.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 insted)
-		style: /red/.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.55$/.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: div.getElementsByTagName("input")[0].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: document.createElement("select").appendChild( document.createElement("option") ).selected,
-
-		parentNode: div.removeChild( div.appendChild( document.createElement("div") ) ).parentNode === null,
-
-		// Will be defined later
-		deleteExpando: true,
-		checkClone: false,
-		scriptEval: false,
-		noCloneEvent: true,
-		boxModel: null
-	};
-
-	script.type = "text/javascript";
-	try {
-		script.appendChild( document.createTextNode( "window." + id + "=1;" ) );
-	} catch(e) {}
-
-	root.insertBefore( script, root.firstChild );
-
-	// Make sure that the execution of code works by injecting a script
-	// tag with appendChild/createTextNode
-	// (IE doesn't support this, fails, and uses .text instead)
-	if ( window[ id ] ) {
-		jQuery.support.scriptEval = true;
-		delete window[ id ];
-	}
-
-	// Test to see if it's possible to delete an expando from an element
-	// Fails in Internet Explorer
-	try {
-		delete script.test;
-	
-	} catch(e) {
-		jQuery.support.deleteExpando = false;
-	}
-
-	root.removeChild( script );
-
-	if ( div.attachEvent && div.fireEvent ) {
-		div.attachEvent("onclick", function click() {
-			// Cloning a node shouldn't copy over any
-			// bound event handlers (IE does this)
-			jQuery.support.noCloneEvent = false;
-			div.detachEvent("onclick", click);
-		});
-		div.cloneNode(true).fireEvent("onclick");
-	}
-
-	div = document.createElement("div");
-	div.innerHTML = "<input type='radio' name='radiotest' checked='checked'/>";
-
-	var fragment = document.createDocumentFragment();
-	fragment.appendChild( div.firstChild );
-
-	// WebKit doesn't clone checked state correctly in fragments
-	jQuery.support.checkClone = fragment.cloneNode(true).cloneNode(true).lastChild.checked;
-
-	// Figure out if the W3C box model works as expected
-	// document.body must exist before we can do this
-	jQuery(function() {
-		var div = document.createElement("div");
-		div.style.width = div.style.paddingLeft = "1px";
-
-		document.body.appendChild( div );
-		jQuery.boxModel = jQuery.support.boxModel = div.offsetWidth === 2;
-		document.body.removeChild( div ).style.display = 'none';
-
-		div = null;
-	});
-
-	// Technique from Juriy Zaytsev
-	// http://thinkweb2.com/projects/prototype/detecting-event-support-without-browser-sniffing/
-	var eventSupported = function( eventName ) { 
-		var el = document.createElement("div"); 
-		eventName = "on" + eventName; 
-
-		var isSupported = (eventName in el); 
-		if ( !isSupported ) { 
-			el.setAttribute(eventName, "return;"); 
-			isSupported = typeof el[eventName] === "function"; 
-		} 
-		el = null; 
-
-		return isSupported; 
-	};
-	
-	jQuery.support.submitBubbles = eventSupported("submit");
-	jQuery.support.changeBubbles = eventSupported("change");
-
-	// release memory in IE
-	root = script = div = all = a = null;
-})();
-
-jQuery.props = {
-	"for": "htmlFor",
-	"class": "className",
-	readonly: "readOnly",
-	maxlength: "maxLength",
-	cellspacing: "cellSpacing",
-	rowspan: "rowSpan",
-	colspan: "colSpan",
-	tabindex: "tabIndex",
-	usemap: "useMap",
-	frameborder: "frameBorder"
-};
-var expando = "jQuery" + now(), uuid = 0, windowData = {};
-
-jQuery.extend({
-	cache: {},
-	
-	expando:expando,
-
-	// The following elements throw uncatchable exceptions if you
-	// attempt to add expando properties to them.
-	noData: {
-		"embed": true,
-		"object": true,
-		"applet": true
-	},
-
-	data: function( elem, name, data ) {
-		if ( elem.nodeName && jQuery.noData[elem.nodeName.toLowerCase()] ) {
-			return;
-		}
-
-		elem = elem == window ?
-			windowData :
-			elem;
-
-		var id = elem[ expando ], cache = jQuery.cache, thisCache;
-
-		if ( !id && typeof name === "string" && data === undefined ) {
-			return null;
-		}
-
-		// Compute a unique ID for the element
-		if ( !id ) { 
-			id = ++uuid;
-		}
-
-		// Avoid generating a new cache unless none exists and we
-		// want to manipulate it.
-		if ( typeof name === "object" ) {
-			elem[ expando ] = id;
-			thisCache = cache[ id ] = jQuery.extend(true, {}, name);
-
-		} else if ( !cache[ id ] ) {
-			elem[ expando ] = id;
-			cache[ id ] = {};
-		}
-
-		thisCache = cache[ id ];
-
-		// Prevent overriding the named cache with undefined values
-		if ( data !== undefined ) {
-			thisCache[ name ] = data;
-		}
-
-		return typeof name === "string" ? thisCache[ name ] : thisCache;
-	},
-
-	removeData: function( elem, name ) {
-		if ( elem.nodeName && jQuery.noData[elem.nodeName.toLowerCase()] ) {
-			return;
-		}
-
-		elem = elem == window ?
-			windowData :
-			elem;
-
-		var id = elem[ expando ], cache = jQuery.cache, thisCache = cache[ id ];
-
-		// If we want to remove a specific section of the element's data
-		if ( name ) {
-			if ( thisCache ) {
-				// Remove the section of cache data
-				delete thisCache[ name ];
-
-				// If we've removed all the data, remove the element's cache
-				if ( jQuery.isEmptyObject(thisCache) ) {
-					jQuery.removeData( elem );
-				}
-			}
-
-		// Otherwise, we want to remove all of the element's data
-		} else {
-			if ( jQuery.support.deleteExpando ) {
-				delete elem[ jQuery.expando ];
-
-			} else if ( elem.removeAttribute ) {
-				elem.removeAttribute( jQuery.expando );
-			}
-
-			// Completely remove the data cache
-			delete cache[ id ];
-		}
-	}
-});
-
-jQuery.fn.extend({
-	data: function( key, value ) {
-		if ( typeof key === "undefined" && this.length ) {
-			return jQuery.data( this[0] );
-
-		} else if ( typeof key === "object" ) {
-			return this.each(function() {
-				jQuery.data( this, key );
-			});
-		}
-
-		var parts = key.split(".");
-		parts[1] = parts[1] ? "." + parts[1] : "";
-
-		if ( value === undefined ) {
-			var data = this.triggerHandler("getData" + parts[1] + "!", [parts[0]]);
-
-			if ( data === undefined && this.length ) {
-				data = jQuery.data( this[0], key );
-			}
-			return data === undefined && parts[1] ?
-				this.data( parts[0] ) :
-				data;
-		} else {
-			return this.trigger("setData" + parts[1] + "!", [parts[0], value]).each(function() {
-				jQuery.data( this, key, value );
-			});
-		}
-	},
-
-	removeData: function( key ) {
-		return this.each(function() {
-			jQuery.removeData( this, key );
-		});
-	}
-});
-jQuery.extend({
-	queue: function( elem, type, data ) {
-		if ( !elem ) {
-			return;
-		}
-
-		type = (type || "fx") + "queue";
-		var q = jQuery.data( elem, type );
-
-		// Speed up dequeue by getting out quickly if this is just a lookup
-		if ( !data ) {
-			return q || [];
-		}
-
-		if ( !q || jQuery.isArray(data) ) {
-			q = jQuery.data( elem, type, jQuery.makeArray(data) );
-
-		} else {
-			q.push( data );
-		}
-
-		return q;
-	},
-
-	dequeue: function( elem, type ) {
-		type = type || "fx";
-
-		var queue = jQuery.queue( elem, type ), fn = queue.shift();
-
-		// If the fx queue is dequeued, always remove the progress sentinel
-		if ( fn === "inprogress" ) {
-			fn = queue.shift();
-		}
-
-		if ( fn ) {
-			// Add a progress sentinel to prevent the fx queue from being
-			// automatically dequeued
-			if ( type === "fx" ) {
-				queue.unshift("inprogress");
-			}
-
-			fn.call(elem, function() {
-				jQuery.dequeue(elem, type);
-			});
-		}
-	}
-});
-
-jQuery.fn.extend({
-	queue: function( type, data ) {
-		if ( typeof type !== "string" ) {
-			data = type;
-			type = "fx";
-		}
-
-		if ( data === undefined ) {
-			return jQuery.queue( this[0], type );
-		}
-		return this.each(function( i, elem ) {
-			var queue = jQuery.queue( this, type, data );
-
-			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() {
-			var elem = this;
-			setTimeout(function() {
-				jQuery.dequeue( elem, type );
-			}, time );
-		});
-	},
-
-	clearQueue: function( type ) {
-		return this.queue( type || "fx", [] );
-	}
-});
-var rclass = /[\n\t]/g,
-	rspace = /\s+/,
-	rreturn = /\r/g,
-	rspecialurl = /href|src|style/,
-	rtype = /(button|input)/i,
-	rfocusable = /(button|input|object|select|textarea)/i,
-	rclickable = /^(a|area)$/i,
-	rradiocheck = /radio|checkbox/;
-
-jQuery.fn.extend({
-	attr: function( name, value ) {
-		return access( this, name, value, true, jQuery.attr );
-	},
-
-	removeAttr: function( name, fn ) {
-		return this.each(function(){
-			jQuery.attr( this, name, "" );
-			if ( this.nodeType === 1 ) {
-				this.removeAttribute( name );
-			}
-		});
-	},
-
-	addClass: function( value ) {
-		if ( jQuery.isFunction(value) ) {
-			return this.each(function(i) {
-				var self = jQuery(this);
-				self.addClass( value.call(this, i, self.attr("class")) );
-			});
-		}
-
-		if ( value && typeof value === "string" ) {
-			var classNames = (value || "").split( rspace );
-
-			for ( var i = 0, l = this.length; i < l; i++ ) {
-				var elem = this[i];
-
-				if ( elem.nodeType === 1 ) {
-					if ( !elem.className ) {
-						elem.className = value;
-
-					} else {
-						var className = " " + elem.className + " ", setClass = elem.className;
-						for ( var c = 0, cl = classNames.length; c < cl; c++ ) {
-							if ( className.indexOf( " " + classNames[c] + " " ) < 0 ) {
-								setClass += " " + classNames[c];
-							}
-						}
-						elem.className = jQuery.trim( setClass );
-					}
-				}
-			}
-		}
-
-		return this;
-	},
-
-	removeClass: function( value ) {
-		if ( jQuery.isFunction(value) ) {
-			return this.each(function(i) {
-				var self = jQuery(this);
-				self.removeClass( value.call(this, i, self.attr("class")) );
-			});
-		}
-
-		if ( (value && typeof value === "string") || value === undefined ) {
-			var classNames = (value || "").split(rspace);
-
-			for ( var i = 0, l = this.length; i < l; i++ ) {
-				var elem = this[i];
-
-				if ( elem.nodeType === 1 && elem.className ) {
-					if ( value ) {
-						var className = (" " + elem.className + " ").replace(rclass, " ");
-						for ( var c = 0, cl = classNames.length; c < cl; c++ ) {
-							className = className.replace(" " + classNames[c] + " ", " ");
-						}
-						elem.className = jQuery.trim( className );
-
-					} else {
-						elem.className = "";
-					}
-				}
-			}
-		}
-
-		return this;
-	},
-
-	toggleClass: function( value, stateVal ) {
-		var type = typeof value, isBool = typeof stateVal === "boolean";
-
-		if ( jQuery.isFunction( value ) ) {
-			return this.each(function(i) {
-				var self = jQuery(this);
-				self.toggleClass( value.call(this, i, self.attr("class"), 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( rspace );
-
-				while ( (className = classNames[ i++ ]) ) {
-					// check each className given, space seperated 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 + " ";
-		for ( var i = 0, l = this.length; i < l; i++ ) {
-			if ( (" " + this[i].className + " ").replace(rclass, " ").indexOf( className ) > -1 ) {
-				return true;
-			}
-		}
-
-		return false;
-	},
-
-	val: function( value ) {
-		if ( value === undefined ) {
-			var elem = this[0];
-
-			if ( elem ) {
-				if ( jQuery.nodeName( elem, "option" ) ) {
-					return (elem.attributes.value || {}).specified ? elem.value : elem.text;
-				}
-
-				// We need to handle select boxes special
-				if ( jQuery.nodeName( elem, "select" ) ) {
-					var 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
-					for ( var i = one ? index : 0, max = one ? index + 1 : options.length; i < max; i++ ) {
-						var option = options[ i ];
-
-						if ( option.selected ) {
-							// Get the specifc 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 );
-						}
-					}
-
-					return values;
-				}
-
-				// Handle the case where in Webkit "" is returned instead of "on" if a value isn't specified
-				if ( rradiocheck.test( elem.type ) && !jQuery.support.checkOn ) {
-					return elem.getAttribute("value") === null ? "on" : elem.value;
-				}
-				
-
-				// Everything else, we just grab the value
-				return (elem.value || "").replace(rreturn, "");
-
-			}
-
-			return undefined;
-		}
-
-		var isFunction = jQuery.isFunction(value);
-
-		return this.each(function(i) {
-			var self = jQuery(this), val = value;
-
-			if ( this.nodeType !== 1 ) {
-				return;
-			}
-
-			if ( isFunction ) {
-				val = value.call(this, i, self.val());
-			}
-
-			// Typecast each time if the value is a Function and the appended
-			// value is therefore different each time.
-			if ( typeof val === "number" ) {
-				val += "";
-			}
-
-			if ( jQuery.isArray(val) && rradiocheck.test( this.type ) ) {
-				this.checked = jQuery.inArray( self.val(), val ) >= 0;
-
-			} else if ( jQuery.nodeName( this, "select" ) ) {
-				var values = jQuery.makeArray(val);
-
-				jQuery( "option", this ).each(function() {
-					this.selected = jQuery.inArray( jQuery(this).val(), values ) >= 0;
-				});
-
-				if ( !values.length ) {
-					this.selectedIndex = -1;
-				}
-
-			} else {
-				this.value = val;
-			}
-		});
-	}
-});
-
-jQuery.extend({
-	attrFn: {
-		val: true,
-		css: true,
-		html: true,
-		text: true,
-		data: true,
-		width: true,
-		height: true,
-		offset: true
-	},
-		
-	attr: function( elem, name, value, pass ) {
-		// don't set attributes on text and comment nodes
-		if ( !elem || elem.nodeType === 3 || elem.nodeType === 8 ) {
-			return undefined;
-		}
-
-		if ( pass && name in jQuery.attrFn ) {
-			return jQuery(elem)[name](value);
-		}
-
-		var notxml = elem.nodeType !== 1 || !jQuery.isXMLDoc( elem ),
-			// Whether we are setting (or getting)
-			set = value !== undefined;
-
-		// Try to normalize/fix the name
-		name = notxml && jQuery.props[ name ] || name;
-
-		// Only do all the following if this is a node (faster for style)
-		if ( elem.nodeType === 1 ) {
-			// These attributes require special treatment
-			var special = rspecialurl.test( name );
-
-			// Safari mis-reports the default selected property of an option
-			// Accessing the parent's selectedIndex property fixes it
-			if ( name === "selected" && !jQuery.support.optSelected ) {
-				var parent = elem.parentNode;
-				if ( parent ) {
-					parent.selectedIndex;
-	
-					// Make sure that it also works with optgroups, see #5701
-					if ( parent.parentNode ) {
-						parent.parentNode.selectedIndex;
-					}
-				}
-			}
-
-			// If applicable, access the attribute via the DOM 0 way
-			if ( name in elem && notxml && !special ) {
-				if ( set ) {
-					// We can't allow the type property to be changed (since it causes problems in IE)
-					if ( name === "type" && rtype.test( elem.nodeName ) && elem.parentNode ) {
-						jQuery.error( "type property can't be changed" );
-					}
-
-					elem[ name ] = value;
-				}
-
-				// browsers index elements by id/name on forms, give priority to attributes.
-				if ( jQuery.nodeName( elem, "form" ) && elem.getAttributeNode(name) ) {
-					return elem.getAttributeNode( name ).nodeValue;
-				}
-
-				// 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/
-				if ( name === "tabIndex" ) {
-					var attributeNode = elem.getAttributeNode( "tabIndex" );
-
-					return attributeNode && attributeNode.specified ?
-						attributeNode.value :
-						rfocusable.test( elem.nodeName ) || rclickable.test( elem.nodeName ) && elem.href ?
-							0 :
-							undefined;
-				}
-
-				return elem[ name ];
-			}
-
-			if ( !jQuery.support.style && notxml && name === "style" ) {
-				if ( set ) {
-					elem.style.cssText = "" + value;
-				}
-
-				return elem.style.cssText;
-			}
-
-			if ( set ) {
-				// convert the value to a string (all browsers do this but IE) see #1070
-				elem.setAttribute( name, "" + value );
-			}
-
-			var attr = !jQuery.support.hrefNormalized && notxml && special ?
-					// Some attributes require a special call on IE
-					elem.getAttribute( name, 2 ) :
-					elem.getAttribute( name );
-
-			// Non-existent attributes return null, we normalize to undefined
-			return attr === null ? undefined : attr;
-		}
-
-		// elem is actually elem.style ... set the style
-		// Using attr for specific style information is now deprecated. Use style instead.
-		return jQuery.style( elem, name, value );
-	}
-});
-var rnamespaces = /\.(.*)$/,
-	fcleanup = function( nm ) {
-		return nm.replace(/[^\w\s\.\|`]/g, function( ch ) {
-			return "\\" + ch;
-		});
-	};
-
-/*
+  function access(elems, key, value, exec, fn, pass) {
+    var length = elems.length;
+
+    // Setting many attributes
+    if (typeof key === "object") {
+      for (var k in key) {
+        access(elems, k, key[k], exec, fn, value);
+      }
+      return elems;
+    }
+
+    // Setting one attribute
+    if (value !== undefined) {
+      // Optionally, function values get executed if exec is true
+      exec = !pass && exec && jQuery.isFunction(value);
+
+      for (var i = 0; i < length; i++) {
+        fn(elems[i], key,
+            exec ? value.call(elems[i], i, fn(elems[i], key)) : value, pass);
+      }
+
+      return elems;
+    }
+
+    // Getting an attribute
+    return length ? fn(elems[0], key) : undefined;
+  }
+
+  function now() {
+    return (new Date).getTime();
+  }
+
+  (function () {
+
+    jQuery.support = {};
+
+    var root = document.documentElement,
+        script = document.createElement("script"),
+        div = document.createElement("div"),
+        id = "script" + now();
+
+    div.style.display = "none";
+    div.innerHTML = "   <link/><table></table><a href='/a' style='color:red;float:left;opacity:.55;'>a</a><input type='checkbox'/>";
+
+    var all = div.getElementsByTagName("*"),
+        a = div.getElementsByTagName("a")[0];
+
+    // Can't get basic test support
+    if (!all || !all.length || !a) {
+      return;
+    }
+
+    jQuery.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 insted)
+      style: /red/.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.55$/.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: div.getElementsByTagName("input")[0].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: document.createElement("select").appendChild(
+          document.createElement("option")).selected,
+
+      parentNode: div.removeChild(
+          div.appendChild(document.createElement("div"))).parentNode === null,
+
+      // Will be defined later
+      deleteExpando: true,
+      checkClone: false,
+      scriptEval: false,
+      noCloneEvent: true,
+      boxModel: null
+    };
+
+    script.type = "text/javascript";
+    try {
+      script.appendChild(document.createTextNode("window." + id + "=1;"));
+    } catch (e) {
+    }
+
+    root.insertBefore(script, root.firstChild);
+
+    // Make sure that the execution of code works by injecting a script
+    // tag with appendChild/createTextNode
+    // (IE doesn't support this, fails, and uses .text instead)
+    if (window[id]) {
+      jQuery.support.scriptEval = true;
+      delete window[id];
+    }
+
+    // Test to see if it's possible to delete an expando from an element
+    // Fails in Internet Explorer
+    try {
+      delete script.test;
+
+    } catch (e) {
+      jQuery.support.deleteExpando = false;
+    }
+
+    root.removeChild(script);
+
+    if (div.attachEvent && div.fireEvent) {
+      div.attachEvent("onclick", function click() {
+        // Cloning a node shouldn't copy over any
+        // bound event handlers (IE does this)
+        jQuery.support.noCloneEvent = false;
+        div.detachEvent("onclick", click);
+      });
+      div.cloneNode(true).fireEvent("onclick");
+    }
+
+    div = document.createElement("div");
+    div.innerHTML = "<input type='radio' name='radiotest' checked='checked'/>";
+
+    var fragment = document.createDocumentFragment();
+    fragment.appendChild(div.firstChild);
+
+    // WebKit doesn't clone checked state correctly in fragments
+    jQuery.support.checkClone = fragment.cloneNode(true).cloneNode(
+        true).lastChild.checked;
+
+    // Figure out if the W3C box model works as expected
+    // document.body must exist before we can do this
+    jQuery(function () {
+      var div = document.createElement("div");
+      div.style.width = div.style.paddingLeft = "1px";
+
+      document.body.appendChild(div);
+      jQuery.boxModel = jQuery.support.boxModel = div.offsetWidth === 2;
+      document.body.removeChild(div).style.display = 'none';
+
+      div = null;
+    });
+
+    // Technique from Juriy Zaytsev
+    // http://thinkweb2.com/projects/prototype/detecting-event-support-without-browser-sniffing/
+    var eventSupported = function (eventName) {
+      var el = document.createElement("div");
+      eventName = "on" + eventName;
+
+      var isSupported = (eventName in el);
+      if (!isSupported) {
+        el.setAttribute(eventName, "return;");
+        isSupported = typeof el[eventName] === "function";
+      }
+      el = null;
+
+      return isSupported;
+    };
+
+    jQuery.support.submitBubbles = eventSupported("submit");
+    jQuery.support.changeBubbles = eventSupported("change");
+
+    // release memory in IE
+    root = script = div = all = a = null;
+  })();
+
+  jQuery.props = {
+    "for": "htmlFor",
+    "class": "className",
+    readonly: "readOnly",
+    maxlength: "maxLength",
+    cellspacing: "cellSpacing",
+    rowspan: "rowSpan",
+    colspan: "colSpan",
+    tabindex: "tabIndex",
+    usemap: "useMap",
+    frameborder: "frameBorder"
+  };
+  var expando = "jQuery" + now(), uuid = 0, windowData = {};
+
+  jQuery.extend({
+    cache: {},
+
+    expando: expando,
+
+    // The following elements throw uncatchable exceptions if you
+    // attempt to add expando properties to them.
+    noData: {
+      "embed": true,
+      "object": true,
+      "applet": true
+    },
+
+    data: function (elem, name, data) {
+      if (elem.nodeName && jQuery.noData[elem.nodeName.toLowerCase()]) {
+        return;
+      }
+
+      elem = elem == window ? windowData : elem;
+
+      var id = elem[expando], cache = jQuery.cache, thisCache;
+
+      if (!id && typeof name === "string" && data === undefined) {
+        return null;
+      }
+
+      // Compute a unique ID for the element
+      if (!id) {
+        id = ++uuid;
+      }
+
+      // Avoid generating a new cache unless none exists and we
+      // want to manipulate it.
+      if (typeof name === "object") {
+        elem[expando] = id;
+        thisCache = cache[id] = jQuery.extend(true, {}, name);
+
+      } else if (!cache[id]) {
+        elem[expando] = id;
+        cache[id] = {};
+      }
+
+      thisCache = cache[id];
+
+      // Prevent overriding the named cache with undefined values
+      if (data !== undefined) {
+        thisCache[name] = data;
+      }
+
+      return typeof name === "string" ? thisCache[name] : thisCache;
+    },
+
+    removeData: function (elem, name) {
+      if (elem.nodeName && jQuery.noData[elem.nodeName.toLowerCase()]) {
+        return;
+      }
+
+      elem = elem == window ? windowData : elem;
+
+      var id = elem[expando], cache = jQuery.cache, thisCache = cache[id];
+
+      // If we want to remove a specific section of the element's data
+      if (name) {
+        if (thisCache) {
+          // Remove the section of cache data
+          delete thisCache[name];
+
+          // If we've removed all the data, remove the element's cache
+          if (jQuery.isEmptyObject(thisCache)) {
+            jQuery.removeData(elem);
+          }
+        }
+
+        // Otherwise, we want to remove all of the element's data
+      } else {
+        if (jQuery.support.deleteExpando) {
+          delete elem[jQuery.expando];
+
+        } else if (elem.removeAttribute) {
+          elem.removeAttribute(jQuery.expando);
+        }
+
+        // Completely remove the data cache
+        delete cache[id];
+      }
+    }
+  });
+
+  jQuery.fn.extend({
+    data: function (key, value) {
+      if (typeof key === "undefined" && this.length) {
+        return jQuery.data(this[0]);
+
+      } else if (typeof key === "object") {
+        return this.each(function () {
+          jQuery.data(this, key);
+        });
+      }
+
+      var parts = key.split(".");
+      parts[1] = parts[1] ? "." + parts[1] : "";
+
+      if (value === undefined) {
+        var data = this.triggerHandler("getData" + parts[1] + "!", [parts[0]]);
+
+        if (data === undefined && this.length) {
+          data = jQuery.data(this[0], key);
+        }
+        return data === undefined && parts[1] ? this.data(parts[0]) : data;
+      } else {
+        return this.trigger("setData" + parts[1] + "!", [parts[0], value]).each(
+            function () {
+              jQuery.data(this, key, value);
+            });
+      }
+    },
+
+    removeData: function (key) {
+      return this.each(function () {
+        jQuery.removeData(this, key);
+      });
+    }
+  });
+  jQuery.extend({
+    queue: function (elem, type, data) {
+      if (!elem) {
+        return;
+      }
+
+      type = (type || "fx") + "queue";
+      var q = jQuery.data(elem, type);
+
+      // Speed up dequeue by getting out quickly if this is just a lookup
+      if (!data) {
+        return q || [];
+      }
+
+      if (!q || jQuery.isArray(data)) {
+        q = jQuery.data(elem, type, jQuery.makeArray(data));
+
+      } else {
+        q.push(data);
+      }
+
+      return q;
+    },
+
+    dequeue: function (elem, type) {
+      type = type || "fx";
+
+      var queue = jQuery.queue(elem, type), fn = queue.shift();
+
+      // If the fx queue is dequeued, always remove the progress sentinel
+      if (fn === "inprogress") {
+        fn = queue.shift();
+      }
+
+      if (fn) {
+        // Add a progress sentinel to prevent the fx queue from being
+        // automatically dequeued
+        if (type === "fx") {
+          queue.unshift("inprogress");
+        }
+
+        fn.call(elem, function () {
+          jQuery.dequeue(elem, type);
+        });
+      }
+    }
+  });
+
+  jQuery.fn.extend({
+    queue: function (type, data) {
+      if (typeof type !== "string") {
+        data = type;
+        type = "fx";
+      }
+
+      if (data === undefined) {
+        return jQuery.queue(this[0], type);
+      }
+      return this.each(function (i, elem) {
+        var queue = jQuery.queue(this, type, data);
+
+        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 () {
+        var elem = this;
+        setTimeout(function () {
+          jQuery.dequeue(elem, type);
+        }, time);
+      });
+    },
+
+    clearQueue: function (type) {
+      return this.queue(type || "fx", []);
+    }
+  });
+  var rclass = /[\n\t]/g,
+      rspace = /\s+/,
+      rreturn = /\r/g,
+      rspecialurl = /href|src|style/,
+      rtype = /(button|input)/i,
+      rfocusable = /(button|input|object|select|textarea)/i,
+      rclickable = /^(a|area)$/i,
+      rradiocheck = /radio|checkbox/;
+
+  jQuery.fn.extend({
+    attr: function (name, value) {
+      return access(this, name, value, true, jQuery.attr);
+    },
+
+    removeAttr: function (name, fn) {
+      return this.each(function () {
+        jQuery.attr(this, name, "");
+        if (this.nodeType === 1) {
+          this.removeAttribute(name);
+        }
+      });
+    },
+
+    addClass: function (value) {
+      if (jQuery.isFunction(value)) {
+        return this.each(function (i) {
+          var self = jQuery(this);
+          self.addClass(value.call(this, i, self.attr("class")));
+        });
+      }
+
+      if (value && typeof value === "string") {
+        var classNames = (value || "").split(rspace);
+
+        for (var i = 0, l = this.length; i < l; i++) {
+          var elem = this[i];
+
+          if (elem.nodeType === 1) {
+            if (!elem.className) {
+              elem.className = value;
+
+            } else {
+              var className = " " + elem.className + " ",
+                  setClass = elem.className;
+              for (var c = 0, cl = classNames.length; c < cl; c++) {
+                if (className.indexOf(" " + classNames[c] + " ") < 0) {
+                  setClass += " " + classNames[c];
+                }
+              }
+              elem.className = jQuery.trim(setClass);
+            }
+          }
+        }
+      }
+
+      return this;
+    },
+
+    removeClass: function (value) {
+      if (jQuery.isFunction(value)) {
+        return this.each(function (i) {
+          var self = jQuery(this);
+          self.removeClass(value.call(this, i, self.attr("class")));
+        });
+      }
+
+      if ((value && typeof value === "string") || value === undefined) {
+        var classNames = (value || "").split(rspace);
+
+        for (var i = 0, l = this.length; i < l; i++) {
+          var elem = this[i];
+
+          if (elem.nodeType === 1 && elem.className) {
+            if (value) {
+              var className = (" " + elem.className + " ").replace(rclass, " ");
+              for (var c = 0, cl = classNames.length; c < cl; c++) {
+                className = className.replace(" " + classNames[c] + " ", " ");
+              }
+              elem.className = jQuery.trim(className);
+
+            } else {
+              elem.className = "";
+            }
+          }
+        }
+      }
+
+      return this;
+    },
+
+    toggleClass: function (value, stateVal) {
+      var type = typeof value, isBool = typeof stateVal === "boolean";
+
+      if (jQuery.isFunction(value)) {
+        return this.each(function (i) {
+          var self = jQuery(this);
+          self.toggleClass(value.call(this, i, self.attr("class"), 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(rspace);
+
+          while ((className = classNames[i++])) {
+            // check each className given, space seperated 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 + " ";
+      for (var i = 0, l = this.length; i < l; i++) {
+        if ((" " + this[i].className + " ").replace(rclass, " ").indexOf(
+                className) > -1) {
+          return true;
+        }
+      }
+
+      return false;
+    },
+
+    val: function (value) {
+      if (value === undefined) {
+        var elem = this[0];
+
+        if (elem) {
+          if (jQuery.nodeName(elem, "option")) {
+            return (elem.attributes.value || {}).specified ? elem.value
+                : elem.text;
+          }
+
+          // We need to handle select boxes special
+          if (jQuery.nodeName(elem, "select")) {
+            var 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
+            for (var i = one ? index : 0,
+                max = one ? index + 1 : options.length; i < max; i++) {
+              var option = options[i];
+
+              if (option.selected) {
+                // Get the specifc 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);
+              }
+            }
+
+            return values;
+          }
+
+          // Handle the case where in Webkit "" is returned instead of "on" if a value isn't specified
+          if (rradiocheck.test(elem.type) && !jQuery.support.checkOn) {
+            return elem.getAttribute("value") === null ? "on" : elem.value;
+          }
+
+          // Everything else, we just grab the value
+          return (elem.value || "").replace(rreturn, "");
+
+        }
+
+        return undefined;
+      }
+
+      var isFunction = jQuery.isFunction(value);
+
+      return this.each(function (i) {
+        var self = jQuery(this), val = value;
+
+        if (this.nodeType !== 1) {
+          return;
+        }
+
+        if (isFunction) {
+          val = value.call(this, i, self.val());
+        }
+
+        // Typecast each time if the value is a Function and the appended
+        // value is therefore different each time.
+        if (typeof val === "number") {
+          val += "";
+        }
+
+        if (jQuery.isArray(val) && rradiocheck.test(this.type)) {
+          this.checked = jQuery.inArray(self.val(), val) >= 0;
+
+        } else if (jQuery.nodeName(this, "select")) {
+          var values = jQuery.makeArray(val);
+
+          jQuery("option", this).each(function () {
+            this.selected = jQuery.inArray(jQuery(this).val(), values) >= 0;
+          });
+
+          if (!values.length) {
+            this.selectedIndex = -1;
+          }
+
+        } else {
+          this.value = val;
+        }
+      });
+    }
+  });
+
+  jQuery.extend({
+    attrFn: {
+      val: true,
+      css: true,
+      html: true,
+      text: true,
+      data: true,
+      width: true,
+      height: true,
+      offset: true
+    },
+
+    attr: function (elem, name, value, pass) {
+      // don't set attributes on text and comment nodes
+      if (!elem || elem.nodeType === 3 || elem.nodeType === 8) {
+        return undefined;
+      }
+
+      if (pass && name in jQuery.attrFn) {
+        return jQuery(elem)[name](value);
+      }
+
+      var notxml = elem.nodeType !== 1 || !jQuery.isXMLDoc(elem),
+          // Whether we are setting (or getting)
+          set = value !== undefined;
+
+      // Try to normalize/fix the name
+      name = notxml && jQuery.props[name] || name;
+
+      // Only do all the following if this is a node (faster for style)
+      if (elem.nodeType === 1) {
+        // These attributes require special treatment
+        var special = rspecialurl.test(name);
+
+        // Safari mis-reports the default selected property of an option
+        // Accessing the parent's selectedIndex property fixes it
+        if (name === "selected" && !jQuery.support.optSelected) {
+          var parent = elem.parentNode;
+          if (parent) {
+            parent.selectedIndex;
+
+            // Make sure that it also works with optgroups, see #5701
+            if (parent.parentNode) {
+              parent.parentNode.selectedIndex;
+            }
+          }
+        }
+
+        // If applicable, access the attribute via the DOM 0 way
+        if (name in elem && notxml && !special) {
+          if (set) {
+            // We can't allow the type property to be changed (since it causes problems in IE)
+            if (name === "type" && rtype.test(elem.nodeName)
+                && elem.parentNode) {
+              jQuery.error("type property can't be changed");
+            }
+
+            elem[name] = value;
+          }
+
+          // browsers index elements by id/name on forms, give priority to attributes.
+          if (jQuery.nodeName(elem, "form") && elem.getAttributeNode(name)) {
+            return elem.getAttributeNode(name).nodeValue;
+          }
+
+          // 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/
+          if (name === "tabIndex") {
+            var attributeNode = elem.getAttributeNode("tabIndex");
+
+            return attributeNode && attributeNode.specified
+                ? attributeNode.value : rfocusable.test(elem.nodeName)
+                || rclickable.test(elem.nodeName) && elem.href ? 0 : undefined;
+          }
+
+          return elem[name];
+        }
+
+        if (!jQuery.support.style && notxml && name === "style") {
+          if (set) {
+            elem.style.cssText = "" + value;
+          }
+
+          return elem.style.cssText;
+        }
+
+        if (set) {
+          // convert the value to a string (all browsers do this but IE) see #1070
+          elem.setAttribute(name, "" + value);
+        }
+
+        var attr = !jQuery.support.hrefNormalized && notxml && special
+            ? // Some attributes require a special call on IE
+            elem.getAttribute(name, 2) : elem.getAttribute(name);
+
+        // Non-existent attributes return null, we normalize to undefined
+        return attr === null ? undefined : attr;
+      }
+
+      // elem is actually elem.style ... set the style
+      // Using attr for specific style information is now deprecated. Use style instead.
+      return jQuery.style(elem, name, value);
+    }
+  });
+  var rnamespaces = /\.(.*)$/,
+      fcleanup = function (nm) {
+        return nm.replace(/[^\w\s\.\|`]/g, function (ch) {
+          return "\\" + ch;
+        });
+      };
+
+  /*
  * A number of helper functions used for managing events.
  * Many of the ideas behind this code originated from
  * Dean Edwards' addEvent library.
  */
-jQuery.event = {
-
-	// Bind an event to an element
-	// Original by Dean Edwards
-	add: function( elem, types, handler, data ) {
-		if ( elem.nodeType === 3 || elem.nodeType === 8 ) {
-			return;
-		}
-
-		// For whatever reason, IE has trouble passing the window object
-		// around, causing it to be cloned in the process
-		if ( elem.setInterval && ( elem !== window && !elem.frameElement ) ) {
-			elem = window;
-		}
-
-		var handleObjIn, handleObj;
-
-		if ( handler.handler ) {
-			handleObjIn = handler;
-			handler = handleObjIn.handler;
-		}
-
-		// Make sure that the function being executed has a unique ID
-		if ( !handler.guid ) {
-			handler.guid = jQuery.guid++;
-		}
-
-		// Init the element's event structure
-		var elemData = jQuery.data( elem );
-
-		// If no elemData is found then we must be trying to bind to one of the
-		// banned noData elements
-		if ( !elemData ) {
-			return;
-		}
-
-		var events = elemData.events = elemData.events || {},
-			eventHandle = elemData.handle, eventHandle;
-
-		if ( !eventHandle ) {
-			elemData.handle = eventHandle = function() {
-				// Handle the second event of a trigger and when
-				// an event is called after a page has unloaded
-				return typeof jQuery !== "undefined" && !jQuery.event.triggered ?
-					jQuery.event.handle.apply( eventHandle.elem, arguments ) :
-					undefined;
-			};
-		}
-
-		// Add elem as a property of the handle function
-		// This is to prevent a memory leak with non-native events in IE.
-		eventHandle.elem = elem;
-
-		// Handle multiple events separated by a space
-		// jQuery(...).bind("mouseover mouseout", fn);
-		types = types.split(" ");
-
-		var type, i = 0, namespaces;
-
-		while ( (type = types[ i++ ]) ) {
-			handleObj = handleObjIn ?
-				jQuery.extend({}, handleObjIn) :
-				{ handler: handler, data: data };
-
-			// Namespaced event handlers
-			if ( type.indexOf(".") > -1 ) {
-				namespaces = type.split(".");
-				type = namespaces.shift();
-				handleObj.namespace = namespaces.slice(0).sort().join(".");
-
-			} else {
-				namespaces = [];
-				handleObj.namespace = "";
-			}
-
-			handleObj.type = type;
-			handleObj.guid = handler.guid;
-
-			// Get the current list of functions bound to this event
-			var handlers = events[ type ],
-				special = jQuery.event.special[ type ] || {};
-
-			// Init the event handler queue
-			if ( !handlers ) {
-				handlers = events[ type ] = [];
-
-				// Check for a special event handler
-				// 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 the function to the element's handler list
-			handlers.push( handleObj );
-
-			// Keep track of which events have been used, for global triggering
-			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, pos ) {
-		// don't do events on text and comment nodes
-		if ( elem.nodeType === 3 || elem.nodeType === 8 ) {
-			return;
-		}
-
-		var ret, type, fn, i = 0, all, namespaces, namespace, special, eventType, handleObj, origType,
-			elemData = jQuery.data( elem ),
-			events = elemData && elemData.events;
-
-		if ( !elemData || !events ) {
-			return;
-		}
-
-		// types is actually an event object here
-		if ( types && types.type ) {
-			handler = types.handler;
-			types = types.type;
-		}
-
-		// Unbind all events for the element
-		if ( !types || typeof types === "string" && types.charAt(0) === "." ) {
-			types = types || "";
-
-			for ( type in events ) {
-				jQuery.event.remove( elem, type + types );
-			}
-
-			return;
-		}
-
-		// Handle multiple events separated by a space
-		// jQuery(...).unbind("mouseover mouseout", fn);
-		types = types.split(" ");
-
-		while ( (type = types[ i++ ]) ) {
-			origType = type;
-			handleObj = null;
-			all = type.indexOf(".") < 0;
-			namespaces = [];
-
-			if ( !all ) {
-				// Namespaced event handlers
-				namespaces = type.split(".");
-				type = namespaces.shift();
-
-				namespace = new RegExp("(^|\\.)" + 
-					jQuery.map( namespaces.slice(0).sort(), fcleanup ).join("\\.(?:.*\\.)?") + "(\\.|$)")
-			}
-
-			eventType = events[ type ];
-
-			if ( !eventType ) {
-				continue;
-			}
-
-			if ( !handler ) {
-				for ( var j = 0; j < eventType.length; j++ ) {
-					handleObj = eventType[ j ];
-
-					if ( all || namespace.test( handleObj.namespace ) ) {
-						jQuery.event.remove( elem, origType, handleObj.handler, j );
-						eventType.splice( j--, 1 );
-					}
-				}
-
-				continue;
-			}
-
-			special = jQuery.event.special[ type ] || {};
-
-			for ( var j = pos || 0; j < eventType.length; j++ ) {
-				handleObj = eventType[ j ];
-
-				if ( handler.guid === handleObj.guid ) {
-					// remove the given handler for the given type
-					if ( all || namespace.test( handleObj.namespace ) ) {
-						if ( pos == null ) {
-							eventType.splice( j--, 1 );
-						}
-
-						if ( special.remove ) {
-							special.remove.call( elem, handleObj );
-						}
-					}
-
-					if ( pos != null ) {
-						break;
-					}
-				}
-			}
-
-			// remove generic event handler if no more handlers exist
-			if ( eventType.length === 0 || pos != null && eventType.length === 1 ) {
-				if ( !special.teardown || special.teardown.call( elem, namespaces ) === false ) {
-					removeEvent( elem, type, elemData.handle );
-				}
-
-				ret = null;
-				delete events[ type ];
-			}
-		}
-
-		// Remove the expando if it's no longer used
-		if ( jQuery.isEmptyObject( events ) ) {
-			var handle = elemData.handle;
-			if ( handle ) {
-				handle.elem = null;
-			}
-
-			delete elemData.events;
-			delete elemData.handle;
-
-			if ( jQuery.isEmptyObject( elemData ) ) {
-				jQuery.removeData( elem );
-			}
-		}
-	},
-
-	// bubbling is internal
-	trigger: function( event, data, elem /*, bubbling */ ) {
-		// Event object or event type
-		var type = event.type || event,
-			bubbling = arguments[3];
-
-		if ( !bubbling ) {
-			event = typeof event === "object" ?
-				// jQuery.Event object
-				event[expando] ? event :
-				// Object literal
-				jQuery.extend( jQuery.Event(type), event ) :
-				// Just the event type (string)
-				jQuery.Event(type);
-
-			if ( type.indexOf("!") >= 0 ) {
-				event.type = type = type.slice(0, -1);
-				event.exclusive = true;
-			}
-
-			// Handle a global trigger
-			if ( !elem ) {
-				// Don't bubble custom events when global (to avoid too much overhead)
-				event.stopPropagation();
-
-				// Only trigger if we've ever bound an event for it
-				if ( jQuery.event.global[ type ] ) {
-					jQuery.each( jQuery.cache, function() {
-						if ( this.events && this.events[type] ) {
-							jQuery.event.trigger( event, data, this.handle.elem );
-						}
-					});
-				}
-			}
-
-			// Handle triggering a single element
-
-			// don't do events on text and comment nodes
-			if ( !elem || elem.nodeType === 3 || elem.nodeType === 8 ) {
-				return undefined;
-			}
-
-			// Clean up in case it is reused
-			event.result = undefined;
-			event.target = elem;
-
-			// Clone the incoming data, if any
-			data = jQuery.makeArray( data );
-			data.unshift( event );
-		}
-
-		event.currentTarget = elem;
-
-		// Trigger the event, it is assumed that "handle" is a function
-		var handle = jQuery.data( elem, "handle" );
-		if ( handle ) {
-			handle.apply( elem, data );
-		}
-
-		var parent = elem.parentNode || elem.ownerDocument;
-
-		// Trigger an inline bound script
-		try {
-			if ( !(elem && elem.nodeName && jQuery.noData[elem.nodeName.toLowerCase()]) ) {
-				if ( elem[ "on" + type ] && elem[ "on" + type ].apply( elem, data ) === false ) {
-					event.result = false;
-				}
-			}
-
-		// prevent IE from throwing an error for some elements with some event types, see #3533
-		} catch (e) {}
-
-		if ( !event.isPropagationStopped() && parent ) {
-			jQuery.event.trigger( event, data, parent, true );
-
-		} else if ( !event.isDefaultPrevented() ) {
-			var target = event.target, old,
-				isClick = jQuery.nodeName(target, "a") && type === "click",
-				special = jQuery.event.special[ type ] || {};
-
-			if ( (!special._default || special._default.call( elem, event ) === false) && 
-				!isClick && !(target && target.nodeName && jQuery.noData[target.nodeName.toLowerCase()]) ) {
-
-				try {
-					if ( target[ type ] ) {
-						// Make sure that we don't accidentally re-trigger the onFOO events
-						old = target[ "on" + type ];
-
-						if ( old ) {
-							target[ "on" + type ] = null;
-						}
-
-						jQuery.event.triggered = true;
-						target[ type ]();
-					}
-
-				// prevent IE from throwing an error for some elements with some event types, see #3533
-				} catch (e) {}
-
-				if ( old ) {
-					target[ "on" + type ] = old;
-				}
-
-				jQuery.event.triggered = false;
-			}
-		}
-	},
-
-	handle: function( event ) {
-		var all, handlers, namespaces, namespace, events;
-
-		event = arguments[0] = jQuery.event.fix( event || window.event );
-		event.currentTarget = this;
-
-		// Namespaced event handlers
-		all = event.type.indexOf(".") < 0 && !event.exclusive;
-
-		if ( !all ) {
-			namespaces = event.type.split(".");
-			event.type = namespaces.shift();
-			namespace = new RegExp("(^|\\.)" + namespaces.slice(0).sort().join("\\.(?:.*\\.)?") + "(\\.|$)");
-		}
-
-		var events = jQuery.data(this, "events"), handlers = events[ event.type ];
-
-		if ( events && handlers ) {
-			// Clone the handlers to prevent manipulation
-			handlers = handlers.slice(0);
-
-			for ( var j = 0, l = handlers.length; j < l; j++ ) {
-				var handleObj = handlers[ j ];
-
-				// Filter the functions by class
-				if ( all || namespace.test( handleObj.namespace ) ) {
-					// Pass in a reference to the handler function itself
-					// So that we can later remove it
-					event.handler = handleObj.handler;
-					event.data = handleObj.data;
-					event.handleObj = handleObj;
-	
-					var ret = handleObj.handler.apply( this, arguments );
-
-					if ( ret !== undefined ) {
-						event.result = ret;
-						if ( ret === false ) {
-							event.preventDefault();
-							event.stopPropagation();
-						}
-					}
-
-					if ( event.isImmediatePropagationStopped() ) {
-						break;
-					}
-				}
-			}
-		}
-
-		return event.result;
-	},
-
-	props: "altKey attrChange attrName bubbles button cancelable charCode clientX clientY ctrlKey currentTarget data detail eventPhase fromElement handler keyCode layerX layerY metaKey newValue offsetX offsetY originalTarget pageX pageY prevValue relatedNode relatedTarget screenX screenY shiftKey srcElement target toElement view wheelDelta which".split(" "),
-
-	fix: function( event ) {
-		if ( event[ expando ] ) {
-			return event;
-		}
-
-		// store a copy of the original event object
-		// and "clone" to set read-only properties
-		var originalEvent = event;
-		event = jQuery.Event( originalEvent );
-
-		for ( var i = this.props.length, prop; i; ) {
-			prop = this.props[ --i ];
-			event[ prop ] = originalEvent[ prop ];
-		}
-
-		// Fix target property, if necessary
-		if ( !event.target ) {
-			event.target = event.srcElement || document; // Fixes #1925 where srcElement might not be defined either
-		}
-
-		// check if target is a textnode (safari)
-		if ( event.target.nodeType === 3 ) {
-			event.target = event.target.parentNode;
-		}
-
-		// Add relatedTarget, if necessary
-		if ( !event.relatedTarget && event.fromElement ) {
-			event.relatedTarget = event.fromElement === event.target ? event.toElement : event.fromElement;
-		}
-
-		// Calculate pageX/Y if missing and clientX/Y available
-		if ( event.pageX == null && event.clientX != null ) {
-			var doc = document.documentElement, body = document.body;
-			event.pageX = event.clientX + (doc && doc.scrollLeft || body && body.scrollLeft || 0) - (doc && doc.clientLeft || body && body.clientLeft || 0);
-			event.pageY = event.clientY + (doc && doc.scrollTop  || body && body.scrollTop  || 0) - (doc && doc.clientTop  || body && body.clientTop  || 0);
-		}
-
-		// Add which for key events
-		if ( !event.which && ((event.charCode || event.charCode === 0) ? event.charCode : event.keyCode) ) {
-			event.which = event.charCode || event.keyCode;
-		}
-
-		// Add metaKey to non-Mac browsers (use ctrl for PC's and Meta for Macs)
-		if ( !event.metaKey && event.ctrlKey ) {
-			event.metaKey = event.ctrlKey;
-		}
-
-		// Add which for click: 1 === left; 2 === middle; 3 === right
-		// Note: button is not normalized, so don't use it
-		if ( !event.which && event.button !== undefined ) {
-			event.which = (event.button & 1 ? 1 : ( event.button & 2 ? 3 : ( event.button & 4 ? 2 : 0 ) ));
-		}
-
-		return event;
-	},
-
-	// Deprecated, use jQuery.guid instead
-	guid: 1E8,
-
-	// Deprecated, use jQuery.proxy instead
-	proxy: jQuery.proxy,
-
-	special: {
-		ready: {
-			// Make sure the ready event is setup
-			setup: jQuery.bindReady,
-			teardown: jQuery.noop
-		},
-
-		live: {
-			add: function( handleObj ) {
-				jQuery.event.add( this, handleObj.origType, jQuery.extend({}, handleObj, {handler: liveHandler}) ); 
-			},
-
-			remove: function( handleObj ) {
-				var remove = true,
-					type = handleObj.origType.replace(rnamespaces, "");
-				
-				jQuery.each( jQuery.data(this, "events").live || [], function() {
-					if ( type === this.origType.replace(rnamespaces, "") ) {
-						remove = false;
-						return false;
-					}
-				});
-
-				if ( remove ) {
-					jQuery.event.remove( this, handleObj.origType, liveHandler );
-				}
-			}
-
-		},
-
-		beforeunload: {
-			setup: function( data, namespaces, eventHandle ) {
-				// We only want to do this special case on windows
-				if ( this.setInterval ) {
-					this.onbeforeunload = eventHandle;
-				}
-
-				return false;
-			},
-			teardown: function( namespaces, eventHandle ) {
-				if ( this.onbeforeunload === eventHandle ) {
-					this.onbeforeunload = null;
-				}
-			}
-		}
-	}
-};
-
-var removeEvent = document.removeEventListener ?
-	function( elem, type, handle ) {
-		elem.removeEventListener( type, handle, false );
-	} : 
-	function( elem, type, handle ) {
-		elem.detachEvent( "on" + type, handle );
-	};
-
-jQuery.Event = function( src ) {
-	// Allow instantiation without the 'new' keyword
-	if ( !this.preventDefault ) {
-		return new jQuery.Event( src );
-	}
-
-	// Event object
-	if ( src && src.type ) {
-		this.originalEvent = src;
-		this.type = src.type;
-	// Event type
-	} else {
-		this.type = src;
-	}
-
-	// timeStamp is buggy for some events on Firefox(#3843)
-	// So we won't rely on the native value
-	this.timeStamp = now();
-
-	// Mark it as fixed
-	this[ expando ] = true;
-};
-
-function returnFalse() {
-	return false;
-}
-function returnTrue() {
-	return true;
-}
+  jQuery.event = {
+
+    // Bind an event to an element
+    // Original by Dean Edwards
+    add: function (elem, types, handler, data) {
+      if (elem.nodeType === 3 || elem.nodeType === 8) {
+        return;
+      }
+
+      // For whatever reason, IE has trouble passing the window object
+      // around, causing it to be cloned in the process
+      if (elem.setInterval && ( elem !== window && !elem.frameElement )) {
+        elem = window;
+      }
+
+      var handleObjIn, handleObj;
+
+      if (handler.handler) {
+        handleObjIn = handler;
+        handler = handleObjIn.handler;
+      }
+
+      // Make sure that the function being executed has a unique ID
+      if (!handler.guid) {
+        handler.guid = jQuery.guid++;
+      }
+
+      // Init the element's event structure
+      var elemData = jQuery.data(elem);
+
+      // If no elemData is found then we must be trying to bind to one of the
+      // banned noData elements
+      if (!elemData) {
+        return;
+      }
+
+      var events = elemData.events = elemData.events || {},
+          eventHandle = elemData.handle, eventHandle;
+
+      if (!eventHandle) {
+        elemData.handle = eventHandle = function () {
+          // Handle the second event of a trigger and when
+          // an event is called after a page has unloaded
+          return typeof jQuery !== "undefined" && !jQuery.event.triggered
+              ? jQuery.event.handle.apply(eventHandle.elem, arguments)
+              : undefined;
+        };
+      }
+
+      // Add elem as a property of the handle function
+      // This is to prevent a memory leak with non-native events in IE.
+      eventHandle.elem = elem;
+
+      // Handle multiple events separated by a space
+      // jQuery(...).bind("mouseover mouseout", fn);
+      types = types.split(" ");
+
+      var type, i = 0, namespaces;
+
+      while ((type = types[i++])) {
+        handleObj = handleObjIn ? jQuery.extend({}, handleObjIn)
+            : {handler: handler, data: data};
+
+        // Namespaced event handlers
+        if (type.indexOf(".") > -1) {
+          namespaces = type.split(".");
+          type = namespaces.shift();
+          handleObj.namespace = namespaces.slice(0).sort().join(".");
+
+        } else {
+          namespaces = [];
+          handleObj.namespace = "";
+        }
+
+        handleObj.type = type;
+        handleObj.guid = handler.guid;
+
+        // Get the current list of functions bound to this event
+        var handlers = events[type],
+            special = jQuery.event.special[type] || {};
+
+        // Init the event handler queue
+        if (!handlers) {
+          handlers = events[type] = [];
+
+          // Check for a special event handler
+          // 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 the function to the element's handler list
+        handlers.push(handleObj);
+
+        // Keep track of which events have been used, for global triggering
+        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, pos) {
+      // don't do events on text and comment nodes
+      if (elem.nodeType === 3 || elem.nodeType === 8) {
+        return;
+      }
+
+      var ret, type, fn, i = 0, all, namespaces, namespace, special, eventType,
+          handleObj, origType,
+          elemData = jQuery.data(elem),
+          events = elemData && elemData.events;
+
+      if (!elemData || !events) {
+        return;
+      }
+
+      // types is actually an event object here
+      if (types && types.type) {
+        handler = types.handler;
+        types = types.type;
+      }
+
+      // Unbind all events for the element
+      if (!types || typeof types === "string" && types.charAt(0) === ".") {
+        types = types || "";
+
+        for (type in events) {
+          jQuery.event.remove(elem, type + types);
+        }
+
+        return;
+      }
+
+      // Handle multiple events separated by a space
+      // jQuery(...).unbind("mouseover mouseout", fn);
+      types = types.split(" ");
+
+      while ((type = types[i++])) {
+        origType = type;
+        handleObj = null;
+        all = type.indexOf(".") < 0;
+        namespaces = [];
+
+        if (!all) {
+          // Namespaced event handlers
+          namespaces = type.split(".");
+          type = namespaces.shift();
+
+          namespace = new RegExp("(^|\\.)" +
+              jQuery.map(namespaces.slice(0).sort(), fcleanup).join(
+                  "\\.(?:.*\\.)?") + "(\\.|$)")
+        }
+
+        eventType = events[type];
+
+        if (!eventType) {
+          continue;
+        }
+
+        if (!handler) {
+          for (var j = 0; j < eventType.length; j++) {
+            handleObj = eventType[j];
+
+            if (all || namespace.test(handleObj.namespace)) {
+              jQuery.event.remove(elem, origType, handleObj.handler, j);
+              eventType.splice(j--, 1);
+            }
+          }
+
+          continue;
+        }
+
+        special = jQuery.event.special[type] || {};
+
+        for (var j = pos || 0; j < eventType.length; j++) {
+          handleObj = eventType[j];
+
+          if (handler.guid === handleObj.guid) {
+            // remove the given handler for the given type
+            if (all || namespace.test(handleObj.namespace)) {
+              if (pos == null) {
+                eventType.splice(j--, 1);
+              }
+
+              if (special.remove) {
+                special.remove.call(elem, handleObj);
+              }
+            }
+
+            if (pos != null) {
+              break;
+            }
+          }
+        }
+
+        // remove generic event handler if no more handlers exist
+        if (eventType.length === 0 || pos != null && eventType.length === 1) {
+          if (!special.teardown || special.teardown.call(elem, namespaces)
+              === false) {
+            removeEvent(elem, type, elemData.handle);
+          }
+
+          ret = null;
+          delete events[type];
+        }
+      }
+
+      // Remove the expando if it's no longer used
+      if (jQuery.isEmptyObject(events)) {
+        var handle = elemData.handle;
+        if (handle) {
+          handle.elem = null;
+        }
+
+        delete elemData.events;
+        delete elemData.handle;
+
+        if (jQuery.isEmptyObject(elemData)) {
+          jQuery.removeData(elem);
+        }
+      }
+    },
+
+    // bubbling is internal
+    trigger: function (event, data, elem /*, bubbling */) {
+      // Event object or event type
+      var type = event.type || event,
+          bubbling = arguments[3];
+
+      if (!bubbling) {
+        event = typeof event === "object" ? // jQuery.Event object
+            event[expando] ? event : // Object literal
+                jQuery.extend(jQuery.Event(type), event)
+            : // Just the event type (string)
+            jQuery.Event(type);
+
+        if (type.indexOf("!") >= 0) {
+          event.type = type = type.slice(0, -1);
+          event.exclusive = true;
+        }
+
+        // Handle a global trigger
+        if (!elem) {
+          // Don't bubble custom events when global (to avoid too much overhead)
+          event.stopPropagation();
+
+          // Only trigger if we've ever bound an event for it
+          if (jQuery.event.global[type]) {
+            jQuery.each(jQuery.cache, function () {
+              if (this.events && this.events[type]) {
+                jQuery.event.trigger(event, data, this.handle.elem);
+              }
+            });
+          }
+        }
+
+        // Handle triggering a single element
+
+        // don't do events on text and comment nodes
+        if (!elem || elem.nodeType === 3 || elem.nodeType === 8) {
+          return undefined;
+        }
+
+        // Clean up in case it is reused
+        event.result = undefined;
+        event.target = elem;
+
+        // Clone the incoming data, if any
+        data = jQuery.makeArray(data);
+        data.unshift(event);
+      }
+
+      event.currentTarget = elem;
+
+      // Trigger the event, it is assumed that "handle" is a function
+      var handle = jQuery.data(elem, "handle");
+      if (handle) {
+        handle.apply(elem, data);
+      }
+
+      var parent = elem.parentNode || elem.ownerDocument;
+
+      // Trigger an inline bound script
+      try {
+        if (!(elem && elem.nodeName
+                && jQuery.noData[elem.nodeName.toLowerCase()])) {
+          if (elem["on" + type] && elem["on" + type].apply(elem, data)
+              === false) {
+            event.result = false;
+          }
+        }
+
+        // prevent IE from throwing an error for some elements with some event types, see #3533
+      } catch (e) {
+      }
+
+      if (!event.isPropagationStopped() && parent) {
+        jQuery.event.trigger(event, data, parent, true);
+
+      } else if (!event.isDefaultPrevented()) {
+        var target = event.target, old,
+            isClick = jQuery.nodeName(target, "a") && type === "click",
+            special = jQuery.event.special[type] || {};
+
+        if ((!special._default || special._default.call(elem, event) === false)
+            &&
+            !isClick && !(target && target.nodeName
+                && jQuery.noData[target.nodeName.toLowerCase()])) {
+
+          try {
+            if (target[type]) {
+              // Make sure that we don't accidentally re-trigger the onFOO events
+              old = target["on" + type];
+
+              if (old) {
+                target["on" + type] = null;
+              }
+
+              jQuery.event.triggered = true;
+              target[type]();
+            }
+
+            // prevent IE from throwing an error for some elements with some event types, see #3533
+          } catch (e) {
+          }
+
+          if (old) {
+            target["on" + type] = old;
+          }
+
+          jQuery.event.triggered = false;
+        }
+      }
+    },
+
+    handle: function (event) {
+      var all, handlers, namespaces, namespace, events;
+
+      event = arguments[0] = jQuery.event.fix(event || window.event);
+      event.currentTarget = this;
+
+      // Namespaced event handlers
+      all = event.type.indexOf(".") < 0 && !event.exclusive;
+
+      if (!all) {
+        namespaces = event.type.split(".");
+        event.type = namespaces.shift();
+        namespace = new RegExp("(^|\\.)" + namespaces.slice(0).sort().join(
+            "\\.(?:.*\\.)?") + "(\\.|$)");
+      }
+
+      var events = jQuery.data(this, "events"), handlers = events[event.type];
+
+      if (events && handlers) {
+        // Clone the handlers to prevent manipulation
+        handlers = handlers.slice(0);
+
+        for (var j = 0, l = handlers.length; j < l; j++) {
+          var handleObj = handlers[j];
+
+          // Filter the functions by class
+          if (all || namespace.test(handleObj.namespace)) {
+            // Pass in a reference to the handler function itself
+            // So that we can later remove it
+            event.handler = handleObj.handler;
+            event.data = handleObj.data;
+            event.handleObj = handleObj;
+
+            var ret = handleObj.handler.apply(this, arguments);
+
+            if (ret !== undefined) {
+              event.result = ret;
+              if (ret === false) {
+                event.preventDefault();
+                event.stopPropagation();
+              }
+            }
+
+            if (event.isImmediatePropagationStopped()) {
+              break;
+            }
+          }
+        }
+      }
+
+      return event.result;
+    },
+
+    props: "altKey attrChange attrName bubbles button cancelable charCode clientX clientY ctrlKey currentTarget data detail eventPhase fromElement handler keyCode layerX layerY metaKey newValue offsetX offsetY originalTarget pageX pageY prevValue relatedNode relatedTarget screenX screenY shiftKey srcElement target toElement view wheelDelta which".split(
+        " "),
+
+    fix: function (event) {
+      if (event[expando]) {
+        return event;
+      }
+
+      // store a copy of the original event object
+      // and "clone" to set read-only properties
+      var originalEvent = event;
+      event = jQuery.Event(originalEvent);
+
+      for (var i = this.props.length, prop; i;) {
+        prop = this.props[--i];
+        event[prop] = originalEvent[prop];
+      }
+
+      // Fix target property, if necessary
+      if (!event.target) {
+        event.target = event.srcElement || document; // Fixes #1925 where srcElement might not be defined either
+      }
+
+      // check if target is a textnode (safari)
+      if (event.target.nodeType === 3) {
+        event.target = event.target.parentNode;
+      }
+
+      // Add relatedTarget, if necessary
+      if (!event.relatedTarget && event.fromElement) {
+        event.relatedTarget = event.fromElement === event.target
+            ? event.toElement : event.fromElement;
+      }
+
+      // Calculate pageX/Y if missing and clientX/Y available
+      if (event.pageX == null && event.clientX != null) {
+        var doc = document.documentElement, body = document.body;
+        event.pageX = event.clientX + (doc && doc.scrollLeft || body
+            && body.scrollLeft || 0) - (doc && doc.clientLeft || body
+            && body.clientLeft || 0);
+        event.pageY = event.clientY + (doc && doc.scrollTop || body
+            && body.scrollTop || 0) - (doc && doc.clientTop || body
+            && body.clientTop || 0);
+      }
+
+      // Add which for key events
+      if (!event.which && ((event.charCode || event.charCode === 0)
+              ? event.charCode : event.keyCode)) {
+        event.which = event.charCode || event.keyCode;
+      }
+
+      // Add metaKey to non-Mac browsers (use ctrl for PC's and Meta for Macs)
+      if (!event.metaKey && event.ctrlKey) {
+        event.metaKey = event.ctrlKey;
+      }
+
+      // Add which for click: 1 === left; 2 === middle; 3 === right
+      // Note: button is not normalized, so don't use it
+      if (!event.which && event.button !== undefined) {
+        event.which = (event.button & 1 ? 1 : ( event.button & 2 ? 3
+            : ( event.button & 4 ? 2 : 0 ) ));
+      }
+
+      return event;
+    },
+
+    // Deprecated, use jQuery.guid instead
+    guid: 1E8,
+
+    // Deprecated, use jQuery.proxy instead
+    proxy: jQuery.proxy,
+
+    special: {
+      ready: {
+        // Make sure the ready event is setup
+        setup: jQuery.bindReady,
+        teardown: jQuery.noop
+      },
+
+      live: {
+        add: function (handleObj) {
+          jQuery.event.add(this, handleObj.origType,
+              jQuery.extend({}, handleObj, {handler: liveHandler}));
+        },
+
+        remove: function (handleObj) {
+          var remove = true,
+              type = handleObj.origType.replace(rnamespaces, "");
+
+          jQuery.each(jQuery.data(this, "events").live || [], function () {
+            if (type === this.origType.replace(rnamespaces, "")) {
+              remove = false;
+              return false;
+            }
+          });
+
+          if (remove) {
+            jQuery.event.remove(this, handleObj.origType, liveHandler);
+          }
+        }
+
+      },
+
+      beforeunload: {
+        setup: function (data, namespaces, eventHandle) {
+          // We only want to do this special case on windows
+          if (this.setInterval) {
+            this.onbeforeunload = eventHandle;
+          }
+
+          return false;
+        },
+        teardown: function (namespaces, eventHandle) {
+          if (this.onbeforeunload === eventHandle) {
+            this.onbeforeunload = null;
+          }
+        }
+      }
+    }
+  };
+
+  var removeEvent = document.removeEventListener ? function (elem, type,
+      handle) {
+    elem.removeEventListener(type, handle, false);
+  } : function (elem, type, handle) {
+    elem.detachEvent("on" + type, handle);
+  };
+
+  jQuery.Event = function (src) {
+    // Allow instantiation without the 'new' keyword
+    if (!this.preventDefault) {
+      return new jQuery.Event(src);
+    }
+
+    // Event object
+    if (src && src.type) {
+      this.originalEvent = src;
+      this.type = src.type;
+      // Event type
+    } else {
+      this.type = src;
+    }
+
+    // timeStamp is buggy for some events on Firefox(#3843)
+    // So we won't rely on the native value
+    this.timeStamp = now();
+
+    // Mark it as fixed
+    this[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)
-		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
-};
+  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)
+      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
+  };
 
 // Checks if an event happened on an element within another element
 // Used in jQuery.event.special.mouseenter and mouseleave handlers
-var withinElement = function( event ) {
-	// Check if mouse(over|out) are still within the same parent element
-	var parent = event.relatedTarget;
-
-	// Firefox sometimes assigns relatedTarget a XUL element
-	// which we cannot access the parentNode property of
-	try {
-		// Traverse up the tree
-		while ( parent && parent !== this ) {
-			parent = parent.parentNode;
-		}
-
-		if ( parent !== this ) {
-			// set the correct event type
-			event.type = event.data;
-
-			// handle event if we actually just moused on to a non sub-element
-			jQuery.event.handle.apply( this, arguments );
-		}
-
-	// assuming we've left the element since we most likely mousedover a xul element
-	} catch(e) { }
-},
+  var withinElement = function (event) {
+        // Check if mouse(over|out) are still within the same parent element
+        var parent = event.relatedTarget;
+
+        // Firefox sometimes assigns relatedTarget a XUL element
+        // which we cannot access the parentNode property of
+        try {
+          // Traverse up the tree
+          while (parent && parent !== this) {
+            parent = parent.parentNode;
+          }
+
+          if (parent !== this) {
+            // set the correct event type
+            event.type = event.data;
+
+            // handle event if we actually just moused on to a non sub-element
+            jQuery.event.handle.apply(this, arguments);
+          }
+
+          // assuming we've left the element since we most likely mousedover a xul element
+        } catch (e) {
+        }
+      },
 
 // In case of event delegation, we only need to rename the event.type,
 // liveHandler will take care of the rest.
-delegate = function( event ) {
-	event.type = event.data;
-	jQuery.event.handle.apply( this, arguments );
-};
+      delegate = function (event) {
+        event.type = event.data;
+        jQuery.event.handle.apply(this, arguments);
+      };
 
 // Create mouseenter and mouseleave events
-jQuery.each({
-	mouseenter: "mouseover",
-	mouseleave: "mouseout"
-}, function( orig, fix ) {
-	jQuery.event.special[ orig ] = {
-		setup: function( data ) {
-			jQuery.event.add( this, fix, data && data.selector ? delegate : withinElement, orig );
-		},
-		teardown: function( data ) {
-			jQuery.event.remove( this, fix, data && data.selector ? delegate : withinElement );
-		}
-	};
-});
+  jQuery.each({
+    mouseenter: "mouseover",
+    mouseleave: "mouseout"
+  }, function (orig, fix) {
+    jQuery.event.special[orig] = {
+      setup: function (data) {
+        jQuery.event.add(this, fix,
+            data && data.selector ? delegate : withinElement, orig);
+      },
+      teardown: function (data) {
+        jQuery.event.remove(this, fix,
+            data && data.selector ? delegate : withinElement);
+      }
+    };
+  });
 
 // submit delegation
-if ( !jQuery.support.submitBubbles ) {
-
-	jQuery.event.special.submit = {
-		setup: function( data, namespaces ) {
-			if ( this.nodeName.toLowerCase() !== "form" ) {
-				jQuery.event.add(this, "click.specialSubmit", function( e ) {
-					var elem = e.target, type = elem.type;
-
-					if ( (type === "submit" || type === "image") && jQuery( elem ).closest("form").length ) {
-						return trigger( "submit", this, arguments );
-					}
-				});
-	 
-				jQuery.event.add(this, "keypress.specialSubmit", function( e ) {
-					var elem = e.target, type = elem.type;
-
-					if ( (type === "text" || type === "password") && jQuery( elem ).closest("form").length && e.keyCode === 13 ) {
-						return trigger( "submit", this, arguments );
-					}
-				});
-
-			} else {
-				return false;
-			}
-		},
-
-		teardown: function( namespaces ) {
-			jQuery.event.remove( this, ".specialSubmit" );
-		}
-	};
-
-}
+  if (!jQuery.support.submitBubbles) {
+
+    jQuery.event.special.submit = {
+      setup: function (data, namespaces) {
+        if (this.nodeName.toLowerCase() !== "form") {
+          jQuery.event.add(this, "click.specialSubmit", function (e) {
+            var elem = e.target, type = elem.type;
+
+            if ((type === "submit" || type === "image") && jQuery(elem).closest(
+                    "form").length) {
+              return trigger("submit", this, arguments);
+            }
+          });
+
+          jQuery.event.add(this, "keypress.specialSubmit", function (e) {
+            var elem = e.target, type = elem.type;
+
+            if ((type === "text" || type === "password") && jQuery(
+                    elem).closest("form").length && e.keyCode === 13) {
+              return trigger("submit", this, arguments);
+            }
+          });
+
+        } else {
+          return false;
+        }
+      },
+
+      teardown: function (namespaces) {
+        jQuery.event.remove(this, ".specialSubmit");
+      }
+    };
+
+  }
 
 // change delegation, happens here so we have bind.
-if ( !jQuery.support.changeBubbles ) {
-
-	var formElems = /textarea|input|select/i,
-
-	changeFilters,
-
-	getVal = function( elem ) {
-		var type = elem.type, val = elem.value;
-
-		if ( type === "radio" || type === "checkbox" ) {
-			val = elem.checked;
-
-		} else if ( type === "select-multiple" ) {
-			val = elem.selectedIndex > -1 ?
-				jQuery.map( elem.options, function( elem ) {
-					return elem.selected;
-				}).join("-") :
-				"";
-
-		} else if ( elem.nodeName.toLowerCase() === "select" ) {
-			val = elem.selectedIndex;
-		}
-
-		return val;
-	},
-
-	testChange = function testChange( e ) {
-		var elem = e.target, data, val;
-
-		if ( !formElems.test( elem.nodeName ) || elem.readOnly ) {
-			return;
-		}
-
-		data = jQuery.data( elem, "_change_data" );
-		val = getVal(elem);
-
-		// the current data will be also retrieved by beforeactivate
-		if ( e.type !== "focusout" || elem.type !== "radio" ) {
-			jQuery.data( elem, "_change_data", val );
-		}
-		
-		if ( data === undefined || val === data ) {
-			return;
-		}
-
-		if ( data != null || val ) {
-			e.type = "change";
-			return jQuery.event.trigger( e, arguments[1], elem );
-		}
-	};
-
-	jQuery.event.special.change = {
-		filters: {
-			focusout: testChange, 
-
-			click: function( e ) {
-				var elem = e.target, type = elem.type;
-
-				if ( type === "radio" || type === "checkbox" || elem.nodeName.toLowerCase() === "select" ) {
-					return testChange.call( this, e );
-				}
-			},
-
-			// Change has to be called before submit
-			// Keydown will be called before keypress, which is used in submit-event delegation
-			keydown: function( e ) {
-				var elem = e.target, type = elem.type;
-
-				if ( (e.keyCode === 13 && elem.nodeName.toLowerCase() !== "textarea") ||
-					(e.keyCode === 32 && (type === "checkbox" || type === "radio")) ||
-					type === "select-multiple" ) {
-					return testChange.call( this, e );
-				}
-			},
-
-			// Beforeactivate happens also before the previous element is blurred
-			// with this event you can't trigger a change event, but you can store
-			// information/focus[in] is not needed anymore
-			beforeactivate: function( e ) {
-				var elem = e.target;
-				jQuery.data( elem, "_change_data", getVal(elem) );
-			}
-		},
-
-		setup: function( data, namespaces ) {
-			if ( this.type === "file" ) {
-				return false;
-			}
-
-			for ( var type in changeFilters ) {
-				jQuery.event.add( this, type + ".specialChange", changeFilters[type] );
-			}
-
-			return formElems.test( this.nodeName );
-		},
-
-		teardown: function( namespaces ) {
-			jQuery.event.remove( this, ".specialChange" );
-
-			return formElems.test( this.nodeName );
-		}
-	};
-
-	changeFilters = jQuery.event.special.change.filters;
-}
-
-function trigger( type, elem, args ) {
-	args[0].type = type;
-	return jQuery.event.handle.apply( elem, args );
-}
+  if (!jQuery.support.changeBubbles) {
+
+    var formElems = /textarea|input|select/i,
+
+        changeFilters,
+
+        getVal = function (elem) {
+          var type = elem.type, val = elem.value;
+
+          if (type === "radio" || type === "checkbox") {
+            val = elem.checked;
+
+          } else if (type === "select-multiple") {
+            val = elem.selectedIndex > -1 ? jQuery.map(elem.options,
+                function (elem) {
+                  return elem.selected;
+                }).join("-") : "";
+
+          } else if (elem.nodeName.toLowerCase() === "select") {
+            val = elem.selectedIndex;
+          }
+
+          return val;
+        },
+
+        testChange = function testChange(e) {
+          var elem = e.target, data, val;
+
+          if (!formElems.test(elem.nodeName) || elem.readOnly) {
+            return;
+          }
+
+          data = jQuery.data(elem, "_change_data");
+          val = getVal(elem);
+
+          // the current data will be also retrieved by beforeactivate
+          if (e.type !== "focusout" || elem.type !== "radio") {
+            jQuery.data(elem, "_change_data", val);
+          }
+
+          if (data === undefined || val === data) {
+            return;
+          }
+
+          if (data != null || val) {
+            e.type = "change";
+            return jQuery.event.trigger(e, arguments[1], elem);
+          }
+        };
+
+    jQuery.event.special.change = {
+      filters: {
+        focusout: testChange,
+
+        click: function (e) {
+          var elem = e.target, type = elem.type;
+
+          if (type === "radio" || type === "checkbox"
+              || elem.nodeName.toLowerCase() === "select") {
+            return testChange.call(this, e);
+          }
+        },
+
+        // Change has to be called before submit
+        // Keydown will be called before keypress, which is used in submit-event delegation
+        keydown: function (e) {
+          var elem = e.target, type = elem.type;
+
+          if ((e.keyCode === 13 && elem.nodeName.toLowerCase() !== "textarea")
+              ||
+              (e.keyCode === 32 && (type === "checkbox" || type === "radio")) ||
+              type === "select-multiple") {
+            return testChange.call(this, e);
+          }
+        },
+
+        // Beforeactivate happens also before the previous element is blurred
+        // with this event you can't trigger a change event, but you can store
+        // information/focus[in] is not needed anymore
+        beforeactivate: function (e) {
+          var elem = e.target;
+          jQuery.data(elem, "_change_data", getVal(elem));
+        }
+      },
+
+      setup: function (data, namespaces) {
+        if (this.type === "file") {
+          return false;
+        }
+
+        for (var type in changeFilters) {
+          jQuery.event.add(this, type + ".specialChange", changeFilters[type]);
+        }
+
+        return formElems.test(this.nodeName);
+      },
+
+      teardown: function (namespaces) {
+        jQuery.event.remove(this, ".specialChange");
+
+        return formElems.test(this.nodeName);
+      }
+    };
+
+    changeFilters = jQuery.event.special.change.filters;
+  }
+
+  function trigger(type, elem, args) {
+    args[0].type = type;
+    return jQuery.event.handle.apply(elem, args);
+  }
 
 // Create "bubbling" focus and blur events
-if ( document.addEventListener ) {
-	jQuery.each({ focus: "focusin", blur: "focusout" }, function( orig, fix ) {
-		jQuery.event.special[ fix ] = {
-			setup: function() {
-				this.addEventListener( orig, handler, true );
-			}, 
-			teardown: function() { 
-				this.removeEventListener( orig, handler, true );
-			}
-		};
-
-		function handler( e ) { 
-			e = jQuery.event.fix( e );
-			e.type = fix;
-			return jQuery.event.handle.call( this, e );
-		}
-	});
-}
-
-jQuery.each(["bind", "one"], function( i, name ) {
-	jQuery.fn[ name ] = function( type, data, fn ) {
-		// Handle object literals
-		if ( typeof type === "object" ) {
-			for ( var key in type ) {
-				this[ name ](key, data, type[key], fn);
-			}
-			return this;
-		}
-		
-		if ( jQuery.isFunction( data ) ) {
-			fn = data;
-			data = undefined;
-		}
-
-		var handler = name === "one" ? jQuery.proxy( fn, function( event ) {
-			jQuery( this ).unbind( event, handler );
-			return fn.apply( this, arguments );
-		}) : fn;
-
-		if ( type === "unload" && name !== "one" ) {
-			this.one( type, data, fn );
-
-		} else {
-			for ( var i = 0, l = this.length; i < l; i++ ) {
-				jQuery.event.add( this[i], type, handler, data );
-			}
-		}
-
-		return this;
-	};
-});
-
-jQuery.fn.extend({
-	unbind: function( type, fn ) {
-		// Handle object literals
-		if ( typeof type === "object" && !type.preventDefault ) {
-			for ( var key in type ) {
-				this.unbind(key, type[key]);
-			}
-
-		} else {
-			for ( var i = 0, l = this.length; i < l; i++ ) {
-				jQuery.event.remove( this[i], type, fn );
-			}
-		}
-
-		return this;
-	},
-	
-	delegate: function( selector, types, data, fn ) {
-		return this.live( types, data, fn, selector );
-	},
-	
-	undelegate: function( selector, types, fn ) {
-		if ( arguments.length === 0 ) {
-				return this.unbind( "live" );
-		
-		} else {
-			return this.die( types, null, fn, selector );
-		}
-	},
-	
-	trigger: function( type, data ) {
-		return this.each(function() {
-			jQuery.event.trigger( type, data, this );
-		});
-	},
-
-	triggerHandler: function( type, data ) {
-		if ( this[0] ) {
-			var event = jQuery.Event( type );
-			event.preventDefault();
-			event.stopPropagation();
-			jQuery.event.trigger( event, data, this[0] );
-			return event.result;
-		}
-	},
-
-	toggle: function( fn ) {
-		// Save reference to arguments for access in closure
-		var args = arguments, i = 1;
-
-		// link all the functions, so any of them can unbind this click handler
-		while ( i < args.length ) {
-			jQuery.proxy( fn, args[ i++ ] );
-		}
-
-		return this.click( jQuery.proxy( fn, 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;
-		}));
-	},
-
-	hover: function( fnOver, fnOut ) {
-		return this.mouseenter( fnOver ).mouseleave( fnOut || fnOver );
-	}
-});
-
-var liveMap = {
-	focus: "focusin",
-	blur: "focusout",
-	mouseenter: "mouseover",
-	mouseleave: "mouseout"
-};
-
-jQuery.each(["live", "die"], function( i, name ) {
-	jQuery.fn[ name ] = function( types, data, fn, origSelector /* Internal Use Only */ ) {
-		var type, i = 0, match, namespaces, preType,
-			selector = origSelector || this.selector,
-			context = origSelector ? this : jQuery( this.context );
-
-		if ( jQuery.isFunction( data ) ) {
-			fn = data;
-			data = undefined;
-		}
-
-		types = (types || "").split(" ");
-
-		while ( (type = types[ i++ ]) != null ) {
-			match = rnamespaces.exec( type );
-			namespaces = "";
-
-			if ( match )  {
-				namespaces = match[0];
-				type = type.replace( rnamespaces, "" );
-			}
-
-			if ( type === "hover" ) {
-				types.push( "mouseenter" + namespaces, "mouseleave" + namespaces );
-				continue;
-			}
-
-			preType = type;
-
-			if ( type === "focus" || type === "blur" ) {
-				types.push( liveMap[ type ] + namespaces );
-				type = type + namespaces;
-
-			} else {
-				type = (liveMap[ type ] || type) + namespaces;
-			}
-
-			if ( name === "live" ) {
-				// bind live handler
-				context.each(function(){
-					jQuery.event.add( this, liveConvert( type, selector ),
-						{ data: data, selector: selector, handler: fn, origType: type, origHandler: fn, preType: preType } );
-				});
-
-			} else {
-				// unbind live handler
-				context.unbind( liveConvert( type, selector ), fn );
-			}
-		}
-		
-		return this;
-	}
-});
-
-function liveHandler( event ) {
-	var stop, elems = [], selectors = [], args = arguments,
-		related, match, handleObj, elem, j, i, l, data,
-		events = jQuery.data( this, "events" );
-
-	// Make sure we avoid non-left-click bubbling in Firefox (#3861)
-	if ( event.liveFired === this || !events || !events.live || event.button && event.type === "click" ) {
-		return;
-	}
-
-	event.liveFired = this;
-
-	var live = events.live.slice(0);
-
-	for ( j = 0; j < live.length; j++ ) {
-		handleObj = live[j];
-
-		if ( handleObj.origType.replace( rnamespaces, "" ) === event.type ) {
-			selectors.push( handleObj.selector );
-
-		} else {
-			live.splice( j--, 1 );
-		}
-	}
-
-	match = jQuery( event.target ).closest( selectors, event.currentTarget );
-
-	for ( i = 0, l = match.length; i < l; i++ ) {
-		for ( j = 0; j < live.length; j++ ) {
-			handleObj = live[j];
-
-			if ( match[i].selector === handleObj.selector ) {
-				elem = match[i].elem;
-				related = null;
-
-				// Those two events require additional checking
-				if ( handleObj.preType === "mouseenter" || handleObj.preType === "mouseleave" ) {
-					related = jQuery( event.relatedTarget ).closest( handleObj.selector )[0];
-				}
-
-				if ( !related || related !== elem ) {
-					elems.push({ elem: elem, handleObj: handleObj });
-				}
-			}
-		}
-	}
-
-	for ( i = 0, l = elems.length; i < l; i++ ) {
-		match = elems[i];
-		event.currentTarget = match.elem;
-		event.data = match.handleObj.data;
-		event.handleObj = match.handleObj;
-
-		if ( match.handleObj.origHandler.apply( match.elem, args ) === false ) {
-			stop = false;
-			break;
-		}
-	}
-
-	return stop;
-}
-
-function liveConvert( type, selector ) {
-	return "live." + (type && type !== "*" ? type + "." : "") + selector.replace(/\./g, "`").replace(/ /g, "&");
-}
-
-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").split(" "), function( i, name ) {
-
-	// Handle event binding
-	jQuery.fn[ name ] = function( fn ) {
-		return fn ? this.bind( name, fn ) : this.trigger( name );
-	};
-
-	if ( jQuery.attrFn ) {
-		jQuery.attrFn[ name ] = true;
-	}
-});
+  if (document.addEventListener) {
+    jQuery.each({focus: "focusin", blur: "focusout"}, function (orig, fix) {
+      jQuery.event.special[fix] = {
+        setup: function () {
+          this.addEventListener(orig, handler, true);
+        },
+        teardown: function () {
+          this.removeEventListener(orig, handler, true);
+        }
+      };
+
+      function handler(e) {
+        e = jQuery.event.fix(e);
+        e.type = fix;
+        return jQuery.event.handle.call(this, e);
+      }
+    });
+  }
+
+  jQuery.each(["bind", "one"], function (i, name) {
+    jQuery.fn[name] = function (type, data, fn) {
+      // Handle object literals
+      if (typeof type === "object") {
+        for (var key in type) {
+          this[name](key, data, type[key], fn);
+        }
+        return this;
+      }
+
+      if (jQuery.isFunction(data)) {
+        fn = data;
+        data = undefined;
+      }
+
+      var handler = name === "one" ? jQuery.proxy(fn, function (event) {
+        jQuery(this).unbind(event, handler);
+        return fn.apply(this, arguments);
+      }) : fn;
+
+      if (type === "unload" && name !== "one") {
+        this.one(type, data, fn);
+
+      } else {
+        for (var i = 0, l = this.length; i < l; i++) {
+          jQuery.event.add(this[i], type, handler, data);
+        }
+      }
+
+      return this;
+    };
+  });
+
+  jQuery.fn.extend({
+    unbind: function (type, fn) {
+      // Handle object literals
+      if (typeof type === "object" && !type.preventDefault) {
+        for (var key in type) {
+          this.unbind(key, type[key]);
+        }
+
+      } else {
+        for (var i = 0, l = this.length; i < l; i++) {
+          jQuery.event.remove(this[i], type, fn);
+        }
+      }
+
+      return this;
+    },
+
+    delegate: function (selector, types, data, fn) {
+      return this.live(types, data, fn, selector);
+    },
+
+    undelegate: function (selector, types, fn) {
+      if (arguments.length === 0) {
+        return this.unbind("live");
+
+      } else {
+        return this.die(types, null, fn, selector);
+      }
+    },
+
+    trigger: function (type, data) {
+      return this.each(function () {
+        jQuery.event.trigger(type, data, this);
+      });
+    },
+
+    triggerHandler: function (type, data) {
+      if (this[0]) {
+        var event = jQuery.Event(type);
+        event.preventDefault();
+        event.stopPropagation();
+        jQuery.event.trigger(event, data, this[0]);
+        return event.result;
+      }
+    },
+
+    toggle: function (fn) {
+      // Save reference to arguments for access in closure
+      var args = arguments, i = 1;
+
+      // link all the functions, so any of them can unbind this click handler
+      while (i < args.length) {
+        jQuery.proxy(fn, args[i++]);
+      }
+
+      return this.click(jQuery.proxy(fn, 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;
+      }));
+    },
+
+    hover: function (fnOver, fnOut) {
+      return this.mouseenter(fnOver).mouseleave(fnOut || fnOver);
+    }
+  });
+
+  var liveMap = {
+    focus: "focusin",
+    blur: "focusout",
+    mouseenter: "mouseover",
+    mouseleave: "mouseout"
+  };
+
+  jQuery.each(["live", "die"], function (i, name) {
+    jQuery.fn[name] = function (types, data, fn, origSelector
+        /* Internal Use Only */) {
+      var type, i = 0, match, namespaces, preType,
+          selector = origSelector || this.selector,
+          context = origSelector ? this : jQuery(this.context);
+
+      if (jQuery.isFunction(data)) {
+        fn = data;
+        data = undefined;
+      }
+
+      types = (types || "").split(" ");
+
+      while ((type = types[i++]) != null) {
+        match = rnamespaces.exec(type);
+        namespaces = "";
+
+        if (match) {
+          namespaces = match[0];
+          type = type.replace(rnamespaces, "");
+        }
+
+        if (type === "hover") {
+          types.push("mouseenter" + namespaces, "mouseleave" + namespaces);
+          continue;
+        }
+
+        preType = type;
+
+        if (type === "focus" || type === "blur") {
+          types.push(liveMap[type] + namespaces);
+          type = type + namespaces;
+
+        } else {
+          type = (liveMap[type] || type) + namespaces;
+        }
+
+        if (name === "live") {
+          // bind live handler
+          context.each(function () {
+            jQuery.event.add(this, liveConvert(type, selector),
+                {
+                  data: data,
+                  selector: selector,
+                  handler: fn,
+                  origType: type,
+                  origHandler: fn,
+                  preType: preType
+                });
+          });
+
+        } else {
+          // unbind live handler
+          context.unbind(liveConvert(type, selector), fn);
+        }
+      }
+
+      return this;
+    }
+  });
+
+  function liveHandler(event) {
+    var stop, elems = [], selectors = [], args = arguments,
+        related, match, handleObj, elem, j, i, l, data,
+        events = jQuery.data(this, "events");
+
+    // Make sure we avoid non-left-click bubbling in Firefox (#3861)
+    if (event.liveFired === this || !events || !events.live || event.button
+        && event.type === "click") {
+      return;
+    }
+
+    event.liveFired = this;
+
+    var live = events.live.slice(0);
+
+    for (j = 0; j < live.length; j++) {
+      handleObj = live[j];
+
+      if (handleObj.origType.replace(rnamespaces, "") === event.type) {
+        selectors.push(handleObj.selector);
+
+      } else {
+        live.splice(j--, 1);
+      }
+    }
+
+    match = jQuery(event.target).closest(selectors, event.currentTarget);
+
+    for (i = 0, l = match.length; i < l; i++) {
+      for (j = 0; j < live.length; j++) {
+        handleObj = live[j];
+
+        if (match[i].selector === handleObj.selector) {
+          elem = match[i].elem;
+          related = null;
+
+          // Those two events require additional checking
+          if (handleObj.preType === "mouseenter" || handleObj.preType
+              === "mouseleave") {
+            related = jQuery(event.relatedTarget).closest(
+                handleObj.selector)[0];
+          }
+
+          if (!related || related !== elem) {
+            elems.push({elem: elem, handleObj: handleObj});
+          }
+        }
+      }
+    }
+
+    for (i = 0, l = elems.length; i < l; i++) {
+      match = elems[i];
+      event.currentTarget = match.elem;
+      event.data = match.handleObj.data;
+      event.handleObj = match.handleObj;
+
+      if (match.handleObj.origHandler.apply(match.elem, args) === false) {
+        stop = false;
+        break;
+      }
+    }
+
+    return stop;
+  }
+
+  function liveConvert(type, selector) {
+    return "live." + (type && type !== "*" ? type + "." : "")
+        + selector.replace(/\./g, "`").replace(/ /g, "&");
+  }
+
+  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").split(" "),
+      function (i, name) {
+
+        // Handle event binding
+        jQuery.fn[name] = function (fn) {
+          return fn ? this.bind(name, fn) : this.trigger(name);
+        };
+
+        if (jQuery.attrFn) {
+          jQuery.attrFn[name] = true;
+        }
+      });
 
 // Prevent memory leaks in IE
 // Window isn't included so as not to unbind existing unload events
 // More info:
 //  - http://isaacschlueter.com/2006/10/msie-memory-leaks/
-if ( window.attachEvent && !window.addEventListener ) {
-	window.attachEvent("onunload", function() {
-		for ( var id in jQuery.cache ) {
-			if ( jQuery.cache[ id ].handle ) {
-				// Try/Catch is to handle iframes being unloaded, see #4280
-				try {
-					jQuery.event.remove( jQuery.cache[ id ].handle.elem );
-				} catch(e) {}
-			}
-		}
-	});
-}
-/*!
+  if (window.attachEvent && !window.addEventListener) {
+    window.attachEvent("onunload", function () {
+      for (var id in jQuery.cache) {
+        if (jQuery.cache[id].handle) {
+          // Try/Catch is to handle iframes being unloaded, see #4280
+          try {
+            jQuery.event.remove(jQuery.cache[id].handle.elem);
+          } catch (e) {
+          }
+        }
+      }
+    });
+  }
+  /*!
  * Sizzle CSS Selector Engine - v1.0
  *  Copyright 2009, The Dojo Foundation
  *  Released under the MIT, BSD, and GPL Licenses.
  *  More information: http://sizzlejs.com/
  */
-(function(){
+  (function () {
 
-var chunker = /((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^[\]]*\]|['"][^'"]*['"]|[^[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,
-	done = 0,
-	toString = Object.prototype.toString,
-	hasDuplicate = false,
-	baseHasDuplicate = true;
+    var chunker = /((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^[\]]*\]|['"][^'"]*['"]|[^[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,
+        done = 0,
+        toString = Object.prototype.toString,
+        hasDuplicate = false,
+        baseHasDuplicate = true;
 
 // Here we check if the JavaScript engine is using some sort of
 // optimization where it does not always call our comparision
 // function. If that is the case, discard the hasDuplicate value.
 //   Thus far that includes Google Chrome.
-[0, 0].sort(function(){
-	baseHasDuplicate = false;
-	return 0;
-});
-
-var Sizzle = function(selector, context, results, seed) {
-	results = results || [];
-	var origContext = context = context || document;
-
-	if ( context.nodeType !== 1 && context.nodeType !== 9 ) {
-		return [];
-	}
-	
-	if ( !selector || typeof selector !== "string" ) {
-		return results;
-	}
-
-	var parts = [], m, set, checkSet, extra, prune = true, contextXML = isXML(context),
-		soFar = selector;
-	
-	// Reset the position of the chunker regexp (start from head)
-	while ( (chunker.exec(""), m = chunker.exec(soFar)) !== null ) {
-		soFar = m[3];
-		
-		parts.push( m[1] );
-		
-		if ( m[2] ) {
-			extra = m[3];
-			break;
-		}
-	}
-
-	if ( parts.length > 1 && origPOS.exec( selector ) ) {
-		if ( parts.length === 2 && Expr.relative[ parts[0] ] ) {
-			set = posProcess( parts[0] + parts[1], context );
-		} else {
-			set = Expr.relative[ parts[0] ] ?
-				[ context ] :
-				Sizzle( parts.shift(), context );
-
-			while ( parts.length ) {
-				selector = parts.shift();
-
-				if ( Expr.relative[ selector ] ) {
-					selector += parts.shift();
-				}
-				
-				set = posProcess( selector, set );
-			}
-		}
-	} else {
-		// Take a shortcut and set the context if the root selector is an ID
-		// (but not if it'll be faster if the inner selector is an ID)
-		if ( !seed && parts.length > 1 && context.nodeType === 9 && !contextXML &&
-				Expr.match.ID.test(parts[0]) && !Expr.match.ID.test(parts[parts.length - 1]) ) {
-			var ret = Sizzle.find( parts.shift(), context, contextXML );
-			context = ret.expr ? Sizzle.filter( ret.expr, ret.set )[0] : ret.set[0];
-		}
-
-		if ( context ) {
-			var ret = seed ?
-				{ expr: parts.pop(), set: makeArray(seed) } :
-				Sizzle.find( parts.pop(), parts.length === 1 && (parts[0] === "~" || parts[0] === "+") && context.parentNode ? context.parentNode : context, contextXML );
-			set = ret.expr ? Sizzle.filter( ret.expr, ret.set ) : ret.set;
-
-			if ( parts.length > 0 ) {
-				checkSet = makeArray(set);
-			} else {
-				prune = false;
-			}
-
-			while ( parts.length ) {
-				var cur = parts.pop(), pop = cur;
-
-				if ( !Expr.relative[ cur ] ) {
-					cur = "";
-				} else {
-					pop = parts.pop();
-				}
-
-				if ( pop == null ) {
-					pop = context;
-				}
-
-				Expr.relative[ cur ]( checkSet, pop, contextXML );
-			}
-		} else {
-			checkSet = parts = [];
-		}
-	}
-
-	if ( !checkSet ) {
-		checkSet = set;
-	}
-
-	if ( !checkSet ) {
-		Sizzle.error( cur || selector );
-	}
-
-	if ( toString.call(checkSet) === "[object Array]" ) {
-		if ( !prune ) {
-			results.push.apply( results, checkSet );
-		} else if ( context && context.nodeType === 1 ) {
-			for ( var i = 0; checkSet[i] != null; i++ ) {
-				if ( checkSet[i] && (checkSet[i] === true || checkSet[i].nodeType === 1 && contains(context, checkSet[i])) ) {
-					results.push( set[i] );
-				}
-			}
-		} else {
-			for ( var i = 0; checkSet[i] != null; i++ ) {
-				if ( checkSet[i] && checkSet[i].nodeType === 1 ) {
-					results.push( set[i] );
-				}
-			}
-		}
-	} else {
-		makeArray( checkSet, results );
-	}
-
-	if ( extra ) {
-		Sizzle( extra, origContext, results, seed );
-		Sizzle.uniqueSort( results );
-	}
-
-	return results;
-};
-
-Sizzle.uniqueSort = function(results){
-	if ( sortOrder ) {
-		hasDuplicate = baseHasDuplicate;
-		results.sort(sortOrder);
-
-		if ( hasDuplicate ) {
-			for ( var i = 1; i < results.length; i++ ) {
-				if ( results[i] === results[i-1] ) {
-					results.splice(i--, 1);
-				}
-			}
-		}
-	}
-
-	return results;
-};
-
-Sizzle.matches = function(expr, set){
-	return Sizzle(expr, null, null, set);
-};
-
-Sizzle.find = function(expr, context, isXML){
-	var set, match;
-
-	if ( !expr ) {
-		return [];
-	}
-
-	for ( var i = 0, l = Expr.order.length; i < l; i++ ) {
-		var type = Expr.order[i], match;
-		
-		if ( (match = Expr.leftMatch[ type ].exec( expr )) ) {
-			var left = match[1];
-			match.splice(1,1);
-
-			if ( left.substr( left.length - 1 ) !== "\\" ) {
-				match[1] = (match[1] || "").replace(/\\/g, "");
-				set = Expr.find[ type ]( match, context, isXML );
-				if ( set != null ) {
-					expr = expr.replace( Expr.match[ type ], "" );
-					break;
-				}
-			}
-		}
-	}
-
-	if ( !set ) {
-		set = context.getElementsByTagName("*");
-	}
-
-	return {set: set, expr: expr};
-};
-
-Sizzle.filter = function(expr, set, inplace, not){
-	var old = expr, result = [], curLoop = set, match, anyFound,
-		isXMLFilter = set && set[0] && isXML(set[0]);
-
-	while ( expr && set.length ) {
-		for ( var type in Expr.filter ) {
-			if ( (match = Expr.leftMatch[ type ].exec( expr )) != null && match[2] ) {
-				var filter = Expr.filter[ type ], found, item, left = match[1];
-				anyFound = false;
-
-				match.splice(1,1);
-
-				if ( left.substr( left.length - 1 ) === "\\" ) {
-					continue;
-				}
-
-				if ( curLoop === result ) {
-					result = [];
-				}
-
-				if ( Expr.preFilter[ type ] ) {
-					match = Expr.preFilter[ type ]( match, curLoop, inplace, result, not, isXMLFilter );
-
-					if ( !match ) {
-						anyFound = found = true;
-					} else if ( match === true ) {
-						continue;
-					}
-				}
-
-				if ( match ) {
-					for ( var i = 0; (item = curLoop[i]) != null; i++ ) {
-						if ( item ) {
-							found = filter( item, match, i, curLoop );
-							var pass = not ^ !!found;
-
-							if ( inplace && found != null ) {
-								if ( pass ) {
-									anyFound = true;
-								} else {
-									curLoop[i] = false;
-								}
-							} else if ( pass ) {
-								result.push( item );
-								anyFound = true;
-							}
-						}
-					}
-				}
-
-				if ( found !== undefined ) {
-					if ( !inplace ) {
-						curLoop = result;
-					}
-
-					expr = expr.replace( Expr.match[ type ], "" );
-
-					if ( !anyFound ) {
-						return [];
-					}
-
-					break;
-				}
-			}
-		}
-
-		// Improper expression
-		if ( expr === old ) {
-			if ( anyFound == null ) {
-				Sizzle.error( expr );
-			} else {
-				break;
-			}
-		}
-
-		old = expr;
-	}
-
-	return curLoop;
-};
-
-Sizzle.error = function( msg ) {
-	throw "Syntax error, unrecognized expression: " + msg;
-};
-
-var Expr = Sizzle.selectors = {
-	order: [ "ID", "NAME", "TAG" ],
-	match: {
-		ID: /#((?:[\w\u00c0-\uFFFF-]|\\.)+)/,
-		CLASS: /\.((?:[\w\u00c0-\uFFFF-]|\\.)+)/,
-		NAME: /\[name=['"]*((?:[\w\u00c0-\uFFFF-]|\\.)+)['"]*\]/,
-		ATTR: /\[\s*((?:[\w\u00c0-\uFFFF-]|\\.)+)\s*(?:(\S?=)\s*(['"]*)(.*?)\3|)\s*\]/,
-		TAG: /^((?:[\w\u00c0-\uFFFF\*-]|\\.)+)/,
-		CHILD: /:(only|nth|last|first)-child(?:\((even|odd|[\dn+-]*)\))?/,
-		POS: /:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^-]|$)/,
-		PSEUDO: /:((?:[\w\u00c0-\uFFFF-]|\\.)+)(?:\((['"]?)((?:\([^\)]+\)|[^\(\)]*)+)\2\))?/
-	},
-	leftMatch: {},
-	attrMap: {
-		"class": "className",
-		"for": "htmlFor"
-	},
-	attrHandle: {
-		href: function(elem){
-			return elem.getAttribute("href");
-		}
-	},
-	relative: {
-		"+": function(checkSet, part){
-			var isPartStr = typeof part === "string",
-				isTag = isPartStr && !/\W/.test(part),
-				isPartStrNotTag = isPartStr && !isTag;
-
-			if ( isTag ) {
-				part = part.toLowerCase();
-			}
-
-			for ( var i = 0, l = checkSet.length, elem; i < l; i++ ) {
-				if ( (elem = checkSet[i]) ) {
-					while ( (elem = elem.previousSibling) && elem.nodeType !== 1 ) {}
-
-					checkSet[i] = isPartStrNotTag || elem && elem.nodeName.toLowerCase() === part ?
-						elem || false :
-						elem === part;
-				}
-			}
-
-			if ( isPartStrNotTag ) {
-				Sizzle.filter( part, checkSet, true );
-			}
-		},
-		">": function(checkSet, part){
-			var isPartStr = typeof part === "string";
-
-			if ( isPartStr && !/\W/.test(part) ) {
-				part = part.toLowerCase();
-
-				for ( var i = 0, l = checkSet.length; i < l; i++ ) {
-					var elem = checkSet[i];
-					if ( elem ) {
-						var parent = elem.parentNode;
-						checkSet[i] = parent.nodeName.toLowerCase() === part ? parent : false;
-					}
-				}
-			} else {
-				for ( var i = 0, l = checkSet.length; i < l; i++ ) {
-					var elem = checkSet[i];
-					if ( elem ) {
-						checkSet[i] = isPartStr ?
-							elem.parentNode :
-							elem.parentNode === part;
-					}
-				}
-
-				if ( isPartStr ) {
-					Sizzle.filter( part, checkSet, true );
-				}
-			}
-		},
-		"": function(checkSet, part, isXML){
-			var doneName = done++, checkFn = dirCheck;
-
-			if ( typeof part === "string" && !/\W/.test(part) ) {
-				var nodeCheck = part = part.toLowerCase();
-				checkFn = dirNodeCheck;
-			}
-
-			checkFn("parentNode", part, doneName, checkSet, nodeCheck, isXML);
-		},
-		"~": function(checkSet, part, isXML){
-			var doneName = done++, checkFn = dirCheck;
-
-			if ( typeof part === "string" && !/\W/.test(part) ) {
-				var nodeCheck = part = part.toLowerCase();
-				checkFn = dirNodeCheck;
-			}
-
-			checkFn("previousSibling", part, doneName, checkSet, nodeCheck, isXML);
-		}
-	},
-	find: {
-		ID: function(match, context, isXML){
-			if ( typeof context.getElementById !== "undefined" && !isXML ) {
-				var m = context.getElementById(match[1]);
-				return m ? [m] : [];
-			}
-		},
-		NAME: function(match, context){
-			if ( typeof context.getElementsByName !== "undefined" ) {
-				var ret = [], results = context.getElementsByName(match[1]);
-
-				for ( var i = 0, l = results.length; i < l; i++ ) {
-					if ( results[i].getAttribute("name") === match[1] ) {
-						ret.push( results[i] );
-					}
-				}
-
-				return ret.length === 0 ? null : ret;
-			}
-		},
-		TAG: function(match, context){
-			return context.getElementsByTagName(match[1]);
-		}
-	},
-	preFilter: {
-		CLASS: function(match, curLoop, inplace, result, not, isXML){
-			match = " " + match[1].replace(/\\/g, "") + " ";
-
-			if ( isXML ) {
-				return match;
-			}
-
-			for ( var i = 0, elem; (elem = curLoop[i]) != null; i++ ) {
-				if ( elem ) {
-					if ( not ^ (elem.className && (" " + elem.className + " ").replace(/[\t\n]/g, " ").indexOf(match) >= 0) ) {
-						if ( !inplace ) {
-							result.push( elem );
-						}
-					} else if ( inplace ) {
-						curLoop[i] = false;
-					}
-				}
-			}
-
-			return false;
-		},
-		ID: function(match){
-			return match[1].replace(/\\/g, "");
-		},
-		TAG: function(match, curLoop){
-			return match[1].toLowerCase();
-		},
-		CHILD: function(match){
-			if ( match[1] === "nth" ) {
-				// parse equations like 'even', 'odd', '5', '2n', '3n+2', '4n-1', '-n+6'
-				var test = /(-?)(\d*)n((?:\+|-)?\d*)/.exec(
-					match[2] === "even" && "2n" || match[2] === "odd" && "2n+1" ||
-					!/\D/.test( match[2] ) && "0n+" + match[2] || match[2]);
-
-				// calculate the numbers (first)n+(last) including if they are negative
-				match[2] = (test[1] + (test[2] || 1)) - 0;
-				match[3] = test[3] - 0;
-			}
-
-			// TODO: Move to normal caching system
-			match[0] = done++;
-
-			return match;
-		},
-		ATTR: function(match, curLoop, inplace, result, not, isXML){
-			var name = match[1].replace(/\\/g, "");
-			
-			if ( !isXML && Expr.attrMap[name] ) {
-				match[1] = Expr.attrMap[name];
-			}
-
-			if ( match[2] === "~=" ) {
-				match[4] = " " + match[4] + " ";
-			}
-
-			return match;
-		},
-		PSEUDO: function(match, curLoop, inplace, result, not){
-			if ( match[1] === "not" ) {
-				// If we're dealing with a complex expression, or a simple one
-				if ( ( chunker.exec(match[3]) || "" ).length > 1 || /^\w/.test(match[3]) ) {
-					match[3] = Sizzle(match[3], null, null, curLoop);
-				} else {
-					var ret = Sizzle.filter(match[3], curLoop, inplace, true ^ not);
-					if ( !inplace ) {
-						result.push.apply( result, ret );
-					}
-					return false;
-				}
-			} else if ( Expr.match.POS.test( match[0] ) || Expr.match.CHILD.test( match[0] ) ) {
-				return true;
-			}
-			
-			return match;
-		},
-		POS: function(match){
-			match.unshift( true );
-			return match;
-		}
-	},
-	filters: {
-		enabled: function(elem){
-			return elem.disabled === false && elem.type !== "hidden";
-		},
-		disabled: function(elem){
-			return elem.disabled === true;
-		},
-		checked: function(elem){
-			return elem.checked === true;
-		},
-		selected: function(elem){
-			// Accessing this property makes selected-by-default
-			// options in Safari work properly
-			elem.parentNode.selectedIndex;
-			return elem.selected === true;
-		},
-		parent: function(elem){
-			return !!elem.firstChild;
-		},
-		empty: function(elem){
-			return !elem.firstChild;
-		},
-		has: function(elem, i, match){
-			return !!Sizzle( match[3], elem ).length;
-		},
-		header: function(elem){
-			return /h\d/i.test( elem.nodeName );
-		},
-		text: function(elem){
-			return "text" === elem.type;
-		},
-		radio: function(elem){
-			return "radio" === elem.type;
-		},
-		checkbox: function(elem){
-			return "checkbox" === elem.type;
-		},
-		file: function(elem){
-			return "file" === elem.type;
-		},
-		password: function(elem){
-			return "password" === elem.type;
-		},
-		submit: function(elem){
-			return "submit" === elem.type;
-		},
-		image: function(elem){
-			return "image" === elem.type;
-		},
-		reset: function(elem){
-			return "reset" === elem.type;
-		},
-		button: function(elem){
-			return "button" === elem.type || elem.nodeName.toLowerCase() === "button";
-		},
-		input: function(elem){
-			return /input|select|textarea|button/i.test(elem.nodeName);
-		}
-	},
-	setFilters: {
-		first: function(elem, i){
-			return i === 0;
-		},
-		last: function(elem, i, match, array){
-			return i === array.length - 1;
-		},
-		even: function(elem, i){
-			return i % 2 === 0;
-		},
-		odd: function(elem, i){
-			return i % 2 === 1;
-		},
-		lt: function(elem, i, match){
-			return i < match[3] - 0;
-		},
-		gt: function(elem, i, match){
-			return i > match[3] - 0;
-		},
-		nth: function(elem, i, match){
-			return match[3] - 0 === i;
-		},
-		eq: function(elem, i, match){
-			return match[3] - 0 === i;
-		}
-	},
-	filter: {
-		PSEUDO: function(elem, match, i, array){
-			var name = match[1], filter = Expr.filters[ name ];
-
-			if ( filter ) {
-				return filter( elem, i, match, array );
-			} else if ( name === "contains" ) {
-				return (elem.textContent || elem.innerText || getText([ elem ]) || "").indexOf(match[3]) >= 0;
-			} else if ( name === "not" ) {
-				var not = match[3];
-
-				for ( var i = 0, l = not.length; i < l; i++ ) {
-					if ( not[i] === elem ) {
-						return false;
-					}
-				}
-
-				return true;
-			} else {
-				Sizzle.error( "Syntax error, unrecognized expression: " + name );
-			}
-		},
-		CHILD: function(elem, match){
-			var type = match[1], 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;
-				case 'last':
-					while ( (node = node.nextSibling) )	 {
-						if ( node.nodeType === 1 ) { 
-							return false; 
-						}
-					}
-					return true;
-				case 'nth':
-					var first = match[2], last = match[3];
-
-					if ( first === 1 && last === 0 ) {
-						return true;
-					}
-					
-					var doneName = match[0],
-						parent = elem.parentNode;
-	
-					if ( parent && (parent.sizcache !== doneName || !elem.nodeIndex) ) {
-						var count = 0;
-						for ( node = parent.firstChild; node; node = node.nextSibling ) {
-							if ( node.nodeType === 1 ) {
-								node.nodeIndex = ++count;
-							}
-						} 
-						parent.sizcache = doneName;
-					}
-					
-					var diff = elem.nodeIndex - last;
-					if ( first === 0 ) {
-						return diff === 0;
-					} else {
-						return ( diff % first === 0 && diff / first >= 0 );
-					}
-			}
-		},
-		ID: function(elem, match){
-			return elem.nodeType === 1 && elem.getAttribute("id") === match;
-		},
-		TAG: function(elem, match){
-			return (match === "*" && elem.nodeType === 1) || elem.nodeName.toLowerCase() === match;
-		},
-		CLASS: function(elem, match){
-			return (" " + (elem.className || elem.getAttribute("class")) + " ")
-				.indexOf( match ) > -1;
-		},
-		ATTR: function(elem, match){
-			var name = match[1],
-				result = Expr.attrHandle[ name ] ?
-					Expr.attrHandle[ name ]( elem ) :
-					elem[ name ] != null ?
-						elem[ name ] :
-						elem.getAttribute( name ),
-				value = result + "",
-				type = match[2],
-				check = match[4];
-
-			return result == null ?
-				type === "!=" :
-				type === "=" ?
-				value === check :
-				type === "*=" ?
-				value.indexOf(check) >= 0 :
-				type === "~=" ?
-				(" " + value + " ").indexOf(check) >= 0 :
-				!check ?
-				value && result !== false :
-				type === "!=" ?
-				value !== check :
-				type === "^=" ?
-				value.indexOf(check) === 0 :
-				type === "$=" ?
-				value.substr(value.length - check.length) === check :
-				type === "|=" ?
-				value === check || value.substr(0, check.length + 1) === check + "-" :
-				false;
-		},
-		POS: function(elem, match, i, array){
-			var name = match[2], filter = Expr.setFilters[ name ];
-
-			if ( filter ) {
-				return filter( elem, i, match, array );
-			}
-		}
-	}
-};
-
-var origPOS = Expr.match.POS;
-
-for ( var type in Expr.match ) {
-	Expr.match[ type ] = new RegExp( Expr.match[ type ].source + /(?![^\[]*\])(?![^\(]*\))/.source );
-	Expr.leftMatch[ type ] = new RegExp( /(^(?:.|\r|\n)*?)/.source + Expr.match[ type ].source.replace(/\\(\d+)/g, function(all, num){
-		return "\\" + (num - 0 + 1);
-	}));
-}
-
-var makeArray = function(array, results) {
-	array = Array.prototype.slice.call( array, 0 );
-
-	if ( results ) {
-		results.push.apply( results, array );
-		return results;
-	}
-	
-	return array;
-};
+    [0, 0].sort(function () {
+      baseHasDuplicate = false;
+      return 0;
+    });
+
+    var Sizzle = function (selector, context, results, seed) {
+      results = results || [];
+      var origContext = context = context || document;
+
+      if (context.nodeType !== 1 && context.nodeType !== 9) {
+        return [];
+      }
+
+      if (!selector || typeof selector !== "string") {
+        return results;
+      }
+
+      var parts = [], m, set, checkSet, extra, prune = true,
+          contextXML = isXML(context),
+          soFar = selector;
+
+      // Reset the position of the chunker regexp (start from head)
+      while ((chunker.exec(""), m = chunker.exec(soFar)) !== null) {
+        soFar = m[3];
+
+        parts.push(m[1]);
+
+        if (m[2]) {
+          extra = m[3];
+          break;
+        }
+      }
+
+      if (parts.length > 1 && origPOS.exec(selector)) {
+        if (parts.length === 2 && Expr.relative[parts[0]]) {
+          set = posProcess(parts[0] + parts[1], context);
+        } else {
+          set = Expr.relative[parts[0]] ? [context] : Sizzle(parts.shift(),
+              context);
+
+          while (parts.length) {
+            selector = parts.shift();
+
+            if (Expr.relative[selector]) {
+              selector += parts.shift();
+            }
+
+            set = posProcess(selector, set);
+          }
+        }
+      } else {
+        // Take a shortcut and set the context if the root selector is an ID
+        // (but not if it'll be faster if the inner selector is an ID)
+        if (!seed && parts.length > 1 && context.nodeType === 9 && !contextXML
+            &&
+            Expr.match.ID.test(parts[0]) && !Expr.match.ID.test(
+                parts[parts.length - 1])) {
+          var ret = Sizzle.find(parts.shift(), context, contextXML);
+          context = ret.expr ? Sizzle.filter(ret.expr, ret.set)[0] : ret.set[0];
+        }
+
+        if (context) {
+          var ret = seed ? {expr: parts.pop(), set: makeArray(seed)}
+              : Sizzle.find(parts.pop(),
+                  parts.length === 1 && (parts[0] === "~" || parts[0] === "+")
+                  && context.parentNode ? context.parentNode : context,
+                  contextXML);
+          set = ret.expr ? Sizzle.filter(ret.expr, ret.set) : ret.set;
+
+          if (parts.length > 0) {
+            checkSet = makeArray(set);
+          } else {
+            prune = false;
+          }
+
+          while (parts.length) {
+            var cur = parts.pop(), pop = cur;
+
+            if (!Expr.relative[cur]) {
+              cur = "";
+            } else {
+              pop = parts.pop();
+            }
+
+            if (pop == null) {
+              pop = context;
+            }
+
+            Expr.relative[cur](checkSet, pop, contextXML);
+          }
+        } else {
+          checkSet = parts = [];
+        }
+      }
+
+      if (!checkSet) {
+        checkSet = set;
+      }
+
+      if (!checkSet) {
+        Sizzle.error(cur || selector);
+      }
+
+      if (toString.call(checkSet) === "[object Array]") {
+        if (!prune) {
+          results.push.apply(results, checkSet);
+        } else if (context && context.nodeType === 1) {
+          for (var i = 0; checkSet[i] != null; i++) {
+            if (checkSet[i] && (checkSet[i] === true || checkSet[i].nodeType
+                    === 1 && contains(context, checkSet[i]))) {
+              results.push(set[i]);
+            }
+          }
+        } else {
+          for (var i = 0; checkSet[i] != null; i++) {
+            if (checkSet[i] && checkSet[i].nodeType === 1) {
+              results.push(set[i]);
+            }
+          }
+        }
+      } else {
+        makeArray(checkSet, results);
+      }
+
+      if (extra) {
+        Sizzle(extra, origContext, results, seed);
+        Sizzle.uniqueSort(results);
+      }
+
+      return results;
+    };
+
+    Sizzle.uniqueSort = function (results) {
+      if (sortOrder) {
+        hasDuplicate = baseHasDuplicate;
+        results.sort(sortOrder);
+
+        if (hasDuplicate) {
+          for (var i = 1; i < results.length; i++) {
+            if (results[i] === results[i - 1]) {
+              results.splice(i--, 1);
+            }
+          }
+        }
+      }
+
+      return results;
+    };
+
+    Sizzle.matches = function (expr, set) {
+      return Sizzle(expr, null, null, set);
+    };
+
+    Sizzle.find = function (expr, context, isXML) {
+      var set, match;
+
+      if (!expr) {
+        return [];
+      }
+
+      for (var i = 0, l = Expr.order.length; i < l; i++) {
+        var type = Expr.order[i], match;
+
+        if ((match = Expr.leftMatch[type].exec(expr))) {
+          var left = match[1];
+          match.splice(1, 1);
+
+          if (left.substr(left.length - 1) !== "\\") {
+            match[1] = (match[1] || "").replace(/\\/g, "");
+            set = Expr.find[type](match, context, isXML);
+            if (set != null) {
+              expr = expr.replace(Expr.match[type], "");
+              break;
+            }
+          }
+        }
+      }
+
+      if (!set) {
+        set = context.getElementsByTagName("*");
+      }
+
+      return {set: set, expr: expr};
+    };
+
+    Sizzle.filter = function (expr, set, inplace, not) {
+      var old = expr, result = [], curLoop = set, match, anyFound,
+          isXMLFilter = set && set[0] && isXML(set[0]);
+
+      while (expr && set.length) {
+        for (var type in Expr.filter) {
+          if ((match = Expr.leftMatch[type].exec(expr)) != null && match[2]) {
+            var filter = Expr.filter[type], found, item, left = match[1];
+            anyFound = false;
+
+            match.splice(1, 1);
+
+            if (left.substr(left.length - 1) === "\\") {
+              continue;
+            }
+
+            if (curLoop === result) {
+              result = [];
+            }
+
+            if (Expr.preFilter[type]) {
+              match = Expr.preFilter[type](match, curLoop, inplace, result, not,
+                  isXMLFilter);
+
+              if (!match) {
+                anyFound = found = true;
+              } else if (match === true) {
+                continue;
+              }
+            }
+
+            if (match) {
+              for (var i = 0; (item = curLoop[i]) != null; i++) {
+                if (item) {
+                  found = filter(item, match, i, curLoop);
+                  var pass = not ^ !!found;
+
+                  if (inplace && found != null) {
+                    if (pass) {
+                      anyFound = true;
+                    } else {
+                      curLoop[i] = false;
+                    }
+                  } else if (pass) {
+                    result.push(item);
+                    anyFound = true;
+                  }
+                }
+              }
+            }
+
+            if (found !== undefined) {
+              if (!inplace) {
+                curLoop = result;
+              }
+
+              expr = expr.replace(Expr.match[type], "");
+
+              if (!anyFound) {
+                return [];
+              }
+
+              break;
+            }
+          }
+        }
+
+        // Improper expression
+        if (expr === old) {
+          if (anyFound == null) {
+            Sizzle.error(expr);
+          } else {
+            break;
+          }
+        }
+
+        old = expr;
+      }
+
+      return curLoop;
+    };
+
+    Sizzle.error = function (msg) {
+      throw "Syntax error, unrecognized expression: " + msg;
+    };
+
+    var Expr = Sizzle.selectors = {
+      order: ["ID", "NAME", "TAG"],
+      match: {
+        ID: /#((?:[\w\u00c0-\uFFFF-]|\\.)+)/,
+        CLASS: /\.((?:[\w\u00c0-\uFFFF-]|\\.)+)/,
+        NAME: /\[name=['"]*((?:[\w\u00c0-\uFFFF-]|\\.)+)['"]*\]/,
+        ATTR: /\[\s*((?:[\w\u00c0-\uFFFF-]|\\.)+)\s*(?:(\S?=)\s*(['"]*)(.*?)\3|)\s*\]/,
+        TAG: /^((?:[\w\u00c0-\uFFFF\*-]|\\.)+)/,
+        CHILD: /:(only|nth|last|first)-child(?:\((even|odd|[\dn+-]*)\))?/,
+        POS: /:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^-]|$)/,
+        PSEUDO: /:((?:[\w\u00c0-\uFFFF-]|\\.)+)(?:\((['"]?)((?:\([^\)]+\)|[^\(\)]*)+)\2\))?/
+      },
+      leftMatch: {},
+      attrMap: {
+        "class": "className",
+        "for": "htmlFor"
+      },
+      attrHandle: {
+        href: function (elem) {
+          return elem.getAttribute("href");
+        }
+      },
+      relative: {
+        "+": function (checkSet, part) {
+          var isPartStr = typeof part === "string",
+              isTag = isPartStr && !/\W/.test(part),
+              isPartStrNotTag = isPartStr && !isTag;
+
+          if (isTag) {
+            part = part.toLowerCase();
+          }
+
+          for (var i = 0, l = checkSet.length, elem; i < l; i++) {
+            if ((elem = checkSet[i])) {
+              while ((elem = elem.previousSibling) && elem.nodeType !== 1) {
+              }
+
+              checkSet[i] = isPartStrNotTag || elem
+              && elem.nodeName.toLowerCase() === part ? elem || false : elem
+                  === part;
+            }
+          }
+
+          if (isPartStrNotTag) {
+            Sizzle.filter(part, checkSet, true);
+          }
+        },
+        ">": function (checkSet, part) {
+          var isPartStr = typeof part === "string";
+
+          if (isPartStr && !/\W/.test(part)) {
+            part = part.toLowerCase();
+
+            for (var i = 0, l = checkSet.length; i < l; i++) {
+              var elem = checkSet[i];
+              if (elem) {
+                var parent = elem.parentNode;
+                checkSet[i] = parent.nodeName.toLowerCase() === part ? parent
+                    : false;
+              }
+            }
+          } else {
+            for (var i = 0, l = checkSet.length; i < l; i++) {
+              var elem = checkSet[i];
+              if (elem) {
+                checkSet[i] = isPartStr ? elem.parentNode : elem.parentNode
+                    === part;
+              }
+            }
+
+            if (isPartStr) {
+              Sizzle.filter(part, checkSet, true);
+            }
+          }
+        },
+        "": function (checkSet, part, isXML) {
+          var doneName = done++, checkFn = dirCheck;
+
+          if (typeof part === "string" && !/\W/.test(part)) {
+            var nodeCheck = part = part.toLowerCase();
+            checkFn = dirNodeCheck;
+          }
+
+          checkFn("parentNode", part, doneName, checkSet, nodeCheck, isXML);
+        },
+        "~": function (checkSet, part, isXML) {
+          var doneName = done++, checkFn = dirCheck;
+
+          if (typeof part === "string" && !/\W/.test(part)) {
+            var nodeCheck = part = part.toLowerCase();
+            checkFn = dirNodeCheck;
+          }
+
+          checkFn("previousSibling", part, doneName, checkSet, nodeCheck,
+              isXML);
+        }
+      },
+      find: {
+        ID: function (match, context, isXML) {
+          if (typeof context.getElementById !== "undefined" && !isXML) {
+            var m = context.getElementById(match[1]);
+            return m ? [m] : [];
+          }
+        },
+        NAME: function (match, context) {
+          if (typeof context.getElementsByName !== "undefined") {
+            var ret = [], results = context.getElementsByName(match[1]);
+
+            for (var i = 0, l = results.length; i < l; i++) {
+              if (results[i].getAttribute("name") === match[1]) {
+                ret.push(results[i]);
+              }
+            }
+
+            return ret.length === 0 ? null : ret;
+          }
+        },
+        TAG: function (match, context) {
+          return context.getElementsByTagName(match[1]);
+        }
+      },
+      preFilter: {
+        CLASS: function (match, curLoop, inplace, result, not, isXML) {
+          match = " " + match[1].replace(/\\/g, "") + " ";
+
+          if (isXML) {
+            return match;
+          }
+
+          for (var i = 0, elem; (elem = curLoop[i]) != null; i++) {
+            if (elem) {
+              if (not ^ (elem.className && (" " + elem.className + " ").replace(
+                      /[\t\n]/g, " ").indexOf(match) >= 0)) {
+                if (!inplace) {
+                  result.push(elem);
+                }
+              } else if (inplace) {
+                curLoop[i] = false;
+              }
+            }
+          }
+
+          return false;
+        },
+        ID: function (match) {
+          return match[1].replace(/\\/g, "");
+        },
+        TAG: function (match, curLoop) {
+          return match[1].toLowerCase();
+        },
+        CHILD: function (match) {
+          if (match[1] === "nth") {
+            // parse equations like 'even', 'odd', '5', '2n', '3n+2', '4n-1', '-n+6'
+            var test = /(-?)(\d*)n((?:\+|-)?\d*)/.exec(
+                match[2] === "even" && "2n" || match[2] === "odd" && "2n+1" ||
+                !/\D/.test(match[2]) && "0n+" + match[2] || match[2]);
+
+            // calculate the numbers (first)n+(last) including if they are negative
+            match[2] = (test[1] + (test[2] || 1)) - 0;
+            match[3] = test[3] - 0;
+          }
+
+          // TODO: Move to normal caching system
+          match[0] = done++;
+
+          return match;
+        },
+        ATTR: function (match, curLoop, inplace, result, not, isXML) {
+          var name = match[1].replace(/\\/g, "");
+
+          if (!isXML && Expr.attrMap[name]) {
+            match[1] = Expr.attrMap[name];
+          }
+
+          if (match[2] === "~=") {
+            match[4] = " " + match[4] + " ";
+          }
+
+          return match;
+        },
+        PSEUDO: function (match, curLoop, inplace, result, not) {
+          if (match[1] === "not") {
+            // If we're dealing with a complex expression, or a simple one
+            if (( chunker.exec(match[3]) || "" ).length > 1 || /^\w/.test(
+                    match[3])) {
+              match[3] = Sizzle(match[3], null, null, curLoop);
+            } else {
+              var ret = Sizzle.filter(match[3], curLoop, inplace, true ^ not);
+              if (!inplace) {
+                result.push.apply(result, ret);
+              }
+              return false;
+            }
+          } else if (Expr.match.POS.test(match[0]) || Expr.match.CHILD.test(
+                  match[0])) {
+            return true;
+          }
+
+          return match;
+        },
+        POS: function (match) {
+          match.unshift(true);
+          return match;
+        }
+      },
+      filters: {
+        enabled: function (elem) {
+          return elem.disabled === false && elem.type !== "hidden";
+        },
+        disabled: function (elem) {
+          return elem.disabled === true;
+        },
+        checked: function (elem) {
+          return elem.checked === true;
+        },
+        selected: function (elem) {
+          // Accessing this property makes selected-by-default
+          // options in Safari work properly
+          elem.parentNode.selectedIndex;
+          return elem.selected === true;
+        },
+        parent: function (elem) {
+          return !!elem.firstChild;
+        },
+        empty: function (elem) {
+          return !elem.firstChild;
+        },
+        has: function (elem, i, match) {
+          return !!Sizzle(match[3], elem).length;
+        },
+        header: function (elem) {
+          return /h\d/i.test(elem.nodeName);
+        },
+        text: function (elem) {
+          return "text" === elem.type;
+        },
+        radio: function (elem) {
+          return "radio" === elem.type;
+        },
+        checkbox: function (elem) {
+          return "checkbox" === elem.type;
+        },
+        file: function (elem) {
+          return "file" === elem.type;
+        },
+        password: function (elem) {
+          return "password" === elem.type;
+        },
+        submit: function (elem) {
+          return "submit" === elem.type;
+        },
+        image: function (elem) {
+          return "image" === elem.type;
+        },
+        reset: function (elem) {
+          return "reset" === elem.type;
+        },
+        button: function (elem) {
+          return "button" === elem.type || elem.nodeName.toLowerCase()
+              === "button";
+        },
+        input: function (elem) {
+          return /input|select|textarea|button/i.test(elem.nodeName);
+        }
+      },
+      setFilters: {
+        first: function (elem, i) {
+          return i === 0;
+        },
+        last: function (elem, i, match, array) {
+          return i === array.length - 1;
+        },
+        even: function (elem, i) {
+          return i % 2 === 0;
+        },
+        odd: function (elem, i) {
+          return i % 2 === 1;
+        },
+        lt: function (elem, i, match) {
+          return i < match[3] - 0;
+        },
+        gt: function (elem, i, match) {
+          return i > match[3] - 0;
+        },
+        nth: function (elem, i, match) {
+          return match[3] - 0 === i;
+        },
+        eq: function (elem, i, match) {
+          return match[3] - 0 === i;
+        }
+      },
+      filter: {
+        PSEUDO: function (elem, match, i, array) {
+          var name = match[1], filter = Expr.filters[name];
+
+          if (filter) {
+            return filter(elem, i, match, array);
+          } else if (name === "contains") {
+            return (elem.textContent || elem.innerText || getText([elem])
+                || "").indexOf(match[3]) >= 0;
+          } else if (name === "not") {
+            var not = match[3];
+
+            for (var i = 0, l = not.length; i < l; i++) {
+              if (not[i] === elem) {
+                return false;
+              }
+            }
+
+            return true;
+          } else {
+            Sizzle.error("Syntax error, unrecognized expression: " + name);
+          }
+        },
+        CHILD: function (elem, match) {
+          var type = match[1], 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;
+            case 'last':
+              while ((node = node.nextSibling)) {
+                if (node.nodeType === 1) {
+                  return false;
+                }
+              }
+              return true;
+            case 'nth':
+              var first = match[2], last = match[3];
+
+              if (first === 1 && last === 0) {
+                return true;
+              }
+
+              var doneName = match[0],
+                  parent = elem.parentNode;
+
+              if (parent && (parent.sizcache !== doneName || !elem.nodeIndex)) {
+                var count = 0;
+                for (node = parent.firstChild; node; node = node.nextSibling) {
+                  if (node.nodeType === 1) {
+                    node.nodeIndex = ++count;
+                  }
+                }
+                parent.sizcache = doneName;
+              }
+
+              var diff = elem.nodeIndex - last;
+              if (first === 0) {
+                return diff === 0;
+              } else {
+                return ( diff % first === 0 && diff / first >= 0 );
+              }
+          }
+        },
+        ID: function (elem, match) {
+          return elem.nodeType === 1 && elem.getAttribute("id") === match;
+        },
+        TAG: function (elem, match) {
+          return (match === "*" && elem.nodeType === 1)
+              || elem.nodeName.toLowerCase() === match;
+        },
+        CLASS: function (elem, match) {
+          return (" " + (elem.className || elem.getAttribute("class")) + " ")
+          .indexOf(match) > -1;
+        },
+        ATTR: function (elem, match) {
+          var name = match[1],
+              result = Expr.attrHandle[name] ? Expr.attrHandle[name](elem)
+                  : elem[name] != null ? elem[name] : elem.getAttribute(name),
+              value = result + "",
+              type = match[2],
+              check = match[4];
+
+          return result == null ? type === "!=" : type === "=" ? value === check
+              : type === "*=" ? value.indexOf(check) >= 0 : type === "~=" ? (" "
+                  + value + " ").indexOf(check) >= 0 : !check ? value && result
+                  !== false : type === "!=" ? value !== check : type === "^="
+                  ? value.indexOf(check) === 0 : type === "$="
+                      ? value.substr(value.length - check.length) === check
+                      : type === "|=" ? value === check || value.substr(
+                          0, check.length + 1) === check + "-" : false;
+        },
+        POS: function (elem, match, i, array) {
+          var name = match[2], filter = Expr.setFilters[name];
+
+          if (filter) {
+            return filter(elem, i, match, array);
+          }
+        }
+      }
+    };
+
+    var origPOS = Expr.match.POS;
+
+    for (var type in Expr.match) {
+      Expr.match[type] = new RegExp(Expr.match[type].source
+          + /(?![^\[]*\])(?![^\(]*\))/.source);
+      Expr.leftMatch[type] = new RegExp(/(^(?:.|\r|\n)*?)/.source
+          + Expr.match[type].source.replace(/\\(\d+)/g, function (all, num) {
+            return "\\" + (num - 0 + 1);
+          }));
+    }
+
+    var makeArray = function (array, results) {
+      array = Array.prototype.slice.call(array, 0);
+
+      if (results) {
+        results.push.apply(results, array);
+        return results;
+      }
+
+      return array;
+    };
 
 // Perform a simple check to determine if the browser is capable of
 // converting a NodeList to an array using builtin methods.
 // Also verifies that the returned array holds DOM nodes
 // (which is not the case in the Blackberry browser)
-try {
-	Array.prototype.slice.call( document.documentElement.childNodes, 0 )[0].nodeType;
+    try {
+      Array.prototype.slice.call(document.documentElement.childNodes,
+          0)[0].nodeType;
 
 // Provide a fallback method if it does not work
-} catch(e){
-	makeArray = function(array, results) {
-		var ret = results || [];
-
-		if ( toString.call(array) === "[object Array]" ) {
-			Array.prototype.push.apply( ret, array );
-		} else {
-			if ( typeof array.length === "number" ) {
-				for ( var i = 0, l = array.length; i < l; i++ ) {
-					ret.push( array[i] );
-				}
-			} else {
-				for ( var i = 0; array[i]; i++ ) {
-					ret.push( array[i] );
-				}
-			}
-		}
-
-		return ret;
-	};
-}
-
-var sortOrder;
-
-if ( document.documentElement.compareDocumentPosition ) {
-	sortOrder = function( a, b ) {
-		if ( !a.compareDocumentPosition || !b.compareDocumentPosition ) {
-			if ( a == b ) {
-				hasDuplicate = true;
-			}
-			return a.compareDocumentPosition ? -1 : 1;
-		}
-
-		var ret = a.compareDocumentPosition(b) & 4 ? -1 : a === b ? 0 : 1;
-		if ( ret === 0 ) {
-			hasDuplicate = true;
-		}
-		return ret;
-	};
-} else if ( "sourceIndex" in document.documentElement ) {
-	sortOrder = function( a, b ) {
-		if ( !a.sourceIndex || !b.sourceIndex ) {
-			if ( a == b ) {
-				hasDuplicate = true;
-			}
-			return a.sourceIndex ? -1 : 1;
-		}
-
-		var ret = a.sourceIndex - b.sourceIndex;
-		if ( ret === 0 ) {
-			hasDuplicate = true;
-		}
-		return ret;
-	};
-} else if ( document.createRange ) {
-	sortOrder = function( a, b ) {
-		if ( !a.ownerDocument || !b.ownerDocument ) {
-			if ( a == b ) {
-				hasDuplicate = true;
-			}
-			return a.ownerDocument ? -1 : 1;
-		}
-
-		var aRange = a.ownerDocument.createRange(), bRange = b.ownerDocument.createRange();
-		aRange.setStart(a, 0);
-		aRange.setEnd(a, 0);
-		bRange.setStart(b, 0);
-		bRange.setEnd(b, 0);
-		var ret = aRange.compareBoundaryPoints(Range.START_TO_END, bRange);
-		if ( ret === 0 ) {
-			hasDuplicate = true;
-		}
-		return ret;
-	};
-}
+    } catch (e) {
+      makeArray = function (array, results) {
+        var ret = results || [];
+
+        if (toString.call(array) === "[object Array]") {
+          Array.prototype.push.apply(ret, array);
+        } else {
+          if (typeof array.length === "number") {
+            for (var i = 0, l = array.length; i < l; i++) {
+              ret.push(array[i]);
+            }
+          } else {
+            for (var i = 0; array[i]; i++) {
+              ret.push(array[i]);
+            }
+          }
+        }
+
+        return ret;
+      };
+    }
+
+    var sortOrder;
+
+    if (document.documentElement.compareDocumentPosition) {
+      sortOrder = function (a, b) {
+        if (!a.compareDocumentPosition || !b.compareDocumentPosition) {
+          if (a == b) {
+            hasDuplicate = true;
+          }
+          return a.compareDocumentPosition ? -1 : 1;
+        }
+
+        var ret = a.compareDocumentPosition(b) & 4 ? -1 : a === b ? 0 : 1;
+        if (ret === 0) {
+          hasDuplicate = true;
+        }
+        return ret;
+      };
+    } else if ("sourceIndex" in document.documentElement) {
+      sortOrder = function (a, b) {
+        if (!a.sourceIndex || !b.sourceIndex) {
+          if (a == b) {
+            hasDuplicate = true;
+          }
+          return a.sourceIndex ? -1 : 1;
+        }
+
+        var ret = a.sourceIndex - b.sourceIndex;
+        if (ret === 0) {
+          hasDuplicate = true;
+        }
+        return ret;
+      };
+    } else if (document.createRange) {
+      sortOrder = function (a, b) {
+        if (!a.ownerDocument || !b.ownerDocument) {
+          if (a == b) {
+            hasDuplicate = true;
+          }
+          return a.ownerDocument ? -1 : 1;
+        }
+
+        var aRange = a.ownerDocument.createRange(),
+            bRange = b.ownerDocument.createRange();
+        aRange.setStart(a, 0);
+        aRange.setEnd(a, 0);
+        bRange.setStart(b, 0);
+        bRange.setEnd(b, 0);
+        var ret = aRange.compareBoundaryPoints(Range.START_TO_END, bRange);
+        if (ret === 0) {
+          hasDuplicate = true;
+        }
+        return ret;
+      };
+    }
 
 // Utility function for retreiving the text value of an array of DOM nodes
-function getText( elems ) {
-	var ret = "", elem;
+    function getText(elems) {
+      var ret = "", elem;
 
-	for ( var i = 0; elems[i]; i++ ) {
-		elem = elems[i];
+      for (var i = 0; elems[i]; i++) {
+        elem = elems[i];
 
-		// Get the text from text nodes and CDATA nodes
-		if ( elem.nodeType === 3 || elem.nodeType === 4 ) {
-			ret += elem.nodeValue;
+        // Get the text from text nodes and CDATA nodes
+        if (elem.nodeType === 3 || elem.nodeType === 4) {
+          ret += elem.nodeValue;
 
-		// Traverse everything else, except comment nodes
-		} else if ( elem.nodeType !== 8 ) {
-			ret += getText( elem.childNodes );
-		}
-	}
+          // Traverse everything else, except comment nodes
+        } else if (elem.nodeType !== 8) {
+          ret += getText(elem.childNodes);
+        }
+      }
 
-	return ret;
-}
+      return ret;
+    }
 
 // Check to see if the browser returns elements by name when
 // querying by getElementById (and provide a workaround)
-(function(){
-	// We're going to inject a fake input element with a specified name
-	var form = document.createElement("div"),
-		id = "script" + (new Date).getTime();
-	form.innerHTML = "<a name='" + id + "'/>";
-
-	// Inject it into the root element, check its status, and remove it quickly
-	var root = document.documentElement;
-	root.insertBefore( form, root.firstChild );
-
-	// The workaround has to do additional checks after a getElementById
-	// Which slows things down for other browsers (hence the branching)
-	if ( document.getElementById( id ) ) {
-		Expr.find.ID = function(match, context, isXML){
-			if ( typeof context.getElementById !== "undefined" && !isXML ) {
-				var m = context.getElementById(match[1]);
-				return m ? m.id === match[1] || typeof m.getAttributeNode !== "undefined" && m.getAttributeNode("id").nodeValue === match[1] ? [m] : undefined : [];
-			}
-		};
-
-		Expr.filter.ID = function(elem, match){
-			var node = typeof elem.getAttributeNode !== "undefined" && elem.getAttributeNode("id");
-			return elem.nodeType === 1 && node && node.nodeValue === match;
-		};
-	}
-
-	root.removeChild( form );
-	root = form = null; // release memory in IE
-})();
-
-(function(){
-	// Check to see if the browser returns only elements
-	// when doing getElementsByTagName("*")
-
-	// Create a fake element
-	var div = document.createElement("div");
-	div.appendChild( document.createComment("") );
-
-	// Make sure no comments are found
-	if ( div.getElementsByTagName("*").length > 0 ) {
-		Expr.find.TAG = function(match, context){
-			var results = context.getElementsByTagName(match[1]);
-
-			// Filter out possible comments
-			if ( match[1] === "*" ) {
-				var tmp = [];
-
-				for ( var i = 0; results[i]; i++ ) {
-					if ( results[i].nodeType === 1 ) {
-						tmp.push( results[i] );
-					}
-				}
-
-				results = tmp;
-			}
-
-			return results;
-		};
-	}
-
-	// Check to see if an attribute returns normalized href attributes
-	div.innerHTML = "<a href='#'></a>";
-	if ( div.firstChild && typeof div.firstChild.getAttribute !== "undefined" &&
-			div.firstChild.getAttribute("href") !== "#" ) {
-		Expr.attrHandle.href = function(elem){
-			return elem.getAttribute("href", 2);
-		};
-	}
-
-	div = null; // release memory in IE
-})();
-
-if ( document.querySelectorAll ) {
-	(function(){
-		var oldSizzle = Sizzle, div = document.createElement("div");
-		div.innerHTML = "<p class='TEST'></p>";
-
-		// Safari can't handle uppercase or unicode characters when
-		// in quirks mode.
-		if ( div.querySelectorAll && div.querySelectorAll(".TEST").length === 0 ) {
-			return;
-		}
-	
-		Sizzle = function(query, context, extra, seed){
-			context = context || document;
-
-			// Only use querySelectorAll on non-XML documents
-			// (ID selectors don't work in non-HTML documents)
-			if ( !seed && context.nodeType === 9 && !isXML(context) ) {
-				try {
-					return makeArray( context.querySelectorAll(query), extra );
-				} catch(e){}
-			}
-		
-			return oldSizzle(query, context, extra, seed);
-		};
-
-		for ( var prop in oldSizzle ) {
-			Sizzle[ prop ] = oldSizzle[ prop ];
-		}
-
-		div = null; // release memory in IE
-	})();
-}
-
-(function(){
-	var div = document.createElement("div");
-
-	div.innerHTML = "<div class='test e'></div><div class='test'></div>";
-
-	// Opera can't find a second classname (in 9.6)
-	// Also, make sure that getElementsByClassName actually exists
-	if ( !div.getElementsByClassName || div.getElementsByClassName("e").length === 0 ) {
-		return;
-	}
-
-	// Safari caches class attributes, doesn't catch changes (in 3.2)
-	div.lastChild.className = "e";
-
-	if ( div.getElementsByClassName("e").length === 1 ) {
-		return;
-	}
-	
-	Expr.order.splice(1, 0, "CLASS");
-	Expr.find.CLASS = function(match, context, isXML) {
-		if ( typeof context.getElementsByClassName !== "undefined" && !isXML ) {
-			return context.getElementsByClassName(match[1]);
-		}
-	};
-
-	div = null; // release memory in IE
-})();
-
-function dirNodeCheck( dir, cur, doneName, checkSet, nodeCheck, isXML ) {
-	for ( var i = 0, l = checkSet.length; i < l; i++ ) {
-		var elem = checkSet[i];
-		if ( elem ) {
-			elem = elem[dir];
-			var match = false;
-
-			while ( elem ) {
-				if ( elem.sizcache === doneName ) {
-					match = checkSet[elem.sizset];
-					break;
-				}
-
-				if ( elem.nodeType === 1 && !isXML ){
-					elem.sizcache = doneName;
-					elem.sizset = i;
-				}
-
-				if ( elem.nodeName.toLowerCase() === cur ) {
-					match = elem;
-					break;
-				}
-
-				elem = elem[dir];
-			}
-
-			checkSet[i] = match;
-		}
-	}
-}
-
-function dirCheck( dir, cur, doneName, checkSet, nodeCheck, isXML ) {
-	for ( var i = 0, l = checkSet.length; i < l; i++ ) {
-		var elem = checkSet[i];
-		if ( elem ) {
-			elem = elem[dir];
-			var match = false;
-
-			while ( elem ) {
-				if ( elem.sizcache === doneName ) {
-					match = checkSet[elem.sizset];
-					break;
-				}
-
-				if ( elem.nodeType === 1 ) {
-					if ( !isXML ) {
-						elem.sizcache = doneName;
-						elem.sizset = i;
-					}
-					if ( typeof cur !== "string" ) {
-						if ( elem === cur ) {
-							match = true;
-							break;
-						}
-
-					} else if ( Sizzle.filter( cur, [elem] ).length > 0 ) {
-						match = elem;
-						break;
-					}
-				}
-
-				elem = elem[dir];
-			}
-
-			checkSet[i] = match;
-		}
-	}
-}
-
-var contains = document.compareDocumentPosition ? function(a, b){
-	return !!(a.compareDocumentPosition(b) & 16);
-} : function(a, b){
-	return a !== b && (a.contains ? a.contains(b) : true);
-};
-
-var 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 : 0).documentElement;
-	return documentElement ? documentElement.nodeName !== "HTML" : false;
-};
-
-var posProcess = function(selector, context){
-	var tmpSet = [], later = "", match,
-		root = context.nodeType ? [context] : context;
-
-	// Position selectors must be done after the filter
-	// And so must :not(positional) so we move all PSEUDOs to the end
-	while ( (match = Expr.match.PSEUDO.exec( selector )) ) {
-		later += match[0];
-		selector = selector.replace( Expr.match.PSEUDO, "" );
-	}
-
-	selector = Expr.relative[selector] ? selector + "*" : selector;
-
-	for ( var i = 0, l = root.length; i < l; i++ ) {
-		Sizzle( selector, root[i], tmpSet );
-	}
-
-	return Sizzle.filter( later, tmpSet );
-};
+    (function () {
+      // We're going to inject a fake input element with a specified name
+      var form = document.createElement("div"),
+          id = "script" + (new Date).getTime();
+      form.innerHTML = "<a name='" + id + "'/>";
+
+      // Inject it into the root element, check its status, and remove it quickly
+      var root = document.documentElement;
+      root.insertBefore(form, root.firstChild);
+
+      // The workaround has to do additional checks after a getElementById
+      // Which slows things down for other browsers (hence the branching)
+      if (document.getElementById(id)) {
+        Expr.find.ID = function (match, context, isXML) {
+          if (typeof context.getElementById !== "undefined" && !isXML) {
+            var m = context.getElementById(match[1]);
+            return m ? m.id === match[1] || typeof m.getAttributeNode
+            !== "undefined" && m.getAttributeNode("id").nodeValue === match[1]
+                ? [m] : undefined : [];
+          }
+        };
+
+        Expr.filter.ID = function (elem, match) {
+          var node = typeof elem.getAttributeNode !== "undefined"
+              && elem.getAttributeNode("id");
+          return elem.nodeType === 1 && node && node.nodeValue === match;
+        };
+      }
+
+      root.removeChild(form);
+      root = form = null; // release memory in IE
+    })();
+
+    (function () {
+      // Check to see if the browser returns only elements
+      // when doing getElementsByTagName("*")
+
+      // Create a fake element
+      var div = document.createElement("div");
+      div.appendChild(document.createComment(""));
+
+      // Make sure no comments are found
+      if (div.getElementsByTagName("*").length > 0) {
+        Expr.find.TAG = function (match, context) {
+          var results = context.getElementsByTagName(match[1]);
+
+          // Filter out possible comments
+          if (match[1] === "*") {
+            var tmp = [];
+
+            for (var i = 0; results[i]; i++) {
+              if (results[i].nodeType === 1) {
+                tmp.push(results[i]);
+              }
+            }
+
+            results = tmp;
+          }
+
+          return results;
+        };
+      }
+
+      // Check to see if an attribute returns normalized href attributes
+      div.innerHTML = "<a href='#'></a>";
+      if (div.firstChild && typeof div.firstChild.getAttribute !== "undefined"
+          &&
+          div.firstChild.getAttribute("href") !== "#") {
+        Expr.attrHandle.href = function (elem) {
+          return elem.getAttribute("href", 2);
+        };
+      }
+
+      div = null; // release memory in IE
+    })();
+
+    if (document.querySelectorAll) {
+      (function () {
+        var oldSizzle = Sizzle, div = document.createElement("div");
+        div.innerHTML = "<p class='TEST'></p>";
+
+        // Safari can't handle uppercase or unicode characters when
+        // in quirks mode.
+        if (div.querySelectorAll && div.querySelectorAll(".TEST").length
+            === 0) {
+          return;
+        }
+
+        Sizzle = function (query, context, extra, seed) {
+          context = context || document;
+
+          // Only use querySelectorAll on non-XML documents
+          // (ID selectors don't work in non-HTML documents)
+          if (!seed && context.nodeType === 9 && !isXML(context)) {
+            try {
+              return makeArray(context.querySelectorAll(query), extra);
+            } catch (e) {
+            }
+          }
+
+          return oldSizzle(query, context, extra, seed);
+        };
+
+        for (var prop in oldSizzle) {
+          Sizzle[prop] = oldSizzle[prop];
+        }
+
+        div = null; // release memory in IE
+      })();
+    }
+
+    (function () {
+      var div = document.createElement("div");
+
+      div.innerHTML = "<div class='test e'></div><div class='test'></div>";
+
+      // Opera can't find a second classname (in 9.6)
+      // Also, make sure that getElementsByClassName actually exists
+      if (!div.getElementsByClassName || div.getElementsByClassName("e").length
+          === 0) {
+        return;
+      }
+
+      // Safari caches class attributes, doesn't catch changes (in 3.2)
+      div.lastChild.className = "e";
+
+      if (div.getElementsByClassName("e").length === 1) {
+        return;
+      }
+
+      Expr.order.splice(1, 0, "CLASS");
+      Expr.find.CLASS = function (match, context, isXML) {
+        if (typeof context.getElementsByClassName !== "undefined" && !isXML) {
+          return context.getElementsByClassName(match[1]);
+        }
+      };
+
+      div = null; // release memory in IE
+    })();
+
+    function dirNodeCheck(dir, cur, doneName, checkSet, nodeCheck, isXML) {
+      for (var i = 0, l = checkSet.length; i < l; i++) {
+        var elem = checkSet[i];
+        if (elem) {
+          elem = elem[dir];
+          var match = false;
+
+          while (elem) {
+            if (elem.sizcache === doneName) {
+              match = checkSet[elem.sizset];
+              break;
+            }
+
+            if (elem.nodeType === 1 && !isXML) {
+              elem.sizcache = doneName;
+              elem.sizset = i;
+            }
+
+            if (elem.nodeName.toLowerCase() === cur) {
+              match = elem;
+              break;
+            }
+
+            elem = elem[dir];
+          }
+
+          checkSet[i] = match;
+        }
+      }
+    }
+
+    function dirCheck(dir, cur, doneName, checkSet, nodeCheck, isXML) {
+      for (var i = 0, l = checkSet.length; i < l; i++) {
+        var elem = checkSet[i];
+        if (elem) {
+          elem = elem[dir];
+          var match = false;
+
+          while (elem) {
+            if (elem.sizcache === doneName) {
+              match = checkSet[elem.sizset];
+              break;
+            }
+
+            if (elem.nodeType === 1) {
+              if (!isXML) {
+                elem.sizcache = doneName;
+                elem.sizset = i;
+              }
+              if (typeof cur !== "string") {
+                if (elem === cur) {
+                  match = true;
+                  break;
+                }
+
+              } else if (Sizzle.filter(cur, [elem]).length > 0) {
+                match = elem;
+                break;
+              }
+            }
+
+            elem = elem[dir];
+          }
+
+          checkSet[i] = match;
+        }
+      }
+    }
+
+    var contains = document.compareDocumentPosition ? function (a, b) {
+      return !!(a.compareDocumentPosition(b) & 16);
+    } : function (a, b) {
+      return a !== b && (a.contains ? a.contains(b) : true);
+    };
+
+    var 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
+          : 0).documentElement;
+      return documentElement ? documentElement.nodeName !== "HTML" : false;
+    };
+
+    var posProcess = function (selector, context) {
+      var tmpSet = [], later = "", match,
+          root = context.nodeType ? [context] : context;
+
+      // Position selectors must be done after the filter
+      // And so must :not(positional) so we move all PSEUDOs to the end
+      while ((match = Expr.match.PSEUDO.exec(selector))) {
+        later += match[0];
+        selector = selector.replace(Expr.match.PSEUDO, "");
+      }
+
+      selector = Expr.relative[selector] ? selector + "*" : selector;
+
+      for (var i = 0, l = root.length; i < l; i++) {
+        Sizzle(selector, root[i], tmpSet);
+      }
+
+      return Sizzle.filter(later, tmpSet);
+    };
 
 // EXPOSE
-jQuery.find = Sizzle;
-jQuery.expr = Sizzle.selectors;
-jQuery.expr[":"] = jQuery.expr.filters;
-jQuery.unique = Sizzle.uniqueSort;
-jQuery.text = getText;
-jQuery.isXMLDoc = isXML;
-jQuery.contains = contains;
+    jQuery.find = Sizzle;
+    jQuery.expr = Sizzle.selectors;
+    jQuery.expr[":"] = jQuery.expr.filters;
+    jQuery.unique = Sizzle.uniqueSort;
+    jQuery.text = getText;
+    jQuery.isXMLDoc = isXML;
+    jQuery.contains = contains;
 
-return;
+    return;
 
-window.Sizzle = Sizzle;
+    window.Sizzle = Sizzle;
 
-})();
-var runtil = /Until$/,
-	rparentsprev = /^(?:parents|prevUntil|prevAll)/,
-	// Note: This RegExp should be improved, or likely pulled from Sizzle
-	rmultiselector = /,/,
-	slice = Array.prototype.slice;
+  })();
+  var runtil = /Until$/,
+      rparentsprev = /^(?:parents|prevUntil|prevAll)/,
+      // Note: This RegExp should be improved, or likely pulled from Sizzle
+      rmultiselector = /,/,
+      slice = Array.prototype.slice;
 
 // Implement the identical functionality for filter and not
-var winnow = function( elements, qualifier, keep ) {
-	if ( jQuery.isFunction( qualifier ) ) {
-		return jQuery.grep(elements, function( elem, i ) {
-			return !!qualifier.call( elem, i, elem ) === 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;
-	});
-};
-
-jQuery.fn.extend({
-	find: function( selector ) {
-		var ret = this.pushStack( "", "find", selector ), length = 0;
-
-		for ( var 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 ( var n = length; n < ret.length; n++ ) {
-					for ( var r = 0; r < length; r++ ) {
-						if ( ret[r] === ret[n] ) {
-							ret.splice(n--, 1);
-							break;
-						}
-					}
-				}
-			}
-		}
-
-		return ret;
-	},
-
-	has: function( target ) {
-		var targets = jQuery( target );
-		return this.filter(function() {
-			for ( var i = 0, l = targets.length; i < l; 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 && jQuery.filter( selector, this ).length > 0;
-	},
-
-	closest: function( selectors, context ) {
-		if ( jQuery.isArray( selectors ) ) {
-			var ret = [], cur = this[0], match, matches = {}, selector;
-
-			if ( cur && selectors.length ) {
-				for ( var i = 0, l = selectors.length; i < l; i++ ) {
-					selector = selectors[i];
-
-					if ( !matches[selector] ) {
-						matches[selector] = jQuery.expr.match.POS.test( selector ) ? 
-							jQuery( selector, context || this.context ) :
-							selector;
-					}
-				}
-
-				while ( cur && cur.ownerDocument && cur !== context ) {
-					for ( selector in matches ) {
-						match = matches[selector];
-
-						if ( match.jquery ? match.index(cur) > -1 : jQuery(cur).is(match) ) {
-							ret.push({ selector: selector, elem: cur });
-							delete matches[selector];
-						}
-					}
-					cur = cur.parentNode;
-				}
-			}
-
-			return ret;
-		}
-
-		var pos = jQuery.expr.match.POS.test( selectors ) ? 
-			jQuery( selectors, context || this.context ) : null;
-
-		return this.map(function( i, cur ) {
-			while ( cur && cur.ownerDocument && cur !== context ) {
-				if ( pos ? pos.index(cur) > -1 : jQuery(cur).is(selectors) ) {
-					return cur;
-				}
-				cur = cur.parentNode;
-			}
-			return null;
-		});
-	},
-	
-	// Determine the position of an element within
-	// the matched set of elements
-	index: function( elem ) {
-		if ( !elem || typeof elem === "string" ) {
-			return jQuery.inArray( this[0],
-				// If it receives a string, the selector is used
-				// If it receives nothing, the siblings are used
-				elem ? jQuery( elem ) : this.parent().children() );
-		}
-		// 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 || this.context ) :
-				jQuery.makeArray( selector ),
-			all = jQuery.merge( this.get(), set );
-
-		return this.pushStack( isDisconnected( set[0] ) || isDisconnected( all[0] ) ?
-			all :
-			jQuery.unique( all ) );
-	},
-
-	andSelf: function() {
-		return this.add( this.prevObject );
-	}
-});
+  var winnow = function (elements, qualifier, keep) {
+    if (jQuery.isFunction(qualifier)) {
+      return jQuery.grep(elements, function (elem, i) {
+        return !!qualifier.call(elem, i, elem) === 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;
+    });
+  };
+
+  jQuery.fn.extend({
+    find: function (selector) {
+      var ret = this.pushStack("", "find", selector), length = 0;
+
+      for (var 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 (var n = length; n < ret.length; n++) {
+            for (var r = 0; r < length; r++) {
+              if (ret[r] === ret[n]) {
+                ret.splice(n--, 1);
+                break;
+              }
+            }
+          }
+        }
+      }
+
+      return ret;
+    },
+
+    has: function (target) {
+      var targets = jQuery(target);
+      return this.filter(function () {
+        for (var i = 0, l = targets.length; i < l; 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 && jQuery.filter(selector, this).length > 0;
+    },
+
+    closest: function (selectors, context) {
+      if (jQuery.isArray(selectors)) {
+        var ret = [], cur = this[0], match, matches = {}, selector;
+
+        if (cur && selectors.length) {
+          for (var i = 0, l = selectors.length; i < l; i++) {
+            selector = selectors[i];
+
+            if (!matches[selector]) {
+              matches[selector] = jQuery.expr.match.POS.test(selector) ? jQuery(
+                  selector, context || this.context) : selector;
+            }
+          }
+
+          while (cur && cur.ownerDocument && cur !== context) {
+            for (selector in matches) {
+              match = matches[selector];
+
+              if (match.jquery ? match.index(cur) > -1 : jQuery(cur).is(
+                      match)) {
+                ret.push({selector: selector, elem: cur});
+                delete matches[selector];
+              }
+            }
+            cur = cur.parentNode;
+          }
+        }
+
+        return ret;
+      }
+
+      var pos = jQuery.expr.match.POS.test(selectors) ? jQuery(
+          selectors, context || this.context) : null;
+
+      return this.map(function (i, cur) {
+        while (cur && cur.ownerDocument && cur !== context) {
+          if (pos ? pos.index(cur) > -1 : jQuery(cur).is(selectors)) {
+            return cur;
+          }
+          cur = cur.parentNode;
+        }
+        return null;
+      });
+    },
+
+    // Determine the position of an element within
+    // the matched set of elements
+    index: function (elem) {
+      if (!elem || typeof elem === "string") {
+        return jQuery.inArray(this[0],
+            // If it receives a string, the selector is used
+            // If it receives nothing, the siblings are used
+            elem ? jQuery(elem) : this.parent().children());
+      }
+      // 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
+          || this.context) : jQuery.makeArray(selector),
+          all = jQuery.merge(this.get(), set);
+
+      return this.pushStack(
+          isDisconnected(set[0]) || isDisconnected(all[0]) ? all
+              : jQuery.unique(all));
+    },
+
+    andSelf: function () {
+      return this.add(this.prevObject);
+    }
+  });
 
 // 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;
-}
-
-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 jQuery.nth( elem, 2, "nextSibling" );
-	},
-	prev: function( elem ) {
-		return jQuery.nth( elem, 2, "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.makeArray( 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 ? jQuery.unique( ret ) : ret;
-
-		if ( (this.length > 1 || rmultiselector.test( selector )) && rparentsprev.test( name ) ) {
-			ret = ret.reverse();
-		}
-
-		return this.pushStack( ret, name, slice.call(arguments).join(",") );
-	};
-});
-
-jQuery.extend({
-	filter: function( expr, elems, not ) {
-		if ( not ) {
-			expr = ":not(" + expr + ")";
-		}
-
-		return 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;
-	},
-
-	nth: function( cur, result, dir, elem ) {
-		result = result || 1;
-		var num = 0;
-
-		for ( ; cur; cur = cur[dir] ) {
-			if ( cur.nodeType === 1 && ++num === result ) {
-				break;
-			}
-		}
-
-		return cur;
-	},
-
-	sibling: function( n, elem ) {
-		var r = [];
-
-		for ( ; n; n = n.nextSibling ) {
-			if ( n.nodeType === 1 && n !== elem ) {
-				r.push( n );
-			}
-		}
-
-		return r;
-	}
-});
-var rinlinejQuery = / jQuery\d+="(?:\d+|null)"/g,
-	rleadingWhitespace = /^\s+/,
-	rxhtmlTag = /(<([\w:]+)[^>]*?)\/>/g,
-	rselfClosing = /^(?:area|br|col|embed|hr|img|input|link|meta|param)$/i,
-	rtagName = /<([\w:]+)/,
-	rtbody = /<tbody/i,
-	rhtml = /<|&#?\w+;/,
-	rnocache = /<script|<object|<embed|<option|<style/i,
-	rchecked = /checked\s*(?:[^=]|=\s*.checked.)/i,  // checked="checked" or checked (html5)
-	fcloseTag = function( all, front, tag ) {
-		return rselfClosing.test( tag ) ?
-			all :
-			front + "></" + tag + ">";
-	},
-	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, "", "" ]
-	};
-
-wrapMap.optgroup = wrapMap.option;
-wrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.thead;
-wrapMap.th = wrapMap.td;
+  function isDisconnected(node) {
+    return !node || !node.parentNode || node.parentNode.nodeType === 11;
+  }
+
+  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 jQuery.nth(elem, 2, "nextSibling");
+    },
+    prev: function (elem) {
+      return jQuery.nth(elem, 2, "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.makeArray(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 ? jQuery.unique(ret) : ret;
+
+      if ((this.length > 1 || rmultiselector.test(selector))
+          && rparentsprev.test(name)) {
+        ret = ret.reverse();
+      }
+
+      return this.pushStack(ret, name, slice.call(arguments).join(","));
+    };
+  });
+
+  jQuery.extend({
+    filter: function (expr, elems, not) {
+      if (not) {
+        expr = ":not(" + expr + ")";
+      }
+
+      return 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;
+    },
+
+    nth: function (cur, result, dir, elem) {
+      result = result || 1;
+      var num = 0;
+
+      for (; cur; cur = cur[dir]) {
+        if (cur.nodeType === 1 && ++num === result) {
+          break;
+        }
+      }
+
+      return cur;
+    },
+
+    sibling: function (n, elem) {
+      var r = [];
+
+      for (; n; n = n.nextSibling) {
+        if (n.nodeType === 1 && n !== elem) {
+          r.push(n);
+        }
+      }
+
+      return r;
+    }
+  });
+  var rinlinejQuery = / jQuery\d+="(?:\d+|null)"/g,
+      rleadingWhitespace = /^\s+/,
+      rxhtmlTag = /(<([\w:]+)[^>]*?)\/>/g,
+      rselfClosing = /^(?:area|br|col|embed|hr|img|input|link|meta|param)$/i,
+      rtagName = /<([\w:]+)/,
+      rtbody = /<tbody/i,
+      rhtml = /<|&#?\w+;/,
+      rnocache = /<script|<object|<embed|<option|<style/i,
+      rchecked = /checked\s*(?:[^=]|=\s*.checked.)/i,  // checked="checked" or checked (html5)
+      fcloseTag = function (all, front, tag) {
+        return rselfClosing.test(tag) ? all : front + "></" + tag + ">";
+      },
+      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, "", ""]
+      };
+
+  wrapMap.optgroup = wrapMap.option;
+  wrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.thead;
+  wrapMap.th = wrapMap.td;
 
 // IE can't serialize <link> and <script> tags normally
-if ( !jQuery.support.htmlSerialize ) {
-	wrapMap._default = [ 1, "div<div>", "</div>" ];
-}
-
-jQuery.fn.extend({
-	text: function( text ) {
-		if ( jQuery.isFunction(text) ) {
-			return this.each(function(i) {
-				var self = jQuery(this);
-				self.text( text.call(this, i, self.text()) );
-			});
-		}
-
-		if ( typeof text !== "object" && text !== undefined ) {
-			return this.empty().append( (this[0] && this[0].ownerDocument || document).createTextNode( text ) );
-		}
-
-		return jQuery.text( this );
-	},
-
-	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 ) {
-		return this.each(function() {
-			jQuery( this ).wrapAll( 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.appendChild( elem );
-			}
-		});
-	},
-
-	prepend: function() {
-		return this.domManip(arguments, true, function( elem ) {
-			if ( this.nodeType === 1 ) {
-				this.insertBefore( elem, this.firstChild );
-			}
-		});
-	},
-
-	before: function() {
-		if ( this[0] && this[0].parentNode ) {
-			return this.domManip(arguments, false, function( elem ) {
-				this.parentNode.insertBefore( elem, this );
-			});
-		} else if ( arguments.length ) {
-			var set = jQuery(arguments[0]);
-			set.push.apply( set, this.toArray() );
-			return this.pushStack( set, "before", arguments );
-		}
-	},
-
-	after: function() {
-		if ( this[0] && this[0].parentNode ) {
-			return this.domManip(arguments, false, function( elem ) {
-				this.parentNode.insertBefore( elem, this.nextSibling );
-			});
-		} else if ( arguments.length ) {
-			var set = this.pushStack( this, "after", arguments );
-			set.push.apply( set, jQuery(arguments[0]).toArray() );
-			return set;
-		}
-	},
-	
-	// keepData is for internal use only--do not document
-	remove: function( selector, keepData ) {
-		for ( var i = 0, elem; (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() {
-		for ( var i = 0, elem; (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( events ) {
-		// Do the clone
-		var ret = this.map(function() {
-			if ( !jQuery.support.noCloneEvent && !jQuery.isXMLDoc(this) ) {
-				// IE copies events bound via attachEvent when
-				// using cloneNode. Calling detachEvent on the
-				// clone will also remove the events from the orignal
-				// In order to get around this, we use innerHTML.
-				// Unfortunately, this means some modifications to
-				// attributes in IE that are actually only stored
-				// as properties will not be copied (such as the
-				// the name attribute on an input).
-				var html = this.outerHTML, ownerDocument = this.ownerDocument;
-				if ( !html ) {
-					var div = ownerDocument.createElement("div");
-					div.appendChild( this.cloneNode(true) );
-					html = div.innerHTML;
-				}
-
-				return jQuery.clean([html.replace(rinlinejQuery, "")
-					// Handle the case in IE 8 where action=/test/> self-closes a tag
-					.replace(/=([^="'>\s]+\/)>/g, '="$1">')
-					.replace(rleadingWhitespace, "")], ownerDocument)[0];
-			} else {
-				return this.cloneNode(true);
-			}
-		});
-
-		// Copy the events from the original to the clone
-		if ( events === true ) {
-			cloneCopyEvent( this, ret );
-			cloneCopyEvent( this.find("*"), ret.find("*") );
-		}
-
-		// Return the cloned set
-		return ret;
-	},
-
-	html: function( value ) {
-		if ( value === undefined ) {
-			return this[0] && this[0].nodeType === 1 ?
-				this[0].innerHTML.replace(rinlinejQuery, "") :
-				null;
-
-		// See if we can take a shortcut and just use innerHTML
-		} else if ( typeof value === "string" && !rnocache.test( value ) &&
-			(jQuery.support.leadingWhitespace || !rleadingWhitespace.test( value )) &&
-			!wrapMap[ (rtagName.exec( value ) || ["", ""])[1].toLowerCase() ] ) {
-
-			value = value.replace(rxhtmlTag, fcloseTag);
-
-			try {
-				for ( var i = 0, l = this.length; i < l; i++ ) {
-					// Remove element nodes and prevent memory leaks
-					if ( this[i].nodeType === 1 ) {
-						jQuery.cleanData( this[i].getElementsByTagName("*") );
-						this[i].innerHTML = value;
-					}
-				}
-
-			// If using innerHTML throws an exception, use the fallback method
-			} catch(e) {
-				this.empty().append( value );
-			}
-
-		} else if ( jQuery.isFunction( value ) ) {
-			this.each(function(i){
-				var self = jQuery(this), old = self.html();
-				self.empty().append(function(){
-					return value.call( this, i, old );
-				});
-			});
-
-		} else {
-			this.empty().append( value );
-		}
-
-		return this;
-	},
-
-	replaceWith: function( value ) {
-		if ( this[0] && this[0].parentNode ) {
-			// 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 );
-				}
-			});
-		} else {
-			return this.pushStack( jQuery(jQuery.isFunction(value) ? value() : value), "replaceWith", value );
-		}
-	},
-
-	detach: function( selector ) {
-		return this.remove( selector, true );
-	},
-
-	domManip: function( args, table, callback ) {
-		var results, first, value = args[0], scripts = [], fragment, parent;
-
-		// We can't cloneNode fragments that contain checked, in WebKit
-		if ( !jQuery.support.checkClone && arguments.length === 3 && typeof value === "string" && rchecked.test( value ) ) {
-			return this.each(function() {
-				jQuery(this).domManip( args, table, callback, true );
-			});
-		}
-
-		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] ) {
-			parent = value && value.parentNode;
-
-			// If we're in a fragment, just use that instead of building a new one
-			if ( jQuery.support.parentNode && parent && parent.nodeType === 11 && parent.childNodes.length === this.length ) {
-				results = { fragment: parent };
-
-			} else {
-				results = buildFragment( args, this, scripts );
-			}
-			
-			fragment = results.fragment;
-			
-			if ( fragment.childNodes.length === 1 ) {
-				first = fragment = fragment.firstChild;
-			} else {
-				first = fragment.firstChild;
-			}
-
-			if ( first ) {
-				table = table && jQuery.nodeName( first, "tr" );
-
-				for ( var i = 0, l = this.length; i < l; i++ ) {
-					callback.call(
-						table ?
-							root(this[i], first) :
-							this[i],
-						i > 0 || results.cacheable || this.length > 1  ?
-							fragment.cloneNode(true) :
-							fragment
-					);
-				}
-			}
-
-			if ( scripts.length ) {
-				jQuery.each( scripts, evalScript );
-			}
-		}
-
-		return this;
-
-		function root( elem, cur ) {
-			return jQuery.nodeName(elem, "table") ?
-				(elem.getElementsByTagName("tbody")[0] ||
-				elem.appendChild(elem.ownerDocument.createElement("tbody"))) :
-				elem;
-		}
-	}
-});
-
-function cloneCopyEvent(orig, ret) {
-	var i = 0;
-
-	ret.each(function() {
-		if ( this.nodeName !== (orig[i] && orig[i].nodeName) ) {
-			return;
-		}
-
-		var oldData = jQuery.data( orig[i++] ), curData = jQuery.data( this, oldData ), events = oldData && oldData.events;
-
-		if ( events ) {
-			delete curData.handle;
-			curData.events = {};
-
-			for ( var type in events ) {
-				for ( var handler in events[ type ] ) {
-					jQuery.event.add( this, type, events[ type ][ handler ], events[ type ][ handler ].data );
-				}
-			}
-		}
-	});
-}
-
-function buildFragment( args, nodes, scripts ) {
-	var fragment, cacheable, cacheresults,
-		doc = (nodes && nodes[0] ? nodes[0].ownerDocument || nodes[0] : document);
-
-	// Only cache "small" (1/2 KB) 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
-	if ( args.length === 1 && typeof args[0] === "string" && args[0].length < 512 && doc === document &&
-		!rnocache.test( args[0] ) && (jQuery.support.checkClone || !rchecked.test( args[0] )) ) {
-
-		cacheable = true;
-		cacheresults = jQuery.fragments[ args[0] ];
-		if ( cacheresults ) {
-			if ( cacheresults !== 1 ) {
-				fragment = cacheresults;
-			}
-		}
-	}
-
-	if ( !fragment ) {
-		fragment = doc.createDocumentFragment();
-		jQuery.clean( args, doc, fragment, scripts );
-	}
-
-	if ( cacheable ) {
-		jQuery.fragments[ args[0] ] = cacheresults ? fragment : 1;
-	}
-
-	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 ret = [], insert = jQuery( selector ),
-			parent = this.length === 1 && this[0].parentNode;
-		
-		if ( parent && parent.nodeType === 11 && parent.childNodes.length === 1 && insert.length === 1 ) {
-			insert[ original ]( this[0] );
-			return this;
-			
-		} else {
-			for ( var i = 0, l = insert.length; i < l; i++ ) {
-				var elems = (i > 0 ? this.clone(true) : this).get();
-				jQuery.fn[ original ].apply( jQuery(insert[i]), elems );
-				ret = ret.concat( elems );
-			}
-		
-			return this.pushStack( ret, name, insert.selector );
-		}
-	};
-});
-
-jQuery.extend({
-	clean: function( elems, context, fragment, scripts ) {
-		context = context || document;
-
-		// !context.createElement fails in IE with an error but returns typeof 'object'
-		if ( typeof context.createElement === "undefined" ) {
-			context = context.ownerDocument || context[0] && context[0].ownerDocument || document;
-		}
-
-		var ret = [];
-
-		for ( var i = 0, elem; (elem = elems[i]) != null; i++ ) {
-			if ( typeof elem === "number" ) {
-				elem += "";
-			}
-
-			if ( !elem ) {
-				continue;
-			}
-
-			// Convert html string into DOM nodes
-			if ( typeof elem === "string" && !rhtml.test( elem ) ) {
-				elem = context.createTextNode( elem );
-
-			} else if ( typeof elem === "string" ) {
-				// Fix "XHTML"-style tags in all browsers
-				elem = elem.replace(rxhtmlTag, fcloseTag);
-
-				// Trim whitespace, otherwise indexOf won't work as expected
-				var tag = (rtagName.exec( elem ) || ["", ""])[1].toLowerCase(),
-					wrap = wrapMap[ tag ] || wrapMap._default,
-					depth = wrap[0],
-					div = context.createElement("div");
-
-				// Go to html and back, then peel off extra wrappers
-				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>
-					var 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 ( var 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;
-			}
-
-			if ( elem.nodeType ) {
-				ret.push( elem );
-			} else {
-				ret = jQuery.merge( ret, elem );
-			}
-		}
-
-		if ( fragment ) {
-			for ( var i = 0; ret[i]; i++ ) {
-				if ( scripts && jQuery.nodeName( ret[i], "script" ) && (!ret[i].type || ret[i].type.toLowerCase() === "text/javascript") ) {
-					scripts.push( ret[i].parentNode ? ret[i].parentNode.removeChild( ret[i] ) : ret[i] );
-				
-				} else {
-					if ( ret[i].nodeType === 1 ) {
-						ret.splice.apply( ret, [i + 1, 0].concat(jQuery.makeArray(ret[i].getElementsByTagName("script"))) );
-					}
-					fragment.appendChild( ret[i] );
-				}
-			}
-		}
-
-		return ret;
-	},
-	
-	cleanData: function( elems ) {
-		var data, id, cache = jQuery.cache,
-			special = jQuery.event.special,
-			deleteExpando = jQuery.support.deleteExpando;
-		
-		for ( var i = 0, elem; (elem = elems[i]) != null; i++ ) {
-			id = elem[ jQuery.expando ];
-			
-			if ( id ) {
-				data = cache[ id ];
-				
-				if ( data.events ) {
-					for ( var type in data.events ) {
-						if ( special[ type ] ) {
-							jQuery.event.remove( elem, type );
-
-						} else {
-							removeEvent( elem, type, data.handle );
-						}
-					}
-				}
-				
-				if ( deleteExpando ) {
-					delete elem[ jQuery.expando ];
-
-				} else if ( elem.removeAttribute ) {
-					elem.removeAttribute( jQuery.expando );
-				}
-				
-				delete cache[ id ];
-			}
-		}
-	}
-});
+  if (!jQuery.support.htmlSerialize) {
+    wrapMap._default = [1, "div<div>", "</div>"];
+  }
+
+  jQuery.fn.extend({
+    text: function (text) {
+      if (jQuery.isFunction(text)) {
+        return this.each(function (i) {
+          var self = jQuery(this);
+          self.text(text.call(this, i, self.text()));
+        });
+      }
+
+      if (typeof text !== "object" && text !== undefined) {
+        return this.empty().append(
+            (this[0] && this[0].ownerDocument || document).createTextNode(
+                text));
+      }
+
+      return jQuery.text(this);
+    },
+
+    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) {
+      return this.each(function () {
+        jQuery(this).wrapAll(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.appendChild(elem);
+        }
+      });
+    },
+
+    prepend: function () {
+      return this.domManip(arguments, true, function (elem) {
+        if (this.nodeType === 1) {
+          this.insertBefore(elem, this.firstChild);
+        }
+      });
+    },
+
+    before: function () {
+      if (this[0] && this[0].parentNode) {
+        return this.domManip(arguments, false, function (elem) {
+          this.parentNode.insertBefore(elem, this);
+        });
+      } else if (arguments.length) {
+        var set = jQuery(arguments[0]);
+        set.push.apply(set, this.toArray());
+        return this.pushStack(set, "before", arguments);
+      }
+    },
+
+    after: function () {
+      if (this[0] && this[0].parentNode) {
+        return this.domManip(arguments, false, function (elem) {
+          this.parentNode.insertBefore(elem, this.nextSibling);
+        });
+      } else if (arguments.length) {
+        var set = this.pushStack(this, "after", arguments);
+        set.push.apply(set, jQuery(arguments[0]).toArray());
+        return set;
+      }
+    },
+
+    // keepData is for internal use only--do not document
+    remove: function (selector, keepData) {
+      for (var i = 0, elem; (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 () {
+      for (var i = 0, elem; (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 (events) {
+      // Do the clone
+      var ret = this.map(function () {
+        if (!jQuery.support.noCloneEvent && !jQuery.isXMLDoc(this)) {
+          // IE copies events bound via attachEvent when
+          // using cloneNode. Calling detachEvent on the
+          // clone will also remove the events from the orignal
+          // In order to get around this, we use innerHTML.
+          // Unfortunately, this means some modifications to
+          // attributes in IE that are actually only stored
+          // as properties will not be copied (such as the
+          // the name attribute on an input).
+          var html = this.outerHTML, ownerDocument = this.ownerDocument;
+          if (!html) {
+            var div = ownerDocument.createElement("div");
+            div.appendChild(this.cloneNode(true));
+            html = div.innerHTML;
+          }
+
+          return jQuery.clean([html.replace(rinlinejQuery, "")
+          // Handle the case in IE 8 where action=/test/> self-closes a tag
+          .replace(/=([^="'>\s]+\/)>/g, '="$1">')
+          .replace(rleadingWhitespace, "")], ownerDocument)[0];
+        } else {
+          return this.cloneNode(true);
+        }
+      });
+
+      // Copy the events from the original to the clone
+      if (events === true) {
+        cloneCopyEvent(this, ret);
+        cloneCopyEvent(this.find("*"), ret.find("*"));
+      }
+
+      // Return the cloned set
+      return ret;
+    },
+
+    html: function (value) {
+      if (value === undefined) {
+        return this[0] && this[0].nodeType === 1 ? this[0].innerHTML.replace(
+            rinlinejQuery, "") : null;
+
+        // See if we can take a shortcut and just use innerHTML
+      } else if (typeof value === "string" && !rnocache.test(value) &&
+          (jQuery.support.leadingWhitespace || !rleadingWhitespace.test(value))
+          &&
+          !wrapMap[(rtagName.exec(value) || ["", ""])[1].toLowerCase()]) {
+
+        value = value.replace(rxhtmlTag, fcloseTag);
+
+        try {
+          for (var i = 0, l = this.length; i < l; i++) {
+            // Remove element nodes and prevent memory leaks
+            if (this[i].nodeType === 1) {
+              jQuery.cleanData(this[i].getElementsByTagName("*"));
+              this[i].innerHTML = value;
+            }
+          }
+
+          // If using innerHTML throws an exception, use the fallback method
+        } catch (e) {
+          this.empty().append(value);
+        }
+
+      } else if (jQuery.isFunction(value)) {
+        this.each(function (i) {
+          var self = jQuery(this), old = self.html();
+          self.empty().append(function () {
+            return value.call(this, i, old);
+          });
+        });
+
+      } else {
+        this.empty().append(value);
+      }
+
+      return this;
+    },
+
+    replaceWith: function (value) {
+      if (this[0] && this[0].parentNode) {
+        // 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);
+          }
+        });
+      } else {
+        return this.pushStack(
+            jQuery(jQuery.isFunction(value) ? value() : value), "replaceWith",
+            value);
+      }
+    },
+
+    detach: function (selector) {
+      return this.remove(selector, true);
+    },
+
+    domManip: function (args, table, callback) {
+      var results, first, value = args[0], scripts = [], fragment, parent;
+
+      // We can't cloneNode fragments that contain checked, in WebKit
+      if (!jQuery.support.checkClone && arguments.length === 3 && typeof value
+          === "string" && rchecked.test(value)) {
+        return this.each(function () {
+          jQuery(this).domManip(args, table, callback, true);
+        });
+      }
+
+      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]) {
+        parent = value && value.parentNode;
+
+        // If we're in a fragment, just use that instead of building a new one
+        if (jQuery.support.parentNode && parent && parent.nodeType === 11
+            && parent.childNodes.length === this.length) {
+          results = {fragment: parent};
+
+        } else {
+          results = buildFragment(args, this, scripts);
+        }
+
+        fragment = results.fragment;
+
+        if (fragment.childNodes.length === 1) {
+          first = fragment = fragment.firstChild;
+        } else {
+          first = fragment.firstChild;
+        }
+
+        if (first) {
+          table = table && jQuery.nodeName(first, "tr");
+
+          for (var i = 0, l = this.length; i < l; i++) {
+            callback.call(
+                table ? root(this[i], first) : this[i],
+                i > 0 || results.cacheable || this.length > 1
+                    ? fragment.cloneNode(true) : fragment
+            );
+          }
+        }
+
+        if (scripts.length) {
+          jQuery.each(scripts, evalScript);
+        }
+      }
+
+      return this;
+
+      function root(elem, cur) {
+        return jQuery.nodeName(elem, "table") ? (elem.getElementsByTagName(
+            "tbody")[0] ||
+            elem.appendChild(elem.ownerDocument.createElement("tbody"))) : elem;
+      }
+    }
+  });
+
+  function cloneCopyEvent(orig, ret) {
+    var i = 0;
+
+    ret.each(function () {
+      if (this.nodeName !== (orig[i] && orig[i].nodeName)) {
+        return;
+      }
+
+      var oldData = jQuery.data(orig[i++]),
+          curData = jQuery.data(this, oldData),
+          events = oldData && oldData.events;
+
+      if (events) {
+        delete curData.handle;
+        curData.events = {};
+
+        for (var type in events) {
+          for (var handler in events[type]) {
+            jQuery.event.add(this, type, events[type][handler],
+                events[type][handler].data);
+          }
+        }
+      }
+    });
+  }
+
+  function buildFragment(args, nodes, scripts) {
+    var fragment, cacheable, cacheresults,
+        doc = (nodes && nodes[0] ? nodes[0].ownerDocument || nodes[0]
+            : document);
+
+    // Only cache "small" (1/2 KB) 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
+    if (args.length === 1 && typeof args[0] === "string" && args[0].length < 512
+        && doc === document &&
+        !rnocache.test(args[0]) && (jQuery.support.checkClone || !rchecked.test(
+            args[0]))) {
+
+      cacheable = true;
+      cacheresults = jQuery.fragments[args[0]];
+      if (cacheresults) {
+        if (cacheresults !== 1) {
+          fragment = cacheresults;
+        }
+      }
+    }
+
+    if (!fragment) {
+      fragment = doc.createDocumentFragment();
+      jQuery.clean(args, doc, fragment, scripts);
+    }
+
+    if (cacheable) {
+      jQuery.fragments[args[0]] = cacheresults ? fragment : 1;
+    }
+
+    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 ret = [], insert = jQuery(selector),
+          parent = this.length === 1 && this[0].parentNode;
+
+      if (parent && parent.nodeType === 11 && parent.childNodes.length === 1
+          && insert.length === 1) {
+        insert[original](this[0]);
+        return this;
+
+      } else {
+        for (var i = 0, l = insert.length; i < l; i++) {
+          var elems = (i > 0 ? this.clone(true) : this).get();
+          jQuery.fn[original].apply(jQuery(insert[i]), elems);
+          ret = ret.concat(elems);
+        }
+
+        return this.pushStack(ret, name, insert.selector);
+      }
+    };
+  });
+
+  jQuery.extend({
+    clean: function (elems, context, fragment, scripts) {
+      context = context || document;
+
+      // !context.createElement fails in IE with an error but returns typeof 'object'
+      if (typeof context.createElement === "undefined") {
+        context = context.ownerDocument || context[0]
+            && context[0].ownerDocument || document;
+      }
+
+      var ret = [];
+
+      for (var i = 0, elem; (elem = elems[i]) != null; i++) {
+        if (typeof elem === "number") {
+          elem += "";
+        }
+
+        if (!elem) {
+          continue;
+        }
+
+        // Convert html string into DOM nodes
+        if (typeof elem === "string" && !rhtml.test(elem)) {
+          elem = context.createTextNode(elem);
+
+        } else if (typeof elem === "string") {
+          // Fix "XHTML"-style tags in all browsers
+          elem = elem.replace(rxhtmlTag, fcloseTag);
+
+          // Trim whitespace, otherwise indexOf won't work as expected
+          var tag = (rtagName.exec(elem) || ["", ""])[1].toLowerCase(),
+              wrap = wrapMap[tag] || wrapMap._default,
+              depth = wrap[0],
+              div = context.createElement("div");
+
+          // Go to html and back, then peel off extra wrappers
+          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>
+            var 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 (var 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;
+        }
+
+        if (elem.nodeType) {
+          ret.push(elem);
+        } else {
+          ret = jQuery.merge(ret, elem);
+        }
+      }
+
+      if (fragment) {
+        for (var i = 0; ret[i]; i++) {
+          if (scripts && jQuery.nodeName(ret[i], "script") && (!ret[i].type
+                  || ret[i].type.toLowerCase() === "text/javascript")) {
+            scripts.push(
+                ret[i].parentNode ? ret[i].parentNode.removeChild(ret[i])
+                    : ret[i]);
+
+          } else {
+            if (ret[i].nodeType === 1) {
+              ret.splice.apply(ret, [i + 1, 0].concat(
+                  jQuery.makeArray(ret[i].getElementsByTagName("script"))));
+            }
+            fragment.appendChild(ret[i]);
+          }
+        }
+      }
+
+      return ret;
+    },
+
+    cleanData: function (elems) {
+      var data, id, cache = jQuery.cache,
+          special = jQuery.event.special,
+          deleteExpando = jQuery.support.deleteExpando;
+
+      for (var i = 0, elem; (elem = elems[i]) != null; i++) {
+        id = elem[jQuery.expando];
+
+        if (id) {
+          data = cache[id];
+
+          if (data.events) {
+            for (var type in data.events) {
+              if (special[type]) {
+                jQuery.event.remove(elem, type);
+
+              } else {
+                removeEvent(elem, type, data.handle);
+              }
+            }
+          }
+
+          if (deleteExpando) {
+            delete elem[jQuery.expando];
+
+          } else if (elem.removeAttribute) {
+            elem.removeAttribute(jQuery.expando);
+          }
+
+          delete cache[id];
+        }
+      }
+    }
+  });
 // exclude the following css properties to add px
-var rexclude = /z-?index|font-?weight|opacity|zoom|line-?height/i,
-	ralpha = /alpha\([^)]*\)/,
-	ropacity = /opacity=([^)]*)/,
-	rfloat = /float/i,
-	rdashAlpha = /-([a-z])/ig,
-	rupper = /([A-Z])/g,
-	rnumpx = /^-?\d+(?:px)?$/i,
-	rnum = /^-?\d/,
-
-	cssShow = { position: "absolute", visibility: "hidden", display:"block" },
-	cssWidth = [ "Left", "Right" ],
-	cssHeight = [ "Top", "Bottom" ],
-
-	// cache check for defaultView.getComputedStyle
-	getComputedStyle = document.defaultView && document.defaultView.getComputedStyle,
-	// normalize float css property
-	styleFloat = jQuery.support.cssFloat ? "cssFloat" : "styleFloat",
-	fcamelCase = function( all, letter ) {
-		return letter.toUpperCase();
-	};
-
-jQuery.fn.css = function( name, value ) {
-	return access( this, name, value, true, function( elem, name, value ) {
-		if ( value === undefined ) {
-			return jQuery.curCSS( elem, name );
-		}
-		
-		if ( typeof value === "number" && !rexclude.test(name) ) {
-			value += "px";
-		}
-
-		jQuery.style( elem, name, value );
-	});
-};
-
-jQuery.extend({
-	style: function( elem, name, value ) {
-		// don't set styles on text and comment nodes
-		if ( !elem || elem.nodeType === 3 || elem.nodeType === 8 ) {
-			return undefined;
-		}
-
-		// ignore negative width and height values #1599
-		if ( (name === "width" || name === "height") && parseFloat(value) < 0 ) {
-			value = undefined;
-		}
-
-		var style = elem.style || elem, set = value !== undefined;
-
-		// IE uses filters for opacity
-		if ( !jQuery.support.opacity && name === "opacity" ) {
-			if ( set ) {
-				// IE has trouble with opacity if it does not have layout
-				// Force it by setting the zoom level
-				style.zoom = 1;
-
-				// Set the alpha filter to set the opacity
-				var opacity = parseInt( value, 10 ) + "" === "NaN" ? "" : "alpha(opacity=" + value * 100 + ")";
-				var filter = style.filter || jQuery.curCSS( elem, "filter" ) || "";
-				style.filter = ralpha.test(filter) ? filter.replace(ralpha, opacity) : opacity;
-			}
-
-			return style.filter && style.filter.indexOf("opacity=") >= 0 ?
-				(parseFloat( ropacity.exec(style.filter)[1] ) / 100) + "":
-				"";
-		}
-
-		// Make sure we're using the right name for getting the float value
-		if ( rfloat.test( name ) ) {
-			name = styleFloat;
-		}
-
-		name = name.replace(rdashAlpha, fcamelCase);
-
-		if ( set ) {
-			style[ name ] = value;
-		}
-
-		return style[ name ];
-	},
-
-	css: function( elem, name, force, extra ) {
-		if ( name === "width" || name === "height" ) {
-			var val, props = cssShow, which = name === "width" ? cssWidth : cssHeight;
-
-			function getWH() {
-				val = name === "width" ? elem.offsetWidth : elem.offsetHeight;
-
-				if ( extra === "border" ) {
-					return;
-				}
-
-				jQuery.each( which, function() {
-					if ( !extra ) {
-						val -= parseFloat(jQuery.curCSS( elem, "padding" + this, true)) || 0;
-					}
-
-					if ( extra === "margin" ) {
-						val += parseFloat(jQuery.curCSS( elem, "margin" + this, true)) || 0;
-					} else {
-						val -= parseFloat(jQuery.curCSS( elem, "border" + this + "Width", true)) || 0;
-					}
-				});
-			}
-
-			if ( elem.offsetWidth !== 0 ) {
-				getWH();
-			} else {
-				jQuery.swap( elem, props, getWH );
-			}
-
-			return Math.max(0, Math.round(val));
-		}
-
-		return jQuery.curCSS( elem, name, force );
-	},
-
-	curCSS: function( elem, name, force ) {
-		var ret, style = elem.style, filter;
-
-		// IE uses filters for opacity
-		if ( !jQuery.support.opacity && name === "opacity" && elem.currentStyle ) {
-			ret = ropacity.test(elem.currentStyle.filter || "") ?
-				(parseFloat(RegExp.$1) / 100) + "" :
-				"";
-
-			return ret === "" ?
-				"1" :
-				ret;
-		}
-
-		// Make sure we're using the right name for getting the float value
-		if ( rfloat.test( name ) ) {
-			name = styleFloat;
-		}
-
-		if ( !force && style && style[ name ] ) {
-			ret = style[ name ];
-
-		} else if ( getComputedStyle ) {
-
-			// Only "float" is needed here
-			if ( rfloat.test( name ) ) {
-				name = "float";
-			}
-
-			name = name.replace( rupper, "-$1" ).toLowerCase();
-
-			var defaultView = elem.ownerDocument.defaultView;
-
-			if ( !defaultView ) {
-				return null;
-			}
-
-			var computedStyle = defaultView.getComputedStyle( elem, null );
-
-			if ( computedStyle ) {
-				ret = computedStyle.getPropertyValue( name );
-			}
-
-			// We should always get a number back from opacity
-			if ( name === "opacity" && ret === "" ) {
-				ret = "1";
-			}
-
-		} else if ( elem.currentStyle ) {
-			var camelCase = name.replace(rdashAlpha, fcamelCase);
-
-			ret = elem.currentStyle[ name ] || elem.currentStyle[ camelCase ];
-
-			// 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
-			if ( !rnumpx.test( ret ) && rnum.test( ret ) ) {
-				// Remember the original values
-				var left = style.left, rsLeft = elem.runtimeStyle.left;
-
-				// Put in the new values to get a computed value out
-				elem.runtimeStyle.left = elem.currentStyle.left;
-				style.left = camelCase === "fontSize" ? "1em" : (ret || 0);
-				ret = style.pixelLeft + "px";
-
-				// Revert the changed values
-				style.left = left;
-				elem.runtimeStyle.left = rsLeft;
-			}
-		}
-
-		return ret;
-	},
-
-	// A method for quickly swapping in/out CSS properties to get correct calculations
-	swap: function( elem, options, callback ) {
-		var old = {};
-
-		// Remember the old values, and insert the new ones
-		for ( var name in options ) {
-			old[ name ] = elem.style[ name ];
-			elem.style[ name ] = options[ name ];
-		}
-
-		callback.call( elem );
-
-		// Revert the old values
-		for ( var name in options ) {
-			elem.style[ name ] = old[ name ];
-		}
-	}
-});
-
-if ( jQuery.expr && jQuery.expr.filters ) {
-	jQuery.expr.filters.hidden = function( elem ) {
-		var width = elem.offsetWidth, height = elem.offsetHeight,
-			skip = elem.nodeName.toLowerCase() === "tr";
-
-		return width === 0 && height === 0 && !skip ?
-			true :
-			width > 0 && height > 0 && !skip ?
-				false :
-				jQuery.curCSS(elem, "display") === "none";
-	};
-
-	jQuery.expr.filters.visible = function( elem ) {
-		return !jQuery.expr.filters.hidden( elem );
-	};
-}
-var jsc = now(),
-	rscript = /<script(.|\s)*?\/script>/gi,
-	rselectTextarea = /select|textarea/i,
-	rinput = /color|date|datetime|email|hidden|month|number|password|range|search|tel|text|time|url|week/i,
-	jsre = /=\?(&|$)/,
-	rquery = /\?/,
-	rts = /(\?|&)_=.*?(&|$)/,
-	rurl = /^(\w+:)?\/\/([^\/?#]+)/,
-	r20 = /%20/g,
-
-	// Keep a copy of the old load method
-	_load = jQuery.fn.load;
-
-jQuery.fn.extend({
-	load: function( url, params, callback ) {
-		if ( typeof url !== "string" ) {
-			return _load.call( this, url );
-
-		// Don't do a request if no elements are being requested
-		} else if ( !this.length ) {
-			return this;
-		}
-
-		var off = url.indexOf(" ");
-		if ( off >= 0 ) {
-			var selector = url.slice(off, url.length);
-			url = url.slice(0, off);
-		}
-
-		// Default to a GET request
-		var type = "GET";
-
-		// If the second parameter was provided
-		if ( params ) {
-			// If it's a function
-			if ( jQuery.isFunction( params ) ) {
-				// We assume that it's the callback
-				callback = params;
-				params = null;
-
-			// Otherwise, build a param string
-			} else if ( typeof params === "object" ) {
-				params = jQuery.param( params, jQuery.ajaxSettings.traditional );
-				type = "POST";
-			}
-		}
-
-		var self = this;
-
-		// Request the remote document
-		jQuery.ajax({
-			url: url,
-			type: type,
-			dataType: "html",
-			data: params,
-			complete: function( res, status ) {
-				// If successful, inject the HTML into all the matched elements
-				if ( status === "success" || status === "notmodified" ) {
-					// 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(res.responseText.replace(rscript, ""))
-
-							// Locate the specified elements
-							.find(selector) :
-
-						// If not, just inject the full result
-						res.responseText );
-				}
-
-				if ( callback ) {
-					self.each( callback, [res.responseText, status, res] );
-				}
-			}
-		});
-
-		return this;
-	},
-
-	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 };
-					}) :
-					{ name: elem.name, value: val };
-		}).get();
-	}
-});
+  var rexclude = /z-?index|font-?weight|opacity|zoom|line-?height/i,
+      ralpha = /alpha\([^)]*\)/,
+      ropacity = /opacity=([^)]*)/,
+      rfloat = /float/i,
+      rdashAlpha = /-([a-z])/ig,
+      rupper = /([A-Z])/g,
+      rnumpx = /^-?\d+(?:px)?$/i,
+      rnum = /^-?\d/,
+
+      cssShow = {position: "absolute", visibility: "hidden", display: "block"},
+      cssWidth = ["Left", "Right"],
+      cssHeight = ["Top", "Bottom"],
+
+      // cache check for defaultView.getComputedStyle
+      getComputedStyle = document.defaultView
+          && document.defaultView.getComputedStyle,
+      // normalize float css property
+      styleFloat = jQuery.support.cssFloat ? "cssFloat" : "styleFloat",
+      fcamelCase = function (all, letter) {
+        return letter.toUpperCase();
+      };
+
+  jQuery.fn.css = function (name, value) {
+    return access(this, name, value, true, function (elem, name, value) {
+      if (value === undefined) {
+        return jQuery.curCSS(elem, name);
+      }
+
+      if (typeof value === "number" && !rexclude.test(name)) {
+        value += "px";
+      }
+
+      jQuery.style(elem, name, value);
+    });
+  };
+
+  jQuery.extend({
+    style: function (elem, name, value) {
+      // don't set styles on text and comment nodes
+      if (!elem || elem.nodeType === 3 || elem.nodeType === 8) {
+        return undefined;
+      }
+
+      // ignore negative width and height values #1599
+      if ((name === "width" || name === "height") && parseFloat(value) < 0) {
+        value = undefined;
+      }
+
+      var style = elem.style || elem, set = value !== undefined;
+
+      // IE uses filters for opacity
+      if (!jQuery.support.opacity && name === "opacity") {
+        if (set) {
+          // IE has trouble with opacity if it does not have layout
+          // Force it by setting the zoom level
+          style.zoom = 1;
+
+          // Set the alpha filter to set the opacity
+          var opacity = parseInt(value, 10) + "" === "NaN" ? ""
+              : "alpha(opacity=" + value * 100 + ")";
+          var filter = style.filter || jQuery.curCSS(elem, "filter") || "";
+          style.filter = ralpha.test(filter) ? filter.replace(ralpha, opacity)
+              : opacity;
+        }
+
+        return style.filter && style.filter.indexOf("opacity=") >= 0
+            ? (parseFloat(ropacity.exec(style.filter)[1]) / 100) + "" : "";
+      }
+
+      // Make sure we're using the right name for getting the float value
+      if (rfloat.test(name)) {
+        name = styleFloat;
+      }
+
+      name = name.replace(rdashAlpha, fcamelCase);
+
+      if (set) {
+        style[name] = value;
+      }
+
+      return style[name];
+    },
+
+    css: function (elem, name, force, extra) {
+      if (name === "width" || name === "height") {
+        var val, props = cssShow,
+            which = name === "width" ? cssWidth : cssHeight;
+
+        function getWH() {
+          val = name === "width" ? elem.offsetWidth : elem.offsetHeight;
+
+          if (extra === "border") {
+            return;
+          }
+
+          jQuery.each(which, function () {
+            if (!extra) {
+              val -= parseFloat(jQuery.curCSS(elem, "padding" + this, true))
+                  || 0;
+            }
+
+            if (extra === "margin") {
+              val += parseFloat(jQuery.curCSS(elem, "margin" + this, true))
+                  || 0;
+            } else {
+              val -= parseFloat(
+                  jQuery.curCSS(elem, "border" + this + "Width", true)) || 0;
+            }
+          });
+        }
+
+        if (elem.offsetWidth !== 0) {
+          getWH();
+        } else {
+          jQuery.swap(elem, props, getWH);
+        }
+
+        return Math.max(0, Math.round(val));
+      }
+
+      return jQuery.curCSS(elem, name, force);
+    },
+
+    curCSS: function (elem, name, force) {
+      var ret, style = elem.style, filter;
+
+      // IE uses filters for opacity
+      if (!jQuery.support.opacity && name === "opacity" && elem.currentStyle) {
+        ret = ropacity.test(elem.currentStyle.filter || "") ? (parseFloat(
+            RegExp.$1) / 100) + "" : "";
+
+        return ret === "" ? "1" : ret;
+      }
+
+      // Make sure we're using the right name for getting the float value
+      if (rfloat.test(name)) {
+        name = styleFloat;
+      }
+
+      if (!force && style && style[name]) {
+        ret = style[name];
+
+      } else if (getComputedStyle) {
+
+        // Only "float" is needed here
+        if (rfloat.test(name)) {
+          name = "float";
+        }
+
+        name = name.replace(rupper, "-$1").toLowerCase();
+
+        var defaultView = elem.ownerDocument.defaultView;
+
+        if (!defaultView) {
+          return null;
+        }
+
+        var computedStyle = defaultView.getComputedStyle(elem, null);
+
+        if (computedStyle) {
+          ret = computedStyle.getPropertyValue(name);
+        }
+
+        // We should always get a number back from opacity
+        if (name === "opacity" && ret === "") {
+          ret = "1";
+        }
+
+      } else if (elem.currentStyle) {
+        var camelCase = name.replace(rdashAlpha, fcamelCase);
+
+        ret = elem.currentStyle[name] || elem.currentStyle[camelCase];
+
+        // 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
+        if (!rnumpx.test(ret) && rnum.test(ret)) {
+          // Remember the original values
+          var left = style.left, rsLeft = elem.runtimeStyle.left;
+
+          // Put in the new values to get a computed value out
+          elem.runtimeStyle.left = elem.currentStyle.left;
+          style.left = camelCase === "fontSize" ? "1em" : (ret || 0);
+          ret = style.pixelLeft + "px";
+
+          // Revert the changed values
+          style.left = left;
+          elem.runtimeStyle.left = rsLeft;
+        }
+      }
+
+      return ret;
+    },
+
+    // A method for quickly swapping in/out CSS properties to get correct calculations
+    swap: function (elem, options, callback) {
+      var old = {};
+
+      // Remember the old values, and insert the new ones
+      for (var name in options) {
+        old[name] = elem.style[name];
+        elem.style[name] = options[name];
+      }
+
+      callback.call(elem);
+
+      // Revert the old values
+      for (var name in options) {
+        elem.style[name] = old[name];
+      }
+    }
+  });
+
+  if (jQuery.expr && jQuery.expr.filters) {
+    jQuery.expr.filters.hidden = function (elem) {
+      var width = elem.offsetWidth, height = elem.offsetHeight,
+          skip = elem.nodeName.toLowerCase() === "tr";
+
+      return width === 0 && height === 0 && !skip ? true : width > 0 && height
+      > 0 && !skip ? false : jQuery.curCSS(elem, "display") === "none";
+    };
+
+    jQuery.expr.filters.visible = function (elem) {
+      return !jQuery.expr.filters.hidden(elem);
+    };
+  }
+  var jsc = now(),
+      rscript = /<script(.|\s)*?\/script>/gi,
+      rselectTextarea = /select|textarea/i,
+      rinput = /color|date|datetime|email|hidden|month|number|password|range|search|tel|text|time|url|week/i,
+      jsre = /=\?(&|$)/,
+      rquery = /\?/,
+      rts = /(\?|&)_=.*?(&|$)/,
+      rurl = /^(\w+:)?\/\/([^\/?#]+)/,
+      r20 = /%20/g,
+
+      // Keep a copy of the old load method
+      _load = jQuery.fn.load;
+
+  jQuery.fn.extend({
+    load: function (url, params, callback) {
+      if (typeof url !== "string") {
+        return _load.call(this, url);
+
+        // Don't do a request if no elements are being requested
+      } else if (!this.length) {
+        return this;
+      }
+
+      var off = url.indexOf(" ");
+      if (off >= 0) {
+        var selector = url.slice(off, url.length);
+        url = url.slice(0, off);
+      }
+
+      // Default to a GET request
+      var type = "GET";
+
+      // If the second parameter was provided
+      if (params) {
+        // If it's a function
+        if (jQuery.isFunction(params)) {
+          // We assume that it's the callback
+          callback = params;
+          params = null;
+
+          // Otherwise, build a param string
+        } else if (typeof params === "object") {
+          params = jQuery.param(params, jQuery.ajaxSettings.traditional);
+          type = "POST";
+        }
+      }
+
+      var self = this;
+
+      // Request the remote document
+      jQuery.ajax({
+        url: url,
+        type: type,
+        dataType: "html",
+        data: params,
+        complete: function (res, status) {
+          // If successful, inject the HTML into all the matched elements
+          if (status === "success" || status === "notmodified") {
+            // 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(res.responseText.replace(rscript, ""))
+
+                // Locate the specified elements
+                .find(selector) : // If not, just inject the full result
+                res.responseText);
+          }
+
+          if (callback) {
+            self.each(callback, [res.responseText, status, res]);
+          }
+        }
+      });
+
+      return this;
+    },
+
+    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};
+            }) : {name: elem.name, value: val};
+      }).get();
+    }
+  });
 
 // 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.bind(o, f);
-	};
-});
-
-jQuery.extend({
-
-	get: function( url, data, callback, type ) {
-		// shift arguments if data argument was omited
-		if ( jQuery.isFunction( data ) ) {
-			type = type || callback;
-			callback = data;
-			data = null;
-		}
-
-		return jQuery.ajax({
-			type: "GET",
-			url: url,
-			data: data,
-			success: callback,
-			dataType: type
-		});
-	},
-
-	getScript: function( url, callback ) {
-		return jQuery.get(url, null, callback, "script");
-	},
-
-	getJSON: function( url, data, callback ) {
-		return jQuery.get(url, data, callback, "json");
-	},
-
-	post: function( url, data, callback, type ) {
-		// shift arguments if data argument was omited
-		if ( jQuery.isFunction( data ) ) {
-			type = type || callback;
-			callback = data;
-			data = {};
-		}
-
-		return jQuery.ajax({
-			type: "POST",
-			url: url,
-			data: data,
-			success: callback,
-			dataType: type
-		});
-	},
-
-	ajaxSetup: function( settings ) {
-		jQuery.extend( jQuery.ajaxSettings, settings );
-	},
-
-	ajaxSettings: {
-		url: location.href,
-		global: true,
-		type: "GET",
-		contentType: "application/x-www-form-urlencoded",
-		processData: true,
-		async: true,
-		/*
+  jQuery.each(
+      "ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(
+          " "), function (i, o) {
+        jQuery.fn[o] = function (f) {
+          return this.bind(o, f);
+        };
+      });
+
+  jQuery.extend({
+
+    get: function (url, data, callback, type) {
+      // shift arguments if data argument was omited
+      if (jQuery.isFunction(data)) {
+        type = type || callback;
+        callback = data;
+        data = null;
+      }
+
+      return jQuery.ajax({
+        type: "GET",
+        url: url,
+        data: data,
+        success: callback,
+        dataType: type
+      });
+    },
+
+    getScript: function (url, callback) {
+      return jQuery.get(url, null, callback, "script");
+    },
+
+    getJSON: function (url, data, callback) {
+      return jQuery.get(url, data, callback, "json");
+    },
+
+    post: function (url, data, callback, type) {
+      // shift arguments if data argument was omited
+      if (jQuery.isFunction(data)) {
+        type = type || callback;
+        callback = data;
+        data = {};
+      }
+
+      return jQuery.ajax({
+        type: "POST",
+        url: url,
+        data: data,
+        success: callback,
+        dataType: type
+      });
+    },
+
+    ajaxSetup: function (settings) {
+      jQuery.extend(jQuery.ajaxSettings, settings);
+    },
+
+    ajaxSettings: {
+      url: location.href,
+      global: true,
+      type: "GET",
+      contentType: "application/x-www-form-urlencoded",
+      processData: true,
+      async: true,
+      /*
 		timeout: 0,
 		data: null,
 		username: null,
 		password: null,
 		traditional: false,
 		*/
-		// Create the request object; Microsoft failed to properly
-		// implement the XMLHttpRequest in IE7 (can't request local files),
-		// so we use the ActiveXObject when it is available
-		// This function can be overriden by calling jQuery.ajaxSetup
-		xhr: window.XMLHttpRequest && (window.location.protocol !== "file:" || !window.ActiveXObject) ?
-			function() {
-				return new window.XMLHttpRequest();
-			} :
-			function() {
-				try {
-					return new window.ActiveXObject("Microsoft.XMLHTTP");
-				} catch(e) {}
-			},
-		accepts: {
-			xml: "application/xml, text/xml",
-			html: "text/html",
-			script: "text/javascript, application/javascript",
-			json: "application/json, text/javascript",
-			text: "text/plain",
-			_default: "*/*"
-		}
-	},
-
-	// Last-Modified header cache for next request
-	lastModified: {},
-	etag: {},
-
-	ajax: function( origSettings ) {
-		var s = jQuery.extend(true, {}, jQuery.ajaxSettings, origSettings);
-		
-		var jsonp, status, data,
-			callbackContext = origSettings && origSettings.context || s,
-			type = s.type.toUpperCase();
-
-		// convert data if not already a string
-		if ( s.data && s.processData && typeof s.data !== "string" ) {
-			s.data = jQuery.param( s.data, s.traditional );
-		}
-
-		// Handle JSONP Parameter Callbacks
-		if ( s.dataType === "jsonp" ) {
-			if ( type === "GET" ) {
-				if ( !jsre.test( s.url ) ) {
-					s.url += (rquery.test( s.url ) ? "&" : "?") + (s.jsonp || "callback") + "=?";
-				}
-			} else if ( !s.data || !jsre.test(s.data) ) {
-				s.data = (s.data ? s.data + "&" : "") + (s.jsonp || "callback") + "=?";
-			}
-			s.dataType = "json";
-		}
-
-		// Build temporary JSONP function
-		if ( s.dataType === "json" && (s.data && jsre.test(s.data) || jsre.test(s.url)) ) {
-			jsonp = s.jsonpCallback || ("jsonp" + jsc++);
-
-			// Replace the =? sequence both in the query string and the data
-			if ( s.data ) {
-				s.data = (s.data + "").replace(jsre, "=" + jsonp + "$1");
-			}
-
-			s.url = s.url.replace(jsre, "=" + jsonp + "$1");
-
-			// We need to make sure
-			// that a JSONP style response is executed properly
-			s.dataType = "script";
-
-			// Handle JSONP-style loading
-			window[ jsonp ] = window[ jsonp ] || function( tmp ) {
-				data = tmp;
-				success();
-				complete();
-				// Garbage collect
-				window[ jsonp ] = undefined;
-
-				try {
-					delete window[ jsonp ];
-				} catch(e) {}
-
-				if ( head ) {
-					head.removeChild( script );
-				}
-			};
-		}
-
-		if ( s.dataType === "script" && s.cache === null ) {
-			s.cache = false;
-		}
-
-		if ( s.cache === false && type === "GET" ) {
-			var ts = now();
-
-			// try replacing _= if it is there
-			var ret = s.url.replace(rts, "$1_=" + ts + "$2");
-
-			// if nothing was replaced, add timestamp to the end
-			s.url = ret + ((ret === s.url) ? (rquery.test(s.url) ? "&" : "?") + "_=" + ts : "");
-		}
-
-		// If data is available, append data to url for get requests
-		if ( s.data && type === "GET" ) {
-			s.url += (rquery.test(s.url) ? "&" : "?") + s.data;
-		}
-
-		// Watch for a new set of requests
-		if ( s.global && ! jQuery.active++ ) {
-			jQuery.event.trigger( "ajaxStart" );
-		}
-
-		// Matches an absolute URL, and saves the domain
-		var parts = rurl.exec( s.url ),
-			remote = parts && (parts[1] && parts[1] !== location.protocol || parts[2] !== location.host);
-
-		// If we're requesting a remote document
-		// and trying to load JSON or Script with a GET
-		if ( s.dataType === "script" && type === "GET" && remote ) {
-			var head = document.getElementsByTagName("head")[0] || document.documentElement;
-			var script = document.createElement("script");
-			script.src = s.url;
-			if ( s.scriptCharset ) {
-				script.charset = s.scriptCharset;
-			}
-
-			// Handle Script loading
-			if ( !jsonp ) {
-				var done = false;
-
-				// Attach handlers for all browsers
-				script.onload = script.onreadystatechange = function() {
-					if ( !done && (!this.readyState ||
-							this.readyState === "loaded" || this.readyState === "complete") ) {
-						done = true;
-						success();
-						complete();
-
-						// Handle memory leak in IE
-						script.onload = script.onreadystatechange = null;
-						if ( head && script.parentNode ) {
-							head.removeChild( script );
-						}
-					}
-				};
-			}
-
-			// 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 );
-
-			// We handle everything using the script element injection
-			return undefined;
-		}
-
-		var requestDone = false;
-
-		// Create the request object
-		var xhr = s.xhr();
-
-		if ( !xhr ) {
-			return;
-		}
-
-		// Open the socket
-		// Passing null username, generates a login popup on Opera (#2865)
-		if ( s.username ) {
-			xhr.open(type, s.url, s.async, s.username, s.password);
-		} else {
-			xhr.open(type, s.url, s.async);
-		}
-
-		// Need an extra try/catch for cross domain requests in Firefox 3
-		try {
-			// Set the correct header, if data is being sent
-			if ( s.data || origSettings && origSettings.contentType ) {
-				xhr.setRequestHeader("Content-Type", s.contentType);
-			}
-
-			// Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode.
-			if ( s.ifModified ) {
-				if ( jQuery.lastModified[s.url] ) {
-					xhr.setRequestHeader("If-Modified-Since", jQuery.lastModified[s.url]);
-				}
-
-				if ( jQuery.etag[s.url] ) {
-					xhr.setRequestHeader("If-None-Match", jQuery.etag[s.url]);
-				}
-			}
-
-			// Set header so the called script knows that it's an XMLHttpRequest
-			// Only send the header if it's not a remote XHR
-			if ( !remote ) {
-				xhr.setRequestHeader("X-Requested-With", "XMLHttpRequest");
-			}
-
-			// Set the Accepts header for the server, depending on the dataType
-			xhr.setRequestHeader("Accept", s.dataType && s.accepts[ s.dataType ] ?
-				s.accepts[ s.dataType ] + ", */*" :
-				s.accepts._default );
-		} catch(e) {}
-
-		// Allow custom headers/mimetypes and early abort
-		if ( s.beforeSend && s.beforeSend.call(callbackContext, xhr, s) === false ) {
-			// Handle the global AJAX counter
-			if ( s.global && ! --jQuery.active ) {
-				jQuery.event.trigger( "ajaxStop" );
-			}
-
-			// close opended socket
-			xhr.abort();
-			return false;
-		}
-
-		if ( s.global ) {
-			trigger("ajaxSend", [xhr, s]);
-		}
-
-		// Wait for a response to come back
-		var onreadystatechange = xhr.onreadystatechange = function( isTimeout ) {
-			// The request was aborted
-			if ( !xhr || xhr.readyState === 0 || isTimeout === "abort" ) {
-				// Opera doesn't call onreadystatechange before this point
-				// so we simulate the call
-				if ( !requestDone ) {
-					complete();
-				}
-
-				requestDone = true;
-				if ( xhr ) {
-					xhr.onreadystatechange = jQuery.noop;
-				}
-
-			// The transfer is complete and the data is available, or the request timed out
-			} else if ( !requestDone && xhr && (xhr.readyState === 4 || isTimeout === "timeout") ) {
-				requestDone = true;
-				xhr.onreadystatechange = jQuery.noop;
-
-				status = isTimeout === "timeout" ?
-					"timeout" :
-					!jQuery.httpSuccess( xhr ) ?
-						"error" :
-						s.ifModified && jQuery.httpNotModified( xhr, s.url ) ?
-							"notmodified" :
-							"success";
-
-				var errMsg;
-
-				if ( status === "success" ) {
-					// Watch for, and catch, XML document parse errors
-					try {
-						// process the data (runs the xml through httpData regardless of callback)
-						data = jQuery.httpData( xhr, s.dataType, s );
-					} catch(err) {
-						status = "parsererror";
-						errMsg = err;
-					}
-				}
-
-				// Make sure that the request was successful or notmodified
-				if ( status === "success" || status === "notmodified" ) {
-					// JSONP handles its own success callback
-					if ( !jsonp ) {
-						success();
-					}
-				} else {
-					jQuery.handleError(s, xhr, status, errMsg);
-				}
-
-				// Fire the complete handlers
-				complete();
-
-				if ( isTimeout === "timeout" ) {
-					xhr.abort();
-				}
-
-				// Stop memory leaks
-				if ( s.async ) {
-					xhr = null;
-				}
-			}
-		};
-
-		// Override the abort handler, if we can (IE doesn't allow it, but that's OK)
-		// Opera doesn't fire onreadystatechange at all on abort
-		try {
-			var oldAbort = xhr.abort;
-			xhr.abort = function() {
-				if ( xhr ) {
-					oldAbort.call( xhr );
-				}
-
-				onreadystatechange( "abort" );
-			};
-		} catch(e) { }
-
-		// Timeout checker
-		if ( s.async && s.timeout > 0 ) {
-			setTimeout(function() {
-				// Check to see if the request is still happening
-				if ( xhr && !requestDone ) {
-					onreadystatechange( "timeout" );
-				}
-			}, s.timeout);
-		}
-
-		// Send the data
-		try {
-			xhr.send( type === "POST" || type === "PUT" || type === "DELETE" ? s.data : null );
-		} catch(e) {
-			jQuery.handleError(s, xhr, null, e);
-			// Fire the complete handlers
-			complete();
-		}
-
-		// firefox 1.5 doesn't fire statechange for sync requests
-		if ( !s.async ) {
-			onreadystatechange();
-		}
-
-		function success() {
-			// If a local callback was specified, fire it and pass it the data
-			if ( s.success ) {
-				s.success.call( callbackContext, data, status, xhr );
-			}
-
-			// Fire the global callback
-			if ( s.global ) {
-				trigger( "ajaxSuccess", [xhr, s] );
-			}
-		}
-
-		function complete() {
-			// Process result
-			if ( s.complete ) {
-				s.complete.call( callbackContext, xhr, status);
-			}
-
-			// The request was completed
-			if ( s.global ) {
-				trigger( "ajaxComplete", [xhr, s] );
-			}
-
-			// Handle the global AJAX counter
-			if ( s.global && ! --jQuery.active ) {
-				jQuery.event.trigger( "ajaxStop" );
-			}
-		}
-		
-		function trigger(type, args) {
-			(s.context ? jQuery(s.context) : jQuery.event).trigger(type, args);
-		}
-
-		// return XMLHttpRequest to allow aborting the request etc.
-		return xhr;
-	},
-
-	handleError: function( s, xhr, status, e ) {
-		// If a local callback was specified, fire it
-		if ( s.error ) {
-			s.error.call( s.context || s, xhr, status, e );
-		}
-
-		// Fire the global callback
-		if ( s.global ) {
-			(s.context ? jQuery(s.context) : jQuery.event).trigger( "ajaxError", [xhr, s, e] );
-		}
-	},
-
-	// Counter for holding the number of active queries
-	active: 0,
-
-	// Determines if an XMLHttpRequest was successful or not
-	httpSuccess: function( xhr ) {
-		try {
-			// IE error sometimes returns 1223 when it should be 204 so treat it as success, see #1450
-			return !xhr.status && location.protocol === "file:" ||
-				// Opera returns 0 when status is 304
-				( xhr.status >= 200 && xhr.status < 300 ) ||
-				xhr.status === 304 || xhr.status === 1223 || xhr.status === 0;
-		} catch(e) {}
-
-		return false;
-	},
-
-	// Determines if an XMLHttpRequest returns NotModified
-	httpNotModified: function( xhr, url ) {
-		var lastModified = xhr.getResponseHeader("Last-Modified"),
-			etag = xhr.getResponseHeader("Etag");
-
-		if ( lastModified ) {
-			jQuery.lastModified[url] = lastModified;
-		}
-
-		if ( etag ) {
-			jQuery.etag[url] = etag;
-		}
-
-		// Opera returns 0 when status is 304
-		return xhr.status === 304 || xhr.status === 0;
-	},
-
-	httpData: function( xhr, type, s ) {
-		var ct = xhr.getResponseHeader("content-type") || "",
-			xml = type === "xml" || !type && ct.indexOf("xml") >= 0,
-			data = xml ? xhr.responseXML : xhr.responseText;
-
-		if ( xml && data.documentElement.nodeName === "parsererror" ) {
-			jQuery.error( "parsererror" );
-		}
-
-		// Allow a pre-filtering function to sanitize the response
-		// s is checked to keep backwards compatibility
-		if ( s && s.dataFilter ) {
-			data = s.dataFilter( data, type );
-		}
-
-		// The filter can actually parse the response
-		if ( typeof data === "string" ) {
-			// Get the JavaScript object, if JSON is used.
-			if ( type === "json" || !type && ct.indexOf("json") >= 0 ) {
-				data = jQuery.parseJSON( data );
-
-			// If the type is "script", eval it in global context
-			} else if ( type === "script" || !type && ct.indexOf("javascript") >= 0 ) {
-				jQuery.globalEval( data );
-			}
-		}
-
-		return data;
-	},
-
-	// Serialize an array of form elements or a set of
-	// key/values into a query string
-	param: function( a, traditional ) {
-		var s = [];
-		
-		// Set traditional to true for jQuery <= 1.3.2 behavior.
-		if ( traditional === undefined ) {
-			traditional = jQuery.ajaxSettings.traditional;
-		}
-		
-		// If an array was passed in, assume that it is an array of form elements.
-		if ( jQuery.isArray(a) || a.jquery ) {
-			// 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 ( var prefix in a ) {
-				buildParams( prefix, a[prefix] );
-			}
-		}
-
-		// Return the resulting serialization
-		return s.join("&").replace(r20, "+");
-
-		function buildParams( prefix, obj ) {
-			if ( jQuery.isArray(obj) ) {
-				// Serialize array item.
-				jQuery.each( obj, function( i, v ) {
-					if ( traditional || /\[\]$/.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" || jQuery.isArray(v) ? i : "" ) + "]", v );
-					}
-				});
-					
-			} else if ( !traditional && obj != null && typeof obj === "object" ) {
-				// Serialize object item.
-				jQuery.each( obj, function( k, v ) {
-					buildParams( prefix + "[" + k + "]", v );
-				});
-					
-			} else {
-				// Serialize scalar item.
-				add( prefix, obj );
-			}
-		}
-
-		function add( key, value ) {
-			// If value is a function, invoke it and return its value
-			value = jQuery.isFunction(value) ? value() : value;
-			s[ s.length ] = encodeURIComponent(key) + "=" + encodeURIComponent(value);
-		}
-	}
-});
-var elemdisplay = {},
-	rfxtypes = /toggle|show|hide/,
-	rfxnum = /^([+-]=)?([\d+-.]+)(.*)$/,
-	timerId,
-	fxAttrs = [
-		// height animations
-		[ "height", "marginTop", "marginBottom", "paddingTop", "paddingBottom" ],
-		// width animations
-		[ "width", "marginLeft", "marginRight", "paddingLeft", "paddingRight" ],
-		// opacity animations
-		[ "opacity" ]
-	];
-
-jQuery.fn.extend({
-	show: function( speed, callback ) {
-		if ( speed || speed === 0) {
-			return this.animate( genFx("show", 3), speed, callback);
-
-		} else {
-			for ( var i = 0, l = this.length; i < l; i++ ) {
-				var old = jQuery.data(this[i], "olddisplay");
-
-				this[i].style.display = old || "";
-
-				if ( jQuery.css(this[i], "display") === "none" ) {
-					var nodeName = this[i].nodeName, display;
-
-					if ( elemdisplay[ nodeName ] ) {
-						display = elemdisplay[ nodeName ];
-
-					} else {
-						var elem = jQuery("<" + nodeName + " />").appendTo("body");
-
-						display = elem.css("display");
-
-						if ( display === "none" ) {
-							display = "block";
-						}
-
-						elem.remove();
-
-						elemdisplay[ nodeName ] = display;
-					}
-
-					jQuery.data(this[i], "olddisplay", display);
-				}
-			}
-
-			// Set the display of the elements in a second loop
-			// to avoid the constant reflow
-			for ( var j = 0, k = this.length; j < k; j++ ) {
-				this[j].style.display = jQuery.data(this[j], "olddisplay") || "";
-			}
-
-			return this;
-		}
-	},
-
-	hide: function( speed, callback ) {
-		if ( speed || speed === 0 ) {
-			return this.animate( genFx("hide", 3), speed, callback);
-
-		} else {
-			for ( var i = 0, l = this.length; i < l; i++ ) {
-				var old = jQuery.data(this[i], "olddisplay");
-				if ( !old && old !== "none" ) {
-					jQuery.data(this[i], "olddisplay", jQuery.css(this[i], "display"));
-				}
-			}
-
-			// Set the display of the elements in a second loop
-			// to avoid the constant reflow
-			for ( var j = 0, k = this.length; j < k; j++ ) {
-				this[j].style.display = "none";
-			}
-
-			return this;
-		}
-	},
-
-	// Save the old toggle function
-	_toggle: jQuery.fn.toggle,
-
-	toggle: function( fn, fn2 ) {
-		var bool = typeof fn === "boolean";
-
-		if ( jQuery.isFunction(fn) && jQuery.isFunction(fn2) ) {
-			this._toggle.apply( this, arguments );
-
-		} else if ( fn == null || bool ) {
-			this.each(function() {
-				var state = bool ? fn : jQuery(this).is(":hidden");
-				jQuery(this)[ state ? "show" : "hide" ]();
-			});
-
-		} else {
-			this.animate(genFx("toggle", 3), fn, fn2);
-		}
-
-		return this;
-	},
-
-	fadeTo: function( speed, to, callback ) {
-		return this.filter(":hidden").css("opacity", 0).show().end()
-					.animate({opacity: to}, speed, callback);
-	},
-
-	animate: function( prop, speed, easing, callback ) {
-		var optall = jQuery.speed(speed, easing, callback);
-
-		if ( jQuery.isEmptyObject( prop ) ) {
-			return this.each( optall.complete );
-		}
-
-		return this[ optall.queue === false ? "each" : "queue" ](function() {
-			var opt = jQuery.extend({}, optall), p,
-				hidden = this.nodeType === 1 && jQuery(this).is(":hidden"),
-				self = this;
-
-			for ( p in prop ) {
-				var name = p.replace(rdashAlpha, fcamelCase);
-
-				if ( p !== name ) {
-					prop[ name ] = prop[ p ];
-					delete prop[ p ];
-					p = name;
-				}
-
-				if ( prop[p] === "hide" && hidden || prop[p] === "show" && !hidden ) {
-					return opt.complete.call(this);
-				}
-
-				if ( ( p === "height" || p === "width" ) && this.style ) {
-					// Store display property
-					opt.display = jQuery.css(this, "display");
-
-					// Make sure that nothing sneaks out
-					opt.overflow = this.style.overflow;
-				}
-
-				if ( jQuery.isArray( prop[p] ) ) {
-					// Create (if needed) and add to specialEasing
-					(opt.specialEasing = opt.specialEasing || {})[p] = prop[p][1];
-					prop[p] = prop[p][0];
-				}
-			}
-
-			if ( opt.overflow != null ) {
-				this.style.overflow = "hidden";
-			}
-
-			opt.curAnim = jQuery.extend({}, prop);
-
-			jQuery.each( prop, function( name, val ) {
-				var e = new jQuery.fx( self, opt, name );
-
-				if ( rfxtypes.test(val) ) {
-					e[ val === "toggle" ? hidden ? "show" : "hide" : val ]( prop );
-
-				} else {
-					var parts = rfxnum.exec(val),
-						start = e.cur(true) || 0;
-
-					if ( parts ) {
-						var end = parseFloat( parts[2] ),
-							unit = parts[3] || "px";
-
-						// We need to compute starting value
-						if ( unit !== "px" ) {
-							self.style[ name ] = (end || 1) + unit;
-							start = ((end || 1) / e.cur(true)) * start;
-							self.style[ name ] = start + unit;
-						}
-
-						// If a +=/-= token was provided, we're doing a relative animation
-						if ( parts[1] ) {
-							end = ((parts[1] === "-=" ? -1 : 1) * end) + start;
-						}
-
-						e.custom( start, end, unit );
-
-					} else {
-						e.custom( start, val, "" );
-					}
-				}
-			});
-
-			// For JS strict compliance
-			return true;
-		});
-	},
-
-	stop: function( clearQueue, gotoEnd ) {
-		var timers = jQuery.timers;
-
-		if ( clearQueue ) {
-			this.queue([]);
-		}
-
-		this.each(function() {
-			// go in reverse order so anything added to the queue during the loop is ignored
-			for ( var i = timers.length - 1; i >= 0; i-- ) {
-				if ( timers[i].elem === this ) {
-					if (gotoEnd) {
-						// force the next step to be the last
-						timers[i](true);
-					}
-
-					timers.splice(i, 1);
-				}
-			}
-		});
-
-		// start the next in the queue if the last step wasn't forced
-		if ( !gotoEnd ) {
-			this.dequeue();
-		}
-
-		return this;
-	}
-
-});
+      // Create the request object; Microsoft failed to properly
+      // implement the XMLHttpRequest in IE7 (can't request local files),
+      // so we use the ActiveXObject when it is available
+      // This function can be overriden by calling jQuery.ajaxSetup
+      xhr: window.XMLHttpRequest && (window.location.protocol !== "file:"
+          || !window.ActiveXObject) ? function () {
+        return new window.XMLHttpRequest();
+      } : function () {
+        try {
+          return new window.ActiveXObject("Microsoft.XMLHTTP");
+        } catch (e) {
+        }
+      },
+      accepts: {
+        xml: "application/xml, text/xml",
+        html: "text/html",
+        script: "text/javascript, application/javascript",
+        json: "application/json, text/javascript",
+        text: "text/plain",
+        _default: "*/*"
+      }
+    },
+
+    // Last-Modified header cache for next request
+    lastModified: {},
+    etag: {},
+
+    ajax: function (origSettings) {
+      var s = jQuery.extend(true, {}, jQuery.ajaxSettings, origSettings);
+
+      var jsonp, status, data,
+          callbackContext = origSettings && origSettings.context || s,
+          type = s.type.toUpperCase();
+
+      // convert data if not already a string
+      if (s.data && s.processData && typeof s.data !== "string") {
+        s.data = jQuery.param(s.data, s.traditional);
+      }
+
+      // Handle JSONP Parameter Callbacks
+      if (s.dataType === "jsonp") {
+        if (type === "GET") {
+          if (!jsre.test(s.url)) {
+            s.url += (rquery.test(s.url) ? "&" : "?") + (s.jsonp || "callback")
+                + "=?";
+          }
+        } else if (!s.data || !jsre.test(s.data)) {
+          s.data = (s.data ? s.data + "&" : "") + (s.jsonp || "callback")
+              + "=?";
+        }
+        s.dataType = "json";
+      }
+
+      // Build temporary JSONP function
+      if (s.dataType === "json" && (s.data && jsre.test(s.data) || jsre.test(
+              s.url))) {
+        jsonp = s.jsonpCallback || ("jsonp" + jsc++);
+
+        // Replace the =? sequence both in the query string and the data
+        if (s.data) {
+          s.data = (s.data + "").replace(jsre, "=" + jsonp + "$1");
+        }
+
+        s.url = s.url.replace(jsre, "=" + jsonp + "$1");
+
+        // We need to make sure
+        // that a JSONP style response is executed properly
+        s.dataType = "script";
+
+        // Handle JSONP-style loading
+        window[jsonp] = window[jsonp] || function (tmp) {
+          data = tmp;
+          success();
+          complete();
+          // Garbage collect
+          window[jsonp] = undefined;
+
+          try {
+            delete window[jsonp];
+          } catch (e) {
+          }
+
+          if (head) {
+            head.removeChild(script);
+          }
+        };
+      }
+
+      if (s.dataType === "script" && s.cache === null) {
+        s.cache = false;
+      }
+
+      if (s.cache === false && type === "GET") {
+        var ts = now();
+
+        // try replacing _= if it is there
+        var ret = s.url.replace(rts, "$1_=" + ts + "$2");
+
+        // if nothing was replaced, add timestamp to the end
+        s.url = ret + ((ret === s.url) ? (rquery.test(s.url) ? "&" : "?") + "_="
+            + ts : "");
+      }
+
+      // If data is available, append data to url for get requests
+      if (s.data && type === "GET") {
+        s.url += (rquery.test(s.url) ? "&" : "?") + s.data;
+      }
+
+      // Watch for a new set of requests
+      if (s.global && !jQuery.active++) {
+        jQuery.event.trigger("ajaxStart");
+      }
+
+      // Matches an absolute URL, and saves the domain
+      var parts = rurl.exec(s.url),
+          remote = parts && (parts[1] && parts[1] !== location.protocol
+              || parts[2] !== location.host);
+
+      // If we're requesting a remote document
+      // and trying to load JSON or Script with a GET
+      if (s.dataType === "script" && type === "GET" && remote) {
+        var head = document.getElementsByTagName("head")[0]
+            || document.documentElement;
+        var script = document.createElement("script");
+        script.src = s.url;
+        if (s.scriptCharset) {
+          script.charset = s.scriptCharset;
+        }
+
+        // Handle Script loading
+        if (!jsonp) {
+          var done = false;
+
+          // Attach handlers for all browsers
+          script.onload = script.onreadystatechange = function () {
+            if (!done && (!this.readyState ||
+                    this.readyState === "loaded" || this.readyState
+                    === "complete")) {
+              done = true;
+              success();
+              complete();
+
+              // Handle memory leak in IE
+              script.onload = script.onreadystatechange = null;
+              if (head && script.parentNode) {
+                head.removeChild(script);
+              }
+            }
+          };
+        }
+
+        // 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);
+
+        // We handle everything using the script element injection
+        return undefined;
+      }
+
+      var requestDone = false;
+
+      // Create the request object
+      var xhr = s.xhr();
+
+      if (!xhr) {
+        return;
+      }
+
+      // Open the socket
+      // Passing null username, generates a login popup on Opera (#2865)
+      if (s.username) {
+        xhr.open(type, s.url, s.async, s.username, s.password);
+      } else {
+        xhr.open(type, s.url, s.async);
+      }
+
+      // Need an extra try/catch for cross domain requests in Firefox 3
+      try {
+        // Set the correct header, if data is being sent
+        if (s.data || origSettings && origSettings.contentType) {
+          xhr.setRequestHeader("Content-Type", s.contentType);
+        }
+
+        // Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode.
+        if (s.ifModified) {
+          if (jQuery.lastModified[s.url]) {
+            xhr.setRequestHeader("If-Modified-Since",
+                jQuery.lastModified[s.url]);
+          }
+
+          if (jQuery.etag[s.url]) {
+            xhr.setRequestHeader("If-None-Match", jQuery.etag[s.url]);
+          }
+        }
+
+        // Set header so the called script knows that it's an XMLHttpRequest
+        // Only send the header if it's not a remote XHR
+        if (!remote) {
+          xhr.setRequestHeader("X-Requested-With", "XMLHttpRequest");
+        }
+
+        // Set the Accepts header for the server, depending on the dataType
+        xhr.setRequestHeader("Accept",
+            s.dataType && s.accepts[s.dataType] ? s.accepts[s.dataType]
+                + ", */*" : s.accepts._default);
+      } catch (e) {
+      }
+
+      // Allow custom headers/mimetypes and early abort
+      if (s.beforeSend && s.beforeSend.call(callbackContext, xhr, s)
+          === false) {
+        // Handle the global AJAX counter
+        if (s.global && !--jQuery.active) {
+          jQuery.event.trigger("ajaxStop");
+        }
+
+        // close opended socket
+        xhr.abort();
+        return false;
+      }
+
+      if (s.global) {
+        trigger("ajaxSend", [xhr, s]);
+      }
+
+      // Wait for a response to come back
+      var onreadystatechange = xhr.onreadystatechange = function (isTimeout) {
+        // The request was aborted
+        if (!xhr || xhr.readyState === 0 || isTimeout === "abort") {
+          // Opera doesn't call onreadystatechange before this point
+          // so we simulate the call
+          if (!requestDone) {
+            complete();
+          }
+
+          requestDone = true;
+          if (xhr) {
+            xhr.onreadystatechange = jQuery.noop;
+          }
+
+          // The transfer is complete and the data is available, or the request timed out
+        } else if (!requestDone && xhr && (xhr.readyState === 4 || isTimeout
+                === "timeout")) {
+          requestDone = true;
+          xhr.onreadystatechange = jQuery.noop;
+
+          status = isTimeout === "timeout" ? "timeout" : !jQuery.httpSuccess(
+              xhr) ? "error" : s.ifModified && jQuery.httpNotModified(xhr,
+              s.url) ? "notmodified" : "success";
+
+          var errMsg;
+
+          if (status === "success") {
+            // Watch for, and catch, XML document parse errors
+            try {
+              // process the data (runs the xml through httpData regardless of callback)
+              data = jQuery.httpData(xhr, s.dataType, s);
+            } catch (err) {
+              status = "parsererror";
+              errMsg = err;
+            }
+          }
+
+          // Make sure that the request was successful or notmodified
+          if (status === "success" || status === "notmodified") {
+            // JSONP handles its own success callback
+            if (!jsonp) {
+              success();
+            }
+          } else {
+            jQuery.handleError(s, xhr, status, errMsg);
+          }
+
+          // Fire the complete handlers
+          complete();
+
+          if (isTimeout === "timeout") {
+            xhr.abort();
+          }
+
+          // Stop memory leaks
+          if (s.async) {
+            xhr = null;
+          }
+        }
+      };
+
+      // Override the abort handler, if we can (IE doesn't allow it, but that's OK)
+      // Opera doesn't fire onreadystatechange at all on abort
+      try {
+        var oldAbort = xhr.abort;
+        xhr.abort = function () {
+          if (xhr) {
+            oldAbort.call(xhr);
+          }
+
+          onreadystatechange("abort");
+        };
+      } catch (e) {
+      }
+
+      // Timeout checker
+      if (s.async && s.timeout > 0) {
+        setTimeout(function () {
+          // Check to see if the request is still happening
+          if (xhr && !requestDone) {
+            onreadystatechange("timeout");
+          }
+        }, s.timeout);
+      }
+
+      // Send the data
+      try {
+        xhr.send(type === "POST" || type === "PUT" || type === "DELETE" ? s.data
+            : null);
+      } catch (e) {
+        jQuery.handleError(s, xhr, null, e);
+        // Fire the complete handlers
+        complete();
+      }
+
+      // firefox 1.5 doesn't fire statechange for sync requests
+      if (!s.async) {
+        onreadystatechange();
+      }
+
+      function success() {
+        // If a local callback was specified, fire it and pass it the data
+        if (s.success) {
+          s.success.call(callbackContext, data, status, xhr);
+        }
+
+        // Fire the global callback
+        if (s.global) {
+          trigger("ajaxSuccess", [xhr, s]);
+        }
+      }
+
+      function complete() {
+        // Process result
+        if (s.complete) {
+          s.complete.call(callbackContext, xhr, status);
+        }
+
+        // The request was completed
+        if (s.global) {
+          trigger("ajaxComplete", [xhr, s]);
+        }
+
+        // Handle the global AJAX counter
+        if (s.global && !--jQuery.active) {
+          jQuery.event.trigger("ajaxStop");
+        }
+      }
+
+      function trigger(type, args) {
+        (s.context ? jQuery(s.context) : jQuery.event).trigger(type, args);
+      }
+
+      // return XMLHttpRequest to allow aborting the request etc.
+      return xhr;
+    },
+
+    handleError: function (s, xhr, status, e) {
+      // If a local callback was specified, fire it
+      if (s.error) {
+        s.error.call(s.context || s, xhr, status, e);
+      }
+
+      // Fire the global callback
+      if (s.global) {
+        (s.context ? jQuery(s.context) : jQuery.event).trigger("ajaxError",
+            [xhr, s, e]);
+      }
+    },
+
+    // Counter for holding the number of active queries
+    active: 0,
+
+    // Determines if an XMLHttpRequest was successful or not
+    httpSuccess: function (xhr) {
+      try {
+        // IE error sometimes returns 1223 when it should be 204 so treat it as success, see #1450
+        return !xhr.status && location.protocol === "file:" ||
+            // Opera returns 0 when status is 304
+            ( xhr.status >= 200 && xhr.status < 300 ) ||
+            xhr.status === 304 || xhr.status === 1223 || xhr.status === 0;
+      } catch (e) {
+      }
+
+      return false;
+    },
+
+    // Determines if an XMLHttpRequest returns NotModified
+    httpNotModified: function (xhr, url) {
+      var lastModified = xhr.getResponseHeader("Last-Modified"),
+          etag = xhr.getResponseHeader("Etag");
+
+      if (lastModified) {
+        jQuery.lastModified[url] = lastModified;
+      }
+
+      if (etag) {
+        jQuery.etag[url] = etag;
+      }
+
+      // Opera returns 0 when status is 304
+      return xhr.status === 304 || xhr.status === 0;
+    },
+
+    httpData: function (xhr, type, s) {
+      var ct = xhr.getResponseHeader("content-type") || "",
+          xml = type === "xml" || !type && ct.indexOf("xml") >= 0,
+          data = xml ? xhr.responseXML : xhr.responseText;
+
+      if (xml && data.documentElement.nodeName === "parsererror") {
+        jQuery.error("parsererror");
+      }
+
+      // Allow a pre-filtering function to sanitize the response
+      // s is checked to keep backwards compatibility
+      if (s && s.dataFilter) {
+        data = s.dataFilter(data, type);
+      }
+
+      // The filter can actually parse the response
+      if (typeof data === "string") {
+        // Get the JavaScript object, if JSON is used.
+        if (type === "json" || !type && ct.indexOf("json") >= 0) {
+          data = jQuery.parseJSON(data);
+
+          // If the type is "script", eval it in global context
+        } else if (type === "script" || !type && ct.indexOf("javascript")
+            >= 0) {
+          jQuery.globalEval(data);
+        }
+      }
+
+      return data;
+    },
+
+    // Serialize an array of form elements or a set of
+    // key/values into a query string
+    param: function (a, traditional) {
+      var s = [];
+
+      // Set traditional to true for jQuery <= 1.3.2 behavior.
+      if (traditional === undefined) {
+        traditional = jQuery.ajaxSettings.traditional;
+      }
+
+      // If an array was passed in, assume that it is an array of form elements.
+      if (jQuery.isArray(a) || a.jquery) {
+        // 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 (var prefix in a) {
+          buildParams(prefix, a[prefix]);
+        }
+      }
+
+      // Return the resulting serialization
+      return s.join("&").replace(r20, "+");
+
+      function buildParams(prefix, obj) {
+        if (jQuery.isArray(obj)) {
+          // Serialize array item.
+          jQuery.each(obj, function (i, v) {
+            if (traditional || /\[\]$/.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"
+              || jQuery.isArray(v) ? i : "" ) + "]", v);
+            }
+          });
+
+        } else if (!traditional && obj != null && typeof obj === "object") {
+          // Serialize object item.
+          jQuery.each(obj, function (k, v) {
+            buildParams(prefix + "[" + k + "]", v);
+          });
+
+        } else {
+          // Serialize scalar item.
+          add(prefix, obj);
+        }
+      }
+
+      function add(key, value) {
+        // If value is a function, invoke it and return its value
+        value = jQuery.isFunction(value) ? value() : value;
+        s[s.length] = encodeURIComponent(key) + "=" + encodeURIComponent(value);
+      }
+    }
+  });
+  var elemdisplay = {},
+      rfxtypes = /toggle|show|hide/,
+      rfxnum = /^([+-]=)?([\d+-.]+)(.*)$/,
+      timerId,
+      fxAttrs = [
+        // height animations
+        ["height", "marginTop", "marginBottom", "paddingTop", "paddingBottom"],
+        // width animations
+        ["width", "marginLeft", "marginRight", "paddingLeft", "paddingRight"],
+        // opacity animations
+        ["opacity"]
+      ];
+
+  jQuery.fn.extend({
+    show: function (speed, callback) {
+      if (speed || speed === 0) {
+        return this.animate(genFx("show", 3), speed, callback);
+
+      } else {
+        for (var i = 0, l = this.length; i < l; i++) {
+          var old = jQuery.data(this[i], "olddisplay");
+
+          this[i].style.display = old || "";
+
+          if (jQuery.css(this[i], "display") === "none") {
+            var nodeName = this[i].nodeName, display;
+
+            if (elemdisplay[nodeName]) {
+              display = elemdisplay[nodeName];
+
+            } else {
+              var elem = jQuery("<" + nodeName + " />").appendTo("body");
+
+              display = elem.css("display");
+
+              if (display === "none") {
+                display = "block";
+              }
+
+              elem.remove();
+
+              elemdisplay[nodeName] = display;
+            }
+
+            jQuery.data(this[i], "olddisplay", display);
+          }
+        }
+
+        // Set the display of the elements in a second loop
+        // to avoid the constant reflow
+        for (var j = 0, k = this.length; j < k; j++) {
+          this[j].style.display = jQuery.data(this[j], "olddisplay") || "";
+        }
+
+        return this;
+      }
+    },
+
+    hide: function (speed, callback) {
+      if (speed || speed === 0) {
+        return this.animate(genFx("hide", 3), speed, callback);
+
+      } else {
+        for (var i = 0, l = this.length; i < l; i++) {
+          var old = jQuery.data(this[i], "olddisplay");
+          if (!old && old !== "none") {
+            jQuery.data(this[i], "olddisplay", jQuery.css(this[i], "display"));
+          }
+        }
+
+        // Set the display of the elements in a second loop
+        // to avoid the constant reflow
+        for (var j = 0, k = this.length; j < k; j++) {
+          this[j].style.display = "none";
+        }
+
+        return this;
+      }
+    },
+
+    // Save the old toggle function
+    _toggle: jQuery.fn.toggle,
+
+    toggle: function (fn, fn2) {
+      var bool = typeof fn === "boolean";
+
+      if (jQuery.isFunction(fn) && jQuery.isFunction(fn2)) {
+        this._toggle.apply(this, arguments);
+
+      } else if (fn == null || bool) {
+        this.each(function () {
+          var state = bool ? fn : jQuery(this).is(":hidden");
+          jQuery(this)[state ? "show" : "hide"]();
+        });
+
+      } else {
+        this.animate(genFx("toggle", 3), fn, fn2);
+      }
+
+      return this;
+    },
+
+    fadeTo: function (speed, to, callback) {
+      return this.filter(":hidden").css("opacity", 0).show().end()
+      .animate({opacity: to}, speed, callback);
+    },
+
+    animate: function (prop, speed, easing, callback) {
+      var optall = jQuery.speed(speed, easing, callback);
+
+      if (jQuery.isEmptyObject(prop)) {
+        return this.each(optall.complete);
+      }
+
+      return this[optall.queue === false ? "each" : "queue"](function () {
+        var opt = jQuery.extend({}, optall), p,
+            hidden = this.nodeType === 1 && jQuery(this).is(":hidden"),
+            self = this;
+
+        for (p in prop) {
+          var name = p.replace(rdashAlpha, fcamelCase);
+
+          if (p !== name) {
+            prop[name] = prop[p];
+            delete prop[p];
+            p = name;
+          }
+
+          if (prop[p] === "hide" && hidden || prop[p] === "show" && !hidden) {
+            return opt.complete.call(this);
+          }
+
+          if (( p === "height" || p === "width" ) && this.style) {
+            // Store display property
+            opt.display = jQuery.css(this, "display");
+
+            // Make sure that nothing sneaks out
+            opt.overflow = this.style.overflow;
+          }
+
+          if (jQuery.isArray(prop[p])) {
+            // Create (if needed) and add to specialEasing
+            (opt.specialEasing = opt.specialEasing || {})[p] = prop[p][1];
+            prop[p] = prop[p][0];
+          }
+        }
+
+        if (opt.overflow != null) {
+          this.style.overflow = "hidden";
+        }
+
+        opt.curAnim = jQuery.extend({}, prop);
+
+        jQuery.each(prop, function (name, val) {
+          var e = new jQuery.fx(self, opt, name);
+
+          if (rfxtypes.test(val)) {
+            e[val === "toggle" ? hidden ? "show" : "hide" : val](prop);
+
+          } else {
+            var parts = rfxnum.exec(val),
+                start = e.cur(true) || 0;
+
+            if (parts) {
+              var end = parseFloat(parts[2]),
+                  unit = parts[3] || "px";
+
+              // We need to compute starting value
+              if (unit !== "px") {
+                self.style[name] = (end || 1) + unit;
+                start = ((end || 1) / e.cur(true)) * start;
+                self.style[name] = start + unit;
+              }
+
+              // If a +=/-= token was provided, we're doing a relative animation
+              if (parts[1]) {
+                end = ((parts[1] === "-=" ? -1 : 1) * end) + start;
+              }
+
+              e.custom(start, end, unit);
+
+            } else {
+              e.custom(start, val, "");
+            }
+          }
+        });
+
+        // For JS strict compliance
+        return true;
+      });
+    },
+
+    stop: function (clearQueue, gotoEnd) {
+      var timers = jQuery.timers;
+
+      if (clearQueue) {
+        this.queue([]);
+      }
+
+      this.each(function () {
+        // go in reverse order so anything added to the queue during the loop is ignored
+        for (var i = timers.length - 1; i >= 0; i--) {
+          if (timers[i].elem === this) {
+            if (gotoEnd) {
+              // force the next step to be the last
+              timers[i](true);
+            }
+
+            timers.splice(i, 1);
+          }
+        }
+      });
+
+      // start the next in the queue if the last step wasn't forced
+      if (!gotoEnd) {
+        this.dequeue();
+      }
+
+      return this;
+    }
+
+  });
 
 // Generate shortcuts for custom animations
-jQuery.each({
-	slideDown: genFx("show", 1),
-	slideUp: genFx("hide", 1),
-	slideToggle: genFx("toggle", 1),
-	fadeIn: { opacity: "show" },
-	fadeOut: { opacity: "hide" }
-}, function( name, props ) {
-	jQuery.fn[ name ] = function( speed, callback ) {
-		return this.animate( props, speed, callback );
-	};
-});
-
-jQuery.extend({
-	speed: function( speed, easing, fn ) {
-		var opt = speed && typeof speed === "object" ? 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 :
-			jQuery.fx.speeds[opt.duration] || jQuery.fx.speeds._default;
-
-		// Queueing
-		opt.old = opt.complete;
-		opt.complete = function() {
-			if ( opt.queue !== false ) {
-				jQuery(this).dequeue();
-			}
-			if ( jQuery.isFunction( opt.old ) ) {
-				opt.old.call( this );
-			}
-		};
-
-		return opt;
-	},
-
-	easing: {
-		linear: function( p, n, firstNum, diff ) {
-			return firstNum + diff * p;
-		},
-		swing: function( p, n, firstNum, diff ) {
-			return ((-Math.cos(p*Math.PI)/2) + 0.5) * diff + firstNum;
-		}
-	},
-
-	timers: [],
-
-	fx: function( elem, options, prop ) {
-		this.options = options;
-		this.elem = elem;
-		this.prop = prop;
-
-		if ( !options.orig ) {
-			options.orig = {};
-		}
-	}
-
-});
-
-jQuery.fx.prototype = {
-	// Simple function for setting a style value
-	update: function() {
-		if ( this.options.step ) {
-			this.options.step.call( this.elem, this.now, this );
-		}
-
-		(jQuery.fx.step[this.prop] || jQuery.fx.step._default)( this );
-
-		// Set display property to block for height/width animations
-		if ( ( this.prop === "height" || this.prop === "width" ) && this.elem.style ) {
-			this.elem.style.display = "block";
-		}
-	},
-
-	// Get the current size
-	cur: function( force ) {
-		if ( this.elem[this.prop] != null && (!this.elem.style || this.elem.style[this.prop] == null) ) {
-			return this.elem[ this.prop ];
-		}
-
-		var r = parseFloat(jQuery.css(this.elem, this.prop, force));
-		return r && r > -10000 ? r : parseFloat(jQuery.curCSS(this.elem, this.prop)) || 0;
-	},
-
-	// Start an animation from one number to another
-	custom: function( from, to, unit ) {
-		this.startTime = now();
-		this.start = from;
-		this.end = to;
-		this.unit = unit || this.unit || "px";
-		this.now = this.start;
-		this.pos = this.state = 0;
-
-		var self = this;
-		function t( gotoEnd ) {
-			return self.step(gotoEnd);
-		}
-
-		t.elem = this.elem;
-
-		if ( t() && jQuery.timers.push(t) && !timerId ) {
-			timerId = setInterval(jQuery.fx.tick, 13);
-		}
-	},
-
-	// Simple 'show' function
-	show: function() {
-		// Remember where we started, so that we can go back to it later
-		this.options.orig[this.prop] = jQuery.style( this.elem, this.prop );
-		this.options.show = true;
-
-		// Begin the animation
-		// Make sure that we start at a small width/height to avoid any
-		// flash of content
-		this.custom(this.prop === "width" || this.prop === "height" ? 1 : 0, this.cur());
-
-		// Start by showing the element
-		jQuery( this.elem ).show();
-	},
-
-	// Simple 'hide' function
-	hide: function() {
-		// Remember where we started, so that we can go back to it later
-		this.options.orig[this.prop] = jQuery.style( this.elem, this.prop );
-		this.options.hide = true;
-
-		// Begin the animation
-		this.custom(this.cur(), 0);
-	},
-
-	// Each step of an animation
-	step: function( gotoEnd ) {
-		var t = now(), done = true;
-
-		if ( gotoEnd || t >= this.options.duration + this.startTime ) {
-			this.now = this.end;
-			this.pos = this.state = 1;
-			this.update();
-
-			this.options.curAnim[ this.prop ] = true;
-
-			for ( var i in this.options.curAnim ) {
-				if ( this.options.curAnim[i] !== true ) {
-					done = false;
-				}
-			}
-
-			if ( done ) {
-				if ( this.options.display != null ) {
-					// Reset the overflow
-					this.elem.style.overflow = this.options.overflow;
-
-					// Reset the display
-					var old = jQuery.data(this.elem, "olddisplay");
-					this.elem.style.display = old ? old : this.options.display;
-
-					if ( jQuery.css(this.elem, "display") === "none" ) {
-						this.elem.style.display = "block";
-					}
-				}
-
-				// Hide the element if the "hide" operation was done
-				if ( this.options.hide ) {
-					jQuery(this.elem).hide();
-				}
-
-				// Reset the properties, if the item has been hidden or shown
-				if ( this.options.hide || this.options.show ) {
-					for ( var p in this.options.curAnim ) {
-						jQuery.style(this.elem, p, this.options.orig[p]);
-					}
-				}
-
-				// Execute the complete function
-				this.options.complete.call( this.elem );
-			}
-
-			return false;
-
-		} else {
-			var n = t - this.startTime;
-			this.state = n / this.options.duration;
-
-			// Perform the easing function, defaults to swing
-			var specialEasing = this.options.specialEasing && this.options.specialEasing[this.prop];
-			var defaultEasing = this.options.easing || (jQuery.easing.swing ? "swing" : "linear");
-			this.pos = jQuery.easing[specialEasing || defaultEasing](this.state, n, 0, 1, this.options.duration);
-			this.now = this.start + ((this.end - this.start) * this.pos);
-
-			// Perform the next step of the animation
-			this.update();
-		}
-
-		return true;
-	}
-};
-
-jQuery.extend( jQuery.fx, {
-	tick: function() {
-		var timers = jQuery.timers;
-
-		for ( var i = 0; i < timers.length; i++ ) {
-			if ( !timers[i]() ) {
-				timers.splice(i--, 1);
-			}
-		}
-
-		if ( !timers.length ) {
-			jQuery.fx.stop();
-		}
-	},
-		
-	stop: function() {
-		clearInterval( timerId );
-		timerId = null;
-	},
-	
-	speeds: {
-		slow: 600,
- 		fast: 200,
- 		// Default speed
- 		_default: 400
-	},
-
-	step: {
-		opacity: function( fx ) {
-			jQuery.style(fx.elem, "opacity", fx.now);
-		},
-
-		_default: function( fx ) {
-			if ( fx.elem.style && fx.elem.style[ fx.prop ] != null ) {
-				fx.elem.style[ fx.prop ] = (fx.prop === "width" || fx.prop === "height" ? Math.max(0, fx.now) : fx.now) + fx.unit;
-			} else {
-				fx.elem[ fx.prop ] = fx.now;
-			}
-		}
-	}
-});
-
-if ( jQuery.expr && jQuery.expr.filters ) {
-	jQuery.expr.filters.animated = function( elem ) {
-		return jQuery.grep(jQuery.timers, function( fn ) {
-			return elem === fn.elem;
-		}).length;
-	};
-}
-
-function genFx( type, num ) {
-	var obj = {};
-
-	jQuery.each( fxAttrs.concat.apply([], fxAttrs.slice(0,num)), function() {
-		obj[ this ] = type;
-	});
-
-	return obj;
-}
-if ( "getBoundingClientRect" in document.documentElement ) {
-	jQuery.fn.offset = function( options ) {
-		var elem = this[0];
-
-		if ( options ) { 
-			return this.each(function( i ) {
-				jQuery.offset.setOffset( this, options, i );
-			});
-		}
-
-		if ( !elem || !elem.ownerDocument ) {
-			return null;
-		}
-
-		if ( elem === elem.ownerDocument.body ) {
-			return jQuery.offset.bodyOffset( elem );
-		}
-
-		var box = elem.getBoundingClientRect(), doc = elem.ownerDocument, body = doc.body, docElem = doc.documentElement,
-			clientTop = docElem.clientTop || body.clientTop || 0, clientLeft = docElem.clientLeft || body.clientLeft || 0,
-			top  = box.top  + (self.pageYOffset || jQuery.support.boxModel && docElem.scrollTop  || body.scrollTop ) - clientTop,
-			left = box.left + (self.pageXOffset || jQuery.support.boxModel && docElem.scrollLeft || body.scrollLeft) - clientLeft;
-
-		return { top: top, left: left };
-	};
-
-} else {
-	jQuery.fn.offset = function( options ) {
-		var elem = this[0];
-
-		if ( options ) { 
-			return this.each(function( i ) {
-				jQuery.offset.setOffset( this, options, i );
-			});
-		}
-
-		if ( !elem || !elem.ownerDocument ) {
-			return null;
-		}
-
-		if ( elem === elem.ownerDocument.body ) {
-			return jQuery.offset.bodyOffset( elem );
-		}
-
-		jQuery.offset.initialize();
-
-		var offsetParent = elem.offsetParent, prevOffsetParent = elem,
-			doc = elem.ownerDocument, computedStyle, docElem = doc.documentElement,
-			body = doc.body, defaultView = doc.defaultView,
-			prevComputedStyle = defaultView ? defaultView.getComputedStyle( elem, null ) : elem.currentStyle,
-			top = elem.offsetTop, left = elem.offsetLeft;
-
-		while ( (elem = elem.parentNode) && elem !== body && elem !== docElem ) {
-			if ( jQuery.offset.supportsFixedPosition && prevComputedStyle.position === "fixed" ) {
-				break;
-			}
-
-			computedStyle = defaultView ? defaultView.getComputedStyle(elem, null) : elem.currentStyle;
-			top  -= elem.scrollTop;
-			left -= elem.scrollLeft;
-
-			if ( elem === offsetParent ) {
-				top  += elem.offsetTop;
-				left += elem.offsetLeft;
-
-				if ( jQuery.offset.doesNotAddBorder && !(jQuery.offset.doesAddBorderForTableAndCells && /^t(able|d|h)$/i.test(elem.nodeName)) ) {
-					top  += parseFloat( computedStyle.borderTopWidth  ) || 0;
-					left += parseFloat( computedStyle.borderLeftWidth ) || 0;
-				}
-
-				prevOffsetParent = offsetParent, offsetParent = elem.offsetParent;
-			}
-
-			if ( jQuery.offset.subtractsBorderForOverflowNotVisible && computedStyle.overflow !== "visible" ) {
-				top  += parseFloat( computedStyle.borderTopWidth  ) || 0;
-				left += parseFloat( computedStyle.borderLeftWidth ) || 0;
-			}
-
-			prevComputedStyle = computedStyle;
-		}
-
-		if ( prevComputedStyle.position === "relative" || prevComputedStyle.position === "static" ) {
-			top  += body.offsetTop;
-			left += body.offsetLeft;
-		}
-
-		if ( jQuery.offset.supportsFixedPosition && prevComputedStyle.position === "fixed" ) {
-			top  += Math.max( docElem.scrollTop, body.scrollTop );
-			left += Math.max( docElem.scrollLeft, body.scrollLeft );
-		}
-
-		return { top: top, left: left };
-	};
-}
-
-jQuery.offset = {
-	initialize: function() {
-		var body = document.body, container = document.createElement("div"), innerDiv, checkDiv, table, td, bodyMarginTop = parseFloat( jQuery.curCSS(body, "marginTop", true) ) || 0,
-			html = "<div style='position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;'><div></div></div><table style='position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;' cellpadding='0' cellspacing='0'><tr><td></td></tr></table>";
-
-		jQuery.extend( container.style, { position: "absolute", top: 0, left: 0, margin: 0, border: 0, width: "1px", height: "1px", visibility: "hidden" } );
-
-		container.innerHTML = html;
-		body.insertBefore( container, body.firstChild );
-		innerDiv = container.firstChild;
-		checkDiv = innerDiv.firstChild;
-		td = innerDiv.nextSibling.firstChild.firstChild;
-
-		this.doesNotAddBorder = (checkDiv.offsetTop !== 5);
-		this.doesAddBorderForTableAndCells = (td.offsetTop === 5);
-
-		checkDiv.style.position = "fixed", checkDiv.style.top = "20px";
-		// safari subtracts parent border width here which is 5px
-		this.supportsFixedPosition = (checkDiv.offsetTop === 20 || checkDiv.offsetTop === 15);
-		checkDiv.style.position = checkDiv.style.top = "";
-
-		innerDiv.style.overflow = "hidden", innerDiv.style.position = "relative";
-		this.subtractsBorderForOverflowNotVisible = (checkDiv.offsetTop === -5);
-
-		this.doesNotIncludeMarginInBodyOffset = (body.offsetTop !== bodyMarginTop);
-
-		body.removeChild( container );
-		body = container = innerDiv = checkDiv = table = td = null;
-		jQuery.offset.initialize = jQuery.noop;
-	},
-
-	bodyOffset: function( body ) {
-		var top = body.offsetTop, left = body.offsetLeft;
-
-		jQuery.offset.initialize();
-
-		if ( jQuery.offset.doesNotIncludeMarginInBodyOffset ) {
-			top  += parseFloat( jQuery.curCSS(body, "marginTop",  true) ) || 0;
-			left += parseFloat( jQuery.curCSS(body, "marginLeft", true) ) || 0;
-		}
-
-		return { top: top, left: left };
-	},
-	
-	setOffset: function( elem, options, i ) {
-		// set position first, in-case top/left are set even on static elem
-		if ( /static/.test( jQuery.curCSS( elem, "position" ) ) ) {
-			elem.style.position = "relative";
-		}
-		var curElem   = jQuery( elem ),
-			curOffset = curElem.offset(),
-			curTop    = parseInt( jQuery.curCSS( elem, "top",  true ), 10 ) || 0,
-			curLeft   = parseInt( jQuery.curCSS( elem, "left", true ), 10 ) || 0;
-
-		if ( jQuery.isFunction( options ) ) {
-			options = options.call( elem, i, curOffset );
-		}
-
-		var props = {
-			top:  (options.top  - curOffset.top)  + curTop,
-			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 null;
-		}
-
-		var elem = this[0],
-
-		// Get *real* offsetParent
-		offsetParent = this.offsetParent(),
-
-		// Get correct offsets
-		offset       = this.offset(),
-		parentOffset = /^body|html$/i.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.curCSS(elem, "marginTop",  true) ) || 0;
-		offset.left -= parseFloat( jQuery.curCSS(elem, "marginLeft", true) ) || 0;
-
-		// Add offsetParent borders
-		parentOffset.top  += parseFloat( jQuery.curCSS(offsetParent[0], "borderTopWidth",  true) ) || 0;
-		parentOffset.left += parseFloat( jQuery.curCSS(offsetParent[0], "borderLeftWidth", true) ) || 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 && (!/^body|html$/i.test(offsetParent.nodeName) && jQuery.css(offsetParent, "position") === "static") ) {
-				offsetParent = offsetParent.offsetParent;
-			}
-			return offsetParent;
-		});
-	}
-});
-
+  jQuery.each({
+    slideDown: genFx("show", 1),
+    slideUp: genFx("hide", 1),
+    slideToggle: genFx("toggle", 1),
+    fadeIn: {opacity: "show"},
+    fadeOut: {opacity: "hide"}
+  }, function (name, props) {
+    jQuery.fn[name] = function (speed, callback) {
+      return this.animate(props, speed, callback);
+    };
+  });
+
+  jQuery.extend({
+    speed: function (speed, easing, fn) {
+      var opt = speed && typeof speed === "object" ? 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 : jQuery.fx.speeds[opt.duration]
+          || jQuery.fx.speeds._default;
+
+      // Queueing
+      opt.old = opt.complete;
+      opt.complete = function () {
+        if (opt.queue !== false) {
+          jQuery(this).dequeue();
+        }
+        if (jQuery.isFunction(opt.old)) {
+          opt.old.call(this);
+        }
+      };
+
+      return opt;
+    },
+
+    easing: {
+      linear: function (p, n, firstNum, diff) {
+        return firstNum + diff * p;
+      },
+      swing: function (p, n, firstNum, diff) {
+        return ((-Math.cos(p * Math.PI) / 2) + 0.5) * diff + firstNum;
+      }
+    },
+
+    timers: [],
+
+    fx: function (elem, options, prop) {
+      this.options = options;
+      this.elem = elem;
+      this.prop = prop;
+
+      if (!options.orig) {
+        options.orig = {};
+      }
+    }
+
+  });
+
+  jQuery.fx.prototype = {
+    // Simple function for setting a style value
+    update: function () {
+      if (this.options.step) {
+        this.options.step.call(this.elem, this.now, this);
+      }
+
+      (jQuery.fx.step[this.prop] || jQuery.fx.step._default)(this);
+
+      // Set display property to block for height/width animations
+      if (( this.prop === "height" || this.prop === "width" )
+          && this.elem.style) {
+        this.elem.style.display = "block";
+      }
+    },
+
+    // Get the current size
+    cur: function (force) {
+      if (this.elem[this.prop] != null && (!this.elem.style
+              || this.elem.style[this.prop] == null)) {
+        return this.elem[this.prop];
+      }
+
+      var r = parseFloat(jQuery.css(this.elem, this.prop, force));
+      return r && r > -10000 ? r : parseFloat(
+          jQuery.curCSS(this.elem, this.prop)) || 0;
+    },
+
+    // Start an animation from one number to another
+    custom: function (from, to, unit) {
+      this.startTime = now();
+      this.start = from;
+      this.end = to;
+      this.unit = unit || this.unit || "px";
+      this.now = this.start;
+      this.pos = this.state = 0;
+
+      var self = this;
+
+      function t(gotoEnd) {
+        return self.step(gotoEnd);
+      }
+
+      t.elem = this.elem;
+
+      if (t() && jQuery.timers.push(t) && !timerId) {
+        timerId = setInterval(jQuery.fx.tick, 13);
+      }
+    },
+
+    // Simple 'show' function
+    show: function () {
+      // Remember where we started, so that we can go back to it later
+      this.options.orig[this.prop] = jQuery.style(this.elem, this.prop);
+      this.options.show = true;
+
+      // Begin the animation
+      // Make sure that we start at a small width/height to avoid any
+      // flash of content
+      this.custom(this.prop === "width" || this.prop === "height" ? 1 : 0,
+          this.cur());
+
+      // Start by showing the element
+      jQuery(this.elem).show();
+    },
+
+    // Simple 'hide' function
+    hide: function () {
+      // Remember where we started, so that we can go back to it later
+      this.options.orig[this.prop] = jQuery.style(this.elem, this.prop);
+      this.options.hide = true;
+
+      // Begin the animation
+      this.custom(this.cur(), 0);
+    },
+
+    // Each step of an animation
+    step: function (gotoEnd) {
+      var t = now(), done = true;
+
+      if (gotoEnd || t >= this.options.duration + this.startTime) {
+        this.now = this.end;
+        this.pos = this.state = 1;
+        this.update();
+
+        this.options.curAnim[this.prop] = true;
+
+        for (var i in this.options.curAnim) {
+          if (this.options.curAnim[i] !== true) {
+            done = false;
+          }
+        }
+
+        if (done) {
+          if (this.options.display != null) {
+            // Reset the overflow
+            this.elem.style.overflow = this.options.overflow;
+
+            // Reset the display
+            var old = jQuery.data(this.elem, "olddisplay");
+            this.elem.style.display = old ? old : this.options.display;
+
+            if (jQuery.css(this.elem, "display") === "none") {
+              this.elem.style.display = "block";
+            }
+          }
+
+          // Hide the element if the "hide" operation was done
+          if (this.options.hide) {
+            jQuery(this.elem).hide();
+          }
+
+          // Reset the properties, if the item has been hidden or shown
+          if (this.options.hide || this.options.show) {
+            for (var p in this.options.curAnim) {
+              jQuery.style(this.elem, p, this.options.orig[p]);
+            }
+          }
+
+          // Execute the complete function
+          this.options.complete.call(this.elem);
+        }
+
+        return false;
+
+      } else {
+        var n = t - this.startTime;
+        this.state = n / this.options.duration;
+
+        // Perform the easing function, defaults to swing
+        var specialEasing = this.options.specialEasing
+            && this.options.specialEasing[this.prop];
+        var defaultEasing = this.options.easing || (jQuery.easing.swing
+            ? "swing" : "linear");
+        this.pos = jQuery.easing[specialEasing || defaultEasing](this.state, n,
+            0, 1, this.options.duration);
+        this.now = this.start + ((this.end - this.start) * this.pos);
+
+        // Perform the next step of the animation
+        this.update();
+      }
+
+      return true;
+    }
+  };
+
+  jQuery.extend(jQuery.fx, {
+    tick: function () {
+      var timers = jQuery.timers;
+
+      for (var i = 0; i < timers.length; i++) {
+        if (!timers[i]()) {
+          timers.splice(i--, 1);
+        }
+      }
+
+      if (!timers.length) {
+        jQuery.fx.stop();
+      }
+    },
+
+    stop: function () {
+      clearInterval(timerId);
+      timerId = null;
+    },
+
+    speeds: {
+      slow: 600,
+      fast: 200,
+      // Default speed
+      _default: 400
+    },
+
+    step: {
+      opacity: function (fx) {
+        jQuery.style(fx.elem, "opacity", fx.now);
+      },
+
+      _default: function (fx) {
+        if (fx.elem.style && fx.elem.style[fx.prop] != null) {
+          fx.elem.style[fx.prop] = (fx.prop === "width" || fx.prop === "height"
+              ? Math.max(0, fx.now) : fx.now) + fx.unit;
+        } else {
+          fx.elem[fx.prop] = fx.now;
+        }
+      }
+    }
+  });
+
+  if (jQuery.expr && jQuery.expr.filters) {
+    jQuery.expr.filters.animated = function (elem) {
+      return jQuery.grep(jQuery.timers, function (fn) {
+        return elem === fn.elem;
+      }).length;
+    };
+  }
+
+  function genFx(type, num) {
+    var obj = {};
+
+    jQuery.each(fxAttrs.concat.apply([], fxAttrs.slice(0, num)), function () {
+      obj[this] = type;
+    });
+
+    return obj;
+  }
+
+  if ("getBoundingClientRect" in document.documentElement) {
+    jQuery.fn.offset = function (options) {
+      var elem = this[0];
+
+      if (options) {
+        return this.each(function (i) {
+          jQuery.offset.setOffset(this, options, i);
+        });
+      }
+
+      if (!elem || !elem.ownerDocument) {
+        return null;
+      }
+
+      if (elem === elem.ownerDocument.body) {
+        return jQuery.offset.bodyOffset(elem);
+      }
+
+      var box = elem.getBoundingClientRect(), doc = elem.ownerDocument,
+          body = doc.body, docElem = doc.documentElement,
+          clientTop = docElem.clientTop || body.clientTop || 0,
+          clientLeft = docElem.clientLeft || body.clientLeft || 0,
+          top = box.top + (self.pageYOffset || jQuery.support.boxModel
+              && docElem.scrollTop || body.scrollTop ) - clientTop,
+          left = box.left + (self.pageXOffset || jQuery.support.boxModel
+              && docElem.scrollLeft || body.scrollLeft) - clientLeft;
+
+      return {top: top, left: left};
+    };
+
+  } else {
+    jQuery.fn.offset = function (options) {
+      var elem = this[0];
+
+      if (options) {
+        return this.each(function (i) {
+          jQuery.offset.setOffset(this, options, i);
+        });
+      }
+
+      if (!elem || !elem.ownerDocument) {
+        return null;
+      }
+
+      if (elem === elem.ownerDocument.body) {
+        return jQuery.offset.bodyOffset(elem);
+      }
+
+      jQuery.offset.initialize();
+
+      var offsetParent = elem.offsetParent, prevOffsetParent = elem,
+          doc = elem.ownerDocument, computedStyle,
+          docElem = doc.documentElement,
+          body = doc.body, defaultView = doc.defaultView,
+          prevComputedStyle = defaultView ? defaultView.getComputedStyle(elem,
+              null) : elem.currentStyle,
+          top = elem.offsetTop, left = elem.offsetLeft;
+
+      while ((elem = elem.parentNode) && elem !== body && elem !== docElem) {
+        if (jQuery.offset.supportsFixedPosition && prevComputedStyle.position
+            === "fixed") {
+          break;
+        }
+
+        computedStyle = defaultView ? defaultView.getComputedStyle(elem, null)
+            : elem.currentStyle;
+        top -= elem.scrollTop;
+        left -= elem.scrollLeft;
+
+        if (elem === offsetParent) {
+          top += elem.offsetTop;
+          left += elem.offsetLeft;
+
+          if (jQuery.offset.doesNotAddBorder
+              && !(jQuery.offset.doesAddBorderForTableAndCells
+                  && /^t(able|d|h)$/i.test(elem.nodeName))) {
+            top += parseFloat(computedStyle.borderTopWidth) || 0;
+            left += parseFloat(computedStyle.borderLeftWidth) || 0;
+          }
+
+          prevOffsetParent = offsetParent, offsetParent = elem.offsetParent;
+        }
+
+        if (jQuery.offset.subtractsBorderForOverflowNotVisible
+            && computedStyle.overflow !== "visible") {
+          top += parseFloat(computedStyle.borderTopWidth) || 0;
+          left += parseFloat(computedStyle.borderLeftWidth) || 0;
+        }
+
+        prevComputedStyle = computedStyle;
+      }
+
+      if (prevComputedStyle.position === "relative"
+          || prevComputedStyle.position === "static") {
+        top += body.offsetTop;
+        left += body.offsetLeft;
+      }
+
+      if (jQuery.offset.supportsFixedPosition && prevComputedStyle.position
+          === "fixed") {
+        top += Math.max(docElem.scrollTop, body.scrollTop);
+        left += Math.max(docElem.scrollLeft, body.scrollLeft);
+      }
+
+      return {top: top, left: left};
+    };
+  }
+
+  jQuery.offset = {
+    initialize: function () {
+      var body = document.body, container = document.createElement("div"),
+          innerDiv, checkDiv, table, td,
+          bodyMarginTop = parseFloat(jQuery.curCSS(body, "marginTop", true))
+              || 0,
+          html = "<div style='position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;'><div></div></div><table style='position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;' cellpadding='0' cellspacing='0'><tr><td></td></tr></table>";
+
+      jQuery.extend(container.style, {
+        position: "absolute",
+        top: 0,
+        left: 0,
+        margin: 0,
+        border: 0,
+        width: "1px",
+        height: "1px",
+        visibility: "hidden"
+      });
+
+      container.innerHTML = html;
+      body.insertBefore(container, body.firstChild);
+      innerDiv = container.firstChild;
+      checkDiv = innerDiv.firstChild;
+      td = innerDiv.nextSibling.firstChild.firstChild;
+
+      this.doesNotAddBorder = (checkDiv.offsetTop !== 5);
+      this.doesAddBorderForTableAndCells = (td.offsetTop === 5);
+
+      checkDiv.style.position = "fixed", checkDiv.style.top = "20px";
+      // safari subtracts parent border width here which is 5px
+      this.supportsFixedPosition = (checkDiv.offsetTop === 20
+          || checkDiv.offsetTop === 15);
+      checkDiv.style.position = checkDiv.style.top = "";
+
+      innerDiv.style.overflow = "hidden", innerDiv.style.position = "relative";
+      this.subtractsBorderForOverflowNotVisible = (checkDiv.offsetTop === -5);
+
+      this.doesNotIncludeMarginInBodyOffset = (body.offsetTop
+          !== bodyMarginTop);
+
+      body.removeChild(container);
+      body = container = innerDiv = checkDiv = table = td = null;
+      jQuery.offset.initialize = jQuery.noop;
+    },
+
+    bodyOffset: function (body) {
+      var top = body.offsetTop, left = body.offsetLeft;
+
+      jQuery.offset.initialize();
+
+      if (jQuery.offset.doesNotIncludeMarginInBodyOffset) {
+        top += parseFloat(jQuery.curCSS(body, "marginTop", true)) || 0;
+        left += parseFloat(jQuery.curCSS(body, "marginLeft", true)) || 0;
+      }
+
+      return {top: top, left: left};
+    },
+
+    setOffset: function (elem, options, i) {
+      // set position first, in-case top/left are set even on static elem
+      if (/static/.test(jQuery.curCSS(elem, "position"))) {
+        elem.style.position = "relative";
+      }
+      var curElem = jQuery(elem),
+          curOffset = curElem.offset(),
+          curTop = parseInt(jQuery.curCSS(elem, "top", true), 10) || 0,
+          curLeft = parseInt(jQuery.curCSS(elem, "left", true), 10) || 0;
+
+      if (jQuery.isFunction(options)) {
+        options = options.call(elem, i, curOffset);
+      }
+
+      var props = {
+        top: (options.top - curOffset.top) + curTop,
+        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 null;
+      }
+
+      var elem = this[0],
+
+          // Get *real* offsetParent
+          offsetParent = this.offsetParent(),
+
+          // Get correct offsets
+          offset = this.offset(),
+          parentOffset = /^body|html$/i.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.curCSS(elem, "marginTop", true)) || 0;
+      offset.left -= parseFloat(jQuery.curCSS(elem, "marginLeft", true)) || 0;
+
+      // Add offsetParent borders
+      parentOffset.top += parseFloat(
+          jQuery.curCSS(offsetParent[0], "borderTopWidth", true)) || 0;
+      parentOffset.left += parseFloat(
+          jQuery.curCSS(offsetParent[0], "borderLeftWidth", true)) || 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 && (!/^body|html$/i.test(offsetParent.nodeName)
+            && jQuery.css(offsetParent, "position") === "static")) {
+          offsetParent = offsetParent.offsetParent;
+        }
+        return offsetParent;
+      });
+    }
+  });
 
 // Create scrollLeft and scrollTop methods
-jQuery.each( ["Left", "Top"], function( i, name ) {
-	var method = "scroll" + name;
-
-	jQuery.fn[ method ] = function(val) {
-		var elem = this[0], win;
-		
-		if ( !elem ) {
-			return null;
-		}
-
-		if ( val !== undefined ) {
-			// Set the scroll offset
-			return this.each(function() {
-				win = getWindow( this );
-
-				if ( win ) {
-					win.scrollTo(
-						!i ? val : jQuery(win).scrollLeft(),
-						 i ? val : jQuery(win).scrollTop()
-					);
-
-				} else {
-					this[ method ] = val;
-				}
-			});
-		} else {
-			win = getWindow( elem );
-
-			// Return the scroll offset
-			return win ? ("pageXOffset" in win) ? win[ i ? "pageYOffset" : "pageXOffset" ] :
-				jQuery.support.boxModel && win.document.documentElement[ method ] ||
-					win.document.body[ method ] :
-				elem[ method ];
-		}
-	};
-});
-
-function getWindow( elem ) {
-	return ("scrollTo" in elem && elem.document) ?
-		elem :
-		elem.nodeType === 9 ?
-			elem.defaultView || elem.parentWindow :
-			false;
-}
+  jQuery.each(["Left", "Top"], function (i, name) {
+    var method = "scroll" + name;
+
+    jQuery.fn[method] = function (val) {
+      var elem = this[0], win;
+
+      if (!elem) {
+        return null;
+      }
+
+      if (val !== undefined) {
+        // Set the scroll offset
+        return this.each(function () {
+          win = getWindow(this);
+
+          if (win) {
+            win.scrollTo(
+                !i ? val : jQuery(win).scrollLeft(),
+                i ? val : jQuery(win).scrollTop()
+            );
+
+          } else {
+            this[method] = val;
+          }
+        });
+      } else {
+        win = getWindow(elem);
+
+        // Return the scroll offset
+        return win ? ("pageXOffset" in win) ? win[i ? "pageYOffset"
+            : "pageXOffset"] : jQuery.support.boxModel
+            && win.document.documentElement[method] ||
+            win.document.body[method] : elem[method];
+      }
+    };
+  });
+
+  function getWindow(elem) {
+    return ("scrollTo" in elem && elem.document) ? elem : elem.nodeType === 9
+        ? elem.defaultView || elem.parentWindow : false;
+  }
+
 // Create innerHeight, innerWidth, outerHeight and outerWidth methods
-jQuery.each([ "Height", "Width" ], function( i, name ) {
-
-	var type = name.toLowerCase();
-
-	// innerHeight and innerWidth
-	jQuery.fn["inner" + name] = function() {
-		return this[0] ?
-			jQuery.css( this[0], type, false, "padding" ) :
-			null;
-	};
-
-	// outerHeight and outerWidth
-	jQuery.fn["outer" + name] = function( margin ) {
-		return this[0] ?
-			jQuery.css( this[0], type, false, margin ? "margin" : "border" ) :
-			null;
-	};
-
-	jQuery.fn[ type ] = function( size ) {
-		// Get window width or height
-		var elem = this[0];
-		if ( !elem ) {
-			return size == null ? null : this;
-		}
-		
-		if ( jQuery.isFunction( size ) ) {
-			return this.each(function( i ) {
-				var self = jQuery( this );
-				self[ type ]( size.call( this, i, self[ type ]() ) );
-			});
-		}
-
-		return ("scrollTo" in elem && elem.document) ? // does it walk and quack like a window?
-			// Everyone else use document.documentElement or document.body depending on Quirks vs Standards mode
-			elem.document.compatMode === "CSS1Compat" && elem.document.documentElement[ "client" + name ] ||
-			elem.document.body[ "client" + name ] :
-
-			// Get document width or height
-			(elem.nodeType === 9) ? // is it a document
-				// Either scroll[Width/Height] or offset[Width/Height], whichever is greater
-				Math.max(
-					elem.documentElement["client" + name],
-					elem.body["scroll" + name], elem.documentElement["scroll" + name],
-					elem.body["offset" + name], elem.documentElement["offset" + name]
-				) :
-
-				// Get or set width or height on the element
-				size === undefined ?
-					// Get width or height on the element
-					jQuery.css( elem, type ) :
-
-					// Set the width or height on the element (default to pixels if value is unitless)
-					this.css( type, typeof size === "string" ? size : size + "px" );
-	};
-
-});
+  jQuery.each(["Height", "Width"], function (i, name) {
+
+    var type = name.toLowerCase();
+
+    // innerHeight and innerWidth
+    jQuery.fn["inner" + name] = function () {
+      return this[0] ? jQuery.css(this[0], type, false, "padding") : null;
+    };
+
+    // outerHeight and outerWidth
+    jQuery.fn["outer" + name] = function (margin) {
+      return this[0] ? jQuery.css(this[0], type, false,
+          margin ? "margin" : "border") : null;
+    };
+
+    jQuery.fn[type] = function (size) {
+      // Get window width or height
+      var elem = this[0];
+      if (!elem) {
+        return size == null ? null : this;
+      }
+
+      if (jQuery.isFunction(size)) {
+        return this.each(function (i) {
+          var self = jQuery(this);
+          self[type](size.call(this, i, self[type]()));
+        });
+      }
+
+      return ("scrollTo" in elem && elem.document) ? // does it walk and quack like a window?
+          // Everyone else use document.documentElement or document.body depending on Quirks vs Standards mode
+          elem.document.compatMode === "CSS1Compat"
+          && elem.document.documentElement["client" + name] ||
+          elem.document.body["client" + name] : // Get document width or height
+          (elem.nodeType === 9) ? // is it a document
+              // Either scroll[Width/Height] or offset[Width/Height], whichever is greater
+              Math.max(
+                  elem.documentElement["client" + name],
+                  elem.body["scroll" + name],
+                  elem.documentElement["scroll" + name],
+                  elem.body["offset" + name],
+                  elem.documentElement["offset" + name]
+              ) : // Get or set width or height on the element
+              size === undefined ? // Get width or height on the element
+                  jQuery.css(elem, type)
+                  : // Set the width or height on the element (default to pixels if value is unitless)
+                  this.css(type, typeof size === "string" ? size : size + "px");
+    };
+
+  });
 // Expose jQuery to the global object
-window.jQuery = window.$ = jQuery;
+  window.jQuery = window.$ = jQuery;
 
 })(window);
diff --git a/azkaban-web-server/src/web/js/jquery/jquery.jstree.js b/azkaban-web-server/src/web/js/jquery/jquery.jstree.js
index 5037698..405164c 100644
--- a/azkaban-web-server/src/web/js/jquery/jquery.jstree.js
+++ b/azkaban-web-server/src/web/js/jquery/jquery.jstree.js
@@ -16,1231 +16,1740 @@
 /*global window : false, clearInterval: false, clearTimeout: false, document: false, setInterval: false, setTimeout: false, jQuery: false, navigator: false, XSLTProcessor: false, DOMParser: false, XMLSerializer: false*/
 
 "use strict";
-// Common functions not related to jsTree 
+// Common functions not related to jsTree
 // decided to move them to a `vakata` "namespace"
 (function ($) {
-	$.vakata = {};
-	// CSS related functions
-	$.vakata.css = {
-		get_css : function(rule_name, delete_flag, sheet) {
-			rule_name = rule_name.toLowerCase();
-			var css_rules = sheet.cssRules || sheet.rules,
-				j = 0;
-			do {
-				if(css_rules.length && j > css_rules.length + 5) { return false; }
-				if(css_rules[j].selectorText && css_rules[j].selectorText.toLowerCase() == rule_name) {
-					if(delete_flag === true) {
-						if(sheet.removeRule) { sheet.removeRule(j); }
-						if(sheet.deleteRule) { sheet.deleteRule(j); }
-						return true;
-					}
-					else { return css_rules[j]; }
-				}
-			}
-			while (css_rules[++j]);
-			return false;
-		},
-		add_css : function(rule_name, sheet) {
-			if($.jstree.css.get_css(rule_name, false, sheet)) { return false; }
-			if(sheet.insertRule) { sheet.insertRule(rule_name + ' { }', 0); } else { sheet.addRule(rule_name, null, 0); }
-			return $.vakata.css.get_css(rule_name);
-		},
-		remove_css : function(rule_name, sheet) { 
-			return $.vakata.css.get_css(rule_name, true, sheet); 
-		},
-		add_sheet : function(opts) {
-			var tmp;
-			if(opts.str) {
-				tmp = document.createElement("style");
-				tmp.setAttribute('type',"text/css");
-				if(tmp.styleSheet) {
-					document.getElementsByTagName("head")[0].appendChild(tmp);
-					tmp.styleSheet.cssText = opts.str;
-				}
-				else {
-					tmp.appendChild(document.createTextNode(opts.str));
-					document.getElementsByTagName("head")[0].appendChild(tmp);
-				}
-				return tmp.sheet || tmp.styleSheet;
-			}
-			if(opts.url) {
-				if(document.createStyleSheet) {
-					try { tmp = document.createStyleSheet(opts.url); } catch (e) { }
-				}
-				else {
-					tmp			= document.createElement('link');
-					tmp.rel		= 'stylesheet';
-					tmp.type	= 'text/css';
-					tmp.media	= "all";
-					tmp.href	= opts.url;
-					document.getElementsByTagName("head")[0].appendChild(tmp);
-					return tmp.styleSheet;
-				}
-			}
-		}
-	};
+  $.vakata = {};
+  // CSS related functions
+  $.vakata.css = {
+    get_css: function (rule_name, delete_flag, sheet) {
+      rule_name = rule_name.toLowerCase();
+      var css_rules = sheet.cssRules || sheet.rules,
+          j = 0;
+      do {
+        if (css_rules.length && j > css_rules.length + 5) {
+          return false;
+        }
+        if (css_rules[j].selectorText && css_rules[j].selectorText.toLowerCase()
+            == rule_name) {
+          if (delete_flag === true) {
+            if (sheet.removeRule) {
+              sheet.removeRule(j);
+            }
+            if (sheet.deleteRule) {
+              sheet.deleteRule(j);
+            }
+            return true;
+          }
+          else {
+            return css_rules[j];
+          }
+        }
+      }
+      while (css_rules[++j]);
+      return false;
+    },
+    add_css: function (rule_name, sheet) {
+      if ($.jstree.css.get_css(rule_name, false, sheet)) {
+        return false;
+      }
+      if (sheet.insertRule) {
+        sheet.insertRule(rule_name + ' { }', 0);
+      } else {
+        sheet.addRule(rule_name, null, 0);
+      }
+      return $.vakata.css.get_css(rule_name);
+    },
+    remove_css: function (rule_name, sheet) {
+      return $.vakata.css.get_css(rule_name, true, sheet);
+    },
+    add_sheet: function (opts) {
+      var tmp;
+      if (opts.str) {
+        tmp = document.createElement("style");
+        tmp.setAttribute('type', "text/css");
+        if (tmp.styleSheet) {
+          document.getElementsByTagName("head")[0].appendChild(tmp);
+          tmp.styleSheet.cssText = opts.str;
+        }
+        else {
+          tmp.appendChild(document.createTextNode(opts.str));
+          document.getElementsByTagName("head")[0].appendChild(tmp);
+        }
+        return tmp.sheet || tmp.styleSheet;
+      }
+      if (opts.url) {
+        if (document.createStyleSheet) {
+          try {
+            tmp = document.createStyleSheet(opts.url);
+          } catch (e) {
+          }
+        }
+        else {
+          tmp = document.createElement('link');
+          tmp.rel = 'stylesheet';
+          tmp.type = 'text/css';
+          tmp.media = "all";
+          tmp.href = opts.url;
+          document.getElementsByTagName("head")[0].appendChild(tmp);
+          return tmp.styleSheet;
+        }
+      }
+    }
+  };
 })(jQuery);
 
-/* 
+/*
  * jsTree core 1.0
  */
 (function ($) {
-	// private variables 
-	var instances = [],			// instance array (used by $.jstree.reference/create/focused)
-		focused_instance = -1,	// the index in the instance array of the currently focused instance
-		plugins = {},			// list of included plugins
-		prepared_move = {},		// for the move plugin
-		is_ie6 = false;
-
-	// jQuery plugin wrapper (thanks to jquery UI widget function)
-	$.fn.jstree = function (settings) {
-		var isMethodCall = (typeof settings == 'string'), // is this a method call like $().jstree("open_node")
-			args = Array.prototype.slice.call(arguments, 1), 
-			returnValue = this;
-
-		// extend settings and allow for multiple hashes and metadata
-		if(!isMethodCall && $.meta) { args.push($.metadata.get(this).jstree); }
-		settings = !isMethodCall && args.length ? $.extend.apply(null, [true, settings].concat(args)) : settings;
-		// block calls to "private" methods
-		if(isMethodCall && settings.substring(0, 1) == '_') { return returnValue; }
-
-		// if a method call execute the method on all selected instances
-		if(isMethodCall) {
-			this.each(function() {
-				var instance = instances[$.data(this, "jstree-instance-id")],
-					methodValue = (instance && $.isFunction(instance[settings])) ? instance[settings].apply(instance, args) : instance;
-					if(typeof methodValue !== "undefined" && (settings.indexOf("is_" === 0) || (methodValue !== true && methodValue !== false))) { returnValue = methodValue; return false; }
-			});
-		}
-		else {
-			this.each(function() {
-				var instance_id = $.data(this, "jstree-instance-id"),
-					s = false;
-				// if an instance already exists, destroy it first
-				if(typeof instance_id !== "undefined" && instances[instance_id]) { instances[instance_id].destroy(); }
-				// push a new empty object to the instances array
-				instance_id = parseInt(instances.push({}),10) - 1;
-				// store the jstree instance id to the container element
-				$.data(this, "jstree-instance-id", instance_id);
-				// clean up all plugins
-				if(!settings) { settings = {}; }
-				settings.plugins = $.isArray(settings.plugins) ? settings.plugins : $.jstree.defaults.plugins;
-				if($.inArray("core", settings.plugins) === -1) { settings.plugins.unshift("core"); }
-				
-				// only unique plugins (NOT WORKING)
-				// settings.plugins = settings.plugins.sort().join(",,").replace(/(,|^)([^,]+)(,,\2)+(,|$)/g,"$1$2$4").replace(/,,+/g,",").replace(/,$/,"").split(",");
-
-				// extend defaults with passed data
-				s = $.extend(true, {}, $.jstree.defaults, settings);
-				s.plugins = settings.plugins;
-				$.each(plugins, function (i, val) { if($.inArray(i, s.plugins) === -1) { s[i] = null; delete s[i]; } });
-				// push the new object to the instances array (at the same time set the default classes to the container) and init
-				instances[instance_id] = new $.jstree._instance(instance_id, $(this).addClass("jstree jstree-" + instance_id), s); 
-				// init all activated plugins for this instance
-				$.each(instances[instance_id]._get_settings().plugins, function (i, val) { instances[instance_id].data[val] = {}; });
-				$.each(instances[instance_id]._get_settings().plugins, function (i, val) { if(plugins[val]) { plugins[val].__init.apply(instances[instance_id]); } });
-				// initialize the instance
-				instances[instance_id].init();
-			});
-		}
-		// return the jquery selection (or if it was a method call that returned a value - the returned value)
-		return returnValue;
-	};
-	// object to store exposed functions and objects
-	$.jstree = {
-		defaults : {
-			plugins : []
-		},
-		_focused : function () { return instances[focused_instance] || null; },
-		_reference : function (needle) { 
-			// get by instance id
-			if(instances[needle]) { return instances[needle]; }
-			// get by DOM (if still no luck - return null
-			var o = $(needle); 
-			if(!o.length && typeof needle === "string") { o = $("#" + needle); }
-			if(!o.length) { return null; }
-			return instances[o.closest(".jstree").data("jstree-instance-id")] || null; 
-		},
-		_instance : function (index, container, settings) { 
-			// for plugins to store data in
-			this.data = { core : {} };
-			this.get_settings	= function () { return $.extend(true, {}, settings); };
-			this._get_settings	= function () { return settings; };
-			this.get_index		= function () { return index; };
-			this.get_container	= function () { return container; };
-			this._set_settings	= function (s) { 
-				settings = $.extend(true, {}, settings, s);
-			};
-		},
-		_fn : { },
-		plugin : function (pname, pdata) {
-			pdata = $.extend({}, {
-				__init		: $.noop, 
-				__destroy	: $.noop,
-				_fn			: {},
-				defaults	: false
-			}, pdata);
-			plugins[pname] = pdata;
-
-			$.jstree.defaults[pname] = pdata.defaults;
-			$.each(pdata._fn, function (i, val) {
-				val.plugin		= pname;
-				val.old			= $.jstree._fn[i];
-				$.jstree._fn[i] = function () {
-					var rslt,
-						func = val,
-						args = Array.prototype.slice.call(arguments),
-						evnt = new $.Event("before.jstree"),
-						rlbk = false;
-
-					// Check if function belongs to the included plugins of this instance
-					do {
-						if(func && func.plugin && $.inArray(func.plugin, this._get_settings().plugins) !== -1) { break; }
-						func = func.old;
-					} while(func);
-					if(!func) { return; }
-
-					// a chance to stop execution (or change arguments): 
-					// * just bind to jstree.before
-					// * check the additional data object (func property)
-					// * call event.stopImmediatePropagation()
-					// * return false (or an array of arguments)
-					rslt = this.get_container().triggerHandler(evnt, { "func" : i, "inst" : this, "args" : args });
-					if(rslt === false) { return; }
-					if(typeof rslt !== "undefined") { args = rslt; }
-
-					// context and function to trigger events, then finally call the function
-					if(i.indexOf("_") === 0) {
-						rslt = func.apply(this, args);
-					}
-					else {
-						rslt = func.apply(
-							$.extend({}, this, { 
-								__callback : function (data) { 
-									this.get_container().triggerHandler( i + '.jstree', { "inst" : this, "args" : args, "rslt" : data, "rlbk" : rlbk });
-								},
-								__rollback : function () { 
-									rlbk = this.get_rollback();
-									return rlbk;
-								},
-								__call_old : function (replace_arguments) {
-									return func.old.apply(this, (replace_arguments ? Array.prototype.slice.call(arguments, 1) : args ) );
-								}
-							}), args);
-					}
-
-					// return the result
-					return rslt;
-				};
-				$.jstree._fn[i].old = val.old;
-				$.jstree._fn[i].plugin = pname;
-			});
-		},
-		rollback : function (rb) {
-			if(rb) {
-				if(!$.isArray(rb)) { rb = [ rb ]; }
-				$.each(rb, function (i, val) {
-					instances[val.i].set_rollback(val.h, val.d);
-				});
-			}
-		}
-	};
-	// set the prototype for all instances
-	$.jstree._fn = $.jstree._instance.prototype = {};
-
-	// css functions - used internally
-
-	// load the css when DOM is ready
-	$(function() {
-		// code is copied form jQuery ($.browser is deprecated + there is a bug in IE)
-		var u = navigator.userAgent.toLowerCase(),
-			v = (u.match( /.+?(?:rv|it|ra|ie)[\/: ]([\d.]+)/ ) || [0,'0'])[1],
-			css_string = '' + 
-				'.jstree ul, .jstree li { display:block; margin:0 0 0 0; padding:0 0 0 0; list-style-type:none; } ' + 
-				'.jstree li { display:block; min-height:18px; line-height:18px; white-space:nowrap; margin-left:18px; } ' + 
-				'.jstree-rtl li { margin-left:0; margin-right:18px; } ' + 
-				'.jstree > ul > li { margin-left:0px; } ' + 
-				'.jstree-rtl > ul > li { margin-right:0px; } ' + 
-				'.jstree ins { display:inline-block; text-decoration:none; width:18px; height:18px; margin:0 0 0 0; padding:0; } ' + 
-				'.jstree a { display:inline-block; line-height:16px; height:16px; color:black; white-space:nowrap; text-decoration:none; padding:1px 2px; margin:0; } ' + 
-				'.jstree a:focus { outline: none; } ' + 
-				'.jstree a > ins { height:16px; width:16px; } ' + 
-				'.jstree a > .jstree-icon { margin-right:3px; } ' + 
-				'.jstree-rtl a > .jstree-icon { margin-left:3px; margin-right:0; } ' + 
-				'li.jstree-open > ul { display:block; } ' + 
-				'li.jstree-closed > ul { display:none; } ';
-		// Correct IE 6 (does not support the > CSS selector)
-		if(/msie/.test(u) && parseInt(v, 10) == 6) { 
-			is_ie6 = true;
-			css_string += '' + 
-				'.jstree li { height:18px; margin-left:0; margin-right:0; } ' + 
-				'.jstree li li { margin-left:18px; } ' + 
-				'.jstree-rtl li li { margin-left:0px; margin-right:18px; } ' + 
-				'li.jstree-open ul { display:block; } ' + 
-				'li.jstree-closed ul { display:none !important; } ' + 
-				'.jstree li a { display:inline; border-width:0 !important; padding:0px 2px !important; } ' + 
-				'.jstree li a ins { height:16px; width:16px; margin-right:3px; } ' + 
-				'.jstree-rtl li a ins { margin-right:0px; margin-left:3px; } ';
-		}
-		// Correct IE 7 (shifts anchor nodes onhover)
-		if(/msie/.test(u) && parseInt(v, 10) == 7) { 
-			css_string += '.jstree li a { border-width:0 !important; padding:0px 2px !important; } ';
-		}
-		$.vakata.css.add_sheet({ str : css_string });
-	});
-
-	// core functions (open, close, create, update, delete)
-	$.jstree.plugin("core", {
-		__init : function () {
-			this.data.core.to_open = $.map($.makeArray(this.get_settings().core.initially_open), function (n) { return "#" + n.toString().replace(/^#/,"").replace('\\/','/').replace('/','\\/'); });
-		},
-		defaults : { 
-			html_titles	: false,
-			animation	: 500,
-			initially_open : [],
-			rtl			: false,
-			strings		: {
-				loading		: "Loading ...",
-				new_node	: "New node"
-			}
-		},
-		_fn : { 
-			init	: function () { 
-				this.set_focus(); 
-				if(this._get_settings().core.rtl) {
-					this.get_container().addClass("jstree-rtl").css("direction", "rtl");
-				}
-				this.get_container().html("<ul><li class='jstree-last jstree-leaf'><ins>&#160;</ins><a class='jstree-loading' href='#'><ins class='jstree-icon'>&#160;</ins>" + this._get_settings().core.strings.loading + "</a></li></ul>");
-				this.data.core.li_height = this.get_container().find("ul li.jstree-closed, ul li.jstree-leaf").eq(0).height() || 18;
-
-				this.get_container()
-					.delegate("li > ins", "click.jstree", $.proxy(function (event) {
-							var trgt = $(event.target);
-							if(trgt.is("ins") && event.pageY - trgt.offset().top < this.data.core.li_height) { this.toggle_node(trgt); }
-						}, this))
-					.bind("mousedown.jstree", $.proxy(function () { 
-							this.set_focus(); // This used to be setTimeout(set_focus,0) - why?
-						}, this))
-					.bind("dblclick.jstree", function (event) { 
-						var sel;
-						if(document.selection && document.selection.empty) { document.selection.empty(); }
-						else {
-							if(window.getSelection) {
-								sel = window.getSelection();
-								try { 
-									sel.removeAllRanges();
-									sel.collapse();
-								} catch (err) { }
-							}
-						}
-					});
-				this.__callback();
-				this.load_node(-1, function () { this.loaded(); this.reopen(); });
-			},
-			destroy	: function () { 
-				var i,
-					n = this.get_index(),
-					s = this._get_settings(),
-					_this = this;
-
-				$.each(s.plugins, function (i, val) {
-					try { plugins[val].__destroy.apply(_this); } catch(err) { }
-				});
-				this.__callback();
-				// set focus to another instance if this one is focused
-				if(this.is_focused()) { 
-					for(i in instances) { 
-						if(instances.hasOwnProperty(i) && i != n) { 
-							instances[i].set_focus(); 
-							break; 
-						} 
-					}
-				}
-				// if no other instance found
-				if(n === focused_instance) { focused_instance = -1; }
-				// remove all traces of jstree in the DOM (only the ones set using jstree*) and cleans all events
-				this.get_container()
-					.unbind(".jstree")
-					.undelegate(".jstree")
-					.removeData("jstree-instance-id")
-					.find("[class^='jstree']")
-						.andSelf()
-						.attr("class", function () { return this.className.replace(/jstree[^ ]*|$/ig,''); });
-				// remove the actual data
-				instances[n] = null;
-				delete instances[n];
-			},
-			save_opened : function () {
-				var _this = this;
-				this.data.core.to_open = [];
-				this.get_container().find(".jstree-open").each(function () { 
-					_this.data.core.to_open.push("#" + this.id.toString().replace(/^#/,"").replace('\\/','/').replace('/','\\/')); 
-				});
-				this.__callback(_this.data.core.to_open);
-			},
-			reopen : function (is_callback) {
-				var _this = this,
-					done = true,
-					current = [],
-					remaining = [];
-				if(!is_callback) { this.data.core.reopen = false; this.data.core.refreshing = true; }
-				if(this.data.core.to_open.length) {
-					$.each(this.data.core.to_open, function (i, val) {
-						if(val == "#") { return true; }
-						if($(val).length && $(val).is(".jstree-closed")) { current.push(val); }
-						else { remaining.push(val); }
-					});
-					if(current.length) {
-						this.data.core.to_open = remaining;
-						$.each(current, function (i, val) { 
-							_this.open_node(val, function () { _this.reopen(true); }, true); 
-						});
-						done = false;
-					}
-				}
-				if(done) { 
-					// TODO: find a more elegant approach to syncronizing returning requests
-					if(this.data.core.reopen) { clearTimeout(this.data.core.reopen); }
-					this.data.core.reopen = setTimeout(function () { _this.__callback({}, _this); }, 50);
-					this.data.core.refreshing = false;
-				}
-			},
-			refresh : function (obj) {
-				var _this = this;
-				this.save_opened();
-				if(!obj) { obj = -1; }
-				obj = this._get_node(obj);
-				if(!obj) { obj = -1; }
-				if(obj !== -1) { obj.children("UL").remove(); }
-				this.load_node(obj, function () { _this.__callback({ "obj" : obj}); _this.reopen(); });
-			},
-			// Dummy function to fire after the first load (so that there is a jstree.loaded event)
-			loaded	: function () { 
-				this.__callback(); 
-			},
-			// deal with focus
-			set_focus	: function () { 
-				var f = $.jstree._focused();
-				if(f && f !== this) {
-					f.get_container().removeClass("jstree-focused"); 
-				}
-				if(f !== this) {
-					this.get_container().addClass("jstree-focused"); 
-					focused_instance = this.get_index(); 
-				}
-				this.__callback();
-			},
-			is_focused	: function () { 
-				return focused_instance == this.get_index(); 
-			},
-
-			// traverse
-			_get_node		: function (obj) { 
-				var $obj = $(obj, this.get_container()); 
-				if($obj.is(".jstree") || obj == -1) { return -1; } 
-				$obj = $obj.closest("li", this.get_container()); 
-				return $obj.length ? $obj : false; 
-			},
-			_get_next		: function (obj, strict) {
-				obj = this._get_node(obj);
-				if(obj === -1) { return this.get_container().find("> ul > li:first-child"); }
-				if(!obj.length) { return false; }
-				if(strict) { return (obj.nextAll("li").size() > 0) ? obj.nextAll("li:eq(0)") : false; }
-
-				if(obj.hasClass("jstree-open")) { return obj.find("li:eq(0)"); }
-				else if(obj.nextAll("li").size() > 0) { return obj.nextAll("li:eq(0)"); }
-				else { return obj.parentsUntil(".jstree","li").next("li").eq(0); }
-			},
-			_get_prev		: function (obj, strict) {
-				obj = this._get_node(obj);
-				if(obj === -1) { return this.get_container().find("> ul > li:last-child"); }
-				if(!obj.length) { return false; }
-				if(strict) { return (obj.prevAll("li").length > 0) ? obj.prevAll("li:eq(0)") : false; }
-
-				if(obj.prev("li").length) {
-					obj = obj.prev("li").eq(0);
-					while(obj.hasClass("jstree-open")) { obj = obj.children("ul:eq(0)").children("li:last"); }
-					return obj;
-				}
-				else { var o = obj.parentsUntil(".jstree","li:eq(0)"); return o.length ? o : false; }
-			},
-			_get_parent		: function (obj) {
-				obj = this._get_node(obj);
-				if(obj == -1 || !obj.length) { return false; }
-				var o = obj.parentsUntil(".jstree", "li:eq(0)");
-				return o.length ? o : -1;
-			},
-			_get_children	: function (obj) {
-				obj = this._get_node(obj);
-				if(obj === -1) { return this.get_container().children("ul:eq(0)").children("li"); }
-				if(!obj.length) { return false; }
-				return obj.children("ul:eq(0)").children("li");
-			},
-			get_path		: function (obj, id_mode) {
-				var p = [],
-					_this = this;
-				obj = this._get_node(obj);
-				if(obj === -1 || !obj || !obj.length) { return false; }
-				obj.parentsUntil(".jstree", "li").each(function () {
-					p.push( id_mode ? this.id : _this.get_text(this) );
-				});
-				p.reverse();
-				p.push( id_mode ? obj.attr("id") : this.get_text(obj) );
-				return p;
-			},
-
-			is_open		: function (obj) { obj = this._get_node(obj); return obj && obj !== -1 && obj.hasClass("jstree-open"); },
-			is_closed	: function (obj) { obj = this._get_node(obj); return obj && obj !== -1 && obj.hasClass("jstree-closed"); },
-			is_leaf		: function (obj) { obj = this._get_node(obj); return obj && obj !== -1 && obj.hasClass("jstree-leaf"); },
-			// open/close
-			open_node	: function (obj, callback, skip_animation) {
-				obj = this._get_node(obj);
-				if(!obj.length) { return false; }
-				if(!obj.hasClass("jstree-closed")) { if(callback) { callback.call(); } return false; }
-				var s = skip_animation || is_ie6 ? 0 : this._get_settings().core.animation,
-					t = this;
-				if(!this._is_loaded(obj)) {
-					obj.children("a").addClass("jstree-loading");
-					this.load_node(obj, function () { t.open_node(obj, callback, skip_animation); }, callback);
-				}
-				else {
-					if(s) { obj.children("ul").css("display","none"); }
-					obj.removeClass("jstree-closed").addClass("jstree-open").children("a").removeClass("jstree-loading");
-					if(s) { obj.children("ul").stop(true).slideDown(s, function () { this.style.display = ""; }); }
-					this.__callback({ "obj" : obj });
-					if(callback) { callback.call(); }
-				}
-			},
-			close_node	: function (obj, skip_animation) {
-				obj = this._get_node(obj);
-				var s = skip_animation || is_ie6 ? 0 : this._get_settings().core.animation;
-				if(!obj.length || !obj.hasClass("jstree-open")) { return false; }
-				if(s) { obj.children("ul").attr("style","display:block !important"); }
-				obj.removeClass("jstree-open").addClass("jstree-closed");
-				if(s) { obj.children("ul").stop(true).slideUp(s, function () { this.style.display = ""; }); }
-				this.__callback({ "obj" : obj });
-			},
-			toggle_node	: function (obj) {
-				obj = this._get_node(obj);
-				if(obj.hasClass("jstree-closed")) { return this.open_node(obj); }
-				if(obj.hasClass("jstree-open")) { return this.close_node(obj); }
-			},
-			open_all	: function (obj, original_obj) {
-				obj = obj ? this._get_node(obj) : this.get_container();
-				if(!obj || obj === -1) { obj = this.get_container(); }
-				if(original_obj) { 
-					obj = obj.find("li.jstree-closed");
-				}
-				else {
-					original_obj = obj;
-					if(obj.is(".jstree-closed")) { obj = obj.find("li.jstree-closed").andSelf(); }
-					else { obj = obj.find("li.jstree-closed"); }
-				}
-				var _this = this;
-				obj.each(function () { 
-					var __this = this; 
-					if(!_this._is_loaded(this)) { _this.open_node(this, function() { _this.open_all(__this, original_obj); }, true); }
-					else { _this.open_node(this, false, true); }
-				});
-				// so that callback is fired AFTER all nodes are open
-				if(original_obj.find('li.jstree-closed').length === 0) { this.__callback({ "obj" : original_obj }); }
-			},
-			close_all	: function (obj) {
-				var _this = this;
-				obj = obj ? this._get_node(obj) : this.get_container();
-				if(!obj || obj === -1) { obj = this.get_container(); }
-				obj.find("li.jstree-open").andSelf().each(function () { _this.close_node(this); });
-				this.__callback({ "obj" : obj });
-			},
-			clean_node	: function (obj) {
-				obj = obj && obj != -1 ? $(obj) : this.get_container();
-				obj = obj.is("li") ? obj.find("li").andSelf() : obj.find("li");
-				obj.removeClass("jstree-last")
-					.filter("li:last-child").addClass("jstree-last").end()
-					.filter(":has(li)")
-						.not(".jstree-open").removeClass("jstree-leaf").addClass("jstree-closed");
-				obj.not(".jstree-open, .jstree-closed").addClass("jstree-leaf").children("ul").remove();
-				this.__callback({ "obj" : obj });
-			},
-			// rollback
-			get_rollback : function () { 
-				this.__callback();
-				return { i : this.get_index(), h : this.get_container().children("ul").clone(true), d : this.data }; 
-			},
-			set_rollback : function (html, data) {
-				this.get_container().empty().append(html);
-				this.data = data;
-				this.__callback();
-			},
-			// Dummy functions to be overwritten by any datastore plugin included
-			load_node	: function (obj, s_call, e_call) { this.__callback({ "obj" : obj }); },
-			_is_loaded	: function (obj) { return true; },
-
-			// Basic operations: create
-			create_node	: function (obj, position, js, callback, is_loaded) {
-				obj = this._get_node(obj);
-				position = typeof position === "undefined" ? "last" : position;
-				var d = $("<li>"),
-					s = this._get_settings().core,
-					tmp;
-
-				if(obj !== -1 && !obj.length) { return false; }
-				if(!is_loaded && !this._is_loaded(obj)) { this.load_node(obj, function () { this.create_node(obj, position, js, callback, true); }); return false; }
-
-				this.__rollback();
-
-				if(typeof js === "string") { js = { "data" : js }; }
-				if(!js) { js = {}; }
-				if(js.attr) { d.attr(js.attr); }
-				if(js.state) { d.addClass("jstree-" + js.state); }
-				if(!js.data) { js.data = s.strings.new_node; }
-				if(!$.isArray(js.data)) { tmp = js.data; js.data = []; js.data.push(tmp); }
-				$.each(js.data, function (i, m) {
-					tmp = $("<a>");
-					if($.isFunction(m)) { m = m.call(this, js); }
-					if(typeof m == "string") { tmp.attr('href','#')[ s.html_titles ? "html" : "text" ](m); }
-					else {
-						if(!m.attr) { m.attr = {}; }
-						if(!m.attr.href) { m.attr.href = '#'; }
-						tmp.attr(m.attr)[ s.html_titles ? "html" : "text" ](m.title);
-						if(m.language) { tmp.addClass(m.language); }
-					}
-					tmp.prepend("<ins class='jstree-icon'>&#160;</ins>");
-					if(m.icon) { 
-						if(m.icon.indexOf("/") === -1) { tmp.children("ins").addClass(m.icon); }
-						else { tmp.children("ins").css("background","url('" + m.icon + "') center center no-repeat"); }
-					}
-					d.append(tmp);
-				});
-				d.prepend("<ins class='jstree-icon'>&#160;</ins>");
-				if(obj === -1) {
-					obj = this.get_container();
-					if(position === "before") { position = "first"; }
-					if(position === "after") { position = "last"; }
-				}
-				switch(position) {
-					case "before": obj.before(d); tmp = this._get_parent(obj); break;
-					case "after" : obj.after(d);  tmp = this._get_parent(obj); break;
-					case "inside":
-					case "first" :
-						if(!obj.children("ul").length) { obj.append("<ul>"); }
-						obj.children("ul").prepend(d);
-						tmp = obj;
-						break;
-					case "last":
-						if(!obj.children("ul").length) { obj.append("<ul>"); }
-						obj.children("ul").append(d);
-						tmp = obj;
-						break;
-					default:
-						if(!obj.children("ul").length) { obj.append("<ul>"); }
-						if(!position) { position = 0; }
-						tmp = obj.children("ul").children("li").eq(position);
-						if(tmp.length) { tmp.before(d); }
-						else { obj.children("ul").append(d); }
-						tmp = obj;
-						break;
-				}
-				if(tmp === -1 || tmp.get(0) === this.get_container().get(0)) { tmp = -1; }
-				this.clean_node(tmp);
-				this.__callback({ "obj" : d, "parent" : tmp });
-				if(callback) { callback.call(this, d); }
-				return d;
-			},
-			// Basic operations: rename (deal with text)
-			get_text	: function (obj) {
-				obj = this._get_node(obj);
-				if(!obj.length) { return false; }
-				var s = this._get_settings().core.html_titles;
-				obj = obj.children("a:eq(0)");
-				if(s) {
-					obj = obj.clone();
-					obj.children("INS").remove();
-					return obj.html();
-				}
-				else {
-					obj = obj.contents().filter(function() { return this.nodeType == 3; })[0];
-					return obj.nodeValue;
-				}
-			},
-			set_text	: function (obj, val) {
-				obj = this._get_node(obj);
-				if(!obj.length) { return false; }
-				obj = obj.children("a:eq(0)");
-				if(this._get_settings().core.html_titles) {
-					var tmp = obj.children("INS").clone();
-					obj.html(val).prepend(tmp);
-					this.__callback({ "obj" : obj, "name" : val });
-					return true;
-				}
-				else {
-					obj = obj.contents().filter(function() { return this.nodeType == 3; })[0];
-					this.__callback({ "obj" : obj, "name" : val });
-					return (obj.nodeValue = val);
-				}
-			},
-			rename_node : function (obj, val) {
-				obj = this._get_node(obj);
-				this.__rollback();
-				if(obj && obj.length && this.set_text.apply(this, Array.prototype.slice.call(arguments))) { this.__callback({ "obj" : obj, "name" : val }); }
-			},
-			// Basic operations: deleting nodes
-			delete_node : function (obj) {
-				obj = this._get_node(obj);
-				if(!obj.length) { return false; }
-				this.__rollback();
-				var p = this._get_parent(obj), prev = this._get_prev(obj);
-				obj = obj.remove();
-				if(p !== -1 && p.find("> ul > li").length === 0) {
-					p.removeClass("jstree-open jstree-closed").addClass("jstree-leaf");
-				}
-				this.clean_node(p);
-				this.__callback({ "obj" : obj, "prev" : prev });
-				return obj;
-			},
-			prepare_move : function (o, r, pos, cb, is_cb) {
-				var p = {};
-
-				p.ot = $.jstree._reference(p.o) || this;
-				p.o = p.ot._get_node(o);
-				p.r = r === - 1 ? -1 : this._get_node(r);
-				p.p = (typeof p === "undefined") ? "last" : pos; // TODO: move to a setting
-				if(!is_cb && prepared_move.o && prepared_move.o[0] === p.o[0] && prepared_move.r[0] === p.r[0] && prepared_move.p === p.p) {
-					this.__callback(prepared_move);
-					if(cb) { cb.call(this, prepared_move); }
-					return;
-				}
-				p.ot = $.jstree._reference(p.o) || this;
-				p.rt = r === -1 ? p.ot : $.jstree._reference(p.r) || this;
-				if(p.r === -1) {
-					p.cr = -1;
-					switch(p.p) {
-						case "first":
-						case "before":
-						case "inside":
-							p.cp = 0; 
-							break;
-						case "after":
-						case "last":
-							p.cp = p.rt.get_container().find(" > ul > li").length; 
-							break;
-						default:
-							p.cp = p.p;
-							break;
-					}
-				}
-				else {
-					if(!/^(before|after)$/.test(p.p) && !this._is_loaded(p.r)) {
-						return this.load_node(p.r, function () { this.prepare_move(o, r, pos, cb, true); });
-					}
-					switch(p.p) {
-						case "before":
-							p.cp = p.r.index();
-							p.cr = p.rt._get_parent(p.r);
-							break;
-						case "after":
-							p.cp = p.r.index() + 1;
-							p.cr = p.rt._get_parent(p.r);
-							break;
-						case "inside":
-						case "first":
-							p.cp = 0;
-							p.cr = p.r;
-							break;
-						case "last":
-							p.cp = p.r.find(" > ul > li").length; 
-							p.cr = p.r;
-							break;
-						default: 
-							p.cp = p.p;
-							p.cr = p.r;
-							break;
-					}
-				}
-				p.np = p.cr == -1 ? p.rt.get_container() : p.cr;
-				p.op = p.ot._get_parent(p.o);
-				p.or = p.np.find(" > ul > li:nth-child(" + (p.cp + 1) + ")");
-
-				prepared_move = p;
-				this.__callback(prepared_move);
-				if(cb) { cb.call(this, prepared_move); }
-			},
-			check_move : function () {
-				var obj = prepared_move, ret = true;
-				if(obj.or[0] === obj.o[0]) { return false; }
-				obj.o.each(function () { 
-					if(obj.r.parentsUntil(".jstree").andSelf().filter("li").index(this) !== -1) { ret = false; return false; }
-				});
-				return ret;
-			},
-			move_node : function (obj, ref, position, is_copy, is_prepared, skip_check) {
-				if(!is_prepared) { 
-					return this.prepare_move(obj, ref, position, function (p) {
-						this.move_node(p, false, false, is_copy, true, skip_check);
-					});
-				}
-				if(!skip_check && !this.check_move()) { return false; }
-
-				this.__rollback();
-				var o = false;
-				if(is_copy) {
-					o = obj.o.clone();
-					o.find("*[id]").andSelf().each(function () {
-						if(this.id) { this.id = "copy_" + this.id; }
-					});
-				}
-				else { o = obj.o; }
-
-				if(obj.or.length) { obj.or.before(o); }
-				else { 
-					if(!obj.np.children("ul").length) { $("<ul>").appendTo(obj.np); }
-					obj.np.children("ul:eq(0)").append(o); 
-				}
-
-				try { 
-					obj.ot.clean_node(obj.op);
-					obj.rt.clean_node(obj.np);
-					if(!obj.op.find("> ul > li").length) {
-						obj.op.removeClass("jstree-open jstree-closed").addClass("jstree-leaf").children("ul").remove();
-					}
-				} catch (e) { }
-
-				if(is_copy) { 
-					prepared_move.cy = true;
-					prepared_move.oc = o; 
-				}
-				this.__callback(prepared_move);
-				return prepared_move;
-			},
-			_get_move : function () { return prepared_move; }
-		}
-	});
+  // private variables
+  var instances = [],			// instance array (used by $.jstree.reference/create/focused)
+      focused_instance = -1,	// the index in the instance array of the currently focused instance
+      plugins = {},			// list of included plugins
+      prepared_move = {},		// for the move plugin
+      is_ie6 = false;
+
+  // jQuery plugin wrapper (thanks to jquery UI widget function)
+  $.fn.jstree = function (settings) {
+    var isMethodCall = (typeof settings == 'string'), // is this a method call like $().jstree("open_node")
+        args = Array.prototype.slice.call(arguments, 1),
+        returnValue = this;
+
+    // extend settings and allow for multiple hashes and metadata
+    if (!isMethodCall && $.meta) {
+      args.push($.metadata.get(this).jstree);
+    }
+    settings = !isMethodCall && args.length ? $.extend.apply(null,
+        [true, settings].concat(args)) : settings;
+    // block calls to "private" methods
+    if (isMethodCall && settings.substring(0, 1) == '_') {
+      return returnValue;
+    }
+
+    // if a method call execute the method on all selected instances
+    if (isMethodCall) {
+      this.each(function () {
+        var instance = instances[$.data(this, "jstree-instance-id")],
+            methodValue = (instance && $.isFunction(instance[settings]))
+                ? instance[settings].apply(instance, args) : instance;
+        if (typeof methodValue !== "undefined" && (settings.indexOf("is_" === 0)
+                || (methodValue !== true && methodValue !== false))) {
+          returnValue = methodValue;
+          return false;
+        }
+      });
+    }
+    else {
+      this.each(function () {
+        var instance_id = $.data(this, "jstree-instance-id"),
+            s = false;
+        // if an instance already exists, destroy it first
+        if (typeof instance_id !== "undefined" && instances[instance_id]) {
+          instances[instance_id].destroy();
+        }
+        // push a new empty object to the instances array
+        instance_id = parseInt(instances.push({}), 10) - 1;
+        // store the jstree instance id to the container element
+        $.data(this, "jstree-instance-id", instance_id);
+        // clean up all plugins
+        if (!settings) {
+          settings = {};
+        }
+        settings.plugins = $.isArray(settings.plugins) ? settings.plugins
+            : $.jstree.defaults.plugins;
+        if ($.inArray("core", settings.plugins) === -1) {
+          settings.plugins.unshift("core");
+        }
+
+        // only unique plugins (NOT WORKING)
+        // settings.plugins = settings.plugins.sort().join(",,").replace(/(,|^)([^,]+)(,,\2)+(,|$)/g,"$1$2$4").replace(/,,+/g,",").replace(/,$/,"").split(",");
+
+        // extend defaults with passed data
+        s = $.extend(true, {}, $.jstree.defaults, settings);
+        s.plugins = settings.plugins;
+        $.each(plugins, function (i, val) {
+          if ($.inArray(i, s.plugins) === -1) {
+            s[i] = null;
+            delete s[i];
+          }
+        });
+        // push the new object to the instances array (at the same time set the default classes to the container) and init
+        instances[instance_id] = new $.jstree._instance(instance_id,
+            $(this).addClass("jstree jstree-" + instance_id), s);
+        // init all activated plugins for this instance
+        $.each(instances[instance_id]._get_settings().plugins,
+            function (i, val) {
+              instances[instance_id].data[val] = {};
+            });
+        $.each(instances[instance_id]._get_settings().plugins,
+            function (i, val) {
+              if (plugins[val]) {
+                plugins[val].__init.apply(instances[instance_id]);
+              }
+            });
+        // initialize the instance
+        instances[instance_id].init();
+      });
+    }
+    // return the jquery selection (or if it was a method call that returned a value - the returned value)
+    return returnValue;
+  };
+  // object to store exposed functions and objects
+  $.jstree = {
+    defaults: {
+      plugins: []
+    },
+    _focused: function () {
+      return instances[focused_instance] || null;
+    },
+    _reference: function (needle) {
+      // get by instance id
+      if (instances[needle]) {
+        return instances[needle];
+      }
+      // get by DOM (if still no luck - return null
+      var o = $(needle);
+      if (!o.length && typeof needle === "string") {
+        o = $("#" + needle);
+      }
+      if (!o.length) {
+        return null;
+      }
+      return instances[o.closest(".jstree").data("jstree-instance-id")] || null;
+    },
+    _instance: function (index, container, settings) {
+      // for plugins to store data in
+      this.data = {core: {}};
+      this.get_settings = function () {
+        return $.extend(true, {}, settings);
+      };
+      this._get_settings = function () {
+        return settings;
+      };
+      this.get_index = function () {
+        return index;
+      };
+      this.get_container = function () {
+        return container;
+      };
+      this._set_settings = function (s) {
+        settings = $.extend(true, {}, settings, s);
+      };
+    },
+    _fn: {},
+    plugin: function (pname, pdata) {
+      pdata = $.extend({}, {
+        __init: $.noop,
+        __destroy: $.noop,
+        _fn: {},
+        defaults: false
+      }, pdata);
+      plugins[pname] = pdata;
+
+      $.jstree.defaults[pname] = pdata.defaults;
+      $.each(pdata._fn, function (i, val) {
+        val.plugin = pname;
+        val.old = $.jstree._fn[i];
+        $.jstree._fn[i] = function () {
+          var rslt,
+              func = val,
+              args = Array.prototype.slice.call(arguments),
+              evnt = new $.Event("before.jstree"),
+              rlbk = false;
+
+          // Check if function belongs to the included plugins of this instance
+          do {
+            if (func && func.plugin && $.inArray(func.plugin,
+                    this._get_settings().plugins) !== -1) {
+              break;
+            }
+            func = func.old;
+          } while (func);
+          if (!func) {
+            return;
+          }
+
+          // a chance to stop execution (or change arguments):
+          // * just bind to jstree.before
+          // * check the additional data object (func property)
+          // * call event.stopImmediatePropagation()
+          // * return false (or an array of arguments)
+          rslt = this.get_container().triggerHandler(evnt,
+              {"func": i, "inst": this, "args": args});
+          if (rslt === false) {
+            return;
+          }
+          if (typeof rslt !== "undefined") {
+            args = rslt;
+          }
+
+          // context and function to trigger events, then finally call the function
+          if (i.indexOf("_") === 0) {
+            rslt = func.apply(this, args);
+          }
+          else {
+            rslt = func.apply(
+                $.extend({}, this, {
+                  __callback: function (data) {
+                    this.get_container().triggerHandler(i + '.jstree', {
+                      "inst": this,
+                      "args": args,
+                      "rslt": data,
+                      "rlbk": rlbk
+                    });
+                  },
+                  __rollback: function () {
+                    rlbk = this.get_rollback();
+                    return rlbk;
+                  },
+                  __call_old: function (replace_arguments) {
+                    return func.old.apply(this,
+                        (replace_arguments ? Array.prototype.slice.call(
+                            arguments, 1) : args ));
+                  }
+                }), args);
+          }
+
+          // return the result
+          return rslt;
+        };
+        $.jstree._fn[i].old = val.old;
+        $.jstree._fn[i].plugin = pname;
+      });
+    },
+    rollback: function (rb) {
+      if (rb) {
+        if (!$.isArray(rb)) {
+          rb = [rb];
+        }
+        $.each(rb, function (i, val) {
+          instances[val.i].set_rollback(val.h, val.d);
+        });
+      }
+    }
+  };
+  // set the prototype for all instances
+  $.jstree._fn = $.jstree._instance.prototype = {};
+
+  // css functions - used internally
+
+  // load the css when DOM is ready
+  $(function () {
+    // code is copied form jQuery ($.browser is deprecated + there is a bug in IE)
+    var u = navigator.userAgent.toLowerCase(),
+        v = (u.match(/.+?(?:rv|it|ra|ie)[\/: ]([\d.]+)/) || [0, '0'])[1],
+        css_string = '' +
+            '.jstree ul, .jstree li { display:block; margin:0 0 0 0; padding:0 0 0 0; list-style-type:none; } '
+            +
+            '.jstree li { display:block; min-height:18px; line-height:18px; white-space:nowrap; margin-left:18px; } '
+            +
+            '.jstree-rtl li { margin-left:0; margin-right:18px; } ' +
+            '.jstree > ul > li { margin-left:0px; } ' +
+            '.jstree-rtl > ul > li { margin-right:0px; } ' +
+            '.jstree ins { display:inline-block; text-decoration:none; width:18px; height:18px; margin:0 0 0 0; padding:0; } '
+            +
+            '.jstree a { display:inline-block; line-height:16px; height:16px; color:black; white-space:nowrap; text-decoration:none; padding:1px 2px; margin:0; } '
+            +
+            '.jstree a:focus { outline: none; } ' +
+            '.jstree a > ins { height:16px; width:16px; } ' +
+            '.jstree a > .jstree-icon { margin-right:3px; } ' +
+            '.jstree-rtl a > .jstree-icon { margin-left:3px; margin-right:0; } '
+            +
+            'li.jstree-open > ul { display:block; } ' +
+            'li.jstree-closed > ul { display:none; } ';
+    // Correct IE 6 (does not support the > CSS selector)
+    if (/msie/.test(u) && parseInt(v, 10) == 6) {
+      is_ie6 = true;
+      css_string += '' +
+          '.jstree li { height:18px; margin-left:0; margin-right:0; } ' +
+          '.jstree li li { margin-left:18px; } ' +
+          '.jstree-rtl li li { margin-left:0px; margin-right:18px; } ' +
+          'li.jstree-open ul { display:block; } ' +
+          'li.jstree-closed ul { display:none !important; } ' +
+          '.jstree li a { display:inline; border-width:0 !important; padding:0px 2px !important; } '
+          +
+          '.jstree li a ins { height:16px; width:16px; margin-right:3px; } ' +
+          '.jstree-rtl li a ins { margin-right:0px; margin-left:3px; } ';
+    }
+    // Correct IE 7 (shifts anchor nodes onhover)
+    if (/msie/.test(u) && parseInt(v, 10) == 7) {
+      css_string += '.jstree li a { border-width:0 !important; padding:0px 2px !important; } ';
+    }
+    $.vakata.css.add_sheet({str: css_string});
+  });
+
+  // core functions (open, close, create, update, delete)
+  $.jstree.plugin("core", {
+    __init: function () {
+      this.data.core.to_open = $.map(
+          $.makeArray(this.get_settings().core.initially_open), function (n) {
+            return "#" + n.toString().replace(/^#/, "").replace('\\/',
+                '/').replace('/', '\\/');
+          });
+    },
+    defaults: {
+      html_titles: false,
+      animation: 500,
+      initially_open: [],
+      rtl: false,
+      strings: {
+        loading: "Loading ...",
+        new_node: "New node"
+      }
+    },
+    _fn: {
+      init: function () {
+        this.set_focus();
+        if (this._get_settings().core.rtl) {
+          this.get_container().addClass("jstree-rtl").css("direction", "rtl");
+        }
+        this.get_container().html("<ul><li class='jstree-last jstree-leaf'><ins>&#160;</ins><a class='jstree-loading' href='#'><ins class='jstree-icon'>&#160;</ins>"
+            + this._get_settings().core.strings.loading + "</a></li></ul>");
+        this.data.core.li_height = this.get_container().find(
+            "ul li.jstree-closed, ul li.jstree-leaf").eq(0).height() || 18;
+
+        this.get_container()
+        .delegate("li > ins", "click.jstree", $.proxy(function (event) {
+          var trgt = $(event.target);
+          if (trgt.is("ins") && event.pageY - trgt.offset().top
+              < this.data.core.li_height) {
+            this.toggle_node(trgt);
+          }
+        }, this))
+        .bind("mousedown.jstree", $.proxy(function () {
+          this.set_focus(); // This used to be setTimeout(set_focus,0) - why?
+        }, this))
+        .bind("dblclick.jstree", function (event) {
+          var sel;
+          if (document.selection && document.selection.empty) {
+            document.selection.empty();
+          }
+          else {
+            if (window.getSelection) {
+              sel = window.getSelection();
+              try {
+                sel.removeAllRanges();
+                sel.collapse();
+              } catch (err) {
+              }
+            }
+          }
+        });
+        this.__callback();
+        this.load_node(-1, function () {
+          this.loaded();
+          this.reopen();
+        });
+      },
+      destroy: function () {
+        var i,
+            n = this.get_index(),
+            s = this._get_settings(),
+            _this = this;
+
+        $.each(s.plugins, function (i, val) {
+          try {
+            plugins[val].__destroy.apply(_this);
+          } catch (err) {
+          }
+        });
+        this.__callback();
+        // set focus to another instance if this one is focused
+        if (this.is_focused()) {
+          for (i in instances) {
+            if (instances.hasOwnProperty(i) && i != n) {
+              instances[i].set_focus();
+              break;
+            }
+          }
+        }
+        // if no other instance found
+        if (n === focused_instance) {
+          focused_instance = -1;
+        }
+        // remove all traces of jstree in the DOM (only the ones set using jstree*) and cleans all events
+        this.get_container()
+        .unbind(".jstree")
+        .undelegate(".jstree")
+        .removeData("jstree-instance-id")
+        .find("[class^='jstree']")
+        .andSelf()
+        .attr("class", function () {
+          return this.className.replace(/jstree[^ ]*|$/ig, '');
+        });
+        // remove the actual data
+        instances[n] = null;
+        delete instances[n];
+      },
+      save_opened: function () {
+        var _this = this;
+        this.data.core.to_open = [];
+        this.get_container().find(".jstree-open").each(function () {
+          _this.data.core.to_open.push("#" + this.id.toString().replace(/^#/,
+              "").replace('\\/', '/').replace('/', '\\/'));
+        });
+        this.__callback(_this.data.core.to_open);
+      },
+      reopen: function (is_callback) {
+        var _this = this,
+            done = true,
+            current = [],
+            remaining = [];
+        if (!is_callback) {
+          this.data.core.reopen = false;
+          this.data.core.refreshing = true;
+        }
+        if (this.data.core.to_open.length) {
+          $.each(this.data.core.to_open, function (i, val) {
+            if (val == "#") {
+              return true;
+            }
+            if ($(val).length && $(val).is(".jstree-closed")) {
+              current.push(val);
+            }
+            else {
+              remaining.push(val);
+            }
+          });
+          if (current.length) {
+            this.data.core.to_open = remaining;
+            $.each(current, function (i, val) {
+              _this.open_node(val, function () {
+                _this.reopen(true);
+              }, true);
+            });
+            done = false;
+          }
+        }
+        if (done) {
+          // TODO: find a more elegant approach to syncronizing returning requests
+          if (this.data.core.reopen) {
+            clearTimeout(this.data.core.reopen);
+          }
+          this.data.core.reopen = setTimeout(function () {
+            _this.__callback({}, _this);
+          }, 50);
+          this.data.core.refreshing = false;
+        }
+      },
+      refresh: function (obj) {
+        var _this = this;
+        this.save_opened();
+        if (!obj) {
+          obj = -1;
+        }
+        obj = this._get_node(obj);
+        if (!obj) {
+          obj = -1;
+        }
+        if (obj !== -1) {
+          obj.children("UL").remove();
+        }
+        this.load_node(obj, function () {
+          _this.__callback({"obj": obj});
+          _this.reopen();
+        });
+      },
+      // Dummy function to fire after the first load (so that there is a jstree.loaded event)
+      loaded: function () {
+        this.__callback();
+      },
+      // deal with focus
+      set_focus: function () {
+        var f = $.jstree._focused();
+        if (f && f !== this) {
+          f.get_container().removeClass("jstree-focused");
+        }
+        if (f !== this) {
+          this.get_container().addClass("jstree-focused");
+          focused_instance = this.get_index();
+        }
+        this.__callback();
+      },
+      is_focused: function () {
+        return focused_instance == this.get_index();
+      },
+
+      // traverse
+      _get_node: function (obj) {
+        var $obj = $(obj, this.get_container());
+        if ($obj.is(".jstree") || obj == -1) {
+          return -1;
+        }
+        $obj = $obj.closest("li", this.get_container());
+        return $obj.length ? $obj : false;
+      },
+      _get_next: function (obj, strict) {
+        obj = this._get_node(obj);
+        if (obj === -1) {
+          return this.get_container().find("> ul > li:first-child");
+        }
+        if (!obj.length) {
+          return false;
+        }
+        if (strict) {
+          return (obj.nextAll("li").size() > 0) ? obj.nextAll("li:eq(0)")
+              : false;
+        }
+
+        if (obj.hasClass("jstree-open")) {
+          return obj.find("li:eq(0)");
+        }
+        else if (obj.nextAll("li").size() > 0) {
+          return obj.nextAll("li:eq(0)");
+        }
+        else {
+          return obj.parentsUntil(".jstree", "li").next("li").eq(0);
+        }
+      },
+      _get_prev: function (obj, strict) {
+        obj = this._get_node(obj);
+        if (obj === -1) {
+          return this.get_container().find("> ul > li:last-child");
+        }
+        if (!obj.length) {
+          return false;
+        }
+        if (strict) {
+          return (obj.prevAll("li").length > 0) ? obj.prevAll("li:eq(0)")
+              : false;
+        }
+
+        if (obj.prev("li").length) {
+          obj = obj.prev("li").eq(0);
+          while (obj.hasClass("jstree-open")) {
+            obj = obj.children("ul:eq(0)").children("li:last");
+          }
+          return obj;
+        }
+        else {
+          var o = obj.parentsUntil(".jstree", "li:eq(0)");
+          return o.length ? o : false;
+        }
+      },
+      _get_parent: function (obj) {
+        obj = this._get_node(obj);
+        if (obj == -1 || !obj.length) {
+          return false;
+        }
+        var o = obj.parentsUntil(".jstree", "li:eq(0)");
+        return o.length ? o : -1;
+      },
+      _get_children: function (obj) {
+        obj = this._get_node(obj);
+        if (obj === -1) {
+          return this.get_container().children("ul:eq(0)").children("li");
+        }
+        if (!obj.length) {
+          return false;
+        }
+        return obj.children("ul:eq(0)").children("li");
+      },
+      get_path: function (obj, id_mode) {
+        var p = [],
+            _this = this;
+        obj = this._get_node(obj);
+        if (obj === -1 || !obj || !obj.length) {
+          return false;
+        }
+        obj.parentsUntil(".jstree", "li").each(function () {
+          p.push(id_mode ? this.id : _this.get_text(this));
+        });
+        p.reverse();
+        p.push(id_mode ? obj.attr("id") : this.get_text(obj));
+        return p;
+      },
+
+      is_open: function (obj) {
+        obj = this._get_node(obj);
+        return obj && obj !== -1 && obj.hasClass("jstree-open");
+      },
+      is_closed: function (obj) {
+        obj = this._get_node(obj);
+        return obj && obj !== -1 && obj.hasClass("jstree-closed");
+      },
+      is_leaf: function (obj) {
+        obj = this._get_node(obj);
+        return obj && obj !== -1 && obj.hasClass("jstree-leaf");
+      },
+      // open/close
+      open_node: function (obj, callback, skip_animation) {
+        obj = this._get_node(obj);
+        if (!obj.length) {
+          return false;
+        }
+        if (!obj.hasClass("jstree-closed")) {
+          if (callback) {
+            callback.call();
+          }
+          return false;
+        }
+        var s = skip_animation || is_ie6 ? 0
+            : this._get_settings().core.animation,
+            t = this;
+        if (!this._is_loaded(obj)) {
+          obj.children("a").addClass("jstree-loading");
+          this.load_node(obj, function () {
+            t.open_node(obj, callback, skip_animation);
+          }, callback);
+        }
+        else {
+          if (s) {
+            obj.children("ul").css("display", "none");
+          }
+          obj.removeClass("jstree-closed").addClass("jstree-open").children(
+              "a").removeClass("jstree-loading");
+          if (s) {
+            obj.children("ul").stop(true).slideDown(s, function () {
+              this.style.display = "";
+            });
+          }
+          this.__callback({"obj": obj});
+          if (callback) {
+            callback.call();
+          }
+        }
+      },
+      close_node: function (obj, skip_animation) {
+        obj = this._get_node(obj);
+        var s = skip_animation || is_ie6 ? 0
+            : this._get_settings().core.animation;
+        if (!obj.length || !obj.hasClass("jstree-open")) {
+          return false;
+        }
+        if (s) {
+          obj.children("ul").attr("style", "display:block !important");
+        }
+        obj.removeClass("jstree-open").addClass("jstree-closed");
+        if (s) {
+          obj.children("ul").stop(true).slideUp(s, function () {
+            this.style.display = "";
+          });
+        }
+        this.__callback({"obj": obj});
+      },
+      toggle_node: function (obj) {
+        obj = this._get_node(obj);
+        if (obj.hasClass("jstree-closed")) {
+          return this.open_node(obj);
+        }
+        if (obj.hasClass("jstree-open")) {
+          return this.close_node(obj);
+        }
+      },
+      open_all: function (obj, original_obj) {
+        obj = obj ? this._get_node(obj) : this.get_container();
+        if (!obj || obj === -1) {
+          obj = this.get_container();
+        }
+        if (original_obj) {
+          obj = obj.find("li.jstree-closed");
+        }
+        else {
+          original_obj = obj;
+          if (obj.is(".jstree-closed")) {
+            obj = obj.find("li.jstree-closed").andSelf();
+          }
+          else {
+            obj = obj.find("li.jstree-closed");
+          }
+        }
+        var _this = this;
+        obj.each(function () {
+          var __this = this;
+          if (!_this._is_loaded(this)) {
+            _this.open_node(this, function () {
+              _this.open_all(__this, original_obj);
+            }, true);
+          }
+          else {
+            _this.open_node(this, false, true);
+          }
+        });
+        // so that callback is fired AFTER all nodes are open
+        if (original_obj.find('li.jstree-closed').length === 0) {
+          this.__callback({"obj": original_obj});
+        }
+      },
+      close_all: function (obj) {
+        var _this = this;
+        obj = obj ? this._get_node(obj) : this.get_container();
+        if (!obj || obj === -1) {
+          obj = this.get_container();
+        }
+        obj.find("li.jstree-open").andSelf().each(function () {
+          _this.close_node(this);
+        });
+        this.__callback({"obj": obj});
+      },
+      clean_node: function (obj) {
+        obj = obj && obj != -1 ? $(obj) : this.get_container();
+        obj = obj.is("li") ? obj.find("li").andSelf() : obj.find("li");
+        obj.removeClass("jstree-last")
+        .filter("li:last-child").addClass("jstree-last").end()
+        .filter(":has(li)")
+        .not(".jstree-open").removeClass("jstree-leaf").addClass(
+            "jstree-closed");
+        obj.not(".jstree-open, .jstree-closed").addClass(
+            "jstree-leaf").children("ul").remove();
+        this.__callback({"obj": obj});
+      },
+      // rollback
+      get_rollback: function () {
+        this.__callback();
+        return {
+          i: this.get_index(),
+          h: this.get_container().children("ul").clone(true),
+          d: this.data
+        };
+      },
+      set_rollback: function (html, data) {
+        this.get_container().empty().append(html);
+        this.data = data;
+        this.__callback();
+      },
+      // Dummy functions to be overwritten by any datastore plugin included
+      load_node: function (obj, s_call, e_call) {
+        this.__callback({"obj": obj});
+      },
+      _is_loaded: function (obj) {
+        return true;
+      },
+
+      // Basic operations: create
+      create_node: function (obj, position, js, callback, is_loaded) {
+        obj = this._get_node(obj);
+        position = typeof position === "undefined" ? "last" : position;
+        var d = $("<li>"),
+            s = this._get_settings().core,
+            tmp;
+
+        if (obj !== -1 && !obj.length) {
+          return false;
+        }
+        if (!is_loaded && !this._is_loaded(obj)) {
+          this.load_node(obj, function () {
+            this.create_node(obj, position, js, callback, true);
+          });
+          return false;
+        }
+
+        this.__rollback();
+
+        if (typeof js === "string") {
+          js = {"data": js};
+        }
+        if (!js) {
+          js = {};
+        }
+        if (js.attr) {
+          d.attr(js.attr);
+        }
+        if (js.state) {
+          d.addClass("jstree-" + js.state);
+        }
+        if (!js.data) {
+          js.data = s.strings.new_node;
+        }
+        if (!$.isArray(js.data)) {
+          tmp = js.data;
+          js.data = [];
+          js.data.push(tmp);
+        }
+        $.each(js.data, function (i, m) {
+          tmp = $("<a>");
+          if ($.isFunction(m)) {
+            m = m.call(this, js);
+          }
+          if (typeof m == "string") {
+            tmp.attr('href', '#')[s.html_titles ? "html" : "text"](m);
+          }
+          else {
+            if (!m.attr) {
+              m.attr = {};
+            }
+            if (!m.attr.href) {
+              m.attr.href = '#';
+            }
+            tmp.attr(m.attr)[s.html_titles ? "html" : "text"](m.title);
+            if (m.language) {
+              tmp.addClass(m.language);
+            }
+          }
+          tmp.prepend("<ins class='jstree-icon'>&#160;</ins>");
+          if (m.icon) {
+            if (m.icon.indexOf("/") === -1) {
+              tmp.children("ins").addClass(m.icon);
+            }
+            else {
+              tmp.children("ins").css("background", "url('" + m.icon
+                  + "') center center no-repeat");
+            }
+          }
+          d.append(tmp);
+        });
+        d.prepend("<ins class='jstree-icon'>&#160;</ins>");
+        if (obj === -1) {
+          obj = this.get_container();
+          if (position === "before") {
+            position = "first";
+          }
+          if (position === "after") {
+            position = "last";
+          }
+        }
+        switch (position) {
+          case "before":
+            obj.before(d);
+            tmp = this._get_parent(obj);
+            break;
+          case "after" :
+            obj.after(d);
+            tmp = this._get_parent(obj);
+            break;
+          case "inside":
+          case "first" :
+            if (!obj.children("ul").length) {
+              obj.append("<ul>");
+            }
+            obj.children("ul").prepend(d);
+            tmp = obj;
+            break;
+          case "last":
+            if (!obj.children("ul").length) {
+              obj.append("<ul>");
+            }
+            obj.children("ul").append(d);
+            tmp = obj;
+            break;
+          default:
+            if (!obj.children("ul").length) {
+              obj.append("<ul>");
+            }
+            if (!position) {
+              position = 0;
+            }
+            tmp = obj.children("ul").children("li").eq(position);
+            if (tmp.length) {
+              tmp.before(d);
+            }
+            else {
+              obj.children("ul").append(d);
+            }
+            tmp = obj;
+            break;
+        }
+        if (tmp === -1 || tmp.get(0) === this.get_container().get(0)) {
+          tmp = -1;
+        }
+        this.clean_node(tmp);
+        this.__callback({"obj": d, "parent": tmp});
+        if (callback) {
+          callback.call(this, d);
+        }
+        return d;
+      },
+      // Basic operations: rename (deal with text)
+      get_text: function (obj) {
+        obj = this._get_node(obj);
+        if (!obj.length) {
+          return false;
+        }
+        var s = this._get_settings().core.html_titles;
+        obj = obj.children("a:eq(0)");
+        if (s) {
+          obj = obj.clone();
+          obj.children("INS").remove();
+          return obj.html();
+        }
+        else {
+          obj = obj.contents().filter(function () {
+            return this.nodeType == 3;
+          })[0];
+          return obj.nodeValue;
+        }
+      },
+      set_text: function (obj, val) {
+        obj = this._get_node(obj);
+        if (!obj.length) {
+          return false;
+        }
+        obj = obj.children("a:eq(0)");
+        if (this._get_settings().core.html_titles) {
+          var tmp = obj.children("INS").clone();
+          obj.html(val).prepend(tmp);
+          this.__callback({"obj": obj, "name": val});
+          return true;
+        }
+        else {
+          obj = obj.contents().filter(function () {
+            return this.nodeType == 3;
+          })[0];
+          this.__callback({"obj": obj, "name": val});
+          return (obj.nodeValue = val);
+        }
+      },
+      rename_node: function (obj, val) {
+        obj = this._get_node(obj);
+        this.__rollback();
+        if (obj && obj.length && this.set_text.apply(this,
+                Array.prototype.slice.call(arguments))) {
+          this.__callback({"obj": obj, "name": val});
+        }
+      },
+      // Basic operations: deleting nodes
+      delete_node: function (obj) {
+        obj = this._get_node(obj);
+        if (!obj.length) {
+          return false;
+        }
+        this.__rollback();
+        var p = this._get_parent(obj), prev = this._get_prev(obj);
+        obj = obj.remove();
+        if (p !== -1 && p.find("> ul > li").length === 0) {
+          p.removeClass("jstree-open jstree-closed").addClass("jstree-leaf");
+        }
+        this.clean_node(p);
+        this.__callback({"obj": obj, "prev": prev});
+        return obj;
+      },
+      prepare_move: function (o, r, pos, cb, is_cb) {
+        var p = {};
+
+        p.ot = $.jstree._reference(p.o) || this;
+        p.o = p.ot._get_node(o);
+        p.r = r === -1 ? -1 : this._get_node(r);
+        p.p = (typeof p === "undefined") ? "last" : pos; // TODO: move to a setting
+        if (!is_cb && prepared_move.o && prepared_move.o[0] === p.o[0]
+            && prepared_move.r[0] === p.r[0] && prepared_move.p === p.p) {
+          this.__callback(prepared_move);
+          if (cb) {
+            cb.call(this, prepared_move);
+          }
+          return;
+        }
+        p.ot = $.jstree._reference(p.o) || this;
+        p.rt = r === -1 ? p.ot : $.jstree._reference(p.r) || this;
+        if (p.r === -1) {
+          p.cr = -1;
+          switch (p.p) {
+            case "first":
+            case "before":
+            case "inside":
+              p.cp = 0;
+              break;
+            case "after":
+            case "last":
+              p.cp = p.rt.get_container().find(" > ul > li").length;
+              break;
+            default:
+              p.cp = p.p;
+              break;
+          }
+        }
+        else {
+          if (!/^(before|after)$/.test(p.p) && !this._is_loaded(p.r)) {
+            return this.load_node(p.r, function () {
+              this.prepare_move(o, r, pos, cb, true);
+            });
+          }
+          switch (p.p) {
+            case "before":
+              p.cp = p.r.index();
+              p.cr = p.rt._get_parent(p.r);
+              break;
+            case "after":
+              p.cp = p.r.index() + 1;
+              p.cr = p.rt._get_parent(p.r);
+              break;
+            case "inside":
+            case "first":
+              p.cp = 0;
+              p.cr = p.r;
+              break;
+            case "last":
+              p.cp = p.r.find(" > ul > li").length;
+              p.cr = p.r;
+              break;
+            default:
+              p.cp = p.p;
+              p.cr = p.r;
+              break;
+          }
+        }
+        p.np = p.cr == -1 ? p.rt.get_container() : p.cr;
+        p.op = p.ot._get_parent(p.o);
+        p.or = p.np.find(" > ul > li:nth-child(" + (p.cp + 1) + ")");
+
+        prepared_move = p;
+        this.__callback(prepared_move);
+        if (cb) {
+          cb.call(this, prepared_move);
+        }
+      },
+      check_move: function () {
+        var obj = prepared_move, ret = true;
+        if (obj.or[0] === obj.o[0]) {
+          return false;
+        }
+        obj.o.each(function () {
+          if (obj.r.parentsUntil(".jstree").andSelf().filter("li").index(this)
+              !== -1) {
+            ret = false;
+            return false;
+          }
+        });
+        return ret;
+      },
+      move_node: function (obj, ref, position, is_copy, is_prepared,
+          skip_check) {
+        if (!is_prepared) {
+          return this.prepare_move(obj, ref, position, function (p) {
+            this.move_node(p, false, false, is_copy, true, skip_check);
+          });
+        }
+        if (!skip_check && !this.check_move()) {
+          return false;
+        }
+
+        this.__rollback();
+        var o = false;
+        if (is_copy) {
+          o = obj.o.clone();
+          o.find("*[id]").andSelf().each(function () {
+            if (this.id) {
+              this.id = "copy_" + this.id;
+            }
+          });
+        }
+        else {
+          o = obj.o;
+        }
+
+        if (obj.or.length) {
+          obj.or.before(o);
+        }
+        else {
+          if (!obj.np.children("ul").length) {
+            $("<ul>").appendTo(obj.np);
+          }
+          obj.np.children("ul:eq(0)").append(o);
+        }
+
+        try {
+          obj.ot.clean_node(obj.op);
+          obj.rt.clean_node(obj.np);
+          if (!obj.op.find("> ul > li").length) {
+            obj.op.removeClass("jstree-open jstree-closed").addClass(
+                "jstree-leaf").children("ul").remove();
+          }
+        } catch (e) {
+        }
+
+        if (is_copy) {
+          prepared_move.cy = true;
+          prepared_move.oc = o;
+        }
+        this.__callback(prepared_move);
+        return prepared_move;
+      },
+      _get_move: function () {
+        return prepared_move;
+      }
+    }
+  });
 })(jQuery);
 //*/
 
-/* 
+/*
  * jsTree ui plugin 1.0
  * This plugins handles selecting/deselecting/hovering/dehovering nodes
  */
 (function ($) {
-	$.jstree.plugin("ui", {
-		__init : function () { 
-			this.data.ui.selected = $(); 
-			this.data.ui.last_selected = false; 
-			this.data.ui.hovered = null;
-			this.data.ui.to_select = this.get_settings().ui.initially_select;
-
-			this.get_container()
-				.delegate("a", "click.jstree", $.proxy(function (event) {
-						event.preventDefault();
-						this.select_node(event.currentTarget, true, event);
-					}, this))
-				.delegate("a", "mouseenter.jstree", $.proxy(function (event) {
-						this.hover_node(event.target);
-					}, this))
-				.delegate("a", "mouseleave.jstree", $.proxy(function (event) {
-						this.dehover_node(event.target);
-					}, this))
-				.bind("reopen.jstree", $.proxy(function () { 
-						this.reselect();
-					}, this))
-				.bind("get_rollback.jstree", $.proxy(function () { 
-						this.dehover_node();
-						this.save_selected();
-					}, this))
-				.bind("set_rollback.jstree", $.proxy(function () { 
-						this.reselect();
-					}, this))
-				.bind("close_node.jstree", $.proxy(function (event, data) { 
-						var s = this._get_settings().ui,
-							obj = this._get_node(data.rslt.obj),
-							clk = (obj && obj.length) ? obj.children("ul").find(".jstree-clicked") : $(),
-							_this = this;
-						if(s.selected_parent_close === false || !clk.length) { return; }
-						clk.each(function () { 
-							_this.deselect_node(this);
-							if(s.selected_parent_close === "select_parent") { _this.select_node(obj); }
-						});
-					}, this))
-				.bind("delete_node.jstree", $.proxy(function (event, data) { 
-						var s = this._get_settings().ui.select_prev_on_delete,
-							obj = this._get_node(data.rslt.obj),
-							clk = (obj && obj.length) ? obj.find(".jstree-clicked") : [],
-							_this = this;
-						clk.each(function () { _this.deselect_node(this); });
-						if(s && clk.length) { this.select_node(data.rslt.prev); }
-					}, this))
-				.bind("move_node.jstree", $.proxy(function (event, data) { 
-						if(data.rslt.cy) { 
-							data.rslt.oc.find(".jstree-clicked").removeClass("jstree-clicked");
-						}
-					}, this));
-		},
-		defaults : {
-			select_limit : -1, // 0, 1, 2 ... or -1 for unlimited
-			select_multiple_modifier : "ctrl", // on, or ctrl, shift, alt
-			selected_parent_close : "select_parent", // false, "deselect", "select_parent"
-			select_prev_on_delete : true,
-			disable_selecting_children : false,
-			initially_select : []
-		},
-		_fn : { 
-			_get_node : function (obj, allow_multiple) {
-				if(typeof obj === "undefined" || obj === null) { return allow_multiple ? this.data.ui.selected : this.data.ui.last_selected; }
-				var $obj = $(obj, this.get_container()); 
-				if($obj.is(".jstree") || obj == -1) { return -1; } 
-				$obj = $obj.closest("li", this.get_container()); 
-				return $obj.length ? $obj : false; 
-			},
-			save_selected : function () {
-				var _this = this;
-				this.data.ui.to_select = [];
-				this.data.ui.selected.each(function () { _this.data.ui.to_select.push("#" + this.id.toString().replace(/^#/,"").replace('\\/','/').replace('/','\\/')); });
-				this.__callback(this.data.ui.to_select);
-			},
-			reselect : function () {
-				var _this = this,
-					s = this.data.ui.to_select;
-				s = $.map($.makeArray(s), function (n) { return "#" + n.toString().replace(/^#/,"").replace('\\/','/').replace('/','\\/'); });
-				this.deselect_all();
-				$.each(s, function (i, val) { if(val && val !== "#") { _this.select_node(val); } });
-				this.__callback();
-			},
-			refresh : function (obj) {
-				this.save_selected();
-				return this.__call_old();
-			},
-			hover_node : function (obj) {
-				obj = this._get_node(obj);
-				if(!obj.length) { return false; }
-				//if(this.data.ui.hovered && obj.get(0) === this.data.ui.hovered.get(0)) { return; }
-				if(!obj.hasClass("jstree-hovered")) { this.dehover_node(); }
-				this.data.ui.hovered = obj.children("a").addClass("jstree-hovered").parent();
-				this.__callback({ "obj" : obj });
-			},
-			dehover_node : function () {
-				var obj = this.data.ui.hovered, p;
-				if(!obj || !obj.length) { return false; }
-				p = obj.children("a").removeClass("jstree-hovered").parent();
-				if(this.data.ui.hovered[0] === p[0]) { this.data.ui.hovered = null; }
-				this.__callback({ "obj" : obj });
-			},
-			select_node : function (obj, check, e) {
-				obj = this._get_node(obj);
-				if(obj == -1 || !obj || !obj.length) { return false; }
-				var s = this._get_settings().ui,
-					is_multiple = (s.select_multiple_modifier == "on" || (s.select_multiple_modifier !== false && e && e[s.select_multiple_modifier + "Key"])),
-					is_selected = this.is_selected(obj),
-					proceed = true;
-				if(check) {
-					if(s.disable_selecting_children && is_multiple && obj.parents("li", this.get_container()).children(".jstree-clicked").length) {
-						return false;
-					}
-					proceed = false;
-					switch(!0) {
-						case (is_selected && !is_multiple): 
-							this.deselect_all();
-							is_selected = false;
-							proceed = true;
-							break;
-						case (!is_selected && !is_multiple): 
-							if(s.select_limit == -1 || s.select_limit > 0) {
-								this.deselect_all();
-								proceed = true;
-							}
-							break;
-						case (is_selected && is_multiple): 
-							this.deselect_node(obj);
-							break;
-						case (!is_selected && is_multiple): 
-							if(s.select_limit == -1 || this.data.ui.selected.length + 1 <= s.select_limit) { 
-								proceed = true;
-							}
-							break;
-					}
-				}
-				if(proceed && !is_selected) {
-					obj.children("a").addClass("jstree-clicked");
-					this.data.ui.selected = this.data.ui.selected.add(obj);
-					this.data.ui.last_selected = obj;
-					this.__callback({ "obj" : obj });
-				}
-			},
-			deselect_node : function (obj) {
-				obj = this._get_node(obj);
-				if(!obj.length) { return false; }
-				if(this.is_selected(obj)) {
-					obj.children("a").removeClass("jstree-clicked");
-					this.data.ui.selected = this.data.ui.selected.not(obj);
-					if(this.data.ui.last_selected.get(0) === obj.get(0)) { this.data.ui.last_selected = this.data.ui.selected.eq(0); }
-					this.__callback({ "obj" : obj });
-				}
-			},
-			toggle_select : function (obj) {
-				obj = this._get_node(obj);
-				if(!obj.length) { return false; }
-				if(this.is_selected(obj)) { this.deselect_node(obj); }
-				else { this.select_node(obj); }
-			},
-			is_selected : function (obj) { return this.data.ui.selected.index(this._get_node(obj)) >= 0; },
-			get_selected : function (context) { 
-				return context ? $(context).find(".jstree-clicked").parent() : this.data.ui.selected; 
-			},
-			deselect_all : function (context) {
-				if(context) { $(context).find(".jstree-clicked").removeClass("jstree-clicked"); } 
-				else { this.get_container().find(".jstree-clicked").removeClass("jstree-clicked"); }
-				this.data.ui.selected = $([]);
-				this.data.ui.last_selected = false;
-				this.__callback();
-			}
-		}
-	});
-	// include the selection plugin by default
-	$.jstree.defaults.plugins.push("ui");
+  $.jstree.plugin("ui", {
+    __init: function () {
+      this.data.ui.selected = $();
+      this.data.ui.last_selected = false;
+      this.data.ui.hovered = null;
+      this.data.ui.to_select = this.get_settings().ui.initially_select;
+
+      this.get_container()
+      .delegate("a", "click.jstree", $.proxy(function (event) {
+        event.preventDefault();
+        this.select_node(event.currentTarget, true, event);
+      }, this))
+      .delegate("a", "mouseenter.jstree", $.proxy(function (event) {
+        this.hover_node(event.target);
+      }, this))
+      .delegate("a", "mouseleave.jstree", $.proxy(function (event) {
+        this.dehover_node(event.target);
+      }, this))
+      .bind("reopen.jstree", $.proxy(function () {
+        this.reselect();
+      }, this))
+      .bind("get_rollback.jstree", $.proxy(function () {
+        this.dehover_node();
+        this.save_selected();
+      }, this))
+      .bind("set_rollback.jstree", $.proxy(function () {
+        this.reselect();
+      }, this))
+      .bind("close_node.jstree", $.proxy(function (event, data) {
+        var s = this._get_settings().ui,
+            obj = this._get_node(data.rslt.obj),
+            clk = (obj && obj.length) ? obj.children("ul").find(
+                ".jstree-clicked") : $(),
+            _this = this;
+        if (s.selected_parent_close === false || !clk.length) {
+          return;
+        }
+        clk.each(function () {
+          _this.deselect_node(this);
+          if (s.selected_parent_close === "select_parent") {
+            _this.select_node(obj);
+          }
+        });
+      }, this))
+      .bind("delete_node.jstree", $.proxy(function (event, data) {
+        var s = this._get_settings().ui.select_prev_on_delete,
+            obj = this._get_node(data.rslt.obj),
+            clk = (obj && obj.length) ? obj.find(".jstree-clicked") : [],
+            _this = this;
+        clk.each(function () {
+          _this.deselect_node(this);
+        });
+        if (s && clk.length) {
+          this.select_node(data.rslt.prev);
+        }
+      }, this))
+      .bind("move_node.jstree", $.proxy(function (event, data) {
+        if (data.rslt.cy) {
+          data.rslt.oc.find(".jstree-clicked").removeClass("jstree-clicked");
+        }
+      }, this));
+    },
+    defaults: {
+      select_limit: -1, // 0, 1, 2 ... or -1 for unlimited
+      select_multiple_modifier: "ctrl", // on, or ctrl, shift, alt
+      selected_parent_close: "select_parent", // false, "deselect", "select_parent"
+      select_prev_on_delete: true,
+      disable_selecting_children: false,
+      initially_select: []
+    },
+    _fn: {
+      _get_node: function (obj, allow_multiple) {
+        if (typeof obj === "undefined" || obj === null) {
+          return allow_multiple ? this.data.ui.selected
+              : this.data.ui.last_selected;
+        }
+        var $obj = $(obj, this.get_container());
+        if ($obj.is(".jstree") || obj == -1) {
+          return -1;
+        }
+        $obj = $obj.closest("li", this.get_container());
+        return $obj.length ? $obj : false;
+      },
+      save_selected: function () {
+        var _this = this;
+        this.data.ui.to_select = [];
+        this.data.ui.selected.each(function () {
+          _this.data.ui.to_select.push("#" + this.id.toString().replace(/^#/,
+              "").replace('\\/', '/').replace('/', '\\/'));
+        });
+        this.__callback(this.data.ui.to_select);
+      },
+      reselect: function () {
+        var _this = this,
+            s = this.data.ui.to_select;
+        s = $.map($.makeArray(s), function (n) {
+          return "#" + n.toString().replace(/^#/, "").replace('\\/',
+              '/').replace('/', '\\/');
+        });
+        this.deselect_all();
+        $.each(s, function (i, val) {
+          if (val && val !== "#") {
+            _this.select_node(val);
+          }
+        });
+        this.__callback();
+      },
+      refresh: function (obj) {
+        this.save_selected();
+        return this.__call_old();
+      },
+      hover_node: function (obj) {
+        obj = this._get_node(obj);
+        if (!obj.length) {
+          return false;
+        }
+        //if(this.data.ui.hovered && obj.get(0) === this.data.ui.hovered.get(0)) { return; }
+        if (!obj.hasClass("jstree-hovered")) {
+          this.dehover_node();
+        }
+        this.data.ui.hovered = obj.children("a").addClass(
+            "jstree-hovered").parent();
+        this.__callback({"obj": obj});
+      },
+      dehover_node: function () {
+        var obj = this.data.ui.hovered, p;
+        if (!obj || !obj.length) {
+          return false;
+        }
+        p = obj.children("a").removeClass("jstree-hovered").parent();
+        if (this.data.ui.hovered[0] === p[0]) {
+          this.data.ui.hovered = null;
+        }
+        this.__callback({"obj": obj});
+      },
+      select_node: function (obj, check, e) {
+        obj = this._get_node(obj);
+        if (obj == -1 || !obj || !obj.length) {
+          return false;
+        }
+        var s = this._get_settings().ui,
+            is_multiple = (s.select_multiple_modifier == "on"
+                || (s.select_multiple_modifier !== false && e
+                    && e[s.select_multiple_modifier + "Key"])),
+            is_selected = this.is_selected(obj),
+            proceed = true;
+        if (check) {
+          if (s.disable_selecting_children && is_multiple && obj.parents("li",
+                  this.get_container()).children(".jstree-clicked").length) {
+            return false;
+          }
+          proceed = false;
+          switch (!0) {
+            case (is_selected && !is_multiple):
+              this.deselect_all();
+              is_selected = false;
+              proceed = true;
+              break;
+            case (!is_selected && !is_multiple):
+              if (s.select_limit == -1 || s.select_limit > 0) {
+                this.deselect_all();
+                proceed = true;
+              }
+              break;
+            case (is_selected && is_multiple):
+              this.deselect_node(obj);
+              break;
+            case (!is_selected && is_multiple):
+              if (s.select_limit == -1 || this.data.ui.selected.length + 1
+                  <= s.select_limit) {
+                proceed = true;
+              }
+              break;
+          }
+        }
+        if (proceed && !is_selected) {
+          obj.children("a").addClass("jstree-clicked");
+          this.data.ui.selected = this.data.ui.selected.add(obj);
+          this.data.ui.last_selected = obj;
+          this.__callback({"obj": obj});
+        }
+      },
+      deselect_node: function (obj) {
+        obj = this._get_node(obj);
+        if (!obj.length) {
+          return false;
+        }
+        if (this.is_selected(obj)) {
+          obj.children("a").removeClass("jstree-clicked");
+          this.data.ui.selected = this.data.ui.selected.not(obj);
+          if (this.data.ui.last_selected.get(0) === obj.get(0)) {
+            this.data.ui.last_selected = this.data.ui.selected.eq(0);
+          }
+          this.__callback({"obj": obj});
+        }
+      },
+      toggle_select: function (obj) {
+        obj = this._get_node(obj);
+        if (!obj.length) {
+          return false;
+        }
+        if (this.is_selected(obj)) {
+          this.deselect_node(obj);
+        }
+        else {
+          this.select_node(obj);
+        }
+      },
+      is_selected: function (obj) {
+        return this.data.ui.selected.index(this._get_node(obj)) >= 0;
+      },
+      get_selected: function (context) {
+        return context ? $(context).find(".jstree-clicked").parent()
+            : this.data.ui.selected;
+      },
+      deselect_all: function (context) {
+        if (context) {
+          $(context).find(".jstree-clicked").removeClass("jstree-clicked");
+        }
+        else {
+          this.get_container().find(".jstree-clicked").removeClass(
+              "jstree-clicked");
+        }
+        this.data.ui.selected = $([]);
+        this.data.ui.last_selected = false;
+        this.__callback();
+      }
+    }
+  });
+  // include the selection plugin by default
+  $.jstree.defaults.plugins.push("ui");
 })(jQuery);
 //*/
 
-/* 
+/*
  * jsTree CRRM plugin 1.0
  * Handles creating/renaming/removing/moving nodes by user interaction.
  */
 (function ($) {
-	$.jstree.plugin("crrm", { 
-		__init : function () {
-			this.get_container()
-				.bind("move_node.jstree", $.proxy(function (e, data) {
-					if(this._get_settings().crrm.move.open_onmove) {
-						var t = this;
-						data.rslt.np.parentsUntil(".jstree").andSelf().filter(".jstree-closed").each(function () {
-							t.open_node(this, false, true);
-						});
-					}
-				}, this));
-		},
-		defaults : {
-			input_width_limit : 200,
-			move : {
-				always_copy			: false, // false, true or "multitree"
-				open_onmove			: true,
-				default_position	: "last",
-				check_move			: function (m) { return true; }
-			}
-		},
-		_fn : {
-			_show_input : function (obj, callback) {
-				obj = this._get_node(obj);
-				var rtl = this._get_settings().core.rtl,
-					w = this._get_settings().crrm.input_width_limit,
-					w1 = obj.children("ins").width(),
-					w2 = obj.find("> a:visible > ins").width() * obj.find("> a:visible > ins").length,
-					t = this.get_text(obj),
-					h1 = $("<div>", { css : { "position" : "absolute", "top" : "-200px", "left" : (rtl ? "0px" : "-1000px"), "visibility" : "hidden" } }).appendTo("body"),
-					h2 = obj.css("position","relative").append(
-					$("<input>", { 
-						"value" : t,
-						// "size" : t.length,
-						"css" : {
-							"padding" : "0",
-							"border" : "1px solid silver",
-							"position" : "absolute",
-							"left"  : (rtl ? "auto" : (w1 + w2 + 4) + "px"),
-							"right" : (rtl ? (w1 + w2 + 4) + "px" : "auto"),
-							"top" : "0px",
-							"height" : (this.data.core.li_height - 2) + "px",
-							"lineHeight" : (this.data.core.li_height - 2) + "px",
-							"width" : "150px" // will be set a bit further down
-						},
-						"blur" : $.proxy(function () {
-							var i = obj.children("input"),
-								v = i.val();
-							if(v === "") { v = t; }
-							i.remove(); // rollback purposes
-							this.set_text(obj,t); // rollback purposes
-							this.rename_node(obj, v);
-							callback.call(this, obj, v, t);
-							obj.css("position","");
-						}, this),
-						"keyup" : function (event) {
-							var key = event.keyCode || event.which;
-							if(key == 27) { this.value = t; this.blur(); return; }
-							else if(key == 13) { this.blur(); return; }
-							else {
-								h2.width(Math.min(h1.text("pW" + this.value).width(),w));
-							}
-						}
-					})
-				).children("input"); 
-				this.set_text(obj, "");
-				h1.css({
-						fontFamily		: h2.css('fontFamily')		|| '',
-						fontSize		: h2.css('fontSize')		|| '',
-						fontWeight		: h2.css('fontWeight')		|| '',
-						fontStyle		: h2.css('fontStyle')		|| '',
-						fontStretch		: h2.css('fontStretch')		|| '',
-						fontVariant		: h2.css('fontVariant')		|| '',
-						letterSpacing	: h2.css('letterSpacing')	|| '',
-						wordSpacing		: h2.css('wordSpacing')		|| ''
-				});
-				h2.width(Math.min(h1.text("pW" + h2[0].value).width(),w))[0].select();
-			},
-			rename : function (obj) {
-				obj = this._get_node(obj);
-				this.__rollback();
-				var f = this.__callback;
-				this._show_input(obj, function (obj, new_name, old_name) { 
-					f.call(this, { "obj" : obj, "new_name" : new_name, "old_name" : old_name });
-				});
-			},
-			create : function (obj, position, js, callback, skip_rename) {
-				var t, _this = this;
-				obj = this._get_node(obj);
-				if(!obj) { obj = -1; }
-				this.__rollback();
-				t = this.create_node(obj, position, js, function (t) {
-					var p = this._get_parent(t),
-						pos = $(t).index();
-					if(callback) { callback.call(this, t); }
-					if(p.length && p.hasClass("jstree-closed")) { this.open_node(p, false, true); }
-					if(!skip_rename) { 
-						this._show_input(t, function (obj, new_name, old_name) { 
-							_this.__callback({ "obj" : obj, "name" : new_name, "parent" : p, "position" : pos });
-						});
-					}
-					else { _this.__callback({ "obj" : t, "name" : this.get_text(t), "parent" : p, "position" : pos }); }
-				});
-				return t;
-			},
-			remove : function (obj) {
-				obj = this._get_node(obj, true);
-				this.__rollback();
-				this.delete_node(obj);
-				this.__callback({ "obj" : obj });
-			},
-			check_move : function () {
-				if(!this.__call_old()) { return false; }
-				var s = this._get_settings().crrm.move;
-				if(!s.check_move.call(this, this._get_move())) { return false; }
-				return true;
-			},
-			move_node : function (obj, ref, position, is_copy, is_prepared, skip_check) {
-				var s = this._get_settings().crrm.move;
-				if(!is_prepared) { 
-					if(!position) { position = s.default_position; }
-					if(position === "inside" && !s.default_position.match(/^(before|after)$/)) { position = s.default_position; }
-					return this.__call_old(true, obj, ref, position, is_copy, false, skip_check);
-				}
-				// if the move is already prepared
-				if(s.always_copy === true || (s.always_copy === "multitree" && obj.rt.get_index() !== obj.ot.get_index() )) {
-					is_copy = true;
-				}
-				this.__call_old(true, obj, ref, position, is_copy, true, skip_check);
-			},
-
-			cut : function (obj) {
-				obj = this._get_node(obj);
-				this.data.crrm.cp_nodes = false;
-				this.data.crrm.ct_nodes = false;
-				if(!obj || !obj.length) { return false; }
-				this.data.crrm.ct_nodes = obj;
-			},
-			copy : function (obj) {
-				obj = this._get_node(obj);
-				this.data.crrm.cp_nodes = false;
-				this.data.crrm.ct_nodes = false;
-				if(!obj || !obj.length) { return false; }
-				this.data.crrm.cp_nodes = obj;
-			},
-			paste : function (obj) { 
-				obj = this._get_node(obj);
-				if(!obj || !obj.length) { return false; }
-				if(!this.data.crrm.ct_nodes && !this.data.crrm.cp_nodes) { return false; }
-				if(this.data.crrm.ct_nodes) { this.move_node(this.data.crrm.ct_nodes, obj); }
-				if(this.data.crrm.cp_nodes) { this.move_node(this.data.crrm.cp_nodes, obj, false, true); }
-				this.data.crrm.cp_nodes = false;
-				this.data.crrm.ct_nodes = false;
-			}
-		}
-	});
-	// include the crr plugin by default
-	$.jstree.defaults.plugins.push("crrm");
+  $.jstree.plugin("crrm", {
+    __init: function () {
+      this.get_container()
+      .bind("move_node.jstree", $.proxy(function (e, data) {
+        if (this._get_settings().crrm.move.open_onmove) {
+          var t = this;
+          data.rslt.np.parentsUntil(".jstree").andSelf().filter(
+              ".jstree-closed").each(function () {
+            t.open_node(this, false, true);
+          });
+        }
+      }, this));
+    },
+    defaults: {
+      input_width_limit: 200,
+      move: {
+        always_copy: false, // false, true or "multitree"
+        open_onmove: true,
+        default_position: "last",
+        check_move: function (m) {
+          return true;
+        }
+      }
+    },
+    _fn: {
+      _show_input: function (obj, callback) {
+        obj = this._get_node(obj);
+        var rtl = this._get_settings().core.rtl,
+            w = this._get_settings().crrm.input_width_limit,
+            w1 = obj.children("ins").width(),
+            w2 = obj.find("> a:visible > ins").width() * obj.find(
+                "> a:visible > ins").length,
+            t = this.get_text(obj),
+            h1 = $("<div>", {
+              css: {
+                "position": "absolute",
+                "top": "-200px",
+                "left": (rtl ? "0px" : "-1000px"),
+                "visibility": "hidden"
+              }
+            }).appendTo("body"),
+            h2 = obj.css("position", "relative").append(
+                $("<input>", {
+                  "value": t,
+                  // "size" : t.length,
+                  "css": {
+                    "padding": "0",
+                    "border": "1px solid silver",
+                    "position": "absolute",
+                    "left": (rtl ? "auto" : (w1 + w2 + 4) + "px"),
+                    "right": (rtl ? (w1 + w2 + 4) + "px" : "auto"),
+                    "top": "0px",
+                    "height": (this.data.core.li_height - 2) + "px",
+                    "lineHeight": (this.data.core.li_height - 2) + "px",
+                    "width": "150px" // will be set a bit further down
+                  },
+                  "blur": $.proxy(function () {
+                    var i = obj.children("input"),
+                        v = i.val();
+                    if (v === "") {
+                      v = t;
+                    }
+                    i.remove(); // rollback purposes
+                    this.set_text(obj, t); // rollback purposes
+                    this.rename_node(obj, v);
+                    callback.call(this, obj, v, t);
+                    obj.css("position", "");
+                  }, this),
+                  "keyup": function (event) {
+                    var key = event.keyCode || event.which;
+                    if (key == 27) {
+                      this.value = t;
+                      this.blur();
+                      return;
+                    }
+                    else if (key == 13) {
+                      this.blur();
+                      return;
+                    }
+                    else {
+                      h2.width(Math.min(h1.text("pW" + this.value).width(), w));
+                    }
+                  }
+                })
+            ).children("input");
+        this.set_text(obj, "");
+        h1.css({
+          fontFamily: h2.css('fontFamily') || '',
+          fontSize: h2.css('fontSize') || '',
+          fontWeight: h2.css('fontWeight') || '',
+          fontStyle: h2.css('fontStyle') || '',
+          fontStretch: h2.css('fontStretch') || '',
+          fontVariant: h2.css('fontVariant') || '',
+          letterSpacing: h2.css('letterSpacing') || '',
+          wordSpacing: h2.css('wordSpacing') || ''
+        });
+        h2.width(Math.min(h1.text("pW" + h2[0].value).width(), w))[0].select();
+      },
+      rename: function (obj) {
+        obj = this._get_node(obj);
+        this.__rollback();
+        var f = this.__callback;
+        this._show_input(obj, function (obj, new_name, old_name) {
+          f.call(this,
+              {"obj": obj, "new_name": new_name, "old_name": old_name});
+        });
+      },
+      create: function (obj, position, js, callback, skip_rename) {
+        var t, _this = this;
+        obj = this._get_node(obj);
+        if (!obj) {
+          obj = -1;
+        }
+        this.__rollback();
+        t = this.create_node(obj, position, js, function (t) {
+          var p = this._get_parent(t),
+              pos = $(t).index();
+          if (callback) {
+            callback.call(this, t);
+          }
+          if (p.length && p.hasClass("jstree-closed")) {
+            this.open_node(p, false, true);
+          }
+          if (!skip_rename) {
+            this._show_input(t, function (obj, new_name, old_name) {
+              _this.__callback(
+                  {"obj": obj, "name": new_name, "parent": p, "position": pos});
+            });
+          }
+          else {
+            _this.__callback({
+              "obj": t,
+              "name": this.get_text(t),
+              "parent": p,
+              "position": pos
+            });
+          }
+        });
+        return t;
+      },
+      remove: function (obj) {
+        obj = this._get_node(obj, true);
+        this.__rollback();
+        this.delete_node(obj);
+        this.__callback({"obj": obj});
+      },
+      check_move: function () {
+        if (!this.__call_old()) {
+          return false;
+        }
+        var s = this._get_settings().crrm.move;
+        if (!s.check_move.call(this, this._get_move())) {
+          return false;
+        }
+        return true;
+      },
+      move_node: function (obj, ref, position, is_copy, is_prepared,
+          skip_check) {
+        var s = this._get_settings().crrm.move;
+        if (!is_prepared) {
+          if (!position) {
+            position = s.default_position;
+          }
+          if (position === "inside" && !s.default_position.match(
+                  /^(before|after)$/)) {
+            position = s.default_position;
+          }
+          return this.__call_old(true, obj, ref, position, is_copy, false,
+              skip_check);
+        }
+        // if the move is already prepared
+        if (s.always_copy === true || (s.always_copy === "multitree"
+                && obj.rt.get_index() !== obj.ot.get_index() )) {
+          is_copy = true;
+        }
+        this.__call_old(true, obj, ref, position, is_copy, true, skip_check);
+      },
+
+      cut: function (obj) {
+        obj = this._get_node(obj);
+        this.data.crrm.cp_nodes = false;
+        this.data.crrm.ct_nodes = false;
+        if (!obj || !obj.length) {
+          return false;
+        }
+        this.data.crrm.ct_nodes = obj;
+      },
+      copy: function (obj) {
+        obj = this._get_node(obj);
+        this.data.crrm.cp_nodes = false;
+        this.data.crrm.ct_nodes = false;
+        if (!obj || !obj.length) {
+          return false;
+        }
+        this.data.crrm.cp_nodes = obj;
+      },
+      paste: function (obj) {
+        obj = this._get_node(obj);
+        if (!obj || !obj.length) {
+          return false;
+        }
+        if (!this.data.crrm.ct_nodes && !this.data.crrm.cp_nodes) {
+          return false;
+        }
+        if (this.data.crrm.ct_nodes) {
+          this.move_node(this.data.crrm.ct_nodes, obj);
+        }
+        if (this.data.crrm.cp_nodes) {
+          this.move_node(this.data.crrm.cp_nodes, obj, false, true);
+        }
+        this.data.crrm.cp_nodes = false;
+        this.data.crrm.ct_nodes = false;
+      }
+    }
+  });
+  // include the crr plugin by default
+  $.jstree.defaults.plugins.push("crrm");
 })(jQuery);
 
-/* 
+/*
  * jsTree themes plugin 1.0
  * Handles loading and setting themes, as well as detecting path to themes, etc.
  */
 (function ($) {
-	var themes_loaded = [];
-	// this variable stores the path to the themes folder - if left as false - it will be autodetected
-	$.jstree._themes = false;
-	$.jstree.plugin("themes", {
-		__init : function () { 
-			this.get_container()
-				.bind("init.jstree", $.proxy(function () {
-						var s = this._get_settings().themes;
-						this.data.themes.dots = s.dots; 
-						this.data.themes.icons = s.icons; 
-						//alert(s.dots);
-						this.set_theme(s.theme, s.url);
-					}, this))
-				.bind("loaded.jstree", $.proxy(function () {
-						// bound here too, as simple HTML tree's won't honor dots & icons otherwise
-						if(!this.data.themes.dots) { this.hide_dots(); }
-						else { this.show_dots(); }
-						if(!this.data.themes.icons) { this.hide_icons(); }
-						else { this.show_icons(); }
-					}, this));
-		},
-		defaults : { 
-			theme : "default", 
-			url : false,
-			dots : true,
-			icons : true
-		},
-		_fn : {
-			set_theme : function (theme_name, theme_url) {
-				if(!theme_name) { return false; }
-				if(!theme_url) { theme_url = $.jstree._themes + theme_name + '/style.css'; }
-				if($.inArray(theme_url, themes_loaded) == -1) {
-					$.vakata.css.add_sheet({ "url" : theme_url, "rel" : "jstree" });
-					themes_loaded.push(theme_url);
-				}
-				if(this.data.themes.theme != theme_name) {
-					this.get_container().removeClass('jstree-' + this.data.themes.theme);
-					this.data.themes.theme = theme_name;
-				}
-				this.get_container().addClass('jstree-' + theme_name);
-				if(!this.data.themes.dots) { this.hide_dots(); }
-				else { this.show_dots(); }
-				if(!this.data.themes.icons) { this.hide_icons(); }
-				else { this.show_icons(); }
-				this.__callback();
-			},
-			get_theme	: function () { return this.data.themes.theme; },
-
-			show_dots	: function () { this.data.themes.dots = true; this.get_container().children("ul").removeClass("jstree-no-dots"); },
-			hide_dots	: function () { this.data.themes.dots = false; this.get_container().children("ul").addClass("jstree-no-dots"); },
-			toggle_dots	: function () { if(this.data.themes.dots) { this.hide_dots(); } else { this.show_dots(); } },
-
-			show_icons	: function () { this.data.themes.icons = true; this.get_container().children("ul").removeClass("jstree-no-icons"); },
-			hide_icons	: function () { this.data.themes.icons = false; this.get_container().children("ul").addClass("jstree-no-icons"); },
-			toggle_icons: function () { if(this.data.themes.icons) { this.hide_icons(); } else { this.show_icons(); } }
-		}
-	});
-	// autodetect themes path
-	$(function () {
-		if($.jstree._themes === false) {
-			$("script").each(function () { 
-				if(this.src.toString().match(/jquery\.jstree[^\/]*?\.js(\?.*)?$/)) { 
-					$.jstree._themes = this.src.toString().replace(/jquery\.jstree[^\/]*?\.js(\?.*)?$/, "") + 'themes/'; 
-					return false; 
-				}
-			});
-		}
-		if($.jstree._themes === false) { $.jstree._themes = "themes/"; }
-	});
-	// include the themes plugin by default
-	$.jstree.defaults.plugins.push("themes");
+  var themes_loaded = [];
+  // this variable stores the path to the themes folder - if left as false - it will be autodetected
+  $.jstree._themes = false;
+  $.jstree.plugin("themes", {
+    __init: function () {
+      this.get_container()
+      .bind("init.jstree", $.proxy(function () {
+        var s = this._get_settings().themes;
+        this.data.themes.dots = s.dots;
+        this.data.themes.icons = s.icons;
+        //alert(s.dots);
+        this.set_theme(s.theme, s.url);
+      }, this))
+      .bind("loaded.jstree", $.proxy(function () {
+        // bound here too, as simple HTML tree's won't honor dots & icons otherwise
+        if (!this.data.themes.dots) {
+          this.hide_dots();
+        }
+        else {
+          this.show_dots();
+        }
+        if (!this.data.themes.icons) {
+          this.hide_icons();
+        }
+        else {
+          this.show_icons();
+        }
+      }, this));
+    },
+    defaults: {
+      theme: "default",
+      url: false,
+      dots: true,
+      icons: true
+    },
+    _fn: {
+      set_theme: function (theme_name, theme_url) {
+        if (!theme_name) {
+          return false;
+        }
+        if (!theme_url) {
+          theme_url = $.jstree._themes + theme_name + '/style.css';
+        }
+        if ($.inArray(theme_url, themes_loaded) == -1) {
+          $.vakata.css.add_sheet({"url": theme_url, "rel": "jstree"});
+          themes_loaded.push(theme_url);
+        }
+        if (this.data.themes.theme != theme_name) {
+          this.get_container().removeClass('jstree-' + this.data.themes.theme);
+          this.data.themes.theme = theme_name;
+        }
+        this.get_container().addClass('jstree-' + theme_name);
+        if (!this.data.themes.dots) {
+          this.hide_dots();
+        }
+        else {
+          this.show_dots();
+        }
+        if (!this.data.themes.icons) {
+          this.hide_icons();
+        }
+        else {
+          this.show_icons();
+        }
+        this.__callback();
+      },
+      get_theme: function () {
+        return this.data.themes.theme;
+      },
+
+      show_dots: function () {
+        this.data.themes.dots = true;
+        this.get_container().children("ul").removeClass("jstree-no-dots");
+      },
+      hide_dots: function () {
+        this.data.themes.dots = false;
+        this.get_container().children("ul").addClass("jstree-no-dots");
+      },
+      toggle_dots: function () {
+        if (this.data.themes.dots) {
+          this.hide_dots();
+        } else {
+          this.show_dots();
+        }
+      },
+
+      show_icons: function () {
+        this.data.themes.icons = true;
+        this.get_container().children("ul").removeClass("jstree-no-icons");
+      },
+      hide_icons: function () {
+        this.data.themes.icons = false;
+        this.get_container().children("ul").addClass("jstree-no-icons");
+      },
+      toggle_icons: function () {
+        if (this.data.themes.icons) {
+          this.hide_icons();
+        } else {
+          this.show_icons();
+        }
+      }
+    }
+  });
+  // autodetect themes path
+  $(function () {
+    if ($.jstree._themes === false) {
+      $("script").each(function () {
+        if (this.src.toString().match(/jquery\.jstree[^\/]*?\.js(\?.*)?$/)) {
+          $.jstree._themes = this.src.toString().replace(
+              /jquery\.jstree[^\/]*?\.js(\?.*)?$/, "") + 'themes/';
+          return false;
+        }
+      });
+    }
+    if ($.jstree._themes === false) {
+      $.jstree._themes = "themes/";
+    }
+  });
+  // include the themes plugin by default
+  $.jstree.defaults.plugins.push("themes");
 })(jQuery);
 //*/
 
@@ -1250,436 +1759,617 @@
  * Depends on the jstree ui & jquery hotkeys plugins
  */
 (function ($) {
-	var bound = [];
-	function exec(i, event) {
-		var f = $.jstree._focused(), tmp;
-		if(f && f.data && f.data.hotkeys && f.data.hotkeys.enabled) { 
-			tmp = f._get_settings().hotkeys[i];
-			if(tmp) { return tmp.call(f, event); }
-		}
-	}
-	$.jstree.plugin("hotkeys", {
-		__init : function () {
-			if(typeof $.hotkeys === "undefined") { throw "jsTree hotkeys: jQuery hotkeys plugin not included."; }
-			if(!this.data.ui) { throw "jsTree hotkeys: jsTree UI plugin not included."; }
-			$.each(this._get_settings().hotkeys, function (i, val) {
-				if($.inArray(i, bound) == -1) {
-					$(document).bind("keydown", i, function (event) { return exec(i, event); });
-					bound.push(i);
-				}
-			});
-			this.enable_hotkeys();
-		},
-		defaults : {
-			"up" : function () { 
-				var o = this.data.ui.hovered || this.data.ui.last_selected || -1;
-				this.hover_node(this._get_prev(o));
-				return false; 
-			},
-			"down" : function () { 
-				var o = this.data.ui.hovered || this.data.ui.last_selected || -1;
-				this.hover_node(this._get_next(o));
-				return false;
-			},
-			"left" : function () { 
-				var o = this.data.ui.hovered || this.data.ui.last_selected;
-				if(o) {
-					if(o.hasClass("jstree-open")) { this.close_node(o); }
-					else { this.hover_node(this._get_prev(o)); }
-				}
-				return false;
-			},
-			"right" : function () { 
-				var o = this.data.ui.hovered || this.data.ui.last_selected;
-				if(o && o.length) {
-					if(o.hasClass("jstree-closed")) { this.open_node(o); }
-					else { this.hover_node(this._get_next(o)); }
-				}
-				return false;
-			},
-			"space" : function () { 
-				if(this.data.ui.hovered) { this.data.ui.hovered.children("a:eq(0)").click(); } 
-				return false; 
-			},
-			"ctrl+space" : function (event) { 
-				event.type = "click";
-				if(this.data.ui.hovered) { this.data.ui.hovered.children("a:eq(0)").trigger(event); } 
-				return false; 
-			},
-			"f2" : function () { this.rename(this.data.ui.hovered || this.data.ui.last_selected); },
-			"del" : function () { this.remove(this.data.ui.hovered || this._get_node(null)); }
-		},
-		_fn : {
-			enable_hotkeys : function () {
-				this.data.hotkeys.enabled = true;
-			},
-			disable_hotkeys : function () {
-				this.data.hotkeys.enabled = false;
-			}
-		}
-	});
+  var bound = [];
+
+  function exec(i, event) {
+    var f = $.jstree._focused(), tmp;
+    if (f && f.data && f.data.hotkeys && f.data.hotkeys.enabled) {
+      tmp = f._get_settings().hotkeys[i];
+      if (tmp) {
+        return tmp.call(f, event);
+      }
+    }
+  }
+
+  $.jstree.plugin("hotkeys", {
+    __init: function () {
+      if (typeof $.hotkeys === "undefined") {
+        throw "jsTree hotkeys: jQuery hotkeys plugin not included.";
+      }
+      if (!this.data.ui) {
+        throw "jsTree hotkeys: jsTree UI plugin not included.";
+      }
+      $.each(this._get_settings().hotkeys, function (i, val) {
+        if ($.inArray(i, bound) == -1) {
+          $(document).bind("keydown", i, function (event) {
+            return exec(i, event);
+          });
+          bound.push(i);
+        }
+      });
+      this.enable_hotkeys();
+    },
+    defaults: {
+      "up": function () {
+        var o = this.data.ui.hovered || this.data.ui.last_selected || -1;
+        this.hover_node(this._get_prev(o));
+        return false;
+      },
+      "down": function () {
+        var o = this.data.ui.hovered || this.data.ui.last_selected || -1;
+        this.hover_node(this._get_next(o));
+        return false;
+      },
+      "left": function () {
+        var o = this.data.ui.hovered || this.data.ui.last_selected;
+        if (o) {
+          if (o.hasClass("jstree-open")) {
+            this.close_node(o);
+          }
+          else {
+            this.hover_node(this._get_prev(o));
+          }
+        }
+        return false;
+      },
+      "right": function () {
+        var o = this.data.ui.hovered || this.data.ui.last_selected;
+        if (o && o.length) {
+          if (o.hasClass("jstree-closed")) {
+            this.open_node(o);
+          }
+          else {
+            this.hover_node(this._get_next(o));
+          }
+        }
+        return false;
+      },
+      "space": function () {
+        if (this.data.ui.hovered) {
+          this.data.ui.hovered.children("a:eq(0)").click();
+        }
+        return false;
+      },
+      "ctrl+space": function (event) {
+        event.type = "click";
+        if (this.data.ui.hovered) {
+          this.data.ui.hovered.children("a:eq(0)").trigger(event);
+        }
+        return false;
+      },
+      "f2": function () {
+        this.rename(this.data.ui.hovered || this.data.ui.last_selected);
+      },
+      "del": function () {
+        this.remove(this.data.ui.hovered || this._get_node(null));
+      }
+    },
+    _fn: {
+      enable_hotkeys: function () {
+        this.data.hotkeys.enabled = true;
+      },
+      disable_hotkeys: function () {
+        this.data.hotkeys.enabled = false;
+      }
+    }
+  });
 })(jQuery);
 //*/
 
-/* 
+/*
  * jsTree JSON 1.0
  * The JSON data store. Datastores are build by overriding the `load_node` and `_is_loaded` functions.
  */
 (function ($) {
-	$.jstree.plugin("json_data", {
-		defaults : { 
-			data : false,
-			ajax : false,
-			correct_state : true,
-			progressive_render : false
-		},
-		_fn : {
-			load_node : function (obj, s_call, e_call) { var _this = this; this.load_node_json(obj, function () { _this.__callback({ "obj" : obj }); s_call.call(this); }, e_call); },
-			_is_loaded : function (obj) { 
-				var s = this._get_settings().json_data, d;
-				obj = this._get_node(obj); 
-				if(obj && obj !== -1 && s.progressive_render && !obj.is(".jstree-open, .jstree-leaf") && obj.children("ul").children("li").length === 0 && obj.data("jstree-children")) {
-					d = this._parse_json(obj.data("jstree-children"));
-					if(d) {
-						obj.append(d);
-						$.removeData(obj, "jstree-children");
-					}
-					this.clean_node(obj);
-					return true;
-				}
-				return obj == -1 || !obj || !s.ajax || obj.is(".jstree-open, .jstree-leaf") || obj.children("ul").children("li").size() > 0;
-			},
-			load_node_json : function (obj, s_call, e_call) {
-				var s = this.get_settings().json_data, d,
-					error_func = function () {},
-					success_func = function () {};
-				obj = this._get_node(obj);
-				if(obj && obj !== -1) {
-					if(obj.data("jstree-is-loading")) { return; }
-					else { obj.data("jstree-is-loading",true); }
-				}
-				switch(!0) {
-					case (!s.data && !s.ajax): throw "Neither data nor ajax settings supplied.";
-					case (!!s.data && !s.ajax) || (!!s.data && !!s.ajax && (!obj || obj === -1)):
-						if(!obj || obj == -1) {
-							d = this._parse_json(s.data);
-							if(d) {
-								this.get_container().children("ul").empty().append(d.children());
-								this.clean_node();
-							}
-							else { 
-								if(s.correct_state) { this.get_container().children("ul").empty(); }
-							}
-						}
-						if(s_call) { s_call.call(this); }
-						break;
-					case (!s.data && !!s.ajax) || (!!s.data && !!s.ajax && obj && obj !== -1):
-						error_func = function (x, t, e) {
-							var ef = this.get_settings().json_data.ajax.error; 
-							if(ef) { ef.call(this, x, t, e); }
-							if(obj != -1 && obj.length) {
-								obj.children(".jstree-loading").removeClass("jstree-loading");
-								obj.data("jstree-is-loading",false);
-								if(t === "success" && s.correct_state) { obj.removeClass("jstree-open jstree-closed").addClass("jstree-leaf"); }
-							}
-							else {
-								if(t === "success" && s.correct_state) { this.get_container().children("ul").empty(); }
-							}
-							if(e_call) { e_call.call(this); }
-						};
-						success_func = function (d, t, x) {
-							var sf = this.get_settings().json_data.ajax.success; 
-							if(sf) { d = sf.call(this,d,t,x) || d; }
-							if(d === "" || (!$.isArray(d) && !$.isPlainObject(d))) {
-								return error_func.call(this, x, t, "");
-							}
-							d = this._parse_json(d);
-							if(d) {
-								if(obj === -1 || !obj) { this.get_container().children("ul").empty().append(d.children()); }
-								else { obj.append(d).children(".jstree-loading").removeClass("jstree-loading"); obj.data("jstree-is-loading",false); }
-								this.clean_node(obj);
-								if(s_call) { s_call.call(this); }
-							}
-							else {
-								if(obj === -1 || !obj) {
-									if(s.correct_state) { 
-										this.get_container().children("ul").empty(); 
-										if(s_call) { s_call.call(this); }
-									}
-								}
-								else {
-									obj.children(".jstree-loading").removeClass("jstree-loading");
-									obj.data("jstree-is-loading",false);
-									if(s.correct_state) { 
-										obj.removeClass("jstree-open jstree-closed").addClass("jstree-leaf"); 
-										if(s_call) { s_call.call(this); } 
-									}
-								}
-							}
-						};
-						s.ajax.context = this;
-						s.ajax.error = error_func;
-						s.ajax.success = success_func;
-						if(!s.ajax.dataType) { s.ajax.dataType = "json"; }
-						if($.isFunction(s.ajax.url)) { s.ajax.url = s.ajax.url.call(this, obj); }
-						if($.isFunction(s.ajax.data)) { s.ajax.data = s.ajax.data.call(this, obj); }
-						$.ajax(s.ajax);
-						break;
-				}
-			},
-			_parse_json : function (js, is_callback) {
-				var d = false, 
-					p = this._get_settings(),
-					s = p.json_data,
-					t = p.core.html_titles,
-					tmp, i, j, ul1, ul2;
-
-				if(!js) { return d; }
-				if($.isFunction(js)) { 
-					js = js.call(this);
-				}
-				if($.isArray(js)) {
-					d = $();
-					if(!js.length) { return false; }
-					for(i = 0, j = js.length; i < j; i++) {
-						tmp = this._parse_json(js[i], true);
-						if(tmp.length) { d = d.add(tmp); }
-					}
-				}
-				else {
-					if(typeof js == "string") { js = { data : js }; }
-					if(!js.data && js.data !== "") { return d; }
-					d = $("<li>");
-					if(js.attr) { d.attr(js.attr); }
-					if(js.metadata) { d.data("jstree", js.metadata); }
-					if(js.state) { d.addClass("jstree-" + js.state); }
-					if(!$.isArray(js.data)) { tmp = js.data; js.data = []; js.data.push(tmp); }
-					$.each(js.data, function (i, m) {
-						tmp = $("<a>");
-						if($.isFunction(m)) { m = m.call(this, js); }
-						if(typeof m == "string") { tmp.attr('href','#')[ t ? "html" : "text" ](m); }
-						else {
-							if(!m.attr) { m.attr = {}; }
-							if(!m.attr.href) { m.attr.href = '#'; }
-							tmp.attr(m.attr)[ t ? "html" : "text" ](m.title);
-							if(m.language) { tmp.addClass(m.language); }
-						}
-						tmp.prepend("<ins class='jstree-icon'>&#160;</ins>");
-						if(!m.icon && js.icon) { m.icon = js.icon; }
-						if(m.icon) { 
-							if(m.icon.indexOf("/") === -1) { tmp.children("ins").addClass(m.icon); }
-							else { tmp.children("ins").css("background","url('" + m.icon + "') center center no-repeat"); }
-						}
-						d.append(tmp);
-					});
-					d.prepend("<ins class='jstree-icon'>&#160;</ins>");
-					if(js.children) { 
-						if(s.progressive_render && js.state !== "open") {
-							d.addClass("jstree-closed").data("jstree-children", js.children);
-						}
-						else {
-							if($.isFunction(js.children)) {
-								js.children = js.children.call(this, js);
-							}
-							if($.isArray(js.children) && js.children.length) {
-								tmp = this._parse_json(js.children, true);
-								if(tmp.length) {
-									ul2 = $("<ul>");
-									ul2.append(tmp);
-									d.append(ul2);
-								}
-							}
-						}
-					}
-				}
-				if(!is_callback) {
-					ul1 = $("<ul>");
-					ul1.append(d);
-					d = ul1;
-				}
-				return d;
-			},
-			get_json : function (obj, li_attr, a_attr, is_callback) {
-				var result = [], 
-					s = this._get_settings(), 
-					_this = this,
-					tmp1, tmp2, li, a, t, lang;
-				obj = this._get_node(obj);
-				if(!obj || obj === -1) { obj = this.get_container().find("> ul > li"); }
-				li_attr = $.isArray(li_attr) ? li_attr : [ "id", "class" ];
-				if(!is_callback && this.data.types) { li_attr.push(s.types.type_attr); }
-				a_attr = $.isArray(a_attr) ? a_attr : [ ];
-
-				obj.each(function () {
-					li = $(this);
-					tmp1 = { data : [] };
-					if(li_attr.length) { tmp1.attr = { }; }
-					$.each(li_attr, function (i, v) { 
-						tmp2 = li.attr(v); 
-						if(tmp2 && tmp2.length && tmp2.replace(/jstree[^ ]*|$/ig,'').length) {
-							tmp1.attr[v] = tmp2.replace(/jstree[^ ]*|$/ig,''); 
-						}
-					});
-					if(li.hasClass("jstree-open")) { tmp1.state = "open"; }
-					if(li.hasClass("jstree-closed")) { tmp1.state = "closed"; }
-					a = li.children("a");
-					a.each(function () {
-						t = $(this);
-						if(
-							a_attr.length || 
-							$.inArray("languages", s.plugins) !== -1 || 
-							t.children("ins").get(0).style.backgroundImage.length || 
-							(t.children("ins").get(0).className && t.children("ins").get(0).className.replace(/jstree[^ ]*|$/ig,'').length)
-						) { 
-							lang = false;
-							if($.inArray("languages", s.plugins) !== -1 && $.isArray(s.languages) && s.languages.length) {
-								$.each(s.languages, function (l, lv) {
-									if(t.hasClass(lv)) {
-										lang = lv;
-										return false;
-									}
-								});
-							}
-							tmp2 = { attr : { }, title : _this.get_text(t, lang) }; 
-							$.each(a_attr, function (k, z) {
-								tmp1.attr[z] = (t.attr(z) || "").replace(/jstree[^ ]*|$/ig,'');
-							});
-							$.each(s.languages, function (k, z) {
-								if(t.hasClass(z)) { tmp2.language = z; return true; }
-							});
-							if(t.children("ins").get(0).className.replace(/jstree[^ ]*|$/ig,'').replace(/^\s+$/ig,"").length) {
-								tmp2.icon = t.children("ins").get(0).className.replace(/jstree[^ ]*|$/ig,'').replace(/^\s+$/ig,"");
-							}
-							if(t.children("ins").get(0).style.backgroundImage.length) {
-								tmp2.icon = t.children("ins").get(0).style.backgroundImage.replace("url(","").replace(")","");
-							}
-						}
-						else {
-							tmp2 = _this.get_text(t);
-						}
-						if(a.length > 1) { tmp1.data.push(tmp2); }
-						else { tmp1.data = tmp2; }
-					});
-					li = li.find("> ul > li");
-					if(li.length) { tmp1.children = _this.get_json(li, li_attr, a_attr, true); }
-					result.push(tmp1);
-				});
-				return result;
-			}
-		}
-	});
+  $.jstree.plugin("json_data", {
+    defaults: {
+      data: false,
+      ajax: false,
+      correct_state: true,
+      progressive_render: false
+    },
+    _fn: {
+      load_node: function (obj, s_call, e_call) {
+        var _this = this;
+        this.load_node_json(obj, function () {
+          _this.__callback({"obj": obj});
+          s_call.call(this);
+        }, e_call);
+      },
+      _is_loaded: function (obj) {
+        var s = this._get_settings().json_data, d;
+        obj = this._get_node(obj);
+        if (obj && obj !== -1 && s.progressive_render && !obj.is(
+                ".jstree-open, .jstree-leaf") && obj.children("ul").children(
+                "li").length === 0 && obj.data("jstree-children")) {
+          d = this._parse_json(obj.data("jstree-children"));
+          if (d) {
+            obj.append(d);
+            $.removeData(obj, "jstree-children");
+          }
+          this.clean_node(obj);
+          return true;
+        }
+        return obj == -1 || !obj || !s.ajax || obj.is(
+            ".jstree-open, .jstree-leaf") || obj.children("ul").children(
+            "li").size() > 0;
+      },
+      load_node_json: function (obj, s_call, e_call) {
+        var s = this.get_settings().json_data, d,
+            error_func = function () {
+            },
+            success_func = function () {
+            };
+        obj = this._get_node(obj);
+        if (obj && obj !== -1) {
+          if (obj.data("jstree-is-loading")) {
+            return;
+          }
+          else {
+            obj.data("jstree-is-loading", true);
+          }
+        }
+        switch (!0) {
+          case (!s.data && !s.ajax):
+            throw "Neither data nor ajax settings supplied.";
+          case (!!s.data && !s.ajax) || (!!s.data && !!s.ajax && (!obj || obj
+              === -1)):
+            if (!obj || obj == -1) {
+              d = this._parse_json(s.data);
+              if (d) {
+                this.get_container().children("ul").empty().append(
+                    d.children());
+                this.clean_node();
+              }
+              else {
+                if (s.correct_state) {
+                  this.get_container().children("ul").empty();
+                }
+              }
+            }
+            if (s_call) {
+              s_call.call(this);
+            }
+            break;
+          case (!s.data && !!s.ajax) || (!!s.data && !!s.ajax && obj && obj
+              !== -1):
+            error_func = function (x, t, e) {
+              var ef = this.get_settings().json_data.ajax.error;
+              if (ef) {
+                ef.call(this, x, t, e);
+              }
+              if (obj != -1 && obj.length) {
+                obj.children(".jstree-loading").removeClass("jstree-loading");
+                obj.data("jstree-is-loading", false);
+                if (t === "success" && s.correct_state) {
+                  obj.removeClass("jstree-open jstree-closed").addClass(
+                      "jstree-leaf");
+                }
+              }
+              else {
+                if (t === "success" && s.correct_state) {
+                  this.get_container().children("ul").empty();
+                }
+              }
+              if (e_call) {
+                e_call.call(this);
+              }
+            };
+            success_func = function (d, t, x) {
+              var sf = this.get_settings().json_data.ajax.success;
+              if (sf) {
+                d = sf.call(this, d, t, x) || d;
+              }
+              if (d === "" || (!$.isArray(d) && !$.isPlainObject(d))) {
+                return error_func.call(this, x, t, "");
+              }
+              d = this._parse_json(d);
+              if (d) {
+                if (obj === -1 || !obj) {
+                  this.get_container().children("ul").empty().append(
+                      d.children());
+                }
+                else {
+                  obj.append(d).children(".jstree-loading").removeClass(
+                      "jstree-loading");
+                  obj.data("jstree-is-loading", false);
+                }
+                this.clean_node(obj);
+                if (s_call) {
+                  s_call.call(this);
+                }
+              }
+              else {
+                if (obj === -1 || !obj) {
+                  if (s.correct_state) {
+                    this.get_container().children("ul").empty();
+                    if (s_call) {
+                      s_call.call(this);
+                    }
+                  }
+                }
+                else {
+                  obj.children(".jstree-loading").removeClass("jstree-loading");
+                  obj.data("jstree-is-loading", false);
+                  if (s.correct_state) {
+                    obj.removeClass("jstree-open jstree-closed").addClass(
+                        "jstree-leaf");
+                    if (s_call) {
+                      s_call.call(this);
+                    }
+                  }
+                }
+              }
+            };
+            s.ajax.context = this;
+            s.ajax.error = error_func;
+            s.ajax.success = success_func;
+            if (!s.ajax.dataType) {
+              s.ajax.dataType = "json";
+            }
+            if ($.isFunction(s.ajax.url)) {
+              s.ajax.url = s.ajax.url.call(this, obj);
+            }
+            if ($.isFunction(s.ajax.data)) {
+              s.ajax.data = s.ajax.data.call(this, obj);
+            }
+            $.ajax(s.ajax);
+            break;
+        }
+      },
+      _parse_json: function (js, is_callback) {
+        var d = false,
+            p = this._get_settings(),
+            s = p.json_data,
+            t = p.core.html_titles,
+            tmp, i, j, ul1, ul2;
+
+        if (!js) {
+          return d;
+        }
+        if ($.isFunction(js)) {
+          js = js.call(this);
+        }
+        if ($.isArray(js)) {
+          d = $();
+          if (!js.length) {
+            return false;
+          }
+          for (i = 0, j = js.length; i < j; i++) {
+            tmp = this._parse_json(js[i], true);
+            if (tmp.length) {
+              d = d.add(tmp);
+            }
+          }
+        }
+        else {
+          if (typeof js == "string") {
+            js = {data: js};
+          }
+          if (!js.data && js.data !== "") {
+            return d;
+          }
+          d = $("<li>");
+          if (js.attr) {
+            d.attr(js.attr);
+          }
+          if (js.metadata) {
+            d.data("jstree", js.metadata);
+          }
+          if (js.state) {
+            d.addClass("jstree-" + js.state);
+          }
+          if (!$.isArray(js.data)) {
+            tmp = js.data;
+            js.data = [];
+            js.data.push(tmp);
+          }
+          $.each(js.data, function (i, m) {
+            tmp = $("<a>");
+            if ($.isFunction(m)) {
+              m = m.call(this, js);
+            }
+            if (typeof m == "string") {
+              tmp.attr('href', '#')[t ? "html" : "text"](m);
+            }
+            else {
+              if (!m.attr) {
+                m.attr = {};
+              }
+              if (!m.attr.href) {
+                m.attr.href = '#';
+              }
+              tmp.attr(m.attr)[t ? "html" : "text"](m.title);
+              if (m.language) {
+                tmp.addClass(m.language);
+              }
+            }
+            tmp.prepend("<ins class='jstree-icon'>&#160;</ins>");
+            if (!m.icon && js.icon) {
+              m.icon = js.icon;
+            }
+            if (m.icon) {
+              if (m.icon.indexOf("/") === -1) {
+                tmp.children("ins").addClass(m.icon);
+              }
+              else {
+                tmp.children("ins").css("background", "url('" + m.icon
+                    + "') center center no-repeat");
+              }
+            }
+            d.append(tmp);
+          });
+          d.prepend("<ins class='jstree-icon'>&#160;</ins>");
+          if (js.children) {
+            if (s.progressive_render && js.state !== "open") {
+              d.addClass("jstree-closed").data("jstree-children", js.children);
+            }
+            else {
+              if ($.isFunction(js.children)) {
+                js.children = js.children.call(this, js);
+              }
+              if ($.isArray(js.children) && js.children.length) {
+                tmp = this._parse_json(js.children, true);
+                if (tmp.length) {
+                  ul2 = $("<ul>");
+                  ul2.append(tmp);
+                  d.append(ul2);
+                }
+              }
+            }
+          }
+        }
+        if (!is_callback) {
+          ul1 = $("<ul>");
+          ul1.append(d);
+          d = ul1;
+        }
+        return d;
+      },
+      get_json: function (obj, li_attr, a_attr, is_callback) {
+        var result = [],
+            s = this._get_settings(),
+            _this = this,
+            tmp1, tmp2, li, a, t, lang;
+        obj = this._get_node(obj);
+        if (!obj || obj === -1) {
+          obj = this.get_container().find("> ul > li");
+        }
+        li_attr = $.isArray(li_attr) ? li_attr : ["id", "class"];
+        if (!is_callback && this.data.types) {
+          li_attr.push(s.types.type_attr);
+        }
+        a_attr = $.isArray(a_attr) ? a_attr : [];
+
+        obj.each(function () {
+          li = $(this);
+          tmp1 = {data: []};
+          if (li_attr.length) {
+            tmp1.attr = {};
+          }
+          $.each(li_attr, function (i, v) {
+            tmp2 = li.attr(v);
+            if (tmp2 && tmp2.length && tmp2.replace(/jstree[^ ]*|$/ig,
+                    '').length) {
+              tmp1.attr[v] = tmp2.replace(/jstree[^ ]*|$/ig, '');
+            }
+          });
+          if (li.hasClass("jstree-open")) {
+            tmp1.state = "open";
+          }
+          if (li.hasClass("jstree-closed")) {
+            tmp1.state = "closed";
+          }
+          a = li.children("a");
+          a.each(function () {
+            t = $(this);
+            if (
+                a_attr.length ||
+                $.inArray("languages", s.plugins) !== -1 ||
+                t.children("ins").get(0).style.backgroundImage.length ||
+                (t.children("ins").get(0).className && t.children("ins").get(
+                    0).className.replace(/jstree[^ ]*|$/ig, '').length)
+            ) {
+              lang = false;
+              if ($.inArray("languages", s.plugins) !== -1 && $.isArray(
+                      s.languages) && s.languages.length) {
+                $.each(s.languages, function (l, lv) {
+                  if (t.hasClass(lv)) {
+                    lang = lv;
+                    return false;
+                  }
+                });
+              }
+              tmp2 = {attr: {}, title: _this.get_text(t, lang)};
+              $.each(a_attr, function (k, z) {
+                tmp1.attr[z] = (t.attr(z) || "").replace(/jstree[^ ]*|$/ig, '');
+              });
+              $.each(s.languages, function (k, z) {
+                if (t.hasClass(z)) {
+                  tmp2.language = z;
+                  return true;
+                }
+              });
+              if (t.children("ins").get(0).className.replace(/jstree[^ ]*|$/ig,
+                      '').replace(/^\s+$/ig, "").length) {
+                tmp2.icon = t.children("ins").get(0).className.replace(
+                    /jstree[^ ]*|$/ig, '').replace(/^\s+$/ig, "");
+              }
+              if (t.children("ins").get(0).style.backgroundImage.length) {
+                tmp2.icon = t.children("ins").get(
+                    0).style.backgroundImage.replace("url(", "").replace(")",
+                    "");
+              }
+            }
+            else {
+              tmp2 = _this.get_text(t);
+            }
+            if (a.length > 1) {
+              tmp1.data.push(tmp2);
+            }
+            else {
+              tmp1.data = tmp2;
+            }
+          });
+          li = li.find("> ul > li");
+          if (li.length) {
+            tmp1.children = _this.get_json(li, li_attr, a_attr, true);
+          }
+          result.push(tmp1);
+        });
+        return result;
+      }
+    }
+  });
 })(jQuery);
 //*/
 
-/* 
+/*
  * jsTree languages plugin 1.0
  * Adds support for multiple language versions in one tree
  * This basically allows for many titles coexisting in one node, but only one of them being visible at any given time
  * This is useful for maintaining the same structure in many languages (hence the name of the plugin)
  */
 (function ($) {
-	$.jstree.plugin("languages", {
-		__init : function () { this._load_css();  },
-		defaults : [],
-		_fn : {
-			set_lang : function (i) { 
-				var langs = this._get_settings().languages,
-					st = false,
-					selector = ".jstree-" + this.get_index() + ' a';
-				if(!$.isArray(langs) || langs.length === 0) { return false; }
-				if($.inArray(i,langs) == -1) {
-					if(!!langs[i]) { i = langs[i]; }
-					else { return false; }
-				}
-				if(i == this.data.languages.current_language) { return true; }
-				st = $.vakata.css.get_css(selector + "." + this.data.languages.current_language, false, this.data.languages.language_css);
-				if(st !== false) { st.style.display = "none"; }
-				st = $.vakata.css.get_css(selector + "." + i, false, this.data.languages.language_css);
-				if(st !== false) { st.style.display = ""; }
-				this.data.languages.current_language = i;
-				this.__callback(i);
-				return true;
-			},
-			get_lang : function () {
-				return this.data.languages.current_language;
-			},
-			get_text : function (obj, lang) {
-				obj = this._get_node(obj) || this.data.ui.last_selected;
-				if(!obj.size()) { return false; }
-				var langs = this._get_settings().languages,
-					s = this._get_settings().core.html_titles;
-				if($.isArray(langs) && langs.length) {
-					lang = (lang && $.inArray(lang,langs) != -1) ? lang : this.data.languages.current_language;
-					obj = obj.children("a." + lang);
-				}
-				else { obj = obj.children("a:eq(0)"); }
-				if(s) {
-					obj = obj.clone();
-					obj.children("INS").remove();
-					return obj.html();
-				}
-				else {
-					obj = obj.contents().filter(function() { return this.nodeType == 3; })[0];
-					return obj.nodeValue;
-				}
-			},
-			set_text : function (obj, val, lang) {
-				obj = this._get_node(obj) || this.data.ui.last_selected;
-				if(!obj.size()) { return false; }
-				var langs = this._get_settings().languages,
-					s = this._get_settings().core.html_titles,
-					tmp;
-				if($.isArray(langs) && langs.length) {
-					lang = (lang && $.inArray(lang,langs) != -1) ? lang : this.data.languages.current_language;
-					obj = obj.children("a." + lang);
-				}
-				else { obj = obj.children("a:eq(0)"); }
-				if(s) {
-					tmp = obj.children("INS").clone();
-					obj.html(val).prepend(tmp);
-					this.__callback({ "obj" : obj, "name" : val, "lang" : lang });
-					return true;
-				}
-				else {
-					obj = obj.contents().filter(function() { return this.nodeType == 3; })[0];
-					this.__callback({ "obj" : obj, "name" : val, "lang" : lang });
-					return (obj.nodeValue = val);
-				}
-			},
-			_load_css : function () {
-				var langs = this._get_settings().languages,
-					str = "/* languages css */",
-					selector = ".jstree-" + this.get_index() + ' a',
-					ln;
-				if($.isArray(langs) && langs.length) {
-					this.data.languages.current_language = langs[0];
-					for(ln = 0; ln < langs.length; ln++) {
-						str += selector + "." + langs[ln] + " {";
-						if(langs[ln] != this.data.languages.current_language) { str += " display:none; "; }
-						str += " } ";
-					}
-					this.data.languages.language_css = $.vakata.css.add_sheet({ 'str' : str });
-				}
-			},
-			create_node : function (obj, position, js, callback) {
-				var t = this.__call_old(true, obj, position, js, function (t) {
-					var langs = this._get_settings().languages,
-						a = t.children("a"),
-						ln;
-					if($.isArray(langs) && langs.length) {
-						for(ln = 0; ln < langs.length; ln++) {
-							if(!a.is("." + langs[ln])) {
-								t.append(a.eq(0).clone().removeClass(langs.join(" ")).addClass(langs[ln]));
-							}
-						}
-						a.not("." + langs.join(", .")).remove();
-					}
-					if(callback) { callback.call(this, t); }
-				});
-				return t;
-			}
-		}
-	});
+  $.jstree.plugin("languages", {
+    __init: function () {
+      this._load_css();
+    },
+    defaults: [],
+    _fn: {
+      set_lang: function (i) {
+        var langs = this._get_settings().languages,
+            st = false,
+            selector = ".jstree-" + this.get_index() + ' a';
+        if (!$.isArray(langs) || langs.length === 0) {
+          return false;
+        }
+        if ($.inArray(i, langs) == -1) {
+          if (!!langs[i]) {
+            i = langs[i];
+          }
+          else {
+            return false;
+          }
+        }
+        if (i == this.data.languages.current_language) {
+          return true;
+        }
+        st = $.vakata.css.get_css(selector + "."
+            + this.data.languages.current_language, false,
+            this.data.languages.language_css);
+        if (st !== false) {
+          st.style.display = "none";
+        }
+        st = $.vakata.css.get_css(selector + "." + i, false,
+            this.data.languages.language_css);
+        if (st !== false) {
+          st.style.display = "";
+        }
+        this.data.languages.current_language = i;
+        this.__callback(i);
+        return true;
+      },
+      get_lang: function () {
+        return this.data.languages.current_language;
+      },
+      get_text: function (obj, lang) {
+        obj = this._get_node(obj) || this.data.ui.last_selected;
+        if (!obj.size()) {
+          return false;
+        }
+        var langs = this._get_settings().languages,
+            s = this._get_settings().core.html_titles;
+        if ($.isArray(langs) && langs.length) {
+          lang = (lang && $.inArray(lang, langs) != -1) ? lang
+              : this.data.languages.current_language;
+          obj = obj.children("a." + lang);
+        }
+        else {
+          obj = obj.children("a:eq(0)");
+        }
+        if (s) {
+          obj = obj.clone();
+          obj.children("INS").remove();
+          return obj.html();
+        }
+        else {
+          obj = obj.contents().filter(function () {
+            return this.nodeType == 3;
+          })[0];
+          return obj.nodeValue;
+        }
+      },
+      set_text: function (obj, val, lang) {
+        obj = this._get_node(obj) || this.data.ui.last_selected;
+        if (!obj.size()) {
+          return false;
+        }
+        var langs = this._get_settings().languages,
+            s = this._get_settings().core.html_titles,
+            tmp;
+        if ($.isArray(langs) && langs.length) {
+          lang = (lang && $.inArray(lang, langs) != -1) ? lang
+              : this.data.languages.current_language;
+          obj = obj.children("a." + lang);
+        }
+        else {
+          obj = obj.children("a:eq(0)");
+        }
+        if (s) {
+          tmp = obj.children("INS").clone();
+          obj.html(val).prepend(tmp);
+          this.__callback({"obj": obj, "name": val, "lang": lang});
+          return true;
+        }
+        else {
+          obj = obj.contents().filter(function () {
+            return this.nodeType == 3;
+          })[0];
+          this.__callback({"obj": obj, "name": val, "lang": lang});
+          return (obj.nodeValue = val);
+        }
+      },
+      _load_css: function () {
+        var langs = this._get_settings().languages,
+            str = "/* languages css */",
+            selector = ".jstree-" + this.get_index() + ' a',
+            ln;
+        if ($.isArray(langs) && langs.length) {
+          this.data.languages.current_language = langs[0];
+          for (ln = 0; ln < langs.length; ln++) {
+            str += selector + "." + langs[ln] + " {";
+            if (langs[ln] != this.data.languages.current_language) {
+              str += " display:none; ";
+            }
+            str += " } ";
+          }
+          this.data.languages.language_css = $.vakata.css.add_sheet(
+              {'str': str});
+        }
+      },
+      create_node: function (obj, position, js, callback) {
+        var t = this.__call_old(true, obj, position, js, function (t) {
+          var langs = this._get_settings().languages,
+              a = t.children("a"),
+              ln;
+          if ($.isArray(langs) && langs.length) {
+            for (ln = 0; ln < langs.length; ln++) {
+              if (!a.is("." + langs[ln])) {
+                t.append(a.eq(0).clone().removeClass(langs.join(" ")).addClass(
+                    langs[ln]));
+              }
+            }
+            a.not("." + langs.join(", .")).remove();
+          }
+          if (callback) {
+            callback.call(this, t);
+          }
+        });
+        return t;
+      }
+    }
+  });
 })(jQuery);
 //*/
 
@@ -1689,70 +2379,89 @@
  * Depends on the jquery.cookie plugin
  */
 (function ($) {
-	$.jstree.plugin("cookies", {
-		__init : function () {
-			if(typeof $.cookie === "undefined") { throw "jsTree cookie: jQuery cookie plugin not included."; }
-
-			var s = this._get_settings().cookies,
-				tmp;
-			if(!!s.save_opened) {
-				tmp = $.cookie(s.save_opened);
-				if(tmp && tmp.length) { this.data.core.to_open = tmp.split(","); }
-			}
-			if(!!s.save_selected) {
-				tmp = $.cookie(s.save_selected);
-				if(tmp && tmp.length && this.data.ui) { this.data.ui.to_select = tmp.split(","); }
-			}
-			this.get_container()
-				.one( ( this.data.ui ? "reselect" : "reopen" ) + ".jstree", $.proxy(function () {
-					this.get_container()
-						.bind("open_node.jstree close_node.jstree select_node.jstree deselect_node.jstree", $.proxy(function (e) { 
-								if(this._get_settings().cookies.auto_save) { this.save_cookie((e.handleObj.namespace + e.handleObj.type).replace("jstree","")); }
-							}, this));
-				}, this));
-		},
-		defaults : {
-			save_opened		: "jstree_open",
-			save_selected	: "jstree_select",
-			auto_save		: true,
-			cookie_options	: {}
-		},
-		_fn : {
-			save_cookie : function (c) {
-				if(this.data.core.refreshing) { return; }
-				var s = this._get_settings().cookies;
-				if(!c) { // if called manually and not by event
-					if(s.save_opened) {
-						this.save_opened();
-						$.cookie(s.save_opened, this.data.core.to_open.join(","), s.cookie_options);
-					}
-					if(s.save_selected && this.data.ui) {
-						this.save_selected();
-						$.cookie(s.save_selected, this.data.ui.to_select.join(","), s.cookie_options);
-					}
-					return;
-				}
-				switch(c) {
-					case "open_node":
-					case "close_node":
-						if(!!s.save_opened) { 
-							this.save_opened(); 
-							$.cookie(s.save_opened, this.data.core.to_open.join(","), s.cookie_options); 
-						}
-						break;
-					case "select_node":
-					case "deselect_node":
-						if(!!s.save_selected && this.data.ui) { 
-							this.save_selected(); 
-							$.cookie(s.save_selected, this.data.ui.to_select.join(","), s.cookie_options); 
-						}
-						break;
-				}
-			}
-		}
-	});
-	// include cookies by default
-	$.jstree.defaults.plugins.push("cookies");
+  $.jstree.plugin("cookies", {
+    __init: function () {
+      if (typeof $.cookie === "undefined") {
+        throw "jsTree cookie: jQuery cookie plugin not included.";
+      }
+
+      var s = this._get_settings().cookies,
+          tmp;
+      if (!!s.save_opened) {
+        tmp = $.cookie(s.save_opened);
+        if (tmp && tmp.length) {
+          this.data.core.to_open = tmp.split(",");
+        }
+      }
+      if (!!s.save_selected) {
+        tmp = $.cookie(s.save_selected);
+        if (tmp && tmp.length && this.data.ui) {
+          this.data.ui.to_select = tmp.split(",");
+        }
+      }
+      this.get_container()
+      .one(( this.data.ui ? "reselect" : "reopen" ) + ".jstree",
+          $.proxy(function () {
+            this.get_container()
+            .bind(
+                "open_node.jstree close_node.jstree select_node.jstree deselect_node.jstree",
+                $.proxy(function (e) {
+                  if (this._get_settings().cookies.auto_save) {
+                    this.save_cookie(
+                        (e.handleObj.namespace + e.handleObj.type).replace(
+                            "jstree", ""));
+                  }
+                }, this));
+          }, this));
+    },
+    defaults: {
+      save_opened: "jstree_open",
+      save_selected: "jstree_select",
+      auto_save: true,
+      cookie_options: {}
+    },
+    _fn: {
+      save_cookie: function (c) {
+        if (this.data.core.refreshing) {
+          return;
+        }
+        var s = this._get_settings().cookies;
+        if (!c) { // if called manually and not by event
+          if (s.save_opened) {
+            this.save_opened();
+            $.cookie(s.save_opened, this.data.core.to_open.join(","),
+                s.cookie_options);
+          }
+          if (s.save_selected && this.data.ui) {
+            this.save_selected();
+            $.cookie(s.save_selected, this.data.ui.to_select.join(","),
+                s.cookie_options);
+          }
+          return;
+        }
+        switch (c) {
+          case "open_node":
+          case "close_node":
+            if (!!s.save_opened) {
+              this.save_opened();
+              $.cookie(s.save_opened, this.data.core.to_open.join(","),
+                  s.cookie_options);
+            }
+            break;
+          case "select_node":
+          case "deselect_node":
+            if (!!s.save_selected && this.data.ui) {
+              this.save_selected();
+              $.cookie(s.save_selected, this.data.ui.to_select.join(","),
+                  s.cookie_options);
+            }
+            break;
+        }
+      }
+    }
+  });
+  // include cookies by default
+  $.jstree.defaults.plugins.push("cookies");
 })(jQuery);
 //*/
 
@@ -1761,33 +2470,38 @@
  * Sorts items alphabetically (or using any other function)
  */
 (function ($) {
-	$.jstree.plugin("sort", {
-		__init : function () {
-			this.get_container()
-				.bind("load_node.jstree", $.proxy(function (e, data) {
-						var obj = this._get_node(data.rslt.obj);
-						obj = obj === -1 ? this.get_container().children("ul") : obj.children("ul");
-						this.sort(obj);
-					}, this))
-				.bind("rename_node.jstree", $.proxy(function (e, data) {
-						this.sort(data.rslt.obj.parent());
-					}, this))
-				.bind("move_node.jstree", $.proxy(function (e, data) {
-						var m = data.rslt.np == -1 ? this.get_container() : data.rslt.np;
-						this.sort(m.children("ul"));
-					}, this));
-		},
-		defaults : function (a, b) { return this.get_text(a) > this.get_text(b) ? 1 : -1; },
-		_fn : {
-			sort : function (obj) {
-				var s = this._get_settings().sort,
-					t = this;
-				obj.append($.makeArray(obj.children("li")).sort($.proxy(s, t)));
-				obj.find("> li > ul").each(function() { t.sort($(this)); });
-				this.clean_node(obj);
-			}
-		}
-	});
+  $.jstree.plugin("sort", {
+    __init: function () {
+      this.get_container()
+      .bind("load_node.jstree", $.proxy(function (e, data) {
+        var obj = this._get_node(data.rslt.obj);
+        obj = obj === -1 ? this.get_container().children("ul") : obj.children(
+            "ul");
+        this.sort(obj);
+      }, this))
+      .bind("rename_node.jstree", $.proxy(function (e, data) {
+        this.sort(data.rslt.obj.parent());
+      }, this))
+      .bind("move_node.jstree", $.proxy(function (e, data) {
+        var m = data.rslt.np == -1 ? this.get_container() : data.rslt.np;
+        this.sort(m.children("ul"));
+      }, this));
+    },
+    defaults: function (a, b) {
+      return this.get_text(a) > this.get_text(b) ? 1 : -1;
+    },
+    _fn: {
+      sort: function (obj) {
+        var s = this._get_settings().sort,
+            t = this;
+        obj.append($.makeArray(obj.children("li")).sort($.proxy(s, t)));
+        obj.find("> li > ul").each(function () {
+          t.sort($(this));
+        });
+        this.clean_node(obj);
+      }
+    }
+  });
 })(jQuery);
 //*/
 
@@ -1796,425 +2510,573 @@
  * Drag and drop plugin for moving/copying nodes
  */
 (function ($) {
-	var o = false,
-		r = false,
-		m = false,
-		sli = false,
-		sti = false,
-		dir1 = false,
-		dir2 = false;
-	$.vakata.dnd = {
-		is_down : false,
-		is_drag : false,
-		helper : false,
-		scroll_spd : 10,
-		init_x : 0,
-		init_y : 0,
-		threshold : 5,
-		user_data : {},
-
-		drag_start : function (e, data, html) { 
-			if($.vakata.dnd.is_drag) { $.vakata.drag_stop({}); }
-			try {
-				e.currentTarget.unselectable = "on";
-				e.currentTarget.onselectstart = function() { return false; };
-				if(e.currentTarget.style) { e.currentTarget.style.MozUserSelect = "none"; }
-			} catch(err) { }
-			$.vakata.dnd.init_x = e.pageX;
-			$.vakata.dnd.init_y = e.pageY;
-			$.vakata.dnd.user_data = data;
-			$.vakata.dnd.is_down = true;
-			$.vakata.dnd.helper = $("<div id='vakata-dragged'>").html(html).css("opacity", "0.75");
-			$(document).bind("mousemove", $.vakata.dnd.drag);
-			$(document).bind("mouseup", $.vakata.dnd.drag_stop);
-			return false;
-		},
-		drag : function (e) { 
-			if(!$.vakata.dnd.is_down) { return; }
-			if(!$.vakata.dnd.is_drag) {
-				if(Math.abs(e.pageX - $.vakata.dnd.init_x) > 5 || Math.abs(e.pageY - $.vakata.dnd.init_y) > 5) { 
-					$.vakata.dnd.helper.appendTo("body");
-					$.vakata.dnd.is_drag = true;
-					$(document).triggerHandler("drag_start.vakata", { "event" : e, "data" : $.vakata.dnd.user_data });
-				}
-				else { return; }
-			}
-
-			// maybe use a scrolling parent element instead of document?
-			if(e.type === "mousemove") { // thought of adding scroll in order to move the helper, but mouse poisition is n/a
-				var d = $(document), t = d.scrollTop(), l = d.scrollLeft();
-				if(e.pageY - t < 20) { 
-					if(sti && dir1 === "down") { clearInterval(sti); sti = false; }
-					if(!sti) { dir1 = "up"; sti = setInterval(function () { $(document).scrollTop($(document).scrollTop() - $.vakata.dnd.scroll_spd); }, 150); }
-				}
-				else { 
-					if(sti && dir1 === "up") { clearInterval(sti); sti = false; }
-				}
-				if($(window).height() - (e.pageY - t) < 20) {
-					if(sti && dir1 === "up") { clearInterval(sti); sti = false; }
-					if(!sti) { dir1 = "down"; sti = setInterval(function () { $(document).scrollTop($(document).scrollTop() + $.vakata.dnd.scroll_spd); }, 150); }
-				}
-				else { 
-					if(sti && dir1 === "down") { clearInterval(sti); sti = false; }
-				}
-
-				if(e.pageX - l < 20) {
-					if(sli && dir2 === "right") { clearInterval(sli); sli = false; }
-					if(!sli) { dir2 = "left"; sli = setInterval(function () { $(document).scrollLeft($(document).scrollLeft() - $.vakata.dnd.scroll_spd); }, 150); }
-				}
-				else { 
-					if(sli && dir2 === "left") { clearInterval(sli); sli = false; }
-				}
-				if($(window).width() - (e.pageX - l) < 20) {
-					if(sli && dir2 === "left") { clearInterval(sli); sli = false; }
-					if(!sli) { dir2 = "right"; sli = setInterval(function () { $(document).scrollLeft($(document).scrollLeft() + $.vakata.dnd.scroll_spd); }, 150); }
-				}
-				else { 
-					if(sli && dir2 === "right") { clearInterval(sli); sli = false; }
-				}
-			}
-
-			$.vakata.dnd.helper.css({ left : (e.pageX + 5) + "px", top : (e.pageY + 10) + "px" });
-			$(document).triggerHandler("drag.vakata", { "event" : e, "data" : $.vakata.dnd.user_data });
-		},
-		drag_stop : function (e) {
-			$(document).unbind("mousemove", $.vakata.dnd.drag);
-			$(document).unbind("mouseup", $.vakata.dnd.drag_stop);
-			$(document).triggerHandler("drag_stop.vakata", { "event" : e, "data" : $.vakata.dnd.user_data });
-			$.vakata.dnd.helper.remove();
-			$.vakata.dnd.init_x = 0;
-			$.vakata.dnd.init_y = 0;
-			$.vakata.dnd.user_data = {};
-			$.vakata.dnd.is_down = false;
-			$.vakata.dnd.is_drag = false;
-		}
-	};
-	$(function() {
-		var css_string = '#vakata-dragged { display:block; margin:0 0 0 0; padding:4px 4px 4px 24px; position:absolute; top:-2000px; line-height:16px; z-index:10000; } ';
-		$.vakata.css.add_sheet({ str : css_string });
-	});
-
-	$.jstree.plugin("dnd", {
-		__init : function () {
-			this.data.dnd = {
-				active : false,
-				after : false,
-				inside : false,
-				before : false,
-				off : false,
-				prepared : false,
-				w : 0,
-				to1 : false,
-				to2 : false,
-				cof : false,
-				cw : false,
-				ch : false,
-				i1 : false,
-				i2 : false
-			};
-			this.get_container()
-				.bind("mouseenter.jstree", $.proxy(function () {
-						if($.vakata.dnd.is_drag && $.vakata.dnd.user_data.jstree && this.data.themes) {
-							m.attr("class", "jstree-" + this.data.themes.theme); 
-							$.vakata.dnd.helper.attr("class", "jstree-dnd-helper jstree-" + this.data.themes.theme);
-						}
-					}, this))
-				.bind("mouseleave.jstree", $.proxy(function () {
-						if($.vakata.dnd.is_drag && $.vakata.dnd.user_data.jstree) {
-							if(this.data.dnd.i1) { clearInterval(this.data.dnd.i1); }
-							if(this.data.dnd.i2) { clearInterval(this.data.dnd.i2); }
-						}
-					}, this))
-				.bind("mousemove.jstree", $.proxy(function (e) {
-						if($.vakata.dnd.is_drag && $.vakata.dnd.user_data.jstree) {
-							var cnt = this.get_container()[0];
-
-							// Horizontal scroll
-							if(e.pageX + 24 > this.data.dnd.cof.left + this.data.dnd.cw) {
-								if(this.data.dnd.i1) { clearInterval(this.data.dnd.i1); }
-								this.data.dnd.i1 = setInterval($.proxy(function () { this.scrollLeft += $.vakata.dnd.scroll_spd; }, cnt), 100);
-							}
-							else if(e.pageX - 24 < this.data.dnd.cof.left) {
-								if(this.data.dnd.i1) { clearInterval(this.data.dnd.i1); }
-								this.data.dnd.i1 = setInterval($.proxy(function () { this.scrollLeft -= $.vakata.dnd.scroll_spd; }, cnt), 100);
-							}
-							else {
-								if(this.data.dnd.i1) { clearInterval(this.data.dnd.i1); }
-							}
-
-							// Vertical scroll
-							if(e.pageY + 24 > this.data.dnd.cof.top + this.data.dnd.ch) {
-								if(this.data.dnd.i2) { clearInterval(this.data.dnd.i2); }
-								this.data.dnd.i2 = setInterval($.proxy(function () { this.scrollTop += $.vakata.dnd.scroll_spd; }, cnt), 100);
-							}
-							else if(e.pageY - 24 < this.data.dnd.cof.top) {
-								if(this.data.dnd.i2) { clearInterval(this.data.dnd.i2); }
-								this.data.dnd.i2 = setInterval($.proxy(function () { this.scrollTop -= $.vakata.dnd.scroll_spd; }, cnt), 100);
-							}
-							else {
-								if(this.data.dnd.i2) { clearInterval(this.data.dnd.i2); }
-							}
-
-						}
-					}, this))
-				.delegate("a", "mousedown.jstree", $.proxy(function (e) { 
-						if(e.which === 1) {
-							this.start_drag(e.currentTarget, e);
-							return false;
-						}
-					}, this))
-				.delegate("a", "mouseenter.jstree", $.proxy(function (e) { 
-						if($.vakata.dnd.is_drag && $.vakata.dnd.user_data.jstree) {
-							this.dnd_enter(e.currentTarget);
-						}
-					}, this))
-				.delegate("a", "mousemove.jstree", $.proxy(function (e) { 
-						if($.vakata.dnd.is_drag && $.vakata.dnd.user_data.jstree) {
-							if(typeof this.data.dnd.off.top === "undefined") { this.data.dnd.off = $(e.target).offset(); }
-							this.data.dnd.w = (e.pageY - (this.data.dnd.off.top || 0)) % this.data.core.li_height;
-							if(this.data.dnd.w < 0) { this.data.dnd.w += this.data.core.li_height; }
-							this.dnd_show();
-						}
-					}, this))
-				.delegate("a", "mouseleave.jstree", $.proxy(function (e) { 
-						if($.vakata.dnd.is_drag && $.vakata.dnd.user_data.jstree) {
-							this.data.dnd.after		= false;
-							this.data.dnd.before	= false;
-							this.data.dnd.inside	= false;
-							$.vakata.dnd.helper.children("ins").attr("class","jstree-invalid");
-							m.hide();
-							if(r && r[0] === e.target.parentNode) {
-								if(this.data.dnd.to1) {
-									clearTimeout(this.data.dnd.to1);
-									this.data.dnd.to1 = false;
-								}
-								if(this.data.dnd.to2) {
-									clearTimeout(this.data.dnd.to2);
-									this.data.dnd.to2 = false;
-								}
-							}
-						}
-					}, this))
-				.delegate("a", "mouseup.jstree", $.proxy(function (e) { 
-						if($.vakata.dnd.is_drag && $.vakata.dnd.user_data.jstree) {
-							this.dnd_finish(e);
-						}
-					}, this));
-
-			$(document)
-				.bind("drag_stop.vakata", $.proxy(function () {
-						this.data.dnd.after		= false;
-						this.data.dnd.before	= false;
-						this.data.dnd.inside	= false;
-						this.data.dnd.off		= false;
-						this.data.dnd.prepared	= false;
-						this.data.dnd.w			= false;
-						this.data.dnd.to1		= false;
-						this.data.dnd.to2		= false;
-						this.data.dnd.active	= false;
-						this.data.dnd.foreign	= false;
-						if(m) { m.css({ "top" : "-2000px" }); }
-					}, this))
-				.bind("drag_start.vakata", $.proxy(function (e, data) {
-						if(data.data.jstree) { 
-							var et = $(data.event.target);
-							if(et.closest(".jstree").hasClass("jstree-" + this.get_index())) {
-								this.dnd_enter(et);
-							}
-						}
-					}, this));
-
-			var s = this._get_settings().dnd;
-			if(s.drag_target) {
-				$(document)
-					.delegate(s.drag_target, "mousedown.jstree", $.proxy(function (e) {
-						o = e.target;
-						$.vakata.dnd.drag_start(e, { jstree : true, obj : e.target }, "<ins class='jstree-icon'></ins>" + $(e.target).text() );
-						if(this.data.themes) { 
-							m.attr("class", "jstree-" + this.data.themes.theme); 
-							$.vakata.dnd.helper.attr("class", "jstree-dnd-helper jstree-" + this.data.themes.theme); 
-						}
-						$.vakata.dnd.helper.children("ins").attr("class","jstree-invalid");
-						var cnt = this.get_container();
-						this.data.dnd.cof = cnt.offset();
-						this.data.dnd.cw = parseInt(cnt.width(),10);
-						this.data.dnd.ch = parseInt(cnt.height(),10);
-						this.data.dnd.foreign = true;
-						return false;
-					}, this));
-			}
-			if(s.drop_target) {
-				$(document)
-					.delegate(s.drop_target, "mouseenter.jstree", $.proxy(function (e) {
-							if(this.data.dnd.active && this._get_settings().dnd.drop_check.call(this, { "o" : o, "r" : $(e.target) })) {
-								$.vakata.dnd.helper.children("ins").attr("class","jstree-ok");
-							}
-						}, this))
-					.delegate(s.drop_target, "mouseleave.jstree", $.proxy(function (e) {
-							if(this.data.dnd.active) {
-								$.vakata.dnd.helper.children("ins").attr("class","jstree-invalid");
-							}
-						}, this))
-					.delegate(s.drop_target, "mouseup.jstree", $.proxy(function (e) {
-							if(this.data.dnd.active && $.vakata.dnd.helper.children("ins").hasClass("jstree-ok")) {
-								this._get_settings().dnd.drop_finish.call(this, { "o" : o, "r" : $(e.target) });
-							}
-						}, this));
-			}
-		},
-		defaults : {
-			copy_modifier	: "ctrl",
-			check_timeout	: 200,
-			open_timeout	: 500,
-			drop_target		: ".jstree-drop",
-			drop_check		: function (data) { return true; },
-			drop_finish		: $.noop,
-			drag_target		: ".jstree-draggable",
-			drag_finish		: $.noop,
-			drag_check		: function (data) { return { after : false, before : false, inside : true }; }
-		},
-		_fn : {
-			dnd_prepare : function () {
-				if(!r || !r.length) { return; }
-				this.data.dnd.off = r.offset();
-				if(this._get_settings().core.rtl) {
-					this.data.dnd.off.right = this.data.dnd.off.left + r.width();
-				}
-				if(this.data.dnd.foreign) {
-					var a = this._get_settings().dnd.drag_check.call(this, { "o" : o, "r" : r });
-					this.data.dnd.after = a.after;
-					this.data.dnd.before = a.before;
-					this.data.dnd.inside = a.inside;
-					this.data.dnd.prepared = true;
-					return this.dnd_show();
-				}
-				this.prepare_move(o, r, "before");
-				this.data.dnd.before = this.check_move();
-				this.prepare_move(o, r, "after");
-				this.data.dnd.after = this.check_move();
-				if(this._is_loaded(r)) {
-					this.prepare_move(o, r, "inside");
-					this.data.dnd.inside = this.check_move();
-				}
-				else {
-					this.data.dnd.inside = false;
-				}
-				this.data.dnd.prepared = true;
-				return this.dnd_show();
-			},
-			dnd_show : function () {
-				if(!this.data.dnd.prepared) { return; }
-				var o = ["before","inside","after"],
-					r = false,
-					rtl = this._get_settings().core.rtl,
-					pos;
-				if(this.data.dnd.w < this.data.core.li_height/3) { o = ["before","inside","after"]; }
-				else if(this.data.dnd.w <= this.data.core.li_height*2/3) {
-					o = this.data.dnd.w < this.data.core.li_height/2 ? ["inside","before","after"] : ["inside","after","before"];
-				}
-				else { o = ["after","inside","before"]; }
-				$.each(o, $.proxy(function (i, val) { 
-					if(this.data.dnd[val]) {
-						$.vakata.dnd.helper.children("ins").attr("class","jstree-ok");
-						r = val;
-						return false;
-					}
-				}, this));
-				if(r === false) { $.vakata.dnd.helper.children("ins").attr("class","jstree-invalid"); }
-				
-				pos = rtl ? (this.data.dnd.off.right - 18) : (this.data.dnd.off.left + 10);
-				switch(r) {
-					case "before":
-						m.css({ "left" : pos + "px", "top" : (this.data.dnd.off.top - 6) + "px" }).show();
-						break;
-					case "after":
-						m.css({ "left" : pos + "px", "top" : (this.data.dnd.off.top + this.data.core.li_height - 7) + "px" }).show();
-						break;
-					case "inside":
-						m.css({ "left" : pos + ( rtl ? -4 : 4) + "px", "top" : (this.data.dnd.off.top + this.data.core.li_height/2 - 5) + "px" }).show();
-						break;
-					default:
-						m.hide();
-						break;
-				}
-				return r;
-			},
-			dnd_open : function () {
-				this.data.dnd.to2 = false;
-				this.open_node(r, $.proxy(this.dnd_prepare,this), true);
-			},
-			dnd_finish : function (e) {
-				if(this.data.dnd.foreign) {
-					if(this.data.dnd.after || this.data.dnd.before || this.data.dnd.inside) {
-						this._get_settings().dnd.drag_finish.call(this, { "o" : o, "r" : r });
-					}
-				}
-				else {
-					this.dnd_prepare();
-					this.move_node(o, r, this.dnd_show(), e[this._get_settings().dnd.copy_modifier + "Key"]);
-				}
-				o = false;
-				r = false;
-				m.hide();
-			},
-			dnd_enter : function (obj) {
-				var s = this._get_settings().dnd;
-				this.data.dnd.prepared = false;
-				r = this._get_node(obj);
-				if(s.check_timeout) { 
-					// do the calculations after a minimal timeout (users tend to drag quickly to the desired location)
-					if(this.data.dnd.to1) { clearTimeout(this.data.dnd.to1); }
-					this.data.dnd.to1 = setTimeout($.proxy(this.dnd_prepare, this), s.check_timeout); 
-				}
-				else { 
-					this.dnd_prepare(); 
-				}
-				if(s.open_timeout) { 
-					if(this.data.dnd.to2) { clearTimeout(this.data.dnd.to2); }
-					if(r && r.length && r.hasClass("jstree-closed")) { 
-						// if the node is closed - open it, then recalculate
-						this.data.dnd.to2 = setTimeout($.proxy(this.dnd_open, this), s.open_timeout);
-					}
-				}
-				else {
-					if(r && r.length && r.hasClass("jstree-closed")) { 
-						this.dnd_open();
-					}
-				}
-			},
-			start_drag : function (obj, e) {
-				o = this._get_node(obj);
-				if(this.data.ui && this.is_selected(o)) { o = this._get_node(null, true); }
-				$.vakata.dnd.drag_start(e, { jstree : true, obj : o }, "<ins class='jstree-icon'></ins>" + (o.length > 1 ? "Multiple selection" : this.get_text(o)) );
-				if(this.data.themes) { 
-					m.attr("class", "jstree-" + this.data.themes.theme); 
-					$.vakata.dnd.helper.attr("class", "jstree-dnd-helper jstree-" + this.data.themes.theme); 
-				}
-				var cnt = this.get_container();
-				this.data.dnd.cof = cnt.children("ul").offset();
-				this.data.dnd.cw = parseInt(cnt.width(),10);
-				this.data.dnd.ch = parseInt(cnt.height(),10);
-				this.data.dnd.active = true;
-			}
-		}
-	});
-	$(function() {
-		var css_string = '' + 
-			'#vakata-dragged ins { display:block; text-decoration:none; width:16px; height:16px; margin:0 0 0 0; padding:0; position:absolute; top:4px; left:4px; } ' + 
-			'#vakata-dragged .jstree-ok { background:green; } ' + 
-			'#vakata-dragged .jstree-invalid { background:red; } ' + 
-			'#jstree-marker { padding:0; margin:0; line-height:12px; font-size:1px; overflow:hidden; height:12px; width:8px; position:absolute; top:-30px; z-index:10000; background-repeat:no-repeat; display:none; background-color:silver; } ';
-		$.vakata.css.add_sheet({ str : css_string });
-		m = $("<div>").attr({ id : "jstree-marker" }).hide().appendTo("body");
-		$(document).bind("drag_start.vakata", function (e, data) {
-			if(data.data.jstree) { 
-				m.show(); 
-			}
-		});
-		$(document).bind("drag_stop.vakata", function (e, data) {
-			if(data.data.jstree) { m.hide(); }
-		});
-	});
+  var o = false,
+      r = false,
+      m = false,
+      sli = false,
+      sti = false,
+      dir1 = false,
+      dir2 = false;
+  $.vakata.dnd = {
+    is_down: false,
+    is_drag: false,
+    helper: false,
+    scroll_spd: 10,
+    init_x: 0,
+    init_y: 0,
+    threshold: 5,
+    user_data: {},
+
+    drag_start: function (e, data, html) {
+      if ($.vakata.dnd.is_drag) {
+        $.vakata.drag_stop({});
+      }
+      try {
+        e.currentTarget.unselectable = "on";
+        e.currentTarget.onselectstart = function () {
+          return false;
+        };
+        if (e.currentTarget.style) {
+          e.currentTarget.style.MozUserSelect = "none";
+        }
+      } catch (err) {
+      }
+      $.vakata.dnd.init_x = e.pageX;
+      $.vakata.dnd.init_y = e.pageY;
+      $.vakata.dnd.user_data = data;
+      $.vakata.dnd.is_down = true;
+      $.vakata.dnd.helper = $("<div id='vakata-dragged'>").html(html).css(
+          "opacity", "0.75");
+      $(document).bind("mousemove", $.vakata.dnd.drag);
+      $(document).bind("mouseup", $.vakata.dnd.drag_stop);
+      return false;
+    },
+    drag: function (e) {
+      if (!$.vakata.dnd.is_down) {
+        return;
+      }
+      if (!$.vakata.dnd.is_drag) {
+        if (Math.abs(e.pageX - $.vakata.dnd.init_x) > 5 || Math.abs(e.pageY
+                - $.vakata.dnd.init_y) > 5) {
+          $.vakata.dnd.helper.appendTo("body");
+          $.vakata.dnd.is_drag = true;
+          $(document).triggerHandler("drag_start.vakata",
+              {"event": e, "data": $.vakata.dnd.user_data});
+        }
+        else {
+          return;
+        }
+      }
+
+      // maybe use a scrolling parent element instead of document?
+      if (e.type === "mousemove") { // thought of adding scroll in order to move the helper, but mouse poisition is n/a
+        var d = $(document), t = d.scrollTop(), l = d.scrollLeft();
+        if (e.pageY - t < 20) {
+          if (sti && dir1 === "down") {
+            clearInterval(sti);
+            sti = false;
+          }
+          if (!sti) {
+            dir1 = "up";
+            sti = setInterval(function () {
+              $(document).scrollTop($(document).scrollTop()
+                  - $.vakata.dnd.scroll_spd);
+            }, 150);
+          }
+        }
+        else {
+          if (sti && dir1 === "up") {
+            clearInterval(sti);
+            sti = false;
+          }
+        }
+        if ($(window).height() - (e.pageY - t) < 20) {
+          if (sti && dir1 === "up") {
+            clearInterval(sti);
+            sti = false;
+          }
+          if (!sti) {
+            dir1 = "down";
+            sti = setInterval(function () {
+              $(document).scrollTop($(document).scrollTop()
+                  + $.vakata.dnd.scroll_spd);
+            }, 150);
+          }
+        }
+        else {
+          if (sti && dir1 === "down") {
+            clearInterval(sti);
+            sti = false;
+          }
+        }
+
+        if (e.pageX - l < 20) {
+          if (sli && dir2 === "right") {
+            clearInterval(sli);
+            sli = false;
+          }
+          if (!sli) {
+            dir2 = "left";
+            sli = setInterval(function () {
+              $(document).scrollLeft($(document).scrollLeft()
+                  - $.vakata.dnd.scroll_spd);
+            }, 150);
+          }
+        }
+        else {
+          if (sli && dir2 === "left") {
+            clearInterval(sli);
+            sli = false;
+          }
+        }
+        if ($(window).width() - (e.pageX - l) < 20) {
+          if (sli && dir2 === "left") {
+            clearInterval(sli);
+            sli = false;
+          }
+          if (!sli) {
+            dir2 = "right";
+            sli = setInterval(function () {
+              $(document).scrollLeft($(document).scrollLeft()
+                  + $.vakata.dnd.scroll_spd);
+            }, 150);
+          }
+        }
+        else {
+          if (sli && dir2 === "right") {
+            clearInterval(sli);
+            sli = false;
+          }
+        }
+      }
+
+      $.vakata.dnd.helper.css(
+          {left: (e.pageX + 5) + "px", top: (e.pageY + 10) + "px"});
+      $(document).triggerHandler("drag.vakata",
+          {"event": e, "data": $.vakata.dnd.user_data});
+    },
+    drag_stop: function (e) {
+      $(document).unbind("mousemove", $.vakata.dnd.drag);
+      $(document).unbind("mouseup", $.vakata.dnd.drag_stop);
+      $(document).triggerHandler("drag_stop.vakata",
+          {"event": e, "data": $.vakata.dnd.user_data});
+      $.vakata.dnd.helper.remove();
+      $.vakata.dnd.init_x = 0;
+      $.vakata.dnd.init_y = 0;
+      $.vakata.dnd.user_data = {};
+      $.vakata.dnd.is_down = false;
+      $.vakata.dnd.is_drag = false;
+    }
+  };
+  $(function () {
+    var css_string = '#vakata-dragged { display:block; margin:0 0 0 0; padding:4px 4px 4px 24px; position:absolute; top:-2000px; line-height:16px; z-index:10000; } ';
+    $.vakata.css.add_sheet({str: css_string});
+  });
+
+  $.jstree.plugin("dnd", {
+    __init: function () {
+      this.data.dnd = {
+        active: false,
+        after: false,
+        inside: false,
+        before: false,
+        off: false,
+        prepared: false,
+        w: 0,
+        to1: false,
+        to2: false,
+        cof: false,
+        cw: false,
+        ch: false,
+        i1: false,
+        i2: false
+      };
+      this.get_container()
+      .bind("mouseenter.jstree", $.proxy(function () {
+        if ($.vakata.dnd.is_drag && $.vakata.dnd.user_data.jstree
+            && this.data.themes) {
+          m.attr("class", "jstree-" + this.data.themes.theme);
+          $.vakata.dnd.helper.attr("class", "jstree-dnd-helper jstree-"
+              + this.data.themes.theme);
+        }
+      }, this))
+      .bind("mouseleave.jstree", $.proxy(function () {
+        if ($.vakata.dnd.is_drag && $.vakata.dnd.user_data.jstree) {
+          if (this.data.dnd.i1) {
+            clearInterval(this.data.dnd.i1);
+          }
+          if (this.data.dnd.i2) {
+            clearInterval(this.data.dnd.i2);
+          }
+        }
+      }, this))
+      .bind("mousemove.jstree", $.proxy(function (e) {
+        if ($.vakata.dnd.is_drag && $.vakata.dnd.user_data.jstree) {
+          var cnt = this.get_container()[0];
+
+          // Horizontal scroll
+          if (e.pageX + 24 > this.data.dnd.cof.left + this.data.dnd.cw) {
+            if (this.data.dnd.i1) {
+              clearInterval(this.data.dnd.i1);
+            }
+            this.data.dnd.i1 = setInterval($.proxy(function () {
+              this.scrollLeft += $.vakata.dnd.scroll_spd;
+            }, cnt), 100);
+          }
+          else if (e.pageX - 24 < this.data.dnd.cof.left) {
+            if (this.data.dnd.i1) {
+              clearInterval(this.data.dnd.i1);
+            }
+            this.data.dnd.i1 = setInterval($.proxy(function () {
+              this.scrollLeft -= $.vakata.dnd.scroll_spd;
+            }, cnt), 100);
+          }
+          else {
+            if (this.data.dnd.i1) {
+              clearInterval(this.data.dnd.i1);
+            }
+          }
+
+          // Vertical scroll
+          if (e.pageY + 24 > this.data.dnd.cof.top + this.data.dnd.ch) {
+            if (this.data.dnd.i2) {
+              clearInterval(this.data.dnd.i2);
+            }
+            this.data.dnd.i2 = setInterval($.proxy(function () {
+              this.scrollTop += $.vakata.dnd.scroll_spd;
+            }, cnt), 100);
+          }
+          else if (e.pageY - 24 < this.data.dnd.cof.top) {
+            if (this.data.dnd.i2) {
+              clearInterval(this.data.dnd.i2);
+            }
+            this.data.dnd.i2 = setInterval($.proxy(function () {
+              this.scrollTop -= $.vakata.dnd.scroll_spd;
+            }, cnt), 100);
+          }
+          else {
+            if (this.data.dnd.i2) {
+              clearInterval(this.data.dnd.i2);
+            }
+          }
+
+        }
+      }, this))
+      .delegate("a", "mousedown.jstree", $.proxy(function (e) {
+        if (e.which === 1) {
+          this.start_drag(e.currentTarget, e);
+          return false;
+        }
+      }, this))
+      .delegate("a", "mouseenter.jstree", $.proxy(function (e) {
+        if ($.vakata.dnd.is_drag && $.vakata.dnd.user_data.jstree) {
+          this.dnd_enter(e.currentTarget);
+        }
+      }, this))
+      .delegate("a", "mousemove.jstree", $.proxy(function (e) {
+        if ($.vakata.dnd.is_drag && $.vakata.dnd.user_data.jstree) {
+          if (typeof this.data.dnd.off.top === "undefined") {
+            this.data.dnd.off = $(e.target).offset();
+          }
+          this.data.dnd.w = (e.pageY - (this.data.dnd.off.top || 0))
+              % this.data.core.li_height;
+          if (this.data.dnd.w < 0) {
+            this.data.dnd.w += this.data.core.li_height;
+          }
+          this.dnd_show();
+        }
+      }, this))
+      .delegate("a", "mouseleave.jstree", $.proxy(function (e) {
+        if ($.vakata.dnd.is_drag && $.vakata.dnd.user_data.jstree) {
+          this.data.dnd.after = false;
+          this.data.dnd.before = false;
+          this.data.dnd.inside = false;
+          $.vakata.dnd.helper.children("ins").attr("class", "jstree-invalid");
+          m.hide();
+          if (r && r[0] === e.target.parentNode) {
+            if (this.data.dnd.to1) {
+              clearTimeout(this.data.dnd.to1);
+              this.data.dnd.to1 = false;
+            }
+            if (this.data.dnd.to2) {
+              clearTimeout(this.data.dnd.to2);
+              this.data.dnd.to2 = false;
+            }
+          }
+        }
+      }, this))
+      .delegate("a", "mouseup.jstree", $.proxy(function (e) {
+        if ($.vakata.dnd.is_drag && $.vakata.dnd.user_data.jstree) {
+          this.dnd_finish(e);
+        }
+      }, this));
+
+      $(document)
+      .bind("drag_stop.vakata", $.proxy(function () {
+        this.data.dnd.after = false;
+        this.data.dnd.before = false;
+        this.data.dnd.inside = false;
+        this.data.dnd.off = false;
+        this.data.dnd.prepared = false;
+        this.data.dnd.w = false;
+        this.data.dnd.to1 = false;
+        this.data.dnd.to2 = false;
+        this.data.dnd.active = false;
+        this.data.dnd.foreign = false;
+        if (m) {
+          m.css({"top": "-2000px"});
+        }
+      }, this))
+      .bind("drag_start.vakata", $.proxy(function (e, data) {
+        if (data.data.jstree) {
+          var et = $(data.event.target);
+          if (et.closest(".jstree").hasClass("jstree-" + this.get_index())) {
+            this.dnd_enter(et);
+          }
+        }
+      }, this));
+
+      var s = this._get_settings().dnd;
+      if (s.drag_target) {
+        $(document)
+        .delegate(s.drag_target, "mousedown.jstree", $.proxy(function (e) {
+          o = e.target;
+          $.vakata.dnd.drag_start(e,
+              {jstree: true, obj: e.target}, "<ins class='jstree-icon'></ins>"
+              + $(e.target).text());
+          if (this.data.themes) {
+            m.attr("class", "jstree-" + this.data.themes.theme);
+            $.vakata.dnd.helper.attr("class", "jstree-dnd-helper jstree-"
+                + this.data.themes.theme);
+          }
+          $.vakata.dnd.helper.children("ins").attr("class", "jstree-invalid");
+          var cnt = this.get_container();
+          this.data.dnd.cof = cnt.offset();
+          this.data.dnd.cw = parseInt(cnt.width(), 10);
+          this.data.dnd.ch = parseInt(cnt.height(), 10);
+          this.data.dnd.foreign = true;
+          return false;
+        }, this));
+      }
+      if (s.drop_target) {
+        $(document)
+        .delegate(s.drop_target, "mouseenter.jstree", $.proxy(function (e) {
+          if (this.data.dnd.active && this._get_settings().dnd.drop_check.call(
+                  this, {"o": o, "r": $(e.target)})) {
+            $.vakata.dnd.helper.children("ins").attr("class", "jstree-ok");
+          }
+        }, this))
+        .delegate(s.drop_target, "mouseleave.jstree", $.proxy(function (e) {
+          if (this.data.dnd.active) {
+            $.vakata.dnd.helper.children("ins").attr("class", "jstree-invalid");
+          }
+        }, this))
+        .delegate(s.drop_target, "mouseup.jstree", $.proxy(function (e) {
+          if (this.data.dnd.active && $.vakata.dnd.helper.children(
+                  "ins").hasClass("jstree-ok")) {
+            this._get_settings().dnd.drop_finish.call(this,
+                {"o": o, "r": $(e.target)});
+          }
+        }, this));
+      }
+    },
+    defaults: {
+      copy_modifier: "ctrl",
+      check_timeout: 200,
+      open_timeout: 500,
+      drop_target: ".jstree-drop",
+      drop_check: function (data) {
+        return true;
+      },
+      drop_finish: $.noop,
+      drag_target: ".jstree-draggable",
+      drag_finish: $.noop,
+      drag_check: function (data) {
+        return {after: false, before: false, inside: true};
+      }
+    },
+    _fn: {
+      dnd_prepare: function () {
+        if (!r || !r.length) {
+          return;
+        }
+        this.data.dnd.off = r.offset();
+        if (this._get_settings().core.rtl) {
+          this.data.dnd.off.right = this.data.dnd.off.left + r.width();
+        }
+        if (this.data.dnd.foreign) {
+          var a = this._get_settings().dnd.drag_check.call(this,
+              {"o": o, "r": r});
+          this.data.dnd.after = a.after;
+          this.data.dnd.before = a.before;
+          this.data.dnd.inside = a.inside;
+          this.data.dnd.prepared = true;
+          return this.dnd_show();
+        }
+        this.prepare_move(o, r, "before");
+        this.data.dnd.before = this.check_move();
+        this.prepare_move(o, r, "after");
+        this.data.dnd.after = this.check_move();
+        if (this._is_loaded(r)) {
+          this.prepare_move(o, r, "inside");
+          this.data.dnd.inside = this.check_move();
+        }
+        else {
+          this.data.dnd.inside = false;
+        }
+        this.data.dnd.prepared = true;
+        return this.dnd_show();
+      },
+      dnd_show: function () {
+        if (!this.data.dnd.prepared) {
+          return;
+        }
+        var o = ["before", "inside", "after"],
+            r = false,
+            rtl = this._get_settings().core.rtl,
+            pos;
+        if (this.data.dnd.w < this.data.core.li_height / 3) {
+          o = ["before", "inside", "after"];
+        }
+        else if (this.data.dnd.w <= this.data.core.li_height * 2 / 3) {
+          o = this.data.dnd.w < this.data.core.li_height / 2 ? ["inside",
+            "before", "after"] : ["inside", "after", "before"];
+        }
+        else {
+          o = ["after", "inside", "before"];
+        }
+        $.each(o, $.proxy(function (i, val) {
+          if (this.data.dnd[val]) {
+            $.vakata.dnd.helper.children("ins").attr("class", "jstree-ok");
+            r = val;
+            return false;
+          }
+        }, this));
+        if (r === false) {
+          $.vakata.dnd.helper.children("ins").attr("class", "jstree-invalid");
+        }
+
+        pos = rtl ? (this.data.dnd.off.right - 18) : (this.data.dnd.off.left
+            + 10);
+        switch (r) {
+          case "before":
+            m.css({
+              "left": pos + "px",
+              "top": (this.data.dnd.off.top - 6) + "px"
+            }).show();
+            break;
+          case "after":
+            m.css({
+              "left": pos + "px",
+              "top": (this.data.dnd.off.top + this.data.core.li_height - 7)
+              + "px"
+            }).show();
+            break;
+          case "inside":
+            m.css({
+              "left": pos + ( rtl ? -4 : 4) + "px",
+              "top": (this.data.dnd.off.top + this.data.core.li_height / 2 - 5)
+              + "px"
+            }).show();
+            break;
+          default:
+            m.hide();
+            break;
+        }
+        return r;
+      },
+      dnd_open: function () {
+        this.data.dnd.to2 = false;
+        this.open_node(r, $.proxy(this.dnd_prepare, this), true);
+      },
+      dnd_finish: function (e) {
+        if (this.data.dnd.foreign) {
+          if (this.data.dnd.after || this.data.dnd.before
+              || this.data.dnd.inside) {
+            this._get_settings().dnd.drag_finish.call(this, {"o": o, "r": r});
+          }
+        }
+        else {
+          this.dnd_prepare();
+          this.move_node(o, r, this.dnd_show(),
+              e[this._get_settings().dnd.copy_modifier + "Key"]);
+        }
+        o = false;
+        r = false;
+        m.hide();
+      },
+      dnd_enter: function (obj) {
+        var s = this._get_settings().dnd;
+        this.data.dnd.prepared = false;
+        r = this._get_node(obj);
+        if (s.check_timeout) {
+          // do the calculations after a minimal timeout (users tend to drag quickly to the desired location)
+          if (this.data.dnd.to1) {
+            clearTimeout(this.data.dnd.to1);
+          }
+          this.data.dnd.to1 = setTimeout($.proxy(this.dnd_prepare, this),
+              s.check_timeout);
+        }
+        else {
+          this.dnd_prepare();
+        }
+        if (s.open_timeout) {
+          if (this.data.dnd.to2) {
+            clearTimeout(this.data.dnd.to2);
+          }
+          if (r && r.length && r.hasClass("jstree-closed")) {
+            // if the node is closed - open it, then recalculate
+            this.data.dnd.to2 = setTimeout($.proxy(this.dnd_open, this),
+                s.open_timeout);
+          }
+        }
+        else {
+          if (r && r.length && r.hasClass("jstree-closed")) {
+            this.dnd_open();
+          }
+        }
+      },
+      start_drag: function (obj, e) {
+        o = this._get_node(obj);
+        if (this.data.ui && this.is_selected(o)) {
+          o = this._get_node(null, true);
+        }
+        $.vakata.dnd.drag_start(e,
+            {jstree: true, obj: o}, "<ins class='jstree-icon'></ins>"
+            + (o.length > 1 ? "Multiple selection" : this.get_text(o)));
+        if (this.data.themes) {
+          m.attr("class", "jstree-" + this.data.themes.theme);
+          $.vakata.dnd.helper.attr("class", "jstree-dnd-helper jstree-"
+              + this.data.themes.theme);
+        }
+        var cnt = this.get_container();
+        this.data.dnd.cof = cnt.children("ul").offset();
+        this.data.dnd.cw = parseInt(cnt.width(), 10);
+        this.data.dnd.ch = parseInt(cnt.height(), 10);
+        this.data.dnd.active = true;
+      }
+    }
+  });
+  $(function () {
+    var css_string = '' +
+        '#vakata-dragged ins { display:block; text-decoration:none; width:16px; height:16px; margin:0 0 0 0; padding:0; position:absolute; top:4px; left:4px; } '
+        +
+        '#vakata-dragged .jstree-ok { background:green; } ' +
+        '#vakata-dragged .jstree-invalid { background:red; } ' +
+        '#jstree-marker { padding:0; margin:0; line-height:12px; font-size:1px; overflow:hidden; height:12px; width:8px; position:absolute; top:-30px; z-index:10000; background-repeat:no-repeat; display:none; background-color:silver; } ';
+    $.vakata.css.add_sheet({str: css_string});
+    m = $("<div>").attr({id: "jstree-marker"}).hide().appendTo("body");
+    $(document).bind("drag_start.vakata", function (e, data) {
+      if (data.data.jstree) {
+        m.show();
+      }
+    });
+    $(document).bind("drag_stop.vakata", function (e, data) {
+      if (data.data.jstree) {
+        m.hide();
+      }
+    });
+  });
 })(jQuery);
 //*/
 
@@ -2225,489 +3087,685 @@
  * DOES NOT WORK NICELY WITH MULTITREE DRAG'N'DROP
  */
 (function ($) {
-	$.jstree.plugin("checkbox", {
-		__init : function () {
-			this.select_node = this.deselect_node = this.deselect_all = $.noop;
-			this.get_selected = this.get_checked;
-
-			this.get_container()
-				.bind("open_node.jstree create_node.jstree clean_node.jstree", $.proxy(function (e, data) { 
-						this._prepare_checkboxes(data.rslt.obj);
-					}, this))
-				.bind("loaded.jstree", $.proxy(function (e) {
-						this._prepare_checkboxes();
-					}, this))
-				.delegate("a", "click.jstree", $.proxy(function (e) {
-						if(this._get_node(e.target).hasClass("jstree-checked")) { this.uncheck_node(e.target); }
-						else { this.check_node(e.target); }
-						if(this.data.ui) { this.save_selected(); }
-						if(this.data.cookies) { this.save_cookie("select_node"); }
-						e.preventDefault();
-					}, this));
-		},
-		__destroy : function () {
-			this.get_container().find(".jstree-checkbox").remove();
-		},
-		_fn : {
-			_prepare_checkboxes : function (obj) {
-				obj = !obj || obj == -1 ? this.get_container() : this._get_node(obj);
-				var c, _this = this, t;
-				obj.each(function () {
-					t = $(this);
-					c = t.is("li") && t.hasClass("jstree-checked") ? "jstree-checked" : "jstree-unchecked";
-					t.find("a").not(":has(.jstree-checkbox)").prepend("<ins class='jstree-checkbox'>&#160;</ins>").parent().not(".jstree-checked, .jstree-unchecked").addClass(c);
-				});
-				if(obj.is("li")) { this._repair_state(obj); }
-				else { obj.find("> ul > li").each(function () { _this._repair_state(this); }); }
-			},
-			change_state : function (obj, state) {
-				obj = this._get_node(obj);
-				state = (state === false || state === true) ? state : obj.hasClass("jstree-checked");
-				if(state) { obj.find("li").andSelf().removeClass("jstree-checked jstree-undetermined").addClass("jstree-unchecked"); }
-				else { 
-					obj.find("li").andSelf().removeClass("jstree-unchecked jstree-undetermined").addClass("jstree-checked"); 
-					if(this.data.ui) { this.data.ui.last_selected = obj; }
-					this.data.checkbox.last_selected = obj;
-				}
-				obj.parentsUntil(".jstree", "li").each(function () {
-					var $this = $(this);
-					if(state) {
-						if($this.children("ul").children(".jstree-checked, .jstree-undetermined").length) {
-							$this.parentsUntil(".jstree", "li").andSelf().removeClass("jstree-checked jstree-unchecked").addClass("jstree-undetermined");
-							return false;
-						}
-						else {
-							$this.removeClass("jstree-checked jstree-undetermined").addClass("jstree-unchecked");
-						}
-					}
-					else {
-						if($this.children("ul").children(".jstree-unchecked, .jstree-undetermined").length) {
-							$this.parentsUntil(".jstree", "li").andSelf().removeClass("jstree-checked jstree-unchecked").addClass("jstree-undetermined");
-							return false;
-						}
-						else {
-							$this.removeClass("jstree-unchecked jstree-undetermined").addClass("jstree-checked");
-						}
-					}
-				});
-				if(this.data.ui) { this.data.ui.selected = this.get_checked(); }
-				this.__callback(obj);
-			},
-			check_node : function (obj) {
-				this.change_state(obj, false);
-			},
-			uncheck_node : function (obj) {
-				this.change_state(obj, true);
-			},
-			check_all : function () {
-				var _this = this;
-				this.get_container().children("ul").children("li").each(function () {
-					_this.check_node(this, false);
-				});
-			},
-			uncheck_all : function () {
-				var _this = this;
-				this.get_container().children("ul").children("li").each(function () {
-					_this.change_state(this, true);
-				});
-			},
-
-			is_checked : function(obj) {
-				obj = this._get_node(obj);
-				return obj.length ? obj.is(".jstree-checked") : false;
-			},
-			get_checked : function (obj) {
-				obj = !obj || obj === -1 ? this.get_container() : this._get_node(obj);
-				return obj.find("> ul > .jstree-checked, .jstree-undetermined > ul > .jstree-checked");
-			},
-			get_unchecked : function (obj) { 
-				obj = !obj || obj === -1 ? this.get_container() : this._get_node(obj);
-				return obj.find("> ul > .jstree-unchecked, .jstree-undetermined > ul > .jstree-unchecked");
-			},
-
-			show_checkboxes : function () { this.get_container().children("ul").removeClass("jstree-no-checkboxes"); },
-			hide_checkboxes : function () { this.get_container().children("ul").addClass("jstree-no-checkboxes"); },
-
-			_repair_state : function (obj) {
-				obj = this._get_node(obj);
-				if(!obj.length) { return; }
-				var a = obj.find("> ul > .jstree-checked").length,
-					b = obj.find("> ul > .jstree-undetermined").length,
-					c = obj.find("> ul > li").length;
-
-				if(c === 0) { if(obj.hasClass("jstree-undetermined")) { this.check_node(obj); } }
-				else if(a === 0 && b === 0) { this.uncheck_node(obj); }
-				else if(a === c) { this.check_node(obj); }
-				else { 
-					obj.parentsUntil(".jstree","li").removeClass("jstree-checked jstree-unchecked").addClass("jstree-undetermined");
-				}
-			},
-			reselect : function () {
-				if(this.data.ui) { 
-					var _this = this,
-						s = this.data.ui.to_select;
-					s = $.map($.makeArray(s), function (n) { return "#" + n.toString().replace(/^#/,"").replace('\\/','/').replace('/','\\/'); });
-					this.deselect_all();
-					$.each(s, function (i, val) { _this.check_node(val); });
-					this.__callback();
-				}
-			}
-		}
-	});
+  $.jstree.plugin("checkbox", {
+    __init: function () {
+      this.select_node = this.deselect_node = this.deselect_all = $.noop;
+      this.get_selected = this.get_checked;
+
+      this.get_container()
+      .bind("open_node.jstree create_node.jstree clean_node.jstree",
+          $.proxy(function (e, data) {
+            this._prepare_checkboxes(data.rslt.obj);
+          }, this))
+      .bind("loaded.jstree", $.proxy(function (e) {
+        this._prepare_checkboxes();
+      }, this))
+      .delegate("a", "click.jstree", $.proxy(function (e) {
+        if (this._get_node(e.target).hasClass("jstree-checked")) {
+          this.uncheck_node(e.target);
+        }
+        else {
+          this.check_node(e.target);
+        }
+        if (this.data.ui) {
+          this.save_selected();
+        }
+        if (this.data.cookies) {
+          this.save_cookie("select_node");
+        }
+        e.preventDefault();
+      }, this));
+    },
+    __destroy: function () {
+      this.get_container().find(".jstree-checkbox").remove();
+    },
+    _fn: {
+      _prepare_checkboxes: function (obj) {
+        obj = !obj || obj == -1 ? this.get_container() : this._get_node(obj);
+        var c, _this = this, t;
+        obj.each(function () {
+          t = $(this);
+          c = t.is("li") && t.hasClass("jstree-checked") ? "jstree-checked"
+              : "jstree-unchecked";
+          t.find("a").not(":has(.jstree-checkbox)").prepend(
+              "<ins class='jstree-checkbox'>&#160;</ins>").parent().not(
+              ".jstree-checked, .jstree-unchecked").addClass(c);
+        });
+        if (obj.is("li")) {
+          this._repair_state(obj);
+        }
+        else {
+          obj.find("> ul > li").each(function () {
+            _this._repair_state(this);
+          });
+        }
+      },
+      change_state: function (obj, state) {
+        obj = this._get_node(obj);
+        state = (state === false || state === true) ? state : obj.hasClass(
+            "jstree-checked");
+        if (state) {
+          obj.find("li").andSelf().removeClass(
+              "jstree-checked jstree-undetermined").addClass(
+              "jstree-unchecked");
+        }
+        else {
+          obj.find("li").andSelf().removeClass(
+              "jstree-unchecked jstree-undetermined").addClass(
+              "jstree-checked");
+          if (this.data.ui) {
+            this.data.ui.last_selected = obj;
+          }
+          this.data.checkbox.last_selected = obj;
+        }
+        obj.parentsUntil(".jstree", "li").each(function () {
+          var $this = $(this);
+          if (state) {
+            if ($this.children("ul").children(
+                    ".jstree-checked, .jstree-undetermined").length) {
+              $this.parentsUntil(".jstree", "li").andSelf().removeClass(
+                  "jstree-checked jstree-unchecked").addClass(
+                  "jstree-undetermined");
+              return false;
+            }
+            else {
+              $this.removeClass("jstree-checked jstree-undetermined").addClass(
+                  "jstree-unchecked");
+            }
+          }
+          else {
+            if ($this.children("ul").children(
+                    ".jstree-unchecked, .jstree-undetermined").length) {
+              $this.parentsUntil(".jstree", "li").andSelf().removeClass(
+                  "jstree-checked jstree-unchecked").addClass(
+                  "jstree-undetermined");
+              return false;
+            }
+            else {
+              $this.removeClass(
+                  "jstree-unchecked jstree-undetermined").addClass(
+                  "jstree-checked");
+            }
+          }
+        });
+        if (this.data.ui) {
+          this.data.ui.selected = this.get_checked();
+        }
+        this.__callback(obj);
+      },
+      check_node: function (obj) {
+        this.change_state(obj, false);
+      },
+      uncheck_node: function (obj) {
+        this.change_state(obj, true);
+      },
+      check_all: function () {
+        var _this = this;
+        this.get_container().children("ul").children("li").each(function () {
+          _this.check_node(this, false);
+        });
+      },
+      uncheck_all: function () {
+        var _this = this;
+        this.get_container().children("ul").children("li").each(function () {
+          _this.change_state(this, true);
+        });
+      },
+
+      is_checked: function (obj) {
+        obj = this._get_node(obj);
+        return obj.length ? obj.is(".jstree-checked") : false;
+      },
+      get_checked: function (obj) {
+        obj = !obj || obj === -1 ? this.get_container() : this._get_node(obj);
+        return obj.find(
+            "> ul > .jstree-checked, .jstree-undetermined > ul > .jstree-checked");
+      },
+      get_unchecked: function (obj) {
+        obj = !obj || obj === -1 ? this.get_container() : this._get_node(obj);
+        return obj.find(
+            "> ul > .jstree-unchecked, .jstree-undetermined > ul > .jstree-unchecked");
+      },
+
+      show_checkboxes: function () {
+        this.get_container().children("ul").removeClass("jstree-no-checkboxes");
+      },
+      hide_checkboxes: function () {
+        this.get_container().children("ul").addClass("jstree-no-checkboxes");
+      },
+
+      _repair_state: function (obj) {
+        obj = this._get_node(obj);
+        if (!obj.length) {
+          return;
+        }
+        var a = obj.find("> ul > .jstree-checked").length,
+            b = obj.find("> ul > .jstree-undetermined").length,
+            c = obj.find("> ul > li").length;
+
+        if (c === 0) {
+          if (obj.hasClass("jstree-undetermined")) {
+            this.check_node(obj);
+          }
+        }
+        else if (a === 0 && b === 0) {
+          this.uncheck_node(obj);
+        }
+        else if (a === c) {
+          this.check_node(obj);
+        }
+        else {
+          obj.parentsUntil(".jstree", "li").removeClass(
+              "jstree-checked jstree-unchecked").addClass(
+              "jstree-undetermined");
+        }
+      },
+      reselect: function () {
+        if (this.data.ui) {
+          var _this = this,
+              s = this.data.ui.to_select;
+          s = $.map($.makeArray(s), function (n) {
+            return "#" + n.toString().replace(/^#/, "").replace('\\/',
+                '/').replace('/', '\\/');
+          });
+          this.deselect_all();
+          $.each(s, function (i, val) {
+            _this.check_node(val);
+          });
+          this.__callback();
+        }
+      }
+    }
+  });
 })(jQuery);
 //*/
 
-/* 
+/*
  * jsTree XML 1.0
  * The XML data store. Datastores are build by overriding the `load_node` and `_is_loaded` functions.
  */
 (function ($) {
-	$.vakata.xslt = function (xml, xsl, callback) {
-		var rs = "", xm, xs, processor, support;
-		if(document.recalc) {
-			xm = document.createElement('xml');
-			xs = document.createElement('xml');
-			xm.innerHTML = xml;
-			xs.innerHTML = xsl;
-			$("body").append(xm).append(xs);
-			setTimeout( (function (xm, xs, callback) {
-				return function () {
-					callback.call(null, xm.transformNode(xs.XMLDocument));
-					setTimeout( (function (xm, xs) { return function () { jQuery("body").remove(xm).remove(xs); }; })(xm, xs), 200);
-				};
-			}) (xm, xs, callback), 100);
-			return true;
-		}
-		if(typeof window.DOMParser !== "undefined" && typeof window.XMLHttpRequest !== "undefined" && typeof window.XSLTProcessor !== "undefined") {
-			processor = new XSLTProcessor();
-			support = $.isFunction(processor.transformDocument) ? (typeof window.XMLSerializer !== "undefined") : true;
-			if(!support) { return false; }
-			xml = new DOMParser().parseFromString(xml, "text/xml");
-			xsl = new DOMParser().parseFromString(xsl, "text/xml");
-			if($.isFunction(processor.transformDocument)) {
-				rs = document.implementation.createDocument("", "", null);
-				processor.transformDocument(xml, xsl, rs, null);
-				callback.call(null, XMLSerializer().serializeToString(rs));
-				return true;
-			}
-			else {
-				processor.importStylesheet(xsl);
-				rs = processor.transformToFragment(xml, document);
-				callback.call(null, $("<div>").append(rs).html());
-				return true;
-			}
-		}
-		return false;
-	};
-	var xsl = {
-		'nest' : '<?xml version="1.0" encoding="utf-8" ?>' + 
-			'<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" >' + 
-			'<xsl:output method="html" encoding="utf-8" omit-xml-declaration="yes" standalone="no" indent="no" media-type="text/html" />' + 
-			'<xsl:template match="/">' + 
-			'	<xsl:call-template name="nodes">' + 
-			'		<xsl:with-param name="node" select="/root" />' + 
-			'	</xsl:call-template>' + 
-			'</xsl:template>' + 
-			'<xsl:template name="nodes">' + 
-			'	<xsl:param name="node" />' + 
-			'	<ul>' + 
-			'	<xsl:for-each select="$node/item">' + 
-			'		<xsl:variable name="children" select="count(./item) &gt; 0" />' + 
-			'		<li>' + 
-			'			<xsl:attribute name="class">' + 
-			'				<xsl:if test="position() = last()">jstree-last </xsl:if>' + 
-			'				<xsl:choose>' + 
-			'					<xsl:when test="@state = \'open\'">jstree-open </xsl:when>' + 
-			'					<xsl:when test="$children or @hasChildren or @state = \'closed\'">jstree-closed </xsl:when>' + 
-			'					<xsl:otherwise>jstree-leaf </xsl:otherwise>' + 
-			'				</xsl:choose>' + 
-			'				<xsl:value-of select="@class" />' + 
-			'			</xsl:attribute>' + 
-			'			<xsl:for-each select="@*">' + 
-			'				<xsl:if test="name() != \'class\' and name() != \'state\' and name() != \'hasChildren\'">' + 
-			'					<xsl:attribute name="{name()}"><xsl:value-of select="." /></xsl:attribute>' + 
-			'				</xsl:if>' + 
-			'			</xsl:for-each>' + 
-			'	<ins class="jstree-icon"><xsl:text>&#xa0;</xsl:text></ins>' + 
-			'			<xsl:for-each select="content/name">' + 
-			'				<a>' + 
-			'				<xsl:attribute name="href">' + 
-			'					<xsl:choose>' + 
-			'					<xsl:when test="@href"><xsl:value-of select="@href" /></xsl:when>' + 
-			'					<xsl:otherwise>#</xsl:otherwise>' + 
-			'					</xsl:choose>' + 
-			'				</xsl:attribute>' + 
-			'				<xsl:attribute name="class"><xsl:value-of select="@lang" /> <xsl:value-of select="@class" /></xsl:attribute>' + 
-			'				<xsl:attribute name="style"><xsl:value-of select="@style" /></xsl:attribute>' + 
-			'				<xsl:for-each select="@*">' + 
-			'					<xsl:if test="name() != \'style\' and name() != \'class\' and name() != \'href\'">' + 
-			'						<xsl:attribute name="{name()}"><xsl:value-of select="." /></xsl:attribute>' + 
-			'					</xsl:if>' + 
-			'				</xsl:for-each>' + 
-			'					<ins>' + 
-			'						<xsl:attribute name="class">jstree-icon ' + 
-			'							<xsl:if test="string-length(attribute::icon) > 0 and not(contains(@icon,\'/\'))"><xsl:value-of select="@icon" /></xsl:if>' + 
-			'						</xsl:attribute>' + 
-			'						<xsl:if test="string-length(attribute::icon) > 0 and contains(@icon,\'/\')"><xsl:attribute name="style">background:url(<xsl:value-of select="@icon" />) center center no-repeat;</xsl:attribute></xsl:if>' + 
-			'						<xsl:text>&#xa0;</xsl:text>' + 
-			'					</ins>' + 
-			'					<xsl:value-of select="current()" />' + 
-			'				</a>' + 
-			'			</xsl:for-each>' + 
-			'			<xsl:if test="$children or @hasChildren"><xsl:call-template name="nodes"><xsl:with-param name="node" select="current()" /></xsl:call-template></xsl:if>' + 
-			'		</li>' + 
-			'	</xsl:for-each>' + 
-			'	</ul>' + 
-			'</xsl:template>' + 
-			'</xsl:stylesheet>',
-
-		'flat' : '<?xml version="1.0" encoding="utf-8" ?>' + 
-			'<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" >' + 
-			'<xsl:output method="html" encoding="utf-8" omit-xml-declaration="yes" standalone="no" indent="no" media-type="text/xml" />' + 
-			'<xsl:template match="/">' + 
-			'	<ul>' + 
-			'	<xsl:for-each select="//item[not(@parent_id) or @parent_id=0 or not(@parent_id = //item/@id)]">' + /* the last `or` may be removed */
-			'		<xsl:call-template name="nodes">' + 
-			'			<xsl:with-param name="node" select="." />' + 
-			'			<xsl:with-param name="is_last" select="number(position() = last())" />' + 
-			'		</xsl:call-template>' + 
-			'	</xsl:for-each>' + 
-			'	</ul>' + 
-			'</xsl:template>' + 
-			'<xsl:template name="nodes">' + 
-			'	<xsl:param name="node" />' + 
-			'	<xsl:param name="is_last" />' + 
-			'	<xsl:variable name="children" select="count(//item[@parent_id=$node/attribute::id]) &gt; 0" />' + 
-			'	<li>' + 
-			'	<xsl:attribute name="class">' + 
-			'		<xsl:if test="$is_last = true()">jstree-last </xsl:if>' + 
-			'		<xsl:choose>' + 
-			'			<xsl:when test="@state = \'open\'">jstree-open </xsl:when>' + 
-			'			<xsl:when test="$children or @hasChildren or @state = \'closed\'">jstree-closed </xsl:when>' + 
-			'			<xsl:otherwise>jstree-leaf </xsl:otherwise>' + 
-			'		</xsl:choose>' + 
-			'		<xsl:value-of select="@class" />' + 
-			'	</xsl:attribute>' + 
-			'	<xsl:for-each select="@*">' + 
-			'		<xsl:if test="name() != \'parent_id\' and name() != \'hasChildren\' and name() != \'class\' and name() != \'state\'">' + 
-			'		<xsl:attribute name="{name()}"><xsl:value-of select="." /></xsl:attribute>' + 
-			'		</xsl:if>' + 
-			'	</xsl:for-each>' + 
-			'	<ins class="jstree-icon"><xsl:text>&#xa0;</xsl:text></ins>' + 
-			'	<xsl:for-each select="content/name">' + 
-			'		<a>' + 
-			'		<xsl:attribute name="href">' + 
-			'			<xsl:choose>' + 
-			'			<xsl:when test="@href"><xsl:value-of select="@href" /></xsl:when>' + 
-			'			<xsl:otherwise>#</xsl:otherwise>' + 
-			'			</xsl:choose>' + 
-			'		</xsl:attribute>' + 
-			'		<xsl:attribute name="class"><xsl:value-of select="@lang" /> <xsl:value-of select="@class" /></xsl:attribute>' + 
-			'		<xsl:attribute name="style"><xsl:value-of select="@style" /></xsl:attribute>' + 
-			'		<xsl:for-each select="@*">' + 
-			'			<xsl:if test="name() != \'style\' and name() != \'class\' and name() != \'href\'">' + 
-			'				<xsl:attribute name="{name()}"><xsl:value-of select="." /></xsl:attribute>' + 
-			'			</xsl:if>' + 
-			'		</xsl:for-each>' + 
-			'			<ins>' + 
-			'				<xsl:attribute name="class">jstree-icon ' + 
-			'					<xsl:if test="string-length(attribute::icon) > 0 and not(contains(@icon,\'/\'))"><xsl:value-of select="@icon" /></xsl:if>' + 
-			'				</xsl:attribute>' + 
-			'				<xsl:if test="string-length(attribute::icon) > 0 and contains(@icon,\'/\')"><xsl:attribute name="style">background:url(<xsl:value-of select="@icon" />) center center no-repeat;</xsl:attribute></xsl:if>' + 
-			'				<xsl:text>&#xa0;</xsl:text>' + 
-			'			</ins>' + 
-			'			<xsl:value-of select="current()" />' + 
-			'		</a>' + 
-			'	</xsl:for-each>' + 
-			'	<xsl:if test="$children">' + 
-			'		<ul>' + 
-			'		<xsl:for-each select="//item[@parent_id=$node/attribute::id]">' + 
-			'			<xsl:call-template name="nodes">' + 
-			'				<xsl:with-param name="node" select="." />' + 
-			'				<xsl:with-param name="is_last" select="number(position() = last())" />' + 
-			'			</xsl:call-template>' + 
-			'		</xsl:for-each>' + 
-			'		</ul>' + 
-			'	</xsl:if>' + 
-			'	</li>' + 
-			'</xsl:template>' + 
-			'</xsl:stylesheet>'
-	};
-	$.jstree.plugin("xml_data", {
-		defaults : { 
-			data : false,
-			ajax : false,
-			xsl : "flat",
-			clean_node : false,
-			correct_state : true
-		},
-		_fn : {
-			load_node : function (obj, s_call, e_call) { var _this = this; this.load_node_xml(obj, function () { _this.__callback({ "obj" : obj }); s_call.call(this); }, e_call); },
-			_is_loaded : function (obj) { 
-				var s = this._get_settings().xml_data;
-				obj = this._get_node(obj);
-				return obj == -1 || !obj || !s.ajax || obj.is(".jstree-open, .jstree-leaf") || obj.children("ul").children("li").size() > 0;
-			},
-			load_node_xml : function (obj, s_call, e_call) {
-				var s = this.get_settings().xml_data,
-					error_func = function () {},
-					success_func = function () {};
-
-				obj = this._get_node(obj);
-				if(obj && obj !== -1) {
-					if(obj.data("jstree-is-loading")) { return; }
-					else { obj.data("jstree-is-loading",true); }
-				}
-				switch(!0) {
-					case (!s.data && !s.ajax): throw "Neither data nor ajax settings supplied.";
-					case (!!s.data && !s.ajax) || (!!s.data && !!s.ajax && (!obj || obj === -1)):
-						if(!obj || obj == -1) {
-							this.parse_xml(s.data, $.proxy(function (d) {
-								if(d) {
-									d = d.replace(/ ?xmlns="[^"]*"/ig, "");
-									if(d.length > 10) {
-										d = $(d);
-										this.get_container().children("ul").empty().append(d.children());
-										if(s.clean_node) { this.clean_node(obj); }
-										if(s_call) { s_call.call(this); }
-									}
-								}
-								else { 
-									if(s.correct_state) { 
-										this.get_container().children("ul").empty(); 
-										if(s_call) { s_call.call(this); }
-									}
-								}
-							}, this));
-						}
-						break;
-					case (!s.data && !!s.ajax) || (!!s.data && !!s.ajax && obj && obj !== -1):
-						error_func = function (x, t, e) {
-							var ef = this.get_settings().xml_data.ajax.error; 
-							if(ef) { ef.call(this, x, t, e); }
-							if(obj !== -1 && obj.length) {
-								obj.children(".jstree-loading").removeClass("jstree-loading");
-								obj.data("jstree-is-loading",false);
-								if(t === "success" && s.correct_state) { obj.removeClass("jstree-open jstree-closed").addClass("jstree-leaf"); }
-							}
-							else {
-								if(t === "success" && s.correct_state) { this.get_container().children("ul").empty(); }
-							}
-							if(e_call) { e_call.call(this); }
-						};
-						success_func = function (d, t, x) {
-							d = x.responseText;
-							var sf = this.get_settings().xml_data.ajax.success; 
-							if(sf) { d = sf.call(this,d,t,x) || d; }
-							if(d == "") {
-								return error_func.call(this, x, t, "");
-							}
-							this.parse_xml(d, $.proxy(function (d) {
-								if(d) {
-									d = d.replace(/ ?xmlns="[^"]*"/ig, "");
-									if(d.length > 10) {
-										d = $(d);
-										if(obj === -1 || !obj) { this.get_container().children("ul").empty().append(d.children()); }
-										else { obj.children(".jstree-loading").removeClass("jstree-loading"); obj.append(d); obj.data("jstree-is-loading",false); }
-										if(s.clean_node) { this.clean_node(obj); }
-										if(s_call) { s_call.call(this); }
-									}
-									else {
-										if(obj && obj !== -1) { 
-											obj.children(".jstree-loading").removeClass("jstree-loading");
-											obj.data("jstree-is-loading",false);
-											if(s.correct_state) { 
-												obj.removeClass("jstree-open jstree-closed").addClass("jstree-leaf"); 
-												if(s_call) { s_call.call(this); } 
-											}
-										}
-										else {
-											if(s.correct_state) { 
-												this.get_container().children("ul").empty();
-												if(s_call) { s_call.call(this); } 
-											}
-										}
-									}
-								}
-							}, this));
-						};
-						s.ajax.context = this;
-						s.ajax.error = error_func;
-						s.ajax.success = success_func;
-						if(!s.ajax.dataType) { s.ajax.dataType = "xml"; }
-						if($.isFunction(s.ajax.url)) { s.ajax.url = s.ajax.url.call(this, obj); }
-						if($.isFunction(s.ajax.data)) { s.ajax.data = s.ajax.data.call(this, obj); }
-						$.ajax(s.ajax);
-						break;
-				}
-			},
-			parse_xml : function (xml, callback) {
-				var s = this._get_settings().xml_data;
-				$.vakata.xslt(xml, xsl[s.xsl], callback);
-			},
-			get_xml : function (tp, obj, li_attr, a_attr, is_callback) {
-				var result = "", 
-					s = this._get_settings(), 
-					_this = this,
-					tmp1, tmp2, li, a, lang;
-				if(!tp) { tp = "flat"; }
-				if(!is_callback) { is_callback = 0; }
-				obj = this._get_node(obj);
-				if(!obj || obj === -1) { obj = this.get_container().find("> ul > li"); }
-				li_attr = $.isArray(li_attr) ? li_attr : [ "id", "class" ];
-				if(!is_callback && this.data.types && $.inArray(s.types.type_attr, li_attr) === -1) { li_attr.push(s.types.type_attr); }
-
-				a_attr = $.isArray(a_attr) ? a_attr : [ ];
-
-				if(!is_callback) { result += "<root>"; }
-				obj.each(function () {
-					result += "<item";
-					li = $(this);
-					$.each(li_attr, function (i, v) { result += " " + v + "=\"" + (li.attr(v) || "").replace(/jstree[^ ]*|$/ig,'').replace(/^\s+$/ig,"") + "\""; });
-					if(li.hasClass("jstree-open")) { result += " state=\"open\""; }
-					if(li.hasClass("jstree-closed")) { result += " state=\"closed\""; }
-					if(tp === "flat") { result += " parent_id=\"" + is_callback + "\""; }
-					result += ">";
-					result += "<content>";
-					a = li.children("a");
-					a.each(function () {
-						tmp1 = $(this);
-						lang = false;
-						result += "<name";
-						if($.inArray("languages", s.plugins) !== -1) {
-							$.each(s.languages, function (k, z) {
-								if(tmp1.hasClass(z)) { result += " lang=\"" + z + "\""; lang = z; return false; }
-							});
-						}
-						if(a_attr.length) { 
-							$.each(a_attr, function (k, z) {
-								result += " " + z + "=\"" + (tmp1.attr(z) || "").replace(/jstree[^ ]*|$/ig,'') + "\"";
-							});
-						}
-						if(tmp1.children("ins").get(0).className.replace(/jstree[^ ]*|$/ig,'').replace(/^\s+$/ig,"").length) {
-							result += ' icon="' + tmp1.children("ins").get(0).className.replace(/jstree[^ ]*|$/ig,'').replace(/^\s+$/ig,"") + '"';
-						}
-						if(tmp1.children("ins").get(0).style.backgroundImage.length) {
-							result += ' icon="' + tmp1.children("ins").get(0).style.backgroundImage.replace("url(","").replace(")","") + '"';
-						}
-						result += ">";
-						result += "<![CDATA[" + _this.get_text(tmp1, lang) + "]]>";
-						result += "</name>";
-					});
-					result += "</content>";
-					tmp2 = li[0].id;
-					li = li.find("> ul > li");
-					if(li.length) { tmp2 = _this.get_xml(tp, li, li_attr, a_attr, tmp2); }
-					else { tmp2 = ""; }
-					if(tp == "nest") { result += tmp2; }
-					result += "</item>";
-					if(tp == "flat") { result += tmp2; }
-				});
-				if(!is_callback) { result += "</root>"; }
-				return result;
-			}
-		}
-	});
+  $.vakata.xslt = function (xml, xsl, callback) {
+    var rs = "", xm, xs, processor, support;
+    if (document.recalc) {
+      xm = document.createElement('xml');
+      xs = document.createElement('xml');
+      xm.innerHTML = xml;
+      xs.innerHTML = xsl;
+      $("body").append(xm).append(xs);
+      setTimeout((function (xm, xs, callback) {
+        return function () {
+          callback.call(null, xm.transformNode(xs.XMLDocument));
+          setTimeout((function (xm, xs) {
+            return function () {
+              jQuery("body").remove(xm).remove(xs);
+            };
+          })(xm, xs), 200);
+        };
+      })(xm, xs, callback), 100);
+      return true;
+    }
+    if (typeof window.DOMParser !== "undefined" && typeof window.XMLHttpRequest
+        !== "undefined" && typeof window.XSLTProcessor !== "undefined") {
+      processor = new XSLTProcessor();
+      support = $.isFunction(processor.transformDocument)
+          ? (typeof window.XMLSerializer !== "undefined") : true;
+      if (!support) {
+        return false;
+      }
+      xml = new DOMParser().parseFromString(xml, "text/xml");
+      xsl = new DOMParser().parseFromString(xsl, "text/xml");
+      if ($.isFunction(processor.transformDocument)) {
+        rs = document.implementation.createDocument("", "", null);
+        processor.transformDocument(xml, xsl, rs, null);
+        callback.call(null, XMLSerializer().serializeToString(rs));
+        return true;
+      }
+      else {
+        processor.importStylesheet(xsl);
+        rs = processor.transformToFragment(xml, document);
+        callback.call(null, $("<div>").append(rs).html());
+        return true;
+      }
+    }
+    return false;
+  };
+  var xsl = {
+    'nest': '<?xml version="1.0" encoding="utf-8" ?>' +
+    '<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" >'
+    +
+    '<xsl:output method="html" encoding="utf-8" omit-xml-declaration="yes" standalone="no" indent="no" media-type="text/html" />'
+    +
+    '<xsl:template match="/">' +
+    '	<xsl:call-template name="nodes">' +
+    '		<xsl:with-param name="node" select="/root" />' +
+    '	</xsl:call-template>' +
+    '</xsl:template>' +
+    '<xsl:template name="nodes">' +
+    '	<xsl:param name="node" />' +
+    '	<ul>' +
+    '	<xsl:for-each select="$node/item">' +
+    '		<xsl:variable name="children" select="count(./item) &gt; 0" />' +
+    '		<li>' +
+    '			<xsl:attribute name="class">' +
+    '				<xsl:if test="position() = last()">jstree-last </xsl:if>' +
+    '				<xsl:choose>' +
+    '					<xsl:when test="@state = \'open\'">jstree-open </xsl:when>' +
+    '					<xsl:when test="$children or @hasChildren or @state = \'closed\'">jstree-closed </xsl:when>'
+    +
+    '					<xsl:otherwise>jstree-leaf </xsl:otherwise>' +
+    '				</xsl:choose>' +
+    '				<xsl:value-of select="@class" />' +
+    '			</xsl:attribute>' +
+    '			<xsl:for-each select="@*">' +
+    '				<xsl:if test="name() != \'class\' and name() != \'state\' and name() != \'hasChildren\'">'
+    +
+    '					<xsl:attribute name="{name()}"><xsl:value-of select="." /></xsl:attribute>'
+    +
+    '				</xsl:if>' +
+    '			</xsl:for-each>' +
+    '	<ins class="jstree-icon"><xsl:text>&#xa0;</xsl:text></ins>' +
+    '			<xsl:for-each select="content/name">' +
+    '				<a>' +
+    '				<xsl:attribute name="href">' +
+    '					<xsl:choose>' +
+    '					<xsl:when test="@href"><xsl:value-of select="@href" /></xsl:when>'
+    +
+    '					<xsl:otherwise>#</xsl:otherwise>' +
+    '					</xsl:choose>' +
+    '				</xsl:attribute>' +
+    '				<xsl:attribute name="class"><xsl:value-of select="@lang" /> <xsl:value-of select="@class" /></xsl:attribute>'
+    +
+    '				<xsl:attribute name="style"><xsl:value-of select="@style" /></xsl:attribute>'
+    +
+    '				<xsl:for-each select="@*">' +
+    '					<xsl:if test="name() != \'style\' and name() != \'class\' and name() != \'href\'">'
+    +
+    '						<xsl:attribute name="{name()}"><xsl:value-of select="." /></xsl:attribute>'
+    +
+    '					</xsl:if>' +
+    '				</xsl:for-each>' +
+    '					<ins>' +
+    '						<xsl:attribute name="class">jstree-icon ' +
+    '							<xsl:if test="string-length(attribute::icon) > 0 and not(contains(@icon,\'/\'))"><xsl:value-of select="@icon" /></xsl:if>'
+    +
+    '						</xsl:attribute>' +
+    '						<xsl:if test="string-length(attribute::icon) > 0 and contains(@icon,\'/\')"><xsl:attribute name="style">background:url(<xsl:value-of select="@icon" />) center center no-repeat;</xsl:attribute></xsl:if>'
+    +
+    '						<xsl:text>&#xa0;</xsl:text>' +
+    '					</ins>' +
+    '					<xsl:value-of select="current()" />' +
+    '				</a>' +
+    '			</xsl:for-each>' +
+    '			<xsl:if test="$children or @hasChildren"><xsl:call-template name="nodes"><xsl:with-param name="node" select="current()" /></xsl:call-template></xsl:if>'
+    +
+    '		</li>' +
+    '	</xsl:for-each>' +
+    '	</ul>' +
+    '</xsl:template>' +
+    '</xsl:stylesheet>',
+
+    'flat': '<?xml version="1.0" encoding="utf-8" ?>' +
+    '<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" >'
+    +
+    '<xsl:output method="html" encoding="utf-8" omit-xml-declaration="yes" standalone="no" indent="no" media-type="text/xml" />'
+    +
+    '<xsl:template match="/">' +
+    '	<ul>' +
+    '	<xsl:for-each select="//item[not(@parent_id) or @parent_id=0 or not(@parent_id = //item/@id)]">'
+    + /* the last `or` may be removed */
+    '		<xsl:call-template name="nodes">' +
+    '			<xsl:with-param name="node" select="." />' +
+    '			<xsl:with-param name="is_last" select="number(position() = last())" />'
+    +
+    '		</xsl:call-template>' +
+    '	</xsl:for-each>' +
+    '	</ul>' +
+    '</xsl:template>' +
+    '<xsl:template name="nodes">' +
+    '	<xsl:param name="node" />' +
+    '	<xsl:param name="is_last" />' +
+    '	<xsl:variable name="children" select="count(//item[@parent_id=$node/attribute::id]) &gt; 0" />'
+    +
+    '	<li>' +
+    '	<xsl:attribute name="class">' +
+    '		<xsl:if test="$is_last = true()">jstree-last </xsl:if>' +
+    '		<xsl:choose>' +
+    '			<xsl:when test="@state = \'open\'">jstree-open </xsl:when>' +
+    '			<xsl:when test="$children or @hasChildren or @state = \'closed\'">jstree-closed </xsl:when>'
+    +
+    '			<xsl:otherwise>jstree-leaf </xsl:otherwise>' +
+    '		</xsl:choose>' +
+    '		<xsl:value-of select="@class" />' +
+    '	</xsl:attribute>' +
+    '	<xsl:for-each select="@*">' +
+    '		<xsl:if test="name() != \'parent_id\' and name() != \'hasChildren\' and name() != \'class\' and name() != \'state\'">'
+    +
+    '		<xsl:attribute name="{name()}"><xsl:value-of select="." /></xsl:attribute>'
+    +
+    '		</xsl:if>' +
+    '	</xsl:for-each>' +
+    '	<ins class="jstree-icon"><xsl:text>&#xa0;</xsl:text></ins>' +
+    '	<xsl:for-each select="content/name">' +
+    '		<a>' +
+    '		<xsl:attribute name="href">' +
+    '			<xsl:choose>' +
+    '			<xsl:when test="@href"><xsl:value-of select="@href" /></xsl:when>' +
+    '			<xsl:otherwise>#</xsl:otherwise>' +
+    '			</xsl:choose>' +
+    '		</xsl:attribute>' +
+    '		<xsl:attribute name="class"><xsl:value-of select="@lang" /> <xsl:value-of select="@class" /></xsl:attribute>'
+    +
+    '		<xsl:attribute name="style"><xsl:value-of select="@style" /></xsl:attribute>'
+    +
+    '		<xsl:for-each select="@*">' +
+    '			<xsl:if test="name() != \'style\' and name() != \'class\' and name() != \'href\'">'
+    +
+    '				<xsl:attribute name="{name()}"><xsl:value-of select="." /></xsl:attribute>'
+    +
+    '			</xsl:if>' +
+    '		</xsl:for-each>' +
+    '			<ins>' +
+    '				<xsl:attribute name="class">jstree-icon ' +
+    '					<xsl:if test="string-length(attribute::icon) > 0 and not(contains(@icon,\'/\'))"><xsl:value-of select="@icon" /></xsl:if>'
+    +
+    '				</xsl:attribute>' +
+    '				<xsl:if test="string-length(attribute::icon) > 0 and contains(@icon,\'/\')"><xsl:attribute name="style">background:url(<xsl:value-of select="@icon" />) center center no-repeat;</xsl:attribute></xsl:if>'
+    +
+    '				<xsl:text>&#xa0;</xsl:text>' +
+    '			</ins>' +
+    '			<xsl:value-of select="current()" />' +
+    '		</a>' +
+    '	</xsl:for-each>' +
+    '	<xsl:if test="$children">' +
+    '		<ul>' +
+    '		<xsl:for-each select="//item[@parent_id=$node/attribute::id]">' +
+    '			<xsl:call-template name="nodes">' +
+    '				<xsl:with-param name="node" select="." />' +
+    '				<xsl:with-param name="is_last" select="number(position() = last())" />'
+    +
+    '			</xsl:call-template>' +
+    '		</xsl:for-each>' +
+    '		</ul>' +
+    '	</xsl:if>' +
+    '	</li>' +
+    '</xsl:template>' +
+    '</xsl:stylesheet>'
+  };
+  $.jstree.plugin("xml_data", {
+    defaults: {
+      data: false,
+      ajax: false,
+      xsl: "flat",
+      clean_node: false,
+      correct_state: true
+    },
+    _fn: {
+      load_node: function (obj, s_call, e_call) {
+        var _this = this;
+        this.load_node_xml(obj, function () {
+          _this.__callback({"obj": obj});
+          s_call.call(this);
+        }, e_call);
+      },
+      _is_loaded: function (obj) {
+        var s = this._get_settings().xml_data;
+        obj = this._get_node(obj);
+        return obj == -1 || !obj || !s.ajax || obj.is(
+            ".jstree-open, .jstree-leaf") || obj.children("ul").children(
+            "li").size() > 0;
+      },
+      load_node_xml: function (obj, s_call, e_call) {
+        var s = this.get_settings().xml_data,
+            error_func = function () {
+            },
+            success_func = function () {
+            };
+
+        obj = this._get_node(obj);
+        if (obj && obj !== -1) {
+          if (obj.data("jstree-is-loading")) {
+            return;
+          }
+          else {
+            obj.data("jstree-is-loading", true);
+          }
+        }
+        switch (!0) {
+          case (!s.data && !s.ajax):
+            throw "Neither data nor ajax settings supplied.";
+          case (!!s.data && !s.ajax) || (!!s.data && !!s.ajax && (!obj || obj
+              === -1)):
+            if (!obj || obj == -1) {
+              this.parse_xml(s.data, $.proxy(function (d) {
+                if (d) {
+                  d = d.replace(/ ?xmlns="[^"]*"/ig, "");
+                  if (d.length > 10) {
+                    d = $(d);
+                    this.get_container().children("ul").empty().append(
+                        d.children());
+                    if (s.clean_node) {
+                      this.clean_node(obj);
+                    }
+                    if (s_call) {
+                      s_call.call(this);
+                    }
+                  }
+                }
+                else {
+                  if (s.correct_state) {
+                    this.get_container().children("ul").empty();
+                    if (s_call) {
+                      s_call.call(this);
+                    }
+                  }
+                }
+              }, this));
+            }
+            break;
+          case (!s.data && !!s.ajax) || (!!s.data && !!s.ajax && obj && obj
+              !== -1):
+            error_func = function (x, t, e) {
+              var ef = this.get_settings().xml_data.ajax.error;
+              if (ef) {
+                ef.call(this, x, t, e);
+              }
+              if (obj !== -1 && obj.length) {
+                obj.children(".jstree-loading").removeClass("jstree-loading");
+                obj.data("jstree-is-loading", false);
+                if (t === "success" && s.correct_state) {
+                  obj.removeClass("jstree-open jstree-closed").addClass(
+                      "jstree-leaf");
+                }
+              }
+              else {
+                if (t === "success" && s.correct_state) {
+                  this.get_container().children("ul").empty();
+                }
+              }
+              if (e_call) {
+                e_call.call(this);
+              }
+            };
+            success_func = function (d, t, x) {
+              d = x.responseText;
+              var sf = this.get_settings().xml_data.ajax.success;
+              if (sf) {
+                d = sf.call(this, d, t, x) || d;
+              }
+              if (d == "") {
+                return error_func.call(this, x, t, "");
+              }
+              this.parse_xml(d, $.proxy(function (d) {
+                if (d) {
+                  d = d.replace(/ ?xmlns="[^"]*"/ig, "");
+                  if (d.length > 10) {
+                    d = $(d);
+                    if (obj === -1 || !obj) {
+                      this.get_container().children("ul").empty().append(
+                          d.children());
+                    }
+                    else {
+                      obj.children(".jstree-loading").removeClass(
+                          "jstree-loading");
+                      obj.append(d);
+                      obj.data("jstree-is-loading", false);
+                    }
+                    if (s.clean_node) {
+                      this.clean_node(obj);
+                    }
+                    if (s_call) {
+                      s_call.call(this);
+                    }
+                  }
+                  else {
+                    if (obj && obj !== -1) {
+                      obj.children(".jstree-loading").removeClass(
+                          "jstree-loading");
+                      obj.data("jstree-is-loading", false);
+                      if (s.correct_state) {
+                        obj.removeClass("jstree-open jstree-closed").addClass(
+                            "jstree-leaf");
+                        if (s_call) {
+                          s_call.call(this);
+                        }
+                      }
+                    }
+                    else {
+                      if (s.correct_state) {
+                        this.get_container().children("ul").empty();
+                        if (s_call) {
+                          s_call.call(this);
+                        }
+                      }
+                    }
+                  }
+                }
+              }, this));
+            };
+            s.ajax.context = this;
+            s.ajax.error = error_func;
+            s.ajax.success = success_func;
+            if (!s.ajax.dataType) {
+              s.ajax.dataType = "xml";
+            }
+            if ($.isFunction(s.ajax.url)) {
+              s.ajax.url = s.ajax.url.call(this, obj);
+            }
+            if ($.isFunction(s.ajax.data)) {
+              s.ajax.data = s.ajax.data.call(this, obj);
+            }
+            $.ajax(s.ajax);
+            break;
+        }
+      },
+      parse_xml: function (xml, callback) {
+        var s = this._get_settings().xml_data;
+        $.vakata.xslt(xml, xsl[s.xsl], callback);
+      },
+      get_xml: function (tp, obj, li_attr, a_attr, is_callback) {
+        var result = "",
+            s = this._get_settings(),
+            _this = this,
+            tmp1, tmp2, li, a, lang;
+        if (!tp) {
+          tp = "flat";
+        }
+        if (!is_callback) {
+          is_callback = 0;
+        }
+        obj = this._get_node(obj);
+        if (!obj || obj === -1) {
+          obj = this.get_container().find("> ul > li");
+        }
+        li_attr = $.isArray(li_attr) ? li_attr : ["id", "class"];
+        if (!is_callback && this.data.types && $.inArray(s.types.type_attr,
+                li_attr) === -1) {
+          li_attr.push(s.types.type_attr);
+        }
+
+        a_attr = $.isArray(a_attr) ? a_attr : [];
+
+        if (!is_callback) {
+          result += "<root>";
+        }
+        obj.each(function () {
+          result += "<item";
+          li = $(this);
+          $.each(li_attr, function (i, v) {
+            result += " " + v + "=\"" + (li.attr(v) || "").replace(
+                /jstree[^ ]*|$/ig, '').replace(/^\s+$/ig, "") + "\"";
+          });
+          if (li.hasClass("jstree-open")) {
+            result += " state=\"open\"";
+          }
+          if (li.hasClass("jstree-closed")) {
+            result += " state=\"closed\"";
+          }
+          if (tp === "flat") {
+            result += " parent_id=\"" + is_callback + "\"";
+          }
+          result += ">";
+          result += "<content>";
+          a = li.children("a");
+          a.each(function () {
+            tmp1 = $(this);
+            lang = false;
+            result += "<name";
+            if ($.inArray("languages", s.plugins) !== -1) {
+              $.each(s.languages, function (k, z) {
+                if (tmp1.hasClass(z)) {
+                  result += " lang=\"" + z + "\"";
+                  lang = z;
+                  return false;
+                }
+              });
+            }
+            if (a_attr.length) {
+              $.each(a_attr, function (k, z) {
+                result += " " + z + "=\"" + (tmp1.attr(z) || "").replace(
+                    /jstree[^ ]*|$/ig, '') + "\"";
+              });
+            }
+            if (tmp1.children("ins").get(0).className.replace(/jstree[^ ]*|$/ig,
+                    '').replace(/^\s+$/ig, "").length) {
+              result += ' icon="' + tmp1.children("ins").get(
+                  0).className.replace(/jstree[^ ]*|$/ig, '').replace(/^\s+$/ig,
+                  "") + '"';
+            }
+            if (tmp1.children("ins").get(0).style.backgroundImage.length) {
+              result += ' icon="' + tmp1.children("ins").get(
+                  0).style.backgroundImage.replace("url(", "").replace(")", "")
+                  + '"';
+            }
+            result += ">";
+            result += "<![CDATA[" + _this.get_text(tmp1, lang) + "]]>";
+            result += "</name>";
+          });
+          result += "</content>";
+          tmp2 = li[0].id;
+          li = li.find("> ul > li");
+          if (li.length) {
+            tmp2 = _this.get_xml(tp, li, li_attr, a_attr, tmp2);
+          }
+          else {
+            tmp2 = "";
+          }
+          if (tp == "nest") {
+            result += tmp2;
+          }
+          result += "</item>";
+          if (tp == "flat") {
+            result += tmp2;
+          }
+        });
+        if (!is_callback) {
+          result += "</root>";
+        }
+        return result;
+      }
+    }
+  });
 })(jQuery);
 //*/
 
@@ -2717,81 +3775,114 @@
  * DOES NOT WORK WITH JSON PROGRESSIVE RENDER
  */
 (function ($) {
-	$.expr[':'].jstree_contains = function(a,i,m){
-		return (a.textContent || a.innerText || "").toLowerCase().indexOf(m[3].toLowerCase())>=0;
-	};
-	$.jstree.plugin("search", {
-		__init : function () {
-			this.data.search.str = "";
-			this.data.search.result = $();
-		},
-		defaults : {
-			ajax : false, // OR ajax object
-			case_insensitive : false
-		},
-		_fn : {
-			search : function (str, skip_async) {
-				if(str === "") { return; }
-				var s = this.get_settings().search, 
-					t = this,
-					error_func = function () { },
-					success_func = function () { };
-				this.data.search.str = str;
-
-				if(!skip_async && s.ajax !== false && this.get_container().find(".jstree-closed:eq(0)").length > 0) {
-					this.search.supress_callback = true;
-					error_func = function () { };
-					success_func = function (d, t, x) {
-						var sf = this.get_settings().search.ajax.success; 
-						if(sf) { d = sf.call(this,d,t,x) || d; }
-						this.data.search.to_open = d;
-						this._search_open();
-					};
-					s.ajax.context = this;
-					s.ajax.error = error_func;
-					s.ajax.success = success_func;
-					if($.isFunction(s.ajax.url)) { s.ajax.url = s.ajax.url.call(this, str); }
-					if($.isFunction(s.ajax.data)) { s.ajax.data = s.ajax.data.call(this, str); }
-					if(!s.ajax.data) { s.ajax.data = { "search_string" : str }; }
-					if(!s.ajax.dataType || /^json/.exec(s.ajax.dataType)) { s.ajax.dataType = "json"; }
-					$.ajax(s.ajax);
-					return;
-				}
-				if(this.data.search.result.length) { this.clear_search(); }
-				this.data.search.result = this.get_container().find("a" + (this.data.languages ? "." + this.get_lang() : "" ) + ":" + (s.case_insensitive ? "jstree_contains" : "contains") + "(" + this.data.search.str + ")");
-				this.data.search.result.addClass("jstree-search").parents(".jstree-closed").each(function () {
-					t.open_node(this, false, true);
-				});
-				this.__callback({ nodes : this.data.search.result, str : str });
-			},
-			clear_search : function (str) {
-				this.data.search.result.removeClass("jstree-search");
-				this.__callback(this.data.search.result);
-				this.data.search.result = $();
-			},
-			_search_open : function (is_callback) {
-				var _this = this,
-					done = true,
-					current = [],
-					remaining = [];
-				if(this.data.search.to_open.length) {
-					$.each(this.data.search.to_open, function (i, val) {
-						if(val == "#") { return true; }
-						if($(val).length && $(val).is(".jstree-closed")) { current.push(val); }
-						else { remaining.push(val); }
-					});
-					if(current.length) {
-						this.data.search.to_open = remaining;
-						$.each(current, function (i, val) { 
-							_this.open_node(val, function () { _this._search_open(true); }); 
-						});
-						done = false;
-					}
-				}
-				if(done) { this.search(this.data.search.str, true); }
-			}
-		}
-	});
+  $.expr[':'].jstree_contains = function (a, i, m) {
+    return (a.textContent || a.innerText || "").toLowerCase().indexOf(
+        m[3].toLowerCase()) >= 0;
+  };
+  $.jstree.plugin("search", {
+    __init: function () {
+      this.data.search.str = "";
+      this.data.search.result = $();
+    },
+    defaults: {
+      ajax: false, // OR ajax object
+      case_insensitive: false
+    },
+    _fn: {
+      search: function (str, skip_async) {
+        if (str === "") {
+          return;
+        }
+        var s = this.get_settings().search,
+            t = this,
+            error_func = function () {
+            },
+            success_func = function () {
+            };
+        this.data.search.str = str;
+
+        if (!skip_async && s.ajax !== false && this.get_container().find(
+                ".jstree-closed:eq(0)").length > 0) {
+          this.search.supress_callback = true;
+          error_func = function () {
+          };
+          success_func = function (d, t, x) {
+            var sf = this.get_settings().search.ajax.success;
+            if (sf) {
+              d = sf.call(this, d, t, x) || d;
+            }
+            this.data.search.to_open = d;
+            this._search_open();
+          };
+          s.ajax.context = this;
+          s.ajax.error = error_func;
+          s.ajax.success = success_func;
+          if ($.isFunction(s.ajax.url)) {
+            s.ajax.url = s.ajax.url.call(this, str);
+          }
+          if ($.isFunction(s.ajax.data)) {
+            s.ajax.data = s.ajax.data.call(this, str);
+          }
+          if (!s.ajax.data) {
+            s.ajax.data = {"search_string": str};
+          }
+          if (!s.ajax.dataType || /^json/.exec(s.ajax.dataType)) {
+            s.ajax.dataType = "json";
+          }
+          $.ajax(s.ajax);
+          return;
+        }
+        if (this.data.search.result.length) {
+          this.clear_search();
+        }
+        this.data.search.result = this.get_container().find("a"
+            + (this.data.languages ? "." + this.get_lang() : "" ) + ":"
+            + (s.case_insensitive ? "jstree_contains" : "contains") + "("
+            + this.data.search.str + ")");
+        this.data.search.result.addClass("jstree-search").parents(
+            ".jstree-closed").each(function () {
+          t.open_node(this, false, true);
+        });
+        this.__callback({nodes: this.data.search.result, str: str});
+      },
+      clear_search: function (str) {
+        this.data.search.result.removeClass("jstree-search");
+        this.__callback(this.data.search.result);
+        this.data.search.result = $();
+      },
+      _search_open: function (is_callback) {
+        var _this = this,
+            done = true,
+            current = [],
+            remaining = [];
+        if (this.data.search.to_open.length) {
+          $.each(this.data.search.to_open, function (i, val) {
+            if (val == "#") {
+              return true;
+            }
+            if ($(val).length && $(val).is(".jstree-closed")) {
+              current.push(val);
+            }
+            else {
+              remaining.push(val);
+            }
+          });
+          if (current.length) {
+            this.data.search.to_open = remaining;
+            $.each(current, function (i, val) {
+              _this.open_node(val, function () {
+                _this._search_open(true);
+              });
+            });
+            done = false;
+          }
+        }
+        if (done) {
+          this.search(this.data.search.str, true);
+        }
+      }
+    }
+  });
 })(jQuery);
 //*/
 
@@ -2799,712 +3890,971 @@
  * jsTree contextmenu plugin 1.0
  */
 (function ($) {
-	$.vakata.context = {
-		cnt		: $("<div id='vakata-contextmenu'>"),
-		vis		: false,
-		tgt		: false,
-		par		: false,
-		func	: false,
-		data	: false,
-		show	: function (s, t, x, y, d, p) {
-			var html = $.vakata.context.parse(s), h, w;
-			if(!html) { return; }
-			$.vakata.context.vis = true;
-			$.vakata.context.tgt = t;
-			$.vakata.context.par = p || t || null;
-			$.vakata.context.data = d || null;
-			$.vakata.context.cnt
-				.html(html)
-				.css({ "visibility" : "hidden", "display" : "block", "left" : 0, "top" : 0 });
-			h = $.vakata.context.cnt.height();
-			w = $.vakata.context.cnt.width();
-			if(x + w > $(document).width()) { 
-				x = $(document).width() - (w + 5); 
-				$.vakata.context.cnt.find("li > ul").addClass("right"); 
-			}
-			if(y + h > $(document).height()) { 
-				y = y - (h + t[0].offsetHeight); 
-				$.vakata.context.cnt.find("li > ul").addClass("bottom"); 
-			}
-
-			$.vakata.context.cnt
-				.css({ "left" : x, "top" : y })
-				.find("li:has(ul)")
-					.bind("mouseenter", function (e) { 
-						var w = $(document).width(),
-							h = $(document).height(),
-							ul = $(this).children("ul").show(); 
-						if(w !== $(document).width()) { ul.toggleClass("right"); }
-						if(h !== $(document).height()) { ul.toggleClass("bottom"); }
-					})
-					.bind("mouseleave", function (e) { 
-						$(this).children("ul").hide(); 
-					})
-					.end()
-				.css({ "visibility" : "visible" })
-				.show();
-			$(document).triggerHandler("context_show.vakata");
-		},
-		hide	: function () {
-			$.vakata.context.vis = false;
-			$.vakata.context.cnt.attr("class","").hide();
-			$(document).triggerHandler("context_hide.vakata");
-		},
-		parse	: function (s, is_callback) {
-			if(!s) { return false; }
-			var str = "",
-				tmp = false,
-				was_sep = true;
-			if(!is_callback) { $.vakata.context.func = {}; }
-			str += "<ul>";
-			$.each(s, function (i, val) {
-				if(!val) { return true; }
-				$.vakata.context.func[i] = val.action;
-				if(!was_sep && val.separator_before) {
-					str += "<li class='vakata-separator vakata-separator-before'></li>";
-				}
-				was_sep = false;
-				str += "<li class='" + (val._class || "") + (val._disabled ? " jstree-contextmenu-disabled " : "") + "'><ins ";
-				if(val.icon && val.icon.indexOf("/") === -1) { str += " class='" + val.icon + "' "; }
-				if(val.icon && val.icon.indexOf("/") !== -1) { str += " style='background:url(" + val.icon + ") center center no-repeat;' "; }
-				str += ">&#160;</ins><a href='#' rel='" + i + "'>";
-				if(val.submenu) {
-					str += "<span style='float:right;'>&raquo;</span>";
-				}
-				str += val.label + "</a>";
-				if(val.submenu) {
-					tmp = $.vakata.context.parse(val.submenu, true);
-					if(tmp) { str += tmp; }
-				}
-				str += "</li>";
-				if(val.separator_after) {
-					str += "<li class='vakata-separator vakata-separator-after'></li>";
-					was_sep = true;
-				}
-			});
-			str = str.replace(/<li class\='vakata-separator vakata-separator-after'\><\/li\>$/,"");
-			str += "</ul>";
-			return str.length > 10 ? str : false;
-		},
-		exec	: function (i) {
-			if($.isFunction($.vakata.context.func[i])) {
-				$.vakata.context.func[i].call($.vakata.context.data, $.vakata.context.par);
-				return true;
-			}
-			else { return false; }
-		}
-	};
-	$(function () {
-		var css_string = '' + 
-			'#vakata-contextmenu { display:none; position:absolute; margin:0; padding:0; min-width:180px; background:#ebebeb; border:1px solid silver; z-index:10000; *width:180px; } ' + 
-			'#vakata-contextmenu ul { min-width:180px; *width:180px; } ' + 
-			'#vakata-contextmenu ul, #vakata-contextmenu li { margin:0; padding:0; list-style-type:none; display:block; } ' + 
-			'#vakata-contextmenu li { line-height:20px; min-height:20px; position:relative; padding:0px; } ' + 
-			'#vakata-contextmenu li a { padding:1px 6px; line-height:17px; display:block; text-decoration:none; margin:1px 1px 0 1px; } ' + 
-			'#vakata-contextmenu li ins { float:left; width:16px; height:16px; text-decoration:none; margin-right:2px; } ' + 
-			'#vakata-contextmenu li a:hover, #vakata-contextmenu li.vakata-hover > a { background:gray; color:white; } ' + 
-			'#vakata-contextmenu li ul { display:none; position:absolute; top:-2px; left:100%; background:#ebebeb; border:1px solid gray; } ' + 
-			'#vakata-contextmenu .right { right:100%; left:auto; } ' + 
-			'#vakata-contextmenu .bottom { bottom:-1px; top:auto; } ' + 
-			'#vakata-contextmenu li.vakata-separator { min-height:0; height:1px; line-height:1px; font-size:1px; overflow:hidden; margin:0 2px; background:silver; /* border-top:1px solid #fefefe; */ padding:0; } ';
-		$.vakata.css.add_sheet({ str : css_string });
-		$.vakata.context.cnt
-			.delegate("a","click", function (e) { e.preventDefault(); })
-			.delegate("a","mouseup", function (e) {
-				if(!$(this).parent().hasClass("jstree-contextmenu-disabled") && $.vakata.context.exec($(this).attr("rel"))) {
-					$.vakata.context.hide();
-				}
-				else { $(this).blur(); }
-			})
-			.delegate("a","mouseover", function () {
-				$.vakata.context.cnt.find(".vakata-hover").removeClass("vakata-hover");
-			})
-			.appendTo("body");
-		$(document).bind("mousedown", function (e) { if($.vakata.context.vis && !$.contains($.vakata.context.cnt[0], e.target)) { $.vakata.context.hide(); } });
-		if(typeof $.hotkeys !== "undefined") {
-			$(document)
-				.bind("keydown", "up", function (e) { 
-					if($.vakata.context.vis) { 
-						var o = $.vakata.context.cnt.find("ul:visible").last().children(".vakata-hover").removeClass("vakata-hover").prevAll("li:not(.vakata-separator)").first();
-						if(!o.length) { o = $.vakata.context.cnt.find("ul:visible").last().children("li:not(.vakata-separator)").last(); }
-						o.addClass("vakata-hover");
-						e.stopImmediatePropagation(); 
-						e.preventDefault();
-					} 
-				})
-				.bind("keydown", "down", function (e) { 
-					if($.vakata.context.vis) { 
-						var o = $.vakata.context.cnt.find("ul:visible").last().children(".vakata-hover").removeClass("vakata-hover").nextAll("li:not(.vakata-separator)").first();
-						if(!o.length) { o = $.vakata.context.cnt.find("ul:visible").last().children("li:not(.vakata-separator)").first(); }
-						o.addClass("vakata-hover");
-						e.stopImmediatePropagation(); 
-						e.preventDefault();
-					} 
-				})
-				.bind("keydown", "right", function (e) { 
-					if($.vakata.context.vis) { 
-						$.vakata.context.cnt.find(".vakata-hover").children("ul").show().children("li:not(.vakata-separator)").removeClass("vakata-hover").first().addClass("vakata-hover");
-						e.stopImmediatePropagation(); 
-						e.preventDefault();
-					} 
-				})
-				.bind("keydown", "left", function (e) { 
-					if($.vakata.context.vis) { 
-						$.vakata.context.cnt.find(".vakata-hover").children("ul").hide().children(".vakata-separator").removeClass("vakata-hover");
-						e.stopImmediatePropagation(); 
-						e.preventDefault();
-					} 
-				})
-				.bind("keydown", "esc", function (e) { 
-					$.vakata.context.hide(); 
-					e.preventDefault();
-				})
-				.bind("keydown", "space", function (e) { 
-					$.vakata.context.cnt.find(".vakata-hover").last().children("a").click();
-					e.preventDefault();
-				});
-		}
-	});
-
-	$.jstree.plugin("contextmenu", {
-		__init : function () {
-			this.get_container()
-				.delegate("a", "contextmenu.jstree", $.proxy(function (e) {
-						e.preventDefault();
-						this.show_contextmenu(e.currentTarget, e.pageX, e.pageY);
-					}, this))
-				.bind("destroy.jstree", $.proxy(function () {
-						if(this.data.contextmenu) {
-							$.vakata.context.hide();
-						}
-					}, this));
-			$(document).bind("context_hide.vakata", $.proxy(function () { this.data.contextmenu = false; }, this));
-		},
-		defaults : { 
-			select_node : false, // requires UI plugin
-			show_at_node : true,
-			items : { // Could be a function that should return an object like this one
-				"create" : {
-					"separator_before"	: false,
-					"separator_after"	: true,
-					"label"				: "Create",
-					"action"			: function (obj) { this.create(obj); }
-				},
-				"rename" : {
-					"separator_before"	: false,
-					"separator_after"	: false,
-					"label"				: "Rename",
-					"action"			: function (obj) { this.rename(obj); }
-				},
-				"remove" : {
-					"separator_before"	: false,
-					"icon"				: false,
-					"separator_after"	: false,
-					"label"				: "Delete",
-					"action"			: function (obj) { this.remove(obj); }
-				},
-				"ccp" : {
-					"separator_before"	: true,
-					"icon"				: false,
-					"separator_after"	: false,
-					"label"				: "Edit",
-					"action"			: false,
-					"submenu" : { 
-						"cut" : {
-							"separator_before"	: false,
-							"separator_after"	: false,
-							"label"				: "Cut",
-							"action"			: function (obj) { this.cut(obj); }
-						},
-						"copy" : {
-							"separator_before"	: false,
-							"icon"				: false,
-							"separator_after"	: false,
-							"label"				: "Copy",
-							"action"			: function (obj) { this.copy(obj); }
-						},
-						"paste" : {
-							"separator_before"	: false,
-							"icon"				: false,
-							"separator_after"	: false,
-							"label"				: "Paste",
-							"action"			: function (obj) { this.paste(obj); }
-						}
-					}
-				}
-			}
-		},
-		_fn : {
-			show_contextmenu : function (obj, x, y) {
-				obj = this._get_node(obj);
-				var s = this.get_settings().contextmenu,
-					a = obj.children("a:visible:eq(0)"),
-					o = false;
-				if(s.select_node && this.data.ui && !this.is_selected(obj)) {
-					this.deselect_all();
-					this.select_node(obj, true);
-				}
-				if(s.show_at_node || typeof x === "undefined" || typeof y === "undefined") {
-					o = a.offset();
-					x = o.left;
-					y = o.top + this.data.core.li_height;
-				}
-				if($.isFunction(s.items)) { s.items = s.items.call(this, obj); }
-				this.data.contextmenu = true;
-				$.vakata.context.show(s.items, a, x, y, this, obj);
-				if(this.data.themes) { $.vakata.context.cnt.attr("class", "jstree-" + this.data.themes.theme + "-context"); }
-			}
-		}
-	});
+  $.vakata.context = {
+    cnt: $("<div id='vakata-contextmenu'>"),
+    vis: false,
+    tgt: false,
+    par: false,
+    func: false,
+    data: false,
+    show: function (s, t, x, y, d, p) {
+      var html = $.vakata.context.parse(s), h, w;
+      if (!html) {
+        return;
+      }
+      $.vakata.context.vis = true;
+      $.vakata.context.tgt = t;
+      $.vakata.context.par = p || t || null;
+      $.vakata.context.data = d || null;
+      $.vakata.context.cnt
+      .html(html)
+      .css({"visibility": "hidden", "display": "block", "left": 0, "top": 0});
+      h = $.vakata.context.cnt.height();
+      w = $.vakata.context.cnt.width();
+      if (x + w > $(document).width()) {
+        x = $(document).width() - (w + 5);
+        $.vakata.context.cnt.find("li > ul").addClass("right");
+      }
+      if (y + h > $(document).height()) {
+        y = y - (h + t[0].offsetHeight);
+        $.vakata.context.cnt.find("li > ul").addClass("bottom");
+      }
+
+      $.vakata.context.cnt
+      .css({"left": x, "top": y})
+      .find("li:has(ul)")
+      .bind("mouseenter", function (e) {
+        var w = $(document).width(),
+            h = $(document).height(),
+            ul = $(this).children("ul").show();
+        if (w !== $(document).width()) {
+          ul.toggleClass("right");
+        }
+        if (h !== $(document).height()) {
+          ul.toggleClass("bottom");
+        }
+      })
+      .bind("mouseleave", function (e) {
+        $(this).children("ul").hide();
+      })
+      .end()
+      .css({"visibility": "visible"})
+      .show();
+      $(document).triggerHandler("context_show.vakata");
+    },
+    hide: function () {
+      $.vakata.context.vis = false;
+      $.vakata.context.cnt.attr("class", "").hide();
+      $(document).triggerHandler("context_hide.vakata");
+    },
+    parse: function (s, is_callback) {
+      if (!s) {
+        return false;
+      }
+      var str = "",
+          tmp = false,
+          was_sep = true;
+      if (!is_callback) {
+        $.vakata.context.func = {};
+      }
+      str += "<ul>";
+      $.each(s, function (i, val) {
+        if (!val) {
+          return true;
+        }
+        $.vakata.context.func[i] = val.action;
+        if (!was_sep && val.separator_before) {
+          str += "<li class='vakata-separator vakata-separator-before'></li>";
+        }
+        was_sep = false;
+        str += "<li class='" + (val._class || "") + (val._disabled
+            ? " jstree-contextmenu-disabled " : "") + "'><ins ";
+        if (val.icon && val.icon.indexOf("/") === -1) {
+          str += " class='" + val.icon + "' ";
+        }
+        if (val.icon && val.icon.indexOf("/") !== -1) {
+          str += " style='background:url(" + val.icon
+              + ") center center no-repeat;' ";
+        }
+        str += ">&#160;</ins><a href='#' rel='" + i + "'>";
+        if (val.submenu) {
+          str += "<span style='float:right;'>&raquo;</span>";
+        }
+        str += val.label + "</a>";
+        if (val.submenu) {
+          tmp = $.vakata.context.parse(val.submenu, true);
+          if (tmp) {
+            str += tmp;
+          }
+        }
+        str += "</li>";
+        if (val.separator_after) {
+          str += "<li class='vakata-separator vakata-separator-after'></li>";
+          was_sep = true;
+        }
+      });
+      str = str.replace(
+          /<li class\='vakata-separator vakata-separator-after'\><\/li\>$/, "");
+      str += "</ul>";
+      return str.length > 10 ? str : false;
+    },
+    exec: function (i) {
+      if ($.isFunction($.vakata.context.func[i])) {
+        $.vakata.context.func[i].call($.vakata.context.data,
+            $.vakata.context.par);
+        return true;
+      }
+      else {
+        return false;
+      }
+    }
+  };
+  $(function () {
+    var css_string = '' +
+        '#vakata-contextmenu { display:none; position:absolute; margin:0; padding:0; min-width:180px; background:#ebebeb; border:1px solid silver; z-index:10000; *width:180px; } '
+        +
+        '#vakata-contextmenu ul { min-width:180px; *width:180px; } ' +
+        '#vakata-contextmenu ul, #vakata-contextmenu li { margin:0; padding:0; list-style-type:none; display:block; } '
+        +
+        '#vakata-contextmenu li { line-height:20px; min-height:20px; position:relative; padding:0px; } '
+        +
+        '#vakata-contextmenu li a { padding:1px 6px; line-height:17px; display:block; text-decoration:none; margin:1px 1px 0 1px; } '
+        +
+        '#vakata-contextmenu li ins { float:left; width:16px; height:16px; text-decoration:none; margin-right:2px; } '
+        +
+        '#vakata-contextmenu li a:hover, #vakata-contextmenu li.vakata-hover > a { background:gray; color:white; } '
+        +
+        '#vakata-contextmenu li ul { display:none; position:absolute; top:-2px; left:100%; background:#ebebeb; border:1px solid gray; } '
+        +
+        '#vakata-contextmenu .right { right:100%; left:auto; } ' +
+        '#vakata-contextmenu .bottom { bottom:-1px; top:auto; } ' +
+        '#vakata-contextmenu li.vakata-separator { min-height:0; height:1px; line-height:1px; font-size:1px; overflow:hidden; margin:0 2px; background:silver; /* border-top:1px solid #fefefe; */ padding:0; } ';
+    $.vakata.css.add_sheet({str: css_string});
+    $.vakata.context.cnt
+    .delegate("a", "click", function (e) {
+      e.preventDefault();
+    })
+    .delegate("a", "mouseup", function (e) {
+      if (!$(this).parent().hasClass("jstree-contextmenu-disabled")
+          && $.vakata.context.exec($(this).attr("rel"))) {
+        $.vakata.context.hide();
+      }
+      else {
+        $(this).blur();
+      }
+    })
+    .delegate("a", "mouseover", function () {
+      $.vakata.context.cnt.find(".vakata-hover").removeClass("vakata-hover");
+    })
+    .appendTo("body");
+    $(document).bind("mousedown", function (e) {
+      if ($.vakata.context.vis && !$.contains($.vakata.context.cnt[0],
+              e.target)) {
+        $.vakata.context.hide();
+      }
+    });
+    if (typeof $.hotkeys !== "undefined") {
+      $(document)
+      .bind("keydown", "up", function (e) {
+        if ($.vakata.context.vis) {
+          var o = $.vakata.context.cnt.find("ul:visible").last().children(
+              ".vakata-hover").removeClass("vakata-hover").prevAll(
+              "li:not(.vakata-separator)").first();
+          if (!o.length) {
+            o = $.vakata.context.cnt.find("ul:visible").last().children(
+                "li:not(.vakata-separator)").last();
+          }
+          o.addClass("vakata-hover");
+          e.stopImmediatePropagation();
+          e.preventDefault();
+        }
+      })
+      .bind("keydown", "down", function (e) {
+        if ($.vakata.context.vis) {
+          var o = $.vakata.context.cnt.find("ul:visible").last().children(
+              ".vakata-hover").removeClass("vakata-hover").nextAll(
+              "li:not(.vakata-separator)").first();
+          if (!o.length) {
+            o = $.vakata.context.cnt.find("ul:visible").last().children(
+                "li:not(.vakata-separator)").first();
+          }
+          o.addClass("vakata-hover");
+          e.stopImmediatePropagation();
+          e.preventDefault();
+        }
+      })
+      .bind("keydown", "right", function (e) {
+        if ($.vakata.context.vis) {
+          $.vakata.context.cnt.find(".vakata-hover").children(
+              "ul").show().children("li:not(.vakata-separator)").removeClass(
+              "vakata-hover").first().addClass("vakata-hover");
+          e.stopImmediatePropagation();
+          e.preventDefault();
+        }
+      })
+      .bind("keydown", "left", function (e) {
+        if ($.vakata.context.vis) {
+          $.vakata.context.cnt.find(".vakata-hover").children(
+              "ul").hide().children(".vakata-separator").removeClass(
+              "vakata-hover");
+          e.stopImmediatePropagation();
+          e.preventDefault();
+        }
+      })
+      .bind("keydown", "esc", function (e) {
+        $.vakata.context.hide();
+        e.preventDefault();
+      })
+      .bind("keydown", "space", function (e) {
+        $.vakata.context.cnt.find(".vakata-hover").last().children("a").click();
+        e.preventDefault();
+      });
+    }
+  });
+
+  $.jstree.plugin("contextmenu", {
+    __init: function () {
+      this.get_container()
+      .delegate("a", "contextmenu.jstree", $.proxy(function (e) {
+        e.preventDefault();
+        this.show_contextmenu(e.currentTarget, e.pageX, e.pageY);
+      }, this))
+      .bind("destroy.jstree", $.proxy(function () {
+        if (this.data.contextmenu) {
+          $.vakata.context.hide();
+        }
+      }, this));
+      $(document).bind("context_hide.vakata", $.proxy(function () {
+        this.data.contextmenu = false;
+      }, this));
+    },
+    defaults: {
+      select_node: false, // requires UI plugin
+      show_at_node: true,
+      items: { // Could be a function that should return an object like this one
+        "create": {
+          "separator_before": false,
+          "separator_after": true,
+          "label": "Create",
+          "action": function (obj) {
+            this.create(obj);
+          }
+        },
+        "rename": {
+          "separator_before": false,
+          "separator_after": false,
+          "label": "Rename",
+          "action": function (obj) {
+            this.rename(obj);
+          }
+        },
+        "remove": {
+          "separator_before": false,
+          "icon": false,
+          "separator_after": false,
+          "label": "Delete",
+          "action": function (obj) {
+            this.remove(obj);
+          }
+        },
+        "ccp": {
+          "separator_before": true,
+          "icon": false,
+          "separator_after": false,
+          "label": "Edit",
+          "action": false,
+          "submenu": {
+            "cut": {
+              "separator_before": false,
+              "separator_after": false,
+              "label": "Cut",
+              "action": function (obj) {
+                this.cut(obj);
+              }
+            },
+            "copy": {
+              "separator_before": false,
+              "icon": false,
+              "separator_after": false,
+              "label": "Copy",
+              "action": function (obj) {
+                this.copy(obj);
+              }
+            },
+            "paste": {
+              "separator_before": false,
+              "icon": false,
+              "separator_after": false,
+              "label": "Paste",
+              "action": function (obj) {
+                this.paste(obj);
+              }
+            }
+          }
+        }
+      }
+    },
+    _fn: {
+      show_contextmenu: function (obj, x, y) {
+        obj = this._get_node(obj);
+        var s = this.get_settings().contextmenu,
+            a = obj.children("a:visible:eq(0)"),
+            o = false;
+        if (s.select_node && this.data.ui && !this.is_selected(obj)) {
+          this.deselect_all();
+          this.select_node(obj, true);
+        }
+        if (s.show_at_node || typeof x === "undefined" || typeof y
+            === "undefined") {
+          o = a.offset();
+          x = o.left;
+          y = o.top + this.data.core.li_height;
+        }
+        if ($.isFunction(s.items)) {
+          s.items = s.items.call(this, obj);
+        }
+        this.data.contextmenu = true;
+        $.vakata.context.show(s.items, a, x, y, this, obj);
+        if (this.data.themes) {
+          $.vakata.context.cnt.attr("class", "jstree-" + this.data.themes.theme
+              + "-context");
+        }
+      }
+    }
+  });
 })(jQuery);
 //*/
 
-/* 
+/*
  * jsTree types plugin 1.0
  * Adds support types of nodes
  * You can set an attribute on each li node, that represents its type.
  * According to the type setting the node may get custom icon/validation rules
  */
 (function ($) {
-	$.jstree.plugin("types", {
-		__init : function () {
-			var s = this._get_settings().types;
-			this.data.types.attach_to = [];
-			this.get_container()
-				.bind("init.jstree", $.proxy(function () { 
-						var types = s.types, 
-							attr  = s.type_attr, 
-							icons_css = "", 
-							_this = this;
-
-						$.each(types, function (i, tp) {
-							$.each(tp, function (k, v) { 
-								if(!/^(max_depth|max_children|icon|valid_children)$/.test(k)) { _this.data.types.attach_to.push(k); }
-							});
-							if(!tp.icon) { return true; }
-							if( tp.icon.image || tp.icon.position) {
-								if(i == "default")	{ icons_css += '.jstree-' + _this.get_index() + ' a > .jstree-icon { '; }
-								else				{ icons_css += '.jstree-' + _this.get_index() + ' li[' + attr + '=' + i + '] > a > .jstree-icon { '; }
-								if(tp.icon.image)	{ icons_css += ' background-image:url(' + tp.icon.image + '); '; }
-								if(tp.icon.position){ icons_css += ' background-position:' + tp.icon.position + '; '; }
-								else				{ icons_css += ' background-position:0 0; '; }
-								icons_css += '} ';
-							}
-						});
-						if(icons_css != "") { $.vakata.css.add_sheet({ 'str' : icons_css }); }
-					}, this))
-				.bind("before.jstree", $.proxy(function (e, data) { 
-						if($.inArray(data.func, this.data.types.attach_to) !== -1) {
-							var s = this._get_settings().types.types,
-								t = this._get_type(data.args[0]);
-							if(
-								( 
-									(s[t] && typeof s[t][data.func] !== "undefined") || 
-									(s["default"] && typeof s["default"][data.func] !== "undefined")
-								) && !this._check(data.func, data.args[0])
-							) {
-								e.stopImmediatePropagation();
-								return false;
-							}
-						}
-					}, this));
-		},
-		defaults : {
-			// defines maximum number of root nodes (-1 means unlimited, -2 means disable max_children checking)
-			max_children		: -1,
-			// defines the maximum depth of the tree (-1 means unlimited, -2 means disable max_depth checking)
-			max_depth			: -1,
-			// defines valid node types for the root nodes
-			valid_children		: "all",
-
-			// where is the type stores (the rel attribute of the LI element)
-			type_attr : "rel",
-			// a list of types
-			types : {
-				// the default type
-				"default" : {
-					"max_children"	: -1,
-					"max_depth"		: -1,
-					"valid_children": "all"
-
-					// Bound functions - you can bind any other function here (using boolean or function)
-					//"select_node"	: true,
-					//"open_node"	: true,
-					//"close_node"	: true,
-					//"create_node"	: true,
-					//"delete_node"	: true
-				}
-			}
-		},
-		_fn : {
-			_get_type : function (obj) {
-				obj = this._get_node(obj);
-				return (!obj || !obj.length) ? false : obj.attr(this._get_settings().types.type_attr) || "default";
-			},
-			set_type : function (str, obj) {
-				obj = this._get_node(obj);
-				return (!obj.length || !str) ? false : obj.attr(this._get_settings().types.type_attr, str);
-			},
-			_check : function (rule, obj, opts) {
-				var v = false, t = this._get_type(obj), d = 0, _this = this, s = this._get_settings().types;
-				if(obj === -1) { 
-					if(!!s[rule]) { v = s[rule]; }
-					else { return; }
-				}
-				else {
-					if(t === false) { return; }
-					if(!!s.types[t] && !!s.types[t][rule]) { v = s.types[t][rule]; }
-					else if(!!s.types["default"] && !!s.types["default"][rule]) { v = s.types["default"][rule]; }
-				}
-				if($.isFunction(v)) { v = v.call(this, obj); }
-				if(rule === "max_depth" && obj !== -1 && opts !== false && s.max_depth !== -2 && v !== 0) {
-					// also include the node itself - otherwise if root node it is not checked
-					this._get_node(obj).children("a:eq(0)").parentsUntil(".jstree","li").each(function (i) {
-						// check if current depth already exceeds global tree depth
-						if(s.max_depth !== -1 && s.max_depth - (i + 1) <= 0) { v = 0; return false; }
-						d = (i === 0) ? v : _this._check(rule, this, false);
-						// check if current node max depth is already matched or exceeded
-						if(d !== -1 && d - (i + 1) <= 0) { v = 0; return false; }
-						// otherwise - set the max depth to the current value minus current depth
-						if(d >= 0 && (d - (i + 1) < v || v < 0) ) { v = d - (i + 1); }
-						// if the global tree depth exists and it minus the nodes calculated so far is less than `v` or `v` is unlimited
-						if(s.max_depth >= 0 && (s.max_depth - (i + 1) < v || v < 0) ) { v = s.max_depth - (i + 1); }
-					});
-				}
-				return v;
-			},
-			check_move : function () {
-				if(!this.__call_old()) { return false; }
-				var m  = this._get_move(),
-					s  = m.rt._get_settings().types,
-					mc = m.rt._check("max_children", m.cr),
-					md = m.rt._check("max_depth", m.cr),
-					vc = m.rt._check("valid_children", m.cr),
-					ch = 0, d = 1, t;
-
-				if(vc === "none") { return false; } 
-				if($.isArray(vc) && m.ot && m.ot._get_type) {
-					m.o.each(function () {
-						if($.inArray(m.ot._get_type(this), vc) === -1) { d = false; return false; }
-					});
-					if(d === false) { return false; }
-				}
-				if(s.max_children !== -2 && mc !== -1) {
-					ch = m.cr === -1 ? this.get_container().children("> ul > li").not(m.o).length : m.cr.children("> ul > li").not(m.o).length;
-					if(ch + m.o.length > mc) { return false; }
-				}
-				if(s.max_depth !== -2 && md !== -1) {
-					d = 0;
-					if(md === 0) { return false; }
-					if(typeof m.o.d === "undefined") {
-						// TODO: deal with progressive rendering and async when checking max_depth (how to know the depth of the moved node)
-						t = m.o;
-						while(t.length > 0) {
-							t = t.find("> ul > li");
-							d ++;
-						}
-						m.o.d = d;
-					}
-					if(md - m.o.d < 0) { return false; }
-				}
-				return true;
-			},
-			create_node : function (obj, position, js, callback, is_loaded, skip_check) {
-				if(!skip_check && (is_loaded || this._is_loaded(obj))) {
-					var p  = (position && position.match(/^before|after$/i) && obj !== -1) ? this._get_parent(obj) : this._get_node(obj),
-						s  = this._get_settings().types,
-						mc = this._check("max_children", p),
-						md = this._check("max_depth", p),
-						vc = this._check("valid_children", p),
-						ch;
-					if(!js) { js = {}; }
-					if(vc === "none") { return false; } 
-					if($.isArray(vc)) {
-						if(!js.attr || !js.attr[s.type_attr]) { 
-							if(!js.attr) { js.attr = {}; }
-							js.attr[s.type_attr] = vc[0]; 
-						}
-						else {
-							if($.inArray(js.attr[s.type_attr], vc) === -1) { return false; }
-						}
-					}
-					if(s.max_children !== -2 && mc !== -1) {
-						ch = p === -1 ? this.get_container().children("> ul > li").length : p.children("> ul > li").length;
-						if(ch + 1 > mc) { return false; }
-					}
-					if(s.max_depth !== -2 && md !== -1 && (md - 1) < 0) { return false; }
-				}
-				return this.__call_old(true, obj, position, js, callback, is_loaded, skip_check);
-			}
-		}
-	});
+  $.jstree.plugin("types", {
+    __init: function () {
+      var s = this._get_settings().types;
+      this.data.types.attach_to = [];
+      this.get_container()
+      .bind("init.jstree", $.proxy(function () {
+        var types = s.types,
+            attr = s.type_attr,
+            icons_css = "",
+            _this = this;
+
+        $.each(types, function (i, tp) {
+          $.each(tp, function (k, v) {
+            if (!/^(max_depth|max_children|icon|valid_children)$/.test(k)) {
+              _this.data.types.attach_to.push(k);
+            }
+          });
+          if (!tp.icon) {
+            return true;
+          }
+          if (tp.icon.image || tp.icon.position) {
+            if (i == "default") {
+              icons_css += '.jstree-' + _this.get_index()
+                  + ' a > .jstree-icon { ';
+            }
+            else {
+              icons_css += '.jstree-' + _this.get_index() + ' li[' + attr + '='
+                  + i + '] > a > .jstree-icon { ';
+            }
+            if (tp.icon.image) {
+              icons_css += ' background-image:url(' + tp.icon.image + '); ';
+            }
+            if (tp.icon.position) {
+              icons_css += ' background-position:' + tp.icon.position + '; ';
+            }
+            else {
+              icons_css += ' background-position:0 0; ';
+            }
+            icons_css += '} ';
+          }
+        });
+        if (icons_css != "") {
+          $.vakata.css.add_sheet({'str': icons_css});
+        }
+      }, this))
+      .bind("before.jstree", $.proxy(function (e, data) {
+        if ($.inArray(data.func, this.data.types.attach_to) !== -1) {
+          var s = this._get_settings().types.types,
+              t = this._get_type(data.args[0]);
+          if (
+              (
+                  (s[t] && typeof s[t][data.func] !== "undefined") ||
+                  (s["default"] && typeof s["default"][data.func]
+                      !== "undefined")
+              ) && !this._check(data.func, data.args[0])
+          ) {
+            e.stopImmediatePropagation();
+            return false;
+          }
+        }
+      }, this));
+    },
+    defaults: {
+      // defines maximum number of root nodes (-1 means unlimited, -2 means disable max_children checking)
+      max_children: -1,
+      // defines the maximum depth of the tree (-1 means unlimited, -2 means disable max_depth checking)
+      max_depth: -1,
+      // defines valid node types for the root nodes
+      valid_children: "all",
+
+      // where is the type stores (the rel attribute of the LI element)
+      type_attr: "rel",
+      // a list of types
+      types: {
+        // the default type
+        "default": {
+          "max_children": -1,
+          "max_depth": -1,
+          "valid_children": "all"
+
+          // Bound functions - you can bind any other function here (using boolean or function)
+          //"select_node"	: true,
+          //"open_node"	: true,
+          //"close_node"	: true,
+          //"create_node"	: true,
+          //"delete_node"	: true
+        }
+      }
+    },
+    _fn: {
+      _get_type: function (obj) {
+        obj = this._get_node(obj);
+        return (!obj || !obj.length) ? false : obj.attr(
+            this._get_settings().types.type_attr) || "default";
+      },
+      set_type: function (str, obj) {
+        obj = this._get_node(obj);
+        return (!obj.length || !str) ? false : obj.attr(
+            this._get_settings().types.type_attr, str);
+      },
+      _check: function (rule, obj, opts) {
+        var v = false, t = this._get_type(obj), d = 0, _this = this,
+            s = this._get_settings().types;
+        if (obj === -1) {
+          if (!!s[rule]) {
+            v = s[rule];
+          }
+          else {
+            return;
+          }
+        }
+        else {
+          if (t === false) {
+            return;
+          }
+          if (!!s.types[t] && !!s.types[t][rule]) {
+            v = s.types[t][rule];
+          }
+          else if (!!s.types["default"] && !!s.types["default"][rule]) {
+            v = s.types["default"][rule];
+          }
+        }
+        if ($.isFunction(v)) {
+          v = v.call(this, obj);
+        }
+        if (rule === "max_depth" && obj !== -1 && opts !== false && s.max_depth
+            !== -2 && v !== 0) {
+          // also include the node itself - otherwise if root node it is not checked
+          this._get_node(obj).children("a:eq(0)").parentsUntil(".jstree",
+              "li").each(function (i) {
+            // check if current depth already exceeds global tree depth
+            if (s.max_depth !== -1 && s.max_depth - (i + 1) <= 0) {
+              v = 0;
+              return false;
+            }
+            d = (i === 0) ? v : _this._check(rule, this, false);
+            // check if current node max depth is already matched or exceeded
+            if (d !== -1 && d - (i + 1) <= 0) {
+              v = 0;
+              return false;
+            }
+            // otherwise - set the max depth to the current value minus current depth
+            if (d >= 0 && (d - (i + 1) < v || v < 0)) {
+              v = d - (i + 1);
+            }
+            // if the global tree depth exists and it minus the nodes calculated so far is less than `v` or `v` is unlimited
+            if (s.max_depth >= 0 && (s.max_depth - (i + 1) < v || v < 0)) {
+              v = s.max_depth - (i + 1);
+            }
+          });
+        }
+        return v;
+      },
+      check_move: function () {
+        if (!this.__call_old()) {
+          return false;
+        }
+        var m = this._get_move(),
+            s = m.rt._get_settings().types,
+            mc = m.rt._check("max_children", m.cr),
+            md = m.rt._check("max_depth", m.cr),
+            vc = m.rt._check("valid_children", m.cr),
+            ch = 0, d = 1, t;
+
+        if (vc === "none") {
+          return false;
+        }
+        if ($.isArray(vc) && m.ot && m.ot._get_type) {
+          m.o.each(function () {
+            if ($.inArray(m.ot._get_type(this), vc) === -1) {
+              d = false;
+              return false;
+            }
+          });
+          if (d === false) {
+            return false;
+          }
+        }
+        if (s.max_children !== -2 && mc !== -1) {
+          ch = m.cr === -1 ? this.get_container().children("> ul > li").not(
+              m.o).length : m.cr.children("> ul > li").not(m.o).length;
+          if (ch + m.o.length > mc) {
+            return false;
+          }
+        }
+        if (s.max_depth !== -2 && md !== -1) {
+          d = 0;
+          if (md === 0) {
+            return false;
+          }
+          if (typeof m.o.d === "undefined") {
+            // TODO: deal with progressive rendering and async when checking max_depth (how to know the depth of the moved node)
+            t = m.o;
+            while (t.length > 0) {
+              t = t.find("> ul > li");
+              d++;
+            }
+            m.o.d = d;
+          }
+          if (md - m.o.d < 0) {
+            return false;
+          }
+        }
+        return true;
+      },
+      create_node: function (obj, position, js, callback, is_loaded,
+          skip_check) {
+        if (!skip_check && (is_loaded || this._is_loaded(obj))) {
+          var p = (position && position.match(/^before|after$/i) && obj !== -1)
+              ? this._get_parent(obj) : this._get_node(obj),
+              s = this._get_settings().types,
+              mc = this._check("max_children", p),
+              md = this._check("max_depth", p),
+              vc = this._check("valid_children", p),
+              ch;
+          if (!js) {
+            js = {};
+          }
+          if (vc === "none") {
+            return false;
+          }
+          if ($.isArray(vc)) {
+            if (!js.attr || !js.attr[s.type_attr]) {
+              if (!js.attr) {
+                js.attr = {};
+              }
+              js.attr[s.type_attr] = vc[0];
+            }
+            else {
+              if ($.inArray(js.attr[s.type_attr], vc) === -1) {
+                return false;
+              }
+            }
+          }
+          if (s.max_children !== -2 && mc !== -1) {
+            ch = p === -1 ? this.get_container().children("> ul > li").length
+                : p.children("> ul > li").length;
+            if (ch + 1 > mc) {
+              return false;
+            }
+          }
+          if (s.max_depth !== -2 && md !== -1 && (md - 1) < 0) {
+            return false;
+          }
+        }
+        return this.__call_old(true, obj, position, js, callback, is_loaded,
+            skip_check);
+      }
+    }
+  });
 })(jQuery);
 //*/
 
-/* 
+/*
  * jsTree HTML data 1.0
  * The HTML data store. Datastores are build by replacing the `load_node` and `_is_loaded` functions.
  */
 (function ($) {
-	$.jstree.plugin("html_data", {
-		__init : function () { 
-			// this used to use html() and clean the whitespace, but this way any attached data was lost
-			this.data.html_data.original_container_html = this.get_container().find(" > ul > li").clone(true);
-			// remove white space from LI node - otherwise nodes appear a bit to the right
-			this.data.html_data.original_container_html.find("li").andSelf().contents().filter(function() { return this.nodeType == 3; }).remove();
-		},
-		defaults : { 
-			data : false,
-			ajax : false,
-			correct_state : true
-		},
-		_fn : {
-			load_node : function (obj, s_call, e_call) { var _this = this; this.load_node_html(obj, function () { _this.__callback({ "obj" : obj }); s_call.call(this); }, e_call); },
-			_is_loaded : function (obj) { 
-				obj = this._get_node(obj); 
-				return obj == -1 || !obj || !this._get_settings().html_data.ajax || obj.is(".jstree-open, .jstree-leaf") || obj.children("ul").children("li").size() > 0;
-			},
-			load_node_html : function (obj, s_call, e_call) {
-				var d,
-					s = this.get_settings().html_data,
-					error_func = function () {},
-					success_func = function () {};
-				obj = this._get_node(obj);
-				if(obj && obj !== -1) {
-					if(obj.data("jstree-is-loading")) { return; }
-					else { obj.data("jstree-is-loading",true); }
-				}
-				switch(!0) {
-					case (!s.data && !s.ajax):
-						if(!obj || obj == -1) {
-							this.get_container()
-								.children("ul").empty()
-								.append(this.data.html_data.original_container_html)
-								.find("li, a").filter(function () { return this.firstChild.tagName !== "INS"; }).prepend("<ins class='jstree-icon'>&#160;</ins>").end()
-								.filter("a").children("ins:first-child").not(".jstree-icon").addClass("jstree-icon");
-							this.clean_node();
-						}
-						if(s_call) { s_call.call(this); }
-						break;
-					case (!!s.data && !s.ajax) || (!!s.data && !!s.ajax && (!obj || obj === -1)):
-						if(!obj || obj == -1) {
-							d = $(s.data);
-							if(!d.is("ul")) { d = $("<ul>").append(d); }
-							this.get_container()
-								.children("ul").empty().append(d.children())
-								.find("li, a").filter(function () { return this.firstChild.tagName !== "INS"; }).prepend("<ins class='jstree-icon'>&#160;</ins>").end()
-								.filter("a").children("ins:first-child").not(".jstree-icon").addClass("jstree-icon");
-							this.clean_node();
-						}
-						if(s_call) { s_call.call(this); }
-						break;
-					case (!s.data && !!s.ajax) || (!!s.data && !!s.ajax && obj && obj !== -1):
-						obj = this._get_node(obj);
-						error_func = function (x, t, e) {
-							var ef = this.get_settings().html_data.ajax.error; 
-							if(ef) { ef.call(this, x, t, e); }
-							if(obj != -1 && obj.length) {
-								obj.children(".jstree-loading").removeClass("jstree-loading");
-								obj.data("jstree-is-loading",false);
-								if(t === "success" && s.correct_state) { obj.removeClass("jstree-open jstree-closed").addClass("jstree-leaf"); }
-							}
-							else {
-								if(t === "success" && s.correct_state) { this.get_container().children("ul").empty(); }
-							}
-							if(e_call) { e_call.call(this); }
-						};
-						success_func = function (d, t, x) {
-							var sf = this.get_settings().html_data.ajax.success; 
-							if(sf) { d = sf.call(this,d,t,x) || d; }
-							if(d == "") {
-								return error_func.call(this, x, t, "");
-							}
-							if(d) {
-								d = $(d);
-								if(!d.is("ul")) { d = $("<ul>").append(d); }
-								if(obj == -1 || !obj) { this.get_container().children("ul").empty().append(d.children()).find("li, a").filter(function () { return this.firstChild.tagName !== "INS"; }).prepend("<ins class='jstree-icon'>&#160;</ins>").end().filter("a").children("ins:first-child").not(".jstree-icon").addClass("jstree-icon"); }
-								else { obj.children(".jstree-loading").removeClass("jstree-loading"); obj.append(d).find("li, a").filter(function () { return this.firstChild.tagName !== "INS"; }).prepend("<ins class='jstree-icon'>&#160;</ins>").end().filter("a").children("ins:first-child").not(".jstree-icon").addClass("jstree-icon"); obj.data("jstree-is-loading",false); }
-								this.clean_node(obj);
-								if(s_call) { s_call.call(this); }
-							}
-							else {
-								if(obj && obj !== -1) {
-									obj.children(".jstree-loading").removeClass("jstree-loading");
-									obj.data("jstree-is-loading",false);
-									if(s.correct_state) { 
-										obj.removeClass("jstree-open jstree-closed").addClass("jstree-leaf"); 
-										if(s_call) { s_call.call(this); } 
-									}
-								}
-								else {
-									if(s.correct_state) { 
-										this.get_container().children("ul").empty();
-										if(s_call) { s_call.call(this); } 
-									}
-								}
-							}
-						};
-						s.ajax.context = this;
-						s.ajax.error = error_func;
-						s.ajax.success = success_func;
-						if(!s.ajax.dataType) { s.ajax.dataType = "html"; }
-						if($.isFunction(s.ajax.url)) { s.ajax.url = s.ajax.url.call(this, obj); }
-						if($.isFunction(s.ajax.data)) { s.ajax.data = s.ajax.data.call(this, obj); }
-						$.ajax(s.ajax);
-						break;
-				}
-			}
-		}
-	});
-	// include the HTML data plugin by default
-	$.jstree.defaults.plugins.push("html_data");
+  $.jstree.plugin("html_data", {
+    __init: function () {
+      // this used to use html() and clean the whitespace, but this way any attached data was lost
+      this.data.html_data.original_container_html = this.get_container().find(
+          " > ul > li").clone(true);
+      // remove white space from LI node - otherwise nodes appear a bit to the right
+      this.data.html_data.original_container_html.find(
+          "li").andSelf().contents().filter(function () {
+        return this.nodeType == 3;
+      }).remove();
+    },
+    defaults: {
+      data: false,
+      ajax: false,
+      correct_state: true
+    },
+    _fn: {
+      load_node: function (obj, s_call, e_call) {
+        var _this = this;
+        this.load_node_html(obj, function () {
+          _this.__callback({"obj": obj});
+          s_call.call(this);
+        }, e_call);
+      },
+      _is_loaded: function (obj) {
+        obj = this._get_node(obj);
+        return obj == -1 || !obj || !this._get_settings().html_data.ajax
+            || obj.is(".jstree-open, .jstree-leaf") || obj.children(
+                "ul").children("li").size() > 0;
+      },
+      load_node_html: function (obj, s_call, e_call) {
+        var d,
+            s = this.get_settings().html_data,
+            error_func = function () {
+            },
+            success_func = function () {
+            };
+        obj = this._get_node(obj);
+        if (obj && obj !== -1) {
+          if (obj.data("jstree-is-loading")) {
+            return;
+          }
+          else {
+            obj.data("jstree-is-loading", true);
+          }
+        }
+        switch (!0) {
+          case (!s.data && !s.ajax):
+            if (!obj || obj == -1) {
+              this.get_container()
+              .children("ul").empty()
+              .append(this.data.html_data.original_container_html)
+              .find("li, a").filter(function () {
+                return this.firstChild.tagName !== "INS";
+              }).prepend("<ins class='jstree-icon'>&#160;</ins>").end()
+              .filter("a").children("ins:first-child").not(
+                  ".jstree-icon").addClass("jstree-icon");
+              this.clean_node();
+            }
+            if (s_call) {
+              s_call.call(this);
+            }
+            break;
+          case (!!s.data && !s.ajax) || (!!s.data && !!s.ajax && (!obj || obj
+              === -1)):
+            if (!obj || obj == -1) {
+              d = $(s.data);
+              if (!d.is("ul")) {
+                d = $("<ul>").append(d);
+              }
+              this.get_container()
+              .children("ul").empty().append(d.children())
+              .find("li, a").filter(function () {
+                return this.firstChild.tagName !== "INS";
+              }).prepend("<ins class='jstree-icon'>&#160;</ins>").end()
+              .filter("a").children("ins:first-child").not(
+                  ".jstree-icon").addClass("jstree-icon");
+              this.clean_node();
+            }
+            if (s_call) {
+              s_call.call(this);
+            }
+            break;
+          case (!s.data && !!s.ajax) || (!!s.data && !!s.ajax && obj && obj
+              !== -1):
+            obj = this._get_node(obj);
+            error_func = function (x, t, e) {
+              var ef = this.get_settings().html_data.ajax.error;
+              if (ef) {
+                ef.call(this, x, t, e);
+              }
+              if (obj != -1 && obj.length) {
+                obj.children(".jstree-loading").removeClass("jstree-loading");
+                obj.data("jstree-is-loading", false);
+                if (t === "success" && s.correct_state) {
+                  obj.removeClass("jstree-open jstree-closed").addClass(
+                      "jstree-leaf");
+                }
+              }
+              else {
+                if (t === "success" && s.correct_state) {
+                  this.get_container().children("ul").empty();
+                }
+              }
+              if (e_call) {
+                e_call.call(this);
+              }
+            };
+            success_func = function (d, t, x) {
+              var sf = this.get_settings().html_data.ajax.success;
+              if (sf) {
+                d = sf.call(this, d, t, x) || d;
+              }
+              if (d == "") {
+                return error_func.call(this, x, t, "");
+              }
+              if (d) {
+                d = $(d);
+                if (!d.is("ul")) {
+                  d = $("<ul>").append(d);
+                }
+                if (obj == -1 || !obj) {
+                  this.get_container().children("ul").empty().append(
+                      d.children()).find("li, a").filter(function () {
+                    return this.firstChild.tagName !== "INS";
+                  }).prepend(
+                      "<ins class='jstree-icon'>&#160;</ins>").end().filter(
+                      "a").children("ins:first-child").not(
+                      ".jstree-icon").addClass("jstree-icon");
+                }
+                else {
+                  obj.children(".jstree-loading").removeClass("jstree-loading");
+                  obj.append(d).find("li, a").filter(function () {
+                    return this.firstChild.tagName !== "INS";
+                  }).prepend(
+                      "<ins class='jstree-icon'>&#160;</ins>").end().filter(
+                      "a").children("ins:first-child").not(
+                      ".jstree-icon").addClass("jstree-icon");
+                  obj.data("jstree-is-loading", false);
+                }
+                this.clean_node(obj);
+                if (s_call) {
+                  s_call.call(this);
+                }
+              }
+              else {
+                if (obj && obj !== -1) {
+                  obj.children(".jstree-loading").removeClass("jstree-loading");
+                  obj.data("jstree-is-loading", false);
+                  if (s.correct_state) {
+                    obj.removeClass("jstree-open jstree-closed").addClass(
+                        "jstree-leaf");
+                    if (s_call) {
+                      s_call.call(this);
+                    }
+                  }
+                }
+                else {
+                  if (s.correct_state) {
+                    this.get_container().children("ul").empty();
+                    if (s_call) {
+                      s_call.call(this);
+                    }
+                  }
+                }
+              }
+            };
+            s.ajax.context = this;
+            s.ajax.error = error_func;
+            s.ajax.success = success_func;
+            if (!s.ajax.dataType) {
+              s.ajax.dataType = "html";
+            }
+            if ($.isFunction(s.ajax.url)) {
+              s.ajax.url = s.ajax.url.call(this, obj);
+            }
+            if ($.isFunction(s.ajax.data)) {
+              s.ajax.data = s.ajax.data.call(this, obj);
+            }
+            $.ajax(s.ajax);
+            break;
+        }
+      }
+    }
+  });
+  // include the HTML data plugin by default
+  $.jstree.defaults.plugins.push("html_data");
 })(jQuery);
 //*/
 
-/* 
+/*
  * jsTree themeroller plugin 1.0
  * Adds support for jQuery UI themes. Include this at the end of your plugins list, also make sure "themes" is not included.
  */
 (function ($) {
-	$.jstree.plugin("themeroller", {
-		__init : function () {
-			var s = this._get_settings().themeroller;
-			this.get_container()
-				.addClass("ui-widget-content")
-				.delegate("a","mouseenter.jstree", function () {
-					$(this).addClass(s.item_h);
-				})
-				.delegate("a","mouseleave.jstree", function () {
-					$(this).removeClass(s.item_h);
-				})
-				.bind("open_node.jstree create_node.jstree", $.proxy(function (e, data) { 
-						this._themeroller(data.rslt.obj);
-					}, this))
-				.bind("loaded.jstree refresh.jstree", $.proxy(function (e) {
-						this._themeroller();
-					}, this))
-				.bind("close_node.jstree", $.proxy(function (e, data) {
-						data.rslt.obj.children("ins").removeClass(s.opened).addClass(s.closed);
-					}, this))
-				.bind("select_node.jstree", $.proxy(function (e, data) {
-						data.rslt.obj.children("a").addClass(s.item_a);
-					}, this))
-				.bind("deselect_node.jstree deselect_all.jstree", $.proxy(function (e, data) {
-						this.get_container()
-							.find("." + s.item_a).removeClass(s.item_a).end()
-							.find(".jstree-clicked").addClass(s.item_a);
-					}, this))
-				.bind("move_node.jstree", $.proxy(function (e, data) {
-						this._themeroller(data.rslt.o);
-					}, this));
-		},
-		__destroy : function () {
-			var s = this._get_settings().themeroller,
-				c = [ "ui-icon" ];
-			$.each(s, function (i, v) {
-				v = v.split(" ");
-				if(v.length) { c = c.concat(v); }
-			});
-			this.get_container()
-				.removeClass("ui-widget-content")
-				.find("." + c.join(", .")).removeClass(c.join(" "));
-		},
-		_fn : {
-			_themeroller : function (obj) {
-				var s = this._get_settings().themeroller;
-				obj = !obj || obj == -1 ? this.get_container() : this._get_node(obj).parent();
-				obj
-					.find("li.jstree-closed > ins.jstree-icon").removeClass(s.opened).addClass("ui-icon " + s.closed).end()
-					.find("li.jstree-open > ins.jstree-icon").removeClass(s.closed).addClass("ui-icon " + s.opened).end()
-					.find("a").addClass(s.item)
-						.children("ins.jstree-icon").addClass("ui-icon " + s.item_icon);
-			}
-		},
-		defaults : {
-			"opened" : "ui-icon-triangle-1-se",
-			"closed" : "ui-icon-triangle-1-e",
-			"item" : "ui-state-default",
-			"item_h" : "ui-state-hover",
-			"item_a" : "ui-state-active",
-			"item_icon" : "ui-icon-folder-collapsed"
-		}
-	});
-	$(function() {
-		var css_string = '.jstree .ui-icon { overflow:visible; } .jstree a { padding:0 2px; }';
-		$.vakata.css.add_sheet({ str : css_string });
-	});
+  $.jstree.plugin("themeroller", {
+    __init: function () {
+      var s = this._get_settings().themeroller;
+      this.get_container()
+      .addClass("ui-widget-content")
+      .delegate("a", "mouseenter.jstree", function () {
+        $(this).addClass(s.item_h);
+      })
+      .delegate("a", "mouseleave.jstree", function () {
+        $(this).removeClass(s.item_h);
+      })
+      .bind("open_node.jstree create_node.jstree", $.proxy(function (e, data) {
+        this._themeroller(data.rslt.obj);
+      }, this))
+      .bind("loaded.jstree refresh.jstree", $.proxy(function (e) {
+        this._themeroller();
+      }, this))
+      .bind("close_node.jstree", $.proxy(function (e, data) {
+        data.rslt.obj.children("ins").removeClass(s.opened).addClass(s.closed);
+      }, this))
+      .bind("select_node.jstree", $.proxy(function (e, data) {
+        data.rslt.obj.children("a").addClass(s.item_a);
+      }, this))
+      .bind("deselect_node.jstree deselect_all.jstree",
+          $.proxy(function (e, data) {
+            this.get_container()
+            .find("." + s.item_a).removeClass(s.item_a).end()
+            .find(".jstree-clicked").addClass(s.item_a);
+          }, this))
+      .bind("move_node.jstree", $.proxy(function (e, data) {
+        this._themeroller(data.rslt.o);
+      }, this));
+    },
+    __destroy: function () {
+      var s = this._get_settings().themeroller,
+          c = ["ui-icon"];
+      $.each(s, function (i, v) {
+        v = v.split(" ");
+        if (v.length) {
+          c = c.concat(v);
+        }
+      });
+      this.get_container()
+      .removeClass("ui-widget-content")
+      .find("." + c.join(", .")).removeClass(c.join(" "));
+    },
+    _fn: {
+      _themeroller: function (obj) {
+        var s = this._get_settings().themeroller;
+        obj = !obj || obj == -1 ? this.get_container() : this._get_node(
+            obj).parent();
+        obj
+        .find("li.jstree-closed > ins.jstree-icon").removeClass(
+            s.opened).addClass("ui-icon " + s.closed).end()
+        .find("li.jstree-open > ins.jstree-icon").removeClass(
+            s.closed).addClass("ui-icon " + s.opened).end()
+        .find("a").addClass(s.item)
+        .children("ins.jstree-icon").addClass("ui-icon " + s.item_icon);
+      }
+    },
+    defaults: {
+      "opened": "ui-icon-triangle-1-se",
+      "closed": "ui-icon-triangle-1-e",
+      "item": "ui-state-default",
+      "item_h": "ui-state-hover",
+      "item_a": "ui-state-active",
+      "item_icon": "ui-icon-folder-collapsed"
+    }
+  });
+  $(function () {
+    var css_string = '.jstree .ui-icon { overflow:visible; } .jstree a { padding:0 2px; }';
+    $.vakata.css.add_sheet({str: css_string});
+  });
 })(jQuery);
 //*/
 
-/* 
+/*
  * jsTree unique plugin 1.0
  * Forces different names amongst siblings (still a bit experimental)
  * NOTE: does not check language versions (it will not be possible to have nodes with the same title, even in different languages)
  */
 (function ($) {
-	$.jstree.plugin("unique", {
-		__init : function () {
-			this.get_container()
-				.bind("before.jstree", $.proxy(function (e, data) { 
-						var nms = [], res = true, p, t;
-						if(data.func == "move_node") {
-							// obj, ref, position, is_copy, is_prepared, skip_check
-							if(data.args[4] === true) {
-								if(data.args[0].o && data.args[0].o.length) {
-									data.args[0].o.children("a").each(function () { nms.push($(this).text().replace(/^\s+/g,"")); });
-									res = this._check_unique(nms, data.args[0].np.find("> ul > li").not(data.args[0].o));
-								}
-							}
-						}
-						if(data.func == "create_node") {
-							// obj, position, js, callback, is_loaded
-							if(data.args[4] || this._is_loaded(data.args[0])) {
-								p = this._get_node(data.args[0]);
-								if(data.args[1] && (data.args[1] === "before" || data.args[1] === "after")) {
-									p = this._get_parent(data.args[0]);
-									if(!p || p === -1) { p = this.get_container(); }
-								}
-								if(typeof data.args[2] === "string") { nms.push(data.args[2]); }
-								else if(!data.args[2] || !data.args[2].data) { nms.push(this._get_settings().core.strings.new_node); }
-								else { nms.push(data.args[2].data); }
-								res = this._check_unique(nms, p.find("> ul > li"));
-							}
-						}
-						if(data.func == "rename_node") {
-							// obj, val
-							nms.push(data.args[1]);
-							t = this._get_node(data.args[0]);
-							p = this._get_parent(t);
-							if(!p || p === -1) { p = this.get_container(); }
-							res = this._check_unique(nms, p.find("> ul > li").not(t));
-						}
-						if(!res) {
-							e.stopPropagation();
-							return false;
-						}
-					}, this));
-		},
-		_fn : { 
-			_check_unique : function (nms, p) {
-				var cnms = [];
-				p.children("a").each(function () { cnms.push($(this).text().replace(/^\s+/g,"")); });
-				if(!cnms.length || !nms.length) { return true; }
-				cnms = cnms.sort().join(",,").replace(/(,|^)([^,]+)(,,\2)+(,|$)/g,"$1$2$4").replace(/,,+/g,",").replace(/,$/,"").split(",");
-				if((cnms.length + nms.length) != cnms.concat(nms).sort().join(",,").replace(/(,|^)([^,]+)(,,\2)+(,|$)/g,"$1$2$4").replace(/,,+/g,",").replace(/,$/,"").split(",").length) {
-					return false;
-				}
-				return true;
-			},
-			check_move : function () {
-				if(!this.__call_old()) { return false; }
-				var p = this._get_move(), nms = [];
-				if(p.o && p.o.length) {
-					p.o.children("a").each(function () { nms.push($(this).text().replace(/^\s+/g,"")); });
-					return this._check_unique(nms, p.np.find("> ul > li").not(p.o));
-				}
-				return true;
-			}
-		}
-	});
+  $.jstree.plugin("unique", {
+    __init: function () {
+      this.get_container()
+      .bind("before.jstree", $.proxy(function (e, data) {
+        var nms = [], res = true, p, t;
+        if (data.func == "move_node") {
+          // obj, ref, position, is_copy, is_prepared, skip_check
+          if (data.args[4] === true) {
+            if (data.args[0].o && data.args[0].o.length) {
+              data.args[0].o.children("a").each(function () {
+                nms.push($(this).text().replace(/^\s+/g, ""));
+              });
+              res = this._check_unique(nms,
+                  data.args[0].np.find("> ul > li").not(data.args[0].o));
+            }
+          }
+        }
+        if (data.func == "create_node") {
+          // obj, position, js, callback, is_loaded
+          if (data.args[4] || this._is_loaded(data.args[0])) {
+            p = this._get_node(data.args[0]);
+            if (data.args[1] && (data.args[1] === "before" || data.args[1]
+                    === "after")) {
+              p = this._get_parent(data.args[0]);
+              if (!p || p === -1) {
+                p = this.get_container();
+              }
+            }
+            if (typeof data.args[2] === "string") {
+              nms.push(data.args[2]);
+            }
+            else if (!data.args[2] || !data.args[2].data) {
+              nms.push(this._get_settings().core.strings.new_node);
+            }
+            else {
+              nms.push(data.args[2].data);
+            }
+            res = this._check_unique(nms, p.find("> ul > li"));
+          }
+        }
+        if (data.func == "rename_node") {
+          // obj, val
+          nms.push(data.args[1]);
+          t = this._get_node(data.args[0]);
+          p = this._get_parent(t);
+          if (!p || p === -1) {
+            p = this.get_container();
+          }
+          res = this._check_unique(nms, p.find("> ul > li").not(t));
+        }
+        if (!res) {
+          e.stopPropagation();
+          return false;
+        }
+      }, this));
+    },
+    _fn: {
+      _check_unique: function (nms, p) {
+        var cnms = [];
+        p.children("a").each(function () {
+          cnms.push($(this).text().replace(/^\s+/g, ""));
+        });
+        if (!cnms.length || !nms.length) {
+          return true;
+        }
+        cnms = cnms.sort().join(",,").replace(/(,|^)([^,]+)(,,\2)+(,|$)/g,
+            "$1$2$4").replace(/,,+/g, ",").replace(/,$/, "").split(",");
+        if ((cnms.length + nms.length) != cnms.concat(nms).sort().join(
+                ",,").replace(/(,|^)([^,]+)(,,\2)+(,|$)/g, "$1$2$4").replace(
+                /,,+/g, ",").replace(/,$/, "").split(",").length) {
+          return false;
+        }
+        return true;
+      },
+      check_move: function () {
+        if (!this.__call_old()) {
+          return false;
+        }
+        var p = this._get_move(), nms = [];
+        if (p.o && p.o.length) {
+          p.o.children("a").each(function () {
+            nms.push($(this).text().replace(/^\s+/g, ""));
+          });
+          return this._check_unique(nms, p.np.find("> ul > li").not(p.o));
+        }
+        return true;
+      }
+    }
+  });
 })(jQuery);
-//*/
\ No newline at end of file
+//*/
diff --git a/azkaban-web-server/src/web/js/jquery/jquery.tablesorter.js b/azkaban-web-server/src/web/js/jquery/jquery.tablesorter.js
index 0db269a..8e08d26 100644
--- a/azkaban-web-server/src/web/js/jquery/jquery.tablesorter.js
+++ b/azkaban-web-server/src/web/js/jquery/jquery.tablesorter.js
@@ -1,853 +1,930 @@
 /*
- * 
+ *
  * TableSorter 2.0 - Client-side table sorting with ease!
  * Version 2.0.3
  * @requires jQuery v1.2.3
- * 
+ *
  * Copyright (c) 2007 Christian Bach
  * Examples and docs at: http://tablesorter.com
  * Dual licensed under the MIT and GPL licenses:
  * http://www.opensource.org/licenses/mit-license.php
  * http://www.gnu.org/licenses/gpl.html
- * 
+ *
  */
 /**
  *
  * @description Create a sortable table with multi-column sorting capabilitys
- * 
+ *
  * @example $('table').tablesorter();
  * @desc Create a simple tablesorter interface.
  *
  * @example $('table').tablesorter({ sortList:[[0,0],[1,0]] });
  * @desc Create a tablesorter interface and sort on the first and secound column in ascending order.
- * 
+ *
  * @example $('table').tablesorter({ headers: { 0: { sorter: false}, 1: {sorter: false} } });
  * @desc Create a tablesorter interface and disableing the first and secound column headers.
- * 
+ *
  * @example $('table').tablesorter({ 0: {sorter:"integer"}, 1: {sorter:"currency"} });
  * @desc Create a tablesorter interface and set a column parser for the first and secound column.
- * 
- * 
+ *
+ *
  * @param Object settings An object literal containing key/value pairs to provide optional settings.
- * 
- * @option String cssHeader (optional) 			A string of the class name to be appended to sortable tr elements in the thead of the table. 
- * 												Default value: "header"
- * 
- * @option String cssAsc (optional) 			A string of the class name to be appended to sortable tr elements in the thead on a ascending sort. 
- * 												Default value: "headerSortUp"
- * 
- * @option String cssDesc (optional) 			A string of the class name to be appended to sortable tr elements in the thead on a descending sort. 
- * 												Default value: "headerSortDown"
- * 
- * @option String sortInitialOrder (optional) 	A string of the inital sorting order can be asc or desc. 
- * 												Default value: "asc"
- * 
- * @option String sortMultisortKey (optional) 	A string of the multi-column sort key. 
- * 												Default value: "shiftKey"
- * 
- * @option String textExtraction (optional) 	A string of the text-extraction method to use. 
- * 												For complex html structures inside td cell set this option to "complex", 
- * 												on large tables the complex option can be slow. 
- * 												Default value: "simple"
- * 
- * @option Object headers (optional) 			An array containing the forces sorting rules. 
- * 												This option let's you specify a default sorting rule. 
- * 												Default value: null
- * 
- * @option Array sortList (optional) 			An array containing the forces sorting rules. 
- * 												This option let's you specify a default sorting rule. 
- * 												Default value: null
- * 
- * @option Array sortForce (optional) 			An array containing forced sorting rules. 
- * 												This option let's you specify a default sorting rule, which is prepended to user-selected rules.
- * 												Default value: null
- *  
-  * @option Array sortAppend (optional) 			An array containing forced sorting rules. 
- * 												This option let's you specify a default sorting rule, which is appended to user-selected rules.
- * 												Default value: null
- * 
- * @option Boolean widthFixed (optional) 		Boolean flag indicating if tablesorter should apply fixed widths to the table columns.
- * 												This is usefull when using the pager companion plugin.
- * 												This options requires the dimension jquery plugin.
- * 												Default value: false
  *
- * @option Boolean cancelSelection (optional) 	Boolean flag indicating if tablesorter should cancel selection of the table headers text.
- * 												Default value: true
+ * @option String cssHeader (optional)      A string of the class name to be appended to sortable tr elements in the thead of the table.
+ *                        Default value: "header"
+ *
+ * @option String cssAsc (optional)      A string of the class name to be appended to sortable tr elements in the thead on a ascending sort.
+ *                        Default value: "headerSortUp"
+ *
+ * @option String cssDesc (optional)      A string of the class name to be appended to sortable tr elements in the thead on a descending sort.
+ *                        Default value: "headerSortDown"
+ *
+ * @option String sortInitialOrder (optional)  A string of the inital sorting order can be asc or desc.
+ *                        Default value: "asc"
+ *
+ * @option String sortMultisortKey (optional)  A string of the multi-column sort key.
+ *                        Default value: "shiftKey"
  *
- * @option Boolean debug (optional) 			Boolean flag indicating if tablesorter should display debuging information usefull for development.
+ * @option String textExtraction (optional)  A string of the text-extraction method to use.
+ *                        For complex html structures inside td cell set this option to "complex",
+ *                        on large tables the complex option can be slow.
+ *                        Default value: "simple"
+ *
+ * @option Object headers (optional)      An array containing the forces sorting rules.
+ *                        This option let's you specify a default sorting rule.
+ *                        Default value: null
+ *
+ * @option Array sortList (optional)      An array containing the forces sorting rules.
+ *                        This option let's you specify a default sorting rule.
+ *                        Default value: null
+ *
+ * @option Array sortForce (optional)      An array containing forced sorting rules.
+ *                        This option let's you specify a default sorting rule, which is prepended to user-selected rules.
+ *                        Default value: null
+ *
+ * @option Array sortAppend (optional)      An array containing forced sorting rules.
+ *                        This option let's you specify a default sorting rule, which is appended to user-selected rules.
+ *                        Default value: null
+ *
+ * @option Boolean widthFixed (optional)    Boolean flag indicating if tablesorter should apply fixed widths to the table columns.
+ *                        This is usefull when using the pager companion plugin.
+ *                        This options requires the dimension jquery plugin.
+ *                        Default value: false
+ *
+ * @option Boolean cancelSelection (optional)  Boolean flag indicating if tablesorter should cancel selection of the table headers text.
+ *                        Default value: true
+ *
+ * @option Boolean debug (optional)      Boolean flag indicating if tablesorter should display debuging information usefull for development.
  *
  * @type jQuery
  *
  * @name tablesorter
- * 
+ *
  * @cat Plugins/Tablesorter
- * 
+ *
  * @author Christian Bach/christian.bach@polyester.se
  */
 
-(function($) {
-	$.extend({
-		tablesorter: new function() {
-			
-			var parsers = [], widgets = [];
-			
-			this.defaults = {
-				cssHeader: "header",
-				cssAsc: "headerSortUp",
-				cssDesc: "headerSortDown",
-				sortInitialOrder: "asc",
-				sortMultiSortKey: "shiftKey",
-				sortForce: null,
-				sortAppend: null,
-				textExtraction: "simple",
-				parsers: {}, 
-				widgets: [],		
-				widgetZebra: {css: ["even","odd"]},
-				headers: {},
-				widthFixed: false,
-				cancelSelection: true,
-				sortList: [],
-				headerList: [],
-				dateFormat: "us",
-				decimal: '.',
-				debug: false
-			};
-			
-			/* debuging utils */
-			function benchmark(s,d) {
-				log(s + "," + (new Date().getTime() - d.getTime()) + "ms");
-			}
-			
-			this.benchmark = benchmark;
-			
-			function log(s) {
-				if (typeof console != "undefined" && typeof console.debug != "undefined") {
-					console.log(s);
-				} else {
-					alert(s);
-				}
-			}
-						
-			/* parsers utils */
-			function buildParserCache(table,$headers) {
-				
-				if(table.config.debug) { var parsersDebug = ""; }
-				
-				var rows = table.tBodies[0].rows;
-				
-				if(table.tBodies[0].rows[0]) {
-
-					var list = [], cells = rows[0].cells, l = cells.length;
-					
-					for (var i=0;i < l; i++) {
-						var p = false;
-						
-						if($.metadata && ($($headers[i]).metadata() && $($headers[i]).metadata().sorter)  ) {
-						
-							p = getParserById($($headers[i]).metadata().sorter);	
-						
-						} else if((table.config.headers[i] && table.config.headers[i].sorter)) {
-	
-							p = getParserById(table.config.headers[i].sorter);
-						}
-						if(!p) {
-							p = detectParserForColumn(table,cells[i]);
-						}
-	
-						if(table.config.debug) { parsersDebug += "column:" + i + " parser:" +p.id + "\n"; }
-	
-						list.push(p);
-					}
-				}
-				
-				if(table.config.debug) { log(parsersDebug); }
-
-				return list;
-			};
-			
-			function detectParserForColumn(table,node) {
-				var l = parsers.length;
-				for(var i=1; i < l; i++) {
-					if(parsers[i].is($.trim(getElementText(table.config,node)),table,node)) {
-						return parsers[i];
-					}
-				}
-				// 0 is always the generic parser (text)
-				return parsers[0];
-			}
-			
-			function getParserById(name) {
-				var l = parsers.length;
-				for(var i=0; i < l; i++) {
-					if(parsers[i].id.toLowerCase() == name.toLowerCase()) {	
-						return parsers[i];
-					}
-				}
-				return false;
-			}
-			
-			/* utils */
-			function buildCache(table) {
-				
-				if(table.config.debug) { var cacheTime = new Date(); }
-				
-				
-				var totalRows = (table.tBodies[0] && table.tBodies[0].rows.length) || 0,
-					totalCells = (table.tBodies[0].rows[0] && table.tBodies[0].rows[0].cells.length) || 0,
-					parsers = table.config.parsers, 
-					cache = {row: [], normalized: []};
-				
-					for (var i=0;i < totalRows; ++i) {
-					
-						/** Add the table data to main data array */
-						var c = table.tBodies[0].rows[i], cols = [];
-					
-						cache.row.push($(c));
-						
-						for(var j=0; j < totalCells; ++j) {
-							cols.push(parsers[j].format(getElementText(table.config,c.cells[j]),table,c.cells[j]));	
-						}
-												
-						cols.push(i); // add position for rowCache
-						cache.normalized.push(cols);
-						cols = null;
-					};
-				
-				if(table.config.debug) { benchmark("Building cache for " + totalRows + " rows:", cacheTime); }
-				
-				return cache;
-			};
-			
-			function getElementText(config,node) {
-				
-				if(!node) return "";
-								
-				var t = "";
-				
-				if(config.textExtraction == "simple") {
-					if(node.childNodes[0] && node.childNodes[0].hasChildNodes()) {
-						t = node.childNodes[0].innerHTML;
-					} else {
-						t = node.innerHTML;
-					}
-				} else {
-					if(typeof(config.textExtraction) == "function") {
-						t = config.textExtraction(node);
-					} else { 
-						t = $(node).text();
-					}	
-				}
-				return t;
-			}
-			
-			function appendToTable(table,cache) {
-				
-				if(table.config.debug) {var appendTime = new Date()}
-				
-				var c = cache, 
-					r = c.row, 
-					n= c.normalized, 
-					totalRows = n.length, 
-					checkCell = (n[0].length-1), 
-					tableBody = $(table.tBodies[0]),
-					rows = [];
-				
-				for (var i=0;i < totalRows; i++) {
-					rows.push(r[n[i][checkCell]]);	
-					if(!table.config.appender) {
-						
-						var o = r[n[i][checkCell]];
-						var l = o.length;
-						for(var j=0; j < l; j++) {
-							
-							tableBody[0].appendChild(o[j]);
-						
-						}
-						
-						//tableBody.append(r[n[i][checkCell]]);
-					}
-				}	
-				
-				if(table.config.appender) {
-				
-					table.config.appender(table,rows);	
-				}
-				
-				rows = null;
-				
-				if(table.config.debug) { benchmark("Rebuilt table:", appendTime); }
-								
-				//apply table widgets
-				applyWidget(table);
-				
-				// trigger sortend
-				setTimeout(function() {
-					$(table).trigger("sortEnd");	
-				},0);
-				
-			};
-			
-			function buildHeaders(table) {
-				
-				if(table.config.debug) { var time = new Date(); }
-				
-				var meta = ($.metadata) ? true : false, tableHeadersRows = [];
-			
-				for(var i = 0; i < table.tHead.rows.length; i++) { tableHeadersRows[i]=0; };
-				
-				$tableHeaders = $("thead th",table);
-		
-				$tableHeaders.each(function(index) {
-							
-					this.count = 0;
-					this.column = index;
-					this.order = formatSortingOrder(table.config.sortInitialOrder);
-					
-					if(checkHeaderMetadata(this) || checkHeaderOptions(table,index)) this.sortDisabled = true;
-					
-					if(!this.sortDisabled) {
-						$(this).addClass(table.config.cssHeader);
-					}
-					
-					// add cell to headerList
-					table.config.headerList[index]= this;
-				});
-				
-				if(table.config.debug) { benchmark("Built headers:", time); log($tableHeaders); }
-				
-				return $tableHeaders;
-				
-			};
-						
-		   	function checkCellColSpan(table, rows, row) {
-                var arr = [], r = table.tHead.rows, c = r[row].cells;
-				
-				for(var i=0; i < c.length; i++) {
-					var cell = c[i];
-					
-					if ( cell.colSpan > 1) { 
-						arr = arr.concat(checkCellColSpan(table, headerArr,row++));
-					} else  {
-						if(table.tHead.length == 1 || (cell.rowSpan > 1 || !r[row+1])) {
-							arr.push(cell);
-						}
-						//headerArr[row] = (i+row);
-					}
-				}
-				return arr;
-			};
-			
-			function checkHeaderMetadata(cell) {
-				if(($.metadata) && ($(cell).metadata().sorter === false)) { return true; };
-				return false;
-			}
-			
-			function checkHeaderOptions(table,i) {	
-				if((table.config.headers[i]) && (table.config.headers[i].sorter === false)) { return true; };
-				return false;
-			}
-			
-			function applyWidget(table) {
-				var c = table.config.widgets;
-				var l = c.length;
-				for(var i=0; i < l; i++) {
-					
-					getWidgetById(c[i]).format(table);
-				}
-				
-			}
-			
-			function getWidgetById(name) {
-				var l = widgets.length;
-				for(var i=0; i < l; i++) {
-					if(widgets[i].id.toLowerCase() == name.toLowerCase() ) {
-						return widgets[i]; 
-					}
-				}
-			};
-			
-			function formatSortingOrder(v) {
-				
-				if(typeof(v) != "Number") {
-					i = (v.toLowerCase() == "desc") ? 1 : 0;
-				} else {
-					i = (v == (0 || 1)) ? v : 0;
-				}
-				return i;
-			}
-			
-			function isValueInArray(v, a) {
-				var l = a.length;
-				for(var i=0; i < l; i++) {
-					if(a[i][0] == v) {
-						return true;	
-					}
-				}
-				return false;
-			}
-				
-			function setHeadersCss(table,$headers, list, css) {
-				// remove all header information
-				$headers.removeClass(css[0]).removeClass(css[1]);
-				
-				var h = [];
-				$headers.each(function(offset) {
-						if(!this.sortDisabled) {
-							h[this.column] = $(this);					
-						}
-				});
-				
-				var l = list.length; 
-				for(var i=0; i < l; i++) {
-					h[list[i][0]].addClass(css[list[i][1]]);
-				}
-			}
-			
-			function fixColumnWidth(table,$headers) {
-				var c = table.config;
-				if(c.widthFixed) {
-					var colgroup = $('<colgroup>');
-					$("tr:first td",table.tBodies[0]).each(function() {
-						colgroup.append($('<col>').css('width',$(this).width()));
-					});
-					$(table).prepend(colgroup);
-				};
-			}
-			
-			function updateHeaderSortCount(table,sortList) {
-				var c = table.config, l = sortList.length;
-				for(var i=0; i < l; i++) {
-					var s = sortList[i];
-					var o = c.headerList[s[0]];
-					o.count = s[1];
-					o.count++;
-				}
-			}
-			
-			/* sorting methods */
-			function multisort(table,sortList,cache) {
-				
-				if(table.config.debug) { var sortTime = new Date(); }
-				
-				var dynamicExp = "var sortWrapper = function(a,b) {", l = sortList.length;
-					
-				for(var i=0; i < l; i++) {
-					
-					var c = sortList[i][0];
-					var order = sortList[i][1];
-					var s = (getCachedSortType(table.config.parsers,c) == "text") ? ((order == 0) ? "sortText" : "sortTextDesc") : ((order == 0) ? "sortNumeric" : "sortNumericDesc");
-					
-					var e = "e" + i;
-					
-					dynamicExp += "var " + e + " = " + s + "(a[" + c + "],b[" + c + "]); ";
-					dynamicExp += "if(" + e + ") { return " + e + "; } ";
-					dynamicExp += "else { ";
-				}
-				
-				// if value is the same keep orignal order	
-				var orgOrderCol = cache.normalized[0].length - 1;
-				dynamicExp += "return a[" + orgOrderCol + "]-b[" + orgOrderCol + "];";
-						
-				for(var i=0; i < l; i++) {
-					dynamicExp += "}; ";
-				}
-				
-				dynamicExp += "return 0; ";	
-				dynamicExp += "}; ";	
-				
-				eval(dynamicExp);
-				
-				cache.normalized.sort(sortWrapper);
-				
-				if(table.config.debug) { benchmark("Sorting on " + sortList.toString() + " and dir " + order+ " time:", sortTime); }
-				
-				return cache;
-			};
-			
-			function sortText(a,b) {
-				return ((a < b) ? -1 : ((a > b) ? 1 : 0));
-			};
-			
-			function sortTextDesc(a,b) {
-				return ((b < a) ? -1 : ((b > a) ? 1 : 0));
-			};	
-			
-	 		function sortNumeric(a,b) {
-				return a-b;
-			};
-			
-			function sortNumericDesc(a,b) {
-				return b-a;
-			};
-			
-			function getCachedSortType(parsers,i) {
-				return parsers[i].type;
-			};
-			
-			/* public methods */
-			this.construct = function(settings) {
-
-				return this.each(function() {
-					
-					if(!this.tHead || !this.tBodies) return;
-					
-					var $this, $document,$headers, cache, config, shiftDown = 0, sortOrder;
-					
-					this.config = {};
-					
-					config = $.extend(this.config, $.tablesorter.defaults, settings);
-					
-					// store common expression for speed					
-					$this = $(this);
-					
-					// build headers
-					$headers = buildHeaders(this);
-					
-					// try to auto detect column type, and store in tables config
-					this.config.parsers = buildParserCache(this,$headers);
-					
-					
-					// build the cache for the tbody cells
-					cache = buildCache(this);
-					
-					// get the css class names, could be done else where.
-					var sortCSS = [config.cssDesc,config.cssAsc];
-					
-					// fixate columns if the users supplies the fixedWidth option
-					fixColumnWidth(this);
-					
-					// apply event handling to headers
-					// this is to big, perhaps break it out?
-					$headers.click(function(e) {
-						
-						$this.trigger("sortStart");
-						
-						var totalRows = ($this[0].tBodies[0] && $this[0].tBodies[0].rows.length) || 0;
-						
-						if(!this.sortDisabled && totalRows > 0) {
-							
-							
-							// store exp, for speed
-							var $cell = $(this);
-	
-							// get current column index
-							var i = this.column;
-							
-							// get current column sort order
-							this.order = this.count++ % 2;
-							
-							// user only whants to sort on one column
-							if(!e[config.sortMultiSortKey]) {
-								
-								// flush the sort list
-								config.sortList = [];
-								
-								if(config.sortForce != null) {
-									var a = config.sortForce; 
-									for(var j=0; j < a.length; j++) {
-										if(a[j][0] != i) {
-											config.sortList.push(a[j]);
-										}
-									}
-								}
-								
-								// add column to sort list
-								config.sortList.push([i,this.order]);
-							
-							// multi column sorting
-							} else {
-								// the user has clicked on an all ready sortet column.
-								if(isValueInArray(i,config.sortList)) {	 
-									
-									// revers the sorting direction for all tables.
-									for(var j=0; j < config.sortList.length; j++) {
-										var s = config.sortList[j], o = config.headerList[s[0]];
-										if(s[0] == i) {
-											o.count = s[1];
-											o.count++;
-											s[1] = o.count % 2;
-										}
-									}	
-								} else {
-									// add column to sort list array
-									config.sortList.push([i,this.order]);
-								}
-							};
-							setTimeout(function() {
-								//set css for headers
-								setHeadersCss($this[0],$headers,config.sortList,sortCSS);
-								appendToTable($this[0],multisort($this[0],config.sortList,cache));
-							},1);
-							// stop normal event by returning false
-							return false;
-						}
-					// cancel selection	
-					}).mousedown(function() {
-						if(config.cancelSelection) {
-							this.onselectstart = function() {return false};
-							return false;
-						}
-					});
-					
-					// apply easy methods that trigger binded events
-					$this.bind("update",function() {
-						
-						// rebuild parsers.
-						this.config.parsers = buildParserCache(this,$headers);
-						
-						// rebuild the cache map
-						cache = buildCache(this);
-						
-					}).bind("sorton",function(e,list) {
-						
-						$(this).trigger("sortStart");
-						
-						config.sortList = list;
-						
-						// update and store the sortlist
-						var sortList = config.sortList;
-						
-						// update header count index
-						updateHeaderSortCount(this,sortList);
-						
-						//set css for headers
-						setHeadersCss(this,$headers,sortList,sortCSS);
-						
-						
-						// sort the table and append it to the dom
-						appendToTable(this,multisort(this,sortList,cache));
-
-					}).bind("appendCache",function() {
-						
-						appendToTable(this,cache);
-					
-					}).bind("applyWidgetId",function(e,id) {
-						
-						getWidgetById(id).format(this);
-						
-					}).bind("applyWidgets",function() {
-						// apply widgets
-						applyWidget(this);
-					});
-					
-					if($.metadata && ($(this).metadata() && $(this).metadata().sortlist)) {
-						config.sortList = $(this).metadata().sortlist;
-					}
-					// if user has supplied a sort list to constructor.
-					if(config.sortList.length > 0) {
-						$this.trigger("sorton",[config.sortList]);	
-					}
-					
-					// apply widgets
-					applyWidget(this);
-				});
-			};
-			
-			this.addParser = function(parser) {
-				var l = parsers.length, a = true;
-				for(var i=0; i < l; i++) {
-					if(parsers[i].id.toLowerCase() == parser.id.toLowerCase()) {
-						a = false;
-					}
-				}
-				if(a) { parsers.push(parser); };
-			};
-			
-			this.addWidget = function(widget) {
-				widgets.push(widget);
-			};
-			
-			this.formatFloat = function(s) {
-				var i = parseFloat(s);
-				return (isNaN(i)) ? 0 : i;
-			};
-			this.formatInt = function(s) {
-				var i = parseInt(s);
-				return (isNaN(i)) ? 0 : i;
-			};
-			
-			this.isDigit = function(s,config) {
-				var DECIMAL = '\\' + config.decimal;
-				var exp = '/(^[+]?0(' + DECIMAL +'0+)?$)|(^([-+]?[1-9][0-9]*)$)|(^([-+]?((0?|[1-9][0-9]*)' + DECIMAL +'(0*[1-9][0-9]*)))$)|(^[-+]?[1-9]+[0-9]*' + DECIMAL +'0+$)/';
-				return RegExp(exp).test($.trim(s));
-			};
-			
-			this.clearTableBody = function(table) {
-				if($.browser.msie) {
-					function empty() {
-						while ( this.firstChild ) this.removeChild( this.firstChild );
-					}
-					empty.apply(table.tBodies[0]);
-				} else {
-					table.tBodies[0].innerHTML = "";
-				}
-			};
-		}
-	});
-	
-	// extend plugin scope
-	$.fn.extend({
-        tablesorter: $.tablesorter.construct
-	});
-	
-	var ts = $.tablesorter;
-	
-	// add default parsers
-	ts.addParser({
-		id: "text",
-		is: function(s) {
-			return true;
-		},
-		format: function(s) {
-			return $.trim(s.toLowerCase());
-		},
-		type: "text"
-	});
-	
-	ts.addParser({
-		id: "digit",
-		is: function(s,table) {
-			var c = table.config;
-			return $.tablesorter.isDigit(s,c);
-		},
-		format: function(s) {
-			return $.tablesorter.formatFloat(s);
-		},
-		type: "numeric"
-	});
-	
-	ts.addParser({
-		id: "currency",
-		is: function(s) {
-			return /^[£$€?.]/.test(s);
-		},
-		format: function(s) {
-			return $.tablesorter.formatFloat(s.replace(new RegExp(/[^0-9.]/g),""));
-		},
-		type: "numeric"
-	});
-	
-	ts.addParser({
-		id: "ipAddress",
-		is: function(s) {
-			return /^\d{2,3}[\.]\d{2,3}[\.]\d{2,3}[\.]\d{2,3}$/.test(s);
-		},
-		format: function(s) {
-			var a = s.split("."), r = "", l = a.length;
-			for(var i = 0; i < l; i++) {
-				var item = a[i];
-			   	if(item.length == 2) {
-					r += "0" + item;
-			   	} else {
-					r += item;
-			   	}
-			}
-			return $.tablesorter.formatFloat(r);
-		},
-		type: "numeric"
-	});
-	
-	ts.addParser({
-		id: "url",
-		is: function(s) {
-			return /^(https?|ftp|file):\/\/$/.test(s);
-		},
-		format: function(s) {
-			return jQuery.trim(s.replace(new RegExp(/(https?|ftp|file):\/\//),''));
-		},
-		type: "text"
-	});
-	
-	ts.addParser({
-		id: "isoDate",
-		is: function(s) {
-			return /^\d{4}[\/-]\d{1,2}[\/-]\d{1,2}$/.test(s);
-		},
-		format: function(s) {
-			return $.tablesorter.formatFloat((s != "") ? new Date(s.replace(new RegExp(/-/g),"/")).getTime() : "0");
-		},
-		type: "numeric"
-	});
-		
-	ts.addParser({
-		id: "percent",
-		is: function(s) { 
-			return /\%$/.test($.trim(s));
-		},
-		format: function(s) {
-			return $.tablesorter.formatFloat(s.replace(new RegExp(/%/g),""));
-		},
-		type: "numeric"
-	});
-
-	ts.addParser({
-		id: "usLongDate",
-		is: function(s) {
-			return s.match(new RegExp(/^[A-Za-z]{3,10}\.? [0-9]{1,2}, ([0-9]{4}|'?[0-9]{2}) (([0-2]?[0-9]:[0-5][0-9])|([0-1]?[0-9]:[0-5][0-9]\s(AM|PM)))$/));
-		},
-		format: function(s) {
-			return $.tablesorter.formatFloat(new Date(s).getTime());
-		},
-		type: "numeric"
-	});
-
-	ts.addParser({
-		id: "shortDate",
-		is: function(s) {
-			return /\d{1,2}[\/\-]\d{1,2}[\/\-]\d{2,4}/.test(s);
-		},
-		format: function(s,table) {
-			var c = table.config;
-			s = s.replace(/\-/g,"/");
-			if(c.dateFormat == "us") {
-				// reformat the string in ISO format
-				s = s.replace(/(\d{1,2})[\/\-](\d{1,2})[\/\-](\d{4})/, "$3/$1/$2");
-			} else if(c.dateFormat == "uk") {
-				//reformat the string in ISO format
-				s = s.replace(/(\d{1,2})[\/\-](\d{1,2})[\/\-](\d{4})/, "$3/$2/$1");
-			} else if(c.dateFormat == "dd/mm/yy" || c.dateFormat == "dd-mm-yy") {
-				s = s.replace(/(\d{1,2})[\/\-](\d{1,2})[\/\-](\d{2})/, "$1/$2/$3");	
-			}
-			return $.tablesorter.formatFloat(new Date(s).getTime());
-		},
-		type: "numeric"
-	});
-
-	ts.addParser({
-	    id: "time",
-	    is: function(s) {
-	        return /^(([0-2]?[0-9]:[0-5][0-9])|([0-1]?[0-9]:[0-5][0-9]\s(am|pm)))$/.test(s);
-	    },
-	    format: function(s) {
-	        return $.tablesorter.formatFloat(new Date("2000/01/01 " + s).getTime());
-	    },
-	  type: "numeric"
-	});
-	
-	
-	ts.addParser({
-	    id: "metadata",
-	    is: function(s) {
-	        return false;
-	    },
-	    format: function(s,table,cell) {
-			var c = table.config, p = (!c.parserMetadataName) ? 'sortValue' : c.parserMetadataName;
-	        return $(cell).metadata()[p];
-	    },
-	  type: "numeric"
-	});
-	
-	// add default widgets
-	ts.addWidget({
-		id: "zebra",
-		format: function(table) {
-			if(table.config.debug) { var time = new Date(); }
-			$("tr:visible",table.tBodies[0])
-	        .filter(':even')
-	        .removeClass(table.config.widgetZebra.css[1]).addClass(table.config.widgetZebra.css[0])
-	        .end().filter(':odd')
-	        .removeClass(table.config.widgetZebra.css[0]).addClass(table.config.widgetZebra.css[1]);
-			if(table.config.debug) { $.tablesorter.benchmark("Applying Zebra widget", time); }
-		}
-	});	
-})(jQuery);
\ No newline at end of file
+(function ($) {
+  $.extend({
+    tablesorter: new function () {
+
+      var parsers = [], widgets = [];
+
+      this.defaults = {
+        cssHeader: "header",
+        cssAsc: "headerSortUp",
+        cssDesc: "headerSortDown",
+        sortInitialOrder: "asc",
+        sortMultiSortKey: "shiftKey",
+        sortForce: null,
+        sortAppend: null,
+        textExtraction: "simple",
+        parsers: {},
+        widgets: [],
+        widgetZebra: {css: ["even", "odd"]},
+        headers: {},
+        widthFixed: false,
+        cancelSelection: true,
+        sortList: [],
+        headerList: [],
+        dateFormat: "us",
+        decimal: '.',
+        debug: false
+      };
+
+      /* debuging utils */
+      function benchmark(s, d) {
+        log(s + "," + (new Date().getTime() - d.getTime()) + "ms");
+      }
+
+      this.benchmark = benchmark;
+
+      function log(s) {
+        if (typeof console != "undefined" && typeof console.debug
+            != "undefined") {
+          console.log(s);
+        } else {
+          alert(s);
+        }
+      }
+
+      /* parsers utils */
+      function buildParserCache(table, $headers) {
+
+        if (table.config.debug) {
+          var parsersDebug = "";
+        }
+
+        var rows = table.tBodies[0].rows;
+
+        if (table.tBodies[0].rows[0]) {
+
+          var list = [], cells = rows[0].cells, l = cells.length;
+
+          for (var i = 0; i < l; i++) {
+            var p = false;
+
+            if ($.metadata && ($($headers[i]).metadata() && $(
+                    $headers[i]).metadata().sorter)) {
+
+              p = getParserById($($headers[i]).metadata().sorter);
+
+            } else if ((table.config.headers[i]
+                    && table.config.headers[i].sorter)) {
+
+              p = getParserById(table.config.headers[i].sorter);
+            }
+            if (!p) {
+              p = detectParserForColumn(table, cells[i]);
+            }
+
+            if (table.config.debug) {
+              parsersDebug += "column:" + i + " parser:" + p.id + "\n";
+            }
+
+            list.push(p);
+          }
+        }
+
+        if (table.config.debug) {
+          log(parsersDebug);
+        }
+
+        return list;
+      };
+
+      function detectParserForColumn(table, node) {
+        var l = parsers.length;
+        for (var i = 1; i < l; i++) {
+          if (parsers[i].is($.trim(getElementText(table.config, node)), table,
+                  node)) {
+            return parsers[i];
+          }
+        }
+        // 0 is always the generic parser (text)
+        return parsers[0];
+      }
+
+      function getParserById(name) {
+        var l = parsers.length;
+        for (var i = 0; i < l; i++) {
+          if (parsers[i].id.toLowerCase() == name.toLowerCase()) {
+            return parsers[i];
+          }
+        }
+        return false;
+      }
+
+      /* utils */
+      function buildCache(table) {
+
+        if (table.config.debug) {
+          var cacheTime = new Date();
+        }
+
+        var totalRows = (table.tBodies[0] && table.tBodies[0].rows.length) || 0,
+            totalCells = (table.tBodies[0].rows[0]
+                && table.tBodies[0].rows[0].cells.length) || 0,
+            parsers = table.config.parsers,
+            cache = {row: [], normalized: []};
+
+        for (var i = 0; i < totalRows; ++i) {
+
+          /** Add the table data to main data array */
+          var c = table.tBodies[0].rows[i], cols = [];
+
+          cache.row.push($(c));
+
+          for (var j = 0; j < totalCells; ++j) {
+            cols.push(
+                parsers[j].format(getElementText(table.config, c.cells[j]),
+                    table, c.cells[j]));
+          }
+
+          cols.push(i); // add position for rowCache
+          cache.normalized.push(cols);
+          cols = null;
+        }
+        ;
+
+        if (table.config.debug) {
+          benchmark("Building cache for " + totalRows + " rows:", cacheTime);
+        }
+
+        return cache;
+      };
+
+      function getElementText(config, node) {
+
+        if (!node) {
+          return "";
+        }
+
+        var t = "";
+
+        if (config.textExtraction == "simple") {
+          if (node.childNodes[0] && node.childNodes[0].hasChildNodes()) {
+            t = node.childNodes[0].innerHTML;
+          } else {
+            t = node.innerHTML;
+          }
+        } else {
+          if (typeof(config.textExtraction) == "function") {
+            t = config.textExtraction(node);
+          } else {
+            t = $(node).text();
+          }
+        }
+        return t;
+      }
+
+      function appendToTable(table, cache) {
+
+        if (table.config.debug) {
+          var appendTime = new Date()
+        }
+
+        var c = cache,
+            r = c.row,
+            n = c.normalized,
+            totalRows = n.length,
+            checkCell = (n[0].length - 1),
+            tableBody = $(table.tBodies[0]),
+            rows = [];
+
+        for (var i = 0; i < totalRows; i++) {
+          rows.push(r[n[i][checkCell]]);
+          if (!table.config.appender) {
+
+            var o = r[n[i][checkCell]];
+            var l = o.length;
+            for (var j = 0; j < l; j++) {
+
+              tableBody[0].appendChild(o[j]);
+
+            }
+
+            //tableBody.append(r[n[i][checkCell]]);
+          }
+        }
+
+        if (table.config.appender) {
+
+          table.config.appender(table, rows);
+        }
+
+        rows = null;
+
+        if (table.config.debug) {
+          benchmark("Rebuilt table:", appendTime);
+        }
+
+        //apply table widgets
+        applyWidget(table);
+
+        // trigger sortend
+        setTimeout(function () {
+          $(table).trigger("sortEnd");
+        }, 0);
+
+      };
+
+      function buildHeaders(table) {
+
+        if (table.config.debug) {
+          var time = new Date();
+        }
+
+        var meta = ($.metadata) ? true : false, tableHeadersRows = [];
+
+        for (var i = 0; i < table.tHead.rows.length; i++) {
+          tableHeadersRows[i] = 0;
+        }
+        ;
+
+        $tableHeaders = $("thead th", table);
+
+        $tableHeaders.each(function (index) {
+
+          this.count = 0;
+          this.column = index;
+          this.order = formatSortingOrder(table.config.sortInitialOrder);
+
+          if (checkHeaderMetadata(this) || checkHeaderOptions(table,
+                  index)) {
+            this.sortDisabled = true;
+          }
+
+          if (!this.sortDisabled) {
+            $(this).addClass(table.config.cssHeader);
+          }
+
+          // add cell to headerList
+          table.config.headerList[index] = this;
+        });
+
+        if (table.config.debug) {
+          benchmark("Built headers:", time);
+          log($tableHeaders);
+        }
+
+        return $tableHeaders;
+
+      };
+
+      function checkCellColSpan(table, rows, row) {
+        var arr = [], r = table.tHead.rows, c = r[row].cells;
+
+        for (var i = 0; i < c.length; i++) {
+          var cell = c[i];
+
+          if (cell.colSpan > 1) {
+            arr = arr.concat(checkCellColSpan(table, headerArr, row++));
+          } else {
+            if (table.tHead.length == 1 || (cell.rowSpan > 1 || !r[row + 1])) {
+              arr.push(cell);
+            }
+            //headerArr[row] = (i+row);
+          }
+        }
+        return arr;
+      };
+
+      function checkHeaderMetadata(cell) {
+        if (($.metadata) && ($(cell).metadata().sorter === false)) {
+          return true;
+        }
+        ;
+        return false;
+      }
+
+      function checkHeaderOptions(table, i) {
+        if ((table.config.headers[i]) && (table.config.headers[i].sorter
+                === false)) {
+          return true;
+        }
+        ;
+        return false;
+      }
+
+      function applyWidget(table) {
+        var c = table.config.widgets;
+        var l = c.length;
+        for (var i = 0; i < l; i++) {
+
+          getWidgetById(c[i]).format(table);
+        }
+
+      }
+
+      function getWidgetById(name) {
+        var l = widgets.length;
+        for (var i = 0; i < l; i++) {
+          if (widgets[i].id.toLowerCase() == name.toLowerCase()) {
+            return widgets[i];
+          }
+        }
+      };
+
+      function formatSortingOrder(v) {
+
+        if (typeof(v) != "Number") {
+          i = (v.toLowerCase() == "desc") ? 1 : 0;
+        } else {
+          i = (v == (0 || 1)) ? v : 0;
+        }
+        return i;
+      }
+
+      function isValueInArray(v, a) {
+        var l = a.length;
+        for (var i = 0; i < l; i++) {
+          if (a[i][0] == v) {
+            return true;
+          }
+        }
+        return false;
+      }
+
+      function setHeadersCss(table, $headers, list, css) {
+        // remove all header information
+        $headers.removeClass(css[0]).removeClass(css[1]);
+
+        var h = [];
+        $headers.each(function (offset) {
+          if (!this.sortDisabled) {
+            h[this.column] = $(this);
+          }
+        });
+
+        var l = list.length;
+        for (var i = 0; i < l; i++) {
+          h[list[i][0]].addClass(css[list[i][1]]);
+        }
+      }
+
+      function fixColumnWidth(table, $headers) {
+        var c = table.config;
+        if (c.widthFixed) {
+          var colgroup = $('<colgroup>');
+          $("tr:first td", table.tBodies[0]).each(function () {
+            colgroup.append($('<col>').css('width', $(this).width()));
+          });
+          $(table).prepend(colgroup);
+        }
+        ;
+      }
+
+      function updateHeaderSortCount(table, sortList) {
+        var c = table.config, l = sortList.length;
+        for (var i = 0; i < l; i++) {
+          var s = sortList[i];
+          var o = c.headerList[s[0]];
+          o.count = s[1];
+          o.count++;
+        }
+      }
+
+      /* sorting methods */
+      function multisort(table, sortList, cache) {
+
+        if (table.config.debug) {
+          var sortTime = new Date();
+        }
+
+        var dynamicExp = "var sortWrapper = function(a,b) {",
+            l = sortList.length;
+
+        for (var i = 0; i < l; i++) {
+
+          var c = sortList[i][0];
+          var order = sortList[i][1];
+          var s = (getCachedSortType(table.config.parsers, c) == "text")
+              ? ((order == 0) ? "sortText" : "sortTextDesc") : ((order == 0)
+                  ? "sortNumeric" : "sortNumericDesc");
+
+          var e = "e" + i;
+
+          dynamicExp += "var " + e + " = " + s + "(a[" + c + "],b[" + c
+              + "]); ";
+          dynamicExp += "if(" + e + ") { return " + e + "; } ";
+          dynamicExp += "else { ";
+        }
+
+        // if value is the same keep orignal order
+        var orgOrderCol = cache.normalized[0].length - 1;
+        dynamicExp += "return a[" + orgOrderCol + "]-b[" + orgOrderCol + "];";
+
+        for (var i = 0; i < l; i++) {
+          dynamicExp += "}; ";
+        }
+
+        dynamicExp += "return 0; ";
+        dynamicExp += "}; ";
+
+        eval(dynamicExp);
+
+        cache.normalized.sort(sortWrapper);
+
+        if (table.config.debug) {
+          benchmark("Sorting on " + sortList.toString() + " and dir " + order
+              + " time:", sortTime);
+        }
+
+        return cache;
+      };
+
+      function sortText(a, b) {
+        return ((a < b) ? -1 : ((a > b) ? 1 : 0));
+      };
+
+      function sortTextDesc(a, b) {
+        return ((b < a) ? -1 : ((b > a) ? 1 : 0));
+      };
+
+      function sortNumeric(a, b) {
+        return a - b;
+      };
+
+      function sortNumericDesc(a, b) {
+        return b - a;
+      };
+
+      function getCachedSortType(parsers, i) {
+        return parsers[i].type;
+      };
+
+      /* public methods */
+      this.construct = function (settings) {
+
+        return this.each(function () {
+
+          if (!this.tHead || !this.tBodies) {
+            return;
+          }
+
+          var $this, $document, $headers, cache, config, shiftDown = 0,
+              sortOrder;
+
+          this.config = {};
+
+          config = $.extend(this.config, $.tablesorter.defaults, settings);
+
+          // store common expression for speed
+          $this = $(this);
+
+          // build headers
+          $headers = buildHeaders(this);
+
+          // try to auto detect column type, and store in tables config
+          this.config.parsers = buildParserCache(this, $headers);
+
+          // build the cache for the tbody cells
+          cache = buildCache(this);
+
+          // get the css class names, could be done else where.
+          var sortCSS = [config.cssDesc, config.cssAsc];
+
+          // fixate columns if the users supplies the fixedWidth option
+          fixColumnWidth(this);
+
+          // apply event handling to headers
+          // this is to big, perhaps break it out?
+          $headers.click(function (e) {
+
+            $this.trigger("sortStart");
+
+            var totalRows = ($this[0].tBodies[0]
+                && $this[0].tBodies[0].rows.length) || 0;
+
+            if (!this.sortDisabled && totalRows > 0) {
+
+
+              // store exp, for speed
+              var $cell = $(this);
+
+              // get current column index
+              var i = this.column;
+
+              // get current column sort order
+              this.order = this.count++ % 2;
+
+              // user only whants to sort on one column
+              if (!e[config.sortMultiSortKey]) {
+
+                // flush the sort list
+                config.sortList = [];
+
+                if (config.sortForce != null) {
+                  var a = config.sortForce;
+                  for (var j = 0; j < a.length; j++) {
+                    if (a[j][0] != i) {
+                      config.sortList.push(a[j]);
+                    }
+                  }
+                }
+
+                // add column to sort list
+                config.sortList.push([i, this.order]);
+
+                // multi column sorting
+              } else {
+                // the user has clicked on an all ready sortet column.
+                if (isValueInArray(i, config.sortList)) {
+
+                  // revers the sorting direction for all tables.
+                  for (var j = 0; j < config.sortList.length; j++) {
+                    var s = config.sortList[j], o = config.headerList[s[0]];
+                    if (s[0] == i) {
+                      o.count = s[1];
+                      o.count++;
+                      s[1] = o.count % 2;
+                    }
+                  }
+                } else {
+                  // add column to sort list array
+                  config.sortList.push([i, this.order]);
+                }
+              }
+              ;
+              setTimeout(function () {
+                //set css for headers
+                setHeadersCss($this[0], $headers, config.sortList, sortCSS);
+                appendToTable($this[0],
+                    multisort($this[0], config.sortList, cache));
+              }, 1);
+              // stop normal event by returning false
+              return false;
+            }
+            // cancel selection
+          }).mousedown(function () {
+            if (config.cancelSelection) {
+              this.onselectstart = function () {
+                return false
+              };
+              return false;
+            }
+          });
+
+          // apply easy methods that trigger binded events
+          $this.bind("update", function () {
+
+            // rebuild parsers.
+            this.config.parsers = buildParserCache(this, $headers);
+
+            // rebuild the cache map
+            cache = buildCache(this);
+
+          }).bind("sorton", function (e, list) {
+
+            $(this).trigger("sortStart");
+
+            config.sortList = list;
+
+            // update and store the sortlist
+            var sortList = config.sortList;
+
+            // update header count index
+            updateHeaderSortCount(this, sortList);
+
+            //set css for headers
+            setHeadersCss(this, $headers, sortList, sortCSS);
+
+            // sort the table and append it to the dom
+            appendToTable(this, multisort(this, sortList, cache));
+
+          }).bind("appendCache", function () {
+
+            appendToTable(this, cache);
+
+          }).bind("applyWidgetId", function (e, id) {
+
+            getWidgetById(id).format(this);
+
+          }).bind("applyWidgets", function () {
+            // apply widgets
+            applyWidget(this);
+          });
+
+          if ($.metadata && ($(this).metadata() && $(
+                  this).metadata().sortlist)) {
+            config.sortList = $(this).metadata().sortlist;
+          }
+          // if user has supplied a sort list to constructor.
+          if (config.sortList.length > 0) {
+            $this.trigger("sorton", [config.sortList]);
+          }
+
+          // apply widgets
+          applyWidget(this);
+        });
+      };
+
+      this.addParser = function (parser) {
+        var l = parsers.length, a = true;
+        for (var i = 0; i < l; i++) {
+          if (parsers[i].id.toLowerCase() == parser.id.toLowerCase()) {
+            a = false;
+          }
+        }
+        if (a) {
+          parsers.push(parser);
+        }
+        ;
+      };
+
+      this.addWidget = function (widget) {
+        widgets.push(widget);
+      };
+
+      this.formatFloat = function (s) {
+        var i = parseFloat(s);
+        return (isNaN(i)) ? 0 : i;
+      };
+      this.formatInt = function (s) {
+        var i = parseInt(s);
+        return (isNaN(i)) ? 0 : i;
+      };
+
+      this.isDigit = function (s, config) {
+        var DECIMAL = '\\' + config.decimal;
+        var exp = '/(^[+]?0(' + DECIMAL
+            + '0+)?$)|(^([-+]?[1-9][0-9]*)$)|(^([-+]?((0?|[1-9][0-9]*)'
+            + DECIMAL + '(0*[1-9][0-9]*)))$)|(^[-+]?[1-9]+[0-9]*' + DECIMAL
+            + '0+$)/';
+        return RegExp(exp).test($.trim(s));
+      };
+
+      this.clearTableBody = function (table) {
+        if ($.browser.msie) {
+          function empty() {
+            while (this.firstChild) {
+              this.removeChild(this.firstChild);
+            }
+          }
+
+          empty.apply(table.tBodies[0]);
+        } else {
+          table.tBodies[0].innerHTML = "";
+        }
+      };
+    }
+  });
+
+  // extend plugin scope
+  $.fn.extend({
+    tablesorter: $.tablesorter.construct
+  });
+
+  var ts = $.tablesorter;
+
+  // add default parsers
+  ts.addParser({
+    id: "text",
+    is: function (s) {
+      return true;
+    },
+    format: function (s) {
+      return $.trim(s.toLowerCase());
+    },
+    type: "text"
+  });
+
+  ts.addParser({
+    id: "digit",
+    is: function (s, table) {
+      var c = table.config;
+      return $.tablesorter.isDigit(s, c);
+    },
+    format: function (s) {
+      return $.tablesorter.formatFloat(s);
+    },
+    type: "numeric"
+  });
+
+  ts.addParser({
+    id: "currency",
+    is: function (s) {
+      return /^[£$€?.]/.test(s);
+    },
+    format: function (s) {
+      return $.tablesorter.formatFloat(s.replace(new RegExp(/[^0-9.]/g), ""));
+    },
+    type: "numeric"
+  });
+
+  ts.addParser({
+    id: "ipAddress",
+    is: function (s) {
+      return /^\d{2,3}[\.]\d{2,3}[\.]\d{2,3}[\.]\d{2,3}$/.test(s);
+    },
+    format: function (s) {
+      var a = s.split("."), r = "", l = a.length;
+      for (var i = 0; i < l; i++) {
+        var item = a[i];
+        if (item.length == 2) {
+          r += "0" + item;
+        } else {
+          r += item;
+        }
+      }
+      return $.tablesorter.formatFloat(r);
+    },
+    type: "numeric"
+  });
+
+  ts.addParser({
+    id: "url",
+    is: function (s) {
+      return /^(https?|ftp|file):\/\/$/.test(s);
+    },
+    format: function (s) {
+      return jQuery.trim(s.replace(new RegExp(/(https?|ftp|file):\/\//), ''));
+    },
+    type: "text"
+  });
+
+  ts.addParser({
+    id: "isoDate",
+    is: function (s) {
+      return /^\d{4}[\/-]\d{1,2}[\/-]\d{1,2}$/.test(s);
+    },
+    format: function (s) {
+      return $.tablesorter.formatFloat(
+          (s != "") ? new Date(s.replace(new RegExp(/-/g), "/")).getTime()
+              : "0");
+    },
+    type: "numeric"
+  });
+
+  ts.addParser({
+    id: "percent",
+    is: function (s) {
+      return /\%$/.test($.trim(s));
+    },
+    format: function (s) {
+      return $.tablesorter.formatFloat(s.replace(new RegExp(/%/g), ""));
+    },
+    type: "numeric"
+  });
+
+  ts.addParser({
+    id: "usLongDate",
+    is: function (s) {
+      return s.match(new RegExp(
+          /^[A-Za-z]{3,10}\.? [0-9]{1,2}, ([0-9]{4}|'?[0-9]{2}) (([0-2]?[0-9]:[0-5][0-9])|([0-1]?[0-9]:[0-5][0-9]\s(AM|PM)))$/));
+    },
+    format: function (s) {
+      return $.tablesorter.formatFloat(new Date(s).getTime());
+    },
+    type: "numeric"
+  });
+
+  ts.addParser({
+    id: "shortDate",
+    is: function (s) {
+      return /\d{1,2}[\/\-]\d{1,2}[\/\-]\d{2,4}/.test(s);
+    },
+    format: function (s, table) {
+      var c = table.config;
+      s = s.replace(/\-/g, "/");
+      if (c.dateFormat == "us") {
+        // reformat the string in ISO format
+        s = s.replace(/(\d{1,2})[\/\-](\d{1,2})[\/\-](\d{4})/, "$3/$1/$2");
+      } else if (c.dateFormat == "uk") {
+        //reformat the string in ISO format
+        s = s.replace(/(\d{1,2})[\/\-](\d{1,2})[\/\-](\d{4})/, "$3/$2/$1");
+      } else if (c.dateFormat == "dd/mm/yy" || c.dateFormat == "dd-mm-yy") {
+        s = s.replace(/(\d{1,2})[\/\-](\d{1,2})[\/\-](\d{2})/, "$1/$2/$3");
+      }
+      return $.tablesorter.formatFloat(new Date(s).getTime());
+    },
+    type: "numeric"
+  });
+
+  ts.addParser({
+    id: "time",
+    is: function (s) {
+      return /^(([0-2]?[0-9]:[0-5][0-9])|([0-1]?[0-9]:[0-5][0-9]\s(am|pm)))$/.test(
+          s);
+    },
+    format: function (s) {
+      return $.tablesorter.formatFloat(new Date("2000/01/01 " + s).getTime());
+    },
+    type: "numeric"
+  });
+
+  ts.addParser({
+    id: "metadata",
+    is: function (s) {
+      return false;
+    },
+    format: function (s, table, cell) {
+      var c = table.config,
+          p = (!c.parserMetadataName) ? 'sortValue' : c.parserMetadataName;
+      return $(cell).metadata()[p];
+    },
+    type: "numeric"
+  });
+
+  // add default widgets
+  ts.addWidget({
+    id: "zebra",
+    format: function (table) {
+      if (table.config.debug) {
+        var time = new Date();
+      }
+      $("tr:visible", table.tBodies[0])
+      .filter(':even')
+      .removeClass(table.config.widgetZebra.css[1]).addClass(
+          table.config.widgetZebra.css[0])
+      .end().filter(':odd')
+      .removeClass(table.config.widgetZebra.css[0]).addClass(
+          table.config.widgetZebra.css[1]);
+      if (table.config.debug) {
+        $.tablesorter.benchmark("Applying Zebra widget", time);
+      }
+    }
+  });
+})(jQuery);
diff --git a/azkaban-web-server/src/web/js/jquery/jquery-1.9.1.js b/azkaban-web-server/src/web/js/jquery/jquery-1.9.1.js
index 8e4906d..a514ac4 100644
--- a/azkaban-web-server/src/web/js/jquery/jquery-1.9.1.js
+++ b/azkaban-web-server/src/web/js/jquery/jquery-1.9.1.js
@@ -11,975 +11,971 @@
  *
  * Date: 2013-2-4
  */
-(function( window, undefined ) {
+(function (window, undefined) {
 
 // Can't do this because several apps including ASP.NET trace
 // the stack via arguments.caller.callee and Firefox dies if
 // you try to trace through "use strict" call chains. (#13335)
 // Support: Firefox 18+
 //"use strict";
-var
-	// The deferred used on DOM ready
-	readyList,
-
-	// A central reference to the root jQuery(document)
-	rootjQuery,
-
-	// Support: IE<9
-	// For `typeof node.method` instead of `node.method !== undefined`
-	core_strundefined = typeof undefined,
-
-	// Use the correct document accordingly with window argument (sandbox)
-	document = window.document,
-	location = window.location,
-
-	// Map over jQuery in case of overwrite
-	_jQuery = window.jQuery,
-
-	// Map over the $ in case of overwrite
-	_$ = window.$,
-
-	// [[Class]] -> type pairs
-	class2type = {},
-
-	// List of deleted data cache ids, so we can reuse them
-	core_deletedIds = [],
-
-	core_version = "1.9.1",
-
-	// Save a reference to some core methods
-	core_concat = core_deletedIds.concat,
-	core_push = core_deletedIds.push,
-	core_slice = core_deletedIds.slice,
-	core_indexOf = core_deletedIds.indexOf,
-	core_toString = class2type.toString,
-	core_hasOwn = class2type.hasOwnProperty,
-	core_trim = core_version.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 splitting on whitespace
-	core_rnotwhite = /\S+/g,
-
-	// 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)
-	// Strict HTML recognition (#11290: must start with <)
-	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+(?:[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
-	completed = function( event ) {
-
-		// readyState === "complete" is good enough for us to call the dom ready in oldIE
-		if ( document.addEventListener || event.type === "load" || document.readyState === "complete" ) {
-			detach();
-			jQuery.ready();
-		}
-	},
-	// Clean-up method for dom ready events
-	detach = function() {
-		if ( document.addEventListener ) {
-			document.removeEventListener( "DOMContentLoaded", completed, false );
-			window.removeEventListener( "load", completed, false );
-
-		} else {
-			document.detachEvent( "onreadystatechange", completed );
-			window.detachEvent( "onload", completed );
-		}
-	};
-
-jQuery.fn = jQuery.prototype = {
-	// The current version of jQuery being used
-	jquery: core_version,
-
-	constructor: jQuery,
-	init: function( selector, context, rootjQuery ) {
-		var match, elem;
-
-		// HANDLE: $(""), $(null), $(undefined), $(false)
-		if ( !selector ) {
-			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;
-
-					// scripts is true for back-compat
-					jQuery.merge( this, jQuery.parseHTML(
-						match[1],
-						context && context.nodeType ? context.ownerDocument || context : document,
-						true
-					) );
-
-					// HANDLE: $(html, props)
-					if ( rsingleTag.test( match[1] ) && jQuery.isPlainObject( context ) ) {
-						for ( match in context ) {
-							// Properties of context are called as methods if possible
-							if ( jQuery.isFunction( this[ match ] ) ) {
-								this[ match ]( context[ match ] );
-
-							// ...and otherwise set as attributes
-							} else {
-								this.attr( match, context[ match ] );
-							}
-						}
-					}
-
-					return this;
-
-				// 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: $(DOMElement)
-		} else if ( selector.nodeType ) {
-			this.context = this[0] = selector;
-			this.length = 1;
-			return this;
-
-		// 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 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 ) {
-
-		// 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;
-
-		// 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;
-	},
-
-	slice: function() {
-		return this.pushStack( core_slice.apply( this, arguments ) );
-	},
-
-	first: function() {
-		return this.eq( 0 );
-	},
-
-	last: function() {
-		return this.eq( -1 );
-	},
-
-	eq: function( i ) {
-		var len = this.length,
-			j = +i + ( i < 0 ? len : 0 );
-		return this.pushStack( j >= 0 && j < len ? [ this[j] ] : [] );
-	},
-
-	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
-};
+  var
+      // The deferred used on DOM ready
+      readyList,
+
+      // A central reference to the root jQuery(document)
+      rootjQuery,
+
+      // Support: IE<9
+      // For `typeof node.method` instead of `node.method !== undefined`
+      core_strundefined = typeof undefined,
+
+      // Use the correct document accordingly with window argument (sandbox)
+      document = window.document,
+      location = window.location,
+
+      // Map over jQuery in case of overwrite
+      _jQuery = window.jQuery,
+
+      // Map over the $ in case of overwrite
+      _$ = window.$,
+
+      // [[Class]] -> type pairs
+      class2type = {},
+
+      // List of deleted data cache ids, so we can reuse them
+      core_deletedIds = [],
+
+      core_version = "1.9.1",
+
+      // Save a reference to some core methods
+      core_concat = core_deletedIds.concat,
+      core_push = core_deletedIds.push,
+      core_slice = core_deletedIds.slice,
+      core_indexOf = core_deletedIds.indexOf,
+      core_toString = class2type.toString,
+      core_hasOwn = class2type.hasOwnProperty,
+      core_trim = core_version.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 splitting on whitespace
+      core_rnotwhite = /\S+/g,
+
+      // 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)
+      // Strict HTML recognition (#11290: must start with <)
+      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+(?:[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
+      completed = function (event) {
+
+        // readyState === "complete" is good enough for us to call the dom ready in oldIE
+        if (document.addEventListener || event.type === "load"
+            || document.readyState === "complete") {
+          detach();
+          jQuery.ready();
+        }
+      },
+      // Clean-up method for dom ready events
+      detach = function () {
+        if (document.addEventListener) {
+          document.removeEventListener("DOMContentLoaded", completed, false);
+          window.removeEventListener("load", completed, false);
+
+        } else {
+          document.detachEvent("onreadystatechange", completed);
+          window.detachEvent("onload", completed);
+        }
+      };
+
+  jQuery.fn = jQuery.prototype = {
+    // The current version of jQuery being used
+    jquery: core_version,
+
+    constructor: jQuery,
+    init: function (selector, context, rootjQuery) {
+      var match, elem;
+
+      // HANDLE: $(""), $(null), $(undefined), $(false)
+      if (!selector) {
+        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;
+
+            // scripts is true for back-compat
+            jQuery.merge(this, jQuery.parseHTML(
+                match[1],
+                context && context.nodeType ? context.ownerDocument || context
+                    : document,
+                true
+            ));
+
+            // HANDLE: $(html, props)
+            if (rsingleTag.test(match[1]) && jQuery.isPlainObject(context)) {
+              for (match in context) {
+                // Properties of context are called as methods if possible
+                if (jQuery.isFunction(this[match])) {
+                  this[match](context[match]);
+
+                  // ...and otherwise set as attributes
+                } else {
+                  this.attr(match, context[match]);
+                }
+              }
+            }
+
+            return this;
+
+            // 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: $(DOMElement)
+      } else if (selector.nodeType) {
+        this.context = this[0] = selector;
+        this.length = 1;
+        return this;
+
+        // 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 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) {
+
+      // 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;
+
+      // 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;
+    },
+
+    slice: function () {
+      return this.pushStack(core_slice.apply(this, arguments));
+    },
+
+    first: function () {
+      return this.eq(0);
+    },
+
+    last: function () {
+      return this.eq(-1);
+    },
+
+    eq: function (i) {
+      var len = this.length,
+          j = +i + ( i < 0 ? len : 0 );
+      return this.pushStack(j >= 0 && j < len ? [this[j]] : []);
+    },
+
+    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 src, copyIsArray, copy, name, options, 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 );
-		}
-
-		// 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 ) {
-		if ( obj == null ) {
-			return String( obj );
-		}
-		return typeof obj === "object" || typeof obj === "function" ?
-			class2type[ core_toString.call(obj) ] || "object" :
-			typeof obj;
-	},
-
-	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
-	// keepScripts (optional): If true, will include scripts passed in the html string
-	parseHTML: function( data, context, keepScripts ) {
-		if ( !data || typeof data !== "string" ) {
-			return null;
-		}
-		if ( typeof context === "boolean" ) {
-			keepScripts = context;
-			context = false;
-		}
-		context = context || document;
-
-		var parsed = rsingleTag.exec( data ),
-			scripts = !keepScripts && [];
-
-		// Single tag
-		if ( parsed ) {
-			return [ context.createElement( parsed[1] ) ];
-		}
-
-		parsed = jQuery.buildFragment( [ data ], context, scripts );
-		if ( scripts ) {
-			jQuery( scripts ).remove();
-		}
-		return jQuery.merge( [], parsed.childNodes );
-	},
-
-	parseJSON: function( data ) {
-		// Attempt to parse using the native JSON parser first
-		if ( window.JSON && window.JSON.parse ) {
-			return window.JSON.parse( data );
-		}
-
-		if ( data === null ) {
-			return data;
-		}
-
-		if ( typeof data === "string" ) {
-
-			// Make sure leading/trailing whitespace is removed (IE can't handle it)
-			data = jQuery.trim( data );
-
-			if ( 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 && jQuery.trim( 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 value,
-			i = 0,
-			length = obj.length,
-			isArray = isArraylike( obj );
-
-		if ( args ) {
-			if ( isArray ) {
-				for ( ; i < length; i++ ) {
-					value = callback.apply( obj[ i ], args );
-
-					if ( value === false ) {
-						break;
-					}
-				}
-			} else {
-				for ( i in obj ) {
-					value = callback.apply( obj[ i ], args );
-
-					if ( value === false ) {
-						break;
-					}
-				}
-			}
-
-		// A special, fast, case for the most common use of each
-		} else {
-			if ( isArray ) {
-				for ( ; i < length; i++ ) {
-					value = callback.call( obj[ i ], i, obj[ i ] );
-
-					if ( value === false ) {
-						break;
-					}
-				}
-			} else {
-				for ( i in obj ) {
-					value = callback.call( obj[ i ], i, obj[ i ] );
-
-					if ( value === 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 ret = results || [];
-
-		if ( arr != null ) {
-			if ( isArraylike( Object(arr) ) ) {
-				jQuery.merge( ret,
-					typeof arr === "string" ?
-					[ arr ] : arr
-				);
-			} else {
-				core_push.call( 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,
-			i = 0,
-			length = elems.length,
-			isArray = isArraylike( elems ),
-			ret = [];
-
-		// 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 ( i in elems ) {
-				value = callback( elems[ i ], i, arg );
-
-				if ( value != null ) {
-					ret[ ret.length ] = value;
-				}
-			}
-		}
-
-		// Flatten any nested arrays
-		return core_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 args, proxy, tmp;
-
-		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 || this, 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, raw ) {
-		var i = 0,
-			length = elems.length,
-			bulk = key == null;
-
-		// Sets many values
-		if ( jQuery.type( key ) === "object" ) {
-			chainable = true;
-			for ( i in key ) {
-				jQuery.access( elems, fn, i, key[i], true, emptyGet, raw );
-			}
-
-		// Sets one value
-		} else if ( value !== undefined ) {
-			chainable = true;
-
-			if ( !jQuery.isFunction( value ) ) {
-				raw = true;
-			}
-
-			if ( bulk ) {
-				// Bulk operations run against the entire set
-				if ( raw ) {
-					fn.call( elems, value );
-					fn = null;
-
-				// ...except when executing function values
-				} else {
-					bulk = fn;
-					fn = function( elem, key, value ) {
-						return bulk.call( jQuery( elem ), value );
-					};
-				}
-			}
-
-			if ( fn ) {
-				for ( ; i < length; i++ ) {
-					fn( elems[i], key, raw ? value : value.call( elems[i], i, fn( elems[i], key ) ) );
-				}
-			}
-		}
-
-		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 );
-
-		// Standards-based browsers support DOMContentLoaded
-		} else if ( document.addEventListener ) {
-			// Use the handy event callback
-			document.addEventListener( "DOMContentLoaded", completed, false );
-
-			// A fallback to window.onload, that will always work
-			window.addEventListener( "load", completed, false );
-
-		// If IE event model is used
-		} else {
-			// Ensure firing before onload, maybe late but safe also for iframes
-			document.attachEvent( "onreadystatechange", completed );
-
-			// A fallback to window.onload, that will always work
-			window.attachEvent( "onload", completed );
-
-			// 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 );
-						}
-
-						// detach all dom ready events
-						detach();
-
-						// and execute any waiting functions
-						jQuery.ready();
-					}
-				})();
-			}
-		}
-	}
-	return readyList.promise( obj );
-};
+  jQuery.fn.init.prototype = jQuery.fn;
+
+  jQuery.extend = jQuery.fn.extend = function () {
+    var src, copyIsArray, copy, name, options, 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;
+    }
 
-// Populate the class2type map
-jQuery.each("Boolean Number String Function Array Date RegExp Object Error".split(" "), function(i, name) {
-	class2type[ "[object " + name + "]" ] = name.toLowerCase();
-});
+    // 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);
+      }
+
+      // 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) {
+      if (obj == null) {
+        return String(obj);
+      }
+      return typeof obj === "object" || typeof obj === "function"
+          ? class2type[core_toString.call(obj)] || "object" : typeof obj;
+    },
+
+    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
+    // keepScripts (optional): If true, will include scripts passed in the html string
+    parseHTML: function (data, context, keepScripts) {
+      if (!data || typeof data !== "string") {
+        return null;
+      }
+      if (typeof context === "boolean") {
+        keepScripts = context;
+        context = false;
+      }
+      context = context || document;
+
+      var parsed = rsingleTag.exec(data),
+          scripts = !keepScripts && [];
+
+      // Single tag
+      if (parsed) {
+        return [context.createElement(parsed[1])];
+      }
+
+      parsed = jQuery.buildFragment([data], context, scripts);
+      if (scripts) {
+        jQuery(scripts).remove();
+      }
+      return jQuery.merge([], parsed.childNodes);
+    },
+
+    parseJSON: function (data) {
+      // Attempt to parse using the native JSON parser first
+      if (window.JSON && window.JSON.parse) {
+        return window.JSON.parse(data);
+      }
+
+      if (data === null) {
+        return data;
+      }
+
+      if (typeof data === "string") {
+
+        // Make sure leading/trailing whitespace is removed (IE can't handle it)
+        data = jQuery.trim(data);
+
+        if (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 && jQuery.trim(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 value,
+          i = 0,
+          length = obj.length,
+          isArray = isArraylike(obj);
+
+      if (args) {
+        if (isArray) {
+          for (; i < length; i++) {
+            value = callback.apply(obj[i], args);
+
+            if (value === false) {
+              break;
+            }
+          }
+        } else {
+          for (i in obj) {
+            value = callback.apply(obj[i], args);
+
+            if (value === false) {
+              break;
+            }
+          }
+        }
+
+        // A special, fast, case for the most common use of each
+      } else {
+        if (isArray) {
+          for (; i < length; i++) {
+            value = callback.call(obj[i], i, obj[i]);
+
+            if (value === false) {
+              break;
+            }
+          }
+        } else {
+          for (i in obj) {
+            value = callback.call(obj[i], i, obj[i]);
+
+            if (value === 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 ret = results || [];
+
+      if (arr != null) {
+        if (isArraylike(Object(arr))) {
+          jQuery.merge(ret,
+              typeof arr === "string" ? [arr] : arr
+          );
+        } else {
+          core_push.call(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,
+          i = 0,
+          length = elems.length,
+          isArray = isArraylike(elems),
+          ret = [];
+
+      // 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 (i in elems) {
+          value = callback(elems[i], i, arg);
+
+          if (value != null) {
+            ret[ret.length] = value;
+          }
+        }
+      }
+
+      // Flatten any nested arrays
+      return core_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 args, proxy, tmp;
+
+      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 || this,
+            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, raw) {
+      var i = 0,
+          length = elems.length,
+          bulk = key == null;
+
+      // Sets many values
+      if (jQuery.type(key) === "object") {
+        chainable = true;
+        for (i in key) {
+          jQuery.access(elems, fn, i, key[i], true, emptyGet, raw);
+        }
+
+        // Sets one value
+      } else if (value !== undefined) {
+        chainable = true;
+
+        if (!jQuery.isFunction(value)) {
+          raw = true;
+        }
+
+        if (bulk) {
+          // Bulk operations run against the entire set
+          if (raw) {
+            fn.call(elems, value);
+            fn = null;
+
+            // ...except when executing function values
+          } else {
+            bulk = fn;
+            fn = function (elem, key, value) {
+              return bulk.call(jQuery(elem), value);
+            };
+          }
+        }
+
+        if (fn) {
+          for (; i < length; i++) {
+            fn(elems[i], key,
+                raw ? value : value.call(elems[i], i, fn(elems[i], key)));
+          }
+        }
+      }
+
+      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);
+
+        // Standards-based browsers support DOMContentLoaded
+      } else if (document.addEventListener) {
+        // Use the handy event callback
+        document.addEventListener("DOMContentLoaded", completed, false);
+
+        // A fallback to window.onload, that will always work
+        window.addEventListener("load", completed, false);
+
+        // If IE event model is used
+      } else {
+        // Ensure firing before onload, maybe late but safe also for iframes
+        document.attachEvent("onreadystatechange", completed);
+
+        // A fallback to window.onload, that will always work
+        window.attachEvent("onload", completed);
+
+        // 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);
+              }
+
+              // detach all dom ready events
+              detach();
 
-function isArraylike( obj ) {
-	var length = obj.length,
-		type = jQuery.type( obj );
+              // and execute any waiting functions
+              jQuery.ready();
+            }
+          })();
+        }
+      }
+    }
+    return readyList.promise(obj);
+  };
 
-	if ( jQuery.isWindow( obj ) ) {
-		return false;
-	}
+// Populate the class2type map
+  jQuery.each(
+      "Boolean Number String Function Array Date RegExp Object Error".split(
+          " "), function (i, name) {
+        class2type["[object " + name + "]"] = name.toLowerCase();
+      });
+
+  function isArraylike(obj) {
+    var length = obj.length,
+        type = jQuery.type(obj);
+
+    if (jQuery.isWindow(obj)) {
+      return false;
+    }
 
-	if ( obj.nodeType === 1 && length ) {
-		return true;
-	}
+    if (obj.nodeType === 1 && length) {
+      return true;
+    }
 
-	return type === "array" || type !== "function" &&
-		( length === 0 ||
-		typeof length === "number" && length > 0 && ( length - 1 ) in obj );
-}
+    return type === "array" || type !== "function" &&
+        ( length === 0 ||
+            typeof length === "number" && length > 0 && ( length - 1 ) in obj );
+  }
 
 // All jQuery objects should point back to these
-rootjQuery = jQuery(document);
+  rootjQuery = jQuery(document);
 // String to Object options format cache
-var optionsCache = {};
+  var optionsCache = {};
 
 // Convert String-formatted options into Object-formatted ones and store in cache
-function createOptions( options ) {
-	var object = optionsCache[ options ] = {};
-	jQuery.each( options.match( core_rnotwhite ) || [], function( _, flag ) {
-		object[ flag ] = true;
-	});
-	return object;
-}
-
-/*
+  function createOptions(options) {
+    var object = optionsCache[options] = {};
+    jQuery.each(options.match(core_rnotwhite) || [], 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
@@ -1001,6432 +997,6540 @@ function createOptions( options ) {
  *	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 // Flag to know if list is currently firing
-		firing,
-		// Last fire value (for non-forgettable lists)
-		memory,
-		// Flag to know if list was already fired
-		fired,
-		// End of the loop when firing
-		firingLength,
-		// Index of currently firing callback (modified by remove if needed)
-		firingIndex,
-		// First callback to fire (used internally by add and fireWith)
-		firingStart,
-		// 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" ) {
-								if ( !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;
-			},
-			// Check if a given callback is in the list.
-			// If no argument is given, return whether or not list has callbacks attached.
-			has: function( fn ) {
-				return fn ? jQuery.inArray( fn, list ) > -1 : !!( list && list.length );
-			},
-			// 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 = jQuery.isFunction( fns[ i ] ) && fns[ i ];
-							// deferred[ done | fail | progress ] for forwarding actions to newDefer
-							deferred[ tuple[1] ](function() {
-								var returned = fn && 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 === promise ? newDefer.promise() : this, fn ? [ returned ] : arguments );
-								}
-							});
-						});
-						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 ]
-			deferred[ tuple[0] ] = function() {
-				deferred[ tuple[0] + "With" ]( this === deferred ? promise : this, arguments );
-				return this;
-			};
-			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,
-		input, select, fragment,
-		opt, eventName, isSupported, i,
-		div = document.createElement("div");
-
-	// Setup
-	div.setAttribute( "className", "t" );
-	div.innerHTML = "  <link/><table></table><a href='/a'>a</a><input type='checkbox'/>";
-
-	// Support tests won't run in some limited or non-browser environments
-	all = div.getElementsByTagName("*");
-	a = div.getElementsByTagName("a")[ 0 ];
-	if ( !all || !a || !all.length ) {
-		return {};
-	}
-
-	// First batch of tests
-	select = document.createElement("select");
-	opt = select.appendChild( document.createElement("option") );
-	input = div.getElementsByTagName("input")[ 0 ];
-
-	a.style.cssText = "top:1px;float:left;opacity:.5";
-	support = {
-		// Test setAttribute on camelCase class. If it works, we need attrFixes when doing get/setAttribute (ie6/7)
-		getSetAttribute: div.className !== "t",
-
-		// 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,
-
-		// Check the default checkbox/radio value ("" on WebKit; "on" elsewhere)
-		checkOn: !!input.value,
-
-		// 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,
-
-		// 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
-		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;
-
-	// Support: IE<9
-	try {
-		delete div.test;
-	} catch( e ) {
-		support.deleteExpando = false;
-	}
-
-	// Check if we can trust getAttribute("value")
-	input = document.createElement("input");
-	input.setAttribute( "value", "" );
-	support.input = input.getAttribute( "value" ) === "";
-
-	// Check if an input maintains its value after becoming a radio
-	input.value = "t";
-	input.setAttribute( "type", "radio" );
-	support.radioValue = input.value === "t";
-
-	// #11217 - WebKit loses check when the name is after the checked attribute
-	input.setAttribute( "checked", "t" );
-	input.setAttribute( "name", "t" );
-
-	fragment = document.createDocumentFragment();
-	fragment.appendChild( input );
-
-	// Check if a disconnected checkbox will retain its checked
-	// value of true after appended to the DOM (IE6/7)
-	support.appendChecked = input.checked;
-
-	// WebKit doesn't clone checked state correctly in fragments
-	support.checkClone = fragment.cloneNode( true ).cloneNode( true ).lastChild.checked;
-
-	// Support: IE<9
-	// Opera does not clone events (and typeof div.attachEvent === undefined).
-	// IE9-10 clones events bound via attachEvent, but they don't trigger with .click()
-	if ( div.attachEvent ) {
-		div.attachEvent( "onclick", function() {
-			support.noCloneEvent = false;
-		});
-
-		div.cloneNode( true ).click();
-	}
-
-	// Support: IE<9 (lack submit/change bubble), Firefox 17+ (lack focusin event)
-	// Beware of CSP restrictions (https://developer.mozilla.org/en/Security/CSP), test/csp.php
-	for ( i in { submit: true, change: true, focusin: true }) {
-		div.setAttribute( eventName = "on" + i, "t" );
-
-		support[ i + "Bubbles" ] = eventName in window || div.attributes[ eventName ].expando === false;
-	}
-
-	div.style.backgroundClip = "content-box";
-	div.cloneNode( true ).style.backgroundClip = "";
-	support.clearCloneStyle = div.style.backgroundClip === "content-box";
-
-	// Run tests that need a body at doc ready
-	jQuery(function() {
-		var container, marginDiv, tds,
-			divReset = "padding:0;margin:0;border:0;display:block;box-sizing:content-box;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;",
-			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 = "border:0;width:0;height:0;position:absolute;top:0;left:-9999px;margin-top:1px";
-
-		body.appendChild( container ).appendChild( div );
-
-		// Support: IE8
-		// 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).
-		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";
-
-		// Support: IE8
-		// Check if empty table cells still have offsetWidth/Height
-		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 );
-
-		// Use 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. (#3333)
-			// Fails in WebKit before Feb 2011 nightlies
-			// WebKit Bug 13343 - getComputedStyle returns wrong value for margin-right
-			marginDiv = div.appendChild( document.createElement("div") );
-			marginDiv.style.cssText = div.style.cssText = divReset;
-			marginDiv.style.marginRight = marginDiv.style.width = "0";
-			div.style.width = "1px";
-
-			support.reliableMarginRight =
-				!parseFloat( ( window.getComputedStyle( marginDiv, null ) || {} ).marginRight );
-		}
-
-		if ( typeof div.style.zoom !== core_strundefined ) {
-			// Support: IE<8
-			// Check if natively block-level elements act like inline-block
-			// elements when setting their display to 'inline' and giving
-			// them layout
-			div.innerHTML = "";
-			div.style.cssText = divReset + "width:1px;padding:1px;display:inline;zoom:1";
-			support.inlineBlockNeedsLayout = ( div.offsetWidth === 3 );
-
-			// Support: IE6
-			// Check if elements with layout shrink-wrap their children
-			div.style.display = "block";
-			div.innerHTML = "<div></div>";
-			div.firstChild.style.width = "5px";
-			support.shrinkWrapBlocks = ( div.offsetWidth !== 3 );
-
-			if ( support.inlineBlockNeedsLayout ) {
-				// Prevent IE 6 from affecting layout for positioned elements #11048
-				// Prevent IE from shrinking the body in IE 7 mode #12869
-				// Support: IE<8
-				body.style.zoom = 1;
-			}
-		}
-
-		body.removeChild( container );
-
-		// Null elements to avoid leaks in IE
-		container = div = tds = marginDiv = null;
-	});
-
-	// Null elements to avoid leaks in IE
-	all = select = fragment = opt = a = input = null;
-
-	return support;
-})();
-
-var rbrace = /(?:\{[\s\S]*\}|\[[\s\S]*\])$/,
-	rmultiDash = /([A-Z])/g;
-
-function internalData( 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 = core_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;
-}
-
-function internalRemoveData( elem, name, pvt ) {
-	if ( !jQuery.acceptData( elem ) ) {
-		return;
-	}
-
-	var i, l, thisCache,
-		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(" ");
-					}
-				}
-			} else {
-				// If "name" is an array of keys...
-				// When data is initially created, via ("key", "val") signature,
-				// keys will be converted to camelCase.
-				// Since there is no way to tell _how_ a key was added, remove
-				// both plain key and camelCase key. #12786
-				// This will only penalize the array argument path.
-				name = name.concat( jQuery.map( name, jQuery.camelCase ) );
-			}
-
-			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;
-	}
-}
-
-jQuery.extend({
-	cache: {},
-
-	// Unique for each copy of jQuery on the page
-	// Non-digits removed to match rinlinejQuery
-	expando: "jQuery" + ( core_version + 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 ) {
-		return internalData( elem, name, data );
-	},
-
-	removeData: function( elem, name ) {
-		return internalRemoveData( elem, name );
-	},
-
-	// For internal use only.
-	_data: function( elem, name, data ) {
-		return internalData( elem, name, data, true );
-	},
-
-	_removeData: function( elem, name ) {
-		return internalRemoveData( elem, name, true );
-	},
-
-	// A method for determining if a DOM node can handle the data expando
-	acceptData: function( elem ) {
-		// Do not set data on non-element because it will not be cleared (#8335).
-		if ( elem.nodeType && elem.nodeType !== 1 && elem.nodeType !== 9 ) {
-			return false;
-		}
-
-		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 attrs, name,
-			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" ) ) {
-					attrs = elem.attributes;
-					for ( ; i < attrs.length; i++ ) {
-						name = attrs[i].name;
-
-						if ( !name.indexOf( "data-" ) ) {
-							name = jQuery.camelCase( name.slice(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 );
-			});
-		}
-
-		return jQuery.access( this, function( value ) {
-
-			if ( value === undefined ) {
-				// Try to fetch any internally stored data first
-				return elem ? dataAttr( elem, key, jQuery.data( elem, key ) ) : null;
-			}
-
-			this.each(function() {
-				jQuery.data( this, key, value );
-			});
-		}, null, value, arguments.length > 1, null, true );
-	},
-
-	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;
-}
+  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 // Flag to know if list is currently firing
+        firing,
+        // Last fire value (for non-forgettable lists)
+        memory,
+        // Flag to know if list was already fired
+        fired,
+        // End of the loop when firing
+        firingLength,
+        // Index of currently firing callback (modified by remove if needed)
+        firingIndex,
+        // First callback to fire (used internally by add and fireWith)
+        firingStart,
+        // 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") {
+                    if (!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;
+          },
+          // Check if a given callback is in the list.
+          // If no argument is given, return whether or not list has callbacks attached.
+          has: function (fn) {
+            return fn ? jQuery.inArray(fn, list) > -1 : !!( list
+                && list.length );
+          },
+          // 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 = jQuery.isFunction(fns[i]) && fns[i];
+                  // deferred[ done | fail | progress ] for forwarding actions to newDefer
+                  deferred[tuple[1]](function () {
+                    var returned = fn && 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 === promise ? newDefer.promise() : this,
+                          fn ? [returned] : arguments);
+                    }
+                  });
+                });
+                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 = {};
 
-// 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--;
-		}
-
-		hooks.cur = fn;
-		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" );
-				jQuery._removeData( elem, key );
-			})
-		});
-	}
-});
-
-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,
-	rclass = /[\t\r\n]/g,
-	rreturn = /\r/g,
-	rfocusable = /^(?:input|select|textarea|button|object)$/i,
-	rclickable = /^(?:a|area)$/i,
-	rboolean = /^(?:checked|selected|autofocus|autoplay|async|controls|defer|disabled|hidden|loop|multiple|open|readonly|required|scoped)$/i,
-	ruseDefault = /^(?:checked|selected)$/i,
-	getSetAttribute = jQuery.support.getSetAttribute,
-	getSetInput = jQuery.support.input;
-
-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 classes, elem, cur, clazz, j,
-			i = 0,
-			len = this.length,
-			proceed = typeof value === "string" && value;
-
-		if ( jQuery.isFunction( value ) ) {
-			return this.each(function( j ) {
-				jQuery( this ).addClass( value.call( this, j, this.className ) );
-			});
-		}
-
-		if ( proceed ) {
-			// The disjunction here is for better compressibility (see removeClass)
-			classes = ( value || "" ).match( core_rnotwhite ) || [];
-
-			for ( ; i < len; i++ ) {
-				elem = this[ i ];
-				cur = elem.nodeType === 1 && ( elem.className ?
-					( " " + elem.className + " " ).replace( rclass, " " ) :
-					" "
-				);
-
-				if ( cur ) {
-					j = 0;
-					while ( (clazz = classes[j++]) ) {
-						if ( cur.indexOf( " " + clazz + " " ) < 0 ) {
-							cur += clazz + " ";
-						}
-					}
-					elem.className = jQuery.trim( cur );
-
-				}
-			}
-		}
-
-		return this;
-	},
-
-	removeClass: function( value ) {
-		var classes, elem, cur, clazz, j,
-			i = 0,
-			len = this.length,
-			proceed = arguments.length === 0 || typeof value === "string" && value;
-
-		if ( jQuery.isFunction( value ) ) {
-			return this.each(function( j ) {
-				jQuery( this ).removeClass( value.call( this, j, this.className ) );
-			});
-		}
-		if ( proceed ) {
-			classes = ( value || "" ).match( core_rnotwhite ) || [];
-
-			for ( ; i < len; i++ ) {
-				elem = this[ i ];
-				// This expression is here for better compressibility (see addClass)
-				cur = elem.nodeType === 1 && ( elem.className ?
-					( " " + elem.className + " " ).replace( rclass, " " ) :
-					""
-				);
-
-				if ( cur ) {
-					j = 0;
-					while ( (clazz = classes[j++]) ) {
-						// Remove *all* instances
-						while ( cur.indexOf( " " + clazz + " " ) >= 0 ) {
-							cur = cur.replace( " " + clazz + " ", " " );
-						}
-					}
-					elem.className = value ? jQuery.trim( cur ) : "";
-				}
-			}
-		}
-
-		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.match( core_rnotwhite ) || [];
-
-				while ( (className = classNames[ i++ ]) ) {
-					// check each className given, space separated list
-					state = isBool ? state : !self.hasClass( className );
-					self[ state ? "addClass" : "removeClass" ]( className );
-				}
-
-			// Toggle whole class name
-			} else if ( type === core_strundefined || type === "boolean" ) {
-				if ( this.className ) {
-					// store className if set
-					jQuery._data( this, "__className__", this.className );
-				}
-
-				// If the element has a class name or if we're passed "false",
-				// then remove the whole classname (if there was one, the above saved it).
-				// Otherwise bring back whatever was previously saved (if anything),
-				// falling back to the empty string if nothing was stored.
-				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 ret, hooks, 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, option,
-					options = elem.options,
-					index = elem.selectedIndex,
-					one = elem.type === "select-one" || index < 0,
-					values = one ? null : [],
-					max = one ? index + 1 : options.length,
-					i = index < 0 ?
-						max :
-						one ? index : 0;
-
-				// Loop through all the selected options
-				for ( ; i < max; i++ ) {
-					option = options[ i ];
-
-					// oldIE doesn't update selected after form reset (#2551)
-					if ( ( option.selected || i === index ) &&
-							// Don't return options that are disabled or in a disabled optgroup
-							( 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 );
-					}
-				}
-
-				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;
-			}
-		}
-	},
-
-	attr: function( elem, name, value ) {
-		var hooks, notxml, ret,
-			nType = elem.nodeType;
-
-		// don't get/set attributes on text, comment and attribute nodes
-		if ( !elem || nType === 3 || nType === 8 || nType === 2 ) {
-			return;
-		}
-
-		// Fallback to prop when attributes are not supported
-		if ( typeof elem.getAttribute === core_strundefined ) {
-			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 );
-
-			} else if ( hooks && notxml && "set" in hooks && (ret = hooks.set( elem, value, name )) !== undefined ) {
-				return ret;
-
-			} else {
-				elem.setAttribute( name, value + "" );
-				return value;
-			}
-
-		} else if ( hooks && notxml && "get" in hooks && (ret = hooks.get( elem, name )) !== null ) {
-			return ret;
-
-		} else {
-
-			// In IE9+, Flash objects don't have .getAttribute (#12945)
-			// Support: IE9+
-			if ( typeof elem.getAttribute !== core_strundefined ) {
-				ret =  elem.getAttribute( name );
-			}
-
-			// Non-existent attributes return null, we normalize to undefined
-			return ret == null ?
-				undefined :
-				ret;
-		}
-	},
-
-	removeAttr: function( elem, value ) {
-		var name, propName,
-			i = 0,
-			attrNames = value && value.match( core_rnotwhite );
-
-		if ( attrNames && elem.nodeType === 1 ) {
-			while ( (name = attrNames[i++]) ) {
-				propName = jQuery.propFix[ name ] || name;
-
-				// Boolean attributes get special treatment (#10870)
-				if ( rboolean.test( name ) ) {
-					// Set corresponding property to false for boolean attributes
-					// Also clear defaultChecked/defaultSelected (if appropriate) for IE<8
-					if ( !getSetAttribute && ruseDefault.test( name ) ) {
-						elem[ jQuery.camelCase( "default-" + name ) ] =
-							elem[ propName ] = false;
-					} else {
-						elem[ propName ] = false;
-					}
-
-				// See #9699 for explanation of this approach (setting first, then removal)
-				} else {
-					jQuery.attr( elem, name, "" );
-				}
-
-				elem.removeAttribute( getSetAttribute ? name : propName );
-			}
-		}
-	},
-
-	attrHooks: {
-		type: {
-			set: function( elem, value ) {
-				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 default in case type is set after value during creation
-					var val = elem.value;
-					elem.setAttribute( "type", value );
-					if ( val ) {
-						elem.value = val;
-					}
-					return 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;
-			}
-		}
-	}
-});
+      // Keep pipe for back-compat
+      promise.pipe = promise.then;
 
-// Hook for boolean attributes
-boolHook = {
-	get: function( elem, name ) {
-		var
-			// Use .prop to determine if this attribute is understood as boolean
-			prop = jQuery.prop( elem, name ),
-
-			// Fetch it accordingly
-			attr = typeof prop === "boolean" && elem.getAttribute( name ),
-			detail = typeof prop === "boolean" ?
-
-				getSetInput && getSetAttribute ?
-					attr != null :
-					// oldIE fabricates an empty string for missing boolean attributes
-					// and conflates checked/selected into attroperties
-					ruseDefault.test( name ) ?
-						elem[ jQuery.camelCase( "default-" + name ) ] :
-						!!attr :
-
-				// fetch an attribute node for properties not recognized as boolean
-				elem.getAttributeNode( name );
-
-		return detail && detail.value !== false ?
-			name.toLowerCase() :
-			undefined;
-	},
-	set: function( elem, value, name ) {
-		if ( value === false ) {
-			// Remove boolean attributes when set to false
-			jQuery.removeAttr( elem, name );
-		} else if ( getSetInput && getSetAttribute || !ruseDefault.test( name ) ) {
-			// IE<8 needs the *property* name
-			elem.setAttribute( !getSetAttribute && jQuery.propFix[ name ] || name, name );
-
-		// Use defaultChecked and defaultSelected for oldIE
-		} else {
-			elem[ jQuery.camelCase( "default-" + name ) ] = elem[ name ] = true;
-		}
-
-		return name;
-	}
-};
+      // 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 ]
+        deferred[tuple[0]] = function () {
+          deferred[tuple[0] + "With"](this === deferred ? promise : this,
+              arguments);
+          return this;
+        };
+        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,
+        input, select, fragment,
+        opt, eventName, isSupported, i,
+        div = document.createElement("div");
+
+    // Setup
+    div.setAttribute("className", "t");
+    div.innerHTML = "  <link/><table></table><a href='/a'>a</a><input type='checkbox'/>";
+
+    // Support tests won't run in some limited or non-browser environments
+    all = div.getElementsByTagName("*");
+    a = div.getElementsByTagName("a")[0];
+    if (!all || !a || !all.length) {
+      return {};
+    }
+
+    // First batch of tests
+    select = document.createElement("select");
+    opt = select.appendChild(document.createElement("option"));
+    input = div.getElementsByTagName("input")[0];
+
+    a.style.cssText = "top:1px;float:left;opacity:.5";
+    support = {
+      // Test setAttribute on camelCase class. If it works, we need attrFixes when doing get/setAttribute (ie6/7)
+      getSetAttribute: div.className !== "t",
+
+      // 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,
+
+      // Check the default checkbox/radio value ("" on WebKit; "on" elsewhere)
+      checkOn: !!input.value,
+
+      // 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,
+
+      // 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
+      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;
+
+    // Support: IE<9
+    try {
+      delete div.test;
+    } catch (e) {
+      support.deleteExpando = false;
+    }
+
+    // Check if we can trust getAttribute("value")
+    input = document.createElement("input");
+    input.setAttribute("value", "");
+    support.input = input.getAttribute("value") === "";
+
+    // Check if an input maintains its value after becoming a radio
+    input.value = "t";
+    input.setAttribute("type", "radio");
+    support.radioValue = input.value === "t";
+
+    // #11217 - WebKit loses check when the name is after the checked attribute
+    input.setAttribute("checked", "t");
+    input.setAttribute("name", "t");
+
+    fragment = document.createDocumentFragment();
+    fragment.appendChild(input);
+
+    // Check if a disconnected checkbox will retain its checked
+    // value of true after appended to the DOM (IE6/7)
+    support.appendChecked = input.checked;
+
+    // WebKit doesn't clone checked state correctly in fragments
+    support.checkClone = fragment.cloneNode(true).cloneNode(
+        true).lastChild.checked;
+
+    // Support: IE<9
+    // Opera does not clone events (and typeof div.attachEvent === undefined).
+    // IE9-10 clones events bound via attachEvent, but they don't trigger with .click()
+    if (div.attachEvent) {
+      div.attachEvent("onclick", function () {
+        support.noCloneEvent = false;
+      });
+
+      div.cloneNode(true).click();
+    }
+
+    // Support: IE<9 (lack submit/change bubble), Firefox 17+ (lack focusin event)
+    // Beware of CSP restrictions (https://developer.mozilla.org/en/Security/CSP), test/csp.php
+    for (i in {submit: true, change: true, focusin: true}) {
+      div.setAttribute(eventName = "on" + i, "t");
+
+      support[i + "Bubbles"] = eventName in window
+          || div.attributes[eventName].expando === false;
+    }
+
+    div.style.backgroundClip = "content-box";
+    div.cloneNode(true).style.backgroundClip = "";
+    support.clearCloneStyle = div.style.backgroundClip === "content-box";
+
+    // Run tests that need a body at doc ready
+    jQuery(function () {
+      var container, marginDiv, tds,
+          divReset = "padding:0;margin:0;border:0;display:block;box-sizing:content-box;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;",
+          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 = "border:0;width:0;height:0;position:absolute;top:0;left:-9999px;margin-top:1px";
+
+      body.appendChild(container).appendChild(div);
+
+      // Support: IE8
+      // 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).
+      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";
+
+      // Support: IE8
+      // Check if empty table cells still have offsetWidth/Height
+      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 );
+
+      // Use 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. (#3333)
+        // Fails in WebKit before Feb 2011 nightlies
+        // WebKit Bug 13343 - getComputedStyle returns wrong value for margin-right
+        marginDiv = div.appendChild(document.createElement("div"));
+        marginDiv.style.cssText = div.style.cssText = divReset;
+        marginDiv.style.marginRight = marginDiv.style.width = "0";
+        div.style.width = "1px";
+
+        support.reliableMarginRight =
+            !parseFloat(
+                ( window.getComputedStyle(marginDiv, null) || {} ).marginRight);
+      }
+
+      if (typeof div.style.zoom !== core_strundefined) {
+        // Support: IE<8
+        // Check if natively block-level elements act like inline-block
+        // elements when setting their display to 'inline' and giving
+        // them layout
+        div.innerHTML = "";
+        div.style.cssText = divReset
+            + "width:1px;padding:1px;display:inline;zoom:1";
+        support.inlineBlockNeedsLayout = ( div.offsetWidth === 3 );
+
+        // Support: IE6
+        // Check if elements with layout shrink-wrap their children
+        div.style.display = "block";
+        div.innerHTML = "<div></div>";
+        div.firstChild.style.width = "5px";
+        support.shrinkWrapBlocks = ( div.offsetWidth !== 3 );
+
+        if (support.inlineBlockNeedsLayout) {
+          // Prevent IE 6 from affecting layout for positioned elements #11048
+          // Prevent IE from shrinking the body in IE 7 mode #12869
+          // Support: IE<8
+          body.style.zoom = 1;
+        }
+      }
+
+      body.removeChild(container);
+
+      // Null elements to avoid leaks in IE
+      container = div = tds = marginDiv = null;
+    });
+
+    // Null elements to avoid leaks in IE
+    all = select = fragment = opt = a = input = null;
+
+    return support;
+  })();
+
+  var rbrace = /(?:\{[\s\S]*\}|\[[\s\S]*\])$/,
+      rmultiDash = /([A-Z])/g;
+
+  function internalData(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 = core_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;
+  }
+
+  function internalRemoveData(elem, name, pvt) {
+    if (!jQuery.acceptData(elem)) {
+      return;
+    }
+
+    var i, l, thisCache,
+        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(" ");
+            }
+          }
+        } else {
+          // If "name" is an array of keys...
+          // When data is initially created, via ("key", "val") signature,
+          // keys will be converted to camelCase.
+          // Since there is no way to tell _how_ a key was added, remove
+          // both plain key and camelCase key. #12786
+          // This will only penalize the array argument path.
+          name = name.concat(jQuery.map(name, jQuery.camelCase));
+        }
+
+        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;
+    }
+  }
+
+  jQuery.extend({
+    cache: {},
+
+    // Unique for each copy of jQuery on the page
+    // Non-digits removed to match rinlinejQuery
+    expando: "jQuery" + ( core_version + 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) {
+      return internalData(elem, name, data);
+    },
+
+    removeData: function (elem, name) {
+      return internalRemoveData(elem, name);
+    },
+
+    // For internal use only.
+    _data: function (elem, name, data) {
+      return internalData(elem, name, data, true);
+    },
+
+    _removeData: function (elem, name) {
+      return internalRemoveData(elem, name, true);
+    },
+
+    // A method for determining if a DOM node can handle the data expando
+    acceptData: function (elem) {
+      // Do not set data on non-element because it will not be cleared (#8335).
+      if (elem.nodeType && elem.nodeType !== 1 && elem.nodeType !== 9) {
+        return false;
+      }
+
+      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 attrs, name,
+          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")) {
+            attrs = elem.attributes;
+            for (; i < attrs.length; i++) {
+              name = attrs[i].name;
+
+              if (!name.indexOf("data-")) {
+                name = jQuery.camelCase(name.slice(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);
+        });
+      }
+
+      return jQuery.access(this, function (value) {
+
+        if (value === undefined) {
+          // Try to fetch any internally stored data first
+          return elem ? dataAttr(elem, key, jQuery.data(elem, key)) : null;
+        }
+
+        this.each(function () {
+          jQuery.data(this, key, value);
+        });
+      }, null, value, arguments.length > 1, null, true);
+    },
+
+    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--;
+      }
+
+      hooks.cur = fn;
+      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");
+          jQuery._removeData(elem, key);
+        })
+      });
+    }
+  });
+
+  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,
+      rclass = /[\t\r\n]/g,
+      rreturn = /\r/g,
+      rfocusable = /^(?:input|select|textarea|button|object)$/i,
+      rclickable = /^(?:a|area)$/i,
+      rboolean = /^(?:checked|selected|autofocus|autoplay|async|controls|defer|disabled|hidden|loop|multiple|open|readonly|required|scoped)$/i,
+      ruseDefault = /^(?:checked|selected)$/i,
+      getSetAttribute = jQuery.support.getSetAttribute,
+      getSetInput = jQuery.support.input;
+
+  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 classes, elem, cur, clazz, j,
+          i = 0,
+          len = this.length,
+          proceed = typeof value === "string" && value;
+
+      if (jQuery.isFunction(value)) {
+        return this.each(function (j) {
+          jQuery(this).addClass(value.call(this, j, this.className));
+        });
+      }
+
+      if (proceed) {
+        // The disjunction here is for better compressibility (see removeClass)
+        classes = ( value || "" ).match(core_rnotwhite) || [];
+
+        for (; i < len; i++) {
+          elem = this[i];
+          cur = elem.nodeType === 1 && ( elem.className ? ( " " + elem.className
+                  + " " ).replace(rclass, " ") : " "
+          );
+
+          if (cur) {
+            j = 0;
+            while ((clazz = classes[j++])) {
+              if (cur.indexOf(" " + clazz + " ") < 0) {
+                cur += clazz + " ";
+              }
+            }
+            elem.className = jQuery.trim(cur);
+
+          }
+        }
+      }
+
+      return this;
+    },
+
+    removeClass: function (value) {
+      var classes, elem, cur, clazz, j,
+          i = 0,
+          len = this.length,
+          proceed = arguments.length === 0 || typeof value === "string"
+              && value;
+
+      if (jQuery.isFunction(value)) {
+        return this.each(function (j) {
+          jQuery(this).removeClass(value.call(this, j, this.className));
+        });
+      }
+      if (proceed) {
+        classes = ( value || "" ).match(core_rnotwhite) || [];
+
+        for (; i < len; i++) {
+          elem = this[i];
+          // This expression is here for better compressibility (see addClass)
+          cur = elem.nodeType === 1 && ( elem.className ? ( " " + elem.className
+                  + " " ).replace(rclass, " ") : ""
+          );
+
+          if (cur) {
+            j = 0;
+            while ((clazz = classes[j++])) {
+              // Remove *all* instances
+              while (cur.indexOf(" " + clazz + " ") >= 0) {
+                cur = cur.replace(" " + clazz + " ", " ");
+              }
+            }
+            elem.className = value ? jQuery.trim(cur) : "";
+          }
+        }
+      }
+
+      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.match(core_rnotwhite) || [];
+
+          while ((className = classNames[i++])) {
+            // check each className given, space separated list
+            state = isBool ? state : !self.hasClass(className);
+            self[state ? "addClass" : "removeClass"](className);
+          }
+
+          // Toggle whole class name
+        } else if (type === core_strundefined || type === "boolean") {
+          if (this.className) {
+            // store className if set
+            jQuery._data(this, "__className__", this.className);
+          }
+
+          // If the element has a class name or if we're passed "false",
+          // then remove the whole classname (if there was one, the above saved it).
+          // Otherwise bring back whatever was previously saved (if anything),
+          // falling back to the empty string if nothing was stored.
+          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 ret, hooks, 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, option,
+              options = elem.options,
+              index = elem.selectedIndex,
+              one = elem.type === "select-one" || index < 0,
+              values = one ? null : [],
+              max = one ? index + 1 : options.length,
+              i = index < 0 ? max : one ? index : 0;
+
+          // Loop through all the selected options
+          for (; i < max; i++) {
+            option = options[i];
+
+            // oldIE doesn't update selected after form reset (#2551)
+            if (( option.selected || i === index ) &&
+                // Don't return options that are disabled or in a disabled optgroup
+                ( 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);
+            }
+          }
+
+          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;
+        }
+      }
+    },
+
+    attr: function (elem, name, value) {
+      var hooks, notxml, ret,
+          nType = elem.nodeType;
+
+      // don't get/set attributes on text, comment and attribute nodes
+      if (!elem || nType === 3 || nType === 8 || nType === 2) {
+        return;
+      }
+
+      // Fallback to prop when attributes are not supported
+      if (typeof elem.getAttribute === core_strundefined) {
+        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);
+
+        } else if (hooks && notxml && "set" in hooks && (ret = hooks.set(elem,
+                value, name)) !== undefined) {
+          return ret;
+
+        } else {
+          elem.setAttribute(name, value + "");
+          return value;
+        }
+
+      } else if (hooks && notxml && "get" in hooks && (ret = hooks.get(elem,
+              name)) !== null) {
+        return ret;
+
+      } else {
+
+        // In IE9+, Flash objects don't have .getAttribute (#12945)
+        // Support: IE9+
+        if (typeof elem.getAttribute !== core_strundefined) {
+          ret = elem.getAttribute(name);
+        }
+
+        // Non-existent attributes return null, we normalize to undefined
+        return ret == null ? undefined : ret;
+      }
+    },
+
+    removeAttr: function (elem, value) {
+      var name, propName,
+          i = 0,
+          attrNames = value && value.match(core_rnotwhite);
+
+      if (attrNames && elem.nodeType === 1) {
+        while ((name = attrNames[i++])) {
+          propName = jQuery.propFix[name] || name;
+
+          // Boolean attributes get special treatment (#10870)
+          if (rboolean.test(name)) {
+            // Set corresponding property to false for boolean attributes
+            // Also clear defaultChecked/defaultSelected (if appropriate) for IE<8
+            if (!getSetAttribute && ruseDefault.test(name)) {
+              elem[jQuery.camelCase("default-" + name)] =
+                  elem[propName] = false;
+            } else {
+              elem[propName] = false;
+            }
+
+            // See #9699 for explanation of this approach (setting first, then removal)
+          } else {
+            jQuery.attr(elem, name, "");
+          }
+
+          elem.removeAttribute(getSetAttribute ? name : propName);
+        }
+      }
+    },
+
+    attrHooks: {
+      type: {
+        set: function (elem, value) {
+          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 default in case type is set after value during creation
+            var val = elem.value;
+            elem.setAttribute("type", value);
+            if (val) {
+              elem.value = val;
+            }
+            return 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) {
+      var
+          // Use .prop to determine if this attribute is understood as boolean
+          prop = jQuery.prop(elem, name),
+
+          // Fetch it accordingly
+          attr = typeof prop === "boolean" && elem.getAttribute(name),
+          detail = typeof prop === "boolean" ? getSetInput && getSetAttribute
+              ? attr != null
+              : // oldIE fabricates an empty string for missing boolean attributes
+              // and conflates checked/selected into attroperties
+              ruseDefault.test(name) ? elem[jQuery.camelCase("default-" + name)]
+                  : !!attr
+              : // fetch an attribute node for properties not recognized as boolean
+              elem.getAttributeNode(name);
+
+      return detail && detail.value !== false ? name.toLowerCase() : undefined;
+    },
+    set: function (elem, value, name) {
+      if (value === false) {
+        // Remove boolean attributes when set to false
+        jQuery.removeAttr(elem, name);
+      } else if (getSetInput && getSetAttribute || !ruseDefault.test(name)) {
+        // IE<8 needs the *property* name
+        elem.setAttribute(!getSetAttribute && jQuery.propFix[name] || name,
+            name);
+
+        // Use defaultChecked and defaultSelected for oldIE
+      } else {
+        elem[jQuery.camelCase("default-" + name)] = elem[name] = true;
+      }
+
+      return name;
+    }
+  };
+
+// fix oldIE value attroperty
+  if (!getSetInput || !getSetAttribute) {
+    jQuery.attrHooks.value = {
+      get: function (elem, name) {
+        var ret = elem.getAttributeNode(name);
+        return jQuery.nodeName(elem, "input")
+            ? // Ignore the value *property* by using defaultValue
+            elem.defaultValue : ret && ret.specified ? ret.value : undefined;
+      },
+      set: function (elem, value, name) {
+        if (jQuery.nodeName(elem, "input")) {
+          // Does not return so that setAttribute is also used
+          elem.defaultValue = value;
+        } else {
+          // Use nodeHook if defined (#1954); otherwise setAttribute is fine
+          return nodeHook && nodeHook.set(elem, value, name);
+        }
+      }
+    };
+  }
+
+// IE6/7 do not support getting/setting some attributes with get/setAttribute
+  if (!getSetAttribute) {
+
+    // 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 = elem.getAttributeNode(name);
+        return ret && ( name === "id" || name === "name" || name === "coords"
+            ? 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) {
+          elem.setAttributeNode(
+              (ret = elem.ownerDocument.createAttribute(name))
+          );
+        }
+
+        ret.value = value += "";
+
+        // Break association with cloned elements by also using setAttribute (#9646)
+        return name === "value" || value === elem.getAttribute(name) ? value
+            : undefined;
+      }
+    };
+
+    // 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) {
+        nodeHook.set(elem, value === "" ? false : value, name);
+      }
+    };
+
+    // 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;
+          }
+        }
+      });
+    });
+  }
+
+// Some attributes require a special call on IE
+// http://msdn.microsoft.com/en-us/library/ms536429%28VS.85%29.aspx
+  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;
+        }
+      });
+    });
+
+    // href/src property should get the full normalized URL (#10299/#12915)
+    jQuery.each(["href", "src"], function (i, name) {
+      jQuery.propHooks[name] = {
+        get: function (elem) {
+          return elem.getAttribute(name, 4);
+        }
+      };
+    });
+  }
+
+  if (!jQuery.support.style) {
+    jQuery.attrHooks.style = {
+      get: function (elem) {
+        // Return undefined in the case of empty string
+        // Note: IE uppercases css property names, but if we were to .toLowerCase()
+        // .cssText, that would destroy case senstitivity in URL's, like in "background"
+        return elem.style.cssText || 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 = /^(?:input|select|textarea)$/i,
+      rkeyEvent = /^key/,
+      rmouseEvent = /^(?:mouse|contextmenu)|click/,
+      rfocusMorph = /^(?:focusinfocus|focusoutblur)$/,
+      rtypenamespace = /^([^.]*)(?:\.(.+)|)$/;
+
+  function returnTrue() {
+    return true;
+  }
+
+  function returnFalse() {
+    return false;
+  }
+
+  /*
+ * Helper functions for managing events -- not part of the public interface.
+ * Props to Dean Edwards' addEvent library for many of the ideas.
+ */
+  jQuery.event = {
+
+    global: {},
+
+    add: function (elem, types, handler, data, selector) {
+      var tmp, events, t, handleObjIn,
+          special, eventHandle, handleObj,
+          handlers, type, namespaces, origType,
+          elemData = jQuery._data(elem);
+
+      // Don't attach events to noData or text/comment nodes (but allow plain objects)
+      if (!elemData) {
+        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
+      if (!(events = elemData.events)) {
+        events = elemData.events = {};
+      }
+      if (!(eventHandle = elemData.handle)) {
+        eventHandle = elemData.handle = 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 !== core_strundefined && (!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 = ( types || "" ).match(core_rnotwhite) || [""];
+      t = types.length;
+      while (t--) {
+        tmp = rtypenamespace.exec(types[t]) || [];
+        type = origType = tmp[1];
+        namespaces = ( tmp[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: origType,
+          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
+        if (!(handlers = events[type])) {
+          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;
+    },
+
+    // Detach an event or set of events from an element
+    remove: function (elem, types, handler, selector, mappedTypes) {
+      var j, handleObj, tmp,
+          origCount, t, events,
+          special, handlers, type,
+          namespaces, origType,
+          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 = ( types || "" ).match(core_rnotwhite) || [""];
+      t = types.length;
+      while (t--) {
+        tmp = rtypenamespace.exec(types[t]) || [];
+        type = origType = tmp[1];
+        namespaces = ( tmp[2] || "" ).split(".").sort();
+
+        // 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;
+        handlers = events[type] || [];
+        tmp = tmp[2] && new RegExp("(^|\\.)" + namespaces.join("\\.(?:.*\\.|)")
+            + "(\\.|$)");
+
+        // Remove matching events
+        origCount = j = handlers.length;
+        while (j--) {
+          handleObj = handlers[j];
+
+          if (( mappedTypes || origType === handleObj.origType ) &&
+              ( !handler || handler.guid === handleObj.guid ) &&
+              ( !tmp || tmp.test(handleObj.namespace) ) &&
+              ( !selector || selector === handleObj.selector || selector
+                  === "**" && handleObj.selector )) {
+            handlers.splice(j, 1);
+
+            if (handleObj.selector) {
+              handlers.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 (origCount && !handlers.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");
+      }
+    },
+
+    trigger: function (event, data, elem, onlyHandlers) {
+      var handle, ontype, cur,
+          bubbleType, special, tmp, i,
+          eventPath = [elem || document],
+          type = core_hasOwn.call(event, "type") ? event.type : event,
+          namespaces = core_hasOwn.call(event, "namespace")
+              ? event.namespace.split(".") : [];
+
+      cur = tmp = elem = elem || document;
+
+      // Don't do events on text and comment nodes
+      if (elem.nodeType === 3 || elem.nodeType === 8) {
+        return;
+      }
+
+      // 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) {
+        // Namespaced trigger; create a regexp to match event type in handle()
+        namespaces = type.split(".");
+        type = namespaces.shift();
+        namespaces.sort();
+      }
+      ontype = type.indexOf(":") < 0 && "on" + type;
+
+      // Caller can pass in a jQuery.Event object, Object, or just an event type string
+      event = event[jQuery.expando] ? event : new jQuery.Event(
+          type, typeof event === "object" && event);
+
+      event.isTrigger = true;
+      event.namespace = namespaces.join(".");
+      event.namespace_re = event.namespace ? new RegExp("(^|\\.)"
+          + namespaces.join("\\.(?:.*\\.|)") + "(\\.|$)") : null;
+
+      // 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 ? [event] : jQuery.makeArray(data, [event]);
+
+      // Allow special events to draw outside the lines
+      special = jQuery.event.special[type] || {};
+      if (!onlyHandlers && 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)
+      if (!onlyHandlers && !special.noBubble && !jQuery.isWindow(elem)) {
+
+        bubbleType = special.delegateType || type;
+        if (!rfocusMorph.test(bubbleType + type)) {
+          cur = cur.parentNode;
+        }
+        for (; cur; cur = cur.parentNode) {
+          eventPath.push(cur);
+          tmp = cur;
+        }
+
+        // Only add window if we got to document (e.g., not plain obj or detached DOM)
+        if (tmp === (elem.ownerDocument || document)) {
+          eventPath.push(tmp.defaultView || tmp.parentWindow || window);
+        }
+      }
+
+      // Fire handlers on the event path
+      i = 0;
+      while ((cur = eventPath[i++]) && !event.isPropagationStopped()) {
+
+        event.type = i > 1 ? bubbleType : special.bindType || type;
+
+        // jQuery handler
+        handle = ( jQuery._data(cur, "events") || {} )[event.type]
+            && jQuery._data(cur, "handle");
+        if (handle) {
+          handle.apply(cur, data);
+        }
+
+        // Native 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)
+          if (ontype && elem[type] && !jQuery.isWindow(elem)) {
+
+            // Don't re-trigger an onFOO event when we call its FOO() method
+            tmp = elem[ontype];
+
+            if (tmp) {
+              elem[ontype] = null;
+            }
+
+            // Prevent re-triggering of the same event, since we already bubbled it above
+            jQuery.event.triggered = type;
+            try {
+              elem[type]();
+            } catch (e) {
+              // IE<9 dies on focus/blur to hidden element (#1486,#12518)
+              // only reproducible on winXP IE8 native, not IE9 in IE8 mode
+            }
+            jQuery.event.triggered = undefined;
+
+            if (tmp) {
+              elem[ontype] = tmp;
+            }
+          }
+        }
+      }
+
+      return event.result;
+    },
+
+    dispatch: function (event) {
+
+      // Make a writable jQuery.Event from the native event object
+      event = jQuery.event.fix(event);
+
+      var i, ret, handleObj, matched, j,
+          handlerQueue = [],
+          args = core_slice.call(arguments),
+          handlers = ( jQuery._data(this, "events") || {} )[event.type] || [],
+          special = jQuery.event.special[event.type] || {};
+
+      // 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
+      handlerQueue = jQuery.event.handlers.call(this, event, handlers);
+
+      // Run delegates first; they may want to stop propagation beneath us
+      i = 0;
+      while ((matched = handlerQueue[i++]) && !event.isPropagationStopped()) {
+        event.currentTarget = matched.elem;
+
+        j = 0;
+        while ((handleObj = matched.handlers[j++])
+        && !event.isImmediatePropagationStopped()) {
+
+          // Triggered event must either 1) have no namespace, or
+          // 2) have namespace(s) a subset or equal to those in the bound event (both can have no namespace).
+          if (!event.namespace_re || event.namespace_re.test(
+                  handleObj.namespace)) {
+
+            event.handleObj = handleObj;
+            event.data = handleObj.data;
+
+            ret = ( (jQuery.event.special[handleObj.origType] || {}).handle
+                || handleObj.handler )
+            .apply(matched.elem, args);
+
+            if (ret !== undefined) {
+              if ((event.result = 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;
+    },
+
+    handlers: function (event, handlers) {
+      var sel, handleObj, matches, i,
+          handlerQueue = [],
+          delegateCount = handlers.delegateCount,
+          cur = event.target;
+
+      // Find delegate handlers
+      // Black-hole SVG <use> instance trees (#13180)
+      // Avoid non-left-click bubbling in Firefox (#3861)
+      if (delegateCount && cur.nodeType && (!event.button || event.type
+              !== "click")) {
+
+        for (; cur != this; cur = cur.parentNode || this) {
+
+          // Don't check non-elements (#13208)
+          // Don't process clicks on disabled elements (#6911, #8165, #11382, #11764)
+          if (cur.nodeType === 1 && (cur.disabled !== true || event.type
+                  !== "click")) {
+            matches = [];
+            for (i = 0; i < delegateCount; i++) {
+              handleObj = handlers[i];
+
+              // Don't conflict with Object.prototype properties (#13203)
+              sel = handleObj.selector + " ";
+
+              if (matches[sel] === undefined) {
+                matches[sel] = handleObj.needsContext ? jQuery(sel, this).index(
+                    cur) >= 0 : jQuery.find(sel, this, null, [cur]).length;
+              }
+              if (matches[sel]) {
+                matches.push(handleObj);
+              }
+            }
+            if (matches.length) {
+              handlerQueue.push({elem: cur, handlers: matches});
+            }
+          }
+        }
+      }
+
+      // Add the remaining (directly-bound) handlers
+      if (delegateCount < handlers.length) {
+        handlerQueue.push(
+            {elem: this, handlers: handlers.slice(delegateCount)});
+      }
+
+      return handlerQueue;
+    },
+
+    fix: function (event) {
+      if (event[jQuery.expando]) {
+        return event;
+      }
+
+      // Create a writable copy of the event object and normalize some properties
+      var i, prop, copy,
+          type = event.type,
+          originalEvent = event,
+          fixHook = this.fixHooks[type];
+
+      if (!fixHook) {
+        this.fixHooks[type] = fixHook =
+            rmouseEvent.test(type) ? this.mouseHooks : rkeyEvent.test(type)
+                ? this.keyHooks : {};
+      }
+      copy = fixHook.props ? this.props.concat(fixHook.props) : this.props;
+
+      event = new jQuery.Event(originalEvent);
+
+      i = copy.length;
+      while (i--) {
+        prop = copy[i];
+        event[prop] = originalEvent[prop];
+      }
+
+      // Support: IE<9
+      // Fix target property (#1925)
+      if (!event.target) {
+        event.target = originalEvent.srcElement || document;
+      }
+
+      // Support: Chrome 23+, Safari?
+      // Target should not be a text node (#504, #13143)
+      if (event.target.nodeType === 3) {
+        event.target = event.target.parentNode;
+      }
+
+      // Support: IE<9
+      // For mouse/key events, metaKey==false if it's undefined (#3368, #11328)
+      event.metaKey = !!event.metaKey;
+
+      return fixHook.filter ? fixHook.filter(event, originalEvent) : event;
+    },
+
+    // Includes some event props shared by KeyEvent and MouseEvent
+    props: "altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(
+        " "),
+
+    fixHooks: {},
+
+    keyHooks: {
+      props: "char charCode key keyCode".split(" "),
+      filter: function (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 body, eventDoc, doc,
+            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;
+      }
+    },
+
+    special: {
+      load: {
+        // Prevent triggered image.load events from bubbling to window.load
+        noBubble: true
+      },
+      click: {
+        // For checkbox, fire native event so checked state will be right
+        trigger: function () {
+          if (jQuery.nodeName(this, "input") && this.type === "checkbox"
+              && this.click) {
+            this.click();
+            return false;
+          }
+        }
+      },
+      focus: {
+        // Fire native event if possible so blur/focus sequence is correct
+        trigger: function () {
+          if (this !== document.activeElement && this.focus) {
+            try {
+              this.focus();
+              return false;
+            } catch (e) {
+              // Support: IE<9
+              // If we error on focus to hidden element (#1486, #12518),
+              // let .trigger() run the handlers
+            }
+          }
+        },
+        delegateType: "focusin"
+      },
+      blur: {
+        trigger: function () {
+          if (this === document.activeElement && this.blur) {
+            this.blur();
+            return false;
+          }
+        },
+        delegateType: "focusout"
+      },
+
+      beforeunload: {
+        postDispatch: function (event) {
+
+          // Even when returnValue equals to undefined Firefox will still show alert
+          if (event.result !== undefined) {
+            event.originalEvent.returnValue = event.result;
+          }
+        }
+      }
+    },
+
+    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();
+      }
+    }
+  };
+
+  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] === core_strundefined) {
+        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;
+  };
+
+// 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 = {
+    isDefaultPrevented: returnFalse,
+    isPropagationStopped: returnFalse,
+    isImmediatePropagationStopped: returnFalse,
+
+    preventDefault: function () {
+      var e = this.originalEvent;
+
+      this.isDefaultPrevented = returnTrue;
+      if (!e) {
+        return;
+      }
+
+      // If preventDefault exists, run it on the original event
+      if (e.preventDefault) {
+        e.preventDefault();
+
+        // Support: IE
+        // Otherwise set the returnValue property of the original event to false
+      } else {
+        e.returnValue = false;
+      }
+    },
+    stopPropagation: function () {
+      var e = this.originalEvent;
+
+      this.isPropagationStopped = returnTrue;
+      if (!e) {
+        return;
+      }
+      // If stopPropagation exists, run it on the original event
+      if (e.stopPropagation) {
+        e.stopPropagation();
+      }
+
+      // Support: IE
+      // Set the cancelBubble property of the original event to true
+      e.cancelBubble = true;
+    },
+    stopImmediatePropagation: function () {
+      this.isImmediatePropagationStopped = returnTrue;
+      this.stopPropagation();
+    }
+  };
+
+// 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;
+
+        // 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, "submitBubbles")) {
+            jQuery.event.add(form, "submit._submit", function (event) {
+              event._submit_bubble = true;
+            });
+            jQuery._data(form, "submitBubbles", 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,
+                  "changeBubbles")) {
+            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, "changeBubbles", 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 type, origFn;
+
+      // Types can be a map of types/handlers
+      if (typeof types === "object") {
+        // ( types-Object, selector, data )
+        if (typeof selector !== "string") {
+          // ( 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);
+    },
+
+    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) {
+      var elem = this[0];
+      if (elem) {
+        return jQuery.event.trigger(type, data, elem, true);
+      }
+    }
+  });
+  /*!
+ * Sizzle CSS Selector Engine
+ * Copyright 2012 jQuery Foundation and other contributors
+ * Released under the MIT license
+ * http://sizzlejs.com/
+ */
+  (function (window, undefined) {
+
+    var i,
+        cachedruns,
+        Expr,
+        getText,
+        isXML,
+        compile,
+        hasDuplicate,
+        outermostContext,
+
+        // Local document vars
+        setDocument,
+        document,
+        docElem,
+        documentIsXML,
+        rbuggyQSA,
+        rbuggyMatches,
+        matches,
+        contains,
+        sortOrder,
+
+        // Instance-specific data
+        expando = "sizzle" + -(new Date()),
+        preferredDoc = window.document,
+        support = {},
+        dirruns = 0,
+        done = 0,
+        classCache = createCache(),
+        tokenCache = createCache(),
+        compilerCache = createCache(),
+
+        // General-purpose constants
+        strundefined = typeof undefined,
+        MAX_NEGATIVE = 1 << 31,
+
+        // Array methods
+        arr = [],
+        pop = arr.pop,
+        push = arr.push,
+        slice = arr.slice,
+        // Use a stripped-down indexOf if we can't use a native one
+        indexOf = arr.indexOf || function (elem) {
+          var i = 0,
+              len = this.length;
+          for (; i < len; i++) {
+            if (this[i] === elem) {
+              return i;
+            }
+          }
+          return -1;
+        },
+
+        // Regular expressions
+
+        // 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 quoted,
+        //   then not containing pseudos/brackets,
+        //   then attribute selectors/non-parenthetical expressions,
+        //   then anything else
+        // These preferences are here to reduce the number of selectors
+        //   needing tokenize in the PSEUDO preFilter
+        pseudos = ":(" + characterEncoding
+            + ")(?:\\(((['\"])((?:\\\\.|[^\\\\])*?)\\3|((?:\\\\.|[^\\\\()[\\]]|"
+            + attributes.replace(3, 8) + ")*)|.*)\\)|)",
+
+        // 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),
+        ridentifier = new RegExp("^" + identifier + "$"),
+
+        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),
+          "CHILD": new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("
+              + whitespace +
+              "*(even|odd|(([+-]|)(\\d*)n|)" + whitespace + "*(?:([+-]|)"
+              + whitespace +
+              "*(\\d+)|))" + whitespace + "*\\)|)", "i"),
+          // For use in libraries implementing .is()
+          // We use this for POS matching in `select`
+          "needsContext": new RegExp("^" + whitespace
+              + "*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\(" +
+              whitespace + "*((?:-\\d)?\\d*)" + whitespace + "*\\)|)(?=[^-]|$)",
+              "i")
+        },
+
+        rsibling = /[\x20\t\r\n\f]*[+~]/,
+
+        rnative = /^[^{]+\{\s*\[native code/,
+
+        // Easily-parseable/retrievable ID or TAG or CLASS selectors
+        rquickExpr = /^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,
+
+        rinputs = /^(?:input|select|textarea|button)$/i,
+        rheader = /^h\d$/i,
+
+        rescape = /'|\\/g,
+        rattributeQuotes = /\=[\x20\t\r\n\f]*([^'"\]]*)[\x20\t\r\n\f]*\]/g,
+
+        // CSS escapes http://www.w3.org/TR/CSS21/syndata.html#escaped-characters
+        runescape = /\\([\da-fA-F]{1,6}[\x20\t\r\n\f]?|.)/g,
+        funescape = function (_, escaped) {
+          var high = "0x" + escaped - 0x10000;
+          // NaN means non-codepoint
+          return high !== high ? escaped : // BMP codepoint
+              high < 0 ? String.fromCharCode(high + 0x10000)
+                  : // Supplemental Plane codepoint (surrogate pair)
+                  String.fromCharCode(high >> 10 | 0xD800, high & 0x3FF
+                      | 0xDC00);
+        };
+
+// Use a stripped-down slice if we can't use a native one
+    try {
+      slice.call(preferredDoc.documentElement.childNodes, 0)[0].nodeType;
+    } catch (e) {
+      slice = function (i) {
+        var elem,
+            results = [];
+        while ((elem = this[i++])) {
+          results.push(elem);
+        }
+        return results;
+      };
+    }
+
+    /**
+     * For feature detection
+     * @param {Function} fn The function to test for native support
+     */
+    function isNative(fn) {
+      return rnative.test(fn + "");
+    }
+
+    /**
+     * Create key-value caches of limited size
+     * @returns {Function(string, Object)} Returns the Object data after storing it on itself with
+     *  property name the (space-suffixed) string and (if the cache is larger than Expr.cacheLength)
+     *  deleting the oldest entry
+     */
+    function createCache() {
+      var cache,
+          keys = [];
+
+      return (cache = function (key, value) {
+        // Use (key + " ") to avoid collision with native prototype properties (see Issue #157)
+        if (keys.push(key += " ") > Expr.cacheLength) {
+          // Only keep the most recent entries
+          delete cache[keys.shift()];
+        }
+        return (cache[key] = value);
+      });
+    }
+
+    /**
+     * Mark a function for special use by Sizzle
+     * @param {Function} fn The function to mark
+     */
+    function markFunction(fn) {
+      fn[expando] = true;
+      return fn;
+    }
+
+    /**
+     * Support testing using an element
+     * @param {Function} fn Passed the created div and expects a boolean result
+     */
+    function assert(fn) {
+      var div = document.createElement("div");
+
+      try {
+        return fn(div);
+      } catch (e) {
+        return false;
+      } finally {
+        // release memory in IE
+        div = null;
+      }
+    }
+
+    function Sizzle(selector, context, results, seed) {
+      var match, elem, m, nodeType,
+          // QSA vars
+          i, groups, old, nid, newContext, newSelector;
+
+      if (( context ? context.ownerDocument || context : preferredDoc )
+          !== document) {
+        setDocument(context);
+      }
+
+      context = context || document;
+      results = results || [];
+
+      if (!selector || typeof selector !== "string") {
+        return results;
+      }
+
+      if ((nodeType = context.nodeType) !== 1 && nodeType !== 9) {
+        return [];
+      }
+
+      if (!documentIsXML && !seed) {
+
+        // Shortcuts
+        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]) && support.getByClassName
+              && context.getElementsByClassName) {
+            push.apply(results,
+                slice.call(context.getElementsByClassName(m), 0));
+            return results;
+          }
+        }
+
+        // QSA path
+        if (support.qsa && !rbuggyQSA.test(selector)) {
+          old = true;
+          nid = expando;
+          newContext = context;
+          newSelector = 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 (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 + toSelector(groups[i]);
+            }
+            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");
+              }
+            }
+          }
+        }
+      }
+
+      // All others
+      return select(selector.replace(rtrim, "$1"), context, results, seed);
+    }
+
+    /**
+     * Detect xml
+     * @param {Element|Object} elem An element or a document
+     */
+    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;
+    };
+
+    /**
+     * Sets document-related variables once based on the current document
+     * @param {Element|Object} [doc] An element or document object to use to set the document
+     * @returns {Object} Returns the current document
+     */
+    setDocument = Sizzle.setDocument = function (node) {
+      var doc = node ? node.ownerDocument || node : preferredDoc;
+
+      // If no document and documentElement is available, return
+      if (doc === document || doc.nodeType !== 9 || !doc.documentElement) {
+        return document;
+      }
+
+      // Set our document
+      document = doc;
+      docElem = doc.documentElement;
+
+      // Support tests
+      documentIsXML = isXML(doc);
+
+      // Check if getElementsByTagName("*") returns only elements
+      support.tagNameNoComments = assert(function (div) {
+        div.appendChild(doc.createComment(""));
+        return !div.getElementsByTagName("*").length;
+      });
+
+      // Check if attributes should be retrieved by attribute nodes
+      support.attributes = 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
+      support.getByClassName = 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
+      support.getByName = 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 = doc.getElementsByName &&
+            // buggy browsers will return fewer than the correct 2
+            doc.getElementsByName(expando).length === 2 +
+            // buggy browsers will return more than the correct 0
+            doc.getElementsByName(expando + 0).length;
+        support.getIdNotName = !doc.getElementById(expando);
+
+        // Cleanup
+        docElem.removeChild(div);
+
+        return pass;
+      });
+
+      // IE6/7 return modified attributes
+      Expr.attrHandle = assert(function (div) {
+        div.innerHTML = "<a href='#'></a>";
+        return div.firstChild && typeof div.firstChild.getAttribute
+            !== strundefined &&
+            div.firstChild.getAttribute("href") === "#";
+      }) ? {} : {
+        "href": function (elem) {
+          return elem.getAttribute("href", 2);
+        },
+        "type": function (elem) {
+          return elem.getAttribute("type");
+        }
+      };
+
+      // ID find and filter
+      if (support.getIdNotName) {
+        Expr.find["ID"] = function (id, context) {
+          if (typeof context.getElementById !== strundefined
+              && !documentIsXML) {
+            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] : [];
+          }
+        };
+        Expr.filter["ID"] = function (id) {
+          var attrId = id.replace(runescape, funescape);
+          return function (elem) {
+            return elem.getAttribute("id") === attrId;
+          };
+        };
+      } else {
+        Expr.find["ID"] = function (id, context) {
+          if (typeof context.getElementById !== strundefined
+              && !documentIsXML) {
+            var m = context.getElementById(id);
+
+            return m ? m.id === id || typeof m.getAttributeNode !== strundefined
+            && m.getAttributeNode("id").value === id ? [m] : undefined : [];
+          }
+        };
+        Expr.filter["ID"] = function (id) {
+          var attrId = id.replace(runescape, funescape);
+          return function (elem) {
+            var node = typeof elem.getAttributeNode !== strundefined
+                && elem.getAttributeNode("id");
+            return node && node.value === attrId;
+          };
+        };
+      }
+
+      // Tag
+      Expr.find["TAG"] = support.tagNameNoComments ? function (tag, context) {
+        if (typeof context.getElementsByTagName !== strundefined) {
+          return context.getElementsByTagName(tag);
+        }
+      } : function (tag, context) {
+        var elem,
+            tmp = [],
+            i = 0,
+            results = context.getElementsByTagName(tag);
+
+        // Filter out possible comments
+        if (tag === "*") {
+          while ((elem = results[i++])) {
+            if (elem.nodeType === 1) {
+              tmp.push(elem);
+            }
+          }
+
+          return tmp;
+        }
+        return results;
+      };
+
+      // Name
+      Expr.find["NAME"] = support.getByName && function (tag, context) {
+        if (typeof context.getElementsByName !== strundefined) {
+          return context.getElementsByName(name);
+        }
+      };
+
+      // Class
+      Expr.find["CLASS"] = support.getByClassName && function (className,
+          context) {
+        if (typeof context.getElementsByClassName !== strundefined
+            && !documentIsXML) {
+          return context.getElementsByClassName(className);
+        }
+      };
+
+      // QSA and matchesSelector support
+
+      // matchesSelector(:active) reports false when true (IE9/Opera 11.5)
+      rbuggyMatches = [];
+
+      // qSa(:focus) reports false when true (Chrome 21),
+      // no need to also add to buggyMatches since matches checks buggyQSA
+      // A support test would require too much code (would include document ready)
+      rbuggyQSA = [":focus"];
+
+      if ((support.qsa = isNative(doc.querySelectorAll))) {
+        // 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 and will not see later tests
+          if (!div.querySelectorAll(":checked").length) {
+            rbuggyQSA.push(":checked");
+          }
+        });
+
+        assert(function (div) {
+
+          // Opera 10-12/IE8 - ^= $= *= and empty values
+          // Should not select anything
+          div.innerHTML = "<input type='hidden' i=''/>";
+          if (div.querySelectorAll("[i^='']").length) {
+            rbuggyQSA.push("[*^$]=" + whitespace + "*(?:\"\"|'')");
+          }
+
+          // FF 3.5 - :enabled/:disabled and hidden elements (hidden elements are still enabled)
+          // IE8 throws error here and will not see later tests
+          if (!div.querySelectorAll(":enabled").length) {
+            rbuggyQSA.push(":enabled", ":disabled");
+          }
+
+          // Opera 10-11 does not throw on post-comma invalid pseudos
+          div.querySelectorAll("*,:x");
+          rbuggyQSA.push(",.*:");
+        });
+      }
+
+      if ((support.matchesSelector = isNative(
+              (matches = docElem.matchesSelector ||
+                  docElem.mozMatchesSelector ||
+                  docElem.webkitMatchesSelector ||
+                  docElem.oMatchesSelector ||
+                  docElem.msMatchesSelector)))) {
+
+        assert(function (div) {
+          // Check to see if it's possible to do matchesSelector
+          // on a disconnected node (IE 9)
+          support.disconnectedMatch = matches.call(div, "div");
+
+          // This should fail with an exception
+          // Gecko does not error, returns false instead
+          matches.call(div, "[s!='']:x");
+          rbuggyMatches.push("!=", pseudos);
+        });
+      }
+
+      rbuggyQSA = new RegExp(rbuggyQSA.join("|"));
+      rbuggyMatches = new RegExp(rbuggyMatches.join("|"));
+
+      // Element contains another
+      // Purposefully does not implement inclusive descendent
+      // As in, an element does not contain itself
+      contains = isNative(docElem.contains) || docElem.compareDocumentPosition
+          ? 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) : a.compareDocumentPosition
+                    && a.compareDocumentPosition(bup) & 16
+            ));
+          } : function (a, b) {
+            if (b) {
+              while ((b = b.parentNode)) {
+                if (b === a) {
+                  return true;
+                }
+              }
+            }
+            return false;
+          };
+
+      // Document order sorting
+      sortOrder = docElem.compareDocumentPosition ? function (a, b) {
+        var compare;
+
+        if (a === b) {
+          hasDuplicate = true;
+          return 0;
+        }
+
+        if ((compare = b.compareDocumentPosition && a.compareDocumentPosition
+                && a.compareDocumentPosition(b))) {
+          if (compare & 1 || a.parentNode && a.parentNode.nodeType === 11) {
+            if (a === doc || contains(preferredDoc, a)) {
+              return -1;
+            }
+            if (b === doc || contains(preferredDoc, b)) {
+              return 1;
+            }
+            return 0;
+          }
+          return compare & 4 ? -1 : 1;
+        }
+
+        return a.compareDocumentPosition ? -1 : 1;
+      } : function (a, b) {
+        var cur,
+            i = 0,
+            aup = a.parentNode,
+            bup = b.parentNode,
+            ap = [a],
+            bp = [b];
+
+        // Exit early if the nodes are identical
+        if (a === b) {
+          hasDuplicate = true;
+          return 0;
+
+          // Parentless nodes are either documents or disconnected
+        } else if (!aup || !bup) {
+          return a === doc ? -1 : b === doc ? 1 : aup ? -1 : bup ? 1 : 0;
+
+          // If the nodes are siblings, we can do a quick check
+        } else if (aup === bup) {
+          return siblingCheck(a, b);
+        }
+
+        // Otherwise we need full lists of their ancestors for comparison
+        cur = a;
+        while ((cur = cur.parentNode)) {
+          ap.unshift(cur);
+        }
+        cur = b;
+        while ((cur = cur.parentNode)) {
+          bp.unshift(cur);
+        }
+
+        // Walk down the tree looking for a discrepancy
+        while (ap[i] === bp[i]) {
+          i++;
+        }
+
+        return i ? // Do a sibling check if the nodes have a common ancestor
+            siblingCheck(ap[i], bp[i])
+            : // Otherwise nodes in our document sort first
+            ap[i] === preferredDoc ? -1 : bp[i] === preferredDoc ? 1 : 0;
+      };
+
+      // Always assume the presence of duplicates if sort doesn't
+      // pass them to our comparison function (as in Google Chrome).
+      hasDuplicate = false;
+      [0, 0].sort(sortOrder);
+      support.detectDuplicates = hasDuplicate;
+
+      return document;
+    };
+
+    Sizzle.matches = function (expr, elements) {
+      return Sizzle(expr, null, null, elements);
+    };
+
+    Sizzle.matchesSelector = function (elem, expr) {
+      // Set document vars if needed
+      if (( elem.ownerDocument || elem ) !== document) {
+        setDocument(elem);
+      }
+
+      // Make sure that attribute selectors are quoted
+      expr = expr.replace(rattributeQuotes, "='$1']");
+
+      // rbuggyQSA always contains :focus, so no need for an existence check
+      if (support.matchesSelector && !documentIsXML && (!rbuggyMatches
+              || !rbuggyMatches.test(expr)) && !rbuggyQSA.test(expr)) {
+        try {
+          var ret = matches.call(elem, expr);
+
+          // IE 9's matchesSelector returns false on disconnected nodes
+          if (ret || support.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, document, null, [elem]).length > 0;
+    };
+
+    Sizzle.contains = function (context, elem) {
+      // Set document vars if needed
+      if (( context.ownerDocument || context ) !== document) {
+        setDocument(context);
+      }
+      return contains(context, elem);
+    };
+
+    Sizzle.attr = function (elem, name) {
+      var val;
+
+      // Set document vars if needed
+      if (( elem.ownerDocument || elem ) !== document) {
+        setDocument(elem);
+      }
+
+      if (!documentIsXML) {
+        name = name.toLowerCase();
+      }
+      if ((val = Expr.attrHandle[name])) {
+        return val(elem);
+      }
+      if (documentIsXML || support.attributes) {
+        return elem.getAttribute(name);
+      }
+      return ( (val = elem.getAttributeNode(name)) || elem.getAttribute(name) )
+      && elem[name] === true ? name : val && val.specified ? val.value : null;
+    };
+
+    Sizzle.error = function (msg) {
+      throw new Error("Syntax error, unrecognized expression: " + msg);
+    };
+
+// Document sorting and removing duplicates
+    Sizzle.uniqueSort = function (results) {
+      var elem,
+          duplicates = [],
+          i = 1,
+          j = 0;
+
+      // Unless we *know* we can detect duplicates, assume their presence
+      hasDuplicate = !support.detectDuplicates;
+      results.sort(sortOrder);
+
+      if (hasDuplicate) {
+        for (; (elem = results[i]); i++) {
+          if (elem === results[i - 1]) {
+            j = duplicates.push(i);
+          }
+        }
+        while (j--) {
+          results.splice(duplicates[j], 1);
+        }
+      }
+
+      return results;
+    };
+
+    function siblingCheck(a, b) {
+      var cur = b && a,
+          diff = cur && ( ~b.sourceIndex || MAX_NEGATIVE ) - ( ~a.sourceIndex
+              || MAX_NEGATIVE );
+
+      // Use IE sourceIndex if available on both nodes
+      if (diff) {
+        return diff;
+      }
+
+      // Check if b follows a
+      if (cur) {
+        while ((cur = cur.nextSibling)) {
+          if (cur === b) {
+            return -1;
+          }
+        }
+      }
+
+      return a ? 1 : -1;
+    }
+
+// 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 no nodeType, this is expected to be an array
+        for (; (node = elem[i]); i++) {
+          // Do not traverse comment nodes
+          ret += getText(node);
+        }
+      } else 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
+
+      return ret;
+    };
+
+    Expr = Sizzle.selectors = {
+
+      // Can be adjusted by the user
+      cacheLength: 50,
+
+      createPseudo: markFunction,
+
+      match: matchExpr,
+
+      find: {},
+
+      relative: {
+        ">": {dir: "parentNode", first: true},
+        " ": {dir: "parentNode"},
+        "+": {dir: "previousSibling", first: true},
+        "~": {dir: "previousSibling"}
+      },
+
+      preFilter: {
+        "ATTR": function (match) {
+          match[1] = match[1].replace(runescape, funescape);
+
+          // Move the given value to match[3] whether quoted or unquoted
+          match[3] = ( match[4] || match[5] || "" ).replace(runescape,
+              funescape);
+
+          if (match[2] === "~=") {
+            match[3] = " " + match[3] + " ";
+          }
+
+          return match.slice(0, 4);
+        },
+
+        "CHILD": function (match) {
+          /* matches from matchExpr["CHILD"]
+				1 type (only|nth|...)
+				2 what (child|of-type)
+				3 argument (even|odd|\d*|\d*n([+-]\d+)?|...)
+				4 xn-component of xn+y argument ([+-]?\d*n|)
+				5 sign of xn-component
+				6 x of xn-component
+				7 sign of y-component
+				8 y of y-component
+			*/
+          match[1] = match[1].toLowerCase();
+
+          if (match[1].slice(0, 3) === "nth") {
+            // nth-* requires argument
+            if (!match[3]) {
+              Sizzle.error(match[0]);
+            }
+
+            // numeric x and y parameters for Expr.filter.CHILD
+            // remember that false/true cast respectively to 0/1
+            match[4] = +( match[4] ? match[5] + (match[6] || 1) : 2 * ( match[3]
+                === "even" || match[3] === "odd" ) );
+            match[5] = +( ( match[7] + match[8] ) || match[3] === "odd" );
+
+            // other types prohibit arguments
+          } else if (match[3]) {
+            Sizzle.error(match[0]);
+          }
+
+          return match;
+        },
+
+        "PSEUDO": function (match) {
+          var excess,
+              unquoted = !match[5] && match[2];
+
+          if (matchExpr["CHILD"].test(match[0])) {
+            return null;
+          }
+
+          // Accept quoted arguments as-is
+          if (match[4]) {
+            match[2] = match[4];
+
+            // Strip excess characters from unquoted arguments
+          } else if (unquoted && 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
+            match[0] = match[0].slice(0, excess);
+            match[2] = unquoted.slice(0, excess);
+          }
+
+          // Return only captures needed by the pseudo filter method (type and argument)
+          return match.slice(0, 3);
+        }
+      },
+
+      filter: {
+
+        "TAG": function (nodeName) {
+          if (nodeName === "*") {
+            return function () {
+              return true;
+            };
+          }
+
+          nodeName = nodeName.replace(runescape, funescape).toLowerCase();
+          return function (elem) {
+            return elem.nodeName && elem.nodeName.toLowerCase() === nodeName;
+          };
+        },
+
+        "CLASS": function (className) {
+          var pattern = classCache[className + " "];
+
+          return pattern ||
+              (pattern = new RegExp("(^|" + whitespace + ")" + className + "("
+                  + whitespace + "|$)")) &&
+              classCache(className, function (elem) {
+                return pattern.test(elem.className || (typeof elem.getAttribute
+                    !== strundefined && elem.getAttribute("class")) || "");
+              });
+        },
+
+        "ATTR": function (name, operator, check) {
+          return function (elem) {
+            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.slice(-check.length) === check : operator === "~="
+                    ? ( " " + result + " " ).indexOf(check) > -1 : operator
+                    === "|=" ? result === check || result.slice(0, check.length
+                        + 1) === check + "-" : false;
+          };
+        },
+
+        "CHILD": function (type, what, argument, first, last) {
+          var simple = type.slice(0, 3) !== "nth",
+              forward = type.slice(-4) !== "last",
+              ofType = what === "of-type";
+
+          return first === 1 && last === 0 ? // Shortcut for :nth-*(n)
+              function (elem) {
+                return !!elem.parentNode;
+              } : function (elem, context, xml) {
+                var cache, outerCache, node, diff, nodeIndex, start,
+                    dir = simple !== forward ? "nextSibling"
+                        : "previousSibling",
+                    parent = elem.parentNode,
+                    name = ofType && elem.nodeName.toLowerCase(),
+                    useCache = !xml && !ofType;
+
+                if (parent) {
+
+                  // :(first|last|only)-(child|of-type)
+                  if (simple) {
+                    while (dir) {
+                      node = elem;
+                      while ((node = node[dir])) {
+                        if (ofType ? node.nodeName.toLowerCase() === name
+                                : node.nodeType === 1) {
+                          return false;
+                        }
+                      }
+                      // Reverse direction for :only-* (if we haven't yet done so)
+                      start = dir = type === "only" && !start && "nextSibling";
+                    }
+                    return true;
+                  }
+
+                  start = [forward ? parent.firstChild : parent.lastChild];
+
+                  // non-xml :nth-child(...) stores cache data on `parent`
+                  if (forward && useCache) {
+                    // Seek `elem` from a previously-cached index
+                    outerCache = parent[expando] || (parent[expando] = {});
+                    cache = outerCache[type] || [];
+                    nodeIndex = cache[0] === dirruns && cache[1];
+                    diff = cache[0] === dirruns && cache[2];
+                    node = nodeIndex && parent.childNodes[nodeIndex];
+
+                    while ((node = ++nodeIndex && node && node[dir] ||
+
+                        // Fallback to seeking `elem` from the start
+                        (diff = nodeIndex = 0) || start.pop())) {
+
+                      // When found, cache indexes on `parent` and break
+                      if (node.nodeType === 1 && ++diff && node === elem) {
+                        outerCache[type] = [dirruns, nodeIndex, diff];
+                        break;
+                      }
+                    }
+
+                    // Use previously-cached element index if available
+                  } else if (useCache && (cache = (elem[expando]
+                          || (elem[expando] = {}))[type]) && cache[0]
+                      === dirruns) {
+                    diff = cache[1];
+
+                    // xml :nth-child(...) or :nth-last-child(...) or :nth(-last)?-of-type(...)
+                  } else {
+                    // Use the same loop as above to seek `elem` from the start
+                    while ((node = ++nodeIndex && node && node[dir] ||
+                        (diff = nodeIndex = 0) || start.pop())) {
+
+                      if (( ofType ? node.nodeName.toLowerCase() === name
+                              : node.nodeType === 1 ) && ++diff) {
+                        // Cache the index of each encountered element
+                        if (useCache) {
+                          (node[expando]
+                              || (node[expando] = {}))[type] = [dirruns, diff];
+                        }
+
+                        if (node === elem) {
+                          break;
+                        }
+                      }
+                    }
+                  }
+
+                  // Incorporate the offset, then check against cycle size
+                  diff -= last;
+                  return diff === first || ( diff % first === 0 && diff / first
+                      >= 0 );
+                }
+              };
+        },
+
+        "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: {
+        // Potentially complex 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;
+          };
+        }),
+
+        // "Whether an element is represented by a :lang() selector
+        // is based solely on the element's language value
+        // being equal to the identifier C,
+        // or beginning with the identifier C immediately followed by "-".
+        // The matching of C against the element's language value is performed case-insensitively.
+        // The identifier C does not have to be a valid language name."
+        // http://www.w3.org/TR/selectors/#lang-pseudo
+        "lang": markFunction(function (lang) {
+          // lang value must be a valid identifider
+          if (!ridentifier.test(lang || "")) {
+            Sizzle.error("unsupported lang: " + lang);
+          }
+          lang = lang.replace(runescape, funescape).toLowerCase();
+          return function (elem) {
+            var elemLang;
+            do {
+              if ((elemLang = documentIsXML ? elem.getAttribute("xml:lang")
+                      || elem.getAttribute("lang") : elem.lang)) {
+
+                elemLang = elemLang.toLowerCase();
+                return elemLang === lang || elemLang.indexOf(lang + "-") === 0;
+              }
+            } while ((elem = elem.parentNode) && elem.nodeType === 1);
+            return false;
+          };
+        }),
+
+        // Miscellaneous
+        "target": function (elem) {
+          var hash = window.location && window.location.hash;
+          return hash && hash.slice(1) === elem.id;
+        },
+
+        "root": function (elem) {
+          return elem === docElem;
+        },
+
+        "focus": function (elem) {
+          return elem === document.activeElement && (!document.hasFocus
+              || document.hasFocus()) && !!(elem.type || elem.href
+              || ~elem.tabIndex);
+        },
+
+        // Boolean properties
+        "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;
+        },
+
+        // Contents
+        "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 "?")
+          for (elem = elem.firstChild; elem; elem = elem.nextSibling) {
+            if (elem.nodeName > "@" || elem.nodeType === 3 || elem.nodeType
+                === 4) {
+              return false;
+            }
+          }
+          return true;
+        },
+
+        "parent": function (elem) {
+          return !Expr.pseudos["empty"](elem);
+        },
+
+        // Element/input types
+        "header": function (elem) {
+          return rheader.test(elem.nodeName);
+        },
+
+        "input": function (elem) {
+          return rinputs.test(elem.nodeName);
+        },
+
+        "button": function (elem) {
+          var name = elem.nodeName.toLowerCase();
+          return name === "input" && elem.type === "button" || name
+              === "button";
+        },
+
+        "text": function (elem) {
+          var 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" &&
+              elem.type === "text" &&
+              ( (attr = elem.getAttribute("type")) == null || attr.toLowerCase()
+                  === elem.type );
+        },
+
+        // Position-in-collection
+        "first": createPositionalPseudo(function () {
+          return [0];
+        }),
+
+        "last": createPositionalPseudo(function (matchIndexes, length) {
+          return [length - 1];
+        }),
+
+        "eq": createPositionalPseudo(function (matchIndexes, length, argument) {
+          return [argument < 0 ? argument + length : argument];
+        }),
+
+        "even": createPositionalPseudo(function (matchIndexes, length) {
+          var i = 0;
+          for (; i < length; i += 2) {
+            matchIndexes.push(i);
+          }
+          return matchIndexes;
+        }),
+
+        "odd": createPositionalPseudo(function (matchIndexes, length) {
+          var i = 1;
+          for (; i < length; i += 2) {
+            matchIndexes.push(i);
+          }
+          return matchIndexes;
+        }),
+
+        "lt": createPositionalPseudo(function (matchIndexes, length, argument) {
+          var i = argument < 0 ? argument + length : argument;
+          for (; --i >= 0;) {
+            matchIndexes.push(i);
+          }
+          return matchIndexes;
+        }),
+
+        "gt": createPositionalPseudo(function (matchIndexes, length, argument) {
+          var i = argument < 0 ? argument + length : argument;
+          for (; ++i < length;) {
+            matchIndexes.push(i);
+          }
+          return matchIndexes;
+        })
+      }
+    };
+
+// Add button/input type pseudos
+    for (i in{
+      radio: true,
+      checkbox: true,
+      file: true,
+      password: true,
+      image: true
+    }) {
+      Expr.pseudos[i] = createInputPseudo(i);
+    }
+    for (i in {submit: true, reset: true}) {
+      Expr.pseudos[i] = createButtonPseudo(i);
+    }
+
+    function tokenize(selector, parseOnly) {
+      var matched, match, tokens, type,
+          soFar, groups, preFilters,
+          cached = tokenCache[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) {
+            // Don't consume trailing commas as valid
+            soFar = soFar.slice(match[0].length) || soFar;
+          }
+          groups.push(tokens = []);
+        }
+
+        matched = false;
+
+        // Combinators
+        if ((match = rcombinators.exec(soFar))) {
+          matched = match.shift();
+          tokens.push({
+            value: matched,
+            // Cast descendant combinators to space
+            type: match[0].replace(rtrim, " ")
+          });
+          soFar = soFar.slice(matched.length);
+        }
+
+        // Filters
+        for (type in Expr.filter) {
+          if ((match = matchExpr[type].exec(soFar)) && (!preFilters[type] ||
+                  (match = preFilters[type](match)))) {
+            matched = match.shift();
+            tokens.push({
+              value: matched,
+              type: type,
+              matches: match
+            });
+            soFar = soFar.slice(matched.length);
+          }
+        }
+
+        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 toSelector(tokens) {
+      var i = 0,
+          len = tokens.length,
+          selector = "";
+      for (; i < len; i++) {
+        selector += tokens[i].value;
+      }
+      return selector;
+    }
+
+    function addCombinator(matcher, combinator, base) {
+      var dir = combinator.dir,
+          checkNonElements = base && dir === "parentNode",
+          doneName = done++;
+
+      return combinator.first
+          ? // Check against closest ancestor/preceding element
+          function (elem, context, xml) {
+            while ((elem = elem[dir])) {
+              if (elem.nodeType === 1 || checkNonElements) {
+                return matcher(elem, context, xml);
+              }
+            }
+          } : // Check against all ancestor/preceding elements
+          function (elem, context, xml) {
+            var data, cache, outerCache,
+                dirkey = dirruns + " " + doneName;
+
+            // We can't set arbitrary data on XML nodes, so they don't benefit from dir caching
+            if (xml) {
+              while ((elem = elem[dir])) {
+                if (elem.nodeType === 1 || checkNonElements) {
+                  if (matcher(elem, context, xml)) {
+                    return true;
+                  }
+                }
+              }
+            } else {
+              while ((elem = elem[dir])) {
+                if (elem.nodeType === 1 || checkNonElements) {
+                  outerCache = elem[expando] || (elem[expando] = {});
+                  if ((cache = outerCache[dir]) && cache[0] === dirkey) {
+                    if ((data = cache[1]) === true || data === cachedruns) {
+                      return data === true;
+                    }
+                  } else {
+                    cache = outerCache[dir] = [dirkey];
+                    cache[1] = matcher(elem, context, xml) || cachedruns;
+                    if (cache[1] === true) {
+                      return true;
+                    }
+                  }
+                }
+              }
+            }
+          };
+    }
+
+    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) {
+        var temp, i, elem,
+            preMap = [],
+            postMap = [],
+            preexisting = results.length,
+
+            // Get initial elements from seed or context
+            elems = seed || multipleContexts(selector || "*",
+                context.nodeType ? [context] : context, []),
+
+            // 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) {
+          temp = condense(matcherOut, postMap);
+          postFilter(temp, [], context, xml);
+
+          // Un-match failing elements by moving them back to matcherIn
+          i = temp.length;
+          while (i--) {
+            if ((elem = temp[i])) {
+              matcherOut[postMap[i]] = !(matcherIn[postMap[i]] = elem);
+            }
+          }
+        }
+
+        if (seed) {
+          if (postFinder || preFilter) {
+            if (postFinder) {
+              // Get the final matcherOut by condensing this intermediate into postFinder contexts
+              temp = [];
+              i = matcherOut.length;
+              while (i--) {
+                if ((elem = matcherOut[i])) {
+                  // Restore matcherIn since elem is not yet a final match
+                  temp.push((matcherIn[i] = elem));
+                }
+              }
+              postFinder(null, (matcherOut = []), temp, xml);
+            }
+
+            // Move matched elements from seed to results to keep them synchronized
+            i = matcherOut.length;
+            while (i--) {
+              if ((elem = matcherOut[i]) &&
+                  (temp = postFinder ? indexOf.call(seed, elem) : preMap[i])
+                  > -1) {
+
+                seed[temp] = !(results[temp] = elem);
+              }
+            }
+          }
+
+          // Add elements to results, through postFinder if defined
+        } 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 {
+          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 && toSelector(tokens.slice(0, i - 1)).replace(rtrim,
+                "$1"),
+                matcher,
+                i < j && matcherFromTokens(tokens.slice(i, j)),
+                j < len && matcherFromTokens((tokens = tokens.slice(j))),
+                j < len && toSelector(tokens)
+            );
+          }
+          matchers.push(matcher);
+        }
+      }
+
+      return elementMatcher(matchers);
+    }
+
+    function matcherFromGroupMatchers(elementMatchers, setMatchers) {
+      // A counter to specify which element is currently being matched
+      var matcherCachedRuns = 0,
+          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),
+                // Use integer dirruns iff this is the outermost matcher
+                dirrunsUnique = (dirruns += contextBackup == null ? 1
+                    : Math.random() || 0.1);
+
+            if (outermost) {
+              outermostContext = context !== document && context;
+              cachedruns = matcherCachedRuns;
+            }
+
+            // Add elements passing elementMatchers directly to results
+            // Keep `i` a string if there are no elements so `matchedCount` will be "00" below
+            for (; (elem = elems[i]) != null; i++) {
+              if (byElement && elem) {
+                j = 0;
+                while ((matcher = elementMatchers[j++])) {
+                  if (matcher(elem, context, xml)) {
+                    results.push(elem);
+                    break;
+                  }
+                }
+                if (outermost) {
+                  dirruns = dirrunsUnique;
+                  cachedruns = ++matcherCachedRuns;
+                }
+              }
+
+              // 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) {
+              j = 0;
+              while ((matcher = setMatchers[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;
+          };
+
+      return bySet ? markFunction(superMatcher) : superMatcher;
+    }
+
+    compile = Sizzle.compile = function (selector, group
+        /* Internal Use Only */) {
+      var i,
+          setMatchers = [],
+          elementMatchers = [],
+          cached = compilerCache[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) {
+      var i = 0,
+          len = contexts.length;
+      for (; i < len; i++) {
+        Sizzle(selector, contexts[i], results);
+      }
+      return results;
+    }
+
+    function select(selector, context, results, seed) {
+      var i, tokens, token, type, find,
+          match = tokenize(selector);
+
+      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 && !documentIsXML &&
+              Expr.relative[tokens[1].type]) {
+
+            context = Expr.find["ID"](
+                token.matches[0].replace(runescape, funescape), context)[0];
+            if (!context) {
+              return results;
+            }
+
+            selector = selector.slice(tokens.shift().value.length);
+          }
+
+          // Fetch a seed set for right-to-left matching
+          i = matchExpr["needsContext"].test(selector) ? 0 : tokens.length;
+          while (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(runescape, funescape),
+                      rsibling.test(tokens[0].type) && context.parentNode
+                      || context
+                  ))) {
+
+                // If seed is empty or no tokens remain, we can return early
+                tokens.splice(i, 1);
+                selector = seed.length && toSelector(tokens);
+                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,
+          documentIsXML,
+          results,
+          rsibling.test(selector)
+      );
+      return results;
+    }
+
+// Deprecated
+    Expr.pseudos["nth"] = Expr.pseudos["eq"];
+
+// Easy API for creating new setFilters
+    function setFilters() {
+    }
+
+    Expr.filters = setFilters.prototype = Expr.pseudos;
+    Expr.setFilters = new setFilters();
+
+// Initialize with the default document
+    setDocument();
+
+// 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, ret, self,
+          len = this.length;
+
+      if (typeof selector !== "string") {
+        self = this;
+        return this.pushStack(jQuery(selector).filter(function () {
+          for (i = 0; i < len; i++) {
+            if (jQuery.contains(self[i], this)) {
+              return true;
+            }
+          }
+        }));
+      }
+
+      ret = [];
+      for (i = 0; i < len; i++) {
+        jQuery.find(selector, this[i], ret);
+      }
+
+      // Needed because $( selector, context ) becomes $( context ).find( selector )
+      ret = this.pushStack(len > 1 ? jQuery.unique(ret) : ret);
+      ret.selector = ( this.selector ? this.selector + " " : "" ) + selector;
+      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));
+    },
+
+    filter: function (selector) {
+      return this.pushStack(winnow(this, selector, true));
+    },
+
+    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;
+        }
+      }
+
+      return this.pushStack(ret.length > 1 ? jQuery.unique(ret) : ret);
+    },
+
+    // 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.first().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(jQuery.unique(all));
+    },
+
+    addBack: function (selector) {
+      return this.add(
+          selector == null ? this.prevObject : this.prevObject.filter(selector)
+      );
+    }
+  });
+
+  jQuery.fn.andSelf = jQuery.fn.addBack;
+
+  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);
+    };
+  });
+
+  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) {
+        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) {
+      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,
+      rnoshimcache = new RegExp("<(?:" + nodeNames + ")[\\s/>]", "i"),
+      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,
+      manipulation_rcheckableType = /^(?:checkbox|radio)$/i,
+      // checked="checked" or checked
+      rchecked = /checked\s*(?:[^=]|=\s*.checked.)/i,
+      rscriptType = /^$|\/(?:java|ecma)script/i,
+      rscriptTypeMasked = /^true\/(.*)/,
+      rcleanScript = /^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g,
+
+      // We have to close these tags to support XHTML (#13200)
+      wrapMap = {
+        option: [1, "<select multiple='multiple'>", "</select>"],
+        legend: [1, "<fieldset>", "</fieldset>"],
+        area: [1, "<map>", "</map>"],
+        param: [1, "<object>", "</object>"],
+        thead: [1, "<table>", "</table>"],
+        tr: [2, "<table><tbody>", "</tbody></table>"],
+        col: [2, "<table><tbody></tbody><colgroup>", "</colgroup></table>"],
+        td: [3, "<table><tbody><tr>", "</tr></tbody></table>"],
+
+        // 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.
+        _default: jQuery.support.htmlSerialize ? [0, "", ""] : [1, "X<div>",
+          "</div>"]
+      },
+      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;
+
+  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.nodeType
+            === 9) {
+          this.appendChild(elem);
+        }
+      });
+    },
+
+    prepend: function () {
+      return this.domManip(arguments, true, function (elem) {
+        if (this.nodeType === 1 || this.nodeType === 11 || this.nodeType
+            === 9) {
+          this.insertBefore(elem, this.firstChild);
+        }
+      });
+    },
+
+    before: function () {
+      return this.domManip(arguments, false, function (elem) {
+        if (this.parentNode) {
+          this.parentNode.insertBefore(elem, this);
+        }
+      });
+    },
+
+    after: function () {
+      return this.domManip(arguments, false, function (elem) {
+        if (this.parentNode) {
+          this.parentNode.insertBefore(elem, this.nextSibling);
+        }
+      });
+    },
+
+    // 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 > 0) {
+          if (!keepData && elem.nodeType === 1) {
+            jQuery.cleanData(getAll(elem));
+          }
+
+          if (elem.parentNode) {
+            if (keepData && jQuery.contains(elem.ownerDocument, elem)) {
+              setGlobalEval(getAll(elem, "script"));
+            }
+            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(getAll(elem, false));
+        }
+
+        // Remove any remaining nodes
+        while (elem.firstChild) {
+          elem.removeChild(elem.firstChild);
+        }
+
+        // If this is a select, ensure that it displays empty (#12336)
+        // Support: IE<9
+        if (elem.options && jQuery.nodeName(elem, "select")) {
+          elem.options.length = 0;
+        }
+      }
+
+      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(getAll(elem, false));
+                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) {
+      var isFunc = jQuery.isFunction(value);
+
+      // 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 (!isFunc && typeof value !== "string") {
+        value = jQuery(value).not(this).detach();
+      }
+
+      return this.domManip([value], true, function (elem) {
+        var next = this.nextSibling,
+            parent = this.parentNode;
+
+        if (parent) {
+          jQuery(this).remove();
+          parent.insertBefore(elem, next);
+        }
+      });
+    },
+
+    detach: function (selector) {
+      return this.remove(selector, true);
+    },
+
+    domManip: function (args, table, callback) {
+
+      // Flatten any nested arrays
+      args = core_concat.apply([], args);
+
+      var first, node, hasScripts,
+          scripts, doc, fragment,
+          i = 0,
+          l = this.length,
+          set = this,
+          iNoClone = l - 1,
+          value = args[0],
+          isFunction = jQuery.isFunction(value);
+
+      // We can't cloneNode fragments that contain checked, in WebKit
+      if (isFunction || !( l <= 1 || typeof value !== "string"
+              || jQuery.support.checkClone || !rchecked.test(value) )) {
+        return this.each(function (index) {
+          var self = set.eq(index);
+          if (isFunction) {
+            args[0] = value.call(this, index, table ? self.html() : undefined);
+          }
+          self.domManip(args, table, callback);
+        });
+      }
+
+      if (l) {
+        fragment = jQuery.buildFragment(args, this[0].ownerDocument, false,
+            this);
+        first = fragment.firstChild;
+
+        if (fragment.childNodes.length === 1) {
+          fragment = first;
+        }
+
+        if (first) {
+          table = table && jQuery.nodeName(first, "tr");
+          scripts = jQuery.map(getAll(fragment, "script"), disableScript);
+          hasScripts = scripts.length;
+
+          // Use the original fragment for the last item instead of the first because it can end up
+          // being emptied incorrectly in certain situations (#8070).
+          for (; i < l; i++) {
+            node = fragment;
+
+            if (i !== iNoClone) {
+              node = jQuery.clone(node, true, true);
+
+              // Keep references to cloned scripts for later restoration
+              if (hasScripts) {
+                jQuery.merge(scripts, getAll(node, "script"));
+              }
+            }
+
+            callback.call(
+                table && jQuery.nodeName(this[i], "table") ? findOrAppend(
+                    this[i], "tbody") : this[i],
+                node,
+                i
+            );
+          }
+
+          if (hasScripts) {
+            doc = scripts[scripts.length - 1].ownerDocument;
+
+            // Reenable scripts
+            jQuery.map(scripts, restoreScript);
+
+            // Evaluate executable scripts on first document insertion
+            for (i = 0; i < hasScripts; i++) {
+              node = scripts[i];
+              if (rscriptType.test(node.type || "") &&
+                  !jQuery._data(node, "globalEval") && jQuery.contains(doc,
+                      node)) {
+
+                if (node.src) {
+                  // Hope ajax is available...
+                  jQuery.ajax({
+                    url: node.src,
+                    type: "GET",
+                    dataType: "script",
+                    async: false,
+                    global: false,
+                    "throws": true
+                  });
+                } else {
+                  jQuery.globalEval(
+                      ( node.text || node.textContent || node.innerHTML
+                          || "" ).replace(rcleanScript, ""));
+                }
+              }
+            }
+          }
+
+          // Fix #11809: Avoid leaking memory
+          fragment = first = null;
+        }
+      }
+
+      return this;
+    }
+  });
+
+  function findOrAppend(elem, tag) {
+    return elem.getElementsByTagName(tag)[0] || elem.appendChild(
+        elem.ownerDocument.createElement(tag));
+  }
+
+// Replace/restore the type attribute of script elements for safe DOM manipulation
+  function disableScript(elem) {
+    var attr = elem.getAttributeNode("type");
+    elem.type = ( attr && attr.specified ) + "/" + elem.type;
+    return elem;
+  }
+
+  function restoreScript(elem) {
+    var match = rscriptTypeMasked.exec(elem.type);
+    if (match) {
+      elem.type = match[1];
+    } else {
+      elem.removeAttribute("type");
+    }
+    return elem;
+  }
+
+// Mark scripts as having already been evaluated
+  function setGlobalEval(elems, refElements) {
+    var elem,
+        i = 0;
+    for (; (elem = elems[i]) != null; i++) {
+      jQuery._data(elem, "globalEval", !refElements || jQuery._data(
+          refElements[i], "globalEval"));
+    }
+  }
+
+  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 fixCloneNodeIssues(src, dest) {
+    var nodeName, e, data;
+
+    // We do not need to do anything for non-Elements
+    if (dest.nodeType !== 1) {
+      return;
+    }
+
+    nodeName = dest.nodeName.toLowerCase();
+
+    // IE6-8 copies events bound via attachEvent when using cloneNode.
+    if (!jQuery.support.noCloneEvent && dest[jQuery.expando]) {
+      data = jQuery._data(dest);
+
+      for (e in data.events) {
+        jQuery.removeEvent(dest, e, data.handle);
+      }
+
+      // Event data gets referenced instead of copied if the expando gets copied too
+      dest.removeAttribute(jQuery.expando);
+    }
+
+    // IE blanks contents when cloning scripts, and tries to evaluate newly-set text
+    if (nodeName === "script" && dest.text !== src.text) {
+      disableScript(dest).text = src.text;
+      restoreScript(dest);
+
+      // IE6-10 improperly clones children of object elements using classid.
+      // IE10 throws NoModificationAllowedError if parent is null, #12132.
+    } else if (nodeName === "object") {
+      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" && manipulation_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.defaultSelected = 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;
+    }
+  }
+
+  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),
+          last = insert.length - 1;
+
+      for (; i <= last; i++) {
+        elems = i === last ? this : this.clone(true);
+        jQuery(insert[i])[original](elems);
+
+        // Modern browsers can apply jQuery collections as arrays, but oldIE needs a .get()
+        core_push.apply(ret, elems.get());
+      }
+
+      return this.pushStack(ret);
+    };
+  });
+
+  function getAll(context, tag) {
+    var elems, elem,
+        i = 0,
+        found = typeof context.getElementsByTagName !== core_strundefined
+            ? context.getElementsByTagName(tag || "*")
+            : typeof context.querySelectorAll !== core_strundefined
+                ? context.querySelectorAll(tag || "*") : undefined;
+
+    if (!found) {
+      for (found = [], elems = context.childNodes || context;
+          (elem = elems[i]) != null; i++) {
+        if (!tag || jQuery.nodeName(elem, tag)) {
+          found.push(elem);
+        } else {
+          jQuery.merge(found, getAll(elem, tag));
+        }
+      }
+    }
+
+    return tag === undefined || tag && jQuery.nodeName(context, tag)
+        ? jQuery.merge([context], found) : found;
+  }
+
+// Used in buildFragment, fixes the defaultChecked property
+  function fixDefaultChecked(elem) {
+    if (manipulation_rcheckableType.test(elem.type)) {
+      elem.defaultChecked = elem.checked;
+    }
+  }
+
+  jQuery.extend({
+    clone: function (elem, dataAndEvents, deepDataAndEvents) {
+      var destElements, node, clone, i, srcElements,
+          inPage = jQuery.contains(elem.ownerDocument, elem);
+
+      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)) {
+
+        // We eschew Sizzle here for performance reasons: http://jsperf.com/getall-vs-sizzle/2
+        destElements = getAll(clone);
+        srcElements = getAll(elem);
+
+        // Fix all IE cloning issues
+        for (i = 0; (node = srcElements[i]) != null; ++i) {
+          // Ensure that the destination node is not null; Fixes #9587
+          if (destElements[i]) {
+            fixCloneNodeIssues(node, destElements[i]);
+          }
+        }
+      }
+
+      // Copy the events from the original to the clone
+      if (dataAndEvents) {
+        if (deepDataAndEvents) {
+          srcElements = srcElements || getAll(elem);
+          destElements = destElements || getAll(clone);
+
+          for (i = 0; (node = srcElements[i]) != null; i++) {
+            cloneCopyEvent(node, destElements[i]);
+          }
+        } else {
+          cloneCopyEvent(elem, clone);
+        }
+      }
+
+      // Preserve script evaluation history
+      destElements = getAll(clone, "script");
+      if (destElements.length > 0) {
+        setGlobalEval(destElements, !inPage && getAll(elem, "script"));
+      }
+
+      destElements = srcElements = node = null;
+
+      // Return the cloned set
+      return clone;
+    },
+
+    buildFragment: function (elems, context, scripts, selection) {
+      var j, elem, contains,
+          tmp, tag, tbody, wrap,
+          l = elems.length,
+
+          // Ensure a safe fragment
+          safe = createSafeFragment(context),
+
+          nodes = [],
+          i = 0;
+
+      for (; i < l; i++) {
+        elem = elems[i];
+
+        if (elem || elem === 0) {
+
+          // Add nodes directly
+          if (jQuery.type(elem) === "object") {
+            jQuery.merge(nodes, elem.nodeType ? [elem] : elem);
+
+            // Convert non-html into a text node
+          } else if (!rhtml.test(elem)) {
+            nodes.push(context.createTextNode(elem));
+
+            // Convert html into DOM nodes
+          } else {
+            tmp = tmp || safe.appendChild(context.createElement("div"));
+
+            // Deserialize a standard representation
+            tag = ( rtagName.exec(elem) || ["", ""] )[1].toLowerCase();
+            wrap = wrapMap[tag] || wrapMap._default;
+
+            tmp.innerHTML = wrap[1] + elem.replace(rxhtmlTag, "<$1></$2>")
+                + wrap[2];
+
+            // Descend through wrappers to the right content
+            j = wrap[0];
+            while (j--) {
+              tmp = tmp.lastChild;
+            }
+
+            // Manually add leading whitespace removed by IE
+            if (!jQuery.support.leadingWhitespace && rleadingWhitespace.test(
+                    elem)) {
+              nodes.push(
+                  context.createTextNode(rleadingWhitespace.exec(elem)[0]));
+            }
+
+            // Remove IE's autoinserted <tbody> from table fragments
+            if (!jQuery.support.tbody) {
+
+              // String was a <table>, *may* have spurious <tbody>
+              elem = tag === "table" && !rtbody.test(elem) ? tmp.firstChild
+                  : // String was a bare <thead> or <tfoot>
+                  wrap[1] === "<table>" && !rtbody.test(elem) ? tmp : 0;
+
+              j = elem && elem.childNodes.length;
+              while (j--) {
+                if (jQuery.nodeName((tbody = elem.childNodes[j]), "tbody")
+                    && !tbody.childNodes.length) {
+                  elem.removeChild(tbody);
+                }
+              }
+            }
+
+            jQuery.merge(nodes, tmp.childNodes);
+
+            // Fix #12392 for WebKit and IE > 9
+            tmp.textContent = "";
+
+            // Fix #12392 for oldIE
+            while (tmp.firstChild) {
+              tmp.removeChild(tmp.firstChild);
+            }
+
+            // Remember the top-level container for proper cleanup
+            tmp = safe.lastChild;
+          }
+        }
+      }
+
+      // Fix #11356: Clear elements from fragment
+      if (tmp) {
+        safe.removeChild(tmp);
+      }
+
+      // Reset defaultChecked for any radios and checkboxes
+      // about to be appended to the DOM in IE 6/7 (#8060)
+      if (!jQuery.support.appendChecked) {
+        jQuery.grep(getAll(nodes, "input"), fixDefaultChecked);
+      }
+
+      i = 0;
+      while ((elem = nodes[i++])) {
+
+        // #4087 - If origin and destination elements are the same, and this is
+        // that element, do not do anything
+        if (selection && jQuery.inArray(elem, selection) !== -1) {
+          continue;
+        }
+
+        contains = jQuery.contains(elem.ownerDocument, elem);
+
+        // Append to fragment
+        tmp = getAll(safe.appendChild(elem), "script");
+
+        // Preserve script evaluation history
+        if (contains) {
+          setGlobalEval(tmp);
+        }
+
+        // Capture executables
+        if (scripts) {
+          j = 0;
+          while ((elem = tmp[j++])) {
+            if (rscriptType.test(elem.type || "")) {
+              scripts.push(elem);
+            }
+          }
+        }
+      }
+
+      tmp = null;
+
+      return safe;
+    },
+
+    cleanData: function (elems, /* internal */ acceptData) {
+      var elem, type, id, data,
+          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 (typeof elem.removeAttribute !== core_strundefined) {
+                elem.removeAttribute(internalKey);
+
+              } else {
+                elem[internalKey] = null;
+              }
+
+              core_deletedIds.push(id);
+            }
+          }
+        }
+      }
+    }
+  });
+  var iframe, getStyles, curCSS,
+      ralpha = /alpha\([^)]*\)/i,
+      ropacity = /opacity\s*=\s*([^)]*)/,
+      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 = {BODY: "block"},
+
+      cssShow = {position: "absolute", visibility: "hidden", display: "block"},
+      cssNormalTransform = {
+        letterSpacing: 0,
+        fontWeight: 400
+      },
+
+      cssExpand = ["Top", "Right", "Bottom", "Left"],
+      cssPrefixes = ["Webkit", "O", "Moz", "ms"];
+
+// 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) {
+    // isHidden might be called from jQuery#filter function;
+    // in that case, element will be second argument
+    elem = el || elem;
+    return jQuery.css(elem, "display") === "none" || !jQuery.contains(
+        elem.ownerDocument, elem);
+  }
+
+  function showHide(elements, show) {
+    var display, elem, hidden,
+        values = [],
+        index = 0,
+        length = elements.length;
+
+    for (; index < length; index++) {
+      elem = elements[index];
+      if (!elem.style) {
+        continue;
+      }
+
+      values[index] = jQuery._data(elem, "olddisplay");
+      display = elem.style.display;
+      if (show) {
+        // Reset the inline display of this element to learn if it is
+        // being hidden by cascaded rules or not
+        if (!values[index] && 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 {
+
+        if (!values[index]) {
+          hidden = isHidden(elem);
+
+          if (display && display !== "none" || !hidden) {
+            jQuery._data(elem, "olddisplay",
+                hidden ? display : jQuery.css(elem, "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) {
+        var len, styles,
+            map = {},
+            i = 0;
+
+        if (jQuery.isArray(name)) {
+          styles = getStyles(elem);
+          len = name.length;
+
+          for (; i < len; i++) {
+            map[name[i]] = jQuery.css(elem, name[i], false, styles);
+          }
+
+          return map;
+        }
+
+        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) {
+      var bool = typeof state === "boolean";
+
+      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: {
+      "columnCount": true,
+      "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";
+        }
+
+        // Fixes #8908, it can be done more correctly by specifing setters in cssHooks,
+        // but it would mean to define eight (for every problematic property) identical functions
+        if (!jQuery.support.clearCloneStyle && value === "" && name.indexOf(
+                "background") === 0) {
+          style[name] = "inherit";
+        }
+
+        // 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, extra, styles) {
+      var num, val, 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, styles);
+      }
+
+      //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 (extra === "" || extra) {
+        num = parseFloat(val);
+        return extra === true || 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, args) {
+      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.apply(elem, args || []);
+
+      // Revert the old values
+      for (name in options) {
+        elem.style[name] = old[name];
+      }
+
+      return ret;
+    }
+  });
+
+// NOTE: we've included the "window" in window.getComputedStyle
+// because jsdom on node.js will break without it.
+  if (window.getComputedStyle) {
+    getStyles = function (elem) {
+      return window.getComputedStyle(elem, null);
+    };
+
+    curCSS = function (elem, name, _computed) {
+      var width, minWidth, maxWidth,
+          computed = _computed || getStyles(elem),
+
+          // getPropertyValue is only needed for .css('filter') in IE9, see #12537
+          ret = computed ? computed.getPropertyValue(name) || computed[name]
+              : undefined,
+          style = elem.style;
+
+      if (computed) {
+
+        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)) {
+
+          // Remember the original values
+          width = style.width;
+          minWidth = style.minWidth;
+          maxWidth = style.maxWidth;
+
+          // Put in the new values to get a computed value out
+          style.minWidth = style.maxWidth = style.width = ret;
+          ret = computed.width;
+
+          // Revert the changed values
+          style.width = width;
+          style.minWidth = minWidth;
+          style.maxWidth = maxWidth;
+        }
+      }
+
+      return ret;
+    };
+  } else if (document.documentElement.currentStyle) {
+    getStyles = function (elem) {
+      return elem.currentStyle;
+    };
+
+    curCSS = function (elem, name, _computed) {
+      var left, rs, rsLeft,
+          computed = _computed || getStyles(elem),
+          ret = computed ? computed[name] : undefined,
+          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];
+      }
 
-// fix oldIE value attroperty
-if ( !getSetInput || !getSetAttribute ) {
-	jQuery.attrHooks.value = {
-		get: function( elem, name ) {
-			var ret = elem.getAttributeNode( name );
-			return jQuery.nodeName( elem, "input" ) ?
-
-				// Ignore the value *property* by using defaultValue
-				elem.defaultValue :
-
-				ret && ret.specified ? ret.value : undefined;
-		},
-		set: function( elem, value, name ) {
-			if ( jQuery.nodeName( elem, "input" ) ) {
-				// Does not return so that setAttribute is also used
-				elem.defaultValue = value;
-			} else {
-				// Use nodeHook if defined (#1954); otherwise setAttribute is fine
-				return nodeHook && nodeHook.set( elem, value, name );
-			}
-		}
-	};
-}
+      // From the awesome hack by Dean Edwards
+      // http://erik.eae.net/archives/2007/07/27/18.54.15/#comment-102291
 
-// IE6/7 do not support getting/setting some attributes with get/setAttribute
-if ( !getSetAttribute ) {
-
-	// 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 = elem.getAttributeNode( name );
-			return ret && ( name === "id" || name === "name" || name === "coords" ? 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 ) {
-				elem.setAttributeNode(
-					(ret = elem.ownerDocument.createAttribute( name ))
-				);
-			}
-
-			ret.value = value += "";
-
-			// Break association with cloned elements by also using setAttribute (#9646)
-			return name === "value" || value === elem.getAttribute( name ) ?
-				value :
-				undefined;
-		}
-	};
-
-	// 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 ) {
-			nodeHook.set( elem, value === "" ? false : value, name );
-		}
-	};
-
-	// 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;
-				}
-			}
-		});
-	});
-}
+      // 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;
+        rs = elem.runtimeStyle;
+        rsLeft = rs && rs.left;
 
-// Some attributes require a special call on IE
-// http://msdn.microsoft.com/en-us/library/ms536429%28VS.85%29.aspx
-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;
-			}
-		});
-	});
-
-	// href/src property should get the full normalized URL (#10299/#12915)
-	jQuery.each([ "href", "src" ], function( i, name ) {
-		jQuery.propHooks[ name ] = {
-			get: function( elem ) {
-				return elem.getAttribute( name, 4 );
-			}
-		};
-	});
-}
-
-if ( !jQuery.support.style ) {
-	jQuery.attrHooks.style = {
-		get: function( elem ) {
-			// Return undefined in the case of empty string
-			// Note: IE uppercases css property names, but if we were to .toLowerCase()
-			// .cssText, that would destroy case senstitivity in URL's, like in "background"
-			return elem.style.cssText || undefined;
-		},
-		set: function( elem, value ) {
-			return ( elem.style.cssText = value + "" );
-		}
-	};
-}
+        // Put in the new values to get a computed value out
+        if (rsLeft) {
+          rs.left = elem.currentStyle.left;
+        }
+        style.left = name === "fontSize" ? "1em" : ret;
+        ret = style.pixelLeft + "px";
 
-// 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;
-		}
-	});
-}
+        // Revert the changed values
+        style.left = left;
+        if (rsLeft) {
+          rs.left = rsLeft;
+        }
+      }
 
-// IE6/7 call enctype encoding
-if ( !jQuery.support.enctype ) {
-	jQuery.propFix.enctype = "encoding";
-}
+      return ret === "" ? "auto" : ret;
+    };
+  }
 
-// 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 = /^(?:input|select|textarea)$/i,
-	rkeyEvent = /^key/,
-	rmouseEvent = /^(?:mouse|contextmenu)|click/,
-	rfocusMorph = /^(?:focusinfocus|focusoutblur)$/,
-	rtypenamespace = /^([^.]*)(?:\.(.+)|)$/;
-
-function returnTrue() {
-	return true;
-}
-
-function returnFalse() {
-	return false;
-}
-
-/*
- * Helper functions for managing events -- not part of the public interface.
- * Props to Dean Edwards' addEvent library for many of the ideas.
- */
-jQuery.event = {
-
-	global: {},
-
-	add: function( elem, types, handler, data, selector ) {
-		var tmp, events, t, handleObjIn,
-			special, eventHandle, handleObj,
-			handlers, type, namespaces, origType,
-			elemData = jQuery._data( elem );
-
-		// Don't attach events to noData or text/comment nodes (but allow plain objects)
-		if ( !elemData ) {
-			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
-		if ( !(events = elemData.events) ) {
-			events = elemData.events = {};
-		}
-		if ( !(eventHandle = elemData.handle) ) {
-			eventHandle = elemData.handle = 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 !== core_strundefined && (!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 = ( types || "" ).match( core_rnotwhite ) || [""];
-		t = types.length;
-		while ( t-- ) {
-			tmp = rtypenamespace.exec( types[t] ) || [];
-			type = origType = tmp[1];
-			namespaces = ( tmp[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: origType,
-				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
-			if ( !(handlers = events[ type ]) ) {
-				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;
-	},
-
-	// Detach an event or set of events from an element
-	remove: function( elem, types, handler, selector, mappedTypes ) {
-		var j, handleObj, tmp,
-			origCount, t, events,
-			special, handlers, type,
-			namespaces, origType,
-			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 = ( types || "" ).match( core_rnotwhite ) || [""];
-		t = types.length;
-		while ( t-- ) {
-			tmp = rtypenamespace.exec( types[t] ) || [];
-			type = origType = tmp[1];
-			namespaces = ( tmp[2] || "" ).split( "." ).sort();
-
-			// 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;
-			handlers = events[ type ] || [];
-			tmp = tmp[2] && new RegExp( "(^|\\.)" + namespaces.join("\\.(?:.*\\.|)") + "(\\.|$)" );
-
-			// Remove matching events
-			origCount = j = handlers.length;
-			while ( j-- ) {
-				handleObj = handlers[ j ];
-
-				if ( ( mappedTypes || origType === handleObj.origType ) &&
-					( !handler || handler.guid === handleObj.guid ) &&
-					( !tmp || tmp.test( handleObj.namespace ) ) &&
-					( !selector || selector === handleObj.selector || selector === "**" && handleObj.selector ) ) {
-					handlers.splice( j, 1 );
-
-					if ( handleObj.selector ) {
-						handlers.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 ( origCount && !handlers.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" );
-		}
-	},
-
-	trigger: function( event, data, elem, onlyHandlers ) {
-		var handle, ontype, cur,
-			bubbleType, special, tmp, i,
-			eventPath = [ elem || document ],
-			type = core_hasOwn.call( event, "type" ) ? event.type : event,
-			namespaces = core_hasOwn.call( event, "namespace" ) ? event.namespace.split(".") : [];
-
-		cur = tmp = elem = elem || document;
-
-		// Don't do events on text and comment nodes
-		if ( elem.nodeType === 3 || elem.nodeType === 8 ) {
-			return;
-		}
-
-		// 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 ) {
-			// Namespaced trigger; create a regexp to match event type in handle()
-			namespaces = type.split(".");
-			type = namespaces.shift();
-			namespaces.sort();
-		}
-		ontype = type.indexOf(":") < 0 && "on" + type;
-
-		// Caller can pass in a jQuery.Event object, Object, or just an event type string
-		event = event[ jQuery.expando ] ?
-			event :
-			new jQuery.Event( type, typeof event === "object" && event );
-
-		event.isTrigger = true;
-		event.namespace = namespaces.join(".");
-		event.namespace_re = event.namespace ?
-			new RegExp( "(^|\\.)" + namespaces.join("\\.(?:.*\\.|)") + "(\\.|$)" ) :
-			null;
-
-		// 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 ?
-			[ event ] :
-			jQuery.makeArray( data, [ event ] );
-
-		// Allow special events to draw outside the lines
-		special = jQuery.event.special[ type ] || {};
-		if ( !onlyHandlers && 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)
-		if ( !onlyHandlers && !special.noBubble && !jQuery.isWindow( elem ) ) {
-
-			bubbleType = special.delegateType || type;
-			if ( !rfocusMorph.test( bubbleType + type ) ) {
-				cur = cur.parentNode;
-			}
-			for ( ; cur; cur = cur.parentNode ) {
-				eventPath.push( cur );
-				tmp = cur;
-			}
-
-			// Only add window if we got to document (e.g., not plain obj or detached DOM)
-			if ( tmp === (elem.ownerDocument || document) ) {
-				eventPath.push( tmp.defaultView || tmp.parentWindow || window );
-			}
-		}
-
-		// Fire handlers on the event path
-		i = 0;
-		while ( (cur = eventPath[i++]) && !event.isPropagationStopped() ) {
-
-			event.type = i > 1 ?
-				bubbleType :
-				special.bindType || type;
-
-			// jQuery handler
-			handle = ( jQuery._data( cur, "events" ) || {} )[ event.type ] && jQuery._data( cur, "handle" );
-			if ( handle ) {
-				handle.apply( cur, data );
-			}
-
-			// Native 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)
-				if ( ontype && elem[ type ] && !jQuery.isWindow( elem ) ) {
-
-					// Don't re-trigger an onFOO event when we call its FOO() method
-					tmp = elem[ ontype ];
-
-					if ( tmp ) {
-						elem[ ontype ] = null;
-					}
-
-					// Prevent re-triggering of the same event, since we already bubbled it above
-					jQuery.event.triggered = type;
-					try {
-						elem[ type ]();
-					} catch ( e ) {
-						// IE<9 dies on focus/blur to hidden element (#1486,#12518)
-						// only reproducible on winXP IE8 native, not IE9 in IE8 mode
-					}
-					jQuery.event.triggered = undefined;
-
-					if ( tmp ) {
-						elem[ ontype ] = tmp;
-					}
-				}
-			}
-		}
-
-		return event.result;
-	},
-
-	dispatch: function( event ) {
-
-		// Make a writable jQuery.Event from the native event object
-		event = jQuery.event.fix( event );
-
-		var i, ret, handleObj, matched, j,
-			handlerQueue = [],
-			args = core_slice.call( arguments ),
-			handlers = ( jQuery._data( this, "events" ) || {} )[ event.type ] || [],
-			special = jQuery.event.special[ event.type ] || {};
-
-		// 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
-		handlerQueue = jQuery.event.handlers.call( this, event, handlers );
-
-		// Run delegates first; they may want to stop propagation beneath us
-		i = 0;
-		while ( (matched = handlerQueue[ i++ ]) && !event.isPropagationStopped() ) {
-			event.currentTarget = matched.elem;
-
-			j = 0;
-			while ( (handleObj = matched.handlers[ j++ ]) && !event.isImmediatePropagationStopped() ) {
-
-				// Triggered event must either 1) have no namespace, or
-				// 2) have namespace(s) a subset or equal to those in the bound event (both can have no namespace).
-				if ( !event.namespace_re || event.namespace_re.test( handleObj.namespace ) ) {
-
-					event.handleObj = handleObj;
-					event.data = handleObj.data;
-
-					ret = ( (jQuery.event.special[ handleObj.origType ] || {}).handle || handleObj.handler )
-							.apply( matched.elem, args );
-
-					if ( ret !== undefined ) {
-						if ( (event.result = 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;
-	},
-
-	handlers: function( event, handlers ) {
-		var sel, handleObj, matches, i,
-			handlerQueue = [],
-			delegateCount = handlers.delegateCount,
-			cur = event.target;
-
-		// Find delegate handlers
-		// Black-hole SVG <use> instance trees (#13180)
-		// Avoid non-left-click bubbling in Firefox (#3861)
-		if ( delegateCount && cur.nodeType && (!event.button || event.type !== "click") ) {
-
-			for ( ; cur != this; cur = cur.parentNode || this ) {
-
-				// Don't check non-elements (#13208)
-				// Don't process clicks on disabled elements (#6911, #8165, #11382, #11764)
-				if ( cur.nodeType === 1 && (cur.disabled !== true || event.type !== "click") ) {
-					matches = [];
-					for ( i = 0; i < delegateCount; i++ ) {
-						handleObj = handlers[ i ];
-
-						// Don't conflict with Object.prototype properties (#13203)
-						sel = handleObj.selector + " ";
-
-						if ( matches[ sel ] === undefined ) {
-							matches[ sel ] = handleObj.needsContext ?
-								jQuery( sel, this ).index( cur ) >= 0 :
-								jQuery.find( sel, this, null, [ cur ] ).length;
-						}
-						if ( matches[ sel ] ) {
-							matches.push( handleObj );
-						}
-					}
-					if ( matches.length ) {
-						handlerQueue.push({ elem: cur, handlers: matches });
-					}
-				}
-			}
-		}
-
-		// Add the remaining (directly-bound) handlers
-		if ( delegateCount < handlers.length ) {
-			handlerQueue.push({ elem: this, handlers: handlers.slice( delegateCount ) });
-		}
-
-		return handlerQueue;
-	},
-
-	fix: function( event ) {
-		if ( event[ jQuery.expando ] ) {
-			return event;
-		}
-
-		// Create a writable copy of the event object and normalize some properties
-		var i, prop, copy,
-			type = event.type,
-			originalEvent = event,
-			fixHook = this.fixHooks[ type ];
-
-		if ( !fixHook ) {
-			this.fixHooks[ type ] = fixHook =
-				rmouseEvent.test( type ) ? this.mouseHooks :
-				rkeyEvent.test( type ) ? this.keyHooks :
-				{};
-		}
-		copy = fixHook.props ? this.props.concat( fixHook.props ) : this.props;
-
-		event = new jQuery.Event( originalEvent );
-
-		i = copy.length;
-		while ( i-- ) {
-			prop = copy[ i ];
-			event[ prop ] = originalEvent[ prop ];
-		}
-
-		// Support: IE<9
-		// Fix target property (#1925)
-		if ( !event.target ) {
-			event.target = originalEvent.srcElement || document;
-		}
-
-		// Support: Chrome 23+, Safari?
-		// Target should not be a text node (#504, #13143)
-		if ( event.target.nodeType === 3 ) {
-			event.target = event.target.parentNode;
-		}
-
-		// Support: IE<9
-		// For mouse/key events, metaKey==false if it's undefined (#3368, #11328)
-		event.metaKey = !!event.metaKey;
-
-		return fixHook.filter ? fixHook.filter( event, originalEvent ) : event;
-	},
-
-	// Includes some event props shared by KeyEvent and MouseEvent
-	props: "altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),
-
-	fixHooks: {},
-
-	keyHooks: {
-		props: "char charCode key keyCode".split(" "),
-		filter: function( 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 body, eventDoc, doc,
-				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;
-		}
-	},
-
-	special: {
-		load: {
-			// Prevent triggered image.load events from bubbling to window.load
-			noBubble: true
-		},
-		click: {
-			// For checkbox, fire native event so checked state will be right
-			trigger: function() {
-				if ( jQuery.nodeName( this, "input" ) && this.type === "checkbox" && this.click ) {
-					this.click();
-					return false;
-				}
-			}
-		},
-		focus: {
-			// Fire native event if possible so blur/focus sequence is correct
-			trigger: function() {
-				if ( this !== document.activeElement && this.focus ) {
-					try {
-						this.focus();
-						return false;
-					} catch ( e ) {
-						// Support: IE<9
-						// If we error on focus to hidden element (#1486, #12518),
-						// let .trigger() run the handlers
-					}
-				}
-			},
-			delegateType: "focusin"
-		},
-		blur: {
-			trigger: function() {
-				if ( this === document.activeElement && this.blur ) {
-					this.blur();
-					return false;
-				}
-			},
-			delegateType: "focusout"
-		},
-
-		beforeunload: {
-			postDispatch: function( event ) {
-
-				// Even when returnValue equals to undefined Firefox will still show alert
-				if ( event.result !== undefined ) {
-					event.originalEvent.returnValue = event.result;
-				}
-			}
-		}
-	},
-
-	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();
-		}
-	}
-};
-
-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 ] === core_strundefined ) {
-				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 setPositiveNumber(elem, value, subtract) {
+    var matches = rnumsplit.exec(value);
+    return matches
+        ? // Guard against undefined "subtract", e.g., when used as in cssHooks
+        Math.max(0, matches[1] - ( subtract || 0 )) + ( matches[2] || "px" )
+        : value;
+  }
 
-// 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 = {
-	isDefaultPrevented: returnFalse,
-	isPropagationStopped: returnFalse,
-	isImmediatePropagationStopped: returnFalse,
-
-	preventDefault: function() {
-		var e = this.originalEvent;
-
-		this.isDefaultPrevented = returnTrue;
-		if ( !e ) {
-			return;
-		}
-
-		// If preventDefault exists, run it on the original event
-		if ( e.preventDefault ) {
-			e.preventDefault();
-
-		// Support: IE
-		// Otherwise set the returnValue property of the original event to false
-		} else {
-			e.returnValue = false;
-		}
-	},
-	stopPropagation: function() {
-		var e = this.originalEvent;
-
-		this.isPropagationStopped = returnTrue;
-		if ( !e ) {
-			return;
-		}
-		// If stopPropagation exists, run it on the original event
-		if ( e.stopPropagation ) {
-			e.stopPropagation();
-		}
-
-		// Support: IE
-		// Set the cancelBubble property of the original event to true
-		e.cancelBubble = true;
-	},
-	stopImmediatePropagation: function() {
-		this.isImmediatePropagationStopped = returnTrue;
-		this.stopPropagation();
-	}
-};
+  function augmentWidthOrHeight(elem, name, extra, isBorderBox, styles) {
+    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,
 
-// 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;
-
-			// 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;
-		}
-	};
-});
+        val = 0;
 
-// 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, "submitBubbles" ) ) {
-					jQuery.event.add( form, "submit._submit", function( event ) {
-						event._submit_bubble = true;
-					});
-					jQuery._data( form, "submitBubbles", 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" );
-		}
-	};
-}
+    for (; i < 4; i += 2) {
+      // both box models exclude margin, so add it if we want it
+      if (extra === "margin") {
+        val += jQuery.css(elem, extra + cssExpand[i], true, styles);
+      }
 
-// 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, "changeBubbles" ) ) {
-					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, "changeBubbles", 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 );
-		}
-	};
-}
+      if (isBorderBox) {
+        // border-box includes padding, so remove it if we want content
+        if (extra === "content") {
+          val -= jQuery.css(elem, "padding" + cssExpand[i], true, styles);
+        }
 
-// 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 type, origFn;
-
-		// Types can be a map of types/handlers
-		if ( typeof types === "object" ) {
-			// ( types-Object, selector, data )
-			if ( typeof selector !== "string" ) {
-				// ( 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 );
-	},
-
-	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 ) {
-		var elem = this[0];
-		if ( elem ) {
-			return jQuery.event.trigger( type, data, elem, true );
-		}
-	}
-});
-/*!
- * Sizzle CSS Selector Engine
- * Copyright 2012 jQuery Foundation and other contributors
- * Released under the MIT license
- * http://sizzlejs.com/
- */
-(function( window, undefined ) {
-
-var i,
-	cachedruns,
-	Expr,
-	getText,
-	isXML,
-	compile,
-	hasDuplicate,
-	outermostContext,
-
-	// Local document vars
-	setDocument,
-	document,
-	docElem,
-	documentIsXML,
-	rbuggyQSA,
-	rbuggyMatches,
-	matches,
-	contains,
-	sortOrder,
-
-	// Instance-specific data
-	expando = "sizzle" + -(new Date()),
-	preferredDoc = window.document,
-	support = {},
-	dirruns = 0,
-	done = 0,
-	classCache = createCache(),
-	tokenCache = createCache(),
-	compilerCache = createCache(),
-
-	// General-purpose constants
-	strundefined = typeof undefined,
-	MAX_NEGATIVE = 1 << 31,
-
-	// Array methods
-	arr = [],
-	pop = arr.pop,
-	push = arr.push,
-	slice = arr.slice,
-	// Use a stripped-down indexOf if we can't use a native one
-	indexOf = arr.indexOf || function( elem ) {
-		var i = 0,
-			len = this.length;
-		for ( ; i < len; i++ ) {
-			if ( this[i] === elem ) {
-				return i;
-			}
-		}
-		return -1;
-	},
-
-
-	// Regular expressions
-
-	// 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 quoted,
-	//   then not containing pseudos/brackets,
-	//   then attribute selectors/non-parenthetical expressions,
-	//   then anything else
-	// These preferences are here to reduce the number of selectors
-	//   needing tokenize in the PSEUDO preFilter
-	pseudos = ":(" + characterEncoding + ")(?:\\(((['\"])((?:\\\\.|[^\\\\])*?)\\3|((?:\\\\.|[^\\\\()[\\]]|" + attributes.replace( 3, 8 ) + ")*)|.*)\\)|)",
-
-	// 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 ),
-	ridentifier = new RegExp( "^" + identifier + "$" ),
-
-	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 ),
-		"CHILD": new RegExp( "^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\(" + whitespace +
-			"*(even|odd|(([+-]|)(\\d*)n|)" + whitespace + "*(?:([+-]|)" + whitespace +
-			"*(\\d+)|))" + whitespace + "*\\)|)", "i" ),
-		// For use in libraries implementing .is()
-		// We use this for POS matching in `select`
-		"needsContext": new RegExp( "^" + whitespace + "*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\(" +
-			whitespace + "*((?:-\\d)?\\d*)" + whitespace + "*\\)|)(?=[^-]|$)", "i" )
-	},
-
-	rsibling = /[\x20\t\r\n\f]*[+~]/,
-
-	rnative = /^[^{]+\{\s*\[native code/,
-
-	// Easily-parseable/retrievable ID or TAG or CLASS selectors
-	rquickExpr = /^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,
-
-	rinputs = /^(?:input|select|textarea|button)$/i,
-	rheader = /^h\d$/i,
-
-	rescape = /'|\\/g,
-	rattributeQuotes = /\=[\x20\t\r\n\f]*([^'"\]]*)[\x20\t\r\n\f]*\]/g,
-
-	// CSS escapes http://www.w3.org/TR/CSS21/syndata.html#escaped-characters
-	runescape = /\\([\da-fA-F]{1,6}[\x20\t\r\n\f]?|.)/g,
-	funescape = function( _, escaped ) {
-		var high = "0x" + escaped - 0x10000;
-		// NaN means non-codepoint
-		return high !== high ?
-			escaped :
-			// BMP codepoint
-			high < 0 ?
-				String.fromCharCode( high + 0x10000 ) :
-				// Supplemental Plane codepoint (surrogate pair)
-				String.fromCharCode( high >> 10 | 0xD800, high & 0x3FF | 0xDC00 );
-	};
+        // at this point, extra isn't border nor margin, so remove border
+        if (extra !== "margin") {
+          val -= jQuery.css(elem, "border" + cssExpand[i] + "Width", true,
+              styles);
+        }
+      } else {
+        // at this point, extra isn't content, so add padding
+        val += jQuery.css(elem, "padding" + cssExpand[i], true, styles);
+
+        // at this point, extra isn't content nor padding, so add border
+        if (extra !== "padding") {
+          val += jQuery.css(elem, "border" + cssExpand[i] + "Width", true,
+              styles);
+        }
+      }
+    }
 
-// Use a stripped-down slice if we can't use a native one
-try {
-	slice.call( preferredDoc.documentElement.childNodes, 0 )[0].nodeType;
-} catch ( e ) {
-	slice = function( i ) {
-		var elem,
-			results = [];
-		while ( (elem = this[i++]) ) {
-			results.push( elem );
-		}
-		return results;
-	};
-}
-
-/**
- * For feature detection
- * @param {Function} fn The function to test for native support
- */
-function isNative( fn ) {
-	return rnative.test( fn + "" );
-}
-
-/**
- * Create key-value caches of limited size
- * @returns {Function(string, Object)} Returns the Object data after storing it on itself with
- *	property name the (space-suffixed) string and (if the cache is larger than Expr.cacheLength)
- *	deleting the oldest entry
- */
-function createCache() {
-	var cache,
-		keys = [];
-
-	return (cache = function( key, value ) {
-		// Use (key + " ") to avoid collision with native prototype properties (see Issue #157)
-		if ( keys.push( key += " " ) > Expr.cacheLength ) {
-			// Only keep the most recent entries
-			delete cache[ keys.shift() ];
-		}
-		return (cache[ key ] = value);
-	});
-}
-
-/**
- * Mark a function for special use by Sizzle
- * @param {Function} fn The function to mark
- */
-function markFunction( fn ) {
-	fn[ expando ] = true;
-	return fn;
-}
-
-/**
- * Support testing using an element
- * @param {Function} fn Passed the created div and expects a boolean result
- */
-function assert( fn ) {
-	var div = document.createElement("div");
-
-	try {
-		return fn( div );
-	} catch (e) {
-		return false;
-	} finally {
-		// release memory in IE
-		div = null;
-	}
-}
-
-function Sizzle( selector, context, results, seed ) {
-	var match, elem, m, nodeType,
-		// QSA vars
-		i, groups, old, nid, newContext, newSelector;
-
-	if ( ( context ? context.ownerDocument || context : preferredDoc ) !== document ) {
-		setDocument( context );
-	}
-
-	context = context || document;
-	results = results || [];
-
-	if ( !selector || typeof selector !== "string" ) {
-		return results;
-	}
-
-	if ( (nodeType = context.nodeType) !== 1 && nodeType !== 9 ) {
-		return [];
-	}
-
-	if ( !documentIsXML && !seed ) {
-
-		// Shortcuts
-		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]) && support.getByClassName && context.getElementsByClassName ) {
-				push.apply( results, slice.call(context.getElementsByClassName( m ), 0) );
-				return results;
-			}
-		}
-
-		// QSA path
-		if ( support.qsa && !rbuggyQSA.test(selector) ) {
-			old = true;
-			nid = expando;
-			newContext = context;
-			newSelector = 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 ( 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 + toSelector( groups[i] );
-				}
-				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");
-					}
-				}
-			}
-		}
-	}
-
-	// All others
-	return select( selector.replace( rtrim, "$1" ), context, results, seed );
-}
-
-/**
- * Detect xml
- * @param {Element|Object} elem An element or a document
- */
-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;
-};
-
-/**
- * Sets document-related variables once based on the current document
- * @param {Element|Object} [doc] An element or document object to use to set the document
- * @returns {Object} Returns the current document
- */
-setDocument = Sizzle.setDocument = function( node ) {
-	var doc = node ? node.ownerDocument || node : preferredDoc;
-
-	// If no document and documentElement is available, return
-	if ( doc === document || doc.nodeType !== 9 || !doc.documentElement ) {
-		return document;
-	}
-
-	// Set our document
-	document = doc;
-	docElem = doc.documentElement;
-
-	// Support tests
-	documentIsXML = isXML( doc );
-
-	// Check if getElementsByTagName("*") returns only elements
-	support.tagNameNoComments = assert(function( div ) {
-		div.appendChild( doc.createComment("") );
-		return !div.getElementsByTagName("*").length;
-	});
-
-	// Check if attributes should be retrieved by attribute nodes
-	support.attributes = 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
-	support.getByClassName = 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
-	support.getByName = 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 = doc.getElementsByName &&
-			// buggy browsers will return fewer than the correct 2
-			doc.getElementsByName( expando ).length === 2 +
-			// buggy browsers will return more than the correct 0
-			doc.getElementsByName( expando + 0 ).length;
-		support.getIdNotName = !doc.getElementById( expando );
-
-		// Cleanup
-		docElem.removeChild( div );
-
-		return pass;
-	});
-
-	// IE6/7 return modified attributes
-	Expr.attrHandle = assert(function( div ) {
-		div.innerHTML = "<a href='#'></a>";
-		return div.firstChild && typeof div.firstChild.getAttribute !== strundefined &&
-			div.firstChild.getAttribute("href") === "#";
-	}) ?
-		{} :
-		{
-			"href": function( elem ) {
-				return elem.getAttribute( "href", 2 );
-			},
-			"type": function( elem ) {
-				return elem.getAttribute("type");
-			}
-		};
-
-	// ID find and filter
-	if ( support.getIdNotName ) {
-		Expr.find["ID"] = function( id, context ) {
-			if ( typeof context.getElementById !== strundefined && !documentIsXML ) {
-				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] : [];
-			}
-		};
-		Expr.filter["ID"] = function( id ) {
-			var attrId = id.replace( runescape, funescape );
-			return function( elem ) {
-				return elem.getAttribute("id") === attrId;
-			};
-		};
-	} else {
-		Expr.find["ID"] = function( id, context ) {
-			if ( typeof context.getElementById !== strundefined && !documentIsXML ) {
-				var m = context.getElementById( id );
-
-				return m ?
-					m.id === id || typeof m.getAttributeNode !== strundefined && m.getAttributeNode("id").value === id ?
-						[m] :
-						undefined :
-					[];
-			}
-		};
-		Expr.filter["ID"] =  function( id ) {
-			var attrId = id.replace( runescape, funescape );
-			return function( elem ) {
-				var node = typeof elem.getAttributeNode !== strundefined && elem.getAttributeNode("id");
-				return node && node.value === attrId;
-			};
-		};
-	}
-
-	// Tag
-	Expr.find["TAG"] = support.tagNameNoComments ?
-		function( tag, context ) {
-			if ( typeof context.getElementsByTagName !== strundefined ) {
-				return context.getElementsByTagName( tag );
-			}
-		} :
-		function( tag, context ) {
-			var elem,
-				tmp = [],
-				i = 0,
-				results = context.getElementsByTagName( tag );
-
-			// Filter out possible comments
-			if ( tag === "*" ) {
-				while ( (elem = results[i++]) ) {
-					if ( elem.nodeType === 1 ) {
-						tmp.push( elem );
-					}
-				}
-
-				return tmp;
-			}
-			return results;
-		};
-
-	// Name
-	Expr.find["NAME"] = support.getByName && function( tag, context ) {
-		if ( typeof context.getElementsByName !== strundefined ) {
-			return context.getElementsByName( name );
-		}
-	};
-
-	// Class
-	Expr.find["CLASS"] = support.getByClassName && function( className, context ) {
-		if ( typeof context.getElementsByClassName !== strundefined && !documentIsXML ) {
-			return context.getElementsByClassName( className );
-		}
-	};
-
-	// QSA and matchesSelector support
-
-	// matchesSelector(:active) reports false when true (IE9/Opera 11.5)
-	rbuggyMatches = [];
-
-	// qSa(:focus) reports false when true (Chrome 21),
-	// no need to also add to buggyMatches since matches checks buggyQSA
-	// A support test would require too much code (would include document ready)
-	rbuggyQSA = [ ":focus" ];
-
-	if ( (support.qsa = isNative(doc.querySelectorAll)) ) {
-		// 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 and will not see later tests
-			if ( !div.querySelectorAll(":checked").length ) {
-				rbuggyQSA.push(":checked");
-			}
-		});
-
-		assert(function( div ) {
-
-			// Opera 10-12/IE8 - ^= $= *= and empty values
-			// Should not select anything
-			div.innerHTML = "<input type='hidden' i=''/>";
-			if ( div.querySelectorAll("[i^='']").length ) {
-				rbuggyQSA.push( "[*^$]=" + whitespace + "*(?:\"\"|'')" );
-			}
-
-			// FF 3.5 - :enabled/:disabled and hidden elements (hidden elements are still enabled)
-			// IE8 throws error here and will not see later tests
-			if ( !div.querySelectorAll(":enabled").length ) {
-				rbuggyQSA.push( ":enabled", ":disabled" );
-			}
-
-			// Opera 10-11 does not throw on post-comma invalid pseudos
-			div.querySelectorAll("*,:x");
-			rbuggyQSA.push(",.*:");
-		});
-	}
-
-	if ( (support.matchesSelector = isNative( (matches = docElem.matchesSelector ||
-		docElem.mozMatchesSelector ||
-		docElem.webkitMatchesSelector ||
-		docElem.oMatchesSelector ||
-		docElem.msMatchesSelector) )) ) {
-
-		assert(function( div ) {
-			// Check to see if it's possible to do matchesSelector
-			// on a disconnected node (IE 9)
-			support.disconnectedMatch = matches.call( div, "div" );
-
-			// This should fail with an exception
-			// Gecko does not error, returns false instead
-			matches.call( div, "[s!='']:x" );
-			rbuggyMatches.push( "!=", pseudos );
-		});
-	}
-
-	rbuggyQSA = new RegExp( rbuggyQSA.join("|") );
-	rbuggyMatches = new RegExp( rbuggyMatches.join("|") );
-
-	// Element contains another
-	// Purposefully does not implement inclusive descendent
-	// As in, an element does not contain itself
-	contains = isNative(docElem.contains) || docElem.compareDocumentPosition ?
-		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 ) :
-					a.compareDocumentPosition && a.compareDocumentPosition( bup ) & 16
-			));
-		} :
-		function( a, b ) {
-			if ( b ) {
-				while ( (b = b.parentNode) ) {
-					if ( b === a ) {
-						return true;
-					}
-				}
-			}
-			return false;
-		};
-
-	// Document order sorting
-	sortOrder = docElem.compareDocumentPosition ?
-	function( a, b ) {
-		var compare;
-
-		if ( a === b ) {
-			hasDuplicate = true;
-			return 0;
-		}
-
-		if ( (compare = b.compareDocumentPosition && a.compareDocumentPosition && a.compareDocumentPosition( b )) ) {
-			if ( compare & 1 || a.parentNode && a.parentNode.nodeType === 11 ) {
-				if ( a === doc || contains( preferredDoc, a ) ) {
-					return -1;
-				}
-				if ( b === doc || contains( preferredDoc, b ) ) {
-					return 1;
-				}
-				return 0;
-			}
-			return compare & 4 ? -1 : 1;
-		}
-
-		return a.compareDocumentPosition ? -1 : 1;
-	} :
-	function( a, b ) {
-		var cur,
-			i = 0,
-			aup = a.parentNode,
-			bup = b.parentNode,
-			ap = [ a ],
-			bp = [ b ];
-
-		// Exit early if the nodes are identical
-		if ( a === b ) {
-			hasDuplicate = true;
-			return 0;
-
-		// Parentless nodes are either documents or disconnected
-		} else if ( !aup || !bup ) {
-			return a === doc ? -1 :
-				b === doc ? 1 :
-				aup ? -1 :
-				bup ? 1 :
-				0;
-
-		// If the nodes are siblings, we can do a quick check
-		} else if ( aup === bup ) {
-			return siblingCheck( a, b );
-		}
-
-		// Otherwise we need full lists of their ancestors for comparison
-		cur = a;
-		while ( (cur = cur.parentNode) ) {
-			ap.unshift( cur );
-		}
-		cur = b;
-		while ( (cur = cur.parentNode) ) {
-			bp.unshift( cur );
-		}
-
-		// Walk down the tree looking for a discrepancy
-		while ( ap[i] === bp[i] ) {
-			i++;
-		}
-
-		return i ?
-			// Do a sibling check if the nodes have a common ancestor
-			siblingCheck( ap[i], bp[i] ) :
-
-			// Otherwise nodes in our document sort first
-			ap[i] === preferredDoc ? -1 :
-			bp[i] === preferredDoc ? 1 :
-			0;
-	};
-
-	// Always assume the presence of duplicates if sort doesn't
-	// pass them to our comparison function (as in Google Chrome).
-	hasDuplicate = false;
-	[0, 0].sort( sortOrder );
-	support.detectDuplicates = hasDuplicate;
-
-	return document;
-};
-
-Sizzle.matches = function( expr, elements ) {
-	return Sizzle( expr, null, null, elements );
-};
-
-Sizzle.matchesSelector = function( elem, expr ) {
-	// Set document vars if needed
-	if ( ( elem.ownerDocument || elem ) !== document ) {
-		setDocument( elem );
-	}
-
-	// Make sure that attribute selectors are quoted
-	expr = expr.replace( rattributeQuotes, "='$1']" );
-
-	// rbuggyQSA always contains :focus, so no need for an existence check
-	if ( support.matchesSelector && !documentIsXML && (!rbuggyMatches || !rbuggyMatches.test(expr)) && !rbuggyQSA.test(expr) ) {
-		try {
-			var ret = matches.call( elem, expr );
-
-			// IE 9's matchesSelector returns false on disconnected nodes
-			if ( ret || support.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, document, null, [elem] ).length > 0;
-};
-
-Sizzle.contains = function( context, elem ) {
-	// Set document vars if needed
-	if ( ( context.ownerDocument || context ) !== document ) {
-		setDocument( context );
-	}
-	return contains( context, elem );
-};
-
-Sizzle.attr = function( elem, name ) {
-	var val;
-
-	// Set document vars if needed
-	if ( ( elem.ownerDocument || elem ) !== document ) {
-		setDocument( elem );
-	}
-
-	if ( !documentIsXML ) {
-		name = name.toLowerCase();
-	}
-	if ( (val = Expr.attrHandle[ name ]) ) {
-		return val( elem );
-	}
-	if ( documentIsXML || support.attributes ) {
-		return elem.getAttribute( name );
-	}
-	return ( (val = elem.getAttributeNode( name )) || elem.getAttribute( name ) ) && elem[ name ] === true ?
-		name :
-		val && val.specified ? val.value : null;
-};
-
-Sizzle.error = function( msg ) {
-	throw new Error( "Syntax error, unrecognized expression: " + msg );
-};
+    return val;
+  }
 
-// Document sorting and removing duplicates
-Sizzle.uniqueSort = function( results ) {
-	var elem,
-		duplicates = [],
-		i = 1,
-		j = 0;
-
-	// Unless we *know* we can detect duplicates, assume their presence
-	hasDuplicate = !support.detectDuplicates;
-	results.sort( sortOrder );
-
-	if ( hasDuplicate ) {
-		for ( ; (elem = results[i]); i++ ) {
-			if ( elem === results[ i - 1 ] ) {
-				j = duplicates.push( i );
-			}
-		}
-		while ( j-- ) {
-			results.splice( duplicates[ j ], 1 );
-		}
-	}
-
-	return results;
-};
-
-function siblingCheck( a, b ) {
-	var cur = b && a,
-		diff = cur && ( ~b.sourceIndex || MAX_NEGATIVE ) - ( ~a.sourceIndex || MAX_NEGATIVE );
-
-	// Use IE sourceIndex if available on both nodes
-	if ( diff ) {
-		return diff;
-	}
-
-	// Check if b follows a
-	if ( cur ) {
-		while ( (cur = cur.nextSibling) ) {
-			if ( cur === b ) {
-				return -1;
-			}
-		}
-	}
-
-	return a ? 1 : -1;
-}
+  function getWidthOrHeight(elem, name, extra) {
+
+    // Start with offset property, which is equivalent to the border-box value
+    var valueIsBorderBox = true,
+        val = name === "width" ? elem.offsetWidth : elem.offsetHeight,
+        styles = getStyles(elem),
+        isBorderBox = jQuery.support.boxSizing && jQuery.css(elem, "boxSizing",
+            false, styles) === "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, styles);
+      if (val < 0 || val == null) {
+        val = elem.style[name];
+      }
 
-// 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;
-	};
-}
+      // Computed unit is not pixels. Stop here and return.
+      if (rnumnonpx.test(val)) {
+        return val;
+      }
 
-// 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;
-	};
-}
+      // 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] );
 
-// 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 no nodeType, this is expected to be an array
-		for ( ; (node = elem[i]); i++ ) {
-			// Do not traverse comment nodes
-			ret += getText( node );
-		}
-	} else 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
-
-	return ret;
-};
-
-Expr = Sizzle.selectors = {
-
-	// Can be adjusted by the user
-	cacheLength: 50,
-
-	createPseudo: markFunction,
-
-	match: matchExpr,
-
-	find: {},
-
-	relative: {
-		">": { dir: "parentNode", first: true },
-		" ": { dir: "parentNode" },
-		"+": { dir: "previousSibling", first: true },
-		"~": { dir: "previousSibling" }
-	},
-
-	preFilter: {
-		"ATTR": function( match ) {
-			match[1] = match[1].replace( runescape, funescape );
-
-			// Move the given value to match[3] whether quoted or unquoted
-			match[3] = ( match[4] || match[5] || "" ).replace( runescape, funescape );
-
-			if ( match[2] === "~=" ) {
-				match[3] = " " + match[3] + " ";
-			}
-
-			return match.slice( 0, 4 );
-		},
-
-		"CHILD": function( match ) {
-			/* matches from matchExpr["CHILD"]
-				1 type (only|nth|...)
-				2 what (child|of-type)
-				3 argument (even|odd|\d*|\d*n([+-]\d+)?|...)
-				4 xn-component of xn+y argument ([+-]?\d*n|)
-				5 sign of xn-component
-				6 x of xn-component
-				7 sign of y-component
-				8 y of y-component
-			*/
-			match[1] = match[1].toLowerCase();
-
-			if ( match[1].slice( 0, 3 ) === "nth" ) {
-				// nth-* requires argument
-				if ( !match[3] ) {
-					Sizzle.error( match[0] );
-				}
-
-				// numeric x and y parameters for Expr.filter.CHILD
-				// remember that false/true cast respectively to 0/1
-				match[4] = +( match[4] ? match[5] + (match[6] || 1) : 2 * ( match[3] === "even" || match[3] === "odd" ) );
-				match[5] = +( ( match[7] + match[8] ) || match[3] === "odd" );
-
-			// other types prohibit arguments
-			} else if ( match[3] ) {
-				Sizzle.error( match[0] );
-			}
-
-			return match;
-		},
-
-		"PSEUDO": function( match ) {
-			var excess,
-				unquoted = !match[5] && match[2];
-
-			if ( matchExpr["CHILD"].test( match[0] ) ) {
-				return null;
-			}
-
-			// Accept quoted arguments as-is
-			if ( match[4] ) {
-				match[2] = match[4];
-
-			// Strip excess characters from unquoted arguments
-			} else if ( unquoted && 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
-				match[0] = match[0].slice( 0, excess );
-				match[2] = unquoted.slice( 0, excess );
-			}
-
-			// Return only captures needed by the pseudo filter method (type and argument)
-			return match.slice( 0, 3 );
-		}
-	},
-
-	filter: {
-
-		"TAG": function( nodeName ) {
-			if ( nodeName === "*" ) {
-				return function() { return true; };
-			}
-
-			nodeName = nodeName.replace( runescape, funescape ).toLowerCase();
-			return function( elem ) {
-				return elem.nodeName && elem.nodeName.toLowerCase() === nodeName;
-			};
-		},
-
-		"CLASS": function( className ) {
-			var pattern = classCache[ className + " " ];
-
-			return pattern ||
-				(pattern = new RegExp( "(^|" + whitespace + ")" + className + "(" + whitespace + "|$)" )) &&
-				classCache( className, function( elem ) {
-					return pattern.test( elem.className || (typeof elem.getAttribute !== strundefined && elem.getAttribute("class")) || "" );
-				});
-		},
-
-		"ATTR": function( name, operator, check ) {
-			return function( elem ) {
-				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.slice( -check.length ) === check :
-					operator === "~=" ? ( " " + result + " " ).indexOf( check ) > -1 :
-					operator === "|=" ? result === check || result.slice( 0, check.length + 1 ) === check + "-" :
-					false;
-			};
-		},
-
-		"CHILD": function( type, what, argument, first, last ) {
-			var simple = type.slice( 0, 3 ) !== "nth",
-				forward = type.slice( -4 ) !== "last",
-				ofType = what === "of-type";
-
-			return first === 1 && last === 0 ?
-
-				// Shortcut for :nth-*(n)
-				function( elem ) {
-					return !!elem.parentNode;
-				} :
-
-				function( elem, context, xml ) {
-					var cache, outerCache, node, diff, nodeIndex, start,
-						dir = simple !== forward ? "nextSibling" : "previousSibling",
-						parent = elem.parentNode,
-						name = ofType && elem.nodeName.toLowerCase(),
-						useCache = !xml && !ofType;
-
-					if ( parent ) {
-
-						// :(first|last|only)-(child|of-type)
-						if ( simple ) {
-							while ( dir ) {
-								node = elem;
-								while ( (node = node[ dir ]) ) {
-									if ( ofType ? node.nodeName.toLowerCase() === name : node.nodeType === 1 ) {
-										return false;
-									}
-								}
-								// Reverse direction for :only-* (if we haven't yet done so)
-								start = dir = type === "only" && !start && "nextSibling";
-							}
-							return true;
-						}
-
-						start = [ forward ? parent.firstChild : parent.lastChild ];
-
-						// non-xml :nth-child(...) stores cache data on `parent`
-						if ( forward && useCache ) {
-							// Seek `elem` from a previously-cached index
-							outerCache = parent[ expando ] || (parent[ expando ] = {});
-							cache = outerCache[ type ] || [];
-							nodeIndex = cache[0] === dirruns && cache[1];
-							diff = cache[0] === dirruns && cache[2];
-							node = nodeIndex && parent.childNodes[ nodeIndex ];
-
-							while ( (node = ++nodeIndex && node && node[ dir ] ||
-
-								// Fallback to seeking `elem` from the start
-								(diff = nodeIndex = 0) || start.pop()) ) {
-
-								// When found, cache indexes on `parent` and break
-								if ( node.nodeType === 1 && ++diff && node === elem ) {
-									outerCache[ type ] = [ dirruns, nodeIndex, diff ];
-									break;
-								}
-							}
-
-						// Use previously-cached element index if available
-						} else if ( useCache && (cache = (elem[ expando ] || (elem[ expando ] = {}))[ type ]) && cache[0] === dirruns ) {
-							diff = cache[1];
-
-						// xml :nth-child(...) or :nth-last-child(...) or :nth(-last)?-of-type(...)
-						} else {
-							// Use the same loop as above to seek `elem` from the start
-							while ( (node = ++nodeIndex && node && node[ dir ] ||
-								(diff = nodeIndex = 0) || start.pop()) ) {
-
-								if ( ( ofType ? node.nodeName.toLowerCase() === name : node.nodeType === 1 ) && ++diff ) {
-									// Cache the index of each encountered element
-									if ( useCache ) {
-										(node[ expando ] || (node[ expando ] = {}))[ type ] = [ dirruns, diff ];
-									}
-
-									if ( node === elem ) {
-										break;
-									}
-								}
-							}
-						}
-
-						// Incorporate the offset, then check against cycle size
-						diff -= last;
-						return diff === first || ( diff % first === 0 && diff / first >= 0 );
-					}
-				};
-		},
-
-		"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: {
-		// Potentially complex 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;
-			};
-		}),
-
-		// "Whether an element is represented by a :lang() selector
-		// is based solely on the element's language value
-		// being equal to the identifier C,
-		// or beginning with the identifier C immediately followed by "-".
-		// The matching of C against the element's language value is performed case-insensitively.
-		// The identifier C does not have to be a valid language name."
-		// http://www.w3.org/TR/selectors/#lang-pseudo
-		"lang": markFunction( function( lang ) {
-			// lang value must be a valid identifider
-			if ( !ridentifier.test(lang || "") ) {
-				Sizzle.error( "unsupported lang: " + lang );
-			}
-			lang = lang.replace( runescape, funescape ).toLowerCase();
-			return function( elem ) {
-				var elemLang;
-				do {
-					if ( (elemLang = documentIsXML ?
-						elem.getAttribute("xml:lang") || elem.getAttribute("lang") :
-						elem.lang) ) {
-
-						elemLang = elemLang.toLowerCase();
-						return elemLang === lang || elemLang.indexOf( lang + "-" ) === 0;
-					}
-				} while ( (elem = elem.parentNode) && elem.nodeType === 1 );
-				return false;
-			};
-		}),
-
-		// Miscellaneous
-		"target": function( elem ) {
-			var hash = window.location && window.location.hash;
-			return hash && hash.slice( 1 ) === elem.id;
-		},
-
-		"root": function( elem ) {
-			return elem === docElem;
-		},
-
-		"focus": function( elem ) {
-			return elem === document.activeElement && (!document.hasFocus || document.hasFocus()) && !!(elem.type || elem.href || ~elem.tabIndex);
-		},
-
-		// Boolean properties
-		"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;
-		},
-
-		// Contents
-		"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 "?")
-			for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) {
-				if ( elem.nodeName > "@" || elem.nodeType === 3 || elem.nodeType === 4 ) {
-					return false;
-				}
-			}
-			return true;
-		},
-
-		"parent": function( elem ) {
-			return !Expr.pseudos["empty"]( elem );
-		},
-
-		// Element/input types
-		"header": function( elem ) {
-			return rheader.test( elem.nodeName );
-		},
-
-		"input": function( elem ) {
-			return rinputs.test( elem.nodeName );
-		},
-
-		"button": function( elem ) {
-			var name = elem.nodeName.toLowerCase();
-			return name === "input" && elem.type === "button" || name === "button";
-		},
-
-		"text": function( elem ) {
-			var 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" &&
-				elem.type === "text" &&
-				( (attr = elem.getAttribute("type")) == null || attr.toLowerCase() === elem.type );
-		},
-
-		// Position-in-collection
-		"first": createPositionalPseudo(function() {
-			return [ 0 ];
-		}),
-
-		"last": createPositionalPseudo(function( matchIndexes, length ) {
-			return [ length - 1 ];
-		}),
-
-		"eq": createPositionalPseudo(function( matchIndexes, length, argument ) {
-			return [ argument < 0 ? argument + length : argument ];
-		}),
-
-		"even": createPositionalPseudo(function( matchIndexes, length ) {
-			var i = 0;
-			for ( ; i < length; i += 2 ) {
-				matchIndexes.push( i );
-			}
-			return matchIndexes;
-		}),
-
-		"odd": createPositionalPseudo(function( matchIndexes, length ) {
-			var i = 1;
-			for ( ; i < length; i += 2 ) {
-				matchIndexes.push( i );
-			}
-			return matchIndexes;
-		}),
-
-		"lt": createPositionalPseudo(function( matchIndexes, length, argument ) {
-			var i = argument < 0 ? argument + length : argument;
-			for ( ; --i >= 0; ) {
-				matchIndexes.push( i );
-			}
-			return matchIndexes;
-		}),
-
-		"gt": createPositionalPseudo(function( matchIndexes, length, argument ) {
-			var i = argument < 0 ? argument + length : argument;
-			for ( ; ++i < length; ) {
-				matchIndexes.push( i );
-			}
-			return matchIndexes;
-		})
-	}
-};
+      // Normalize "", auto, and prepare for extra
+      val = parseFloat(val) || 0;
+    }
 
-// Add button/input type pseudos
-for ( i in { radio: true, checkbox: true, file: true, password: true, image: true } ) {
-	Expr.pseudos[ i ] = createInputPseudo( i );
-}
-for ( i in { submit: true, reset: true } ) {
-	Expr.pseudos[ i ] = createButtonPseudo( i );
-}
-
-function tokenize( selector, parseOnly ) {
-	var matched, match, tokens, type,
-		soFar, groups, preFilters,
-		cached = tokenCache[ 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 ) {
-				// Don't consume trailing commas as valid
-				soFar = soFar.slice( match[0].length ) || soFar;
-			}
-			groups.push( tokens = [] );
-		}
-
-		matched = false;
-
-		// Combinators
-		if ( (match = rcombinators.exec( soFar )) ) {
-			matched = match.shift();
-			tokens.push( {
-				value: matched,
-				// Cast descendant combinators to space
-				type: match[0].replace( rtrim, " " )
-			} );
-			soFar = soFar.slice( matched.length );
-		}
-
-		// Filters
-		for ( type in Expr.filter ) {
-			if ( (match = matchExpr[ type ].exec( soFar )) && (!preFilters[ type ] ||
-				(match = preFilters[ type ]( match ))) ) {
-				matched = match.shift();
-				tokens.push( {
-					value: matched,
-					type: type,
-					matches: match
-				} );
-				soFar = soFar.slice( matched.length );
-			}
-		}
-
-		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 toSelector( tokens ) {
-	var i = 0,
-		len = tokens.length,
-		selector = "";
-	for ( ; i < len; i++ ) {
-		selector += tokens[i].value;
-	}
-	return selector;
-}
-
-function addCombinator( matcher, combinator, base ) {
-	var dir = combinator.dir,
-		checkNonElements = base && dir === "parentNode",
-		doneName = done++;
-
-	return combinator.first ?
-		// Check against closest ancestor/preceding element
-		function( elem, context, xml ) {
-			while ( (elem = elem[ dir ]) ) {
-				if ( elem.nodeType === 1 || checkNonElements ) {
-					return matcher( elem, context, xml );
-				}
-			}
-		} :
-
-		// Check against all ancestor/preceding elements
-		function( elem, context, xml ) {
-			var data, cache, outerCache,
-				dirkey = dirruns + " " + doneName;
-
-			// We can't set arbitrary data on XML nodes, so they don't benefit from dir caching
-			if ( xml ) {
-				while ( (elem = elem[ dir ]) ) {
-					if ( elem.nodeType === 1 || checkNonElements ) {
-						if ( matcher( elem, context, xml ) ) {
-							return true;
-						}
-					}
-				}
-			} else {
-				while ( (elem = elem[ dir ]) ) {
-					if ( elem.nodeType === 1 || checkNonElements ) {
-						outerCache = elem[ expando ] || (elem[ expando ] = {});
-						if ( (cache = outerCache[ dir ]) && cache[0] === dirkey ) {
-							if ( (data = cache[1]) === true || data === cachedruns ) {
-								return data === true;
-							}
-						} else {
-							cache = outerCache[ dir ] = [ dirkey ];
-							cache[1] = matcher( elem, context, xml ) || cachedruns;
-							if ( cache[1] === true ) {
-								return true;
-							}
-						}
-					}
-				}
-			}
-		};
-}
-
-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 ) {
-		var temp, i, elem,
-			preMap = [],
-			postMap = [],
-			preexisting = results.length,
-
-			// Get initial elements from seed or context
-			elems = seed || multipleContexts( selector || "*", context.nodeType ? [ context ] : context, [] ),
-
-			// 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 ) {
-			temp = condense( matcherOut, postMap );
-			postFilter( temp, [], context, xml );
-
-			// Un-match failing elements by moving them back to matcherIn
-			i = temp.length;
-			while ( i-- ) {
-				if ( (elem = temp[i]) ) {
-					matcherOut[ postMap[i] ] = !(matcherIn[ postMap[i] ] = elem);
-				}
-			}
-		}
-
-		if ( seed ) {
-			if ( postFinder || preFilter ) {
-				if ( postFinder ) {
-					// Get the final matcherOut by condensing this intermediate into postFinder contexts
-					temp = [];
-					i = matcherOut.length;
-					while ( i-- ) {
-						if ( (elem = matcherOut[i]) ) {
-							// Restore matcherIn since elem is not yet a final match
-							temp.push( (matcherIn[i] = elem) );
-						}
-					}
-					postFinder( null, (matcherOut = []), temp, xml );
-				}
-
-				// Move matched elements from seed to results to keep them synchronized
-				i = matcherOut.length;
-				while ( i-- ) {
-					if ( (elem = matcherOut[i]) &&
-						(temp = postFinder ? indexOf.call( seed, elem ) : preMap[i]) > -1 ) {
-
-						seed[temp] = !(results[temp] = elem);
-					}
-				}
-			}
-
-		// Add elements to results, through postFinder if defined
-		} 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 {
-			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 && toSelector( tokens.slice( 0, i - 1 ) ).replace( rtrim, "$1" ),
-					matcher,
-					i < j && matcherFromTokens( tokens.slice( i, j ) ),
-					j < len && matcherFromTokens( (tokens = tokens.slice( j )) ),
-					j < len && toSelector( tokens )
-				);
-			}
-			matchers.push( matcher );
-		}
-	}
-
-	return elementMatcher( matchers );
-}
-
-function matcherFromGroupMatchers( elementMatchers, setMatchers ) {
-	// A counter to specify which element is currently being matched
-	var matcherCachedRuns = 0,
-		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 ),
-				// Use integer dirruns iff this is the outermost matcher
-				dirrunsUnique = (dirruns += contextBackup == null ? 1 : Math.random() || 0.1);
-
-			if ( outermost ) {
-				outermostContext = context !== document && context;
-				cachedruns = matcherCachedRuns;
-			}
-
-			// Add elements passing elementMatchers directly to results
-			// Keep `i` a string if there are no elements so `matchedCount` will be "00" below
-			for ( ; (elem = elems[i]) != null; i++ ) {
-				if ( byElement && elem ) {
-					j = 0;
-					while ( (matcher = elementMatchers[j++]) ) {
-						if ( matcher( elem, context, xml ) ) {
-							results.push( elem );
-							break;
-						}
-					}
-					if ( outermost ) {
-						dirruns = dirrunsUnique;
-						cachedruns = ++matcherCachedRuns;
-					}
-				}
-
-				// 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 ) {
-				j = 0;
-				while ( (matcher = setMatchers[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;
-		};
-
-	return bySet ?
-		markFunction( superMatcher ) :
-		superMatcher;
-}
-
-compile = Sizzle.compile = function( selector, group /* Internal Use Only */ ) {
-	var i,
-		setMatchers = [],
-		elementMatchers = [],
-		cached = compilerCache[ 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 ) {
-	var i = 0,
-		len = contexts.length;
-	for ( ; i < len; i++ ) {
-		Sizzle( selector, contexts[i], results );
-	}
-	return results;
-}
-
-function select( selector, context, results, seed ) {
-	var i, tokens, token, type, find,
-		match = tokenize( selector );
-
-	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 && !documentIsXML &&
-					Expr.relative[ tokens[1].type ] ) {
-
-				context = Expr.find["ID"]( token.matches[0].replace( runescape, funescape ), context )[0];
-				if ( !context ) {
-					return results;
-				}
-
-				selector = selector.slice( tokens.shift().value.length );
-			}
-
-			// Fetch a seed set for right-to-left matching
-			i = matchExpr["needsContext"].test( selector ) ? 0 : tokens.length;
-			while ( 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( runescape, funescape ),
-						rsibling.test( tokens[0].type ) && context.parentNode || context
-					)) ) {
-
-						// If seed is empty or no tokens remain, we can return early
-						tokens.splice( i, 1 );
-						selector = seed.length && toSelector( tokens );
-						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,
-		documentIsXML,
-		results,
-		rsibling.test( selector )
-	);
-	return results;
-}
+    // use the active box-sizing model to add/subtract irrelevant styles
+    return ( val +
+        augmentWidthOrHeight(
+            elem,
+            name,
+            extra || ( isBorderBox ? "border" : "content" ),
+            valueIsBorderBox,
+            styles
+        )
+    ) + "px";
+  }
 
-// Deprecated
-Expr.pseudos["nth"] = Expr.pseudos["eq"];
+// Try to determine the default display value of an element
+  function css_defaultDisplay(nodeName) {
+    var doc = document,
+        display = elemdisplay[nodeName];
+
+    if (!display) {
+      display = actualDisplay(nodeName, doc);
+
+      // If the simple way fails, read from inside an iframe
+      if (display === "none" || !display) {
+        // Use the already-created iframe if possible
+        iframe = ( iframe ||
+            jQuery("<iframe frameborder='0' width='0' height='0'/>")
+            .css("cssText", "display:block !important")
+        ).appendTo(doc.documentElement);
+
+        // Always write a new HTML skeleton so Webkit and Firefox don't choke on reuse
+        doc = ( iframe[0].contentWindow || iframe[0].contentDocument ).document;
+        doc.write("<!doctype html><html><body>");
+        doc.close();
+
+        display = actualDisplay(nodeName, doc);
+        iframe.detach();
+      }
 
-// Easy API for creating new setFilters
-function setFilters() {}
-Expr.filters = setFilters.prototype = Expr.pseudos;
-Expr.setFilters = new setFilters();
+      // Store the correct default display
+      elemdisplay[nodeName] = display;
+    }
 
-// Initialize with the default document
-setDocument();
+    return display;
+  }
 
-// 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, ret, self,
-			len = this.length;
-
-		if ( typeof selector !== "string" ) {
-			self = this;
-			return this.pushStack( jQuery( selector ).filter(function() {
-				for ( i = 0; i < len; i++ ) {
-					if ( jQuery.contains( self[ i ], this ) ) {
-						return true;
-					}
-				}
-			}) );
-		}
-
-		ret = [];
-		for ( i = 0; i < len; i++ ) {
-			jQuery.find( selector, this[ i ], ret );
-		}
-
-		// Needed because $( selector, context ) becomes $( context ).find( selector )
-		ret = this.pushStack( len > 1 ? jQuery.unique( ret ) : ret );
-		ret.selector = ( this.selector ? this.selector + " " : "" ) + selector;
-		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) );
-	},
-
-	filter: function( selector ) {
-		return this.pushStack( winnow(this, selector, true) );
-	},
-
-	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;
-			}
-		}
-
-		return this.pushStack( ret.length > 1 ? jQuery.unique( ret ) : ret );
-	},
-
-	// 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.first().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( jQuery.unique(all) );
-	},
-
-	addBack: function( selector ) {
-		return this.add( selector == null ?
-			this.prevObject : this.prevObject.filter(selector)
-		);
-	}
-});
-
-jQuery.fn.andSelf = jQuery.fn.addBack;
-
-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 );
-	};
-});
-
-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;
-	}
-});
+// Called ONLY from within css_defaultDisplay
+  function actualDisplay(name, doc) {
+    var elem = jQuery(doc.createElement(name)).appendTo(doc.body),
+        display = jQuery.css(elem[0], "display");
+    elem.remove();
+    return display;
+  }
 
-// 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 ) {
-			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 ) {
-		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,
-	rnoshimcache = new RegExp("<(?:" + nodeNames + ")[\\s/>]", "i"),
-	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,
-	manipulation_rcheckableType = /^(?:checkbox|radio)$/i,
-	// checked="checked" or checked
-	rchecked = /checked\s*(?:[^=]|=\s*.checked.)/i,
-	rscriptType = /^$|\/(?:java|ecma)script/i,
-	rscriptTypeMasked = /^true\/(.*)/,
-	rcleanScript = /^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g,
-
-	// We have to close these tags to support XHTML (#13200)
-	wrapMap = {
-		option: [ 1, "<select multiple='multiple'>", "</select>" ],
-		legend: [ 1, "<fieldset>", "</fieldset>" ],
-		area: [ 1, "<map>", "</map>" ],
-		param: [ 1, "<object>", "</object>" ],
-		thead: [ 1, "<table>", "</table>" ],
-		tr: [ 2, "<table><tbody>", "</tbody></table>" ],
-		col: [ 2, "<table><tbody></tbody><colgroup>", "</colgroup></table>" ],
-		td: [ 3, "<table><tbody><tr>", "</tr></tbody></table>" ],
-
-		// 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.
-		_default: jQuery.support.htmlSerialize ? [ 0, "", "" ] : [ 1, "X<div>", "</div>"  ]
-	},
-	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;
-
-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.nodeType === 9 ) {
-				this.appendChild( elem );
-			}
-		});
-	},
-
-	prepend: function() {
-		return this.domManip(arguments, true, function( elem ) {
-			if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) {
-				this.insertBefore( elem, this.firstChild );
-			}
-		});
-	},
-
-	before: function() {
-		return this.domManip( arguments, false, function( elem ) {
-			if ( this.parentNode ) {
-				this.parentNode.insertBefore( elem, this );
-			}
-		});
-	},
-
-	after: function() {
-		return this.domManip( arguments, false, function( elem ) {
-			if ( this.parentNode ) {
-				this.parentNode.insertBefore( elem, this.nextSibling );
-			}
-		});
-	},
-
-	// 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 > 0 ) {
-				if ( !keepData && elem.nodeType === 1 ) {
-					jQuery.cleanData( getAll( elem ) );
-				}
-
-				if ( elem.parentNode ) {
-					if ( keepData && jQuery.contains( elem.ownerDocument, elem ) ) {
-						setGlobalEval( getAll( elem, "script" ) );
-					}
-					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( getAll( elem, false ) );
-			}
-
-			// Remove any remaining nodes
-			while ( elem.firstChild ) {
-				elem.removeChild( elem.firstChild );
-			}
-
-			// If this is a select, ensure that it displays empty (#12336)
-			// Support: IE<9
-			if ( elem.options && jQuery.nodeName( elem, "select" ) ) {
-				elem.options.length = 0;
-			}
-		}
-
-		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( getAll( elem, false ) );
-							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 ) {
-		var isFunc = jQuery.isFunction( value );
-
-		// 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 ( !isFunc && typeof value !== "string" ) {
-			value = jQuery( value ).not( this ).detach();
-		}
-
-		return this.domManip( [ value ], true, function( elem ) {
-			var next = this.nextSibling,
-				parent = this.parentNode;
-
-			if ( parent ) {
-				jQuery( this ).remove();
-				parent.insertBefore( elem, next );
-			}
-		});
-	},
-
-	detach: function( selector ) {
-		return this.remove( selector, true );
-	},
-
-	domManip: function( args, table, callback ) {
-
-		// Flatten any nested arrays
-		args = core_concat.apply( [], args );
-
-		var first, node, hasScripts,
-			scripts, doc, fragment,
-			i = 0,
-			l = this.length,
-			set = this,
-			iNoClone = l - 1,
-			value = args[0],
-			isFunction = jQuery.isFunction( value );
-
-		// We can't cloneNode fragments that contain checked, in WebKit
-		if ( isFunction || !( l <= 1 || typeof value !== "string" || jQuery.support.checkClone || !rchecked.test( value ) ) ) {
-			return this.each(function( index ) {
-				var self = set.eq( index );
-				if ( isFunction ) {
-					args[0] = value.call( this, index, table ? self.html() : undefined );
-				}
-				self.domManip( args, table, callback );
-			});
-		}
-
-		if ( l ) {
-			fragment = jQuery.buildFragment( args, this[ 0 ].ownerDocument, false, this );
-			first = fragment.firstChild;
-
-			if ( fragment.childNodes.length === 1 ) {
-				fragment = first;
-			}
-
-			if ( first ) {
-				table = table && jQuery.nodeName( first, "tr" );
-				scripts = jQuery.map( getAll( fragment, "script" ), disableScript );
-				hasScripts = scripts.length;
-
-				// Use the original fragment for the last item instead of the first because it can end up
-				// being emptied incorrectly in certain situations (#8070).
-				for ( ; i < l; i++ ) {
-					node = fragment;
-
-					if ( i !== iNoClone ) {
-						node = jQuery.clone( node, true, true );
-
-						// Keep references to cloned scripts for later restoration
-						if ( hasScripts ) {
-							jQuery.merge( scripts, getAll( node, "script" ) );
-						}
-					}
-
-					callback.call(
-						table && jQuery.nodeName( this[i], "table" ) ?
-							findOrAppend( this[i], "tbody" ) :
-							this[i],
-						node,
-						i
-					);
-				}
-
-				if ( hasScripts ) {
-					doc = scripts[ scripts.length - 1 ].ownerDocument;
-
-					// Reenable scripts
-					jQuery.map( scripts, restoreScript );
-
-					// Evaluate executable scripts on first document insertion
-					for ( i = 0; i < hasScripts; i++ ) {
-						node = scripts[ i ];
-						if ( rscriptType.test( node.type || "" ) &&
-							!jQuery._data( node, "globalEval" ) && jQuery.contains( doc, node ) ) {
-
-							if ( node.src ) {
-								// Hope ajax is available...
-								jQuery.ajax({
-									url: node.src,
-									type: "GET",
-									dataType: "script",
-									async: false,
-									global: false,
-									"throws": true
-								});
-							} else {
-								jQuery.globalEval( ( node.text || node.textContent || node.innerHTML || "" ).replace( rcleanScript, "" ) );
-							}
-						}
-					}
-				}
-
-				// Fix #11809: Avoid leaking memory
-				fragment = first = null;
-			}
-		}
-
-		return this;
-	}
-});
-
-function findOrAppend( elem, tag ) {
-	return elem.getElementsByTagName( tag )[0] || elem.appendChild( elem.ownerDocument.createElement( tag ) );
-}
+  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
+          return elem.offsetWidth === 0 && rdisplayswap.test(
+              jQuery.css(elem, "display")) ? jQuery.swap(elem, cssShow,
+              function () {
+                return getWidthOrHeight(elem, name, extra);
+              }) : getWidthOrHeight(elem, name, extra);
+        }
+      },
+
+      set: function (elem, value, extra) {
+        var styles = extra && getStyles(elem);
+        return setPositiveNumber(elem, value, extra ? augmentWidthOrHeight(
+            elem,
+            name,
+            extra,
+            jQuery.support.boxSizing && jQuery.css(elem, "boxSizing", false,
+            styles) === "border-box",
+            styles
+            ) : 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 === "", then remove inline opacity #12685
+        if (( value >= 1 || value === "" ) &&
+            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 is no filter style applied in a css rule or unset inline opacity, we are done
+          if (value === "" || currentStyle && !currentStyle.filter) {
+            return;
+          }
+        }
 
-// Replace/restore the type attribute of script elements for safe DOM manipulation
-function disableScript( elem ) {
-	var attr = elem.getAttributeNode("type");
-	elem.type = ( attr && attr.specified ) + "/" + elem.type;
-	return elem;
-}
-function restoreScript( elem ) {
-	var match = rscriptTypeMasked.exec( elem.type );
-	if ( match ) {
-		elem.type = match[1];
-	} else {
-		elem.removeAttribute("type");
-	}
-	return elem;
-}
+        // otherwise, set new filter values
+        style.filter = ralpha.test(filter) ? filter.replace(ralpha, opacity)
+            : filter + " " + opacity;
+      }
+    };
+  }
 
-// Mark scripts as having already been evaluated
-function setGlobalEval( elems, refElements ) {
-	var elem,
-		i = 0;
-	for ( ; (elem = elems[i]) != null; i++ ) {
-		jQuery._data( elem, "globalEval", !refElements || jQuery._data( refElements[i], "globalEval" ) );
-	}
-}
-
-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 fixCloneNodeIssues( src, dest ) {
-	var nodeName, e, data;
-
-	// We do not need to do anything for non-Elements
-	if ( dest.nodeType !== 1 ) {
-		return;
-	}
-
-	nodeName = dest.nodeName.toLowerCase();
-
-	// IE6-8 copies events bound via attachEvent when using cloneNode.
-	if ( !jQuery.support.noCloneEvent && dest[ jQuery.expando ] ) {
-		data = jQuery._data( dest );
-
-		for ( e in data.events ) {
-			jQuery.removeEvent( dest, e, data.handle );
-		}
-
-		// Event data gets referenced instead of copied if the expando gets copied too
-		dest.removeAttribute( jQuery.expando );
-	}
-
-	// IE blanks contents when cloning scripts, and tries to evaluate newly-set text
-	if ( nodeName === "script" && dest.text !== src.text ) {
-		disableScript( dest ).text = src.text;
-		restoreScript( dest );
-
-	// IE6-10 improperly clones children of object elements using classid.
-	// IE10 throws NoModificationAllowedError if parent is null, #12132.
-	} else if ( nodeName === "object" ) {
-		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" && manipulation_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.defaultSelected = 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;
-	}
-}
-
-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 ),
-			last = insert.length - 1;
-
-		for ( ; i <= last; i++ ) {
-			elems = i === last ? this : this.clone(true);
-			jQuery( insert[i] )[ original ]( elems );
-
-			// Modern browsers can apply jQuery collections as arrays, but oldIE needs a .get()
-			core_push.apply( ret, elems.get() );
-		}
-
-		return this.pushStack( ret );
-	};
-});
-
-function getAll( context, tag ) {
-	var elems, elem,
-		i = 0,
-		found = typeof context.getElementsByTagName !== core_strundefined ? context.getElementsByTagName( tag || "*" ) :
-			typeof context.querySelectorAll !== core_strundefined ? context.querySelectorAll( tag || "*" ) :
-			undefined;
-
-	if ( !found ) {
-		for ( found = [], elems = context.childNodes || context; (elem = elems[i]) != null; i++ ) {
-			if ( !tag || jQuery.nodeName( elem, tag ) ) {
-				found.push( elem );
-			} else {
-				jQuery.merge( found, getAll( elem, tag ) );
-			}
-		}
-	}
-
-	return tag === undefined || tag && jQuery.nodeName( context, tag ) ?
-		jQuery.merge( [ context ], found ) :
-		found;
-}
+// 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) {
+          if (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"},
+                curCSS, [elem, "marginRight"]);
+          }
+        }
+      };
+    }
 
-// Used in buildFragment, fixes the defaultChecked property
-function fixDefaultChecked( elem ) {
-	if ( manipulation_rcheckableType.test( elem.type ) ) {
-		elem.defaultChecked = elem.checked;
-	}
-}
-
-jQuery.extend({
-	clone: function( elem, dataAndEvents, deepDataAndEvents ) {
-		var destElements, node, clone, i, srcElements,
-			inPage = jQuery.contains( elem.ownerDocument, elem );
-
-		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) ) {
-
-			// We eschew Sizzle here for performance reasons: http://jsperf.com/getall-vs-sizzle/2
-			destElements = getAll( clone );
-			srcElements = getAll( elem );
-
-			// Fix all IE cloning issues
-			for ( i = 0; (node = srcElements[i]) != null; ++i ) {
-				// Ensure that the destination node is not null; Fixes #9587
-				if ( destElements[i] ) {
-					fixCloneNodeIssues( node, destElements[i] );
-				}
-			}
-		}
-
-		// Copy the events from the original to the clone
-		if ( dataAndEvents ) {
-			if ( deepDataAndEvents ) {
-				srcElements = srcElements || getAll( elem );
-				destElements = destElements || getAll( clone );
-
-				for ( i = 0; (node = srcElements[i]) != null; i++ ) {
-					cloneCopyEvent( node, destElements[i] );
-				}
-			} else {
-				cloneCopyEvent( elem, clone );
-			}
-		}
-
-		// Preserve script evaluation history
-		destElements = getAll( clone, "script" );
-		if ( destElements.length > 0 ) {
-			setGlobalEval( destElements, !inPage && getAll( elem, "script" ) );
-		}
-
-		destElements = srcElements = node = null;
-
-		// Return the cloned set
-		return clone;
-	},
-
-	buildFragment: function( elems, context, scripts, selection ) {
-		var j, elem, contains,
-			tmp, tag, tbody, wrap,
-			l = elems.length,
-
-			// Ensure a safe fragment
-			safe = createSafeFragment( context ),
-
-			nodes = [],
-			i = 0;
-
-		for ( ; i < l; i++ ) {
-			elem = elems[ i ];
-
-			if ( elem || elem === 0 ) {
-
-				// Add nodes directly
-				if ( jQuery.type( elem ) === "object" ) {
-					jQuery.merge( nodes, elem.nodeType ? [ elem ] : elem );
-
-				// Convert non-html into a text node
-				} else if ( !rhtml.test( elem ) ) {
-					nodes.push( context.createTextNode( elem ) );
-
-				// Convert html into DOM nodes
-				} else {
-					tmp = tmp || safe.appendChild( context.createElement("div") );
-
-					// Deserialize a standard representation
-					tag = ( rtagName.exec( elem ) || ["", ""] )[1].toLowerCase();
-					wrap = wrapMap[ tag ] || wrapMap._default;
-
-					tmp.innerHTML = wrap[1] + elem.replace( rxhtmlTag, "<$1></$2>" ) + wrap[2];
-
-					// Descend through wrappers to the right content
-					j = wrap[0];
-					while ( j-- ) {
-						tmp = tmp.lastChild;
-					}
-
-					// Manually add leading whitespace removed by IE
-					if ( !jQuery.support.leadingWhitespace && rleadingWhitespace.test( elem ) ) {
-						nodes.push( context.createTextNode( rleadingWhitespace.exec( elem )[0] ) );
-					}
-
-					// Remove IE's autoinserted <tbody> from table fragments
-					if ( !jQuery.support.tbody ) {
-
-						// String was a <table>, *may* have spurious <tbody>
-						elem = tag === "table" && !rtbody.test( elem ) ?
-							tmp.firstChild :
-
-							// String was a bare <thead> or <tfoot>
-							wrap[1] === "<table>" && !rtbody.test( elem ) ?
-								tmp :
-								0;
-
-						j = elem && elem.childNodes.length;
-						while ( j-- ) {
-							if ( jQuery.nodeName( (tbody = elem.childNodes[j]), "tbody" ) && !tbody.childNodes.length ) {
-								elem.removeChild( tbody );
-							}
-						}
-					}
-
-					jQuery.merge( nodes, tmp.childNodes );
-
-					// Fix #12392 for WebKit and IE > 9
-					tmp.textContent = "";
-
-					// Fix #12392 for oldIE
-					while ( tmp.firstChild ) {
-						tmp.removeChild( tmp.firstChild );
-					}
-
-					// Remember the top-level container for proper cleanup
-					tmp = safe.lastChild;
-				}
-			}
-		}
-
-		// Fix #11356: Clear elements from fragment
-		if ( tmp ) {
-			safe.removeChild( tmp );
-		}
-
-		// Reset defaultChecked for any radios and checkboxes
-		// about to be appended to the DOM in IE 6/7 (#8060)
-		if ( !jQuery.support.appendChecked ) {
-			jQuery.grep( getAll( nodes, "input" ), fixDefaultChecked );
-		}
-
-		i = 0;
-		while ( (elem = nodes[ i++ ]) ) {
-
-			// #4087 - If origin and destination elements are the same, and this is
-			// that element, do not do anything
-			if ( selection && jQuery.inArray( elem, selection ) !== -1 ) {
-				continue;
-			}
-
-			contains = jQuery.contains( elem.ownerDocument, elem );
-
-			// Append to fragment
-			tmp = getAll( safe.appendChild( elem ), "script" );
-
-			// Preserve script evaluation history
-			if ( contains ) {
-				setGlobalEval( tmp );
-			}
-
-			// Capture executables
-			if ( scripts ) {
-				j = 0;
-				while ( (elem = tmp[ j++ ]) ) {
-					if ( rscriptType.test( elem.type || "" ) ) {
-						scripts.push( elem );
-					}
-				}
-			}
-		}
-
-		tmp = null;
-
-		return safe;
-	},
-
-	cleanData: function( elems, /* internal */ acceptData ) {
-		var elem, type, id, data,
-			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 ( typeof elem.removeAttribute !== core_strundefined ) {
-							elem.removeAttribute( internalKey );
-
-						} else {
-							elem[ internalKey ] = null;
-						}
-
-						core_deletedIds.push( id );
-					}
-				}
-			}
-		}
-	}
-});
-var iframe, getStyles, curCSS,
-	ralpha = /alpha\([^)]*\)/i,
-	ropacity = /opacity\s*=\s*([^)]*)/,
-	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 = { BODY: "block" },
-
-	cssShow = { position: "absolute", visibility: "hidden", display: "block" },
-	cssNormalTransform = {
-		letterSpacing: 0,
-		fontWeight: 400
-	},
-
-	cssExpand = [ "Top", "Right", "Bottom", "Left" ],
-	cssPrefixes = [ "Webkit", "O", "Moz", "ms" ];
+    // 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) {
+              computed = curCSS(elem, prop);
+              // if curCSS returns percentage, fallback to offset
+              return rnumnonpx.test(computed) ? jQuery(elem).position()[prop]
+                  + "px" : computed;
+            }
+          }
+        };
+      });
+    }
 
-// 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 ) {
-	// isHidden might be called from jQuery#filter function;
-	// in that case, element will be second argument
-	elem = el || elem;
-	return jQuery.css( elem, "display" ) === "none" || !jQuery.contains( elem.ownerDocument, elem );
-}
-
-function showHide( elements, show ) {
-	var display, elem, hidden,
-		values = [],
-		index = 0,
-		length = elements.length;
-
-	for ( ; index < length; index++ ) {
-		elem = elements[ index ];
-		if ( !elem.style ) {
-			continue;
-		}
-
-		values[ index ] = jQuery._data( elem, "olddisplay" );
-		display = elem.style.display;
-		if ( show ) {
-			// Reset the inline display of this element to learn if it is
-			// being hidden by cascaded rules or not
-			if ( !values[ index ] && 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 {
-
-			if ( !values[ index ] ) {
-				hidden = isHidden( elem );
-
-				if ( display && display !== "none" || !hidden ) {
-					jQuery._data( elem, "olddisplay", hidden ? display : jQuery.css( elem, "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 ) {
-			var len, styles,
-				map = {},
-				i = 0;
-
-			if ( jQuery.isArray( name ) ) {
-				styles = getStyles( elem );
-				len = name.length;
-
-				for ( ; i < len; i++ ) {
-					map[ name[ i ] ] = jQuery.css( elem, name[ i ], false, styles );
-				}
-
-				return map;
-			}
-
-			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 ) {
-		var bool = typeof state === "boolean";
-
-		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: {
-		"columnCount": true,
-		"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";
-			}
-
-			// Fixes #8908, it can be done more correctly by specifing setters in cssHooks,
-			// but it would mean to define eight (for every problematic property) identical functions
-			if ( !jQuery.support.clearCloneStyle && value === "" && name.indexOf("background") === 0 ) {
-				style[ name ] = "inherit";
-			}
-
-			// 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, extra, styles ) {
-		var num, val, 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, styles );
-		}
-
-		//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 ( extra === "" || extra ) {
-			num = parseFloat( val );
-			return extra === true || 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, args ) {
-		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.apply( elem, args || [] );
-
-		// Revert the old values
-		for ( name in options ) {
-			elem.style[ name ] = old[ name ];
-		}
-
-		return ret;
-	}
-});
+  });
+
+  if (jQuery.expr && jQuery.expr.filters) {
+    jQuery.expr.filters.hidden = function (elem) {
+      // Support: Opera <= 12.12
+      // Opera reports offsetWidths and offsetHeights less than zero on some elements
+      return elem.offsetWidth <= 0 && elem.offsetHeight <= 0 ||
+          (!jQuery.support.reliableHiddenOffsets && ((elem.style
+              && elem.style.display) || jQuery.css(elem, "display"))
+              === "none");
+    };
+
+    jQuery.expr.filters.visible = function (elem) {
+      return !jQuery.expr.filters.hidden(elem);
+    };
+  }
 
-// NOTE: we've included the "window" in window.getComputedStyle
-// because jsdom on node.js will break without it.
-if ( window.getComputedStyle ) {
-	getStyles = function( elem ) {
-		return window.getComputedStyle( elem, null );
-	};
-
-	curCSS = function( elem, name, _computed ) {
-		var width, minWidth, maxWidth,
-			computed = _computed || getStyles( elem ),
-
-			// getPropertyValue is only needed for .css('filter') in IE9, see #12537
-			ret = computed ? computed.getPropertyValue( name ) || computed[ name ] : undefined,
-			style = elem.style;
-
-		if ( computed ) {
-
-			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 ) ) {
-
-				// Remember the original values
-				width = style.width;
-				minWidth = style.minWidth;
-				maxWidth = style.maxWidth;
-
-				// Put in the new values to get a computed value out
-				style.minWidth = style.maxWidth = style.width = ret;
-				ret = computed.width;
-
-				// Revert the changed values
-				style.width = width;
-				style.minWidth = minWidth;
-				style.maxWidth = maxWidth;
-			}
-		}
-
-		return ret;
-	};
-} else if ( document.documentElement.currentStyle ) {
-	getStyles = function( elem ) {
-		return elem.currentStyle;
-	};
-
-	curCSS = function( elem, name, _computed ) {
-		var left, rs, rsLeft,
-			computed = _computed || getStyles( elem ),
-			ret = computed ? computed[ name ] : undefined,
-			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;
-			rs = elem.runtimeStyle;
-			rsLeft = rs && rs.left;
-
-			// Put in the new values to get a computed value out
-			if ( rsLeft ) {
-				rs.left = elem.currentStyle.left;
-			}
-			style.left = name === "fontSize" ? "1em" : ret;
-			ret = style.pixelLeft + "px";
-
-			// Revert the changed values
-			style.left = left;
-			if ( rsLeft ) {
-				rs.left = rsLeft;
-			}
-		}
-
-		return ret === "" ? "auto" : ret;
-	};
-}
-
-function setPositiveNumber( elem, value, subtract ) {
-	var matches = rnumsplit.exec( value );
-	return matches ?
-		// Guard against undefined "subtract", e.g., when used as in cssHooks
-		Math.max( 0, matches[ 1 ] - ( subtract || 0 ) ) + ( matches[ 2 ] || "px" ) :
-		value;
-}
-
-function augmentWidthOrHeight( elem, name, extra, isBorderBox, styles ) {
-	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" ) {
-			val += jQuery.css( elem, extra + cssExpand[ i ], true, styles );
-		}
-
-		if ( isBorderBox ) {
-			// border-box includes padding, so remove it if we want content
-			if ( extra === "content" ) {
-				val -= jQuery.css( elem, "padding" + cssExpand[ i ], true, styles );
-			}
-
-			// at this point, extra isn't border nor margin, so remove border
-			if ( extra !== "margin" ) {
-				val -= jQuery.css( elem, "border" + cssExpand[ i ] + "Width", true, styles );
-			}
-		} else {
-			// at this point, extra isn't content, so add padding
-			val += jQuery.css( elem, "padding" + cssExpand[ i ], true, styles );
-
-			// at this point, extra isn't content nor padding, so add border
-			if ( extra !== "padding" ) {
-				val += jQuery.css( elem, "border" + cssExpand[ i ] + "Width", true, styles );
-			}
-		}
-	}
-
-	return val;
-}
-
-function getWidthOrHeight( elem, name, extra ) {
-
-	// Start with offset property, which is equivalent to the border-box value
-	var valueIsBorderBox = true,
-		val = name === "width" ? elem.offsetWidth : elem.offsetHeight,
-		styles = getStyles( elem ),
-		isBorderBox = jQuery.support.boxSizing && jQuery.css( elem, "boxSizing", false, styles ) === "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, styles );
-		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,
-			styles
-		)
-	) + "px";
-}
+// 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 = 0,
+            expanded = {},
+
+            // assumes a single number if not a string
+            parts = typeof value === "string" ? value.split(" ") : [value];
+
+        for (; i < 4; i++) {
+          expanded[prefix + cssExpand[i] + suffix] =
+              parts[i] || parts[i - 2] || parts[0];
+        }
 
-// Try to determine the default display value of an element
-function css_defaultDisplay( nodeName ) {
-	var doc = document,
-		display = elemdisplay[ nodeName ];
+        return expanded;
+      }
+    };
 
-	if ( !display ) {
-		display = actualDisplay( nodeName, doc );
+    if (!rmargin.test(prefix)) {
+      jQuery.cssHooks[prefix + suffix].set = setPositiveNumber;
+    }
+  });
+  var r20 = /%20/g,
+      rbracket = /\[\]$/,
+      rCRLF = /\r?\n/g,
+      rsubmitterTypes = /^(?:submit|button|image|reset|file)$/i,
+      rsubmittable = /^(?:input|select|textarea|keygen)/i;
+
+  jQuery.fn.extend({
+    serialize: function () {
+      return jQuery.param(this.serializeArray());
+    },
+    serializeArray: function () {
+      return this.map(function () {
+        // Can add propHook for "elements" to filter or add form elements
+        var elements = jQuery.prop(this, "elements");
+        return elements ? jQuery.makeArray(elements) : this;
+      })
+      .filter(function () {
+        var type = this.type;
+        // Use .is(":disabled") so that fieldset[disabled] works
+        return this.name && !jQuery(this).is(":disabled") &&
+            rsubmittable.test(this.nodeName) && !rsubmitterTypes.test(type) &&
+            ( this.checked || !manipulation_rcheckableType.test(type) );
+      })
+      .map(function (i, elem) {
+        var val = jQuery(this).val();
+
+        return val == null ? null : jQuery.isArray(val) ? jQuery.map(val,
+            function (val) {
+              return {name: elem.name, value: val.replace(rCRLF, "\r\n")};
+            }) : {name: elem.name, value: val.replace(rCRLF, "\r\n")};
+      }).get();
+    }
+  });
 
-		// If the simple way fails, read from inside an iframe
-		if ( display === "none" || !display ) {
-			// Use the already-created iframe if possible
-			iframe = ( iframe ||
-				jQuery("<iframe frameborder='0' width='0' height='0'/>")
-				.css( "cssText", "display:block !important" )
-			).appendTo( doc.documentElement );
+//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;
+    }
 
-			// Always write a new HTML skeleton so Webkit and Firefox don't choke on reuse
-			doc = ( iframe[0].contentWindow || iframe[0].contentDocument ).document;
-			doc.write("<!doctype html><html><body>");
-			doc.close();
+    // 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);
+      }
+    }
 
-			display = actualDisplay( nodeName, doc );
-			iframe.detach();
-		}
+    // Return the resulting serialization
+    return s.join("&").replace(r20, "+");
+  };
 
-		// Store the correct default display
-		elemdisplay[ nodeName ] = display;
-	}
+  function buildParams(prefix, obj, traditional, add) {
+    var name;
 
-	return display;
-}
+    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);
 
-// Called ONLY from within css_defaultDisplay
-function actualDisplay( name, doc ) {
-	var elem = jQuery( doc.createElement( name ) ).appendTo( doc.body ),
-		display = jQuery.css( elem[0], "display" );
-	elem.remove();
-	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
-				return elem.offsetWidth === 0 && rdisplayswap.test( jQuery.css( elem, "display" ) ) ?
-					jQuery.swap( elem, cssShow, function() {
-						return getWidthOrHeight( elem, name, extra );
-					}) :
-					getWidthOrHeight( elem, name, extra );
-			}
-		},
-
-		set: function( elem, value, extra ) {
-			var styles = extra && getStyles( elem );
-			return setPositiveNumber( elem, value, extra ?
-				augmentWidthOrHeight(
-					elem,
-					name,
-					extra,
-					jQuery.support.boxSizing && jQuery.css( elem, "boxSizing", false, styles ) === "border-box",
-					styles
-				) : 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 === "", then remove inline opacity #12685
-			if ( ( value >= 1 || value === "" ) &&
-					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 is no filter style applied in a css rule or unset inline opacity, we are done
-				if ( value === "" || currentStyle && !currentStyle.filter ) {
-					return;
-				}
-			}
-
-			// otherwise, set new filter values
-			style.filter = ralpha.test( filter ) ?
-				filter.replace( ralpha, opacity ) :
-				filter + " " + opacity;
-		}
-	};
-}
+        } else {
+          // Item is non-scalar (array or object), encode its numeric index.
+          buildParams(prefix + "[" + ( typeof v === "object" ? i : "" ) + "]",
+              v, traditional, add);
+        }
+      });
 
-// 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 ) {
-				if ( 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" },
-						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 ) {
-						computed = curCSS( elem, prop );
-						// if curCSS returns percentage, fallback to offset
-						return rnumnonpx.test( computed ) ?
-							jQuery( elem ).position()[ prop ] + "px" :
-							computed;
-					}
-				}
-			};
-		});
-	}
-
-});
-
-if ( jQuery.expr && jQuery.expr.filters ) {
-	jQuery.expr.filters.hidden = function( elem ) {
-		// Support: Opera <= 12.12
-		// Opera reports offsetWidths and offsetHeights less than zero on some elements
-		return elem.offsetWidth <= 0 && elem.offsetHeight <= 0 ||
-			(!jQuery.support.reliableHiddenOffsets && ((elem.style && elem.style.display) || jQuery.css( elem, "display" )) === "none");
-	};
-
-	jQuery.expr.filters.visible = function( elem ) {
-		return !jQuery.expr.filters.hidden( elem );
-	};
-}
+    } else if (!traditional && jQuery.type(obj) === "object") {
+      // Serialize object item.
+      for (name in obj) {
+        buildParams(prefix + "[" + name + "]", obj[name], traditional, add);
+      }
 
-// 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 = 0,
-				expanded = {},
-
-				// assumes a single number if not a string
-				parts = typeof value === "string" ? value.split(" ") : [ value ];
-
-			for ( ; 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,
-	rsubmitterTypes = /^(?:submit|button|image|reset|file)$/i,
-	rsubmittable = /^(?:input|select|textarea|keygen)/i;
-
-jQuery.fn.extend({
-	serialize: function() {
-		return jQuery.param( this.serializeArray() );
-	},
-	serializeArray: function() {
-		return this.map(function(){
-			// Can add propHook for "elements" to filter or add form elements
-			var elements = jQuery.prop( this, "elements" );
-			return elements ? jQuery.makeArray( elements ) : this;
-		})
-		.filter(function(){
-			var type = this.type;
-			// Use .is(":disabled") so that fieldset[disabled] works
-			return this.name && !jQuery( this ).is( ":disabled" ) &&
-				rsubmittable.test( this.nodeName ) && !rsubmitterTypes.test( type ) &&
-				( this.checked || !manipulation_rcheckableType.test( type ) );
-		})
-		.map(function( i, elem ){
-			var val = jQuery( this ).val();
-
-			return val == null ?
-				null :
-				jQuery.isArray( val ) ?
-					jQuery.map( val, function( val ){
-						return { name: elem.name, value: val.replace( rCRLF, "\r\n" ) };
-					}) :
-					{ name: elem.name, value: val.replace( rCRLF, "\r\n" ) };
-		}).get();
-	}
-});
+    } else {
+      // Serialize scalar item.
+      add(prefix, obj);
+    }
+  }
 
-//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 {
-				// Item is non-scalar (array or object), encode its numeric index.
-				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 );
-	}
-}
-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 ) {
-		return arguments.length > 0 ?
-			this.on( name, null, data, fn ) :
-			this.trigger( name );
-	};
-});
-
-jQuery.fn.hover = function( fnOver, fnOut ) {
-	return this.mouseenter( fnOver ).mouseleave( fnOut || fnOver );
-};
-var
-	// Document location
-	ajaxLocParts,
-	ajaxLocation,
-	ajax_nonce = jQuery.now(),
-
-	ajax_rquery = /\?/,
-	rhash = /#.*$/,
-	rts = /([?&])_=[^&]*/,
-	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 = /^\/\//,
-	rurl = /^([\w.+-]+:)(?:\/\/([^\/?#:]*)(?::(\d+)|)|)/,
-
-	// Keep a copy of the old load method
-	_load = jQuery.fn.load,
-
-	/* Prefilters
+  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) {
+          return arguments.length > 0 ? this.on(name, null, data, fn)
+              : this.trigger(name);
+        };
+      });
+
+  jQuery.fn.hover = function (fnOver, fnOut) {
+    return this.mouseenter(fnOver).mouseleave(fnOut || fnOver);
+  };
+  var
+      // Document location
+      ajaxLocParts,
+      ajaxLocation,
+      ajax_nonce = jQuery.now(),
+
+      ajax_rquery = /\?/,
+      rhash = /#.*$/,
+      rts = /([?&])_=[^&]*/,
+      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 = /^\/\//,
+      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
@@ -7435,210 +7539,214 @@ var
 	 * 4) the catchall symbol "*" can be used
 	 * 5) execution will start with transport dataType and THEN continue down to "*" if needed
 	 */
-	prefilters = {},
+      prefilters = {},
 
-	/* Transports bindings
+      /* 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 = {},
+      transports = {},
 
-	// Avoid comment-prolog char sequence (#10098); must appease lint and evade compression
-	allTypes = "*/".concat("*");
+      // Avoid comment-prolog char sequence (#10098); must appease lint and evade compression
+      allTypes = "*/".concat("*");
 
 // #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;
-}
+  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() ) || [];
+  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,
-			i = 0,
-			dataTypes = dataTypeExpression.toLowerCase().match( core_rnotwhite ) || [];
-
-		if ( jQuery.isFunction( func ) ) {
-			// For each dataType in the dataTypeExpression
-			while ( (dataType = dataTypes[i++]) ) {
-				// Prepend if requested
-				if ( dataType[0] === "+" ) {
-					dataType = dataType.slice( 1 ) || "*";
-					(structure[ dataType ] = structure[ dataType ] || []).unshift( func );
-
-				// Otherwise append
-				} else {
-					(structure[ dataType ] = structure[ dataType ] || []).push( func );
-				}
-			}
-		}
-	};
-}
+  function addToPrefiltersOrTransports(structure) {
+
+    // dataTypeExpression is optional and defaults to "*"
+    return function (dataTypeExpression, func) {
+
+      if (typeof dataTypeExpression !== "string") {
+        func = dataTypeExpression;
+        dataTypeExpression = "*";
+      }
+
+      var dataType,
+          i = 0,
+          dataTypes = dataTypeExpression.toLowerCase().match(core_rnotwhite)
+              || [];
+
+      if (jQuery.isFunction(func)) {
+        // For each dataType in the dataTypeExpression
+        while ((dataType = dataTypes[i++])) {
+          // Prepend if requested
+          if (dataType[0] === "+") {
+            dataType = dataType.slice(1) || "*";
+            (structure[dataType] = structure[dataType] || []).unshift(func);
+
+            // Otherwise append
+          } else {
+            (structure[dataType] = structure[dataType] || []).push(func);
+          }
+        }
+      }
+    };
+  }
 
 // Base inspection function for prefilters and transports
-function inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR ) {
-
-	var inspected = {},
-		seekingTransport = ( structure === transports );
-
-	function inspect( dataType ) {
-		var selected;
-		inspected[ dataType ] = true;
-		jQuery.each( structure[ dataType ] || [], function( _, prefilterOrFactory ) {
-			var dataTypeOrTransport = prefilterOrFactory( options, originalOptions, jqXHR );
-			if( typeof dataTypeOrTransport === "string" && !seekingTransport && !inspected[ dataTypeOrTransport ] ) {
-				options.dataTypes.unshift( dataTypeOrTransport );
-				inspect( dataTypeOrTransport );
-				return false;
-			} else if ( seekingTransport ) {
-				return !( selected = dataTypeOrTransport );
-			}
-		});
-		return selected;
-	}
-
-	return inspect( options.dataTypes[ 0 ] ) || !inspected[ "*" ] && inspect( "*" );
-}
+  function inspectPrefiltersOrTransports(structure, options, originalOptions,
+      jqXHR) {
+
+    var inspected = {},
+        seekingTransport = ( structure === transports );
+
+    function inspect(dataType) {
+      var selected;
+      inspected[dataType] = true;
+      jQuery.each(structure[dataType] || [], function (_, prefilterOrFactory) {
+        var dataTypeOrTransport = prefilterOrFactory(options, originalOptions,
+            jqXHR);
+        if (typeof dataTypeOrTransport === "string" && !seekingTransport
+            && !inspected[dataTypeOrTransport]) {
+          options.dataTypes.unshift(dataTypeOrTransport);
+          inspect(dataTypeOrTransport);
+          return false;
+        } else if (seekingTransport) {
+          return !( selected = dataTypeOrTransport );
+        }
+      });
+      return selected;
+    }
+
+    return inspect(options.dataTypes[0]) || !inspected["*"] && inspect("*");
+  }
 
 // A special extend for ajax options
 // that takes "flat" options (not to be deep extended)
 // Fixes #9887
-function ajaxExtend( target, src ) {
-	var deep, key,
-		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 );
-	}
-
-	return target;
-}
-
-jQuery.fn.load = function( url, params, callback ) {
-	if ( typeof url !== "string" && _load ) {
-		return _load.apply( this, arguments );
-	}
-
-	var selector, response, type,
-		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";
-	}
-
-	// If we have elements to modify, make the request
-	if ( self.length > 0 ) {
-		jQuery.ajax({
-			url: url,
-
-			// if "type" variable is undefined, then "GET" method will be used
-			type: type,
-			dataType: "html",
-			data: params
-		}).done(function( responseText ) {
-
-			// Save response for use in complete callback
-			response = arguments;
-
-			self.html( selector ?
-
-				// If a selector was specified, locate the right elements in a dummy div
-				// Exclude scripts to avoid IE 'Permission Denied' errors
-				jQuery("<div>").append( jQuery.parseHTML( responseText ) ).find( selector ) :
-
-				// Otherwise use the full result
-				responseText );
-
-		}).complete( callback && function( jqXHR, status ) {
-			self.each( callback, response || [ jqXHR.responseText, status, jqXHR ] );
-		});
-	}
-
-	return this;
-};
+  function ajaxExtend(target, src) {
+    var deep, key,
+        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);
+    }
+
+    return target;
+  }
+
+  jQuery.fn.load = function (url, params, callback) {
+    if (typeof url !== "string" && _load) {
+      return _load.apply(this, arguments);
+    }
+
+    var selector, response, type,
+        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";
+    }
+
+    // If we have elements to modify, make the request
+    if (self.length > 0) {
+      jQuery.ajax({
+        url: url,
+
+        // if "type" variable is undefined, then "GET" method will be used
+        type: type,
+        dataType: "html",
+        data: params
+      }).done(function (responseText) {
+
+        // Save response for use in complete callback
+        response = arguments;
+
+        self.html(selector
+            ? // If a selector was specified, locate the right elements in a dummy div
+            // Exclude scripts to avoid IE 'Permission Denied' errors
+            jQuery("<div>").append(jQuery.parseHTML(responseText)).find(
+                selector) : // Otherwise use the full result
+            responseText);
+
+      }).complete(callback && function (jqXHR, status) {
+        self.each(callback, response || [jqXHR.responseText, status, jqXHR]);
+      });
+    }
+
+    return this;
+  };
 
 // Attach a bunch of functions for handling common AJAX events
-jQuery.each( [ "ajaxStart", "ajaxStop", "ajaxComplete", "ajaxError", "ajaxSuccess", "ajaxSend" ], function( i, type ){
-	jQuery.fn[ type ] = function( fn ){
-		return this.on( type, fn );
-	};
-});
-
-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({
-			url: url,
-			type: method,
-			dataType: type,
-			data: data,
-			success: callback
-		});
-	};
-});
-
-jQuery.extend({
-
-	// Counter for holding the number of active queries
-	active: 0,
-
-	// Last-Modified header cache for next request
-	lastModified: {},
-	etag: {},
-
-	ajaxSettings: {
-		url: ajaxLocation,
-		type: "GET",
-		isLocal: rlocalProtocol.test( ajaxLocParts[ 1 ] ),
-		global: true,
-		processData: true,
-		async: true,
-		contentType: "application/x-www-form-urlencoded; charset=UTF-8",
-		/*
+  jQuery.each(
+      ["ajaxStart", "ajaxStop", "ajaxComplete", "ajaxError", "ajaxSuccess",
+        "ajaxSend"], function (i, type) {
+        jQuery.fn[type] = function (fn) {
+          return this.on(type, fn);
+        };
+      });
+
+  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({
+        url: url,
+        type: method,
+        dataType: type,
+        data: data,
+        success: callback
+      });
+    };
+  });
+
+  jQuery.extend({
+
+    // Counter for holding the number of active queries
+    active: 0,
+
+    // Last-Modified header cache for next request
+    lastModified: {},
+    etag: {},
+
+    ajaxSettings: {
+      url: ajaxLocation,
+      type: "GET",
+      isLocal: rlocalProtocol.test(ajaxLocParts[1]),
+      global: true,
+      processData: true,
+      async: true,
+      contentType: "application/x-www-form-urlencoded; charset=UTF-8",
+      /*
 		timeout: 0,
 		data: null,
 		dataType: null,
@@ -7650,529 +7758,533 @@ jQuery.extend({
 		headers: {},
 		*/
 
-		accepts: {
-			"*": allTypes,
-			text: "text/plain",
-			html: "text/html",
-			xml: "application/xml, text/xml",
-			json: "application/json, text/javascript"
-		},
-
-		contents: {
-			xml: /xml/,
-			html: /html/,
-			json: /json/
-		},
-
-		responseFields: {
-			xml: "responseXML",
-			text: "responseText"
-		},
-
-		// Data converters
-		// Keys separate source (or catchall "*") and destination types with a single space
-		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: {
-			url: true,
-			context: true
-		}
-	},
-
-	// 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 ) {
-		return settings ?
-
-			// Building a settings object
-			ajaxExtend( ajaxExtend( target, jQuery.ajaxSettings ), settings ) :
-
-			// Extending ajaxSettings
-			ajaxExtend( jQuery.ajaxSettings, target );
-	},
-
-	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 // Cross-domain detection vars
-			parts,
-			// Loop variable
-			i,
-			// URL without anti-cache param
-			cacheURL,
-			// Response headers as string
-			responseHeadersString,
-			// timeout handle
-			timeoutTimer,
-
-			// To know if global events are to be dispatched
-			fireGlobals,
-
-			transport,
-			// Response headers
-			responseHeaders,
-			// Create the final options object
-			s = jQuery.ajaxSetup( {}, options ),
-			// Callbacks context
-			callbackContext = s.context || s,
-			// Context for global events is callbackContext if it is a DOM node or jQuery collection
-			globalEventContext = s.context && ( callbackContext.nodeType || callbackContext.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,
-
-				// 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 == null ? null : match;
-				},
-
-				// Raw string
-				getAllResponseHeaders: function() {
-					return state === 2 ? responseHeadersString : null;
-				},
-
-				// Caches the header
-				setRequestHeader: function( name, value ) {
-					var lname = name.toLowerCase();
-					if ( !state ) {
-						name = requestHeadersNames[ lname ] = requestHeadersNames[ lname ] || name;
-						requestHeaders[ name ] = value;
-					}
-					return this;
-				},
-
-				// Overrides response content-type header
-				overrideMimeType: function( type ) {
-					if ( !state ) {
-						s.mimeType = type;
-					}
-					return this;
-				},
-
-				// Status-dependent callbacks
-				statusCode: function( map ) {
-					var code;
-					if ( map ) {
-						if ( state < 2 ) {
-							for ( code in map ) {
-								// Lazy-add the new callback in a way that preserves old ones
-								statusCode[ code ] = [ statusCode[ code ], map[ code ] ];
-							}
-						} else {
-							// Execute the appropriate callbacks
-							jqXHR.always( map[ jqXHR.status ] );
-						}
-					}
-					return this;
-				},
-
-				// Cancel the request
-				abort: function( statusText ) {
-					var finalText = statusText || strAbort;
-					if ( transport ) {
-						transport.abort( finalText );
-					}
-					done( 0, finalText );
-					return this;
-				}
-			};
-
-		// Attach deferreds
-		deferred.promise( jqXHR ).complete = completeDeferred.add;
-		jqXHR.success = jqXHR.done;
-		jqXHR.error = jqXHR.fail;
-
-		// Remove hash character (#7531: and string promotion)
-		// Add protocol if not provided (#5866: IE7 issue with protocol-less urls)
-		// Handle falsy url in the settings object (#10093: consistency with old signature)
-		// We also use the url parameter if available
-		s.url = ( ( url || s.url || ajaxLocation ) + "" ).replace( rhash, "" ).replace( rprotocol, ajaxLocParts[ 1 ] + "//" );
-
-		// Alias method option to type as per ticket #12004
-		s.type = options.method || options.type || s.method || s.type;
-
-		// Extract dataTypes list
-		s.dataTypes = jQuery.trim( s.dataType || "*" ).toLowerCase().match( core_rnotwhite ) || [""];
-
-		// 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() );
-			s.crossDomain = !!( parts &&
-				( parts[ 1 ] !== ajaxLocParts[ 1 ] || parts[ 2 ] !== ajaxLocParts[ 2 ] ||
-					( parts[ 3 ] || ( parts[ 1 ] === "http:" ? 80 : 443 ) ) !=
-						( 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;
-
-		// Watch for a new set of requests
-		if ( fireGlobals && jQuery.active++ === 0 ) {
-			jQuery.event.trigger("ajaxStart");
-		}
-
-		// Uppercase the type
-		s.type = s.type.toUpperCase();
-
-		// Determine if request has content
-		s.hasContent = !rnoContent.test( s.type );
-
-		// Save the URL in case we're toying with the If-Modified-Since
-		// and/or If-None-Match header later on
-		cacheURL = s.url;
-
-		// More options handling for requests with no content
-		if ( !s.hasContent ) {
-
-			// If data is available, append data to url
-			if ( s.data ) {
-				cacheURL = ( s.url += ( ajax_rquery.test( cacheURL ) ? "&" : "?" ) + s.data );
-				// #9682: remove data so that it's not used in an eventual retry
-				delete s.data;
-			}
-
-			// Add anti-cache in url if needed
-			if ( s.cache === false ) {
-				s.url = rts.test( cacheURL ) ?
-
-					// If there is already a '_' parameter, set its value
-					cacheURL.replace( rts, "$1_=" + ajax_nonce++ ) :
-
-					// Otherwise add one to the end
-					cacheURL + ( ajax_rquery.test( cacheURL ) ? "&" : "?" ) + "_=" + ajax_nonce++;
-			}
-		}
-
-		// Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode.
-		if ( s.ifModified ) {
-			if ( jQuery.lastModified[ cacheURL ] ) {
-				jqXHR.setRequestHeader( "If-Modified-Since", jQuery.lastModified[ cacheURL ] );
-			}
-			if ( jQuery.etag[ cacheURL ] ) {
-				jqXHR.setRequestHeader( "If-None-Match", jQuery.etag[ cacheURL ] );
-			}
-		}
-
-		// 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 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;
-				}
-			}
-		}
-
-		// Callback for when everything is done
-		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[ cacheURL ] = modified;
-					}
-					modified = jqXHR.getResponseHeader("etag");
-					if ( modified ) {
-						jQuery.etag[ cacheURL ] = modified;
-					}
-				}
-
-				// if no content
-				if ( status === 204 ) {
-					isSuccess = true;
-					statusText = "nocontent";
-
-				// if not modified
-				} else if ( status === 304 ) {
-					isSuccess = true;
-					statusText = "notmodified";
-
-				// If we have data, let's convert it
-				} 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 ( status || !statusText ) {
-					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( isSuccess ? "ajaxSuccess" : "ajaxError",
-					[ 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");
-				}
-			}
-		}
-
-		return jqXHR;
-	},
-
-	getScript: function( url, callback ) {
-		return jQuery.get( url, undefined, callback, "script" );
-	},
-
-	getJSON: function( url, data, callback ) {
-		return jQuery.get( url, data, callback, "json" );
-	}
-});
-
-/* Handles responses to an ajax request:
+      accepts: {
+        "*": allTypes,
+        text: "text/plain",
+        html: "text/html",
+        xml: "application/xml, text/xml",
+        json: "application/json, text/javascript"
+      },
+
+      contents: {
+        xml: /xml/,
+        html: /html/,
+        json: /json/
+      },
+
+      responseFields: {
+        xml: "responseXML",
+        text: "responseText"
+      },
+
+      // Data converters
+      // Keys separate source (or catchall "*") and destination types with a single space
+      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: {
+        url: true,
+        context: true
+      }
+    },
+
+    // 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) {
+      return settings ? // Building a settings object
+          ajaxExtend(ajaxExtend(target, jQuery.ajaxSettings), settings)
+          : // Extending ajaxSettings
+          ajaxExtend(jQuery.ajaxSettings, target);
+    },
+
+    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 // Cross-domain detection vars
+          parts,
+          // Loop variable
+          i,
+          // URL without anti-cache param
+          cacheURL,
+          // Response headers as string
+          responseHeadersString,
+          // timeout handle
+          timeoutTimer,
+
+          // To know if global events are to be dispatched
+          fireGlobals,
+
+          transport,
+          // Response headers
+          responseHeaders,
+          // Create the final options object
+          s = jQuery.ajaxSetup({}, options),
+          // Callbacks context
+          callbackContext = s.context || s,
+          // Context for global events is callbackContext if it is a DOM node or jQuery collection
+          globalEventContext = s.context && ( callbackContext.nodeType
+              || callbackContext.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,
+
+            // 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 == null ? null : match;
+            },
+
+            // Raw string
+            getAllResponseHeaders: function () {
+              return state === 2 ? responseHeadersString : null;
+            },
+
+            // Caches the header
+            setRequestHeader: function (name, value) {
+              var lname = name.toLowerCase();
+              if (!state) {
+                name = requestHeadersNames[lname] = requestHeadersNames[lname]
+                    || name;
+                requestHeaders[name] = value;
+              }
+              return this;
+            },
+
+            // Overrides response content-type header
+            overrideMimeType: function (type) {
+              if (!state) {
+                s.mimeType = type;
+              }
+              return this;
+            },
+
+            // Status-dependent callbacks
+            statusCode: function (map) {
+              var code;
+              if (map) {
+                if (state < 2) {
+                  for (code in map) {
+                    // Lazy-add the new callback in a way that preserves old ones
+                    statusCode[code] = [statusCode[code], map[code]];
+                  }
+                } else {
+                  // Execute the appropriate callbacks
+                  jqXHR.always(map[jqXHR.status]);
+                }
+              }
+              return this;
+            },
+
+            // Cancel the request
+            abort: function (statusText) {
+              var finalText = statusText || strAbort;
+              if (transport) {
+                transport.abort(finalText);
+              }
+              done(0, finalText);
+              return this;
+            }
+          };
+
+      // Attach deferreds
+      deferred.promise(jqXHR).complete = completeDeferred.add;
+      jqXHR.success = jqXHR.done;
+      jqXHR.error = jqXHR.fail;
+
+      // Remove hash character (#7531: and string promotion)
+      // Add protocol if not provided (#5866: IE7 issue with protocol-less urls)
+      // Handle falsy url in the settings object (#10093: consistency with old signature)
+      // We also use the url parameter if available
+      s.url = ( ( url || s.url || ajaxLocation ) + "" ).replace(rhash,
+          "").replace(rprotocol, ajaxLocParts[1] + "//");
+
+      // Alias method option to type as per ticket #12004
+      s.type = options.method || options.type || s.method || s.type;
+
+      // Extract dataTypes list
+      s.dataTypes = jQuery.trim(s.dataType || "*").toLowerCase().match(
+          core_rnotwhite) || [""];
+
+      // 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());
+        s.crossDomain = !!( parts &&
+            ( parts[1] !== ajaxLocParts[1] || parts[2] !== ajaxLocParts[2] ||
+                ( parts[3] || ( parts[1] === "http:" ? 80 : 443 ) ) !=
+                ( 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;
+
+      // Watch for a new set of requests
+      if (fireGlobals && jQuery.active++ === 0) {
+        jQuery.event.trigger("ajaxStart");
+      }
+
+      // Uppercase the type
+      s.type = s.type.toUpperCase();
+
+      // Determine if request has content
+      s.hasContent = !rnoContent.test(s.type);
+
+      // Save the URL in case we're toying with the If-Modified-Since
+      // and/or If-None-Match header later on
+      cacheURL = s.url;
+
+      // More options handling for requests with no content
+      if (!s.hasContent) {
+
+        // If data is available, append data to url
+        if (s.data) {
+          cacheURL = ( s.url += ( ajax_rquery.test(cacheURL) ? "&" : "?" )
+              + s.data );
+          // #9682: remove data so that it's not used in an eventual retry
+          delete s.data;
+        }
+
+        // Add anti-cache in url if needed
+        if (s.cache === false) {
+          s.url = rts.test(cacheURL)
+              ? // If there is already a '_' parameter, set its value
+              cacheURL.replace(rts, "$1_=" + ajax_nonce++)
+              : // Otherwise add one to the end
+              cacheURL + ( ajax_rquery.test(cacheURL) ? "&" : "?" ) + "_="
+              + ajax_nonce++;
+        }
+      }
+
+      // Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode.
+      if (s.ifModified) {
+        if (jQuery.lastModified[cacheURL]) {
+          jqXHR.setRequestHeader("If-Modified-Since",
+              jQuery.lastModified[cacheURL]);
+        }
+        if (jQuery.etag[cacheURL]) {
+          jqXHR.setRequestHeader("If-None-Match", jQuery.etag[cacheURL]);
+        }
+      }
+
+      // 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 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;
+          }
+        }
+      }
+
+      // Callback for when everything is done
+      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[cacheURL] = modified;
+            }
+            modified = jqXHR.getResponseHeader("etag");
+            if (modified) {
+              jQuery.etag[cacheURL] = modified;
+            }
+          }
+
+          // if no content
+          if (status === 204) {
+            isSuccess = true;
+            statusText = "nocontent";
+
+            // if not modified
+          } else if (status === 304) {
+            isSuccess = true;
+            statusText = "notmodified";
+
+            // If we have data, let's convert it
+          } 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 (status || !statusText) {
+            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(isSuccess ? "ajaxSuccess" : "ajaxError",
+              [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");
+          }
+        }
+      }
+
+      return jqXHR;
+    },
+
+    getScript: function (url, callback) {
+      return jQuery.get(url, undefined, callback, "script");
+    },
+
+    getJSON: function (url, data, callback) {
+      return jQuery.get(url, data, callback, "json");
+    }
+  });
+
+  /* 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 firstDataType, ct, finalDataType, type,
-		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 ];
-	}
-}
+  function ajaxHandleResponses(s, jqXHR, responses) {
+    var firstDataType, ct, finalDataType, type,
+        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) {
@@ -8264,1324 +8376,1339 @@ function ajaxHandleResponses( s, jqXHR, responses ) {
   }
 
 // Install script dataType
-jQuery.ajaxSetup({
-	accepts: {
-		script: "text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"
-	},
-	contents: {
-		script: /(?:java|ecma)script/
-	},
-	converters: {
-		"text script": function( text ) {
-			jQuery.globalEval( text );
-			return text;
-		}
-	}
-});
+  jQuery.ajaxSetup({
+    accepts: {
+      script: "text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"
+    },
+    contents: {
+      script: /(?:java|ecma)script/
+    },
+    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;
-	}
-});
+  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) {
+  jQuery.ajaxTransport("script", function (s) {
 
-	// This transport only deals with cross domain requests
-	if ( s.crossDomain ) {
+    // This transport only deals with cross domain requests
+    if (s.crossDomain) {
 
-		var script,
-			head = document.head || jQuery("head")[0] || document.documentElement;
+      var script,
+          head = document.head || jQuery("head")[0] || document.documentElement;
 
-		return {
+      return {
 
-			send: function( _, callback ) {
+        send: function (_, callback) {
 
-				script = document.createElement("script");
+          script = document.createElement("script");
 
-				script.async = true;
+          script.async = true;
 
-				if ( s.scriptCharset ) {
-					script.charset = s.scriptCharset;
-				}
+          if (s.scriptCharset) {
+            script.charset = s.scriptCharset;
+          }
 
-				script.src = s.url;
+          script.src = s.url;
 
-				// Attach handlers for all browsers
-				script.onload = script.onreadystatechange = function( _, isAbort ) {
+          // Attach handlers for all browsers
+          script.onload = script.onreadystatechange = function (_, isAbort) {
 
-					if ( isAbort || !script.readyState || /loaded|complete/.test( script.readyState ) ) {
+            if (isAbort || !script.readyState || /loaded|complete/.test(
+                    script.readyState)) {
 
-						// Handle memory leak in IE
-						script.onload = script.onreadystatechange = null;
+              // Handle memory leak in IE
+              script.onload = script.onreadystatechange = null;
 
-						// Remove the script
-						if ( script.parentNode ) {
-							script.parentNode.removeChild( script );
-						}
+              // Remove the script
+              if (script.parentNode) {
+                script.parentNode.removeChild(script);
+              }
 
-						// Dereference the script
-						script = null;
+              // Dereference the script
+              script = null;
 
-						// Callback if not abort
-						if ( !isAbort ) {
-							callback( 200, "success" );
-						}
-					}
-				};
+              // Callback if not abort
+              if (!isAbort) {
+                callback(200, "success");
+              }
+            }
+          };
 
-				// Circumvent IE6 bugs with base elements (#2709 and #4378) by prepending
-				// Use native DOM manipulation to avoid our domManip AJAX trickery
-				head.insertBefore( script, head.firstChild );
-			},
+          // Circumvent IE6 bugs with base elements (#2709 and #4378) by prepending
+          // Use native DOM manipulation to avoid our domManip AJAX trickery
+          head.insertBefore(script, head.firstChild);
+        },
 
-			abort: function() {
-				if ( script ) {
-					script.onload( undefined, true );
-				}
-			}
-		};
-	}
-});
-var oldCallbacks = [],
-	rjsonp = /(=)\?(?=&|$)|\?\?/;
+        abort: function () {
+          if (script) {
+            script.onload(undefined, true);
+          }
+        }
+      };
+    }
+  });
+  var oldCallbacks = [],
+      rjsonp = /(=)\?(?=&|$)|\?\?/;
 
 // Default jsonp settings
-jQuery.ajaxSetup({
-	jsonp: "callback",
-	jsonpCallback: function() {
-		var callback = oldCallbacks.pop() || ( jQuery.expando + "_" + ( ajax_nonce++ ) );
-		this[ callback ] = true;
-		return callback;
-	}
-});
+  jQuery.ajaxSetup({
+    jsonp: "callback",
+    jsonpCallback: function () {
+      var callback = oldCallbacks.pop() || ( jQuery.expando + "_"
+          + ( ajax_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,
-		jsonProp = s.jsonp !== false && ( rjsonp.test( s.url ) ?
-			"url" :
-			typeof s.data === "string" && !( s.contentType || "" ).indexOf("application/x-www-form-urlencoded") && rjsonp.test( s.data ) && "data"
-		);
-
-	// Handle iff the expected data type is "jsonp" or we have a parameter to set
-	if ( jsonProp || s.dataTypes[ 0 ] === "jsonp" ) {
-
-		// Get callback name, remembering preexisting value associated with it
-		callbackName = s.jsonpCallback = jQuery.isFunction( s.jsonpCallback ) ?
-			s.jsonpCallback() :
-			s.jsonpCallback;
-
-		// Insert callback into url or form data
-		if ( jsonProp ) {
-			s[ jsonProp ] = s[ jsonProp ].replace( rjsonp, "$1" + callbackName );
-		} else if ( s.jsonp !== false ) {
-			s.url += ( ajax_rquery.test( s.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
-		overwritten = window[ callbackName ];
-		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";
-	}
-});
-var xhrCallbacks, xhrSupported,
-	xhrId = 0,
-	// #5280: Internet Explorer will keep connections alive if we don't abort on unload
-	xhrOnUnloadAbort = window.ActiveXObject && function() {
-		// Abort all pending requests
-		var key;
-		for ( key in xhrCallbacks ) {
-			xhrCallbacks[ key ]( undefined, true );
-		}
-	};
+  jQuery.ajaxPrefilter("json jsonp", function (s, originalSettings, jqXHR) {
+
+    var callbackName, overwritten, responseContainer,
+        jsonProp = s.jsonp !== false && ( rjsonp.test(s.url) ? "url"
+                : typeof s.data === "string" && !( s.contentType
+                || "" ).indexOf("application/x-www-form-urlencoded")
+                && rjsonp.test(s.data) && "data"
+        );
+
+    // Handle iff the expected data type is "jsonp" or we have a parameter to set
+    if (jsonProp || s.dataTypes[0] === "jsonp") {
+
+      // Get callback name, remembering preexisting value associated with it
+      callbackName = s.jsonpCallback = jQuery.isFunction(s.jsonpCallback)
+          ? s.jsonpCallback() : s.jsonpCallback;
+
+      // Insert callback into url or form data
+      if (jsonProp) {
+        s[jsonProp] = s[jsonProp].replace(rjsonp, "$1" + callbackName);
+      } else if (s.jsonp !== false) {
+        s.url += ( ajax_rquery.test(s.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
+      overwritten = window[callbackName];
+      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";
+    }
+  });
+  var xhrCallbacks, xhrSupported,
+      xhrId = 0,
+      // #5280: Internet Explorer will keep connections alive if we don't abort on unload
+      xhrOnUnloadAbort = window.ActiveXObject && function () {
+        // Abort all pending requests
+        var key;
+        for (key in xhrCallbacks) {
+          xhrCallbacks[key](undefined, true);
+        }
+      };
 
 // Functions to create xhrs
-function createStandardXHR() {
-	try {
-		return new window.XMLHttpRequest();
-	} catch( e ) {}
-}
-
-function createActiveXHR() {
-	try {
-		return new window.ActiveXObject("Microsoft.XMLHTTP");
-	} catch( e ) {}
-}
+  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
+  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;
+      function () {
+        return !this.isLocal && createStandardXHR() || createActiveXHR();
+      } : // For all other browsers, use the standard XMLHttpRequest object
+      createStandardXHR;
 
 // Determine support properties
-xhrSupported = jQuery.ajaxSettings.xhr();
-jQuery.support.cors = !!xhrSupported && ( "withCredentials" in xhrSupported );
-xhrSupported = jQuery.support.ajax = !!xhrSupported;
+  xhrSupported = jQuery.ajaxSettings.xhr();
+  jQuery.support.cors = !!xhrSupported && ( "withCredentials" in xhrSupported );
+  xhrSupported = jQuery.support.ajax = !!xhrSupported;
 
 // Create transport if the browser can provide an xhr
-if ( xhrSupported ) {
-
-	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( err ) {}
-
-					// 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, responseHeaders, statusText, responses;
-
-						// 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 {
-									responses = {};
-									status = xhr.status;
-									responseHeaders = xhr.getAllResponseHeaders();
-
-									// When requesting binary data, IE6-9 will throw an exception
-									// on any attempt to access responseText (#11426)
-									if ( typeof xhr.responseText === "string" ) {
-										responses.text = xhr.responseText;
-									}
-
-									// 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 );
-					} 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( undefined, true );
-					}
-				}
-			};
-		}
-	});
-}
-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;
-		}]
-	};
+  if (xhrSupported) {
+
+    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 (err) {
+            }
+
+            // 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, responseHeaders, statusText, responses;
+
+              // 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 {
+                    responses = {};
+                    status = xhr.status;
+                    responseHeaders = xhr.getAllResponseHeaders();
+
+                    // When requesting binary data, IE6-9 will throw an exception
+                    // on any attempt to access responseText (#11426)
+                    if (typeof xhr.responseText === "string") {
+                      responses.text = xhr.responseText;
+                    }
+
+                    // 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);
+            } 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(undefined, true);
+            }
+          }
+        };
+      }
+    });
+  }
+  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;
-	});
-	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,
-		stopped,
-		index = 0,
-		length = animationPrefilters.length,
-		deferred = jQuery.Deferred().always( function() {
-			// don't match elem in the :animated selector
-			delete tick.elem;
-		}),
-		tick = function() {
-			if ( stopped ) {
-				return false;
-			}
-			var currentTime = fxNow || createFxNow(),
-				remaining = Math.max( 0, animation.startTime + animation.duration - currentTime ),
-				// archaic crash bug won't allow us to use 1 - ( 0.5 || 0 ) (#12497)
-				temp = remaining / animation.duration || 0,
-				percent = 1 - temp,
-				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 ) {
-				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;
-				if ( stopped ) {
-					return this;
-				}
-				stopped = true;
-				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, {
-			elem: elem,
-			anim: animation,
-			queue: animation.opts.queue
-		})
-	);
-
-	// 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 value, name, index, easing, 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 ) {
-	/*jshint validthis:true */
-	var prop, index, length,
-		value, dataShow, toggle,
-		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.always(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 ];
-			toggle = toggle || value === "toggle";
-			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" in dataShow ) {
-			hidden = dataShow.hidden;
-		}
-
-		// store state if its toggle - enables .stop().toggle() to "reverse"
-		if ( toggle ) {
-			dataShow.hidden = !hidden;
-		}
-		if ( hidden ) {
-			jQuery( elem ).show();
-		} else {
-			anim.done(function() {
-				jQuery( elem ).hide();
-			});
-		}
-		anim.done(function() {
-			var prop;
-			jQuery._removeData( elem, "fxshow" );
-			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 an empty string as a 3rd 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, "" );
-			// 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;
-			}
-		}
-	}
-};
+  function createFxNow() {
+    setTimeout(function () {
+      fxNow = undefined;
+    });
+    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,
+        stopped,
+        index = 0,
+        length = animationPrefilters.length,
+        deferred = jQuery.Deferred().always(function () {
+          // don't match elem in the :animated selector
+          delete tick.elem;
+        }),
+        tick = function () {
+          if (stopped) {
+            return false;
+          }
+          var currentTime = fxNow || createFxNow(),
+              remaining = Math.max(0, animation.startTime + animation.duration
+                  - currentTime),
+              // archaic crash bug won't allow us to use 1 - ( 0.5 || 0 ) (#12497)
+              temp = remaining / animation.duration || 0,
+              percent = 1 - temp,
+              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) {
+            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;
+            if (stopped) {
+              return this;
+            }
+            stopped = true;
+            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, {
+          elem: elem,
+          anim: animation,
+          queue: animation.opts.queue
+        })
+    );
+
+    // 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 value, name, index, easing, 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) {
+    /*jshint validthis:true */
+    var prop, index, length,
+        value, dataShow, toggle,
+        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.always(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];
+        toggle = toggle || value === "toggle";
+        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" in dataShow) {
+        hidden = dataShow.hidden;
+      }
+
+      // store state if its toggle - enables .stop().toggle() to "reverse"
+      if (toggle) {
+        dataShow.hidden = !hidden;
+      }
+      if (hidden) {
+        jQuery(elem).show();
+      } else {
+        anim.done(function () {
+          jQuery(elem).hide();
+        });
+      }
+      anim.done(function () {
+        var prop;
+        jQuery._removeData(elem, "fxshow");
+        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 an empty string as a 3rd 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, "");
+        // 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" ?
-			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 );
-				doAnimation.finish = function() {
-					anim.stop( true );
-				};
-				// Empty animations, or finishing resolves immediately
-				if ( empty || jQuery._data( this, "finish" ) ) {
-					anim.stop( true );
-				}
-			};
-			doAnimation.finish = doAnimation;
-
-		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 );
-			}
-		});
-	},
-	finish: function( type ) {
-		if ( type !== false ) {
-			type = type || "fx";
-		}
-		return this.each(function() {
-			var index,
-				data = jQuery._data( this ),
-				queue = data[ type + "queue" ],
-				hooks = data[ type + "queueHooks" ],
-				timers = jQuery.timers,
-				length = queue ? queue.length : 0;
-
-			// enable finishing flag on private data
-			data.finish = true;
-
-			// empty the queue first
-			jQuery.queue( this, type, [] );
-
-			if ( hooks && hooks.cur && hooks.cur.finish ) {
-				hooks.cur.finish.call( this );
-			}
-
-			// look for any active animations, and finish them
-			for ( index = timers.length; index--; ) {
-				if ( timers[ index ].elem === this && timers[ index ].queue === type ) {
-					timers[ index ].anim.stop( true );
-					timers.splice( index, 1 );
-				}
-			}
-
-			// look for any animations in the old queue and finish them
-			for ( index = 0; index < length; index++ ) {
-				if ( queue[ index ] && queue[ index ].finish ) {
-					queue[ index ].finish.call( this );
-				}
-			}
-
-			// turn off finishing flag
-			delete data.finish;
-		});
-	}
-});
+  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" ? 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);
+            doAnimation.finish = function () {
+              anim.stop(true);
+            };
+            // Empty animations, or finishing resolves immediately
+            if (empty || jQuery._data(this, "finish")) {
+              anim.stop(true);
+            }
+          };
+      doAnimation.finish = doAnimation;
+
+      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);
+        }
+      });
+    },
+    finish: function (type) {
+      if (type !== false) {
+        type = type || "fx";
+      }
+      return this.each(function () {
+        var index,
+            data = jQuery._data(this),
+            queue = data[type + "queue"],
+            hooks = data[type + "queueHooks"],
+            timers = jQuery.timers,
+            length = queue ? queue.length : 0;
+
+        // enable finishing flag on private data
+        data.finish = true;
+
+        // empty the queue first
+        jQuery.queue(this, type, []);
+
+        if (hooks && hooks.cur && hooks.cur.finish) {
+          hooks.cur.finish.call(this);
+        }
+
+        // look for any active animations, and finish them
+        for (index = timers.length; index--;) {
+          if (timers[index].elem === this && timers[index].queue === type) {
+            timers[index].anim.stop(true);
+            timers.splice(index, 1);
+          }
+        }
+
+        // look for any animations in the old queue and finish them
+        for (index = 0; index < length; index++) {
+          if (queue[index] && queue[index].finish) {
+            queue[index].finish.call(this);
+          }
+        }
+
+        // turn off finishing flag
+        delete data.finish;
+      });
+    }
+  });
 
 // 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;
-}
+  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;
-
-	fxNow = jQuery.now();
-
-	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();
-	}
-	fxNow = undefined;
-};
-
-jQuery.fx.timer = function( timer ) {
-	if ( timer() && jQuery.timers.push( timer ) ) {
-		jQuery.fx.start();
-	}
-};
-
-jQuery.fx.interval = 13;
-
-jQuery.fx.start = function() {
-	if ( !timerId ) {
-		timerId = setInterval( jQuery.fx.tick, jQuery.fx.interval );
-	}
-};
-
-jQuery.fx.stop = function() {
-	clearInterval( timerId );
-	timerId = null;
-};
-
-jQuery.fx.speeds = {
-	slow: 600,
-	fast: 200,
-	// Default speed
-	_default: 400
-};
+  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;
+
+    fxNow = jQuery.now();
+
+    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();
+    }
+    fxNow = undefined;
+  };
+
+  jQuery.fx.timer = function (timer) {
+    if (timer() && jQuery.timers.push(timer)) {
+      jQuery.fx.start();
+    }
+  };
+
+  jQuery.fx.interval = 13;
+
+  jQuery.fx.start = function () {
+    if (!timerId) {
+      timerId = setInterval(jQuery.fx.tick, jQuery.fx.interval);
+    }
+  };
+
+  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;
-	};
-}
-jQuery.fn.offset = function( options ) {
-	if ( arguments.length ) {
-		return options === undefined ?
-			this :
-			this.each(function( i ) {
-				jQuery.offset.setOffset( this, options, i );
-			});
-	}
-
-	var docElem, win,
-		box = { top: 0, left: 0 },
-		elem = this[ 0 ],
-		doc = elem && elem.ownerDocument;
-
-	if ( !doc ) {
-		return;
-	}
-
-	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 !== core_strundefined ) {
-		box = elem.getBoundingClientRect();
-	}
-	win = getWindow( doc );
-	return {
-		top: box.top  + ( win.pageYOffset || docElem.scrollTop )  - ( docElem.clientTop  || 0 ),
-		left: box.left + ( win.pageXOffset || docElem.scrollLeft ) - ( docElem.clientLeft || 0 )
-	};
-};
-
-jQuery.offset = {
-
-	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 offsetParent, offset,
-			parentOffset = { top: 0, left: 0 },
-			elem = this[ 0 ];
-
-		// fixed elements are offset from window (parentOffset = {top:0, left: 0}, because it is it's only offset parent
-		if ( jQuery.css( elem, "position" ) === "fixed" ) {
-			// we assume that getBoundingClientRect is available when computed position is fixed
-			offset = elem.getBoundingClientRect();
-		} else {
-			// Get *real* offsetParent
-			offsetParent = this.offsetParent();
-
-			// Get correct offsets
-			offset = this.offset();
-			if ( !jQuery.nodeName( offsetParent[ 0 ], "html" ) ) {
-				parentOffset = offsetParent.offset();
-			}
-
-			// Add offsetParent borders
-			parentOffset.top  += jQuery.css( offsetParent[ 0 ], "borderTopWidth", true );
-			parentOffset.left += jQuery.css( offsetParent[ 0 ], "borderLeftWidth", true );
-		}
-
-		// Subtract parent offsets and 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
-		return {
-			top:  offset.top  - parentOffset.top - jQuery.css( elem, "marginTop", true ),
-			left: offset.left - parentOffset.left - jQuery.css( elem, "marginLeft", true)
-		};
-	},
-
-	offsetParent: function() {
-		return this.map(function() {
-			var offsetParent = this.offsetParent || document.documentElement;
-			while ( offsetParent && ( !jQuery.nodeName( offsetParent, "html" ) && jQuery.css( offsetParent, "position") === "static" ) ) {
-				offsetParent = offsetParent.offsetParent;
-			}
-			return offsetParent || document.documentElement;
-		});
-	}
-});
+  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;
+    };
+  }
+  jQuery.fn.offset = function (options) {
+    if (arguments.length) {
+      return options === undefined ? this : this.each(function (i) {
+        jQuery.offset.setOffset(this, options, i);
+      });
+    }
+
+    var docElem, win,
+        box = {top: 0, left: 0},
+        elem = this[0],
+        doc = elem && elem.ownerDocument;
+
+    if (!doc) {
+      return;
+    }
+
+    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 !== core_strundefined) {
+      box = elem.getBoundingClientRect();
+    }
+    win = getWindow(doc);
+    return {
+      top: box.top + ( win.pageYOffset || docElem.scrollTop )
+      - ( docElem.clientTop || 0 ),
+      left: box.left + ( win.pageXOffset || docElem.scrollLeft )
+      - ( docElem.clientLeft || 0 )
+    };
+  };
+
+  jQuery.offset = {
+
+    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 offsetParent, offset,
+          parentOffset = {top: 0, left: 0},
+          elem = this[0];
+
+      // fixed elements are offset from window (parentOffset = {top:0, left: 0}, because it is it's only offset parent
+      if (jQuery.css(elem, "position") === "fixed") {
+        // we assume that getBoundingClientRect is available when computed position is fixed
+        offset = elem.getBoundingClientRect();
+      } else {
+        // Get *real* offsetParent
+        offsetParent = this.offsetParent();
+
+        // Get correct offsets
+        offset = this.offset();
+        if (!jQuery.nodeName(offsetParent[0], "html")) {
+          parentOffset = offsetParent.offset();
+        }
+
+        // Add offsetParent borders
+        parentOffset.top += jQuery.css(offsetParent[0], "borderTopWidth", true);
+        parentOffset.left += jQuery.css(offsetParent[0], "borderLeftWidth",
+            true);
+      }
+
+      // Subtract parent offsets and 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
+      return {
+        top: offset.top - parentOffset.top - jQuery.css(elem, "marginTop",
+            true),
+        left: offset.left - parentOffset.left - jQuery.css(elem, "marginLeft",
+            true)
+      };
+    },
+
+    offsetParent: function () {
+      return this.map(function () {
+        var offsetParent = this.offsetParent || document.documentElement;
+        while (offsetParent && ( !jQuery.nodeName(offsetParent, "html")
+            && jQuery.css(offsetParent, "position") === "static" )) {
+          offsetParent = offsetParent.offsetParent;
+        }
+        return offsetParent || document.documentElement;
+      });
+    }
+  });
 
 // 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;
-}
+  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, extra ) :
-
-					// Set width or height on the element
-					jQuery.style( elem, type, value, extra );
-			}, type, chainable ? margin : undefined, chainable, null );
-		};
-	});
-});
+  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, extra)
+                  : // Set width or height on the element
+                  jQuery.style(elem, type, value, extra);
+            }, type, chainable ? margin : undefined, chainable, null);
+          };
+        });
+  });
 // Limit scope pollution from any deprecated API
 // (function() {
 
 // })();
 // Expose jQuery to the global object
-window.jQuery = window.$ = jQuery;
+  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
@@ -9595,8 +9722,10 @@ window.jQuery = window.$ = jQuery;
 // 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; } );
-}
+  if (typeof define === "function" && define.amd && define.amd.jQuery) {
+    define("jquery", [], function () {
+      return jQuery;
+    });
+  }
 
-})( window );
+})(window);
diff --git a/azkaban-web-server/src/web/js/jquery/themes/apple/style.css b/azkaban-web-server/src/web/js/jquery/themes/apple/style.css
index 8f1b3de..f0b5d40 100644
--- a/azkaban-web-server/src/web/js/jquery/themes/apple/style.css
+++ b/azkaban-web-server/src/web/js/jquery/themes/apple/style.css
@@ -4,57 +4,186 @@
  * Supported plugins: ui (hovered, clicked), checkbox, contextmenu, search
  */
 
-.jstree-apple > ul { background:url("bg.jpg") left top repeat; }
-.jstree-apple li, 
-.jstree-apple ins { background-image:url("d.png"); background-repeat:no-repeat; background-color:transparent; }
-.jstree-apple li { background-position:-90px 0; background-repeat:repeat-y;  }
-.jstree-apple li.jstree-last { background:transparent; }
-.jstree-apple .jstree-open > ins { background-position:-72px 0; }
-.jstree-apple .jstree-closed > ins { background-position:-54px 0; }
-.jstree-apple .jstree-leaf > ins { background-position:-36px 0; }
-
-.jstree-apple a { border-radius:4px; -moz-border-radius:4px; -webkit-border-radius:4px; text-shadow:1px 1px 1px white; }
-.jstree-apple .jstree-hovered { background:#e7f4f9; border:1px solid #d8f0fa; padding:0 3px 0 1px; text-shadow:1px 1px 1px silver; }
-.jstree-apple .jstree-clicked { background:#beebff; border:1px solid #99defd; padding:0 3px 0 1px; }
-.jstree-apple a .jstree-icon { background-position:-56px -20px; }
-.jstree-apple a.jstree-loading .jstree-icon { background:url("throbber.gif") center center no-repeat !important; }
-
-.jstree-apple.jstree-focused { background:white; }
-
-.jstree-apple .jstree-no-dots li, 
-.jstree-apple .jstree-no-dots .jstree-leaf > ins { background:transparent; }
-.jstree-apple .jstree-no-dots .jstree-open > ins { background-position:-18px 0; }
-.jstree-apple .jstree-no-dots .jstree-closed > ins { background-position:0 0; }
-
-.jstree-apple .jstree-no-icons a .jstree-icon { display:none; }
-
-.jstree-apple .jstree-search { font-style:italic; }
-
-.jstree-apple .jstree-no-icons .jstree-checkbox { display:inline-block; }
-.jstree-apple .jstree-no-checkboxes .jstree-checkbox { display:none !important; }
-.jstree-apple .jstree-checked > a > .jstree-checkbox { background-position:-38px -19px; }
-.jstree-apple .jstree-unchecked > a > .jstree-checkbox { background-position:-2px -19px; }
-.jstree-apple .jstree-undetermined > a > .jstree-checkbox { background-position:-20px -19px; }
-.jstree-apple .jstree-checked > a > .checkbox:hover { background-position:-38px -37px; }
-.jstree-apple .jstree-unchecked > a > .jstree-checkbox:hover { background-position:-2px -37px; }
-.jstree-apple .jstree-undetermined > a > .jstree-checkbox:hover { background-position:-20px -37px; }
-
-#vakata-dragged.jstree-apple ins { background:transparent !important; }
-#vakata-dragged.jstree-apple .jstree-ok { background:url("d.png") -2px -53px no-repeat !important; }
-#vakata-dragged.jstree-apple .jstree-invalid { background:url("d.png") -18px -53px no-repeat !important; }
-#jstree-marker.jstree-apple { background:url("d.png") -41px -57px no-repeat !important; }
-
-.jstree-apple a.jstree-search { color:aqua; }
-
-#vakata-contextmenu.jstree-apple-context, 
-#vakata-contextmenu.jstree-apple-context li ul { background:#f0f0f0; border:1px solid #979797; -moz-box-shadow: 1px 1px 2px #999; -webkit-box-shadow: 1px 1px 2px #999; box-shadow: 1px 1px 2px #999; }
-#vakata-contextmenu.jstree-apple-context li { }
-#vakata-contextmenu.jstree-apple-context a { color:black; }
-#vakata-contextmenu.jstree-apple-context a:hover, 
-#vakata-contextmenu.jstree-apple-context .vakata-hover > a { padding:0 5px; background:#e8eff7; border:1px solid #aecff7; color:black; -moz-border-radius:2px; -webkit-border-radius:2px; border-radius:2px; }
-#vakata-contextmenu.jstree-apple-context li.jstree-contextmenu-disabled a, 
-#vakata-contextmenu.jstree-apple-context li.jstree-contextmenu-disabled a:hover { color:silver; background:transparent; border:0; padding:1px 4px; }
-#vakata-contextmenu.jstree-apple-context li.vakata-separator { background:white; border-top:1px solid #e0e0e0; margin:0; }
-#vakata-contextmenu.jstree-apple-context li ul { margin-left:-4px; }
-
-/* TODO: IE6 support - the `>` selectors */
\ No newline at end of file
+.jstree-apple > ul {
+  background: url("bg.jpg") left top repeat;
+}
+
+.jstree-apple li,
+.jstree-apple ins {
+  background-image: url("d.png");
+  background-repeat: no-repeat;
+  background-color: transparent;
+}
+
+.jstree-apple li {
+  background-position: -90px 0;
+  background-repeat: repeat-y;
+}
+
+.jstree-apple li.jstree-last {
+  background: transparent;
+}
+
+.jstree-apple .jstree-open > ins {
+  background-position: -72px 0;
+}
+
+.jstree-apple .jstree-closed > ins {
+  background-position: -54px 0;
+}
+
+.jstree-apple .jstree-leaf > ins {
+  background-position: -36px 0;
+}
+
+.jstree-apple a {
+  border-radius: 4px;
+  -moz-border-radius: 4px;
+  -webkit-border-radius: 4px;
+  text-shadow: 1px 1px 1px white;
+}
+
+.jstree-apple .jstree-hovered {
+  background: #e7f4f9;
+  border: 1px solid #d8f0fa;
+  padding: 0 3px 0 1px;
+  text-shadow: 1px 1px 1px silver;
+}
+
+.jstree-apple .jstree-clicked {
+  background: #beebff;
+  border: 1px solid #99defd;
+  padding: 0 3px 0 1px;
+}
+
+.jstree-apple a .jstree-icon {
+  background-position: -56px -20px;
+}
+
+.jstree-apple a.jstree-loading .jstree-icon {
+  background: url("throbber.gif") center center no-repeat !important;
+}
+
+.jstree-apple.jstree-focused {
+  background: white;
+}
+
+.jstree-apple .jstree-no-dots li,
+.jstree-apple .jstree-no-dots .jstree-leaf > ins {
+  background: transparent;
+}
+
+.jstree-apple .jstree-no-dots .jstree-open > ins {
+  background-position: -18px 0;
+}
+
+.jstree-apple .jstree-no-dots .jstree-closed > ins {
+  background-position: 0 0;
+}
+
+.jstree-apple .jstree-no-icons a .jstree-icon {
+  display: none;
+}
+
+.jstree-apple .jstree-search {
+  font-style: italic;
+}
+
+.jstree-apple .jstree-no-icons .jstree-checkbox {
+  display: inline-block;
+}
+
+.jstree-apple .jstree-no-checkboxes .jstree-checkbox {
+  display: none !important;
+}
+
+.jstree-apple .jstree-checked > a > .jstree-checkbox {
+  background-position: -38px -19px;
+}
+
+.jstree-apple .jstree-unchecked > a > .jstree-checkbox {
+  background-position: -2px -19px;
+}
+
+.jstree-apple .jstree-undetermined > a > .jstree-checkbox {
+  background-position: -20px -19px;
+}
+
+.jstree-apple .jstree-checked > a > .checkbox:hover {
+  background-position: -38px -37px;
+}
+
+.jstree-apple .jstree-unchecked > a > .jstree-checkbox:hover {
+  background-position: -2px -37px;
+}
+
+.jstree-apple .jstree-undetermined > a > .jstree-checkbox:hover {
+  background-position: -20px -37px;
+}
+
+#vakata-dragged.jstree-apple ins {
+  background: transparent !important;
+}
+
+#vakata-dragged.jstree-apple .jstree-ok {
+  background: url("d.png") -2px -53px no-repeat !important;
+}
+
+#vakata-dragged.jstree-apple .jstree-invalid {
+  background: url("d.png") -18px -53px no-repeat !important;
+}
+
+#jstree-marker.jstree-apple {
+  background: url("d.png") -41px -57px no-repeat !important;
+}
+
+.jstree-apple a.jstree-search {
+  color: aqua;
+}
+
+#vakata-contextmenu.jstree-apple-context,
+#vakata-contextmenu.jstree-apple-context li ul {
+  background: #f0f0f0;
+  border: 1px solid #979797;
+  -moz-box-shadow: 1px 1px 2px #999;
+  -webkit-box-shadow: 1px 1px 2px #999;
+  box-shadow: 1px 1px 2px #999;
+}
+
+#vakata-contextmenu.jstree-apple-context li {
+}
+
+#vakata-contextmenu.jstree-apple-context a {
+  color: black;
+}
+
+#vakata-contextmenu.jstree-apple-context a:hover,
+#vakata-contextmenu.jstree-apple-context .vakata-hover > a {
+  padding: 0 5px;
+  background: #e8eff7;
+  border: 1px solid #aecff7;
+  color: black;
+  -moz-border-radius: 2px;
+  -webkit-border-radius: 2px;
+  border-radius: 2px;
+}
+
+#vakata-contextmenu.jstree-apple-context li.jstree-contextmenu-disabled a,
+#vakata-contextmenu.jstree-apple-context li.jstree-contextmenu-disabled a:hover {
+  color: silver;
+  background: transparent;
+  border: 0;
+  padding: 1px 4px;
+}
+
+#vakata-contextmenu.jstree-apple-context li.vakata-separator {
+  background: white;
+  border-top: 1px solid #e0e0e0;
+  margin: 0;
+}
+
+#vakata-contextmenu.jstree-apple-context li ul {
+  margin-left: -4px;
+}
+
+/* TODO: IE6 support - the `>` selectors */
diff --git a/azkaban-web-server/src/web/js/jquery/themes/classic/style.css b/azkaban-web-server/src/web/js/jquery/themes/classic/style.css
index bb15730..8eb7f6e 100644
--- a/azkaban-web-server/src/web/js/jquery/themes/classic/style.css
+++ b/azkaban-web-server/src/web/js/jquery/themes/classic/style.css
@@ -4,56 +4,179 @@
  * Supported plugins: ui (hovered, clicked), checkbox, contextmenu, search
  */
 
-.jstree-classic li, 
-.jstree-classic ins { background-image:url("d.png"); background-repeat:no-repeat; background-color:transparent; }
-.jstree-classic li { background-position:-90px 0; background-repeat:repeat-y;  }
-.jstree-classic li.jstree-last { background:transparent; }
-.jstree-classic .jstree-open > ins { background-position:-72px 0; }
-.jstree-classic .jstree-closed > ins { background-position:-54px 0; }
-.jstree-classic .jstree-leaf > ins { background-position:-36px 0; }
-
-.jstree-classic .jstree-hovered { background:#e7f4f9; border:1px solid #e7f4f9; padding:0 2px 0 1px; }
-.jstree-classic .jstree-clicked { background:navy; border:1px solid navy; padding:0 2px 0 1px; color:white; }
-.jstree-classic a .jstree-icon { background-position:-56px -19px; }
-.jstree-classic .jstree-open > a .jstree-icon { background-position:-56px -36px; }
-.jstree-classic a.jstree-loading .jstree-icon { background:url("throbber.gif") center center no-repeat !important; }
-
-.jstree-classic.jstree-focused { background:white; }
-
-.jstree-classic .jstree-no-dots li, 
-.jstree-classic .jstree-no-dots .jstree-leaf > ins { background:transparent; }
-.jstree-classic .jstree-no-dots .jstree-open > ins { background-position:-18px 0; }
-.jstree-classic .jstree-no-dots .jstree-closed > ins { background-position:0 0; }
-
-.jstree-classic .jstree-no-icons a .jstree-icon { display:none; }
-
-.jstree-classic .jstree-search { font-style:italic; }
-
-.jstree-classic .jstree-no-icons .jstree-checkbox { display:inline-block; }
-.jstree-classic .jstree-no-checkboxes .jstree-checkbox { display:none !important; }
-.jstree-classic .jstree-checked > a > .jstree-checkbox { background-position:-38px -19px; }
-.jstree-classic .jstree-unchecked > a > .jstree-checkbox { background-position:-2px -19px; }
-.jstree-classic .jstree-undetermined > a > .jstree-checkbox { background-position:-20px -19px; }
-.jstree-classic .jstree-checked > a > .jstree-checkbox:hover { background-position:-38px -37px; }
-.jstree-classic .jstree-unchecked > a > .jstree-checkbox:hover { background-position:-2px -37px; }
-.jstree-classic .jstree-undetermined > a > .jstree-checkbox:hover { background-position:-20px -37px; }
-
-#vakata-dragged.jstree-classic ins { background:transparent !important; }
-#vakata-dragged.jstree-classic .jstree-ok { background:url("d.png") -2px -53px no-repeat !important; }
-#vakata-dragged.jstree-classic .jstree-invalid { background:url("d.png") -18px -53px no-repeat !important; }
-#jstree-marker.jstree-classic { background:url("d.png") -41px -57px no-repeat !important; }
-
-.jstree-classic a.jstree-search { color:aqua; }
-
-#vakata-contextmenu.jstree-classic-context, 
-#vakata-contextmenu.jstree-classic-context li ul { background:#f0f0f0; border:1px solid #979797; -moz-box-shadow: 1px 1px 2px #999; -webkit-box-shadow: 1px 1px 2px #999; box-shadow: 1px 1px 2px #999; }
-#vakata-contextmenu.jstree-classic-context li { }
-#vakata-contextmenu.jstree-classic-context a { color:black; }
-#vakata-contextmenu.jstree-classic-context a:hover, 
-#vakata-contextmenu.jstree-classic-context .vakata-hover > a { padding:0 5px; background:#e8eff7; border:1px solid #aecff7; color:black; -moz-border-radius:2px; -webkit-border-radius:2px; border-radius:2px; }
-#vakata-contextmenu.jstree-classic-context li.jstree-contextmenu-disabled a, 
-#vakata-contextmenu.jstree-classic-context li.jstree-contextmenu-disabled a:hover { color:silver; background:transparent; border:0; padding:1px 4px; }
-#vakata-contextmenu.jstree-classic-context li.vakata-separator { background:white; border-top:1px solid #e0e0e0; margin:0; }
-#vakata-contextmenu.jstree-classic-context li ul { margin-left:-4px; }
-
-/* TODO: IE6 support - the `>` selectors */
\ No newline at end of file
+.jstree-classic li,
+.jstree-classic ins {
+  background-image: url("d.png");
+  background-repeat: no-repeat;
+  background-color: transparent;
+}
+
+.jstree-classic li {
+  background-position: -90px 0;
+  background-repeat: repeat-y;
+}
+
+.jstree-classic li.jstree-last {
+  background: transparent;
+}
+
+.jstree-classic .jstree-open > ins {
+  background-position: -72px 0;
+}
+
+.jstree-classic .jstree-closed > ins {
+  background-position: -54px 0;
+}
+
+.jstree-classic .jstree-leaf > ins {
+  background-position: -36px 0;
+}
+
+.jstree-classic .jstree-hovered {
+  background: #e7f4f9;
+  border: 1px solid #e7f4f9;
+  padding: 0 2px 0 1px;
+}
+
+.jstree-classic .jstree-clicked {
+  background: navy;
+  border: 1px solid navy;
+  padding: 0 2px 0 1px;
+  color: white;
+}
+
+.jstree-classic a .jstree-icon {
+  background-position: -56px -19px;
+}
+
+.jstree-classic .jstree-open > a .jstree-icon {
+  background-position: -56px -36px;
+}
+
+.jstree-classic a.jstree-loading .jstree-icon {
+  background: url("throbber.gif") center center no-repeat !important;
+}
+
+.jstree-classic.jstree-focused {
+  background: white;
+}
+
+.jstree-classic .jstree-no-dots li,
+.jstree-classic .jstree-no-dots .jstree-leaf > ins {
+  background: transparent;
+}
+
+.jstree-classic .jstree-no-dots .jstree-open > ins {
+  background-position: -18px 0;
+}
+
+.jstree-classic .jstree-no-dots .jstree-closed > ins {
+  background-position: 0 0;
+}
+
+.jstree-classic .jstree-no-icons a .jstree-icon {
+  display: none;
+}
+
+.jstree-classic .jstree-search {
+  font-style: italic;
+}
+
+.jstree-classic .jstree-no-icons .jstree-checkbox {
+  display: inline-block;
+}
+
+.jstree-classic .jstree-no-checkboxes .jstree-checkbox {
+  display: none !important;
+}
+
+.jstree-classic .jstree-checked > a > .jstree-checkbox {
+  background-position: -38px -19px;
+}
+
+.jstree-classic .jstree-unchecked > a > .jstree-checkbox {
+  background-position: -2px -19px;
+}
+
+.jstree-classic .jstree-undetermined > a > .jstree-checkbox {
+  background-position: -20px -19px;
+}
+
+.jstree-classic .jstree-checked > a > .jstree-checkbox:hover {
+  background-position: -38px -37px;
+}
+
+.jstree-classic .jstree-unchecked > a > .jstree-checkbox:hover {
+  background-position: -2px -37px;
+}
+
+.jstree-classic .jstree-undetermined > a > .jstree-checkbox:hover {
+  background-position: -20px -37px;
+}
+
+#vakata-dragged.jstree-classic ins {
+  background: transparent !important;
+}
+
+#vakata-dragged.jstree-classic .jstree-ok {
+  background: url("d.png") -2px -53px no-repeat !important;
+}
+
+#vakata-dragged.jstree-classic .jstree-invalid {
+  background: url("d.png") -18px -53px no-repeat !important;
+}
+
+#jstree-marker.jstree-classic {
+  background: url("d.png") -41px -57px no-repeat !important;
+}
+
+.jstree-classic a.jstree-search {
+  color: aqua;
+}
+
+#vakata-contextmenu.jstree-classic-context,
+#vakata-contextmenu.jstree-classic-context li ul {
+  background: #f0f0f0;
+  border: 1px solid #979797;
+  -moz-box-shadow: 1px 1px 2px #999;
+  -webkit-box-shadow: 1px 1px 2px #999;
+  box-shadow: 1px 1px 2px #999;
+}
+
+#vakata-contextmenu.jstree-classic-context li {
+}
+
+#vakata-contextmenu.jstree-classic-context a {
+  color: black;
+}
+
+#vakata-contextmenu.jstree-classic-context a:hover,
+#vakata-contextmenu.jstree-classic-context .vakata-hover > a {
+  padding: 0 5px;
+  background: #e8eff7;
+  border: 1px solid #aecff7;
+  color: black;
+  -moz-border-radius: 2px;
+  -webkit-border-radius: 2px;
+  border-radius: 2px;
+}
+
+#vakata-contextmenu.jstree-classic-context li.jstree-contextmenu-disabled a,
+#vakata-contextmenu.jstree-classic-context li.jstree-contextmenu-disabled a:hover {
+  color: silver;
+  background: transparent;
+  border: 0;
+  padding: 1px 4px;
+}
+
+#vakata-contextmenu.jstree-classic-context li.vakata-separator {
+  background: white;
+  border-top: 1px solid #e0e0e0;
+  margin: 0;
+}
+
+#vakata-contextmenu.jstree-classic-context li ul {
+  margin-left: -4px;
+}
+
+/* TODO: IE6 support - the `>` selectors */
diff --git a/azkaban-web-server/src/web/js/jquery/themes/default/style.css b/azkaban-web-server/src/web/js/jquery/themes/default/style.css
index 01a0889..6a37c7f 100644
--- a/azkaban-web-server/src/web/js/jquery/themes/default/style.css
+++ b/azkaban-web-server/src/web/js/jquery/themes/default/style.css
@@ -4,70 +4,219 @@
  * Supported plugins: ui (hovered, clicked), checkbox, contextmenu, search
  */
 
-.jstree-default li, 
-.jstree-default ins { background-image:url("d.png"); background-repeat:no-repeat; background-color:transparent; }
-.jstree-default li { background-position:-90px 0; background-repeat:repeat-y; }
-.jstree-default li.jstree-last { background:transparent; }
-.jstree-default .jstree-open > ins { background-position:-72px 0; }
-.jstree-default .jstree-closed > ins { background-position:-54px 0; }
-.jstree-default .jstree-leaf > ins { background-position:-36px 0; }
-
-.jstree-default .jstree-hovered { background:#e7f4f9; border:1px solid #d8f0fa; padding:0 2px 0 1px; }
-.jstree-default .jstree-clicked { background:#beebff; border:1px solid #99defd; padding:0 2px 0 1px; }
-.jstree-default a .jstree-icon { background-position:-56px -19px; }
-.jstree-default a.jstree-loading .jstree-icon { background:url("throbber.gif") center center no-repeat !important; }
-
-.jstree-default.jstree-focused { background:#ffffee; }
-
-.jstree-default .jstree-no-dots li, 
-.jstree-default .jstree-no-dots .jstree-leaf > ins { background:transparent; }
-.jstree-default .jstree-no-dots .jstree-open > ins { background-position:-18px 0; }
-.jstree-default .jstree-no-dots .jstree-closed > ins { background-position:0 0; }
-
-.jstree-default .jstree-no-icons a .jstree-icon { display:none; }
-
-.jstree-default .jstree-search { font-style:italic; }
-
-.jstree-default .jstree-no-icons .jstree-checkbox { display:inline-block; }
-.jstree-default .jstree-no-checkboxes .jstree-checkbox { display:none !important; }
-.jstree-default .jstree-checked > a > .jstree-checkbox { background-position:-38px -19px; }
-.jstree-default .jstree-unchecked > a > .jstree-checkbox { background-position:-2px -19px; }
-.jstree-default .jstree-undetermined > a > .jstree-checkbox { background-position:-20px -19px; }
-.jstree-default .jstree-checked > a > .jstree-checkbox:hover { background-position:-38px -37px; }
-.jstree-default .jstree-unchecked > a > .jstree-checkbox:hover { background-position:-2px -37px; }
-.jstree-default .jstree-undetermined > a > .jstree-checkbox:hover { background-position:-20px -37px; }
-
-#vakata-dragged.jstree-default ins { background:transparent !important; }
-#vakata-dragged.jstree-default .jstree-ok { background:url("d.png") -2px -53px no-repeat !important; }
-#vakata-dragged.jstree-default .jstree-invalid { background:url("d.png") -18px -53px no-repeat !important; }
-#jstree-marker.jstree-default { background:url("d.png") -41px -57px no-repeat !important; }
-
-.jstree-default a.jstree-search { color:aqua; }
-
-#vakata-contextmenu.jstree-default-context, 
-#vakata-contextmenu.jstree-default-context li ul { background:#f0f0f0; border:1px solid #979797; -moz-box-shadow: 1px 1px 2px #999; -webkit-box-shadow: 1px 1px 2px #999; box-shadow: 1px 1px 2px #999; }
-#vakata-contextmenu.jstree-default-context li { }
-#vakata-contextmenu.jstree-default-context a { color:black; }
-#vakata-contextmenu.jstree-default-context a:hover, 
-#vakata-contextmenu.jstree-default-context .vakata-hover > a { padding:0 5px; background:#e8eff7; border:1px solid #aecff7; color:black; -moz-border-radius:2px; -webkit-border-radius:2px; border-radius:2px; }
-#vakata-contextmenu.jstree-default-context li.jstree-contextmenu-disabled a, 
-#vakata-contextmenu.jstree-default-context li.jstree-contextmenu-disabled a:hover { color:silver; background:transparent; border:0; padding:1px 4px; }
-#vakata-contextmenu.jstree-default-context li.vakata-separator { background:white; border-top:1px solid #e0e0e0; margin:0; }
-#vakata-contextmenu.jstree-default-context li ul { margin-left:-4px; }
+.jstree-default li,
+.jstree-default ins {
+  background-image: url("d.png");
+  background-repeat: no-repeat;
+  background-color: transparent;
+}
+
+.jstree-default li {
+  background-position: -90px 0;
+  background-repeat: repeat-y;
+}
+
+.jstree-default li.jstree-last {
+  background: transparent;
+}
+
+.jstree-default .jstree-open > ins {
+  background-position: -72px 0;
+}
+
+.jstree-default .jstree-closed > ins {
+  background-position: -54px 0;
+}
+
+.jstree-default .jstree-leaf > ins {
+  background-position: -36px 0;
+}
+
+.jstree-default .jstree-hovered {
+  background: #e7f4f9;
+  border: 1px solid #d8f0fa;
+  padding: 0 2px 0 1px;
+}
+
+.jstree-default .jstree-clicked {
+  background: #beebff;
+  border: 1px solid #99defd;
+  padding: 0 2px 0 1px;
+}
+
+.jstree-default a .jstree-icon {
+  background-position: -56px -19px;
+}
+
+.jstree-default a.jstree-loading .jstree-icon {
+  background: url("throbber.gif") center center no-repeat !important;
+}
+
+.jstree-default.jstree-focused {
+  background: #ffffee;
+}
+
+.jstree-default .jstree-no-dots li,
+.jstree-default .jstree-no-dots .jstree-leaf > ins {
+  background: transparent;
+}
+
+.jstree-default .jstree-no-dots .jstree-open > ins {
+  background-position: -18px 0;
+}
+
+.jstree-default .jstree-no-dots .jstree-closed > ins {
+  background-position: 0 0;
+}
+
+.jstree-default .jstree-no-icons a .jstree-icon {
+  display: none;
+}
+
+.jstree-default .jstree-search {
+  font-style: italic;
+}
+
+.jstree-default .jstree-no-icons .jstree-checkbox {
+  display: inline-block;
+}
+
+.jstree-default .jstree-no-checkboxes .jstree-checkbox {
+  display: none !important;
+}
+
+.jstree-default .jstree-checked > a > .jstree-checkbox {
+  background-position: -38px -19px;
+}
+
+.jstree-default .jstree-unchecked > a > .jstree-checkbox {
+  background-position: -2px -19px;
+}
+
+.jstree-default .jstree-undetermined > a > .jstree-checkbox {
+  background-position: -20px -19px;
+}
+
+.jstree-default .jstree-checked > a > .jstree-checkbox:hover {
+  background-position: -38px -37px;
+}
+
+.jstree-default .jstree-unchecked > a > .jstree-checkbox:hover {
+  background-position: -2px -37px;
+}
+
+.jstree-default .jstree-undetermined > a > .jstree-checkbox:hover {
+  background-position: -20px -37px;
+}
+
+#vakata-dragged.jstree-default ins {
+  background: transparent !important;
+}
+
+#vakata-dragged.jstree-default .jstree-ok {
+  background: url("d.png") -2px -53px no-repeat !important;
+}
+
+#vakata-dragged.jstree-default .jstree-invalid {
+  background: url("d.png") -18px -53px no-repeat !important;
+}
+
+#jstree-marker.jstree-default {
+  background: url("d.png") -41px -57px no-repeat !important;
+}
+
+.jstree-default a.jstree-search {
+  color: aqua;
+}
+
+#vakata-contextmenu.jstree-default-context,
+#vakata-contextmenu.jstree-default-context li ul {
+  background: #f0f0f0;
+  border: 1px solid #979797;
+  -moz-box-shadow: 1px 1px 2px #999;
+  -webkit-box-shadow: 1px 1px 2px #999;
+  box-shadow: 1px 1px 2px #999;
+}
+
+#vakata-contextmenu.jstree-default-context li {
+}
+
+#vakata-contextmenu.jstree-default-context a {
+  color: black;
+}
+
+#vakata-contextmenu.jstree-default-context a:hover,
+#vakata-contextmenu.jstree-default-context .vakata-hover > a {
+  padding: 0 5px;
+  background: #e8eff7;
+  border: 1px solid #aecff7;
+  color: black;
+  -moz-border-radius: 2px;
+  -webkit-border-radius: 2px;
+  border-radius: 2px;
+}
+
+#vakata-contextmenu.jstree-default-context li.jstree-contextmenu-disabled a,
+#vakata-contextmenu.jstree-default-context li.jstree-contextmenu-disabled a:hover {
+  color: silver;
+  background: transparent;
+  border: 0;
+  padding: 1px 4px;
+}
+
+#vakata-contextmenu.jstree-default-context li.vakata-separator {
+  background: white;
+  border-top: 1px solid #e0e0e0;
+  margin: 0;
+}
+
+#vakata-contextmenu.jstree-default-context li ul {
+  margin-left: -4px;
+}
 
 /* IE6 BEGIN */
-.jstree-default li, 
+.jstree-default li,
 .jstree-default ins,
-#vakata-dragged.jstree-default .jstree-invalid, 
-#vakata-dragged.jstree-default .jstree-ok, 
-#jstree-marker.jstree-default { _background-image:url("d.gif"); }
-.jstree-default .jstree-open ins { _background-position:-72px 0; }
-.jstree-default .jstree-closed ins { _background-position:-54px 0; }
-.jstree-default .jstree-leaf ins { _background-position:-36px 0; }
-.jstree-default a ins.jstree-icon { _background-position:-56px -19px; }
-#vakata-contextmenu.jstree-default-context ins { _display:none; }
-#vakata-contextmenu.jstree-default-context li { _zoom:1; }
-.jstree-default .jstree-undetermined a .jstree-checkbox { _background-position:-20px -19px; }
-.jstree-default .jstree-checked a .jstree-checkbox { _background-position:-38px -19px; }
-.jstree-default .jstree-unchecked a .jstree-checkbox { _background-position:-2px -19px; }
-/* IE6 END */
\ No newline at end of file
+#vakata-dragged.jstree-default .jstree-invalid,
+#vakata-dragged.jstree-default .jstree-ok,
+#jstree-marker.jstree-default {
+  _background-image: url("d.gif");
+}
+
+.jstree-default .jstree-open ins {
+  _background-position: -72px 0;
+}
+
+.jstree-default .jstree-closed ins {
+  _background-position: -54px 0;
+}
+
+.jstree-default .jstree-leaf ins {
+  _background-position: -36px 0;
+}
+
+.jstree-default a ins.jstree-icon {
+  _background-position: -56px -19px;
+}
+
+#vakata-contextmenu.jstree-default-context ins {
+  _display: none;
+}
+
+#vakata-contextmenu.jstree-default-context li {
+  _zoom: 1;
+}
+
+.jstree-default .jstree-undetermined a .jstree-checkbox {
+  _background-position: -20px -19px;
+}
+
+.jstree-default .jstree-checked a .jstree-checkbox {
+  _background-position: -38px -19px;
+}
+
+.jstree-default .jstree-unchecked a .jstree-checkbox {
+  _background-position: -2px -19px;
+}
+
+/* IE6 END */
diff --git a/azkaban-web-server/src/web/js/jquery/themes/default-rtl/style.css b/azkaban-web-server/src/web/js/jquery/themes/default-rtl/style.css
index 3ad0727..006f7c4 100644
--- a/azkaban-web-server/src/web/js/jquery/themes/default-rtl/style.css
+++ b/azkaban-web-server/src/web/js/jquery/themes/default-rtl/style.css
@@ -4,80 +4,256 @@
  * Supported plugins: ui (hovered, clicked), checkbox, contextmenu, search
  */
 
-.jstree-default-rtl li, 
-.jstree-default-rtl ins { background-image:url("d.png"); background-repeat:no-repeat; background-color:transparent; }
-.jstree-default-rtl li { background-position:-90px 0; background-repeat:repeat-y; }
-.jstree-default-rtl li.jstree-last { background:transparent; }
-.jstree-default-rtl .jstree-open > ins { background-position:-72px 0; }
-.jstree-default-rtl .jstree-closed > ins { background-position:-54px 0; }
-.jstree-default-rtl .jstree-leaf > ins { background-position:-36px 0; }
-
-.jstree-default-rtl .jstree-hovered { background:#e7f4f9; border:1px solid #d8f0fa; padding:0 2px 0 1px; }
-.jstree-default-rtl .jstree-clicked { background:#beebff; border:1px solid #99defd; padding:0 2px 0 1px; }
-.jstree-default-rtl a .jstree-icon { background-position:-56px -19px; }
-.jstree-default-rtl a.jstree-loading .jstree-icon { background:url("throbber.gif") center center no-repeat !important; }
-
-.jstree-default-rtl.jstree-focused { background:#ffffee; }
-
-.jstree-default-rtl .jstree-no-dots li, 
-.jstree-default-rtl .jstree-no-dots .jstree-leaf > ins { background:transparent; }
-.jstree-default-rtl .jstree-no-dots .jstree-open > ins { background-position:-18px 0; }
-.jstree-default-rtl .jstree-no-dots .jstree-closed > ins { background-position:0 0; }
-
-.jstree-default-rtl .jstree-no-icons a .jstree-icon { display:none; }
-
-.jstree-default-rtl .jstree-search { font-style:italic; }
-
-.jstree-default-rtl .jstree-no-icons .jstree-checkbox { display:inline-block; }
-.jstree-default-rtl .jstree-no-checkboxes .jstree-checkbox { display:none !important; }
-.jstree-default-rtl .jstree-checked > a > .jstree-checkbox { background-position:-38px -19px; }
-.jstree-default-rtl .jstree-unchecked > a > .jstree-checkbox { background-position:-2px -19px; }
-.jstree-default-rtl .jstree-undetermined > a > .jstree-checkbox { background-position:-20px -19px; }
-.jstree-default-rtl .jstree-checked > a > .jstree-checkbox:hover { background-position:-38px -37px; }
-.jstree-default-rtl .jstree-unchecked > a > .jstree-checkbox:hover { background-position:-2px -37px; }
-.jstree-default-rtl .jstree-undetermined > a > .jstree-checkbox:hover { background-position:-20px -37px; }
-
-#vakata-dragged.jstree-default-rtl ins { background:transparent !important; }
-#vakata-dragged.jstree-default-rtl .jstree-ok { background:url("d.png") -2px -53px no-repeat !important; }
-#vakata-dragged.jstree-default-rtl .jstree-invalid { background:url("d.png") -18px -53px no-repeat !important; }
-#jstree-marker.jstree-default-rtl { background:url("d.png") -41px -57px no-repeat !important; }
-
-.jstree-default-rtl a.jstree-search { color:aqua; }
-
-#vakata-contextmenu.jstree-default-rtl-context, 
-#vakata-contextmenu.jstree-default-rtl-context li ul { background:#f0f0f0; border:1px solid #979797; -moz-box-shadow: 1px 1px 2px #999; -webkit-box-shadow: 1px 1px 2px #999; box-shadow: 1px 1px 2px #999; }
-#vakata-contextmenu.jstree-default-rtl-context li { }
-#vakata-contextmenu.jstree-default-rtl-context a { color:black; }
-#vakata-contextmenu.jstree-default-rtl-context a:hover, 
-#vakata-contextmenu.jstree-default-rtl-context .vakata-hover > a { padding:0 5px; background:#e8eff7; border:1px solid #aecff7; color:black; -moz-border-radius:2px; -webkit-border-radius:2px; border-radius:2px; }
-#vakata-contextmenu.jstree-default-rtl-context li.jstree-contextmenu-disabled a, 
-#vakata-contextmenu.jstree-default-rtl-context li.jstree-contextmenu-disabled a:hover { color:silver; background:transparent; border:0; padding:1px 4px; }
-#vakata-contextmenu.jstree-default-rtl-context li.vakata-separator { background:white; border-top:1px solid #e0e0e0; margin:0; }
-#vakata-contextmenu.jstree-default-rtl-context li ul { margin-left:-4px; }
+.jstree-default-rtl li,
+.jstree-default-rtl ins {
+  background-image: url("d.png");
+  background-repeat: no-repeat;
+  background-color: transparent;
+}
+
+.jstree-default-rtl li {
+  background-position: -90px 0;
+  background-repeat: repeat-y;
+}
+
+.jstree-default-rtl li.jstree-last {
+  background: transparent;
+}
+
+.jstree-default-rtl .jstree-open > ins {
+  background-position: -72px 0;
+}
+
+.jstree-default-rtl .jstree-closed > ins {
+  background-position: -54px 0;
+}
+
+.jstree-default-rtl .jstree-leaf > ins {
+  background-position: -36px 0;
+}
+
+.jstree-default-rtl .jstree-hovered {
+  background: #e7f4f9;
+  border: 1px solid #d8f0fa;
+  padding: 0 2px 0 1px;
+}
+
+.jstree-default-rtl .jstree-clicked {
+  background: #beebff;
+  border: 1px solid #99defd;
+  padding: 0 2px 0 1px;
+}
+
+.jstree-default-rtl a .jstree-icon {
+  background-position: -56px -19px;
+}
+
+.jstree-default-rtl a.jstree-loading .jstree-icon {
+  background: url("throbber.gif") center center no-repeat !important;
+}
+
+.jstree-default-rtl.jstree-focused {
+  background: #ffffee;
+}
+
+.jstree-default-rtl .jstree-no-dots li,
+.jstree-default-rtl .jstree-no-dots .jstree-leaf > ins {
+  background: transparent;
+}
+
+.jstree-default-rtl .jstree-no-dots .jstree-open > ins {
+  background-position: -18px 0;
+}
+
+.jstree-default-rtl .jstree-no-dots .jstree-closed > ins {
+  background-position: 0 0;
+}
+
+.jstree-default-rtl .jstree-no-icons a .jstree-icon {
+  display: none;
+}
+
+.jstree-default-rtl .jstree-search {
+  font-style: italic;
+}
+
+.jstree-default-rtl .jstree-no-icons .jstree-checkbox {
+  display: inline-block;
+}
+
+.jstree-default-rtl .jstree-no-checkboxes .jstree-checkbox {
+  display: none !important;
+}
+
+.jstree-default-rtl .jstree-checked > a > .jstree-checkbox {
+  background-position: -38px -19px;
+}
+
+.jstree-default-rtl .jstree-unchecked > a > .jstree-checkbox {
+  background-position: -2px -19px;
+}
+
+.jstree-default-rtl .jstree-undetermined > a > .jstree-checkbox {
+  background-position: -20px -19px;
+}
+
+.jstree-default-rtl .jstree-checked > a > .jstree-checkbox:hover {
+  background-position: -38px -37px;
+}
+
+.jstree-default-rtl .jstree-unchecked > a > .jstree-checkbox:hover {
+  background-position: -2px -37px;
+}
+
+.jstree-default-rtl .jstree-undetermined > a > .jstree-checkbox:hover {
+  background-position: -20px -37px;
+}
+
+#vakata-dragged.jstree-default-rtl ins {
+  background: transparent !important;
+}
+
+#vakata-dragged.jstree-default-rtl .jstree-ok {
+  background: url("d.png") -2px -53px no-repeat !important;
+}
+
+#vakata-dragged.jstree-default-rtl .jstree-invalid {
+  background: url("d.png") -18px -53px no-repeat !important;
+}
+
+#jstree-marker.jstree-default-rtl {
+  background: url("d.png") -41px -57px no-repeat !important;
+}
+
+.jstree-default-rtl a.jstree-search {
+  color: aqua;
+}
+
+#vakata-contextmenu.jstree-default-rtl-context,
+#vakata-contextmenu.jstree-default-rtl-context li ul {
+  background: #f0f0f0;
+  border: 1px solid #979797;
+  -moz-box-shadow: 1px 1px 2px #999;
+  -webkit-box-shadow: 1px 1px 2px #999;
+  box-shadow: 1px 1px 2px #999;
+}
+
+#vakata-contextmenu.jstree-default-rtl-context li {
+}
+
+#vakata-contextmenu.jstree-default-rtl-context a {
+  color: black;
+}
+
+#vakata-contextmenu.jstree-default-rtl-context a:hover,
+#vakata-contextmenu.jstree-default-rtl-context .vakata-hover > a {
+  padding: 0 5px;
+  background: #e8eff7;
+  border: 1px solid #aecff7;
+  color: black;
+  -moz-border-radius: 2px;
+  -webkit-border-radius: 2px;
+  border-radius: 2px;
+}
+
+#vakata-contextmenu.jstree-default-rtl-context li.jstree-contextmenu-disabled a,
+#vakata-contextmenu.jstree-default-rtl-context li.jstree-contextmenu-disabled a:hover {
+  color: silver;
+  background: transparent;
+  border: 0;
+  padding: 1px 4px;
+}
+
+#vakata-contextmenu.jstree-default-rtl-context li.vakata-separator {
+  background: white;
+  border-top: 1px solid #e0e0e0;
+  margin: 0;
+}
+
+#vakata-contextmenu.jstree-default-rtl-context li ul {
+  margin-left: -4px;
+}
 
 /* IE6 BEGIN */
-.jstree-default-rtl li, 
+.jstree-default-rtl li,
 .jstree-default-rtl ins,
-#vakata-dragged.jstree-default-rtl .jstree-invalid, 
-#vakata-dragged.jstree-default-rtl .jstree-ok, 
-#jstree-marker.jstree-default-rtl { _background-image:url("d.gif"); }
-.jstree-default-rtl .jstree-open ins { _background-position:-72px 0; }
-.jstree-default-rtl .jstree-closed ins { _background-position:-54px 0; }
-.jstree-default-rtl .jstree-leaf ins { _background-position:-36px 0; }
-.jstree-default-rtl a ins.jstree-icon { _background-position:-56px -19px; }
-#vakata-contextmenu.jstree-default-rtl-context ins { _display:none; }
-#vakata-contextmenu.jstree-default-rtl-context li { _zoom:1; }
-.jstree-default-rtl .jstree-undetermined a .jstree-checkbox { _background-position:-18px -19px; }
-.jstree-default-rtl .jstree-checked a .jstree-checkbox { _background-position:-36px -19px; }
-.jstree-default-rtl .jstree-unchecked a .jstree-checkbox { _background-position:0px -19px; }
+#vakata-dragged.jstree-default-rtl .jstree-invalid,
+#vakata-dragged.jstree-default-rtl .jstree-ok,
+#jstree-marker.jstree-default-rtl {
+  _background-image: url("d.gif");
+}
+
+.jstree-default-rtl .jstree-open ins {
+  _background-position: -72px 0;
+}
+
+.jstree-default-rtl .jstree-closed ins {
+  _background-position: -54px 0;
+}
+
+.jstree-default-rtl .jstree-leaf ins {
+  _background-position: -36px 0;
+}
+
+.jstree-default-rtl a ins.jstree-icon {
+  _background-position: -56px -19px;
+}
+
+#vakata-contextmenu.jstree-default-rtl-context ins {
+  _display: none;
+}
+
+#vakata-contextmenu.jstree-default-rtl-context li {
+  _zoom: 1;
+}
+
+.jstree-default-rtl .jstree-undetermined a .jstree-checkbox {
+  _background-position: -18px -19px;
+}
+
+.jstree-default-rtl .jstree-checked a .jstree-checkbox {
+  _background-position: -36px -19px;
+}
+
+.jstree-default-rtl .jstree-unchecked a .jstree-checkbox {
+  _background-position: 0px -19px;
+}
+
 /* IE6 END */
 
 /* RTL part */
-.jstree-default-rtl .jstree-hovered, .jstree-default-rtl .jstree-clicked { padding:0 1px 0 2px; }
-.jstree-default-rtl li { background-image:url("dots.gif"); background-position: 100% 0px; }
-.jstree-default-rtl .jstree-checked > a > .jstree-checkbox { background-position:-36px -19px; margin-left:2px; }
-.jstree-default-rtl .jstree-unchecked > a > .jstree-checkbox { background-position:0px -19px; margin-left:2px; }
-.jstree-default-rtl .jstree-undetermined > a > .jstree-checkbox { background-position:-18px -19px; margin-left:2px; }
-.jstree-default-rtl .jstree-checked > a > .jstree-checkbox:hover { background-position:-36px -37px; }
-.jstree-default-rtl .jstree-unchecked > a > .jstree-checkbox:hover { background-position:0px -37px; }
-.jstree-default-rtl .jstree-undetermined > a > .jstree-checkbox:hover { background-position:-18px -37px; }
\ No newline at end of file
+.jstree-default-rtl .jstree-hovered, .jstree-default-rtl .jstree-clicked {
+  padding: 0 1px 0 2px;
+}
+
+.jstree-default-rtl li {
+  background-image: url("dots.gif");
+  background-position: 100% 0px;
+}
+
+.jstree-default-rtl .jstree-checked > a > .jstree-checkbox {
+  background-position: -36px -19px;
+  margin-left: 2px;
+}
+
+.jstree-default-rtl .jstree-unchecked > a > .jstree-checkbox {
+  background-position: 0px -19px;
+  margin-left: 2px;
+}
+
+.jstree-default-rtl .jstree-undetermined > a > .jstree-checkbox {
+  background-position: -18px -19px;
+  margin-left: 2px;
+}
+
+.jstree-default-rtl .jstree-checked > a > .jstree-checkbox:hover {
+  background-position: -36px -37px;
+}
+
+.jstree-default-rtl .jstree-unchecked > a > .jstree-checkbox:hover {
+  background-position: 0px -37px;
+}
+
+.jstree-default-rtl .jstree-undetermined > a > .jstree-checkbox:hover {
+  background-position: -18px -37px;
+}
diff --git a/azkaban-web-server/src/web/js/jqueryui/jquery-ui-1.10.1.custom.js b/azkaban-web-server/src/web/js/jqueryui/jquery-ui-1.10.1.custom.js
index 9f576b4..2e58bbb 100644
--- a/azkaban-web-server/src/web/js/jqueryui/jquery-ui-1.10.1.custom.js
+++ b/azkaban-web-server/src/web/js/jqueryui/jquery-ui-1.10.1.custom.js
@@ -3,7032 +3,7505 @@
 * 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) 2013 jQuery Foundation and other contributors Licensed MIT */
 
-(function( $, undefined ) {
+(function ($, undefined) {
 
-var uuid = 0,
-	runiqueId = /^ui-id-\d+$/;
+  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.10.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
-	}
-});
+  $.ui = $.ui || {};
+  if ($.ui.version) {
+    return;
+  }
+
+  $.extend($.ui, {
+    version: "1.10.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" );
-			}
-		});
-	}
-});
+  $.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");
+        }
+      });
+    }
+  });
 
 // selectors
-function focusable( element, isTabIndexNotNaN ) {
-	var map, mapName, img,
-		nodeName = element.nodeName.toLowerCase();
-	if ( "area" === nodeName ) {
-		map = element.parentNode;
-		mapName = map.name;
-		if ( !element.href || !mapName || map.nodeName.toLowerCase() !== "map" ) {
-			return false;
-		}
-		img = $( "img[usemap=#" + mapName + "]" )[0];
-		return !!img && visible( img );
-	}
-	return ( /input|select|textarea|button|object/.test( nodeName ) ?
-		!element.disabled :
-		"a" === nodeName ?
-			element.href || isTabIndexNotNaN :
-			isTabIndexNotNaN) &&
-		// the element and all of its ancestors must be visible
-		visible( element );
-}
-
-function visible( element ) {
-	return $.expr.filters.visible( element ) &&
-		!$( element ).parents().addBack().filter(function() {
-			return $.css( this, "visibility" ) === "hidden";
-		}).length;
-}
-
-$.extend( $.expr[ ":" ], {
-	data: $.expr.createPseudo ?
-		$.expr.createPseudo(function( dataName ) {
-			return function( elem ) {
-				return !!$.data( elem, dataName );
-			};
-		}) :
-		// support: jQuery <1.8
-		function( elem, i, match ) {
-			return !!$.data( elem, match[ 3 ] );
-		},
-
-	focusable: function( element ) {
-		return focusable( element, !isNaN( $.attr( element, "tabindex" ) ) );
-	},
-
-	tabbable: function( element ) {
-		var tabIndex = $.attr( element, "tabindex" ),
-			isTabIndexNaN = isNaN( tabIndex );
-		return ( isTabIndexNaN || tabIndex >= 0 ) && focusable( element, !isTabIndexNaN );
-	}
-});
+  function focusable(element, isTabIndexNotNaN) {
+    var map, mapName, img,
+        nodeName = element.nodeName.toLowerCase();
+    if ("area" === nodeName) {
+      map = element.parentNode;
+      mapName = map.name;
+      if (!element.href || !mapName || map.nodeName.toLowerCase() !== "map") {
+        return false;
+      }
+      img = $("img[usemap=#" + mapName + "]")[0];
+      return !!img && visible(img);
+    }
+    return ( /input|select|textarea|button|object/.test(nodeName)
+        ? !element.disabled : "a" === nodeName ? element.href
+            || isTabIndexNotNaN : isTabIndexNotNaN) &&
+        // the element and all of its ancestors must be visible
+        visible(element);
+  }
+
+  function visible(element) {
+    return $.expr.filters.visible(element) &&
+        !$(element).parents().addBack().filter(function () {
+          return $.css(this, "visibility") === "hidden";
+        }).length;
+  }
+
+  $.extend($.expr[":"], {
+    data: $.expr.createPseudo ? $.expr.createPseudo(function (dataName) {
+          return function (elem) {
+            return !!$.data(elem, dataName);
+          };
+        }) : // support: jQuery <1.8
+        function (elem, i, match) {
+          return !!$.data(elem, match[3]);
+        },
+
+    focusable: function (element) {
+      return focusable(element, !isNaN($.attr(element, "tabindex")));
+    },
+
+    tabbable: function (element) {
+      var tabIndex = $.attr(element, "tabindex"),
+          isTabIndexNaN = isNaN(tabIndex);
+      return ( isTabIndexNaN || tabIndex >= 0 ) && focusable(element,
+          !isTabIndexNaN);
+    }
+  });
 
 // support: jQuery <1.8
-if ( !$( "<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" );
-			});
-		};
-	});
-}
+  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");
+        });
+      };
+    });
+  }
 
 // support: jQuery <1.8
-if ( !$.fn.addBack ) {
-	$.fn.addBack = function( selector ) {
-		return this.add( selector == null ?
-			this.prevObject : this.prevObject.filter( selector )
-		);
-	};
-}
+  if (!$.fn.addBack) {
+    $.fn.addBack = function (selector) {
+      return this.add(
+          selector == null ? this.prevObject : this.prevObject.filter(selector)
+      );
+    };
+  }
 
 // support: jQuery 1.6.1, 1.6.2 (http://bugs.jquery.com/ticket/9413)
-if ( $( "<a>" ).data( "a-b", "a" ).removeData( "a-b" ).data( "a-b" ) ) {
-	$.fn.removeData = (function( removeData ) {
-		return function( key ) {
-			if ( arguments.length ) {
-				return removeData.call( this, $.camelCase( key ) );
-			} else {
-				return removeData.call( this );
-			}
-		};
-	})( $.fn.removeData );
-}
-
-
+  if ($("<a>").data("a-b", "a").removeData("a-b").data("a-b")) {
+    $.fn.removeData = (function (removeData) {
+      return function (key) {
+        if (arguments.length) {
+          return removeData.call(this, $.camelCase(key));
+        } else {
+          return removeData.call(this);
+        }
+      };
+    })($.fn.removeData);
+  }
 
+// deprecated
+  $.ui.ie = !!/msie [\w.]+/.exec(navigator.userAgent.toLowerCase());
+
+  $.support.selectstart = "onselectstart" in document.createElement("div");
+  $.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);
+          }
+        }
+      }
+    },
+
+    // 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;
+    }
+  });
 
+})(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,
+        // proxiedPrototype allows the provided prototype to remain unmodified
+        // so that it can be used as a mixin for multiple widgets (#8876)
+        proxiedPrototype = {},
+        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)) {
+        proxiedPrototype[prop] = value;
+        return;
+      }
+      proxiedPrototype[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: existingConstructor ? basePrototype.widgetEventPrefix
+          : name
+    }, proxiedPrototype, {
+      constructor: constructor,
+      namespace: namespace,
+      widgetName: name,
+      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 || name;
+    $.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 {
+            $.data(this, fullName, 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) {
+        $.data(element, this.widgetFullName, this);
+        this._on(true, 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 (suppressDisabledCheck, element, handlers) {
+      var delegateElement,
+          instance = this;
+
+      // no suppressDisabledCheck flag, shuffle arguments
+      if (typeof suppressDisabledCheck !== "boolean") {
+        handlers = element;
+        element = suppressDisabledCheck;
+        suppressDisabledCheck = false;
+      }
+
+      // 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 (!suppressDisabledCheck &&
+              ( 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]) {
+        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
-$.ui.ie = !!/msie [\w.]+/.exec( navigator.userAgent.toLowerCase() );
-
-$.support.selectstart = "onselectstart" in document.createElement( "div" );
-$.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 );
-				}
-			}
-		}
-	},
-
-	// 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;
-	}
-});
-
-})( 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,
-		// proxiedPrototype allows the provided prototype to remain unmodified
-		// so that it can be used as a mixin for multiple widgets (#8876)
-		proxiedPrototype = {},
-		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 ) ) {
-			proxiedPrototype[ prop ] = value;
-			return;
-		}
-		proxiedPrototype[ 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: existingConstructor ? basePrototype.widgetEventPrefix : name
-	}, proxiedPrototype, {
-		constructor: constructor,
-		namespace: namespace,
-		widgetName: name,
-		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 || name;
-	$.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 {
-					$.data( this, fullName, 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 ) {
-			$.data( element, this.widgetFullName, this );
-			this._on( true, 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( suppressDisabledCheck, element, handlers ) {
-		var delegateElement,
-			instance = this;
-
-		// no suppressDisabledCheck flag, shuffle arguments
-		if ( typeof suppressDisabledCheck !== "boolean" ) {
-			handlers = element;
-			element = suppressDisabledCheck;
-			suppressDisabledCheck = false;
-		}
-
-		// 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 ( !suppressDisabledCheck &&
-						( 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 ] ) {
-			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();
-			});
-		}
-	};
-});
-
-})( jQuery );
-(function( $, undefined ) {
-
-var mouseHandled = false;
-$( document ).mouseup( function() {
-	mouseHandled = false;
-});
-
-$.widget("ui.mouse", {
-	version: "1.10.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 || 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) {
+
+  var mouseHandled = false;
+  $(document).mouseup(function () {
+    mouseHandled = false;
+  });
+
+  $.widget("ui.mouse", {
+    version: "1.10.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 || 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+(\.[\d]+)?%?/,
-	rposition = /^\w+/,
-	rpercent = /%$/,
-	_position = $.fn.position;
-
-function getOffsets( offsets, width, height ) {
-	return [
-		parseFloat( offsets[ 0 ] ) * ( rpercent.test( offsets[ 0 ] ) ? width / 100 : 1 ),
-		parseFloat( offsets[ 1 ] ) * ( rpercent.test( offsets[ 1 ] ) ? height / 100 : 1 )
-	];
-}
-
-function parseCss( element, property ) {
-	return parseInt( $.css( element, property ), 10 ) || 0;
-}
-
-function getDimensions( elem ) {
-	var raw = elem[0];
-	if ( raw.nodeType === 9 ) {
-		return {
-			width: elem.width(),
-			height: elem.height(),
-			offset: { top: 0, left: 0 }
-		};
-	}
-	if ( $.isWindow( raw ) ) {
-		return {
-			width: elem.width(),
-			height: elem.height(),
-			offset: { top: elem.scrollTop(), left: elem.scrollLeft() }
-		};
-	}
-	if ( raw.preventDefault ) {
-		return {
-			width: 0,
-			height: 0,
-			offset: { top: raw.pageY, left: raw.pageX }
-		};
-	}
-	return {
-		width: elem.outerWidth(),
-		height: elem.outerHeight(),
-		offset: elem.offset()
-	};
-}
-
-$.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, dimensions,
-		target = $( options.of ),
-		within = $.position.getWithinInfo( options.within ),
-		scrollInfo = $.position.getScrollInfo( within ),
-		collision = ( options.collision || "flip" ).split( " " ),
-		offsets = {};
-
-	dimensions = getDimensions( target );
-	if ( target[0].preventDefault ) {
-		// force left top to allow flipping
-		options.at = "left top";
-	}
-	targetWidth = dimensions.width;
-	targetHeight = dimensions.height;
-	targetOffset = dimensions.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 ( 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 );
-		}
-	}
-};
+(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+(\.[\d]+)?%?/,
+      rposition = /^\w+/,
+      rpercent = /%$/,
+      _position = $.fn.position;
+
+  function getOffsets(offsets, width, height) {
+    return [
+      parseFloat(offsets[0]) * ( rpercent.test(offsets[0]) ? width / 100 : 1 ),
+      parseFloat(offsets[1]) * ( rpercent.test(offsets[1]) ? height / 100 : 1 )
+    ];
+  }
+
+  function parseCss(element, property) {
+    return parseInt($.css(element, property), 10) || 0;
+  }
+
+  function getDimensions(elem) {
+    var raw = elem[0];
+    if (raw.nodeType === 9) {
+      return {
+        width: elem.width(),
+        height: elem.height(),
+        offset: {top: 0, left: 0}
+      };
+    }
+    if ($.isWindow(raw)) {
+      return {
+        width: elem.width(),
+        height: elem.height(),
+        offset: {top: elem.scrollTop(), left: elem.scrollLeft()}
+      };
+    }
+    if (raw.preventDefault) {
+      return {
+        width: 0,
+        height: 0,
+        offset: {top: raw.pageY, left: raw.pageX}
+      };
+    }
+    return {
+      width: elem.outerWidth(),
+      height: elem.outerHeight(),
+      offset: elem.offset()
+    };
+  }
+
+  $.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,
+        dimensions,
+        target = $(options.of),
+        within = $.position.getWithinInfo(options.within),
+        scrollInfo = $.position.getScrollInfo(within),
+        collision = ( options.collision || "flip" ).split(" "),
+        offsets = {};
+
+    dimensions = getDimensions(target);
+    if (target[0].preventDefault) {
+      // force left top to allow flipping
+      options.at = "left top";
+    }
+    targetWidth = dimensions.width;
+    targetHeight = dimensions.height;
+    targetOffset = dimensions.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 (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 );
-})();
-
-}( jQuery ) );
-(function( $, undefined ) {
-
-$.widget("ui.draggable", $.ui.mouse, {
-	version: "1.10.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,
-
-		// callbacks
-		drag: null,
-		start: null,
-		stop: null
-	},
-	_create: function() {
-
-		if (this.options.helper === "original" && !(/^(?:r|a|f)/).test(this.element.css("position"))) {
-			this.element[0].style.position = "relative";
-		}
-		if (this.options.addClasses){
-			this.element.addClass("ui-draggable");
-		}
-		if (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).closest(".ui-resizable-handle").length > 0) {
-			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;
-		}
-
-		/*
+  (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);
+  })();
+
+}(jQuery) );
+(function ($, undefined) {
+
+  $.widget("ui.draggable", $.ui.mouse, {
+    version: "1.10.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,
+
+      // callbacks
+      drag: null,
+      start: null,
+      stop: null
+    },
+    _create: function () {
+
+      if (this.options.helper === "original" && !(/^(?:r|a|f)/).test(
+              this.element.css("position"))) {
+        this.element[0].style.position = "relative";
+      }
+      if (this.options.addClasses) {
+        this.element.addClass("ui-draggable");
+      }
+      if (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).closest(
+              ".ui-resizable-handle").length > 0) {
+        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 element,
-			that = this,
-			elementInDom = false,
-			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)
-		element = this.element[0];
-		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))) {
-			$(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("*")
-			.addBack()
-			.each(function() {
-				if(this === event.target) {
-					handle = true;
-				}
-			});
-
-		return handle;
-
-	},
-
-	_createHelper: function(event) {
-
-		var o = this.options,
-			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();
-		}
-
-		//This needs to be actually done for all browsers, since pageX/pageY includes this information
-		//Ugly IE fix
-		if((this.offsetParent[0] === document.body) ||
-			(this.offsetParent[0].tagName && this.offsetParent[0].tagName.toLowerCase() === "html" && $.ui.ie)) {
-			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 over, c, ce,
-			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) {
-			c = $(o.containment);
-			ce = c[0];
-
-			if(!ce) {
-				return;
-			}
-
-			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,
-			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 containment, co, top, left,
-			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),
-			pageX = event.pageX,
-			pageY = event.pageY;
-
-		/*
+      //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 element,
+          that = this,
+          elementInDom = false,
+          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)
+      element = this.element[0];
+      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))) {
+        $(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("*")
+      .addBack()
+      .each(function () {
+        if (this === event.target) {
+          handle = true;
+        }
+      });
+
+      return handle;
+
+    },
+
+    _createHelper: function (event) {
+
+      var o = this.options,
+          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();
+      }
+
+      //This needs to be actually done for all browsers, since pageX/pageY includes this information
+      //Ugly IE fix
+      if ((this.offsetParent[0] === document.body) ||
+          (this.offsetParent[0].tagName
+              && this.offsetParent[0].tagName.toLowerCase() === "html"
+              && $.ui.ie)) {
+        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 over, c, ce,
+          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) {
+        c = $(o.containment);
+        ce = c[0];
+
+        if (!ce) {
+          return;
+        }
+
+        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,
+          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 containment, co, top, left,
+          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),
+          pageX = event.pageX,
+          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 (this.relative_container){
-				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)
-				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;
-
-				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();
-		}
-		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]);
-		//The absolute position has to be recalculated after plugins
-		if(type === "drag") {
-			this.positionAbs = this._convertPositionTo("absolute");
-		}
-		return $.Widget.prototype._trigger.call(this, type, event, ui);
-	},
-
-	plugins: {},
-
-	_uiHash: function() {
-		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("ui-draggable"), o = inst.options,
-			uiSortable = $.extend({}, ui, { item: inst.element });
-		inst.sortables = [];
-		$(o.connectToSortable).each(function() {
-			var sortable = $.data(this, "ui-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("ui-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("ui-draggable"), that = this;
-
-		$.each(inst.sortables, function() {
-
-			var innermostIntersecting = false,
-				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) &&
-						$.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("ui-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() {
-		var t = $("body"), o = $(this).data("ui-draggable").options;
-		if (t.css("cursor")) {
-			o._cursor = t.css("cursor");
-		}
-		t.css("cursor", o.cursor);
-	},
-	stop: function() {
-		var o = $(this).data("ui-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("ui-draggable").options;
-		if(t.css("opacity")) {
-			o._opacity = t.css("opacity");
-		}
-		t.css("opacity", o.opacity);
-	},
-	stop: function(event, ui) {
-		var o = $(this).data("ui-draggable").options;
-		if(o._opacity) {
-			$(ui.helper).css("opacity", o._opacity);
-		}
-	}
-});
-
-$.ui.plugin.add("draggable", "scroll", {
-	start: function() {
-		var i = $(this).data("ui-draggable");
-		if(i.scrollParent[0] !== document && i.scrollParent[0].tagName !== "HTML") {
-			i.overflowOffset = i.scrollParent.offset();
-		}
-	},
-	drag: function( event ) {
-
-		var i = $(this).data("ui-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() {
-
-		var i = $(this).data("ui-draggable"),
-			o = i.options;
-
-		i.snapElements = [];
-
-		$(o.snap.constructor !== String ? ( o.snap.items || ":data(ui-draggable)" ) : o.snap).each(function() {
-			var $t = $(this),
-				$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 ts, bs, ls, rs, l, r, t, b, i, first,
-			inst = $(this).data("ui-draggable"),
-			o = inst.options,
-			d = o.snapTolerance,
-			x1 = ui.offset.left, x2 = x1 + inst.helperProportions.width,
-			y1 = ui.offset.top, y2 = y1 + inst.helperProportions.height;
-
-		for (i = inst.snapElements.length - 1; i >= 0; i--){
-
-			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") {
-				ts = Math.abs(t - y2) <= d;
-				bs = Math.abs(b - y1) <= d;
-				ls = Math.abs(l - x2) <= d;
-				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;
-				}
-			}
-
-			first = (ts || bs || ls || rs);
-
-			if(o.snapMode !== "outer") {
-				ts = Math.abs(t - y1) <= d;
-				bs = Math.abs(b - y2) <= d;
-				ls = Math.abs(l - x1) <= d;
-				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() {
-		var min,
-			o = this.data("ui-draggable").options,
-			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; }
-
-		min = parseInt($(group[0]).css("zIndex"), 10) || 0;
-		$(group).each(function(i) {
-			$(this).css("zIndex", min + i);
-		});
-		this.css("zIndex", (min + group.length));
-	}
-});
-
-$.ui.plugin.add("draggable", "zIndex", {
-	start: function(event, ui) {
-		var t = $(ui.helper), o = $(this).data("ui-draggable").options;
-		if(t.css("zIndex")) {
-			o._zIndex = t.css("zIndex");
-		}
-		t.css("zIndex", o.zIndex);
-	},
-	stop: function(event, ui) {
-		var o = $(this).data("ui-draggable").options;
-		if(o._zIndex) {
-			$(ui.helper).css("zIndex", o._zIndex);
-		}
-	}
-});
+      if (this.originalPosition) { //If we are not dragging yet, we won't check for options
+        if (this.containment) {
+          if (this.relative_container) {
+            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)
+          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;
+
+          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();
+      }
+      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]);
+      //The absolute position has to be recalculated after plugins
+      if (type === "drag") {
+        this.positionAbs = this._convertPositionTo("absolute");
+      }
+      return $.Widget.prototype._trigger.call(this, type, event, ui);
+    },
+
+    plugins: {},
+
+    _uiHash: function () {
+      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("ui-draggable"), o = inst.options,
+          uiSortable = $.extend({}, ui, {item: inst.element});
+      inst.sortables = [];
+      $(o.connectToSortable).each(function () {
+        var sortable = $.data(this, "ui-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("ui-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("ui-draggable"), that = this;
+
+      $.each(inst.sortables, function () {
+
+        var innermostIntersecting = false,
+            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) &&
+                $.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("ui-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 () {
+      var t = $("body"), o = $(this).data("ui-draggable").options;
+      if (t.css("cursor")) {
+        o._cursor = t.css("cursor");
+      }
+      t.css("cursor", o.cursor);
+    },
+    stop: function () {
+      var o = $(this).data("ui-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("ui-draggable").options;
+      if (t.css("opacity")) {
+        o._opacity = t.css("opacity");
+      }
+      t.css("opacity", o.opacity);
+    },
+    stop: function (event, ui) {
+      var o = $(this).data("ui-draggable").options;
+      if (o._opacity) {
+        $(ui.helper).css("opacity", o._opacity);
+      }
+    }
+  });
+
+  $.ui.plugin.add("draggable", "scroll", {
+    start: function () {
+      var i = $(this).data("ui-draggable");
+      if (i.scrollParent[0] !== document && i.scrollParent[0].tagName
+          !== "HTML") {
+        i.overflowOffset = i.scrollParent.offset();
+      }
+    },
+    drag: function (event) {
+
+      var i = $(this).data("ui-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 () {
+
+      var i = $(this).data("ui-draggable"),
+          o = i.options;
+
+      i.snapElements = [];
+
+      $(o.snap.constructor !== String ? ( o.snap.items
+          || ":data(ui-draggable)" ) : o.snap).each(function () {
+        var $t = $(this),
+            $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 ts, bs, ls, rs, l, r, t, b, i, first,
+          inst = $(this).data("ui-draggable"),
+          o = inst.options,
+          d = o.snapTolerance,
+          x1 = ui.offset.left, x2 = x1 + inst.helperProportions.width,
+          y1 = ui.offset.top, y2 = y1 + inst.helperProportions.height;
+
+      for (i = inst.snapElements.length - 1; i >= 0; i--) {
+
+        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") {
+          ts = Math.abs(t - y2) <= d;
+          bs = Math.abs(b - y1) <= d;
+          ls = Math.abs(l - x2) <= d;
+          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;
+          }
+        }
+
+        first = (ts || bs || ls || rs);
+
+        if (o.snapMode !== "outer") {
+          ts = Math.abs(t - y1) <= d;
+          bs = Math.abs(b - y2) <= d;
+          ls = Math.abs(l - x1) <= d;
+          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 () {
+      var min,
+          o = this.data("ui-draggable").options,
+          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;
+      }
+
+      min = parseInt($(group[0]).css("zIndex"), 10) || 0;
+      $(group).each(function (i) {
+        $(this).css("zIndex", min + i);
+      });
+      this.css("zIndex", (min + group.length));
+    }
+  });
+
+  $.ui.plugin.add("draggable", "zIndex", {
+    start: function (event, ui) {
+      var t = $(ui.helper), o = $(this).data("ui-draggable").options;
+      if (t.css("zIndex")) {
+        o._zIndex = t.css("zIndex");
+      }
+      t.css("zIndex", o.zIndex);
+    },
+    stop: function (event, ui) {
+      var o = $(this).data("ui-draggable").options;
+      if (o._zIndex) {
+        $(ui.helper).css("zIndex", o._zIndex);
+      }
+    }
+  });
 
 })(jQuery);
-(function( $, undefined ) {
-
-function isOverAxis( x, reference, size ) {
-	return ( x > reference ) && ( x < ( reference + size ) );
-}
-
-$.widget("ui.droppable", {
-	version: "1.10.1",
-	widgetEventPrefix: "drop",
-	options: {
-		accept: "*",
-		activeClass: false,
-		addClasses: true,
-		greedy: false,
-		hoverClass: false,
-		scope: "default",
-		tolerance: "intersect",
-
-		// callbacks
-		activate: null,
-		deactivate: null,
-		drop: null,
-		out: null,
-		over: null
-	},
-	_create: function() {
-
-		var o = this.options,
-			accept = o.accept;
-
-		this.isover = false;
-		this.isout = true;
-
-		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 i = 0,
-			drop = $.ui.ddmanager.droppables[this.options.scope];
-
-		for ( ; 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);
-		}
-		if(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);
-		}
-		if(draggable){
-			this._trigger("deactivate", event, this.ui(draggable));
-		}
-	},
-
-	_over: function(event) {
-
-		var draggable = $.ui.ddmanager.current;
-
-		// Bail if draggable and droppable are same element
-		if (!draggable || (draggable.currentItem || draggable.element)[0] === this.element[0]) {
-			return;
-		}
-
-		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;
-
-		// Bail if draggable and droppable are same element
-		if (!draggable || (draggable.currentItem || draggable.element)[0] === this.element[0]) {
-			return;
-		}
-
-		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,
-			childrenIntersection = false;
-
-		// Bail if draggable and droppable are same element
-		if (!draggable || (draggable.currentItem || draggable.element)[0] === this.element[0]) {
-			return false;
-		}
-
-		this.element.find(":data(ui-droppable)").not(".ui-draggable-dragging").each(function() {
-			var inst = $.data(this, "ui-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 draggableLeft, draggableTop,
-		x1 = (draggable.positionAbs || draggable.position.absolute).left, x2 = x1 + draggable.helperProportions.width,
-		y1 = (draggable.positionAbs || draggable.position.absolute).top, y2 = y1 + draggable.helperProportions.height,
-		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);
-		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
-		case "pointer":
-			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);
-			return isOverAxis( draggableTop, t, droppable.proportions.height ) && isOverAxis( draggableLeft, l, droppable.proportions.width );
-		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
-			);
-		default:
-			return false;
-		}
-
-};
-
-/*
+(function ($, undefined) {
+
+  function isOverAxis(x, reference, size) {
+    return ( x > reference ) && ( x < ( reference + size ) );
+  }
+
+  $.widget("ui.droppable", {
+    version: "1.10.1",
+    widgetEventPrefix: "drop",
+    options: {
+      accept: "*",
+      activeClass: false,
+      addClasses: true,
+      greedy: false,
+      hoverClass: false,
+      scope: "default",
+      tolerance: "intersect",
+
+      // callbacks
+      activate: null,
+      deactivate: null,
+      drop: null,
+      out: null,
+      over: null
+    },
+    _create: function () {
+
+      var o = this.options,
+          accept = o.accept;
+
+      this.isover = false;
+      this.isout = true;
+
+      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 i = 0,
+          drop = $.ui.ddmanager.droppables[this.options.scope];
+
+      for (; 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);
+      }
+      if (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);
+      }
+      if (draggable) {
+        this._trigger("deactivate", event, this.ui(draggable));
+      }
+    },
+
+    _over: function (event) {
+
+      var draggable = $.ui.ddmanager.current;
+
+      // Bail if draggable and droppable are same element
+      if (!draggable || (draggable.currentItem || draggable.element)[0]
+          === this.element[0]) {
+        return;
+      }
+
+      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;
+
+      // Bail if draggable and droppable are same element
+      if (!draggable || (draggable.currentItem || draggable.element)[0]
+          === this.element[0]) {
+        return;
+      }
+
+      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,
+          childrenIntersection = false;
+
+      // Bail if draggable and droppable are same element
+      if (!draggable || (draggable.currentItem || draggable.element)[0]
+          === this.element[0]) {
+        return false;
+      }
+
+      this.element.find(":data(ui-droppable)").not(
+          ".ui-draggable-dragging").each(function () {
+        var inst = $.data(this, "ui-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 draggableLeft, draggableTop,
+        x1 = (draggable.positionAbs || draggable.position.absolute).left,
+        x2 = x1 + draggable.helperProportions.width,
+        y1 = (draggable.positionAbs || draggable.position.absolute).top,
+        y2 = y1 + draggable.helperProportions.height,
+        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);
+      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
+      case "pointer":
+        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);
+        return isOverAxis(draggableTop, t, droppable.proportions.height)
+            && isOverAxis(draggableLeft, l, droppable.proportions.width);
+      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
+        );
+      default:
+        return false;
+    }
+
+  };
+
+  /*
 	This manager tracks offsets of draggables and droppables
 */
-$.ui.ddmanager = {
-	current: null,
-	droppables: { "default": [] },
-	prepareOffsets: function(t, event) {
-
-		var i, j,
-			m = $.ui.ddmanager.droppables[t.options.scope] || [],
-			type = event ? event.type : null, // workaround for #2317
-			list = (t.currentItem || t.element).find(":data(ui-droppable)").addBack();
-
-		droppablesLoop: for (i = 0; i < m.length; i++) {
-
-			//No disabled and non-accepted
-			if(m[i].options.disabled || (t && !m[i].accept.call(m[i].element[0],(t.currentItem || t.element)))) {
-				continue;
-			}
-
-			// Filter out elements in the current dragged item
-			for (j=0; j < list.length; j++) {
-				if(list[j] === m[i].element[0]) {
-					m[i].proportions.height = 0;
-					continue droppablesLoop;
-				}
-			}
-
-			m[i].visible = m[i].element.css("display") !== "none";
-			if(!m[i].visible) {
-				continue;
-			}
-
-			//Activate the droppable if used directly from draggables
-			if(type === "mousedown") {
-				m[i]._activate.call(m[i], event);
-			}
-
-			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 = true;
-				this.isover = false;
-				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 parentInstance, scope, parent,
-				intersects = $.ui.intersect(draggable, this, this.options.tolerance),
-				c = !intersects && this.isover ? "isout" : (intersects && !this.isover ? "isover" : null);
-			if(!c) {
-				return;
-			}
-
-			if (this.options.greedy) {
-				// find droppable parents with same scope
-				scope = this.options.scope;
-				parent = this.element.parents(":data(ui-droppable)").filter(function () {
-					return $.data(this, "ui-droppable").options.scope === scope;
-				});
-
-				if (parent.length) {
-					parentInstance = $.data(parent[0], "ui-droppable");
-					parentInstance.greedyChild = (c === "isover");
-				}
-			}
-
-			// we just moved into a greedy child
-			if (parentInstance && c === "isover") {
-				parentInstance.isover = false;
-				parentInstance.isout = true;
-				parentInstance._out.call(parentInstance, event);
-			}
-
-			this[c] = true;
-			this[c === "isout" ? "isover" : "isout"] = false;
-			this[c === "isover" ? "_over" : "_out"].call(this, event);
-
-			// we just moved out of a greedy child
-			if (parentInstance && c === "isout") {
-				parentInstance.isout = false;
-				parentInstance.isover = true;
-				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 );
-		}
-	}
-};
+  $.ui.ddmanager = {
+    current: null,
+    droppables: {"default": []},
+    prepareOffsets: function (t, event) {
+
+      var i, j,
+          m = $.ui.ddmanager.droppables[t.options.scope] || [],
+          type = event ? event.type : null, // workaround for #2317
+          list = (t.currentItem || t.element).find(
+              ":data(ui-droppable)").addBack();
+
+      droppablesLoop: for (i = 0; i < m.length; i++) {
+
+        //No disabled and non-accepted
+        if (m[i].options.disabled || (t && !m[i].accept.call(m[i].element[0],
+                (t.currentItem || t.element)))) {
+          continue;
+        }
+
+        // Filter out elements in the current dragged item
+        for (j = 0; j < list.length; j++) {
+          if (list[j] === m[i].element[0]) {
+            m[i].proportions.height = 0;
+            continue droppablesLoop;
+          }
+        }
+
+        m[i].visible = m[i].element.css("display") !== "none";
+        if (!m[i].visible) {
+          continue;
+        }
+
+        //Activate the droppable if used directly from draggables
+        if (type === "mousedown") {
+          m[i]._activate.call(m[i], event);
+        }
+
+        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 = true;
+              this.isover = false;
+              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 parentInstance, scope, parent,
+                intersects = $.ui.intersect(draggable, this,
+                    this.options.tolerance),
+                c = !intersects && this.isover ? "isout" : (intersects
+                && !this.isover ? "isover" : null);
+            if (!c) {
+              return;
+            }
+
+            if (this.options.greedy) {
+              // find droppable parents with same scope
+              scope = this.options.scope;
+              parent = this.element.parents(":data(ui-droppable)").filter(
+                  function () {
+                    return $.data(this, "ui-droppable").options.scope === scope;
+                  });
+
+              if (parent.length) {
+                parentInstance = $.data(parent[0], "ui-droppable");
+                parentInstance.greedyChild = (c === "isover");
+              }
+            }
+
+            // we just moved into a greedy child
+            if (parentInstance && c === "isover") {
+              parentInstance.isover = false;
+              parentInstance.isout = true;
+              parentInstance._out.call(parentInstance, event);
+            }
+
+            this[c] = true;
+            this[c === "isout" ? "isover" : "isout"] = false;
+            this[c === "isover" ? "_over" : "_out"].call(this, event);
+
+            // we just moved out of a greedy child
+            if (parentInstance && c === "isout") {
+              parentInstance.isout = false;
+              parentInstance.isover = true;
+              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 ) {
-
-function num(v) {
-	return parseInt(v, 10) || 0;
-}
-
-function isNumber(value) {
-	return !isNaN(parseInt(value, 10));
-}
-
-$.widget("ui.resizable", $.ui.mouse, {
-	version: "1.10.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,
-		// See #7960
-		zIndex: 90,
-
-		// callbacks
-		resize: null,
-		start: null,
-		stop: null
-	},
-	_create: function() {
-
-		var n, i, handle, axis, hname,
-			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(
-				"ui-resizable", this.element.data("ui-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";
-			}
-
-			n = this.handles.split(",");
-			this.handles = {};
-
-			for(i = 0; i < n.length; i++) {
-
-				handle = $.trim(n[i]);
-				hname = "ui-resizable-"+handle;
-				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) {
-
-			var i, axis, padPos, padWrapper;
-
-			target = target || this.element;
-
-			for(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)) {
-
-					axis = $(this.handles[i], this.element);
-
-					//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...
-					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) {
-					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 wrapper,
-			_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);
-			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 i, handle,
-			capture = false;
-
-		for (i in this.handles) {
-			handle = $(this.handles[i])[0];
-			if (handle === event.target || $.contains(handle, event.target)) {
-				capture = true;
-			}
-		}
-
-		return !this.options.disabled && capture;
-	},
-
-	_mouseStart: function(event) {
-
-		var curleft, curtop, cursor,
-			o = this.options,
-			iniPos = this.element.position(),
-			el = this.element;
-
-		this.resizing = true;
-
-		// bugfix for http://dev.jquery.com/ticket/1749
-		if ( (/absolute/).test( el.css("position") ) ) {
-			el.css({ position: "absolute", top: el.css("top"), left: el.css("left") });
-		} else if (el.is(".ui-draggable")) {
-			el.css({ position: "absolute", top: iniPos.top, left: iniPos.left });
-		}
-
-		this._renderProxy();
-
-		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);
-
-		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 data,
-			el = this.helper, props = {},
-			smp = this.originalMousePosition,
-			a = this.axis,
-			prevTop = this.position.top,
-			prevLeft = this.position.left,
-			prevWidth = this.size.width,
-			prevHeight = this.size.height,
-			dx = (event.pageX-smp.left)||0,
-			dy = (event.pageY-smp.top)||0,
-			trigger = this._change[a];
-
-		if (!trigger) {
-			return false;
-		}
-
-		// Calculate the attrs that will be change
-		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);
-
-		this._updateCache(data);
-
-		// plugins callbacks need to be called first
-		this._propagate("resize", event);
-
-		if (this.position.top !== prevTop) {
-			props.top = this.position.top + "px";
-		}
-		if (this.position.left !== prevLeft) {
-			props.left = this.position.left + "px";
-		}
-		if (this.size.width !== prevWidth) {
-			props.width = this.size.width + "px";
-		}
-		if (this.size.height !== prevHeight) {
-			props.height = this.size.height + "px";
-		}
-		el.css(props);
-
-		if (!this._helper && this._proportionallyResizeElements.length) {
-			this._proportionallyResize();
-		}
-
-		// Call the user callback if the element was resized
-		if ( ! $.isEmptyObject(props) ) {
-			this._trigger("resize", event, this.ui());
-		}
-
-		return false;
-	},
-
-	_mouseStop: function(event) {
-
-		this.resizing = false;
-		var pr, ista, soffseth, soffsetw, s, left, top,
-			o = this.options, that = this;
-
-		if(this._helper) {
-
-			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;
-
-			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 pMinWidth, pMaxWidth, pMinHeight, pMaxHeight, b,
-			o = this.options;
-
-		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) {
-		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 ) {
-
-		var 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 ) {
-
-		var o = this._vBoundaries,
-			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),
-			dw = this.originalPosition.left + this.originalSize.width,
-			dh = this.position.top + this.size.height,
-			cw = /sw|nw|w/.test(a), ch = /nw|ne|n/.test(a);
-		if (isminw) {
-			data.width = o.minWidth;
-		}
-		if (isminh) {
-			data.height = o.minHeight;
-		}
-		if (ismaxw) {
-			data.width = o.maxWidth;
-		}
-		if (ismaxh) {
-			data.height = o.maxHeight;
-		}
-
-		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
-		if (!data.width && !data.height && !data.left && data.top) {
-			data.top = null;
-		} else if (!data.width && !data.height && !data.top && data.left) {
-			data.left = null;
-		}
-
-		return data;
-	},
-
-	_proportionallyResize: function() {
-
-		if (!this._proportionallyResizeElements.length) {
-			return;
-		}
-
-		var i, j, borders, paddings, prel,
-			element = this.helper || this.element;
-
-		for ( i=0; i < this._proportionallyResizeElements.length; i++) {
-
-			prel = this._proportionallyResizeElements[i];
-
-			if (!this.borderDif) {
-				this.borderDif = [];
-				borders = [prel.css("borderTopWidth"), prel.css("borderRightWidth"), prel.css("borderBottomWidth"), prel.css("borderLeftWidth")];
-				paddings = [prel.css("paddingTop"), prel.css("paddingRight"), prel.css("paddingBottom"), prel.css("paddingLeft")];
-
-				for ( j = 0; j < borders.length; j++ ) {
-					this.borderDif[ j ] = ( parseInt( borders[ j ], 10 ) || 0 ) + ( parseInt( paddings[ j ], 10 ) || 0 );
-				}
-			}
-
-			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>");
-
-			this.helper.addClass(this._helper).css({
-				width: this.element.outerWidth() - 1,
-				height: this.element.outerHeight() - 1,
-				position: "absolute",
-				left: this.elementOffset.left +"px",
-				top: this.elementOffset.top +"px",
-				zIndex: ++o.zIndex //TODO: Don't modify option
-			});
-
-			this.helper
-				.appendTo("body")
-				.disableSelection();
-
-		} else {
-			this.helper = this.element;
-		}
-
-	},
-
-	_change: {
-		e: function(event, dx) {
-			return { width: this.originalSize.width + dx };
-		},
-		w: function(event, dx) {
-			var cs = this.originalSize, sp = this.originalPosition;
-			return { left: sp.left + dx, width: cs.width - dx };
-		},
-		n: function(event, dx, dy) {
-			var 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
-		};
-	}
-
-});
-
-/*
+(function ($, undefined) {
+
+  function num(v) {
+    return parseInt(v, 10) || 0;
+  }
+
+  function isNumber(value) {
+    return !isNaN(parseInt(value, 10));
+  }
+
+  $.widget("ui.resizable", $.ui.mouse, {
+    version: "1.10.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,
+      // See #7960
+      zIndex: 90,
+
+      // callbacks
+      resize: null,
+      start: null,
+      stop: null
+    },
+    _create: function () {
+
+      var n, i, handle, axis, hname,
+          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(
+            "ui-resizable", this.element.data("ui-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";
+        }
+
+        n = this.handles.split(",");
+        this.handles = {};
+
+        for (i = 0; i < n.length; i++) {
+
+          handle = $.trim(n[i]);
+          hname = "ui-resizable-" + handle;
+          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) {
+
+        var i, axis, padPos, padWrapper;
+
+        target = target || this.element;
+
+        for (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)) {
+
+            axis = $(this.handles[i], this.element);
+
+            //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...
+            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) {
+            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 wrapper,
+          _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);
+        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 i, handle,
+          capture = false;
+
+      for (i in this.handles) {
+        handle = $(this.handles[i])[0];
+        if (handle === event.target || $.contains(handle, event.target)) {
+          capture = true;
+        }
+      }
+
+      return !this.options.disabled && capture;
+    },
+
+    _mouseStart: function (event) {
+
+      var curleft, curtop, cursor,
+          o = this.options,
+          iniPos = this.element.position(),
+          el = this.element;
+
+      this.resizing = true;
+
+      // bugfix for http://dev.jquery.com/ticket/1749
+      if ((/absolute/).test(el.css("position"))) {
+        el.css(
+            {position: "absolute", top: el.css("top"), left: el.css("left")});
+      } else if (el.is(".ui-draggable")) {
+        el.css({position: "absolute", top: iniPos.top, left: iniPos.left});
+      }
+
+      this._renderProxy();
+
+      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);
+
+      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 data,
+          el = this.helper, props = {},
+          smp = this.originalMousePosition,
+          a = this.axis,
+          prevTop = this.position.top,
+          prevLeft = this.position.left,
+          prevWidth = this.size.width,
+          prevHeight = this.size.height,
+          dx = (event.pageX - smp.left) || 0,
+          dy = (event.pageY - smp.top) || 0,
+          trigger = this._change[a];
+
+      if (!trigger) {
+        return false;
+      }
+
+      // Calculate the attrs that will be change
+      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);
+
+      this._updateCache(data);
+
+      // plugins callbacks need to be called first
+      this._propagate("resize", event);
+
+      if (this.position.top !== prevTop) {
+        props.top = this.position.top + "px";
+      }
+      if (this.position.left !== prevLeft) {
+        props.left = this.position.left + "px";
+      }
+      if (this.size.width !== prevWidth) {
+        props.width = this.size.width + "px";
+      }
+      if (this.size.height !== prevHeight) {
+        props.height = this.size.height + "px";
+      }
+      el.css(props);
+
+      if (!this._helper && this._proportionallyResizeElements.length) {
+        this._proportionallyResize();
+      }
+
+      // Call the user callback if the element was resized
+      if (!$.isEmptyObject(props)) {
+        this._trigger("resize", event, this.ui());
+      }
+
+      return false;
+    },
+
+    _mouseStop: function (event) {
+
+      this.resizing = false;
+      var pr, ista, soffseth, soffsetw, s, left, top,
+          o = this.options, that = this;
+
+      if (this._helper) {
+
+        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;
+
+        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 pMinWidth, pMaxWidth, pMinHeight, pMaxHeight, b,
+          o = this.options;
+
+      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) {
+      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) {
+
+      var 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) {
+
+      var o = this._vBoundaries,
+          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),
+          dw = this.originalPosition.left + this.originalSize.width,
+          dh = this.position.top + this.size.height,
+          cw = /sw|nw|w/.test(a), ch = /nw|ne|n/.test(a);
+      if (isminw) {
+        data.width = o.minWidth;
+      }
+      if (isminh) {
+        data.height = o.minHeight;
+      }
+      if (ismaxw) {
+        data.width = o.maxWidth;
+      }
+      if (ismaxh) {
+        data.height = o.maxHeight;
+      }
+
+      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
+      if (!data.width && !data.height && !data.left && data.top) {
+        data.top = null;
+      } else if (!data.width && !data.height && !data.top && data.left) {
+        data.left = null;
+      }
+
+      return data;
+    },
+
+    _proportionallyResize: function () {
+
+      if (!this._proportionallyResizeElements.length) {
+        return;
+      }
+
+      var i, j, borders, paddings, prel,
+          element = this.helper || this.element;
+
+      for (i = 0; i < this._proportionallyResizeElements.length; i++) {
+
+        prel = this._proportionallyResizeElements[i];
+
+        if (!this.borderDif) {
+          this.borderDif = [];
+          borders = [prel.css("borderTopWidth"), prel.css("borderRightWidth"),
+            prel.css("borderBottomWidth"), prel.css("borderLeftWidth")];
+          paddings = [prel.css("paddingTop"), prel.css("paddingRight"),
+            prel.css("paddingBottom"), prel.css("paddingLeft")];
+
+          for (j = 0; j < borders.length; j++) {
+            this.borderDif[j] = ( parseInt(borders[j], 10) || 0 ) + ( parseInt(
+                paddings[j], 10) || 0 );
+          }
+        }
+
+        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>");
+
+        this.helper.addClass(this._helper).css({
+          width: this.element.outerWidth() - 1,
+          height: this.element.outerHeight() - 1,
+          position: "absolute",
+          left: this.elementOffset.left + "px",
+          top: this.elementOffset.top + "px",
+          zIndex: ++o.zIndex //TODO: Don't modify option
+        });
+
+        this.helper
+        .appendTo("body")
+        .disableSelection();
+
+      } else {
+        this.helper = this.element;
+      }
+
+    },
+
+    _change: {
+      e: function (event, dx) {
+        return {width: this.originalSize.width + dx};
+      },
+      w: function (event, dx) {
+        var cs = this.originalSize, sp = this.originalPosition;
+        return {left: sp.left + dx, width: cs.width - dx};
+      },
+      n: function (event, dx, dy) {
+        var 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", "animate", {
-
-	stop: function( event ) {
-		var that = $(this).data("ui-resizable"),
-			o = that.options,
-			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,
-			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() {
-		var element, p, co, ch, cw, width, height,
-			that = $(this).data("ui-resizable"),
-			o = that.options,
-			el = that.element,
-			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 {
-			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]) };
-
-			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 ) {
-		var woset, hoset, isParent, isOffsetRelative,
-			that = $(this).data("ui-resizable"),
-			o = that.options,
-			co = that.containerOffset, 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;
-
-		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 );
-
-		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(){
-		var that = $(this).data("ui-resizable"),
-			o = that.options,
-			co = that.containerOffset,
-			cop = that.containerPosition,
-			ce = that.containerElement,
-			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", "alsoResize", {
-
-	start: function () {
-		var that = $(this).data("ui-resizable"),
-			o = that.options,
-			_store = function (exp) {
-				$(exp).each(function() {
-					var el = $(this);
-					el.data("ui-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("ui-resizable"),
-			o = that.options,
-			os = that.originalSize,
-			op = that.originalPosition,
-			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("ui-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 () {
-		$(this).removeData("resizable-alsoresize");
-	}
-});
-
-$.ui.plugin.add("resizable", "ghost", {
-
-	start: function() {
-
-		var that = $(this).data("ui-resizable"), o = that.options, cs = that.size;
-
-		that.ghost = that.originalElement.clone();
-		that.ghost
-			.css({ opacity: 0.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(){
-		var that = $(this).data("ui-resizable");
-		if (that.ghost) {
-			that.ghost.css({ position: "relative", height: that.size.height, width: that.size.width });
-		}
-	},
-
-	stop: function() {
-		var that = $(this).data("ui-resizable");
-		if (that.ghost && that.helper) {
-			that.helper.get(0).removeChild(that.ghost.get(0));
-		}
-	}
-
-});
-
-$.ui.plugin.add("resizable", "grid", {
-
-	resize: function() {
-		var that = $(this).data("ui-resizable"),
-			o = that.options,
-			cs = that.size,
-			os = that.originalSize,
-			op = that.originalPosition,
-			a = that.axis,
-			grid = typeof o.grid === "number" ? [o.grid, o.grid] : o.grid,
-			gridX = (grid[0]||1),
-			gridY = (grid[1]||1),
-			ox = Math.round((cs.width - os.width) / gridX) * gridX,
-			oy = Math.round((cs.height - os.height) / gridY) * gridY,
-			newWidth = os.width + ox,
-			newHeight = os.height + oy,
-			isMaxWidth = o.maxWidth && (o.maxWidth < newWidth),
-			isMaxHeight = o.maxHeight && (o.maxHeight < newHeight),
-			isMinWidth = o.minWidth && (o.minWidth > newWidth),
-			isMinHeight = o.minHeight && (o.minHeight > newHeight);
-
-		o.grid = grid;
-
-		if (isMinWidth) {
-			newWidth = newWidth + gridX;
-		}
-		if (isMinHeight) {
-			newHeight = newHeight + gridY;
-		}
-		if (isMaxWidth) {
-			newWidth = newWidth - gridX;
-		}
-		if (isMaxHeight) {
-			newHeight = newHeight - gridY;
-		}
-
-		if (/^(se|s|e)$/.test(a)) {
-			that.size.width = newWidth;
-			that.size.height = newHeight;
-		} else if (/^(ne)$/.test(a)) {
-			that.size.width = newWidth;
-			that.size.height = newHeight;
-			that.position.top = op.top - oy;
-		} else if (/^(sw)$/.test(a)) {
-			that.size.width = newWidth;
-			that.size.height = newHeight;
-			that.position.left = op.left - ox;
-		} else {
-			that.size.width = newWidth;
-			that.size.height = newHeight;
-			that.position.top = op.top - oy;
-			that.position.left = op.left - ox;
-		}
-	}
-
-});
+  $.ui.plugin.add("resizable", "animate", {
+
+    stop: function (event) {
+      var that = $(this).data("ui-resizable"),
+          o = that.options,
+          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,
+          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 () {
+      var element, p, co, ch, cw, width, height,
+          that = $(this).data("ui-resizable"),
+          o = that.options,
+          el = that.element,
+          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 {
+        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])
+        };
+
+        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) {
+      var woset, hoset, isParent, isOffsetRelative,
+          that = $(this).data("ui-resizable"),
+          o = that.options,
+          co = that.containerOffset, 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;
+
+      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);
+
+      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 () {
+      var that = $(this).data("ui-resizable"),
+          o = that.options,
+          co = that.containerOffset,
+          cop = that.containerPosition,
+          ce = that.containerElement,
+          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", "alsoResize", {
+
+    start: function () {
+      var that = $(this).data("ui-resizable"),
+          o = that.options,
+          _store = function (exp) {
+            $(exp).each(function () {
+              var el = $(this);
+              el.data("ui-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("ui-resizable"),
+          o = that.options,
+          os = that.originalSize,
+          op = that.originalPosition,
+          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("ui-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 () {
+      $(this).removeData("resizable-alsoresize");
+    }
+  });
+
+  $.ui.plugin.add("resizable", "ghost", {
+
+    start: function () {
+
+      var that = $(this).data("ui-resizable"), o = that.options, cs = that.size;
+
+      that.ghost = that.originalElement.clone();
+      that.ghost
+      .css({
+        opacity: 0.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 () {
+      var that = $(this).data("ui-resizable");
+      if (that.ghost) {
+        that.ghost.css({
+          position: "relative",
+          height: that.size.height,
+          width: that.size.width
+        });
+      }
+    },
+
+    stop: function () {
+      var that = $(this).data("ui-resizable");
+      if (that.ghost && that.helper) {
+        that.helper.get(0).removeChild(that.ghost.get(0));
+      }
+    }
+
+  });
+
+  $.ui.plugin.add("resizable", "grid", {
+
+    resize: function () {
+      var that = $(this).data("ui-resizable"),
+          o = that.options,
+          cs = that.size,
+          os = that.originalSize,
+          op = that.originalPosition,
+          a = that.axis,
+          grid = typeof o.grid === "number" ? [o.grid, o.grid] : o.grid,
+          gridX = (grid[0] || 1),
+          gridY = (grid[1] || 1),
+          ox = Math.round((cs.width - os.width) / gridX) * gridX,
+          oy = Math.round((cs.height - os.height) / gridY) * gridY,
+          newWidth = os.width + ox,
+          newHeight = os.height + oy,
+          isMaxWidth = o.maxWidth && (o.maxWidth < newWidth),
+          isMaxHeight = o.maxHeight && (o.maxHeight < newHeight),
+          isMinWidth = o.minWidth && (o.minWidth > newWidth),
+          isMinHeight = o.minHeight && (o.minHeight > newHeight);
+
+      o.grid = grid;
+
+      if (isMinWidth) {
+        newWidth = newWidth + gridX;
+      }
+      if (isMinHeight) {
+        newHeight = newHeight + gridY;
+      }
+      if (isMaxWidth) {
+        newWidth = newWidth - gridX;
+      }
+      if (isMaxHeight) {
+        newHeight = newHeight - gridY;
+      }
+
+      if (/^(se|s|e)$/.test(a)) {
+        that.size.width = newWidth;
+        that.size.height = newHeight;
+      } else if (/^(ne)$/.test(a)) {
+        that.size.width = newWidth;
+        that.size.height = newHeight;
+        that.position.top = op.top - oy;
+      } else if (/^(sw)$/.test(a)) {
+        that.size.width = newWidth;
+        that.size.height = newHeight;
+        that.position.left = op.left - ox;
+      } else {
+        that.size.width = newWidth;
+        that.size.height = newHeight;
+        that.position.top = op.top - oy;
+        that.position.left = op.left - ox;
+      }
+    }
+
+  });
 
 })(jQuery);
-(function( $, undefined ) {
-
-$.widget("ui.selectable", $.ui.mouse, {
-	version: "1.10.1",
-	options: {
-		appendTo: "body",
-		autoRefresh: true,
-		distance: 0,
-		filter: "*",
-		tolerance: "touch",
-
-		// callbacks
-		selected: null,
-		selecting: null,
-		start: null,
-		stop: null,
-		unselected: null,
-		unselecting: null
-	},
-	_create: function() {
-		var selectees,
-			that = this;
-
-		this.element.addClass("ui-selectable");
-
-		this.dragged = false;
-
-		// cache selectee children based on filter
-		this.refresh = function() {
-			selectees = $(that.options.filter, that.element[0]);
-			selectees.addClass("ui-selectee");
-			selectees.each(function() {
-				var $this = $(this),
-					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,
-			options = this.options;
-
-		this.opos = [event.pageX, event.pageY];
-
-		if (this.options.disabled) {
-			return;
-		}
-
-		this.selectees = $(options.filter, this.element[0]);
-
-		this._trigger("start", event);
-
-		$(options.appendTo).append(this.helper);
-		// position helper (lasso)
-		this.helper.css({
-			"left": event.pageX,
-			"top": event.pageY,
-			"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().addBack().each(function() {
-			var doSelect,
-				selectee = $.data(this, "selectable-item");
-			if (selectee) {
-				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) {
-
-		this.dragged = true;
-
-		if (this.options.disabled) {
-			return;
-		}
-
-		var tmp,
-			that = this,
-			options = this.options,
-			x1 = this.opos[0],
-			y1 = this.opos[1],
-			x2 = event.pageX,
-			y2 = event.pageY;
-
-		if (x1 > x2) { tmp = x2; x2 = x1; x1 = tmp; }
-		if (y1 > y2) { 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"),
-				hit = false;
-
-			//prevent helper from being selected if appendTo: selectable
-			if (!selectee || selectee.element === that.element[0]) {
-				return;
-			}
-
-			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;
-
-		$(".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;
-	}
-
-});
+(function ($, undefined) {
+
+  $.widget("ui.selectable", $.ui.mouse, {
+    version: "1.10.1",
+    options: {
+      appendTo: "body",
+      autoRefresh: true,
+      distance: 0,
+      filter: "*",
+      tolerance: "touch",
+
+      // callbacks
+      selected: null,
+      selecting: null,
+      start: null,
+      stop: null,
+      unselected: null,
+      unselecting: null
+    },
+    _create: function () {
+      var selectees,
+          that = this;
+
+      this.element.addClass("ui-selectable");
+
+      this.dragged = false;
+
+      // cache selectee children based on filter
+      this.refresh = function () {
+        selectees = $(that.options.filter, that.element[0]);
+        selectees.addClass("ui-selectee");
+        selectees.each(function () {
+          var $this = $(this),
+              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,
+          options = this.options;
+
+      this.opos = [event.pageX, event.pageY];
+
+      if (this.options.disabled) {
+        return;
+      }
+
+      this.selectees = $(options.filter, this.element[0]);
+
+      this._trigger("start", event);
+
+      $(options.appendTo).append(this.helper);
+      // position helper (lasso)
+      this.helper.css({
+        "left": event.pageX,
+        "top": event.pageY,
+        "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().addBack().each(function () {
+        var doSelect,
+            selectee = $.data(this, "selectable-item");
+        if (selectee) {
+          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) {
+
+      this.dragged = true;
+
+      if (this.options.disabled) {
+        return;
+      }
+
+      var tmp,
+          that = this,
+          options = this.options,
+          x1 = this.opos[0],
+          y1 = this.opos[1],
+          x2 = event.pageX,
+          y2 = event.pageY;
+
+      if (x1 > x2) {
+        tmp = x2;
+        x2 = x1;
+        x1 = tmp;
+      }
+      if (y1 > y2) {
+        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"),
+            hit = false;
+
+        //prevent helper from being selected if appendTo: selectable
+        if (!selectee || selectee.element === that.element[0]) {
+          return;
+        }
+
+        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;
+
+      $(".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 ) {
-
-/*jshint loopfunc: true */
-
-function isOverAxis( x, reference, size ) {
-	return ( x > reference ) && ( x < ( reference + size ) );
-}
-
-$.widget("ui.sortable", $.ui.mouse, {
-	version: "1.10.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,
-
-		// callbacks
-		activate: null,
-		beforeStop: null,
-		change: null,
-		deactivate: null,
-		out: null,
-		over: null,
-		receive: null,
-		remove: null,
-		sort: null,
-		start: null,
-		stop: null,
-		update: null
-	},
-	_create: function() {
-
-		var 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 currentItem = null,
-			validHandle = false,
-			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
-		$(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) {
-			$(this.options.handle, currentItem).find("*").addBack().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 i,
-			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();
-
-		/*
+(function ($, undefined) {
+
+  /*jshint loopfunc: true */
+
+  function isOverAxis(x, reference, size) {
+    return ( x > reference ) && ( x < ( reference + size ) );
+  }
+
+  $.widget("ui.sortable", $.ui.mouse, {
+    version: "1.10.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,
+
+      // callbacks
+      activate: null,
+      beforeStop: null,
+      change: null,
+      deactivate: null,
+      out: null,
+      over: null,
+      receive: null,
+      remove: null,
+      sort: null,
+      start: null,
+      stop: null,
+      update: null
+    },
+    _create: function () {
+
+      var 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 currentItem = null,
+          validHandle = false,
+          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
+      $(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) {
+        $(this.options.handle, currentItem).find("*").addBack().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 i,
+          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 ( 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) {
-		var i, item, itemElement, intersection,
-			o = this.options,
-			scrolled = false;
-
-		//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) {
-			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 (i = this.items.length - 1; i >= 0; i--) {
-
-			//Cache variables and intersection, continue if no intersection
-			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;
-			}
-
-			// cannot intersect with itself
-			// no useless actions that have been done before
-			// no action if the item moved is the parent of the item checked
-			if (itemElement !== this.currentItem[0] &&
-				this.placeholder[intersection === 1 ? "next" : "prev"]()[0] !== itemElement &&
-				!$.contains(this.placeholder[0], itemElement) &&
-				(this.options.type === "semi-dynamic" ? !$.contains(this.element[0], itemElement) : true)
-			) {
-
-				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,
-				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),
-			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),
-			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,
-			l = item.left,
-			r = l + item.width,
-			t = item.top,
-			b = t + item.height,
-			dyClick = this.offset.click.top,
-			dxClick = this.offset.click.left,
-			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") || isOverAxis(this.positionAbs.top + this.offset.click.top, item.top, item.height),
-			isOverElementWidth = (this.options.axis === "y") || 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 = isOverAxis(this.positionAbs.top + this.offset.click.top, item.top + (item.height/2), item.height),
-			isOverRightHalf = 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 i, j, cur, inst,
-			items = [],
-			queries = [],
-			connectWith = this._connectWith();
-
-		if(connectWith && connected) {
-			for (i = connectWith.length - 1; i >= 0; i--){
-				cur = $(connectWith[i]);
-				for ( j = cur.length - 1; j >= 0; j--){
-					inst = $.data(cur[j], this.widgetFullName);
-					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 (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 i, j, cur, inst, targetData, _queries, item, queriesLength,
-			items = this.items,
-			queries = [[$.isFunction(this.options.items) ? this.options.items.call(this.element[0], event, { item: this.currentItem }) : $(this.options.items, this.element), this]],
-			connectWith = this._connectWith();
-
-		if(connectWith && this.ready) { //Shouldn't be run the first time through due to massive slow-down
-			for (i = connectWith.length - 1; i >= 0; i--){
-				cur = $(connectWith[i]);
-				for (j = cur.length - 1; j >= 0; j--){
-					inst = $.data(cur[j], this.widgetFullName);
-					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 (i = queries.length - 1; i >= 0; i--) {
-			targetData = queries[i][1];
-			_queries = queries[i][0];
-
-			for (j=0, queriesLength = _queries.length; j < queriesLength; j++) {
-				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();
-		}
-
-		var i, item, t, p;
-
-		for (i = this.items.length - 1; i >= 0; i--){
-			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;
-			}
-
-			t = this.options.toleranceElement ? $(this.options.toleranceElement, item.item) : item.item;
-
-			if (!fast) {
-				item.width = t.outerWidth();
-				item.height = t.outerHeight();
-			}
-
-			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 (i = this.containers.length - 1; i >= 0; i--){
-				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 className,
-			o = that.options;
-
-		if(!o.placeholder || o.placeholder.constructor === String) {
-			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) {
-		var i, j, dist, itemWithLeastDistance, posProperty, sizeProperty, base, cur, nearBottom,
-			innermostContainer = null,
-			innermostIndex = null;
-
-		// get innermost container that intersects with item
-		for (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
-			dist = 10000;
-			itemWithLeastDistance = null;
-			posProperty = this.containers[innermostIndex].floating ? "left" : "top";
-			sizeProperty = this.containers[innermostIndex].floating ? "width" : "height";
-			base = this.positionAbs[posProperty] + this.offset.click[posProperty];
-			for (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;
-				}
-				cur = this.items[j].item.offset()[posProperty];
-				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";
-				}
-			}
-
-			//Check if dropOnEmpty is enabled
-			if(!itemWithLeastDistance && !this.options.dropOnEmpty) {
-				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,
-			helper = $.isFunction(o.helper) ? $(o.helper.apply(this.element[0], [event, this.currentItem])) : (o.helper === "clone" ? this.currentItem.clone() : this.currentItem);
-
-		//Add the helper to the DOM if that didn't happen already
-		if(!helper.parents("body").length) {
-			$(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();
-		}
-
-		// This needs to be actually done for all browsers, since pageX/pageY includes this information
-		// with an ugly IE fix
-		if( this.offsetParent[0] === document.body || (this.offsetParent[0].tagName && this.offsetParent[0].tagName.toLowerCase() === "html" && $.ui.ie)) {
-			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 ce, co, over,
-			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)) {
-			ce = $(o.containment)[0];
-			co = $(o.containment).offset();
-			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,
-			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 top, left,
-			o = this.options,
-			pageX = event.pageX,
-			pageY = event.pageY,
-			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();
-		}
-
-		/*
+      //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 (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) {
+      var i, item, itemElement, intersection,
+          o = this.options,
+          scrolled = false;
+
+      //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) {
+        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 (i = this.items.length - 1; i >= 0; i--) {
+
+        //Cache variables and intersection, continue if no intersection
+        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;
+        }
+
+        // cannot intersect with itself
+        // no useless actions that have been done before
+        // no action if the item moved is the parent of the item checked
+        if (itemElement !== this.currentItem[0] &&
+            this.placeholder[intersection === 1 ? "next" : "prev"]()[0]
+            !== itemElement &&
+            !$.contains(this.placeholder[0], itemElement) &&
+            (this.options.type === "semi-dynamic" ? !$.contains(this.element[0],
+                itemElement) : true)
+        ) {
+
+          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,
+            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),
+          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),
+          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,
+          l = item.left,
+          r = l + item.width,
+          t = item.top,
+          b = t + item.height,
+          dyClick = this.offset.click.top,
+          dxClick = this.offset.click.left,
+          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")
+          || isOverAxis(this.positionAbs.top + this.offset.click.top, item.top,
+              item.height),
+          isOverElementWidth = (this.options.axis === "y")
+              || 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 = isOverAxis(this.positionAbs.top
+          + this.offset.click.top, item.top + (item.height / 2), item.height),
+          isOverRightHalf = 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 i, j, cur, inst,
+          items = [],
+          queries = [],
+          connectWith = this._connectWith();
+
+      if (connectWith && connected) {
+        for (i = connectWith.length - 1; i >= 0; i--) {
+          cur = $(connectWith[i]);
+          for (j = cur.length - 1; j >= 0; j--) {
+            inst = $.data(cur[j], this.widgetFullName);
+            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 (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 i, j, cur, inst, targetData, _queries, item, queriesLength,
+          items = this.items,
+          queries = [[$.isFunction(this.options.items)
+              ? this.options.items.call(this.element[0], event,
+                  {item: this.currentItem}) : $(this.options.items,
+                  this.element), this]],
+          connectWith = this._connectWith();
+
+      if (connectWith && this.ready) { //Shouldn't be run the first time through due to massive slow-down
+        for (i = connectWith.length - 1; i >= 0; i--) {
+          cur = $(connectWith[i]);
+          for (j = cur.length - 1; j >= 0; j--) {
+            inst = $.data(cur[j], this.widgetFullName);
+            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 (i = queries.length - 1; i >= 0; i--) {
+        targetData = queries[i][1];
+        _queries = queries[i][0];
+
+        for (j = 0, queriesLength = _queries.length; j < queriesLength; j++) {
+          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();
+      }
+
+      var i, item, t, p;
+
+      for (i = this.items.length - 1; i >= 0; i--) {
+        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;
+        }
+
+        t = this.options.toleranceElement ? $(this.options.toleranceElement,
+            item.item) : item.item;
+
+        if (!fast) {
+          item.width = t.outerWidth();
+          item.height = t.outerHeight();
+        }
+
+        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 (i = this.containers.length - 1; i >= 0; i--) {
+          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 className,
+          o = that.options;
+
+      if (!o.placeholder || o.placeholder.constructor === String) {
+        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) {
+      var i, j, dist, itemWithLeastDistance, posProperty, sizeProperty, base,
+          cur, nearBottom,
+          innermostContainer = null,
+          innermostIndex = null;
+
+      // get innermost container that intersects with item
+      for (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
+        dist = 10000;
+        itemWithLeastDistance = null;
+        posProperty = this.containers[innermostIndex].floating ? "left" : "top";
+        sizeProperty = this.containers[innermostIndex].floating ? "width"
+            : "height";
+        base = this.positionAbs[posProperty] + this.offset.click[posProperty];
+        for (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;
+          }
+          cur = this.items[j].item.offset()[posProperty];
+          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";
+          }
+        }
+
+        //Check if dropOnEmpty is enabled
+        if (!itemWithLeastDistance && !this.options.dropOnEmpty) {
+          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,
+          helper = $.isFunction(o.helper) ? $(
+              o.helper.apply(this.element[0], [event, this.currentItem]))
+              : (o.helper === "clone" ? this.currentItem.clone()
+                  : this.currentItem);
+
+      //Add the helper to the DOM if that didn't happen already
+      if (!helper.parents("body").length) {
+        $(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();
+      }
+
+      // This needs to be actually done for all browsers, since pageX/pageY includes this information
+      // with an ugly IE fix
+      if (this.offsetParent[0] === document.body
+          || (this.offsetParent[0].tagName
+              && this.offsetParent[0].tagName.toLowerCase() === "html"
+              && $.ui.ie)) {
+        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 ce, co, over,
+          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)) {
+        ce = $(o.containment)[0];
+        co = $(o.containment).offset();
+        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,
+          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 top, left,
+          o = this.options,
+          pageX = event.pageX,
+          pageY = event.pageY,
+          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();
+      }
+
+      /*
 		 * - 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) {
-				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;
-
-				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 i,
-			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(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 (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);
-		}
-		if(this._storedOpacity) {
-			this.helper.css("opacity", this._storedOpacity);
-		}
-		if(this._storedZIndex) {
-			this.helper.css("zIndex", this._storedZIndex === "auto" ? "" : this._storedZIndex);
-		}
-
-		this.dragging = false;
-		if(this.cancelHelperRemoval) {
-			if(!noPropagation) {
-				this._trigger("beforeStop", event, this._uiHash());
-				for (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 (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
-		};
-	}
-
-});
+      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) {
+          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;
+
+          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 i,
+          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 (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 (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);
+      }
+      if (this._storedOpacity) {
+        this.helper.css("opacity", this._storedOpacity);
+      }
+      if (this._storedZIndex) {
+        this.helper.css("zIndex",
+            this._storedZIndex === "auto" ? "" : this._storedZIndex);
+      }
+
+      this.dragging = false;
+      if (this.cancelHelperRemoval) {
+        if (!noPropagation) {
+          this._trigger("beforeStop", event, this._uiHash());
+          for (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 (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.10.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 options = this.options;
-		this.prevShow = this.prevHide = $();
-		this.element.addClass( "ui-accordion ui-widget ui-helper-reset" )
-			// ARIA
-			.attr( "role", "tablist" );
-
-		// don't allow collapsible: false and active: false / null
-		if ( !options.collapsible && (options.active === false || options.active == null) ) {
-			options.active = 0;
-		}
-
-		this._processPanels();
-		// handle negative values
-		if ( options.active < 0 ) {
-			options.active += this.headers.length;
-		}
-		this._refresh();
-	},
-
-	_getCreateEventData: function() {
-		return {
-			header: this.active,
-			panel: !this.active.length ? $() : this.active.next(),
-			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 ) {
-		/*jshint maxcomplexity:15*/
-		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 options = this.options;
-		this._processPanels();
-
-		// was collapsed or no panel
-		if ( ( options.active === false && options.collapsible === true ) || !this.headers.length ) {
-			options.active = false;
-			this.active = $();
-		// active false only when collapsible is true
-		} if ( options.active === false ) {
-			this._activate( 0 );
-		// was active, but active panel is gone
-		} else if ( this.active.length && !$.contains( this.element[ 0 ], this.active[ 0 ] ) ) {
-			// all remaining panel are disabled
-			if ( this.headers.length === this.headers.find(".ui-state-disabled").length ) {
-				options.active = false;
-				this.active = $();
-			// activate previous panel
-			} else {
-				this._activate( Math.max( 0, options.active - 1 ) );
-			}
-		// was active, active panel still exists
-		} else {
-			// make sure active index is correct
-			options.active = this.headers.index( this.active );
-		}
-
-		this._destroyIcons();
-
-		this._refresh();
-	},
-
-	_processPanels: function() {
-		this.headers = this.element.find( this.options.header )
-			.addClass( "ui-accordion-header ui-helper-reset ui-state-default ui-corner-all" );
-
-		this.headers.next()
-			.addClass( "ui-accordion-content ui-helper-reset ui-widget-content ui-corner-bottom" )
-			.filter(":not(.ui-accordion-content-active)")
-			.hide();
-	},
-
-	_refresh: function() {
-		var maxHeight,
-			options = this.options,
-			heightStyle = options.heightStyle,
-			parent = this.element.parent(),
-			accordionId = this.accordionId = "ui-accordion-" +
-				(this.element.attr( "id" ) || ++uid);
-
-		this.active = this._findActive( options.active )
-			.addClass( "ui-accordion-header-active ui-state-active ui-corner-top" )
-			.removeClass( "ui-corner-all" );
-		this.active.next()
-			.addClass( "ui-accordion-content-active" )
-			.show();
-
-		this.headers
-			.attr( "role", "tab" )
-			.each(function( 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._createIcons();
-
-		this._setupEvents( options.event );
-
-		if ( heightStyle === "fill" ) {
-			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 );
-			});
-
-			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 ).css( "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 = {
-			keydown: "_keydown"
-		};
-		if ( event ) {
-			$.each( event.split(" "), function( index, eventName ) {
-				events[ eventName ] = "_eventHandler";
-			});
-		}
-
-		this._off( this.headers.add( this.headers.next() ) );
-		this._on( this.headers, events );
-		this._on( this.headers.next(), { keydown: "_panelKeyDown" });
-		this._hoverable( this.headers );
-		this._focusable( this.headers );
-	},
-
-	_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 );
-	}
-});
-
-})( jQuery );
-(function( $, undefined ) {
+(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.10.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 options = this.options;
+      this.prevShow = this.prevHide = $();
+      this.element.addClass("ui-accordion ui-widget ui-helper-reset")
+      // ARIA
+      .attr("role", "tablist");
+
+      // don't allow collapsible: false and active: false / null
+      if (!options.collapsible && (options.active === false || options.active
+              == null)) {
+        options.active = 0;
+      }
+
+      this._processPanels();
+      // handle negative values
+      if (options.active < 0) {
+        options.active += this.headers.length;
+      }
+      this._refresh();
+    },
+
+    _getCreateEventData: function () {
+      return {
+        header: this.active,
+        panel: !this.active.length ? $() : this.active.next(),
+        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) {
+      /*jshint maxcomplexity:15*/
+      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 options = this.options;
+      this._processPanels();
+
+      // was collapsed or no panel
+      if (( options.active === false && options.collapsible === true )
+          || !this.headers.length) {
+        options.active = false;
+        this.active = $();
+        // active false only when collapsible is true
+      }
+      if (options.active === false) {
+        this._activate(0);
+        // was active, but active panel is gone
+      } else if (this.active.length && !$.contains(this.element[0],
+              this.active[0])) {
+        // all remaining panel are disabled
+        if (this.headers.length === this.headers.find(
+                ".ui-state-disabled").length) {
+          options.active = false;
+          this.active = $();
+          // activate previous panel
+        } else {
+          this._activate(Math.max(0, options.active - 1));
+        }
+        // was active, active panel still exists
+      } else {
+        // make sure active index is correct
+        options.active = this.headers.index(this.active);
+      }
+
+      this._destroyIcons();
+
+      this._refresh();
+    },
+
+    _processPanels: function () {
+      this.headers = this.element.find(this.options.header)
+      .addClass(
+          "ui-accordion-header ui-helper-reset ui-state-default ui-corner-all");
+
+      this.headers.next()
+      .addClass(
+          "ui-accordion-content ui-helper-reset ui-widget-content ui-corner-bottom")
+      .filter(":not(.ui-accordion-content-active)")
+      .hide();
+    },
+
+    _refresh: function () {
+      var maxHeight,
+          options = this.options,
+          heightStyle = options.heightStyle,
+          parent = this.element.parent(),
+          accordionId = this.accordionId = "ui-accordion-" +
+              (this.element.attr("id") || ++uid);
+
+      this.active = this._findActive(options.active)
+      .addClass("ui-accordion-header-active ui-state-active ui-corner-top")
+      .removeClass("ui-corner-all");
+      this.active.next()
+      .addClass("ui-accordion-content-active")
+      .show();
+
+      this.headers
+      .attr("role", "tab")
+      .each(function (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._createIcons();
+
+      this._setupEvents(options.event);
+
+      if (heightStyle === "fill") {
+        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);
+        });
+
+        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).css("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 = {
+        keydown: "_keydown"
+      };
+      if (event) {
+        $.each(event.split(" "), function (index, eventName) {
+          events[eventName] = "_eventHandler";
+        });
+      }
+
+      this._off(this.headers.add(this.headers.next()));
+      this._on(this.headers, events);
+      this._on(this.headers.next(), {keydown: "_panelKeyDown"});
+      this._hoverable(this.headers);
+      this._focusable(this.headers);
+    },
+
+    _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);
+    }
+  });
 
-// used to prevent race conditions with remote data sources
-var requestIndex = 0;
-
-$.widget( "ui.autocomplete", {
-	version: "1.10.1",
-	defaultElement: "<input>",
-	options: {
-		appendTo: null,
-		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,
-			nodeName = this.element[0].nodeName.toLowerCase(),
-			isTextarea = nodeName === "textarea",
-			isInput = nodeName === "input";
-
-		this.isMultiLine =
-			// Textareas are always multi-line
-			isTextarea ? true :
-			// Inputs are always single-line, even if inside a contentEditable element
-			// IE also treats inputs as contentEditable
-			isInput ? false :
-			// All other element types are determined by whether or not they're contentEditable
-			this.element.prop( "isContentEditable" );
-
-		this.valueMethod = this.element[ isTextarea || isInput ? "val" : "text" ];
-		this.isNewMenu = true;
-
-		this.element
-			.addClass( "ui-autocomplete-input" )
-			.attr( "autocomplete", "off" );
-
-		this._on( this.element, {
-			keydown: function( event ) {
-				/*jshint maxcomplexity:15*/
-				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 ui-front" )
-			.appendTo( this._appendTo() )
-			.menu({
-				// custom key handling for now
-				input: $(),
-				// disable ARIA support, the live region takes care of that
-				role: null
-			})
-			.hide()
-			.data( "ui-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;
-					}
-				}
-
-				var item = ui.item.data( "ui-autocomplete-item" );
-				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 ) {
-				var item = ui.item.data( "ui-autocomplete-item" ),
-					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 );
-
-		// 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._appendTo() );
-		}
-		if ( key === "disabled" && value && this.xhr ) {
-			this.xhr.abort();
-		}
-	},
-
-	_appendTo: function() {
-		var element = this.options.appendTo;
-
-		if ( element ) {
-			element = element.jquery || element.nodeType ?
-				$( element ) :
-				this.document.find( element ).eq( 0 );
-		}
-
-		if ( !element ) {
-			element = this.element.closest( ".ui-front" );
-		}
-
-		if ( !element.length ) {
-			element = this.document[0].body;
-		}
-
-		return element;
-	},
-
-	_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();
-		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 );
-		});
-	}
-});
+})(jQuery);
+(function ($, undefined) {
 
+// used to prevent race conditions with remote data sources
+  var requestIndex = 0;
+
+  $.widget("ui.autocomplete", {
+    version: "1.10.1",
+    defaultElement: "<input>",
+    options: {
+      appendTo: null,
+      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,
+          nodeName = this.element[0].nodeName.toLowerCase(),
+          isTextarea = nodeName === "textarea",
+          isInput = nodeName === "input";
+
+      this.isMultiLine =
+          // Textareas are always multi-line
+          isTextarea ? true
+              : // Inputs are always single-line, even if inside a contentEditable element
+              // IE also treats inputs as contentEditable
+              isInput ? false
+                  : // All other element types are determined by whether or not they're contentEditable
+                  this.element.prop("isContentEditable");
+
+      this.valueMethod = this.element[isTextarea || isInput ? "val" : "text"];
+      this.isNewMenu = true;
+
+      this.element
+      .addClass("ui-autocomplete-input")
+      .attr("autocomplete", "off");
+
+      this._on(this.element, {
+        keydown: function (event) {
+          /*jshint maxcomplexity:15*/
+          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 ui-front")
+      .appendTo(this._appendTo())
+      .menu({
+        // custom key handling for now
+        input: $(),
+        // disable ARIA support, the live region takes care of that
+        role: null
+      })
+      .hide()
+      .data("ui-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;
+            }
+          }
+
+          var item = ui.item.data("ui-autocomplete-item");
+          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) {
+          var item = ui.item.data("ui-autocomplete-item"),
+              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);
+
+      // 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._appendTo());
+      }
+      if (key === "disabled" && value && this.xhr) {
+        this.xhr.abort();
+      }
+    },
+
+    _appendTo: function () {
+      var element = this.options.appendTo;
+
+      if (element) {
+        element = element.jquery || element.nodeType ? $(element)
+            : this.document.find(element).eq(0);
+      }
+
+      if (!element) {
+        element = this.element.closest(".ui-front");
+      }
+
+      if (!element.length) {
+        element = this.document[0].body;
+      }
+
+      return element;
+    },
+
+    _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();
+      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 ) {
-			name = name.replace( /'/g, "\\'" );
-			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.10.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",
-			activeClass = !toggleButton ? "ui-state-active" : "",
-			focusClass = "ui-state-focus";
-
-		if ( options.label === null ) {
-			options.label = (this.type === "input" ? this.buttonElement.val() : this.buttonElement.html());
-		}
-
-		this._hoverable( this.buttonElement );
-
-		this.buttonElement
-			.addClass( baseClasses )
-			.attr( "role", "button" )
-			.bind( "mouseenter" + this.eventNamespace, function() {
-				if ( options.disabled ) {
-					return;
-				}
-				if ( this === lastActive ) {
-					$( this ).addClass( "ui-state-active" );
-				}
-			})
-			.bind( "mouseleave" + this.eventNamespace, function() {
-				if ( options.disabled ) {
-					return;
-				}
-				$( this ).removeClass( activeClass );
-			})
-			.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;
-				}
-			});
-		} 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" );
-					}
-				})
-				// see #8559, we bind to blur here in case the button element loses
-				// focus between keydown and keyup, it would be left in an "active" state
-				.bind( "keyup" + this.eventNamespace + " blur" + 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() {
-		//See #8237 & #8828
-		var isDisabled = this.element.is( "input, button" ) ? 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.10.1",
-	options: {
-		items: "button, input[type=button], input[type=submit], input[type=reset], input[type=checkbox], input[type=radio], a, :data(ui-button)"
-	},
-
-	_create: function() {
-		this.element.addClass( "ui-buttonset" );
-	},
-
-	_init: function() {
-		this.refresh();
-	},
-
-	_setOption: function( 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.10.1" } });
-
-var PROP_NAME = "datepicker",
-	dpuuid = new Date().getTime(),
-	instActive;
-
-/* Date picker manager.
+  $.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) {
+          name = name.replace(/'/g, "\\'");
+          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.10.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",
+          activeClass = !toggleButton ? "ui-state-active" : "",
+          focusClass = "ui-state-focus";
+
+      if (options.label === null) {
+        options.label = (this.type === "input" ? this.buttonElement.val()
+            : this.buttonElement.html());
+      }
+
+      this._hoverable(this.buttonElement);
+
+      this.buttonElement
+      .addClass(baseClasses)
+      .attr("role", "button")
+      .bind("mouseenter" + this.eventNamespace, function () {
+        if (options.disabled) {
+          return;
+        }
+        if (this === lastActive) {
+          $(this).addClass("ui-state-active");
+        }
+      })
+      .bind("mouseleave" + this.eventNamespace, function () {
+        if (options.disabled) {
+          return;
+        }
+        $(this).removeClass(activeClass);
+      })
+      .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;
+          }
+        });
+      } 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");
+          }
+        })
+        // see #8559, we bind to blur here in case the button element loses
+        // focus between keydown and keyup, it would be left in an "active" state
+        .bind("keyup" + this.eventNamespace + " blur" + 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 () {
+      //See #8237 & #8828
+      var isDisabled = this.element.is("input, button") ? 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.10.1",
+    options: {
+      items: "button, input[type=button], input[type=submit], input[type=reset], input[type=checkbox], input[type=radio], a, :data(ui-button)"
+    },
+
+    _create: function () {
+      this.element.addClass("ui-buttonset");
+    },
+
+    _init: function () {
+      this.refresh();
+    },
+
+    _setOption: function (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.10.1"}});
+
+  var PROP_NAME = "datepicker",
+      dpuuid = new Date().getTime(),
+      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._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,
-
-	// 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.
+  function Datepicker() {
+    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,
+
+    // 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;
-	},
+    setDefaults: function (settings) {
+      extendRemove(this._defaults, settings || {});
+      return this;
+    },
 
-	/* Attach the date picker to a jQuery selection.
+    /* 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) {
-		var nodeName, inline, inst;
-		nodeName = target.nodeName.toLowerCase();
-		inline = (nodeName === "div" || nodeName === "span");
-		if (!target.id) {
-			this.uuid += 1;
-			target.id = "dp" + this.uuid;
-		}
-		inst = this._newInst($(target), inline);
-		inst.settings = $.extend({}, settings || {});
-		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);
-		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 showOn, buttonText, buttonImage,
-			appendText = this._get(inst, "appendText"),
-			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();
-		}
-
-		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
-			buttonText = this._get(inst, "buttonText");
-			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 findMax, max, maxI, i,
-				date = new Date(2009, 12 - 1, 20), // Ensure double digits
-				dateFormat = this._get(inst, "dateFormat");
-
-			if (dateFormat.match(/[DM]/)) {
-				findMax = function(names) {
-					max = 0;
-					maxI = 0;
-					for (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);
-		$.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.
+    _attachDatepicker: function (target, settings) {
+      var nodeName, inline, inst;
+      nodeName = target.nodeName.toLowerCase();
+      inline = (nodeName === "div" || nodeName === "span");
+      if (!target.id) {
+        this.uuid += 1;
+        target.id = "dp" + this.uuid;
+      }
+      inst = this._newInst($(target), inline);
+      inst.settings = $.extend({}, settings || {});
+      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);
+      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 showOn, buttonText, buttonImage,
+          appendText = this._get(inst, "appendText"),
+          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();
+      }
+
+      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
+        buttonText = this._get(inst, "buttonText");
+        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 findMax, max, maxI, i,
+            date = new Date(2009, 12 - 1, 20), // Ensure double digits
+            dateFormat = this._get(inst, "dateFormat");
+
+        if (dateFormat.match(/[DM]/)) {
+          findMax = function (names) {
+            max = 0;
+            maxI = 0;
+            for (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);
+      $.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
@@ -7038,163 +7511,171 @@ $.extend(Datepicker.prototype, {
 	 *					leave empty for default (screen centre)
 	 * @return the manager object
 	 */
-	_dialogDatepicker: function(input, date, onSelect, settings, pos) {
-		var id, browserWidth, browserHeight, scrollX, scrollY,
-			inst = this._dialogInst; // internal instance
-
-		if (!inst) {
-			this.uuid += 1;
-			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) {
-			browserWidth = document.documentElement.clientWidth;
-			browserHeight = document.documentElement.clientHeight;
-			scrollX = document.documentElement.scrollLeft || document.body.scrollLeft;
-			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.
+    _dialogDatepicker: function (input, date, onSelect, settings, pos) {
+      var id, browserWidth, browserHeight, scrollX, scrollY,
+          inst = this._dialogInst; // internal instance
+
+      if (!inst) {
+        this.uuid += 1;
+        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) {
+        browserWidth = document.documentElement.clientWidth;
+        browserHeight = document.documentElement.clientHeight;
+        scrollX = document.documentElement.scrollLeft
+            || document.body.scrollLeft;
+        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 nodeName,
-			$target = $(target),
-			inst = $.data(target, PROP_NAME);
-
-		if (!$target.hasClass(this.markerClassName)) {
-			return;
-		}
-
-		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.
+    _destroyDatepicker: function (target) {
+      var nodeName,
+          $target = $(target),
+          inst = $.data(target, PROP_NAME);
+
+      if (!$target.hasClass(this.markerClassName)) {
+        return;
+      }
+
+      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 nodeName, inline,
-			$target = $(target),
-			inst = $.data(target, PROP_NAME);
-
-		if (!$target.hasClass(this.markerClassName)) {
-			return;
-		}
-
-		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") {
-			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.
+    _enableDatepicker: function (target) {
+      var nodeName, inline,
+          $target = $(target),
+          inst = $.data(target, PROP_NAME);
+
+      if (!$target.hasClass(this.markerClassName)) {
+        return;
+      }
+
+      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") {
+        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 nodeName, inline,
-			$target = $(target),
-			inst = $.data(target, PROP_NAME);
-
-		if (!$target.hasClass(this.markerClassName)) {
-			return;
-		}
-
-		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") {
-			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?
+    _disableDatepicker: function (target) {
+      var nodeName, inline,
+          $target = $(target),
+          inst = $.data(target, PROP_NAME);
+
+      if (!$target.hasClass(this.markerClassName)) {
+        return;
+      }
+
+      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") {
+        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.
+    _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.
+    _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,
@@ -7203,614 +7684,663 @@ $.extend(Datepicker.prototype, {
 	 * @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 settings, date, minDate, maxDate,
-			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));
-		}
-
-		settings = name || {};
-		if (typeof name === "string") {
-			settings = {};
-			settings[name] = value;
-		}
-
-		if (inst) {
-			if (this._curInst === inst) {
-				this._hideDatepicker();
-			}
-
-			date = this._getDateDatepicker(target, true);
-			minDate = this._getMinMaxDate(inst, "min");
-			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);
-			}
-			if ( "disabled" in settings ) {
-				if ( settings.disabled ) {
-					this._disableDatepicker(target);
-				} else {
-					this._enableDatepicker(target);
-				}
-			}
-			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.
+    _optionDatepicker: function (target, name, value) {
+      var settings, date, minDate, maxDate,
+          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));
+      }
+
+      settings = name || {};
+      if (typeof name === "string") {
+        settings = {};
+        settings[name] = value;
+      }
+
+      if (inst) {
+        if (this._curInst === inst) {
+          this._hideDatepicker();
+        }
+
+        date = this._getDateDatepicker(target, true);
+        minDate = this._getMinMaxDate(inst, "min");
+        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);
+        }
+        if ("disabled" in settings) {
+          if (settings.disabled) {
+            this._disableDatepicker(target);
+          } else {
+            this._enableDatepicker(target);
+          }
+        }
+        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.
+    _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.
+    _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 onSelect, dateStr, sel,
-			inst = $.datepicker._getInst(event.target),
-			handled = true,
-			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: sel = $("td." + $.datepicker._dayOverClass + ":not(." +
-									$.datepicker._currentClass + ")", inst.dpDiv);
-						if (sel[0]) {
-							$.datepicker._selectDay(event.target, inst.selectedMonth, inst.selectedYear, sel[0]);
-						}
-
-						onSelect = $.datepicker._get(inst, "onSelect");
-						if (onSelect) {
-							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
-				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 chars, chr,
-			inst = $.datepicker._getInst(event.target);
-
-		if ($.datepicker._get(inst, "constrainInput")) {
-			chars = $.datepicker._possibleChars($.datepicker._get(inst, "dateFormat"));
-			chr = String.fromCharCode(event.charCode == null ? 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 date,
-			inst = $.datepicker._getInst(event.target);
-
-		if (inst.input.val() !== inst.lastVal) {
-			try {
-				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) {
-			}
-		}
-		return true;
-	},
-
-	/* Pop-up the date picker for a given input field.
+    _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 onSelect, dateStr, sel,
+          inst = $.datepicker._getInst(event.target),
+          handled = true,
+          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:
+            sel = $("td." + $.datepicker._dayOverClass + ":not(." +
+                $.datepicker._currentClass + ")", inst.dpDiv);
+            if (sel[0]) {
+              $.datepicker._selectDay(event.target, inst.selectedMonth,
+                  inst.selectedYear, sel[0]);
+            }
+
+            onSelect = $.datepicker._get(inst, "onSelect");
+            if (onSelect) {
+              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
+          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 chars, chr,
+          inst = $.datepicker._getInst(event.target);
+
+      if ($.datepicker._get(inst, "constrainInput")) {
+        chars = $.datepicker._possibleChars(
+            $.datepicker._get(inst, "dateFormat"));
+        chr = String.fromCharCode(
+            event.charCode == null ? 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 date,
+          inst = $.datepicker._getInst(event.target);
+
+      if (inst.input.val() !== inst.lastVal) {
+        try {
+          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) {
+        }
+      }
+      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, beforeShow, beforeShowSettings, isFixed,
-			offset, showAnim, duration;
-
-		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] );
-			}
-		}
-
-		beforeShow = $.datepicker._get(inst, "beforeShow");
-		beforeShowSettings = beforeShow ? beforeShow.apply(input, [input, inst]) : {};
-		if(beforeShowSettings === 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
-		}
-
-		isFixed = false;
-		$(input).parents().each(function() {
-			isFixed |= $(this).css("position") === "fixed";
-			return !isFixed;
-		});
-
-		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) {
-			showAnim = $.datepicker._get(inst, "showAnim");
-			duration = $.datepicker._get(inst, "duration");
-			inst.dpDiv.zIndex($(input).zIndex()+1);
-			$.datepicker._datepickerShowing = true;
-
-			if ( $.effects && $.effects.effect[ showAnim ] ) {
-				inst.dpDiv.show(showAnim, $.datepicker._get(inst, "showOptions"), duration);
-			} else {
-				inst.dpDiv[showAnim || "show"](showAnim ? duration : null);
-			}
-
-			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)
-		instActive = inst; // for delegate hover events
-		inst.dpDiv.empty().append(this._generateHTML(inst));
-		this._attachHandlers(inst);
-		inst.dpDiv.find("." + this._dayOverClass + " a").mouseover();
-
-		var origyearshtml,
-			numMonths = this._getNumberOfMonths(inst),
-			cols = numMonths[1],
-			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");
-
-		// #6694 - don't focus the input if it's already focused
-		// this breaks the change event in IE
-		if (inst === $.datepicker._curInst && $.datepicker._datepickerShowing && inst.input &&
-			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 ){
-			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.
+    _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, beforeShow, beforeShowSettings, isFixed,
+          offset, showAnim, duration;
+
+      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]);
+        }
+      }
+
+      beforeShow = $.datepicker._get(inst, "beforeShow");
+      beforeShowSettings = beforeShow ? beforeShow.apply(input, [input, inst])
+          : {};
+      if (beforeShowSettings === 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
+      }
+
+      isFixed = false;
+      $(input).parents().each(function () {
+        isFixed |= $(this).css("position") === "fixed";
+        return !isFixed;
+      });
+
+      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) {
+        showAnim = $.datepicker._get(inst, "showAnim");
+        duration = $.datepicker._get(inst, "duration");
+        inst.dpDiv.zIndex($(input).zIndex() + 1);
+        $.datepicker._datepickerShowing = true;
+
+        if ($.effects && $.effects.effect[showAnim]) {
+          inst.dpDiv.show(showAnim, $.datepicker._get(inst, "showOptions"),
+              duration);
+        } else {
+          inst.dpDiv[showAnim || "show"](showAnim ? duration : null);
+        }
+
+        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)
+      instActive = inst; // for delegate hover events
+      inst.dpDiv.empty().append(this._generateHTML(inst));
+      this._attachHandlers(inst);
+      inst.dpDiv.find("." + this._dayOverClass + " a").mouseover();
+
+      var origyearshtml,
+          numMonths = this._getNumberOfMonths(inst),
+          cols = numMonths[1],
+          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");
+
+      // #6694 - don't focus the input if it's already focused
+      // this breaks the change event in IE
+      if (inst === $.datepicker._curInst && $.datepicker._datepickerShowing
+          && inst.input &&
+          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) {
+        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(),
-			dpHeight = inst.dpDiv.outerHeight(),
-			inputWidth = inst.input ? inst.input.outerWidth() : 0,
-			inputHeight = inst.input ? inst.input.outerHeight() : 0,
-			viewWidth = document.documentElement.clientWidth + (isFixed ? 0 : $(document).scrollLeft()),
-			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 position,
-			inst = this._getInst(obj),
-			isRTL = this._get(inst, "isRTL");
-
-		while (obj && (obj.type === "hidden" || obj.nodeType !== 1 || $.expr.filters.hidden(obj))) {
-			obj = obj[isRTL ? "previousSibling" : "nextSibling"];
-		}
-
-		position = $(obj).offset();
-		return [position.left, position.top];
-	},
-
-	/* Hide the date picker from view.
+    _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(),
+          dpHeight = inst.dpDiv.outerHeight(),
+          inputWidth = inst.input ? inst.input.outerWidth() : 0,
+          inputHeight = inst.input ? inst.input.outerHeight() : 0,
+          viewWidth = document.documentElement.clientWidth + (isFixed ? 0 : $(
+              document).scrollLeft()),
+          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 position,
+          inst = this._getInst(obj),
+          isRTL = this._get(inst, "isRTL");
+
+      while (obj && (obj.type === "hidden" || obj.nodeType !== 1
+          || $.expr.filters.hidden(obj))) {
+        obj = obj[isRTL ? "previousSibling" : "nextSibling"];
+      }
+
+      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 showAnim, duration, postProcess, onClose,
-			inst = this._curInst;
-
-		if (!inst || (input && inst !== $.data(input, PROP_NAME))) {
-			return;
-		}
-
-		if (this._datepickerShowing) {
-			showAnim = this._get(inst, "showAnim");
-			duration = this._get(inst, "duration");
-			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;
-
-			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),
-			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 date,
-			target = $(id),
-			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 {
-			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),
-			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 inst,
-			target = $(id);
-
-		if ($(td).hasClass(this._unselectableClass) || this._isDisabledDatepicker(target[0])) {
-			return;
-		}
-
-		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);
-		this._selectDate(target, "");
-	},
-
-	/* Update the input field with the selected date. */
-	_selectDate: function(id, dateStr) {
-		var onSelect,
-			target = $(id),
-			inst = this._getInst(target[0]);
-
-		dateStr = (dateStr != null ? dateStr : this._formatDate(inst));
-		if (inst.input) {
-			inst.input.val(dateStr);
-		}
-		this._updateAlternate(inst);
-
-		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 altFormat, date, dateStr,
-			altField = this._get(inst, "altField");
-
-		if (altField) { // update alternate field too
-			altFormat = this._get(inst, "altFormat") || this._get(inst, "dateFormat");
-			date = this._getDate(inst);
-			dateStr = this.formatDate(altFormat, date, this._getFormatConfig(inst));
-			$(altField).each(function() { $(this).val(dateStr); });
-		}
-	},
-
-	/* Set as beforeShowDay function to prevent selection of weekends.
+    _hideDatepicker: function (input) {
+      var showAnim, duration, postProcess, onClose,
+          inst = this._curInst;
+
+      if (!inst || (input && inst !== $.data(input, PROP_NAME))) {
+        return;
+      }
+
+      if (this._datepickerShowing) {
+        showAnim = this._get(inst, "showAnim");
+        duration = this._get(inst, "duration");
+        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;
+
+        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),
+          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 date,
+          target = $(id),
+          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 {
+        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),
+          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 inst,
+          target = $(id);
+
+      if ($(td).hasClass(this._unselectableClass) || this._isDisabledDatepicker(
+              target[0])) {
+        return;
+      }
+
+      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);
+      this._selectDate(target, "");
+    },
+
+    /* Update the input field with the selected date. */
+    _selectDate: function (id, dateStr) {
+      var onSelect,
+          target = $(id),
+          inst = this._getInst(target[0]);
+
+      dateStr = (dateStr != null ? dateStr : this._formatDate(inst));
+      if (inst.input) {
+        inst.input.val(dateStr);
+      }
+      this._updateAlternate(inst);
+
+      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 altFormat, date, dateStr,
+          altField = this._get(inst, "altField");
+
+      if (altField) { // update alternate field too
+        altFormat = this._get(inst, "altFormat") || this._get(inst,
+            "dateFormat");
+        date = this._getDate(inst);
+        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), ""];
-	},
+    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.
+    /* 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 time,
-			checkDate = new Date(date.getTime());
+    iso8601Week: function (date) {
+      var time,
+          checkDate = new Date(date.getTime());
 
-		// Find Thursday of this week starting on Monday
-		checkDate.setDate(checkDate.getDate() + 4 - (checkDate.getDay() || 7));
+      // Find Thursday of this week starting on Monday
+      checkDate.setDate(checkDate.getDate() + 4 - (checkDate.getDay() || 7));
 
-		time = checkDate.getTime();
-		checkDate.setMonth(0); // Compare with Jan 1
-		checkDate.setDate(1);
-		return Math.floor(Math.round((time - checkDate) / 86400000) / 7) + 1;
-	},
+      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.
+    /* Parse a string value into a date object.
 	 * See formatDate below for the possible formats.
 	 *
 	 * @param  format string - the expected format of the date
@@ -7823,187 +8353,198 @@ $.extend(Datepicker.prototype, {
 	 *					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 iFormat, dim, extra,
-			iValue = 0,
-			shortYearCutoffTemp = (settings ? settings.shortYearCutoff : null) || this._defaults.shortYearCutoff,
-			shortYearCutoff = (typeof shortYearCutoffTemp !== "string" ? shortYearCutoffTemp :
-				new Date().getFullYear() % 100 + parseInt(shortYearCutoffTemp, 10)),
-			dayNamesShort = (settings ? settings.dayNamesShort : null) || this._defaults.dayNamesShort,
-			dayNames = (settings ? settings.dayNames : null) || this._defaults.dayNames,
-			monthNamesShort = (settings ? settings.monthNamesShort : null) || this._defaults.monthNamesShort,
-			monthNames = (settings ? settings.monthNames : null) || this._defaults.monthNames,
-			year = -1,
-			month = -1,
-			day = -1,
-			doy = -1,
-			literal = false,
-			date,
-			// Check whether a format character is doubled
-			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
-			getNumber = function(match) {
-				var isDoubled = lookAhead(match),
-					size = (match === "@" ? 14 : (match === "!" ? 20 :
-					(match === "y" && isDoubled ? 4 : (match === "o" ? 3 : 2)))),
-					digits = new RegExp("^\\d{1," + size + "}"),
-					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
-			getName = function(match, shortNames, longNames) {
-				var index = -1,
-					names = $.map(lookAhead(match) ? longNames : shortNames, function (v, k) {
-						return [ [k, v] ];
-					}).sort(function (a, b) {
-						return -(a[1].length - b[1].length);
-					});
-
-				$.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
-			checkLiteral = function() {
-				if (value.charAt(iValue) !== format.charAt(iFormat)) {
-					throw "Unexpected literal at position " + iValue;
-				}
-				iValue++;
-			};
-
-		for (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 "@":
-						date = new Date(getNumber("@"));
-						year = date.getFullYear();
-						month = date.getMonth() + 1;
-						day = date.getDate();
-						break;
-					case "!":
-						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){
-			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 {
-				dim = this._getDaysInMonth(year, month - 1);
-				if (day <= dim) {
-					break;
-				}
-				month++;
-				day -= dim;
-			} while (true);
-		}
-
-		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.
+    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 iFormat, dim, extra,
+          iValue = 0,
+          shortYearCutoffTemp = (settings ? settings.shortYearCutoff : null)
+              || this._defaults.shortYearCutoff,
+          shortYearCutoff = (typeof shortYearCutoffTemp !== "string"
+              ? shortYearCutoffTemp : new Date().getFullYear() % 100 + parseInt(
+              shortYearCutoffTemp, 10)),
+          dayNamesShort = (settings ? settings.dayNamesShort : null)
+              || this._defaults.dayNamesShort,
+          dayNames = (settings ? settings.dayNames : null)
+              || this._defaults.dayNames,
+          monthNamesShort = (settings ? settings.monthNamesShort : null)
+              || this._defaults.monthNamesShort,
+          monthNames = (settings ? settings.monthNames : null)
+              || this._defaults.monthNames,
+          year = -1,
+          month = -1,
+          day = -1,
+          doy = -1,
+          literal = false,
+          date,
+          // Check whether a format character is doubled
+          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
+          getNumber = function (match) {
+            var isDoubled = lookAhead(match),
+                size = (match === "@" ? 14 : (match === "!" ? 20 : (match
+                === "y" && isDoubled ? 4 : (match === "o" ? 3 : 2)))),
+                digits = new RegExp("^\\d{1," + size + "}"),
+                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
+          getName = function (match, shortNames, longNames) {
+            var index = -1,
+                names = $.map(lookAhead(match) ? longNames : shortNames,
+                    function (v, k) {
+                      return [[k, v]];
+                    }).sort(function (a, b) {
+                  return -(a[1].length - b[1].length);
+                });
+
+            $.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
+          checkLiteral = function () {
+            if (value.charAt(iValue) !== format.charAt(iFormat)) {
+              throw "Unexpected literal at position " + iValue;
+            }
+            iValue++;
+          };
+
+      for (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 "@":
+              date = new Date(getNumber("@"));
+              year = date.getFullYear();
+              month = date.getMonth() + 1;
+              day = date.getDate();
+              break;
+            case "!":
+              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) {
+        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 {
+          dim = this._getDaysInMonth(year, month - 1);
+          if (day <= dim) {
+            break;
+          }
+          month++;
+          day -= dim;
+        } while (true);
+      }
+
+      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)
@@ -8031,4650 +8572,4833 @@ $.extend(Datepicker.prototype, {
 	 *					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 iFormat,
-			dayNamesShort = (settings ? settings.dayNamesShort : null) || this._defaults.dayNamesShort,
-			dayNames = (settings ? settings.dayNames : null) || this._defaults.dayNames,
-			monthNamesShort = (settings ? settings.monthNamesShort : null) || this._defaults.monthNamesShort,
-			monthNames = (settings ? settings.monthNames : null) || this._defaults.monthNames,
-			// Check whether a format character is doubled
-			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
-			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
-			formatName = function(match, value, shortNames, longNames) {
-				return (lookAhead(match) ? longNames[value] : shortNames[value]);
-			},
-			output = "",
-			literal = false;
-
-		if (date) {
-			for (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 iFormat,
-			chars = "",
-			literal = false,
-			// Check whether a format character is doubled
-			lookAhead = function(match) {
-				var matches = (iFormat + 1 < format.length && format.charAt(iFormat + 1) === match);
-				if (matches) {
-					iFormat++;
-				}
-				return matches;
-			};
-
-		for (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"),
-			dates = inst.lastVal = inst.input ? inst.input.val() : null,
-			defaultDate = this._getDefaultDate(inst),
-			date = defaultDate,
-			settings = this._getFormatConfig(inst);
-
-		try {
-			date = this.parseDate(dateFormat, dates, settings) || defaultDate;
-		} catch (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;
-			},
-			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(),
-					year = date.getFullYear(),
-					month = date.getMonth(),
-					day = date.getDate(),
-					pattern = /([+\-]?[0-9]+)\s*(d|D|w|W|m|M|y|Y)?/g,
-					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);
-			},
-			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.
+    formatDate: function (format, date, settings) {
+      if (!date) {
+        return "";
+      }
+
+      var iFormat,
+          dayNamesShort = (settings ? settings.dayNamesShort : null)
+              || this._defaults.dayNamesShort,
+          dayNames = (settings ? settings.dayNames : null)
+              || this._defaults.dayNames,
+          monthNamesShort = (settings ? settings.monthNamesShort : null)
+              || this._defaults.monthNamesShort,
+          monthNames = (settings ? settings.monthNames : null)
+              || this._defaults.monthNames,
+          // Check whether a format character is doubled
+          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
+          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
+          formatName = function (match, value, shortNames, longNames) {
+            return (lookAhead(match) ? longNames[value] : shortNames[value]);
+          },
+          output = "",
+          literal = false;
+
+      if (date) {
+        for (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 iFormat,
+          chars = "",
+          literal = false,
+          // Check whether a format character is doubled
+          lookAhead = function (match) {
+            var matches = (iFormat + 1 < format.length && format.charAt(iFormat
+                + 1) === match);
+            if (matches) {
+              iFormat++;
+            }
+            return matches;
+          };
+
+      for (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"),
+          dates = inst.lastVal = inst.input ? inst.input.val() : null,
+          defaultDate = this._getDefaultDate(inst),
+          date = defaultDate,
+          settings = this._getFormatConfig(inst);
+
+      try {
+        date = this.parseDate(dateFormat, dates, settings) || defaultDate;
+      } catch (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;
+          },
+          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(),
+                year = date.getFullYear(),
+                month = date.getMonth(),
+                day = date.getDate(),
+                pattern = /([+\-]?[0-9]+)\s*(d|D|w|W|m|M|y|Y)?/g,
+                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);
+          },
+          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,
-			origMonth = inst.selectedMonth,
-			origYear = inst.selectedYear,
-			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
+    _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,
+          origMonth = inst.selectedMonth,
+          origYear = inst.selectedYear,
+          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"),
-			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 maxDraw, prevText, prev, nextText, next, currentText, gotoDate,
-			controls, buttonPanel, firstDay, showWeek, dayNames, dayNamesMin,
-			monthNames, monthNamesShort, beforeShowDay, showOtherMonths,
-			selectOtherMonths, defaultDate, html, dow, row, group, col, selectedDate,
-			cornerClass, calender, thead, day, daysInMonth, leadDays, curRows, numRows,
-			printDate, dRow, tbody, daySettings, otherMonth, unselectable,
-			tempDate = new Date(),
-			today = this._daylightSavingAdjust(
-				new Date(tempDate.getFullYear(), tempDate.getMonth(), tempDate.getDate())), // clear time
-			isRTL = this._get(inst, "isRTL"),
-			showButtonPanel = this._get(inst, "showButtonPanel"),
-			hideIfNoPrevNext = this._get(inst, "hideIfNoPrevNext"),
-			navigationAsDateFormat = this._get(inst, "navigationAsDateFormat"),
-			numMonths = this._getNumberOfMonths(inst),
-			showCurrentAtPos = this._get(inst, "showCurrentAtPos"),
-			stepMonths = this._get(inst, "stepMonths"),
-			isMultiMonth = (numMonths[0] !== 1 || numMonths[1] !== 1),
-			currentDate = this._daylightSavingAdjust((!inst.currentDay ? new Date(9999, 9, 9) :
-				new Date(inst.currentYear, inst.currentMonth, inst.currentDay))),
-			minDate = this._getMinMaxDate(inst, "min"),
-			maxDate = this._getMinMaxDate(inst, "max"),
-			drawMonth = inst.drawMonth - showCurrentAtPos,
-			drawYear = inst.drawYear;
-
-		if (drawMonth < 0) {
-			drawMonth += 12;
-			drawYear--;
-		}
-		if (maxDate) {
-			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;
-
-		prevText = this._get(inst, "prevText");
-		prevText = (!navigationAsDateFormat ? prevText : this.formatDate(prevText,
-			this._daylightSavingAdjust(new Date(drawYear, drawMonth - stepMonths, 1)),
-			this._getFormatConfig(inst)));
-
-		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>"));
-
-		nextText = this._get(inst, "nextText");
-		nextText = (!navigationAsDateFormat ? nextText : this.formatDate(nextText,
-			this._daylightSavingAdjust(new Date(drawYear, drawMonth + stepMonths, 1)),
-			this._getFormatConfig(inst)));
-
-		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>"));
-
-		currentText = this._get(inst, "currentText");
-		gotoDate = (this._get(inst, "gotoCurrent") && inst.currentDay ? currentDate : today);
-		currentText = (!navigationAsDateFormat ? currentText :
-			this.formatDate(currentText, gotoDate, this._getFormatConfig(inst)));
-
-		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>" : "");
-
-		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>" : "";
-
-		firstDay = parseInt(this._get(inst, "firstDay"),10);
-		firstDay = (isNaN(firstDay) ? 0 : firstDay);
-
-		showWeek = this._get(inst, "showWeek");
-		dayNames = this._get(inst, "dayNames");
-		dayNamesMin = this._get(inst, "dayNamesMin");
-		monthNames = this._get(inst, "monthNames");
-		monthNamesShort = this._get(inst, "monthNamesShort");
-		beforeShowDay = this._get(inst, "beforeShowDay");
-		showOtherMonths = this._get(inst, "showOtherMonths");
-		selectOtherMonths = this._get(inst, "selectOtherMonths");
-		defaultDate = this._getDefaultDate(inst);
-		html = "";
-		dow;
-		for (row = 0; row < numMonths[0]; row++) {
-			group = "";
-			this.maxRows = 4;
-			for (col = 0; col < numMonths[1]; col++) {
-				selectedDate = this._daylightSavingAdjust(new Date(drawYear, drawMonth, inst.selectedDay));
-				cornerClass = " ui-corner-all";
-				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>";
-				thead = (showWeek ? "<th class='ui-datepicker-week-col'>" + this._get(inst, "weekHeader") + "</th>" : "");
-				for (dow = 0; dow < 7; dow++) { // days of the week
-					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>";
-				daysInMonth = this._getDaysInMonth(drawYear, drawMonth);
-				if (drawYear === inst.selectedYear && drawMonth === inst.selectedMonth) {
-					inst.selectedDay = Math.min(inst.selectedDay, daysInMonth);
-				}
-				leadDays = (this._getFirstDayOfMonth(drawYear, drawMonth) - firstDay + 7) % 7;
-				curRows = Math.ceil((leadDays + daysInMonth) / 7); // calculate the number of rows to generate
-				numRows = (isMultiMonth ? this.maxRows > curRows ? this.maxRows : curRows : curRows); //If multiple months, use the higher number of rows (see #7043)
-				this.maxRows = numRows;
-				printDate = this._daylightSavingAdjust(new Date(drawYear, drawMonth, 1 - leadDays));
-				for (dRow = 0; dRow < numRows; dRow++) { // create date picker rows
-					calender += "<tr>";
-					tbody = (!showWeek ? "" : "<td class='ui-datepicker-week-col'>" +
-						this._get(inst, "calculateWeek")(printDate) + "</td>");
-					for (dow = 0; dow < 7; dow++) { // create date picker days
-						daySettings = (beforeShowDay ?
-							beforeShowDay.apply((inst.input ? inst.input[0] : null), [printDate]) : [true, ""]);
-						otherMonth = (printDate.getMonth() !== drawMonth);
-						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].replace(/'/g, "&#39;") + "'" : "") + // cell title
-							(unselectable ? "" : " data-handler='selectDay' data-event='click' data-month='" + printDate.getMonth() + "' data-year='" + printDate.getFullYear() + "'") + ">" + // actions
-							(otherMonth && !showOtherMonths ? "&#xa0;" : // 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;
-		inst._keyEvent = false;
-		return html;
-	},
-
-	/* Generate the month and year header. */
-	_generateMonthYearHeader: function(inst, drawMonth, drawYear, minDate, maxDate,
-			secondary, monthNames, monthNamesShort) {
-
-		var inMinYear, inMaxYear, month, years, thisYear, determineYear, year, endYear,
-			changeMonth = this._get(inst, "changeMonth"),
-			changeYear = this._get(inst, "changeYear"),
-			showMonthAfterYear = this._get(inst, "showMonthAfterYear"),
-			html = "<div class='ui-datepicker-title'>",
-			monthHtml = "";
-
-		// month selection
-		if (secondary || !changeMonth) {
-			monthHtml += "<span class='ui-datepicker-month'>" + monthNames[drawMonth] + "</span>";
-		} else {
-			inMinYear = (minDate && minDate.getFullYear() === drawYear);
-			inMaxYear = (maxDate && maxDate.getFullYear() === drawYear);
-			monthHtml += "<select class='ui-datepicker-month' data-handler='selectMonth' data-event='change'>";
-			for ( 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) ? "&#xa0;" : "");
-		}
-
-		// 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
-				years = this._get(inst, "yearRange").split(":");
-				thisYear = new Date().getFullYear();
-				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);
-				};
-				year = determineYear(years[0]);
-				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) ? "&#xa0;" : "") + 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),
-			month = inst.drawMonth + (period === "M" ? offset : 0),
-			day = Math.min(inst.selectedDay, this._getDaysInMonth(year, month)) + (period === "D" ? offset : 0),
-			date = this._restrictMinMax(inst, this._daylightSavingAdjust(new Date(year, month, day)));
-
-		inst.selectedDay = date.getDate();
-		inst.drawMonth = inst.selectedMonth = date.getMonth();
-		inst.drawYear = inst.selectedYear = date.getFullYear();
-		if (period === "M" || period === "Y") {
-			this._notifyChange(inst);
-		}
-	},
-
-	/* Ensure a date is within any min/max bounds. */
-	_restrictMinMax: function(inst, date) {
-		var minDate = this._getMinMaxDate(inst, "min"),
-			maxDate = this._getMinMaxDate(inst, "max"),
-			newDate = (minDate && date < minDate ? minDate : date);
-		return (maxDate && newDate > maxDate ? maxDate : newDate);
-	},
-
-	/* Notify change of month/year. */
-	_notifyChange: function(inst) {
-		var onChange = this._get(inst, "onChangeMonthYear");
-		if (onChange) {
-			onChange.apply((inst.input ? inst.input[0] : null),
-				[inst.selectedYear, inst.selectedMonth + 1, inst]);
-		}
-	},
-
-	/* Determine the number of months to show. */
-	_getNumberOfMonths: function(inst) {
-		var numMonths = this._get(inst, "numberOfMonths");
-		return (numMonths == null ? [1, 1] : (typeof numMonths === "number" ? [1, numMonths] : numMonths));
-	},
-
-	/* Determine the current maximum date - ensure no time components are set. */
-	_getMinMaxDate: function(inst, minMax) {
-		return this._determineDate(inst, this._get(inst, minMax + "Date"), null);
-	},
-
-	/* Find the number of days in a given month. */
-	_getDaysInMonth: function(year, month) {
-		return 32 - this._daylightSavingAdjust(new Date(year, month, 32)).getDate();
-	},
-
-	/* Find the day of the week of the first of a month. */
-	_getFirstDayOfMonth: function(year, month) {
-		return new Date(year, month, 1).getDay();
-	},
-
-	/* Determines if we should allow a "next/prev" month display change. */
-	_canAdjustMonth: function(inst, offset, curYear, curMonth) {
-		var numMonths = this._getNumberOfMonths(inst),
-			date = this._daylightSavingAdjust(new Date(curYear,
-			curMonth + (offset < 0 ? offset : numMonths[0] * numMonths[1]), 1));
-
-		if (offset < 0) {
-			date.setDate(this._getDaysInMonth(date.getFullYear(), date.getMonth()));
-		}
-		return this._isInRange(inst, date);
-	},
-
-	/* Is the given date in the accepted range? */
-	_isInRange: function(inst, date) {
-		var yearSplit, currentYear,
-			minDate = this._getMinMaxDate(inst, "min"),
-			maxDate = this._getMinMaxDate(inst, "max"),
-			minYear = null,
-			maxYear = null,
-			years = this._get(inst, "yearRange");
-			if (years){
-				yearSplit = years.split(":");
-				currentYear = new Date().getFullYear();
-				minYear = parseInt(yearSplit[0], 10);
-				maxYear = parseInt(yearSplit[1], 10);
-				if ( yearSplit[0].match(/[+\-].*/) ) {
-					minYear += currentYear;
-				}
-				if ( yearSplit[1].match(/[+\-].*/) ) {
-					maxYear += currentYear;
-				}
-			}
-
-		return ((!minDate || date.getTime() >= minDate.getTime()) &&
-			(!maxDate || date.getTime() <= maxDate.getTime()) &&
-			(!minYear || date.getFullYear() >= minYear) &&
-			(!maxYear || date.getFullYear() <= maxYear));
-	},
-
-	/* Provide the configuration settings for formatting/parsing. */
-	_getFormatConfig: function(inst) {
-		var shortYearCutoff = this._get(inst, "shortYearCutoff");
-		shortYearCutoff = (typeof shortYearCutoff !== "string" ? shortYearCutoff :
-			new Date().getFullYear() % 100 + parseInt(shortYearCutoff, 10));
-		return {shortYearCutoff: shortYearCutoff,
-			dayNamesShort: this._get(inst, "dayNamesShort"), dayNames: this._get(inst, "dayNames"),
-			monthNamesShort: this._get(inst, "monthNamesShort"), monthNames: this._get(inst, "monthNames")};
-	},
-
-	/* Format the given date for display. */
-	_formatDate: function(inst, day, month, year) {
-		if (!day) {
-			inst.currentDay = inst.selectedDay;
-			inst.currentMonth = inst.selectedMonth;
-			inst.currentYear = inst.selectedYear;
-		}
-		var date = (day ? (typeof day === "object" ? day :
-			this._daylightSavingAdjust(new Date(year, month, day))) :
-			this._daylightSavingAdjust(new Date(inst.currentYear, inst.currentMonth, inst.currentDay)));
-		return this.formatDate(this._get(inst, "dateFormat"), date, this._getFormatConfig(inst));
-	}
-});
-
-/*
+    _attachHandlers: function (inst) {
+      var stepMonths = this._get(inst, "stepMonths"),
+          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 maxDraw, prevText, prev, nextText, next, currentText, gotoDate,
+          controls, buttonPanel, firstDay, showWeek, dayNames, dayNamesMin,
+          monthNames, monthNamesShort, beforeShowDay, showOtherMonths,
+          selectOtherMonths, defaultDate, html, dow, row, group, col,
+          selectedDate,
+          cornerClass, calender, thead, day, daysInMonth, leadDays, curRows,
+          numRows,
+          printDate, dRow, tbody, daySettings, otherMonth, unselectable,
+          tempDate = new Date(),
+          today = this._daylightSavingAdjust(
+              new Date(tempDate.getFullYear(), tempDate.getMonth(),
+                  tempDate.getDate())), // clear time
+          isRTL = this._get(inst, "isRTL"),
+          showButtonPanel = this._get(inst, "showButtonPanel"),
+          hideIfNoPrevNext = this._get(inst, "hideIfNoPrevNext"),
+          navigationAsDateFormat = this._get(inst, "navigationAsDateFormat"),
+          numMonths = this._getNumberOfMonths(inst),
+          showCurrentAtPos = this._get(inst, "showCurrentAtPos"),
+          stepMonths = this._get(inst, "stepMonths"),
+          isMultiMonth = (numMonths[0] !== 1 || numMonths[1] !== 1),
+          currentDate = this._daylightSavingAdjust(
+              (!inst.currentDay ? new Date(9999, 9, 9) : new Date(
+                  inst.currentYear, inst.currentMonth, inst.currentDay))),
+          minDate = this._getMinMaxDate(inst, "min"),
+          maxDate = this._getMinMaxDate(inst, "max"),
+          drawMonth = inst.drawMonth - showCurrentAtPos,
+          drawYear = inst.drawYear;
+
+      if (drawMonth < 0) {
+        drawMonth += 12;
+        drawYear--;
+      }
+      if (maxDate) {
+        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;
+
+      prevText = this._get(inst, "prevText");
+      prevText = (!navigationAsDateFormat ? prevText : this.formatDate(prevText,
+          this._daylightSavingAdjust(
+              new Date(drawYear, drawMonth - stepMonths, 1)),
+          this._getFormatConfig(inst)));
+
+      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>"));
+
+      nextText = this._get(inst, "nextText");
+      nextText = (!navigationAsDateFormat ? nextText : this.formatDate(nextText,
+          this._daylightSavingAdjust(
+              new Date(drawYear, drawMonth + stepMonths, 1)),
+          this._getFormatConfig(inst)));
+
+      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>"));
+
+      currentText = this._get(inst, "currentText");
+      gotoDate = (this._get(inst, "gotoCurrent") && inst.currentDay
+          ? currentDate : today);
+      currentText = (!navigationAsDateFormat ? currentText : this.formatDate(
+          currentText, gotoDate, this._getFormatConfig(inst)));
+
+      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>" : "");
+
+      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>" : "";
+
+      firstDay = parseInt(this._get(inst, "firstDay"), 10);
+      firstDay = (isNaN(firstDay) ? 0 : firstDay);
+
+      showWeek = this._get(inst, "showWeek");
+      dayNames = this._get(inst, "dayNames");
+      dayNamesMin = this._get(inst, "dayNamesMin");
+      monthNames = this._get(inst, "monthNames");
+      monthNamesShort = this._get(inst, "monthNamesShort");
+      beforeShowDay = this._get(inst, "beforeShowDay");
+      showOtherMonths = this._get(inst, "showOtherMonths");
+      selectOtherMonths = this._get(inst, "selectOtherMonths");
+      defaultDate = this._getDefaultDate(inst);
+      html = "";
+      dow;
+      for (row = 0; row < numMonths[0]; row++) {
+        group = "";
+        this.maxRows = 4;
+        for (col = 0; col < numMonths[1]; col++) {
+          selectedDate = this._daylightSavingAdjust(
+              new Date(drawYear, drawMonth, inst.selectedDay));
+          cornerClass = " ui-corner-all";
+          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>";
+          thead = (showWeek ? "<th class='ui-datepicker-week-col'>" + this._get(
+              inst, "weekHeader") + "</th>" : "");
+          for (dow = 0; dow < 7; dow++) { // days of the week
+            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>";
+          daysInMonth = this._getDaysInMonth(drawYear, drawMonth);
+          if (drawYear === inst.selectedYear && drawMonth
+              === inst.selectedMonth) {
+            inst.selectedDay = Math.min(inst.selectedDay, daysInMonth);
+          }
+          leadDays = (this._getFirstDayOfMonth(drawYear, drawMonth) - firstDay
+              + 7) % 7;
+          curRows = Math.ceil((leadDays + daysInMonth) / 7); // calculate the number of rows to generate
+          numRows = (isMultiMonth ? this.maxRows > curRows ? this.maxRows
+              : curRows : curRows); //If multiple months, use the higher number of rows (see #7043)
+          this.maxRows = numRows;
+          printDate = this._daylightSavingAdjust(
+              new Date(drawYear, drawMonth, 1 - leadDays));
+          for (dRow = 0; dRow < numRows; dRow++) { // create date picker rows
+            calender += "<tr>";
+            tbody = (!showWeek ? "" : "<td class='ui-datepicker-week-col'>" +
+                this._get(inst, "calculateWeek")(printDate) + "</td>");
+            for (dow = 0; dow < 7; dow++) { // create date picker days
+              daySettings = (beforeShowDay ? beforeShowDay.apply(
+                  (inst.input ? inst.input[0] : null), [printDate]) : [true,
+                ""]);
+              otherMonth = (printDate.getMonth() !== drawMonth);
+              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].replace(/'/g, "&#39;") + "'"
+                      : "") + // cell title
+                  (unselectable ? ""
+                      : " data-handler='selectDay' data-event='click' data-month='"
+                      + printDate.getMonth() + "' data-year='"
+                      + printDate.getFullYear() + "'") + ">" + // actions
+                  (otherMonth && !showOtherMonths ? "&#xa0;" : // 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;
+      inst._keyEvent = false;
+      return html;
+    },
+
+    /* Generate the month and year header. */
+    _generateMonthYearHeader: function (inst, drawMonth, drawYear, minDate,
+        maxDate,
+        secondary, monthNames, monthNamesShort) {
+
+      var inMinYear, inMaxYear, month, years, thisYear, determineYear, year,
+          endYear,
+          changeMonth = this._get(inst, "changeMonth"),
+          changeYear = this._get(inst, "changeYear"),
+          showMonthAfterYear = this._get(inst, "showMonthAfterYear"),
+          html = "<div class='ui-datepicker-title'>",
+          monthHtml = "";
+
+      // month selection
+      if (secondary || !changeMonth) {
+        monthHtml += "<span class='ui-datepicker-month'>"
+            + monthNames[drawMonth] + "</span>";
+      } else {
+        inMinYear = (minDate && minDate.getFullYear() === drawYear);
+        inMaxYear = (maxDate && maxDate.getFullYear() === drawYear);
+        monthHtml += "<select class='ui-datepicker-month' data-handler='selectMonth' data-event='change'>";
+        for (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)
+            ? "&#xa0;" : "");
+      }
+
+      // 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
+          years = this._get(inst, "yearRange").split(":");
+          thisYear = new Date().getFullYear();
+          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);
+          };
+          year = determineYear(years[0]);
+          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) ? "&#xa0;" : "")
+            + 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),
+          month = inst.drawMonth + (period === "M" ? offset : 0),
+          day = Math.min(inst.selectedDay, this._getDaysInMonth(year, month))
+              + (period === "D" ? offset : 0),
+          date = this._restrictMinMax(inst,
+              this._daylightSavingAdjust(new Date(year, month, day)));
+
+      inst.selectedDay = date.getDate();
+      inst.drawMonth = inst.selectedMonth = date.getMonth();
+      inst.drawYear = inst.selectedYear = date.getFullYear();
+      if (period === "M" || period === "Y") {
+        this._notifyChange(inst);
+      }
+    },
+
+    /* Ensure a date is within any min/max bounds. */
+    _restrictMinMax: function (inst, date) {
+      var minDate = this._getMinMaxDate(inst, "min"),
+          maxDate = this._getMinMaxDate(inst, "max"),
+          newDate = (minDate && date < minDate ? minDate : date);
+      return (maxDate && newDate > maxDate ? maxDate : newDate);
+    },
+
+    /* Notify change of month/year. */
+    _notifyChange: function (inst) {
+      var onChange = this._get(inst, "onChangeMonthYear");
+      if (onChange) {
+        onChange.apply((inst.input ? inst.input[0] : null),
+            [inst.selectedYear, inst.selectedMonth + 1, inst]);
+      }
+    },
+
+    /* Determine the number of months to show. */
+    _getNumberOfMonths: function (inst) {
+      var numMonths = this._get(inst, "numberOfMonths");
+      return (numMonths == null ? [1, 1] : (typeof numMonths === "number" ? [1,
+        numMonths] : numMonths));
+    },
+
+    /* Determine the current maximum date - ensure no time components are set. */
+    _getMinMaxDate: function (inst, minMax) {
+      return this._determineDate(inst, this._get(inst, minMax + "Date"), null);
+    },
+
+    /* Find the number of days in a given month. */
+    _getDaysInMonth: function (year, month) {
+      return 32 - this._daylightSavingAdjust(
+          new Date(year, month, 32)).getDate();
+    },
+
+    /* Find the day of the week of the first of a month. */
+    _getFirstDayOfMonth: function (year, month) {
+      return new Date(year, month, 1).getDay();
+    },
+
+    /* Determines if we should allow a "next/prev" month display change. */
+    _canAdjustMonth: function (inst, offset, curYear, curMonth) {
+      var numMonths = this._getNumberOfMonths(inst),
+          date = this._daylightSavingAdjust(new Date(curYear,
+              curMonth + (offset < 0 ? offset : numMonths[0] * numMonths[1]),
+              1));
+
+      if (offset < 0) {
+        date.setDate(this._getDaysInMonth(date.getFullYear(), date.getMonth()));
+      }
+      return this._isInRange(inst, date);
+    },
+
+    /* Is the given date in the accepted range? */
+    _isInRange: function (inst, date) {
+      var yearSplit, currentYear,
+          minDate = this._getMinMaxDate(inst, "min"),
+          maxDate = this._getMinMaxDate(inst, "max"),
+          minYear = null,
+          maxYear = null,
+          years = this._get(inst, "yearRange");
+      if (years) {
+        yearSplit = years.split(":");
+        currentYear = new Date().getFullYear();
+        minYear = parseInt(yearSplit[0], 10);
+        maxYear = parseInt(yearSplit[1], 10);
+        if (yearSplit[0].match(/[+\-].*/)) {
+          minYear += currentYear;
+        }
+        if (yearSplit[1].match(/[+\-].*/)) {
+          maxYear += currentYear;
+        }
+      }
+
+      return ((!minDate || date.getTime() >= minDate.getTime()) &&
+          (!maxDate || date.getTime() <= maxDate.getTime()) &&
+          (!minYear || date.getFullYear() >= minYear) &&
+          (!maxYear || date.getFullYear() <= maxYear));
+    },
+
+    /* Provide the configuration settings for formatting/parsing. */
+    _getFormatConfig: function (inst) {
+      var shortYearCutoff = this._get(inst, "shortYearCutoff");
+      shortYearCutoff = (typeof shortYearCutoff !== "string" ? shortYearCutoff
+          : new Date().getFullYear() % 100 + parseInt(shortYearCutoff, 10));
+      return {
+        shortYearCutoff: shortYearCutoff,
+        dayNamesShort: this._get(inst, "dayNamesShort"),
+        dayNames: this._get(inst, "dayNames"),
+        monthNamesShort: this._get(inst, "monthNamesShort"),
+        monthNames: this._get(inst, "monthNames")
+      };
+    },
+
+    /* Format the given date for display. */
+    _formatDate: function (inst, day, month, year) {
+      if (!day) {
+        inst.currentDay = inst.selectedDay;
+        inst.currentMonth = inst.selectedMonth;
+        inst.currentYear = inst.selectedYear;
+      }
+      var date = (day ? (typeof day === "object" ? day
+          : this._daylightSavingAdjust(new Date(year, month, day)))
+          : this._daylightSavingAdjust(
+              new Date(inst.currentYear, inst.currentMonth, inst.currentDay)));
+      return this.formatDate(this._get(inst, "dateFormat"), date,
+          this._getFormatConfig(inst));
+    }
+  });
+
+  /*
  * Bind hover events for datepicker elements.
  * Done via delegate so the binding only occurs once in the lifetime of the parent div.
  * Global 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) {
-			target[name] = props[name];
-		}
-	}
-	return target;
-}
-
-/* Invoke the datepicker functionality.
+  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) {
+        target[name] = props[name];
+      }
+    }
+    return target;
+  }
+
+  /* Invoke the datepicker functionality.
    @param  options  string - a command, optionally followed by additional parameters or
 					Object - settings for attaching new datepicker functionality
    @return  jQuery object */
-$.fn.datepicker = function(options){
-
-	/* Verify an empty collection wasn't passed - Fixes #6976 */
-	if ( !this.length ) {
-		return this;
-	}
-
-	/* Initialise the date picker. */
-	if (!$.datepicker.initialized) {
-		$(document).mousedown($.datepicker._checkExternalClick);
-		$.datepicker.initialized = true;
-	}
-
-	/* Append datepicker main container to body if not exist. */
-	if ($("#"+$.datepicker._mainDivId).length === 0) {
-		$("body").append($.datepicker.dpDiv);
-	}
-
-	var otherArgs = Array.prototype.slice.call(arguments, 1);
-	if (typeof options === "string" && (options === "isDisabled" || options === "getDate" || options === "widget")) {
-		return $.datepicker["_" + options + "Datepicker"].
-			apply($.datepicker, [this[0]].concat(otherArgs));
-	}
-	if (options === "option" && arguments.length === 2 && typeof arguments[1] === "string") {
-		return $.datepicker["_" + options + "Datepicker"].
-			apply($.datepicker, [this[0]].concat(otherArgs));
-	}
-	return this.each(function() {
-		typeof options === "string" ?
-			$.datepicker["_" + options + "Datepicker"].
-				apply($.datepicker, [this].concat(otherArgs)) :
-			$.datepicker._attachDatepicker(this, options);
-	});
-};
-
-$.datepicker = new Datepicker(); // singleton instance
-$.datepicker.initialized = false;
-$.datepicker.uuid = new Date().getTime();
-$.datepicker.version = "1.10.1";
+  $.fn.datepicker = function (options) {
+
+    /* Verify an empty collection wasn't passed - Fixes #6976 */
+    if (!this.length) {
+      return this;
+    }
+
+    /* Initialise the date picker. */
+    if (!$.datepicker.initialized) {
+      $(document).mousedown($.datepicker._checkExternalClick);
+      $.datepicker.initialized = true;
+    }
+
+    /* Append datepicker main container to body if not exist. */
+    if ($("#" + $.datepicker._mainDivId).length === 0) {
+      $("body").append($.datepicker.dpDiv);
+    }
+
+    var otherArgs = Array.prototype.slice.call(arguments, 1);
+    if (typeof options === "string" && (options === "isDisabled" || options
+            === "getDate" || options === "widget")) {
+      return $.datepicker["_" + options + "Datepicker"].apply($.datepicker,
+          [this[0]].concat(otherArgs));
+    }
+    if (options === "option" && arguments.length === 2 && typeof arguments[1]
+        === "string") {
+      return $.datepicker["_" + options + "Datepicker"].apply($.datepicker,
+          [this[0]].concat(otherArgs));
+    }
+    return this.each(function () {
+      typeof options === "string" ? $.datepicker["_" + options
+          + "Datepicker"].apply($.datepicker, [this].concat(otherArgs))
+          : $.datepicker._attachDatepicker(this, options);
+    });
+  };
+
+  $.datepicker = new Datepicker(); // singleton instance
+  $.datepicker.initialized = false;
+  $.datepicker.uuid = new Date().getTime();
+  $.datepicker.version = "1.10.1";
 
 // Workaround for #4055
 // Add another global to avoid noConflict issues with inline event handlers
-window["DP_jQuery_" + dpuuid] = $;
+  window["DP_jQuery_" + dpuuid] = $;
 
 })(jQuery);
-(function( $, undefined ) {
-
-var 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.10.1",
-	options: {
-		appendTo: "body",
-		autoOpen: true,
-		buttons: [],
-		closeOnEscape: true,
-		closeText: "close",
-		dialogClass: "",
-		draggable: true,
-		hide: null,
-		height: "auto",
-		maxHeight: null,
-		maxWidth: null,
-		minHeight: 150,
-		minWidth: 150,
-		modal: false,
-		position: {
-			my: "center",
-			at: "center",
-			of: window,
-			collision: "fit",
-			// Ensure the titlebar is always visible
-			using: function( pos ) {
-				var topOffset = $( this ).css( pos ).offset().top;
-				if ( topOffset < 0 ) {
-					$( this ).css( "top", pos.top - topOffset );
-				}
-			}
-		},
-		resizable: true,
-		show: null,
-		title: null,
-		width: 300,
-
-		// callbacks
-		beforeClose: null,
-		close: null,
-		drag: null,
-		dragStart: null,
-		dragStop: null,
-		focus: null,
-		open: null,
-		resize: null,
-		resizeStart: null,
-		resizeStop: null
-	},
-
-	_create: function() {
-		this.originalCss = {
-			display: this.element[0].style.display,
-			width: this.element[0].style.width,
-			minHeight: this.element[0].style.minHeight,
-			maxHeight: this.element[0].style.maxHeight,
-			height: this.element[0].style.height
-		};
-		this.originalPosition = {
-			parent: this.element.parent(),
-			index: this.element.parent().children().index( this.element )
-		};
-		this.originalTitle = this.element.attr("title");
-		this.options.title = this.options.title || this.originalTitle;
-
-		this._createWrapper();
-
-		this.element
-			.show()
-			.removeAttr("title")
-			.addClass("ui-dialog-content ui-widget-content")
-			.appendTo( this.uiDialog );
-
-		this._createTitlebar();
-		this._createButtonPane();
-
-		if ( this.options.draggable && $.fn.draggable ) {
-			this._makeDraggable();
-		}
-		if ( this.options.resizable && $.fn.resizable ) {
-			this._makeResizable();
-		}
-
-		this._isOpen = false;
-	},
-
-	_init: function() {
-		if ( this.options.autoOpen ) {
-			this.open();
-		}
-	},
-
-	_appendTo: function() {
-		var element = this.options.appendTo;
-		if ( element && (element.jquery || element.nodeType) ) {
-			return $( element );
-		}
-		return this.document.find( element || "body" ).eq( 0 );
-	},
-
-	_destroy: function() {
-		var next,
-			originalPosition = this.originalPosition;
-
-		this._destroyOverlay();
-
-		this.element
-			.removeUniqueId()
-			.removeClass("ui-dialog-content ui-widget-content")
-			.css( this.originalCss )
-			// Without detaching first, the following becomes really slow
-			.detach();
-
-		this.uiDialog.stop( true, true ).remove();
-
-		if ( this.originalTitle ) {
-			this.element.attr( "title", this.originalTitle );
-		}
-
-		next = originalPosition.parent.children().eq( originalPosition.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 {
-			originalPosition.parent.append( this.element );
-		}
-	},
-
-	widget: function() {
-		return this.uiDialog;
-	},
-
-	disable: $.noop,
-	enable: $.noop,
-
-	close: function( event ) {
-		var that = this;
-
-		if ( !this._isOpen || this._trigger( "beforeClose", event ) === false ) {
-			return;
-		}
-
-		this._isOpen = false;
-		this._destroyOverlay();
-
-		if ( !this.opener.filter(":focusable").focus().length ) {
-			// Hiding a focused element doesn't trigger blur in WebKit
-			// so in case we have nothing to focus on, explicitly blur the active element
-			// https://bugs.webkit.org/show_bug.cgi?id=47182
-			$( this.document[0].activeElement ).blur();
-		}
-
-		this._hide( this.uiDialog, this.options.hide, function() {
-			that._trigger( "close", event );
-		});
-	},
-
-	isOpen: function() {
-		return this._isOpen;
-	},
-
-	moveToTop: function() {
-		this._moveToTop();
-	},
-
-	_moveToTop: function( event, silent ) {
-		var moved = !!this.uiDialog.nextAll(":visible").insertBefore( this.uiDialog ).length;
-		if ( moved && !silent ) {
-			this._trigger( "focus", event );
-		}
-		return moved;
-	},
-
-	open: function() {
-		var that = this;
-		if ( this._isOpen ) {
-			if ( this._moveToTop() ) {
-				this._focusTabbable();
-			}
-			return;
-		}
-
-		this._isOpen = true;
-		this.opener = $( this.document[0].activeElement );
-
-		this._size();
-		this._position();
-		this._createOverlay();
-		this._moveToTop( null, true );
-		this._show( this.uiDialog, this.options.show, function() {
-			that._focusTabbable();
-			that._trigger("focus");
-		});
-
-		this._trigger("open");
-	},
-
-	_focusTabbable: function() {
-		// Set focus to the first match:
-		// 1. First element inside the dialog matching [autofocus]
-		// 2. Tabbable element inside the content element
-		// 3. Tabbable element inside the buttonpane
-		// 4. The close button
-		// 5. The dialog itself
-		var hasFocus = this.element.find("[autofocus]");
-		if ( !hasFocus.length ) {
-			hasFocus = this.element.find(":tabbable");
-		}
-		if ( !hasFocus.length ) {
-			hasFocus = this.uiDialogButtonPane.find(":tabbable");
-		}
-		if ( !hasFocus.length ) {
-			hasFocus = this.uiDialogTitlebarClose.filter(":tabbable");
-		}
-		if ( !hasFocus.length ) {
-			hasFocus = this.uiDialog;
-		}
-		hasFocus.eq( 0 ).focus();
-	},
-
-	_keepFocus: function( event ) {
-		function checkFocus() {
-			var activeElement = this.document[0].activeElement,
-				isActive = this.uiDialog[0] === activeElement ||
-					$.contains( this.uiDialog[0], activeElement );
-			if ( !isActive ) {
-				this._focusTabbable();
-			}
-		}
-		event.preventDefault();
-		checkFocus.call( this );
-		// support: IE
-		// IE <= 8 doesn't prevent moving focus even with event.preventDefault()
-		// so we check again later
-		this._delay( checkFocus );
-	},
-
-	_createWrapper: function() {
-		this.uiDialog = $("<div>")
-			.addClass( "ui-dialog ui-widget ui-widget-content ui-corner-all ui-front " +
-				this.options.dialogClass )
-			.hide()
-			.attr({
-				// Setting tabIndex makes the div focusable
-				tabIndex: -1,
-				role: "dialog"
-			})
-			.appendTo( this._appendTo() );
-
-		this._on( this.uiDialog, {
-			keydown: function( event ) {
-				if ( this.options.closeOnEscape && !event.isDefaultPrevented() && event.keyCode &&
-						event.keyCode === $.ui.keyCode.ESCAPE ) {
-					event.preventDefault();
-					this.close( event );
-					return;
-				}
-
-				// prevent tabbing out of dialogs
-				if ( event.keyCode !== $.ui.keyCode.TAB ) {
-					return;
-				}
-				var tabbables = this.uiDialog.find(":tabbable"),
-					first = tabbables.filter(":first"),
-					last  = tabbables.filter(":last");
-
-				if ( ( event.target === last[0] || event.target === this.uiDialog[0] ) && !event.shiftKey ) {
-					first.focus( 1 );
-					event.preventDefault();
-				} else if ( ( event.target === first[0] || event.target === this.uiDialog[0] ) && event.shiftKey ) {
-					last.focus( 1 );
-					event.preventDefault();
-				}
-			},
-			mousedown: function( event ) {
-				if ( this._moveToTop( event ) ) {
-					this._focusTabbable();
-				}
-			}
-		});
-
-		// We assume that any existing aria-describedby attribute means
-		// that the dialog content is marked up properly
-		// otherwise we brute force the content as the description
-		if ( !this.element.find("[aria-describedby]").length ) {
-			this.uiDialog.attr({
-				"aria-describedby": this.element.uniqueId().attr("id")
-			});
-		}
-	},
-
-	_createTitlebar: function() {
-		var uiDialogTitle;
-
-		this.uiDialogTitlebar = $("<div>")
-			.addClass("ui-dialog-titlebar ui-widget-header ui-corner-all ui-helper-clearfix")
-			.prependTo( this.uiDialog );
-		this._on( this.uiDialogTitlebar, {
-			mousedown: function( event ) {
-				// Don't prevent click on close button (#8838)
-				// Focusing a dialog that is partially scrolled out of view
-				// causes the browser to scroll it into view, preventing the click event
-				if ( !$( event.target ).closest(".ui-dialog-titlebar-close") ) {
-					// Dialog isn't getting focus when dragging (#8063)
-					this.uiDialog.focus();
-				}
-			}
-		});
-
-		this.uiDialogTitlebarClose = $("<button></button>")
-			.button({
-				label: this.options.closeText,
-				icons: {
-					primary: "ui-icon-closethick"
-				},
-				text: false
-			})
-			.addClass("ui-dialog-titlebar-close")
-			.appendTo( this.uiDialogTitlebar );
-		this._on( this.uiDialogTitlebarClose, {
-			click: function( event ) {
-				event.preventDefault();
-				this.close( event );
-			}
-		});
-
-		uiDialogTitle = $("<span>")
-			.uniqueId()
-			.addClass("ui-dialog-title")
-			.prependTo( this.uiDialogTitlebar );
-		this._title( uiDialogTitle );
-
-		this.uiDialog.attr({
-			"aria-labelledby": uiDialogTitle.attr("id")
-		});
-	},
-
-	_title: function( title ) {
-		if ( !this.options.title ) {
-			title.html("&#160;");
-		}
-		title.text( this.options.title );
-	},
-
-	_createButtonPane: function() {
-		this.uiDialogButtonPane = $("<div>")
-			.addClass("ui-dialog-buttonpane ui-widget-content ui-helper-clearfix");
-
-		this.uiButtonSet = $("<div>")
-			.addClass("ui-dialog-buttonset")
-			.appendTo( this.uiDialogButtonPane );
-
-		this._createButtons();
-	},
-
-	_createButtons: function() {
-		var that = this,
-			buttons = this.options.buttons;
-
-		// if we already have a button pane, remove it
-		this.uiDialogButtonPane.remove();
-		this.uiButtonSet.empty();
-
-		if ( $.isEmptyObject( buttons ) || ($.isArray( buttons ) && !buttons.length) ) {
-			this.uiDialog.removeClass("ui-dialog-buttons");
-			return;
-		}
-
-		$.each( buttons, function( name, props ) {
-			var click, buttonOptions;
-			props = $.isFunction( props ) ?
-				{ click: props, text: name } :
-				props;
-			// Default to a non-submitting button
-			props = $.extend( { type: "button" }, props );
-			// Change the context for the click callback to be the main element
-			click = props.click;
-			props.click = function() {
-				click.apply( that.element[0], arguments );
-			};
-			buttonOptions = {
-				icons: props.icons,
-				text: props.showText
-			};
-			delete props.icons;
-			delete props.showText;
-			$( "<button></button>", props )
-				.button( buttonOptions )
-				.appendTo( that.uiButtonSet );
-		});
-		this.uiDialog.addClass("ui-dialog-buttons");
-		this.uiDialogButtonPane.appendTo( this.uiDialog );
-	},
-
-	_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._blockFrames();
-				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._unblockFrames();
-				that._trigger( "dragStop", event, filteredUi( ui ) );
-			}
-		});
-	},
-
-	_makeResizable: function() {
-		var that = this,
-			options = this.options,
-			handles = options.resizable,
-			// .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._blockFrames();
-				that._trigger( "resizeStart", event, filteredUi( ui ) );
-			},
-			resize: function( event, ui ) {
-				that._trigger( "resize", event, filteredUi( ui ) );
-			},
-			stop: function( event, ui ) {
-				options.height = $( this ).height();
-				options.width = $( this ).width();
-				$( this ).removeClass("ui-dialog-resizing");
-				that._unblockFrames();
-				that._trigger( "resizeStop", event, filteredUi( ui ) );
-			}
-		})
-		.css( "position", position );
-	},
-
-	_minHeight: function() {
-		var options = this.options;
-
-		return options.height === "auto" ?
-			options.minHeight :
-			Math.min( options.minHeight, options.height );
-	},
-
-	_position: function() {
-		// Need to show the dialog to get the actual offset in the position plugin
-		var isVisible = this.uiDialog.is(":visible");
-		if ( !isVisible ) {
-			this.uiDialog.show();
-		}
-		this.uiDialog.position( this.options.position );
-		if ( !isVisible ) {
-			this.uiDialog.hide();
-		}
-	},
-
-	_setOptions: function( options ) {
-		var that = this,
-			resize = false,
-			resizableOptions = {};
-
-		$.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();
-			this._position();
-		}
-		if ( this.uiDialog.is(":data(ui-resizable)") ) {
-			this.uiDialog.resizable( "option", resizableOptions );
-		}
-	},
-
-	_setOption: function( key, value ) {
-		/*jshint maxcomplexity:15*/
-		var isDraggable, isResizable,
-			uiDialog = this.uiDialog;
-
-		if ( key === "dialogClass" ) {
-			uiDialog
-				.removeClass( this.options.dialogClass )
-				.addClass( value );
-		}
-
-		if ( key === "disabled" ) {
-			return;
-		}
-
-		this._super( key, value );
-
-		if ( key === "appendTo" ) {
-			this.uiDialog.appendTo( this._appendTo() );
-		}
-
-		if ( key === "buttons" ) {
-			this._createButtons();
-		}
-
-		if ( key === "closeText" ) {
-			this.uiDialogTitlebarClose.button({
-				// Ensure that we always pass a string
-				label: "" + value
-			});
-		}
-
-		if ( key === "draggable" ) {
-			isDraggable = uiDialog.is(":data(ui-draggable)");
-			if ( isDraggable && !value ) {
-				uiDialog.draggable("destroy");
-			}
-
-			if ( !isDraggable && value ) {
-				this._makeDraggable();
-			}
-		}
-
-		if ( key === "position" ) {
-			this._position();
-		}
-
-		if ( key === "resizable" ) {
-			// currently resizable, becoming non-resizable
-			isResizable = uiDialog.is(":data(ui-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();
-			}
-		}
-
-		if ( key === "title" ) {
-			this._title( this.uiDialogTitlebar.find(".ui-dialog-title") );
-		}
-	},
-
-	_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, maxContentHeight,
-			options = this.options;
-
-		// Reset content sizing
-		this.element.show().css({
-			width: "auto",
-			minHeight: 0,
-			maxHeight: "none",
-			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 );
-		maxContentHeight = typeof options.maxHeight === "number" ?
-			Math.max( 0, options.maxHeight - nonContentHeight ) :
-			"none";
-
-		if ( options.height === "auto" ) {
-			this.element.css({
-				minHeight: minContentHeight,
-				maxHeight: maxContentHeight,
-				height: "auto"
-			});
-		} else {
-			this.element.height( Math.max( 0, options.height - nonContentHeight ) );
-		}
-
-		if (this.uiDialog.is(":data(ui-resizable)") ) {
-			this.uiDialog.resizable( "option", "minHeight", this._minHeight() );
-		}
-	},
-
-	_blockFrames: function() {
-		this.iframeBlocks = this.document.find( "iframe" ).map(function() {
-			var iframe = $( this );
-
-			return $( "<div>" )
-				.css({
-					position: "absolute",
-					width: iframe.outerWidth(),
-					height: iframe.outerHeight()
-				})
-				.appendTo( iframe.parent() )
-				.offset( iframe.offset() )[0];
-		});
-	},
-
-	_unblockFrames: function() {
-		if ( this.iframeBlocks ) {
-			this.iframeBlocks.remove();
-			delete this.iframeBlocks;
-		}
-	},
-
-	_createOverlay: function() {
-		if ( !this.options.modal ) {
-			return;
-		}
-
-		if ( !$.ui.dialog.overlayInstances ) {
-			// Prevent use of anchors and inputs.
-			// We use a delay in case the overlay is created from an
-			// event that we're going to be cancelling. (#2804)
-			this._delay(function() {
-				// Handle .dialog().dialog("close") (#4065)
-				if ( $.ui.dialog.overlayInstances ) {
-					this.document.bind( "focusin.dialog", function( event ) {
-						if ( !$( event.target ).closest(".ui-dialog").length &&
-								// TODO: Remove hack when datepicker implements
-								// the .ui-front logic (#8989)
-								!$( event.target ).closest(".ui-datepicker").length ) {
-							event.preventDefault();
-							$(".ui-dialog:visible:last .ui-dialog-content")
-								.data("ui-dialog")._focusTabbable();
-						}
-					});
-				}
-			});
-		}
-
-		this.overlay = $("<div>")
-			.addClass("ui-widget-overlay ui-front")
-			.appendTo( this._appendTo() );
-		this._on( this.overlay, {
-			mousedown: "_keepFocus"
-		});
-		$.ui.dialog.overlayInstances++;
-	},
-
-	_destroyOverlay: function() {
-		if ( !this.options.modal ) {
-			return;
-		}
-
-		if ( this.overlay ) {
-			$.ui.dialog.overlayInstances--;
-
-			if ( !$.ui.dialog.overlayInstances ) {
-				this.document.unbind( "focusin.dialog" );
-			}
-			this.overlay.remove();
-			this.overlay = null;
-		}
-	}
-});
-
-$.ui.dialog.overlayInstances = 0;
+(function ($, undefined) {
+
+  var 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.10.1",
+    options: {
+      appendTo: "body",
+      autoOpen: true,
+      buttons: [],
+      closeOnEscape: true,
+      closeText: "close",
+      dialogClass: "",
+      draggable: true,
+      hide: null,
+      height: "auto",
+      maxHeight: null,
+      maxWidth: null,
+      minHeight: 150,
+      minWidth: 150,
+      modal: false,
+      position: {
+        my: "center",
+        at: "center",
+        of: window,
+        collision: "fit",
+        // Ensure the titlebar is always visible
+        using: function (pos) {
+          var topOffset = $(this).css(pos).offset().top;
+          if (topOffset < 0) {
+            $(this).css("top", pos.top - topOffset);
+          }
+        }
+      },
+      resizable: true,
+      show: null,
+      title: null,
+      width: 300,
+
+      // callbacks
+      beforeClose: null,
+      close: null,
+      drag: null,
+      dragStart: null,
+      dragStop: null,
+      focus: null,
+      open: null,
+      resize: null,
+      resizeStart: null,
+      resizeStop: null
+    },
+
+    _create: function () {
+      this.originalCss = {
+        display: this.element[0].style.display,
+        width: this.element[0].style.width,
+        minHeight: this.element[0].style.minHeight,
+        maxHeight: this.element[0].style.maxHeight,
+        height: this.element[0].style.height
+      };
+      this.originalPosition = {
+        parent: this.element.parent(),
+        index: this.element.parent().children().index(this.element)
+      };
+      this.originalTitle = this.element.attr("title");
+      this.options.title = this.options.title || this.originalTitle;
+
+      this._createWrapper();
+
+      this.element
+      .show()
+      .removeAttr("title")
+      .addClass("ui-dialog-content ui-widget-content")
+      .appendTo(this.uiDialog);
+
+      this._createTitlebar();
+      this._createButtonPane();
+
+      if (this.options.draggable && $.fn.draggable) {
+        this._makeDraggable();
+      }
+      if (this.options.resizable && $.fn.resizable) {
+        this._makeResizable();
+      }
+
+      this._isOpen = false;
+    },
+
+    _init: function () {
+      if (this.options.autoOpen) {
+        this.open();
+      }
+    },
+
+    _appendTo: function () {
+      var element = this.options.appendTo;
+      if (element && (element.jquery || element.nodeType)) {
+        return $(element);
+      }
+      return this.document.find(element || "body").eq(0);
+    },
+
+    _destroy: function () {
+      var next,
+          originalPosition = this.originalPosition;
+
+      this._destroyOverlay();
+
+      this.element
+      .removeUniqueId()
+      .removeClass("ui-dialog-content ui-widget-content")
+      .css(this.originalCss)
+      // Without detaching first, the following becomes really slow
+      .detach();
+
+      this.uiDialog.stop(true, true).remove();
+
+      if (this.originalTitle) {
+        this.element.attr("title", this.originalTitle);
+      }
+
+      next = originalPosition.parent.children().eq(originalPosition.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 {
+        originalPosition.parent.append(this.element);
+      }
+    },
+
+    widget: function () {
+      return this.uiDialog;
+    },
+
+    disable: $.noop,
+    enable: $.noop,
+
+    close: function (event) {
+      var that = this;
+
+      if (!this._isOpen || this._trigger("beforeClose", event) === false) {
+        return;
+      }
+
+      this._isOpen = false;
+      this._destroyOverlay();
+
+      if (!this.opener.filter(":focusable").focus().length) {
+        // Hiding a focused element doesn't trigger blur in WebKit
+        // so in case we have nothing to focus on, explicitly blur the active element
+        // https://bugs.webkit.org/show_bug.cgi?id=47182
+        $(this.document[0].activeElement).blur();
+      }
+
+      this._hide(this.uiDialog, this.options.hide, function () {
+        that._trigger("close", event);
+      });
+    },
+
+    isOpen: function () {
+      return this._isOpen;
+    },
+
+    moveToTop: function () {
+      this._moveToTop();
+    },
+
+    _moveToTop: function (event, silent) {
+      var moved = !!this.uiDialog.nextAll(":visible").insertBefore(
+          this.uiDialog).length;
+      if (moved && !silent) {
+        this._trigger("focus", event);
+      }
+      return moved;
+    },
+
+    open: function () {
+      var that = this;
+      if (this._isOpen) {
+        if (this._moveToTop()) {
+          this._focusTabbable();
+        }
+        return;
+      }
+
+      this._isOpen = true;
+      this.opener = $(this.document[0].activeElement);
+
+      this._size();
+      this._position();
+      this._createOverlay();
+      this._moveToTop(null, true);
+      this._show(this.uiDialog, this.options.show, function () {
+        that._focusTabbable();
+        that._trigger("focus");
+      });
+
+      this._trigger("open");
+    },
+
+    _focusTabbable: function () {
+      // Set focus to the first match:
+      // 1. First element inside the dialog matching [autofocus]
+      // 2. Tabbable element inside the content element
+      // 3. Tabbable element inside the buttonpane
+      // 4. The close button
+      // 5. The dialog itself
+      var hasFocus = this.element.find("[autofocus]");
+      if (!hasFocus.length) {
+        hasFocus = this.element.find(":tabbable");
+      }
+      if (!hasFocus.length) {
+        hasFocus = this.uiDialogButtonPane.find(":tabbable");
+      }
+      if (!hasFocus.length) {
+        hasFocus = this.uiDialogTitlebarClose.filter(":tabbable");
+      }
+      if (!hasFocus.length) {
+        hasFocus = this.uiDialog;
+      }
+      hasFocus.eq(0).focus();
+    },
+
+    _keepFocus: function (event) {
+      function checkFocus() {
+        var activeElement = this.document[0].activeElement,
+            isActive = this.uiDialog[0] === activeElement ||
+                $.contains(this.uiDialog[0], activeElement);
+        if (!isActive) {
+          this._focusTabbable();
+        }
+      }
+
+      event.preventDefault();
+      checkFocus.call(this);
+      // support: IE
+      // IE <= 8 doesn't prevent moving focus even with event.preventDefault()
+      // so we check again later
+      this._delay(checkFocus);
+    },
+
+    _createWrapper: function () {
+      this.uiDialog = $("<div>")
+      .addClass("ui-dialog ui-widget ui-widget-content ui-corner-all ui-front "
+          +
+          this.options.dialogClass)
+      .hide()
+      .attr({
+        // Setting tabIndex makes the div focusable
+        tabIndex: -1,
+        role: "dialog"
+      })
+      .appendTo(this._appendTo());
+
+      this._on(this.uiDialog, {
+        keydown: function (event) {
+          if (this.options.closeOnEscape && !event.isDefaultPrevented()
+              && event.keyCode &&
+              event.keyCode === $.ui.keyCode.ESCAPE) {
+            event.preventDefault();
+            this.close(event);
+            return;
+          }
+
+          // prevent tabbing out of dialogs
+          if (event.keyCode !== $.ui.keyCode.TAB) {
+            return;
+          }
+          var tabbables = this.uiDialog.find(":tabbable"),
+              first = tabbables.filter(":first"),
+              last = tabbables.filter(":last");
+
+          if (( event.target === last[0] || event.target === this.uiDialog[0] )
+              && !event.shiftKey) {
+            first.focus(1);
+            event.preventDefault();
+          } else if (( event.target === first[0] || event.target
+                  === this.uiDialog[0] ) && event.shiftKey) {
+            last.focus(1);
+            event.preventDefault();
+          }
+        },
+        mousedown: function (event) {
+          if (this._moveToTop(event)) {
+            this._focusTabbable();
+          }
+        }
+      });
+
+      // We assume that any existing aria-describedby attribute means
+      // that the dialog content is marked up properly
+      // otherwise we brute force the content as the description
+      if (!this.element.find("[aria-describedby]").length) {
+        this.uiDialog.attr({
+          "aria-describedby": this.element.uniqueId().attr("id")
+        });
+      }
+    },
+
+    _createTitlebar: function () {
+      var uiDialogTitle;
+
+      this.uiDialogTitlebar = $("<div>")
+      .addClass(
+          "ui-dialog-titlebar ui-widget-header ui-corner-all ui-helper-clearfix")
+      .prependTo(this.uiDialog);
+      this._on(this.uiDialogTitlebar, {
+        mousedown: function (event) {
+          // Don't prevent click on close button (#8838)
+          // Focusing a dialog that is partially scrolled out of view
+          // causes the browser to scroll it into view, preventing the click event
+          if (!$(event.target).closest(".ui-dialog-titlebar-close")) {
+            // Dialog isn't getting focus when dragging (#8063)
+            this.uiDialog.focus();
+          }
+        }
+      });
+
+      this.uiDialogTitlebarClose = $("<button></button>")
+      .button({
+        label: this.options.closeText,
+        icons: {
+          primary: "ui-icon-closethick"
+        },
+        text: false
+      })
+      .addClass("ui-dialog-titlebar-close")
+      .appendTo(this.uiDialogTitlebar);
+      this._on(this.uiDialogTitlebarClose, {
+        click: function (event) {
+          event.preventDefault();
+          this.close(event);
+        }
+      });
+
+      uiDialogTitle = $("<span>")
+      .uniqueId()
+      .addClass("ui-dialog-title")
+      .prependTo(this.uiDialogTitlebar);
+      this._title(uiDialogTitle);
+
+      this.uiDialog.attr({
+        "aria-labelledby": uiDialogTitle.attr("id")
+      });
+    },
+
+    _title: function (title) {
+      if (!this.options.title) {
+        title.html("&#160;");
+      }
+      title.text(this.options.title);
+    },
+
+    _createButtonPane: function () {
+      this.uiDialogButtonPane = $("<div>")
+      .addClass("ui-dialog-buttonpane ui-widget-content ui-helper-clearfix");
+
+      this.uiButtonSet = $("<div>")
+      .addClass("ui-dialog-buttonset")
+      .appendTo(this.uiDialogButtonPane);
+
+      this._createButtons();
+    },
+
+    _createButtons: function () {
+      var that = this,
+          buttons = this.options.buttons;
+
+      // if we already have a button pane, remove it
+      this.uiDialogButtonPane.remove();
+      this.uiButtonSet.empty();
+
+      if ($.isEmptyObject(buttons) || ($.isArray(buttons) && !buttons.length)) {
+        this.uiDialog.removeClass("ui-dialog-buttons");
+        return;
+      }
+
+      $.each(buttons, function (name, props) {
+        var click, buttonOptions;
+        props = $.isFunction(props) ? {click: props, text: name} : props;
+        // Default to a non-submitting button
+        props = $.extend({type: "button"}, props);
+        // Change the context for the click callback to be the main element
+        click = props.click;
+        props.click = function () {
+          click.apply(that.element[0], arguments);
+        };
+        buttonOptions = {
+          icons: props.icons,
+          text: props.showText
+        };
+        delete props.icons;
+        delete props.showText;
+        $("<button></button>", props)
+        .button(buttonOptions)
+        .appendTo(that.uiButtonSet);
+      });
+      this.uiDialog.addClass("ui-dialog-buttons");
+      this.uiDialogButtonPane.appendTo(this.uiDialog);
+    },
+
+    _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._blockFrames();
+          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._unblockFrames();
+          that._trigger("dragStop", event, filteredUi(ui));
+        }
+      });
+    },
+
+    _makeResizable: function () {
+      var that = this,
+          options = this.options,
+          handles = options.resizable,
+          // .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._blockFrames();
+          that._trigger("resizeStart", event, filteredUi(ui));
+        },
+        resize: function (event, ui) {
+          that._trigger("resize", event, filteredUi(ui));
+        },
+        stop: function (event, ui) {
+          options.height = $(this).height();
+          options.width = $(this).width();
+          $(this).removeClass("ui-dialog-resizing");
+          that._unblockFrames();
+          that._trigger("resizeStop", event, filteredUi(ui));
+        }
+      })
+      .css("position", position);
+    },
+
+    _minHeight: function () {
+      var options = this.options;
+
+      return options.height === "auto" ? options.minHeight : Math.min(
+          options.minHeight, options.height);
+    },
+
+    _position: function () {
+      // Need to show the dialog to get the actual offset in the position plugin
+      var isVisible = this.uiDialog.is(":visible");
+      if (!isVisible) {
+        this.uiDialog.show();
+      }
+      this.uiDialog.position(this.options.position);
+      if (!isVisible) {
+        this.uiDialog.hide();
+      }
+    },
+
+    _setOptions: function (options) {
+      var that = this,
+          resize = false,
+          resizableOptions = {};
+
+      $.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();
+        this._position();
+      }
+      if (this.uiDialog.is(":data(ui-resizable)")) {
+        this.uiDialog.resizable("option", resizableOptions);
+      }
+    },
+
+    _setOption: function (key, value) {
+      /*jshint maxcomplexity:15*/
+      var isDraggable, isResizable,
+          uiDialog = this.uiDialog;
+
+      if (key === "dialogClass") {
+        uiDialog
+        .removeClass(this.options.dialogClass)
+        .addClass(value);
+      }
+
+      if (key === "disabled") {
+        return;
+      }
+
+      this._super(key, value);
+
+      if (key === "appendTo") {
+        this.uiDialog.appendTo(this._appendTo());
+      }
+
+      if (key === "buttons") {
+        this._createButtons();
+      }
+
+      if (key === "closeText") {
+        this.uiDialogTitlebarClose.button({
+          // Ensure that we always pass a string
+          label: "" + value
+        });
+      }
+
+      if (key === "draggable") {
+        isDraggable = uiDialog.is(":data(ui-draggable)");
+        if (isDraggable && !value) {
+          uiDialog.draggable("destroy");
+        }
+
+        if (!isDraggable && value) {
+          this._makeDraggable();
+        }
+      }
+
+      if (key === "position") {
+        this._position();
+      }
+
+      if (key === "resizable") {
+        // currently resizable, becoming non-resizable
+        isResizable = uiDialog.is(":data(ui-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();
+        }
+      }
+
+      if (key === "title") {
+        this._title(this.uiDialogTitlebar.find(".ui-dialog-title"));
+      }
+    },
+
+    _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, maxContentHeight,
+          options = this.options;
+
+      // Reset content sizing
+      this.element.show().css({
+        width: "auto",
+        minHeight: 0,
+        maxHeight: "none",
+        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);
+      maxContentHeight = typeof options.maxHeight === "number" ? Math.max(
+          0, options.maxHeight - nonContentHeight) : "none";
+
+      if (options.height === "auto") {
+        this.element.css({
+          minHeight: minContentHeight,
+          maxHeight: maxContentHeight,
+          height: "auto"
+        });
+      } else {
+        this.element.height(Math.max(0, options.height - nonContentHeight));
+      }
+
+      if (this.uiDialog.is(":data(ui-resizable)")) {
+        this.uiDialog.resizable("option", "minHeight", this._minHeight());
+      }
+    },
+
+    _blockFrames: function () {
+      this.iframeBlocks = this.document.find("iframe").map(function () {
+        var iframe = $(this);
+
+        return $("<div>")
+        .css({
+          position: "absolute",
+          width: iframe.outerWidth(),
+          height: iframe.outerHeight()
+        })
+        .appendTo(iframe.parent())
+        .offset(iframe.offset())[0];
+      });
+    },
+
+    _unblockFrames: function () {
+      if (this.iframeBlocks) {
+        this.iframeBlocks.remove();
+        delete this.iframeBlocks;
+      }
+    },
+
+    _createOverlay: function () {
+      if (!this.options.modal) {
+        return;
+      }
+
+      if (!$.ui.dialog.overlayInstances) {
+        // Prevent use of anchors and inputs.
+        // We use a delay in case the overlay is created from an
+        // event that we're going to be cancelling. (#2804)
+        this._delay(function () {
+          // Handle .dialog().dialog("close") (#4065)
+          if ($.ui.dialog.overlayInstances) {
+            this.document.bind("focusin.dialog", function (event) {
+              if (!$(event.target).closest(".ui-dialog").length &&
+                  // TODO: Remove hack when datepicker implements
+                  // the .ui-front logic (#8989)
+                  !$(event.target).closest(".ui-datepicker").length) {
+                event.preventDefault();
+                $(".ui-dialog:visible:last .ui-dialog-content")
+                .data("ui-dialog")._focusTabbable();
+              }
+            });
+          }
+        });
+      }
+
+      this.overlay = $("<div>")
+      .addClass("ui-widget-overlay ui-front")
+      .appendTo(this._appendTo());
+      this._on(this.overlay, {
+        mousedown: "_keepFocus"
+      });
+      $.ui.dialog.overlayInstances++;
+    },
+
+    _destroyOverlay: function () {
+      if (!this.options.modal) {
+        return;
+      }
+
+      if (this.overlay) {
+        $.ui.dialog.overlayInstances--;
+
+        if (!$.ui.dialog.overlayInstances) {
+          this.document.unbind("focusin.dialog");
+        }
+        this.overlay.remove();
+        this.overlay = null;
+      }
+    }
+  });
+
+  $.ui.dialog.overlayInstances = 0;
 
 // DEPRECATED
-if ( $.uiBackCompat !== false ) {
-	// position option with array notation
-	// just override with old implementation
-	$.widget( "ui.dialog", $.ui.dialog, {
-		_position: function() {
-			var position = this.options.position,
-				myAt = [],
-				offset = [ 0, 0 ],
-				isVisible;
-
-			if ( position ) {
-				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();
-			}
-		}
-	});
-}
-
-}( jQuery ) );
-(function( $, undefined ) {
-
-$.widget( "ui.menu", {
-	version: "1.10.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;
-		// flag used to prevent firing of the click handler
-		// as the event bubbles up through nested menus
-		this.mouseHandled = false;
-		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 ( !this.mouseHandled && target.not( ".ui-state-disabled" ).length ) {
-					this.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
-				this.mouseHandled = false;
-			}
-		});
-	},
-
-	_destroy: function() {
-		// Destroy (sub)menus
-		this.element
-			.removeAttr( "aria-activedescendant" )
-			.find( ".ui-menu" ).addBack()
-				.removeClass( "ui-menu ui-widget ui-widget-content ui-corner-all ui-menu-icons" )
-				.removeAttr( "role" )
-				.removeAttr( "tabIndex" )
-				.removeAttr( "aria-labelledby" )
-				.removeAttr( "aria-expanded" )
-				.removeAttr( "aria-hidden" )
-				.removeAttr( "aria-disabled" )
-				.removeUniqueId()
-				.show();
-
-		// 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 ) {
-		/*jshint maxcomplexity:20*/
-		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() {
-		var menus,
-			icon = this.options.icons.submenu,
-			submenus = this.element.find( this.options.menus );
-
-		// Initialize nested menus
-		submenus.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 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" ) );
-			});
-
-		menus = submenus.add( this.element );
-
-		// Don't refresh list items that are already adapted
-		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 ( !/[^\-\u2014\u2013\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" );
-
-		// 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 ];
-	},
-
-	_setOption: function( key, value ) {
-		if ( key === "icons" ) {
-			this.element.find( ".ui-menu-icon" )
-				.removeClass( this.options.icons.submenu )
-				.addClass( value.submenu );
-		}
-		this._super( key, value );
-	},
-
-	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.10.1",
-	options: {
-		max: 100,
-		value: 0,
-
-		change: null,
-		complete: null
-	},
-
-	min: 0,
-
-	_create: function() {
-		// Constrain initial value
-		this.oldValue = this.options.value = this._constrainedValue();
-
-		this.element
-			.addClass( "ui-progressbar ui-widget ui-widget-content ui-corner-all" )
-			.attr({
-				// Only set static values, aria-valuenow and aria-valuemax are
-				// set inside _refreshValue()
-				role: "progressbar",
-				"aria-valuemin": this.min
-			});
-
-		this.valueDiv = $( "<div class='ui-progressbar-value ui-widget-header ui-corner-left'></div>" )
-			.appendTo( this.element );
-
-		this._refreshValue();
-	},
-
-	_destroy: function() {
-		this.element
-			.removeClass( "ui-progressbar ui-widget ui-widget-content ui-corner-all" )
-			.removeAttr( "role" )
-			.removeAttr( "aria-valuemin" )
-			.removeAttr( "aria-valuemax" )
-			.removeAttr( "aria-valuenow" );
-
-		this.valueDiv.remove();
-	},
-
-	value: function( newValue ) {
-		if ( newValue === undefined ) {
-			return this.options.value;
-		}
-
-		this.options.value = this._constrainedValue( newValue );
-		this._refreshValue();
-	},
-
-	_constrainedValue: function( newValue ) {
-		if ( newValue === undefined ) {
-			newValue = this.options.value;
-		}
-
-		this.indeterminate = newValue === false;
-
-		// sanitize value
-		if ( typeof newValue !== "number" ) {
-			newValue = 0;
-		}
-
-		return this.indeterminate ? false :
-			Math.min( this.options.max, Math.max( this.min, newValue ) );
-	},
-
-	_setOptions: function( options ) {
-		// Ensure "value" option is set after other values (like max)
-		var value = options.value;
-		delete options.value;
-
-		this._super( options );
-
-		this.options.value = this._constrainedValue( value );
-		this._refreshValue();
-	},
-
-	_setOption: function( key, value ) {
-		if ( key === "max" ) {
-			// Don't allow a max less than min
-			value = Math.max( this.min, value );
-		}
-
-		this._super( key, value );
-	},
-
-	_percentage: function() {
-		return this.indeterminate ? 100 : 100 * ( this.options.value - this.min ) / ( this.options.max - this.min );
-	},
-
-	_refreshValue: function() {
-		var value = this.options.value,
-			percentage = this._percentage();
-
-		this.valueDiv
-			.toggle( this.indeterminate || value > this.min )
-			.toggleClass( "ui-corner-right", value === this.options.max )
-			.width( percentage.toFixed(0) + "%" );
-
-		this.element.toggleClass( "ui-progressbar-indeterminate", this.indeterminate );
-
-		if ( this.indeterminate ) {
-			this.element.removeAttr( "aria-valuenow" );
-			if ( !this.overlayDiv ) {
-				this.overlayDiv = $( "<div class='ui-progressbar-overlay'></div>" ).appendTo( this.valueDiv );
-			}
-		} else {
-			this.element.attr({
-				"aria-valuemax": this.options.max,
-				"aria-valuenow": value
-			});
-			if ( this.overlayDiv ) {
-				this.overlayDiv.remove();
-				this.overlayDiv = null;
-			}
-		}
-
-		if ( this.oldValue !== value ) {
-			this.oldValue = value;
-			this._trigger( "change" );
-		}
-		if ( value === this.options.max ) {
-			this._trigger( "complete" );
-		}
-	}
-});
-
-})( jQuery );
-(function( $, undefined ) {
+  if ($.uiBackCompat !== false) {
+    // position option with array notation
+    // just override with old implementation
+    $.widget("ui.dialog", $.ui.dialog, {
+      _position: function () {
+        var position = this.options.position,
+            myAt = [],
+            offset = [0, 0],
+            isVisible;
+
+        if (position) {
+          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();
+        }
+      }
+    });
+  }
+
+}(jQuery) );
+(function ($, undefined) {
+
+  $.widget("ui.menu", {
+    version: "1.10.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;
+      // flag used to prevent firing of the click handler
+      // as the event bubbles up through nested menus
+      this.mouseHandled = false;
+      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 (!this.mouseHandled && target.not(".ui-state-disabled").length) {
+            this.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
+          this.mouseHandled = false;
+        }
+      });
+    },
+
+    _destroy: function () {
+      // Destroy (sub)menus
+      this.element
+      .removeAttr("aria-activedescendant")
+      .find(".ui-menu").addBack()
+      .removeClass(
+          "ui-menu ui-widget ui-widget-content ui-corner-all ui-menu-icons")
+      .removeAttr("role")
+      .removeAttr("tabIndex")
+      .removeAttr("aria-labelledby")
+      .removeAttr("aria-expanded")
+      .removeAttr("aria-hidden")
+      .removeAttr("aria-disabled")
+      .removeUniqueId()
+      .show();
+
+      // 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) {
+      /*jshint maxcomplexity:20*/
+      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 () {
+      var menus,
+          icon = this.options.icons.submenu,
+          submenus = this.element.find(this.options.menus);
+
+      // Initialize nested menus
+      submenus.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 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"));
+      });
+
+      menus = submenus.add(this.element);
+
+      // Don't refresh list items that are already adapted
+      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 (!/[^\-\u2014\u2013\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");
+
+      // 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];
+    },
+
+    _setOption: function (key, value) {
+      if (key === "icons") {
+        this.element.find(".ui-menu-icon")
+        .removeClass(this.options.icons.submenu)
+        .addClass(value.submenu);
+      }
+      this._super(key, value);
+    },
+
+    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.10.1",
+    options: {
+      max: 100,
+      value: 0,
+
+      change: null,
+      complete: null
+    },
+
+    min: 0,
+
+    _create: function () {
+      // Constrain initial value
+      this.oldValue = this.options.value = this._constrainedValue();
+
+      this.element
+      .addClass("ui-progressbar ui-widget ui-widget-content ui-corner-all")
+      .attr({
+        // Only set static values, aria-valuenow and aria-valuemax are
+        // set inside _refreshValue()
+        role: "progressbar",
+        "aria-valuemin": this.min
+      });
+
+      this.valueDiv = $(
+          "<div class='ui-progressbar-value ui-widget-header ui-corner-left'></div>")
+      .appendTo(this.element);
+
+      this._refreshValue();
+    },
+
+    _destroy: function () {
+      this.element
+      .removeClass("ui-progressbar ui-widget ui-widget-content ui-corner-all")
+      .removeAttr("role")
+      .removeAttr("aria-valuemin")
+      .removeAttr("aria-valuemax")
+      .removeAttr("aria-valuenow");
+
+      this.valueDiv.remove();
+    },
+
+    value: function (newValue) {
+      if (newValue === undefined) {
+        return this.options.value;
+      }
+
+      this.options.value = this._constrainedValue(newValue);
+      this._refreshValue();
+    },
+
+    _constrainedValue: function (newValue) {
+      if (newValue === undefined) {
+        newValue = this.options.value;
+      }
+
+      this.indeterminate = newValue === false;
+
+      // sanitize value
+      if (typeof newValue !== "number") {
+        newValue = 0;
+      }
+
+      return this.indeterminate ? false : Math.min(this.options.max,
+          Math.max(this.min, newValue));
+    },
+
+    _setOptions: function (options) {
+      // Ensure "value" option is set after other values (like max)
+      var value = options.value;
+      delete options.value;
+
+      this._super(options);
+
+      this.options.value = this._constrainedValue(value);
+      this._refreshValue();
+    },
+
+    _setOption: function (key, value) {
+      if (key === "max") {
+        // Don't allow a max less than min
+        value = Math.max(this.min, value);
+      }
+
+      this._super(key, value);
+    },
+
+    _percentage: function () {
+      return this.indeterminate ? 100 : 100 * ( this.options.value - this.min )
+          / ( this.options.max - this.min );
+    },
+
+    _refreshValue: function () {
+      var value = this.options.value,
+          percentage = this._percentage();
+
+      this.valueDiv
+      .toggle(this.indeterminate || value > this.min)
+      .toggleClass("ui-corner-right", value === this.options.max)
+      .width(percentage.toFixed(0) + "%");
+
+      this.element.toggleClass("ui-progressbar-indeterminate",
+          this.indeterminate);
+
+      if (this.indeterminate) {
+        this.element.removeAttr("aria-valuenow");
+        if (!this.overlayDiv) {
+          this.overlayDiv = $(
+              "<div class='ui-progressbar-overlay'></div>").appendTo(
+              this.valueDiv);
+        }
+      } else {
+        this.element.attr({
+          "aria-valuemax": this.options.max,
+          "aria-valuenow": value
+        });
+        if (this.overlayDiv) {
+          this.overlayDiv.remove();
+          this.overlayDiv = null;
+        }
+      }
+
+      if (this.oldValue !== value) {
+        this.oldValue = value;
+        this._trigger("change");
+      }
+      if (value === this.options.max) {
+        this._trigger("complete");
+      }
+    }
+  });
+
+})(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.10.1",
-	widgetEventPrefix: "slide",
-
-	options: {
-		animate: false,
-		distance: 0,
-		max: 100,
-		min: 0,
-		orientation: "horizontal",
-		range: false,
-		step: 1,
-		value: 0,
-		values: null,
-
-		// callbacks
-		change: null,
-		slide: null,
-		start: null,
-		stop: null
-	},
-
-	_create: function() {
-		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");
-
-		this._refresh();
-		this._setOption( "disabled", this.options.disabled );
-
-		this._animateOff = false;
-	},
-
-	_refresh: function() {
-		this._createRange();
-		this._createHandles();
-		this._setupEvents();
-		this._refreshValue();
-	},
-
-	_createHandles: function() {
-		var i, handleCount,
-			options = 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 = [];
-
-		handleCount = ( options.values && options.values.length ) || 1;
-
-		if ( existingHandles.length > handleCount ) {
-			existingHandles.slice( handleCount ).remove();
-			existingHandles = existingHandles.slice( 0, handleCount );
-		}
-
-		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.each(function( i ) {
-			$( this ).data( "ui-slider-handle-index", i );
-		});
-	},
-
-	_createRange: function() {
-		var options = this.options,
-			classes = "";
-
-		if ( options.range ) {
-			if ( options.range === true ) {
-				if ( !options.values ) {
-					options.values = [ this._valueMin(), this._valueMin() ];
-				} else if ( options.values.length && options.values.length !== 2 ) {
-					options.values = [ options.values[0], options.values[0] ];
-				} else if ( $.isArray( options.values ) ) {
-					options.values = options.values.slice(0);
-				}
-			}
-
-			if ( !this.range || !this.range.length ) {
-				this.range = $( "<div></div>" )
-					.appendTo( this.element );
-
-				classes = "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 ui-corner-all";
-			} else {
-				this.range.removeClass( "ui-slider-range-min ui-slider-range-max" )
-					// Handle range switching from true to min/max
-					.css({
-						"left": "",
-						"bottom": ""
-					});
-			}
-
-			this.range.addClass( classes +
-				( ( options.range === "min" || options.range === "max" ) ? " ui-slider-range-" + options.range : "" ) );
-		} else {
-			this.range = $([]);
-		}
-	},
-
-	_setupEvents: function() {
-		var elements = this.handles.add( this.range ).filter( "a" );
-		this._off( elements );
-		this._on( elements, this._handleEvents );
-		this._hoverable( elements );
-		this._focusable( elements );
-	},
-
-	_destroy: function() {
-		this.handles.remove();
-		this.range.remove();
-
-		this.element
-			.removeClass( "ui-slider" +
-				" ui-slider-horizontal" +
-				" ui-slider-vertical" +
-				" ui-widget" +
-				" ui-widget-content" +
-				" ui-corner-all" );
-
-		this._mouseDestroy();
-	},
-
-	_mouseCapture: function( 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 &&
-					(i === that._lastChangedValue || that.values(i) === o.min ))) {
-				distance = thisDistance;
-				closestHandle = $( this );
-				index = i;
-			}
-		});
-
-		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().addBack().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();
-			}
-
-			//store the last changed value index for reference when handles overlap
-			this._lastChangedValue = index;
-
-			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 ( key === "range" && this.options.range === true ) {
-			if ( value === "min" ) {
-				this.options.value = this._values( 0 );
-				this.options.values = null;
-			} else if ( value === "max" ) {
-				this.options.value = this._values( this.options.values.length-1 );
-				this.options.values = null;
-			}
-		}
-
-		if ( $.isArray( this.options.values ) ) {
-			valsLength = this.options.values.length;
-		}
-
-		$.Widget.prototype._setOption.apply( this, arguments );
-
-		switch ( key ) {
-			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;
-			case "range":
-				this._animateOff = true;
-				this._refresh();
-				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 if ( this.options.values && this.options.values.length ) {
-			// .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;
-		} else {
-			return [];
-		}
-	},
-
-	// 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 } );
-			}
-		}
-	},
-
-	_handleEvents: {
-		keydown: function( event ) {
-			/*jshint maxcomplexity:25*/
-			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 );
-		},
-		click: function( event ) {
-			event.preventDefault();
-		},
-		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" );
-			}
-		}
-	}
-
-});
+  var numPages = 5;
+
+  $.widget("ui.slider", $.ui.mouse, {
+    version: "1.10.1",
+    widgetEventPrefix: "slide",
+
+    options: {
+      animate: false,
+      distance: 0,
+      max: 100,
+      min: 0,
+      orientation: "horizontal",
+      range: false,
+      step: 1,
+      value: 0,
+      values: null,
+
+      // callbacks
+      change: null,
+      slide: null,
+      start: null,
+      stop: null
+    },
+
+    _create: function () {
+      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");
+
+      this._refresh();
+      this._setOption("disabled", this.options.disabled);
+
+      this._animateOff = false;
+    },
+
+    _refresh: function () {
+      this._createRange();
+      this._createHandles();
+      this._setupEvents();
+      this._refreshValue();
+    },
+
+    _createHandles: function () {
+      var i, handleCount,
+          options = 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 = [];
+
+      handleCount = ( options.values && options.values.length ) || 1;
+
+      if (existingHandles.length > handleCount) {
+        existingHandles.slice(handleCount).remove();
+        existingHandles = existingHandles.slice(0, handleCount);
+      }
+
+      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.each(function (i) {
+        $(this).data("ui-slider-handle-index", i);
+      });
+    },
+
+    _createRange: function () {
+      var options = this.options,
+          classes = "";
+
+      if (options.range) {
+        if (options.range === true) {
+          if (!options.values) {
+            options.values = [this._valueMin(), this._valueMin()];
+          } else if (options.values.length && options.values.length !== 2) {
+            options.values = [options.values[0], options.values[0]];
+          } else if ($.isArray(options.values)) {
+            options.values = options.values.slice(0);
+          }
+        }
+
+        if (!this.range || !this.range.length) {
+          this.range = $("<div></div>")
+          .appendTo(this.element);
+
+          classes = "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 ui-corner-all";
+        } else {
+          this.range.removeClass("ui-slider-range-min ui-slider-range-max")
+          // Handle range switching from true to min/max
+          .css({
+            "left": "",
+            "bottom": ""
+          });
+        }
+
+        this.range.addClass(classes +
+            ( ( options.range === "min" || options.range === "max" )
+                ? " ui-slider-range-" + options.range : "" ));
+      } else {
+        this.range = $([]);
+      }
+    },
+
+    _setupEvents: function () {
+      var elements = this.handles.add(this.range).filter("a");
+      this._off(elements);
+      this._on(elements, this._handleEvents);
+      this._hoverable(elements);
+      this._focusable(elements);
+    },
+
+    _destroy: function () {
+      this.handles.remove();
+      this.range.remove();
+
+      this.element
+      .removeClass("ui-slider" +
+          " ui-slider-horizontal" +
+          " ui-slider-vertical" +
+          " ui-widget" +
+          " ui-widget-content" +
+          " ui-corner-all");
+
+      this._mouseDestroy();
+    },
+
+    _mouseCapture: function (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 &&
+                (i === that._lastChangedValue || that.values(i) === o.min ))) {
+          distance = thisDistance;
+          closestHandle = $(this);
+          index = i;
+        }
+      });
+
+      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().addBack().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();
+        }
+
+        //store the last changed value index for reference when handles overlap
+        this._lastChangedValue = index;
+
+        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 (key === "range" && this.options.range === true) {
+        if (value === "min") {
+          this.options.value = this._values(0);
+          this.options.values = null;
+        } else if (value === "max") {
+          this.options.value = this._values(this.options.values.length - 1);
+          this.options.values = null;
+        }
+      }
+
+      if ($.isArray(this.options.values)) {
+        valsLength = this.options.values.length;
+      }
+
+      $.Widget.prototype._setOption.apply(this, arguments);
+
+      switch (key) {
+        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;
+        case "range":
+          this._animateOff = true;
+          this._refresh();
+          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 if (this.options.values && this.options.values.length) {
+        // .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;
+      } else {
+        return [];
+      }
+    },
+
+    // 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});
+        }
+      }
+    },
+
+    _handleEvents: {
+      keydown: function (event) {
+        /*jshint maxcomplexity:25*/
+        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);
+      },
+      click: function (event) {
+        event.preventDefault();
+      },
+      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");
+        }
+      }
+    }
+
+  });
 
 }(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.10.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 + "'>&#9650;</span>" +
-			"</a>" +
-			"<a class='ui-spinner-button ui-spinner-down ui-corner-br'>" +
-				"<span class='ui-icon " + this.options.icons.down + "'>&#9660;</span>" +
-			"</a>";
-	},
-
-	_start: function( 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 );
-			}
-		}
-		if ( key === "icons" ) {
-			this.buttons.first().find( ".ui-icon" )
-				.removeClass( this.options.icons.up )
-				.addClass( value.up );
-			this.buttons.last().find( ".ui-icon" )
-				.removeClass( this.options.icons.down )
-				.addClass( value.down );
-		}
-
-		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 ) {
-		if ( this._start() ) {
-			this._spin( (steps || 1) * this.options.step );
-			this._stop();
-		}
-	},
-
-	stepDown: modifier(function( steps ) {
-		this._stepDown( steps );
-	}),
-	_stepDown: function( steps ) {
-		if ( this._start() ) {
-			this._spin( (steps || 1) * -this.options.step );
-			this._stop();
-		}
-	},
-
-	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 &&
-		decodeURIComponent( anchor.href.replace( rhash, "" ) ) ===
-			decodeURIComponent( location.href.replace( rhash, "" ) );
-}
-
-$.widget( "ui.tabs", {
-	version: "1.10.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;
-
-		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();
-		options.active = this._initialActive();
-
-		// 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( options.active );
-		} else {
-			this.active = $();
-		}
-
-		this._refresh();
-
-		if ( this.active.length ) {
-			this.load( options.active );
-		}
-	},
-
-	_initialActive: function() {
-		var active = this.options.active,
-			collapsible = this.options.collapsible,
-			locationHash = location.hash.substring( 1 );
-
-		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 = collapsible ? false : 0;
-			}
-		}
-
-		// don't allow collapsible: false and active: false
-		if ( !collapsible && active === false && this.anchors.length ) {
-			active = 0;
-		}
-
-		return active;
-	},
-
-	_getCreateEventData: function() {
-		return {
-			tab: this.active,
-			panel: !this.active.length ? $() : this._getPanelForTab( this.active )
-		};
-	},
-
-	_tabKeydown: function( event ) {
-		/*jshint maxcomplexity:15*/
-		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,
-			parent = this.element.parent();
-
-		if ( heightStyle === "fill" ) {
-			maxHeight = parent.height();
-			maxHeight -= this.element.outerHeight() - this.element.height();
-
-			this.element.siblings( ":visible" ).each(function() {
-				var elem = $( this ),
-					position = elem.css( "position" );
-
-				if ( position === "absolute" || position === "fixed" ) {
-					return;
-				}
-				maxHeight -= elem.outerHeight( true );
-			});
-
-			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" )
-			.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 )
-					.removeData( "ui-tabs-aria-controls" );
-			} else {
-				li.removeAttr( "aria-controls" );
-			}
-		});
-
-		this.panels.show();
-
-		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 );
-				});
-		}
-	},
-
-	_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 ) );
-	}
-});
-
-})( 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.10.1",
-	options: {
-		content: function() {
-			// support: IE<9, Opera in jQuery <1.7
-			// .text() can't accept undefined, so coerce to a string
-			var title = $( this ).attr( "title" ) || "";
-			// Escape title, since we're going from an attribute to raw HTML
-			return $( "<a>" ).text( title ).html();
-		},
-		hide: true,
-		// Disabled elements have inconsistent behavior across browsers (#8661)
-		items: "[title]:not([disabled])",
-		position: {
-			my: "left top+15",
-			at: "left bottom",
-			collision: "flipfit flip"
-		},
-		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 ).addBack().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 ).addBack().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 or the tooltip is already open
-		if ( !target.length || target.data( "ui-tooltip-id" ) ) {
-			return;
-		}
-
-		if ( target.attr( "title" ) ) {
-			target.data( "ui-tooltip-title", target.attr( "title" ) );
-		}
-
-		target.data( "ui-tooltip-open", true );
-
-		// kill parent tooltips, custom or native, for hover
-		if ( event && event.type === "mouseover" ) {
-			target.parents().each(function() {
-				var parent = $( this ),
-					blurEvent;
-				if ( parent.data( "ui-tooltip-open" ) ) {
-					blurEvent = $.Event( "blur" );
-					blurEvent.target = blurEvent.currentTarget = this;
-					that.close( blurEvent, true );
-				}
-				if ( parent.attr( "title" ) ) {
-					parent.uniqueId();
-					that.parents[ this.id ] = {
-						element: this,
-						title: parent.attr( "title" )
-					};
-					parent.attr( "title", "" );
-				}
-			});
-		}
-
-		this._updateContent( target, event );
-	},
-
-	_updateContent: function( target, event ) {
-		var content,
-			contentOption = this.options.content,
-			that = this,
-			eventType = event ? event.type : null;
-
-		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( "ui-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() {
-				// jQuery creates a special event for focusin when it doesn't
-				// exist natively. To improve performance, the native event
-				// object is reused and the type is changed. Therefore, we can't
-				// rely on the type being correct after the event finished
-				// bubbling, so we set it back to the previous value. (#8740)
-				if ( event ) {
-					event.type = eventType;
-				}
-				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.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 = this.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( true, 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;
-		}
-
-		// Clear the interval for delayed tracking tooltips
-		clearInterval( this.delayedShow );
-
-		// 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( "ui-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 ).attr( "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 );
-		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 dataSpace = "ui-effects-";
-
-$.effects = {
-	effect: {}
-};
-
-/*!
+(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.10.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 + "'>&#9650;</span>" +
+          "</a>" +
+          "<a class='ui-spinner-button ui-spinner-down ui-corner-br'>" +
+          "<span class='ui-icon " + this.options.icons.down + "'>&#9660;</span>"
+          +
+          "</a>";
+    },
+
+    _start: function (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);
+        }
+      }
+      if (key === "icons") {
+        this.buttons.first().find(".ui-icon")
+        .removeClass(this.options.icons.up)
+        .addClass(value.up);
+        this.buttons.last().find(".ui-icon")
+        .removeClass(this.options.icons.down)
+        .addClass(value.down);
+      }
+
+      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) {
+      if (this._start()) {
+        this._spin((steps || 1) * this.options.step);
+        this._stop();
+      }
+    },
+
+    stepDown: modifier(function (steps) {
+      this._stepDown(steps);
+    }),
+    _stepDown: function (steps) {
+      if (this._start()) {
+        this._spin((steps || 1) * -this.options.step);
+        this._stop();
+      }
+    },
+
+    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 &&
+        decodeURIComponent(anchor.href.replace(rhash, "")) ===
+        decodeURIComponent(location.href.replace(rhash, ""));
+  }
+
+  $.widget("ui.tabs", {
+    version: "1.10.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;
+
+      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();
+      options.active = this._initialActive();
+
+      // 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(options.active);
+      } else {
+        this.active = $();
+      }
+
+      this._refresh();
+
+      if (this.active.length) {
+        this.load(options.active);
+      }
+    },
+
+    _initialActive: function () {
+      var active = this.options.active,
+          collapsible = this.options.collapsible,
+          locationHash = location.hash.substring(1);
+
+      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 = collapsible ? false : 0;
+        }
+      }
+
+      // don't allow collapsible: false and active: false
+      if (!collapsible && active === false && this.anchors.length) {
+        active = 0;
+      }
+
+      return active;
+    },
+
+    _getCreateEventData: function () {
+      return {
+        tab: this.active,
+        panel: !this.active.length ? $() : this._getPanelForTab(this.active)
+      };
+    },
+
+    _tabKeydown: function (event) {
+      /*jshint maxcomplexity:15*/
+      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,
+          parent = this.element.parent();
+
+      if (heightStyle === "fill") {
+        maxHeight = parent.height();
+        maxHeight -= this.element.outerHeight() - this.element.height();
+
+        this.element.siblings(":visible").each(function () {
+          var elem = $(this),
+              position = elem.css("position");
+
+          if (position === "absolute" || position === "fixed") {
+            return;
+          }
+          maxHeight -= elem.outerHeight(true);
+        });
+
+        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")
+      .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)
+          .removeData("ui-tabs-aria-controls");
+        } else {
+          li.removeAttr("aria-controls");
+        }
+      });
+
+      this.panels.show();
+
+      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);
+        });
+      }
+    },
+
+    _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));
+    }
+  });
+
+})(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.10.1",
+    options: {
+      content: function () {
+        // support: IE<9, Opera in jQuery <1.7
+        // .text() can't accept undefined, so coerce to a string
+        var title = $(this).attr("title") || "";
+        // Escape title, since we're going from an attribute to raw HTML
+        return $("<a>").text(title).html();
+      },
+      hide: true,
+      // Disabled elements have inconsistent behavior across browsers (#8661)
+      items: "[title]:not([disabled])",
+      position: {
+        my: "left top+15",
+        at: "left bottom",
+        collision: "flipfit flip"
+      },
+      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).addBack().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).addBack().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 or the tooltip is already open
+      if (!target.length || target.data("ui-tooltip-id")) {
+        return;
+      }
+
+      if (target.attr("title")) {
+        target.data("ui-tooltip-title", target.attr("title"));
+      }
+
+      target.data("ui-tooltip-open", true);
+
+      // kill parent tooltips, custom or native, for hover
+      if (event && event.type === "mouseover") {
+        target.parents().each(function () {
+          var parent = $(this),
+              blurEvent;
+          if (parent.data("ui-tooltip-open")) {
+            blurEvent = $.Event("blur");
+            blurEvent.target = blurEvent.currentTarget = this;
+            that.close(blurEvent, true);
+          }
+          if (parent.attr("title")) {
+            parent.uniqueId();
+            that.parents[this.id] = {
+              element: this,
+              title: parent.attr("title")
+            };
+            parent.attr("title", "");
+          }
+        });
+      }
+
+      this._updateContent(target, event);
+    },
+
+    _updateContent: function (target, event) {
+      var content,
+          contentOption = this.options.content,
+          that = this,
+          eventType = event ? event.type : null;
+
+      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("ui-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 () {
+          // jQuery creates a special event for focusin when it doesn't
+          // exist natively. To improve performance, the native event
+          // object is reused and the type is changed. Therefore, we can't
+          // rely on the type being correct after the event finished
+          // bubbling, so we set it back to the previous value. (#8740)
+          if (event) {
+            event.type = eventType;
+          }
+          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.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 = this.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(true, 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;
+      }
+
+      // Clear the interval for delayed tracking tooltips
+      clearInterval(this.delayedShow);
+
+      // 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("ui-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).attr("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);
+      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 dataSpace = "ui-effects-";
+
+  $.effects = {
+    effect: {}
+  };
+
+  /*!
  * jQuery Color Animations v2.1.2
  * https://github.com/jquery/jquery-color
  *
@@ -12684,2220 +13408,2255 @@ $.effects = {
  *
  * Date: Wed Jan 16 08:47:09 2013 -0600
  */
-(function( jQuery, undefined ) {
-
-	var stepHooks = "backgroundColor borderBottomColor borderLeftColor borderRightColor borderTopColor color columnRuleColor outlineColor textDecorationColor textEmphasisColor",
-
-	// 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;
+  (function (jQuery, undefined) {
+
+    var stepHooks = "backgroundColor borderBottomColor borderLeftColor borderRightColor borderTopColor color columnRuleColor outlineColor textDecorationColor textEmphasisColor",
+
+        // 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;
+    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 ] && jQuery.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;
+    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] && jQuery.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;
-	}
-
-	// chroma (diff) == 0 means greyscale which, by definition, saturation = 0%
-	// otherwise, saturation is based on the ratio of chroma (diff) to lightness (add)
-	if ( diff === 0 ) {
-		s = 0;
-	} 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 );
-		};
-	});
-});
+    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;
+      }
+
+      // chroma (diff) == 0 means greyscale which, by definition, saturation = 0%
+      // otherwise, saturation is based on the ratio of chroma (diff) to lightness (add)
+      if (diff === 0) {
+        s = 0;
+      } 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 cssHook and .fx.step function for each named hook.
 // accept a space separated string of properties
-color.hook = function( hook ) {
-	var hooks = hook.split( " " );
-	each( hooks, function( i, hook ) {
-		jQuery.cssHooks[ hook ] = {
-			set: function( elem, value ) {
-				var parsed, curElem,
-					backgroundColor = "";
-
-				if ( value !== "transparent" && ( 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( e ) {
-					// 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 ) );
-		};
-	});
-
-};
-
-color.hook( stepHooks );
-
-jQuery.cssHooks.borderColor = {
-	expand: function( value ) {
-		var expanded = {};
-
-		each( [ "Top", "Right", "Bottom", "Left" ], function( i, part ) {
-			expanded[ "border" + part + "Color" ] = value;
-		});
-		return expanded;
-	}
-};
+    color.hook = function (hook) {
+      var hooks = hook.split(" ");
+      each(hooks, function (i, hook) {
+        jQuery.cssHooks[hook] = {
+          set: function (elem, value) {
+            var parsed, curElem,
+                backgroundColor = "";
+
+            if (value !== "transparent" && ( 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 (e) {
+              // 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));
+        };
+      });
+
+    };
+
+    color.hook(stepHooks);
+
+    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( elem ) {
-	var key, len,
-		style = elem.ownerDocument.defaultView ?
-			elem.ownerDocument.defaultView.getComputedStyle( elem, null ) :
-			elem.currentStyle,
-		styles = {};
-
-	if ( style && style.length && style[ 0 ] && style[ style[ 0 ] ] ) {
-		len = style.length;
-		while ( len-- ) {
-			key = style[ len ];
-			if ( typeof style[ key ] === "string" ) {
-				styles[ $.camelCase( key ) ] = style[ key ];
-			}
-		}
-	// support: Opera, IE <9
-	} else {
-		for ( key in style ) {
-			if ( typeof style[ key ] === "string" ) {
-				styles[ key ] = style[ key ];
-			}
-		}
-	}
-
-	return styles;
-}
-
-
-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;
-}
+    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(elem) {
+      var key, len,
+          style = elem.ownerDocument.defaultView
+              ? elem.ownerDocument.defaultView.getComputedStyle(elem, null)
+              : elem.currentStyle,
+          styles = {};
+
+      if (style && style.length && style[0] && style[style[0]]) {
+        len = style.length;
+        while (len--) {
+          key = style[len];
+          if (typeof style[key] === "string") {
+            styles[$.camelCase(key)] = style[key];
+          }
+        }
+        // support: Opera, IE <9
+      } else {
+        for (key in style) {
+          if (typeof style[key] === "string") {
+            styles[key] = style[key];
+          }
+        }
+      }
+
+      return styles;
+    }
+
+    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;
+    }
 
 // support: jQuery <1.8
-if ( !$.fn.addBack ) {
-	$.fn.addBack = function( selector ) {
-		return this.add( selector == null ?
-			this.prevObject : this.prevObject.filter( selector )
-		);
-	};
-}
-
-$.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( "*" ).addBack() : animated;
-
-		// map the animated objects to store the original styles.
-		allAnimations = allAnimations.map(function() {
-			var el = $( this );
-			return {
-				el: el,
-				start: getElementStyles( 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( 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 = $.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 arguments.length > 1 ?
-			$.effects.animateClass.call( this,
-				{ remove: classNames }, speed, easing, callback ) :
-			this._removeClass.apply( this, arguments );
-	},
-
-	_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.10.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;
-	}
-});
+    if (!$.fn.addBack) {
+      $.fn.addBack = function (selector) {
+        return this.add(
+            selector == null ? this.prevObject : this.prevObject.filter(
+                selector)
+        );
+      };
+    }
+
+    $.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("*").addBack()
+                : animated;
+
+        // map the animated objects to store the original styles.
+        allAnimations = allAnimations.map(function () {
+          var el = $(this);
+          return {
+            el: el,
+            start: getElementStyles(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(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 = $.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 arguments.length > 1 ? $.effects.animateClass.call(this,
+            {remove: classNames}, speed, easing, callback)
+            : this._removeClass.apply(this, arguments);
+      },
+
+      _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.10.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
-	return typeof speed === "string" && !$.effects.effect[ speed ];
-}
-
-$.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 ];
-
-		if ( $.fx.off || !effectMethod ) {
-			// 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 );
-			}
-		}
-
-		return queue === false ? this.each( run ) : this.queue( queue || "fx", run );
-	},
-
-	_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() {
+    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
+      return typeof speed === "string" && !$.effects.effect[speed];
+    }
+
+    $.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];
+
+        if ($.fx.off || !effectMethod) {
+          // 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);
+          }
+        }
+
+        return queue === false ? this.each(run) : this.queue(queue || "fx",
+            run);
+      },
+
+      _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;
-	};
-});
-
-})();
+    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();
-		}
-	});
-
-};
+(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.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();
-
-};
+(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.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();
-		}
-	});
-
-};
+(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.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();
-		}
-	});
-};
+(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.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();
-	}
-};
+(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.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();
-		});
-
-};
+(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();
-			}
-		});
-};
+(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();
-};
+(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(),
-			outerHeight: elem.outerHeight(),
-			outerWidth: elem.outerWidth()
-		};
-
-	$.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,
-				outerHeight: original.outerHeight * factor,
-				outerWidth: original.outerWidth * 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,
-		outerHeight: 0,
-		outerWidth: 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,
-			outerHeight: 0,
-			outerWidth: 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(),
-					outerHeight: child.outerHeight(),
-					outerWidth: child.outerWidth()
-				};
-			if (restore) {
-				$.effects.save(child, props2);
-			}
-
-			child.from = {
-				height: c_original.height * factor.from.y,
-				width: c_original.width * factor.from.x,
-				outerHeight: c_original.outerHeight * factor.from.y,
-				outerWidth: c_original.outerWidth * factor.from.x
-			};
-			child.to = {
-				height: c_original.height * factor.to.y,
-				width: c_original.width * factor.to.x,
-				outerHeight: c_original.height * factor.to.y,
-				outerWidth: 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();
-		}
-	});
-
-};
+(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(),
+          outerHeight: elem.outerHeight(),
+          outerWidth: elem.outerWidth()
+        };
+
+    $.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,
+        outerHeight: original.outerHeight * factor,
+        outerWidth: original.outerWidth * 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,
+      outerHeight: 0,
+      outerWidth: 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,
+          outerHeight: 0,
+          outerWidth: 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(),
+              outerHeight: child.outerHeight(),
+              outerWidth: child.outerWidth()
+            };
+        if (restore) {
+          $.effects.save(child, props2);
+        }
+
+        child.from = {
+          height: c_original.height * factor.from.y,
+          width: c_original.width * factor.from.x,
+          outerHeight: c_original.outerHeight * factor.from.y,
+          outerWidth: c_original.outerWidth * factor.from.x
+        };
+        child.to = {
+          height: c_original.height * factor.to.y,
+          width: c_original.width * factor.to.x,
+          outerHeight: c_original.height * factor.to.y,
+          outerWidth: 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();
-
-};
+(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();
-		}
-	});
-};
+(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();
-			});
-};
+(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/azkaban-web-server/src/web/js/jqueryui/jquery-ui-sliderAccess.js b/azkaban-web-server/src/web/js/jqueryui/jquery-ui-sliderAccess.js
index a54cf4a..4139388 100644
--- a/azkaban-web-server/src/web/js/jqueryui/jquery-ui-sliderAccess.js
+++ b/azkaban-web-server/src/web/js/jqueryui/jquery-ui-sliderAccess.js
@@ -3,87 +3,97 @@
  * By: Trent Richardson [http://trentrichardson.com]
  * Version 0.3
  * Last Modified: 10/20/2012
- * 
+ *
  * Copyright 2011 Trent Richardson
  * Dual licensed under the MIT and GPL licenses.
  * http://trentrichardson.com/Impromptu/GPL-LICENSE.txt
  * http://trentrichardson.com/Impromptu/MIT-LICENSE.txt
- * 
+ *
  */
- (function($){
+(function ($) {
 
-	$.fn.extend({
-		sliderAccess: function(options){
-			options = options || {};
-			options.touchonly = options.touchonly !== undefined? options.touchonly : true; // by default only show it if touch device
+  $.fn.extend({
+    sliderAccess: function (options) {
+      options = options || {};
+      options.touchonly = options.touchonly !== undefined ? options.touchonly
+          : true; // by default only show it if touch device
 
-			if(options.touchonly === true && !("ontouchend" in document))
-				return $(this);
-				
-			return $(this).each(function(i,obj){
-						var $t = $(this),
-							o = $.extend({},{ 
-											where: 'after',
-											step: $t.slider('option','step'), 
-											upIcon: 'ui-icon-plus', 
-											downIcon: 'ui-icon-minus',
-											text: false,
-											upText: '+',
-											downText: '-',
-											buttonset: true,
-											buttonsetTag: 'span',
-											isRTL: false
-										}, options),
-							$buttons = $('<'+ o.buttonsetTag +' class="ui-slider-access">'+
-											'<button data-icon="'+ o.downIcon +'" data-step="'+ (o.isRTL? o.step : o.step*-1) +'">'+ o.downText +'</button>'+
-											'<button data-icon="'+ o.upIcon +'" data-step="'+ (o.isRTL? o.step*-1 : o.step) +'">'+ o.upText +'</button>'+
-										'</'+ o.buttonsetTag +'>');
+      if (options.touchonly === true && !("ontouchend" in document)) {
+        return $(this);
+      }
 
-						$buttons.children('button').each(function(j, jobj){
-							var $jt = $(this);
-							$jt.button({ 
-											text: o.text, 
-											icons: { primary: $jt.data('icon') }
-										})
-								.click(function(e){
-											var step = $jt.data('step'),
-												curr = $t.slider('value'),
-												newval = curr += step*1,
-												minval = $t.slider('option','min'),
-												maxval = $t.slider('option','max'),
-												slidee = $t.slider("option", "slide") || function(){},
-												stope = $t.slider("option", "stop") || function(){};
+      return $(this).each(function (i, obj) {
+        var $t = $(this),
+            o = $.extend({}, {
+              where: 'after',
+              step: $t.slider('option', 'step'),
+              upIcon: 'ui-icon-plus',
+              downIcon: 'ui-icon-minus',
+              text: false,
+              upText: '+',
+              downText: '-',
+              buttonset: true,
+              buttonsetTag: 'span',
+              isRTL: false
+            }, options),
+            $buttons = $('<' + o.buttonsetTag + ' class="ui-slider-access">' +
+                '<button data-icon="' + o.downIcon + '" data-step="' + (o.isRTL
+                    ? o.step : o.step * -1) + '">' + o.downText + '</button>' +
+                '<button data-icon="' + o.upIcon + '" data-step="' + (o.isRTL
+                    ? o.step * -1 : o.step) + '">' + o.upText + '</button>' +
+                '</' + o.buttonsetTag + '>');
 
-											e.preventDefault();
-											
-											if(newval < minval || newval > maxval)
-												return;
-											
-											$t.slider('value', newval);
+        $buttons.children('button').each(function (j, jobj) {
+          var $jt = $(this);
+          $jt.button({
+            text: o.text,
+            icons: {primary: $jt.data('icon')}
+          })
+          .click(function (e) {
+            var step = $jt.data('step'),
+                curr = $t.slider('value'),
+                newval = curr += step * 1,
+                minval = $t.slider('option', 'min'),
+                maxval = $t.slider('option', 'max'),
+                slidee = $t.slider("option", "slide") || function () {
+                },
+                stope = $t.slider("option", "stop") || function () {
+                };
 
-											slidee.call($t, null, { value: newval });
-											stope.call($t, null, { value: newval });
-										});
-						});
-						
-						// before or after					
-						$t[o.where]($buttons);
+            e.preventDefault();
 
-						if(o.buttonset){
-							$buttons.removeClass('ui-corner-right').removeClass('ui-corner-left').buttonset();
-							$buttons.eq(0).addClass('ui-corner-left');
-							$buttons.eq(1).addClass('ui-corner-right');
-						}
+            if (newval < minval || newval > maxval) {
+              return;
+            }
 
-						// adjust the width so we don't break the original layout
-						var bOuterWidth = $buttons.css({
-									marginLeft: ((o.where == 'after' && !o.isRTL) || (o.where == 'before' && o.isRTL)? 10:0), 
-									marginRight: ((o.where == 'before' && !o.isRTL) || (o.where == 'after' && o.isRTL)? 10:0)
-								}).outerWidth(true) + 5;
-						var tOuterWidth = $t.outerWidth(true);
-						$t.css('display','inline-block').width(tOuterWidth-bOuterWidth);
-					});		
-		}
-	});
+            $t.slider('value', newval);
 
-})(jQuery);
\ No newline at end of file
+            slidee.call($t, null, {value: newval});
+            stope.call($t, null, {value: newval});
+          });
+        });
+
+        // before or after
+        $t[o.where]($buttons);
+
+        if (o.buttonset) {
+          $buttons.removeClass('ui-corner-right').removeClass(
+              'ui-corner-left').buttonset();
+          $buttons.eq(0).addClass('ui-corner-left');
+          $buttons.eq(1).addClass('ui-corner-right');
+        }
+
+        // adjust the width so we don't break the original layout
+        var bOuterWidth = $buttons.css({
+          marginLeft: ((o.where == 'after' && !o.isRTL) || (o.where == 'before'
+              && o.isRTL) ? 10 : 0),
+          marginRight: ((o.where == 'before' && !o.isRTL) || (o.where == 'after'
+              && o.isRTL) ? 10 : 0)
+        }).outerWidth(true) + 5;
+        var tOuterWidth = $t.outerWidth(true);
+        $t.css('display', 'inline-block').width(tOuterWidth - bOuterWidth);
+      });
+    }
+  });
+
+})(jQuery);
diff --git a/azkaban-web-server/src/web/js/jqueryui/jquery-ui-timepicker-addon.js b/azkaban-web-server/src/web/js/jqueryui/jquery-ui-timepicker-addon.js
index b8616da..3a13cd1 100644
--- a/azkaban-web-server/src/web/js/jqueryui/jquery-ui-timepicker-addon.js
+++ b/azkaban-web-server/src/web/js/jqueryui/jquery-ui-timepicker-addon.js
@@ -12,1871 +12,2069 @@
 
 /*jslint evil: true, white: false, undef: false, nomen: false */
 
-(function($) {
-
-	/*
-	* Lets not redefine timepicker, Prevent "Uncaught RangeError: Maximum call stack size exceeded"
-	*/
-	$.ui.timepicker = $.ui.timepicker || {};
-	if ($.ui.timepicker.version) {
-		return;
-	}
-
-	/*
-	* Extend jQueryUI, get it started with our version number
-	*/
-	$.extend($.ui, {
-		timepicker: {
-			version: "1.1.1"
-		}
-	});
-
-	/* 
-	* Timepicker manager.
-	* Use the singleton instance of this class, $.timepicker, to interact with the time picker.
-	* Settings for (groups of) time pickers are maintained in an instance object,
-	* allowing multiple different settings on the same page.
-	*/
-	function Timepicker() {
-		this.regional = []; // Available regional settings, indexed by language code
-		this.regional[''] = { // Default regional settings
-			currentText: 'Now',
-			closeText: 'Done',
-			amNames: ['AM', 'A'],
-			pmNames: ['PM', 'P'],
-			timeFormat: 'HH:mm',
-			timeSuffix: '',
-			timeOnlyTitle: 'Choose Time',
-			timeText: 'Time',
-			hourText: 'Hour',
-			minuteText: 'Minute',
-			secondText: 'Second',
-			millisecText: 'Millisecond',
-			timezoneText: 'Time Zone',
-			isRTL: false
-		};
-		this._defaults = { // Global defaults for all the datetime picker instances
-			showButtonPanel: true,
-			timeOnly: false,
-			showHour: true,
-			showMinute: true,
-			showSecond: false,
-			showMillisec: false,
-			showTimezone: false,
-			showTime: true,
-			stepHour: 1,
-			stepMinute: 1,
-			stepSecond: 1,
-			stepMillisec: 1,
-			hour: 0,
-			minute: 0,
-			second: 0,
-			millisec: 0,
-			timezone: null,
-			useLocalTimezone: false,
-			defaultTimezone: "+0000",
-			hourMin: 0,
-			minuteMin: 0,
-			secondMin: 0,
-			millisecMin: 0,
-			hourMax: 23,
-			minuteMax: 59,
-			secondMax: 59,
-			millisecMax: 999,
-			minDateTime: null,
-			maxDateTime: null,
-			onSelect: null,
-			hourGrid: 0,
-			minuteGrid: 0,
-			secondGrid: 0,
-			millisecGrid: 0,
-			alwaysSetTime: true,
-			separator: ' ',
-			altFieldTimeOnly: true,
-			altTimeFormat: null,
-			altSeparator: null,
-			altTimeSuffix: null,
-			pickerTimeFormat: null,
-			pickerTimeSuffix: null,
-			showTimepicker: true,
-			timezoneIso8601: false,
-			timezoneList: null,
-			addSliderAccess: false,
-			sliderAccessArgs: null,
-			controlType: 'slider',
-			defaultValue: null,
-			parse: 'strict'
-		};
-		$.extend(this._defaults, this.regional['']);
-	}
-
-	$.extend(Timepicker.prototype, {
-		$input: null,
-		$altInput: null,
-		$timeObj: null,
-		inst: null,
-		hour_slider: null,
-		minute_slider: null,
-		second_slider: null,
-		millisec_slider: null,
-		timezone_select: null,
-		hour: 0,
-		minute: 0,
-		second: 0,
-		millisec: 0,
-		timezone: null,
-		defaultTimezone: "+0000",
-		hourMinOriginal: null,
-		minuteMinOriginal: null,
-		secondMinOriginal: null,
-		millisecMinOriginal: null,
-		hourMaxOriginal: null,
-		minuteMaxOriginal: null,
-		secondMaxOriginal: null,
-		millisecMaxOriginal: null,
-		ampm: '',
-		formattedDate: '',
-		formattedTime: '',
-		formattedDateTime: '',
-		timezoneList: null,
-		units: ['hour','minute','second','millisec'],
-		control: null,
-
-		/* 
-		* Override the default settings for all instances of the time 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;
-		},
-
-		/*
-		* Create a new Timepicker instance
-		*/
-		_newInst: function($input, o) {
-			var tp_inst = new Timepicker(),
-				inlineSettings = {},
-                fns = {},
-		        overrides, i;
-
-			for (var attrName in this._defaults) {
-				if(this._defaults.hasOwnProperty(attrName)){
-					var attrValue = $input.attr('time:' + attrName);
-					if (attrValue) {
-						try {
-							inlineSettings[attrName] = eval(attrValue);
-						} catch (err) {
-							inlineSettings[attrName] = attrValue;
-						}
-					}
-				}
-			}
-		    overrides = {
-		        beforeShow: function (input, dp_inst) {
-		            if ($.isFunction(tp_inst._defaults.evnts.beforeShow)) {
-		                return tp_inst._defaults.evnts.beforeShow.call($input[0], input, dp_inst, tp_inst);
-		            }
-		        },
-		        onChangeMonthYear: function (year, month, dp_inst) {
-		            // Update the time as well : this prevents the time from disappearing from the $input field.
-		            tp_inst._updateDateTime(dp_inst);
-		            if ($.isFunction(tp_inst._defaults.evnts.onChangeMonthYear)) {
-		                tp_inst._defaults.evnts.onChangeMonthYear.call($input[0], year, month, dp_inst, tp_inst);
-		            }
-		        },
-		        onClose: function (dateText, dp_inst) {
-		            if (tp_inst.timeDefined === true && $input.val() !== '') {
-		                tp_inst._updateDateTime(dp_inst);
-		            }
-		            if ($.isFunction(tp_inst._defaults.evnts.onClose)) {
-		                tp_inst._defaults.evnts.onClose.call($input[0], dateText, dp_inst, tp_inst);
-		            }
-		        }
-		    };
-		    for (i in overrides) {
-		        if (overrides.hasOwnProperty(i)) {
-		            fns[i] = o[i] || null;
-		        }
-		    }
-		    tp_inst._defaults = $.extend({}, this._defaults, inlineSettings, o, overrides, {
-		        evnts:fns,
-		        timepicker: tp_inst // add timepicker as a property of datepicker: $.datepicker._get(dp_inst, 'timepicker');
-		    });
-			tp_inst.amNames = $.map(tp_inst._defaults.amNames, function(val) {
-				return val.toUpperCase();
-			});
-			tp_inst.pmNames = $.map(tp_inst._defaults.pmNames, function(val) {
-				return val.toUpperCase();
-			});
-
-			// controlType is string - key to our this._controls
-			if(typeof(tp_inst._defaults.controlType) === 'string'){
-				if($.fn[tp_inst._defaults.controlType] === undefined){
-					tp_inst._defaults.controlType = 'select';
-				}
-				tp_inst.control = tp_inst._controls[tp_inst._defaults.controlType];
-			}
-			// controlType is an object and must implement create, options, value methods
-			else{ 
-				tp_inst.control = tp_inst._defaults.controlType;
-			}
-
-			if (tp_inst._defaults.timezoneList === null) {
-				var timezoneList = ['-1200', '-1100', '-1000', '-0930', '-0900', '-0800', '-0700', '-0600', '-0500', '-0430', '-0400', '-0330', '-0300', '-0200', '-0100', '+0000', 
-									'+0100', '+0200', '+0300', '+0330', '+0400', '+0430', '+0500', '+0530', '+0545', '+0600', '+0630', '+0700', '+0800', '+0845', '+0900', '+0930', 
-									'+1000', '+1030', '+1100', '+1130', '+1200', '+1245', '+1300', '+1400'];
-
-				if (tp_inst._defaults.timezoneIso8601) {
-					timezoneList = $.map(timezoneList, function(val) {
-						return val == '+0000' ? 'Z' : (val.substring(0, 3) + ':' + val.substring(3));
-					});
-				}
-				tp_inst._defaults.timezoneList = timezoneList;
-			}
-
-			tp_inst.timezone = tp_inst._defaults.timezone;
-			tp_inst.hour = tp_inst._defaults.hour;
-			tp_inst.minute = tp_inst._defaults.minute;
-			tp_inst.second = tp_inst._defaults.second;
-			tp_inst.millisec = tp_inst._defaults.millisec;
-			tp_inst.ampm = '';
-			tp_inst.$input = $input;
-
-			if (o.altField) {
-				tp_inst.$altInput = $(o.altField).css({
-					cursor: 'pointer'
-				}).focus(function() {
-					$input.trigger("focus");
-				});
-			}
-
-			if (tp_inst._defaults.minDate === 0 || tp_inst._defaults.minDateTime === 0) {
-				tp_inst._defaults.minDate = new Date();
-			}
-			if (tp_inst._defaults.maxDate === 0 || tp_inst._defaults.maxDateTime === 0) {
-				tp_inst._defaults.maxDate = new Date();
-			}
-
-			// datepicker needs minDate/maxDate, timepicker needs minDateTime/maxDateTime..
-			if (tp_inst._defaults.minDate !== undefined && tp_inst._defaults.minDate instanceof Date) {
-				tp_inst._defaults.minDateTime = new Date(tp_inst._defaults.minDate.getTime());
-			}
-			if (tp_inst._defaults.minDateTime !== undefined && tp_inst._defaults.minDateTime instanceof Date) {
-				tp_inst._defaults.minDate = new Date(tp_inst._defaults.minDateTime.getTime());
-			}
-			if (tp_inst._defaults.maxDate !== undefined && tp_inst._defaults.maxDate instanceof Date) {
-				tp_inst._defaults.maxDateTime = new Date(tp_inst._defaults.maxDate.getTime());
-			}
-			if (tp_inst._defaults.maxDateTime !== undefined && tp_inst._defaults.maxDateTime instanceof Date) {
-				tp_inst._defaults.maxDate = new Date(tp_inst._defaults.maxDateTime.getTime());
-			}
-			tp_inst.$input.bind('focus', function() {
-				tp_inst._onFocus();
-			});
-
-			return tp_inst;
-		},
-
-		/*
-		* add our sliders to the calendar
-		*/
-		_addTimePicker: function(dp_inst) {
-			var currDT = (this.$altInput && this._defaults.altFieldTimeOnly) ? this.$input.val() + ' ' + this.$altInput.val() : this.$input.val();
-
-			this.timeDefined = this._parseTime(currDT);
-			this._limitMinMaxDateTime(dp_inst, false);
-			this._injectTimePicker();
-		},
-
-		/*
-		* parse the time string from input value or _setTime
-		*/
-		_parseTime: function(timeString, withDate) {
-			if (!this.inst) {
-				this.inst = $.datepicker._getInst(this.$input[0]);
-			}
-
-			if (withDate || !this._defaults.timeOnly) {
-				var dp_dateFormat = $.datepicker._get(this.inst, 'dateFormat');
-				try {
-					var parseRes = parseDateTimeInternal(dp_dateFormat, this._defaults.timeFormat, timeString, $.datepicker._getFormatConfig(this.inst), this._defaults);
-					if (!parseRes.timeObj) {
-						return false;
-					}
-					$.extend(this, parseRes.timeObj);
-				} catch (err) {
-					$.datepicker.log("Error parsing the date/time string: " + err +
-									"\ndate/time string = " + timeString +
-									"\ntimeFormat = " + this._defaults.timeFormat +
-									"\ndateFormat = " + dp_dateFormat);
-					return false;
-				}
-				return true;
-			} else {
-				var timeObj = $.datepicker.parseTime(this._defaults.timeFormat, timeString, this._defaults);
-				if (!timeObj) {
-					return false;
-				}
-				$.extend(this, timeObj);
-				return true;
-			}
-		},
-
-		/*
-		* generate and inject html for timepicker into ui datepicker
-		*/
-		_injectTimePicker: function() {
-			var $dp = this.inst.dpDiv,
-				o = this.inst.settings,
-				tp_inst = this,
-				litem = '',
-				uitem = '',
-				max = {},
-				gridSize = {},
-				size = null;
-
-			// Prevent displaying twice
-			if ($dp.find("div.ui-timepicker-div").length === 0 && o.showTimepicker) {
-				var noDisplay = ' style="display:none;"',
-					html = '<div class="ui-timepicker-div'+ (o.isRTL? ' ui-timepicker-rtl' : '') +'"><dl>' + '<dt class="ui_tpicker_time_label"' + ((o.showTime) ? '' : noDisplay) + '>' + o.timeText + '</dt>' + 
-								'<dd class="ui_tpicker_time"' + ((o.showTime) ? '' : noDisplay) + '></dd>';
-
-				// Create the markup
-				for(var i=0,l=this.units.length; i<l; i++){
-					litem = this.units[i];
-					uitem = litem.substr(0,1).toUpperCase() + litem.substr(1);
-					// Added by Peter Medeiros:
-					// - Figure out what the hour/minute/second max should be based on the step values.
-					// - Example: if stepMinute is 15, then minMax is 45.
-					max[litem] = parseInt((o[litem+'Max'] - ((o[litem+'Max'] - o[litem+'Min']) % o['step'+uitem])), 10);
-					gridSize[litem] = 0;
-
-					html += '<dt class="ui_tpicker_'+ litem +'_label"' + ((o['show'+uitem]) ? '' : noDisplay) + '>' + o[litem +'Text'] + '</dt>' + 
-								'<dd class="ui_tpicker_'+ litem +'"><div class="ui_tpicker_'+ litem +'_slider"' + ((o['show'+uitem]) ? '' : noDisplay) + '></div>';
-
-					if (o['show'+uitem] && o[litem+'Grid'] > 0) {
-						html += '<div style="padding-left: 1px"><table class="ui-tpicker-grid-label"><tr>';
-
-						if(litem == 'hour'){
-							for (var h = o[litem+'Min']; h <= max[litem]; h += parseInt(o[litem+'Grid'], 10)) {
-								gridSize[litem]++;
-								var tmph = $.datepicker.formatTime(useAmpm(o.pickerTimeFormat || o.timeFormat)? 'hht':'HH', {hour:h}, o);									
-								html += '<td data-for="'+litem+'">' + tmph + '</td>';
-							}
-						}
-						else{
-							for (var m = o[litem+'Min']; m <= max[litem]; m += parseInt(o[litem+'Grid'], 10)) {
-								gridSize[litem]++;
-								html += '<td data-for="'+litem+'">' + ((m < 10) ? '0' : '') + m + '</td>';
-							}
-						}
-
-						html += '</tr></table></div>';
-					}
-					html += '</dd>';
-				}
-				
-				// Timezone
-				html += '<dt class="ui_tpicker_timezone_label"' + ((o.showTimezone) ? '' : noDisplay) + '>' + o.timezoneText + '</dt>';
-				html += '<dd class="ui_tpicker_timezone" ' + ((o.showTimezone) ? '' : noDisplay) + '></dd>';
-
-				// Create the elements from string
-				html += '</dl></div>';
-				var $tp = $(html);
-
-				// if we only want time picker...
-				if (o.timeOnly === true) {
-					$tp.prepend('<div class="ui-widget-header ui-helper-clearfix ui-corner-all">' + '<div class="ui-datepicker-title">' + o.timeOnlyTitle + '</div>' + '</div>');
-					$dp.find('.ui-datepicker-header, .ui-datepicker-calendar').hide();
-				}
-				
-				// add sliders, adjust grids, add events
-				for(var i=0,l=tp_inst.units.length; i<l; i++){
-					litem = tp_inst.units[i];
-					uitem = litem.substr(0,1).toUpperCase() + litem.substr(1);
-					
-					// add the slider
-					tp_inst[litem+'_slider'] = tp_inst.control.create(tp_inst, $tp.find('.ui_tpicker_'+litem+'_slider'), litem, tp_inst[litem], o[litem+'Min'], max[litem], o['step'+uitem]);
-
-					// adjust the grid and add click event
-					if (o['show'+uitem] && o[litem+'Grid'] > 0) {
-						size = 100 * gridSize[litem] * o[litem+'Grid'] / (max[litem] - o[litem+'Min']);
-						$tp.find('.ui_tpicker_'+litem+' table').css({
-							width: size + "%",
-							marginLeft: o.isRTL? '0' : ((size / (-2 * gridSize[litem])) + "%"),
-							marginRight: o.isRTL? ((size / (-2 * gridSize[litem])) + "%") : '0',
-							borderCollapse: 'collapse'
-						}).find("td").click(function(e){
-								var $t = $(this),
-									h = $t.html(),
-									n = parseInt(h.replace(/[^0-9]/g),10),
-									ap = h.replace(/[^apm]/ig),
-									f = $t.data('for'); // loses scope, so we use data-for
-
-								if(f == 'hour'){
-									if(ap.indexOf('p') !== -1 && n < 12){
-										n += 12;
-									}
-									else{
-										if(ap.indexOf('a') !== -1 && n === 12){
-											n = 0;
-										}
-									}
-								}
-								
-								tp_inst.control.value(tp_inst, tp_inst[f+'_slider'], litem, n);
-
-								tp_inst._onTimeChange();
-								tp_inst._onSelectHandler();
-							})
-						.css({
-								cursor: 'pointer',
-								width: (100 / gridSize[litem]) + '%',
-								textAlign: 'center',
-								overflow: 'hidden'
-							});
-					} // end if grid > 0
-				} // end for loop
-
-				// Add timezone options
-				this.timezone_select = $tp.find('.ui_tpicker_timezone').append('<select></select>').find("select");
-				$.fn.append.apply(this.timezone_select,
-				$.map(o.timezoneList, function(val, idx) {
-					return $("<option />").val(typeof val == "object" ? val.value : val).text(typeof val == "object" ? val.label : val);
-				}));
-				if (typeof(this.timezone) != "undefined" && this.timezone !== null && this.timezone !== "") {
-					var local_date = new Date(this.inst.selectedYear, this.inst.selectedMonth, this.inst.selectedDay, 12);
-					var local_timezone = $.timepicker.timeZoneOffsetString(local_date);
-					if (local_timezone == this.timezone) {
-						selectLocalTimeZone(tp_inst);
-					} else {
-						this.timezone_select.val(this.timezone);
-					}
-				} else {
-					if (typeof(this.hour) != "undefined" && this.hour !== null && this.hour !== "") {
-						this.timezone_select.val(o.defaultTimezone);
-					} else {
-						selectLocalTimeZone(tp_inst);
-					}
-				}
-				this.timezone_select.change(function() {
-					tp_inst._defaults.useLocalTimezone = false;
-					tp_inst._onTimeChange();
-				});
-				// End timezone options
-				
-				// inject timepicker into datepicker
-				var $buttonPanel = $dp.find('.ui-datepicker-buttonpane');
-				if ($buttonPanel.length) {
-					$buttonPanel.before($tp);
-				} else {
-					$dp.append($tp);
-				}
-
-				this.$timeObj = $tp.find('.ui_tpicker_time');
-
-				if (this.inst !== null) {
-					var timeDefined = this.timeDefined;
-					this._onTimeChange();
-					this.timeDefined = timeDefined;
-				}
-
-				// slideAccess integration: http://trentrichardson.com/2011/11/11/jquery-ui-sliders-and-touch-accessibility/
-				if (this._defaults.addSliderAccess) {
-					var sliderAccessArgs = this._defaults.sliderAccessArgs,
-						rtl = this._defaults.isRTL;
-					sliderAccessArgs.isRTL = rtl;
-						
-					setTimeout(function() { // fix for inline mode
-						if ($tp.find('.ui-slider-access').length === 0) {
-							$tp.find('.ui-slider:visible').sliderAccess(sliderAccessArgs);
-
-							// fix any grids since sliders are shorter
-							var sliderAccessWidth = $tp.find('.ui-slider-access:eq(0)').outerWidth(true);
-							if (sliderAccessWidth) {
-								$tp.find('table:visible').each(function() {
-									var $g = $(this),
-										oldWidth = $g.outerWidth(),
-										oldMarginLeft = $g.css(rtl? 'marginRight':'marginLeft').toString().replace('%', ''),
-										newWidth = oldWidth - sliderAccessWidth,
-										newMarginLeft = ((oldMarginLeft * newWidth) / oldWidth) + '%',
-										css = { width: newWidth, marginRight: 0, marginLeft: 0 };
-									css[rtl? 'marginRight':'marginLeft'] = newMarginLeft;
-									$g.css(css);
-								});
-							}
-						}
-					}, 10);
-				}
-				// end slideAccess integration
-
-			}
-		},
-
-		/*
-		* This function tries to limit the ability to go outside the
-		* min/max date range
-		*/
-		_limitMinMaxDateTime: function(dp_inst, adjustSliders) {
-			var o = this._defaults,
-				dp_date = new Date(dp_inst.selectedYear, dp_inst.selectedMonth, dp_inst.selectedDay);
-
-			if (!this._defaults.showTimepicker) {
-				return;
-			} // No time so nothing to check here
-
-			if ($.datepicker._get(dp_inst, 'minDateTime') !== null && $.datepicker._get(dp_inst, 'minDateTime') !== undefined && dp_date) {
-				var minDateTime = $.datepicker._get(dp_inst, 'minDateTime'),
-					minDateTimeDate = new Date(minDateTime.getFullYear(), minDateTime.getMonth(), minDateTime.getDate(), 0, 0, 0, 0);
-
-				if (this.hourMinOriginal === null || this.minuteMinOriginal === null || this.secondMinOriginal === null || this.millisecMinOriginal === null) {
-					this.hourMinOriginal = o.hourMin;
-					this.minuteMinOriginal = o.minuteMin;
-					this.secondMinOriginal = o.secondMin;
-					this.millisecMinOriginal = o.millisecMin;
-				}
-
-				if (dp_inst.settings.timeOnly || minDateTimeDate.getTime() == dp_date.getTime()) {
-					this._defaults.hourMin = minDateTime.getHours();
-					if (this.hour <= this._defaults.hourMin) {
-						this.hour = this._defaults.hourMin;
-						this._defaults.minuteMin = minDateTime.getMinutes();
-						if (this.minute <= this._defaults.minuteMin) {
-							this.minute = this._defaults.minuteMin;
-							this._defaults.secondMin = minDateTime.getSeconds();
-							if (this.second <= this._defaults.secondMin) {
-								this.second = this._defaults.secondMin;
-								this._defaults.millisecMin = minDateTime.getMilliseconds();
-							} else {
-								if (this.millisec < this._defaults.millisecMin) {
-									this.millisec = this._defaults.millisecMin;
-								}
-								this._defaults.millisecMin = this.millisecMinOriginal;
-							}
-						} else {
-							this._defaults.secondMin = this.secondMinOriginal;
-							this._defaults.millisecMin = this.millisecMinOriginal;
-						}
-					} else {
-						this._defaults.minuteMin = this.minuteMinOriginal;
-						this._defaults.secondMin = this.secondMinOriginal;
-						this._defaults.millisecMin = this.millisecMinOriginal;
-					}
-				} else {
-					this._defaults.hourMin = this.hourMinOriginal;
-					this._defaults.minuteMin = this.minuteMinOriginal;
-					this._defaults.secondMin = this.secondMinOriginal;
-					this._defaults.millisecMin = this.millisecMinOriginal;
-				}
-			}
-
-			if ($.datepicker._get(dp_inst, 'maxDateTime') !== null && $.datepicker._get(dp_inst, 'maxDateTime') !== undefined && dp_date) {
-				var maxDateTime = $.datepicker._get(dp_inst, 'maxDateTime'),
-					maxDateTimeDate = new Date(maxDateTime.getFullYear(), maxDateTime.getMonth(), maxDateTime.getDate(), 0, 0, 0, 0);
-
-				if (this.hourMaxOriginal === null || this.minuteMaxOriginal === null || this.secondMaxOriginal === null) {
-					this.hourMaxOriginal = o.hourMax;
-					this.minuteMaxOriginal = o.minuteMax;
-					this.secondMaxOriginal = o.secondMax;
-					this.millisecMaxOriginal = o.millisecMax;
-				}
-
-				if (dp_inst.settings.timeOnly || maxDateTimeDate.getTime() == dp_date.getTime()) {
-					this._defaults.hourMax = maxDateTime.getHours();
-					if (this.hour >= this._defaults.hourMax) {
-						this.hour = this._defaults.hourMax;
-						this._defaults.minuteMax = maxDateTime.getMinutes();
-						if (this.minute >= this._defaults.minuteMax) {
-							this.minute = this._defaults.minuteMax;
-							this._defaults.secondMax = maxDateTime.getSeconds();
-						} else if (this.second >= this._defaults.secondMax) {
-							this.second = this._defaults.secondMax;
-							this._defaults.millisecMax = maxDateTime.getMilliseconds();
-						} else {
-							if (this.millisec > this._defaults.millisecMax) {
-								this.millisec = this._defaults.millisecMax;
-							}
-							this._defaults.millisecMax = this.millisecMaxOriginal;
-						}
-					} else {
-						this._defaults.minuteMax = this.minuteMaxOriginal;
-						this._defaults.secondMax = this.secondMaxOriginal;
-						this._defaults.millisecMax = this.millisecMaxOriginal;
-					}
-				} else {
-					this._defaults.hourMax = this.hourMaxOriginal;
-					this._defaults.minuteMax = this.minuteMaxOriginal;
-					this._defaults.secondMax = this.secondMaxOriginal;
-					this._defaults.millisecMax = this.millisecMaxOriginal;
-				}
-			}
-
-			if (adjustSliders !== undefined && adjustSliders === true) {
-				var hourMax = parseInt((this._defaults.hourMax - ((this._defaults.hourMax - this._defaults.hourMin) % this._defaults.stepHour)), 10),
-					minMax = parseInt((this._defaults.minuteMax - ((this._defaults.minuteMax - this._defaults.minuteMin) % this._defaults.stepMinute)), 10),
-					secMax = parseInt((this._defaults.secondMax - ((this._defaults.secondMax - this._defaults.secondMin) % this._defaults.stepSecond)), 10),
-					millisecMax = parseInt((this._defaults.millisecMax - ((this._defaults.millisecMax - this._defaults.millisecMin) % this._defaults.stepMillisec)), 10);
-
-				if (this.hour_slider) {
-					this.control.options(this, this.hour_slider, 'hour', { min: this._defaults.hourMin, max: hourMax });
-					this.control.value(this, this.hour_slider, 'hour', this.hour);
-				}
-				if (this.minute_slider) {
-					this.control.options(this, this.minute_slider, 'minute', { min: this._defaults.minuteMin, max: minMax });
-					this.control.value(this, this.minute_slider, 'minute', this.minute);
-				}
-				if (this.second_slider) {
-					this.control.options(this, this.second_slider, 'second', { min: this._defaults.secondMin, max: secMax });
-					this.control.value(this, this.second_slider, 'second', this.second);
-				}
-				if (this.millisec_slider) {
-					this.control.options(this, this.millisec_slider, 'millisec', { min: this._defaults.millisecMin, max: millisecMax });
-					this.control.value(this, this.millisec_slider, 'millisec', this.millisec);
-				}
-			}
-
-		},
-
-		/*
-		* when a slider moves, set the internal time...
-		* on time change is also called when the time is updated in the text field
-		*/
-		_onTimeChange: function() {
-			var hour = (this.hour_slider) ? this.control.value(this, this.hour_slider, 'hour') : false,
-				minute = (this.minute_slider) ? this.control.value(this, this.minute_slider, 'minute') : false,
-				second = (this.second_slider) ? this.control.value(this, this.second_slider, 'second') : false,
-				millisec = (this.millisec_slider) ? this.control.value(this, this.millisec_slider, 'millisec') : false,
-				timezone = (this.timezone_select) ? this.timezone_select.val() : false,
-				o = this._defaults,
-				pickerTimeFormat = o.pickerTimeFormat || o.timeFormat,
-				pickerTimeSuffix = o.pickerTimeSuffix || o.timeSuffix;
-
-			if (typeof(hour) == 'object') {
-				hour = false;
-			}
-			if (typeof(minute) == 'object') {
-				minute = false;
-			}
-			if (typeof(second) == 'object') {
-				second = false;
-			}
-			if (typeof(millisec) == 'object') {
-				millisec = false;
-			}
-			if (typeof(timezone) == 'object') {
-				timezone = false;
-			}
-
-			if (hour !== false) {
-				hour = parseInt(hour, 10);
-			}
-			if (minute !== false) {
-				minute = parseInt(minute, 10);
-			}
-			if (second !== false) {
-				second = parseInt(second, 10);
-			}
-			if (millisec !== false) {
-				millisec = parseInt(millisec, 10);
-			}
-
-			var ampm = o[hour < 12 ? 'amNames' : 'pmNames'][0];
-
-			// If the update was done in the input field, the input field should not be updated.
-			// If the update was done using the sliders, update the input field.
-			var hasChanged = (hour != this.hour || minute != this.minute || second != this.second || millisec != this.millisec 
-								|| (this.ampm.length > 0 && (hour < 12) != ($.inArray(this.ampm.toUpperCase(), this.amNames) !== -1)) 
-								|| ((this.timezone === null && timezone != this.defaultTimezone) || (this.timezone !== null && timezone != this.timezone)));
-
-			if (hasChanged) {
-
-				if (hour !== false) {
-					this.hour = hour;
-				}
-				if (minute !== false) {
-					this.minute = minute;
-				}
-				if (second !== false) {
-					this.second = second;
-				}
-				if (millisec !== false) {
-					this.millisec = millisec;
-				}
-				if (timezone !== false) {
-					this.timezone = timezone;
-				}
-
-				if (!this.inst) {
-					this.inst = $.datepicker._getInst(this.$input[0]);
-				}
-
-				this._limitMinMaxDateTime(this.inst, true);
-			}
-			if (useAmpm(o.timeFormat)) {
-				this.ampm = ampm;
-			}
-
-			// Updates the time within the timepicker
-			this.formattedTime = $.datepicker.formatTime(o.timeFormat, this, o);
-			if (this.$timeObj) {
-				if(pickerTimeFormat === o.timeFormat){
-					this.$timeObj.text(this.formattedTime + pickerTimeSuffix);
-				}
-				else{
-					this.$timeObj.text($.datepicker.formatTime(pickerTimeFormat, this, o) + pickerTimeSuffix);
-				}
-			}
-
-			this.timeDefined = true;
-			if (hasChanged) {
-				this._updateDateTime();
-			}
-		},
-
-		/*
-		* call custom onSelect.
-		* bind to sliders slidestop, and grid click.
-		*/
-		_onSelectHandler: function() {
-			var onSelect = this._defaults.onSelect || this.inst.settings.onSelect;
-			var inputEl = this.$input ? this.$input[0] : null;
-			if (onSelect && inputEl) {
-				onSelect.apply(inputEl, [this.formattedDateTime, this]);
-			}
-		},
-
-		/*
-		* update our input with the new date time..
-		*/
-		_updateDateTime: function(dp_inst) {
-			dp_inst = this.inst || dp_inst;
-			var dt = $.datepicker._daylightSavingAdjust(new Date(dp_inst.selectedYear, dp_inst.selectedMonth, dp_inst.selectedDay)),
-				dateFmt = $.datepicker._get(dp_inst, 'dateFormat'),
-				formatCfg = $.datepicker._getFormatConfig(dp_inst),
-				timeAvailable = dt !== null && this.timeDefined;
-			this.formattedDate = $.datepicker.formatDate(dateFmt, (dt === null ? new Date() : dt), formatCfg);
-			var formattedDateTime = this.formattedDate;
-
-			/*
-			* remove following lines to force every changes in date picker to change the input value
-			* Bug descriptions: when an input field has a default value, and click on the field to pop up the date picker. 
-			* If the user manually empty the value in the input field, the date picker will never change selected value.
-			*/
-			//if (dp_inst.lastVal !== undefined && (dp_inst.lastVal.length > 0 && this.$input.val().length === 0)) {
-			//	return;
-			//}
-
-			if (this._defaults.timeOnly === true) {
-				formattedDateTime = this.formattedTime;
-			} else if (this._defaults.timeOnly !== true && (this._defaults.alwaysSetTime || timeAvailable)) {
-				formattedDateTime += this._defaults.separator + this.formattedTime + this._defaults.timeSuffix;
-			}
-
-			this.formattedDateTime = formattedDateTime;
-
-			if (!this._defaults.showTimepicker) {
-				this.$input.val(this.formattedDate);
-			} else if (this.$altInput && this._defaults.altFieldTimeOnly === true) {
-				this.$altInput.val(this.formattedTime);
-				this.$input.val(this.formattedDate);
-			} else if (this.$altInput) {
-				this.$input.val(formattedDateTime);
-				var altFormattedDateTime = '',
-					altSeparator = this._defaults.altSeparator ? this._defaults.altSeparator : this._defaults.separator,
-					altTimeSuffix = this._defaults.altTimeSuffix ? this._defaults.altTimeSuffix : this._defaults.timeSuffix;
-
-				if (this._defaults.altFormat) altFormattedDateTime = $.datepicker.formatDate(this._defaults.altFormat, (dt === null ? new Date() : dt), formatCfg);
-				else altFormattedDateTime = this.formattedDate;
-				if (altFormattedDateTime) altFormattedDateTime += altSeparator;
-				if (this._defaults.altTimeFormat) altFormattedDateTime += $.datepicker.formatTime(this._defaults.altTimeFormat, this, this._defaults) + altTimeSuffix;
-				else altFormattedDateTime += this.formattedTime + altTimeSuffix;
-				this.$altInput.val(altFormattedDateTime);
-			} else {
-				this.$input.val(formattedDateTime);
-			}
-
-			this.$input.trigger("change");
-		},
-
-		_onFocus: function() {
-			if (!this.$input.val() && this._defaults.defaultValue) {
-				this.$input.val(this._defaults.defaultValue);
-				var inst = $.datepicker._getInst(this.$input.get(0)),
-					tp_inst = $.datepicker._get(inst, 'timepicker');
-				if (tp_inst) {
-					if (tp_inst._defaults.timeOnly && (inst.input.val() != inst.lastVal)) {
-						try {
-							$.datepicker._updateDatepicker(inst);
-						} catch (err) {
-							$.datepicker.log(err);
-						}
-					}
-				}
-			}
-		},
-
-		/*
-		* Small abstraction to control types
-		* We can add more, just be sure to follow the pattern: create, options, value
-		*/
-		_controls: {
-			// slider methods
-			slider: {
-				create: function(tp_inst, obj, unit, val, min, max, step){
-					var rtl = tp_inst._defaults.isRTL; // if rtl go -60->0 instead of 0->60
-					return obj.prop('slide', null).slider({
-						orientation: "horizontal",
-						value: rtl? val*-1 : val,
-						min: rtl? max*-1 : min,
-						max: rtl? min*-1 : max,
-						step: step,
-						slide: function(event, ui) {
-							tp_inst.control.value(tp_inst, $(this), unit, rtl? ui.value*-1:ui.value);
-							tp_inst._onTimeChange();
-						},
-						stop: function(event, ui) {
-							tp_inst._onSelectHandler();
-						}
-					});	
-				},
-				options: function(tp_inst, obj, unit, opts, val){
-					if(tp_inst._defaults.isRTL){
-						if(typeof(opts) == 'string'){
-							if(opts == 'min' || opts == 'max'){
-								if(val !== undefined)
-									return obj.slider(opts, val*-1);
-								return Math.abs(obj.slider(opts));
-							}
-							return obj.slider(opts);
-						}
-						var min = opts.min, 
-							max = opts.max;
-						opts.min = opts.max = null;
-						if(min !== undefined)
-							opts.max = min * -1;
-						if(max !== undefined)
-							opts.min = max * -1;
-						return obj.slider(opts);
-					}
-					if(typeof(opts) == 'string' && val !== undefined)
-							return obj.slider(opts, val);
-					return obj.slider(opts);
-				},
-				value: function(tp_inst, obj, unit, val){
-					if(tp_inst._defaults.isRTL){
-						if(val !== undefined)
-							return obj.slider('value', val*-1);
-						return Math.abs(obj.slider('value'));
-					}
-					if(val !== undefined)
-						return obj.slider('value', val);
-					return obj.slider('value');
-				}
-			},
-			// select methods
-			select: {
-				create: function(tp_inst, obj, unit, val, min, max, step){
-					var sel = '<select class="ui-timepicker-select" data-unit="'+ unit +'" data-min="'+ min +'" data-max="'+ max +'" data-step="'+ step +'">',
-						ul = tp_inst._defaults.timeFormat.indexOf('t') !== -1? 'toLowerCase':'toUpperCase',
-						m = 0;
-
-					for(var i=min; i<=max; i+=step){						
-						sel += '<option value="'+ i +'"'+ (i==val? ' selected':'') +'>';
-						if(unit == 'hour' && useAmpm(tp_inst._defaults.pickerTimeFormat || tp_inst._defaults.timeFormat))
-							sel += $.datepicker.formatTime("hh TT", {hour:i}, tp_inst._defaults);
-						else if(unit == 'millisec' || i >= 10) sel += i;
-						else sel += '0'+ i.toString();
-						sel += '</option>';
-					}
-					sel += '</select>';
-
-					obj.children('select').remove();
-
-					$(sel).appendTo(obj).change(function(e){
-						tp_inst._onTimeChange();
-						tp_inst._onSelectHandler();
-					});
-
-					return obj;
-				},
-				options: function(tp_inst, obj, unit, opts, val){
-					var o = {},
-						$t = obj.children('select');
-					if(typeof(opts) == 'string'){
-						if(val === undefined)
-							return $t.data(opts);
-						o[opts] = val;	
-					}
-					else o = opts;
-					return tp_inst.control.create(tp_inst, obj, $t.data('unit'), $t.val(), o.min || $t.data('min'), o.max || $t.data('max'), o.step || $t.data('step'));
-				},
-				value: function(tp_inst, obj, unit, val){
-					var $t = obj.children('select');
-					if(val !== undefined)
-						return $t.val(val);
-					return $t.val();
-				}
-			}
-		} // end _controls
-
-	});
-
-	$.fn.extend({
-		/*
-		* shorthand just to use timepicker..
-		*/
-		timepicker: function(o) {
-			o = o || {};
-			var tmp_args = Array.prototype.slice.call(arguments);
-
-			if (typeof o == 'object') {
-				tmp_args[0] = $.extend(o, {
-					timeOnly: true
-				});
-			}
-
-			return $(this).each(function() {
-				$.fn.datetimepicker.apply($(this), tmp_args);
-			});
-		},
-
-		/*
-		* extend timepicker to datepicker
-		*/
-		datetimepicker: function(o) {
-			o = o || {};
-			var tmp_args = arguments;
-
-			if (typeof(o) == 'string') {
-				if (o == 'getDate') {
-					return $.fn.datepicker.apply($(this[0]), tmp_args);
-				} else {
-					return this.each(function() {
-						var $t = $(this);
-						$t.datepicker.apply($t, tmp_args);
-					});
-				}
-			} else {
-				return this.each(function() {
-					var $t = $(this);
-					$t.datepicker($.timepicker._newInst($t, o)._defaults);
-				});
-			}
-		}
-	});
-
-	/*
-	* Public Utility to parse date and time
-	*/
-	$.datepicker.parseDateTime = function(dateFormat, timeFormat, dateTimeString, dateSettings, timeSettings) {
-		var parseRes = parseDateTimeInternal(dateFormat, timeFormat, dateTimeString, dateSettings, timeSettings);
-		if (parseRes.timeObj) {
-			var t = parseRes.timeObj;
-			parseRes.date.setHours(t.hour, t.minute, t.second, t.millisec);
-		}
-
-		return parseRes.date;
-	};
-
-	/*
-	* Public utility to parse time
-	*/
-	$.datepicker.parseTime = function(timeFormat, timeString, options) {		
-		var o = extendRemove(extendRemove({}, $.timepicker._defaults), options || {});
-
-		// Strict parse requires the timeString to match the timeFormat exactly
-		var strictParse = function(f, s, o){
-
-			// pattern for standard and localized AM/PM markers
-			var getPatternAmpm = function(amNames, pmNames) {
-				var markers = [];
-				if (amNames) {
-					$.merge(markers, amNames);
-				}
-				if (pmNames) {
-					$.merge(markers, pmNames);
-				}
-				markers = $.map(markers, function(val) {
-					return val.replace(/[.*+?|()\[\]{}\\]/g, '\\$&');
-				});
-				return '(' + markers.join('|') + ')?';
-			};
-
-			// figure out position of time elements.. cause js cant do named captures
-			var getFormatPositions = function(timeFormat) {
-				var finds = timeFormat.toLowerCase().match(/(h{1,2}|m{1,2}|s{1,2}|l{1}|t{1,2}|z|'.*?')/g),
-					orders = {
-						h: -1,
-						m: -1,
-						s: -1,
-						l: -1,
-						t: -1,
-						z: -1
-					};
-
-				if (finds) {
-					for (var i = 0; i < finds.length; i++) {
-						if (orders[finds[i].toString().charAt(0)] == -1) {
-							orders[finds[i].toString().charAt(0)] = i + 1;
-						}
-					}
-				}
-				return orders;
-			};
-
-			var regstr = '^' + f.toString()
-					.replace(/([hH]{1,2}|mm?|ss?|[tT]{1,2}|[lz]|'.*?')/g, function (match) {
-							switch (match.charAt(0).toLowerCase()) {
-								case 'h': return '(\\d?\\d)';
-								case 'm': return '(\\d?\\d)';
-								case 's': return '(\\d?\\d)';
-								case 'l': return '(\\d?\\d?\\d)';
-								case 'z': return '(z|[-+]\\d\\d:?\\d\\d|\\S+)?';
-								case 't': return getPatternAmpm(o.amNames, o.pmNames);
-								default:    // literal escaped in quotes
-									return '(' + match.replace(/\'/g, "").replace(/(\.|\$|\^|\\|\/|\(|\)|\[|\]|\?|\+|\*)/g, function (m) { return "\\" + m; }) + ')?';
-							}
-						})
-					.replace(/\s/g, '\\s?') +
-					o.timeSuffix + '$',
-				order = getFormatPositions(f),
-				ampm = '',
-				treg;
-
-			treg = s.match(new RegExp(regstr, 'i'));
-
-			var resTime = {
-				hour: 0,
-				minute: 0,
-				second: 0,
-				millisec: 0
-			};
-
-			if (treg) {
-				if (order.t !== -1) {
-					if (treg[order.t] === undefined || treg[order.t].length === 0) {
-						ampm = '';
-						resTime.ampm = '';
-					} else {
-						ampm = $.inArray(treg[order.t].toUpperCase(), o.amNames) !== -1 ? 'AM' : 'PM';
-						resTime.ampm = o[ampm == 'AM' ? 'amNames' : 'pmNames'][0];
-					}
-				}
-
-				if (order.h !== -1) {
-					if (ampm == 'AM' && treg[order.h] == '12') {
-						resTime.hour = 0; // 12am = 0 hour
-					} else {
-						if (ampm == 'PM' && treg[order.h] != '12') {
-							resTime.hour = parseInt(treg[order.h], 10) + 12; // 12pm = 12 hour, any other pm = hour + 12
-						} else {
-							resTime.hour = Number(treg[order.h]);
-						}
-					}
-				}
-
-				if (order.m !== -1) {
-					resTime.minute = Number(treg[order.m]);
-				}
-				if (order.s !== -1) {
-					resTime.second = Number(treg[order.s]);
-				}
-				if (order.l !== -1) {
-					resTime.millisec = Number(treg[order.l]);
-				}
-				if (order.z !== -1 && treg[order.z] !== undefined) {
-					var tz = treg[order.z].toUpperCase();
-					switch (tz.length) {
-					case 1:
-						// Z
-						tz = o.timezoneIso8601 ? 'Z' : '+0000';
-						break;
-					case 5:
-						// +hhmm
-						if (o.timezoneIso8601) {
-							tz = tz.substring(1) == '0000' ? 'Z' : tz.substring(0, 3) + ':' + tz.substring(3);
-						}
-						break;
-					case 6:
-						// +hh:mm
-						if (!o.timezoneIso8601) {
-							tz = tz == 'Z' || tz.substring(1) == '00:00' ? '+0000' : tz.replace(/:/, '');
-						} else {
-							if (tz.substring(1) == '00:00') {
-								tz = 'Z';
-							}
-						}
-						break;
-					}
-					resTime.timezone = tz;
-				}
-
-
-				return resTime;
-			}
-			return false;
-		};// end strictParse
-
-		// First try JS Date, if that fails, use strictParse
-		var looseParse = function(f,s,o){
-			try{
-				var d = new Date('2012-01-01 '+ s);
-				return {
-					hour: d.getHours(),
-					minutes: d.getMinutes(),
-					seconds: d.getSeconds(),
-					millisec: d.getMilliseconds(),
-					timezone: $.timepicker.timeZoneOffsetString(d)
-				};
-			}
-			catch(err){
-				try{
-					return strictParse(f,s,o);
-				}
-				catch(err2){
-					$.datepicker.log("Unable to parse \ntimeString: "+ s +"\ntimeFormat: "+ f);
-				}				
-			}
-			return false;
-		}; // end looseParse
-		
-		if(typeof o.parse === "function"){
-			return o.parse(timeFormat, timeString, o)
-		}
-		if(o.parse === 'loose'){
-			return looseParse(timeFormat, timeString, o);
-		}
-		return strictParse(timeFormat, timeString, o);
-	};
-
-	/*
-	* Public utility to format the time
-	* format = string format of the time
-	* time = a {}, not a Date() for timezones
-	* options = essentially the regional[].. amNames, pmNames, ampm
-	*/
-	$.datepicker.formatTime = function(format, time, options) {
-		options = options || {};
-		options = $.extend({}, $.timepicker._defaults, options);
-		time = $.extend({
-			hour: 0,
-			minute: 0,
-			second: 0,
-			millisec: 0,
-			timezone: '+0000'
-		}, time);
-
-		var tmptime = format,
-			ampmName = options.amNames[0],
-			hour = parseInt(time.hour, 10);
-
-		if (hour > 11) {
-			ampmName = options.pmNames[0];
-		}
-
-		tmptime = tmptime.replace(/(?:HH?|hh?|mm?|ss?|[tT]{1,2}|[lz]|('.*?'|".*?"))/g, function(match) {
-		switch (match) {
-			case 'HH':
-				return ('0' + hour).slice(-2);
-			case 'H':
-				return hour;
-			case 'hh':
-				return ('0' + convert24to12(hour)).slice(-2);
-			case 'h':
-				return convert24to12(hour);
-			case 'mm':
-				return ('0' + time.minute).slice(-2);
-			case 'm':
-				return time.minute;
-			case 'ss':
-				return ('0' + time.second).slice(-2);
-			case 's':
-				return time.second;
-			case 'l':
-				return ('00' + time.millisec).slice(-3);
-			case 'z':
-				return time.timezone === null? options.defaultTimezone : time.timezone;
-			case 'T': 
-				return ampmName.charAt(0).toUpperCase();
-			case 'TT': 
-				return ampmName.toUpperCase();
-			case 't':
-				return ampmName.charAt(0).toLowerCase();
-			case 'tt':
-				return ampmName.toLowerCase();
-			default:
-				return match.replace(/\'/g, "") || "'";
-			}
-		});
-
-		tmptime = $.trim(tmptime);
-		return tmptime;
-	};
-
-	/*
-	* the bad hack :/ override datepicker so it doesnt close on select
-	// inspired: http://stackoverflow.com/questions/1252512/jquery-datepicker-prevent-closing-picker-when-clicking-a-date/1762378#1762378
-	*/
-	$.datepicker._base_selectDate = $.datepicker._selectDate;
-	$.datepicker._selectDate = function(id, dateStr) {
-		var inst = this._getInst($(id)[0]),
-			tp_inst = this._get(inst, 'timepicker');
-
-		if (tp_inst) {
-			tp_inst._limitMinMaxDateTime(inst, true);
-			inst.inline = inst.stay_open = true;
-			//This way the onSelect handler called from calendarpicker get the full dateTime
-			this._base_selectDate(id, dateStr);
-			inst.inline = inst.stay_open = false;
-			this._notifyChange(inst);
-			this._updateDatepicker(inst);
-		} else {
-			this._base_selectDate(id, dateStr);
-		}
-	};
-
-	/*
-	* second bad hack :/ override datepicker so it triggers an event when changing the input field
-	* and does not redraw the datepicker on every selectDate event
-	*/
-	$.datepicker._base_updateDatepicker = $.datepicker._updateDatepicker;
-	$.datepicker._updateDatepicker = function(inst) {
-
-		// don't popup the datepicker if there is another instance already opened
-		var input = inst.input[0];
-		if ($.datepicker._curInst && $.datepicker._curInst != inst && $.datepicker._datepickerShowing && $.datepicker._lastInput != input) {
-			return;
-		}
-
-		if (typeof(inst.stay_open) !== 'boolean' || inst.stay_open === false) {
-
-			this._base_updateDatepicker(inst);
-
-			// Reload the time control when changing something in the input text field.
-			var tp_inst = this._get(inst, 'timepicker');
-			if (tp_inst) {
-				tp_inst._addTimePicker(inst);
-
-				if (tp_inst._defaults.useLocalTimezone) { //checks daylight saving with the new date.
-					var date = new Date(inst.selectedYear, inst.selectedMonth, inst.selectedDay, 12);
-					selectLocalTimeZone(tp_inst, date);
-					tp_inst._onTimeChange();
-				}
-			}
-		}
-	};
-
-	/*
-	* third bad hack :/ override datepicker so it allows spaces and colon in the input field
-	*/
-	$.datepicker._base_doKeyPress = $.datepicker._doKeyPress;
-	$.datepicker._doKeyPress = function(event) {
-		var inst = $.datepicker._getInst(event.target),
-			tp_inst = $.datepicker._get(inst, 'timepicker');
-
-		if (tp_inst) {
-			if ($.datepicker._get(inst, 'constrainInput')) {
-				var ampm = useAmpm(tp_inst._defaults.timeFormat),
-					dateChars = $.datepicker._possibleChars($.datepicker._get(inst, 'dateFormat')),
-					datetimeChars = tp_inst._defaults.timeFormat.toString()
-											.replace(/[hms]/g, '')
-											.replace(/TT/g, ampm ? 'APM' : '')
-											.replace(/Tt/g, ampm ? 'AaPpMm' : '')
-											.replace(/tT/g, ampm ? 'AaPpMm' : '')
-											.replace(/T/g, ampm ? 'AP' : '')
-											.replace(/tt/g, ampm ? 'apm' : '')
-											.replace(/t/g, ampm ? 'ap' : '') + 
-											" " + tp_inst._defaults.separator + 
-											tp_inst._defaults.timeSuffix + 
-											(tp_inst._defaults.showTimezone ? tp_inst._defaults.timezoneList.join('') : '') + 
-											(tp_inst._defaults.amNames.join('')) + (tp_inst._defaults.pmNames.join('')) + 
-											dateChars,
-					chr = String.fromCharCode(event.charCode === undefined ? event.keyCode : event.charCode);
-				return event.ctrlKey || (chr < ' ' || !dateChars || datetimeChars.indexOf(chr) > -1);
-			}
-		}
-
-		return $.datepicker._base_doKeyPress(event);
-	};
-
-	/*
-	* Fourth bad hack :/ override _updateAlternate function used in inline mode to init altField
-	*/
-	$.datepicker._base_updateAlternate = $.datepicker._updateAlternate;
-	/* Update any alternate field to synchronise with the main field. */
-	$.datepicker._updateAlternate = function(inst) {
-		var tp_inst = this._get(inst, 'timepicker');
-		if(tp_inst){
-			var altField = tp_inst._defaults.altField;
-			if (altField) { // update alternate field too
-				var altFormat = tp_inst._defaults.altFormat || tp_inst._defaults.dateFormat,
-					date = this._getDate(inst),
-					formatCfg = $.datepicker._getFormatConfig(inst),
-					altFormattedDateTime = '', 
-					altSeparator = tp_inst._defaults.altSeparator ? tp_inst._defaults.altSeparator : tp_inst._defaults.separator, 
-					altTimeSuffix = tp_inst._defaults.altTimeSuffix ? tp_inst._defaults.altTimeSuffix : tp_inst._defaults.timeSuffix,
-					altTimeFormat = tp_inst._defaults.altTimeFormat !== null ? tp_inst._defaults.altTimeFormat : tp_inst._defaults.timeFormat;
-				
-				altFormattedDateTime += $.datepicker.formatTime(altTimeFormat, tp_inst, tp_inst._defaults) + altTimeSuffix;
-				if(!tp_inst._defaults.timeOnly && !tp_inst._defaults.altFieldTimeOnly){
-					if(tp_inst._defaults.altFormat)
-						altFormattedDateTime = $.datepicker.formatDate(tp_inst._defaults.altFormat, (date === null ? new Date() : date), formatCfg) + altSeparator + altFormattedDateTime;
-					else altFormattedDateTime = tp_inst.formattedDate + altSeparator + altFormattedDateTime;
-				}
-				$(altField).val(altFormattedDateTime);
-			}
-		}
-		else{
-			$.datepicker._base_updateAlternate(inst);
-		}
-	};
-
-	/*
-	* Override key up event to sync manual input changes.
-	*/
-	$.datepicker._base_doKeyUp = $.datepicker._doKeyUp;
-	$.datepicker._doKeyUp = function(event) {
-		var inst = $.datepicker._getInst(event.target),
-			tp_inst = $.datepicker._get(inst, 'timepicker');
-
-		if (tp_inst) {
-			if (tp_inst._defaults.timeOnly && (inst.input.val() != inst.lastVal)) {
-				try {
-					$.datepicker._updateDatepicker(inst);
-				} catch (err) {
-					$.datepicker.log(err);
-				}
-			}
-		}
-
-		return $.datepicker._base_doKeyUp(event);
-	};
-
-	/*
-	* override "Today" button to also grab the time.
-	*/
-	$.datepicker._base_gotoToday = $.datepicker._gotoToday;
-	$.datepicker._gotoToday = function(id) {
-		var inst = this._getInst($(id)[0]),
-			$dp = inst.dpDiv;
-		this._base_gotoToday(id);
-		var tp_inst = this._get(inst, 'timepicker');
-		selectLocalTimeZone(tp_inst);
-		var now = new Date();
-		this._setTime(inst, now);
-		$('.ui-datepicker-today', $dp).click();
-	};
-
-	/*
-	* Disable & enable the Time in the datetimepicker
-	*/
-	$.datepicker._disableTimepickerDatepicker = function(target) {
-		var inst = this._getInst(target);
-		if (!inst) {
-			return;
-		}
-
-		var tp_inst = this._get(inst, 'timepicker');
-		$(target).datepicker('getDate'); // Init selected[Year|Month|Day]
-		if (tp_inst) {
-			tp_inst._defaults.showTimepicker = false;
-			tp_inst._updateDateTime(inst);
-		}
-	};
-
-	$.datepicker._enableTimepickerDatepicker = function(target) {
-		var inst = this._getInst(target);
-		if (!inst) {
-			return;
-		}
-
-		var tp_inst = this._get(inst, 'timepicker');
-		$(target).datepicker('getDate'); // Init selected[Year|Month|Day]
-		if (tp_inst) {
-			tp_inst._defaults.showTimepicker = true;
-			tp_inst._addTimePicker(inst); // Could be disabled on page load
-			tp_inst._updateDateTime(inst);
-		}
-	};
-
-	/*
-	* Create our own set time function
-	*/
-	$.datepicker._setTime = function(inst, date) {
-		var tp_inst = this._get(inst, 'timepicker');
-		if (tp_inst) {
-			var defaults = tp_inst._defaults;
-
-			// calling _setTime with no date sets time to defaults
-			tp_inst.hour = date ? date.getHours() : defaults.hour;
-			tp_inst.minute = date ? date.getMinutes() : defaults.minute;
-			tp_inst.second = date ? date.getSeconds() : defaults.second;
-			tp_inst.millisec = date ? date.getMilliseconds() : defaults.millisec;
-
-			//check if within min/max times.. 
-			tp_inst._limitMinMaxDateTime(inst, true);
-
-			tp_inst._onTimeChange();
-			tp_inst._updateDateTime(inst);
-		}
-	};
-
-	/*
-	* Create new public method to set only time, callable as $().datepicker('setTime', date)
-	*/
-	$.datepicker._setTimeDatepicker = function(target, date, withDate) {
-		var inst = this._getInst(target);
-		if (!inst) {
-			return;
-		}
-
-		var tp_inst = this._get(inst, 'timepicker');
-
-		if (tp_inst) {
-			this._setDateFromField(inst);
-			var tp_date;
-			if (date) {
-				if (typeof date == "string") {
-					tp_inst._parseTime(date, withDate);
-					tp_date = new Date();
-					tp_date.setHours(tp_inst.hour, tp_inst.minute, tp_inst.second, tp_inst.millisec);
-				} else {
-					tp_date = new Date(date.getTime());
-				}
-				if (tp_date.toString() == 'Invalid Date') {
-					tp_date = undefined;
-				}
-				this._setTime(inst, tp_date);
-			}
-		}
-
-	};
-
-	/*
-	* override setDate() to allow setting time too within Date object
-	*/
-	$.datepicker._base_setDateDatepicker = $.datepicker._setDateDatepicker;
-	$.datepicker._setDateDatepicker = function(target, date) {
-		var inst = this._getInst(target);
-		if (!inst) {
-			return;
-		}
-
-		var tp_date = (date instanceof Date) ? new Date(date.getTime()) : date;
-
-		this._updateDatepicker(inst);
-		this._base_setDateDatepicker.apply(this, arguments);
-		this._setTimeDatepicker(target, tp_date, true);
-	};
-
-	/*
-	* override getDate() to allow getting time too within Date object
-	*/
-	$.datepicker._base_getDateDatepicker = $.datepicker._getDateDatepicker;
-	$.datepicker._getDateDatepicker = function(target, noDefault) {
-		var inst = this._getInst(target);
-		if (!inst) {
-			return;
-		}
-
-		var tp_inst = this._get(inst, 'timepicker');
-
-		if (tp_inst) {
-			// if it hasn't yet been defined, grab from field
-			if(inst.lastVal === undefined){
-				this._setDateFromField(inst, noDefault);
-			}
-
-			var date = this._getDate(inst);
-			if (date && tp_inst._parseTime($(target).val(), tp_inst.timeOnly)) {
-				date.setHours(tp_inst.hour, tp_inst.minute, tp_inst.second, tp_inst.millisec);
-			}
-			return date;
-		}
-		return this._base_getDateDatepicker(target, noDefault);
-	};
-
-	/*
-	* override parseDate() because UI 1.8.14 throws an error about "Extra characters"
-	* An option in datapicker to ignore extra format characters would be nicer.
-	*/
-	$.datepicker._base_parseDate = $.datepicker.parseDate;
-	$.datepicker.parseDate = function(format, value, settings) {
-		var date;
-		try {
-			date = this._base_parseDate(format, value, settings);
-		} catch (err) {
-			// Hack!  The error message ends with a colon, a space, and
-			// the "extra" characters.  We rely on that instead of
-			// attempting to perfectly reproduce the parsing algorithm.
-			date = this._base_parseDate(format, value.substring(0,value.length-(err.length-err.indexOf(':')-2)), settings);
-			$.datepicker.log("Error parsing the date string: " + err + "\ndate string = " + value + "\ndate format = " + format);
-		}
-		return date;
-	};
-
-	/*
-	* override formatDate to set date with time to the input
-	*/
-	$.datepicker._base_formatDate = $.datepicker._formatDate;
-	$.datepicker._formatDate = function(inst, day, month, year) {
-		var tp_inst = this._get(inst, 'timepicker');
-		if (tp_inst) {
-			tp_inst._updateDateTime(inst);
-			return tp_inst.$input.val();
-		}
-		return this._base_formatDate(inst);
-	};
-
-	/*
-	* override options setter to add time to maxDate(Time) and minDate(Time). MaxDate
-	*/
-	$.datepicker._base_optionDatepicker = $.datepicker._optionDatepicker;
-	$.datepicker._optionDatepicker = function(target, name, value) {
-		var inst = this._getInst(target),
-	        name_clone;
-		if (!inst) {
-			return null;
-		}
-
-		var tp_inst = this._get(inst, 'timepicker');
-		if (tp_inst) {
-			var min = null,
-				max = null,
-				onselect = null,
-				overrides = tp_inst._defaults.evnts,
-				fns = {},
-				prop;
-		    if (typeof name == 'string') { // if min/max was set with the string
-		        if (name === 'minDate' || name === 'minDateTime') {
-		            min = value;
-		        } else if (name === 'maxDate' || name === 'maxDateTime') {
-		            max = value;
-		        } else if (name === 'onSelect') {
-		            onselect = value;
-		        } else if (overrides.hasOwnProperty(name)) {
-		            if (typeof (value) === 'undefined') {
-		                return overrides[name];
-		            }
-		            fns[name] = value;
-		            name_clone = {}; //empty results in exiting function after overrides updated
-		        }
-		    } else if (typeof name == 'object') { //if min/max was set with the JSON
-		        if (name.minDate) {
-		            min = name.minDate;
-		        } else if (name.minDateTime) {
-		            min = name.minDateTime;
-		        } else if (name.maxDate) {
-		            max = name.maxDate;
-		        } else if (name.maxDateTime) {
-		            max = name.maxDateTime;
-		        }
-		        for (prop in overrides) {
-		            if (overrides.hasOwnProperty(prop) && name[prop]) {
-		                fns[prop] = name[prop];
-		            }
-		        }
-		    }
-		    for (prop in fns) {
-		        if (fns.hasOwnProperty(prop)) {
-		            overrides[prop] = fns[prop];
-		            if (!name_clone) { name_clone = $.extend({}, name);}
-		            delete name_clone[prop];
-		        }
-		    }
-		    if (name_clone && isEmptyObject(name_clone)) { return; }
-		    if (min) { //if min was set
-		        if (min === 0) {
-		            min = new Date();
-		        } else {
-		            min = new Date(min);
-		        }
-		        tp_inst._defaults.minDate = min;
-		        tp_inst._defaults.minDateTime = min;
-		    } else if (max) { //if max was set
-		        if (max === 0) {
-		            max = new Date();
-		        } else {
-		            max = new Date(max);
-		        }
-		        tp_inst._defaults.maxDate = max;
-		        tp_inst._defaults.maxDateTime = max;
-		    } else if (onselect) {
-		        tp_inst._defaults.onSelect = onselect;
-		    }
-		}
-		if (value === undefined) {
-			return this._base_optionDatepicker.call($.datepicker, target, name);
-		}
-		return this._base_optionDatepicker.call($.datepicker, target, name_clone || name, value);
-	};
-	/*
-	* jQuery isEmptyObject does not check hasOwnProperty - if someone has added to the object prototype,
-	* it will return false for all objects
-	*/
-	var isEmptyObject = function(obj) {
-		var prop;
-		for (prop in obj) {
-			if (obj.hasOwnProperty(obj)) {
-				return false;
-			}
-		}
-		return true;
-	};
-
-	/*
-	* jQuery extend now ignores nulls!
-	*/
-	var extendRemove = function(target, props) {
-		$.extend(target, props);
-		for (var name in props) {
-			if (props[name] === null || props[name] === undefined) {
-				target[name] = props[name];
-			}
-		}
-		return target;
-	};
-
-	/*
-	* Determine by the time format if should use ampm
-	* Returns true if should use ampm, false if not
-	*/
-	var useAmpm = function(timeFormat){
-		return (timeFormat.indexOf('t') !== -1 && timeFormat.indexOf('h') !== -1);
-	};
-
-	/*
-	* Converts 24 hour format into 12 hour
-	* Returns 12 hour without leading 0
-	*/
-	var convert24to12 = function(hour) {
-		if (hour > 12) {
-			hour = hour - 12;
-		}
-
-		if (hour == 0) {
-			hour = 12;
-		}
-
-		return String(hour);
-	};
-
-	/*
-	* Splits datetime string into date ans time substrings.
-	* Throws exception when date can't be parsed
-	* Returns [dateString, timeString]
-	*/
-	var splitDateTime = function(dateFormat, dateTimeString, dateSettings, timeSettings) {
-		try {
-			// The idea is to get the number separator occurances in datetime and the time format requested (since time has 
-			// fewer unknowns, mostly numbers and am/pm). We will use the time pattern to split.
-			var separator = timeSettings && timeSettings.separator ? timeSettings.separator : $.timepicker._defaults.separator,
-				format = timeSettings && timeSettings.timeFormat ? timeSettings.timeFormat : $.timepicker._defaults.timeFormat,
-				timeParts = format.split(separator), // how many occurances of separator may be in our format?
-				timePartsLen = timeParts.length,
-				allParts = dateTimeString.split(separator),
-				allPartsLen = allParts.length;
-
-			if (allPartsLen > 1) {
-				return [
-						allParts.splice(0,allPartsLen-timePartsLen).join(separator),
-						allParts.splice(0,timePartsLen).join(separator)
-					];
-			}
-
-		} catch (err) {
-			$.datepicker.log('Could not split the date from the time. Please check the following datetimepicker options' +
-					"\nthrown error: " + err +
-					"\ndateTimeString" + dateTimeString +
-					"\ndateFormat = " + dateFormat +
-					"\nseparator = " + timeSettings.separator +
-					"\ntimeFormat = " + timeSettings.timeFormat);
-
-			if (err.indexOf(":") >= 0) {
-				// Hack!  The error message ends with a colon, a space, and
-				// the "extra" characters.  We rely on that instead of
-				// attempting to perfectly reproduce the parsing algorithm.
-				var dateStringLength = dateTimeString.length - (err.length - err.indexOf(':') - 2),
-					timeString = dateTimeString.substring(dateStringLength);
-
-				return [$.trim(dateTimeString.substring(0, dateStringLength)), $.trim(dateTimeString.substring(dateStringLength))];
-
-			} else {
-				throw err;
-			}
-		}
-		return [dateTimeString, ''];
-	};
-
-	/*
-	* Internal function to parse datetime interval
-	* Returns: {date: Date, timeObj: Object}, where
-	*   date - parsed date without time (type Date)
-	*   timeObj = {hour: , minute: , second: , millisec: } - parsed time. Optional
-	*/
-	var parseDateTimeInternal = function(dateFormat, timeFormat, dateTimeString, dateSettings, timeSettings) {
-		var date;
-		var splitRes = splitDateTime(dateFormat, dateTimeString, dateSettings, timeSettings);
-		date = $.datepicker._base_parseDate(dateFormat, splitRes[0], dateSettings);
-		if (splitRes[1] !== '') {
-			var timeString = splitRes[1],
-				parsedTime = $.datepicker.parseTime(timeFormat, timeString, timeSettings);
-
-			if (parsedTime === null) {
-				throw 'Wrong time format';
-			}
-			return {
-				date: date,
-				timeObj: parsedTime
-			};
-		} else {
-			return {
-				date: date
-			};
-		}
-	};
-
-	/*
-	* Internal function to set timezone_select to the local timezone
-	*/
-	var selectLocalTimeZone = function(tp_inst, date) {
-		if (tp_inst && tp_inst.timezone_select) {
-			tp_inst._defaults.useLocalTimezone = true;
-			var now = typeof date !== 'undefined' ? date : new Date();
-			var tzoffset = $.timepicker.timeZoneOffsetString(now);
-			if (tp_inst._defaults.timezoneIso8601) {
-				tzoffset = tzoffset.substring(0, 3) + ':' + tzoffset.substring(3);
-			}
-			tp_inst.timezone_select.val(tzoffset);
-		}
-	};
-
-	/*
-	* Create a Singleton Insance
-	*/
-	$.timepicker = new Timepicker();
-
-	/**
-	 * Get the timezone offset as string from a date object (eg '+0530' for UTC+5.5)
-	 * @param  date
-	 * @return string
-	 */
-	$.timepicker.timeZoneOffsetString = function(date) {
-		var off = date.getTimezoneOffset() * -1,
-			minutes = off % 60,
-			hours = (off - minutes) / 60;
-		return (off >= 0 ? '+' : '-') + ('0' + (hours * 101).toString()).substr(-2) + ('0' + (minutes * 101).toString()).substr(-2);
-	};
-
-	/**
-	 * Calls `timepicker()` on the `startTime` and `endTime` elements, and configures them to
-	 * enforce date range limits.
-	 * n.b. The input value must be correctly formatted (reformatting is not supported)
-	 * @param  Element startTime
-	 * @param  Element endTime
-	 * @param  obj options Options for the timepicker() call
-	 * @return jQuery
-	 */
-	$.timepicker.timeRange = function(startTime, endTime, options) {
-		return $.timepicker.handleRange('timepicker', startTime, endTime, options);
-	};
-
-	/**
-	 * Calls `datetimepicker` on the `startTime` and `endTime` elements, and configures them to
-	 * enforce date range limits.
-	 * @param  Element startTime
-	 * @param  Element endTime
-	 * @param  obj options Options for the `timepicker()` call. Also supports `reformat`,
-	 *   a boolean value that can be used to reformat the input values to the `dateFormat`.
-	 * @param  string method Can be used to specify the type of picker to be added
-	 * @return jQuery
-	 */
-	$.timepicker.dateTimeRange = function(startTime, endTime, options) {
-		$.timepicker.dateRange(startTime, endTime, options, 'datetimepicker');
-	};
-
-	/**
-	 * Calls `method` on the `startTime` and `endTime` elements, and configures them to
-	 * enforce date range limits.
-	 * @param  Element startTime
-	 * @param  Element endTime
-	 * @param  obj options Options for the `timepicker()` call. Also supports `reformat`,
-	 *   a boolean value that can be used to reformat the input values to the `dateFormat`.
-	 * @param  string method Can be used to specify the type of picker to be added
-	 * @return jQuery
-	 */
-	$.timepicker.dateRange = function(startTime, endTime, options, method) {
-		method = method || 'datepicker';
-		$.timepicker.handleRange(method, startTime, endTime, options);
-	};
-
-	/**
-	 * Calls `method` on the `startTime` and `endTime` elements, and configures them to
-	 * enforce date range limits.
-	 * @param  string method Can be used to specify the type of picker to be added
-	 * @param  Element startTime
-	 * @param  Element endTime
-	 * @param  obj options Options for the `timepicker()` call. Also supports `reformat`,
-	 *   a boolean value that can be used to reformat the input values to the `dateFormat`.
-	 * @return jQuery
-	 */
-	$.timepicker.handleRange = function(method, startTime, endTime, options) {
-		$.fn[method].call(startTime, $.extend({
-			onClose: function(dateText, inst) {
-				checkDates(this, endTime, dateText);
-			},
-			onSelect: function(selectedDateTime) {
-				selected(this, endTime, 'minDate');
-			}
-		}, options, options.start));
-		$.fn[method].call(endTime, $.extend({
-			onClose: function(dateText, inst) {
-				checkDates(this, startTime, dateText);
-			},
-			onSelect: function(selectedDateTime) {
-				selected(this, startTime, 'maxDate');
-			}
-		}, options, options.end));
-		// timepicker doesn't provide access to its 'timeFormat' option, 
-		// nor could I get datepicker.formatTime() to behave with times, so I
-		// have disabled reformatting for timepicker
-		if (method != 'timepicker' && options.reformat) {
-			$([startTime, endTime]).each(function() {
-				var format = $(this)[method].call($(this), 'option', 'dateFormat'),
-					date = new Date($(this).val());
-				if ($(this).val() && date) {
-					$(this).val($.datepicker.formatDate(format, date));
-				}
-			});
-		}
-		checkDates(startTime, endTime, startTime.val());
-
-		function checkDates(changed, other, dateText) {
-			if (other.val() && (new Date(startTime.val()) > new Date(endTime.val()))) {
-				other.val(dateText);
-			}
-		}
-		selected(startTime, endTime, 'minDate');
-		selected(endTime, startTime, 'maxDate');
-
-		function selected(changed, other, option) {
-			if (!$(changed).val()) {
-				return;
-			}
-			var date = $(changed)[method].call($(changed), 'getDate');
-			// timepicker doesn't implement 'getDate' and returns a jQuery
-			if (date.getTime) {
-				$(other)[method].call($(other), 'option', option, date);
-			}
-		}
-		return $([startTime.get(0), endTime.get(0)]);
-	};
-
-	/*
-	* Keep up with the version
-	*/
-	$.timepicker.version = "1.1.1";
-
-})(jQuery);
\ No newline at end of file
+(function ($) {
+
+  /*
+  * Lets not redefine timepicker, Prevent "Uncaught RangeError: Maximum call stack size exceeded"
+  */
+  $.ui.timepicker = $.ui.timepicker || {};
+  if ($.ui.timepicker.version) {
+    return;
+  }
+
+  /*
+  * Extend jQueryUI, get it started with our version number
+  */
+  $.extend($.ui, {
+    timepicker: {
+      version: "1.1.1"
+    }
+  });
+
+  /*
+  * Timepicker manager.
+  * Use the singleton instance of this class, $.timepicker, to interact with the time picker.
+  * Settings for (groups of) time pickers are maintained in an instance object,
+  * allowing multiple different settings on the same page.
+  */
+  function Timepicker() {
+    this.regional = []; // Available regional settings, indexed by language code
+    this.regional[''] = { // Default regional settings
+      currentText: 'Now',
+      closeText: 'Done',
+      amNames: ['AM', 'A'],
+      pmNames: ['PM', 'P'],
+      timeFormat: 'HH:mm',
+      timeSuffix: '',
+      timeOnlyTitle: 'Choose Time',
+      timeText: 'Time',
+      hourText: 'Hour',
+      minuteText: 'Minute',
+      secondText: 'Second',
+      millisecText: 'Millisecond',
+      timezoneText: 'Time Zone',
+      isRTL: false
+    };
+    this._defaults = { // Global defaults for all the datetime picker instances
+      showButtonPanel: true,
+      timeOnly: false,
+      showHour: true,
+      showMinute: true,
+      showSecond: false,
+      showMillisec: false,
+      showTimezone: false,
+      showTime: true,
+      stepHour: 1,
+      stepMinute: 1,
+      stepSecond: 1,
+      stepMillisec: 1,
+      hour: 0,
+      minute: 0,
+      second: 0,
+      millisec: 0,
+      timezone: null,
+      useLocalTimezone: false,
+      defaultTimezone: "+0000",
+      hourMin: 0,
+      minuteMin: 0,
+      secondMin: 0,
+      millisecMin: 0,
+      hourMax: 23,
+      minuteMax: 59,
+      secondMax: 59,
+      millisecMax: 999,
+      minDateTime: null,
+      maxDateTime: null,
+      onSelect: null,
+      hourGrid: 0,
+      minuteGrid: 0,
+      secondGrid: 0,
+      millisecGrid: 0,
+      alwaysSetTime: true,
+      separator: ' ',
+      altFieldTimeOnly: true,
+      altTimeFormat: null,
+      altSeparator: null,
+      altTimeSuffix: null,
+      pickerTimeFormat: null,
+      pickerTimeSuffix: null,
+      showTimepicker: true,
+      timezoneIso8601: false,
+      timezoneList: null,
+      addSliderAccess: false,
+      sliderAccessArgs: null,
+      controlType: 'slider',
+      defaultValue: null,
+      parse: 'strict'
+    };
+    $.extend(this._defaults, this.regional['']);
+  }
+
+  $.extend(Timepicker.prototype, {
+    $input: null,
+    $altInput: null,
+    $timeObj: null,
+    inst: null,
+    hour_slider: null,
+    minute_slider: null,
+    second_slider: null,
+    millisec_slider: null,
+    timezone_select: null,
+    hour: 0,
+    minute: 0,
+    second: 0,
+    millisec: 0,
+    timezone: null,
+    defaultTimezone: "+0000",
+    hourMinOriginal: null,
+    minuteMinOriginal: null,
+    secondMinOriginal: null,
+    millisecMinOriginal: null,
+    hourMaxOriginal: null,
+    minuteMaxOriginal: null,
+    secondMaxOriginal: null,
+    millisecMaxOriginal: null,
+    ampm: '',
+    formattedDate: '',
+    formattedTime: '',
+    formattedDateTime: '',
+    timezoneList: null,
+    units: ['hour', 'minute', 'second', 'millisec'],
+    control: null,
+
+    /*
+    * Override the default settings for all instances of the time 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;
+    },
+
+    /*
+    * Create a new Timepicker instance
+    */
+    _newInst: function ($input, o) {
+      var tp_inst = new Timepicker(),
+          inlineSettings = {},
+          fns = {},
+          overrides, i;
+
+      for (var attrName in this._defaults) {
+        if (this._defaults.hasOwnProperty(attrName)) {
+          var attrValue = $input.attr('time:' + attrName);
+          if (attrValue) {
+            try {
+              inlineSettings[attrName] = eval(attrValue);
+            } catch (err) {
+              inlineSettings[attrName] = attrValue;
+            }
+          }
+        }
+      }
+      overrides = {
+        beforeShow: function (input, dp_inst) {
+          if ($.isFunction(tp_inst._defaults.evnts.beforeShow)) {
+            return tp_inst._defaults.evnts.beforeShow.call($input[0], input,
+                dp_inst, tp_inst);
+          }
+        },
+        onChangeMonthYear: function (year, month, dp_inst) {
+          // Update the time as well : this prevents the time from disappearing from the $input field.
+          tp_inst._updateDateTime(dp_inst);
+          if ($.isFunction(tp_inst._defaults.evnts.onChangeMonthYear)) {
+            tp_inst._defaults.evnts.onChangeMonthYear.call($input[0], year,
+                month, dp_inst, tp_inst);
+          }
+        },
+        onClose: function (dateText, dp_inst) {
+          if (tp_inst.timeDefined === true && $input.val() !== '') {
+            tp_inst._updateDateTime(dp_inst);
+          }
+          if ($.isFunction(tp_inst._defaults.evnts.onClose)) {
+            tp_inst._defaults.evnts.onClose.call($input[0], dateText, dp_inst,
+                tp_inst);
+          }
+        }
+      };
+      for (i in overrides) {
+        if (overrides.hasOwnProperty(i)) {
+          fns[i] = o[i] || null;
+        }
+      }
+      tp_inst._defaults = $.extend({}, this._defaults, inlineSettings, o,
+          overrides, {
+            evnts: fns,
+            timepicker: tp_inst // add timepicker as a property of datepicker: $.datepicker._get(dp_inst, 'timepicker');
+          });
+      tp_inst.amNames = $.map(tp_inst._defaults.amNames, function (val) {
+        return val.toUpperCase();
+      });
+      tp_inst.pmNames = $.map(tp_inst._defaults.pmNames, function (val) {
+        return val.toUpperCase();
+      });
+
+      // controlType is string - key to our this._controls
+      if (typeof(tp_inst._defaults.controlType) === 'string') {
+        if ($.fn[tp_inst._defaults.controlType] === undefined) {
+          tp_inst._defaults.controlType = 'select';
+        }
+        tp_inst.control = tp_inst._controls[tp_inst._defaults.controlType];
+      }
+      // controlType is an object and must implement create, options, value methods
+      else {
+        tp_inst.control = tp_inst._defaults.controlType;
+      }
+
+      if (tp_inst._defaults.timezoneList === null) {
+        var timezoneList = ['-1200', '-1100', '-1000', '-0930', '-0900',
+          '-0800', '-0700', '-0600', '-0500', '-0430', '-0400', '-0330',
+          '-0300', '-0200', '-0100', '+0000',
+          '+0100', '+0200', '+0300', '+0330', '+0400', '+0430', '+0500',
+          '+0530', '+0545', '+0600', '+0630', '+0700', '+0800', '+0845',
+          '+0900', '+0930',
+          '+1000', '+1030', '+1100', '+1130', '+1200', '+1245', '+1300',
+          '+1400'];
+
+        if (tp_inst._defaults.timezoneIso8601) {
+          timezoneList = $.map(timezoneList, function (val) {
+            return val == '+0000' ? 'Z' : (val.substring(0, 3) + ':'
+                + val.substring(3));
+          });
+        }
+        tp_inst._defaults.timezoneList = timezoneList;
+      }
+
+      tp_inst.timezone = tp_inst._defaults.timezone;
+      tp_inst.hour = tp_inst._defaults.hour;
+      tp_inst.minute = tp_inst._defaults.minute;
+      tp_inst.second = tp_inst._defaults.second;
+      tp_inst.millisec = tp_inst._defaults.millisec;
+      tp_inst.ampm = '';
+      tp_inst.$input = $input;
+
+      if (o.altField) {
+        tp_inst.$altInput = $(o.altField).css({
+          cursor: 'pointer'
+        }).focus(function () {
+          $input.trigger("focus");
+        });
+      }
+
+      if (tp_inst._defaults.minDate === 0 || tp_inst._defaults.minDateTime
+          === 0) {
+        tp_inst._defaults.minDate = new Date();
+      }
+      if (tp_inst._defaults.maxDate === 0 || tp_inst._defaults.maxDateTime
+          === 0) {
+        tp_inst._defaults.maxDate = new Date();
+      }
+
+      // datepicker needs minDate/maxDate, timepicker needs minDateTime/maxDateTime..
+      if (tp_inst._defaults.minDate !== undefined && tp_inst._defaults.minDate
+          instanceof Date) {
+        tp_inst._defaults.minDateTime = new Date(
+            tp_inst._defaults.minDate.getTime());
+      }
+      if (tp_inst._defaults.minDateTime !== undefined
+          && tp_inst._defaults.minDateTime instanceof Date) {
+        tp_inst._defaults.minDate = new Date(
+            tp_inst._defaults.minDateTime.getTime());
+      }
+      if (tp_inst._defaults.maxDate !== undefined && tp_inst._defaults.maxDate
+          instanceof Date) {
+        tp_inst._defaults.maxDateTime = new Date(
+            tp_inst._defaults.maxDate.getTime());
+      }
+      if (tp_inst._defaults.maxDateTime !== undefined
+          && tp_inst._defaults.maxDateTime instanceof Date) {
+        tp_inst._defaults.maxDate = new Date(
+            tp_inst._defaults.maxDateTime.getTime());
+      }
+      tp_inst.$input.bind('focus', function () {
+        tp_inst._onFocus();
+      });
+
+      return tp_inst;
+    },
+
+    /*
+    * add our sliders to the calendar
+    */
+    _addTimePicker: function (dp_inst) {
+      var currDT = (this.$altInput && this._defaults.altFieldTimeOnly)
+          ? this.$input.val() + ' ' + this.$altInput.val() : this.$input.val();
+
+      this.timeDefined = this._parseTime(currDT);
+      this._limitMinMaxDateTime(dp_inst, false);
+      this._injectTimePicker();
+    },
+
+    /*
+    * parse the time string from input value or _setTime
+    */
+    _parseTime: function (timeString, withDate) {
+      if (!this.inst) {
+        this.inst = $.datepicker._getInst(this.$input[0]);
+      }
+
+      if (withDate || !this._defaults.timeOnly) {
+        var dp_dateFormat = $.datepicker._get(this.inst, 'dateFormat');
+        try {
+          var parseRes = parseDateTimeInternal(dp_dateFormat,
+              this._defaults.timeFormat, timeString,
+              $.datepicker._getFormatConfig(this.inst), this._defaults);
+          if (!parseRes.timeObj) {
+            return false;
+          }
+          $.extend(this, parseRes.timeObj);
+        } catch (err) {
+          $.datepicker.log("Error parsing the date/time string: " + err +
+              "\ndate/time string = " + timeString +
+              "\ntimeFormat = " + this._defaults.timeFormat +
+              "\ndateFormat = " + dp_dateFormat);
+          return false;
+        }
+        return true;
+      } else {
+        var timeObj = $.datepicker.parseTime(this._defaults.timeFormat,
+            timeString, this._defaults);
+        if (!timeObj) {
+          return false;
+        }
+        $.extend(this, timeObj);
+        return true;
+      }
+    },
+
+    /*
+    * generate and inject html for timepicker into ui datepicker
+    */
+    _injectTimePicker: function () {
+      var $dp = this.inst.dpDiv,
+          o = this.inst.settings,
+          tp_inst = this,
+          litem = '',
+          uitem = '',
+          max = {},
+          gridSize = {},
+          size = null;
+
+      // Prevent displaying twice
+      if ($dp.find("div.ui-timepicker-div").length === 0 && o.showTimepicker) {
+        var noDisplay = ' style="display:none;"',
+            html = '<div class="ui-timepicker-div' + (o.isRTL
+                ? ' ui-timepicker-rtl' : '') + '"><dl>'
+                + '<dt class="ui_tpicker_time_label"' + ((o.showTime) ? ''
+                    : noDisplay) + '>' + o.timeText + '</dt>' +
+                '<dd class="ui_tpicker_time"' + ((o.showTime) ? '' : noDisplay)
+                + '></dd>';
+
+        // Create the markup
+        for (var i = 0, l = this.units.length; i < l; i++) {
+          litem = this.units[i];
+          uitem = litem.substr(0, 1).toUpperCase() + litem.substr(1);
+          // Added by Peter Medeiros:
+          // - Figure out what the hour/minute/second max should be based on the step values.
+          // - Example: if stepMinute is 15, then minMax is 45.
+          max[litem] = parseInt(
+              (o[litem + 'Max'] - ((o[litem + 'Max'] - o[litem + 'Min'])
+                  % o['step' + uitem])), 10);
+          gridSize[litem] = 0;
+
+          html += '<dt class="ui_tpicker_' + litem + '_label"' + ((o['show'
+              + uitem]) ? '' : noDisplay) + '>' + o[litem + 'Text'] + '</dt>' +
+              '<dd class="ui_tpicker_' + litem + '"><div class="ui_tpicker_'
+              + litem + '_slider"' + ((o['show' + uitem]) ? '' : noDisplay)
+              + '></div>';
+
+          if (o['show' + uitem] && o[litem + 'Grid'] > 0) {
+            html += '<div style="padding-left: 1px"><table class="ui-tpicker-grid-label"><tr>';
+
+            if (litem == 'hour') {
+              for (var h = o[litem + 'Min']; h <= max[litem];
+                  h += parseInt(o[litem + 'Grid'], 10)) {
+                gridSize[litem]++;
+                var tmph = $.datepicker.formatTime(
+                    useAmpm(o.pickerTimeFormat || o.timeFormat) ? 'hht' : 'HH',
+                    {hour: h}, o);
+                html += '<td data-for="' + litem + '">' + tmph + '</td>';
+              }
+            }
+            else {
+              for (var m = o[litem + 'Min']; m <= max[litem];
+                  m += parseInt(o[litem + 'Grid'], 10)) {
+                gridSize[litem]++;
+                html += '<td data-for="' + litem + '">' + ((m < 10) ? '0' : '')
+                    + m + '</td>';
+              }
+            }
+
+            html += '</tr></table></div>';
+          }
+          html += '</dd>';
+        }
+
+        // Timezone
+        html += '<dt class="ui_tpicker_timezone_label"' + ((o.showTimezone) ? ''
+            : noDisplay) + '>' + o.timezoneText + '</dt>';
+        html += '<dd class="ui_tpicker_timezone" ' + ((o.showTimezone) ? ''
+            : noDisplay) + '></dd>';
+
+        // Create the elements from string
+        html += '</dl></div>';
+        var $tp = $(html);
+
+        // if we only want time picker...
+        if (o.timeOnly === true) {
+          $tp.prepend('<div class="ui-widget-header ui-helper-clearfix ui-corner-all">'
+              + '<div class="ui-datepicker-title">' + o.timeOnlyTitle + '</div>'
+              + '</div>');
+          $dp.find('.ui-datepicker-header, .ui-datepicker-calendar').hide();
+        }
+
+        // add sliders, adjust grids, add events
+        for (var i = 0, l = tp_inst.units.length; i < l; i++) {
+          litem = tp_inst.units[i];
+          uitem = litem.substr(0, 1).toUpperCase() + litem.substr(1);
+
+          // add the slider
+          tp_inst[litem + '_slider'] = tp_inst.control.create(tp_inst,
+              $tp.find('.ui_tpicker_' + litem + '_slider'), litem,
+              tp_inst[litem], o[litem + 'Min'], max[litem], o['step' + uitem]);
+
+          // adjust the grid and add click event
+          if (o['show' + uitem] && o[litem + 'Grid'] > 0) {
+            size = 100 * gridSize[litem] * o[litem + 'Grid'] / (max[litem]
+                - o[litem + 'Min']);
+            $tp.find('.ui_tpicker_' + litem + ' table').css({
+              width: size + "%",
+              marginLeft: o.isRTL ? '0' : ((size / (-2 * gridSize[litem]))
+                  + "%"),
+              marginRight: o.isRTL ? ((size / (-2 * gridSize[litem])) + "%")
+                  : '0',
+              borderCollapse: 'collapse'
+            }).find("td").click(function (e) {
+              var $t = $(this),
+                  h = $t.html(),
+                  n = parseInt(h.replace(/[^0-9]/g), 10),
+                  ap = h.replace(/[^apm]/ig),
+                  f = $t.data('for'); // loses scope, so we use data-for
+
+              if (f == 'hour') {
+                if (ap.indexOf('p') !== -1 && n < 12) {
+                  n += 12;
+                }
+                else {
+                  if (ap.indexOf('a') !== -1 && n === 12) {
+                    n = 0;
+                  }
+                }
+              }
+
+              tp_inst.control.value(tp_inst, tp_inst[f + '_slider'], litem, n);
+
+              tp_inst._onTimeChange();
+              tp_inst._onSelectHandler();
+            })
+            .css({
+              cursor: 'pointer',
+              width: (100 / gridSize[litem]) + '%',
+              textAlign: 'center',
+              overflow: 'hidden'
+            });
+          } // end if grid > 0
+        } // end for loop
+
+        // Add timezone options
+        this.timezone_select = $tp.find('.ui_tpicker_timezone').append(
+            '<select></select>').find("select");
+        $.fn.append.apply(this.timezone_select,
+            $.map(o.timezoneList, function (val, idx) {
+              return $("<option />").val(
+                  typeof val == "object" ? val.value : val).text(
+                  typeof val == "object" ? val.label : val);
+            }));
+        if (typeof(this.timezone) != "undefined" && this.timezone !== null
+            && this.timezone !== "") {
+          var local_date = new Date(this.inst.selectedYear,
+              this.inst.selectedMonth, this.inst.selectedDay, 12);
+          var local_timezone = $.timepicker.timeZoneOffsetString(local_date);
+          if (local_timezone == this.timezone) {
+            selectLocalTimeZone(tp_inst);
+          } else {
+            this.timezone_select.val(this.timezone);
+          }
+        } else {
+          if (typeof(this.hour) != "undefined" && this.hour !== null
+              && this.hour !== "") {
+            this.timezone_select.val(o.defaultTimezone);
+          } else {
+            selectLocalTimeZone(tp_inst);
+          }
+        }
+        this.timezone_select.change(function () {
+          tp_inst._defaults.useLocalTimezone = false;
+          tp_inst._onTimeChange();
+        });
+        // End timezone options
+
+        // inject timepicker into datepicker
+        var $buttonPanel = $dp.find('.ui-datepicker-buttonpane');
+        if ($buttonPanel.length) {
+          $buttonPanel.before($tp);
+        } else {
+          $dp.append($tp);
+        }
+
+        this.$timeObj = $tp.find('.ui_tpicker_time');
+
+        if (this.inst !== null) {
+          var timeDefined = this.timeDefined;
+          this._onTimeChange();
+          this.timeDefined = timeDefined;
+        }
+
+        // slideAccess integration: http://trentrichardson.com/2011/11/11/jquery-ui-sliders-and-touch-accessibility/
+        if (this._defaults.addSliderAccess) {
+          var sliderAccessArgs = this._defaults.sliderAccessArgs,
+              rtl = this._defaults.isRTL;
+          sliderAccessArgs.isRTL = rtl;
+
+          setTimeout(function () { // fix for inline mode
+            if ($tp.find('.ui-slider-access').length === 0) {
+              $tp.find('.ui-slider:visible').sliderAccess(sliderAccessArgs);
+
+              // fix any grids since sliders are shorter
+              var sliderAccessWidth = $tp.find(
+                  '.ui-slider-access:eq(0)').outerWidth(true);
+              if (sliderAccessWidth) {
+                $tp.find('table:visible').each(function () {
+                  var $g = $(this),
+                      oldWidth = $g.outerWidth(),
+                      oldMarginLeft = $g.css(rtl ? 'marginRight'
+                          : 'marginLeft').toString().replace('%', ''),
+                      newWidth = oldWidth - sliderAccessWidth,
+                      newMarginLeft = ((oldMarginLeft * newWidth) / oldWidth)
+                          + '%',
+                      css = {width: newWidth, marginRight: 0, marginLeft: 0};
+                  css[rtl ? 'marginRight' : 'marginLeft'] = newMarginLeft;
+                  $g.css(css);
+                });
+              }
+            }
+          }, 10);
+        }
+        // end slideAccess integration
+
+      }
+    },
+
+    /*
+    * This function tries to limit the ability to go outside the
+    * min/max date range
+    */
+    _limitMinMaxDateTime: function (dp_inst, adjustSliders) {
+      var o = this._defaults,
+          dp_date = new Date(dp_inst.selectedYear, dp_inst.selectedMonth,
+              dp_inst.selectedDay);
+
+      if (!this._defaults.showTimepicker) {
+        return;
+      } // No time so nothing to check here
+
+      if ($.datepicker._get(dp_inst, 'minDateTime') !== null
+          && $.datepicker._get(dp_inst, 'minDateTime') !== undefined
+          && dp_date) {
+        var minDateTime = $.datepicker._get(dp_inst, 'minDateTime'),
+            minDateTimeDate = new Date(minDateTime.getFullYear(),
+                minDateTime.getMonth(), minDateTime.getDate(), 0, 0, 0, 0);
+
+        if (this.hourMinOriginal === null || this.minuteMinOriginal === null
+            || this.secondMinOriginal === null || this.millisecMinOriginal
+            === null) {
+          this.hourMinOriginal = o.hourMin;
+          this.minuteMinOriginal = o.minuteMin;
+          this.secondMinOriginal = o.secondMin;
+          this.millisecMinOriginal = o.millisecMin;
+        }
+
+        if (dp_inst.settings.timeOnly || minDateTimeDate.getTime()
+            == dp_date.getTime()) {
+          this._defaults.hourMin = minDateTime.getHours();
+          if (this.hour <= this._defaults.hourMin) {
+            this.hour = this._defaults.hourMin;
+            this._defaults.minuteMin = minDateTime.getMinutes();
+            if (this.minute <= this._defaults.minuteMin) {
+              this.minute = this._defaults.minuteMin;
+              this._defaults.secondMin = minDateTime.getSeconds();
+              if (this.second <= this._defaults.secondMin) {
+                this.second = this._defaults.secondMin;
+                this._defaults.millisecMin = minDateTime.getMilliseconds();
+              } else {
+                if (this.millisec < this._defaults.millisecMin) {
+                  this.millisec = this._defaults.millisecMin;
+                }
+                this._defaults.millisecMin = this.millisecMinOriginal;
+              }
+            } else {
+              this._defaults.secondMin = this.secondMinOriginal;
+              this._defaults.millisecMin = this.millisecMinOriginal;
+            }
+          } else {
+            this._defaults.minuteMin = this.minuteMinOriginal;
+            this._defaults.secondMin = this.secondMinOriginal;
+            this._defaults.millisecMin = this.millisecMinOriginal;
+          }
+        } else {
+          this._defaults.hourMin = this.hourMinOriginal;
+          this._defaults.minuteMin = this.minuteMinOriginal;
+          this._defaults.secondMin = this.secondMinOriginal;
+          this._defaults.millisecMin = this.millisecMinOriginal;
+        }
+      }
+
+      if ($.datepicker._get(dp_inst, 'maxDateTime') !== null
+          && $.datepicker._get(dp_inst, 'maxDateTime') !== undefined
+          && dp_date) {
+        var maxDateTime = $.datepicker._get(dp_inst, 'maxDateTime'),
+            maxDateTimeDate = new Date(maxDateTime.getFullYear(),
+                maxDateTime.getMonth(), maxDateTime.getDate(), 0, 0, 0, 0);
+
+        if (this.hourMaxOriginal === null || this.minuteMaxOriginal === null
+            || this.secondMaxOriginal === null) {
+          this.hourMaxOriginal = o.hourMax;
+          this.minuteMaxOriginal = o.minuteMax;
+          this.secondMaxOriginal = o.secondMax;
+          this.millisecMaxOriginal = o.millisecMax;
+        }
+
+        if (dp_inst.settings.timeOnly || maxDateTimeDate.getTime()
+            == dp_date.getTime()) {
+          this._defaults.hourMax = maxDateTime.getHours();
+          if (this.hour >= this._defaults.hourMax) {
+            this.hour = this._defaults.hourMax;
+            this._defaults.minuteMax = maxDateTime.getMinutes();
+            if (this.minute >= this._defaults.minuteMax) {
+              this.minute = this._defaults.minuteMax;
+              this._defaults.secondMax = maxDateTime.getSeconds();
+            } else if (this.second >= this._defaults.secondMax) {
+              this.second = this._defaults.secondMax;
+              this._defaults.millisecMax = maxDateTime.getMilliseconds();
+            } else {
+              if (this.millisec > this._defaults.millisecMax) {
+                this.millisec = this._defaults.millisecMax;
+              }
+              this._defaults.millisecMax = this.millisecMaxOriginal;
+            }
+          } else {
+            this._defaults.minuteMax = this.minuteMaxOriginal;
+            this._defaults.secondMax = this.secondMaxOriginal;
+            this._defaults.millisecMax = this.millisecMaxOriginal;
+          }
+        } else {
+          this._defaults.hourMax = this.hourMaxOriginal;
+          this._defaults.minuteMax = this.minuteMaxOriginal;
+          this._defaults.secondMax = this.secondMaxOriginal;
+          this._defaults.millisecMax = this.millisecMaxOriginal;
+        }
+      }
+
+      if (adjustSliders !== undefined && adjustSliders === true) {
+        var hourMax = parseInt(
+            (this._defaults.hourMax - ((this._defaults.hourMax
+                - this._defaults.hourMin) % this._defaults.stepHour)), 10),
+            minMax = parseInt(
+                (this._defaults.minuteMax - ((this._defaults.minuteMax
+                    - this._defaults.minuteMin) % this._defaults.stepMinute)),
+                10),
+            secMax = parseInt(
+                (this._defaults.secondMax - ((this._defaults.secondMax
+                    - this._defaults.secondMin) % this._defaults.stepSecond)),
+                10),
+            millisecMax = parseInt(
+                (this._defaults.millisecMax - ((this._defaults.millisecMax
+                    - this._defaults.millisecMin)
+                    % this._defaults.stepMillisec)), 10);
+
+        if (this.hour_slider) {
+          this.control.options(this, this.hour_slider, 'hour',
+              {min: this._defaults.hourMin, max: hourMax});
+          this.control.value(this, this.hour_slider, 'hour', this.hour);
+        }
+        if (this.minute_slider) {
+          this.control.options(this, this.minute_slider, 'minute',
+              {min: this._defaults.minuteMin, max: minMax});
+          this.control.value(this, this.minute_slider, 'minute', this.minute);
+        }
+        if (this.second_slider) {
+          this.control.options(this, this.second_slider, 'second',
+              {min: this._defaults.secondMin, max: secMax});
+          this.control.value(this, this.second_slider, 'second', this.second);
+        }
+        if (this.millisec_slider) {
+          this.control.options(this, this.millisec_slider, 'millisec',
+              {min: this._defaults.millisecMin, max: millisecMax});
+          this.control.value(this, this.millisec_slider, 'millisec',
+              this.millisec);
+        }
+      }
+
+    },
+
+    /*
+    * when a slider moves, set the internal time...
+    * on time change is also called when the time is updated in the text field
+    */
+    _onTimeChange: function () {
+      var hour = (this.hour_slider) ? this.control.value(this, this.hour_slider,
+          'hour') : false,
+          minute = (this.minute_slider) ? this.control.value(this,
+              this.minute_slider, 'minute') : false,
+          second = (this.second_slider) ? this.control.value(this,
+              this.second_slider, 'second') : false,
+          millisec = (this.millisec_slider) ? this.control.value(this,
+              this.millisec_slider, 'millisec') : false,
+          timezone = (this.timezone_select) ? this.timezone_select.val()
+              : false,
+          o = this._defaults,
+          pickerTimeFormat = o.pickerTimeFormat || o.timeFormat,
+          pickerTimeSuffix = o.pickerTimeSuffix || o.timeSuffix;
+
+      if (typeof(hour) == 'object') {
+        hour = false;
+      }
+      if (typeof(minute) == 'object') {
+        minute = false;
+      }
+      if (typeof(second) == 'object') {
+        second = false;
+      }
+      if (typeof(millisec) == 'object') {
+        millisec = false;
+      }
+      if (typeof(timezone) == 'object') {
+        timezone = false;
+      }
+
+      if (hour !== false) {
+        hour = parseInt(hour, 10);
+      }
+      if (minute !== false) {
+        minute = parseInt(minute, 10);
+      }
+      if (second !== false) {
+        second = parseInt(second, 10);
+      }
+      if (millisec !== false) {
+        millisec = parseInt(millisec, 10);
+      }
+
+      var ampm = o[hour < 12 ? 'amNames' : 'pmNames'][0];
+
+      // If the update was done in the input field, the input field should not be updated.
+      // If the update was done using the sliders, update the input field.
+      var hasChanged = (hour != this.hour || minute != this.minute || second
+          != this.second || millisec != this.millisec
+          || (this.ampm.length > 0 && (hour < 12) != ($.inArray(
+              this.ampm.toUpperCase(), this.amNames) !== -1))
+          || ((this.timezone === null && timezone != this.defaultTimezone)
+              || (this.timezone !== null && timezone != this.timezone)));
+
+      if (hasChanged) {
+
+        if (hour !== false) {
+          this.hour = hour;
+        }
+        if (minute !== false) {
+          this.minute = minute;
+        }
+        if (second !== false) {
+          this.second = second;
+        }
+        if (millisec !== false) {
+          this.millisec = millisec;
+        }
+        if (timezone !== false) {
+          this.timezone = timezone;
+        }
+
+        if (!this.inst) {
+          this.inst = $.datepicker._getInst(this.$input[0]);
+        }
+
+        this._limitMinMaxDateTime(this.inst, true);
+      }
+      if (useAmpm(o.timeFormat)) {
+        this.ampm = ampm;
+      }
+
+      // Updates the time within the timepicker
+      this.formattedTime = $.datepicker.formatTime(o.timeFormat, this, o);
+      if (this.$timeObj) {
+        if (pickerTimeFormat === o.timeFormat) {
+          this.$timeObj.text(this.formattedTime + pickerTimeSuffix);
+        }
+        else {
+          this.$timeObj.text($.datepicker.formatTime(pickerTimeFormat, this, o)
+              + pickerTimeSuffix);
+        }
+      }
+
+      this.timeDefined = true;
+      if (hasChanged) {
+        this._updateDateTime();
+      }
+    },
+
+    /*
+    * call custom onSelect.
+    * bind to sliders slidestop, and grid click.
+    */
+    _onSelectHandler: function () {
+      var onSelect = this._defaults.onSelect || this.inst.settings.onSelect;
+      var inputEl = this.$input ? this.$input[0] : null;
+      if (onSelect && inputEl) {
+        onSelect.apply(inputEl, [this.formattedDateTime, this]);
+      }
+    },
+
+    /*
+    * update our input with the new date time..
+    */
+    _updateDateTime: function (dp_inst) {
+      dp_inst = this.inst || dp_inst;
+      var dt = $.datepicker._daylightSavingAdjust(
+          new Date(dp_inst.selectedYear, dp_inst.selectedMonth,
+              dp_inst.selectedDay)),
+          dateFmt = $.datepicker._get(dp_inst, 'dateFormat'),
+          formatCfg = $.datepicker._getFormatConfig(dp_inst),
+          timeAvailable = dt !== null && this.timeDefined;
+      this.formattedDate = $.datepicker.formatDate(dateFmt,
+          (dt === null ? new Date() : dt), formatCfg);
+      var formattedDateTime = this.formattedDate;
+
+      /*
+      * remove following lines to force every changes in date picker to change the input value
+      * Bug descriptions: when an input field has a default value, and click on the field to pop up the date picker.
+      * If the user manually empty the value in the input field, the date picker will never change selected value.
+      */
+      //if (dp_inst.lastVal !== undefined && (dp_inst.lastVal.length > 0 && this.$input.val().length === 0)) {
+      //	return;
+      //}
+
+      if (this._defaults.timeOnly === true) {
+        formattedDateTime = this.formattedTime;
+      } else if (this._defaults.timeOnly !== true
+          && (this._defaults.alwaysSetTime || timeAvailable)) {
+        formattedDateTime += this._defaults.separator + this.formattedTime
+            + this._defaults.timeSuffix;
+      }
+
+      this.formattedDateTime = formattedDateTime;
+
+      if (!this._defaults.showTimepicker) {
+        this.$input.val(this.formattedDate);
+      } else if (this.$altInput && this._defaults.altFieldTimeOnly === true) {
+        this.$altInput.val(this.formattedTime);
+        this.$input.val(this.formattedDate);
+      } else if (this.$altInput) {
+        this.$input.val(formattedDateTime);
+        var altFormattedDateTime = '',
+            altSeparator = this._defaults.altSeparator
+                ? this._defaults.altSeparator : this._defaults.separator,
+            altTimeSuffix = this._defaults.altTimeSuffix
+                ? this._defaults.altTimeSuffix : this._defaults.timeSuffix;
+
+        if (this._defaults.altFormat) {
+          altFormattedDateTime = $.datepicker.formatDate(
+              this._defaults.altFormat, (dt === null ? new Date() : dt),
+              formatCfg);
+        } else {
+          altFormattedDateTime = this.formattedDate;
+        }
+        if (altFormattedDateTime) {
+          altFormattedDateTime += altSeparator;
+        }
+        if (this._defaults.altTimeFormat) {
+          altFormattedDateTime += $.datepicker.formatTime(
+              this._defaults.altTimeFormat, this, this._defaults)
+              + altTimeSuffix;
+        } else {
+          altFormattedDateTime += this.formattedTime + altTimeSuffix;
+        }
+        this.$altInput.val(altFormattedDateTime);
+      } else {
+        this.$input.val(formattedDateTime);
+      }
+
+      this.$input.trigger("change");
+    },
+
+    _onFocus: function () {
+      if (!this.$input.val() && this._defaults.defaultValue) {
+        this.$input.val(this._defaults.defaultValue);
+        var inst = $.datepicker._getInst(this.$input.get(0)),
+            tp_inst = $.datepicker._get(inst, 'timepicker');
+        if (tp_inst) {
+          if (tp_inst._defaults.timeOnly && (inst.input.val()
+                  != inst.lastVal)) {
+            try {
+              $.datepicker._updateDatepicker(inst);
+            } catch (err) {
+              $.datepicker.log(err);
+            }
+          }
+        }
+      }
+    },
+
+    /*
+    * Small abstraction to control types
+    * We can add more, just be sure to follow the pattern: create, options, value
+    */
+    _controls: {
+      // slider methods
+      slider: {
+        create: function (tp_inst, obj, unit, val, min, max, step) {
+          var rtl = tp_inst._defaults.isRTL; // if rtl go -60->0 instead of 0->60
+          return obj.prop('slide', null).slider({
+            orientation: "horizontal",
+            value: rtl ? val * -1 : val,
+            min: rtl ? max * -1 : min,
+            max: rtl ? min * -1 : max,
+            step: step,
+            slide: function (event, ui) {
+              tp_inst.control.value(tp_inst, $(this), unit,
+                  rtl ? ui.value * -1 : ui.value);
+              tp_inst._onTimeChange();
+            },
+            stop: function (event, ui) {
+              tp_inst._onSelectHandler();
+            }
+          });
+        },
+        options: function (tp_inst, obj, unit, opts, val) {
+          if (tp_inst._defaults.isRTL) {
+            if (typeof(opts) == 'string') {
+              if (opts == 'min' || opts == 'max') {
+                if (val !== undefined) {
+                  return obj.slider(opts, val * -1);
+                }
+                return Math.abs(obj.slider(opts));
+              }
+              return obj.slider(opts);
+            }
+            var min = opts.min,
+                max = opts.max;
+            opts.min = opts.max = null;
+            if (min !== undefined) {
+              opts.max = min * -1;
+            }
+            if (max !== undefined) {
+              opts.min = max * -1;
+            }
+            return obj.slider(opts);
+          }
+          if (typeof(opts) == 'string' && val !== undefined) {
+            return obj.slider(opts, val);
+          }
+          return obj.slider(opts);
+        },
+        value: function (tp_inst, obj, unit, val) {
+          if (tp_inst._defaults.isRTL) {
+            if (val !== undefined) {
+              return obj.slider('value', val * -1);
+            }
+            return Math.abs(obj.slider('value'));
+          }
+          if (val !== undefined) {
+            return obj.slider('value', val);
+          }
+          return obj.slider('value');
+        }
+      },
+      // select methods
+      select: {
+        create: function (tp_inst, obj, unit, val, min, max, step) {
+          var sel = '<select class="ui-timepicker-select" data-unit="' + unit
+              + '" data-min="' + min + '" data-max="' + max + '" data-step="'
+              + step + '">',
+              ul = tp_inst._defaults.timeFormat.indexOf('t') !== -1
+                  ? 'toLowerCase' : 'toUpperCase',
+              m = 0;
+
+          for (var i = min; i <= max; i += step) {
+            sel += '<option value="' + i + '"' + (i == val ? ' selected' : '')
+                + '>';
+            if (unit == 'hour' && useAmpm(tp_inst._defaults.pickerTimeFormat
+                    || tp_inst._defaults.timeFormat)) {
+              sel += $.datepicker.formatTime("hh TT", {hour: i},
+                  tp_inst._defaults);
+            } else if (unit == 'millisec' || i >= 10) {
+              sel += i;
+            } else {
+              sel += '0' + i.toString();
+            }
+            sel += '</option>';
+          }
+          sel += '</select>';
+
+          obj.children('select').remove();
+
+          $(sel).appendTo(obj).change(function (e) {
+            tp_inst._onTimeChange();
+            tp_inst._onSelectHandler();
+          });
+
+          return obj;
+        },
+        options: function (tp_inst, obj, unit, opts, val) {
+          var o = {},
+              $t = obj.children('select');
+          if (typeof(opts) == 'string') {
+            if (val === undefined) {
+              return $t.data(opts);
+            }
+            o[opts] = val;
+          }
+          else {
+            o = opts;
+          }
+          return tp_inst.control.create(tp_inst, obj, $t.data('unit'),
+              $t.val(), o.min || $t.data('min'), o.max || $t.data('max'), o.step
+              || $t.data('step'));
+        },
+        value: function (tp_inst, obj, unit, val) {
+          var $t = obj.children('select');
+          if (val !== undefined) {
+            return $t.val(val);
+          }
+          return $t.val();
+        }
+      }
+    } // end _controls
+
+  });
+
+  $.fn.extend({
+    /*
+    * shorthand just to use timepicker..
+    */
+    timepicker: function (o) {
+      o = o || {};
+      var tmp_args = Array.prototype.slice.call(arguments);
+
+      if (typeof o == 'object') {
+        tmp_args[0] = $.extend(o, {
+          timeOnly: true
+        });
+      }
+
+      return $(this).each(function () {
+        $.fn.datetimepicker.apply($(this), tmp_args);
+      });
+    },
+
+    /*
+    * extend timepicker to datepicker
+    */
+    datetimepicker: function (o) {
+      o = o || {};
+      var tmp_args = arguments;
+
+      if (typeof(o) == 'string') {
+        if (o == 'getDate') {
+          return $.fn.datepicker.apply($(this[0]), tmp_args);
+        } else {
+          return this.each(function () {
+            var $t = $(this);
+            $t.datepicker.apply($t, tmp_args);
+          });
+        }
+      } else {
+        return this.each(function () {
+          var $t = $(this);
+          $t.datepicker($.timepicker._newInst($t, o)._defaults);
+        });
+      }
+    }
+  });
+
+  /*
+  * Public Utility to parse date and time
+  */
+  $.datepicker.parseDateTime = function (dateFormat, timeFormat, dateTimeString,
+      dateSettings, timeSettings) {
+    var parseRes = parseDateTimeInternal(dateFormat, timeFormat, dateTimeString,
+        dateSettings, timeSettings);
+    if (parseRes.timeObj) {
+      var t = parseRes.timeObj;
+      parseRes.date.setHours(t.hour, t.minute, t.second, t.millisec);
+    }
+
+    return parseRes.date;
+  };
+
+  /*
+  * Public utility to parse time
+  */
+  $.datepicker.parseTime = function (timeFormat, timeString, options) {
+    var o = extendRemove(extendRemove({}, $.timepicker._defaults), options
+        || {});
+
+    // Strict parse requires the timeString to match the timeFormat exactly
+    var strictParse = function (f, s, o) {
+
+      // pattern for standard and localized AM/PM markers
+      var getPatternAmpm = function (amNames, pmNames) {
+        var markers = [];
+        if (amNames) {
+          $.merge(markers, amNames);
+        }
+        if (pmNames) {
+          $.merge(markers, pmNames);
+        }
+        markers = $.map(markers, function (val) {
+          return val.replace(/[.*+?|()\[\]{}\\]/g, '\\$&');
+        });
+        return '(' + markers.join('|') + ')?';
+      };
+
+      // figure out position of time elements.. cause js cant do named captures
+      var getFormatPositions = function (timeFormat) {
+        var finds = timeFormat.toLowerCase().match(
+            /(h{1,2}|m{1,2}|s{1,2}|l{1}|t{1,2}|z|'.*?')/g),
+            orders = {
+              h: -1,
+              m: -1,
+              s: -1,
+              l: -1,
+              t: -1,
+              z: -1
+            };
+
+        if (finds) {
+          for (var i = 0; i < finds.length; i++) {
+            if (orders[finds[i].toString().charAt(0)] == -1) {
+              orders[finds[i].toString().charAt(0)] = i + 1;
+            }
+          }
+        }
+        return orders;
+      };
+
+      var regstr = '^' + f.toString()
+          .replace(/([hH]{1,2}|mm?|ss?|[tT]{1,2}|[lz]|'.*?')/g, function (match) {
+            switch (match.charAt(0).toLowerCase()) {
+              case 'h':
+                return '(\\d?\\d)';
+              case 'm':
+                return '(\\d?\\d)';
+              case 's':
+                return '(\\d?\\d)';
+              case 'l':
+                return '(\\d?\\d?\\d)';
+              case 'z':
+                return '(z|[-+]\\d\\d:?\\d\\d|\\S+)?';
+              case 't':
+                return getPatternAmpm(o.amNames, o.pmNames);
+              default:    // literal escaped in quotes
+                return '(' + match.replace(/\'/g, "").replace(
+                    /(\.|\$|\^|\\|\/|\(|\)|\[|\]|\?|\+|\*)/g, function (m) {
+                      return "\\" + m;
+                    }) + ')?';
+            }
+          })
+          .replace(/\s/g, '\\s?') +
+          o.timeSuffix + '$',
+          order = getFormatPositions(f),
+          ampm = '',
+          treg;
+
+      treg = s.match(new RegExp(regstr, 'i'));
+
+      var resTime = {
+        hour: 0,
+        minute: 0,
+        second: 0,
+        millisec: 0
+      };
+
+      if (treg) {
+        if (order.t !== -1) {
+          if (treg[order.t] === undefined || treg[order.t].length === 0) {
+            ampm = '';
+            resTime.ampm = '';
+          } else {
+            ampm = $.inArray(treg[order.t].toUpperCase(), o.amNames) !== -1
+                ? 'AM' : 'PM';
+            resTime.ampm = o[ampm == 'AM' ? 'amNames' : 'pmNames'][0];
+          }
+        }
+
+        if (order.h !== -1) {
+          if (ampm == 'AM' && treg[order.h] == '12') {
+            resTime.hour = 0; // 12am = 0 hour
+          } else {
+            if (ampm == 'PM' && treg[order.h] != '12') {
+              resTime.hour = parseInt(treg[order.h], 10) + 12; // 12pm = 12 hour, any other pm = hour + 12
+            } else {
+              resTime.hour = Number(treg[order.h]);
+            }
+          }
+        }
+
+        if (order.m !== -1) {
+          resTime.minute = Number(treg[order.m]);
+        }
+        if (order.s !== -1) {
+          resTime.second = Number(treg[order.s]);
+        }
+        if (order.l !== -1) {
+          resTime.millisec = Number(treg[order.l]);
+        }
+        if (order.z !== -1 && treg[order.z] !== undefined) {
+          var tz = treg[order.z].toUpperCase();
+          switch (tz.length) {
+            case 1:
+              // Z
+              tz = o.timezoneIso8601 ? 'Z' : '+0000';
+              break;
+            case 5:
+              // +hhmm
+              if (o.timezoneIso8601) {
+                tz = tz.substring(1) == '0000' ? 'Z' : tz.substring(0, 3) + ':'
+                    + tz.substring(3);
+              }
+              break;
+            case 6:
+              // +hh:mm
+              if (!o.timezoneIso8601) {
+                tz = tz == 'Z' || tz.substring(1) == '00:00' ? '+0000'
+                    : tz.replace(/:/, '');
+              } else {
+                if (tz.substring(1) == '00:00') {
+                  tz = 'Z';
+                }
+              }
+              break;
+          }
+          resTime.timezone = tz;
+        }
+
+        return resTime;
+      }
+      return false;
+    };// end strictParse
+
+    // First try JS Date, if that fails, use strictParse
+    var looseParse = function (f, s, o) {
+      try {
+        var d = new Date('2012-01-01 ' + s);
+        return {
+          hour: d.getHours(),
+          minutes: d.getMinutes(),
+          seconds: d.getSeconds(),
+          millisec: d.getMilliseconds(),
+          timezone: $.timepicker.timeZoneOffsetString(d)
+        };
+      }
+      catch (err) {
+        try {
+          return strictParse(f, s, o);
+        }
+        catch (err2) {
+          $.datepicker.log("Unable to parse \ntimeString: " + s
+              + "\ntimeFormat: " + f);
+        }
+      }
+      return false;
+    }; // end looseParse
+
+    if (typeof o.parse === "function") {
+      return o.parse(timeFormat, timeString, o)
+    }
+    if (o.parse === 'loose') {
+      return looseParse(timeFormat, timeString, o);
+    }
+    return strictParse(timeFormat, timeString, o);
+  };
+
+  /*
+  * Public utility to format the time
+  * format = string format of the time
+  * time = a {}, not a Date() for timezones
+  * options = essentially the regional[].. amNames, pmNames, ampm
+  */
+  $.datepicker.formatTime = function (format, time, options) {
+    options = options || {};
+    options = $.extend({}, $.timepicker._defaults, options);
+    time = $.extend({
+      hour: 0,
+      minute: 0,
+      second: 0,
+      millisec: 0,
+      timezone: '+0000'
+    }, time);
+
+    var tmptime = format,
+        ampmName = options.amNames[0],
+        hour = parseInt(time.hour, 10);
+
+    if (hour > 11) {
+      ampmName = options.pmNames[0];
+    }
+
+    tmptime = tmptime.replace(
+        /(?:HH?|hh?|mm?|ss?|[tT]{1,2}|[lz]|('.*?'|".*?"))/g, function (match) {
+          switch (match) {
+            case 'HH':
+              return ('0' + hour).slice(-2);
+            case 'H':
+              return hour;
+            case 'hh':
+              return ('0' + convert24to12(hour)).slice(-2);
+            case 'h':
+              return convert24to12(hour);
+            case 'mm':
+              return ('0' + time.minute).slice(-2);
+            case 'm':
+              return time.minute;
+            case 'ss':
+              return ('0' + time.second).slice(-2);
+            case 's':
+              return time.second;
+            case 'l':
+              return ('00' + time.millisec).slice(-3);
+            case 'z':
+              return time.timezone === null ? options.defaultTimezone
+                  : time.timezone;
+            case 'T':
+              return ampmName.charAt(0).toUpperCase();
+            case 'TT':
+              return ampmName.toUpperCase();
+            case 't':
+              return ampmName.charAt(0).toLowerCase();
+            case 'tt':
+              return ampmName.toLowerCase();
+            default:
+              return match.replace(/\'/g, "") || "'";
+          }
+        });
+
+    tmptime = $.trim(tmptime);
+    return tmptime;
+  };
+
+  /*
+  * the bad hack :/ override datepicker so it doesnt close on select
+  // inspired: http://stackoverflow.com/questions/1252512/jquery-datepicker-prevent-closing-picker-when-clicking-a-date/1762378#1762378
+  */
+  $.datepicker._base_selectDate = $.datepicker._selectDate;
+  $.datepicker._selectDate = function (id, dateStr) {
+    var inst = this._getInst($(id)[0]),
+        tp_inst = this._get(inst, 'timepicker');
+
+    if (tp_inst) {
+      tp_inst._limitMinMaxDateTime(inst, true);
+      inst.inline = inst.stay_open = true;
+      //This way the onSelect handler called from calendarpicker get the full dateTime
+      this._base_selectDate(id, dateStr);
+      inst.inline = inst.stay_open = false;
+      this._notifyChange(inst);
+      this._updateDatepicker(inst);
+    } else {
+      this._base_selectDate(id, dateStr);
+    }
+  };
+
+  /*
+  * second bad hack :/ override datepicker so it triggers an event when changing the input field
+  * and does not redraw the datepicker on every selectDate event
+  */
+  $.datepicker._base_updateDatepicker = $.datepicker._updateDatepicker;
+  $.datepicker._updateDatepicker = function (inst) {
+
+    // don't popup the datepicker if there is another instance already opened
+    var input = inst.input[0];
+    if ($.datepicker._curInst && $.datepicker._curInst != inst
+        && $.datepicker._datepickerShowing && $.datepicker._lastInput
+        != input) {
+      return;
+    }
+
+    if (typeof(inst.stay_open) !== 'boolean' || inst.stay_open === false) {
+
+      this._base_updateDatepicker(inst);
+
+      // Reload the time control when changing something in the input text field.
+      var tp_inst = this._get(inst, 'timepicker');
+      if (tp_inst) {
+        tp_inst._addTimePicker(inst);
+
+        if (tp_inst._defaults.useLocalTimezone) { //checks daylight saving with the new date.
+          var date = new Date(inst.selectedYear, inst.selectedMonth,
+              inst.selectedDay, 12);
+          selectLocalTimeZone(tp_inst, date);
+          tp_inst._onTimeChange();
+        }
+      }
+    }
+  };
+
+  /*
+  * third bad hack :/ override datepicker so it allows spaces and colon in the input field
+  */
+  $.datepicker._base_doKeyPress = $.datepicker._doKeyPress;
+  $.datepicker._doKeyPress = function (event) {
+    var inst = $.datepicker._getInst(event.target),
+        tp_inst = $.datepicker._get(inst, 'timepicker');
+
+    if (tp_inst) {
+      if ($.datepicker._get(inst, 'constrainInput')) {
+        var ampm = useAmpm(tp_inst._defaults.timeFormat),
+            dateChars = $.datepicker._possibleChars(
+                $.datepicker._get(inst, 'dateFormat')),
+            datetimeChars = tp_inst._defaults.timeFormat.toString()
+                .replace(/[hms]/g, '')
+                .replace(/TT/g, ampm ? 'APM' : '')
+                .replace(/Tt/g, ampm ? 'AaPpMm' : '')
+                .replace(/tT/g, ampm ? 'AaPpMm' : '')
+                .replace(/T/g, ampm ? 'AP' : '')
+                .replace(/tt/g, ampm ? 'apm' : '')
+                .replace(/t/g, ampm ? 'ap' : '') +
+                " " + tp_inst._defaults.separator +
+                tp_inst._defaults.timeSuffix +
+                (tp_inst._defaults.showTimezone
+                    ? tp_inst._defaults.timezoneList.join('') : '') +
+                (tp_inst._defaults.amNames.join(''))
+                + (tp_inst._defaults.pmNames.join('')) +
+                dateChars,
+            chr = String.fromCharCode(
+                event.charCode === undefined ? event.keyCode : event.charCode);
+        return event.ctrlKey || (chr < ' ' || !dateChars
+            || datetimeChars.indexOf(chr) > -1);
+      }
+    }
+
+    return $.datepicker._base_doKeyPress(event);
+  };
+
+  /*
+  * Fourth bad hack :/ override _updateAlternate function used in inline mode to init altField
+  */
+  $.datepicker._base_updateAlternate = $.datepicker._updateAlternate;
+  /* Update any alternate field to synchronise with the main field. */
+  $.datepicker._updateAlternate = function (inst) {
+    var tp_inst = this._get(inst, 'timepicker');
+    if (tp_inst) {
+      var altField = tp_inst._defaults.altField;
+      if (altField) { // update alternate field too
+        var altFormat = tp_inst._defaults.altFormat
+            || tp_inst._defaults.dateFormat,
+            date = this._getDate(inst),
+            formatCfg = $.datepicker._getFormatConfig(inst),
+            altFormattedDateTime = '',
+            altSeparator = tp_inst._defaults.altSeparator
+                ? tp_inst._defaults.altSeparator : tp_inst._defaults.separator,
+            altTimeSuffix = tp_inst._defaults.altTimeSuffix
+                ? tp_inst._defaults.altTimeSuffix
+                : tp_inst._defaults.timeSuffix,
+            altTimeFormat = tp_inst._defaults.altTimeFormat !== null
+                ? tp_inst._defaults.altTimeFormat
+                : tp_inst._defaults.timeFormat;
+
+        altFormattedDateTime += $.datepicker.formatTime(altTimeFormat, tp_inst,
+            tp_inst._defaults) + altTimeSuffix;
+        if (!tp_inst._defaults.timeOnly
+            && !tp_inst._defaults.altFieldTimeOnly) {
+          if (tp_inst._defaults.altFormat) {
+            altFormattedDateTime = $.datepicker.formatDate(
+                tp_inst._defaults.altFormat,
+                (date === null ? new Date() : date), formatCfg) + altSeparator
+                + altFormattedDateTime;
+          } else {
+            altFormattedDateTime = tp_inst.formattedDate + altSeparator
+                + altFormattedDateTime;
+          }
+        }
+        $(altField).val(altFormattedDateTime);
+      }
+    }
+    else {
+      $.datepicker._base_updateAlternate(inst);
+    }
+  };
+
+  /*
+  * Override key up event to sync manual input changes.
+  */
+  $.datepicker._base_doKeyUp = $.datepicker._doKeyUp;
+  $.datepicker._doKeyUp = function (event) {
+    var inst = $.datepicker._getInst(event.target),
+        tp_inst = $.datepicker._get(inst, 'timepicker');
+
+    if (tp_inst) {
+      if (tp_inst._defaults.timeOnly && (inst.input.val() != inst.lastVal)) {
+        try {
+          $.datepicker._updateDatepicker(inst);
+        } catch (err) {
+          $.datepicker.log(err);
+        }
+      }
+    }
+
+    return $.datepicker._base_doKeyUp(event);
+  };
+
+  /*
+  * override "Today" button to also grab the time.
+  */
+  $.datepicker._base_gotoToday = $.datepicker._gotoToday;
+  $.datepicker._gotoToday = function (id) {
+    var inst = this._getInst($(id)[0]),
+        $dp = inst.dpDiv;
+    this._base_gotoToday(id);
+    var tp_inst = this._get(inst, 'timepicker');
+    selectLocalTimeZone(tp_inst);
+    var now = new Date();
+    this._setTime(inst, now);
+    $('.ui-datepicker-today', $dp).click();
+  };
+
+  /*
+  * Disable & enable the Time in the datetimepicker
+  */
+  $.datepicker._disableTimepickerDatepicker = function (target) {
+    var inst = this._getInst(target);
+    if (!inst) {
+      return;
+    }
+
+    var tp_inst = this._get(inst, 'timepicker');
+    $(target).datepicker('getDate'); // Init selected[Year|Month|Day]
+    if (tp_inst) {
+      tp_inst._defaults.showTimepicker = false;
+      tp_inst._updateDateTime(inst);
+    }
+  };
+
+  $.datepicker._enableTimepickerDatepicker = function (target) {
+    var inst = this._getInst(target);
+    if (!inst) {
+      return;
+    }
+
+    var tp_inst = this._get(inst, 'timepicker');
+    $(target).datepicker('getDate'); // Init selected[Year|Month|Day]
+    if (tp_inst) {
+      tp_inst._defaults.showTimepicker = true;
+      tp_inst._addTimePicker(inst); // Could be disabled on page load
+      tp_inst._updateDateTime(inst);
+    }
+  };
+
+  /*
+  * Create our own set time function
+  */
+  $.datepicker._setTime = function (inst, date) {
+    var tp_inst = this._get(inst, 'timepicker');
+    if (tp_inst) {
+      var defaults = tp_inst._defaults;
+
+      // calling _setTime with no date sets time to defaults
+      tp_inst.hour = date ? date.getHours() : defaults.hour;
+      tp_inst.minute = date ? date.getMinutes() : defaults.minute;
+      tp_inst.second = date ? date.getSeconds() : defaults.second;
+      tp_inst.millisec = date ? date.getMilliseconds() : defaults.millisec;
+
+      //check if within min/max times..
+      tp_inst._limitMinMaxDateTime(inst, true);
+
+      tp_inst._onTimeChange();
+      tp_inst._updateDateTime(inst);
+    }
+  };
+
+  /*
+  * Create new public method to set only time, callable as $().datepicker('setTime', date)
+  */
+  $.datepicker._setTimeDatepicker = function (target, date, withDate) {
+    var inst = this._getInst(target);
+    if (!inst) {
+      return;
+    }
+
+    var tp_inst = this._get(inst, 'timepicker');
+
+    if (tp_inst) {
+      this._setDateFromField(inst);
+      var tp_date;
+      if (date) {
+        if (typeof date == "string") {
+          tp_inst._parseTime(date, withDate);
+          tp_date = new Date();
+          tp_date.setHours(tp_inst.hour, tp_inst.minute, tp_inst.second,
+              tp_inst.millisec);
+        } else {
+          tp_date = new Date(date.getTime());
+        }
+        if (tp_date.toString() == 'Invalid Date') {
+          tp_date = undefined;
+        }
+        this._setTime(inst, tp_date);
+      }
+    }
+
+  };
+
+  /*
+  * override setDate() to allow setting time too within Date object
+  */
+  $.datepicker._base_setDateDatepicker = $.datepicker._setDateDatepicker;
+  $.datepicker._setDateDatepicker = function (target, date) {
+    var inst = this._getInst(target);
+    if (!inst) {
+      return;
+    }
+
+    var tp_date = (date instanceof Date) ? new Date(date.getTime()) : date;
+
+    this._updateDatepicker(inst);
+    this._base_setDateDatepicker.apply(this, arguments);
+    this._setTimeDatepicker(target, tp_date, true);
+  };
+
+  /*
+  * override getDate() to allow getting time too within Date object
+  */
+  $.datepicker._base_getDateDatepicker = $.datepicker._getDateDatepicker;
+  $.datepicker._getDateDatepicker = function (target, noDefault) {
+    var inst = this._getInst(target);
+    if (!inst) {
+      return;
+    }
+
+    var tp_inst = this._get(inst, 'timepicker');
+
+    if (tp_inst) {
+      // if it hasn't yet been defined, grab from field
+      if (inst.lastVal === undefined) {
+        this._setDateFromField(inst, noDefault);
+      }
+
+      var date = this._getDate(inst);
+      if (date && tp_inst._parseTime($(target).val(), tp_inst.timeOnly)) {
+        date.setHours(tp_inst.hour, tp_inst.minute, tp_inst.second,
+            tp_inst.millisec);
+      }
+      return date;
+    }
+    return this._base_getDateDatepicker(target, noDefault);
+  };
+
+  /*
+  * override parseDate() because UI 1.8.14 throws an error about "Extra characters"
+  * An option in datapicker to ignore extra format characters would be nicer.
+  */
+  $.datepicker._base_parseDate = $.datepicker.parseDate;
+  $.datepicker.parseDate = function (format, value, settings) {
+    var date;
+    try {
+      date = this._base_parseDate(format, value, settings);
+    } catch (err) {
+      // Hack!  The error message ends with a colon, a space, and
+      // the "extra" characters.  We rely on that instead of
+      // attempting to perfectly reproduce the parsing algorithm.
+      date = this._base_parseDate(format,
+          value.substring(0, value.length - (err.length - err.indexOf(':')
+              - 2)), settings);
+      $.datepicker.log("Error parsing the date string: " + err
+          + "\ndate string = " + value + "\ndate format = " + format);
+    }
+    return date;
+  };
+
+  /*
+  * override formatDate to set date with time to the input
+  */
+  $.datepicker._base_formatDate = $.datepicker._formatDate;
+  $.datepicker._formatDate = function (inst, day, month, year) {
+    var tp_inst = this._get(inst, 'timepicker');
+    if (tp_inst) {
+      tp_inst._updateDateTime(inst);
+      return tp_inst.$input.val();
+    }
+    return this._base_formatDate(inst);
+  };
+
+  /*
+  * override options setter to add time to maxDate(Time) and minDate(Time). MaxDate
+  */
+  $.datepicker._base_optionDatepicker = $.datepicker._optionDatepicker;
+  $.datepicker._optionDatepicker = function (target, name, value) {
+    var inst = this._getInst(target),
+        name_clone;
+    if (!inst) {
+      return null;
+    }
+
+    var tp_inst = this._get(inst, 'timepicker');
+    if (tp_inst) {
+      var min = null,
+          max = null,
+          onselect = null,
+          overrides = tp_inst._defaults.evnts,
+          fns = {},
+          prop;
+      if (typeof name == 'string') { // if min/max was set with the string
+        if (name === 'minDate' || name === 'minDateTime') {
+          min = value;
+        } else if (name === 'maxDate' || name === 'maxDateTime') {
+          max = value;
+        } else if (name === 'onSelect') {
+          onselect = value;
+        } else if (overrides.hasOwnProperty(name)) {
+          if (typeof (value) === 'undefined') {
+            return overrides[name];
+          }
+          fns[name] = value;
+          name_clone = {}; //empty results in exiting function after overrides updated
+        }
+      } else if (typeof name == 'object') { //if min/max was set with the JSON
+        if (name.minDate) {
+          min = name.minDate;
+        } else if (name.minDateTime) {
+          min = name.minDateTime;
+        } else if (name.maxDate) {
+          max = name.maxDate;
+        } else if (name.maxDateTime) {
+          max = name.maxDateTime;
+        }
+        for (prop in overrides) {
+          if (overrides.hasOwnProperty(prop) && name[prop]) {
+            fns[prop] = name[prop];
+          }
+        }
+      }
+      for (prop in fns) {
+        if (fns.hasOwnProperty(prop)) {
+          overrides[prop] = fns[prop];
+          if (!name_clone) {
+            name_clone = $.extend({}, name);
+          }
+          delete name_clone[prop];
+        }
+      }
+      if (name_clone && isEmptyObject(name_clone)) {
+        return;
+      }
+      if (min) { //if min was set
+        if (min === 0) {
+          min = new Date();
+        } else {
+          min = new Date(min);
+        }
+        tp_inst._defaults.minDate = min;
+        tp_inst._defaults.minDateTime = min;
+      } else if (max) { //if max was set
+        if (max === 0) {
+          max = new Date();
+        } else {
+          max = new Date(max);
+        }
+        tp_inst._defaults.maxDate = max;
+        tp_inst._defaults.maxDateTime = max;
+      } else if (onselect) {
+        tp_inst._defaults.onSelect = onselect;
+      }
+    }
+    if (value === undefined) {
+      return this._base_optionDatepicker.call($.datepicker, target, name);
+    }
+    return this._base_optionDatepicker.call($.datepicker, target, name_clone
+        || name, value);
+  };
+  /*
+  * jQuery isEmptyObject does not check hasOwnProperty - if someone has added to the object prototype,
+  * it will return false for all objects
+  */
+  var isEmptyObject = function (obj) {
+    var prop;
+    for (prop in obj) {
+      if (obj.hasOwnProperty(obj)) {
+        return false;
+      }
+    }
+    return true;
+  };
+
+  /*
+  * jQuery extend now ignores nulls!
+  */
+  var extendRemove = function (target, props) {
+    $.extend(target, props);
+    for (var name in props) {
+      if (props[name] === null || props[name] === undefined) {
+        target[name] = props[name];
+      }
+    }
+    return target;
+  };
+
+  /*
+  * Determine by the time format if should use ampm
+  * Returns true if should use ampm, false if not
+  */
+  var useAmpm = function (timeFormat) {
+    return (timeFormat.indexOf('t') !== -1 && timeFormat.indexOf('h') !== -1);
+  };
+
+  /*
+  * Converts 24 hour format into 12 hour
+  * Returns 12 hour without leading 0
+  */
+  var convert24to12 = function (hour) {
+    if (hour > 12) {
+      hour = hour - 12;
+    }
+
+    if (hour == 0) {
+      hour = 12;
+    }
+
+    return String(hour);
+  };
+
+  /*
+  * Splits datetime string into date ans time substrings.
+  * Throws exception when date can't be parsed
+  * Returns [dateString, timeString]
+  */
+  var splitDateTime = function (dateFormat, dateTimeString, dateSettings,
+      timeSettings) {
+    try {
+      // The idea is to get the number separator occurances in datetime and the time format requested (since time has
+      // fewer unknowns, mostly numbers and am/pm). We will use the time pattern to split.
+      var separator = timeSettings && timeSettings.separator
+          ? timeSettings.separator : $.timepicker._defaults.separator,
+          format = timeSettings && timeSettings.timeFormat
+              ? timeSettings.timeFormat : $.timepicker._defaults.timeFormat,
+          timeParts = format.split(separator), // how many occurances of separator may be in our format?
+          timePartsLen = timeParts.length,
+          allParts = dateTimeString.split(separator),
+          allPartsLen = allParts.length;
+
+      if (allPartsLen > 1) {
+        return [
+          allParts.splice(0, allPartsLen - timePartsLen).join(separator),
+          allParts.splice(0, timePartsLen).join(separator)
+        ];
+      }
+
+    } catch (err) {
+      $.datepicker.log('Could not split the date from the time. Please check the following datetimepicker options'
+          +
+          "\nthrown error: " + err +
+          "\ndateTimeString" + dateTimeString +
+          "\ndateFormat = " + dateFormat +
+          "\nseparator = " + timeSettings.separator +
+          "\ntimeFormat = " + timeSettings.timeFormat);
+
+      if (err.indexOf(":") >= 0) {
+        // Hack!  The error message ends with a colon, a space, and
+        // the "extra" characters.  We rely on that instead of
+        // attempting to perfectly reproduce the parsing algorithm.
+        var dateStringLength = dateTimeString.length - (err.length
+            - err.indexOf(':') - 2),
+            timeString = dateTimeString.substring(dateStringLength);
+
+        return [$.trim(dateTimeString.substring(0, dateStringLength)),
+          $.trim(dateTimeString.substring(dateStringLength))];
+
+      } else {
+        throw err;
+      }
+    }
+    return [dateTimeString, ''];
+  };
+
+  /*
+  * Internal function to parse datetime interval
+  * Returns: {date: Date, timeObj: Object}, where
+  *   date - parsed date without time (type Date)
+  *   timeObj = {hour: , minute: , second: , millisec: } - parsed time. Optional
+  */
+  var parseDateTimeInternal = function (dateFormat, timeFormat, dateTimeString,
+      dateSettings, timeSettings) {
+    var date;
+    var splitRes = splitDateTime(dateFormat, dateTimeString, dateSettings,
+        timeSettings);
+    date = $.datepicker._base_parseDate(dateFormat, splitRes[0], dateSettings);
+    if (splitRes[1] !== '') {
+      var timeString = splitRes[1],
+          parsedTime = $.datepicker.parseTime(timeFormat, timeString,
+              timeSettings);
+
+      if (parsedTime === null) {
+        throw 'Wrong time format';
+      }
+      return {
+        date: date,
+        timeObj: parsedTime
+      };
+    } else {
+      return {
+        date: date
+      };
+    }
+  };
+
+  /*
+  * Internal function to set timezone_select to the local timezone
+  */
+  var selectLocalTimeZone = function (tp_inst, date) {
+    if (tp_inst && tp_inst.timezone_select) {
+      tp_inst._defaults.useLocalTimezone = true;
+      var now = typeof date !== 'undefined' ? date : new Date();
+      var tzoffset = $.timepicker.timeZoneOffsetString(now);
+      if (tp_inst._defaults.timezoneIso8601) {
+        tzoffset = tzoffset.substring(0, 3) + ':' + tzoffset.substring(3);
+      }
+      tp_inst.timezone_select.val(tzoffset);
+    }
+  };
+
+  /*
+  * Create a Singleton Insance
+  */
+  $.timepicker = new Timepicker();
+
+  /**
+   * Get the timezone offset as string from a date object (eg '+0530' for UTC+5.5)
+   * @param  date
+   * @return string
+   */
+  $.timepicker.timeZoneOffsetString = function (date) {
+    var off = date.getTimezoneOffset() * -1,
+        minutes = off % 60,
+        hours = (off - minutes) / 60;
+    return (off >= 0 ? '+' : '-') + ('0' + (hours * 101).toString()).substr(-2)
+        + ('0' + (minutes * 101).toString()).substr(-2);
+  };
+
+  /**
+   * Calls `timepicker()` on the `startTime` and `endTime` elements, and configures them to
+   * enforce date range limits.
+   * n.b. The input value must be correctly formatted (reformatting is not supported)
+   * @param  Element startTime
+   * @param  Element endTime
+   * @param  obj options Options for the timepicker() call
+   * @return jQuery
+   */
+  $.timepicker.timeRange = function (startTime, endTime, options) {
+    return $.timepicker.handleRange('timepicker', startTime, endTime, options);
+  };
+
+  /**
+   * Calls `datetimepicker` on the `startTime` and `endTime` elements, and configures them to
+   * enforce date range limits.
+   * @param  Element startTime
+   * @param  Element endTime
+   * @param  obj options Options for the `timepicker()` call. Also supports `reformat`,
+   *   a boolean value that can be used to reformat the input values to the `dateFormat`.
+   * @param  string method Can be used to specify the type of picker to be added
+   * @return jQuery
+   */
+  $.timepicker.dateTimeRange = function (startTime, endTime, options) {
+    $.timepicker.dateRange(startTime, endTime, options, 'datetimepicker');
+  };
+
+  /**
+   * Calls `method` on the `startTime` and `endTime` elements, and configures them to
+   * enforce date range limits.
+   * @param  Element startTime
+   * @param  Element endTime
+   * @param  obj options Options for the `timepicker()` call. Also supports `reformat`,
+   *   a boolean value that can be used to reformat the input values to the `dateFormat`.
+   * @param  string method Can be used to specify the type of picker to be added
+   * @return jQuery
+   */
+  $.timepicker.dateRange = function (startTime, endTime, options, method) {
+    method = method || 'datepicker';
+    $.timepicker.handleRange(method, startTime, endTime, options);
+  };
+
+  /**
+   * Calls `method` on the `startTime` and `endTime` elements, and configures them to
+   * enforce date range limits.
+   * @param  string method Can be used to specify the type of picker to be added
+   * @param  Element startTime
+   * @param  Element endTime
+   * @param  obj options Options for the `timepicker()` call. Also supports `reformat`,
+   *   a boolean value that can be used to reformat the input values to the `dateFormat`.
+   * @return jQuery
+   */
+  $.timepicker.handleRange = function (method, startTime, endTime, options) {
+    $.fn[method].call(startTime, $.extend({
+      onClose: function (dateText, inst) {
+        checkDates(this, endTime, dateText);
+      },
+      onSelect: function (selectedDateTime) {
+        selected(this, endTime, 'minDate');
+      }
+    }, options, options.start));
+    $.fn[method].call(endTime, $.extend({
+      onClose: function (dateText, inst) {
+        checkDates(this, startTime, dateText);
+      },
+      onSelect: function (selectedDateTime) {
+        selected(this, startTime, 'maxDate');
+      }
+    }, options, options.end));
+    // timepicker doesn't provide access to its 'timeFormat' option,
+    // nor could I get datepicker.formatTime() to behave with times, so I
+    // have disabled reformatting for timepicker
+    if (method != 'timepicker' && options.reformat) {
+      $([startTime, endTime]).each(function () {
+        var format = $(this)[method].call($(this), 'option', 'dateFormat'),
+            date = new Date($(this).val());
+        if ($(this).val() && date) {
+          $(this).val($.datepicker.formatDate(format, date));
+        }
+      });
+    }
+    checkDates(startTime, endTime, startTime.val());
+
+    function checkDates(changed, other, dateText) {
+      if (other.val() && (new Date(startTime.val()) > new Date(
+              endTime.val()))) {
+        other.val(dateText);
+      }
+    }
+
+    selected(startTime, endTime, 'minDate');
+    selected(endTime, startTime, 'maxDate');
+
+    function selected(changed, other, option) {
+      if (!$(changed).val()) {
+        return;
+      }
+      var date = $(changed)[method].call($(changed), 'getDate');
+      // timepicker doesn't implement 'getDate' and returns a jQuery
+      if (date.getTime) {
+        $(other)[method].call($(other), 'option', option, date);
+      }
+    }
+
+    return $([startTime.get(0), endTime.get(0)]);
+  };
+
+  /*
+  * Keep up with the version
+  */
+  $.timepicker.version = "1.1.1";
+
+})(jQuery);