function setOptions(row)
{
	BrandList = document.getElementById("brand_" + row)
	ProductList = document.getElementById("product_" + row)
	ProductList.options.length = 0
	
	ProductList.options[0] = new Option('Please choose...','');
	
	switch (BrandList.selectedIndex)
	{
		case 1: //Austex
			ProductList.options[1] = new Option('Beef Stew (15oz)', 'Beef Stew (15oz)|.99-1.29');
			ProductList.options[2] = new Option('Chili with Beans (15oz)', 'Chili with Beans (15oz)|.89-1.29');
			ProductList.options[3] = new Option('Chili with Beans (19oz)', 'Chili with Beans (19oz)|.89-1.39');
			ProductList.options[4] = new Option('Chili no Beans (15oz)', 'Chili no Beans (15oz)|.89-1.49');
			ProductList.options[5] = new Option('Chili no Beans (19oz)', 'Chili no Beans (19oz)|.99-1.59');
			ProductList.options[6] = new Option('Onion Hot Dog Chili Sauce (10oz)', 'Onion Hot Dog Chili Sauce (10oz)|.44-.69');
			ProductList.options[7] = new Option('Hot Dog Chili Sauce (10oz)', 'Hot Dog Chili Sauce (10oz)|.44-.69');
			break
		case 2: //Best Yet
			ProductList.options[1] = new Option('Chili with Beans (15oz)', 'Chili with Beans (15oz)|.79-1.19');
			ProductList.options[2] = new Option('Corned Beef Hash 15oz)', 'Corned Beef Hash 15oz)|1.19-1.59');
			break
		case 3: //Big Y
			ProductList.options[1] = new Option('Chili with Beans (15oz)', 'Chili with Beans (15oz)|.79-1.19');
			ProductList.options[2] = new Option('Chili no Beans (15oz)', 'Chili no Beans (15oz)|.99-1.49');
			ProductList.options[3] = new Option('Corned Beef Hash (15oz)', 'Corned Beef Hash (15oz)|1.19-1.59');
			break
		case 4: //Black Rock
			ProductList.options[1] = new Option('Chili with Beans (15oz)', 'Chili with Beans (15oz)|8.99-8.99');
			break
		case 5: //Bloom
			ProductList.options[1] = new Option('Hot Dog Chili Sauce (10oz)', 'Hot Dog Chili Sauce (10oz)|.45-.55');
			break
		case 6: //Bryan
			ProductList.options[1] = new Option('Chili no Beans (10oz)', 'Chili no Beans (10oz)|1.25-1.49');
			ProductList.options[2] = new Option('Chili no Beans (15oz)', 'Chili no Beans (15oz)|1.49-1.99');
			ProductList.options[3] = new Option('Chili with Beans (15oz)', 'Chili with Beans (15oz)|.99-1.49');
			ProductList.options[4] = new Option('Corned Beef Hash (15oz)', 'Corned Beef Hash (15oz)|1.49-1.99');
			ProductList.options[5] = new Option('Hot Dog Chili Sauce with Beef (10oz)', 'Hot Dog Chili Sauce with Beef (10oz)|.79-.99');
			break
		case 7: //Bunker Hill
			ProductList.options[1] = new Option('Chili no Beans (10oz)', 'Chili no Beans (10oz)|.99-1.39');
			ProductList.options[2] = new Option('Spicier Chili no Beans (10oz)', 'Spicier Chili no Beans (10oz)|.99-1.39');
			ProductList.options[3] = new Option('Hot Dog Chili Sauce (10oz)', 'Hot Dog Chili Sauce (10oz)|.44-.69');
			break
		case 8: //Castleberry's
			ProductList.options[1] = new Option('Barbecue Pork in Barbecue Sauce (10oz)', 'Barbecue Pork in Barbecue Sauce (10oz)|1.99-2.39');
			ProductList.options[2] = new Option('Barbecue Pork in Barbecue Sauce (14.5oz)', 'Barbecue Pork in Barbecue Sauce (14.5oz)|2.49-2.99');
			ProductList.options[3] = new Option('Barbecue Beef (10oz)', 'Barbecue Beef (10oz)|1.99-2.39');
			ProductList.options[4] = new Option('Beef Stew (15oz)', 'Beef Stew (15oz)|.99-1.29');
			ProductList.options[5] = new Option('Brunswick Beef Stew Chicken & Beef (15oz)', 'Brunswick Beef Stew Chicken & Beef (15oz)|1.29-1.49');
			ProductList.options[6] = new Option('Chili with Beans (15oz)', 'Chili with Beans (15oz)|.89-1.19');
			ProductList.options[7] = new Option('Chili no Beans (10oz)', 'Chili no Beans (10oz)|.99-1.29');
			ProductList.options[8] = new Option('Chili no Beans (15oz)', 'Chili no Beans (15oz)|1.25-1.49');
			ProductList.options[9] = new Option('Corned Beef Hash (15oz)', 'Corned Beef Hash (15oz)|1.49-1.99');
			ProductList.options[10] = new Option('Creamed Chip Beef Gravy (10oz)', 'Creamed Chip Beef Gravy (10oz)|1.49-1.99');
			ProductList.options[11] = new Option('Georgia Hash (15oz)', 'Georgia Hash (15oz)|1.99-2.39');
			ProductList.options[12] = new Option('Hot Chili with Beans (15oz)', 'Hot Chili with Beans (15oz)|.89-1.19');
			ProductList.options[13] = new Option('Hot Dog Chili Sauce (10oz)', 'Hot Dog Chili Sauce (10oz)|.44-.69');
			ProductList.options[14] = new Option('Onion Hot Dog Chili Sauce (10oz)', 'Onion Hot Dog Chili Sauce (10oz)|.44-.69');
			ProductList.options[15] = new Option('Sausage Gravy (10oz)', 'Sausage Gravy (10oz)|1.29-1.49');
			break
		case 9: //Thrifty Maid
			ProductList.options[1] = new Option('Chili with Beans (15oz)', 'Chili with Beans (15oz)|.79-1.19');
			ProductList.options[2] = new Option('Corned Beef Hash (15oz)', 'Corned Beef Hash (15oz)|1.19-1.59');
			ProductList.options[3] = new Option('Hot Dog Chili Sauce (10oz)', 'Hot Dog Chili Sauce (10oz)|.45-.55');
			break
		case 10: //Triple Bar
			ProductList.options[1] = new Option('Chili no Beans (15oz)', 'Chili no Beans (15oz)|1.38-1.38');
			ProductList.options[2] = new Option('Chili with Beans (15oz)', 'Chili with Beans (15oz)|1.38-1.38');
			ProductList.options[3] = new Option('Chili with Beans Slow Cooked (15oz)', 'Chili with Beans Slow Cooked (15oz)|6.99-6.99');
			break
		case 11: //Value Time
			ProductList.options[1] = new Option('Beef and Chicken Chili with Beans (15oz)', 'Beef and Chicken Chili with Beans (15oz)|.79-.99');
			break
		case 12: //Food Club
			ProductList.options[1] = new Option('Corned Beef Hash (15oz)', 'Corned Beef Hash (15oz)|1.19-1.59');
			ProductList.options[2] = new Option('Chili with Beans (15oz)', 'Chili with Beans (15oz)|.79-1.19');
			ProductList.options[3] = new Option('Chili no Beans (15oz)', 'Chili no Beans (15oz)|.99-1.49');
			break
		case 13: //Food Lion
			ProductList.options[1] = new Option('Hot Dog Chili Sauce (10oz)', 'Hot Dog Chili Sauce (10oz)|.45-.55');
			break			
		case 14: //Goldstar
			ProductList.options[1] = new Option('Original Chili (10oz)', 'Original Chili (10oz)|.99-1.29');
			ProductList.options[2] = new Option('Chili (15oz)', 'Chili (15oz)|1.49-1.69');
			ProductList.options[3] = new Option('Tex-Mex Chili with Beans (15oz)', 'Tex-Mex Chili with Beans (15oz)|1.49-1.69');
			break
		case 15: //Great Value (Canada Only)
			ProductList.options[1] = new Option('Hot Chili with Beans (15oz)', 'Hot Chili with Beans (15oz)|.49-1.09');
			ProductList.options[2] = new Option('Chili with Beans (15oz)', 'Chili with Beans (15oz)|.49-1.09');
			break
		case 16: //Kroger
			ProductList.options[1] = new Option('Chili with Beans (15oz)', 'Chili with Beans (15oz)|0.89 -1.09');
			ProductList.options[2] = new Option('Chili no Beans (15oz)', 'Chili no Beans (15oz)|1.49-1.79');
			ProductList.options[3] = new Option('Beef Stew (15oz)', 'Beef Stew (15oz)|.99-1.29');
			ProductList.options[4] = new Option('Hot Dog Chili Sauce (10oz)', 'Hot Dog Chili Sauce (10oz)|.39-.55');
			break
		case 17: //Lowes Foods
			ProductList.options[1] = new Option('Chili with Beans (15oz)', 'Chili with Beans (15oz)|.79-1.19');
			ProductList.options[2] = new Option('Chili no Beans (15oz)', 'Chili no Beans (15oz)|.99-1.49');
			ProductList.options[3] = new Option('Corned Beef Hash (15oz)', 'Corned Beef Hash (15oz)|1.19-1.59');
			break
		case 18: //Meijer
			ProductList.options[1] = new Option('Chili with Beans (15oz)', 'Chili with Beans (15oz)|.79-1.19');
			ProductList.options[2] = new Option('Chili no Beans (15oz)', 'Chili no Beans (15oz)|.99-1.49');
			ProductList.options[3] = new Option('Corned Beef Hash (15oz)', 'Corned Beef Hash (15oz)|1.19-1.59');
			ProductList.options[4] = new Option('Hot Dog Chili Sauce (10oz)', 'Hot Dog Chili Sauce (10oz)|.45-.55');
			break
		case 19: //Morton House
			ProductList.options[1] = new Option('Chili With Beans Beef & Chicken (15oz)', 'Chili With Beans Beef & Chicken (15oz)|.79-1.09');
			ProductList.options[2] = new Option('Chili With Beans Beef & Chicken (15oz)', 'Chili With Beans Beef & Chicken (15oz)|.79-1.09');
			ProductList.options[3] = new Option('Corned Beef Hash (15oz)', 'Corned Beef Hash (15oz)|1.29-1.79');
			break
		case 20: //Paramount
			ProductList.options[1] = new Option('Chili with Beans (15oz)', 'Chili with Beans (15oz)|1.29-1.49');
			ProductList.options[2] = new Option('Chili no Beans (15oz)', 'Chili no Beans (15oz)|1.49-1.79');
			ProductList.options[3] = new Option('Hot Dog Chili Sauce (15oz)', 'Hot Dog Chili Sauce (15oz)|.50-.69');
			ProductList.options[4] = new Option('Chili Hot Dog Chili (15oz)', 'Chili Hot Dog Chili (15oz)|1.49-1.79');
			break
		case 21: //Piggly Wiggly
			ProductList.options[1] = new Option('Chili no Beans (10oz)', 'Chili no Beans (10oz)|.99-1.19');
			ProductList.options[2] = new Option('Chili no Beans (15oz)', 'Chili no Beans (15oz)|1.29-1.49');
			ProductList.options[3] = new Option('Chili with Beans (15oz)', 'Chili with Beans (15oz)|.79-1.19');
			ProductList.options[4] = new Option('Corned Beef Hash (15oz)', 'Corned Beef Hash (15oz)|1.19-1.59');
			break
		case 22: //Prudence
			ProductList.options[1] = new Option('Corned Beef Hash (15oz)', 'Corned Beef Hash (15oz)|.99-1.79');
			break
		case 23: //Southern Home
			ProductList.options[1] = new Option('Chili no Beans (10oz)', 'Chili no Beans (10oz)|.99-1.19');
			ProductList.options[2] = new Option('Chili no Beans (15oz)', 'Chili no Beans (15oz)|1.29-1.49');
			ProductList.options[3] = new Option('Chili with Beans (15oz)', 'Chili with Beans (15oz)|.79-1.19');
			ProductList.options[4] = new Option('Corned Beef Hash (15oz)', 'Corned Beef Hash (15oz)|1.19-1.59');
			break
		case 24: //Steak 'n Shake
			ProductList.options[1] = new Option('Chili with Beans (10oz)', 'Chili with Beans (10oz)|.99-1.29');
			break
		case 25: //Cattle Drive
			ProductList.options[1] = new Option('Beef Stew (6-pack/15oz)', 'Beef Stew (6-pack/15oz)|8.99-8.99');
			ProductList.options[2] = new Option('Chicken Chili with Beans (6-pack/15oz)', 'Chicken Chili with Beans (6-pack/15oz)|7.79-7.79');
			ProductList.options[3] = new Option('Chili no Beans (6-pack/15oz)', 'Chili no Beans (6-pack/15oz)|8.99-8.99');
			ProductList.options[4] = new Option('Chili with Beans (6-pack/15oz)', 'Chili with Beans (6-pack/15oz)|8.99-8.99');
			break
		case 26: //Firefighters
			ProductList.options[1] = new Option('Chicken Chili with Beans (15oz)', 'Chicken Chili with Beans (15oz)|1.49-1.49');
			ProductList.options[2] = new Option('Chili with Beans (15oz)', 'Chili with Beans (15oz)|1.49-1.49');
			ProductList.options[3] = new Option('Chili no Beans (15oz)', 'Chili no Beans (15oz)|1.49-1.49');
			break
	
	}
	
	UpdatePrice(row)

}

