/**
        Report spam(wall messages, photo comments, video comments, blog post commnetnts)
*/

function spam( id, url, type )
{
        this.url = url;
        this.id = id;
        this.type = type;
        this.req = new Object();

        this.report = function( message_id )
        {
                if( !message_id ) return false;
                sendRequest( spam.req,
                             spam.url,
                             {target_id: spam.id, id: message_id, type: spam.type},
                             function()
                             {
                                $( "#ajax_loading" ).show();
                             },
                             function( data )
                             {
                                $( "#ajax_loading" ).hide();
                                $( "#report_spam_button_" + message_id ).hide();
                                $( "#report_spam_result_" + message_id ).show();                                
                             },
                             function( data )
                             {
                                $( "#ajax_loading" ).hide();
                                showMessageFromDiv( "report_spam_failed" );
                             });
                return false;
        }
}