function toggleRetrievePasswordPopup() {
	if (!$('#ooph-retrievepassword').is(':visible')) {
		hideLoginPopup();
	}
	$('#ooph-retrievepassword').toggle();
}

function hideRetrievePasswordPopup() {
	$('#ooph-retrievepassword').hide();
}

function showRetrievePasswordPopup() {
	$('#ooph-retrievepassword').show();
}

function toggleLoginPopup() {
	if (!$('#ooph-signin').is(':visible')) {
		hideCreateAccountPopup();
		hideRetrievePasswordPopup();
	}
	$('#ooph-signin').toggle();
}

function showLoginPopup() {
	hideCreateAccountPopup();
	$('#ooph-signin').show();
}

function hideLoginPopup() {
	$('#ooph-signin').hide();
}

function showCreateAccountPopup() {
	hideLoginPopup();
	$('#create-account').show();
}

function hideCreateAccountPopup() {
	$('#create-account').hide();
}

function commentReply(comment_id) {
	
	$('#reply-to-container').hide();
	
	////
	// Check whether this comment is on this page... if not return
	var comment = $('#post_comment_'+comment_id);
	if (comment.length < 1) return;
	comment = comment[0];
	
	$('#comment_reply').val(comment_id);
	
	var comment_text = $('#post_comment_'+comment_id+' .text').html();
	var comment_name = $('#post_comment_'+comment_id+' .name').html();
	
	$('#reply-to-container .reply-comment-name').html(comment_name);
	$('#reply-to-container .reply-comment-text').html(comment_text);	
	
	$('#reply-to-container').show();
	
	$.scrollTo($('#leaveareply'));
	
}

function cancelReply() {
	$('#comment_reply').val('');
	$('#reply-to-container').hide();
}

function toggleNotifyEmail(handle) {
	if ($(handle).is(':checked')) {
		$('#emailaddresscontainer').show();
	} else {
		$('#emailaddresscontainer').hide();
	}
}

