function getCookie( cookieName )
{
	var nameEQ = cookieName + "=";
	var cookieArray = document.cookie.split(';');
	for( var i = 0; i < cookieArray.length; i++ )
	{
		var c = cookieArray[i];
		while( c.charAt(0) == ' ' ) c = c.substring( 1, c.length );
		if( c.indexOf( nameEQ ) == 0 ) return c.substring( nameEQ.length, c.length );
	}
	return null;
}

function toggleVisible( id )
{
	if( document.getElementById( id ).style.display == 'block' )
	{
		document.getElementById( id ).style.display = 'none';
		writeCookie( id, 'none' );
	}
	else
	{
		document.getElementById( id ).style.display = 'block';
		writeCookie( id, 'block' );
	}
}

function writeCookie( cookieName, cookieValue )
{
	var date = new Date();
	date.setTime( date.getTime() + ( 1000 * 60 * 60 * 24 * 365 * 20 ) );
	var expires = "; expires=" + date.toGMTString();
	
	document.cookie = escape( cookieName ) + "=" + escape( cookieValue ) + expires + "; path=/";
}