<!-- Votre browser ne traite pas le Java-->




var whitespace = " \t\n\r";
var invalidChar = "'[]}{´^ /\<>^éèçàùöëêâ()°~-+_#.;:,?!§";
var invalidCharShow="";
 // Focus sur l'objet qui contient une erreur + message d'erreur-->
function warnInvalid (theField,s)
{
    theField.focus()
    theField.select()
    alert(s)    

    return false
}
// Verifie si une chaîne est vide ou pas 
function isEmpty(s) {
    return ((s == null) || (s.length == 0))
}

// verifie si on a des espaces en s

function isWhitespace(s) {
    var i;

    if (isEmpty(s)) return true;
    for (i = 0; i < s.length; i++)
    {   
        var c = s.charAt(i);
        if (whitespace.indexOf(c) == -1) return false; // not whitespace
    }
    return true;
}
// verifie si le caractère est un digit ou un espace (pour les numeros de téléphone)
function isDigitorWhite (c){
   return ((c >= "0") && (c <= "9") || isWhitespace(c))
}
// Verifie si le caractère est un chiffre 
function estDigit (c){
   return ((c >= "0") && (c <= "9"))
}

// Verifie si la chaîne est un numero de téléphone valide  en se composant des chiffres et des espaces
function isTel (s){
    var i,cpt;
	cpt=0;
      for (i = 0; i < s.length; i++)
    {   
        var c = s.charAt(i);
		
		
        if (estDigit(c)) 
		{
		  cpt = cpt + 1
		}
		else
		{
		 if (!isWhitespace(c) || !estDigit(c))
		  return false;
		}
	   
	}
	// alert ("cpt="+cpt+"lenght="+s.lenght) 
//	if (cpt < 9)
//	 return false
//	else
	 return true;
    
}

// Verifie si le caractère est un chiffre 
function estDigit (c){
   return ((c >= "0") && (c <= "9"))
}
//verifie si la chaîne est composée des chiffres
function isDigit(s)
{ 

 for (i = 0; i < s.length; i++)
     {   
        var c = s.charAt(i);
        if (!estDigit(c))
		{
		 return false;
        } 
	 }
return true;
}

function isInvalid(s) {
    var i;

    if (isEmpty(s)) return true;
    for (i = 0; i < s.length; i++)
    {   
        var c = s.charAt(i);
       if (invalidChar.indexOf(c) == -1)
        
        	 return false; // not whitespace
       
    }
    return true;
}

function checkInvalidChar (s){
    var i,cpt;
	cpt=0;
      for (i = 0; i < s.length; i++)
    {   
        var c = s.charAt(i);
		
		
        if (isInvalid(c))
        {
			invalidCharShow = c;
        	return false;
        }
    }
	   return true;
	}

	function checkAlphaChar (s)
	{
  var charpos = s.search("[^ A-Za-zéèçàùöëêâ]"); 
              if(s.length > 0 &&  charpos >= 0) 
              { 
                
                return false; 
              }
         return true;     
		
	}
  //  /(ftp|http|https):\/\/
function checkAlphaNumChar (s)
	{
  var charpos = s.search("[^A-Za-zéèçàùöëêâ0-9]"); 
              if(s.length > 0 &&  charpos >= 0) 
              { 
                
                return false; 
              }
         return true;     
		
	}
function isUrl(s) {
	 var re = new RegExp("/(\w+:{0,1}\w*@)?(\S+)(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!\-\/]))?/");
	
	return s.match(re);
}


function isMail(email) { 

 
  
// 

        invalidChars = " /:,;" 

        for (i=0; i<invalidChars.length; i++) { 
        // does it contain any invalid characters? 
            badChar = invalidChars.charAt(i) 
            if (email.indexOf(badChar,0) > -1) { 
         
                     return false 
             } 
         } 
         atPos = email.indexOf("@",1) // there must be one "@" symbol 
         if (atPos == -1) { 
        
                return false 
         } 
         if (email.indexOf("@",atPos+1) != -1) { // and only one "@" symbol 
     
                   return false 
          } 
         periodPos = email.indexOf(".",atPos) 
         if (periodPos == -1) {   // and at least one "." after the "@" 
  
            return false 
         } 
         if (periodPos+3 > email.length) {// must be at least 2 characters 
 
                return false 
          } 

          return true 
      }

 

// ***************************************************************************************



function HideDiv(element,class1,class2) {
if (element)
	{
	if (element.className==class2) {
			element.className = class1;
		}
		
	}	
	}
function ShowDiv(element,class1,class2) {

	if (element)
	{
	if (element.className==class1) {
			element.className = class2;
		}
		
	}
}

