/***********************************************
** File:      %M%  version %I%
** Author:    nat
** Modified:  %G%
** Copyright: I-Next Ltd
***********************************************/
/* ident %W% */

function doLoad(){
  highlightLinks()
}

function popup( win, w, h ){
  if ( window.pop ){ window.pop.close(); } // close an open one
  if ( popup.arguments.length < 2 ){ w = 320; };
  if ( popup.arguments.length < 3 ){ h = 480; };
  pop = window.open( win,'return','toolbar=no,location=no,directories=no,status=yes,scrollbars=no,resizable=no,copyhistory=no,locationbar=no,width=' + w + ',height=' + h + ',screenX=0,screenY=0,top=0,left=0');
}

function highlightLinks(){
  if ( document.all || document.getElementById ){
    var u = document.URL; // get the url
    var links = new Array(); // store the relevent links
    var s = u.split('/'); // get each directory in the url
    var path = s[0] + '//' + s[2] + '/'; // build the start of the path
    if ( s.length == 4 ){ links[0] = path; } // get the home link
    for ( var i = 3; i < s.length; i ++ ){ // insert the links
      if ( s[i] != '' ){ // a directory url leaves a blank entry
        path += s[i] + '/'; // build the path
        links[ links.length ] = path; // replicate a push
      }
    }
    if ( !u.match(/\/$/) ){ // if required remove the trailing '/'
      links[ (links.length-1) ] = path.substring(0, (path.length-1));
    }
    for ( var j = (document.links.length - 1); j >= 0; j -- ){
      var h = document.links[j].href; // get the link
      for ( var k = 0; k < links.length; k ++ ){
        if ( h == links[k] ){ // get the matching file and directory
          document.links[j].style.color = '#009999';
          document.links[j].style.textDecoration='none';
        }
      }
    }
  }
}
function NG_hImage(s){
  var u = document.URL.split('/');
  var i = ( u.length < 5 )? 'default' : u[3];
  var e = ( s == 'header' )? 'jpg' : 'gif';
  document.write('<img src="/gifs/' + s + '/' + i + '.' + e + '" border="0" alt="">');
}
window.onload = doLoad;
