//
// This function is used to make flashing text.
//

var flag = true;

function changeColour(elementId)
{
    var delay, delay1 = 1000, delay2 = 500;
		var colour1 = "#457591", colour2 = "#68B0DA";
		
		if (document.getElementById)
		{
		 var element = document.getElementById(elementId);
		 
		 if (flag)
		 	{
		 	 delay = delay1;
			 element.style.color = colour1;
			 flag = false;
			}
			else
			{
			 delay = delay2;
			 element.style.color = colour2;
			 flag = true;
			}
		 setTimeout("changeColour('" + elementId + "')", delay);
		}
}
	// Notes:
	// Add the following to the body tag:
	// onload="changeColour('newsflash');"
	// newsflash is the id of the text that you want to make flash

//
// This function is used on the scholarships.html page
//

function GoLevel( intLevel )
{
 				 document.frmPost.levelAppliedFor.value = intLevel;
				 document.frmPost.submit();
}

//
// The following functions are used on the lighthouse.html page
//

// Show TextBox function

function showTextBox(sLayerName)
{
	hideTextBox();

	var tab;
	
	if (sLayerName == "term1")
		 	tab = "termtab1";
	else if (sLayerName == "term2")
		 	tab = "termtab2";
	else if (sLayerName == "term3")
		 	tab = "termtab3";
	else
			tab = "termtab4";

	if (NS4) 
	{
		document.layers[sLayerName].visibility = "show";
		document.layers[tab].background = "#4E84A3";
		document.layers[tab].color = "white";
	} 
	else if (DOM) 
	{
		document.getElementById(sLayerName).style.visibility = "visible";
		document.getElementById(tab).style.background = "#4E84A3";
		document.getElementById(tab).style.color = "white";
	} 
	else 
	{
		document.all[sLayerName].style.visibility = "visible";
		document.all[tab].style.background = "#4E84A3";
		document.all[tab].style.color = "white";
	}	
	sLayerName = null;
}

// Hide TextBox function.

function hideTextBox() 
{

 oBox = new Array('term1','term2','term3','term4');
 oTab = new Array('termtab1','termtab2','termtab3','termtab4');
	
	for (i = 0; i < oBox.length; i++) 
	{
		if (NS4) 
		{
			document.layers[oBox[i]].visibility = "hide";
			document.layers[oTab[i]].background = "#FFFFFF";
			document.layers[oTab[i]].color = "#4E84A3";
		} 
		else if (DOM) 
		{
			document.getElementById(oBox[i]).style.visibility = "hidden";
			document.getElementById(oTab[i]).style.background = "#FFFFFF";
			document.getElementById(oTab[i]).style.color = "#4E84A3";
		} 
		else 
		{
			document.all[oBox[i]].style.visibility = "hidden";
			document.all[oTab[i]].style.background = "#FFFFFF";
			document.all[oTab[i]].style.color = "#4E84A3";
		}	
	}
}