function unlock (reportID)
{
	form = document.getElementById('formPrivateReport' + reportID);
	
	var xmlHttp;

	xmlHttp = init_request_obj();
	
	if (xmlHttp != null)
	{
		xmlHttp.onreadystatechange = function ()
		{
			if (xmlHttp.readyState == 4)
			{
				if ( xmlHttp.responseText.match('1') )
				{
					location.reload();
				}
				else
				{
					alert ("The key is invalid.");
				}
			}
		}
		
		form_submit ('POST', xmlHttp, 'report_unlock.cfm', form);
	}
	
	return null;
}

function view (gotourl)
{
	window.open(gotourl,"_self")
	
	return null;
}

function bookmark (reportID)
{
	form = document.getElementById('formReportNav' + reportID);
	
	var xmlHttp;

	xmlHttp = init_request_obj();
	
	if (xmlHttp != null)
	{
		xmlHttp.onreadystatechange = function ()
		{
			if (xmlHttp.readyState == 4)
			{
				if ( xmlHttp.responseText.match('1') )
				{
					if (document.getElementById('hiddenBookmark'  + reportID).value == 1)
					{
						
						if (document.getElementById('hiddenPrivateReport' + reportID).value == 1)
						{
							document.getElementById('divBookmark' + reportID).innerHTML = "";
						}
						
						else 
						{
							document.getElementById('hiddenBookmark' + reportID).value = "0";
							document.getElementById('imgBookmarkReport' + reportID).src = "images/button_add_to_myworkpic.jpg";
						}
					}
					
					else
					{
						document.getElementById('imgBookmarkReport' + reportID).src = "images/button_remove_from_myworkpic.jpg";
						document.getElementById('hiddenBookmark' + reportID).value = "1";
					}
				}
			}
		}
		
		form_submit ('POST', xmlHttp, 'report_bookmark.cfm', form);
	}
	
	return null;
}