var flashVar;

function handleHash()
{
	var e;
	e = window.location.hash;
	if( e )
	{
		e = e.split( "#" );
		f = e[1].split('|url=');
		return handleIncoming( f[0], f[1] );
	}
}

function handleIncoming( e, href )
{
	// ( !document.getElementById('CaltexMain') ? flashExists=false : flashExists=true )
    flashExists = document.getElementById('CaltexMain') != null ? true : false;
    
	if( flashExists )
	{
	   flashVar = e;
	   return false;
	}
	else
	{
		window.location = href;
		return false;
	}
}

function getVariable()
{
	if(!flashVar)
	{
		handleHash();
	}
	return flashVar;
}