﻿
function divFileHide() {
var divLoading = document.getElementById('loadingFileDiv');
divLoading.style.display = 'block';
}

function divFileShow() {
var divLoading = document.getElementById('loadingFileDiv');
divLoading.style.display = 'none';
}

function upload(){
divFileHide();
}

function onComplete( result ) {
divFileShow();
}

function clickOnce(btn, msg) {
    // Comprobamos si se está haciendo una validación
    if (typeof (Page_ClientValidate) == 'function') {
        // Si se está haciendo una validación, volver si ésta da resultado false
        if (Page_ClientValidate() == false) { return false; }
    }

    // Asegurarse de que el botón sea del tipo button, nunca del tipo submit
    if (btn.getAttribute('type') == 'button') {
        // El atributo msg es totalmente opcional.
        // Será el texto que muestre el botón mientras esté deshabilitado
        if (!msg || (msg == 'undefined')) { msg = 'Enviando...'; }

        btn.value = msg;

        // La magia verdadera :D
        btn.disabled = true;
    }

    return true;
}
