var controle_janela = -1;

function $id(id){
	return document.getElementById(id);
}

window.onload = function(){
	$id("bg_sombra").style.display = "block";
	setInterval(sombraOk, 1000);
	setInterval(alinhamento, 1000);
	sombraOk();
	alinhamento();
}

function alinhamento()
{
	obj = $id("container");
	if(document.body.clientWidth < 970)
	{
		if(controle_janela != 1){
			obj.style.postion = "relative";
			obj.style.float = "left";
			obj.style.left = "0";
			obj.style.marginLeft = "0";
			$id("bg_sombra").style.display = "none";
			
			controle_janela = 1;
		}
	}
	else
	{
		if(controle_janela != 2){
			obj.style.postion = "absolute";
			obj.style.float = "none";
			obj.style.left = "50%";
			obj.style.marginLeft = "-502px";
			$id("bg_sombra").style.display = "block";
			
			controle_janela = 2;
		}
	}
}


function sombraOk(){
	if($id("bg_sombra").style.height != $id("container").clientHeight + "px"){
		$id("bg_sombra").style.height = $id("container").clientHeight + "px";
	}
}