function SelVitrineTurismo(id){
		   document.getElementById(id).style.display="block";
		   
			if (id==1){
			   document.getElementById('2').style.display="none";
			   document.getElementById('3').style.display="none";
			   document.getElementById('4').style.display="none";
			   document.getElementById('5').style.display="none";
			   document.getElementById('v1').style.background="#9f1b33";
			   document.getElementById('v2').style.background="#c57685";
			   document.getElementById('v3').style.background="#c57685";
			   document.getElementById('v4').style.background="#c57685";
			   document.getElementById('v5').style.background="#c57685";
			}
			if (id==2){
			   document.getElementById('1').style.display="none";
			   document.getElementById('3').style.display="none";
			   document.getElementById('4').style.display="none";
			   document.getElementById('5').style.display="none";
			   document.getElementById('v2').style.background="#9f1b33";
			   document.getElementById('v1').style.background="#c57685";
			   document.getElementById('v3').style.background="#c57685";
			   document.getElementById('v4').style.background="#c57685";
			   document.getElementById('v5').style.background="#c57685";
			}
			if (id==3){
			   document.getElementById('2').style.display="none";
			   document.getElementById('1').style.display="none";
			   document.getElementById('4').style.display="none";
			   document.getElementById('5').style.display="none";
			   document.getElementById('v3').style.background="#9f1b33";
			   document.getElementById('v1').style.background="#c57685";
			   document.getElementById('v2').style.background="#c57685";
			   document.getElementById('v4').style.background="#c57685";
			   document.getElementById('v5').style.background="#c57685";
			}
			if (id==4){
			   document.getElementById('2').style.display="none";
			   document.getElementById('3').style.display="none";
			   document.getElementById('1').style.display="none";
			   document.getElementById('5').style.display="none";
			   document.getElementById('v4').style.background="#9f1b33";
			   document.getElementById('v1').style.background="#c57685";
			   document.getElementById('v2').style.background="#c57685";
			   document.getElementById('v3').style.background="#c57685";
			   document.getElementById('v5').style.background="#c57685";
			}
			if (id==5){
			   document.getElementById('2').style.display="none";
			   document.getElementById('3').style.display="none";
			   document.getElementById('4').style.display="none";
			   document.getElementById('1').style.display="none";
			   document.getElementById('v5').style.background="#9f1b33";
			   document.getElementById('v1').style.background="#c57685";
			   document.getElementById('v2').style.background="#c57685";
			   document.getElementById('v3').style.background="#c57685";
			   document.getElementById('v4').style.background="#c57685";
			}
		  }

	b=0
	function slideshow(){
		switch (b){
			case 1:SelVitrineTurismo('1');
	  		break;
			case 2:SelVitrineTurismo('2');
	   		break;   
			case 3:SelVitrineTurismo('3');
	   		break;   
			case 4:SelVitrineTurismo('4');
	   		break;   
			case 5:SelVitrineTurismo('5');   	   	
			b= -1;
		}
	  b++;
	}
	
function Inicializar (){
  slideshow();
  setInterval (slideshow,5000);
} 



function paginacaoTurismo(tipoConteudo,numero) {
  var url = 'listaMaisPacotes.asp?tipoConteudo='+tipoConteudo+'&n_page='+ numero+'';
  if(window.ActiveXObject) {
 	 ajaxTurismo = new ActiveXObject("Microsoft.XMLHTTP"); /*Inicia o Ajax*/
  } else {
 	 ajaxTurismo = new XMLHttpRequest("Microsoft.XMLHTTP"); /*Inicia o Ajax*/
  }
  ajaxTurismo.open('GET', url)
  ajaxTurismo.onreadystatechange = function() {
	  if (ajaxTurismo.readyState == 1) {
		  //document.getElementById('listaIndice').innerHTML = '<img src="img/loading.gif" title="Carregando..."/> Carregando...';
	  }
	  if (ajaxTurismo.readyState == 4) {
		  if (ajaxTurismo.status == 200) {
			  document.getElementById('outros_pacotes').innerHTML = ajaxTurismo.responseText;
		  } else {
			  document.getElementById('outros_pacotes').innerHTML = ajaxTurismo.responseText;
			  document.getElementById('').innerHTML = ajaxTurismo.responseText;
		  }
	  }
  }
  ajaxTurismo.send(url);
}

