// JavaScript Document
function getY( oElement )
{
  var iReturnValue = 0;
  
  while( oElement != null ) {
  	iReturnValue += oElement.offsetTop;
  	oElement = oElement.offsetParent;
  }
  
  return iReturnValue;
}

function getX( oElement )
{
  var iReturnValue = 0;
  
  while( oElement != null ) {
  	iReturnValue += oElement.offsetLeft;
  	oElement = oElement.offsetParent;
  }
  
  return iReturnValue;
}

function show(id,id2)
{
	var x = getX(document.getElementById(id2)); // x-ul butonului ;)
	if(id=='hiace')
	{
		x=x + 38 -196;  
		//x=x+2 -196;  
	}
	var y = getY(document.getElementById("fad"));  // marginea de sus a fading-ului

	//initializeaza zonele
	document.getElementById(id).style.left = x + "px";
	document.getElementById(id).style.top = y + "px";
	document.getElementById(id).style.display = "none";
}

function show2(id,id2)
{
	if(tov!=''){
		hide3(tov);
		tov='';
	}	
	if(id!='' && id2!=''){
		show(id,id2);
		document.getElementById(id).style.display = "block";
	}
}

function hide(id){
	tov=id;
	//var t = setTimeout("hide3('" + id +"')",50)
}

function hide3(id){
  //if(id!=tov){
  document.getElementById(id).style.display = "none";
  //}
}

var tov='';

function stai(id)
{
	tov = id;
}

function hide2(id)
{
	// tov='';
	document.getElementById(id).style.display = "none";
}
// sfarsit functii meniu
