function addClubHit( id )
{
	var url = "/ajax/ajax.add_club_hit.php";
	var params = "content_id=" + id;
	
	var ajax = new Ajax.Request( 
		url,
		{
			parameters: params,
			method: "post",
			evalScripts: true
		}
	);
	
	$('club_hit_button').className = "ahc2e_club_hit_off";
	$('club_hit_button').href = 'javascript:void(0)';
}

function addMediaClubHit( id )
{
	var url = "/ajax/ajax.add_media_club_hit.php";
	var params = "content_id=" + id;
	
	var ajax = new Ajax.Request( 
		url,
		{
			parameters: params,
			method: "post",
			evalScripts: true,
			onSuccess: updateHitLink( id )
		}
	);
}

function groupSubscribe(id)
{
	alert('Application Accepted!');
	var url = "/ajax/ajax.group_subscribe.php";
		var params = "group_id=" + id;
		
		var ajax = new Ajax.Request(
			url,
			{
				parameters: params,
				method: "post",
				evalScripts: true
			}
	
		);
	
	$('group_subscribe_link').href = "javascript:void(0)";
	$('group_subscribe_link').innerHTML = "Application Accepted!";
	
}

function groupUnSubscribe(id)
{
	test = confirm('Really Leave This Group?');
	if(test)
	{
		
		var url = "/ajax/ajax.group_unsubscribe.php";
		var params = "group_id=" + id;
		
		var ajax = new Ajax.Request(
			url,
			{
				parameters: params,
				method: "post",
				evalScripts: true
			}
	
		);
		
		$('group_leave_link').innerHTML = "LEFT GROUP!";
		$('group_leave_link').href = "javascript:void(0)";
	}
	
}

function updateHitLink( id )
{
	$('hitLink_' + id).innerHTML = "Love It!";
	$('hitLink_' + id).href = 'javascript:void(0)';
	$('hitImg_' + id).src = '/images/hit-SM2.gif';
	num = parseInt($('hit_count_span_' + id).innerHTML);
	$('hit_count_span_' + id).innerHTML = num + 1;
}


function addMediaView( id )
{
	//alert('view +1');
	var url = "/ajax/ajax.add_media_view.php";
	var params = "content_id=" + id;
	
	var ajax = new Ajax.Request(
		url,
		{
			parameters: params,
			method: "post",
			evalScripts: true
		}
	
	);
}

function messageUser( user_id, friend_id )
{
	//do something here
}

function saveArticle( id )
{
	alert('Saving Article');
	var url = "/ajax/ajax.save_article.php";
	var params = "content_id=" + id;
	
	var ajax = new Ajax.Request(
		url,
		{
			parameters: params,
			method: "post",
			evalScripts: true
		}
	
	);
	
}

function removeArticle( id )
{
	test = confirm('Really Remove This Article?');
	if(test)
	{
		//alert(id);
		var url = "/ajax/ajax.remove_article.php";
		var params = "content_id=" + id;
		
		var ajax = new Ajax.Request(
			url,
			{
				parameters: params,
				method: "post",
				evalScripts: true
			}
	
		);
	}
}

function saveBlogEntry( id )
{
	alert('Saving Blog Entry');
	var url = "/ajax/ajax.save_blog_entry.php";
	var params = "content_id=" + id;
	
	var ajax = new Ajax.Request(
		url,
		{
			parameters: params,
			method: "post",
			evalScripts: true
		}
	
	);
	
}

function saveJob( id )
{
	
	alert('Saving Job');
	var url = "/ajax/ajax.save_job.php";
	var params = "job_id=" + id;
	
	var ajax = new Ajax.Request(
			url,
			{
				parameters: params,
				method: "post",
				evalScripts: true,
				onSuccess: updateSaveLink( id )
			}
	
		);
		
	
}

function updateSaveLink( id )
{
	$('link_' + id).innerHTML = "delete from favorites";
	$('link_' + id).href = 'javascript:removeJob(' + id + ')';
}

