/* qlunix.js - unix quick link menu - 2007.09.10 - 2006.06.29 */

function view($pg){
 var $loc = 'http://geoffair.net/unix/'+$pg;
 window.location.href=$loc;
}

function item( lnk, dsc, fd )
{
 this.lnk = lnk;
 this.dsc = dsc;
 this.fd = fd;
}

function QuickLinks()
{
 var n, max;
 var $dir = location.href.substring(0,location.href.lastIndexOf('/')+1);
 var $fn = location.href.substring($dir.length,location.href.length+1);
 if ($fn.length == 0) {
     $fn = "index.htm";
 }
 var ma = new Array(
	new item( "index.htm", "2006/06/29", "unix and GNU" ),
	new item( "commands.htm", "2009/04/22", "Personal commands used" ),
	new item( "automake.htm", "2009/04/22", "GNU Automake tools" ),
	new item( "tar-01.htm", "2008/08/17", "Games with TAR" ),
	new item( "grep.htm", "2008/06/03", "Games with GREP" ),
	new item( "ubuntu-08.htm", "2011/08/06", "Nautilus Bug!" ),
	new item( "ubuntu-05.htm", "2008/08/17", "Ubuntu Start Again" ),
	new item( "ubuntu-04.htm", "2008/06/10", "Ubuntu Gnome Gaffs, Kubunut" ),
	new item( "ubuntu-03.htm", "2008/05/01", "Ubuntu Some Issues" ),
	new item( "ubuntu-02.htm", "2008/04/21", "Ubuntu Terminals" ),
	new item( "ubuntu-01.htm", "2008/04/18", "Ubuntu Installation" ),
	new item( "unix7.htm", "2006/05/31", "Unix Commands" ),
	new item( "unix6.htm", "2006/04/23", "Unix Shell Scripting" ),
	new item( "unix5.htm", "2006/01/29", "ubuntu distribution" ),
	new item( "unix4.htm", "2006/01/18", "Unix/Linux Distributions" ),
	new item( "unix2.htm", "2005/11/18", "Compiling in GNU" ),
	new item( "unix1.htm", "2005/12/30", "UNIX, in ALL its forms" )
 );
 max = ma.length;
 document.writeln("<table width=\"100%\">");
 document.writeln("<tr><td align=\"center\">");
 document.writeln("<form method=\"post\" name=\"tops\" action=\"\">");
 document.writeln("<b>Quick Links</b> ");
 document.writeln("<select name=\"tops\">");
 var $selnx = -1;
 for( n = 0; n < max; n++ ) {
  if (ma[n].lnk == $fn) {
   n++;
   if( n == max ) n = 0;
   $selnx = n;
   break;
  }
 }
 if ($selnx == -1) {
     $selnx = 1;
 }

 for( n = 0; n < max; n++ ) {
  var $opt = "<option value=\"" + ma[n].lnk;
  if( $selnx == n ) {
   $opt += "\" selected>";
  } else {
   $opt += "\">";
  }
  $opt += (ma[n].fd + " (" + ma[n].lnk + ")");
  document.writeln($opt);
  document.writeln("</option>");
 }
 document.writeln("</select>");
 document.write("<input type=\"button\" value=\"Go\" onClick=\"view(document.tops.tops[document.tops.tops.selectedIndex].value)\" name=\"button\">");
 document.writeln(" Current is [<b>" + $fn + "</b>]");
 document.writeln("</form>");
 document.writeln("</td></tr>");
 document.writeln("</table>");
}

function ModifiedDate() {
 var month = new Array("January","February","March","April","May","June","July",
					  "August","September","October","November","December");
 var updated = new Date(document.lastModified);
 var Month   = month[updated.getMonth()];
 var Day     = updated.getDate();
 var Year    = updated.getYear();
 var Hour    = updated.getHours();
 var Min     = updated.getMinutes();
 if( Year < 2000 ) Year += 1900;
 if( Year < 2000 ) Year += 100;  //Netscape 3 and IE 4.7 return 0 instead of 100 for 2000
 if( Hour < 10 )  Hour = "0" + Hour;
 if( Min  < 10 )  Min  = "0" + Min;
 var tm = Month + ' ' + Day +  ', ' + Year + ' at ' + Hour + ':' + Min;
 document.write('<p class="mdt">Last modified: ' + tm + '</p>');
}

/* eof - qlunix.js */

