var price_i = new Array();
	price_i['hotel'] = 87;
	price_i['deelname'] = 399;
	price_i['deelname_jongere'] = 199;
	price_i['increment'] = 50;

var count_i;
var max_keyword_i = 3;

$(document).ready(function()
{
	count_i = 0;
	if($('#registratie').length);
	{
		init();
		$(':input').change(function(){init()});
	}
	
	if($('#paper_indienen').length)
	{	
		$(":input[name='keyword[]']").change(function(){checkBoxLength($(this))});
	}
			
});

function init()
{
	subscriber_type = $("input[name='subscriber_type']:checked").val();
	hotel = $("input[name='hotel']:checked").val();
	
	count_i = (subscriber_type == 'Jongere') ? (price_i['deelname_jongere']) : (price_i['deelname']);
	count_i = (hotel == 'Wel') ? (count_i + price_i['hotel']) : count_i;

	$('#registration_cost_total').html('&euro; ' + count_i + ',-'); 
	$('#registration_cost_total_late').html('&euro; ' + (count_i + price_i['increment']) + ',-'); 
	
	$(':input[name=registration_cost_total]').val(count_i);
	$(':input[name=registration_cost_total_late]').val(count_i + price_i['increment']);
}

function checkBoxLength(element_s)
{
	if($(":input[name='keyword[]']:checked").length > max_keyword_i)
	{
		$(element_s).attr('checked','');
		alert('U mag maximaal maar '+(max_keyword_i)+' trefwoorden selecteren');	
	}
}
