// Bibliothèque de scripts - Gîtes de France Puy-de-Dôme


//****************************************************************
// Affichage des sous-menus 
//****************************************************************

sfHover = function()
	{
	if (document.getElementById("navigation"))
		{
		var sfEls = document.getElementById("navigation").getElementsByTagName("LI");
		for (var i=0; i<sfEls.length; i++)
			{
			sfEls[i].onmouseover=function()
				{
				this.className+=" sfhover";
				}
			sfEls[i].onmouseout=function()
				{
				this.className=this.className.replace(new RegExp(" sfhover\\b"), "");
				}
			}
		}
	}
if (window.attachEvent) window.attachEvent("onload", sfHover);

sfHover = function()
	{
	if (document.getElementById("advancedsearch"))
		{
		var sfEls = document.getElementById("advancedsearch").getElementsByTagName("LI");
		for (var i=0; i<sfEls.length; i++)
			{
			sfEls[i].onmouseover=function()
				{
				this.className+=" sfhover";
				}
			sfEls[i].onmouseout=function()
				{
				this.className=this.className.replace(new RegExp(" sfhover\\b"), "");
				}
			}
		}
	}
if (window.attachEvent) window.attachEvent("onload", sfHover);


//****************************************************************
// Couleur de fonds des cellules du tableau #LIBRAIRIE
//****************************************************************

sfHover = function()
	{
	if (document.getElementById("librairie"))
		{
		var sfEls = document.getElementById("librairie").getElementsByTagName("TR");
		for (var i=0; i<sfEls.length; i++)
			{
			sfEls[i].onmouseover=function()
				{
				this.className+=" sfhover";
				}
			sfEls[i].onmouseout=function()
				{
				this.className=this.className.replace(new RegExp(" sfhover\\b"), "");
				}
			}
		}
	}
if (window.attachEvent) window.attachEvent("onload", sfHover);


//****************************************************************
// Couleur de fonds des lignes du tableau #CALENDAR
//****************************************************************

sfHover = function() {
	if (document.getElementById("calendar"))
		{
		var sfEls = document.getElementById("calendar").getElementsByTagName("TR");
		for (var i=0; i<sfEls.length; i++)
			{
			sfEls[i].onmouseover=function()
				{
				this.className+=" sfhover";
				}
			sfEls[i].onmouseout=function()
				{
				this.className=this.className.replace(new RegExp(" sfhover\\b"), "");
				}
			}
		}
	}
if (window.attachEvent) window.attachEvent("onload", sfHover);

//****************************************************************
// Gestion du comportement des balises MARQUEE 
//****************************************************************

function funcMarqueeHover()
	{
	if (document.getElementsByTagName("marquee"))
		{
		var sfEls = document.getElementsByTagName("marquee");
		for (var i=0; i<sfEls.length; i++)
			{
			sfEls[i].onmouseover=function()
				{
				this.stop();
				}
			sfEls[i].onmouseout=function()
				{
				this.start();
				}
			}
		}
	}
//if (window.attachEvent) window.attachEvent("onload", sfHover);

//****************************************************************
// Fonction d'import des animations Flash 
//****************************************************************

function RunFlash(swf, hauteur, largeur, nom) {
	document.write("<object width=\""+largeur+"\" height=\""+hauteur+"\" id=\""+nom+"\" classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0\">\n");
	document.write("<param name=\"quality\" value=\"high\">\n");
	document.write("<param name=\"wmode\" value=\"transparent\">\n");
	document.write("<param name=\"movie\" value=\""+swf+"\">\n");
	document.write("<embed src=\""+swf+"\" quality=\"high\" wmode=\"transparent\" width=\""+largeur+"\" height=\""+hauteur+"\" name=\""+nom+"\" align=\"middle\" type=\"application/x-shockwave-flash\" pluginspage=\"http://www.macromedia.com/go/getflashplayer\">\n");
	document.write("</object>\n");
}


