// alphaselect2000j - js file for loading page header and site nav map


function page_headers () {
  
  pages  = new Array ( );
  pages [ 0 ] = "index";
  pages [ 1 ] = "web";
  pages [ 2 ] = "examples";
  pages [ 3 ] = "further";
  pages [ 4 ] = "contact";
  pages [ 5 ] = "cgi";

  paget  = new Array ( );
  paget [ 0 ] = "Home Page";
  paget [ 1 ] = "Web Services";
  paget [ 2 ] = "Example Sites";
  paget [ 3 ] = "Further Services";
  paget [ 4 ] = "Contact";
  paget [ 5 ] = "Reply from Server";

  var line;
  var counter;
  var temp;
  var page_no = -1;
  var pt = window.location.pathname;
  for ( counter = 0; counter < 6; counter++ ) {
    temp = window.location.pathname.lastIndexOf ( pages [ counter ] );
    if ( temp > -1 ) { page_no = counter; break; }
  }
  // case of no final page name cos index page
  var site_map = 1;
  if ( page_no == -1 ) {
    page_no = 0;
    counter = 0;
  }

  // case of cgi reply
  var site_map = 1;
  if ( page_no == 5 ) site_map = 0;

  line = "<p >";
  line += "<table border=0 width=100% >";
  line += "  <tr><td rowspan=3 width=40% >";
  if ( page_no != 5 ) 
//    line += "  <a onclick=\"this.blur ();\" href=\"./\" >";
    line += "  <a onclick=\"this.blur ();\" href=\"./\" >";
else
    line += "  <a onclick=\"this.blur ();\" href=\"../\" >";
//  line += "    <img src=\"/as2klogo.gif\" width=95% align=top ";
  line += "    <img src=\"/as2klogo.gif\" width=95% align=top ";
  line += "         border=\"0\" alt=\"AlphaSelect 2000\" > ";
//  if ( page_no != 5 ) 
    line += "  <\a>";
  line += "    </td> <td height=0 > <br> </td></tr>";
  line += "  <tr><td align=left >";
  line += "     <font color=darkgreen size=4 > <b>";
  line += paget [ page_no ];
  line +=                                         "</b></font></td></tr>";
  line += "  <tr height=0 > <td> <br> </td></tr>";
  line += "</table>";
  line += "</p>";
  document.write ( line );

  paget [ 0 ] = "Home";

  line  = "<p>";
if ( site_map > 0 ) {
  line += "<table border=3 bordercolor=blue width=100% >";
  line += "  <tr><td>";
  line += "    <table border=0 cellspacing=8 >";
  line += "      <tr>";
  line += "	<td colspan=5 > <H3 align=center >";
  line += "           <font color=blue > Site Navigation Map </td>";
  line += "      </tr>";
  line += "      <tr>";
  for ( counter = 0; counter < 5; counter++ ) {
    line += "	<td bgcolor=#cc99ff height=60 width=200 align=center>";
    if ( page_no == counter ) {
      line += "	    <font color=white > <b> ";
      line += paget [ counter ];
      line +=                                "</b> </td>";
    }
    else {
      line += "	<a onclick=\"this.blur ();\" href=";
      line += pages [ counter ];
      line += ".html > ";
      line += paget [ counter ];
      line += " </a></td>";
    }
  }
  line += "      </tr>";
  line += "    </table>";
  line += "  </td></tr>";
  line += "</table>";
} // end if ( site_map > 0 )
  line += "<table>";
  line += "<tr><td height=4 ></td></tr>";
  line += "</table>";
  line += "</P>";
  line += "<font color=black >";

  document.write ( line );

}


function vlog () {
  
  var line  = "<img height=\"1\" width=\"1\" src=\"/cgi-bin/vlog.pl\?";
  var loc   = document.location;
  var rfrr  = document.referrer;
      line += "loc=";
      line += loc;
      line += "\&";
      line += "rfrr=";
      line += rfrr;
      line += "\" >";
  document.write ( line );

} // end function vlog ()
