var activeMenue = null;
var timer_ = null;

function parseObject(id) {
	if ( document.getElementById) {return document.getElementById(id);}
	else if ( document.all ){return document.all[id];}
	else if ( document.layers ){return document.layers[id];}
	return null;
	}

function showIT(objParent, obj) {
	if ( obj.style ) {
		var metop = parseInt(docjslib_getRealTop(objParent)+ yShift)+"px";
		var meleft = parseInt(docjslib_getRealLeft(objParent)+ xShift)+"px";
		obj.style.top = metop;
		obj.style.left = meleft;
		//alert(obj.style.left+' '+ obj.style.top+' '+parseInt(docjslib_getRealLeft(objParent)));
		obj.style.visibility = 'visible';
		}
	}

function hideIT(obj) {
	if ( obj.style ) {obj.style.visibility = 'hidden';}
	}

function pHide(str) {
	o  = parseObject(str);
	timer_=setTimeout("hideIT(o)",250);
	}

function clearTimer(){clearTimeout(timer_);}

function triggerMenu(mparent,menu){
	objPMenu  = parseObject(menu);
	//alert(objPMenu.id);
	objParent = parseObject(mparent);
	//alert(activeMenue);
	if ( activeMenue != objPMenu && activeMenue != null) {hideIT(activeMenue);}
	//window.clearTimeout(currentTimer);
	activeMenue = objPMenu;
	if ( ! isVisible(objPMenu) ) {showIT(objParent,objPMenu);}
	return true;
	}

function isVisible(obj)	{
	if ( obj.style ) { obj = obj.style; }
	return (obj.visibility == 'visible');
	}
		
function docjslib_getRealLeft(imgElem){
	xPos = eval(imgElem).offsetLeft;
	tempEl = eval(imgElem).offsetParent;
	while (tempEl != null) {
		xPos += tempEl.offsetLeft;
		tempEl = tempEl.offsetParent;
		}//alert(xPos);
	return xPos;
	}
	
function docjslib_getRealTop(imgElem) {
	yPos = eval(imgElem).offsetTop;
	tempEl = eval(imgElem).offsetParent;
	while (tempEl != null) {
		yPos += tempEl.offsetTop;
		tempEl = tempEl.offsetParent;
		}//alert(yPos);
	return yPos;
	}