home *** CD-ROM | disk | FTP | other *** search
/ Chip 1998 February / CHIP_2_98.iso / software / pelne / optionp / iis4_03.cab / jsbrowser.js < prev    next >
Text File  |  1997-10-30  |  2KB  |  89 lines

  1. //open
  2.  
  3. var POP = true;
  4.  
  5. //browser style
  6. var TDIR = 0
  7. var TFILE = 1
  8.  
  9. //system font size
  10. var SMALL = 0
  11. var LARGE = 1
  12.  
  13. function BrowserObj(pathCntrl,open,browsertype,sysfontsize)
  14.     {    
  15.         this.browsertype = browsertype;
  16.         this.sysfontsize = sysfontsize;
  17.         this.currentFile = "";
  18.                         
  19.         if (pathCntrl != null)
  20.             {
  21.             this.currentPath = pathCntrl.value;
  22.             this.lastpath = pathCntrl.value;
  23.             this.pathCntrl = pathCntrl;
  24.             }
  25.         else
  26.             {
  27.             this.currentPath = "";
  28.             this.lastPath = "";
  29.             }
  30.             
  31.         
  32.         this.BrowserObjSetPath = BrowserObjSetPath;    
  33.         this.BrowserObjOpen = BrowserObjOpen;
  34.         
  35.         if (open)
  36.             {
  37.             BrowserObjOpen();
  38.             }    
  39.     }
  40.  
  41. function BrowserObjPop(title, width, height, filename)
  42.     {
  43.         thefile=(filename + ".asp");
  44.         thefile="JSBrowser/JSBrwPop.asp?pg="+thefile;
  45.         var browser = navigator.appName;
  46.         if (JSBrowser.sysfontsize == LARGE){
  47.             width += 150;
  48.             height += 150;
  49.         }
  50.         if (browser.indexOf("Microsoft") == -1)
  51.             {        
  52.             width += 35;
  53.             height += 50;
  54.             }
  55.         popbox=window.open(thefile,title,"resizable=yes,toolbar=no,scrollbars=yes,directories=no,menubar=no,width="+width+",height="+height);
  56.         popbox.opener = self;
  57.         
  58.     }
  59.     
  60. function BrowserObjOpen()
  61.     {
  62.         BrowserObjPop('Browser',470,275,'JSBrowser');
  63.     }
  64.  
  65. function BrowserObjSetPath()
  66.     {
  67.     
  68.         if (JSBrowser.browsertype == TDIR)
  69.             {
  70.             JSBrowser.pathCntrl.value = JSBrowser.currentPath;         
  71.             }
  72.         else
  73.             {
  74.             currentPath = JSBrowser.currentPath;
  75.  
  76.             if (currentPath.lastIndexOf("\\") == currentPath.length-1)
  77.                 {
  78.                     JSBrowser.pathCntrl.value = currentPath + JSBrowser.currentFile;
  79.                 }
  80.             else
  81.                 {
  82.                     JSBrowser.pathCntrl.value = currentPath + "\\" + JSBrowser.currentFile;                
  83.                 }
  84.             }
  85.         JSBrowser.pathCntrl.focus();
  86.         JSBrowser.pathCntrl.blur();        
  87.     }    
  88.     
  89. JSBrowser = new BrowserObj(null,false,TDIR,SMALL);