function offTimer() {
	if (document.timer) {
		window.clearTimeout(document.timer);
		document.timer = null;
	}
}

function show(obj) {
	if( function_exists("$") ){
		$( obj ).show();
	}
	else{
		document.getElementById(obj).style.display = 'block';
	}
}

function hide( obj ) {
	if( obj == null ){
		obj = document.vis;
	}
	if( function_exists("$") ){
		$( obj ).hide();
	}
	else{
		document.getElementById( obj ).style.display = 'none';
	}
}

function on(obj) {
	//if(!document.getElementById(obj)) return;
	offTimer();
	if (document.vis) {
		hide();
	}
	show(obj);
}

function off(obj) {
	//if(!document.getElementById(obj)) return;
	document.vis = obj;
	//hide();
	document.timer = window.setTimeout('hide()', 50);
}
