//Cette fonction renvoi le contenu de la fiche de produit


function getFicheProduit(id_prod, id_fam, id_gamme, titre_prod, prix_HT, prix_TTC, prix_public_HT, prix_public_TTC,ref_constr,logo_mark,img_prod,remise, url_fiche_produit, profil_client, url_mark, titre_mark){
	var fiche_produit = '';	
	fiche_produit = fiche_produit + '<table border="0" cellpadding=2 cellspacing=1 width="180" ><tr><td colspan="2" align="center"><a href="/marque/'+url_mark+'" onMouseMove="ShowMarque(\''+titre_mark+'\');" onMouseOver="ShowMarque(\''+titre_mark+'\');" onMouseOut="HideMarque();"><img src="/logos/'+logo_mark+'" border=0></a></td></tr>';
  	fiche_produit = fiche_produit + '<tr><td align="center"><a href="'+url_fiche_produit+'"><img onMouseOver="ShowBulle(\''+titre_prod+'\')" onMouseMove="ShowBulle(\''+titre_prod+'\')" onMouseOut="HideBulle()" src="/img-prod/petit/'+img_prod+'" border="0"></a></td><td align="center"><a href="'+url_fiche_produit+'" class="lien" onMouseOver="ShowBulle(\''+titre_prod+'\')" onMouseMove="ShowBulle(\''+titre_prod+'\')" onMouseOut="HideBulle()"><b>'+getTitreCourt(titre_prod)+'</b></a></td></tr>';
  	
	if (remise != 0){
		fiche_produit = fiche_produit + '<tr>';
		fiche_produit = fiche_produit + '<td width="100" height="80" style="background-image:url(/img-graph/reduction.gif); background-repeat:no-repeat; background-position:center; " align="center" valign="middle"><font face="Arial, Helvetica, sans-serif" color="#FFFFFF" size="3"><div align="center" ><b>-'+remise+'%</b></div></font></td>';
		fiche_produit = fiche_produit + '<td align="center"><table border="0" cellpadding="0" cellspacing="0"><tr><td colspan=2  align="center" style="border:1px solid #cc3300; border-bottom:2px solid #cc3300; border-right:2px solid #cc3300; background-color:#FFFF00;" ><font color="#cc3300" size="4" face="Arial, Helvetica, sans-serif"><b>'+prix_HT+'</b></font><b><font color="#cc3300" size="4" face="Arial, Helvetica, sans-serif" >&nbsp;&euro;&nbsp;<span style="color:#cc3300; font-size:12; font-weight:normal; font-family:Arial, Helvetica, sans-serif; ">HT</span></font></b></td>';
		fiche_produit = fiche_produit + '</tr><tr><td align="center" colspan="2"><font color="#cc3300" size="2" face="Arial, Helvetica, sans-serif">'+prix_TTC+'&nbsp;&euro;&nbsp;TTC</font></td></tr></table></td></tr></table>';
	}else{
		fiche_produit = fiche_produit + '<tr>';
		//fiche_produit = fiche_produit + '<td width="100" height="80" style="background-image:url(img-graph/reduction.gif); background-repeat:no-repeat; background-position:center; " align="center" valign="middle"><font face="Arial, Helvetica, sans-serif" color="#FFFFFF" size="3"><div align="center" ><b>-'+remise+'%</b></div></font></td>';
		fiche_produit = fiche_produit + '<td align="center" colspan="2" ><table border="0" cellpadding="0" cellspacing="0"><tr><td colspan=2  align="center" style="border:1px solid #cc3300; border-bottom:2px solid #cc3300; border-right:2px solid #cc3300; background-color:#FFFF00;" ><font color="#cc3300" size="4" face="Arial, Helvetica, sans-serif"><b>'+prix_HT+'</b></font><b><font color="#cc3300" size="4" face="Arial, Helvetica, sans-serif" >&nbsp;&euro;&nbsp;<span style="color:#cc3300; font-size:12; font-weight:normal; font-family:Arial, Helvetica, sans-serif; ">HT</span></font></b></td>';
		fiche_produit = fiche_produit + '</tr><tr><td align="center" colspan="2"><font color="#cc3300" size="2" face="Arial, Helvetica, sans-serif">'+prix_TTC+'&nbsp;&euro;&nbsp;TTC</font></td></tr></table></td></tr></table>';

	}
	return fiche_produit;
}



//Je récupère  la pratie du titre qui est avant les :
function getTitreCourt(titre){
	var posDeuxPoints = (''+titre).indexOf(' - ');
	return (''+titre.substr(0,posDeuxPoints));
}

//Déclaration de la classe Produit
function ProduitJs(idProd,logo,remise,titreProd,prixHt,prixTtc,PrixPublicHt,PrixPublicTtc,urlDetail){
	this.idProd = idProd;
	this.logo = logo;
	this.remise = remise;
	this.titreProd = titreProd;
	this.prixHt = prixHt;
	this.prixTtc = prixTtc;
	this.prixPublicHt = prixPublicHt;
	this.prixPublicTtc = prixPublicTtc;
	this.urlDetail = '/pro/'+urlDetail;
	this.selectionne = 0;
}

//Affichage aléatoire des produits pour la promotion


