<%--
  Copyright 2003 Sun Microsystems, Inc. All rights reserved 
  Use is subject to license terms.
 --%>
<%-- @(#)searchContent.jsp --%>

<%@page language= "java" import="com.sun.portal.search.providers.SearchRequestBean" %>

<%@page errorPage="error.jsp" %>

<%@ taglib uri="/tld/jx.tld" prefix="jx" %>

<jsp:include page="psSearch.jsp" flush="true"/>

<% String processRating = request.getParameter("process_rating");
   if (processRating != null && processRating.equals("y")) { %>
      <jsp:include page="processRating.jsp" flush="true"/>
<% } %>

<% String mode = ""; %>
<jx:choose>
<jx:when test="$defaultMode == 'adv'">
    <% mode = "adv"; %>
</jx:when>
<jx:when test="$defaultMode == 'browse'">
    <% mode = "browse"; %>
</jx:when>
<jx:otherwise>
    <% mode = "basic"; %>
</jx:otherwise>
</jx:choose>

<% if (request.getParameter("mode") != null) { %>
    <% mode = request.getParameter("mode"); %>
<% } %>

<jsp:useBean id="formbean" class="com.sun.portal.search.providers.SearchRequestBean" scope= "request" >
<jsp:setProperty name="formbean" property="*"/>
</jsp:useBean>

<jsp:setProperty name="formbean" property="mode" value="<%=mode%>"/>

<FORM NAME="searchform" METHOD=GET ENCTYPE="application/x-www-form-urlencoded">
<INPUT type=HIDDEN name="page" value="1">

<jsp:include page="searchMenu.jsp" flush="true"/>

<% if (formbean.getMode().equals("adv")) { %>
    <jsp:include page="advancedSearch.jsp" flush="true"/>
<% } else { %>
    <jsp:include page="basicSearch.jsp" flush="true"/>
<% } %>

<INPUT type=HIDDEN name="process_rating" value="n">
<INPUT type=HIDDEN name="rating_database" value="">
<INPUT type=HIDDEN name="rating_url" value="">
<INPUT type=HIDDEN name="new_rating" value="">
<INPUT type=HIDDEN name="num_rating" value="">
<INPUT type=HIDDEN name="sum_rating" value="">
<INPUT type=HIDDEN name="peak_rating" value="">

<script language="JavaScript1.2">
function rating_submit(database, url, selectName, numRating, sumRating, peakRating) {
    document.forms['searchform'].process_rating.value = "y";
    document.forms['searchform'].rating_database.value = database;
    document.forms['searchform'].rating_url.value = url;
    document.forms['searchform'].new_rating.value = document.forms['searchform'].elements[selectName].value;
    document.forms['searchform'].num_rating.value = numRating;
    document.forms['searchform'].sum_rating.value = sumRating;
    document.forms['searchform'].peak_rating.value = peakRating;
    document.forms['searchform'].submit();
}
</script>

<% if (formbean.getMode().equals("browse")) { %>
    <jsp:include page="browseOnly.jsp" flush="true"/>
<% } %>

<jx:declare id="categorySearch" type="java.lang.Boolean"/>
<% if (!formbean.getScope().equals("") && categorySearch.booleanValue()) { %>
    <jsp:include page="browseSearch.jsp" flush="true"/>
    <HR>
<% } %>

<% if (!formbean.getScope().equals("") || (formbean.getMode().equals("browse") && !formbean.getBrowseCategory().equals("ROOT"))) { %>
    <jsp:include page="searchOnly.jsp" flush="true"/>
    <HR>
<% } %>

<% if (!formbean.getScope().equals("") || formbean.getMode().equals("browse")) { %>
    <jsp:include page="pageFooter.jsp" flush="true"/>
<% } %>

</FORM>