//************************************************
// fonction permettant l'affichage du POPUP image
//************************************************
function funcPopupImg(varId,varFileField,varTab,varLabel)
	{
		//title='" + escape(varLabel) + "'
	var strHtmlCode =	"<html>"
						+"<head><link href='../_css/web.css' rel='stylesheet' type='text/css'></head>"
						+"<body class='zoom'>"
						+"<div><img src='../_inc/IMG_DbImgView.asp?strTable="+varTab+"&strSelectField="+varTab+"Id&strSelectValue="
						+ varId +"&strFileField=" + varFileField + "&blnAffiche=oui&strImgNoFile=../images/_charte/NoFile.gif"
						+ "' onload='window.opener.funcPopupResizeToImg();'>"
						+ "<br>"
						+ varLabel + "<br>"
						+ '<a href="#" onClick="window.print();">[imprimer l\'image]</a></font></div>'
						+ "</div>"
						+"</body></html>";
	
	WinPopUpImg = window.open ("", "PopUpImg", "toolbar=no, menubar=no, scrollbars=no, resizable=no, location=no, directories=no, status=no");
	WinPopUpImg.document.write(strHtmlCode);
	WinPopUpImg.document.close();
	WinPopUpImg.document.title= "Zoom image";
	WinPopUpImg.focus();
	}

//fonction permettant de redimensionner le POPUP en fonction de la taille de l'image
function funcPopupResizeToImg()
	{
	var ScreenW = screen.availWidth;
	var ScreenH = screen.availHeight;
	var ImgW = WinPopUpImg.document.images[0].width;
	var ImgH = WinPopUpImg.document.images[0].height;
	WinPopUpImg.resizeTo(ImgW+20, ImgH+100);
	WinPopUpImg.moveTo((ScreenW-ImgW)/2, (ScreenH-ImgH)/2);
	}


//****************************************************************
// Affichage des POPUP 
//****************************************************************

function funcPopup(varUrl)
	{
	WinPopUpPlan = window.open (varUrl, "PopUp", "height=400, width=350, toolbar=no, menubar=no, scrollbars=no, resizable=no, location=no, directories=no, status=no");
	WinPopUpPlan.focus();
	var ScreenW = screen.availWidth;
	var ScreenH = screen.availHeight;
	WinPopUpPlan.moveTo((ScreenW-600)/2, (ScreenH-600)/2);
	}

function funcDemo(varUrl)
	{
	WinPopUpPlan = window.open (varUrl, "PopUpPlan", "height=530, width=750, toolbar=no, menubar=no, scrollbars=no, resizable=no, location=no, directories=no, status=no");
	WinPopUpPlan.focus();
	var ScreenW = screen.availWidth;
	var ScreenH = screen.availHeight;
	WinPopUpPlan.moveTo((ScreenW-750)/2, (ScreenH-530)/2);
	}

function MM_openBrWindow(theURL,winName,features,intAW,intAH) { //v2.0
	winpopup = window.open(theURL,winName,features);
	//alert (winpopup.width + ' ' + winpopup.height);
	winpopup.moveTo(Math.round((screen.availWidth-intAW)/2),Math.round((screen.availHeight-intAH)/2));

}


//****************************************************************
// Affichage des POPUP 
//****************************************************************

function funcSendToFriend(varUrl)
	{
		
	if (document.getElementsByTagName("IFRAME")[0])
		{
		if (document.getElementsByTagName("IFRAME")[0].src.indexOf("http://www.itea.fr") > -1)
			{
			if(confirm("Si vous souhaitez envoyer un lien vers un ou plusieurs gîtes, nous vous invitons à saisir directement leurs références."))
				{
				varLno = prompt("Saisissez directement la ou les références séparées d'une virgule :","");
				if (varLno != "")
					{
					varLnoUrl = "http://"+ window.document.location.hostname +"/recherche/REC_liste.asp?ENVIR=63&ORI=&OPE=&LNO="+ varLno;
					varUrl = varUrl.substring(0,varUrl.indexOf("?referer=")+9)+escape(varLnoUrl);
					}
				}
			}
		}
	
	WinPopUpPlan = window.open (varUrl, "PopUp", "height=400, width=350, toolbar=no, menubar=no, scrollbars=yes, resizable=no, location=no, directories=no, status=no");
	WinPopUpPlan.focus();
	var ScreenW = screen.availWidth;
	var ScreenH = screen.availHeight;
	WinPopUpPlan.moveTo((ScreenW-600)/2, (ScreenH-600)/2);
	}


