function secure_email(str) {
	var at="@";
	var dot=".";
	var lat=str.indexOf(at);
	var lstr=str.length;
	var ldot=str.indexOf(dot);
	if (str.indexOf(at)==-1){
	   return false;
	}

	if (str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr){
	   return false;
	}

	if (str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr){
	    return false;
	}

	 if (str.indexOf(at,(lat+1))!=-1){
	    return false;
	 }

	 if (str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot){
	    return false;
	 }

	 if (str.indexOf(dot,(lat+2))==-1){
	    return false;
	 }
	
	 if (str.indexOf(" ")!=-1){
	    return false;
	 }

	 return true;				
}

function secure_tel_fr(num_tel)
{
	// Definition du motif a matcher
	var regex = new RegExp(/^(01|02|03|04|05|06|08|09)[0-9]{8}/gi);
	// Definition de la variable booleene match
	var match = false;
	// Test sur le motif
	if(regex.test(num_tel))
	{
		match = true;
	}
	else
	{
		match = false;
	}

	// On renvoie match
	return match;
} 

function secure_tel_international(num)
{
	// Definition du motif a matcher
	var regex = new RegExp("^[0-9+]+$");
	// Definition de la variable booleene match
	var match = false;
	// Test sur le motif
	if(regex.test(num))
	{
		match = true;
	}
	else
	{
		match = false;
	}

	// On renvoie match
	return match;
}

function secure_int(num)
{
	// Definition du motif a matcher
	var regex = new RegExp("^[0-9]+$");
	// Definition de la variable booleene match
	var match = false;
	// Test sur le motif
	if(regex.test(num))
	{
		match = true;
	}
	else
	{
		match = false;
	}

	// On renvoie match
	return match;
}

function secure_float(num)
{
	// Definition du motif a matcher
	var regex = new RegExp(/^[0-9]+\.{1}[0-9]/gi);
	// Definition de la variable booleene match
	var match = false;
	// Test sur le motif
	if(regex.test(num) || secure_int(num)==true)
	{
		match = true;
	}
	else
	{
		match = false;
	}

	// On renvoie match
	return match;
}
