	
	

	var $w2n = jQuery.noConflict();
	
	$w2n(document).ready(function(){
		
		$w2n(".lista-imoveis-comparacao .remover").click(function(){
																  
			var id = $w2n(this).attr("href");
			var obj = $w2n(this).parent().parent();			
			
				$w2n.ajax({
					type: "POST",
					url: "/ajax/comparacao-remover.asp",
					data: { id: id },
					async: true,
					cache: true,					
					beforeSend: function(){
						
						$w2n("#load-ajax").fadeIn("slow");
						
					},
					success: function(resposta){	
						
						$w2n(obj).hide("slow");
						
						if(resposta=="#"){
							setTimeout("$w2n('#filtro-comparacao').hide('slow');", 500);
						}
					
					},
					complete: function(){
						
						$w2n("#load-ajax").fadeOut("fast");	
						
					},
					error: function(){ 
					
						alert('erro'); 
						
					}
				});
	
			return false;
	
		});
		
		
		$w2n("#filtro-comparacao input:checkbox").click(function(){
			
			if($w2n("#opc-finalidade:checked").length==0){
				$w2n(".lista-imoveis-comparacao .item-finalidade").fadeOut("slow"); }else{
				$w2n(".lista-imoveis-comparacao .item-finalidade").fadeIn("slow");
			}
			
			if($w2n("#opc-tipo-imovel:checked").length==0){
				$w2n(".lista-imoveis-comparacao .item-tipo-imovel").fadeOut("slow"); }else{
				$w2n(".lista-imoveis-comparacao .item-tipo-imovel").fadeIn("slow");
			}
			
			if($w2n("#opc-subtipo-imovel:checked").length==0){
				$w2n(".lista-imoveis-comparacao .item-subtipo-imovel").fadeOut("slow"); }else{
				$w2n(".lista-imoveis-comparacao .item-subtipo-imovel").fadeIn("slow");
			}
			
			if($w2n("#opc-area-construida:checked").length==0){
				$w2n(".lista-imoveis-comparacao .item-area-construida").fadeOut("slow"); }else{
				$w2n(".lista-imoveis-comparacao .item-area-construida").fadeIn("slow");
			}
			
			if($w2n("#opc-area-privativa:checked").length==0){
				$w2n(".lista-imoveis-comparacao .item-area-privativa").fadeOut("slow"); }else{
				$w2n(".lista-imoveis-comparacao .item-area-privativa").fadeIn("slow");
			}
			
			if($w2n("#opc-area-terreno:checked").length==0){
				$w2n(".lista-imoveis-comparacao .item-area-terreno").fadeOut("slow"); }else{
				$w2n(".lista-imoveis-comparacao .item-area-terreno").fadeIn("slow");
			}
			
			if($w2n("#opc-area-total:checked").length==0){
				$w2n(".lista-imoveis-comparacao .item-area-total").fadeOut("slow"); }else{
				$w2n(".lista-imoveis-comparacao .item-area-total").fadeIn("slow");
			}
			
			if($w2n("#opc-dormitorio:checked").length==0){
				$w2n(".lista-imoveis-comparacao .item-dormitorio").fadeOut("slow"); }else{
				$w2n(".lista-imoveis-comparacao .item-dormitorio").fadeIn("slow");
			}
			
			if($w2n("#opc-suite:checked").length==0){
				$w2n(".lista-imoveis-comparacao .item-suite").fadeOut("slow"); }else{
				$w2n(".lista-imoveis-comparacao .item-suite").fadeIn("slow");
			}
			
			if($w2n("#opc-garagem:checked").length==0){
				$w2n(".lista-imoveis-comparacao .item-garagem").fadeOut("slow"); }else{
				$w2n(".lista-imoveis-comparacao .item-garagem").fadeIn("slow");
			}
			
			if($w2n("#opc-cidade:checked").length==0){
				$w2n(".lista-imoveis-comparacao .item-cidade").fadeOut("slow"); }else{
				$w2n(".lista-imoveis-comparacao .item-cidade").fadeIn("slow");
			}
			
			if($w2n("#opc-bairro:checked").length==0){
				$w2n(".lista-imoveis-comparacao .item-bairro").fadeOut("slow"); }else{
				$w2n(".lista-imoveis-comparacao .item-bairro").fadeIn("slow");
			}
			
			if($w2n("#opc-preco:checked").length==0){
				$w2n(".lista-imoveis-comparacao .item-preco").fadeOut("slow"); }else{
				$w2n(".lista-imoveis-comparacao .item-preco").fadeIn("slow");
			}
			
			if($w2n("#opc-preco-iptu:checked").length==0){
				$w2n(".lista-imoveis-comparacao .item-preco-iptu").fadeOut("slow"); }else{
				$w2n(".lista-imoveis-comparacao .item-preco-iptu").fadeIn("slow");
			}
			
			if($w2n("#opc-preco-condominio:checked").length==0){
				$w2n(".lista-imoveis-comparacao .item-preco-condominio").fadeOut("slow"); }else{
				$w2n(".lista-imoveis-comparacao .item-preco-condominio").fadeIn("slow");
			}
			
		});
		
	});
	
	