var hwr4pictures	= new Array();
var hwr4pictures_current	= 0;

function hwr4gallery_next() {
	if(hwr4pictures.length>hwr4pictures_current+1) {
		hwr4pictures_current+= 1;
		hwr4gallery_setImg();
		return true;
	}
	return false;
}

function hwr4gallery_prev() {
	if(0<hwr4pictures_current) {
		hwr4pictures_current-= 1;
		hwr4gallery_setImg();
		return true;
	}
	return false;
}

function hwr4gallery_setImg() {
	document.getElementById('hwr4gallery_mainpic').src	= hwr4pictures[hwr4pictures_current][2];
	
		var img_anim	= new YAHOO.util.Anim("hwr4gallery_mainpic", { width: { to: hwr4pictures[hwr4pictures_current][3]}, height: { to: hwr4pictures[hwr4pictures_current][4]} }, 0.2, YAHOO.util.Easing.easeOut);
		img_anim.animate();
		
	document.getElementById('hwr4gallery_name_top').innerHTML	= 'Bild '+(hwr4pictures_current+1)+' / '+hwr4pictures.length;
	document.getElementById('hwr4gallery_subtitle').innerHTML	= hwr4pictures[hwr4pictures_current][1];
	document.getElementById('hwr4gallery_subtitle').style.visibility	= (""==hwr4pictures[hwr4pictures_current][1].replace(" ", "")) ? 'hidden' : 'visible';
	
	return true;
}

function hwr4gallery_slideshow() {
	if(hwr4gallery_next()) window.setTimeout('hwr4gallery_slideshow()', 3000);
}