function Create_DD_Menu() {
  var argv = Create_DD_Menu.arguments;

  var argc = argv.length;

	document.write ('<div id=dd' + argv[1] + ' class=dropdown style="position:absolute; top:0; left:0; z-index:10" onMouseOut="HideMenu(id)" onMouseOver="ShowMenu(id,\'menu' + argv[0] +'\')">');

	if (argc > 2) {
		document.write ('<table class="dd_top" border=0 cellspacing=0 cellpadding=1>');
		document.write ('	<tr class="dd_top">');
		document.write ('		<td class="dd_top">' + argv[2] + '</td>');
		document.write ('	</tr>');
		document.write ('</table>');

		document.write ('<table class="dropdown_menu" border=0 cellspacing=0 cellpadding=1>');

		for (var i = 3; i < argc; i+=2) {
			document.write ('<tr id=ddmi' + argv[1] + i + ' class="ddmi" onMouseOut="DD_Menu_Off(this.id);" onMouseOver="DD_Menu_On(this.id);"  onClick="ShowPage(\'' + argv[i+1] + '\');return false;">');
			document.write ('<td class="ddmi"><a class="ddmi" href="' + argv[i+1] + '">' + argv[i] + '</a></td>');
			document.write ('</tr>');
		}

		document.write ('</table>');
	}

	document.write ('</div>');
}

function ValidateEmail(e) {
	ok = "1234567890qwertyuiop[]asdfghjklzxcvbnm.@-_QWERTYUIOPASDFGHJKLZXCVBNM";
	
	if (e.length == 0)
			return (-1);
	
	for(i=0; i < e.length ;i++) {
		if(ok.indexOf(e.charAt(i))<0) { 
			return (false);
		}	
	} 
	
	re = /(@.*@)|(\.\.)|(^\.)|(^@)|(@$)|(\.$)|(@\.)/;
	re_two = /^.+\@(\[?)[a-zA-Z0-9\-\.]+\.([a-zA-Z]{2,4}|[0-9]{1,3})(\]?)$/;
	if (!e.match(re) && e.match(re_two)) {
		return (-1);		
	} 
}

function Used_Open(ptr,lan,id) {
	PopupWin(ptr+'popup.php?f=2&lan='+lan+'&id='+id,600,550,'yes');
}

function bof() {
	if (top.location != location) {
  	top.location.href = document.location.href;
 	}
}

function ShowPage(id) {
	this.location=id;
}

//top menu
function Menu_On(id) {
	document.getElementById(id).style.backgroundColor='C3C6BA';
	document.getElementById(id).style.cursor='hand';
}
function Menu_Off(id) {
	document.getElementById(id).style.backgroundColor='e9ece5';
	document.getElementById(id).style.cursor='default';
}

function DD_Menu_On(id) {
	document.getElementById(id).style.backgroundColor='C3C6BA';
	document.getElementById(id).style.cursor='hand';
}
function DD_Menu_Off(id) {
	document.getElementById(id).style.backgroundColor='e9ece5';
	document.getElementById(id).style.cursor='default';
}

function ShowMenu(Item, obj) {
	if (use_dropdown) {
		if (browser_type != 'msie') { inc = 4; } else {	inc = 6; }
		
		document.getElementById(Item).style.left = document.getElementById('menu').offsetLeft + document.getElementById(obj).offsetLeft - 1;
		document.getElementById(Item).style.top = document.getElementById('menu').offsetTop + inc;
		document.getElementById(Item).style.visibility = 'Visible';
	}
}
function HideMenu(Item) {
	if (use_dropdown) {
		document.getElementById(Item).style.visibility = 'Hidden';
	}
}

//toc
function TM_On(id) {
	document.getElementById(id).style.backgroundColor='D3D6CB';
	document.getElementById(id).style.cursor='hand';
}
function TM_Off(id) {
	document.getElementById(id).style.backgroundColor='e9ece5';
	document.getElementById(id).style.cursor='default';
}

