

//---------------------------------------------------------------
function mark_code( key , mark )
{
	var params = "key=" + key;
	params += "&mark=" + mark;
		
    new Ajax.Request('/mark', {
        method: 'post',
        parameters: params,
        onSuccess: function( transport ){
           var current_mark = transport.responseText;
           $("mark").update( current_mark );
        },
        onFailure: function(){ alert("ohoh"); }
    });
    return false;
}


//---------------------------------------------------------------
function flag_offensive( key )
{
	var params = "key=" + key;
		
  new Ajax.Request('/offensive', {
      method: 'post',
      parameters: params,
      onFailure: function(){ alert("ohoh"); }
  });
  return false;
}


//---------------------------------------------------------------
function comment_code()
{
	var params = "key=" + $F('extract_key');
	params += "&poster_name=" + $F('poster_name');
	params += "&comment=" + $F('comment');
		
    new Ajax.Request('/comment', {
        method: 'post',
        parameters: params,
        onSuccess: function( transport ){
           var response = transport.responseText;
           if( "OK" == response )
        	   window.location.reload(true); 
        },
        onFailure: function(){ alert("ohoh"); }
    });
    return false;
}

