Quello che si puo' fare in cinque minuti...
codice:
<HTML>
 <HEAD>
  <TITLE> Scramble! </TITLE>
<script>
function casino(nome) {
	o = document.getElementById(nome);
	t = o.value;
	r = "";
	p = "";
	for (var i=0; i<t.length; i++)	{
		a = t.substr(i,1);
		if (! /[a-zA-Z0-9]/.test(a))		{
			r += p + a; 
			p = "";
		} else {
			p = (Math.random()>.5) ? p+a : a+p; 
		}
	}
	r += p;
	o.value = r;
}
</script>
 </HEAD>

 <BODY>
 <input type=text id="testo">
 <input type="button" value="scramble!" onclick="casino('testo')">
  
 </BODY>
</HTML>
ciao