var text1 = "";
var text2 = ""
var photo_album_id = 0;

	function upload_teaser(status)
	{
		if (status == 1)
			document.getElementById('upload_photo').style.textDecoration = "underline";
		else
			document.getElementById('upload_photo').style.textDecoration = "";
	}

	last_id = "";

	function photo_abfrage (gid)
	{
		if (confirm (text1))
		{
			location.href = "photo_album.html?gid=" + gid + "&action=delete";
		}
		else
		{
		}
	}

	function abfrage_photo (photo_id)
	{
		if (confirm (text2))
		{
			location.href = "photo_album.html?photo_id=" + photo_id + "&action=delete&photo_album_id=" + photo_album_id;
		}
		else
		{
		}
	}

	function show_edit(id)
	{

		if (last_id != "")
		{
			document.getElementById(last_id).style.display = "none";
			document.getElementById('album_box_'+last_id).style.filter = "alpha(opacity=100)";
			document.getElementById('album_box_'+last_id).style.MozOpacity = "1";
		}

		document.getElementById(id).style.display = "block";

		document.getElementById('album_box_'+id).style.filter = "alpha(opacity=50)";
		document.getElementById('album_box_'+id).style.MozOpacity = "0.5";

		last_id = id;
	}

	function hide_edit()
	{

		if (last_id != "")
		{
			document.getElementById(last_id).style.display = "none";
			document.getElementById('album_box_'+last_id).style.filter = "alpha(opacity=100)";
			document.getElementById('album_box_'+last_id).style.MozOpacity = "1";
		}
	}

	function upload_photo(input)
	{
		progress();
		document.forms['upload_form'].submit();
	}

	function upload_complete(status, url, error_type)
	{
		if (status == "success")
		{
			window.location.href = request_url;
		}
		else if (status == "error")
		{
			if (error_type == "filesize")
			{
				document.getElementById("error_photo_filesize").style.display = "block";
			}

			if (error_type == "filetype")
			{
				document.getElementById("error_photo_filetype").style.display = "block";
			}

			if (error_type == "nofile")
			{
				document.getElementById("error_photo_nofile").style.display = "block";
			}

			document.getElementById("uploading").style.display = "none";
		}
	}

	function progress()
	{
		if (navigator.appName.indexOf("Netscape")!=-1 && parseInt(navigator.appVersion) >= 5)
		{
			document.getElementById("photo_overview_album").style.MozOpacity = "0.1";
		}
		else if (navigator.appName.indexOf("Microsoft")!= -1 && parseInt(navigator.appVersion) >= 4)
		{
			document.getElementById("photo_overview_album").style.filter = "Alpha(opacity: 10)";
			document.getElementById("photo_overview_album").style.opacity = 0.1;
		}

		document.getElementById("uploading").style.display = "block";
		document.getElementById("error_photo_filesize").style.display = "none";
		document.getElementById("error_photo_filetype").style.display = "none";
	}
