﻿/* Function to validate if we do have values provided for user id and password. */
function ValidateUserInfo(userid, pwd) {
    if (userid == '') {
        alert('User Id cannot be blank.');
        return false;
    }

    if (pwd == '') {
        alert('Password cannot be blank.');
        return false;
    }

    return true;
}

/* Function to get the url for user credential verification and redirect to the old pages */
function GetTarget(userid, pwd, oldUri) {
    var url = '';

    if (ValidateUserInfo(userid, pwd)) {
        url = oldUri;
    }
    else {
        url = 'home.aspx';
    }
    return url;
}

