var popupWindow; 
function openWin(name, url, w, h, opts) {
    if ((!popupWindow || popupWindow.closed) && window.name != name) { 
	// open new window
	popupWindow = window.open( url, name, 'width='+w+',height='+h+','+opts);
    } else if (window.name == name) {
	// re-use the current window
	window.resizeTo(w, h);
	window.location.href = url;
	window.focus();
    } else {
	// re-use the child window
	popupWindow.resizeTo(w, h);
	popupWindow.location.href = url;
	popupWindow.focus();
    }
}

/* General presentation */

function rollover(n)
{
    // Being for the benefit of Mr. Kite
    if(!n){return;}
    var lis=n.getElementsByTagName('li');
    for (var i=0;i<lis.length;i++) {
	lis[i].onmouseover=function() {
	    if (!this.className.match('over')) {
		this.className=this.className+' over';
	    }
	}
	lis[i].onmouseout=function() {
	    this.className=this.className.replace('over','');
	}
    }
}



function addHandlers() {
  if(!document.getElementById || !document.createTextNode){return;}
  var n=document.getElementById('navlist'); rollover(n);

}

function addEvent( obj, type, fn )
{
	if (obj.addEventListener)
		obj.addEventListener( type, fn, false );
	else if (obj.attachEvent)
	{
		obj["e"+type+fn] = fn;
		obj[type+fn] = function() { obj["e"+type+fn]( window.event ); }
		obj.attachEvent( "on"+type, obj[type+fn] );
	}
}


getElementsByClassName = function (needle)
{
  var         my_array = document.getElementsByTagName("*");
  var         retvalue = new Array();
  var        i;
  var        j;

  for (i = 0, j = 0; i < my_array.length; i++)
  {
    var c = " " + my_array[i].className + " ";
    if (c.indexOf(" " + needle + " ") != -1)
      retvalue[j++] = my_array[i];
  }
  return retvalue;
}


addEvent(window, 'load', function()
{
    addHandlers();
});



