//******************************************************//
//       fonction d'échange d'images article.php        //
//******************************************************//
function change_img(small_id)
{
	var img_big=document.getElementById('big').src;
	var nb_big=document.getElementById('big_span').innerHTML ;
	var title_big=document.getElementById('big').title;
	var nb_small=document.getElementById(small_id).innerHTML;
	
	document.getElementById('zoom').href=document.getElementById('zoom').href.replace('/'+nb_big+'/','/'+nb_small+'/');
	document.getElementById('zoom').title=document.getElementById('small_'+small_id).title;
	
	img_small=document.getElementById('small_'+small_id).src.replace(nb_small+'/vignette',nb_small+'/middle');
	document.getElementById('big').src=img_small;
	document.getElementById('big').title=document.getElementById('small_'+small_id).title;
	document.getElementById('big_span').innerHTML=document.getElementById(small_id).innerHTML;
	
}

//******************************************************//
//       fonction de comfirm du prix max pour article   //
//******************************************************//
function confirmPrixMax (prix_max)
{
	if(typeof(document.add_product.prix)!='undefined'){
		prix_max=parseFloat(prix_max);
		prix=parseFloat(document.add_product.prix.value);
		if (prix>prix_max)
		{
			if(confirm("Vous avez renseigné un prix supérieur au prix d'achat immédiat! Voulez-vous quand même ajouter ce produit à votre panier ?")){
				return true;
			}
			else
			{
				return false;	
			}
		}
	}
	else{
		return true;
	}
}

