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

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

$('#togglestep4main').click(function() {
    if (($('#swimlane0step4mainmedium').is(':visible')) || ($('#swimlane0step4mainall').is(':visible'))) {
        $('#step4mainentrycriteria').hide();
        $('#swimlane0step4mainexpedite').hide();
        $('#swimlane0step4mainall').hide();
        $('#swimlane0step4maincritical').hide();
        $('#swimlane0step4mainhigh').hide();
        $('#swimlane0step4mainmedium').hide();
        $('#swimlane0step4mainlow').hide();
        $('#swimlane0step4mainpull').hide();
        $('#swimlane0step4mainwaiting').hide();
        $('#swimlane0step4mainblocked').hide();
        $('#swimlane0step4maindeferred').hide();
        $('#swimlane0step4mainghosted').hide();
        $('#step4mainexitcriteria').hide();
        $('#togglestep4main').val('Show');
    } else {
        $('#step4mainentrycriteria').show();
        $('#swimlane0step4mainexpedite').show();
        $('#swimlane0step4mainall').show();
        $('#swimlane0step4maincritical').show();
        $('#swimlane0step4mainhigh').show();
        $('#swimlane0step4mainmedium').show();
        $('#swimlane0step4mainlow').show();
        $('#swimlane0step4mainpull').show();
        $('#swimlane0step4mainwaiting').show();
        $('#swimlane0step4mainblocked').show();
        $('#swimlane0step4maindeferred').show();
        $('#swimlane0step4mainghosted').show();
        $('#step4mainexitcriteria').show();
        $('#togglestep4main').val('Hide');
    }
});