function findRooms() {
	var body	= '<table><tr>';
	var arrMonth= new Array('Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec');
	var today	= new Date();
	var sel		= '';

	// Hotel Selection
	body += '<td style="font-family: Arial; font-size: 11px; color: #ffffff; width: 270px; padding-left: 30px;">Hotel: <select id="id_hotel" style="font-size: 11px; font-family: Arial;">' +
		'<option value="">Please Select</option>' +
		'<option value="1789">Ventura Inn & Suites Hamilton</option>' +
		'<option value="1791">Ventura Inn & Suites Rotorua</option>' +
		'<option value="2356">Ventura Inn & Suites Auckland Airport</option>' +
		'</select></td>';

	// Date selection
	body += '<td style="font-family: Arial; font-size: 11px; color: #ffffff; width: 300px;">Arrival Date: <select id="id_day" style="font-size: 11px; font-family: Arial;">';
	for(var i = 1; i <= 31; i++) {
		sel = '';
		if(i == today.getDate()) sel = ' selected';
		body += '<option value="' + i + '"' + sel + '>' + i + '</option>';
	}
	body += '</select>';
	body += '&nbsp;<select id="id_month" style="font-size: 11px; font-family: Arial;">';
	for(var i = 0; i < 12; i++) {
		sel = '';
		if(i == today.getMonth()) sel = ' selected';
		body += '<option value="' + (i + 1) + '"' + sel + '>' + arrMonth[i] + '</option>';
	}
	body += '</select>';
	body += '&nbsp;<select id="id_year" style="font-size: 11px; font-family: Arial;">';
	for(var i = today.getFullYear(); i < (today.getFullYear() + 3); i++) {
		sel = '';
		if(i == today.getFullYear()) sel = ' selected';
		body += '<option value="' + i + '"' + sel + '>' + i + '</option>';
	}
	body += '</select>';
	body += '</td>';
	
	// Nights
	body += '<td style="font-family: Arial; font-size: 11px; color: #ffffff; width: 150px;">No. of Nights: <select id="id_nights" style="font-size: 11px; font-family: Arial;">';
	for(var i = 1; i <= 10; i++) body += '<option value="' + i + '">' + i + '</option>';
	body += '</select></td>';

	// Book Button
	body += '<td style="font-family: Arial; font-size: 11px; color: #ffffff; width: 150px; padding-left: 40px;"><input type="button" value="Find Rooms" style="font-size: 11px; font-family: Arial;" onClick="bookRooms();" /></td>';
	body += '</tr></table>';
	document.getElementById("id_bookings").innerHTML = body;	
}

function bookRooms() {
	var hotelid		= document.getElementById("id_hotel").value;
	var intNights	= parseInt(document.getElementById("id_nights").value);
	var day			= document.getElementById("id_day").value;
	var month		= document.getElementById("id_month").value;
	var year		= document.getElementById("id_year").value;
	var strDatein	= '';
	var strDateout	= '';
	var width		= 777;
	var height		= 500;
	var operator	= '';

	// Only Proceed if a hotel was selected
	if(hotelid != '') {
		// Build Date In
		var datein = new Date();
		datein.setFullYear(parseInt(year), parseInt(month) - 1, parseInt(day));
		if(parseInt(day) < 10) day = '0' + day;
		if(parseInt(month) < 10) month = '0' + month;
		strDatein = year + '-' + month + '-' + day;

		// Build Date Out
		var dateout = addDays(datein, intNights);
		day = dateout.getDate();
		month = dateout.getMonth() + 1;
		year = dateout.getFullYear();
		if(parseInt(day) < 10) day = '0' + day;
		if(parseInt(month) < 10) month = '0' + month;
		strDateout = year + '-' + month + '-' + day;
		
		// Determin Operator
		if(hotelid == 1789) operator = 'venham';
		else if(hotelid == 1791) operator = 'venrot';
		else if(hotelid == 2356) operator = 'venakl';

		window.open("http://www.seekom.com/accommodation/Property.php?reset=true&op=" + operator + "&pid=" + hotelid + "&datein=" + strDatein + "&dateout=" + strDateout, "seekom", "scrollbars=yes,width=" + width + ",height=" + height + ",top=" + (screen.height/2 - height/2) + ",left=" + (screen.width/2 - width/2));
	} else {
		alert("You must select a hotel to place a booking on.");
	}
}

function addDays(myDate,days) {
    return new Date(myDate.getTime() + days*24*60*60*1000);
}