// JavaScript Document
// Adiciona a função (fn) ao evento (evType) do objeto (obj)
function addEvent(obj, evType, fn){
   if (obj.addEventListener){
	  obj.addEventListener(evType, fn, true)}
   if (obj.attachEvent){
	  obj.attachEvent("on"+evType, fn)}
}
// --------------------


// Extensão do getElementById(id), permitindo o uso de classes
// Autor: Náiron - www.elmicox.com
function DOMgetElementsByClassName($node,$className){
    var $node, $atual, $className, $retorno = new Array(), $novos = new Array();
    $retorno = new Array();
    for (var $i=0;$i<$node.childNodes.length;$i++){
       $atual = $node.childNodes[$i];
       if($atual.nodeType==1){// 1 = XML_ELEMENT_NODE
          $classeAtual = $atual.className;
          if(new RegExp("\\b"+$className+"\\b").test($classeAtual)){
             $retorno[$retorno.length] = $atual;
          }
          if($atual.childNodes.length>0){
             $novos = DOMgetElementsByClassName($atual,$className);
             if($novos.length>0){
                $retorno = $retorno.concat($novos);
             }
          }
       }
    }
    return $retorno;
}
// --------------------





function AtivaHoverIE(classe) {
	var pais = DOMgetElementsByClassName(document.body,classe);
	for (var j=0; j<pais.length; j++) {
		var sfEls = pais[j].getElementsByTagName("li");
		for (var i=0; i<sfEls.length; i++) {
		   sfEls[i].onmouseover=function() {
					   this.className+=" over";
		   }
		   sfEls[i].onmouseout=function() {
					   this.className=this.className.replace(new RegExp(" over\\b"), "");
		   }
		}
	}
}

addEvent(window,"load",function () { AtivaHoverIE("menu"); });



