//window.onload = function() {
//    alert('in');
//    _aspxAttachEventToDocument("mousemove", OnMouseMove);
//}
//function CalculateRelativeX(x, clickedElement) {
//    var left = _aspxGetAbsoluteX(clickedElement);
//    return Math.abs(x - left);
//}
//function CalculateRelativeY(y, clickedElement) {
//    var top = _aspxGetAbsoluteY(clickedElement);
//    return Math.abs(y - top);
//}
//function OnMouseMove(evt) {

//    var srcElement = _aspxGetEventSource(evt);
//    if (citicalAlertchart.GetMainDOMElement() != srcElement)
//        return;
//    var x = CalculateRelativeX(_aspxGetEventX(evt), srcElement);
//    var y = CalculateRelativeY(_aspxGetEventY(evt), srcElement);
//    var hitInfo = citicalAlertchart.HitTest(x, y);
//    for (var i = 0; i < hitInfo.length; i++)
//        if (hitInfo[i].object instanceof ASPxClientSeries) {
//        ToolTip.ShowAtPos(_aspxGetEventX(evt) + 5, _aspxGetEventY(evt) + 10);
//        ToolTip.SetContentHTML("</span>" + hitInfo[i].object.name + "</span>");
//        return;
//    }
//    ToolTip.Hide(); 
//}



