﻿function Grid1AfterSelectChange_appNewsSelect(gridName, rowId) {
    //get cell value;
    var row = igtbl_getRowById(rowId);
    var val = row.DataKey;
    document.getElementById("ctl00_ContentPlaceHolder1_hiddenNewsId").value = val;
}
function windowWidth() {
    return document.body ? document.body.clientWidth : 1;
}
function windowHeight() {
    return document.body ? document.body.clientHeight : 1;
}
function openNewsMaintain(action, id) {
    if (action == "enquire" || action == "update" || action == "delete") {
        if (document.getElementById("ctl00_ContentPlaceHolder1_hiddenNewsId").value != "") {
            var url = "WebAppNewsMaintenance.aspx?id=" + document.getElementById("ctl00_ContentPlaceHolder1_hiddenNewsId").value + "&value=&action=" + action;
            var win = window.open('', '', 'left=' + windowWidth() / 3 + 'px, top=50px, width=800px, height=800px, scrollbars=yes, status =no, resizable=yes');
            win.location.href = url;
            win = null;
            return false;
        }
    }
    else if (action == "add") {
        var url = "WebAppNewsMaintenance.aspx?id=" + "&value=&action=" + action;
        var win = window.open('', '', 'left=' + windowWidth() / 3 + 'px, top=50px, width=800px, height=800px, scrollbars=yes, status =no, resizable=yes');
        win.location.href = url;
        win = null;
        return false;
    }
}
function imageOn(img, id) {
    id.src = img;
}
function imageOff(img, id) {
    id.src = img;
}
function Grid1AfterSelectChange_appFAQSelect(gridName, rowId) {
    //get cell value;
    var row = igtbl_getRowById(rowId);
    var val = row.DataKey;
    document.getElementById("ctl00_ContentPlaceHolder1_hiddenFAQId").value = val;
}
function openFAQMaintain(action, id) {
    if (action == "enquire" || action == "update" || action == "delete") {
        if (document.getElementById("ctl00_ContentPlaceHolder1_hiddenFAQId").value != "") {
            var url = "WebAppFAQMaintenance.aspx?id=" + document.getElementById("ctl00_ContentPlaceHolder1_hiddenFAQId").value + "&value=&action=" + action;
            var win = window.open('', '', 'left=' + windowWidth() / 3 + 'px, top=50px, width=800px, height=800px, scrollbars=yes, status =no, resizable=yes');
            win.location.href = url;
            win = null;
            return false;
        }
    }
    else if (action == "add") {
        var url = "WebAppFAQMaintenance.aspx?id=" + "&value=&action=" + action;
        var win = window.open('', '', 'left=' + windowWidth() / 3 + 'px, top=50px, width=800px, height=800px, scrollbars=yes, status =no, resizable=yes');
        win.location.href = url;
        win = null;
        return false;
    }
}
function disableEnterKey(e) {
    var key;
    if (window.event)
        key = window.event.keyCode; //IE
    else
        key = e.which; //firefox      

    return (key != 13);
}
function Grid1AfterSelectChange_appDocsSelect(gridName, rowId) {
    //get cell value;
    var row = igtbl_getRowById(rowId);
    var val = row.DataKey;
    document.getElementById("ctl00_ContentPlaceHolder1_hiddenDocId").value = val;
}
function Grid1AfterSelectChange_appLinkSelect(gridName, rowId) {
    //get cell value;
    var row = igtbl_getRowById(rowId);
    var val = row.DataKey;
    document.getElementById("ctl00_ContentPlaceHolder1_hiddenLinkId").value = val;
}
function Grid1AfterSelectChange_appPageSelect(gridName, rowId) {
    //get cell value;
    var row = igtbl_getRowById(rowId);
    var val = row.DataKey;
    document.getElementById("ctl00_ContentPlaceHolder1_hiddenPageId").value = val;
}
function openPageMaintain(action, id) {
    if (action == "enquire" || action == "update" || action == "delete") {
        if (document.getElementById("ctl00_ContentPlaceHolder1_hiddenPageId").value != "") {
            var url = "WebAppPagesMaintenance.aspx?id=" + document.getElementById("ctl00_ContentPlaceHolder1_hiddenPageId").value + "&value=&action=" + action;
            var win = window.open('', '', 'left=' + windowWidth() / 3 + 'px, top=50px, width=800px,height=800px, scrollbars=yes, status =no, resizable=yes');
            win.location.href = url;
            win = null;
            return false;
        }
    }
    else if (action == "add") {
        var url = "WebAppPagesMaintenance.aspx?id=" + "&value=&action=" + action;

        var win = window.open('', '', 'left=' + windowWidth() / 3 + 'px, top=50px, width=800px,height=800px, scrollbars=yes, status =no, resizable=yes');
        win.location.href = url;
        win = null;
        return false;
    }
}
function openDocsMaintain(action, id) {
    if (action == "enquire" || action == "update" || action == "delete") {
        if (document.getElementById("ctl00_ContentPlaceHolder1_hiddenDocId").value != "") {
            var url = "WebAppDocumentsMaintenance.aspx?id=" + document.getElementById("ctl00_ContentPlaceHolder1_hiddenDocId").value + "&value=&action=" + action;
            var win = window.open('', '', 'left=' + windowWidth() / 3 + 'px, top=100px, width=780px,height=570px, scrollbars=no, status =no, resizable=yes');
            win.location.href = url;
            win = null;
            return false;
        }
    }
    else if (action == "add") {
        var url = "WebAppDocumentsMaintenance.aspx?id=" + "&value=&action=" + action;
        var win = window.open('', '', 'left=' + windowWidth() / 3 + 'px, top=100px, width=780px,height=570px, scrollbars=no, status =no, resizable=yes');
        win.location.href = url;
        win = null;
        return false;
    }
}
function openLinkMaintain(action, id) {
    if (action == "enquire" || action == "update" || action == "delete") {
        if (document.getElementById("ctl00_ContentPlaceHolder1_hiddenLinkId").value != "") {
            var url = "WebAppLinksMaintenance.aspx?id=" + document.getElementById("ctl00_ContentPlaceHolder1_hiddenLinkId").value + "&value=&action=" + action;
            var win = window.open('', '', 'left=' + windowWidth() / 3 + 'px, top=100px, width=780px,height=440px, scrollbars=no, status =no, resizable=yes');
            win.location.href = url;
            win = null;
            return false;
        }
    }
    else if (action == "add") {
        var url = "WebAppLinksMaintenance.aspx?id=" + "&value=&action=" + action;
        var win = window.open('', '', 'left=' + windowWidth() / 3 + 'px, top=100px, width=780px,height=440px, scrollbars=no, status =no, resizable=yes');
        win.location.href = url;
        win = null;
        return false;
    }
}
function Grid1AfterSelectChange_appAssSelect(gridName, rowId) {
    //get cell value;
    var row = igtbl_getRowById(rowId);
    var val = row.DataKey;
    document.getElementById("ctl00_ContentPlaceHolder1_hiddenAssId").value = val;
}
function openAssMaintain(action, id) {
    if (action == "enquire" || action == "update" || action == "delete") {
        if (document.getElementById("ctl00_ContentPlaceHolder1_hiddenAssId").value != "") {
            var url = "WebAppAssessMaintenance.aspx?id=" + document.getElementById("ctl00_ContentPlaceHolder1_hiddenAssId").value + "&value=&action=" + action;
            var win = window.open('', '', 'left=' + windowWidth() / 3 + 'px, top=100px, width=780px,height=520px, scrollbars=no, status =no, resizable=yes');
            win.location.href = url;
            win = null;
            return false;
        }
    }
    else if (action == "add") {
        var url = "WebAppAssessMaintenance.aspx?id=" + "&value=&action=" + action;
        var win = window.open('', '', 'left=' + windowWidth() / 3 + 'px, top=100px, width=780px,height=520px, scrollbars=no, status =no, resizable=yes');
        win.location.href = url;
        win = null;
        return false;
    }
}
function Grid1AfterSelectChange_appUserSelect(gridName, rowId) {
    //get cell value;
    var row = igtbl_getRowById(rowId);
    var val = row.DataKey;
    document.getElementById("ctl00_ContentPlaceHolder1_hiddenUserId").value = val;
}
function openUserMaintain(action, id) {
    if (action == "enquire" || action == "update" || action == "delete") {
        if (document.getElementById("ctl00_ContentPlaceHolder1_hiddenUserId").value != "") {
            var url = "WebAppUserMaintenance.aspx?id=" + document.getElementById("ctl00_ContentPlaceHolder1_hiddenUserId").value + "&value=&action=" + action;
            var win = window.open('', '', 'left=' + windowWidth() / 3 + 'px, top=100px, width=800px,height=800px, scrollbars=yes, status =no, resizable=yes');
            win.location.href = url;
            win = null;
            return false;
        }
    }
    else if (action == "add") {
        var url = "WebAppUserMaintenance.aspx?id=" + "&value=&action=" + action;
        var win = window.open('', '', 'left=' + windowWidth() / 3 + 'px, top=100px, width=800px,height=800px, scrollbars=yes, status =no, resizable=yes');
        win.location.href = url;
        win = null;
        return false;
    }
    else if (action == "password") {
        if (document.getElementById("ctl00_ContentPlaceHolder1_hiddenUserId").value != "") {
            var url = "WebAppChangePassword.aspx?id=" + document.getElementById("ctl00_ContentPlaceHolder1_hiddenUserId").value;
            var win = window.open('', '', 'left=' + windowWidth() / 3 + 'px, top=100px, width=780px,height=300px, scrollbars=no, status =no, resizable=yes');
            win.location.href = url;
            win = null;
            return false;
        }
    }
}
function Grid1AfterSelectChange_appAssessorBodySelect(gridName, rowId) {
    //get cell value;
    var row = igtbl_getRowById(rowId);
    var val = row.DataKey;
    document.getElementById("ctl00_ContentPlaceHolder1_hiddenAssessorBodyId").value = val;
}
function openAssessorBodyMaintain(action, id) {
    if (action == "enquire" || action == "update" || action == "delete") {
        if (document.getElementById("ctl00_ContentPlaceHolder1_hiddenAssessorBodyId").value != "") {
            var url = "WebAppAssessorBodyMaintenance.aspx?id=" + document.getElementById("ctl00_ContentPlaceHolder1_hiddenAssessorBodyId").value + "&value=&action=" + action;
            var win = window.open('', '', 'left=' + windowWidth() / 3 + 'px, top=100px, width=800px,height=800px, scrollbars=yes, status =no, resizable=yes');
            win.location.href = url;
            win = null;
            return false;
        }
    }
    else if (action == "add") {
        var url = "WebAppAssessorBodyMaintenance.aspx?id=" + "&value=&action=" + action;
        var win = window.open('', '', 'left=' + windowWidth() / 3 + 'px, top=100px, width=800px,height=800px, scrollbars=yes, status =no, resizable=yes');
        win.location.href = url;
        win = null;
        return false;
    }
}
function Grid1AfterSelectChange_appAuthorBodySelect(gridName, rowId) {
    //get cell value;
    var row = igtbl_getRowById(rowId);
    var val = row.DataKey;
    document.getElementById("ctl00_ContentPlaceHolder1_hiddenAuthorBodyId").value = val;
}
function openAuthorBodyMaintain(action, id) {
    if (action == "enquire" || action == "update" || action == "delete") {
        if (document.getElementById("ctl00_ContentPlaceHolder1_hiddenAuthorBodyId").value != "") {
            var url = "WebAppAuthorBodyMaintenance.aspx?id=" + document.getElementById("ctl00_ContentPlaceHolder1_hiddenAuthorBodyId").value + "&value=&action=" + action;
            var win = window.open('', '', 'left=' + windowWidth() / 3 + 'px, top=100px, width=800px,height=800px, scrollbars=yes, status =no, resizable=yes');
            win.location.href = url;
            win = null;
            return false;
        }
    }
    else if (action == "add") {
        var url = "WebAppAuthorBodyMaintenance.aspx?id=" + "&value=&action=" + action;
        var win = window.open('', '', 'left=' + windowWidth() / 3 + 'px, top=100px, width=800px,height=800px, scrollbars=yes, status =no, resizable=yes');
        win.location.href = url;
        win = null;
        return false;
    }
}
function changePasswordWindow() {
    var url = "WebAppChangePassword.aspx";
    var win = window.open('', '', 'left=' + windowWidth() / 3 + 'px, top=100px, width=780px,height=300px, scrollbars=no, status =no, resizable=yes');
    win.location.href = url;
    win = null;
    return false;

}
function passwordReminderWindow() {
    var url = "PasswordReminder.aspx";
    var win = window.open('', '', 'left=' + windowWidth() / 3 + 'px, top=100px, width=600px,height=230px, scrollbars=no, status =no, resizable=yes');
    win.location.href = url;
    win = null;
    return false;
}
function Grid1AfterSelectChange_appProviderSelect(gridName, rowId) {
    //get cell value;
    var row = igtbl_getRowById(rowId);
    var val = row.DataKey;
    document.getElementById("ctl00_ContentPlaceHolder1_hiddenProviderId").value = val;
}
function openProviderMaintain(action, id) {
    if (action == "enquire" || action == "update" || action == "delete") {
        if (document.getElementById("ctl00_ContentPlaceHolder1_hiddenProviderId").value != "") {
            var url = "WebAppProviderMaintenance.aspx?id=" + document.getElementById("ctl00_ContentPlaceHolder1_hiddenProviderId").value + "&value=&action=" + action;
            var win = window.open('', '', 'left=' + windowWidth() / 3 + 'px, top=100px, width=800px,height=800px, scrollbars=yes, status =no, resizable=yes');
            win.location.href = url;
            win = null;
            return false;
        }
    }
    else if (action == "reference") {
        if (document.getElementById("ctl00_ContentPlaceHolder1_hiddenProviderId").value != "") {
            var url = "WebAppProviderReference.aspx?id=" + document.getElementById("ctl00_ContentPlaceHolder1_hiddenProviderId").value;
            var win = window.open('', '', 'left=' + windowWidth() / 3 + 'px, top=100px, width=800px,height=800px, scrollbars=yes, status =no, resizable=yes');
            win.location.href = url;
            win = null;
            return false;
        }
    }
    else if (action == "add") {
        var url = "WebAppProviderMaintenance.aspx?id=" + "&value=&action=" + action;
        var win = window.open('', '', 'left=' + windowWidth() / 3 + 'px, top=100px, width=800px,height=800px, scrollbars=yes, status =no, resizable=yes');
        win.location.href = url;
        win = null;
        return false;
    }
    else if (action == "approval") {
        if (document.getElementById("ctl00_ContentPlaceHolder1_hiddenProviderId").value != "") {
            var url = "WebAppProviderApproval.aspx?id=" + document.getElementById("ctl00_ContentPlaceHolder1_hiddenProviderId").value;
            var win = window.open('', '', 'left=' + windowWidth() / 3 + 'px, top=100px, width=780px,height=780px, scrollbars=no, status =no, resizable=yes');
            win.location.href = url;
            win = null;
            return false;
        }
    }
    else if (action == "renewal") {
        if (document.getElementById("ctl00_ContentPlaceHolder1_hiddenProviderId").value != "") {
            var url = "WebAppProviderRenewal.aspx?id=" + document.getElementById("ctl00_ContentPlaceHolder1_hiddenProviderId").value;
            var win = window.open('', '', 'left=' + windowWidth() / 3 + 'px, top=100px, width=780px,height=590px, scrollbars=no, status =no, resizable=yes');
            win.location.href = url;
            win = null;
            return false;
        }
    }
}
function Grid1AfterSelectChange_appInstructorSelect(gridName, rowId) {
    //get cell value;
    var row = igtbl_getRowById(rowId);
    var val = row.DataKey;
    document.getElementById("ctl00_ContentPlaceHolder1_hiddenInstructorId").value = val;
}
function openInstructorMaintain(action, id) {
    if (action == "enquire" || action == "update" || action == "delete") {
        if (document.getElementById("ctl00_ContentPlaceHolder1_hiddenInstructorId").value != "") {
            var url = "WebAppInstructorMaintenance.aspx?id=" + document.getElementById("ctl00_ContentPlaceHolder1_hiddenInstructorId").value + "&value=&action=" + action + "&providerId=";
            var win = window.open('', '', 'left=' + windowWidth() / 3 + 'px, top=50px, width=800px,height=800px, scrollbars=yes, status =no, resizable=yes');
            win.location.href = url;
            win = null;
            return false;
        }
    }
    else if (action == "add") {
        if (document.getElementById("ctl00_ContentPlaceHolder1_hiddenProviderId").value != "") {
            var url = "WebAppInstructorMaintenance.aspx?id=" + "&value=&action=" + action + "&providerId=" + document.getElementById("ctl00_ContentPlaceHolder1_hiddenProviderId").value;
            var win = window.open('', '', 'left=' + windowWidth() / 3 + 'px, top=50px, width=800px,height=800px, scrollbars=yes, status =no, resizable=yes');
            win.location.href = url;
            win = null;
            return false;
        }
    }
}
function Grid1AfterSelectChange_appCourseselect(gridName, rowId) {
    //get cell value;
    var row = igtbl_getRowById(rowId);
    var val = row.DataKey;
    document.getElementById("ctl00_ContentPlaceHolder1_hiddenCourseId").value = val;
}
function openCoursesMaintain(action, id) {
    if (action == "enquire" || action == "update" || action == "delete") {
        if (document.getElementById("ctl00_ContentPlaceHolder1_hiddenCourseId").value != "") {
            var url = "WebAppCoursesMaintenance.aspx?id=" + document.getElementById("ctl00_ContentPlaceHolder1_hiddenCourseId").value + "&action=" + action;
            var win = window.open('', '', 'left=' + windowWidth() / 3 + 'px, top=50px, width=800px,height=800px, scrollbars=yes, status =no, resizable=yes');
            win.location.href = url;
            win = null;
            return false;
        }
    }
    if (action == "upload") {
        if (document.getElementById("ctl00_ContentPlaceHolder1_hiddenCourseId").value != "") {
            var url = "WebAppCoursesUpload.aspx?id=" + document.getElementById("ctl00_ContentPlaceHolder1_hiddenCourseId").value;
            var win = window.open('', '', 'left=' + windowWidth() / 3 + 'px, top=100px, width=780px,height=800px, scrollbars=no, status =no, resizable=yes');
            win.location.href = url;
            win = null;
            return false;
        }
    }
    if (action == "submit") {
        if (document.getElementById("ctl00_ContentPlaceHolder1_hiddenCourseId").value != "") {
            var url = "WebAppCoursesSubmit.aspx?id=" + document.getElementById("ctl00_ContentPlaceHolder1_hiddenCourseId").value;
            var win = window.open('', '', 'left=' + windowWidth() / 3 + 'px, top=100px, width=780px,height=360px, scrollbars=yes, status =no, resizable=yes');
            win.location.href = url;
            win = null;
            return false;
        }
    }
    else if (action == "add") {

        var url = "WebAppCoursesMaintenance.aspx?id=" + "&action=" + action;
        var win = window.open('', '', 'left=' + windowWidth() / 3 + 'px, top=50px, width=800px,height=800px, scrollbars=yes, status =no, resizable=yes');
        win.location.href = url;
        win = null;
        return false;

    }
    else if (action == "approval") {
        if (document.getElementById("ctl00_ContentPlaceHolder1_hiddenCourseId").value != "") {
            var url = "WebAppCourseApproval.aspx?id=" + document.getElementById("ctl00_ContentPlaceHolder1_hiddenCourseId").value;
            var win = window.open('', '', 'left=' + windowWidth() / 3 + 'px, top=50px, width=780px,height=500px, scrollbars=yes, status =no, resizable=yes');
            win.location.href = url;
            win = null;
            return false;
        }
    }
}
function Grid1AfterSelectChange_appEventSelect(gridName, rowId) {
    //get cell value;
    var row = igtbl_getRowById(rowId);
    var val = row.DataKey;
    document.getElementById("ctl00_ContentPlaceHolder1_hiddenEventId").value = val;
}
function openEventsMaintain(action, id) {
    if (action == "enquire" || action == "update" || action == "delete" || action == "copy") {
        if (document.getElementById("ctl00_ContentPlaceHolder1_hiddenEventId").value != "") {
            var url = "WebAppEventsMaintenance.aspx?id=" + document.getElementById("ctl00_ContentPlaceHolder1_hiddenEventId").value + "&action=" + action;
            var win = window.open('', '', 'left=' + windowWidth() / 3 + 'px, top=50px, width=800px,height=800px, scrollbars=yes, status =no, resizable=yes');
            win.location.href = url;
            win = null;
            return false;
        }
    }
    else if (action == "add") {
        var url = "WebAppEventsMaintenance.aspx?id=" + "&action=" + action;
        var win = window.open('', '', 'left=' + windowWidth() / 3 + 'px, top=50px, width=800px,height=800px, scrollbars=yes, status =no, resizable=yes');
        win.location.href = url;
        win = null;
        return false;

    }
}

