	// PRELOAD IMAGES
	loadThese = new Array();
	var imgs = 24;
	loadThese[0] = 'center';
	for(j=1;j<imgs;j++){loadThese[j]=j;}
	$.preload(loadThese, {
		base:'img/homepage/',
		ext:'.jpg'
	});        
	randArray = new Array(1,2,3,4,5,6,7,8);
	randArray.sort( randOrd );
	var arrayPos = 0;
	var imageSet = 0;
	function fadeThis()
	{
		if (arrayPos >= 8){ arrayPos=0; imageSet++; randArray.sort( randOrd );}
                if (imageSet >=  3){imageSet=0;}
                var i = randArray[arrayPos];
		var k = imageSet*8 + i;
                arrayPos++;
		var randContainer = '#img_' + i;
		var randImg = k + '.jpg';
		if ($(randContainer).html() == ''){
			$(randContainer).html('<img src="img/homepage/' + randImg + '" style="display:none;"  />');
			$(randContainer + ' img').fadeIn(3000).fadeOut(3000, function(){$(this).parent().empty();});
		}
	}
        function randOrd(){ return (Math.round(Math.random())-0.5); }
	$(document).ready(function() {
		$('#loader').hide();
		fadeThis();
		setInterval(fadeThis, 2800);
		$('#content_wrapper div').hover(
                        function()
			{
				if ($(this).html() == '' && this.id != '')
				{
					currDiv = this.id.split("_");
                                        var pos = parseInt(currDiv[1]);
                                        $(this).html('<img src="img/homepage/' + (imageSet*8+pos) + '.jpg" style="display:none;"  />');
					$(this).children().fadeIn(3000);
				}
			}, 
			function()
			{
				if($(this).html() != ''  && this.id != '')
				{
					$(this).children().fadeOut(3000, function(){$(this).parent().empty();});
				}
			}
		);
	});