YUI(TWP.yuiConfig).use("oop", "event", function(Y){
    var compactionString = window.location.href.match("twpDebug=true") ? "c=false&m=false&" : "c=true&m=true&",
        comboBase = (TWP.base ? TWP.base : TWP.contextServer) + '/wpost/js/combo?context=wpost&' + compactionString,
        combine = comboBase.indexOf("glassdev") < 0? true : false;
        combine = window.location.href.match("twpDev=true") ? false : combine;
    var TWPConfigUpdate = {
        groups:{
            eidosHeader:{
                combine:combine,
                comboBase:comboBase,
                root:"r=/yui-base/",
                base: combine ? null : (TWP.base ? TWP.base : TWP.contextServer) + "/wpost/javascript/yui-base/",
                modules:{
                    eiodsExternalHeader:{
                        path:"eidos-modules/external-header.js",
                        requires:["node","get","jsonp","querystring","eidosMegaMenus","eidosHeaderRegistration","restoreText"]
                    },
                    eiodsExternalFooter:{
                        path:"eidos-modules/external-footer.js",
                        requires:["node","get","jsonp","querystring"]
                    },
                    eidosMegaMenus:{
                        path:"eidos-modules/menus.js",
                        requires:["node","event-mouseenter"],
                        triggers:["#main-nav-wrapper"],
                        init:function(Y,el) {
                            new Y.TWP.Eidos.Modules.MegaMenus(el);
                        }
                    },
                    eidosWeatherWidget:{
                        path:"eidos-modules/weather.js",
                        requires:["transition","io","jsonp","cookie","twpOverlay"],
                        triggers:["#weather-widget"],
                        init:function(Y,el){
                            Y.TWP.Eidos.Modules.Weather(el);
                        }
                    },
                    eidosHeaderRegistration:{
                        path:"eidos-modules/header-registration.js",
                        requires:["twpUser"],
                        triggers:["ul#utility-links"],
                        init:function(Y,el){
                            new Y.TWP.Eidos.Modules.HeaderRegistration(el);
                        }
                    },
                    restoreText:{
                        path:"eidos-modules/restore-text.js",
                        requires:["node"],
                        triggers:[".restore.text"],
                        init:function(Y,el){
                            new Y.TWP.Eidos.Modules.RestoreText(el);
                        }
                    }
                }
            },
            twpAds:{
                combine:true,
                comboBase:(TWP.base ? TWP.base : TWP.contextServer)+ '/wpost/js/combo?context=wp-static&c=true&m=false&',
                root:"r=/",
                modules:{
                    twpAdMain:{
                        path:"ad/wp_ad.js",
                        requires:["twpGenericAdConfig"]
                    },
                    twpGenericAdConfig:{
                        path:"ad/wpni_generic_ad.js"
                    },
                    twpTiffanyManager:{
                        path:"ad/tiffany_manager.js"
                    },
                    twpTileFlights:{
                        path:"ad/tile_flights.js",
                        requires:["twpTiffanyManager"]
                    }
                }
            },
            global:{
                combine:combine,
                comboBase:comboBase,
                root:"r=/yui-base/",
                base: combine ? null : (TWP.base ? TWP.base : TWP.contextServer) + "/wpost/javascript/yui-base/",
                modules:{
                    twpOverlay:{
                        path:"utils/overlay.js",
                        requires:["node","oop","anim","event","event-custom"]
                    },
                    twpUser:{
                        path:"utils/twp-user.js",
                        requires:["cookie"]
                    }
                }
            }
        }
    };

    Y.aggregate(TWP.yuiConfig, TWPConfigUpdate);
    Y.on("contentready",function(){
        YUI(TWP.yuiConfig).use("eiodsExternalHeader",function(Y){
            new Y.TWP.Eidos.Modules.ExternalHeader(Y.one("#header-v3-external, #header-v3.external"));
        })
    },"#header-v3-external, #header-v3.external");
    Y.on("contentready",function(){
        YUI(TWP.yuiConfig).use("eiodsExternalFooter",function(Y){
            new Y.TWP.Eidos.Modules.ExternalFooter(Y.one("#footer-v3-external, #footer-v3.external"));
        })
    },"#footer-v3-external, #footer-v3.external");
});
