<!--

function printOpen(){
window.open('','printOpened','top=10,left=10,height=600,width=800,toolbar=1,statusbar=1,menubar=1, scrollbars=1, resizable=1');
}

function getElementLeft(szElementName) {
	var iRetVal = 0;

	if ( navigator.appName == "Netscape" ) {
		iRetVal = document.images[szElementName].x;
	}
	else {
		iRetVal = document.all[szElementName].offsetLeft;
		objHTMLelement = document.all[szElementName].offsetParent;
  		while (objHTMLelement != null) {
  			iRetVal += objHTMLelement.offsetLeft;
  			objHTMLelement = objHTMLelement.offsetParent;
  		}
	}
	
	return iRetVal;
}

function getElementTop(szElementName) {
	var iRetVal = 0;

	if ( navigator.appName == "Netscape" ) {
		iRetVal = document.images[szElementName].y;
	}
	else {
		iRetVal = document.all[szElementName].offsetTop;
		objHTMLelement = document.all[szElementName].offsetParent;
		while (objHTMLelement != null) {
  			iRetVal += objHTMLelement.offsetTop;
  			objHTMLelement = objHTMLelement.offsetParent;
  		}
	}
	
	return iRetVal;
}

function Popup(URL) { 
		newwindow = window.open(URL, 'Oubli_Mot_de_Passe', 'height=250, width=300, left=100, top=100, resizable=yes, scrollbars=yes, toolbar=no, status=yes');
		if (window.focus) {newwindow.focus()}
	}

function RealPopupPic(titre,sPicURL) {
 				var cmptitre='';
				if(titre!='') {
					cmptitre = "&titre="+titre;
				}
				window.open("/Library/realpopup.php?img="+sPicURL+cmptitre, "", "resizable=1,LEFT=200,TOP=100,HEIGHT=150,WIDTH=200");
			}


function MM_findObj(n, d) { //v4.0
  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 && document.getElementById) x=document.getElementById(n); return x;
}

function echeck(str) {
		var at="@";
		var dot=".";
		var lat=str.indexOf(at);
		var lstr=str.length;
		var ldot=str.indexOf(dot);
		if (str.indexOf(at)==-1){
		   return false
		}

		if (str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr){
		   return false
		}

		if (str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr){
		    return false
		}

		 if (str.indexOf(at,(lat+1))!=-1){
		    return false
		 }

		 if (str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot){
		    return false
		 }

		 if (str.indexOf(dot,(lat+2))==-1){
		    return false
		 }
		
		 if (str.indexOf(" ")!=-1){
		    return false
		 }

 		 return true					
	}




