function goto_page(page)
{
	document.getElementById('paging').page.value=page;
	document.getElementById('paging').submit();
	return true;
}

function verifyCommentDelete(userID, commentID)
{
    input_box=confirm("Are you SURE you want to DELETE this comment?");
	if (input_box == true)
	{
       document.forms["deleteComment"].id.value = userID;
	   document.forms["deleteComment"].deleteID.value = commentID;
	   document.forms["deleteComment"].submit();
	}
}

function toggleAddCommentDiv()
{
	//document.getElementById('add_comment').style.position = "relative";
	document.getElementById('add_comment').style.visibility = "visible";
	document.getElementById('add_comment').style.height = "100%";
	document.getElementById('add_comment').style.margin = "5px";		
	document.getElementById('add_comment').style.padding = "5px";				
	
	//document.getElementById('add_comment_link').innerHTML = "<input type='submit' value='Add New Comment'>";
      
    document.getElementById('add_comment_link').innerHTML = "<strong>Adding New Comment</strong>";
}

function newComment(id)
{
    document.getElementById('add_comment').innerHTML = 
        "<form method='post'>"
      + "New Comment:<br/>"  
      + "<textarea name='new_comment' style='width: 98%; height: 200px'></textarea><br/>"
      + "<input type='hidden' name='id' value='" + id + "'>"
      + "<input type='submit' value='Add'>"
      + "</form>";
      
}

function readMessage(id)
{
	//window.open("/tap/profiles/read_message.php?id=" + id,"plain","width=525,height=350,scrollbars=yes");
}

function deleteAll()
{
	input_box=confirm("Are you SURE you want to DELETE ALL MESSAGES?");
	if (input_box == true)
	{
		document.forms[0].deleteID.value = 0;
		document.forms[0].submit();
	}
}

function deleteMessage(id)
{
	input_box=confirm("Are you SURE you want to DELETE the selected message?");
	if (input_box == true)
	{
		document.forms[0].deleteID.value = id;
		document.forms[0].submit();	
	}
}

