Ive seen the sample to add a legend and the sample to toggle layer visability. Is there a way to combine the two and make the legend more like the table of contents in ArcMap/ArcServer to toggle the layers? I'm fairly new to JavaScript so if its too complicated, I can work on this aspect later. Thanks.