<%@  page pageEncoding="utf-8" contentType="text/html;charset=utf-8" import="com.novell.webaccess.common.JSPConduit"%>

<%@ taglib uri="/WEB-INF/iman.tld" prefix="iman" %>
<%@ taglib uri="/WEB-INF/c.tld" prefix="c" %>
<%@ taglib uri="/WEB-INF/x.tld" prefix="x" %>

<% 
   JSPConduit c = JSPConduit.getJSPConduit(request); 
   c.set("TaskHeader.title", c.string("OS.Simple.BrowseDir")); 
   c.set("TaskHeader.bgcolor", "#E0E1DF"); %>  
<iman:stringtable bundle="FwResources"/>
<iman:stringtable bundle="DevResources"/>

<HTML>
<HEAD>
   <LINK rel="stylesheet" href="<c:out value="${ContextPath}" />/portal/modules/fw/css/osStyles.css">
   
   <SCRIPT src="<c:out value="${ContextPath}" />/portal/modules/fw/javascripts/Studio.js"></SCRIPT>
   <iman:eMFrameScripts/>
   <iman:mvedScripts/>
   <iman:osScripts/>

   <SCRIPT>
      function onExit()
      {
         if(document.form.queryName.value == "")
         {
            alert("<iman:string key="TC.MustEnterQueryName"/>");
            document.form.queryName.focus();
         }
         else
         { 
            document.form.submit();
         }
      }
      
      function nameExists()
      {
      	if(document.form.nameExists.value == "true")
         {
           if(confirm("<iman:string key="SaveQuery.TheQuery"/>"+document.form.queryName.value+"<iman:string key="SaveQuery.AlreadyExists"/>"))
           {
           	  document.form.overwrite.value = "true";
              document.form.submit();
           }
         }
      }
   </SCRIPT>
</HEAD>

<BODY bgcolor="#E0E1DF" onload="javascript:document.form.queryName.focus(); nameExists();">
<FORM name="form" method="post" action="webacc">

   <INPUT type="hidden" name="taskId" value="<c:out value="${taskId}"/>">
   <INPUT type="hidden" name="nextState" value="save">
   <INPUT type="hidden" name="query" value="<c:out value="${param.query}"/>">
   <INPUT type="hidden" name="nameExists" value="<c:out value="${nameExists}"/>">
   <INPUT type="hidden" name="overwrite" value="">
 
	<FONT face="Helvetica,Arial" ><b><iman:string key="TC.SaveQueryTitle"/></b></FONT><br/><br/>
   <FONT face="Helvetica,Arial" size=-1><b><iman:string key="TC.QueryNamePrompt"/></b></FONT>
   <INPUT type="text" name="queryName" size="-1" style="width:<iman:string key="UI.textboxPixel"/>" value="<c:out value="${queryName}"/>"><BR>

   <BR>   
   <iman:button key="OK" onClick="onExit();"/>
   <iman:button key="Cancel" onClick="window.close()"/>

</FORM>
</BODY>
</HTML>
