// JavaScript Document

var initialiseMenu = function() {
var menus = [];

function setClass() {
if (!/(^|\s)over(\s|$)/.test(this.className))
this.className += ' over';
}
function removeClass() {
this.className = this.className.replace(/(^|\s)over(\s|$)/, ' ');
}
window.attachEvent('onunload', function() {
for (var i = 0; i < menus.length; ++i)
menus[i].onmouseover = menus[i].onmouseout
= null;
menus.length = 0;
window.detachEvent('onunload', arguments.callee);
});

return function(id) {
var menu = document.getElementById(id),
nodes = menu.childNodes;

for (var index = 0, length = nodes.length, node; index < length; ++index) {
node = nodes[index];
if (node.tagName == 'LI') {
node.onmouseover = setClass;
node.onmouseout = removeClass;
}
}
menus[menus.length] = menu;
};
}();

window.attachEvent('onload', function() {
initialiseMenu('H_menu');
initialiseMenu('V_menu');

window.detachEvent('onload', arguments.callee);
});


