var contextHelpStatus;

function setFocus(id)
{
	document.getElementById(id).focus();
}

function displayHelp()
{
	document.getElementById('helpContainer').style.display = 'block';
}

function hideHelp()
{
	document.getElementById('helpContainer').style.display = 'none';
}

function displayHelpTags(theClass)
{
	// Rotate between help displayed / not displayed
	if (contextHelpStatus==1)
	{
		newStyle = 'none';
		contextHelpStatus=0;
	}
	else
	{
		newStyle = 'block';
		contextHelpStatus=1;
	}
			
	var allATags = new Array();
	
    // Create Array of All HTML <a> Tags
    var allATags=document.getElementsByTagName("a");

    // Loop through all tags using a for loop
    for (i=0; i < allATags.length; i++) {

    	// Get all tags with the specified class name.
    	if (allATags[i].className==theClass) {
    		allATags[i].style.display=newStyle;
    	}
    }
}

// SubNav
function showSubNav(item) {
	if (document.getElementById) {
		document.getElementById(item).style.display = "block";
		return false;
		} 
	else {
		return true;
	}
}

function hideSubNav(zap) {
	if (document.getElementById) {
		var abra = document.getElementById(zap).style;
		abra.display = "none";
		return false;
		} 
	else {
		return true;
	}
}
// Forms Processing

function hideStatus() { 
	// Hides the status box on user change in a form
	// I.e. If the status says "page updated", and the user makes a change, then it will no longer display.
	// Triggered on key press + on change events for drop downs + Selects
	document.getElementById("headerTitleStatus").style.display = "none";
}

function drpNvChange(){
	// Resets Element ID to 0, then reprocesses the form
	document.getElementById("drpElAll").selected = true;
	document.forms['form1'].submit();
}

function drpFmChange(){
	// Resets Form Field ID to 0, then reprocesses the form
	document.getElementById("drpFfAll").selected = true;
	document.forms['form1'].submit();
}

function drpTdChange(){
	// Resets Table Values ID to 0, then reprocesses the form
	document.getElementById("drpTvAll").selected = true;
	document.forms['form1'].submit();
}