function UpdatePrice(row)	{

	ProductList = document.getElementById("product_" + row)
	PriceList = document.getElementById("price_" + row)

	PriceList.options.length = 0
	
	PriceRange = ProductList.value
	
	if (PriceRange=='')	{
		PriceList .options[0] = new Option('-', '0.00');		
		return false
	}
	
	PriceRange = PriceRange.split('|')[1]
	
	var iCount = -1
	for(i=parseFloat(PriceRange.split('-')[0]); i <= parseFloat(PriceRange.split('-')[1]); i = i + .10)	{
		iCount++
		PriceList.options[iCount] = new Option(CurrencyFormatted(i), CurrencyFormatted(i));		
		}
	if (parseFloat(PriceList.options[iCount].value) < parseFloat(PriceRange.split('-')[1]))	{
		iCount++
		PriceList.options[iCount] = new Option(CurrencyFormatted(parseFloat(PriceRange.split('-')[1])), CurrencyFormatted(parseFloat(PriceRange.split('-')[1])));		
		}
	

}


function MoreItems()	{

	TotalProducts  = parseInt(document.getElementById("TotalProducts").value)
	if (TotalProducts < 25)	{
		TotalProducts = TotalProducts + 1
		document.getElementById("productrow_" + TotalProducts).style.display=""
		document.getElementById("productrowB_" + TotalProducts).style.display=""
		}
	else	{
		window.alert('This form only allows for up to 5 products to be requested. You can submit an additional form if you need to submit more than 25 separate products.')
		}
	document.getElementById("TotalProducts").value = TotalProducts
}