function AllChart() {
    var chartAll = document.getElementById('chkChangeAllView');
    var checkCriticalChart = document.getElementById('chkChangeViewCriticalAlert');    
    var chartIdlingReport = document.getElementById('chkSwitchIdlingCharts');
    var chartIdlingAdvReport = document.getElementById('chkSwitchIdlingAdvCharts'); 
    var chartWarrantyIncomReport = document.getElementById('chkSwitchWarrantyIncomCharts');
    var chartHVRWarrantyIncomReport = document.getElementById('chkSwitchHVRWarrantyIncomCharts');
    var chartHVRWarrantyInstalledReport = document.getElementById('chkSwitchHVRWarrantyInstalledCharts');
    var chartPortalUsageReport = document.getElementById('chkSwitchPortalUsageCharts');
    var chartHVRCommStatusReport = document.getElementById('chkSwitchHVRCommStatusCharts');
    var chartHVRAlarmStatusReport = document.getElementById('chkSwitchHVRAlarmStatusCharts');
    var chartHVRWarrantyAlarmStatusReport = document.getElementById('chkSwitchHVRWarrantyAlarmStatusCharts');
    var chartHVRnonWarrantyAlarmStatusReport = document.getElementById('chkSwitchHVRnonWarrantyAlarmStatusCharts');
    var chartNearingMaintenanceReport = document.getElementById('chkSwitchNearingMaintenanceCharts');
    
    var toggle = document.getElementById('<%= ToggleButtonExtender2.ClientID%>');
    if (chartAll.checked) {
        if (checkCriticalChart != null) {
            document.getElementById('wcCriticalAlertReport').style.display = 'none';
            document.getElementById('pnlCriticalReport').style.display = "block";
            checkCriticalChart.checked = false;
            checkCriticalChart.click();
        }       
        if (chartIdlingReport != null) {
            document.getElementById('wcIdlingReport').style.display = 'none';
            document.getElementById('pnlIdlingInfo').style.display = "block";
            chartIdlingReport.checked = false;
            chartIdlingReport.click();
        }
        if (chartIdlingAdvReport != null) {
            document.getElementById('wcIdlingAdvReport').style.display = 'none';
            document.getElementById('pnlIdlingAdvInfo').style.display = "block";
            chartIdlingAdvReport.checked = false;
            chartIdlingAdvReport.click();
        } 
        if (chartWarrantyIncomReport != null) {
            document.getElementById('wcWarrantyIncomReport').style.display = 'none';
            document.getElementById('pnlWarrantyIncomInfo').style.display = "block";
            chartWarrantyIncomReport.checked = false;
            chartWarrantyIncomReport.click();
        }
        if (chartPortalUsageReport != null) {
            document.getElementById('wcPortalUsageReport').style.display = 'none';
            document.getElementById('pnlPortalUsageInfo').style.display = "block";
            chartPortalUsageReport.checked = false;
            chartPortalUsageReport.click();
        }
        if (chartHVRCommStatusReport != null) {
            document.getElementById('wcHVRCommStatusReport').style.display = 'none';
            document.getElementById('pnlHVRCommStatusInfo').style.display = "block";
            chartHVRCommStatusReport.checked = false;
            chartHVRCommStatusReport.click();
        }
        if (chartHVRAlarmStatusReport != null) {
            document.getElementById('wcHVRAlarmStatusReport').style.display = 'none';
            document.getElementById('pnlHVRAlarmStatusInfo').style.display = "block";
            chartHVRAlarmStatusReport.checked = false;
            chartHVRAlarmStatusReport.click();
        }
        if (chartHVRWarrantyAlarmStatusReport != null) {
            document.getElementById('wcHVRWarrantyAlarmStatusReport').style.display = 'none';
            document.getElementById('pnlHVRWarrantyAlarmStatusInfo').style.display = "block";
            chartHVRWarrantyAlarmStatusReport.checked = false;
            chartHVRWarrantyAlarmStatusReport.click();
        }
        if (chartHVRnonWarrantyAlarmStatusReport != null) {
            document.getElementById('wcHVRnonWarrantyAlarmStatusReport').style.display = 'none';
            document.getElementById('pnlHVRnonWarrantyAlarmStatusInfo').style.display = "block";
            chartHVRnonWarrantyAlarmStatusReport.checked = false;
            chartHVRnonWarrantyAlarmStatusReport.click();
        }
        if (chartHVRWarrantyIncomReport != null) {
            document.getElementById('wcHVRWarrantyIncomReport').style.display = 'none';
            document.getElementById('pnlHVRWarrantyIncomInfo').style.display = "block";
            chartHVRWarrantyIncomReport.checked = false;
            chartHVRWarrantyIncomReport.click();
        }
        if (chartHVRWarrantyInstalledReport != null) {
            document.getElementById('wcHVRWarrantyInstalledReport').style.display = 'none';
            document.getElementById('pnlHVRWarrantyInstalledInfo').style.display = "block";
            chartHVRWarrantyInstalledReport.checked = false;
            chartHVRWarrantyInstalledReport.click();
        }
        if (chartNearingMaintenanceReport != null) {
            document.getElementById('wcNearingMaintenanceReport').style.display = 'none';
            document.getElementById('pnlNearingMaintenanceInfo').style.display = "block";
            chartNearingMaintenanceReport.checked = false;
            chartNearingMaintenanceReport.click();
        }
        //checkCriticalChart.onmouseover=true ;    
    }
    else {

        if (checkCriticalChart != null) {
            document.getElementById('wcCriticalAlertReport').style.display = 'inline';
            document.getElementById('pnlCriticalReport').style.display = "none";
            checkCriticalChart.checked = true;
            checkCriticalChart.click();
        }       
        if (chartIdlingReport != null) {
            document.getElementById('wcIdlingReport').style.display = 'inline';
            document.getElementById('pnlIdlingInfo').style.display = "none";
            chartIdlingReport.checked = true;
            chartIdlingReport.click();
        }
        if (chartIdlingAdvReport != null) {
            document.getElementById('wcIdlingAdvReport').style.display = 'inline';
            document.getElementById('pnlIdlingAdvInfo').style.display = "none";
            chartIdlingAdvReport.checked = true;
            chartIdlingAdvReport.click();
        } 
        if (chartWarrantyIncomReport != null) {
            document.getElementById('wcWarrantyIncomReport').style.display = 'inline';
            document.getElementById('pnlWarrantyIncomInfo').style.display = "none";
            chartWarrantyIncomReport.checked = true;
            chartWarrantyIncomReport.click();
        }
        if (chartHVRWarrantyIncomReport != null) {
            document.getElementById('wcHVRWarrantyIncomReport').style.display = 'inline';
            document.getElementById('pnlHVRWarrantyIncomInfo').style.display = "none";
            chartHVRWarrantyIncomReport.checked = false;
            chartHVRWarrantyIncomReport.click();
        }
        if (chartHVRWarrantyInstalledReport != null) {
            document.getElementById('wcHVRWarrantyInstalledReport').style.display = 'inline';
            document.getElementById('pnlHVRWarrantyInstalledInfo').style.display = "none";
            chartHVRWarrantyInstalledReport.checked = false;
            chartHVRWarrantyInstalledReport.click();
        }
        if (chartPortalUsageReport != null) {
            document.getElementById('wcPortalUsageReport').style.display = 'inline';
            document.getElementById('pnlPortalUsageInfo').style.display = "none";
            chartPortalUsageReport.checked = true;
            chartPortalUsageReport.click();
        }
        if (chartHVRCommStatusReport != null) {
            document.getElementById('wcHVRCommStatusReport').style.display = 'inline';
            document.getElementById('pnlHVRCommStatusInfo').style.display = "none";
            chartHVRCommStatusReport.checked = true;
            chartHVRCommStatusReport.click();
        }
        if (chartHVRAlarmStatusReport != null) {
            document.getElementById('wcHVRAlarmStatusReport').style.display = 'inline';
            document.getElementById('pnlHVRAlarmStatusInfo').style.display = "none";
            chartHVRAlarmStatusReport.checked = true;
            chartHVRAlarmStatusReport.click();
        }
        if (chartHVRWarrantyAlarmStatusReport != null) {
            document.getElementById('wcHVRWarrantyAlarmStatusReport').style.display = 'inline';
            document.getElementById('pnlHVRWarrantyAlarmStatusInfo').style.display = "none";
            chartHVRWarrantyAlarmStatusReport.checked = true;
            chartHVRWarrantyAlarmStatusReport.click();
        }
        if (chartHVRnonWarrantyAlarmStatusReport != null) {
            document.getElementById('wcHVRnonWarrantyAlarmStatusReport').style.display = 'inline';
            document.getElementById('pnlHVRnonWarrantyAlarmStatusInfo').style.display = "none";
            chartHVRnonWarrantyAlarmStatusReport.checked = true;
            chartHVRnonWarrantyAlarmStatusReport.click();
        }
        if (chartNearingMaintenanceReport != null) {
            document.getElementById('wcNearingMaintenanceReport').style.display = 'inline';
            document.getElementById('pnlNearingMaintenanceInfo').style.display = "none";
            chartNearingMaintenanceReport.checked = true;
            chartNearingMaintenanceReport.click();
        }
    }    
}

function chart() {
    var check = document.getElementById('chkChangeViewCriticalAlert');
    var hdnValue = document.getElementById('hdnChartPerffered').value;    
    if (check.checked) {
        document.getElementById('wcCriticalAlertReport').style.display = 'none';
        document.getElementById('pnlCriticalReport').style.display = "block";
    }
    else {
        document.getElementById('wcCriticalAlertReport').style.display = 'inline';
        document.getElementById('pnlCriticalReport').style.display = "none";

    }   
}

