function make_total()
{
	total	= 0;
	if( $('select[name="journalouinternet"]').val() == 2 )
	{
		total += 0.5;
	}
	
	if( $('input[name="bonusline"]:checked').val() != undefined )
	{
		total += parseFloat( $('input[name="bonusline"]:checked').val() );
	}
	
	if( $('input[name="photosup"]:checked').val() != undefined )
	{
		total += parseFloat( $('input[name="photosup"]:checked').val() );
	}
	
	total += parseFloat( $('input[name="annprix"]:checked').val() );
	
	//alert( total );
	
	$('.total').html( total.toString().replace('.',',') + " Euro" );
	$('input[name="total"]').val( total );
}

$(document).ready(function(){
	//make_total();
	
	/*$('input[name="bonusline"]').click(function(){
		make_total();
	});*/

	$('select[name="journalouinternet"]').change(function(){
		if( $(this).val() < 1 )
		{
			$('input[pa="autos"]').parent().parent().hide();
			$('input[pa="encadre"]').parent().parent().hide();
			$('input[pa="rouge"]').parent().parent().hide();
			$('input[pa="rougephoto"]').parent().parent().hide();
			
			if( $('input[name="annprix"]:checked').attr("pa") != "simple" && $('input[name="annprix"]:checked').attr("pa") != "photo" )
			{
				$('input[pa="simple"]:eq(0)').attr("checked", true);
				
				$('input[name="photosup"]').removeAttr('checked');
				$('input[name="photosup"]').attr('disabled',true);
				$('.save').html(savetxt);
			}
			
			//$('input[pa="simple"]:eq(0)').attr("checked", true);
		}
		else
		{
			$('input[pa="autos"]').parent().parent().show();
			$('input[pa="encadre"]').parent().parent().show();
			$('input[pa="rouge"]').parent().parent().show();
			$('input[pa="rougephoto"]').parent().parent().show();
		}
		
		//make_total();
	});
	
	$('input[name="annprix"]').click(function(){
		//make_total();
		
		if( $(this).attr('class') == "avecphoto" )
		{
			$('input[name="photosup"]').removeAttr('disabled');
			//$('.save').html(savephoto);
		}
		else
		{
			$('input[name="photosup"]').removeAttr('checked');
			$('input[name="photosup"]').attr('disabled',true);
			//$('.save').html(savetxt);
		}
		
		$('input[name="typepa"]').val($(this).attr("pa"));
		
		//alert((this).attr("parution"));
		
		$('input[name="parutions"]').val($(this).attr("parution"));
	});
	
	/*$('input[name="photosup"]').click(function(){
		make_total();
	});*/
	

});