/**
* limits text to given length if too long
*/
function textLimit(text, textlen, textend)
{
	if (text.length > textlen)
	{
		text = text.substring(0, textlen);
		while (text.length > (textlen/2) && text.substring(text.length-1, text.length) != ' ')
			text = text.substring(0, text.length-1);
		text += textend;
	}
	return text;
}

/**
* removes non numeric charaters
*/
function input_numeric(obj)
{
	sValue = '';
	for (i = 0; i < obj.value.length; i++)
	{
		if (obj.value[i] >= '0' && obj.value[i] <= '9') sValue += obj.value[i];
	}
	if (sValue.length != obj.value.length) obj.value = sValue;
}