function TSM_On(id) {
	var sub_id = 's'+id;

	if (browser_type != 'opera') { 
		if(exists = eval(document.getElementById(sub_id+'a'))) 
			document.getElementById(sub_id+'a').style.backgroundColor='D3D6CB';
		if(exists = eval(document.getElementById(sub_id+'b'))) 
			document.getElementById(sub_id+'b').style.backgroundColor='D3D6CB';
		if(exists = eval(document.getElementById(sub_id+'c'))) 
			document.getElementById(sub_id+'c').style.backgroundColor='D3D6CB';
	
		document.getElementById(id).style.backgroundColor='D3D6CB';
	}
	else {
		document.getElementById(sub_id).style.color='0000ff';
	}
	//document.getElementById(sub_id).style.textDecoration='underline';
	document.getElementById(id).style.cursor='hand';
	document.getElementById(sub_id).style.cursor='hand';

}
function TSM_Off(id) {
	var sub_id = 's'+id;

	if (browser_type != 'opera') { 
		if(exists = eval(document.getElementById(sub_id+'a'))) 
			document.getElementById(sub_id+'a').style.backgroundColor='f0f0f0';
		if(exists = eval(document.getElementById(sub_id+'b'))) 
			document.getElementById(sub_id+'b').style.backgroundColor='f0f0f0';
		if(exists = eval(document.getElementById(sub_id+'c'))) 
			document.getElementById(sub_id+'c').style.backgroundColor='f0f0f0';
	
		document.getElementById(id).style.backgroundColor='f0f0f0';
	}
	else {
		document.getElementById(sub_id).style.color='000000';
	}
	document.getElementById(sub_id).style.color='000000';
	//document.getElementById(sub_id).style.textDecoration='none';
	document.getElementById(id).style.cursor='default';
}

//common table row
function TR_On(id) {
	document.getElementById(id).style.backgroundColor='e9ece5';
	document.getElementById(id).style.cursor='hand';
}
function TR_Off(id) {
	document.getElementById(id).style.backgroundColor='';
	document.getElementById(id).style.cursor='default';
}

function PopupWin(page,h,w,t,m,l,s,b,r) {
	if (h==null) h=500;
	if (w==null) w=500;
	if (t==null) t='no';
	if (m==null) m='yes';
	if (l==null) l='no';
	if (s==null) s='yes';
	if (b==null) b='yes';
	if (r==null) r='yes';
	OpenWin = this.open(page, "", "height=" + h + ",width=" + w + ",toolbar=" + t + ",menubar=" + m + ",location=" + l + ",status=" + s + ",scrollbars=" + b + ",resizable=" + r  );
}

function Form(ptr,id,p) {
	if (p==null) {
		pid = '';
	}
	else {
		pid = '&p='+p;
	}
	PopupWin(ptr+'popup.php?f=0&lan='+id.substring(0,2)+'&id='+id+pid,560,465,'yes');
} 

function SpecSheet(ptr,id,prod) {
	PopupWin(ptr+'popup.php?f=1&lan='+id.substring(0,2)+'&id='+prod,550,710,'yes');
} 

function createCookie(name,value,days)
{
	if (days)
	{
		var date = new Date();
		date.setTime(date.getTime()+(days*24*60*60*1000));
		var expires = "; expires="+date.toGMTString();
	}
	else var expires = "";
	document.cookie = name+"="+value+expires+"; path=/";
}

function readCookie(name)
{
	var nameEQ = name + "=";
	var ca = document.cookie.split(';');
	for(var i=0;i < ca.length;i++)
	{
		var c = ca[i];
		while (c.charAt(0)==' ') c = c.substring(1,c.length);
		if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
	}
	return null;
}

function eraseCookie(name)
{
	createCookie(name,"",-1);
}


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_showHideLayers() { //v6.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'':(v=='hide')?'none':v; }
    obj.display=v; }
}

function MM_ZLayers() { //v6.0
  var i,p,v,obj,args=MM_ZLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?9:(v=='hide')?2:v; }
    obj.zIndex=v;  }
}

var HiZObj=null;

