Set various default values if not passed as parameters If no filename passed, then use name of referring document If no name for file to display after saving then use filename Source location is public (scripts folder, the default), private (data folder) or both Default target location is same as soure location ------------------------------------------------------ Various javascript functions used by the rich text editor ------------------------------------------------------ ------------------------------------------------------ Redirect to next document after savingUse rich text option only if it is MSIE5 or higher on windowsTwo versions of the body tag depending if IE is the browserStart of editing section - saving section under else ------------------------------------------------------ First the rich text editing section ------------------------------------------------------ If source location is private, copy it to the public folderIf source location is public, copy it to the private folderImport the fileget header info Now follows non-internet explorer editing section ------------------------------------------------------ If source location is public, first copy it to the private folderImport the file End of non-IE editing sectionEnd of NOT saving partStart of saving section - above was editing ------------------------------------------------------ Now save itEnd of saving part