// JScript source code

function getRefToDiv(divID) 
{
	//customised to suit this particular page - DON'T COPY THIS UNLESS YOU KNOW WHAT YOU ARE DOING!!
	if( document.layers ) 
	{
		return document.layers[divID].document.layers[divID];
	}
	if( document.getElementById ) 
	{
		return document.getElementById(divID);
	}
	if( document.all ) 
	{
		return document.all[divID];
	}
	if( document[divID] ) { return document[divID].document[divID]; }
	return false;
}

function IsDivShown(divID_as_a_string)
{
	var myReference = getRefToDiv(divID_as_a_string);
	if( !myReference ) 
	{
		window.alert('Cant get the item in this browser for ' + divID_as_a_string ); 
		return; 
	}
	if( myReference.style ) 
	{
		if (myReference.style.visibility == 'visible')
			return true;
		else
			return false;
	}
	else 
	{
		if( myReference.visibility  == 'show' )
			return true;
		else
			return false;
	}
}

function showDiv(divID_as_a_string) 
{
	var myReference = getRefToDiv(divID_as_a_string);
	if( !myReference ) 
	{
		window.alert('Cant get the item in this browser for ' + divID_as_a_string ); 
		return; 
	}
	if( myReference.style ) 
	{
		myReference.style.visibility = 'visible'; 
		myReference.style.display = 'block'; 
	}
	else 
	{
		if( myReference.visibility ) 
		{
			myReference.visibility = 'show'; 
		}
		else 
		{
			window.alert('object does not have visiblity attibute '+divID_as_a_string);
			return; 
		} 
	}
}

function hideDiv(divID_as_a_string) 
{
	var myReference = getRefToDiv(divID_as_a_string);
	if( !myReference ) 
	{
		window.alert('unagle to find the div '+divID_as_a_string);
		return; 
	}
	if( myReference.style ) 
	{
		myReference.style.visibility = 'hidden'; 
		myReference.style.display = 'none'; 
	}
	else
	{
		if( myReference.visibility ) 
		{
			myReference.visibility = 'hide'; 
		}
		else
		{
			window.alert('object does not have visiblity attibute '+divID_as_a_string);
			return; 
		} 
	}
}

function changeDivSize(divID_as_a_string , newX, newY) 
{
	var myReference = getRefToDiv(divID_as_a_string);
	if( !myReference ) 
	{
		window.alert('Nothing works in this browser'); 
		return; 
	}
	if( myReference.style ) 
	{
		myReference = myReference.style;
	}
	myReference.width = newX; 
	myReference.height = newY; 
}
