<!--
var ns4 = (document.layers)? true:false;
var ie4 = (document.all)? true:false;
var _formVars;
var bInitInProgress = true;
var bUnloaded = false;

function _StorePage() {
	if (bInitInProgress || bUnloaded) return true;
	var obj;
	_form = document.fluffernutter;
	for (var i in _formVars) {
		if (_formVars[i].ObjectType == "fill") {
			obj = _form[i];
			obj.value = _formVars[i].Value;
		}
	}
	bUnloaded = true;
	return true;
}

function _GetObject(name) {
	var obj;
	obj = _form[name];
	return(obj);
}

function _Vars(object) {
	this.Price = new _ObjInfo();
	this.Price.Type = "Currency";
	this.Price.Format = _Format_C2S;
	this.Price.Update = Price_Update;
	this.Price.bOverride = true;
	this.DocStamps = new _ObjInfo();
	this.DocStamps.Type = "Currency";
	this.DocStamps.Format = _Format_C2S;
	this.DocStamps.Update = DocStamps_Update;
	this.DocStamps.bCanBeFilled = false;
	this.DocStamps.bOverride = true;
	this.TitleInsurance = new _ObjInfo();
	this.TitleInsurance.Type = "Currency";
	this.TitleInsurance.Format = _Format_C2S;
	this.TitleInsurance.Update = TitleInsurance_Update;
	this.TitleInsurance.bCanBeFilled = false;
	this.TitleInsurance.bOverride = true;
	this.RelatedTitleFees = new _ObjInfo();
	this.RelatedTitleFees.Type = "Currency";
	this.RelatedTitleFees.Format = _Format_C2S;
	this.RelatedTitleFees.Update = RelatedTitleFees_Update;
	this.RelatedTitleFees.bOverride = true;
	this.SearchFees = new _ObjInfo();
	this.SearchFees.Type = "Currency";
	this.SearchFees.Format = _Format_C2S;
	this.SearchFees.Update = SearchFees_Update;
	this.SearchFees.bOverride = true;
//*****//
//******//
//******//
//	this.ScanFee = new _ObjInfo();
//	this.ScanFee.Type = "Currency";
//	this.ScanFee.Format = _Format_C2S;
//	this.ScanFee.Update = ScanFee_Update;
//	this.ScanFee.bOverride = true;
//******//
	this.TransFee = new _ObjInfo();
	this.TransFee.Type = "Currency";
	this.TransFee.Format = _Format_C2S;
	this.TransFee.Update = TransFee_Update;
	this.TransFee.bOverride = true;
//******//
//******//
//******//
	this.CommissionAmt = new _ObjInfo();
	this.CommissionAmt.Type = "Currency";
	this.CommissionAmt.Format = _Format_C2S;
	this.CommissionAmt.Update = CommissionAmt_Update;
	this.CommissionAmt.bOverride = true;
	this.CommissionPct = new _ObjInfo();
	this.CommissionPct.Type = "Number";
	this.CommissionPct.Format = _Format_N2;
	this.CommissionPct.Update = CommissionPct_Update;
	this.CommissionPct.bOverride = true;
	this.MailAwayYES = new _ObjInfo();
	this.MailAwayYES.Update = MailAwayYES_Update;
	this.MailAwayYES.OnValue = "Yes";
	this.MailAwayYES.OffValue = "0";
	this.MailAwayYES.bOverride = true;
	this.MailAwayYES.ObjectType = "checkbox";
	this.MailaWayExpress = new _ObjInfo();
	this.MailaWayExpress.Type = "Currency";
	this.MailaWayExpress.Format = _Format_C2S;
	this.MailaWayExpress.Update = MailaWayExpress_Update;
	this.MailaWayExpress.bCanBeFilled = false;
	this.MailaWayExpress.bOverride = true;
	/*this.PayoffExpress = new _ObjInfo();
	this.PayoffExpress.Type = "Currency";
	this.PayoffExpress.Format = _Format_C2S;
	this.PayoffExpress.Update = PayoffExpress_Update;
	this.PayoffExpress.bCanBeFilled = false;
	this.PayoffExpress.bOverride = true;*/
	this.Payoff1 = new _ObjInfo();
	this.Payoff1.Type = "Currency";
	this.Payoff1.Format = _Format_C2S;
	this.Payoff1.Update = Payoff1_Update;
	this.Payoff1.bOverride = true;
	this.Payoff2 = new _ObjInfo();
	this.Payoff2.Type = "Currency";
	this.Payoff2.Format = _Format_C2S;
	this.Payoff2.Update = Payoff2_Update;
	this.Payoff2.bOverride = true;



// begin added payoff3
	this.Payoff3 = new _ObjInfo();
	this.Payoff3.Type = "Currency";
	this.Payoff3.Format = _Format_C2S;
	this.Payoff3.Update = Payoff3_Update;
	this.Payoff3.bOverride = true;
// end added payoff3
 


	this.Payoff1ExpressCalc1 = new _ObjInfo();
	this.Payoff1ExpressCalc1.Type = "Currency";
	this.Payoff1ExpressCalc1.Format = _Format_C2S;
	this.Payoff1ExpressCalc1.Update = Payoff1ExpressCalc1_Update;
	this.Payoff1ExpressCalc1.bCanBeFilled = false;
	this.Payoff1ExpressCalc1.bOverride = true;
	this.Payoff1ExpressCalc1.ObjectType = "hidden";
	this.Payoff2ExpressCalc1 = new _ObjInfo();
	this.Payoff2ExpressCalc1.Type = "Currency";
	this.Payoff2ExpressCalc1.Format = _Format_C2S;
	this.Payoff2ExpressCalc1.Update = Payoff2ExpressCalc1_Update;
	this.Payoff2ExpressCalc1.bCanBeFilled = false;
	this.Payoff2ExpressCalc1.bOverride = true;
	this.Payoff2ExpressCalc1.ObjectType = "hidden";



// begin Payoff3ExpressCalc1
	this.Payoff3ExpressCalc1 = new _ObjInfo();
	this.Payoff3ExpressCalc1.Type = "Currency";
	this.Payoff3ExpressCalc1.Format = _Format_C2S;
	this.Payoff3ExpressCalc1.Update = Payoff3ExpressCalc1_Update;
	this.Payoff3ExpressCalc1.bCanBeFilled = false;
	this.Payoff3ExpressCalc1.bOverride = true;
	this.Payoff3ExpressCalc1.ObjectType = "hidden"; 
//end Payoff3ExpressCalc1



	this.NetSeller = new _ObjInfo();
	this.NetSeller.Type = "Currency";
	this.NetSeller.Format = _Format_C2S;
	this.NetSeller.Update = NetSeller_Update;
	this.NetSeller.bCanBeFilled = false;
	this.NetSeller.bOverride = true;
	this.TitlePremCalc = new _ObjInfo();
	this.TitlePremCalc.Type = "Currency";
	this.TitlePremCalc.Format = _Format_C2S;
	this.TitlePremCalc.Update = TitlePremCalc_Update;
	this.TitlePremCalc.bCanBeFilled = false;
	this.TitlePremCalc.bOverride = true;
	this.TitlePremCalc.ObjectType = "hidden";
	this.TitlePremRounding = new _ObjInfo();
	this.TitlePremRounding.Type = "Currency";
	this.TitlePremRounding.Format = _Format_C2S;
	this.TitlePremRounding.Update = TitlePremRounding_Update;
	this.TitlePremRounding.bCanBeFilled = false;
	this.TitlePremRounding.ObjectType = "hidden";
	this.SatRecordingFee = new _ObjInfo();
	this.SatRecordingFee.Type = "Currency";
	this.SatRecordingFee.Format = _Format_C2S;
	this.SatRecordingFee.Update = SatRecordingFee_Update;
	this.SatRecordingFee.bCanBeFilled = false;
	this.SatRecordingFee.bOverride = true;
	this.Payoff1ExpressCalc2 = new _ObjInfo();
	this.Payoff1ExpressCalc2.Type = "Currency";
	this.Payoff1ExpressCalc2.Format = _Format_C2S;
	this.Payoff1ExpressCalc2.Update = Payoff1ExpressCalc2_Update;
	this.Payoff1ExpressCalc2.bCanBeFilled = false;
	this.Payoff1ExpressCalc2.bOverride = true;
	this.Payoff1ExpressCalc2.ObjectType = "hidden";
	this.Payoff2ExpressCalc2 = new _ObjInfo();
	this.Payoff2ExpressCalc2.Type = "Currency";
	this.Payoff2ExpressCalc2.Format = _Format_C2S;
	this.Payoff2ExpressCalc2.Update = Payoff2ExpressCalc2_Update;
	this.Payoff2ExpressCalc2.bCanBeFilled = false;
	this.Payoff2ExpressCalc2.bOverride = true;
	this.Payoff2ExpressCalc2.ObjectType = "hidden";
	//
	this.Payoff3ExpressCalc2 = new _ObjInfo();
	this.Payoff3ExpressCalc2.Type = "Currency";
	this.Payoff3ExpressCalc2.Format = _Format_C2S;
	this.Payoff3ExpressCalc2.Update = Payoff2ExpressCalc2_Update;
	this.Payoff3ExpressCalc2.bCanBeFilled = false;
	this.Payoff3ExpressCalc2.bOverride = true;
	this.Payoff3ExpressCalc2.ObjectType = "hidden";
	//
	this.SellerPaidCCAmt = new _ObjInfo();
	this.SellerPaidCCAmt.Type = "Currency";
	this.SellerPaidCCAmt.Format = _Format_C2S;
	this.SellerPaidCCAmt.Update = SellerPaidCCAmt_Update;
	this.SellerPaidCCAmt.bOverride = true;
	this.SellerPaidCCPct = new _ObjInfo();
	this.SellerPaidCCPct.Type = "Number";
	this.SellerPaidCCPct.Format = _Format_N2;
	this.SellerPaidCCPct.Update = SellerPaidCCPct_Update;
	this.SellerPaidCCPct.bOverride = true;
	this.BuyerWarranty = new _ObjInfo();
	this.BuyerWarranty.Type = "Currency";
	this.BuyerWarranty.Format = _Format_C2S;
	this.BuyerWarranty.Update = BuyerWarranty_Update;
	this.BuyerWarranty.bOverride = true;
	this.TaxProration = new _ObjInfo();
	this.TaxProration.Type = "Currency";
	this.TaxProration.Format = _Format_C2S;
	this.TaxProration.Update = TaxProration_Update;
	this.TaxProration.bOverride = true;
	this.ClosingDate = new _ObjInfo();
	this.ClosingDate.Type = "Date";
	this.ClosingDate.Format = _Format_DS;
	this.ClosingDate.Update = ClosingDate_Update;
	this.ClosingDate.bOverride = true;
	this.LastYearTaxes = new _ObjInfo();
	this.LastYearTaxes.Type = "Currency";
	this.LastYearTaxes.Format = _Format_C2S;
	this.LastYearTaxes.Update = LastYearTaxes_Update;
	this.LastYearTaxes.bOverride = true;
	this.OtherSellerFees = new _ObjInfo();
	this.OtherSellerFees.Type = "Currency";
	this.OtherSellerFees.Format = _Format_C2S;
	this.OtherSellerFees.Update = OtherSellerFees_Update;
	this.OtherSellerFees.bOverride = true;
	this.OtherSellerFeesDesc = new _ObjInfo();
	this.OtherSellerFeesDesc.bOverride = true;
}

