// V1.11
// 21/08/02
<!--
parent.document.title = document.title;

function sniffer() {
    var agent = navigator.userAgent.toLowerCase();
    this.major = parseInt(navigator.appVersion);
    this.minor = parseFloat(navigator.appVersion);
    this.ns  = ((agent.indexOf('mozilla')!=-1) && ((agent.indexOf('spoofer')==-1) && (agent.indexOf('compatible') == -1)));
    this.ns2 = (this.ns && (this.major == 2));
    this.ns3 = (this.ns && (this.major == 3));
    this.ns4b = (this.ns && (this.minor < 4.04));
    this.ns4 = (this.ns && (this.major == 4));
    this.ns6 = (this.ns && (this.major >= 5));
    this.ie   = (agent.indexOf("msie") != -1);
    this.ie3  = (this.ie && (this.major == 2));
    this.ie5  = (this.ie && (this.major >= 4) && (document.getElementById) ) ? true : false ;
    this.ie6  = (this.ie5 && (agent.indexOf('msie 6')!=-1) ) ? true : false ;
    this.ie4  = (this.ie && (this.major >= 4) && !(this.ie5));
    this.op3 = (agent.indexOf("opera") != -1);
    this.win   = (agent.indexOf("win")!=-1);
    this.mac   = (agent.indexOf("mac")!=-1);
    this.unix  = (agent.indexOf("x11")!=-1);
    this.dom = (this.ns6 || this.ie5 );
}

var clientIs = new sniffer();

/********************************************************************
*                   Ajout des feuilles de styles                    *
********************************************************************/
//document.open();

if(clientIs.ie){
                document.write('<link rel="stylesheet" type="text/css" href="../css/styleie.css">');

        } else { 
                this.document.write('<link rel="stylesheet" type="text/css" href="../css/stylens.css">');
        }
document.close();

function openWin(URL,w,h,resize,scroll)
{
lAttributes = '';
lAttributes += 'toolbar=0,';
lAttributes += 'Location=0,';
lAttributes += 'directory=0,';
lAttributes += 'status=0,';
lAttributes += 'menubar=0,';
lAttributes += 'scrollbars='+scroll+',';
lAttributes += 'resizable='+resize+',';
lAttributes += 'width='+w+',';
lAttributes += 'left='+((screen.width - w) / 2)+',';
lAttributes += 'height='+h+',';
lAttributes += 'top='+((screen.height - h) / 2)+'';

winId = window.open(URL,"_blank",lAttributes, false);
}

function openWin2(URL,title,w,h,resize,scroll)
{
lAttributes = '';
lAttributes += 'toolbar=0,';
lAttributes += 'Location=0,';
lAttributes += 'directory=0,';
lAttributes += 'status=0,';
lAttributes += 'menubar=0,';
lAttributes += 'scrollbars='+scroll+',';
lAttributes += 'resizable='+resize+',';
lAttributes += 'width='+w+',';
lAttributes += 'left='+((screen.width - w) / 2)+',';
lAttributes += 'height='+h+',';
lAttributes += 'top='+((screen.height - h) / 2)+'';

winId = window.open(URL,title,lAttributes);
}

function openWin3(URL,title,w,h,resize,scroll)
{
lAttributes = '';
lAttributes += 'toolbar=0,';
lAttributes += 'Location=0,';
lAttributes += 'directory=0,';
lAttributes += 'status=0,';
lAttributes += 'menubar=0,';
lAttributes += 'scrollbars='+scroll+',';
lAttributes += 'resizable='+resize+',';
lAttributes += 'width='+w+',';
lAttributes += 'left='+(((screen.width - w) / 2)+ 20)+',';
lAttributes += 'height='+h+',';
lAttributes += 'top='+(((screen.height - h) / 2)+ 20)+'';

winId = window.open(URL,title,lAttributes);
}


