image_url = new Array(); var countImages = image_url.length; var rotator_id = 'bn_rotate' var rotator_speed = 8000 var timer=0; var count_preload = 0; function preload() { if (document.getElementById(rotator_id) && count_preload > 0){ index = Math.floor(Math.random() * image_url.length); file = 'http://www.szszv.eu/mediafiles/bn/'+image_url[index] swapfade(document.getElementById(rotator_id), file, '1', '') } count_preload++; timer = window.setTimeout('preload()', rotator_speed); } dw_Event.add( window, 'load', preload);