Percolation model of galactic structure