// Compacted by ScriptingMagic.com
/************************************************************************************************************
JS Calendar
Copyright (C) September 2006  DTHMLGoodies.com, Alf Magne Kalleland

This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.

This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA

Dhtmlgoodies.com., hereby disclaims all copyright interest in this script
written by Alf Magne Kalleland.

Alf Magne Kalleland, 2006
Owner of DHTMLgoodies.com

************************************************************************************************************/
var turnOffYearSpan=false;var weekStartsOnSunday=false;var showWeekNumber=true;var languageCode="ge";var calendar_display_time=true;var todayStringFormat="[todayString] [UCFdayString]. [day]. [monthString] [year]";var pathToImages="/inforum/js/calendar_new/images/";var speedOfSelectBoxSliding=200;var intervalSelectBox_minutes=5;var calendar_offsetTop=0;var calendar_offsetLeft=0;var calendarDiv=false;var monthArray;var monthArrayShort;var dayArray;var weekString;var todayString;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}function loadLanguage(a){switch(a){case "en":this.monthArray=["January","February","March","April","May","June","July","August","September","October","November","December"];this.monthArrayShort=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];this.dayArray=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"];this.weekString="Week";this.todayString="";break;case "de":this.monthArray=["Januar","Februar","M&auml;rz","April","Mai","Juni","Juli","August","September","Oktober","November","Dezember"];this.monthArrayShort=["Jan","Feb","Mar","Apr","Mai","Jun","Jul","Aug","Sep","Okt","Nov","Dez"];this.dayArray=["Mon","Die","Mit","Don","Fre","Sam","Son"];this.weekString="Woche";this.todayString="Heute";break;case "no":this.monthArray=["Januar","Februar","Mars","April","Mai","Juni","Juli","August","September","Oktober","November","Desember"];this.monthArrayShort=["Jan","Feb","Mar","Apr","Mai","Jun","Jul","Aug","Sep","Okt","Nov","Des"];this.dayArray=["Man","Tir","Ons","Tor","Fre","L&oslash;r","S&oslash;n"];this.weekString="Uke";this.todayString="Dagen i dag er";break;case "nl":this.monthArray=["Januari","Februari","Maart","April","Mei","Juni","Juli","Augustus","September","Oktober","November","December"];this.monthArrayShort=["Jan","Feb","Mar","Apr","Mei","Jun","Jul","Aug","Sep","Okt","Nov","Dec"];this.dayArray=["Ma","Di","Wo","Do","Vr","Za","Zo"];this.weekString="Week";this.todayString="Vandaag";break;case "es":this.monthArray=["Enero","Febrero","Marzo","April","Mayo","Junio","Julio","Agosto","Septiembre","Octubre","Noviembre","Diciembre"];this.monthArrayShort=["Ene","Feb","Mar","Abr","May","Jun","Jul","Ago","Sep","Oct","Nov","Dic"];this.dayArray=["Lun","Mar","Mie","Jue","Vie","Sab","Dom"];this.weekString="Semana";this.todayString="Hoy es";break;case "pt-br":this.monthArray=["Janeiro","Fevereiro","Mar&ccedil;o","Abril","Maio","Junho","Julho","Agosto","Setembro","Outubro","Novembro","Dezembro"];this.monthArrayShort=["Jan","Fev","Mar","Abr","Mai","Jun","Jul","Ago","Set","Out","Nov","Dez"];this.dayArray=["Seg","Ter","Qua","Qui","Sex","S&aacute;b","Dom"];this.weekString="Sem.";this.todayString="Hoje &eacute;";break;case "fr":this.monthArray=["Janvier","F\ufffdvrier","Mars","Avril","Mai","Juin","Juillet","Ao\ufffdt","Septembre","Octobre","Novembre","D\ufffdcembre"];this.monthArrayShort=["Jan","Fev","Mar","Avr","Mai","Jun","Jul","Aou","Sep","Oct","Nov","Dec"];this.dayArray=["Lun","Mar","Mer","Jeu","Ven","Sam","Dim"];this.weekString="Sem";this.todayString="Aujourd'hui";break;case "da":this.monthArray=["januar","februar","marts","april","maj","juni","juli","august","september","oktober","november","december"];this.monthArrayShort=["jan","feb","mar","apr","maj","jun","jul","aug","sep","okt","nov","dec"];this.dayArray=["man","tirs","ons","tors","fre","l&oslash;r","s&oslash;n"];this.weekString="Uge";this.todayString="I dag er den";break;case "hu":this.monthArray=["Janu\xe1r","Febru\xe1r","M\xe1rcius","\ufffd?prilis","M\xe1jus","J\xfanius","J\xfalius","Augusztus","Szeptember","Okt\xf3ber","November","December"];this.monthArrayShort=["Jan","Feb","M\xe1rc","\ufffd?pr","M\xe1j","J\xfan","J\xfal","Aug","Szep","Okt","Nov","Dec"];this.dayArray=["H\xe9","Ke","Sze","Cs","P\xe9","Szo","Vas"];this.weekString="H\xe9t";this.todayString="Mai nap";break;case "it":this.monthArray=["Gennaio","Febbraio","Marzo","Aprile","Maggio","Giugno","Luglio","Agosto","Settembre","Ottobre","Novembre","Dicembre"];this.monthArrayShort=["Gen","Feb","Mar","Apr","Mag","Giu","Lugl","Ago","Set","Ott","Nov","Dic"];this.dayArray=["Lun",";Mar","Mer","Gio","Ven","Sab","Dom"];this.weekString="Settimana";this.todayString="Oggi &egrave; il";break;case "sv":this.monthArray=["Januari","Februari","Mars","April","Maj","Juni","Juli","Augusti","September","Oktober","November","December"];this.monthArrayShort=["Jan","Feb","Mar","Apr","Maj","Jun","Jul","Aug","Sep","Okt","Nov","Dec"];this.dayArray=["M&aring;n","Tis","Ons","Tor","Fre","L&ouml;r","S&ouml;n"];this.weekString="Vecka";this.todayString="Idag &auml;r det den";break;case "cz":this.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"];this.monthArrayShort=["led","&#250;n","b&#345;","dub","kv&#283;","&#269;er","&#269;er-ec","srp","z&#225;&#345;","&#345;&#237;j","list","pros"];this.dayArray=["Pon","&#218;t","St","&#268;t","P&#225;","So","Ne"];this.weekString="t&#253;den";this.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="#F1F1F1";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.id.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 a=document.createElement("DIV");a.className="monthYearPicker";a.id="monthPicker";for(var b=0;b<monthArray.length;b++){var c=document.createElement("DIV");c.innerHTML=monthArray[b];c.onmouseover=highlightMonthYear;c.onmouseout=highlightMonthYear;c.onclick=selectMonth;c.id="monthDiv_"+b;c.style.width="56px";c.onselectstart=cancelCalendarEvent;a.appendChild(c);if(currentMonth&&currentMonth==b){c.style.color=selectBoxHighlightColor;activeSelectBoxMonth=c}}return a}function changeSelectBoxYear(e,a){if(!a){a=this}var b=a.parentNode.getElementsByTagName("DIV");if(a.innerHTML.indexOf("-")>=0){var c=b[1].innerHTML/1-1;if(activeSelectBoxYear){activeSelectBoxYear.style.color=""}}else{var c=b[1].innerHTML/1+1;if(activeSelectBoxYear){activeSelectBoxYear.style.color=""}}for(var d=1;d<b.length-1;d++){b[d].innerHTML=c+d-1;b[d].id="yearDiv"+(c/1+d/1-1)}if(activeSelectBoxYear){activeSelectBoxYear.style.color="";if(document.getElementById("yearDiv"+currentYear)){activeSelectBoxYear=document.getElementById("yearDiv"+currentYear);activeSelectBoxYear.style.color=selectBoxHighlightColor}}}function changeSelectBoxHour(e,a){if(!a){a=this}var b=a.parentNode.getElementsByTagName("DIV");if(a.innerHTML.indexOf("-")>=0){var c=b[1].innerHTML/1-1;if(c<0){c=0}if(activeSelectBoxHour){activeSelectBoxHour.style.color=""}}else{var c=b[1].innerHTML/1+1;if(c>14){c=14}if(activeSelectBoxHour){activeSelectBoxHour.style.color=""}}var d="";for(var f=1;f<b.length-1;f++){if((c/1+f/1)<11){d="0"}else{d=""}b[f].innerHTML=d+(c+f-1);b[f].id="hourDiv"+(c/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 b=document.getElementById("yearDropDown");var c=b.getElementsByTagName("DIV");for(var d=1;d<c.length-1;d++){c[d].innerHTML=currentYear/1-a+d;if(currentYear==(currentYear/1-a+d)){c[d].style.color=selectBoxHighlightColor;activeSelectBoxYear=c[d]}else{c[d].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 a=document.getElementById("hourDropDown");var b=a.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 e="";if((currentHour/1-6+d+c)<10){e="0"}b[d].innerHTML=e+(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 a=document.createElement("DIV");a.className="monthYearPicker"}else{var a=document.getElementById("yearDropDown");var b=a.getElementsByTagName("DIV");for(var c=0;c<b.length;c++){b[c].parentNode.removeChild(b[c])}}var d=new Date();if(currentYear){d.setFullYear(currentYear)}var e=d.getFullYear()/1-5;var f=10;if(!turnOffYearSpan){var g=document.createElement("DIV");g.innerHTML="&nbsp;&nbsp;- ";g.onclick=changeSelectBoxYear;g.onmouseover=highlightMonthYear;g.onmouseout=function(){selectBoxMovementInProgress=false};g.onselectstart=cancelCalendarEvent;a.appendChild(g)}else{e=d.getFullYear()/1-0;f=2}for(var c=e;c<(e+f);c++){var g=document.createElement("DIV");g.innerHTML=c;g.onmouseover=highlightMonthYear;g.onmouseout=highlightMonthYear;g.onclick=selectYear;g.id="yearDiv"+c;g.onselectstart=cancelCalendarEvent;a.appendChild(g);if(currentYear&&currentYear==c){g.style.color=selectBoxHighlightColor;activeSelectBoxYear=g}}if(!turnOffYearSpan){var g=document.createElement("DIV");g.innerHTML="&nbsp;&nbsp;+ ";g.onclick=changeSelectBoxYear;g.onmouseover=highlightMonthYear;g.onmouseout=function(){selectBoxMovementInProgress=false};g.onselectstart=cancelCalendarEvent;a.appendChild(g)}return a}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 a=document.createElement("DIV");a.className="monthYearPicker"}else{var a=document.getElementById("hourDropDown");var b=a.getElementsByTagName("DIV");for(var c=0;c<b.length;c++){b[c].parentNode.removeChild(b[c])}}if(!currentHour){currentHour=0}var d=currentHour/1;if(d>14){d=14}var e=document.createElement("DIV");e.innerHTML="&nbsp;&nbsp;- ";e.onclick=changeSelectBoxHour;e.onmouseover=highlightMonthYear;e.onmouseout=function(){selectBoxMovementInProgress=false};e.onselectstart=cancelCalendarEvent;a.appendChild(e);for(var c=d;c<d+10;c++){var f="";if(c/1<10){f="0"}var e=document.createElement("DIV");e.innerHTML=f+c;e.onmouseover=highlightMonthYear;e.onmouseout=highlightMonthYear;e.onclick=selectHour;e.id="hourDiv"+c;e.onselectstart=cancelCalendarEvent;a.appendChild(e);if(currentYear&&currentYear==c){e.style.color=selectBoxHighlightColor;activeSelectBoxYear=e}}var e=document.createElement("DIV");e.innerHTML="&nbsp;&nbsp;+ ";e.onclick=changeSelectBoxHour;e.onmouseover=highlightMonthYear;e.onmouseout=function(){selectBoxMovementInProgress=false};e.onselectstart=cancelCalendarEvent;a.appendChild(e);return a}function createMinuteDiv(){if(!document.getElementById("minuteDropDown")){var a=document.createElement("DIV");a.className="monthYearPicker"}else{var a=document.getElementById("minuteDropDown");var b=a.getElementsByTagName("DIV");for(var c=0;c<b.length;c++){b[c].parentNode.removeChild(b[c])}}var d=0;var e="";for(var c=d;c<60;c+=intervalSelectBox_minutes){if(c<10){e="0"}else{e=""}var f=document.createElement("DIV");f.innerHTML=e+c;f.onmouseover=highlightMonthYear;f.onmouseout=highlightMonthYear;f.onclick=selectMinute;f.id="minuteDiv_"+e+c;f.onselectstart=cancelCalendarEvent;a.appendChild(f);if(currentYear&&currentYear==c){f.style.color=selectBoxHighlightColor;activeSelectBoxYear=f}}return a}function highlightSelect(){if(this.className=="selectBoxTime"){this.className="selectBoxTimeOver"}else{if(this.className=="selectBoxTimeOver"){this.className="selectBoxTime"}}if(this.className=="selectBox"){this.className="selectBoxOver"}else{if(this.className=="selectBoxOver"){this.className="selectBox"}}}function highlightArrow(){}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 a=document.createElement("DIV");a.className="topBar";a.id="topBar";calendarDiv.appendChild(a);var b=document.createElement("DIV");b.style.marginRight="1px";b.className="selectBox";b.id="leftArrow";b.onclick=switchMonth;b.onmouseover=highlightSelect;b.onmouseout=highlightSelect;a.appendChild(b);if(Opera){b.style.width="16px"}var c=document.createElement("DIV");c.style.marginRight="1px";c.className="selectBox";c.id="rightArrow";c.onclick=switchMonth;c.onmouseover=highlightSelect;c.onmouseout=highlightSelect;if(Opera){c.style.width="16px"}a.appendChild(c);var d=document.createElement("DIV");d.id="monthSelect";d.onmouseover=highlightSelect;d.onmouseout=highlightSelect;d.onclick=showMonthDropDown;var e=document.createElement("SPAN");e.innerHTML=monthArray[currentMonth];e.id="calendar_month_txt";d.appendChild(e);var f=document.createElement("DIV");f.id="image";f.style.position="absolute";f.style.right="0px";d.appendChild(f);d.className="selectBox";if(Opera){f.style.cssText="float:right;position:relative";f.style.position="relative";f.style.styleFloat="right"}a.appendChild(d);var g=createMonthDiv();g.style.left="37px";g.style.top=d.offsetTop+d.offsetHeight+1+"px";g.style.width="60px";g.id="monthDropDown";calendarDiv.appendChild(g);var h=document.createElement("DIV");h.id="yearSelect";h.onmouseover=highlightSelect;h.onmouseout=highlightSelect;h.onclick=showYearDropDown;var e=document.createElement("SPAN");e.innerHTML=currentYear;e.id="calendar_year_txt";h.appendChild(e);a.appendChild(h);var f=document.createElement("DIV");f.id="image";f.style.position="absolute";f.style.right="0px";h.appendChild(f);h.className="selectBox";if(Opera){h.style.width="50px";f.style.cssText="float:right";f.style.position="relative";f.style.styleFloat="right"}var i=createYearDiv();i.style.left="113px";i.style.top=d.offsetTop+d.offsetHeight+1+"px";i.style.width="35px";i.id="yearDropDown";calendarDiv.appendChild(i);var f=document.createElement("IMG");f.src=pathToImages+"close.gif";f.style.styleFloat="right";f.onmouseover=highlightClose;f.onmouseout=highlightClose;f.onclick=closeCalendar;a.appendChild(f);if(!document.all){f.style.position="absolute";f.style.right="2px"}}function writeCalendarContent(){var a=true;if(!calendarContentDiv){calendarContentDiv=document.createElement("DIV");calendarDiv.appendChild(calendarContentDiv);a=false}currentMonth=currentMonth/1;var d=new Date();d.setFullYear(currentYear);d.setDate(1);d.setMonth(currentMonth);var b=d.getDay();if(!weekStartsOnSunday){if(b==0){b=7}b--}document.getElementById("calendar_year_txt").innerHTML=currentYear;document.getElementById("calendar_month_txt").innerHTML=monthArray[currentMonth];document.getElementById("calendar_hour_txt").innerHTML=currentHour;document.getElementById("calendar_minute_txt").innerHTML=currentMinute;var c=calendarContentDiv.getElementsByTagName("TABLE");if(c.length>0){calendarContentDiv.removeChild(c[0])}var e=document.createElement("TABLE");e.width="100%";e.cellSpacing="0";calendarContentDiv.appendChild(e);var f=document.createElement("TBODY");e.appendChild(f);var g=f.insertRow(-1);g.className="calendar_week_row";if(showWeekNumber){var h=g.insertCell(-1);h.innerHTML=weekString;h.className="calendar_week_column";h.style.backgroundColor=selectBoxRolloverBgColor}for(var i=0;i<dayArray.length;i++){var h=g.insertCell(-1);h.innerHTML=dayArray[i]}var g=f.insertRow(-1);if(showWeekNumber){var h=g.insertCell(-1);h.className="calendar_week_column";h.style.backgroundColor=selectBoxRolloverBgColor;var j=getWeek(currentYear,currentMonth,1);h.innerHTML=j}for(var i=0;i<b;i++){var h=g.insertCell(-1);h.innerHTML="&nbsp;"}var k=b;var l=daysInMonthArray[currentMonth];if(l==28){if(isLeapYear(currentYear)){l=29}}for(var i=1;i<=l;i++){d.setDate(i-1);if(k>0&&k%7==0){var g=f.insertRow(-1);if(showWeekNumber){var h=g.insertCell(-1);h.className="calendar_week_column";var j=getWeek(currentYear,currentMonth,i);h.innerHTML=j;h.style.backgroundColor=selectBoxRolloverBgColor}}var h=g.insertCell(-1);if(currentYear==inputYear&&currentMonth==inputMonth&&i==inputDay){h.className="activeDay"}h.innerHTML=i;h.onclick=pickDate;k++}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(!a){setTimeout("resizeIframe()",350)}else{setTimeout("resizeIframe()",10)}}}function resizeIframe(){iframeObj.style.width=calendarDiv.offsetWidth+"px";iframeObj.style.height=calendarDiv.offsetHeight+"px"}function pickTodaysDate(){var d=new Date();currentMonth=d.getMonth();currentYear=d.getFullYear();pickDate(false,d.getDate())}function pickDate(e,a){var b=currentMonth/1+1;if(b<10){b="0"+b}var c;if(!a&&this){c=this.innerHTML}else{c=a}if(c/1<10){c="0"+c}if(returnFormat){returnFormat=returnFormat.replace("dd",c);returnFormat=returnFormat.replace("mm",b);returnFormat=returnFormat.replace("yyyy",currentYear);returnFormat=returnFormat.replace("hh",currentHour);returnFormat=returnFormat.replace("ii",currentMinute);returnFormat=returnFormat.replace("d",c/1);returnFormat=returnFormat.replace("m",b/1);returnDateTo.value=returnFormat;try{returnDateTo.onchange()}catch(e){}}else{for(var d=0;d<returnDateToYear.options.length;d++){if(returnDateToYear.options[d].value==currentYear){returnDateToYear.selectedIndex=d;break}}for(var d=0;d<returnDateToMonth.options.length;d++){if(returnDateToMonth.options[d].value==parseFloat(b)){returnDateToMonth.selectedIndex=d;break}}for(var d=0;d<returnDateToDay.options.length;d++){if(returnDateToDay.options[d].value==parseFloat(c)){returnDateToDay.selectedIndex=d;break}}if(calendarDisplayTime){for(var d=0;d<returnDateToHour.options.length;d++){if(returnDateToHour.options[d].value==parseFloat(currentHour)){returnDateToHour.selectedIndex=d;break}}for(var d=0;d<returnDateToMinute.options.length;d++){if(returnDateToMinute.options[d].value==parseFloat(currentMinute)){returnDateToMinute.selectedIndex=d;break}}}}closeCalendar()}function getWeek(a,b,c){if(!weekStartsOnSunday){c=(c/1)}else{c=(c/1)+1}a=a/1;b=b/1+1;var d=Math.floor((14-(b))/12);var y=a+4800-d;var m=(b)+(12*d)-3;var e=c+Math.floor(((153*m)+2)/5)+(365*y)+Math.floor(y/4)-Math.floor(y/100)+Math.floor(y/400)-32045;var f=(e+31741-(e%7))%146097%36524%1461;var L=Math.floor(f/1460);var g=((f-L)%365)+L;NumberOfWeek=Math.floor(g/7)+1;return NumberOfWeek}function writeTimeBar(){var a=document.createElement("DIV");a.id="timeBar";a.className="timeBar";var b=document.createElement("DIV");b.innerHTML="Time:";var c=document.createElement("DIV");c.id="hourSelect";c.onmouseover=highlightSelect;c.onmouseout=highlightSelect;c.onclick=showHourDropDown;c.style.width="30px";var d=document.createElement("SPAN");d.innerHTML=currentHour;d.id="calendar_hour_txt";c.appendChild(d);a.appendChild(c);var e=document.createElement("DIV");e.id="image";e.style.position="absolute";e.style.right="0px";c.appendChild(e);c.className="selectBoxTime";if(Opera){c.style.width="30px";e.style.cssText="float:right";e.style.position="relative";e.style.styleFloat="right"}var f=createHourDiv();f.style.left="163px";f.style.width="35px";f.id="hourDropDown";calendarDiv.appendChild(f);var g=document.createElement("DIV");g.id="minuteSelect";g.onmouseover=highlightSelect;g.onmouseout=highlightSelect;g.onclick=showMinuteDropDown;g.style.width="30px";var d=document.createElement("SPAN");d.innerHTML=currentMinute;d.id="calendar_minute_txt";g.appendChild(d);a.appendChild(g);var e=document.createElement("DIV");e.id="image";e.style.position="absolute";e.style.right="0px";g.appendChild(e);g.className="selectBoxTime";if(Opera){g.style.width="30px";e.style.cssText="float:right";e.style.position="relative";e.style.styleFloat="right"}var h=createMinuteDiv();h.style.left="200px";h.style.width="35px";h.id="minuteDropDown";calendarDiv.appendChild(h);return a}function writeBottomBar(){var d=new Date();var a=document.createElement("DIV");a.id="bottomBar";a.style.cursor="pointer";a.className="todaysDate";var b=document.createElement("DIV");b.onclick=pickTodaysDate;b.id="todaysDateString";b.style.width=(calendarDiv.offsetWidth-95)+"px";var c=d.getDay();if(!weekStartsOnSunday){if(c==0){c=7}c--}var e=todayStringFormat;e=e.replace("[monthString]",monthArrayShort[d.getMonth()]);e=e.replace("[day]",d.getDate());e=e.replace("[year]",d.getFullYear());e=e.replace("[dayString]",dayArray[c].toLowerCase());e=e.replace("[UCFdayString]",dayArray[c]);e=e.replace("[todayString]",todayString);b.innerHTML=todayString+": "+d.getDate()+". "+monthArrayShort[d.getMonth()]+", "+d.getFullYear();b.innerHTML=e;a.appendChild(b);var f=writeTimeBar();a.appendChild(f);calendarDiv.appendChild(a)}function getTopPos(a){var b=a.offsetTop+a.offsetHeight;while((a=a.offsetParent)!=null){b+=a.offsetTop}return b+calendar_offsetTop}function getleftPos(a){var b=a.offsetLeft;while((a=a.offsetParent)!=null){b+=a.offsetLeft}return b+calendar_offsetLeft}function positionCalendar(a){calendarDiv.style.left=getleftPos(a)+"px";calendarDiv.style.top=getTopPos(a)+"px";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="blank.html";iframeObj.src="blank.html";document.body.appendChild(iframeObj2);document.body.appendChild(iframeObj)}calendarDiv=document.createElement("DIV");calendarDiv.id="calendarDiv";calendarDiv.style.zIndex=900000;slideCalendarSelectBox();document.body.appendChild(calendarDiv);writeBottomBar();writeTopBar();if(!currentYear){var d=new Date();currentMonth=d.getMonth();currentYear=d.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(a,b){return a/1-b/1}function displayCalendar(a,b,c,d,e,f){this.loadLanguage(e);if(d){calendarDisplayTime=true}else{calendarDisplayTime=false}if(a.value.length>6){if(!a.value.match(/^[0-9]*?$/gi)){var g=a.value.split(/[^0-9]/gi);var h=new Object();h.m=b.indexOf("mm");if(h.m==-1){h.m=b.indexOf("m")}h.d=b.indexOf("dd");if(h.d==-1){h.d=b.indexOf("d")}h.y=b.indexOf("yyyy");h.h=b.indexOf("hh");h.i=b.indexOf("ii");this.initialHour="00";this.initialMinute="00";var i=["y","m","d","h","i"];var j=["currentYear","currentMonth","inputDay","currentHour","currentMinute"];var k=[4,2,2,2,2];for(var l=0;l<i.length;l++){if(h[i[l]]>=0){window[j[l]]=a.value.substr(h[i[l]],k[l])}}currentMonth--}else{var m=b.indexOf("mm");currentMonth=a.value.substr(m,2)/1-1;var n=b.indexOf("yyyy");currentYear=a.value.substr(n,4);var o=b.indexOf("dd");tmpDay=a.value.substr(o,2);var p=b.indexOf("hh");if(p>=0){tmpHour=a.value.substr(p,2);currentHour=tmpHour;if(currentHour.length==1){currentHour="0"}}else{currentHour="00"}var q=b.indexOf("ii");if(q>=0){tmpMinute=a.value.substr(q,2);currentMinute=tmpMinute}else{currentMinute="00"}}}else{var r=new Date();currentMonth=r.getMonth();currentYear=r.getFullYear();currentHour="08";currentMinute="00";inputDay=r.getDate()/1}inputYear=currentYear;inputMonth=currentMonth;if(!calendarDiv){initCalendar()}else{if(calendarDiv.style.display=="block"){closeCalendar();return false}writeCalendarContent()}returnFormat=b;returnDateTo=a;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()}function displayCalendarSelectBox(a,b,c,d,e,f,g){this.loadLanguage(g);if(!d){calendarDisplayTime=false}else{calendarDisplayTime=true}currentMonth=b.options[b.selectedIndex].value/1-1;currentYear=a.options[a.selectedIndex].value;if(d){currentHour=d.options[d.selectedIndex].value;inputHour=currentHour/1}if(e){currentMinute=e.options[e.selectedIndex].value;inputMinute=currentMinute/1}inputYear=a.options[a.selectedIndex].value;inputMonth=b.options[b.selectedIndex].value/1-1;inputDay=c.options[c.selectedIndex].value/1;if(!calendarDiv){initCalendar()}else{writeCalendarContent()}returnDateToYear=a;returnDateToMonth=b;returnDateToDay=c;returnDateToHour=d;returnDateToMinute=e;returnFormat=false;returnDateTo=false;positionCalendar(f);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()}
