    
    
    jQuery.fn.fadeToggle = function(on_off_toggle, speed, easing, callback) {
        return this.animate({opacity: on_off_toggle}, speed, easing, callback);
    }; 
    
    
    function clear_backgrounds()
    {
    
        $('#home-controls #video').css('background-image', 'url(/image/videotab.gif)');
        $('#home-controls #summary').css('background-image', 'url(/image/summarytab.gif)');
        $('#home-controls #gallery').css('background-image', 'url(/image/gallerytab.gif)');
    
    }
    
    function toggle_divs(div)
    {
        
        $('#home-container #home-video').css('display', 'none')
        $('#home-container #home-gallery').css('display', 'none')
        $('#home-container #home-summary').css('display', 'none')
        
        var showthis = '#'+div
        $(showthis).css('display', 'block');
    
    }
    
    function load_content(div)
    {
        
        clear_content()
        
        $('#'+div).css("display", "block").css("color", "#ffffff");
        
        if (div == 'home-gallery')
        {
            
            $('#home-container').css('background-image', 'url(/image/homefancyback.gif)');
            
            $('#home-gallery').css('margin-top', '25px').css('margin-left', '35px').css('color', '#ffffff');
            
            var mygallery=new simpleGallery({
                wrapperid: "home-gallery", //ID of main gallery container,
                dimensions: [475, 267], //width/height of gallery in pixels. Should reflect dimensions of the images exactly
                imagearray: [
                    ["/image/gallery/gallery1.jpg", "", "", "The newly constructed Building 2.0 by night"],
                    ["/image/gallery/gallery2.jpg", "", "", "Ponds Forge"],
                    ["/image/gallery/gallery3.jpg", "", "", "Building 2.0 – typical floorspace"],
                    ["/image/gallery/gallery4.jpg", "", "", "The newly constructed Building 2.0 by day"],
                    ["/image/gallery/gallery5.jpg", "", "", "Building 2.0"],
                    ["/image/gallery/gallery6.jpg", "", "", "Building 2.0 atrium"],
                    ["/image/gallery/gallery8.jpg", "", "", "Building 2.0 atrium"],
                    ["/image/gallery/gallery9.jpg", "", "", "Building 1 and Building 2.0"]
                ],
                autoplay: [true, 2000, 2], //[auto_play_boolean, delay_btw_slide_millisec, cycles_before_stopping_int]
                persist: false, //remember last viewed slide and recall within same session?
                fadeduration: 750, //transition duration (milliseconds)
                oninit:function(){ //event that fires when gallery has initialized/ ready to run
                    //Keyword "this": references current gallery instance (ie: try this.navigate("play/pause"))
                },
                onslide:function(curslide, i){ //event that fires after each slide is shown
                    //Keyword "this": references current gallery instance
                    //curslide: returns DOM reference to current slide's DIV (ie: try alert(curslide.innerHTML)
                    //i: integer reflecting current image within collection being shown (0=1st image, 1=2nd etc)
                }
            })
        
        }
        
        if (div == 'home-video')
        {
            $('#home-container').css('background-image', 'url(/image/homefancyback2.gif)');
            
            var vid = new SWFObject("/video_player.swf", "video", "476", "276", "9", "#000000");
            vid.addParam("allowFullScreen", "true");
            vid.addParam("base", base_url);
            vid.addParam("wmode", "transparent");
            vid.addVariable("playnow", "1");
            vid.addVariable("playercolor", "0x404040");
            vid.addVariable("file", "flash/sdc_vid.flv");
            vid.write("home-video");
            
        }
        
        if (div == 'home-summary')
        {
            $('#home-container').css('background-image', 'url(/image/homefancyback.gif)');
            
            var homesum = new SWFObject("/flash/home_flash.swf", "", "547", "263", "8", "#000000");
            homesum.addParam('wmode', 'transparent');
            homesum.write("home-summary");
        
        }
    
    }
    
    function clear_content()
    {
    
        $('#home-container #home-video').html('').css('display', 'none');
        $('#home-container #home-gallery').html('').css('display', 'none');
        $('#home-container #home-summary').html('').css('display', 'none');
    
    }
    
    
