
function checkFloat(obj,maxvalue)
{
    obj.value = obj.value.replace(/[^0-9.]/g,"");
    // strip all text and such.
    if(maxvalue > 0)
    {
	if(obj.value > maxvalue)
	{
		obj.value = maxvalue;
	}
    }
    obj.focus();
    // ensure it keeps focus.
}

function checkInteger(obj,maxvalue)
{
    obj.value = obj.value.replace(/[^0-9]/g,"");
    // strip all text and such.
    if(maxvalue > 0)
    {
	if(obj.value > maxvalue)
	{
		obj.value = maxvalue;
	}
    }
    obj.focus();
    // ensure it keeps focus.
}

function checkCreditCard(obj)
{
    obj.value = obj.value.replace(/[^0-9 -]/g,"");
    // strip all text and such.
    obj.focus();
    // ensure it keeps focus.
 //alert(field.value);
}

function checkPhone(obj)
{
    obj.value = obj.value.replace(/[^0-9()-]/g,"");
    // strip all text and such.
    obj.focus();
    // ensure it keeps focus.
 //alert(field.value);
}

function checkLettersNumbers(obj)
{
    obj.value = obj.value.replace(/[^0-9a-zA-Z]/g,"");
    // strip all text and such.
    obj.focus();
    // ensure it keeps focus.
 //alert(field.value);
}
