var yuifiles = new Array;
var loader = new YAHOO.util.YUILoader();
yuifiles.push('connection;BR');
yuifiles.push('dom');
yuifiles.push('event');    
loader.require(yuifiles);
if( typeof yuicomponents != "undefined" )
{
    loader.require(yuicomponents);
}
loader.onSuccess = function(o)
{
     // should be onDOMReady but for some reason it is not behaving as it should be
     YAHOO.util.Event.onContentReady( "sitecontainer", function()
     {
        if(typeof onYUIReady == 'function') 
        {
            onYUIReady();
        }
        // yui-skin-sam needed in order for default ui skin component to work
        YAHOO.util.Dom.addClass( document.body, "yui-skin-sam" );                         
     });   
     YAHOO.util.Event.onContentReady( "container", function()
     {
        if(typeof onYUIReady == 'function') 
        {
            onYUIReady();
        }
        // yui-skin-sam needed in order for default ui skin component to work
        YAHOO.util.Dom.addClass( document.body, "yui-skin-sam" );                         
     });        
}
loader.onFailure = function(msg, xhrobj) 
{
    var m = "YUI load failed: " + msg; 
    alert("Failed loading yui: " + msg)    
    YAHOO.log(m);
}
loader.insert();