/********************************************************* Set of JavaScript functions used throughout database Contact Management, 04/Jan/2001 **********************************************************/ /*********************************************************** openDBRelativeURL is used to open relative URLs Given the string of the URL that needs opening, this function will append it to the end of the URL, after the directory and file name of the database ************************************************************/ function openDBRelativeURL( elemName ){ pathName = location.pathname.split('.nsf'); location.href = pathName[0] + '.nsf/' + elemName; } /*********************************************************** doDelete is used to delete the document from the server The user is first asked to confirm that this is what they want to do. Giving them the chance to cancel the action. This works SIMPLY by changing the end of the URL from "?OpenDocument" to "?DeleteDocument" ************************************************************/ function doDelete( setSubmitVar) { if ( confirm('Are you sure you want to delete this document?') ){ isDocBeingSubmitted = true; location.search = "?DeleteDocument"; } } /*********************************************************** trim is a simple function to remove leading/trailing spaces ************************************************************/ function trim(aStr) { return aStr.replace(/^\s{1,}/, "").replace(/\s{1,}$/, "") }