jQuery(document).ready(function(){

	
	var onimages = ['includes/images/shopon.jpg', 'includes/images/liveon.jpg', 'includes/images/workon.jpg'];
	var offimages = ['includes/images/shopoff.jpg', 'includes/images/liveoff.jpg', 'includes/images/workoff.jpg'];
	var people = ['includes/images/shop.jpg', 'includes/images/live.jpg', 'includes/images/work2.jpg'];

/*	
	var images = [];
	for (i = 0; i < preload.length; i++) {
	    images[i] = new Image();
	    images[i].src = preload[i];
	}
*/	


	$(".ltop #shop").hover(
		function(){
				
				time = false;
				
				$(this).find("img").attr({src: onimages[0]});
				
				$('.ltop img').each(function(i) {
					if (i != 0) {
						$(this).attr({src: offimages[i]});
					}
					// change middle stuff
					
				});
				$('#middleswap').load('includes/resources/middle.php?id=shop');
				//var image = $('.floatright img').attr("src");
				$('.floatright img').attr({src: people[0]});
				$('#bottomswap').load('includes/resources/promos.php?sid=shop');
				
		}
		
	);  // end of function
	
	
	$(".ltop #live").hover(
		function(){
				$(this).find("img").attr({src: onimages[1]});
				
				$('.ltop img').each(function(i) {
					if (i != 1) {
						$(this).attr({src: offimages[i]});
					}
					// change middle stuff
				});
				$('#middleswap').load('includes/resources/middle.php?id=live');
				$('.floatright img').attr({src: people[1]});
				$('#bottomswap').load('includes/resources/promos.php?sid=live');
				
		}
		
	);  // end of function
	
	$(".ltop #work").hover(
		
		function(){
				$(this).find("img").attr({src: onimages[2]});
				$(this).find("img").attr({src: onimages[2]});
				
				
				$('.ltop img').each(function(i) {
					if (i != 2) {
						$(this).attr({src: offimages[i]});
					}
					// change middle stuff
				});
				$('#middleswap').load('includes/resources/middle.php?id=work');
				$('.floatright img').attr({src: people[2]});
				$('#bottomswap').load('includes/resources/promos.php?sid=work');
				
		}
	);  // end of function

	// loop around until they actually hover over something
		setTimeout('$(".ltop #live").trigger("mouseenter");', 3000);
		setTimeout('$(".ltop #work").trigger("mouseenter");', 6000);
		setTimeout('$(".ltop #shop").trigger("mouseenter");', 9000);
});

