
/////////////////////////////////////////////////////////////////////////////////
function getLeft(MyObject){
	if (MyObject.offsetParent)
		return (MyObject.offsetLeft + getLeft(MyObject.offsetParent));
	else 
		return (MyObject.offsetLeft);
} 
 
/////////////////////////////////////////////////////////////////////////////////
function getTop(MyObject){
	if (MyObject.offsetParent)
		return (MyObject.offsetTop + getTop(MyObject.offsetParent));
	else
		return (MyObject.offsetTop);
}

function afficheMenuTop(nParamMenu){
	switch(nParamMenu){
		case 1: //menu produit
			document.getElementById('id_top_produit').style.backgroundColor = "#ffffff";
			document.getElementById('puce_top_produit').src = '/images/site/puce/puce_fleche_orange_basse.gif';
			$("#id_top_produit a").css("color","#F98722");
			break;
		case 2 : //lp
			document.getElementById('id_top_livre_photo').style.backgroundColor = "#ffffff";	
			$("#id_top_livre_photo a").css("color","#0383B8");			
			break;
		case 3 : //tirage
			document.getElementById('id_top_tirage').style.backgroundColor = "#ffffff";
			$("#id_top_tirage a").css("color","#6CAF15");
			break;
	}

	clearInterval(oMenuTransition);
	oMenuTransition = setInterval("afficheMenuTop2(" + nParamMenu + ")", nTimerViewMenu);
}

function afficheMenuTop2(nParamMenu){
	cacheMenuTop2();
	switch(nParamMenu){
		case 1: //menu produit
			document.getElementById('top_menu_produit').style.display = "block";				
			break;
		case 2 : //lp
			document.getElementById('top_menu_livre_photo').style.display = "block";
			break;
		case 3 : //tirage
			document.getElementById('top_menu_tirage').style.display = "block";
			break;
	}
}

function cacheMenuTop(){
	document.getElementById('id_top_livre_photo').style.backgroundColor = "transparent";
	document.getElementById('id_top_tirage').style.backgroundColor = "transparent";
	document.getElementById('id_top_produit').style.backgroundColor = "transparent";
	document.getElementById('puce_top_produit').src = '/images/site/puce/puce_fleche_noire.gif';
	
	$("#id_top_produit a").css("color","#000000");
	$("#id_top_livre_photo a").css("color","#313131");
	$("#id_top_tirage a").css("color","#313131");

	clearInterval(oMenuTransition);
	oMenuTransition = setInterval("cacheMenuTop2()", nTimerUnviewMenu);
}

function cacheMenuTop2(){
	document.getElementById('top_menu_produit').style.display="none";
	document.getElementById('top_menu_livre_photo').style.display="none";
	document.getElementById('top_menu_tirage').style.display="none";
}

