浏览代码

AMBARI-918. Update styles in Cluster Management. (yusaku)

git-svn-id: https://svn.apache.org/repos/asf/incubator/ambari/branches/AMBARI-666@1402294 13f79535-47bb-0310-9956-ffa450edef68
Yusaku Sako 12 年之前
父节点
当前提交
1ace5cdfc2
共有 27 个文件被更改,包括 3229 次插入1987 次删除
  1. 2 0
      AMBARI-666-CHANGES.txt
  2. 二进制
      ambari-web/app/assets/img/jquery-ui-bootstrap/ui-bg_flat_0_aaaaaa_40x100.png
  3. 二进制
      ambari-web/app/assets/img/jquery-ui-bootstrap/ui-bg_glass_55_fbf9ee_1x400.png
  4. 二进制
      ambari-web/app/assets/img/jquery-ui-bootstrap/ui-bg_glass_65_ffffff_1x400.png
  5. 二进制
      ambari-web/app/assets/img/jquery-ui-bootstrap/ui-bg_glass_75_dadada_1x400.png
  6. 二进制
      ambari-web/app/assets/img/jquery-ui-bootstrap/ui-bg_glass_75_e6e6e6_1x400.png
  7. 二进制
      ambari-web/app/assets/img/jquery-ui-bootstrap/ui-bg_glass_75_ffffff_1x400.png
  8. 二进制
      ambari-web/app/assets/img/jquery-ui-bootstrap/ui-bg_highlight-soft_75_cccccc_1x100.png
  9. 二进制
      ambari-web/app/assets/img/jquery-ui-bootstrap/ui-bg_inset-soft_95_fef1ec_1x100.png
  10. 二进制
      ambari-web/app/assets/img/jquery-ui-bootstrap/ui-icons_222222_256x240.png
  11. 二进制
      ambari-web/app/assets/img/jquery-ui-bootstrap/ui-icons_2e83ff_256x240.png
  12. 二进制
      ambari-web/app/assets/img/jquery-ui-bootstrap/ui-icons_454545_256x240.png
  13. 二进制
      ambari-web/app/assets/img/jquery-ui-bootstrap/ui-icons_888888_256x240.png
  14. 二进制
      ambari-web/app/assets/img/jquery-ui-bootstrap/ui-icons_cd0a0a_256x240.png
  15. 二进制
      ambari-web/app/assets/img/jquery-ui-bootstrap/ui-icons_f6cf3b_256x240.png
  16. 20 2
      ambari-web/app/styles/application.less
  17. 13 10
      ambari-web/app/styles/apps.less
  18. 5 1
      ambari-web/app/templates/common/time_range.hbs
  19. 4 2
      ambari-web/app/templates/main/apps.hbs
  20. 72 20
      ambari-web/app/views/common/time_range.js
  21. 1 1
      ambari-web/app/views/main/host/summary.js
  22. 2 2
      ambari-web/app/views/main/menu.js
  23. 2 2
      ambari-web/config.coffee
  24. 0 454
      ambari-web/vendor/scripts/bootstrap-datepicker.js
  25. 1788 1487
      ambari-web/vendor/scripts/jquery-ui-timepicker-addon.js
  26. 0 6
      ambari-web/vendor/styles/datepicker.css
  27. 1320 0
      ambari-web/vendor/styles/jquery-ui-bootstrap/jquery-ui-1.8.16.custom.css

+ 2 - 0
AMBARI-666-CHANGES.txt

@@ -344,6 +344,8 @@ AMBARI-666 branch (unreleased changes)
 
   IMPROVEMENTS
 
+  AMBARI-918. Update styles in Cluster Management. (yusaku)
+
   AMBARI-917. Update layout and flow for App Browser. (yusaku)
 
   AMBARI-888. Add more tests for controller implementation. (hitesh)

二进制
ambari-web/app/assets/img/jquery-ui-bootstrap/ui-bg_flat_0_aaaaaa_40x100.png


二进制
ambari-web/app/assets/img/jquery-ui-bootstrap/ui-bg_glass_55_fbf9ee_1x400.png


二进制
ambari-web/app/assets/img/jquery-ui-bootstrap/ui-bg_glass_65_ffffff_1x400.png


二进制
ambari-web/app/assets/img/jquery-ui-bootstrap/ui-bg_glass_75_dadada_1x400.png


二进制
ambari-web/app/assets/img/jquery-ui-bootstrap/ui-bg_glass_75_e6e6e6_1x400.png


二进制
ambari-web/app/assets/img/jquery-ui-bootstrap/ui-bg_glass_75_ffffff_1x400.png


二进制
ambari-web/app/assets/img/jquery-ui-bootstrap/ui-bg_highlight-soft_75_cccccc_1x100.png


二进制
ambari-web/app/assets/img/jquery-ui-bootstrap/ui-bg_inset-soft_95_fef1ec_1x100.png


二进制
ambari-web/app/assets/img/jquery-ui-bootstrap/ui-icons_222222_256x240.png


二进制
ambari-web/app/assets/img/jquery-ui-bootstrap/ui-icons_2e83ff_256x240.png


二进制
ambari-web/app/assets/img/jquery-ui-bootstrap/ui-icons_454545_256x240.png


二进制
ambari-web/app/assets/img/jquery-ui-bootstrap/ui-icons_888888_256x240.png


二进制
ambari-web/app/assets/img/jquery-ui-bootstrap/ui-icons_cd0a0a_256x240.png


二进制
ambari-web/app/assets/img/jquery-ui-bootstrap/ui-icons_f6cf3b_256x240.png


+ 20 - 2
ambari-web/app/styles/application.less

@@ -141,6 +141,7 @@ footer {
   li.span2 {
     padding: 0;
     margin: 0;
+    width: 140px;
   }
 
   margin-bottom: 20px;
@@ -1404,7 +1405,7 @@ ul.inline li {
 
 /* TIME RANGE WIDGET */
 
-/* css for timepicker */
+/* start css for timepicker */
 .ui-timepicker-div .ui-widget-header {
   margin-bottom: 8px;
 }
@@ -1444,6 +1445,23 @@ ul.inline li {
 .ui-timepicker-rtl dl dd {
   margin: 0 65px 10px 10px;
 }
+/* end css for timepicker */
+
+#slider {
+  margin: 10px 0 40px;
+  width: 330px;
+
+  .now-marker {
+    position: absolute;
+    right: -15px;
+    bottom: -23px;
+  }
+  .period-marker {
+    position: absolute;
+    left: -15px;
+    bottom: -23px;
+  }
+}
 
 /* TIME RANGE WIDGET END */
 
@@ -1488,4 +1506,4 @@ ul.inline li {
   display: block;
   width: 105px;
   margin-bottom: 10px;
-}
+}

+ 13 - 10
ambari-web/app/styles/apps.less

@@ -1,37 +1,40 @@
-#apps{
+#apps {
   .search-bar {
-    float:right;
+    float: right;
+    margin-top: -40px;
   }
   .dataTable {
     border: 1px solid silver;
     th {
-      border-top:none;
+      border-top: none;
     }
   }
+  .dataTables_wrapper {
+    margin-top: 10px;
+  }
   #filter_info {
-    float:left;
-    padding-top:10px;
+    padding-top: 10px;
   }
   .page-bar {
     border: 1px solid silver;
-    text-align:right;
+    text-align: right;
     div {
       display: inline-block;
-      margin:0 10px;
+      margin: 0 10px;
     }
     .dataTables_length {
       label {
-        display:inline;
+        display: inline;
       }
       select {
         margin-bottom: 4px;
         margin-top: 4px;
-        width:70px;
+        width: 70px;
       }
     }
     .dataTables_paginate {
       a {
-        padding:0 5px;
+        padding: 0 5px;
       }
     }
   }

+ 5 - 1
ambari-web/app/templates/common/time_range.hbs

@@ -24,4 +24,8 @@
   {{/each}}
   From {{view view.dateFromView}}
   To {{view view.dateToView}}
-</ul>
+</ul>
+<div id="slider">
+  <sapn class="period-marker">{{view.rangeLabel}}</sapn>
+  <sapn class="now-marker">{{view.nowLabel}}</sapn>
+</div>

+ 4 - 2
ambari-web/app/templates/main/apps.hbs

@@ -17,8 +17,10 @@
 -->
 <div id="apps">
     <div id="filter_info" class="row">
-      <div class="span3">Show: <a href="javascript:void(0)">filtered(400)</a>&nbsp;&#124;&nbsp;<a href="javascript:void(0)">starred(20)</a></div>
-      <div class="span2 offset1"><a href="javascript:void(0)">Clear filters</a>&nbsp;&#124;&nbsp;<a href="javascript:void(0)">Clear stars</a></div>
+      <div class="span3">Show: <a href="javascript:void(0)">Filtered (400)</a>&nbsp;&#124;&nbsp;<a href="javascript:void(0)">Starred (20)</a></div>
+      <div class="span2"><a href="javascript:void(0)">Clear filters</a>&nbsp;&#124;&nbsp;<a href="javascript:void(0)">Clear stars</a></div>
+    </div>
+    <div>
     </div>
     <table class="table table-striped" id="dataTable">
     <thead>

+ 72 - 20
ambari-web/app/views/common/time_range.js

