function controllaCaratteri()  {
	var num = $('#testo').val().length;
	$('#numcaratteri').html(num);
}

function controllaRichiesta()  {
	var testo = $.trim($('#testo').val());
	$('#testo').val(testo);
	var num = testo.length;
	$('#numcaratteri').html(num);
	if(num >= 20)
	  return true;
	else {
	  Ext.MessageBox.alert('Errore','Devi inserire almeno 20 caratteri.');
	  return false;
	}
}

function stripslashes( str ) {
    // +   original by: Kevin van Zonneveld (http://kevin.vanzonneveld.net)
    // +   improved by: Ates Goral (http://magnetiq.com)
    // +      fixed by: Mick@el
    // +   improved by: marrtins
    // +   bugfixed by: Onno Marsman
    // +   improved by: rezna
    // +   input by: Rick Waldron
    // +   reimplemented by: Brett Zamir (http://brett-zamir.me)
    // *     example 1: stripslashes('Kevin\'s code');
    // *     returns 1: "Kevin's code"
    // *     example 2: stripslashes('Kevin\\\'s code');
    // *     returns 2: "Kevin\'s code"
    return (str+'').replace(/\\(.?)/g, function (s, n1) {
        switch(n1) {
            case '\\':
                return '\\';
            case '0':
                return '\0';
            case '':
                return '';
            default:
                return n1;
        }
    });
}