$(function() {

// delete update
	$('.delete_update').live("click",function(){
		var ID = $(this).attr("id");
		var dataString = 'msg_id='+ ID;
		var txt = 'Delete this Comment?';
				
		$.prompt(txt,{ 
			buttons:{
				Delete:true, Cancel:false
			}, 	opacity: 0,
			prefix:'cleanblue' ,
				callback: function(v,m,f){
						
					if(v){
						$.ajax({
							type: "POST",
							url: "?L=status_update.delete_update&chromeless=1",
							data: dataString,
							cache: false,
							success: function(html){
								$(".bar"+ID).slideUp();
							}
						});
					}else{}
						
				}
		});
		return false;
	});

//comment slide
	$('.comment').live("click",function(){
		var ID = $(this).attr("id");
		$("#fullbox"+ID).show();
		$("#c"+ID).slideToggle(300);
		return false;
	});
//commment Submint
	$('.comment_submit').live("click",function(){
		var ID = $(this).attr("id");
		var comment_content = $("#textarea"+ID).val();
		var dataString = 'comment_content='+ comment_content + '&msg_id=' + ID;
		if(comment_content=='')	{
			$.prompt('Please Enter Comment Text',{ opacity: 0, prefix:'cleanblue' });
		} else {
			$.ajax({
				type: "POST",
				url: "?L=status_update.comment_ajax&chromeless=1",
				data: dataString,
				cache: false,
				success: function(html){
					$("#commentload"+ID).append(html);
					document.getElementById("textarea"+ID).value='';
					$("#textarea"+ID).focus();
				}
			});
		}
		return false;
	});

//comment delete
	$('.cdelete_update').live("click",function(){
		var ID = $(this).attr("id");
		var dataString = 'com_id='+ ID;
		var txt = 'Are you sure you want to delete this comment?';
				
		$.prompt(txt,{ 
			buttons:{
				Delete:true, Cancel:false
			}, opacity: 0,
				prefix:'cleanblue' ,
				callback: function(v,m,f){
						
					if(v){
					
						$.ajax({
							type: "POST",
							url: "?L=status_update.delete_comment&chromeless=1",
							data: dataString,
							cache: false,
							success: function(html){
								$("#comment"+ID).slideUp();
							}
						});
					} else{}
						
				}
		});
		return false;
	});


$(".vote").click(function() 
{

var id = $(this).attr("id");
var name = $(this).attr("name");
var dataString = 'id='+ id ;
var parent = $(this);


if(name=='up')
{

$(this).fadeIn(200).html('<img src="dot.gif" align="absmiddle">');
$.ajax({
   type: "POST",
   url: "?L=status_update.up_vote&chromeless=1",
   data: dataString,
   cache: false,

   success: function(html)
   {
    parent.html(html);
  
  }  });
  
}
else
{

$(this).fadeIn(200).html('<img src="dot.gif" align="absmiddle">');
$.ajax({
   type: "POST",
   url: "?L=status_update.down_vote&chromeless=1",
   data: dataString,
   cache: false,

   success: function(html)
   {
       parent.html(html);
  }
   
 });


}
  
 
 

return false;
	});
	



	
return false;
});
