/* Expand/Collapse block of html */
function expandcollapse (blockId) { 
   myBlock = document.getElementById(blockId); 
   
   if (myBlock.style.display == "none") { 
      myBlock.style.display = "inline"; 
   } 
   else { 
      myBlock.style.display = "none"; 
   } 
} 

/* Generic Popup window */
function popupWin(sUrl, bScroll, nWidth, nHeight)
{
	var oPopupWin;
		
	if (oPopupWin) oPopupWin.close();
	if (!nWidth) nWidth = 550;
	if (!nHeight) nHeight = 450;

	if (!bScroll)
		bScroll = 'yes';
	else {
		bScroll == 'no' ? 'no' : 'yes';
	}
	oPopupWin = window.open(sUrl, 'PopupWin', 'resizable=yes,menu=no,toolbar=no,location=no,directories=no,status=no,scrollbars=' + bScroll + 
		',width=' + nWidth + ',height=' + nHeight +
		',left=' + (window.screenLeft + 20) +
		',top=' + (window.screenTop - 30)); 
	if (oPopupWin) oPopupWin.focus();
}

/* Popup window function copied from original site for opening CA series floorplans. */
function popupER(project, plan) {
	var sw = screen.width * .9;
	var sh = screen.height * .9;
	erWindow = window.open('flash/Ca_Series_Interactive/er.html?project='+project+'&plan='+plan,'erWin','width='+sw+',height='+sh+',resizable=1,screenX=0,screenY=0,top=0,left=0');
}

/* Popup window for Arbor series virtual tours. */
function popupArborVT() {
	var sw = screen.width * .9;
	var sh = screen.height * .9;
	erWindow = window.open('flash/Arbor_Series_Interactive/index.html','erWin','width='+sw+',height='+sh+',resizable=yes,screenX=0,screenY=0,top=0,left=0');
}

function popupRidgeSeries(sUrl, nWidth, nHeight) {
	var oPopupWin;
		
	if (oPopupWin) oPopupWin.close();
	if (!nWidth) nWidth = (screen.width * .9);
	if (!nHeight) nHeight = (screen.height * .9);

	oPopupWin = window.open(sUrl, 'PopupWin', 'resizable=yes,menu=no,toolbar=yes,location=no,directories=no,status=no,scrollbars=yes' + 
		',width=' + nWidth + ',height=' + nHeight); 
	if (oPopupWin) oPopupWin.focus();
}

/* Showing/Hiding content */
function hidediv(id) {
	//safe function to hide an element with a specified id
	if (document.getElementById) { // DOM3 = IE5, NS6
		document.getElementById(id).style.display = 'none';
	}
	else {
		if (document.layers) { // Netscape 4
			document.id.display = 'none';
		}
		else { // IE 4
			document.all.id.style.display = 'none';
		}
	}
}

function showdiv(id) {
	//safe function to show an element with a specified id
		  
	if (document.getElementById) { // DOM3 = IE5, NS6
		document.getElementById(id).style.display = 'block';
	}
	else {
		if (document.layers) { // Netscape 4
			document.id.display = 'block';
		}
		else { // IE 4
			document.all.id.style.display = 'block';
		}
	}
}
