function validate() {
		
			date1 = document.getElementById('checkin').value;
			if (date1 == null || date1 == '') {
				alert('You must choose a check in date');
				return false;
			}
			cid = date1.substring(0,2);
			mid = date1.substring(3,5);
			yid = date1.substring(6);
			checkin = new Date(yid,mid,cid);
			
			date2 = document.getElementById('checkout').value;
			if (date2 == null || date2 == '') {
				alert('You must choose a check out date');
				return false;
			}
			cod = date2.substring(0,2);
			mod = date2.substring(3,5);
			yod = date2.substring(6);
			checkout = new Date(yod,mod,cod);
			
			var daysDiff = (checkout.valueOf() - checkin.valueOf());
			daysDiff = Math.floor(((((daysDiff  / 1000) / 60) / 60) / 24));

			if (daysDiff < 1) {
				alert('The check out date must be at least one day after check in date');
				return false;
			}
//			me.D1.options[me.D1.selectedIndex].value
			var adults = document.getElementById('adults').value;
			var adindex = document.getElementById('adults').selectedIndex;
			adults = parseInt(document.getElementById('adults').options[adindex].value);
			
			
			var rooms = document.getElementById('rooms').value;
			var adindex = document.getElementById('rooms').selectedIndex;
			rooms = parseInt(document.getElementById('rooms').options[adindex].value);
			
			window.open ('https://www.primal-res.gr/HotelBookingEngines/PrimalResV5/BookingEngine/Step1.php?HotelCode=1109807250&LanguageID=1&Adults='+adults + '&NoOfRooms='+rooms+'&CheckInDate='+date1+'&CheckOutDate='+date2+'&Step2=1' , 'newwindow', config='height=720,width=1018, toolbar=no, menubar=no, scrollbars=yes, resizable=no,location=no, directories=no, status=no');
		}

