var gE = function (id) {
    return document.getElementById(id);
}
function fnValidateMandatoryFieldsOnSaveButtonClick() {
    return true;
}
function fnAllowNumericOnly(event) {
    return (fnNumeric(event));
}
function fnConfirmTabIndexChange() {
    var ConfirmTabChange = confirm(MessageVars.CWB_00054);
    if (ConfirmTabChange == true) {
        return true;
    }
    else {
        return false;
    }
}
$(document).ready(function () {
    var modal = document.getElementById("ctl00_CP_MsgModal");
    var msg = document.getElementById("ctl00_CP_MsgLabel").innerHTML;
    if (msg != "")
        modal.style.display = "block";
    else
        modal.style.display = "None";
});


function GetDashlet() {
    $.ajax({

        type: "POST",
        url: "/Pages/BaseFramework/MyDashBoard.aspx/GetDashlet",
        data: '{}',
        contentType: "application/json;charset=utf-8",
        dataType: "json",
        success: function (data) {
            $('#ctl00_CP_DashletGridView').html('');
            $('#ctl00_CP_DashletGridView').append("<tr><th>RoleDashletId </th><th>DashletName</th></tr>");
            var datas = $.parseJSON(data.d);

            $.each(datas, function (dt, idx) {
                $('#ctl00_CP_DashletGridView').append("<tr><td>" + idx.RoleDashletId + "</td><td>" + idx.DashletName + "</td><tr>")
            });
        }
    });
}


