/* Copyright (c) 2004 - fulspec.com */
var curr_picture = 1;
var x0 = 0; x1 = 0;
var sflag = false;
var dir = '';
function init() {
var len = comment.length;
var photoTBL = '
';
for (i=1; i<(len+1); i++) {
photoTBL += ' | ';
}
photoTBL += '
';
document.getElementById('photos').innerHTML = photoTBL;
document.getElementById('comment').innerHTML = comment[0];
return true;
}
function insert_comment() {
document.getElementById('comment').innerHTML = comment[(curr_picture-1)];
}
function scroll(dc) {
if (x0 == x1) {
sflag = true;
dir = dc;
scrollit();
}
}
function scrollit() {
if (x0 == x1) {
if (sflag && (dir == 'L') && (curr_picture < comment.length)) {
curr_picture += 1;
x1 = (1-(curr_picture)) * 120;
} else if (sflag && (dir == 'R') && (curr_picture > 1)) {
curr_picture -= 1;
x1 = (1-(curr_picture)) * 120;
} else {
insert_comment();
return true;
}
}
setTimeout("incrscroll()",20);
}
function incrscroll() {
var step = 10;
var dir = (x0 > x1) ? -1 : 1;
x0 += (step * dir);
document.getElementById('photos').style.left = x0 +'px';
scrollit();
}
function stop() {
sflag = false;
}
function popupDiv(no) {
if (no == 0) {
document.getElementById('blowup').style.visibility = 'hidden';
} else {
var graphic = '+ '.jpg)
';
document.getElementById('blowup').innerHTML = graphic+ '' +comment[(no-1)]+ '
';
document.getElementById('blowup').style.visibility = 'visible'
}
return false;
}
window.onload = init;