var fixedPointDashboard = [];
fixedPointDashboard = 
	{
	includeRepository	: new Array(),
	setupProgress		: 0,
	dashboardScriptPath	: (typeof(dashboardScriptPath) != 'undefined') ? dashboardScriptPath : '',
	dashboardEnableDock	: (typeof(dashboardEnableDock) != 'undefined') ? dashboardEnableDock : false,
	showInitStatus		: (typeof(dashboardShowInitStatus) != 'undefined') ? dashboardShowInitStatus: false,
	defaultWidgets		: (typeof(dashboardDefaultWidgets) != 'undefined') ? dashboardDefaultWidgets: true,
	dashboardContainer	: false,
	dashboardCookieControl	: (typeof(dashboardCookieControl) != 'undefined') ? dashboardCookieControl : true,
	googleMapsKey	: (typeof(externalGoogleMaps) != 'undefined') ? externalGoogleMaps : 'ABQIAAAALBeawp8SVKY56xh0Rf52phSnfO7TMQdZ24-nuLe_aVjAhGrFfxS7ywrECIqzmaHil2A-oMNPeF_dKQ',

	init: function()
		{
		if(document.body == null || typeof(fpTools.animate) == 'undefined' || typeof(fpTools.chrome) == 'undefined')
			{
			setTimeout("fixedPointDashboard.init()", 300);
			return false;
			}
		else	{
			if(typeof(dashboardContainer) != 'undefined')
				{
				document.body.appendChild(dashboardContainer);
				fixedPointDashboard.dashboardContainer = dashboardContainer;
				}
			else	fixedPointDashboard.dashboardContainer = document.body;
			fixedPointDashboard.createInclude();
			}
		},

	createInclude: function()
		{
		fixedPointDashboard.includeOrder = [[fixedPointDashboard.dashboardScriptPath+"lib/kiintopiste_common.js", typeof(fixedPointCommon)],
			(fixedPointDashboard.dashboardCookieControl) ? [fixedPointDashboard.dashboardScriptPath+"lib/kiintopiste_cookies.js", typeof(fixedPointCookieControl)] : [],
			[fixedPointDashboard.dashboardScriptPath+"lib/kiintopiste_uicontrol.js", typeof(fixedPointUiControl)],
			[fixedPointDashboard.dashboardScriptPath+"lib/kiintopiste_windowcontrol.js", typeof(fixedPointWindowControl)],
			[fixedPointDashboard.dashboardScriptPath+"lib/kiintopiste_skins.js", typeof(dashboardSkins)],
			(fixedPointDashboard.defaultWidgets) ? [fixedPointDashboard.dashboardScriptPath+"lib/kiintopiste_windowdata.js", typeof(fixedPointWindowControl)] : [],
			[fixedPointDashboard.dashboardScriptPath+"lib/kiintopiste_ajax.js", typeof(fixedPointAjaxFramework)],
			(fixedPointDashboard.dashboardEnableDock) ? [fixedPointDashboard.dashboardScriptPath+"lib/kiintopiste_dock.js", typeof(fixedPointDashboardDock)] : []]

		for(var i=0; i<fixedPointDashboard.includeOrder.length; i++){(typeof(fixedPointDashboard.includeOrder[i][0]) != 'undefined') ? false : fixedPointDashboard.includeOrder.splice(i,1);}

		fixedPointDashboard.include();
		},

	include: function()
		{
		if(fixedPointDashboard.setupProgress < fixedPointDashboard.includeOrder.length)
			{
			var indicator = fpTools.chrome.systemInfo('systemSetup');
				
			var checkInclude = fixedPointDashboard.includeRepository.toString();
			if(checkInclude.indexOf(fixedPointDashboard.includeOrder[fixedPointDashboard.setupProgress][0]) == -1)
				{
				indicator.innerHTML = "Loading file "+(fixedPointDashboard.setupProgress+1)+" of " +fixedPointDashboard.includeOrder.length + " : " + fixedPointDashboard.includeOrder[fixedPointDashboard.setupProgress][0];
				fpTools.include(fixedPointDashboard.includeOrder[fixedPointDashboard.setupProgress][0]);
				fixedPointDashboard.includeRepository.push(fixedPointDashboard.includeOrder[fixedPointDashboard.setupProgress][0]);
				if(fixedPointDashboard.showInitStatus) fixedPointDashboard.dashboardContainer.appendChild(indicator);
				}
			if(fixedPointDashboard.includeOrder[fixedPointDashboard.setupProgress][1] != 'undefined')
				{
				fixedPointDashboard.setupProgress++;
				}
			setTimeout("fixedPointDashboard.createInclude()", 30);
			}
		else	{
			if(fixedPointDashboard.dashboardCookieControl) fixedPointWindowControl.openSession();
			if(fixedPointDashboard.showInitStatus)
				{
				fpTools.animate.init({obj: $('systemSetup'), styleProperty: animate._alpha, startValue:100, endValue:0, iteration:8, speed:30});
				fpTools.animate.init({obj: $('systemSetup'), styleProperty: animate._y, startValue:10, endValue:-30, iteration:8, speed:30});
				}
			}
		}
	}

fixedPointDashboard.init();