function setCheckoutdDate(name) { var str = new String(name); //programmer: pj acayan //date:02/07/2002 //description: /* string.slice is not compatible with javascript v1.1 */ //str = str.slice(-11); if (str.indexOf("checkindate") > -1) { if (document.frmMain.Monthcheckindate.selectedIndex == 11 && document.frmMain.Daycheckindate.selectedIndex == 30) { document.frmMain.Yearcheckoutdate.selectedIndex = document.frmMain.Yearcheckindate.selectedIndex + 1; document.frmMain.Monthcheckoutdate.selectedIndex = 0; document.frmMain.Daycheckoutdate.selectedIndex = 0; document.frmMain.checkoutdate.value = document.frmMain.Monthcheckoutdate.options[document.frmMain.Monthcheckoutdate.selectedIndex].value + "/" + document.frmMain.Daycheckoutdate.options[document.frmMain.Daycheckoutdate.selectedIndex].value + "/" + document.frmMain.Yearcheckoutdate.options[document.frmMain.Yearcheckoutdate.selectedIndex].value; } else if (document.frmMain.Monthcheckindate.selectedIndex == 1 && document.frmMain.Daycheckindate.selectedIndex == 28) { document.frmMain.Yearcheckoutdate.selectedIndex = document.frmMain.Yearcheckindate.selectedIndex; document.frmMain.Monthcheckoutdate.selectedIndex = document.frmMain.Monthcheckindate.selectedIndex + 1; document.frmMain.Daycheckoutdate.selectedIndex = 0; document.frmMain.checkoutdate.value = document.frmMain.Monthcheckoutdate.options[document.frmMain.Monthcheckoutdate.selectedIndex].value + "/" + document.frmMain.Daycheckoutdate.options[document.frmMain.Daycheckoutdate.selectedIndex].value + "/" + document.frmMain.Yearcheckoutdate.options[document.frmMain.Yearcheckoutdate.selectedIndex].value; } else if ((document.frmMain.Monthcheckindate.selectedIndex == 1 && document.frmMain.Daycheckindate.selectedIndex == 27) && (document.frmMain.Yearcheckindate.value % 4 != 0)) { document.frmMain.Yearcheckoutdate.selectedIndex = document.frmMain.Yearcheckindate.selectedIndex; document.frmMain.Monthcheckoutdate.selectedIndex = document.frmMain.Monthcheckindate.selectedIndex + 1; document.frmMain.Daycheckoutdate.selectedIndex = 0; document.frmMain.checkoutdate.value = document.frmMain.Monthcheckoutdate.options[document.frmMain.Monthcheckoutdate.selectedIndex].value + "/" + document.frmMain.Daycheckoutdate.options[document.frmMain.Daycheckoutdate.selectedIndex].value + "/" + document.frmMain.Yearcheckoutdate.options[document.frmMain.Yearcheckoutdate.selectedIndex].value; } else if ((document.frmMain.Monthcheckindate.selectedIndex == 0 && document.frmMain.Daycheckindate.selectedIndex == 30) || (document.frmMain.Monthcheckindate.selectedIndex == 2 && document.frmMain.Daycheckindate.selectedIndex == 30) || (document.frmMain.Monthcheckindate.selectedIndex == 3 && document.frmMain.Daycheckindate.selectedIndex == 29) || (document.frmMain.Monthcheckindate.selectedIndex == 4 && document.frmMain.Daycheckindate.selectedIndex == 30) || (document.frmMain.Monthcheckindate.selectedIndex == 5 && document.frmMain.Daycheckindate.selectedIndex == 29) || (document.frmMain.Monthcheckindate.selectedIndex == 6 && document.frmMain.Daycheckindate.selectedIndex == 30) || (document.frmMain.Monthcheckindate.selectedIndex == 7 && document.frmMain.Daycheckindate.selectedIndex == 30) || (document.frmMain.Monthcheckindate.selectedIndex == 8 && document.frmMain.Daycheckindate.selectedIndex == 29) || (document.frmMain.Monthcheckindate.selectedIndex == 9 && document.frmMain.Daycheckindate.selectedIndex == 30) || (document.frmMain.Monthcheckindate.selectedIndex == 10 && document.frmMain.Daycheckindate.selectedIndex == 29)) { document.frmMain.Yearcheckoutdate.selectedIndex = document.frmMain.Yearcheckindate.selectedIndex; document.frmMain.Monthcheckoutdate.selectedIndex = document.frmMain.Monthcheckindate.selectedIndex + 1; document.frmMain.Daycheckoutdate.selectedIndex = 0; document.frmMain.checkoutdate.value = document.frmMain.Monthcheckoutdate.options[document.frmMain.Monthcheckoutdate.selectedIndex].value + "/" + document.frmMain.Daycheckoutdate.options[document.frmMain.Daycheckoutdate.selectedIndex].value + "/" + document.frmMain.Yearcheckoutdate.options[document.frmMain.Yearcheckoutdate.selectedIndex].value; } else { document.frmMain.Yearcheckoutdate.selectedIndex = document.frmMain.Yearcheckindate.selectedIndex; document.frmMain.Monthcheckoutdate.selectedIndex = document.frmMain.Monthcheckindate.selectedIndex; document.frmMain.Daycheckoutdate.selectedIndex = document.frmMain.Daycheckindate.selectedIndex + 1; document.frmMain.checkoutdate.value = document.frmMain.Monthcheckoutdate.options[document.frmMain.Monthcheckoutdate.selectedIndex].value + "/" + document.frmMain.Daycheckoutdate.options[document.frmMain.Daycheckoutdate.selectedIndex].value + "/" + document.frmMain.Yearcheckoutdate.options[document.frmMain.Yearcheckoutdate.selectedIndex].value; } } CheckDaysOut('frmMain'); } function CheckDays(FormName, slMonth, slDay, slYear) { var mth = eval("document." + FormName + "." + slMonth + ".options[document." + FormName + "." + slMonth + ".selectedIndex].value"); var yr = eval("parseInt(document." + FormName + "." + slYear + ".options[document." + FormName + "." + slYear + ".selectedIndex].value)"); var dayLength = eval("document." + FormName + "." + slDay + ".length"); var days = 0; if (mth==1 || mth==3 || mth==5 || mth==7 || mth==8 || mth==10 || mth==12) { days = 31; } else if (mth==4 || mth==6 || mth==9 || mth==11) { days = 30; } else if (mth==2) { days = (yr%4==0 ? 29 : 28); } eval("document." + FormName + "." + slDay + ".length = days"); if (dayLength < days) { for (var i=dayLength;i < days;i++) { eval("document." + FormName + "." + slDay + ".options[i].value = i + 1"); eval("document." + FormName + "." + slDay + ".options[i].text = i + 1"); } } } function CheckDaysOut(FormName) { var mth = eval("document." + FormName + ".Monthcheckoutdate.options[document." + FormName + ".Monthcheckoutdate.selectedIndex].value"); var yr = eval("parseInt(document." + FormName + ".Yearcheckoutdate.options[document." + FormName + ".Yearcheckoutdate.selectedIndex].value)"); var dayLength = eval("document." + FormName + ".Daycheckoutdate.length"); var days = 0; //alert('mth=' + mth); if (mth==1 || mth==3 || mth==5 || mth==7 || mth==8 || mth==10 || mth==12) { days = 31; } else if (mth==4 || mth==6 || mth==9 || mth==11) { days = 30; } else if (mth==2) { days = (yr%4==0 ? 29 : 28); } eval("document." + FormName + ".Daycheckoutdate.length = days"); if (dayLength < days) { var pDayPtr var OptPtr pDayPtr = eval("document." + FormName + ".Daycheckoutdate.selectedIndex") OptPtr = eval("document." + FormName + ".Daycheckoutdate") for (var i=dayLength;i < days;i++) { OptPtr.options[i].value = i + 1; OptPtr.options[i].text = i + 1; } OptPtr.selectedIndex = pDayPtr; } }