function _InitVars(object) {
	bInitInProgress = true;
	_form = document.fluffernutter;
	_subForm = document.watsonform;
	_formVars = new _Vars();
	var obj;
	for (var i in _formVars) {
		if (_formVars[i].ObjectType == "fill" || _formVars[i].ObjectType == "checkbox" || _formVars[i].ObjectType == "select") {
			obj = _GetObject(i);
			if (_formVars[i].ObjectType == "fill") {
				_formVars[i].Value = obj.value;
				_SetObjectNumber(_formVars[i]);
			}
			else if (_formVars[i].ObjectType == "select") {
				if (obj.options.selectedIndex == -1) _formVars[i].Value = ""
				else _formVars[i].Value = obj.options[obj.options.selectedIndex].text;
				_SetObjectNumber(_formVars[i]);
			}
			else if (_formVars[i].ObjectType == "checkbox") {
				if (obj.checked) _formVars[i].Value = _formVars[i].OnValue;
				else _formVars[i].Value = _formVars[i].OffValue;
				_SetObjectNumber(_formVars[i]);
				if (obj.checked) {
					if (_formVars[i].Group != "") {
						var group = _formVars[i].Group;
						_formVars[group].Value = _formVars[i].Value;
						_formVars[group].Number = _formVars[i].Number;
						_formVars[group].bNumber = _formVars[i].bNumber;
					}
				}
			}
			if (_formVars[i].ObjectType == "fill" &&  _formVars[i].Value != "") {
				_formVars[i].bHasData = true;
				_UpdateField(i);
			}
		}
	}
	for (var i in _formVars) {
		_formVars[i].Update();
	}
	bInitInProgress = false;
	return true;
}

