﻿/* Miscelanea ------------------------------------------------------------------------------ */
function replace(strTexto, strTextoOld, strTextoNew) {
    return strTexto.split(strTextoOld).join(strTextoNew);
}
function impresionPagina() {
    setTimeout("window.print()", 1000);
}
function verPoliticasPrivacidad() {
    var intAnchura = 700;
    var intAltura = 700;
    var strUrl = "/politicasPrivacidad.aspx";
    var intPosIzquierda, intPosTop;
    if (screen) {
        intPosIzquierda = (screen.width - intAnchura) / 2;
        intPosTop = (screen.height - intAltura) / 2;
    } else {
        intPosIzquierda = 0;
        intPosTop = 0;
    }
    var strAtributos = "width=" + intAnchura + ", height=" + intAltura + ", scrollbars=yes," +
					   "left=" + intPosIzquierda + ",top=" + intPosTop;
    objVentanaPoliticasPrivacidad = window.open(strUrl, "VentanaPoliticasPrivacidad", strAtributos);
    objVentanaPoliticasPrivacidad.focus();
}
function posicionaScrollPagina() {
    $('html, body').animate({
        scrollTop: $(document).height()
    }, 1500);
}
function validarLongitudTextArea(objTextArea, intMaxLength) {
    if (objTextArea.value.length > intMaxLength) {
        objTextArea.value = objTextArea.value.substring(0, intMaxLength);
    }
    try {
        document.getElementById("CaracteresRestantes").innerHTML = intMaxLength - objTextArea.value.length;
    } catch (e) {/*Si no existe no da error y continua con el proceso*/
    }
}

