function doNewModule(){
		if(module.dirty){
			if(!confirm("You have unsaved changes in your module.  Are you certain you want to create a new module and lose these changes?")){
				return;
			}
		}
		module = moduleBuilder.createModule();
		doMainMenu("New module created!");
}
function doEditModule(){
	doEditMenu();
}
function doExportModule(){
		var content="<h1>Export Module</h1>";
		content += "<p>Select the contents of the text area below and copy it to the clipboard. You can then paste it into another text editor.  Press the \"Done\" button when you are finished to return to the main menu.</p>";
		module.dirty=false;
		content+="<p><textarea style=\"width:100%;height:50%;\" readonly=\"readonly\">"+JSON.stringify(module)+"</textarea></p>";
		content += "<p><button onclick=\"doMainMenu();\">Done</button></p>";
		gameContentDiv.innerHTML=content;
}
function doActualImport(){
		module=JSON.parse(document.getElementById("importTextArea").value);
		doMainMenu("Module imported!");
}
function doImportModule(){
		if(module.dirty){
			if(!confirm("You have unsaved changes in your module.  Are you certain you want to import a module and lose these changes?")){
				return;
			}
		}
		var content="<h1>Import Module</h1>";
		content += "<p>Copy text from another editor, and paste it into the text area below, then press the \"Import\" button, or press the \"Cancel\" button to cancel the import and return to the main menu.</p>";
		content+="<p><textarea style=\"width:100%;height:50%;\" id=\"importTextArea\"></textarea></p>";
		content += "<p><button onclick=\"doActualImport();\">Import</button><button onclick=\"doMainMenu();\">Cancel</button></p>";
		gameContentDiv.innerHTML=content;
}
function doPlayModule(){
	alert("Not Implemented!");
}
function doMainMenu(message){
		var content="<h1>Main Menu</h1>";
		content += "<p><button onclick=\"doNewModule();\">New Module</button></p>";
		content += "<p><button onclick=\"doEditModule();\">Edit Module</button></p>";
		content += "<p><button onclick=\"doExportModule();\">Export Module</button></p>";
		content += "<p><button onclick=\"doImportModule();\">Import Module</button></p>";
		content += "<p><button onclick=\"doPlayModule();\">Play Module</button></p>";
		if(message!=null){
			content += "<p>"+message+"</p>";
		}
		gameContentDiv.innerHTML=content;		
}