function BringToTop()
{ //v6.0
  var i,p,v,obj,args=BringToTop.arguments;
  if ((obj=MM_findObj(args[0]))!=null) {
    if (obj.style) {
        if (HiZObj != null) HiZObj.style.zIndex=2;
        HiZObj=obj;
        obj.style.zIndex=9;
    }
  }
}

               <!--
var ns4 = (document.layers)? true:false;				//NS 4
var ie4 = (document.all)? true:false;					//IE 4
var dom = (document.getElementById)? true:false;	//DOM

function getObject(divId) {
	if (dom) return document.getElementById(divId);
	if (ie4) return document.all[divId];
	if (ns4) return document.layers[divId];
}

function getLeftByObject(myObject) {
	if (dom || ie4) {
		if (myObject.offsetParent) return (myObject.offsetLeft + getLeftByObject(myObject.offsetParent));
		else return (myObject.offsetLeft);
	}
	if (ns4) return (myObject.x);
}

function getLeft(divId) {
	return getLeftByObject(getObject(divId));
}

function getTopByObject(myObject) {
	if (dom || ie4) {
		if (myObject.offsetParent) return (myObject.offsetTop + getTopByObject(myObject.offsetParent));
		else return (myObject.offsetTop);
	}
	if (ns4) return (myObject.y);
}

function getTop(divId) {
	return getTopByObject(getObject(divId));
}

function getHeight(DivId) {
	if (dom) return (document.getElementById(DivId).offsetHeight);
	if (ie4) return (document.all[DivId].clientHeight);
	if (ns4) return (document.layers[DivId].clip.height);
}

function getWidth(DivId) {
	if (dom) return (document.getElementById(DivId).offsetWidth);
	if (ie4) return (document.all[DivId].clientWidth);
	if (ns4) return (document.layers[DivId].clip.width);
}

function setLeft(DivId,X) {
    if (dom) document.getElementById(DivId).style.left = X;
    if (ie4) document.all[DivId].style.posLeft = X;
    if (ns4) document.layers[DivId].pageX = X;
}

function setTop(DivId,Y) {
    if (dom) document.getElementById(DivId).style.top = Y;
    if (ie4) document.all[DivId].style.posTop = Y;
    if (ns4) document.layers[DivId].pageY = Y;
}

function setClip(DivId,DivClipLeft,DivClipRight) {
	if (dom)
		document.getElementById(DivId).style.clip = "rect(auto "+DivClipRight+"px auto "+DivClipLeft+"px)";
	else if (ie4)
		document.all[DivId].style.clip = "rect(auto "+DivClipRight+"px auto "+DivClipLeft+"px)";
	else if (ns4){
		document.layers[DivId].clip.left = DivClipLeft;
		document.layers[DivId].clip.right = DivClipRight;
	}
}

function show(DivId) {
	if (dom) {
		document.getElementById(DivId).style.visibility = "visible";
	} else if (ie4) {
		document.all[DivId].style.visibility = "visible";
	} else if (ns4) {
		document.layers[DivId].visibility = "show";
	}
}

function hide(DivId) {
	if (dom) {
		document.getElementById(DivId).style.visibility = "hidden";
	} else if (ie4) {
		document.all[DivId].style.visibility = "hidden";
	} else if (ns4) {
		document.layers[DivId].visibility = "hide";
	}
}

function posStatic(DivId){
	if (dom){
		document.getElementById(DivId).style.position = "static";
	} else if (ie4) {
		document.all[DivId].style.position = "static";
	} else if (ns4) {
		document.layers[DivId].position = "relative";
	}
}

function posAbsolute(DivId){
	if (dom){
		document.getElementById(DivId).style.position = "absolute";
	} else if (ie4) {
		document.all[DivId].style.position = "absolute";
	} else if (ns4) {
		document.layers[DivId].position = "absolute";
	}
}



function setToAnchor(AnchorId,AnchorName,DivId) {
	 var X,Y,MyAnchor;
    if (dom) MyAnchor = document.getElementById(AnchorId);
    else if (ie4) MyAnchor = document.all[AnchorId];
    else if (ns4) MyAnchor = document.anchors[AnchorName];
    X = getLeftByObject(MyAnchor);
    Y = getTopByObject(MyAnchor);
    setLeft(DivId,X);
    setTop(DivId,Y);
    }

