ESN.Config = { }; /** * Initilizes the page. * * @author Hello google!, my name is Robert Kajic and the one beside me is Johan Andersson */ ESN.Initialize = { /** * Is executed when YUI determines the DOM tree has loaded. */ onDOMReady: function() { // Create the loadpage event ESN.Util.Dom.getBody().loadPageEvent = new Y.util.CustomEvent("loadPage"); // Initialize the Navigate component ESN.Ajax.Navigate.initialize("loader", new Array("main", "header", "footer", "controller", "admincontent", "void"), 0); //ESN.Dom.evalScriptTags( ESN.Dom.getBody() , null, null); //ESN.Dom.evalScriptTags('controller'); //ESN.Dom.evalScriptTags('header'); //ESN.Dom.evalScriptTags('footer'); // Y.util.Event.onAvailable('mainMenu', ESN.Dom.evalScriptTags('header')); Y.util.AnimMgr.delay = 35; }, /** * Is executed by the body onload event */ onBodyReady: function() { // load pages //ESN.Ajax.Navigate.loadPage("header", "index.php?key=header"); //ESN.Ajax.Navigate.loadPage("controller", "index.php?key=rightcontroller"); //ESN.Ajax.Navigate.loadPage("footer", "index.php?key=footer"); // Initilize the history manager (will also load the current url) ESN.Util.HistoryManager.initilize("main", "index.php?key=frontpage"); this.preloadImages(); // if 1024*768, change the overflow-x to hidden if( screen.width == 1024 && screen.height == 768 ) { $('body').style.overflowX = 'hidden'; } }, preloadImages: function() { if (document.images) { var images = [ 'http://static.playzeek.com/images/common/gamercard/button-close.gif', 'http://static.playzeek.com/images/common/gamercard/bg-loading.gif', 'http://static.playzeek.com/images/common/gamercard/bg-left.gif', 'http://static.playzeek.com/images/common/gamercard/bg-right.gif', 'http://static.playzeek.com/images/common/gamercard/bg-moving.gif' ], i, currentImage; for (i in images) { currentImage = new Image(1,1); currentImage.src = images[i]; } } } }; Y.util.Event.onDOMReady( ESN.Initialize.onDOMReady ); String.prototype.ucFirst = function () { return this.substr(0,1).toUpperCase() + this.substr(1,this.length); }