if (window.addEventListener) window.addEventListener("load", swap_preview, false);
if (window.attachEvent) window.attachEvent("onload", swap_preview);

function swap_preview() {
	
	box = $('previewbox');	

	swappers = document.getElementsByClassName('swap_preview');
	
	for(i=0;i<swappers.length;i++) {
    	swappers[i].onmouseover = swapIn;
    }

	// Initialize with the first image
	box.style.backgroundImage = "url(" + swappers[0].href + ")";
}

function swapIn() {
	box.style.backgroundImage = "url(" + this.href + ")";
}