function menuhide(){
  var mnh = $('#footer').height();
 
  $('#footer h2').click(function(){
    if($('#footer').hasClass('exp')){
      $('#footer').animate({'bottom': (50-mnh)},300).removeClass('exp');
      $('#footer h2 span.exp').removeClass('exp').addClass('col');
    }
    else{
      $('#footer').animate({'bottom': 0},300).addClass('exp');
      $('#footer h2 span.col').removeClass('col').addClass('exp');
     }
  });
   $('#footer').css('bottom', (50-mnh));  
}



$(document).ready(function(){
  ////Call function to enable Footer panel show/hide
  menuhide();

  ////Apply the jScrollPane as an api call so we can reinitialize it as panes become visible
  var api = $('.panes').jScrollPane({
    showArrows: true,
    verticalDragMaxHeight: 105,
    verticalDragMinHeight: 105
  }); 
  
  
  ////apply Tabs JQuery Tool to the Panes of the page, 
  ////then re-apply jScrollPane to account for pane height. 
 var tabs = $('#sidebar ul.tabs').tabs('.content_area>.panes',{
   initialIndex: 0,
   onClick: function(){
    $('.panes').jScrollPane({
      showArrows: true,
      verticalDragMaxHeight: 105,
      verticalDragMinHeight: 105
  }); 
   }
 }).data('tabs');
     
  
  
  
  
  ////If the url has a hash, attempt to load the Pane as the initial index.
  var lhash = (window.location.hash).slice(1);
  if(lhash){
    ///find the tab that has the reference from the hash
    var ini = $('li[title="'+lhash+'"]').index();
    ///Send to the referenced tab via api.click event
    tabs.click(ini);
      }
        
  
 ////For links inside the Tab Panes, this will ensure they fire the Tabs function
 ////and not try to load the HREF setting 
  $('.panes a').click(function(e){
    ///get the href of the clicked item
    var trigger = $(this).attr('href');
    ///create an api ref for JQuery Tools
    var navapi = $('#sidebar ul.tabs').data('tabs');
    ///iterate to find the matching tab for the href, then apply the click function
    $('li.navigation').each(function(n){
      if($(this).children('a').attr('href')==trigger){
        navapi.click($(this).index());
         e.preventDefault();
      }
    });
 });
  
  ////If page contains Twitter Feed container, move it to the proper table cell, then apply jScrollPane
  ////Currently this is a workaround for Umbraco not implementing the Macro Container properly for the TwitterFeed Plugin
  ////Also, this is only for the Collegiate page, and not to be used sitewide
  if($('#twfeed').length){
    $('#home table td:first').empty().append($('#twfeed'));
    $('#twfeed').show();
    $('#twfeed').jScrollPane({
      showArrows: true,
      verticalDragMinHeight: 105,
      verticalDragMaxHeight: 105,
      horizontalDragMinWidth: 105,
      horizontalDragMaxWidth: 105
    });
  }
  
  ////JQuery Tools Scrollable tool for the footer team selector
  $('#other_teams .scrollable').scrollable();

});

///the only way to get jScrollPane to set an accurate height with WebFonts
///is to bind it to the window.load event
$(window).bind('load', function(){
  $('.panes').jScrollPane({
    showArrows: true,
    verticalDragMaxHeight: 105,
    verticalDragMinHeight: 105
  }); 
});