function openPopUp(myFile,myWindow,myWidth,myHeight,myParam){
//myFile :		nom du fichier contenant le code HTML du pop-up
//myWindow :	nom de la fenêtre (ne pas mettre d'espace)
//myWidth :		entier indiquant la largeur de la fenêtre en pixels
//myHeight :	entier indiquant la hauteur de la fenêtre en pixels

	var ns4 = (document.layers)? true:false;			//NS 4
	var ie4 = (document.all)? true:false;			//IE 4
	var dom = (document.getElementById)? true:false;	//DOM
	var xMax, yMax, xOffset, yOffset;

	if (ie4 || dom){
		xMax = screen.width;
		yMax = screen.height;
	} else if (ns4) {
		xMax = window.outerWidth;
		yMax = window.outerHeight;
	} else {
		xMax = 800;
		yMax = 600;
	}

	xOffset = (xMax - myWidth)/2;
	yOffset = (yMax - myHeight)/2;
	fenetre=window.open(myFile,myWindow,'width='+myWidth
					+',height='+myHeight
					+',screenX='+xOffset
					+',screenY='+yOffset
					+',top='+yOffset
					+',left='+xOffset
					+myParam);
	fenetre.resizeTo(myWidth,myHeight);
}

function getScreenWidth() {
	var screenWidth;
	if (ie4 || dom) screenWidth = screen.width;
	else if (ns4) screenWidth = window.outerWidth;
	else screenWidth = 800;
	return screenWidth;
}

function getScreenHeight() {
	var screenHeight;
	if (ie4 || dom) screenHeight = screen.height;
	else if (ns4) screenHeight = window.outerHeight;
	else screenHeight = 600;
	return screenHeight;
}

/* Scroll functions */

function scroll(idDiv, idAnchor, nameAnchor, scrollWidth) {
	this.idDiv			= idDiv;
	this.idAnchor		= idAnchor;
	this.nameAnchor		= nameAnchor;
	this.divLeft		= getLeft(idDiv);				//Position du DIV par rapport au côté gauche de la page
	this.divTop			= getTop(idDiv);				//Position du DIV par rapport au haut de la page
	this.divWidth 		= scrollWidth;					//Largeur du DIV contenant le message
	this.messageWidth = getWidth(idDiv);			//Largeur du Message
	this.scrollActive = true;
	this.first 			= true;							//Indication de démarrage du défilement
	this.startPos 		= this.divLeft + this.divWidth;		//Position de départ du DIV contenant le message
	this.endPos 		= this.divLeft - this.messageWidth;	//Position finale du DIV contenant le message
	this.myPos 			= this.startPos;				//Position courante du DIV contenant le message
	this.divClipLeft 	= 0;								//Début de la partie visible du DIV
	this.divClipRight = 0;								//Fin de la partie visible du DIV
	this.action			= scrollAction;
}

function scrollAction() {
	if (this.scrollActive) {
		if (this.myPos < this.endPos) this.myPos = this.startPos;
		divClipLeft = this.divLeft - this.myPos;
		divClipRight = this.startPos - this.myPos;
		setLeft(this.idDiv,this.myPos);
		setTop(this.idDiv,this.divTop);
		setClip(this.idDiv,divClipLeft,divClipRight);
		if (this.first) {
			//show(this.idDiv);
		}
		this.first = false;
		this.myPos = this.myPos - 1;
	}
}

function scrollInit(idDiv,idAnchor,nameAnchor,scrollWidth){
	setToAnchor(idAnchor,nameAnchor,idDiv);
	return new scroll(idDiv,idAnchor,nameAnchor,scrollWidth);
}

function isInt(myString) {
	for (var i=0; i<myString.length; i++) {
		if ("0123456789".indexOf(myString.charAt(i))==-1) return false;
	}
	return true
}

function favoris(){
	browserName = navigator.appName;
	browserVer = parseInt(navigator.appVersion);

	if (browserName == "Microsoft Internet Explorer" & browserVer >= 4) {
		window.external.AddFavorite('http://www.sanef.com/', 'Sanef.com');
	}
}

