Without looking at the sourcecode, I can't say what the intended usage of these functions is. However, This is how I would implemment these functions in my code...
<html>
<head>
<SCRIPT language="JavaScript">
<!--
// main() - An attempt to maintain a Structured Script
// NOTE: All statements should be made within
// function calls or as javascript:function
// call within the HTML
main(); // First Command to be executed
function main()
{
alert("Executing..... main()"

;
}
// onLoad()
// Invoked from tag: <Body onLoad("onLoad()"

>
function onLoad()
{
alert("Executing..... onLoad()"

;
}
//-->
</SCRIPT>
</head>
<body onLoad="Main()" bgcolor="#FFFFFF" text="#000000">
</body>
</html>
Script Usage:
Main():
A call to main()is the first line to be executed and is called between <head> and </head>. This routine is generally used for variable and some object initialization This routine is placed between the <head> and </head> tags to allow the user to make document.write() function calls.
onLoad():
Invoked from tag: <Body onLoad("onLoad()"

>
This event fires after the </body> of a document has been drawn, and provides a convenient place to create object references for the components that are exposed by the browser's DOM (Document Object Model).
Notes:
(1) document.write() will fail if called after the </body> of a document has been drawn. Use this function from main()
(2) DOM references must be created in or after the onLoad event.