
var imageDefs = [
{ title: 'Immagine 1', src: 'img/port1.jpg'}, 
{ title: 'Immagine 2', src: 'img/port2.jpg'}, 
{ title: 'Immagine 3', src: 'img/port3.jpg'}, 
{ title: 'Immagine 4', src: 'img/port4.jpg'}, 
{ title: 'Immagine 5', src: 'img/port5.jpg'}, 
{ title: 'Immagine 6', src: 'img/port6.jpg'}, 
{ title: 'Immagine 7', src: 'img/port7.jpg'}, 
{ title: 'Immagine 8', src: 'img/port8.jpg'}, 
{ title: 'Immagine 9', src: 'img/port9.jpg'}, 
{ title: 'Immagine 10', src: 'img/port10.jpg'}, 
{ title: 'Immagine 11', src: 'img/port11.jpg'}, 
{ title: 'Immagine 12', src: 'img/port12.jpg'}, 
{ title: 'Immagine 13', src: 'img/port13.jpg'}, 
{ title: 'Immagine 14', src: 'img/port14.jpg'}, 
{ title: 'Immagine 15', src: 'img/port15.jpg'}, 
{ title: 'Immagine 16', src: 'img/port16.jpg'}, 
{ title: 'Immagine 17', src: 'img/port17.jpg'}, 
{ title: 'Immagine 18', src: 'img/port18.jpg'}, 
{ title: 'Immagine 19', src: 'img/port19.jpg'}, 
{ title: 'Immagine 20', src: 'img/port20.jpg'}, 
{ title: 'Immagine 21', src: 'img/port21.jpg'}, 
{ title: 'Immagine 22', src: 'img/port22.jpg'}, 
{ title: 'Immagine 23', src: 'img/port23.jpg'}, 
{ title: 'Immagine 24', src: 'img/port24.jpg'}, 
{ title: 'Immagine 25', src: 'img/port25.jpg'}, 
{ title: 'Immagine 26', src: 'img/port26.jpg'}, 
{ title: 'Immagine 27', src: 'img/port27.jpg'}, 
{ title: 'Immagine 28', src: 'img/port28.jpg'}, 
{ title: 'Immagine 29', src: 'img/port29.jpg'}, 
{ title: 'Immagine 30', src: 'img/port30.jpg'}];

var index = 0;


function changeImage(i)
{
$('portfolio').childElements()[index].removeClassName('activeport');
var img = document.getElementById('the-image');
img.alt = img.title = imageDefs[i].title;
img.src = imageDefs[i].src;
$('portfolio').childElements()[i].addClassName('activeport');
index = i;
}

function next() {
var i = index + 1;
if (i >= imageDefs.length) i = 0;
changeImage(i);
}

function prev() {
var i = index - 1;
if (i < 0) i = imageDefs.length - 1;
changeImage(i);
}


//section = 0;

//function changeSez(section) {
//	$('navi').childElements(li)[section].addClassName('active');
//	var link = document.getElementById('link-1');
//}