// Copyright (c) 1999 Macromedia. All rights reserved.

var pixel = fw.getDocumentDOM().getPixelMask();

// Figure out if there is a selection that the user made

if (pixel == null){
	
	var currentSel = fw.selection;
	if (currentSel == null || currentSel.length == 0)
		fw.getDocumentDOM().selectAll();

	// Now run the filters
	fw.getDocumentDOM().applyEffects(
		{ 
			category:"Untitled",
			effects:[ 
				{ 
					EffectIsVisible:true,
					EffectMoaID:"{3439b08d-1922-11d3-9bde00e02910d580}",
					MB_filter_preview_tile_size:"-1 -1",
					category:"Adjust Color",
					hls_colorize:true,
					hue_amount:0,
					lightness_amount:0,
					name:"Hue/Saturation...",
					saturation_amount:0 
				} 
			],
			name:"Untitled" 
		}
	);
} else {

	// Run the filters on the user selected pixels
	fw.getDocumentDOM().filterSelection(
		{ 
			EffectMoaID:"{3439b08d-1922-11d3-9bde00e02910d580}",
			MB_filter_preview_tile_size:"-1 -1",
			hls_colorize:true,
			hue_amount:0,
			lightness_amount:0,
			saturation_amount:0 
		}
	);
}

