var start_pic_num = 1;
var act_pic_num = 1;
var max_pic_num = 4;
	
function set_slideshow_start(nr) { start_pic_num = nr; }

function set_slideshow_count(nr) { max_pic_num = nr; }
	
function next_slideshowpic() {
	act_pic_num ++;
	if (act_pic_num > max_pic_num) act_pic_num = 1;
	show_slidepopup(act_pic_num);
}

function prev_slideshowpic() {
	act_pic_num --;
	if (act_pic_num < 1) act_pic_num = max_pic_num;
	show_slidepopup(act_pic_num);
}
	
function show_slidepopup(nr) {
	var show_nr = start_pic_num + nr - 1;
	act_pic_num = nr;

	var posY = 0;
	if (self.pageYOffset) // all except Explorer
	{ posY = self.pageYOffset; }
	else if (document.documentElement && document.documentElement.scrollTop)
		// Explorer 6 Strict
	{ posY = document.documentElement.scrollTop; }
	else if (document.body) // all other Explorers
	{ posY = document.body.scrollTop; }

	var h = 1024
	var w = 768;
	if (self.innerHeight) // all except Explorer
	{ h = self.innerHeight;	}
	else if (document.documentElement && document.documentElement.clientHeight)
		// Explorer 6 Strict Mode
	{ h = document.documentElement.clientHeight; }
	else if (document.body) // other Explorers
	{ h = document.body.clientHeight; }

	posY = Math.max(Math.round((h - 400) / 2), 125) + posY;

	document.images["popuppicture"].src = "/img/slideshow/p" + show_nr + ".jpg"
	document.getElementById("slidepopup").style.visibility = "visible";
	document.getElementById("slidepopup").style.top = posY;
	document.getElementById("slideshowcount").value = act_pic_num + "/" + max_pic_num;
}
	
function close_slidepopup() {
	document.getElementById("slidepopup").style.visibility = "hidden";
	document.images["popuppicture"].src = "/img/slideshow/nothing.jpg";
}

function bottom_pic_over(nr) {
	document.getElementById("bottompic" + nr).style.borderColor = "#000000";
}

function bottom_pic_out(nr) {
	document.getElementById("bottompic" + nr).style.borderColor = "#7B807C";
}