// Hover effects:
/* $("tr").mouseover(function () { $(this).children().addClass("hover"); });
$("tr").mouseout(function () { $(this).children().removeClass("hover"); });
*/
// Item expand/contract/link follow
function _bbn_set_row_behavior(row) {

}

function _bbn_toggle(parent, target) {
  target.mousedown(function () {
    if (parent.attr("toggle") != "+") {
      parent.attr("toggle", "+");
    } else {
      parent.attr("toggle", "-");
    }
    var toggle = parent.attr("toggle");
    if (toggle == "+") {
      parent.children(".content").children(".summary").show();
    } else {
      parent.children(".content").children(".summary").hide();
    }
  }); 
}

$("tr").each(function () {
  var parent = $(this);
  _bbn_toggle($(this), $(this).children(".content").children(".title"));
  _bbn_toggle($(this), $(this).children(".content").children(".summary").children(".summary-text"));
  parent.children(".content").children(".summary").children(".link").children("a").click(function () {
    parent.attr("toggle", "-");
    parent.children(".content").children(".summary").hide();
    
  });  
   
});

// Show titles of clicked links in a different color:
$(".title-link").click(function (e) {
  e.preventDefault();
  return false;
}); 

/*
function bbnRequestNewItem() {
  if (ajaxPollingEnabled) {
    bodyContent = $.ajax({
      url: "/poll.php?class=" + currentItemClass + "&id=" + currentItemId,
      dataType: "html",
      success: function(msg) {
        $("table").prepend(msg);
      }
    }).responseText;
  }
}
*/
$("#search input").focus();

// Set up AJAX polling:
// var ajaxPollingEnabled = true;
// var currentItemClass = "odd";
// window.setInterval(function (a, b) { bbnRequestNewItem(); }, 3000);