function openPrint(URL,w,h,resize,scroll)
{
lAttributes = '';
lAttributes += 'toolbar=1,';
lAttributes += 'Location=0,';
lAttributes += 'directory=0,';
lAttributes += 'status=0,';
lAttributes += 'menubar=1,';
lAttributes += 'scrollbars='+scroll+',';
lAttributes += 'resizable='+resize+',';
lAttributes += 'width='+w+',';
lAttributes += 'height='+h+'';

winId = window.open(URL,"",lAttributes);
}



function getLanguage()
{
var url = document.location.href;
if (url.indexOf("/fr/")!=-1) return "fr";
if (url.indexOf("/en/")!=-1) return "en";
if (url.indexOf("/es/")!=-1) return "es";
}
function switchLanguage(increment)
{
	for(i=0;i<top.frames.length;i++)
	{
		var pagepath = top.frames[i].document.location.href;


		index = pagepath.lastIndexOf("/");
		pagefilename = pagepath.substring(index+1,pagepath.length);
	
		tmppath = pagepath.substring(0,index);
		index = tmppath.lastIndexOf("/");
		language = tmppath.substring(index+1,tmppath.length);


		nextpath = tmppath.substring(0,index);

		/*
*/
		if (language=='fr')
		{
			if(increment==1)
				language= '/es/' ;
			else
				language= '/en/';
		}
		else if(language=='en')
		{
			if(increment==1)
				language= '/fr/' ;
			else
				language= '/es/';
		}
		else 
		{
			if(increment==1)
				language= '/en/' ;
			else
				language= '/fr/';
		}


	top.frames[i].document.location.href = nextpath + language + pagefilename;

	//top.frames[i].document.location.reload();
	}

}
function directAccess(URL)
{
	var pageNameIndex = URL.lastIndexOf("/");
	pageName = URL.substring(pageNameIndex+1,URL.length);

	if(pageName=="index.php")
	{
		parent.location.href = URL;
	}
	else
	{
		location.href = URL;
	}
}

/******************** fonctions ow fiche technique et zoom *************/
function fiche(newurl, type)
{
	openWin(newurl,605,497,0,0);
}
function zoom(newurl, direction)
{
	openWin(newurl,605,597,0,0);
}

function retouralaRecherche()
{
history.back();
}
/******************************************************************************
*                   Gestion du resize et des styles sous NS4                  *
******************************************************************************/
function onloadGlobalHandler()
{
	handleWindowResize();
}

function handleWindowResize()
{
	var clientIs = new sniffer();
	if(!clientIs.ns4) return;

	setTimeout("top.onresize=redo",1000);
}
function redo()
{
	for(i=0;i<top.frames.length;i++)
	{
		top.frames[i].document.location.reload();
	}
}

/******************************************************************************

******************************************************************************/

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_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_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);
}


/*******************************************************************************
/					Poster un formulaire en tapant sur enter 
/******************************************************************************/
function entsub(myform) {
  if (window.event && window.event.keyCode == 13)
    myform.submit();
  else
    return true;
}

/*******************************************************************************
/					Ouvrir un fenêtre en pop-up 
/******************************************************************************/
function Popup(u,W,H) {
	window.open(u,'Popupin','resizable=yes,scrollbars=yes,width=' + W +',height=' + H);
	//return false;
}

/******************************************************************************
*                   action clic pour chutier                  *
******************************************************************************/
function actChutier(enreg, classeur, doc, objCheck, cote)
{
	document.chutier.cmd.value = (objCheck.checked?"add":"del");
	document.chutier.enreg.value = enreg;
	document.chutier.classeur.value = classeur;
	document.chutier.doc.value = doc;
	document.chutier.cote.value = cote;
	document.chutier.submit();
}
function actChutier2(enreg, classeur, doc, objCheck, cote)
{
	document.chutier.cmd.value = "del";
	document.chutier.enreg.value = enreg;
	document.chutier.classeur.value = classeur;
	document.chutier.doc.value = doc;
	document.chutier.cote.value = cote;
	document.chutier.submit();
	document.location.href='sel_mosa.asp';
	opener.document.location.href=opener.document.location.href;
}

