function getElementHeight(Elem) {
	if(document.getElementById) {
		var elem = document.getElementById(Elem);
	} else if (document.all){
		var elem = document.all[Elem];
	}
	xPos = elem.offsetHeight;
	return xPos;
}

function goURL() {
	window.location='/';
}

function isNumber(n) {
	return !isNaN(parseFloat(n)) && isFinite(n);
}

function validateGrantSearch()
{
	var valid = true;
	var errMsg = '';
	
	if($('#keywords').val().length > 0 && $('#keywords').val().length < 4)
	{
		valid = false;
		errMsg = 'Keyword search must be at least four characters in length.\r\n';
	}

	if($('#min_amount').val().length > 0)
	{
		var tmpAmount = $('#min_amount').val();
		tmpAmount = tmpAmount.replace('$','');
		tmpAmount = tmpAmount.replace(',','');
		if(isNaN(parseInt(tmpAmount)))
		{
			valid = false;
			errMsg += 'Min. Amount must be numeric.\r\n';
		}
		else
			$('#min_amount').val(tmpAmount);
	}

	if(!valid) alert(errMsg);
	return valid;
}
