function fonte(tipo) {
	var tamanho = parseInt(document.getElementById('font_tamanho').size);
	
	if (tipo == '+') {
		if (tamanho < 6)
			document.getElementById('font_tamanho').size = tamanho + 1;
	}
	else if(tipo == '-') {
		if (tamanho > 1)
			document.getElementById('font_tamanho').size = tamanho - 1;
	}
	else {
		document.getElementById('font_tamanho').size = 2;
	}
}
function startAll(nome) {
    navRoot = document.getElementById(nome);
    if(navRoot != undefined) {
        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", "");
                }
            }
        }
    }
}
startList = function() {
    if(document.all && document.getElementById) {
        startAll("nav1");
        startAll("nav2");
        startAll("nav3");
        startAll("nav4");
        startAll("nav5");
        startAll("nav6");
        startAll("nav7");
        startAll("nav8");
        startAll("nav9");
        startAll("nav10");
        startAll("nav11");
        startAll("nav12");
        startAll("nav13");
        startAll("nav14");
        startAll("nav15");
        startAll("nav16");
        startAll("nav17");
        startAll("nav18");
        startAll("nav19");
        startAll("nav20");
        startAll("nav21");
        startAll("nav22");
        startAll("nav23");
        startAll("nav24");
        startAll("nav25");
        startAll("nav26");
        startAll("nav27");
        startAll("nav28");
        startAll("nav29");
        startAll("nav30");
        
    }
}
window.onload = startList;

function buscaCaixa(tipo) {
    
    var noticia = "view/botoes/noticias_v.jpg";
    var blogs   = "view/botoes/blogs_busca_v.jpg";
    var podcast = "view/botoes/podcast_a.jpg";
    var action  = "?p=busca&tipo=noticia";
    
    if (tipo == 'noticia') {
        noticia = "view/botoes/noticias_b.jpg";
        action  = "?p=busca&tipo=noticia";
    }
    else if (tipo == 'blog') {
        blogs = "view/botoes/blogs_busca_b.jpg";
        action  = "?p=busca&tipo=blog";
    }
    else if (tipo == 'podcast') {
        podcast = "view/botoes/podcast_b.jpg";
        action  = "?p=busca&tipo=podcast";
    }
    else {
        tipo = 'noticia';
    }
    
    document.getElementById('icone_noticia').src = noticia;
    document.getElementById('icone_blog').src = blogs;
    document.getElementById('icone_podcast').src = podcast;
    document.getElementById('form_busca').action = action;
    document.getElementById('tipo').value = tipo;
    
}

function logout() {
    if (confirm('Deseja realmente sair do sistema?'))
        xajax_logout();
}

function contaCaracteres() {
    numeroCaracteres = document.form_comentario.comentario.value.length
    totalPermitido = 4000;
    
    if (numeroCaracteres > totalPermitido)
        document.form_comentario.comentario.value = document.form_comentario.comentario.value.substr(0, 4000);
    
    document.form_comentario.caracteres_disponiveis.value = totalPermitido - document.form_comentario.comentario.value.length;
}

