var img_photos, img_text, img_which;

function img_init(img_p, img_t) {
 img_photos=img_p;
 img_text=img_t;
 img_which=0;
 img_update();
}

function img_update() {
 document.getElementById("img_space").innerHTML='<em>#' + (img_which+1).toString() + ': ' + img_text[img_which] + '</em><br><a href="#" onClick="img_back(); return false;">[Previous Image]</a>&nbsp;&nbsp;<a href="#" onClick="img_fwd(); return false;">[Next Image]</a><br><br><img src="' + img_photos[img_which] + '">';
}

function img_back(){
 img_which = (img_which+img_photos.length-1)%img_photos.length;
 img_update();
}

function img_fwd(){
 img_which = (img_which+1)%img_photos.length;
 img_update();
}