function chartIdlingFunc() {

    var chartIdling = document.getElementById('chkSwitchIdlingCharts');
    var hdnValue = document.getElementById('hdnChartPerffered').value;    
    if (chartIdling.checked) {
        document.getElementById('wcIdlingReport').style.display = 'none';
        document.getElementById('pnlIdlingInfo').style.display = "block";
    }
    else {
        document.getElementById('wcIdlingReport').style.display = 'inline';
        document.getElementById('pnlIdlingInfo').style.display = "none";
    }  
}
function chartHVRCommStatusFunc() {

    var chartHVRCommStatus = document.getElementById('chkSwitchHVRCommStatusCharts');
    var hdnValue = document.getElementById('hdnChartPerffered').value;
    if (chartHVRCommStatus.checked) {
        document.getElementById('wcHVRCommStatusReport').style.display = 'none';
        document.getElementById('pnlHVRCommStatusInfo').style.display = "block";
    }
    else {
        document.getElementById('wcHVRCommStatusReport').style.display = 'inline';
        document.getElementById('pnlHVRCommStatusInfo').style.display = "none";
    }
}
function chartHVRAlarmStatusFunc() {

    var chartHVRAlarmStatus = document.getElementById('chkSwitchHVRAlarmStatusCharts');
    var hdnValue = document.getElementById('hdnChartPerffered').value;
    if (chartHVRAlarmStatus.checked) {
        document.getElementById('wcHVRAlarmStatusReport').style.display = 'none';
        document.getElementById('pnlHVRAlarmStatusInfo').style.display = "block";
    }
    else {
        document.getElementById('wcHVRAlarmStatusReport').style.display = 'inline';
        document.getElementById('pnlHVRAlarmStatusInfo').style.display = "none";
    }
}
function chartHVRWarrantyAlarmStatusFunc() {

    var chartHVRWarrantyAlarmStatus = document.getElementById('chkSwitchHVRWarrantyAlarmStatusCharts');
    var hdnValue = document.getElementById('hdnChartPerffered').value;
    if (chartHVRWarrantyAlarmStatus.checked) {
        document.getElementById('wcHVRWarrantyAlarmStatusReport').style.display = 'none';
        document.getElementById('pnlHVRWarrantyAlarmStatusInfo').style.display = "block";
    }
    else {
        document.getElementById('wcHVRWarrantyAlarmStatusReport').style.display = 'inline';
        document.getElementById('pnlHVRWarrantyAlarmStatusInfo').style.display = "none";
    }
}

function chartHVRnonWarrantyAlarmStatusFunc() {

    var chartHVRnonWarrantyAlarmStatus = document.getElementById('chkSwitchHVRnonWarrantyAlarmStatusCharts');
    var hdnValue = document.getElementById('hdnChartPerffered').value;
    if (chartHVRnonWarrantyAlarmStatus.checked) {
        document.getElementById('wcHVRnonWarrantyAlarmStatusReport').style.display = 'none';
        document.getElementById('pnlHVRnonWarrantyAlarmStatusInfo').style.display = "block";
    }
    else {
        document.getElementById('wcHVRnonWarrantyAlarmStatusReport').style.display = 'inline';
        document.getElementById('pnlHVRnonWarrantyAlarmStatusInfo').style.display = "none";
    }
}

function chartIdlingAdv() {

    var chartIdling = document.getElementById('chkSwitchIdlingAdvCharts');
    var hdnValue = document.getElementById('hdnChartPerffered').value;    
    if (chartIdling.checked) {
        document.getElementById('wcIdlingAdvReport').style.display = 'none';
        document.getElementById('pnlIdlingAdvInfo').style.display = "block";
    }
    else {
        document.getElementById('wcIdlingAdvReport').style.display = 'inline';
        document.getElementById('pnlIdlingAdvInfo').style.display = "none";
    }
}

function chartWarrantyIncomFun() {

    var chartIdling = document.getElementById('chkSwitchWarrantyIncomCharts');
    var hdnValue = document.getElementById('hdnChartPerffered').value;
    if (chartIdling.checked) {
        document.getElementById('wcWarrantyIncomReport').style.display = 'none';
        document.getElementById('pnlWarrantyIncomInfo').style.display = "block";
    }
    else {
        document.getElementById('wcWarrantyIncomReport').style.display = 'inline';
        document.getElementById('pnlWarrantyIncomInfo').style.display = "none";
    }
}
function chartHVRWarrantyIncomFun() {

    var chartIdling = document.getElementById('chkSwitchHVRWarrantyIncomCharts');
    var hdnValue = document.getElementById('hdnChartPerffered').value;
    if (chartIdling.checked) {
        document.getElementById('wcHVRWarrantyIncomReport').style.display = 'none';
        document.getElementById('pnlHVRWarrantyIncomInfo').style.display = "block";
    }
    else {
        document.getElementById('wcHVRWarrantyIncomReport').style.display = 'inline';
        document.getElementById('pnlHVRWarrantyIncomInfo').style.display = "none";
    }
}

function chartHVRWarrantyInstalledFun() {

    var chartIdling = document.getElementById('chkSwitchHVRWarrantyInstalledCharts');
    var hdnValue = document.getElementById('hdnChartPerffered').value;
    if (chartIdling.checked) {
        document.getElementById('wcHVRWarrantyInstalledReport').style.display = 'none';
        document.getElementById('pnlHVRWarrantyInstalledInfo').style.display = "block";
    }
    else {
        document.getElementById('wcHVRWarrantyInstalledReport').style.display = 'inline';
        document.getElementById('pnlHVRWarrantyInstalledInfo').style.display = "none";
    }
}

