
function preload_img_default(chemin) {
    pic = new Image();
    pic.src = chemin + "/nav_bandeau_logo/bt_ma_selection_on.jpg";
    pic = new Image();
    pic.src = chemin + "/nav_bandeau_logo/bt_nav_fond_on_centre.png";
    pic = new Image();
    pic.src = chemin + "/nav_bandeau_logo/bt_nav_fond_on_gauche.png";
    pic = new Image();
    pic.src = chemin + "/nav_bandeau_logo/bt_nav_fond_on_droite.png";
}

function preload_img(chemin) {
    pic = new Image();
    pic.src = chemin;
}

function show_center(function_callback, argument) {
	//new Effect.Appear('centre_contenu');
	if (function_callback) {
		$("#centre_contenu").slideDown("slow",function(){function_callback(argument);});
	} else {
		$("#centre_contenu").slideDown("slow");
	}
}

function show_center_block(function_callback, argument) {
	setTimeout("show_center("+function_callback+",'"+argument+"')", 1000);
}	

function forget_password(value) {
    if (value == 'true') {
        document.getElementById('access_account').style.display = 'none';
        document.getElementById('forget_password').style.display = 'block';
    } else {
        document.getElementById('forget_password').style.display = 'none';
        document.getElementById('access_account').style.display = 'block';  
    }
    return false;
}

function liste_produit(id) {

    if ($("#produit_1").css("display") != "none") {
        $("#produit_1").hide("fast", function(){$("#produit_"+id).show("fast");});
    } else if ($("#produit_2").css("display") != "none") {
        $("#produit_2").hide("fast", function(){$("#produit_"+id).show("fast");});
    } else if ($("#produit_3").css("display") != "none") {
        $("#produit_3").hide("fast", function(){$("#produit_"+id).show("fast");});
    }
}

function redirige_produit(id) {
    if (id != 0) {
        document.location = "fiche-produit.php?id="+id;
    }
}

function redirige_agence(cp) {
    if (cp == '') {
        alert('Veuillez saisir un code postal.');
    } else {
        document.location = "agence-fiche.php?cp="+cp;
    }
}

function recherche_agence(code_postal) {
    $.ajax({
    	type: "GET",
    	url: "agence-map.php",
    	data: "cp="+code_postal,
        dataType: "script",
    	success: function(data){

      	}
    });
}