You can hold your javascripts in a seperate text file named whatever.js , by including a reference to that page by inserting <script language="javascript" src="whatever.js"></script>
Its good if you use the same scripts over and over again on different pages as it keeps the total file size down and the client only needs to load it once.