function delineate(str, VarName)
{

	theStart = str.indexOf(VarName);
	if (theStart == -1)
	{
		return "N/A";
	}
	else
	{
		 theStart = theStart + VarName.length + 1;
	}
	theEnd = str.indexOf('&', theStart);
	if (theEnd == -1)
	{
		return(str.substring(theStart));
	}
	else
	{
		if (VarName=='E:')
		{
			theStart = theStart - 1; //No equals sign after E: for e-mail
			theEnd = theEnd - 2;     //Remove the final semi colon and square bracket
		}
		return(str.substring(theStart, theEnd));
	}
}

function delineateNewPage(str, VarName)
{
	theStart = str.indexOf(VarName) + VarName.length + 1;
	return(str.substring(theStart));
}

function Hex(num){return(num.toString(16).toUpperCase())}
function Str(num){return(num.toString())}
function PPStr(num){return(num.toString().replace(/\s/g,"+"))}
function fmtCurr(num, showcents, showcomma){
	if (showcomma === undefined)
		showcomma = true;
	if (showcents === undefined)
		showcents = true;		
	num = num.toString().replace(/\$|\,/g,'');
	if(isNaN(num)) 
		num = "0";
	sign = (num == (num = Math.abs(num)));
	num = Math.floor(num*100+0.50000000001);
	cents = num % 100;
	num = Math.floor(num/100).toString();
	if(cents<10) 
		cents = "0" + cents;
	if (showcomma)
	{
		for (var i = 0; i < Math.floor((num.length-(1+i))/3); i++)
		{
			num = num.substring(0,num.length-(4*i+3))+','+num.substring(num.length-(4*i+3));
		}
	}	
	if (showcents)
		number = (((sign)?'':'-') + num + '.' + cents);
	else
		number = (((sign)?'':'-') + num);
	
	return number;
}

function IsValidText(MyText, ValidChars){
var IsValid = true;
	for(i = 0; i < MyText.length; i++) if(ValidChars.indexOf(MyText.charAt(i).toUpperCase()) == -1) IsValid = false;
	return IsValid;
}

function UnsubscribeMe()
{
	emailD='FastPropertyData.com';
	emailU=('CustSvc' + '@' + emailD);
	return '<br><font color=#003399>Click <A title="Unsubscribe" href="mailto:' + emailU + '?subject=FastPropertyData.com: Unsubscribe&amp;body=Please cancel my foreclosure list subscription.">here</a> to unsubscribe.</font>';

//	window.location.href = "https://www.paypal.com/cgi-bin/webscr?cmd=_subscr-find&alias=Sales%40FastPropertyData.com";
}

