function blockTopic(topicId){$("#block"+topicId).css({display:"none"});$("#loader"+topicId).css({display:"inline"}).html('<img class="imgfix" src="'+static_path+'images/ajax-loader_s.gif" />');$.ajax({url:global_path+'topic/'+topicId+',block.plain',cache:false,dataType:"plain",success:function(response,status){$("#loader"+topicId).css({display:"none"})
if(response=='true'){$("#unblock"+topicId).css({display:"inline"});}else{showMessage("There was an error and topic cannot be blocked. Try once more or contact with adminitrator.");}},error:function(response,status,errorThrown){showMessage("There was an error and topic cannot be blocked. Try once more or contact with adminitrator.");$("#block"+topicId).css({display:"inline"});$("#loader"+topicId).css({display:"none"})}});}
function unblockTopic(topicId){$("#unblock"+topicId).css({display:"none"});$("#loader"+topicId).css({display:"inline"}).html('<img class="imgfix" src="'+static_path+'images/ajax-loader_s.gif" />');$.ajax({url:global_path+'topic/'+topicId+',unblock.plain',cache:false,dataType:"plain",success:function(response,status){$("#loader"+topicId).css({display:"none"})
if(response=='true'){$("#block"+topicId).css({display:"inline"});}else{showMessage("There was an error and topic cannot be unblocked. Try once more or contact with adminitrator.");}},error:function(response,status,errorThrown){showMessage("There was an error and topic cannot be unblocked. Try once more or contact with adminitrator.");$("#loader"+topicId).css({display:"none"})}});}
function deleteTopic(topicId){if(window.confirm('Deleting topic. Are you sure?')){$("#loader"+topicId).css({display:"inline"}).html('<img class="imgfix" src="'+static_path+'images/ajax-loader_s.gif" />');$.ajax({url:global_path+'topic/'+topicId+',delete.plain',cache:false,dataType:"plain",success:function(response,status){$("#loader"+topicId).css({display:"none"})
if(response=='true'){$("#t"+topicId).html('topic deleted. when you refresh the page, this message will disappear.');showMessage("Topic has been deleted");}else{showMessage("There was an error and topic cannot be unblocked. Try once more or contact with adminitrator.");}},error:function(response,status,errorThrown){showMessage("There was an error and topic cannot be unblocked. Try once more or contact with adminitrator.");$("#loader"+topicId).css({display:"none"})}});}}