$(document).ready(function(){

  $("div.lightbox:has(img)").each(function(){
    $(this).find("a").lightBox();
    if($(this).find("a").length>5){
      $(this).find("div:gt(0)").hide();
      $(this)
        .prepend("<button onclick='showMore(this);' class='show-more'>Show More &raquo;</button>")
        .append("<button onclick='showLess(this);' class='show-less'>&laquo; Show Less</button>");
      assignEvents();
      $(this).find("button.show-less").trigger("click");
    }
  });
  
});

function showLess(node) {
  $(node).parent().find("div:gt(0)").hide("fast");
  $(node).parent().find("div:eq(0) img:eq(4)").parent().hide();
  $(node).hide();
  $(node).parent().find("button.show-more").show();
}

function showMore(node) {
  $(node).parent().find("div").show("fast");
  $(node).parent().find("img:eq(4)").parent().show();
  $(node).hide();
  $(node).parent().find("button.show-less").show();
}