Certainly. The entire code of Step 1 can be inserted in an external .js file. Then you'd reference it on your page as such:
Code:
<script src="thumbnail.js" type="text/javascript">
/***********************************************
* Image Thumbnail Viewer II script- © Dynamic Drive DHTML code library (www.dynamicdrive.com)
* Visit http://www.dynamicDrive.com for hundreds of DHTML scripts
* This notice must stay intact for legal use
***********************************************/
</script>
Attached is how "thumbnail.js" would look like.
Bookmarks