
function show_details (id)
{
var tab = new Array ("prodserv","affairebranche","affairezone","manifest1","manifest2");

if (document.getElementById(id).style.display == 'none')
	{
	document.getElementById(id).style.display = "block";
     for(i=0;i<tab.length;i++)
		{
		if ((tab[i] != id) && document.getElementById(tab[i]) )
 		document.getElementById(tab[i]).style.display = "none";
		}
	}
}

function show_details2 (id)
{
var tab = new Array ("service","chiffre2");

if (document.getElementById(id).style.display == 'none')
	{
	document.getElementById(id).style.display = "block";
     for(i=0;i<tab.length;i++)
		{
		if ((tab[i] != id) && document.getElementById(tab[i]) )
 		document.getElementById(tab[i]).style.display = "none";
		}
	}
}


function show_details3 (id)
{
var tab = new Array ("service2","chiffre1");

if (document.getElementById(id).style.display == 'none')
	{
	document.getElementById(id).style.display = "block";
     for(i=0;i<tab.length;i++)
		{
		if ((tab[i] != id) && document.getElementById(tab[i]) )
 		document.getElementById(tab[i]).style.display = "none";
		}
	}
}





function initNavigationBar() {
	if(!document.getElementsByTagName) return;
	var bOpera = navigator.userAgent.indexOf("Opera") > -1;
	
	function setHoverEvent(li, ul) {
		var css = ul.style;
		li.onmouseover = function() { 
			css.visibility = 'visible';
			if(bOpera) toggleSplashFlash(false);
		}

		li.onmouseout = function() { 
			css.visibility = 'hidden';	
			if(bOpera) toggleSplashFlash(true);
		}

		/*if((li.offsetLeft + ul.offsetWidth) > 664) {
			css.left = 'auto';
			css.right = '0px';
		}*/
	}

	var nav = document.getElementById('menu');
	if(!nav) return;
	var el, li, uls = nav.getElementsByTagName('ul');
	for(var i=0; i<uls.length; i++) {
		el = uls[i].parentNode;
		if(el.nodeName == 'LI') {
			setHoverEvent(el, uls[i]);
		}
	}
}
	function toggleSplashFlash(toggle) {
		var splash = document.getElementById("splashEmbeds");
		splash.style.display = toggle? 'block' : 'none';
	}


/**
 *	Popups
 *	-------------------------
 */


function popupImage(path) {
	window.open('image=' + path, 
		'imageViewer', 'width=320,height=240,left=100,top=100');
}

function openCentered(url, width, height) {
	var left = (screen.width - parseInt(width))/2;
	var top = (screen.height - parseInt(height))/2;
	var settings = 'left='+left+',top='+top+',width='+width+',height='+height+'';
	window.open(url, '', settings);
}




// JavaScript Document
/*-------------------------------------------------------*

/** ParamÃ©trage **/
var SCROLL_PERMANANT_START = 0; // lancer le scroll au dÃ©marage ?
var SCROLL_PERMANANT_D = 0; // nombre de pixels entre chaque pas pour le scroll permanant
var SCROLL_PERMANANT_T = 30; // nombre de millisecondes entre chaque pas pour le scroll permanant

var SCROLL_POS = 0; // position initiale du div
var SCROLL_POS_MIN = 0;
//var SCROLL_POS_MAX = -854; // taille du div en nÃ©gatif
// taille du div en nÃ©gatif -- Passage Ã  10 films = (10*122) au lieu de 7 (7*122=854)

var SCROLL_D = 0;
var SCROLL_T = 0;

/** Fin paramÃ©trage **/
var SCROLL_PERMANANT = SCROLL_PERMANANT_START;
var SCROLL_PERMANANT_TIMEOUT;
var SCROLL_LEFT_TIMEOUT;
var SCROLL_RIGHT_TIMEOUT;

function scrollBoucle() {
	if ( SCROLL_POS < SCROLL_POS_MAX ){
		}
		
	else if ( SCROLL_POS > SCROLL_POS_MIN )
		SCROLL_POS = 0;
		
		
}

function scrollMove() {
	var div = document.getElementById("scroll-conteneur");

	if ( div ) 
		div.style.left = SCROLL_POS + "px";
}

