      ////////////////////////////////////
    //    Menus navegación emergentes   //
   //      Iñaki Gorostiza 2003.       //
  //  igorostiza&copy;ola-e.com            //
  ////////////////////////////////////
var hidding="", id, who=0, layer_up=null;

function abrir_popup(pagina,w,h)
{	x=(screen.width-w)/2;
	y=(screen.height-h)/2;
window.open(pagina,"_blank","resizable=no,border=0,scrollbars=yes,width="+w+",height="+h+",left="+x+", top="+y);
}
function abrir_popup_sin(pagina,w,h)
{	x=((screen.width-w)/2)-5;
	y=(screen.height-h)/2;
window.open(pagina,"_blank","resizable=no,border=0,width="+w+",height="+h+",left="+x+", top="+y);
}


function number()
{
return (Math.round(Math.random()*3)+1);
}

function cambiar(obj,c)
{
	obj.style.background=c;
}

function popup(nombre)
{
	aux=document.getElementById(nombre);
	if (aux.style.visibility=="visible")
	{
		persist();
	}
	else
	{
		popdown_now();
		sombra.style.padding=10;
		sombra.style.left=aux.offsetLeft-10;
		sombra.style.top=aux.offsetTop-10;
		sombra.style.width=aux.offsetWidth+15;
		sombra.style.height=aux.offsetHeight+15;
		layer_up=aux;
		aux.style.visibility='visible';
		sombra.style.visibility='visible';
	}
	
}

function popdown_now()
{

	if ((layer_up!=null)&&(hidding!=""))
	{
		hidding="";	
		layer_up.style.visibility='hidden';	
		sombra.style.visibility='hidden';
		layer_up=null;	
	}
}

function popdown()
{
	if ((layer_up!=null)&&(hidding!=layer_up.id))
	{
		hidding=layer_up.id; 
		id=setTimeout("popdown_now()",300);
	}
}

function persist()
{
	if (hidding!="") 
	{
		hidding="";
		clearTimeout(id);
	}
}
