window.onload = add_id;
var isrc = ["http://www.rjmprogramming.com.au/wordpress/wp24.jpg", "http://www.rjmprogramming.com.au/wordpress/wp25.jpg", "http://www.rjmprogramming.com.au/wordpress/wp27.jpg", "http://www.rjmprogramming.com.au/wordpress/wp28.jpg"];
var tds = [], tables = [];
var sinv;
var defcolours = ["White", "Silver", "Gray", "Black", "Red", "Maroon", "Yellow", "Olive", "Lime", "Green", "Aqua", "Teal", "Blue", "Navy", "Fuchsia", "Purple"];
var favcol = " ";
var selprefix = "
";
function swap_imgs() {
var j, otd, oimg, rnum, oldsrc, isrcrnum = "", r, g, b;
var arr=['0','1','2','3','4','5','6','7','8','9','a','b','c','d','e','f'];
for (j=0; j" + eval((j + 1)) + " " + otd.innerHTML.trim() + "";
if (j == 0) {
document.body.innerHTML = "Static HTML Made More Dynamic by Javascript DOM
" + selprefix + selsuffix + "
" + document.body.innerHTML;
tables[0].align = 'center';
document.getElementById('favcol').value = favcol;
}
} else {
oldsrc = document.getElementById("a" + eval((j + 1))).title;
otd.innerHTML = otd.innerHTML.replace(oldsrc, isrcrnum).replace(oldsrc, isrcrnum).replace(oldsrc, isrcrnum).replace(oldsrc, isrcrnum);
}
}
rnum = Math.floor(Math.random() * defcolours.length) + 0;
if (favcol.trim() == "") {
tables[0].style.backgroundColor = defcolours[rnum];
} else if (favcol.trim() == "N") {
r = Math.floor((Math.random()*256)+0);
g = Math.floor((Math.random()*256)+0);
b = Math.floor((Math.random()*256)+0);
tables[0].style.backgroundColor = '#' + arr[(r-(r % 16)) / 16] + arr[r % 16] + arr[(g-(g % 16)) / 16] + arr[g % 16] + arr[(b-(b % 16)) / 16] + arr[b % 16];
} else {
tables[0].style.backgroundColor = otd.style.color;
}
rnum = Math.floor(Math.random() * 20) + 0;
tables[0].cellPadding = rnum;
rnum = Math.floor(Math.random() * 20) + 0;
tables[0].cellSpacing = rnum;
}
function add_id() {
var i;
var imgs = document.getElementsByTagName("img");
if (favcol == " ") {
favcol = location.search.split("favcol=")[1] ? location.search.split("favcol=")[1].split("&")[0] : "";
for (i=0; i" + defcolours[i] + "";
}
}
for (i=0; i