/*======================================*\
|| #################################### ||
|| # Post Thank You Hack version 7.80  praying# ||
|| #################################### ||
\*======================================*/
var post_praying_handleSuccess = function(o)
{
	if(o.responseText !== undefined)
	{
		if (post_praying_callback.object_name[o.tId] !== undefined)
		{
			fetch_object(post_praying_callback.object_name[o.tId]).innerHTML = o.responseText;
		}
	}
}
var post_praying_handleFailure = function(o)
{
	if(o.responseText !== undefined)
	{
		alert(o.responseText);
	}
}
var post_praying_callback =
{
	success: post_praying_handleSuccess,
	failure: post_praying_handleFailure,
	timeout: vB_Default_Timeout,
	cache: false,
	object_name: new Array()
};
function post_praying_give(postid, integrate)
{
	fetch_object('post_praying_button_' + postid).style.display = 'none';
	fetch_object('post_praying_separator_' + postid).style.display = 'none';

	if (integrate == true)
	{
		fetch_object('post_groan_button_' + postid).style.display = 'none';
	}

	var sUrl = 'post_praying.php';
	var postData = 'do=post_praying_add&using_ajax=1&p=' + postid + '&securitytoken=' + SECURITYTOKEN;

	var request = YAHOO.util.Connect.asyncRequest('POST', sUrl, post_praying_callback, postData);

	post_praying_callback.object_name[request.tId] = 'post_praying_box_' + postid;

	fetch_object('post_praying_box_' + postid).style.display = '';

	return false;
}
function post_praying_remove_all(postid, integrate)
{
	var sUrl = 'post_praying.php';
	var postData = 'do=post_praying_remove_all&using_ajax=1&p=' + postid + '&securitytoken=' + SECURITYTOKEN;

	var request = YAHOO.util.Connect.asyncRequest('POST', sUrl, post_praying_callback, postData);

	post_praying_callback.object_name[request.tId] = 'post_praying_box_' + postid;

	fetch_object('post_praying_button_' + postid).style.display = ''
	fetch_object('post_praying_separator_' + postid).style.display = '';

	if (integrate == true)
	{
		fetch_object('post_groan_button_' + postid).style.display = '';
	}

	fetch_object('post_praying_box_' + postid).style.display = 'none';

	return false;
}
function post_praying_remove_user(postid, integrate)
{
	var sUrl = 'post_praying.php';
	var postData = 'do=post_praying_remove_user&using_ajax=1&p=' + postid + '&securitytoken=' + SECURITYTOKEN;

	var request = YAHOO.util.Connect.asyncRequest('POST', sUrl, post_praying_callback, postData);

	post_praying_callback.object_name[request.tId] = 'post_praying_box_' + postid;

	fetch_object('post_praying_button_' + postid).style.display = ''
	fetch_object('post_praying_separator_' + postid).style.display = '';

	if (integrate == true)
	{
		fetch_object('post_groan_button_' + postid).style.display = '';
	}

	fetch_object('post_praying_box_' + postid).style.display = 'none';

	return false;	
}