function go(page) {
        var where = page.go_menu.options[page.go_menu.selectedIndex].value;
        if (where != "x") {
              eval( 'location.href' + ' = where' );
        }
        else {
              alert("Oops, the selection you made\nwon't take you anywhere.\n\nTry making a selection again!");
        }
}


//----------------------------------------------------------
// This is function that is called to register varibables
// a being required. All it does is append an entry to each of
// the requiredNames and requiredLabels arrays

var requiredNames  = Array();
var requiredLabels = Array();

function registerRequired( fieldName, fieldLabel )
{
    var i = requiredNames.length;
    requiredNames[i] = fieldName;
    requiredLabels[i] = fieldLabel;
}

//----------------------------------------------------------
// This function will compare the input form with the 
// requiredNames array and make sure all those variables
// are specified

function requiredcheck( formname )
{
    var msg = "";
	var i = 0;
	var j = 0;

    // Prepare input
    var foundData = Array();

    for ( i = 0; i < requiredNames.length; i++ )
    {
       foundData[i] = false;
    }

    /// Iterrate over all forms.
    for ( i = 0; i < document.forms.length; i++ )
    {
       var f = document.forms[i];

       // find the one that matches our formname
       if ( f.name == formname )
       {
           // Cycle over the elements in the form
           for ( var j = 0; j < f.elements.length ; j++ )
           {
               var el = f.elements[j];

               // See if it is on our list of required values
               for ( var k = 0; k < requiredNames.length; k++ )
               {
                   if ( requiredNames[k] == el.name )
                   {
                       if ( el.type == "radio" )
                       {
                           foundData[k] = foundData[k] || el.checked;
                       }
                       else
                       {
                           foundData[k] = foundData[k] || ( el.value.toString().length > 0 );
                       }

                       break; //
                   }
               }

           }
           break;
       }
    }


    // Check Values
    for ( var k = 0; k < requiredNames.length; k++ )
    {
         if ( ! foundData[k] )
         {
             msg = msg + "* \"" + requiredLabels[k] + "\"\n";
         }
    }

    if ( msg.length > 0 )
    {
        msg = "You must provide answers to the following questions:\n" + msg;
        alert( msg );
        return false;
    }
    else
        return true;
}

//-------------------------------------------------------------------------
// Function that returns the base URL of the document if it 
// specified in a base tag

function getbase()
{
    var baseset = document.getElementsByTagName( "base" );
    if ( baseset && baseset.length > 0 )  {
       return baseset.item(0).href;
    } else {
       return null;
    }
}

//-------------------------------------------------------------------------
// Function that tries to get the protocol from the front of a 
// a URL string

function getprotocol( url )
{
   var bits = url.split(":");
   if ( bits ){
      return bits[0];
   } else {
      return bits;
   }
}

//-------------------------------------------------------------------------
// Function that adds the base to the front of a URL

function addBaseToURL( url )
{
   var base = getbase();
   if ( base  )
   {
      if ( url )
      {
          var protocol = getprotocol( url.toLowerCase() );
          if ( protocol != "http" && protocol != "https" )
          {
             return base + url;
          }
      }
   }
   return url;
}


// Function for opening the large popup window that goes with calculators

function openpopup( link, name, config )
{
   var href;
   
   if ( link.href ) {
       href = link.href;
   } else {
       href = link;
   }
      
   var win = window.open( href, name, config );
   win.focus();
   return false;
}

function opencalcpopup( link )
{
   return openpopup( link, "dircalcpopup",
                     "toolbar=yes,location=yes,menubar=yes,status=yes,resizable=yes,scrollbars=yes,width=800,height=500" );
}

// Function for opening the small popup window that goes with calculators
function opensmallpopup( link )
{
   return openpopup( link, "dircalcsmallpopup",
                     "toolbar=no,location=no,menubar=no,status=no,resizable=yes,scrollbars=yes,width=460,height=150" );
}

// Function for opening the window associated with doing the PDF download
// 

function startpdfdownload( url )
{
   return opensmallpopup( url );
}

function startcsvdownload( url )
{
   return opensmallpopup( url );
}



// Exit button
function exitbutton( frm )
{
   if ( confirm( "This action will close this window and all the \n" +
                 "information you have entered will be lost.\n\n" +
                 "Do you wish to continue with this action?\n" ) )
   {              
       var url = addBaseToURL( frm.action );
       var win = window.open( url, "dircalcpopup" );
       win.focus();
       window.close();
   }
   return false;
}


/*//-------------------------------------------------------------
// (C) 2000 www.CodeLifter.com
// http://www.codelifter.com
// Free for all users, but leave in this  header

// Set the message for the alert box
am = "The right-click menu has been disabled";

// do not edit below this line
// ===========================
bV  = parseInt(navigator.appVersion)
bNS = navigator.appName=="Netscape"
bIE = navigator.appName=="Microsoft Internet Explorer"

function nrc(e) {
   if (bNS && e.which > 1){
      alert(am)
      return false
   } else if (bIE && (event.button >1)) {
     alert(am)
     return false;
   }
}

document.onmousedown = nrc;
if (document.layers) window.captureEvents(Event.MOUSEDOWN);
if (bNS && bV<5) window.onmousedown = nrc;
//-------------------------------------------------------------

*/
