/* Research Database Management System (RDMS)
 ' Copyright(C) 2008 Graham Philips
 ' RDMS is licensed under the GNU General Public License.
 ' Please See license.html or http://www.gnu.org/licenses/gpl.txt for the full license
 ' If there are problems, see http://sourceforge.net/projects/rdms/ for support.
 '
 ' RDMS comes with ABSOLUTELY NO WARRANTY
 '  
 ' This program is free software; you can redistribute it and/or modify it under
 ' the terms of the GNU General Public License as published by the Free Software
 ' Foundation; either version 2 of the License, or (at your option) any later
 ' version. */

/* Functions to adjust a selected user's status on the active user's trusted list */

function trustUserPrompt(userID)
{
	document.getElementById('messageDisplayBox').innerHTML = "<span class=\"himessage\">"+
		"You have chosen to add this user to your trusted list. Please <a class=\"main\" "+
		"href=\"#\" onclick=\"trustUser("+userID+");return false;\">Confirm</a> or <a "+
		"class=\"main\" href=\"#\" onclick=\"clearMessageDisplayBox("+
		");return false;\">Cancel</a> this decision.</span>";
}

function trustUser(userID)
{
	document.getElementById('messageDisplayBox').innerHTML = "<span class=\"himessage\">[Adding User...]</span>";
	xmlHttp = new GetXmlHttpObject();
	url = "/includes/ajax/users/addtrusteduser.asp?userID="+userID+"&sid="+Math.random();
	xmlHttp.onreadystatechange = function(){xmlHttpResponse('messageDisplayBox',''+
		'<span class=\"himessage\">User added successfully</span>','userTrustStatus');}; 
	xmlHttp.open("GET",url,true);
	xmlHttp.send(null);
}

function deTrustUserPrompt(userID)
{
	document.getElementById('messageDisplayBox').innerHTML = "<span class=\"himessage\">"+
		"You have chosen to remove this user from your trusted list. Please <a class=\"main\" "+
		"href=\"#\" onclick=\"deTrustUser("+userID+");return false;\">Confirm</a> or <a "+
		"class=\"main\" href=\"#\" onclick=\"clearMessageDisplayBox("+
		");return false;\">Cancel</a> this decision.</span>";
}

function deTrustUser(userID)
{
	document.getElementById('messageDisplayBox').innerHTML = "<span class=\"himessage\">[Removing User...]</span>";
	xmlHttp = new GetXmlHttpObject();
	url = "/includes/ajax/users/removetrusteduser.asp?userID="+userID+"&sid="+Math.random();
	xmlHttp.onreadystatechange = function(){xmlHttpResponse('messageDisplayBox',''+
		'<span class=\"himessage\">User removed successfully</span>','userTrustStatus');}; 
	xmlHttp.open("GET",url,true);
	xmlHttp.send(null);
}

// -->
