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:{
                    eidosMegaMenus:{
                        path:"eidos-modules/menus.js",
                        requires:["node","event-mouseenter"],
                        triggers:["#main-nav-wrapper", ".mega-menu"],
                        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);
                        }
                    }
                }
            },
            eidosModules:{
                combine:combine,
                comboBase:comboBase,
                root:"r=/yui-base/",
                base: combine ? null : (TWP.base ? TWP.base : TWP.contextServer) + "/wpost/javascript/yui-base/",
                modules:{
                    eidosFlipper:{
                        path:"eidos-modules/flipper.js",
                        requires:["event-custom","twpOverlay","transition"],
                        triggers:[".flipper-wrap"],
                        init:function(Y,el){
                            new Y.TWP.Eidos.Modules.Flipper(el);
                        }
                    }
                }
            },
            global:{
                combine:combine,
                comboBase:comboBase,
                root:"r=/yui-base/",
                base: combine ? null : (TWP.base ? TWP.base : TWP.contextServer) + "/wpost/javascript/yui-base/",
                modules:{
                    toast:{
                        disabled:true,
                        path:"toast/toast.js",
                        requires:["node","event","oop","json","cookie", "io-base","anim","dd-drag", "event-mouseenter", "jsonp"],
                        triggers:['body']
                    },
                    twpOverlay:{
                        path:"utils/overlay.js",
                        requires:["overlay","node","oop","transition","gallery-overlay-extras"]
                    },
                    twpOverlayHelper:{
                        path:"utils/overlay-helper.js",
                        requires:["twpOverlay","querystring","io","json","oop"],
                        triggers:[".ajax-overlay",".iframe-overlay",".clone-overlay"],
                        init:function(Y,el){
                            new Y.TWP.OverlayHelper(el);
                        }
                    },
                    ajaxUpdate:{
                        path:"utils/ajax-update.js",
                        requires:["io","node"],
                        triggers:[".ajax-update"],
                        init:function(Y,el){
                            el.on("click",function(e){
                                e.preventDefault();
                                Y.TWP.Util.ajaxUpdate(Y.one(el.get("rel")),el.get("href"));
                            });
                        }
                    },
                    shareBox:{
                        path:"share-box/share-box.js",
                        requires:["substitute","transition","twpOverlayHelper","event-mouseenter"],
                        triggers:["a.share-box"],
                        init:function(Y,el){
                            new Y.TWP.Social.ShareBox(el);
                        }
                    },
                    swfobject:{
                        path:"utils/swfobject-2.2.js"
                    }
                }
            }
        }
    };

    Y.aggregate(TWP.yuiConfig, TWPConfigUpdate);
    $(document).ready(function() {
        TWP.appInit(document,[
            TWP.yuiConfig.groups.global,
            TWP.yuiConfig.groups.eidosModules
        ]);
    });
    Y.on("contentready",function(){
        TWP.appInit(document,[
            TWP.yuiConfig.groups.eidosHeader
        ]);
    },"#header-v3");
});
