function phonesubmit() {
    if (validate_phone()) {
        return true;
    } else {
        return false;
    }
}

function smssubmit() {
    if (validate_pin()) {
        return true;
    } else {
        return false;
    }
}

function validate_pin() {
    strPin = document.getElementById("pin").value;
    clear_error("pin");
    if (strPin.length < 5) {
        highlight_error("pin");
        return false;
    }
    return true;
}

function validate_phone() {
    strPhone = document.getElementById("mobile").value;
    clear_error("mobile");
    if (cell_formats.length < 1) { 
        return true; 
    }
    var formats = false;
    for (var idx in cell_formats) {
        formats = true;
        var objRE = new RegExp(cell_formats[idx], "i");
        if (objRE.exec(strPhone)) {
            return true;
        }
    }
    if (!formats) {
        return true;
    } else {
        highlight_error("mobile");
        return false;
    }
}

