// JavaScript Document

/**
* moeda
*
* @abstract Classe que formata de desformata valores monetários
* em float e formata valores de float em moeda.
*
* @example
* moeda.formatar(1000)
* >> retornar 1.000,00
* moeda.desformatar(1.000,00)
* >> retornar 1000
*
* @version 1.0
**/
var moeda = {

/**
* retiraFormatacao
* Remove a formatação de uma string de moeda e retorna um float
* @param {Object} num
*/
desformatar: function(num){
while(num.indexOf('.') != -1){
num = num.replace(".","");
}
while(num.indexOf(',') != -1){
num = num.replace(",",".");
}
while(num.indexOf(' ') != -1){
num = num.replace(" ","");
}
return parseFloat(num);
},

/**
* formatar
* Deixar um valor float no formato monetário
* @param {Object} num
*/
formatar: function(num){
num = num.toString();
while(num.indexOf(' ') != -1){
num = num.replace(" ","");
}
num = parseFloat(num);
x = 0;
if(num<0){
num = Math.abs(num);
x = 1;
}
if(isNaN(num)) {
num = "0";
}
cents = Math.floor((num*100+0.5)%100);
num = Math.floor((num*100+0.5)/100).toString();
if(cents < 10) {
cents = "0" + cents;
}
for (var i = 0; i < Math.floor((num.length-(1+i))/3); i++){
num = num.substring(0,num.length-(4*i+3))+'.'+num.substring(num.length-(4*i+3));
}
ret = num + ',' + cents;
if (x == 1){
ret = ' – ' + ret;
}
ret = ret.replace(" ","");
return ret;
},

/**
* arredondar
* @abstract Arredonda um valor quebrado para duas casas
* decimais.
* @param {Object} num
*/
arredondar: function(num){
return Math.round(num*Math.pow(10,2))/Math.pow(10,2);
}
}








function janela2(arquivo)
{
window.open(arquivo,"","resizable=yes,scrollbars=yes,width=800,Height=450,menubar=no,status=yes");
}


function testamensagem(){	
var x;
var campos;
x=0;
campos = "";
var mail = document.mensagem.Email;
var mail2 = document.mensagem.Email2;
var nome = document.mensagem.Nome;
var mensagem = document.mensagem.Mensagem;

var parte1 = mail.value.indexOf("@");
var parte2 = mail.value.indexOf(".");
var parte3 = mail.value.length;
if (!(parte1 >= 3 && parte2 >= 6 && parte3 >= 9)) {
alert ("O E-mail digitado não é um endereço valido!");
mail.focus();
return false;
}

 	if (mail.value == mail2.value) {
		if (nome.value == "") { campos = campos + "Nome, "; x = 1;	}
		if (mensagem.value == "") { campos = campos + "Mensagem, "; x = 1;	}
		if (mail.value.length==0) { campos = campos + "E-mail, "; x=1; }
		if (mail2.value.length==0) { campos = campos + "Confirme seu E-mail, "; x=1; }
	} else{
		alert("A confirmação de seu E-mail esta incorreta!");
		x = 1;
		return false;
	}
	
	if (x == 1) {
		alert("O(s) campo(s) "+campos+" não pode(m) ser deixado(s) em branco!");
		return false;
	} else{
		return true;
	}
	
}