function YY_checkform() { //v4.66
//copyright (c)1998,2002 Yaromat.com
  var args = YY_checkform.arguments; var myDot=true; var myV=''; var myErr='';var addErr=false;var myReq;
  for (var i=1; i<args.length;i=i+4){
    if (args[i+1].charAt(0)=='#'){myReq=true; args[i+1]=args[i+1].substring(1);}else{myReq=false}
    var myObj = MM_findObj(args[i].replace(/\[\d+\]/ig,""));
    myV=myObj.value;
    if (myObj.type=='text'||myObj.type=='password'||myObj.type=='hidden'){
      if (myReq&&myObj.value.length==0){addErr=true}
      if ((myV.length>0)&&(args[i+2]==1)){ //fromto
        var myMa=args[i+1].split('_');if(isNaN(myV)||myV<myMa[0]/1||myV > myMa[1]/1){addErr=true}
      } else if ((myV.length>0)&&(args[i+2]==2)){
          var rx=new RegExp("^[\\w\.=-]+@[\\w\\.-]+\\.[a-z]{2,4}$");if(!rx.test(myV))addErr=true;
      } else if ((myV.length>0)&&(args[i+2]==3)){ // date
        var myMa=args[i+1].split("#"); var myAt=myV.match(myMa[0]);
        if(myAt){
          var myD=(myAt[myMa[1]])?myAt[myMa[1]]:1; var myM=myAt[myMa[2]]-1; var myY=myAt[myMa[3]];
          var myDate=new Date(myY,myM,myD);
          if(myDate.getFullYear()!=myY||myDate.getDate()!=myD||myDate.getMonth()!=myM){addErr=true};
        }else{addErr=true}
      } else if ((myV.length>0)&&(args[i+2]==4)){ // time
        var myMa=args[i+1].split("#"); var myAt=myV.match(myMa[0]);if(!myAt){addErr=true}
      } else if (myV.length>0&&args[i+2]==5){ // check this 2
            var myObj1 = MM_findObj(args[i+1].replace(/\[\d+\]/ig,""));
            if(myObj1.length)myObj1=myObj1[args[i+1].replace(/(.*\[)|(\].*)/ig,"")];
            if(!myObj1.checked){addErr=true}
      } else if (myV.length>0&&args[i+2]==6){ // the same
            var myObj1 = MM_findObj(args[i+1]);
            if(myV!=myObj1.value){addErr=true}
      }
    } else
    if (!myObj.type&&myObj.length>0&&myObj[0].type=='radio'){
          var myTest = args[i].match(/(.*)\[(\d+)\].*/i);
          var myObj1=(myObj.length>1)?myObj[myTest[2]]:myObj;
      if (args[i+2]==1&&myObj1&&myObj1.checked&&MM_findObj(args[i+1]).value.length/1==0){addErr=true}
      if (args[i+2]==2){
        var myDot=false;
        for(var j=0;j<myObj.length;j++){myDot=myDot||myObj[j].checked}
        if(!myDot){myErr+='* ' +args[i+3]+'\n'}
      }
    } else if (myObj.type=='checkbox'){
      if(args[i+2]==1&&myObj.checked==false){addErr=true}
      if(args[i+2]==2&&myObj.checked&&MM_findObj(args[i+1]).value.length/1==0){addErr=true}
    } else if (myObj.type=='select-one'||myObj.type=='select-multiple'){
      if(args[i+2]==1&&myObj.selectedIndex/1==0){addErr=true}
    }else if (myObj.type=='textarea'){
      if(myV.length<args[i+1]){addErr=true}
    }
    if (addErr){myErr+='* '+args[i+3]+'\n'; addErr=false}
  }
  if (myErr!=''){alert('Veuillez corriger les erreurs suivantes :\t\t\t\t\t\n\n'+myErr)}
  document.MM_returnValue = (myErr=='');
}
//-->