function removeJob( id )
{
	
	test = confirm('Really Remove This Job?');
	if(test)
	{
		var url = "/ajax/ajax.remove_job.php";
		var params = "job_id=" + id;
		
		var ajax = new Ajax.Request(
			url,
			{
				parameters: params,
				method: "post",
				evalScripts: true,
				onSuccess: updateRemoveLink( id )
			}
	
		);
	}

}

function updateRemoveLink( id )
{
	$('link_' + id).innerHTML = "save";
	$('link_' + id).href = 'javascript:saveJob(' + id + ')';
}

function removeJobEntry( id )
{
	test = confirm('Really Remove This Job?');
	if(test)
	{
		var url = "/ajax/ajax.unlist_job.php";
		var params = "job_id=" + id;
		
		var ajax = new Ajax.Request(
			url,
			{
				parameters: params,
				method: "post",
				evalScripts: true,
				onSuccess: postRemoved()
			}
	
		);
	}
	
}

function postRemoved()
{
	alert('Posting Removed');
	window.location="flex-career_manage.php";
}

function saveDatingMatch( user_id, match_id, firstname, obj){
		obj.innerHTML = "Saved!";
		obj.href = "javascript:void(0);"
		obj.onclick = '';
		
		var url = "/ajax/ajax.singles.save_match.php";
		var params = "user_id=" + user_id + "&match_id=" + match_id;
	
		var ajax = new Ajax.Request(
			url,
			{
				parameters: params,
				method: "post",
				evalScripts: true
			}
	
		);
	alert(firstname+" has been successfully added to your saved matches!");
}

function removeDatingMatch( user_id, match_id, firstname, obj){
		obj.innerHTML = "Removed!";
		obj.href = "javascript:void(0);"
		obj.onclick = '';
		
		var url = "/ajax/ajax.singles.remove_match.php";
		var params = "user_id=" + user_id + "&match_id=" + match_id;
	
		var ajax = new Ajax.Request(
			url,
			{
				parameters: params,
				method: "post"
			}
	
		);
	alert(firstname+" has been successfully removed from your saved matches!");
}

function removeProfileMatch( user_id, match_id, firstname )
{
	if( confirm('Are you sure you want to delete this match?' ) )
	{
		$( match_id + '_match' ).style.display = "none";
		var url = "/ajax/ajax.singles.remove_match.php";
		var params = "user_id=" + user_id + "&match_id=" + match_id;
	
		var ajax = new Ajax.Request(
			url,
			{
				parameters: params,
				method: "post"
			}
	
		);
		alert(firstname+" has been successfully removed from your saved matches!");
	}
	else
	{
		return false;
	}
}


function updateMyProTabs( type, div, id )
{
	var url = "/ajax/ajax.update_my_pro_tabs.php";
	var params = "type=" + type + "&id=" + id;
	
	var ajax = new Ajax.Updater( 
		div,
		url,
		{
			parameters: params,
			method: "post",
			evalScripts: true
		}
	);
}

function updateMyGroups( type, div )
{
	var url = "/ajax/ajax.update_my_groups.php";
	var params = "type=" + type;
	
	var ajax = new Ajax.Updater( 
		div,
		url,
		{
			parameters: params,
			method: "post",
			evalScripts: true
		}
	);
}

function updatePhotos( type, div )
{
	var url = "/ajax/ajax.update_my_photos.php";
	var params = "type=" + type;
	
	var ajax = new Ajax.Updater( 
		div,
		url,
		{
			parameters: params,
			method: "post",
			evalScripts: true
		}
	);
}

function updateComments( type, div, which )
{
	if( which == 'inbox' )
	{
		var url = "/ajax/ajax.update_my_comments.php";
		var params = "type=" + type + "&which=" + which;
		
		var ajax = new Ajax.Updater( 
			div,
			url,
			{
				parameters: params,
				method: "post",
				evalScripts: true
			}
		); 
	}
	else
	{
		$('hidden_type').value = type;
		$('comment_form').submit();
	}
}


