<?xml version="1.0"?> 
<?xml-stylesheet href="xul.css" type="text/css"?> 

<!-- <!DOCTYPE window> -->

<window xmlns:html="http://www.w3.org/TR/REC-html40"
          xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">

<html:script>
	var mode = "undetermined";
	function kickProgressMeter() {
		var meter = document.getElementById("Browser:LoadingProgress");
		dump( "Meter was mode=" + meter.getAttribute("mode") + " value=" + meter.getAttribute("value") + "\n" );
		if ( mode == "undetermined" ) {
			mode = "normal";
			var random = Math.round( Math.random() * 100 )
			dump("Setting meter to (" + mode + ") " + random.toString() + "\n" );
			meter.setAttribute( "value", random.toString() );
		} else {
			mode = "undetermined";
			dump("Setting meter to (undetermined)\n");
		}
		meter.setAttribute( "mode", mode );
	}
</html:script>

<broadcaster id="Browser:LoadingProgress"/>

<html:center>
<html:table border="" cols="3" width="99%" style="color-background:rgb(192,192,192);">
<html:tr>
	<html:td width="3%"  nowrap="" style="border: 1px inset rgb(192,192,192);">
		<html:button onclick="kickProgressMeter()" height="12">
			X
		</html:button>
	</html:td>
	<html:td width="15%" nowrap="" style="border: 1px inset rgb(192,192,192);">
		<progressmeter id="meter" mode="normal" value="61">
			<observes element="Browser:LoadingProgress" attribute="value" />
            <observes element="Browser:LoadingProgress" attribute="mode" />                     
        </progressmeter>
	</html:td>
	<html:td width="82%" nowrap="" style="border: 1px inset rgb(192,192,192);">
		Document: Done (even a stopped clock is right twice a day)
	</html:td>
</html:tr>
</html:table>
</html:center>
</window>