function chartPortalUsageClick() {

    var chartPortalUsage = document.getElementById('chkSwitchPortalUsageCharts');
    var hdnValue = document.getElementById('hdnChartPerffered').value;    
    if (chartPortalUsage.checked) {
        document.getElementById('wcPortalUsageReport').style.display = 'none';
        document.getElementById('pnlPortalUsageInfo').style.display = "block";
    }
    else {
        document.getElementById('wcPortalUsageReport').style.display = 'inline';
        document.getElementById('pnlPortalUsageInfo').style.display = "none";
    }   
} 
//NearingMaintenance
function chartNearingMaintenanceClick() {
    var chartNearingMaintenanceCharts = document.getElementById('chkSwitchNearingMaintenanceCharts');
    var hdnValue = document.getElementById('hdnChartPerffered').value;
    if (chartNearingMaintenanceCharts.checked) {
        document.getElementById('wcNearingMaintenanceReport').style.display = 'none';
        document.getElementById('pnlNearingMaintenanceInfo').style.display = "block";
    }
    else {
        document.getElementById('wcNearingMaintenanceReport').style.display = 'inline';
        document.getElementById('pnlNearingMaintenanceInfo').style.display = "none";
    }
}
function setChart() {
    document.getElementById('hdnIsGridView').value = "true";
}

function ChartPanelHide() {
    if (document.getElementById('ddlTop').value == '10') {
        var objMain = $('#main');
        objMain.removeClass('use-sidebar');
        Resized();
    }
}



// Code Included by Ranjith for chartwidth Resize
function Resized() {
    var callbackState = document.getElementById('callbackState').value;

}
//Nearing Maintenance
function DoCallbackNearingMaintenance() {

    var hdnValue = document.getElementById('hdnChartPerffered').value;
    var hdnArray = new Array();
    hdnArray = hdnValue;
    if (hdnArray.indexOf(373) != -1) {
        document.getElementById('chartNearingMaintenance').value = $('#pnlNearingMaintenance').width();
        if (document.getElementById('wcNearingMaintenanceReport') != undefined) {
            wcNearingMaintenanceReport.PerformCallback();
        }
    }
    else if (hdnValue == "") {
        document.getElementById('chartNearingMaintenance').value = $('#pnlNearingMaintenance').width();
        if (document.getElementById('wcNearingMaintenanceReport') != undefined) {
            wcNearingMaintenanceReport.PerformCallback();
        }
    }

}
function DoCallbackAlert() {
    var hdnValue = document.getElementById('hdnChartPerffered').value;
    var hdnArray = new Array();
    hdnArray = hdnValue;
    if (hdnArray.indexOf(1) != -1) {
        document.getElementById('chartCrtical').value = $('#pnlCritical').width();
        if (document.getElementById('wcCriticalAlertReport') != undefined) {
            citicalAlertchart.PerformCallback();
        }
    }
    else if (hdnValue == "") {
        document.getElementById('chartCrtical').value = $('#pnlCritical').width();
        if (document.getElementById('wcCriticalAlertReport') != undefined) {
            citicalAlertchart.PerformCallback();
        }
    }
}

function DoCallbackIdling() {

    var hdnValue = document.getElementById('hdnChartPerffered').value;
    var hdnArray = new Array();
    hdnArray = hdnValue;
    if (hdnArray.indexOf(3) != -1) {
        document.getElementById('chartIdlig').value = $('#pnlIdling').width();
        if (document.getElementById('wcIdlingReport') != undefined) {
            wcIdlingReport.PerformCallback();
        }
    }
    else if (hdnValue == "") {
        document.getElementById('chartIdlig').value = $('#pnlIdling').width();
        if (document.getElementById('wcIdlingReport') != undefined) {
            wcIdlingReport.PerformCallback();
        }
    }    
}
function DoCallbackHVRCommStatus() {

    var hdnValue = document.getElementById('hdnChartPerffered').value;
    var hdnArray = new Array();
    hdnArray = hdnValue;
    if (hdnArray.indexOf(433) != -1) {
        document.getElementById('chartHVRCommStatus').value = $('#pnlHVRCommStatus').width();
        if (document.getElementById('wcHVRCommStatusReport') != undefined) {
            wcHVRCommStatusReport.PerformCallback();
        }
    }
    else if (hdnValue == "") {
        document.getElementById('chartHVRCommStatus').value = $('#pnlHVRCommStatus').width();
        if (document.getElementById('wcHVRCommStatusReport') != undefined) {
            wcHVRCommStatusReport.PerformCallback();
        }
    }
}
function DoCallbackHVRAlarmStatus() {

    var hdnValue = document.getElementById('hdnChartPerffered').value;
    var hdnArray = new Array();
    hdnArray = hdnValue;
    if (hdnArray.indexOf(434) != -1) {
        document.getElementById('chartHVRAlarmStatus').value = $('#pnlHVRAlarmStatus').width();
        if (document.getElementById('wcHVRAlarmStatusReport') != undefined) {
            wcHVRAlarmStatusReport.PerformCallback();
        }
    }
    else if (hdnValue == "") {
        document.getElementById('chartHVRAlarmStatus').value = $('#pnlHVRAlarmStatus').width();
        if (document.getElementById('wcHVRAlarmStatusReport') != undefined) {
            wcHVRAlarmStatusReport.PerformCallback();
        }
    }
}
function DoCallbackHVRWarrantyAlarmStatus() {

    var hdnValue = document.getElementById('hdnChartPerffered').value;
    var hdnArray = new Array();
    hdnArray = hdnValue;
    if (hdnArray.indexOf(435) != -1) {
        document.getElementById('chartHVRWarrantyAlarmStatus').value = $('#pnlHVRWarrantyAlarmStatus').width();
        if (document.getElementById('wcHVRWarrantyAlarmStatusReport') != undefined) {
            wcHVRWarrantyAlarmStatusReport.PerformCallback();
        }
    }
    else if (hdnValue == "") {
        document.getElementById('chartHVRWarrantyAlarmStatus').value = $('#pnlHVRWarrantyAlarmStatus').width();
        if (document.getElementById('wcHVRWarrantyAlarmStatusReport') != undefined) {
            wcHVRWarrantyAlarmStatusReport.PerformCallback();
        }
    }
}

