// para abrir ventanas emergentes:
      /*Centra la ventana que se abre si se pasa la url, si no 
      tambien puede calcular la posicion del centro de la pagina.*/
      var x=0;
      var y=0;
      function CentrarEmergente(ancho,alto,url,nombre)
      {   
          if (!document.all && !document.layers)
          {
              return;
          }
          x=screen.width;
          y=screen.height;
          x=Math.floor((x-ancho)/2);
          y=Math.floor((y-alto)/2)-20;
          if ((url!=null)&&(nombre==null))
          {
              Emergente(url,x,y,ancho,alto);
          }
		  if ((url!=null)&&(nombre!=null))
		  {
              Emergente(url,x,y,ancho,alto,nombre);
		  }    
      }

      function Emergente(url,x,y,ancho,alto,nombre)
      { 
	  	var apodo;
	  	if (nombre!=null)
			apodo=nombre;
		else    
        	nombre='emergen';					
        win1="width="+ancho+",height="+alto+",top="+y+",left="+x+"'"
        win2=",directories=0,location=0,status=0,scrollbars=1,toolbar=0,menubar=0,resizable=1";
        win=win1+win2;
        window.open(url,nombre,win);
      }
	  
