<%@  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); %>

<HTML>
<HEAD><TITLE>ObjectSelectorFinish (Simple)</TITLE>
<script>
function returnFromOS()
   {
      var isWindowed = (top.name=="SimpleOSWindow");
      if (isWindowed)
      {
         //windowed
         if (top.opener.returnFromOS)
         {
            top.opener.returnFromOS("<%= c.toScript(c.var("OS.Control")) %>", "<%= c.toScript(c.var("OS.Results")) %>", "<%= c.toScript(c.var("OS.CallBack")) %>");
         }
         else
         {
<%          if (com.novell.emframe.dev.D.isDebugEnabled()) { %>
               alert("returnFromOS() not defined in task.\nClosing Object Selector.");
<%          } %>
         }

         top.close();
      }
      else
      {
         //in the task
         document.forms[0].submit();
      }
   }
</script>
</HEAD>
<BODY onLoad="javascript:returnFromOS();">
   <form name="SearchFinish" target=_parent method=post action="<%= c.var("OS.AnchorURI") %>">
<%    int i = 0;
      while (i<c.toInt("OS.AnchorURLParm.Count")) { %>
         <input type=hidden name="<%= c.toTag(c.var("OS.AnchorURLParmName."+i)) %>" value="<%= c.toTag(c.var("OS.AnchorURLParmValue."+i)) %>">
<%       i++;
      } %>
      <input type=hidden name="OS.Control" value="<%= c.toTag(c.var("OS.Control")) %>">
      <input type=hidden name="OS.CallBack" value="<%= c.toTag(c.var("OS.CallBack")) %>">
      <input type=hidden name="OS.Results" value="<%= c.toTag(c.var("OS.Results")) %>">
      <input type=hidden name="OS.AnchorDocState" value="<%= c.toTag(c.var("OS.AnchorDocState")) %>">
      <input type=hidden name="OS.ReturningToAnchor" value="true">
   </form>
</BODY>
</HTML>
