Hello SitePoint

As a string manipulation exercise, I have written a JavaScript function to randomize the text in an <a> tag by switching the text characters around. "hurlLinkText(linkArg)" is called by the onmouseover event so that the user sees gibberish when they hover over a link.

After a few failed tries, I got it working with these lines:

Code:
function hurlLinkText(linkArg) {
	var linkText = linkArg.lastChild.nodeValue;
	var textLen = linkText.length;
	var switches = Math.round(textLen/2);

	for (var i = 0; i &lt; switches; i++) {
		var switchCharIndex = Math.floor(Math.random() * textLen) -1;	
		var switchChar = linkText.charAt(switchCharIndex);

		linkText = linkText.replace(linkText.substr(switchCharIndex,1),linkText[i]);
		linkText = linkText.replace(linkText[i],switchChar);
	}				// for (var i = 0;...

	linkArg.lastChild.nodeValue = linkText;
}				// function hurlLinkText(linkArg)
One of the important parts of this function is to switch two characters in the string. I'm doing that with these two lines:

linkText = linkText.replace(linkText.substr(switchCharIndex,1),linkText[i]);
linkText = linkText.replace(linkText[i],switchChar);

Is that a reasonable way to switch two characters in a string?

I would be grateful for any ideas or critisism of this function.

Thanks!