function testadoador(){	
var x;
var campos;
x=0;
campos = "";
var mail = document.doador.Email;
var mail2 = document.doador.Email2;
var nome = document.doador.Nome;

var parte1 = mail.value.indexOf("@");
var parte2 = mail.value.indexOf(".");
var parte3 = mail.value.length;
if (!(parte1 >= 3 && parte2 >= 6 && parte3 >= 9)) {
alert ("O E-mail digitado não é um endereço valido!");
mail.focus();
return false;
}

 	if (mail.value == mail2.value) {
		if (nome.value == "") { campos = campos + "Nome, "; x = 1;	}
		if (document.doador.Endereco.value.length==0) { campos = campos + "Endereço, "; x=1; }
		if (document.doador.Bairro.value.length==0) { campos = campos + "Bairro, "; x=1; }
		if (document.doador.Cidade.value.length==0) { campos = campos + "Cidade, "; x=1; }
		if (document.doador.Estado.value==1) { campos = campos + "Estado, "; x=1; }		
		if (document.doador.Cep.value.length==0) { campos = campos + "Cep, "; x=1; }
		if (document.doador.TelefoneDDD.value == ""){ campos = campos + "DDD, "; x=1; }
		if (document.doador.Telefone.value == "" ) { campos = campos + "Telefone, "; x=1; }		
		if (document.doador.Email.value.length==0) { campos = campos + "E-mail, "; x=1; }
		if (document.doador.Email2.value.length==0) { campos = campos + "Confirme seu E-mail, "; x=1; }
	} else{
		alert("A confirmação de seu E-mail esta incorreta!");
		x = 1;
		return false;
	}
	
	if (x == 1) {
		alert("O(s) campo(s) "+campos+" não pode(m) ser deixado(s) em branco!");
		return false;
	} else{
		return true;
	}
	
}

function mailtest(){
	var mail = document.cadastro.email;
	var mail2 = document.cadastro.email2;
	
	if (checkMail(mail)){
		document.getElementById("visto").style.display = "";
		document.getElementById("visto").src = "imagem/success.png";
		document.getElementById("invalido").style.display = "none";
		if (mail.value == mail2.value){
			document.getElementById("visto2").style.display = "";
			document.getElementById("visto2").src = "imagem/success.png";
		}else{
			document.getElementById("visto2").style.display = "";
			document.getElementById("visto2").src = "imagem/error.png";
		}
	}else{
		document.getElementById("visto").style.display = "";
		document.getElementById("invalido").style.display = "";
		document.getElementById("visto").src = "imagem/error.png";
	}
	
	/*var parte1 = mail.value.indexOf("@");
	var parte2 = mail.value.indexOf(".");
	var parte3 = mail.value.length;
	if (!(parte1 >= 3 && parte2 >= 6 && parte3 >= 9)) {
		document.getElementById("visto").style.display = "";
		document.getElementById("invalido").style.display = "";
		document.getElementById("visto").src = "imagem/error.png";
			
	}else{
		document.getElementById("visto").style.display = "";
		document.getElementById("visto").src = "imagem/success.png";
		document.getElementById("invalido").style.display = "none";
		if (mail.value == mail2.value){
			document.getElementById("visto2").style.display = "";
			document.getElementById("visto2").src = "imagem/success.png";
		}else{
			document.getElementById("visto2").style.display = "";
			document.getElementById("visto2").src = "imagem/error.png";
		}
		
	}*/
}

function mailtest2(){
	var mail = document.cadastro.email;
	var mail2 = document.cadastro.email2;
	if (mail.value == mail2.value){
		document.getElementById("visto2").style.display = "";
		document.getElementById("visto2").src = "imagem/success.png";
	}else{
		document.getElementById("visto2").style.display = "";
		document.getElementById("visto2").src = "imagem/error.png";
	}
	
}

function testsenha(){	
	var mail = document.esqueceu.usuario;
	var mail2 = document.esqueceu.usuario2;
	
	//valida E-mail
	var parte1 = mail.value.indexOf("@");
	var parte2 = mail.value.indexOf(".");
	var parte3 = mail.value.length;

	if (!(parte1 >= 3 && parte2 >= 6 && parte3 >= 9)) {
		alert ("O E-mail digitado não é um endereço valido!");
		document.esqueceu.usuario.focus();
		x = 1;
		return false;
	}

	if (mail.value == mail2.value){
		return true;
	}else{
		alert("A confirmação de seu E-mail esta incorreta!");
		return false;
	}	
}

function senhatest(){
	var senha = document.cadastro.senha;
	if (senha.value.length >= 6){
		document.getElementById("visto3").style.display = "";
		document.getElementById("visto3").src = "imagem/success.png";
	}else{
		document.getElementById("visto3").style.display = "";
		document.getElementById("visto3").src = "imagem/error.png";
	}
}
	
