function smartBreadcrumbs() {
  if (typeof(currentBC) != 'undefined' && currentBC)
  {
    if (jQuery("div[id*=" + currentBC + "]").length == 1)
    {
      jQuery("div[id*=" + currentBC + "]").css("display","block");
      SetCookie("currentBC", jQuery("div[id*=" + currentBC + "]").get()[0].id);
    }
    else
    {
      jQuery("#breadcrumbs div:first").css("display","block");
      SetCookie("currentBC", jQuery("#breadcrumbs div:first").get()[0].id);
    }
  }
  else
  {
    jQuery("#breadcrumbs div:first").css("display","block");
    SetCookie("currentBC", jQuery("#breadcrumbs div:first").get()[0].id);
  }
}

jQuery(document).ready( function() {
  smartBreadcrumbs();
});

smartBreadcrumbs();
