
// figure out the base URL of this page and use it in the following methods.
var baseURL = location.href.substring( 0, location.href.lastIndexOf("encoder/") );

function shortcutIcon() {
   document.writeln('<link rel="shortcut icon" href="' + baseURL + 'images_encoder/srsicon16.png">') ;
}

function encoderArticleHeader( title, author) {
   shortcutIcon() ;
   // document.writeln('<LINK rel=stylesheet type="text/css" href="../_common_files/encoder.css">') ;
   document.writeln(
         '<title>' + title + '</title>',
         '</head>',
         '',
         '<body background="' + baseURL + 'images_encoder/srs-bkgnd.gif" bgcolor="#C0C0C0" bgproperties="fixed">'
         ) ;
   encoderLogo() ;
   googleSearch() ;
   if( author == undefined )
      document.writeln( '<center><hr width="80%"><p><h1>'+title+'</h1></center>' )
   else
      document.writeln( '<center><hr width="80%"><p><h1>'+title+'</h1><h3>by</h3><h2>'+author+'</h2></center>' )
}

function encoderHeader( title ) {
   shortcutIcon() ;
   // document.writeln('<LINK rel=stylesheet type="text/css" href="../_common_files/encoder.css">') ;
   document.writeln(
         '<title>' + title + '</title>',
         '</head>',
         '',
         '<body background="' + baseURL + 'images_encoder/srs-bkgnd.gif" bgcolor="#C0C0C0" bgproperties="fixed">'
         ) ;
   encoderLogo() ;
   googleSearch() ;
   tableTitle( title ) ;
}

function encoderHeaderMain( title ) {
   shortcutIcon() ;
   document.writeln(
         '<title>' + title + '</title>',
         '</head>',
         '',
         '<body background="' + baseURL + 'images_encoder/srs-bkgnd.gif" bgcolor="#C0C0C0" bgproperties="fixed">'
         ) ;
   encoderLogo() ;
   googleSearch() ;
   document.writeln( '<table border="1" cellspacing="3" cellpadding="5">')
}

function encoderLogo() {
   document.writeln(
         '<!--webbot bot="Include" u-include="issuenav.html" tag="BODY" startspan -->',
         '<table border="0" width="100%">',
         '   <tbody>',
         '      <tr>',
         '         <td>',
         '            <a href="' + baseURL + 'encoder/">',
         '               <img src="' + baseURL + 'images_encoder/encoder-small.gif" alt="Encoder Front Page" border="0" width="309" height="134"></a>',
         '         </td>',
         '         <td>',
         '            <table border="0">',
         '               <tbody>',
         '                  <tr>',
         '                     <td><b><font face="Verdana">',
         '                              <a href="http://www.seattlerobotics.org">SRS Web-Home</a> &nbsp;  &nbsp; ',
         '                     </font></b></td>',
         '                     <td><b><font face="Verdana">',
         '                              <a href="' + baseURL + 'encoder/index.html">Encoder Main</a>',
         '                     </font></b></td>',
         '                  </tr>',
         '                  <tr>',
         '                     <td><b><font face="Verdana">',
         '                              <a href="' + baseURL + 'encoder/encoder_index.html">Article Index </a>',
         '                     </font></b></td>',
         '                     <td><b><font face="Verdana">',
         '                              <a href="' + baseURL + 'encoder/wguide.html">Writers Guide</a>',
         '                     </font></b></td>',
         '                  </tr>',
         '               </tbody>',
         '            </table>',
         '         </td>',
         '      </tr>',
         '   </tbody>',
         '</table>'
         )
   }

