function $(tmp_id) {
	return document.getElementById(tmp_id);
}

function popup(tmp_pagina, tmp_w, tmp_h) {
	var left = (screen.width - tmp_w) / 2;
	var top = (screen.height - tmp_h) / 2;
	
	window.open(tmp_pagina, tmp_w + '_' + tmp_h, 'top=' + top + ', left=' + left + ', width=' + tmp_w + ', height=' + tmp_h + ', tollbar=no, statusbar=no, scrollbar=no');
}

function addEvento(obj, evType, fn)
{
	if (obj.addEventListener)
	{
	   obj.addEventListener(evType, fn, false);
	   return true;
	}
	else if (obj.attachEvent)
	{
	   var r = obj.attachEvent("on"+evType, fn);
	   return r;
	} 
	else
	{
	   return false;
	}
}
