
function nominate_topic_give(postid)
{
	fetch_object('nominate_topic_button_' + postid).style.display = 'none';
	fetch_object('nominate_topic_stamps_' + postid).style.display = '';

	var handleSuccess = function(o){
		if(o.responseText !== undefined){
			fetch_object('nominate_topic_box_' + postid).innerHTML = o.responseText;
			fetch_object('nominate_topic_stamps_box_' + postid).innerHTML = o.responseText;
		}
	}
	var handleFailure = function(o){
		if(o.responseText !== undefined){
			alert(o.responseText);
		}
	}
	var callback =
	{
  		success: handleSuccess,
  		failure: handleFailure
	};

	var sUrl = 'nominate_topic.php';
	var postData = 'do=nominate_topic_add&using_ajax=1&p=' + postid + '&securitytoken=' + SECURITYTOKEN;

	YAHOO.util.Connect.asyncRequest('POST', sUrl, callback, postData);
}

function nominate_topic_remove_all(postid)
{
	fetch_object('nominate_topic_stamps_' + postid).style.display = 'none';

	var handleSuccess = function(o){
		if(o.responseText !== undefined){
			fetch_object('nominate_topic_box_' + postid).innerHTML = o.responseText;
			fetch_object('nominate_topic_stamps_box_' + postid).innerHTML = o.responseText;
		}
	}
	var handleFailure = function(o){
		if(o.responseText !== undefined){
			alert(o.responseText);
		}
	}
	var callback =
	{
  		success: handleSuccess,
  		failure: handleFailure
	};

	var sUrl = 'nominate_topic.php';
	var postData = 'do=nominate_topic_remove_all&using_ajax=1&p=' + postid + '&securitytoken=' + SECURITYTOKEN;

	YAHOO.util.Connect.asyncRequest('POST', sUrl, callback, postData);

	fetch_object('nominate_topic_button_' + postid).style.display = ''
}

function nominate_topic_remove_user(postid,flag)
{
	if (flag == 1) fetch_object('nominate_topic_stamps_' + postid).style.display = 'none';

	var handleSuccess = function(o){
		if(o.responseText !== undefined){
			fetch_object('nominate_topic_box_' + postid).innerHTML = o.responseText;
		}
	}
	var handleFailure = function(o){
		if(o.responseText !== undefined){
			alert(o.responseText);
		}
	}
	var callback =
	{
  		success: handleSuccess,
  		failure: handleFailure
	};

	var sUrl = 'nominate_topic.php';
	var postData = 'do=nominate_topic_remove_user&using_ajax=1&p=' + postid + '&securitytoken=' + SECURITYTOKEN;

	YAHOO.util.Connect.asyncRequest('POST', sUrl, callback, postData);

	fetch_object('nominate_topic_button_' + postid).style.display = ''
}

