function BannerFlutuante(local_banner,url_link,nova_janela,pos_esq,pos_topo,local_img_fechar)  {
	nr_id = Math.floor(Math.random()*1000)+"";
	div=document.createElement("div");
	div.setAttribute("id","banner_flutuante_"+nr_id);
	div.style.position="absolute";
	div.style.zIndex="99";
	img_fechar=document.createElement("img");
	img_fechar.setAttribute("src",local_img_fechar);
	img_fechar.setAttribute("id","banner_fechar_"+nr_id);
	img_fechar.style.cursor="pointer";
	img_fechar.align="right";
	div.appendChild(img_fechar);
	img_fechar.onclick=function ()  {
		div.style.display="none";
	}
	img=document.createElement("img");
	img.setAttribute("src",local_banner);
	img.setAttribute("id","banner_"+nr_id);
	img.setAttribute("border","0");
	if(url_link!="")  {
		a=document.createElement("a");
		a.setAttribute("href",url_link);
		if(nova_janela) a.setAttribute("target","_blank");
		a.appendChild(img);
		div.appendChild(a);
	}
	else  {
		div.appendChild(img);
	}
	document.body.appendChild(div);
	img.onload=function ()  { CarregarPosicionamento(nr_id,pos_esq,pos_topo) };
}

function CarregarPosicionamento(nr_id,pos_esq,pos_topo)  {
	tamanho_div=0;
	largura_div=0;
	img_fechar=document.getElementById("banner_fechar_"+nr_id);
	img=document.getElementById("banner_"+nr_id);
	div=document.getElementById("banner_flutuante_"+nr_id);
	tamanho_div+=parseInt(img_fechar.getAttribute("width"));
	tamanho_div+=parseInt(img.getAttribute("width"));
	largura_div+=parseInt(img.getAttribute("height"));
	div.style.width=tamanho_div+"px";
	if(pos_esq=="centro" && pos_topo=="meio")  {
		div.style.left="50%";
		div.style.top="50%";
		div.style.marginLeft=-parseInt(tamanho_div/2)+"px";
		div.style.marginTop=-parseInt(largura_div/2)+"px";
	}
	else  {
		div.style.left=pos_esq+"px";
		div.style.top=pos_topo+"px";
	}
}
