
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 num(dom){
	dom.value = dom.value.replace(/\D/g,'');
}

function hideDefault(input){
  if(typeof(input.defaultValue)=="undefined")
    input.defaultValue = input.value;
  if(input.value == input.defaultValue)
    input.value = "";
  return true;
}
function showDefault(input){
  if(input.value == "" && typeof(input.defaultValue)!="undefined")
    input.value = input.defaultValue;
  return true;
}
// ex: <INPUT onFocus="return hideDefault(this);" onBlur="return showDefault(this);" value="Type your full name here" />

