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

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

$('#togglestep1main').click(function() {
    if (($('#swimlane0step1mainmedium').is(':visible')) || ($('#swimlane0step1mainall').is(':visible'))) {
        $('#step1mainentrycriteria').hide();
        $('#swimlane0step1mainexpedite').hide();
        $('#swimlane0step1mainall').hide();
        $('#swimlane0step1maincritical').hide();
        $('#swimlane0step1mainhigh').hide();
        $('#swimlane0step1mainmedium').hide();
        $('#swimlane0step1mainlow').hide();
        $('#swimlane0step1mainpull').hide();
        $('#swimlane0step1mainwaiting').hide();
        $('#swimlane0step1mainblocked').hide();
        $('#swimlane0step1maindeferred').hide();
        $('#swimlane0step1mainghosted').hide();
        $('#step1mainexitcriteria').hide();
        $('#togglestep1main').val('Show');
    } else {
        $('#step1mainentrycriteria').show();
        $('#swimlane0step1mainexpedite').show();
        $('#swimlane0step1mainall').show();
        $('#swimlane0step1maincritical').show();
        $('#swimlane0step1mainhigh').show();
        $('#swimlane0step1mainmedium').show();
        $('#swimlane0step1mainlow').show();
        $('#swimlane0step1mainpull').show();
        $('#swimlane0step1mainwaiting').show();
        $('#swimlane0step1mainblocked').show();
        $('#swimlane0step1maindeferred').show();
        $('#swimlane0step1mainghosted').show();
        $('#step1mainexitcriteria').show();
        $('#togglestep1main').val('Hide');
    }
});