/********************************************/
/*			  VERIF FORMULAIRE				*/
/********************************************/

function checkMail(form) {
			
			var x = form.email.value;
									
			if (x) {
										
			var filter  = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;
			if (filter.test(x)) return true;
			else return false;
			}
			
			else return false;
										
}


function retour_vide(f, field, tr) {
									
	var e = eval("form" +"." +field +".value");
								
	if ((e == "") || (e == null) || isblank(e)) {
	
	return tr + '\n';
	}

	else return "";
									
}



function isblank(s) {

	for (var i = 0; i < s.length; i++) {
	var c = s.charAt(i);
	if ((c != ' ') && (c !='\n') && (c != '')) return false;
	}	
	return true;
}


/********************************************/
/*			 	   POPUP					*/
/********************************************/

function newWindow(mypage,myname,w,h,features) {

  if(screen.width){
  var winl = (screen.width-w)/2;
  var wint = (screen.height-h)/2;
  }else{winl = 0;wint =0;}
  if (winl < 0) winl = 0;
  if (wint < 0) wint = 0;
  var settings = 'height=' + h + ',';
  settings += 'width=' + w + ',';
  settings += 'top=' + wint + ',';
  settings += 'left=' + winl + ',';
  settings += features;
  win = window.open(mypage,myname,settings);
  win.window.focus();
  
}