Javascript for Cognos Tree Prompt - Multi Select

Can anyone provide me the javascript code for Cognos Tree Prompt Multi select please.

  1. By Default when we select Child Node the parent Node will get Greyed out

  2. My user is selecting Greyed out Parent Node again and Child Node which is showing ambiguous results.

I need to put a Validation Both Parent Node and Child Nodes of that category should not be selected at the same time

Please help me on this!