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

<HTML>
<HEAD>
<TITLE>SelectedObjectsButtons</TITLE>
<jsp:include page='<%= c.getPath("dev/eMFrameScripts_inc.jsp") %>' flush="true" />
<script>
   var bButtonsEnabled=false;
   
   function enableButtons(enabled)
   {
      if (bButtonsEnabled!=enabled)
      {
         document.getElementById("SOButtons").style.display=((enabled)?"inline":"none");
         document.getElementById("DisabledSOButtons").style.display=((enabled)?"none":"inline");
         bButtonsEnabled=enabled;
      }
   }
   
   function returnSelection()
   {
      if (!top.m_bSelectionMade)
      {
         top.m_bSelectionMade = true;
         var strURL = "webacc?taskId=fw.ObjectSelectorFinish&merge=fw.OS.ObjectSelectorFinish&error=dev.GenErr&User.context=<%= c.var("User.context") %>&Search.ContextId="+toScript(top.m_searchContextId);
         
         // format the results string
         var cnt = 0;
         var strResults = "";
         for (var i=0; i<top.SelectedObjectsTitle.selectedObjects.length; i++)
         {
            if (top.SelectedObjectsTitle.selectedObjects[i] != null)
            {
               if (cnt!=0)
               {
                  strResults += ",";
               }
               strResults += urlEncode(top.SelectedObjectsTitle.selectedObjects[i][0]);
               cnt++;
            }
         }
         document.PostData.action = strURL;
         document.getElementById("osresults").value = strResults;
         document.PostData.submit();
      }
   }
   
   function doResetHint()
   {
      if (top.Results.bEnhancedHint) 
      {
         top.Results.resetHint();
      }
   }
   
</script>
</HEAD>
<script>
   if (MS55)
      document.writeln('<body bgcolor="#EFEEE9" style="border-style:solid; border-width:1; border-color:#BFBBB2;" onFocus="top.ensureOpenerValid();">');
   else
      document.writeln('<body bgcolor="#EFEEE9" onFocus="top.ensureOpenerValid();">');
</script>
<div id=SOButtons style="width:100%;position:absolute;top:5;display:none">
<center>
<table height="100%" cellspacing=0 cellpadding=0 border=0>
   <tr>
      <td><a href="javascript:doResetHint();returnSelection()"><IMG alt="<%= c.toTag(c.string("OS.Browser.OKHint")) %>" title="<%= c.toTag(c.string("OS.Browser.OKHint")) %>" src="<%= c.getModulesUrl() %>/dev/images/<%= c.toTag(c.string("Button.OK.image")) %>" border=0></a></td>
      <td>&nbsp;&nbsp</td>
      <td><a href="javascript:doResetHint();top.SelectedObjectsTitle.clearAllSelections()"><IMG alt="<%= c.toTag(c.string("OS.Browser.ClearAllHint")) %>" title="<%= c.toTag(c.string("OS.Browser.ClearAllHint")) %>" src="<%= c.getModulesUrl() %>/dev/images/<%= c.toTag(c.string("Button.ClearAll.image")) %>" border=0></a></td>
   </tr>
</table>
</center>
</div> 

<div id=DisabledSOButtons style="width:100%;position:absolute;top:5;display:inline">
<center>
<table height="100%" cellspacing=0 cellpadding=0 border=0>
   <tr>
      <td><IMG alt="<%= c.toTag(c.string("Button.OKDisabled.alt")) %>" title="<%= c.toTag(c.string("Button.OKDisabled.alt")) %>" src="<%= c.getModulesUrl() %>/dev/images/<%= c.toTag(c.string("Button.OKDisabled.image")) %>" border=0></td>
      <td>&nbsp;&nbsp</td>
      <td><IMG alt="<%= c.toTag(c.string("Button.ClearAllDisabled.alt")) %>" title="<%= c.toTag(c.string("Button.ClearAllDisabled.alt")) %>" src="<%= c.getModulesUrl() %>/dev/images/<%= c.toTag(c.string("Button.ClearAllDisabled.image")) %>" border=0></td>
   </tr>
</table>
</center>   
</div>

<form name=PostData method=post target="" onSubmit="javascript:top.processDisplayCountChange();return false;">
<input type=hidden name="OS.Results" id="osresults" value="">
</form>
</body>
</HTML>
