Restoring watermark javascript function