function filterAanbod(type, value, advid){
	if(type && value){
		$.ajax({
			cache: false,
			type: "GET",
			url: 'vraag_en_aanbod/filter/'+type+'/'+value,
			success: function(html){
				LoadUrl('http://www.deovernameadviseur.nl/onze_adviseurs/adviseur/'+advid+'/vraag_en_aanbod_regionaal.html');
			},
			error: function(XMLHttpRequest, textStatus, errorThrown){
				showError(XMLHttpRequest['responseText']);
			}
		});
		return true;
	} else {
		return false;
	}
}

function ResetFilter(adv_id){
	$.get('vraag_en_aanbod/resetFilter', '', function(){
		LoadUrl('http://www.deovernameadviseur.nl/onze_adviseurs/adviseur/'+adv_id+'/vraag_en_aanbod_regionaal.html');
	});
}

$(document).ready(function(){
	$('#adviseurform').validate({
		rules: {
			email: {
				required:true,
				email:true
			}
		},
		submitHandler: function(){
			$('#adviseurform').ajaxSubmit({
				beforeSubmit: function(){
					AjaxLoader(true);
				},
				success: function(html){
					$('.line').html(html);
					CloseAjaxLoader(true);
				},
				error: function(XMLHttpRequest, textStatus, errorThrown){
					showError(XMLHttpRequest['responseText']);
				}
			});
		}
	});
});