function scrollPermanant() {
	SCROLL_POS = SCROLL_PERMANANT_D;
	
	scrollMove();
	
	SCROLL_PERMANANT_TIMEOUT = setTimeout("scrollPermanant()",SCROLL_PERMANANT_T);
}

function scrollL()
{
	if ( SCROLL_PERMANANT == 1 ) {
		clearTimeout(SCROLR_PERMANANT_TIMEOUT);
		SCROLL_PERMANANT = 0;
	}
	if ( SCROLL_POS <	 SCROLL_POS_MAX ){
	
	
		}
		else if (SCROLL_POS_MAX!=0) {
	SCROLL_POS -= SCROLL_D;
	scrollBoucle();
	scrollMove();

	
	}SCROLL_LEFT_TIMEOUT = setTimeout("scrollL()",SCROLL_T);
}

function scrollR()
{
	if ( SCROLL_PERMANANT == 1 ) {
		clearTimeout(SCROLL_PERMANANT_TIMEOUT);
		SCROLL_PERMANANT = 0;
	}

	
	SCROLL_POS -= SCROLL_D;
	scrollBoucle();
	scrollMove();
	
	SCROLL_RIGHT_TIMEOUT = setTimeout("scrollR()",SCROLL_T);
}

function stopScroll()
{
	clearTimeout(SCROLL_LEFT_TIMEOUT);
	clearTimeout(SCROLL_RIGHT_TIMEOUT);
	
	if ( SCROLL_PERMANANT_START == 1 && SCROLL_PERMANANT == 0) {
		scrollPermanant();
		SCROLL_PERMANANT = 1;
	}
	
}

if ( SCROLL_PERMANANT_START == 1 ) {
	window.onload = scrollPermanant;
}
function MM_validateForm() { //v4.0
  var i,p,q,nm,test,num,min,max,errors,errorMail,errorMailFR,errorMailEN,msgErreur='',args=MM_validateForm.arguments;
  for (i=0; i<(args.length-2); i+=3) { test=args[i+2]; val=MM_findObj(args[i]);
    if (val) { nm=val.name; if ((val=val.value)!="") {
      if (test.indexOf('isEmail')!=-1) { p=val.indexOf('@');
        if (p<1 || p==(val.length-1)) errorMail = 'oui';
      } else if (test!='R') { num = parseFloat(val);
        if (isNaN(val)) errors+='- '+nm+' must contain a number.\n';
        if (test.indexOf('inRange') != -1) { p=test.indexOf(':');
          min=test.substring(8,p); max=test.substring(p+1);
          if (num<min || max<num) errors+='- '+nm+' must contain a number between '+min+' and '+max+'.\n';
    } } } else if (test.charAt(0) == 'R') errors += '- '+nm+' is required.\n'; }
  }
   
  if (errors || errorMail)
  {
	  if (document.forms[0].LANG.value == 'FR') 
	  {
 		if (errors ) 
		msgErreur += '- Veuillez remplir tous les champs obligatoires.\n';
		if (errorMail ) 
		msgErreur += '- Adresse Email invalide.\n';		
	  }
  	  else
		{
 		if (errors ) 
		msgErreur += '- Please fill out all required files.\n';
		if (errorMail ) 
		msgErreur += '- Non valid Email address.\n';		
	  }
  }
 
  
   if (msgErreur )	alert (msgErreur);
  
  document.MM_returnValue = (msgErreur == '');
}

function runSlideShow(){
   if (document.all){
      document.images.SLIDESIMG.style.filter="blendTrans(duration=2)"
      document.images.SLIDESIMG.style.filter="blendTrans(duration=crossFadeDuration)"
      document.images.SLIDESIMG.filters.blendTrans.Apply()      
   }
   document.images.SLIDESIMG.src = preLoad[j].src
   if (document.all){
      document.images.SLIDESIMG.filters.blendTrans.Play()
   }
   j = j + 1
   if (j > (p-1)) j=0
   t = setTimeout('runSlideShow()', slideShowSpeed)
}




function visibilite(thingId)

{
var targetElement;
targetElement = document.getElementById(thingId) ;
if (targetElement.style.display == "none" )
{
targetElement.style.display = "" ;
} else {
targetElement.style.display = "none" ;
}
}
