Some times its really helpful to link the external js files to a form.
It will help you, that you can srite in a file by using VS studio or any js editor.
//create the function which will load the file
var netRequest = new ActiveXObject("Msxml2.XMLHTTP");
netRequest.open("GET", scriptFile, false);
//call the above function by passing your file name(absolute path)
//now call the OnLoad function, which has defined in the external JS file
//also you can define and call other function, in the external JS files
Have a wonderful coding.