/* TIRA A BORDA DOS FLASHS
Copyright 2006 Adobe Systems, Inc. All rights reserved.
Versão compacta, alterada por Renato Herculano
	- src, width e height são obrigatórios
	- os demais parametros são opcionais
*/
function flash(src, width, height, id, flashVars, wmode, menu, scale){
	var ret = GetArgumentos(src, width, height, id, flashVars, wmode, menu, scale);
	var str = '<object ';
	for (var i in ret.objAttrs)
		str += i + '="' + ret.objAttrs[i] + '" ';
		str += '>';
	for (var i in ret.params)
		str += '<param name="' + i + '" value="' + ret.params[i] + '" /> ';
		str += '</object>';
	document.write(str);
}

function GetArgumentos(src, w, h, id, flashVars, wmode, menu, scale){
	var ret = new Object();
	ret.params = new Object();
	ret.objAttrs = new Object();

	ret.objAttrs['data'] = ret.params["movie"] = src;
	ret.objAttrs['width'] = w;
	ret.objAttrs['height'] = h;
	ret.params['quality'] = 'high';
	ret.objAttrs['type'] = 'application/x-shockwave-flash';
	ret.params['menu'] = 'false';
	
	if(id) ret.objAttrs['id'] = id;
	
	if(flashVars) ret.params['flashVars'] = flashVars;
	
	ret.params['wmode'] = (wmode)? wmode : 'transparent';
	ret.params['scale'] = (scale)? scale : 'exactfit';
	ret.params['menu'] = (menu)? menu : 'false';
	
	return ret;
}

	var endereco = location.href;
		
	function linkCombo(valor){
			location.href = endereco + valor;
}


//marcarMenu(): abre e marca 2º nivel do menu lateral, e marca o 3º
function marcaMenu(){
	//armazena o array com as pastas da url
	var l = location.href.split('/');
	
	//verifica se nao esta na home
	var p = (l[5] == '' || l[5] == 'index.asp')? 'home' : l[5];
	
	//armazena o primeiro nivel
	var primeiroNivel = document.getElementById(p);
	
	if(primeiroNivel)
		//altera a class do 1º nivel
		primeiroNivel.className = 'primeiroNivelMarcado';
	
	//armazena o 2º nivel
	var segundoNivel = document.getElementById(l[6]);
	if(segundoNivel)
		//altera a class do segundo nível
		segundoNivel.className = 'segundoNivelMarcado';
		
	//armazena o 3º nivel
	var terceiroNivel = document.getElementById(l[7]);
	if(terceiroNivel)
		//altera a class do terceiro nível
		terceiroNivel.className = 'terceiroNivelMarcado';
	
	//armazena o 4º nivel
	var quartoNivel = document.getElementById(l[8]);
	if(quartoNivel)
		//altera a class do terceiro nível
		quartoNivel.className = 'quartoNivelMarcado';
}

var ultima = conteudoImpressao = '';
function mostra(item){	
	if(ultima.length > 0)
		esconde(ultima)
	
	ultima = item;
	
	conteudoImpressao = ultima;
	
	document.getElementById(item).style.display = 'block';
}

function esconde(item){
	document.getElementById(item).style.display = 'none';
}

//Função para imprimir texto de partes especificas da pags//
function imprimeDiv(){	
	if(endereco.indexOf("produtos") > -1){
		if(IE){
			document.getElementById(conteudoImpressao).childNodes[4].style.width = 600 + 'px';
			document.getElementById(conteudoImpressao).childNodes[4].style.height = 800 + 'px';
		}
		else{
			document.getElementById(conteudoImpressao).childNodes[7].style.width = 600 + 'px';
			document.getElementById(conteudoImpressao).childNodes[7].style.height = 800 + 'px';
		}
	}	
	window.print();
	location.reload();
}

