// panel javascript functions
// Simon Lebrun, Tetraplex Limited
// automatically generated (do not edit)

var timer = null;
var shortClose = 1500;
var longClose = 4000;

function openPanel(n) {
//	alert('open request for '+n);
	var s = new String(n);
	closeAll(s.substr(0,2));
	var panel = document.getElementById("panel"+s);
	if (panel != null) {
		panel.style.visibility = 'visible';
	} else {
		alert('Javascript Error: panel'+s+' not found');
	}
}

function closePanel(n) {
	var panel = document.getElementById("panel"+n);
	if (panel != null) {
		panel.style.visibility = 'hidden';
	} else {
		alert('Javascript Error: panel'+n+' not found');
	}
}

function openPanelAndStartTimer(n, d) {
	openPanel(n);
	startCloseTimer(d);
}

function closeAll(e) {

	// change this to "if IE", etc

	var alldivs = null;

	if (document.getElementsByTagName) {
		allDivs = document.getElementsByTagName("div");
	} else if (document.all) {
		allDivs = document.all.tags('div');
	}

	if (allDivs != null) {
		for (var i = 0; i < allDivs.length; i++) {
			var d = allDivs[i];
			if (d.id.substr(0,5) == 'panel') {
				if ((d.id.substr(5, 2) != e) || (d.id.length > 7)) {
					d.style.visibility='hidden';
				}
			}
		}
	}
	// make use of var allDivs = document.getElementsByTagName("div");

}

function startCloseTimer(d) {
	/* stop any current timer */
	clearCloseTimer();
	timer = setTimeout("closeAll()", d);
}

function clearCloseTimer() {
	if (timer != null) {
		clearTimeout(timer);
		timer = null;
	}
}

function browserTest() {
	var ns4=document.layers?1:0;
	var ie4=document.all?1:0;
	var ns6=document.getElementById&&!document.all?1:0;
}