@@ -26,21 +26,25 @@ var App = require('app');
  */
 App.TimeRangeWidget = Em.View.extend({
   classNames:['time-range-widget'],
+  templateName:require('templates/common/time_range'),
+  dateFrom: null,
+  dateTo: null,
+
   /**
    * presets
    */
   presets:[
-    Em.Object.create({ label:Em.I18n.t('timeRange.presets.1hour'), value:'1h'}),
-    Em.Object.create({ label:Em.I18n.t('timeRange.presets.12hour'), value:'12h'}),
-    Em.Object.create({ label:Em.I18n.t('timeRange.presets.1day'), value:'1d'}),
-    Em.Object.create({ label:Em.I18n.t('timeRange.presets.1week'), value:'1wk'}),
-    Em.Object.create({ label:Em.I18n.t('timeRange.presets.1month'), value:'1mo'}),
-    Em.Object.create({ label:Em.I18n.t('timeRange.presets.1year'), value:'1yr'})
+    Em.Object.create({ label:Em.I18n.t('timeRange.presets.1hour'), value:'1h', period: 3600000, step: 300000}),
+    Em.Object.create({ label:Em.I18n.t('timeRange.presets.12hour'), value:'12h', period: 43200000, step: 3600000}),
+    Em.Object.create({ label:Em.I18n.t('timeRange.presets.1day'), value:'1d', period: 86400000, step: 3600000}),
+    Em.Object.create({ label:Em.I18n.t('timeRange.presets.1week'), value:'1wk', period: 604800000, step: 86400000}),
+    Em.Object.create({ label:Em.I18n.t('timeRange.presets.1month'), value:'1mo', period: 2592000000, step: 86400000}),
+    Em.Object.create({ label:Em.I18n.t('timeRange.presets.1year'), value:'1yr', period: 31536000000, step: 2592000000})
   ],
   /**
    * chosen preset value
    */
-  chosenPreset:'1h',
+  chosenPreset: null,
 
   /**
    * return array of chosen presets
@@ -59,9 +63,9 @@ App.TimeRangeWidget = Em.View.extend({
       return this.get('isActive') ? "disabled" : false;
     }.property('isActive'),
     isActive:function () {
-      return this.get('preset.value') == this.get('widget.chosenPreset');
+      return this.get('preset.value') == this.get('widget.chosenPreset.value');
     }.property('widget.chosenPreset'),
-    template:Em.Handlebars.compile('<a {{action activate view.preset.value target="view.widget" href="true" }}>{{unbound view.preset.label}}</a>')
+    template:Em.Handlebars.compile('<a {{action activate view.preset target="view.widget" href="true" }}>{{unbound view.preset.label}}</a>')
   }),
 
   /**
@@ -96,11 +100,13 @@ App.TimeRangeWidget = Em.View.extend({
    * @param event
    */
   activate:function (event) {
-    this.set('chosenPreset', event.context);
+    if (event.context == this.get('chosenPreset')) {
+      this.set('chosenPreset', null);
+    } else {
+      this.set('chosenPreset', event.context);
+    }
   },
 
-  templateName:require('templates/common/time_range'),
-
   dateFromView: Ember.TextField.extend({
     elementId: 'timeRangeFrom',
     classNames: 'timeRangeFrom',
@@ -108,7 +114,7 @@ App.TimeRangeWidget = Em.View.extend({
     readonly: true,
     didInsertElement: function() {
       var self = this;
-      $('#timeRangeFrom').datetimepicker({
+      this.$().datetimepicker({
         dateFormat: 'dd/mm/yy',
         timeFormat: 'hh:mm',
         maxDate: new Date(),
@@ -119,8 +125,7 @@ App.TimeRangeWidget = Em.View.extend({
             var testEndDate = new Date(endDateTextBox.val());
             if (testStartDate > testEndDate)
               endDateTextBox.val(dateText);
-          }
-          else {
+          } else {
             endDateTextBox.val(dateText);
           }
           self.set('dateFrom', dateText);
@@ -141,10 +146,10 @@ App.TimeRangeWidget = Em.View.extend({
     readonly: true,
     didInsertElement: function() {
       var self = this;
-      $('#timeRangeTo').datetimepicker({
-        maxDate: new Date(),
+      this.$().datetimepicker({
         dateFormat: 'dd/mm/yy',
         timeFormat: 'hh:mm',
+        maxDate: new Date(),
         onClose:function (dateText, inst) {
           var startDateTextBox = $('#timeRangeFrom');
           if (startDateTextBox.val() != '') {
@@ -152,8 +157,7 @@ App.TimeRangeWidget = Em.View.extend({
             var testEndDate = new Date(dateText);
             if (testStartDate > testEndDate)
               startDateTextBox.val(dateText);
-          }
-          else {
+          } else {
             startDateTextBox.val(dateText);
           }
           self.set('dateTo', dateText);
@@ -165,5 +169,53 @@ App.TimeRangeWidget = Em.View.extend({
       });
       self.set('dateTo', this.get('value'));
     }
-  })
+  }),
+
+  sliderOptions: Ember.Object.extend({
+    end: null,
+    period: null,
+    start: function() {
+      return this.get('end') - this.get('period');
+    }.property('end', 'period')
+  }),
+  nowLabel: null,
+  rangeLabel: null,
+  buildSlider: function() {
+    if (this.get('chosenPreset')) {
+      var sliderOptions = this.sliderOptions.create({
+        end: function() {
+          var endDate = new Date();
+          return endDate.getTime();
+        }.property(),
+        period: this.get('chosenPreset.period'),
+        step: this.get('chosenPreset.step'),
+        countTimeAgo: function(stepValue) {
+          var msAgo = this.get('end') - stepValue;
+          return msAgo.toDaysHoursMinutes();
+        }
+      });
+      this.set('nowLabel', 'Now');
+      this.set('rangeLabel', new Date(sliderOptions.get('start')));
+
+      var self = this;
+      $('#slider').slider({
+        range: "max",
+        min: sliderOptions.get('start'),
+        max: sliderOptions.get('end'),
+        value: sliderOptions.get('start'),
+        step: sliderOptions.get('step'),
+        stop: function(event, ui) {
+          self.set('rangeLabel', new Date(ui.value));
+//          self.set('rangeLabel', sliderOptions.countTimeAgo(ui.value).h);
+        },
+        slide: function(event, ui){
+          self.set('rangeLabel', new Date(ui.value));
+//          self.set('rangeLabel', sliderOptions.countTimeAgo(ui.value).h);
+        }
+      });
+    } else {
+      console.log(this.get('chosenPreset'));
+      $("#slider").slider("destroy");
+    }
+  }.observes('chosenPreset')
 })

+ 1 - 1
ambari-web/app/views/main/host/summary.js

@@ -26,7 +26,7 @@ App.MainHostSummaryView = Em.View.extend({
   ComponentButtonView: Em.View.extend({
     content: null,
     adjustedIndex: function() {
-      return this.getPath('_parentView.contentIndex') + 1;
+      return this.get('_parentView.contentIndex') + 1;
     }.property(),
     positionButton: function() {
       return (this.get("adjustedIndex")%2 == 0) ? true : false;

+ 2 - 2
ambari-web/app/views/main/menu.js

@@ -30,8 +30,8 @@ App.MainMenuView = Em.CollectionView.extend({
     { label:'Charts', routing:'charts'},
     { label:'Services', routing:'services'},
     { label:'Hosts', routing:'hosts'},
-    { label:'Admin', routing:'admin'},
-    { label:'Apps', routing:'apps'}
+    { label:'Apps', routing:'apps'},
+    { label:'Admin', routing:'admin'}
   ],
 
   /**

+ 2 - 2
ambari-web/config.coffee

@@ -61,8 +61,8 @@ exports.config =
       order:
         before: [
           'vendor/styles/bootstrap.css',
-          'vendor/styles/datepicker.css',
-          'vendor/styles/font-awesome.css',
+#          'vendor/styles/datepicker.css'
+          'vendor/styles/font-awesome.css'
           'vendor/styles/font-awesome-ie7.css',
           'vendor/styles/cubism.css',
           'vendor/styles/rickshaw.css'

+ 0 - 454
ambari-web/vendor/scripts/bootstrap-datepicker.js

@@ -1,454 +0,0 @@
-/* =========================================================
- * bootstrap-datepicker.js 
- * http://www.eyecon.ro/bootstrap-datepicker
- * =========================================================
- * Copyright 2012 Stefan Petre
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ========================================================= */
- 
-!function( $ ) {
-	
-	// Picker object
-	
-	var Datepicker = function(element, options){
-		this.element = $(element);
-		this.format = DPGlobal.parseFormat(options.format||this.element.data('date-format')||'mm/dd/yyyy');
-		this.picker = $(DPGlobal.template)
-							.appendTo('body')
-							.on({
-								click: $.proxy(this.click, this),
-								mousedown: $.proxy(this.mousedown, this)
-							});
-		this.isInput = this.element.is('input');
-		this.component = this.element.is('.date') ? this.element.find('.add-on') : false;
-		
-		if (this.isInput) {
-			this.element.on({
-				focus: $.proxy(this.show, this),
-				blur: $.proxy(this.hide, this),
-				keyup: $.proxy(this.update, this)
-			});
-		} else {
-			if (this.component){
-				this.component.on('click', $.proxy(this.show, this));
-			} else {
-				this.element.on('click', $.proxy(this.show, this));
-			}
-		}
-		this.minViewMode = options.minViewMode||this.element.data('date-minviewmode')||0;
-		if (typeof this.minViewMode === 'string') {
-			switch (this.minViewMode) {
-				case 'months':
-					this.minViewMode = 1;
-					break;
-				case 'years':
-					this.minViewMode = 2;
-					break;
-				default:
-					this.minViewMode = 0;
-					break;
-			}
-		}
-		this.viewMode = options.viewMode||this.element.data('date-viewmode')||0;
-		if (typeof this.viewMode === 'string') {
-			switch (this.viewMode) {
-				case 'months':
-					this.viewMode = 1;
-					break;
-				case 'years':
-					this.viewMode = 2;
-					break;
-				default:
-					this.viewMode = 0;
-					break;
-			}
-		}
-		this.startViewMode = this.viewMode;
-		this.weekStart = options.weekStart||this.element.data('date-weekstart')||0;
-		this.weekEnd = this.weekStart === 0 ? 6 : this.weekStart - 1;
-		this.fillDow();
-		this.fillMonths();
-		this.update();
-		this.showMode();
-	};
-	
-	Datepicker.prototype = {
-		constructor: Datepicker,
-		
-		show: function(e) {
-			this.picker.show();
-			this.height = this.component ? this.component.outerHeight() : this.element.outerHeight();
-			this.place();
-			$(window).on('resize', $.proxy(this.place, this));
-			if (e ) {
-				e.stopPropagation();
-				e.preventDefault();
-			}
-			if (!this.isInput) {
-				$(document).on('mousedown', $.proxy(this.hide, this));
-			}
-			this.element.trigger({
-				type: 'show',
-				date: this.date
-			});
-		},
-		
-		hide: function(){
-			this.picker.hide();
-			$(window).off('resize', this.place);
-			this.viewMode = this.startViewMode;
-			this.showMode();
-			if (!this.isInput) {
-				$(document).off('mousedown', this.hide);
-			}
-			this.set();
-			this.element.trigger({
-				type: 'hide',
-				date: this.date
-			});
-		},
-		
-		set: function() {
-			var formated = DPGlobal.formatDate(this.date, this.format);
-			if (!this.isInput) {
-				if (this.component){
-					this.element.find('input').prop('value', formated);
-				}
-				this.element.data('date', formated);
-			} else {
-				this.element.prop('value', formated);
-			}
-		},
-		
-		setValue: function(newDate) {
-			if (typeof newDate === 'string') {
-				this.date = DPGlobal.parseDate(newDate, this.format);
-			} else {
-				this.date = new Date(newDate);
-			}
-			this.set();
-			this.viewDate = new Date(this.date.getFullYear(), this.date.getMonth(), 1, 0, 0, 0, 0);
-			this.fill();
-		},
-		
-		place: function(){
-			var offset = this.component ? this.component.offset() : this.element.offset();
-			this.picker.css({
-				top: offset.top + this.height,
-				left: offset.left
-			});
-		},
-		
-		update: function(newDate){
-			this.date = DPGlobal.parseDate(
-				typeof newDate === 'string' ? newDate : (this.isInput ? this.element.prop('value') : this.element.data('date')),
-				this.format
-			);
-			this.viewDate = new Date(this.date.getFullYear(), this.date.getMonth(), 1, 0, 0, 0, 0);
-			this.fill();
-		},
-		
-		fillDow: function(){
-			var dowCnt = this.weekStart;
-			var html = '<tr>';
-			while (dowCnt < this.weekStart + 7) {
-				html += '<th class="dow">'+DPGlobal.dates.daysMin[(dowCnt++)%7]+'</th>';
-			}
-			html += '</tr>';
-			this.picker.find('.datepicker-days thead').append(html);
-		},
-		
-		fillMonths: function(){
-			var html = '';
-			var i = 0
-			while (i < 12) {
-				html += '<span class="month">'+DPGlobal.dates.monthsShort[i++]+'</span>';
-			}
-			this.picker.find('.datepicker-months td').append(html);
-		},
-		
-		fill: function() {
-			var d = new Date(this.viewDate),
-				year = d.getFullYear(),
-				month = d.getMonth(),
-				currentDate = this.date.valueOf();
-			this.picker.find('.datepicker-days th:eq(1)')
-						.text(DPGlobal.dates.months[month]+' '+year);
-			var prevMonth = new Date(year, month-1, 28,0,0,0,0),
-				day = DPGlobal.getDaysInMonth(prevMonth.getFullYear(), prevMonth.getMonth());
-			prevMonth.setDate(day);
-			prevMonth.setDate(day - (prevMonth.getDay() - this.weekStart + 7)%7);
-			var nextMonth = new Date(prevMonth);
-			nextMonth.setDate(nextMonth.getDate() + 42);
-			nextMonth = nextMonth.valueOf();
-			html = [];
-			var clsName;
-			while(prevMonth.valueOf() < nextMonth) {
-				if (prevMonth.getDay() === this.weekStart) {
-					html.push('<tr>');
-				}
-				clsName = '';
-				if (prevMonth.getMonth() < month) {
-					clsName += ' old';
-				} else if (prevMonth.getMonth() > month) {
-					clsName += ' new';
-				}
-				if (prevMonth.valueOf() === currentDate) {
-					clsName += ' active';
-				}
-				html.push('<td class="day'+clsName+'">'+prevMonth.getDate() + '</td>');
-				if (prevMonth.getDay() === this.weekEnd) {
-					html.push('</tr>');
-				}
-				prevMonth.setDate(prevMonth.getDate()+1);
-			}
-			this.picker.find('.datepicker-days tbody').empty().append(html.join(''));
-			var currentYear = this.date.getFullYear();
-			
-			var months = this.picker.find('.datepicker-months')
-						.find('th:eq(1)')
-							.text(year)
-							.end()
-						.find('span').removeClass('active');
-			if (currentYear === year) {
-				months.eq(this.date.getMonth()).addClass('active');
-			}
-			
-			html = '';
-			year = parseInt(year/10, 10) * 10;
-			var yearCont = this.picker.find('.datepicker-years')
-								.find('th:eq(1)')
-									.text(year + '-' + (year + 9))
-									.end()
-								.find('td');
-			year -= 1;
-			for (var i = -1; i < 11; i++) {
-				html += '<span class="year'+(i === -1 || i === 10 ? ' old' : '')+(currentYear === year ? ' active' : '')+'">'+year+'</span>';
-				year += 1;
-			}
-			yearCont.html(html);
-		},
-		
-		click: function(e) {
-			e.stopPropagation();
-			e.preventDefault();
-			var target = $(e.target).closest('span, td, th');
-			if (target.length === 1) {
-				switch(target[0].nodeName.toLowerCase()) {
-					case 'th':
-						switch(target[0].className) {
-							case 'switch':
-								this.showMode(1);
-								break;
-							case 'prev':
-							case 'next':
-								this.viewDate['set'+DPGlobal.modes[this.viewMode].navFnc].call(
-									this.viewDate,
-									this.viewDate['get'+DPGlobal.modes[this.viewMode].navFnc].call(this.viewDate) + 
-									DPGlobal.modes[this.viewMode].navStep * (target[0].className === 'prev' ? -1 : 1)
-								);
-								this.fill();
-								this.set();
-								break;
-						}
-						break;
-					case 'span':
-						if (target.is('.month')) {
-							var month = target.parent().find('span').index(target);
-							this.viewDate.setMonth(month);
-						} else {
-							var year = parseInt(target.text(), 10)||0;
-							this.viewDate.setFullYear(year);
-						}
-						if (this.viewMode !== 0) {
-							this.date = new Date(this.viewDate);
-							this.element.trigger({
-								type: 'changeDate',
-								date: this.date,
-								viewMode: DPGlobal.modes[this.viewMode].clsName
-							});
-						}
-						this.showMode(-1);
-						this.fill();
-						this.set();
-						break;
-					case 'td':
-						if (target.is('.day')){
-							var day = parseInt(target.text(), 10)||1;
-							var month = this.viewDate.getMonth();
-							if (target.is('.old')) {
-								month -= 1;
-							} else if (target.is('.new')) {
-								month += 1;
-							}
-							var year = this.viewDate.getFullYear();
-							this.date = new Date(year, month, day,0,0,0,0);
-							this.viewDate = new Date(year, month, Math.min(28, day),0,0,0,0);
-							this.fill();
-							this.set();
-							this.element.trigger({
-								type: 'changeDate',
-								date: this.date,
-								viewMode: DPGlobal.modes[this.viewMode].clsName
-							});
-						}
-						break;
-				}
-			}
-		},
-		
-		mousedown: function(e){
-			e.stopPropagation();
-			e.preventDefault();
-		},
-		
-		showMode: function(dir) {
-			if (dir) {
-				this.viewMode = Math.max(this.minViewMode, Math.min(2, this.viewMode + dir));
-			}
-			this.picker.find('>div').hide().filter('.datepicker-'+DPGlobal.modes[this.viewMode].clsName).show();
-		}
-	};
-	
-	$.fn.datepicker = function ( option, val ) {
-		return this.each(function () {
-			var $this = $(this),
-				data = $this.data('datepicker'),
-				options = typeof option === 'object' && option;
-			if (!data) {
-				$this.data('datepicker', (data = new Datepicker(this, $.extend({}, $.fn.datepicker.defaults,options))));
-			}
-			if (typeof option === 'string') data[option](val);
-		});
-	};
-
-	$.fn.datepicker.defaults = {
-	};
-	$.fn.datepicker.Constructor = Datepicker;
-	
-	var DPGlobal = {
-		modes: [
-			{
-				clsName: 'days',
-				navFnc: 'Month',
-				navStep: 1
-			},
-			{
-				clsName: 'months',
-				navFnc: 'FullYear',
-				navStep: 1
-			},
-			{
-				clsName: 'years',
-				navFnc: 'FullYear',
-				navStep: 10
-		}],
-		dates:{
-			days: ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday"],
-			daysShort: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"],
-			daysMin: ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa", "Su"],
-			months: ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"],
-			monthsShort: ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"]
-		},
-		isLeapYear: function (year) {
-			return (((year % 4 === 0) && (year % 100 !== 0)) || (year % 400 === 0))
-		},
-		getDaysInMonth: function (year, month) {
-			return [31, (DPGlobal.isLeapYear(year) ? 29 : 28), 31, 30, 31, 30, 31, 31, 30, 31, 30, 31][month]
-		},
-		parseFormat: function(format){
-			var separator = format.match(/[.\/\-\s].*?/),
-				parts = format.split(/\W+/);
-			if (!separator || !parts || parts.length === 0){
-				throw new Error("Invalid date format.");
-			}
-			return {separator: separator, parts: parts};
-		},
-		parseDate: function(date, format) {
-			var parts = date.split(format.separator),
-				date = new Date(),
-				val;
-			date.setHours(0);
-			date.setMinutes(0);
-			date.setSeconds(0);
-			date.setMilliseconds(0);
-			if (parts.length === format.parts.length) {
-				for (var i=0, cnt = format.parts.length; i < cnt; i++) {
-					val = parseInt(parts[i], 10)||1;
-					switch(format.parts[i]) {
-						case 'dd':
-						case 'd':
-							date.setDate(val);
-							break;
-						case 'mm':
-						case 'm':
-							date.setMonth(val - 1);
-							break;
-						case 'yy':
-							date.setFullYear(2000 + val);
-							break;
-						case 'yyyy':
-							date.setFullYear(val);
-							break;
-					}
-				}
-			}
-			return date;
-		},
-		formatDate: function(date, format){
-			var val = {
-				d: date.getDate(),
-				m: date.getMonth() + 1,
-				yy: date.getFullYear().toString().substring(2),
-				yyyy: date.getFullYear()
-			};
-			val.dd = (val.d < 10 ? '0' : '') + val.d;
-			val.mm = (val.m < 10 ? '0' : '') + val.m;
-			var date = [];
-			for (var i=0, cnt = format.parts.length; i < cnt; i++) {
-				date.push(val[format.parts[i]]);
-			}
-			return date.join(format.separator);
-		},
-		headTemplate: '<thead>'+
-							'<tr>'+
-								'<th class="prev">&lsaquo;</th>'+
-								'<th colspan="5" class="switch"></th>'+
-								'<th class="next">&rsaquo;</th>'+
-							'</tr>'+
-						'</thead>',
-		contTemplate: '<tbody><tr><td colspan="7"></td></tr></tbody>'
-	};
-	DPGlobal.template = '<div class="datepicker dropdown-menu">'+
-							'<div class="datepicker-days">'+
-								'<table class=" table-condensed">'+
-									DPGlobal.headTemplate+
-									'<tbody></tbody>'+
-								'</table>'+
-							'</div>'+
-							'<div class="datepicker-months">'+
-								'<table class="table-condensed">'+
-									DPGlobal.headTemplate+
-									DPGlobal.contTemplate+
-								'</table>'+
-							'</div>'+
-							'<div class="datepicker-years">'+
-								'<table class="table-condensed">'+
-									DPGlobal.headTemplate+
-									DPGlobal.contTemplate+
-								'</table>'+
-							'</div>'+
-						'</div>';
-
-}( window.jQuery )

+ 1788 - 1487
ambari-web/vendor/scripts/jquery-ui-timepicker-addon.js

@@ -1,1530 +1,1831 @@
 /*
-* jQuery timepicker addon
-* By: Trent Richardson [http://trentrichardson.com]
-* Version 1.0.1
-* Last Modified: 07/01/2012
-*
-* Copyright 2012 Trent Richardson
-* You may use this project under MIT or GPL licenses.
-* http://trentrichardson.com/Impromptu/GPL-LICENSE.txt
-* http://trentrichardson.com/Impromptu/MIT-LICENSE.txt
-*
-* HERES THE CSS:
-* .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; }
-*/
-
-/*jslint evil: true, maxlen: 300, white: false, undef: false, nomen: false, onevar: false */
+ * jQuery timepicker addon
+ * By: Trent Richardson [http://trentrichardson.com]
+ * Version 1.0.5
+ * Last Modified: 10/06/2012
+ *
+ * Copyright 2012 Trent Richardson
+ * You may use this project under MIT or GPL licenses.
+ * http://trentrichardson.com/Impromptu/GPL-LICENSE.txt
+ * http://trentrichardson.com/Impromptu/MIT-LICENSE.txt
+ */
+
+/*jslint evil: true, white: false, undef: false, nomen: false */
 
 (function($) {
 
-// Prevent "Uncaught RangeError: Maximum call stack size exceeded"
-$.ui.timepicker = $.ui.timepicker || {};
-if ($.ui.timepicker.version) {
-	return;
-}
-
-$.extend($.ui, { timepicker: { version: "1.0.1" } });
-
-/* Time picker 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',
-		ampm: false,
-		amNames: ['AM', 'A'],
-		pmNames: ['PM', 'P'],
-		timeFormat: 'hh:mm tt',
-		timeSuffix: '',
-		timeOnlyTitle: 'Choose Time',
-		timeText: 'Time',
-		hourText: 'Hour',
-		minuteText: 'Minute',
-		secondText: 'Second',
-		millisecText: 'Millisecond',
-		timezoneText: 'Time Zone'
-	};
-	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,
-		showTimepicker: true,
-		timezoneIso8601: false,
-		timezoneList: null,
-		addSliderAccess: false,
-		sliderAccessArgs: null
-	};
-	$.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,
-
-	/* 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 = {};
-
-		for (var attrName in this._defaults) {
-			var attrValue = $input.attr('time:' + attrName);
-			if (attrValue) {
-				try {
-					inlineSettings[attrName] = eval(attrValue);
-				} catch (err) {
-					inlineSettings[attrName] = attrValue;
-				}
-			}
-		}
-		tp_inst._defaults = $.extend({}, this._defaults, inlineSettings, o, {
-			beforeShow: function(input, dp_inst) {
-				if ($.isFunction(o.beforeShow)) {
-					return o.beforeShow(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(o.onChangeMonthYear)) {
-					o.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);
+  /*
+   * 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.0.5"
+    }
+  });
+
+  /*
+   * Timepicker manager.
+   * Use the singleton instance of this class, $.timepicker, to interact with the time picker.
+   * Settings for (groups of) time pickers are maintained in an instance object,
+   * allowing multiple different settings on the same page.
+   */
+  function Timepicker() {
+    this.regional = []; // Available regional settings, indexed by language code
+    this.regional[''] = { // Default regional settings
+      currentText: 'Now',
+      closeText: 'Done',
+      ampm: false,
+      amNames: ['AM', 'A'],
+      pmNames: ['PM', 'P'],
+      timeFormat: 'hh:mm tt',
+      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,
+      altSeparator: null,
+      altTimeSuffix: null,
+      showTimepicker: true,
+      timezoneIso8601: false,
+      timezoneList: null,
+      addSliderAccess: false,
+      sliderAccessArgs: null,
+      controlType: 'slider',
+      defaultValue: null
+    };
+    $.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(tp_inst._defaults.controlType == 'slider' && $.fn.slider === undefined){
+          tp_inst._defaults.controlType = 'select';
+        }
+        tp_inst.control = tp_inst._controls[tp_inst._defaults.controlType];
+      }
+      // controlType is an object and must implement create, options, value methods
+      else{
+        tp_inst.control = tp_inst._defaults.controlType;
+      }
+
+      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) {
+          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 = (o.ampm && h > 12) ? h - 12 : h;
+                if (tmph < 10) {
+                  tmph = '0' + tmph;
                 }
-				if ($.isFunction(o.onClose)) {
-					o.onClose.call($input[0], dateText, dp_inst, tp_inst);
+                if (o.ampm) {
+                  if (h === 0) {
+                    tmph = 12 + 'a';
+                  } else {
+                    if (h < 12) {
+                      tmph += 'a';
+                    } else {
+                      tmph += 'p';
+                    }
+                  }
                 }
-			},
-			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(); });
-
-		if (tp_inst._defaults.timezoneList === null) {
-			var timezoneList = [];
-			for (var i = -11; i <= 12; i++) {
-				timezoneList.push((i >= 0 ? '+' : '-') + ('0' + Math.abs(i).toString()).slice(-2) + '00');
+                html += '<td data-for="'+litem+'">' + tmph + '</td>';
+              }
             }
-			if (tp_inst._defaults.timezoneIso8601) {
-				timezoneList = $.map(timezoneList, function(val) {
-					return val == '+0000' ? 'Z' : (val.substring(0, 3) + ':' + val.substring(3));
-				});
+            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>';
+              }
             }
-			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"); });
+
+            html += '</tr></table></div>';
+          }
+          html += '</dd>';
         }
 
-		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());
+        // 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();
         }
-		if(tp_inst._defaults.minDateTime !== undefined && tp_inst._defaults.minDateTime instanceof Date) {
-			tp_inst._defaults.minDate = new Date(tp_inst._defaults.minDateTime.getTime());
+
+        // 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(),
+                  f = $t.data('for'); // loses scope, so we use data-for
+
+                if (f == 'hour' && o.ampm) {
+                  var ap = h.substring(2).toLowerCase(),
+                    aph = parseInt(h.substring(0, 2), 10);
+                  if (ap == 'a') {
+                    if (aph == 12) {
+                      h = 0;
+                    } else {
+                      h = aph;
+                    }
+                  } else if (aph == 12) {
+                    h = 12;
+                  } else {
+                    h = aph + 12;
+                  }
+                }
+                tp_inst.control.value(tp_inst, tp_inst[f+'_slider'], parseInt(h,10));
+
+                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);
+          }
         }
-		if(tp_inst._defaults.maxDate !== undefined && tp_inst._defaults.maxDate instanceof Date) {
-			tp_inst._defaults.maxDateTime = new Date(tp_inst._defaults.maxDate.getTime());
+        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);
         }
-		if(tp_inst._defaults.maxDateTime !== undefined && tp_inst._defaults.maxDateTime instanceof Date) {
-			tp_inst._defaults.maxDate = new Date(tp_inst._defaults.maxDateTime.getTime());
+
+        this.$timeObj = $tp.find('.ui_tpicker_time');
+
+        if (this.inst !== null) {
+          var timeDefined = this.timeDefined;
+          this._onTimeChange();
+          this.timeDefined = timeDefined;
         }
-		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)
-			{
-				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._defaults,
-			tp_inst = this,
-			// 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.
-			hourMax = parseInt((o.hourMax - ((o.hourMax - o.hourMin) % o.stepHour)) ,10),
-			minMax  = parseInt((o.minuteMax - ((o.minuteMax - o.minuteMin) % o.stepMinute)) ,10),
-			secMax  = parseInt((o.secondMax - ((o.secondMax - o.secondMin) % o.stepSecond)) ,10),
-			millisecMax  = parseInt((o.millisecMax - ((o.millisecMax - o.millisecMin) % o.stepMillisec)) ,10),
-			dp_id = this.inst.id.toString().replace(/([^A-Za-z0-9_])/g, '');
-
-		// Prevent displaying twice
-		//if ($dp.find("div#ui-timepicker-div-"+ dp_id).length === 0) {
-		if ($dp.find("div#ui-timepicker-div-"+ dp_id).length === 0 && o.showTimepicker) {
-			var noDisplay = ' style="display:none;"',
-				html =	'<div class="ui-timepicker-div" id="ui-timepicker-div-' + dp_id + '"><dl>' +
-						'<dt class="ui_tpicker_time_label" id="ui_tpicker_time_label_' + dp_id + '"' +
-						((o.showTime) ? '' : noDisplay) + '>' + o.timeText + '</dt>' +
-						'<dd class="ui_tpicker_time" id="ui_tpicker_time_' + dp_id + '"' +
-						((o.showTime) ? '' : noDisplay) + '></dd>' +
-						'<dt class="ui_tpicker_hour_label" id="ui_tpicker_hour_label_' + dp_id + '"' +
-						((o.showHour) ? '' : noDisplay) + '>' + o.hourText + '</dt>',
-				hourGridSize = 0,
-				minuteGridSize = 0,
-				secondGridSize = 0,
-				millisecGridSize = 0,
-				size = null;
-
-            // Hours
-			html += '<dd class="ui_tpicker_hour"><div id="ui_tpicker_hour_' + dp_id + '"' +
-						((o.showHour) ? '' : noDisplay) + '></div>';
-			if (o.showHour && o.hourGrid > 0) {
-				html += '<div style="padding-left: 1px"><table class="ui-tpicker-grid-label"><tr>';
-
-				for (var h = o.hourMin; h <= hourMax; h += parseInt(o.hourGrid,10)) {
-					hourGridSize++;
-					var tmph = (o.ampm && h > 12) ? h-12 : h;
-					if (tmph < 10) { tmph = '0' + tmph; }
-					if (o.ampm) {
-						if (h === 0) {
-                            tmph = 12 +'a';
-                        } else {
-                            if (h < 12) { tmph += 'a'; }
-						    else { tmph += 'p'; }
-                        }
-					}
-					html += '<td>' + tmph + '</td>';
-				}
-
-				html += '</tr></table></div>';
-			}
-			html += '</dd>';
-
-			// Minutes
-			html += '<dt class="ui_tpicker_minute_label" id="ui_tpicker_minute_label_' + dp_id + '"' +
-					((o.showMinute) ? '' : noDisplay) + '>' + o.minuteText + '</dt>'+
-					'<dd class="ui_tpicker_minute"><div id="ui_tpicker_minute_' + dp_id + '"' +
-							((o.showMinute) ? '' : noDisplay) + '></div>';
-
-			if (o.showMinute && o.minuteGrid > 0) {
-				html += '<div style="padding-left: 1px"><table class="ui-tpicker-grid-label"><tr>';
-
-				for (var m = o.minuteMin; m <= minMax; m += parseInt(o.minuteGrid,10)) {
-					minuteGridSize++;
-					html += '<td>' + ((m < 10) ? '0' : '') + m + '</td>';
-				}
-
-				html += '</tr></table></div>';
-			}
-			html += '</dd>';
-
-			// Seconds
-			html += '<dt class="ui_tpicker_second_label" id="ui_tpicker_second_label_' + dp_id + '"' +
-					((o.showSecond) ? '' : noDisplay) + '>' + o.secondText + '</dt>'+
-					'<dd class="ui_tpicker_second"><div id="ui_tpicker_second_' + dp_id + '"'+
-							((o.showSecond) ? '' : noDisplay) + '></div>';
-
-			if (o.showSecond && o.secondGrid > 0) {
-				html += '<div style="padding-left: 1px"><table><tr>';
-
-				for (var s = o.secondMin; s <= secMax; s += parseInt(o.secondGrid,10)) {
-					secondGridSize++;
-					html += '<td>' + ((s < 10) ? '0' : '') + s + '</td>';
-				}
-
-				html += '</tr></table></div>';
-			}
-			html += '</dd>';
-
-			// Milliseconds
-			html += '<dt class="ui_tpicker_millisec_label" id="ui_tpicker_millisec_label_' + dp_id + '"' +
-					((o.showMillisec) ? '' : noDisplay) + '>' + o.millisecText + '</dt>'+
-					'<dd class="ui_tpicker_millisec"><div id="ui_tpicker_millisec_' + dp_id + '"'+
-							((o.showMillisec) ? '' : noDisplay) + '></div>';
-
-			if (o.showMillisec && o.millisecGrid > 0) {
-				html += '<div style="padding-left: 1px"><table><tr>';
-
-				for (var l = o.millisecMin; l <= millisecMax; l += parseInt(o.millisecGrid,10)) {
-					millisecGridSize++;
-					html += '<td>' + ((l < 10) ? '0' : '') + l + '</td>';
-				}
-
-				html += '</tr></table></div>';
-			}
-			html += '</dd>';
-
-			// Timezone
-			html += '<dt class="ui_tpicker_timezone_label" id="ui_tpicker_timezone_label_' + dp_id + '"' +
-					((o.showTimezone) ? '' : noDisplay) + '>' + o.timezoneText + '</dt>';
-			html += '<dd class="ui_tpicker_timezone" id="ui_tpicker_timezone_' + dp_id + '"'	+
-							((o.showTimezone) ? '' : noDisplay) + '></dd>';
-
-			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();
-			}
-
-			this.hour_slider = $tp.find('#ui_tpicker_hour_'+ dp_id).slider({
-				orientation: "horizontal",
-				value: this.hour,
-				min: o.hourMin,
-				max: hourMax,
-				step: o.stepHour,
-				slide: function(event, ui) {
-					tp_inst.hour_slider.slider( "option", "value", ui.value);
-					tp_inst._onTimeChange();
-				}
-			});
-
-
-			// Updated by Peter Medeiros:
-			// - Pass in Event and UI instance into slide function
-			this.minute_slider = $tp.find('#ui_tpicker_minute_'+ dp_id).slider({
-				orientation: "horizontal",
-				value: this.minute,
-				min: o.minuteMin,
-				max: minMax,
-				step: o.stepMinute,
-				slide: function(event, ui) {
-					tp_inst.minute_slider.slider( "option", "value", ui.value);
-					tp_inst._onTimeChange();
-				}
-			});
-
-			this.second_slider = $tp.find('#ui_tpicker_second_'+ dp_id).slider({
-				orientation: "horizontal",
-				value: this.second,
-				min: o.secondMin,
-				max: secMax,
-				step: o.stepSecond,
-				slide: function(event, ui) {
-					tp_inst.second_slider.slider( "option", "value", ui.value);
-					tp_inst._onTimeChange();
-				}
-			});
-
-			this.millisec_slider = $tp.find('#ui_tpicker_millisec_'+ dp_id).slider({
-				orientation: "horizontal",
-				value: this.millisec,
-				min: o.millisecMin,
-				max: millisecMax,
-				step: o.stepMillisec,
-				slide: function(event, ui) {
-					tp_inst.millisec_slider.slider( "option", "value", ui.value);
-					tp_inst._onTimeChange();
-				}
-			});
-
-			this.timezone_select = $tp.find('#ui_tpicker_timezone_'+ dp_id).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 = timeZoneString(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();
-			});
-
-			// Add grid functionality
-			if (o.showHour && o.hourGrid > 0) {
-				size = 100 * hourGridSize * o.hourGrid / (hourMax - o.hourMin);
-
-				$tp.find(".ui_tpicker_hour table").css({
-					width: size + "%",
-					marginLeft: (size / (-2 * hourGridSize)) + "%",
-					borderCollapse: 'collapse'
-				}).find("td").each( function(index) {
-					$(this).click(function() {
-						var h = $(this).html();
-						if(o.ampm)	{
-							var ap = h.substring(2).toLowerCase(),
-								aph = parseInt(h.substring(0,2), 10);
-							if (ap == 'a') {
-								if (aph == 12) { h = 0; }
-								else { h = aph; }
-							} else if (aph == 12) { h = 12; }
-							else { h = aph + 12; }
-						}
-						tp_inst.hour_slider.slider("option", "value", h);
-						tp_inst._onTimeChange();
-						tp_inst._onSelectHandler();
-					}).css({
-						cursor: 'pointer',
-						width: (100 / hourGridSize) + '%',
-						textAlign: 'center',
-						overflow: 'hidden'
-					});
-				});
-			}
-
-			if (o.showMinute && o.minuteGrid > 0) {
-				size = 100 * minuteGridSize * o.minuteGrid / (minMax - o.minuteMin);
-				$tp.find(".ui_tpicker_minute table").css({
-					width: size + "%",
-					marginLeft: (size / (-2 * minuteGridSize)) + "%",
-					borderCollapse: 'collapse'
-				}).find("td").each(function(index) {
-					$(this).click(function() {
-						tp_inst.minute_slider.slider("option", "value", $(this).html());
-						tp_inst._onTimeChange();
-						tp_inst._onSelectHandler();
-					}).css({
-						cursor: 'pointer',
-						width: (100 / minuteGridSize) + '%',
-						textAlign: 'center',
-						overflow: 'hidden'
-					});
-				});
-			}
-
-			if (o.showSecond && o.secondGrid > 0) {
-				$tp.find(".ui_tpicker_second table").css({
-					width: size + "%",
-					marginLeft: (size / (-2 * secondGridSize)) + "%",
-					borderCollapse: 'collapse'
-				}).find("td").each(function(index) {
-					$(this).click(function() {
-						tp_inst.second_slider.slider("option", "value", $(this).html());
-						tp_inst._onTimeChange();
-						tp_inst._onSelectHandler();
-					}).css({
-						cursor: 'pointer',
-						width: (100 / secondGridSize) + '%',
-						textAlign: 'center',
-						overflow: 'hidden'
-					});
-				});
-			}
-
-			if (o.showMillisec && o.millisecGrid > 0) {
-				$tp.find(".ui_tpicker_millisec table").css({
-					width: size + "%",
-					marginLeft: (size / (-2 * millisecGridSize)) + "%",
-					borderCollapse: 'collapse'
-				}).find("td").each(function(index) {
-					$(this).click(function() {
-						tp_inst.millisec_slider.slider("option", "value", $(this).html());
-						tp_inst._onTimeChange();
-						tp_inst._onSelectHandler();
-					}).css({
-						cursor: 'pointer',
-						width: (100 / millisecGridSize) + '%',
-						textAlign: 'center',
-						overflow: 'hidden'
-					});
-				});
-			}
-
-			var $buttonPanel = $dp.find('.ui-datepicker-buttonpane');
-			if ($buttonPanel.length) { $buttonPanel.before($tp); }
-			else { $dp.append($tp); }
-
-			this.$timeObj = $tp.find('#ui_tpicker_time_'+ dp_id);
-
-			if (this.inst !== null) {
-				var timeDefined = this.timeDefined;
-				this._onTimeChange();
-				this.timeDefined = timeDefined;
-			}
-
-			//Emulate datepicker onSelect behavior. Call on slidestop.
-			var onSelectDelegate = function() {
-				tp_inst._onSelectHandler();
-			};
-			this.hour_slider.bind('slidestop',onSelectDelegate);
-			this.minute_slider.bind('slidestop',onSelectDelegate);
-			this.second_slider.bind('slidestop',onSelectDelegate);
-			this.millisec_slider.bind('slidestop',onSelectDelegate);
-
-			// slideAccess integration: http://trentrichardson.com/2011/11/11/jquery-ui-sliders-and-touch-accessibility/
-			if (this._defaults.addSliderAccess){
-				var sliderAccessArgs = this._defaults.sliderAccessArgs;
-				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('marginLeft').toString().replace('%',''),
-									newWidth = oldWidth - sliderAccessWidth,
-									newMarginLeft = ((oldMarginLeft * newWidth)/oldWidth) + '%';
-
-								$g.css({ width: newWidth, marginLeft: newMarginLeft });
-							});
-						}
-					}
-				},0);
-			}
-			// 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();
-					} else 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.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.hour_slider.slider("option", { min: this._defaults.hourMin, max: hourMax }).slider('value', this.hour);
-            }
-			if(this.minute_slider) {
-				this.minute_slider.slider("option", { min: this._defaults.minuteMin, max: minMax }).slider('value', this.minute);
-            }
-			if(this.second_slider){
-				this.second_slider.slider("option", { min: this._defaults.secondMin, max: secMax }).slider('value', this.second);
-            }
-			if(this.millisec_slider) {
-				this.millisec_slider.slider("option", { min: this._defaults.millisecMin, max: millisecMax }).slider('value', 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.hour_slider.slider('value') : false,
-			minute = (this.minute_slider) ? this.minute_slider.slider('value') : false,
-			second = (this.second_slider) ? this.second_slider.slider('value') : false,
-			millisec = (this.millisec_slider) ? this.millisec_slider.slider('value') : false,
-			timezone = (this.timezone_select) ? this.timezone_select.val() : false,
-			o = this._defaults;
-
-		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)) ||
-				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 (o.ampm) { this.ampm = ampm; }
-
-		//this._formatTime();
-		this.formattedTime = $.datepicker.formatTime(this._defaults.timeFormat, this, this._defaults);
-		if (this.$timeObj) { this.$timeObj.text(this.formattedTime + o.timeSuffix); }
-		this.timeDefined = true;
-		if (hasChanged) { this._updateDateTime(); }
-	},
-
-	//########################################################################
-	// call custom onSelect.
-	// bind to sliders slidestop, and grid click.
-	//########################################################################
-	_onSelectHandler: function() {
-		var onSelect = this._defaults.onSelect;
-		var inputEl = this.$input ? this.$input[0] : null;
-		if (onSelect && inputEl) {
-			onSelect.apply(inputEl, [this.formattedDateTime, this]);
-		}
-	},
-
-	//########################################################################
-	// left for any backwards compatibility
-	//########################################################################
-	_formatTime: function(time, format) {
-		time = time || { hour: this.hour, minute: this.minute, second: this.second, millisec: this.millisec, ampm: this.ampm, timezone: this.timezone };
-		var tmptime = (format || this._defaults.timeFormat).toString();
-
-		tmptime = $.datepicker.formatTime(tmptime, time, this._defaults);
-
-		if (arguments.length) { return tmptime; }
-		else { this.formattedTime = tmptime; }
-	},
-
-	//########################################################################
-	// 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.$altInput.val(formattedDateTime);
-			this.$input.val(formattedDateTime);
-		} else {
-			this.$input.val(formattedDateTime);
-		}
-
-		this.$input.trigger("change");
-	}
-
-});
-
-$.fn.extend({
-	//########################################################################
-	// shorthand just to use timepicker..
-	//########################################################################
-	timepicker: function(o) {
-		o = o || {};
-		var tmp_args = 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);
-				});
+
+        // 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);
+                });
+              }
             }
