function getQueryString ()
{
 var querystring = new Array;
 
 // parse current url into an array with the keys/values
 var q = String (document.location).split ('?')[1];
 if (!q) return false;
 q = q. split ('&');

 for (var i = 0 ; i < q.length; i++)
 {
   // for each key/value, split them at the '='
   // and add them to the qerystring array
   var o = q[i].split('=');
   querystring[o[0]] = o[1];
 }

 // return the querystring
 return querystring;
}

function currentPage() {

	qstring = getQueryString();
	page = qstring['page'];
	
	if ( page == 2 ) {
		document.getElementById( 'terms' ).className = "current";
	} else if ( page == 1 ) {
		document.getElementById( 'about' ).className = "current";
	} else if ( page == 3 ) {
		document.getElementById( 'links' ).className = "current";
	} else if ( page == 4 ) {
		document.getElementById( 'forms' ).className = "current";
	}	
	  else {
        document.getElementById( 'home' ).className = "current";
	}
	
}

function addLoadEvent(func) {
  var oldonload = window.onload;
  if (typeof window.onload != 'function') {
    window.onload = func;
  } else {
    window.onload = function() {
      if (oldonload) {
        oldonload();
      }
      func();
    }
  }
}

addLoadEvent( currentPage );