package org.apache.jsp.ampiere.jsp.button;

import javax.servlet.*;
import javax.servlet.http.*;
import javax.servlet.jsp.*;
import java.util.ArrayList;
import com.ampiere.util.AmpiereUtil;

public final class docaction_jsp extends org.apache.jasper.runtime.HttpJspBase
    implements org.apache.jasper.runtime.JspSourceDependent {

  private static java.util.Vector _jspx_dependants;

  static {
    _jspx_dependants = new java.util.Vector(2);
    _jspx_dependants.add("/WEB-INF/struts-bean.tld");
    _jspx_dependants.add("/WEB-INF/struts-html.tld");
  }

  private org.apache.jasper.runtime.TagHandlerPool _jspx_tagPool_bean_write_property_name_nobody;
  private org.apache.jasper.runtime.TagHandlerPool _jspx_tagPool_html_hidden_property_name_nobody;
  private org.apache.jasper.runtime.TagHandlerPool _jspx_tagPool_html_hidden_styleId_property_name_nobody;

  public java.util.List getDependants() {
    return _jspx_dependants;
  }

  public void _jspInit() {
    _jspx_tagPool_bean_write_property_name_nobody = org.apache.jasper.runtime.TagHandlerPool.getTagHandlerPool(getServletConfig());
    _jspx_tagPool_html_hidden_property_name_nobody = org.apache.jasper.runtime.TagHandlerPool.getTagHandlerPool(getServletConfig());
    _jspx_tagPool_html_hidden_styleId_property_name_nobody = org.apache.jasper.runtime.TagHandlerPool.getTagHandlerPool(getServletConfig());
  }

  public void _jspDestroy() {
    _jspx_tagPool_bean_write_property_name_nobody.release();
    _jspx_tagPool_html_hidden_property_name_nobody.release();
    _jspx_tagPool_html_hidden_styleId_property_name_nobody.release();
  }

  public void _jspService(HttpServletRequest request, HttpServletResponse response)
        throws java.io.IOException, ServletException {

    JspFactory _jspxFactory = null;
    PageContext pageContext = null;
    HttpSession session = null;
    ServletContext application = null;
    ServletConfig config = null;
    JspWriter out = null;
    Object page = this;
    JspWriter _jspx_out = null;
    PageContext _jspx_page_context = null;


    try {
      _jspxFactory = JspFactory.getDefaultFactory();
      response.setContentType("text/html; charset=UTF-8");
      pageContext = _jspxFactory.getPageContext(this, request, response,
      			null, true, 8192, true);
      _jspx_page_context = pageContext;
      application = pageContext.getServletContext();
      config = pageContext.getServletConfig();
      session = pageContext.getSession();
      out = pageContext.getOut();
      _jspx_out = out;

      out.write("\r\n");
      out.write("\r\n");
      out.write("\r\n");
      out.write("\r\n");
      out.write("\r\n");
      org.apache.jasper.runtime.JspRuntimeLibrary.include(request, response, "/ampiere/jsp/common/includeYAHOOUI.jsp", out, true);
      out.write(" \r\n");
      out.write("<html>\r\n");
      out.write("<head>\r\n");
      out.write("<title>");
      if (_jspx_meth_bean_write_0(_jspx_page_context))
        return;
      out.write("</title>\r\n");
      out.write("<link type=\"text/css\" rel=\"stylesheet\" href=\"");
      out.write((java.lang.String) org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate("${pageContext.request.contextPath}", java.lang.String.class, (PageContext)_jspx_page_context, null, false));
      out.write("/ampiere/css/import_popup.css\"/>\r\n");
      out.write("<link type=\"text/css\" rel=\"stylesheet\" href=\"");
      out.write((java.lang.String) org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate("${pageContext.request.contextPath}", java.lang.String.class, (PageContext)_jspx_page_context, null, false));
      out.write("/ampiere/css/window.css\"/>\r\n");
      out.write("<script type=\"text/javascript\" src=\"");
      out.write((java.lang.String) org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate("${pageContext.request.contextPath}", java.lang.String.class, (PageContext)_jspx_page_context, null, false));
      out.write("/ampiere/js/window.js\"></script>\r\n");
      out.write("<style type=\"text/css\">\r\n");
      out.write("<!--\r\n");
      out.write(".popupInfoTable {\r\n");
      out.write("\tpadding-top: 3px;\r\n");
      out.write("\tpadding-bottom: 3px;\r\n");
      out.write("}\r\n");
      out.write("-->\r\n");
      out.write("</style>\r\n");
      out.write("<script type=\"text/javascript\">\r\n");
      out.write("var selectIndex = 0;\r\n");
      out.write("var valueArray = null;\r\n");
      out.write("var descArray = null;\r\n");
      out.write("\r\n");
      out.write("// Change description\r\n");
      out.write("function changeActionCombo(index) {\r\n");
      out.write("\tvar desc = document.getElementById(\"description\");\r\n");
      out.write("\tif (desc != null) {\r\n");
      out.write("\t\tif (descArray != null && descArray.length > index) {\r\n");
      out.write("\t\t\tdesc.value = descArray[index];\r\n");
      out.write("\t\t} else {\r\n");
      out.write("\t\t\tdesc.value = \"\";\r\n");
      out.write("\t\t}\r\n");
      out.write("\t}\r\n");
      out.write("\r\n");
      out.write("\tselectIndex = index;\r\n");
      out.write("}\r\n");
      out.write("// Start process\r\n");
      out.write("function startProcess(isBatch) {\r\n");
      out.write("\tif (! checkParent(window)) {\r\n");
      out.write("        window.close();\r\n");
      out.write("\t\treturn;\r\n");
      out.write("\t}\r\n");
      out.write("\r\n");
      out.write("    if (window.opener.top.WWindow) {\r\n");
      out.write("    \tvar buttonObj = (window.opener.top.WWindow.document.getElementById(\"DocAction\"));\r\n");
      out.write("\t\tvar processIdObj = document.getElementById(\"Process_ID\");\r\n");
      out.write("\t\tif (buttonObj != null && processIdObj != null) {\r\n");
      out.write("\t\t\tvar actionComboObj = document.getElementById(\"actionCombo\");\r\n");
      out.write("\t\t\tif (valueArray != null && actionComboObj != null) {\r\n");
      out.write("\t\t\t\tvar selectValue = valueArray[actionComboObj.value];\r\n");
      out.write("\t\t\t\tprocessButton(buttonObj, processIdObj.value, isBatch, selectValue);\r\n");
      out.write("\t\t\t}\r\n");
      out.write("/*\r\n");
      out.write("\t\t\tif (valueArray != null && selectIndex >= 0 && valueArray.length > selectIndex) {\r\n");
      out.write("\t\t\t\tvar selectValue = valueArray[selectIndex];\r\n");
      out.write("\t\t\t\tprocessButton(buttonObj, processIdObj.value, isBatch, selectValue);\r\n");
      out.write("\t\t\t}\r\n");
      out.write("*/\r\n");
      out.write("\t\t}\r\n");
      out.write("\t}\r\n");
      out.write("\r\n");
      out.write("    window.close();\r\n");
      out.write("    window.opener.focus();\r\n");
      out.write("}\r\n");
      out.write("</script>\r\n");
      out.write("</head>\r\n");
      out.write("\r\n");
 com.ampiere.grid.ed.WDocAction wDocAction = (com.ampiere.grid.ed.WDocAction)request.getAttribute("wDocAction"); 
      out.write("\r\n");
      out.write("\r\n");

boolean closeMe = true;
if (wDocAction != null) {
	ArrayList actionCombo = (ArrayList)wDocAction.getActionCombo();
	if (actionCombo != null && actionCombo.size() > 0) {
		closeMe = false;
	}
}

      out.write("\r\n");
      out.write("\r\n");
      out.write("<body id=\"popup\">\r\n");
      out.write("\r\n");
      out.write("<div>\r\n");
      if (_jspx_meth_html_hidden_0(_jspx_page_context))
        return;
      out.write('\r');
      out.write('\n');
      if (_jspx_meth_html_hidden_1(_jspx_page_context))
        return;
      out.write('\r');
      out.write('\n');
      if (_jspx_meth_html_hidden_2(_jspx_page_context))
        return;
      out.write("\r\n");
      out.write("</div>\r\n");
      out.write("\r\n");
      out.write("\r\n");
      out.write("<div id=\"header\">\r\n");
      out.write("\t\t<h1>");
      if (_jspx_meth_bean_write_1(_jspx_page_context))
        return;
      out.write("</h1>\r\n");
      out.write("</div>\r\n");
      out.write("\r\n");
      out.write("<div id=\"body\">\r\n");
      out.write("\r\n");

String batchButton = null;
if (wDocAction != null) {
	ArrayList actionCombo = (ArrayList)wDocAction.getActionCombo();
	String actionComboDescSel = AmpiereUtil.sanitizing((String)wDocAction.getActionComboDescSelected());
	if (actionCombo != null && actionCombo.size() > 0) {
		batchButton = wDocAction.getBatchButton();

      out.write("\r\n");
      out.write("<script type=\"text/javascript\">\r\n");
      out.write("valueArray = ");
      out.print( wDocAction.getActionComboValueArray() );
      out.write(";\r\n");
      out.write("descArray = ");
      out.print( wDocAction.getActionComboDescArray() );
      out.write(";\r\n");
      out.write("</script>\r\n");
      out.write("\r\n");
      out.write("<!-- body -->\r\n");
      out.write("\r\n");
      out.write("\r\n");
      out.write("<!-- popupInfoTable -->\r\n");
      out.write("<table class=\"popupInfoTable\">\r\n");
      out.write("<tr>\r\n");
      out.write("\t<th nowrap=\"nowrap\" valign=\"middle\" align=\"right\">");
      out.print( wDocAction.getActionLabel() );
      out.write("\r\n");
      out.write("\t</th>\r\n");
      out.write("\t<td class=\"align-right\">\r\n");
      out.write("\t\t<select id=\"actionCombo\" onchange=\"changeActionCombo(this.value);\">\r\n");

		for (int ii = 0; ii < actionCombo.size(); ii++) {
			String comboValue = AmpiereUtil.sanitizing((String)actionCombo.get(ii));
			if (comboValue != null && comboValue.equals(wDocAction.getActionComboSelected())) {

      out.write("\r\n");
      out.write("\t\t\t\t<option value=\"");
      out.print( ii );
      out.write("\" selected=\"selected\">");
      out.print( comboValue );
      out.write("</option>\r\n");

			} else {

      out.write("\r\n");
      out.write("\t\t\t\t<option value=\"");
      out.print( ii );
      out.write('"');
      out.write('>');
      out.print( comboValue );
      out.write("</option>\r\n");

			}
		}

      out.write("\r\n");
      out.write("\t\t</select>\r\n");
      out.write("\t</td>\r\n");
      out.write("\t</tr>\r\n");
      out.write("\r\n");
      out.write("\t<tr>\r\n");
      out.write("\t<td colspan=\"2\" align=\"right\" valign=\"middle\" nowrap=\"nowrap\">\r\n");
      out.write("\t<textarea id=\"description\" readonly=\"readonly\" cols=\"40\" rows=\"3\">");
      out.print( (actionComboDescSel != null ? actionComboDescSel : "") );
      out.write("\r\n");
      out.write("\t</textarea>\r\n");
      out.write("\t</td>\r\n");
      out.write("\t</tr>\r\n");
      out.write("\t</table>\r\n");

	}
}

if (batchButton == null) {

      out.write("\r\n");
      out.write("<center><font color=\"#FF0000\"><i><b>DocAction - No Options.</b></i></font></center>\r\n");

}

      out.write("\r\n");
      out.write("<!-- bottomMenu -->\r\n");
      out.write("<div class=\"bottomMenuBoth\">\r\n");
      out.write("<table>\r\n");
      out.write("<tr>\r\n");

	if (batchButton != null) {

      out.write("\r\n");
      out.write("\t<td class=\"left\"><input type=\"image\" src=\"");
      out.write((java.lang.String) org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate("${pageContext.request.contextPath}", java.lang.String.class, (PageContext)_jspx_page_context, null, false));
      out.write("/ampiere/images/Process32.png\" onClick=\"startProcess('true');\" alt=\"");
      out.print( batchButton );
      out.write("\" />\r\n");
      out.write("\t</td>\r\n");

	}else{ //clmg 2009/02/24

      out.write("\r\n");
      out.write("\t<td class=\"left\">&nbsp;</td>\r\n");
		
	}

      out.write("\r\n");
      out.write("\t<td class=\"right\">\r\n");
      out.write("\t<input id=\"ok\" type=\"image\" src=\"");
      out.write((java.lang.String) org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate("${pageContext.request.contextPath}", java.lang.String.class, (PageContext)_jspx_page_context, null, false));
      out.write("/ampiere/images/Ok32.png\" onclick=\"startProcess('false');\" alt=\"");
      if (_jspx_meth_bean_write_2(_jspx_page_context))
        return;
      out.write("\"/>\r\n");
      out.write("\t<span>OK</span>\r\n");
      out.write("\t<input id=\"cancel\" type=\"image\" src=\"");
      out.write((java.lang.String) org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate("${pageContext.request.contextPath}", java.lang.String.class, (PageContext)_jspx_page_context, null, false));
      out.write("/ampiere/images/Cancel32.png\" onclick=\"window.close();return false;\" alt=\"");
      if (_jspx_meth_bean_write_3(_jspx_page_context))
        return;
      out.write("\"/>\r\n");
      out.write("\t<span>キャンセル</span>\r\n");
      out.write("</td>\r\n");
      out.write("</tr>\r\n");
      out.write("</table>\r\n");
      out.write("</div>\r\n");
      out.write("<!-- /bottomMenu -->\r\n");
      out.write("\r\n");
      out.write("</div>\r\n");
      out.write("<!-- /body -->\r\n");
      out.write("\r\n");
      out.write("<!-- footer -->\r\n");
      out.write("<!-- /footer -->\r\n");
      out.write("\r\n");
      out.write("</body>\r\n");
      out.write("</html>\r\n");
    } catch (Throwable t) {
      if (!(t instanceof SkipPageException)){
        out = _jspx_out;
        if (out != null && out.getBufferSize() != 0)
          out.clearBuffer();
        if (_jspx_page_context != null) _jspx_page_context.handlePageException(t);
      }
    } finally {
      if (_jspxFactory != null) _jspxFactory.releasePageContext(_jspx_page_context);
    }
  }

  private boolean _jspx_meth_bean_write_0(PageContext _jspx_page_context)
          throws Throwable {
    PageContext pageContext = _jspx_page_context;
    JspWriter out = _jspx_page_context.getOut();
    //  bean:write
    org.apache.struts.taglib.bean.WriteTag _jspx_th_bean_write_0 = (org.apache.struts.taglib.bean.WriteTag) _jspx_tagPool_bean_write_property_name_nobody.get(org.apache.struts.taglib.bean.WriteTag.class);
    _jspx_th_bean_write_0.setPageContext(_jspx_page_context);
    _jspx_th_bean_write_0.setParent(null);
    _jspx_th_bean_write_0.setName("buttonActionForm");
    _jspx_th_bean_write_0.setProperty("title");
    int _jspx_eval_bean_write_0 = _jspx_th_bean_write_0.doStartTag();
    if (_jspx_th_bean_write_0.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE)
      return true;
    _jspx_tagPool_bean_write_property_name_nobody.reuse(_jspx_th_bean_write_0);
    return false;
  }

  private boolean _jspx_meth_html_hidden_0(PageContext _jspx_page_context)
          throws Throwable {
    PageContext pageContext = _jspx_page_context;
    JspWriter out = _jspx_page_context.getOut();
    //  html:hidden
    org.apache.struts.taglib.html.HiddenTag _jspx_th_html_hidden_0 = (org.apache.struts.taglib.html.HiddenTag) _jspx_tagPool_html_hidden_property_name_nobody.get(org.apache.struts.taglib.html.HiddenTag.class);
    _jspx_th_html_hidden_0.setPageContext(_jspx_page_context);
    _jspx_th_html_hidden_0.setParent(null);
    _jspx_th_html_hidden_0.setName("buttonActionForm");
    _jspx_th_html_hidden_0.setProperty("windowNo");
    int _jspx_eval_html_hidden_0 = _jspx_th_html_hidden_0.doStartTag();
    if (_jspx_th_html_hidden_0.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE)
      return true;
    _jspx_tagPool_html_hidden_property_name_nobody.reuse(_jspx_th_html_hidden_0);
    return false;
  }

  private boolean _jspx_meth_html_hidden_1(PageContext _jspx_page_context)
          throws Throwable {
    PageContext pageContext = _jspx_page_context;
    JspWriter out = _jspx_page_context.getOut();
    //  html:hidden
    org.apache.struts.taglib.html.HiddenTag _jspx_th_html_hidden_1 = (org.apache.struts.taglib.html.HiddenTag) _jspx_tagPool_html_hidden_property_name_nobody.get(org.apache.struts.taglib.html.HiddenTag.class);
    _jspx_th_html_hidden_1.setPageContext(_jspx_page_context);
    _jspx_th_html_hidden_1.setParent(null);
    _jspx_th_html_hidden_1.setName("buttonActionForm");
    _jspx_th_html_hidden_1.setProperty("columnName");
    int _jspx_eval_html_hidden_1 = _jspx_th_html_hidden_1.doStartTag();
    if (_jspx_th_html_hidden_1.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE)
      return true;
    _jspx_tagPool_html_hidden_property_name_nobody.reuse(_jspx_th_html_hidden_1);
    return false;
  }

  private boolean _jspx_meth_html_hidden_2(PageContext _jspx_page_context)
          throws Throwable {
    PageContext pageContext = _jspx_page_context;
    JspWriter out = _jspx_page_context.getOut();
    //  html:hidden
    org.apache.struts.taglib.html.HiddenTag _jspx_th_html_hidden_2 = (org.apache.struts.taglib.html.HiddenTag) _jspx_tagPool_html_hidden_styleId_property_name_nobody.get(org.apache.struts.taglib.html.HiddenTag.class);
    _jspx_th_html_hidden_2.setPageContext(_jspx_page_context);
    _jspx_th_html_hidden_2.setParent(null);
    _jspx_th_html_hidden_2.setStyleId("Process_ID");
    _jspx_th_html_hidden_2.setName("buttonActionForm");
    _jspx_th_html_hidden_2.setProperty("processId");
    int _jspx_eval_html_hidden_2 = _jspx_th_html_hidden_2.doStartTag();
    if (_jspx_th_html_hidden_2.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE)
      return true;
    _jspx_tagPool_html_hidden_styleId_property_name_nobody.reuse(_jspx_th_html_hidden_2);
    return false;
  }

  private boolean _jspx_meth_bean_write_1(PageContext _jspx_page_context)
          throws Throwable {
    PageContext pageContext = _jspx_page_context;
    JspWriter out = _jspx_page_context.getOut();
    //  bean:write
    org.apache.struts.taglib.bean.WriteTag _jspx_th_bean_write_1 = (org.apache.struts.taglib.bean.WriteTag) _jspx_tagPool_bean_write_property_name_nobody.get(org.apache.struts.taglib.bean.WriteTag.class);
    _jspx_th_bean_write_1.setPageContext(_jspx_page_context);
    _jspx_th_bean_write_1.setParent(null);
    _jspx_th_bean_write_1.setName("buttonActionForm");
    _jspx_th_bean_write_1.setProperty("title");
    int _jspx_eval_bean_write_1 = _jspx_th_bean_write_1.doStartTag();
    if (_jspx_th_bean_write_1.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE)
      return true;
    _jspx_tagPool_bean_write_property_name_nobody.reuse(_jspx_th_bean_write_1);
    return false;
  }

  private boolean _jspx_meth_bean_write_2(PageContext _jspx_page_context)
          throws Throwable {
    PageContext pageContext = _jspx_page_context;
    JspWriter out = _jspx_page_context.getOut();
    //  bean:write
    org.apache.struts.taglib.bean.WriteTag _jspx_th_bean_write_2 = (org.apache.struts.taglib.bean.WriteTag) _jspx_tagPool_bean_write_property_name_nobody.get(org.apache.struts.taglib.bean.WriteTag.class);
    _jspx_th_bean_write_2.setPageContext(_jspx_page_context);
    _jspx_th_bean_write_2.setParent(null);
    _jspx_th_bean_write_2.setName("buttonActionForm");
    _jspx_th_bean_write_2.setProperty("submitBtnTitle");
    int _jspx_eval_bean_write_2 = _jspx_th_bean_write_2.doStartTag();
    if (_jspx_th_bean_write_2.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE)
      return true;
    _jspx_tagPool_bean_write_property_name_nobody.reuse(_jspx_th_bean_write_2);
    return false;
  }

  private boolean _jspx_meth_bean_write_3(PageContext _jspx_page_context)
          throws Throwable {
    PageContext pageContext = _jspx_page_context;
    JspWriter out = _jspx_page_context.getOut();
    //  bean:write
    org.apache.struts.taglib.bean.WriteTag _jspx_th_bean_write_3 = (org.apache.struts.taglib.bean.WriteTag) _jspx_tagPool_bean_write_property_name_nobody.get(org.apache.struts.taglib.bean.WriteTag.class);
    _jspx_th_bean_write_3.setPageContext(_jspx_page_context);
    _jspx_th_bean_write_3.setParent(null);
    _jspx_th_bean_write_3.setName("buttonActionForm");
    _jspx_th_bean_write_3.setProperty("closeBtnTitle");
    int _jspx_eval_bean_write_3 = _jspx_th_bean_write_3.doStartTag();
    if (_jspx_th_bean_write_3.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE)
      return true;
    _jspx_tagPool_bean_write_property_name_nobody.reuse(_jspx_th_bean_write_3);
    return false;
  }
}
