var exportSettings = fw.getDocumentDOM().exportSettings;

exportSettings.exportFilesStyle = "HTML and Images";
exportSettings.setByUser = true;
exportSettings.templateName = "FrontPage";

// use the document title as the base name of the export
// if it doesn't exist (probably because the file hasn't been saved yet),  just use a generic name
var docTitle = fw.getDocumentDOM().docTitleWithoutExtension;

if (docTitle.length == 0) {
	docTitle = "Untitled";
}

exportSettings.baseName = docTitle;
exportSettings.fileExtension = fw.getPref("HTMLExtension");

fw.getDocumentDOM().setExportSettings(exportSettings);

fw.exportDocumentAs(null, null, null);
