﻿function ConfirmDeleteItem() {
var agree=confirm("Are you sure you wish to delete the record?");
if (agree) {
    return true;
}
else
{
	return false ;
}

}



function CheckAmount (Field,Value) {
		NewString="";
		SeenPointAlready=false;
		if (isNaN(Value)) {
			SafeChars="0123456789,.";
			for (var i = 0, maxI = Value.length; i < maxI; ++i) {
				CharToTest=Value.charAt(i);
				if (SafeChars.indexOf(CharToTest)>-1)
				{
					if (CharToTest==".") {
						if (SeenPointAlready==false) {
							NewString+=CharToTest;
							SeenPointAlready=true;
						}
					} else {
						NewString+=CharToTest;
					}
				}
				
			}
		} else {NewString=Value;}
		if (NewString=="") {NewString="0";}
		Field.value=NewString;
		//alert(NewString);
	}

function CheckCashAmount (Field,Amount) {
		Amount=Amount.replace(" dollars",".00")
		NewString="";
		if (isNaN(Amount)) {
			SafeChars="0123456789,.";
			for (var i = 0, maxI = Amount.length; i < maxI; ++i) {
				CharToTest=Amount.charAt(i);
				if (SafeChars.indexOf(CharToTest)>-1)
				{
				NewString+=CharToTest;
				}
				
			}
		} else {NewString=Amount;}
		if (NewString.indexOf(".")==-1) {NewString=NewString+".00";}
		Field.value=NewString;
		//alert(NewString);
	}


