
function testparent(nombre, padre){
    if((!parent || parent == window)&& location.search.length < 1){
      var base = location.href;
      var p = base.indexOf(nombre);
      location.replace(base.substring(0,p) + padre + "?"+base);
    }
}

function testopen(enlace){
  if(parent && parent != window) window.open(enlace,"_top");
  else if(opener && !opener.closed){
    while(opener != opener.parent) opener=opener.parent;
    opener.location = enlace;
    opener.focus();
    window.focus();
  }
  else{
    window.open(enlace,"_blank");
    window.focus();
  }
}


  function winopen(pg,pt){   			         
    vent= window.open(pg,pt,"toolbar=no,directories=no,menubar=no,\
          scrollbars=yes,status=yes,width=600,height=400,dependent=yes");
    vent.focus();
  }

  function winopen2(pg,pt){   			         
    vent= window.open(pg,pt,"toolbar=yes,directories=no,menubar=no,\
          scrollbars=yes,status=yes,width=600,height=400,dependent=yes");
    vent.focus();
  }
  
    function MostrarMenu() {
      var i,obj,args=MostrarMenu.arguments;
      for(i=0; i<(args.length-1); i++) if((obj=document.getElementById(args[i]))!=null && obj.style)
          obj.style.visibility = args[++i];
    }



  function menutemas(bas,iz,to) {
    document.write("<div id='MENUTEMAS' style='position: absolute; left:" + iz + 
                   "px; top:"+to+"px; width: 260px; z-index: 10; visibility: hidden;'>"+
      "<table width='265' border='0' cellspacing='0' cellpadding='5'>"+
        "<tr> "+
          "<td width='50' onmouseover='MostrarMenu(\"MENUTEMAS\",\"hidden\")'></td>"+
          "<td BGCOLOR='#0099cc' align=center class='nada'><b>"+
            "<A HREF='"+bas+"temas/index.htm'>Principio de Inercia</a><br><A HREF='"+bas+"temas/ondas/index.htm'>Ondas "+
            "Mec&aacute;nicas</a></b> </td> "+
          "<td width='50' onmouseover='MostrarMenu(\"MENUTEMAS\",\"hidden\")'></td>"+
        "</tr>"+
        "<tr><td height='50' colspan='3' onmouseover='MostrarMenu(\"MENUTEMAS\",\"hidden\")'></td></tr>"+
      "</table>"+
    "</div>");
  }



function basicmenuapplets(bas,ref,iz,to){
  document.write("<div id='RFAPPLETS' style='position: absolute; left:" + iz +
                 "px; top:"+to+"px; width: 260px; z-index: 10; visibility: hidden;'>"+
    "<table width='285' border='0' cellspacing='0' cellpadding='0'>"+
      "<tr> "+
        "<td width='50' onmouseover='MostrarMenu(\"RFAPPLETS\",\"hidden\")'></td>"+
        "<td BGCOLOR='#0099cc' align=center class='nada'><b>"+
           "<a href="+ref+" onmouseup='MostrarMenu(\"RFAPPLETS\",\"hidden\")'>"+
             "Instrucciones de uso y descarga"+
           "</a><hr>"+
           "<a href='"+bas+"descargas/index.htm#mecanica'>Mec&aacute;nica y Gravedad</a> <br>"+
           "<a href='"+bas+"descargas/index.htm#temperatura'> Temperatura</a><br>"+
           "<a href='"+bas+"descargas/index.htm#electricidad'> Campo El&eacute;ctrico</a><br>"+
           "<a href='"+bas+"descargas/ondas.htm'>Oscilaciones y Ondas</a><br>"+
           "<a href='"+bas+"descargas/index.htm#relatividad'>Relatividad Especial</a></td> "+
        "<td width='50' onmouseover='MostrarMenu(\"RFAPPLETS\",\"hidden\")'></td>"+
      "</tr>"+
      "<tr><td height='50' colspan='3' onmouseover='MostrarMenu(\"RFAPPLETS\",\"hidden\")'></td>"+
    "</tr>"+
  "</table>"+
  "</div>");
}

function menuapplets(bas,iz,to){ 
  basicmenuapplets(bas,"javascript:winopen2('"+bas+"instrucciones.html?a','Instrucciones')",iz,to);
}


