SplashDialog = function(editorUi)
{
	var div = document.createElement('div');
	div.style.textAlign = 'center';
	
	var elt = editorUi.addLanguageMenu(div, true);
	
	if (elt != null)
	{
		elt.style.bottom = '19px';
	}
	
	var help = null;
	var serviceCount = editorUi.getServiceCount();
	
	if (!editorUi.isOffline() && serviceCount > 1)
	{
		help = document.createElement('a');
		help.setAttribute('href', 'https://about.draw.io/support/');
		help.setAttribute('title', mxResources.get('help'));
		help.setAttribute('target', '_blank');
		help.style.position = 'absolute';
		help.style.fontSize = '12px';
		help.style.textDecoration = 'none';
		help.style.cursor = 'pointer';
		help.style.bottom = '22px';
		help.style.left = '26px';
		help.style.color = 'gray';

		var icon = document.createElement('img');
		mxUtils.setOpacity(icon, 50);
		icon.style.height = '16px';
		icon.style.width = '16px';
		icon.setAttribute('border', '0');
		icon.setAttribute('valign', 'bottom');
		icon.setAttribute('src', Editor.helpImage);
		icon.style.marginRight = '2px';
		help.appendChild(icon);
		
		mxUtils.write(help, mxResources.get('help'));
		
		div.appendChild(help);
	}

	var hd = document.createElement('p');
	hd.style.fontSize = '16pt';
	hd.style.padding = '0px';
	hd.style.paddingTop = '2px';
	hd.style.margin = '0px';
	hd.style.color = 'gray';
	
	var logo = document.createElement('img');
	logo.setAttribute('border', '0');
	logo.setAttribute('align', 'absmiddle');
	logo.style.width = '40px';
	logo.style.height = '40px';
	logo.style.marginRight = '12px';
	logo.style.paddingBottom = '4px';
	
	var service = '';
	
	if (editorUi.mode == App.MODE_GOOGLE)
	{
		logo.src = IMAGE_PATH + '/google-drive-logo.svg';
		service = mxResources.get('googleDrive');
	}
	else if (editorUi.mode == App.MODE_DROPBOX)
	{
		logo.src = IMAGE_PATH + '/dropbox-logo.svg';
		service = mxResources.get('dropbox');
	}
	else if (editorUi.mode == App.MODE_ONEDRIVE)
	{
		logo.src = IMAGE_PATH + '/onedrive-logo.svg';
		service = mxResources.get('oneDrive');
	}
	else if (editorUi.mode == App.MODE_GITHUB)
	{
		logo.src = IMAGE_PATH + '/github-logo.svg';
		service = mxResources.get('github');
	}
	else if (editorUi.mode == App.MODE_GITLAB)
	{
		logo.src = IMAGE_PATH + '/gitlab-logo.svg';
		service = mxResources.get('gitlab');
	}
	else if (editorUi.mode == App.MODE_BROWSER)
	{
		logo.src = IMAGE_PATH + '/osa_database.png';
		service = mxResources.get('browser');
	}
	else if (editorUi.mode == App.MODE_TRELLO)
	{
		logo.src = IMAGE_PATH + '/trello-logo.svg';
		service = mxResources.get('trello');
	}
	else
	{
		logo.src = IMAGE_PATH + '/osa_drive-harddisk.png';
		service = mxResources.get('device');
	}

	var buttons = document.createElement('div');
	buttons.style.margin = '4px 0px 0px 0px';
	
	var btn = document.createElement('button');
	btn.className = 'geBigButton';
	btn.style.fontSize = '18px';
	btn.style.padding = '10px';
	btn.style.width = '340px';
	
	if (!mxClient.IS_CHROMEAPP && !EditorUi.isElectronApp)
	{
		hd.appendChild(logo);
		mxUtils.write(hd, service);
		div.appendChild(hd);
		buttons.style.border = '1px solid #d3d3d3';
		buttons.style.borderWidth = '1px 0px 1px 0px';
		buttons.style.padding = '18px 0px 24px 0px';
		btn.style.marginBottom = '8px';
	}
	else
	{
		buttons.style.padding = '42px 0px 56px 0px';
		btn.style.marginBottom = '12px';
	}

	if (mxClient.IS_QUIRKS)
	{
		buttons.style.whiteSpace = 'nowrap';
		buttons.style.cssFloat = 'left';
	}

	if (mxClient.IS_QUIRKS)
	{
		btn.style.width = '340px';
	}
	
	mxUtils.write(btn, mxResources.get('createNewDiagram'));
	
	mxEvent.addListener(btn, 'click', function()
	{
		editorUi.hideDialog();
		editorUi.actions.get('new').funct();
	});
	
	buttons.appendChild(btn);
	mxUtils.br(buttons);
	
	var btn = document.createElement('button');
	btn.className = 'geBigButton';
	btn.style.marginBottom = '22px';
	btn.style.fontSize = '18px';
	btn.style.padding = '10px';
	btn.style.width = '340px';
	
	if (mxClient.IS_QUIRKS)
	{
		btn.style.width = '340px';
	}
	
	mxUtils.write(btn, mxResources.get('openExistingDiagram'));
	
	mxEvent.addListener(btn, 'click', function()
	{
		editorUi.actions.get('open').funct();
	});
	
	buttons.appendChild(btn);

	var storage = 'undefined';
	
	if (editorUi.mode == App.MODE_GOOGLE)
	{
		storage = mxResources.get('googleDrive');
	}
	else if (editorUi.mode == App.MODE_DROPBOX)
	{
		storage = mxResources.get('dropbox');
	}
	else if (editorUi.mode == App.MODE_ONEDRIVE)
	{
		storage = mxResources.get('oneDrive');
	}
	else if (editorUi.mode == App.MODE_GITHUB)
	{
		storage = mxResources.get('github');
	}
	else if (editorUi.mode == App.MODE_GITLAB)
	{
		storage = mxResources.get('gitlab');
	}
	else if (editorUi.mode == App.MODE_TRELLO)
	{
		storage = mxResources.get('trello');
	}
	else if (editorUi.mode == App.MODE_DEVICE)
	{
		storage = mxResources.get('device');
	}
	else if (editorUi.mode == App.MODE_BROWSER)
	{
		storage = mxResources.get('browser');
	}
	
	if (!mxClient.IS_CHROMEAPP && !EditorUi.isElectronApp)
	{
		var driveUsers = (editorUi.drive != null) ? editorUi.drive.getUsersList() : [];
		
		function addLogout(logout)
		{
			btn.style.marginBottom = '24px';
			
			var link = document.createElement('a');
			link.style.display = 'inline-block';
			link.style.cursor = 'pointer';
			link.style.marginTop = '6px';
			mxUtils.write(link, mxResources.get('signOut'));

			// Makes room after last big buttons
			btn.style.marginBottom = '16px';
			buttons.style.paddingBottom = '18px';
			
			mxEvent.addListener(link, 'click', function()
			{
				editorUi.confirm(mxResources.get('areYouSure'), function()
				{
					logout();
				});
			});
			
			buttons.appendChild(link);
		};
		
		if (editorUi.mode == App.MODE_GOOGLE && driveUsers.length > 0)
		{
			var title = document.createElement('span');
			title.style.marginTop = '6px';
			mxUtils.write(title, mxResources.get('changeUser') + ':');

			// Makes room after last big buttons
			btn.style.marginBottom = '16px';
			buttons.style.paddingBottom = '18px';
			
			buttons.appendChild(title);
			
			var usersSelect = document.createElement('select');
			usersSelect.style.marginLeft = '4px';
			usersSelect.style.width = '200px';
			
			for (var i = 0; i < driveUsers.length; i++)
			{
				var option = document.createElement('option');
				mxUtils.write(option, driveUsers[i].displayName);
				option.value = i;
				usersSelect.appendChild(option);
				//More info (email) about the user in a disabled option
				option = document.createElement('option');
				option.innerHTML = '&nbsp;&nbsp;&nbsp;';
				mxUtils.write(option, '<' + driveUsers[i].email + '>');
				option.setAttribute('disabled', 'disabled');
				usersSelect.appendChild(option);
			}
			
			//Add account option
			var option = document.createElement('option');
			mxUtils.write(option, mxResources.get('addAccount'));
			option.value = driveUsers.length;
			usersSelect.appendChild(option);
			
			mxEvent.addListener(usersSelect, 'change', function()
			{
				var userIndex = usersSelect.value;
				var existingAccount = driveUsers.length != userIndex;
				
				if (existingAccount)
				{
					editorUi.drive.setUser(driveUsers[userIndex]);
				}
				
				editorUi.drive.authorize(existingAccount, function()
				{
					editorUi.setMode(App.MODE_GOOGLE);
					editorUi.hideDialog();
					editorUi.showSplash();
				}, function(resp)
				{
					editorUi.handleError(resp, null, function()
					{
						editorUi.hideDialog();
						editorUi.showSplash();
					});
				}, true);
			});
			
			buttons.appendChild(usersSelect);
		}
		else if (editorUi.mode == App.MODE_ONEDRIVE && editorUi.oneDrive != null)
		{
			addLogout(function()
			{
				editorUi.oneDrive.logout();
			});
		}
		else if (editorUi.mode == App.MODE_GITHUB && editorUi.gitHub != null)
		{
			addLogout(function()
			{
				editorUi.gitHub.logout();
				editorUi.openLink('https://www.github.com/logout');
			});
		}
		else if (editorUi.mode == App.MODE_GITLAB && editorUi.gitLab != null)
		{
			addLogout(function()
			{
				editorUi.gitLab.logout();
				editorUi.openLink(DRAWIO_GITLAB_URL + '/users/sign_out');
			});
		}
		else if (editorUi.mode == App.MODE_TRELLO && editorUi.trello != null)
		{
			if (editorUi.trello.isAuthorized())
			{
				addLogout(function()
				{
					editorUi.trello.logout();
				});
			}
		}
		else if (editorUi.mode == App.MODE_DROPBOX && editorUi.dropbox != null)
		{
			// NOTE: Dropbox has a logout option in the picker
			addLogout(function()
			{
				editorUi.dropbox.logout();
				editorUi.openLink('https://www.dropbox.com/logout');
			});
		}
		
		mxUtils.br(buttons);
		var link = document.createElement('a');
		link.style.display = 'inline-block';
		link.style.cursor = 'pointer';
		link.style.marginTop = '8px';
		mxUtils.write(link, mxResources.get('changeStorage'));
		
		mxEvent.addListener(link, 'click', function()
		{
			editorUi.hideDialog(false);
			editorUi.setMode(null);
			editorUi.clearMode();
			editorUi.showSplash(true);
		});
		
		buttons.appendChild(link);
	}
		
	div.appendChild(buttons);
	this.container = div;
}
Constructs a dialog for creating new files from templates.