function IsInt( numstr, allowNegatives )
	{
	if (numstr+"" == "undefined" || numstr+"" == "null" || numstr+"" == "")	return false;
	if (allowNegatives+"" == "undefined" || allowNegatives+"" == "null") allowNegatives = true;

	var isValid = true;

	numstr += "";	
	for (i = 0; i < numstr.length; i++) 
		{
    	if (!((numstr.charAt(i) >= "0") && (numstr.charAt(i) <= "9") || (numstr.charAt(i) == "-")))
    		{ isValid = false; break; }
		else if ((numstr.charAt(i) == "-" && i != 0) || (numstr.charAt(i) == "-" && !allowNegatives)) 
			{ isValid = false; break; }
		}
	return isValid;
	}


