function killErrors() {
	return true;
}
window.onerror=killErrors;

// Anti-spam
function emailProtect(adresse, dns, txt, classe, style){
	var name = adresse ;
	var domain = dns ;
	//var subject = "subject=Anti spam" ;
	//document.write('<a href=\"mailto:' + name + '@' + domain + ' ?' + subject + '\">') ;
	document.write('<a href=\"mailto:' + name + '@' + domain + '\"') ;
	if(classe != ""){
		document.write(' class=\"' + classe + '\"') ;
	}
	if(style != ""){
		document.write(' style=\"' + style + '\"') ;
	}
	document.write('>') ;
	if(txt != ""){
		document.write(txt + '</a>') ;
	}
	else{
		document.write(name + '@' + domain + '</a>') ;
	}
}

function EmailCheck(EmailSaisi)
{
	var str = EmailSaisi
	var reg1 = /(@.*@)|(\.\.)|(@\.)|(\.@)|(^\.)|(@\-)/; // not valid
	var reg2 = /^[a-zA-Z0-9\-\._!#\$%&\*\+=\^\{\}~]+\@(\[?)[a-zA-Z0-9\-\.]+\.([a-zA-Z]{2,3}|[0-9]{1,3})(\]?)$/;
	
	if (!reg1.test(str) && reg2.test(str))
	{
		return true;
	}
	return false;
}
function CheckForm(NomForm,langage)
{
	if (!(EmailCheck(document.forms[NomForm].email.value))) // Control du champ Email
	{
		if(langage == 'fr')
			alert ("Entrez un E-mail valide pour le destinataire.");
		else
			alert ("Please insert a valid E-mail address.");
		return false;
	}
	else
	{
		return true;
	}
}

// FAVORIS
var bookmarkurl="http://www.cevi-eciw.eu/"
var bookmarktitle="CEVI"
function AjouterFavoris(langage)
{
	if (document.all)
	{
		window.external.AddFavorite(bookmarkurl,bookmarktitle);
	}
	else
	{
		if(langage == 'fr')
			alert ("Cette action ne peut pas être automatisée sur votre navigateur,\nveuillez la réaliser manuellement.");
		else
			alert ("Sorry, your browser does not include this feature,\nplease add to favourites manually.");
	}
}
