// by Vic Phillips (22-April-2006) http://www.vicsjavascripts.org.uk

var zxcImgPath='';
var zxcImgAry=['/pasek.gif'];

var zxcBObj,zxcTO;

function zxcInitBanner(id,pth,ary,zxcw,zxch){
 var zxcp=document.getElementById(id)
 zxcp.cnt=0;
 zxcp.ary=[];
 for (var zxc0=0;zxc0<Math.max(zxcImgAry.length,Math.ceil(zxcp.offsetWidth/zxcw)+1);zxc0++){
  zxcp.cnt=++zxcp.cnt%ary.length;
  zxcp.ary[zxc0]=document.createElement('img');
  zxcp.ary[zxc0].src=pth+ary[zxcp.cnt];
  zxcStyle(zxcp.ary[zxc0],{position:'absolute',left:(zxcw*zxc0)+'px',top:'0px',width:zxcw+'px',height:zxch+'px'});
  zxcp.appendChild(zxcp.ary[zxc0]);
 }
 zxcp.cnt=0;
 zxcp.first=zxcp.ary[zxcp.cnt];
 zxcp.last=zxcp.ary[zxcp.ary.length-1];
 zxcBObj=zxcp;
 setTimeout('zxcRotate()',500);
}

function zxcRotate(){
 for (var zxc0=0;zxc0<zxcBObj.ary.length;zxc0++){
  zxcBObj.ary[zxc0].style.left=(parseInt(zxcBObj.ary[zxc0].style.left)-1)+'px';
  if (parseInt(zxcBObj.first.style.left)+parseInt(zxcBObj.first.style.width)<0){
   zxcBObj.first.style.left=(parseInt(zxcBObj.last.style.left)+parseInt(zxcBObj.last.style.width))+'px'  ;
   zxcBObj.last=zxcBObj.first;
   zxcBObj.cnt=++zxcBObj.cnt%zxcBObj.ary.length;
   zxcBObj.first=zxcBObj.ary[zxcBObj.cnt];
  }
 }
 zxcTO=setTimeout('zxcRotate()',50);
}

function zxcStyle(zxcele,zxcstyle){
 for (key in zxcstyle){ zxcele.style[key]=zxcstyle[key]; }
}