/*------------------------------------------------------------*/ 
/*   Utilities.js     Jason Pryde     9/12/2008              */
/*   Functions to dynamically controls and divs on site      */
/*------------------------------------------------------------*/ 
 



/*----  for SoundSlideshow scripts elsewhere on site ----*/
var slideshowscript = ""

  
/*----------------------------------------------------------*/

function trimAll(sString) 
{
while (sString.substring(0,1) == ' ')
      {sString = sString.substring(1, sString.length);}

while (sString.substring(sString.length-1, sString.length) == ' ')
      {sString = sString.substring(0,sString.length-1);}
return sString;
}



function HideDiv(id) {

	//safe function to hide an element with a specified id
	if (document.getElementById) // DOM3 = IE5, NS6
	{ if(document.getElementById(id)) 
		{ 


			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
alert("id:"+id);

	if (document.getElementById) // DOM3 = IE5, NS6
	{ if(document.getElementById(id)) 
		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';
		}
	}
}