<%@  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("BaseResources");
   c.stringTable("FwResources"); %>
<HTML><HEAD><TITLE><%= c.toHTML(c.string("ModifyRBSObjectDescription.Title")) %></TITLE>
<LINK href="<%= c.getModulesUrl() + "/dev/css/hf_style.css" %>" rel="styleSheet" type="text/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()
   {
   	// Set the focus on the text area when page loads
      document.ModifyRBSObjectDescriptionForm.DescriptionTextArea.focus();
   }


   function setWaitCursor()
   {
	   document.body.style.cursor="wait";
   }


   // Function - getModifiedDescription
   function getModifiedDescription()
   {
      if (document.ModifyRBSObjectDescriptionForm.ModifyRBSObjectDescriptionChanged.value == "true")
      {
         var textAreaSizeOk = checkFinalTextAreaSize();
         if (textAreaSizeOk == false)
         {
            return false;
         }
         document.ModifyRBSObjectDescriptionForm.ChangedRBSObjectDescription.value = document.ModifyRBSObjectDescriptionForm.DescriptionTextArea.value;
         return true;
      }
      else
      {
      	// Check with user to see if they want to continue
         var message = "<%= c.toScript(c.string("ModifyRBSObjectDescription.NothingChanged")) %>";

         if (!confirm(message))
         {
            document.ModifyRBSObjectDescriptionForm.DescriptionTextArea.focus();
            return false;
         }

         setWaitCursor();

         // Nothing has changed so return to the main page
         document.ModifyRBSObjectDescriptionForm.elements["taskId"].value="fw.HomePage";
         document.ModifyRBSObjectDescriptionForm.elements["merge"].value="fw.HomePage";
         document.ModifyRBSObjectDescriptionForm.elements["nextState"].value="fw.HomePage";
         document.ModifyRBSObjectDescriptionForm.submit();
      }
   }

	// Function - setDescriptionChange
   // Set to true if the user has changed the description value
   function setDescriptionChange()
   {
      document.ModifyRBSObjectDescriptionForm.ModifyRBSObjectDescriptionChanged.value = "true";
   }

	// Check to make sure the description attribute max size is not exceeded.
   function checkFinalTextAreaSize()
   {
      var maxlimit = 1024;

      if (document.ModifyRBSObjectDescriptionForm.DescriptionTextArea.value.length > maxlimit) // if too long...trim it!
	  {
         var limitMessage = "<%= c.toScript(c.string("ModifyRBSObjectDescription.ExceededLimit")) %>";
         alert(limitMessage);
         document.ModifyRBSObjectDescriptionForm.DescriptionTextArea.value = document.ModifyRBSObjectDescriptionForm.DescriptionTextArea.value.substring(0, maxlimit);
         return false;
      }
      else
      {
         return true;
      }
   }


</SCRIPT>
</HEAD>
<BODY TEXT="#000000" LINK="#000000" VLINK="#000000" ALINK="#000000" bgcolor="#FFFFFF" onload="onPageLoad();">
<form name="ModifyRBSObjectDescriptionForm" method=post action="webacc" onsubmit="return(getModifiedDescription())">
   <input type=hidden name="taskId" value="<%= c.var("taskId") %>">
   <input type=hidden name="merge" value="dev.GenConf">
   <input type=hidden name="error" value="dev.GenErr">
   <input type=hidden name="User.context" value="<%= c.var("User.context") %>">
   <input type=hidden name="nextState" value="doModifications">

   <input type=hidden name="ModifyRBSObjectDescriptionChanged" value="false">
   <input type=hidden name="ChangedRBSObjectDescription" value="">
   <input type=hidden name="ModifyRBSObjectDescriptionName" value="<%= c.var("ModifyRBSObjectDescriptionName") %>">

   <input type=hidden name="taskComplete" value="">
   <input type=hidden name="taskCancelled" value="">
   <!-- End of hidden fields -->

   <% c.set("TaskHeader.title", c.string("ModifyRBSObjectDescription.Title"));
      c.set("TaskHeader.helpFile", "base/modifydescription.html"); %>
   <jsp:include page='<%= c.getPath("dev/TaskHeader_inc.jsp") %>' flush="true" />

   <BR>
   <DIV class="mediumtext"><B><%= c.var("RBSObjectTypeDispalyName") %></B> <%= c.var("LocalizedDisplayName") %></DIV>
   <BR><BR>
	<FONT face="Helvetica,Arial" size=-1><NOBR><%= c.toHTML(c.string("ModifyRBSObjectDescription.Description")) %></NOBR></FONT><BR>
	<TEXTAREA name="DescriptionTextArea" rows="5" cols="35" onchange="setDescriptionChange()" maxlength="64"><%= c.var("RBSObject.ModifyDescription") %></TEXTAREA>
   <BR><BR>
	<DIV class="ruleabove">
		<INPUT type=image name="Modify Object" alt="<%= c.string("Button.Modify.alt") %>" src="<%= c.getModulesUrl() + "/dev/images/" + c.string("Button.OK.image") %>" border=0><jsp:include page='<%= c.getPath("dev/Cancel_inc.jsp") %>' flush="true" />
   </DIV>
   </FONT>
</FORM>
<jsp:include page='<%= c.getPath("dev/OSFooter_inc.jsp") %>' flush="true" />
</BODY></HTML>