function CalcTotal()	{
	var TotalRefunded
	var TotalQuantity
	TotalRefunded = 0
	TotalQuantity = 0
	for (i = 1; i < 26; i++)	{
		if(document.getElementById("quantity_" + i).value != '')	{
			TotalRefunded = TotalRefunded  + (document.getElementById("quantity_" + i).value * document.getElementById("price_" + i).value)
			TotalQuantity = TotalQuantity + parseInt(document.getElementById("quantity_" + i).value)
		}	
	}
	document.getElementById("TotalRefunded").innerHTML = '$' + CurrencyFormatted(TotalRefunded)
	if (TotalQuantity > 5)	{
		window.alert('You can submit a refund request for up to 5 products per household without proof of purchase.  If you would like to obtain refund for more than 5 products, please send your request along with proof of purchase along with your Social Security number (for verification) to: Castleberry’s Food Company Recall Refund, P.O. Box 85362, San Diego, CA, 92186-5362')
		return false;
		}
	else	{
		return true;
		}
	
}

function CurrencyFormatted(amount)
{
	var i = parseFloat(amount);
	if(isNaN(i)) { i = 0.00; }
	var minus = '';
	if(i < 0) { minus = '-'; }
	i = Math.abs(i);
	i = parseInt((i + .005) * 100);
	i = i / 100;
	s = new String(i);
	if(s.indexOf('.') < 0) { s += '.00'; }
	if(s.indexOf('.') == (s.length - 2)) { s += '0'; }
	s = minus + s;
	return s;
}


