
var tbpW=250;
var tbpO=[],tbpP=[],tbpA,tbpT,tbpTf;

function tbpSet(m,c) {
if (document.getElementById&&document.createElement) {
	var m=document.getElementById(m);
	m.className=c;
	var e,f,i,j;

	var e=m.firstChild;
	while (e) {
		if (e.tagName=='LI') {
			var div=document.createElement('div');
			while (e.firstChild) {
				div.appendChild(e.firstChild);
			}
			e.appendChild(div);
		}
		e=e.nextSibling;
	}

	e=m.getElementsByTagName('a');
	if (!tbpTf) tbpTf=new Function('tbpHAT();');
	for (i=0;i<e.length;i++) {
		e[i].onmouseout=e[i].onblur=tbpTf;
	}

	m=m.getElementsByTagName('ul');
	for (i=0;i<m.length;i++) {
		if (j=m[i].id) {
			tbpO[j]=m[i];
			e=m[i].parentNode;
			f=e.parentNode.getAttribute('id');
			if (tbpO[f]) {
				tbpP[j]=f;
			}
			f=new Function('tbpS(\''+j+'\');');
			e=e.getElementsByTagName('a');
			for (c=0;c<e.length;c++) {
				e[c].onmouseover=e[c].onfocus=f;
			}
			tbpH(j);
		}
	}
}}

function tbpHA() {
	if (tbpA) {
		while (tbpA) tbpH(tbpA);
		tbpHE('visible');
	}
}

function tbpHAT() {
	if (!tbpT) tbpT=setTimeout('tbpHA();', tbpW);
}

function tbpTC() {
	if (tbpT) {
		clearTimeout(tbpT);
		tbpT=null;
	}
}

function tbpS(m) {
	tbpTC();
	if (tbpA) while (tbpA&&m!=tbpA&&tbpP[m]!=tbpA) tbpH(tbpA);
	else tbpHE('hidden');

	tbpSH(m,'visible');
	tbpA=m;
}

function tbpH(m) {
	if (m==tbpA) tbpA=tbpP[m];
	tbpSH(m,'hidden');
	tbpT=null;
}

function tbpSH(m,v) {
	tbpO[m].parentNode.firstChild.className=v;
	tbpO[m].style.visibility=v;
}

function tbpHE(v) {
	tbpHEV(v,document.getElementsByTagName('select'));
}

function tbpHEV(v,e) {
	for (var i=0;i<e.length;i++) e[i].style.visibility=v;
}
