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

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

$('#togglestep0main').click(function() {
    if (($('#swimlane0step0mainmedium').is(':visible')) || ($('#swimlane0step0mainall').is(':visible'))) {
        $('#step0mainentrycriteria').hide();
        $('#swimlane0step0mainexpedite').hide();
        $('#swimlane0step0mainall').hide();
        $('#swimlane0step0maincritical').hide();
        $('#swimlane0step0mainhigh').hide();
        $('#swimlane0step0mainmedium').hide();
        $('#swimlane0step0mainlow').hide();
        $('#swimlane0step0mainpull').hide();
        $('#swimlane0step0mainwaiting').hide();
        $('#swimlane0step0mainblocked').hide();
        $('#swimlane0step0maindeferred').hide();
        $('#swimlane0step0mainghosted').hide();
        $('#step0mainexitcriteria').hide();
        $('#togglestep0main').val('Show');
    } else {
        $('#step0mainentrycriteria').show();
        $('#swimlane0step0mainexpedite').show();
        $('#swimlane0step0mainall').show();
        $('#swimlane0step0maincritical').show();
        $('#swimlane0step0mainhigh').show();
        $('#swimlane0step0mainmedium').show();
        $('#swimlane0step0mainlow').show();
        $('#swimlane0step0mainpull').show();
        $('#swimlane0step0mainwaiting').show();
        $('#swimlane0step0mainblocked').show();
        $('#swimlane0step0maindeferred').show();
        $('#swimlane0step0mainghosted').show();
        $('#step0mainexitcriteria').show();
        $('#togglestep0main').val('Hide');
    }
});