
	// validates the login form...
	function validateLogin(frm)
	{
		error = "";

		if(!frm)
		{
			alert("No login form specified!");
			return false;
		}

		if(frm.stage_name.value == "" || frm.stage_name.value == "Username")
		{
			alert("Please, enter your Username");
			frm.stage_name.focus();
			return false;
		}

		if(frm.password.value == "" || frm.password.value == "********")
		{
			alert("Please, enter your password");
			frm.password.focus();
			return false;
		}

		return true;
	} // end function validateLogin()



	// shows a hidden page element (usually used for displaying some hidden DIVs)
	function showElement(elmnt)
	{
		if(document.getElementById(elmnt))
		{
			document.getElementById(elmnt).style.display = 'block';
		}
	}



	// hides a page element (usually used for hiding some DIVs)
	function hideElement(elmnt)
	{
		if(document.getElementById(elmnt))
		{
			document.getElementById(elmnt).style.display = 'none';
		}
	}



	// opens a pop-up window
	function openWizard(url,winName,winWidth,winHeight)
	{
		if(winName == null) winName = '';
		if(!(winWidth > 0)) winWidth = 700;
		if(!(winHeight > 0)) winHeight = 550;

		if(url != null)
			window.open(url,winName,'toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=1,width=' + winWidth + ',height=' + winHeight);
	}

	// proceed to modify photo details
	function doModifyPhoto(photoID)
	{
		if(!(photoID > 0))
		{
			alert("Error. Invalid Photo ID.");
			return false;
		}

		window.location = '/wf/index.php?cmd=manage_photos&action=modify&id=' + photoID;
	}

	// proceed to delete photo
	function doDeletePhoto(frm,photoID)
	{
		if(!(document.getElementById(frm)))
		{
			alert("Error. No form specified.");
			return false;
		}

		if(!(photoID > 0))
		{
			alert("Error. Invalid Photo ID.");
			return false;
		}

		if(confirm("Are you sure you want to delete this photo?"))
		{
			document.getElementById(frm).cmd.value = "manage_photos";
			document.getElementById(frm).elements.action.value = "delete";
			document.getElementById(frm).elements.id.value = photoID;
			document.getElementById(frm).submit();
		}
		return false;
	}

