window.onload = function rolloverInit(){
	//Directory
	dirs=window.location.href.split('/'),
	cdir=dirs[dirs.length-2];
	
	//console.log(cdir);
	for (var i=0; i<document.images.length; i++){
		if (document.images[i].id) {
			if (document.images[i].id != "lightboxImage") {
				setupRollover(document.images[i]);
			}
		}
	}
}

function setupRollover(thisImage) {
	thisImage.outImage = new Image();
	thisImage.outImage.src = "/_img/examples/" + cdir + "/" + thisImage.id + "1.jpg";
	thisImage.onmouseout = rollOut;
	
	thisImage.overImage = new Image();
	thisImage.overImage.src = "/_img/examples/" + cdir + "/" + thisImage.id + "2.jpg";
	thisImage.onmouseover = rollOver;
}

function rollOut(){
	this.src = this.outImage.src;
}

function rollOver(){
	this.src = this.overImage.src;
}
	