function ValidEmail(sEmail)
{
	P_at1 = sEmail.indexOf('@')
	P_at2 = sEmail.lastIndexOf('@')
	P_Prd1 = sEmail.indexOf('.',P_at2)
	P_Prd2 = sEmail.lastIndexOf('.')
	P_Spc = sEmail.indexOf(' ')
	if ((P_at1 >= 1) && (P_at1 == P_at2) && (P_Prd1 - P_at1 >= 2) && (P_Prd1 == P_Prd2) && (P_Spc == -1))
	{
	//Added BH 
	/************************************************
	AUTHOR: Karen Gayda (http://www.rgagnon.com/jsdetails/js-0063.html)

	DATE: 03/24/2000
	
	DESCRIPTION: Validates that a string contains a
		valid email pattern.

	PARAMETERS:
		strValue - String to be tested for validity

	RETURNS:
		True if valid, otherwise false.

	REMARKS: Accounts for email with country appended
		does not validate that email contains valid URL
		type (.com, .gov, etc.) or valid country suffix.
  *************************************************/
	
	var objRegExp  = /(^[a-zA-Z0-9_\-\.\+\^!#\$%&*+\/\=\?\`\|\{\}~\']+@([a-zA-Z0-9\-]*[a-zA-Z0-9])([.][a-z]{3})$)|(^[a-zA-Z0-9_\-\.\+\^!#\$%&*+\/\=\?\`\|\{\}~\']+@([a-zA-Z0-9\-]*[a-zA-Z0-9])(\.[a-z]{3})(\.[a-z]{2})*$)/i;
	//check for valid email
	return objRegExp.test(sEmail);
	//End Added BH
//		return 1;
	}
	else
	{
		return 0;
	}		
}

function IsNumeric(sText)
{
	var ValidChars = "0123456789";
	var IsNumber=true;
	var Char;

	for (i = 0; i < sText.length && IsNumber == true; i++) 
	{ 
		Char = sText.charAt(i); 
		if (ValidChars.indexOf(Char) == -1) 
		{
			IsNumber = false;
		}
	}
	return IsNumber;
}
	
function PrintThisPage()
{
/*
This script is written by Eric (Webcrawl@usa.net)
For full source code, installation instructions,
100's more DHTML scripts, and Terms Of
Use, visit dynamicdrive.com
*/

	if (window.print) 
	{
		window.print() ;  
	}
	else
	{
		var WebBrowser = '<OBJECT ID="WebBrowser1" WIDTH=0 HEIGHT=0 CLASSID="CLSID:8856F961-340A-11D0-A96B-00C04FD705A2"></OBJECT>';
	document.body.insertAdjacentHTML('beforeEnd', WebBrowser);
		WebBrowser1.ExecWB(6, 1);//Use a 1 vs. a 2 for a prompting dialog box    
		WebBrowser1.outerHTML = "";  
	}
}

function toggleT(_w,_h) 
{
	// Author: JS-Examples - http://www.js-examples.com
	// Courtesy of SimplytheBest.net - http://simplythebest.net/scripts/
	// _w : which ID (1) or (2)
	// _h : (h)ide or (s)how
	if (document.getElementById)
	{
		obj = document.getElementById(_w);
		if (_h=='s') obj.style.visibility='visible';
		if (_h=='h') obj.style.visibility='hidden';
	}
	else if (document.all) 
	{ // is IE
		if (_h=='s') eval("document.all."+_w+".style.visibility='visible';");
		if (_h=='h') eval("document.all."+_w+".style.visibility='hidden';");
	} 
	else 
	{ // is NS? 
		if (_h=='s') eval("document.layers['"+_w+"'].visibility='show';");
		if (_h=='h') eval("document.layers['"+_w+"'].visibility='hide';");
	}
}

function GetTermsAndConditions()
{
	if (SubLvl == 'LD')
	{
		return '<A target=_blank title="Terms and Conditions" href="TermsAndConditionsLicenseToRedistribute.htm" ><font face="Trebuchet MS" color=#003399>Terms and Conditions<\/FONT><\/A>';
	}
	else if (SubLvl == 'LS')
	{
		return '<A target=_blank title="Terms and Conditions" href="TermsAndConditionsLicenseToResell.htm"><font face="Trebuchet MS" color=#003399>Terms and Conditions<\/FONT><\/A>';
	}
	else
	{
		return '<A target=_blank title="Terms and Conditions" href="TermsAndConditions.htm" ><font face="Trebuchet MS" color=#003399>Terms and Conditions<\/FONT><\/A>';
	}
	return
}

function footer_email()
{
	emailD='FastPropertyData.com'
	emailU=('Webmaster' + '@' + emailD)
	return '<A title="Contact Webmaster" href="mailto:' + emailU + '"><font color=#003399 size=1>' + emailU + '</font></a>';
}
  
function CustomerService_email()
{
	emailD='FastPropertyData.com'
	emailU=('CustSvc' + '@' + emailD)
	return '<A title="Contact Customer Service" href="mailto:' + emailU + '"><font color=#003399 size=1>' + emailU + '</font></a>';
}
  
function ConfirmFreeTrial()
{
	emailD='FastPropertyData.com'
	emailU=('TrialList' + '@' + emailD)

	if (confirm("You will now be taken to your e-mail program to send us an e-mail request.\n\nFeel free to change your e-mail to specify a county (or counties) other than Adams County.  You are welcome to request all 13 counties, but the file can be large (up to 4MB) as it will be sent in Excel format so please make sure your e-mail box has enough space.\n\nYour Free Trial will arrive within one business day and you may need to check your junk mail box for it.  It will be sent from "+emailU+".\n"))
	location =	"mailto:"+emailU+"?subject=Free Trial Foreclosure List Request&body=Please send me a recent foreclosure list for Adams County as a free trial."
}
 
function GetVars(str)
{
	AutoRenew = delineate(str, "auto_renew");
	SubLvl = delineate(str, "sub_lvl");
	SubLen = delineate(str, "p3");
	if (SubLen == "N/A")
		SubLen = delineate(str, "sub_len");
	PreSaleBids = delineate(str, "presale_bids");
	FullData = delineate(str, "full_data");
	ItemNbr = delineate(str, "item_number");
	PrevItemName = delineate(str, "item_name");
	Amount = delineate(str, "a3");
	if (Amount == "N/A")
		Amount = delineate(str, "amount");
	Adv = delineate(str, "adv");
	AddrLbl = delineate(str, "addr_lbl");
	MergeDoc = delineate(str, "mrg_doc");
	FileFormat = delineate(str, "file_fmt");
	PreFilter = delineate(str, "pre_fltr");
	FileFrequency = delineate(str, "file_fqcy")
	EMail = delineate(str, "e_mail")
	if (EMail == "N/A")
		EMail = delineate(str, "E:");
		
	return;
}
 
function ConvBlankToZero(Val)
{
	if (Val.length == 0) 
		return "0";
	else
		return Val;
}

function trimAll(sString)
{
	while (sString.substring(0,1) == ' ')
	{
		sString = sString.substring(1, sString.length);
	}
	while (sString.substring(sString.length-1, sString.length) == ' ')
	{
		sString = sString.substring(0,sString.length-1);
	}
	return sString;
}

/*

 functions specific to ForeclosureLists.htm 

*/
function GetCost()
{
	var numCtys=0;
	//var MtnCtyCount=0;
	var Cost=0.00;
	//var MtnSurcharge=0.00;
	for(i = 0; i <= 13; i++) //13 counties (note--Grand is hidden since it is still used in ClientData)
	{
		if (document.FCList.chkCounty[i].checked)
		{
			numCtys++;
/*
			if ((i==11) || (i==7))
			{
				MtnCtyCount++;
			}
*/
		}
	}
	//alert("numctys=" + numCtys + " mtnctycount=" + MtnCtyCount);
	if (document.FCList.rbtSvcLvlStd.checked)
	{
		switch(numCtys)
		{
		case 0:
			Cost = 0.00;
			PreSaleCost = 0.00;
			break;			
		case 1:
			Cost = 29.00;
			PreSaleCost = 20.00;
			break;
		case 2:
			Cost = 39.00;
			PreSaleCost = 23.00;
			break;
		case 3:
		case 4:
			Cost = 49.00;
			PreSaleCost = 26.00;
			//if (MtnCtyCount > 0)
			//{
			//	MtnSurcharge = 5.0;
			//	Cost = Cost + MtnSurcharge
			//}
			break;
		default:
			BaseCost = 49.00;				
			AddCost = 10.00;
			CostMult = parseInt((numCtys +1) / 3) - 1 //Gives integer only
			Cost = BaseCost + (AddCost * CostMult)
			BasePreSaleCost = 26.00;
			AddPreSaleCost = 3.00;
			PreSaleCost = BasePreSaleCost + (AddPreSaleCost * CostMult)
			//if (MtnCtyCount > 0)
			//{
			//	if (numCtys == 10)
			//	{
			//		MtnSurcharge = 5.0;
			//	}
			//	Cost = Cost + MtnSurcharge
			//}
			break;
		}
	}
	else if (document.FCList.rbtSvcLvlPrm.checked)
	{
		switch(numCtys)
		{
		case 0:
			Cost = 0.00;
			PreSaleCost = 0.00;
			break;			
		case 1:
			Cost = 39.00;
			PreSaleCost = 15.00;
			break;
		case 2:
			Cost = 54.00;
			PreSaleCost = 17.50;
			break;
		case 3:
		case 4:
			Cost = 69.00;
			PreSaleCost = 20.00;
			//if (MtnCtyCount > 0)
			//{
			//	MtnSurcharge = 5.0;
			//	Cost = Cost + MtnSurcharge
			//}
			break;
		default:
			BaseCost = 69.00;				
			AddCost = 14.00;
			CostMult = parseInt((numCtys +1) / 3) - 1 //Gives integer only
			Cost = BaseCost + (AddCost * CostMult)
			BasePreSaleCost = 20.00;
			AddPreSaleCost = 2.50;
			PreSaleCost = BasePreSaleCost + (AddPreSaleCost * CostMult)
			//if (MtnCtyCount > 0)
			//{
			//	if (numCtys == 10)
			//	{
			//		MtnSurcharge = 5.0;
			//	}
			//	Cost = Cost + MtnSurcharge
			//}
			break;
		}
	}
	else if (document.FCList.rbtSvcLvlDB.checked)
	{
		switch(numCtys)
		{
		case 0:
			Cost = 0.00;
			PreSaleCost = 0.00;
			break;			
		case 1:
			Cost = 24.00;
			PreSaleCost = 15.00;
			break;
		case 2:
			Cost = 31.00;
			PreSaleCost = 17.50;
			break;
		case 3:
		case 4:
			Cost = 39.00;
			PreSaleCost = 20.00;
			break;
		default:
			BaseCost = 39.00;				
			AddCost = 8.00;
			CostMult = parseInt((numCtys +1) / 3) - 1 //Gives integer only
			Cost = BaseCost + (AddCost * CostMult)
			BasePreSaleCost = 20.00;
			AddPreSaleCost = 2.50;
			PreSaleCost = BasePreSaleCost + (AddPreSaleCost * CostMult)
			break;
		}
	}
	
	if (document.FCList.chkPreSaleBidList.checked)
		Cost = Cost + PreSaleCost;
		
	return Cost;
}

function FCList_SubmitMe(flag)
{
	var CanSubmit = 1;
	var i = 0;
	var Count = 0;
	var numCtys = 0;
	var selCtys = 0xFFFFFFFF;
	var selInput = 0xFFFFFFFF;
	var selPDC1 = 0xFFFFFFFF;
	var selPDC2 = 0xFFFFFFFF;
	var selMLS = 0xFFFFFFFF;
	var selX = 0xFFFFFFFF;
	var Msg = "";
	var SubLen = 0;
	var strSubLen = "";
	var Cost = 0.0;
	var PartNum = "";
	var ItemName = "";
	var Surcharge = 0.0;
//	var MtnSurcharge = 0.0;
//	var MtnCtyCount = 0;
	var MLS = "N";
	var MLSListorOffice = "Y";
	var Adv = "";
	var FullData = 'N';
	var AutoRenew = 'N';

	//COUNTIES: must select at least one
	selCtys = 0x0;
	for(i = 0; i <= 13; i++) //13 counties (note--Grand is hidden since it is still used in ClientData)
	{
		if (document.FCList.chkCounty[i].checked)
		{
			numCtys++;
			selCtys = selCtys | (0x1 << i);
/*
			if ((i==11) || (i==7))
			{
				MtnCtyCount++;
			}
*/
/* No longer needed as of 5/14/08 as Larimer Data now comes complete.
			if ((i==10))
			{
				//Larimer County -- indicate that we need to ask whether the subscriber wants full data or not
				FullData = 'Y';
			}
*/
		}
	}
	if (numCtys < 1)
	{
		alert("Step 1: You must choose at least ONE county");
		CanSubmit = 0;
	}
/*
	//Don't make the user go into the next price bracket if Summit or Grand County is the only reason it is in the next bracket
	if ((numCtys > 4)&&(numCtys < 12)&&(MtnSurcharge > 0.0))
	{
		numCtys--;
	}
*/

	//SUBSCRIPTION LEVEL: must select at least one
	if (document.FCList.rbtSvcLvlStd.checked)
	{
		//Standard
		sub_lvl= "S";
	}
	else if (document.FCList.rbtSvcLvlPrm.checked)
	{
		//Premium
		sub_lvl= "P"
	}
	else if (document.FCList.rbtSvcLvlDB.checked)
	{
		//Premium
		sub_lvl= "D"
	}
	else
	{
		alert("Step 2: You must select a Subscription Level");
		CanSubmit = 0;
	}

	//SUBSCRIPTION LENGTH: must select at least one
	Count = 0;
	for(i = 0; i < 6; i++)
	{
		if (document.FCList.rbtSubLen[i].checked)
		{
			Count++;
			switch(i)
			{
			case 0:		// 1 month service
				SubLen = 1;
				Surcharge = 10.0;
				if ((flag == 1) || (document.FCList.chkAutoRenew.checked))   //No surcharge on renewals
				{
					Surcharge = 0.0;
				}
				break;
			case 1:		
			case 2:
			case 3:		// 2, 3 or 4 month service
				SubLen = i + 1;
				break;
			case 4:
			case 5:	// 6 or 12 month service
				SubLen = (i - 3) * 6;
				break;
			default:
				break;
			}
		}
	}
	if (Count < 1)
	{
		alert("Step 3: You must choose a Subscription Length!");
		CanSubmit = 0;
	}

	if (CanSubmit)
	{
		Msg = "[C:" + Hex(selCtys) + "SL:" + Hex(SubLen)

		switch(numCtys)
		{
		case 1:
			PartNum = "01";
			ItemName = "1+Cty";
			break;
		case 2:
			PartNum = "02";
			ItemName = "2+Ctys";
			break;
		case 3:
		case 4:
			PartNum = "04";
			ItemName = "3+-+4+Ctys";
			break;
		case 5:
		case 7:
		case 6:
			PartNum = "05";
			ItemName = "5+-+7+Ctys";
			break;
		case 11:
		case 12:
		case 13: //11 - 13 counties
			PartNum = "11";
			ItemName = "11+-+13+Ctys";
			break;
		default:
			PartNum = "10";
			ItemName = "8+-+10+Ctys";
			break;
		}
		
		Cost = GetCost();
		
		switch(SubLen)
		{
//		case 0:
//			PartNum = PartNum + "-SM";
//			strSubLen = "";
//			break;
		case 6:
			PartNum = PartNum + "-6M";
			strSubLen = "6+Month";
			Cost = Cost * 5.5;
			break;
		case 12:
			PartNum = PartNum + "-1Y";
			strSubLen = "12+Month";
			Cost = Cost * 11;
			break;
		default:
			PartNum = PartNum + "-" + Str(SubLen) + "M";
			strSubLen = Str(SubLen) + "+Month";
			Cost = Cost * SubLen + Surcharge;
			break;
		}
			
		PartNum = "FCL-" + PartNum + Msg;
		ItemName = strSubLen + "+FC+List+for+" + ItemName + " (" + sub_lvl;
		
		if (document.FCList.chkPreSaleBidList.checked)
			PreSaleBids = "P";
		else
			PreSaleBids = "N";

		if (document.FCList.chkAutoRenew.checked) 
		{
			AutoRenew = 'Y';
		}
		if (flag==2) 
		{
			//Customize
			Msg = "ForeclosureListsInfo.htm?sub_len=" + SubLen + "&sub_lvl=" + sub_lvl + "&presale_bids=" + PreSaleBids + "&full_data=" + FullData + "&item_name=" + ItemName + "&item_number=" + PartNum + "&amount=" + fmtCurr(Cost, true, false) + "&auto_renew=" + AutoRenew;
			window.location.href = Msg			
		}
		else
		{
			//Renew
			document.FCList.subject.value = "Subscription Info";
			document.FCList.Item_Name.value = ItemName + ") (Renew)";
			document.FCList.Part_Num.value = PartNum + "]";
			document.FCList.Cost.value = fmtCurr(Cost);
			document.FCList.Option_1.value = "A:";
			document.FCList.Option_2.value = "XF:" + PreSaleBids;
			if (AutoRenew == 'Y')
				Msg = "Y&item_name=" + ItemName + ")(Renew)&item_number=" + PartNum  + "]&no_shipping=1&no_note=1&currency_code=USD&a3=" + fmtCurr(Cost, true, false) + "&on0=(Renew)&p3=" + SubLen + "&t3=M&src=1&sra=1";
			else
				Msg = AutoRenew+"&item_name=" + ItemName + ")(Renew)&item_number=" + PartNum + "]&amount=" + fmtCurr(Cost, true, false) + "&no_note=1&currency_code=USD&on0=(Renew)";

			document.FCList.redirect.value = "https://www.fastpropertydata.com/PaymentMethod.htm?np="+Msg;
			emailD='FastPropertyData.com'
			document.FCList.recipient.value = 'sales' + '@' + emailD;
			document.FCList.email.value = 'sales' + '@' + emailD;

			if (confirm("Although every reasonable effort has been made to ensure the accuracy of the information provided, FastPropertyData.com cannot be held responsible for any consequences resulting from any omissions or errors contained herein. FastPropertyData.com assumes no liability whatsoever associated with the use or misuse of this data. Your purchase of foreclosure data or services from FastPropertyData.com constitutes acceptance of this policy. Accept?")) 
			{
				document.FCList.submit();
			}
		}
	}
}

  
/*

 functions specific to ForeclosureListsInfo.htm 

*/
function FCListInfo_GetVar(str)
{
	SubLen = delineate(str, "sub_len");
	AutoRenew = delineate(str, "auto_renew");
	SubLvl = delineate(str, "sub_lvl");
	PreSaleBids = delineate(str, "presale_bids");
	FullData = delineate(str, "full_data");
	ItemNbr = delineate(str, "item_number");
	PrevItemName = delineate(str, "item_name");
	Amount = delineate(str, "amount");
	return;
}

function FCListInfo_AddlEmails()
{
	var output = "";
	if (SubLvl=='P')
	{
            output = "<p style=\"MARGIN-TOP: 0px; MARGIN-BOTTOM: 0px\">You may wish to have your Foreclosure Lists sent to additional e-mail addresses*.&nbsp;&nbsp;Enter up to 3 additional addresses below:<\/p>";
            output = output + "<p style=\"MARGIN-TOP: 0px; MARGIN-BOTTOM: 0px\">&nbsp;<\/p>";
            output = output + "<p style=\"MARGIN-TOP: 0px; MARGIN-BOTTOM: 0px\">Enter&nbsp;first&nbsp;additional&nbsp;E-mail Address:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <input id=EmailAddl1 type=text size=40><br><\/p>";	
            output = output + "<p style=\"MARGIN-TOP: 0px; MARGIN-BOTTOM: 0px\">Enter&nbsp;second&nbsp;additional&nbsp;E-mail Address:&nbsp;&nbsp;&nbsp; <input id=EmailAddl2 type=text size=40><br><\/p>";	
            output = output + "<p style=\"MARGIN-TOP: 0px; MARGIN-BOTTOM: 0px\">Enter&nbsp;third&nbsp;additional&nbsp;E-mail Address:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <input id=EmailAddl3 type=text size=40><br><\/p>";	
	}
	else if (SubLvl!='D')
	{
            output = "<p style=\"MARGIN-TOP: 0px; MARGIN-BOTTOM: 0px\">You may wish to have your Foreclosure Lists sent to an additional e-mail address*.&nbsp;&nbsp;Enter it below:<\/p>";
            output = output + "<p style=\"MARGIN-TOP: 0px; MARGIN-BOTTOM: 0px\">&nbsp;<\/p>";
            output = output + "<p style=\"MARGIN-TOP: 0px; MARGIN-BOTTOM: 0px\">Enter&nbsp;an&nbsp;additional&nbsp;E-mail Address:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <input id=EmailAddl1 type=text size=40><br><\/p>";
	}

	if (SubLvl!='D')
	{
			output = output + '<p style="MARGIN-TOP: 0px; MARGIN-BOTTOM: 0px"><font color=#003399>*Our Foreclosure List Subscriptions are for one individual or entity (see our ' + GetTermsAndConditions() + ').&nbsp; Therefore, the additional address must be for the same individual or entity.&nbsp;</font></p>';
	}
	
	return output;
}

function FCListInfo_FullData()
{
	var output = "";
	if (FullData=='Y')
	{
		output = "<p style=\"MARGIN-TOP: 0px; MARGIN-BOTTOM: 0px\"><font size=1><\/font>&nbsp;<\/p>";
		output = output + "<p style=\"MARGIN-TOP: 0px; MARGIN-BOTTOM: 0px\"><font color=#ff9933 size=2><IMG alt=\"Larimer County Data Clarification\" src=\"images/AccountStep3a.gif\" align=left border=0 ><\/font><\/p>";
		output = output + "<p style=\"MARGIN-TOP: 35px; MARGIN-BOTTOM: 0px\"><font size=1>Larimer County data is missing deed of trust and attorney data when it is first compiled.&nbsp; This information is available approximately two weeks later.<\/p>";
		output = output + "<p style=\"MARGIN-TOP: 0px; MARGIN-BOTTOM: 0px\"><input id=chkFullData type=checkbox value=ON name=chkFullData> Check here if you want to wait to receive Larimer County data until the complete info is available.<\/p><\/font>";		
	}
	return output;
}

function FCListInfo_GoToDesc()
{
	var output = "";
	if (SubLvl=='D')
	{
		output = output + "go to the payment page";
	}
	else
	{
		output = output + "use default ";
		if (SubLvl=='P')
		{
			output = output + "preferences and ";
		}
		output = output + "data fields to create your account<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Click <strong><font color=#003399>[Customize]</font></strong> to define your ";
		if (SubLvl=='P')
		{
			output = output + "preferences, features and ";
		}
		if ((SubLvl=="LD") || (SubLvl=="LS"))
		{
			output = output + "preferences and ";
		}
		if (SubLvl=='S')
		{
			output = output + "features and ";
		}
		output = output + "data fields for your account</font>";
	}
	return output;
}

function FCListInfo_SubmitMe(flag)
{
	var CanSubmit = 1;
	var i = 0;
	var Count = 0;
	var Msg = "";
	var PartNum2 = "";
	var Adv = "";
	var e_mail = "";	
	var PromoCode = "";
	var bNoPmt = false;

	//Validate e-mail address
	if (document.FCListInfo.Email1.value == document.FCListInfo.Email2.value)
	{
		Email = document.FCListInfo.Email1.value;
		if (ValidEmail(Email) == 1)
		{
			e_mail = Email + ";"
		}
		else
		{
			alert("Step 4: The e-mail address " + Email + " is not valid.  Please correct it");
			CanSubmit = 0;
		}		
	}
	else
	{
		alert("Step 4: The e-mail addresses don't match.  Please correct your e-mail address");
		CanSubmit = 0;
	}
	
	if (SubLvl != 'D')
	{
		Email = document.FCListInfo.EmailAddl1.value;
		if (Email.length > 0)
		{
			if (ValidEmail(Email) == 1)
			{
				e_mail = e_mail + Email + ";"
			}
			else
			{
				alert("Step 4: The e-mail address " + Email + "is not valid.  Please correct it");
				CanSubmit = 0;
			}		
		}
	}
	
	if (SubLvl == 'P')
	{
		Email = document.FCListInfo.EmailAddl2.value;
		if (Email.length > 0)
		{
			if (ValidEmail(Email) == 1)
			{
				e_mail = e_mail + Email + ";"
			}
			else
			{
				alert("Step 4: The e-mail address " + Email + " is not valid.  Please correct it");
				CanSubmit = 0;
			}		
		}
		Email = document.FCListInfo.EmailAddl3.value;
		if (Email.length > 0)
		{
			if (ValidEmail(Email) == 1)
			{
				e_mail = e_mail + Email + ";"
			}
			else
			{
				alert("Step 4: The e-mail address " + Email + " is not valid.  Please correct it");
				CanSubmit = 0;
			}		
		}
	}

	
	//Advertising: Info only
	for(i=0; i < 6; i++)
	{
		//if (document.FCListInfo.chkAdv[i].checked)
		if (document.FCListInfo.txtAdv[i].value != "")
		{
			document.FCListInfo.chkAdv[i].checked = true;
			Adv = Adv + i + document.FCListInfo.txtAdv[i].value + ";"
		}
	}
	
	//Promotion Code
	PromoCode = document.FCListInfo.txtPromoCode.value.toUpperCase();
	
	if (PromoCode != "")
	{
		var NumPromos = 16;
		var Promos = new Array(NumPromos);
		var bPromoFound = false;
		var bPromoValid = true;
		var ErrorMsg = "";
		for (i=0; i<NumPromos; i++)
		{
			Promos[i] = new Array(7); //0: Promo Code 1: Percent Off 2: $ off 3: Month Duration; 4: Expiration Date (mm/dd/yyyy format) 5: Description; 6: Subscription type (S=Standard P=Premium D=Database)
		}
		Promos[0][0] = "ATTIC";
		Promos[0][1] = "100";
		Promos[0][2] = "";
		Promos[0][3] = "1";
		Promos[0][4] = "";
		Promos[0][5] = "Free 1-month Premium-level subscription (new subscriptions only)";
		Promos[0][6] = "P";
		
		Promos[1][0] = "KUDZU2008";
		Promos[1][1] = "20";
		Promos[1][2] = "";
		Promos[1][3] = "3";
		Promos[1][4] = "12/31/2008";
		Promos[1][5] = "20% off a 3-month Premium Foreclosure List Subscription (not valid for current subscribers)";
		Promos[1][6] = "P";
/*
		Promos[2][0] = "ABB08";
		Promos[2][1] = "100";
		Promos[2][2] = "";
		Promos[2][3] = "3";
		Promos[2][4] = "12/31/2009";
		Promos[2][5] = "Free 3-month Premium Foreclosure List Subscription from the Arapahoe Band Boosters Silent Auction (not valid for current subscribers)";
		Promos[2][6] = "P";
*/		
		Promos[2][0] = "1313";
		Promos[2][1] = "10";
		Promos[2][2] = "";
		Promos[2][3] = "3";
		Promos[2][4] = "";
		Promos[2][5] = "10% off a 3-month Foreclosure List Subscription courtesy of Dave Heiliger (not valid for current subscribers)";
		Promos[2][6] = "";
		
		Promos[3][0] = "DANO";
		Promos[3][1] = "10";
		Promos[3][2] = "";
		Promos[3][3] = "1";
		Promos[3][4] = "";
		Promos[3][5] = "10% off a 1-month Foreclosure List Subscription courtesy of Dano Keys (not valid for current subscribers)";
		Promos[3][6] = "";
		
		Promos[4][0] = "FRANKLIN09";
		Promos[4][1] = "100";
		Promos[4][2] = "";
		Promos[4][3] = "3";
		Promos[4][4] = "12/31/2009";
		Promos[4][5] = "Free 3-month Premium Foreclosure List Subscription from the Franklin Elementary Silent Auction (not valid for current subscribers)";
		Promos[4][6] = "P";
		
		Promos[5][0] = "YVC09";
		Promos[5][1] = "100";
		Promos[5][2] = "";
		Promos[5][3] = "3";
		Promos[5][4] = "12/31/2009";
		Promos[5][5] = "Free 3-month Premium Foreclosure List Subscription from the Young Voices of Colorado Silent Auction (not valid for current subscribers)";
		Promos[5][6] = "P";
		
		Promos[6][0] = "CAREI-0902";
		Promos[6][1] = "10";
		Promos[6][2] = "";
		Promos[6][3] = "3";
		Promos[6][4] = "3/31/2009";
		Promos[6][5] = "10% off a 3-month Foreclosure List Subscription for CAREI members (not valid for current subscribers)";
		Promos[6][6] = "";
		
		Promos[7][0] = "CAREI-0903";
		Promos[7][1] = "10";
		Promos[7][2] = "";
		Promos[7][3] = "3";
		Promos[7][4] = "5/31/2009";
		Promos[7][5] = "10% off a 3-month Foreclosure List Subscription for CAREI members (not valid for current subscribers)";
		Promos[7][6] = "";
		
		Promos[8][0] = "HOTHEM";
		Promos[8][1] = "20";
		Promos[8][2] = "";
		Promos[8][3] = "3";
		Promos[8][4] = "";
		Promos[8][5] = "20% off a 3-month subscription courtesy of Bob Hothem (not valid for current subscribers)";
		Promos[8][6] = "";
		
		Promos[9][0] = "SWIM2009";
		Promos[9][1] = "10";
		Promos[9][2] = "";
		Promos[9][3] = "";
		Promos[9][4] = "";
		Promos[9][5] = "10% off the initial subscription payment for high school swimmers and supporters (not valid for current subscribers)";
		Promos[9][6] = "";
		
		Promos[10][0] = "BC200906";
		Promos[10][1] = "50";
		Promos[10][2] = "";
		Promos[10][3] = "3";
		Promos[10][4] = "6/30/2009";
		Promos[10][5] = "50% off a 3-month Foreclosure List Subscription for attendees of the Foreclosure Short Sale Boot Camp (not valid for current subscribers)";
		Promos[10][6] = "";
		
		Promos[11][0] = "LEBOVIC";
		Promos[11][1] = "15";
		Promos[11][2] = "";
		Promos[11][3] = "3";
		Promos[11][4] = "";
		Promos[11][5] = "15% off a 3-month Foreclosure List Subscription courtesy of Aaron Lebovic (not valid for current subscribers)";
		Promos[11][6] = "";

		Promos[12][0] = "JGIENGER";
		Promos[12][1] = "20";
		Promos[12][2] = "";
		Promos[12][3] = "";
		Promos[12][4] = "";
		Promos[12][5] = "20% off a Foreclosure List Subscription courtesy of Jake Gienger (not valid for current subscribers)";
		Promos[12][6] = "";

		Promos[13][0] = "KWSOUTHLANDS";
		Promos[13][1] = "20";
		Promos[13][2] = "";
		Promos[13][3] = "";
		Promos[13][4] = "";
		Promos[13][5] = "20% off a Foreclosure List Subscription for KW Southlands (not valid for current subscribers)";
		Promos[13][6] = "";

		Promos[14][0] = "FALL09FPD";
		Promos[14][1] = "15";
		Promos[14][2] = "";
		Promos[14][3] = "";
		Promos[14][4] = "11/30/2009";
		Promos[14][5] = "15% off a Foreclosure List Subscription (not valid for current subscribers)";
		Promos[14][6] = "";

		Promos[15][0] = "DEMETRI";
		Promos[15][1] = "10";
		Promos[15][2] = "";
		Promos[15][3] = "3";
		Promos[15][4] = "";
		Promos[15][5] = "10% off a 3-month Foreclosure List Subscription courtesy of Demetri Fefes (not valid for current subscribers)";
		Promos[15][6] = "";

		//Now check PromoCode against valid promotions
		for (i=0; i<NumPromos; i++)
		{
			alert
			if (PromoCode == Promos[i][0])
			{				
				bPromoFound = true;
				if (Promos[i][4] != "")
				{
					//Check expiration date
					var today = new Date;
					expire = new Date(Promos[i][4].substring(6,10), Promos[i][4].substring(0,2) - 1, Promos[i][4].substring(3,5), 23, 59, 59);
					//alert('today: ' + today + '\n' + 'expire: ' + expire + ' year: ' + Promos[i][4].substring(6,10) + ' month: ' + Promos[i][4].substring(0,2) + ' day: ' + Promos[i][4].substring(3,5))
					if (today > expire)
					{
						alert("The promotion code you entered has expired and is no longer valid.");
						bPromoValid = false;
						CanSubmit = 0;
					}
				}
					
				//Check subscription level
				if (bPromoValid)
				{
					if ((Promos[i][6] != "") && (Promos[i][6] != SubLvl))
					{
						SubName = new Array(3);
						SubName[0] = 'Standard-level';
						SubName[1] = 'Premium-level';
						SubName[2] = 'Database Only';
						
						for (j=0; j<3; j++)
						{
							if (Promos[i][6] == SubName[j].substring(0,1))
								Promos[i][6] = SubName[j];
							if (SubLvl == SubName[j].substring(0,1))
								SubNameString = SubName[j];
						}
						ErrorMsg = "The promotion code you entered is for a " + Promos[i][6] + " subscription but you have selected a " + SubNameString + " subscription on the previous page.  Please use your browser's back button and correct your subscription level if you want to use this promotion code";
					}
				
					//Check subscription length
					if ((Promos[i][3] != "") && (Promos[i][3] != SubLen))
					{
						if (ErrorMsg)
							ErrorMsg = ErrorMsg + '\n\n';
						ErrorMsg = ErrorMsg + "The promotion code you entered is for a " + Promos[i][3] + "-month subscription but you have selected a " + SubLen + "-month subscription on the previous page.  Please use your browser's back button and correct your subscription length if you want to use this promotion code";
					}
					if ((Promos[i][3] == "") && (SubLen >= 6))
					{
						if (ErrorMsg)
							ErrorMsg = ErrorMsg + '\n\n';
						ErrorMsg = ErrorMsg + "Promotion codes can only be used on subscriptions that are less than 6 months long. You have selected a " + SubLen + "-month subscription on the previous page.  Please use your browser's back button and correct your subscription length if you want to use this promotion code";
					}					
					if (ErrorMsg)
					{
						bPromoValid = false;
						alert(ErrorMsg);
						CanSubmit = 0;
					}
				}
				
				if (bPromoValid)
				{
					//Set new amount
					//Is this a percent off or $ off?
					if (Promos[i][1] != "")
					{
						//Percent off
						if (Promos[i][1] > 1)
							Promos[i][1] = Promos[i][1] / 100
						pct = 1 - Promos[i][1];
						Amount = fmtCurr(Amount * pct);
					}
					else
					{
						Amount = Amount - Promos[i][2];
					}
					AutoRenew = "P"; //Can't do auto-renew with promotions (on PayPal only) so set to "P" for Promo and the paymentmethod.htm page will sort it out.
					alert("This promotion code entitles you to the following:\n\n" + Promos[i][5]);
					Adv = Adv + 'Promo-' + PromoCode; //+ "(" + Promos[i][5] + ");"
				}
				i = NumPromos;
			}
		}
		if (!bPromoFound)
		{
			CanSubmit = 0;
			alert("The promotion code you entered (" + PromoCode + ") is not valid.");
			document.FCListInfo.txtPromoCode.value = "";
		}
	}
	

	if (CanSubmit)
	{
		//Modify the item name if amount or auto_renew changed due to promo code
		NewItemList = document.FCListInfo.ItemList.value.substring(0, document.FCListInfo.ItemList.value.indexOf("&amount")) + "&amount=" + Amount + "&auto_renew=" + AutoRenew;
		document.FCListInfo.ItemList.value = NewItemList;
		
		if ((FullData=='Y') && (document.FCListInfo.chkFullData.checked))
		{
			FullData = 'Y';
		}
		else
		{
			FullData = 'N';
		}
					
		switch(flag)
		{
		case 0:
			//New Subscriber
//			PartNum2 = "I:DFLTP1:DFLTP2:DFLTML:DFLTX:DFLTD:DFLT" + "A:" + Adv + "E:" + e_mail + "L:" + SubLvl + "]";
			PartNum2 = "I:DFLTP1:DFLTP2:DFLTML:DFLTX:DFLTD:DFLTD2:DFLT" + "E:" + e_mail + "]";
			ItemName = PrevItemName + ")";
			break;
		case 1:
			//Renewing existing/former subscriber
//			PartNum2 =  "A:" + Adv + "]";
			PartNum2 =  "E:" + e_mail + "]";
			ItemName = PrevItemName + ")(Renew)";
			break;
		case 2:
			//Customize
			if (SubLvl=='S')
			{
				//Skip preferences and send preference string to Features
				Msg = "ForeclosureListsFeatures.htm?file_fqcy=W&file_fmt=C&pre_fltr=PF:SNF;NOONF;MLSNF;BD0!0;BT0!0;DOT0!0;LTV0!0;TV0!0;PT1;Z;XZ;&sub_len=" + SubLen + "&adv=" + Adv + "&presale_bids=" + PreSaleBids + "&full_data="+FullData+"&e_mail=" + e_mail + "&sub_lvl=" + SubLvl + "&item_name=" + PrevItemName + "&item_number=" + ItemNbr + "&amount=" + Amount + "&auto_renew=" + AutoRenew;
			}
			else
			{
				Msg = "ForeclosureListsPreferences.htm?sub_len=" + SubLen + "&adv=" + Adv + "&presale_bids=" + PreSaleBids + "&full_data="+FullData+"&e_mail=" + e_mail + "&sub_lvl=" + SubLvl + "&item_name=" + PrevItemName + "&item_number=" + ItemNbr + "&amount=" + Amount + "&auto_renew=" + AutoRenew;
			}
			window.location.href = Msg
			break;
		}
		
		if (flag != 2)
		{		
			document.FCListInfo.Item_Name.value = ItemName;
			document.FCListInfo.Part_Num.value = ItemNbr + PartNum2;
			document.FCListInfo.Cost.value = Amount;
			document.FCListInfo.Option_1.value = "A:"+Adv;
			if (SubLvl=='P')
			{
				//Make Excel format and Multiple Files/wk the default for Premium
				document.FCListInfo.Option_2.value = "XF:"+PreSaleBids+FullData+"EM";
			}
			else
			{
				document.FCListInfo.Option_2.value = "XF:"+PreSaleBids+FullData;
			}
			if (AutoRenew == 'Y')
				Msg = "Y&item_name=" + ItemName + "&item_number=" + ItemNbr + PartNum2 + "&no_shipping=1&no_note=1&currency_code=USD&a3=" + Amount + "&on0=A:"+Adv+"&on1=XF:"+PreSaleBids+FullData+"&p3=" + SubLen + "&t3=M&src=1&sra=1";
			else
				Msg = AutoRenew+"&item_name=" + ItemName + "&item_number=" + ItemNbr + PartNum2 + "&amount=" + Amount + "&no_note=1&currency_code=USD&on0=A:"+Adv+"&on1=XF:"+PreSaleBids+FullData;

			emailD='FastPropertyData.com';
			document.FCListInfo.redirect.value = "https://www.fastpropertydata.com/PaymentMethod.htm?np="+Msg;
			document.FCListInfo.recipient.value = 'sales' + '@' + emailD;
			document.FCListInfo.email.value = document.FCListInfo.Email1.value;

			if (confirm("Although every reasonable effort has been made to ensure the accuracy of the information provided, FastPropertyData.com cannot be held responsible for any consequences resulting from any omissions or errors contained herein. FastPropertyData.com assumes no liability whatsoever associated with the use or misuse of this data. Your purchase of foreclosure data or services from FastPropertyData.com constitutes acceptance of this policy. Accept?")) 
			{
				document.FCListInfo.submit();
			}
			
		}
	}
}

/*

Functions for AdditionalServices.htm

*/
function AddlSvcs_SubmitMe(RptType)
{
	var CanSubmit = 1;
	var Count = 0;
	var Msg = "";
	var Cost = 0.0;
	var PartNum = "";
	var ItemName = "";
	var i = 0;
	var ListingTypes = "";
	var NumListingTypes = 0;
	var PropTypes = "";
	var NumPropTypes = 0;
	var MLSAreas = "";
	var NumMLSAreas = 0;
	var SubLen = 0;

	//SERVICES: must select at least one
	if (RptType=='TSOAE')
	{
//		if (document.AdditionalSvcs.chkTBD.checked)
//		{
//			Cost = Cost + 29.95;
//			PartNum = PartNum + "LSTTBD-1";
//			ItemName = ItemName + "TBD";
//			Count++;
//		}
//		if (document.AdditionalSvcs.chkOAE.checked)
//		{
			Cost = Cost + 6.95;
			PartNum = PartNum + "LSTOAE-1";
			ItemName = ItemName + "OAE";
			Count++;
//		}
	}

	if (RptType == 'FSBO')
	{
		PartNum = PartNum + "FSBO";
		Cost = 299.00;
		Count++;
	}
	
	if (RptType=='EXP')
	{
		PartNum = PartNum + "EXP-1";
		ItemName = ItemName + "EXP";

		//Get subscription length
		if (document.AdditionalSvcs.txtEXPSubLen.value >= 1)
		{
			SubLen = document.AdditionalSvcs.txtEXPSubLen.value;
		}
		else
		{
			alert("Subscription length must be at least one month");
			CanSubmit = 0;
		}

		//Get Listing Types from checkboxes
		for(i = 0; i < 4; i++)
		{
			if (document.AdditionalSvcs.chkLstingType[i].checked)
			{
				NumListingTypes++;
				switch(i)
				{
					case 0: ListingTypes = ListingTypes + "EXP"; break;
					case 1: ListingTypes = ListingTypes + " W/D"; break;
					case 2: ListingTypes = ListingTypes + " P/C"; break;
					case 3: ListingTypes = ListingTypes + " NEW"; break;
				}
			}
		}
		if (NumListingTypes == 0)
		{
			alert("Must select at least one MLS listing type to be included in your report");
			CanSubmit = 0;
		}
		
		//Get Property Types from checkboxes
		for(i = 0; i < 5; i++)
		{
			if (document.AdditionalSvcs.chkPropType[i].checked)
			{
				NumPropTypes++;
				switch(i)
				{
					case 0: PropTypes = PropTypes + "RES"; break;
					case 1: PropTypes = PropTypes + " CND"; break;
					case 2: PropTypes = PropTypes + " INC"; break;
					case 3: PropTypes = PropTypes + " RNT"; break;
					case 4: PropTypes = PropTypes + " LND"; break;
				}
			}
		}
		if (NumPropTypes == 0)
		{
			alert("Must select at least one property type to be included in your report");
			CanSubmit = 0;
		}

		if (document.AdditionalSvcs.txtMLSAreas.value.length == 0)
		{
			//Get MLS Areas from checkboxes
			for(i = 0; i < 45; i++)
			{
				if (document.AdditionalSvcs.chkMLSArea[i].checked)
				{
					NumMLSAreas++;
					switch(i)
					{
						case 0: MLSAreas = MLSAreas + " AUN"; break;
						case 1: MLSAreas = MLSAreas + " AUS"; break;
						case 2: MLSAreas = MLSAreas + " BFL"; break;
						case 3: MLSAreas = MLSAreas + " BOM"; break;
						case 4: MLSAreas = MLSAreas + " BOP"; break;
						case 5: MLSAreas = MLSAreas + " BOU"; break;
						case 6: MLSAreas = MLSAreas + " BRM"; break;
						case 7: MLSAreas = MLSAreas + " CSP"; break;
						case 8: MLSAreas = MLSAreas + " DCW"; break;
						case 9: MLSAreas = MLSAreas + " DEP"; break;
						case 10: MLSAreas = MLSAreas + " DHL"; break;
						case 11: MLSAreas = MLSAreas + " DNE"; break;
						case 12: MLSAreas = MLSAreas + " DNW"; break;
						case 13: MLSAreas = MLSAreas + " DSE"; break;
						case 14: MLSAreas = MLSAreas + " DSW"; break;
						case 15: MLSAreas = MLSAreas + " ESN"; break;
						case 16: MLSAreas = MLSAreas + " ESS"; break;
						case 17: MLSAreas = MLSAreas + " JFC"; break;
						case 18: MLSAreas = MLSAreas + " JFN"; break;
						case 19: MLSAreas = MLSAreas + " JFS"; break;
						case 20: MLSAreas = MLSAreas + " JFW"; break;
						case 21: MLSAreas = MLSAreas + " JNC"; break;
						case 22: MLSAreas = MLSAreas + " JSC"; break;
						case 23: MLSAreas = MLSAreas + " LAF"; break;
						case 24: MLSAreas = MLSAreas + " LBE"; break;
						case 25: MLSAreas = MLSAreas + " LNG"; break;
						case 26: MLSAreas = MLSAreas + " LSV"; break;
						case 27: MLSAreas = MLSAreas + " MCC"; break;
						case 28: MLSAreas = MLSAreas + " MCP"; break;
						case 29: MLSAreas = MLSAreas + " MEN"; break;
						case 30: MLSAreas = MLSAreas + " MES"; break;
						case 31: MLSAreas = MLSAreas + " MGC"; break;
						case 32: MLSAreas = MLSAreas + " MJC"; break;
						case 33: MLSAreas = MLSAreas + " MJN"; break;
						case 34: MLSAreas = MLSAreas + " MJS"; break;
						case 35: MLSAreas = MLSAreas + " MPC"; break;
						case 36: MLSAreas = MLSAreas + " MPE"; break;
						case 37: MLSAreas = MLSAreas + " NNE"; break;
						case 38: MLSAreas = MLSAreas + " NNW"; break;
						case 39: MLSAreas = MLSAreas + " NSC"; break;
						case 40: MLSAreas = MLSAreas + " NSE"; break;
						case 41: MLSAreas = MLSAreas + " NSW"; break;
						case 42: MLSAreas = MLSAreas + " SSC"; break;
						case 43: MLSAreas = MLSAreas + " SSE"; break;
						case 44: MLSAreas = MLSAreas + " SUP"; break;
						default: alert("Error in the code, please contact the Webmaster"); break;
					}
				}
			}	
		}
		else
		{
			if(!IsValidText(document.AdditionalSvcs.txtMLSAreas.value, " ABCDEFGHIJKLMNOPQRSTUVWXYZ"))
			{
				alert("MLS Areas: ONLY letters allowed!");
				CanSubmit = 0;
			}
			MLSAreas = document.AdditionalSvcs.txtMLSAreas.value;
			NumMLSAreas = Math.round(document.AdditionalSvcs.txtMLSAreas.value.length / 4);
		}

		//Calculate Costs based on # of MLS Areas selected
		if (NumMLSAreas <= 6)
		{
			Cost = Cost + ((10.00 * NumMLSAreas) * SubLen);

		}
		else if (NumMLSAreas <= 10) 
		{
			Cost = Cost + (69.00 * SubLen);
		}
		else if (NumMLSAreas <= 15)
		{
			Cost = Cost + (79.00 * SubLen);
		}
		else
		{
			Cost = Cost + (89.00 * SubLen);
		}

		Count++;
	}
	if (RptType=='NOO')
	{
		Cost = Cost + 19.95;
		if(document.AdditionalSvcs.rbtNOO[0].checked)
		{
			PartNum = PartNum + "NOO-NC";
			ItemName = ItemName + "NOONC";

		}
		else if (document.AdditionalSvcs.rbtNOO[1].checked)
		{
			PartNum = PartNum + "NOO-CO";
			ItemName = ItemName + "NOOCO";
		}
		else 
		{
			alert("Must choose Non-Commercial or Commercial");
			CanSubmit = 0;
		}
		Count++;
	}
	if (Count < 1)
	{
		alert("Must choose at least ONE service!");
		CanSubmit = 0;
	}
	else
	{
		Msg = "[";

		if (RptType=='TSOAE')
		{
			if (document.AdditionalSvcs.txtOwnerName.value.length < 4)
			{
				alert("Must enter Owner Name (at least 4 characters).");
				CanSubmit = 0;
			}
			else if (!IsValidText(document.AdditionalSvcs.txtOwnerName.value, " ABCDEFGHIJKLMNOPQRSTUVWXYZ"))
			{
				alert("Owner Name: ONLY letters and spaces are allowed.");
				CanSubmit = 0;
			}
			else
				Msg = Msg + "ON:" + PPStr(document.AdditionalSvcs.txtOwnerName.value);

			//Property Address
			if (document.AdditionalSvcs.txtPropAddr.value.length < 4)
			{
				alert("Must enter Property Address (at least 4 characters).");
				CanSubmit = 0;
			}
			else if(!IsValidText(document.AdditionalSvcs.txtPropAddr.value, " 0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ,"))
			{
				alert("Property Address: ONLY numbers, letters, commas and spaces are allowed.");
				CanSubmit = 0;
			}
			else
				Msg = Msg + "+PA:" + document.AdditionalSvcs.txtPropAddr.value;

			//Property City State Zip
			if (document.AdditionalSvcs.txtPropCSZ.value.length < 4)
			{
				alert("Must enter Property City, State Zip (at least 4 characters).");
				CanSubmit = 0;
			}
			else if(!IsValidText(document.AdditionalSvcs.txtPropCSZ.value, " 0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ,"))
			{
				alert("Property City, State Zip: ONLY numbers, letters, commas and spaces are allowed.");
				CanSubmit = 0;
			}
			else
				Msg = Msg + " " + document.AdditionalSvcs.txtPropCSZ.value;

			//Property County
			if (document.AdditionalSvcs.txtCounty.value.length < 2)
			{
				alert("Must enter County (at least 2 characters).");
				CanSubmit = 0;
			}
			else if(!IsValidText(document.AdditionalSvcs.txtCounty.value, " ABCDEFGHIJKLMNOPQRSTUVWXYZ"))
			{
				alert("County: ONLY letters and spaces are allowed.");
				CanSubmit = 0;
			}
			else
				Msg = Msg + "+C:" + PPStr(document.AdditionalSvcs.txtCounty.value);
			
			if (!ValidEmail(document.AdditionalSvcs.txtOEemail.value))
			{
				alert("EMail: Email address is not valid.  Please enter a valid e-mail address.");
				CanSubmit = 0;
			}
			else
			{
				Msg = Msg + "+E:" + document.AdditionalSvcs.txtOEemail.value + ";";
			}
		}

		if (RptType=='EXP')
		{
			if (NumMLSAreas == 0)
			{
				alert("Must enter at least one MLS area!");
				CanSubmit = 0;
			}
			else
				Msg = Msg + "+Sub:" + SubLen + "+LT:" + PPStr(ListingTypes) + "+PT:" + PPStr(PropTypes) + "+MA:" + MLSAreas;
			if (!ValidEmail(document.AdditionalSvcs.ExWdemail.value))
			{
				alert("EMail: Email address is not valid.  Please enter a valid e-mail address.");
				CanSubmit = 0;
			}
			else
			{
				Msg = Msg + "+E:" + document.AdditionalSvcs.ExWdemail.value + ";";
			}
		}

		if (RptType=='NOO')
		{
			if (document.AdditionalSvcs.txtZipCode.value.length != 5)
			{
				alert("Must enter 5-digit Zip Code!");
				CanSubmit = 0;
			}
			else if(!IsValidText(document.AdditionalSvcs.txtZipCode.value, "0123456789"))
			{
				alert("Zip Code: must enter numbers only!");
				CanSubmit = 0;
			}
			else
				Msg = Msg + "+ZC:" + PPStr(document.AdditionalSvcs.txtZipCode.value);
		}

		if (RptType=='FSBO')
		{
			//Owner Name
			if (document.AdditionalSvcs.OwnerName.value.length < 4)
			{
				alert("Must enter Your Name (at least 4 characters).");
				CanSubmit = 0;
			}
			else if (!IsValidText(document.AdditionalSvcs.OwnerName.value, " ABCDEFGHIJKLMNOPQRSTUVWXYZ"))
			{
				alert("Your Name: ONLY letters and spaces are allowed.");
				CanSubmit = 0;
			}
			else
				Msg = Msg + "Name: " + document.AdditionalSvcs.OwnerName.value;

			//Property Address
			if (document.AdditionalSvcs.PropAddr.value.length < 4)
			{
				alert("Must enter Property Address (at least 4 characters).");
				CanSubmit = 0;
			}
			else if(!IsValidText(document.AdditionalSvcs.PropAddr.value, " 0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ,"))
			{
				alert("Property Address: ONLY numbers, letters, commas and spaces are allowed.");
				CanSubmit = 0;
			}
			else
				Msg = Msg + "; Property Address:" + document.AdditionalSvcs.PropAddr.value;
			
			//Property City State Zip
			if (document.AdditionalSvcs.PropCSZ.value.length < 4)
			{
				alert("Must enter Property City, State Zip (at least 4 characters).");
				CanSubmit = 0;
			}
			else if(!IsValidText(document.AdditionalSvcs.PropCSZ.value, " 0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ,"))
			{
				alert("Property City, State Zip: ONLY numbers, letters, commas and spaces are allowed.");
				CanSubmit = 0;
			}
			else
				Msg = Msg + " " + document.AdditionalSvcs.PropCSZ.value;

			//Property County
			if (document.AdditionalSvcs.County.value.length < 2)
			{
				alert("Must enter County (at least 2 characters).");
				CanSubmit = 0;
			}
			else if(!IsValidText(document.AdditionalSvcs.County.value, " ABCDEFGHIJKLMNOPQRSTUVWXYZ"))
			{
				alert("County: ONLY letters and spaces are allowed.");
				CanSubmit = 0;
			}
			else
				Msg = Msg + "; County:" + document.AdditionalSvcs.County.value;
			
			//PropType
			if (document.AdditionalSvcs.PropType.value == 'None')
			{
				alert("Must select a Property Type.");
				CanSubmit = 0;
			}
			else
				Msg = Msg + "; PropType:" + document.AdditionalSvcs.PropType.value;
			
			//E-mail Address
			if (!ValidEmail(document.AdditionalSvcs.Email.value))
			{
				alert("EMail: Email address is not valid.  Please enter a valid e-mail address.");
				CanSubmit = 0;
			}
			else
			{
				Msg = Msg + "; Email:" + document.AdditionalSvcs.Email.value;
			}

			//Owner Phone
			if (document.AdditionalSvcs.OwnerPhone.value.length < 10)
			{
				alert("Must enter Your Phone Number (including area code).");
				CanSubmit = 0;
			}
			else if(!IsValidText(document.AdditionalSvcs.OwnerPhone.value, " 0123456789()-"))
			{
				alert("Your Phone Number: ONLY numbers, hyphens, parenthesis and spaces are allowed.");
				CanSubmit = 0;
			}
			else
				Msg = Msg + "; Owner Phone:" + document.AdditionalSvcs.OwnerPhone.value;

			//Owner Address (if entered)
			if ((document.AdditionalSvcs.OwnerAddr.value.length > 0) || (document.AdditionalSvcs.OwnerCSZ.value.length > 0))
			{
				if (document.AdditionalSvcs.OwnerAddr.value.length < 4)
				{
					//If they have entered something, they need to enter it completly
					alert("Must finish entering Your Address (at least 4 characters) or clear the field if it is the same as the property.");
					CanSubmit = 0;
				}
				else if(!IsValidText(document.AdditionalSvcs.OwnerAddr.value, " 0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ,"))
				{
					alert("Owner Address: ONLY numbers, letters, commas and spaces are allowed.");
					CanSubmit = 0;
				}
				else
					Msg = Msg + "; Owner Address:" + document.AdditionalSvcs.OwnerAddr.value;
				
				//Owner City State Zip
				if (document.AdditionalSvcs.OwnerCSZ.value.length < 4)
				{
					alert("Must finish entering Your City, State Zip (at least 4 characters) or clear the field if it is the same as the property.");
					CanSubmit = 0;
				}
				else if(!IsValidText(document.AdditionalSvcs.OwnerCSZ.value, " 0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ,"))
				{
					alert("Your City, State Zip: ONLY numbers, letters, commas and spaces are allowed.");
					CanSubmit = 0;
				}
				else
					Msg = Msg + " " + document.AdditionalSvcs.OwnerCSZ.value;
			}
			else
			{
				Msg = Msg + "; Owner Address: Same as Property"
			}
		}

	}

	if (CanSubmit)
	{
		Msg = Msg + "]";
		ItemName = "Additional+Services(" + ItemName + ")";

		document.AdditionalSvcs.Item_Name.value = ItemName;
		document.AdditionalSvcs.Part_Num.value = PartNum + Msg;
		document.AdditionalSvcs.Cost.value = fmtCurr(Cost);
		document.AdditionalSvcs.Option_1.value = '';
		document.AdditionalSvcs.Option_2.value = '';

		if ((RptType == 'EXP') && (document.AdditionalSvcs.ckAutoRenew.checked))
		{
			Msg = "Y&item_name=" + ItemName + "&item_number=" + PartNum + Msg + "&no_shipping=1&no_note=1&currency_code=USD&a3=" + fmtCurr(Cost, true, false) + "&p3=" + SubLen + "&t3=M&src=1&sra=1"
		}
		else
		{
			Msg = "N&item_name=" + ItemName + "&item_number=" + PartNum + Msg + "&amount=" + fmtCurr(Cost, true, false) + "&currency_code=USD";
		}
		
		document.AdditionalSvcs.redirect.value = "https://www.fastpropertydata.com/PaymentMethod.htm?np="+Msg;
		emailD='FastPropertyData.com'
		document.AdditionalSvcs.recipient.value = 'sales' + '@' + emailD;
		if (RptType=='TSOAE')
		{
			document.AdditionalSvcs.email.value = document.AdditionalSvcs.txtOEemail.value;
		}
		else if (RptType=='EXP')
		{
			document.AdditionalSvcs.email.value = document.AdditionalSvcs.ExWdemail.value;
		}		
		else if (RptType=='FSBO')
		{
			
			document.AdditionalSvcs.subject.value = "FBSO Listing Request from FastPropertyData.com";
			document.AdditionalSvcs.Item_Name.value = "FSBO MLS Listing";
			if (document.AdditionalSvcs.OwnerAddr.value == '')
			{
				document.AdditionalSvcs.OwnerAddr.value = 'Same as Property';
				document.AdditionalSvcs.OwnerCSZ.value = 'Same as Property';
			}
			//Set fields so they don't appear in the e-mail
			document.AdditionalSvcs.txtEXPSubLen.value = '';
			document.AdditionalSvcs.ckAutoRenew.checked = false;
			document.AdditionalSvcs.chkLstingType[0].checked = false;
			document.AdditionalSvcs.chkLstingType[1].checked = false;
			document.AdditionalSvcs.chkPropType[0].checked = false;
			document.AdditionalSvcs.chkTBD.value = '';
			document.AdditionalSvcs.email.value = document.AdditionalSvcs.Email.value;
			document.AdditionalSvcs.recipient.value = document.AdditionalSvcs.recipient.value + ',deni@' + emailD;
			document.AdditionalSvcs.redirect.value = 'http://www.FastPropertyData.com/ThankYouFSBO.htm';
			document.AdditionalSvcs.submit();
			//Now reset the fields
			document.AdditionalSvcs.txtEXPSubLen.value = '1';
			document.AdditionalSvcs.ckAutoRenew.checked = true;
			document.AdditionalSvcs.chkLstingType[0].checked = true;
			document.AdditionalSvcs.chkLstingType[1].checked = true;
			document.AdditionalSvcs.chkPropType[0].checked = true;
			document.AdditionalSvcs.chkTBD.value = 'FALSE';
			if (document.AdditionalSvcs.OwnerAddr.value == 'Same as Property') 
			{
				document.AdditionalSvcs.OwnerAddr.value = '';
				document.AdditionalSvcs.OwnerCSZ.value = '';
			}
		}
		else
		{
			document.AdditionalSvcs.email.value = 'sales' + '@' + emailD;
		}

		if (RptType!='FSBO')
		{
			if (confirm("Although every reasonable effort has been made to ensure the accuracy of the information provided, FastPropertyData.com cannot be held responsible for any consequences resulting from any omissions or errors contained herein. FastPropertyData.com assumes no liability whatsoever associated with the use or misuse of data or services. Your purchase of foreclosure data or services from FastPropertyData.com constitutes acceptance of this policy. Accept?")) 
			{
				document.AdditionalSvcs.submit();
			}
		}
	}
}

/*

Functions for ForeclosureListDataFields.htm

*/
function DataFields_SubmitMe(flag)
{
	var CanSubmit = 1;
	var i = 0;
	var Count = 0;
	var selInput = 0xFFFFFFFF;
	var selPDC1 = 0xFFFFFFFF;
	var selPDC2 = 0xFFFFFFFF;
	var selMLS = 0xFFFFFFFF;
	var selX = 0xFFFFFFFF;
	var selDeed = 0xFFFFFFFF;
	var selDeed2 = 0xFFFFFFFF;
	var Msg = "";
	var PartNum2 = "";
	var MLS = "N";
	var MLSListorOffice = "Y";
	var iMaxChecks = 0;

	//INPUT: must select at least one
	Count = 0;
	selInput = 0x0;
	for(i = 0; i < 30; i++)
	{
		if (i == 10)
			//Sold Status is out of its order so compensate
			//It is currently i==10 but should have been i==25
		{
			if (document.FCListDataFields.chkInput[i].checked)
			{
				Count++;
				selInput = selInput | (0x1 << 25);
			}
		}
		else
		{
			if ((i > 10) && (i<=25))
				//Sold Status is out of its order so compensate
				//It is currently i==10 but should have been i==25
			{
				if (document.FCListDataFields.chkInput[i].checked)
				{
					Count++;
					selInput = selInput | (0x1 << (i-1));
				}
			}
			else
			{
				if (document.FCListDataFields.chkInput[i].checked)
				{
					Count++;
					selInput = selInput | (0x1 << i);
				}
			}
		}
	}
	if ((Count < 1)&&(flag == 0))
	{
		alert("Must choose at least ONE item from the Input(I) section!");
		CanSubmit = 0;
	}

	//PDC: no minimum
	Count = 0;
	selPDC1 = 0x0;
	selPDC2 = 0x0;
	for(i = 0; i < 30; i++)
	{
		if (i < 9) 
		{
			if (document.FCListDataFields.chkPDC[i].checked) selPDC1 = selPDC1 | (0x1 << i);
		}
		else
		{
			if (i >= 9) 
			{
				//Ignore where Phone Number used to be since the field is no longer available
				if (document.FCListDataFields.chkPDC[i].checked) selPDC1 = selPDC1 | (0x1 << (i+1));
			}
		}
	}
	for(i = 30; i < 54; i++)
	{
		if (document.FCListDataFields.chkPDC[i].checked) selPDC2 = selPDC2 | (0x1 << (i - 30));
	}

	//MLS: no minimum
	Count = 0;
	selMLS = 0x0;
	MLS = "N";
	MLSListorOffice = "Y";
	//Check to see if any MLS fields are selected and, if so, force Listor and Office fields to be selected also
	for(i = 0; i < 23; i++)
	{
		if (document.FCListDataFields.chkMLS[i].checked)
		{
			if ((i <=15) || (i >= 18))
			{
				MLS = "Y";
				
			}
			selMLS = selMLS | (0x1 << i);			
		}
		if (!(document.FCListDataFields.chkMLS[i].checked) && (i >=15) && (i <= 18))
		{
			MLSListorOffice = "N";
		}
	}
	if ((MLS == "Y") && (MLSListorOffice == "N"))
	{
		alert("You must select all MLS Listor and Office fields if you select any fields from the MLS(M) section!");
		CanSubmit = 0;
	}

	//X: no minimum
	Count = 0;
	selX = 0x0;
	if (SubLvl == 'P')
		iMaxChecks = 22;		
	else
		iMaxChecks = 15;
		
	for(i = 0; i < iMaxChecks; i++)
	{
		if (document.FCListDataFields.chkX[i].checked) selX = selX | (0x1 << i);
	}
	
	//D: no minimum
	selDeed = 0x0;
	if (SubLvl == 'P')
		iMaxChecks = 31;		
	else
		iMaxChecks = 0;
		
	for(i = 0; i < iMaxChecks; i++)
	{
		if (document.FCListDataFields.chkD[i].checked) selDeed = selDeed | (0x1 << i);
	}

	selDeed2 = 0x0;
	if (SubLvl == 'P')
		iMaxChecks = 34;		
	else
		iMaxChecks = 31;
		
	for(i = 31; i < iMaxChecks; i++)
	{
		if (document.FCListDataFields.chkD[i].checked) selDeed2 = selDeed2 | (0x1 << (i-31));
	}
	
	
	if (CanSubmit)
	{
		PartNum2 = "I:" + Hex(selInput) + "P1:" + Hex(selPDC1) + "P2:" + Hex(selPDC2) + "ML:" + Hex(selMLS) + "X:" + Hex(selX) + "D:" + Hex(selDeed) + "D2:" + Hex(selDeed2) + "E:" + EMail + "]"
		ItemName = PrevItemName + PreFilter + ")";
		
		document.FCListDataFields.Item_Name.value = ItemName;
		document.FCListDataFields.Part_Num.value = ItemNbr + PartNum2;
		document.FCListDataFields.Cost.value = Amount;
		document.FCListDataFields.Option_1.value = "A:"+Adv;
		document.FCListDataFields.Option_2.value = "XF:"+PreSaleBids+FullData + FileFormat + FileFrequency + AddrLbl + MergeDoc;
		if (AutoRenew == 'Y')
			Msg = "Y&item_name=" + ItemName + "&item_number=" + ItemNbr + PartNum2 + "&no_shipping=1&no_note=1&currency_code=USD&a3=" + Amount + "&on0=A:"+Adv+"&on1=XF:"+PreSaleBids+FullData + FileFormat + FileFrequency + AddrLbl + MergeDoc + "&p3=" + SubLen + "&t3=M&src=1&sra=1";
		else
			Msg = AutoRenew+"&item_name=" + ItemName + "&item_number=" + ItemNbr + PartNum2 + "&amount=" + Amount + "&no_note=1&currency_code=USD&on0=A:"+Adv+"&on1=XF:"+PreSaleBids+FullData + FileFormat + FileFrequency + AddrLbl + MergeDoc;

		document.FCListDataFields.redirect.value = "https://www.fastpropertydata.com/PaymentMethod.htm?np="+Msg;
		emailD='FastPropertyData.com'
		document.FCListDataFields.recipient.value = 'sales' + '@' + emailD;
		document.FCListDataFields.email.value = EMail;

		if (confirm("Although every reasonable effort has been made to ensure the accuracy of the information provided, FastPropertyData.com cannot be held responsible for any consequences resulting from any omissions or errors contained herein. FastPropertyData.com assumes no liability whatsoever associated with the use or misuse of this data. Your purchase of foreclosure data or services from FastPropertyData.com constitutes acceptance of this policy. Accept?")) 
		{
			document.FCListDataFields.submit();
		}
	}
}

/*

Functions for ForeclosureListsPreferences.htm

*/
function SetAllPropTypes(All)
{
	if (All=="Y")
	{
		if (document.FCListPreferences.chkPropType[0].checked)
		{
			//If No Filter is checked, uncheck all others
			for (i=1; i<12; i++)
			{
				document.FCListPreferences.chkPropType[i].checked = false
			}
		}
		return;
	}
	else
	{
		//If a property type is checked, uncheck "No Filter"
		document.FCListPreferences.chkPropType[0].checked = false
		return;
	}
}

function IsValidNumericFilter(Val, Title)
{
	if (isNaN(Val))
	{
		alert("Pre Filter: " + Title + " must be numeric (or blank).  Please correct it");
		return 0;
	}
	else
	{
		if (Val < 0)
		{
			alert("Pre Filter: " + Title + " must be greater than or equal to 0 (or blank).  Please correct it");
			return 0;
		}
	}		
	return 1;
}

function Preferences_SubmitMe(flag)
{
	var CanSubmit = 1;
	var i = 0;
	var Count = 0;
	var Msg = "";
	var selPropType = 0xFFFFFFFF;
	var FileFormat = "";
	var FileFrequency = "";
	var PreFilter = "";
	var sMin = "";
	var sMax = "";
	
	//File Frequency
	if (document.FCListPreferences.rbtMultFiles.checked)
		FileFrequency = "M";
	else
		FileFrequency = "W";
		
	//File Format
	if (document.FCListPreferences.rbtCSV.checked)
		FileFormat = "C";
	else
		FileFormat = "E";
		
	//Pre-filters
	//Status, NOO, MLS
	PreFilter = "PF:S" + document.FCListPreferences.cboStatus.value + ";";
	PreFilter = PreFilter + "NOO" + document.FCListPreferences.cboNOO.value + ";";
	PreFilter = PreFilter + "MLS" + document.FCListPreferences.cboMLS.value + ";";
	
	//Bedrooms
	sMin = document.FCListPreferences.txtBedMin.value;
	sMin = ConvBlankToZero(sMin)
	if (!(IsValidNumericFilter(sMin, "Minimum Bedrooms")))
	{
		CanSubmit = 0;
	}
	sMax = document.FCListPreferences.txtBedMax.value;
	sMax = ConvBlankToZero(sMax)
	if (!(IsValidNumericFilter(sMax, "Maximum Bedrooms")))
	{
		CanSubmit = 0;
	}
	else
	{
		if (CanSubmit == 1)
		{
			if (((sMin * 1) > (sMax * 1)) && (sMax != 0))
			{
				CanSubmit = 0;
				alert("Pre Filter: Maximum Bedrooms must be greater than or equal Minimum Bedrooms (or 0 or blank).  Please correct it");				
			}
		}
	}			
	PreFilter = PreFilter + "BD" + sMin + "!" + sMax + ";";

	//Bathrooms
	sMin = document.FCListPreferences.txtBathMin.value;
	sMin = ConvBlankToZero(sMin)
	if (!(IsValidNumericFilter(sMin, "Minimum Bathrooms")))
	{
		CanSubmit = 0;
	}
	sMax = document.FCListPreferences.txtBathMax.value;
	sMax = ConvBlankToZero(sMax)
	if (!(IsValidNumericFilter(sMax, "Maximum Bathrooms")))
	{
		CanSubmit = 0;
	}
	else
	{
		if (CanSubmit == 1)
		{
			if (((sMin * 1) > (sMax * 1)) && (sMax != 0))
			{
				CanSubmit = 0;
				alert("Pre Filter: Maximum Bathrooms must be greater than or equal Minimum Bathrooms (or 0 or blank).  Please correct it");				
			}
		}
	}			
	PreFilter = PreFilter + "BT" + sMin + "!" + sMax + ";";
	
	//DOT Age	
	sMin = document.FCListPreferences.txtDOTAgeMin.value;
	sMin = ConvBlankToZero(sMin)
	if (!(IsValidNumericFilter(sMin, "Minimum DOT Age")))
	{
		CanSubmit = 0;
	}
	sMax = document.FCListPreferences.txtDOTAgeMax.value;
	sMax = ConvBlankToZero(sMax)
	if (!(IsValidNumericFilter(sMax, "Maximum DOT Age")))
	{
		CanSubmit = 0;
	}
	else
	{
		if (CanSubmit == 1)
		{
			if (((sMin * 1) > (sMax * 1)) && (sMax != 0))
			{
				CanSubmit = 0;
				alert("Pre Filter: Maximum DOT Age must be greater than or equal Minimum DOT Age (or 0 or blank).  Please correct it");				
			}
		}
	}			
	PreFilter = PreFilter + "DOT" + sMin + "!" + sMax + ";";

	//LTV Percentage	
	sMin = document.FCListPreferences.txtLTVPctMin.value;
	sMin = ConvBlankToZero(sMin)
	if (!(IsValidNumericFilter(sMin, "Minimum LTV Percentage")))
	{
		CanSubmit = 0;
	}
	sMax = document.FCListPreferences.txtLTVPctMax.value;
	sMax = ConvBlankToZero(sMax)
	if (!(IsValidNumericFilter(sMax, "Maximum LTV Percentage")))
	{
		CanSubmit = 0;
	}
	else
	{
		if (CanSubmit == 1)
		{
			if (((sMin * 1) > (sMax * 1)) && (sMax != 0))
			{
				CanSubmit = 0;
				alert("Pre Filter: Maximum LTV Percentage must be greater than or equal Minimum LTV Percentage (or 0 or blank).  Please correct it");				
			}
		}
	}			
	PreFilter = PreFilter + "LTV" + sMin + "!" + sMax + ";";

	//Total Value	
	sMin = document.FCListPreferences.txtTotValMin.value;
	sMin = ConvBlankToZero(sMin)
	if (!(IsValidNumericFilter(sMin, "Minimum Total Value")))
	{
		CanSubmit = 0;
	}
	sMax = document.FCListPreferences.txtTotValMax.value;
	sMax = ConvBlankToZero(sMax);
	if (!(IsValidNumericFilter(sMax, "Maximum Total Value")))
	{
		CanSubmit = 0;
	}
	else
	{
		if (CanSubmit == 1)
		{
			if (((sMin * 1) > (sMax * 1)) && (sMax != 0))
			{
				CanSubmit = 0;
				alert("Pre Filter: Maximum Total Value must be greater than or equal Minimum Total Value (or 0 or blank).  Please correct it");				
			}
		}
	}			
	PreFilter = PreFilter + "TV" + sMin + "!" + sMax + ";";

	//Property Types
	selPropType = 0x0;
	for(i = 0; i < 12; i++)
	{
		if (document.FCListPreferences.chkPropType[i].checked)
		{
			selPropType = selPropType | (0x1 << i);
		}
	}
	PreFilter = PreFilter + "PT" + selPropType + ";";

	//Zip Codes
	sZip = document.FCListPreferences.txtZips.value;
	sZip = trimAll(sZip);
	if (sZip.length != 0)
	{
		if (sZip.substring(sZip.length - 1, sZip.length) == ",")
		{
			sZip = sZip.substring(0, sZip.length - 1)
			document.FCListPreferences.txtZips.value = sZip
		}
		for (i=0; i < sZip.length; i = i + 6)
		{
			if (isNaN(sZip.substring(i, i+5)))
			{
				alert("Zip codes to include must be 5 digits. Please correct Zip Code " + sZip.substring(i, i+5) + ".");
				CanSubmit = 0;
			}
			else
			{
				if (i + 5 > sZip.length)
				{
					alert("Zip codes to include must be 5 digits. Please correct Zip Code " + sZip.substring(i, sZip.length) + ".");
					CanSubmit = 0;
				}
				else
				{
					if (i + 6 < sZip.length)
					{
						if (sZip.substring(i + 5, i + 6) != ",")
						{
							alert("Zip codes to include must be separated by commas. Please correct position " + (i + 6) + ".");
							CanSubmit = 0;
						}
					}
				}
			}
		}
	}
	PreFilter = PreFilter + "Z" + sZip + ";";

	//Zip Codes Exclude
	sZip = document.FCListPreferences.txtZipsExclude.value;
	sZip = trimAll(sZip);
	if (sZip.length != 0)
	{
		if (sZip.substring(sZip.length - 1, sZip.length) == ",")
		{
			sZip = sZip.substring(0, sZip.length - 1)
			document.FCListPreferences.txtZips.value = sZip
		}
		for (i=0; i < sZip.length; i = i + 6)
		{
			if (isNaN(sZip.substring(i, i+5)))
			{
				alert("Zip codes to exclude must be 5 digits. Please correct Zip Code " + sZip.substring(i, i+5) + ".");
				CanSubmit = 0;
			}
			else
			{
				if (i + 5 > sZip.length)
				{
					alert("Zip codes to exclude must be 5 digits. Please correct Zip Code " + sZip.substring(i, sZip.length) + ".");
					CanSubmit = 0;
				}
				else
				{
					if (i + 6 < sZip.length)
					{
						if (sZip.substring(i + 5, i + 6) != ",")
						{
							alert("Zip codes to exclude must be separated by commas. Please correct position " + (i + 6) + ".");
							CanSubmit = 0;
						}
					}
				}
			}
		}
	}
	PreFilter = PreFilter + "XZ" + sZip + ";";

	if (CanSubmit)
	{
		switch(flag)
		{
		case 0:
			//New Subscriber
			PartNum2 = "I:DFLTP1:DFLTP2:DFLTML:DFLTX:DFLTD:DFLTD2:DFLT" + "E:" + EMail + "]";
			ItemName = PrevItemName + PreFilter + ")";
			break;
		case 1:
			//Renewing existing/former subscriber
			PartNum2 = "E:" + EMail + "]";
			ItemName = PrevItemName + PreFilter + ")(Renew)";
			break;
		case 2:
			//Customize
			if (SubLvl=='P')
			{
				Msg = "ForeclosureListsFeatures.htm?file_fqcy=" + FileFrequency + "&file_fmt=" + FileFormat + "&pre_fltr=" + PreFilter + "&sub_len=" + SubLen + "&adv=" + Adv + "&presale_bids=" + PreSaleBids + "&full_data="+FullData+"&e_mail=" + EMail + "&sub_lvl=" + SubLvl + "&item_name=" + PrevItemName + "&item_number=" + ItemNbr + "&amount=" + Amount + "&auto_renew=" + AutoRenew;
			}
			else //Licenses - skip features and jump to data fields
			{
				Msg = "ForeclosureListsDataFields.htm?addr_lbl=AL:LBN&mrg_doc=M1:MDN0;M2:MDN0;M3:MDN0;M4:MDN0;&file_fqcy=W&file_fmt=" + FileFormat + "&pre_fltr=" + PreFilter + "&sub_len=" + SubLen + "&adv=" + Adv + "&presale_bids=" + PreSaleBids + "&full_data="+FullData+"&e_mail=" + EMail + "&sub_lvl=" + SubLvl + "&item_name=" + PrevItemName + "&item_number=" + ItemNbr + "&amount=" + Amount + "&auto_renew=" + AutoRenew;
			}
			window.location.href = Msg
			break;
		}
//		alert("FileFormat: " + FileFormat + " Pre-Filter: " + PreFilter)
		
		if (flag != 2)
		{
			document.FCListPreferences.Item_Name.value = ItemName;
			document.FCListPreferences.Part_Num.value = ItemNbr + PartNum2;
			document.FCListPreferences.Cost.value = Amount;
			document.FCListPreferences.Option_1.value = "A:"+Adv;
			document.FCListPreferences.Option_2.value = "XF:"+PreSaleBids+FullData + FileFormat + FileFrequency;
			if (AutoRenew == 'Y')
				Msg = "Y&item_name=" + ItemName + "&item_number=" + ItemNbr + PartNum2 + "&no_shipping=1&no_note=1&currency_code=USD&a3=" + Amount + "&on0=A:"+Adv+"&on1=XF:"+PreSaleBids+FullData + FileFormat + FileFrequency + "&p3=" + SubLen + "&t3=M&src=1&sra=1";
			else
				Msg = AutoRenew+"&item_name=" + ItemName + "&item_number=" + ItemNbr + PartNum2 + "&amount=" + Amount + "&no_note=1&currency_code=USD&on0=A:"+Adv+"&on1=XF:"+PreSaleBids+FullData + FileFormat + FileFrequency ;

			document.FCListPreferences.redirect.value = "https://www.fastpropertydata.com/PaymentMethod.htm?np="+Msg;
			emailD='FastPropertyData.com'
			document.FCListPreferences.recipient.value = 'sales' + '@' + emailD;
			document.FCListPreferences.email.value = EMail;

			if (confirm("Although every reasonable effort has been made to ensure the accuracy of the information provided, FastPropertyData.com cannot be held responsible for any consequences resulting from any omissions or errors contained herein. FastPropertyData.com assumes no liability whatsoever associated with the use or misuse of this data. Your purchase of foreclosure data or services from FastPropertyData.com constitutes acceptance of this policy. Accept?")) 
			{
				document.FCListPreferences.submit();
			}
		}
	}
}

/*

Functions for ForeclosureListsFeatures.htm

*/
function MergeDoc(Id)
{
	if (document.FCListFeatures.cboMergeDoc[Id-1].value == "NF")
	{
		document.FCListFeatures.chkMailMerge[Id-1].checked = false
	}
	else
	{
		if (Id == 1)
		{
			document.FCListFeatures.chkMailMerge[Id-1].checked = true				
		}
	}
}

function Features_SubmitMe(flag)
{
	var CanSubmit = 1;
	var i = 0;
	var Count = 0;
	var Msg = "";
	var AddrLbl = "";
	var MergeDoc = "";
	var tmp = "";

	//Address Labels	
	AddrLbl = "AL:" + document.FCListFeatures.cboAddrLbl.value;
	//Validate fields for non-"None" selections
	if (document.FCListFeatures.cboAddrLbl.value != "LBN")
	{
		//Address Label Font Pref
		tmp = trimAll(document.FCListFeatures.txtAddrLblFont.value);
		if (tmp.length == "")
		{
			CanSubmit = 0;
			alert("Please type in a font name for your address lables.");
		}
		else
		{
			AddrLbl = AddrLbl + "F-" + tmp + "-";
		}
		
		tmp = trimAll(document.FCListFeatures.txtAddrLblFontSize.value);
		if (tmp.length == 0)
		{
			CanSubmit = 0;
			alert("Please type in a font size for your address lables.");
		}
		else
		{
			if (isNaN(tmp))
			{
				CanSubmit = 0;
				alert("Font size must be numeric.  Please correct it");
			}
			else
			{
				if (tmp < 6)
				{
					CanSubmit = 0;
					alert("Font size must be greater than or equal to 6.  Please correct it");
				}
				else
				{
					AddrLbl = AddrLbl + "S" + tmp;				
				}
			}		
		}

		//Address Label Address Pref
		if (document.FCListFeatures.rbtAddrFmtProp.checked)
			AddrLbl = AddrLbl + "AP";
		else
		{
			if (document.FCListFeatures.rbtAddrFmtNOO.checked)
				AddrLbl = AddrLbl + "AO";
			else
			{
				CanSubmit = 0;
				alert("Please select your address preference for your address lables.");
			}
		}
	}	
	
	//Mail Merge Docs
	if (SubLvl == 'P')
	{
		for (i=0;i < 4; i++)
		{
			tmp = document.FCListFeatures.chkMailMerge[i].checked
			if (tmp == true)
				tmp = 1;
			else
				tmp = 0;

			MergeDoc = MergeDoc + "M" + (i+1) + document.FCListFeatures.cboMergeDoc[i].value + tmp + ";";
			//Make sure we don't have any "None" selections followed by a valid selection.
			if ((i>0) && (document.FCListFeatures.cboMergeDoc[i].value != "MDN") && (document.FCListFeatures.cboMergeDoc[i-1].value == "MDN"))
			{
				CanSubmit = 0;
				alert("Merge document selection of \'None\' cannot be followed by a specified document.  Please correct your selection for Merge Document " + i + " and/or " + (i + 1) + ".");
			}
		}
	}
	else
	{
		for (i=0;i < 4; i++)
		{
			MergeDoc = MergeDoc + "M" + (i+1) + ":MDN0;";
		}
	}
	
	if (CanSubmit)
	{
		switch(flag)
		{
		case 0:
			//New Subscriber
			PartNum2 = "I:DFLTP1:DFLTP2:DFLTML:DFLTX:DFLTD:DFLT" + "E:" + EMail + "]";
			ItemName = PrevItemName + PreFilter + ")";
			break;
		case 1:
			//Renewing existing/former subscriber
			PartNum2 =  "E:" + EMail + "]";
			ItemName = PrevItemName + PreFilter + ")(Renew)";
			break;
		case 2:
			//Customize
			Msg = "ForeclosureListsDataFields.htm?addr_lbl=" + AddrLbl + "&mrg_doc=" + MergeDoc + "&file_fqcy=" + FileFrequency + "&file_fmt=" + FileFormat + "&pre_fltr=" + PreFilter + "&sub_len=" + SubLen + "&adv=" + Adv + "&presale_bids=" + PreSaleBids + "&full_data="+FullData+"&e_mail=" + EMail + "&sub_lvl=" + SubLvl + "&item_name=" + PrevItemName + "&item_number=" + ItemNbr + "&amount=" + Amount + "&auto_renew=" + AutoRenew;
			window.location.href = Msg;
			break;
		}

//		alert("Address Labels: " + AddrLbl + "; Merge Docs: " + MergeDoc)
		
		if (flag != 2)
		{
			document.FCListFeatures.Item_Name.value = ItemName;
			document.FCListFeatures.Part_Num.value = ItemNbr + PartNum2;
			document.FCListFeatures.Cost.value = Amount;
			document.FCListFeatures.Option_1.value = "A:"+Adv;
			document.FCListFeatures.Option_2.value = "XF:"+PreSaleBids+FullData + FileFormat + FileFrequency + AddrLbl + MergeDoc;
			if (AutoRenew == 'Y')
				Msg = "Y&item_name=" + ItemName + "&item_number=" + ItemNbr + PartNum2 + "&no_shipping=1&no_note=1&currency_code=USD&a3=" + Amount + "&on0=A:"+Adv+"&on1=XF:"+PreSaleBids+FullData + FileFormat + FileFrequency + AddrLbl + MergeDoc + "&p3=" + SubLen + "&t3=M&src=1&sra=1";
			else
				Msg = AutoRenew+"&item_name=" + ItemName + "&item_number=" + ItemNbr + PartNum2 + "&amount=" + Amount + "&no_note=1&currency_code=USD&on0=A:"+Adv+"&on1=XF:"+PreSaleBids+FullData + FileFormat + FileFrequency + AddrLbl + MergeDoc;

			document.FCListFeatures.redirect.value = "https://www.fastpropertydata.com/PaymentMethod.htm?np="+Msg;
			emailD='FastPropertyData.com'
			document.FCListFeatures.recipient.value = 'sales' + '@' + emailD;
			document.FCListFeatures.email.value = EMail;

			if (confirm("Although every reasonable effort has been made to ensure the accuracy of the information provided, FastPropertyData.com cannot be held responsible for any consequences resulting from any omissions or errors contained herein. FastPropertyData.com assumes no liability whatsoever associated with the use or misuse of this data. Your purchase of foreclosure data or services from FastPropertyData.com constitutes acceptance of this policy. Accept?")) 
			{
				document.FCListFeatures.submit();
			}
		}
	}
}

