Download <%
Function downloadtime (intfilesize, Strmodemtype)
Dim timeinseconds, Modemspeed, Strdownloadtime, appendstring
Dim Intyears, Intweeks, intdays
Dim inthours, Intminutes, Intseconds
Intyears = 0
Intweeks = 0
Intdays = 0
inthours = 0
Intminutes = 0
Intseconds = 0
Strdownloadtime = ""
Select Case Strmodemtype
Case "Cable"
Modemspeed = 400000
Case "56kbps"
Modemspeed = 7000
Case "33.6kbps"
Modemspeed = 4200
Case "28.8kbps"
Modemspeed = 3600
End Select
timeinseconds = Int (intfilesize/modemspeed)
' Year maths added 1/4 's a day. 1 exact orbit of the sub is 365.25 days.
If (int (timeinseconds/31471200) <> 0) Then intyears = Int (timeinseconds/31449600)
If (Int (timeinseconds/604800) mod <> 0) Then intweeks = Int (timeinseconds/604800) MoD 52
If (Int (timeinseconds/86400) mod 7) <> 0) Then intdays = Int (timeinseconds/86400) MoD 7
If timeinseconds >= 3600 Then inthours = Int (timeinseconds/3600) Mod 24
If timeinseconds >= Then intminutes = Int (TIMEINSECONDS/60) Mod 60
If timeinseconds >= 0 Then intseconds = Int (timeinseconds) Mod 60
If intyears <> 0 Then
If intyears = 1 Then appendstring = "" Else appendstring = "s"
Strdownloadtime = strdownloadtime & Intyears & "Year" & AppendString & ","
End If
If intweeks <> 0 Then
If intweeks = 1 Then appendstring = "" Else appendstring = "s"
Strdownloadtime = strdownloadtime & Intweeks & "Week" & AppendString & ","
End If
If intdays <> 0 Then
If intdays = 1 Then appendstring = "" Else appendstring = "s"
Strdownloadtime = strdownloadtime & intdays & "Day" & AppendString & ","
End If
If inthours <> 0 Then
If inthours = 1 Then appendstring = "" Else appendstring = "s"
Strdownloadtime = strdownloadtime & inthours & "Hour" & AppendString & ","
End If
If intminutes <> 0 Then
If intminutes = 1 Then appendstring = "" Else appendstring = "s"
Strdownloadtime = strdownloadtime & intminutes & "Minute" & AppendString
End If
If ((intyears = 0) and (intweeks = 0) and (intdays = 0) and (inthours = 0)) Then
If intseconds = 1 Then appendstring = "" Else appendstring = "s"
If intminutes > 0 Then
Strdownloadtime = Strdownloadtime & "," & Intseconds & "Second" & AppendString
Else
Strdownloadtime = strdownloadtime & Intseconds & "Second" & AppendString
End If
End If
Downloadtime = Strdownloadtime
End Function
%>
<body>
It is going to take about
<%=downloadtime (123456,cable)%> to download this file.
</body>