// JavaScript Document

$(function(){
	$('.broker_type_select form').submit(function(){
		var data=$(this).serialize();
		var url=$(this).attr('action');
		$.get(url,data,function(response){
			$('.brokers_list').html(response['output']);
		},'json')
		return false;
	});
	$('.broker_type_select form :radio').change(function(){
		$(this).closest('form').submit();
	})

	$('.brokers_list a').live('click',function(){
		var url=$(this).attr('href')+'&ajax=1';
		$('.brokers_profile').addClass('loading');
		$('.brokers_profile .inner').html('');
		$.get(url,'',function(response){
			$('.brokers_profile').removeClass('loading');
			$('.brokers_profile .inner').html(response['output']);
		},'json')
		return false;
	});

	$('.right_col .map').click(function(){
		var href=$(this).find('a').attr('href');
		location.href=href;
	})
	
	$('.blank').attr('target','_blank');
	
//	$('.classifieds .item .reply').click(function(){
//		$(this).hide();
//		$(this).closest('.item').find('.reply_form').show();
//		var $form=$(this).closest('.item').find('.reply_form form');
//		var post=$(this).serialize();
//
//	})
//

});

