 function go(tIndex) {
  if(tIndex != "NOJUMP" && tIndex!=""){
    location = tIndex
  }
}

function wopen(url, name, param) {
  var win = window.open(url, name, param)
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v3.0
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}


function hilight(handle,color){
	handle.style.backgroundColor=color
	handle.style.cursor="hand"
}

function hilightOff(handle){
	 handle.style.backgroundColor="" 
}


function buildButton(linkText,alink){
var buttonStr = '';
	buttonStr ='<table width="180" border="0" cellspacing="0" cellpadding="0">'
	buttonStr +=   '<tr>'
	buttonStr +=     '<td colspan="3" class="hiLine"></td>'
	buttonStr +=   '</tr><tr>'
	buttonStr +=     '<td width="1" class="hiLine"></td>'
	buttonStr +=    '<td width="178" class="navButton" align="right" onMouseOver="hilight(this,\'#c1c1c1\')" onClick="location=\''+ alink +'\'" onMouseOut="hilightOff(this)" ><a href="'+ alink +'" >&nbsp;&nbsp;' + linkText + '&nbsp;&nbsp;</a><br></td>'
	buttonStr +=    '<td width="1" class="shadeLine"></td>'
	buttonStr +=  '</tr><tr>'
	buttonStr +=    '<td colspan="3" class="shadeLine"></td>'
	buttonStr +=  '</tr>'
	buttonStr +='</table>'
	document.write(buttonStr)
}

function buildMainButton(linkText,alink){
var buttonStr = '';
	buttonStr ='<table width="180" border="0" cellspacing="0" cellpadding="0">'
	buttonStr +=   '<tr>'
	buttonStr +=     '<td colspan="3" class="hiLine"></td>'
	buttonStr +=   '</tr><tr>'
	buttonStr +=     '<td width="1"  class="hiLine"></td>'
	buttonStr +=    '<td width="178" class="navButton2" align="right" onMouseOver="hilight(this,\'#c1c1c1\')" onClick="location=\''+ alink +'\'" onMouseOut="hilightOff(this)" ><a href="'+ alink +'" >' + linkText + '&nbsp;&nbsp;</a></td>'
	buttonStr +=    '<td width="1"  class="shadeLine"></td>'
	buttonStr +=  '</tr><tr>'
	buttonStr +=    '<td colspan="3"  class="shadeLine"></td>'
	buttonStr +=  '</tr>'
	buttonStr +='</table>'
	document.write(buttonStr)
}


//remember last selected tab
var lastval="";

function init(){

// this is needed only for the menu page
// display the last tab they selected on return
// display the help tab if they've never been here before...
 if(document.getElementById) {
  if (GetCookie('last')) {
  on(GetCookie('last'));
  } else { on('d0') }
 }
}


//code for DHTML in W3C-compliant browsers (IE5/Mozilla/Netscape 6)
//uses information from http://wsabstract.com/javatutors/dom.shtml
//part I: tabbed pages where the associated DIV to display is called by the name of the
// activating object + "text".  There's no 'out' function - a DIV stays 'displayed' until another
// one is selected.  



function getCookieValue (pos) {
  var endpos = document.cookie.indexOf (";", pos);
  if (endpos == -1)
    endpos = document.cookie.length;
  return unescape(document.cookie.substring(pos, endpos));
}



function GetCookie (name) {
  var value = name + "=";
  var valueLength = value.length;
  var cookieLength = document.cookie.length;
  var i = 0;
  while (i < cookieLength) {
    var j = i + valueLength;
    if (document.cookie.substring(i, j) == value)
      return getCookieValue (j);
    i = document.cookie.indexOf(" ", i) + 1;
    if (i == 0) break; 
  }
  return null;
}

function SetCookieSave (name, value) {

var now = new Date();
now.setTime(now.getTime() + 100000000000);
document.cookie = name + "=" + escape (value)  +
                  "; expires=" + now.toGMTString() +
                  "; path=/";
}



function SetCookie (name,value) {
  document.cookie = name + "=" + escape (value) + "; path=/";
}

function DeleteCookie(name) {

if (GetCookie(name)) {
 document.cookie = name +"=; expires=Thu, 01-Jan-70 00:00:01 GMT; path=/"
} 
}

function DeleteCookiePath(path, name) {

if (GetCookie(name)) {
 document.cookie = name + "=; expires=Thu, 01-Jan-70 00:00:01 GMT; path=" + path
}
}


function on(val) {

 if(document.getElementById) {
  // if a pull down menu is active, kill it
   killMenu(); 
   if (val !=lastval) {
     var itm =     document.getElementById(val);
     var txt =     document.getElementById(val+"text");
     var lastitm = document.getElementById(lastval);
     var lasttxt = document.getElementById(lastval+"text");
    
     if (lasttxt) {lasttxt.style.display="none"};
     if (txt) {txt.style.display="block"};
  //   if (lastitm) {lastitm.style.backgroundColor="transparent"};
  //   if (itm) {itm.style.backgroundColor="white"};
     if (itm) {itm.className="buttonon"};
     if (lastitm) {lastitm.className="button"};

     lastval = val;
     SetCookie('last', val);
   }
 }
}






