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;
	}

function SelectedIndexOf(SelectControl,ValString) {
	// Return the selectedIndex where the given ValString lives...
	// necessitated by Netscape, what else.
	var i, n;
	n = SelectControl.options.length;
	for (i=0; i<n; i++) {
		if (SelectControl.options[i].value == ValString) {
			return i;
		}
	}
	return -1;
}
