//function goodbye(e) {
//	if(!e) e = window.event;
//	//e.cancelBubble is supported by IE - this will kill the bubbling process.
//	e.cancelBubble = true;
//	e.returnValue = 'You sure you want to leave?'; //This is displayed on the dialog
//
//	//e.stopPropagation works in Firefox.
//	if (e.stopPropagation) {
//		e.stopPropagation();
//		e.preventDefault();
//	}
//}
//window.onbeforeunload=goodbye;


//document.getElementById("menu1").onclick=alert("hello")
//doNavLink('menu1', '../images/leftnav_1b.gif', '../images/leftnav_1c.gif','heritage.html')

function doNavLink(mdiv, nimage, nimageover, nlink) {
	document.getElementById(mdiv).onmouseover="MM_swapImage(nimage,'',nimageover,1)"
	document.getElementById(mdiv).onclick=document.location=nlink
	//"MM_goToURL('parent', nlink);return document.MM_returnValue"	
}
//doNavLink("menu1", "../images/leftnav_1b.gif", "../images/leftnav_1c.gif", "heritage.html")
//document.getElementById("menu1").onclick =
//function goTo(loc) {
	
//var newloc = "document.location"+loc;
//window.location(loc);
//}
document.getElementById("menu1").onclick = function() {
	alert("hello")
//goTo("heritage.html")
}

function showTeam(x) {
   for (i=1; i<=4; i++)
   {
	   el = document.getElementById("textarea" + i); el.style.display = 'none';
	   el = document.getElementById("teamMenu" + i);
	   el.style.backgroundColor = '#fff';
	   el.style.color = '#000';
   }
   el = document.getElementById("textarea" + x); el.style.display = 'block';
   el = document.getElementById("teamImage"); el.src = '../images/teamdesign' + x + ".jpg";
   el = document.getElementById("teamMenu" + x);
   el.style.backgroundColor = '#99d6d9';
   el.style.color = '#fff';
}

