function arrow_down_right(id)
{
	var is_vis = Element.visible(id);
	if (false) {
		if (is_vis) { $(id).hide(); } else { $(id).show(); }
		$(id + "_img").src = (is_vis) ? "../images/small-right.gif" : "../images/small-down.gif";
	} else {
		var args = arguments[1] || {duration: 0.25};
		if (is_vis) {
			args.afterFinish = function () { $(id + "_img").src = "../images/small-right.gif"; }
		} else {
			args.afterFinish = function () { $(id + "_img").src = "../images/small-down.gif"; }
		}
		new Effect[is_vis ? 'BlindUp' : 'BlindDown'](id, args);
	}
}

function get_random( start, end )
{
	var ranNum;
	if( start == end ) {
		ranNum = start;
	} else {
		ranNum = ( Math.floor(Math.random()*end) + start);
	}//document.write(ranNum+100);
    return ranNum;
}

var files = new Array();
files[1] = "fct";
files[9] = 3;
files[2] = "dc"
files[10] = 3;
files[3]  = "pp";
files[11] = 4;
files[4] = "msr";
files[12] = 2;
files[5] = "gsr";
files[13] = 1;
files[6] = "pv";
files[14] = 3;
files[7] = "ms";
files[15] = 1;
files[8] = "sp";
files[16] = 3;

function changeImages() {
	r = get_random( 1, files[ i + 8 ] );
	el = eval("document.getElementById('home-random-image-'+i)");
	el.src = "images/home/"+files[i]+"/home-"+r+".jpg";
}

function random_loader( count, duration, delay ) {
	var index = 0;
	var home_element = document.getElementById("home-random-back");
	if( home_element != null ) {
		for( var i = 1; i <= count; ++i ) {
			Effect.Appear( "home-random-image-"+i, { queue: 'end', duration: duration } );
			Effect.Fade( "home-random-image-"+i, { 	queue: 'end', 
													delay: delay, 
													duration: duration, 
													afterFinish: function () {
																					++index;
																					r = get_random( 1, files[ index + 8 ] );
																					//document.write( r );
																					el = eval("document.getElementById('home-random-image-'+index)");
																					el.src = "images/home/"+files[index]+"/home-"+r+".jpg";
																					//document.write(el.src);
																				}
												}
						);
		}
		interval = 900 * ( count + duration + delay );
		setTimeout( "random_loader( "+count+", "+duration+", "+delay+" )", interval );
	}
}