function isNumeric(obj) {
	if (obj.value == null || !obj.value.toString().match(/^[-]?\d*\.?\d*$/))
	{
		alert("This value must be a number.");
		obj.value == '';
	}
}

function showBlogComments()
{
	$('my_blog').className = "";
	$('my_comments').className = "apn_active";
	$('my_reading_list').className = "";
	
	$('my_comments_div').style.display="";
	$('my_blog_div').style.display = "none";
	$('my_reading_list_div').style.display = "none";
}

function showMyBlog()
{
	$('my_blog').className = "apn_active";
	$('my_comments').className = "";
	$('my_reading_list').className = "";
	
	$('my_comments_div').style.display="none";
	$('my_blog_div').style.display = "";
	$('my_reading_list_div').style.display = "none";
}

function showReadingList()
{
	$('my_blog').className = "";
	$('my_comments').className = "";
	$('my_reading_list').className = "apn_active";
	
	$('my_comments_div').style.display="none";
	$('my_blog_div').style.display = "none";
	$('my_reading_list_div').style.display = "";
}

function showJobSearch()
{
	$('job_search_tab').className="activ";
	$('my_searches_tab').className = "";
	$('my_jobs_tab').className = "";
	
	$('job_search').style.display="";
	$('my_searches').style.display = "none";
	$('my_jobs').style.display = "none";
}

function showMySearches()
{
	$('job_search_tab').className = "";
	$('my_searches_tab').className="activ";
	$('my_jobs_tab').className = "";
	
	$('job_search').style.display="none";
	$('my_searches').style.display = "";
	$('my_jobs').style.display = "none";
}

function showMyJobs()
{
	$('job_search_tab').className = "";
	$('my_searches_tab').className = "";
	$('my_jobs_tab').className="activ";
	
	$('job_search').style.display="none";
	$('my_searches').style.display = "none";
	$('my_jobs').style.display = "";
}

function showPostNewJob()
{
	$('post_new_job_tab').className = "activ";
	$('manage_posted_jobs_tab').className = "";
	
	$('post_new_job').style.display="";
	$('manage_posted_jobs').style.display="none";
}

function showManagePostedJobs()
{
	$('post_new_job_tab').className = "";
	$('manage_posted_jobs_tab').className = "activ";
	
	$('post_new_job').style.display="none";
	$('manage_posted_jobs').style.display="";
}

function showPublicAboutMeTab()
{
	$('public_about_me_tab').className = "selected";
	$('public_photos_tab').className = "";
	if( $('public_faves_tab') )
		$('public_faves_tab').className = "";
	$('public_blog_tab').className = "";
	$('public_groups_tab').className = "";
	$('public_friends_tab').className = "";
	
	$('aac_about_me').style.display = "";
	$('acc_pub_photos').style.display = "none";
	$('aac_faves').style.display = "none";
	$('aac_blog').style.display = "none";
	$('aac_groups').style.display = "none";
	$('aac_friends').style.display = "none";
}

function showPublicPhotosTab()
{
	$('public_about_me_tab').className = "";
	$('public_photos_tab').className = "selected";
	if( $('public_faves_tab') )
		$('public_faves_tab').className = "";
	$('public_blog_tab').className = "";
	$('public_groups_tab').className = "";
	$('public_friends_tab').className = "";
	
	$('aac_about_me').style.display = "none";
	$('acc_pub_photos').style.display = "";
	$('aac_faves').style.display = "none";
	$('aac_blog').style.display = "none";
	$('aac_groups').style.display = "none";
	$('aac_friends').style.display = "none";
}