-		}
-		else {
-			return this.each(function() {
-				var $t = $(this);
-				$t.datepicker($.timepicker._newInst($t, o)._defaults);
-			});
+          }, 10);
         }
-	}
-});
-
-$.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;
-};
-
-$.datepicker.parseTime = function(timeFormat, timeString, options) {
-	
-	//########################################################################
-	// pattern for standard and localized AM/PM markers
-	//########################################################################
-	var getPatternAmpm = function(amNames, pmNames) {
-		var markers = [];
-		if (amNames) {
-			$.merge(markers, amNames);
+        // 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 (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;
+
+        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;
         }
-		return orders;
-	};
-    
-	var o = extendRemove(extendRemove({}, $.timepicker._defaults), options || {});
-    
-	var regstr = '^' + timeFormat.toString()
-			.replace(/h{1,2}/ig, '(\\d?\\d)')
-			.replace(/m{1,2}/ig, '(\\d?\\d)')
-			.replace(/s{1,2}/ig, '(\\d?\\d)')
-			.replace(/l{1}/ig, '(\\d?\\d?\\d)')
-			.replace(/t{1,2}/ig, getPatternAmpm(o.amNames, o.pmNames))
-			.replace(/z{1}/ig, '(z|[-+]\\d\\d:?\\d\\d)?')
-			.replace(/\s/g, '\\s?') + o.timeSuffix + '$',
-		order = getFormatPositions(timeFormat),
-		ampm = '',
-		treg;
-
-	treg = timeString.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], 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;
-};
-
-//########################################################################
-// format the time all pretty...
-// 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;
-	var ampmName = options.amNames[0];
-
-	var hour = parseInt(time.hour, 10);
-	if (options.ampm) {
-		if (hour > 11){
-			ampmName = options.pmNames[0];
-			if(hour > 12) {
-				hour = hour % 12;
+      }
+
+      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;
             }
-		}
-		if (hour === 0) {
-			hour = 12;
+          } 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;
         }
