I came upon this code at JavaScript Source and thought it would be perfect for our site. I work on a local historical website ([url]http://www.petroliaheritage.com
I would appreciate any assistance you can give me.
Thanks
Dan
<SCRIPT LANGUAGE=”JavaScript”>
<!– This script and many more are available free online at –>
<!– The JavaScript Source!! [url]http://javascript.internet.com
<!– Begin
function randomBg() {
var expDays = 30;
var exp = new Date();
exp.setTime(exp.getTime() + (expDays*24*60
var hex1=new Array(“0”, “1”, “2”, “3”, “4”, “5”, “6”, “7”, “8”, “9”, “A”, “B”, “C”, “D”, “E”, “F”)
var hex2=new Array(“0”, “1”, “2”, “3”, “4”, “5”, “6”, “7”, “8”, “9”, “A”, “B”, “C”, “D”, “E”, “F”)
var hex3=new Array(“0”, “1”, “2”, “3”, “4”, “5”, “6”, “7”, “8”, “9”, “A”, “B”, “C”, “D”, “E”, “F”)
var hex4=new Array(“0”, “1”, “2”, “3”, “4”, “5”, “6”, “7”, “8”, “9”, “A”, “B”, “C”, “D”, “E”, “F”)
var hex5=new Array(“0”, “1”, “2”, “3”, “4”, “5”, “6”, “7”, “8”, “9”, “A”, “B”, “C”, “D”, “E”, “F”)
var hex6=new Array(“0”, “1”, “2”, “3”, “4”, “5”, “6”, “7”, “8”, “9”, “A”, “B”, “C”, “D”, “E”, “F”)
var bg=”#”+hex1[Math.floor(Math.random()*hex1.length)]+hex2[Math.floor(Math.random()*hex3.length)]+hex4[Math.floor(Math.random()*hex5.length)]+hex6[Math.floor(Math.random()
document.bgColor = bg
document.colorChange.colorValue.value = bg
document.colorChange.text.value = “”;
}
// End –>
</script>
</head>
<body bgcolor=008080>
<form name=”colorChange”>
<input type=”button” value=”Random Background” onClick=”randomBg()”>
</form>