~dongpo-deng/sahana-eden/test

« back to all changes in this revision

Viewing changes to static/scripts/S3/S3.min.js

  • Committer: Deng Dongpo
  • Date: 2010-08-01 09:29:44 UTC
  • Revision ID: dongpo@dhcp-21193.iis.sinica.edu.tw-20100801092944-8t9obt4xtl7otesb
initial

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
Calendar=function(J,K,H,G){this.activeDiv=null;this.currentDateEl=null;this.getDateStatus=null;this.getDateToolTip=null;this.getDateText=null;this.timeout=null;this.onSelected=H||null;this.onClose=G||null;this.dragging=false;this.hidden=false;this.minYear=1970;this.maxYear=2050;this.dateFormat=Calendar._TT.DEF_DATE_FORMAT;this.ttDateFormat=Calendar._TT.TT_DATE_FORMAT;this.isPopup=true;this.weekNumbers=true;this.firstDayOfWeek=typeof J=="number"?J:Calendar._FD;this.showsOtherMonths=false;this.dateStr=K;this.ar_days=null;this.showsTime=false;this.time24=true;this.yearStep=2;this.hiliteToday=true;this.multiple=null;this.table=null;this.element=null;this.tbody=null;this.firstdayname=null;this.monthsCombo=null;this.yearsCombo=null;this.hilitedMonth=null;this.activeMonth=null;this.hilitedYear=null;this.activeYear=null;this.dateClicked=false;if(typeof Calendar._SDN=="undefined"){if(typeof Calendar._SDN_len=="undefined"){Calendar._SDN_len=3}var L=new Array();for(var I=8;I>0;){L[--I]=Calendar._DN[I].substr(0,Calendar._SDN_len)}Calendar._SDN=L;if(typeof Calendar._SMN_len=="undefined"){Calendar._SMN_len=3}L=new Array();for(var I=12;I>0;){L[--I]=Calendar._MN[I].substr(0,Calendar._SMN_len)}Calendar._SMN=L}};Calendar._C=null;Calendar.is_ie=(/msie/i.test(navigator.userAgent)&&!/opera/i.test(navigator.userAgent));Calendar.is_ie5=(Calendar.is_ie&&/msie 5\.0/i.test(navigator.userAgent));Calendar.is_opera=/opera/i.test(navigator.userAgent);Calendar.is_khtml=/Konqueror|Safari|KHTML/i.test(navigator.userAgent);Calendar.getAbsolutePos=function(I){var G=0,J=0;var K=/^div$/i.test(I.tagName);if(K&&I.scrollLeft){G=I.scrollLeft}if(K&&I.scrollTop){J=I.scrollTop}var H={x:I.offsetLeft-G,y:I.offsetTop-J};if(I.offsetParent){var L=this.getAbsolutePos(I.offsetParent);H.x+=L.x;H.y+=L.y}return H};Calendar.isRelated=function(G,E){var F=E.relatedTarget;if(!F){var H=E.type;if(H=="mouseover"){F=E.fromElement}else{if(H=="mouseout"){F=E.toElement}}}while(F){if(F==G){return true}F=F.parentNode}return false};Calendar.removeClass=function(G,H){if(!(G&&G.className)){return}var F=G.className.split(" ");var J=new Array();for(var I=F.length;I>0;){if(F[--I]!=H){J[J.length]=F[I]}}G.className=J.join(" ")};Calendar.addClass=function(D,C){Calendar.removeClass(D,C);D.className+=" "+C};Calendar.getElement=function(C){var D=Calendar.is_ie?window.event.srcElement:C.currentTarget;while(D.nodeType!=1||/^div$/i.test(D.tagName)){D=D.parentNode}return D};Calendar.getTargetElement=function(C){var D=Calendar.is_ie?window.event.srcElement:C.target;while(D.nodeType!=1){D=D.parentNode}return D};Calendar.stopEvent=function(B){B||(B=window.event);if(Calendar.is_ie){B.cancelBubble=true;B.returnValue=false}else{B.preventDefault();B.stopPropagation()}return false};Calendar.addEvent=function(D,E,F){if(D.attachEvent){D.attachEvent("on"+E,F)}else{if(D.addEventListener){D.addEventListener(E,F,true)}else{D["on"+E]=F}}};Calendar.removeEvent=function(D,E,F){if(D.detachEvent){D.detachEvent("on"+E,F)}else{if(D.removeEventListener){D.removeEventListener(E,F,true)}else{D["on"+E]=null}}};Calendar.createElement=function(E,F){var D=null;if(document.createElementNS){D=document.createElementNS("http://www.w3.org/1999/xhtml",E)}else{D=document.createElement(E)}if(typeof F!="undefined"){F.appendChild(D)}return D};Calendar._add_evs=function(el){with(Calendar){addEvent(el,"mouseover",dayMouseOver);addEvent(el,"mousedown",dayMouseDown);addEvent(el,"mouseout",dayMouseOut);if(is_ie){addEvent(el,"dblclick",dayMouseDblClick);el.setAttribute("unselectable",true)}}};Calendar.findMonth=function(B){if(typeof B.month!="undefined"){return B}else{if(typeof B.parentNode.month!="undefined"){return B.parentNode}}return null};Calendar.findYear=function(B){if(typeof B.year!="undefined"){return B}else{if(typeof B.parentNode.year!="undefined"){return B.parentNode}}return null};Calendar.showMonthsCombo=function(){var I=Calendar._C;if(!I){return false}var I=I;var H=I.activeDiv;var J=I.monthsCombo;if(I.hilitedMonth){Calendar.removeClass(I.hilitedMonth,"hilite")}if(I.activeMonth){Calendar.removeClass(I.activeMonth,"active")}var K=I.monthsCombo.getElementsByTagName("div")[I.date.getMonth()];Calendar.addClass(K,"active");I.activeMonth=K;var L=J.style;L.display="block";if(H.navtype<0){L.left=H.offsetLeft+"px"}else{var G=J.offsetWidth;if(typeof G=="undefined"){G=50}L.left=(H.offsetLeft+H.offsetWidth-G)+"px"}L.top=(H.offsetTop+H.offsetHeight)+"px"};Calendar.showYearsCombo=function(K){var N=Calendar._C;if(!N){return false}var N=N;var L=N.activeDiv;var S=N.yearsCombo;if(N.hilitedYear){Calendar.removeClass(N.hilitedYear,"hilite")}if(N.activeYear){Calendar.removeClass(N.activeYear,"active")}N.activeYear=null;var M=N.date.getFullYear()+(K?1:-1);var P=S.firstChild;var Q=false;for(var T=12;T>0;--T){if(M>=N.minYear&&M<=N.maxYear){P.innerHTML=M;P.year=M;P.style.display="block";Q=true}else{P.style.display="none"}P=P.nextSibling;M+=K?N.yearStep:-N.yearStep}if(Q){var O=S.style;O.display="block";if(L.navtype<0){O.left=L.offsetLeft+"px"}else{var R=S.offsetWidth;if(typeof R=="undefined"){R=50}O.left=(L.offsetLeft+L.offsetWidth-R)+"px"}O.top=(L.offsetTop+L.offsetHeight)+"px"}};Calendar.tableMouseUp=function(ev){var cal=Calendar._C;if(!cal){return false}if(cal.timeout){clearTimeout(cal.timeout)}var el=cal.activeDiv;if(!el){return false}var target=Calendar.getTargetElement(ev);ev||(ev=window.event);Calendar.removeClass(el,"active");if(target==el||target.parentNode==el){Calendar.cellClick(el,ev)}var mon=Calendar.findMonth(target);var date=null;if(mon){date=new Date(cal.date);if(mon.month!=date.getMonth()){date.setMonth(mon.month);cal.setDate(date);cal.dateClicked=false;cal.callHandler()}}else{var year=Calendar.findYear(target);if(year){date=new Date(cal.date);if(year.year!=date.getFullYear()){date.setFullYear(year.year);cal.setDate(date);cal.dateClicked=false;cal.callHandler()}}}with(Calendar){removeEvent(document,"mouseup",tableMouseUp);removeEvent(document,"mouseover",tableMouseOver);removeEvent(document,"mousemove",tableMouseOver);cal._hideCombos();_C=null;return stopEvent(ev)}};Calendar.tableMouseOver=function(X){var T=Calendar._C;if(!T){return}var R=T.activeDiv;var b=Calendar.getTargetElement(X);if(b==R||b.parentNode==R){Calendar.addClass(R,"hilite active");Calendar.addClass(R.parentNode,"rowhilite")}else{if(typeof R.navtype=="undefined"||(R.navtype!=50&&(R.navtype==0||Math.abs(R.navtype)>2))){Calendar.removeClass(R,"active")}Calendar.removeClass(R,"hilite");Calendar.removeClass(R.parentNode,"rowhilite")}X||(X=window.event);if(R.navtype==50&&b!=R){var Y=Calendar.getAbsolutePos(R);var V=R.offsetWidth;var W=X.clientX;var U;var Z=true;if(W>Y.x+V){U=W-Y.x-V;Z=false}else{U=Y.x-W}if(U<0){U=0}var e=R._range;var c=R._current;var d=Math.floor(U/10)%e.length;for(var f=e.length;--f>=0;){if(e[f]==c){break}}while(d-->0){if(Z){if(--f<0){f=e.length-1}}else{if(++f>=e.length){f=0}}}var S=e[f];R.innerHTML=S;T.onUpdateTime()}var Q=Calendar.findMonth(b);if(Q){if(Q.month!=T.date.getMonth()){if(T.hilitedMonth){Calendar.removeClass(T.hilitedMonth,"hilite")}Calendar.addClass(Q,"hilite");T.hilitedMonth=Q}else{if(T.hilitedMonth){Calendar.removeClass(T.hilitedMonth,"hilite")}}}else{if(T.hilitedMonth){Calendar.removeClass(T.hilitedMonth,"hilite")}var a=Calendar.findYear(b);if(a){if(a.year!=T.date.getFullYear()){if(T.hilitedYear){Calendar.removeClass(T.hilitedYear,"hilite")}Calendar.addClass(a,"hilite");T.hilitedYear=a}else{if(T.hilitedYear){Calendar.removeClass(T.hilitedYear,"hilite")}}}else{if(T.hilitedYear){Calendar.removeClass(T.hilitedYear,"hilite")}}}return Calendar.stopEvent(X)};Calendar.tableMouseDown=function(B){if(Calendar.getTargetElement(B)==Calendar.getElement(B)){return Calendar.stopEvent(B)}};Calendar.calDragIt=function(J){var I=Calendar._C;if(!(I&&I.dragging)){return false}var G;var H;if(Calendar.is_ie){H=window.event.clientY+document.body.scrollTop;G=window.event.clientX+document.body.scrollLeft}else{G=J.pageX;H=J.pageY}I.hideShowCovered();var F=I.element.style;F.left=(G-I.xOffs)+"px";F.top=(H-I.yOffs)+"px";return Calendar.stopEvent(J)};Calendar.calDragEnd=function(ev){var cal=Calendar._C;if(!cal){return false}cal.dragging=false;with(Calendar){removeEvent(document,"mousemove",calDragIt);removeEvent(document,"mouseup",calDragEnd);tableMouseUp(ev)}cal.hideShowCovered()};Calendar.dayMouseDown=function(ev){var el=Calendar.getElement(ev);if(el.disabled){return false}var cal=el.calendar;cal.activeDiv=el;Calendar._C=cal;if(el.navtype!=300){with(Calendar){if(el.navtype==50){el._current=el.innerHTML;addEvent(document,"mousemove",tableMouseOver)}else{addEvent(document,Calendar.is_ie5?"mousemove":"mouseover",tableMouseOver)}addClass(el,"hilite active");addEvent(document,"mouseup",tableMouseUp)}}else{if(cal.isPopup){cal._dragStart(ev)}}if(el.navtype==-1||el.navtype==1){if(cal.timeout){clearTimeout(cal.timeout)}cal.timeout=setTimeout("Calendar.showMonthsCombo()",250)}else{if(el.navtype==-2||el.navtype==2){if(cal.timeout){clearTimeout(cal.timeout)}cal.timeout=setTimeout((el.navtype>0)?"Calendar.showYearsCombo(true)":"Calendar.showYearsCombo(false)",250)}else{cal.timeout=null}}return Calendar.stopEvent(ev)};Calendar.dayMouseDblClick=function(B){Calendar.cellClick(Calendar.getElement(B),B||window.event);if(Calendar.is_ie){document.selection.empty()}};Calendar.dayMouseOver=function(D){var C=Calendar.getElement(D);if(Calendar.isRelated(C,D)||Calendar._C||C.disabled){return false}if(C.ttip){if(C.ttip.substr(0,1)=="_"){C.ttip=C.caldate.print(C.calendar.ttDateFormat)+C.ttip.substr(1)}C.calendar.tooltips.innerHTML=C.ttip}if(C.navtype!=300){Calendar.addClass(C,"hilite");if(C.caldate){Calendar.addClass(C.parentNode,"rowhilite")}}return Calendar.stopEvent(D)};Calendar.dayMouseOut=function(ev){with(Calendar){var el=getElement(ev);if(isRelated(el,ev)||_C||el.disabled){return false}removeClass(el,"hilite");if(el.caldate){removeClass(el.parentNode,"rowhilite")}if(el.calendar){el.calendar.tooltips.innerHTML=_TT.SEL_DATE}return stopEvent(ev)}};Calendar.cellClick=function(d,U){var Q=d.calendar;var a=false;var X=false;var c=null;if(typeof d.navtype=="undefined"){if(Q.currentDateEl){Calendar.removeClass(Q.currentDateEl,"selected");Calendar.addClass(d,"selected");a=(Q.currentDateEl==d);if(!a){Q.currentDateEl=d}}Q.date.setDateOnly(d.caldate);c=Q.date;var R=!(Q.dateClicked=!d.otherMonth);if(!R&&!Q.currentDateEl){Q._toggleMultipleDate(new Date(c))}else{X=!d.disabled}if(R){Q._init(Q.firstDayOfWeek,c)}}else{if(d.navtype==200){Calendar.removeClass(d,"hilite");Q.callCloseHandler();return}c=new Date(Q.date);if(d.navtype==0){c.setDateOnly(new Date())}Q.dateClicked=false;var V=c.getFullYear();var b=c.getMonth();function S(B){var A=c.getDate();var C=c.getMonthDays(B);if(A>C){c.setDate(C)}c.setMonth(B)}switch(d.navtype){case 400:Calendar.removeClass(d,"hilite");var T=Calendar._TT.ABOUT;if(typeof T!="undefined"){T+=Q.showsTime?Calendar._TT.ABOUT_TIME:""}else{T='Help and about box text is not translated into this language.\nIf you know this language and you feel generous please update\nthe corresponding file in "lang" subdir to match calendar-en.js\nand send it back to <mihai_bazon@yahoo.com> to get it into the distribution  ;-)\n\nThank you!\nhttp://dynarch.com/mishoo/calendar.epl\n'}alert(T);return;case-2:if(V>Q.minYear){c.setFullYear(V-1)}break;case-1:if(b>0){S(b-1)}else{if(V-->Q.minYear){c.setFullYear(V);S(11)}}break;case 1:if(b<11){S(b+1)}else{if(V<Q.maxYear){c.setFullYear(V+1);S(0)}}break;case 2:if(V<Q.maxYear){c.setFullYear(V+1)}break;case 100:Q.setFirstDayOfWeek(d.fdow);return;case 50:var Y=d._range;var W=d.innerHTML;for(var Z=Y.length;--Z>=0;){if(Y[Z]==W){break}}if(U&&U.shiftKey){if(--Z<0){Z=Y.length-1}}else{if(++Z>=Y.length){Z=0}}var P=Y[Z];d.innerHTML=P;Q.onUpdateTime();return;case 0:if((typeof Q.getDateStatus=="function")&&Q.getDateStatus(c,c.getFullYear(),c.getMonth(),c.getDate())){return false}break}if(!c.equalsTo(Q.date)){Q.setDate(c);X=true}else{if(d.navtype==0){X=a=true}}}if(X){U&&Q.callHandler()}if(a){Calendar.removeClass(d,"hilite");U&&Q.callCloseHandler()}};Calendar.prototype.create=function(Y){var Z=null;if(!Y){Z=document.getElementsByTagName("body")[0];this.isPopup=true}else{Z=Y;this.isPopup=false}this.date=this.dateStr?new Date(this.dateStr):new Date();var V=Calendar.createElement("table");this.table=V;V.cellSpacing=0;V.cellPadding=0;V.calendar=this;Calendar.addEvent(V,"mousedown",Calendar.tableMouseDown);var T=Calendar.createElement("div");this.element=T;T.className="calendar";if(this.isPopup){T.style.position="absolute";T.style.display="none"}T.appendChild(V);var b=Calendar.createElement("thead",V);var X=null;var U=null;var S=this;var f=function(A,B,C){X=Calendar.createElement("td",U);X.colSpan=B;X.className="button";if(C!=0&&Math.abs(C)<=2){X.className+=" nav"}Calendar._add_evs(X);X.calendar=S;X.navtype=C;X.innerHTML="<div unselectable='on'>"+A+"</div>";return X};U=Calendar.createElement("tr",b);var R=6;(this.isPopup)&&--R;(this.weekNumbers)&&++R;f("?",1,400).ttip=Calendar._TT.INFO;this.title=f("",R,300);this.title.className="title";if(this.isPopup){this.title.ttip=Calendar._TT.DRAG_TO_MOVE;this.title.style.cursor="move";f("&#x00d7;",1,200).ttip=Calendar._TT.CLOSE}U=Calendar.createElement("tr",b);U.className="headrow";this._nav_py=f("&#x00ab;",1,-2);this._nav_py.ttip=Calendar._TT.PREV_YEAR;this._nav_pm=f("&#x2039;",1,-1);this._nav_pm.ttip=Calendar._TT.PREV_MONTH;this._nav_now=f(Calendar._TT.TODAY,this.weekNumbers?4:3,0);this._nav_now.ttip=Calendar._TT.GO_TODAY;this._nav_nm=f("&#x203a;",1,1);this._nav_nm.ttip=Calendar._TT.NEXT_MONTH;this._nav_ny=f("&#x00bb;",1,2);this._nav_ny.ttip=Calendar._TT.NEXT_YEAR;U=Calendar.createElement("tr",b);U.className="daynames";if(this.weekNumbers){X=Calendar.createElement("td",U);X.className="name wn";X.innerHTML=Calendar._TT.WK}for(var c=7;c>0;--c){X=Calendar.createElement("td",U);if(!c){X.navtype=100;X.calendar=this;Calendar._add_evs(X)}}this.firstdayname=(this.weekNumbers)?U.firstChild.nextSibling:U.firstChild;this._displayWeekdays();var d=Calendar.createElement("tbody",V);this.tbody=d;for(c=6;c>0;--c){U=Calendar.createElement("tr",d);if(this.weekNumbers){X=Calendar.createElement("td",U)}for(var e=7;e>0;--e){X=Calendar.createElement("td",U);X.calendar=this;Calendar._add_evs(X)}}if(this.showsTime){U=Calendar.createElement("tr",d);U.className="time";X=Calendar.createElement("td",U);X.className="time";X.colSpan=2;X.innerHTML=Calendar._TT.TIME||"&nbsp;";X=Calendar.createElement("td",U);X.className="time";X.colSpan=this.weekNumbers?4:3;(function(){function F(P,N,O,L){var K=Calendar.createElement("span",X);K.className=P;K.innerHTML=N;K.calendar=S;K.ttip=Calendar._TT.TIME_PART;K.navtype=50;K._range=[];if(typeof O!="number"){K._range=O}else{for(var J=O;J<=L;++J){var M;if(J<10&&L>=10){M="0"+J}else{M=""+J}K._range[K._range.length]=M}}Calendar._add_evs(K);return K}var B=S.date.getHours();var I=S.date.getMinutes();var A=!S.time24;var H=(B>12);if(A&&H){B-=12}var D=F("hour",B,A?1:0,A?12:23);var E=Calendar.createElement("span",X);E.innerHTML=":";E.className="colon";var G=F("minute",I,0,59);var C=null;X=Calendar.createElement("td",U);X.className="time";X.colSpan=2;if(A){C=F("ampm",H?"pm":"am",["am","pm"])}else{X.innerHTML="&nbsp;"}S.onSetTime=function(){var K,L=this.date.getHours(),J=this.date.getMinutes();if(A){K=(L>=12);if(K){L-=12}if(L==0){L=12}C.innerHTML=K?"pm":"am"}D.innerHTML=(L<10)?("0"+L):L;G.innerHTML=(J<10)?("0"+J):J};S.onUpdateTime=function(){var K=this.date;var J=parseInt(D.innerHTML,10);if(A){if(/pm/i.test(C.innerHTML)&&J<12){J+=12}else{if(/am/i.test(C.innerHTML)&&J==12){J=0}}}var N=K.getDate();var M=K.getMonth();var L=K.getFullYear();K.setHours(J);K.setMinutes(parseInt(G.innerHTML,10));K.setFullYear(L);K.setMonth(M);K.setDate(N);this.dateClicked=false;this.callHandler()}})()}else{this.onSetTime=this.onUpdateTime=function(){}}var a=Calendar.createElement("tfoot",V);U=Calendar.createElement("tr",a);U.className="footrow";X=f(Calendar._TT.SEL_DATE,this.weekNumbers?8:7,300);X.className="ttip";if(this.isPopup){X.ttip=Calendar._TT.DRAG_TO_MOVE;X.style.cursor="move"}this.tooltips=X;T=Calendar.createElement("div",this.element);this.monthsCombo=T;T.className="combo";for(c=0;c<Calendar._MN.length;++c){var Q=Calendar.createElement("div");Q.className=Calendar.is_ie?"label-IEfix":"label";Q.month=c;Q.innerHTML=Calendar._SMN[c];T.appendChild(Q)}T=Calendar.createElement("div",this.element);this.yearsCombo=T;T.className="combo";for(c=12;c>0;--c){var W=Calendar.createElement("div");W.className=Calendar.is_ie?"label-IEfix":"label";T.appendChild(W)}this._init(this.firstDayOfWeek,this.date);Z.appendChild(this.element)};Calendar._keyEvent=function(T){var Q=window._dynarch_popupCalendar;if(!Q||Q.multiple){return false}(Calendar.is_ie)&&(T=window.event);var V=(Calendar.is_ie||T.type=="keypress"),S=T.keyCode;if(T.ctrlKey){switch(S){case 37:V&&Calendar.cellClick(Q._nav_pm);break;case 38:V&&Calendar.cellClick(Q._nav_py);break;case 39:V&&Calendar.cellClick(Q._nav_nm);break;case 40:V&&Calendar.cellClick(Q._nav_ny);break;default:return false}}else{switch(S){case 32:Calendar.cellClick(Q._nav_now);break;case 27:V&&Q.callCloseHandler();break;case 37:case 38:case 39:case 40:if(V){var Z,R,U,X,O,K;Z=S==37||S==38;K=(S==37||S==39)?1:7;function P(){O=Q.currentDateEl;var A=O.pos;R=A&15;U=A>>4;X=Q.ar_days[U][R]}P();function Y(){var A=new Date(Q.date);A.setDate(A.getDate()-K);Q.setDate(A)}function W(){var A=new Date(Q.date);A.setDate(A.getDate()+K);Q.setDate(A)}while(1){switch(S){case 37:if(--R>=0){X=Q.ar_days[U][R]}else{R=6;S=38;continue}break;case 38:if(--U>=0){X=Q.ar_days[U][R]}else{Y();P()}break;case 39:if(++R<7){X=Q.ar_days[U][R]}else{R=0;S=40;continue}break;case 40:if(++U<Q.ar_days.length){X=Q.ar_days[U][R]}else{W();P()}break}break}if(X){if(!X.disabled){Calendar.cellClick(X)}else{if(Z){Y()}else{W()}}}}break;case 13:if(V){Calendar.cellClick(Q.currentDateEl,T)}break;default:return false}}return Calendar.stopEvent(T)};Calendar.prototype._init=function(q,e){var f=new Date(),l=f.getFullYear(),c=f.getMonth(),AB=f.getDate();this.table.style.visibility="hidden";var v=e.getFullYear();if(v<this.minYear){v=this.minYear;e.setFullYear(v)}else{if(v>this.maxYear){v=this.maxYear;e.setFullYear(v)}}this.firstDayOfWeek=q;this.date=new Date(e);var d=e.getMonth();var a=e.getDate();var b=e.getMonthDays();e.setDate(1);var k=(e.getDay()-this.firstDayOfWeek)%7;if(k<0){k+=7}e.setDate(-k);e.setDate(e.getDate()+1);var y=this.tbody.firstChild;var s=Calendar._SMN[d];var o=this.ar_days=new Array();var p=Calendar._TT.WEEKEND;var z=this.multiple?(this.datesCells={}):null;for(var i=0;i<6;++i,y=y.nextSibling){var AC=y.firstChild;if(this.weekNumbers){AC.className="day wn";AC.innerHTML=e.getWeekNumber();AC=AC.nextSibling}y.className="daysrow";var g=false,x,AA=o[i]=[];for(var j=0;j<7;++j,AC=AC.nextSibling,e.setDate(x+1)){x=e.getDate();var w=e.getDay();AC.className="day";AC.pos=i<<4|j;AA[j]=AC;var r=(e.getMonth()==d);if(!r){if(this.showsOtherMonths){AC.className+=" othermonth";AC.otherMonth=true}else{AC.className="emptycell";AC.innerHTML="&nbsp;";AC.disabled=true;continue}}else{AC.otherMonth=false;g=true}AC.disabled=false;AC.innerHTML=this.getDateText?this.getDateText(e,x):x;if(z){z[e.print("%Y%m%d")]=AC}if(this.getDateStatus){var n=this.getDateStatus(e,v,d,x);if(this.getDateToolTip){var u=this.getDateToolTip(e,v,d,x);if(u){AC.title=u}}if(n===true){AC.className+=" disabled";AC.disabled=true}else{if(/disabled/i.test(n)){AC.disabled=true}AC.className+=" "+n}}if(!AC.disabled){AC.caldate=new Date(e);AC.ttip="_";if(!this.multiple&&r&&x==a&&this.hiliteToday){AC.className+=" selected";this.currentDateEl=AC}if(e.getFullYear()==l&&e.getMonth()==c&&x==AB){AC.className+=" today";AC.ttip+=Calendar._TT.PART_TODAY}if(p.indexOf(w.toString())!=-1){AC.className+=AC.otherMonth?" oweekend":" weekend"}}}if(!(g||this.showsOtherMonths)){y.className="emptyrow"}}this.title.innerHTML=Calendar._MN[d]+", "+v;this.onSetTime();this.table.style.visibility="visible";this._initMultipleDates()};Calendar.prototype._initMultipleDates=function(){if(this.multiple){for(var F in this.multiple){var D=this.datesCells[F];var E=this.multiple[F];if(!E){continue}if(D){D.className+=" selected"}}}};Calendar.prototype._toggleMultipleDate=function(H){if(this.multiple){var G=H.print("%Y%m%d");var E=this.datesCells[G];if(E){var F=this.multiple[G];if(!F){Calendar.addClass(E,"selected");this.multiple[G]=H}else{Calendar.removeClass(E,"selected");delete this.multiple[G]}}}};Calendar.prototype.setDateToolTipHandler=function(B){this.getDateToolTip=B};Calendar.prototype.setDate=function(B){if(!B.equalsTo(this.date)){this._init(this.firstDayOfWeek,B)}};Calendar.prototype.refresh=function(){this._init(this.firstDayOfWeek,this.date)};Calendar.prototype.setFirstDayOfWeek=function(B){this._init(B,this.date);this._displayWeekdays()};Calendar.prototype.setDateStatusHandler=Calendar.prototype.setDisabledHandler=function(B){this.getDateStatus=B};Calendar.prototype.setRange=function(C,D){this.minYear=C;this.maxYear=D};Calendar.prototype.callHandler=function(){if(this.onSelected){this.onSelected(this,this.date.print(this.dateFormat))}};Calendar.prototype.callCloseHandler=function(){if(this.onClose){this.onClose(this)}this.hideShowCovered()};Calendar.prototype.destroy=function(){var B=this.element.parentNode;B.removeChild(this.element);Calendar._C=null;window._dynarch_popupCalendar=null};Calendar.prototype.reparent=function(D){var C=this.element;C.parentNode.removeChild(C);D.appendChild(C)};Calendar._checkCalendar=function(F){var E=window._dynarch_popupCalendar;if(!E){return false}var D=Calendar.is_ie?Calendar.getElement(F):Calendar.getTargetElement(F);for(;D!=null&&D!=E.element;D=D.parentNode){}if(D==null){window._dynarch_popupCalendar.callCloseHandler();return Calendar.stopEvent(F)}};Calendar.prototype.show=function(){var I=this.table.getElementsByTagName("tr");for(var J=I.length;J>0;){var H=I[--J];Calendar.removeClass(H,"rowhilite");var K=H.getElementsByTagName("td");for(var L=K.length;L>0;){var G=K[--L];Calendar.removeClass(G,"hilite");Calendar.removeClass(G,"active")}}this.element.style.display="block";this.hidden=false;if(this.isPopup){window._dynarch_popupCalendar=this;Calendar.addEvent(document,"keydown",Calendar._keyEvent);Calendar.addEvent(document,"keypress",Calendar._keyEvent);Calendar.addEvent(document,"mousedown",Calendar._checkCalendar)}this.hideShowCovered()};Calendar.prototype.hide=function(){if(this.isPopup){Calendar.removeEvent(document,"keydown",Calendar._keyEvent);Calendar.removeEvent(document,"keypress",Calendar._keyEvent);Calendar.removeEvent(document,"mousedown",Calendar._checkCalendar)}this.element.style.display="none";this.hidden=true;this.hideShowCovered()};Calendar.prototype.showAt=function(D,E){var F=this.element.style;F.left=D+"px";F.top=E+"px";this.show()};Calendar.prototype.showAtElement=function(I,H){var F=this;var G=Calendar.getAbsolutePos(I);if(!H||typeof H!="string"){this.showAt(G.x,G.y+I.offsetHeight);return true}function J(B){if(B.x<0){B.x=0}if(B.y<0){B.y=0}var A=document.createElement("div");var C=A.style;C.position="absolute";C.right=C.bottom=C.width=C.height="0px";document.body.appendChild(A);var D=Calendar.getAbsolutePos(A);document.body.removeChild(A);if(Calendar.is_ie){D.y+=document.body.scrollTop;D.x+=document.body.scrollLeft}else{D.y+=window.scrollY;D.x+=window.scrollX}var E=B.x+B.width-D.x;if(E>0){B.x-=E}E=B.y+B.height-D.y;if(E>0){B.y-=E}}this.element.style.display="block";Calendar.continuation_for_the_fucking_khtml_browser=function(){var D=F.element.offsetWidth;var B=F.element.offsetHeight;F.element.style.display="none";var C=H.substr(0,1);var A="l";if(H.length>1){A=H.substr(1,1)}switch(C){case"T":G.y-=B;break;case"B":G.y+=I.offsetHeight;break;case"C":G.y+=(I.offsetHeight-B)/2;break;case"t":G.y+=I.offsetHeight-B;break;case"b":break}switch(A){case"L":G.x-=D;break;case"R":G.x+=I.offsetWidth;break;case"C":G.x+=(I.offsetWidth-D)/2;break;case"l":G.x+=I.offsetWidth-D;break;case"r":break}G.width=D;G.height=B+40;F.monthsCombo.style.display="none";J(G);F.showAt(G.x,G.y)};if(Calendar.is_khtml){setTimeout("Calendar.continuation_for_the_fucking_khtml_browser()",10)}else{Calendar.continuation_for_the_fucking_khtml_browser()}};Calendar.prototype.setDateFormat=function(B){this.dateFormat=B};Calendar.prototype.setTtDateFormat=function(B){this.ttDateFormat=B};Calendar.prototype.parseDate=function(D,C){if(!C){C=this.dateFormat}this.setDate(Date.parseDate(D,C))};Calendar.prototype.hideShowCovered=function(){if(!Calendar.is_ie&&!Calendar.is_opera){return}function S(A){var B=A.style.visibility;if(!B){if(document.defaultView&&typeof(document.defaultView.getComputedStyle)=="function"){if(!Calendar.is_khtml){B=document.defaultView.getComputedStyle(A,"").getPropertyValue("visibility")}else{B=""}}else{if(A.currentStyle){B=A.currentStyle.visibility}else{B=""}}}return B}var U=new Array("applet","iframe","select");var R=this.element;var T=Calendar.getAbsolutePos(R);var e=T.x;var Q=R.offsetWidth+e;var V=T.y;var W=R.offsetHeight+V;for(var c=U.length;c>0;){var d=document.getElementsByTagName(U[--c]);var f=null;for(var a=d.length;a>0;){f=d[--a];T=Calendar.getAbsolutePos(f);var X=T.x;var Y=f.offsetWidth+X;var Z=T.y;var b=f.offsetHeight+Z;if(this.hidden||(X>Q)||(Y<e)||(Z>W)||(b<V)){if(!f.__msh_save_visibility){f.__msh_save_visibility=S(f)}f.style.visibility=f.__msh_save_visibility}else{if(!f.__msh_save_visibility){f.__msh_save_visibility=S(f)}f.style.visibility="hidden"}}}};Calendar.prototype._displayWeekdays=function(){var J=this.firstDayOfWeek;var F=this.firstdayname;var H=Calendar._TT.WEEKEND;for(var I=0;I<7;++I){F.className="day name";var G=(I+J)%7;if(I){F.ttip=Calendar._TT.DAY_FIRST.replace("%s",Calendar._DN[G]);F.navtype=100;F.calendar=this;F.fdow=G;Calendar._add_evs(F)}if(H.indexOf(G.toString())!=-1){Calendar.addClass(F,"weekend")}F.innerHTML=Calendar._SDN[(I+J)%7];F=F.nextSibling}};Calendar.prototype._hideCombos=function(){this.monthsCombo.style.display="none";this.yearsCombo.style.display="none"};Calendar.prototype._dragStart=function(ev){if(this.dragging){return}this.dragging=true;var posX;var posY;if(Calendar.is_ie){posY=window.event.clientY+document.body.scrollTop;posX=window.event.clientX+document.body.scrollLeft}else{posY=ev.clientY+window.scrollY;posX=ev.clientX+window.scrollX}var st=this.element.style;this.xOffs=posX-parseInt(st.left);this.yOffs=posY-parseInt(st.top);with(Calendar){addEvent(document,"mousemove",calDragIt);addEvent(document,"mouseup",calDragEnd)}};Date._MD=new Array(31,28,31,30,31,30,31,31,30,31,30,31);Date.SECOND=1000;Date.MINUTE=60*Date.SECOND;Date.HOUR=60*Date.MINUTE;Date.DAY=24*Date.HOUR;Date.WEEK=7*Date.DAY;Date.parseDate=function(X,Q){var W=new Date();var V=0;var P=-1;var Y=0;var T=X.split(/\W+/);var U=Q.match(/%./g);var Z=0,N=0;var S=0;var O=0;for(Z=0;Z<T.length;++Z){if(!T[Z]){continue}switch(U[Z]){case"%d":case"%e":Y=parseInt(T[Z],10);break;case"%m":P=parseInt(T[Z],10)-1;break;case"%Y":case"%y":V=parseInt(T[Z],10);(V<100)&&(V+=(V>29)?1900:2000);break;case"%b":case"%B":for(N=0;N<12;++N){if(Calendar._MN[N].substr(0,T[Z].length).toLowerCase()==T[Z].toLowerCase()){P=N;break}}break;case"%H":case"%I":case"%k":case"%l":S=parseInt(T[Z],10);break;case"%P":case"%p":if(/pm/i.test(T[Z])&&S<12){S+=12}else{if(/am/i.test(T[Z])&&S>=12){S-=12}}break;case"%M":O=parseInt(T[Z],10);break}}if(isNaN(V)){V=W.getFullYear()}if(isNaN(P)){P=W.getMonth()}if(isNaN(Y)){Y=W.getDate()}if(isNaN(S)){S=W.getHours()}if(isNaN(O)){O=W.getMinutes()}if(V!=0&&P!=-1&&Y!=0){return new Date(V,P,Y,S,O,0)}V=0;P=-1;Y=0;for(Z=0;Z<T.length;++Z){if(T[Z].search(/[a-zA-Z]+/)!=-1){var R=-1;for(N=0;N<12;++N){if(Calendar._MN[N].substr(0,T[Z].length).toLowerCase()==T[Z].toLowerCase()){R=N;break}}if(R!=-1){if(P!=-1){Y=P+1}P=R}}else{if(parseInt(T[Z],10)<=12&&P==-1){P=T[Z]-1}else{if(parseInt(T[Z],10)>31&&V==0){V=parseInt(T[Z],10);(V<100)&&(V+=(V>29)?1900:2000)}else{if(Y==0){Y=T[Z]}}}}}if(V==0){V=W.getFullYear()}if(P!=-1&&Y!=0){return new Date(V,P,Y,S,O,0)}return W};Date.prototype.getMonthDays=function(D){var C=this.getFullYear();if(typeof D=="undefined"){D=this.getMonth()}if(((0==(C%4))&&((0!=(C%100))||(0==(C%400))))&&D==1){return 29}else{return Date._MD[D]}};Date.prototype.getDayOfYear=function(){var D=new Date(this.getFullYear(),this.getMonth(),this.getDate(),0,0,0);var E=new Date(this.getFullYear(),0,0,0,0,0);var F=D-E;return Math.floor(F/Date.DAY)};Date.prototype.getWeekNumber=function(){var E=new Date(this.getFullYear(),this.getMonth(),this.getDate(),0,0,0);var F=E.getDay();E.setDate(E.getDate()-(F+6)%7+3);var D=E.valueOf();E.setMonth(0);E.setDate(4);return Math.round((D-E.valueOf())/(7*86400000))+1};Date.prototype.equalsTo=function(B){return((this.getFullYear()==B.getFullYear())&&(this.getMonth()==B.getMonth())&&(this.getDate()==B.getDate())&&(this.getHours()==B.getHours())&&(this.getMinutes()==B.getMinutes()))};Date.prototype.setDateOnly=function(C){var D=new Date(C);this.setDate(1);this.setFullYear(D.getFullYear());this.setMonth(D.getMonth());this.setDate(D.getDate())};Date.prototype.print=function(d){var U=this.getMonth();var e=this.getDate();var c=this.getFullYear();var a=this.getWeekNumber();var Z=this.getDay();var V={};var Y=this.getHours();var T=(Y>=12);var g=(T)?(Y-12):Y;var W=this.getDayOfYear();if(g==0){g=12}var S=this.getMinutes();var f=this.getSeconds();V["%a"]=Calendar._SDN[Z];V["%A"]=Calendar._DN[Z];V["%b"]=Calendar._SMN[U];V["%B"]=Calendar._MN[U];V["%C"]=1+Math.floor(c/100);V["%d"]=(e<10)?("0"+e):e;V["%e"]=e;V["%H"]=(Y<10)?("0"+Y):Y;V["%I"]=(g<10)?("0"+g):g;V["%j"]=(W<100)?((W<10)?("00"+W):("0"+W)):W;V["%k"]=Y;V["%l"]=g;V["%m"]=(U<9)?("0"+(1+U)):(1+U);V["%M"]=(S<10)?("0"+S):S;V["%n"]="\n";V["%p"]=T?"PM":"AM";V["%P"]=T?"pm":"am";V["%s"]=Math.floor(this.getTime()/1000);V["%S"]=(f<10)?("0"+f):f;V["%t"]="\t";V["%U"]=V["%W"]=V["%V"]=(a<10)?("0"+a):a;V["%u"]=Z+1;V["%w"]=Z;V["%y"]=(""+c).substr(2,2);V["%Y"]=c;V["%%"]="%";var X=/%./g;if(!Calendar.is_ie5&&!Calendar.is_khtml){return d.replace(X,function(A){return V[A]||A})}var b=d.match(X);for(var i=0;i<b.length;i++){var R=V[b[i]];if(R){X=new RegExp(b[i],"g");d=d.replace(X,R)}}return d};Date.prototype.__msh_oldSetFullYear=Date.prototype.setFullYear;Date.prototype.setFullYear=function(D){var C=new Date(this);C.__msh_oldSetFullYear(D);if(C.getMonth()!=this.getMonth()){this.setDate(28)}this.__msh_oldSetFullYear(D)};window._dynarch_popupCalendar=null;Calendar._DN=new Array("Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday");Calendar._SDN=new Array("Sun","Mon","Tue","Wed","Thu","Fri","Sat","Sun");Calendar._FD=0;Calendar._MN=new Array("January","February","March","April","May","June","July","August","September","October","November","December");Calendar._SMN=new Array("Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec");Calendar._TT={};Calendar._TT.INFO="About the calendar";Calendar._TT.ABOUT="DHTML Date/Time Selector\n(c) dynarch.com 2002-2005 / Author: Mihai Bazon\nFor latest version visit: http://www.dynarch.com/projects/calendar/\nDistributed under GNU LGPL.  See http://gnu.org/licenses/lgpl.html for details.\n\nDate selection:\n- Use the \xab, \xbb buttons to select year\n- Use the "+String.fromCharCode(8249)+", "+String.fromCharCode(8250)+" buttons to select month\n- Hold mouse button on any of the above buttons for faster selection.";Calendar._TT.ABOUT_TIME="\n\nTime selection:\n- Click on any of the time parts to increase it\n- or Shift-click to decrease it\n- or click and drag for faster selection.";Calendar._TT.PREV_YEAR="Prev. year (hold for menu)";Calendar._TT.PREV_MONTH="Prev. month (hold for menu)";Calendar._TT.GO_TODAY="Go Today";Calendar._TT.NEXT_MONTH="Next month (hold for menu)";Calendar._TT.NEXT_YEAR="Next year (hold for menu)";Calendar._TT.SEL_DATE="Select date";Calendar._TT.DRAG_TO_MOVE="Drag to move";Calendar._TT.PART_TODAY=" (today)";Calendar._TT.DAY_FIRST="Display %s first";Calendar._TT.WEEKEND="0,6";Calendar._TT.CLOSE="Close";Calendar._TT.TODAY="Today";Calendar._TT.TIME_PART="(Shift-)Click or drag to change value";Calendar._TT.DEF_DATE_FORMAT="%Y-%m-%d";Calendar._TT.TT_DATE_FORMAT="%a, %b %e";Calendar._TT.WK="wk";Calendar._TT.TIME="Time:";Calendar.setup=function(I){function J(B,A){if(typeof I[B]=="undefined"){I[B]=A}}J("inputField",null);J("displayArea",null);J("button",null);J("eventName","click");J("ifFormat","%Y/%m/%d");J("daFormat","%Y/%m/%d");J("singleClick",true);J("disableFunc",null);J("dateStatusFunc",I.disableFunc);J("dateText",null);J("firstDay",null);J("align","Br");J("range",[1900,2999]);J("weekNumbers",true);J("flat",null);J("flatCallback",null);J("onSelect",null);J("onClose",null);J("onUpdate",null);J("date",null);J("showsTime",false);J("timeFormat","24");J("electric",true);J("step",2);J("position",null);J("cache",false);J("showOthers",false);J("multiple",null);var M=["inputField","displayArea","button"];for(var N in M){if(typeof I[M[N]]=="string"){I[M[N]]=document.getElementById(I[M[N]])}}if(!(I.flat||I.multiple||I.inputField||I.displayArea||I.button)){alert("Calendar.setup:\n  Nothing to setup (no fields found).  Please check your code");return false}function H(B){var C=B.params;var A=(B.dateClicked||C.electric);if(A&&C.inputField){C.inputField.value=B.date.print(C.ifFormat);if(typeof C.inputField.onchange=="function"){C.inputField.onchange()}}if(A&&C.displayArea){C.displayArea.innerHTML=B.date.print(C.daFormat)}if(A&&typeof C.onUpdate=="function"){C.onUpdate(B)}if(A&&C.flat){if(typeof C.flatCallback=="function"){C.flatCallback(B)}}if(A&&C.singleClick&&B.dateClicked){B.callCloseHandler()}}if(I.flat!=null){if(typeof I.flat=="string"){I.flat=document.getElementById(I.flat)}if(!I.flat){alert("Calendar.setup:\n  Flat specified but can't find parent.");return false}var K=new Calendar(I.firstDay,I.date,I.onSelect||H);K.showsOtherMonths=I.showOthers;K.showsTime=I.showsTime;K.time24=(I.timeFormat=="24");K.params=I;K.weekNumbers=I.weekNumbers;K.setRange(I.range[0],I.range[1]);K.setDateStatusHandler(I.dateStatusFunc);K.getDateText=I.dateText;if(I.ifFormat){K.setDateFormat(I.ifFormat)}if(I.inputField&&typeof I.inputField.value=="string"){K.parseDate(I.inputField.value)}K.create(I.flat);K.show();return false}var L=I.button||I.displayArea||I.inputField;L["on"+I.eventName]=function(){var E=I.inputField||I.displayArea;var C=I.inputField?I.ifFormat:I.daFormat;var F=false;var A=window.calendar;if(E){I.date=Date.parseDate(E.value||E.innerHTML,C)}if(!(A&&I.cache)){window.calendar=A=new Calendar(I.firstDay,I.date,I.onSelect||H,I.onClose||function(P){P.hide()});A.showsTime=I.showsTime;A.time24=(I.timeFormat=="24");A.weekNumbers=I.weekNumbers;F=true}else{if(I.date){A.setDate(I.date)}A.hide()}if(I.multiple){A.multiple={};for(var D=I.multiple.length;--D>=0;){var G=I.multiple[D];var B=G.print("%Y%m%d");A.multiple[B]=G}}A.showsOtherMonths=I.showOthers;A.yearStep=I.step;A.setRange(I.range[0],I.range[1]);A.params=I;A.setDateStatusHandler(I.dateStatusFunc);A.getDateText=I.dateText;A.setDateFormat(C);if(F){A.create()}A.refresh();if(!I.position){A.showAtElement(I.button||I.displayArea||I.inputField,I.align)}else{A.showAt(I.position[0],I.position[1])}return false};return K};jQuery.fn.clockpick=function(options,callback){var settings={starthour:8,endhour:18,showminutes:true,minutedivisions:4,military:false,event:"click",layout:"vertical",valuefield:null,useBgiframe:false,hoursopacity:1,minutesopacity:1};if(options){jQuery.extend(settings,options)}var callback=callback||function(){},v=(settings.layout=="vertical");errorcheck();jQuery(this)[settings.event](function(e){var self=this,$self=jQuery(this),$body=jQuery("body");if(!settings.valuefield){$self.unbind("keydown").bind("keydown",keyhandler)}else{jQuery("[name="+settings.valuefield+"]").unbind("keydown").bind("keydown",keyhandler)[0].focus()}jQuery("#CP_hourcont,#CP_minutecont").remove();$hourcont=jQuery("<div id='CP_hourcont' class='CP' />").appendTo($body);!settings.useBgiframe?$hourcont.css("opacity",settings.hoursopacity):null;binder($hourcont);$hourcol1=jQuery("<div class='CP_hourcol' id='hourcol1' />").appendTo($body);$hourcol2=jQuery("<div class='CP_hourcol' id='hourcol2' />").appendTo($body);if(settings.showminutes){$mc=jQuery("<div id='CP_minutecont' class='CP' />").appendTo($body);!settings.useBgiframe?$mc.css("opacity",settings.minutesopacity):null;binder($mc)}if(!v){$hourcont.css("width","auto");$mc.css("width","auto")}else{$hourcol1.addClass("floatleft");$hourcol2.addClass("floatleft")}renderhours();putcontainer();function renderhours(){var c=1;for(h=settings.starthour;h<=settings.endhour;h++){if(h==12){c=1}displayhours=((!settings.military&&h>12)?h-12:h)+set_tt(h);if(!settings.military&&h==0){displayhours="12"+set_tt(h)}$hd=jQuery("<div class='CP_hour' id='hr_"+h+"_"+c+"'>"+displayhours+"</div>");if(settings.military){$hd.width(20)}binder($hd);if(!v){$hd.css("float","left")}(h<12)?$hourcol1.append($hd):$hourcol2.append($hd);c++}$hourcont.append($hourcol1);!v?$hourcont.append("<div style='clear:left' />"):"";$hourcont.append($hourcol2)}function renderminutes(h){realhours=h;displayhours=(!settings.military&&h>12)?h-12:h;if(!settings.military&&h==0){displayhours="12"}$mc.empty();var n=60/settings.minutedivisions,tt=set_tt(realhours),counter=1;for(m=0;m<60;m=m+n){$md=jQuery("<div class='CP_minute' id='"+realhours+"_"+m+"'>"+displayhours+":"+((m<10)?"0":"")+m+tt+"</div>");if(!v){$md.css("float","left");if(settings.minutedivisions>6&&counter==settings.minutedivisions/2+1){$mc.append("<div style='clear:left' />")}}$mc.append($md);binder($md);counter++}}function set_tt(realhours){if(!settings.military){return(realhours>=12)?" PM":" AM"}else{return""}}function putcontainer(){if(!jQuery.browser.safari&&e.type!="focus"){$hourcont.css("left",e.pageX-5).css("top",e.pageY-(Math.floor($hourcont.height()/2)));rectify($hourcont)}else{$self.after($hourcont)}$hourcont.show();if(settings.useBgiframe){bgi($hourcont)}}function rectify($obj){var ph=document.documentElement.clientHeight?document.documentElement.clientHeight:document.body.clientHeight;var pw=document.documentElement.clientWidth?document.documentElement.clientWidth:document.body.clientWidth;if(!jQuery.browser.safari){var t=parseInt($obj.css("top"));var l=parseInt($obj.css("left"))}else{var t=$obj[0].offsetTop;var l=$obj[0].offsetLeft}var st=document.documentElement.scrollTop?document.documentElement.scrollTop:document.body.scrollTop;if(t<=st&&!$obj.is("#CP_minutecont")){$obj.css("top",st+10+"px")}else{if(t+$obj.height()-st>ph){$obj.css("top",st+ph-$obj.height()-10+"px")}}if(l<=0){$obj.css("left","10px")}}function bgi(ob){if(typeof jQuery.fn.bgIframe=="function"){ob.bgIframe()}else{alert("bgIframe plugin not loaded.")}}function binder($obj){if($obj.attr("id")=="CP_hourcont"){$obj.mouseout(function(e){hourcont_out(e)})}else{if($obj.attr("id")=="CP_minutecont"){$obj.mouseout(function(e){minutecont_out(e)})}else{if($obj.attr("class")=="CP_hour"){$obj.mouseover(function(e){hourdiv_over($obj,e)});$obj.mouseout(function(){hourdiv_out($obj)});$obj.click(function(){hourdiv_click($obj)})}else{if($obj.attr("class")=="CP_minute"){$obj.mouseover(function(){minutediv_over($obj)});$obj.mouseout(function(){minutediv_out($obj)});$obj.click(function(){minutediv_click($obj)})}}}}}function hourcont_out(e){try{t=(e.toElement)?e.toElement:e.relatedTarget;if(!(jQuery(t).is("div[@class^=CP], iframe"))){if(!jQuery.browser.safari){cleardivs()}}}catch(e){cleardivs()}}function minutecont_out(e){try{t=(e.toElement)?e.toElement:e.relatedTarget;if(!(jQuery(t).is("div[@class^=CP], iframe"))){if(!jQuery.browser.safari){cleardivs()}}}catch(e){cleardivs()}}function hourdiv_over($obj,e){var h=$obj.attr("id").split("_")[1],i=$obj.attr("id").split("_")[2],l,t;$obj.addClass("CP_over");if(settings.showminutes){$mc.hide();renderminutes(h);if(v){t=e.type=="mouseover"?e.pageY-15:$hourcont.offset().top+2+($obj.height()*i);if(h<12){if(!jQuery.browser.safari){l=$hourcont.offset().left-$mc.width()}else{l=$hourcont[0].offsetLeft-$mc.width()}}else{if(!jQuery.browser.safari){l=$hourcont.offset().left+$hourcont.width()}else{l=$hourcont[0].offsetLeft+$hourcont.width()}}}else{l=(e.type=="mouseover")?e.pageX-10:$hourcont.offset().left+($obj.width()-5)*i;if(h<12){if(!jQuery.browser.safari){t=$hourcont.offset().top-$mc.height()}else{t=$hourcont[0].offsetTop-$mc.height()}}else{if(!jQuery.browser.safari){t=$hourcont.offset().top+$hourcont.height()}else{t=$hourcont[0].offsetTop+$hourcont.height()}}}$mc.css("left",l+"px").css("top",t+"px");rectify($mc);$mc.show();if(settings.useBgiframe){bgi($mc)}}return false}function hourdiv_out($obj){$obj.removeClass("CP_over");return false}function hourdiv_click($obj){h=$obj.attr("id").split("_")[1];tt=set_tt(h);str=$obj.text();if(str.indexOf(" ")!=-1){cleanstr=str.substring(0,str.indexOf(" "))}else{cleanstr=str}$obj.text(cleanstr+":00"+tt);setval($obj);cleardivs()}function minutediv_over($obj){$obj.addClass("CP_over");return false}function minutediv_out($obj){$obj.removeClass("CP_over");return false}function minutediv_click($obj){setval($obj);cleardivs()}function setval($obj){if(!settings.valuefield){self.value=$obj.text()}else{jQuery("input[@name="+settings.valuefield+"]").val($obj.text())}callback.apply($self,[$obj.text()]);$self.unbind("keydown",keyhandler)}function cleardivs(){if(settings.showminutes){$mc.remove()}$hourcont.remove();$self.unbind("keydown",keyhandler)}function keyhandler(e){var $obj=$("div.CP_over").size()?$("div.CP_over"):$("div.CP_hour:first"),divtype=$obj.is(".CP_hour")?"hour":"minute",hi=(divtype=="hour")?$obj[0].id.split("_")[2]:0,h=(divtype=="minute")?$obj[0].id.split("_")[0]:$obj[0].id.split("_")[1];if(divtype=="minute"){var curloc=h<12?"m1":"m2"}else{var curloc=h<12?"h1":"h2"}function divprev($obj){if($obj.prev().size()){eval(divtype+"div_out($obj)");eval(divtype+"div_over($obj.prev(), e)")}else{return false}}function divnext($obj){if($obj.next().size()){eval(divtype+"div_out($obj)");eval(divtype+"div_over($obj.next(), e)")}else{return false}}function hourtohour($obj){var ctx=h>=12?"#hourcol1":"#hourcol2";$newobj=jQuery(".CP_hour[@id$=_"+hi+"]",ctx);if($newobj.size()){hourdiv_out($obj);hourdiv_over($newobj,e)}else{return false}}function hourtominute($obj){hourdiv_out($obj);minutediv_over($(".CP_minute:first"))}function minutetohour($obj){minutediv_out($obj);var ctx=h>=12?"#hourcol2":"#hourcol1";var $newobj=jQuery(".CP_hour[@id^=hr_"+h+"]",ctx);hourdiv_over($newobj,e)}switch(e.keyCode){case 37:if(v){switch(curloc){case"m1":return false;break;case"m2":minutetohour($obj);break;case"h1":hourtominute($obj);break;case"h2":hourtohour($obj);break}}else{divprev($obj)}break;case 38:if(v){divprev($obj)}else{switch(curloc){case"m1":return false;break;case"m2":minutetohour($obj);break;case"h1":hourtominute($obj);break;case"h2":hourtohour($obj);break}}break;case 39:if(v){switch(curloc){case"m1":minutetohour($obj);break;case"m2":return false;break;case"h1":hourtohour($obj);break;case"h2":hourtominute($obj);break}}else{divnext($obj)}break;case 40:if(v){divnext($obj)}else{switch(curloc){case"m1":minutetohour($obj);break;case"m2":return false;break;case"h1":hourtohour($obj);break;case"h2":hourtominute($obj);break}}break;case 13:eval(divtype+"div_click($obj)");break}return false}return false});function errorcheck(){if(settings.starthour>=settings.endhour){alert("Error - start hour must be less than end hour.");return false}else{if(60%settings.minutedivisions!=0){alert("Error - param minutedivisions must divide evenly into 60.");return false}}}return this};jQuery(document).ready(function(){jQuery(".s3_checkbox_label").cluetip({activation:"hover",positionBy:"auto",local:true,hideLocal:false,showTitle:false,topOffset:0,mouseOutClose:true,arrows:true,clickThrough:true});});;(function($){$.cluetip={version:'1.0.7'};var $cluetip,$cluetipInner,$cluetipOuter,$cluetipTitle,$cluetipArrows,$cluetipWait,$dropShadow,imgCount;$.fn.cluetip=function(js,options){if(typeof js=='object'){options=js;js=null;}
 
2
if(js=='destroy'){return this.removeData('thisInfo').unbind('.cluetip');}
 
3
return this.each(function(index){var link=this,$this=$(this);var opts=$.extend(true,{},$.fn.cluetip.defaults,options||{},$.metadata?$this.metadata():$.meta?$this.data():{});var cluetipContents=false;var cluezIndex=+opts.cluezIndex;$this.data('thisInfo',{title:link.title,zIndex:cluezIndex});var isActive=false,closeOnDelay=0;if(!$('#cluetip').length){$(['<div id="cluetip">','<div id="cluetip-outer">','<h3 id="cluetip-title"></h3>','<div id="cluetip-inner"></div>','</div>','<div id="cluetip-extra"></div>','<div id="cluetip-arrows" class="cluetip-arrows"></div>','</div>'].join(''))
 
4
[insertionType](insertionElement).hide();$cluetip=$('#cluetip').css({position:'absolute'});$cluetipOuter=$('#cluetip-outer').css({position:'relative',zIndex:cluezIndex});$cluetipInner=$('#cluetip-inner');$cluetipTitle=$('#cluetip-title');$cluetipArrows=$('#cluetip-arrows');$cluetipWait=$('<div id="cluetip-waitimage"></div>').css({position:'absolute'}).insertBefore($cluetip).hide();}
 
5
var dropShadowSteps=(opts.dropShadow)?+opts.dropShadowSteps:0;if(!$dropShadow){$dropShadow=$([]);for(var i=0;i<dropShadowSteps;i++){$dropShadow=$dropShadow.add($('<div></div>').css({zIndex:cluezIndex-1,opacity:.1,top:1+i,left:1+i}));}
 
6
$dropShadow.css({position:'absolute',backgroundColor:'#000'}).prependTo($cluetip);}
 
7
var tipAttribute=$this.attr(opts.attribute),ctClass=opts.cluetipClass;if(!tipAttribute&&!opts.splitTitle&&!js){return true;}
 
8
if(opts.local&&opts.localPrefix){tipAttribute=opts.localPrefix+tipAttribute;}
 
9
if(opts.local&&opts.hideLocal){$(tipAttribute+':first').hide();}
 
10
var tOffset=parseInt(opts.topOffset,10),lOffset=parseInt(opts.leftOffset,10);var tipHeight,wHeight,defHeight=isNaN(parseInt(opts.height,10))?'auto':(/\D/g).test(opts.height)?opts.height:opts.height+'px';var sTop,linkTop,posY,tipY,mouseY,baseline;var tipInnerWidth=parseInt(opts.width,10)||275,tipWidth=tipInnerWidth+(parseInt($cluetip.css('paddingLeft'),10)||0)+(parseInt($cluetip.css('paddingRight'),10)||0)+dropShadowSteps,linkWidth=this.offsetWidth,linkLeft,posX,tipX,mouseX,winWidth;var tipParts;var tipTitle=(opts.attribute!='title')?$this.attr(opts.titleAttribute):'';if(opts.splitTitle){if(tipTitle==undefined){tipTitle='';}
 
11
tipParts=tipTitle.split(opts.splitTitle);tipTitle=tipParts.shift();}
 
12
if(opts.escapeTitle){tipTitle=tipTitle.replace(/&/g,'&amp;').replace(/>/g,'&gt;').replace(/</g,'&lt;');}
 
13
var localContent;function returnFalse(){return false;}
 
14
var activate=function(event){if(!opts.onActivate($this)){return false;}
 
15
isActive=true;$cluetip.removeClass().css({width:tipInnerWidth});if(tipAttribute==$this.attr('href')){$this.css('cursor',opts.cursor);}
 
16
if(opts.hoverClass){$this.addClass(opts.hoverClass);}
 
17
linkTop=posY=$this.offset().top;linkLeft=$this.offset().left;mouseX=event.pageX;mouseY=event.pageY;if(link.tagName.toLowerCase()!='area'){sTop=$(document).scrollTop();winWidth=$(window).width();}
 
18
if(opts.positionBy=='fixed'){posX=linkWidth+linkLeft+lOffset;$cluetip.css({left:posX});}else{posX=(linkWidth>linkLeft&&linkLeft>tipWidth)||linkLeft+linkWidth+tipWidth+lOffset>winWidth?linkLeft-tipWidth-lOffset:linkWidth+linkLeft+lOffset;if(link.tagName.toLowerCase()=='area'||opts.positionBy=='mouse'||linkWidth+tipWidth>winWidth){if(mouseX+20+tipWidth>winWidth){$cluetip.addClass(' cluetip-'+ctClass);posX=(mouseX-tipWidth-lOffset)>=0?mouseX-tipWidth-lOffset-parseInt($cluetip.css('marginLeft'),10)+parseInt($cluetipInner.css('marginRight'),10):mouseX-(tipWidth/2);}else{posX=mouseX+lOffset;}}
 
19
var pY=posX<0?event.pageY+tOffset:event.pageY;$cluetip.css({left:(posX>0&&opts.positionBy!='bottomTop')?posX:(mouseX+(tipWidth/2)>winWidth)?winWidth/2-tipWidth/2:Math.max(mouseX-(tipWidth/2),0),zIndex:$this.data('thisInfo').zIndex});$cluetipArrows.css({zIndex:$this.data('thisInfo').zIndex+1});}
 
20
wHeight=$(window).height();if(js){if(typeof js=='function'){js=js.call(link);}
 
21
$cluetipInner.html(js);cluetipShow(pY);}
 
22
else if(tipParts){var tpl=tipParts.length;$cluetipInner.html(tpl?tipParts[0]:'');if(tpl>1){for(var i=1;i<tpl;i++){$cluetipInner.append('<div class="split-body">'+tipParts[i]+'</div>');}}
 
23
cluetipShow(pY);}
 
24
else if(!opts.local&&tipAttribute.indexOf('#')!==0){if(/\.(jpe?g|tiff?|gif|png)$/i.test(tipAttribute)){$cluetipInner.html('<img src="'+tipAttribute+'" alt="'+tipTitle+'" />');cluetipShow(pY);}else if(cluetipContents&&opts.ajaxCache){$cluetipInner.html(cluetipContents);cluetipShow(pY);}else{var optionBeforeSend=opts.ajaxSettings.beforeSend,optionError=opts.ajaxSettings.error,optionSuccess=opts.ajaxSettings.success,optionComplete=opts.ajaxSettings.complete;var ajaxSettings={cache:false,url:tipAttribute,beforeSend:function(xhr){if(optionBeforeSend){optionBeforeSend.call(link,xhr,$cluetip,$cluetipInner);}
 
25
$cluetipOuter.children().empty();if(opts.waitImage){$cluetipWait.css({top:mouseY+20,left:mouseX+20,zIndex:$this.data('thisInfo').zIndex-1}).show();}},error:function(xhr,textStatus){if(isActive){if(optionError){optionError.call(link,xhr,textStatus,$cluetip,$cluetipInner);}else{$cluetipInner.html('<i>sorry, the contents could not be loaded</i>');}}},success:function(data,textStatus){cluetipContents=opts.ajaxProcess.call(link,data);if(isActive){if(optionSuccess){optionSuccess.call(link,data,textStatus,$cluetip,$cluetipInner);}
 
26
$cluetipInner.html(cluetipContents);}},complete:function(xhr,textStatus){if(optionComplete){optionComplete.call(link,xhr,textStatus,$cluetip,$cluetipInner);}
 
27
var imgs=$cluetipInner[0].getElementsByTagName('img');imgCount=imgs.length;for(var i=0,l=imgs.length;i<l;i++){if(imgs[i].complete){imgCount--;}}
 
28
if(imgCount&&!$.browser.opera){$(imgs).bind('load error',function(){imgCount--;if(imgCount<1){$cluetipWait.hide();if(isActive){cluetipShow(pY);}}});}else{$cluetipWait.hide();if(isActive){cluetipShow(pY);}}}};var ajaxMergedSettings=$.extend(true,{},opts.ajaxSettings,ajaxSettings);$.ajax(ajaxMergedSettings);}}else if(opts.local){var $localContent=$(tipAttribute+(/#\S+$/.test(tipAttribute)?'':':eq('+index+')')).clone(true).show();$cluetipInner.html($localContent);cluetipShow(pY);}};var cluetipShow=function(bpY){$cluetip.addClass('cluetip-'+ctClass);if(opts.truncate){var $truncloaded=$cluetipInner.text().slice(0,opts.truncate)+'...';$cluetipInner.html($truncloaded);}
 
29
function doNothing(){};tipTitle?$cluetipTitle.show().html(tipTitle):(opts.showTitle)?$cluetipTitle.show().html('&nbsp;'):$cluetipTitle.hide();if(opts.sticky){var $closeLink=$('<div id="cluetip-close"><a href="#">'+opts.closeText+'</a></div>');(opts.closePosition=='bottom')?$closeLink.appendTo($cluetipInner):(opts.closePosition=='title')?$closeLink.prependTo($cluetipTitle):$closeLink.prependTo($cluetipInner);$closeLink.bind('click.cluetip',function(){cluetipClose();return false;});if(opts.mouseOutClose){$cluetip.bind('mouseleave.cluetip',function(){cluetipClose();});}else{$cluetip.unbind('mouseleave.cluetip');}}
 
30
var direction='';$cluetipOuter.css({zIndex:$this.data('thisInfo').zIndex,overflow:defHeight=='auto'?'visible':'auto',height:defHeight});tipHeight=defHeight=='auto'?Math.max($cluetip.outerHeight(),$cluetip.height()):parseInt(defHeight,10);tipY=posY;baseline=sTop+wHeight;if(opts.positionBy=='fixed'){tipY=posY-opts.dropShadowSteps+tOffset;}else if((posX<mouseX&&Math.max(posX,0)+tipWidth>mouseX)||opts.positionBy=='bottomTop'){if(posY+tipHeight+tOffset>baseline&&mouseY-sTop>tipHeight+tOffset){tipY=mouseY-tipHeight-tOffset;direction='top';}else{tipY=mouseY+tOffset;direction='bottom';}}else if(posY+tipHeight+tOffset>baseline){tipY=(tipHeight>=wHeight)?sTop:baseline-tipHeight-tOffset;}else if($this.css('display')=='block'||link.tagName.toLowerCase()=='area'||opts.positionBy=="mouse"){tipY=bpY-tOffset;}else{tipY=posY-opts.dropShadowSteps;}
 
31
if(direction==''){posX<linkLeft?direction='left':direction='right';}
 
32
$cluetip.css({top:tipY+'px'}).removeClass().addClass('clue-'+direction+'-'+ctClass).addClass(' cluetip-'+ctClass);if(opts.arrows){var bgY=(posY-tipY-opts.dropShadowSteps);$cluetipArrows.css({top:(/(left|right)/.test(direction)&&posX>=0&&bgY>0)?bgY+'px':/(left|right)/.test(direction)?0:''}).show();}else{$cluetipArrows.hide();}
 
33
$dropShadow.hide();$cluetip.hide()[opts.fx.open](opts.fx.openSpeed||0);if(opts.dropShadow){$dropShadow.css({height:tipHeight,width:tipInnerWidth,zIndex:$this.data('thisInfo').zIndex-1}).show();}
 
34
if($.fn.bgiframe){$cluetip.bgiframe();}
 
35
if(opts.delayedClose>0){closeOnDelay=setTimeout(cluetipClose,opts.delayedClose);}
 
36
opts.onShow.call(link,$cluetip,$cluetipInner);};var inactivate=function(event){isActive=false;$cluetipWait.hide();if(!opts.sticky||(/click|toggle/).test(opts.activation)){cluetipClose();clearTimeout(closeOnDelay);}
 
37
if(opts.hoverClass){$this.removeClass(opts.hoverClass);}};var cluetipClose=function(){$cluetipOuter.parent().hide().removeClass();opts.onHide.call(link,$cluetip,$cluetipInner);$this.removeClass('cluetip-clicked');if(tipTitle){$this.attr(opts.titleAttribute,tipTitle);}
 
38
$this.css('cursor','');if(opts.arrows){$cluetipArrows.css({top:''});}};$(document).bind('hideCluetip',function(e){cluetipClose();});if((/click|toggle/).test(opts.activation)){$this.bind('click.cluetip',function(event){if($cluetip.is(':hidden')||!$this.is('.cluetip-clicked')){activate(event);$('.cluetip-clicked').removeClass('cluetip-clicked');$this.addClass('cluetip-clicked');}else{inactivate(event);}
 
39
this.blur();return false;});}else if(opts.activation=='focus'){$this.bind('focus.cluetip',function(event){activate(event);});$this.bind('blur.cluetip',function(event){inactivate(event);});}else{$this[opts.clickThrough?'unbind':'bind']('click',returnFalse);var mouseTracks=function(evt){if(opts.tracking==true){var trackX=posX-evt.pageX;var trackY=tipY?tipY-evt.pageY:posY-evt.pageY;$this.bind('mousemove.cluetip',function(evt){$cluetip.css({left:evt.pageX+trackX,top:evt.pageY+trackY});});}};if($.fn.hoverIntent&&opts.hoverIntent){$this.hoverIntent({sensitivity:opts.hoverIntent.sensitivity,interval:opts.hoverIntent.interval,over:function(event){activate(event);mouseTracks(event);},timeout:opts.hoverIntent.timeout,out:function(event){inactivate(event);$this.unbind('mousemove.cluetip');}});}else{$this.bind('mouseenter.cluetip',function(event){activate(event);mouseTracks(event);}).bind('mouseleave.cluetip',function(event){inactivate(event);$this.unbind('mousemove.cluetip');});}
 
40
$this.bind('mouseover.cluetip',function(event){$this.attr('title','');}).bind('mouseleave.cluetip',function(event){$this.attr('title',$this.data('thisInfo').title);});}});};$.fn.cluetip.defaults={width:275,height:'auto',cluezIndex:97,positionBy:'auto',topOffset:15,leftOffset:15,local:false,localPrefix:null,hideLocal:true,attribute:'rel',titleAttribute:'title',splitTitle:'',escapeTitle:false,showTitle:true,cluetipClass:'default',hoverClass:'',waitImage:true,cursor:'help',arrows:false,dropShadow:true,dropShadowSteps:6,sticky:false,mouseOutClose:false,activation:'hover',clickThrough:false,tracking:false,delayedClose:0,closePosition:'top',closeText:'Close',truncate:0,fx:{open:'show',openSpeed:''},hoverIntent:{sensitivity:3,interval:50,timeout:0},onActivate:function(e){return true;},onShow:function(ct,ci){},onHide:function(ct,ci){},ajaxCache:true,ajaxProcess:function(data){data=data.replace(/<(script|style|title)[^<]+<\/(script|style|title)>/gm,'').replace(/<(link|meta)[^>]+>/g,'');return data;},ajaxSettings:{dataType:'html'},debug:false};var insertionType='appendTo',insertionElement='body';$.cluetip.setup=function(options){if(options&&options.insertionType&&(options.insertionType).match(/appendTo|prependTo|insertBefore|insertAfter/)){insertionType=options.insertionType;}
 
41
if(options&&options.insertionElement){insertionElement=options.insertionElement;}};})(jQuery);var S3MultiselectWidgetFileCounter=0;function S3MultiselectWidgetAddClick(Args)
 
42
{var WidgetID=Args.WidgetID;var DummyDisplayValues=[/DummyDisplay0/g,/DummyDisplay1/g,/DummyDisplay2/g,/DummyDisplay3/g,/DummyDisplay4/g]
 
43
var DummyJSONValues=[/DummyJSON0/g,/DummyJSON1/g,/DummyJSON2/g,/DummyJSON3/g,/DummyJSON4/g]
 
44
var JSONInputValue=$("#"+WidgetID+"_json").val();var newJSONInputValue="{";var JSONValue;var InputBlank=true;var NewRow=Args.NewRow;var FileInputID="";var NewFileInputID="";for(i=0;i<Args.ColumnFields.length;i++)
 
45
{var InputID="#"+WidgetID+"_"+Args.ColumnFields[i]
 
46
var InputSelector=$(InputID)
 
47
var AutoTextValue=$(InputID+"_auto_text").val();DisplayValue="";if(InputSelector.is("select"))
 
48
{JSONValue="'"+InputSelector.val()+"'";DisplayValue=$(InputID+" option:selected").text();InputSelector.val("");}
 
49
else if(AutoTextValue!=undefined)
 
50
{DisplayValue=AutoTextValue
 
51
JSONValue=$(InputID+"_auto_json").val();if(Args.ColumnFields[i].slice(-3)=="_id"&&JSONValue=="")
 
52
{DisplayValue="";break;}
 
53
$(InputID+"_auto_text").val("");$(InputID+"_auto_json").val("");$(InputID+"_auto_edit").hide();}
 
54
else if(InputSelector.attr("type")=="file")
 
55
{DisplayValue=InputSelector.val();if(DisplayValue!="")
 
56
{FileInputID=InputID;NewFileInputID=Args.ColumnFields[i]+S3MultiselectWidgetFileCounter;JSONValue="'"+NewFileInputID+"'"
 
57
S3MultiselectWidgetFileCounter++;}}
 
58
else
 
59
{DisplayValue=InputSelector.val();InputSelector.val("");if(InputSelector.attr("class")=="currency")
 
60
{DisplayValue=JSONValue.replace("$","");}
 
61
DisplayValue=DisplayValue.replace(/'/g,"\"");JSONValue="'"+DisplayValue+"'"}
 
62
if(DisplayValue!="")
 
63
{InputBlank=false;}
 
64
NewRow=NewRow.replace(DummyDisplayValues[i],DisplayValue);NewRow=NewRow.replace(DummyJSONValues[i],JSONValue);newJSONInputValue=newJSONInputValue+"'"+Args.ColumnFields[i]+"':"+JSONValue+","}
 
65
newJSONInputValue=newJSONInputValue.slice(0,-1)+"}"
 
66
if(!InputBlank&&!JSONInputValue.match(newJSONInputValue))
 
67
{if(JSONInputValue!="")
 
68
{JSONInputValue=JSONInputValue+",";}
 
69
JSONInputValue=JSONInputValue+newJSONInputValue;$("#"+WidgetID+"_json").val(JSONInputValue);$(NewRow).insertBefore("#"+Args.WidgetID+"_input_row");if(FileInputID!="")
 
70
{$(FileInputID).attr("id",NewFileInputID);$("#"+NewFileInputID).attr("name",NewFileInputID);$("#"+NewFileInputID).hide();$('<input class="upload" id="drrpp_framework_file_dummy_file" type="file" />').insertAfter("#"+NewFileInputID)}}};function S3MultiselectWidgetDeleteClick(WidgetDelete,Args)
 
71
{var WidgetID=Args.WidgetID;var RowID=$(WidgetDelete).attr("row_id");var DummyWidgetValue=$("#"+Args.DummyName).val();var JSONInputValue=$("#"+WidgetID+"_json").val();$(WidgetDelete).parent().parent().remove();if(RowID!="New")
 
72
{if(JSONInputValue!="")
 
73
{JSONInputValue=JSONInputValue+",";}
 
74
JSONInputValue=JSONInputValue+"{'id':'"+RowID+"','deleted':True},";}
 
75
else
 
76
{var DeleteJSON="{";for(i=0;i<Args.ColumnFields.length;i++)
 
77
{DeleteJSON=DeleteJSON+"'"+Args.ColumnFields[i]+"':'"+$(WidgetDelete).attr(Args.ColumnFields[i])+"',"}
 
78
DeleteJSON=DeleteJSON.slice(0,-1)+"}";JSONInputValue=JSONInputValue.replace(DeleteJSON,"");}
 
79
JSONInputValue=JSONInputValue.replace(",,",",");if(JSONInputValue.slice(-1)==",")
 
80
{JSONInputValue=JSONInputValue.slice(0,-1)}
 
81
$("#"+WidgetID+"_json").val(JSONInputValue);};(function($){$.ui=$.ui||{};if($.ui.version){return;}
 
82
$.extend($.ui,{version:"1.8.2",plugin:{add:function(module,option,set){var proto=$.ui[module].prototype;for(var i in set){proto.plugins[i]=proto.plugins[i]||[];proto.plugins[i].push([option,set[i]]);}},call:function(instance,name,args){var set=instance.plugins[name];if(!set||!instance.element[0].parentNode){return;}
 
83
for(var i=0;i<set.length;i++){if(instance.options[set[i][0]]){set[i][1].apply(instance.element,args);}}}},contains:function(a,b){return document.compareDocumentPosition?a.compareDocumentPosition(b)&16:a!==b&&a.contains(b);},hasScroll:function(el,a){if($(el).css('overflow')=='hidden'){return false;}
 
84
var scroll=(a&&a=='left')?'scrollLeft':'scrollTop',has=false;if(el[scroll]>0){return true;}
 
85
el[scroll]=1;has=(el[scroll]>0);el[scroll]=0;return has;},isOverAxis:function(x,reference,size){return(x>reference)&&(x<(reference+size));},isOver:function(y,x,top,left,height,width){return $.ui.isOverAxis(y,top,height)&&$.ui.isOverAxis(x,left,width);},keyCode:{ALT:18,BACKSPACE:8,CAPS_LOCK:20,COMMA:188,COMMAND:91,COMMAND_LEFT:91,COMMAND_RIGHT:93,CONTROL:17,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,INSERT:45,LEFT:37,MENU:93,NUMPAD_ADD:107,NUMPAD_DECIMAL:110,NUMPAD_DIVIDE:111,NUMPAD_ENTER:108,NUMPAD_MULTIPLY:106,NUMPAD_SUBTRACT:109,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SHIFT:16,SPACE:32,TAB:9,UP:38,WINDOWS:91}});$.fn.extend({_focus:$.fn.focus,focus:function(delay,fn){return typeof delay==='number'?this.each(function(){var elem=this;setTimeout(function(){$(elem).focus();(fn&&fn.call(elem));},delay);}):this._focus.apply(this,arguments);},enableSelection:function(){return this.attr('unselectable','off').css('MozUserSelect','');},disableSelection:function(){return this.attr('unselectable','on').css('MozUserSelect','none');},scrollParent:function(){var scrollParent;if(($.browser.msie&&(/(static|relative)/).test(this.css('position')))||(/absolute/).test(this.css('position'))){scrollParent=this.parents().filter(function(){return(/(relative|absolute|fixed)/).test($.curCSS(this,'position',1))&&(/(auto|scroll)/).test($.curCSS(this,'overflow',1)+$.curCSS(this,'overflow-y',1)+$.curCSS(this,'overflow-x',1));}).eq(0);}else{scrollParent=this.parents().filter(function(){return(/(auto|scroll)/).test($.curCSS(this,'overflow',1)+$.curCSS(this,'overflow-y',1)+$.curCSS(this,'overflow-x',1));}).eq(0);}
 
86
return(/fixed/).test(this.css('position'))||!scrollParent.length?$(document):scrollParent;},zIndex:function(zIndex){if(zIndex!==undefined){return this.css('zIndex',zIndex);}
 
87
if(this.length){var elem=$(this[0]),position,value;while(elem.length&&elem[0]!==document){position=elem.css('position');if(position=='absolute'||position=='relative'||position=='fixed')
 
88
{value=parseInt(elem.css('zIndex'));if(!isNaN(value)&&value!=0){return value;}}
 
89
elem=elem.parent();}}
 
90
return 0;}});$.extend($.expr[':'],{data:function(elem,i,match){return!!$.data(elem,match[3]);},focusable:function(element){var nodeName=element.nodeName.toLowerCase(),tabIndex=$.attr(element,'tabindex');return(/input|select|textarea|button|object/.test(nodeName)?!element.disabled:'a'==nodeName||'area'==nodeName?element.href||!isNaN(tabIndex):!isNaN(tabIndex))&&!$(element)['area'==nodeName?'parents':'closest'](':hidden').length;},tabbable:function(element){var tabIndex=$.attr(element,'tabindex');return(isNaN(tabIndex)||tabIndex>=0)&&$(element).is(':focusable');}});})(jQuery);;(function($){$.fn.extend({autocomplete:function(urlOrData,options){var isUrl=typeof urlOrData=="string";options=$.extend({},$.Autocompleter.defaults,{url:isUrl?urlOrData:null,data:isUrl?null:urlOrData,delay:isUrl?$.Autocompleter.defaults.delay:10,max:options&&!options.scroll?10:150},options);options.highlight=options.highlight||function(value){return value;};options.formatMatch=options.formatMatch||options.formatItem;return this.each(function(){new $.Autocompleter(this,options);});},result:function(handler){return this.bind("result",handler);},search:function(handler){return this.trigger("search",[handler]);},flushCache:function(){return this.trigger("flushCache");},setOptions:function(options){return this.trigger("setOptions",[options]);},unautocomplete:function(){return this.trigger("unautocomplete");}});$.Autocompleter=function(input,options){var KEY={UP:38,DOWN:40,DEL:46,TAB:9,RETURN:13,ESC:27,COMMA:188,PAGEUP:33,PAGEDOWN:34,BACKSPACE:8};var $input=$(input).attr("autocomplete","off").addClass(options.inputClass);var timeout;var previousValue="";var cache=$.Autocompleter.Cache(options);var hasFocus=0;var lastKeyPressCode;var config={mouseDownOnSelect:false};var select=$.Autocompleter.Select(options,input,selectCurrent,config);var blockSubmit;$.browser.opera&&$(input.form).bind("submit.autocomplete",function(){if(blockSubmit){blockSubmit=false;return false;}});$input.bind(($.browser.opera?"keypress":"keydown")+".autocomplete",function(event){hasFocus=1;lastKeyPressCode=event.keyCode;switch(event.keyCode){case KEY.UP:event.preventDefault();if(select.visible()){select.prev();}else{onChange(0,true);}
 
91
break;case KEY.DOWN:event.preventDefault();if(select.visible()){select.next();}else{onChange(0,true);}
 
92
break;case KEY.PAGEUP:event.preventDefault();if(select.visible()){select.pageUp();}else{onChange(0,true);}
 
93
break;case KEY.PAGEDOWN:event.preventDefault();if(select.visible()){select.pageDown();}else{onChange(0,true);}
 
94
break;case options.multiple&&$.trim(options.multipleSeparator)==","&&KEY.COMMA:case KEY.TAB:case KEY.RETURN:if(selectCurrent()){event.preventDefault();blockSubmit=true;return false;}
 
95
break;case KEY.ESC:select.hide();break;default:clearTimeout(timeout);timeout=setTimeout(onChange,options.delay);break;}}).focus(function(){hasFocus++;}).blur(function(){hasFocus=0;if(!config.mouseDownOnSelect){hideResults();}}).click(function(){if(hasFocus++>1&&!select.visible()){onChange(0,true);}}).bind("search",function(){var fn=(arguments.length>1)?arguments[1]:null;function findValueCallback(q,data){var result;if(data&&data.length){for(var i=0;i<data.length;i++){if(data[i].result.toLowerCase()==q.toLowerCase()){result=data[i];break;}}}
 
96
if(typeof fn=="function")fn(result);else $input.trigger("result",result&&[result.data,result.value]);}
 
97
$.each(trimWords($input.val()),function(i,value){request(value,findValueCallback,findValueCallback);});}).bind("flushCache",function(){cache.flush();}).bind("setOptions",function(){$.extend(options,arguments[1]);if("data"in arguments[1])
 
98
cache.populate();}).bind("unautocomplete",function(){select.unbind();$input.unbind();$(input.form).unbind(".autocomplete");});function selectCurrent(){var selected=select.selected();if(!selected)
 
99
return false;var v=selected.result;previousValue=v;if(options.multiple){var words=trimWords($input.val());if(words.length>1){var seperator=options.multipleSeparator.length;var cursorAt=$(input).selection().start;var wordAt,progress=0;$.each(words,function(i,word){progress+=word.length;if(cursorAt<=progress){wordAt=i;return false;}
 
100
progress+=seperator;});words[wordAt]=v;v=words.join(options.multipleSeparator);}
 
101
v+=options.multipleSeparator;}
 
102
$input.val(v);hideResultsNow();$input.trigger("result",[selected.data,selected.value]);return true;}
 
103
function onChange(crap,skipPrevCheck){if(lastKeyPressCode==KEY.DEL){select.hide();return;}
 
104
var currentValue=$input.val();if(!skipPrevCheck&&currentValue==previousValue)
 
105
return;previousValue=currentValue;currentValue=lastWord(currentValue);if(currentValue.length>=options.minChars){$input.addClass(options.loadingClass);if(!options.matchCase)
 
106
currentValue=currentValue.toLowerCase();request(currentValue,receiveData,hideResultsNow);}else{stopLoading();select.hide();}};function trimWords(value){if(!value)
 
107
return[""];if(!options.multiple)
 
108
return[$.trim(value)];return $.map(value.split(options.multipleSeparator),function(word){return $.trim(value).length?$.trim(word):null;});}
 
109
function lastWord(value){if(!options.multiple)
 
110
return value;var words=trimWords(value);if(words.length==1)
 
111
return words[0];var cursorAt=$(input).selection().start;if(cursorAt==value.length){words=trimWords(value)}else{words=trimWords(value.replace(value.substring(cursorAt),""));}
 
112
return words[words.length-1];}
 
113
function autoFill(q,sValue){if(options.autoFill&&(lastWord($input.val()).toLowerCase()==q.toLowerCase())&&lastKeyPressCode!=KEY.BACKSPACE){$input.val($input.val()+sValue.substring(lastWord(previousValue).length));$(input).selection(previousValue.length,previousValue.length+sValue.length);}};function hideResults(){clearTimeout(timeout);timeout=setTimeout(hideResultsNow,200);};function hideResultsNow(){var wasVisible=select.visible();select.hide();clearTimeout(timeout);stopLoading();if(options.mustMatch){$input.search(function(result){if(!result){if(options.multiple){var words=trimWords($input.val()).slice(0,-1);$input.val(words.join(options.multipleSeparator)+(words.length?options.multipleSeparator:""));}
 
114
else{$input.val("");$input.trigger("result",null);}}});}};function receiveData(q,data){if(data&&data.length&&hasFocus){stopLoading();select.display(data,q);autoFill(q,data[0].value);select.show();}else{hideResultsNow();}};function request(term,success,failure){if(!options.matchCase)
 
115
term=term.toLowerCase();var data=cache.load(term);if(data&&data.length){success(term,data);}else if((typeof options.url=="string")&&(options.url.length>0)){var extraParams={timestamp:+new Date()};$.each(options.extraParams,function(key,param){extraParams[key]=typeof param=="function"?param():param;});$.ajax({mode:"abort",port:"autocomplete"+input.name,dataType:options.dataType,url:options.url,data:$.extend({q:lastWord(term),limit:options.max},extraParams),success:function(data){var parsed=options.parse&&options.parse(data)||parse(data);cache.add(term,parsed);success(term,parsed);}});}else{select.emptyList();failure(term);}};function parse(data){var parsed=[];var rows=data.split("\n");for(var i=0;i<rows.length;i++){var row=$.trim(rows[i]);if(row){row=row.split("|");parsed[parsed.length]={data:row,value:row[0],result:options.formatResult&&options.formatResult(row,row[0])||row[0]};}}
 
116
return parsed;};function stopLoading(){$input.removeClass(options.loadingClass);};};$.Autocompleter.defaults={inputClass:"ac_input",resultsClass:"ac_results",loadingClass:"ac_loading",minChars:1,delay:400,matchCase:false,matchSubset:false,matchContains:false,cacheLength:10,max:100,mustMatch:false,extraParams:{},selectFirst:true,formatItem:function(row){return row[0];},formatMatch:null,autoFill:false,width:0,multiple:false,multipleSeparator:", ",highlight:function(value,term){return value.replace(new RegExp("(?![^&;]+;)(?!<[^<>]*)("+term.replace(/([\^\$\(\)\[\]\{\}\*\.\+\?\|\\])/gi,"\\$1")+")(?![^<>]*>)(?![^&;]+;)","gi"),"<strong>$1</strong>");},scroll:true,scrollHeight:180};$.Autocompleter.Cache=function(options){var data={};var length=0;function matchSubset(s,sub){if(!options.matchCase)
 
117
s=s.toLowerCase();var i=s.indexOf(sub);if(options.matchContains=="word"){i=s.toLowerCase().search("\\b"+sub.toLowerCase());}
 
118
if(i==-1)return false;return i==0||options.matchContains;};function add(q,value){if(length>options.cacheLength){flush();}
 
119
if(!data[q]){length++;}
 
120
data[q]=value;}
 
121
function populate(){if(!options.data)return false;var stMatchSets={},nullData=0;if(!options.url)options.cacheLength=1;stMatchSets[""]=[];for(var i=0,ol=options.data.length;i<ol;i++){var rawValue=options.data[i];rawValue=(typeof rawValue=="string")?[rawValue]:rawValue;var value=options.formatMatch(rawValue,i+1,options.data.length);if(value===false)
 
122
continue;var firstChar=value.charAt(0).toLowerCase();if(!stMatchSets[firstChar])
 
123
stMatchSets[firstChar]=[];var row={value:value,data:rawValue,result:options.formatResult&&options.formatResult(rawValue)||value};stMatchSets[firstChar].push(row);if(nullData++<options.max){stMatchSets[""].push(row);}};$.each(stMatchSets,function(i,value){options.cacheLength++;add(i,value);});}
 
124
setTimeout(populate,25);function flush(){data={};length=0;}
 
125
return{flush:flush,add:add,populate:populate,load:function(q){if(!options.cacheLength||!length)
 
126
return null;if(!options.url&&options.matchContains){var csub=[];for(var k in data){if(k.length>0){var c=data[k];$.each(c,function(i,x){if(matchSubset(x.value,q)){csub.push(x);}});}}
 
127
return csub;}else
 
128
if(data[q]){return data[q];}else
 
129
if(options.matchSubset){for(var i=q.length-1;i>=options.minChars;i--){var c=data[q.substr(0,i)];if(c){var csub=[];$.each(c,function(i,x){if(matchSubset(x.value,q)){csub[csub.length]=x;}});return csub;}}}
 
130
return null;}};};$.Autocompleter.Select=function(options,input,select,config){var CLASSES={ACTIVE:"ac_over"};var listItems,active=-1,data,term="",needsInit=true,element,list;function init(){if(!needsInit)
 
131
return;element=$("<div/>").hide().addClass(options.resultsClass).css("position","absolute").appendTo(document.body);list=$("<ul/>").appendTo(element).mouseover(function(event){if(target(event).nodeName&&target(event).nodeName.toUpperCase()=='LI'){active=$("li",list).removeClass(CLASSES.ACTIVE).index(target(event));$(target(event)).addClass(CLASSES.ACTIVE);}}).click(function(event){$(target(event)).addClass(CLASSES.ACTIVE);select();input.focus();return false;}).mousedown(function(){config.mouseDownOnSelect=true;}).mouseup(function(){config.mouseDownOnSelect=false;});if(options.width>0)
 
132
element.css("width",options.width);needsInit=false;}
 
133
function target(event){var element=event.target;while(element&&element.tagName!="LI")
 
134
element=element.parentNode;if(!element)
 
135
return[];return element;}
 
136
function moveSelect(step){listItems.slice(active,active+1).removeClass(CLASSES.ACTIVE);movePosition(step);var activeItem=listItems.slice(active,active+1).addClass(CLASSES.ACTIVE);if(options.scroll){var offset=0;listItems.slice(0,active).each(function(){offset+=this.offsetHeight;});if((offset+activeItem[0].offsetHeight-list.scrollTop())>list[0].clientHeight){list.scrollTop(offset+activeItem[0].offsetHeight-list.innerHeight());}else if(offset<list.scrollTop()){list.scrollTop(offset);}}};function movePosition(step){active+=step;if(active<0){active=listItems.size()-1;}else if(active>=listItems.size()){active=0;}}
 
137
function limitNumberOfItems(available){return options.max&&options.max<available?options.max:available;}
 
138
function fillList(){list.empty();var max=limitNumberOfItems(data.length);for(var i=0;i<max;i++){if(!data[i])
 
139
continue;var formatted=options.formatItem(data[i].data,i+1,max,data[i].value,term);if(formatted===false)
 
140
continue;var li=$("<li/>").html(options.highlight(formatted,term)).addClass(i%2==0?"ac_even":"ac_odd").appendTo(list)[0];$.data(li,"ac_data",data[i]);}
 
141
listItems=list.find("li");if(options.selectFirst){listItems.slice(0,1).addClass(CLASSES.ACTIVE);active=0;}
 
142
if($.fn.bgiframe)
 
143
list.bgiframe();}
 
144
return{display:function(d,q){init();data=d;term=q;fillList();},next:function(){moveSelect(1);},prev:function(){moveSelect(-1);},pageUp:function(){if(active!=0&&active-8<0){moveSelect(-active);}else{moveSelect(-8);}},pageDown:function(){if(active!=listItems.size()-1&&active+8>listItems.size()){moveSelect(listItems.size()-1-active);}else{moveSelect(8);}},hide:function(){element&&element.hide();listItems&&listItems.removeClass(CLASSES.ACTIVE);active=-1;},visible:function(){return element&&element.is(":visible");},current:function(){return this.visible()&&(listItems.filter("."+CLASSES.ACTIVE)[0]||options.selectFirst&&listItems[0]);},show:function(){var offset=$(input).offset();element.css({width:typeof options.width=="string"||options.width>0?options.width:$(input).width(),top:offset.top+input.offsetHeight,left:offset.left}).show();if(options.scroll){list.scrollTop(0);list.css({maxHeight:options.scrollHeight,overflow:'auto'});if($.browser.msie&&typeof document.body.style.maxHeight==="undefined"){var listHeight=0;listItems.each(function(){listHeight+=this.offsetHeight;});var scrollbarsVisible=listHeight>options.scrollHeight;list.css('height',scrollbarsVisible?options.scrollHeight:listHeight);if(!scrollbarsVisible){listItems.width(list.width()-parseInt(listItems.css("padding-left"))-parseInt(listItems.css("padding-right")));}}}},selected:function(){var selected=listItems&&listItems.filter("."+CLASSES.ACTIVE).removeClass(CLASSES.ACTIVE);return selected&&selected.length&&$.data(selected[0],"ac_data");},emptyList:function(){list&&list.empty();},unbind:function(){element&&element.remove();}};};$.fn.selection=function(start,end){if(start!==undefined){return this.each(function(){if(this.createTextRange){var selRange=this.createTextRange();if(end===undefined||start==end){selRange.move("character",start);selRange.select();}else{selRange.collapse(true);selRange.moveStart("character",start);selRange.moveEnd("character",end);selRange.select();}}else if(this.setSelectionRange){this.setSelectionRange(start,end);}else if(this.selectionStart){this.selectionStart=start;this.selectionEnd=end;}});}
 
145
var field=this[0];if(field.createTextRange){var range=document.selection.createRange(),orig=field.value,teststring="<->",textLength=range.text.length;range.text=teststring;var caretAt=field.value.indexOf(teststring);field.value=orig;this.selection(caretAt,caretAt+textLength);return{start:caretAt,end:caretAt+textLength}}else if(field.selectionStart!==undefined){return{start:field.selectionStart,end:field.selectionEnd}}};})(jQuery);(function($){$.extend($.ui,{datepicker:{version:"1.8.2"}});var PROP_NAME='datepicker';var dpuuid=new Date().getTime();function Datepicker(){this.debug=false;this._curInst=null;this._keyEvent=false;this._disabledInputs=[];this._datepickerShowing=false;this._inDialog=false;this._mainDivId='ui-datepicker-div';this._inlineClass='ui-datepicker-inline';this._appendClass='ui-datepicker-append';this._triggerClass='ui-datepicker-trigger';this._dialogClass='ui-datepicker-dialog';this._disableClass='ui-datepicker-disabled';this._unselectableClass='ui-datepicker-unselectable';this._currentClass='ui-datepicker-current-day';this._dayOverClass='ui-datepicker-days-cell-over';this.regional=[];this.regional['']={closeText:'Done',prevText:'Prev',nextText:'Next',currentText:'Today',monthNames:['January','February','March','April','May','June','July','August','September','October','November','December'],monthNamesShort:['Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec'],dayNames:['Sunday','Monday','Tuesday','Wednesday','Thursday','Friday','Saturday'],dayNamesShort:['Sun','Mon','Tue','Wed','Thu','Fri','Sat'],dayNamesMin:['Su','Mo','Tu','We','Th','Fr','Sa'],weekHeader:'Wk',dateFormat:'mm/dd/yy',firstDay:0,isRTL:false,showMonthAfterYear:false,yearSuffix:''};this._defaults={showOn:'focus',showAnim:'fadeIn',showOptions:{},defaultDate:null,appendText:'',buttonText:'...',buttonImage:'',buttonImageOnly:false,hideIfNoPrevNext:false,navigationAsDateFormat:false,gotoCurrent:false,changeMonth:false,changeYear:false,yearRange:'c-10:c+10',showOtherMonths:false,selectOtherMonths:false,showWeek:false,calculateWeek:this.iso8601Week,shortYearCutoff:'+10',minDate:null,maxDate:null,duration:'fast',beforeShowDay:null,beforeShow:null,onSelect:null,onChangeMonthYear:null,onClose:null,numberOfMonths:1,showCurrentAtPos:0,stepMonths:1,stepBigMonths:12,altField:'',altFormat:'',constrainInput:true,showButtonPanel:false,autoSize:false};$.extend(this._defaults,this.regional['']);this.dpDiv=$('<div id="'+this._mainDivId+'" class="ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all ui-helper-hidden-accessible"></div>');}
 
146
$.extend(Datepicker.prototype,{markerClassName:'hasDatepicker',log:function(){if(this.debug)
 
147
console.log.apply('',arguments);},_widgetDatepicker:function(){return this.dpDiv;},setDefaults:function(settings){extendRemove(this._defaults,settings||{});return this;},_attachDatepicker:function(target,settings){var inlineSettings=null;for(var attrName in this._defaults){var attrValue=target.getAttribute('date:'+attrName);if(attrValue){inlineSettings=inlineSettings||{};try{inlineSettings[attrName]=eval(attrValue);}catch(err){inlineSettings[attrName]=attrValue;}}}
 
148
var nodeName=target.nodeName.toLowerCase();var inline=(nodeName=='div'||nodeName=='span');if(!target.id){this.uuid+=1;target.id='dp'+this.uuid;}
 
149
var inst=this._newInst($(target),inline);inst.settings=$.extend({},settings||{},inlineSettings||{});if(nodeName=='input'){this._connectDatepicker(target,inst);}else if(inline){this._inlineDatepicker(target,inst);}},_newInst:function(target,inline){var id=target[0].id.replace(/([^A-Za-z0-9_])/g,'\\\\$1');return{id:id,input:target,selectedDay:0,selectedMonth:0,selectedYear:0,drawMonth:0,drawYear:0,inline:inline,dpDiv:(!inline?this.dpDiv:$('<div class="'+this._inlineClass+' ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all"></div>'))};},_connectDatepicker:function(target,inst){var input=$(target);inst.append=$([]);inst.trigger=$([]);if(input.hasClass(this.markerClassName))
 
150
return;this._attachments(input,inst);input.addClass(this.markerClassName).keydown(this._doKeyDown).keypress(this._doKeyPress).keyup(this._doKeyUp).bind("setData.datepicker",function(event,key,value){inst.settings[key]=value;}).bind("getData.datepicker",function(event,key){return this._get(inst,key);});this._autoSize(inst);$.data(target,PROP_NAME,inst);},_attachments:function(input,inst){var appendText=this._get(inst,'appendText');var isRTL=this._get(inst,'isRTL');if(inst.append)
 
151
inst.append.remove();if(appendText){inst.append=$('<span class="'+this._appendClass+'">'+appendText+'</span>');input[isRTL?'before':'after'](inst.append);}
 
152
input.unbind('focus',this._showDatepicker);if(inst.trigger)
 
153
inst.trigger.remove();var showOn=this._get(inst,'showOn');if(showOn=='focus'||showOn=='both')
 
154
input.focus(this._showDatepicker);if(showOn=='button'||showOn=='both'){var buttonText=this._get(inst,'buttonText');var buttonImage=this._get(inst,'buttonImage');inst.trigger=$(this._get(inst,'buttonImageOnly')?$('<img/>').addClass(this._triggerClass).attr({src:buttonImage,alt:buttonText,title:buttonText}):$('<button type="button"></button>').addClass(this._triggerClass).html(buttonImage==''?buttonText:$('<img/>').attr({src:buttonImage,alt:buttonText,title:buttonText})));input[isRTL?'before':'after'](inst.trigger);inst.trigger.click(function(){if($.datepicker._datepickerShowing&&$.datepicker._lastInput==input[0])
 
155
$.datepicker._hideDatepicker();else
 
156
$.datepicker._showDatepicker(input[0]);return false;});}},_autoSize:function(inst){if(this._get(inst,'autoSize')&&!inst.inline){var date=new Date(2009,12-1,20);var dateFormat=this._get(inst,'dateFormat');if(dateFormat.match(/[DM]/)){var findMax=function(names){var max=0;var maxI=0;for(var i=0;i<names.length;i++){if(names[i].length>max){max=names[i].length;maxI=i;}}
 
157
return maxI;};date.setMonth(findMax(this._get(inst,(dateFormat.match(/MM/)?'monthNames':'monthNamesShort'))));date.setDate(findMax(this._get(inst,(dateFormat.match(/DD/)?'dayNames':'dayNamesShort')))+20-date.getDay());}
 
158
inst.input.attr('size',this._formatDate(inst,date).length);}},_inlineDatepicker:function(target,inst){var divSpan=$(target);if(divSpan.hasClass(this.markerClassName))
 
159
return;divSpan.addClass(this.markerClassName).append(inst.dpDiv).bind("setData.datepicker",function(event,key,value){inst.settings[key]=value;}).bind("getData.datepicker",function(event,key){return this._get(inst,key);});$.data(target,PROP_NAME,inst);this._setDate(inst,this._getDefaultDate(inst),true);this._updateDatepicker(inst);this._updateAlternate(inst);},_dialogDatepicker:function(input,date,onSelect,settings,pos){var inst=this._dialogInst;if(!inst){this.uuid+=1;var id='dp'+this.uuid;this._dialogInput=$('<input type="text" id="'+id+'" style="position: absolute; top: -100px; width: 0px; z-index: -10;"/>');this._dialogInput.keydown(this._doKeyDown);$('body').append(this._dialogInput);inst=this._dialogInst=this._newInst(this._dialogInput,false);inst.settings={};$.data(this._dialogInput[0],PROP_NAME,inst);}
 
160
extendRemove(inst.settings,settings||{});date=(date&&date.constructor==Date?this._formatDate(inst,date):date);this._dialogInput.val(date);this._pos=(pos?(pos.length?pos:[pos.pageX,pos.pageY]):null);if(!this._pos){var browserWidth=document.documentElement.clientWidth;var browserHeight=document.documentElement.clientHeight;var scrollX=document.documentElement.scrollLeft||document.body.scrollLeft;var scrollY=document.documentElement.scrollTop||document.body.scrollTop;this._pos=[(browserWidth/2)-100+scrollX,(browserHeight/2)-150+scrollY];}
 
161
this._dialogInput.css('left',(this._pos[0]+20)+'px').css('top',this._pos[1]+'px');inst.settings.onSelect=onSelect;this._inDialog=true;this.dpDiv.addClass(this._dialogClass);this._showDatepicker(this._dialogInput[0]);if($.blockUI)
 
162
$.blockUI(this.dpDiv);$.data(this._dialogInput[0],PROP_NAME,inst);return this;},_destroyDatepicker:function(target){var $target=$(target);var inst=$.data(target,PROP_NAME);if(!$target.hasClass(this.markerClassName)){return;}
 
163
var nodeName=target.nodeName.toLowerCase();$.removeData(target,PROP_NAME);if(nodeName=='input'){inst.append.remove();inst.trigger.remove();$target.removeClass(this.markerClassName).unbind('focus',this._showDatepicker).unbind('keydown',this._doKeyDown).unbind('keypress',this._doKeyPress).unbind('keyup',this._doKeyUp);}else if(nodeName=='div'||nodeName=='span')
 
164
$target.removeClass(this.markerClassName).empty();},_enableDatepicker:function(target){var $target=$(target);var inst=$.data(target,PROP_NAME);if(!$target.hasClass(this.markerClassName)){return;}
 
165
var nodeName=target.nodeName.toLowerCase();if(nodeName=='input'){target.disabled=false;inst.trigger.filter('button').each(function(){this.disabled=false;}).end().filter('img').css({opacity:'1.0',cursor:''});}
 
166
else if(nodeName=='div'||nodeName=='span'){var inline=$target.children('.'+this._inlineClass);inline.children().removeClass('ui-state-disabled');}
 
167
this._disabledInputs=$.map(this._disabledInputs,function(value){return(value==target?null:value);});},_disableDatepicker:function(target){var $target=$(target);var inst=$.data(target,PROP_NAME);if(!$target.hasClass(this.markerClassName)){return;}
 
168
var nodeName=target.nodeName.toLowerCase();if(nodeName=='input'){target.disabled=true;inst.trigger.filter('button').each(function(){this.disabled=true;}).end().filter('img').css({opacity:'0.5',cursor:'default'});}
 
169
else if(nodeName=='div'||nodeName=='span'){var inline=$target.children('.'+this._inlineClass);inline.children().addClass('ui-state-disabled');}
 
170
this._disabledInputs=$.map(this._disabledInputs,function(value){return(value==target?null:value);});this._disabledInputs[this._disabledInputs.length]=target;},_isDisabledDatepicker:function(target){if(!target){return false;}
 
171
for(var i=0;i<this._disabledInputs.length;i++){if(this._disabledInputs[i]==target)
 
172
return true;}
 
173
return false;},_getInst:function(target){try{return $.data(target,PROP_NAME);}
 
174
catch(err){throw'Missing instance data for this datepicker';}},_optionDatepicker:function(target,name,value){var inst=this._getInst(target);if(arguments.length==2&&typeof name=='string'){return(name=='defaults'?$.extend({},$.datepicker._defaults):(inst?(name=='all'?$.extend({},inst.settings):this._get(inst,name)):null));}
 
175
var settings=name||{};if(typeof name=='string'){settings={};settings[name]=value;}
 
176
if(inst){if(this._curInst==inst){this._hideDatepicker();}
 
177
var date=this._getDateDatepicker(target,true);extendRemove(inst.settings,settings);this._attachments($(target),inst);this._autoSize(inst);this._setDateDatepicker(target,date);this._updateDatepicker(inst);}},_changeDatepicker:function(target,name,value){this._optionDatepicker(target,name,value);},_refreshDatepicker:function(target){var inst=this._getInst(target);if(inst){this._updateDatepicker(inst);}},_setDateDatepicker:function(target,date){var inst=this._getInst(target);if(inst){this._setDate(inst,date);this._updateDatepicker(inst);this._updateAlternate(inst);}},_getDateDatepicker:function(target,noDefault){var inst=this._getInst(target);if(inst&&!inst.inline)
 
178
this._setDateFromField(inst,noDefault);return(inst?this._getDate(inst):null);},_doKeyDown:function(event){var inst=$.datepicker._getInst(event.target);var handled=true;var isRTL=inst.dpDiv.is('.ui-datepicker-rtl');inst._keyEvent=true;if($.datepicker._datepickerShowing)
 
179
switch(event.keyCode){case 9:$.datepicker._hideDatepicker();handled=false;break;case 13:var sel=$('td.'+$.datepicker._dayOverClass,inst.dpDiv).add($('td.'+$.datepicker._currentClass,inst.dpDiv));if(sel[0])
 
180
$.datepicker._selectDay(event.target,inst.selectedMonth,inst.selectedYear,sel[0]);else
 
181
$.datepicker._hideDatepicker();return false;break;case 27:$.datepicker._hideDatepicker();break;case 33:$.datepicker._adjustDate(event.target,(event.ctrlKey?-$.datepicker._get(inst,'stepBigMonths'):-$.datepicker._get(inst,'stepMonths')),'M');break;case 34:$.datepicker._adjustDate(event.target,(event.ctrlKey?+$.datepicker._get(inst,'stepBigMonths'):+$.datepicker._get(inst,'stepMonths')),'M');break;case 35:if(event.ctrlKey||event.metaKey)$.datepicker._clearDate(event.target);handled=event.ctrlKey||event.metaKey;break;case 36:if(event.ctrlKey||event.metaKey)$.datepicker._gotoToday(event.target);handled=event.ctrlKey||event.metaKey;break;case 37:if(event.ctrlKey||event.metaKey)$.datepicker._adjustDate(event.target,(isRTL?+1:-1),'D');handled=event.ctrlKey||event.metaKey;if(event.originalEvent.altKey)$.datepicker._adjustDate(event.target,(event.ctrlKey?-$.datepicker._get(inst,'stepBigMonths'):-$.datepicker._get(inst,'stepMonths')),'M');break;case 38:if(event.ctrlKey||event.metaKey)$.datepicker._adjustDate(event.target,-7,'D');handled=event.ctrlKey||event.metaKey;break;case 39:if(event.ctrlKey||event.metaKey)$.datepicker._adjustDate(event.target,(isRTL?-1:+1),'D');handled=event.ctrlKey||event.metaKey;if(event.originalEvent.altKey)$.datepicker._adjustDate(event.target,(event.ctrlKey?+$.datepicker._get(inst,'stepBigMonths'):+$.datepicker._get(inst,'stepMonths')),'M');break;case 40:if(event.ctrlKey||event.metaKey)$.datepicker._adjustDate(event.target,+7,'D');handled=event.ctrlKey||event.metaKey;break;default:handled=false;}
 
182
else if(event.keyCode==36&&event.ctrlKey)
 
183
$.datepicker._showDatepicker(this);else{handled=false;}
 
184
if(handled){event.preventDefault();event.stopPropagation();}},_doKeyPress:function(event){var inst=$.datepicker._getInst(event.target);if($.datepicker._get(inst,'constrainInput')){var chars=$.datepicker._possibleChars($.datepicker._get(inst,'dateFormat'));var chr=String.fromCharCode(event.charCode==undefined?event.keyCode:event.charCode);return event.ctrlKey||(chr<' '||!chars||chars.indexOf(chr)>-1);}},_doKeyUp:function(event){var inst=$.datepicker._getInst(event.target);if(inst.input.val()!=inst.lastVal){try{var date=$.datepicker.parseDate($.datepicker._get(inst,'dateFormat'),(inst.input?inst.input.val():null),$.datepicker._getFormatConfig(inst));if(date){$.datepicker._setDateFromField(inst);$.datepicker._updateAlternate(inst);$.datepicker._updateDatepicker(inst);}}
 
185
catch(event){$.datepicker.log(event);}}
 
186
return true;},_showDatepicker:function(input){input=input.target||input;if(input.nodeName.toLowerCase()!='input')
 
187
input=$('input',input.parentNode)[0];if($.datepicker._isDisabledDatepicker(input)||$.datepicker._lastInput==input)
 
188
return;var inst=$.datepicker._getInst(input);if($.datepicker._curInst&&$.datepicker._curInst!=inst){$.datepicker._curInst.dpDiv.stop(true,true);}
 
189
var beforeShow=$.datepicker._get(inst,'beforeShow');extendRemove(inst.settings,(beforeShow?beforeShow.apply(input,[input,inst]):{}));inst.lastVal=null;$.datepicker._lastInput=input;$.datepicker._setDateFromField(inst);if($.datepicker._inDialog)
 
190
input.value='';if(!$.datepicker._pos){$.datepicker._pos=$.datepicker._findPos(input);$.datepicker._pos[1]+=input.offsetHeight;}
 
191
var isFixed=false;$(input).parents().each(function(){isFixed|=$(this).css('position')=='fixed';return!isFixed;});if(isFixed&&$.browser.opera){$.datepicker._pos[0]-=document.documentElement.scrollLeft;$.datepicker._pos[1]-=document.documentElement.scrollTop;}
 
192
var offset={left:$.datepicker._pos[0],top:$.datepicker._pos[1]};$.datepicker._pos=null;inst.dpDiv.css({position:'absolute',display:'block',top:'-1000px'});$.datepicker._updateDatepicker(inst);offset=$.datepicker._checkOffset(inst,offset,isFixed);inst.dpDiv.css({position:($.datepicker._inDialog&&$.blockUI?'static':(isFixed?'fixed':'absolute')),display:'none',left:offset.left+'px',top:offset.top+'px'});if(!inst.inline){var showAnim=$.datepicker._get(inst,'showAnim');var duration=$.datepicker._get(inst,'duration');var postProcess=function(){$.datepicker._datepickerShowing=true;var borders=$.datepicker._getBorders(inst.dpDiv);inst.dpDiv.find('iframe.ui-datepicker-cover').css({left:-borders[0],top:-borders[1],width:inst.dpDiv.outerWidth(),height:inst.dpDiv.outerHeight()});};inst.dpDiv.zIndex($(input).zIndex()+1);if($.effects&&$.effects[showAnim])
 
193
inst.dpDiv.show(showAnim,$.datepicker._get(inst,'showOptions'),duration,postProcess);else
 
194
inst.dpDiv[showAnim||'show']((showAnim?duration:null),postProcess);if(!showAnim||!duration)
 
195
postProcess();if(inst.input.is(':visible')&&!inst.input.is(':disabled'))
 
196
inst.input.focus();$.datepicker._curInst=inst;}},_updateDatepicker:function(inst){var self=this;var borders=$.datepicker._getBorders(inst.dpDiv);inst.dpDiv.empty().append(this._generateHTML(inst)).find('iframe.ui-datepicker-cover').css({left:-borders[0],top:-borders[1],width:inst.dpDiv.outerWidth(),height:inst.dpDiv.outerHeight()}).end().find('button, .ui-datepicker-prev, .ui-datepicker-next, .ui-datepicker-calendar td a').bind('mouseout',function(){$(this).removeClass('ui-state-hover');if(this.className.indexOf('ui-datepicker-prev')!=-1)$(this).removeClass('ui-datepicker-prev-hover');if(this.className.indexOf('ui-datepicker-next')!=-1)$(this).removeClass('ui-datepicker-next-hover');}).bind('mouseover',function(){if(!self._isDisabledDatepicker(inst.inline?inst.dpDiv.parent()[0]:inst.input[0])){$(this).parents('.ui-datepicker-calendar').find('a').removeClass('ui-state-hover');$(this).addClass('ui-state-hover');if(this.className.indexOf('ui-datepicker-prev')!=-1)$(this).addClass('ui-datepicker-prev-hover');if(this.className.indexOf('ui-datepicker-next')!=-1)$(this).addClass('ui-datepicker-next-hover');}}).end().find('.'+this._dayOverClass+' a').trigger('mouseover').end();var numMonths=this._getNumberOfMonths(inst);var cols=numMonths[1];var width=17;if(cols>1)
 
197
inst.dpDiv.addClass('ui-datepicker-multi-'+cols).css('width',(width*cols)+'em');else
 
198
inst.dpDiv.removeClass('ui-datepicker-multi-2 ui-datepicker-multi-3 ui-datepicker-multi-4').width('');inst.dpDiv[(numMonths[0]!=1||numMonths[1]!=1?'add':'remove')+'Class']('ui-datepicker-multi');inst.dpDiv[(this._get(inst,'isRTL')?'add':'remove')+'Class']('ui-datepicker-rtl');if(inst==$.datepicker._curInst&&$.datepicker._datepickerShowing&&inst.input&&inst.input.is(':visible')&&!inst.input.is(':disabled'))
 
199
inst.input.focus();},_getBorders:function(elem){var convert=function(value){return{thin:1,medium:2,thick:3}[value]||value;};return[parseFloat(convert(elem.css('border-left-width'))),parseFloat(convert(elem.css('border-top-width')))];},_checkOffset:function(inst,offset,isFixed){var dpWidth=inst.dpDiv.outerWidth();var dpHeight=inst.dpDiv.outerHeight();var inputWidth=inst.input?inst.input.outerWidth():0;var inputHeight=inst.input?inst.input.outerHeight():0;var viewWidth=document.documentElement.clientWidth+$(document).scrollLeft();var viewHeight=document.documentElement.clientHeight+$(document).scrollTop();offset.left-=(this._get(inst,'isRTL')?(dpWidth-inputWidth):0);offset.left-=(isFixed&&offset.left==inst.input.offset().left)?$(document).scrollLeft():0;offset.top-=(isFixed&&offset.top==(inst.input.offset().top+inputHeight))?$(document).scrollTop():0;offset.left-=Math.min(offset.left,(offset.left+dpWidth>viewWidth&&viewWidth>dpWidth)?Math.abs(offset.left+dpWidth-viewWidth):0);offset.top-=Math.min(offset.top,(offset.top+dpHeight>viewHeight&&viewHeight>dpHeight)?Math.abs(dpHeight+inputHeight):0);return offset;},_findPos:function(obj){var inst=this._getInst(obj);var isRTL=this._get(inst,'isRTL');while(obj&&(obj.type=='hidden'||obj.nodeType!=1)){obj=obj[isRTL?'previousSibling':'nextSibling'];}
 
200
var position=$(obj).offset();return[position.left,position.top];},_hideDatepicker:function(input){var inst=this._curInst;if(!inst||(input&&inst!=$.data(input,PROP_NAME)))
 
201
return;if(this._datepickerShowing){var showAnim=this._get(inst,'showAnim');var duration=this._get(inst,'duration');var postProcess=function(){$.datepicker._tidyDialog(inst);this._curInst=null;};if($.effects&&$.effects[showAnim])
 
202
inst.dpDiv.hide(showAnim,$.datepicker._get(inst,'showOptions'),duration,postProcess);else
 
203
inst.dpDiv[(showAnim=='slideDown'?'slideUp':(showAnim=='fadeIn'?'fadeOut':'hide'))]((showAnim?duration:null),postProcess);if(!showAnim)
 
204
postProcess();var onClose=this._get(inst,'onClose');if(onClose)
 
205
onClose.apply((inst.input?inst.input[0]:null),[(inst.input?inst.input.val():''),inst]);this._datepickerShowing=false;this._lastInput=null;if(this._inDialog){this._dialogInput.css({position:'absolute',left:'0',top:'-100px'});if($.blockUI){$.unblockUI();$('body').append(this.dpDiv);}}
 
206
this._inDialog=false;}},_tidyDialog:function(inst){inst.dpDiv.removeClass(this._dialogClass).unbind('.ui-datepicker-calendar');},_checkExternalClick:function(event){if(!$.datepicker._curInst)
 
207
return;var $target=$(event.target);if($target[0].id!=$.datepicker._mainDivId&&$target.parents('#'+$.datepicker._mainDivId).length==0&&!$target.hasClass($.datepicker.markerClassName)&&!$target.hasClass($.datepicker._triggerClass)&&$.datepicker._datepickerShowing&&!($.datepicker._inDialog&&$.blockUI))
 
208
$.datepicker._hideDatepicker();},_adjustDate:function(id,offset,period){var target=$(id);var inst=this._getInst(target[0]);if(this._isDisabledDatepicker(target[0])){return;}
 
209
this._adjustInstDate(inst,offset+
 
210
(period=='M'?this._get(inst,'showCurrentAtPos'):0),period);this._updateDatepicker(inst);},_gotoToday:function(id){var target=$(id);var inst=this._getInst(target[0]);if(this._get(inst,'gotoCurrent')&&inst.currentDay){inst.selectedDay=inst.currentDay;inst.drawMonth=inst.selectedMonth=inst.currentMonth;inst.drawYear=inst.selectedYear=inst.currentYear;}
 
211
else{var date=new Date();inst.selectedDay=date.getDate();inst.drawMonth=inst.selectedMonth=date.getMonth();inst.drawYear=inst.selectedYear=date.getFullYear();}
 
212
this._notifyChange(inst);this._adjustDate(target);},_selectMonthYear:function(id,select,period){var target=$(id);var inst=this._getInst(target[0]);inst._selectingMonthYear=false;inst['selected'+(period=='M'?'Month':'Year')]=inst['draw'+(period=='M'?'Month':'Year')]=parseInt(select.options[select.selectedIndex].value,10);this._notifyChange(inst);this._adjustDate(target);},_clickMonthYear:function(id){var target=$(id);var inst=this._getInst(target[0]);if(inst.input&&inst._selectingMonthYear&&!$.browser.msie)
 
213
inst.input.focus();inst._selectingMonthYear=!inst._selectingMonthYear;},_selectDay:function(id,month,year,td){var target=$(id);if($(td).hasClass(this._unselectableClass)||this._isDisabledDatepicker(target[0])){return;}
 
214
var inst=this._getInst(target[0]);inst.selectedDay=inst.currentDay=$('a',td).html();inst.selectedMonth=inst.currentMonth=month;inst.selectedYear=inst.currentYear=year;this._selectDate(id,this._formatDate(inst,inst.currentDay,inst.currentMonth,inst.currentYear));},_clearDate:function(id){var target=$(id);var inst=this._getInst(target[0]);this._selectDate(target,'');},_selectDate:function(id,dateStr){var target=$(id);var inst=this._getInst(target[0]);dateStr=(dateStr!=null?dateStr:this._formatDate(inst));if(inst.input)
 
215
inst.input.val(dateStr);this._updateAlternate(inst);var onSelect=this._get(inst,'onSelect');if(onSelect)
 
216
onSelect.apply((inst.input?inst.input[0]:null),[dateStr,inst]);else if(inst.input)
 
217
inst.input.trigger('change');if(inst.inline)
 
218
this._updateDatepicker(inst);else{this._hideDatepicker();this._lastInput=inst.input[0];if(typeof(inst.input[0])!='object')
 
219
inst.input.focus();this._lastInput=null;}},_updateAlternate:function(inst){var altField=this._get(inst,'altField');if(altField){var altFormat=this._get(inst,'altFormat')||this._get(inst,'dateFormat');var date=this._getDate(inst);var dateStr=this.formatDate(altFormat,date,this._getFormatConfig(inst));$(altField).each(function(){$(this).val(dateStr);});}},noWeekends:function(date){var day=date.getDay();return[(day>0&&day<6),''];},iso8601Week:function(date){var checkDate=new Date(date.getTime());checkDate.setDate(checkDate.getDate()+4-(checkDate.getDay()||7));var time=checkDate.getTime();checkDate.setMonth(0);checkDate.setDate(1);return Math.floor(Math.round((time-checkDate)/86400000)/7)+1;},parseDate:function(format,value,settings){if(format==null||value==null)
 
220
throw'Invalid arguments';value=(typeof value=='object'?value.toString():value+'');if(value=='')
 
221
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 doy=-1;var literal=false;var lookAhead=function(match){var matches=(iFormat+1<format.length&&format.charAt(iFormat+1)==match);if(matches)
 
222
iFormat++;return matches;};var getNumber=function(match){lookAhead(match);var size=(match=='@'?14:(match=='!'?20:(match=='y'?4:(match=='o'?3:2))));var digits=new RegExp('^\\d{1,'+size+'}');var num=value.substring(iValue).match(digits);if(!num)
 
223
throw'Missing number at position '+iValue;iValue+=num[0].length;return parseInt(num[0],10);};var getName=function(match,shortNames,longNames){var names=(lookAhead(match)?longNames:shortNames);for(var i=0;i<names.length;i++){if(value.substr(iValue,names[i].length)==names[i]){iValue+=names[i].length;return i+1;}}
 
224
throw'Unknown name at position '+iValue;};var checkLiteral=function(){if(value.charAt(iValue)!=format.charAt(iFormat))
 
225
throw'Unexpected literal at position '+iValue;iValue++;};var iValue=0;for(var iFormat=0;iFormat<format.length;iFormat++){if(literal)
 
226
if(format.charAt(iFormat)=="'"&&!lookAhead("'"))
 
227
literal=false;else
 
228
checkLiteral();else
 
229
switch(format.charAt(iFormat)){case'd':day=getNumber('d');break;case'D':getName('D',dayNamesShort,dayNames);break;case'o':doy=getNumber('o');break;case'm':month=getNumber('m');break;case'M':month=getName('M',monthNamesShort,monthNames);break;case'y':year=getNumber('y');break;case'@':var date=new Date(getNumber('@'));year=date.getFullYear();month=date.getMonth()+1;day=date.getDate();break;case'!':var date=new Date((getNumber('!')-this._ticksTo1970)/10000);year=date.getFullYear();month=date.getMonth()+1;day=date.getDate();break;case"'":if(lookAhead("'"))
 
230
checkLiteral();else
 
231
literal=true;break;default:checkLiteral();}}
 
232
if(year==-1)
 
233
year=new Date().getFullYear();else if(year<100)
 
234
year+=new Date().getFullYear()-new Date().getFullYear()%100+
 
235
(year<=shortYearCutoff?0:-100);if(doy>-1){month=1;day=doy;do{var dim=this._getDaysInMonth(year,month-1);if(day<=dim)
 
236
break;month++;day-=dim;}while(true);}
 
237
var date=this._daylightSavingAdjust(new Date(year,month-1,day));if(date.getFullYear()!=year||date.getMonth()+1!=month||date.getDate()!=day)
 
238
throw'Invalid date';return date;},ATOM:'yy-mm-dd',COOKIE:'D, dd M yy',ISO_8601:'yy-mm-dd',RFC_822:'D, d M y',RFC_850:'DD, dd-M-y',RFC_1036:'D, d M y',RFC_1123:'D, d M yy',RFC_2822:'D, d M yy',RSS:'D, d M y',TICKS:'!',TIMESTAMP:'@',W3C:'yy-mm-dd',_ticksTo1970:(((1970-1)*365+Math.floor(1970/4)-Math.floor(1970/100)+
 
239
Math.floor(1970/400))*24*60*60*10000000),formatDate:function(format,date,settings){if(!date)
 
240
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)
 
241
iFormat++;return matches;};var formatNumber=function(match,value,len){var num=''+value;if(lookAhead(match))
 
242
while(num.length<len)
 
243
num='0'+num;return num;};var formatName=function(match,value,shortNames,longNames){return(lookAhead(match)?longNames[value]:shortNames[value]);};var output='';var literal=false;if(date)
 
244
for(var iFormat=0;iFormat<format.length;iFormat++){if(literal)
 
245
if(format.charAt(iFormat)=="'"&&!lookAhead("'"))
 
246
literal=false;else
 
247
output+=format.charAt(iFormat);else
 
248
switch(format.charAt(iFormat)){case'd':output+=formatNumber('d',date.getDate(),2);break;case'D':output+=formatName('D',date.getDay(),dayNamesShort,dayNames);break;case'o':output+=formatNumber('o',(date.getTime()-new Date(date.getFullYear(),0,0).getTime())/86400000,3);break;case'm':output+=formatNumber('m',date.getMonth()+1,2);break;case'M':output+=formatName('M',date.getMonth(),monthNamesShort,monthNames);break;case'y':output+=(lookAhead('y')?date.getFullYear():(date.getYear()%100<10?'0':'')+date.getYear()%100);break;case'@':output+=date.getTime();break;case'!':output+=date.getTime()*10000+this._ticksTo1970;break;case"'":if(lookAhead("'"))
 
249
output+="'";else
 
250
literal=true;break;default:output+=format.charAt(iFormat);}}
 
251
return output;},_possibleChars:function(format){var chars='';var literal=false;var lookAhead=function(match){var matches=(iFormat+1<format.length&&format.charAt(iFormat+1)==match);if(matches)
 
252
iFormat++;return matches;};for(var iFormat=0;iFormat<format.length;iFormat++)
 
253
if(literal)
 
254
if(format.charAt(iFormat)=="'"&&!lookAhead("'"))
 
255
literal=false;else
 
256
chars+=format.charAt(iFormat);else
 
257
switch(format.charAt(iFormat)){case'd':case'm':case'y':case'@':chars+='0123456789';break;case'D':case'M':return null;case"'":if(lookAhead("'"))
 
258
chars+="'";else
 
259
literal=true;break;default:chars+=format.charAt(iFormat);}
 
260
return chars;},_get:function(inst,name){return inst.settings[name]!==undefined?inst.settings[name]:this._defaults[name];},_setDateFromField:function(inst,noDefault){if(inst.input.val()==inst.lastVal){return;}
 
261
var dateFormat=this._get(inst,'dateFormat');var dates=inst.lastVal=inst.input?inst.input.val():null;var date,defaultDate;date=defaultDate=this._getDefaultDate(inst);var settings=this._getFormatConfig(inst);try{date=this.parseDate(dateFormat,dates,settings)||defaultDate;}catch(event){this.log(event);dates=(noDefault?'':dates);}
 
262
inst.selectedDay=date.getDate();inst.drawMonth=inst.selectedMonth=date.getMonth();inst.drawYear=inst.selectedYear=date.getFullYear();inst.currentDay=(dates?date.getDate():0);inst.currentMonth=(dates?date.getMonth():0);inst.currentYear=(dates?date.getFullYear():0);this._adjustInstDate(inst);},_getDefaultDate:function(inst){return this._restrictMinMax(inst,this._determineDate(inst,this._get(inst,'defaultDate'),new Date()));},_determineDate:function(inst,date,defaultDate){var offsetNumeric=function(offset){var date=new Date();date.setDate(date.getDate()+offset);return date;};var offsetString=function(offset){try{return $.datepicker.parseDate($.datepicker._get(inst,'dateFormat'),offset,$.datepicker._getFormatConfig(inst));}
 
263
catch(e){}
 
264
var date=(offset.toLowerCase().match(/^c/)?$.datepicker._getDate(inst):null)||new Date();var year=date.getFullYear();var month=date.getMonth();var day=date.getDate();var pattern=/([+-]?[0-9]+)\s*(d|D|w|W|m|M|y|Y)?/g;var matches=pattern.exec(offset);while(matches){switch(matches[2]||'d'){case'd':case'D':day+=parseInt(matches[1],10);break;case'w':case'W':day+=parseInt(matches[1],10)*7;break;case'm':case'M':month+=parseInt(matches[1],10);day=Math.min(day,$.datepicker._getDaysInMonth(year,month));break;case'y':case'Y':year+=parseInt(matches[1],10);day=Math.min(day,$.datepicker._getDaysInMonth(year,month));break;}
 
265
matches=pattern.exec(offset);}
 
266
return new Date(year,month,day);};date=(date==null?defaultDate:(typeof date=='string'?offsetString(date):(typeof date=='number'?(isNaN(date)?defaultDate:offsetNumeric(date)):date)));date=(date&&date.toString()=='Invalid Date'?defaultDate:date);if(date){date.setHours(0);date.setMinutes(0);date.setSeconds(0);date.setMilliseconds(0);}
 
267
return this._daylightSavingAdjust(date);},_daylightSavingAdjust:function(date){if(!date)return null;date.setHours(date.getHours()>12?date.getHours()+2:0);return date;},_setDate:function(inst,date,noChange){var clear=!(date);var origMonth=inst.selectedMonth;var origYear=inst.selectedYear;date=this._restrictMinMax(inst,this._determineDate(inst,date,new Date()));inst.selectedDay=inst.currentDay=date.getDate();inst.drawMonth=inst.selectedMonth=inst.currentMonth=date.getMonth();inst.drawYear=inst.selectedYear=inst.currentYear=date.getFullYear();if((origMonth!=inst.selectedMonth||origYear!=inst.selectedYear)&&!noChange)
 
268
this._notifyChange(inst);this._adjustInstDate(inst);if(inst.input){inst.input.val(clear?'':this._formatDate(inst));}},_getDate:function(inst){var startDate=(!inst.currentYear||(inst.input&&inst.input.val()=='')?null:this._daylightSavingAdjust(new Date(inst.currentYear,inst.currentMonth,inst.currentDay)));return startDate;},_generateHTML:function(inst){var today=new Date();today=this._daylightSavingAdjust(new Date(today.getFullYear(),today.getMonth(),today.getDate()));var isRTL=this._get(inst,'isRTL');var showButtonPanel=this._get(inst,'showButtonPanel');var hideIfNoPrevNext=this._get(inst,'hideIfNoPrevNext');var navigationAsDateFormat=this._get(inst,'navigationAsDateFormat');var numMonths=this._getNumberOfMonths(inst);var showCurrentAtPos=this._get(inst,'showCurrentAtPos');var stepMonths=this._get(inst,'stepMonths');var isMultiMonth=(numMonths[0]!=1||numMonths[1]!=1);var currentDate=this._daylightSavingAdjust((!inst.currentDay?new Date(9999,9,9):new Date(inst.currentYear,inst.currentMonth,inst.currentDay)));var minDate=this._getMinMaxDate(inst,'min');var maxDate=this._getMinMaxDate(inst,'max');var drawMonth=inst.drawMonth-showCurrentAtPos;var drawYear=inst.drawYear;if(drawMonth<0){drawMonth+=12;drawYear--;}
 
269
if(maxDate){var maxDraw=this._daylightSavingAdjust(new Date(maxDate.getFullYear(),maxDate.getMonth()-(numMonths[0]*numMonths[1])+1,maxDate.getDate()));maxDraw=(minDate&&maxDraw<minDate?minDate:maxDraw);while(this._daylightSavingAdjust(new Date(drawYear,drawMonth,1))>maxDraw){drawMonth--;if(drawMonth<0){drawMonth=11;drawYear--;}}}
 
270
inst.drawMonth=drawMonth;inst.drawYear=drawYear;var prevText=this._get(inst,'prevText');prevText=(!navigationAsDateFormat?prevText:this.formatDate(prevText,this._daylightSavingAdjust(new Date(drawYear,drawMonth-stepMonths,1)),this._getFormatConfig(inst)));var prev=(this._canAdjustMonth(inst,-1,drawYear,drawMonth)?'<a class="ui-datepicker-prev ui-corner-all" onclick="DP_jQuery_'+dpuuid+'.datepicker._adjustDate(\'#'+inst.id+'\', -'+stepMonths+', \'M\');"'+' title="'+prevText+'"><span class="ui-icon ui-icon-circle-triangle-'+(isRTL?'e':'w')+'">'+prevText+'</span></a>':(hideIfNoPrevNext?'':'<a class="ui-datepicker-prev ui-corner-all ui-state-disabled" title="'+prevText+'"><span class="ui-icon ui-icon-circle-triangle-'+(isRTL?'e':'w')+'">'+prevText+'</span></a>'));var nextText=this._get(inst,'nextText');nextText=(!navigationAsDateFormat?nextText:this.formatDate(nextText,this._daylightSavingAdjust(new Date(drawYear,drawMonth+stepMonths,1)),this._getFormatConfig(inst)));var next=(this._canAdjustMonth(inst,+1,drawYear,drawMonth)?'<a class="ui-datepicker-next ui-corner-all" onclick="DP_jQuery_'+dpuuid+'.datepicker._adjustDate(\'#'+inst.id+'\', +'+stepMonths+', \'M\');"'+' title="'+nextText+'"><span class="ui-icon ui-icon-circle-triangle-'+(isRTL?'w':'e')+'">'+nextText+'</span></a>':(hideIfNoPrevNext?'':'<a class="ui-datepicker-next ui-corner-all ui-state-disabled" title="'+nextText+'"><span class="ui-icon ui-icon-circle-triangle-'+(isRTL?'w':'e')+'">'+nextText+'</span></a>'));var currentText=this._get(inst,'currentText');var gotoDate=(this._get(inst,'gotoCurrent')&&inst.currentDay?currentDate:today);currentText=(!navigationAsDateFormat?currentText:this.formatDate(currentText,gotoDate,this._getFormatConfig(inst)));var controls=(!inst.inline?'<button type="button" class="ui-datepicker-close ui-state-default ui-priority-primary ui-corner-all" onclick="DP_jQuery_'+dpuuid+'.datepicker._hideDatepicker();">'+this._get(inst,'closeText')+'</button>':'');var buttonPanel=(showButtonPanel)?'<div class="ui-datepicker-buttonpane ui-widget-content">'+(isRTL?controls:'')+
 
271
(this._isInRange(inst,gotoDate)?'<button type="button" class="ui-datepicker-current ui-state-default ui-priority-secondary ui-corner-all" onclick="DP_jQuery_'+dpuuid+'.datepicker._gotoToday(\'#'+inst.id+'\');"'+'>'+currentText+'</button>':'')+(isRTL?'':controls)+'</div>':'';var firstDay=parseInt(this._get(inst,'firstDay'),10);firstDay=(isNaN(firstDay)?0:firstDay);var showWeek=this._get(inst,'showWeek');var dayNames=this._get(inst,'dayNames');var dayNamesShort=this._get(inst,'dayNamesShort');var dayNamesMin=this._get(inst,'dayNamesMin');var monthNames=this._get(inst,'monthNames');var monthNamesShort=this._get(inst,'monthNamesShort');var beforeShowDay=this._get(inst,'beforeShowDay');var showOtherMonths=this._get(inst,'showOtherMonths');var selectOtherMonths=this._get(inst,'selectOtherMonths');var calculateWeek=this._get(inst,'calculateWeek')||this.iso8601Week;var defaultDate=this._getDefaultDate(inst);var html='';for(var row=0;row<numMonths[0];row++){var group='';for(var col=0;col<numMonths[1];col++){var selectedDate=this._daylightSavingAdjust(new Date(drawYear,drawMonth,inst.selectedDay));var cornerClass=' ui-corner-all';var calender='';if(isMultiMonth){calender+='<div class="ui-datepicker-group';if(numMonths[1]>1)
 
272
switch(col){case 0:calender+=' ui-datepicker-group-first';cornerClass=' ui-corner-'+(isRTL?'right':'left');break;case numMonths[1]-1:calender+=' ui-datepicker-group-last';cornerClass=' ui-corner-'+(isRTL?'left':'right');break;default:calender+=' ui-datepicker-group-middle';cornerClass='';break;}
 
273
calender+='">';}
 
274
calender+='<div class="ui-datepicker-header ui-widget-header ui-helper-clearfix'+cornerClass+'">'+
 
275
(/all|left/.test(cornerClass)&&row==0?(isRTL?next:prev):'')+
 
276
(/all|right/.test(cornerClass)&&row==0?(isRTL?prev:next):'')+
 
277
this._generateMonthYearHeader(inst,drawMonth,drawYear,minDate,maxDate,row>0||col>0,monthNames,monthNamesShort)+'</div><table class="ui-datepicker-calendar"><thead>'+'<tr>';var thead=(showWeek?'<th class="ui-datepicker-week-col">'+this._get(inst,'weekHeader')+'</th>':'');for(var dow=0;dow<7;dow++){var day=(dow+firstDay)%7;thead+='<th'+((dow+firstDay+6)%7>=5?' class="ui-datepicker-week-end"':'')+'>'+'<span title="'+dayNames[day]+'">'+dayNamesMin[day]+'</span></th>';}
 
278
calender+=thead+'</tr></thead><tbody>';var daysInMonth=this._getDaysInMonth(drawYear,drawMonth);if(drawYear==inst.selectedYear&&drawMonth==inst.selectedMonth)
 
279
inst.selectedDay=Math.min(inst.selectedDay,daysInMonth);var leadDays=(this._getFirstDayOfMonth(drawYear,drawMonth)-firstDay+7)%7;var numRows=(isMultiMonth?6:Math.ceil((leadDays+daysInMonth)/7));var printDate=this._daylightSavingAdjust(new Date(drawYear,drawMonth,1-leadDays));for(var dRow=0;dRow<numRows;dRow++){calender+='<tr>';var tbody=(!showWeek?'':'<td class="ui-datepicker-week-col">'+
 
280
this._get(inst,'calculateWeek')(printDate)+'</td>');for(var dow=0;dow<7;dow++){var daySettings=(beforeShowDay?beforeShowDay.apply((inst.input?inst.input[0]:null),[printDate]):[true,'']);var otherMonth=(printDate.getMonth()!=drawMonth);var unselectable=(otherMonth&&!selectOtherMonths)||!daySettings[0]||(minDate&&printDate<minDate)||(maxDate&&printDate>maxDate);tbody+='<td class="'+
 
281
((dow+firstDay+6)%7>=5?' ui-datepicker-week-end':'')+
 
282
(otherMonth?' ui-datepicker-other-month':'')+
 
283
((printDate.getTime()==selectedDate.getTime()&&drawMonth==inst.selectedMonth&&inst._keyEvent)||(defaultDate.getTime()==printDate.getTime()&&defaultDate.getTime()==selectedDate.getTime())?' '+this._dayOverClass:'')+
 
284
(unselectable?' '+this._unselectableClass+' ui-state-disabled':'')+
 
285
(otherMonth&&!showOtherMonths?'':' '+daySettings[1]+
 
286
(printDate.getTime()==currentDate.getTime()?' '+this._currentClass:'')+
 
287
(printDate.getTime()==today.getTime()?' ui-datepicker-today':''))+'"'+
 
288
((!otherMonth||showOtherMonths)&&daySettings[2]?' title="'+daySettings[2]+'"':'')+
 
289
(unselectable?'':' onclick="DP_jQuery_'+dpuuid+'.datepicker._selectDay(\'#'+
 
290
inst.id+'\','+printDate.getMonth()+','+printDate.getFullYear()+', this);return false;"')+'>'+
 
291
(otherMonth&&!showOtherMonths?'&#xa0;':(unselectable?'<span class="ui-state-default">'+printDate.getDate()+'</span>':'<a class="ui-state-default'+
 
292
(printDate.getTime()==today.getTime()?' ui-state-highlight':'')+
 
293
(printDate.getTime()==currentDate.getTime()?' ui-state-active':'')+
 
294
(otherMonth?' ui-priority-secondary':'')+'" href="#">'+printDate.getDate()+'</a>'))+'</td>';printDate.setDate(printDate.getDate()+1);printDate=this._daylightSavingAdjust(printDate);}
 
295
calender+=tbody+'</tr>';}
 
296
drawMonth++;if(drawMonth>11){drawMonth=0;drawYear++;}
 
297
calender+='</tbody></table>'+(isMultiMonth?'</div>'+
 
298
((numMonths[0]>0&&col==numMonths[1]-1)?'<div class="ui-datepicker-row-break"></div>':''):'');group+=calender;}
 
299
html+=group;}
 
300
html+=buttonPanel+($.browser.msie&&parseInt($.browser.version,10)<7&&!inst.inline?'<iframe src="javascript:false;" class="ui-datepicker-cover" frameborder="0"></iframe>':'');inst._keyEvent=false;return html;},_generateMonthYearHeader:function(inst,drawMonth,drawYear,minDate,maxDate,secondary,monthNames,monthNamesShort){var changeMonth=this._get(inst,'changeMonth');var changeYear=this._get(inst,'changeYear');var showMonthAfterYear=this._get(inst,'showMonthAfterYear');var html='<div class="ui-datepicker-title">';var monthHtml='';if(secondary||!changeMonth)
 
301
monthHtml+='<span class="ui-datepicker-month">'+monthNames[drawMonth]+'</span>';else{var inMinYear=(minDate&&minDate.getFullYear()==drawYear);var inMaxYear=(maxDate&&maxDate.getFullYear()==drawYear);monthHtml+='<select class="ui-datepicker-month" '+'onchange="DP_jQuery_'+dpuuid+'.datepicker._selectMonthYear(\'#'+inst.id+'\', this, \'M\');" '+'onclick="DP_jQuery_'+dpuuid+'.datepicker._clickMonthYear(\'#'+inst.id+'\');"'+'>';for(var month=0;month<12;month++){if((!inMinYear||month>=minDate.getMonth())&&(!inMaxYear||month<=maxDate.getMonth()))
 
302
monthHtml+='<option value="'+month+'"'+
 
303
(month==drawMonth?' selected="selected"':'')+'>'+monthNamesShort[month]+'</option>';}
 
304
monthHtml+='</select>';}
 
305
if(!showMonthAfterYear)
 
306
html+=monthHtml+(secondary||!(changeMonth&&changeYear)?'&#xa0;':'');if(secondary||!changeYear)
 
307
html+='<span class="ui-datepicker-year">'+drawYear+'</span>';else{var years=this._get(inst,'yearRange').split(':');var thisYear=new Date().getFullYear();var determineYear=function(value){var year=(value.match(/c[+-].*/)?drawYear+parseInt(value.substring(1),10):(value.match(/[+-].*/)?thisYear+parseInt(value,10):parseInt(value,10)));return(isNaN(year)?thisYear:year);};var year=determineYear(years[0]);var endYear=Math.max(year,determineYear(years[1]||''));year=(minDate?Math.max(year,minDate.getFullYear()):year);endYear=(maxDate?Math.min(endYear,maxDate.getFullYear()):endYear);html+='<select class="ui-datepicker-year" '+'onchange="DP_jQuery_'+dpuuid+'.datepicker._selectMonthYear(\'#'+inst.id+'\', this, \'Y\');" '+'onclick="DP_jQuery_'+dpuuid+'.datepicker._clickMonthYear(\'#'+inst.id+'\');"'+'>';for(;year<=endYear;year++){html+='<option value="'+year+'"'+
 
308
(year==drawYear?' selected="selected"':'')+'>'+year+'</option>';}
 
309
html+='</select>';}
 
310
html+=this._get(inst,'yearSuffix');if(showMonthAfterYear)
 
311
html+=(secondary||!(changeMonth&&changeYear)?'&#xa0;':'')+monthHtml;html+='</div>';return html;},_adjustInstDate:function(inst,offset,period){var year=inst.drawYear+(period=='Y'?offset:0);var month=inst.drawMonth+(period=='M'?offset:0);var day=Math.min(inst.selectedDay,this._getDaysInMonth(year,month))+
 
312
(period=='D'?offset:0);var date=this._restrictMinMax(inst,this._daylightSavingAdjust(new Date(year,month,day)));inst.selectedDay=date.getDate();inst.drawMonth=inst.selectedMonth=date.getMonth();inst.drawYear=inst.selectedYear=date.getFullYear();if(period=='M'||period=='Y')
 
313
this._notifyChange(inst);},_restrictMinMax:function(inst,date){var minDate=this._getMinMaxDate(inst,'min');var maxDate=this._getMinMaxDate(inst,'max');date=(minDate&&date<minDate?minDate:date);date=(maxDate&&date>maxDate?maxDate:date);return date;},_notifyChange:function(inst){var onChange=this._get(inst,'onChangeMonthYear');if(onChange)
 
314
onChange.apply((inst.input?inst.input[0]:null),[inst.selectedYear,inst.selectedMonth+1,inst]);},_getNumberOfMonths:function(inst){var numMonths=this._get(inst,'numberOfMonths');return(numMonths==null?[1,1]:(typeof numMonths=='number'?[1,numMonths]:numMonths));},_getMinMaxDate:function(inst,minMax){return this._determineDate(inst,this._get(inst,minMax+'Date'),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(inst,offset,curYear,curMonth){var numMonths=this._getNumberOfMonths(inst);var date=this._daylightSavingAdjust(new Date(curYear,curMonth+(offset<0?offset:numMonths[0]*numMonths[1]),1));if(offset<0)
 
315
date.setDate(this._getDaysInMonth(date.getFullYear(),date.getMonth()));return this._isInRange(inst,date);},_isInRange:function(inst,date){var minDate=this._getMinMaxDate(inst,'min');var maxDate=this._getMinMaxDate(inst,'max');return((!minDate||date.getTime()>=minDate.getTime())&&(!maxDate||date.getTime()<=maxDate.getTime()));},_getFormatConfig:function(inst){var shortYearCutoff=this._get(inst,'shortYearCutoff');shortYearCutoff=(typeof shortYearCutoff!='string'?shortYearCutoff:new Date().getFullYear()%100+parseInt(shortYearCutoff,10));return{shortYearCutoff:shortYearCutoff,dayNamesShort:this._get(inst,'dayNamesShort'),dayNames:this._get(inst,'dayNames'),monthNamesShort:this._get(inst,'monthNamesShort'),monthNames:this._get(inst,'monthNames')};},_formatDate:function(inst,day,month,year){if(!day){inst.currentDay=inst.selectedDay;inst.currentMonth=inst.selectedMonth;inst.currentYear=inst.selectedYear;}
 
316
var date=(day?(typeof day=='object'?day:this._daylightSavingAdjust(new Date(year,month,day))):this._daylightSavingAdjust(new Date(inst.currentYear,inst.currentMonth,inst.currentDay)));return this.formatDate(this._get(inst,'dateFormat'),date,this._getFormatConfig(inst));}});function extendRemove(target,props){$.extend(target,props);for(var name in props)
 
317
if(props[name]==null||props[name]==undefined)
 
318
target[name]=props[name];return target;};function isArray(a){return(a&&(($.browser.safari&&typeof a=='object'&&a.length)||(a.constructor&&a.constructor.toString().match(/\Array\(\)/))));};$.fn.datepicker=function(options){if(!$.datepicker.initialized){$(document).mousedown($.datepicker._checkExternalClick).find('body').append($.datepicker.dpDiv);$.datepicker.initialized=true;}
 
319
var otherArgs=Array.prototype.slice.call(arguments,1);if(typeof options=='string'&&(options=='isDisabled'||options=='getDate'||options=='widget'))
 
320
return $.datepicker['_'+options+'Datepicker'].apply($.datepicker,[this[0]].concat(otherArgs));if(options=='option'&&arguments.length==2&&typeof arguments[1]=='string')
 
321
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();$.datepicker.initialized=false;$.datepicker.uuid=new Date().getTime();$.datepicker.version="1.8.2";window['DP_jQuery_'+dpuuid]=$;})(jQuery);function popup(url){newwindow=window.open(url,'name','height=400,width=600');if(window.focus)newwindow.focus();return false;}
 
322
function collapse(id){jQuery('#'+id).slideToggle();}
 
323
function fade(id,value){if(value>0)jQuery('#'+id).hide().fadeIn('slow');else jQuery('#'+id).show().fadeOut('slow');}
 
324
function ajax(u,s,t){query='';if(typeof s=="string"){d=jQuery(s).serialize();if(d){query=d;}}else{pcs=[];for(i=0;i<s.length;i++){q=jQuery("#"+s[i]).serialize();if(q){pcs.push(q);}}
 
325
if(pcs.length>0){query=pcs.join("&");}}
 
326
jQuery.ajax({type:"POST",url:u,data:query,success:function(msg){if(t){if(t==':eval')eval(msg);else jQuery("#"+t).html(msg);}}});}
 
327
String.prototype.reverse=function(){return this.split('').reverse().join('');};function web2py_ajax_init(){jQuery('.hidden').hide();jQuery('.error').hide().slideDown('slow');jQuery('.flash').click(function(){jQuery(this).fadeOut('slow');return false;});jQuery('input.string').attr('size',50);jQuery('textarea.text').attr('cols',50).attr('rows',10);jQuery('input.integer').keyup(function(){this.value=this.value.reverse().replace(/[^0-9\-]|\-(?=.)/g,'').reverse();});jQuery('input.double').keyup(function(){this.value=this.value.reverse().replace(/[^0-9\-\.]|[\-](?=.)|[\.](?=[0-9]*[\.])/g,'').reverse();});try{jQuery("input.time").clockpick({starthour:0,endhour:23,showminutes:true,military:true});}catch(e){};};jQuery(document).ready(function(){jQuery('.flash').hide().slideDown('slow')
 
328
if(jQuery('.flash').html()!='')jQuery('.flash').slideDown('slow');web2py_ajax_init();});function web2py_trap_form(action,target){jQuery('#'+target+' form').each(function(i){var form=jQuery(this);if(!form.hasClass('no_trap'))
 
329
form.submit(function(obj){jQuery('.flash').hide().html('');web2py_ajax_page('post',action,form.serialize(),target);return false;});});}
 
330
function web2py_ajax_page(method,action,data,target){jQuery.ajax({'type':method,'url':action,'data':data,'beforeSend':function(xhr){xhr.setRequestHeader('web2py-component-location',document.location);xhr.setRequestHeader('web2py-component-element',target);},'complete':function(xhr,text){command=xhr.getResponseHeader('web2py-component-command');if(command)eval(command);flash=xhr.getResponseHeader('web2py-component-flash');if(flash)jQuery('.flash').html(flash).slideDown();},'success':function(text){jQuery('#'+target).html(text);web2py_trap_form(action,target);web2py_ajax_init();}});}
 
331
function web2py_component(action,target){jQuery(document).ready(function(){web2py_ajax_page('get',action,null,target);});}
 
332
function s3_auto_widget_options(AutocompleteField)
 
333
{options={minChars:2,matchContains:true,dataType:'json',parse:function(data){var rows=new Array();for(var i=0;i<data.length;i++){rows[i]={data:data[i],value:data[i].id,result:data[i][AutocompleteField]};}
 
334
return rows;},formatItem:function(row,i,n){return row[AutocompleteField];}};return options;};function s3_auto_widget_result(event,data,formatted,AutoID,AutocompleteField,PopupURL)
 
335
{var NewJSON="{'id':'"+data.id+"'}";var selAutoJSON=$("#"+AutoID+"_auto_json");var selAutoEdit=$("#"+AutoID+"_auto_edit");var selAutoNewLabel=$("#"+AutoID+"_auto_new_label");selAutoJSON.val(NewJSON);selAutoNewLabel.hide();selAutoEdit.show();selAutoEdit.attr("href",PopupURL+"/"+data.id+"/update?format=popup"+"&auto_id="+AutoID+"&fields=['"+AutocompleteField+"']");};function s3_auto_widget_keypress(AutoID)
 
336
{var selAutoEdit=$("#"+AutoID+"_auto_edit");selAutoEdit.show();}
 
337
function s3_auto_widget_change(AutoID,AutocompleteField,ParseChars,PopupURL)
 
338
{var selAutoJSON=$("#"+AutoID+"_auto_json");var selAutoEdit=$("#"+AutoID+"_auto_edit");var selAutoNewLabel=$("#"+AutoID+"_auto_new_label");var AutoText=$("#"+AutoID+"_auto_text").val();if(AutoText!="")
 
339
{AutoText=AutoText.replace(/'/g,"\"");var NewJSON="{'"+AutocompleteField+"':'"+
 
340
AutoText+"'}";selAutoJSON.val(NewJSON);var strParseChars="";if(ParseChars)
 
341
{strParseChars="&parse_chars="+ParseChars;}
 
342
selAutoEdit.attr("href",PopupURL+"/create"+"?format=popup"+"&auto_id="+AutoID+"&fields=['"+AutocompleteField+"']"+"&auto_text_value="+AutoText+
 
343
strParseChars);selAutoEdit.show();selAutoNewLabel.show();}
 
344
else
 
345
{selAutoJSON.val("");selAutoEdit.hide();}};jQuery.fn.fancyZoom=function(O){var O=O||{};var L=O&&O.directory?O.directory:"images";var D=false;if($("#zoom").length==0){var E=$.browser.msie?"gif":"png";var J='<div id="zoom" style="display:none;">                   <table id="zoom_table" style="border-collapse:collapse; width:100%; height:100%;">                     <tbody>                       <tr>                         <td class="tl" style="background:url('+L+"/tl."+E+') 0 0 no-repeat; width:20px height:20px; overflow:hidden;" />                         <td class="tm" style="background:url('+L+"/tm."+E+') 0 0 repeat-x; height:20px; overflow:hidden;" />                         <td class="tr" style="background:url('+L+"/tr."+E+') 100% 0 no-repeat; width:20px height:20px; overflow:hidden;" />                       </tr>                       <tr>                         <td class="ml" style="background:url('+L+"/ml."+E+') 0 0 repeat-y; width:20px; overflow:hidden;" />                         <td class="mm" style="background:#fff; vertical-align:top; padding:10px;">                           <div id="zoom_content">                           </div>                         </td>                         <td class="mr" style="background:url('+L+"/mr."+E+') 100% 0 repeat-y;  width:20px; overflow:hidden;" />                       </tr>                       <tr>                         <td class="bl" style="background:url('+L+"/bl."+E+') 0 100% no-repeat; width:20px height:20px; overflow:hidden;" />                         <td class="bm" style="background:url('+L+"/bm."+E+') 0 100% repeat-x; height:20px; overflow:hidden;" />                         <td class="br" style="background:url('+L+"/br."+E+') 100% 100% no-repeat; width:20px height:20px; overflow:hidden;" />                       </tr>                     </tbody>                   </table>                   <a href="#" title="Close" id="zoom_close" style="position:absolute; top:0; left:0;">                     <img src="'+L+"/closebox."+E+'" alt="Close" style="border:none; margin:0; padding:0;" />                   </a>                 </div>';$("body").append(J);$("html").click(function(P){if($(P.target).parents("#zoom:visible").length==0){K()}});$(document).keyup(function(P){if(P.keyCode==27&&$("#zoom:visible").length>0){K()}});$("#zoom_close").click(K)}var N=$("#zoom");var I=$("#zoom_table");var H=$("#zoom_close");var G=$("#zoom_content");var A=$("td.ml,td.mm,td.mr");this.each(function(P){$($(this).attr("href")).hide();$(this).click(M)});return this;function M(V){if(D){return false}D=true;var P=$($(this).attr("href"));var T=O.width;var U=O.height;var Q=window.innerWidth||(window.document.documentElement.clientWidth||window.document.body.clientWidth);var b=window.innerHeight||(window.document.documentElement.clientHeight||window.document.body.clientHeight);var Z=window.pageXOffset||(window.document.documentElement.scrollLeft||window.document.body.scrollLeft);var Y=window.pageYOffset||(window.document.documentElement.scrollTop||window.document.body.scrollTop);var c={width:Q,height:b,x:Z,y:Y};var Q=(T||P.width())+60;var b=(U||P.height())+60;var W=c;var X=Math.max((W.height/2)-(b/2)+Y,0);var a=(W.width/2)-(Q/2);var R=V.pageY;var S=V.pageX;H.attr("curTop",R);H.attr("curLeft",S);H.attr("scaleImg",O.scaleImg?"true":"false");$("#zoom").hide().css({position:"absolute",top:R+"px",left:S+"px",width:"1px",height:"1px"});F();H.hide();if(O.closeOnClick){$("#zoom").click(K)}if(O.scaleImg){G.html(P.html());$("#zoom_content img").css("width","100%")}else{G.html("")}$("#zoom").animate({top:X+"px",left:a+"px",opacity:"show",width:Q,height:b},500,null,function(){if(O.scaleImg!=true){G.html(P.html())}C();H.show();D=false});return false}function K(){if(D){return false}D=true;$("#zoom").unbind("click");F();if(H.attr("scaleImg")!="true"){G.html("")}H.hide();$("#zoom").animate({top:H.attr("curTop")+"px",left:H.attr("curLeft")+"px",opacity:"hide",width:"1px",height:"1px"},500,null,function(){if(H.attr("scaleImg")=="true"){G.html("")}C();D=false});return false}function B(R){$("#zoom_table td").each(function(T){var S=$(this).css("background-image").replace(/\.(png|gif|none)\"\)$/,"."+R+'")');$(this).css("background-image",S)});var Q=H.children("img");var P=Q.attr("src").replace(/\.(png|gif|none)$/,"."+R);Q.attr("src",P)}function F(){if($.browser.msie&&parseFloat($.browser.version)>=7){B("gif")}}function C(){if($.browser.msie&&$.browser.version>=7){B("png")}}};$(document).ready(function(){$("div.label label[id!='delete_record__label']").append(":");});var popupWin=null;function openPopup(url){if(!popupWin||popupWin.closed){popupWin=window.open(url,"popupWin","width=640,height=480");}else popupWin.focus();}
 
346
$(document).ready(function(){$('.error').hide().slideDown('slow')
 
347
$('.error').click(function(){$(this).fadeOut('slow');return false;});$('.warning').hide().slideDown('slow')
 
348
$('.warning').click(function(){$(this).fadeOut('slow');return false;});$('.information').hide().slideDown('slow')
 
349
$('.information').click(function(){$(this).fadeOut('slow');return false;});$('.confirmation').hide().slideDown('slow')
 
350
$('.confirmation').click(function(){$(this).fadeOut('slow');return false;});$("input.date").datepicker({changeMonth:true,changeYear:true,dateFormat:'yy-mm-dd',isRTL:false});$('a.colorbox').click(function(){$(this).attr('href',function(){var url_in=$(this).attr('href');var caller=$(this).parents('tr').attr('id').replace(/__row/,'');var url_out=url_in;if(url_out.indexOf("&caller=")==-1){url_out=url_out+'&caller='+caller;}
 
351
return url_out;});return false;});$('.hoverable').hover(function(){$(this).addClass('hovered');},function(){$(this).removeClass('hovered');});$('#modulenav li').hover(function(){var header_width=$(this).width();var popup_width=$('ul',this).width();if(popup_width!=null){if(popup_width<header_width){$('ul',this).css({'width':header_width.toString()+'px'});}}
 
352
$('ul',this).css('display','block');},function(){$('ul',this).css('display','none');});$('#subnav li').hover(function(){var popup_width=$(this).width()-2;$('ul',this).css({'display':'block','width':popup_width.toString()+'px'});},function(){$('ul',this).css('display','none');});});(function($){jQuery.ajaxS3=function(s){var options=jQuery.extend({},jQuery.ajaxS3Settings,s);options.tryCount=0;showStatus(_ajaxS3_get_+' '+(s.message?s.message:_ajaxS3_fmd_)+'...',this.ajaxS3Settings.msgTimeout);options.success=function(data,status){hideStatus();if(s.success)
 
353
s.success(data,status);}
 
354
options.error=function(xhr,textStatus,errorThrown){if(textStatus=='timeout'){this.tryCount++;if(this.tryCount<=this.retryLimit){showStatus(_ajaxS3_get_+' '+(s.message?s.message:_ajaxS3_fmd_)+'... '+_ajaxS3_rtr_+' '+this.tryCount,$.ajaxS3Settings.msgTimeout);$.ajax(this);return;}
 
355
showStatus(_ajaxS3_wht_+' '+(this.retryLimit+1)+' '+_ajaxS3_gvn_,$.ajaxS3Settings.msgTimeout,false,true);return;}
 
356
if(xhr.status==500){showStatus(_ajaxS3_500_,$.ajaxS3Settings.msgTimeout,false,true);}else{showStatus(_ajaxS3_dwn_,$.ajaxS3Settings.msgTimeout,false,true);}};jQuery.ajax(options);};jQuery.postS3=function(url,data,callback,type){return jQuery.ajaxS3({type:"POST",url:url,data:data,success:callback,dataType:type});};jQuery.getS3=function(url,data,callback,type,message){if(jQuery.isFunction(data)){callback=data;data=null;}
 
357
return jQuery.ajaxS3({type:'GET',url:url,data:data,success:callback,dataType:type,message:message});};jQuery.getJSONS3=function(url,data,callback,message){if(jQuery.isFunction(data)){message=callback;callback=data;data=null;}
 
358
return jQuery.getS3(url,data,callback,'json',message);};jQuery.ajaxS3Settings={timeout:10000,msgTimeout:2000,retryLimit:10,dataType:'json',type:'GET'};jQuery.ajaxS3Setup=function(settings){jQuery.extend(jQuery.ajaxS3Settings,settings);};})(jQuery);function StatusBar(sel,options)
 
359
{var _I=this;var _sb=null;this.elementId="_showstatus";this.prependMultiline=true;this.showCloseButton=false;this.afterTimeoutText=null;this.cssClass="statusbar";this.highlightClass="statusbarhighlight";this.errorClass="statusbarerror";this.closeButtonClass="statusbarclose";this.additive=false;$.extend(this,options);if(sel)
 
360
_sb=$(sel);if(!_sb)
 
361
{_sb=$("<div id='_statusbar' class='"+_I.cssClass+"'>"+"<div class='"+_I.closeButtonClass+"'>"+
 
362
(_I.showCloseButton?" X </div></div>":"")).appendTo(document.body).show();}
 
363
$("."+_I.cssClass).click(function(e){$(_sb).hide();});this.show=function(message,timeout,additive,isError)
 
364
{if(additive||((additive==undefined)&&_I.additive))
 
365
{var html="<div style='margin-bottom: 2px;' >"+message+"</div>";if(_I.prependMultiline)
 
366
_sb.prepend(html);else
 
367
_sb.append(html);}
 
368
else
 
369
{if(!_I.showCloseButton)
 
370
_sb.text(message);else
 
371
{var t=_sb.find("div.statusbarclose");_sb.text(message).prepend(t);}}
 
372
_sb.show();if(timeout)
 
373
{if(isError)
 
374
_sb.addClass(_I.errorClass);else
 
375
_sb.addClass(_I.highlightClass);setTimeout(function(){_sb.removeClass(_I.highlightClass);if(_I.afterTimeoutText)
 
376
_I.show(_I.afterTimeoutText);},timeout);}}
 
377
this.release=function()
 
378
{if(_statusbar){$('#_statusbar').remove();_statusbar=undefined;}}}
 
379
var _statusbar=null;function showStatus(message,timeout,additive,isError)
 
380
{if(!_statusbar)
 
381
_statusbar=new StatusBar();_statusbar.show(message,timeout,additive,isError);}
 
382
function hideStatus()
 
383
{if(_statusbar)
 
384
_statusbar.release();}
 
 
b'\\ No newline at end of file'