$(document).ready(function(){
	/*$(".changePictureProduct").click(function(){
		$("#flashPanoramique").html($(this).attr("href"));
	});*/
	// a chauque chargement de la page, on 'bind' les éléments
	bindNewPage();
});

function bindNewPage(){
	$(".changePage").click(function(){
		var page = $(this).next(".page").val();
		var type = $(this).next().next(".type").val();
		var sous_categ = $(this).next().next().next(".sous_categ").val();
		//alert(page+" "+type+" "+sous_categ);
		var divId = $("#"+$(this).parent().parent().parent().attr("id"));
		//alert("divid=>"+divId);
		divId.load("page/produits_dyn.php?type=" + type + "&page=" + page+"&sous_categ="+sous_categ, function(data){
			bindNewPage();
		});
		return false;
	});
	$(".popup").click( function() {
		window.open($(this).attr("href"));
		return false;
	});
	$(".passwordLost").click( function() {
		$("#loginContent").html($("#loginlostContent").html());
		return false;
	});
}
//$("#diaporamaContainter").html("<img src='"+url+"' alt='titre' />");

function changeImage(url){
	// replace le contenu de #diaporamaContainer par une nouvelle image (url)
	$("#diaporamaContainter").html("<img src='"+url+"' alt='titre' />");
}		

function changeFlash(){
	//affiche le flash soDiaporamique
	soPanoramique.write("diaporamaContainter");
}


