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

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

$('#togglestep8main').click(function() {
    if (($('#swimlane0step8mainmedium').is(':visible')) || ($('#swimlane0step8mainall').is(':visible'))) {
        $('#step8mainentrycriteria').hide();
        $('#swimlane0step8mainexpedite').hide();
        $('#swimlane0step8mainall').hide();
        $('#swimlane0step8maincritical').hide();
        $('#swimlane0step8mainhigh').hide();
        $('#swimlane0step8mainmedium').hide();
        $('#swimlane0step8mainlow').hide();
        $('#swimlane0step8mainpull').hide();
        $('#swimlane0step8mainwaiting').hide();
        $('#swimlane0step8mainblocked').hide();
        $('#swimlane0step8maindeferred').hide();
        $('#swimlane0step8mainghosted').hide();
        $('#step8mainexitcriteria').hide();
        $('#togglestep8main').val('Show');
    } else {
        $('#step8mainentrycriteria').show();
        $('#swimlane0step8mainexpedite').show();
        $('#swimlane0step8mainall').show();
        $('#swimlane0step8maincritical').show();
        $('#swimlane0step8mainhigh').show();
        $('#swimlane0step8mainmedium').show();
        $('#swimlane0step8mainlow').show();
        $('#swimlane0step8mainpull').show();
        $('#swimlane0step8mainwaiting').show();
        $('#swimlane0step8mainblocked').show();
        $('#swimlane0step8maindeferred').show();
        $('#swimlane0step8mainghosted').show();
        $('#step8mainexitcriteria').show();
        $('#togglestep8main').val('Hide');
    }
});