
function dataCheck(){
	
	startDate = document.inquiry.a.value;	
	startDate = startDate.replace("-","");
	startDate = startDate.replace("-","");
	endDate = document.inquiry.d.value;	
	endDate = endDate.replace("-","");
	endDate = endDate.replace("-","");	
	check_Date = endDate - startDate;	
	
	if(check_Date < 0){
		alert("Departure Date can not be earlier than Arrival Date\nPlease select Arrival and Departure Date again");
		return false;
	
	}
	
		
	startDateSend = document.inquiry.a.value;	
	startDateSend = startDateSend.replace("-","_");
	startDateSend = startDateSend.replace("-","_");
	endDateSend = document.inquiry.d.value;	
	endDateSend = endDateSend.replace("-","_");
	endDateSend = endDateSend.replace("-","_");	
		
	url = 'inquiry.html?a=' + startDateSend + '&d=' + endDateSend + '&r=' + document.inquiry.r.selectedIndex + '&p=' + document.inquiry.p.selectedIndex
	location.href = url;

}

document.write('<form action="inquiry.html" method="get" name="inquiry" onSubmit="return dataCheck();">\
				<img src="images-template/spacer.gif" width="15" height="50" border="0" vspace="0" hspace="0" align="left"/>\
				<br /><span class="inquiry-title">Inquiries and Reservations </span>\
				<br /><br />\
				<table cellpadding="5" cellspacing="0" border="0">	\
					<tr><td><span class="inquiry">Arrival:</span><script>DateInput(\'a\', true, \'YYYY-MM-DD\')</script></td></tr>\
					<tr><td><span class="inquiry">Departure:</span><script>DateInput(\'d\', true, \'YYYY-MM-DD\')</script></td></tr>\
					<tr>\
						<td class="inquiry">\
							Room: \
							<select name="r" id="r" style="font-size:12px">\
								<option>1</option>\
								<option>2</option>\
								<option>3</option>\
								<option>4</option>\
								<option>5</option>\
								<option>6</option>\
							</select>\
							People: \
							<select name="p" id="p" style="font-size:12px">\
								<option>1</option>\
								<option>2</option>\
								<option>3</option>\
								<option>4</option>\
								<option>5</option>\
								<option>6</option>\
								<option>7</option>\
								<option>8</option>\
								<option>9</option>\
								<option>10</option>\
								<option value="11">> 10</option>\
							</select>\
						</td>\
					</tr>\
					<tr><td><br /><input  type="image" src="images-template/button-check.jpg"/></td></tr>\
				</table>\
				</form>');
