var turnOffYearSpan = false; // true = Only show This Year and Next, false = show +/- 5 years var weekStartsOnSunday = false; // true = Start the week on Sunday, false = start the week on Monday var showWeekNumber = false; // true = show week number, false = do not show week number var languageCode = 'de'; // Possible values: en,ge,no,nl,es,pt-br,fr // en = english, ge = german, no = norwegian,nl = dutch, es = spanish, pt-br = portuguese, fr = french, da = danish, hu = hungarian(Use UTF-8 doctype for hungarian) var calendar_display_time = true; // Format of current day at the bottom of the calendar // [todayString] = the value of todayString // [dayString] = day of week (examle: mon, tue, wed...) // [UCFdayString] = day of week (examle: Mon, Tue, Wed...) ( First letter in uppercase) // [day] = Day of month, 1..31 // [monthString] = Name of current month // [year] = Current year var todayStringFormat = '[todayString] [UCFdayString]. [day]. [monthString] [year]'; var pathToImages = '_scripts/calendar/'; // Relative to your HTML file var speedOfSelectBoxSliding = 200; // Milliseconds between changing year and hour when holding mouse over "-" and "+" - lower value = faster var intervalSelectBox_minutes = 5; // Minute select box - interval between each option (5 = default) var calendar_offsetTop = 0; // Offset - calendar placement - You probably have to modify this value if you're not using a strict doctype var calendar_offsetLeft = 0; // Offset - calendar placement - You probably have to modify this value if you're not using a strict doctype 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": /* English */ 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 "gr": /* Greek */ var monthArray = ['Ιανουάριος','Φεβρουάριος','Μάρτιος','Απρίλιος','Μάϊος','Ιούνιος','Ιούλιος','Αύγουστος','Σεπτέμβριος','Οκτώβριος','Νοέμβριος','Δεκέμβριος']; var monthArrayShort = ['Ιαν','Φεβ','Μαρ','Απρ','Μαϊ','Ιουν','Ιουλ','Αυγ','Σεπ','Οκτ','Νοέ','Δεκ']; var dayArray = ['Δευ','Τρι','Τετ','Πεμ','Παρ','Σαβ','Κυρ']; var weekString = 'Εβδομάδα'; var todayString = ''; break; case "de": /* German */ var monthArray = ['Januar','Februar','Mä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": /* Norwegian */ 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ør','Søn']; var weekString = 'Uke'; var todayString = 'Dagen i dag er'; break; case "nl": /* Dutch */ 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": /* Spanish */ 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": /* Brazilian portuguese (pt-br) */ var monthArray = ['Janeiro','Fevereiro','Març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áb','Dom']; var weekString = 'Sem.'; var todayString = 'Hoje é'; break; case "fr": /* French */ var monthArray = ['Janvier','F�vrier','Mars','Avril','Mai','Juin','Juillet','Ao�t','Septembre','Octobre','Novembre','D�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": /*Danish*/ 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ør','søn']; var weekString = 'Uge'; var todayString = 'I dag er den'; break; case "hu": /* Hungarian - Remember to use UTF-8 encoding, i.e. the tag */ var monthArray = ['Január','Február','Március','�?prilis','Május','Június','Július','Augusztus','Szeptember','Október','November','December']; var monthArrayShort = ['Jan','Feb','Márc','�?pr','Máj','Jún','Júl','Aug','Szep','Okt','Nov','Dec']; var dayArray = ['Hé','Ke','Sze','Cs','Pé','Szo','Vas']; var weekString = 'Hét'; var todayString = 'Mai nap'; break; case "it": /* Italian*/ 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 è il'; break; case "sv": /* Swedish */ 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ån','Tis','Ons','Tor','Fre','Lör','Sön']; var weekString = 'Vecka'; var todayString = 'Idag är det den'; break; case "cz": /* Czech */ var monthArray = ['leden','únor','březen','duben','květen','červen','červenec','srpen','září','říjen','listopad','prosinec']; var monthArrayShort = ['led','ún','bř','dub','kvě','čer','čer-ec','srp','zář','říj','list','pros']; var dayArray = ['Pon','Út','St','Čt','Pá','So','Ne']; var weekString = 'tý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; //// fix for EI frame problem on time dropdowns 09/30/2006 var iframeObj2 =false; function EIS_FIX_EI1(where2fixit) { if(!iframeObj2)return; iframeObj2.style.display = 'block'; iframeObj2.style.height =document.getElementById(where2fixit).offsetHeight+1; iframeObj2.style.width=document.getElementById(where2fixit).offsetWidth; iframeObj2.style.left=getleftPos(document.getElementById(where2fixit))+1-calendar_offsetLeft; iframeObj2.style.top=getTopPos(document.getElementById(where2fixit))-document.getElementById(where2fixit).offsetHeight-calendar_offsetTop; } function EIS_Hide_Frame() { if(iframeObj2)iframeObj2.style.display = 'none';} //// fix for EI frame problem on time dropdowns 09/30/2006 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'; // Highlight color of select boxes var selectBoxRolloverBgColor = '#E2EBED'; // Background color on drop down lists(rollover) var selectBoxMovementInProgress = false; var activeSelectBox = false; function cancelCalendarEvent() { return false; } function isLeapYear(inputYear) { if(inputYear%400==0||(inputYear%4==0&&inputYear%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'; //// fix for EI frame problem on time dropdowns 09/30/2006 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')} //// fix for EI frame problem on time dropdowns 09/30/2006 } } function showYearDropDown() { if(document.getElementById('yearDropDown').style.display=='block'){ document.getElementById('yearDropDown').style.display='none'; //// fix for EI frame problem on time dropdowns 09/30/2006 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')} //// fix for EI frame problem on time dropdowns 09/30/2006 } } function showHourDropDown() { if(document.getElementById('hourDropDown').style.display=='block'){ document.getElementById('hourDropDown').style.display='none'; //// fix for EI frame problem on time dropdowns 09/30/2006 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')} //// fix for EI frame problem on time dropdowns 09/30/2006 } } function showMinuteDropDown() { if(document.getElementById('minuteDropDown').style.display=='block'){ document.getElementById('minuteDropDown').style.display='none'; //// fix for EI frame problem on time dropdowns 09/30/2006 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')} //// fix for EI frame problem on time dropdowns 09/30/2006 } } function selectMonth() { document.getElementById('calendar_month_txt').innerHTML = this.innerHTML currentMonth = this.id.replace(/[^\d]/g,''); document.getElementById('monthDropDown').style.display='none'; //// fix for EI frame problem on time dropdowns 09/30/2006 EIS_Hide_Frame(); for(var no=0;no=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 div = document.createElement('DIV'); div.className='monthYearPicker'; div.id = 'monthPicker'; for(var no=0;no=0){ var startYear = yearItems[1].innerHTML/1 -1; if(activeSelectBoxYear){ activeSelectBoxYear.style.color=''; } }else{ var startYear = yearItems[1].innerHTML/1 +1; if(activeSelectBoxYear){ activeSelectBoxYear.style.color=''; } } for(var no=1;no=0){ var startHour = hourItems[1].innerHTML/1 -1; if(startHour<0)startHour=0; if(activeSelectBoxHour){ activeSelectBoxHour.style.color=''; } }else{ var startHour = hourItems[1].innerHTML/1 +1; if(startHour>14)startHour = 14; if(activeSelectBoxHour){ activeSelectBoxHour.style.color=''; } } var prefix = ''; for(var no=1;no14)startHour=14; var subDiv = document.createElement('DIV'); subDiv.innerHTML = '  - '; subDiv.onclick = changeSelectBoxHour; subDiv.onmouseover = highlightMonthYear; subDiv.onmouseout = function(){ selectBoxMovementInProgress = false;}; subDiv.onselectstart = cancelCalendarEvent; div.appendChild(subDiv); for(var no=startHour;no=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'; //// //// fix for EI frame problem on time dropdowns 09/30/2006 EIS_Hide_Frame();} if(activeSelectBoxMonth)activeSelectBoxMonth.className=''; if(activeSelectBoxYear)activeSelectBoxYear.className=''; } function writeTopBar() { var topBar = document.createElement('DIV'); topBar.className = 'topBar'; topBar.id = 'topBar'; calendarDiv.appendChild(topBar); // Left arrow var leftDiv = document.createElement('DIV'); leftDiv.style.marginRight = '1px'; var img = document.createElement('IMG'); img.src = pathToImages + 'left.gif'; img.onmouseover = highlightArrow; img.onclick = switchMonth; img.onmouseout = highlightArrow; leftDiv.appendChild(img); topBar.appendChild(leftDiv); if(Opera)leftDiv.style.width = '16px'; // Right arrow var rightDiv = document.createElement('DIV'); rightDiv.style.marginRight = '1px'; var img = document.createElement('IMG'); img.src = pathToImages + 'right.gif'; img.onclick = switchMonth; img.onmouseover = highlightArrow; img.onmouseout = highlightArrow; rightDiv.appendChild(img); if(Opera)rightDiv.style.width = '16px'; topBar.appendChild(rightDiv); // Month selector var monthDiv = document.createElement('DIV'); monthDiv.id = 'monthSelect'; monthDiv.onmouseover = highlightSelect; monthDiv.onmouseout = highlightSelect; monthDiv.onclick = showMonthDropDown; var span = document.createElement('SPAN'); span.innerHTML = monthArray[currentMonth]; span.id = 'calendar_month_txt'; monthDiv.appendChild(span); var img = document.createElement('IMG'); img.src = pathToImages + 'down.gif'; img.style.position = 'absolute'; img.style.right = '0px'; monthDiv.appendChild(img); monthDiv.className = 'selectBox'; if(Opera){ img.style.cssText = 'float:right;position:relative'; img.style.position = 'relative'; img.style.styleFloat = 'right'; } topBar.appendChild(monthDiv); var monthPicker = createMonthDiv(); monthPicker.style.left = '37px'; monthPicker.style.top = monthDiv.offsetTop + monthDiv.offsetHeight + 1 + 'px'; monthPicker.style.width ='60px'; monthPicker.id = 'monthDropDown'; calendarDiv.appendChild(monthPicker); // Year selector var yearDiv = document.createElement('DIV'); yearDiv.onmouseover = highlightSelect; yearDiv.onmouseout = highlightSelect; yearDiv.onclick = showYearDropDown; var span = document.createElement('SPAN'); span.innerHTML = currentYear; span.id = 'calendar_year_txt'; yearDiv.appendChild(span); topBar.appendChild(yearDiv); var img = document.createElement('IMG'); img.src = pathToImages + 'down.gif'; yearDiv.appendChild(img); yearDiv.className = 'selectBox'; if(Opera){ yearDiv.style.width = '50px'; img.style.cssText = 'float:right'; img.style.position = 'relative'; img.style.styleFloat = 'right'; } var yearPicker = createYearDiv(); yearPicker.style.left = '113px'; yearPicker.style.top = monthDiv.offsetTop + monthDiv.offsetHeight + 1 + 'px'; yearPicker.style.width = '35px'; yearPicker.id = 'yearDropDown'; calendarDiv.appendChild(yearPicker); var img = document.createElement('IMG'); img.src = pathToImages + 'close.gif'; img.style.styleFloat = 'right'; img.onmouseover = highlightClose; img.onmouseout = highlightClose; img.onclick = closeCalendar; topBar.appendChild(img); if(!document.all){ img.style.position = 'absolute'; img.style.right = '2px'; } } function writeCalendarContent() { var calendarContentDivExists = true; if(!calendarContentDiv){ calendarContentDiv = document.createElement('DIV'); calendarDiv.appendChild(calendarContentDiv); calendarContentDivExists = false; } currentMonth = currentMonth/1; var d = new Date(); d.setFullYear(currentYear); d.setDate(1); d.setMonth(currentMonth); var dayStartOfMonth = d.getDay(); if (! weekStartsOnSunday) { if(dayStartOfMonth==0)dayStartOfMonth=7; dayStartOfMonth--; } 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 existingTable = calendarContentDiv.getElementsByTagName('TABLE'); if(existingTable.length>0){ calendarContentDiv.removeChild(existingTable[0]); } var calTable = document.createElement('TABLE'); calTable.width = '100%'; calTable.cellSpacing = '0'; calendarContentDiv.appendChild(calTable); var calTBody = document.createElement('TBODY'); calTable.appendChild(calTBody); var row = calTBody.insertRow(-1); row.className = 'calendar_week_row'; if (showWeekNumber) { var cell = row.insertCell(-1); cell.innerHTML = weekString; cell.className = 'calendar_week_column'; cell.style.backgroundColor = selectBoxRolloverBgColor; } for(var no=0;no0 && colCounter%7==0){ var row = calTBody.insertRow(-1); if (showWeekNumber) { var cell = row.insertCell(-1); cell.className = 'calendar_week_column'; var week = getWeek(currentYear,currentMonth,no); cell.innerHTML = week; // Week cell.style.backgroundColor = selectBoxRolloverBgColor; } } var cell = row.insertCell(-1); if(currentYear==inputYear && currentMonth == inputMonth && no==inputDay){ cell.className='activeDay'; } cell.innerHTML = no; if (toDisable(d,no)) { cell.className='disableDay'; }else { cell.onclick = pickDate; } colCounter++; } 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(!calendarContentDivExists)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,inputDay) { var month = currentMonth/1 +1; if(month<10)month = '0' + month; var day; if(!inputDay && this)day = this.innerHTML; else day = inputDay; if(day/1<10)day = '0' + day; if(returnFormat){ returnFormat = returnFormat.replace('dd',day); returnFormat = returnFormat.replace('mm',month); returnFormat = returnFormat.replace('yyyy',currentYear); returnFormat = returnFormat.replace('hh',currentHour); returnFormat = returnFormat.replace('ii',currentMinute); returnFormat = returnFormat.replace('d',day/1); returnFormat = returnFormat.replace('m',month/1); returnDateTo.value = returnFormat; try{ returnDateTo.onchange(); }catch(e){ } }else{ for(var no=0;no0){ if(!format.match(/^[0-9]*?$/gi)){ var items = inputField.value.split(/[^0-9]/gi); var positionArray = new Array(); positionArray['m'] = format.indexOf('mm'); if(positionArray['m']==-1)positionArray['m'] = format.indexOf('m'); positionArray['d'] = format.indexOf('dd'); if(positionArray['d']==-1)positionArray['d'] = format.indexOf('d'); positionArray['y'] = format.indexOf('yyyy'); positionArray['h'] = format.indexOf('hh'); positionArray['i'] = format.indexOf('ii'); var positionArrayNumeric = Array(); positionArrayNumeric[0] = positionArray['m']; positionArrayNumeric[1] = positionArray['d']; positionArrayNumeric[2] = positionArray['y']; positionArrayNumeric[3] = positionArray['h']; positionArrayNumeric[4] = positionArray['i']; positionArrayNumeric = positionArrayNumeric.sort(calendarSortItems); var itemIndex = -1; currentHour = '00'; currentMinute = '00'; for(var no=0;no=0){ tmpHour = inputField.value.substr(hourPos,2); currentHour = tmpHour; }else{ currentHour = '00'; } var minutePos = format.indexOf('ii'); if(minutePos>=0){ tmpMinute = inputField.value.substr(minutePos,2); currentMinute = tmpMinute; }else{ currentMinute = '00'; } } }else{ var d = new Date(); currentMonth = d.getMonth(); currentYear = d.getFullYear(); currentHour = '08'; currentMinute = '00'; tmpDay = d.getDate(); } inputYear = currentYear; inputMonth = currentMonth; inputDay = tmpDay/1; if(!calendarDiv){ initCalendar(); }else{ if(calendarDiv.style.display=='block'){ closeCalendar(); return false; } writeCalendarContent(); } returnFormat = format; returnDateTo = inputField; positionCalendar(buttonObj); 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(yearInput,monthInput,dayInput,hourInput,minuteInput,buttonObj) { if(!hourInput)calendarDisplayTime=false; else calendarDisplayTime = true; currentMonth = monthInput.options[monthInput.selectedIndex].value/1-1; currentYear = yearInput.options[yearInput.selectedIndex].value; if(hourInput){ currentHour = hourInput.options[hourInput.selectedIndex].value; inputHour = currentHour/1; } if(minuteInput){ currentMinute = minuteInput.options[minuteInput.selectedIndex].value; inputMinute = currentMinute/1; } inputYear = yearInput.options[yearInput.selectedIndex].value; inputMonth = monthInput.options[monthInput.selectedIndex].value/1 - 1; inputDay = dayInput.options[dayInput.selectedIndex].value/1; if(!calendarDiv){ initCalendar(); }else{ writeCalendarContent(); } returnDateToYear = yearInput; returnDateToMonth = monthInput; returnDateToDay = dayInput; returnDateToHour = hourInput; returnDateToMinute = minuteInput; returnFormat = false; returnDateTo = false; positionCalendar(buttonObj); 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'; //// fix for EI frame problem on time dropdowns 09/30/2006 iframeObj2.style.display = ''; iframeObj2.style.height = calendarDiv.offsetHeight + 'px'; iframeObj2.style.width = calendarDiv.offsetWidth + 'px' } setTimeProperties(); updateYearDiv(); updateMonthDiv(); updateHourDiv(); updateMinuteDiv(); } // For adding days to the date object. function addDaysToDate(date,days){ var t = date.getTime() + (days * 1000 * 60 * 60 * 24) return new Date(t); } //disabling four days after current date. var disDate = addDaysToDate(new Date(), 0); // HERE SET HOW MANY DAYS AFTER TODAY THE CALENDAR DISABLES //To disable the date. Change this date to however you want the logic to be. function toDisable(dateObj,date){ var cYear = disDate.getFullYear(); var cMonth = disDate.getMonth()-1; var cDate = disDate.getDate(); var dateTill = Date.UTC(cYear,cMonth,cDate); var displayDate = Date.UTC(dateObj.getFullYear(),dateObj.getMonth(),date); return displayDate < dateTill; }