Understanding Surfactant and Neonatal Respiratory Distress

A newborn baby exhibits signs of respiratory distress due to the lack of surfactant. She has signs of low oxygen and high carbon dioxide. Explain the following in depth:

What is the role of surfactant, what cell secretes it, and when does the body start its production as well as when it is secreted?
Why does the lack of surfactant result in respiratory distress?
What type of acid-base disorder would the infant develop?
How would the infants body compensate for the acid-base disorder?