var index = 0;
var path = 'img/content/daily_images/';
imgList = new Array();


function init(){
	if(imgList[0]){
		$('beschreibung').innerHTML = imgList[0].description;
		$('mainFullImage').src = path + imgList[0].image;
		$('slideshow').style.display = "block";
		$('loader').style.display = "none";
	}
}


function onFinished(pos, id, path) {
	$(id).src = path + imgList[pos].image;
	$(id).style.width = $('med_'+pos).style.width;
	$(id).style.height = $('med_'+pos).style.height;
	$('beschreibung').innerHTML = imgList[pos].description;
	new Effect.Opacity(id, {fps:25, duration:0.5, from:0, to:1 });
}

var nextImage = function(pos){
	index += pos;
	if(index < 0) index = imgList.length-1;
	if (index > imgList.length-1) index = 0;
	new Effect.Opacity('mainFullImage', {fps:25, duration:0.4, from:1, to:0, afterFinish: function() { onFinished(index, 'mainFullImage', path); }});
}

function onFinishedFade(mode){
	if(mode == "show"){
		$('content').toggle();
		$('full').toggle();
		new Effect.Opacity('full', {fps:25, duration:0.4, from:0, to:1});
	}
}

var hideFull = function(){
	$('content').hide();
	$('contentFull').show();
}

function change(id, img){
	$(id).src = path + "images/" +  img;
}