function showPublicFavesTab()
{
	$('public_about_me_tab').className = "";
	$('public_photos_tab').className = "";
	if( $('public_faves_tab') )
		$('public_faves_tab').className = "selected";
	$('public_blog_tab').className = "";
	$('public_groups_tab').className = "";
	$('public_friends_tab').className = "";
	
	$('aac_about_me').style.display = "none";
	$('acc_pub_photos').style.display = "none";
	$('aac_faves').style.display = "";
	$('aac_blog').style.display = "none";
	$('aac_groups').style.display = "none";
	$('aac_friends').style.display = "none";
}

function showPublicBlogTab()
{
	$('public_about_me_tab').className = "";
	$('public_photos_tab').className = "";
	if( $('public_faves_tab') )
		$('public_faves_tab').className = "";
	$('public_blog_tab').className = "selected";
	$('public_groups_tab').className = "";
	$('public_friends_tab').className = "";
	
	$('aac_about_me').style.display = "none";
	$('acc_pub_photos').style.display = "none";
	$('aac_faves').style.display = "none";
	$('aac_blog').style.display = "";
	$('aac_groups').style.display = "none";
	$('aac_friends').style.display = "none";
}

function showPublicGroupsTab()
{
	$('public_about_me_tab').className = "";
	$('public_photos_tab').className = "";
	if( $('public_faves_tab') )
		$('public_faves_tab').className = "";
	$('public_blog_tab').className = "";
	$('public_groups_tab').className = "selected";
	$('public_friends_tab').className = "";
	
	$('aac_about_me').style.display = "none";
	$('acc_pub_photos').style.display = "none";
	$('aac_faves').style.display = "none";
	$('aac_blog').style.display = "none";
	$('aac_groups').style.display = "";
	$('aac_friends').style.display = "none";
}

function showPublicFriendsTab()
{
	$('public_about_me_tab').className = "";
	$('public_photos_tab').className = "";
	if( $('public_faves_tab') )
		$('public_faves_tab').className = "";
	$('public_blog_tab').className = "";
	$('public_groups_tab').className = "";
	$('public_friends_tab').className = "selected";
	
	$('aac_about_me').style.display = "none";
	$('acc_pub_photos').style.display = "none";
	$('aac_faves').style.display = "none";
	$('aac_blog').style.display = "none";
	$('aac_groups').style.display = "none";
	$('aac_friends').style.display = "";
}

function showProPublicAboutMeTab()
{
	$('pro_public_about_me_tab').className = "apn_active";
	$('pro_public_questions_answered_tab').className = "";
	$('pro_public_groups_tab').className = "";
	$('pro_public_blog_tab').className = "";
	$('pro_public_friends_tab').className = "";
	$('pro_public_location_tab').className = "";
	
	$('pro_public_about_me').style.display = "";
	$('pro_public_questions_answered').style.display = "none";
	$('pro_public_groups').style.display = "none";
	$('pro_public_blog').style.display = "none";
	$('pro_public_friends').style.display = "none";
	$('pro_public_location').style.display = "none";
}

function showProPublicQuestionsTab()
{
	$('pro_public_about_me_tab').className = "";
	$('pro_public_questions_answered_tab').className = "apn_active";
	$('pro_public_groups_tab').className = "";
	$('pro_public_blog_tab').className = "";
	$('pro_public_friends_tab').className = "";
	$('pro_public_location_tab').className = "";
	
	$('pro_public_about_me').style.display = "none";
	$('pro_public_questions_answered').style.display = "";
	$('pro_public_groups').style.display = "none";
	$('pro_public_blog').style.display = "none";
	$('pro_public_friends').style.display = "none";
	$('pro_public_location').style.display = "none";
}

