program2.js minor changes

using window.onload event instead of HTML5
window.document.onreadystatechange