$(document).ready(function() {
	$("#footer").stickyFooter();
	
	$("ul.overviewList li").each(function() {
		$(this).height($(this).height());
	});
	
	$('#navigation > ul').accordion({
		autoheight: false,
		active: false,
		alwaysOpen: false,
		header: '.depth0 > a'
	});
	
	//$("#contactForm").validate();
	
	$("a[href$='.pdf']").addClass("pdf");
	
	$("#navigation .subCurrent > a").click(function() {
		return false;
	});
	
	Shadowbox.init();
	
	$('#s6') 
	.after('<ul id="nav">') 
	.cycle({ 
		fx:     'fade', 
		speed:  'fast', 
		timeout: 5000
		/*  UNCOMMENT LINES BELOW TO RESTORE SLIDESHOW NAVIGATION
		pager:  '#nav',
		// callback fn that creates a thumbnail to use as pager anchor 
   	 	pagerAnchorBuilder: function(idx, slide) { 
   	 	myIdx = idx + 1;
        return '<li><a href="#">' + myIdx + '</a></li>';
        }*/
	});
	
	$('.striped tr:odd').addClass('oddRow');
	
	
});

// sticky footer plugin
(function($){
  var footer;
 
  $.fn.extend({
    stickyFooter: function(options) {
      footer = this;
     
      positionFooter();

      $(window)
        .scroll(positionFooter)
        .resize(positionFooter);

      function positionFooter() {
        var docHeight = $(document.body).height() - $("#sticky-footer-push").height();
        if(docHeight < $(window).height()){
          var diff = $(window).height() - docHeight;
          if (!$("#sticky-footer-push").length > 0) {
            $(footer).before('<div id="sticky-footer-push" class="span-24 last"></div>');
          }
          $("#sticky-footer-push").height(diff);
        }
      }
    }
  });
})(jQuery);