Event.observe(window, 'load', function() {
	moveStuff();			
});


Event.observe(window, 'resize', function() {
	moveStuff();				
});

function moveStuff() {
	
	// determine screen width
	
	var window_width =  document.viewport.getWidth();
	
	var holder_potwidth = window_width - 408;
	
	num_rows = Math.floor(holder_potwidth / 192);
	
	holder_width = num_rows * 192;
	
	if(window_width <= 1170) { //design must be scooted around
		
		if(window_width >=970) {						
			
			$('photo_main_holder').setStyle({'width':holder_width+'px'});
			$('footer').setStyle({ 'top': '800px'});
			
		} else if(window_width >=790) {

			$('photo_main_holder').setStyle({'width':holder_width+'px'});
			$('footer').setStyle({ 'top': '1100px'});
			
		} else if(window_width >=630) {

			$('photo_main_holder').setStyle({'width':holder_width+'px'});
			$('footer').setStyle({ 'top': '1770px'});
			
		}
			
			
	} else { // revert to widest layout
	
		$('photo_main_holder').setStyle({'width':holder_width+'px'});
			$('footer').setStyle({ 'top': '652px'});
		
	}
				
		
};

