function verify_conditions()
{
	if ($('#conditionChk').is(':checked'))
	{
		$('#checkout_confirmation').submit();
	}
	else
	{
		alert('Vous devez accepter les conditions générales de ventes');
	}
}

$(function() {
    $('#productImg a').lightBox();

    $('#marques').jCarouselLite({
    auto: 800,
    speed: 3000,
    visible: 8,
    scroll: 1
    });


    $('#achat_products').bind("click", function(){
      if ($("input[@type=radio][@checked]").length > 0) {

        return true;

      }
      else {

        alert('Veuillez choisir votre taille SVP.');
        return false;

      }
    });

    
});

function mycarousel_initCallback(carousel)
{
    // Disable autoscrolling if the user clicks the prev or next button.
    carousel.buttonNext.bind('click', function() {
        carousel.startAuto(0);
    });

    carousel.buttonPrev.bind('click', function() {
        carousel.startAuto(0);
    });

    // Pause autoscrolling if the user moves with the cursor over the clip.
    carousel.clip.hover(function() {
        carousel.stopAuto();
    }, function() {
        carousel.startAuto();
    });
};

function availability( m_pId, m_opt_v_id)
{

$.post("products_availability.php",{pId: m_pId, opt_v_id: m_opt_v_id },
        function success(data_ok){ // Au succès on renvoie le résultat de la requête
        switch (data_ok)
        {
          case '0': // $("#availability").html("Expédition sous 24/48h"); // Affichage
                    $("#stockLeft").html('Expédition sous 24/48h');
                    // $("#availability").slideDown("normal");
                    break;
          case '1': // $("#availability").slideUp("fast");
                    $("#stockLeft").html("Expédition sous 5 à 10 jours");
                    break;
          case '2': // $("#availability").slideUp("fast");
                    $("#stockLeft").html("Expédition sous 15 jours");
                    break;
        }
        
        
    });
}
