$( function() {
    $.fn.extend( {
        bindParseEmbed: function( callack, button ) {
            var input = this;
            $( button ).bind( {
                click: function () {
                    var url = $( input ).attr( 'rel' );
                    $( input ).attr( 'disabled', true );
                    $( this ).attr( 'disabled', true );
                    $.ajax( {
                        type: 'POST',
                        url: url,
                        data: { embed: $( input ).val() },
                        success: function( html ) {
                            $( input ).attr( 'disabled', false );
                            $( button ).attr( 'disabled', false );
                            callack( html, input );
                        },
                        dataType: 'html'
                    } );
                    return false;
                }
            } );
        }
    } );
} );

