added a javascript snippet for if(..)