function affichImage() {
	document.getElementById('redir').style.visibility= 'visible';
}

function updatepdt2(ref,idrub){
	$(function() { $("#updtpdt").show(); });
	$("#pdt2").load("inc-produit2.php?ref="+ref+"&id_rubrique="+idrub);
}

function updatepdt3(ref,idrub){
	$(function() { $("#updtpdt").show(); });
	$("#pdt3").load("inc-produit3.php?ref="+ref+"&id_rubrique="+idrub);
}

function updatepdt34(ref,idrub){
	$(function() { $("#updtpdt").show(); });
	$("#pdt3").load("inc-produit34.php?ref="+ref+"&id_rubrique="+idrub);
}

function updatepdt43(ref,idrub){
	$(function() { $("#updtpdt").show(); });
	$("#pdt3").load("inc-produit43.php?ref="+ref+"&id_rubrique="+idrub);
}

function showRequest()  { 
	$(function() { $("#load1").show(); });
}

function showResponse(responseText, statusText)  { 
	$("#MonPanier").load("ajaxvuepanier.php");
	$(function() { $("#load1").hide(); });
	function majpanier () {
		$("#addpanier").load("ajaxpanier.php");
	}
	$.prompt(
		'<div id="addpanier" style="text-align: center;"><b>L\'article a bien été ajouté à votre panier</b><br /><br /><img src="ajax-loader-panier.gif" /></div>',
		{
			loaded: majpanier,
			buttons: { "Poursuivre mes achats":0,"Terminer ma commande":1 },
			submit: function(v,m,f){
                if(v==0) { return true; }
				else { document.location.href = "panier.php"; return true; }
            }
		});
	$.scrollTo( '#comptetop', 2000 );
}

function showRequestc()  { 
	$(function() { $("#load").show(); });
}

function showResponsec(responseText, statusText)  { 
	$("#menuhaut").load("connecte.php");
	$("#inc-compte").load("inc-compte.php");
	$(function() { $("#load").hide(); });
	$.prompt('<b>Bonjour, vous êtes bien connecté !</b>',
		{
			buttons: { "Poursuivre":0,"Accéder à mon compte":1 },
			submit: function(v,m,f){
                if(v==0) { return true; }
				else { document.location.href = "moncompte.php"; return true; }
            }
		});
	$.scrollTo( '#top', 2000 );
}

$(document).ready(function() {
	var options = {
       beforeSubmit:  showRequest,
       success:     showResponse
	}; 
    $('#Panier').ajaxForm(options);
}); 

$(document).ready(function() {
	var options = {
       beforeSubmit:  showRequestc,
       success:     showResponsec
	}; 
    $('#connexion').ajaxForm(options);
});

$(function() {
	$("#load").hide();
	$("#load1").hide();
	$("#updtpdt").hide();
	$('div#lexique').corner("tr 10px").corner("tl 10px");
	$('div#contenu').corner("tr 10px").corner("tl 10px");
	$('#s1').cycle({ 
		fx: 'fade',
		speed:  2000,
		pause: 1,
		cleartype:  1,
		nowrap:	0
	});
	$('#s2').cycle({ 
		fx: 'fade',
		speed:  2000,
		pause: 1,
		cleartype:  1,
		nowrap:	0
	});
	$('#s0').cycle({ 
		fx: 'fade',
		speed:  2000,
		pause: 1,
		cleartype:  1,
		nowrap:	0
	});
	$('#s3').cycle({ 
		fx: 'fade',
		speed:  2000,
		pause: 1,
		cleartype:  1,
		nowrap:	0
	});
	$('#s18').cycle({ 
		fx: 'fade',
		speed:  2000,
		pause: 1,
		cleartype:  1,
		nowrap:	0
	});
	$('#s5').cycle({ 
		fx: 'fade',
		speed:  5000,
		delay: -5000,
		pause: 1,
		cleartype:  1,
		nowrap:	0
	});
	$.localScroll( 2000 );
	$('#colorSelector div').css('backgroundColor', '#' + $.cookie('fondcolor'));
	$('#colorSelector').ColorPicker({
		color: '#' + $.cookie('fondcolor'),
		onShow: function (colpkr) {
			$('#fond').css('backgroundColor', '#' + $.cookie('fondcolor'));
			$(colpkr).fadeIn(500);
			return false;
		},
		onHide: function (colpkr) {
			$(colpkr).fadeOut(500);
			return false;
		},
		onChange: function (hsb, hex, rgb) {
			$('#colorSelector div').css('backgroundColor', '#' + hex);
			$('#fond').css('backgroundColor', '#' + hex);
		},
		onSubmit: function (hsb, hex, rgb) {
			$('#colorSelector div').css('backgroundColor', '#' + hex);
			$('#fond').css('backgroundColor', '#' + hex);
			$.cookie('fondcolor', hex, { path: '/', expires: 10 });
			$('.colorpicker').fadeOut(500);
		}
	});
	$('a').tooltip({
		track: true,
		delay: 0,
		showURL: false,
		showBody: " - "
	});
});