function showProPublicLocationTab()
{
	$('pro_public_about_me_tab').className = "";
	$('pro_public_questions_answered_tab').className = "";
	$('pro_public_location_tab').className = "apn_active";
	$('pro_public_groups_tab').className = "";
	$('pro_public_blog_tab').className = "";
	$('pro_public_friends_tab').className = "";
	
	$('pro_public_about_me').style.display = "none";
	$('pro_public_questions_answered').style.display = "none";
	$('pro_public_location').style.display = "";
	$('pro_public_groups').style.display = "none";
	$('pro_public_blog').style.display = "none";
	$('pro_public_friends').style.display = "none";
}


function showProPublicGroupsTab()
{
	$('pro_public_about_me_tab').className = "";
	$('pro_public_questions_answered_tab').className = "";
	$('pro_public_groups_tab').className = "apn_active";
	$('pro_public_blog_tab').className = "";
	$('pro_public_friends_tab').className = "";
	$('pro_public_location_tab').className = "";
	
	$('pro_public_about_me').style.display = "none";
	$('pro_public_questions_answered').style.display = "none";
	$('pro_public_groups').style.display = "";
	$('pro_public_blog').style.display = "none";
	$('pro_public_friends').style.display = "none";
	$('pro_public_location').style.display = "none";
}

function showProPublicBlogTab()
{
	$('pro_public_about_me_tab').className = "";
	$('pro_public_questions_answered_tab').className = "";
	$('pro_public_groups_tab').className = "";
	$('pro_public_blog_tab').className = "apn_active";
	$('pro_public_friends_tab').className = "";
	$('pro_public_location_tab').className = "";
	
	$('pro_public_about_me').style.display = "none";
	$('pro_public_questions_answered').style.display = "none";
	$('pro_public_groups').style.display = "none";
	$('pro_public_blog').style.display = "";
	$('pro_public_friends').style.display = "none";
	$('pro_public_location').style.display = "none";
}

function showProPublicFriendsTab()
{
	$('pro_public_about_me_tab').className = "";
	$('pro_public_questions_answered_tab').className = "";
	$('pro_public_groups_tab').className = "";
	$('pro_public_blog_tab').className = "";
	$('pro_public_friends_tab').className = "apn_active";
	$('pro_public_location_tab').className = "";
	
	$('pro_public_about_me').style.display = "none";
	$('pro_public_questions_answered').style.display = "none";
	$('pro_public_groups').style.display = "none";
	$('pro_public_blog').style.display = "none";
	$('pro_public_friends').style.display = "";
	$('pro_public_location').style.display = "none";
}

function showPhotoGallerySearch()
{
	$('gallery_sort').style.display="none";
	//$('gallery_search').style.display="";
	Effect.SlideDown('gallery_search_a');
}

function showPhotoGallerySort( test )
{
	//$('gallery_sort').style.display="";
	if(test)
	{
		$('gallery_search_a').style.display="none";
		Effect.SlideDown('gallery_search_a');
	}
	else
	{
		$('gallery_search_a').style.display="none";
		Effect.SlideDown('gallery_sort');
	}
	
}

function closeSortTab()
{
	//$('gallery_sort').style.display="none";
	Effect.SlideUp('gallery_sort'); 
}

function closeSearchTab()
{
	//$('gallery_search').style.display="none";
	Effect.SlideUp('gallery_search_a');
}


function viewComment( comment_id, el_id )
{
	var div = el_id + '_content';
	var url = "/ajax/ajax.view_comment.php";
	var params = "comment_id=" + comment_id + "&el_id=" + el_id;
	
	var ajax = new Ajax.Updater( 
		div,
		url,
		{
			parameters: params,
			method: "post",
			evalScripts: true,
			onSuccess: displayDialog( el_id, {'fade': false} )
		}
	);
}

function removeDefaultText(text,fld)
{
	if (text != '' && fld.value == text){
		fld.value = '';	
	}
	
}

// must output to an invisible div to function
function messageUser(user_id, redir) {
	var url = "/ajax/ajax.message_user.php";
	var params = "user_id=" + user_id +"&redirect=" + redir;
	var div = 'execute';
	
	var ajax = new Ajax.Updater(
		div,
		url,
		{
			parameters: params,
			method: "post",
			evalScripts: true
		}

	);
}

