// Mail needed javascript functions

// Verif d'une adresse email
// -------------------------
/*
function VerifEmail(adresse)
{  
  var place = adresse.indexOf("@",1);
  var point = adresse.indexOf(".",place+1);
  if ((place > -1)&&(adresse.length >2)&&(point > 1))
  {
	// Adresse email OK
	return true;	
  }
  else
  {	
  	// Adresse email non valide
	return false;
  }

}*/
function VerifEmail(adresse)
{   // found here: http://www.quirksmode.org/js/mailcheck.html
	var filter = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;
	if (filter.test(adresse)) 
	{
		// Adresse email OK
		return true;	
  	}
  	else
  	{	
  		// Adresse email non valide
		return false;
  	}
}

// Ouvrir window pour envoi mail
// -----------------------------
function openMailWindow(thisWindow, arguments)
{
	 thisWindow.open(arguments,'_blank','toolbar=0, location=0, directories=0, status=0, scrollbars=0, resizable=0, copyhistory=0, menuBar=0, width=360, height=250, left=200, top=200');
}

function emscramble(first, text, css, last){
 var a,b,c,d
 a='<a href=\"mai'
 //b='volunteers'
 b=first
 c='>'
 a+='lto:'
 b+='@'
 d='</a>'
 b+=last+"\""
 css=' '+css+' '

 document.write(a+b+css+c+text+d)
}

function emshow(first, css, last){
 var a,b,c,d
 a='<a href=\"mai'
 //b='volunteers'
 b=first
 c='>'
 a+='lto:'
 b+='@'
 d='</a>'
 b+=last+"\""
 css=' '+css+' '
 text=first+'@'+last;
 document.write(a+b+css+c+text+d)
}