function paginacaoTurismoTodos(tipo,numero) {
  var url = 'listaTodosPacotes.asp?tipo='+tipo+'&n_page=' + numero;
  if(window.ActiveXObject) {
 	 ajaxListaTurismo= new ActiveXObject("Microsoft.XMLHTTP"); /*Inicia o Ajax*/
  } else {
 	 ajaxListaTurismo = new XMLHttpRequest("Microsoft.XMLHTTP"); /*Inicia o Ajax*/
  }
  ajaxListaTurismo.open('GET', url)
  ajaxListaTurismo.onreadystatechange = function() {
	  if (ajaxListaTurismo.readyState == 1) {
		  //document.getElementById('listaIndice').innerHTML = '<img src="img/loading.gif" title="Carregando..."/> Carregando...';
	  }
	  if (ajaxListaTurismo.readyState == 4) {
		  if (ajaxListaTurismo.status == 200) {
			  document.getElementById('todos_pacotes').innerHTML = ajaxListaTurismo.responseText;
		  } else {
			  document.getElementById('todos_pacotes').innerHTML = ajaxListaTurismo.responseText;
			  document.getElementById('').innerHTML = ajaxListaTurismo.responseText;
		  }
	  }
  }
  ajaxListaTurismo.send(url);
}


function mostraFoto(idImg,idCont) {
  var url = 'foto.asp?idImg='+idImg+'&idCont='+idCont;
  if(window.ActiveXObject) {
 	 ajaxListaTurismo= new ActiveXObject("Microsoft.XMLHTTP"); /*Inicia o Ajax*/
  } else {
 	 ajaxListaTurismo = new XMLHttpRequest("Microsoft.XMLHTTP"); /*Inicia o Ajax*/
  }
  ajaxListaTurismo.open('GET', url)
  ajaxListaTurismo.onreadystatechange = function() {
	  if (ajaxListaTurismo.readyState == 1) {
		  //document.getElementById('listaIndice').innerHTML = '<img src="img/loading.gif" title="Carregando..."/> Carregando...';
	  }
	  if (ajaxListaTurismo.readyState == 4) {
		  if (ajaxListaTurismo.status == 200) {
			  document.getElementById('divFoto').innerHTML = ajaxListaTurismo.responseText;
		  } else {
			  document.getElementById('divFoto').innerHTML = ajaxListaTurismo.responseText;
			  document.getElementById('').innerHTML = ajaxListaTurismo.responseText;
		  }
	  }
  }
  ajaxListaTurismo.send(url);
}


function entreContato(){
	if (document.getElementById('contatoTur').style.display=='none'){
		document.getElementById('contatoTur').style.display='block';
		}else{
		document.getElementById('contatoTur').style.display='none';	
		}
	}



function GetXMLHttp() {
	var xmlHttp;
	try {
		xmlHttp = new XMLHttpRequest();
	}
	catch(ee) {
		try {
			xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
		}
		catch(e) {
			try {
				xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
			}
			catch(e) {
				xmlHttp = false;
			}
		}
	}
	return xmlHttp;
}

var Enviar = GetXMLHttp();

function EnviarEmail() {

	var Nome = document.getElementById("Nome");
	var EMail = document.getElementById("EMail");
	var Texto = document.getElementById("Texto");
	var emailAgencia = document.getElementById("emailAgencia");
	var idConteudo = document.getElementById("idConteudo");
		
	
	if (Nome.value==""){
		 valida_nome(Nome.value);
		 return false;
		}
	if (EMail.value==""){
		 valida_email(EMail.value);
		 return false;
		}		
	if (Texto.value==""){
		 valida_comentario(Texto.value);
		 return false;
		}		
	

	var URL = "turismoInterna.asp?EnviarEmail=ok&Nome="+Nome.value+"&EMail="+EMail.value+"&Texto="+Texto.value+"&emailAgencia="+emailAgencia.value+"&idConteudo="+idConteudo.value;
	
	//alert("Mensagem enviada com sucesso!");
	
	Enviar.open("GET", URL, true);
	Enviar.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
	document.getElementById("Resposta").innerHTML = "Mensagem enviada com Sucesso!";
	document.getElementById("contatoTur").style.display='none';

	Nome = "";
	EMail = "";

	Enviar.send(null);
	Enviar.onload = lerTexto;
	
	document.getElementById("Nome").value="";
	document.getElementById("EMail").value="";	
	document.getElementById("Texto").value="";	
	
}