function messageClose(form) {
	var url = "/ajax/ajax.message_user_confirm.php";
	var div = 'execute';
	var params = '';
	
	var j = 0;
	for (i in form.elements) {
		if (j != 0) params += '&';
		params = form.elements[i].name + '=' + form.elements[i].value;
		j++;
	}
	
	var ajax = new Ajax.Updater(
		div,
		url,
		{
			parameters: params,
			method: "post",
			evalScripts: true
		}

	);
	
}

function updateDating( opt )
{
	
	if( opt.value == 'Y' )
	{
		Effect.SlideDown('dating_info');
	}
	else
	{
		Effect.SlideUp('dating_info');
	}
	
}

function sendFriendRequest(friend_id, send_request, popup_num )
{
	if( popup_num )
	{
		displayDialog('popup_friend_request_pop_' + popup_num,{'fade': false});
		
		if( send_request )
		{
			var url = "/ajax/ajax.friend_request.php";
			var params = "friend=" + friend_id;
			
			var ajax = new Ajax.Request(
					url,
					{
						parameters: params,
						method: "post",
						evalScripts: true
					}
			
				);
		}
	}
	else {
		displayDialog('popup_friend_request_pop',{'fade': false});
		
		if( send_request )
		{
			var url = "/ajax/ajax.friend_request.php";
			var params = "friend=" + friend_id;
			
			var ajax = new Ajax.Request(
					url,
					{
						parameters: params,
						method: "post",
						evalScripts: true
					}
			
				);
		}
	}
}

function confirmFriendRequest( user_id, friend_id )
{
	var url = "/ajax/ajax.friend_request.php";
	var params = "friend=" + friend_id + "&action=accept&user_id=" + user_id;
	var div ="debug_div";
	var ajax = new Ajax.Updater(
			div,
			url,
			{
				parameters: params,
				method: "post",
				evalScripts: true
			}
		);
}

function denyFriendRequest( user_id, friend_id )
{
	var url = "/ajax/ajax.friend_request.php";
	var params = "friend=" + friend_id + "&action=deny&user_id=" + user_id;
	var div ="debug_div";
	var ajax = new Ajax.Updater(
			div,
			url,
			{
				parameters: params,
				method: "post",
				evalScripts: true
			}
		);
}

function removeFriend( user_id, friend_id )
{
	if( confirm('Are you sure you want to remove this friend?' ) )
	{
		var url = "/ajax/ajax.remove_friend.php";
		var params = "friend=" + friend_id + "&user_id=" + user_id;
		var ajax = new Ajax.Request(
			url,
			{
				parameters: params,
				method: "post"
			}
		);	
		
		location.reload( true );
	}
	else
		return false;
}

function rateAnswer( answer_id )
{
	$('rate_' + answer_id + '_txt_link').style.display = "none";
	
	var url = "/ajax/ajax.rate_answer.php";
	var params = "answer=" + answer_id;
	var div ="rate_answer_" + answer_id;
	var ajax = new Ajax.Updater(
			div,
			url,
			{
				parameters: params,
				method: "post",
				evalScripts: true
			}
		);
}

function updateProMainTab( type, div, id )
{
	var url = "/ajax/ajax.update_pro_main_tab.php";
	var params = "type=" + type + "&id=" + id;
	
	var ajax = new Ajax.Updater( 
		div,
		url,
		{
			parameters: params,
			method: "post",
			evalScripts: true
		}
	);
}