function showhideDivs(div)
{
	switch (div)
{
case (0):

ShowDiv(document.getElementById("divmenuprod"),'DisplayNone','DisplayBlock')

HideDiv(document.getElementById("divmenunews"),'DisplayNone','DisplayBlock')
HideDiv(document.getElementById("divmenutemoin"),'DisplayNone','DisplayBlock')
HideDiv(document.getElementById("divmenucontact"),'DisplayNone','DisplayBlock')
HideDiv(document.getElementById("divmenulinks"),'DisplayNone','DisplayBlock')

break

case (1):

HideDiv(document.getElementById("divmenuprod"),'DisplayNone','DisplayBlock')

ShowDiv(document.getElementById("divmenunews"),'DisplayNone','DisplayBlock')
HideDiv(document.getElementById("divmenutemoin"),'DisplayNone','DisplayBlock')
HideDiv(document.getElementById("divmenucontact"),'DisplayNone','DisplayBlock')
HideDiv(document.getElementById("divmenulinks"),'DisplayNone','DisplayBlock')
break
case (2):
HideDiv(document.getElementById("divmenuprod"),'DisplayNone','DisplayBlock')

HideDiv(document.getElementById("divmenunews"),'DisplayNone','DisplayBlock')
ShowDiv(document.getElementById("divmenutemoin"),'DisplayNone','DisplayBlock')
HideDiv(document.getElementById("divmenucontact"),'DisplayNone','DisplayBlock')
HideDiv(document.getElementById("divmenulinks"),'DisplayNone','DisplayBlock')
break
case (3):
HideDiv(document.getElementById("divmenuprod"),'DisplayNone','DisplayBlock')

HideDiv(document.getElementById("divmenunews"),'DisplayNone','DisplayBlock')
HideDiv(document.getElementById("divmenutemoin"),'DisplayNone','DisplayBlock')
ShowDiv(document.getElementById("divmenucontact"),'DisplayNone','DisplayBlock')
HideDiv(document.getElementById("divmenulinks"),'DisplayNone','DisplayBlock')
break
case (4):
HideDiv(document.getElementById("divmenuprod"),'DisplayNone','DisplayBlock')

HideDiv(document.getElementById("divmenunews"),'DisplayNone','DisplayBlock')
HideDiv(document.getElementById("divmenutemoin"),'DisplayNone','DisplayBlock')
HideDiv(document.getElementById("divmenucontact"),'DisplayNone','DisplayBlock')
ShowDiv(document.getElementById("divmenulinks"),'DisplayNone','DisplayBlock')
break
default:

HideDiv(document.getElementById("divmenuprod"),'DisplayNone','DisplayBlock')

HideDiv(document.getElementById("divmenunews"),'DisplayNone','DisplayBlock')
HideDiv(document.getElementById("divmenutemoin"),'DisplayNone','DisplayBlock')
HideDiv(document.getElementById("divmenucontact"),'DisplayNone','DisplayBlock')
HideDiv(document.getElementById("divmenulinks"),'DisplayNone','DisplayBlock')
break
}
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.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];}}
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
function MM_openBrWindow(theURL,winName,features) { //v2.0
   window.open(theURL,winName,features);
  
}



var bName = navigator.appName;
 var bVer = parseInt(navigator.appVersion);
 var NS4 = (bName == "Netscape" && bVer >= 4);
 var IE4 = (bName == "Microsoft Internet Explorer" && bVer >= 4);
 var NS3 = (bName == "Netscape" && bVer < 4);
 var IE3 = (bName == "Microsoft Internet Explorer" && bVer < 4);
function writeDiv(divname,picname)
  {
 img = getImage(picname);
 //alert(getImagePageLeft(img)+ ' ' +getImagePageTop(img));
 var Left = getImagePageLeft(img) - 230;
 var Top = getImagePageTop(img) +10;
//img = document.getElementById(picname);
/*document.write("<div class='DisplayBlock' style=' float: right; margin: 0px; position: absolute; right: "+Left+"px; top: "+Top+"px;' width : 120; 	text-align: right; z-index: 50; id='"+divname+"' z-order=5>");*/
document.write("<div class='DisplayBlock' style='float: right;  margin: 0px;position: absolute;  right: "+Left+"px; top: "+Top+"px;' width : 120; 	text-align: right; z-index: 50; id='"+divname+"' z-order=5>");
/* self.moveTo(screen.availWidth/2-(document.images[0].width/2),screen.availHeight/2-(document.images[0].height/2));

  */
  
  }
  
  function getImage(name) {
  if (NS4) {
    return findImage(name, document);
  }
  if (IE4)
    return eval('document.all.' + name);
  return null;
}
  function findImage(name, doc) {
  var i, img;
  for (i = 0; i < doc.images.length; i++)
    if (doc.images[i].name == name)
      return doc.images[i];
  for (i = 0; i < doc.layers.length; i++)
    if ((img = findImage(name, doc.layers[i].document)) != null) {
      img.container = doc.layers[i];
      return img;
    }
  return null;
}

function getImagePageLeft(img) {
  var x, obj;
  if (NS4) {
    if (img.container != null)
      return img.container.pageX + img.x;
      
    else
      return img.x;
  }
  if (IE4) {
    x = 0;
    obj = img;
    while (obj.offsetParent != null) {
      x += obj.offsetLeft;
      obj = obj.offsetParent;
    }
    x += obj.offsetLeft;
    return x;
  }
  return -1;
}

function getImagePageTop(img) {
  var y, obj;
  if (NS4) {
    if (img.container != null)
      return img.container.pageY + img.y;
    else
      return img.y;
  }
  if (IE4) {
    y = 0;
    obj = img;
    while (obj.offsetParent != null) {
      y += obj.offsetTop;
      obj = obj.offsetParent;
    }
    y += obj.offsetTop;
    return y;
  }
  return -1;
}


//fin du script -->
