//Included by Ranjith on 08-July-2011 for Ibutton Validation
function ValidationIButtonEntry() {

    var IButtonKey = document.getElementById('txtIButtonKey');
    var IButtonName = document.getElementById('txtIButtonname');

    var isError = false;
    var controlToBeFocused;
    var alertMessage = '';

    if (RemoveSpaces(IButtonKey).length == 0) {

        alertMessage += (alertMessage.length == 0 ? '' : '\n') + 'Please enter the Ibutton Key.';
        if (!isError) {
            isError = true;
            controlToBeFocused = IButtonKey;
        }

        IButtonKey.style.backgroundColor = 'lightyellow';
    }
    else {
        IButtonKey.style.backgroundColor = 'white';
    }

    if (RemoveSpaces(IButtonName).length == 0) {

        alertMessage += (alertMessage.length == 0 ? '' : '\n') + 'Please enter the Ibutton Key Name.';
        if (!isError) {
            isError = true;
            controlToBeFocused = IButtonName;
        }

        IButtonName.style.backgroundColor = 'lightyellow';
    }
    else {
        IButtonName.style.backgroundColor = 'white';
    }

    if (isError) {
        controlToBeFocused.focus();
        alert(alertMessage);
        return false;
    }
    else {
        return true;
    }
}

function ValidationKeyEntry() {

    var Username = document.getElementById('txtUserName');

    var isError = false;
    var controlToBeFocused;
    var alertMessage = '';
   

//    if (document.getElementById("ASPxKey").value == null) {

//        alertMessage += (alertMessage.length == 0 ? '' : '\n') + 'Please Select the Key.';
//        if (!isError) {
//            isError = true;
//            controlToBeFocused = document.getElementById("ASPxKey");
//        }
//        document.getElementById("ASPxKey").style.backgroundColor = 'lightyellow';
//    }
//    else {
//        document.getElementById("ASPxKey").style.backgroundColor = 'white';
//    }

    if (RemoveSpaces(Username).length == 0) {

        alertMessage += (alertMessage.length == 0 ? '' : '\n') + 'Please enter the Username.';
        if (!isError) {
            isError = true;
            controlToBeFocused = Username;
        }
        Username.style.backgroundColor = 'lightyellow';
    }
    else {
        Username.style.backgroundColor = 'white';
    }
       
    if (isError) {
        controlToBeFocused.focus();
        alert(alertMessage);
        return false;
    }
    else {
        return true;
    }
}
