function processBreadcrumb() {
  jQuery(".page-breadcrumb").each(function() {
    var b = jQuery(this);
    var contentWidth = function() {
      var w = 0;
      b.children().each(function() {
        w = w + jQuery(this).width();
      });
      return w;
    };
    if (b.width() < contentWidth()) {
      var hiddenList = jQuery("<ul></ul>");
      var ellipsis = jQuery("<li class='ellipsis'><span>...</span></li>");
      ellipsis.append(hiddenList);
      b.children().first().after(ellipsis);
      while (b.width() < contentWidth()) {
        var e = b.children().first().next().next();
        hiddenList.append(e.clone());
        e.remove();
      }
    }
  });
}

function processHelpAction() {
  jQuery("#helpActions").live("click", function (event) {
    if (jQuery("#subcontent").hasClass("contentHelp")) {
      jQuery("#helpWrapper").animate({
        left: '940px'
      }, 500);
      jQuery("#subcontent").removeClass("contentHelp");
    } else {
      jQuery("#helpWrapper").animate({
        left: "544px"
      }, 500);
      jQuery("#subcontent").addClass("contentHelp");
    }
  });
}


function drawRate(item) {
  var MV = jQuery.makeArray(item.children().filter(".metadata"));
  var tMV = {};
  jQuery.each(MV, function() {
    var t = jQuery(this).text().split("=");
    tMV[t[0]] = t[1];
  });
  MV = tMV;
  item.children().removeClass('star-rating-hover');
  item.children().filter('.star-rating').slice(0, MV['rating']).addClass('star-rating-on');
}

function printWindow() {
  window.print();
}