function senhatest2(){
	var senha = document.cadastro.senha;
	var senha2 = document.cadastro.senha2;
	if(senha.value == senha2.value){
		document.getElementById("visto4").style.display = "";
		document.getElementById("visto4").src = "imagem/success.png";
	}else{
		document.getElementById("visto4").style.display = "";
		document.getElementById("visto4").src = "imagem/error.png";
	}
}



function pesquisa(){
	var x = document.busca.consulta.value;
	if (x == "") {return false;}else{return true;}
}

function senha(x){
	if (x == true){
		document.getElementById("senha").style.display = "inline";
	}
	if (x == false){
		document.getElementById("senha").style.display = "none";
	}	
}

function checkMail(mail){
        var er = new RegExp(/^[A-Za-z0-9_\-\.]+@[A-Za-z0-9_\-\.]{2,}\.[A-Za-z0-9]{2,}(\.[A-Za-z0-9])?/);
        if(typeof(mail) == "string"){
                if(er.test(mail)){ return true; }
        }else if(typeof(mail) == "object"){
                if(er.test(mail.value)){ 
                                        return true; 
                                }
        }else{
                return false;
                }
}



function testacadastro(acao) {	
	var x;
	var campos;
	x = 0;
	campos = "";
	var email = document.cadastro.email.value;
	var email2 = document.cadastro.email2.value;
	var senha = document.cadastro.senha.value;
	var senha2 = document.cadastro.senha2.value;

	var nome = document.cadastro.nome.value;
	var sobrenome = document.cadastro.sobrenome.value;
	var cpf = document.cadastro.cpf.value;
	var dianasci = document.cadastro.dianasci.value;
	var mesnasci = document.cadastro.mesnasci.value;
	var anonasci= document.cadastro.anonasci.value;
	var sexo = document.cadastro.sexo.value;

	var cep = document.cadastro.cep.value;
	var tipo= document.cadastro.tipo.value;
	var endereco = document.cadastro.endereco.value;
	var numero = document.cadastro.numero.value;
	var bairro = document.cadastro.bairro.value;
	var cidade = document.cadastro.cidade.value;
	var estado = document.cadastro.estado.value;
	var ddd1 = document.cadastro.ddd1.value;
	var telefone1 = document.cadastro.telefone1.value;
	
	
	//valida E-mail
	
	if (!(checkMail(email))){
		alert ("O E-mail digitado não é um endereço valido!");
		document.cadastro.email.focus();
		x = 1;
		return false;
	}
	
	
	
	
	
	/*var parte1 = email.indexOf("@");
	var parte2 = email.indexOf(".");
	var parte3 = email.length;

	if (!(parte1 >= 3 && parte2 >= 6 && parte3 >= 9)) {
		alert ("O E-mail digitado não é um endereço valido!");
		document.cadastro.email.focus();
		x = 1;
		return false;
	}*/
//valida Data de nascimento
	if (dianasci > 31 || mesnasci > 12 || anonasci > 2005 || anonasci < 1900) {
		x = 1;
		alert ("Data de Nascimento invalida!!");
		document.cadastro.dianasci.focus();
		return false;
	}

//valida Cep
	if (cep.length < 8){
		x = 1;
		alert ("Cep invalido!");
		cep = "";
		document.cadastro.cep.focus();
		return false;
	}

// Valida DDD e Telefone	
	if (ddd1.length < 2){
		x = 1;
		alert ("DDD invalido!");
		ddd1 = "";
		document.cadastro.ddd1.focus();
		return false;
	}
	
	if (telefone1.length < 8){
		x = 1;
		alert ("Telefone invalido!");
		telefone1 = "";
		document.cadastro.telefone1.focus();
		return false;
	}

//libera senha caso a ação seja Alterar
	if (acao == "alterar"){
		var senhaantiga = document.cadastro.senhaantiga.value;
		if (senhaantiga == "" && senha == "" && senha2 == "" ){
			senha = "1234567";
			senha2 = "1234567";
		}else{
			if (senhaantiga == ""){
			x = 1;
			alert ("Digite sua senha antiga!");
			senhaantiga = "";
			document.cadastro.senhaantiga.focus();
			return false;
			}
		}
	}
	
 	if (email == email2) {
		if (senha == senha2 && senha.length >=6) {
			if (nome == "") { campos = campos + "nome, "; x = 1;}
			if (sobrenome == "") { campos = campos + "sobrenome, "; x = 1;}
			if (cpf == "") { campos = campos + "cpf, "; x = 1;}
			if (dianasci == "") { campos = campos + "dia de nascimento, "; x = 1;}
			if (mesnasci == "") { campos = campos + "mês de Nascimento, "; x = 1;}
			if (anonasci == "") { campos = campos + "ano de Nascimento, "; x = 1;}
			if (sexo == "") { campos = campos + "sexo, "; x = 1;}
			
			if (cep == "") { campos = campos + "CEP, "; x = 1;}
			if (tipo == "") { campos = campos + "tipo, "; x = 1;}
			if (endereco == "") { campos = campos + "endereço, "; x = 1;}
			if (numero == "") { campos = campos + "numero do endereço, "; x = 1;}
			if (bairro == "") { campos = campos + "bairro, "; x = 1;}
			if (cidade == "") { campos = campos + "cidade, "; x = 1;}
			if (estado == "") { campos = campos + "estado, "; x = 1;}
			if (ddd1 == "") { campos = campos + "DDD, "; x = 1;}
			if (telefone1 == "") { campos = campos + "telefone, "; x = 1;}
		}else{
			alert("A senha não tem no mínimo 6 dígitos ou sua confirmação está incorreta!");
			x = 1;
			document.cadastro.senha.focus();
			return false;
		}
	} else{
		alert("A confirmação de seu E-mail esta incorreta!");
		x = 1;
		document.cadastro.email2.focus();
		return false;
	}
	
	if (x == 1) {
		alert("O(s) campo(s) "+campos+" não pode(m) ser deixado(s) em branco!");
		return false;
	}
	
	if (x == 0){
		return true;
	}
	
}

