function findRooms() {
	var body	= '<table style="width: 800px"><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="VENTURAHDIRECT">Ventura Inn & Suites Hamilton</option>' +
		'<option value="VENTURARDIRECT">Quality Inn On Fenton Rotorua</option>' +
		'<option value="VENTURAAADIRECT">Bella Vista Express Hotel 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>';

	// 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 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		= screen.availWidth;
	var height		= screen.availHeight;
	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;

		window.open("http://www.thebookingbutton.com.au/properties/" + hotelid + "?check_in_date=" + strDatein, "thebookingbutton", "scrollbars=yes,width=" + width + ",height=" + height + ",top=1,left=1");
	} 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);
}
