google.load("jquery", "1.3.2"); google.setOnLoadCallback(fadeImage); var images = new Array( "home2.jpg", "home1.jpg", "home3.jpg" ); for (i in images) { var img = new Image(); img.src = "http://flash-geo.ru/random/" + images[i]; } var i = 0; var n = 3; function fadeImage() { $("#random_img").fadeOut("fast", function() { $("#random_img").attr("src", "http://flash-geo.ru/random/" + images[i]); $("#random_img").fadeIn("slow"); i++; if (i == n) i = 0; window.setTimeout("fadeImage()", 5000); }); }