<%@  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); 
   c.stringTable("DevResources"); 
   c.stringTable("FwResources"); %>
<HTML>
<HEAD>
<TITLE><%= c.toHTML(c.string("RBSManagement.ModifyRoleScopeTitle")) %></TITLE>
<LINK rel='stylesheet' href='<%= c.getModulesUrl() + "/dev/css/hf_style.css" %>'>
<jsp:include page='<%= c.getPath("dev/eMFrameScripts_inc.jsp") %>' flush="true" />
<jsp:include page='<%= c.getPath("dev/OSScripts_inc.jsp") %>' flush="true" />
<SCRIPT language="JavaScript">
	
   function onPageLoad()
   {
   	returnFromOS();
      document.myForm.ScopeTextField.focus();
   }
   
   function setWaitCursor()
   {
	   document.body.style.cursor="wait";
   }
   
   function onExit()
   {
      if (!opener.document.ModifyAssociationsForm)
      {
      	alert(ParentWindowChangedErrorAlertMessage);
         window.close();
         return false;
      }
      
      passDataBack();
   }
   
   function passDataBack()
  	{
      openerForm 				= opener.document.ModifyAssociationsForm;
      var memberName			= openerForm.ModifyMemberFullName.value;
      var oldScope			= openerForm.ModifyMemberOldScope.value;
      var newScope			= document.myForm.ScopeTextField.value;
      var modifyScopeArray = new Array();
      var count 				= 0;
      
      if (newScope.length > 0)
      {
         modifyScopeArray[count] = urlEncode(memberName) + ";" + urlEncode(oldScope) + ";" + urlEncode(newScope) + "$";
      }
      
      count++;
   	         
      if (modifyScopeArray.length > 0)
	   {
         openerForm.ModifyScopeList.value=modifyScopeArray.join("$");
         openerForm.merge.value="fw.ModifyRoleAssociations";
         openerForm.nextState.value="modifyMemberScopeInTable";
	   }
      else
      {
         // The user has clicked OK without selecting anything. Go back to the original page without calling submit
	      window.close();
         return false;
      }
      
      setWaitCursor();
      openerForm.submit();
      window.close();
  	}
   
   function checkKey(evt)
   {
      var keyCode = evt.which ? evt.which : evt.keyCode;
      
      if (keyCode == 13)
      {
         passDataBack();
      }
      
      return true;
   }
   
   
</SCRIPT>
</HEAD>
<BODY TEXT="#000000" LINK="#000000" VLINK="#000000" ALINK="#000000" bgcolor="#FFFFFF" onLoad="onPageLoad();">
<FORM name=myForm>

	<% c.set("TaskHeader.title", c.toHTML(c.string("ModifyRoleScope.ModifyScope"))); %>
   <jsp:include page='<%= c.getPath("dev/TaskHeader_inc.jsp") %>' flush="true" />
   <BR>
	<TABLE>
		<TR><TD>&nbsp;</TD></TR>
		<TR>
			<TD class="mediumtext" width="40%" nowrap valign="bottom"><%= c.toHTML(c.string("ModifyRoleScope.Scope")) %></TD>
		</TR>
		<TR>
			<TD width="40%" nowrap valign="top" height="24">
			   <input type=text name="ScopeTextField" value="" size=25 maxlength=64 onkeypress="return checkKey(event)">
			   <% c.set("OS.TypeFilter",c.var("RoleScopeFilter")); 
				   c.set("OS.Mode", "Search"); 
               c.set("OS.Control", "ScopeTextField"); %>
				<jsp:include page='<%= c.getPath("dev/OS_inc.jsp") %>' flush="true" />
			</TD>
	   </TR>
      <TR><TD>&nbsp;</TD></TR>
      <TR>
      	<TD class="ruleabove">
         	<a href="#" onClick="onExit();return false"><IMG src="<%= c.getModulesUrl() + "/dev/images/" + c.string("Button.OK.image") %>" alt="<%= c.toHTML(c.string("Button.OK.alt")) %>" title="<%= c.toHTML(c.string("Button.OK.alt")) %>" border=0></a>
				<a href="#" onClick="window.close();return false"><IMG src="<%= c.getModulesUrl() + "/dev/images/" + c.string("Button.Cancel.image") %>" alt="<%= c.toHTML(c.string("Button.Cancel.alt")) %>" title="<%= c.toHTML(c.string("Button.Cancel.alt")) %>" border=0></a>
         </TD>
      </TR>
	</TABLE>
</FORM>
<jsp:include page='<%= c.getPath("dev/OSFooter_inc.jsp") %>' flush="true" />
</BODY>
</HTML>
