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

$('#swimlane0step1buffermedium').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('###');
    $('#swimlane0step1buffermedium').html('<img src="/images/ajax-loader.gif">').load('/kanban/dropped_on_step_priority', {swimlane_no:'0', step_no:'1', 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});
    }
});

$('#togglestep1buffer').click(function() {
    if (($('#swimlane0step1buffermedium').is(':visible')) || ($('#swimlane0step1bufferall').is(':visible'))) {
        $('#step1bufferentrycriteria').hide();
        $('#swimlane0step1bufferexpedite').hide();
        $('#swimlane0step1bufferall').hide();
        $('#swimlane0step1buffercritical').hide();
        $('#swimlane0step1bufferhigh').hide();
        $('#swimlane0step1buffermedium').hide();
        $('#swimlane0step1bufferlow').hide();
        $('#swimlane0step1bufferpull').hide();
        $('#swimlane0step1bufferwaiting').hide();
        $('#swimlane0step1bufferblocked').hide();
        $('#swimlane0step1bufferdeferred').hide();
        $('#swimlane0step1bufferghosted').hide();
        $('#step1bufferexitcriteria').hide();
        $('#togglestep1buffer').val('Show');
    } else {
        $('#step1bufferentrycriteria').show();
        $('#swimlane0step1bufferexpedite').show();
        $('#swimlane0step1bufferall').show();
        $('#swimlane0step1buffercritical').show();
        $('#swimlane0step1bufferhigh').show();
        $('#swimlane0step1buffermedium').show();
        $('#swimlane0step1bufferlow').show();
        $('#swimlane0step1bufferpull').show();
        $('#swimlane0step1bufferwaiting').show();
        $('#swimlane0step1bufferblocked').show();
        $('#swimlane0step1bufferdeferred').show();
        $('#swimlane0step1bufferghosted').show();
        $('#step1bufferexitcriteria').show();
        $('#togglestep1buffer').val('Hide');
    }
});