function DashletBind() {
    //  $('[id$=MainUpdateProgress]').show();
    $("#loading").show();
    $.ajax({
        type: "POST",
        url: "/Pages/BaseFramework/MyDashBoard.aspx/DashletBind",
        data: '{}',
        contentType: "application/json;charset=utf-8",
        dataType: "json",
        success: function (data) {

            var datas = $.parseJSON(data.d);
            if (datas.CiscularHeader != '') {
                $('#CircularHeader').html('');
                $('#CircularList').html('');
                $('#CircularHeader').html(datas.CiscularHeader);
                $('#CircularList').html(datas.CircularGrid);
                $('#Circular').show();
            }
            else {
                $('#CircularHeader').html("<tr><td>No Records found !</td></tr>");
                $('#CircularList').html("");
                $('#Circular').hide();
            }
            if (datas.CourierRecieveHeader != '') {

                $('#tblList').html('');
                $('#trHeader').html('');
                $('#trHeader').html(datas.CourierRecieveHeader);
                $('#tblList').html(datas.CourierRecieveGrid);
                $('#CourierReceiveDiv').show();

            }
            else {
                $('#trHeader').html("<tr><td>No Records found !</td></tr>");
                $('#tblList').html("");
                $('#CourierReceiveDiv').hide();
            }
            if (datas.CourierdispatchHeader != '') {
                $('#CourierdispatchHeader').html('');
                $('#CourierdispatchGrid').html('');
                $('#CourierdispatchHeader').html(datas.CourierdispatchHeader);
                $('#CourierdispatchGrid').html(datas.CourierDispatchGrid);
                $('#CourierDispatchDiv').show();
            }
            else {
                $('#CourierdispatchHeader').html("");
                $('#CourierdispatchGrid').html("");
                $('#CourierDispatchDiv').hide();
            }
            if (datas.NewsHeader != '') {
                $('#NewsList').html('');
                $('#NewsGrid').html('');
                $('#NewsList').html(datas.NewsHeader);
                $('#NewsGrid').html(datas.NewsGrid);
                $('#NewsDiv').show();
            }
            else {
                $('#NewsList').html("");
                $('#NewsGrid').html("");
                $('#NewsDiv').hide();
            }
            if (datas.EventHeader != '') {

                $('#EventList').html('');
                $('#EventGrid').html('');
                $('#EventList').html(datas.EventHeader);
                $('#EventGrid').html(datas.EventGrid);
                $('#Eventdiv').show();
            }
            else {
                $('#EventList').html("");
                $('#EventGrid').html("");
                $('#Eventdiv').hide();

            }
            if (datas.TaskAssignHeader != '') {

                $('#TaskAssignHeader').html('');
                $('#TaskAssignList').html('');
                $('#TaskAssignHeader').html(datas.TaskAssignHeader);
                $('#TaskAssignList').html(datas.TaskAssignGrid);
                $('#TaskAssignToMe').show();
            }
            else {
                $('#TaskAssignHeader').html("");
                $('#TaskAssignList').html("");
                $('#TaskAssignToMe').hide();

            }
            if (datas.TaskAssignByHeader != '') {

                $('#TaskAssignByHeader').html('');
                $('#TaskAssignByList').html('');
                $('#TaskAssignByHeader').html(datas.TaskAssignByHeader);
                $('#TaskAssignByList').html(datas.TaskAssignByGrid);
                $('#TaskAssignByMe').show();
            }
            else {
                $('#TaskAssignByHeader').html("");
                $('#TaskAssignByList').html("");
                $('#TaskAssignByMe').hide();

            }
            if (datas.BirthdayHeader != '') {

                $('#BirthdayHeader').html('');
                $('#BirthdayList').html('');
                $('#BirthdayHeader').html(datas.BirthdayHeader);
                $('#BirthdayList').html(datas.BirthdayGrid);
                $('#staffbdaydiv').show();
            }
            else {
                $('#BirthdayHeader').html("");
                $('#BirthdayList').html("");
                $('#staffbdaydiv').hide();

            }
            if (datas.StudentBirthdayHeader != '') {

                $('#StudentBirthdayHeader').html('');
                $('#StudentBirthdayList').html('');
                $('#StudentBirthdayHeader').html(datas.StudentBirthdayHeader);
                $('#StudentBirthdayList').html(datas.StudentBirthdayGrid);
                $('#studentbdaydiv').show();
            }
            else {
                $('#StudentBirthdayHeader').html("");
                $('#StudentBirthdayList').html("");
                $('#studentbdaydiv').hide();

            }
            if (datas.AbsentHeader != '') {

                $('#AbsentHeader').html('');
                $('#AbsentList').html('');
                $('#AbsentHeader').html(datas.AbsentHeader);
                $('#AbsentList').html(datas.Absentgrid);
                $('#AbsentStudentdiv').show();
            }
            else {
                $('#AbsentHeader').html("");
                $('#AbsentList').html("");
                $('#AbsentStudentdiv').hide();

            }
            if (datas.EmployeeAbsentHeader != '') {

                $('#AbsentEmployeeHeader').html('');
                $('#AbsentEmployeeList').html('');
                $('#AbsentEmployeeHeader').html(datas.EmployeeAbsentHeader);
                $('#AbsentEmployeeList').html(datas.EmployeeAbsentgrid);
                $('#AbsentEmployeediv').show();
            }
            else {
                $('#AbsentEmployeeHeader').html("");
                $('#AbsentEmployeeList').html("");
                $('#AbsentEmployeediv').hide();

            }
            if (datas.StudentLeaveHeader != '') {

                $('#StudentLeaveHeader').html('');
                $('#StudentLeaveList').html('');
                $('#StudentLeaveHeader').html(datas.StudentLeaveHeader);
                $('#StudentLeaveList').html(datas.StudentLeavegrid);
                $('#LeaveStudentdiv').show();
            }
            else {
                $('#StudentLeaveHeader').html("");
                $('#StudentLeaveList').html("");
                $('#LeaveStudentdiv').hide();

            }
            if (datas.LeaveHeader != '') {

                $('#LeaveHeader').html('');
                $('#LeaveList').html('');
                $('#LeaveHeader').html(datas.LeaveHeader);
                $('#LeaveList').html(datas.Leavegrid);
                $('#LeaveEmployeediv').show();
            }
            else {
                $('#LeaveHeader').html("");
                $('#LeaveList').html("");
                $('#LeaveEmployeediv').hide();

            }
            if (datas.PollHeader != '') {

                $('#PollHeader').html('');
                $('#PollList').html('');
                $('#PollHeader').html(datas.PollHeader);
                $('#PollList').html(datas.Pollgrid);
                $('#Polldiv').show();
            }
            else {
                $('#PollHeader').html("");
                $('#PollList').html("");
                $('#Polldiv').hide();

            }
            if (datas.BookHeader != '') {

                $('#BookHeader').html('');
                $('#BookList').html('');
                $('#BookHeader').html(datas.BookHeader);
                $('#BookList').html(datas.Bookgrid);
                $('#Bookreturndiv').show();
            }
            else {
                $('#BookHeader').html("");
                $('#BookList').html("");
                $('#Bookreturndiv').hide();

            }
            if (datas.FeeCollectionHeader != '') {

                $('#FeecollectionHeader').html('');
                $('#FeecollectionList').html('');
                $('#FeecollectionHeader').html(datas.FeeCollectionHeader);
                $('#FeecollectionList').html(datas.FeeCollectiongrid);
                $('#Feecollectiondiv').show();
            }
            else {
                $('#FeecollectionHeader').html("");
                $('#FeecollectionList').html("");
                $('#Feecollectiondiv').hide();

            }
            if (datas.FeeAlertHeader != '') {

                $('#FeeAlertHeader').html('');
                $('#FeeAlertList').html('');
                $('#FeeAlertHeader').html(datas.FeeAlertHeader);
                $('#FeeAlertList').html(datas.FeeAlertgrid);
                $('#FeeAlertdiv').show();
            }
            else {
                $('#FeeAlertHeader').html("");
                $('#FeeAlertList').html("");
                $('#FeeAlertdiv').hide();

            }
            if (datas.BlogHeader != '') {

                $('#BlogHeader').html('');
                $('#BlogList').html('');
                $('#BlogHeader').html(datas.BlogHeader);
                $('#BlogList').html(datas.Bloggrid);
                $('#Blogdiv').show();
            }
            else {
                $('#BlogHeader').html("");
                $('#BlogList').html("");
                $('#Blogdiv').hide();

            }
            if (datas.ExamName != '' && datas.ExamName != null) {

                $('#ctl00_CP_ExamNameLabel').text('');
                $('#ctl00_CP_ExamNameLabel').text(datas.ExamName);
                $('#ctl00_CP_TotalObtainLabel').text('');
                $('#ctl00_CP_TotalObtainLabel').text(datas.TotalObtain);
                $('#ctl00_CP_TotalMarksLabel').text('');
                $('#ctl00_CP_TotalMarksLabel').text(datas.TotalMarks);
                $('#ctl00_CP_ResultStatusLabel').text('');
                $('#ctl00_CP_ResultStatusLabel').text(datas.ResultStatus);
                $('#ctl00_CP_ResultGradeLabel').text('');
                $('#ctl00_CP_ResultGradeLabel').text(datas.ResultGrade);
                $('#ctl00_CP_PercentageLabel').text('');
                $('#ctl00_CP_PercentageLabel').text(datas.Percentage);
                $('#ctl00_CP_PercentileLabel').text('');
                $('#ctl00_CP_PercentileLabel').text(datas.Percentile);
                $('#studentresultdiv').show();
                window.setTimeout(function () { $('[id$=MainUpdateProgress]').hide(); }, 300);
            }
            else {
                $('#ctl00_CP_ExamNameLabel').text('');
                $('#ctl00_CP_TotalObtainLabel').text('');
                $('#ctl00_CP_TotalMarksLabel').text('');
                $('#ctl00_CP_ResultStatusLabel').text('');
                $('#ctl00_CP_ResultGradeLabel').text('');
                $('#ctl00_CP_PercentageLabel').text('');
                $('#ctl00_CP_PercentileLabel').text('');
                $('#studentresultdiv').hide();

            }

            if (datas.HomeworkHeader != '') {

                $('#HomeWorkHeader').html('');
                $('#HomeWorkList').html('');
                $('#HomeWorkHeader').html(datas.HomeworkHeader);
                $('#HomeWorkList').html(datas.Homeworkgrid);
                $('#Homeworkdiv').show();
            }
            else {
                $('#HomeWorkHeader').html("");
                $('#HomeWorkList').html("");
                $('#Homeworkdiv').hide();

            }
            if (datas.DailyStatusHeader != '') {

                $('#DailyStatusHeader').html('');
                $('#DailyStatusList').html('');
                $('#DailyStatusHeader').html(datas.DailyStatusHeader);
                $('#DailyStatusList').html(datas.DailyStatusrid);
                $('#DailyStatusDiv').show();
            }
            else {
                $('#DailyStatusHeader').html("");
                $('#DailyStatusList').html("");
                $('#DailyStatusDiv').hide();

            }
            if (datas.VisitorLogHeader != '') {

                $('#VisitorLogHeader').html('');
                $('#VisitorLogList').html('');
                $('#VisitorLogHeader').html(datas.VisitorLogHeader);
                $('#VisitorLogList').html(datas.VisitorLoggrid);
                $('#VisitorLogDiv').show();
            }
            else {
                $('#VisitorLogHeader').html("");
                $('#VisitorLogList').html("");
                $('#VisitorLogDiv').hide();

            }
            if (datas.ProxyHeader != '') {
                $('#ProxylList').html('');
                $('#ProxyHeader').html('');
                $('#ProxyHeader').html(datas.ProxyHeader);
                $('#ProxylList').html(datas.Proxygrid);
                $('#ProxyDiv').show();
            }
            else {
                $('#ProxyHeader').html("");
                $('#ProxylList').html("");
                $('#ProxyDiv').hide();
            }
            if (datas.AttedancestudentHeader != '') {
                $('#studenattHeader').html('');
                $('#studenattList').html('');
                $('#studenattHeader').html(datas.AttedancestudentHeader);
                $('#studenattList').html(datas.Attedancestudentgrid);
                $('#StudentAttendanceDiv').show();
            }
            else {
                $('#studenattHeader').html("<tr><td>No Records found !</td></tr>");
                $('#studenattList').html("");
                $('#StudentAttendanceDiv').hide();
            }

            if (datas.FavScreenHeader != '') {

                $('#UserFavouriteList').html('');
                $('#UserFavouriteHeader').html('');
                $('#UserFavouriteHeader').html(datas.FavScreenHeader);
                $('#UserFavouriteList').html(datas.FavScreengrid);
                $('#favouriteDiv').show();
            }
            else {
                $('#UserFavouriteHeader').html("");
                $('#UserFavouriteList').html("");
                $('#favouriteDiv').hide();
            }
            //asset check
            if (datas.AssetCheckHeader != '') {
                $('#AssetCheckHeader').html('');
                $('#AssetCheckList').html('');
                $('#AssetCheckHeader').html(datas.AssetCheckHeader);
                $('#AssetCheckList').html(datas.AssetCheckgrid);
                $('#AssetCheckDiv').show();
            }
            else {

                $('#AssetCheckHeader').html("<tr><td>No Records found !</td></tr>");
                $('#AssetCheckList').html("");
                $('#AssetCheckDiv').hide();
            }
            //asset maintenance
            if (datas.AssetMaintenanceHeader != '') {

                $('#AssetMaintenanceHeader').html('');
                $('#AssetMaintenanceList').html('');
                $('#AssetMaintenanceHeader').html(datas.AssetMaintenanceHeader);
                $('#AssetMaintenanceList').html(datas.AssetMaintenancegrid);
                $('#AssetMaintenanceDiv').show();
            }
            else {

                $('#AssetMaintenanceHeader').html("<tr><td>No Records found !</td></tr>");
                $('#AssetMaintenanceList').html("");
                $('#AssetMaintenanceDiv').hide();
            }

            //asset renew
            if (datas.AssetRenewHeader != '') {

                $('#AssetRenewHeader').html('');
                $('#AssetRenewList').html('');
                $('#AssetRenewHeader').html(datas.AssetRenewHeader);
                $('#AssetRenewList').html(datas.AssetRenewgrid);
                $('#AssetRenewDiv').show();
            }
            else {

                $('#AssetRenewHeader').html("<tr><td>No Records found !</td></tr>");
                $('#AssetRenewList').html("");
                $('#AssetRenewDiv').hide();
            }
            if (datas.InwardRegisterHeader == '') {
                $('#InwardGridDiv').html('');
                $('#InwardRegisterDiv').hide();

            }
            else {
                if (datas.InwardRegisterGrid == '') {
                    $('#InwardHeader').html(datas.InwardRegisterHeader);
                    $('#InwardGridDiv').html('<tr><td colspan="9">No Record found !</td><tr>');
                    $('#InwardRegisterDiv').show();

                }
                else {
                    $('#InwardHeader').html(datas.InwardRegisterHeader);
                    $('#InwardGridDiv').html(datas.InwardRegisterGrid);
                    $('#InwardRegisterDiv').show();
                }
            }
            if (datas.OutwardRegisterHeader == '') {
                $('#OutwardGridDiv').html('');
                $('#OutwardRegisterDiv').hide();

            }
            else {
                if (datas.outwardRegisterGrid == '') {
                    $('#OutwardHeader').html(datas.OutwardRegisterHeader);
                    $('#OutwardGridDiv').html('<tr><td colspan="9">No Record found !</td><tr>');
                    $('#OutwardRegisterDiv').show();

                }
                else {
                    $('#OutwardHeader').html(datas.OutwardRegisterHeader);
                    $('#OutwardGridDiv').html(datas.outwardRegisterGrid);
                    $('#OutwardRegisterDiv').show();
                }
            }
            if (datas.ReorderStockHeader == '') {
                $('#ReorderStockGridDiv').html('');
                $('#ReorderStockDiv').hide();

            }
            else {
                if (datas.ReorderStock == '') {
                    $('#ReorderStockHeader').html(datas.ReorderStockHeader);
                    $('#ReorderStockGridDiv').html('<tr><td colspan="9">No Record found !</td><tr>');
                    $('#ReorderStockDiv').show();

                }
                else {
                    $('#ReorderStockHeader').html(datas.ReorderStockHeader);
                    $('#ReorderStockGridDiv').html(datas.ReorderStock);
                    $('#ReorderStockDiv').show();
                }
            }
            if (datas.SafetyStockHeader == '') {
                $('#SafetyStockGridDiv').html('');
                $('#SafetyStockDiv').hide();

            }
            else {
                if (datas.SafetyStock == '') {
                    $('#SafetyStockHeader').html(datas.SafetyStockHeader);
                    $('#SafetyStockGridDiv').html('<tr><td colspan="9">No Record found !</td><tr>');
                    $('#SafetyStockDiv').show();

                }
                else {
                    $('#SafetyStockHeader').html(datas.SafetyStockHeader);
                    $('#SafetyStockGridDiv').html(datas.SafetyStock);
                    $('#SafetyStockDiv').show();
                }
            }
            if (datas.IncrementHeader != '') {
                $('#IncrementHeader').html('');
                $('#IncrementList').html('');
                $('#IncrementHeader').html(datas.IncrementHeader);
                $('#IncrementList').html(datas.IncrementGrid);
                $('#IncrementDiv').show();
            }
            else {
                $('#IncrementHeader').html("<tr><td>no records found !</td></tr>");
                $('#IncrementList').html("");
                $('#IncrementDiv').hide();
            }
            if (datas.RetirementHeader != '') {

                $('#RetirementHeader').html('');
                $('#RetirementList').html('');
                $('#RetirementHeader').html(datas.RetirementHeader);
                $('#RetirementList').html(datas.RetirementGrid);
                $('#RetirementDiv').show();
            }
            else {
                $('#RetirementHeader').html("<tr><td>no records found !</td></tr>");
                $('#RetirementList').html("");
                $('#RetirementDiv').hide();
            }

            if (datas.MyeExamHeader != '') {

                $('#MyeExamHeader').html('');
                $('#MyeExamList').html('');
                $('#MyeExamHeader').html(datas.MyeExamHeader);
                $('#MyeExamList').html(datas.MyeExamGrid);
                $('#MyeExamDiv').show();
            }
            else {
                $('#MyeExamHeader').html("<tr><td>no records found !</td></tr>");
                $('#MyeExamList').html("");
                $('#MyeExamDiv').hide();
            }
            //changes for Mantis Id :0035512 By Hemali
            if (datas.AllFollowupHeader != '') {
                $('#AllFollowupHeader').html('');
                $('#AllFollowupList').html('');
                $('#AllFollowupHeader').html(datas.AllFollowupHeader);
                $('#AllFollowupList').html(datas.AllFollowupResult);
                $('#AllAdmissionFollowup').show();
            }
            else {
                $('#AllFollowupHeader').html("<tr><td>No Records found !</td></tr>");
                $('#AllFollowupList').html("");
                $('#AllAdmissionFollowup').hide();
            }

            if (datas.TodaysFollowupHeader != '') {
                $('#TodaysFollowupHeader').html('');
                $('#TodaysFollowupList').html('');
                $('#TodaysFollowupHeader').html(datas.TodaysFollowupHeader);
                $('#TodaysFollowupList').html(datas.TodaysFollowupResult);
                $('#TodaysAdmissionFollowup').show();
            }
            else {
                $('#TodaysFollowupHeader').html("<tr><td>No Records found !</td></tr>");
                $('#TodaysFollowupList').html("");
                $('#TodaysAdmissionFollowup').hide();
            }
            //Changes for Mantis Id: 0036743
            if (datas.PostDatedPaymentHeader != '') {
                $('#PostDatedPaymentHeader').html('');
                $('#PostDatedPaymentList').html('');
                $('#PostDatedPaymentHeader').html(datas.PostDatedPaymentHeader);
                $('#PostDatedPaymentList').html(datas.PostDatedPaymentResult);
                $('#PostDatedPaymentDiv').show();
            }
            else {
                $('#PostDatedPaymentHeader').html("<tr><td>No Records found !</td></tr>");
                $('#PostDatedPaymentList').html("");
                $('#PostDatedPaymentDiv').hide();
            }

            $("#loading").hide();
        },
        error: function (xhr, status, error) {
            $('[id$=MainUpdateProgress]').hide();
            var err = eval("(" + xhr.responseText + ")");
            console.log(err.Message);
            $("#loading").hide();
        }
    });
}
function GetDatas(obj) {
    var id = $(obj).parent().parent().attr("attrid");
    var typ = $(obj).parent().parent().attr("attrtyp");
    var EventSchedulid;
    var status;

    if ($(obj).parent().parent().attr("attrtEventSchedule") == undefined) {
        EventSchedulid = 0;
    }
    else {
        EventSchedulid = $(obj).parent().parent().attr("attrtEventSchedule");
    }
    if ($(obj).parent().parent().attr("attrtStatus") == undefined) {
        status = 0;
    }
    else {
        status = $(obj).parent().parent().attr("attrtStatus");
        if (status == "False") {
            status = 0;
        }
        else if (status == "TRUE") {
            status = 1;
        }
        else {
            status = 2;
        }
    }

    $.ajax({
        type: "POST",
        url: "/Pages/BaseFramework/MyDashBoard.aspx/SetSession",
        data: '{"Id":"' + id + '","Typ":"' + typ + '","EventSchedulId":"' + EventSchedulid + '","Status":"' + status + '"}',
        contentType: "application/json;charset=utf-8",
        dataType: "json",
        success: function (data) {
            if ($(obj).parent().parent().attr("attrtyp") == 1)
                window.location = '/Pages/Communication/CircularView.aspx';
            else if (typ == 2) {
                window.location = '/Pages/Communication/NewsView.aspx';
            }
            else if (typ == 3) {

                window.location = '/Pages/Activity/ViewEvent.aspx';
            }
            else if (typ == 5) {
                window.location = '/Pages/Communication/AssignTask.aspx';
            }
            else if (typ == 18) {
                window.location = '/Pages/Communication/BlogView.aspx';
            }
        },
        error: function (xhr, status, error) {
            $('[id$=MainUpdateProgress]').hide();
            var err = eval("(" + xhr.responseText + ")");
            console.log(err.Message);
        }
    });

}
$("#LinkButtonVisitorlog").click(function (event) {
    window.location = '/Pages/FrontOffice/VisitorLog.aspx';
});
$("#LinkButtondailyStatus").click(function (event) {
    window.location = '/Pages/Academic/DailyStatus.aspx';
});
$("#LinkButtonStudentABsent").click(function (event) {
    window.location = '/Pages/Attendance/AttendanceList.aspx';
});
$("#LinkButtonEmpAbsent").click(function (event) {
    window.location = '/Pages/Hrm/Employee/EmployeeRegister.aspx';
});
$("#LinkButtonFeecollection").click(function (event) {
    window.location = '/Pages/FeeManagement/FeeReceiptSearch.aspx';
});
$("#LinkButtonHomework").click(function (event) {
    window.location = '/Pages/Academic/MyClasswork.aspx';
});
$("#LinkButtonPoll").click(function (event) {
    window.location = '/Pages/Communication/MyPoll.aspx';
});
$("#LinkButtonAssignMe").click(function (event) {
    window.location = '/Pages/Communication/ViewTask.aspx';
});
$("#LinkButtonLinkButtonFeeAlert").click(function (event) {
    window.location = '/Pages/FeeManagement/MyFee.aspx';
});
$("#LinkButtonResult").click(function (event) {
    window.location = '/Pages/Assessment/General/MyResult.aspx';
});
$("#LinkButtonInwardRegister").click(function (event) {
    window.location = '/Pages/FrontOffice/InwardRegister.aspx';
});
$("#LinkButtonOutwardRegister").click(function (event) {
    window.location = '/Pages/FrontOffice/OutwardRegister.aspx';
});
$("#LinkButtonCircular").click(function (event) {
    window.location = '/Pages/Communication/CircularList.aspx';
});

