/**
 * check if given value is a valid integer
 * if the flag emptyOK is true, an empty value results to true, otherwise to false
*/ 
function isInt(value, emptyOK) {
	if (value==null || value=="") return emptyOK;

	if(!value.match(/^-{0,1}[0-9]{1,}$/)){
		return false;
	}
	return true;
}
