<div><span class="intro">下载进度:</span>
<div class="barborder">
<div class="bar" id="loadpercent"></div>
</div>
</div>
<div id="showAD"></div>
<div id="showSWF" class="show" style="display:none;">
<object id="flashgame" ......省略内容......>
</object>
</div>
<script language="javascript">
<!--
if(window.navigator.userAgent.indexOf("Firefox")>=1)//判断是否为FIREFOX浏览器,FIREFOX不支持PercentLoaded()函数
{
document.getElementById("loadpercent").innerHTML= "Firefox!No Attentions";
document.getElementById("showSWF").style.display='block';
}
else
{
refreshProgress();
}
function show()//隐藏AD层、显示FLASH层
{
document.getElementById("showAD").style.display='none';
document.getElementById("showSWF").style.display='block';
}
function refreshProgress()//刷新进度条函数
{
var downProgressWidth=502;
var bar = document.getElementById("loadpercent");
var movie = document.getElementById("flashgame");
var nPercentLoaded = Math.abs(movie.PercentLoaded());
bar.style.width=Math.ceil(downProgressWidth*nPercentLoaded/100)+"px";
bar.innerHTML= nPercentLoaded+"%";
if(nPercentLoaded==100)
{
bar.style.width=(downProgressWidth-2)+"px";
bar.innerHTML= "Game download is complete";
show();
}
else
{
setTimeout('refreshProgress()',0);
}
}
//-->
</script>