//specify list of random background colors to apply to CSS class "randomcolor"
//For each entry, you can optionally specify a text and link color via the syntax:
// "BackgroundColor:TextColor" OR "BackgroundColor:TextColor:LinkColor"
var randombgcolors=[ "/i/bg1a.jpg", "/i/bg2a.jpg", "/i/bg3a.jpg"]

var rbcssrule=""
var randomnum=Math.floor(Math.random()*randombgcolors.length)
if (randombgcolors[randomnum].indexOf(":")!=-1){
rbcssrule="background-image: url("+randombgcolors[randomnum]+");"
rbcssrule+="color: "+randombgcolors[randomnum]+";"
}
else
rbcssrule="background-image: url("+randombgcolors[randomnum]+");"

document.write('<style type="text/css">\n')
document.write('.randomcolor{'+rbcssrule+'}\n')
if (randombgcolors[randomnum].split(":").length==3) //if link color specified
document.write('.randomcolor a{color:'+randombgcolors[randomnum]+';}\n')
document.write('<\/style>')
