function openMP3(pagina, target){
	var i;
	var w = 220;
	var h = 290;
	
	var esquerda = (screen.width - w)/2;
	var topo = (screen.height - h)/2;
	
	window.open(pagina, target, "width="+ w +", height="+ h +", top="+ topo +", left="+ esquerda +", scrollbars=no, location=no");

	return i;
}


function openFLV(pagina, target){
	var i;
	var w = 500;
	var h = 350;
	
	var esquerda = (screen.width - w)/2;
	var topo = (screen.height - h)/2;
	
	window.open(pagina, target, 'width='+ w +', height='+ h +', top='+ topo +', left='+ esquerda +', status=1,menubar=no,scrollbars=no,resizable=no');
	return i;
}

function openPicture(pagina, target){
	var i;
	var w = 640;
	var h = 368;
	
	var esquerda = (screen.width - w)/2;
	var topo = (screen.height - h)/2;
	
	window.open(pagina, target, "width="+ w +", height="+ h +", top="+ topo +", left="+ esquerda +", toolbar=no, directories=no, scrollbars=no, location=no, resizable=no");
	return i;
}

function openPage(pagina, target, w, h){
	var i;
	var esquerda = (screen.width - w)/2;
	var topo = (screen.height - h)/2;
	
	window.open(pagina, target, "width="+ w +", height="+ h +", top="+ topo +", left="+ esquerda +", toolbar=no, directories=no, scrollbars=no, location=no, resizable=no");
	return i;
}

function mudapagina(combo){
	var endereco = combo.value;
	if (endereco != "#"){
		novapagina = window.open(endereco, "_parent");
	}
}

function closeAdd(id){
	obj = document.getElementById(id);
	obj.style.visibility = 'hidden';
}

function MM_showHideLayers() { //v9.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) 
  with (document) if (getElementById && ((obj=getElementById(args[i]))!=null)) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v=='hide')?'hidden':v; }
    obj.visibility=v; }
}

// FUNÇÃO VALIDA FORMULÁRIO
function valida(){

if(document.contato.nome.value.length < 3){
alert("O campo NOME esta vazio ou incorreto\nPor Favor verifique o campo novamente")
document.contato.nome.focus();
return false;
}

var emailfilter=/^\w+[\+\.\w-]*@([\w-]+\.)*\w+[\w-]*\.([a-z]{2,4}|\d+)$/i;
var returnval=emailfilter.test(contato.email.value)
if (returnval==false){
		alert("O campo E-MAIL esta vazio ou incorreto\nPor Favor verifique o campo novamente")
		document.contato.email.focus();
		return false;
}

if(document.contato.cidade.value.length < 4){
alert("O campo CIDADE esta vazio ou incorreto\nPor Favor verifique o campo novamente")
document.contato.cidade.focus();
return false;
}
if(document.contato.estado.value.length < 1){
alert("O campo ESTADO esta vazio ou incorreto\nPor Favor verifique o campo novamente")
document.contato.estado.focus();
return false;
}

if(document.contato.ddd.value.length < 3){
alert("O campo DDD esta vazio ou incorreto\nPor Favor verifique o campo novamente")
document.contato.ddd.focus();
return false;
}

if(document.contato.tel.value.length < 8){
alert("O campo TELEFONE esta vazio ou incorreto\nPor Favor verifique o campo novamente")
document.contato.tel.focus();
return false;
}

if(document.contato.data.value.length < 8){
alert("O campo DATA esta vazio ou incorreto\nPor Favor verifique o campo novamente")
document.contato.data.focus();
return false;
}

if(document.contato.mensagem.value.length < 10){
alert("O campo MENSAGEM esta vazio ou incorreto\nPor Favor verifique o campo novamente")
document.contato.mensagem.focus();
return false;
}

return true;
}

// FUNÇÃO VALIDA FORMULÁRIO de COMENTÁRIO
function valida2(){

if(document.contato.nome.value.length < 3){
alert("O campo NOME esta vazio ou incorreto\nPor Favor verifique o campo novamente")
document.contato.nome.focus();
return false;
}

var emailfilter=/^\w+[\+\.\w-]*@([\w-]+\.)*\w+[\w-]*\.([a-z]{2,4}|\d+)$/i;
var returnval=emailfilter.test(contato.email.value)
if (returnval==false){
		alert("O campo E-MAIL esta vazio ou incorreto\nPor Favor verifique o campo novamente")
		document.contato.email.focus();
		return false;
}

if(document.contato.cidade.value.length < 3){
alert("O campo CIDADE esta vazio ou incorreto\nPor Favor verifique o campo novamente")
document.contato.cidade.focus();
return false;
}
if(document.contato.estado.value.length < 1){
alert("O campo ESTADO esta vazio ou incorreto\nPor Favor verifique o campo novamente")
document.contato.estado.focus();
return false;
}
if(document.contato.pais.value.length < 3){
alert("O campo PAIS esta vazio ou incorreto\nPor Favor verifique o campo novamente")
document.contato.pais.focus();
return false;
}


if(document.contato.mensagem.value.length < 10){
alert("O campo MENSAGEM esta vazio ou incorreto\nPor Favor verifique o campo novamente")
document.contato.mensagem.focus();
return false;
}

return true;
}
