	trasp = "image/trasp.gif";
	curr_imgs = new Array (6);
	last_img1 = 0;
	last_img2 = 0;
	img_alpha = 100;
	step = 5;
	time_step = 60;
	min_wt = 750;
	max_wt = 2000;

	function init_imgs(){
		end_index = Math.min (8, imgs.length);
		for (i=1; i<=end_index; i++){
			x = Math.floor (imgs.length * Math.random());
			img = document.getElementById ("img_down" + i);
			curr_imgs[i] = imgs[x];
			img.src = curr_imgs[i];
			imgs.splice (x, 1);
		}
		img_rotate();
	}
	
	function img_rotate(){
		if (imgs.length){
			chg_img = 1 + Math.floor (8 * Math.random());
			while (chg_img == last_img1 || chg_img == last_img2)
				chg_img = 1 + Math.floor (8 * Math.random());
			last_img2 = last_img1;
			last_img1 = chg_img;
			x = Math.floor (imgs.length * Math.random());
			img = document.getElementById ("img_up" + chg_img);
			img_alpha = 0;
			img.style.opacity = img_alpha / 100;
			img.style.filter = "alpha(opacity=" + img_alpha + ")";
			img.src = imgs[x];
			imgs.splice (x, 1, curr_imgs[chg_img]);
			img_fade();
		}
	}
	
	function img_fade(){
		img = document.getElementById ("img_up" + chg_img);
		if (img_alpha < 100){
			img_alpha = Math.min (100, img_alpha + step);
			img.style.opacity = img_alpha / 100;
			img.style.filter = "alpha(opacity=" + img_alpha + ")";
			window.setTimeout ('img_fade()', time_step);
		} else {
			back = document.getElementById ("img_down" + chg_img);
			back.src = img.src;
			curr_imgs[chg_img] = img.src;
			img.src = trasp;
			window.setTimeout ("img_rotate()", min_wt + Math.floor ((max_wt - min_wt) * Math.random()));
		}
	}
	
	
