	// common js functions

	function showElement(elmnt)
	{
		if(document.getElementById(elmnt))
		{
			document.getElementById(elmnt).style.display = 'inline';
		}
	}

	function hideElement(elmnt)
	{
		if(document.getElementById(elmnt))
		{
			document.getElementById(elmnt).style.display = 'none';
		}
	}

	function openPopup(url,winName,winWidth,winHeight,showScrollbars)
	{
		if(winName == null) winName = '';
		if(!(winWidth > 0)) winWidth = 700;
		if(!(winHeight > 0)) winHeight = 550;

		showScrolls = (showScrollbars == true) ? "1" : "0";

		if(url != null)
			window.open(url,winName,'toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=' + showScrolls + ',resizable=1,width=' + winWidth + ',height=' + winHeight);
	}

	function deleteRecord(recordID, recordName)
	{
		str = "Are you sure you want to delete this " + recordName + "?";

		if(recordID > 0 && (frm = document.getElementById('form_records')))
		{
			if (confirm(str))
			{
				frm.elements.action.value = "delete_record";
				frm.elements.id_to_delete.value = recordID;
				frm.submit();
			}
		}

		return true;
	} // /deleteRecord()


	////
	// moves up/down a record (changing position)
	//
	function changePosition(id, direction)
	{
		if (id > 0 && (direction == "move_up" || direction == "move_down") && (frm = document.getElementById('form_position')))
		{
			frm.elements.mode.value = direction;
			frm.elements.id_to_move.value = id;
			frm.submit();
		}

		return false;
	} // /changePosition()