function DoCallbackHVRnonWarrantyAlarmStatus() {

    var hdnValue = document.getElementById('hdnChartPerffered').value;
    var hdnArray = new Array();
    hdnArray = hdnValue;
    if (hdnArray.indexOf(435) != -1) {
        document.getElementById('chartHVRnonWarrantyAlarmStatus').value = $('#pnlHVRnonWarrantyAlarmStatus').width();
        if (document.getElementById('wcHVRnonWarrantyAlarmStatusReport') != undefined) {
            wcHVRnonWarrantyAlarmStatusReport.PerformCallback();
        }
    }
    else if (hdnValue == "") {
        document.getElementById('chartHVRnonWarrantyAlarmStatus').value = $('#pnlHVRnonWarrantyAlarmStatus').width();
        if (document.getElementById('wcHVRnonWarrantyAlarmStatusReport') != undefined) {
            wcHVRnonWarrantyAlarmStatusReport.PerformCallback();
        }
    }
}
function DoCallbackIdlingAdv() {

    var hdnValue = document.getElementById('hdnChartPerffered').value;
    var hdnArray = new Array();
    hdnArray = hdnValue;

    if (hdnArray.indexOf(286) != -1) {
        document.getElementById('chartIdligAdv').value = $('#pnlIdlingAdv').width();
        if (document.getElementById('wcIdlingAdvReport') != undefined) {
            wcIdlingAdvReport.PerformCallback();
        }
    }
    else if (hdnValue == "") {
        document.getElementById('chartIdligAdv').value = $('#pnlIdlingAdv').width();
        if (document.getElementById('wcIdlingAdvReport') != undefined) {
            wcIdlingAdvReport.PerformCallback();
        }
    }
    
}
function DoCallbackWarrantyIncom() {

    var hdnValue = document.getElementById('hdnChartPerffered').value;
    var hdnArray = new Array();
    hdnArray = hdnValue;

    if (hdnArray.indexOf(286) != -1) {
        document.getElementById('chartWarrantyIncom').value = $('#pnlWarrantyIncom').width();
        if (document.getElementById('wcWarrantyIncomReport') != undefined) {
            wcWarrantyIncomReport.PerformCallback();
        }
    }
    else if (hdnValue == "") {
        document.getElementById('chartWarrantyIncom').value = $('#pnlWarrantyIncom').width();
        if (document.getElementById('wcWarrantyIncomReport') != undefined) {
            wcWarrantyIncomReport.PerformCallback();
        }
    }

}
function DoCallbackHVRWarrantyIncom() {

    var hdnValue = document.getElementById('hdnChartPerffered').value;
    var hdnArray = new Array();
    hdnArray = hdnValue;

    if (hdnArray.indexOf(286) != -1) {
        document.getElementById('chartHVRWarrantyIncom').value = $('#pnlHVRWarrantyIncom').width();
        if (document.getElementById('wcHVRWarrantyIncomReport') != undefined) {
            wcHVRWarrantyIncomReport.PerformCallback();
        }
    }
    else if (hdnValue == "") {
        document.getElementById('chartHVRWarrantyIncom').value = $('#pnlHVRWarrantyIncom').width();
        if (document.getElementById('wcHVRWarrantyIncomReport') != undefined) {
            wcHVRWarrantyIncomReport.PerformCallback();
        }
    }
}

function DoCallbackHVRWarrantyInstalled() {

    var hdnValue = document.getElementById('hdnChartPerffered').value;
    var hdnArray = new Array();
    hdnArray = hdnValue;

    if (hdnArray.indexOf(286) != -1) {
        document.getElementById('chartHVRWarrantyInstalled').value = $('#pnlHVRWarrantyInstalled').width();
        if (document.getElementById('wcHVRWarrantyInstalledReport') != undefined) {
            wcHVRWarrantyInstalledReport.PerformCallback();
        }
    }
    else if (hdnValue == "") {
        document.getElementById('chartHVRWarrantyInstalled').value = $('#pnlHVRWarrantyInstalled').width();
        if (document.getElementById('wcHVRWarrantyInstalledReport') != undefined) {
            wcHVRWarrantyInstalledReport.PerformCallback();
        }
    }
}

function DoCallbackPortalUsage() {

    var hdnValue = document.getElementById('hdnChartPerffered').value;
    var hdnArray = new Array();
    hdnArray = hdnValue;

    if (hdnArray.indexOf(287) != -1) {
        document.getElementById('chartPortalUsage').value = $('#pnlPortalUsage').width();
        if (document.getElementById('wcPortalUsageReport') != undefined) {
            wcPortalUsageReport.PerformCallback();
        }
    }
    else if (hdnValue == "") {
        document.getElementById('chartPortalUsage').value = $('#pnlPortalUsage').width();
        if (document.getElementById('wcPortalUsageReport') != undefined) {
            wcPortalUsageReport.PerformCallback();
        }
    }
    
} 

function ResizeChartCritical(s, e) {
    
    var hdnValue = document.getElementById('hdnChartPerffered').value;
    var hdnArray = new Array();
    hdnArray = hdnValue;
    document.getElementById('callbackState').value = 0;
	//document.getElementById('callbackState'].value = 0;
    if (hdnArray.indexOf(1) != -1) {
        var chart1 = $('#pnlCritical').width();
        if ((chart1 - 5) > 0) {
            document.getElementById('chartCrtical').value = (chart1 - 5);            
            //document.getElementById('chartCrtical'].value = (chart1 - 5);
            s.GetMainElement().style.width = (chart1 - 5) + 'px';
        }
    }
    else if (hdnValue == "") {
        var chart1 = $('#pnlCritical').width();
        if ((chart1 - 5) > 0) {
            document.getElementById('chartCrtical').value = (chart1 - 5);                        
            //document.getElementById('chartCrtical'].value = (chart1 - 5);
            s.GetMainElement().style.width = (chart1 - 5) + 'px';
        }
    }    
    if ($find('mpeProgressIndicator') != undefined) {
        $find('mpeProgressIndicator').hide();
    }
}

