var turnOffYearSpan=false;var weekStartsOnSunday=false;var showWeekNumber=true;var languageCode="cn";var calendar_display_time=true;var todayStringFormat="[todayString]";var pathToImages="images/lyy_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"cn":var monthArray=["一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月"];var monthArrayShort=["一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月"];var dayArray=["一","二","三","四","五","六","日"];var weekString="周";var todayString="CURR TIME";break;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","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":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","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":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=["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":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="#E2EBED";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="56px";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 c=b.parentNode.getElementsByTagName("DIV");if(b.innerHTML.indexOf("-")>=0){var a=c[1].innerHTML/1-1;if(activeSelectBoxYear){activeSelectBoxYear.style.color="";}}else{var a=c[1].innerHTML/1+1;if(activeSelectBoxYear){activeSelectBoxYear.style.color="";}}for(var f=1;f<c.length-1;f++){c[f].innerHTML=a+f-1;c[f].id="yearDiv"+(a/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,a){if(!a){a=this;}var b=a.parentNode.getElementsByTagName("DIV");if(a.innerHTML.indexOf("-")>=0){var g=b[1].innerHTML/1-1;if(g<0){g=0;}if(activeSelectBoxHour){activeSelectBoxHour.style.color="";}}else{var g=b[1].innerHTML/1+1;if(g>14){g=14;}if(activeSelectBoxHour){activeSelectBoxHour.style.color="";}}var c="";for(var f=1;f<b.length-1;f++){if((g/1+f/1)<11){c="0";}else{c="";}b[f].innerHTML=c+(g+f-1);b[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 b=5;if(turnOffYearSpan){b=0;}var d=document.getElementById("yearDropDown");var a=d.getElementsByTagName("DIV");for(var c=1;c<a.length-1;c++){a[c].innerHTML=currentYear/1-b+c;if(currentYear==(currentYear/1-b+c)){a[c].style.color=selectBoxHighlightColor;activeSelectBoxYear=a[c];}else{a[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 a=0;if((currentHour/1-6+1)<0){a=(currentHour/1-6+1)*-1;}for(var d=1;d<b.length-1;d++){var c="";if((currentHour/1-6+d+a)<10){c="0";}b[d].innerHTML=c+(currentHour/1-6+d+a);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 a=e.getFullYear()/1-5;var c=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{a=e.getFullYear()/1-0;c=2;}for(var f=a;f<(a+c);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 a=document.createElement("DIV");a.innerHTML="&nbsp;&nbsp;- ";a.onclick=changeSelectBoxHour;a.onmouseover=highlightMonthYear;a.onmouseout=function(){selectBoxMovementInProgress=false;};a.onselectstart=cancelCalendarEvent;f.appendChild(a);for(var d=c;d<c+10;d++){var b="";if(d/1<10){b="0";}var a=document.createElement("DIV");a.innerHTML=b+d;a.onmouseover=highlightMonthYear;a.onmouseout=highlightMonthYear;a.onclick=selectHour;a.id="hourDiv"+d;a.onselectstart=cancelCalendarEvent;f.appendChild(a);if(currentYear&&currentYear==d){a.style.color=selectBoxHighlightColor;activeSelectBoxYear=a;}}var a=document.createElement("DIV");a.innerHTML="&nbsp;&nbsp;+ ";a.onclick=changeSelectBoxHour;a.onmouseover=highlightMonthYear;a.onmouseout=function(){selectBoxMovementInProgress=false;};a.onselectstart=cancelCalendarEvent;f.appendChild(a);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 a=0;var c="";for(var d=a;d<60;d+=intervalSelectBox_minutes){if(d<10){c="0";}else{c="";}var b=document.createElement("DIV");b.innerHTML=c+d;b.onmouseover=highlightMonthYear;b.onmouseout=highlightMonthYear;b.onclick=selectMinute;b.id="minuteDiv_"+c+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 i=document.createElement("DIV");i.style.marginRight="1px";var d=document.createElement("IMG");d.src=pathToImages+"right.gif";d.onclick=switchMonth;d.onmouseover=highlightArrow;d.onmouseout=highlightArrow;i.appendChild(d);if(Opera){i.style.width="16px";}c.appendChild(i);var b=document.createElement("DIV");b.id="monthSelect";b.onmouseover=highlightSelect;b.onmouseout=highlightSelect;b.onclick=showMonthDropDown;var h=document.createElement("SPAN");h.innerHTML=monthArray[currentMonth];h.id="calendar_month_txt";b.appendChild(h);var d=document.createElement("IMG");d.src=pathToImages+"down.gif";d.style.position="absolute";d.style.right="0px";b.appendChild(d);b.className="selectBox";if(Opera){d.style.cssText="float:right;position:relative";d.style.position="relative";d.style.styleFloat="right";}c.appendChild(b);var a=createMonthDiv();a.style.left="37px";a.style.top=b.offsetTop+b.offsetHeight+1+"px";a.style.width="60px";a.id="monthDropDown";calendarDiv.appendChild(a);var f=document.createElement("DIV");f.onmouseover=highlightSelect;f.onmouseout=highlightSelect;f.onclick=showYearDropDown;var h=document.createElement("SPAN");h.innerHTML=currentYear;h.id="calendar_year_txt";f.appendChild(h);c.appendChild(f);var d=document.createElement("IMG");d.src=pathToImages+"down.gif";f.appendChild(d);f.className="selectBox";if(Opera){f.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=b.offsetTop+b.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 e=true;if(!calendarContentDiv){calendarContentDiv=document.createElement("DIV");calendarDiv.appendChild(calendarContentDiv);e=false;}currentMonth=currentMonth/1;var i=new Date();i.setFullYear(currentYear);i.setDate(1);i.setMonth(currentMonth);var f=i.getDay();if(!weekStartsOnSunday){if(f==0){f=7;}f--;}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 a=calendarContentDiv.getElementsByTagName("TABLE");if(a.length>0){calendarContentDiv.removeChild(a[0]);}var h=document.createElement("TABLE");h.width="100%";h.cellSpacing="0";calendarContentDiv.appendChild(h);var g=document.createElement("TBODY");h.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 c=getWeek(currentYear,currentMonth,1);j.innerHTML=c;}for(var k=0;k<f;k++){var j=m.insertCell(-1);j.innerHTML="&nbsp;";}var l=f;var b=daysInMonthArray[currentMonth];if(b==28){if(isLeapYear(currentYear)){b=29;}}for(var k=1;k<=b;k++){i.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 c=getWeek(currentYear,currentMonth,k);j.innerHTML=c;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(!e){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(d,c){var b=currentMonth/1+1;if(b<10){b="0"+b;}var a;if(!c&&this){a=this.innerHTML;}else{a=c;}if(a/1<10){a="0"+a;}if(returnFormat){returnFormat=returnFormat.replace("dd",a);returnFormat=returnFormat.replace("mm",b);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",b/1);returnDateTo.value=returnFormat;try{returnDateTo.onchange();}catch(d){}}else{for(var f=0;f<returnDateToYear.options.length;f++){if(returnDateToYear.options[f].value==currentYear){returnDateToYear.selectedIndex=f;break;}}for(var f=0;f<returnDateToMonth.options.length;f++){if(returnDateToMonth.options[f].value==parseFloat(b)){returnDateToMonth.selectedIndex=f;break;}}for(var f=0;f<returnDateToDay.options.length;f++){if(returnDateToDay.options[f].value==parseFloat(a)){returnDateToDay.selectedIndex=f;break;}}if(calendarDisplayTime){for(var f=0;f<returnDateToHour.options.length;f++){if(returnDateToHour.options[f].value==parseFloat(currentHour)){returnDateToHour.selectedIndex=f;break;}}for(var f=0;f<returnDateToMinute.options.length;f++){if(returnDateToMinute.options[f].value==parseFloat(currentMinute)){returnDateToMinute.selectedIndex=f;break;}}}}closeCalendar();}function getWeek(f,d,h){if(!weekStartsOnSunday){h=(h/1);}else{h=(h/1)+1;}f=f/1;d=d/1+1;var i=Math.floor((14-(d))/12);var g=f+4800-i;var c=(d)+(12*i)-3;var j=h+Math.floor(((153*c)+2)/5)+(365*g)+Math.floor(g/4)-Math.floor(g/100)+Math.floor(g/400)-32045;var k=(j+31741-(j%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 f=document.createElement("DIV");f.id="timeBar";f.className="timeBar";var d=document.createElement("DIV");d.innerHTML="Time:";var a=document.createElement("DIV");a.onmouseover=highlightSelect;a.onmouseout=highlightSelect;a.onclick=showHourDropDown;a.style.width="30px";var e=document.createElement("SPAN");e.innerHTML=currentHour;e.id="calendar_hour_txt";a.appendChild(e);f.appendChild(a);var b=document.createElement("IMG");b.src=pathToImages+"down_time.gif";a.appendChild(b);a.className="selectBoxTime";if(Opera){a.style.width="30px";b.style.cssText="float:right";b.style.position="relative";b.style.styleFloat="right";}var c=createHourDiv();c.style.left="130px";c.style.width="35px";c.id="hourDropDown";calendarDiv.appendChild(c);var h=document.createElement("DIV");h.onmouseover=highlightSelect;h.onmouseout=highlightSelect;h.onclick=showMinuteDropDown;h.style.width="30px";var e=document.createElement("SPAN");e.innerHTML=currentMinute;e.id="calendar_minute_txt";h.appendChild(e);f.appendChild(h);var b=document.createElement("IMG");b.src=pathToImages+"down_time.gif";h.appendChild(b);h.className="selectBoxTime";if(Opera){h.style.width="30px";b.style.cssText="float:right";b.style.position="relative";b.style.styleFloat="right";}var g=createMinuteDiv();g.style.left="167px";g.style.width="35px";g.id="minuteDropDown";calendarDiv.appendChild(g);return f;}function writeBottomBar(){var f=new Date();var e=document.createElement("DIV");e.id="bottomBar";e.style.cursor="pointer";e.className="todaysDate";var c=document.createElement("DIV");c.onclick=pickTodaysDate;c.id="todaysDateString";c.style.width=(calendarDiv.offsetWidth-95)+"px";var b=f.getDay();if(!weekStartsOnSunday){if(b==0){b=7;}b--;}var a=todayStringFormat;a=a.replace("[monthString]",monthArrayShort[f.getMonth()]);a=a.replace("[day]",f.getDate());a=a.replace("[year]",f.getFullYear());a=a.replace("[dayString]",dayArray[b].toLowerCase());a=a.replace("[UCFdayString]",dayArray[b]);a=a.replace("[todayString]",todayString);c.innerHTML=todayString+": "+f.getDate()+". "+monthArrayShort[f.getMonth()]+", "+f.getFullYear();c.innerHTML=a;e.appendChild(c);var g=writeTimeBar();e.appendChild(g);calendarDiv.appendChild(e);}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=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,q,c,s,b){if(s){calendarDisplayTime=true;}else{calendarDisplayTime=false;}if(f.value.length>6){if(!f.value.match(/^[0-9]*?$/gi)){var p=f.value.split(/[^0-9]/gi);var m=new Object();m.m=q.indexOf("mm");if(m.m==-1){m.m=q.indexOf("m");}m.d=q.indexOf("dd");if(m.d==-1){m.d=q.indexOf("d");}m.y=q.indexOf("yyyy");m.h=q.indexOf("hh");m.i=q.indexOf("ii");this.initialHour="00";this.initialMinute="00";var a=["y","m","d","h","i"];var o=["currentYear","currentMonth","inputDay","currentHour","currentMinute"];var h=[4,2,2,2,2];for(var k=0;k<a.length;k++){if(m[a[k]]>=0){window[o[k]]=f.value.substr(m[a[k]],h[k])/1;}}currentMonth--;}else{var r=q.indexOf("mm");currentMonth=f.value.substr(r,2)/1-1;var g=q.indexOf("yyyy");currentYear=f.value.substr(g,4);var l=q.indexOf("dd");tmpDay=f.value.substr(l,2);var j=q.indexOf("hh");if(j>=0){tmpHour=f.value.substr(j,2);currentHour=tmpHour;if(currentHour.length==1){currentHour="0";}}else{currentHour="00";}var e=q.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=q;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();}function displayCalendarSelectBox(e,f,d,c,b,a){if(!c){calendarDisplayTime=false;}else{calendarDisplayTime=true;}currentMonth=f.options[f.selectedIndex].value/1-1;currentYear=e.options[e.selectedIndex].value;if(c){currentHour=c.options[c.selectedIndex].value;inputHour=currentHour/1;}if(b){currentMinute=b.options[b.selectedIndex].value;inputMinute=currentMinute/1;}inputYear=e.options[e.selectedIndex].value;inputMonth=f.options[f.selectedIndex].value/1-1;inputDay=d.options[d.selectedIndex].value/1;if(!calendarDiv){initCalendar();}else{writeCalendarContent();}returnDateToYear=e;returnDateToMonth=f;returnDateToDay=d;returnDateToHour=c;returnDateToMinute=b;returnFormat=false;returnDateTo=false;positionCalendar(a);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();}