// ESCONDE/MOSTRA UM LAYER
function show_hide(divname,estado){
	document.getElementById(divname).style.visibility = estado;
}

// IMPRIME O MAPA DO MENU PRODUTOS - COLOCA A FUNÇÃO SHOW_HIDE SE POR IE
function show_submenu_produtos(divName){
	if (is_ie()){
		complemento = "";
	}
	else {
		complemento = " onmouseover=\"show_hide('"+divName+"','visible');\" onmouseout=\"show_hide('"+divName+"','hidden');\"";
	}
	/*
	document.write("<map name='map_produtos'>");
	document.write("<area coords='10,15,82,31' alt='' href='../produtos/index.php?cat_id=1'"+complemento+"/>");
	document.write("<area coords='9,31,82,46' alt='' href='../produtos/index.php?cat_id=2'"+complemento+" />");
	document.write("<area coords='8,46,90,62' alt='' href='../produtos/index.php?cat_id=3'"+complemento+" />");
	document.write("<area coords='8,62,96,79' alt='' href='../produtos/index.php?cat_id=4'"+complemento+" />");
	document.write("<area coords='8,79,90,95' alt='' href='../produtos/index.php?cat_id=5'"+complemento+" />");
	document.write("<area coords='7,98,69,112' alt='' href='../produtos/index.php?cat_id=6'"+complemento+" />");
	document.write("<area coords='6,112,50,130' alt='' href='../produtos/index.php?cat_id=7'"+complemento+" />");
	document.write("<area coords='5,129,66,144' alt='' href='../produtos/index.php?cat_id=8'"+complemento+" />");
	document.write("<area coords='5,147,85,160' alt='' href='../produtos/index.php?cat_id=11'"+complemento+" />");
	document.write("<area coords='5,155,33,176' alt='' href='../pes/index.php'"+complemento+" />");
	document.write("</map>");*/
	
	document.write("<map name='map_produtos'>");
	document.write("<area coords='29,26,120,39' alt='' href='../produtos/index.php?cat_id=1'"+complemento+"/>");
	document.write("<area coords='29,49,106,65' alt='' href='../produtos/index.php?cat_id=2'"+complemento+" />");
	document.write("<area coords='29,70,139,86' alt='' href='../produtos/index.php?cat_id=3'"+complemento+" />");
	document.write("<area coords='29,93,148,108' alt='' href='../produtos/index.php?cat_id=4'"+complemento+" />");
	document.write("<area coords='28,116,137,131' alt='' href='../produtos/index.php?cat_id=5'"+complemento+" />");
	document.write("<area coords='14,138,117,153' alt='' href='../produtos/index.php?cat_id=6'"+complemento+" />");
	document.write("<area coords='14,159,106,179' alt='' href='../produtos/index.php?cat_id=7'"+complemento+" />");
	document.write("<area coords='12,185,114,202' alt='' href='../produtos/index.php?cat_id=8'"+complemento+" />");
	document.write("<area coords='13,206,150,222' alt='' href='../produtos/index.php?cat_id=11'"+complemento+" />");
	document.write("<area coords='14,226,49,242' alt='' href='../pes/index.php'"+complemento+" />");
	document.write("</map>");	
}

// IMPRIME O MAPA DO MENU EXPORTACAO - COLOCA A FUNÇÃO SHOW_HIDE SE POR IE
function show_submenu_exportacao(divName){
	if (is_ie()){
		complemento = "";
	}
	else {
		complemento = " onmouseover=\"show_hide('"+divName+"','visible');\" onmouseout=\"show_hide('"+divName+"','hidden');\"";
	}
	
	document.write("<map name='map_exportacao'>");
	document.write("<area coords='0,0,98,15' alt='History/Historico' title='History/Historico' href='../exportacao/historia.php'"+complemento+" />");
	document.write("<area coords='0,16,98,45' alt='System of Confort/Tipos de Conforto' title='System of Confort/Tipos de Conforto' href='../exportacao/conforto.php'"+complemento+" />");
	document.write("<area coords='0,45,98,63' alt='Products/Productos' title='Products/Productos' href='../produtos/index.php?cat_id=0'"+complemento+" />");
	document.write("<area coords='0,64,98,79' alt='Contact/Contacto' title='Contact/Contacto' href='../exportacao/contato.php'"+complemento+" />");
	document.write("</map>");
}