//changes for Mantis Id :0035512 By Hemali
$("#LinkButtonAllFollowup").click(function (event) {
    window.location = '/Pages/Admission/AdmissionInquiryFollowup.aspx';
});

$("#LinkButtonTodaysFollowup").click(function (event) {
    window.location = '/Pages/Admission/AdmissionInquiryFollowup.aspx';
});


$("#LinkButtonPostDatedPayment").click(function (event) {
    window.location = '/Pages/FeeManagement/PostDatedPayment.aspx';
});

function DashletDelete(dashletId) {

    $.ajax({
        type: "POST",
        url: "/Pages/BaseFramework/MyDashBoard.aspx/DeleteDashlet",
        data: '{"DashletId":"' + dashletId + '"}',
        contentType: "application/json;charset=utf-8",
        dataType: "json",
        success: function (data) {
            DashletBind();
        }
    });
}

$(document).ready(function () {
    DashletBind();
});
function getFavPath(obj) {
    var pagepath = $(obj).parent().parent().attr("attrpath");
    pagepath = pagepath.substring(1);
    window.location = pagepath;
}

function GetExamDetail(rowindex) {
    $.ajax({
        type: "POST",
        url: "/Pages/BaseFramework/MyDashBoard.aspx/SetExamSession",
        data: '{"RowIndex":"' + rowindex + '"}',
        contentType: "application/json;charset=utf-8",
        dataType: "json",
        success: function (data) {
            window.location = '/Pages/EExam/TestStartupRemark.aspx?RowIndex=' + rowindex;
        },
        error: function (xhr, status, error) {
            var err = eval("(" + xhr.responseText + ")");
            console.log(err.Message);
        }
    });
}