
var num = 0;
function changeImage(direction) {
	//alert(num);
	if (direction == "prev") {
		num--;
	} else {
		num++;
	}
	
	if (num < 0) {
		num = ($$('.slide img').length-1);
	}
	else if (num >= ($$('.slide img').length)) {
		num = 0;
	}
	
	$$('.slide img').invoke('hide');
	$$('.slide img')[num].show();
	$$('#mycaption span').invoke('hide');
	$$('#mycaption span')[num].show();
	
	$('myimagenum').innerHTML = "Image "+(num+1)+" of "+$$('.slide img').length
	
	return false;
}