<h2>Scripting example</h2> 

<pre> 
/******************************************************* 
* Support script for VMaxFileLoader applet * 
* This script uses customized functions form * 
* VMaxDHTML Lib v6.2. For the full library please visit * 
* Virtual_Max's cafe ( http://come.to/vmax ) * 
* This script and it's derivatives are free for use * 
* if and only if this notice remains unchanged and present in * 
* all copies and derivatives. * 
* (C)2001 Virtual_Max Revision: 03/15/2001 * 
*******************************************************/ 
  

var loader=null; 
var obj; 
<font color="#808080"> 
// this function will be called by applet 
// when applet finished loading document 
</font> 
function setContent(s){ 
if(obj==null) obj = getById(divName); 
changeContent(obj,s); 
//fix page scrolles in NN4; 
if(document.layers) setTimeout("document.height=40+"+(obj.top+obj.clip.height)+";",300); 
} 
  

<font color="#808080"> 
// this function is called from links onclick handlers 
// to call applet load(String url) method and start document 
// loading , but first it checks that applet finished loading. 
</font> 
function loadURL(url) { 
if(loader!=null) loader.load(url); 
} 
<font color="#808080"> 
// Helper function to get DIV with given ID 
// from document in browser independent manner 
// note div must have CSS positioning either 
// absolute ether relative, otherwise this wouldn't 
// work in NN4. 
</font> 
function getById(id,o){ 
if(document.getElementById) return document.getElementById(id); 
if(document.all) return document.all[id] 
if(o==null) o=window.document; 
if(o.layers[id]) return o.layers[id] 
for(var i=0; i&lt;o.layers.length; i++) { 
var oo=getById(id,o.layers[i].document); 
if(oo!=null) return oo; 
} 
alert(id +" not found") 
return null; 
} 
<font color="#808080"> 
// This function change content of div object 
// in browser independent manner. 
// used internaly by script function setContent 
</font> 
function changeContent(o,content){ 
if(o==null) return; 
if(document.layers){ 
o.document.writeln(content); 
o.document.close(); 
} 
else o.innerHTML = content 
} 
<font color="#808080"> 
// function myunescape is REQUIRED !!!! 
// called internally by vmaxfileloader applet 
// without it the applet won't work 
// be sure you always include this function 
// in your scripts !!!!!!!!!!!!!!!!!!!!!!!! 
</font> 
function myunescape(s){ 
var inx=0; 
while((inx=s.indexOf('+',inx))>=0){ 
s=s.substring(0,inx)+' '+s.substring(inx+1); 
} 
return unescape(s); 
} 

<font color="#808080"> 
// workaround of NN4 window resise bug 
</font> 
if(!document.all){ 
var oldW=window.innerWidth, oldH=window.innerHeight; 
function fixResize(){ 
if(document.layers) 
if(oldW!=window.innerWidth || oldH!=window.innerHeight) 
history.go(0); 
} 
window.onresize=fixResize; 
} 
</pre> 