// Detect if browser is Netscape 3 + or IE 4 +.
img_path = 'images/';
bName = navigator.appName;
bVer = parseInt(navigator.appVersion);
    if ((bName == "Netscape" && bVer >= 3) || 
        (bName == "Microsoft Internet Explorer" && bVer >= 4)) br = "n3"; 
    else br = "n2";


// mouse off - UP stage
    if (br== "n3") { var currentimage="";

	img1off = new Image();  img1off.src = (img_path + "b_accueil0.gif");
	img1on = new Image();    img1on.src = (img_path + "b_accueil1.gif");

	img2off = new Image();  img2off.src = (img_path + "b_vos_hotes0.gif");
	img2on = new Image();    img2on.src = (img_path + "b_vos_hotes1.gif");

	img3off = new Image();  img3off.src = (img_path + "b_chambres0.gif");
	img3on = new Image();    img3on.src = (img_path + "b_chambres1.gif");

	img4off = new Image();  img4off.src = (img_path + "b_pieces_communes0.gif");
	img4on = new Image();    img4on.src = (img_path + "b_pieces_communes1.gif");

	img5off = new Image();  img5off.src = (img_path + "b_localisation0.gif");
	img5on = new Image();    img5on.src = (img_path + "b_localisation1.gif");

	img6off = new Image();  img6off.src = (img_path + "b_autres_infos0.gif");
	img6on = new Image();    img6on.src = (img_path + "b_autres_infos1.gif");

	img7off = new Image();  img7off.src = (img_path + "b_reservation0.gif");
	img7on = new Image();    img7on.src = (img_path + "b_reservation1.gif");

	img8off = new Image();  img8off.src = (img_path + "logos_fr_depart.gif");
	img8on = new Image();    img8on.src = (img_path + "4soleils_gros.gif");

	img9off = new Image();  img9off.src = (img_path + "b_home0.gif");
	img9on = new Image();    img9on.src = (img_path + "b_home1.gif");

	img10off = new Image();  img10off.src = (img_path + "b_hosts0.gif");
	img10on = new Image();    img10on.src = (img_path + "b_hosts1.gif");

	img11off = new Image();  img11off.src = (img_path + "b_rooms0.gif");
	img11on = new Image();    img11on.src = (img_path + "b_rooms1.gif");

	img12off = new Image();  img12off.src = (img_path + "b_common_rooms0.gif");
	img12on = new Image();    img12on.src = (img_path + "b_common_rooms1.gif");

	img13off = new Image();  img13off.src = (img_path + "b_localisation0.gif");
	img13on = new Image();    img13on.src = (img_path + "b_localisation1.gif");

	img14off = new Image();  img14off.src = (img_path + "b_other_info0.gif");
	img14on = new Image();    img14on.src = (img_path + "b_other_info1.gif");

	img15off = new Image();  img15off.src = (img_path + "b_reservation_0.gif");
	img15on = new Image();    img15on.src = (img_path + "b_reservation_1.gif");

	img16off = new Image();  img16off.src = (img_path + "b_prixforfaits0.gif");
	img16on = new Image();    img16on.src = (img_path + "b_prixforfaits1.gif");

	img17off = new Image();  img17off.src = (img_path + "b_pricespackages0.gif");
	img17on = new Image();    img17on.src = (img_path + "b_pricespackages1.gif");

	img18off = new Image();  img18off.src = (img_path + "b_activites0.gif");
	img18on = new Image();    img18on.src = (img_path + "b_activites1.gif");

	img19off = new Image();  img19off.src = (img_path + "b_activities0.gif");
	img19on = new Image();    img19on.src = (img_path + "b_activities1.gif");

	img20off = new Image();  img20off.src = (img_path + "b_liens0.gif");
	img20on = new Image();    img20on.src = (img_path + "b_liens1.gif");

	img21off = new Image();  img21off.src = (img_path + "b_links0.gif");
	img21on = new Image();    img21on.src = (img_path + "b_links1.gif");


    }                                                                 


// Function to "activate" images.
function imgAct(imgName) {
    if (br == "n3" && currentimage != imgName) {
    document[imgName].src = eval(imgName + "on.src");
    }
}


// Function to "deactivate" images.
function imgInact(imgName) {
    if (br == "n3" && currentimage != imgName) {
    document[imgName].src = eval(imgName + "off.src");
    }
}


// Fonction d'ouverture d'une fenêtre pour images pièces communes

function popPhoto(image,x,y,scroll) {
	//exception : description du déjeuner qui n'est pas une image
	if ( (image == 'dejeuner.html')        ||
             (image == 'breakfast.html')       ||
             (image == 'menu_benevento.html')  ||
             (image == 'menu_casablanca.html')
           ) {
	URL = image;
	}
	else {
	baseUrl = 'images/photos/';
	URL = baseUrl + image;
	}
	day = new Date();
	id = day.getTime();
	eval("page" + id + " = window.open(URL, '" + id + "', 	'toolbar=0,scrollbars=" + scroll + ",location=0,statusbar=0,menubar=0,resizable=0,screenX=0,screenY=0,width=" + x + ",height=" + y + "');");
}


//Fonction pour afficher un message dans status bar pour liens photos

function statusOn() {
	window.status='Cliquez pour voir une image agrandie !'; 
}

function statusOff() {
	window.status=' '; 
}



//Fonctions pour afficher une partie du code selon sélection
//(chambres.html ; reservation.html)

   if (document.getElementById) {
	layerRef = "document.getElementById";
	styleRef = ".style";
   }
   else
   if (document.all) {
	layerRef = "document.all";
	styleRef = ".style";
   }
   else {
	layerRef = "document.layers";
	styleRef = "";
   }

function showMsg(t) {
	lyrName='msg'+t.selectedIndex
	if (document.getElementById) {
	for (i=0;i<6;i++)
	{
	eval(layerRef+'("msg'+i+'")'+styleRef+'.visibility="hidden"');
	}
	eval(layerRef+'("'+lyrName+'")'+styleRef+'.visibility="visible"');
	}
	else {
	clearMsg();
	eval(layerRef+'["'+lyrName+'"]'+styleRef+'.visibility="visible"');
	}
}

function clearMsg(){
	for (i=0;i<6;i++)
	{
	eval(layerRef+'["msg'+i+'"]'+styleRef+'.visibility="hidden"');
	}
}


