        $(document).ready(function(){
            $('ul#nav').NavDropDown();                   
        });
        
 $(window).load(function() {    

        var theWindow        = $(window),
            $bg              = $("#bg"),
            aspectRatio      = $bg.width() / $bg.height();

        function resizeBg() {

                if ( (theWindow.width() / theWindow.height()) < aspectRatio ) {
                    $bg
                        .removeClass()
                        .addClass('bgheight');
                } else {
                    $bg
                        .removeClass()
                        .addClass('bgwidth');
                }

        }

        theWindow.resize(function() {
                resizeBg();
        }).trigger("resize");

});   


$(window).load(function() {    

        var theWindow        = $(window),
            $bg              = $("#bg1"),
            aspectRatio      = $bg.width() / $bg.height();

        function resizeBg() {

                if ( (theWindow.width() / theWindow.height()) < aspectRatio ) {
                    $bg
                        .removeClass()
                        .addClass('bgheight1');
                } else {
                    $bg
                        .removeClass()
                        .addClass('bgwidth1');
                }

        }

        theWindow.resize(function() {
                resizeBg();
        }).trigger("resize");

}); 



    $(window).load(function() {
        $("div#makeMeScrollable").smoothDivScroll({ 
            autoScroll: "onstart" , 
            autoScrollDirection: "backandforth", 
            autoScrollStep: 1, 
            autoScrollInterval: 15,    
            startAtElementId: "startAtMe", 
            visibleHotSpots: "always"
        });
    });
    
    
    
    
    
    
    $(document).ready(function() {
            /*
            *   Examples - images
            */
            $("a#ex1").fancybox();

            $("a#ex2").fancybox({
                'overlayShow'    : false,
                'transitionIn'    : 'elastic',
                'transitionOut'    : 'elastic'
            });

            $("a#ex3").fancybox({
                'transitionIn'    : 'none',
                'transitionOut'    : 'none'    
            });

            $("a#ex4").fancybox({
                'opacity'        : true,
                'overlayShow'    : false,
                'transitionIn'    : 'elastic',
                'transitionOut'    : 'none'
            });

            $("a#ex5").fancybox();

            $("a#ex6").fancybox({
                'titlePosition'        : 'outside',
                'overlayColor'        : '#000',
                'overlayOpacity'    : 0.9
            });

            $("a#ex7").fancybox({
                'titlePosition'    : 'inside'
            });

            $("a#ex8").fancybox({
                'titlePosition'    : 'over'
            });

            $("a[rel=ex_g]").fancybox({
                'transitionIn'        : 'none',
                'transitionOut'        : 'none',
                'titlePosition'     : 'over',
                'titleFormat'        : function(title, currentArray, currentIndex, currentOpts) {
                    return '<span id="fancybox-title-over">Image ' + (currentIndex + 1) + ' / ' + currentArray.length + (title.length ? ' &nbsp; ' + title : '') + '</span>';
                }
            });
        });  
            
