function isan(_str)
{
	var success = false;
	if (isNaN(_str) == false) {
		success = true;
	}
	return success;
}

function isPositiveNumber(_str)
{
	var success = false;
	_str = globalReplace(_str,",", "");
	_str = globalReplace(_str," ", "");
	if ( (parseInt(_str) >= 0) || (_str == "") )
	{
		if (isan(_str))
		{
			success = true;
		}
	}
	return success;	
}

function globalReplace(_str, findThis, replaceThis)
{
	while (_str.indexOf(findThis) > -1) {
		_str = _str.replace(findThis, replaceThis);
	}
	return _str
}


function ltrim(_str)
{
	var outString = _str;

	while(''+outString.charAt(0)==' '){
		outString=outString.substring(1,outString.length);
	}
	return outString;
}

function rtrim(_str)
{
	var outString = _str;

	while(''+outString.charAt(outString.length-1)==' '){
		outString=outString.substring(0,outString.length-1);
	}
	return outString;
}

function trim(_str)
{
	var outString = _str;

	outString = ltrim(outString);
	outString = rtrim(outString);
	return outString;
}

function validateBoolRadio(oRadio)
{
	var retVal = -1;
	if (oRadio[0].checked) { 
		retVal = 0;
	} else if (oRadio[1].checked) {
		retVal = 1; 
	} else {
		retVal = -1;
	}
	return retVal;
}

function doSubmit(_action)
{
	if (checkForm()) {
		document.frmIA.action = _action;
	}
	document.frmIA.submit();
	return true;
}

function doBackSubmit(_action)
{
		document.frmIA.reset();
		document.frmIA.action = _action;
		document.frmIA.submit();
		return true;
}


function doPopupSubmit(_action)
{
	document.frmIA.action = _action;
	document.frmIA.target = 'windowName';
	document.frmIA.onSubmit = openWindow();
	document.frmIA.submit();
}

function closeBrowser()
{
	window.opener = 'q';
	window.close();
}