function fGetTamanio() {
  var myWidth = 0, myHeight = 0;
  if( typeof( window.innerWidth ) == 'number' ) {
    //Non-IE
    myWidth = window.innerWidth;
    myHeight = window.innerHeight;
  } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
    //IE 6+ in 'standards compliant mode'
    myWidth = document.documentElement.clientWidth;
    myHeight = document.documentElement.clientHeight;
  } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
    //IE 4 compatible
    myWidth = document.body.clientWidth;
    myHeight = document.body.clientHeight;
  }
  return [myWidth,myHeight];
}

function Ajusta() {
  var iTamanio=fGetTamanio();
  if (WTamanio!=iTamanio[0]) {
    var oMenuBanner=document.getElementById('MenuBannerC');
    var oVRed=document.getElementById('Vred');
    var iImagen=0;
    var iImagenW=0;
    var iImagenH=0;
    var bMenu=1;
    aImagen=['gra','nor','chi'];
    aAncho=[500,300,150];
    aAlto=[68,41,21];
    if (iTamanio[0]>1100) {
       iImagen=0;
    } else if(iTamanio[0]>920) {
       iImagen=1;
    } else if(iTamanio[0]>760) {
       iImagen=2;
    } else if(iTamanio[0]>630) {
       iImagen=2;
       bMenu=0;
    } else {
       iImagen=3;
       bMenu=0;
    }
    if (iImagen!=3) {
       if(!(oImg=document.getElementById('Veracruz'))) {
          oVRed.innerHTML='<a href="http://www.veracruzenred.com/"><img Id="Veracruz" alt="veracruzenred.com" border="0" title="veracruzenred"></a>';
          oImg=document.getElementById('Veracruz')
       }
       if (iV!=iImagen) {
         oImg.src="/img/veracruzenred_"+aImagen[iImagen]+".gif";
         oImg.width=aAncho[iImagen];
         oImg.height=aAlto[iImagen];
         iV=iImagen;
       }
    } else {
       if (iV!=3) {
         iV=3;
         oVRed.innerHTML='veracruzenred.com';
       }
    }
    if (bMenu) {
       if (MenuBanner!='') {
         oMenuBanner.innerHTML=MenuBanner;
         MenuBanner='';
       }
    } else {
       if (MenuBanner=='') {
         MenuBanner=oMenuBanner.innerHTML;
         oMenuBanner.innerHTML="";
       }
    }
    WTamanio=iTamanio[0];
  }
//  document.title = "W: "+iTamanio[0]+"H:"+iTamanio[1];
}

function Toggle(e,sClase) {
   e.className = sClase;
}


function Portada_DoFSCommand(command, args) {
  var e=document.getElementById('PiePagina');
//  document.title = "Imagen: "+args;
  e.innerHTML = Pies[args];
}

var Pies = new Array();
MenuBanner='';
WTamanio=0;
iV=-1;

var iNota=0;
var iNota2=0;
var bPrimero=1;
var bNota1Primero=1;
var oNot1, oNot2;

// Funciones de Animación de Notas
function Notas() {
  if (bPrimero) {
     bPrimero=0;
     oNot1=document.getElementById('DivNot1');
     oNot2=document.getElementById('DivNot2');
     oNot2.innerHTML='<table class="Separacion" align="center" width="235"><tr><td></td></tr></table>'+oNot1.innerHTML;
     oNot2.style.left = oNot1.offsetLeft;
     iNota2 = oNot1.offsetTop + oNot1.offsetHeight + 15;
     oNot2.style.top = iNota2;
     oNot2.style.display='';
  }
  if (oNot1.offsetTop < (oNot1.offsetHeight * -1)) {
     iNota=oNot2.offsetTop+oNot2.offsetHeight+15;
     if (bNota1Primero==1) {
        bNota1Primero=0;
        oNot1.innerHTML='<table class="Separacion" align="center" width="235"><tr><td></td></tr></table>'+oNot1.innerHTML;
     }
  }

  if (oNot2.offsetTop < (oNot2.offsetHeight * -1)) {
     iNota2=oNot1.offsetTop+oNot1.offsetHeight+15;
  }

//  document.title = "H: "+oNot.offsetHeight+" Top: "+oNot.style.top;
  oNot1.style.top = iNota;
  oNot2.style.top = iNota2;
  iNota-=1;
  iNota2-=1;
}

var iTop=0;

function fAnimaAvanzada() {
  oNot1=document.getElementById('DivNot1');
  if (oNot1.offsetTop > iTop) {
     oNot1.style.top = oNot1.offsetTop - 10;
     setTimeout('fAnimaAvanzada();',50);
  } else if (oNot1.offsetTop < iTop) {
//     oNot1.style.top = oNot1.offsetTop + 10;
//     setTimeout('fAnimaAvanzada();',50);
     oNot1.style.top = iTop;
  } else {
     oNot1.style.top = iTop;
  }
}

function fAvanza(iNumero) {
//  oNot1=document.getElementById('DivNot1');
  iNumero=iNumero-1;
//  oNot1.style.top=0-(250*iNumero);
  iTop=0-(250*iNumero);
  setTimeout('fAnimaAvanzada();',50);
}