var isIE = (/\bmsie\b/i.test(navigator.userAgent) && document.all && !(/\bopera\b/i.test(navigator.userAgent)));
function imprimir(target){
	var conteudo= document.getElementById("conteudo").innerHTML;
	var esquerda= (screen.width-500)/2;
	var topo= (screen.height-480)/2;
	document.cont.html.value= conteudo;
	window.open('',target,"width=500, height=480,scrollbars=yes,resizable=no,left="+esquerda+",top="+topo+",location=no,menubar=yes,toolbar=no,status=no,resizable=0");
	return true;
}
function acessibilidade(target){
	var conteudo= document.getElementById("conteudo").innerHTML;
	var altura = 300;
	var largura = 480;
	var esquerda= (screen.width-largura)/2;
	var topo= (screen.height-altura)/2;
	document.acessebilidade.html.value= conteudo;
	window.open('',target,"width="+largura+", height="+altura+",scrollbars=yes,resizable=no,left="+esquerda+",top="+topo+",location=no,menubar=no,toolbar=no,status=no,resizable=0");
	return true;
}
function indique(){
	var esquerda= (screen.width-300)/2;
	var topo= (screen.height-380)/2;
	var url;
	url = document.location.href;
	window.open("./scripts/popups/indique.php?&url=" + url ,"","menubar=no,location=no,toolbar=no,status=no,scrollbars=no,resizable=no,width=300,height=380,left="+ esquerda+",top="+topo);
}
function fonte(par){
	if(par == 'maior'){
		alteraValor(2);
	}else{
		alteraValor(-2);
	}

}
function alteraValor(valor) {
	var e  = document.getElementById('conteudo');
	var nos= e.childNodes;
	for(i=0;i<nos.length;i++) {
		var no = nos[i];
		if(no.tagName !=undefined){
			var tamanho = getCurrentStyle(no).fontSize;
			tamanho = parseInt(tamanho);
			try{
				no.style.fontSize = tamanho + valor + 'px';
			}catch(e){}
		}
	}
}
function getCurrentStyle(elem) {
	if(isIE)
		return elem.currentStyle;
	else
		return (document.defaultView.getComputedStyle(elem, null) || false);
}
function alterar_display(e) {
	var el=document.getElementById(e);
	if(el.className=='escondido') {
		el.className='amostra';
	} else {
		el.className='escondido';
	}
}
function adiciona_plugin(){
	if(isIE){
		try{
			window.external.AddSearchProvider('http://brasilprofissoes.com.br/scripts/plugins/OpenSearch-BP.xml');
		}catch(e){
			alert("Seu navegador não suporta plugins");
		}
	}else{
		addEngine();
	}
}
function addEngine(){
	if ((typeof window.sidebar == "object") && (typeof window.sidebar.addSearchEngine == "function")){
		window.sidebar.addSearchEngine("http://brasilprofissoes.com.br/scripts/plugins/OpenSearch-BP.xml","http://brasilprofissoes.com.br/favicon.ico","Busca","Todo Site");
	}
	else
	{
		alert("Erro na instalação");
	}
}
