// Script to move the #outer div to center of the screen

// initially moves #outer to 0px left then fires the movepage

function movePageToZero () {
	
	// get the width of the screen
	width = $(window).width();
	//alert(width);
	//alert('movePageToZero');
	
	if (width < 1400 ) {
		// margin back to zero for #outer
		$("#outer").css({margin: 0});
		
		// initialise page moving function
		movePageToNew ();
		
	} 
}

// works out how far the page margin has to move to centre the #outer div

function movePageToNew () {
	// get width of window
	width = $(window).width();
	//alert(width);
	// work out hom much the #outer has to be moved
	toMove = (1400 - width) /2;
	//alert(toMove);
	// move the #outer div
	$("#outer").css({marginLeft: -toMove });
}

$(document).ready(function(){

	movePageToZero();

});

// move function fired up again on window resize

$(window).resize(function() {

	movePageToZero ();
	//alert('here');

});




