/****************************************************
 * Copyright (c) Legwork Studio. All Rights Reserved.
 * Updated by: Jos, 10-Oct-2011
 * 
 * Let's get this party started.
 ****************************************************
/                                                  */

var Athenos = Athenos || {};

(function(Athenos) {
	// Queue up stuff throughout the body that needs
	// to happen after DOM Ready.
	var queue = [],
	
		isIOS = (function(){
			var ios = ['iphone', 'ipod', 'ipad'],
				agent = window.navigator.userAgent.toLowerCase(),
				iosCount = ios.length,
				i,
				isTrue = false;

			for(i=0; i<iosCount; i++){
				if(agent.indexOf(ios[i]) !== -1) { isTrue= true; } 
			}

			return isTrue;
		})();
		
	//redirect iOS
	if(isIOS) { window.location.href = location.protocol+"//"+location.hostname+"/mobile/index.html"; }
	
	Athenos.queue = function() {
		for (var i = -1, func; func = arguments[++i];) {
			queue[queue.length] = func;
		}
	};
	
	Athenos.unqueue = function() {
		var func;
		while (func = queue.shift()) {
			func();
		}
	};
}(Athenos));
