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

  1. <%@ LANGUAGE=VBScript %>
  2. <% Option Explicit %>
  3. <% Response.Expires = 0 %>
  4.  
  5. <% if Session("FONTSIZE") = "" then %>
  6.     <!--#include file="iito.inc"-->
  7. <% else %>
  8.  
  9. <% 
  10. '    strings for localization
  11. Const L_HTTPHEADERS_TEXT = "HTTP Headers"
  12. Const L_ACCESSDENIED_TEXT="Access Denied" 
  13. Const L_ENABLEEXPIRE_TEXT="Enable Content Expiration"
  14. Const L_CONTENTSHOULD_TEXT="Content should:"
  15. Const L_EXPIMM_TEXT="Expire Immediately"
  16. Const L_EXPAFT_TEXT="Expire after"
  17. Const L_SECONDS_TEXT="Second(s)"
  18. Const L_MINUTES_TEXT="Minute(s)"
  19. Const L_HOURS_TEXT="Hour(s)"
  20. Const L_DAYS_TEXT="Day(s)"
  21. Const L_EXPON_TEXT="Expire on"
  22. Const L_MIDNIGHT_TEXT="Midnight"
  23. Const L_MONTH_TEXT="Month"
  24. Const L_DAY_TEXT="Day"
  25. Const L_YEAR_TEXT="Year"
  26. Const L_TIME_TEXT="Time"
  27.  
  28. Const L_ENTERHEADER_TEXT="Enter a custom name and value pair below:"
  29. Const L_SAMPHDR_TEXT="Custom Header:Value"
  30. Const L_SELECTITEM_TEXT="Select a header to delete."
  31.  
  32.  
  33. Const L_JAN_TEXT = "January"
  34. Const L_FEB_TEXT = "February"
  35. Const L_MAR_TEXT = "March"
  36. Const L_APR_TEXT = "April"
  37. Const L_MAY_TEXT = "May"
  38. Const L_JUN_TEXT = "June"
  39. Const L_JUL_TEXT = "July"
  40. Const L_AUG_TEXT = "August"
  41. Const L_SEP_TEXT = "September"
  42. Const L_OCT_TEXT = "October"
  43. Const L_NOV_TEXT = "November"
  44. Const L_DEC_TEXT = "December"
  45.  
  46. Const L_MON_TEXT = "Monday"
  47. Const L_TUE_TEXT = "Tuesday"
  48. Const L_WED_TEXT = "Wednesday"
  49. Const L_THU_TEXT = "Thursday"
  50. Const L_FRI_TEXT = "Friday"
  51. Const L_SAT_TEXT = "Saturday"
  52. Const L_SUN_TEXT = "Sunday"
  53.  
  54.  
  55. On Error Resume Next 
  56.  
  57. Dim path, currentobj, httpexp, timeunit,expireon, SetLocale
  58.  
  59. SetLocale = False
  60.  
  61. path=Session("dpath")
  62. Session("path")=path
  63. Set currentobj=GetObject(path)
  64. Session("SpecObj")=path
  65. Session("SpecProps")="HttpExpires"
  66.  
  67.  
  68. httpexp=currentobj.HttpExpires
  69.  
  70. if err <> 0 then
  71.     httpexp="d,-1"
  72. end if
  73. httpexp = UCase(trim(httpexp))
  74.  
  75. timeunit="<OPTION VALUE=0>" & L_SECONDS_TEXT & "<OPTION VALUE=1 SELECTED>" & L_MINUTES_TEXT & "<OPTION VALUE=2>" & L_HOURS_TEXT & "<OPTION VALUE=3 >" & L_DAYS_TEXT
  76.  
  77. function expires()
  78.     httpexp = UCase(Trim(httpexp))
  79.     if len(httpexp)= 0 then
  80.         expires="<INPUT TYPE='checkbox' NAME='hdnchkHttpExpires'  OnClick='SetExp(null);top.title.Global.updated=true;'>"
  81.     elseif httpexp="D,-1" then
  82.         expires="<INPUT TYPE='checkbox' NAME='hdnchkHttpExpires'  OnClick='SetExp(null);top.title.Global.updated=true;'>"
  83.     elseif Left(httpexp,2)="S," then
  84.         expires="<INPUT TYPE='checkbox' NAME='hdnchkHttpExpires' CHECKED OnClick='SetExp(null);top.title.Global.updated=true;'>"
  85.     elseif Left(httpexp,2)="D," then
  86.         expires="<INPUT TYPE='checkbox' NAME='hdnchkHttpExpires' CHECKED OnClick='SetExp(null);top.title.Global.updated=true;'>"        
  87.     else
  88.         expires="<INPUT TYPE='checkbox' NAME='hdnchkHttpExpires' OnClick='SetExp(null);top.title.Global.updated=true;'>"
  89.     end if
  90. end function
  91.  
  92. function expireType(thisbutton)
  93.  
  94.     Dim typestr, etype
  95.     
  96.     typestr=Mid(httpexp,1,4)
  97.     if typestr="" then
  98.         etype=""
  99.     elseif Mid(httpexp,1,2)="D," then
  100.         if len(httpexp) > 4 then
  101.                 etype=1
  102.         else
  103.                 etype=0
  104.         end if
  105.     elseif Mid(httpexp,1,2)="S," then
  106.         etype=2
  107.     else
  108.         etype=""
  109.     end if
  110.  
  111.     if thisbutton=etype then
  112.         expireType="<INPUT TYPE='radio' NAME='hdnrdoHttpExpires' CHECKED OnClick='SetExp(" & thisbutton & ");top.title.Global.updated=true;'>"
  113.     else
  114.         expireType="<INPUT TYPE='radio' NAME='hdnrdoHttpExpires' OnClick='SetExp(" & thisbutton & ");top.title.Global.updated=true;'>"
  115.     end if
  116.  
  117. end function
  118.  
  119. function hexToDec(hexstr)
  120.     hexToDec = CLng("&H" & hexstr)
  121. end function
  122.  
  123. function writeExpires(fieldname,fieldsize,onchangeproc,onfocusproc, onblurproc,hidden,adminonly,readonly)
  124.  
  125.     On Error Resume Next 
  126.     Dim strExpires, numsecs, timeelapse, thisdate
  127.     
  128.     strExpires=httpexp
  129.  
  130.     'global
  131.     expireon=""
  132.  
  133.     'httpexp is global
  134.     if Mid(httpexp,1,2) = "D," then
  135.         numsecs = Trim(Mid(strExpires,Instr(strExpires,",")+1))
  136.         if fieldname="Seconds" then
  137.             if instr(numsecs,"X") then
  138.                 numsecs=hexToDec(Trim(Mid(numsecs, Instr(numsecs,"X")+1)))        
  139.             end if
  140.             timeelapse=numsecs
  141.             if numsecs mod 86400=0 then
  142.                 timeelapse=numsecs/86400
  143.                 'timeunit is global
  144.                 timeunit="<OPTION VALUE=0 >" & L_SECONDS_TEXT & "<OPTION VALUE=1>" & L_MINUTES_TEXT & "<OPTION VALUE=2>" & L_HOURS_TEXT & "<OPTION SELECTED VALUE=3>" & L_DAYS_TEXT
  145.  
  146.             elseif numsecs mod 3600=0 then
  147.                 timeelapse=numsecs/3600
  148.                 'timeunit is global                
  149.                 timeunit="<OPTION VALUE=0 >" & L_SECONDS_TEXT & "<OPTION VALUE=1>" & L_MINUTES_TEXT & "<OPTION SELECTED  VALUE=2 >" & L_HOURS_TEXT & "<OPTION VALUE=3>" & L_DAYS_TEXT
  150.  
  151.             elseif numsecs mod 60=0 then
  152.                 timeelapse=numsecs/60
  153.                 'timeunit is global                
  154.                 timeunit="<OPTION VALUE=0 >" & L_SECONDS_TEXT & "<OPTION SELECTED VALUE=1>" & L_MINUTES_TEXT & "<OPTION VALUE=2>" & L_HOURS_TEXT & "<OPTION VALUE=3>" & L_DAYS_TEXT
  155.             end if
  156.  
  157.             if timeelapse > 0 then
  158.                 expireon=timeelapse
  159.             else
  160.                 expireon=""
  161.             end if
  162.         end if
  163.  
  164.     elseif Mid(httpexp,1,2) = "S,"  then 
  165.     
  166.         SetLocale = True
  167.         
  168.         'trim off the "S,"
  169.         strExpires = Mid(strExpires,Instr(strExpires,",")+1)
  170.         'trim off the "Day," 
  171.         strExpires = Mid(strExpires,Instr(strExpires,",")+1)
  172.         
  173.         'trim off the GMT... plus any spaces...
  174.         strExpires=Trim(Mid(strExpires,1, len(strExpires)-3))
  175.  
  176.         if isDate(strExpires) then
  177.             thisdate=CDate(strExpires)        
  178.         end if
  179.         
  180.         Select Case fieldname 
  181.         Case "Date"         
  182.             dim Dy,Mo, Yr
  183.             Dy = Day(thisdate)        
  184.             Mo = Month(thisdate)
  185.             Yr = Year(thisdate)            
  186.             expireon= WeekDayName(WeekDay(Mo & "/" & Dy & "/" & Yr),False,vbUseSystem) & ", " & MonthName(Mo, False)& " " & Dy & ", " & Yr
  187.             
  188.         Case "Hours" 
  189.             expireon=Hour(thisdate) 
  190.             
  191.         Case "Minutes" 
  192.             expireon=Minute(thisdate)
  193.             
  194.         End Select        
  195.     else
  196.         expireon=""
  197.     end if
  198.         writeExpires=inputboxfixed(err,"TEXT", ("hdn" & "HttpExpires" & fieldname), expireon ,fieldsize,fieldsize,onchangeproc,onfocusproc,onblurproc,hidden,adminonly,readonly)
  199. end function
  200.  
  201. %>
  202.  
  203. <!--#include file="iiset.inc"-->
  204.  
  205. <HTML>
  206. <HEAD>
  207. <TITLE></TITLE>
  208. <SCRIPT LANGUAGE="JavaScript">
  209.  
  210. top.title.Global.helpFileName="iipy_9";
  211. top.title.Global.siteProperties = false;
  212. userSet=true;
  213.  
  214. EXP_NONE = 0
  215. EXP_DYNAMIC = 1
  216. EXP_STATIC = 2
  217.  
  218. MONTHS = new Array()
  219. MONTHS[0] = "<%= L_JAN_TEXT %>";
  220. MONTHS[1] = "<%= L_FEB_TEXT %>";
  221. MONTHS[2] = "<%= L_MAR_TEXT %>";
  222. MONTHS[3] = "<%= L_APR_TEXT %>";
  223. MONTHS[4] = "<%= L_MAY_TEXT %>";
  224. MONTHS[5] = "<%= L_JUN_TEXT %>";
  225. MONTHS[6] = "<%= L_JUL_TEXT %>";
  226. MONTHS[7] = "<%= L_AUG_TEXT %>";
  227. MONTHS[8] = "<%= L_SEP_TEXT %>";
  228. MONTHS[9] = "<%= L_OCT_TEXT %>";
  229. MONTHS[10] = "<%= L_NOV_TEXT %>";
  230. MONTHS[11] = "<%= L_DEC_TEXT %>";
  231.  
  232.  
  233. DAYS = new Array()
  234. DAYS[0] = "<%= L_SUN_TEXT %>";
  235. DAYS[1] = "<%= L_MON_TEXT %>";
  236. DAYS[2] = "<%= L_TUE_TEXT %>";
  237. DAYS[3] = "<%= L_WED_TEXT %>";
  238. DAYS[4] = "<%= L_THU_TEXT %>";
  239. DAYS[5] = "<%= L_FRI_TEXT %>";
  240. DAYS[6] = "<%= L_SAT_TEXT %>";
  241.  
  242.  
  243. function isNum(txtcntrl,min) {
  244.     str=txtcntrl.value;
  245.     for (var i=0; i < str.length; i++) {
  246.               num = parseInt(str);
  247.         if (isNaN(num)){
  248.                alert("Please enter an integer.");
  249.             return false;
  250.               }
  251.         if (num < min) {
  252.             alert("Please enter an integer greater than " + (min-1) + ".");
  253.             return false;
  254.         }
  255.      }
  256.     return true;
  257. }
  258.  
  259. function SetRdo(rdo,fromCntrl, toCntrl){
  260.     if (!rdo){
  261.         if (fromCntrl.value !=""){
  262.             toCntrl.value=fromCntrl.value;
  263.             fromCntrl.value="";
  264.         }
  265.     }
  266.     else{
  267.         if (toCntrl.value !=""){
  268.             fromCntrl.value=toCntrl.value;
  269.             toCntrl.value="";
  270.         }
  271.     }
  272. }
  273.  
  274.  
  275.     function SetExp(expType){
  276.         if (expType==null){
  277.             if (document.userform.hdnchkHttpExpires.checked){
  278.                 document.userform.hdnrdoHttpExpires[0].checked=true;            
  279.                 document.userform.HttpExpires.value=document.userform.hdnHttpExpires.value;
  280.             }
  281.             else{        
  282.                 document.userform.hdnHttpExpires.value=document.userform.HttpExpires.value;
  283.                 document.userform.HttpExpires.value="d,-1";
  284.                 clearSeconds();
  285.                 clearGMT();
  286.             }
  287.         }
  288.  
  289.         else{
  290.             document.userform.hdnchkHttpExpires.checked=true;
  291.  
  292.             if (expType == EXP_NONE){
  293.                 document.userform.HttpExpires.value="D,0";
  294.                 clearSeconds();
  295.                 clearGMT();
  296.             }
  297.             
  298.             if (expType == EXP_DYNAMIC){
  299.                 clearGMT();
  300.                 expsecs=parseInt(document.userform.hdnhdnHttpExpiresSeconds.value);
  301.                 if (isNaN(expsecs))
  302.                 {
  303.                     expsecs = 30;
  304.                     document.userform.hdnHttpSeconds.value = 1800;
  305.                     document.userform.hdnHttpExpiresTimeUnit.options[1].selected = true;
  306.                 }
  307.                 
  308.                 document.userform.hdnHttpExpiresSeconds.value=expsecs;
  309.                 secval = parseInt(document.userform.hdnHttpSeconds.value);                                
  310.                 secstr = secval.toString(16);
  311.                                 
  312.                 <% ' Netscape's toString is broken... this hack should fix it... %>
  313.                 <% if not Session("IsIE") then %>
  314.                     while (secstr.indexOf(":") > -1){
  315.                         secstr = secstr.substring(0,secstr.indexOf(":")) + "a" + secstr.substring(secstr.indexOf(":")+1,secstr.length);
  316.                     }
  317.                     
  318.                 <% end if %>
  319.                 document.userform.HttpExpires.value="D,0X"+secstr;
  320.             }
  321.             
  322.             if (expType == EXP_STATIC){
  323.                 clearSeconds();
  324.                 setRadiotoStatic();                
  325.                 expdate=new Date();
  326.                 SetDateCntrls(expdate)
  327.             }
  328.         }
  329.     }
  330.  
  331.     function clearSeconds(){
  332.         if (document.userform.hdnHttpExpiresSeconds.value !=""){
  333.             userSet=false;
  334.             document.userform.hdnhdnHttpExpiresSeconds.value=document.userform.hdnHttpExpiresSeconds.value ;
  335.             document.userform.hdnHttpExpiresSeconds.value="";
  336.         
  337.             userSet=true;
  338.         }
  339.     }
  340.  
  341.  
  342.  
  343.     function SetSeconds(){
  344.         
  345.             tp=document.userform.hdnHttpExpiresTimeUnit.selectedIndex;
  346.  
  347.             if (document.userform.hdnHttpExpiresSeconds.value==""){
  348.                  expsecval=0;                
  349.             }
  350.             else{
  351.                 expsecval=parseInt(document.userform.hdnHttpExpiresSeconds.value);
  352.                 if (tp==0){
  353.                     document.userform.hdnHttpSeconds.value=expsecval ;
  354.                 }
  355.                 if (tp==1){
  356.                     document.userform.hdnHttpSeconds.value=expsecval * 60;
  357.                 }
  358.                 if (tp==2){
  359.                     document.userform.hdnHttpSeconds.value=expsecval * 3600;
  360.                 }
  361.                 if (tp==3){
  362.                     document.userform.hdnHttpSeconds.value=expsecval * 86400;
  363.                 }
  364.                 
  365.                 document.userform.hdnrdoHttpExpires[1].checked=true;
  366.                 document.userform.hdnhdnHttpExpiresSeconds.value=document.userform.hdnHttpExpiresSeconds.value;            
  367.                 SetExp(EXP_DYNAMIC);                
  368.             }
  369.             
  370.  
  371.             
  372.     }
  373.  
  374.  
  375.     function SetLocale(){
  376.  
  377.         expdate=parseUIDate();
  378.         
  379.                 
  380.         tzdiff=expdate.getTimezoneOffset()
  381.  
  382.         hrsdiff=parseInt(tzdiff/60)
  383.         mindiff=tzdiff%(hrsdiff*60)
  384.  
  385.         var hrs = document.userform.hdnHttpExpiresHours.value
  386.         var mns = document.userform.hdnHttpExpiresMinutes.value
  387.         if (hrs == "")
  388.         {
  389.             hrs = 0;
  390.         }
  391.         if (mns == "")
  392.         {
  393.             mns = 0;
  394.         }
  395.         expdate.setHours(hrs - hrsdiff);
  396.         expdate.setMinutes(mns -mindiff);
  397.         
  398.         SetDateCntrls(expdate)
  399.     }
  400.  
  401.     function SetDateCntrls(dateObj){
  402.         year=dateObj.getYear();
  403.  
  404.         if (year < 100){
  405.             year="19" + year;    
  406.         }
  407.         
  408.         datestr = DAYS[dateObj.getDay()] + ", " + MONTHS[dateObj.getMonth()] + " " + dateObj.getDate() + ", " + year;
  409.         document.userform.hdnHttpExpiresDate.value = datestr;
  410.         
  411.         document.userform.hdnHttpExpiresHours.value=dateObj.getHours();
  412.         document.userform.hdnHttpExpiresMinutes.value=dateObj.getMinutes();
  413.  
  414.         if (document.userform.hdnHttpExpiresMinutes.value < 10){
  415.             document.userform.hdnHttpExpiresMinutes.value="0" + document.userform.hdnHttpExpiresMinutes.value;
  416.         }
  417.  
  418.         
  419.         document.userform.HttpExpires.value="s," + expdate.toGMTString();
  420.  
  421.     }
  422.     
  423.     function setRadiotoStatic(){
  424.         document.userform.hdnchkHttpExpires.checked=true;
  425.         document.userform.hdnrdoHttpExpires[2].checked=true;
  426.         <% if Session("Browser") = "IE4" then %>        
  427.             document.userform.hdnHttpExpiresDate.disabled = false;    
  428.         <% end if %>
  429.     }
  430.     function setStaticDate(){            
  431.             newDate = parseUIDate();
  432.             newDate.setHours(document.userform.hdnHttpExpiresHours.value);
  433.             newDate.setMinutes(document.userform.hdnHttpExpiresMinutes.value);
  434.                 
  435.             document.userform.HttpExpires.value = "s,"+newDate.toGMTString();
  436.     }
  437.     
  438.     function fixStaticDate(staticdate)
  439.     {
  440.         return staticdate;
  441.     }
  442.     
  443.     function parseUIDate(){
  444.  
  445.         if (document.userform.hdnHttpExpiresDate.value != "")
  446.         {
  447.             datestr = document.userform.hdnHttpExpiresDate.value;
  448.             datestr = datestr.substring(datestr.indexOf(",")+2, datestr.length);
  449.             newDate = new Date(datestr);
  450.         }
  451.         else{
  452.             <% if Session("Browser") = "IE4" then %>        
  453.                 document.userform.hdnHttpExpiresDate.disabled = true;    
  454.             <% end if %>
  455.             newDate = new Date();
  456.         }
  457.         return newDate;
  458.     }
  459.     
  460.     function clearGMT(){
  461.         document.userform.hdnHttpExpiresDate.value="";
  462.         document.userform.hdnHttpExpiresHours.value="";
  463.         document.userform.hdnHttpExpiresMinutes.value="";
  464.     }
  465.  
  466.  
  467.     function popBox(title, width, height, filename){
  468.         thefile=(filename + ".asp");
  469.         thefile="iipop.asp?pg="+thefile;
  470.         <% if Session("Browser") <> "IE3" then %>
  471.             width=width +25;
  472.             height=height + 50;                
  473.         <% end if %>
  474.  
  475.         popbox=window.open(thefile,title,"toolbar=no,scrollbars=yes,directories=no,menubar=no,width="+width+",height="+height);
  476.         if(popbox !=null){
  477.             if (popbox.opener==null){
  478.                 popbox.opener=self;
  479.             }
  480.         }
  481.     }
  482.     
  483.     function popCalendar(cntrlname,someDate){
  484.         if (someDate == ""){
  485.             newdate = new Date();
  486.             someDate = newdate.toGMTString();
  487.         }
  488.         thefile="calendar.asp?cntrl="+cntrlname + "¤tDate=" + escape(someDate);
  489.         <% if Session("FONTSIZE") = "LARGE" then %>
  490.         popbox=window.open(thefile,"Calendar","resizable=yes,toolbar=no,scrollbars=no,directories=no,menubar=no,width=250,height=260");
  491.         <% else %>
  492.         popbox=window.open(thefile,"Calendar","resizable=yes,toolbar=no,scrollbars=no,directories=no,menubar=no,width=250,height=240");            
  493.         <% end if %>
  494.         if(popbox !=null){
  495.             if (popbox.opener==null){
  496.                 popbox.opener=self;
  497.             }
  498.         }
  499.     }    
  500.  
  501. </SCRIPT>
  502. </HEAD>
  503.  
  504.  
  505. <BODY BGCOLOR="#CCCCCC" TOPMARGIN=5 TEXT="#000000" LINK="#FFFFFF" onLoad="loadList();" STYLE="font-face: Helv,Arial; font-size:10pt;">
  506. <FONT SIZE=1 FACE="HELV,ARIAL">
  507.  
  508. <FORM NAME="userform">
  509. <B>
  510.     <%= L_HTTPHEADERS_TEXT %>
  511. </B>
  512. <P>
  513.  
  514. <%= expires %>
  515. <%= L_ENABLEEXPIRE_TEXT %>
  516. <P>
  517.  
  518. <TABLE BORDER=0 CELLPADDING=0>
  519. <TR>
  520.     <TD VALIGN="top" WIDTH = 100>
  521.         <FONT SIZE=1 FACE="HELV,ARIAL">
  522.             <%= L_CONTENTSHOULD_TEXT %>
  523.         </FONT>
  524.     </TD>
  525.     <TD VALIGN="top">
  526.         <FONT SIZE=1 FACE="HELV,ARIAL">    
  527.             <%= expireType(0) %> 
  528.         </FONT>
  529.     </TD>
  530.     <TD>
  531.         <FONT SIZE=1 FACE="HELV,ARIAL">    
  532.             <%= L_EXPIMM_TEXT %>
  533.         </FONT>
  534.     </TD>
  535. </TR>
  536.  
  537. <TR>
  538.     <TD VALIGN="top">
  539.     </TD>
  540.     <TD VALIGN="top">
  541.         <FONT SIZE=1 FACE="HELV,ARIAL">    
  542.             <%= expireType(1) %>
  543.         </FONT>
  544.     </TD>
  545.     <TD>
  546.         <FONT SIZE=1 FACE="HELV,ARIAL">    
  547.              <%= L_EXPAFT_TEXT %> 
  548.             <%= writeExpires("Seconds",5,"","","isNum(this,0);SetSeconds();",true,false,False) %>
  549.             <INPUT TYPE="hidden" NAME="hdnHttpSeconds">
  550.             <SELECT NAME="hdnHttpExpiresTimeUnit" OnChange="SetSeconds();top.title.Global.updated=true;">
  551.                 <%= timeunit %>
  552.             </SELECT>
  553.         </FONT>
  554.     </TD>
  555. </TR>
  556.  
  557. <TR>
  558.     <TD VALIGN="top">
  559.     </TD>
  560.     <TD VALIGN="top">
  561.         <FONT SIZE=1 FACE="HELV,ARIAL">    
  562.             <%= expireType(2) %>
  563.         </FONT>
  564.     </TD>
  565.     <TD>
  566.         <FONT SIZE=1 FACE="HELV,ARIAL">    
  567.             <%= L_EXPON_TEXT %> 
  568.         </FONT>
  569.     </TD>
  570. </TR>
  571. <TR>
  572.     <TD COLSPAN=2>
  573.     </TD>
  574.     <TD>
  575.             <TABLE>
  576.                 <TR>
  577.                     <TD>
  578.                         <FONT SIZE=1 FACE="HELV,ARIAL">
  579.                             <%= writeExpires("Date",35,"","","setStaticDate();",false,false,True) %>
  580.                             <INPUT TYPE="button" VALUE="..." OnClick="setRadiotoStatic();popCalendar('document.userform.hdnHttpExpiresDate',document.userform.hdnHttpExpiresDate.value);">                                                                    
  581.                             <INPUT TYPE="hidden" NAME="HttpExpires" VALUE="<%= currentobj.HttpExpires %>">                                                    
  582.                             <INPUT TYPE="hidden" NAME="hdnHttpExpires" VALUE="<%= currentobj.HttpExpires %>">                                                                                        
  583.                         </FONT>
  584.                     </TD>
  585.                     <TD>  </TD>
  586.                     <TD><FONT SIZE=1 FACE="HELV,ARIAL"><%= writeExpires("Hours",2,"","","isNum(this,0);setStaticDate();",false,false,false) %>: <%= writeExpires("Minutes",2,"","","isNum(this,0);setStaticDate();",false,false,false) %></FONT></TD>
  587.                 </TR>
  588.                 <TR>
  589.                     <TD>  </TD>
  590.                     <TD>  </TD>
  591.                     <TD ALIGN="center"><FONT SIZE=1 FACE="HELV,ARIAL"><%= L_TIME_TEXT %></FONT></TD>
  592.                 </TR>
  593.             </TABLE>
  594.             </TD>
  595.             </TR>
  596.         </TABLE>                        
  597.         </FONT>
  598.     </TD>
  599. </TR>
  600.  
  601. </TABLE>
  602. </FORM>
  603. <HR>
  604.  
  605.  
  606. <SCRIPT LANGUAGE="JavaScript">
  607.  
  608.     function loadList(){
  609.         <% if SetLocale then %>
  610.             SetLocale();
  611.         <% end if %>
  612.         
  613.         <% if Session("IsIE") then %>
  614.             parent.list.location.href = "iihdrls.asp";
  615.         <% else %>
  616.             parent.frames[1].location.href="iihdrls.asp";
  617.         <% end if %>
  618.     }
  619.  
  620.     function addItem(){
  621.         header=prompt("<%= L_ENTERHEADER_TEXT %>","<%= L_SAMPHDR_TEXT %>");
  622.         if ((header != "") && (header != null)){    
  623.             
  624.             i=cachedList.length;    
  625.             cachedList[i]=new listObj(header);
  626.             cachedList[i].updated=true;    
  627.             cachedList[i].newitem=true;
  628.             loadList();
  629.         }
  630.     }
  631.  
  632.     function delItem(){
  633.         ndxnum=parent.list.document.userform.selHttpCustomHeader.options.selectedIndex;
  634.         if (ndxnum != -1){
  635.         var i=parent.list.document.userform.selHttpCustomHeader.options[ndxnum].value;
  636.             if (i !=""){
  637.                 cachedList[i].deleted=true;
  638.                 cachedList[i].updated=true;    
  639.                 loadList();
  640.             }
  641.         }
  642.         else{
  643.             alert("<%= L_SELECTITEM_TEXT %>");
  644.         }
  645.     }
  646.  
  647.     function buildListForm(){    
  648.         numrows=0;
  649.         for (var i=0; i < cachedList.length; i++) {
  650.             if ((!cachedList[i].deleted) && (cachedList[i].header !="")){
  651.                 numrows=numrows + 1;
  652.             }
  653.         }
  654.         qstr="numrows="+numrows;
  655.         qstr=qstr+"&cols=HttpCustomHeaders"
  656.  
  657.         top.body.hlist.location.href="iihdn.asp?"+qstr;
  658.         <% 'the list values will be grabbed by the hiddenlistform script... %>
  659.     }
  660.  
  661.     function SetListVals(){
  662.         listForm=parent.parent.hlist.document.hiddenlistform;    
  663.         j=0;
  664.         for (var i=0; i < cachedList.length; i++) {
  665.             if ((!cachedList[i].deleted) && (cachedList[i].header !="")){
  666.                 listForm.elements[j++].value=cachedList[i].header;
  667.                 //cachedList[i].updated=false;
  668.             }
  669.         }
  670.     }
  671.  
  672.     function popBox(title, width, height, filename){
  673.         thefile=(filename + ".asp");
  674.         thefile="iipop.asp?pg="+thefile;
  675.         <% if not Session("IsIE") then %>
  676.             width=width +25;
  677.             height=height + 50;
  678.         <% end if %>
  679.  
  680.         popbox=window.open(thefile,title,"toolbar=no,scrollbars=yes,directories=no,menubar=no,width="+width+",height="+height);
  681.         if(popbox !=null){
  682.             if (popbox.opener==null){
  683.                 popbox.opener=self;
  684.             }
  685.         }
  686.     }
  687.  
  688.     function listFuncs(){
  689.         this.loadList=loadList;
  690.         this.addItem=addItem;
  691.         this.delItem=delItem;
  692.         this.writeList=buildListForm;
  693.         this.popBox=popBox;
  694.         this.SetListVals=SetListVals;
  695.         this.ndx=0;
  696.     }
  697.  
  698.  
  699.  
  700.     function listObj(header){
  701.         this.header=header;
  702.         this.deleted=false;
  703.         this.updated=false;
  704.         this.newitem=false;
  705.     }
  706.  
  707.     cachedList=new Array()
  708.  
  709. listFunc=new listFuncs();
  710.  
  711. <%  
  712.  
  713. Dim aHdrs,arraybound, i
  714.  
  715. aHdrs=currentobj.HttpCustomHeaders
  716. arraybound=UBound(aHdrs)
  717. if aHdrs(arraybound) <> "" then
  718. for i=0 to arraybound
  719.      %>cachedList[<%= i %>]=new listObj("<%= aHdrs(i) %>");<% 
  720. Next
  721. end if 
  722.  %>
  723.  
  724. </SCRIPT>
  725.  
  726. </FONT>
  727. </BODY>
  728.  
  729. </HTML>
  730.  
  731. <% end if %>