function checkDate(myDayStr,myMonthStr,myYearStr) {
months=new Array;
months['01']='Jan';
months['02']='Feb';
months['03']='Mar';
months['04']='Apr';
months['05']='May';
months['06']='Jun';
months['07']='Jul';
months['08']='Aug';
months['09']='Sep';
months['10']='Oct';
months['11']='Nov';
months['12']='Dec';
if(months[myMonthStr]) {
//if(myDayStr.charAt('0')==0) myDayStr=myDayStr.substring(1);
var myDateStr = myDayStr + ' ' + months[myMonthStr] + ' ' + myYearStr + ' ' +'12:00:00';
/* Using form values, create a new date object
which looks like "Wed Jan 1 00:00:00 EST 1975". */
var myDate = new Date( myDateStr );
// Convert the date to a string so we can parse it.
var myDate_string = myDate.toGMTString();

/* Split the string at every space and put the values into an array so,
using the previous example, the first element in the array is "Wed", the
second element is "Jan", the third element is "1", etc. */
var myDate_array = myDate_string.split( ' ' );

/* If we entered "Feb 31, 1975" in the form, the "new Date()" function
converts the value to "Mar 3, 1975". Therefore, we compare the month
in the array with the month we entered into the form. If they match,
then the date is valid, otherwise, the date is NOT valid. */
if ( myDate_array[2] != months[myMonthStr] ) {
  return false;
} else {
  return true;
}
}
else return false;
}
function MM_validateForm() { //v5.0
  var i,p,q,nm,pswd,test,num,min,max,errors='',args=MM_validateForm.arguments;
  for (i=0; i<(args.length-2); i+=3) { 
  	test=args[i+2]; 
	val=MM_findObj(args[i]); 
	val2=MM_findObj(args[i+1]);
    if (val) { 
		nm=val.name; 
		val=val.value;
		if (val!="") {
			if (test.indexOf('isEmail')!=-1) { 
				if (!echeck(val)) errors+='- Le champ '+nm+' doit contenir une adresse e-mail correcte.\n';
    		} 
			else if (test.indexOf('same') != -1 && val2) {
				if (val2.value=="") errors += '- Le champ '+val2.name+' est obligatoire.\n'; 
				else if (val2.value!=val) errors += '- Les champs '+nm+' et '+val2.name+' doivent être identiques.\n'; 
			}
			else if (test.indexOf('dateF') != -1){
				 myarraydate=val.split("/");
				 thisDate=new Date();

				 if(myarraydate.length!=3 || isNaN(myarraydate[0]) || isNaN(myarraydate[1]) || isNaN(myarraydate[2]) || myarraydate[2].length!=4 || !checkDate(myarraydate[0],myarraydate[1],myarraydate[2])) errors += '- Le champ '+nm+' doit contenir une date valide au format JJ/MM/AAAA.\n'; 
			}
			else if (test.indexOf('dateE') != -1){
				 myarraydate=val.split("/");
				 thisDate=new Date();
				 if(myarraydate.length!=3 || isNaN(myarraydate[0]) || isNaN(myarraydate[1]) || isNaN(myarraydate[2]) || myarraydate[0].length!=4 || !checkDate(myarraydate[2],myarraydate[1],myarraydate[0])) errors += '- Le champ '+nm+' doit contenir une date valide au format AAAA/MM/JJ.\n'; 
			}
			else if (test!='R') {
        		if (isNaN(val)) errors+='- Le champ '+nm+' doit contenir un nombre.\n';
        		if (test.indexOf('inRange') != -1) { 
					p=test.indexOf(':');
          			min=test.substring(8,p);
					max=test.substring(p+1);
          			if (val<min || max<val) errors+='- Le champ '+nm+' doit être un nombre entre '+min+' et '+max+'.\n';
    			}
			}
			
			if(test.indexOf('mini') != -1 ){
				if(val.length<test.substring(test.indexOf('mini')+4)) errors+='- Le champ '+nm+' doit contenir au moins '+test.substring(test.indexOf('mini')+4)+' caractères.\n';
			}
			/*if (pswd != "" && val==pswd) {
				errors+='Le champ '+nm+' est invalide.\n'
			} */
		}
		else if (val2 && test.charAt(0) == 'R' && test.indexOf('same') != -1) {
			if(val=="" && val2.value=="") errors += '- Les champs '+nm+' et '+val2.name+' sont obligatoires.\n'; 
			else if (val=="") errors += '- Le champ '+nm+' est obligatoire.\n'; 
			if(!(val=="" && val2.value=="")&&test.indexOf('mini') != -1 ){
				if(val2.value.length<test.substring(test.indexOf('mini')+4)) errors+='- Le champ '+val2.name+' doit contenir au moins '+test.substring(test.indexOf('mini')+4)+' caractères.\n';
			}
		}
		else if (val2&&val2.value=="" && test.charAt(0) == 'R') errors += '- L\'un des champs '+nm+' et '+val2.name+' est obligatoire.\n'; 
		else if (!val2 && test.charAt(0) == 'R') errors += '- Le champ '+nm+' est obligatoire.\n'; 
		
	}
  } 
  if (errors) alert('Les erreurs suivantes sont apparues :\n\n'+errors);
  document.MM_returnValue = (errors == '');
}

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_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_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 PopupCentrer(page,largeur,hauteur,options) {
  var top=(screen.height-hauteur)/2;
  var left=(screen.width-largeur)/2;
  window.open(page,"","top="+top+",left="+left+",width="+largeur+",height="+hauteur+","+options);
}

function PopupPage(page,largeur,hauteur,top,left,options) {
  window.open(page,"","top="+top+",left="+left+",width="+largeur+",height="+hauteur+","+options);
}

-->
