Javascript source

This javascript will change the background color every week of the month (5 total). I wrote this one when I got tired of seeing the same background colors on my site...but I didn't feel like changing every page. Since bgcolor is an attribute of the BODY tag, you can use different link and text colors to match the background used. There is a default bgcolor provided for those using a browser that doesn't support javascript (or who surf with javascript turned off).

This script is a bit different for me. It's the first time I've found a practical use for doing a javascipt include file. If later on you decide you don't like your color schemes, you only need to edit the include file for changes to be reflected in every HTML file using it *s*   Save this exactly as it is--don't include the <SCRIPT> or <NOSCRIPT> tags--into a file with the extension .js

See how it's used       Grab the source

See more javascripts
<!-- start hiding
// Written by:
//   C. Schaar  aka sleepy
//   http://www.geocities.com/Heartland/Hollow/1000/

var Day_of_Month = new Date( )
Day = Day_of_Month.getDate( )

if (Day < 7)
{
document.write("<BODY BGCOLOR='99CCFF' TEXT='330066' LINK='003399' VLINK='660000' ALINK='660000'>")
}

else if (Day < 14)
{
document.write("<BODY BGCOLOR='CC99FF' TEXT='000033' LINK='660000' VLINK='003366' ALINK='003366'>")
}

else if (Day < 21)
{
document.write("<BODY BGCOLOR='FFCC99' TEXT='993300' LINK='663300' VLINK='CC6600' ALINK='CC6600'>")
}

else if (Day < 28)
{
document.write("<BODY BGCOLOR='00FFCC' TEXT='000066' LINK='003300' VLINK='006666' ALINK='006666'>")
}

else
{
document.write("<BODY BGCOLOR='FFCCCC' TEXT='660000' LINK='CC6600' VLINK='660099' ALINK='660099'>")
}
// stop hiding -->





Copyright ©1997-2001  Charlene C. Schaar
All rights reserved.

Hosted by www.Geocities.ws

1