
//BIBLIO V1.2
var ns4=(document.layers);
var ie4=(document.all&&!document.getElementById);
var ie5=(document.all&&document.getElementById);
var ns6=(!document.all&&document.getElementById);
var mac=(navigator.appVersion.indexOf("Mac")>=0)?1:0;
var dom=(document.getElementById)? 1:0;
var ie = (ie4 || ie5)?1:0;

function layer(lyr){if(ns4){obj=document.layers[lyr]}else if(ie4){obj=document.all[lyr].style}else if(dom){obj=document.getElementById(lyr).style}return obj;}
function layerObj(lyr){if(ns4){obj=document.layers[lyr]}else if(ie4){obj=document.all[lyr]}else if(dom){obj=document.getElementById(lyr)}return obj;}
function left(lyr){if(!ns4&&!mac)obj=parseInt(layer(lyr).left.substring(0,layer(lyr).left.indexOf("p")));else if(dom&&mac&&!ie)obj=parseInt(layer(lyr).left.substring(0,layer(lyr).left.indexOf("p")));else{obj=parseInt(layer(lyr).left)}return obj}
function pot(lyr){if(!ns4&&!mac)obj=parseInt(layer(lyr).top.substring(0,layer(lyr).top.indexOf("p")));else if(dom&&mac&&!ie)obj=parseInt(layer(lyr).top.substring(0,layer(lyr).top.indexOf("p")));else {obj=parseInt(layer(lyr).top)}return obj;}
function showHide(lyr,what){layer(lyr).visibility=what;}
function posLeft(lyr,x){layer(lyr).left=x;}
function posTop(lyr,y){layer(lyr).top=y;}
function setWidth(DivId,w){layer(DivId).width = w;}
function setHeight(DivId,h){layer(DivId).height = h;}
function setZ(lyr,z){layer(lyr).zIndex = z;}
function setClip(DivId,MyClip){if(!ns4){layer(DivId).clip="rect(" + MyClip[0] + "px " + MyClip[1] + "px " + MyClip[2] + "px " + MyClip[3] + "px)";}else{document.layers[DivId].clip.top=MyClip[0];document.layers[DivId].clip.right=MyClip[1];document.layers[DivId].clip.bottom=MyClip[2];document.layers[DivId].clip.left=MyClip[3];}}
function getHeight(DivId){if((ie5&&!mac)||ns6)return(document.getElementById(DivId).offsetHeight);else if(ie4)return(document.all[DivId].clientHeight); else if(ns4)return(document.layers[DivId].clip.height);else if(ie5&&mac) return(document.all[DivId].offsetHeight);else return(document.getElementById(DivId).offsetHeight);}
function getWidth(DivId){if((ie5&&!mac)||ns6)return(document.getElementById(DivId).offsetWidth);else if(ie4)return(document.all[DivId].clientWidth);else if(ns4)return(document.layers[DivId].clip.width);else if(ie5&&mac) return(document.all[DivId].offsetWidth);else return(document.getElementById(DivId).offsetWidth)}
function aleft(MyObject){if(dom||ie4){if(MyObject.offsetParent){return(MyObject.offsetLeft + aleft(MyObject.offsetParent));}else{return(MyObject.offsetLeft);}}if(ns4){return(MyObject.x);}}
function atop(MyObject){if(dom||ie4){if(MyObject.offsetParent){return(MyObject.offsetTop + atop(MyObject.offsetParent));}else{return(MyObject.offsetTop);}}if(ns4){return(MyObject.y);}}
function setToAnchor(AnchorName,lyr,lyrContainAnchor){var MyAnchor;if(dom){MyAnchor=document.getElementById(AnchorName);}else if(ie4){MyAnchor=document.all[AnchorName];}else if(ns4){if(arguments.length==3){MyAnchor= document.layers[lyrContainAnchor].document.anchors[AnchorName];}else{MyAnchor=document.anchors[AnchorName];}}if((arguments.length==2)||(arguments.length==3)){var deltaX=(ns4 && arguments.length==3)?document.layers[lyrContainAnchor].left:0;var deltaY=(ns4 && arguments.length==3)?document.layers[lyrContainAnchor].top:0;posLeft(lyr,aleft(MyAnchor) + deltaX);posTop(lyr,atop(MyAnchor) + deltaY);}else{if(arguments[2]=="x"){posLeft(lyr,aleft(MyAnchor));}else{posTop(lyr,atop(MyAnchor));}}}
function innerContentHTML(content,lyr){if(ns4){with(layerObj(lyr)){document.open();document.write(content);document.close();}}else layerObj("LyrHide").innerHTML=content;}
function preChargerImg(){var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();var i,j=d.MM_p.length,a=preChargerImg.arguments;for(i=0; i<a.length; i++) if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}}
// FIN BIBLIO


