function positionIt() {
	thiswidth = document.body.scrollWidth;
	thisheight = document.body.scrollHeight;
	innerwidth = document.documentElement.clientWidth;
	innerheight = document.documentElement.clientHeight;
	
	if (navigator.appName == "Microsoft Internet Explorer") {
		scrollPosition = document.documentElement.scrollTop;
	}
	else {
		scrollPosition = window.pageYOffset;
	}
	
	//Resize opacity layer
	document.getElementById('opacityContainer').style.width = thiswidth + 'px';
	if (thisheight < innerheight) {
		document.getElementById('opacityContainer').style.height = innerheight + 'px';
	}
	else {
		document.getElementById('opacityContainer').style.height = thisheight + 'px';
	}
	
	//Position the order layer
	document.getElementById('orderLayer').style.left = innerwidth/2-404/2 + 'px';
	document.getElementById('orderLayer').style.top = scrollPosition+innerheight/2-109/2 + 'px';
	
	//Set opacity and order layer to visible
	document.getElementById('opacityContainer').style.visibility = 'visible';
	document.getElementById('orderLayer').style.visibility = 'visible';
}

function positionItOrNot() {
	if (document.getElementById('opacityContainer').style.visibility == 'visible') {
		positionIt();
	}
}

//window.onload = positionIt;
window.onresize = positionItOrNot;

function hideOrder() {
	document.getElementById('opacityContainer').style.visibility = 'hidden';
	document.getElementById('orderLayer').style.visibility = 'hidden';
}
