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

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

$('#togglestep2main').click(function() {
    if (($('#swimlane0step2mainmedium').is(':visible')) || ($('#swimlane0step2mainall').is(':visible'))) {
        $('#step2mainentrycriteria').hide();
        $('#swimlane0step2mainexpedite').hide();
        $('#swimlane0step2mainall').hide();
        $('#swimlane0step2maincritical').hide();
        $('#swimlane0step2mainhigh').hide();
        $('#swimlane0step2mainmedium').hide();
        $('#swimlane0step2mainlow').hide();
        $('#swimlane0step2mainpull').hide();
        $('#swimlane0step2mainwaiting').hide();
        $('#swimlane0step2mainblocked').hide();
        $('#swimlane0step2maindeferred').hide();
        $('#swimlane0step2mainghosted').hide();
        $('#step2mainexitcriteria').hide();
        $('#togglestep2main').val('Show');
    } else {
        $('#step2mainentrycriteria').show();
        $('#swimlane0step2mainexpedite').show();
        $('#swimlane0step2mainall').show();
        $('#swimlane0step2maincritical').show();
        $('#swimlane0step2mainhigh').show();
        $('#swimlane0step2mainmedium').show();
        $('#swimlane0step2mainlow').show();
        $('#swimlane0step2mainpull').show();
        $('#swimlane0step2mainwaiting').show();
        $('#swimlane0step2mainblocked').show();
        $('#swimlane0step2maindeferred').show();
        $('#swimlane0step2mainghosted').show();
        $('#step2mainexitcriteria').show();
        $('#togglestep2main').val('Hide');
    }
});