function isInt(pstrNum, pstrName) {

	if (isNaN(pstrNum)) {
		if(pstrName != null) alert(pstrName + " must be an integer");
		return false;
	}
	if (parseInt(pstrNum,10) != parseFloat(pstrNum)) {
		if(pstrName != null) alert(pstrName + " must be an integer");
		return false;
	}

	return true;
	
}

function isDec(pstrNum, pintPlaces, pstrName) {
 
	var pstrDec
	var pintLoc

	if (isNaN(pstrNum)) {
		if(pstrName != null) alert(pstrName + " must be a number");
		return false;
	}
	if (pintPlaces != null) {
		pintLoc = pstrNum.indexOf(".");
		if (pintLoc == -1) return true;
		pstrDec = trim(pstrNum.substring(pintLoc + 1, pstrNum.length));
		if (pstrDec.length <= pintPlaces) return true;
		if (parseInt(pstrDec.substring(pintPlaces, pstrDec.length)) == 0) return true;
		if(pstrName != null) alert(pstrName + " must not have more than " + pintPlaces + " decimal places");
		return false;
	}


	return true;
}