Moved jQuery code that alters embedded modal forms to within the functions that embeds the form.