$(document).ready(function () {
//ver todos depart
	$("#todos-depart").toggle(function(){
		if(todos_depart){
			$.post('../navs/departamentos.asp', function(resposta){
				$('#todos-depart-lista').html(resposta);
			});
			todos_depart = false;
		}
		$('#todos-depart-lista').slideDown('slow');
	}, function() {
		$('#todos-depart-lista').slideUp('slow');
	});
	todos_depart = true;
	$('#todos-depart-lista').hide();

/// Rodapé
	$("#rodape div.mais-informacoes").toggle(function() {
		 $("#rodape div.informacoes").slideUp('slow'); 
		 $("#rodape div.compra-informacoes").slideUp('slow');

	}, function() {
		 $("#rodape div.informacoes").slideDown('slow'); 
		 $("#rodape div.compra-informacoes").slideDown('slow',function(){$.scrollTo("#rodape div.site-informacoes", 500, { easing:'swing' });});
	});							
	$("#rodape div.mais-informacoes").click();	

//news cadastro
	$("#newsletter_enviar").click(function(){
		var campo = $("#newsletter_email")
		var padrao = /^[a-zA-Z0-9._-]+@([a-zA-Z0-9.-]+\.)+[a-zA-Z0-9.-]{2,}$/;
	    if (campo.val().match(padrao)) {
             $.post('../faleconosco/e_news.asp', {email: campo.val() }, function (resposta) {
				$("#newsletter div").show().html("E-mail Cadastrado!");
  	        });
	    }else{
			$("#newsletter div").show().html("E-mail Inválido!");
		};
	});
	$("#newsletter div").hide();
	
	$("#a-tel").hover(  function () {
    
	       $("#pop-tel").show();
		   
	  },  function () {
           $("#pop-tel").hide();  
  	});

$("#a-car").hover(  function () {
    
	       $("#pop-car").show();
		   
	  },  function () {
		  $("#pop-car").hover("", function() {$("#pop-car").hide();}); 
		  $("#menu-index").hover(function(){$("#pop-car").hide();});
		  $(".login").hover(function(){$("#pop-car").hide();});		  
		  $(".busca").hover(function(){$("#pop-car").hide();});		  		  
		  $("#content").hover(function(){$("#pop-car").hide();});		  
		  $("#content-limpo").hover(function(){$("#pop-car").hide();});		  		  
  	});
	
	
});


  var _gaq = _gaq || [];
  _gaq.push(['_setAccount', 'UA-1607370-1']);
  _gaq.push(['_setDomainName', 'none']);
  _gaq.push(['_setAllowLinker', true]);

	if(window.gaDepartamento != undefined ){
  		_gaq.push(['_setCustomVar',1,'Departamento',gaDepartamento,3]);
	}
	if(window.gaCategoria != undefined ){
  		_gaq.push(['_setCustomVar',2,'Categoria', gaCategoria,3]);
	}
	
  _gaq.push(['_trackPageview']);

  (function() {
    var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
    ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
  })();
