function popupCalendar(sF,sDEl,sMEl,sYEl,sLang,sCntry,XP,YP,LP,TP) { var oForm = document.forms[sF]; var oObj = oForm.elements[sMEl]; var oObj2 = oForm.elements[sYEl]; var strCalendarURL = "NoleggioAuto/js/calendar.html"; oMonths=new Array("01","02","03","04","05","06","07","08","09","10","11","12"); oDate=new Date(); this_month=parseInt(oDate.getMonth()) + 1; this_year=oDate.getYear(); if (this_year < 1900) this_year=1900+this_year; testMnth= parseInt(oObj.selectedIndex)+1; if (this_month > testMnth) { this_year=parseInt(this_year)+1; } //alert(this_year); strCalendarURL+="?" + oMonths[oObj.selectedIndex] + oObj2.value; strCalendarURL+="&" + sF; strCalendarURL+="&" + sDEl; strCalendarURL+="&" + sMEl; strCalendarURL+="&" + sYEl; strCalendarURL+="&" + sLang; strCalendarURL+="&" + sCntry; var strOptions = 'screenX='+ XP + ',screenY=' + YP + ',left=' + LP + ',top=' + TP; calendarWindow = window.open(strCalendarURL,'calendar','resizable=no,scrollbars=no,toolbar=no,menubar=no,height=160,width=180,' + strOptions); calendarWindow.focus(); return false; } function popupCalendarDuplex(sF,sDEl,sMEl,sYEl,sLang,sCntry,XP,YP,LP,TP,sGIl) { var oForm = document.forms[sF]; //var oObj = oForm.elements[sMEl]; var oObj2 = oForm.elements[sYEl]; var strCalendarURL = "NoleggioAuto/js/calendarDuplex.html"; oMonths=new Array("01","02","03","04","05","06","07","08","09","10","11","12"); oMonthsDuplex=new Array("01","02","03","04","05","06","07","08","09","10","11","12","13","14","15","16","17","18","19","20","21","22","23","24"); oDate=new Date(); this_month=parseInt(oDate.getMonth()) + 1; this_year=oDate.getYear(); if (this_year < 1900) this_year=1900+this_year; testMnth= parseInt(oObj2.selectedIndex)+1; if (this_month > testMnth) { this_year=parseInt(this_year)+1; } //alert(this_year); strCalendarURL+="?" + oMonthsDuplex[oObj2.selectedIndex] + oObj2.value; strCalendarURL+="&" + sF; strCalendarURL+="&" + sDEl; strCalendarURL+="&" + sMEl; strCalendarURL+="&" + sYEl; strCalendarURL+="&" + sLang; strCalendarURL+="&" + sCntry; strCalendarURL+="&" + sGIl; var strOptions = 'screenX='+ XP + ',screenY=' + YP + ',left=' + LP + ',top=' + TP; calendarWindow = window.open(strCalendarURL,'calendar','resizable=no,scrollbars=no,toolbar=no,menubar=no,height=160,width=180,' + strOptions); calendarWindow.focus(); return false; } function submitIfLocationCodeNotEmpty(sF, sCTb, sSSb, sCSb, sRE, sST, url) { var strValue; var objForm = document.forms[sF]; if(url == null) { return false; } if (objForm == null) { return false; } var objTBElement = objForm.elements[sRE]; if (objTBElement == null) { return false; } strValue = objTBElement.value; if (strValue != null && strValue !="") { objForm.submit(); } else { searchRentalLocation(sF, sCTb, sSSb, sCSb, sRE, sST, url); } return false; } function searchRentalLocation(sF, sCTb, sSSb, sCSb, sRE, sST, url) { if(sF == "" || sRE == "") { return false; } var cityName = document.forms[sF].elements[sCTb].value; var stateName = document.forms[sF].elements[sSSb].value; var countryNameSB = document.forms[sF].elements[sCSb]; var countryName = countryNameSB.options[countryNameSB.selectedIndex].value; url = url + '?ACTION=RESERVATION&JS_FORM_NAME='; url = url + sF; url = url + '&JS_ELEMENT_NAME=' + sRE; if((cityName == "") || (cityName == null) || (cityName == "null")) { } else { url = url + '&CITY_NAME=' + cityName; } if((stateName == "") || (stateName == null) || (stateName == "null")) { } else { url = url + '&STATE=' + stateName; } if((countryName == "") || (countryName == null) || (countryName == "null")) { } else { url = url + '&COUNTRY_CODE=' + countryName; } url = url + '&LOCATION_SEARCH_TYPE=' + sST; objNewWindow = window.open(url, 'SearchRentalLocation','scrollbars=yes,resizable=yes,width=560,height=420,left=400,top=10'); objNewWindow.focus(); return false; } function resizedPopUp(objPage, objSize) { window.open(objPage, 'Info', 'resizable=yes,scrollbars=no,toolbar=no,menubar=no,' + objSize); }