function findObj(theObj, theDoc)
{ // given a name or id, findObj returns an object reference
  var p, i, foundObj;
  
  if(!theDoc) theDoc = document;
  if( (p = theObj.indexOf("?")) > 0 && parent.frames.length)
  {
    theDoc = parent.frames[theObj.substring(p+1)].document;
    theObj = theObj.substring(0,p);
  }
  if(!(foundObj = theDoc[theObj]) && theDoc.all) foundObj = theDoc.all[theObj];
  for (i=0; !foundObj && i < theDoc.forms.length; i++) 
    foundObj = theDoc.forms[i][theObj];
  for(i=0; !foundObj && theDoc.layers && i < theDoc.layers.length; i++) 
    foundObj = findObj(theObj,theDoc.layers[i].document);
  if(!foundObj && document.getElementById) foundObj = document.getElementById(theObj);
  
  return foundObj;
}

function over()
{
	if (this.style) {
		this.style.backgroundImage = 'none';
	}
}

function out()
{
	if (this.style) {
		this.style.backgroundImage = '';
	}
}

function blurme()
{
	this.blur();
}

function setMenu()
{
	var ob = findObj('topmenu');
	if (!ob) return;
	if (!document.getElementsByTagName) return;
	
	var mlinks = ob.getElementsByTagName('a');
	if (!mlinks || mlinks.length == 0) return;
	
	for (var i=0; i < mlinks.length; i++) {
		var mlink = mlinks[i];
		mlink.onfocus = blurme;
		var theTd = mlink.parentNode;
		if (theTd && theTd.nodeName && theTd.nodeName.toLowerCase() == 'td') {
			theTd.onmouseover = over;
			theTd.onmouseout = out;
		}
	}
	
	// now just make the top banner link blur on foocus
	ob = findObj('topbanner');
	if (!ob) return;
	var tlinks = ob.getElementsByTagName('a');
	if (!tlinks || tlinks.length == 0) return;
	tlinks[0].onfocus = blurme;
}

window.onload = setMenu;
