// SCRIPT FOR MENU ITEMS
function startList() {
	var navRoot;
	var node;
	if (document.all&&document.getElementById) {
		navRoot = document.getElementById('menu');
		for (i=0; i<navRoot.childNodes.length; i++) {
			node = navRoot.childNodes[i];
			if (node.nodeName=="LI") {
				node.onmouseover=function() {
					this.className+=" over";
				}
				node.onmouseout=function() {
					this.className=this.className.replace(" over", "");
				}
			}
		}
	}
}

function startList2(name) {
	var navRoot;
	var node;
	if (document.getElementById(name) !== null) {
		if (document.all&&document.getElementById) {
			navRoot = document.getElementById(name);
			for (i=0; i<navRoot.childNodes.length; i++) {
				node = navRoot.childNodes[i];
				if (node.nodeName=="LI") {
					node.onmouseover=function() {
						this.className+=" over";
					}
					node.onmouseout=function() {
						this.className=this.className.replace(" over", "");
					}
				}
			}
		}
	}
}

function startSearch() {
		var navRoot;
		var node;
		if (document.all&&document.getElementById) {
		navRoot = document.getElementById('search_form');
		for (i=0; i<navRoot.childNodes.length; i++) {
			node = navRoot.childNodes[i];
			if (node.nodeName=="BUTTON") {
				node.onmouseover=function() {
					this.className+=" over";
				}
				node.onmouseout=function() {
					this.className=this.className.replace(" over", "");
				}
			}
		}
	}
}

function startSubscribe() {
		var navRoot;
		var node;
		if (document.all&&document.getElementById) {
		var navRoot = document.getElementById('enewsletters_btn');
		for (i=0; i<navRoot.childNodes.length; i++) {
			node = navRoot.childNodes[i];
			if (node.nodeName=="BUTTON") {
				node.onmouseover=function() {
					this.className+=" over";
				}
				node.onmouseout=function() {
					this.className=this.className.replace(" over", "");
				}
			}
		}
	}
}

function startFocus() {
	var focused = document.getElementsByTagName("INPUT");
	for (var i=0; i<focused.length; i++) {
		focused[i].onfocus=function() {
			this.className+=" focus";
		}
		focused[i].onblur=function() {
			this.className=this.className.replace(" focus", "");
		}
	}
}

window.onload=startList;

function addLoadEvent(func, variable)
{    
    var oldonload = window.onload;
    if (typeof window.onload != 'function')
    {
        window.onload = func;
    } 
    else 
    {
        window.onload = function()
        {
            oldonload();
            func(variable);
        }
    }
}

addLoadEvent(startList2, 'menu1');
addLoadEvent(startList2, 'menu2');
addLoadEvent(startList2, 'menu3');
addLoadEvent(startList2, 'menu4');
addLoadEvent(startList2, 'menu5');
addLoadEvent(startList2, 'menu6');
addLoadEvent(startList2, 'menu7');

addLoadEvent(startSearch);
addLoadEvent(startSubscribe);
addLoadEvent(startFocus);



