/**
   * gets the redirect URL as workaround for opening a new window or refreshing a window (Noscript
   * version)
   */
  private String getWindowOpener() {
    String result = "";
    IServiceStateInfo stateInfo = ContextProvider.getStateInfo();
    WebForm activeForm = FormManager.getActive();

    WebForm[] allForms = FormManager.getAll();
    boolean finished = false;
    for (int i = 0; !finished && i < allForms.length; i++) {
      WebForm form = allForms[i];
      IFormAdapter formAdapter = WebFormUtil.getFormAdapter(form);
      if (stateInfo.isExpired()) {
        if (!formAdapter.getWindowOpenerBuffer().equals("")) {
          result = formAdapter.getWindowOpenerBuffer();
          finished = true;
        }
      } else {
        if (WebComponentControl.openInNewWindow(form) || WebComponentControl.refreshWindow(form)) {
          result =
              "<meta http-equiv=\"refresh\" content=\"0; url="
                  + RenderUtil.createEncodedFormGetURL(form)
                  + "\">";
          formAdapter.addWindowOpenerBuffer(result);
          NoscriptFormStack.getInstance().push(activeForm);
          finished = true;
        } else {
          formAdapter.addWindowOpenerBuffer("");
        }
      }
    }
    return result;
  }
 /** renders the basic html structure of the head of a page, which is the same in every page */
 StringBuffer createPageHeader() {
   StringBuffer html = new StringBuffer();
   String ieSpecial = "";
   if (W4TContext.getBrowser() instanceof Ie) {
     ieSpecial =
         "<!-- InternetExplorer special --><script>"
             + "</script><!-- End InternetExplorer special -->";
   }
   html.append(HTML.DOCTYPE_4_0_TRANSITIONAL);
   html.append("<html><head>");
   WebFormUtil.renderTitle(html, WebFormUtil.getWindowTitle());
   html.append(createCssClasses());
   createCssReferences(html);
   html.append(getWindowOpener());
   html.append(" ");
   html.append(getWindowCloser());
   WebFormUtil.renderContentType(html);
   WebFormUtil.renderCacheControl(html);
   html.append(" ");
   html.append(ieSpecial);
   html.append(WebFormUtil.renderFavIcon());
   html.append("</head>");
   html.append("<body ");
   html.append(getBodyAttributes());
   html.append(">");
   html.append(WebFormUtil.createOpenForm());
   return html;
 }