function reviewAddComment(rid) {
	document.getElementById('addcomment_review' + rid).style.display = 'none';
	document.getElementById('editcomment_review' + rid).style.display = 'block';
	document.getElementById('buttons1_review' + rid).style.display = 'none';
	document.getElementById('buttons2_review' + rid).style.display = 'block';
	document.getElementById('br1_review' + rid).style.display = 'block';
	document.getElementById('br2_review' + rid).style.display = 'block';
}

function cancelComment(rid) {
	document.getElementById('addcomment_review' + rid).style.display = 'block';
	document.getElementById('editcomment_review' + rid).style.display = 'none';
	document.getElementById('buttons1_review' + rid).style.display = 'inline';
	document.getElementById('buttons2_review' + rid).style.display = 'none';
	document.getElementById('br1_review' + rid).style.display = 'none';
	document.getElementById('br2_review' + rid).style.display = 'none';
}

function reviewChangeOwner(rid) {
	document.getElementById('changeowner_review' + rid).style.display = 'block';
}
function cancelChangeOwner(rid) {
	document.getElementById('changeowner_review' + rid).style.display = 'none';
}


function processComment(rid, button) {
	var commentValue = document.getElementById('commenttext_review' + rid).value;
	
	if (commentValue == "") {
		var conf = confirm("Do you want to continue without adding a comment?");
		if (!conf) return false;
	}
	
	document.getElementById('comment_' + button + '_review' + rid).value = commentValue;

	return true;
}

function selectHelpTopic(num)
{
var numHelpBlurbs = 6;
	for (i = 0; i < numHelpBlurbs; i++) {
		if (i != num){
			document.getElementById("help_" + i).style.display = "none";
		} else {
			document.getElementById("help_" + i).style.display = "block";
		}
	}
}

function solicitAddComment(uid) {
	document.getElementById('addcomment_user' + uid).style.display = 'none';
	document.getElementById('editcomment_user' + uid).style.display = 'block';
}

function solicitCancelComment(uid) {
	document.getElementById('editcomment_user' + uid).style.display = 'none';
}

function processSolicitationComment(uid, button) {
	var commentValue = document.getElementById('commenttext_user' + uid).value;
	
	// if the field is hidden, don't submit comments
	if (document.getElementById('editcomment_user' + uid).style.display != 'block'){
		return true;
	}
	// if the comment is blank, prompt...
	if (commentValue == "" || commentValue == 'Type a comment here that will be sent to the user with your solicitation.') {
		var conf = confirm("Do you want to continue without adding a comment?");
		if (!conf) return false;
	}
		
	document.getElementById('comment_' + button + '_user' + uid).value = commentValue;
	
	return true;
}

function clearCommentBox(box){
	if (box.value == 'Type a comment here that will be added when you perform one of the actions below.') {
		box.value = "";
	}
}

function clearSolicitationCommentBox(box){
	if (box.value == 'Type a comment here that will be sent to the user with your solicitation.') {
		box.value = "";
	}
}
