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

<sa:primarymasthead name="Masthead">
<jato:form name="filterDetailsForm" method="post">

<script language="JavaScript">
function validate() {
   var code1 = document.getElementById("code1");
   var code2 = document.getElementById("code2");
   var code3 = document.getElementById("code3");

   if(isEmpty(code1) || isEmpty(code2) || isEmpty(code3)) {
	alert('<cc:text name="JSAlert" bundleID="appBundle" defaultValue="js.alert.eventFilter.code.empty" escape="false"/>');
        return false;
   } else if(!isValid(code1) || !isValid(code2) || !isValid(code3)) {
	alert('<cc:text name="JSAlert" bundleID="appBundle" defaultValue="js.alert.eventFilter.code.notValid" escape="false"/>');
        return false;
   } else {
	return true;
   }
}

function isEmpty(item) {
  var str = trim(item.value);
  if(str.length == 0)
     return true;
  else 
     return false;
} 

function isValid(item) {
  var v = trim(item.value);
  if(v.indexOf("ERR") == 0) {
     return true;
  } else if(isaNum(v) && parseInt(v) >= 0 && parseInt(v) <= 999) {
     return true;
  } else {
     return false;
  }
	
}

</script>

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

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

</cc:pagetitle>

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


