function openDepartement(lakel){
	lakel = '../includes/aff_departement.asp?ki=' + lakel;
	self.focus();
	largeur = 540;
	hauteur	= 500;
	Limage=window.open(lakel,'bigdenon','resizable=yes,toolbar=no,directories=no,menubar=no,scrollbars=yes,width='+largeur+',height='+hauteur);
	largeur = largeur + 6 + 6;
	hauteur = hauteur + 25 + 6;
	Limage.moveTo((screen.availWidth-largeur)/2,(screen.availHeight-hauteur)/2);
	Limage.resizeTo(largeur,hauteur);
	Limage.focus();
}

function openTechno(lakel){
	self.focus();
	largeur = 340;
	hauteur	= 300;
	Limage=window.open(lakel,'bigdenon','resizable=yes,toolbar=no,directories=no,menubar=no,scrollbars=yes,width='+largeur+',height='+hauteur);
	largeur = largeur + 6 + 6;
	hauteur = hauteur + 25 + 6;
	Limage.moveTo((screen.availWidth-largeur)/2,(screen.availHeight-hauteur)/2);
	Limage.resizeTo(largeur,hauteur);
	Limage.focus();
}

function openCloseUp(lekel){
	self.focus();
	largeur = 800;
	hauteur	= 600;
	//Chemin = 'closeup'+lekel+'-big.jpg';
	Chemin = lekel;
	Code = '<html><HEAD><TITLE>DENON</TITLE></HEAD><body bgcolor="#000000" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0"><table width="100%" border="0" cellspacing="0" cellpadding="0" height="100%"><tr align="center" valign="middle"><td><img src="' + Chemin + '" OnClick="window.close()" alt="Fermer la fenêtre"></td></tr></table></body></html>';
	Limage=window.open('','bigdenon','resizable=yes,toolbar=no,directories=no,menubar=no,scrollbars=no,width='+largeur+',height='+hauteur);
	largeur = largeur + 6 + 6;
	hauteur = hauteur + 25 + 6;
	Limage.document.open('about:blank');
	Limage.document.write(Code);
	Limage.document.close();
	Limage.moveTo((screen.availWidth-largeur)/2,(screen.availHeight-hauteur)/2);
	Limage.resizeTo(largeur,hauteur);
	Limage.focus();
}

function openWindowPage(lekel, largeur, hauteur, division){
	self.focus();
	//largeur	= 800;
	//hauteur	= 600;
	Chemin = lekel;
	//Code = '<html><HEAD><TITLE>DENON</TITLE></HEAD><body bgcolor="#000000" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0"><table width="100%" border="0" cellspacing="0" cellpadding="0" height="100%"><tr align="center" valign="middle"><td><img src="' + Chemin + '" OnClick="window.close()" alt="Fermer la fenêtre"></td></tr></table></body></html>';
	Limage=window.open(Chemin,'bigdenon','resizable=yes,toolbar=no,directories=no,menubar=no,scrollbars=no,width='+largeur+',height='+hauteur);
	largeur = largeur + 6 + 6;
	hauteur = hauteur + 25 + 6;
	//Limage.document.open('about:blank');
	//Limage.document.write(Code);
	//Limage.document.close();
	Limage.moveTo((screen.availWidth-largeur)/division,(screen.availHeight-hauteur)/division);
	Limage.resizeTo(largeur,hauteur);
	Limage.focus();
}

function openWindowImage(lekel, largeur, hauteur){
	self.focus();
	//largeur	= 800;
	//hauteur	= 600;
	Chemin = lekel;
	Code = '<html><HEAD><TITLE>DENON</TITLE></HEAD><body bgcolor="#000000" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0"><table width="100%" border="0" cellspacing="0" cellpadding="0" height="100%"><tr align="center" valign="middle"><td><img src="' + Chemin + '" OnClick="window.close()" alt="Fermer la fenêtre"></td></tr></table></body></html>';
	Limage=window.open('','bigdenon','resizable=yes,toolbar=no,directories=no,menubar=no,scrollbars=no,width='+largeur+',height='+hauteur);
	largeur = largeur + 6 + 6;
	hauteur = hauteur + 25 + 6;
	Limage.document.open('about:blank');
	Limage.document.write(Code);
	Limage.document.close();
	Limage.moveTo((screen.availWidth-largeur)/2,(screen.availHeight-hauteur)/2);
	Limage.resizeTo(largeur,hauteur);
	Limage.focus();
}

function openCloseUpSwf(lekel){
	self.focus();
	largeur = 800;
	hauteur	= 600;
	Chemin = 'closeup'+lekel+'-big.htm';
	//Code = '<html><HEAD><TITLE>DENON</TITLE></HEAD><body bgcolor="#000000" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0"><table width="100%" border="0" cellspacing="0" cellpadding="0" height="100%"><tr align="center" valign="middle"><td><img src="' + Chemin + '" OnClick="window.close()" alt="Fermer la fenêtre"></td></tr></table></body></html>';
	Limage=window.open(Chemin,'bigdenon','resizable=yes,toolbar=no,directories=no,menubar=no,scrollbars=no,width='+largeur+',height='+hauteur);
	largeur = largeur + 6 + 6;
	hauteur = hauteur + 25 + 6;
	//Limage.document.open('about:blank');
	//Limage.document.write(Code);
	//Limage.document.close();
	Limage.moveTo((screen.availWidth-largeur)/2,(screen.availHeight-hauteur)/2);
	Limage.resizeTo(largeur,hauteur);
	Limage.focus();
}

