function listaProdutos(lista)
{
   	if (produto.length > 0) {

	   	var texto = "";
		var optLista = "";

		var strProdNome = "";
		var strProdValor = "";
		var strProdValorFinal = "";
		var strProdThumb = "";
		var strProdThumbP = "";
		var strProdLink = "";
		var strClass = "";
		var isDisplay = "";

		cookieLista = getCookie("icones");
		if (!isset(lista) && isset(cookieLista)) {
			optLista = cookieLista;
		} else if (!isset(lista) && !isset(cookieLista)) {
			optLista = 1;
		} else if (isset(lista) && lista != cookieLista) {
			optLista = lista;
		} else if (isset(lista) && lista == cookieLista) {
			optLista = lista;
		}
		setCookie("icones", optLista);
        var i = 0;
		for(x=0; x<produto.length; x++) {

			strProdNome = produto[x][0];
			strProdValor = produto[x][5];
			strProdValorFinal = produto[x][4];
			strProdThumb = produto[x][2];
			strProdThumbP = produto[x][3];
			strProdLink = produto[x][1];
			intProdDesconto = produto[x][1];
			isDisplay = produto[x][7];

			if (optLista == 1) {

				document.l_icones.src = "/images/i_ico_2.gif";
				document.l_texto.src = "/images/i_txt.gif";

				if (isDisplay == 1) { strClass = "produto"; } else { strClass = "produto produto_hide"; }

				texto += "<div class=\"" + strClass + "\">"
					  + "<a href=\"" + strProdLink + "\" class=\"thumb\" title=\"Clique aqui para mais detalhes\"><img src=\"" + strProdThumb + "\" /></a>"
					  + "<a href=\"" + strProdLink + "\" class=\"titulo\" title=\"Clique aqui para mais detalhes\">" + strProdNome + "</a>"
					  + "<span class=\"preco\">";
					  if ( intProdDesconto > 0 ) { texto += "de <span class=\"precof\">R$ " + strProdValor + "</span></span><br /><span class=\"preco\">por R$ " + strProdValorFinal + "</span>"; } else { texto += "R$ " + strProdValor; }
				texto += "</span>"
					  + "|&nbsp;<a href=\"" + strProdLink + "\" class=\"saiba\" title=\"Clique para obter mais informa&ccedil;&otilde;es sobre este produto\">Detalhes</a>"
					  + "</div>";

                if (i > 2) { texto += "<div class=\"clearContent\"></div>"; i = -1; }
                i++;

			} else if (optLista == 2) {

				document.l_icones.src = "/images/i_ico.gif";
				document.l_texto.src = "/images/i_txt_2.gif";

				if (isDisplay == 0) { strClass = "produto_hide"; }

				if (x==0) texto = "<table class=\"produto\"><tr><th>Produto</th><th>Valor</th></tr>";
				texto += "<tr onClick=\"location='" + strProdLink + "'\" title=\"Clique aqui para mais detalhes\" class=\"" + strClass + "\">"
					  + "<td class=\"tit\">" + strProdNome + "</td>"
					  + "<td class=\"vlr\" nowrap=\"nowrap\">";
					  if ( intProdDesconto > 0 ) { texto += "de <span class=\"precof\">R$ " + strProdValor + "</span><br />por R$ " + strProdValorFinal; } else { texto += "R$ " + strProdValor; }
				texto += "</td>"
					  + "</tr>";
				if (x==produto.length) texto += "</table>";
			}
		}
		setData("", "listaProdutos");
		setData(texto, "listaProdutos");
	} else {
		setData("", "listaProdutos");
		setData("<br /><span style='font-size:11px; color:#c0c0c0'>N&atilde;o h&aacute; produtos nesta se&ccedil;&atilde;o</span>", "listaProdutos");
	}
}
function isset(varname)
{
  if ((typeof(varname) != "undefined") && (varname != null) && (varname != "")) return true;
  else return false;
}
function setData(text,id)
{
	if (document.getElementById)
	{
		x = document.getElementById(id);
		x.innerHTML = '';
		x.innerHTML = text;
	}
	else if (document.all)
	{
		x = document.all[id];
		x.innerHTML = text;
	}
	else if (document.layers)
	{
		x = document.layers[id];
		text2 = '<P CLASS="listaProdutos">' + text + '</P>';
		x.document.open();
		x.document.write(text2);
		x.document.close();
	}
}
function getObj(name)
{
	if (document.getElementById)
	{
	   this.obj = document.getElementById(name);
//	   this.style = document.getElementById(name).style;
	}
	else if (document.all)
	{
	   this.obj = document.all[name];
//	   this.style = document.all[name].style;
	}
	else if (document.layers)
	{
	   if (document.layers[name])
	   {
	   	this.obj = document.layers[name];
//	   	this.style = document.layers[name];
	   }
	   else
	   {
	    this.obj = document.layers.testP.layers[name];
//	    this.style = document.layers.testP.layers[name];
	   }
	}
	return this.obj;
}
var lastId = 0;
function menu(id) {
	var strIDon = eval("getObj('m_" + id + "_on')");
	var strIDoff = eval("getObj('m_" + id + "_off')");
	strIDon.style.display = "block";
	strIDoff.style.display = "none";
	if (lastId > 0) {
		var strLastIDon = eval("getObj('m_" + lastId + "_on')");
		var strLastIDoff = eval("getObj('m_" + lastId + "_off')");
		strLastIDon.style.display = "none";
		strLastIDoff.style.display = "block";
	}
	lastId = id;
}
var lastThumbID = "0";
var lastMenuThumbID = "0";
function itemDetalhe(TstrID, TstrImage, TstrDescricao) {
	if (("t"+TstrID) != lastThumbID && TstrImage != '') {
		var strDescricao = getObj('strDescricao');
		var strThumbID = eval("getObj('t" + TstrID + "')");
		var strLastThumbID = "";
		var d = new Date();
		document.prodImg.src = TstrImage;
		
		strDescricao.innerHTML = TstrDescricao;
		strThumbID.className = "active"; 

		Element.setStyle(TstrID, {fontWeight:'bold', color:'#000000'} );
			
		if (lastThumbID != "0") {
			strLastThumbID = eval("getObj('" + lastThumbID + "')");
			strLastThumbID.className = "";
			Element.setStyle(lastMenuThumbID, {fontWeight:'normal', color:'#666666'} );
		}
		
		lastThumbID = "t" + TstrID;
		lastMenuThumbID = TstrID;
	}
}
function setCookie(name, value, expires, path, domain, secure) {
    document.cookie= name + "=" + escape(value) +
        ((expires) ? "; expires=" + expires.toGMTString() : "") +
        ((path) ? "; path=" + path : "") +
        ((domain) ? "; domain=" + domain : "") +
        ((secure) ? "; secure" : "");
}
function getCookie(name) {
    var dc = document.cookie;
    var prefix = name + "=";
    var begin = dc.indexOf("; " + prefix);
    if (begin == -1) {
        begin = dc.indexOf(prefix);
        if (begin != 0) return null;
    } else {
        begin += 2;
    }
    var end = document.cookie.indexOf(";", begin);
    if (end == -1) {
        end = dc.length;
    }
    return unescape(dc.substring(begin + prefix.length, end));
}
function deleteCookie(name, path, domain) {
    if (getCookie(name)) {
        document.cookie = name + "=" +
            ((path) ? "; path=" + path : "") +
            ((domain) ? "; domain=" + domain : "") +
            "; expires=Thu, 01-Jan-70 00:00:01 GMT";
    }
}
/*
 * Desabilita click do Mouse (Solicitado em 20.08.2007 pela Dorris)
 */
isIE=document.all;
isNN=!document.all&&document.getElementById;
isN4=document.layers;

if (isIE||isNN) {
	document.oncontextmenu=checkV;
} else {
	document.captureEvents(Event.MOUSEDOWN || Event.MOUSEUP);
	document.onmousedown=checkV;
}
function checkV(e)
{
	if (isN4) {
		if (e.which==2||e.which==3) {
			dPUW = "";
			return false;
		}
	} else {
		dPUW = "";
		return false;
	}
}