Functional determinants on Mandelstam diagrams