/***************************************************************/
// lacote.js
// Developped by : Tonsenst Charles-Olivier
// Copyright : 2008 Restaurant La Côte
/***************************************************************/
function OpenImage( inImg, inWidth, inHeigth )
{
	inWidth+=20;
	inHeigth+=10;
	var vWnd = window.open( "showimg.php?imgname=" + escape(inImg),  "ShowImg", "width=" + inWidth + ",height=" + inHeigth + "," + ComputeWindowPosition( inWidth, inHeigth, "center" ) + ",status=no,toolbar=no,menubar=no,location=no,resizable=no,scrollbars=no,titlebar=no" );
	if( vWnd ) vWnd.focus();

}

//------------------------------------------------------------------------------
// ComputeWindowPosition( w, h, pos )
// w : Window Width
// h : Window heigth
// pos : position ( random, center )
//------------------------------------------------------------------------------
function ComputeWindowPosition( w, h, pos )
{
	var LeftPosition = 0;
	var TopPosition = 20;
	if(pos=="random")
	{	
		LeftPosition = (screen.width) ? Math.floor(Math.random()*(screen.width-w)) : 100 ; 
		TopPosition = (screen.height) ? Math.floor(Math.random()*((screen.height-h)-75)) : 100;
	}
	else	if (pos=="center")
	{
		LeftPosition=(screen.width)?(screen.width-w)/2:100;
		TopPosition=(screen.height)?(screen.height-h)/2:100;
	}

	return 'top='+TopPosition+',left='+LeftPosition;

} 


function MakeRestoMenu()
{
var ms = null;
var MT_MenuPresentation = null;
	if( TransMenu.isSupported() )
	{
		ms = new TransMenuSet(TransMenu.direction.down, 1, 0, TransMenu.reference.bottomLeft);
		//--------------------------------
		// Presentation
		//--------------------------------
		var MT_MenuPresentation = ms.addMenu(document.getElementById("MH1_0_img"));
		if( MT_MenuPresentation )
		{
			MT_MenuPresentation.addItem("Pr&eacute;sentation", "index.htm" );
			MT_MenuPresentation.addItem("Historique", "Historique.htm" );
			MT_MenuPresentation.addItem("Portrait", "Portrait.htm" );
			MT_MenuPresentation.addItem("Contactez-nous", "Contactez_Nous.htm" );
		}
		
		var MT_MenuCadre = ms.addMenu(document.getElementById("MH1_1_img"));
		if( MT_MenuCadre )
		{
			MT_MenuCadre.addItem("Le cadre", "Le_Cadre.htm" );
			MT_MenuCadre.addItem("Carnac", "Carnac.htm" );
			MT_MenuCadre.addItem("Les m&eacute;galithes de Kermario", "Les_Megalithes_de_Kermario.htm" );
		}
		
		var MT_MenuPrest = ms.addMenu(document.getElementById("MH1_2_img"));
		if( MT_MenuPrest )
		{
			MT_MenuPrest.addItem("Les prestations", "La_Prestations.htm" );
			MT_MenuPrest.addItem("La cuisine", "La_Cuisine.htm" );
			MT_MenuPrest.addItem("Le service", "Le_Service.htm" );
			MT_MenuPrest.addItem("Recettes", "Recettes.htm" );
		}
		
		var MT_MenuRef = ms.addMenu(document.getElementById("MH1_3_img"));
		if( MT_MenuRef )
		{
			MT_MenuRef.addItem("R&eacute;f&eacute;rences", "References.htm" );
			MT_MenuRef.addItem("La presse", "La_Presse.htm" );
			MT_MenuRef.addItem("Les guides", "Les_Guides.htm" );
		}
		
		
	}
	TransMenu.renderAll();

}