
function lockTopic(id) {
	
   var titiuu = new Ajax.Request('ajax/topics.php?act=lock&id='+id , {
		postBody:'', method:'get', 
		onSuccess: function(t) {
		  //alert('response: '+t.responseText);
		  if (t.responseText == 1)
		  {
			alert('nolokots ..');
			document.location = document.location;
		  } else {
			alert('lock neizdevaas .. ');
		  }
		}, onFailure: function(t) {
			alert('failure'); 
		}
  }); 	// end of Ajax.Request
}

function unlockTopic(id) {
	
   var titiuu = new Ajax.Request('ajax/topics.php?act=unlock&id='+id , {
		postBody:'', method:'get', 
		onSuccess: function(t) {
		  //alert('response: '+t.responseText);
		  if (t.responseText == 1){
			alert('Diskusija veiksmīgi atjaunota ..');
			document.location = document.location;
		  } else {
			//alert('lock neizdevaas .. ');
		  }
		}, onFailure: function(t) {
			alert('failure'); 
		}
  }); 	// end of Ajax.Request
}

function delTopic(id) {
   
   var titiuu = new Ajax.Request('ajax/topics.php?act=delete&id='+id , {
		postBody:'', method:'get', 
		onSuccess: function(t) {
		}, onFailure: function(t) {
			alert('failure'); 
		}
  }); 	// end of Ajax.Request
}
function delComment(id) {
	// alert('delComment - '+id);
   var titiuu = new Ajax.Request('ajax/topics.php?act=delcomment&id='+id , {
		postBody:'', method:'get', 
		onSuccess: function(t) {
		  //alert('response: '+t.responseText);
			if(t.responseText != '1'){
				alert('neizdevaas komentaara dzeeshana  .. ');
			}
		}, onFailure: function(t) {
			alert('failure'); 
		}
  }); 	// end of Ajax.Request
}
