var ad_index = 1;
function update_offer() {
  new Effect.Fade($('fp_img'), {afterFinish: show_next_ad});
}
function show_next_ad() {
  $('fp_img').src = ads[ad_index];
  new Effect.Appear($('fp_img'));
  ad_index += 1;
  ad_index %= ads.length;
  setTimeout( update_offer, 6000 );
}
setTimeout( update_offer, 6000 );
