// swap classes of an element
function ClassSwap( id, class_name ) {

if ( document.getElementById( id ).className != class_name ) {
	document.getElementById(id).className = class_name;
	}
}

// redirect to a given url
function Redir( url ) {
	if ( url != "" ) {
		window.location = url;
	}
}

function BuildUrl( url )
{
	if ( url != "" ) {
		return "http://huntley.aggressivedevelopment.com/" + url;
	}
	else
	{
		return "http://huntley.aggressivedevelopment.com/"
	}
}

function ShowHide( id, hideNull )
{
	var strCurrentState		= document.getElementById( id ).style.visibility;

	//alert( strCurrentState )
	
	if ( id != "" )
	{
		if ( strCurrentState == 'hidden' ) {
			document.getElementById( id ).style.visibility 	= 'visible';
			document.getElementById( id ).style.display		= 'block';
		}
		else if ( strCurrentState == 'visible' ) {
			document.getElementById( id ).style.visibility 	= 'hidden';
			document.getElementById( id ).style.display		= 'block';
		}
		else if ( strCurrentState == '' ) {
			if ( hideNull ) {
				document.getElementById( id ).style.visibility 	= 'hidden';
				document.getElementById( id ).style.display		= 'block';			
			}
			if ( !hideNull ) {
				document.getElementById( id ).style.visibility 	= 'visible';
				document.getElementById( id ).style.display		= 'block';
			}
		}
	}
}

function ScreenCover()
{
	document.getElementById("ScreenCover").style.visibility			= "visible";
	document.getElementById("ScreenCover").style.display			= "block";
}	


function SwapColors( id, Color1, Color2 )
{
	if ( document.getElementById( id ).style.backgroundColor != Color1 ) {
		document.getElementById( id ).style.backgroundColor = Color1;
		document.getElementById( id ).style.color			= '#ffffff';
	}
	else
	{
		document.getElementById( id ).style.backgroundColor = Color2;
		document.getElementById( id ).style.color			= 'white';
	}
}		