//************************************************
// Mise à jour de la carte de recherche des adhérents 
//************************************************
var varInit = false;
function funcUpdateMap(varObj,varValue)
	{
	var objForm;
	var objMap;
	if (window.attachEvent)
		{
		objMap = document.getElementById("AdherentSearchMap");
		}
	else
		{
		objMap = document["AdherentSearchMap"];
		}
	objForm = document.getElementById("formAdherentSearch");
	if ((varObj.type == "checkbox") && (varInit == false))
		{
		if (varObj.value == 0)
			{
			varObj.value = 1;
			varValue = 1;
			}
		else
			{
			varObj.value = 0;
			varValue = "";
			}
		}
	if (objMap != null)
		{
		if (varObj.name == "GfGitesRef")
			{
//			funcResetForm(varObj);
			objMap.SetVariable('GfGitesRef',varValue);
			funcParamMap();
			}
		if (varObj.name == "GfGitesCodepostal")
			{
			if (varValue.length == 5)
				{
				objMap.SetVariable('KbGeolocalCpMin',varValue);
				objMap.SetVariable('KbGeolocalCpMax',(varValue*1)+1);
				funcParamMap();
				}
			if (varValue.length == 0)
				{
				objMap.SetVariable('KbGeolocalCpMin',document.getElementsByName("KbGeolocalCpMin").value);
				objMap.SetVariable('KbGeolocalCpMax',document.getElementsByName("KbGeolocalCpMax").value);
				funcParamMap();
				}
			}
		else
			{
			objMap.SetVariable(varObj.name,varValue);
			funcParamMap();
			}
		}
	}

// Initialisation du formulaire
function funcInitForm()
	{
	var objParam1, objParam2;
	objParam1 = document.getElementById("GfTypeId");
	objParam2 = document.getElementById("GfGitesTable");
	if (objParam1)
		{
		if (objParam1.value != 7)
			{
			objParam2.style.display = "none";
			}
		else
			{
			objParam2.style.display = "inline";	
			}
		}
	}

// Réinitialisation du formulaire
function funcResetForm(varObjException)
	{
	var objForm;
	objForm = document.getElementById("formAdherentSearch");
	var objMap;
	if (window.attachEvent)
		{
		objMap = document.getElementById("AdherentSearchMap");
		}
	else
		{
		objMap = document["AdherentSearchMap"];
		}
	if (objForm != null)
		{
		for (i=0; i<objForm.length; i++)
			{
			if ((objForm.elements[i] != varObjException) && (objForm.elements[i].type != "hidden"))
				{
				objForm.elements[i].value = "";
				objForm.elements[i].checked = false;
				}
			if (objForm.elements[i].name == "GfZoneId")
				{
				objMap.SetVariable("GfZoneId","");
				}
			}
		}
	}

// Limitation du nombre de  prestations sélectionnées
var intNbCurrParam = 0;
var intNbMaxParam = 3;

function funcNbParam(varObj)
	{
	if (varObj.type == "checkbox")
		{
		if (varObj.value == 0)
			{
			intNbCurrParam = intNbCurrParam - 1;
			}
		else
			{
			intNbCurrParam = intNbCurrParam + 1;
			}
		}
	if (varObj.type == "select-one")
		{
		if (varObj.selectedIndex == 0)
			{
			intNbCurrParam = intNbCurrParam - 1;
			}
		else
			{
			intNbCurrParam = intNbCurrParam + 1;
			}
		}
//	alert("intNbCurrParam : "+ intNbCurrParam +" / "+ varObj.selectedIndex +" / "+ varObj.type);
//	alert(varObj.selectedIndex == 0);
	if (intNbCurrParam == intNbMaxParam)
		{
		alert("En sélectionnant simultanément trop de critères, vous risquez de ne pas trouver d'hébergement correspondant à votre recherche.");
		intNbMaxParam = 100;
		}
	}