function imprimer(){
	window.print();
}

function envoyerpage(){
	var adress = document.location;
	document.location.href="mailto:?subject=Site Sanef&body=" + adress;
}

function openerUrl(url){
	window.opener.location.href = url;
}

function isEmail(myString){
	/* The following pattern is used to check if the entered e-mail address
	   fits the user@domain format.  It also is used to separate the username
	   from the domain. */
	var emailPat=/^(.+)@(.+)$/;
	/* The following string represents the pattern for matching all special
	   characters.  We don't want to allow special characters in the address.
	   These characters include ( ) < > @ , ; : \ " . [ ]    */
	var specialChars="\\(\\)<>@,;:\\\\\\\"\\.\\[\\]";
	/* The following string represents the range of characters allowed in a
	   username or domainname.  It really states which chars aren't allowed. */
	var validChars="\[^\\s" + specialChars + "\]";
	/* The following pattern applies if the "user" is a quoted string (in
	   which case, there are no rules about which characters are allowed
	   and which aren't; anything goes).  E.g. "jiminy cricket"@disney.com
	   is a legal e-mail address. */
	var quotedUser="(\"[^\"]*\")";
	/* The following pattern applies for domains that are IP addresses,
	   rather than symbolic names.  E.g. joe@[123.124.233.4] is a legal
	   e-mail address. NOTE: The square brackets are required. */
	var ipDomainPat=/^\[(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})\]$/;
	/* The following string represents an atom (basically a series of
	   non-special characters.) */
	var atom=validChars + '+';
	/* The following string represents one word in the typical username.
	   For example, in john.doe@somewhere.com, john and doe are words.
	   Basically, a word is either an atom or quoted string. */
	var word="(" + atom + "|" + quotedUser + ")";
	// The following pattern describes the structure of the user
	var userPat=new RegExp("^" + word + "(\\." + word + ")*$");
	/* The following pattern describes the structure of a normal symbolic
	   domain, as opposed to ipDomainPat, shown above. */
	var domainPat=new RegExp("^" + atom + "(\\." + atom +")*$");


	/* Finally, let's start trying to figure out if the supplied address is
	   valid. */

	/* Begin with the coarse pattern to simply break up user@domain into
	???   different pieces that are easy to analyze. */
	var matchArray=myString.match(emailPat);
	if (matchArray==null) {
	  /* Too many/few @'s or something; basically, this address doesn't
		 even fit the general mould of a valid e-mail address. */
		return false
	}
	var user=matchArray[1];
	var domain=matchArray[2];

	// See if "user" is valid
	if (user.match(userPat)==null) {
		// user is not valid
		return false;
	}

	/* if the e-mail address is at an IP address (as opposed to a symbolic
	   host name) make sure the IP address is valid. */
	var IPArray=domain.match(ipDomainPat)
	if (IPArray!=null) {
		// this is an IP address
		  for (var i=1;i<=4;i++) {
			if (IPArray[i]>255) {
				return false;
			}
		}
		return true;
	}

	// Domain is symbolic name
	var domainArray=domain.match(domainPat)
	if (domainArray==null) {
		return false;
	}

	/* domain name seems valid, but now make sure that it ends in a
	   three-letter word (like com, edu, gov) or a two-letter word,
	   representing country (uk, nl), and that there's a hostname preceding
	   the domain or country. */

	/* Now we need to break up the domain to get a count of how many atoms
	   it consists of. */
	var atomPat=new RegExp(atom,"g");
	var domArr=domain.match(atomPat);
	var len=domArr.length;
	if (domArr[domArr.length-1].length<2 ||
		domArr[domArr.length-1].length>3) {
	   // the address must end in a two letter or three letter word.
	   return false;
	}

	// Make sure there's a host name preceding the domain.
	if (len<2) {
	   return false;
	}

	// If we've gotten this far, everything's valid!
	return true;
}


var varScroll;

function init() {
	varScroll = scrollInit("divfil","filinfo","filinfo",400);
	setInterval("varScroll.action()",20);
}






