<!--
	show the loading progress as percent text
	- just include once this xml
-->
<krpano>

	<!-- loading percent events -->
	<events name="loadingpercent" keep="true"
	        onxmlcomplete="loadingpercent_startloading();"
	        onloadcomplete="delayedcall(2.25, loadingpercent_stoploading() );"
	        />

	<!-- loading percent text -->
	<layer name="loadingpercent_text" keep="true"
	       url="%SWFPATH%/plugins/textfield.swf"
	       align="center"
	       y="10%"
	       background="false"
	       css="color:#ffffff; font-family:Arial; font-weight:bold; font-size:22px; font-style:italic;" textshadow="2"
	       html="111111111"
	       />

	<!-- loading percent actions -->
	<action name="loadingpercent_startloading">
		set(loadingpercent_isloading, true);
		set(layer[loadingpercent_text].visible, true);

		asyncloop(loadingpercent_isloading,
			mul(pvg, progress.progress, 100);
			roundval(pvg,0);
			txtadd(layer[loadingpercent_text].html, 'Loading ', get(pvg), '%');
		  );
	</action>

	<action name="loadingpercent_stoploading">
		set(loadingpercent_isloading, false);
		set(layer[loadingpercent_text].visible, false);
	</action>

</krpano>