function validateReservation(theForm) {
	var errMsgList = '';
	if(theForm.firstName.value == '') errMsgList += 'First Name\n';
	if(theForm.lastName.value == '') errMsgList += 'Last Name\n';
	if(theForm.address.value == '') errMsgList += 'Address\n';
	if(theForm.city.value == '') errMsgList += 'City\n';
	if(theForm.state.value == '') errMsgList += 'State/Province\n';
	if(theForm.zip.value == '') errMsgList += 'Zip/Postal Code\n';
	if(theForm.areaCode.value == '') errMsgList += 'Phone Area Code\n';
	if(theForm.phone.value == '') errMsgList += 'Phone Number\n';
	if(theForm.email.value == '') errMsgList += 'E-mail\n';
	if(errMsgList != '') {
		errMsgList = 'Please complete the following and re-submit:\n' + errMsgList +'';
		alert(errMsgList);
		return false;
	}
	return true;
}

function getWindowHeight() {
	var windowHeight=0;
	if(typeof(window.innerHeight)=='number') {
		windowHeight=window.innerHeight;
	}
	else if(document.documentElement && document.documentElement.clientHeight) {
		windowHeight = document.documentElement.clientHeight;
	}
	else if(document.body&&document.body.clientHeight) {
		windowHeight = document.body.clientHeight;
	}
	return windowHeight;
}

function setFooter() {
	if(document.getElementById) {
		var windowHeight = getWindowHeight();
		if(windowHeight > 0) {
			var wrapperElement = document.getElementById('Wrapper');
			var footerElement = document.getElementById('Footer');
			if(wrapperElement.offsetHeight < windowHeight) {
				wrapperElement.style.height = windowHeight + 'px';
				footerElement.style.position = 'absolute';
				footerElement.style.bottom = '0';
				footerElement.style.left = '0';
			}
			else {
				wrapperElement.style.height = '';
				footerElement.style.position = 'relative';
				footerElement.style.bottom = '';
				footerElement.style.left = '';
			}
		}
	}
/*
*/
}
window.onload = init;

function writeCourseSelect() {
	document.write('<form>');
	document.write('<select name="courses" onchange="selectCourse(this)">');
	document.write('<option selected="selected" disabled="disabled">Select a Course</option>');
	document.write('<optgroup label="Gold">');
	document.write('<option value="/golf-courses/gold/#HawksLanding">Hawks Landing</option>');
	document.write('<option value="/golf-courses/gold/#SouthernDunes">Southern Dunes</option>');
	document.write('<option value="/golf-courses/gold/#PantherLake">Orange County National: Panther Lake</option>');
	document.write('<option value="/golf-courses/gold/#CrookedCat">Orange County National: Crooked Cat</option>');
	document.write('<option value="/golf-courses/gold/#GoldenBearClub">Golden Bear Club</option>');
	document.write('<option value="/golf-courses/gold/#MetroWest">MetroWest</option>');
	document.write('<option value="/golf-courses/gold/#Celebration">Celebration</option>');
	document.write('<option value="/golf-courses/gold/#ChampionsGateNational">Champions Gate: National</option> ');
	document.write('<option value="/golf-courses/gold/#ChampionsGateInternational">Champions Gate: International</option> ');
	document.write('<option value="/golf-courses/gold/#FalconsFire">Falcon&rsquo;s Fire</option>');
	document.write('<option value="/golf-courses/gold/#DisneysMagnolia">Disney&rsquo;s Magnolia</option>');
	document.write('<option value="/golf-courses/gold/#DisneysOspreyRidge">Disney&rsquo;s Osprey Ridge</option>');
	document.write('<option value="/golf-courses/gold/#DisneysPalm">Disney&rsquo;s Palm</option>');
	document.write('<option value="/golf-courses/gold/#GrandePines">Grande Pines</option>');
	document.write('</optgroup>');
	document.write('<optgroup label="Silver">');
	document.write('<option value="/golf-courses/silver/#Diamondback">Diamondback</option>');
	document.write('<option value="/golf-courses/silver/#OrangeLake">Orange Lake: The Reserve</option>');
	document.write('<option value="/golf-courses/silver/#OrangeLake">Orange Lake: The Legends</option>');
	document.write('<option value="/golf-courses/silver/#StoneybrookOrlando">Stoneybrook Orlando</option>');
	document.write('<option value="/golf-courses/silver/#DiamondPlayers">Diamond Players Club</option>');
	document.write('<option value="/golf-courses/silver/#Eastwood">Eastwood</option>');
	document.write('<option value="/golf-courses/silver/#Remington">Remington</option>');
	document.write('<option value="/golf-courses/silver/#Harmony">Harmony Golf Preserve</option>');
	document.write('<option value="/golf-courses/silver/#StonegateOaks">Stonegate Oaks</option>');
	document.write('<option value="/golf-courses/silver/#StoneybrookWest">Stoneybrook West</option>');
	document.write('<option value="/golf-courses/silver/#MysticDunes">Mystic Dunes</option>');
	document.write('<option value="/golf-courses/silver/#BlackBear">Black Bear</option>');
	document.write('</optgroup>');
	document.write('<optgroup label="Bronze">');
	document.write('<option value="/golf-courses/bronze/#KingsRidge">Kings Ridge</option>');
	document.write('<option value="/golf-courses/bronze/#Palisades">Palisades</option>');
	document.write('<option value="/golf-courses/bronze/#Legends">Legends</option>');
	document.write('<option value="/golf-courses/bronze/#NorthShore">North Shore</option>');
	document.write('<option value="/golf-courses/bronze/#HighlandsReserve">Highlands Reserve</option>');
	document.write('<option value="/golf-courses/bronze/#KissimmeeBay">Kissimmee Bay</option>');
	document.write('<option value="/golf-courses/bronze/#RidgewoodLakes">Ridgewood Lakes</option>');
	document.write('<option value="/golf-courses/bronze/#KissimmeeOaks">Kissimmee Oaks</option>');
	document.write('<option value="/golf-courses/bronze/#HuntersCreek">Hunter&rsquo;s Creek</option>');
	document.write('</optgroup>');
	document.write('</select>');
	document.write('</form>');
}
function selectCourse(selectEl) {
	window.location.href=selectEl.value;
}

function init() {
	setFooter();
	var p = document.getElementById('CallUs');
	if(p != null) {
		p.onmouseover = function() { window.status = 'http://www.orlando-vacation-homes.ca/contact/'; return true; }
		p.onmouseout = function() { window.status = ''; return true; }
		p.onclick = function() { window.location = 'http://www.orlando-vacation-homes.ca/contact/'; }
		p.className = 'linked';
	}
}