function tagTopic(topicId, tag) {
	

$j('#tagTopic').html("<img src = '_images/ajax-loader.gif'  border==\"0\">");
$j('#topicButton'+topicId).html("<img src = '_images/ajax-loader.gif'  border=0>");
setTimeout('sendRequest('+topicId+','+tag+ ')', 1000);

 

	//alert(topicId);
}
function sendRequest(topicId, tag) {
var c = new Date();
var mill = c.valueOf();

	$j.ajax({
   type: "POST",
   url: "_tagTopic.php",
   data: "topic="+topicId+"&add="+tag+"&mill="+mill,
   success: function(msg){showTagged(topicId, tag);}
 });

}

function hideTopic (topicId) {
	var topic = '#topic'+topicId;
	$j(topic).css('display', 'none');
	//window.location.reload()
	//alert(	$j('#topic'+topicId).css('display'));
		
}

function showTagged(topicId, tag) {
if(tag) {
$j('#tagTopic').html('<a href="javascript:if(confirm(\'Do you want to unsubscribe to this topic?\')){tagTopic('+topicId+', false);}"><img src="_images/btn_unsubscribe.gif" alt="&hearts;Unsubscribe" width="101" height="18" border="0" /></a>');
	}
	else {
	$j('#tagTopic').html('<a href="javascript:tagTopic('+topicId+', true);"><img src="_images/btn_subscribe.gif" alt="&hearts;Subscribe" width="91" height="18" border="0" /></a>');
	hideTopic(topicId);
	}//alert("saved");
	
	
}





