
function closeAll() {

     $('div.moreinfos').each(function() {
         $(this).parent().find('a.more').show();
             $(this).parent().find('div.overview').find('div.expanded').hide();
             $(this).parent().find('div.overview').find('div.reduced').show();
         $(this).slideUp();
     });
}


jQuery(window).load(function(){

	$("#registration_typeother_val").live("click", function(){
		$("div.row-typeothertxt").slideToggle(100);
	});
	$("#registration_businessother_val").live("click", function(){
		$("div.row-businessothertxt").slideToggle(100);
	});
	$("#registration_valuechainother_val").live("click", function(){
		$("div.row-valuechainothertxt").slideToggle(100);
	});
	$("#registration_activitiesother_val").live("click", function(){
		$("div.row-activitiesothertxt").slideToggle(100);
	});
	$("#registration_applicationother_val").live("click", function(){
		$("div.row-applicationothertxt").slideToggle(100);
	});
	
	
	$("form#registration").submit(function(event){

		var nb_checked_activities = $(".activities-group").find("input[type=checkbox]:checked").length;

		if(nb_checked_activities == 0){

			$(".activities-group").find(".myerror").html("You have to check at least one activity !");
			return false;
                        
		}
		else{
			$(".activities-group").find(".myerror").html("");
		}

	});

        var organization_checkboxes = $("form#registration .organization-group").find("input[type=checkbox]");
        
        organization_checkboxes.click(function() {
            var organization_checkboxes_checked = $("form#registration .organization-group").find("input[type=checkbox]:checked").length;
            if (organization_checkboxes_checked > 1) {
                organization_checkboxes.attr('checked', false);
                $(this).attr('checked', 'checked');
            }
        });

	
	
});



