Porting advanced embargo function to JSPUI
Fixed some codes as the code reviews by helix84