function view (filePath)
{
	window.open(filePath, "_blank")
	
	return null;
}

function report (reportID)
{	
	form = document.getElementById('formFileNav' + reportID);
	
	var xmlHttp;

	xmlHttp = init_request_obj();
	
	if (xmlHttp != null)
	{
		xmlHttp.onreadystatechange = function ()
		{
			if (xmlHttp.readyState == 4)
			{				
				if ( xmlHttp.responseText.match('1') )
				{
					alert ('This file has been reported to the site administrator.');
				}
				else
				{
					alert ('There was an error reporting this file.\nThis error occurred becuase the file is being removed.');
				}
			}
		}
		
		form_submit ('GET', xmlHttp, 'file_report.cfm', form);
	}
	
	return null;
}

function reportComment()
{
	form = document.getElementById('formReportMessage');
	
	var xmlHttp;

	xmlHttp = init_request_obj();
	
	//xmlHttp.overrideMimeType('text/xml');
	
	if (xmlHttp != null)
	{
		xmlHttp.onreadystatechange = function ()
		{
			if (xmlHttp.readyState == 4)
			{
				xmlResponce = xmlHttp.responseText;
				
				if (xmlResponce.match('0'))
				{								
					input = document.getElementById('textSubject');
					
					input.value = "";
					
					input = document.getElementById('textMessage');
					
					input.value = "";
					
					location.reload();
				}
				else
				{					
					alert ("Invalid message or subject length.");
				}
			}
		}
		
		form_submit ('POST', xmlHttp, 'report_comment.cfm', form);
	}
	
	return null;
}