function verifEmail(email)
{		
	var posAt = email.lastIndexOf("@");
	var posPoint = email.lastIndexOf(".");
		
	if((posAt<=0)||(posPoint<=posAt+1)||(posPoint==email.length-1))
	{
		return false;
	}

	return true;
}

function URLEncode( chaine )
{
	// The Javascript escape and unescape functions do not correspond
	// with what browsers actually do...
	var SAFECHARS = "0123456789" +					// Numeric
					"ABCDEFGHIJKLMNOPQRSTUVWXYZ" +	// Alphabetic
					"abcdefghijklmnopqrstuvwxyz" +
					"-_.!~*'()";					// RFC2396 Mark characters
	var HEX = "0123456789ABCDEF";

	var plaintext = "";

	for (var i = 0; i < chaine.length; i++ ) {
		var ch = chaine.charAt(i);
	    if (ch == " ") {
		    plaintext += "+";
		} else if (SAFECHARS.indexOf(ch) != -1) {
		    plaintext += ch;
		} else {
		    var charCode = ch.charCodeAt(0);
			if (charCode > 255) {
			    alert( "Unicode Character '" 
                        + ch 
                        + "' cannot be encoded using standard URL encoding.\n" +
				          "(URL encoding only supports 8-bit characters.)\n" +
						  "A space (+) will be substituted." );
				plaintext += "+";
			} else {
				plaintext += "%";
				plaintext += HEX.charAt((charCode >> 4) & 0xF);
				plaintext += HEX.charAt(charCode & 0xF);
			}
		}
	} // for

	return plaintext;
};

function URLDecode(chaine )
{
   // Replace + with ' '
   // Replace %xx with equivalent character
   // Put [ERROR] in output if %xx is invalid.
   var HEXCHARS = "0123456789ABCDEFabcdef"; 
   var plaintext = "";
   var i = 0;
   while (i < chaine.length) {
       var ch = chaine.charAt(i);
	   if (ch == "+") {
	       plaintext += " ";
		   i++;
	   } else if (ch == "%") {
			if (i < (chaine.length-2) 
					&& HEXCHARS.indexOf(chaine.charAt(i+1)) != -1 
					&& HEXCHARS.indexOf(chaine.charAt(i+2)) != -1 ) {
				plaintext += unescape( chaine.substr(i,3) );
				i += 3;
			} else {
				alert( 'Bad escape combination near ...' + chaine.substr(i) );
				plaintext += "%[ERROR]";
				i++;
			}
		} else {
		   plaintext += ch;
		   i++;
		}
	} // while
   return plaintext;
};