-	}
-	tmptime = tmptime.replace(/(?:hh?|mm?|ss?|[tT]{1,2}|[lz])/g, function(match) {
-		switch (match.toLowerCase()) {
-			case 'hh': return ('0' + hour).slice(-2);
-			case 'h':  return 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;
-			case 't': case 'tt':
-				if (options.ampm) {
-					if (match.length == 1) {
-						ampmName = ampmName.charAt(0);
-                    }
-					return match.charAt(0) == 'T' ? ampmName.toUpperCase() : ampmName.toLowerCase();
-				}
-				return '';
-		}
-	});
-
-	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 = tp_inst._defaults.ampm,
-				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);
-};
-
-//#######################################################################################
-// 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
-			hour = date ? date.getHours() : defaults.hour,
-			minute = date ? date.getMinutes() : defaults.minute,
-			second = date ? date.getSeconds() : defaults.second,
-			millisec = date ? date.getMilliseconds() : defaults.millisec;
-		//check if within min/max times..
-		// correct check if within min/max times. 	
-		// Rewritten by Scott A. Woodward
-		var hourEq = hour === defaults.hourMin,
-			minuteEq = minute === defaults.minuteMin,
-			secondEq = second === defaults.secondMin;
-		var reset = false;
-		if(hour < defaults.hourMin || hour > defaults.hourMax)  
-			reset = true;
-		else if( (minute < defaults.minuteMin || minute > defaults.minuteMax) && hourEq)
-			reset = true;
-		else if( (second < defaults.secondMin || second > defaults.secondMax ) && hourEq && minuteEq)
-			reset = true;
-		else if( (millisec < defaults.millisecMin || millisec > defaults.millisecMax) && hourEq && minuteEq && secondEq)
-			reset = true;
-		if(reset) {
-			hour = defaults.hourMin;
-			minute = defaults.minuteMin;
-			second = defaults.secondMin;
-			millisec = defaults.millisecMin;
-		}
-		tp_inst.hour = hour;
-		tp_inst.minute = minute;
-		tp_inst.second = second;
-		tp_inst.millisec = millisec;
-		if (tp_inst.hour_slider) tp_inst.hour_slider.slider('value', hour);
-		if (tp_inst.minute_slider) tp_inst.minute_slider.slider('value', minute);
-		if (tp_inst.second_slider) tp_inst.second_slider.slider('value', second);
-		if (tp_inst.millisec_slider) tp_inst.millisec_slider.slider('value', millisec);
-
-		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) {
-		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 splitRes = splitDateTime(format, value, settings);
-	return $.datepicker._base_parseDate(format, splitRes[0], settings);
-};
-
-//#######################################################################################
-// 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);
-    if (!inst) { return null; }
-    
-	var tp_inst = this._get(inst, 'timepicker');
-	if (tp_inst) {
-		var min = null, max = null, onselect = null;
-		if (typeof name == 'string') { // if min/max was set with the string
-			if (name === 'minDate' || name === 'minDateTime' ) {
-				min = value;
+      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, { min: this._defaults.hourMin, max: hourMax });
+          this.control.value(this, this.hour_slider, this.hour);
+        }
+        if (this.minute_slider) {
+          this.control.options(this, this.minute_slider, { min: this._defaults.minuteMin, max: minMax });
+          this.control.value(this, this.minute_slider, this.minute);
+        }
+        if (this.second_slider) {
+          this.control.options(this, this.second_slider, { min: this._defaults.secondMin, max: secMax });
+          this.control.value(this, this.second_slider, this.second);
+        }
+        if (this.millisec_slider) {
+          this.control.options(this, this.millisec_slider, { min: this._defaults.millisecMin, max: millisecMax });
+          this.control.value(this, this.millisec_slider, 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) : false,
+        minute = (this.minute_slider) ? this.control.value(this, this.minute_slider) : false,
+        second = (this.second_slider) ? this.control.value(this, this.second_slider) : false,
+        millisec = (this.millisec_slider) ? this.control.value(this, this.millisec_slider) : false,
+        timezone = (this.timezone_select) ? this.timezone_select.val() : false,
+        o = this._defaults;
+
+      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 (o.ampm) {
+        this.ampm = ampm;
+      }
+
+      this.formattedTime = $.datepicker.formatTime(this._defaults.timeFormat, this, this._defaults);
+      if (this.$timeObj) {
+        this.$timeObj.text(this.formattedTime + o.timeSuffix);
+      }
+      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);
             }
