how to toggle image effect with a mouse click

i want a script to toggle image effects when i press certain key(Mouse1 for ex)
then i want it to be disabled when i press it again
can any one help me to do that with Javascript
not C# cauz i beleive when you do that with c# it wont recoginize the image effect (tried it alredy)

look ive a got a C# script (image effect) i want it to be anabled when i RightMB click