/**
* **************************************************************
* FILE : script/tools.0.0.1.0.js
* @version : 2005-02-12
* home page of this script : http://www.nathan.meurrens.org
* @author : Nathan Meurrens < nathan (at) meurrens (dot) org > http://www.nathan.meurrens.org/
* **************************************************************
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA,
* or go to http://www.gnu.org/copyleft/gpl.html
* **************************************************************
* By the way this has nothing to do with legacy but you've got my email adress
* so know that when you're using my work it's often nice for me to get some feedback ;-)
* **************************************************************
**/

function isAdressOk(szMailAdress)
{
	val = szMailAdress ;
	mok = ( (0 == val.length) || (/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*\.((\w{2,2})|(com|net|org|edu|int|mil|gov|arpa|biz|aero|name|coop|info|pro|museum))+$/.test(val)) );
	if(! mok) { alert('Votre adresse E-mail est incorrecte!') ; }
	return mok ;
}

function isMailFormOk(arrForm)
{
	ok = isAdressOk(arrForm.szMailAdress.value) ;
	if(ok)
	{
		ok = arrForm.txMessage.value.length >= 3 ;
		if(! ok) { alert("Introduisez votre message avant de cliquer sur envoi!") ; }
		else
		{
			arrForm.scW.value = screen.width ;
			arrForm.scH.value = screen.height ;
			arrForm.scC.value = screen.colorDepth ;
		}
	}
	return ok ;
}

/** EOF: tools.0.0.1.0.js**/
