
	function verificaNumeric(obj, decimals, negativ)
	{
		//replace , -> .		
		obj.value = obj.value.replace(',', '.');
		initial = obj.value;
		vint = obj.value * 1;

		str = obj.value;

		//if (typeof(vint) == 'NaN')
		{
			str = '';

			nr_punct = 0;
			negativ = 0;
			nr_decimals = 0;
			for (q = 0; q < obj.value.length; q++)
			{
				c = obj.value.substr(q, 1) + '';

				if (c == '.')
				{
					nr_punct++;
					if (nr_punct > 1) continue;
				}							

				if (c == '-')
				{
					negativ = 1;
					continue;
				}

				if ( (c != '-') && (c != '.') && (c != ',') && (c != '0') && (c != '1') && (c != '2') && (c != '3') && (c != '4') && (c != '5') && (c != '6') && (c != '7') && (c != '8') && (c != '9')) continue;

				if ((nr_punct > 0) && (c != '.'))
				{
					nr_decimals++;
					if (nr_decimals > decimals) break;
				}
				str = str + '' + c;
			}
			if (negativ) str = '-' + str;
			obj.value = str;
		}

		//replace . -> ,
		if (str != initial) obj.value = obj.value.replace('.', ',');
	}


	function compuneData(idObj)
	{
		obj = document.getElementById(idObj);

		obj_zi = document.getElementById(idObj + '_zi');
		obj_luna = document.getElementById(idObj + '_luna');
		obj_an = document.getElementById(idObj + '_an');

		ok = 1;
		if (obj_zi.value < 1 || obj_zi.value > 31) ok = 0;
		if (obj_luna.value < 1 || obj_luna.value > 12) ok = 0;
		if (obj_an.value < 1970 || obj_an.value > 2035) ok = 0;

		if (ok) obj.value = obj_zi.value + '.' + obj_luna.value + '.' + obj_an.value;
			else obj.value = '';
	}
