/* Abre la ventana de acceso a la intranet de inversores */
function abrirIntranet(idioma) {
    var ancho = 590;
    var alto = 320;
    var modo = 4;
    // Inglés
    if (idioma == 'en') {
        nuevaVentana('popupAccesoAplicacionEn.html','intranet_inversores','center', 'center', ancho, alto, modo);
    }
    // Español
    else {
        nuevaVentana('popupAccesoAplicacion.html','intranet_inversores','center', 'center', ancho, alto, modo);
    }
}

/* ----------------------------- */
/* Apertura de una nueva ventana */
/* ----------------------------- */
/* Modos =	1:fullscreen
			2:resizable
			4:scrollbars
			8:titlebar
			16:menubar
			32:toolbar
			64:status			 */
function nuevaVentana(url,nombre,x,y,w,h,modo) {
  if (String(url)=="undefined") url="about:blank";
  if (String(nombre)=="undefined") nombre="ventana"+String(Math.round(1000*Math.random()));
  if (isNaN(w)) {
    if (String(w)=="full") {
      w=window.screen.width-10;
    } else {
      w=512;
    }
  }
  if (isNaN(h)) {
    if (String(h)=="full") {
      h=window.screen.height-50;
    } else {
      h=384;
    }
  }
  if (isNaN(x)) {
    if (String(x)=="left") {
      x=0;
    } else if (String(x)=="right") {
      x=window.screen.width-(w+10);
    } else {
      x=(window.screen.width/2)-(w/2+10);
    }
  }
  if (isNaN(y)) {
    if (String(y)=="top") {
      y=0;
    } else if (String(y)=="bottom") {
      y=window.screen.height-(h+50);
    } else {
      y=(window.screen.height/2)-(h/2+50);
    }
  }
  if (isNaN(modo)) modo=0;
  ventana = window.open(url,nombre,"left="+x+",top="+y+",screenX="+x+",screenY="+y+",width="+w+",height="+h+",fullscreen="+(((modo&1)==1)?"yes":"no")+",resizable="+(((modo&2)==2)?"yes":"no")+",scrollbars="+(((modo&4)==4)?"yes":"no")+",titlebar="+(((modo&8)==8)?"yes":"no")+",menubar="+(((modo&16)==16)?"yes":"no")+",toolbar="+(((modo&32)==32)?"yes":"no")+",status="+(((modo&64)==64)?"yes":"no")+"");
  if (ventana!=null) ventana.focus();
}