function HoverMenuLivre(nParamId){
	var sHtml;
	
	//la classe du menu en cours
	if(document.getElementById("menu_livre_" + nHoverLivre).className.indexOf("menu_titre_livre") > -1)
		document.getElementById("menu_livre_" + nHoverLivre).className = "menu_titre_livre";
	else
		document.getElementById("menu_livre_" + nHoverLivre).className = "menu_livre";

	switch(nParamId){
		case 1:
			sHtml = '<a href="/produit/livre-photo/mini-livre-photo-style.asp"><img src="/images/site/menu/livre-photo/mini-livre-style.jpg" width="300" height="283" alt="" /></a>';
			sHtml += "<br /><b>GAMME STYLE</b><br /><i>Couverture souple et personnalisable.</i>";
			break;
		case 2:
			sHtml = '<a href="/produit/livre-photo/livre-photo-style-carre.asp"><img src="/images/site/menu/livre-photo/livre-style-carre.jpg" width="300" height="283" alt="" /></a>';
			sHtml += "<br /><b>GAMME STYLE</b><br /><i>Couverture souple et personnalisable.</i>";
			break;
		case 3:
			sHtml = '<a href="/produit/livre-photo/livre-photo-style-portrait.asp"><img src="/images/site/menu/livre-photo/livre-style-portrait.jpg" width="300" height="283" alt="" /></a>';
			sHtml += "<br /><b>GAMME STYLE</b><br /><i>Couverture souple et personnalisable.</i>";
			break;
		case 4:
			sHtml = '<a href="/produit/livre-photo/livre-photo-elegance-paysage.asp"><img src="/images/site/menu/livre-photo/livre-elegance-paysage.jpg" width="300" height="283" alt="" /></a>';
			sHtml += "<br /><b>GAMME ELEGANCE</b><br /><i>Des dizaines de couvertures au choix,<br />avec fenêtre 7x9.5 cm.</i>";
			break;
		case 5:
			sHtml = '<a href="/produit/livre-photo/livre-photo-molletonne-carre.asp"><img src="/images/site/menu/livre-photo/livre-molletonne-carre.jpg" width="300" height="283" alt="" /></a>';
			sHtml += "<br /><b>GAMME MOLLETONNEE</b><br /><i>Couverture molletonnée et personnalisable,<br />avec ou sans ruban.</i>"
			break;
		case 6:
			sHtml = '<a href="/produit/livre-photo/livre-photo-molletonne-carre-XL.asp"><img src="/images/site/menu/livre-photo/livre-molletonne-carre-xl.jpg" width="300" height="283" alt="" /></a>';
			sHtml += "<br /><b>GAMME MOLLETONNEE</b><br /><i>Couverture molletonnée et personnalisable,<br />avec ou sans ruban.</i>";
			break;
		case 7:
			sHtml = '<a href="/produit/livre-photo/livre-photo-prestige-paysage.asp"><img src="/images/site/menu/livre-photo/livre-prestige-paysage.jpg" width="300" height="283" alt="" /></a>';
			sHtml += "<br /><b>GAMME PRESTIGE</b><br /><i>Couverture rigide et personnalisable,<br />pages intérieures vernies.</i>";
			break;
		case 8:
			sHtml = '<a href="/produit/livre-photo/livre-photo-prestige-carre-XL.asp"><img src="/images/site/menu/livre-photo/livre-prestige-carre-xl.jpg" width="300" height="283" alt="" /></a>';
			sHtml += "<br /><b>GAMME PRESTIGE</b><br /><i>Couverture rigide et personnalisable,<br />pages intérieures vernies.</i>";
			break;
		case 9:
			sHtml = '<a href="/produit/livre-photo/album-photo-poche.asp"><img src="/images/site/menu/livre-photo/album-photo-poche.jpg" width="300" height="283" alt="" /></a>';
			sHtml += "<br /><b>Format compact, coloris d'étui au choix</b>";
			break;
		case 10:
			sHtml = '<a href="/produit/livre-photo/book-photo.asp"><img src="/images/site/menu/livre-photo/book.jpg" width="300" height="283" alt="" /></a>';
			sHtml += "<br /><b>Couverture au choix,<br />pages intérieures sur papier photo</b>";
			break;
		case 11:
			sHtml = '<a href="/produit/livre-photo/livre-photo.asp"><img src="/images/site/menu/livre-photo/livre-photo.jpg" width="300" height="283" alt="" /></a>';			
			break;	
	}
	
	//affiche l'image de présentation
	document.getElementById("top_menu_livre_photo_presentation").innerHTML = sHtml;
	
	nHoverLivre = nParamId;
	
	//la classe du menu en cours
	if(document.getElementById("menu_livre_" + nHoverLivre).className.indexOf("menu_titre_livre") > -1)
		document.getElementById("menu_livre_" + nHoverLivre).className = "menu_titre_livre_selected";
	else
		document.getElementById("menu_livre_" + nHoverLivre).className = "menu_livre_selected";
			
}

