<% 'The first three functions are used in the viewGradient() function. This code is largely undocumented but I will be working on that for a future upgrade of the code. 'This function creates a specified number of nonbreaking spaces Private Function nbsp(iNumber) dim mySpace do until count = iNumber mySpace = mySpace & " " count = count + 1 loop nbsp = mySpace set mySpace = nothing end function '******** 'This function converts a three digit number into a two digit hex number. Private Function smartHex(strRGB) if typeName(strRGB) = "Double" or Len(strRGB) = 3 then strRGB = hex(strRGB) end if if len(strRGB) = 1 then strRGB = 0 & strRGB end if smartHex = strRGB End function '****** 'This function takes a three digit integer and increments it 'or decreases it by 1 depending on the colorEnd variable. If the 'colorEnd and the colorStart variables are equal, it will not change 'the resulting number. Private Function CheckNum(intNumber,colorStart,colorEnd) if intNumber <> colorEnd then if colorEnd > colorStart then if intNumber = "255" then intNumber = intNumber else intNumber = intNumber + 1 end if else if colorEnd < colorStart then if intNumber = "0" then intNumber = intNumber else intNumber = intNumber - 1 end if else if colorEnd = colorStart then intNumber = intNumber end if end if end if else intNumber = colorEnd end if Select Case Len(intNumber) case 1 intNumber = "00" & intNumber case 2 intNumber = "0" & intNumber End Select CheckNum = intNumber end function '****** 'This function creates a banner with a specified height and width who's 'background color starts as one color and ends up as another. Optional 'text can be added for use as a header. Public Function viewGradient(strColor1,strColor2,iHeight,iWidth,strText,strTextColor,iTextSize) dim strColor, count dim intNum1a, intNum1b, intNum1c, intNum2a, intNum2b, intNum2c dim color1a, color1b, color1c, color2a, color2b, color2c count = 0 intNum1a = Int("&H" & Left(strColor1,2)) intNum1b = Int("&H" & Mid(strColor1,3,2)) intNum1c = Int("&H" & Right(strColor1,2)) intNum2a = Int("&H" & Left(strColor2,2)) intNum2b = Int("&H" & Mid(strColor2,3,2)) intNum2c = Int("&H" & Right(strColor2,2)) color1A = intNum1a color1B = intNum1b color1C = intNum1c color2A = intNum2a color2B = intNum2b color2C = intNum2c iTextWidth = len(strText) * 10 'iTextWidth = 100 Response.Write "" _ & "" Do until strColor = strColor2 count = count + 1 intNum1a = CheckNum(intNum1a,color1A,color2A)'<-------necessary intNum1b = CheckNum(intNum1b,color1B,color2B)'<-------necessary intNum1c = CheckNum(intNum1c,color1C,color2C)'<-------necessary strColor = smartHex(intNum1a) & smartHex(intNum1b) & smartHex(intNum1c) intNum1a = int("&H" & intNum1a) intNum1b = int("&H" & intNum1b) intNum1c = int("&H" & intNum1c) Response.Write "" If len(strColor) > 6 Then Response.Write "Error: Hex Number has surpassed the 6 digit limit." exit Do else if len(strColor) < 6 Then Response.Write "Error: Hex Number is less than the 6 digits." exit Do End If End If loop if strText > "" then Response.Write "" end if Response.Write "
" if strText > "" then Response.Write "" _ & " " & strText & "" end if Response.Write "" _ & "
" _ & "

" end function %>