  function findPosX(obj)
  {
    var curleft = 0;
    if(obj.offsetParent)
        while(1) 
        {
          curleft += obj.offsetLeft;
          if(!obj.offsetParent)
            break;
          obj = obj.offsetParent;
        }
    else if(obj.x)
        curleft += obj.x;
    return curleft;
  }

  function findPosY(obj)
  {
    var curtop = 0;
    if(obj.offsetParent)
        while(1)
        {
          curtop += obj.offsetTop;
          if(!obj.offsetParent)
            break;
          obj = obj.offsetParent;
        }
    else if(obj.y)
        curtop += obj.y;
    return curtop;
  }
function posicionar_menu()
{
	document.getElementById("menu").style.left=findPosX(document.getElementById("referencia"))+250
	document.getElementById("menu").style.top=0
	//alert(findPosX(document.getElementById("referencia")))
}
window.onresize=posicionar_menu


////////menu/////////////////
//onmouseover="this.style.MozOpacity=1;this.filters.alpha.opacity=100;this.style.top=0" onmouseout="this.style.MozOpacity=0.7;this.filters.alpha.opacity=70;this.style.top=-10"
//define las unidades del menu
var unidades=new Array("estudio","proyectos","areas")
function menu(unidad_target,unidad_activa,activar)
{
	if(activar)
	{
	//desactiva todos los objetos
	
		for(var i=0;i<unidades.length;i++) //recorre todas las unidades
		{	//unidades
			
			/*document.getElementById("unidad_"+unidades[i]).style.MozOpacity=0.7
			document.getElementById("unidad_"+unidades[i]).filters.alpha.opacity=70
			
			document.getElementById("unidad_"+unidades[i]).style.top=-10
			document.getElementById("unidad_"+unidad_target).style.zIndex=0*/
			document.getElementById("unidad_"+unidades[i]).className="menuInactivo"
		
		}	
	
	//activa el objeto target y su titulo
			//unida target
			/*document.getElementById("unidad_"+unidad_target).style.MozOpacity=1
			document.getElementById("unidad_"+unidad_target).filters.alpha.opacity=100
			
			document.getElementById("unidad_"+unidad_target).style.top=0
			document.getElementById("unidad_"+unidad_target).style.zIndex=3*/
			document.getElementById("unidad_"+unidad_target).className="menuActivo"

	}
	else //vuelve todo al estado anterior
	{
	//desactiva todos los objetos
	
		for(var i=0;i<unidades.length;i++) //recorre todas las unidades
		{	//unidades	
			/*document.getElementById("unidad_"+unidades[i]).style.MozOpacity=0.7
			document.getElementById("unidad_"+unidades[i]).filters.alpha.opacity=70
			document.getElementById("unidad_"+unidades[i]).style.top=-10
			document.getElementById("unidad_"+unidad_target).style.zIndex=0*/
			document.getElementById("unidad_"+unidades[i]).className="menuInactivo"
		
		}
		
	//activa la unidad activa y su titulo
			//unida target
			/*document.getElementById("unidad_"+unidad_activa).style.MozOpacity=1
			document.getElementById("unidad_"+unidad_activa).filters.alpha.opacity=100
			
			document.getElementById("unidad_"+unidad_activa).style.top=0
			document.getElementById("unidad_"+unidad_activa).style.zIndex=1*/
			document.getElementById("unidad_"+unidad_activa).className="menuActivo"
	}

}

<!--
function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);
//-->

//Su explorador no soporta java o lo tiene deshabilitado; esta pagina necesita javascript para funcionar correctamente<!-- 
//Copyright © McAnam.com 

    function favoritos(direccion,descripcion){ 
        if ((navigator.appName == "Microsoft Internet Explorer") && (parseInt(navigator.appVersion)>3)){ 
            window.external.AddFavorite(direccion,descripcion); 
        } 
        else if(navigator.appName == "Netscape")
		 {
            alert("Presione Crtl+D para agregar esta página a sus 'Favoritos'"); 
        } 
        else{ 
            alert("su navegador no dispone de esta opción"); 
        } 
    } 
                     
//-->  
function set_agrandar(i)
{ //alert(i)
document.getElementById("image1").href="proyectos/images/IMG_"+(i+1)+".jpg"
	/*switch(i)
	{
		case 1:
		
		break;
		case 2:
		document.getElementById("image1").href="images/IMG_"+(i+1)+".jpg"
		break;
		case 2:
		document.getElementById("image1").href="images/IMG_"+(i+1)+".jpg"
		break;
		case 2:
		document.getElementById("image1").href="images/IMG_"+(i+1)+".jpg"
		break;
	
	}*/
}

function saltoMenu(direccion){ 
  if(direccion!="")window.location=direccion;
}