$j(function()
{
	// Get all text nodes of an element.
	$j.fn.textNodes = function() {
	    var ret = [];

	    (function(el){
	        if (el.nodeType === 3)
	            ret.push(el);
	        else
	            for (var i=0; i < el.childNodes.length; ++i)
	                arguments.callee(el.childNodes[i]);
	    })(this[0]);
	    return $j(ret);
	}
	
	// Remove all none alphanumeric characaters out of the breadcrumbs.
	$j('.mod-breadcrumbs').each(function()
	{
		$j(this).textNodes().each(function(i, text)
		{
			// Trim the text.
			text.nodeValue = $j.trim(text.nodeValue);
			
			// If the first character is an > sign, a separator was present.
			var hasSeparator = text.nodeValue.charAt(0) === '>';
			
			// Remove all not word characters.
			text.nodeValue = text.nodeValue.replace(/[^a-zA-Z0-9]*\-[^a-zA-Z0-9]*/g, '');
			
			// If there was a separator present, place it back.
			if (hasSeparator)
			{
				text.nodeValue = ' > ' + text.nodeValue.substring(1);
			}
		});
	});
});
