Galactic fountains and their connection with high and intermediate velocity clouds