﻿
function comprobarLogin(){
    this.url = "/default.aspx";
    this.errormail = "Check your mail";
    this.errorpass = "Check your password";
    this.cestaCreada = false;
    this.mensajeCesta = "When login the content of your shopping basket will be cleared. \nDo you wish to continue?";
     
}

comprobarLogin.prototype.login = function (email, password) {
    var strError = ""
    if (!isEml(email)) strError = this.errormail + '\n';
    if (password.length == 0) strError += this.errorpass;
    if (strError != "") {
        alert(strError);
    }
    else {
        if (this.cestaCreada && (!confirm(this.mensajeCesta))) return false;
        document.getElementById("accion").value = "loginAgencia";
        document.getElementById("parametros").value = "&email=" + email + "&password=" + password;
    }

}
