home *** CD-ROM | disk | FTP | other *** search
/ MacFormat 2000 July / macformat-092.iso / Dreamweaver 3 / Configuration / Shared / MM / Scripts / CMN / displayHelp.js < prev    next >
Encoding:
Text File  |  1999-12-01  |  1.0 KB  |  24 lines

  1. //Copyright 1998 Macromedia, Inc. All rights reserved.
  2.  
  3. function displayHelp(){
  4.   var rootPath = dw.getConfigurationPath();
  5.   var idPath = rootPath.substring(0,rootPath.lastIndexOf("/")) + "/Help/contextID.html";
  6.   if (DWfile.exists(idPath)) {
  7.     var idRoot  = dreamweaver.getDocumentDOM(idPath);
  8.     var contextSetter  = idRoot.documentElement;
  9.     var idURL = idRoot.URL;
  10.     var endURL = idURL.indexOf('contextID');
  11.     var driveURL = idURL.substring(0,endURL);
  12.   
  13.     contextSetter.innerHTML = '<' + 'head>\n<' + 'title>context setter<' + '/title>\n\n<' + 'script language="javascript">\nfunction setContext() {\n  parent.right.location="' + driveURL + helpDoc + '";\n}\n<' + '/script>\n<' + '/head>\n\n<' + 'body onLoad="setContext()">\n<' + '/body>';
  14.   
  15.     DWfile.write(idURL, contextSetter.outerHTML);
  16.     dreamweaver.releaseDocument(idRoot);
  17.     var helpFrameset = driveURL + 'ContextHelp.htm';
  18.     dreamweaver.browseDocument(helpFrameset);
  19.  
  20.   } else { //help file not found
  21.     alert(MM.HELP_errorFileNotFound + idPath);
  22.   }
  23. }
  24.