var notWhitespace =/\S/;

//Elimina el espais en blanc entre nodes en moz

function cleanWhitespace(node) {
  for (var x = 0; x < node.childNodes.length; x++) {
    var childNode = node.childNodes[x]
    if ((childNode.nodeType == 3)&&(!notWhitespace.test(childNode.nodeValue))) {
// that is, if it's a whitespace text node
      node.removeChild(node.childNodes[x])
      x--
    }
    if (childNode.nodeType == 1) {
// elements can have text child nodes of their own
      cleanWhitespace(childNode)
    }
  }
}


function recorreLlista(){
	if (document.getElementById("menu")){
		cleanWhitespace(document.getElementById("menu"))
		UL=document.getElementById("menu").childNodes[0]
		for (var i=0;i<UL.childNodes.length;i++){
			if (UL.childNodes[i].className){
				if (UL.childNodes[i].className=="active" && UL.childNodes[i].childNodes.length<2){
					UL.childNodes[i].className="selected";
				}
			}
			if (UL.childNodes[i].childNodes[0].offsetHeight>=49 && UL.childNodes[i].childNodes[0].offsetHeight<=52){
				if (UL.childNodes[i].className!='') UL.childNodes[i].className=UL.childNodes[i].className+" selDosLines";
				else UL.childNodes[i].className="dosLines";
			}
			else if (UL.childNodes[i].childNodes[0].offsetHeight>=68 && UL.childNodes[i].childNodes[0].offsetHeight<=71){
				if (UL.childNodes[i].className!='') UL.childNodes[i].className=UL.childNodes[i].className+" selTresLines";
				else UL.childNodes[i].className="tresLines";
			}
			else if (UL.childNodes[i].childNodes[0].offsetHeight>=89 && UL.childNodes[i].childNodes[0].offsetHeight<=92){
				if (UL.childNodes[i].className!='') UL.childNodes[i].className=UL.childNodes[i].className+" selQuatreLines";
				else UL.childNodes[i].className="quatreLines";
			}
		}
		//UL.childNodes[0].className="dubtes";
	}
}
addLoadEvent(recorreLlista);
