function flash() {
document.write('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="761" height="188" id="flashtopo" align="middle">');
document.write('<param name="allowScriptAccess" value="sameDomain" />');
document.write('<param name="movie" value="'+PATHR+'site/pagina/swf/flashtopo.swf" /><param name="quality" value="high" /><param name="bgcolor" value="#ffffff" /><embed src="'+PATHR+'site/pagina/swf/flashtopo.swf" quality="high" bgcolor="#ffffff" width="761" height="188" name="flashtopo" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flashtopo" pluginspage="http://www.macromedia.com/go/getflashplayer" />');
document.write('</object>');
}

function subMenu(pId1,pId2,pId3,pId4,pId5,pId6) {
  x1 = document.getElementById(pId1);
  x2 = document.getElementById(pId2);
  x3 = document.getElementById(pId3);
  x4 = document.getElementById(pId4);
  x5 = document.getElementById(pId5);
  x6 = document.getElementById(pId6);
  if (x1 != undefined) {
    x1.style.display='block';
  }
  if (x2 != undefined) {
    x2.style.display='none';
  }
  if (x3 != undefined) {
    x3.style.display='none';
  }
  if (x4 != undefined) {
    x4.style.display='none';
  }
  if (x5 != undefined) {
    x5.style.display='none';
  }
  if (x6 != undefined) {
    x6.style.display='none';
  }
}
  

function valida(form){ 
  for (i=0;i<form.length;i++){
	var okay = new String(form[i].name);
	if(okay.substr(0,1) != "X" && form[i].type !== 'submit'){
	  if(okay == 'email' && !checkEmail(form[i])){
        alert('Preencha o campo com seu e-mail corretamente');
        return false;
      }else if(form[i].value == ""){
		var nome = form[i].name;
		alert("O campo " + nome + " é obrigatório.");
		
		if(form[i].type !== 'hidden')
		  form[i].focus();
		
		return false;
	  }			
	}
  }
  return true;
}


// Função para validar e-mails
function checkEmail(campo) {
  if (!(/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(campo.value))){
	return (false);
  }
  
  return (true);
}

