
      $(function(){
          $(".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
          });
          
          $("#menu ul").lavaLamp({ fx: "backout", speed: 700 });

      });

      
    //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, titulo);
    		else if (window.sidebar) window.sidebar.addPanel(titulo, 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();
      }
      
