window.onload = fixmargin;

window.onresize = fixmargin;

function fixmargin() {
	
	var windowWidth			= 0;
	var marginLeft			= 0;
	var swfWidth			= 1300;
	var offset				= -195;
	var startCenteringWidth = swfWidth - Math.abs(offset * 2);
	
	if (typeof(window.innerWidth) == 'number') {
		windowWidth = window.innerWidth;
	} else if (document.documentElement && (document.documentElement.clientWidth || document.documentElement.clientHeight)) {
		windowWidth = document.documentElement.clientWidth;
	} else if(document.body && (document.body.clientWidth || document.body.clientHeight)) {
		windowWidth = document.body.clientWidth;
	}
	
	if (windowWidth <= startCenteringWidth) {
		marginLeft = offset;
	} else if (windowWidth > startCenteringWidth && windowWidth < swfWidth) {
		marginLeft = Math.round(offset + ((Math.abs(offset * 2) - (swfWidth - windowWidth)) / 2));
	} else {
		marginLeft = Math.round((windowWidth - swfWidth) / 2);
	}
	
	document.getElementById('container').style.left = marginLeft + "px";
}