function CheckRefundForm() 
{

	var fm = window.document.form1
	
	//if (!CalcTotal())	{
	//	return false;
	//}
	
	if(fm.FirstName.value == "")
	{
		alert("Please enter your first name");
		fm.FirstName.focus();
		return (false);
   	}
	
	if(fm.LastName.value == "")
	{
		alert("Please enter your last name");
		fm.LastName.focus();
		return (false);
   	}

	if(fm.StreetNumber.value == "")
	{
		alert("Please enter your street number");
		fm.StreetNumber.focus();
		return (false);
   	}
	
	if(fm.StreetName.value == "")
	{
		alert("Please enter your street name");
		fm.StreetName.focus();
		return (false);
   	}

	//if(fm.StreetSuffix.value == "")
	//{
	//	alert("Please enter your street suffix (i.e. St., Rd., Ave.)");
	//	fm.StreetSuffix.focus();
	//	return (false);
   	//}
   	
   	if (fm.StreetName.value.toUpperCase().replace(".","").indexOf("PO BOX") >= 0 || fm.StreetName.value.toUpperCase().replace(".","").indexOf("POBOX")  >= 0 || fm.StreetSuffix.value.toUpperCase().replace(".","").indexOf("PO BOX") >= 0 || fm.StreetSuffix.value.toUpperCase().replace(".","").indexOf("POBOX") >= 0 || fm.Suite.value.toUpperCase().replace(".","").indexOf("PO BOX") >= 0 || fm.Suite.value.toUpperCase().replace(".","").indexOf("POBOX") >= 0)
   	{
   		alert("No PO BOX allowed.");
		fm.StreetName.focus();
		return (false);
   	}
	
	if(fm.City.value == "")
	{
		alert("Please enter your city");
		fm.City.focus();
		return (false);
   	}
	
	if (fm.State.value == "")
	{
		alert("Please select your state/province");
		fm.State.focus();
		return (false);
   	}
   	
   	    index = fm.State.selectedIndex

	if (fm.State.value.split(",")[1] == " CAN")
	{
		if(fm.ZipCode.value == "")
		{
			alert("Please enter your postal code");
			fm.ZipCode.focus();
			return (false);
		}
		
		zip=fm.ZipCode.value.toUpperCase();
		
		if (!zip.match(/^[A-Z][0-9][A-Z] [0-9][A-Z][0-9]$/))  {
			alert("Please enter 7 alpha numeric characters, including a space");
			fm.ZipCode.focus();
			return (false);
		}
	}
	else
	{
		if(fm.ZipCode.value.length != 5)
		{
			alert("Please enter your 5 digit zip code");
			fm.ZipCode.focus();
			return (false);
		}
	}
	
	if(fm.HomePhone.value.length != 12)
	{
		alert("Please enter your home phone # in the format 000-000-0000");
		fm.HomePhone.select();
		fm.HomePhone.focus();
		return (false);
	}

	if (fm.WorkPhone.value.length != 12)
	{
		alert("Please enter your work phone # in the format 000-000-0000");
		fm.WorkPhone.select();
		fm.WorkPhone.focus();
		return (false);
	}
	
	if (fm.Comments.value.length == "")
	{
		alert("Please enter your comments");
		fm.Comments.focus();
		return (false);
	}
	
	if(!isEmail(fm.EmailAddress.value))
	{
		alert("Please enter your e-mail address");
		fm.EmailAddress.focus();
		return (false);
	}
	
	else
	{
		return (true);
	}
}