<!--
function CalcBasicInputRights()
{
	var str = Sunday_Circ.value;
	var str2 = Total_Households.value;
	var strValidChars = "0123456789.";
	var strChar;
	
	str = str.replace(/,/g, "");
	str = str.replace(/%/g, "");
	str = str.replace(/$/g, "");
	str = str.replace(/-/g, "");

	if (Sunday_Circ.value == "")
		{
		alert("Please provide your current NDM Sunday Home Delivery Circulation before proceeding.");
		Sunday_Circ.focus();
		return false;
		}
	else
		{
		for (i = 0; i < str.length; i++)
		  {
		  strChar = str.charAt(i);
		  if (strValidChars.indexOf(strChar) == -1)
			 {
			 alert("Please provide only numeric values as your NDM Sunday Home Delivery Circulation input before proceeding.");
			 Sunday_Circ.focus();
			 return false;
			 }
		  }
		 }
	
	str2 = str2.replace(/,/g, "");
	str2 = str2.replace(/%/g, "");
	str2 = str2.replace(/$/g, "");
	str2 = str2.replace(/-/g, "");

	if (Total_Households.value == "")
		{
		alert("Please provide your current NDM Total Households before proceeding.");
		Total_Households.focus();
		return false;
		}
	else
		{
		for (i = 0; i < str2.length; i++)
		  {
		  strChar = str2.charAt(i);
		  if (strValidChars.indexOf(strChar) == -1)
			 {
			 alert("Please provide only numeric values as your NDM Total Households input before proceeding.");
			 Total_Households.focus();
			 return false;
			 }
		  }
		 }
		 
	Rec_Min.value = Comma(Math.round((str2-str) * 0.25));
	Rec_Rec.value = Comma(Math.round((str2-str) * 0.45));
	Rec_Max.value = Comma(Math.round((str2-str) * 0.65));
	return true;
}

function CalcProjectedInputs()
{
	var str = Response_Rate.value;
	if (Rec_Min.value == "" || Rec_Rec.value == "" || Rec_Max.value == "")
		{
		alert("Please enter your Sunday Home Delivery Circulation and Total Households and calculate our recommended values before trying to view your expected direct mail orders.");
		Rec_Min.focus();
		return false;
		}
	
	if (str == "")
		{
		alert("Please enter a projected response rate before proceeding.");
		Response_Rate.focus();
		return false;
		}
		
	str = str.replace(/,/g, "");
	str = str.replace(/%/g, "");
	str = str.replace(/$/g, "");
	str = str.replace(/-/g, "");
	var str_Rec_Min = Rec_Min.value;
	var str_Rec_Rec = Rec_Rec.value;
	var str_Rec_Max = Rec_Max.value;
	str_Rec_Min = str_Rec_Min.replace(/,/g, "");
	str_Rec_Rec = str_Rec_Rec.replace(/,/g, "");
	str_Rec_Max = str_Rec_Max.replace(/,/g, "");
	Exp_Min.value = Comma(Math.round(str_Rec_Min/100 * str));
	Exp_Rec.value = Comma(Math.round(str_Rec_Rec/100 * str));
	Exp_Max.value = Comma(Math.round(str_Rec_Max/100 * str));
	return true;
}
function Comma(number)
{
	number = '' + number;
	if (number.length > 3)
	{
		var mod = number.length % 3;
		var output = (mod > 0 ? (number.substring(0,mod)) : '');
		for (i=0 ; i < Math.floor(number.length / 3); i++)
		{
			if ((mod == 0) && (i == 0))
				output += number.substring(mod+ 3 * i, mod + 3 * i + 3);
			else
				output+= ',' + number.substring(mod + 3 * i, mod + 3 * i + 3);
		}
		return (output);
	}
	else return number;
}
//-->