var thispath = "isc/hotels.nsf"; var deadlineDays =5; var limitdate; function ConductSearch() //==================== { var Countries; var Countryindex; var Cities; var Cityindex; var now = new Date(); var day = now.getDate(); var year = now.getFullYear(); var month = now.getMonth() +1; var msgflag; var Dobj; var Di; var Mobj; var Mi; //------------------------------------------------ msgflag = "false"; // 6 days limitdate = now.getTime() + 518400000; Dobj = document.forms[0].CheckInDay; Di = Dobj.selectedIndex Mobj = document.forms[0].CheckInMonth; Mi = Mobj.selectedIndex if (Mobj.options[ Mi ].value < month) year = year + 1; if ((Mobj.options[Mi].value == month) && (Dobj.options[Di].value < day)) year = year + 1; days = getDays( Mobj.options[Mi].value, year); if(Dobj.options[Di].value > days) { msgflag="true"; msg="Incorrect day for the month!"; Dobj.focus(); alert(msg); return false; } else if (Date.UTC(year, Mobj.options[Mi].value-1, Dobj.options[Di].value) < limitdate) { msgflag="true"; msg="There is not enough time left to process your booking! \n Please specify a date at least " + deadlineDays + " business days ahead of today."; Mobj.focus(); alert(msg); return false; } if (msgflag == "false") { if ( typeof( document.forms[0].Country) != "undefined" ) { Countries = document.forms[0].Country.options; Countryindex = Countries.selectedIndex; document.forms[0].CountryChoosen.value= Countries[Countryindex ].text; } if ( typeof( document.forms[0].AllCities) != "undefined" ) { Cities = document.forms[0].AllCities.options; Cityindex = Cities.selectedIndex; document.forms[0].CityChoosen.value= Cities[Cityindex ].text; } else { if ( typeof( document.forms[0].OneCity ) != "undefined" ) { Cities = document.forms[0].OneCity.options; Cityindex = Cities.selectedIndex; document.forms[0].CityChoosen.value= Cities[Cityindex ].text; } } document.forms[0].submit() } } function setDates() //==================== { var now = new Date(); var limitdate = now.getTime() +604800000; var day; var month; //------------------------------------------------ now.setTime(limitdate); day = now.getDate()-1; month = now.getMonth(); document.forms[0].CheckInDay.options[day].selected=true; document.forms[0].CheckInMonth.options[month].selected=true; } function afterChanging() //==================== { var CountryList = document.forms[0].Country.options; var CountrySelected = CountryList.selectedIndex; var country = CountryList[CountrySelected].text; var PairsList = document.forms[0].CitiesInCountriesList.options; var PairsSize = PairsList.length -1; var CClist = document.forms[0].AllCities.options; var FullList = new Array( ); var pairTXT; var pair; var nopt; //------------------------------------------------ CClist.length = 0; switch ( country ) { case "All Europe": /* for ( var i=0; i<=PairsSize; i++ ) { pairTXT = PairsList[i].text; pair = pairTXT.split("="); FullList.push(pair[1]); } FullList.sort(); for ( var i=0; i < FullList.length; i++ ) { nopt = new Option( FullList[i], FullList[i], false, false ); CClist.length += 1; CClist[CClist.length - 1] = nopt; } */ pairTXT = document.forms[0].CitiesAvailable.value; pair = pairTXT.split("; "); for ( var i=0; i 0 ) { CClist.selectedIndex = 0; } } function afterLoad() //==================== { var FullList = new Array( ); var PairsList = document.forms[0].CitiesInCountriesList.options; var PairsSize = PairsList.length -1; var AltRVisa =document.forms[0].BLOCKTEXT_ICON1.value; var AltGuide =document.forms[0].BLOCKTEXT_ICON2.value; var AltTransfer = document.forms[0].BLOCKTEXT_ICON3.value; var AltGroup = document.forms[0].BLOCKTEXT_ICON4.value; var CClist; var CCsize; var city; var country; var redraw = 0; var pairTXT; var pair; var nopt; //---------------------------------------------------------------- if (document.forms[0].AGENTUNID.value !="" ) { setCookie ( "SashaHotelsAG", document.forms[0].AGENTUNID.value, inSixMonth ) } if (document.forms[0].AFFILIATEUNID.value !="" ) { setCookie ( "SashaHotelsAF", document.forms[0].AFFILIATEUNID.value, inSixMonth ) } if ( typeof( document.images["russianvisa"]) != "undefined" ) { document.images["russianvisa"].alt =AltRVisa; } document.images["travelguide"].alt =AltGuide; document.images["transfer"].alt = AltTransfer; document.images["group"].alt = AltGroup; if ( typeof( document.forms[0].Country) != "undefined" ) { // we should focus on proper city CClist = document.forms[0].AllCities.options; redraw = 1; } else { if ( typeof( document.forms[0].OneCity) != "undefined" ) { CClist = document.forms[0].OneCity.options; redraw = 1; } } if (redraw == 1 ) { CClist.length = 0; country = document.forms[0].CountryChoosen.value; switch ( country ) { case "All Europe": /* for ( var i=0; i<=PairsSize; i++ ) { pairTXT = PairsList[i].text; pair = pairTXT.split("="); FullList.push(pair[1]); } FullList.sort(); for ( var i=0; i < FullList.length; i++ ) { nopt = new Option( FullList[i], FullList[i], false, false ); CClist.length += 1; CClist[CClist.length - 1] = nopt; } */ pairTXT = document.forms[0].CitiesAvailable.value; pair = pairTXT.split("; "); for ( var i=0; i