function verificanumero(src){

	if (isNaN(src.value)){
		alert ("O campo " + src.name + " deve conter apenas numeros!");
		src.value = "";
		src.focus();
	}
}

function verificafrete(){
	var src = document.frete.cep;
	if (src.value == "" || src.value.length < 8){
		alert ("Cep invalido!");
		src.value = "";
		src.focus();
		return false;
	}
		
	if (isNaN(src.value)){
		alert ("O campo " + src.name + " deve conter apenas numeros!");
		src.value = "";
		src.focus();
		return false;
	}
}


function verificafrete2(form){
	
preencheu = false;
botoes = form.tipo.length;
for (i=0;i<botoes;i++) {
if (form.tipo[i].checked) {
preencheu = true;
break; }
}
if (preencheu) {
form.submit(); }
else {
alert("É necessário escolher o tipo do frete!");
return false;
}
}

function muda_frete(valor,total){
	var frete =	moeda.formatar(valor);
	var soma = moeda.formatar(valor+total);
	document.getElementById("div_frete").innerHTML = "R$ "+frete;
	document.getElementById("div_total").innerHTML = "R$ "+soma;
		
}

function formatar(src, mask) {
	if (navigator.appName == 'Microsoft Internet Explorer') {
 	   
	   var i = src.value.length;
        var saida = mask.substring(i,i+1);
        var ascii = event.keyCode;
				
			
	
        if (saida == "A") {
            if ((ascii >=97) && (ascii <= 122)) { event.keyCode -= 32; }
            else { event.keyCode = 0; }
        } else if (saida == "0") {
            if ((ascii >= 48) && (ascii <= 57)) { return false; }
            else { event.keyCode = 0 }
        } else if (saida == "#") {
            return;
        } else {
            src.value += saida;
            i += 1;
            saida = mask.substring(i,i+1);
            if (saida == "A") {
                if ((ascii >=97) && (ascii <= 122)) { event.keyCode -= 32; }
                else { event.keyCode = 0; }
            } else if (saida == "0") {
                if ((ascii >= 48) && (ascii <= 57)) { return false; }
                else { event.keyCode = 0 }
            } else { return false; }
        }
	} 
}


