If you want to change the background image as seldom as once a
week(month/day) you can set a scheduled job which will change your web
servers rewrite rule for your background image.
If you want it done more often (on rotation basis) you are better of
using some sort of server side script to generate the image (or image
name) dynamically...
see
http://mindprod.com/jgloss/pseudorandom.html
For how to get an integer you can use to select the image.
You can xor in the name of the page (as hashCode), or today's date, as
time divided by millis per day as the seed to make the selection
depend on date or page, not changing every time.
Here is the guts of one of my static macros that selects a daily quote
for each page:
/**
* expand Quotation macro guts
*
* @param fileBeingProcessed file where macros are embedded.
*
* @return on of the choice strings, randomly chosen
*/
private String expand( File fileBeingProcessed )
{
// use today as a seed so will generate same value for
24-hours
// using GMT elapsedTime. Flip will happen at midnight GMT or
4 PM PST.
// Reproducible every time we run this macro that day.
// Xor in hashCode of filename to give a different quote to
different pages.
final Random wheel =
new Random( fileBeingProcessed.getPath().hashCode()
^ ( System.currentTimeMillis() / ( 24
* 60
* 60
* 1000
) ) );
final String chosenQuote = QUOTATIONS[ wheel.nextInt(
QUOTATIONS.length ) ];
return "<blockquote>"
+ chosenQuote
+ "</blockquote>";
}