$(document).ready(function() {


   $('#slider').nivoSlider({
         effect:'sliceDownRight',
         slices:10,
         animSpeed:1000,
         pauseTime:4000,
         startSlide:0,
         directionNav:false, //Next & Prev
         directionNavHide:true, //Only show on hover
         controlNav:false, //1,2,3...
         controlNavThumbs:false, //Use thumbnails for Control Nav
         controlNavThumbsFromRel:false, //Use image rel for thumbs
         controlNavThumbsSearch: '.jpg', //Replace this with...
         controlNavThumbsReplace: '_thumb.jpg', //...this in thumb Image src
         keyboardNav:false, //Use left & right arrows
         pauseOnHover:false, //Stop animation while hovering
         manualAdvance:false, //Force manual transitions
         captionOpacity:0.5, //Universal caption opacity
         beforeChange: function(){},
         afterChange: function(){},
         slideshowEnd: function(){} //Triggers after all slides have been shown
      });
   
   
   
   // make bodyRightSidebar and bodyContentOuter same height
   tallest1 = $('#bodyLeftSidebar').height();
   tallest2 = $('#bodyContent').height();
   if(tallest1 > tallest2){tallest2 = tallest1};
   jQuery('#bodyInnerWrap>div').css({'height': tallest2});
   
      
      
   // make oneThirdDiv boxes same height
   var $tallest = 0;
   $('.oneThirdDiv').each( function(i) {
      if($(this).height() > $tallest)
         $tallest = $(this).height();
   });
   $('.oneThirdDiv').each( function(i) {
      $(this).height($tallest);
   });
   
   
   
   
   // homepage slideshow
   var currentChild = 0;
   var prevChild = 0;
   var numChildren = 0;
   
   function imageFade(){
       
       prevChild = currentChild;
       if(currentChild == numChildren){
           currentChild = 1;
       }else{
           currentChild++;
       }
       
       jQuery("#homepageSlideshow").children(':nth-child(' + currentChild + ')').fadeIn(1200);
       jQuery("#homepageSlideshow").children(':nth-child(' + prevChild + ')').fadeOut(1200);
   }
   
   jQuery(document).ready(function(){
       setInterval(imageFade,3500);
       numChildren = jQuery("#homepageSlideshow").children().length;
       imageFade();
   }); 


});