function ResizeChartNearingMaintenance(s, e) {

    var hdnValue = document.getElementById('hdnChartPerffered').value;
    var hdnArray = new Array();
    hdnArray = hdnValue;
    document.getElementById('callbackState').value = 0;
    if (hdnArray.indexOf(373) != -1) {
        var chart1 = $('#pnlNearingMaintenance').width();
        if ((chart1 - 5) > 0) {
            document.getElementById('chartNearingMaintenance').value = (chart1 - 5);
            s.GetMainElement().style.width = (chart1 - 5) + 'px';
        }
    }
    else if (hdnValue == "") {
        var chart1 = $('#pnlNearingMaintenance').width();
        if ((chart1 - 5) > 0) {
            document.getElementById('chartNearingMaintenance').value = (chart1 - 5);
            s.GetMainElement().style.width = (chart1 - 5) + 'px';
        }
    }
    if ($find('mpeProgressIndicator') != undefined) {
        $find('mpeProgressIndicator').hide();
    }
}

function ResizeChartIdling(s, e) {
    
    var hdnValue = document.getElementById('hdnChartPerffered').value;
    var hdnArray = new Array();
    hdnArray = hdnValue;
    document.getElementById('callbackState').value = 0;
    //window.document.form1.elements['callbackState'].value = 0;
    if (hdnArray.indexOf(3) != -1) {
        var chart1 = $('#pnlIdling').width();
        if ((chart1 - 5) > 0) {
            document.getElementById('chartIdlig').value = (chart1 - 5);
//            window.document.form1.elements['chartIdlig'].value = (chart1 - 5);
            s.GetMainElement().style.width = (chart1 - 5) + 'px';
        }
    }
    else if (hdnValue == "") {
        var chart1 = $('#pnlIdling').width();
        if ((chart1 - 5) > 0) {
            document.getElementById('chartIdlig').value = (chart1 - 5);
//            window.document.form1.elements['chartIdlig'].value = (chart1 - 5);
            s.GetMainElement().style.width = (chart1 - 5) + 'px';
        }
    }    
    if ($find('mpeProgressIndicator') != undefined) {
        $find('mpeProgressIndicator').hide();
    }
}
function ResizeChartHVRCommStatus(s, e) {

    var hdnValue = document.getElementById('hdnChartPerffered').value;
    var hdnArray = new Array();
    hdnArray = hdnValue;
    document.getElementById('callbackState').value = 0;
    //window.document.form1.elements['callbackState'].value = 0;
    if (hdnArray.indexOf(433) != -1) {
        var chart1 = $('#pnlHVRCommStatus').width();
        if ((chart1 - 5) > 0) {
            document.getElementById('chartHVRCommStatus').value = (chart1 - 5);
            //            window.document.form1.elements['chartIdlig'].value = (chart1 - 5);
            s.GetMainElement().style.width = (chart1 - 5) + 'px';
        }
    }
    else if (hdnValue == "") {
        var chart1 = $('#pnlHVRCommStatus').width();
        if ((chart1 - 5) > 0) {
            document.getElementById('chartHVRCommStatus').value = (chart1 - 5);
            //            window.document.form1.elements['chartIdlig'].value = (chart1 - 5);
            s.GetMainElement().style.width = (chart1 - 5) + 'px';
        }
    }
    if ($find('mpeProgressIndicator') != undefined) {
        $find('mpeProgressIndicator').hide();
    }
}
function ResizeChartHVRAlarmStatus(s, e) {

    var hdnValue = document.getElementById('hdnChartPerffered').value;
    var hdnArray = new Array();
    hdnArray = hdnValue;
    document.getElementById('callbackState').value = 0;
    //window.document.form1.elements['callbackState'].value = 0;
    if (hdnArray.indexOf(434) != -1) {
        var chart1 = $('#pnlHVRAlarmStatus').width();
        if ((chart1 - 5) > 0) {
            document.getElementById('chartHVRAlarmStatus').value = (chart1 - 5);
            //            window.document.form1.elements['chartIdlig'].value = (chart1 - 5);
            s.GetMainElement().style.width = (chart1 - 5) + 'px';
        }
    }
    else if (hdnValue == "") {
        var chart1 = $('#pnlHVRAlarmStatus').width();
        if ((chart1 - 5) > 0) {
            document.getElementById('chartHVRAlarmStatus').value = (chart1 - 5);
            //            window.document.form1.elements['chartIdlig'].value = (chart1 - 5);
            s.GetMainElement().style.width = (chart1 - 5) + 'px';
        }
    }
    if ($find('mpeProgressIndicator') != undefined) {
        $find('mpeProgressIndicator').hide();
    }
}
function ResizeChartHVRWarrantyAlarmStatus(s, e) {

    var hdnValue = document.getElementById('hdnChartPerffered').value;
    var hdnArray = new Array();
    hdnArray = hdnValue;
    document.getElementById('callbackState').value = 0;
    //window.document.form1.elements['callbackState'].value = 0;
    if (hdnArray.indexOf(435) != -1) {
        var chart1 = $('#pnlHVRWarrantyAlarmStatus').width();
        if ((chart1 - 5) > 0) {
            document.getElementById('chartHVRWarrantyAlarmStatus').value = (chart1 - 5);
            //            window.document.form1.elements['chartIdlig'].value = (chart1 - 5);
            s.GetMainElement().style.width = (chart1 - 5) + 'px';
        }
    }
    else if (hdnValue == "") {
        var chart1 = $('#pnlHVRWarrantyAlarmStatus').width();
        if ((chart1 - 5) > 0) {
            document.getElementById('chartHVRWarrantyAlarmStatus').value = (chart1 - 5);
            //            window.document.form1.elements['chartIdlig'].value = (chart1 - 5);
            s.GetMainElement().style.width = (chart1 - 5) + 'px';
        }
    }
    if ($find('mpeProgressIndicator') != undefined) {
        $find('mpeProgressIndicator').hide();
    }
}
function ResizeChartHVRnonWarrantyAlarmStatus(s, e) {

    var hdnValue = document.getElementById('hdnChartPerffered').value;
    var hdnArray = new Array();
    hdnArray = hdnValue;
    document.getElementById('callbackState').value = 0;
    //window.document.form1.elements['callbackState'].value = 0;
    if (hdnArray.indexOf(435) != -1) {
        var chart1 = $('#pnlHVRnonWarrantyAlarmStatus').width();
        if ((chart1 - 5) > 0) {
            document.getElementById('chartHVRnonWarrantyAlarmStatus').value = (chart1 - 5);
            //            window.document.form1.elements['chartIdlig'].value = (chart1 - 5);
            s.GetMainElement().style.width = (chart1 - 5) + 'px';
        }
    }
    else if (hdnValue == "") {
        var chart1 = $('#pnlHVRnonWarrantyAlarmStatus').width();
        if ((chart1 - 5) > 0) {
            document.getElementById('chartHVRnonWarrantyAlarmStatus').value = (chart1 - 5);
            //            window.document.form1.elements['chartIdlig'].value = (chart1 - 5);
            s.GetMainElement().style.width = (chart1 - 5) + 'px';
        }
    }
    if ($find('mpeProgressIndicator') != undefined) {
        $find('mpeProgressIndicator').hide();
    }
}
function ResizeChartIdlingAdv(s, e) {
    
    var hdnValue = document.getElementById('hdnChartPerffered').value;
    var hdnArray = new Array();
    hdnArray = hdnValue;
    document.getElementById('callbackState').value = 0;
//    window.document.form1.elements['callbackState'].value = 0;
    if (hdnArray.indexOf(286) != -1) {
        var chart1 = $('#pnlIdlingAdv').width();
        if ((chart1 - 5) > 0) {
            document.getElementById('chartIdligAdv').value = (chart1 - 5);
//            window.document.form1.elements['chartIdligAdv'].value = (chart1 - 5);
            s.GetMainElement().style.width = (chart1 - 5) + 'px';
        }
    }
    else if (hdnValue == "" && $('#pnlIdlingAdv') != undefined) {
        var chart1 = $('#pnlIdlingAdv').width();
        if ((chart1 - 5) > 0) {
            document.getElementById('chartIdligAdv').value = (chart1 - 5);
//            window.document.form1.elements['chartIdligAdv'].value = (chart1 - 5);
            s.GetMainElement().style.width = (chart1 - 5) + 'px';
        }
    }    
    if ($find('mpeProgressIndicator') != undefined) {
        $find('mpeProgressIndicator').hide();
    }
}

