// JavaScript Document

// ************************************************************************************
// Affichage de popup
// ************************************************************************************
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));
}


// ************************************************************************************
// Gestion du menu
// ************************************************************************************

sfHover = function() {
	var sfEls = document.getElementById("menu").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);

// ************************************************************************************
// Gestion des POPUP
// ************************************************************************************
/* fonction permettant l'affichage du POPUP */
function funcPopupPlan(varUrl)
	{
	WinPopUpPlan = window.open (varUrl, "PopUpPlan", "height=505, width=593, 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);
	}

/*--------------------------------------------------------------------------------*/

/* fonction permettant l'affichage du POPUPRendezVous */
function funcPopupRendezVous(varUrl)
	{
	WinPopUpRendezVous = window.open (varUrl, "PopUpRendezVous", "height=700, width=300, toolbar=no, menubar=no, scrollbars=no, resizable=no, location=no, directories=no, status=no");
	WinPopUpRendezVous.focus();
	var ScreenW = screen.availWidth;
	var ScreenH = screen.availHeight;
	WinPopUpRendezVous.moveTo((ScreenW-270)/2, (ScreenH-795)/2);
	}
/*--------------------------------------------------------------------------------*/

/* fonction permettant l'affichage du POPUP Devis */
function funcPopupDevis(varUrl, varPdt)
	{
	WinPopUpDevis = window.open (varUrl + "?PdtId=" + varPdt, "PopUpDevis", "height=700, width=300, toolbar=no, menubar=no, scrollbars=no, resizable=no, location=no, directories=no, status=no");
	WinPopUpDevis.focus();
	var ScreenW = screen.availWidth;
	var ScreenH = screen.availHeight;
	WinPopUpDevis.moveTo((ScreenW-270)/2, (ScreenH-795)/2);
	}
/*--------------------------------------------------------------------------------*/

/*	Fonction de retraitement des liens vers les ressources extérieures au site */

function funcExtLnk()
	{
	//--- Boucle sur la collection des liens de la page courante
	for (i=0; i<document.links.length; i++)
		{
		//--- Contrôle s'il s'agit d'un lien vers une ressource extérieure
		if ((document.links(i).hostname != window.location.hostname) && (document.links(i).protocol == "http:"))
			{
			document.links(i).target = "_blank";	
			}
		}
	}

window.onload = funcExtLnk;
/*--------------------------------------------------------------------------------*/