$(document).ready(function(){
    $('table td.hours').append("<div style='padding-bottom:5px;'>Winter Hours</div><div style='padding-bottom:5px;'>Monday-Friday<br>8:00am-5:00pm</div>Saturday, Sunday<br>9:00am-4:00pm");

    var sidebar, rightSide;
    sidebar = $('#sidebar');
    rightSide = $('#right');
    if(sidebar.height() < rightSide.outerHeight(true)) sidebar.css({'height' : rightSide.outerHeight(true)});
    if($('body').attr('id')=='index') $('#sidebar #pilot').css({'display':'none'});

    //GALLERY//
    $('.gallery_wrap').hide();
    new gallery();
});

(function(){
    var _g;
    gallery = function(){
        _g = document.getElementById('gallery');
        for(i = 1; i < _g.children.length; ++i){
            _g.children[i].style.display = 'none';
        }
        gallery.prototype.initRotation();
    }
    gallery.prototype = {
        current: 0,
        delay: 3000,
        initRotation: function(){
            setInterval(function(){
                $(_g).find('img').eq(gallery.prototype.current).fadeOut();
                if(gallery.prototype.current == (_g.children.length - 1)){
                    $(_g).find('img').eq(0).fadeIn();
                    gallery.prototype.current = 0;
                } else {
                    $(_g).find('img').eq(gallery.prototype.current + 1).fadeIn();
                    ++gallery.prototype.current;
                }
            },gallery.prototype.delay);
        }
    }
})();
function trace(msg){if(window.console){console.log(msg);}}
