var lStrIdLayerAberto1N;
var lStrIdLayerAberto2N;
var lStrIdLayerAberto3N;

lStrIdLayerAberto1N = '';
lStrIdLayerAberto2N = '';
lStrIdLayerAberto3N = '';

function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

function MenuSecao(nome,codigo,nivel)
{
	var obj;
	var div;
	var top;

	var topalt;
	if(codigo == 2){
		topalt = "74px";
	}else if(codigo == 999){
		topalt = "93px";
	}
	if (codigo == 2 || codigo == 999){
		if (nivel == "status")
		{
			obj = eval("window.document.getElementById('"+ nome +"').offsetLeft");
			div = eval("window.document.getElementById('DSC"+ codigo +"')");
			lStrIdLayerAberto1N = 'DSC'+ codigo;
		}
		else if (nivel == "subsecao")
		{
			obj = eval("window.document.getElementById('"+ nome +"').offsetLeft") + 123;
			div = eval("window.document.getElementById('DSE"+ codigo +"')");//eval("document.all.DSE" + codigo);
			div.style.top = topalt;
			lStrIdLayerAberto2N = 'DSE'+ codigo;
		}else{
			top = eval("window.document.getElementById('"+nome+"').offsetTop") + eval("window.document.getElementById('subsecao" + codigo + "').offsetTop")-1;
			obj = (eval("window.document.getElementById('"+ nome +"').offsetLeft") + eval("window.document.getElementById('"+ nome +"').offsetWidth") - 8);
			div = eval("window.document.getElementById('DSS"+ codigo +"')");
			div.style.top = + top + "px";
			lStrIdLayerAberto3N = 'DSS'+ codigo;
		}
	}
	else{
		if (nivel == "subsecao")
		{
			obj = eval("window.document.getElementById('"+ nome +"').offsetLeft");
			div = eval("window.document.getElementById('DSE"+ codigo +"')");//eval("document.all.DSE" + codigo);
			lStrIdLayerAberto2N = 'DSE'+ codigo;
		}else{
			top = eval("window.document.getElementById('"+nome+"').offsetTop") + eval("window.document.getElementById('subsecao" + codigo + "').offsetTop")-1;
			obj = (eval("window.document.getElementById('"+ nome +"').offsetLeft") + eval("window.document.getElementById('"+ nome +"').offsetWidth") - 8);
			div = eval("window.document.getElementById('DSS"+ codigo +"')");
			div.style.top = + top + "px";
			lStrIdLayerAberto3N = 'DSS'+ codigo;
		}
	}
	div.style.left = + obj + "px";
	div.style.display = "block";
}

ajusteAltura = (document.all) ? 19 : 17;
var topo;
var esquerdo;
function PosicionaDiv() {
	topo = document.getElementById('posDivFechadura').offsetTop;
	esquerdo = document.getElementById('posDivFechadura').offsetLeft;
	//alert(topo + ' - 	' +  esquerdo);
	document.getElementById('divFechadura').style.top = topo - 9;
	document.getElementById('divFechadura').style.left = esquerdo + 10 ;
	document.getElementById('divFechadura').style.display = 'block' ;
}

function AcertaDivBanner(){
	if (document.getElementById('dvBannerB')){
		width = document.getElementById('dvBannerB').style.width
		width = Number(width.substr(0,width.indexOf("px")))
		document.getElementById('dvBannerB').style.left = (document.body.offsetWidth - width)/2 - 106;
		document.getElementById('dvBannerB').style.display=""
	}

	if (document.getElementById('dvBannerM')){
		width = document.getElementById('dvBannerM').style.width
		width = Number(width.substr(0,width.indexOf("px")))
		document.getElementById('dvBannerM').style.left = (document.body.offsetWidth - width) - 35;
		document.getElementById('dvBannerM').style.display=""
	}
	
	if (document.getElementById('dvBannerX')){
		width = document.getElementById('dvBannerX').style.width
		width = Number(width.substr(0,width.indexOf("px")))
		document.getElementById('dvBannerX').style.left = (document.body.offsetWidth - width) - 223;
		document.getElementById('dvBannerX').style.display=""
	}
	
	if (document.getElementById('dvBannerS')){
		width = document.getElementById('dvBannerS').style.width
		width = Number(width.substr(0,width.indexOf("px")))
		document.getElementById('dvBannerS').style.left = (document.body.offsetWidth - width) - 466;
		document.getElementById('dvBannerS').style.display=""
	}


}