function hauteur(conteneur, menu)
{
	var hauteurMenu=document.getElementById(menu).offsetHeight;
	var hauteurContenu=document.getElementById(conteneur).offsetHeight;
	hauteurContenu=hauteurContenu+37;
	if(hauteurContenu > hauteurMenu)
	{
		if(hauteurContenu>800)
		{
			hauteurContenu=800;
		}
		document.getElementById(menu).style.height=parseInt(hauteurContenu-5)+"px";
		document.getElementById(menu).style.backgroundColor="#13007D";
		document.getElementById(menu).style.backgroundRepeat="no-repeat";
		document.getElementById(menu).style.backgroundPosition="bottom ";
	}

}

function RunFoo(swf, hauteur, largeur, couleur, nom, version) {
	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=\""+hauteur+"\" height=\""+largeur+"\" id=\""+nom+"\" align=\"middle\">\n");
	document.write("<param name=\"allowScriptAccess\" value=\"sameDomain\" />\n");
	document.write("<param name=\"wmode\" value=\"transparent\" />\n");
	document.write("<param name=\"movie\" value=\""+swf+"\" /><param name=\"quality\" value=\"high\" /><param name=\"bgcolor\" value=\""+couleur+"\" /><embed src=\""+swf+"\" quality=\"high\" bgcolor=\""+couleur+"\" width=\""+hauteur+"\" height=\""+largeur+"\" name=\""+nom+"\" align=\"middle\" allowScriptAccess=\"sameDomain\" type=\"application/x-shockwave-flash\" pluginspage=\"http://www.macromedia.com/go/getflashplayer\" />\n");
	document.write("</object>\n");
}

function validerCommande1()
{
	ok=0;
	var typeLivraison = document.getElementsByName("type_livraison");
	for (i=0; i<typeLivraison.length; i++)
	{
		if (typeLivraison[i].checked)
		{
			id = typeLivraison[i].value;
			window.location.href ='commande.php?action=transport&id='+id;
			ok++;
		}
	}
	if(ok==0)
	{
		alert("Veuillez cocher un mode de livraison");
	}
}

function validerCommande2()
{
	ok=0;
	var typePaiement = document.getElementsByName("type_paiement");
	for (i=0; i<typePaiement.length; i++)
	{
		if (typePaiement[i].checked)
		{
			id = typePaiement[i].value;
			window.location.href ='commande.php?action=paiement&type_paiement='+id;
			ok++;
		}
	}
	if(ok==0)
	{
		alert("Veuillez cocher un mode de paiement");
	}
}


//Photos annonces
$(window).load(function()
{
	$('.produitItemPhoto').mouseover(function()
	{
		//alert('img');
		//$('.imgTrans').css('height', '0px');
		$('#produitimage').hide();
		$('.photoAuxiliaire').hide();
		$('#'+$('img', this).attr('class')).show();
		//$('#'+$('img', this).attr('class')+' .imgTrans').css('height', $('#produitColonne2').height()+'px');
	});	
	
	largeurFenetre=$(document).width();
	$('body').css('background-position', (largeurFenetre-1680)/2+'px 0px');
});


$(window).resize(function()
{
	largeurFenetre=$(document).width();
	$('body').css('background-position', (largeurFenetre-1680)/2+'px 0px');
});

