//----------------------------------------------------------------------------------------------
//--    Auteur : Michel Gautier  (Software Domain)
//--    Date   : XX/XX/2000
//--    Description : Scripts utilisés par un site généré par OO
//----------------------------------------------------------------------------------------------
//--  Historique des modifications :
//--  
//--   Alan Ferronnière 02/06/2005 Gestion de l'impression fonction imprimer()                           
//--
//----------------------------------------------------------------------------------------------

	var MenuFerme = true;
	var myImg = new Image()
	//détection des navigateurs
	var dom = (document.getElementById) ? true : false;
	var ns4 = (document.layers) ? true : false;
    var ie = (document.all) ? true : false;
	var ie4 = ie && !dom;
	var mac = (navigator.appVersion.indexOf("Mac") != -1);
	var ie4m = ie4 && mac;
	var ie5m = ie && mac;
	var ie5w = ie && !mac;
	var ns6 = (navigator.vendor == ("Netscape6") || navigator.product == ("Gecko"));

	function Connecter(varFtp, login)
	{
	   password = window.prompt("Mot de Passe :", "")
	   window.open("ftp://" + login + ":" + password + "@" + varFtp)
	}  
	
	function mailTo(url, width, height, scroll)
	{
		//window.navigate("mailto:"+url)
		window.open("mailto:"+url,"_self")
	}
	
	function navActif(url, width, height, scroll)
	{	
		//window.navigate(url)
		if (new String(location.href).match(/.+\/\d+(-\d+)*\/.+\.htm$/gi) && !new String(url).match(/http:\/\//gi) && !new String(url).match(/javascript:/gi))
		{
			if (ie5w)
				url = "../"+url;
		}
		
		window.open(url,"_self")		
	}
	
	function ouvrir(url, width, height, scroll)
	{
			  
		if (new String(location.href).match(/.+\/\d+(-\d+)*\/.+\.htm$/gi) && !new String(url).match(/http:\/\//gi) && !new String(url).match(/javascript:/gi))
		{
			if (ie5w)
				url = "../"+url;
		}
		
			  if(new String(width) == '0' | new String(width) == 'undefined' | new String(width) == '' | new String(width) == 'null')
			  {width = new String("572")}
			  if(new String(height) == '0' | new String(height) == 'undefined' | new String(height) == '' | new String(height) == 'null')
			  {height = new String("317")}
			  if(new String(scroll) == 'undefined')
			  {scroll = new String("yes")}
			  
			  window.open(url,"","resizable=yes,scrollbars="+scroll+", width="+width+", height="+height)
	}
	
	function ouvrirNewNav(url, width, height, scroll)
	{
			  
		if (new String(location.href).match(/.+\/\d+(-\d+)*\/.+\.htm$/gi) && !new String(url).match(/http:\/\//gi) && !new String(url).match(/javascript:/gi))
		{
			if (ie5w)
				url = "../"+url;
		}
		
			  if(new String(width) == '0' | new String(width) == 'undefined' | new String(width) == '' | new String(width) == 'null')
			  {width = new String("572")}
			  if(new String(height) == '0' | new String(height) == 'undefined' | new String(height) == '' | new String(height) == 'null')
			  {height = new String("317")}
			  if(new String(scroll) == 'undefined')
			  {scroll = new String("yes")}
			  
			  window.open(url,"", "resizable=yes,toolbar=yes,location=yes,status=yes,menubar=yes,scrollbars="+scroll+",width="+width+", height="+height)
	}
	
	function fParent(url, width, height, scroll)
	{
		if (new String(location.href).match(/.+\/\d+(-\d+)*\/.+\.htm$/gi) && !new String(url).match(/http:\/\//gi) && !new String(url).match(/javascript:/gi))
		{
			if (ie5w)
				url = "../"+url;
		}
		
			  
			  if(new String(width) == '0' | new String(width) == 'undefined' | new String(width) == '' | new String(width) == 'null')
			  {width = new String("572")}
			  if(new String(height) == '0' | new String(height) == 'undefined' | new String(height) == '' | new String(height) == 'null')
			  {height = new String("317")}
			  if(new String(scroll) == 'undefined')
			  {scroll = new String("yes")}
			  
			  window.open(url,"_parent", "resizable=yes,toolbar=yes,location=yes,status=yes,menubar=yes,scrollbars="+scroll+",width="+width+", height="+height)
	}
	
	function fTop(url, width, height, scroll)
	{
		if (new String(location.href).match(/.+\/\d+(-\d+)*\/.+\.htm$/gi) && !new String(url).match(/http:\/\//gi) && !new String(url).match(/javascript:/gi))
		{
			if (ie5w)
				url = "../"+url;
		}
		
			  
			  if(new String(width) == '0' | new String(width) == 'undefined' | new String(width) == '' | new String(width) == 'null')
			  {width = new String("572")}
			  if(new String(height) == '0' | new String(height) == 'undefined' | new String(height) == '' | new String(height) == 'null')
			  {height = new String("317")}
			  if(new String(scroll) == 'undefined')
			  {scroll = new String("yes")}
			  
			  window.open(url,"_top", "resizable=yes,toolbar=yes,location=yes,status=yes,menubar=yes,scrollbars="+scroll+",width="+width+", height="+height)
	}
	
	function fIframe(url, width, height, scroll)
	{
		if (new String(location.href).match(/.+\/\d+(-\d+)*\/.+\.htm$/gi) && !new String(url).match(/http:\/\//gi) && !new String(url).match(/javascript:/gi))
		{
			if (ie5w)
				url = "../"+url;
		}
		
			  
			  if(new String(width) == '0' | new String(width) == 'undefined' | new String(width) == '' | new String(width) == 'null')
			  {width = new String("572")}
			  if(new String(height) == '0' | new String(height) == 'undefined' | new String(height) == '' | new String(height) == 'null')
			  {height = new String("317")}
			  if(new String(scroll) == 'undefined')
			  {scroll = new String("yes")}

				try {
					window.document.all.IFrameOO.src = url
				} catch(e) {}
			  
			  //window.open(url,"IFrameOO", "resizable=yes,toolbar=yes,location=yes,status=yes,menubar=yes,scrollbars="+scroll+",width="+width+", height="+height)
	}
	
	function ouvrirModal(url, width, height)
	{
		if (new String(location.href).match(/.+\/\d+(-\d+)*\/.+\.htm$/gi) && !new String(url).match(/http:\/\//gi) && !new String(url).match(/javascript:/gi))
		{
			if (ie5w)
				url = "../"+url;
		}
		
			  if(new String(width) == '0' | new String(width) == 'undefined' | new String(width) == '' | new String(width) == 'null')
			  {width = new String("572")}
			  if(new String(height) == '0' | new String(height) == 'undefined' | new String(height) == '' | new String(height) == 'null')
			  {height = new String("317")}
			  if(new String(scroll) == 'undefined')
			  {scroll = new String("yes")}
			  if(document.all)
			  {
				window.showModalDialog(url, "", "resizable=yes,status:no;unadorned:no;dialogWidth:"+width+ "px; dialogHeight:"+height+"px")
			  }
			  else
			  {
				window.open(url,"contact", "toolbar=no,scrollbars=yes, width="+width+", height="+height)
			  }
	
	}
	function openCloseMenu(val)
	{
	   if(MenuFerme)
	   {
	   	if(parseInt(document.all[val].style.top) < 0)
	   	{
	   		document.all[val].style.top = parseInt(document.all[val].style.top) + 5
	   		setTimeout("openCloseMenu('"+val+"')", 1)
	   	}
	   	else
	   	{
	   		MenuFerme = false
	   	}
	   	
	   }
	   else
	   {
	   	if(parseInt(document.all[val].style.top) > -130)
	   	{
	   		document.all[val].style.top = parseInt(document.all[val].style.top) - 5
	   		setTimeout("openCloseMenu('"+val+"')", 5)
	   	}
	   	else
	   	{
	   		MenuFerme = true
	   	}

	   }
	   //window.event.cancelBubble = true
	}
	
	function fctRollImage(id, val)
	{
		if(document.all)
		{
			document.all[id].src = val
		}
		else
		{
			eval("document."+ id + ".src = " + val)
		}
	}
	
	function ouvrirPopup(idPoppup)
	{
		try
		{
			ptrPopup = document.getElementById(idPoppup)
			if(ptrPopup.style.visibility == "visible")
			{
				ptrPopup.style.visibility = "hidden"
			}
			else
			{
				ptrPopup.style.visibility = "visible"
			}
		}
		catch(e)
		{
		}
	}
	
	