﻿function cambiaTipoGanadero() { 
  alert("Esto implica un cambio en el código de la ganadería");
}

function esconder(div) {
  if (document.getElementById)
     document.poppedLayer = eval('document.getElementById(div)');
  else if (document.all)
     document.poppedLayer = eval('document.all[div]');
  else
     document.poppedLayer = eval('document.layers[div]');
  document.poppedLayer.style.display = "none";
}



function mostrar(div) {
  if (document.getElementById)
     document.poppedLayer = eval('document.getElementById(div)');
  else if (document.all)
     document.poppedLayer = eval('document.all[div]');
  else
     document.poppedLayer = eval('document.layers[div]');
  h = obtenerTamanoPaginaH();
  w = obtenerTamanoPaginaW();
  document.poppedLayer.style.height = h;
  document.poppedLayer.style.width = w;
  document.poppedLayer.style.display = "block";
}


function obtenerTamanoPaginaH() {
    if (window.innerHeight && window.scrollMaxY) { // Firefox         
        yWithScroll = window.innerHeight + window.scrollMaxY;         
        xWithScroll = window.innerWidth + window.scrollMaxX;     
    } else if (document.body.scrollHeight > document.body.offsetHeight){ // all but Explorer Mac         
        yWithScroll = document.body.scrollHeight;         
        xWithScroll = document.body.scrollWidth;     
    } else { // works in Explorer 6 Strict, Mozilla (not FF) and Safari         
        yWithScroll = document.body.offsetHeight;         
        xWithScroll = document.body.offsetWidth;       
    }     
    arrayPageSizeWithScroll = new Array(xWithScroll,yWithScroll);     
    //alert( 'The height is ' + yWithScroll + ' and the width is ' + xWithScroll );     
    return yWithScroll;
}

function obtenerTamanoPaginaW() {
    if (window.innerHeight && window.scrollMaxY) { // Firefox         
        yWithScroll = window.innerHeight + window.scrollMaxY;         
        xWithScroll = window.innerWidth + window.scrollMaxX;     
    } else if (document.body.scrollHeight > document.body.offsetHeight){ // all but Explorer Mac         
        yWithScroll = document.body.scrollHeight;         
        xWithScroll = document.body.scrollWidth;     
    } else { // works in Explorer 6 Strict, Mozilla (not FF) and Safari         
        yWithScroll = document.body.offsetHeight;         
        xWithScroll = document.body.offsetWidth;       
    }     
    arrayPageSizeWithScroll = new Array(xWithScroll,yWithScroll);     
    //alert( 'The height is ' + yWithScroll + ' and the width is ' + xWithScroll );     
    return xWithScroll;
}



function SetMaxLength(memo, maxLength) {
    if (!memo)
        return;
    if (typeof (maxLength) != "undefined" && maxLength >= 0) {
        memo.maxLength = maxLength;
        memo.maxLengthTimerToken = window.setInterval(function() {
            var text = memo.GetText();
            if (text && text.length > memo.maxLength)
                memo.SetText(text.substr(0, memo.maxLength));
        }, 10);
    } else if (memo.maxLengthTimerToken) {
        window.clearInterval(memo.maxLengthTimerToken);
        delete memo.maxLengthTimerToken;
        delete memo.maxLength;
    }
}
function OnMaxLengthChanged(s, e) {
    var maxLength = s.GetNumber();
    SetMaxLength(memo, maxLength);
}

