
      $(function(){
	
				// Banners	
			  if(jQuery("#itens_videos li").length>1){
			  	jQuery("#itens_videos ul").jcarousel({
			    	scroll: 2,
						auto: 4,
				    wrap: 'last',	
			      easing: 'easeOutExpo',
			      animation: 1300,
			      initCallback: initCallback,
			      buttonNextHTML: null,
			      buttonPrevHTML: null
			    });
			   }
			
				// Noticias	
			  if(jQuery("#itens_noticias li").length>1){
			  	jQuery("#itens_noticias ul").jcarousel({
			    	scroll: 1,
						auto: 5,
						vertical : true,
				    wrap: 'last',	
			      easing: 'easeOutExpo',
			      animation: 1300,
			      initCallback: initCallbackCarousel,
			      itemFirstInCallback: {onBeforeAnimation: itemFirstInCallback},
			      buttonNextHTML: null,
			      buttonPrevHTML: null
			    });
			   }
			
				// Noticias	
			  if(jQuery("#itens_publicidade li").length>10){
			  	jQuery("#itens_publicidade ul").jcarousel({
			    	scroll: 1,
						auto: 5,
						vertical : true,
				    wrap: 'last',	
			      easing: 'easeOutExpo',
			      animation: 1300,
			      initCallback: initCallbackCarousel2,
			      itemFirstInCallback: {onBeforeAnimation: itemFirstInCallback2},
			      buttonNextHTML: null,
			      buttonPrevHTML: null
			    });
			   }			
	
	
          $("#bt_enquete").fancybox({
              'width'         : 550,
              'height'        : 280,
              'transitionIn'  : 'elastic',
              'transitionOut' : 'elastic',
              'speedIn'   : 600,
              'speedOut'    : 200,
              'overlayShow' : true,
              'centerOnScroll' : true,
              'overlayColor': '#000',
              'overlayOpacity': 0.8,
              'titleShow': false
          });



      });




			// Portifolio
			function initCallback(carousel) {
			  jQuery('#nav_videos #next').bind('click', function() {
			      carousel.next();
			      return false;
			  });

			  jQuery('#nav_videos #back').bind('click', function() {
			      carousel.prev();
			      return false;
			  });

			};





      
    //Objeto para Enquete
      var Enquete = {
      		
      		/* Release form in the Ajax content*/		
      		release : function(form){
      			jQuery('#campos-enquete').hide();
      			jQuery('#campo-votar').hide();
      			jQuery('#msgReturn-enquete').html('* Aguarde <strong>totalizando</strong> o voto!').fadeIn();		
      			with(form) {
      				
      				jQuery.ajax({							
      					url:'/assets/ajax/enquete.php', type:'post', data:jQuery(form).serialize(),								
      					success:function(response) {
      						 
      						
      						if(response == "error"){
      							jQuery('#campos-enquete').fadeOut(100, function(){jQuery('#msgReturn-enquete').html('* <strong>Problemas</strong> tente mais tarde!').fadeIn()});						
      							setTimeout(function() { jQuery('#msgReturn-enquete').fadeOut(100,function(){jQuery('#campos-newslleter').fadeIn()});}, 4100);	
      						}
      						
      						if(response == "ok"){
      							$("#campo-resultado").show();
      							jQuery('#campos-enquete').fadeOut(100, function(){jQuery('#msgReturn-enquete').html('* Seu voto já foi <strong>contabilizado obrigado!</strong>').fadeIn()});      							
      							$(".botoes_enquete input").hide();
      						}      						
      							
      						
      					}				
      				});
      				
      				return false;
      			}			
      		}	
      	}

      
      
      
      // Objeto para Newslleter
      var Newslleter = {
      		
      		/* Validate form */
      		validate : function(form) {
      				with(form) {
      					
      					if(nome.value == "" || email.value == "" || nome.value == "Nome:" || email.value == "E-mail:" ) {
      						
      						jQuery('#campos-newslleter').fadeOut(100, function(){jQuery('#msgReturn').html('* <strong>Nome</strong> deve ser Preenchido! <br /> * <strong>E-mail</strong> deve ser Preenchido!').fadeIn()});						
      						setTimeout(function() { jQuery('#msgReturn').fadeOut(100,function(){jQuery('#campos-newslleter').fadeIn()});}, 4100);
      						
      					} else if(email.value.indexOf("@") == -1){
      						
      						jQuery('#campos-newslleter').fadeOut(100, function(){jQuery('#msgReturn').html('* <strong>E-mail</strong> incorreto!').fadeIn()});						
      						setTimeout(function() { jQuery('#msgReturn').fadeOut(100,function(){jQuery('#campos-newslleter').fadeIn()});}, 4100);
      						
      					}else{					
      						this.release(form);
      					}
      				}
      				return false;
      			},		

      		/* Release form in the Ajax content*/		
      		release : function(form){				
      						
      			with(form) {				
      				jQuery.ajax({							
      					url:'/assets/ajax/cadastrar.php', type:'post', data:jQuery(form).serialize(),								
      					success:function(response) {
      						
      						
      					
      						if(response == "EmailExists"){
      							jQuery('#campos-newslleter').fadeOut(100, function(){jQuery('#msgReturn').html('* <strong>E-mail</strong> já existe!').fadeIn()});						
      							setTimeout(function() { jQuery('#msgReturn').fadeOut(100,function(){jQuery('#campos-newslleter').fadeIn()});}, 4100);	
      						}
      						
      						if(response == "Ok"){
      							jQuery('#campos-newslleter').fadeOut(100, function(){jQuery('#msgReturn').html('* <strong class="cadastro_sucess">E-mail</strong> cadastrato com sucesso!').fadeIn()});						
      							setTimeout(function() { jQuery('#msgReturn').fadeOut(100,function(){jQuery('#campos-newslleter').fadeIn()});}, 4100);
      							nome.value = "";
      							email.value = "";
      						}
      						
      						
      							
      						return false;
      					}				
      				});	
      			}			
      		}	
      	}
      
      
      
      function addFavorito(url){
    		if (document.all) window.external.AddFavorite(url, "Jornal Palavra Cristã ");
    		else if (window.sidebar) window.sidebar.addPanel("Jornal Palavra Cristã ", url, "");
    	}


      
   // Tamanho Fonte
      function ChangeFontSize(acao) {
      	var ObjTexto		= (document.getElementById) ? document.getElementById('textos_interno') : document.all('textos_interno');
      	if(ObjTexto==null){
      		var ObjTexto	= (document.getElementById) ? document.getElementById('textos_interno') : document.all('textos_interno');
      	};
      	var FonteTamAtual	= parseInt(document.getElementById('query_busca').diversos.value);	
      	switch(acao){
      		case '+':
      			FonteTamNovo	=	FonteTamAtual+2;
      			break;
      		case '-':
      			FonteTamNovo	=	FonteTamAtual-2;
      			break;		
      	}
      	document.getElementById('query_busca').diversos.value	=	FonteTamNovo;
      	ObjTexto.style.fontSize				=	FonteTamNovo+"px";
      }
      
      function pop_up_center(local, w, h, scrol)
      {
      	var instan	=	local.replace(/\./g,"");
      	instan		=	instan.replace(/\?/g,"");
      	instan		=	instan.replace(/\//g,"");
      	instan		=	instan.replace(/=/g,"");
      	instan		=	instan.replace(/;/g,"");
      	instan		=	instan.replace(/:/g,"");
      	instan		=	instan.replace(/-/g,"");

      	var largura = screen.width;
      	var altura 	= screen.height;
      	var XX 		= (largura-w)/2;
      	var YY		= (altura-h)/2;
      	var janela  = window.open(local,'POP_UP'+instan,'width='+w+',height='+h+',left='+XX+',top='+YY+',scrollbars='+scrol+',status=no,resizable=yes, toolbar=no,directories=no,menubar=no');
      	janela.focus();
      }
      

			// Configura os Botões Carrosel Destaque
			function initCallbackCarousel(carousel) {
			    jQuery('#numeros_noticias li').bind('click', function() {
			        carousel.scroll(jQuery.jcarousel.intval(jQuery(this).text()));
			        return false;
			    });
			};

			function itemFirstInCallback(carousel, item, idx, state) {
			    $("#numeros_noticias li").not(".prev").not(".next").each(function(j){
			  	  if((j+1)== idx)
			  		  $(this).addClass('active');
			  	  else
			  		  $(this).removeClass('active');
			  	});
			};


			// Configura os Botões Carrosel Destaque
			function initCallbackCarousel2(carousel) {

			};

			function itemFirstInCallback2(carousel, item, idx, state) {
			};

