$('#swimlane0step0buffermedium').droppable({
    accept      : "div",
    tolerance   : "pointer",
    hoverClass  : "dragdrop"
});

$('#swimlane0step0buffermedium').on("drop", function(e, ui){
    var id = "";
    idstate = ui.draggable.attr("id");
    [swimlane, id, stepno, steprole, state, original_priority, severity, special, release_no] = idstate.split('###');
    $('#swimlane0step0buffermedium').html('<img src="/images/ajax-loader.gif">').load('/kanban/dropped_on_step_priority', {swimlane_no:'0', step_no:'0', step_role:'buffer', priority:'medium', doc_id:id});
    if (special === 'expedite') {
        $('#swimlane'+swimlane+'step'+stepno+steprole+special).html('<img src="/images/ajax-loader.gif">').load('/kanban/step_'+steprole+'_'+special, {swimlane_no:swimlane, step_no:stepno});
    } else {
        $('#swimlane'+swimlane+'step'+stepno+steprole+original_priority).html('<img src="/images/ajax-loader.gif">').load('/kanban/step_'+steprole+'_'+original_priority, {swimlane_no:swimlane, step_no:stepno});
    }
});

$('#togglestep0buffer').click(function() {
    if (($('#swimlane0step0buffermedium').is(':visible')) || ($('#swimlane0step0bufferall').is(':visible'))) {
        $('#step0bufferentrycriteria').hide();
        $('#swimlane0step0bufferexpedite').hide();
        $('#swimlane0step0bufferall').hide();
        $('#swimlane0step0buffercritical').hide();
        $('#swimlane0step0bufferhigh').hide();
        $('#swimlane0step0buffermedium').hide();
        $('#swimlane0step0bufferlow').hide();
        $('#swimlane0step0bufferpull').hide();
        $('#swimlane0step0bufferwaiting').hide();
        $('#swimlane0step0bufferblocked').hide();
        $('#swimlane0step0bufferdeferred').hide();
        $('#swimlane0step0bufferghosted').hide();
        $('#step0bufferexitcriteria').hide();
        $('#togglestep0buffer').val('Show');
    } else {
        $('#step0bufferentrycriteria').show();
        $('#swimlane0step0bufferexpedite').show();
        $('#swimlane0step0bufferall').show();
        $('#swimlane0step0buffercritical').show();
        $('#swimlane0step0bufferhigh').show();
        $('#swimlane0step0buffermedium').show();
        $('#swimlane0step0bufferlow').show();
        $('#swimlane0step0bufferpull').show();
        $('#swimlane0step0bufferwaiting').show();
        $('#swimlane0step0bufferblocked').show();
        $('#swimlane0step0bufferdeferred').show();
        $('#swimlane0step0bufferghosted').show();
        $('#step0bufferexitcriteria').show();
        $('#togglestep0buffer').val('Hide');
    }
});