var activeMenu = 0;
var timeoutId = 0;

function activateMenu(menu) {

 if(document.getElementById) {
  if (activeMenu) hideMenu(activeMenu);
  activeMenu = menu;
  var docMenuID = document.getElementById("menu" + menu);
  var docMId =    document.getElementById("m"+menu);

    docMenuID.style.top  = parseInt(docMId.offsetTop) + parseInt(docMId.offsetHeight);
    docMenuID.style.left = parseInt(docMId.offsetLeft);

// workaround the Mozilla and Netscape 6 positioning problem when margins are used. Mozilla/NS6 
// positions are affected by margin settings for page, IE isn't.  
// Not needed now we run with no margins.
//    if (navigator.userAgent.indexOf('Mozilla/5') != -1) {
//      docMenuID.style.top = parseInt(docMenuID.style.top) + 8;
//      docMenuID.style.left = parseInt(docMenuID.style.left) + 8;
//    }

  docMenuID.style.display = "block";
  docMId.style.backgroundColor = "#E0E0F6";
  docMId.style.Color = "#3333CC";
  if (timeoutId != 0) clearTimeout(timeoutId);
  timeoutId = setTimeout("killMenu()", 5000);

// crudely workaround the IE5 (and IE5.5 and IE6) 'list box always on-top' problem for the software
// download page (software.asp) where the 3 list boxes are called s, h and l
// there's one on the main menu (prefer.inc) called c

if (document.all) {
      if (document.getElementById('s')) {
        var sId = document.getElementById('s');
        sId.style.visibility = "hidden";
      }
  
     if (document.getElementById('h')) {
        var hId = document.getElementById('h');
        hId.style.visibility = "hidden";
     }

     if (document.getElementById('l')) {
        var lId = document.getElementById('l');
        lId.style.visibility = "hidden";
     }
     if (document.getElementById('c')) {
        var cId = document.getElementById('c');
        cId.style.visibility = "hidden";
     }
                   }

}
}
//end activateMenu ******************************************************


// closeSoon is for the tidy rapid close down of the menu system.  Used as the 
// 'onout' function for the pulled-down menus so that if you mouse off the bottom of a
// menu, it closes virtually immediately. Doing this so that killMenu is driven only by 
// maturing timeouts

function closeSoon() {
  var tim = 50;
  if (timeoutId != 0) clearTimeout(timeoutId);
  timeoutId = setTimeout("killMenu()", tim);
}

//end closeSoon ******************************************************

function closeInABit() {
  var tim = 50;
  if (timeoutId != 0) clearTimeout(timeoutId);
  timeoutId = setTimeout("killMenu()", tim);
}


// keepActive closes the menu system in 5 seconds, unless another relevant mouseover
// event occurs.  Used when the user goes out of the header bar components because he 
// may not have intended this and may be confused by the menu system disappearing.

function keepActive() { 
  var tim = 5000;
  if (timeoutId != 0) clearTimeout(timeoutId);
  timeoutId = setTimeout("killMenu()", tim);
}
//end keepActive ********************************************************


// hideMenu closes a specified menu **********************************

function hideMenu(val) {
  var docMenuID = document.getElementById("menu"+val);
  if (docMenuID)  docMenuID.style.display = "none";
  var docMId =    document.getElementById("m"+val);
//  docMId.style.backgroundColor = "transparent";
  docMId.style.backgroundColor = "#cccccc";

// crude workaround for the IE5 'list box always on-top' problem for the software
// download page (software.asp) where the 3 list boxes are called s, h and l
// there's one on the main menu (prefer.inc) called c

if (document.all) {
  if (document.getElementById('s')) {
    var sId = document.getElementById('s');
    sId.style.visibility = "visible";
  }

  if (document.getElementById('h')) {
    var hId = document.getElementById('h');
    hId.style.visibility = "visible";
  }
  if (document.getElementById('l')) {
    var lId = document.getElementById('l');
    lId.style.visibility = "visible";
  }
  if (document.getElementById('c') ) {
    var cId = document.getElementById('c');
    cId.style.visibility = "visible";
  }
                   }

}
//end hideMenu **********************************************************


// killMenu closes the Menu system, finding out if a menu is currently pulled-down first

function killMenu(e) {
  if (activeMenu) {
    hideMenu(activeMenu);
    activeMenu = 0;
  }  
}
//end killMenu **********************************************************


// ############################################
// This function will create a text link in place where the function is called
// example: makeLink( "Eicon Networks", "http://www.eicon.com","topmenu");
// link text as the first argument
// link as the second argument
// the class for the a tag as the third argument
// ###########################################

function makeLink( linkText, link, aClass){
 document.write("<a class='" + aClass + "' href='" + link + "' >" + linkText + "</a>")
}


//script to load random images
var imagenumber = 5 ;
var randomnumber = Math.random() ;
var rand1 = Math.round( (imagenumber-1) * randomnumber) + 1 ;
images = new Array;
images[1] = "/n-images/neo.jpg";
images[2] = "/n-images/chick-blah.jpg";
images[3] = "/n-images/tech-geek.jpg";
images[4] = "/n-images/dude.jpg";
images[5] = "/n-images/redneck.jpg";
var randimage1 = images[rand1];