function _OnSubmit(object) {
	if (bInitInProgress) return true;
	var obj;
	for (var i in _formVars) {
		if (_formVars[i].Group == "") {
			if (_formVars[i].ObjectType == "group" || _formVars[i].ObjectType == "hidden") {
				if (!_CheckValidations(i)) return false;
				object[i].value = _formVars[i].Value;
			}
			else {
				obj = _GetObject(i);
				if (!_CheckValidations(i)) return false;
				if (_formVars[i].ObjectType == "checkbox") {
					if (obj.checked) object[i].value = obj.value;
					else object[i].value = "";
				}
				else if (_formVars[i].ObjectType == "select") {
					if (obj.options.selectedIndex == -1) object[i].value = ""
					else object[i].value = obj.options[obj.options.selectedIndex].text;
				}
				else object[i].value = obj.value;
			}
		}
	}
	return true;
}

function _OnReset(object) {
	if (bInitInProgress) return true;
	_formVars = new _Vars();
	var obj;
	for (var i in _formVars) {
		if (_formVars[i].ObjectType == "fill" || _formVars[i].ObjectType == "checkbox" || _formVars[i].ObjectType == "select") {
			obj = _GetObject(i);
			if (_formVars[i].ObjectType == "fill") {
				obj.value = "";
				_formVars[i].Value = ""
			}
			else if (_formVars[i].ObjectType == "select") {
				obj.options.selectedIndex = 0;
				_formVars[i].Value = obj.options[0].text;
			}
			else if (_formVars[i].ObjectType == "checkbox") {
				obj.checked = false;
				_formVars[i].Value = _formVars[i].OffValue;
			}
			_SetObjectNumber(_formVars[i]);
		}
	}
	for (var i in _formVars) {
		_formVars[i].Update();
	}
	return false;
}

function Price_Update() {
	//ScanFee_Update();
	TransFee_Update();
	DocStamps_Update();
	TitlePremRounding_Update();
	RelatedTitleFees_Update();
	SearchFees_Update();
	CommissionAmt_Update();
	NetSeller_Update();
	NetSeller_Update();
	SellerPaidCCAmt_Update();
	NetSeller_Update();
	NetSeller_Update();
}
//******//
//******//
//******//
function ScanFee_Update() {
	if(!_formVars.ScanFee.bHasBeenFilled) {
		_formVars.ScanFee.Value = 15;
		_SetObjectNumber(_formVars.ScanFee);
		if (_formVars.ScanFee.Value != "") _formVars.ScanFee.bHasData = true;
		else _formVars.ScanFee.bHasData = false;
	}
	_UpdateField("ScanFee");
	NetSeller_Update();
	NetSeller_Update();
	NetSeller_Update();
	NetSeller_Update();
}
//******//
function TransFee_Update() {
	if(!_formVars.TransFee.bHasBeenFilled) {
		_formVars.TransFee.Value = 195;
		_SetObjectNumber(_formVars.TransFee);
		if (_formVars.TransFee.Value != "") _formVars.TransFee.bHasData = true;
		else _formVars.TransFee.bHasData = false;
	}
	_UpdateField("TransFee");
	NetSeller_Update();
	NetSeller_Update();
	NetSeller_Update();
	NetSeller_Update();
}
//******//
//******//
//******//
function DocStamps_Update() {
	if(!_formVars.DocStamps.bHasBeenFilled) {
		_formVars.DocStamps.Number = ((_Round(((_formVars.Price.Number/*+49.99*/)/1000),1)*10)*0.7);
		_formVars.DocStamps.bNumber = true;
		if (_formVars.DocStamps.Number != 0) {
			_formVars.DocStamps.Value = _Format_C2S(_formVars.DocStamps);
			_formVars.DocStamps.bHasData = true;
		}
		else {
			_formVars.DocStamps.Value = "";
			_formVars.DocStamps.bHasData = false;
		}
	}
	_UpdateField("DocStamps");
	NetSeller_Update();
	NetSeller_Update();
	NetSeller_Update();
	NetSeller_Update();
}

function TitleInsurance_Update() {
	if(!_formVars.TitleInsurance.bHasBeenFilled) {

		var swtchVal = _formVars.Price.Number;
		
		switch(true) 
		{
			//-------------------------------------------
			case swtchVal > -100000 && swtchVal <= 0 : 
			{
				_formVars.TitleInsurance.Value = 100 ; 
			}
			break;

			case swtchVal <= 100000 : 
			{
				_formVars.TitleInsurance.Value = (swtchVal / 1000) * 5.75 ;
			}
			break;

			//-------------------------------------------
			case swtchVal > 100000 && swtchVal <= 1000000 : 
			{
				_formVars.TitleInsurance.Value = 575 + ((swtchVal - 100000) / 1000) * 5.00 ; 
			}
			break;

			//-------------------------------------------
			case swtchVal > 1000000 && swtchVal <= 5000000 : 
			{
				_formVars.TitleInsurance.Value = 575 + 4500 + ((swtchVal - 1000000) / 1000) * 2.50 ;
			}
			break;

			//-------------------------------------------
			case swtchVal > 5000000 : 
			{
				_formVars.TitleInsurance.Value = 575 + 4500 + 10000 + ((swtchVal - 5000000) / 1000) * 2.00 ;
			}
			break;
		}

		_SetObjectNumber(_formVars.TitleInsurance);
		if (_formVars.TitleInsurance.Value != "") _formVars.TitleInsurance.bHasData = true;
		else _formVars.TitleInsurance.bHasData = false;
	}
	_UpdateField("TitleInsurance");
	NetSeller_Update();
	NetSeller_Update();
	NetSeller_Update();
	NetSeller_Update();
}