// This function show the current navigation menu, and show the hidden button
var activMenu;
function showCurrentMenu(currentMenu){
	if(document.pageIsLoaded==1)
	{
		document.activMenu = currentMenu;
		showHide(currentMenu,"visible");
		makeLyrHide();
	}
}

// This function hide the active menu, and all the ssMenu (they must be specify in the argument list)
function hideActiveMenu(){
	showHide(document.activMenu,"hidden");
	// hideActiveSSMenu('MenuRubPressCenter','MenuRubFF','MenuRubamenities','MenuRubSpecial','MenuRubLeisure');
	// Hide the hidden button Lyr
	showHide("LyrHide","hidden");
}


// This function create a dynamique button (as large as the client's screen), and hide the active navigation menu when you mouseover the dynamique button 
function makeLyrHide(){
	var delta = 80;
	hideImgNavHeight = (ie)?document.body.clientHeight - delta:window.innerHeight - delta; 
	hideImgNavWidth  = (ie)?document.body.clientWidth - delta:window.innerWidth - delta;
	htmlSrc = "<a href='#' onmouseover='hideActiveMenu()'><img src='/images/dot.gif' width="+hideImgNavWidth+" height="+hideImgNavHeight+" border=0></a>";
	innerContentHTML(htmlSrc,"LyrHide");
	showHide("LyrHide","visible");
}

// This function fix all the navigation menu on the anchors, and is call on resize
function fixLyrNav(){
setToAnchor('Consulter','SousMenuConsulter');
setToAnchor('Context','SousMenuContext');
setToAnchor('Produit','SousMenuProduit');
//setToAnchor('Outil','SousMenuOutil');
setToAnchor('Actualite','SousMenuActualite');
setToAnchor('Societe','SousMenuSociete');


}

///////////////////////////// Activation NAVIGATION
function activeNav(leLienActived)
{
	document.getElementById(leLienActived).style.color = '#92000F';
}

///////////////////////// LAYER DE POP UP
function showPopup(ancre, currentMenu){
	if(document.pageIsLoaded==1)
	{
		setToAnchor(ancre,currentMenu);
		showHide(currentMenu,"visible");
		
		hideImgNavHeight = document.body.scrollHeight; 
		hideImgNavWidth  = document.body.scrollWidth;
		setWidth("layerGris", hideImgNavWidth+"px");
		setHeight("layerGris", hideImgNavHeight+"px");
		showHide("layerGris", "visible");
	}
}
function hidePopup(currentMenu){
	if(document.pageIsLoaded==1)
	{
		showHide(currentMenu,"hidden");
		showHide("layerGris","hidden");
		setWidth("layerGris","0px");
		setHeight("layerGris","0px");
	}
}

////////////////////////// CHANGEMENT DE LANGUE 
function validerformChangementLangue()
{
	lg = document.ChangementLangue.langue.value;
	if (lg == "fr")
	{self.location="http://www.quickfds.fr/"+lg+"/index.html";}
	else if (lg == "en")
	{self.location="http://www.quicksds.com/"+lg+"/index.html";}
	else if (lg == "nl")
	{self.location="http://www.quicksds.nl/"+lg+"/index.html";}
}




