// JavaScript Document
function doCalc() {
var amount, premium, valid;
valid = "true";
amount = document.forms[0].amount.value;

amount = parseFloat(filterNum(amount));

	if (amount < 15001) {
		premium = 310.00;
		
	} 
	else if (amount < 20001) {
		premium = 334.00;
		
	} 
	else if (amount < 25001) {
		premium = 363.00;
		
	} 
	else if (amount < 30001) {
		premium = 382.00;
		
	} 
	else if (amount < 35001) {
		premium = 406.00;
		
	} 
	else if (amount < 40001) {
		premium = 425.00;
		
	} 
	else if (amount < 45001) {
		premium = 440.00;
		
	} 
	else if (amount < 50001) {
		premium = 457.00;
		
	} 
	else if (amount < 55001) {
		premium = 473.00;
		
	} 
	else if (amount < 60001) {
		premium = 489.00;
		
	} 
	else if (amount < 65001) {
		premium = 505.00;
		
	} 
	else if (amount < 70001) {
		premium = 520.00;
		
	} 
	else if (amount < 75001) {
		premium = 535.00;
		
	} 
	else if (amount < 80001) {
		premium = 550.00;
		
	} 
	else if (amount < 85001) {
		premium = 563.00;
		
	} 
	else if (amount < 90001) {
		premium = 576.00;
		
	} 
	else if (amount < 95001) {
		premium = 589.00;
		
	} 
	else if (amount < 100001) {
		premium = 599.00;
		
	} 
	else if (amount < 105001) {
		premium = 609.00;
		
	} 
	else if (amount < 110001) {
		premium = 619.00;
		
	} 
	else if (amount < 115001) {
		premium = 629.00;
		
	} 
	else if (amount < 120001) {
		premium = 639.00;
		
	} 
	else if (amount < 125001) {
		premium = 649.00;
		
	} 
	else if (amount < 130001) {
		premium = 659.00;
		
	} 
	else if (amount < 135001) {
		premium = 669.00;
		
	} 
	else if (amount < 140001) {
		premium = 679.00;
		
	} 
	else if (amount < 145001) {
		premium = 689.00;
		
	} 
	else if (amount < 150001) {
		premium = 699.00;
		
	} 
	else if (amount < 155001) {
		premium = 709.00;
		
	} 
	else if (amount < 160001) {
		premium = 719.00;
		
	} 
	else if (amount < 165001) {
		premium = 729.00;
		
	} 
	else if (amount < 170001) {
		premium = 739.00;
		
	} 
	else if (amount < 175001) {
		premium = 749.00;
		
	} 
	else if (amount < 180001) {
		premium = 759.00;
		
	} 
	else if (amount < 185001) {
		premium = 769.00;
		
	} 
	else if (amount < 190001) {
		premium = 779.00;
		
	} 
	else if (amount < 195001) {
		premium = 789.00;
		
	} 
	else if (amount < 200001) {
		premium = 799.00;
		
	} 
	else if (amount < 205001) {
		premium = 809.00;
		
	} 
	else if (amount < 210001) {
		premium = 819.00;
		
	} 
	else if (amount < 215001) {
		premium = 829.00;
		
	} 
	else if (amount < 220001) {
		premium = 839.00;
		
	} 
	else if (amount < 225001) {
		premium = 849.00;
		
	} 
	else if (amount < 230001) {
		premium = 859.00;
		
	} 
	else if (amount < 235001) {
		premium = 869.00;
		
	} 
	else if (amount < 240001) {
		premium = 879.00;
		
	} 
	else if (amount < 245001) {
		premium = 889.00;
		
	} 
	else if (amount < 250001) {
		premium = 899.00;
		
	} 
	else if (amount < 255001) {
		premium = 909.00;
		
	} 
	else if (amount < 260001) {
		premium = 919.00;
	} 
	
	else if (amount < 265001) {
		premium = 929.00;
		
	} 
	else if (amount < 270001) {
		premium = 939.00;
		
	} 
	else if (amount < 275001) {
		premium = 949.00;
		
	} 
	else if (amount < 280001) {
		premium = 959.00;
		
	} 
	else if (amount < 285001) {
		premium = 969.00;
		
	} 
	else if (amount < 290001) {
		premium = 979.00;
		
	} 
	else if (amount < 295001) {
		premium = 989.00;
		
	} 
	else if (amount < 300001) {
		premium = 999.00;
		
	} 
	else if (amount < 305001) {
		premium = 1015.00;
		
	} 
	else if (amount < 310001) {
		premium = 1031.00;
		
	} 
	else if (amount < 315001) {
		premium = 1047.00;
		
	} 
	else if (amount < 320001) {
		premium = 1064.00;
		
	} 
	else if (amount < 325001) {
		premium = 1080.00;
		
	} 
	else if (amount < 330001) {
		premium = 1096.00;
		
	} 
	else if (amount < 335001) {
		premium = 1112.00;
		
	} 
	else if (amount < 340001) {
		premium = 1129.00;
		
	} 
	else if (amount < 345001) {
		premium = 1145.00;
		
	} 
	else if (amount < 350001) {
		premium = 1161.00;
		
	} 
	else if (amount < 355001) {
		premium = 1177.00;
		
	} 
	else if (amount < 360001) {
		premium = 1194.00;
		
	} 
	else if (amount < 365001) {
		premium = 1210.00;
		
	} 
	else if (amount < 370001) {
		premium = 1231.00;
		
	} 
	else if (amount < 375001) {
		premium = 1242.00;
		
	} 
	else if (amount < 380001) {
		premium = 1259.00;
		
	} 
	else if (amount < 385001) {
		premium = 1275.00;
		
	} 
	else if (amount < 390001) {
		premium = 1291.00;
		
	} 
	else if (amount < 395001) {
		premium = 1307.00;
		
	} 
	else if (amount < 400001) {
		premium = 1324.00;
		
	} 
	else if (amount < 405001) {
		premium = 1340.00;
		
	} 
	else if (amount < 410001) {
		premium = 1356.00;
		
	} 
	else if (amount < 415001) {
		premium = 1372.00;
		
	} 
	else if (amount < 420001) {
		premium = 1389.00;
		
	} 
	else if (amount < 425001) {
		premium = 1405.00;
		
	} 
	else if (amount < 430001) {
		premium = 1421.00;
		
	} 
	else if (amount < 435001) {
		premium = 1437.00;
		
	} 
	else if (amount < 440001) {
		premium = 1454.00;
		
	} 
	else if (amount < 445001) {
		premium = 1470.00;
		
	} 
	else if (amount < 450001) {
		premium = 1486.00;
		
	} 
	else if (amount < 455001) {
		premium = 1502.00;
		
	} 
	else if (amount < 460001) {
		premium = 1519.00;
		
	} 
	else if (amount < 465001) {
		premium = 1535.00;
		
	} 
	else if (amount < 470001) {
		premium = 1551.00;
		
	} 
	else if (amount < 475001) {
		premium = 1567.00;
		
	} 
	else if (amount < 480001) {
		premium = 1584.00;
		
	} 
	else if (amount < 485001) {
		premium = 1600.00;
		
	} 
	else if (amount < 490001) {
		premium = 1616.00;
		
	} 
	else if (amount < 495001) {
		premium = 1632.00;
		
	} 
	else if (amount < 500001) {
		premium = 1649.00;
		
	} 
	else if (amount > 500000) {
		if (amount < 800001) {
		var tmp;
		tmp = amount - 500000;
		tmp = tmp / 1000;
		tmp = Math.ceil(tmp)
		tmp = tmp * 2;
		premium = 1649 + tmp;
		}
		else {
		premium = "Please call for rate........"
		}
	} 	
	else {
		alert("Invialid Policy Amount");
		premium = "";
		valid = "false";
		document.forms[0].amount.select();
	}
if (valid = "true") {
premium = premium+'.00'
}
document.forms[0].premium.value = premium
}
//Checks if characters are valid integers
// Filters dollar signs
function filterNum(str) {
	re = /^\$|,/g;                 	// remove "$" and ","
	return str.replace(re, "");
}