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

<%
  String warningMessage = (String)session.getAttribute("warningMessage");
  if (warningMessage == null) warningMessage = "Execute Diagnostics?";
%>

<script language="javascript">

  function setClickFlag() {
     var form = document.testSetupForm;
     form.clickFlag.value = "true";
  }	

  function desetClickFlag() {
     var form = document.testSetupForm;
     form.clickFlag.value = "false";
  }

  function confirmDiag() {
    return confirm("<%=warningMessage%>");
  }

  function submitValues() {
    if(confirmDiag()) {	
      var form = document.testSetupForm;
      form.action = form.action + "?TestSetup.RunButton=";
      form.submit();
      return true;
    } else {
      return false;
    }
  }

  function onSubmit() {
    var form = document.testSetupForm;
    if(form.clickFlag.value != "true") {
      return submitValues();
    } else {
      return true;
    }
  }

</script>

<sa:primarymasthead name="Masthead">

<jato:form name="testSetupForm" method="post" onSubmit="javascript: return onSubmit();">

<cc:spacer name="spacer" height="15" newline="true"/>

<cc:pagetitle name="PageTitle"
 pageTitleText="page.title.testSetup"
 showPageButtonsTop="true"
 bundleID="appBundle">

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

</cc:pagetitle>

<cc:hidden name="assetID" />
<cc:hidden name="diag.testID"/>
<cc:hidden name="diag.testName" />
<cc:hidden name="diag.agent" />

<input type="hidden" name="clickFlag" value="false" />
</jato:form>

</sa:primarymasthead>

</jato:useViewBean>