function HoverMenuTirage(nParamId){
	var sHtml;	
	
	//la classe du menu en cours
	if(document.getElementById("menu_tirage_" + nHoverTirage).className.indexOf("menu_titre_tirage") > -1)
		document.getElementById("menu_tirage_" + nHoverTirage).className = "menu_titre_tirage";
	else
		document.getElementById("menu_tirage_" + nHoverTirage).className = "menu_tirage";
	
	switch(nParamId){
		case 1:
			sHtml = '<a href="/produit/developpement-photo/tirage-photo-classique.asp"><img src="/images/site/menu/tirage-photo/tirage-photo-classique.jpg" width="330" height="283" alt="" /></a>';
			sHtml += "<br /><b>TIRAGES CLASSIQUES</b><br /><i>Le meilleur pour vos développements photo,<br/>un choix et une qualité inégalés...</i>";
			break;
		case 2:
			sHtml = '<a href="/produit/developpement-photo/tirage-photo-economique.asp"><img src="/images/site/menu/tirage-photo/tirage-photo-economique.jpg" width="330" height="283" alt="" /></a>';
			sHtml += "<br /><b>TIRAGES ECONOMIQUES</b><br /><i>Le prix le plus bas pour développer toutes vos photos...</i>";
			break;
		case 3:
			sHtml = '<a href="/produit/developpement-photo/tirage-photo-agrandissement-poster.asp"><img src="/images/site/menu/tirage-photo/poster-photo.jpg" width="330" height="283" alt="" /></a>';
			sHtml += "<br /><b>POSTERS ET PANORAMIQUES</b><br /><i>Le développement de vos photos en grand format !</i>";
			break;
		case 4:
			sHtml = '<a href="/produit/tirage/tableau-photo/tableau-photo.asp"><img src="/images/site/menu/tirage-photo/tableau-photo.jpg" width="330" height="283" alt="" /></a>';
			sHtml += "<br /><b>TABLEAUX PHOTO</b><br /><i>Quand photo rime avec Déco !</i>";
			break;
		case 5:
			sHtml = '<a href="/produit/developpement-photo/tirage-photo.asp"><img src="/images/site/menu/tirage-photo/tirage-photo.jpg" width="330" height="283" alt="" /></a>';			
			break;
	}
	
	document.getElementById("top_menu_tirage_presentation").innerHTML = sHtml;

	nHoverTirage = nParamId;
	//la classe du menu en cours
	if(document.getElementById("menu_tirage_" + nHoverTirage).className.indexOf("menu_titre_tirage") > -1)
		document.getElementById("menu_tirage_" + nHoverTirage).className = "menu_titre_tirage_selected";
	else
		document.getElementById("menu_tirage_" + nHoverTirage).className = "menu_tirage_selected";
}

//change l'image de présentation
function HoverMenuProduit(nParamId){
	var sHtml;
	
	//la classe du menu en cours	
	if(document.getElementById("menu_produit_" + nHoverProduit).className.indexOf("menu_produit") > -1)
		document.getElementById("menu_produit_" + nHoverProduit).className = "menu_produit";
	else
		document.getElementById("menu_produit_" + nHoverProduit).className = "menu_titre";
	
	nHoverProduit = nParamId;

	//la classe du menu en cours	
	if(document.getElementById("menu_produit_" + nHoverProduit).className.indexOf("menu_produit") > -1)
		document.getElementById("menu_produit_" + nHoverProduit).className = "menu_produit_selected";
	else
		document.getElementById("menu_produit_" + nHoverProduit).className = "menu_titre_selected";		
}

function GetScreenHeight(){
	if (String(window.innerHeight) == "undefined")
		return document.documentElement.clientHeight;
	else
		return window.innerHeight;
}

function GetScreenWidth(){
	if (String(window.innerWidth) == "undefined")
		return document.documentElement.clientWidth;
	else
		return window.innerWidth;
}

function AfficheCache(){
	$("#cache").css("height", GetScreenHeight() + "px");
	$("#cache").css("width", GetScreenWidth() + "px");
	$("#cache").css("display", "block");
}

function CloseCache(){
	$("#cache").css("display", "none");
}

if(document.URL.indexOf("/telechargement/flash2/flash.asp") == -1 && document.URL.indexOf("/telechargement/flash.asp") == -1  ){
	//on ne met en place les fontctions d'affichage de menu qu'une fois la page chargée, pour éviter les erreurs js de non trouvage d'objet
	var sSrcMenu
	sSrcMenu = document.getElementById('id_top_produit').src
	document.getElementById('id_top_produit').onmouseover=function(){afficheMenuTop(1);}
	document.getElementById('id_top_produit').onmouseout=function(){cacheMenuTop();}
	
	sSrcMenu = document.getElementById('id_top_livre_photo').src
	document.getElementById('id_top_livre_photo').onmouseover=function(){afficheMenuTop(2);}
	document.getElementById('id_top_livre_photo').onmouseout=function(){cacheMenuTop();}
	
	sSrcMenu = document.getElementById('id_top_tirage').src
	document.getElementById('id_top_tirage').onmouseover=function(){afficheMenuTop(3);}
	document.getElementById('id_top_livre_photo').onmouseout=function(){cacheMenuTop();}
	

	//init des hover menu top
	var nHoverLivre = 2;
	var nHoverTirage = 1;
	var nHoverProduit = 1
	
	HoverMenuLivre(nHoverLivre);
	HoverMenuTirage(nHoverTirage);
	HoverMenuProduit(nHoverProduit);
}

