
var menu_classes_that_need_fixing = ["menu", "submenu"];

function fixListsForIE6(){
	//IE6 detector
	if((/*@cc_on!@*/false) && (!window.XMLHttpRequest)){
		var uls = document.getElementsByTagName("UL");
		var menu_array = new Array();
		
		for (var i = 0; i < uls.length; i++){
			for(var c = 0; c < menu_classes_that_need_fixing.length; c++){
				if(checkClass(uls[i], menu_classes_that_need_fixing[c])){ menu_array.push(uls[i]); }
			}
		}
		for(var i = 0; i < menu_array.length; i++){
			var children = menu_array[i].childNodes || [];
			
			for(var n = 0; n < children.length; n++){
				if (children[n].nodeName == "LI"){
					children[n].onmouseover = function(){ this.className = this.className + " over"; }
					children[n].onmouseout = function(){ this.className = (this.className).replace(/ over/gi, ""); }
				}
			}
		}
	}
}

function checkClass(element, name){
	var reg	= new RegExp(name, 'g');
	
	if (element.className.match(reg)) { return true; }
	
	return false;
}

if(window.addEventListener){
	window.addEventListener("load", fixListsForIE6, false);
}else if(window.attachEvent){
	window.attachEvent("onload", fixListsForIE6);
}
