var bigBoxPos = new Array();
var smallBoxPos = new Array();
var tinyBoxPos = new Array();

function shiftBoxes(x, y) {
	
	$(".first").each(function() 
	{
		var el = bigBoxPos[$(this).attr('id')];
		$(this).css({ backgroundPosition: -(el.left  + x/2)});
	}); 
	$(".second").each(function() 
	{
		var el = smallBoxPos[$(this).attr('id')];
		$(this).css({ backgroundPosition: -(el.left +  x/5)});
	}); 
	$(".third").each(function() 
	{
		var el = tinyBoxPos[$(this).attr('id')];
		$(this).css({ backgroundPosition: el.left +  x/2});
	}); 
}  

$(document).ready(function(){
	$('.first').each(function() { bigBoxPos[$(this).attr('id')] = $(this).position(); });
	$('.second').each(function() { smallBoxPos[$(this).attr('id')] = $(this).position(); });
	$('.third').each(function() { tinyBoxPos[$(this).attr('id')] = $(this).position(); });
	
	$("#scroll").mouseover(function() {
		$("#scroll").mousemove(function(e) {
		shiftBoxes(e.pageX, e.pageY);
		});
		
	});

});
