// JavaScript Document
    var currentimage = 1;

function scrollRight() {

	var i = document.getElementById('acentro').offsetLeft;
	var s = document.getElementById('acentro').offsetWidth;
	var position = i * -1;
	var size = s - 1000;
	var start = s - 720;
	var fl = s / 680;
	var numberposts = parseInt(fl);
	var txt = " of ";
    var info = currentimage + txt + numberposts;
	

if (position >= size) {	
currentimage = 1;

new Effect.Move('acentro', {
	x: start, y: 0, mode: 'relative',
 	transition: Effect.Transitions.linear,
	duration: 0.2});
info = currentimage + txt + numberposts;
document.getElementById("galleryInfo").innerHTML=info;


}
	else {		

new Effect.Move('acentro', {
	x: -680, y: 0, mode: 'relative',
 	transition: Effect.Transitions.linear,
	duration: 0.1});
	++currentimage;
	info = currentimage + txt + numberposts;
document.getElementById("galleryInfo").innerHTML=info;
	}
}



function scrlLeft() {
	var s = document.getElementById('acentro').offsetWidth;
	var fl = s / 680;
	var numberposts = parseInt(fl);
	var txt = " of ";
    var info = currentimage + txt + numberposts;
	var position = document.getElementById('acentro').offsetLeft;
	
if (position >= -100) {	
currentimage = 1;
	document.getElementById("galleryInfo").innerHTML=info;

}
	else {	

	new Effect.Move('acentro', {
	x: 680, y: 0, mode: 'relative',
 	transition: Effect.Transitions.linear,
	duration: 0.1
	});
	--currentimage;
	info = currentimage + txt + numberposts;
document.getElementById("galleryInfo").innerHTML=info;
 	
}
}

function captionAppear() {
	
new Effect.Opacity('captionWrapper', { from: 0, to: 0.8, duration: 0.2 });
}

function captionFade() {
new Effect.Opacity('captionWrapper', { from: 0.8, to: 0, duration: 0.2 })
}