// Change l'image de l'accueil toutes les x secondes
var img=1;
function changeImage()
{
	$('present').src ="images/accueil_pres_0" + img + ".jpg";
	window.setTimeout("changeImage()", 4000);
	img++;
	if(img>2) img=1;
}

// Ouvre le popup contenant le plan d'accès au magasin
function ouvrePopUp(page, largeur, hauteur)
{
	var top = (screen.height/2)-(hauteur/2);
	var left = (screen.width/2)-(largeur/2);
	window.open(page,"Plan_acces_empreinte_interieur","resizable=no,top=" + top + ",left=" + left + ",width=" + largeur + ",height=" + hauteur + "");
}

// Page produit : affichage de l'image et du texte quand on clique sur le thumbnail
function displayImage(produit, nom_image, val_alt)
{
	$('image').innerHTML = '<img src="images/produits/' + produit + '/' + nom_image + '.jpg" alt="' + val_alt + '" title="' + val_alt + '" />';
	
	var info = val_alt.split(' : ');
	var info = info[1].split(' - ');
	
	var lien = "";
	if(info[0].toUpperCase().indexOf('LEICHT', 0) != -1)
		lien = '<a href="http://www.leicht.de/web2008/f/f_start.html" target="_blank">';
	else if(info[0].toUpperCase().indexOf('ROSET', 0) != -1)
		lien = '<a href="http://www.ligneroset.fr/" target="_blank">';
		
	$('marque').innerHTML = (lien != '' ? lien : '') + info[0] + (lien != '' ? "</a>" : '');
	$('modele').innerHTML = info[1];
	$('createur').innerHTML = info[2];
}

function showPartenaires(bln_affich)
{
	$('partenaires').style.display = bln_affich ? "block" : "none";
}

// Monte le texte des produits quand on clique sur le scrollbar
function upContent()
{
	if($('texte_scroll').style.marginTop == "") $('texte_scroll').style.marginTop = '0px';
	var marge_haut = parseInt($('texte_scroll').style.marginTop.replace('px',''));
	if(marge_haut != 0) $('texte_scroll').style.marginTop = (marge_haut + 20) + 'px';
}

// Descends le texte des produits quand on clique sur le scrollbar
function downContent()
{
	if($('texte_scroll').style.marginTop == "") $('texte_scroll').style.marginTop = '0px';
	var marge_haut = parseInt($('texte_scroll').style.marginTop.replace('px',''));
	if(Math.abs(marge_haut) < ($('texte_scroll').offsetHeight - $('texte').offsetHeight)) $('texte_scroll').style.marginTop = (marge_haut - 20) + 'px';
}