function checkInt(obj){
	var iFormat, v;

	//handle any formatted numbers
	v=obj.value.replace(/[,$]/g, "");

	// if no format argument is supplied default to 0 (positives and negatives ok)
	if (arguments.length==1) {
		iFormat=0;
	}
	else {
		iFormat=arguments[1];
	}

	// if the field is empty stop now
	if (v.length<1) return true;

	// check to see if it's even a number
	if (isNaN(v)) {
		alert ('Please enter whole numbers only.');
		obj.focus();
		return false;
	}


	// check to for non-integers and round
	i = parseInt(v);
	if (i != v) {
		alert ('Please enter whole numbers only.');
		obj.value = Math.round(v);
		obj.focus();
		return false;
	}

	if (iFormat==-1 && v>0){
		alert ('Please enter negative numbers only');
		obj.focus();
		return false;
	}

	if (iFormat==1 && v<0){
		alert ('Please enter positive numbers only');
		obj.focus();
		return false;
	}

	obj.value=v;
	return true;

}
