var openerClick=true;
var turnOffYearSpan=false;
var NUM_turnOffYearSpan=10;
var weekStartsOnSunday=false;
var showWeekNumber=true;
var languageCode="en";
var calendar_display_time=true;
var todayStringFormat="[todayString] [UCFdayString]. [day]. [monthString] [year]";
var speedOfSelectBoxSliding=50;
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 "fr":
var monthArray=["Janvier","F\ufffdvrier","Mars","Avril","Mai","Juin","Juillet","Ao\ufffdt","Septembre","Octobre","Novembre","D\ufffdcembre"];
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;
}
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(_1){
if(!iframeObj2){
return;
}
iframeObj2.style.display="block";
iframeObj2.style.height=document.getElementById(_1).offsetHeight+1;
iframeObj2.style.width=document.getElementById(_1).offsetWidth;
iframeObj2.style.left=getleftPos(document.getElementById(_1))+1-calendar_offsetLeft;
iframeObj2.style.top=getTopPos(document.getElementById(_1))-document.getElementById(_1).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="#FFFFFF";
var selectBoxRolloverBgColor="#E6E6FF";<!--Week column-->
var selectBoxMovementInProgress=false;
var activeSelectBox=false;
function cancelCalendarEvent(){
return false;
}
function isLeapYear(_2){
if(_2%400==0||(_2%4==0&&_2%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 no=0;no<monthArray.length;no++){
document.getElementById("monthDiv_"+no).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 _4=document.createElement("DIV");
_4.className="monthYearPicker";
_4.id="monthPicker";
for(var no=0;no<monthArray.length;no++){
var _6=document.createElement("DIV");
_6.innerHTML=monthArray[no];
_6.onmouseover=highlightMonthYear;
_6.onmouseout=highlightMonthYear;
_6.onclick=selectMonth;
_6.id="monthDiv_"+no;
_6.style.width="69px";
_6.onselectstart=cancelCalendarEvent;
_4.appendChild(_6);
if(currentMonth&&currentMonth==no){
_6.style.color=selectBoxHighlightColor;
activeSelectBoxMonth=_6;
}
}
return _4;
}
function changeSelectBoxYear(e,_8){
if(!_8){
_8=this;
}
var _9=_8.parentNode.getElementsByTagName("DIV");
if(_8.innerHTML.indexOf("-")>=0){
var _a=_9[1].innerHTML/1-1;
if(activeSelectBoxYear){
activeSelectBoxYear.style.color="";
}
}else{
var _a=_9[1].innerHTML/1+1;
if(activeSelectBoxYear){
activeSelectBoxYear.style.color="";
}
}
for(var no=1;no<_9.length-1;no++){
_9[no].innerHTML=_a+no-1;
_9[no].id="yearDiv"+(_a/1+no/1-1);
}
if(activeSelectBoxYear){
activeSelectBoxYear.style.color="";
if(document.getElementById("yearDiv"+currentYear)){
activeSelectBoxYear=document.getElementById("yearDiv"+currentYear);
activeSelectBoxYear.style.color=selectBoxHighlightColor;
}
}
}
function changeSelectBoxHour(e,_d){
if(!_d){
_d=this;
}
var _e=_d.parentNode.getElementsByTagName("DIV");
if(_d.innerHTML.indexOf("-")>=0){
var _f=_e[1].innerHTML/1-1;
if(_f<0){
_f=0;
}
if(activeSelectBoxHour){
activeSelectBoxHour.style.color="";
}
}else{
var _f=_e[1].innerHTML/1+1;
if(_f>14){
_f=14;
}
if(activeSelectBoxHour){
activeSelectBoxHour.style.color="";
}
}
var _10="";
for(var no=1;no<_e.length-1;no++){
if((_f/1+no/1)<11){
_10="0";
}else{
_10="";
}
_e[no].innerHTML=_10+(_f+no-1);
_e[no].id="hourDiv"+(_f/1+no/1-1);
}
if(activeSelectBoxHour){
activeSelectBoxHour.style.color="";
if(document.getElementById("hourDiv"+currentHour)){
activeSelectBoxHour=document.getElementById("hourDiv"+currentHour);
activeSelectBoxHour.style.color=selectBoxHighlightColor;
}
}
}
function updateYearDiv(){
var _12=NUM_turnOffYearSpan;
if(turnOffYearSpan){
_12=0;
}
var div=document.getElementById("yearDropDown");
var _14=div.getElementsByTagName("DIV");
for(var no=1;no<_14.length-1;no++){
_14[no].innerHTML=currentYear/1-_12+no;
if(currentYear==(currentYear/1-_12+no)){
_14[no].style.color=selectBoxHighlightColor;
activeSelectBoxYear=_14[no];
}else{
_14[no].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 div=document.getElementById("hourDropDown");
var _17=div.getElementsByTagName("DIV");
var _18=0;
if((currentHour/1-6+1)<0){
_18=(currentHour/1-6+1)*-1;
}
for(var no=1;no<_17.length-1;no++){
var _1a="";
if((currentHour/1-6+no+_18)<10){
_1a="0";
}
_17[no].innerHTML=_1a+(currentHour/1-6+no+_18);
if(currentHour==(currentHour/1-6+no)){
_17[no].style.color=selectBoxHighlightColor;
activeSelectBoxHour=_17[no];
}else{
_17[no].style.color="";
}
}
}
function updateMinuteDiv(){
for(no=0;no<60;no+=intervalSelectBox_minutes){
var _1b="";
if(no<10){
_1b="0";
}
document.getElementById("minuteDiv_"+_1b+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 div=document.createElement("DIV");
div.className="monthYearPicker";
}else{
var div=document.getElementById("yearDropDown");
var _1d=div.getElementsByTagName("DIV");
for(var no=0;no<_1d.length;no++){
_1d[no].parentNode.removeChild(_1d[no]);
}
}
var d=new Date();
if(currentYear){
d.setFullYear(currentYear);
}
var _20=d.getFullYear()/1-5;
var _21=NUM_turnOffYearSpan;
if(!turnOffYearSpan){
var _22=document.createElement("DIV");
_22.innerHTML="&nbsp;&nbsp;- ";
_22.onclick=changeSelectBoxYear;
_22.onmouseover=highlightMonthYear;
_22.onmouseout=function(){
selectBoxMovementInProgress=false;
};
_22.onselectstart=cancelCalendarEvent;
div.appendChild(_22);
}else{
_20=d.getFullYear()/1-0;
_21=2;
}
for(var no=_20;no<(_20+_21);no++){
var _22=document.createElement("DIV");
_22.innerHTML=no;
_22.onmouseover=highlightMonthYear;
_22.onmouseout=highlightMonthYear;
_22.onclick=selectYear;
_22.id="yearDiv"+no;
_22.onselectstart=cancelCalendarEvent;
div.appendChild(_22);
if(currentYear&&currentYear==no){
_22.style.color=selectBoxHighlightColor;
activeSelectBoxYear=_22;
}
}
if(!turnOffYearSpan){
var _22=document.createElement("DIV");
_22.innerHTML="&nbsp;&nbsp;+ ";
_22.onclick=changeSelectBoxYear;
_22.onmouseover=highlightMonthYear;
_22.onmouseout=function(){
selectBoxMovementInProgress=false;
};
_22.onselectstart=cancelCalendarEvent;
div.appendChild(_22);
}
return div;
}
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 div=document.createElement("DIV");
div.className="monthYearPicker";
}else{
var div=document.getElementById("hourDropDown");
var _24=div.getElementsByTagName("DIV");
for(var no=0;no<_24.length;no++){
_24[no].parentNode.removeChild(_24[no]);
}
}
if(!currentHour){
currentHour=0;
}
var _26=currentHour/1;
if(_26>14){
_26=14;
}
var _27=document.createElement("DIV");
_27.innerHTML="&nbsp;&nbsp;- ";
_27.onclick=changeSelectBoxHour;
_27.onmouseover=highlightMonthYear;
_27.onmouseout=function(){
selectBoxMovementInProgress=false;
};
_27.onselectstart=cancelCalendarEvent;
div.appendChild(_27);
for(var no=_26;no<_26+10;no++){
var _28="";
if(no/1<10){
_28="0";
}
var _27=document.createElement("DIV");
_27.innerHTML=_28+no;
_27.onmouseover=highlightMonthYear;
_27.onmouseout=highlightMonthYear;
_27.onclick=selectHour;
_27.id="hourDiv"+no;
_27.onselectstart=cancelCalendarEvent;
div.appendChild(_27);
if(currentYear&&currentYear==no){
_27.style.color=selectBoxHighlightColor;
activeSelectBoxYear=_27;
}
}
var _27=document.createElement("DIV");
_27.innerHTML="&nbsp;&nbsp;+ ";
_27.onclick=changeSelectBoxHour;
_27.onmouseover=highlightMonthYear;
_27.onmouseout=function(){
selectBoxMovementInProgress=false;
};
_27.onselectstart=cancelCalendarEvent;
div.appendChild(_27);
return div;
}
function createMinuteDiv(){
if(!document.getElementById("minuteDropDown")){
var div=document.createElement("DIV");
div.className="monthYearPicker";
}else{
var div=document.getElementById("minuteDropDown");
var _2a=div.getElementsByTagName("DIV");
for(var no=0;no<_2a.length;no++){
_2a[no].parentNode.removeChild(_2a[no]);
}
}
var _2c=0;
var _2d="";
for(var no=_2c;no<60;no+=intervalSelectBox_minutes){
if(no<10){
_2d="0";
}else{
_2d="";
}
var _2e=document.createElement("DIV");
_2e.innerHTML=_2d+no;
_2e.onmouseover=highlightMonthYear;
_2e.onmouseout=highlightMonthYear;
_2e.onclick=selectMinute;
_2e.id="minuteDiv_"+_2d+no;
_2e.onselectstart=cancelCalendarEvent;
div.appendChild(_2e);
if(currentYear&&currentYear==no){
_2e.style.color=selectBoxHighlightColor;
activeSelectBoxYear=_2e;
}
}
return div;
}
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 highlightClose(){
if(this.src.indexOf("over")>=0)
{
this.src="images/close.jpg";
}

}
function closeCalendar(){
openerClick=true;
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 _2f=document.createElement("DIV");
_2f.className="topBar";
_2f.id="topBar";
calendarDiv.appendChild(_2f);
var _30=document.createElement("DIV");
_30.style.marginRight="1px";

_2f.appendChild(_30);
if(Opera){
_30.style.width="16px";
}
var _32=document.createElement("DIV");
_32.style.marginRight="1px";

if(Opera){
_32.style.width="16px";
}
_2f.appendChild(_32);
var _33=document.createElement("DIV");
_33.id="monthSelect";
_33.onmouseover=highlightSelect;
_33.onmouseout=highlightSelect;
_33.onclick=showMonthDropDown;
var _34=document.createElement("SPAN");
_34.innerHTML=monthArray[currentMonth];
_34.id="calendar_month_txt";
_33.appendChild(_34);
_33.className="selectBox";
if(Opera){
img.style.cssText="float:right;position:relative";
img.style.position="relative";
img.style.styleFloat="right";
}
_2f.appendChild(_33);
var _35=createMonthDiv();
_35.style.left="37px";
_35.style.top=_33.offsetTop+_33.offsetHeight-1+"px";
_35.style.width="73px";
_35.id="monthDropDown";
calendarDiv.appendChild(_35);
var _36=document.createElement("DIV");
_36.onmouseover=highlightSelect;
_36.onmouseout=highlightSelect;
_36.onclick=showYearDropDown;
var _34=document.createElement("SPAN");
_34.innerHTML=currentYear;
_34.id="calendar_year_txt";
_36.appendChild(_34);
_2f.appendChild(_36);
_36.className="selectBox";
if(Opera){
_36.style.width="50px";
img.style.cssText="float:right";
img.style.position="relative";
img.style.styleFloat="right";
}
var _37=createYearDiv();
_37.style.left="113px";
_37.style.top=_33.offsetTop+_33.offsetHeight-1+"px";
_37.style.width="50px";
_37.id="yearDropDown";
calendarDiv.appendChild(_37);
var img=document.createElement("IMG");
img.src="images/close.jpg";
img.style.styleFloat="right";
img.onmouseover=highlightClose;
img.onmouseout=highlightClose;
img.onclick=closeCalendar;
_2f.appendChild(img);
if(!document.all){
img.style.position="absolute";
img.style.right="3px";
}
}
function writeCalendarContent(){
var _38=true;
if(!calendarContentDiv){
calendarContentDiv=document.createElement("DIV");
calendarDiv.appendChild(calendarContentDiv);
_38=false;
}
currentMonth=currentMonth/1;
var d=new Date();
d.setFullYear(currentYear);
d.setDate(1);
d.setMonth(currentMonth);
var _3a=d.getDay();
if(!weekStartsOnSunday){
if(_3a==0){
_3a=7;
}
_3a--;
}
document.getElementById("calendar_year_txt").innerHTML=currentYear+"&nbsp;&nbsp;";
document.getElementById("calendar_month_txt").innerHTML=monthArray[currentMonth]+"&nbsp;&nbsp;";
document.getElementById("calendar_hour_txt").innerHTML=currentHour;
document.getElementById("calendar_minute_txt").innerHTML=currentMinute;
var _3b=calendarContentDiv.getElementsByTagName("TABLE");
if(_3b.length>0){
calendarContentDiv.removeChild(_3b[0]);
}
var _3c=document.createElement("TABLE");
_3c.width="100%";
_3c.cellSpacing="0";
calendarContentDiv.appendChild(_3c);
var _3d=document.createElement("TBODY");
_3c.appendChild(_3d);
var row=_3d.insertRow(-1);
row.className="calendar_week_row";
if(showWeekNumber){
var _3f=row.insertCell(-1);
}
for(var no=0;no<dayArray.length;no++){
var _3f=row.insertCell(-1);
_3f.innerHTML=dayArray[no];
}
var row=_3d.insertRow(-1);
if(showWeekNumber){
var _3f=row.insertCell(-1);
var _41=getWeek(currentYear,currentMonth,1);
}
for(var no=0;no<_3a;no++){
var _3f=row.insertCell(-1);
}
var _42=_3a;
var _43=daysInMonthArray[currentMonth];
if(_43==28){
if(isLeapYear(currentYear)){
_43=29;
}
}
for(var no=1;no<=_43;no++){
d.setDate(no-1);
if(_42>0&&_42%7==0){
var row=_3d.insertRow(-1);
if(showWeekNumber){
var _3f=row.insertCell(-1);
var _41=getWeek(currentYear,currentMonth,no);
}
}
var _3f=row.insertCell(-1);
if(currentYear==inputYear&&currentMonth==inputMonth&&no==inputDay){
_3f.className="activeDay";
}
_3f.innerHTML=no;
if(toDisable(d,no)){
_3f.className="disableDay";
}else{
if(fromDisable(d,no)){
_3f.className="disableDay";
}else{
_3f.onclick=pickDate;
}
}
_42++;
}
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(!_38){
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,_46){
var _47=currentMonth/1+1;
if(_47<10){
_47="0"+_47;
}
var day;
if(!_46&&this){
day=this.innerHTML;
}else{
day=_46;
}
if(day/1<10){
day="0"+day;
}
if(returnFormat){
returnFormat=returnFormat.replace("dd",day);
returnFormat=returnFormat.replace("mm",_47);
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",_47/1);
returnDateTo.value=returnFormat;
try{
returnDateTo.onchange();
}
catch(e){
}
}else{
for(var no=0;no<returnDateToYear.options.length;no++){
if(returnDateToYear.options[no].value==currentYear){
returnDateToYear.selectedIndex=no;
break;
}
}
for(var no=0;no<returnDateToMonth.options.length;no++){
if(returnDateToMonth.options[no].value==parseInt(_47)){
returnDateToMonth.selectedIndex=no;
break;
}
}
for(var no=0;no<returnDateToDay.options.length;no++){
if(returnDateToDay.options[no].value==parseInt(day)){
returnDateToDay.selectedIndex=no;
break;
}
}
if(calendarDisplayTime){
for(var no=0;no<returnDateToHour.options.length;no++){
if(returnDateToHour.options[no].value==parseInt(currentHour)){
returnDateToHour.selectedIndex=no;
break;
}
}
for(var no=0;no<returnDateToMinute.options.length;no++){
if(returnDateToMinute.options[no].value==parseInt(currentMinute)){
returnDateToMinute.selectedIndex=no;
break;
}
}
}
}
closeCalendar();
Hack_CMS(returnDateTo);
}
function getWeek(_4a,_4b,day){
if(!weekStartsOnSunday){
day=(day/1);
}else{
day=(day/1)+1;
}
_4a=_4a/1;
_4b=_4b/1+1;
var a=Math.floor((14-(_4b))/12);
var y=_4a+4800-a;
var m=(_4b)+(12*a)-3;
var jd=day+Math.floor(((153*m)+2)/5)+(365*y)+Math.floor(y/4)-Math.floor(y/100)+Math.floor(y/400)-32045;
var d4=(jd+31741-(jd%7))%146097%36524%1461;
var L=Math.floor(d4/1460);
var d1=((d4-L)%365)+L;
NumberOfWeek=Math.floor(d1/7)+1;
return NumberOfWeek;
}
function writeTimeBar(){
var _54=document.createElement("DIV");
_54.id="timeBar";
_54.className="timeBar";
var _55=document.createElement("DIV");
_55.innerHTML="Time:";
var _56=document.createElement("DIV");
_56.onmouseover=highlightSelect;
_56.onmouseout=highlightSelect;
_56.onclick=showHourDropDown;
_56.style.width="30px";
var _57=document.createElement("SPAN");
_57.innerHTML=currentHour;
_57.id="calendar_hour_txt";
_56.appendChild(_57);
_54.appendChild(_56);
_56.className="selectBoxTime";
if(Opera){
_56.style.width="30px";
img.style.cssText="float:right";
img.style.position="relative";
img.style.styleFloat="right";
}
var _59=createHourDiv();
_59.style.left="130px";
_59.style.width="35px";
_59.id="hourDropDown";
calendarDiv.appendChild(_59);
var _5a=document.createElement("DIV");
_5a.onmouseover=highlightSelect;
_5a.onmouseout=highlightSelect;
_5a.onclick=showMinuteDropDown;
_5a.style.width="30px";
var _57=document.createElement("SPAN");
_57.innerHTML=currentMinute;
_57.id="calendar_minute_txt";
_5a.appendChild(_57);
_54.appendChild(_5a);
_5a.className="selectBoxTime";
if(Opera){
_5a.style.width="30px";
img.style.cssText="float:right";
img.style.position="relative";
img.style.styleFloat="right";
}
var _5b=createMinuteDiv();
_5b.style.left="167px";
_5b.style.width="35px";
_5b.id="minuteDropDown";
calendarDiv.appendChild(_5b);
return _54;
}
function writeBottomBar(){
var d=new Date();
var _5d=document.createElement("DIV");
_5d.id="bottomBar";
_5d.style.cursor="pointer";
_5d.className="todaysDate";
var _5e=document.createElement("DIV");
_5e.onclick=pickTodaysDate;
_5e.id="todaysDateString";
_5e.style.width=(calendarDiv.offsetWidth-95)+"px";
var day=d.getDay();
if(!weekStartsOnSunday){
if(day==0){
day=7;
}
day--;
}
var _60=todayStringFormat;
_60=_60.replace("[monthString]",monthArrayShort[d.getMonth()]);
_60=_60.replace("[day]",d.getDate());
_60=_60.replace("[year]",d.getFullYear());
_60=_60.replace("[dayString]",dayArray[day].toLowerCase());
_60=_60.replace("[UCFdayString]",dayArray[day]);
_60=_60.replace("[todayString]",todayString);
if(hide_today_date_from_bottom==true){
_5e.innerHTML=todayString+": "+d.getDate()+". "+monthArrayShort[d.getMonth()]+", "+d.getFullYear();
_5e.innerHTML=_60;
}
_5d.appendChild(_5e);
var _61=writeTimeBar();
_5d.appendChild(_61);
calendarDiv.appendChild(_5d);
}
function getTopPos(_62){
var _63=_62.offsetTop+_62.offsetHeight;
while((_62=_62.offsetParent)!=null){
_63+=_62.offsetTop;
}
return _63+calendar_offsetTop;
}
function getleftPos(_64){
var _65=_64.offsetLeft;
while((_64=_64.offsetParent)!=null){
_65+=_64.offsetLeft;
}
return _65+calendar_offsetLeft;
}
function positionCalendar(_66){
var _67=0;
var _68=0;
var _69=0;
var _6a=0;
if(typeof (window.innerWidth)=="number"){
_67=window.innerWidth;
_68=window.innerHeight;
}else{
if(document.documentElement&&(document.documentElement.clientWidth||document.documentElement.clientHeight)){
_67=document.documentElement.clientWidth;
_68=document.documentElement.clientHeight;
}else{
if(document.body&&(document.body.clientWidth||document.body.clientHeight)){
_67=document.body.clientWidth;
_68=document.body.clientHeight;
}
}
}
_69=_67-getleftPos(_66);
if(_69<=225){
_6a=getleftPos(_66)-205;
}else{
_6a=getleftPos(_66);
}
calendarDiv.style.left=_6a+"px";
calendarDiv.style.top=getTopPos(_66)+"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 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;
}
var selectedDate;
function displayCalendar(_6e,_6f,_70,_71,_72,_73){
if(_71){
calendarDisplayTime=true;
}else{
calendarDisplayTime=false;
}
if(_73!==null&&_73!==undefined){
_6e.value=_73;
}
if((_6e.value.length>6)&&(_6e.value!=="YYYY-MM-DD")){
if(!_6e.value.match(/^[0-9]*?$/gi)){
var _74=_6e.value.split(/[^0-9]/gi);
var _75=new Object();
_75.m=_6f.indexOf("mm");
if(_75.m==-1){
_75.m=_6f.indexOf("m");
}
_75.d=_6f.indexOf("dd");
if(_75.d==-1){
_75.d=_6f.indexOf("d");
}
_75.y=_6f.indexOf("yyyy");
_75.h=_6f.indexOf("hh");
_75.i=_6f.indexOf("ii");
this.initialHour="00";
this.initialMinute="00";
var _76=["y","m","d","h","i"];
var _77=["currentYear","currentMonth","inputDay","currentHour","currentMinute"];
var _78=[4,2,2,2,2];
for(var i=0;i<_76.length;i++){
if(_75[_76[i]]>=0){
window[_77[i]]=_6e.value.substr(_75[_76[i]],_78[i])/1;
}
}
currentMonth--;
}else{
var _7a=_6f.indexOf("mm");
currentMonth=_6e.value.substr(_7a,2)/1-1;
var _7b=_6f.indexOf("yyyy");
currentYear=_6e.value.substr(_7b,4);
var _7c=_6f.indexOf("dd");
tmpDay=_6e.value.substr(_7c,2);
var _7d=_6f.indexOf("hh");
if(_7d>=0){
tmpHour=_6e.value.substr(_7d,2);
currentHour=tmpHour;
}else{
currentHour="00";
}
var _7e=_6f.indexOf("ii");
if(_7e>=0){
tmpMinute=_6e.value.substr(_7e,2);
currentMinute=tmpMinute;
}else{
currentMinute="00";
}
}
}else{
var d=new Date();
currentMonth=d.getMonth();
currentYear=d.getFullYear();
currentHour="08";
currentMinute="00";
inputDay=d.getDate()/1;
}
inputYear=currentYear;
inputMonth=currentMonth;
if(!calendarDiv){
initCalendar();
}else{
if(calendarDiv.style.display=="block"){
closeCalendar();
return false;
}
writeCalendarContent();
}
returnFormat=_6f;
returnDateTo=_6e;
positionCalendar(_70);
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 addDaysToDate(_80,_81){
var t=_80.getTime()+(_81*1000*60*60*24);
return new Date(t);
}
var disDate=null;
function toDisable(_83,_84){
if(disDate!=null){
var _85=disDate.getFullYear();
var _86=disDate.getMonth()-1;
var _87=disDate.getDate();
var _88=Date.UTC(_85,_86,_87);
var _89=Date.UTC(_83.getFullYear(),_83.getMonth(),_84);
return _89<_88;
}else{
return false;
}
}
var frmdisDate=null;
function fromDisable(_8a,_8b){
if(frmdisDate!=null){
var _8c=frmdisDate.getFullYear();
var _8d=frmdisDate.getMonth()-1;
var _8e=frmdisDate.getDate();
var _8f=Date.UTC(_8c,_8d,_8e);
var _90=Date.UTC(_8a.getFullYear(),_8a.getMonth(),_8b);
return _90>_8f;
}else{
return false;
}
}
var oDivid;
var offsetX;
var offsetY;
function CalendarPopup(_91){
this.select=function(){
if(arguments.length>0){
var _92=arguments[0];
var _93=arguments[1];
var _94=arguments[2];
selectedDate=(arguments.length>3)?arguments[3]:null;
}
displayCalendar(_92,_94.toLowerCase(),document.getElementById(_93),false,false,selectedDate);
};
this.addDisabledDates=function(){
if(arguments.length>0){
var Str=arguments[1];
var _96=Str.split("/");
var _97=_96[2];
var _98=_96[0]%13;
var _99=_96[1]%32;
var _9a=Date.UTC(_97,_98-1,_99);
var _9b=24*60*60*1000;
yesterdayUTC=_9a+_9b;
var _9c=new Date(yesterdayUTC);
disDate=_9c;
}
};
this.setYearSelectStartOffset=function(){
if(arguments.length>0){
var num=arguments[0];
NUM_turnOffYearSpan=10;
}
};
this.frmdisDatesaitechs=function(){
if(arguments.length>0){
var Str=arguments[1];
var _9f=Str.split("/");
var _a0=_9f[2];
var _a1=_9f[0]%13;
var _a2=_9f[1]%32;
var _a3=Date.UTC(_a0,_a1-1,_a2);
var _a4=24*60*60*1000;
yesterdayUTC=_a3+_a4;
var _a5=new Date(yesterdayUTC);
frmdisDate=_a5;
}
};
}
function datedifference(_a6,_a7){
var _a8=false;
_a6=_a6.split("-");
starttime=new Date(_a6[2],_a6[1],_a6[0]);
starttime=new Date(starttime.valueOf()+31*86400000);
_a7=_a7.split("-");
endtime=new Date(_a7[2],_a7[1],_a7[0]);
endtime=new Date(endtime.valueOf());
if(endtime>=starttime){
_a8=true;
}
return _a8;
}
function Hack_CMS(_a9){
if(_a9!=null){
try{
_a9.focus();
_a9.blur();
}
catch(e){
}
try{
eval(_a9.getAttribute("onblur"));
eval(_a9.getAttribute("onchange"));
}
catch(e){
}
}
}
var currentTime=new Date();
var month=currentTime.getMonth()+1;
var day=currentTime.getDate();
var year=(currentTime.getFullYear()-13);
var saitechs_limit=month+"/"+day+"/"+year;
var monthname=new Array("01","02","03","04","05","06","07","08","09","10","11","12");
var calender_date=year+"-"+monthname[month-1]+"-"+day;
var hide_today_date_from_bottom=true;
document.onclick=function autoHideCalendar(e){
if(calendarDiv&&calendarDiv.style.display=="block"){
if(!openerClick){
var _ab;
if(!e){
var e=window.event;
}
if(e.target){
_ab=e.target;
}else{
if(e.srcElement){
_ab=e.srcElement;
}
}
if(_ab.nodeType==3){
_ab=_ab.parentNode;
}
var _ac=false;
var _ad=_ab.parentNode;
while(_ad&&!_ac){
_ac=(_ad.id==calendarDiv.id);
_ad=_ad.parentNode;
}
if(!_ac){
closeCalendar();
}
}else{
openerClick=false;
}
}
};