// VERIFICA SE O BROWSER É O IE
function is_ie(){
	if (navigator.product != null){
		// FIREFOX
			return (false);
	}
	else {
		if (navigator.userAgent.indexOf('Opera') > -1){
			// OPERA
			return (false);
		}
		else {
			// IE
			return (true);
		}
	}
}

function representantes(){
	valor = document.frmRepresentantes.uf[document.frmRepresentantes.uf.selectedIndex].value;
	getConteudo('representantes.php?rep_uf='+valor,'representantes');
}

function abre_conheca(){
	w = 550;
	h = 400;
	largura = screen.width;
	altura = screen.height;
	XX =(largura-w)/2;
	YY = (altura-h)/2;
	janela = window.open('../conheca/index.php','POP_CONHECA','width='+w+',height='+h+',left='+XX+',top='+YY+',scrollbars=no,status=no,resizable=no, toolbar=no,directories=no,menubar=no');
	janela.focus();
}

function abre_conforto(img){
	w = 500;
	h = 350;
	largura = screen.width;
	altura = screen.height;
	XX =(largura-w)/2;
	YY = (altura-h)/2;
	janela = window.open('../exportacao/img.php?img='+img,'POP_CONFORTO_'+img,'width='+w+',height='+h+',left='+XX+',top='+YY+',scrollbars=no,status=no,resizable=no, toolbar=no,directories=no,menubar=no');
	janela.focus();
}

function abre_conforto_prod(img){
	w = 500;
	h = 350;
	largura = screen.width;
	altura = screen.height;
	XX =(largura-w)/2;
	YY = (altura-h)/2;
	janela = window.open('conforto.php?con_img='+img,'POP_CONFORTO','width='+w+',height='+h+',left='+XX+',top='+YY+',scrollbars=no,status=no,resizable=no, toolbar=no,directories=no,menubar=no');
	janela.focus();
}

function abreProdutoZoom(img){
	w = 700;
	h = 520;
	largura = screen.width;
	altura = screen.height;
	XX =(largura-w)/2;
	YY = (altura-h)/2;
	janela = window.open('imagem.php?prod='+img,'POP_PRODUTO','width='+w+',height='+h+',left='+XX+',top='+YY+',scrollbars=no,status=no,resizable=no, toolbar=no,directories=no,menubar=no');
	janela.focus();
}

// FUNÇÃO FLASH
function addSWF (URL, WIDTH, HEIGHT, TRANSPARENT){
	document.write (' <object classid="clsid:27CDB6E-AE6D-11cf-96B8-444553540000" ');
	document.write (' codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" ');
	document.write (' width="'+ WIDTH +'" height="'+ HEIGHT +'">');
	document.write (' <param name="movie" value="'+ URL +'" />');
	document.write (' <param name="quality" value="high" />');
	
	if ( TRANSPARENT ) {
		document.write (' <param name="Wmode" value="Transparent" />'); 
	}

	document.write (' <embed src="'+ URL +'" quality="high" ');

	if ( TRANSPARENT ) {
		document.write (' Wmode = "transparent" ');
	}

	document.write (' pluginspage="http://www.macromedia.com/go/getflashplayer" ');
	document.write (' type="application/x-shockwave-flash" width="'+ WIDTH +'" height="'+ HEIGHT +'"></embed> ');
	document.write (' </object>');
}


function adrian(){
	w = 630;
	h = 520;
	largura = screen.width;
	altura = screen.height;
	XX =(largura-w)/2;
	YY = (altura-h)/2;
	janela = window.open('../videos/adrian.html','adrian','width='+w+',height='+h+',left='+XX+',top='+YY+',scrollbars=no,status=no,resizable=no, toolbar=no,directories=no,menubar=no');
	janela.focus();
}

function oliver(){
	w = 630;
	h = 520;
	largura = screen.width;
	altura = screen.height;
	XX =(largura-w)/2;
	YY = (altura-h)/2;
	janela = window.open('../videos/oliver.html','oliver','width='+w+',height='+h+',left='+XX+',top='+YY+',scrollbars=no,status=no,resizable=no, toolbar=no,directories=no,menubar=no');
	janela.focus();
}

function ype(){
	w = 630;
	h = 520;
	largura = screen.width;
	altura = screen.height;
	XX =(largura-w)/2;
	YY = (altura-h)/2;
	janela = window.open('../videos/ype.html','oliver','width='+w+',height='+h+',left='+XX+',top='+YY+',scrollbars=no,status=no,resizable=no, toolbar=no,directories=no,menubar=no');
	janela.focus();
}


