
	/*
	* user_photo.js
	* Author(s): Alex Baskov, 2008
	*/


	function badPhotoContentReporting(userName, photoID)
	{
		awnd = window.open("/wf/index.php?cmd=bad_photo_content_reporting&username=" + userName + "&pid=" + photoID,"win",'toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=1,width=440,height=300');
		if (awnd.opener == null) awnd.opener = self;
		awnd.focus();
	}

	function validateFields()
	{
		if (document.message_form.email.value == "")
		{
			alert("Please, enter email");
			return false;
		}

		if (!validateEmail())
		{
			alert("The email address does not appear to be valid. Please check and try again");
			return false;
		}

		return true;
	}

	function validateEmail()
	{
		var re, good;
		re=/.+\@.+\..+/;
		good = re.exec(document.message_form.email.value);
		return (good);
	}


	function toggleBox(mode, albumID)
	{
		if (!mode || mode == null || !albumID || !(albumID >= 0)) return false;

		if (mode == "album")
		{
			if (document.getElementById('albumContent_' + albumID))
			{
				if (document.getElementById('albumContent_' + albumID).style.display == "none")
				{
					document.getElementById('albumContent_' + albumID).style.display = "block";
					document.getElementById('albumBoxTitle_' + albumID).className = "albumBoxTitleActive";
				}
				else
				{
					document.getElementById('albumContent_' + albumID).style.display = "none";
					document.getElementById('albumBoxTitle_' + albumID).className = "albumBoxTitleInactive";
				}
			}

		} // /album

		else if (mode == "about")
		{
			if (document.getElementById('albumAbout_' + albumID))
			{
				if (document.getElementById('albumAbout_' + albumID).style.display == "none")
				{
					document.getElementById('albumAbout_' + albumID).style.display = "block";
					document.getElementById('aboutLink_' + albumID).className = "linkActive";
				}
				else
				{
					document.getElementById('albumAbout_' + albumID).style.display = "none";
					document.getElementById('aboutLink_' + albumID).className = "linkInactive";
				}
			}

		} // /about

		else if (mode == "tags")
		{
			if (document.getElementById('albumTags_' + albumID))
			{
				if (document.getElementById('albumTags_' + albumID).style.display == "none")
				{
					document.getElementById('albumTags_' + albumID).style.display = "block";
					document.getElementById('tagsLink_' + albumID).className = "linkActive";
				}
				else
				{
					document.getElementById('albumTags_' + albumID).style.display = "none";
					document.getElementById('tagsLink_' + albumID).className = "linkInactive";
				}
			}

		} // /tags

		return true;
	} // /toggleBox()



	function showTabAll()
	{
		if (document.getElementById('photoCommentsAll').style.display == 'none')
		{
			document.getElementById('photoAddComment').style.display = 'none';
			document.getElementById('photoComments').style.display = 'none';
			document.getElementById('photoCommentsAll').style.display = 'block';
			if (document.getElementById('linkShowAddComment'))
			{
				document.getElementById('linkShowAddComment').className = 'smallButtonOff';
			}
			document.getElementById('linkShowAllComments').className = 'smallButtonOn';
		}

		return true;
	} // /showTabAll()


	function showTabAdd()
	{
		if (document.getElementById('photoAddComment').style.display == 'none')
		{
			document.getElementById('photoComments').style.display = 'none';
			document.getElementById('photoCommentsAll').style.display = 'none';
			document.getElementById('photoAddComment').style.display = 'block';
			if (document.getElementById('linkShowAllComments'))
			{
				document.getElementById('linkShowAllComments').className = 'smallButtonOff';
			}
			document.getElementById('linkShowAddComment').className = 'smallButtonOn';
		}

		return true;
	} // /showTabAdd()