function RelatedTitleFees_Update() {
	if(!_formVars.RelatedTitleFees.bHasBeenFilled) {
		_formVars.RelatedTitleFees.Value = 325;
		_SetObjectNumber(_formVars.RelatedTitleFees);
		if (_formVars.RelatedTitleFees.Value != "") _formVars.RelatedTitleFees.bHasData = true;
		else _formVars.RelatedTitleFees.bHasData = false;
	}
	_UpdateField("RelatedTitleFees");
	NetSeller_Update();
	NetSeller_Update();
	NetSeller_Update();
	NetSeller_Update();
}

function SearchFees_Update() {
	if(!_formVars.SearchFees.bHasBeenFilled) {
		_formVars.SearchFees.Value = 100;
		_SetObjectNumber(_formVars.SearchFees);
		if (_formVars.SearchFees.Value != "") _formVars.SearchFees.bHasData = true;
		else _formVars.SearchFees.bHasData = false;
	}
	_UpdateField("SearchFees");
	NetSeller_Update();
	NetSeller_Update();
	NetSeller_Update();
	NetSeller_Update();
}

function CommissionAmt_Update() {
	if(!_formVars.CommissionAmt.bHasBeenFilled) {
		_formVars.CommissionAmt.Number = ((_formVars.Price.Number*_formVars.CommissionPct.Number)/100);
		_formVars.CommissionAmt.bNumber = true;
		if (_formVars.CommissionAmt.Number != 0) {
			_formVars.CommissionAmt.Value = _Format_C2S(_formVars.CommissionAmt);
			_formVars.CommissionAmt.bHasData = true;
		}
		else {
			_formVars.CommissionAmt.Value = "";
			_formVars.CommissionAmt.bHasData = false;
		}
	}
	_UpdateField("CommissionAmt");
	NetSeller_Update();
	NetSeller_Update();
	NetSeller_Update();
	NetSeller_Update();
}

function CommissionPct_Update() {
	CommissionAmt_Update();
}

function MailAwayYES_Update() {
	MailaWayExpress_Update();
}

function MailaWayExpress_Update() {
	if(!_formVars.MailaWayExpress.bHasBeenFilled) {
		_formVars.MailaWayExpress.Value = ""+((_formVars.MailAwayYES.Value=="Yes")?"Yes":"No");
		_SetObjectNumber(_formVars.MailaWayExpress);
		_formVars.MailaWayExpress.bHasData = true;
	}

//	if(!_formVars.MailaWayExpress.bHasBeenFilled) {
//		_formVars.MailaWayExpress.Value = ""+((_formVars.MailAwayYES.Value=="Yes")?75:0);
//		_SetObjectNumber(_formVars.MailaWayExpress);
//		if (_formVars.MailaWayExpress.Value != "") _formVars.MailaWayExpress.bHasData = true;
//		else _formVars.MailaWayExpress.bHasData = false;
//	}
	_UpdateField("MailaWayExpress");
	NetSeller_Update();
	NetSeller_Update();
	NetSeller_Update();
	NetSeller_Update();
}

/*function PayoffExpress_Update() {
	if(!_formVars.PayoffExpress.bHasBeenFilled) {
		_formVars.PayoffExpress.Number = (_formVars.Payoff3ExpressCalc1.Number+_formVars.Payoff2ExpressCalc1.Number+_formVars.Payoff1ExpressCalc1.Number);
		_formVars.PayoffExpress.bNumber = true;
		if (_formVars.PayoffExpress.Number != 0) {
			_formVars.PayoffExpress.Value = _Format_C2S(_formVars.PayoffExpress);
			_formVars.PayoffExpress.bHasData = true;
		}
		else {
			_formVars.PayoffExpress.Value = "";
			_formVars.PayoffExpress.bHasData = false;
		}
	}
	_UpdateField("PayoffExpress");
	NetSeller_Update();
	NetSeller_Update();
	NetSeller_Update();
	NetSeller_Update();
}
*/
function Payoff1_Update() {
	Payoff1ExpressCalc1_Update();
	NetSeller_Update();
	Payoff1ExpressCalc2_Update();
	NetSeller_Update();
	NetSeller_Update();
	NetSeller_Update();
}

function Payoff2_Update() {
	Payoff2ExpressCalc1_Update();
	NetSeller_Update();
	Payoff2ExpressCalc2_Update();
	NetSeller_Update();
	NetSeller_Update();
	NetSeller_Update();
}
function Payoff3_Update() {
	Payoff3ExpressCalc1_Update();
	NetSeller_Update();
	Payoff3ExpressCalc2_Update();
	NetSeller_Update();
	NetSeller_Update();
	NetSeller_Update();
}

function Payoff1ExpressCalc1_Update() {
	if(!_formVars.Payoff1ExpressCalc1.bHasBeenFilled) {
		_formVars.Payoff1ExpressCalc1.Value = ""+((_formVars.Payoff1.Number>0)?15:0);
		_SetObjectNumber(_formVars.Payoff1ExpressCalc1);
		if (_formVars.Payoff1ExpressCalc1.Value != "") _formVars.Payoff1ExpressCalc1.bHasData = true;
		else _formVars.Payoff1ExpressCalc1.bHasData = false;
	}
	_UpdateField("Payoff1ExpressCalc1");
	//PayoffExpress_Update();
}

function Payoff2ExpressCalc1_Update() {
	if(!_formVars.Payoff2ExpressCalc1.bHasBeenFilled) {
		_formVars.Payoff2ExpressCalc1.Value = ""+((_formVars.Payoff2.Number>0)?15:0);
		_SetObjectNumber(_formVars.Payoff2ExpressCalc1);
		if (_formVars.Payoff2ExpressCalc1.Value != "") _formVars.Payoff2ExpressCalc1.bHasData = true;
		else _formVars.Payoff2ExpressCalc1.bHasData = false;
	}
	_UpdateField("Payoff2ExpressCalc1");
	//PayoffExpress_Update();
	//PayoffExpress_Update();
}



// 
function Payoff3ExpressCalc1_Update() {
	if(!_formVars.Payoff3ExpressCalc1.bHasBeenFilled) {
		_formVars.Payoff3ExpressCalc1.Value = ""+((_formVars.Payoff3.Number>0)?15:0);
		_SetObjectNumber(_formVars.Payoff3ExpressCalc1);
		if (_formVars.Payoff3ExpressCalc1.Value != "") _formVars.Payoff3ExpressCalc1.bHasData = true;
		else _formVars.Payoff3ExpressCalc1.bHasData = false;
	}
	_UpdateField("Payoff3ExpressCalc1");
	//PayoffExpress_Update();
	//PayoffExpress_Update();
}

