<%@page language="java" %>
<%@page import="com.sun.web.ui.common.CCI18N" %>
<%@page import="java.net.URL" %>
<%@page import="java.net.URLEncoder" %>

<%
  String pageName = request.getParameter("pageName");
  String devName  = request.getParameter("devName");
  String fruName  = request.getParameter("fruName");

  if (pageName == null) pageName = "NULL";
  if (devName == null)  devName  = "NULL";
  if (fruName == null)  fruName  = "NULL";

  // Params from the URL.
  String appName = (request.getParameter("appName") != null)
    ? request.getParameter("appName") : "";
  if (appName == null || appName.equals("")) {
    appName = request.getContextPath();
    if (appName == null) {
      appName = "";
    } else if (appName.startsWith("/")) {
      appName = appName.substring(1);
    }
  }

  String windowTitle = (request.getParameter("windowTitle") != null)
    ? new String(request.getParameter("windowTitle").
      getBytes(CCI18N.ISO_ENCODING), CCI18N.UTF8_ENCODING) : "";

  // This param is used in several places; use a var rather than encoding it
  // multiple times.
  String windowTitleEncoded =
    "windowTitle=" + URLEncoder.encode(windowTitle, CCI18N.UTF8_ENCODING);

  StringBuffer buffer = new StringBuffer();

  // src value for the Masthead frame.
  buffer.append("/" + appName + "/serviceadvisor/Masthead?pageTitle=");
  buffer.append(URLEncoder.encode("page.title.serviceAdvisor", CCI18N.UTF8_ENCODING));

  String mastheadSrc = buffer.toString();

  buffer = new StringBuffer();

  // src value for the Navigator frame.
  buffer.append("/" + appName + "/reports/ServiceTree?pageTitle=");
  buffer.append(URLEncoder.encode("page.title.serviceAdvisor", CCI18N.UTF8_ENCODING));
  buffer.append("&amp;pageName=");
  buffer.append(URLEncoder.encode(pageName, CCI18N.UTF8_ENCODING));
  buffer.append("&amp;devName=");
  buffer.append(URLEncoder.encode(devName, CCI18N.UTF8_ENCODING));
  buffer.append("&amp;fruName=");
  buffer.append(URLEncoder.encode(fruName, CCI18N.UTF8_ENCODING));

  String navigatorSrc = buffer.toString();

  // src value for the ButtonNav frame.
  buffer = new StringBuffer();
  buffer.append("/" + appName + "/serviceadvisor/ButtonNav");

  String buttonNavSrc = buffer.toString();

  // src value for the Content frame.
  String contentSrc = "";

%>

