From ca07f463e55d0b7699832e96da56ef81d87440f9 Mon Sep 17 00:00:00 2001 From: mdtrooper <tres.14159@gmail.com> Date: Tue, 2 Nov 2010 11:40:30 +0000 Subject: [PATCH] 2010-11-02 Miguel de Dios <miguel.dedios@artica.es> * include/javascript/jquery.ui.datepicker.js, include/javascript/jquery.ui.dialog.js, include/javascript/jquery.ui.draggable.js, include/javascript/jquery.timeentry.js: fixed end of lines that it haven't semicolon end char. git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@3492 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f --- pandora_console/ChangeLog | 8 ++++++++ pandora_console/include/javascript/jquery.timeentry.js | 2 +- .../include/javascript/jquery.ui.datepicker.js | 2 +- pandora_console/include/javascript/jquery.ui.dialog.js | 2 +- pandora_console/include/javascript/jquery.ui.draggable.js | 2 +- 5 files changed, 12 insertions(+), 4 deletions(-) diff --git a/pandora_console/ChangeLog b/pandora_console/ChangeLog index 0e5f430429..ae599f33b6 100644 --- a/pandora_console/ChangeLog +++ b/pandora_console/ChangeLog @@ -1,3 +1,11 @@ +2010-11-02 Miguel de Dios <miguel.dedios@artica.es> + + * include/javascript/jquery.ui.datepicker.js, + include/javascript/jquery.ui.dialog.js, + include/javascript/jquery.ui.draggable.js, + include/javascript/jquery.timeentry.js: fixed end of lines that it haven't + semicolon end char. + 2010-11-02 Raúl Mateos <raulofpandora@gmail.com> * extensions/pandora_logs.php: Fixed html typos. diff --git a/pandora_console/include/javascript/jquery.timeentry.js b/pandora_console/include/javascript/jquery.timeentry.js index b8ab043f1e..85ef5c8276 100644 --- a/pandora_console/include/javascript/jquery.timeentry.js +++ b/pandora_console/include/javascript/jquery.timeentry.js @@ -4,4 +4,4 @@ Dual licensed under the GPL (http://dev.jquery.com/browser/trunk/jquery/GPL-LICENSE.txt) and MIT (http://dev.jquery.com/browser/trunk/jquery/MIT-LICENSE.txt) licenses. Please attribute the author if you use it. */ -(function($){function TimeEntry(){this._nextId=0;this._inst=[];this._disabledInputs=[];this.regional=[];this.regional['']={show24Hours:false,separator:':',ampmPrefix:'',ampmNames:['AM','PM'],spinnerTexts:['Now','Previous field','Next field','Increment','Decrement']};this._defaults={appendText:'',showSeconds:false,timeSteps:[1,1,1],initialField:0,useMouseWheel:true,defaultTime:null,minTime:null,maxTime:null,spinnerImage:'timeEntry.png',spinnerSize:[20,20,8],spinnerIncDecOnly:false,spinnerRepeat:[500,250],beforeShow:null};$.extend(this._defaults,this.regional['']);}$.extend(TimeEntry.prototype,{markerClassName:'hasTimeEntry',_register:function(a){var b=this._nextId++;this._inst[b]=a;return b;},_getInst:function(a){return this._inst[a]||a;},setDefaults:function(a){extendRemove(this._defaults,a||{});},_doFocus:function(a){var b=(a.nodeName&&a.nodeName.toLowerCase()=='input'?a:this);if($.timeEntry._lastInput==b){return}if($.timeEntry._isDisabledTimeEntry(b)){return;}var c=$.timeEntry._getInst(b._timeId);c._input=$(b);$.timeEntry._focussed=true;$.timeEntry._lastInput=b;$.timeEntry._blurredInput=null;var d=c._get('beforeShow');extendRemove(c._settings,(d?d(b):{}));c._parseTime();},_doBlur:function(a){$.timeEntry._blurredInput=$.timeEntry._lastInput;$.timeEntry._lastInput=null;},_doClick:function(a){var b=a.target;var c=$.timeEntry._getInst(b._timeId);if(!$.timeEntry._focussed){var d=c._get('separator').length+2;c._field=0;if($.browser.msie){var e=b.value;var f=a.clientX+$.timeEntry._findScroll(a.srcElement)[0]-$.timeEntry._findPos(a.srcElement)[0];for(var g=0;g<=Math.max(1,c._secondField,c._ampmField);g++){var h=(g!=c._ampmField?(g*d)+2:(c._ampmField*d)+c._get('ampmPrefix').length+c._get('ampmNames')[0].length);b.value=e.substring(0,h);var i=b.createTextRange();if(f<i.boundingWidth){c._field=g;break;}}b.value=e}else{for(var g=0;g<=Math.max(1,c._secondField,c._ampmField);g++){var j=(g!=c._ampmField?(g*d)+2:(c._ampmField*d)+c._get('ampmPrefix').length+c._get('ampmNames')[0].length);if(b.selectionStart<j){c._field=g;break}}}}c._showField();$.timeEntry._focussed=false},_doKeyDown:function(a){if(a.keyCode>=48){return true}var b=$.timeEntry._getInst(this._timeId);switch(a.keyCode){case 9:return(a.shiftKey?b._previousField(true):b._nextField(true));case 35:if(a.ctrlKey){b._setValue('');}else{b._field=Math.max(1,b._secondField,b._ampmField);b._adjustField(0);}break;case 36:if(a.ctrlKey){b._setTime();}else{b._field=0;b._adjustField(0);}break;case 37:b._previousField(false);break;case 38:b._adjustField(+1);break;case 39:b._nextField(false);break;case 40:b._adjustField(-1);break;case 46:b._setValue('');break}return false;},_doKeyPress:function(a){var b=String.fromCharCode(a.charCode==undefined?a.keyCode:a.charCode);if(b<' '){return true}var c=$.timeEntry._getInst(this._timeId);c._handleKeyPress(b);return false;},_doMouseWheel:function(a,b){b=($.browser.opera?-b/Math.abs(b):b);var c=$.timeEntry._getInst(this._timeId);c._adjustField(b);a.preventDefault()},_connectTimeEntry:function(b,c){var d=$(b);if(d.is('.'+this.markerClassName)){return}var e=c._get('spinnerImage');var f=c._get('spinnerText');var g=c._get('spinnerSize');var h=c._get('appendText');var i=(!e?null:$('<span class="timeEntry_control" _timeid="'+c._id+'" style="display: inline-block; background: url(\''+e+'\') 0 0 no-repeat; '+'width: '+g[0]+'px; height: '+g[1]+'px;'+($.browser.mozilla&&$.browser.version.substr(0,3)!='1.9'?' padding-left: '+g[0]+'px; padding-bottom: '+(g[1]-18)+'px;':'')+'"></span>'));d.wrap('<span class="timeEntry_wrap"></span>').after(h?'<span class="timeEntry_append">'+h+'</span>':'').after(i||'');d.addClass(this.markerClassName).bind('focus.timeEntry',this._doFocus).bind('blur.timeEntry',this._doBlur).bind('click.timeEntry',this._doClick).bind('keydown.timeEntry',this._doKeyDown).bind('keypress.timeEntry',this._doKeyPress);if($.browser.mozilla){d.bind('input.timeEntry',function(a){c._parseTime();});}if($.browser.msie){d.bind('paste.timeEntry',function(a){setTimeout(function(){c._parseTime()},1);});}if(c._get('useMouseWheel')&&$.fn.mousewheel){d.mousewheel(this._doMouseWheel);}d[0]._timeId=c._id;if(i){i.mousedown(this._handleSpinner).mouseup(this._endSpinner).mouseout(this._endSpinner).mousemove(this._describeSpinner);i[0]._timeId=c._id}},_enableTimeEntry:function(a){this._enableDisable(a,false)},_disableTimeEntry:function(a){this._enableDisable(a,true);},_enableDisable:function(b,c){var d=$.timeEntry._getInst(b._timeId);if(!d){return;}b.disabled=c;if(b.nextSibling&&b.nextSibling.nodeName.toLowerCase()=='span'){$.timeEntry._changeSpinner(d,b.nextSibling,(c?5:-1));}$.timeEntry._disabledInputs=$.map($.timeEntry._disabledInputs,function(a){return(a==b?null:a)});if(c){$.timeEntry._disabledInputs[$.timeEntry._disabledInputs.length]=b}},_isDisabledTimeEntry:function(a){for(var i=0;i<this._disabledInputs.length;i++){if(this._disabledInputs[i]==a){return true;}}return false;},_changeTimeEntry:function(a,b){var c=this._getInst(a._timeId);if(c){var d=c._extractTime();extendRemove(c._settings,b||{});if(d){c._setTime(new Date(0,0,0,d[0],d[1],d[2]))}}},_destroyTimeEntry:function(b){$input=$(b);if(!$input.is('.'+this.markerClassName)){return;}$input.removeClass(this.markerClassName).unbind('focus.timeEntry').unbind('blur.timeEntry').unbind('click.timeEntry').unbind('keydown.timeEntry').unbind('keypress.timeEntry');if($.browser.mozilla){$input.unbind('input.timeEntry');}if($.browser.msie){$input.unbind('paste.timeEntry');}if($.fn.mousewheel){$input.unmousewheel()}this._inst[b._timeId]=null;b._timeId=undefined;this._disabledInputs=$.map(this._disabledInputs,function(a){return(a==b?null:a);});b.parentNode.parentNode.replaceChild(b,b.parentNode);},_setTimeTimeEntry:function(a,b){var c=this._getInst(a._timeId);if(c){c._input=$(a);c._setTime(b?(typeof b=='object'?new Date(b.getTime()):b):null)}},_getTimeTimeEntry:function(a){var b=this._getInst(a._timeId);var c=(b?b._extractTime():null);return(!c?null:new Date(0,0,0,c[0],c[1],c[2]));},_describeSpinner:function(a){var b=$.timeEntry._getSpinnerTarget(a);var c=$.timeEntry._getInst(b._timeId);b.title=c._get('spinnerTexts')[$.timeEntry._getSpinnerRegion(c,a)];},_handleSpinner:function(a){var b=$.timeEntry._getSpinnerTarget(a);var c=b.previousSibling;if($.timeEntry._isDisabledTimeEntry(c)){return;}if(c==$.timeEntry._blurredInput){$.timeEntry._lastInput=c;$.timeEntry._blurredInput=null;}var d=$.timeEntry._getInst(c._timeId);$.timeEntry._doFocus(c);var e=$.timeEntry._getSpinnerRegion(d,a);$.timeEntry._changeSpinner(d,b,e);$.timeEntry._actionSpinner(d,e);var f=d._get('spinnerRepeat');if(e>=3&&f[0]){$.timeEntry._timer=setTimeout(function(){$.timeEntry._repeatSpinner(d,e);},f[0]);$(b).one('mouseout',$.timeEntry._releaseSpinner).one('mouseup',$.timeEntry._releaseSpinner);}},_actionSpinner:function(a,b){switch(b){case 0:a._setTime();break;case 1:a._previousField(false);break;case 2:a._nextField(false);break;case 3:a._adjustField(+1);break;case 4:a._adjustField(-1);break;}},_repeatSpinner:function(a,b){$.timeEntry._lastInput=$.timeEntry._blurredInput;this._actionSpinner(a,b);this._timer=setTimeout(function(){$.timeEntry._repeatSpinner(a,b);},a._get('spinnerRepeat')[1]);},_releaseSpinner:function(a){clearTimeout($.timeEntry._timer);},_endSpinner:function(a){var b=$.timeEntry._getSpinnerTarget(a);var c=$.timeEntry._getInst(b._timeId);if(!$.timeEntry._isDisabledTimeEntry(b.previousSibling)){$.timeEntry._changeSpinner(c,b,-1);}if(!$.browser.opera){$.timeEntry._lastInput=$.timeEntry._blurredInput;}if($.timeEntry._lastInput){c._showField();}},_getSpinnerTarget:function(a){return(a.target?a.target:a.srcElement);},_getSpinnerRegion:function(a,b){var c=this._getSpinnerTarget(b);var d=this._findPos(c);var e=this._findScroll(c);var f=a._get('spinnerIncDecOnly');var g=(f?99:b.clientX+e[0]-d[0]-($.browser.msie?1:0));var h=b.clientY+e[1]-d[1]-($.browser.msie?1:0);var i=a._get('spinnerSize');var j=(f?99:i[0]-g);var k=i[1]-h;if(i[2]>0&&Math.abs(g-j)<=i[2]&&Math.abs(h-k)<=i[2]){return 0;}var l=Math.min(g,h,j,k);return(l==g?1:(l==j?2:(l==h?3:4)));},_changeSpinner:function(a,b,c){$(b).css('background-position','-'+((c+1)*a._get('spinnerSize')[0])+'px 0px')},_findPos:function(a){var b=curTop=0;if(a.offsetParent){b=a.offsetLeft;curTop=a.offsetTop;while(a=a.offsetParent){var c=b;b+=a.offsetLeft;if(b<0){b=c;}curTop+=a.offsetTop;}}return[b,curTop];},_findScroll:function(a){var b=false;$(a).parents().each(function(){b|=$(this).css('position')=='fixed';});if(b&&!$.browser.opera){return[0,0]}var c=($.browser.opera?document.body.scrollLeft:a.scrollLeft);var d=($.browser.opera?document.body.scrollTop:a.scrollTop);if(!$.browser.opera){while(a=a.parentNode){c+=a.scrollLeft||0;d+=a.scrollTop||0;}}return[c,d];}});function TimeEntryInstance(a){this._id=$.timeEntry._register(this);this._selectedHour=0;this._selectedMinute=0;this._selectedSecond=0;this._field=0;this._input=null;this._settings=extendRemove({},a||{})}$.extend(TimeEntryInstance.prototype,{_get:function(a){return(this._settings[a]!=null?this._settings[a]:$.timeEntry._defaults[a])},_parseTime:function(){var a=this._extractTime();var b=this._get('showSeconds');if(a){this._selectedHour=a[0];this._selectedMinute=a[1];this._selectedSecond=a[2];}else{var c=this._constrainTime();this._selectedHour=c[0];this._selectedMinute=c[1];this._selectedSecond=(b?c[2]:0);}this._secondField=(b?2:-1);this._ampmField=(this._get('show24Hours')?-1:(b?3:2));this._lastChr='';this._field=Math.max(0,Math.min(Math.max(1,this._secondField,this._ampmField),this._get('initialField')));if(this._input.val()!=''){this._showTime();}},_extractTime:function(){var a=(this._input?this._input.val():'');var b=this._get('separator');var c=a.split(b);if(b==''&&a!=''){c[0]=a.substring(0,2);c[1]=a.substring(2,4);c[2]=a.substring(4,6);}var d=this._get('ampmNames');var e=this._get('show24Hours');if(c.length>=2){var f=!e&&(a.indexOf(d[0])>-1);var g=!e&&(a.indexOf(d[1])>-1);var h=parseInt(c[0],10);h=(isNaN(h)?0:h);h=((f||g)&&h==12?0:h)+(g?12:0);var i=parseInt(c[1],10);i=(isNaN(i)?0:i);var j=(c.length>=3?parseInt(c[2],10):0);j=(isNaN(j)||!this._get('showSeconds')?0:j);return this._constrainTime([h,i,j])}return null;},_constrainTime:function(a){var b=(a!=null);if(!b){var c=this._determineTime(this._get('defaultTime'))||new Date();a=[c.getHours(),c.getMinutes(),c.getSeconds()]}var d=false;var e=this._get('timeSteps');for(var i=0;i<e.length;i++){if(d){a[i]=0;}else if(e[i]>1){a[i]=Math.round(a[i]/e[i])*e[i];d=true;}}return a;},_showTime:function(){var a=this._get('show24Hours');var b=this._get('separator');var c=(this._formatNumber(a?this._selectedHour:((this._selectedHour+11)%12)+1)+b+this._formatNumber(this._selectedMinute)+(this._get('showSeconds')?b+this._formatNumber(this._selectedSecond):'')+(a?'':this._get('ampmPrefix')+this._get('ampmNames')[(this._selectedHour<12?0:1)]));this._setValue(c);this._showField()},_showField:function(){if(!this._input){return}var a=this._input[0];var b=this._get('separator');var c=b.length+2;var d=(this._field!=this._ampmField?(this._field*c):(this._ampmField*c)-b.length+this._get('ampmPrefix').length);var e=d+(this._field!=this._ampmField?2:this._get('ampmNames')[0].length);if(a.setSelectionRange){a.setSelectionRange(d,e);}else if(a.createTextRange){var f=a.createTextRange();f.moveStart('character',d);f.moveEnd('character',e-this._input.val().length);f.select();}if(!a.disabled){a.focus()}},_formatNumber:function(a){return(a<10?'0':'')+a},_setValue:function(a){this._input.val(a);this._input.trigger('change')},_previousField:function(a){var b=(this._input.val()==''||this._field==0);if(!b){this._field--}this._showField();this._lastChr='';return(b&&a)},_nextField:function(a){var b=(this._input.val()==''||this._field==Math.max(1,this._secondField,this._ampmField));if(!b){this._field++}this._showField();this._lastChr='';return(b&&a);},_adjustField:function(a){if(this._input&&this._input.val()==''){a=0;}var b=this._get('timeSteps');this._setTime(new Date(0,0,0,this._selectedHour+(this._field==0?a*b[0]:0)+(this._field==this._ampmField?a*12:0),this._selectedMinute+(this._field==1?a*b[1]:0),this._selectedSecond+(this._field==this._secondField?a*b[2]:0)))},_setTime:function(a){a=this._determineTime(a);var b=this._constrainTime(a?[a.getHours(),a.getMinutes(),a.getSeconds()]:null);a=new Date(0,0,0,b[0],b[1],b[2]);var a=this._normaliseTime(a);var c=this._normaliseTime(this._determineTime(this._get('minTime')));var d=this._normaliseTime(this._determineTime(this._get('maxTime')));a=(c&&a<c?c:(d&&a>d?d:a));this._selectedHour=a.getHours();this._selectedMinute=a.getMinutes();this._selectedSecond=a.getSeconds();this._showTime()},_determineTime:function(h){var i=function(a){var b=new Date();b.setTime(b.getTime()+a*1000);return b;};var j=function(a){var b=new Date();var c=b.getHours();var d=b.getMinutes();var e=b.getSeconds();var f=/([+-]?[0-9]+)\s*(s|S|m|M|h|H)?/g;var g=f.exec(a);while(g){switch(g[2]||'s'){case's':case'S':e+=parseInt(g[1]);break;case'm':case'M':d+=parseInt(g[1]);break;case'h':case'H':c+=parseInt(g[1]);break;}g=f.exec(a)}b=new Date(0,0,10,c,d,e,0);if(/^!/.test(a)){if(b.getDate()>10){b=new Date(0,0,10,23,59,59)}else if(b.getDate()<10){b=new Date(0,0,10,0,0,0);}}return b};return(h?(typeof h=='string'?j(h):(typeof h=='number'?i(h):h)):null)},_normaliseTime:function(a){if(!a){return null}a.setFullYear(2001);a.setMonth(1-1);a.setDate(26);return a},_handleKeyPress:function(a){if(a==this._get('separator')){this._nextField(false)}else if(a>='0'&&a<='9'){var b=(this._lastChr+a)*1;var c=this._get('show24Hours');var d=(this._field==0&&((c&&b<24)||(b>=1&&b<=12))?b+(!c&&this._selectedHour>=12?12:0):this._selectedHour);var e=(this._field==1&&b<60?b:this._selectedMinute);var f=(this._field==this._secondField&&b<60?b:this._selectedSecond);var g=this._constrainTime([d,e,f]);this._setTime(new Date(0,0,0,g[0],g[1],g[2]));this._lastChr=a;}else if(!this._get('show24Hours')){var h=this._get('ampmNames');if((a==h[0].substring(0,1).toLowerCase()&&this._selectedHour>=12)||(a==h[1].substring(0,1).toLowerCase()&&this._selectedHour<12)){var i=this._field;this._field=this._ampmField;this._adjustField(+1);this._field=i;this._showField()}}}});function extendRemove(a,b){$.extend(a,b);for(var c in b){if(b[c]==null){a[c]=null}}return a}$.fn.timeEntry=function(e){var f=Array.prototype.slice.call(arguments,1);if(typeof e=='string'&&(e=='isDisabled'||e=='getTime')){return $.timeEntry['_'+e+'TimeEntry'].apply($.timeEntry,[this[0]].concat(f));}return this.each(function(){var a=this.nodeName.toLowerCase();if(a=='input'){if(typeof e=='string'){$.timeEntry['_'+e+'TimeEntry'].apply($.timeEntry,[this].concat(f));}else{var b=null;for(attrName in $.timeEntry._defaults){var c=this.getAttribute('time:'+attrName);if(c){b=b||{};try{b[attrName]=eval(c);}catch(err){b[attrName]=c;}}}var d=(d&&!b?d:new TimeEntryInstance(!b?e:$.extend(b,e)));$.timeEntry._connectTimeEntry(this,d);}}});};$(document).ready(function(){$.timeEntry=new TimeEntry();});})(jQuery); \ No newline at end of file +(function($){function TimeEntry(){this._nextId=0;this._inst=[];this._disabledInputs=[];this.regional=[];this.regional['']={show24Hours:false,separator:':',ampmPrefix:'',ampmNames:['AM','PM'],spinnerTexts:['Now','Previous field','Next field','Increment','Decrement']};this._defaults={appendText:'',showSeconds:false,timeSteps:[1,1,1],initialField:0,useMouseWheel:true,defaultTime:null,minTime:null,maxTime:null,spinnerImage:'timeEntry.png',spinnerSize:[20,20,8],spinnerIncDecOnly:false,spinnerRepeat:[500,250],beforeShow:null};$.extend(this._defaults,this.regional['']);}$.extend(TimeEntry.prototype,{markerClassName:'hasTimeEntry',_register:function(a){var b=this._nextId++;this._inst[b]=a;return b;},_getInst:function(a){return this._inst[a]||a;},setDefaults:function(a){extendRemove(this._defaults,a||{});},_doFocus:function(a){var b=(a.nodeName&&a.nodeName.toLowerCase()=='input'?a:this);if($.timeEntry._lastInput==b){return;}if($.timeEntry._isDisabledTimeEntry(b)){return;}var c=$.timeEntry._getInst(b._timeId);c._input=$(b);$.timeEntry._focussed=true;$.timeEntry._lastInput=b;$.timeEntry._blurredInput=null;var d=c._get('beforeShow');extendRemove(c._settings,(d?d(b):{}));c._parseTime();},_doBlur:function(a){$.timeEntry._blurredInput=$.timeEntry._lastInput;$.timeEntry._lastInput=null;},_doClick:function(a){var b=a.target;var c=$.timeEntry._getInst(b._timeId);if(!$.timeEntry._focussed){var d=c._get('separator').length+2;c._field=0;if($.browser.msie){var e=b.value;var f=a.clientX+$.timeEntry._findScroll(a.srcElement)[0]-$.timeEntry._findPos(a.srcElement)[0];for(var g=0;g<=Math.max(1,c._secondField,c._ampmField);g++){var h=(g!=c._ampmField?(g*d)+2:(c._ampmField*d)+c._get('ampmPrefix').length+c._get('ampmNames')[0].length);b.value=e.substring(0,h);var i=b.createTextRange();if(f<i.boundingWidth){c._field=g;break;}}b.value=e;}else{for(var g=0;g<=Math.max(1,c._secondField,c._ampmField);g++){var j=(g!=c._ampmField?(g*d)+2:(c._ampmField*d)+c._get('ampmPrefix').length+c._get('ampmNames')[0].length);if(b.selectionStart<j){c._field=g;break;}}}}c._showField();$.timeEntry._focussed=false;},_doKeyDown:function(a){if(a.keyCode>=48){return true;}var b=$.timeEntry._getInst(this._timeId);switch(a.keyCode){case 9:return(a.shiftKey?b._previousField(true):b._nextField(true));case 35:if(a.ctrlKey){b._setValue('');}else{b._field=Math.max(1,b._secondField,b._ampmField);b._adjustField(0);}break;case 36:if(a.ctrlKey){b._setTime();}else{b._field=0;b._adjustField(0);}break;case 37:b._previousField(false);break;case 38:b._adjustField(+1);break;case 39:b._nextField(false);break;case 40:b._adjustField(-1);break;case 46:b._setValue('');break;}return false;},_doKeyPress:function(a){var b=String.fromCharCode(a.charCode==undefined?a.keyCode:a.charCode);if(b<' '){return true;}var c=$.timeEntry._getInst(this._timeId);c._handleKeyPress(b);return false;},_doMouseWheel:function(a,b){b=($.browser.opera?-b/Math.abs(b):b);var c=$.timeEntry._getInst(this._timeId);c._adjustField(b);a.preventDefault();},_connectTimeEntry:function(b,c){var d=$(b);if(d.is('.'+this.markerClassName)){return;}var e=c._get('spinnerImage');var f=c._get('spinnerText');var g=c._get('spinnerSize');var h=c._get('appendText');var i=(!e?null:$('<span class="timeEntry_control" _timeid="'+c._id+'" style="display: inline-block; background: url(\''+e+'\') 0 0 no-repeat; '+'width: '+g[0]+'px; height: '+g[1]+'px;'+($.browser.mozilla&&$.browser.version.substr(0,3)!='1.9'?' padding-left: '+g[0]+'px; padding-bottom: '+(g[1]-18)+'px;':'')+'"></span>'));d.wrap('<span class="timeEntry_wrap"></span>').after(h?'<span class="timeEntry_append">'+h+'</span>':'').after(i||'');d.addClass(this.markerClassName).bind('focus.timeEntry',this._doFocus).bind('blur.timeEntry',this._doBlur).bind('click.timeEntry',this._doClick).bind('keydown.timeEntry',this._doKeyDown).bind('keypress.timeEntry',this._doKeyPress);if($.browser.mozilla){d.bind('input.timeEntry',function(a){c._parseTime();});}if($.browser.msie){d.bind('paste.timeEntry',function(a){setTimeout(function(){c._parseTime();},1);});}if(c._get('useMouseWheel')&&$.fn.mousewheel){d.mousewheel(this._doMouseWheel);}d[0]._timeId=c._id;if(i){i.mousedown(this._handleSpinner).mouseup(this._endSpinner).mouseout(this._endSpinner).mousemove(this._describeSpinner);i[0]._timeId=c._id;}},_enableTimeEntry:function(a){this._enableDisable(a,false);},_disableTimeEntry:function(a){this._enableDisable(a,true);},_enableDisable:function(b,c){var d=$.timeEntry._getInst(b._timeId);if(!d){return;}b.disabled=c;if(b.nextSibling&&b.nextSibling.nodeName.toLowerCase()=='span'){$.timeEntry._changeSpinner(d,b.nextSibling,(c?5:-1));}$.timeEntry._disabledInputs=$.map($.timeEntry._disabledInputs,function(a){return(a==b?null:a);});if(c){$.timeEntry._disabledInputs[$.timeEntry._disabledInputs.length]=b;}},_isDisabledTimeEntry:function(a){for(var i=0;i<this._disabledInputs.length;i++){if(this._disabledInputs[i]==a){return true;}}return false;},_changeTimeEntry:function(a,b){var c=this._getInst(a._timeId);if(c){var d=c._extractTime();extendRemove(c._settings,b||{});if(d){c._setTime(new Date(0,0,0,d[0],d[1],d[2]));}}},_destroyTimeEntry:function(b){$input=$(b);if(!$input.is('.'+this.markerClassName)){return;}$input.removeClass(this.markerClassName).unbind('focus.timeEntry').unbind('blur.timeEntry').unbind('click.timeEntry').unbind('keydown.timeEntry').unbind('keypress.timeEntry');if($.browser.mozilla){$input.unbind('input.timeEntry');}if($.browser.msie){$input.unbind('paste.timeEntry');}if($.fn.mousewheel){$input.unmousewheel();}this._inst[b._timeId]=null;b._timeId=undefined;this._disabledInputs=$.map(this._disabledInputs,function(a){return(a==b?null:a);});b.parentNode.parentNode.replaceChild(b,b.parentNode);},_setTimeTimeEntry:function(a,b){var c=this._getInst(a._timeId);if(c){c._input=$(a);c._setTime(b?(typeof b=='object'?new Date(b.getTime()):b):null);}},_getTimeTimeEntry:function(a){var b=this._getInst(a._timeId);var c=(b?b._extractTime():null);return(!c?null:new Date(0,0,0,c[0],c[1],c[2]));},_describeSpinner:function(a){var b=$.timeEntry._getSpinnerTarget(a);var c=$.timeEntry._getInst(b._timeId);b.title=c._get('spinnerTexts')[$.timeEntry._getSpinnerRegion(c,a)];},_handleSpinner:function(a){var b=$.timeEntry._getSpinnerTarget(a);var c=b.previousSibling;if($.timeEntry._isDisabledTimeEntry(c)){return;}if(c==$.timeEntry._blurredInput){$.timeEntry._lastInput=c;$.timeEntry._blurredInput=null;}var d=$.timeEntry._getInst(c._timeId);$.timeEntry._doFocus(c);var e=$.timeEntry._getSpinnerRegion(d,a);$.timeEntry._changeSpinner(d,b,e);$.timeEntry._actionSpinner(d,e);var f=d._get('spinnerRepeat');if(e>=3&&f[0]){$.timeEntry._timer=setTimeout(function(){$.timeEntry._repeatSpinner(d,e);},f[0]);$(b).one('mouseout',$.timeEntry._releaseSpinner).one('mouseup',$.timeEntry._releaseSpinner);}},_actionSpinner:function(a,b){switch(b){case 0:a._setTime();break;case 1:a._previousField(false);break;case 2:a._nextField(false);break;case 3:a._adjustField(+1);break;case 4:a._adjustField(-1);break;}},_repeatSpinner:function(a,b){$.timeEntry._lastInput=$.timeEntry._blurredInput;this._actionSpinner(a,b);this._timer=setTimeout(function(){$.timeEntry._repeatSpinner(a,b);},a._get('spinnerRepeat')[1]);},_releaseSpinner:function(a){clearTimeout($.timeEntry._timer);},_endSpinner:function(a){var b=$.timeEntry._getSpinnerTarget(a);var c=$.timeEntry._getInst(b._timeId);if(!$.timeEntry._isDisabledTimeEntry(b.previousSibling)){$.timeEntry._changeSpinner(c,b,-1);}if(!$.browser.opera){$.timeEntry._lastInput=$.timeEntry._blurredInput;}if($.timeEntry._lastInput){c._showField();}},_getSpinnerTarget:function(a){return(a.target?a.target:a.srcElement);},_getSpinnerRegion:function(a,b){var c=this._getSpinnerTarget(b);var d=this._findPos(c);var e=this._findScroll(c);var f=a._get('spinnerIncDecOnly');var g=(f?99:b.clientX+e[0]-d[0]-($.browser.msie?1:0));var h=b.clientY+e[1]-d[1]-($.browser.msie?1:0);var i=a._get('spinnerSize');var j=(f?99:i[0]-g);var k=i[1]-h;if(i[2]>0&&Math.abs(g-j)<=i[2]&&Math.abs(h-k)<=i[2]){return 0;}var l=Math.min(g,h,j,k);return(l==g?1:(l==j?2:(l==h?3:4)));},_changeSpinner:function(a,b,c){$(b).css('background-position','-'+((c+1)*a._get('spinnerSize')[0])+'px 0px');},_findPos:function(a){var b=curTop=0;if(a.offsetParent){b=a.offsetLeft;curTop=a.offsetTop;while(a=a.offsetParent){var c=b;b+=a.offsetLeft;if(b<0){b=c;}curTop+=a.offsetTop;}}return[b,curTop];},_findScroll:function(a){var b=false;$(a).parents().each(function(){b|=$(this).css('position')=='fixed';});if(b&&!$.browser.opera){return[0,0];}var c=($.browser.opera?document.body.scrollLeft:a.scrollLeft);var d=($.browser.opera?document.body.scrollTop:a.scrollTop);if(!$.browser.opera){while(a=a.parentNode){c+=a.scrollLeft||0;d+=a.scrollTop||0;}}return[c,d];}});function TimeEntryInstance(a){this._id=$.timeEntry._register(this);this._selectedHour=0;this._selectedMinute=0;this._selectedSecond=0;this._field=0;this._input=null;this._settings=extendRemove({},a||{});}$.extend(TimeEntryInstance.prototype,{_get:function(a){return(this._settings[a]!=null?this._settings[a]:$.timeEntry._defaults[a]);},_parseTime:function(){var a=this._extractTime();var b=this._get('showSeconds');if(a){this._selectedHour=a[0];this._selectedMinute=a[1];this._selectedSecond=a[2];}else{var c=this._constrainTime();this._selectedHour=c[0];this._selectedMinute=c[1];this._selectedSecond=(b?c[2]:0);}this._secondField=(b?2:-1);this._ampmField=(this._get('show24Hours')?-1:(b?3:2));this._lastChr='';this._field=Math.max(0,Math.min(Math.max(1,this._secondField,this._ampmField),this._get('initialField')));if(this._input.val()!=''){this._showTime();}},_extractTime:function(){var a=(this._input?this._input.val():'');var b=this._get('separator');var c=a.split(b);if(b==''&&a!=''){c[0]=a.substring(0,2);c[1]=a.substring(2,4);c[2]=a.substring(4,6);}var d=this._get('ampmNames');var e=this._get('show24Hours');if(c.length>=2){var f=!e&&(a.indexOf(d[0])>-1);var g=!e&&(a.indexOf(d[1])>-1);var h=parseInt(c[0],10);h=(isNaN(h)?0:h);h=((f||g)&&h==12?0:h)+(g?12:0);var i=parseInt(c[1],10);i=(isNaN(i)?0:i);var j=(c.length>=3?parseInt(c[2],10):0);j=(isNaN(j)||!this._get('showSeconds')?0:j);return this._constrainTime([h,i,j]);}return null;},_constrainTime:function(a){var b=(a!=null);if(!b){var c=this._determineTime(this._get('defaultTime'))||new Date();a=[c.getHours(),c.getMinutes(),c.getSeconds()];}var d=false;var e=this._get('timeSteps');for(var i=0;i<e.length;i++){if(d){a[i]=0;}else if(e[i]>1){a[i]=Math.round(a[i]/e[i])*e[i];d=true;}}return a;},_showTime:function(){var a=this._get('show24Hours');var b=this._get('separator');var c=(this._formatNumber(a?this._selectedHour:((this._selectedHour+11)%12)+1)+b+this._formatNumber(this._selectedMinute)+(this._get('showSeconds')?b+this._formatNumber(this._selectedSecond):'')+(a?'':this._get('ampmPrefix')+this._get('ampmNames')[(this._selectedHour<12?0:1)]));this._setValue(c);this._showField();},_showField:function(){if(!this._input){return;}var a=this._input[0];var b=this._get('separator');var c=b.length+2;var d=(this._field!=this._ampmField?(this._field*c):(this._ampmField*c)-b.length+this._get('ampmPrefix').length);var e=d+(this._field!=this._ampmField?2:this._get('ampmNames')[0].length);if(a.setSelectionRange){a.setSelectionRange(d,e);}else if(a.createTextRange){var f=a.createTextRange();f.moveStart('character',d);f.moveEnd('character',e-this._input.val().length);f.select();}if(!a.disabled){a.focus();}},_formatNumber:function(a){return(a<10?'0':'')+a;},_setValue:function(a){this._input.val(a);this._input.trigger('change');},_previousField:function(a){var b=(this._input.val()==''||this._field==0);if(!b){this._field--;}this._showField();this._lastChr='';return(b&&a);},_nextField:function(a){var b=(this._input.val()==''||this._field==Math.max(1,this._secondField,this._ampmField));if(!b){this._field++;}this._showField();this._lastChr='';return(b&&a);},_adjustField:function(a){if(this._input&&this._input.val()==''){a=0;}var b=this._get('timeSteps');this._setTime(new Date(0,0,0,this._selectedHour+(this._field==0?a*b[0]:0)+(this._field==this._ampmField?a*12:0),this._selectedMinute+(this._field==1?a*b[1]:0),this._selectedSecond+(this._field==this._secondField?a*b[2]:0)));},_setTime:function(a){a=this._determineTime(a);var b=this._constrainTime(a?[a.getHours(),a.getMinutes(),a.getSeconds()]:null);a=new Date(0,0,0,b[0],b[1],b[2]);var a=this._normaliseTime(a);var c=this._normaliseTime(this._determineTime(this._get('minTime')));var d=this._normaliseTime(this._determineTime(this._get('maxTime')));a=(c&&a<c?c:(d&&a>d?d:a));this._selectedHour=a.getHours();this._selectedMinute=a.getMinutes();this._selectedSecond=a.getSeconds();this._showTime();},_determineTime:function(h){var i=function(a){var b=new Date();b.setTime(b.getTime()+a*1000);return b;};var j=function(a){var b=new Date();var c=b.getHours();var d=b.getMinutes();var e=b.getSeconds();var f=/([+-]?[0-9]+)\s*(s|S|m|M|h|H)?/g;var g=f.exec(a);while(g){switch(g[2]||'s'){case's':case'S':e+=parseInt(g[1]);break;case'm':case'M':d+=parseInt(g[1]);break;case'h':case'H':c+=parseInt(g[1]);break;}g=f.exec(a);}b=new Date(0,0,10,c,d,e,0);if(/^!/.test(a)){if(b.getDate()>10){b=new Date(0,0,10,23,59,59);}else if(b.getDate()<10){b=new Date(0,0,10,0,0,0);}}return b;};return(h?(typeof h=='string'?j(h):(typeof h=='number'?i(h):h)):null);},_normaliseTime:function(a){if(!a){return null;}a.setFullYear(2001);a.setMonth(1-1);a.setDate(26);return a;},_handleKeyPress:function(a){if(a==this._get('separator')){this._nextField(false);}else if(a>='0'&&a<='9'){var b=(this._lastChr+a)*1;var c=this._get('show24Hours');var d=(this._field==0&&((c&&b<24)||(b>=1&&b<=12))?b+(!c&&this._selectedHour>=12?12:0):this._selectedHour);var e=(this._field==1&&b<60?b:this._selectedMinute);var f=(this._field==this._secondField&&b<60?b:this._selectedSecond);var g=this._constrainTime([d,e,f]);this._setTime(new Date(0,0,0,g[0],g[1],g[2]));this._lastChr=a;}else if(!this._get('show24Hours')){var h=this._get('ampmNames');if((a==h[0].substring(0,1).toLowerCase()&&this._selectedHour>=12)||(a==h[1].substring(0,1).toLowerCase()&&this._selectedHour<12)){var i=this._field;this._field=this._ampmField;this._adjustField(+1);this._field=i;this._showField();}}}});function extendRemove(a,b){$.extend(a,b);for(var c in b){if(b[c]==null){a[c]=null;}}return a;}$.fn.timeEntry=function(e){var f=Array.prototype.slice.call(arguments,1);if(typeof e=='string'&&(e=='isDisabled'||e=='getTime')){return $.timeEntry['_'+e+'TimeEntry'].apply($.timeEntry,[this[0]].concat(f));}return this.each(function(){var a=this.nodeName.toLowerCase();if(a=='input'){if(typeof e=='string'){$.timeEntry['_'+e+'TimeEntry'].apply($.timeEntry,[this].concat(f));}else{var b=null;for(attrName in $.timeEntry._defaults){var c=this.getAttribute('time:'+attrName);if(c){b=b||{};try{b[attrName]=eval(c);}catch(err){b[attrName]=c;}}}var d=(d&&!b?d:new TimeEntryInstance(!b?e:$.extend(b,e)));$.timeEntry._connectTimeEntry(this,d);}}});};$(document).ready(function(){$.timeEntry=new TimeEntry();});})(jQuery); \ No newline at end of file diff --git a/pandora_console/include/javascript/jquery.ui.datepicker.js b/pandora_console/include/javascript/jquery.ui.datepicker.js index e874e2b5b6..d650b41c4d 100644 --- a/pandora_console/include/javascript/jquery.ui.datepicker.js +++ b/pandora_console/include/javascript/jquery.ui.datepicker.js @@ -1,2 +1,2 @@ -(function($){function Datepicker(){this.debug=false;this._nextId=0;this._inst=[];this._curInst=null;this._disabledInputs=[];this._datepickerShowing=false;this._inDialog=false;this.regional=[];this.regional[""]={clearText:"Clear",clearStatus:"Erase the current date",closeText:"Close",closeStatus:"Close without change",prevText:"<Prev",prevStatus:"Show the previous month",nextText:"Next>",nextStatus:"Show the next month",currentText:"Today",currentStatus:"Show the current month",monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthNamesShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],monthStatus:"Show a different month",yearStatus:"Show a different year",weekHeader:"Wk",weekStatus:"Week of the year",dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],dayStatus:"Set DD as first week day",dateStatus:"Select DD, M d",dateFormat:"yy-mm-dd",firstDay:0,initStatus:"Select a date",isRTL:false};this._defaults={showOn:"focus",showAnim:"show",defaultDate:null,appendText:"",buttonText:"...",buttonImage:"",buttonImageOnly:false,closeAtTop:true,mandatory:false,hideIfNoPrevNext:false,changeMonth:true,changeYear:true,yearRange:"-10:+10",changeFirstDay:true,showOtherMonths:false,showWeeks:false,calculateWeek:this.iso8601Week,shortYearCutoff:"+10",showStatus:false,statusForDate:this.dateStatus,minDate:null,maxDate:null,speed:"normal",beforeShowDay:null,beforeShow:null,onSelect:null,onClose:null,numberOfMonths:1,stepMonths:1,rangeSelect:false,rangeSeparator:" - "};$.extend(this._defaults,this.regional[""]);this._datepickerDiv=$('<div id="ui-datepicker-div"></div>')}$.extend(Datepicker.prototype,{markerClassName:"hasDatepicker",log:function(){if(this.debug){console.log.apply("",arguments)}},_register:function(inst){var id=this._nextId++;this._inst[id]=inst;return id},_getInst:function(id){return this._inst[id]||id},setDefaults:function(settings){extendRemove(this._defaults,settings||{});return this},_attachDatepicker:function(target,settings){var inlineSettings=null;for(attrName in this._defaults){var attrValue=target.getAttribute("date:"+attrName);if(attrValue){inlineSettings=inlineSettings||{};try{inlineSettings[attrName]=eval(attrValue)}catch(err){inlineSettings[attrName]=attrValue}}}var nodeName=target.nodeName.toLowerCase();var instSettings=(inlineSettings?$.extend(settings||{},inlineSettings||{}):settings);if(nodeName=="input"){var inst=(inst&&!inlineSettings?inst:new DatepickerInstance(instSettings,false));this._connectDatepicker(target,inst)}else{if(nodeName=="div"||nodeName=="span"){var inst=new DatepickerInstance(instSettings,true);this._inlineDatepicker(target,inst)}}},_destroyDatepicker:function(target){var nodeName=target.nodeName.toLowerCase();var calId=target._calId;target._calId=null;var $target=$(target);if(nodeName=="input"){$target.siblings(".ui-datepicker-append").replaceWith("").end().siblings(".ui-datepicker-trigger").replaceWith("").end().removeClass(this.markerClassName).unbind("focus",this._showDatepicker).unbind("keydown",this._doKeyDown).unbind("keypress",this._doKeyPress);var wrapper=$target.parents(".ui-datepicker-wrap");if(wrapper){wrapper.replaceWith(wrapper.html())}}else{if(nodeName=="div"||nodeName=="span"){$target.removeClass(this.markerClassName).empty()}}if($("input[_calId="+calId+"]").length==0){this._inst[calId]=null}},_enableDatepicker:function(target){target.disabled=false;$(target).siblings("button.ui-datepicker-trigger").each(function(){this.disabled=false}).end().siblings("img.ui-datepicker-trigger").css({opacity:"1.0",cursor:""});this._disabledInputs=$.map(this._disabledInputs,function(value){return(value==target?null:value)})},_disableDatepicker:function(target){target.disabled=true;$(target).siblings("button.ui-datepicker-trigger").each(function(){this.disabled=true}).end().siblings("img.ui-datepicker-trigger").css({opacity:"0.5",cursor:"default"});this._disabledInputs=$.map($.datepicker._disabledInputs,function(value){return(value==target?null:value)});this._disabledInputs[$.datepicker._disabledInputs.length]=target},_isDisabledDatepicker:function(target){if(!target){return false}for(var i=0;i<this._disabledInputs.length;i++){if(this._disabledInputs[i]==target){return true}}return false},_changeDatepicker:function(target,name,value){var settings=name||{};if(typeof name=="string"){settings={};settings[name]=value}if(inst=this._getInst(target._calId)){extendRemove(inst._settings,settings);this._updateDatepicker(inst)}},_setDateDatepicker:function(target,date,endDate){if(inst=this._getInst(target._calId)){inst._setDate(date,endDate);this._updateDatepicker(inst);}},_getDateDatepicker:function(target){var inst=this._getInst(target._calId);if(inst){inst._setDateFromField($(target));}return(inst?inst._getDate():null);},_doKeyDown:function(e){var inst=$.datepicker._getInst(this._calId);if($.datepicker._datepickerShowing){switch(e.keyCode){case 9:$.datepicker._hideDatepicker(null,"");break;case 13:$.datepicker._selectDay(inst,inst._selectedMonth,inst._selectedYear,$("td.ui-datepicker-days-cell-over",inst._datepickerDiv)[0]);return false;break;case 27:$.datepicker._hideDatepicker(null,inst._get("speed"));break;case 33:$.datepicker._adjustDate(inst,(e.ctrlKey?-1:-inst._get("stepMonths")),(e.ctrlKey?"Y":"M"));break;case 34:$.datepicker._adjustDate(inst,(e.ctrlKey?+1:+inst._get("stepMonths")),(e.ctrlKey?"Y":"M"));break;case 35:if(e.ctrlKey){$.datepicker._clearDate(inst);}break;case 36:if(e.ctrlKey){$.datepicker._gotoToday(inst);}break;case 37:if(e.ctrlKey){$.datepicker._adjustDate(inst,-1,"D");}break;case 38:if(e.ctrlKey){$.datepicker._adjustDate(inst,-7,"D")}break;case 39:if(e.ctrlKey){$.datepicker._adjustDate(inst,+1,"D")}break;case 40:if(e.ctrlKey){$.datepicker._adjustDate(inst,+7,"D");}break;}}else{if(e.keyCode==36&&e.ctrlKey){$.datepicker._showDatepicker(this)}}},_doKeyPress:function(e){var inst=$.datepicker._getInst(this._calId);var chars=$.datepicker._possibleChars(inst._get("dateFormat"));var chr=String.fromCharCode(e.charCode==undefined?e.keyCode:e.charCode);return e.ctrlKey||(chr<" "||!chars||chars.indexOf(chr)>-1);},_connectDatepicker:function(target,inst){var input=$(target);if(input.is("."+this.markerClassName)){return }var appendText=inst._get("appendText");var isRTL=inst._get("isRTL");if(appendText){if(isRTL){input.before('<span class="ui-datepicker-append">'+appendText)}else{input.after('<span class="ui-datepicker-append">'+appendText)}}var showOn=inst._get("showOn");if(showOn=="focus"||showOn=="both"){input.focus(this._showDatepicker)}if(showOn=="button"||showOn=="both"){input.wrap('<span class="ui-datepicker-wrap">');var buttonText=inst._get("buttonText");var buttonImage=inst._get("buttonImage");var trigger=$(inst._get("buttonImageOnly")?$("<img>").addClass("ui-datepicker-trigger").attr({src:buttonImage,alt:buttonText,title:buttonText}):$("<button>").addClass("ui-datepicker-trigger").attr({type:"button"}).html(buttonImage!=""?$("<img>").attr({src:buttonImage,alt:buttonText,title:buttonText}):buttonText));if(isRTL){input.before(trigger)}else{input.after(trigger)}trigger.click(function(){if($.datepicker._datepickerShowing&&$.datepicker._lastInput==target){$.datepicker._hideDatepicker()}else{$.datepicker._showDatepicker(target)}})}input.addClass(this.markerClassName).keydown(this._doKeyDown).keypress(this._doKeyPress).bind("setData.datepicker",function(event,key,value){inst._settings[key]=value;}).bind("getData.datepicker",function(event,key){return inst._get(key)});input[0]._calId=inst._id},_inlineDatepicker:function(target,inst){var input=$(target);if(input.is("."+this.markerClassName)){return }input.addClass(this.markerClassName).append(inst._datepickerDiv).bind("setData.datepicker",function(event,key,value){inst._settings[key]=value}).bind("getData.datepicker",function(event,key){return inst._get(key)});input[0]._calId=inst._id;this._updateDatepicker(inst)},_inlineShow:function(inst){var numMonths=inst._getNumberOfMonths();inst._datepickerDiv.width(numMonths[1]*$(".ui-datepicker",inst._datepickerDiv[0]).width())},_dialogDatepicker:function(input,dateText,onSelect,settings,pos){var inst=this._dialogInst;if(!inst){inst=this._dialogInst=new DatepickerInstance({},false);this._dialogInput=$('<input type="text" size="1" style="position: absolute; top: -100px;"/>');this._dialogInput.keydown(this._doKeyDown);$("body").append(this._dialogInput);this._dialogInput[0]._calId=inst._id}extendRemove(inst._settings,settings||{});this._dialogInput.val(dateText);this._pos=(pos?(pos.length?pos:[pos.pageX,pos.pageY]):null);if(!this._pos){var browserWidth=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth;var browserHeight=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight;var scrollX=document.documentElement.scrollLeft||document.body.scrollLeft;var scrollY=document.documentElement.scrollTop||document.body.scrollTop;this._pos=[(browserWidth/2)-100+scrollX,(browserHeight/2)-150+scrollY]}this._dialogInput.css("left",this._pos[0]+"px").css("top",this._pos[1]+"px");inst._settings.onSelect=onSelect;this._inDialog=true;this._datepickerDiv.addClass("ui-datepicker-dialog");this._showDatepicker(this._dialogInput[0]);if($.blockUI){$.blockUI(this._datepickerDiv)}return this},_showDatepicker:function(input){input=input.target||input;if(input.nodeName.toLowerCase()!="input"){input=$("input",input.parentNode)[0]}if($.datepicker._isDisabledDatepicker(input)||$.datepicker._lastInput==input){return }var inst=$.datepicker._getInst(input._calId);var beforeShow=inst._get("beforeShow");extendRemove(inst._settings,(beforeShow?beforeShow.apply(input,[input,inst]):{}));$.datepicker._hideDatepicker(null,"");$.datepicker._lastInput=input;inst._setDateFromField(input);if($.datepicker._inDialog){input.value=""}if(!$.datepicker._pos){$.datepicker._pos=$.datepicker._findPos(input);$.datepicker._pos[1]+=input.offsetHeight}var isFixed=false;$(input).parents().each(function(){isFixed|=$(this).css("position")=="fixed"});if(isFixed&&$.browser.opera){$.datepicker._pos[0]-=document.documentElement.scrollLeft;$.datepicker._pos[1]-=document.documentElement.scrollTop}inst._datepickerDiv.css("position",($.datepicker._inDialog&&$.blockUI?"static":(isFixed?"fixed":"absolute"))).css({left:$.datepicker._pos[0]+"px",top:$.datepicker._pos[1]+"px"});$.datepicker._pos=null;inst._rangeStart=null;$.datepicker._updateDatepicker(inst);if(!inst._inline){var speed=inst._get("speed");var postProcess=function(){$.datepicker._datepickerShowing=true;$.datepicker._afterShow(inst)};var showAnim=inst._get("showAnim")||"show";inst._datepickerDiv[showAnim](speed,postProcess);if(speed==""){postProcess()}if(inst._input[0].type!="hidden"){inst._input[0].focus()}$.datepicker._curInst=inst}},_updateDatepicker:function(inst){inst._datepickerDiv.empty().append(inst._generateDatepicker());var numMonths=inst._getNumberOfMonths();if(numMonths[0]!=1||numMonths[1]!=1){inst._datepickerDiv.addClass("ui-datepicker-multi")}else{inst._datepickerDiv.removeClass("ui-datepicker-multi")}if(inst._get("isRTL")){inst._datepickerDiv.addClass("ui-datepicker-rtl")}else{inst._datepickerDiv.removeClass("ui-datepicker-rtl")}if(inst._input&&inst._input[0].type!="hidden"){$(inst._input[0]).focus()}},_afterShow:function(inst){var numMonths=inst._getNumberOfMonths();inst._datepickerDiv.width(numMonths[1]*$(".ui-datepicker",inst._datepickerDiv[0])[0].offsetWidth);if($.browser.msie&&parseInt($.browser.version)<7){$("iframe.ui-datepicker-cover").css({width:inst._datepickerDiv.width()+4,height:inst._datepickerDiv.height()+4})}var isFixed=inst._datepickerDiv.css("position")=="fixed";var pos=inst._input?$.datepicker._findPos(inst._input[0]):null;var browserWidth=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth;var browserHeight=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight;var scrollX=(isFixed?0:document.documentElement.scrollLeft||document.body.scrollLeft);var scrollY=(isFixed?0:document.documentElement.scrollTop||document.body.scrollTop);if((inst._datepickerDiv.offset().left+inst._datepickerDiv.width()-(isFixed&&$.browser.msie?document.documentElement.scrollLeft:0))>(browserWidth+scrollX)){inst._datepickerDiv.css("left",Math.max(scrollX,pos[0]+(inst._input?$(inst._input[0]).width():null)-inst._datepickerDiv.width()-(isFixed&&$.browser.opera?document.documentElement.scrollLeft:0))+"px")}if((inst._datepickerDiv.offset().top+inst._datepickerDiv.height()-(isFixed&&$.browser.msie?document.documentElement.scrollTop:0))>(browserHeight+scrollY)){inst._datepickerDiv.css("top",Math.max(scrollY,pos[1]-(this._inDialog?0:inst._datepickerDiv.height())-(isFixed&&$.browser.opera?document.documentElement.scrollTop:0))+"px")}},_findPos:function(obj){while(obj&&(obj.type=="hidden"||obj.nodeType!=1)){obj=obj.nextSibling}var position=$(obj).offset();return[position.left,position.top]},_hideDatepicker:function(input,speed){var inst=this._curInst;if(!inst){return }var rangeSelect=inst._get("rangeSelect");if(rangeSelect&&this._stayOpen){this._selectDate(inst,inst._formatDate(inst._currentDay,inst._currentMonth,inst._currentYear))}this._stayOpen=false;if(this._datepickerShowing){speed=(speed!=null?speed:inst._get("speed"));var showAnim=inst._get("showAnim");inst._datepickerDiv[(showAnim=="slideDown"?"slideUp":(showAnim=="fadeIn"?"fadeOut":"hide"))](speed,function(){$.datepicker._tidyDialog(inst)});if(speed==""){this._tidyDialog(inst)}var onClose=inst._get("onClose");if(onClose){onClose.apply((inst._input?inst._input[0]:null),[inst._getDate(),inst])}this._datepickerShowing=false;this._lastInput=null;inst._settings.prompt=null;if(this._inDialog){this._dialogInput.css({position:"absolute",left:"0",top:"-100px"});if($.blockUI){$.unblockUI();$("body").append(this._datepickerDiv)}}this._inDialog=false}this._curInst=null},_tidyDialog:function(inst){inst._datepickerDiv.removeClass("ui-datepicker-dialog").unbind(".ui-datepicker");$(".ui-datepicker-prompt",inst._datepickerDiv).remove()},_checkExternalClick:function(event){if(!$.datepicker._curInst){return }var $target=$(event.target);if(($target.parents("#ui-datepicker-div").length==0)&&!$target.hasClass("hasDatepicker")&&!$target.hasClass("ui-datepicker-trigger")&&$.datepicker._datepickerShowing&&!($.datepicker._inDialog&&$.blockUI)){$.datepicker._hideDatepicker(null,"")}},_adjustDate:function(id,offset,period){var inst=this._getInst(id);inst._adjustDate(offset,period);this._updateDatepicker(inst)},_gotoToday:function(id){var date=new Date();var inst=this._getInst(id);inst._selectedDay=date.getDate();inst._drawMonth=inst._selectedMonth=date.getMonth();inst._drawYear=inst._selectedYear=date.getFullYear();this._adjustDate(inst)},_selectMonthYear:function(id,select,period){var inst=this._getInst(id);inst._selectingMonthYear=false;inst[period=="M"?"_drawMonth":"_drawYear"]=select.options[select.selectedIndex].value-0;this._adjustDate(inst)},_clickMonthYear:function(id){var inst=this._getInst(id);if(inst._input&&inst._selectingMonthYear&&!$.browser.msie){inst._input[0].focus()}inst._selectingMonthYear=!inst._selectingMonthYear;},_changeFirstDay:function(id,day){var inst=this._getInst(id);inst._settings.firstDay=day;this._updateDatepicker(inst);},_selectDay:function(id,month,year,td){if($(td).is(".ui-datepicker-unselectable")){return }var inst=this._getInst(id);var rangeSelect=inst._get("rangeSelect");if(rangeSelect){if(!this._stayOpen){$(".ui-datepicker td").removeClass("ui-datepicker-current-day");$(td).addClass("ui-datepicker-current-day")}this._stayOpen=!this._stayOpen}inst._selectedDay=inst._currentDay=$("a",td).html();inst._selectedMonth=inst._currentMonth=month;inst._selectedYear=inst._currentYear=year;this._selectDate(id,inst._formatDate(inst._currentDay,inst._currentMonth,inst._currentYear));if(this._stayOpen){inst._endDay=inst._endMonth=inst._endYear=null;inst._rangeStart=new Date(inst._currentYear,inst._currentMonth,inst._currentDay);this._updateDatepicker(inst)}else{if(rangeSelect){inst._endDay=inst._currentDay;inst._endMonth=inst._currentMonth;inst._endYear=inst._currentYear;inst._selectedDay=inst._currentDay=inst._rangeStart.getDate();inst._selectedMonth=inst._currentMonth=inst._rangeStart.getMonth();inst._selectedYear=inst._currentYear=inst._rangeStart.getFullYear();inst._rangeStart=null;if(inst._inline){this._updateDatepicker(inst);}}}},_clearDate:function(id){var inst=this._getInst(id);if(inst._get("mandatory")){return;}this._stayOpen=false;inst._endDay=inst._endMonth=inst._endYear=inst._rangeStart=null;this._selectDate(inst,"")},_selectDate:function(id,dateStr){var inst=this._getInst(id);dateStr=(dateStr!=null?dateStr:inst._formatDate());if(inst._rangeStart){dateStr=inst._formatDate(inst._rangeStart)+inst._get("rangeSeparator")+dateStr}if(inst._input){inst._input.val(dateStr)}var onSelect=inst._get("onSelect");if(onSelect){onSelect.apply((inst._input?inst._input[0]:null),[dateStr,inst]);}else{if(inst._input){inst._input.trigger("change")}}if(inst._inline){this._updateDatepicker(inst)}else{if(!this._stayOpen){this._hideDatepicker(null,inst._get("speed"));this._lastInput=inst._input[0];if(typeof (inst._input[0])!="object"){inst._input[0].focus();}this._lastInput=null;}}},noWeekends:function(date){var day=date.getDay();return[(day>0&&day<6),""];},iso8601Week:function(date){var checkDate=new Date(date.getFullYear(),date.getMonth(),date.getDate(),(date.getTimezoneOffset()/-60));var firstMon=new Date(checkDate.getFullYear(),1-1,4);var firstDay=firstMon.getDay()||7;firstMon.setDate(firstMon.getDate()+1-firstDay);if(firstDay<4&&checkDate<firstMon){checkDate.setDate(checkDate.getDate()-3);return $.datepicker.iso8601Week(checkDate);}else{if(checkDate>new Date(checkDate.getFullYear(),12-1,28)){firstDay=new Date(checkDate.getFullYear()+1,1-1,4).getDay()||7;if(firstDay>4&&(checkDate.getDay()||7)<firstDay-3){checkDate.setDate(checkDate.getDate()+3);return $.datepicker.iso8601Week(checkDate)}}}return Math.floor(((checkDate-firstMon)/86400000)/7)+1},dateStatus:function(date,inst){return $.datepicker.formatDate(inst._get("dateStatus"),date,inst._getFormatConfig())},parseDate:function(format,value,settings){if(format==null||value==null){throw"Invalid arguments"}value=(typeof value=="object"?value.toString():value+"");if(value==""){return null;}var shortYearCutoff=(settings?settings.shortYearCutoff:null)||this._defaults.shortYearCutoff;var dayNamesShort=(settings?settings.dayNamesShort:null)||this._defaults.dayNamesShort;var dayNames=(settings?settings.dayNames:null)||this._defaults.dayNames;var monthNamesShort=(settings?settings.monthNamesShort:null)||this._defaults.monthNamesShort;var monthNames=(settings?settings.monthNames:null)||this._defaults.monthNames;var year=-1;var month=-1;var day=-1;var literal=false;var lookAhead=function(match){var matches=(iFormat+1<format.length&&format.charAt(iFormat+1)==match);if(matches){iFormat++}return matches};var getNumber=function(match){lookAhead(match);var size=(match=="y"?4:2);var num=0;while(size>0&&iValue<value.length&&value.charAt(iValue)>="0"&&value.charAt(iValue)<="9"){num=num*10+(value.charAt(iValue++)-0);size--}if(size==(match=="y"?4:2)){throw"Missing number at position "+iValue}return num};var getName=function(match,shortNames,longNames){var names=(lookAhead(match)?longNames:shortNames);var size=0;for(var j=0;j<names.length;j++){size=Math.max(size,names[j].length);}var name="";var iInit=iValue;while(size>0&&iValue<value.length){name+=value.charAt(iValue++);for(var i=0;i<names.length;i++){if(name==names[i]){return i+1}}size--}throw"Unknown name at position "+iInit;};var checkLiteral=function(){if(value.charAt(iValue)!=format.charAt(iFormat)){throw"Unexpected literal at position "+iValue;}iValue++;};var iValue=0;for(var iFormat=0;iFormat<format.length;iFormat++){if(literal){if(format.charAt(iFormat)=="'"&&!lookAhead("'")){literal=false;}else{checkLiteral();}}else{switch(format.charAt(iFormat)){case"d":day=getNumber("d");break;case"D":getName("D",dayNamesShort,dayNames);break;case"m":month=getNumber("m");break;case"M":month=getName("M",monthNamesShort,monthNames);break;case"y":year=getNumber("y");break;case"'":if(lookAhead("'")){checkLiteral()}else{literal=true}break;default:checkLiteral()}}}if(year<100){year+=new Date().getFullYear()-new Date().getFullYear()%100+(year<=shortYearCutoff?0:-100);}var date=new Date(year,month-1,day);if(date.getFullYear()!=year||date.getMonth()+1!=month||date.getDate()!=day){throw"Invalid date"}return date;},formatDate:function(format,date,settings){if(!date){return""}var dayNamesShort=(settings?settings.dayNamesShort:null)||this._defaults.dayNamesShort;var dayNames=(settings?settings.dayNames:null)||this._defaults.dayNames;var monthNamesShort=(settings?settings.monthNamesShort:null)||this._defaults.monthNamesShort;var monthNames=(settings?settings.monthNames:null)||this._defaults.monthNames;var lookAhead=function(match){var matches=(iFormat+1<format.length&&format.charAt(iFormat+1)==match);if(matches){iFormat++;}return matches};var formatNumber=function(match,value){return(lookAhead(match)&&value<10?"0":"")+value;};var formatName=function(match,value,shortNames,longNames){return(lookAhead(match)?longNames[value]:shortNames[value])};var output="";var literal=false;if(date){for(var iFormat=0;iFormat<format.length;iFormat++){if(literal){if(format.charAt(iFormat)=="'"&&!lookAhead("'")){literal=false;}else{output+=format.charAt(iFormat)}}else{switch(format.charAt(iFormat)){case"d":output+=formatNumber("d",date.getDate());break;case"D":output+=formatName("D",date.getDay(),dayNamesShort,dayNames);break;case"m":output+=formatNumber("m",date.getMonth()+1);break;case"M":output+=formatName("M",date.getMonth(),monthNamesShort,monthNames);break;case"y":output+=(lookAhead("y")?date.getFullYear():(date.getYear()%100<10?"0":"")+date.getYear()%100);break;case"'":if(lookAhead("'")){output+="'"}else{literal=true}break;default:output+=format.charAt(iFormat)}}}}return output;},_possibleChars:function(format){var chars="";var literal=false;for(var iFormat=0;iFormat<format.length;iFormat++){if(literal){if(format.charAt(iFormat)=="'"&&!lookAhead("'")){literal=false;}else{chars+=format.charAt(iFormat)}}else{switch(format.charAt(iFormat)){case"d"||"m"||"y":chars+="0123456789";break;case"D"||"M":return null;case"'":if(lookAhead("'")){chars+="'"}else{literal=true}break;default:chars+=format.charAt(iFormat)}}}return chars}});function DatepickerInstance(settings,inline){this._id=$.datepicker._register(this);this._selectedDay=0;this._selectedMonth=0;this._selectedYear=0;this._drawMonth=0;this._drawYear=0;this._input=null;this._inline=inline;this._datepickerDiv=(!inline?$.datepicker._datepickerDiv:$('<div id="ui-datepicker-div-'+this._id+'" class="ui-datepicker-inline">'));this._settings=extendRemove(settings||{});if(inline){this._setDate(this._getDefaultDate());}}$.extend(DatepickerInstance.prototype,{_get:function(name){return this._settings[name]!==undefined?this._settings[name]:$.datepicker._defaults[name];},_setDateFromField:function(input){this._input=$(input);var dateFormat=this._get("dateFormat");var dates=this._input?this._input.val().split(this._get("rangeSeparator")):null;this._endDay=this._endMonth=this._endYear=null;var date=defaultDate=this._getDefaultDate();if(dates.length>0){var settings=this._getFormatConfig();if(dates.length>1){date=$.datepicker.parseDate(dateFormat,dates[1],settings)||defaultDate;this._endDay=date.getDate();this._endMonth=date.getMonth();this._endYear=date.getFullYear();}try{date=$.datepicker.parseDate(dateFormat,dates[0],settings)||defaultDate}catch(e){$.datepicker.log(e);date=defaultDate;}}this._selectedDay=date.getDate();this._drawMonth=this._selectedMonth=date.getMonth();this._drawYear=this._selectedYear=date.getFullYear();this._currentDay=(dates[0]?date.getDate():0);this._currentMonth=(dates[0]?date.getMonth():0);this._currentYear=(dates[0]?date.getFullYear():0);this._adjustDate();},_getDefaultDate:function(){var date=this._determineDate("defaultDate",new Date());var minDate=this._getMinMaxDate("min",true);var maxDate=this._getMinMaxDate("max");date=(minDate&&date<minDate?minDate:date);date=(maxDate&&date>maxDate?maxDate:date);return date},_determineDate:function(name,defaultDate){var offsetNumeric=function(offset){var date=new Date();date.setDate(date.getDate()+offset);return date};var offsetString=function(offset,getDaysInMonth){var date=new Date();var matches=/^([+-]?[0-9]+)\s*(d|D|w|W|m|M|y|Y)?$/.exec(offset);if(matches){var year=date.getFullYear();var month=date.getMonth();var day=date.getDate();switch(matches[2]||"d"){case"d":case"D":day+=(matches[1]-0);break;case"w":case"W":day+=(matches[1]*7);break;case"m":case"M":month+=(matches[1]-0);day=Math.min(day,getDaysInMonth(year,month));break;case"y":case"Y":year+=(matches[1]-0);day=Math.min(day,getDaysInMonth(year,month));break}date=new Date(year,month,day)}return date};var date=this._get(name);return(date==null?defaultDate:(typeof date=="string"?offsetString(date,this._getDaysInMonth):(typeof date=="number"?offsetNumeric(date):date)))},_setDate:function(date,endDate){this._selectedDay=this._currentDay=date.getDate();this._drawMonth=this._selectedMonth=this._currentMonth=date.getMonth();this._drawYear=this._selectedYear=this._currentYear=date.getFullYear();if(this._get("rangeSelect")){if(endDate){this._endDay=endDate.getDate();this._endMonth=endDate.getMonth();this._endYear=endDate.getFullYear();}else{this._endDay=this._currentDay;this._endMonth=this._currentMonth;this._endYear=this._currentYear}}this._adjustDate();},_getDate:function(){var startDate=(!this._currentYear||(this._input&&this._input.val()=="")?null:new Date(this._currentYear,this._currentMonth,this._currentDay));if(this._get("rangeSelect")){return[startDate,(!this._endYear?null:new Date(this._endYear,this._endMonth,this._endDay))]}else{return startDate}},_generateDatepicker:function(){var today=new Date();today=new Date(today.getFullYear(),today.getMonth(),today.getDate());var showStatus=this._get("showStatus");var isRTL=this._get("isRTL");var clear=(this._get("mandatory")?"":'<div class="ui-datepicker-clear"><a onclick="jQuery.datepicker._clearDate('+this._id+');"'+(showStatus?this._addStatus(this._get("clearStatus")||" "):"")+">"+this._get("clearText")+"</a></div>");var controls='<div class="ui-datepicker-control">'+(isRTL?"":clear)+'<div class="ui-datepicker-close"><a onclick="jQuery.datepicker._hideDatepicker();"'+(showStatus?this._addStatus(this._get("closeStatus")||" "):"")+">"+this._get("closeText")+"</a></div>"+(isRTL?clear:"")+"</div>";var prompt=this._get("prompt");var closeAtTop=this._get("closeAtTop");var hideIfNoPrevNext=this._get("hideIfNoPrevNext");var numMonths=this._getNumberOfMonths();var stepMonths=this._get("stepMonths");var isMultiMonth=(numMonths[0]!=1||numMonths[1]!=1);var minDate=this._getMinMaxDate("min",true);var maxDate=this._getMinMaxDate("max");var drawMonth=this._drawMonth;var drawYear=this._drawYear;if(maxDate){var maxDraw=new Date(maxDate.getFullYear(),maxDate.getMonth()-numMonths[1]+1,maxDate.getDate());maxDraw=(minDate&&maxDraw<minDate?minDate:maxDraw);while(new Date(drawYear,drawMonth,1)>maxDraw){drawMonth--;if(drawMonth<0){drawMonth=11;drawYear--}}}var prev='<div class="ui-datepicker-prev">'+(this._canAdjustMonth(-1,drawYear,drawMonth)?'<a onclick="jQuery.datepicker._adjustDate('+this._id+", -"+stepMonths+", 'M');\""+(showStatus?this._addStatus(this._get("prevStatus")||" "):"")+">"+this._get("prevText")+"</a>":(hideIfNoPrevNext?"":"<label>"+this._get("prevText")+"</label>"))+"</div>";var next='<div class="ui-datepicker-next">'+(this._canAdjustMonth(+1,drawYear,drawMonth)?'<a onclick="jQuery.datepicker._adjustDate('+this._id+", +"+stepMonths+", 'M');\""+(showStatus?this._addStatus(this._get("nextStatus")||" "):"")+">"+this._get("nextText")+"</a>":(hideIfNoPrevNext?">":"<label>"+this._get("nextText")+"</label>"))+"</div>";var html=(prompt?'<div class="ui-datepicker-prompt">'+prompt+"</div>":"")+(closeAtTop&&!this._inline?controls:"")+'<div class="ui-datepicker-links">'+(isRTL?next:prev)+(this._isInRange(today)?'<div class="ui-datepicker-current"><a onclick="jQuery.datepicker._gotoToday('+this._id+');"'+(showStatus?this._addStatus(this._get("currentStatus")||" "):"")+">"+this._get("currentText")+"</a></div>":"")+(isRTL?prev:next)+"</div>";var showWeeks=this._get("showWeeks");for(var row=0;row<numMonths[0];row++){for(var col=0;col<numMonths[1];col++){var selectedDate=new Date(drawYear,drawMonth,this._selectedDay);html+='<div class="ui-datepicker-one-month'+(col==0?" ui-datepicker-new-row":"")+'">'+this._generateMonthYearHeader(drawMonth,drawYear,minDate,maxDate,selectedDate,row>0||col>0)+'<table class="ui-datepicker" cellpadding="0" cellspacing="0"><thead><tr class="ui-datepicker-title-row">'+(showWeeks?"<td>"+this._get("weekHeader")+"</td>":"");var firstDay=this._get("firstDay");var changeFirstDay=this._get("changeFirstDay");var dayNames=this._get("dayNames");var dayNamesShort=this._get("dayNamesShort");var dayNamesMin=this._get("dayNamesMin");for(var dow=0;dow<7;dow++){var day=(dow+firstDay)%7;var status=this._get("dayStatus")||" ";status=(status.indexOf("DD")>-1?status.replace(/DD/,dayNames[day]):status.replace(/D/,dayNamesShort[day]));html+="<td"+((dow+firstDay+6)%7>=5?' class="ui-datepicker-week-end-cell"':"")+">"+(!changeFirstDay?"<span":'<a onclick="jQuery.datepicker._changeFirstDay('+this._id+", "+day+');"')+(showStatus?this._addStatus(status):"")+' title="'+dayNames[day]+'">'+dayNamesMin[day]+(changeFirstDay?"</a>":"</span>")+"</td>"}html+="</tr></thead><tbody>";var daysInMonth=this._getDaysInMonth(drawYear,drawMonth);if(drawYear==this._selectedYear&&drawMonth==this._selectedMonth){this._selectedDay=Math.min(this._selectedDay,daysInMonth);}var leadDays=(this._getFirstDayOfMonth(drawYear,drawMonth)-firstDay+7)%7;var currentDate=(!this._currentDay?new Date(9999,9,9):new Date(this._currentYear,this._currentMonth,this._currentDay));var endDate=this._endDay?new Date(this._endYear,this._endMonth,this._endDay):currentDate;var printDate=new Date(drawYear,drawMonth,1-leadDays);var numRows=(isMultiMonth?6:Math.ceil((leadDays+daysInMonth)/7));var beforeShowDay=this._get("beforeShowDay");var showOtherMonths=this._get("showOtherMonths");var calculateWeek=this._get("calculateWeek")||$.datepicker.iso8601Week;var dateStatus=this._get("statusForDate")||$.datepicker.dateStatus;for(var dRow=0;dRow<numRows;dRow++){html+='<tr class="ui-datepicker-days-row">'+(showWeeks?'<td class="ui-datepicker-week-col">'+calculateWeek(printDate)+"</td>":"");for(var dow=0;dow<7;dow++){var daySettings=(beforeShowDay?beforeShowDay.apply((this._input?this._input[0]:null),[printDate]):[true,""]);var otherMonth=(printDate.getMonth()!=drawMonth);var unselectable=otherMonth||!daySettings[0]||(minDate&&printDate<minDate)||(maxDate&&printDate>maxDate);html+='<td class="ui-datepicker-days-cell'+((dow+firstDay+6)%7>=5?" ui-datepicker-week-end-cell":"")+(otherMonth?" ui-datepicker-otherMonth":"")+(printDate.getTime()==selectedDate.getTime()&&drawMonth==this._selectedMonth?" ui-datepicker-days-cell-over":"")+(unselectable?" ui-datepicker-unselectable":"")+(otherMonth&&!showOtherMonths?"":" "+daySettings[1]+(printDate.getTime()>=currentDate.getTime()&&printDate.getTime()<=endDate.getTime()?" ui-datepicker-current-day":"")+(printDate.getTime()==today.getTime()?" ui-datepicker-today":""))+'"'+(unselectable?"":" onmouseover=\"jQuery(this).addClass('ui-datepicker-days-cell-over');"+(!showStatus||(otherMonth&&!showOtherMonths)?"":"jQuery('#ui-datepicker-status-"+this._id+"').html('"+(dateStatus.apply((this._input?this._input[0]:null),[printDate,this])||" ")+"');")+"\" onmouseout=\"jQuery(this).removeClass('ui-datepicker-days-cell-over');"+(!showStatus||(otherMonth&&!showOtherMonths)?"":"jQuery('#ui-datepicker-status-"+this._id+"').html(' ');")+'" onclick="jQuery.datepicker._selectDay('+this._id+","+drawMonth+","+drawYear+', this);"')+">"+(otherMonth?(showOtherMonths?printDate.getDate():" "):(unselectable?printDate.getDate():"<a>"+printDate.getDate()+"</a>"))+"</td>";printDate.setDate(printDate.getDate()+1)}html+="</tr>";}drawMonth++;if(drawMonth>11){drawMonth=0;drawYear++;}html+="</tbody></table></div>"}}html+=(showStatus?'<div style="clear: both;"></div><div id="ui-datepicker-status-'+this._id+'" class="ui-datepicker-status">'+(this._get("initStatus")||" ")+"</div>":"")+(!closeAtTop&&!this._inline?controls:"")+'<div style="clear: both;"></div>'+($.browser.msie&&parseInt($.browser.version)<7&&!this._inline?'<iframe src="javascript:false;" class="ui-datepicker-cover"></iframe>':"");return html;},_generateMonthYearHeader:function(drawMonth,drawYear,minDate,maxDate,selectedDate,secondary){minDate=(this._rangeStart&&minDate&&selectedDate<minDate?selectedDate:minDate);var showStatus=this._get("showStatus");var html='<div class="ui-datepicker-header">';var monthNames=this._get("monthNames");if(secondary||!this._get("changeMonth")){html+=monthNames[drawMonth]+" "}else{var inMinYear=(minDate&&minDate.getFullYear()==drawYear);var inMaxYear=(maxDate&&maxDate.getFullYear()==drawYear);html+='<select class="ui-datepicker-new-month" onchange="jQuery.datepicker._selectMonthYear('+this._id+", this, 'M');\" onclick=\"jQuery.datepicker._clickMonthYear("+this._id+');"'+(showStatus?this._addStatus(this._get("monthStatus")||" "):"")+">";for(var month=0;month<12;month++){if((!inMinYear||month>=minDate.getMonth())&&(!inMaxYear||month<=maxDate.getMonth())){html+='<option value="'+month+'"'+(month==drawMonth?' selected="selected"':"")+">"+monthNames[month]+"</option>"}}html+="</select>";}if(secondary||!this._get("changeYear")){html+=drawYear;}else{var years=this._get("yearRange").split(":");var year=0;var endYear=0;if(years.length!=2){year=drawYear-10;endYear=drawYear+10;}else{if(years[0].charAt(0)=="+"||years[0].charAt(0)=="-"){year=new Date().getFullYear()+parseInt(years[0],10);endYear=new Date().getFullYear()+parseInt(years[1],10);}else{year=parseInt(years[0],10);endYear=parseInt(years[1],10)}}year=(minDate?Math.max(year,minDate.getFullYear()):year);endYear=(maxDate?Math.min(endYear,maxDate.getFullYear()):endYear);html+='<select class="ui-datepicker-new-year" onchange="jQuery.datepicker._selectMonthYear('+this._id+", this, 'Y');\" onclick=\"jQuery.datepicker._clickMonthYear("+this._id+');"'+(showStatus?this._addStatus(this._get("yearStatus")||" "):"")+">";for(;year<=endYear;year++){html+='<option value="'+year+'"'+(year==drawYear?' selected="selected"':"")+">"+year+"</option>"}html+="</select>"}html+="</div>";return html},_addStatus:function(text){return" onmouseover=\"jQuery('#ui-datepicker-status-"+this._id+"').html('"+text+"');\" onmouseout=\"jQuery('#ui-datepicker-status-"+this._id+"').html(' ');\"";},_adjustDate:function(offset,period){var year=this._drawYear+(period=="Y"?offset:0);var month=this._drawMonth+(period=="M"?offset:0);var day=Math.min(this._selectedDay,this._getDaysInMonth(year,month))+(period=="D"?offset:0);var date=new Date(year,month,day);var minDate=this._getMinMaxDate("min",true);var maxDate=this._getMinMaxDate("max");date=(minDate&&date<minDate?minDate:date);date=(maxDate&&date>maxDate?maxDate:date);this._selectedDay=date.getDate();this._drawMonth=this._selectedMonth=date.getMonth();this._drawYear=this._selectedYear=date.getFullYear();},_getNumberOfMonths:function(){var numMonths=this._get("numberOfMonths");return(numMonths==null?[1,1]:(typeof numMonths=="number"?[1,numMonths]:numMonths))},_getMinMaxDate:function(minMax,checkRange){var date=this._determineDate(minMax+"Date",null);if(date){date.setHours(0);date.setMinutes(0);date.setSeconds(0);date.setMilliseconds(0);}return date||(checkRange?this._rangeStart:null);},_getDaysInMonth:function(year,month){return 32-new Date(year,month,32).getDate();},_getFirstDayOfMonth:function(year,month){return new Date(year,month,1).getDay()},_canAdjustMonth:function(offset,curYear,curMonth){var numMonths=this._getNumberOfMonths();var date=new Date(curYear,curMonth+(offset<0?offset:numMonths[1]),1);if(offset<0){date.setDate(this._getDaysInMonth(date.getFullYear(),date.getMonth()))}return this._isInRange(date)},_isInRange:function(date){var newMinDate=(!this._rangeStart?null:new Date(this._selectedYear,this._selectedMonth,this._selectedDay));newMinDate=(newMinDate&&this._rangeStart<newMinDate?this._rangeStart:newMinDate);var minDate=newMinDate||this._getMinMaxDate("min");var maxDate=this._getMinMaxDate("max");return((!minDate||date>=minDate)&&(!maxDate||date<=maxDate))},_getFormatConfig:function(){var shortYearCutoff=this._get("shortYearCutoff");shortYearCutoff=(typeof shortYearCutoff!="string"?shortYearCutoff:new Date().getFullYear()%100+parseInt(shortYearCutoff,10));return{shortYearCutoff:shortYearCutoff,dayNamesShort:this._get("dayNamesShort"),dayNames:this._get("dayNames"),monthNamesShort:this._get("monthNamesShort"),monthNames:this._get("monthNames")}},_formatDate:function(day,month,year){if(!day){this._currentDay=this._selectedDay;this._currentMonth=this._selectedMonth;this._currentYear=this._selectedYear}var date=(day?(typeof day=="object"?day:new Date(year,month,day)):new Date(this._currentYear,this._currentMonth,this._currentDay));return $.datepicker.formatDate(this._get("dateFormat"),date,this._getFormatConfig());}});function extendRemove(target,props){$.extend(target,props);for(var name in props){if(props[name]==null){target[name]=null}}return target}$.fn.datepicker=function(options){var otherArgs=Array.prototype.slice.call(arguments,1);if(typeof options=="string"&&(options=="isDisabled"||options=="getDate")){return $.datepicker["_"+options+"Datepicker"].apply($.datepicker,[this[0]].concat(otherArgs))}return this.each(function(){typeof options=="string"?$.datepicker["_"+options+"Datepicker"].apply($.datepicker,[this].concat(otherArgs)):$.datepicker._attachDatepicker(this,options)})};$.datepicker=new Datepicker();$(document).ready(function(){$(document.body).append($.datepicker._datepickerDiv).mousedown($.datepicker._checkExternalClick);})})(jQuery) +(function($){function Datepicker(){this.debug=false;this._nextId=0;this._inst=[];this._curInst=null;this._disabledInputs=[];this._datepickerShowing=false;this._inDialog=false;this.regional=[];this.regional[""]={clearText:"Clear",clearStatus:"Erase the current date",closeText:"Close",closeStatus:"Close without change",prevText:"<Prev",prevStatus:"Show the previous month",nextText:"Next>",nextStatus:"Show the next month",currentText:"Today",currentStatus:"Show the current month",monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthNamesShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],monthStatus:"Show a different month",yearStatus:"Show a different year",weekHeader:"Wk",weekStatus:"Week of the year",dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],dayStatus:"Set DD as first week day",dateStatus:"Select DD, M d",dateFormat:"yy-mm-dd",firstDay:0,initStatus:"Select a date",isRTL:false};this._defaults={showOn:"focus",showAnim:"show",defaultDate:null,appendText:"",buttonText:"...",buttonImage:"",buttonImageOnly:false,closeAtTop:true,mandatory:false,hideIfNoPrevNext:false,changeMonth:true,changeYear:true,yearRange:"-10:+10",changeFirstDay:true,showOtherMonths:false,showWeeks:false,calculateWeek:this.iso8601Week,shortYearCutoff:"+10",showStatus:false,statusForDate:this.dateStatus,minDate:null,maxDate:null,speed:"normal",beforeShowDay:null,beforeShow:null,onSelect:null,onClose:null,numberOfMonths:1,stepMonths:1,rangeSelect:false,rangeSeparator:" - "};$.extend(this._defaults,this.regional[""]);this._datepickerDiv=$('<div id="ui-datepicker-div"></div>')}$.extend(Datepicker.prototype,{markerClassName:"hasDatepicker",log:function(){if(this.debug){console.log.apply("",arguments)}},_register:function(inst){var id=this._nextId++;this._inst[id]=inst;return id},_getInst:function(id){return this._inst[id]||id},setDefaults:function(settings){extendRemove(this._defaults,settings||{});return this},_attachDatepicker:function(target,settings){var inlineSettings=null;for(attrName in this._defaults){var attrValue=target.getAttribute("date:"+attrName);if(attrValue){inlineSettings=inlineSettings||{};try{inlineSettings[attrName]=eval(attrValue)}catch(err){inlineSettings[attrName]=attrValue}}}var nodeName=target.nodeName.toLowerCase();var instSettings=(inlineSettings?$.extend(settings||{},inlineSettings||{}):settings);if(nodeName=="input"){var inst=(inst&&!inlineSettings?inst:new DatepickerInstance(instSettings,false));this._connectDatepicker(target,inst)}else{if(nodeName=="div"||nodeName=="span"){var inst=new DatepickerInstance(instSettings,true);this._inlineDatepicker(target,inst)}}},_destroyDatepicker:function(target){var nodeName=target.nodeName.toLowerCase();var calId=target._calId;target._calId=null;var $target=$(target);if(nodeName=="input"){$target.siblings(".ui-datepicker-append").replaceWith("").end().siblings(".ui-datepicker-trigger").replaceWith("").end().removeClass(this.markerClassName).unbind("focus",this._showDatepicker).unbind("keydown",this._doKeyDown).unbind("keypress",this._doKeyPress);var wrapper=$target.parents(".ui-datepicker-wrap");if(wrapper){wrapper.replaceWith(wrapper.html())}}else{if(nodeName=="div"||nodeName=="span"){$target.removeClass(this.markerClassName).empty()}}if($("input[_calId="+calId+"]").length==0){this._inst[calId]=null}},_enableDatepicker:function(target){target.disabled=false;$(target).siblings("button.ui-datepicker-trigger").each(function(){this.disabled=false}).end().siblings("img.ui-datepicker-trigger").css({opacity:"1.0",cursor:""});this._disabledInputs=$.map(this._disabledInputs,function(value){return(value==target?null:value)})},_disableDatepicker:function(target){target.disabled=true;$(target).siblings("button.ui-datepicker-trigger").each(function(){this.disabled=true}).end().siblings("img.ui-datepicker-trigger").css({opacity:"0.5",cursor:"default"});this._disabledInputs=$.map($.datepicker._disabledInputs,function(value){return(value==target?null:value)});this._disabledInputs[$.datepicker._disabledInputs.length]=target},_isDisabledDatepicker:function(target){if(!target){return false}for(var i=0;i<this._disabledInputs.length;i++){if(this._disabledInputs[i]==target){return true}}return false},_changeDatepicker:function(target,name,value){var settings=name||{};if(typeof name=="string"){settings={};settings[name]=value}if(inst=this._getInst(target._calId)){extendRemove(inst._settings,settings);this._updateDatepicker(inst)}},_setDateDatepicker:function(target,date,endDate){if(inst=this._getInst(target._calId)){inst._setDate(date,endDate);this._updateDatepicker(inst);}},_getDateDatepicker:function(target){var inst=this._getInst(target._calId);if(inst){inst._setDateFromField($(target));}return(inst?inst._getDate():null);},_doKeyDown:function(e){var inst=$.datepicker._getInst(this._calId);if($.datepicker._datepickerShowing){switch(e.keyCode){case 9:$.datepicker._hideDatepicker(null,"");break;case 13:$.datepicker._selectDay(inst,inst._selectedMonth,inst._selectedYear,$("td.ui-datepicker-days-cell-over",inst._datepickerDiv)[0]);return false;break;case 27:$.datepicker._hideDatepicker(null,inst._get("speed"));break;case 33:$.datepicker._adjustDate(inst,(e.ctrlKey?-1:-inst._get("stepMonths")),(e.ctrlKey?"Y":"M"));break;case 34:$.datepicker._adjustDate(inst,(e.ctrlKey?+1:+inst._get("stepMonths")),(e.ctrlKey?"Y":"M"));break;case 35:if(e.ctrlKey){$.datepicker._clearDate(inst);}break;case 36:if(e.ctrlKey){$.datepicker._gotoToday(inst);}break;case 37:if(e.ctrlKey){$.datepicker._adjustDate(inst,-1,"D");}break;case 38:if(e.ctrlKey){$.datepicker._adjustDate(inst,-7,"D")}break;case 39:if(e.ctrlKey){$.datepicker._adjustDate(inst,+1,"D")}break;case 40:if(e.ctrlKey){$.datepicker._adjustDate(inst,+7,"D");}break;}}else{if(e.keyCode==36&&e.ctrlKey){$.datepicker._showDatepicker(this)}}},_doKeyPress:function(e){var inst=$.datepicker._getInst(this._calId);var chars=$.datepicker._possibleChars(inst._get("dateFormat"));var chr=String.fromCharCode(e.charCode==undefined?e.keyCode:e.charCode);return e.ctrlKey||(chr<" "||!chars||chars.indexOf(chr)>-1);},_connectDatepicker:function(target,inst){var input=$(target);if(input.is("."+this.markerClassName)){return }var appendText=inst._get("appendText");var isRTL=inst._get("isRTL");if(appendText){if(isRTL){input.before('<span class="ui-datepicker-append">'+appendText)}else{input.after('<span class="ui-datepicker-append">'+appendText);}}var showOn=inst._get("showOn");if(showOn=="focus"||showOn=="both"){input.focus(this._showDatepicker)}if(showOn=="button"||showOn=="both"){input.wrap('<span class="ui-datepicker-wrap">');var buttonText=inst._get("buttonText");var buttonImage=inst._get("buttonImage");var trigger=$(inst._get("buttonImageOnly")?$("<img>").addClass("ui-datepicker-trigger").attr({src:buttonImage,alt:buttonText,title:buttonText}):$("<button>").addClass("ui-datepicker-trigger").attr({type:"button"}).html(buttonImage!=""?$("<img>").attr({src:buttonImage,alt:buttonText,title:buttonText}):buttonText));if(isRTL){input.before(trigger)}else{input.after(trigger)}trigger.click(function(){if($.datepicker._datepickerShowing&&$.datepicker._lastInput==target){$.datepicker._hideDatepicker()}else{$.datepicker._showDatepicker(target)}})}input.addClass(this.markerClassName).keydown(this._doKeyDown).keypress(this._doKeyPress).bind("setData.datepicker",function(event,key,value){inst._settings[key]=value;}).bind("getData.datepicker",function(event,key){return inst._get(key)});input[0]._calId=inst._id},_inlineDatepicker:function(target,inst){var input=$(target);if(input.is("."+this.markerClassName)){return }input.addClass(this.markerClassName).append(inst._datepickerDiv).bind("setData.datepicker",function(event,key,value){inst._settings[key]=value}).bind("getData.datepicker",function(event,key){return inst._get(key)});input[0]._calId=inst._id;this._updateDatepicker(inst)},_inlineShow:function(inst){var numMonths=inst._getNumberOfMonths();inst._datepickerDiv.width(numMonths[1]*$(".ui-datepicker",inst._datepickerDiv[0]).width())},_dialogDatepicker:function(input,dateText,onSelect,settings,pos){var inst=this._dialogInst;if(!inst){inst=this._dialogInst=new DatepickerInstance({},false);this._dialogInput=$('<input type="text" size="1" style="position: absolute; top: -100px;"/>');this._dialogInput.keydown(this._doKeyDown);$("body").append(this._dialogInput);this._dialogInput[0]._calId=inst._id}extendRemove(inst._settings,settings||{});this._dialogInput.val(dateText);this._pos=(pos?(pos.length?pos:[pos.pageX,pos.pageY]):null);if(!this._pos){var browserWidth=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth;var browserHeight=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight;var scrollX=document.documentElement.scrollLeft||document.body.scrollLeft;var scrollY=document.documentElement.scrollTop||document.body.scrollTop;this._pos=[(browserWidth/2)-100+scrollX,(browserHeight/2)-150+scrollY]}this._dialogInput.css("left",this._pos[0]+"px").css("top",this._pos[1]+"px");inst._settings.onSelect=onSelect;this._inDialog=true;this._datepickerDiv.addClass("ui-datepicker-dialog");this._showDatepicker(this._dialogInput[0]);if($.blockUI){$.blockUI(this._datepickerDiv)}return this},_showDatepicker:function(input){input=input.target||input;if(input.nodeName.toLowerCase()!="input"){input=$("input",input.parentNode)[0]}if($.datepicker._isDisabledDatepicker(input)||$.datepicker._lastInput==input){return }var inst=$.datepicker._getInst(input._calId);var beforeShow=inst._get("beforeShow");extendRemove(inst._settings,(beforeShow?beforeShow.apply(input,[input,inst]):{}));$.datepicker._hideDatepicker(null,"");$.datepicker._lastInput=input;inst._setDateFromField(input);if($.datepicker._inDialog){input.value=""}if(!$.datepicker._pos){$.datepicker._pos=$.datepicker._findPos(input);$.datepicker._pos[1]+=input.offsetHeight}var isFixed=false;$(input).parents().each(function(){isFixed|=$(this).css("position")=="fixed"});if(isFixed&&$.browser.opera){$.datepicker._pos[0]-=document.documentElement.scrollLeft;$.datepicker._pos[1]-=document.documentElement.scrollTop}inst._datepickerDiv.css("position",($.datepicker._inDialog&&$.blockUI?"static":(isFixed?"fixed":"absolute"))).css({left:$.datepicker._pos[0]+"px",top:$.datepicker._pos[1]+"px"});$.datepicker._pos=null;inst._rangeStart=null;$.datepicker._updateDatepicker(inst);if(!inst._inline){var speed=inst._get("speed");var postProcess=function(){$.datepicker._datepickerShowing=true;$.datepicker._afterShow(inst)};var showAnim=inst._get("showAnim")||"show";inst._datepickerDiv[showAnim](speed,postProcess);if(speed==""){postProcess()}if(inst._input[0].type!="hidden"){inst._input[0].focus()}$.datepicker._curInst=inst}},_updateDatepicker:function(inst){inst._datepickerDiv.empty().append(inst._generateDatepicker());var numMonths=inst._getNumberOfMonths();if(numMonths[0]!=1||numMonths[1]!=1){inst._datepickerDiv.addClass("ui-datepicker-multi")}else{inst._datepickerDiv.removeClass("ui-datepicker-multi")}if(inst._get("isRTL")){inst._datepickerDiv.addClass("ui-datepicker-rtl")}else{inst._datepickerDiv.removeClass("ui-datepicker-rtl")}if(inst._input&&inst._input[0].type!="hidden"){$(inst._input[0]).focus()}},_afterShow:function(inst){var numMonths=inst._getNumberOfMonths();inst._datepickerDiv.width(numMonths[1]*$(".ui-datepicker",inst._datepickerDiv[0])[0].offsetWidth);if($.browser.msie&&parseInt($.browser.version)<7){$("iframe.ui-datepicker-cover").css({width:inst._datepickerDiv.width()+4,height:inst._datepickerDiv.height()+4})}var isFixed=inst._datepickerDiv.css("position")=="fixed";var pos=inst._input?$.datepicker._findPos(inst._input[0]):null;var browserWidth=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth;var browserHeight=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight;var scrollX=(isFixed?0:document.documentElement.scrollLeft||document.body.scrollLeft);var scrollY=(isFixed?0:document.documentElement.scrollTop||document.body.scrollTop);if((inst._datepickerDiv.offset().left+inst._datepickerDiv.width()-(isFixed&&$.browser.msie?document.documentElement.scrollLeft:0))>(browserWidth+scrollX)){inst._datepickerDiv.css("left",Math.max(scrollX,pos[0]+(inst._input?$(inst._input[0]).width():null)-inst._datepickerDiv.width()-(isFixed&&$.browser.opera?document.documentElement.scrollLeft:0))+"px")}if((inst._datepickerDiv.offset().top+inst._datepickerDiv.height()-(isFixed&&$.browser.msie?document.documentElement.scrollTop:0))>(browserHeight+scrollY)){inst._datepickerDiv.css("top",Math.max(scrollY,pos[1]-(this._inDialog?0:inst._datepickerDiv.height())-(isFixed&&$.browser.opera?document.documentElement.scrollTop:0))+"px")}},_findPos:function(obj){while(obj&&(obj.type=="hidden"||obj.nodeType!=1)){obj=obj.nextSibling}var position=$(obj).offset();return[position.left,position.top]},_hideDatepicker:function(input,speed){var inst=this._curInst;if(!inst){return }var rangeSelect=inst._get("rangeSelect");if(rangeSelect&&this._stayOpen){this._selectDate(inst,inst._formatDate(inst._currentDay,inst._currentMonth,inst._currentYear))}this._stayOpen=false;if(this._datepickerShowing){speed=(speed!=null?speed:inst._get("speed"));var showAnim=inst._get("showAnim");inst._datepickerDiv[(showAnim=="slideDown"?"slideUp":(showAnim=="fadeIn"?"fadeOut":"hide"))](speed,function(){$.datepicker._tidyDialog(inst)});if(speed==""){this._tidyDialog(inst)}var onClose=inst._get("onClose");if(onClose){onClose.apply((inst._input?inst._input[0]:null),[inst._getDate(),inst])}this._datepickerShowing=false;this._lastInput=null;inst._settings.prompt=null;if(this._inDialog){this._dialogInput.css({position:"absolute",left:"0",top:"-100px"});if($.blockUI){$.unblockUI();$("body").append(this._datepickerDiv)}}this._inDialog=false}this._curInst=null},_tidyDialog:function(inst){inst._datepickerDiv.removeClass("ui-datepicker-dialog").unbind(".ui-datepicker");$(".ui-datepicker-prompt",inst._datepickerDiv).remove()},_checkExternalClick:function(event){if(!$.datepicker._curInst){return }var $target=$(event.target);if(($target.parents("#ui-datepicker-div").length==0)&&!$target.hasClass("hasDatepicker")&&!$target.hasClass("ui-datepicker-trigger")&&$.datepicker._datepickerShowing&&!($.datepicker._inDialog&&$.blockUI)){$.datepicker._hideDatepicker(null,"")}},_adjustDate:function(id,offset,period){var inst=this._getInst(id);inst._adjustDate(offset,period);this._updateDatepicker(inst)},_gotoToday:function(id){var date=new Date();var inst=this._getInst(id);inst._selectedDay=date.getDate();inst._drawMonth=inst._selectedMonth=date.getMonth();inst._drawYear=inst._selectedYear=date.getFullYear();this._adjustDate(inst)},_selectMonthYear:function(id,select,period){var inst=this._getInst(id);inst._selectingMonthYear=false;inst[period=="M"?"_drawMonth":"_drawYear"]=select.options[select.selectedIndex].value-0;this._adjustDate(inst);},_clickMonthYear:function(id){var inst=this._getInst(id);if(inst._input&&inst._selectingMonthYear&&!$.browser.msie){inst._input[0].focus()}inst._selectingMonthYear=!inst._selectingMonthYear;},_changeFirstDay:function(id,day){var inst=this._getInst(id);inst._settings.firstDay=day;this._updateDatepicker(inst);},_selectDay:function(id,month,year,td){if($(td).is(".ui-datepicker-unselectable")){return }var inst=this._getInst(id);var rangeSelect=inst._get("rangeSelect");if(rangeSelect){if(!this._stayOpen){$(".ui-datepicker td").removeClass("ui-datepicker-current-day");$(td).addClass("ui-datepicker-current-day")}this._stayOpen=!this._stayOpen}inst._selectedDay=inst._currentDay=$("a",td).html();inst._selectedMonth=inst._currentMonth=month;inst._selectedYear=inst._currentYear=year;this._selectDate(id,inst._formatDate(inst._currentDay,inst._currentMonth,inst._currentYear));if(this._stayOpen){inst._endDay=inst._endMonth=inst._endYear=null;inst._rangeStart=new Date(inst._currentYear,inst._currentMonth,inst._currentDay);this._updateDatepicker(inst)}else{if(rangeSelect){inst._endDay=inst._currentDay;inst._endMonth=inst._currentMonth;inst._endYear=inst._currentYear;inst._selectedDay=inst._currentDay=inst._rangeStart.getDate();inst._selectedMonth=inst._currentMonth=inst._rangeStart.getMonth();inst._selectedYear=inst._currentYear=inst._rangeStart.getFullYear();inst._rangeStart=null;if(inst._inline){this._updateDatepicker(inst);}}}},_clearDate:function(id){var inst=this._getInst(id);if(inst._get("mandatory")){return;}this._stayOpen=false;inst._endDay=inst._endMonth=inst._endYear=inst._rangeStart=null;this._selectDate(inst,"")},_selectDate:function(id,dateStr){var inst=this._getInst(id);dateStr=(dateStr!=null?dateStr:inst._formatDate());if(inst._rangeStart){dateStr=inst._formatDate(inst._rangeStart)+inst._get("rangeSeparator")+dateStr}if(inst._input){inst._input.val(dateStr)}var onSelect=inst._get("onSelect");if(onSelect){onSelect.apply((inst._input?inst._input[0]:null),[dateStr,inst]);}else{if(inst._input){inst._input.trigger("change")}}if(inst._inline){this._updateDatepicker(inst);}else{if(!this._stayOpen){this._hideDatepicker(null,inst._get("speed"));this._lastInput=inst._input[0];if(typeof (inst._input[0])!="object"){inst._input[0].focus();}this._lastInput=null;}}},noWeekends:function(date){var day=date.getDay();return[(day>0&&day<6),""];},iso8601Week:function(date){var checkDate=new Date(date.getFullYear(),date.getMonth(),date.getDate(),(date.getTimezoneOffset()/-60));var firstMon=new Date(checkDate.getFullYear(),1-1,4);var firstDay=firstMon.getDay()||7;firstMon.setDate(firstMon.getDate()+1-firstDay);if(firstDay<4&&checkDate<firstMon){checkDate.setDate(checkDate.getDate()-3);return $.datepicker.iso8601Week(checkDate);}else{if(checkDate>new Date(checkDate.getFullYear(),12-1,28)){firstDay=new Date(checkDate.getFullYear()+1,1-1,4).getDay()||7;if(firstDay>4&&(checkDate.getDay()||7)<firstDay-3){checkDate.setDate(checkDate.getDate()+3);return $.datepicker.iso8601Week(checkDate)}}}return Math.floor(((checkDate-firstMon)/86400000)/7)+1},dateStatus:function(date,inst){return $.datepicker.formatDate(inst._get("dateStatus"),date,inst._getFormatConfig())},parseDate:function(format,value,settings){if(format==null||value==null){throw"Invalid arguments"}value=(typeof value=="object"?value.toString():value+"");if(value==""){return null;}var shortYearCutoff=(settings?settings.shortYearCutoff:null)||this._defaults.shortYearCutoff;var dayNamesShort=(settings?settings.dayNamesShort:null)||this._defaults.dayNamesShort;var dayNames=(settings?settings.dayNames:null)||this._defaults.dayNames;var monthNamesShort=(settings?settings.monthNamesShort:null)||this._defaults.monthNamesShort;var monthNames=(settings?settings.monthNames:null)||this._defaults.monthNames;var year=-1;var month=-1;var day=-1;var literal=false;var lookAhead=function(match){var matches=(iFormat+1<format.length&&format.charAt(iFormat+1)==match);if(matches){iFormat++}return matches};var getNumber=function(match){lookAhead(match);var size=(match=="y"?4:2);var num=0;while(size>0&&iValue<value.length&&value.charAt(iValue)>="0"&&value.charAt(iValue)<="9"){num=num*10+(value.charAt(iValue++)-0);size--}if(size==(match=="y"?4:2)){throw"Missing number at position "+iValue}return num};var getName=function(match,shortNames,longNames){var names=(lookAhead(match)?longNames:shortNames);var size=0;for(var j=0;j<names.length;j++){size=Math.max(size,names[j].length);}var name="";var iInit=iValue;while(size>0&&iValue<value.length){name+=value.charAt(iValue++);for(var i=0;i<names.length;i++){if(name==names[i]){return i+1}}size--}throw"Unknown name at position "+iInit;};var checkLiteral=function(){if(value.charAt(iValue)!=format.charAt(iFormat)){throw"Unexpected literal at position "+iValue;}iValue++;};var iValue=0;for(var iFormat=0;iFormat<format.length;iFormat++){if(literal){if(format.charAt(iFormat)=="'"&&!lookAhead("'")){literal=false;}else{checkLiteral();}}else{switch(format.charAt(iFormat)){case"d":day=getNumber("d");break;case"D":getName("D",dayNamesShort,dayNames);break;case"m":month=getNumber("m");break;case"M":month=getName("M",monthNamesShort,monthNames);break;case"y":year=getNumber("y");break;case"'":if(lookAhead("'")){checkLiteral();}else{literal=true;}break;default:checkLiteral();}}}if(year<100){year+=new Date().getFullYear()-new Date().getFullYear()%100+(year<=shortYearCutoff?0:-100);}var date=new Date(year,month-1,day);if(date.getFullYear()!=year||date.getMonth()+1!=month||date.getDate()!=day){throw"Invalid date"}return date;},formatDate:function(format,date,settings){if(!date){return""}var dayNamesShort=(settings?settings.dayNamesShort:null)||this._defaults.dayNamesShort;var dayNames=(settings?settings.dayNames:null)||this._defaults.dayNames;var monthNamesShort=(settings?settings.monthNamesShort:null)||this._defaults.monthNamesShort;var monthNames=(settings?settings.monthNames:null)||this._defaults.monthNames;var lookAhead=function(match){var matches=(iFormat+1<format.length&&format.charAt(iFormat+1)==match);if(matches){iFormat++;}return matches;};var formatNumber=function(match,value){return(lookAhead(match)&&value<10?"0":"")+value;};var formatName=function(match,value,shortNames,longNames){return(lookAhead(match)?longNames[value]:shortNames[value])};var output="";var literal=false;if(date){for(var iFormat=0;iFormat<format.length;iFormat++){if(literal){if(format.charAt(iFormat)=="'"&&!lookAhead("'")){literal=false;}else{output+=format.charAt(iFormat)}}else{switch(format.charAt(iFormat)){case"d":output+=formatNumber("d",date.getDate());break;case"D":output+=formatName("D",date.getDay(),dayNamesShort,dayNames);break;case"m":output+=formatNumber("m",date.getMonth()+1);break;case"M":output+=formatName("M",date.getMonth(),monthNamesShort,monthNames);break;case"y":output+=(lookAhead("y")?date.getFullYear():(date.getYear()%100<10?"0":"")+date.getYear()%100);break;case"'":if(lookAhead("'")){output+="'"}else{literal=true}break;default:output+=format.charAt(iFormat)}}}}return output;},_possibleChars:function(format){var chars="";var literal=false;for(var iFormat=0;iFormat<format.length;iFormat++){if(literal){if(format.charAt(iFormat)=="'"&&!lookAhead("'")){literal=false;}else{chars+=format.charAt(iFormat)}}else{switch(format.charAt(iFormat)){case"d"||"m"||"y":chars+="0123456789";break;case"D"||"M":return null;case"'":if(lookAhead("'")){chars+="'"}else{literal=true}break;default:chars+=format.charAt(iFormat)}}}return chars}});function DatepickerInstance(settings,inline){this._id=$.datepicker._register(this);this._selectedDay=0;this._selectedMonth=0;this._selectedYear=0;this._drawMonth=0;this._drawYear=0;this._input=null;this._inline=inline;this._datepickerDiv=(!inline?$.datepicker._datepickerDiv:$('<div id="ui-datepicker-div-'+this._id+'" class="ui-datepicker-inline">'));this._settings=extendRemove(settings||{});if(inline){this._setDate(this._getDefaultDate());}}$.extend(DatepickerInstance.prototype,{_get:function(name){return this._settings[name]!==undefined?this._settings[name]:$.datepicker._defaults[name];},_setDateFromField:function(input){this._input=$(input);var dateFormat=this._get("dateFormat");var dates=this._input?this._input.val().split(this._get("rangeSeparator")):null;this._endDay=this._endMonth=this._endYear=null;var date=defaultDate=this._getDefaultDate();if(dates.length>0){var settings=this._getFormatConfig();if(dates.length>1){date=$.datepicker.parseDate(dateFormat,dates[1],settings)||defaultDate;this._endDay=date.getDate();this._endMonth=date.getMonth();this._endYear=date.getFullYear();}try{date=$.datepicker.parseDate(dateFormat,dates[0],settings)||defaultDate}catch(e){$.datepicker.log(e);date=defaultDate;}}this._selectedDay=date.getDate();this._drawMonth=this._selectedMonth=date.getMonth();this._drawYear=this._selectedYear=date.getFullYear();this._currentDay=(dates[0]?date.getDate():0);this._currentMonth=(dates[0]?date.getMonth():0);this._currentYear=(dates[0]?date.getFullYear():0);this._adjustDate();},_getDefaultDate:function(){var date=this._determineDate("defaultDate",new Date());var minDate=this._getMinMaxDate("min",true);var maxDate=this._getMinMaxDate("max");date=(minDate&&date<minDate?minDate:date);date=(maxDate&&date>maxDate?maxDate:date);return date;},_determineDate:function(name,defaultDate){var offsetNumeric=function(offset){var date=new Date();date.setDate(date.getDate()+offset);return date};var offsetString=function(offset,getDaysInMonth){var date=new Date();var matches=/^([+-]?[0-9]+)\s*(d|D|w|W|m|M|y|Y)?$/.exec(offset);if(matches){var year=date.getFullYear();var month=date.getMonth();var day=date.getDate();switch(matches[2]||"d"){case"d":case"D":day+=(matches[1]-0);break;case"w":case"W":day+=(matches[1]*7);break;case"m":case"M":month+=(matches[1]-0);day=Math.min(day,getDaysInMonth(year,month));break;case"y":case"Y":year+=(matches[1]-0);day=Math.min(day,getDaysInMonth(year,month));break;}date=new Date(year,month,day);}return date};var date=this._get(name);return(date==null?defaultDate:(typeof date=="string"?offsetString(date,this._getDaysInMonth):(typeof date=="number"?offsetNumeric(date):date)))},_setDate:function(date,endDate){this._selectedDay=this._currentDay=date.getDate();this._drawMonth=this._selectedMonth=this._currentMonth=date.getMonth();this._drawYear=this._selectedYear=this._currentYear=date.getFullYear();if(this._get("rangeSelect")){if(endDate){this._endDay=endDate.getDate();this._endMonth=endDate.getMonth();this._endYear=endDate.getFullYear();}else{this._endDay=this._currentDay;this._endMonth=this._currentMonth;this._endYear=this._currentYear}}this._adjustDate();},_getDate:function(){var startDate=(!this._currentYear||(this._input&&this._input.val()=="")?null:new Date(this._currentYear,this._currentMonth,this._currentDay));if(this._get("rangeSelect")){return[startDate,(!this._endYear?null:new Date(this._endYear,this._endMonth,this._endDay))]}else{return startDate}},_generateDatepicker:function(){var today=new Date();today=new Date(today.getFullYear(),today.getMonth(),today.getDate());var showStatus=this._get("showStatus");var isRTL=this._get("isRTL");var clear=(this._get("mandatory")?"":'<div class="ui-datepicker-clear"><a onclick="jQuery.datepicker._clearDate('+this._id+');"'+(showStatus?this._addStatus(this._get("clearStatus")||" "):"")+">"+this._get("clearText")+"</a></div>");var controls='<div class="ui-datepicker-control">'+(isRTL?"":clear)+'<div class="ui-datepicker-close"><a onclick="jQuery.datepicker._hideDatepicker();"'+(showStatus?this._addStatus(this._get("closeStatus")||" "):"")+">"+this._get("closeText")+"</a></div>"+(isRTL?clear:"")+"</div>";var prompt=this._get("prompt");var closeAtTop=this._get("closeAtTop");var hideIfNoPrevNext=this._get("hideIfNoPrevNext");var numMonths=this._getNumberOfMonths();var stepMonths=this._get("stepMonths");var isMultiMonth=(numMonths[0]!=1||numMonths[1]!=1);var minDate=this._getMinMaxDate("min",true);var maxDate=this._getMinMaxDate("max");var drawMonth=this._drawMonth;var drawYear=this._drawYear;if(maxDate){var maxDraw=new Date(maxDate.getFullYear(),maxDate.getMonth()-numMonths[1]+1,maxDate.getDate());maxDraw=(minDate&&maxDraw<minDate?minDate:maxDraw);while(new Date(drawYear,drawMonth,1)>maxDraw){drawMonth--;if(drawMonth<0){drawMonth=11;drawYear--}}}var prev='<div class="ui-datepicker-prev">'+(this._canAdjustMonth(-1,drawYear,drawMonth)?'<a onclick="jQuery.datepicker._adjustDate('+this._id+", -"+stepMonths+", 'M');\""+(showStatus?this._addStatus(this._get("prevStatus")||" "):"")+">"+this._get("prevText")+"</a>":(hideIfNoPrevNext?"":"<label>"+this._get("prevText")+"</label>"))+"</div>";var next='<div class="ui-datepicker-next">'+(this._canAdjustMonth(+1,drawYear,drawMonth)?'<a onclick="jQuery.datepicker._adjustDate('+this._id+", +"+stepMonths+", 'M');\""+(showStatus?this._addStatus(this._get("nextStatus")||" "):"")+">"+this._get("nextText")+"</a>":(hideIfNoPrevNext?">":"<label>"+this._get("nextText")+"</label>"))+"</div>";var html=(prompt?'<div class="ui-datepicker-prompt">'+prompt+"</div>":"")+(closeAtTop&&!this._inline?controls:"")+'<div class="ui-datepicker-links">'+(isRTL?next:prev)+(this._isInRange(today)?'<div class="ui-datepicker-current"><a onclick="jQuery.datepicker._gotoToday('+this._id+');"'+(showStatus?this._addStatus(this._get("currentStatus")||" "):"")+">"+this._get("currentText")+"</a></div>":"")+(isRTL?prev:next)+"</div>";var showWeeks=this._get("showWeeks");for(var row=0;row<numMonths[0];row++){for(var col=0;col<numMonths[1];col++){var selectedDate=new Date(drawYear,drawMonth,this._selectedDay);html+='<div class="ui-datepicker-one-month'+(col==0?" ui-datepicker-new-row":"")+'">'+this._generateMonthYearHeader(drawMonth,drawYear,minDate,maxDate,selectedDate,row>0||col>0)+'<table class="ui-datepicker" cellpadding="0" cellspacing="0"><thead><tr class="ui-datepicker-title-row">'+(showWeeks?"<td>"+this._get("weekHeader")+"</td>":"");var firstDay=this._get("firstDay");var changeFirstDay=this._get("changeFirstDay");var dayNames=this._get("dayNames");var dayNamesShort=this._get("dayNamesShort");var dayNamesMin=this._get("dayNamesMin");for(var dow=0;dow<7;dow++){var day=(dow+firstDay)%7;var status=this._get("dayStatus")||" ";status=(status.indexOf("DD")>-1?status.replace(/DD/,dayNames[day]):status.replace(/D/,dayNamesShort[day]));html+="<td"+((dow+firstDay+6)%7>=5?' class="ui-datepicker-week-end-cell"':"")+">"+(!changeFirstDay?"<span":'<a onclick="jQuery.datepicker._changeFirstDay('+this._id+", "+day+');"')+(showStatus?this._addStatus(status):"")+' title="'+dayNames[day]+'">'+dayNamesMin[day]+(changeFirstDay?"</a>":"</span>")+"</td>";}html+="</tr></thead><tbody>";var daysInMonth=this._getDaysInMonth(drawYear,drawMonth);if(drawYear==this._selectedYear&&drawMonth==this._selectedMonth){this._selectedDay=Math.min(this._selectedDay,daysInMonth);}var leadDays=(this._getFirstDayOfMonth(drawYear,drawMonth)-firstDay+7)%7;var currentDate=(!this._currentDay?new Date(9999,9,9):new Date(this._currentYear,this._currentMonth,this._currentDay));var endDate=this._endDay?new Date(this._endYear,this._endMonth,this._endDay):currentDate;var printDate=new Date(drawYear,drawMonth,1-leadDays);var numRows=(isMultiMonth?6:Math.ceil((leadDays+daysInMonth)/7));var beforeShowDay=this._get("beforeShowDay");var showOtherMonths=this._get("showOtherMonths");var calculateWeek=this._get("calculateWeek")||$.datepicker.iso8601Week;var dateStatus=this._get("statusForDate")||$.datepicker.dateStatus;for(var dRow=0;dRow<numRows;dRow++){html+='<tr class="ui-datepicker-days-row">'+(showWeeks?'<td class="ui-datepicker-week-col">'+calculateWeek(printDate)+"</td>":"");for(var dow=0;dow<7;dow++){var daySettings=(beforeShowDay?beforeShowDay.apply((this._input?this._input[0]:null),[printDate]):[true,""]);var otherMonth=(printDate.getMonth()!=drawMonth);var unselectable=otherMonth||!daySettings[0]||(minDate&&printDate<minDate)||(maxDate&&printDate>maxDate);html+='<td class="ui-datepicker-days-cell'+((dow+firstDay+6)%7>=5?" ui-datepicker-week-end-cell":"")+(otherMonth?" ui-datepicker-otherMonth":"")+(printDate.getTime()==selectedDate.getTime()&&drawMonth==this._selectedMonth?" ui-datepicker-days-cell-over":"")+(unselectable?" ui-datepicker-unselectable":"")+(otherMonth&&!showOtherMonths?"":" "+daySettings[1]+(printDate.getTime()>=currentDate.getTime()&&printDate.getTime()<=endDate.getTime()?" ui-datepicker-current-day":"")+(printDate.getTime()==today.getTime()?" ui-datepicker-today":""))+'"'+(unselectable?"":" onmouseover=\"jQuery(this).addClass('ui-datepicker-days-cell-over');"+(!showStatus||(otherMonth&&!showOtherMonths)?"":"jQuery('#ui-datepicker-status-"+this._id+"').html('"+(dateStatus.apply((this._input?this._input[0]:null),[printDate,this])||" ")+"');")+"\" onmouseout=\"jQuery(this).removeClass('ui-datepicker-days-cell-over');"+(!showStatus||(otherMonth&&!showOtherMonths)?"":"jQuery('#ui-datepicker-status-"+this._id+"').html(' ');")+'" onclick="jQuery.datepicker._selectDay('+this._id+","+drawMonth+","+drawYear+', this);"')+">"+(otherMonth?(showOtherMonths?printDate.getDate():" "):(unselectable?printDate.getDate():"<a>"+printDate.getDate()+"</a>"))+"</td>";printDate.setDate(printDate.getDate()+1)}html+="</tr>";}drawMonth++;if(drawMonth>11){drawMonth=0;drawYear++;}html+="</tbody></table></div>"}}html+=(showStatus?'<div style="clear: both;"></div><div id="ui-datepicker-status-'+this._id+'" class="ui-datepicker-status">'+(this._get("initStatus")||" ")+"</div>":"")+(!closeAtTop&&!this._inline?controls:"")+'<div style="clear: both;"></div>'+($.browser.msie&&parseInt($.browser.version)<7&&!this._inline?'<iframe src="javascript:false;" class="ui-datepicker-cover"></iframe>':"");return html;},_generateMonthYearHeader:function(drawMonth,drawYear,minDate,maxDate,selectedDate,secondary){minDate=(this._rangeStart&&minDate&&selectedDate<minDate?selectedDate:minDate);var showStatus=this._get("showStatus");var html='<div class="ui-datepicker-header">';var monthNames=this._get("monthNames");if(secondary||!this._get("changeMonth")){html+=monthNames[drawMonth]+" "}else{var inMinYear=(minDate&&minDate.getFullYear()==drawYear);var inMaxYear=(maxDate&&maxDate.getFullYear()==drawYear);html+='<select class="ui-datepicker-new-month" onchange="jQuery.datepicker._selectMonthYear('+this._id+", this, 'M');\" onclick=\"jQuery.datepicker._clickMonthYear("+this._id+');"'+(showStatus?this._addStatus(this._get("monthStatus")||" "):"")+">";for(var month=0;month<12;month++){if((!inMinYear||month>=minDate.getMonth())&&(!inMaxYear||month<=maxDate.getMonth())){html+='<option value="'+month+'"'+(month==drawMonth?' selected="selected"':"")+">"+monthNames[month]+"</option>"}}html+="</select>";}if(secondary||!this._get("changeYear")){html+=drawYear;}else{var years=this._get("yearRange").split(":");var year=0;var endYear=0;if(years.length!=2){year=drawYear-10;endYear=drawYear+10;}else{if(years[0].charAt(0)=="+"||years[0].charAt(0)=="-"){year=new Date().getFullYear()+parseInt(years[0],10);endYear=new Date().getFullYear()+parseInt(years[1],10);}else{year=parseInt(years[0],10);endYear=parseInt(years[1],10)}}year=(minDate?Math.max(year,minDate.getFullYear()):year);endYear=(maxDate?Math.min(endYear,maxDate.getFullYear()):endYear);html+='<select class="ui-datepicker-new-year" onchange="jQuery.datepicker._selectMonthYear('+this._id+", this, 'Y');\" onclick=\"jQuery.datepicker._clickMonthYear("+this._id+');"'+(showStatus?this._addStatus(this._get("yearStatus")||" "):"")+">";for(;year<=endYear;year++){html+='<option value="'+year+'"'+(year==drawYear?' selected="selected"':"")+">"+year+"</option>"}html+="</select>"}html+="</div>";return html},_addStatus:function(text){return" onmouseover=\"jQuery('#ui-datepicker-status-"+this._id+"').html('"+text+"');\" onmouseout=\"jQuery('#ui-datepicker-status-"+this._id+"').html(' ');\"";},_adjustDate:function(offset,period){var year=this._drawYear+(period=="Y"?offset:0);var month=this._drawMonth+(period=="M"?offset:0);var day=Math.min(this._selectedDay,this._getDaysInMonth(year,month))+(period=="D"?offset:0);var date=new Date(year,month,day);var minDate=this._getMinMaxDate("min",true);var maxDate=this._getMinMaxDate("max");date=(minDate&&date<minDate?minDate:date);date=(maxDate&&date>maxDate?maxDate:date);this._selectedDay=date.getDate();this._drawMonth=this._selectedMonth=date.getMonth();this._drawYear=this._selectedYear=date.getFullYear();},_getNumberOfMonths:function(){var numMonths=this._get("numberOfMonths");return(numMonths==null?[1,1]:(typeof numMonths=="number"?[1,numMonths]:numMonths));},_getMinMaxDate:function(minMax,checkRange){var date=this._determineDate(minMax+"Date",null);if(date){date.setHours(0);date.setMinutes(0);date.setSeconds(0);date.setMilliseconds(0);}return date||(checkRange?this._rangeStart:null);},_getDaysInMonth:function(year,month){return 32-new Date(year,month,32).getDate();},_getFirstDayOfMonth:function(year,month){return new Date(year,month,1).getDay()},_canAdjustMonth:function(offset,curYear,curMonth){var numMonths=this._getNumberOfMonths();var date=new Date(curYear,curMonth+(offset<0?offset:numMonths[1]),1);if(offset<0){date.setDate(this._getDaysInMonth(date.getFullYear(),date.getMonth()))}return this._isInRange(date)},_isInRange:function(date){var newMinDate=(!this._rangeStart?null:new Date(this._selectedYear,this._selectedMonth,this._selectedDay));newMinDate=(newMinDate&&this._rangeStart<newMinDate?this._rangeStart:newMinDate);var minDate=newMinDate||this._getMinMaxDate("min");var maxDate=this._getMinMaxDate("max");return((!minDate||date>=minDate)&&(!maxDate||date<=maxDate))},_getFormatConfig:function(){var shortYearCutoff=this._get("shortYearCutoff");shortYearCutoff=(typeof shortYearCutoff!="string"?shortYearCutoff:new Date().getFullYear()%100+parseInt(shortYearCutoff,10));return{shortYearCutoff:shortYearCutoff,dayNamesShort:this._get("dayNamesShort"),dayNames:this._get("dayNames"),monthNamesShort:this._get("monthNamesShort"),monthNames:this._get("monthNames")};},_formatDate:function(day,month,year){if(!day){this._currentDay=this._selectedDay;this._currentMonth=this._selectedMonth;this._currentYear=this._selectedYear}var date=(day?(typeof day=="object"?day:new Date(year,month,day)):new Date(this._currentYear,this._currentMonth,this._currentDay));return $.datepicker.formatDate(this._get("dateFormat"),date,this._getFormatConfig());}});function extendRemove(target,props){$.extend(target,props);for(var name in props){if(props[name]==null){target[name]=null;}}return target;}$.fn.datepicker=function(options){var otherArgs=Array.prototype.slice.call(arguments,1);if(typeof options=="string"&&(options=="isDisabled"||options=="getDate")){return $.datepicker["_"+options+"Datepicker"].apply($.datepicker,[this[0]].concat(otherArgs))}return this.each(function(){typeof options=="string"?$.datepicker["_"+options+"Datepicker"].apply($.datepicker,[this].concat(otherArgs)):$.datepicker._attachDatepicker(this,options)})};$.datepicker=new Datepicker();$(document).ready(function(){$(document.body).append($.datepicker._datepickerDiv).mousedown($.datepicker._checkExternalClick);})})(jQuery) diff --git a/pandora_console/include/javascript/jquery.ui.dialog.js b/pandora_console/include/javascript/jquery.ui.dialog.js index 35742f170f..177045b5af 100644 --- a/pandora_console/include/javascript/jquery.ui.dialog.js +++ b/pandora_console/include/javascript/jquery.ui.dialog.js @@ -1 +1 @@ -(function(B){var A={dragStart:"start.draggable",drag:"drag.draggable",dragStop:"stop.draggable",maxHeight:"maxHeight.resizable",minHeight:"minHeight.resizable",maxWidth:"maxWidth.resizable",minWidth:"minWidth.resizable",resizeStart:"start.resizable",resize:"drag.resizable",resizeStop:"stop.resizable"};B.widget("ui.dialog",{init:function(){var J=this,K=this.options,D=typeof K.resizable=="string"?K.resizable:"n,e,s,w,se,sw,ne,nw",E=this.element.addClass("ui-dialog-content").wrap("<div/>").wrap("<div/>"),G=(this.uiDialogContainer=E.parent().addClass("ui-dialog-container").css({position:"relative",width:"100%",height:"100%"})),H=K.title||E.attr("title")||"",C=(this.uiDialogTitlebar=B('<div class="ui-dialog-titlebar"/>')).append('<span class="ui-dialog-title">'+H+"</span>").append('<a href="#" class="ui-dialog-titlebar-close"><span>X</span></a>').prependTo(G),I=(this.uiDialog=G.parent()).appendTo(document.body).hide().addClass("ui-dialog").addClass(K.dialogClass).addClass(E.attr("className")).removeClass("ui-dialog-content").css({position:"absolute",width:K.width,height:K.height,overflow:"hidden",zIndex:K.zIndex}).attr("tabIndex",-1).css("outline",0).keydown(function(L){if(K.closeOnEscape){var M=27;(L.keyCode&&L.keyCode==M&&J.close())}}).mousedown(function(){J.moveToTop()}),F=(this.uiDialogButtonPane=B("<div/>")).addClass("ui-dialog-buttonpane").css({position:"absolute",bottom:0}).appendTo(I);this.uiDialogTitlebarClose=B(".ui-dialog-titlebar-close",C).hover(function(){B(this).addClass("ui-dialog-titlebar-close-hover")},function(){B(this).removeClass("ui-dialog-titlebar-close-hover")}).mousedown(function(L){L.stopPropagation()}).click(function(){J.close();return false});this.uiDialogTitlebar.find("*").add(this.uiDialogTitlebar).each(function(){B.ui.disableSelection(this)});if(B.fn.draggable){I.draggable({cancel:".ui-dialog-content",helper:K.dragHelper,handle:".ui-dialog-titlebar",start:function(M,L){J.moveToTop();(K.dragStart&&K.dragStart.apply(J.element[0],arguments))},drag:function(M,L){(K.drag&&K.drag.apply(J.element[0],arguments))},stop:function(M,L){(K.dragStop&&K.dragStop.apply(J.element[0],arguments));B.ui.dialog.overlay.resize()}});(K.draggable||I.draggable("disable"))}if(B.fn.resizable){I.resizable({cancel:".ui-dialog-content",helper:K.resizeHelper,maxWidth:K.maxWidth,maxHeight:K.maxHeight,minWidth:K.minWidth,minHeight:K.minHeight,start:function(){(K.resizeStart&&K.resizeStart.apply(J.element[0],arguments))},resize:function(M,L){(K.autoResize&&J.size.apply(J));(K.resize&&K.resize.apply(J.element[0],arguments))},handles:D,stop:function(M,L){(K.autoResize&&J.size.apply(J));(K.resizeStop&&K.resizeStop.apply(J.element[0],arguments));B.ui.dialog.overlay.resize()}});(K.resizable||I.resizable("disable"))}this.createButtons(K.buttons);this.isOpen=false;(K.bgiframe&&B.fn.bgiframe&&I.bgiframe());(K.autoOpen&&this.open())},setData:function(C,D){(A[C]&&this.uiDialog.data(A[C],D));switch(C){case"buttons":this.createButtons(D);break;case"draggable":this.uiDialog.draggable(D?"enable":"disable");break;case"height":this.uiDialog.height(D);break;case"position":this.position(D);break;case"resizable":(typeof D=="string"&&this.uiDialog.data("handles.resizable",D));this.uiDialog.resizable(D?"enable":"disable");break;case"title":B(".ui-dialog-title",this.uiDialogTitlebar).text(D);break;case"width":this.uiDialog.width(D);break}B.widget.prototype.setData.apply(this,arguments)},position:function(H){var D=B(window),E=B(document),F=E.scrollTop(),C=E.scrollLeft(),G=F;if(B.inArray(H,["center","top","right","bottom","left"])>=0){H=[H=="right"||H=="left"?H:"center",H=="top"||H=="bottom"?H:"middle"]}if(H.constructor!=Array){H=["center","middle"]}if(H[0].constructor==Number){C+=H[0]}else{switch(H[0]){case"left":C+=0;break;case"right":C+=D.width()-this.uiDialog.width();break;default:case"center":C+=(D.width()-this.uiDialog.width())/2}}if(H[1].constructor==Number){F+=H[1]}else{switch(H[1]){case"top":F+=0;break;case"bottom":F+=D.height()-this.uiDialog.height();break;default:case"middle":F+=(D.height()-this.uiDialog.height())/2}}F=Math.max(F,G);this.uiDialog.css({top:F,left:C})},size:function(){var D=this.uiDialogContainer,G=this.uiDialogTitlebar,E=this.element,F=parseInt(E.css("margin-top"),10)+parseInt(E.css("margin-bottom"),10),C=parseInt(E.css("margin-left"),10)+parseInt(E.css("margin-right"),10);E.height(D.height()-G.outerHeight()-F);E.width(D.width()-C)},open:function(){if(this.isOpen){return }this.overlay=this.options.modal?new B.ui.dialog.overlay(this):null;(this.uiDialog.next().length>0)&&this.uiDialog.appendTo("body");this.position(this.options.position);this.uiDialog.show(this.options.show);this.options.autoResize&&this.size();this.moveToTop(true);var C=null;var D={options:this.options};this.uiDialogTitlebarClose.focus();this.element.triggerHandler("dialogopen",[C,D],this.options.open);this.isOpen=true},moveToTop:function(E){if((this.options.modal&&!E)||(!this.options.stack&&!this.options.modal)){return this.element.triggerHandler("dialogfocus",[null,{options:this.options}],this.options.focus)}var D=this.options.zIndex,C=this.options;B(".ui-dialog:visible").each(function(){D=Math.max(D,parseInt(B(this).css("z-index"),10)||C.zIndex)});(this.overlay&&this.overlay.$el.css("z-index",++D));this.uiDialog.css("z-index",++D);this.element.triggerHandler("dialogfocus",[null,{options:this.options}],this.options.focus)},close:function(){(this.overlay&&this.overlay.destroy());this.uiDialog.hide(this.options.hide);var D=null;var C={options:this.options};this.element.triggerHandler("dialogclose",[D,C],this.options.close);B.ui.dialog.overlay.resize();this.isOpen=false},destroy:function(){(this.overlay&&this.overlay.destroy());this.uiDialog.hide();this.element.unbind(".dialog").removeData("dialog").removeClass("ui-dialog-content").hide().appendTo("body");this.uiDialog.remove()},createButtons:function(F){var E=this,C=false,D=this.uiDialogButtonPane;D.empty().hide();B.each(F,function(){return !(C=true)});if(C){D.show();B.each(F,function(G,H){B("<button/>").text(G).click(function(){H.apply(E.element[0],arguments)}).appendTo(D)})}}});B.extend(B.ui.dialog,{defaults:{autoOpen:true,autoResize:true,bgiframe:false,buttons:{},closeOnEscape:true,draggable:true,height:200,minHeight:100,minWidth:150,modal:false,overlay:{},position:"center",resizable:true,stack:true,width:300,zIndex:1000},overlay:function(C){this.$el=B.ui.dialog.overlay.create(C)}});B.extend(B.ui.dialog.overlay,{instances:[],events:B.map("focus,mousedown,mouseup,keydown,keypress,click".split(","),function(C){return C+".dialog-overlay"}).join(" "),create:function(D){if(this.instances.length===0){setTimeout(function(){B("a, :input").bind(B.ui.dialog.overlay.events,function(){var F=false;var H=B(this).parents(".ui-dialog");if(H.length){var E=B(".ui-dialog-overlay");if(E.length){var G=parseInt(E.css("z-index"),10);E.each(function(){G=Math.max(G,parseInt(B(this).css("z-index"),10))});F=parseInt(H.css("z-index"),10)>G}else{F=true}}return F})},1);B(document).bind("keydown.dialog-overlay",function(E){var F=27;(E.keyCode&&E.keyCode==F&&D.close())});B(window).bind("resize.dialog-overlay",B.ui.dialog.overlay.resize)}var C=B("<div/>").appendTo(document.body).addClass("ui-dialog-overlay").css(B.extend({borderWidth:0,margin:0,padding:0,position:"absolute",top:0,left:0,width:this.width(),height:this.height()},D.options.overlay));(D.options.bgiframe&&B.fn.bgiframe&&C.bgiframe());this.instances.push(C);return C},destroy:function(C){this.instances.splice(B.inArray(this.instances,C),1);if(this.instances.length===0){B("a, :input").add([document,window]).unbind(".dialog-overlay")}C.remove()},height:function(){if(B.browser.msie&&B.browser.version<7){var D=Math.max(document.documentElement.scrollHeight,document.body.scrollHeight);var C=Math.max(document.documentElement.offsetHeight,document.body.offsetHeight);if(D<C){return B(window).height()+"px"}else{return D+"px"}}else{return B(document).height()+"px"}},width:function(){if(B.browser.msie&&B.browser.version<7){var C=Math.max(document.documentElement.scrollWidth,document.body.scrollWidth);var D=Math.max(document.documentElement.offsetWidth,document.body.offsetWidth);if(C<D){return B(window).width()+"px"}else{return C+"px"}}else{return B(document).width()+"px"}},resize:function(){var C=B([]);B.each(B.ui.dialog.overlay.instances,function(){C=C.add(this)});C.css({width:0,height:0}).css({width:B.ui.dialog.overlay.width(),height:B.ui.dialog.overlay.height()})}});B.extend(B.ui.dialog.overlay.prototype,{destroy:function(){B.ui.dialog.overlay.destroy(this.$el)}})})(jQuery) \ No newline at end of file +(function(B){var A={dragStart:"start.draggable",drag:"drag.draggable",dragStop:"stop.draggable",maxHeight:"maxHeight.resizable",minHeight:"minHeight.resizable",maxWidth:"maxWidth.resizable",minWidth:"minWidth.resizable",resizeStart:"start.resizable",resize:"drag.resizable",resizeStop:"stop.resizable"};B.widget("ui.dialog",{init:function(){var J=this,K=this.options,D=typeof K.resizable=="string"?K.resizable:"n,e,s,w,se,sw,ne,nw",E=this.element.addClass("ui-dialog-content").wrap("<div/>").wrap("<div/>"),G=(this.uiDialogContainer=E.parent().addClass("ui-dialog-container").css({position:"relative",width:"100%",height:"100%"})),H=K.title||E.attr("title")||"",C=(this.uiDialogTitlebar=B('<div class="ui-dialog-titlebar"/>')).append('<span class="ui-dialog-title">'+H+"</span>").append('<a href="#" class="ui-dialog-titlebar-close"><span>X</span></a>').prependTo(G),I=(this.uiDialog=G.parent()).appendTo(document.body).hide().addClass("ui-dialog").addClass(K.dialogClass).addClass(E.attr("className")).removeClass("ui-dialog-content").css({position:"absolute",width:K.width,height:K.height,overflow:"hidden",zIndex:K.zIndex}).attr("tabIndex",-1).css("outline",0).keydown(function(L){if(K.closeOnEscape){var M=27;(L.keyCode&&L.keyCode==M&&J.close());}}).mousedown(function(){J.moveToTop();}),F=(this.uiDialogButtonPane=B("<div/>")).addClass("ui-dialog-buttonpane").css({position:"absolute",bottom:0}).appendTo(I);this.uiDialogTitlebarClose=B(".ui-dialog-titlebar-close",C).hover(function(){B(this).addClass("ui-dialog-titlebar-close-hover");},function(){B(this).removeClass("ui-dialog-titlebar-close-hover");}).mousedown(function(L){L.stopPropagation();}).click(function(){J.close();return false;});this.uiDialogTitlebar.find("*").add(this.uiDialogTitlebar).each(function(){B.ui.disableSelection(this);});if(B.fn.draggable){I.draggable({cancel:".ui-dialog-content",helper:K.dragHelper,handle:".ui-dialog-titlebar",start:function(M,L){J.moveToTop();(K.dragStart&&K.dragStart.apply(J.element[0],arguments));},drag:function(M,L){(K.drag&&K.drag.apply(J.element[0],arguments));},stop:function(M,L){(K.dragStop&&K.dragStop.apply(J.element[0],arguments));B.ui.dialog.overlay.resize();}});(K.draggable||I.draggable("disable"));}if(B.fn.resizable){I.resizable({cancel:".ui-dialog-content",helper:K.resizeHelper,maxWidth:K.maxWidth,maxHeight:K.maxHeight,minWidth:K.minWidth,minHeight:K.minHeight,start:function(){(K.resizeStart&&K.resizeStart.apply(J.element[0],arguments));},resize:function(M,L){(K.autoResize&&J.size.apply(J));(K.resize&&K.resize.apply(J.element[0],arguments));},handles:D,stop:function(M,L){(K.autoResize&&J.size.apply(J));(K.resizeStop&&K.resizeStop.apply(J.element[0],arguments));B.ui.dialog.overlay.resize();}});(K.resizable||I.resizable("disable"));}this.createButtons(K.buttons);this.isOpen=false;(K.bgiframe&&B.fn.bgiframe&&I.bgiframe());(K.autoOpen&&this.open());},setData:function(C,D){(A[C]&&this.uiDialog.data(A[C],D));switch(C){case"buttons":this.createButtons(D);break;case"draggable":this.uiDialog.draggable(D?"enable":"disable");break;case"height":this.uiDialog.height(D);break;case"position":this.position(D);break;case"resizable":(typeof D=="string"&&this.uiDialog.data("handles.resizable",D));this.uiDialog.resizable(D?"enable":"disable");break;case"title":B(".ui-dialog-title",this.uiDialogTitlebar).text(D);break;case"width":this.uiDialog.width(D);break;}B.widget.prototype.setData.apply(this,arguments);},position:function(H){var D=B(window),E=B(document),F=E.scrollTop(),C=E.scrollLeft(),G=F;if(B.inArray(H,["center","top","right","bottom","left"])>=0){H=[H=="right"||H=="left"?H:"center",H=="top"||H=="bottom"?H:"middle"];}if(H.constructor!=Array){H=["center","middle"];}if(H[0].constructor==Number){C+=H[0];}else{switch(H[0]){case"left":C+=0;break;case"right":C+=D.width()-this.uiDialog.width();break;default:case"center":C+=(D.width()-this.uiDialog.width())/2;}}if(H[1].constructor==Number){F+=H[1];}else{switch(H[1]){case"top":F+=0;break;case"bottom":F+=D.height()-this.uiDialog.height();break;default:case"middle":F+=(D.height()-this.uiDialog.height())/2;}}F=Math.max(F,G);this.uiDialog.css({top:F,left:C});},size:function(){var D=this.uiDialogContainer,G=this.uiDialogTitlebar,E=this.element,F=parseInt(E.css("margin-top"),10)+parseInt(E.css("margin-bottom"),10),C=parseInt(E.css("margin-left"),10)+parseInt(E.css("margin-right"),10);E.height(D.height()-G.outerHeight()-F);E.width(D.width()-C);},open:function(){if(this.isOpen){return;}this.overlay=this.options.modal?new B.ui.dialog.overlay(this):null;(this.uiDialog.next().length>0)&&this.uiDialog.appendTo("body");this.position(this.options.position);this.uiDialog.show(this.options.show);this.options.autoResize&&this.size();this.moveToTop(true);var C=null;var D={options:this.options};this.uiDialogTitlebarClose.focus();this.element.triggerHandler("dialogopen",[C,D],this.options.open);this.isOpen=true;},moveToTop:function(E){if((this.options.modal&&!E)||(!this.options.stack&&!this.options.modal)){return this.element.triggerHandler("dialogfocus",[null,{options:this.options}],this.options.focus);}var D=this.options.zIndex,C=this.options;B(".ui-dialog:visible").each(function(){D=Math.max(D,parseInt(B(this).css("z-index"),10)||C.zIndex);});(this.overlay&&this.overlay.$el.css("z-index",++D));this.uiDialog.css("z-index",++D);this.element.triggerHandler("dialogfocus",[null,{options:this.options}],this.options.focus);},close:function(){(this.overlay&&this.overlay.destroy());this.uiDialog.hide(this.options.hide);var D=null;var C={options:this.options};this.element.triggerHandler("dialogclose",[D,C],this.options.close);B.ui.dialog.overlay.resize();this.isOpen=false;},destroy:function(){(this.overlay&&this.overlay.destroy());this.uiDialog.hide();this.element.unbind(".dialog").removeData("dialog").removeClass("ui-dialog-content").hide().appendTo("body");this.uiDialog.remove();},createButtons:function(F){var E=this,C=false,D=this.uiDialogButtonPane;D.empty().hide();B.each(F,function(){return !(C=true);});if(C){D.show();B.each(F,function(G,H){B("<button/>").text(G).click(function(){H.apply(E.element[0],arguments);}).appendTo(D);});}}});B.extend(B.ui.dialog,{defaults:{autoOpen:true,autoResize:true,bgiframe:false,buttons:{},closeOnEscape:true,draggable:true,height:200,minHeight:100,minWidth:150,modal:false,overlay:{},position:"center",resizable:true,stack:true,width:300,zIndex:1000},overlay:function(C){this.$el=B.ui.dialog.overlay.create(C);}});B.extend(B.ui.dialog.overlay,{instances:[],events:B.map("focus,mousedown,mouseup,keydown,keypress,click".split(","),function(C){return C+".dialog-overlay";}).join(" "),create:function(D){if(this.instances.length===0){setTimeout(function(){B("a, :input").bind(B.ui.dialog.overlay.events,function(){var F=false;var H=B(this).parents(".ui-dialog");if(H.length){var E=B(".ui-dialog-overlay");if(E.length){var G=parseInt(E.css("z-index"),10);E.each(function(){G=Math.max(G,parseInt(B(this).css("z-index"),10));});F=parseInt(H.css("z-index"),10)>G;}else{F=true;}}return F;});},1);B(document).bind("keydown.dialog-overlay",function(E){var F=27;(E.keyCode&&E.keyCode==F&&D.close());});B(window).bind("resize.dialog-overlay",B.ui.dialog.overlay.resize);}var C=B("<div/>").appendTo(document.body).addClass("ui-dialog-overlay").css(B.extend({borderWidth:0,margin:0,padding:0,position:"absolute",top:0,left:0,width:this.width(),height:this.height()},D.options.overlay));(D.options.bgiframe&&B.fn.bgiframe&&C.bgiframe());this.instances.push(C);return C;},destroy:function(C){this.instances.splice(B.inArray(this.instances,C),1);if(this.instances.length===0){B("a, :input").add([document,window]).unbind(".dialog-overlay");}C.remove();},height:function(){if(B.browser.msie&&B.browser.version<7){var D=Math.max(document.documentElement.scrollHeight,document.body.scrollHeight);var C=Math.max(document.documentElement.offsetHeight,document.body.offsetHeight);if(D<C){return B(window).height()+"px";}else{return D+"px";}}else{return B(document).height()+"px";}},width:function(){if(B.browser.msie&&B.browser.version<7){var C=Math.max(document.documentElement.scrollWidth,document.body.scrollWidth);var D=Math.max(document.documentElement.offsetWidth,document.body.offsetWidth);if(C<D){return B(window).width()+"px";}else{return C+"px";}}else{return B(document).width()+"px";}},resize:function(){var C=B([]);B.each(B.ui.dialog.overlay.instances,function(){C=C.add(this);});C.css({width:0,height:0}).css({width:B.ui.dialog.overlay.width(),height:B.ui.dialog.overlay.height()});}});B.extend(B.ui.dialog.overlay.prototype,{destroy:function(){B.ui.dialog.overlay.destroy(this.$el);}});})(jQuery); \ No newline at end of file diff --git a/pandora_console/include/javascript/jquery.ui.draggable.js b/pandora_console/include/javascript/jquery.ui.draggable.js index 4ab9155646..8ea364dc8e 100644 --- a/pandora_console/include/javascript/jquery.ui.draggable.js +++ b/pandora_console/include/javascript/jquery.ui.draggable.js @@ -1 +1 @@ -(function(A){A.widget("ui.draggable",A.extend({},A.ui.mouse,{init:function(){var B=this.options;if(B.helper=="original"&&!(/(relative|absolute|fixed)/).test(this.element.css("position"))){this.element.css("position","relative")}this.element.addClass("ui-draggable");(B.disabled&&this.element.addClass("ui-draggable-disabled"));this.mouseInit()},mouseStart:function(F){var H=this.options;if(this.helper||H.disabled||A(F.target).is(".ui-resizable-handle")){return false}var C=!this.options.handle||!A(this.options.handle,this.element).length?true:false;A(this.options.handle,this.element).find("*").andSelf().each(function(){if(this==F.target){C=true}});if(!C){return false}if(A.ui.ddmanager){A.ui.ddmanager.current=this}this.helper=A.isFunction(H.helper)?A(H.helper.apply(this.element[0],[F])):(H.helper=="clone"?this.element.clone():this.element);if(!this.helper.parents("body").length){this.helper.appendTo((H.appendTo=="parent"?this.element[0].parentNode:H.appendTo))}if(this.helper[0]!=this.element[0]&&!(/(fixed|absolute)/).test(this.helper.css("position"))){this.helper.css("position","absolute")}this.margins={left:(parseInt(this.element.css("marginLeft"),10)||0),top:(parseInt(this.element.css("marginTop"),10)||0)};this.cssPosition=this.helper.css("position");this.offset=this.element.offset();this.offset={top:this.offset.top-this.margins.top,left:this.offset.left-this.margins.left};this.offset.click={left:F.pageX-this.offset.left,top:F.pageY-this.offset.top};this.offsetParent=this.helper.offsetParent();var B=this.offsetParent.offset();if(this.offsetParent[0]==document.body&&A.browser.mozilla){B={top:0,left:0}}this.offset.parent={top:B.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:B.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)};var E=this.element.position();this.offset.relative=this.cssPosition=="relative"?{top:E.top-(parseInt(this.helper.css("top"),10)||0)+this.offsetParent[0].scrollTop,left:E.left-(parseInt(this.helper.css("left"),10)||0)+this.offsetParent[0].scrollLeft}:{top:0,left:0};this.originalPosition=this.generatePosition(F);this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()};if(H.cursorAt){if(H.cursorAt.left!=undefined){this.offset.click.left=H.cursorAt.left+this.margins.left}if(H.cursorAt.right!=undefined){this.offset.click.left=this.helperProportions.width-H.cursorAt.right+this.margins.left}if(H.cursorAt.top!=undefined){this.offset.click.top=H.cursorAt.top+this.margins.top}if(H.cursorAt.bottom!=undefined){this.offset.click.top=this.helperProportions.height-H.cursorAt.bottom+this.margins.top}}if(H.containment){if(H.containment=="parent"){H.containment=this.helper[0].parentNode}if(H.containment=="document"||H.containment=="window"){this.containment=[0-this.offset.relative.left-this.offset.parent.left,0-this.offset.relative.top-this.offset.parent.top,A(H.containment=="document"?document:window).width()-this.offset.relative.left-this.offset.parent.left-this.helperProportions.width-this.margins.left-(parseInt(this.element.css("marginRight"),10)||0),(A(H.containment=="document"?document:window).height()||document.body.parentNode.scrollHeight)-this.offset.relative.top-this.offset.parent.top-this.helperProportions.height-this.margins.top-(parseInt(this.element.css("marginBottom"),10)||0)]}if(!(/^(document|window|parent)$/).test(H.containment)){var D=A(H.containment)[0];var G=A(H.containment).offset();this.containment=[G.left+(parseInt(A(D).css("borderLeftWidth"),10)||0)-this.offset.relative.left-this.offset.parent.left,G.top+(parseInt(A(D).css("borderTopWidth"),10)||0)-this.offset.relative.top-this.offset.parent.top,G.left+Math.max(D.scrollWidth,D.offsetWidth)-(parseInt(A(D).css("borderLeftWidth"),10)||0)-this.offset.relative.left-this.offset.parent.left-this.helperProportions.width-this.margins.left-(parseInt(this.element.css("marginRight"),10)||0),G.top+Math.max(D.scrollHeight,D.offsetHeight)-(parseInt(A(D).css("borderTopWidth"),10)||0)-this.offset.relative.top-this.offset.parent.top-this.helperProportions.height-this.margins.top-(parseInt(this.element.css("marginBottom"),10)||0)]}}this.propagate("start",F);this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()};if(A.ui.ddmanager&&!H.dropBehaviour){A.ui.ddmanager.prepareOffsets(this,F)}this.helper.addClass("ui-draggable-dragging");this.mouseDrag(F);return true},convertPositionTo:function(C,D){if(!D){D=this.position}var B=C=="absolute"?1:-1;return{top:(D.top+this.offset.relative.top*B+this.offset.parent.top*B-(this.cssPosition=="fixed"||(this.cssPosition=="absolute"&&this.offsetParent[0]==document.body)?0:this.offsetParent[0].scrollTop)*B+(this.cssPosition=="fixed"?A(document).scrollTop():0)*B+this.margins.top*B),left:(D.left+this.offset.relative.left*B+this.offset.parent.left*B-(this.cssPosition=="fixed"||(this.cssPosition=="absolute"&&this.offsetParent[0]==document.body)?0:this.offsetParent[0].scrollLeft)*B+(this.cssPosition=="fixed"?A(document).scrollLeft():0)*B+this.margins.left*B)}},generatePosition:function(E){var F=this.options;var B={top:(E.pageY-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+(this.cssPosition=="fixed"||(this.cssPosition=="absolute"&&this.offsetParent[0]==document.body)?0:this.offsetParent[0].scrollTop)-(this.cssPosition=="fixed"?A(document).scrollTop():0)),left:(E.pageX-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+(this.cssPosition=="fixed"||(this.cssPosition=="absolute"&&this.offsetParent[0]==document.body)?0:this.offsetParent[0].scrollLeft)-(this.cssPosition=="fixed"?A(document).scrollLeft():0))};if(!this.originalPosition){return B}if(this.containment){if(B.left<this.containment[0]){B.left=this.containment[0]}if(B.top<this.containment[1]){B.top=this.containment[1]}if(B.left>this.containment[2]){B.left=this.containment[2]}if(B.top>this.containment[3]){B.top=this.containment[3]}}if(F.grid){var D=this.originalPosition.top+Math.round((B.top-this.originalPosition.top)/F.grid[1])*F.grid[1];B.top=this.containment?(!(D<this.containment[1]||D>this.containment[3])?D:(!(D<this.containment[1])?D-F.grid[1]:D+F.grid[1])):D;var C=this.originalPosition.left+Math.round((B.left-this.originalPosition.left)/F.grid[0])*F.grid[0];B.left=this.containment?(!(C<this.containment[0]||C>this.containment[2])?C:(!(C<this.containment[0])?C-F.grid[0]:C+F.grid[0])):C}return B},mouseDrag:function(B){this.position=this.generatePosition(B);this.positionAbs=this.convertPositionTo("absolute");this.position=this.propagate("drag",B)||this.position;if(!this.options.axis||this.options.axis!="y"){this.helper[0].style.left=this.position.left+"px"}if(!this.options.axis||this.options.axis!="x"){this.helper[0].style.top=this.position.top+"px"}if(A.ui.ddmanager){A.ui.ddmanager.drag(this,B)}return false},mouseStop:function(C){var D=false;if(A.ui.ddmanager&&!this.options.dropBehaviour){var D=A.ui.ddmanager.drop(this,C)}if((this.options.revert=="invalid"&&!D)||(this.options.revert=="valid"&&D)||this.options.revert===true){var B=this;A(this.helper).animate(this.originalPosition,parseInt(this.options.revert,10)||500,function(){B.propagate("stop",C);B.clear()})}else{this.propagate("stop",C);this.clear()}return false},clear:function(){this.helper.removeClass("ui-draggable-dragging");if(this.options.helper!="original"&&!this.cancelHelperRemoval){this.helper.remove()}this.helper=null;this.cancelHelperRemoval=false},plugins:{},uiHash:function(B){return{helper:this.helper,position:this.position,absolutePosition:this.positionAbs,options:this.options}},propagate:function(C,B){A.ui.plugin.call(this,C,[B,this.uiHash()]);if(C=="drag"){this.positionAbs=this.convertPositionTo("absolute")}return this.element.triggerHandler(C=="drag"?C:"drag"+C,[B,this.uiHash()],this.options[C])},destroy:function(){if(!this.element.data("draggable")){return }this.element.removeData("draggable").unbind(".draggable").removeClass("ui-draggable");this.mouseDestroy()}}));A.extend(A.ui.draggable,{defaults:{appendTo:"parent",axis:false,cancel:":input",delay:0,distance:1,helper:"original"}});A.ui.plugin.add("draggable","cursor",{start:function(D,C){var B=A("body");if(B.css("cursor")){C.options._cursor=B.css("cursor")}B.css("cursor",C.options.cursor)},stop:function(C,B){if(B.options._cursor){A("body").css("cursor",B.options._cursor)}}});A.ui.plugin.add("draggable","zIndex",{start:function(D,C){var B=A(C.helper);if(B.css("zIndex")){C.options._zIndex=B.css("zIndex")}B.css("zIndex",C.options.zIndex)},stop:function(C,B){if(B.options._zIndex){A(B.helper).css("zIndex",B.options._zIndex)}}});A.ui.plugin.add("draggable","opacity",{start:function(D,C){var B=A(C.helper);if(B.css("opacity")){C.options._opacity=B.css("opacity")}B.css("opacity",C.options.opacity)},stop:function(C,B){if(B.options._opacity){A(B.helper).css("opacity",B.options._opacity)}}});A.ui.plugin.add("draggable","iframeFix",{start:function(C,B){A(B.options.iframeFix===true?"iframe":B.options.iframeFix).each(function(){A('<div class="ui-draggable-iframeFix" style="background: #fff;"></div>').css({width:this.offsetWidth+"px",height:this.offsetHeight+"px",position:"absolute",opacity:"0.001",zIndex:1000}).css(A(this).offset()).appendTo("body")})},stop:function(C,B){A("div.DragDropIframeFix").each(function(){this.parentNode.removeChild(this)})}});A.ui.plugin.add("draggable","scroll",{start:function(D,C){var E=C.options;var B=A(this).data("draggable");E.scrollSensitivity=E.scrollSensitivity||20;E.scrollSpeed=E.scrollSpeed||20;B.overflowY=function(F){do{if(/auto|scroll/.test(F.css("overflow"))||(/auto|scroll/).test(F.css("overflow-y"))){return F}F=F.parent()}while(F[0].parentNode);return A(document)}(this);B.overflowX=function(F){do{if(/auto|scroll/.test(F.css("overflow"))||(/auto|scroll/).test(F.css("overflow-x"))){return F}F=F.parent()}while(F[0].parentNode);return A(document)}(this);if(B.overflowY[0]!=document&&B.overflowY[0].tagName!="HTML"){B.overflowYOffset=B.overflowY.offset()}if(B.overflowX[0]!=document&&B.overflowX[0].tagName!="HTML"){B.overflowXOffset=B.overflowX.offset()}},drag:function(D,C){var E=C.options;var B=A(this).data("draggable");if(B.overflowY[0]!=document&&B.overflowY[0].tagName!="HTML"){if((B.overflowYOffset.top+B.overflowY[0].offsetHeight)-D.pageY<E.scrollSensitivity){B.overflowY[0].scrollTop=B.overflowY[0].scrollTop+E.scrollSpeed}if(D.pageY-B.overflowYOffset.top<E.scrollSensitivity){B.overflowY[0].scrollTop=B.overflowY[0].scrollTop-E.scrollSpeed}}else{if(D.pageY-A(document).scrollTop()<E.scrollSensitivity){A(document).scrollTop(A(document).scrollTop()-E.scrollSpeed)}if(A(window).height()-(D.pageY-A(document).scrollTop())<E.scrollSensitivity){A(document).scrollTop(A(document).scrollTop()+E.scrollSpeed)}}if(B.overflowX[0]!=document&&B.overflowX[0].tagName!="HTML"){if((B.overflowXOffset.left+B.overflowX[0].offsetWidth)-D.pageX<E.scrollSensitivity){B.overflowX[0].scrollLeft=B.overflowX[0].scrollLeft+E.scrollSpeed}if(D.pageX-B.overflowXOffset.left<E.scrollSensitivity){B.overflowX[0].scrollLeft=B.overflowX[0].scrollLeft-E.scrollSpeed}}else{if(D.pageX-A(document).scrollLeft()<E.scrollSensitivity){A(document).scrollLeft(A(document).scrollLeft()-E.scrollSpeed)}if(A(window).width()-(D.pageX-A(document).scrollLeft())<E.scrollSensitivity){A(document).scrollLeft(A(document).scrollLeft()+E.scrollSpeed)}}}});A.ui.plugin.add("draggable","snap",{start:function(D,C){var B=A(this).data("draggable");B.snapElements=[];A(C.options.snap===true?".ui-draggable":C.options.snap).each(function(){var F=A(this);var E=F.offset();if(this!=B.element[0]){B.snapElements.push({item:this,width:F.outerWidth(),height:F.outerHeight(),top:E.top,left:E.left})}})},drag:function(J,N){var I=A(this).data("draggable");var L=N.options.snapTolerance||20;var D=N.absolutePosition.left,C=D+I.helperProportions.width,P=N.absolutePosition.top,O=P+I.helperProportions.height;for(var H=I.snapElements.length-1;H>=0;H--){var E=I.snapElements[H].left,B=E+I.snapElements[H].width,R=I.snapElements[H].top,M=R+I.snapElements[H].height;if(!((E-L<D&&D<B+L&&R-L<P&&P<M+L)||(E-L<D&&D<B+L&&R-L<O&&O<M+L)||(E-L<C&&C<B+L&&R-L<P&&P<M+L)||(E-L<C&&C<B+L&&R-L<O&&O<M+L))){continue}if(N.options.snapMode!="inner"){var K=Math.abs(R-O)<=20;var Q=Math.abs(M-P)<=20;var G=Math.abs(E-C)<=20;var F=Math.abs(B-D)<=20;if(K){N.position.top=I.convertPositionTo("relative",{top:R-I.helperProportions.height,left:0}).top}if(Q){N.position.top=I.convertPositionTo("relative",{top:M,left:0}).top}if(G){N.position.left=I.convertPositionTo("relative",{top:0,left:E-I.helperProportions.width}).left}if(F){N.position.left=I.convertPositionTo("relative",{top:0,left:B}).left}}if(N.options.snapMode!="outer"){var K=Math.abs(R-P)<=20;var Q=Math.abs(M-O)<=20;var G=Math.abs(E-D)<=20;var F=Math.abs(B-C)<=20;if(K){N.position.top=I.convertPositionTo("relative",{top:R,left:0}).top}if(Q){N.position.top=I.convertPositionTo("relative",{top:M-I.helperProportions.height,left:0}).top}if(G){N.position.left=I.convertPositionTo("relative",{top:0,left:E}).left}if(F){N.position.left=I.convertPositionTo("relative",{top:0,left:B-I.helperProportions.width}).left}}}}});A.ui.plugin.add("draggable","connectToSortable",{start:function(D,C){var B=A(this).data("draggable");B.sortables=[];A(C.options.connectToSortable).each(function(){if(A.data(this,"sortable")){var E=A.data(this,"sortable");B.sortables.push({instance:E,shouldRevert:E.options.revert});E.refreshItems();E.propagate("activate",D,B)}})},stop:function(D,C){var B=A(this).data("draggable");A.each(B.sortables,function(){if(this.instance.isOver){this.instance.isOver=0;B.cancelHelperRemoval=true;this.instance.cancelHelperRemoval=false;if(this.shouldRevert){this.instance.options.revert=true}this.instance.mouseStop(D);this.instance.element.triggerHandler("sortreceive",[D,A.extend(this.instance.ui(),{sender:B.element})],this.instance.options["receive"]);this.instance.options.helper=this.instance.options._helper}else{this.instance.propagate("deactivate",D,B)}})},drag:function(F,E){var D=A(this).data("draggable"),B=this;var C=function(K){var H=K.left,J=H+K.width,I=K.top,G=I+K.height;return(H<(this.positionAbs.left+this.offset.click.left)&&(this.positionAbs.left+this.offset.click.left)<J&&I<(this.positionAbs.top+this.offset.click.top)&&(this.positionAbs.top+this.offset.click.top)<G)};A.each(D.sortables,function(G){if(C.call(D,this.instance.containerCache)){if(!this.instance.isOver){this.instance.isOver=1;this.instance.currentItem=A(B).clone().appendTo(this.instance.element).data("sortable-item",true);this.instance.options._helper=this.instance.options.helper;this.instance.options.helper=function(){return E.helper[0]};F.target=this.instance.currentItem[0];this.instance.mouseCapture(F,true);this.instance.mouseStart(F,true,true);this.instance.offset.click.top=D.offset.click.top;this.instance.offset.click.left=D.offset.click.left;this.instance.offset.parent.left-=D.offset.parent.left-this.instance.offset.parent.left;this.instance.offset.parent.top-=D.offset.parent.top-this.instance.offset.parent.top;D.propagate("toSortable",F)}if(this.instance.currentItem){this.instance.mouseDrag(F)}}else{if(this.instance.isOver){this.instance.isOver=0;this.instance.cancelHelperRemoval=true;this.instance.options.revert=false;this.instance.mouseStop(F,true);this.instance.options.helper=this.instance.options._helper;this.instance.currentItem.remove();if(this.instance.placeholder){this.instance.placeholder.remove()}D.propagate("fromSortable",F)}}})}});A.ui.plugin.add("draggable","stack",{start:function(D,B){var C=A.makeArray(A(B.options.stack.group)).sort(function(F,E){return(parseInt(A(F).css("zIndex"),10)||B.options.stack.min)-(parseInt(A(E).css("zIndex"),10)||B.options.stack.min)});A(C).each(function(E){this.style.zIndex=B.options.stack.min+E});this[0].style.zIndex=B.options.stack.min+C.length}})})(jQuery) \ No newline at end of file +(function(A){A.widget("ui.draggable",A.extend({},A.ui.mouse,{init:function(){var B=this.options;if(B.helper=="original"&&!(/(relative|absolute|fixed)/).test(this.element.css("position"))){this.element.css("position","relative");}this.element.addClass("ui-draggable");(B.disabled&&this.element.addClass("ui-draggable-disabled"));this.mouseInit();},mouseStart:function(F){var H=this.options;if(this.helper||H.disabled||A(F.target).is(".ui-resizable-handle")){return false;}var C=!this.options.handle||!A(this.options.handle,this.element).length?true:false;A(this.options.handle,this.element).find("*").andSelf().each(function(){if(this==F.target){C=true;}});if(!C){return false;}if(A.ui.ddmanager){A.ui.ddmanager.current=this;}this.helper=A.isFunction(H.helper)?A(H.helper.apply(this.element[0],[F])):(H.helper=="clone"?this.element.clone():this.element);if(!this.helper.parents("body").length){this.helper.appendTo((H.appendTo=="parent"?this.element[0].parentNode:H.appendTo));}if(this.helper[0]!=this.element[0]&&!(/(fixed|absolute)/).test(this.helper.css("position"))){this.helper.css("position","absolute");}this.margins={left:(parseInt(this.element.css("marginLeft"),10)||0),top:(parseInt(this.element.css("marginTop"),10)||0)};this.cssPosition=this.helper.css("position");this.offset=this.element.offset();this.offset={top:this.offset.top-this.margins.top,left:this.offset.left-this.margins.left};this.offset.click={left:F.pageX-this.offset.left,top:F.pageY-this.offset.top};this.offsetParent=this.helper.offsetParent();var B=this.offsetParent.offset();if(this.offsetParent[0]==document.body&&A.browser.mozilla){B={top:0,left:0};}this.offset.parent={top:B.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:B.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)};var E=this.element.position();this.offset.relative=this.cssPosition=="relative"?{top:E.top-(parseInt(this.helper.css("top"),10)||0)+this.offsetParent[0].scrollTop,left:E.left-(parseInt(this.helper.css("left"),10)||0)+this.offsetParent[0].scrollLeft}:{top:0,left:0};this.originalPosition=this.generatePosition(F);this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()};if(H.cursorAt){if(H.cursorAt.left!=undefined){this.offset.click.left=H.cursorAt.left+this.margins.left;}if(H.cursorAt.right!=undefined){this.offset.click.left=this.helperProportions.width-H.cursorAt.right+this.margins.left;}if(H.cursorAt.top!=undefined){this.offset.click.top=H.cursorAt.top+this.margins.top;}if(H.cursorAt.bottom!=undefined){this.offset.click.top=this.helperProportions.height-H.cursorAt.bottom+this.margins.top;}}if(H.containment){if(H.containment=="parent"){H.containment=this.helper[0].parentNode;}if(H.containment=="document"||H.containment=="window"){this.containment=[0-this.offset.relative.left-this.offset.parent.left,0-this.offset.relative.top-this.offset.parent.top,A(H.containment=="document"?document:window).width()-this.offset.relative.left-this.offset.parent.left-this.helperProportions.width-this.margins.left-(parseInt(this.element.css("marginRight"),10)||0),(A(H.containment=="document"?document:window).height()||document.body.parentNode.scrollHeight)-this.offset.relative.top-this.offset.parent.top-this.helperProportions.height-this.margins.top-(parseInt(this.element.css("marginBottom"),10)||0)];}if(!(/^(document|window|parent)$/).test(H.containment)){var D=A(H.containment)[0];var G=A(H.containment).offset();this.containment=[G.left+(parseInt(A(D).css("borderLeftWidth"),10)||0)-this.offset.relative.left-this.offset.parent.left,G.top+(parseInt(A(D).css("borderTopWidth"),10)||0)-this.offset.relative.top-this.offset.parent.top,G.left+Math.max(D.scrollWidth,D.offsetWidth)-(parseInt(A(D).css("borderLeftWidth"),10)||0)-this.offset.relative.left-this.offset.parent.left-this.helperProportions.width-this.margins.left-(parseInt(this.element.css("marginRight"),10)||0),G.top+Math.max(D.scrollHeight,D.offsetHeight)-(parseInt(A(D).css("borderTopWidth"),10)||0)-this.offset.relative.top-this.offset.parent.top-this.helperProportions.height-this.margins.top-(parseInt(this.element.css("marginBottom"),10)||0)];}}this.propagate("start",F);this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()};if(A.ui.ddmanager&&!H.dropBehaviour){A.ui.ddmanager.prepareOffsets(this,F);}this.helper.addClass("ui-draggable-dragging");this.mouseDrag(F);return true;},convertPositionTo:function(C,D){if(!D){D=this.position;}var B=C=="absolute"?1:-1;return{top:(D.top+this.offset.relative.top*B+this.offset.parent.top*B-(this.cssPosition=="fixed"||(this.cssPosition=="absolute"&&this.offsetParent[0]==document.body)?0:this.offsetParent[0].scrollTop)*B+(this.cssPosition=="fixed"?A(document).scrollTop():0)*B+this.margins.top*B),left:(D.left+this.offset.relative.left*B+this.offset.parent.left*B-(this.cssPosition=="fixed"||(this.cssPosition=="absolute"&&this.offsetParent[0]==document.body)?0:this.offsetParent[0].scrollLeft)*B+(this.cssPosition=="fixed"?A(document).scrollLeft():0)*B+this.margins.left*B)};},generatePosition:function(E){var F=this.options;var B={top:(E.pageY-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+(this.cssPosition=="fixed"||(this.cssPosition=="absolute"&&this.offsetParent[0]==document.body)?0:this.offsetParent[0].scrollTop)-(this.cssPosition=="fixed"?A(document).scrollTop():0)),left:(E.pageX-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+(this.cssPosition=="fixed"||(this.cssPosition=="absolute"&&this.offsetParent[0]==document.body)?0:this.offsetParent[0].scrollLeft)-(this.cssPosition=="fixed"?A(document).scrollLeft():0))};if(!this.originalPosition){return B;}if(this.containment){if(B.left<this.containment[0]){B.left=this.containment[0];}if(B.top<this.containment[1]){B.top=this.containment[1];}if(B.left>this.containment[2]){B.left=this.containment[2];}if(B.top>this.containment[3]){B.top=this.containment[3];}}if(F.grid){var D=this.originalPosition.top+Math.round((B.top-this.originalPosition.top)/F.grid[1])*F.grid[1];B.top=this.containment?(!(D<this.containment[1]||D>this.containment[3])?D:(!(D<this.containment[1])?D-F.grid[1]:D+F.grid[1])):D;var C=this.originalPosition.left+Math.round((B.left-this.originalPosition.left)/F.grid[0])*F.grid[0];B.left=this.containment?(!(C<this.containment[0]||C>this.containment[2])?C:(!(C<this.containment[0])?C-F.grid[0]:C+F.grid[0])):C;}return B;},mouseDrag:function(B){this.position=this.generatePosition(B);this.positionAbs=this.convertPositionTo("absolute");this.position=this.propagate("drag",B)||this.position;if(!this.options.axis||this.options.axis!="y"){this.helper[0].style.left=this.position.left+"px";}if(!this.options.axis||this.options.axis!="x"){this.helper[0].style.top=this.position.top+"px";}if(A.ui.ddmanager){A.ui.ddmanager.drag(this,B);}return false;},mouseStop:function(C){var D=false;if(A.ui.ddmanager&&!this.options.dropBehaviour){var D=A.ui.ddmanager.drop(this,C);}if((this.options.revert=="invalid"&&!D)||(this.options.revert=="valid"&&D)||this.options.revert===true){var B=this;A(this.helper).animate(this.originalPosition,parseInt(this.options.revert,10)||500,function(){B.propagate("stop",C);B.clear();});}else{this.propagate("stop",C);this.clear();}return false;},clear:function(){this.helper.removeClass("ui-draggable-dragging");if(this.options.helper!="original"&&!this.cancelHelperRemoval){this.helper.remove();}this.helper=null;this.cancelHelperRemoval=false;},plugins:{},uiHash:function(B){return{helper:this.helper,position:this.position,absolutePosition:this.positionAbs,options:this.options};},propagate:function(C,B){A.ui.plugin.call(this,C,[B,this.uiHash()]);if(C=="drag"){this.positionAbs=this.convertPositionTo("absolute");}return this.element.triggerHandler(C=="drag"?C:"drag"+C,[B,this.uiHash()],this.options[C]);},destroy:function(){if(!this.element.data("draggable")){return;}this.element.removeData("draggable").unbind(".draggable").removeClass("ui-draggable");this.mouseDestroy();}}));A.extend(A.ui.draggable,{defaults:{appendTo:"parent",axis:false,cancel:":input",delay:0,distance:1,helper:"original"}});A.ui.plugin.add("draggable","cursor",{start:function(D,C){var B=A("body");if(B.css("cursor")){C.options._cursor=B.css("cursor");}B.css("cursor",C.options.cursor);},stop:function(C,B){if(B.options._cursor){A("body").css("cursor",B.options._cursor);}}});A.ui.plugin.add("draggable","zIndex",{start:function(D,C){var B=A(C.helper);if(B.css("zIndex")){C.options._zIndex=B.css("zIndex");}B.css("zIndex",C.options.zIndex);},stop:function(C,B){if(B.options._zIndex){A(B.helper).css("zIndex",B.options._zIndex);}}});A.ui.plugin.add("draggable","opacity",{start:function(D,C){var B=A(C.helper);if(B.css("opacity")){C.options._opacity=B.css("opacity");}B.css("opacity",C.options.opacity);},stop:function(C,B){if(B.options._opacity){A(B.helper).css("opacity",B.options._opacity);}}});A.ui.plugin.add("draggable","iframeFix",{start:function(C,B){A(B.options.iframeFix===true?"iframe":B.options.iframeFix).each(function(){A('<div class="ui-draggable-iframeFix" style="background: #fff;"></div>').css({width:this.offsetWidth+"px",height:this.offsetHeight+"px",position:"absolute",opacity:"0.001",zIndex:1000}).css(A(this).offset()).appendTo("body");});},stop:function(C,B){A("div.DragDropIframeFix").each(function(){this.parentNode.removeChild(this);});}});A.ui.plugin.add("draggable","scroll",{start:function(D,C){var E=C.options;var B=A(this).data("draggable");E.scrollSensitivity=E.scrollSensitivity||20;E.scrollSpeed=E.scrollSpeed||20;B.overflowY=function(F){do{if(/auto|scroll/.test(F.css("overflow"))||(/auto|scroll/).test(F.css("overflow-y"))){return F;}F=F.parent();}while(F[0].parentNode);return A(document);}(this);B.overflowX=function(F){do{if(/auto|scroll/.test(F.css("overflow"))||(/auto|scroll/).test(F.css("overflow-x"))){return F;}F=F.parent();}while(F[0].parentNode);return A(document);}(this);if(B.overflowY[0]!=document&&B.overflowY[0].tagName!="HTML"){B.overflowYOffset=B.overflowY.offset();}if(B.overflowX[0]!=document&&B.overflowX[0].tagName!="HTML"){B.overflowXOffset=B.overflowX.offset();}},drag:function(D,C){var E=C.options;var B=A(this).data("draggable");if(B.overflowY[0]!=document&&B.overflowY[0].tagName!="HTML"){if((B.overflowYOffset.top+B.overflowY[0].offsetHeight)-D.pageY<E.scrollSensitivity){B.overflowY[0].scrollTop=B.overflowY[0].scrollTop+E.scrollSpeed;}if(D.pageY-B.overflowYOffset.top<E.scrollSensitivity){B.overflowY[0].scrollTop=B.overflowY[0].scrollTop-E.scrollSpeed;}}else{if(D.pageY-A(document).scrollTop()<E.scrollSensitivity){A(document).scrollTop(A(document).scrollTop()-E.scrollSpeed);}if(A(window).height()-(D.pageY-A(document).scrollTop())<E.scrollSensitivity){A(document).scrollTop(A(document).scrollTop()+E.scrollSpeed);}}if(B.overflowX[0]!=document&&B.overflowX[0].tagName!="HTML"){if((B.overflowXOffset.left+B.overflowX[0].offsetWidth)-D.pageX<E.scrollSensitivity){B.overflowX[0].scrollLeft=B.overflowX[0].scrollLeft+E.scrollSpeed;}if(D.pageX-B.overflowXOffset.left<E.scrollSensitivity){B.overflowX[0].scrollLeft=B.overflowX[0].scrollLeft-E.scrollSpeed;}}else{if(D.pageX-A(document).scrollLeft()<E.scrollSensitivity){A(document).scrollLeft(A(document).scrollLeft()-E.scrollSpeed);}if(A(window).width()-(D.pageX-A(document).scrollLeft())<E.scrollSensitivity){A(document).scrollLeft(A(document).scrollLeft()+E.scrollSpeed);}}}});A.ui.plugin.add("draggable","snap",{start:function(D,C){var B=A(this).data("draggable");B.snapElements=[];A(C.options.snap===true?".ui-draggable":C.options.snap).each(function(){var F=A(this);var E=F.offset();if(this!=B.element[0]){B.snapElements.push({item:this,width:F.outerWidth(),height:F.outerHeight(),top:E.top,left:E.left});}});},drag:function(J,N){var I=A(this).data("draggable");var L=N.options.snapTolerance||20;var D=N.absolutePosition.left,C=D+I.helperProportions.width,P=N.absolutePosition.top,O=P+I.helperProportions.height;for(var H=I.snapElements.length-1;H>=0;H--){var E=I.snapElements[H].left,B=E+I.snapElements[H].width,R=I.snapElements[H].top,M=R+I.snapElements[H].height;if(!((E-L<D&&D<B+L&&R-L<P&&P<M+L)||(E-L<D&&D<B+L&&R-L<O&&O<M+L)||(E-L<C&&C<B+L&&R-L<P&&P<M+L)||(E-L<C&&C<B+L&&R-L<O&&O<M+L))){continue;}if(N.options.snapMode!="inner"){var K=Math.abs(R-O)<=20;var Q=Math.abs(M-P)<=20;var G=Math.abs(E-C)<=20;var F=Math.abs(B-D)<=20;if(K){N.position.top=I.convertPositionTo("relative",{top:R-I.helperProportions.height,left:0}).top;}if(Q){N.position.top=I.convertPositionTo("relative",{top:M,left:0}).top;}if(G){N.position.left=I.convertPositionTo("relative",{top:0,left:E-I.helperProportions.width}).left;}if(F){N.position.left=I.convertPositionTo("relative",{top:0,left:B}).left;}}if(N.options.snapMode!="outer"){var K=Math.abs(R-P)<=20;var Q=Math.abs(M-O)<=20;var G=Math.abs(E-D)<=20;var F=Math.abs(B-C)<=20;if(K){N.position.top=I.convertPositionTo("relative",{top:R,left:0}).top;}if(Q){N.position.top=I.convertPositionTo("relative",{top:M-I.helperProportions.height,left:0}).top;}if(G){N.position.left=I.convertPositionTo("relative",{top:0,left:E}).left;}if(F){N.position.left=I.convertPositionTo("relative",{top:0,left:B-I.helperProportions.width}).left;}}}}});A.ui.plugin.add("draggable","connectToSortable",{start:function(D,C){var B=A(this).data("draggable");B.sortables=[];A(C.options.connectToSortable).each(function(){if(A.data(this,"sortable")){var E=A.data(this,"sortable");B.sortables.push({instance:E,shouldRevert:E.options.revert});E.refreshItems();E.propagate("activate",D,B);}});},stop:function(D,C){var B=A(this).data("draggable");A.each(B.sortables,function(){if(this.instance.isOver){this.instance.isOver=0;B.cancelHelperRemoval=true;this.instance.cancelHelperRemoval=false;if(this.shouldRevert){this.instance.options.revert=true;}this.instance.mouseStop(D);this.instance.element.triggerHandler("sortreceive",[D,A.extend(this.instance.ui(),{sender:B.element})],this.instance.options["receive"]);this.instance.options.helper=this.instance.options._helper;}else{this.instance.propagate("deactivate",D,B);}});},drag:function(F,E){var D=A(this).data("draggable"),B=this;var C=function(K){var H=K.left,J=H+K.width,I=K.top,G=I+K.height;return(H<(this.positionAbs.left+this.offset.click.left)&&(this.positionAbs.left+this.offset.click.left)<J&&I<(this.positionAbs.top+this.offset.click.top)&&(this.positionAbs.top+this.offset.click.top)<G);};A.each(D.sortables,function(G){if(C.call(D,this.instance.containerCache)){if(!this.instance.isOver){this.instance.isOver=1;this.instance.currentItem=A(B).clone().appendTo(this.instance.element).data("sortable-item",true);this.instance.options._helper=this.instance.options.helper;this.instance.options.helper=function(){return E.helper[0];};F.target=this.instance.currentItem[0];this.instance.mouseCapture(F,true);this.instance.mouseStart(F,true,true);this.instance.offset.click.top=D.offset.click.top;this.instance.offset.click.left=D.offset.click.left;this.instance.offset.parent.left-=D.offset.parent.left-this.instance.offset.parent.left;this.instance.offset.parent.top-=D.offset.parent.top-this.instance.offset.parent.top;D.propagate("toSortable",F);}if(this.instance.currentItem){this.instance.mouseDrag(F);}}else{if(this.instance.isOver){this.instance.isOver=0;this.instance.cancelHelperRemoval=true;this.instance.options.revert=false;this.instance.mouseStop(F,true);this.instance.options.helper=this.instance.options._helper;this.instance.currentItem.remove();if(this.instance.placeholder){this.instance.placeholder.remove();}D.propagate("fromSortable",F);}}});}});A.ui.plugin.add("draggable","stack",{start:function(D,B){var C=A.makeArray(A(B.options.stack.group)).sort(function(F,E){return(parseInt(A(F).css("zIndex"),10)||B.options.stack.min)-(parseInt(A(E).css("zIndex"),10)||B.options.stack.min);});A(C).each(function(E){this.style.zIndex=B.options.stack.min+E;});this[0].style.zIndex=B.options.stack.min+C.length;}});})(jQuery); \ No newline at end of file