function showBuilder(x) {
   for (i=1; i<=2; i++)
   {
	   el = document.getElementById("textarea" + i); el.style.display = 'none';
	   el = document.getElementById("teamMenu" + i);
	   el.style.backgroundColor = '#fff';
	   el.style.color = '#000';
	   el = document.getElementById("teamImage" + i); el.style.display = "none";
   }
   el = document.getElementById("textarea" + x); el.style.display = 'block';
   el = document.getElementById("teamImage" + x); el.style.display = "block";
   el = document.getElementById("teamMenu" + x);
   el.style.backgroundColor = '#99d6d9';
   el.style.color = '#fff';
 }

 function showSendToFriend(u) {
	txt = '<form action="sendtofriend.php" method="GET"> ';
	txt +='<table cellpadding="0" class="sendtofriend" cellspacing="0" border="0" style="margin: 30px;">';
	txt +=		'	<tr><td colspan="2"><b>Link: </b>'+u+'</td></tr>';
	txt +=		'	<tr><td align="right">Your Name:</td><td align="left"><input type="text" name="Name" id="Name" class="text" value=""></td></tr>';
	txt +=		'	<tr><td align="right">Your Email:</td><td align="left"><input type="text" name="EmailFrom" id="EmailFrom" class="text" value=""></td></tr>';
	txt +=		'	<tr><td align="right">Your Friend\'s Email:</td><td align="left"><input type="text" name="EmailTo" id="EmailTo" class="text" value=""></td></tr>';
	txt +=		'	<tr><td colspan="2"><input type="button"class="button" value="Send" onclick="sendToFriend();"></td></tr>';
	txt +=		'</table></form>';
	message2(txt);
 }

 function sendToFriend() {
	txt = "";
//	el = document.getElementById("Name"); txt += "&Name=" + el.value;
//	el = document.getElementById("EmailFrom"); txt += "&EmailFrom=" + el.value;
//	el = document.getElementById("EmailTo"); txt += "&EmailTo=" + el.value;
	url = "sendtofriend.php";
	message2("<div class='errormsg'>Your message has been sent!</div>");
	initObj();
	if (xmlhttp!=null) {
	  xmlhttp.onreadystatechange=_sendToFriend;
	  xmlhttp.open("GET",url,true);
	  xmlhttp.setRequestHeader( "If-Modified-Since", "Sat, 1 Jan 2000 00:00:00 GMT" );
	  xmlhttp.send(null);
	}
	txt = "";
 }

 function _sentToFriend() {
 }

 function plan(planID) {
		letter = plans[planID][1];
//		txt = '<div style="padding-top: 0px; background-color:#fff;"> <table class="detailtable" border="0" cellspacing="0" cellpadding="0">';
//		txt += '  <tr>';
//		txt += '      <td></td>';
//		txt += '      <td align="left" valign="top"><a style="	text-decoration:none; color:#999999;" href="../pdf/floorplans/suite_'+plans[planID][1]+'.pdf" target="_blank"><img src="../images/bttndwnload_up.gif" name="bttnpdf" width="18" height="18" border="0" id="bttnpdf" onmouseover="this.src=this.src.replace(\'up\', \'over\')" onmouseout="this.src=this.src.replace(\'over\', \'up\')" />&nbsp;Download PDF</a></td>';
//		txt += '      <td align="right" valign="top"><a onmouseover=\'this.style.cursor=&quot;pointer&quot; \' onfocus=\'this.blur();\' onclick="closeWait();"><img src="../images/bttnclose_up.gif" name="bttnclose2" width="18" height="18" id="bttnclose2" onmouseover="this.src=this.src.replace(\'up\', \'over\')" onmouseout="this.src=this.src.replace(\'over\', \'up\')" /></a></td>';
//		txt += '    </tr>';
//		txt += '    <tr>';
//		txt += '      <td align="right" class="suite">'+plans[planID][0]+'</td>';
//		txt += '      <td colspan="2" class="suitedetail">'+plans[planID][2]+' sq.ft. + '+plans[planID][3]+' + ' +plans[planID][4]+'</td>';
//		txt += '    </tr>';
//		txt += '  </table>';
//		txt += '  <div class="bigplan"><a style="	text-decoration:none; color:#999999;" href="../pdf/floorplans/suite_'+plans[planID][1]+'.pdf" target="_blank"><img width="455" height="556" class="pic" src="../images/plan_'+plans[planID][1]+'.gif" /></a></div>';
//		txt += '  <div class="squigglepop"><img src="../images/squiggle_pop.gif" width="143" height="47" /></div></div>';

		txt = '<div id="planholder" style="margin-bottom: 20px;"><table class="detailtable" border="0" cellspacing="0" cellpadding="0">';
		txt += '  <tr>';
		txt += '    <td></td>';
		txt += '    <td class="pddflink" align="left" valign="top"><a href="../pdf/floorplans/suite_'+plans[planID][1]+'.pdf" target="_blank">&nbsp;Download PDF</a></td>';
		txt += '    <td align="right" valign="top"><a href="#self" onclick="closeWait();"><img src="../images/bttnclose_up.gif" name="bttnclose2" width="18" height="18" id="bttnclose2" onmouseover="MM_swapImage(\'bttnclose2\',\'\',\'../images/bttnclose_over.gif\',1)" onmouseout="MM_swapImgRestore()" /></a></td>';
		txt += '  </tr>';
		txt += '  <tr>';
		txt += '    <td align="right" class="suite">'+plans[planID][0]+'</td>';
		txt += '    <td colspan="2" class="suitedetail">'+plans[planID][2]+' sq.ft. + '+plans[planID][3]+' + ' +plans[planID][4]+'</td>';
		txt += '  </tr>';
		txt += '</table>';

		txt += '<div class="bigplan"><img class="pic" src="../images/plan_'+plans[planID][1]+'.gif" /></div>';
		txt += '<div class="squigglepop"><img src="../images/squiggle_pop.gif" width="143" height="47" /><br><br>';
		txt += '<table class="detailtable">';
		txt += '<tr>';
		txt +=  '   <td width="150"></td>';
		txt += '    <td class="pddflink" align="left" valign="top" style="padding-top: 10px;"><a href="../pdf/../pdf/floorplans/suite_'+plans[planID][1]+'.pdf" target="_blank">&nbsp;Download PDF</a></td>';
		txt += '    <td align="right" valign="top">&nbsp;</td>';
		txt += '  </tr>';
		txt += '  </table></div>';
		
		showOverlay();
		box(txt);
 }


 function placeholderF(pref, i, w, h) {
	el = document.getElementById('placeholder');
	el.src=  "../images/" + pref + "_" + i + ".jpg";
	el = document.getElementById('placeholderl');
	el.onclick = function () { imageF("../images/" + pref + "_" + i + "_full.jpg", w, h) ;};
 }

 function imageF(path, w, h) {
	 t = "<img ";
	 if (w) t += " width=\"" + w + "\" ";
	 if (h) t += " width=\"" + h + "\" ";
	 t += " src='"+path+"'>";
	 message2(t);
 }

 function playVideo(id) {
	txt = '<div style="width: 428px; height: 240px;">';
	txt += '        <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=10,0,2,0" width="428" height="240">';
	txt += '          <param name="movie" value="swf/'+id+'.swf" />';
	txt += '          <param name="quality" value="high" />';
	txt += '          <param name="wmode" value="transparent" />';
	txt += '          <embed src="swf/'+id+'.swf" quality="high" swliveconnect=true allowscriptaccess="sameDomain" pluginspage="http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" width="428" height="240" ></embed>';
	txt += '        </object></div>';
	message4(txt);
}

 function playVideo2(id) {
	txt = '<div style="width: 853px; height: 480px;">';
	txt += '        <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=10,0,2,0" width="853" height="480">';
	txt += '          <param name="movie" value="swf/'+id+'.swf" />';
	txt += '          <param name="quality" value="high" />';
	txt += '          <param name="wmode" value="transparent" />';
	txt += '          <embed src="swf/'+id+'.swf" quality="high" swliveconnect=true allowscriptaccess="sameDomain" pluginspage="http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" width="853" height="480" ></embed>';
	txt += '        </object></div>';
	message4(txt);
}

 function playVideo3(id) {
	txt = '<div style="width: 853px; height: 480px;">';
	txt += '        <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=10,0,2,0" width="853" height="480">';
	txt += '          <param name="movie" value="../swf/'+id+'.swf" />';
	txt += '          <param name="quality" value="high" />';
	txt += '          <param name="wmode" value="transparent" />';
	txt += '          <embed src="../swf/'+id+'.swf" quality="high" swliveconnect=true allowscriptaccess="sameDomain" pluginspage="http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" width="853" height="480" ></embed>';
	txt += '        </object></div>';
	message2(txt);
}


 function playVideo4(id) {
	txt = '<div style="">';
	txt += '        <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=10,0,2,0" width="853" height="480">';
	txt += '          <param name="movie" value="swf/'+id+'.swf" />';
	txt += '          <param name="quality" value="high" />';
	txt += '          <param name="wmode" value="transparent" />';
	txt += '          <embed src="swf/'+id+'.swf" quality="high" swliveconnect=true allowscriptaccess="sameDomain" pluginspage="http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" width="853" height="480" ></embed>';
	txt += '        </object></div>';
	message4(txt);
}

function enlarge(id) {
	i = new Image();
	sr = "../images/large/"  + id + ".jpg";
	wait();
	i.onload = function () { showImage(sr);}
	i.src = sr;
}

function showImage(sr) {
	txt = "<img src='"+sr+"'>";
	message2(txt);
}

function wait() {
	message2("<div style='padding: 40px; text-align: center; background-color: #fff;'>Please wait ... <br><br><br><br><img src='../images/spinning.gif'></div>");
}