// this tells jquery to run the function below once the DOM is ready
jQuery(document).ready(function($) {

  $(".ourClientsAllClients").each(function() {
    
    /* Start Our Clients toggle */
    
    var allClientsDiv = this;
    
    // choose text for the show/hide link
    var showText = "See more clients";
    var hideText = "Hide more clients";
    
    // create the toggle link
    $(allClientsDiv).before("<p><a href='#' id='toggle_link'>"+showText+"</a>");
    
    // hide the content
    $(allClientsDiv).hide();
    
    // capture clicks on the newly created link
    $('a#toggle_link').click(function() {
     
      // change the link text
      if ($('a#toggle_link').text()==showText) {
        $('a#toggle_link').text(hideText);
      }
      else {
        $('a#toggle_link').text(showText);
      }
      
      // toggle the display
      $(allClientsDiv).slideToggle('slow');
      
      // return false so any link destination is not followed
      return false;
      
    });
  
  });
  /* End Our Clients toggle */
  
});
