function fnValidateCSGroupTitle() {
    var himsValidator = [
                             new hims_ctl_val('ctl00_CP_TitleTextBox', "Title", "T", "", "", "", 20),

                             new hims_ctl_val('ctl00_CP_CodeTextBox', "Code", "T", "", "", "", 20)

    ];
    if (fnDoValidate(himsValidator))
        return true;
    else
        return false;
}



function fnValidateHostelStudentGatePass() {
    var himsValidator = [
                             new hims_ctl_val('ctl00_CP_OrgDropDownList', "Organization", "T", "", "", "", 20),

                             new hims_ctl_val('ctl00_CP_EntryModeStatusDropDownList', "Entry Mode Status", "T", "", "", "", 20),

                               new hims_ctl_val('ctl00_CP_StudentIdNoTextBox', "Id No.", "T", "", "", "", 20),
                                new hims_ctl_val('ctl00_CP_RelationshipDropDownList', "Relationship", "T", "", "", "", 20),
                                 new hims_ctl_val('ctl00_CP_VisitorNameTextBox', "Visitor Name", "T", "", "", "", 20),
                                     new hims_ctl_val('ctl00_CP_RemarkTextBox', "Remark", "T", "", "", "", 20),
                            new hims_ctl_val('ctl00_CP_GatePassDateDatePickerControl_DateTextbox', "Gate Pass Date", "T", "", "", "", 20),
                             new hims_ctl_val('ctl00_CP_HostelGatePassReasonDropDownList', "Hostel Gate Pass Reason", "T", "", "", "", 20)

    ];
    if (fnDoValidate(himsValidator))
        return true;
    else
        return false;
}





function fnValidateHostelStudentGatePassBulk() {
    var himsValidator = [

         new hims_ctl_val('ctl00_CP_RelationshipDropDownList', "Relationship", "T", "", "", "", 20),
           new hims_ctl_val('ctl00_CP_VisitorNameTextBox', "Visitor Name", "T", "", "", "", 20),
            new hims_ctl_val('ctl00_CP_HostelGatePassReasonDropDownList', "Hostel Gate Pass Reason", "T", "", "", "", 20),
             new hims_ctl_val('ctl00_CP_RemarkTextBox', "Remark", "T", "", "", "", 20),
                 new hims_ctl_val('ctl00_CP_GatePassDateDatePickerControl_DateTextbox', "Gate Pass Date", "T", "", "", "", 20)                

    ];
    if (fnDoValidate(himsValidator))
        return true;
    else
        return false;
}



function FormatIt(obj) {
    if (obj.value.length == 2)
        obj.value = obj.value + "/";
    if (obj.value.length == 5)
        obj.value = obj.value + "/";
}

function checkAllRows(obj) {   
    var objGridview = obj.closest('table');
    var list = objGridview.getElementsByTagName("input");
    for (var i = 0; i < list.length; i++) {
        var objRow = list[i].parentNode.parentNode;
        if (list[i].type == "checkbox" && obj != list[i]) {
            if (obj.checked) {
                list[i].checked = true;
            }
            else {
                list[i].checked = false;
            }
        }
    }
}
function checkUncheckHeaderCheckBox(obj) {    
    var objGridView = obj.closest('table');
    var list = objGridView.getElementsByTagName("input");
    for (var i = 0; i < list.length; i++) {
        var objHeaderChkBox = list[0];
        var checked = true;
        if (list[i].type == "checkbox" && list[i] != objHeaderChkBox) {
            if (!list[i].checked) {
                checked = false;
                break;
            }
        }
    }
    objHeaderChkBox.checked = checked;
}