timeOut = 300;
timerId = null;
var timerObject = new Object();

var brType = "none";
// netscape navigator doesn't supported
if (document.layers) {
	brType = "";
}
else if (document.getElementById) {
	brType = "dm";
}
else if (document.all) {
	brType = "ie";
}

if ((brType=="ie") || (brType=="dm")) {
	document.writeln("<link rel=stylesheet href=/opit_act.css type=text/css>");
}

function getObject(name)
{
	if (brType == "dm") {
		return document.getElementById(name);
	}
	else if (brType == "ie") {
		return document.all(name);
	}
	else if (brType == "nn") {
		return document.layers[name];
	}

	return null;
}
	
function getLeft(srcobj)
{
	var obj = srcobj;
	var pos = obj.offsetLeft;
	while (obj.offsetParent != null) {
		obj = obj.offsetParent;
		pos += obj.offsetLeft;
		if (obj.tagName == 'BODY') break;
	}
	return pos;
}

function getTop(srcobj)
{
	var obj = srcobj;
	var pos = obj.offsetTop;
	while (obj.offsetParent != null) {
		obj = obj.offsetParent;
		pos += obj.offsetTop;
		if (obj.tagName == 'BODY') break;
	}
	return pos;
}

function showBlock(parentBlock,childBlock)
{
	var obj = getObject(parentBlock);
	var obj2 = getObject(childBlock)


	if ((obj!=null) && (obj2!=null)) {
		try {
			clearTimeout(timerId);
			timerId = null;
			if (timerObject!=null) {
				if (timerObject!=obj2) {
					timerObject.style.display = "none";
					timerObject = null;
				}
			}
		}
		catch (f) {
		}

		if (obj2.style.display=="none") {
			with (obj2.style) {
				width = obj.clientWidth;
				left = getLeft(obj);
				top = getTop(obj) + obj.clientHeight;
				display = "block";
			}
		}

		return true;
	}
	else {
		return false;
	}
}

function hideBlock(childBlock)
{
	var obj = getObject(childBlock);
	if (obj!=null) {
function hideTimeouted()
{
	try {
		obj.style.display = "none";
		timerObject = null;
	}
	catch (f) 
	{
	}
}
		timerId = setTimeout(hideTimeouted, timeOut);
		timerObject = obj;

		return true;
	}
	else {
		return false;
	}
}

function setHidden(block)
{
	var obj = getObject(block)
	if (obj!=null)
		obj.style.display="none"
}
