function fct_PopUp (varUrl)
{
	window.open(varUrl,"mapa","width=790,height=586,scrollbars=no,menubar=no,status=yes,location=no,toolbar=no,left=300,top=200");
}

function fct_PopUpCont (varUrl)
{
	window.open(varUrl,"conteudo","width=500,height=410,menubar=no,location=no,toolbar=no,left=300,top=200");
}

function fct_PopUpAlbum (varUrl)
{
	window.open(varUrl,"album","width=590,height=390,menubar=no,location=no,toolbar=no,left=300,top=200");
}

function fct_Processar()
{
var objeForm = document.form;


	if (objeForm.varNome.value == "")
	{
		alert("Nome não preenchido.");
		objeForm.varNome.focus();
		return;
	}
	
	if (objeForm.varEmail.value == "")
	{
		alert("E-mail não preenchido.");
		objeForm.varEmail.focus();
		return;
	}
	
	if(!IsValidEmail(objeForm.varEmail.value))
	{
		alert("Digite um E-mail válido.");
		objeForm.varEmail.focus();
		return;
	}
	
	if(objeForm.varAssunto.value == "")
	{
		alert("Escreva um assunto.");
		objeForm.varAssunto.focus();
		return;
	}
	
	if(objeForm.varMensagem.value == "")
	{
		alert("Escreva uma mensagem.");
		objeForm.varMensagem.focus();
		return;
	}
	
	else
		{
		objeForm.submit();
		}
}

//#############################################################
//####    Verifica  formatação do campo como aaa@bbb.cc    						    ####
//####         Retorna true se for um E-Mail valido        								    ####
//####        Retorna false nao for um E-Mail valido       							    ####
//####         Autoria: Rafael Kiso 											    ####
//#############################################################
function IsValidEmail( Value )
{
var i, Current, Tmp
var Array = Value.split( '@' , 3 );

// Se tiver mais ou menos que 1 Arroba ou nao tiver nada antes ou apos o Arroba
if( Array.length != 2 || Array[0] == '' || Array[1] == '' )
	return false;

Tmp = Array[0];
// Se contiver caracteres especiais antes do Arroba
for(i=0; i < Tmp.length ;i++)
	{
	Current =  Tmp.charAt(i);
	if( (Current < '0' || Current > '9') && (Current < 'A' || Current > 'Z') && (Current < 'a' || Current > 'z') && Current != '_' && Current != '-' && Current != '.' )
		return false;
	}

Tmp = Array[1];
// Se contiver caracteres especiais depois do Arroba
for(i=0; i < Tmp.length ;i++)
	{
	Current =  Tmp.charAt(i);
	if( (Current < '0' || Current > '9') && (Current < 'A' || Current > 'Z') && (Current < 'a' || Current > 'z') && Current != '.' && Current != '-')
		return false;
	}

Tmp = Tmp.split( '.' , 4 );
// Se depois do arroba existir menos de 2 ou mais de 3 pontos
if( Tmp.length != 2 && Tmp.length != 3 )
	return false;

// Se depois do arroba existir menos de 2 ou mais de 3 pontos
if( Tmp.length == 2 && (Tmp[0] == '' || Tmp[1] == '') )
	return false;

// Se depois do arroba existir menos de 2 ou mais de 3 pontos
if( Tmp.length == 3 && (Tmp[0] == '' || Tmp[1] == '' || Tmp[2] == '') )
	return false;

return true
}

//Álbum de fotos//
//------------------------------------------------------------------------------------------------------------------------------------------------------------//
/*
    fotos = [20] ;
    texto = [20];
    i = 0 ;
	
	for(cont=0; cont<fotos.length; cont++){
	    fotos[cont] = cont'.jpg' ;
	    texto[cont] = 'Legenda da foto 01' ;
	}
	
   function next() {
	if ( (i+1) < fotos.length ) show( i+1 ) ;
}
   
    function prev() {
	if ( i > 0 ) show( i-1 ) ;
}
   

    function show( n ) {
        i = n ;
        document.getElementById("foto").src = fotos[i] ;
        document.getElementById("legenda").innerHTML ='<p>' + texto[i] + '</p>' ;
        document.getElementById("contador").innerHTML = '<p>Foto ' + (n+1) + ' de 3 </p>' ;
        setOpacities();
    }
  
    function setOpacities() {
        var browser = navigator.appName;
       
        if (browser == "Netscape") {
            filtro1 = ".MozOpacity = '0.5'";
            filtro2 = ".MozOpacity = '1.0'";
        } else {
            filtro1 = ".filter = 'alpha(opacity=50)'";
            filtro2 = ".filter = 'alpha(opacity=100)'";
        }
       
        if (i == 0) {
            eval("document.getElementById('antes').style" + filtro1);
        } else {
            eval("document.getElementById('antes').style" + filtro2);
        }
   
        if ((i+1) == fotos.length) {
            eval("document.getElementById('depois').style" + filtro1);
        } else {
            eval("document.getElementById('depois').style" + filtro2);
        }
    }*/