// Filtre des villes de proximité en fonction dela zone géographique
var tabTownId = new Array();
var tabTownValue = new Array();
var tabTownText = new Array();
function funcTownFilter(varGfZoneId)
	{
	var intOptLength;
	var objZone, objVille;
	objZone = document.getElementById("GfZoneId");
	objVille = document.getElementById("KbGeolocalCoord");
	if (objVille != null)
		{
		intOptLength = objVille.options.length
		if (tabTownId.length == 0)
			{
			for (i = 0; i < objVille.options.length; i++)
				{
				tabTownId[i] = objVille.options[i].id;
				tabTownValue[i] = objVille.options[i].value;
				tabTownText[i] = objVille.options[i].innerHTML;
				}
			}
		else
			{
			for (i=objVille.options.length; i>0; i--)
				{
				objVille.options[i-1] = null;
				}
			for (i = 0; i < tabTownId.length; i++)
				{
				objVille.options[objVille.options.length] = new Option(tabTownText[i],tabTownValue[i]);
				objVille.options[objVille.options.length-1].id = tabTownId[i];
				}
			}
		if (varGfZoneId != "")
			{
			for (i=objVille.options.length; i>0; i--)
				{
				if ((objVille.options[i-1].id != "KbGeolocalCoord"+ varGfZoneId) && (objVille.options[i-1].id != ""))
					{
					objVille.options[i-1] = null;
					}
				}
			}
		}
	}

// Concaténation des paramètres de filtre transmis à la carte
function funcParamMap()
	{
	var objForm;
	var objMap;
	var strFormParam;
	if (window.attachEvent)
		{
		objMap = document.getElementById("AdherentSearchMap");
		}
	else
		{
		objMap = document["AdherentSearchMap"];
		}
	objForm = document.getElementById("formAdherentSearch");
	strFormParam = "";
	if (objForm != null)
		{
		for (i=0; i<objForm.length; i++)
			{
			if ((objForm.elements[i].name != undefined) && (objForm.elements[i].value != undefined) && (objForm.elements[i].value != ""))
				{
				if ((objForm.elements[i].type == "checkbox") && (objForm.elements[i].checked == false))
					{
					//on ne tient pas compte du champ
					}
				else
					{
						// Réf. des hébergements peut s'écrire 100619 ou 63G100619
						if(objForm.elements[i].name == 'GfGitesRef') {
							strFormParam += objForm.elements[i].name +"="+ '63G'+objForm.elements[i].value.replace(/^63G/, '') +"&";
						} else {
							strFormParam += objForm.elements[i].name +"="+ objForm.elements[i].value +"&";
						}
					}
				
				if (objForm.elements[i].name == "GfZoneId")
					{
					objMap.SetVariable("GfZoneId",objForm.elements[i].value);
					}
				}
			}
//		alert(strFormParam);
		objMap.SetVariable("strFormParam",strFormParam);
		objMap.Play();
		}
	}

// Initialisation de la carte
function funcInitMap()
	{
	var objForm;
	var objMap;
	if (window.attachEvent)
		{
		objMap = document.getElementById("AdherentSearchMap");
		}
	else
		{
		objMap = document["AdherentSearchMap"];
		}
	if (objMap)
		{
		varMapWidth = objMap.width
		varMapMaxWidth = objMap.width*1.5;
		varMapHeight = objMap.height;
		funcParamMap();
		}
	}

// Gestion des zoom
var varMapWidth, varMapMaxWidth, varMapHeight;

