/*
	General Functions
	This document comprises of general shortcuts and misc functions, classes, objects, etc.
*/
// document.getElementById shortcut
function $(el) 
{
	if(!el.nodeName) return document.getElementById(el);
	else return el;
};

// Deletes the element contained within
function $D(el){ $(el).parentNode.removeChild($(el)); };

// Client Info Object. More to come here
var ClientData =
{	
	gameCounter:0,
	gameInstances: new Array,
	currentGame: null
};


// TEMPORARY FUNCTIONS
// These are for development only. Please remove when going live with v2
function tempFunction()
{
	$('home').parentNode.removeChild($('home')); //.innerHTML='';
	UI.Game.Initialize();
	ClientData.gameInstances[ClientData.gameCounter] = new Engine('Skeemo');
	ClientData.currentGame = ClientData.gameInstances[ClientData.gameCounter];
	setTimeout(function()
	{
		ClientData.currentGame.gameLogic.Start();
	},1000);
};

function tempFunction2()
{
	$('gameWrapper').parentNode.removeChild($('gameWrapper')); //.innerHTML='';
	UI.Game.Initialize();
	ClientData.gameInstances[ClientData.gameCounter] = new Engine('Skeemo');
	ClientData.currentGame = ClientData.gameInstances[ClientData.gameCounter];
	setTimeout(function()
	{
		ClientData.currentGame.gameLogic.Start();
	},1000);
};


// Initial main UI
window.addEventListener('load',UI.Init,false);