// DELETES A LAYER GROUP, TRUE / FALSE DELETE GROUP CONTENTS
function deleteGroup(layerGroup, deleteContents) {
if (layerGroup.typename == "LayerSet") {
doc.activeLayer = layerGroup;
var desc001 = new ActionDescriptor();
var ref001 = new ActionReference();
ref001.putEnumerated( charIDToTypeID( "Lyr " ), charIDToTypeID( "Ordn" ), charIDToTypeID( "Trgt" ) );
desc001.putReference( charIDToTypeID( "null" ), ref001 );
desc001.putBoolean( stringIDToTypeID( "deleteContained" ), deleteContents );
executeAction( charIDToTypeID( "Dlt " ), desc001, DialogModes.NO );
}
}