//over dos botoes
function changeBg(div)
{
	stringName = div+"On";
	document.getElementById(div).className = stringName;
}
function restoreBg(div)
{
	document.getElementById(div).className = div;
}



startList = function() {
	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", "");
				}
			}
		}
	}
}

addOnLoadEvent(function() {startList( )});

//addOnLoadEvent(function() {DHTMLAPI.init( )});
function addOnLoadEvent(func) {
	if (window.addEventListener || window.attachEvent) {
	addEvent(window, "load", func, false);
	} else {
		var oldQueue = (window.onload) ? window.onload : function( ) {};
		window.onload = function( ) {
		oldQueue( );
		func( );
		}
	}
}

//addEvent(document.getElementById("chooser"), "change", navigate, false);
function addEvent(elem, evtType, func, capture) {
	capture = (capture) ? capture : false;
	if (elem.addEventListener) {
		elem.addEventListener(evtType, func, capture);
	} else if (elem.attachEvent) {
		elem.attachEvent("on" + evtType, func);
	} else {
		// for IE/Mac, NN4, and older
		elem["on" + evtType] = func;
	}
}


function initTabs(){
	var a,x,y=0,lnk,j;
	var il=document.getElementById("destaques").childNodes;
	for(i=0;i<il.length;i++){
		lnk = il[i].nodeName;
		if(lnk == "LI"){
			j = y;
			il[i].className = (j==0) ? "abaOn" : "abaOff";
			il[i].id = "_"+y;
			il[i].onclick = function(){  Mk(this); }
			/*for(x=0;x<il[i].childNodes.length;x++){if(il[i].childNodes[x].nodeName == "A"){il[i].childNodes[x].href = "#";}}*/
			y++; //define counter
		}
	}
	MkContentTabs("_"+0);
}


function Mk(obj){
	MkTabs();
	obj.className = "abaOn";
	MkContentTabs(obj.id.toString());
}

function MkTabs(){
	var a,x,y=0,lnk;
	var il=document.getElementById("destaques").childNodes;
	for(i=0;i<il.length;i++){
		lnk = il[i].nodeName;
		if(lnk == "LI"){
			il[i].className = "abaOff";
		}
	}
}
function MkContentTabs(y){
	var x=0;
	var il=document.getElementById("AbConteudos").childNodes;
	for(i=0;i<il.length;i++){
		lnk = il[i].nodeName;
		if(lnk == "DIV"){
			il[i].style['display'] = (y=="_" + x) ? "block" : "none";
			x++; //define counter
		}
	}
}


//alternar leitura e fotos
function showHidePics(aba){
	if(aba == "aba1"){
		document.getElementById("aba2").className = "abaOff";
		document.getElementById("aba1").className = "abaOn";
		document.getElementById("l-fotos").style.display = "none";
		document.getElementById("l-leitura").style.display = "block";
	}else{
		document.getElementById("aba1").className = "abaOff";
		document.getElementById("aba2").className = "abaOn";
		document.getElementById("l-leitura").style.display = "none";
		document.getElementById("l-fotos").style.display = "block";
	}
}

