function cleanInteger(strIn)
{
	var strOut;
	strOut = stripWhitespace(strIn);
	strOut = stripCharsNotInBag(strOut,"0123456789");
	return strOut;
}

function checkInteger(oFldObject,strError,intMin,intMax)
{
	var strValue = oFldObject.value;
	
	if(isInteger(strValue,true) && strValue.length >= intMin && strValue.length <= intMax)
		return true;
	else {
		alert(strError);
		oFldObject.focus();
		oFldObject.select();
		return false;
	}
}

function checkMoney(oFldObject,strError,intMin,intMax)
{
	var strValue = oFldObject.value;
	
	if (intMin == 0 && strValue.length == 0) return true;
	
	//if((parseInt((parseFloat(strValue) * 100),10)/100) == parseFloat(strValue) && strValue.length >= intMin && strValue.length <= intMax)
	if(isFloat(cleanFloat(strValue),true))
		return true;
	else {
		alert(strError);
		oFldObject.focus();
		oFldObject.select();
		return false;
	}
}

function cleanMoney(strIn)
{
	var strOut;
	strOut = stripWhitespace(strIn);
	strOut = stripCharsNotInBag(strOut,"0123456789.-");
	// look to see if we have a '-' sign in the wrong place if so get rid of it.
	if(isSignedFloat(strOut,true))
	{
		strOut = stripCharsNotInBag(strOut,"0123456789.");
	}
	strOut = String(parseInt(strOut * 100,10)/100);
	return strOut;
}

function cleanFloat(strIn)
{
	var strOut;
	strOut = stripWhitespace(strIn);
	strOut = stripCharsNotInBag(strOut,"0123456789.");
	strOut = String(parseFloat(strOut));
	return strOut;
}

function checkFloat(oFldObject,strError,intMin,intMax)
{
	var strValue = oFldObject.value;
	
	if(intMin==0 && strValue.length==0)
		return true;
	if(isFloat(strValue) && strValue.length >= intMin && strValue.length <= intMax)
		return true;
	else {
		alert(strError);
		oFldObject.focus();
		oFldObject.select();
		return false;
	}
}

// overloaded checkString function..
function checkString(oFldObject,strError,intMin,intMax)
{
	var strValue = stripInitialWhitespace(oFldObject.value);
	
	if(strValue.length >= intMin && (strValue.length <= intMax || intMax == 0))
		return true;
	else {
		alert(strError);
		oFldObject.focus();
		oFldObject.select();
		return false;
	}
}

// we will see if the clean function can clean up the date into a acceptable format
function checkDate(oFldObject,strError,intMin,intMax)
{
	var strValue = oFldObject.value;
	
	if(!(strValue.length >= intMin && strValue.length <= intMax)){
		alert(strError);
		oFldObject.focus();
		oFldObject.select();
		return false;
	}

	if(isDate(oFldObject.value,oFldObject)  && strValue.length >= intMin && strValue.length <= intMax)
		return true;
	else {
		oFldObject.focus();
		oFldObject.select();
		return false;
	}
}

//Function can check if a value is selected if returnVal==false,
//or it can return the value of the checked radio if returnVal==true.
function checkRadioGrp(oFldObject,strError,returnVal)
{
	if(!returnVal) {
		if(getRadioButtonValue(oFldObject)==null) {
			oFldObject[0].focus();
			alert(strError);
			return false;
		}else{
			return true;
		}
	}else{
		return getRadioButtonValue(oFldObject);
	}
}

function checkCheckboxGrp(oFldObject,strError)
{
	cntChecked=0;
	for (i=0; i<oFldObject.length; i++) {
		if(oFldObject[i].checked)
			cntChecked++;
	}
	if(cntChecked<=0){
		oFldObject[0].focus();
		alert(strError);
		return false;
	}
	return true;
}

function checkCheckBox(oFldObject,strError)
{
	if(!oFldObject.checked){
		oFldObject.focus();
		alert(strError);
		return false;
	}
	return true;
}

function checkSelect(oFldObject,strError)
{
	if(oFldObject.selectedIndex<=0 || oFldObject[oFldObject.selectedIndex].value==''){
		oFldObject.focus();
		alert(strError);
		return false;
	} else {
		return true;
	}
}