$().ready(function() {
	$(".filterfor #open a").click(function(){
		  $(".advanced").animate({height: '300px'}, 300);
		  $(".filterfor #close a").show();
		  $(".filterfor #filter_search").show();
		  $(".filterfor #open a").css("background", "url(imgs/filter.png) no-repeat left top");
	});
	$(".filterfor #close a").click(function(){
		  $(".advanced").animate({height: '40px'}, 300);
		  $(".filterfor #filter_search").hide();
		  $(this).hide();
		  $(".filterfor #open a").css("background", "url(imgs/filter_advanced.png) no-repeat left top");
	});
	
	$(".filterfor #open a").click(function(){
		  $(".advanced").animate({height: '300px'}, 300);
		  $(".filterfor #close a").show();
		  $(".filterfor #filter_search").show();
		  $(".filterfor #openCommunity a").css("background", "url(imgs/filter.png) no-repeat left top");
	});
	$(".filterfor #close a").click(function(){
		  $(".advanced").animate({height: '40px'}, 300);
		  $(".filterfor #filter_search").hide();
		  $(this).hide();
		  $(".filterfor #openCommunity a").css("background", "url(imgs/advanced_search.png) no-repeat left top");
	});


	$(".searchdating .simple #open a").click(function(){
		  $("#dating").animate({height: '190px'}, 300);
		  $(".advanced").show();
		  $(".cerca").show();
		  $(".cerca").css("display", "block");				
		  $(".cercaA").css("text-align", "center");
		  $(".speciali").show();
		  $("#datingForm").show();		
		  $("#close a").show();
		  $("#open a").css("background", "url(imgs/semplice.png) no-repeat left top");
	});
	$(".searchdating .simple #close a").click(function(){
		  $(".searchdating #dating").hide();
		  $(".cerca").hide();
		  $(".cercaA").css("text-align", "center");		
		  $(".advanced").hide();
		  $(".speciali").hide();
		  $("#datingForm").hide();
		  $(this).hide();
		  $("#open a").css("background", "url(imgs/advanced_search.png) no-repeat left top");
	});

	$("#detailstab-1c .entry-title a").click(function(e){
		  e.preventDefault();
		  elem = $(this).attr('href');
	      if ($(elem).is(":hidden")) {
	         $(elem).slideDown();
	      } else {
	         $(elem).slideUp();
	      }
	});
	$("#detailstab-1c .chiudi a").click(function(e){
		  e.preventDefault();
		  $(this).parent().parent().slideUp();
	});

	$("#detailstab-1e .entry-title a").click(function(e){
		  e.preventDefault();
		  elem = $(this).attr('href');
	      if ($(elem).is(":hidden")) {
	         $(elem).slideDown();
	      } else {
	         $(elem).slideUp();
	      }
	});
	$("#detailstab-1e .chiudi a").click(function(e){
		  e.preventDefault();
		  $(this).parent().parent().slideUp();
	});


});