

    function initMediaArchive(){
      $(".all_mediaContainer").hide(); 
      // show only the first 12
      arrayLength = $(".all_mediaContainer").length;
      max = 12;
      count = 0;
      controlCount = 1;
      numberOfControls = 1;
      while (count < max )  {
        $(".all_mediaContainer").eq(count).show(); 
        count++;
      }
      toggleControls(0);
    }
    
    function showMediaArchive(increment){
      arrayLength = $(".all_mediaContainer").length;
      count = 0;
      max = 12;
      showIndex = increment * max;
      
      //alert("showIndex: " + showIndex);
      
      //hide all
      $(".all_mediaContainer").hide(); 
        
      while (count < max )  {
        $(".all_mediaContainer").eq(showIndex).show(); 
        count++;
        showIndex++;
      }
      toggleControls(increment);
    }

    function inTheMedia_remove() {
      $("#TB_overlay").hide(); 
      $("#all_media_main_div").hide(); 
    }

    function inTheMedia_show() {
      $("#TB_overlay").show(); 
      $("#all_media_main_div").show(); 
    }
    
    function toggleControls(increment) {
      $(".controller").removeClass("active"); 
      $(".controller").eq(increment).addClass("active");
    }
    
$(document).ready(function(){
    initMediaArchive();    
});