function googleSearch() {
   document.writeln(
         '<!-- Search Google -->',
         '<form method="get" action="http://www.google.com/custom">',
         '   <input type="hidden" name="cof" ',
         '   value="LW:418;L:http://www.seattlerobotics.org/srs-logo-color.gif;LH:171;AH:left;AWFID:d7083ff0f45c68f2;">',
         '   <input type="hidden" name="domains" value="seattlerobotics.org">',
         '   <div align="center">',
         '      <center>',
         '         <table cellspacing="0" border="0">',
         '            <tbody>',
         '               <tr valign="top">',
         '                  <td>',
         '                     <a href="http://www.google.com/search">',
         '                        <img src="' + baseURL + 'images_encoder/google_logo_40wht.gif" border="0" alt="Google" align="middle" width="128" height="53"></a>',
         '                  </td>',
         '                  <td>',
         '                     <input type="text" name="q" size="31" maxlength="255" value=""> ',
         '                     <input type="submit" name="sa" value="Google Search"> ',
         '                     <font face="arial,sans-serif" size="-1"><br>',
         '                        <input type="radio" name="sitesearch" value=""> ',
         '                        Search WWW ',
         '                        <input type="radio" name="sitesearch" value="seattlerobotics.org" checked="checked"> ',
         '                        Search seattlerobotics.org ',
         '                     </font><br>',
         '                  </td>',
         '               </tr>',
         '            </tbody>',
         '         </table>',
         '      </center>',
         '   </div>',
         '</form>'
         )
   }

function tableTag() {
   document.writeln(
         '<table border="1" width="100%" cellspacing="3" cellpadding="5">'
         ) ;
} // end of tableTag()

function tableTitle( title ) {
   tableTag() ;
   document.writeln(
         '<tr>',
         '<td width="25%"> <font size="6"><b><u>Inside...</u></b></font> </td>',
         '<td> <font size="6"><b>' + title + '</b></font> </td>',
         '</tr>'
         ) ;
} // end of tableTitle()

function tableScheduledEvents() {
   tableTag() ;
   document.writeln(
         '<table border="1" width="100%" cellspacing="3" cellpadding="5">',
         '   <tr>',
         '      <td width="25%"><font size="6"><b><u>Scheduled Events</u></b></font>',
         '      </td>',
         '      <td><b>Here is a list of upcoming events and tech sessions</b>',
         '      </td>',
         '   </tr>'
         )
} // end of tableScheduledEvents()

function tableHotLinks() {
   tableTag() ;
   document.writeln(
         '<tr>',
         '   <td width="25%"><font size="6"><b><u>Hot Links</u></b></font></td>',
         '   <td><b>Here are this months list of interesting links. If you find a cool',
         '         one, send it to us and we will add it to the list of Hot Links. This list will change each',
         '         month.</b></td>',
         '</tr>'
         )
} // end of tableHotLinks()

function encoderFooter() {
   document.writeln(
         '<h1> SRS Encoder Info </h1>'
         ) ;

   tableTag() ;
   document.writeln(
         '   <tbody>',
         '      <tr>',
         '         <td width="25%"><a href="' + baseURL + 'guide/index.html">',
         '               Standard Technologies of the Seattle Robotics Society</a>',
         '         </td>',
         '         <td>Just getting started? You might like to check out this link that documents',
         '            some of the standard technologies that the Seattle Robotics Society suggests for those',
         '            just starting out. This article explains a lot of different aspects about building a',
         '            robot. Have a look!',
         '         </td>',
         '      </tr>',
         '      <tr>',
         '         <td><font color="#ff0000" size="5">Authors Needed!</font>',
         '         </td>',
         '         <td>The Encoder is actively seeking authors to help write the Encoder. The key',
         '            to growing in this hobby is communicating your experiences to others. The Seattle Robotics',
         '            Society Encoder is one of the premier resources for amateur robotics on the Internet. Each',
         '            issue is read by thousands of people around the world. Please consider sharing ideas with',
         '            us. Check out ',
         '            <a href="' + baseURL + 'encoder/wguide.html">The Encoder Writers Guide</a> ',
         '            for information about how you can help spread the excitement!',
         '         </td>',
         '      </tr>',
         '   </tbody>',
         '</table>'
         ) ;
   encoderEmail() ;
   lastModified() ;

} // end of encoderFooter()

function encoderEmail() {
   document.writeln(
         '<p>For information about submissions or comments about the online Encoder,',
         'contact the Encoder Editor at <img src="' + baseURL + 'images_encoder/editor.png">. (We have ',
               'this as an image to avoid automated spam)',
         '</p>'
         ) ;
} // end of encoderEmail()

function lastModified() {
   document.writeln(
         '<hr width="80%">',
         '<center><small><em>Last updated: ' )
            document.writeln(document.lastModified)
            document.writeln('</em></small></center><p>')
} // end of lastModified()

