This JavaScript (embedded into HTML) generates colors for modification dates in the list of classified tagline sections. Colors are chosen in such a way, that brighter colors correspond to more recently modified items:
  | Fuchsia | – Modified within | last week. |
Red | – Modified within | last month. | |
Brown | – Modified within | last 3 months. | |
Black | – Modified beyond | last 3 months. |
To make script simple and quick it is assumed that any year contains 365 days and any month contains 30 days. This might cause a slight imprecision on the border lines, but it's not important here, since colors serve only to hilight the most recent changes and dates are present anyway.
Script is fairly simple: date and color arrays are declared and date array gets initialized by last modification dates for the corresponding sections (when something is changed in the section, current date should be entered into this script — this doesn't happen very often). Day number of script execution is evaluated and is compared with each of the dates in the array. Date difference drives the choice of colors to be saved in the color array. Saved colors are used in the body of HTML as the color attributes of the corresponding dates in the document.write lines.
<!-- Tagline Selection 01/08/1998–08/15/2001 --> <!-- ----------------------------------------- 05/25/1999 --> <!-- www.davar.net/MISCL/TAGLINES/TAGLINES.HTM --> <!-- Copyright (C) 1998–2000 by Vladimir Veytsel --> <HTML> <HEAD> <TITLE>Tagline Selection (Miscellaneous at Davar Web Site)</TITLE> <META HTTP-EQUIV="Content-Type" CONTENT="Text/HTML; CharSet=ISO-8859-1"> <META NAME = Description CONTENT ="Page: Tagline Selection. Site: Davar Web Site, Computer Science, Programming, Mainframe, UNIX, PC, Internet, Mathematics, Go, Zen, Quotations, Extracts, Humor, Russian."> <META NAME = Keywords CONTENT ="Davar Web Site, Tagline, Taglines"> <META NAME = Author CONTENT="Vladimir Veytsel"> </HEAD> <NOSCRIPT> <BODY BACKGROUND="../../PAPER010.JPG" BGCOLOR=White TEXT=Black LINK=Blue ALINK=Fuchsia VLINK=Purple> </NOSCRIPT> <SCRIPT LANGUAGE=JavaScript> <!-- if (sessionStorage.getItem("BG")=="On") {N=Math.floor(Math.random()*9)%9+1 document.write("<BODY BACKGROUND='../../PAPER0",N,"0.JPG' BGCOLOR=White TEXT=Black LINK=Blue ALINK=Fuchsia VLINK=Purple>") DT = new Array(0) // Date array (dynamically sized; starts from "0" - not used) CT = new Array(0) // Color array (dynamically sized; starts from "0" - not used) DT[1]="05/24/1999" // Random DT[2]="03/06/1998" // Wisdom DT[3]="03/06/1998" // Humor DT[4]="03/06/1998" // Computer DT[5]="03/06/1998" // Corporate DT[6]="03/06/1998" // Political DT[7]="06/15/1998" // Adult DT[8]="03/06/1998" // General Today =new Date() Cur_Date=365*Today.getFullYear()+30*(Today.getMonth()+1)+Today.getDate() for (i=1;i<DT.length;i++) {Month=Number(DT[i].substr(0,2)) Day =Number(DT[i].substr(3,2)) Year =Number(DT[i].substr(6)) Mod_Date=365*Year+30*Month+Day Diff=Cur_Date-Mod_Date CT[i]="Black" // Modified beyond last 3 months if (Diff<=90) CT[i]="Brown" // Modified during last 3 months if (Diff<=30) CT[i]="Red" // Modified during last month if (Diff<=7) CT[i]="Fuchsia" // Modified during last week } //--> </SCRIPT> <!-- Page: Tagline Selection. Site: Davar Web Site, Computer Science, Programming, Mainframe, UNIX, PC, Internet, Mathematics, Go, Zen, Quotations, Extracts, Humor, Russian. --> <FONT FACE="Times New Roman" SIZE=3> <FONT SIZE=5 COLOR=Red><B><I><U>Tagline Selection</U></I></B></FONT> <BR> <TABLE> <TR> <TD> </TD> <TD><B><A HREF="RANDTAGL.HTM">Random</A></B></TD> <TD> </TD> <TD><FONT SIZE='-1'><I>04/21/1998 <NOSCRIPT>– 1999</FONT></I></NOSCRIPT> <SCRIPT LANGUAGE=JavaScript> <!-- document.write("– <FONT COLOR=",CT[1],">",DT[1],"</FONT></FONT></I>") //--> </SCRIPT> </TD> <TD> </TD> <TD><I>Random tagline samples</I></TD> </TR> <TR> <TD></TD> <TD><B><A HREF="WISDOM.HTM">Wisdom</A></B></TD> <TD></TD> <TD><FONT SIZE='-1'><I>03/03/1998 <NOSCRIPT>– 1998</FONT></I></NOSCRIPT> <SCRIPT LANGUAGE=JavaScript> <!-- document.write("– <FONT COLOR=",CT[2],">",DT[2],"</FONT></FONT></I>") //--> </SCRIPT> </TD> <TD></TD> <TD><I>"Doing it the hard way is always easier."</I></TD> </TR> <TR> <TD></TD> <TD><B><A HREF="HUMOR.HTM">Humor</A></B></TD> <TD></TD> <TD><FONT SIZE='-1'><I>12/21/1997 <NOSCRIPT>– 1998</FONT></I></NOSCRIPT> <SCRIPT LANGUAGE=JavaScript> <!-- document.write("– <FONT COLOR=",CT[3],">",DT[3],"</FONT></FONT></I>") //--> </SCRIPT> </TD> <TD></TD> <TD><I>"Just a possum on the information superhighway..."</I></TD> </TR> <TR> <TD></TD> <TD><B><A HREF="COMPUTER.HTM">Computer</A></B></TD> <TD></TD> <TD><FONT SIZE='-1'><I>03/03/1998 <NOSCRIPT>– 1998</FONT></I></NOSCRIPT> <SCRIPT LANGUAGE=JavaScript> <!-- document.write("– <FONT COLOR=",CT[4],">",DT[4],"</FONT></FONT></I>") //--> </SCRIPT> </TD> <TD></TD> <TD><I>"Become a programmer and never see the world!"</I></TD> </TR> <TR> <TD></TD> <TD><B><A HREF="CORPORAT.HTM">Corporate</A></B></TD> <TD></TD> <TD><FONT SIZE='-1'><I>03/03/1998 <NOSCRIPT>– 1998</FONT></I></NOSCRIPT> <SCRIPT LANGUAGE=JavaScript> <!-- document.write("– <FONT COLOR=",CT[5],">",DT[5],"</FONT></FONT></I>") //--> </SCRIPT> </TD> <TD></TD> <TD><I>"The scenery only changes for the lead dog."</I></TD> </TR> <TR> <TD></TD> <TD><B><A HREF="POLITICS.HTM">Political</A></B></TD> <TD></TD> <TD><FONT SIZE='-1'><I>03/04/1998 <NOSCRIPT>– 1998</FONT></I></NOSCRIPT> <SCRIPT LANGUAGE=JavaScript> <!-- document.write("– <FONT COLOR=",CT[6],">",DT[6],"</FONT></FONT></I>") //--> </SCRIPT> </TD> <TD></TD> <TD><I>"An honest politician: One who stays bought."</I></TD> </TR> <TR> <TD></TD> <TD><B><A HREF="ADULT.HTM">Adult</A></B></TD> <TD></TD> <TD><FONT SIZE='-1'><I>03/05/1998 <NOSCRIPT>– 1998</FONT></I></NOSCRIPT> <SCRIPT LANGUAGE=JavaScript> <!-- document.write("– <FONT COLOR=",CT[7],">",DT[7],"</FONT></FONT></I>") //--> </SCRIPT> </TD> <TD></TD> <TD><I>"A man without a woman is like a neck without pain."</I></TD> </TR> <TR> <TD></TD> <TD><B><A HREF="GENERAL.HTM">General</A></B></TD> <TD></TD> <TD><FONT SIZE='-1'><I>03/05/1998 <NOSCRIPT>– 1998</FONT></I></NOSCRIPT> <SCRIPT LANGUAGE=JavaScript> <!-- document.write("– <FONT COLOR=",CT[8],">",DT[8],"</FONT></FONT></I>") //--> </SCRIPT> </TD> <TD></TD> <TD><I>"Evolution stops when stupidity is no longer fatal."</I></TD> </TR> </TABLE> <I> <BR> <FONT COLOR=Green>Go to</FONT> <A HREF="../../index.htm">Davar site entry</A> <FONT COLOR=Green>Go to</FONT> <A HREF="../../CNT.HTM">Site contents</A> <FONT COLOR=Green>Go to</FONT> <A HREF="../../IND.HTM">Site index</A> <FONT COLOR=Green>Go to</FONT> <A HREF="../MISCL.HTM">Miscellaneous</A> </I> </FONT> </BODY> </HTML>