-added php function to generate js trigger events