// ========= AFFICHAGE DES FLASH

function afficheFlash(version,nom,largeur,hauteur){
	document.write('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version='+version+',0,0,0" width='+largeur+' height='+hauteur+'>\n');
	document.write('<param name="allowScriptAccess" value="sameDomain" />\n');
	document.write('<param name="movie" value='+nom+' />\n');
	document.write('<param name="quality" value="high" />\n');
	document.write('<param name="wmode" value="transparent" />\n');
	document.write('<embed src='+nom+' quality="high" wmode="transparent" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" width='+largeur+' height='+hauteur+'></embed>\n');
	document.write('</object>\n');
}	

// ========= AFFICHAGE DES FLASH
// ================================================ VERIFICATION DES FORMULAIRES
function validationForm(monform)
	{
		if (monform.telephone.value=='')
		{
			alert("Veuillez indiquer votre N° de Téléphone");
			monform.telephone.style.border="1px solid #05a4de";
			monform.telephone.focus();
			return false;
		}


		return true;
	}
// ================================================ VERIFICATION DES FORMULAIRES

function afficher() {
    var autre = jQuery("#formatCarte").val();
	var last = jQuery("#formatCarte option:last-child").val();
	if(autre==last){
		jQuery("#autre").show();
	}else jQuery("#autre").hide();
}
function afficher2() {
    var autre = jQuery("#matiere").val();
	var last = jQuery("#matiere option:last-child").val();
	if(autre==last){
		jQuery("#autrM").show();
	}else jQuery("#autrM").hide();
}

jQuery(function(){
	jQuery("#autre").hide();
	jQuery("#formatCarte").change(afficher);
	jQuery("#autrM").hide();
	jQuery("#matiere").change(afficher2);
	afficher();
	afficher2();
	var quantite="";
	var totalPanier="";
	
	
	$('#oublie').dialog({
		autoOpen: false,
		width: 400,
		modal:true,
		overlay:{
			background: "#000",
			opacity:0.8
		},
		buttons :{
			'Ok':function(){
				$(this).dialog('close');
			}
		}	
	});
	
	$("#oublie").load('ajax/oubli-mdp.php');
	
	$("#oublieMDP").click(function(){
		$("#oublie").dialog('open');	
	
	});
	
});

function verifPaiementCb(){
	if($('input[name=conditions]:checked').size()==0)
		alert('Vous devez accepter les conditions générales de vente en cochant la case correspondante');
	else{
		if(confirm('Je confirme vouloir payer par carte bancaire'))
			document.PAYBOX.submit();
	}
}

