<%@ page import="com.google.common.base.Charsets" %>
<%@ page import="com.google.common.base.Strings" %>
<%@ page import="java.net.URLEncoder" %>
<%--
  Created by IntelliJ IDEA.
  User: ulir
  Date: 9/27/12
  Time: 7:05 PM
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>B1 Search</title>
</head>
<body>

<%
    String url = "http://search.b1.org/?";
    if (Strings.isNullOrEmpty(request.getParameter("chid"))) {
        url += "bsrc=4sxxr&chid=c918269&q=" + URLEncoder.encode(Strings.nullToEmpty(request.getParameter("q")), Charsets.UTF_8.name());
    } else {
        url += Strings.nullToEmpty(request.getQueryString());
    }
%>
<script type="text/javascript">
    window.location.href = "<%=url%>";
</script>

</body>
</html>