<%@ page language="java" %> 
<%@taglib uri="/WEB-INF/tld/com_iplanet_jato/jato.tld" prefix="jato"%> 
<%@taglib uri="/WEB-INF/tld/com_sun_web_ui/cc.tld" prefix="cc"%>
<%@taglib uri="/WEB-INF/lib/sa.tld" prefix="sa"%>

<jato:useViewBean className="com.sun.netstorage.mgmt.fm.storade.ui.viewbeans.admin.UtilitiesViewBean">

<%
  String appName = com.sun.netstorage.mgmt.fm.storade.ui.util.Connection.getAppName();
%>

<script language="javascript">
// This function will toggle the disabled state of action buttons
// depending on single or multiple selections.

function toggleDisabledStateForSE() {

   // Action button and menu names.
   var deleteExtractButton = "Utilities.deleteExtractButton";
                               

   // Element name (prefix) of selection checkbox/radiobutton.
   var elementName = "Utilities.solutionExtractTable.Selection";
  
   // Document form.
   var form = document.utilitiesForm;
 
   // Flag indicating to disable action button and menu options.
   var disabled = true;

   // Set flags according to single or multiple selections.
   for (i = 0; i < form.elements.length; i++) {
        var e = form.elements[i];
        if (e.name.indexOf(elementName) != -1) {
             if (e.checked) {
                disabled = false;
            break;
            }
        }
   }
   
   // Toggle action button disabled state.
   ccSetButtonDisabled(deleteExtractButton, "utilitiesForm", disabled);
}

function toggleDisabledStateForCF() {
   // Action button and menu names.
   var delCoreButton = "Utilities.deleteCoreButton";

   // Element name (prefix) of selection checkbox/radiobutton.
   var elementName = "Utilities.coreFilesTable.Selection";
  
   // Document form.
   var form = document.utilitiesForm;
 
   // Flag indicating to disable action button and menu options.
   var disabled = true;
 
   // Set flags according to single or multiple selections.
   for (i = 0; i < form.elements.length; i++) {
        var e = form.elements[i];

        if (e.name.indexOf(elementName) != -1) {
             if (e.checked) {
                disabled = false;
            break;
            }
        }
   }
  
   // Toggle action button disabled state.
   ccSetButtonDisabled(delCoreButton, "utilitiesForm", disabled);
}

function viewLog(url) {
  var logFile = getParameter(url.search, "Utilities.viewLogHREF");
  var win = window.open('/<%=appName%>/alarms/AcknowledgedBy?logFile=' + logFile, 'secondaryWindow','scrollbars,resizable,height=400,width=700,top='+((screen.height-(screen.height/1.618))-(400/2))+',left='+((screen.width-700)/2));
  win.focus();
}

function getParameter(query, key) {
  var ret = new String("not found!");
  var pos1 = query.indexOf(key + "=");

  if(pos1 == -1)
     return ret;

  var pos2 = pos1 + key.length + 1;
  var pos3 = query.substring(pos2, query.length).indexOf("&");
  if(pos3 != -1) {
    var pos4 = pos2 + pos3;
    ret = query.substring(pos2, pos4);
  } else {
    ret = query.substring(pos2, query.length);
  }
  return ret;
}


</script>

<sa:primarymasthead name="Masthead" showDefaultPageTitle="withBarOnly">

<jato:form name="utilitiesForm" method="post">

<!-- Page Title --> 
<!-- PropertySheet -->
  <cc:propertysheet 
   name="UtilitiesPropertySheet" 
   bundleID="appBundle" 
   showJumpLinks="true"
   addJavaScript="true" />

</jato:form>
</sa:primarymasthead>

</jato:useViewBean>


