// JavaScript Document
window.onload=function(){
Nifty("div#noticias2,div#bens,div#artigos,div#comentarios,div#interno,div#ferramentas,div#noticias,div#enquete,div#publicidade,div#destaques,div#destaques2,div#artigos,div#tempo,div#busca_municipio,div#ficha,div#perfil_politico,div#login,div#multimidia,div#noticiasG1,div#noticiasFolha,div#informativos,div#economia,div#noticias,div#fotos,div#boxpoliticosleft1,div#boxpoliticosleft2,div#imprime_noticias,div#cadastro_desempenho","transparent");

$(function(){
	$('#carousel').infiniteCarousel({
	transitionSpeed : 2000,
	displayTime : 10000,
	displayThumbnailBackground : false,
	textholderHeight : .25,
	displayProgressBar : false,
	showControls: true
	
	});
});

}

function onoff(id) {
var el = document.getElementById(id);
el.style.display = (el.style.display=="none") ? "" : "none"; 
}


function lookup(inputString) {
	
	if(inputString.length == 0) {
		// Hide the suggestion box.
		$('#suggestions').hide();
	} else {
		$.post("cidades.php", {queryString: ""+inputString+""}, function(data){
		
		if(data.length >0) {
			$('#suggestions').show();
			$('#autoSuggestionsList').html(data);
		}
	});
	}
} // lookup
	
function fill(thisValue) {
		$('#inputString').val(thisValue);
		setTimeout("$('#suggestions').hide();", 200);
} 

function indique(){
		window.open('form2.php','Indique', 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,width=350,height=310');
}

function favorito(){
    var url      = "http://www.politicosbrasileiros.com.br/";
    var title    = "Politicos Brasileiros";
    if (window.sidebar) window.sidebar.addPanel(title, url,"");
    else if(window.opera && window.print){
        var mbm = document.createElement('a');
        mbm.setAttribute('rel','sidebar');
        mbm.setAttribute('href',url);
        mbm.setAttribute('title',title);
        mbm.click();
    }
    else if(document.all){window.external.AddFavorite(url, title);}
}

function valida_campos(form){

	 if(cadastro.nome.value==""){
	   alert("Campo Nome é obrigatório!");
	    cadastro.nome.focus();
		cadastro.nome.style.backgroundColor ="#FFE4E4";
		cadastro.nome.select();
	   return false;
	 }
	 if(cadastro.nome_resp.value==""){
	   alert("Campo Nome Responsável é obrigatório!");
	    cadastro.nome_resp.focus();
		cadastro.nome_resp.style.backgroundColor ="#FFE4E4";
		cadastro.nome_resp.select();
	   return false;
	 }	
	 if(cadastro.nome_parl.value==""){
	   alert("Campo Nome do Parlamentar é obrigatório!");
	    cadastro.nome_parl.focus();
		cadastro.nome_parl.style.backgroundColor ="#FFE4E4";
		cadastro.nome_parl.select();
	   return false;
	 }	 
	 if(cadastro.estado.value==""){
	   alert("Campo Estado é obrigatório!");
	    cadastro.estado.focus();
		cadastro.estado.style.backgroundColor ="#FFE4E4";
		cadastro.estado.select();
	   return false;
	 }	
	 if(cadastro.cidade.value==""){
	   alert("Campo Cidade é obrigatório!");
	    cadastro.cidade.focus();
		cadastro.cidade.style.backgroundColor ="#FFE4E4";
		cadastro.cidade.select();
	   return false;
	 }	 
	 if(cadastro.cargo.value==""){
	   alert("Campo Cargo do Parlamentar é obrigatório!");
	    cadastro.cargo.focus();
		cadastro.cargo.style.backgroundColor ="#FFE4E4";
		cadastro.cargo.select();
	   return false;
	 }	
	 if(cadastro.telefone.value==""){
	   alert("Campo Telefone é obrigatório!");
	    cadastro.telefone.focus();
		cadastro.telefone.style.backgroundColor ="#FFE4E4";
		cadastro.telefone.select();
	   return false;
	 }	 
     if(cadastro.email.value==""){
	   alert("Campo e-mail é obrigatório!");
	    cadastro.email.focus();
		cadastro.email.style.backgroundColor ="#FFE4E4";
		cadastro.email.select();
	   return false;
	 }

     if(cadastro.senha.value==""){
	   alert("Campo Senha é obrigatório!");
	    cadastro.senha.focus();
		cadastro.senha.style.backgroundColor ="#FFE4E4";
		cadastro.senha.select();
	   return false;
	 }
     if(cadastro.rept_senha.value==""){
	   alert("Campo Repetir Senha é obrigatório!");
	    cadastro.rept_senha.focus();
		cadastro.rept_senha.style.backgroundColor ="#FFE4E4";
		cadastro.rept_senha.select();
	   return false;
	 }	
     if(cadastro.rept_senha.value!=cadastro.senha.value){
	   alert("Campo Repetir senha diferente da Senha!");
	    cadastro.rept_senha.focus();
		cadastro.rept_senha.style.backgroundColor ="#FFE4E4";
		cadastro.rept_senha.select();
	   return false;
	 }	 
}
function valida_campos2(form){


	 if(cadastro.nome_resp.value==""){
	   alert("Campo Nome Responsável é obrigatório!");
	    cadastro.nome_resp.focus();
		cadastro.nome_resp.style.backgroundColor ="#FFE4E4";
		cadastro.nome_resp.select();
	   return false;
	 }	
	 if(cadastro.nome_parl.value==""){
	   alert("Campo Nome do Parlamentar é obrigatório!");
	    cadastro.nome_parl.focus();
		cadastro.nome_parl.style.backgroundColor ="#FFE4E4";
		cadastro.nome_parl.select();
	   return false;
	 }	 
	 if(cadastro.estado.value==""){
	   alert("Campo Estado é obrigatório!");
	    cadastro.estado.focus();
		cadastro.estado.style.backgroundColor ="#FFE4E4";
		cadastro.estado.select();
	   return false;
	 }	
	 if(cadastro.cidade.value==""){
	   alert("Campo Cidade é obrigatório!");
	    cadastro.cidade.focus();
		cadastro.cidade.style.backgroundColor ="#FFE4E4";
		cadastro.cidade.select();
	   return false;
	 }	 
	 if(cadastro.cargo.value==""){
	   alert("Campo Cargo do Parlamentar é obrigatório!");
	    cadastro.cargo.focus();
		cadastro.cargo.style.backgroundColor ="#FFE4E4";
		cadastro.cargo.select();
	   return false;
	 }	
     if(cadastro.email.value==""){
	   alert("Campo e-mail é obrigatório!");
	    cadastro.email.focus();
		cadastro.email.style.backgroundColor ="#FFE4E4";
		cadastro.email.select();
	   return false;
	 }	 
	 if(cadastro.telefone.value==""){
	   alert("Campo Telefone é obrigatório!");
	    cadastro.telefone.focus();
		cadastro.telefone.style.backgroundColor ="#FFE4E4";
		cadastro.telefone.select();
	   return false;
	 }	 

}

function limpa() {
document.getElementById('inputString').value="";


}