function testaficha(){	
var x;
var campos;
x=0;
campos = "";
var mail = document.ficha.Email;

var parte1 = mail.value.indexOf("@");
var parte2 = mail.value.indexOf(".");
var parte3 = mail.value.length;
if (!(parte1 >= 3 && parte2 >= 6 && parte3 >= 9)) {
alert ("O E-mail digitado não é um endereço valido!");
mail.focus();
return false;
}



		
 	if (document.ficha.Email.value == document.ficha.Email2.value) {
		x = 0;
		if (document.ficha.Nome.value.length == 0) { campos = campos + "Nome, "; x = 1;	}
		if (document.ficha.Endereco.value.length==0) { campos = campos + "Endereço, "; x=1; }
		if (document.ficha.Bairro.value.length==0) { campos = campos + "Bairro, "; x=1; }
		if (document.ficha.Cidade.value.length==0) { campos = campos + "Cidade, "; x=1; }
		if (document.ficha.Estado.value==1) { campos = campos + "Estado, "; x=1; }		
		if (document.ficha.Cep.value.length==0) { campos = campos + "Cep, "; x=1; }
		if (document.ficha.Telefone.value.length==0 || document.ficha.TelefoneDDD.value.length==0) { campos = campos + "Telefone, "; x=1; }
		if (document.ficha.Data_nascimentoD.value.length==0 || document.ficha.Data_nascimentoM.value.length==0 || document.ficha.Data_nascimentoA.value.length==0) { campos = campos + "Data nascimento, "; x=1; }
		if (document.ficha.Escolaridade.value.length==0) { campos = campos + "Escolaridade, "; x=1; }
		if (document.ficha.Profissao.value.length==0) { campos = campos + "Profissão, "; x=1; }
		if (document.ficha.Seu_Paroco_tem_conhecimento.value==1) { campos = campos + "'Seu Pároco sabe de seu interesse vocacional?', "; x=1; }
		if (document.ficha.Iniciacao.value==1) { campos = campos + "'Já fez a iniciação cristã?', "; x=1; }
		if (document.ficha.Email.value.length==0) { campos = campos + "E-mail, "; x=1; }
		if (document.ficha.Email2.value.length==0) { campos = campos + "Confirme seu E-mail, "; x=1; }
	} else{
		alert("A confirmação de seu E-mail esta incorreta!");
		x = 1;
		return false;
	}
	
	if (x == 1) {
		alert("O(s) campo(s) "+campos+" não pode(m) ser deixado(s) em branco!");
		return false;
	} else{
		return true	;
	}
	
}


function topo(){
AC_FL_RunContent( 'codebase','http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,28,0','width','1001','height','273','src','/swf/topo','quality','high','pluginspage','http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash','menu','false','wmode','opaque','movie','/swf/topo' ); //end AC code
document.write('<noscript>');
document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,28,0" width="1001" height="273">');
document.write('<param name="movie" value="/swf/topo.swf" />');
document.write('<param name="quality" value="high" />');
document.write('<param name="menu" value="false" />');
document.write('<param name="wmode" value="transparent" />');
document.write('<param name="BGCOLOR" value="#666666" />');

document.write('<embed src="/swf/topo.swf" width="1001" height="273" quality="high" pluginspage="http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" menu="false" wmode="opaque">');
document.write('</embed>');
document.write('</object>');
document.write('</noscript>');
}

function menu()
{
AC_FL_RunContent( 'codebase','http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,28,0','width','1000','height','578','src','/swf/menu','quality','high','pluginspage','http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash','wmode','transparent','menu','false','movie','/swf/menu' ); //end AC code
document.write('<noscript>');
document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,28,0" width="1000" height="578">');
document.write('<param name="movie" value="/swf/menu.swf" />');
document.write('<param name="quality" value="high" />');
document.write('<param name="wmode" value="transparent" />');
document.write('<param name="menu" value="false" />');
document.write('<embed src="/swf/menu.swf" width="1000" height="578" quality="high" pluginspage="http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" wmode="transparent" menu="false">');
document.write('</embed>');
document.write('</object>');
document.write('</noscript>	');
}

