
function usernameCharFilter(e,length)
{
	var key = window.event ? e.keyCode : e.which;
	var keychar = String.fromCharCode(key);
	// allow navi+del+backspace
	if ( key==0 || key==8) return true;
	// allow en characters end nums (starts with letter)
	if(length>0)
		reg = /([a-z]|\d)/;
	else
		reg = /[a-z]/;
	return reg.test(keychar);
}

/**
 * @validate userpforil form
 * @on success call url with ajax
 **/
function validateUserprofilForm(){
	var success=true;

/*	if (success) {
		$.ajax( {
			url: "/?module_class_name=userprofil&userprofil_action="+$("#userprofil_action").val(),
			data: $(this.elements).serialize(),
			success: function(response){
				$("#cascoelozetes_insert_response").html(response).fadeIn();$("#cascoelozetes_form").fadeOut();
			},
			dataType: "html",
			type: "POST"
		});
	}
*/

	return success;
}



