function ass_objc (Object_id, Contents) {
	document.getElementById(Object_id).innerHTML = Contents;
}

function message_alerte(message, sweetch, ancre) {

	if ( message == "Merci de vous identifier" || message == "Vous devez vous identifier" ) {
		message = 'Merci de vous identifier<br>(ou créer un compte)<br>dans l\'espace client en haut à droite.';
	}
	
	if ( message == "Votre panier ainsi que votre (vos) personnalisation(s) ont étés rechargées" ) {
		message = 'Votre panier ainsi que vos éléments de personnalisation ont étés rechargé(s)';
	}	


	if (sweetch) {
        var msg = "";
		msg = msg + '<table width="325" border="0" cellspacing="0" cellpadding="0">';
	  	msg = msg + '<tr>';
	    msg = msg + '	<td id="message_alerte_top">';
	    msg = msg + '     <table width="100%" border="0" cellspacing="0" cellpadding="3" id="message_alerte_title">';
		msg = msg + '	  	<tr>';
		msg = msg + '	    	<td width="90%" valign="middle"><span class="grey-dark" style="font-size:13px;">Alerte</span></td>';
		msg = msg + '	    	<td width="10%"><a href="javascript:message_alerte(\'\', false, \'\');"><img src="images/buttons_close.png" width="12" height="12" border="0" alt="fermer" /></a></td>';
		msg = msg + '	  	</tr>';
	   	msg = msg + '	</table>';
	   	msg = msg + '	</td/>';
	    msg = msg + '</tr>';
		//var msg = '<table width="100%" border="0" cellspacing="0" cellpadding="0" class="tab_message_alerte"><tr><td></td><td align="right"><img src="images/croix.gif" border="0" style="cursor:pointer;" onclick="message_alerte(\'\', false)"></td></tr><tr><td colspan="2">'+message+"</td></tr></table>";
		msg = msg + '<tr><td align="center" style="padding:10px 5px 15px 5px;font-size:14px;font-weight:bold;color:#FF0000;">'+message+"</td></tr></table>";
        ass_objc ('message_alerte', msg);
		window.document.getElementById("cache_tout").style.display = "block";
		window.document.getElementById("message_alerte").style.display = "block";
	} else {
		window.document.getElementById("cache_tout").style.display = "none";
		window.document.getElementById("message_alerte").style.display = "none";
	}
	if (ancre!="") {
		document.location="#"+ancre;
	}
	//return true;
}

function message_aide(sweetch, ancre) {
	if (sweetch) {
		window.document.getElementById("cache_tout").style.display = "block";
		window.document.getElementById("message_aide").style.display = "block";
	} else {
		window.document.getElementById("cache_tout").style.display = "none";
		window.document.getElementById("message_aide").style.display = "none";
	}
	if (ancre!="") {
		document.location="#"+ancre;
	}
	//return true;
}


function zoom_360 (sweetch, ancre) {
     if (sweetch) {
	 	window.document.getElementById("cache_tout").style.display = "block";
	 	window.document.getElementById("zoom_360").style.display = "block";
	 	//window.document.getElementById("div_flash_zoom_360").innerHTML = '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,28,0" width="680" height="453"><param name="movie" value="flash-360-'+produit_titre+'-'+produit_id+'.swf"><param name="quality" value="high"><embed src="flash-360-'+produit_titre+'-'+produit_id+'.swf" quality="high" pluginspage="http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" width="680" height="453"></embed></object>';
	 } else {
        window.document.getElementById("cache_tout").style.display = "none";
	 	window.document.getElementById("zoom_360").style.display = "none";
	 }
     if (ancre!="") {
		document.location="#"+ancre;
	}
}

function ajout_perso_panier (produit_id, produit_ref, sweetch) {
    if (sweetch) {
		window.document.getElementById("pz_produit_ref").innerHTML = produit_ref;
		window.document.getElementById("pz_link_perso").innerHTML = '<a href="module-perso-cartes-voeux-2.php?id='+produit_id+'">Je transmets mes &eacute;lements<br />pour la personnalisation</a>';
		window.document.getElementById("cache_tout").style.display = "block";
		window.document.getElementById("panier_zoom").style.display = "block";
	} else {
        window.document.getElementById("cache_tout").style.display = "none";
		window.document.getElementById("panier_zoom").style.display = "none";
	}
}

function ajout_panier (produit_id, produit_ref, quantite, sweetch, id_prod_perso) {
    if (sweetch) {
		//ajax_http_request ('appel_ajax.php', 'part=ajout_panier&produit_id='+produit_id+'&quantite='+quantite, 'panier_zoom');
        window.document.getElementById("pz_produit_ref").innerHTML = produit_ref;
        window.document.getElementById("pz_quantite").innerHTML = quantite;
		window.document.getElementById("pz_image").innerHTML = '<img src="image-aquarupella-244-1-'+produit_id+'.jpg" width="107" height="107" border="0" alt="/" />';
		window.document.getElementById("pz_link_perso").innerHTML = '<a href="module-perso-cartes-voeux-1.php?id='+id_prod_perso+'">Je transmets mes &eacute;lements<br />pour la personnalisation</a>';
		window.document.getElementById("cache_tout").style.display = "block";
		window.document.getElementById("panier_zoom").style.display = "block";
	} else {
        window.document.getElementById("cache_tout").style.display = "none";
		window.document.getElementById("panier_zoom").style.display = "none";
	}
}

function ajout_cadre (produit_id) {
	ajax_http_request ('ajax_ajout_cadre.php', 'produit_id='+produit_id, 'cadre_zoom');
    window.document.getElementById("cache_tout").style.display = "block";
	window.document.getElementById("cadre_zoom").style.display = "block";
	document.location="#top";
}

function close_cadre (produit_id) {
    window.document.getElementById("cache_tout").style.display = "none";
	window.document.getElementById("cadre_zoom").style.display = "none";
}

function plus(id) {
	window.document.getElementById(id).value = parseInt(window.document.getElementById(id).value)+1;
}
function moins(id) {
    if (window.document.getElementById(id).value > 0) {
		window.document.getElementById(id).value = parseInt(window.document.getElementById(id).value)-1;
	}
}
function plus10(id) {
	window.document.getElementById(id).value = parseInt(window.document.getElementById(id).value)+10;
}
function moins10(id) {
    if (window.document.getElementById(id).value > 10) {
		window.document.getElementById(id).value = parseInt(window.document.getElementById(id).value)-10;
	} else {
        window.document.getElementById(id).value = 0;
    }
}

function onglet_produit(div_aff) {
	window.document.getElementById('onglet_tarif_carte').style.display = "none";
	window.document.getElementById('onglet_tarif_perso').style.display = "none";
	window.document.getElementById('onglet_info').style.display = "none";
	window.document.getElementById(div_aff).style.display = "block";
}

function openWindow(file,tx,ty) {
 myWindow= open(file, "newWindow", "width="+tx+",height="+ty+",menubar=no,resizable=no,scrollbars=yes,status=no,toolbar=no");
}

