/* google analytics */

  var _gaq = _gaq || [];
  _gaq.push(['_setAccount', 'UA-25472752-1']);
  _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);
  })();

/* google analytics */


$(document).ready(function()
{

	$(".opacity").mouseover(function() {
		$(this).stop().animate({'opacity':0.6}, 300);
	}),
	$(".opacity").mouseout(function() {
		$(this).stop().animate({'opacity':1.0}, 300);
	}); 

	$(".logo").mouseover(function() {
		$(this).stop().animate({'opacity':0.6}, 300);
	}),
	$(".logo").mouseout(function() {
		$(this).stop().animate({'opacity':1.0}, 300);
	});

	$(".buttons").mouseover(function() {
		$(this).stop().animate({'opacity':0.6}, 300);
	}),
	$(".buttons").mouseout(function() {
		$(this).stop().animate({'opacity':1.0}, 300);
	});

	$("#uf").change(function() {
		$.ajax({
			type: "POST",
			url: "setRegCityFromUf.php",
			data: "uf="+$("#uf").val(),
			success: function(msg){
				$("#regCity").html(msg);
			}
		});
	});
	$("#regiao").change(function() {
		$.ajax({
			type: "POST",
			url: "setCidadesFromRegiao.php",
			data: "regiao="+$("#regiao").val(),
			success: function(msg){
				$("#cidade").html(msg);
			}
		});
	});

	$("#btBusca").click(function() {
		if ($('#uf').val()=='') var u = '0'; else var u = $('#uf').val();
		if ($('#cidade').val()=='') var c = '0'; else var c = $('#cidade').val();
		if ($('#especie').val()=='') var e = '0'; else var e = $('#especie').val();
		if ($('#sexo').val()=='') var s = '0'; else var s = $('#sexo').val();
		if ($('#idade').val()=='') var i = '0'; else var i = $('#idade').val();
		location.href = './busca,'+u+','+c+','+e+','+s+','+i+',0.html';
	});

});
