﻿/* Some common JS functions */
function CheckForBlankItem(mainObj, lblObj) {
    var obj = document.getElementById('ctl00_ContentPlaceHolder1_' + mainObj);
    if (obj != null && obj.value == '') {
        ShowValidationError(obj, lblObj);
        return true;
    }
    ClearValidationError(obj, lblObj);
    return false;
}

function ShowValidationError(textObj, validationItem) {
    var obj = document.getElementById(validationItem);
    if (obj != null && obj.style != null) {
        obj.style.color = 'red';
    }
    if (textObj != null && textObj.style != null) {
        textObj.style.border = '1px solid red';
    }
}

function ClearValidationError(textObj, validationItem) {
    var obj = document.getElementById(validationItem);
    if (obj != null && obj.style != null) {
        obj.style.color = '';
    }
    if (textObj != null && textObj.style != null) {
        textObj.style.border = '1px solid #7f9db9';
    }
}

function GetContentHolderItem(objname) {
    var obj = document.getElementById('ctl00_ContentPlaceHolder1_' + objname);
    if (obj != null) return obj;
    return document.getElementById(objname);
}