//
function MM_validateForm()
{ //v4.0
var i,p,q,nm,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]);
	if (val)
	{
		nm=val.name;
		nmT='';
		switch (nm)
		{
			case 'reg_nom':
				nmT='Nom';
				break;
			case 'reg_prenom':
				nmT='Prénom';
				break;
			case 'reg_adresse':
				nmT='Adresse';
				break;
			case 'reg_cp':
				nmT='Code Postal';
				break;
			case 'reg_ville':
				nmT='Ville';
				break;
			case 'reg_telephone':
				nmT='Téléphone';
				break;
			case 'reg_email':
				nmT='E-mail';
				break;

			case 'date_achat1':
			case 'date_achat2':
			case 'date_achat3':
				nmT='Date d\'achat';
				break;
			case 'numero_serie1':
			case 'numero_serie2':
			case 'numero_serie3':
				nmT='Numéro de série';
				break;
			case 'ville_achat1':
			case 'ville_achat2':
			case 'ville_achat3':
				nmT='Ville d\'achat';
				break;


			case 'nom':
				nmT='Nom';
				break;
			case 'prenom':
				nmT='Prénom';
				break;
			case 'email':
				nmT='E-mail';
				break;
			case 'age':
				nmT='Age';
				break;
			case 'profession':
				nmT='Profession';
				break;
			case 'question':
				nmT='Question';
				break;
			case 'adresse1':
				nmT='Adresse';
				break;
			case 'cp':
				nmT='Code Postal';
				break;
			case 'ville':
				nmT='Ville';
				break;
			case 'telephone':
				nmT='Téléphone';
				break;
			case 'produit':
				nmT='Produit';
				break;
			case 'couleur':
				nmT='Couleur';
				break;
			case 'num_serie':
				nmT='Numéro de série';
				break;
			case 'magasin_achat':
				nmT='Magasin d\'achat';
				break;
			case 'ville_achat':
				nmT='Ville d\'achat';
				break;
			case 'desc_probleme':
				nmT='Description du problème';
				break;
		}
		if ((val=val.value)!="")
		{
			if (test.indexOf('isEmail')!=-1)
			{
				nmV = nm;
				if (nmT!='') nmV = nmT;
				p=val.indexOf('@');
				if (p<1 || p==(val.length-1)) errors+='• '+nmV+' doit contenir une adresse e-mail.\n';
			}
			else if (test!='R')
			{
				nmV = nm;
				if (nmT!='') nmV = nmT;
				num = parseFloat(val);
				if (isNaN(val)) errors+='- '+nmV+' doit contenir un nombre.\n';
				if (test.indexOf('inRange') != -1)
				{
					nmV = nm;
					if (nmT!='') nmV = nmT;
					p=test.indexOf(':');
					min=test.substring(8,p);
					max=test.substring(p+1);
					if (num<min || max<num) errors+='• '+nmV+' doit contenir un nombre entre '+min+' et '+max+'.\n';
				}
			}
		}
		else if (test.charAt(0) == 'R')
		{
			nmV = nm;
			if (nmT!='') nmV = nmT;
			errors += '• '+nmV+' est obligatoire.\n';
		}
	}
}
if (errors) alert('Les erreurs suivantes sont apparues :\n'+errors);
document.MM_returnValue = (errors == '');
}

function MM_callJS(jsStr) { //v2.0
  return eval(jsStr)
}

function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);

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')?'visible':(v=='hide')?'hidden':v; }
    obj.visibility=v; }
}


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_jumpMenu(targ,selObj,restore){ //v3.0
	eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
	if (restore) selObj.selectedIndex=0;
}


// Functions PopUp
function PopUp(the_url,Largeur,Hauteur)
	{
	var vjNeedToOpenNewWindow = 1;
	if(window.Limage)
		{
		if(Limage.closed)
			{
			vjNeedToOpenNewWindow = 1;
			}
		else
			{
			vjNeedToOpenNewWindow = 0;
			}
		}
	else
		{
		vjNeedToOpenNewWindow = 1;
		}

	if(vjNeedToOpenNewWindow == 0)
		{
		Limage.close();
		vjNeedToOpenNewWindow = 1;
		}
	Limage = window.open('','poppage','status=no,resizable=yes,toolbar=no,directories=no,location=no,menubar=no,scrollbars=yes,width='+Largeur+',height='+Hauteur);
	Limage.document.open("text/html");
	CoefCorrecteur = 0.5;
	Limage.moveTo((screen.availWidth-Largeur)*CoefCorrecteur,(screen.availHeight-Hauteur)*CoefCorrecteur);
	/// Redimensionne pour taille différente (ne fonctionne pas pour NS4 )
	CoefCorrecteur = 1.0;
	Limage.window.resizeTo( Largeur*CoefCorrecteur, Hauteur*CoefCorrecteur );
	Limage.focus();
	Limage.window.location.href = the_url;
	}

// rollOver sur tr
function changeCouleur(ligne, color)
	{
	ligne.bgColor = color;
	}
