﻿var N=-1;function createBar(width,height,bgColor,borderWidth,borderColor,blockColor,speed,blocks){var w3c=document.getElementById?true:false;var ie=document.all?true:false;var newBar;if(w3c||ie){var t='<div id="_xpbar'+(++N)+'" style="visibility:visible; clear:both; position:relative; overflow:hidden; width:'+width+'px; height:'+height+'px; background-color:'+bgColor+'; border-color:'+borderColor+'; border-width:'+borderWidth+'px; border-style:solid; font-size:1px;">';t+='<span id="blocks'+N+'" style="left:-'+(height*2+1)+'px; position:absolute; font-size:1px">';for(i=0;i<blocks;i++){t+='<span style="background-color:'+blockColor+'; left:-'+((height*i)+i)+'px; font-size:1px; position:absolute; width:'+height+'px; height:'+height+'px; '
t+=(ie)?'filter:alpha(opacity='+(100-i*(100/blocks))+')':'-Moz-opacity:'+((100-i*(100/blocks))/100);t+='"></span>';}
t+='</span></div>';document.write(t);if(ie)
newBar=document.all['blocks'+N];else
newBar=document.getElementById('blocks'+N);if(ie)
newBar.bar=document.all['_xpbar'+N];else
newBar.bar=document.getElementById('_xpbar'+N);newBar.blocks=blocks;newBar.N=N;newBar.width=width;newBar.height=height;newBar.speed=speed;newBar.counter=0;newBar.showBar=function(){this.bar.style.visibility='visible';}
newBar.hideBar=function(){this.bar.style.visibility='hidden';}
newBar.displayBar=function(){this.bar.style.visibility='visible';setInterval('startBar('+N+')',speed);}
return newBar;}}
function startBar(blockNumber){var w3c=document.getElementById?true:false;var ie=document.all?true:false;var thisBlock;if(ie)
thisBlock=document.all['blocks'+blockNumber];else
thisBlock=document.getElementById('blocks'+blockNumber);if(parseInt(thisBlock.style.left)+thisBlock.height+1-(thisBlock.blocks*thisBlock.height+thisBlock.blocks)>thisBlock.width){thisBlock.style.left=-(thisBlock.height*2+1)+'px';thisBlock.counter++;}
else
thisBlock.style.left=(parseInt(thisBlock.style.left)+thisBlock.height+1)+'px';}