Right... so read the error message again, and put 2 and 2 together..
The error states that there is output in main.php which means all the headers for the page are already sent. So when you include top_line.php, you can't use any function that requires headers to not be sent yet.
The error is self explanatory. You can't send anything (whitespace, html, plaintext) to the browser before a session_start() call.
The easiest way to do this is to take the HTML and put it into a variable, then when everything is done, echo that variable, rather than echoing the HTML as you go.