$(document).ready(function(){
	$('ul.blocks li').click(function(){
		highlight(this);
	});
	
	$('ul.blocks li input[type="radio"]').click(function(){
		this.checked = (this.checked) ? false : true;
		highlight(this);		
	});
});

function highlight(obj){
	s = $(obj).children('input[type="radio"]');
	
	if(s.attr('checked')){
		$(obj).removeClass('active');
		s.attr('checked', false);
	}
	else{
		$(obj).parent().children('li.active').each(function(){
			$(this).removeClass('active');
		});
		
		$(obj).addClass('active');
		s.attr('checked', true);
		
		// Update the sentence
		showPrice(s.attr('value'));
	}
}

function showPrice(c){
	//try{
		$('#show').hide().html('&nbsp;Ik betaal &euro;<strong>'+pricing[c]+'</strong>,- volgens inkomensklasse <strong>'+c.toUpperCase()+'</strong>.').fadeIn('slow');
	//} catch(e){ }
}

var pricing = new Array();
pricing['a'] = 1753;
pricing['b'] = 1941;
pricing['c'] = 2305;
pricing['d'] = 2628;
pricing['e'] = 3004;
pricing['f'] = 3567;
