function index()
{	
	header();
	
	// debut home
	
	loadXMLDoc('conteneurId','home_hotel.php');
	
	//loadXMLDoc('bas_pageId','bas_page_hotel.php');
	
	start();
	menu();
	offre();
	guidePratique();
	bt_contact_event();
	
	//pageContenu(3);
}

function header()	
{	
	document.getElementById('logo_hotelId').onmousedown  =  home;
}

function home() 
{
	loadXMLDoc('conteneurId','home_hotel.php');
	document.getElementById('menuId').style.display ='none';
}

function pageContenu(pageid) 
{

		// Template predefini dans le BackOffice
		if(pageTplTab[pageid] == 1) 
		  loadXMLDoc('conteneurId','contenu_page_type_hotel.php?p='+pageid,0,'GET',startPageContenu,pageid); 
		else if(pageTplTab[pageid] == 2)   
		  loadXMLDoc('conteneurId','contenu_liste_hotel.php?p='+pageid,0,'GET',menuCarte,'');
		
		 // Pase de template predefini dans le BackOffice
		else if(pageid == 13) 
		  loadXMLDoc('conteneurId','contenu_liste_hotel.php?p='+pageid,0,'GET',menuCarte,'');
	 	else if(pageid == 22)
		  loadXMLDoc('conteneurId','contenu_liste_hotel.php?p='+pageid,0,'GET',menuCarte,'');
		else if(pageid == 24 || pageid == 34)
		  loadXMLDoc('conteneurId','contenu_liste_hotel.php?p='+pageid,0,'GET',menuCarte,'');
		else if(pageid == 27)
		  loadXMLDoc('conteneurId','contenu_plan_acces_hotel.php?p='+pageid,0,'GET',menuCarte,'');
		else if(pageid == 32)
		  loadXMLDoc('conteneurId','contenu_dossier_revue_hotel.php?p='+pageid,0,'GET',menuCarte,'');
		else if(pageid == 29)
		  loadXMLDoc('conteneurId','contenu_revue_revue_hotel.php?p='+pageid,0,'GET',menuCarte,'');
		else if(pageid == 30)
		  loadXMLDoc('conteneurId','contenu_newsletter_hotel.php?p='+pageid,0,'GET',newsletter,'');
		else if(pageid == 18)
		  loadXMLDoc('conteneurId','contenu_contact_hotel.php?p='+pageid,0,'GET',contact,'');
		else if(pageid == 16)
		  loadXMLDoc('conteneurId','contenu_seminaire_salle_hotel.php?p='+pageid,0,'GET',seminaire_salle,pageid);
		else if(pageid == 66)
		  loadXMLDoc('conteneurId','contenu_contact_public_hotel.php?p='+pageid,0,'GET',contact_public,pageid);
		else
		loadXMLDoc('conteneurId','contenu_page_type_hotel.php?p='+pageid,0,'GET',startPageContenu,pageid); 
	

	
	document.getElementById('menuId').style.display ='block';
	setHover();
}

function menuCarte()
{

	contentTop = 0;
	setBtUp('bt_scroll_hautId','contenuTxtId');
	setBtDown('bt_scroll_basId','contenuTxtId');

}

function scroolHaut() 
{
	
	document.getElementById('menuId').style.top=(20 + position);
}
function menu() 
{
	loadXMLDoc('menuId','menu_hotel.php',0,'GET',startMenu);	
}
function offre() 
{
	document.getElementById('bt_OffresId').onmousedown 	= function () { startOffre()};	
	setHover();
}
function guidePratique() 
{
	document.getElementById('bt_quideId').onmousedown 	= function () { startGuidePratique()};	
	setHover();
}

function bt_contact_event() 
{
	document.getElementById('bt_contactId').onmousedown 	= function () { startContact()};	
	setHover();
}

function startPageContenu(pageid) 
{	
	startVignettes(pageid,0,0);
}

function startVignettes(pageid,l1,loadTxt)	
{	
	if(loadTxt)
		loadXMLDoc('bloc_vignetteId','vignettes_gallery.php?p='+pageid+'&l1='+l1+'&txt=1');
	else
		loadXMLDoc('bloc_vignetteId','vignettes_gallery.php?p='+pageid+'&l1='+l1+'&txt=0');
	/*document.getElementById('logo_hotelId').onmousedown 		=  logoHotel;*/
}

function loadBigImg(id,src)	
{	
	if(img = document.getElementById(id))
		img.src = "../data/"+src;

}

/* ---------------------------------------  Menu ---------------------------------------  */
function startMenu()
{
	
	document.getElementById('menu_bt1Id').onmousedown 	= function () { startHotel()};
	document.getElementById('menu_bt2Id').onmousedown 	= function () { startChambre() };
	document.getElementById('menu_bt3Id').onmousedown 	= function () { startRestaurant() };
	document.getElementById('menu_bt4Id').onmousedown 	= function () { startBar() };
	document.getElementById('menu_bt5Id').onmousedown 	= function () { startSeminaire()};
	document.getElementById('menu_bt6Id').onmousedown 	= function () { startSpa()};
	/*document.getElementById('menu_bt6Id').onmousedown 	= function () { window.location.href = 'index_spa.php'; };*/


}

