function StartupCommand(data) {

}

function ShowModuleCommand(data) {
	if(Main.currentModule != null) {
		Main.currentModule.release();
	}
	$("#overlay2").html("");
	Main.currentModule = Phire.getView(data.module);
	Main.currentModule.init(data.data);
}

function ShowAlertPanelCommand(data) {
	Phire.getView("AlertPanel").init(data);
}

function ShowLoginPanelCommand(data) {
	Phire.getView("LoginPanel").init(data);
}

function ExitTestCommand(data) {
	
	var text;
	switch(Main.currentModule.name){
		case "VideoModule":
		case "FitInterviewModule":
			text = "Möchten Sie diesen Programmteil wirklich beenden?";
		break;
		
		default:
			text = "Möchten Sie den Test wirklich abbrechen?";
		break;
		
	}
	
	Phire.sendNotification(Notifications.SHOW_ALERT_PANEL, {
		
		text : text,
		ok : "Ja",
		cancel : "Nein",
		data : data,
		callback : function(value, data) {
			if(value) {

				Phire.sendNotification(Notifications.SHOW_MODULE, {
					module : data
				});
			}

		}
	});

};

function NavigateToCommand(data) {
	if(data.nav == "#undefined")
		return;
	
	if(!UserInfo.loggedIn) {
		Phire.sendNotification(Notifications.SHOW_ALERT_PANEL, {
			text : "Bitte loggen Sie sich ein!"
		});

		return;
	}

	var module;
	switch(data.nav) {

		case "#nav_jobkompass":
			module = "KompassModule";
			break;

		case "#mainmodule_jobtest":
		case "#nav_jobtest":
			module = "JobTestModule";
			break;

		case "#mainmodule_feelWell":
		case "#nav_feelwell":
			module = "FeelWellModule";
			break;

		case "#mainmodule_fit":
		case "#nav_fit":
			module = "FitModule";
			break;
	}
	log("navto", Main.currentModule.name);
	if(UserInfo.inTest) {
		Phire.sendNotification(Notifications.EXIT_TEST, module);
		return;
	}

	Phire.sendNotification(Notifications.SHOW_MODULE, {
		module : module
	});

};