function Grid1AfterSelectChange_appInvoiceSelect(gridName, rowId) {
    //get cell value;
    var row = igtbl_getRowById(rowId);
    var val = row.DataKey;
    document.getElementById("ctl00_ContentPlaceHolder1_hiddenInvoiceId").value = val;
}
function openInvMaintain(action, id) {
    if (action == "enquire" || action == "update" || action == "delete") {
        if (document.getElementById("ctl00_ContentPlaceHolder1_hiddenInvoiceId").value != "") {
            var url = "WebAppInvoiceMaintenance.aspx?id=" + document.getElementById("ctl00_ContentPlaceHolder1_hiddenInvoiceId").value + "&action=" + action;
            var win = window.open('', '', 'left=' + windowWidth() / 3 + 'px, top=50px, width=780px,height=800px, scrollbars=no, status =no, resizable=yes');
            win.location.href = url;
            win = null;
            return false;
        }
    }
    else if (action == "print") {
        if (document.getElementById("ctl00_ContentPlaceHolder1_hiddenInvoiceId").value != "") {
            var url = "WebAppInvoicingPrint.aspx?id=" + document.getElementById("ctl00_ContentPlaceHolder1_hiddenInvoiceId").value;
            var win = window.open('', '', 'left=' + windowWidth() / 3 + 'px, top=50px, width=800px,height=800px, scrollbars=yes, status =no, resizable=yes');
            win.location.href = url;
            win = null;
            return false;
        }
    }
}
function providerLinks(linkType, action) {

    var action = "add";

    var id = "";

    if (linkType == "course") {
        //check id and set action
        if (document.getElementById("ctl00_ContentPlaceHolder1_hiddenCourseId").value != "") {
            action = "update";
        }
        openCoursesMaintain(action, document.getElementById("ctl00_ContentPlaceHolder1_hiddenCourseId").value);
    }
    else if (linkType == "courseattach") {
        //check id and set action
        if (document.getElementById("ctl00_ContentPlaceHolder1_hiddenCourseId").value != "") {
            action = "upload";
            openCoursesMaintain(action, document.getElementById("ctl00_ContentPlaceHolder1_hiddenCourseId").value);
        }
    }
    else if (linkType == "base") {
        //check id and set action
        action = "update";
        openProviderMaintain(action, document.getElementById("ctl00_ContentPlaceHolder1_hiddenProviderId").value);
    }
    else if (linkType == "reference") {
        //check id and set action
        action = "reference";
        openProviderMaintain(action, document.getElementById("ctl00_ContentPlaceHolder1_hiddenProviderId").value)
    }
    //    else if (linkType == "instructor") {
    //        //check id and set action
    //        if (document.getElementById("ctl00_ContentPlaceHolder1_hiddenInstructorId").value != "") {
    //            action = "update";
    //        }
    //        openInstructorMaintain(action, document.getElementById("ctl00_ContentPlaceHolder1_hiddenInstructorId").value)
    //    }
    else if (linkType == "event") {
        //check id and set action
        if (document.getElementById("ctl00_ContentPlaceHolder1_hiddenEventId").value != "") {
            action = "update";
        }
        openEventsMaintain(action, document.getElementById("ctl00_ContentPlaceHolder1_hiddenEventId").value)
    }
}
function closeModalBox() {
    var dialogWindow = this.parent.$find("WebDialogWindow1");
    dialogWindow.hide();

}
function courses_assessment_checkBox() {
    if (document.getElementById("UltraWebTab1__ctl2_assessedyesno").checked == true) {
        document.getElementById("UltraWebTab1__ctl2_assessedtype").disabled = false;
    }
    else {
        document.getElementById("UltraWebTab1__ctl2_assessedtype").disabled = true;
        document.getElementById("UltraWebTab1__ctl2_other").disabled = true;
        document.getElementById("UltraWebTab1__ctl2_other").value = "";
        document.getElementById("UltraWebTab1__ctl2_assessedtype").value = "Select";
    }
}
function assessedtype_SelectedIndexChanged() {
    if (document.getElementById("UltraWebTab1__ctl2_assessedtype").value == "5") {
        document.getElementById("UltraWebTab1__ctl2_other").disabled = false;
    }
    else {
        document.getElementById("UltraWebTab1__ctl2_other").disabled = true;
        document.getElementById("UltraWebTab1__ctl2_other").value = "";
    }
}
function longterm_CheckedChanged() {
    if (document.getElementById("UltraWebTab1__ctl0_longterm").checked == true) {
        document.getElementById("UltraWebTab1__ctl0_cpdhours").disabled = false;
        document.getElementById("UltraWebTab1__ctl0_cpdminutes").disabled = false;
    }
    else {
        document.getElementById("UltraWebTab1__ctl0_cpdhours").disabled = true;
        document.getElementById("UltraWebTab1__ctl0_cpdminutes").disabled = true;
    }
}
function Grid1AfterSelectChange_appAuditSelect(gridName, rowId) {
    //get cell value;
    var row = igtbl_getRowById(rowId);
    var val = row.getCell(0).getValue();
    var val2 = row.getCell(1).getValue();
    document.getElementById("ctl00_ContentPlaceHolder1_hiddenAuditId").value = val;
    document.getElementById("ctl00_ContentPlaceHolder1_hiddenCourseId").value = val2;
}
function openAudit(action) {
    if (action == "detail") {
        if (document.getElementById("ctl00_ContentPlaceHolder1_hiddenAuditId").value != "" && document.getElementById("ctl00_ContentPlaceHolder1_hiddenCourseId").value != "") {
            win = null;
            var url = "WebAppCoursesAuditDetail.aspx?auditid=" + document.getElementById("ctl00_ContentPlaceHolder1_hiddenAuditId").value + "&courseid=" + document.getElementById("ctl00_ContentPlaceHolder1_hiddenCourseId").value;
            var win = window.open('', '', 'left=' + windowWidth() / 3 + 'px, top=50px, width=800px,height=800px, scrollbars=yes, status =no, resizable=yes');
            win.location.href = url;
            //win = null;
            return false;
        }
    }
    else if (action == "print") {
        if (document.getElementById("ctl00_ContentPlaceHolder1_hiddenAuditId").value != "" && document.getElementById("ctl00_ContentPlaceHolder1_hiddenCourseId").value != "") {
            var url = "WebAppCoursesAuditPrint.aspx?auditid=" + document.getElementById("ctl00_ContentPlaceHolder1_hiddenAuditId").value + "&courseid=" + document.getElementById("ctl00_ContentPlaceHolder1_hiddenCourseId").value;
            var win = window.open('', '', 'left=' + windowWidth() / 3 + 'px, top=50px, width=800px,height=800px, scrollbars=yes, status =no, resizable=yes');
            win.location.href = url;
            win = null;
            return false;
        }
    }
}


