////////////////////////////////////////////////////////////////////////////////////
//This JS file contains code for formatting the page correctly.
//Code to control dynamic relocation of ads when pages are resized.
//Created by Paul Barton
$(document).ready(function() {
	resize("#mpu_ad_outer");
        
});
$(window).resize(function() {
	resize("#mpu_ad_outer");
});

function resize(ad) {
	var windowWidth = $(window).width();
	var mpuWidth = $(ad).width() + (parseInt($(ad).css("margin-left"))*2);
	var left = (windowWidth/2)-(mpuWidth/2);
	if(left <0) {
		left = 0;
	}
	$(ad).css("left",left);
	$(ad).css("display", "block");
}
