// $Id: IPAMReport.js,v 1.3 2009/10/09 07:14:31 aramanathan Exp $

function showSubnetWiseIPs(menuItemName,refId,additionalParams,index){ 
   var menuItemObj = getMenuItemObj(menuItemName);
   var tblModel = getTableModel(refId);
   var colInd1  = tblModel.getColumnIndex("SubNetwork.HOSTIPSTART");
   var colInd2  = tblModel.getColumnIndex("SubNetwork.HOSTIPEND");
   var colInd3  = tblModel.getColumnIndex("SubNetwork.NETWORKADDRESS");
   
   var startSubnetAddress = tblModel.getValueAt(index,colInd1);
   var endSubnetAddress = tblModel.getValueAt(index,colInd2);
   var subnetAddress = tblModel.getValueAt(index,colInd3);
   renderViewCurrentView("/IPAvailabilityReportView.cc?startSubnetAddress="+startSubnetAddress+"&endSubnetAddress="+endSubnetAddress+"&selView=showView&selectedSubnet="+subnetAddress+"&showIPs=all&currentReport=IPAvailabilityReportView", "ipamHomeID")
}
 function loadViewOnDemand(currentView){
        document.getElementById('IPAMReportMainViewID').style.display = 'none';
        //renderView(currentView ,'tt');
        renderCurrentView(currentView , 'ipamHomeID');
    }

    
function reservedStaticIPSummary(menuItemName,refId,additionalParams,index){ 
   var menuItemObj = getMenuItemObj(menuItemName);
   var tblModel = getTableModel(refId);
   var colInd1  = tblModel.getColumnIndex("SubNetwork.HOSTIPSTART");
   var colInd2  = tblModel.getColumnIndex("SubNetwork.HOSTIPEND");
   var colInd3  = tblModel.getColumnIndex("SubNetwork.NETWORKADDRESS");
   
   var startSubnetAddress = tblModel.getValueAt(index,colInd1);
   var endSubnetAddress = tblModel.getValueAt(index,colInd2);
   var subnetAddress = tblModel.getValueAt(index,colInd3);
   renderViewCurrentView("/ReservedStaticIPReport.cc?startSubnetAddress="+startSubnetAddress+"&endSubnetAddress="+endSubnetAddress+"&showIPs=all&selectedSubnet="+subnetAddress+"&showView=staticResIP&currentReport=ReservedStaticIPReport&selView=showView", "ipamHomeID")
}
function IPMSummaryListView(menuItemName,refId,additionalParams,index){ 
   var menuItemObj = getMenuItemObj(menuItemName);
   var tblModel = getTableModel(refId);
   var colInd1  = tblModel.getColumnIndex("SubNetwork.HOSTIPSTART");
   var colInd2  = tblModel.getColumnIndex("SubNetwork.HOSTIPEND");
   var colInd3  = tblModel.getColumnIndex("SubNetwork.NETWORKADDRESS");
   
   var startSubnetAddress = tblModel.getValueAt(index,colInd1);
   var endSubnetAddress = tblModel.getValueAt(index,colInd2);
   var subnetAddress = tblModel.getValueAt(index,colInd3);
   renderViewCurrentView("/IPAMSummaryListViewReport.cc?startSubnetAddress="+startSubnetAddress+"&endSubnetAddress="+endSubnetAddress+"&showIPs=all&selectedSubnet="+subnetAddress+"&showView=ipusage&currentReport=IPAMSummaryListViewReport", "ipamHomeID")
}
 function loadingViewOnDemand(showView) {
     
        var showOnDemandURL = 'IPAMUnusedIPReport.cc?selView=lstGrpView&currentReport=IPAMUnusedIPReport&showView='+showView;
        if(showView == 'unusedIP'){
            showOnDemandURL = 'IPAMUnusedIPReport.cc?selView=lstGrpView&currentReport=IPAMUnusedIPReport&showView='+showView;
        } else if(showView == 'staticResIP') {
            showOnDemandURL = 'IPAMReservedStaticIPReport.cc?selView=lstGrpView&currentReport=IPAMReservedStaticIPReport&showView='+showView;
        }else if(showView == 'ipusage') {
            showOnDemandURL = 'IPAMSummaryReportView.cc?selView=grpView&currentReport=IPAMSummaryReportView&showView='+showView;
        }
        renderViewCurrentView(showOnDemandURL ,'ipamHomeID');
}

