var fontsize = 12;
function changeFontSize(direction) {
	el = document.getElementsByTagName("body");
	if (direction == 0)
	{
		el[0].style.fontSize = "12px";
		fontsize = 12;
	} else {
		if (fontsize >= 19 && direction > 0) return true;
		if (fontsize <= 11 && direction < 0) return true;
		fontsize = parseInt(fontsize) + parseInt(direction); 
		el[0].style.fontSize = fontsize + "px";
	}
	direction = 1 - direction;
}

function submitContactForm(obj) {
	el = document.getElementById("FirstName"); if (!el.value) { alert("First name is required!"); return false; }
	el = document.getElementById("LastName"); if (!el.value) { alert("Last name is required!"); return false; }
	el = document.getElementById("Email"); if (!el.value) { alert("Email is required!"); return false;}
	obj.submit();

}


var reid = [];
reid[0] = ["Seaforth","$359,900.00",1706, "cb-seaforth", "seaforth"];
reid[1] = ["Harriston","$369,900.00",1672, "cb-attached_harriston", "harriston"];
reid[2] = ["Seaforth - Walkout","$389,900.00",1706, "cb-seaforth", "seaforth"];
reid[3] = ["Harriston - Walkout","$399,900.00",1672, "cb-attached_harriston_walkout", "harriston"];
reid[4] = ["Seaforth","$388,600.00",1706, "cb-hollow_seaforth", "seaforth"];
reid[5] = ["Lockwood","$426,900.00",1945, "Lockwood-fp", "lockwood"];
reid[6] = ["Lockwood (Option)","$431,900.00",1945, "Lockwood", "lockwood"];
reid[7] = ["Colleton","$419,900.00",2107, "Colleton-fp", "colleton"];
reid[8] = ["Colleton (Option)","$424,900.00",2107, "Colleton", "colleton"];
reid[9] = ["Telford","$436,900.00",1210, "Telford", "telford"];
reid[10] = ["Dobbinton","$442,500.00",1380, "Dobbinton", "dobbington"];
reid[11] = ["Underwood","$445,700.00",1493, "Underwood", "underwood"];
reid[12] = ["Bristol","$470,300.00",1602, "Bristol", "Bristol"];
reid[13] = ["Sydenham","$480,300.00",1794, "Sydenham", "Sydenham"];
reid[14] = ["Telford w/ Loft","$486,900.00",1792, "Telford", "Telford-loft"];
reid[15] = ["Invermay","$493,700.00",1960, "Invermay", "Invermay"];
reid[16] = ["Norfolk","$513,900.00",1794, "Norfolk", "Norfolk"];
reid[17] = ["Dobbinton w/ Loft","$495,200.00",2056, "Dobbinton", "Dobbington-loft"];
reid[18] = ["Underwood w/ Loft","$495,500.00",2163, "Underwood", "Underwood-loft"];
reid[19] = ["Elderslie w/ Loft	 ","$531,900.00",2453, "elderslie", "elderslie"];
reid[20] = ["Invermay w/ Loft","$531,900.00",2694, "Invermay", "Invermay-loft"];
reid[21] = ["Harriston","$406,600.00",1672, "cb-hollow_harriston", "Harriston"];

function showPlan(row, planID) {
	message2("<div style='padding: 40px; text-align: center; background-color: #fff;'>Please wait ... <br><br><br><br><img src='images/spinning.gif'></div>");
	i = new Image();
//	alert(planID);
//	alert(reid[planID][4]);
	i.onload = function () {_showPlan(row, planID);};
	i.src = 'media/plans/reid/'+reid[planID][4]+'.jpg';
//	setTimeout(function () {_showPlan(row, planID);}, 1000);
}

function _showPlan(row, planID) {
//	txt = "<br><br><h1>" + reid[planID][0] + "</h1><br><br><div class=\"plan-holder\">" + "<img src=\"media/plans/reid/bristol.jpg\"></div>" + "<br><br>" + "<a href=\"media/plans/reid/"+reid[0]+".pdf\" target=\"download PDF\"></a>";
	txt = '<table cellpadding="0" cellspacing="0" border=0  width="547">';
	txt += '<tr>';
	txt += '	<td width="111" height="41" class="planSqft">'+reid[planID][2]+' sqft<br>'+reid[planID][1]+'</td>';
	txt += '	<td height="41" width="356" class="planName"><span><nobr>'+reid[planID][0]+'</nobr></span></td>';
	txt += '	<td height="41" width="150" class="planClose"><img src="images/bt_close.jpg" onclick="closeWait();"></td>';
	txt += '</tr>';
	txt += '<tr>';
	txt += '<td colspan="3">';
	txt += '<div class="plan-holder"><img width="547" height="362" src="media/plans/reid/'+reid[planID][4]+'.jpg"></div>';
	txt += '</td>';
	txt += '</tr>';
	txt += '<tr>';
	txt += '	<td colspan="2" class="planContact">&nbsp;To contact the Cobble Beach Sales Office please call 1-266-664-0064<br>&nbsp;or email us at  <a href="mailto:sales@cobblebeach.com">sales@cobblebeach.com</a></td>';
	txt += '	<td class="planDownload">';
	txt += '		<a href="media/plans/reid/'+reid[planID][3]+'.pdf" target="_blank"><img src="images/bttnpop_download1.gif"></a><br>';
	txt += '		<a href="media/plans/reid/'+reid[planID][3]+'.pdf" target="_blank"><img src="images/bttnpop_print1.gif" style="margin-top: 5px;"></a>';
	txt += '	</td>';
	txt += '</tr>';
	txt += '</table>';

	showOverlay();
	box(txt);			
}

function MM_swap_image() {

}

