// JavaScript Document
function $$(el) {
	return document.getElementById(el);	
}
function manterMenuSobre() {
	//$$('subMenuSobre').style.display = 'block';
	$('#subMenuSobre').show('slow');
	$$('aSobre').style.background = 'url(img/btn_sobre_nos.jpg) 0 -41px no-repeat';
}
function esconderMenuSobre() {
	$('#subMenuSobre').hide('slow');
	$$('aSobre').style.background = 'url(img/btn_sobre_nos.jpg) 0 0 no-repeat';
}
function apareceBandeira(){
	$$('divIdiomas').style.display = 'block';
}
function escondeBandeira(){
	$$('divIdiomas').style.display = 'none';
}
function apareceCertificacoes(el){
	if(el == 'divBPF'){
		$$('divISO').style.display = "none";
		$$('divCE').style.display = "none";
		//$('#divISO').hide();		
		//$('#divCE').hide();	
		$('#divBPF').show('200');	
	} else if(el == 'divISO'){
		$$('divBPF').style.display = "none";
		$$('divCE').style.display = "none";
		//$('#divBPF').hide();		
		//$('#divCE').hide();	
		$('#divISO').show('200');	
	} else if(el == 'divCE'){
		$$('divISO').style.display = "none";
		$$('divBPF').style.display = "none";
		//$('#divISO').hide();		
		//$('#divBPF').hide();	
		$('#divCE').show('200');	
	}
}
function manterMenuProdutos(el) {
	
	$('#subMenuProdutos').slideDown(function() {
		$(el).bind('mouseleave', function(){
			esconderMenuProdutos(el);
		})
	});
	
	/*$('#subMenuProdutos').show('slow', function(){
		
	});
	//$$('subMenuProdutos').style.display = 'block';
	$$('aProdutos').style.background = 'url(img/btn_produtos.jpg) 0 -41px no-repeat';
	/*igualaTamanhoDiv('subEstereotaxia','subRadiofrequencia');
	igualaTamanhoDiv('subRadiocirurgia','subSoftware');
	igualaTamanhoDiv('subFixacao','subEstimulacao');
	igualaTamanhoDiv('subNavegacao','subPerfuracao');*/
}
function esconderMenuProdutos(el) {
	
	$('#subMenuProdutos').slideUp(function() {
		
	});
		
	/*$('#subMenuProdutos').hide();
	//$$('subMenuProdutos').style.display = 'none';
	$$('aProdutos').style.background = 'url(img/btn_produtos.jpg) 0 0 no-repeat';*/
}

function MenuProdutos() {
	$$('subMenuProdutos').style.display = 'none';
	$$('aProdutos').style.background = 'url(img/btn_produtos.jpg) 0 0 no-repeat';
}

function imprimirPagina(){
	$$('menuExtras').style.display = "none";
	$$('menuProdutos').style.display = "none";
	$$('topo').style.display = "none";
	$$('h3_link').style.display = "none";
	$$('rodape').style.display = "none";
	window.print();
	$$('menuExtras').style.display = "block";
	$$('menuProdutos').style.display = "block";
	$$('topo').style.display = "block";
	$$('h3_link').style.display = "block";
	$$('rodape').style.display = "block";
}

function reduzirFonte(){
	var size = parseInt($('#contentCenter p').css('font-size').replace('px','')) - 1;
	if(size > 8){
		$('#contentCenter p').css('font-size', size.toString() + 'px');
	}
}

function aumentarFonte(){
	var size = parseInt($('#contentCenter p').css('font-size').replace('px','')) + 1;
	if(size < 16){
		$('#contentCenter p').css('font-size', size.toString() + 'px');
	}
}

function manterSubCategorias(el) {
	if(el != ''){
		var child = $('#ulMenuProdutos').find('li');
		for(var x=0;x<child.length;x++){
			
			$('#' + child[x].id + 'a').removeClass("menu_selecionado");
			$('.submenu_selecionado').removeClass('submenu_selecionado')
			$('#subCategorias' + child[x].id).css('display','none');
		}

		$('#' + el + 'a').toggleClass("menu_selecionado");
		$('#subCategorias' + el).css('display','block');
	}
}
function esconderSubCategorias(el) {
	if(el != ''){
		$$('subCategorias' + el).style.display = 'none';
		/*
		if($$('hdIdAntigo').value == el && $$('hdAparece').value == ""){
			$$('subCategorias' + el).style.display = 'block';
			$$('hdAparece').value = '1';
		} else if($$('hdAparece').value == '1'){
			$$('subCategorias' + $$('hdIdAntigo').value).style.display = "none";
			$$('hdAparece').value == '';
		}
		*/
	}
}

function manterAbertaCategorias(el){
	$$('subCategorias' + el).style.display = 'block';
}

function igualaTamanhoDiv(div1,div2) {
	var tam = $('#' + div1).height();
	$('#' + div2).height(tam);
}
function ajustaBordaLateral() {
	var tam = $('#conteudo').height();
	$('#borderLeft').height(tam);
	$('#borderRight').height(tam);
	

}
