// funçoes 
// autor: valmir - bionica
// data:  13/10/2010

function carrega(url,titulo){

	img = '<img src="'+url+'"><div id="tituloimg">'+titulo+'</div>';

	di = document.getElementById('img-galeria');
	di.innerHTML = (img);
	
	
}

function display_capcha(Thisdiv){
	 divstyle = document.getElementById(Thisdiv).style.display;
     document.getElementById(Thisdiv).style.display = "block";
}
/*
d = document.news;
				alert(document.getElementById("cc").value);
										return false;
				if(d.codcaptcha.value == d.captcha_txt.value){
					return true;
				}else{
						msg = document.getElementById("msgerro");
						msg.innerHTML = ("Código incorreto! ");
						return false;
				}
			}*/
//function oi(){alert("oi");}				




function validacap(campoOucut, campoText, idmsgerro){
			var campoText;
			var campoOucut;
			campoText = document.getElementById(campoText).value;
			campoOucut = document.getElementById(campoOucut).value;

		if(campoText == campoOucut){				
					
					var nome;
					var email;
					var url;
					nome = document.getElementById("nome").value
					email = document.getElementById("email").value
					
					
					 msgdiv = document.getElementById(idmsgerro);
					 msgdiv.innerHTML = ('<span style="color:#090">Aguarde...</span>');
					
					$(function(){
					  $.ajax({
							   type: "POST",
							   url: "cadastro-newsletter.php",
							   data: "nome="+nome+"&email="+email+"&campoText="+campoText+"&campoOucut="+campoOucut,
							   success: function(msg){							 
								    // $("#msgerrosalvar").append(msg);
								     msgdiv = document.getElementById(idmsgerro);
								     msgdiv.innerHTML = (msg);
							   }
							 });    
					});		                        			
				
				return false;
		}else{
				msg = document.getElementById(idmsgerro);
				msg.innerHTML = ("Código incorreto! ");
				return false;
		}
		return false;
}

//atuliza com ajax entidades
function sel_ajax(){

	id = document.getElementById("sel_enti").value;


			if(id != "null"){

				$(function(){	

					  $.ajax({
							   type: "POST",
							   url: "selajax.php",
							   data: "id="+id,
							   success: function(msg){							 
								    // $("#msgerrosalvar").append(msg);
								     msgdiv = document.getElementById("sel_ajax");
								     msgdiv.innerHTML = (msg);
							   }
							 });    
					});	
			}
		        
	
	return false;
}

function proce(){
	
}


$(function(){
						
		$("#galeria-pag a").click(function(){
		//pagina ="arquivo/"+$(this).attr('href');
			url =$(this).attr('href');
//			alert(url);
						
			$('#ajax-img').load(url);
			return false;
		});					
				
		
		$("#video-pag a").click(function(){
			url =$(this).attr('href');
						
			$('#ajax-video').load(url);
			return false;
		});
		
		
		//muda div new lester
		$("#index-formulario-email, #txtnome ").click(function(){
			url = "newsletter.php";						
			$('#newlester').load(url);
			return false;
		});			
				
					
								
	});
	
	
	

