
preLoad(imgRoot+'button-over.gif');

function preLoad(url) {
	if(!document.images) return;
	var img = new Image();
	img.src = url;
}

function menuOver(obj, prefix, display) {
	if(typeof obj == 'number')
		obj = document.getElementById(prefix+'_'+obj);
	if(obj.menuTimeout)
		clearTimeout(obj.menuTimeout);
	obj.style.display=display;
	
}

function menuOut(obj, prefix) {
	if(typeof obj == 'number')
		obj = document.getElementById(prefix+'_'+obj);
	obj.menuTimeout = setTimeout(function() {obj.style.display='none';}, 100);
}

function toggleDisplay(obj) {
	if(typeof obj == 'string')
		obj = document.getElementById(obj);
	
	if(obj.style.display != 'none')
		obj.style.display = 'none';
	else
		obj.style.display = '';
}

function show(obj) {
	if(typeof obj == 'string')
		obj = document.getElementById(obj);
	obj.style.display = '';
}

function hide(obj) {
	if(typeof obj == 'string')
		obj = document.getElementById(obj);
	obj.style.display = 'none';
}

function addLoadEvent(func) {
	var oldonload = window.onload;
	if (typeof window.onload != 'function') {
		window.onload = func;
	}
	else {
		window.onload = function() {
			oldonload();
			func();
		}
	}
}