function direciona(url) {
	window.location.href = url;
}

function showAccess() {
	var box_access = document.getElementById('box-top-login');
	
	if (box_access.style.display == 'none')
		box_access.style.display = 'block';
	else
		box_access.style.display = 'none';
}

function showMenu(h1_id, opts_id) {
	var a = document.getElementById(opts_id);
	var b = document.getElementById(h1_id);
	if (a.style.display == 'none') {
		a.style.display = 'block';
		b.className = 'open';
	}
	else {
		a.style.display = 'none';
		b.className = 'close';
	}
}

/**
 * Funções para bloquear a seleção de texto
 */
/*function blockError() {
	return true;
}

window.onerror = blockError;

function disableselect(e) {
	return false;
}

function reEnable() {
	return true;
}

//Se o browser for IE4+
document.onselectstart = new Function("return false");

//Se o browser for NS6
if(window.sidebar) {
	document.onmousedown = disableselect;
	document.onclick = reEnable;
}*/

/**
 * Função para bloquear o clique direito do mouse
 */
function BlockClick(){
		alert('Conteúdo protegido para Reale Investimentos Imobiliários!!!');
		return false
	}
	
document.oncontextmenu = BlockClick;

/**
 * Bloqueia o 'CTRL + C' para evitar cópia do conteúdo
 */
document.onkeydown = function(e){
	var keychar;

	// Internet Explorer
	try {
		keychar = String.fromCharCode(event.keyCode);
		e = event;
	}
	catch(err) { // Firefox, Opera, Chrome, etc...
		keychar = String.fromCharCode(e.keyCode);
	}

	if (e.ctrlKey && keychar == 'C') {
		//alert('Conteúdo protegido para Reale Investimentos Imobiliários!!!');
		return false;
	}
}


function switchBoxTool(obj) {
	var g = document.getElementById(obj);
	if (g.style.display == 'none') {
		g.style.display = 'block';
	}
	else {
		g.style.display = 'none';
	}
}
