
var IMG_NUM = 9;
var index = Math.ceil(Math.random() * IMG_NUM);

function ir_next() {
	index = (index % IMG_NUM) + 1;
	document.getElementById("rightside").src = ir_format(index);
}

function ir_prev() {
	index = ((index - 2 + IMG_NUM) % IMG_NUM) + 1;
	document.getElementById("rightside").src = ir_format(index);
}

function ir_format(num) {
	return "images/img" + ((num < 10) ? ("0" + num) : num) + ".jpg";
}


document.write("<a href=\"#\" onclick=\"ir_prev(); return false;\" style=\"color: black !important\">&laquo; prev</a> | <a href=\"#\" onclick=\"ir_next(); return false;\" style=\"color: black !important\">next &raquo;</a><br />");
document.write("<img src=\"" + ir_format(index) + "\" id=\"rightside\" alt=\"Latino Studies\" />");