

jQuery(function(){ //do everything in the $(document).ready() event
    
    //create local references to "true" globals (attached to window object)
    var $ = window.jQuery;
    
    //"unit" globals (constrained to this closure)
    var jsVer = "?v0.043"; //increment to force browser to get new version (not from cache)
        
   //anything that needs to be done immediately happens here
   //1. Hide menus (otherwise they look silly as they appear and take a while to disappear)
   $('#site ul li ul').hide();

   //Then we begin our "lazy-loading" of all other js files, ensuring they
   //are loaded in the correct order (each file's dependencies are loaded
   //before it)
    $.ajax({
        type: "GET",
        url: "/workspace/scripts/require.js",
        data: null,
        dataType: "script",
        async: true,
        cache: true,
        success: function(){
            
            require(["/workspace/scripts/frontal.min.js"], function (){
                
                
                $frn.register("require", require);
                
                require(["/workspace/scripts/flo-player/flowplayer-3.2.4.min.js"],function(){});
                
                require(["/workspace/scripts/clock/excanvas.js"], function (){
                    if (window.G_vmlCanvasManager){ //if it was needed due to IE
                        $("canvas").each(function(){window.G_vmlCanvasManager.initElement(this)});//attach canvas functionality because for some reason it doesn't do this itself and falls over
                        $("#video-player figure a:contains(Flash):contains(is required):contains(download latest version)").live("click",function(event){location.href="http://www.adobe.com/go/getflashplayer";event.preventDefault();return false;}) //because for some reason it prevents changing page and doesn't go here itself
                    }
                    require(["/workspace/scripts/clock/coolclock.js",
                            "/workspace/scripts/flo-player/flowplayer-3.2.4.min.js",
							"/workspace/scripts/flo-player/flowplayer.ipad-3.2.1.min.js"] , function (){
                        require(["/workspace/scripts/global.js"+jsVer]);
                    });
                });

                
                

            });                  
        }
    });
    
});

