/*
NOTES:
* the following are simple functions that perform common tasks
* Hal Barwood
* © 2011 The Vaux Condominium Owners Association
* version 111009
*/

/* Vaux simple display controller */

function hide(element)
{
	var elementStyle=document.getElementById(element).style;
	elementStyle.display="none";
}


function show(element)
{
	var elementStyle=document.getElementById(element).style;
	elementStyle.display="block";
}


/* Vaux rollover image changer */

function changeObject (obName, obSource)
{
	if (document.images)
	{
		document[obName].src = obSource;
	}
}

/* redirect from wrong page */

function goHome ()
{
	window.location="../index.html";
}


/* minimalist Window Manager Script version 011504 */

//globals...
newurlwin = null;
opentime = null;

function openurlwin (newurl, name, w, h, m, s, r)
{
	//NOTE:
	//newurl == destination page
	//name   == new window name (never seems to work, but is required)
	//w      == window width
	//h      == window height
	//m      == menubar ("yes" or 1 means new window has menubar)
	//s      == scrollbars ("yes" or 1 means new window has scrollbars)
	//r	 == resizable ("yes" or 1 means new window can be resized)
	
	//make sure window will fit onscreen...
	var sw = screen.width * 0.8;
	var sh = screen.height * 0.8;
	if (w > sw || w == 0)
	{
		w = sw;
	}
	if (h > sh || h == 0)
	{
		h = sh;
	}

	//place window onscreen...
	var wl = (screen.width - w) / 2;
	var wt = (screen.height - h) / 2.5;

	//assemble properties...
	var wprops = 'width='+w+', height='+h+', top='+wt+', left='+wl+', menubar='+m+', scrollbars='+s+', resizable='+r+'';

	//open up...
	newurlwin = window.open(newurl, name, wprops);

	//set self-destruct...
	//////opentime = setTimeout("closeurlwin()", 180000);
}


/* lose window ... */
function closeurlwin()
{
	if (newurlwin != null)
	{
		newurlwin.close();
	}
}

