$(document).ready(function()
{
    $('.choice').live( 'click', function() {
		var choice_value = $(this).val();
        $.ajax({
  			type: "POST",
  			url: "ajax_update.php?type=change_image",
  			data: "choice_value="+choice_value,
  			success: function( result )
              {
                $('#image').html( result );
                $('#products_id').val( choice_value );
  			}
  		});
  		
        $.ajax({
  			type: "POST",
  			url: "ajax_update.php?type=change_price_convertible",
  			data: "choice_value="+choice_value,
  			success: function( result )
              {
                $('#price_convertible').html( result );
  			}
  		});
  		
        $.ajax({
  			type: "POST",
  			url: "ajax_update.php?type=change_titre",
  			data: "choice_value="+choice_value,
  			success: function( result )
              {
                $('#titre_page').html( result );
  			}
  		});
  		
        $.ajax({
  			type: "POST",
  			url: "ajax_update.php?type=change_fiche_product",
  			data: "choice_value="+choice_value,
  			success: function( result )
              {
                
                $('#fiche_product_bloc').html( result );
                tb_init('a.thickbox, area.thickbox, input.thickbox');
  			}
  		});
  		

	});
	
    $('.choice_img').live( 'click', function() {
		var choice_value = $(this).attr('value');
        $.ajax({
  			type: "POST",
  			url: "ajax_update.php?type=change_image",
  			data: "choice_value="+choice_value,
  			success: function( result )
              {
                $('#image').html( result );
                $('#products_id').val( choice_value );
  			}
  		});
  		
        $.ajax({
  			type: "POST",
  			url: "ajax_update.php?type=change_price_convertible",
  			data: "choice_value="+choice_value,
  			success: function( result )
              {
                $('#price_convertible').html( result );
  			}
  		});
  		
        $.ajax({
  			type: "POST",
  			url: "ajax_update.php?type=change_titre",
  			data: "choice_value="+choice_value,
  			success: function( result )
              {
                $('#titre_page').html( result );
  			}
  		});
  		
        $.ajax({
  			type: "POST",
  			url: "ajax_update.php?type=change_fiche_product",
  			data: "choice_value="+choice_value,
  			success: function( result )
              {
                
                $('#fiche_product_bloc').html( result );
                tb_init('a.thickbox, area.thickbox, input.thickbox');
  			}
  		});
  		

	});
	
	$('.convertible').live( 'click', function() {
		var convertible_value = $(this).val();
		var products_id = $('#products_id').val();
        $.ajax({
  			type: "POST",
  			url: "ajax_update.php?type=change_price",
  			data: "convertible_value="+convertible_value+"&products_id="+products_id,
  			success: function( result )
            {
                $('#price').html( result );
                tb_init('a.thickbox, area.thickbox, input.thickbox');
  			}
  		});
	});
	
	$(document).pngFix();
    
    $("input.hint").ezpz_hint();
 
});