<%--
/**
 * Copyright 2002-2004 Sun Microsystems, Inc.  All rights reserved.
 * Use is subject to license terms.
 *
 * ident	"@(#)QuorumWizardStep.jsp	1.2	04/06/21 SMI"
 */
--%>
<%@ page language="java" %> 
<%@ page import="com.iplanet.jato.view.ViewBean" %>
<%@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/tld/com_sun_cluster_spm/spm.tld" prefix="spm"%>

<jato:pagelet>

<cc:i18nbundle id="scBundle" 
               baseName="com.sun.cluster.spm.resources.Resources" />

<!--
  Work-around for a Lockhart's bug in generated HTML (BugID 4930639):
  The wizard tag generates an additional <table> tag before the
  property sheet but without any <tr><td> tags.
  As a consequence, in some browsers (namely Mozilla or Netscape 7),
  only the first section of the property sheet is displayed.
  The work-around consists in adding those <tr><td> tags; this has no
  impact on the global layout.
  -->
</table>
<!--
  Work-around for Lockhart's bug on wizard closing (BugID 4933149):
  When a wizard is opened, if the underlying page is changed, an
  application error is displayed.
  With this work-around, if the underlying page is unknown, the
  wizard will not attempt to refresh it.
  -->
<script type="text/javascript">
function ccWizardForwardAndClose(refreshForm, refreshCmdChild) {
    if (refreshForm != '' && refreshCmdChild != '') {
            var f = window.opener.document.forms[refreshForm];
            if (f != null) {
		var wizardButtonName = null;

            if(refreshCmdChild == 'QuorumStatus.QuorumWizardExit') {
		wizardButtonName = 'QuorumStatus.AddQuorumWizard';
            }

            var wizardButton = f.elements[wizardButtonName];
		if (wizardButton) {
                    f.action = f.action + "?" + refreshCmdChild + "=";
		f.submit();
            }
	}
    }
    close();
}

function wizardPageInit() {
	
    var hiddenField1 = window.document.wizWinForm.elements['WizardWindow.Wizard.NasReviewPageView.CloseWizardHiddenField'];
    var hiddenField2 = window.document.wizWinForm.elements['WizardWindow.Wizard.SdiskReviewPageView.CloseWizardHiddenField'];
	if (!hiddenField1) {
	hiddenField1 = window.document.wizWinForm.elements['WizardWindow.Wizard.NasReviewPageView.CloseWizardHiddenField'];
    }
	if (!hiddenField2) {
	hiddenField2 = window.document.wizWinForm.elements['WizardWindow.Wizard.SdiskReviewPageView.CloseWizardHiddenField'];
    }
		if (hiddenField1 || hiddenField2) {
	var closeWizard1 = hiddenField1.value;
	var closeWizard2 = hiddenField2.value;

	if ((closeWizard1 == "true") || (closeWizard2 == "true")) {
		var f = window.opener.document.forms['scForm'];
		var refreshCmdChild;

		 if (f.elements['QuorumStatus.AddQuorumWizard']) {
		refreshCmdChild = 'QuorumStatus.QuorumWizardExit';
            }
		ccWizardForwardAndClose('scForm', refreshCmdChild);
	}
    }
}

WizardWindow_Wizard.pageInit = wizardPageInit;
</script>

<table border="0" cellpadding="0" cellspacing="0">

<!-- Alert Inline -->
<tr><td>

<div class="ConMgn">
  <cc:hidden name="CloseWizardHiddenField"/>
  <cc:alertinline name="Alert" bundleID="scBundle" />
</div>

</td></tr>

<tr><td>

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

<!--
  End Lockhart's bug work-around (BugID 4930639).
  -->
</td></tr>

</jato:pagelet>
