home *** CD-ROM | disk | FTP | other *** search
/ Chip 1998 February / CHIP_2_98.iso / software / pelne / optionp / iis4_03.cab / jsbrwls.asp < prev    next >
Text File  |  1997-11-13  |  3KB  |  105 lines

  1. <%@ LANGUAGE=VBScript %>
  2. <% Response.Expires = 0 %>
  3.  
  4. <%
  5. Dim browserobj, browser
  6. Set browserobj=Server.CreateObject("MSWC.BrowserType") 
  7. if Instr(Request.ServerVariables("HTTP_USER_AGENT"),"MSIE") then
  8.         browser = "IE" + browserobj.MajorVer
  9. else
  10.         browser = "OTHER"
  11. end if
  12.  
  13. %>
  14.  
  15. <HTML>
  16. <HEAD>
  17.     <TITLE></TITLE>
  18.     <SCRIPT LANGUAGE = "JavaScript">
  19.         function selItem(item)
  20.             {
  21.             parent.head.listFunc.selIndex=item;
  22.             if (parent.head.cachedList[item].nodetype != "File Folder")
  23.                 {
  24.                 parent.filter.document.userform.currentFile.value = parent.head.cachedList[item].fname;
  25.                 if (parent.head.cachedList[item].fext != ""){
  26.                     parent.filter.document.userform.currentFile.value += "."+parent.head.cachedList[item].fext;
  27.                 }
  28.                 
  29.                 }
  30.                 <% if browser = "IE3" then %>                    
  31.                     self.location.href="JSBrwLs.asp#curItem";
  32.                 <% else %>
  33.                     self.location.href="JSBrwLs.asp";            
  34.                 <% end if %>                
  35.  
  36.             }
  37.         
  38.         function delve(item)
  39.             {
  40.             if (parent.head.cachedList[item].nodetype != "File Folder")
  41.                 {
  42.                     selItem(item);
  43.                 }
  44.             else
  45.                 {
  46.                 parent.head.document.userform.currentPath.value = parent.head.cachedList[item].path;
  47.                 parent.head.listFunc.changeDir(parent.head.cachedList[item].path);
  48.                 }
  49.             }
  50.             
  51.         function tdsize(stringwidth)
  52.             {
  53.             return stringwidth;
  54.             }
  55.                 
  56.     </SCRIPT>
  57. </HEAD>
  58.  
  59. <BODY BGCOLOR="#FFFFFF" TEXT="black" TOPMARGIN = 1 LEFTMARGIN = 1 LINK="BLACK" VLINK="BLACK" ALINK="BLACK">
  60.  
  61.  
  62. <SCRIPT LANGUAGE="JavaScript">
  63.     var fs = "<FONT SIZE=1 FACE='HELV'>"
  64.     var fsb = "<FONT SIZE=1 FACE='HELV' COLOR='black'>"    
  65.     var theList = parent.head.cachedList;
  66.     var sel = eval(parent.head.listFunc.selIndex);
  67.     var filtBy = parent.head.listFunc.filterType;    
  68.     dispstr = "<TABLE BORDER=0 CELLPADDING=1 CELLSPACING=0>"
  69.     for (var i = 0; i < parent.head.cachedList.length; i++)
  70.         {
  71.         fext = theList[i].fext;
  72.         if((filtBy == "") || (fext.indexOf(filtBy) != -1))
  73.             {            
  74.             if (sel != i)
  75.                 {
  76.                 dispstr += "<TR><TD WIDTH =  16>";
  77.                 dispstr += "<A HREF='javascript:selItem("+i+");'><IMG BORDER = 0 SRC='" + theList[i].icon     + "'></A>";
  78.                 dispstr += "</TD>";
  79.                 dispstr += "<TD WIDTH = " + tdsize(160) + ">" + fs + "<A HREF='javascript:selItem("+i+");'>"+ theList[i].displayname +"</A></TD>";
  80.                 dispstr += "<TD WIDTH = " + tdsize(75) + " ALIGN='right'>" + fs +theList[i].displaysize +" KB </TD>";
  81.                 dispstr += "<TD WIDTH = " + tdsize(85) + ">" + fs + theList[i].ftype +"</TD>";
  82.                 dispstr += "<TD WIDTH = " + tdsize(150) + ">" + fs + theList[i].displaydate +"</TD></TR>";            
  83.                 }
  84.             else
  85.                 {    
  86.                 dispstr += "<TR BGCOLOR='#DDDDDD'>";
  87.                 dispstr += "<TD WIDTH = 16><A NAME='curItem'></A><IMG BORDER = 0 SRC='"+theList[i].icon +"'></TD>";
  88.                 dispstr += "<TD WIDTH = " + tdsize(150) + ">";                
  89.                 dispstr += fsb + "<A HREF='javascript:delve("+i+");'>" + theList[i].displayname + "</A></TD>";
  90.                 dispstr += "<TD WIDTH = " + tdsize(70) + " ALIGN='right'>" + fsb + theList[i].displaysize+" KB </TD>";
  91.                 dispstr += "<TD WIDTH = " + tdsize(90) + ">" + fsb + theList[i].ftype +"</TD>";
  92.                 dispstr += "<TD WIDTH = " + tdsize(150) + ">" + fsb + theList[i].displaydate +"</TD></TR>";
  93.                 }                
  94.             }
  95.         }
  96.         dispstr += "</TABLE>"
  97.         document.write(dispstr);        
  98.     <% if browser <> "IE3" then %>
  99.         self.location.href = "JSBrwLs.asp#curItem";
  100.     <% end if %>                
  101. </SCRIPT>
  102.  
  103. </BODY>
  104. </HTML>
  105.