function transf(){
document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,28,0" width=100% height=100%> ');
document.write('<param name="movie" value="/swf/transfi.swf" /> ');
document.write('<PARAM NAME=loop VALUE=false /> ');
document.write('<PARAM NAME=quality VALUE=high /> ');
document.write('<param name="menu" value="false" /> ');
document.write('<PARAM NAME=bgcolor VALUE=#ffffff /> ');
document.write('<EMBED src="/swf/transfi.swf" loop=false quality=high bgcolor=#ffffff  WIDTH=100% HEIGHT=100% TYPE="application/x-shockwave-flash" pluginspage="http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash">');
document.write('</embed> '); 
document.write('</object> ');
}


function controlaCamada(divnome,op) { 
var flow = op;
var nomeDiv = divnome;
if(navigator.appName == "Microsoft Internet Explorer"){
	document.getElementById(nomeDiv).style.overflow = "visible";
	return;
}else {
	if( flow == 1 ) { 
		document.getElementById(nomeDiv).style.overflow = "hidden";
	}
	if( flow == 0 ) {  
		document.getElementById(nomeDiv).style.overflow = "visible";
	}
}
} 

function altura(h) {
	if(navigator.appName == "Microsoft Internet Explorer"){
		document.getElementById('direita').style.height = h+'px';
		document.getElementById('menu').style.height = h+'px';
		document.getElementById('corpo').style.paddingTop = 22+'px';
	} else {
		window.moveTo(0,0);
		window.resizeTo(screen.width-1,screen.height-1);
		window.resizeTo(screen.width,screen.height);
		document.getElementById('direita').style.height = h+90+'px';
		document.getElementById('menu').style.height = h+90+'px';
	}
}

function divsobrediv(nomeDiv,quantidade,x1,y1,x2,y2,reverso) { 
//As div's que serão sobrepostas (minimo duas div's), devem ter o mesmo ID somado a um numero na ordem crescente ex: fotos1 fotos2 fotos3. Método: divsobrediv('nome das div’s sem o numero', quantidade de div’s, posição x da primeira Div, posição y da primeira Div, posição x da segunda Div, posição y da segunda Div, 'sim' para as Div's ficar alternadas uma a esquerda e outra a direita e 'nao' para elas ficarem em forma de cascata);.
	var calculoX;
	var claculoY;
	calculoX = x2 - x1;
	calculoY = y2 - y1;
	var atualX;
	var atualY;
	atualX = x1;
	if(navigator.appName == "Microsoft Internet Explorer"){
		atualY = y1;
	} else {
		atualY = y1 + 58;
	}
	var controle;
	controle = 1;
	
	document.getElementById(nomeDiv+controle).style.position = 'absolute';
	document.getElementById(nomeDiv+controle).style.zIndex = controle;
	document.getElementById(nomeDiv+controle).style.left = atualX+'px';
	document.getElementById(nomeDiv+controle).style.top = atualY+'px';
	controle = controle + 1;

	while (controle <= quantidade){
		
		document.getElementById(nomeDiv+controle).style.position = 'absolute';
		document.getElementById(nomeDiv+controle).style.zIndex = controle;
		atualX = atualX + calculoX;
		document.getElementById(nomeDiv+controle).style.left = atualX+'px';
		atualY = atualY + calculoY;
    	document.getElementById(nomeDiv+controle).style.top = atualY+'px';
		controle = controle + 1;
		
		if (reverso == 'sim') {
			if (controle <= quantidade){
				
				document.getElementById(nomeDiv+controle).style.position = 'absolute';
				document.getElementById(nomeDiv+controle).style.zIndex = controle - 2;
				atualX = atualX - calculoX;
				document.getElementById(nomeDiv+controle).style.left = atualX+'px';
				atualY = atualY + calculoY;
    			document.getElementById(nomeDiv+controle).style.top = atualY+'px';
				controle = controle + 1;
				
			}
		}
	}
}
function controlazindex(nomeDiv,fica) {
//metodo: controlazindex('Nome da Div',Z-index que ela vai ficar);
	document.getElementById(nomeDiv).style.zIndex = fica;
}


function mudaImagem(id_imagem,caminho_imagem,titulo){
   document.getElementById(id_imagem).src = caminho_imagem;
   document.getElementById("titulo").innerHTML = titulo;
}



