





function __expandMenuIE(){
//	alert("carregado")
	var element = document.getElementById("global_menu")

	var d = document.createElement("DIV")
	var shape = document.body.appendChild(d)
	shape.style.position = "absolute"
	shape.style.top = "0"
	shape.style.left = "0"
	shape.style.width="100%"
	shape.style.height="500px"
	
	shape.style.zIndex=10
	//shape.style.backgroundColor = "white"
	//shape.style.border = "1px solid red"
	shape.style.display = "none";
	
	element.style.zIndex = 20
	element.style.position = "relative";
	
	shape.element = element
	element.shape = shape
	shape.display = function(n){
		this.style.display = n || "block";
	}
	shape.onmouseover = function(){
		if(element.active) __closeActive(element.active)
		hideTags("select");
		this.display("none");
	}

	var t = element.getElementsByTagName("a");
	element.levelWidth = 0
	element.level = false;
	
	element.style.overflowX = "hidden"
	
	element.__position = function(o){
		this.style.overflowX = "visible"
		//if(screen.availWidth > 800) return false;
		if(document.body.offsetWidth > 800) return false;
		if(this.className == "menu"){
			if(!this._positioned){
				this.lastChild.firstChild.sub.className += " leftdir";
				this._positioned = true;
			}
		}
	}	

	
	function __closeActive(o){
		if(o.sub){
			if(o.sub.active){
				if(o.sub.active.sub){
					arguments.callee(o.sub.active)
				}
			}
		}
		if(o){
			o.sub.className = o.sub.className.replace(/\s?opened/gi,"");
		}
	}

	element.onmouseover = function(){
		this.shape.display();
	}
	
	for(var a=0; a<t.length;a++){
		if(t[a].parentNode.className == "sub"){

			t[a].sub =__getNextElement( t[a] );
			t[a].element = element
			t[a].owner = t[a].parentNode.parentNode;		//UL
			
			t[a].onmouseover = function(){
				if(this.owner.active)__closeActive(this.owner.active);
				this.sub.className += " opened";
				this.owner.active = this;
				hideTags("select",true);
			}
		}
	}
	element.__position()
}	
	
function __getNextElement(o){
	n = o.nextSibling ? o.nextSibling : false;
	if(n == false){	return false;	}
	while(n.nodeType != 1 && n !== n.parentNode.lastChild){
		n = n.nextSibling;
	}
	if(n.nodeType == 3){		return false;	}
	else{							return n;		}
}

if(window.attachEvent){
	window.attachEvent("onload",__expandMenuIE)
	
}

/*
	deixa a tag invisivel
*/
function hideTags(tag,func){
	if(!document.getElementsByTagName) return false;
	if(document.tagsvisible == func) return false;
	var t = document.getElementsByTagName(tag.toUpperCase());
	if(t.length){if(t.length == 0) return false;}
	document.tagsvisible = func;
	if(func==true){func="hidden"; }
	else{		func="visible";	}
	for(var i=0; i<t.length;i++){	t[i].style.visibility = func;	}
}


/*else{
	function __expandMenuGecko(){
		var i = document.getElementsByTagName("iframe")
		for(var a=0; a<i.length; a++){
			i[a].setAttribute("disabled", true)
			i[a].hideFocus = true;
			alert(i[a].src)
			i[a].style.border = "1px solid red"
		}
	}
	window.addEventListener("load",__expandMenuGecko,false)
}
*/