//





function NetSeller_Update() {
	if(!_formVars.NetSeller.bHasBeenFilled) {
		_formVars.NetSeller.Number = (_formVars.Price.Number-(((((((((((((_formVars.CommissionAmt.Number+_formVars.DocStamps.Number)
		+_formVars.TitleInsurance.Number)
		+_formVars.RelatedTitleFees.Number)
		+_formVars.SearchFees.Number)
		//+_formVars.MailaWayExpress.Number)
		+_formVars.Payoff1.Number)
		+_formVars.Payoff2.Number)
		+_formVars.Payoff3.Number)
		+_formVars.SatRecordingFee.Number)
		+_formVars.BuyerWarranty.Number)
		+_formVars.SellerPaidCCAmt.Number)
		//+_formVars.ScanFee.Number)
		+_formVars.TransFee.Number)
		+_formVars.TaxProration.Number)
		+_formVars.OtherSellerFees.Number));
		
		
		_formVars.NetSeller.bNumber = true;
		if (_formVars.NetSeller.Number != 0) {
			_formVars.NetSeller.Value = _Format_C2S(_formVars.NetSeller);
			_formVars.NetSeller.bHasData = true;
		}
		else {
			_formVars.NetSeller.Value = "";
			_formVars.NetSeller.bHasData = false;
		}
	}
	_UpdateField("NetSeller");
}

function TitlePremCalc_Update() {
	if(!_formVars.TitlePremCalc.bHasBeenFilled) {
		_formVars.TitlePremCalc.Value = ""+((_formVars.TitlePremRounding.Number>100000)?((((_formVars.TitlePremRounding.Number-100000)/100)*0.5)+575):((_formVars.TitlePremRounding.Number/100)*0.575));
		_SetObjectNumber(_formVars.TitlePremCalc);
		if (_formVars.TitlePremCalc.Value != "") _formVars.TitlePremCalc.bHasData = true;
		else _formVars.TitlePremCalc.bHasData = false;
	}
	_UpdateField("TitlePremCalc");
	TitleInsurance_Update();
	TitleInsurance_Update();
}

function TitlePremRounding_Update() {
	if(!_formVars.TitlePremRounding.bHasBeenFilled) {
		_formVars.TitlePremRounding.Number = (_Round(((_formVars.Price.Number+49.99)/1000),1)*1000);
		_formVars.TitlePremRounding.bNumber = true;
		if (_formVars.TitlePremRounding.Number != 0) {
			_formVars.TitlePremRounding.Value = _Format_C2S(_formVars.TitlePremRounding);
			_formVars.TitlePremRounding.bHasData = true;
		}
		else {
			_formVars.TitlePremRounding.Value = "";
			_formVars.TitlePremRounding.bHasData = false;
		}
	}
	_UpdateField("TitlePremRounding");
	TitlePremCalc_Update();
	TitlePremCalc_Update();
	TitlePremCalc_Update();
}

function SatRecordingFee_Update() {
	if(!_formVars.SatRecordingFee.bHasBeenFilled) {
		_formVars.SatRecordingFee.Number = (_formVars.Payoff1ExpressCalc2.Number+_formVars.Payoff2ExpressCalc2.Number+_formVars.Payoff3ExpressCalc2.Number);
		_formVars.SatRecordingFee.bNumber = true;
		if (_formVars.SatRecordingFee.Number != 0) {
			_formVars.SatRecordingFee.Value = _Format_C2S(_formVars.SatRecordingFee);
			_formVars.SatRecordingFee.bHasData = true;
		}
		else {
			_formVars.SatRecordingFee.Value = "";
			_formVars.SatRecordingFee.bHasData = false;
		}
	}
	_UpdateField("SatRecordingFee");
	NetSeller_Update();
	NetSeller_Update();
	NetSeller_Update();
}

function Payoff1ExpressCalc2_Update() {
	if(!_formVars.Payoff1ExpressCalc2.bHasBeenFilled) {
		_formVars.Payoff1ExpressCalc2.Value = ""+((_formVars.Payoff1.Number>0)?15:0);
		_SetObjectNumber(_formVars.Payoff1ExpressCalc2);
		if (_formVars.Payoff1ExpressCalc2.Value != "") _formVars.Payoff1ExpressCalc2.bHasData = true;
		else _formVars.Payoff1ExpressCalc2.bHasData = false;
	}
	_UpdateField("Payoff1ExpressCalc2");
	SatRecordingFee_Update();
	SatRecordingFee_Update();
}

function Payoff2ExpressCalc2_Update() {
	if(!_formVars.Payoff2ExpressCalc2.bHasBeenFilled) {
		_formVars.Payoff2ExpressCalc2.Value = ""+((_formVars.Payoff2.Number>0)?15:0);
		_SetObjectNumber(_formVars.Payoff2ExpressCalc2);
		if (_formVars.Payoff2ExpressCalc2.Value != "") _formVars.Payoff2ExpressCalc2.bHasData = true;
		else _formVars.Payoff2ExpressCalc2.bHasData = false;
	}
	_UpdateField("Payoff2ExpressCalc2");
	SatRecordingFee_Update();
}

//

function Payoff3ExpressCalc2_Update() {
	if(!_formVars.Payoff3ExpressCalc2.bHasBeenFilled) {
		_formVars.Payoff3ExpressCalc2.Value = ""+((_formVars.Payoff3.Number>0)?15:0);
		_SetObjectNumber(_formVars.Payoff3ExpressCalc2);
		if (_formVars.Payoff3ExpressCalc2.Value != "") _formVars.Payoff3ExpressCalc2.bHasData = true;
		else _formVars.Payoff3ExpressCalc2.bHasData = false;
	}
	_UpdateField("Payoff3ExpressCalc2");
	SatRecordingFee_Update();
}


//


