Sample code to allocate port numbers

<script language="JavaScript">
<!--
// Add JavaScript code here to determine the port number.
function getPort()
{
   return "23";
}
document.writeln( '<applet mayscript name="Dynamic_Port"' );
document.writeln( ' code="com.wrq.rweb.Launcher.class"' );
document.writeln( ' codebase="./ex/"' );
document.writeln( ' width="0" height="0"' );
document.writeln( ' archive="Launcher.jar">' );
// Get the value for the port and insert it into the applet parameter.
port = getPort();
document.writeln( '<param name="hostURL" value="tn3270://MyHost:' + port + '">' );
document.writeln( '<param name="frame" value="true">' );
document.writeln( '<param name="menuType" value="advanced">' );
document.writeln( '<param name="autoDetect" value="true">');
document.writeln( '<param name="launcher.sessions" value="session type">');
document.writeln( '</applet>' );

// End of comment -->
</script>