
function getElm(id) {
	return document.getElementById(id);
}


// POPUP functions
function abre_janela(width, height, nome) {
	var top = ((screen.height / 2) - (height / 2));
	var left = ((screen.width / 2) - (width / 2));
	window.open('', nome, 'width='+width+',height='+height+',scrollbars=yes,toolbar=no,location=no,status=no,menubar=no,resizable=no,left='+left+',top='+top);
}
function pop_up_center(local, w, h, scrol)
{
	var XX = (screen.width - w) / 2;
	var YY = (screen.height - h) / 2;
	var janela = window.open(local,'POP_UP','width='+w+',height='+h+',left='+XX+',top='+YY+',scrollbars='+scrol+',status=no,resizable=yes, toolbar=no,directories=no,menubar=no');
	janela.focus();
}

function pop_up_center_flex(local, w, h, opt)
{
	var XX = (screen.width - w) / 2;
	var YY = (screen.height - h) / 2;
	var janela = window.open(local,'POP_UP_FLEX','width='+w+',height='+h+',left='+XX+',top='+YY+','+opt);
	janela.focus();
}

function _go(selObj)
{
	valor = selObj.options[selObj.selectedIndex].value;
	if (valor != '#') {
		self.location = valor;
	}
}

function in_array(value, array)
{
	for (var i = 0; i < array.length; i++)
		if (array[i] === value)
			return true;

	return false;
}