///////////////////////////////////////
function MontrerForm(LeMenu)
{
loption = document.getElementById(LeMenu).value;
	// Menu VOUS ETRE
	if(LeMenu === 'VousEtes' && loption === 'Autre')
	{
		document.getElementById('TableVousEtesAutre').style.display = 'block';
		return false;
	}
	if(LeMenu === 'VousEtes' && loption != 'Autre')
	{
		document.getElementById('TableVousEtesAutre').style.display = 'none';
		return false;
	}
	// Menu ACTIVITE
	if(LeMenu === 'Activite' && loption === 'Service')
	{
		document.getElementById('TableActiviteService').style.display = 'block';
		// On verifie que Autre est pas actif
		if (document.getElementById('TableActiviteAutre').style.display === 'block')
		{
			document.getElementById('TableActiviteAutre').style.display = 'none';
		}
		return false;
	}
	if(LeMenu === 'Activite' && loption === 'Autre')
	{
		document.getElementById('TableActiviteAutre').style.display = 'block';
		// On verifie que Autre est pas actif
		if (document.getElementById('TableActiviteService').style.display === 'block')
		{
			document.getElementById('TableActiviteService').style.display = 'none';
		}
		return false;
	}
	if(LeMenu === 'Activite' && ( loption != 'Service' || loption != 'Autre' ))
	{
		document.getElementById('TableActiviteService').style.display = 'none';
		document.getElementById('TableActiviteAutre').style.display = 'none';
		return false;
	}
	
	
	
	
	// Menu NATUREDELADEMANDE
	if(LeMenu === 'NatureDeLaDemande' && loption === 'Autre')
	{
		document.getElementById('TableAutre-Nature-De-La-Demande').style.display = 'block';
		return false;
	}
	if(LeMenu === 'NatureDeLaDemande' && loption != 'Autre')
	{
		document.getElementById('TableAutre-Nature-De-La-Demande').style.display = 'none';
		return false;
	}
	// Menu COMMENT-AVEZ-VOUS-CONNU-QUICKFDS
	if(LeMenu === 'Comment-Avez-Vous-Connu-QuickFDS' && loption === 'Salon')
	{
		document.getElementById('TableSalon-Comment-Avez-Vous-Connu-QuickFDS').style.display = 'block';
		// On verifie que Autre est pas actif
		if (document.getElementById('TableAutre-Comment-Avez-Vous-Connu-QuickFDS').style.display === 'block')
		{
			document.getElementById('TableAutre-Comment-Avez-Vous-Connu-QuickFDS').style.display = 'none';
		}
		return false;
	}
	if(LeMenu === 'Comment-Avez-Vous-Connu-QuickFDS' && loption === 'Autre')
	{
		document.getElementById('TableAutre-Comment-Avez-Vous-Connu-QuickFDS').style.display = 'block';
		// On verifie que salon est pas actif
		if (document.getElementById('TableSalon-Comment-Avez-Vous-Connu-QuickFDS').style.display === 'block')
		{
			document.getElementById('TableSalon-Comment-Avez-Vous-Connu-QuickFDS').style.display = 'none';
		}
		if (document.getElementById('TableSalonAutre-Comment-Avez-Vous-Connu-QuickFDS').style.display === 'block')
		{
			document.getElementById('TableSalonAutre-Comment-Avez-Vous-Connu-QuickFDS').style.display = 'none';
		}
		return false;
	}
	if(LeMenu === 'Comment-Avez-Vous-Connu-QuickFDS' && ( loption != 'Salon' || loption != 'Autre' ))
	{
		document.getElementById('TableSalon-Comment-Avez-Vous-Connu-QuickFDS').style.display = 'none';
		document.getElementById('TableAutre-Comment-Avez-Vous-Connu-QuickFDS').style.display = 'none';
		document.getElementById('TableSalonAutre-Comment-Avez-Vous-Connu-QuickFDS').style.display = 'none';
		return false;
	}
	
	// MENU SALON-COMMENT-AVEZ-VOUS-CONNU-QUICKFDS
	if (LeMenu === 'SalonCommentAvezVousConnuQuickFDS' && loption === 'Autre')
	{
		document.getElementById('TableSalonAutre-Comment-Avez-Vous-Connu-QuickFDS').style.display = 'block';
		return false;
	}
	if (LeMenu === 'SalonCommentAvezVousConnuQuickFDS' && loption != 'Autre')
	{
		document.getElementById('TableSalonAutre-Comment-Avez-Vous-Connu-QuickFDS').style.display = 'none';
		return false;
	}
}





///////////////////////////// OUVERTURE POP UP

function OuvrirPop(url,nom,haut,Gauche,largeur,hauteur,options) {
ouvpop=window.open(url,nom,"top="+haut+",left="+Gauche+",width="+largeur+",height="+hauteur+","+options);
}

// APPEL DEPUIS LA PAGE
// href='javascript:OuvrirPop("/fr/reglementation/textes-reglementaires-fournisseurs.html","popup",10,10,400,350,"menubar=no,scrollbars=no,statusbar=no")'