function setFoto_old(indice){

	if(indice!=""){

		var dt    = new Date();

		var url = './arquivos/galerias/foto.php?imagem=' + escape(indice) + "&t=" + escape(dt.getTime());

		

		document.getElementById('mostraFoto').innerHTML = '<img src="./arquivos/imagens/loading.gif" align="center" valign="middle">';

					

		if (window.XMLHttpRequest) { 

			req = new XMLHttpRequest(); 

		} else if (window.ActiveXObject) { 

			req = new ActiveXObject("Microsoft.XMLHTTP"); 

		} 

		

		if(req){

			req.onreadystatechange = function processReqChange() { 

				if (req.readyState == 4) {

					if (req.status == 200) {

						document.getElementById('mostraFoto').innerHTML = req.responseText;

					} else { 

						//alert(req.responseText);

						alert("Erro");

					}

				} 

			} 

			req.open("GET",url,true); 

			req.send(null); 

		}

	}

}



function makevisible(cur,which){

	//alert(which);

	if (which==0){

		cur.style.opacity=1.0;

		cur.filters.alpha.opacity=100;

	}else{

		cur.style.opacity=0.7;

		cur.filters.alpha.opacity=70

	}

}



function moveup(){

	document.getElementById("listaFotos").scrollLeft -=2;		

}



function movedown(){

	document.getElementById("listaFotos").scrollLeft +=2;		

}





function scrollStop(){

	window.clearInterval(timeFotos);

}



function scrollFotos(tipo){

	if(tipo=='esq'){

		timeFotos = window.setInterval("moveup()",2);

	}else{

		timeFotos = window.setInterval("movedown()",2);

	}

}



function ajustaFotos(s){

	var ind   = s.selectedIndex;

	var album = s.options[ind].value;

	//alert(album);

	setFotos(album);

}



function altDirecao(){

	if(document.getElementById('mCarrossel').direction=='left'){

		document.getElementById('mCarrossel').direction = 'right';	

	}else{

		document.getElementById('mCarrossel').direction = 'left';	

	}

}

function ajustaNoticia(n){

	//alert(n);

	if(n!=""){

		//document.getElementById('conteudoNoticia').innerHTML = '<img src="./arquivos/imagens/loader.gif" align="absmiddle" />';

					

		var dt    = new Date();

		var url = './arquivos/conteudo/noticias.php?n=' + escape(n) + "&t=" + escape(dt.getTime());

		

		if (window.XMLHttpRequest) { 

			req = new XMLHttpRequest(); 

		} else if (window.ActiveXObject) { 

			req = new ActiveXObject("Microsoft.XMLHTTP"); 

		} 

		

		if(req){

			req.onreadystatechange = function processReqChange() { 

				if (req.readyState == 4) {

					if (req.status == 200) {

						document.getElementById('conteudoNoticia').innerHTML = req.responseText;

					}

				} 

			} 

			req.open("GET",url,true); 

			req.send(null); 

		}

	}

	n++;

	clearTimeout(notLoad);

	initNoticias(n);

	

} 



function initNoticias(n){

	//alert(n);

	notLoad = setTimeout('ajustaNoticia("' + n + '")',10000);		

}

function abreRadio(){

	window.open('./radio/index.php','radio','width=700,height=405,top=50,left=50, STATUS=NO, TOOLBAR=NO, LOCATION=NO, DIRECTORIES=NO, RESISABLE=NO, SCROLLBARS=NO');

	return(false);

}

function validaContato(form){
	var nome = form.nome.value;	
	var email = form.email.value;	
	var assunto = form.assunto.value;
	var msg = form.msg.value;
	if(nome.length<5){
		alert("Preencher o formulário com o NOME completo!");
		form.nome.focus();
		return(false);
	}else if(!checkMail(email)){
		alert("Preencher o formulário com um E-MAIL válido!");
		form.email.focus();
		return(false);
	}else if(assunto.length<3){
		alert("Preencher o formulário com um ASSUNTO!");
		form.assunto.focus();
		return(false);
	}else if(msg.length<5){
		alert("Preencher o formulário com uma MENSAGEM!");
		form.msg.focus();
		return(false);
	}
}
function caixaAlta(campo){
	//alert(campo);
	campo.value = campo.value.toUpperCase();
}
function caixaBaixa(campo){
	//alert(campo);
	campo.value = campo.value.toLowerCase();
}
function tBordas(cor,bg,id){
	//alert(id);
	document.getElementById(id).style.borderColor = cor;
	document.getElementById(id).style.backgroundColor = bg;
	
}
