var turnOffYearSpan=true;var weekStartsOnSunday=false;var showWeekNumber=true;var languageCode="en";var calendar_display_time=false;var todayStringFormat="[todayString] [UCFdayString]. [day]. [monthString] [year]";var pathToImages="/portal/images/js_calendar/";var speedOfSelectBoxSliding=200;var intervalSelectBox_minutes=5;var calendar_offsetTop=0;var calendar_offsetLeft=0;var calendarDiv=false;var MSIE=false;var Opera=false;if(navigator.userAgent.indexOf("MSIE")>=0&&navigator.userAgent.indexOf("Opera")<0){MSIE=true}if(navigator.userAgent.indexOf("Opera")>=0){Opera=true}switch(languageCode){case"en":var monthArray=["January","February","March","April","May","June","July","August","September","October","November","December"];var monthArrayShort=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];var dayArray=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"];var weekString="Week";var todayString="";break;case"ge":var monthArray=["Januar","Februar","Mo?=rz","April","Mai","Juni","Juli","August","September","Oktober","November","Dezember"];var monthArrayShort=["Jan","Feb","Mar","Apr","Mai","Jun","Jul","Aug","Sep","Okt","Nov","Dez"];var dayArray=["Mon","Die","Mit","Don","Fre","Sam","Son"];var weekString="Woche";var todayString="Heute";break;case"no":var monthArray=["Januar","Februar","Mars","April","Mai","Juni","Juli","August","September","Oktober","November","Desember"];var monthArrayShort=["Jan","Feb","Mar","Apr","Mai","Jun","Jul","Aug","Sep","Okt","Nov","Des"];var dayArray=["Man","Tir","Ons","Tor","Fre","L&oslash;r","S&oslash;n"];var weekString="Uke";var todayString="Dagen i dag er";break;case"nl":var monthArray=["Januari","Februari","Maart","April","Mei","Juni","Juli","Augustus","September","Oktober","November","December"];var monthArrayShort=["Jan","Feb","Mar","Apr","Mei","Jun","Jul","Aug","Sep","Okt","Nov","Dec"];var dayArray=["Ma","Di","Wo","Do","Vr","Za","Zo"];var weekString="Week";var todayString="Vandaag";break;case"es":var monthArray=["Enero","Febrero","Marzo","April","Mayo","Junio","Julio","Agosto","Septiembre","Octubre","Noviembre","Diciembre"];var monthArrayShort=["Ene","Feb","Mar","Abr","May","Jun","Jul","Ago","Sep","Oct","Nov","Dic"];var dayArray=["Lun","Mar","Mie","Jue","Vie","Sab","Dom"];var weekString="Semana";var todayString="Hoy es";break;case"pt-br":var monthArray=["Janeiro","Fevereiro","Mar&ccedil;o","Abril","Maio","Junho","Julho","Agosto","Setembro","Outubro","Novembro","Dezembro"];var monthArrayShort=["Jan","Fev","Mar","Abr","Mai","Jun","Jul","Ago","Set","Out","Nov","Dez"];var dayArray=["Seg","Ter","Qua","Qui","Sex","S&aacute;b","Dom"];var weekString="Sem.";var todayString="Hoje &eacute;";break;case"fr":var monthArray=["Janvier","Fo?=vrier","Mars","Avril","Mai","Juin","Juillet","Aoo?=t","Septembre","Octobre","Novembre","Do?=cembre"];var monthArrayShort=["Jan","Fev","Mar","Avr","Mai","Jun","Jul","Aou","Sep","Oct","Nov","Dec"];var dayArray=["Lun","Mar","Mer","Jeu","Ven","Sam","Dim"];var weekString="Sem";var todayString="Aujourd'hui";break;case"da":var monthArray=["januar","februar","marts","april","maj","juni","juli","august","september","oktober","november","december"];var monthArrayShort=["jan","feb","mar","apr","maj","jun","jul","aug","sep","okt","nov","dec"];var dayArray=["man","tirs","ons","tors","fre","l&oslash;r","s&oslash;n"];var weekString="Uge";var todayString="I dag er den";break;case"hu":var monthArray=["JanuC!r","FebruC!r","MC!rcius","o?=?prilis","MC!jus","JC:nius","JC:lius","Augusztus","Szeptember","OktC3ber","November","December"];var monthArrayShort=["Jan","Feb","MC!rc","o?=?pr","MC!j","JC:n","JC:l","Aug","Szep","Okt","Nov","Dec"];var dayArray=["HC)","Ke","Sze","Cs","PC)","Szo","Vas"];var weekString="HC)t";var todayString="Mai nap";break;case"it":var monthArray=["Gennaio","Febbraio","Marzo","Aprile","Maggio","Giugno","Luglio","Agosto","Settembre","Ottobre","Novembre","Dicembre"];var monthArrayShort=["Gen","Feb","Mar","Apr","Mag","Giu","Lugl","Ago","Set","Ott","Nov","Dic"];var dayArray=["Lun",";Mar","Mer","Gio","Ven","Sab","Dom"];var weekString="Settimana";var todayString="Oggi &egrave; il";break;case"sv":var monthArray=["Januari","Februari","Mars","April","Maj","Juni","Juli","Augusti","September","Oktober","November","December"];var monthArrayShort=["Jan","Feb","Mar","Apr","Maj","Jun","Jul","Aug","Sep","Okt","Nov","Dec"];var dayArray=["M&aring;n","Tis","Ons","Tor","Fre","L&ouml;r","S&ouml;n"];var weekString="Vecka";var todayString="Idag &auml;r det den";break;case"cz":var monthArray=["leden","&#250;nor","b&#345;ezen","duben","kv&#283;ten","&#269;erven","&#269;ervenec","srpen","z&#225;&#345;&#237;","&#345;&#237;jen","listopad","prosinec"];var monthArrayShort=["led","&#250;n","b&#345;","dub","kv&#283;","&#269;er","&#269;er-ec","srp","z&#225;&#345;","&#345;&#237;j","list","pros"];var dayArray=["Pon","&#218;t","St","&#268;t","P&#225;","So","Ne"];var weekString="t&#253;den";var todayString="";break}if(weekStartsOnSunday){var tempDayName=dayArray[6];for(var theIx=6;
theIx>0;theIx--){dayArray[theIx]=dayArray[theIx-1]}dayArray[0]=tempDayName}var daysInMonthArray=[31,28,31,30,31,30,31,31,30,31,30,31];var currentMonth;var currentYear;var currentHour;var currentMinute;var calendarContentDiv;var returnDateTo;var returnFormat;var activeSelectBoxMonth;var activeSelectBoxYear;var activeSelectBoxHour;var activeSelectBoxMinute;var iframeObj=false;var iframeObj2=false;function EIS_FIX_EI1(a){if(!iframeObj2){return}iframeObj2.style.display="block";iframeObj2.style.height=document.getElementById(a).offsetHeight+1;iframeObj2.style.width=document.getElementById(a).offsetWidth;iframeObj2.style.left=getleftPos(document.getElementById(a))+1-calendar_offsetLeft;iframeObj2.style.top=getTopPos(document.getElementById(a))-document.getElementById(a).offsetHeight-calendar_offsetTop}function EIS_Hide_Frame(){if(iframeObj2){iframeObj2.style.display="none"}}var returnDateToYear;var returnDateToMonth;var returnDateToDay;var returnDateToHour;var returnDateToMinute;var inputYear;var inputMonth;var inputDay;var inputHour;var inputMinute;var calendarDisplayTime=false;var selectBoxHighlightColor="#D60808";var selectBoxRolloverBgColor="#CFBEDC";var selectBoxMovementInProgress=false;var activeSelectBox=false;function cancelCalendarEvent(){return false}function isLeapYear(a){if(a%400==0||(a%4==0&&a%100!=0)){return true}return false}var activeSelectBoxMonth=false;var activeSelectBoxDirection=false;function highlightMonthYear(){if(activeSelectBoxMonth){activeSelectBoxMonth.className=""}activeSelectBox=this;if(this.className=="monthYearActive"){this.className=""}else{this.className="monthYearActive";activeSelectBoxMonth=this}if(this.innerHTML.indexOf("-")>=0||this.innerHTML.indexOf("+")>=0){if(this.className=="monthYearActive"){selectBoxMovementInProgress=true}else{selectBoxMovementInProgress=false}if(this.innerHTML.indexOf("-")>=0){activeSelectBoxDirection=-1}else{activeSelectBoxDirection=1}}else{selectBoxMovementInProgress=false}}function showMonthDropDown(){if(document.getElementById("monthDropDown").style.display=="block"){document.getElementById("monthDropDown").style.display="none";EIS_Hide_Frame()}else{document.getElementById("monthDropDown").style.display="block";document.getElementById("yearDropDown").style.display="none";document.getElementById("hourDropDown").style.display="none";document.getElementById("minuteDropDown").style.display="none";if(MSIE){EIS_FIX_EI1("monthDropDown")}}}function showYearDropDown(){if(document.getElementById("yearDropDown").style.display=="block"){document.getElementById("yearDropDown").style.display="none";EIS_Hide_Frame()}else{document.getElementById("yearDropDown").style.display="block";document.getElementById("monthDropDown").style.display="none";document.getElementById("hourDropDown").style.display="none";document.getElementById("minuteDropDown").style.display="none";if(MSIE){EIS_FIX_EI1("yearDropDown")}}}function showHourDropDown(){if(document.getElementById("hourDropDown").style.display=="block"){document.getElementById("hourDropDown").style.display="none";EIS_Hide_Frame()}else{document.getElementById("hourDropDown").style.display="block";document.getElementById("monthDropDown").style.display="none";document.getElementById("yearDropDown").style.display="none";document.getElementById("minuteDropDown").style.display="none";if(MSIE){EIS_FIX_EI1("hourDropDown")}}}function showMinuteDropDown(){if(document.getElementById("minuteDropDown").style.display=="block"){document.getElementById("minuteDropDown").style.display="none";EIS_Hide_Frame()}else{document.getElementById("minuteDropDown").style.display="block";document.getElementById("monthDropDown").style.display="none";document.getElementById("yearDropDown").style.display="none";document.getElementById("hourDropDown").style.display="none";if(MSIE){EIS_FIX_EI1("minuteDropDown")}}}function selectMonth(){document.getElementById("calendar_month_txt").innerHTML=this.innerHTML;currentMonth=this.id.replace(/[^\d]/g,"");document.getElementById("monthDropDown").style.display="none";EIS_Hide_Frame();for(var a=0;a<monthArray.length;a++){document.getElementById("monthDiv_"+a).style.color=""}this.style.color=selectBoxHighlightColor;activeSelectBoxMonth=this;writeCalendarContent()}function selectHour(){document.getElementById("calendar_hour_txt").innerHTML=this.innerHTML;currentHour=this.innerHTML.replace(/[^\d]/g,"");document.getElementById("hourDropDown").style.display="none";EIS_Hide_Frame();if(activeSelectBoxHour){activeSelectBoxHour.style.color=""}activeSelectBoxHour=this;this.style.color=selectBoxHighlightColor}function selectMinute(){document.getElementById("calendar_minute_txt").innerHTML=this.innerHTML;currentMinute=this.innerHTML.replace(/[^\d]/g,"");document.getElementById("minuteDropDown").style.display="none";EIS_Hide_Frame();if(activeSelectBoxMinute){activeSelectBoxMinute.style.color=""}activeSelectBoxMinute=this;this.style.color=selectBoxHighlightColor}function selectYear(){document.getElementById("calendar_year_txt").innerHTML=this.innerHTML;
currentYear=this.innerHTML.replace(/[^\d]/g,"");document.getElementById("yearDropDown").style.display="none";EIS_Hide_Frame();if(activeSelectBoxYear){activeSelectBoxYear.style.color=""}activeSelectBoxYear=this;this.style.color=selectBoxHighlightColor;writeCalendarContent()}function switchMonth(){if(this.src.indexOf("left")>=0){currentMonth=currentMonth-1;if(currentMonth<0){currentMonth=11;currentYear=currentYear-1}}else{currentMonth=currentMonth+1;if(currentMonth>11){currentMonth=0;currentYear=currentYear/1+1}}writeCalendarContent()}function createMonthDiv(){var c=document.createElement("DIV");c.className="monthYearPicker";c.id="monthPicker";for(var b=0;b<monthArray.length;b++){var a=document.createElement("DIV");a.innerHTML=monthArray[b];a.onmouseover=highlightMonthYear;a.onmouseout=highlightMonthYear;a.onclick=selectMonth;a.id="monthDiv_"+b;a.style.width="61px";a.onselectstart=cancelCalendarEvent;c.appendChild(a);if(currentMonth&&currentMonth==b){a.style.color=selectBoxHighlightColor;activeSelectBoxMonth=a}}return c}function changeSelectBoxYear(d,b){if(!b){b=this}var a=b.parentNode.getElementsByTagName("DIV");if(b.innerHTML.indexOf("-")>=0){var c=a[1].innerHTML/1-1;if(activeSelectBoxYear){activeSelectBoxYear.style.color=""}}else{var c=a[1].innerHTML/1+1;if(activeSelectBoxYear){activeSelectBoxYear.style.color=""}}for(var f=1;f<a.length-1;f++){a[f].innerHTML=c+f-1;a[f].id="yearDiv"+(c/1+f/1-1)}if(activeSelectBoxYear){activeSelectBoxYear.style.color="";if(document.getElementById("yearDiv"+currentYear)){activeSelectBoxYear=document.getElementById("yearDiv"+currentYear);activeSelectBoxYear.style.color=selectBoxHighlightColor}}}function changeSelectBoxHour(d,b){if(!b){b=this}var c=b.parentNode.getElementsByTagName("DIV");if(b.innerHTML.indexOf("-")>=0){var g=c[1].innerHTML/1-1;if(g<0){g=0}if(activeSelectBoxHour){activeSelectBoxHour.style.color=""}}else{var g=c[1].innerHTML/1+1;if(g>14){g=14}if(activeSelectBoxHour){activeSelectBoxHour.style.color=""}}var a="";for(var f=1;f<c.length-1;f++){if((g/1+f/1)<11){a="0"}else{a=""}c[f].innerHTML=a+(g+f-1);c[f].id="hourDiv"+(g/1+f/1-1)}if(activeSelectBoxHour){activeSelectBoxHour.style.color="";if(document.getElementById("hourDiv"+currentHour)){activeSelectBoxHour=document.getElementById("hourDiv"+currentHour);activeSelectBoxHour.style.color=selectBoxHighlightColor}}}function updateYearDiv(){var a=5;if(turnOffYearSpan){a=0}var d=document.getElementById("yearDropDown");var b=d.getElementsByTagName("DIV");for(var c=1;c<b.length-1;c++){b[c].innerHTML=currentYear/1-a+c;if(currentYear==(currentYear/1-a+c)){b[c].style.color=selectBoxHighlightColor;activeSelectBoxYear=b[c]}else{b[c].style.color=""}}}function updateMonthDiv(){for(no=0;no<12;no++){document.getElementById("monthDiv_"+no).style.color=""}document.getElementById("monthDiv_"+currentMonth).style.color=selectBoxHighlightColor;activeSelectBoxMonth=document.getElementById("monthDiv_"+currentMonth)}function updateHourDiv(){var e=document.getElementById("hourDropDown");var b=e.getElementsByTagName("DIV");var c=0;if((currentHour/1-6+1)<0){c=(currentHour/1-6+1)*-1}for(var d=1;d<b.length-1;d++){var a="";if((currentHour/1-6+d+c)<10){a="0"}b[d].innerHTML=a+(currentHour/1-6+d+c);if(currentHour==(currentHour/1-6+d)){b[d].style.color=selectBoxHighlightColor;activeSelectBoxHour=b[d]}else{b[d].style.color=""}}}function updateMinuteDiv(){for(no=0;no<60;no+=intervalSelectBox_minutes){var a="";if(no<10){a="0"}document.getElementById("minuteDiv_"+a+no).style.color=""}if(document.getElementById("minuteDiv_"+currentMinute)){document.getElementById("minuteDiv_"+currentMinute).style.color=selectBoxHighlightColor;activeSelectBoxMinute=document.getElementById("minuteDiv_"+currentMinute)}}function createYearDiv(){if(!document.getElementById("yearDropDown")){var h=document.createElement("DIV");h.className="monthYearPicker"}else{var h=document.getElementById("yearDropDown");var g=h.getElementsByTagName("DIV");for(var f=0;f<g.length;f++){g[f].parentNode.removeChild(g[f])}}var e=new Date();if(currentYear){e.setFullYear(currentYear)}var c=e.getFullYear()/1-5;var a=10;if(!turnOffYearSpan){var b=document.createElement("DIV");b.innerHTML="&nbsp;&nbsp;- ";b.onclick=changeSelectBoxYear;b.onmouseover=highlightMonthYear;b.onmouseout=function(){selectBoxMovementInProgress=false};b.onselectstart=cancelCalendarEvent;h.appendChild(b)}else{c=e.getFullYear()/1-0;a=2}for(var f=c;f<(c+a);f++){var b=document.createElement("DIV");b.innerHTML=f;b.onmouseover=highlightMonthYear;b.onmouseout=highlightMonthYear;b.onclick=selectYear;b.id="yearDiv"+f;b.onselectstart=cancelCalendarEvent;h.appendChild(b);if(currentYear&&currentYear==f){b.style.color=selectBoxHighlightColor;activeSelectBoxYear=b}}if(!turnOffYearSpan){var b=document.createElement("DIV");b.innerHTML="&nbsp;&nbsp;+ ";b.onclick=changeSelectBoxYear;b.onmouseover=highlightMonthYear;b.onmouseout=function(){selectBoxMovementInProgress=false};b.onselectstart=cancelCalendarEvent;h.appendChild(b)}return h}function slideCalendarSelectBox(){if(selectBoxMovementInProgress){if(activeSelectBox.parentNode.id=="hourDropDown"){changeSelectBoxHour(false,activeSelectBox)
}if(activeSelectBox.parentNode.id=="yearDropDown"){changeSelectBoxYear(false,activeSelectBox)}}setTimeout("slideCalendarSelectBox()",speedOfSelectBoxSliding)}function createHourDiv(){if(!document.getElementById("hourDropDown")){var f=document.createElement("DIV");f.className="monthYearPicker"}else{var f=document.getElementById("hourDropDown");var e=f.getElementsByTagName("DIV");for(var d=0;d<e.length;d++){e[d].parentNode.removeChild(e[d])}}if(!currentHour){currentHour=0}var c=currentHour/1;if(c>14){c=14}var b=document.createElement("DIV");b.innerHTML="&nbsp;&nbsp;- ";b.onclick=changeSelectBoxHour;b.onmouseover=highlightMonthYear;b.onmouseout=function(){selectBoxMovementInProgress=false};b.onselectstart=cancelCalendarEvent;f.appendChild(b);for(var d=c;d<c+10;d++){var a="";if(d/1<10){a="0"}var b=document.createElement("DIV");b.innerHTML=a+d;b.onmouseover=highlightMonthYear;b.onmouseout=highlightMonthYear;b.onclick=selectHour;b.id="hourDiv"+d;b.onselectstart=cancelCalendarEvent;f.appendChild(b);if(currentYear&&currentYear==d){b.style.color=selectBoxHighlightColor;activeSelectBoxYear=b}}var b=document.createElement("DIV");b.innerHTML="&nbsp;&nbsp;+ ";b.onclick=changeSelectBoxHour;b.onmouseover=highlightMonthYear;b.onmouseout=function(){selectBoxMovementInProgress=false};b.onselectstart=cancelCalendarEvent;f.appendChild(b);return f}function createMinuteDiv(){if(!document.getElementById("minuteDropDown")){var f=document.createElement("DIV");f.className="monthYearPicker"}else{var f=document.getElementById("minuteDropDown");var e=f.getElementsByTagName("DIV");for(var d=0;d<e.length;d++){e[d].parentNode.removeChild(e[d])}}var c=0;var a="";for(var d=c;d<60;d+=intervalSelectBox_minutes){if(d<10){a="0"}else{a=""}var b=document.createElement("DIV");b.innerHTML=a+d;b.onmouseover=highlightMonthYear;b.onmouseout=highlightMonthYear;b.onclick=selectMinute;b.id="minuteDiv_"+a+d;b.onselectstart=cancelCalendarEvent;f.appendChild(b);if(currentYear&&currentYear==d){b.style.color=selectBoxHighlightColor;activeSelectBoxYear=b}}return f}function highlightSelect(){if(this.className=="selectBoxTime"){this.className="selectBoxTimeOver";this.getElementsByTagName("IMG")[0].src=pathToImages+"down_time_over.gif"}else{if(this.className=="selectBoxTimeOver"){this.className="selectBoxTime";this.getElementsByTagName("IMG")[0].src=pathToImages+"down_time.gif"}}if(this.className=="selectBox"){this.className="selectBoxOver";this.getElementsByTagName("IMG")[0].src=pathToImages+"down_over.gif"}else{if(this.className=="selectBoxOver"){this.className="selectBox";this.getElementsByTagName("IMG")[0].src=pathToImages+"down.gif"}}}function highlightArrow(){if(this.src.indexOf("over")>=0){if(this.src.indexOf("left")>=0){this.src=pathToImages+"left.gif"}if(this.src.indexOf("right")>=0){this.src=pathToImages+"right.gif"}}else{if(this.src.indexOf("left")>=0){this.src=pathToImages+"left_over.gif"}if(this.src.indexOf("right")>=0){this.src=pathToImages+"right_over.gif"}}}function highlightClose(){if(this.src.indexOf("over")>=0){this.src=pathToImages+"close.gif"}else{this.src=pathToImages+"close_over.gif"}}function closeCalendar(){document.getElementById("yearDropDown").style.display="none";document.getElementById("monthDropDown").style.display="none";document.getElementById("hourDropDown").style.display="none";document.getElementById("minuteDropDown").style.display="none";calendarDiv.style.display="none";if(iframeObj){iframeObj.style.display="none";EIS_Hide_Frame()}if(activeSelectBoxMonth){activeSelectBoxMonth.className=""}if(activeSelectBoxYear){activeSelectBoxYear.className=""}}function writeTopBar(){var c=document.createElement("DIV");c.className="topBar";c.id="topBar";calendarDiv.appendChild(c);var g=document.createElement("DIV");g.style.marginRight="1px";var d=document.createElement("IMG");d.src=pathToImages+"left.gif";d.onmouseover=highlightArrow;d.onclick=switchMonth;d.onmouseout=highlightArrow;g.appendChild(d);c.appendChild(g);if(Opera){g.style.width="16px"}var h=document.createElement("DIV");h.style.marginRight="1px";var d=document.createElement("IMG");d.src=pathToImages+"right.gif";d.onclick=switchMonth;d.onmouseover=highlightArrow;d.onmouseout=highlightArrow;h.appendChild(d);if(Opera){h.style.width="16px"}c.appendChild(h);var f=document.createElement("DIV");f.id="monthSelect";f.onmouseover=highlightSelect;f.onmouseout=highlightSelect;f.onclick=showMonthDropDown;var i=document.createElement("SPAN");i.innerHTML=monthArray[currentMonth];i.id="calendar_month_txt";f.appendChild(i);var d=document.createElement("IMG");d.src=pathToImages+"down.gif";d.style.position="absolute";d.style.right="0px";f.appendChild(d);f.className="selectBox";if(Opera){d.style.cssText="float:right;position:relative";d.style.position="relative";d.style.styleFloat="right"}c.appendChild(f);var a=createMonthDiv();a.style.left="37px";a.style.top=f.offsetTop+f.offsetHeight+1+"px";a.style.width="65px";a.id="monthDropDown";calendarDiv.appendChild(a);var b=document.createElement("DIV");b.onmouseover=highlightSelect;
b.onmouseout=highlightSelect;b.onclick=showYearDropDown;var i=document.createElement("SPAN");i.innerHTML=currentYear;i.id="calendar_year_txt";b.appendChild(i);c.appendChild(b);var d=document.createElement("IMG");d.src=pathToImages+"down.gif";b.appendChild(d);b.className="selectBox";if(Opera){b.style.width="50px";d.style.cssText="float:right";d.style.position="relative";d.style.styleFloat="right"}var e=createYearDiv();e.style.left="113px";e.style.top=f.offsetTop+f.offsetHeight+1+"px";e.style.width="35px";e.id="yearDropDown";calendarDiv.appendChild(e);var d=document.createElement("IMG");d.src=pathToImages+"close.gif";d.style.styleFloat="right";d.onmouseover=highlightClose;d.onmouseout=highlightClose;d.onclick=closeCalendar;c.appendChild(d);if(!document.all){d.style.position="absolute";d.style.right="2px"}}function writeCalendarContent(){var f=true;if(!calendarContentDiv){calendarContentDiv=document.createElement("DIV");calendarDiv.appendChild(calendarContentDiv);f=false}currentMonth=currentMonth/1;var h=new Date();h.setFullYear(currentYear);h.setDate(1);h.setMonth(currentMonth);var e=h.getDay();if(!weekStartsOnSunday){if(e==0){e=7}e--}document.getElementById("calendar_year_txt").innerHTML=currentYear;document.getElementById("calendar_month_txt").innerHTML=monthArray[currentMonth];document.getElementById("calendar_hour_txt").innerHTML=currentHour/1>9?currentHour:"0"+currentHour;document.getElementById("calendar_minute_txt").innerHTML=currentMinute/1>9?currentMinute:"0"+currentMinute;var i=calendarContentDiv.getElementsByTagName("TABLE");if(i.length>0){calendarContentDiv.removeChild(i[0])}var c=document.createElement("TABLE");c.width="100%";c.cellSpacing="0";calendarContentDiv.appendChild(c);var g=document.createElement("TBODY");c.appendChild(g);var m=g.insertRow(-1);m.className="calendar_week_row";if(showWeekNumber){var j=m.insertCell(-1);j.innerHTML=weekString;j.className="calendar_week_column";j.style.backgroundColor=selectBoxRolloverBgColor}for(var k=0;k<dayArray.length;k++){var j=m.insertCell(-1);j.innerHTML=dayArray[k]}var m=g.insertRow(-1);if(showWeekNumber){var j=m.insertCell(-1);j.className="calendar_week_column";j.style.backgroundColor=selectBoxRolloverBgColor;var b=getWeek(currentYear,currentMonth,1);j.innerHTML=b}for(var k=0;k<e;k++){var j=m.insertCell(-1);j.innerHTML="&nbsp;"}var l=e;var a=daysInMonthArray[currentMonth];if(a==28){if(isLeapYear(currentYear)){a=29}}for(var k=1;k<=a;k++){h.setDate(k-1);if(l>0&&l%7==0){var m=g.insertRow(-1);if(showWeekNumber){var j=m.insertCell(-1);j.className="calendar_week_column";var b=getWeek(currentYear,currentMonth,k);j.innerHTML=b;j.style.backgroundColor=selectBoxRolloverBgColor}}var j=m.insertCell(-1);if(currentYear==inputYear&&currentMonth==inputMonth&&k==inputDay){j.className="activeDay"}j.innerHTML=k;j.onclick=pickDate;l++}if(!document.all){if(calendarContentDiv.offsetHeight){document.getElementById("topBar").style.top=calendarContentDiv.offsetHeight+document.getElementById("timeBar").offsetHeight+document.getElementById("topBar").offsetHeight-1+"px"}else{document.getElementById("topBar").style.top="";document.getElementById("topBar").style.bottom="0px"}}if(iframeObj){if(!f){setTimeout("resizeIframe()",350)}else{setTimeout("resizeIframe()",10)}}}function resizeIframe(){iframeObj.style.width=calendarDiv.offsetWidth+"px";iframeObj.style.height=calendarDiv.offsetHeight+"px"}function pickTodaysDate(){var a=new Date();currentMonth=a.getMonth();currentYear=a.getFullYear();pickDate(false,a.getDate())}function pickDate(f,d){var c=currentMonth/1+1;if(c<10){c="0"+c}var a;if(!d&&this){a=this.innerHTML}else{a=d}if(a/1<10){a="0"+a}if(returnFormat){returnFormat=returnFormat.replace("dd",a);returnFormat=returnFormat.replace("mm",c);returnFormat=returnFormat.replace("yyyy",currentYear);returnFormat=returnFormat.replace("hh",currentHour);returnFormat=returnFormat.replace("ii",currentMinute);returnFormat=returnFormat.replace("d",a/1);returnFormat=returnFormat.replace("m",c/1);returnDateTo.value=returnFormat;try{returnDateTo.onchange()}catch(f){}}else{for(var g=0;g<returnDateToYear.options.length;g++){if(returnDateToYear.options[g].value==currentYear){returnDateToYear.selectedIndex=g;break}}for(var g=0;g<returnDateToMonth.options.length;g++){if(returnDateToMonth.options[g].value==parseFloat(c)){returnDateToMonth.selectedIndex=g;break}}for(var g=0;g<returnDateToDay.options.length;g++){if(returnDateToDay.options[g].value==parseFloat(a)){returnDateToDay.selectedIndex=g;break}}if(calendarDisplayTime){for(var g=0;g<returnDateToHour.options.length;g++){if(returnDateToHour.options[g].value==parseFloat(currentHour)){returnDateToHour.selectedIndex=g;break}}for(var g=0;g<returnDateToMinute.options.length;g++){if(returnDateToMinute.options[g].value==parseFloat(currentMinute)){returnDateToMinute.selectedIndex=g;break}}}try{var b=/date-(.*?)-y/;b.exec(returnDateToYear.id);validateDateSelect(b.$1)}catch(f){}}closeCalendar()}function getWeek(f,d,g){if(!weekStartsOnSunday){g=(g/1)}else{g=(g/1)+1
}f=f/1;d=d/1+1;var j=Math.floor((14-(d))/12);var h=f+4800-j;var c=(d)+(12*j)-3;var i=g+Math.floor(((153*c)+2)/5)+(365*h)+Math.floor(h/4)-Math.floor(h/100)+Math.floor(h/400)-32045;var k=(i+31741-(i%7))%146097%36524%1461;var e=Math.floor(k/1460);var b=((k-e)%365)+e;NumberOfWeek=Math.floor(b/7)+1;return NumberOfWeek}function writeTimeBar(){var c=document.createElement("DIV");c.id="timeBar";c.className="timeBar";var f=document.createElement("DIV");f.innerHTML="Time:";var b=document.createElement("DIV");b.onmouseover=highlightSelect;b.onmouseout=highlightSelect;b.onclick=showHourDropDown;b.style.width="30px";var g=document.createElement("SPAN");g.innerHTML=currentHour;g.id="calendar_hour_txt";b.appendChild(g);c.appendChild(b);var d=document.createElement("IMG");d.src=pathToImages+"down_time.gif";b.appendChild(d);b.className="selectBoxTime";if(Opera){b.style.width="30px";d.style.cssText="float:right";d.style.position="relative";d.style.styleFloat="right"}var e=createHourDiv();e.style.left="130px";e.style.width="35px";e.id="hourDropDown";calendarDiv.appendChild(e);var h=document.createElement("DIV");h.onmouseover=highlightSelect;h.onmouseout=highlightSelect;h.onclick=showMinuteDropDown;h.style.width="30px";var g=document.createElement("SPAN");g.innerHTML=currentMinute;g.id="calendar_minute_txt";h.appendChild(g);c.appendChild(h);var d=document.createElement("IMG");d.src=pathToImages+"down_time.gif";h.appendChild(d);h.className="selectBoxTime";if(Opera){h.style.width="30px";d.style.cssText="float:right";d.style.position="relative";d.style.styleFloat="right"}var a=createMinuteDiv();a.style.left="167px";a.style.width="35px";a.id="minuteDropDown";calendarDiv.appendChild(a);return c}function writeBottomBar(){var g=new Date();var a=document.createElement("DIV");a.id="bottomBar";a.style.cursor="pointer";a.className="todaysDate";var c=document.createElement("DIV");c.onclick=pickTodaysDate;c.id="todaysDateString";c.style.width=(calendarDiv.offsetWidth-95)+"px";var b=g.getDay();if(!weekStartsOnSunday){if(b==0){b=7}b--}var e=todayStringFormat;e=e.replace("[monthString]",monthArrayShort[g.getMonth()]);e=e.replace("[day]",g.getDate());e=e.replace("[year]",g.getFullYear());e=e.replace("[dayString]",dayArray[b].toLowerCase());e=e.replace("[UCFdayString]",dayArray[b]);e=e.replace("[todayString]",todayString);c.innerHTML=todayString+": "+g.getDate()+". "+monthArrayShort[g.getMonth()]+", "+g.getFullYear();c.innerHTML=e;a.appendChild(c);var f=writeTimeBar();a.appendChild(f);calendarDiv.appendChild(a)}function getTopPos(b){var a=b.offsetTop+b.offsetHeight;while((b=b.offsetParent)!=null){a+=b.offsetTop}return a+calendar_offsetTop}function getleftPos(b){var a=b.offsetLeft;while((b=b.offsetParent)!=null){a+=b.offsetLeft}return a+calendar_offsetLeft}function positionCalendar(a){calendarDiv.style.left=getleftPos(a)+"px";calendarDiv.style.top=getTopPos(a)+"px";w=window.getCoordinates().width;cc=$(calendarDiv).getCoordinates();if((cc.left+cc.width)>w){$(calendarDiv).setStyle("left",w-(cc.width+5))}if(iframeObj){iframeObj.style.left=calendarDiv.style.left;iframeObj.style.top=calendarDiv.style.top;iframeObj2.style.left=calendarDiv.style.left;iframeObj2.style.top=calendarDiv.style.top}}function initCalendar(){if(MSIE){iframeObj=document.createElement("IFRAME");iframeObj.style.filter="alpha(opacity=0)";iframeObj.style.position="absolute";iframeObj.border="0px";iframeObj.style.border="0px";iframeObj.style.backgroundColor="#FF0000";iframeObj2=document.createElement("IFRAME");iframeObj2.style.position="absolute";iframeObj2.border="0px";iframeObj2.style.border="0px";iframeObj2.style.height="1px";iframeObj2.style.width="1px";iframeObj2.src="about:blank";iframeObj.src="about:blank";document.body.appendChild(iframeObj2);document.body.appendChild(iframeObj)}calendarDiv=document.createElement("DIV");calendarDiv.id="calendarDiv";calendarDiv.style.zIndex=1000;slideCalendarSelectBox();document.body.appendChild(calendarDiv);writeBottomBar();writeTopBar();if(!currentYear){var a=new Date();currentMonth=a.getMonth();currentYear=a.getFullYear()}writeCalendarContent()}function setTimeProperties(){if(!calendarDisplayTime){document.getElementById("timeBar").style.display="none";document.getElementById("timeBar").style.visibility="hidden";document.getElementById("todaysDateString").style.width="100%"}else{document.getElementById("timeBar").style.display="block";document.getElementById("timeBar").style.visibility="visible";document.getElementById("hourDropDown").style.top=document.getElementById("calendar_minute_txt").parentNode.offsetHeight+calendarContentDiv.offsetHeight+document.getElementById("topBar").offsetHeight+"px";document.getElementById("minuteDropDown").style.top=document.getElementById("calendar_minute_txt").parentNode.offsetHeight+calendarContentDiv.offsetHeight+document.getElementById("topBar").offsetHeight+"px";document.getElementById("minuteDropDown").style.right="50px";document.getElementById("hourDropDown").style.right="50px";document.getElementById("todaysDateString").style.width="115px"
}}function calendarSortItems(d,c){return d/1-c/1}function displayCalendar(f,r,c,s,b){if(s){calendarDisplayTime=true}else{calendarDisplayTime=false}if(f.value.length>6){if(!f.value.match(/^[0-9]*?$/gi)){var o=f.value.split(/[^0-9]/gi);var m=new Object();m.m=r.indexOf("mm");if(m.m==-1){m.m=r.indexOf("m")}m.d=r.indexOf("dd");if(m.d==-1){m.d=r.indexOf("d")}m.y=r.indexOf("yyyy");m.h=r.indexOf("hh");m.i=r.indexOf("ii");this.initialHour="00";this.initialMinute="00";var p=["y","m","d","h","i"];var a=["currentYear","currentMonth","inputDay","currentHour","currentMinute"];var l=[4,2,2,2,2];for(var j=0;j<p.length;j++){if(m[p[j]]>=0){window[a[j]]=f.value.substr(m[p[j]],l[j])/1}}currentMonth--}else{var q=r.indexOf("mm");currentMonth=f.value.substr(q,2)/1-1;var k=r.indexOf("yyyy");currentYear=f.value.substr(k,4);var g=r.indexOf("dd");tmpDay=f.value.substr(g,2);var h=r.indexOf("hh");if(h>=0){tmpHour=f.value.substr(h,2);currentHour=tmpHour;if(currentHour.length==1){currentHour="0"}}else{currentHour="00"}var e=r.indexOf("ii");if(e>=0){tmpMinute=f.value.substr(e,2);currentMinute=tmpMinute}else{currentMinute="00"}}}else{var n=new Date();currentMonth=n.getMonth();currentYear=n.getFullYear();currentHour="08";currentMinute="00";inputDay=n.getDate()/1}inputYear=currentYear;inputMonth=currentMonth;if(!calendarDiv){initCalendar()}else{if(calendarDiv.style.display=="block"){closeCalendar();return false}writeCalendarContent()}returnFormat=r;returnDateTo=f;positionCalendar(c);calendarDiv.style.visibility="visible";calendarDiv.style.display="block";if(iframeObj){iframeObj.style.display="";iframeObj.style.height="140px";iframeObj.style.width="195px";iframeObj2.style.display="";iframeObj2.style.height="140px";iframeObj2.style.width="195px"}setTimeProperties();updateYearDiv();updateMonthDiv();updateMinuteDiv();updateHourDiv();positionCalendar(c)}function displayCalendarSelectBox(a,f,e,d,c,b){if(!d){calendarDisplayTime=false}else{calendarDisplayTime=true}currentMonth=f.options[f.selectedIndex].value/1-1;currentYear=a.options[a.selectedIndex].value;if(d){currentHour=d.options[d.selectedIndex].value;inputHour=currentHour/1}if(c){currentMinute=c.options[c.selectedIndex].value;inputMinute=currentMinute/1}inputYear=a.options[a.selectedIndex].value;inputMonth=f.options[f.selectedIndex].value/1-1;inputDay=e.options[e.selectedIndex].value/1;if(!calendarDiv){initCalendar()}else{writeCalendarContent()}returnDateToYear=a;returnDateToMonth=f;returnDateToDay=e;returnDateToHour=d;returnDateToMinute=c;returnFormat=false;returnDateTo=false;positionCalendar(b);calendarDiv.style.visibility="visible";calendarDiv.style.display="block";if(iframeObj){iframeObj.style.display="";iframeObj.style.height=calendarDiv.offsetHeight+"px";iframeObj.style.width=calendarDiv.offsetWidth+"px";iframeObj2.style.display="";iframeObj2.style.height=calendarDiv.offsetHeight+"px";iframeObj2.style.width=calendarDiv.offsetWidth+"px"}setTimeProperties();updateYearDiv();updateMonthDiv();updateHourDiv();updateMinuteDiv();positionCalendar(b)};
