$(function(){ 
	$(".listTaille").change(function(){
	string = $(this).val();
	tab = string.split("-",2);
	prod = tab[0];
	taille = tab[1];
	urlpost = "taille="+taille+"&produit="+prod;
	$.ajax({
    type: "POST",
    url: "dispo.php",
    data: urlpost,
    success: function(msg){	
	if(msg>0)	{
		$("#submit"+prod).fadeIn("slow");
		$(".dispo"+prod).empty().append("Dispo");
		
	}
	else {
		$(".dispo"+prod).empty().append("Rupture");
		$("#submit"+prod).fadeOut("slow");
	}
   }
});
});
}); 


function signeHover()
{
	document.getElementById('logo_vetement').src='style/images/LEFT/Vetements_H_Over.png';
	document.getElementById('signe_H').src='style/images/LEFT/Signe_H_Over.png';
}
function signeHout()
{
	document.getElementById('logo_vetement').src='style/images/LEFT/Vetements_Sans.png';
	document.getElementById('signe_H').src='style/images/LEFT/Signe_H_Sans.png';
}
function signeFover()
{
	document.getElementById('logo_vetement').src='style/images/LEFT/Vetements_F_Over.png';
	document.getElementById('signe_F').src='style/images/LEFT/Signe_F_Over.png';
}
function signeFout()
{
	document.getElementById('logo_vetement').src='style/images/LEFT/Vetements_Sans.png';
	document.getElementById('signe_F').src='style/images/LEFT/Signe_F_Sans.png';
}
function changeIMG_and_URL(img,url)
{
	document.getElementById('BIG_IMG').src=img;
	document.getElementById('LINK_BIG_IMG').href=url;
}


// Credits: Robert Penners easing equations (http://www.robertpenner.com/easing/).
jQuery.easing['BounceEaseOut'] = function(p, t, b, c, d) {
	if ((t/=d) < (1/2.75)) {
		return c*(7.5625*t*t) + b;
	} else if (t < (2/2.75)) {
		return c*(7.5625*(t-=(1.5/2.75))*t + .75) + b;
	} else if (t < (2.5/2.75)) {
		return c*(7.5625*(t-=(2.25/2.75))*t + .9375) + b;
	} else {
		return c*(7.5625*(t-=(2.625/2.75))*t + .984375) + b;
	}
};

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();
    });
};

$(document).ready(function() {
    jQuery('#mycarousel').jcarousel({
        easing: 'BounceEaseOut',
		animation:1000,
 		scroll: 2,
        auto: 2,
        wrap: 'last',
        initCallback: mycarousel_initCallback
    });
		
});
