function openWin(url,l,h,scroll) {
	newwin=window.open(url,'popup','scrollbars='+scroll+',menubar=no,status=no,resizable=yes,location=no,toolbar=no,width='+l+',height='+h);
}

function confirmDel(url) {
	if (confirm("Etes-vous certain de vouloir effacer ?") ) {
		eval(url) ;
	}
}

//----------------------------------------------------------------------------
  function fieldExist(numform,fieldname) {
	    for (j=0 ; j<document.forms[numform].elements.length ; j++){
		  if (document.forms[numform].elements[j].name==fieldname){
		   return true;
		  }
		}
	    return false
	  }
//----------------------------------------------------------------------------
	  function checkForm(numform,strfields) {
		if (!checkEmptyFields(numform,strfields)) return false;

    /*if (document.forms[numform].cp.value.length<5) {
			eval ("document.forms["+numform+"].cp.focus()");
			eval ("document.forms["+numform+"].cp.style.background='#F18E00'");
			alert ("Veuillez verifier votre code postal");

			return false;
		}*/
	  /*	if (document.forms[numform].tel.value.length<10) {
			eval ("document.forms["+numform+"].tel.focus()");
			eval ("document.forms["+numform+"].tel.style.background='#F18E00'");
			alert ("Veuillez verifier votre numéro de téléphone");
			return false;
		}*/

		if (!testMail(document.forms[numform].email.value)) {
			eval ("document.forms["+numform+"].email.focus()");
			eval ("document.forms["+numform+"].email.style.background='#F18E00'");
			alert("Merci de verifier votre adresse email !");
			return false;
		}
		else eval ("document.forms["+numform+"].email.style.background='#ffffff'");


		return true;
	  }
//----------------------------------------------------------------------------
	function checkEmptyFields(numform,strfields) {
	  tabfields = strfields.split(";");
		for (i=0 ; i<tabfields.length ; i++) {
		  if (fieldExist(numform,tabfields[i])) {
		    if (eval ("document.forms["+numform+"]." + tabfields[i] + ".value") =="") {
          eval ("document.forms["+numform+"]." + tabfields[i] + ".focus()");
          eval ("document.forms["+numform+"]." + tabfields[i] + ".style.background='#FF9900'");
          alert("Ce champ est obligatoire !");
          return false;
		    }
			else
				  eval ("document.forms["+numform+"]." + tabfields[i] + ".style.background='#ffffff'");

		  }
		}
		return true;
	}
//----------------------------------------------------------------------------
	function testMail(lemail) {
		return ( (lemail.lastIndexOf("@")>-1) && (lemail.lastIndexOf(".") > lemail.lastIndexOf("@")) && (lemail.lastIndexOf(".")+2<lemail.length) );
	}
//----------------------------------------------------------------------------
	function testNum(lenum,n) {
		var lenum ="" + lenum;
		ncourant=0;
		for(var k = 0; k < lenum.length;k++) {
			if((lenum.substring(k,k+1)>="0") && (lenum.substring(k,k+1)<="9")) ncourant=ncourant+1;
		}
		return (n==ncourant);
	}


function showImg(img) {
  document.imgzoom.src = img;
}

