improve js function wrapping to prepare overlaid view
avoid loading twice the same script with overlaid viewing mode
change the post request from a overlaid view