function encontre_seu_imovel(){
	this.id = null;
	this.element = null;
	var me = this;
	
	this.init=function(){
		$('#'+this.id+' #busca_avancada')
			.attr('unselectable','on')
			.css('MozUserSelect','none')
		;
		
		this.element.find('input[name=imo_tipo], input[name=imo_conservacao], input[name=imo_cidade], input[name=imo_faixa], input[name=imo_bairro]').bind('change', function(){
			var json = new Array();
			$(this).parents('.encontre_seu_imovel:first').find('input[name^=imo_][type=hidden]').each(function(){
				if($(this).attr('name').indexOf('[]')<0){
					json.push('set'+ucfirst($(this).attr('name'))+'Value='+$(this).val());
				}
			});
			
			var dormitorios = new Array();
			$(this).parents('.encontre_seu_imovel:first').find('input[name^=imo_dormitorios][type=hidden]').each(function(){
				if($(this).attr('name').indexOf('[]')>=0 && $(this).attr('disabled')==false){
					dormitorios.push($(this).val());
				}
			});
			json.push('setImo_dormitoriosValue='+dormitorios.join(','));
			
			var vagas_garagem = new Array();
			$(this).parents('.encontre_seu_imovel:first').find('input[name^=imo_vagas][type=hidden]').each(function(){
				if($(this).attr('name').indexOf('[]')>=0 && $(this).attr('disabled')==false){
					vagas_garagem.push($(this).val());
				}
			});
			json.push('setImo_vagasValue='+vagas_garagem.join(','));
			
			$.ajax({
				type: 'POST',
				url: 'loadComponent.class.php',
				data: 'class=encontre_seu_imovel&'+json.join('&'),
				success: function( html ){
					//html=html.replaceAll('\\.\\.\\/\\.\\.\\/','');
					me.element.parent()
						.html( html )
					;
				}
			});
		})
		
	}
}