-			else {
-                if (name === 'maxDate' || name === 'maxDateTime') {
-                    max = value;
-                }
-                else {
-                    if (name === 'onSelect') {
-                        onselect = value;
-                    }
-                }
+          }
+        }
+      }
+    },
+
+    /*
+     * 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), rtl? ui.value*-1:ui.value);
+              tp_inst._onTimeChange();
+            },
+            stop: function(event, ui) {
+              tp_inst._onSelectHandler();
             }
-		} 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;
-                            }
-                        }
-                    }
-                }
+          });
+        },
+        options: function(tp_inst, obj, 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, 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');
         }
-		if(min) { //if min was set
-			if (min === 0) {
-				min = new Date();
-            } else {
-				min = new Date(min);
+      },
+      // 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' && tp_inst._defaults.ampm){
+              m = i%12;
+              if(i === 0 || i === 12) sel += '12';
+              else if(m < 10) sel += '0'+ m.toString();
+              else sel += m;
+              sel += ' '+ ((i < 12)? tp_inst._defaults.amNames[0] : tp_inst._defaults.pmNames[0])[ul]();
             }
+            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, 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, 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);
+    }
 
-			tp_inst._defaults.minDate = min;
-			tp_inst._defaults.minDateTime = min;
-		} else if (max) { //if max was set
-			if(max===0) {
-				max=new Date();
+    return parseRes.date;
+  };
+
+  /*
+   * Public utility to parse time
+   */
+  $.datepicker.parseTime = function(timeFormat, timeString, options) {
+
+    // 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 o = extendRemove(extendRemove({}, $.timepicker._defaults), options || {});
+
+    var regstr = '^' + timeFormat.toString()
+        .replace(/(hh?|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(timeFormat),
+      ampm = '',
+      treg;
+
+    treg = timeString.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 {
-				max= new Date(max);
+              if (tz.substring(1) == '00:00') {
+                tz = 'Z';
+              }
+            }
+            break;
+        }
+        resTime.timezone = tz;
+      }
+
+
+      return resTime;
+    }
+
+    return false;
+  };
+
+  /*
+   * 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;
+    var ampmName = options.amNames[0];
+
+    var hour = parseInt(time.hour, 10);
+    if (options.ampm) {
+      if (hour > 11) {
+        ampmName = options.pmNames[0];
+        if (hour > 12) {
+          hour = hour % 12;
+        }
+      }
+      if (hour === 0) {
+        hour = 12;
+      }
+    }
+    tmptime = tmptime.replace(/(?:hh?|mm?|ss?|[tT]{1,2}|[lz]|'.*?')/g, function(match) {
+      switch (match.toLowerCase()) {
+        case 'hh':
+          return ('0' + hour).slice(-2);
+        case 'h':
+          return 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':
+        case 'tt':
+          if (options.ampm) {
+            if (match.length == 1) {
+              ampmName = ampmName.charAt(0);
             }
-			tp_inst._defaults.maxDate = max;
-			tp_inst._defaults.maxDateTime = max;
-		} else if (onselect) {
-			tp_inst._defaults.onSelect = onselect;
+            return match.charAt(0) === 'T' ? ampmName.toUpperCase() : ampmName.toLowerCase();
+          }
+          return '';
+        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();
         }
-	}
-	if (value === undefined) {
-		return this._base_optionDatepicker(target, name);
+      }
+    }
+  };
+
+  /*
+   * third bad hack :/ override datepicker so it allows spaces and colon in the input field
+   */
+  $.datepicker._base_doKeyPress = $.datepicker._doKeyPress;
+  $.datepicker._doKeyPress = function(event) {
+    var inst = $.datepicker._getInst(event.target),
+      tp_inst = $.datepicker._get(inst, 'timepicker');
+
+    if (tp_inst) {
+      if ($.datepicker._get(inst, 'constrainInput')) {
+        var ampm = tp_inst._defaults.ampm,
+          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 !== undefined ? 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;
     }
-	return this._base_optionDatepicker(target, name, value);
-};
-
-//#######################################################################################
-// jQuery extend now ignores nulls!
-//#######################################################################################
-function extendRemove(target, props) {
-	$.extend(target, props);
-	for (var name in props) {
-		if (props[name] === null || props[name] === undefined) {
-			target[name] = props[name];
+
+    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);
+      }
     }
-	return target;
-}
-
-//#######################################################################################
-// Splits datetime string into date ans time substrings.
-// Throws exception when date can't be parsed
-// If only date is present, time substring eill be '' 
-//#######################################################################################
-var splitDateTime = function(dateFormat, dateTimeString, dateSettings)
-{
-	try {
-		var date = $.datepicker._base_parseDate(dateFormat, dateTimeString, dateSettings);
-	} catch (err) {
-		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);
-            var timeString = dateTimeString.substring(dateStringLength);
-
-            return [dateTimeString.substring(0, dateStringLength), 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)
-{
+
+  };
+
+  /*
+   * 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;
-    var splitRes = splitDateTime(dateFormat, dateTimeString, dateSettings);
-	date = $.datepicker._base_parseDate(dateFormat, splitRes[0], dateSettings);
-    if (splitRes[1] !== '')
-    {
-        var timeString = splitRes[1];
-        var separator = timeSettings && timeSettings.separator ? timeSettings.separator : $.timepicker._defaults.separator;            
-        if ( timeString.indexOf(separator) !== 0) {
-            throw 'Missing time separator';
+    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);
+    }
+    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];
         }
-        timeString = timeString.substring(separator.length);
-        var parsedTime = $.datepicker.parseTime(timeFormat, timeString, timeSettings);
-        if (parsedTime === null) {
-            throw 'Wrong time format';
+      }
+      if (name_clone && isEmptyObject(name_clone)) { return; }
+      if (min) { //if min was set
+        if (min === 0) {
+          min = new Date();
+        } else {
+          min = new Date(min);
         }
-        return {date: date, timeObj: parsedTime};
+        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
+   */
+  function isEmptyObject (obj) {
+    var prop;
+    for (prop in obj) {
+      if (obj.hasOwnProperty(obj)) {
+        return false;
+      }
+    }
+    return true;
+  }
+  /*
+   * jQuery extend now ignores nulls!
+   */
+  function extendRemove(target, props) {
+    $.extend(target, props);
+    for (var name in props) {
+      if (props[name] === null || props[name] === undefined) {
+        target[name] = props[name];
+      }
+    }
+    return target;
+  }
+
+  /*
+   * 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,
+        ampm = timeSettings && timeSettings.ampm ? timeSettings.ampm : $.timepicker._defaults.ampm,
+        timeParts = format.split(separator), // how many occurances of separator may be in our format?
+        timePartsLen = timeParts.length,
+        allParts = dateTimeString.split(separator),
+        allPartsLen = allParts.length;
+
+      // because our default ampm=false, but our default format has tt, we need to filter this out
+      if(!ampm){
+        timeParts = $.trim(format.replace(/t/gi,'')).split(separator);
+        timePartsLen = timeParts.length;
+      }
+
+      if (allPartsLen > 1) {
+        return [
+          allParts.splice(0,allPartsLen-timePartsLen).join(separator),
+          allParts.splice(0,timePartsLen).join(separator)
+        ];
+      }
+
+    } catch (err) {
+      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};
+      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 = timeZoneString(now);
-		if (tp_inst._defaults.timezoneIso8601) {
-			tzoffset = tzoffset.substring(0, 3) + ':' + tzoffset.substring(3);
+  };
+
+  /*
+   * 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));
         }
-		tp_inst.timezone_select.val(tzoffset);
-	}
-};
-
-// Input: Date Object
-// Output: String with timezone offset, e.g. '+0100'
-var timeZoneString = function(date)
-{
-	var off = date.getTimezoneOffset() * -10100 / 60;
-	var timezone = (off >= 0 ? '+' : '-') + Math.abs(off).toString().substr(1);
-	return timezone;
-};
-
-$.timepicker = new Timepicker(); // singleton instance
-$.timepicker.version = "1.0.1";
+      });
+    }
+    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.0.5";
 
 })(jQuery);

文件差异内容过多而无法显示
+ 0 - 6
ambari-web/vendor/styles/datepicker.css


+ 1320 - 0
ambari-web/vendor/styles/jquery-ui-bootstrap/jquery-ui-1.8.16.custom.css

@@ -0,0 +1,1320 @@
+/*!
+ * jQuery UI Bootstrap (0.22)
+ * http://addyosmani.github.com/jquery-ui-bootstrap
+ *
+ * Copyright 2012, Addy Osmani
+ * Dual licensed under the MIT or GPL Version 2 licenses.
+ *
+ * Portions copyright jQuery UI & Twitter Bootstrap
+ */
+
+
+/* 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:after { content: "."; display: block; height: 0; clear: both; visibility: hidden; }
+.ui-helper-clearfix { display: inline-block; }
+/* required comment for clearfix to work in Opera \*/
+* html .ui-helper-clearfix { height:1%; }
+.ui-helper-clearfix { display:block; }
+/* end clearfix */
+.ui-helper-zfix { width: 100%; height: 100%; top: 0; left: 0; position: absolute; opacity: 0; filter:Alpha(Opacity=0); }
+
+
+/* Interaction Cues
+----------------------------------*/
+.ui-state-disabled { cursor: default !important; }
+
+
+/* Icons
+----------------------------------*/
+
+/* states and images */
+.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%; }
+
+
+/*
+ * jQuery UI CSS Framework 1.8.16
+ *
+ * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
+ * Dual licensed under the MIT or GPL Version 2 licenses.
+ * http://jquery.org/license
+ *
+ * http://docs.jquery.com/UI/Theming/API
+ *
+ * To view and modify this theme, visit http://jqueryui.com/themeroller/?ctl=themeroller
+ */
+
+
+/* Component containers
+----------------------------------*/
+.ui-widget {   font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; font-size:13px; }
+.ui-widget .ui-widget { font-size: 1em; }
+.ui-widget input, .ui-widget select, .ui-widget textarea, .ui-widget button { font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; font-size: 1em; }
+.ui-widget-content { border: 1px solid #aaaaaa; background: #ffffff url(../img/jquery-ui-bootstrap/ui-bg_glass_75_ffffff_1x400.png) 50% 50% repeat-x; color: #404040; }
+.ui-widget-content a { color: #404040; }
+.ui-widget-header {
+  font-weight:bold;
+  border-color: #0064cd #0064cd #003f81;
+  border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);
+  border:1px solid #666;
+
+ }
+.ui-widget-header a { color: #222222; }
+
+/* Interaction states
+----------------------------------*/
+.ui-state-default, .ui-widget-content .ui-state-default, .ui-widget-header .ui-state-default {
+
+  background-color: #e6e6e6;
+  background-repeat: no-repeat;
+  background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#ffffff), color-stop(25%, #ffffff), to(#e6e6e6));
+  background-image: -webkit-linear-gradient(#ffffff, #ffffff 25%, #e6e6e6);
+  background-image: -moz-linear-gradient(top, #ffffff, #ffffff 25%, #e6e6e6);
+  background-image: -ms-linear-gradient(#ffffff, #ffffff 25%, #e6e6e6);
+  background-image: -o-linear-gradient(#ffffff, #ffffff 25%, #e6e6e6);
+  background-image: linear-gradient(#ffffff, #ffffff 25%, #e6e6e6);
+  filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffff', endColorstr='#e6e6e6', GradientType=0);
+
+  text-shadow: 0 1px 1px rgba(255, 255, 255, 0.75);
+
+  color: #333;
+  font-size: 13px;
+  line-height: normal;
+  border: 1px solid #ccc;
+  border-bottom-color: #bbb;
+  -webkit-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05);
+  -moz-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05);
+  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05);
+  -webkit-transition: 0.1s linear background-image;
+  -moz-transition: 0.1s linear background-image;
+  -ms-transition: 0.1s linear background-image;
+  -o-transition: 0.1s linear background-image;
+  transition: 0.1s linear background-image;
+   overflow: visible;
+
+ }
+
+
+.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 {
+  background-position: 0 -15px;
+  color: #333;
+  text-decoration: none;
+
+
+ }
+.ui-state-hover a, .ui-state-hover a:hover { color: #212121; text-decoration: none; }
+.ui-state-active, .ui-widget-content .ui-state-active, .ui-widget-header .ui-state-active { border: 1px solid #aaaaaa;  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-widget :active { outline: none; }
+
+/* Interaction Cues
+----------------------------------*/
+
+
+.ui-state-highlight p, .ui-state-error p, .ui-state-default p{
+	font-size: 13px;
+	font-weight: normal;
+	line-height: 18px;
+	margin:7px 15px;
+}
+.ui-state-highlight, .ui-widget-content .ui-state-highlight, .ui-widget-header .ui-state-highlight  {
+
+
+  position: relative;
+  margin-bottom: 18px;
+  color: #404040;
+  background-color: #eedc94;
+  background-repeat: repeat-x;
+  background-image: -khtml-gradient(linear, left top, left bottom, from(#fceec1), to(#eedc94));
+  background-image: -moz-linear-gradient(top, #fceec1, #eedc94);
+  background-image: -ms-linear-gradient(top, #fceec1, #eedc94);
+  background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #fceec1), color-stop(100%, #eedc94));
+  background-image: -webkit-linear-gradient(top, #fceec1, #eedc94);
+  background-image: -o-linear-gradient(top, #fceec1, #eedc94);
+  background-image: linear-gradient(top, #fceec1, #eedc94);
+  filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#fceec1', endColorstr='#eedc94', GradientType=0);
+  text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25);
+  border-color: #eedc94 #eedc94 #e4c652;
+  border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);
+  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.5);
+  border-width: 1px;
+  border-style: solid;
+  -webkit-border-radius: 4px;
+  -moz-border-radius: 4px;
+  border-radius: 4px;
+  -webkit-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25);
+  -moz-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25);
+  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25);
+
+
+}
+.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 {
+
+
+  position: relative;
+  margin-bottom: 18px;
+  color: #ffffff;
+  border-width: 1px;
+  border-style: solid;
+  -webkit-border-radius: 4px;
+  -moz-border-radius: 4px;
+  border-radius: 4px;
+  -webkit-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25);
+  -moz-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25);
+  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25);
+ background-color: #c43c35;
+  background-repeat: repeat-x;
+  background-image: -khtml-gradient(linear, left top, left bottom, from(#ee5f5b), to(#c43c35));
+  background-image: -moz-linear-gradient(top, #ee5f5b, #c43c35);
+  background-image: -ms-linear-gradient(top, #ee5f5b, #c43c35);
+  background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #ee5f5b), color-stop(100%, #c43c35));
+  background-image: -webkit-linear-gradient(top, #ee5f5b, #c43c35);
+  background-image: -o-linear-gradient(top, #ee5f5b, #c43c35);
+  background-image: linear-gradient(top, #ee5f5b, #c43c35);
+  filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ee5f5b', endColorstr='#c43c35', GradientType=0);
+  text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25);
+  border-color: #c43c35 #c43c35 #882a25;
+  border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);
+
+
+}
+.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;  }
+
+
+
+/* Icons
+----------------------------------*/
+
+/* states and images */
+.ui-icon { width: 16px; height: 16px; background-image: url(../img/jquery-ui-bootstrap/ui-icons_222222_256x240.png); }
+.ui-widget-content .ui-icon {background-image: url(../img/jquery-ui-bootstrap/ui-icons_222222_256x240.png); }
+.ui-widget-header .ui-icon {background-image: url(../img/jquery-ui-bootstrap/ui-icons_222222_256x240.png); }
+.ui-state-default .ui-icon { background-image: url(../img/jquery-ui-bootstrap/ui-icons_888888_256x240.png); }
+.ui-state-hover .ui-icon, .ui-state-focus .ui-icon {background-image: url(../img/jquery-ui-bootstrap/ui-icons_454545_256x240.png); }
+.ui-state-active .ui-icon {background-image: url(../img/jquery-ui-bootstrap/ui-icons_454545_256x240.png); }
+.ui-state-highlight .ui-icon {background-image: url(../img/jquery-ui-bootstrap/ui-icons_2e83ff_256x240.png); }
+.ui-state-error .ui-icon, .ui-state-error-text .ui-icon {background-image: url(../img/jquery-ui-bootstrap/ui-icons_f6cf3b_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-off { background-position: -96px -144px; }
+.ui-icon-radio-on { background-position: -112px -144px; }
+.ui-icon-pin-w { background-position: -128px -144px; }
+.ui-icon-pin-s { background-position: -144px -144px; }
+.ui-icon-play { background-position: 0 -160px; }
+.ui-icon-pause { background-position: -16px -160px; }
+.ui-icon-seek-next { background-position: -32px -160px; }
+.ui-icon-seek-prev { background-position: -48px -160px; }
+.ui-icon-seek-end { background-position: -64px -160px; }
+.ui-icon-seek-start { background-position: -80px -160px; }
+/* ui-icon-seek-first is deprecated, use ui-icon-seek-start instead */
+.ui-icon-seek-first { background-position: -80px -160px; }
+.ui-icon-stop { background-position: -96px -160px; }
+.ui-icon-eject { background-position: -112px -160px; }
+.ui-icon-volume-off { background-position: -128px -160px; }
+.ui-icon-volume-on { background-position: -144px -160px; }
+.ui-icon-power { background-position: 0 -176px; }
+.ui-icon-signal-diag { background-position: -16px -176px; }
+.ui-icon-signal { background-position: -32px -176px; }
+.ui-icon-battery-0 { background-position: -48px -176px; }
+.ui-icon-battery-1 { background-position: -64px -176px; }
+.ui-icon-battery-2 { background-position: -80px -176px; }
+.ui-icon-battery-3 { background-position: -96px -176px; }
+.ui-icon-circle-plus { background-position: 0 -192px; }
+.ui-icon-circle-minus { background-position: -16px -192px; }
+.ui-icon-circle-close { background-position: -32px -192px; }
+.ui-icon-circle-triangle-e { background-position: -48px -192px; }
+.ui-icon-circle-triangle-s { background-position: -64px -192px; }
+.ui-icon-circle-triangle-w { background-position: -80px -192px; }
+.ui-icon-circle-triangle-n { background-position: -96px -192px; }
+.ui-icon-circle-arrow-e { background-position: -112px -192px; }
+.ui-icon-circle-arrow-s { background-position: -128px -192px; }
+.ui-icon-circle-arrow-w { background-position: -144px -192px; }
+.ui-icon-circle-arrow-n { background-position: -160px -192px; }
+.ui-icon-circle-zoomin { background-position: -176px -192px; }
+.ui-icon-circle-zoomout { background-position: -192px -192px; }
+.ui-icon-circle-check { background-position: -208px -192px; }
+.ui-icon-circlesmall-plus { background-position: 0 -208px; }
+.ui-icon-circlesmall-minus { background-position: -16px -208px; }
+.ui-icon-circlesmall-close { background-position: -32px -208px; }
+.ui-icon-squaresmall-plus { background-position: -48px -208px; }
+.ui-icon-squaresmall-minus { background-position: -64px -208px; }
+.ui-icon-squaresmall-close { background-position: -80px -208px; }
+.ui-icon-grip-dotted-vertical { background-position: 0 -224px; }
+.ui-icon-grip-dotted-horizontal { background-position: -16px -224px; }
+.ui-icon-grip-solid-vertical { background-position: -32px -224px; }
+.ui-icon-grip-solid-horizontal { background-position: -48px -224px; }
+.ui-icon-gripsmall-diagonal-se { background-position: -64px -224px; }
+.ui-icon-grip-diagonal-se { background-position: -80px -224px; }
+
+
+/* Misc visuals
+----------------------------------*/
+
+/* Corner radius */
+.ui-corner-all, .ui-corner-top, .ui-corner-left, .ui-corner-tl { -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(../img/jquery-ui-bootstrap/ui-bg_flat_0_aaaaaa_40x100.png) 50% 50% repeat-x; opacity: .30;filter:Alpha(Opacity=30); }
+.ui-widget-shadow { margin: -8px 0 0 -8px; padding: 8px; background: #aaaaaa url(../img/jquery-ui-bootstrap/ui-bg_flat_0_aaaaaa_40x100.png) 50% 50% repeat-x; opacity: .30;filter:Alpha(Opacity=30); -moz-border-radius: 8px; -khtml-border-radius: 8px; -webkit-border-radius: 8px; border-radius: 8px; }/*
+ * jQuery UI Resizable 1.8.16
+ *
+ * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
+ * Dual licensed under the MIT or GPL Version 2 licenses.
+ * http://jquery.org/license
+ *
+ * http://docs.jquery.com/UI/Resizable#theming
+ */
+.ui-resizable { position: relative;}
+.ui-resizable-handle { position: absolute;font-size: 0.1px;z-index: 99999; 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;}/*
+ * jQuery UI Selectable 1.8.16
+ *
+ * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
+ * Dual licensed under the MIT or GPL Version 2 licenses.
+ * http://jquery.org/license
+ *
+ * http://docs.jquery.com/UI/Selectable#theming
+ */
+.ui-selectable-helper { position: absolute; z-index: 100; border:1px dotted black; }
+/*
+ * jQuery UI Accordion 1.8.16
+ *
+ * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
+ * Dual licensed under the MIT or GPL Version 2 licenses.
+ * http://jquery.org/license
+ *
+ * http://docs.jquery.com/UI/Accordion#theming
+ */
+/* IE/Win - Fix animation bug - #4615 */
+.ui-accordion { width: 100%; }
+.ui-accordion .ui-accordion-header { cursor: pointer; position: relative; margin-top: 1px; zoom: 1; font-weight:bold; }
+.ui-accordion .ui-accordion-li-fix { display: inline; }
+.ui-accordion .ui-accordion-header-active { border-bottom: 0 !important; }
+.ui-accordion .ui-accordion-header a { display: block; font-size: 1em; padding: .5em .5em .5em .7em; }
+.ui-accordion-icons .ui-accordion-header a { padding-left: 2.2em; }
+.ui-accordion .ui-accordion-header .ui-icon { position: absolute; left: .5em; top: 50%; margin-top: -8px; }
+.ui-accordion .ui-accordion-content { padding: 1em 2.2em; border-top: 0; margin-top: -2px; position: relative; top: 1px; margin-bottom: 2px; overflow: auto; display: none; zoom: 1; }
+.ui-accordion .ui-accordion-content-active { display: block; }
+/*
+ * jQuery UI Autocomplete 1.8.16
+ *
+ * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
+ * Dual licensed under the MIT or GPL Version 2 licenses.
+ * http://jquery.org/license
+ *
+ * http://docs.jquery.com/UI/Autocomplete#theming
+ */
+.ui-autocomplete { position: absolute; cursor: default; }
+
+/* workarounds */
+* html .ui-autocomplete { width:1px; } /* without this, the menu expands to 100% in IE6 */
+
+/*
+ * jQuery UI Menu 1.8.16
+ *
+ * Copyright 2010, AUTHORS.txt (http://jqueryui.com/about)
+ * Dual licensed under the MIT or GPL Version 2 licenses.
+ * http://jquery.org/license
+ *
+ * http://docs.jquery.com/UI/Menu#theming
+ */
+.ui-menu {
+	list-style:none;
+	padding: 2px;
+	margin: 0;
+	display:block;
+	float: left;
+}
+.ui-menu .ui-menu {
+	margin-top: -3px;
+}
+.ui-menu .ui-menu-item {
+	margin:0;
+	padding: 0;
+	zoom: 1;
+	float: left;
+	clear: left;
+	width: 100%;
+}
+.ui-menu .ui-menu-item a {
+	text-decoration:none;
+	display:block;
+	padding:.2em .4em;
+	line-height:1.5;
+	zoom:1;
+}
+.ui-menu .ui-menu-item a.ui-state-hover,
+.ui-menu .ui-menu-item a.ui-state-active {
+	font-weight: normal;
+  background:#0064CD;
+  color:#fff
+}
+
+
+/*
+ * jQuery UI Button 1.8.16
+ *
+ * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
+ * Dual licensed under the MIT or GPL Version 2 licenses.
+ * http://jquery.org/license
+ *
+ * http://docs.jquery.com/UI/Button#theming
+ */
+.ui-button {
+
+  cursor: pointer;
+  display: inline-block;
+  background-color: #e6e6e6;
+  background-repeat: no-repeat;
+  background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#ffffff), color-stop(25%, #ffffff), to(#e6e6e6));
+  background-image: -webkit-linear-gradient(#ffffff, #ffffff 25%, #e6e6e6);
+  background-image: -moz-linear-gradient(top, #ffffff, #ffffff 25%, #e6e6e6);
+  background-image: -ms-linear-gradient(#ffffff, #ffffff 25%, #e6e6e6);
+  background-image: -o-linear-gradient(#ffffff, #ffffff 25%, #e6e6e6);
+  background-image: linear-gradient(#ffffff, #ffffff 25%, #e6e6e6);
+  filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffff', endColorstr='#e6e6e6', GradientType=0);
+  padding: 5px 14px 6px;
+  margin: 0;
+  text-shadow: 0 1px 1px rgba(255, 255, 255, 0.75);
+  color: #333;
+  font-size: 13px;
+  line-height: normal;
+  border: 1px solid #ccc;
+  border-bottom-color: #bbb;
+
+  -webkit-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05);
+  -moz-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05);
+  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05);
+  -webkit-transition: 0.1s linear background-image;
+  -moz-transition: 0.1s linear background-image;
+  -ms-transition: 0.1s linear background-image;
+  -o-transition: 0.1s linear background-image;
+  transition: 0.1s linear background-image;
+   overflow: visible;
+
+} /* the overflow property removes extra width in IE */
+
+.ui-button-primary {
+  color: #ffffff;
+  background-color: #0064cd;
+  background-repeat: repeat-x;
+  background-image: -khtml-gradient(linear, left top, left bottom, from(#049cdb), to(#0064cd));
+  background-image: -moz-linear-gradient(top, #049cdb, #0064cd);
+  background-image: -ms-linear-gradient(top, #049cdb, #0064cd);
+  background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #049cdb), color-stop(100%, #0064cd));
+  background-image: -webkit-linear-gradient(top, #049cdb, #0064cd);
+  background-image: -o-linear-gradient(top, #049cdb, #0064cd);
+  background-image: linear-gradient(top, #049cdb, #0064cd);
+  filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#049cdb', endColorstr='#0064cd', GradientType=0);
+  text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25);
+  border-color: #0064cd #0064cd #003f81;
+  border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);
+
+}
+
+
+
+.ui-button-success{
+  color:#ffffff;
+  background-color: #57a957;
+  background-repeat: repeat-x;
+  background-image: -khtml-gradient(linear, left top, left bottom, from(#62c462), to(#57a957));
+  background-image: -moz-linear-gradient(top, #62c462, #57a957);
+  background-image: -ms-linear-gradient(top, #62c462, #57a957);
+  background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #62c462), color-stop(100%, #57a957));
+  background-image: -webkit-linear-gradient(top, #62c462, #57a957);
+  background-image: -o-linear-gradient(top, #62c462, #57a957);
+  background-image: linear-gradient(top, #62c462, #57a957);
+  filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#62c462', endColorstr='#57a957', GradientType=0);
+  text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25);
+  border-color: #57a957 #57a957 #3d773d;
+  border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);
+}
+
+.ui-button-error{
+  color:#ffffff;
+  background-color: #c43c35;
+  background-repeat: repeat-x;
+  background-image: -khtml-gradient(linear, left top, left bottom, from(#ee5f5b), to(#c43c35));
+  background-image: -moz-linear-gradient(top, #ee5f5b, #c43c35);
+  background-image: -ms-linear-gradient(top, #ee5f5b, #c43c35);
+  background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #ee5f5b), color-stop(100%, #c43c35));
+  background-image: -webkit-linear-gradient(top, #ee5f5b, #c43c35);
+  background-image: -o-linear-gradient(top, #ee5f5b, #c43c35);
+  background-image: linear-gradient(top, #ee5f5b, #c43c35);
+  filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ee5f5b', endColorstr='#c43c35', GradientType=0);
+  text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25);
+  border-color: #c43c35 #c43c35 #882a25;
+  border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);
+}
+
+.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 { } /* 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;   }
+.ui-button-text-only .ui-button-text {  }
+.ui-button-icon-only .ui-button-text, .ui-button-icons-only .ui-button-text { padding: .4em; text-indent: -9999999px; /*tempfix*/ display:none;}
+.ui-button-text-icon-primary .ui-button-text, .ui-button-text-icons .ui-button-text { padding: .4em 1em .4em 2.1em; }
+.ui-button-text-icon-secondary .ui-button-text, .ui-button-text-icons .ui-button-text { padding: .4em 2.1em .4em 1em; }
+.ui-button-text-icons .ui-button-text { padding-left: 2.1em; padding-right: 2.1em; }
+/* no icon support for input elements, provide padding by default */
+/* input.ui-button { padding: .4em 1em; } */
+
+/*button icon element(s) */
+.ui-button-icon-only .ui-icon, .ui-button-text-icon-primary .ui-icon, .ui-button-text-icon-secondary .ui-icon, .ui-button-text-icons .ui-icon, .ui-button-icons-only .ui-icon { top: 50%; margin-top:-3px; margin-bottom:3px; }
+.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-state-active {
+  color: #ffffff;
+  background-color: #0064cd;
+  background-repeat: repeat-x;
+  background-image: -khtml-gradient(linear, left top, left bottom, from(#049cdb), to(#0064cd));
+  background-image: -moz-linear-gradient(top, #049cdb, #0064cd);
+  background-image: -ms-linear-gradient(top, #049cdb, #0064cd);
+  background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #049cdb), color-stop(100%, #0064cd));
+  background-image: -webkit-linear-gradient(top, #049cdb, #0064cd);
+  background-image: -o-linear-gradient(top, #049cdb, #0064cd);
+  background-image: linear-gradient(top, #049cdb, #0064cd);
+  filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#049cdb', endColorstr='#0064cd', GradientType=0);
+  text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25);
+  border-color: #0064cd #0064cd #003f81;
+  border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);
+}
+.ui-buttonset .ui-button { margin-left: 0; margin-right: -.4em; }
+
+/* workarounds */
+button.ui-button::-moz-focus-inner { border: 0; padding: 0; } /* reset extra padding in Firefox */
+
+
+
+/*
+ * jQuery UI Dialog 1.8.16
+ *
+ * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
+ * Dual licensed under the MIT or GPL Version 2 licenses.
+ * http://jquery.org/license
+ *
+ * http://docs.jquery.com/UI/Dialog#theming
+ */
+.ui-dialog { position: absolute; padding: .2em; width: 300px; overflow: hidden; }
+.ui-dialog .ui-dialog-titlebar { /*padding: .4em 1em;*/
+
+  position: relative;
+  padding:5px 15px;
+
+  border:0px 0px 0px 1px solid;
+  border-color: white;
+  padding: 5px 15px;
+  font-size: 18px;
+  text-decoration:none;
+  background:none;
+  -moz-border-radius-bottomright: 0px;
+  -webkit-border-bottom-right-radius: 0px;
+  -khtml-border-bottom-right-radius: 0px;
+
+  -moz-border-radius-bottomleft: 0px;
+  -webkit-border-bottom-left-radius: 0px;
+  -khtml-border-bottom-left-radius: 0px;
+  border-bottom-left-radius: 0px;
+
+  border-bottom:1px solid #ccc;
+
+}
+.ui-dialog .ui-dialog-title {
+  float: left;
+  color:#404040;
+  font-weight:bold;
+  margin-top:5px;
+  margin-bottom:5px;
+  padding:5px;
+
+}
+.ui-dialog .ui-dialog-titlebar-close {
+  position: absolute;
+  right: .3em;
+  top: 50%;
+  width: 19px;
+  margin: -10px 0 0 0;
+  padding: 1px;
+  height: 18px;
+  font-size: 20px;
+  font-weight: bold;
+  line-height: 13.5px;
+  text-shadow: 0 1px 0 #ffffff;
+  filter: alpha(opacity=25);
+  -khtml-opacity: 0.25;
+  -moz-opacity: 0.25;
+  opacity: 0.25;
+}
+
+.ui-dialog .ui-dialog-titlebar-close span { 
+  display: block; 
+  margin: 1px;
+  text-indent: 9999px;
+}
+
+.ui-dialog .ui-dialog-titlebar-close:hover, .ui-dialog .ui-dialog-titlebar-close:focus { padding: 0;   filter: alpha(opacity=90);
+  -khtml-opacity: 0.90;
+  -moz-opacity: 0.90;
+  opacity: 0.90;   }
+
+.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;
+  background-color: #f5f5f5;
+  padding: 5px 15px 5px;
+  border-top: 1px solid #ddd;
+  -webkit-border-radius: 0 0 6px 6px;
+  -moz-border-radius: 0 0 6px 6px;
+  border-radius: 0 0 6px 6px;
+  -webkit-box-shadow: inset 0 1px 0 #ffffff;
+  -moz-box-shadow: inset 0 1px 0 #ffffff;
+  box-shadow: inset 0 1px 0 #ffffff;
+  zoom: 1;
+  margin-bottom: 0;
+
+}
+.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-dialog-buttonpane .ui-dialog-buttonset .ui-button{
+  color: #ffffff;
+  background-color: #0064cd;
+  background-repeat: repeat-x;
+  background-image: -khtml-gradient(linear, left top, left bottom, from(#049cdb), to(#0064cd));
+  background-image: -moz-linear-gradient(top, #049cdb, #0064cd);
+  background-image: -ms-linear-gradient(top, #049cdb, #0064cd);
+  background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #049cdb), color-stop(100%, #0064cd));
+  background-image: -webkit-linear-gradient(top, #049cdb, #0064cd);
+  background-image: -o-linear-gradient(top, #049cdb, #0064cd);
+  background-image: linear-gradient(top, #049cdb, #0064cd);
+  filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#049cdb', endColorstr='#0064cd', GradientType=0);
+  text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25);
+  border-color: #0064cd #0064cd #003f81;
+  border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);
+}
+/*
+ * jQuery UI Slider 1.8.16
+ *
+ * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
+ * Dual licensed under the MIT or GPL Version 2 licenses.
+ * http://jquery.org/license
+ *
+ * http://docs.jquery.com/UI/Slider#theming
+ */
+.ui-slider { position: relative; text-align: left; }
+.ui-slider .ui-slider-handle { 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;
+
+  color: #ffffff;
+  background-color: #0064cd;
+  background-repeat: repeat-x;
+  background-image: -khtml-gradient(linear, left top, left bottom, from(#049cdb), to(#0064cd));
+  background-image: -moz-linear-gradient(top, #049cdb, #0064cd);
+  background-image: -ms-linear-gradient(top, #049cdb, #0064cd);
+  background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #049cdb), color-stop(100%, #0064cd));
+  background-image: -webkit-linear-gradient(top, #049cdb, #0064cd);
+  background-image: -o-linear-gradient(top, #049cdb, #0064cd);
+  background-image: linear-gradient(top, #049cdb, #0064cd);
+  filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#049cdb', endColorstr='#0064cd', GradientType=0);
+  text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25);
+  border-color: #0064cd #0064cd #003f81;
+  border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);
+
+}
+
+.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; }/*
+ * jQuery UI Tabs 1.8.16
+ *
+ * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
+ * Dual licensed under the MIT or GPL Version 2 licenses.
+ * http://jquery.org/license
+ *
+ * http://docs.jquery.com/UI/Tabs#theming
+ */
+ .ui-tabs .ui-tabs-nav{ background:none; border-color: #ddd;
+  border-style: solid;
+  border-width: 0 0 1px;}
+.ui-tabs { position: relative; padding: .2em; zoom: 1; border:0px;} /* position: relative prevents IE scroll bug (element with position: relative inside container with overflow: auto appear as "fixed") */
+
+
+.ui-tabs .ui-tabs-nav li:hover, .ui-tabs .ui-tabs-nav li a:hover{
+  background:whiteSmoke;
+  border-bottom:1px solid #ddd;
+  padding-bottom:0px;
+   color:#00438A;
+}
+
+
+.ui-tabs .ui-tabs-nav { margin: 0; padding: .2em .2em 0; border-bottom:1px solid #DDD; }
+.ui-tabs .ui-tabs-nav li {  text-decoration: none; list-style: none; float: left; position: relative; top: 1px; padding: 0px 0px 1px 0px; white-space: nowrap; background:none; border:0px; 
+
+}
+
+.ui-tabs-nav .ui-state-default{
+  -webkit-box-shadow: 0px 0px 0px #ffffff; /* Saf3-4, iOS 4.0.2 - 4.2, Android 2.3+ */
+     -moz-box-shadow: 0px 0px 0px #ffffff; /* FF3.5 - 3.6 */
+          box-shadow: 0px 0px 0px #ffffff; /* Opera 10.5, IE9, FF4+, Chrome 6+, iOS 5 */
+}
+.ui-tabs .ui-tabs-nav li a {
+
+  float: left;
+  text-decoration: none;
+  cursor: text;
+  padding: 0 15px;
+  margin-right: 2px;
+  line-height: 34px;
+  border: 1px solid transparent;
+  -webkit-border-radius: 4px 4px 0 0;
+  -moz-border-radius: 4px 4px 0 0;
+  border-radius: 4px 4px 0 0;
+
+
+ }
+.ui-tabs .ui-tabs-nav li.ui-tabs-selected { margin-bottom: 0; padding-bottom: 0px; outline:none;}
+
+.ui-tabs .ui-tabs-nav li.ui-tabs-selected a, .ui-tabs .ui-tabs-nav li.ui-state-disabled a, .ui-tabs .ui-tabs-nav li.ui-state-processing a {
+
+  background-color: #ffffff;
+  border: 1px solid #ddd;
+  border-bottom-color: #ffffff;
+  cursor: default;
+  color:gray;
+  outline:none;
+}
+
+
+.ui-tabs .ui-tabs-nav li.ui-tabs-selected:hover{
+  background:#ffffff;
+  outline:none;
+}
+
+.ui-tabs .ui-tabs-nav li a, .ui-tabs.ui-tabs-collapsible .ui-tabs-nav li.ui-tabs-selected a { cursor: pointer; color:#0069D6; background:none; font-weight:normal; margin-bottom:-1px;} 
+/* 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-tabs-panel .ui-button{text-decoration:none;}
+.ui-tabs .ui-tabs-hide { display: none !important; }
+
+
+/* IE fix for background inheritance from ui-widget*/
+.ui-tabs .ui-tabs-nav li{
+  filter:none;
+}
+
+
+
+/*
+ * jQuery UI Datepicker 1.8.16
+ *
+ * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
+ * Dual licensed under the MIT or GPL Version 2 licenses.
+ * http://jquery.org/license
+ *
+ * http://docs.jquery.com/UI/Datepicker#theming
+ */
+.ui-datepicker { width: 17em; padding: .4em .4em 0; display: none; }
+.ui-datepicker .ui-datepicker-header { position:relative; padding:.2em 0; border:0px; font-weight: bold; width: 100%; padding: 4px 0; background-color: #f5f5f5; color: #808080; }
+.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;*/ background:#0064CD;color:#fff;}
+.ui-datepicker .ui-datepicker-next-hover { /*right:1px;*/ background:#0064CD;color:#fff;}
+
+.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; }
+
+/* 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; }
+
+/* IE6 IFRAME FIX (taken from datepicker 1.5.3 */
+.ui-datepicker-cover {
+  display: none; /*sorry for IE5*/
+  display/**/: block; /*sorry for IE5*/
+  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-datepicker th{
+  font-weight: bold;
+  color: gray;
+}
+
+.ui-datepicker-today a:hover{
+  background-color: #808080;
+  color: #ffffff;
+
+}
+.ui-datepicker-today a{
+  background-color: #BFBFBF;
+  cursor: pointer;
+  padding: 0 4px;
+  margin-bottom:0px;
+
+}
+
+
+.ui-datepicker td a{
+  margin-bottom:0px;
+  border:0px;
+}
+
+.ui-datepicker td:hover{
+  color:white;
+}
+
+.ui-datepicker td .ui-state-default {
+  border:0px;
+  background:none;
+  margin-bottom:0px;
+  padding:5px;
+  color:gray;
+  text-align: center;
+  filter:none;
+}
+
+
+.ui-datepicker td .ui-state-active{
+  background:#BFBFBF;
+  margin-bottom:0px;
+  font-size:normal;
+  text-shadow: 0px;
+  color:white;  
+  -webkit-border-radius: 4px;
+  -moz-border-radius: 4px;
+  border-radius: 4px;
+}
+
+.ui-datepicker td .ui-state-default:hover{
+  background:#0064cd;
+  color:white;
+  -webkit-border-radius: 4px;
+  -moz-border-radius: 4px;
+  border-radius: 4px;
+}
+
+
+/*
+ * jQuery UI Progressbar 1.8.16
+ *
+ * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
+ * Dual licensed under the MIT or GPL Version 2 licenses.
+ * http://jquery.org/license
+ *
+ * http://docs.jquery.com/UI/Progressbar#theming
+ */
+.ui-progressbar { height:2em; text-align: left; }
+.ui-progressbar .ui-progressbar-value {margin: -1px; height:100%;
+
+/*this can be removed if ui-widget-header is blue*/
+    color: #ffffff;
+  background-color: #0064cd;
+  background-repeat: repeat-x;
+  background-image: -khtml-gradient(linear, left top, left bottom, from(#049cdb), to(#0064cd));
+  background-image: -moz-linear-gradient(top, #049cdb, #0064cd);
+  background-image: -ms-linear-gradient(top, #049cdb, #0064cd);
+  background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #049cdb), color-stop(100%, #0064cd));
+  background-image: -webkit-linear-gradient(top, #049cdb, #0064cd);
+  background-image: -o-linear-gradient(top, #049cdb, #0064cd);
+  background-image: linear-gradient(top, #049cdb, #0064cd);
+  filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#049cdb', endColorstr='#0064cd', GradientType=0);
+  text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25);
+  border-color: #0064cd #0064cd #003f81;
+  border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);
+ }
+
+
+
+/*** Input field styling from Bootstrap **/
+ input, textarea {
+  -webkit-transition: border linear 0.2s, box-shadow linear 0.2s;
+  -moz-transition: border linear 0.2s, box-shadow linear 0.2s;
+  -ms-transition: border linear 0.2s, box-shadow linear 0.2s;
+  -o-transition: border linear 0.2s, box-shadow linear 0.2s;
+  transition: border linear 0.2s, box-shadow linear 0.2s;
+  -webkit-box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1);
+  -moz-box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1);
+  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1);
+}
+input:focus, textarea:focus {
+  outline: 0;
+  border-color: rgba(82, 168, 236, 0.8);
+  -webkit-box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1), 0 0 8px rgba(82, 168, 236, 0.6);
+  -moz-box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1), 0 0 8px rgba(82, 168, 236, 0.6);
+  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1), 0 0 8px rgba(82, 168, 236, 0.6);
+}
+input[type=file]:focus, input[type=checkbox]:focus, select:focus {
+  -webkit-box-shadow: none;
+  -moz-box-shadow: none;
+  box-shadow: none;
+  outline: 1px dotted #666;
+}
+
+input[type="text"],
+input[type="password"],
+.ui-autocomplete-input,
+textarea,
+.uneditable-input {
+  display: inline-block;
+  padding: 4px;
+  font-size: 13px;
+  line-height: 18px;
+  color: #808080;
+  border: 1px solid #ccc;
+  -webkit-border-radius: 3px;
+  -moz-border-radius: 3px;
+  border-radius: 3px;
+}
+
+
+
+/**Toolbar**/
+
+.ui-toolbar{
+  padding: 7px 14px;
+  margin: 0 0 18px;
+  background-color: #f5f5f5;
+  background-repeat: repeat-x;
+  background-image: -khtml-gradient(linear, left top, left bottom, from(#ffffff), to(#f5f5f5));
+  background-image: -moz-linear-gradient(top, #ffffff, #f5f5f5);
+  background-image: -ms-linear-gradient(top, #ffffff, #f5f5f5);
+  background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #ffffff), color-stop(100%, #f5f5f5));
+  background-image: -webkit-linear-gradient(top, #ffffff, #f5f5f5);
+  background-image: -o-linear-gradient(top, #ffffff, #f5f5f5);
+  background-image: linear-gradient(top, #ffffff, #f5f5f5);
+  filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffff', endColorstr='#f5f5f5', GradientType=0);
+  border: 1px solid #ddd;
+  -webkit-border-radius: 3px;
+  -moz-border-radius: 3px;
+  border-radius: 3px;
+  -webkit-box-shadow: inset 0 1px 0 #ffffff;
+  -moz-box-shadow: inset 0 1px 0 #ffffff;
+  box-shadow: inset 0 1px 0 #ffffff;
+}
+
+
+/***Dialog fixes**/
+
+.ui-dialog-buttonset .ui-button:nth-child(2){
+  cursor: pointer;
+  display: inline-block;
+  background-color: #e6e6e6;
+  background-repeat: no-repeat;
+  background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#ffffff), color-stop(25%, #ffffff), to(#e6e6e6));
+  background-image: -webkit-linear-gradient(#ffffff, #ffffff 25%, #e6e6e6);
+  background-image: -moz-linear-gradient(top, #ffffff, #ffffff 25%, #e6e6e6);
+  background-image: -ms-linear-gradient(#ffffff, #ffffff 25%, #e6e6e6);
+  background-image: -o-linear-gradient(#ffffff, #ffffff 25%, #e6e6e6);
+  background-image: linear-gradient(#ffffff, #ffffff 25%, #e6e6e6);
+  filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffff', endColorstr='#e6e6e6', GradientType=0);
+  padding: 5px 14px 6px;
+  text-shadow: 0 1px 1px rgba(255, 255, 255, 0.75);
+  color: #333;
+  font-size: 13px;
+  line-height: normal;
+  border: 1px solid #ccc;
+  border-bottom-color: #bbb;
+  -webkit-border-radius: 4px;
+  -moz-border-radius: 4px;
+  border-radius: 4px;
+  -webkit-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05);
+  -moz-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05);
+  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05);
+  -webkit-transition: 0.1s linear all;
+  -moz-transition: 0.1s linear all;
+  -ms-transition: 0.1s linear all;
+  -o-transition: 0.1s linear all;
+  transition: 0.1s linear all;
+   overflow: visible;
+}
+
+
+
+/***Wijmo Theming**/
+
+div.wijmo-wijmenu{
+  padding:0 20px;
+  background-color: #222;
+  background-color: #222222;
+  background-repeat: repeat-x;
+  background-image: -khtml-gradient(linear, left top, left bottom, from(#333333), to(#222222));
+  background-image: -moz-linear-gradient(top, #333333, #222222);
+  background-image: -ms-linear-gradient(top, #333333, #222222);
+  background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #333333), color-stop(100%, #222222));
+  background-image: -webkit-linear-gradient(top, #333333, #222222);
+  background-image: -o-linear-gradient(top, #333333, #222222);
+  background-image: linear-gradient(top, #333333, #222222);
+  filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#333333', endColorstr='#222222', GradientType=0);
+  -webkit-box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25), inset 0 -1px 0 rgba(0, 0, 0, 0.1);
+  -moz-box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25), inset 0 -1px 0 rgba(0, 0, 0, 0.1);
+  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25), inset 0 -1px 0 rgba(0, 0, 0, 0.1);
+}
+
+.wijmo-wijmenu .ui-state-default{
+  box-shadow: none;
+  color:#BFBFBF;
+}
+
+.wijmo-wijmenu .ui-state-default .wijmo-wijmenu-text{    
+  color:#BFBFBF;
+}
+
+.wijmo-wijmenu .ui-state-hover{
+  background: #444;
+  background: rgba(255, 255, 255, 0.05);
+}
+
+.wijmo-wijmenu .ui-state-hover .wijmo-wijmenu-text{
+  color:#ffffff;
+}
+
+div.wijmo-wijmenu .ui-widget-header h3{
+  position: relative;
+  margin-top:1px;
+  padding:0;
+}
+
+.wijmo-wijmenu h3 a{
+  color: #FFFFFF;
+  display: block;
+  float: left;
+  font-size: 20px;
+  font-weight: 200;
+  line-height: 1;
+  margin-left: -20px;
+  margin-top:1px;
+  padding: 8px 20px 12px;
+}
+
+.wijmo-wijmenu h3 a:hover{
+  background-color: rgba(255, 255, 255, 0.05);
+  color: #FFFFFF;
+  text-decoration: none;
+}
+
+.wijmo-wijmenu .ui-widget-header{
+  border:0px;
+}
+
+.wijmo-wijmenu .wijmo-wijmenu-parent .wijmo-wijmenu-child{
+  padding: 0.3em 0;
+}
+
+div.wijmo-wijmenu .wijmo-wijmenu-item .wijmo-wijmenu-child{
+  background: #333;
+  border:0;
+  margin:0;
+  padding: 6px 0;
+  width:160px;
+  -webkit-border-radius: 0 0 6px 6px;
+  -moz-border-radius: 0 0 6px 6px;
+  border-radius: 0 0 6px 6px;
+  -webkit-box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
+  -moz-box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
+  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
+}
+
+div.wijmo-wijmenu .wijmo-wijmenu-item{
+  margin:0;
+  border:0;
+}
+
+.wijmo-wijmenu a.wijmo-wijmenu-link{
+  margin:0;
+  line-height: 19px;
+  padding: 10px 10px 11px;
+  border:0;
+  -webkit-border-radius: 0;
+  -moz-border-radius: 0;
+  border-radius:0;
+}
+
+div.wijmo-wijmenu .wijmo-wijmenu-child .wijmo-wijmenu-link{
+  display:block;
+  float:none;
+  padding: 4px 15px;
+  width:auto;
+}
+
+div.wijmo-wijmenu .wijmo-wijmenu-child .wijmo-wijmenu-text
+{
+  float:none;
+}
+
+.wijmo-wijmenu .wijmo-wijmenu-item .wijmo-wijmenu-child .ui-state-hover {
+  background: #191919;
+}
+
+.wijmo-wijmenu .wijmo-wijmenu-item .wijmo-wijmenu-separator{
+  padding: 5px 0;
+  background-image: none;
+  background-color: #222;
+  border-top: 1px solid #444;
+  border-bottom:0;
+  border-left:0;
+  border-right:0;
+}
+
+.wijmo-wijmenu .wijmo-wijmenu-item input {
+  -moz-transition: none 0s ease 0s;
+  background-color: rgba(255, 255, 255, 0.3);
+  border: 1px solid #111111;
+  border-radius: 4px 4px 4px 4px;
+  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1) inset, 0 1px 0 rgba(255, 255, 255, 0.25);
+  color: rgba(255, 255, 255, 0.75);
+  font-family: "Helvetica Neue",Helvetica,Arial,sans-serif;
+  line-height: 1;
+  margin: 5px 10px 0 10px;
+  padding: 4px 9px;
+  width:100px;
+}
+
+.wijmo-wijmenu .wijmo-wijmenu-item input:hover {
+  background-color: rgba(255, 255, 255, 0.5);
+  color: #FFFFFF;
+}
+
+.wijmo-wijmenu .wijmo-wijmenu-item input:focus {
+  background-color: #FFFFFF;
+  border: 0 none;
+  box-shadow: 0 0 3px rgba(0, 0, 0, 0.15);
+  color: #404040;
+  outline: 0 none;
+  padding: 5px 10px;
+  text-shadow: 0 1px 0 #FFFFFF;
+}
+
+
+.wijmo-wijmenu .ui-state-default, .ui-widget-content .ui-state-default, .ui-widget-header .ui-state-default {
+  text-shadow:none;
+}
+
+
+.wijmo-wijmenu .ui-state-default{
+  box-shadow: none;
+  color:#BFBFBF;
+  filter: none;
+}
+

部分文件因为文件数量过多而无法显示