<?
	### Javascript functions version 1.0 8th march 2006
	$version_functions_javascript=1.0;
?>
<script language="JavaScript">
function openWindow(theURL,imagewidth,imageheight) { //v2.0
	mHeight=imageheight;
	mWidth=imagewidth;
	mScroll = "yes"
	features="'status=yes,scrollbars=" + mScroll + ",resizable=yes,width=" + mWidth + ",height=" + mHeight + ",top=0,left=0'";
	window.open(theURL,'',features);
}

function closeWindow() {
  window.close();
}

//   ##############  SIMPLE  BROWSER SNIFFER
if (document.layers) {navigator.family = "nn4"}
if (document.all) {navigator.family = "ie4"}
if (window.navigator.userAgent.toLowerCase().match("gecko")) {navigator.family = "gecko"}


//TRACK MOUSE BEGIN
var IE = document.all?true:false
if (!IE) document.captureEvents(Event.MOUSEMOVE)
document.onmousemove = getMouseXY;

// Temporary variables to hold mouse x-y pos.s
var tempX = 0
var tempY = 0

// Main function to retrieve mouse x-y pos.s

function getMouseXY(e) {
	if (IE) { // grab the x-y pos.s if browser is IE
		x = event.clientX + document.body.scrollLeft
		y = event.clientY + document.body.scrollTop
	} else {  // grab the x-y pos.s if browser is NS
		x = e.pageX
		y = e.pageY
	}
	return true
}
//TRACK MOUSE END
function toggleVisibility(me){
	if (me.style.visibility=="hidden"){
		me.style.visibility="visible";
	}
	else {
		me.style.visibility="hidden";
	}
}

function hotKeys (event) {
  // Get details of the event dependent upon browser
  event = (event) ? event : ((window.event) ? event : null);
  // We have found the event.
  if (event) {   
    // Hotkeys require that either the control key or the alt key is being held down
    if (event.ctrlKey || event.altKey || event.metaKey) {
      // Pick up the Unicode value of the character of the depressed key.
      var charCode = (event.charCode) ? event.charCode : ((event.which) ? event.which : event.keyCode);
      // Convert Unicode character to its lowercase ASCII equivalent
      var myChar = String.fromCharCode (charCode).toLowerCase();
      // Convert it back into uppercase if the shift key is being held down
      if (event.shiftKey) {myChar = myChar.toUpperCase();}
      // Now scan through the user-defined array to see if character has been defined.
      for (var i = 0; i < keyActions.length; i++) {
        // See if the next array element contains the Hotkey character
        if (keyActions[i].character == myChar) { 
          // Yes - pick up the action from the table
          var action;
          // If the action is a hyperlink, create JavaScript instruction in an anonymous function
          if (keyActions[i].actionType.toLowerCase() == "link") {
            action = new Function ('location.href  ="' + keyActions[i].param + '"');
          }
          // If the action is JavaScript, embed it in an anonymous function
          else if (keyActions[i].actionType.toLowerCase()  == "code") {
            action = new Function (keyActions[i].param);
          }
          // Error - unrecognised action.
          else {
            alert ('Hotkey Function Error: Action should be "link" or "code"');
            break;
          }
          // At last perform the required action from within an anonymous function.
          action ();
          // Hotkey actioned - exit from the for loop.
          break;
        }
      }
    }
  }
}

</script>