function ResizeChartWarrantyIncom(s, e) {

    var hdnValue = document.getElementById('hdnChartPerffered').value;
    var hdnArray = new Array();
    hdnArray = hdnValue;
    document.getElementById('callbackState').value = 0;
    //    window.document.form1.elements['callbackState'].value = 0;
    if (hdnArray.indexOf(286) != -1) {
        var chart1 = $('#pnlWarrantyIncom').width();
        if ((chart1 - 5) > 0) {
            document.getElementById('chartWarrantyIncom').value = (chart1 - 5);
            //            window.document.form1.elements['chartIdligAdv'].value = (chart1 - 5);
            s.GetMainElement().style.width = (chart1 - 5) + 'px';
        }
    }
    else if (hdnValue == "" && $('#pnlWarrantyIncom') != undefined) {
        var chart1 = $('#pnlWarrantyIncom').width();
        if ((chart1 - 5) > 0) {
            document.getElementById('chartWarrantyIncom').value = (chart1 - 5);
            //            window.document.form1.elements['chartIdligAdv'].value = (chart1 - 5);
            s.GetMainElement().style.width = (chart1 - 5) + 'px';
        }
    }
    if ($find('mpeProgressIndicator') != undefined) {
        $find('mpeProgressIndicator').hide();
    }
}
function ResizeChartHVRWarrantyIncom(s, e) {

    var hdnValue = document.getElementById('hdnChartPerffered').value;
    var hdnArray = new Array();
    hdnArray = hdnValue;
    document.getElementById('callbackState').value = 0;
    //    window.document.form1.elements['callbackState'].value = 0;
    if (hdnArray.indexOf(286) != -1) {
        var chart1 = $('#pnlHVRWarrantyIncom').width();
        if ((chart1 - 5) > 0) {
            document.getElementById('chartHVRWarrantyIncom').value = (chart1 - 5);
            //            window.document.form1.elements['chartIdligAdv'].value = (chart1 - 5);
            s.GetMainElement().style.width = (chart1 - 5) + 'px';
        }
    }
    else if (hdnValue == "" && $('#pnlHVRWarrantyIncom') != undefined) {
        var chart1 = $('#pnlHVRWarrantyIncom').width();
        if ((chart1 - 5) > 0) {
            document.getElementById('chartHVRWarrantyIncom').value = (chart1 - 5);
            //            window.document.form1.elements['chartIdligAdv'].value = (chart1 - 5);
            s.GetMainElement().style.width = (chart1 - 5) + 'px';
        }
    }
    if ($find('mpeProgressIndicator') != undefined) {
        $find('mpeProgressIndicator').hide();
    }
}