function funcFlashZoom(varDirection, varCoefZoom)
	{
	var objDivMap, objMap, objZoomplus, objZoommoins;
	objDivMap = document.getElementById("cartoswf");
	if (window.attachEvent)
		{
		objMap = document.getElementById("AdherentSearchMap");
		}
	else
		{
		objMap = document["AdherentSearchMap"];
		}
	objZoomplus = document.getElementById("formAdherentSearchTab4");
	objZoommoins = document.getElementById("formAdherentSearchTab5");
	if (varDirection == "+")
		{
		if (objMap.width < varMapMaxWidth)
			{	
			objMap.width = objMap.width*varCoefZoom;
			objMap.height = objMap.height*varCoefZoom;
			for (i=0; i<objMap.GetVariable("varLocalisationQ"); i++)
				{	
				objMap.TSetProperty("/clip_localisation/localisation"+i, 2, objMap.TGetProperty("/clip_localisation/localisation"+i, 2)/varCoefZoom);
				objMap.TSetProperty("/clip_localisation/localisation"+i, 3, objMap.TGetProperty("/clip_localisation/localisation"+i, 3)/varCoefZoom);
				}
			objZoommoins.className = "on";
			}
		if (objMap.width >= varMapMaxWidth)
			{
			objZoomplus.className = "off";
			}
		}
	if (varDirection == "-")
		{
		if (objMap.width > varMapWidth)
			{
			objMap.width = objMap.width/varCoefZoom;
			objMap.height = objMap.height/varCoefZoom;
			for (i=0; i<objMap.GetVariable("varLocalisationQ"); i++)
				{	
				objMap.TSetProperty("/clip_localisation/localisation"+i, 2, objMap.TGetProperty("/clip_localisation/localisation"+i, 2)*varCoefZoom);
				objMap.TSetProperty("/clip_localisation/localisation"+i, 3, objMap.TGetProperty("/clip_localisation/localisation"+i, 3)*varCoefZoom);
				}
			objZoomplus.className = "on";
			}
		if (objMap.width <= varMapWidth)
			{
			objZoommoins.className = "off";
			}
		}
	objDivMap.scrollTop = Math.round((objDivMap.scrollTop)*varCoefZoom) + Math.round((objDivMap.scrollHeight*(varCoefZoom-1))/2);
	objDivMap.scrollLeft = Math.round(objDivMap.scrollLeft*varCoefZoom) + Math.round((objDivMap.scrollWidth*(varCoefZoom-1))/2);
	funcFlashZoomScroll();
	}

function funcFlashZoomScroll()
	{
	var objDivMap, varScrollBarSize;
	objDivMap = document.getElementById("cartoswf");
	varScrollBarSize = 0;
	if (objDivMap.scrollTop > 0)
		{
		document.getElementById("carto-top").style.display = "block";
		}
	else
		{
		document.getElementById("carto-top").style.display = "none";
		}
	if (eval(varMapWidth)+objDivMap.scrollLeft-varScrollBarSize < objDivMap.scrollWidth)
		{
		document.getElementById("carto-right").style.display = "block";
		}
	else
		{
		document.getElementById("carto-right").style.display = "none";
		}
	if (eval(varMapHeight)+objDivMap.scrollTop-varScrollBarSize < objDivMap.scrollHeight)
		{
		document.getElementById("carto-bottom").style.display = "block";
		}
	else
		{
		document.getElementById("carto-bottom").style.display = "none";
		}
	if (objDivMap.scrollLeft > 0)
		{
		document.getElementById("carto-left").style.display = "block";
		}
	else
		{
		document.getElementById("carto-left").style.display = "none";
		}
	}

function funcFlashScroll(varDirection, sdsds)
	{
	var objDivMap, objMap, varVerticalScroll, varHorizontalScroll;
	objDivMap = document.getElementById("cartoswf");
	if (window.attachEvent)
		{
		objMap = document.getElementById("AdherentSearchMap");
		}
	else
		{
		objMap = document["AdherentSearchMap"];
		}
	varVerticalScroll = Math.round((objDivMap.scrollHeight - objDivMap.style.height)/10);
	varHorizontalScroll = Math.round((objDivMap.scrollWidth - objDivMap.style.width)/10);
	if (varDirection == "bottom")
		{
		objDivMap.scrollTop = objDivMap.scrollTop+varVerticalScroll;
		}
	if (varDirection == "left")
		{
		objDivMap.scrollLeft = objDivMap.scrollLeft-varHorizontalScroll;
		}
	if (varDirection == "top")
		{
		objDivMap.scrollTop = objDivMap.scrollTop-varVerticalScroll;
		}
	if (varDirection == "right")
		{
		objDivMap.scrollLeft = objDivMap.scrollLeft+varHorizontalScroll;
		}
	funcFlashZoomScroll();
	}