function togglePress(id) {
	el = document.getElementById("press" + id);
	el2 = document.getElementById("pressLink" + id);
	if (el.style.display != "block") {
		el.style.display = "block"; 
		el2.style.display = "none"; 
	} else {
		el.style.display = "none"; 
		el2.style.display = "block"; 
	}
}

function generateSitemap() {
	txt = "";
	for(key in menu) {
		val = menu[key];
		label = val[0];
		txt += '<a href="cobble-beach-'  + val[1] + '.html" class="sitemap-link-level1">' + label.toUpperCase() + '</a>';
		for (key2 in submenu[key] )
		{
			val2 = submenu[key][key2];
			label = val2[0];
			txt += '<a href="cobble-beach-'  + val2[1] + '.html" class="sitemap-link-level2">' + label.toUpperCase() + '</a>';
		}
	}
	document.write(txt);

}

function showPromo() {
//	x = Get_Cookie("ShowPromo");
//	if (x) return true;
	i = new Image();
	i.onload = _showPromo;
	i.src = "images/mcewan-popup2.jpg";
	Set_Cookie("ShowPromo", 0);
}

function _showPromo() {
	txt = "<a href='cobble-beach-mcewan.html'><img src='images/mcewan-popup2.jpg'></a>";
	message5(txt);
}

 function imageF2(path, w, h) {
	 message5("<div style='padding: 40px; text-align: center; background-color: #fff;'>Please wait ... <br><br><br><br><img src='images/spinning.gif'></div>");
	i = new Image;
	 i.onload=function () {_imageF2(path, w, h)};
	 i.src = path;

 }

 function _imageF2(path, w, h) {
	 t = "<img ";
	 if (w) t += " width=\"" + w + "\" ";
	 if (h) t += " width=\"" + h + "\" ";
	 t += " src='"+path+"'>";
	 message5('<div style="border: 5px solid #ccc;">'+t+'</div>');

 }

function showCarolVideo() {
	txt = '<div style="width: 560px; padding: 40px; height: 450px; background-color: #fff; border: 5px solid #eee;"><iframe width="560" height="345" src="http://www.youtube.com/embed/48ZvV0TJCtk" frameborder="0" allowfullscreen></iframe><br><br><span><a href="cobble-beach-carol-welsman-in-concert-2011.html">View all Carol Welsman Videos</a></span></div>';
	message5(txt);
}


function showWinterPopup() {
	txt = '<table id="winterwonderland" width="600" height="570" border="0" cellpadding="0" cellspacing="0">	<tr>		<td width="600" height="159">			<img src="images/winterwonderland/christmas_popup.jpg" alt="A Winter Wonderland" width="600" height="159" border="0" /></td>	</tr>	<tr>		<td width="600" height="38"><a href="pdf/winterwonderland/Yuletide Lunch Buffet.pdf" target="_blank"><img src="images/winterwonderland/christmas_popup-02.jpg" alt="Yuletide Lunch Buffet - Every Friday in December" width="600" height="38" border="0" /></a></td>	</tr>	<tr>		<td width="600" height="36"><a href="pdf/winterwonderland/Brunch with Santa.pdf" target="_blank"><img src="images/winterwonderland/christmas_popup-03.jpg" alt="Brunch with Santa - December 11th 2011" width="600" height="36" border="0" /></a></td>	</tr>	<tr>		<td width="600" height="36"><a href="pdf/winterwonderland/Rockin New Years party.pdf" target="_blank"><img src="images/winterwonderland/christmas_popup-04.jpg" alt="Rockin&rsquo; New Year&rsquo;s Eve Party! - December 31st 2011" width="600" height="36" border="0" /></a></td>	</tr>	<tr>		<td width="600" height="35"><a href="pdf/winterwonderland/New Years Brunch.pdf" target="_blank"><img src="images/winterwonderland/christmas_popup-05.jpg" alt="New Year&rsquo;s Day Brunch - January 1st 2012" width="600" height="35" border="0" /></a></td>	</tr>	<tr>		<td width="600" height="40">			<img src="images/winterwonderland/christmas_popup-06.jpg" width="600" height="40" alt="" /></td>	</tr>	<tr>		<td width="600" height="38"><a href="pdf/winterwonderland/Cross Country Skiing.pdf" target="_blank"><img src="images/winterwonderland/christmas_popup-07.jpg" alt="Cross Country Skiing - Provided by CANSI qualified instructor Dan Mahony" width="600" height="38" border="0" /></a></td>	</tr>	<tr>		<td width="600" height="33"><a href="pdf/winterwonderland/Dog Sled Adventures.pdf" target="_blank"><img src="images/winterwonderland/christmas_popup-08.jpg" alt="Dog Sled Adventures - Provided by Singing Dogs" width="600" height="33" border="0" /></a></td>	</tr>	<tr>		<td width="600" height="36"><a href="pdf/winterwonderland/Sleigh Rides and Carriage Rides.pdf" target="_blank"><img src="images/winterwonderland/christmas_popup-09.jpg" alt="Sleigh Rides &amp; Carriage Rides - Provided by Windsong Horse &amp; Carriage" width="600" height="36" border="0" /></a></td>	</tr>	<tr>		<td width="600" height="119">			<img src="images/winterwonderland/christmas_popup-10.jpg" alt="Cobble Beach - Georgian Bay\'s Extraordinary Golf Resort Community - 1-888-278-8112" width="600" height="119" border="0" /></td>	</tr></table>';
	showOverlay();
	box2('<div style="border: 0px solid #eee; padding: 0px;"><div class="login-close" style="position: absolute; right: 2px; top: 2px; width: 30px; height: 20px; border: 0px solid #000; cursor: pointer; z-index: 999;" onclick="closeWait()" ><img src="images/pixel.gif" width="30" height="20"></div>'+txt+'</b></div>');

}
