// (c) Copyright 2014 Adobe Systems, Inc. All rights reserved.

var removeLayerById = function (layerId) {
    var desc = new ActionDescriptor(),
        theRef = new ActionReference(),
        classLayer = charIDToTypeID("Lyr "),
        actionDelete = charIDToTypeID('Dlt ');
    
    theRef.putIdentifier(classLayer, layerId);
    desc.putReference(charIDToTypeID('null'), theRef);
    executeAction(actionDelete, desc, DialogModes.NO);
};
