<%@  page pageEncoding="utf-8" contentType="text/html;charset=utf-8" import="com.novell.webaccess.common.JSPConduit, com.novell.emframe.dev.eMFrameUtils" %>
<%   JSPConduit c = JSPConduit.getJSPConduit(request);

  /* **************************************************************************
%name: CfgWizMigrateToExistingCollection_js.jsp %
%version: 4 %
%date_modified: Fri Aug 06 10:18:29 2004 %
Copyright (c) 2003 Novell, Inc. All Rights Reserved.
THIS WORK IS AN UNPUBLISHED WORK AND CONTAINS CONFIDENTIAL PROPRIETARY
AND TRADE SECRET INFORMATION OF NOVELL, INC. ACCESS TO THIS WORK IS
RESTRICTED TO (I) NOVELL, INC. EMPLOYEES WHO HAVE A NEED TO KNOW HOW
TO PERFORM TASKS WITHIN THE SCOPE OF THEIR ASSIGNMENTS AND (II)
ENTITIES OTHER THAN NOVELL, INC. WHO HAVE ENTERED INTO APPROPRIATE
LICENSE AGREEMENTS. NO PART OF THIS WORK MAY BE USED, PRACTICED,
PERFORMED COPIED, DISTRIBUTED, REVISED, MODIFIED, TRANSLATED, ABRIDGED,
CONDENSED, EXPANDED, COLLECTED, COMPILED, LINKED, RECAST, TRANSFORMED
OR ADAPTED WITHOUT THE PRIOR WRITTEN CONSENT OF NOVELL, INC. ANY USE
OR EXPLOITATION OF THIS WORK WITHOUT AUTHORIZATION COULD SUBJECT THE
PERPETRATOR TO CRIMINAL AND CIVIL LIABILITY.
***************************************************************************  */

  /* -------------------------------------------  */
  /* Puts the initial input focus into the page.  */
  /* -------------------------------------------  */%>
function setFocusAndInitializeForm()
{
	<%/* This function works on the main form.  */%>
	with (getMainWizForm())
	{
		var	aCaptionData;
		var	oNavData;

		<%/* Perform initializations common to all panels.  */%>
		initializePanel_Common();

		<%/* Set up input values  */%>
		CollectionOne_Name.value 	    = "<%= c.var("Hidden_CollectionOne_Name") %>";
		CollectionTwo_Name.value 	    = "<%= c.var("Hidden_CollectionTwo_Name") %>";


		<%/* Finally, force the caption frame...  */%>
		aCaptionData = new Array();
		aCaptionData["Wiz_Banner_Text"]     = "<%= c.toScript(c.string("CfgWiz.Wizard.Title")) %>";
	 	aCaptionData["Wiz_Banner_ShowHelp"] = false;
		aCaptionData["Wiz_Header_Size"]     = 1;
		aCaptionData["Wiz_Header_Big_0"]    = true;
		aCaptionData["Wiz_Header_Bold_0"]   = true;
		aCaptionData["Wiz_Header_Icon_0"]   = "<%= c.getModulesUrl() %>/fw/images/wiz_SnapinIcon.gif";
		aCaptionData["Wiz_Header_Item_0"]   = "<%= c.toScript(c.string("CfgWiz.MigrateToExistingCollection.Title")) %>";

		parent.window.Wiz_BannerFrame.updateCaption( aCaptionData );

		<%/* ...and navigation frame to update with settings  */
		  /* ...appropriate for this panel.                   */%>
		oNavData               	= new Object();
		oNavData.disableFinish 	= false;
      <% if (c.var("Hidden_RBSAdmin_TaskDelegate").equals("taskDelegateMigrate")) { %>
		   oNavData.disableBack 	= true;
      <% } else { %>
		   oNavData.disableBack 	= false;
      <% } %>
      oNavData.disableNext 	= true;
      oNavData.disableClose   = false;
		parent.window.Wiz_NavigationFrame.updateNavigation( oNavData );

		<%/*-- set focus to the first uninitialized input on the page -- */%>
		CollectionOne_Name.focus();

	} <%/* with  */%>
} <%/* setFocusAndInitializeForm  */

  /* -----------------------------------------------------  */
  /* Called when the help button is pressed on this panel.  */
  /* -----------------------------------------------------  */%>
function showHelp()
{
	runHelp( "todo.html" );
} <%/* showHelp  */



  /* ----------------------------------------------------------------  */
  /* Validates the selected server information when one of the backup  */
  /* push buttons is pressed.                                          */
  /* ----------------------------------------------------------------  */%>
function validateForm_PerPanel()
{
	<%/* This function works on the main form.  */%>
	with (getMainWizForm())
	{
		var	sPB;

		<%/*-- save off values to pass to other pages -- */%>
		Hidden_CollectionOne_Name.value = CollectionOne_Name.value;
		Hidden_CollectionTwo_Name.value = CollectionTwo_Name.value;

		<%/* Validate which push button was pressed.  */%>
		sPB = getPBClicked();
		if ("WizPB_Back" == sPB)
		{
			performBack();
			return( false );
		} <%/* if  */%>
		if ("WizPB_Close" == sPB)
		{
			<%/* Return true so that the form gets submitted and the  */
			  /* plug-in gets a chance to cleanup.                    */%>
			return( true );
		} <%/* if  */%>
		if ("WizPB_Finish" != sPB)
		{
			alert( "<%= c.toScript(c.string("CfgWiz.InternalError.UnknownPB")) %>" );
			return( false );
		} <%/* if  */

		  /* Validate input information  */%>
		if ( "" == CollectionOne_Name.value )
		{
			alert( "<%= c.toScript(c.string("CfgWiz.MigrateToNewCollection.MissingName")) %>" );
			return false;
		}

		if ( "" == CollectionTwo_Name.value )
		{
			alert( "<%= c.toScript(c.string("CfgWiz.MigrateToNewCollection.MissingName")) %>" );
			return false;
		}
		<%/* Returning true will cause the form to be submitted.  */%>
		return( true );
	} <%/* with  */%>
} <%/* validateForm_PerPanel  */



						     /* * * * * * *  */
                             /* End of File  */
                             /* * * * * * *  */%>
function preOS(controlName)
{
    with (getMainWizForm())
    {
        <%/* Disable all the buttons */%>
        var	oNavData;
        oNavData               	= new Object();
        oNavData.disableFinish 	= true;
        oNavData.disableBack 	= true;
        oNavData.disableNext 	= true;
        oNavData.disableClose   = true;
        parent.window.Wiz_NavigationFrame.updateNavigation( oNavData );
   }
}

function postOS(controlName)
{
    with (getMainWizForm())
    {
        <%/* Re-enable active buttons */%>
        var	oNavData;
        oNavData               	= new Object();
        oNavData.disableFinish 	= false;
        oNavData.disableBack 	= false;
        oNavData.disableNext 	= true;
        oNavData.disableClose   = false;
        parent.window.Wiz_NavigationFrame.updateNavigation( oNavData );

        if(controlName  == "CollectionOne_Name")
        {
            CollectionOne_Name.focus();
        }
        else
        {
            CollectionTwo_Name.focus();
        }
   }
}

