var winwidth, winheight, wrapelement, offsetx, offsety, correct = false;

window.onload = window.onresize = window.onscroll = positionWrap;

function getDimensions() {

if (self.innerHeight) // all except Explorer
	{
		winwidth = self.innerWidth;
		winheight = self.innerHeight;
		offsetx = self.pageXOffset;
		offsety = self.pageYOffset;
		correct = 16;
	}
else if (document.documentElement && document.documentElement.clientHeight)
	// Explorer 6 Strict Mode
	{
		winwidth = document.documentElement.clientWidth;
		winheight = document.documentElement.clientHeight;
		offsetx = document.documentElement.scrollLeft;
		offsety = document.documentElement.scrollTop;
	}
else return false;

}

function positionWrap() {
var bgleft, bgtop = 0;
getDimensions();
if (!wrapelement)
	wrapelement = document.getElementById('wrap');
if (1000 > winwidth) {

	var bgleft = -1280 + Math.round(winwidth/2) - offsetx + "px";

}

else var bgleft = "center";

if (456 > winheight) {

	var bgtop = -934 + Math.round(winheight/2) - offsety + "px";

}

else var bgtop = "center";

document.body.style.backgroundPosition = bgleft+' '+bgtop;

}
