<%@ 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.NotificationSetupViewBean">

<%
  String sunMCErrorMsg = (String)session.getAttribute("sunMCErrorMsg");
  if (sunMCErrorMsg == null) sunMCErrorMsg = "SunMC IP Address Not Setup";
%>

<script language="JavaScript">

function isBlank(s) {
  for (var i = 0; i < s.length; i++) {
    var c = s.charAt(i);
    if ((c != ' ') && (c != '\n') && (c != '\t')) return false;
  }
  return true;
}

function ps_CheckRequiredFieldsNotificationPage() {
  var i;
 
  // CHECK THAT ALL REQUIRED NOTIFICATION FIELDS ARE FILLED IN
  for (i = 0; i < reqFieldIDs.length; i++) {
    var field = document.getElementById(reqFieldIDs[i]);
    if (field != null) {
      if (reqFieldFunctions[i] != null && reqFieldFunctions[i](field) == false) {
        alert(reqFieldMessages[i]);
        field.focus();
        return false;
      }
    }
   }

  // IF SUNMC NOTIFIER IS ENABLED - VERIFY THAT USER FILLED IN IP ADDRESS
  // OF SUNMC SERVER BEFORE ACCEPTING PAGE CHANGES
  var field = document.getElementById("SunMCActive")
  if (field.checked) {
    var f = document.getElementById("ipAddressFor");
    // SunMC is active...
    if ((f.value == null) || (f.value == "") || isBlank(f.value)) {
      // SunMC Server IP Address field is empty...report error
      alert('<%=sunMCErrorMsg%>');
      f.focus();
      return false;
    }
  }
  return true;
} 

</script>

<sa:primarymasthead name="Masthead">

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

<!-- Page Title --> 
<cc:pagetitle 
  name="PageTitle" 
  bundleID="appBundle"
  pageTitleText="page.title.notificationSetup" 
  showPageTitleSeparator="true"
  showPageButtonsTop="true"
  showPageButtonsBottom="true">

<!-- PropertySheet -->
  <cc:propertysheet 
   name="NotificationSetupPropertySheet" 
   bundleID="appBundle" 
   showJumpLinks="false"
   addJavaScript="true" />

</cc:pagetitle>

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

</jato:useViewBean>


