User:Meagan/DotOrg/files/mouseover.js

function init {	if (document.getElementById) var x = document.getElementById('mouseovers').getElementsByTagName('IMG'); else if (document.all) var x = document.all['mouseovers'].all.tags('IMG'); else return; var preloads = new Object; for (var i=0;i<x.length;i++) {		preloads['n'+x[i].id] = new Image; preloads['n'+x[i].id].src = 'pix/'+ x[i].id + '_nrm.jpg'; preloads['o'+x[i].id] = new Image; preloads['o'+x[i].id].src = 'pix/'+ x[i].id + '_omo.jpg'; preloads['o'+x[i].id].onerror = function {this.src='pix/default.gif'} x[i].onmouseover = function {this.src=preloads['o'+this.id].src;} x[i].onmouseout = function {this.src=preloads['n'+this.id].src;} x[i].onclick = function {location.href=this.id + '.html'} } }