function crialayer()
{
	/*	fechar = document.createElement("div");
		fechar.id = 'painel_foto';
		fechar.className = "painel_foto";
		fechar.style.height = "200px";
		fechar.style.width = "176px";
		fechar.style.margin-top = "0px";
		fechar.style.margin-left = "0px";
		fechar.style.float = "left";
		fechar.style.fontSize = "10px";
		fechar.style.fontFamily = 'Verdana, Arial, Helvetica, sans-serif';
		fechar.style.backgroundColor = "#575757";
		fechar.style.color = "#ffffff";
		fechar.style.visibility = 'visible';

	*/

	fechar = document.getElementById("painel_foto");
	
	fechar.style.float = "left";
	fechar.style.backgroundColor = "#ffffff";
	fechar.style.color = "#ffffff";
	fechar.style.marginTop = "0px";
	fechar.style.marginLeft = "0px";
	fechar.style.left = "321";
	fechar.style.top = "110";

	if (window.navigator.appName == "Netscape")
	{
		fechar.style.left = "321";
		fechar.style.top = "110";
	} else {
		fechar.style.left = "318";
		fechar.style.top = "110";		
	}

	if (window.navigator.appName == "Netscape")
	{
		fechar.style.MozOpacity = 0;
	} else {
		//fechar.style.opacity = 0;
		fechar.style.filter="alpha(opacity=0)";
		//fechar.style.opacity = some/10;
	}

	imagem = document.createElement("img");
	imagem.id = "img1";
	imagem.style.border = 0;
	img = eval("image" + cont);
	imagem.src = img.src;
	//imagem.height = "90";
	//imagem.width = "65";

	alink = document.createElement("a");
	alink.setAttribute('id','link_destaque');
	//var link = document.getElementById("link_destaque");
	vatalho = eval("link" + cont);
	alink.setAttribute('href',vatalho);
	
	//link.appendChild(span);
	//fechar.appendChild(imagem);
	//fechar.appendChild(link);
	
	alink.insertBefore(imagem, alink.firstChild);
	
	fechar.insertBefore(alink, fechar.firstChild);
	
	//document.body.insertBefore(fechar, document.body.firstChild);
	
	//document.body.insertBefore(span, document.body.firstChild);
	
	//document.getElementById("painel_foto").parentNode.insertBefore(link, 											document.getElementById("painel_foto").nextSibling);
}
var some = 0;
var parado = 0;
function delaylayer(velocidade)
{
	var imagem = document.getElementById("img1");
	img = eval("image" + cont);
	imagem.src = img.src;

	var alink = document.getElementById("link_destaque");
	atalho = eval("link" + cont);
	alink.href = atalho;

	var fechar = document.getElementById("painel_foto");
	//fechar.style.backgroundColor = "#" + bg;
	//alert(painel_foto.style.filter);
	if (window.navigator.appName == "Netscape")
	{
		fechar.style.MozOpacity = some/101;
	} else {
		//fechar.style.opacity = 0;
		fechar.style.filter="alpha(opacity=" + some + ")";
		//fechar.style.opacity = some/10;
	}

	some = some + 2;

	if (some < 100)
	{
		t = setTimeout("delaylayer("+velocidade+")",velocidade);
	} else {

		if (parado == 0)
		{
			cont++;
			if (cont > 4)
			{
				cont = 1;
			}
			some = 0;
			clearTimeout(t);
			t = setTimeout("delaylayer(1)",3000);
		}
	}
}

function trocafoto(valor)
{
	some = 0;
	var obj = document.getElementById("img1");
	if (valor == "menos")
	{
		if (cont == 1)
		{
			cont = 4;
		} else {
			cont--;
		}
	}
	if (valor == "mais")
	{
	if (cont == 4)
		{
			cont = 1;
		} else {
			cont++;
		}
	}
	clearTimeout(t);
	delaylayer(1);
}
function parar()
{
	if (parado == 1)
	{
		parado = 0;
		clearTimeout(t);
		t = setTimeout("delaylayer(1)",1);
	} else {
		clearTimeout(t);	
		parado = 1;
	}
}