Javascript on working on cMAP template