function startNavSelect(funcTarget)
{

	document.getElementById("menu_bt1Id").className	= "";
	document.getElementById("menu_bt2Id").className = "";
	document.getElementById("menu_bt3Id").className = "";
	document.getElementById("menu_bt4Id").className	= "";
	document.getElementById("menu_bt5Id").className	= "";
	document.getElementById("menu_bt6Id").className	= "";

	
	document.getElementById(funcTarget).className = "menu_bt_on";
	setHover();
	
}
function startNavSelectPlanCarte(funcTarget)
{


	document.getElementById("bt_ChaId").className	= "bt_plan";
	document.getElementById("bt_RouId").className	= "bt_plan";
	document.getElementById("bt_BreId").className	= "bt_plan";
	document.getElementById("bt_BouId").className	= "bt_plan";
	document.getElementById("bt_SalId").className	= "bt_plan";
	document.getElementById("bt_MezId").className	= "bt_plan";
	document.getElementById("bt_TerId").className	= "bt_plan";
	document.getElementById("bt_IleId").className	= "bt_plan";
	document.getElementById("bt_AlsId").className	= "bt_plan";
	document.getElementById("bt_AquId").className	= "bt_plan";
	document.getElementById("bt_ProId").className	= "bt_plan";

	document.getElementById(funcTarget).className = "bt_on_plan";
	setHover();

	
}
/*
function startSplitter(funcTarget,value)
{                       
	loadXMLDoc('contentId','content.php',0,'GET',funcTarget,value);
}    */                   
             
function startHotel()
{
	/*loadXMLDoc('contentId','home.php',0,'GET',home);*/
	pageContenu(3);
	startNavSelect("menu_bt1Id");
}
function startChambre()
{
	pageContenu(9);
	startNavSelect("menu_bt2Id");
}
function startRestaurant()
{
	pageContenu(12);
	startNavSelect("menu_bt3Id");
}
function startBar()
{
	pageContenu(15);
	startNavSelect("menu_bt4Id");
}
function startSeminaire()
{
	pageContenu(16);
	startNavSelect("menu_bt5Id");
}
function startSpa()
{
	pageContenu(20);
}
function startOffre()
{
	pageContenu(24);
}
function startGuidePratique()
{
	pageContenu(27);
}
function startContact()
{
	pageContenu(66);
}

function setHover()
{
	document.getElementById('bodyId').style.behavior = 'url(csshover.htc)';
}
/*
function startPresentation(value)
{ 
	document.getElementById('imgcommunId').style.top = '40px';
	loadXMLDoc('textcontentId','presentation.php',0,'GET',navPresentation,value);
}   
	
function navPresentation(presentation) 
{	
	if(!presentation) presentation = 1;
	
	document.getElementById('bt_presentation1Id').onmousedown = startPresentation1;
	document.getElementById('bt_presentation2Id').onmousedown = startPresentation2;
	document.getElementById('bt_presentation3Id').onmousedown = startPresentation3;
	
	startPresentationSelect('bt_presentation' + presentation + 'Id');
	loadXMLDoc('PresentationId','presentation' + presentation + '.php');
	startNavSelect("a_presentationId");

	
}*/

function setBtUp(elId,contentId)
{

	document.getElementById(elId).onmouseover = function()
	{
		intervalUp = setInterval('upDiv("'+ contentId +'")',1);
	}
	
	document.getElementById(elId).onmouseout = function()
	{
		clearInterval(intervalUp);
	}
}

function setBtDown(elId,contentId)
{	
	document.getElementById(elId).onmouseover = function()
	{
		intervalDown = setInterval('downDiv("'+ contentId +'")',1);
	}
	
	document.getElementById(elId).onmouseout = function()
	{
		clearInterval(intervalDown);
	}
}

function upDiv(elId)
{	

	if(contentTop<0)contentTop += 2;
	document.getElementById(elId).style.top = contentTop + 'px';
}

function downDiv(elId)
{
	
	 contentTop-=2;
	document.getElementById(elId).style.top = contentTop + 'px';
}

function newsletter()
{
	form_nwl = new formToDb('testTable','form_nwlId','../front/form_nwl_check.php','form_nwl_resultId','form_nwl_okId','champ2','champ2_error');
}

function contact()
{
	form_ctc = new formToDb('testTable','form_ctcId','../front/form_ctc_check.php','form_ctc_resultId','form_ctc_okId','champ2','champ2_error');
}

function contact_public()
{
	form_ctc_public = new formToDb('testTable','form_ctcId','../front/form_ctc_public_check.php','form_ctc_resultId','form_ctc_okId','champ2','champ2_error');
}

function  masqueDiv()
{
	if(document.getElementById('bts_plan_salleId'))
	{
		document.getElementById('bts_plan_salleId').style.display ='none';
		document.getElementById('plan_salle_fonId').style.display ='none';
		document.getElementById('bt_plan_salleId').style.display ='block';
	}
}
function  demasqueDiv()
{
	if(document.getElementById('bts_plan_salleId'))
	{
		document.getElementById('bts_plan_salleId').style.display ='block';
		document.getElementById('plan_salle_fonId').style.display ='block';
		document.getElementById('bt_plan_salleId').style.display ='none';
		startNavSelectPlanCarte("");
		
	}
}

function loadTexte(pageid)
{
	loadXMLDoc('contenuId','loadTexte_hotel.php?p=' + pageid);	
}

function seminaire_salle(pageid)
{
	startVignettes(pageid,0,1);
}

function comingSoon()
{
	GB_showCenter('Information','../front/comingsoon.php', 200, 200);
}