//--------------------------------------------------------------------------------------------------------
//Funcion que carga el frame central de acuerdo a un parametro que se le envie por peticion GET
//--------------------------------------------------------------------------------------------------------
function cargarFrames(){
   var urls = parent.location.href.split('?');
   for(i=0;i<urls.length;i++){
      if(i==1){
         parent.rightFrame.location.href=urls[1];
      }
   }
}
//--------------------------------------------------------------------------------------------------------
// esta funcion carga los frames izquierdo y central de acuerdo a los parametros enviados desde la
// la Home Page. debe ser ejecutada desde el frameTop
//--------------------------------------------------------------------------------------------------------

function cargaFramesDesdeHome(){

//    window.open("bancavipfrcentro.htm","mainFrame","toolbar=yes,status=yes,menubar=yes,resizable=1,directories=yes,location=yes,scroll=yes");
    var urls = parent.location.href.split('?');

    //si se esta accesando el mapa del sitio desde HomePage se direcciona de acuerdo al explorador se este usado
    if (urls[2] == "prmapasitioIe.htm"){
       if (document.layers){
             urls[2] = "prmapasitioNs.htm";
       }
    }

    parent.leftFrame.location.href=urls[1] + "?home"; //se agrega "home" para diferenciar llamada desde el mapa
    parent.mainFrame.location.href=urls[2];

}
//--------------------------------------------------------------------------------------------------------
// Esta funcion carga los frames izquierdo y central cuando se selecciona alguno de los menus colgantes
// ubicados en frameTop. debe ejecutarse en frameTop
//--------------------------------------------------------------------------------------------------------
function evaluarOpcion (menu,itemsel){

  if (menu == 1){

     if (itemsel == 1){
         parent.leftFrame.location.href = "frameletf0.htm?none?none";
         parent.mainFrame.location.href = "quienes/quienesfrcentro.htm";
     }
     if (itemsel == 2){
         parent.location.href = "mapasc/colombia/mapagya.htm";
     }
     if (itemsel == 3){
              parent.leftFrame.location.href = "frameletf21.htm?none?none";
              parent.mainFrame.location.href = "defensor/defensor.htm";
     }
     if (itemsel == 4){
         parent.leftFrame.location.href = "frameletf15.htm?none?none";
         parent.mainFrame.location.href = "concursopintura/concurso_pintura-1.htm";
     }
     if (itemsel == 5){
              parent.leftFrame.location.href = "frameletf20.htm?none?none";
              parent.mainFrame.location.href = "bbvabancoganadero/seminario.htm";
     }
     if (itemsel == 6){
              parent.leftFrame.location.href = "frameletf23.htm?none?none";
              parent.mainFrame.location.href = "oportunidades/oportunidades.htm";
     }
     
  }

  if (menu == 2){

     if (itemsel==1){
         window.open("http://www.bbvahorizonte.com.co","_Blank","toolbar=yes,status=yes,menubar=yes,resizable=1,directories=yes,location=yes,scrollbar=yes");
     }
     if (itemsel==2){
//       window.open("filisegfrizquierdo.htm","leftFrame","");
//       window.open("frameletf.htm?filiseg/filisegfrcentro1.htm?h?men0007","leftFrame","toolbar=yes,status=yes,menubar=yes,resizable=1,directories=yes,location=yes,scrollbar=yes");
         parent.leftFrame.location.href = "frameletf6.htm?none?none";
         parent.mainFrame.location.href = "filiseg/filisegfrcentro1.htm";
     }
     if (itemsel==3){
         parent.leftFrame.location.href = "frameletf8.htm?none?none";
         parent.mainFrame.location.href = "fidugan/fidugan-1.htm";
     }
     if (itemsel==4){
         parent.leftFrame.location.href = "frameletf7.htm?none?none";
         parent.mainFrame.location.href = "filialvlr/filialvlrfrcentro.htm";
     }
  }

  if (menu == 3){

     if (itemsel == 1){
         parent.leftFrame.location.href = "frameletf1.htm?none?none";
         parent.mainFrame.location.href = "bancapar/bancaparfrcentr1.htm";
     }
     if (itemsel == 2){
         parent.leftFrame.location.href = "frameletf2.htm?none?none";
         parent.mainFrame.location.href = "bancavip/bancavipfrcentro.htm";
     }
     if (itemsel == 3){
         parent.leftFrame.location.href = "frameletf3.htm?none?none";
         parent.mainFrame.location.href = "bancaemp/bancaempfrcentro.htm";
     }
     if (itemsel == 4){
         parent.leftFrame.location.href = "frameletf5.htm?none?none";
         parent.mainFrame.location.href = "bancains/bancainsfrcentro.htm";
     }
     if (itemsel == 5){
         parent.leftFrame.location.href = "frameletf4.htm?none?none";
         parent.mainFrame.location.href = "bancacor/bancacorfrcentro.htm";
     }
     if (itemsel == 6){
              parent.leftFrame.location.href = "frameletf24.htm?none?none";
              parent.mainFrame.location.href = "bancadistancia/bancadiscentro.htm";
     }
     
  }

  if (menu == 4){

     parent.leftFrame.location.href = "frameletf9.htm?none?none";
     parent.mainFrame.location.href = "premlib/images/promocionmes0101.htm";

  }

}

//--------------------------------------------------------------------------------------------------------
// Esta funcion carga los layers y framecentral que inicialmente debe ver el usuario al hacer click
// desde el mapa del sitio. se ejecuta en leftFrame
//  0        1       2    3    4
// LeftUrl?mainUrl?layer?img?rutaimg
//--------------------------------------------------------------------------------------------------------
function cargarlayers(){

   var parametros;

   parametros = parent.leftFrame.location.href.split('?');  //se obtienen parametros

   if (parametros[1] != "home"){

      if (parametros[2] == "bottom"){

         //si se esta accesando el mapa del sitio desde frameBottom se direcciona de acuerdo al explorador se este usado
         if (parametros[1] == "prmapasitioIe.htm"){
	    if (document.layers){
                parametros[1] = "prmapasitioNs.htm";
            }
         }
         //se carga el frame del centro cuando hay clik en frame inferior
         parent.mainFrame.location.href = parametros[1];

      }
      else{

           //cuando se da click en el mapa se debe cargar el frame del centro pero no
           //cuando se da click en el frame top por lo cual se valida de esta forma
           if (parametros[1] != "none"){

              parent.mainFrame.location.href = parametros[1];

           }

           // cuando se da click en el mapa del sitio si se reciben parametros para desplegar
           // submenus se hacen visibles los layers respectivos.
           if (parametros[2] != 'none'){

              MM_showHideLayers(parametros[2],'','show');

              if (parametros[3] != 'none'){

                 MM_nbGroup('down','navbar1',parametros[3],parametros[4],1)
                 //MM_swapImage(parametros[3],'',parametros[4],0);

              }

            }

      }

   }

}





