/**
 *	This file contains useful utility functions which are used across many
 *	of the web pages within this site.
 *
 *	@author Russell Francis
 */




function toggleWorkAreaVisbility()
{
	var workArea = document.getElementById( 'workarea' );
	if ( workArea.style.display == 'none' )
		document.cookie = 'workAreaIsVisible=true;'
		
	else
		document.cookie = 'workAreaIsVisible=false;'
	
	Effect.toggle('workarea','BLIND',{duration: 0});	
}


function setWorkAreaDisplayState()
{
	/*
	if ( getCookieValue( 'workAreaIsVisible' ) == 'true' || !getCookieValue( 'workAreaIsVisible' ) )
	{
		var workArea = document.getElementById( 'workarea' );
		workArea.style.display = 'block';
	}
	*/
}


function showHideEffectParent( effectData )
{
	alert ( effectData.element.parentNode.parentNode )
}


function getCookieValue( name )
{
	var allcookies = document.cookie;
	var pos = allcookies.indexOf( name + "=" );
	if ( pos != -1 )
	{
		var start = pos + ( name.length + 1 );
		var end = allcookies.indexOf( ";", start )
		if ( end == -1 ) end = allcookies.length;
		var value = allcookies.substring( start, end );
		return value;
	}
	
	return null;
}




function registerWorkAreaState() 
{
	alert( 'register state' );
}