// ===================================================================
// Author: Matt Kruse <mkruse@netexpress.net>
// WWW: http://www.mattkruse.com/
//
// NOTICE: You may use this code for any purpose, commercial or
// private, without any further permission from the author. You may
// remove this notice from your final code if you wish, however it is
// appreciated by the author if at least my web site address is kept.
//
// You may *NOT* re-distribute this code in any way except through its
// use. That means, you can include it in your product, or your web
// site, or any other form where the code is actually being used. You
// may not put the plain javascript up on your site for download or
// include it in your javascript libraries for download. Instead,
// please just point to my URL to ensure the most up-to-date versions
// of the files. Thanks.
// ===================================================================

// ------------------------------------------------------------------
// menugo( string )
//
// Pass this function a string and it will take the appropriate 
// action to go to that location. It will accept strings in these
// forms:
//   file.html
//   http://file.html
//   #anchor
//   'No' (does nothing)
// ------------------------------------------------------------------
function menugo(selector) {
        var instr = selector.options[selector.selectedIndex].value;
        if (instr.substring(0,1)=='/') {
                self.location.href = "http://" + self.location.host + instr;
                }
        else if (instr.substring(0,1)=='#') {
			var loc = window.location.href;
			var trimloc = window.location.href.indexOf('#');
			if (trimloc >= 0) {
				window.location.href = loc.substring(0,trimloc) + instr;
				}
			else {
				self.location.href = loc + instr;
				}
			}
        else if (instr.substring(0,6)=='http:/') {
			self.location.href = instr;
			}
        else if (instr == 'No') {   
			// Do Nothing
			}
        else {
			var trimloc = self.location.href.lastIndexOf('/');
			if (trimloc >= 0) {
				self.location.href =  self.location.href.substring(0,trimloc+1) + instr;
				}
			}
        }
