function setToolbar( show )
{
	var colright = document.getElementById( "right" );
	var middle = document.getElementById( "middle" );

	if( show )
	{
		colright.style.display = "";
		middle.style.marginRight = "10.8em";
	}
	else
	{
		colright.style.display = "none";
		middle.style.marginRight = "0.4em";
	}
}

/* Check user preference of toolbar */
function checkToolbar()
{
	var tb_start, tb_end, value = "";

	if( ( tb_start = document.cookie.indexOf( "toolbar=" ) ) != -1 )
	{
		if( ( tb_end = document.cookie.indexOf( ";", tb_start ) ) == -1 ) { tb_end = document.cookie.length; }
		if( unescape( document.cookie.substring( tb_start+8, tb_end ) ) == "no" ) { setToolbar( false ); }
	}
	else
	{
		var wwidth;

		if( window.innerWidth ) { wwidth = window.innerWidth; }
		else { wwidth = document.documentElement.clientWidth; }

		if( wwidth < 980 ) { setToolbar( false ); }
	}
}

function toggleToolbar()
{
	if( document.getElementById( "right" ).style.display != "none" )
	{
		document.cookie = "toolbar=no";
		setToolbar( false );
	}
	else
	{
		document.cookie = "toolbar=yes";
		setToolbar( true );
	}
}
