window.onerror = null;

function showSection(section) {
	if (typeof top.mainArea != 'undefined') 
		top.mainArea.location = section + ".php";
}

function showPage(pageName,section) {
	if (section != null)
		setSectionVisible(section,true);
	if (typeof top.mainArea != 'undefined') 
		top.mainArea.location = pageName;
}


function toggleSectionVisibility(divID) {
	showSection(divID);
	toggleSection(divID);
}

function toggleSection(divID) {
	if (typeof top.menuArea != 'undefined') {
		if (top.menuArea.currentSection != null)
			top.menuArea.document.getElementById(top.menuArea.currentSection).style.display = 'none';
		top.menuArea.currentSection = divID;
		if (top.menuArea.currentSection != null) {
			if (top.menuArea.document.getElementById(top.menuArea.currentSection).style.display == 'none')
				top.menuArea.document.getElementById(top.menuArea.currentSection).style.display = 'block';
			else
				top.menuArea.document.getElementById(top.menuArea.currentSection).style.display = 'none';
		}
	}
}

function setSectionVisible(divID,isVisible) {
	showSection(divID);
	if (typeof top.menuArea != 'undefined') {
		if (top.menuArea.currentSection != null)
			top.menuArea.document.getElementById(top.menuArea.currentSection).style.display = 'none';
		top.menuArea.currentSection = divID;
		if (isVisible)
			top.menuArea.document.getElementById(divID).style.display = 'block';
		else
			top.menuArea.document.getElementById(divID).style.display = 'none';	
	}	
}

function toggleDiv(divID) {
	if (divID != null) {
		if (document.getElementById(divID).style.display == 'none') {
			document.getElementById(divID).style.display = 'block';
			var linkDiv = document.getElementById(divID+'Link');
			if (typeof linkDiv != 'undefined')
				linkDiv.innerHTML = '&uarr; Show Less &uarr;';
			}
		else {
			document.getElementById(divID).style.display = 'none';
			var linkDiv = document.getElementById(divID+'Link');
			if (typeof linkDiv != 'undefined')
				linkDiv.innerHTML = '&darr; Show More &darr;';
		}	
	}
}

function setDivVisible(divID,isVisible) {
	if (divID != null) {
		if (isVisible)
			document.getElementById(divID).style.display = 'block';
		else
			document.getElementById(divID).style.display = 'none';		
	}
}