// Gestion des onglets du formulaire de recherche
function funcFormTab(varObjId)
	{
	//Attribution du style actif à l'onglet
	document.getElementById("formAdherentSearchTab1").className = "";
	document.getElementById("formAdherentSearchTab2").className = "";
	document.getElementById("formAdherentSearchTab3").className = "";
	document.getElementById("formAdherentSearchTab"+varObjId).className = "actif";
	//Affichage du bloc de recherche
	document.getElementById("formAdherentSearchTr1").style.display = "none";
	document.getElementById("formAdherentSearchTr2").style.display = "none";
	document.getElementById("formAdherentSearchTr3").style.display = "none";
	document.getElementById("formAdherentSearchTr"+varObjId).style.display = "inline";
	//Filtrage des prestations conditionnées
	funcInitForm();
	}

//****************************************************************
// Gestion de l'affichage du contenu du title d'un lien
//****************************************************************

var niceTitleDummy;
var varTxt = "";

function initNiceTitle()
	{
	niceTitleDummy = document.createElement("div");
	niceTitleDummy.style.position = "absolute";
	niceTitleDummy.className = "nicetitle";
	niceTitleDummy.style.left = "-1000em";
	niceTitleDummy.style.top = "-1000em";
	document.body.appendChild(niceTitleDummy);
	}

function hideNiceTitle(e) {
	var lnk = getNodeWithTag(getEventTarget(e), "a");
	if (varTxt != "")
		{
		lnk.setAttribute("title",varTxt);
		varTxt = "";
		}
	niceTitleDummy.style.left = "-1000em";
	niceTitleDummy.style.top = "-1000em";
	niceTitleDummy.innerHTML = "";
	}

function showNiceTitle(e) {
	var lnk = getNodeWithTag(getEventTarget(e), "a");
	var spanEls = lnk.getElementsByTagName("SPAN");
	for (var i=0; i<spanEls.length; i++)
		{
		spanEls[i].setAttribute("title","");
		}
	if (window.event)
		{
		x = window.event.clientX+document.body.scrollLeft; 
		y = window.event.clientY+document.body.scrollTop;
		}
	else
		{
		x = e.clientX + window.scrollX; 
		y = e.clientY + window.scrollY;
		}

	if (varTxt == "")
		{
		varTxt = lnk.getAttribute("title");
		lnk.setAttribute("title","");
		}

	niceTitleDummy.style.left = x+7;
	niceTitleDummy.style.top = y+18;
	niceTitleDummy.innerHTML = "<img src='../images/nt_img.gif'><br><div>"+ varTxt +"</div>";
	}

function makeNiceTitles()
	{
	for (var i=0; i<document.links.length; i++)
		{
		var lnk = document.links[i];
		if (lnk.title)
			{
			addEvent(lnk, "mousemove", showNiceTitle);
			addEvent(lnk, "mouseout", hideNiceTitle);
			}
		}
	initNiceTitle();
	}

function addEvent(obj, evType, fn){
	if (obj.attachEvent){
		return obj.attachEvent("on" + evType, fn);
	} else if (obj.addEventListener){
		obj.addEventListener(evType, fn, true);
		return true;
	} else {
		return false;
	}
}

function getEventTarget(event)
{
	if (window.event && window.event.srcElement)
		return window.event.srcElement;
	else if (event && event.target)
		return event.target;
	return null;
}

function getNodeWithTag(el, tag) {
	// toLowerCase is for Gecko bug, supposed to be uppercase
	tag = tag.toLowerCase();
	while ((el != null) && ((el.nodeType != 1) || (el.tagName.toLowerCase() != tag)))
		el = el.parentNode;
	return el;
}