function SellerPaidCCAmt_Update() {
	if(!_formVars.SellerPaidCCAmt.bHasBeenFilled) {
		_formVars.SellerPaidCCAmt.Number = ((_formVars.Price.Number*_formVars.SellerPaidCCPct.Number)/100);
		_formVars.SellerPaidCCAmt.bNumber = true;
		if (_formVars.SellerPaidCCAmt.Number != 0) {
			_formVars.SellerPaidCCAmt.Value = _Format_C2S(_formVars.SellerPaidCCAmt);
			_formVars.SellerPaidCCAmt.bHasData = true;
		}
		else {
			_formVars.SellerPaidCCAmt.Value = "";
			_formVars.SellerPaidCCAmt.bHasData = false;
		}
	}
	_UpdateField("SellerPaidCCAmt");
	NetSeller_Update();
	NetSeller_Update();
}

function SellerPaidCCPct_Update() {
	SellerPaidCCAmt_Update();
}

function BuyerWarranty_Update() {
	NetSeller_Update();
	NetSeller_Update();
	NetSeller_Update();
}

function TaxProration_Update() {
	if(!_formVars.TaxProration.bHasBeenFilled) {
		_formVars.TaxProration.Number = ((_formVars.LastYearTaxes.Number/365)*_DayOfYear(_GetString((_formVars.ClosingDate.Number-1))));
		_formVars.TaxProration.bNumber = true;
		if (_formVars.TaxProration.Number != 0) {
			_formVars.TaxProration.Value = _Format_C2S(_formVars.TaxProration);
			_formVars.TaxProration.bHasData = true;
		}
		else {
			_formVars.TaxProration.Value = "";
			_formVars.TaxProration.bHasData = false;
		}
	}
	_UpdateField("TaxProration");
	NetSeller_Update();
}

function ClosingDate_Update() {
	if(!_formVars.ClosingDate.bHasBeenFilled) {
		_formVars.ClosingDate.Value = _Date();
		_SetObjectNumber(_formVars.ClosingDate);
		if (_formVars.ClosingDate.Value != "") _formVars.ClosingDate.bHasData = true;
		else _formVars.ClosingDate.bHasData = false;
	}
	_UpdateField("ClosingDate");
	TaxProration_Update();
}

function LastYearTaxes_Update() {
	TaxProration_Update();
	TaxProration_Update();
}

function OtherSellerFees_Update() {
	NetSeller_Update();
}

function _ComputeForm(object) {
	if (bInitInProgress) return true;
	var name = object.name;
	var field = name;
	if(_formVars[name].bCanBeFilled) {
		if (object.type == "checkbox") {
			if (object.checked == true) _formVars[name].Value=object.value;
			else _formVars[name].Value=_formVars[name].OffValue;
			_SetObjectNumber(_formVars[name]);
			if (_formVars[name].Group != "") {
				var group = _formVars[name].Group;
				_formVars[group].Value = _formVars[name].Value;
				_formVars[group].Number = _formVars[name].Number;
				_formVars[group].bNumber = _formVars[name].bNumber;
				_UpdateField(group);
				field = group;
			}
		}else if (object.type == "select-one") {
			_formVars[name].Value = object.options[object.options.selectedIndex].text;
			_SetObjectNumber(_formVars[name]);
		}else{
			_formVars[name].Value = object.value;
			_SetObjectNumber(_formVars[name]);
			_formVars[name].bSaved = true;
		}
		_formVars[field].bHasBeenFilled = true;
		if(_formVars[field].Value != "") {
			_formVars[field].bHasData = true;
		}
		else {
			_formVars[field].bHasData = false;
		}
		_formVars[field].Update();
		_formVars[field].bHasBeenFilled = false;
	}
	return true;
}

function _UpdateField(name) {
	var obj;
	if (_formVars[name].ObjectType == "fill" || _formVars[name].ObjectType == "checkbox" || _formVars[name].ObjectType == "select") {
		obj = _GetObject(name);
		if (_formVars[name].ObjectType == "fill") {
			if (!_formVars[name].bHasData) obj.value = "";
			else if (_formVars[name].bNumber) obj.value = _formVars[name].Format(_formVars[name]);
			else obj.value = _formVars[name].Value;
		}
		else if (_formVars[name].ObjectType == "select") {
			var index = -1;
			for (var i=0; i<obj.length; i++) {
				if (obj.options[i].text == _formVars[name].Value) index = i;
			}
			obj.selectedIndex = index;
		}
		else if (_formVars[name].ObjectType == "checkbox") {
			if (_formVars[name].Value == _formVars[name].OnValue) obj.checked = true;
			else  obj.checked = false;
		}
	}
	else if (_formVars[name].ObjectType == "group") {
		for (var i in _formVars) {
			if (_formVars[i].Group == name) {
				obj = _GetObject(i);
				if (_formVars[i].OnValue == _formVars[name].Value) obj.checked = true;
				else obj.checked = false;
			}
		}
	}
}