function ResizeChartHVRWarrantyInstalled(s, e) {

    var hdnValue = document.getElementById('hdnChartPerffered').value;
    var hdnArray = new Array();
    hdnArray = hdnValue;
    document.getElementById('callbackState').value = 0;
    //    window.document.form1.elements['callbackState'].value = 0;
    if (hdnArray.indexOf(286) != -1) {
        var chart1 = $('#pnlHVRWarrantyInstalled').width();
        if ((chart1 - 5) > 0) {
            document.getElementById('chartHVRWarrantyInstalled').value = (chart1 - 5);
            //            window.document.form1.elements['chartIdligAdv'].value = (chart1 - 5);
            s.GetMainElement().style.width = (chart1 - 5) + 'px';
        }
    }
    else if (hdnValue == "" && $('#pnlHVRWarrantyInstalled') != undefined) {
        var chart1 = $('#pnlHVRWarrantyInstalled').width();
        if ((chart1 - 5) > 0) {
            document.getElementById('chartHVRWarrantyInstalled').value = (chart1 - 5);
            //            window.document.form1.elements['chartIdligAdv'].value = (chart1 - 5);
            s.GetMainElement().style.width = (chart1 - 5) + 'px';
        }
    }
    if ($find('mpeProgressIndicator') != undefined) {
        $find('mpeProgressIndicator').hide();
    }
}


function ResizeChartPortalUsage(s, e) {
    
    var hdnValue = document.getElementById('hdnChartPerffered').value;
    var hdnArray = new Array();
    var chart1 = 0;
    hdnArray = hdnValue;
    document.getElementById('callbackState').value = 0;
//    window.document.form1.elements['callbackState'].value = 0;
    if (hdnArray.indexOf(287) != -1) {
        var chart1 = $('#pnlPortalUsage').width();
        if ((chart1 - 5) > 0) {
            document.getElementById('chartPortalUsage').value = 0;
//            window.document.form1.elements['chartPortalUsage'].value = (chart1 - 5);
            s.GetMainElement().style.width = (chart1 - 5) + 'px';
        }
    }
    else if (hdnValue == "") {
        var chart1 = $('#pnlPortalUsage').width();
        if ((chart1 - 5) > 0) {
            document.getElementById('chartPortalUsage').value = 0;
//            window.document.form1.elements['chartPortalUsage'].value = (chart1 - 5);
            s.GetMainElement().style.width = (chart1 - 5) + 'px';
        }
    }    
    if ($find('mpeProgressIndicator') != undefined) {
        $find('mpeProgressIndicator').hide();
    }
} 

function ResetCallbackState() {

    document.getElementById('callbackState').value = 1;
    if ($find('mpeProgressIndicator') != undefined) {
        $find('mpeProgressIndicator').show();
    }
}
//End

//For page reset
function ChangeState() {
    document.getElementById('ddlTop').value = 3;
}


//Dashboard paging functionality

//$(document).ready(function() {
//    LoadPageSettings();

//});

//function LoadPageSettings() {
//    //how much items per page to show
//    var show_per_page = 4;
//    //getting the amount of elements inside content div
//    var number_of_items = $('#PGcontent').children().size();
//    //calculate the number of pages we are going to have
//    var number_of_pages = Math.ceil(number_of_items / show_per_page);

//    //set the value of our hidden input fields
//    $('#current_page').val(0);
//    $('#show_per_page').val(show_per_page);

//    //now when we got all we need for the navigation let's make it '

//    /* 
//    what are we going to have in the navigation?
//    - link to previous page
//    - links to specific pages
//    - link to next page
//    */
//    var navigation_html = '<a class="previous_link" href="javascript:previous();"><img id="imgPre" runat="server" src="../images/previous.gif" alt="" align="top" /></a>';
//    var current_link = 0;
//    while (number_of_pages > current_link) {
//        navigation_html += '<a class="page_link" href="javascript:go_to_page(' + current_link + ')" longdesc="' + current_link + '">' + (current_link + 1) + '</a>';
//        current_link++;
//    }
//    navigation_html += '<a class="next_link" href="javascript:next();"><img id="imgNext" runat="server" src="../images/Next.gif" alt="" align="top" /></a>';

//    $('#page_navigation').html(navigation_html);

//    //add active_page class to the first page link
//    $('#page_navigation .page_link:first').addClass('active_page');

//    //hide all the elements inside content div
//    $('#PGcontent').children().css('display', 'none');

//    //and show the first n (show_per_page) elements
//    $('#PGcontent').children().slice(0, show_per_page).css('display', 'block');

//    
//}
//function previous() {

//    new_page = parseInt($('#current_page').val()) - 1;
//    //if there is an item before the current active link run the function
//    if ($('.active_page').prev('.page_link').length == true) {
//        go_to_page(new_page);
//    }
//}

//function next() {
//    new_page = parseInt($('#current_page').val()) + 1;
//    //if there is an item after the current active link run the function
//    if ($('.active_page').next('.page_link').length == true) {
//        go_to_page(new_page);
//    }
//}
//function go_to_page(page_num) {
//    //get the number of items shown per page
//    var show_per_page = parseInt($('#show_per_page').val());

//    //get the element number where to start the slice from
//    start_from = page_num * show_per_page;

//    //get the element number where to end the slice
//    end_on = start_from + show_per_page;

//    //hide all children elements of content div, get specific items and show them
//    $('#PGcontent').children().css('display', 'none').slice(start_from, end_on).css('display', 'block');

//    /*get the page link that has longdesc attribute of the current page and add active_page class to it
//    and remove that class from previously active page link*/
//    $('.page_link[longdesc=' + page_num + ']').addClass('active_page').siblings('.active_page').removeClass('active_page');

//    //update the current page input field            
//    $('#current_page').val(page_num);

//}