/** 
  *  Really dirty here, but we are going to use jquery to give the right class
  *  to the root element in the breadcrumb trail. Also we need to add span to the a tag
  *  inner html
 **/
function formatBreadcrumbs () {
	if (jQuery("ul.breadcrumbs").length && !jQuery("ul.breadcrumbs").hasClass("no-js")) {
		var num_li = -2;
		jQuery("ul.breadcrumbs li").each(function() {
			if (!jQuery(this).hasClass("last")) {
				num_li++;
				var html = jQuery(this).find("a").html();
				jQuery(this).find("a").html("<span>" + html + "</span>");
			}
		});
	
		jQuery("ul.breadcrumbs li").find("a").each(function() {
			if (num_li > 0) {
				if (jQuery(this).hasClass("root-single")) jQuery(this).addClass("root").removeClass("root-single");
				else jQuery(this).removeClass("parent");
				num_li--;
			} 
			else return false;
		});
	} else return false;
}
