/**
 * Function to hide the li elements with a hiddenopp class, and if needed
 * add a link to show the same elements.
 */
function handleHiddenOpps() {
  var hiddenOpps = $('li.hiddenopp');

  if (hiddenOpps.length > 0) {
    // hide the hiddenopp list elements
    hiddenOpps.hide();
    var allOpps = $('#opps li');

    // add a link to show all the hiddenopp list elements
    var opps = $('#opps');
    opps.append('<div id="showallopps"><p><a href="#">Show All ' + allOpps.length + ' Opportunities</a></p></div>');

    // add a click handler to show the hiddenopps
    $('#showallopps').click(function() {
      $(this).remove();
      hiddenOpps.show();
      return false;
    });
  }
}

