<?php

function timeoutOption($secs$default)
{
    echo 
"            <option value=\"$secs\"";
        if ((!isset(
$GLOBALS['timeout']) && $default) ||
          ((isset(
$GLOBALS['timeout']) && $GLOBALS['timeout'] == $secs)))
          echo 
" selected";
        echo 
">$secs secs</option>\n";
}

function 
commonHeader()
{
?>
</head>
<body link="#FFFF00" vlink="#CCCC00" bgcolor="#000000" text="#FFFFFF" alink="#FFFFFF">
  <font face="Arial">

  <table width="100%" border="0" cellspacing="0">

    <tr>
      <td colspan="2">
        <a href="gs.php">
          <img src="pirate.gif" align="center" border=0>
        </a>
        <font size="+2" color="#FFFFFF">
          <b><i>Cap'n Bry's gnutella search</i></b>
        </font>
      </td>
    </tr>

    <tr bgcolor="#FFCC00"><td height="2" colspan="2"><img src="/images/1x1.gif"></td></tr>

    <!-- Based on CapnBry's PHP gnutella search -->
    <form action="gs.php" method="GET">
    <tr>
      <td colspan="2" valign="center" bgcolor="#000066" height="35">
          Pretend to search for:
          <input type="text" value="<?php if (isset($GLOBALS['query'])) echo $GLOBALS['query'?>" name="query" size="30">

          Server timeout
          <select name="timeout">
<?php
    timeoutOption
(100);
    
timeoutOption(300);
    
timeoutOption(601);
    
timeoutOption(900);
    
timeoutOption(1200);
    
timeoutOption(1800);
?>        
          </select>

          <input type="image" src="search_btn.gif" border=0>
      </td>
    </tr>
    </form>

    <tr bgcolor="#FFCC00"><td height="2" colspan="2"><img src="/images/1x1.gif"></td></tr>
  </table>

  <table align="left" border=0 cellspacing=0>
    <tr>
      <td valign="top" width="120">
        <font size="-1">
          <br>
          <img src="arrow.gif" width="6" height="11">
            <a href="dl_help.php">Problems downloading?</a><br>
          <img src="arrow.gif" width="6" height="11">
            <a href="links.php">Links</a><br>
          <img src="arrow.gif" width="6" height="11">
            <a href="protocol.php">The protocol</a><br>
          <img src="arrow.gif" width="6" height="11">
            <a href="ss.php">Screenshots</a><br>
          <img src="arrow.gif" width="6" height="11">
            <a href="my_client.php">My clone</a><br>
          <img src="arrow.gif" width="6" height="11">
            <a href="gs_source.php">PHP source</a><br>
          <hr width="80%">
          <img src="arrow.gif" width="6" height="11">
            <a href="srch_stats.html">Search stats</a><br>
        </font>
      </td>
    </tr>
  </table>

  <!-- Begin content pane -->
  <table>
    <tr><td>
<?php
}

function 
commonFooter()
{
?>
    </td></tr>
  </table>      
  <!-- End content pane -->
  
  <table width="100%" border=0 cellspacing=0>
    <tr bgcolor="#FFCC00"><td height="2"><img src="/images/1x1.gif"></td></tr>

    <tr>
      <td>
        <a href="mailto:bmayland@leoninedev.SPAM.com">Email CapnBry</a>
          <font size="-1"><i>remove spam from the address for it to work</i></font>
      </td>
    </tr>

    <tr>
      <td>
        <a href="gs.php">Home</a>
        <b> | </b>
        <a href="/">Other things on linus</a>
      </td>
    </tr>

  </table>
  </font>

  <center>
  <font face="Arial" size="-1" color="#999999">CapnBry's PHP Gnutella search v0.4 - See source code for licensing information</font>
  </center>
  
</body>
</html>
<?php
}

?>