var switch_class = true;
var original_highlight = false;
function checkProTabClass( tab, which )
{
	if( which == 'in' )
	{
		switch( $(tab.id).className )
		{
			case "":
				switch_class = true;
				$(tab.id).className = "ov";
				break;
			case "ov":
				switch_class = false;
				$(tab.id).className = "ov";
				break;
			case 'highlight':
				original_highlight = true;
				switch_class = true;
				$(tab.id).className = "ov";
				break;
		}
	}
	else
	{
		switch( $(tab.id).className )
		{
			case "":
				$(tab.id).className = "ov";
				break;
			case "ov":
				if( switch_class )
				{
					if( original_highlight )
					{
						original_highlight = false;
						$(tab.id).className = "highlight";
					}
					else
					{
						original_highlight = false;
						$(tab.id).className = "";
					}
				}
				else
				{
					original_highlight = false;
				}
				break;
		}
	}
}

function sure()
{
	return confirm('Are you sure you would like to remove this?');
}

function ajaxSendMessage( user_id )
{
	var url = "/ajax/ajax.send_message.php";
	var params = "user_id=" + user_id;
	var div = "popup_send_message_content";
	
	var ajax = new Ajax.Updater( 
		div,
		url,
		{
			parameters: params,
			method: "post",
			evalScripts: true,
			onSuccess: displayDialog('popup_send_message',{'fade': false})
		}
	);
}

function deleteReferral( id )
{
	if( confirm('Are you sure you want to delete this?' ) )
	{
		var url = "/ajax/ajax.delete_referral.php";
		$('referral_' + id ).style.display = "none";
		var params = "referral_id=" + id;
		var ajax = new Ajax.Request( 
		url,
		{
			parameters: params,
			method: "post"
		}
	);
	}
	else
		return false;
}

function destroyComment( id )
{
	if( confirm('Are you sure you want to delete this? It will no longer be seen by any users.' ) )
	{
		var url = "/ajax/ajax.destroy_comment.php";
		$('comment_' + id ).style.display = "none";
		var params = "comment_id=" + id;
		var ajax = new Ajax.Request( 
		url,
		{
			parameters: params,
			method: "post"
		}
	);
	}
	else
		return false;
}

function deleteImage( id )
{
	if( confirm('Are you sure you want to delete this?' ) )
	{
		var url = "/ajax/ajax.delete_photo.php";
		$('photo_' + id ).style.display = "none";
		var params = "photo_id=" + id;
		var ajax = new Ajax.Request( 
		url,
		{
			parameters: params,
			method: "post"
		}
	);
	}
	else
		return false;
}

	function userFlagContent(id, flagged, obj)
	{				
		if(!flagged){
		var answer = confirm("By clicking OK, you're alerting the Parents R People team to inappropriate content in this post.\n\nPlease note, abuse of this feature may result in a warning.");
		
			if (answer){
				var url = "/ajax/ajax.mark_flagged_post.php";
				var params = "id="+id+"&content="+obj.name;
	
				var ajax = new Ajax.Request( 
				url,
				{
					parameters: params,
					method: "post",
					evalScripts: true
					}
				);
			
			if(obj.name=='comment'){
				updateComments( 'message', 'comments');
			}
			else{
				var note = '';
			}
			document.getElementById(obj.id).innerHTML = "Flagged!";	
			alert("This post has been reported to Parents R People and the group administrators. Thank you for keeping this site family friendly.");
			document.getElementById(obj.id).onclick = '';
			}
		}
		else{	
			alert("This post has already been reported for inappropriate content.\n\nA Parents R People admin will review this post and remove it, if necessary.\n\nThank you for helping make Parents R People a family friendly site.")
		}
	}
	
function ajaxDeleteArticle( user_id, article_id )
{
	if( confirm('Are you sure you want to delete this article?' ) )
	{
		var url = "/ajax/ajax.delete_article.php";
		var params = "user_id=" + user_id + "&article_id=" + article_id;
	
		var ajax = new Ajax.Request(
			url,
			{
				parameters: params,
				method: "post"
			}
	
		);
		$('article_' + article_id ).style.display = "none";
		alert("Article Removed");
	}
	else
	{
		return false;
	}
}