function _GetNumber(string) {
	var temp=_ConvertNumber(string);
	if (typeof(temp) != "number") return(0);
	else return(temp);
}
function _SetObjectNumber(object) {
	var temp=_ConvertNumber(object.Value);
	if (typeof(temp) != "number") {
		object.Number = 0;
		object.bNumber = false;
	}
	else {
		object.Number = temp;
		object.bNumber = true;
	}
}
function _ConvertNumber(string) {
	string1=""+string;
	if (string1 == "") return(0);
	var stringPart = new Array();
	_MakeStringParts(string1, stringPart);
	if (_MatchDateString(stringPart)) return(stringPart.Value);
	else if (_MatchTimeString(stringPart)) return(stringPart.Value);
	else if (_MatchNumberString(stringPart)) return(stringPart.Value);
	else return("");
}
function _StringPart() {
	this.RawType = "";
	this.LogType = "";
	this.Offset = "";
	this.Length = "";
	this.Value = "";
}
function _MakeStringParts(string, stringPart) {
	var count=0;
	var parts=0;
	while (count<string.length) {
		stringPart[parts] = new _StringPart();
		stringPart[parts].Offset = count;
		var length = 0;
		var rawType = "";
		var logType = "";
		while (count<string.length) {
			if (_IsNumericChar(string.charAt(count))) {
				if (rawType == "") rawType = "num";
				else if (rawType == "alpha") break;
			}
			else if (_IsAlphaChar(string.charAt(count))) {
				if (rawType == "") rawType = "alpha";
				else if (rawType == "num") break;
			}
			else break;
			count++;
			length++;
		}
		if (length>0) {
			var value = string.substring(stringPart[parts].Offset,count);
			if (rawType == "alpha") {
				if (_IsMonthName(value) != -1) logType = "month";
			}
			stringPart[parts].Value = value;
			stringPart[parts].Length = length;
			stringPart[parts].RawType = rawType;
		}
		else {
			stringPart[parts].Value = string.charAt(count);
			stringPart[parts].Length = 1;
			stringPart[parts].RawType = string.charAt(count);
			if (string.charAt(count) == "$") logType = "cur";
			count++;
		}
		stringPart[parts].LogType = logType;
		parts++;
	}
	stringPart.Length = parts;
	stringPart.Value = "";
}
function _MatchDateString(stringPart) {
	var month = 0;
	var day = 0;
	var year = 0;
	var bFound = false;
	if (stringPart.Length == 5 && stringPart[1].Value == stringPart[3].Value && (stringPart[1].Value == '/' || stringPart[1].Value == '-' || stringPart[1].Value == '.') && stringPart[2].Length <= 2) {
		if (stringPart[0].RawType == "num" && stringPart[2].RawType == "num" && stringPart[4].RawType == "num") {
			month = stringPart[0].Value;
			day = stringPart[2].Value;
			year = stringPart[4].Value;
			bFound = true;
		}
	}
	else if (stringPart.Length == 3 && (stringPart[1].Value == '/' || stringPart[1].Value == '-')) {
		if (stringPart[0].RawType == "num" && stringPart[2].RawType == "num") {
			month = stringPart[0].Value;
			day = 1;
			year = stringPart[2].Value;
			bFound = true;
		}
	}
	else {
		var count=0;
		while (count<stringPart.Length && !bFound) {
			if (stringPart[count].LogType == "month") {
				bFound = true;
				month = _IsMonthName(stringPart[count].Value) + 1;
			}
			count++;
		}
		if (bFound) {
			bFound = false;
			count=0;
			while (count<stringPart.Length && !bFound) {
				if (stringPart[count].RawType == "num") {day = stringPart[count].Value; bFound = true;}
				count++;
			}
			if (bFound) {
				bFound = false;
				while (count<stringPart.Length && !bFound) {
					if (stringPart[count].RawType == "num") {year = stringPart[count].Value; bFound = true;}
					count++;
				}
				if (!bFound && day > 31) {year = day; day = 1; bFound = true;}
			}
		}
	}
	if (bFound) {
		if (month*1 < 1 || month*1 > 12 || day*1 < 1 || day*1 > 31) return false;
		if (year*1 < 30) year = year*1 + 2000;
		else if (year*1 < 100) year = year*1 + 1900;
		stringPart.Value = (Date.parse(month + "/" + day + "/" + year)/86400000);
		return true;
	}
	return false;
}
function _MonthNamesArray() {
	this[0]="January";
	this[1]="February";
	this[2]="March";
	this[3]="April";
	this[4]="May";
	this[5]="June";
	this[6]="July";
	this[7]="August";
	this[8]="September";
	this[9]="October";
	this[10]="November";
	this[11]="December";
}
function _MatchNumberString(stringPart) {
	var dash = -1;
	var lparen = -1;
	var rparen = -1;
	var dec = -1;
	var preDec = -1;
	var postDec = -1;
	var percent = -1;
	var length = stringPart.Length;
	for (var count=0; count<length; count++) {
		if (stringPart[count].RawType == "-") {if (dash != -1) return false; dash = count;}
		else if (stringPart[count].RawType == "(") {if (lparen != -1) return false; lparen = count;}
		else if (stringPart[count].RawType == ")") {if (rparen != -1 || lparen == -1) return false; rparen = count;}
		else if (stringPart[count].RawType == ".") {dec = count;}
		else if (stringPart[count].RawType == "num") {
			if (preDec == -1 && dec == -1) preDec = count;
			else if (postDec == -1 && dec != -1) postDec = count;
		}
		else if (stringPart[count].RawType == "%") {if (percent != -1) return false; percent = count;}
		else if (stringPart[count].RawType != "," && stringPart[count].RawType != " " && stringPart[count].LogType != "cur") return false;
	}
	if (preDec != -1 || postDec != -1) {
		var preDecNum = "";
		var postDecNum = "";
		if (preDec != -1) {
			if (dec == -1) dec = length;
			preDecNum = stringPart[preDec].Value;
			for (count=preDec+1; count<dec; count++) {
				if (stringPart[count].RawType == "num") preDecNum = "" + preDecNum + stringPart[count].Value;
			}
		}
		if (postDec != -1) {
			for (count=postDec; count<length; count++) {
				if (stringPart[count].RawType == "num") postDecNum = "" + postDecNum + stringPart[count].Value;
			}
		}
		var num;
		if (preDec != -1) num = preDecNum;
		else num = "0";
		if (postDec != -1) num = num + "." + postDecNum;
		if (dash != -1 || (lparen != -1 && rparen != -1)) num = "-" + num;
		if (percent != -1) num /= 100;
		stringPart.Value = num*1;
		return true;
	}
}
function _MatchTimeString(stringPart) {
	var string;
	var AmPm = "";
	var hour;
	var minute = 0;
	var second = 0;
	var length = stringPart.Length;
	if (stringPart[0].RawType != "num") return false;
	if (length >= 2) {
		string = stringPart[length-1].Value.toLowerCase();
		if (string == "am" || string == "pm") {AmPm = string; length -= 1;}
		else if (length >= 5 && string == "." && stringPart[length-2].Value.toLowerCase() == "m" && stringPart[length-3].Value.toLowerCase() == ".") {
			if (stringPart[length-4].Value.toLowerCase() == "a") {AmPm = "am"; length -= 4;}
			else if (stringPart[length-4].Value.toLowerCase() == "p") {AmPm = "pm"; length -= 4;}
		}
	}
	hour = stringPart[0].Value*1;
	if (hour == 12 && AmPm == "am") hour = 0;
	else if (hour != 12 && AmPm == "pm") hour += 12;
	if (hour < 0 || hour >= 24) return false;
	if ((length == 1 || (length == 2 && stringPart[1].Value == " ")) && AmPm != "") {}
	else if (length >= 3 && stringPart[1].Value == ":" && stringPart[2].RawType == "num") {
		if (length == 4 && stringPart[3].Value != " ") return false;
		if (length >= 5 && (stringPart[3].Value != ":" || stringPart[4].RawType != "num")) return false;
		if (length == 6 && stringPart[5].Value != " ") return false;
		minute = stringPart[2].Value*1;
		if (minute < 0 || minute >= 60) return false;
		if (length >= 5) {
			second = stringPart[4].Value*1;
			if (second < 0 || second >= 60) return false;
		}
	}
	else return false;
	stringPart.Value = (((((hour*60)+minute)*60)+second)/86400);
	return true;
}
function _IsNumericChar(string) {
	if (string.charAt(0) >= '0' && string.charAt(0) <= '9') return true;
	return false;
}
function _IsAlphaChar(string) {
	var char1 = string.charAt(0);
	if ((char1 >= 'A' && char1 <= 'Z')||(char1 >= 'a' && char1 <= 'z')) return true;
	else if (char1 == 'ƒ' || char1 == 'Š' || char1 == 'Œ' || char1 == 'š' || char1 == 'œ' || char1 == 'Ÿ') return true;
	else if (char1 > 'À' && char1 != '×' && char1 != '÷') return true;
	return false;
}
function _IsMonthName(string) {
	var string1 = string.toLowerCase();
	var month = -1;
	var monthNames = new _MonthNamesArray();
	for (var count=0; count<12 && month==-1; count++) {
		if (monthNames[count].toLowerCase() == string1) month = count;
	}
	return(month);
}
function _GetString(number) {
	return(""+number);
}
function _ObjInfo() {
	this.bHasData = false;
	this.Number = 0;
	this.Value = "";
	this.Type = "G";
	this.Format = _Format_Gen;
	this.bHasCalc = false;
	this.Help = "";
	this.bMustFill = false;
	this.bMatchType = false;
	this.MinValue = "";
	this.MaxValue = "";
	this.OnValue = "";
	this.OffValue = "";
	this.bCanBeFilled = true;
	this.bOverride = false;
	this.bOverridden = false;
	this.bSaved = true;
	this.bNumber = false;
	this.ObjectType = "fill";
	this.Group = "";
	this.bHasBeenFilled = false;
	this.Update = _General_Update;
	this.NextTab = "";
	this.PrevTab = "";
}
function _General_Update() {
	return;
}
function _CheckValidations(name) {
	return true;
}
function _onFocus(object) {
	if (bInitInProgress) return true;
	if(_formVars[object.name].bSaved && _formVars[object.name].ObjectType == "fill" && _formVars[object.name].bHasData) {
		object.value = _formVars[object.name].Value;
	}
	_formVars[object.name].bSaved = false;
	self.status=_formVars[object.name].Help;
	return true;
}
function _onBlur(object) {
	if (bInitInProgress || bUnloaded) return true;
	if (object.value == _formVars[object.name].Value || _formVars[object.name].bSaved == true) {
		if(_formVars[object.name].ObjectType == "fill" && _formVars[object.name].bHasData) {
			if (_formVars[object.name].bNumber) object.value = _formVars[object.name].Format(_formVars[object.name]);
		}
		_formVars[object.name].bSaved = true;
	}
	if (_formVars[object.name].Help != "") self.status="";
	return true;
}
function _Date() {
	var tempDate = new Date();
	var result = "";
	var temp = tempDate.getMonth()+1;
	if (temp < 10) result += "0";
	result += (temp + "/");
	temp = tempDate.getDate();
	if (temp < 10) result += "0";
	result += (temp + "/");
	temp = tempDate.getYear();
	if (temp >= 1000) temp = (""+temp).substr(2,2);
	result += temp;
	return(result);
}
function _DayOfYear(dateString) {
	var tempDate = new Date();
	tempDate.setTime(_GetNumber(dateString) * 86400000);
	var month = tempDate.getMonth();
	var monthDays = new _MonthDaysArray(tempDate.getYear());
	days = 0;
	for (var count=0; count<month; count++) {
		days += monthDays[count];
	}
	days += tempDate.getDate();
	return(days);
}
function _MonthDaysArray(year) {
	this[0]=31;
	if ((year % 4 == 0) && ((year % 100 != 0) || (year % 400 == 0)))
		this[1]=29;
	else
		this[1]=28;
	this[2]=31;
	this[3]=30;
	this[4]=31;
	this[5]=30;
	this[6]=31;
	this[7]=31;
	this[8]=30;
	this[9]=31;
	this[10]=30;
	this[11]=31;
}
function _Round(number, places) {
	if (places < 1 || places > 8) return(0);
	var factor = Math.pow(10, Math.round(places));
	return(Math.round(number*factor)/factor);
}
function _Format_Gen(object) {
	return(object.Value);
}
function _Format_NG(object) {
	return("" + object.Number);
}
function _Format_N2(object) {
	var string = "" + (Math.round(object.Number*100)/100);
	if (string.indexOf(".") == -1) string += ".00";
	else string += "0";
	if (string.substring(0, 1) == ".")
		string = "0" + string;
	else if (string.substring(0, 2) == "-.")
		string = "-0" + string.substring(1, string.length);
	string = string.substring(0, string.indexOf(".")+3);
	return(string);
}
function _Format_N2S(object) {
	var string = "" + (Math.round(object.Number*100)/100);
	if (string.indexOf(".") == -1) string += ".00";
	else string += "0";
	if (string.substring(0, 1) == ".")
		string = "0" + string;
	else if (string.substring(0, 2) == "-.")
		string = "-0" + string.substring(1, string.length);
	string = string.substring(0, string.indexOf(".")+3);
	var end = string.length - 3;
	var index = ((end-1) % 3) + 1;
	if (string.charAt(0) == "-" && index == 1) index += 3;
	var result = string.substring(0, index);
	while (index < end) {
		result += ",";
		result += string.substring(index, index+3);
		index += 3;
	}
	result += string.substring(end, end+3);
	return(result);
}
function _Format_C2S(object) {
	var result = _Format_N2S(object);
	if (result.charAt(0) == "-") {
		result = "-$" + result.substring(1,result.length);
	}
	else result = "$" + result;
	return(result);
}
function _Format_DS(object) {
	var tempDate = new Date(2000,1,1);
	var offset = 1900;
	if (tempDate.getYear() == 2000) offset = 0;
	tempDate.setTime(object.Number * 86400000);
	var year = tempDate.getYear();
	if (year < 100 || offset == 1900) year += 1900;
	var month = tempDate.getMonth()+1;
	var day = tempDate.getDate();
	year = year % 100;
	if (year <= 9) year = "0" + year;
	return(month + "/" + day + "/" + year);
}
// -->
