var languageCode="fi";
var form_id="";
var pathToImages="kuvakirjasto/";
var speedOfSelectBoxSliding=200;
var intervalSelectBox_minutes=5;
var calendar_offsetTop=0;
var calendar_offsetLeft=0;
var calendarDiv=false;
var limitDateSelection=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 "fi":
var monthArray=["Tammikuu","Helmikuu","Maaliskuu","Huhtikuu","Toukokuu","Kes&auml;kuu","Hein&auml;kuu","Elokuu","Syyskuu","Lokakuu","Marraskuu","Joulukuu"];
var monthArrayShort=["Tammi","Helmi","Maalis","Huhti","Touko","Kes&auml;","Hein&auml;","Elo","Syys","Loka","Marras","Joulu"];
var dayArray=["Ma","Ti","Ke","To","Pe","La","Su"];
var weekString="Vk";
var todayString="";
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;
}
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 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;
var selectedCalendar="";
function cancelCalendarEvent(){
return false;
}
function isLeapYear(_1){
if(_1%400==0||(_1%4==0&&_1%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";
}else{
document.getElementById("monthDropDown").style.display="block";
document.getElementById("yearDropDown").style.display="none";
}
}
function showYearDropDown(){
if(document.getElementById("yearDropDown").style.display=="block"){
document.getElementById("yearDropDown").style.display="none";
}else{
document.getElementById("yearDropDown").style.display="block";
document.getElementById("monthDropDown").style.display="none";
}
}
function selectMonth(){
document.getElementById("calendar_month_txt").innerHTML=this.innerHTML;
currentMonth=this.id.replace(/[^\d]/g,"");
document.getElementById("monthDropDown").style.display="none";
for(var no=0;no<monthArray.length;no++){
document.getElementById("monthDiv_"+no).style.color="";
}
this.style.color=selectBoxHighlightColor;
activeSelectBoxMonth=this;
writeCalendarContent();
}
function selectYear(){
document.getElementById("calendar_year_txt").innerHTML=this.innerHTML;
currentYear=this.innerHTML.replace(/[^\d]/g,"");
document.getElementById("yearDropDown").style.display="none";
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 _3=document.createElement("DIV");
_3.className="monthYearPicker";
_3.id="monthPicker";
for(var no=0;no<monthArray.length;no++){
var _4=document.createElement("DIV");
_4.innerHTML=monthArray[no];
_4.onmouseover=highlightMonthYear;
_4.onmouseout=highlightMonthYear;
_4.onclick=selectMonth;
_4.id="monthDiv_"+no;
_4.style.width="56px";
_4.onselectstart=cancelCalendarEvent;
_3.appendChild(_4);
if(currentMonth&&currentMonth==no){
_4.style.color=selectBoxHighlightColor;
activeSelectBoxMonth=_4;
}
}
return _3;
}
function changeSelectBoxYear(e,_6){
if(!_6){
_6=this;
}
var _7=_6.parentNode.getElementsByTagName("DIV");
if(_6.innerHTML.indexOf("-")>=0){
var _8=_7[1].innerHTML/1-1;
if(activeSelectBoxYear){
activeSelectBoxYear.style.color="";
}
}else{
var _8=_7[1].innerHTML/1+1;
if(activeSelectBoxYear){
activeSelectBoxYear.style.color="";
}
}
for(var no=1;no<_7.length-1;no++){
_7[no].innerHTML=_8+no-1;
_7[no].id="yearDiv"+(_8/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,_9){
if(!_9){
_9=this;
}
var _10=_9.parentNode.getElementsByTagName("DIV");
if(_9.innerHTML.indexOf("-")>=0){
var _11=_10[1].innerHTML/1-1;
if(_11<0){
_11=0;
}
if(activeSelectBoxHour){
activeSelectBoxHour.style.color="";
}
}else{
var _11=_10[1].innerHTML/1+1;
if(_11>14){
_11=14;
}
if(activeSelectBoxHour){
activeSelectBoxHour.style.color="";
}
}
var _12="";
for(var no=1;no<_10.length-1;no++){
if((_11/1+no/1)<11){
_12="0";
}else{
_12="";
}
_10[no].innerHTML=_12+(_11+no-1);
_10[no].id="hourDiv"+(_11/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 div=document.getElementById("yearDropDown");
var _14=div.getElementsByTagName("DIV");
for(var no=1;no<_14.length-1;no++){
_14[no].innerHTML=currentYear/1+no;
if(currentYear==(currentYear/1+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 createYearDiv(){
if(!document.getElementById("yearDropDown")){
var div=document.createElement("DIV");
div.className="monthYearPicker";
}else{
var div=document.getElementById("yearDropDown");
var _15=div.getElementsByTagName("DIV");
for(var no=0;no<_15.length;no++){
_15[no].parentNode.removeChild(_15[no]);
}
}
var d=new Date();
if(currentYear){
d.setFullYear(currentYear);
}
var _17=d.getFullYear();
for(var no=_17;no<(_17+6);no++){
var _18=document.createElement("DIV");
_18.innerHTML=no;
_18.onmouseover=highlightMonthYear;
_18.onmouseout=highlightMonthYear;
_18.onclick=selectYear;
_18.id="yearDiv"+no;
_18.onselectstart=cancelCalendarEvent;
div.appendChild(_18);
if(currentYear&&currentYear==no){
_18.style.color=selectBoxHighlightColor;
activeSelectBoxYear=_18;
}
}
return div;
}
function slideCalendarSelectBox(){
if(selectBoxMovementInProgress){
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 _19=div.getElementsByTagName("DIV");
for(var no=0;no<_19.length;no++){
_19[no].parentNode.removeChild(_19[no]);
}
}
if(!currentHour){
currentHour=0;
}
var _20=currentHour/1;
if(_20>14){
_20=14;
}
var _21=document.createElement("DIV");
_21.innerHTML="&nbsp;&nbsp;- ";
_21.onclick=changeSelectBoxHour;
_21.onmouseover=highlightMonthYear;
_21.onmouseout=function(){
selectBoxMovementInProgress=false;
};
_21.onselectstart=cancelCalendarEvent;
div.appendChild(_21);
for(var no=_20;no<_20+10;no++){
var _22="";
if(no/1<10){
_22="0";
}
var _21=document.createElement("DIV");
_21.innerHTML=_22+no;
_21.onmouseover=highlightMonthYear;
_21.onmouseout=highlightMonthYear;
_21.onclick=selectHour;
_21.id="hourDiv"+no;
_21.onselectstart=cancelCalendarEvent;
div.appendChild(_21);
if(currentYear&&currentYear==no){
_21.style.color=selectBoxHighlightColor;
activeSelectBoxYear=_21;
}
}
var _21=document.createElement("DIV");
_21.innerHTML="&nbsp;&nbsp;+ ";
_21.onclick=changeSelectBoxHour;
_21.onmouseover=highlightMonthYear;
_21.onmouseout=function(){
selectBoxMovementInProgress=false;
};
_21.onselectstart=cancelCalendarEvent;
div.appendChild(_21);
return div;
}
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";
calendarDiv.style.display="none";
if(iframeObj){
iframeObj.style.display="none";
}
if(activeSelectBoxMonth){
activeSelectBoxMonth.className="";
}
if(activeSelectBoxYear){
activeSelectBoxYear.className="";
}
}
function writeTopBar(){
var _23=document.createElement("DIV");
_23.className="topBar";
_23.id="topBar";
calendarDiv.appendChild(_23);
var _24=document.createElement("DIV");
_24.style.marginRight="1px";
var img=document.createElement("IMG");
img.src=pathToImages+"left.gif";
img.onmouseover=highlightArrow;
img.onclick=switchMonth;
img.onmouseout=highlightArrow;
_24.appendChild(img);
_23.appendChild(_24);
if(Opera){
_24.style.width="16px";
}
var _26=document.createElement("DIV");
_26.style.marginRight="1px";
var img=document.createElement("IMG");
img.src=pathToImages+"right.gif";
img.onclick=switchMonth;
img.onmouseover=highlightArrow;
img.onmouseout=highlightArrow;
_26.appendChild(img);
if(Opera){
_26.style.width="16px";
}
_23.appendChild(_26);
var _27=document.createElement("DIV");
_27.id="monthSelect";
_27.onmouseover=highlightSelect;
_27.onmouseout=highlightSelect;
_27.onclick=showMonthDropDown;
var _28=document.createElement("SPAN");
_28.innerHTML=monthArray[currentMonth];
_28.id="calendar_month_txt";
_27.appendChild(_28);
var img=document.createElement("IMG");
img.src=pathToImages+"down.gif";
img.style.position="absolute";
img.style.right="0px";
_27.appendChild(img);
_27.className="selectBox";
if(Opera){
img.style.cssText="float:right;position:relative";
img.style.position="relative";
img.style.styleFloat="right";
}
_23.appendChild(_27);
var _29=createMonthDiv();
_29.style.left="37px";
_29.style.top=_27.offsetTop+_27.offsetHeight+1+"px";
_29.style.width="60px";
_29.id="monthDropDown";
calendarDiv.appendChild(_29);
var _30=document.createElement("DIV");
_30.onmouseover=highlightSelect;
_30.onmouseout=highlightSelect;
_30.onclick=showYearDropDown;
var _28=document.createElement("SPAN");
_28.innerHTML=currentYear;
_28.id="calendar_year_txt";
_30.appendChild(_28);
_23.appendChild(_30);
var img=document.createElement("IMG");
img.src=pathToImages+"down.gif";
_30.appendChild(img);
_30.className="selectBox";
if(Opera){
_30.style.width="50px";
img.style.cssText="float:right";
img.style.position="relative";
img.style.styleFloat="right";
}
var _31=createYearDiv();
_31.style.left="113px";
_31.style.top=_27.offsetTop+_27.offsetHeight+1+"px";
_31.style.width="35px";
_31.id="yearDropDown";
calendarDiv.appendChild(_31);
var img=document.createElement("IMG");
img.src=pathToImages+"close.gif";
img.style.styleFloat="right";
img.onmouseover=highlightClose;
img.onmouseout=highlightClose;
img.onclick=closeCalendar;
_23.appendChild(img);
if(!document.all){
img.style.position="absolute";
img.style.right="2px";
}
}
function writeCalendarContent(){
var _32=true;
if(!calendarContentDiv){
calendarContentDiv=document.createElement("DIV");
calendarDiv.appendChild(calendarContentDiv);
_32=false;
}
currentMonth=currentMonth/1;
var d=new Date();
d.setFullYear(currentYear);
d.setDate(1);
d.setMonth(currentMonth);
var _33=d.getDay();
if(_33==0){
_33=7;
}
_33--;
document.getElementById("calendar_year_txt").innerHTML=currentYear;
document.getElementById("calendar_month_txt").innerHTML=monthArray[currentMonth];
var _34=calendarContentDiv.getElementsByTagName("TABLE");
if(_34.length>0){
calendarContentDiv.removeChild(_34[0]);
}
var _35=document.createElement("TABLE");
_35.cellSpacing="0";
_35.width="100%";
calendarContentDiv.appendChild(_35);
var _36=document.createElement("TBODY");
_35.appendChild(_36);
var row=_36.insertRow(-1);
var _38=row.insertCell(-1);
_38.innerHTML=weekString;
_38.style.backgroundColor="#ECEDF1";
for(var no=0;no<dayArray.length;no++){
var _38=row.insertCell(-1);
_38.innerHTML=dayArray[no];
}
var row=_36.insertRow(-1);
var _38=row.insertCell(-1);
_38.style.backgroundColor="#ECEDF1";
var _39=getWeek(currentYear,currentMonth,1);
_38.innerHTML=_39;
for(var no=0;no<_33;no++){
var _38=row.insertCell(-1);
_38.innerHTML="&nbsp;";
}
var _40=_33;
var _41=daysInMonthArray[currentMonth];
if(_41==28){
if(isLeapYear(currentYear)){
_41=29;
}
}
selectedStartDate=getSelectedStartDate(form_id);
for(var no=1;no<=_41;no++){
d.setDate(no-1);
if(_40>0&&_40%7==0){
var row=_36.insertRow(-1);
var _38=row.insertCell(-1);
var _39=getWeek(currentYear,currentMonth,no);
_38.innerHTML=_39;
_38.style.backgroundColor="#ECEDF1";
}
var _38=row.insertCell(-1);
if(currentYear==inputYear&&currentMonth==inputMonth&&no==inputDay){
_38.className="activeDay";
}
_38.innerHTML=no;
var _42=new Date();
_42.setFullYear(currentYear,currentMonth,no);
if(!limitDateSelection||_42>=selectedStartDate){
_38.onclick=pickDate;
}else{
_38.className="disabledDay";
}
_40++;
}
if(!document.all){
if(calendarContentDiv.offsetHeight){
document.getElementById("topBar").style.top=calendarContentDiv.offsetHeight+document.getElementById("topBar").offsetHeight-1+"px";
}else{
document.getElementById("topBar").style.top="";
document.getElementById("topBar").style.bottom="0px";
}
}
if(iframeObj){
if(!_32){
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,_43){
var _44=currentMonth/1+1;
if(_44<10){
_44="0"+_44;
}
var day;
if(!_43&&this){
day=this.innerHTML;
}else{
day=_43;
}
if(day/1<10){
day="0"+day;
}
if(returnFormat){
returnFormat=returnFormat.replace("dd",day);
returnFormat=returnFormat.replace("mm",_44);
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",_44/1);
returnDateTo.value=returnFormat;
}else{
for(var no=0;no<returnDateToYear.options.length;no++){
if(parseInt(returnDateToYear.options[no].value,10)==parseInt(currentYear,10)){
returnDateToYear.selectedIndex=no;
break;
}
}
for(var no=0;no<returnDateToMonth.options.length;no++){
if(parseInt(returnDateToMonth.options[no].value,10)==parseInt(_44,10)){
returnDateToMonth.selectedIndex=no;
break;
}
}
for(var no=0;no<returnDateToDay.options.length;no++){
if(parseInt(returnDateToDay.options[no].value,10)==parseInt(day,10)){
returnDateToDay.selectedIndex=no;
break;
}
}
if(calendarDisplayTime){
for(var no=0;no<returnDateToHour.options.length;no++){
if(returnDateToHour.options[no].value==currentHour){
returnDateToHour.selectedIndex=no;
break;
}
}
for(var no=0;no<returnDateToMinute.options.length;no++){
if(returnDateToMinute.options[no].value==currentMinute){
returnDateToMinute.selectedIndex=no;
break;
}
}
}
}
closeCalendar();
if(selectedCalendar=="s"){
checkDateOverlap("s",form_id);
}else{
checkDateOverlap("e",form_id);
}
}
function getWeek(_46,_47,day){
day=day/1;
_46=_46/1;
_47=_47/1+1;
var a=Math.floor((14-(_47))/12);
var y=_46+4800-a;
var m=(_47)+(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 getTopPos(_55){
var _56=_55.offsetTop+_55.offsetHeight;
while((_55=_55.offsetParent)!=null){
_56+=_55.offsetTop;
}
return _56+calendar_offsetTop;
}
function getleftPos(_57){
var _58=_57.offsetLeft;
while((_57=_57.offsetParent)!=null){
_58+=_57.offsetLeft;
}
return _58+calendar_offsetLeft;
}
function positionCalendar(_59){
calendarDiv.style.left=getleftPos(_59)+"px";
calendarDiv.style.top=getTopPos(_59)-100+"px";
if(iframeObj){
iframeObj.style.left=calendarDiv.style.left;
iframeObj.style.top=calendarDiv.style.top;
}
}
function initCalendar(){
if(MSIE){
iframeObj=document.createElement("IFRAME");
iframeObj.style.position="absolute";
iframeObj.border="0px";
iframeObj.style.border="0px";
iframeObj.style.backgroundColor="#FF0000";
document.body.appendChild(iframeObj);
}
calendarDiv=document.createElement("DIV");
calendarDiv.id="calendarDiv";
calendarDiv.style.zIndex=1000;
slideCalendarSelectBox();
document.body.appendChild(calendarDiv);
writeTopBar();
if(!currentYear){
var d=new Date();
currentMonth=d.getMonth();
currentYear=d.getFullYear();
}
writeCalendarContent();
}
function setTimeProperties(){
if(!calendarDisplayTime){
}else{
}
}
function calendarSortItems(a,b){
return a/1-b/1;
}
function displayCalendar(_61,_62,_63,_64,_65){
if(_64){
calendarDisplayTime=true;
}else{
calendarDisplayTime=false;
}
if(_61.value.length>0){
if(!_62.match(/^[0-9]*?$/gi)){
var _66=_61.value.split(/[^0-9]/gi);
var _67=new Array();
_67["m"]=_62.indexOf("mm");
if(_67["m"]==-1){
_67["m"]=_62.indexOf("m");
}
_67["d"]=_62.indexOf("dd");
if(_67["d"]==-1){
_67["d"]=_62.indexOf("d");
}
_67["y"]=_62.indexOf("yyyy");
_67["h"]=_62.indexOf("hh");
_67["i"]=_62.indexOf("ii");
var _68=Array();
_68[0]=_67["m"];
_68[1]=_67["d"];
_68[2]=_67["y"];
_68[3]=_67["h"];
_68[4]=_67["i"];
_68=_68.sort(calendarSortItems);
var _69=-1;
currentHour="00";
currentMinute="00";
for(var no=0;no<_68.length;no++){
if(_68[no]==-1){
continue;
}
_69++;
if(_68[no]==_67["m"]){
currentMonth=_66[_69]-1;
continue;
}
if(_68[no]==_67["y"]){
currentYear=_66[_69];
continue;
}
if(_68[no]==_67["d"]){
tmpDay=_66[_69];
continue;
}
if(_68[no]==_67["h"]){
currentHour=_66[_69];
continue;
}
if(_68[no]==_67["i"]){
currentMinute=_66[_69];
continue;
}
}
currentMonth=currentMonth/1;
tmpDay=tmpDay/1;
}else{
var _70=_62.indexOf("mm");
currentMonth=_61.value.substr(_70,2)/1-1;
var _71=_62.indexOf("yyyy");
currentYear=_61.value.substr(_71,4);
var _72=_62.indexOf("dd");
tmpDay=_61.value.substr(_72,2);
var _73=_62.indexOf("hh");
if(_73>=0){
tmpHour=_61.value.substr(_73,2);
currentHour=tmpHour;
}else{
currentHour="00";
}
var _74=_62.indexOf("ii");
if(_74>=0){
tmpMinute=_61.value.substr(_74,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=_62;
returnDateTo=_61;
positionCalendar(_63);
calendarDiv.style.visibility="visible";
calendarDiv.style.display="block";
if(iframeObj){
iframeObj.style.display="";
iframeObj.style.height="140px";
iframeObj.style.width="195px";
}
setTimeProperties();
updateYearDiv();
updateMonthDiv();
}
function displayCalendarSelectBox(_75,_76,_77,_78,_79,_80,_81,cal,_83){
if(cal!=""){
selectedCalendar=cal;
}
form_id=_83;
if(_81==true){
limitDateSelection=true;
}else{
limitDateSelection=false;
}
if(!_78){
calendarDisplayTime=false;
}else{
calendarDisplayTime=true;
}
currentMonth=_76.options[_76.selectedIndex].value/1-1;
currentYear=_75.options[_75.selectedIndex].value;
if(_78){
currentHour=_78.options[_78.selectedIndex].value;
inputHour=currentHour/1;
}
if(_79){
currentMinute=_79.options[_79.selectedIndex].value;
inputMinute=currentMinute/1;
}
inputYear=_75.options[_75.selectedIndex].value;
inputMonth=_76.options[_76.selectedIndex].value/1-1;
inputDay=_77.options[_77.selectedIndex].value/1;
if(!calendarDiv){
initCalendar();
}else{
writeCalendarContent();
}
returnDateToYear=_75;
returnDateToMonth=_76;
returnDateToDay=_77;
returnDateToHour=_78;
returnDateToMinute=_79;
returnFormat=false;
returnDateTo=false;
positionCalendar(_80);
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";
}
setTimeProperties();
updateYearDiv();
updateMonthDiv();
}


