/* Copyright Notice for Dynarch Date Time Picker */ /* Copyright Mihai Bazon, 2002-2005 | www.bazon.net/mishoo * ----------------------------------------------------------- * * The DHTML Calendar, version 1.0 "It is happening again" * * Details and latest version at: * www.dynarch.com/projects/calendar * * This script is developed by Dynarch.com. Visit us at www.dynarch.com. * * This script is distributed under the GNU Lesser General Public License. * Read the entire license text here: http://www.gnu.org/licenses/lgpl.html */ // Calendar EN language // Author: Mihai Bazon, // Encoding: any // Distributed under the same terms as the calendar itself. /* End Copyright Notice for Dynarch Date Time Picker */ /* ClockPick, by Josh Nathanson Version 1.2.4 Timepicker plugin for jQuery See copyright at end of file Complete documentation at http://www.oakcitygraphics.com/jquery/clockpick/trunk/ClockPick.cfm name clockpick type jQuery param options hash object containing config options param options[starthour] int starting hour (use military int) param options[endhour] int ending hour (use military int) param options[showminutes] bool show minutes param options[minutedivisions] int number of divisions, i.e. 4 = :00, :15, :30, :45 param options[military] bool use 24hr time if true param options[event] string mouse event to trigger plugin param options[layout] string set div layout to vertical or horizontal ('vertical','horizontal') param options[valuefield] string field to insert time value, if not same as click field (name of input field) param options[useBgiframe] bool set true if using bgIframe plugin param options[hoursopacity] float set opacity of hours container param options[minutesopacity] float set opacity of minutes container param callback function callback function - gets passed back the time value as a string */ /* Copyright Notice for jQuery Clockpick */ /* +-----------------------------------------------------------------------+ | Copyright (c) 2007 Josh Nathanson | | All rights reserved. | | | | Redistribution and use in source and binary forms, with or without | | modification, are permitted provided that the following conditions | | are met: | | | | o Redistributions of source code must retain the above copyright | | notice, this list of conditions and the following disclaimer. | | o Redistributions in binary form must reproduce the above copyright | | notice, this list of conditions and the following disclaimer in the | | documentation and/or other materials provided with the distribution.| | | | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS | | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT | | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR | | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT | | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | | | +-----------------------------------------------------------------------+ */ /* End Copyright Notice for jQuery Clockpick below */ 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 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=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="
"+A+"
";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("×",1,200).ttip=Calendar._TT.CLOSE}U=Calendar.createElement("tr",b);U.className="headrow";this._nav_py=f("«",1,-2);this._nav_py.ttip=Calendar._TT.PREV_YEAR;this._nav_pm=f("‹",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("›",1,1);this._nav_nm.ttip=Calendar._TT.NEXT_MONTH;this._nav_ny=f("»",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||" ";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=" "}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;c0;--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(++Uthis.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(0-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=" ";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)||(YW)||(b29)?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;Z31&&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=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(r,s){var u={starthour:8,endhour:18,showminutes:true,minutedivisions:4,military:false,event:'click',layout:'vertical',valuefield:null,useBgiframe:false,hoursopacity:1,minutesopacity:1};if(r){jQuery.extend(u,r)};var s=s||function(){},v=(u.layout=='vertical');errorcheck();jQuery(this)[u.event](function(e){var g=this,$self=jQuery(this),$body=jQuery("body");if(!u.valuefield){$self.unbind("keydown").bind("keydown",keyhandler)}else{var j=jQuery("[name="+u.valuefield+"]");j.unbind("keydown").bind("keydown",keyhandler)[0].focus();j.bind("click",function(){j.unbind("keydown")})}jQuery("#CP_hourcont,#CP_minutecont").remove();var k=jQuery("
").appendTo($body);!u.useBgiframe?k.css("opacity",u.hoursopacity):null;binder(k);var o=jQuery("
").appendTo($body);var p=jQuery("
").appendTo($body);if(u.showminutes){var q=jQuery("
").appendTo($body);!u.useBgiframe?q.css("opacity",u.minutesopacity):null;binder(q)}if(!v){k.css("width","auto");if(u.showminutes){q.css("width","auto")}}else{o.addClass('floatleft');p.addClass('floatleft')}renderhours();putcontainer();function renderhours(){var c=1;for(var h=u.starthour;h<=u.endhour;h++){if(h==12){c=1}var a=((!u.military&&h>12)?h-12:h);if(!u.military&&h==0){a='12'}if(u.military&&h<10){a='0'+a}var b=jQuery("
"+a+set_tt(h)+"
");if(u.military){b.width(20)}binder(b);if(!v){b.css("float","left")}(h<12)?o.append(b):p.append(b);c++}k.append(o);!v?k.append("
"):'';k.append(p)}function renderminutes(h){var a=h;var b=(!u.military&&h>12)?h-12:h;if(!u.military&&h==0){b='12'}if(u.military&&h<10){b='0'+b}q.empty();var n=60/u.minutedivisions,tt=set_tt(a),counter=1;for(var m=0;m<60;m=m+n){$md=jQuery("
"+b+":"+((m<10)?"0":"")+m+tt+"
");if(!v){$md.css("float","left");if(u.minutedivisions>6&&counter==u.minutedivisions/2+1){q.append("
")}}q.append($md);binder($md);counter++}}function set_tt(a){if(!u.military){return(a>=12)?' PM':' AM'}else{return''}}function putcontainer(){if(e.type!='focus'){k.css("left",e.pageX-5+'px').css("top",e.pageY-(Math.floor(k.height()/2))+'px');rectify(k)}else{$self.after(k)}k.slideDown('fast');if(u.useBgiframe)bgi(k)}function rectify(a){var b=document.documentElement.clientHeight?document.documentElement.clientHeight:document.body.clientHeight;var c=document.documentElement.clientWidth?document.documentElement.clientWidth:document.body.clientWidth;var t=parseInt(a.css("top"));var l=parseInt(a.css("left"));var d=document.documentElement.scrollTop?document.documentElement.scrollTop:document.body.scrollTop;if(t<=d&&!a.is("#CP_minutecont")){a.css("top",d+10+'px')}else if(t+a.height()-d>b){a.css("top",d+b-a.height()-10+'px')}if(l<=0){a.css("left",'10px')}}function bgi(a){if(typeof jQuery.fn.bgIframe=='function')a.bgIframe();else alert('bgIframe plugin not loaded.')}function binder(a){if(a.attr("id")=='CP_hourcont'){a.mouseout(function(e){hourcont_out(e)})}else if(a.attr("id")=='CP_minutecont'){a.mouseout(function(e){minutecont_out(e)})}else if(a.attr("class")=='CP_hour'){a.mouseover(function(e){hourdiv_over(a,e)});a.mouseout(function(){hourdiv_out(a)});a.click(function(){hourdiv_click(a)})}else if(a.attr("class")=='CP_minute'){a.mouseover(function(){minutediv_over(a)});a.mouseout(function(){minutediv_out(a)});a.click(function(){minutediv_click(a)})}};function hourcont_out(e){try{var t=(e.toElement)?e.toElement:e.relatedTarget;if(!(jQuery(t).is("div[class^=CP], iframe"))){cleardivs()}}catch(e){cleardivs()}}function minutecont_out(e){try{var t=(e.toElement)?e.toElement:e.relatedTarget;if(!(jQuery(t).is("div[class^=CP], iframe"))){cleardivs()}}catch(e){cleardivs()}}function hourdiv_over(a,e){var h=a.attr("id").split('_')[1],i=a.attr("id").split('_')[2],l,t;a.addClass("CP_over");if(u.showminutes){q.hide();renderminutes(h);if(v){t=e.type=='mouseover'?e.pageY-15:k.offset().top+2+(a.height()*i);if(h<12)l=k.offset().left-q.width()-2;else l=k.offset().left+k.width()+2}else{l=(e.type=='mouseover')?e.pageX-10:k.offset().left+(a.width()-5)*i;if(h<12){t=k.offset().top-q.height()-2}else{t=k.offset().top+k.height()}}q.css("left",l+'px').css("top",t+'px');rectify(q);q.show();if(u.useBgiframe)bgi(q)}return false}function hourdiv_out(a){a.removeClass("CP_over");return false}function hourdiv_click(a){var h=a.attr("id").split('_')[1],tt=set_tt(h),str=a.text();if(str.indexOf(' ')!=-1){var b=str.substring(0,str.indexOf(' '))}else{var b=str}a.text(b+':00'+tt);setval(a);cleardivs()}function minutediv_over(a){a.addClass("CP_over");return false}function minutediv_out(a){a.removeClass("CP_over");return false}function minutediv_click(a){setval(a);cleardivs()}function setval(a){if(!u.valuefield){g.value=a.text()}else{jQuery("input[name="+u.valuefield+"]").val(a.text())}s.apply($self,[a.text()]);$self.unbind("keydown",keyhandler)}function cleardivs(){if(u.showminutes){q.hide()}k.slideUp('fast');$self.unbind("keydown",keyhandler)}function keyhandler(e){var d=$("div.CP_over").size()?$("div.CP_over"):$("div.CP_hour:first"),divtype=d.is(".CP_hour")?'hour':'minute',hi=(divtype=='hour')?d[0].id.split('_')[2]:0,h=(divtype=='minute')?d[0].id.split('_')[0]:d[0].id.split('_')[1];if(divtype=='minute'){var f=h<12?'m1':'m2'}else{var f=h<12?'h1':'h2'}function divprev(a){if(a.prev().size()){eval(divtype+'div_out($obj)');eval(divtype+'div_over($obj.prev(), e)')}else{return false}}function divnext(a){if(a.next().size()){eval(divtype+'div_out($obj)');eval(divtype+'div_over($obj.next(), e)')}else{return false}}function hourtohour(a){var b=h>=12?'#hourcol1':'#hourcol2';$newobj=jQuery(".CP_hour[id$=_"+hi+"]",b);if($newobj.size()){hourdiv_out(a);hourdiv_over($newobj,e)}else{return false}}function hourtominute(a){hourdiv_out(a);minutediv_over($(".CP_minute:first"))}function minutetohour(a){minutediv_out(a);var b=h>=12?'#hourcol2':'#hourcol1';var c=jQuery(".CP_hour[id^=hr_"+h+"]",b);hourdiv_over(c,e)}switch(e.keyCode){case 37:if(v){switch(f){case'm1':return false;break;case'm2':minutetohour(d);break;case'h1':hourtominute(d);break;case'h2':hourtohour(d);break}}else{divprev(d)}break;case 38:if(v){divprev(d)}else{switch(f){case'm1':return false;break;case'm2':minutetohour(d);break;case'h1':hourtominute(d);break;case'h2':hourtohour(d);break}}break;case 39:if(v){switch(f){case'm1':minutetohour(d);break;case'm2':return false;break;case'h1':hourtohour(d);break;case'h2':hourtominute(d);break}}else{divnext(d)}break;case 40:if(v){divnext(d)}else{switch(f){case'm1':minutetohour(d);break;case'm2':return false;break;case'h1':hourtohour(d);break;case'h2':hourtominute(d);break}}break;case 13:eval(divtype+'div_click($obj)');break;default:return true}return false}return false});function errorcheck(){if(u.starthour>=u.endhour){alert('Error - start hour must be less than end hour.');return false}else if(60%u.minutedivisions!=0){alert('Error - param minutedivisions must divide evenly into 60.');return false}}return this}