//Functions for GUESTBOOK
function suredelete(id)
{
	var check;
	check = confirm("Soll dieser GB-Eintrag wirklich gelöscht werden?");
	if(check==true)
	{	
		document.delForm.GB_ID.value = id;
		document.delForm.submit();
	}
}

// -----------------------------------------------------------------------------------------
function suredeleteMusikant(id,name)
{
	var check;
	check = confirm("Soll der Musikant '" + name + "' wirklich gelöscht werden?");
	if(check==true)
	{
		window.location.href = "delete_musikant.php?id="+id;
	}
}

function suredeleteTermin(id,name)
{
	var check;
	check = confirm("Soll der Termin '" + name + "' wirklich gelöscht werden?");
	if(check==true)
	{
		window.location.href = "delete_termin.php?id="+id;
	}
}

function suredeleteFoto()
{
	var check;
	check = confirm("Soll dieses Foto wirklich gelöscht werden?");
	if(check==true)
	{
		var id;
		var temp = document.getElementById("displaypic").src;
		id = temp.substring(temp.indexOf("/fotos")+1,temp.length);
		window.location.href = "delete_foto.php?id="+id;
	}
}


function swapBackground(strImg)
{
	document.getElementById('body').style.backgroundImage = "url("+strImg+")";
}

function aufmachen(breite,id,startsize)
{
	document.getElementById("portrait_pic").style.display="none";
	if (startsize < breite)
	{
		document.getElementById(id).style.display="inline";
		document.getElementById(id).style.width=startsize+"px";
		//document.getElementById("area_portrait").style.marginLeft="-"+(startsize/16)+"px";
		//document.getElementById("bereich_"+id).style.marginTop=document.getElementById("bereich_"+id).style.marginTop.substring(0,-2)+4+"px";
		startsize += 20; 
		window.setTimeout("aufmachen("+breite+",'"+id+"',"+startsize+")",0);
	}
	else
	{
		document.getElementById(id).style.display="inline";
		
	}
}

function zumachen(id)
{
	document.getElementById("portrait_pic").style.display="block";
	document.getElementById(id).style.display="none";
}


function showFoto(id, thumb)
{
	document.getElementById("displaypic").src = "";
	document.getElementById("displaypic").src = id;
	document.getElementById("displaypic").alt = document.getElementById(thumb).alt;
	try
	{
		document.getElementById("fototext").innerHTML = document.getElementById(thumb).alt;
	}
	catch(exception)
	{
		document.editCommentForm.Beschreibung.value = document.getElementById(thumb).alt;
		document.editCommentForm.Fotoname.value     = id;
	}
}

function moveFotoPrev()
{
	var id;
	var temp = document.getElementById("displaypic").src;
	id = temp.substring(temp.indexOf("/fotos")+1,temp.length);
	window.location.href = "move_foto_prev.php?id="+id;
}

function moveFotoNext()
{
	var id;
	var temp = document.getElementById("displaypic").src;
	id = temp.substring(temp.indexOf("/fotos")+1,temp.length);
	window.location.href = "move_foto_next.php?id="+id;
}