//****************************************************************
// Gestion de l'affichage du contenu du alt d'une image
//****************************************************************

var niceAltDummy;
var varAltTxt = "";

function initNiceAlt()
	{
	niceAltDummy = document.createElement("div");
	niceAltDummy.style.position = "absolute";
	niceAltDummy.className = "nicetitle";
	niceAltDummy.style.left = "-1000em";
	niceAltDummy.style.top = "-1000em";
	document.body.appendChild(niceAltDummy);
	}

function hideNiceAlt(e) {
	var img = getNodeWithTag(getEventTarget(e), "img");
	if (varAltTxt != "")
		{
		img.setAttribute("alt",varAltTxt);
		varAltTxt = "";
		}
	niceAltDummy.style.left = "-1000em";
	niceAltDummy.style.top = "-1000em";
	niceAltDummy.innerHTML = "";
	}

function showNiceAlt(e) {
	var img = getNodeWithTag(getEventTarget(e), "img");
	if (window.event)
		{
		x = window.event.clientX+document.body.scrollLeft; 
		y = window.event.clientY+document.body.scrollTop;
		}
	else
		{
		x = e.clientX + window.scrollX; 
		y = e.clientY + window.scrollY;
		}

	if (varAltTxt == "")
		{
		varAltTxt = img.getAttribute("alt");
		img.setAttribute("alt","");
		}

	niceAltDummy.style.left = x+7;
	niceAltDummy.style.top = y+18;
	niceAltDummy.innerHTML = "<img src='../images/nt_img.gif'><br><div>"+ varAltTxt +"</div>";
	}

function makeNiceAlts()
	{
	for (var i=0; i<document.images.length; i++)
		{
		var img = document.images[i];
		if (img.alt)
			{
			addEvent(img, "mousemove", showNiceAlt);
			addEvent(img, "mouseout", hideNiceAlt);
			}
		}
	initNiceAlt();
	}

function addEvent(obj, evType, fn){
	if (obj.attachEvent){
		return obj.attachEvent("on" + evType, fn);
	} else if (obj.addEventListener){
		obj.addEventListener(evType, fn, true);
		return true;
	} else {
		return false;
	}
}

function getEventTarget(event)
{
	if (window.event && window.event.srcElement)
		return window.event.srcElement;
	else if (event && event.target)
		return event.target;
	return null;
}

function getNodeWithTag(el, tag) {
	// toLowerCase is for Gecko bug, supposed to be uppercase
	tag = tag.toLowerCase();
	while ((el != null) && ((el.nodeType != 1) || (el.tagName.toLowerCase() != tag)))
		el = el.parentNode;
	return el;
}


//****************************************************************
// Mise en pause des animations Flash
//****************************************************************

//****************************************************************
// Gestion des dimensions des IFrame
//****************************************************************
function funcIframeSize()
	{
	var intBottomMargin;
	objIframe = document.getElementById("itea");
	if(objIframe)
		{
		// Contrôle de la version du navigateur
		if(navigator.appVersion.indexOf("MSIE 6")>-1)
			{
			// Simplification dans le cas de IE6
			objIframe.height = "2500px";
			}
		else
			{
			// Gestion plus complexe avec les autres types de navigateurs
			document.body.style.overflow = "hidden";
			if (window.attachEvent)
				{
				intBottomMargin = 20;
				}
			else
				{
				intBottomMargin = 5;								
				}
			objIframe.height = document.body.offsetHeight - objIframe.offsetTop - intBottomMargin;
			}
		}
	}
window.onresize = funcIframeSize;

//****************************************************************
// Menu de reroutage
//****************************************************************

function MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}


//****************************************************************
// Initialisation
//****************************************************************

function funcInit()
	{
	makeNiceTitles();
	makeNiceAlts();
	funcInitMap();
	funcInitForm();
	funcMarqueeHover();
	funcIframeSize();
	}

window.onload = funcInit;
