// JavaScript Document

// JavaScript Document
var habitus={};

function Habitus(height,normal,normalplus,twentyfive,fifty,seventyfive) {
	this.height = height;
	this.normal = normal;
	this.normalplus = normalplus;
	this.twentyfive = twentyfive;
	this.fifty = fifty;
	this.seventyfive = seventyfive;
	this.PrintHabitus = PrintHabitus;
}

function PrintHabitus() {
	line1 = this.height +"     "+ this.normalplus +"     "+ this.twentyfive +"     "+ this.fifty +"     "+ this.seventyfive + "<br>\n";
	document.write(line1);
}
	
function checkhref1() {
				//alert("cat1");
				var a1 = document.getElementById("ecommerce");
				a1.setAttribute("href","http://www.babies-by-levin.com/ecommerce_cat1.htm");
						var a2 = document.getElementById("creditcards");
						a2.setAttribute("src","http://www.babies-by-levin.com/images/card_group.gif");
						a2.setAttribute("width","207");
						a2.setAttribute("height","33");
				
				var a3 = document.getElementById("loancommerce");
				a3.setAttribute("href","http://www.babies-by-levin.com/loan_company_cat1.htm");
						var a4 = document.getElementById("loan_options");
						a4.setAttribute("src","http://www.babies-by-levin.com/images/loan_options.gif");
						a4.setAttribute("width","104");
						a4.setAttribute("height","33");
						
				var a7 = document.getElementById("prepaycommerce");
				a7.setAttribute("href","http://www.babies-by-levin.com/pdf_forms/prepay24_nl_percent.pdf");
						var a8 = document.getElementById("prepay_option");
						a8.setAttribute("src","http://www.babies-by-levin.com/images/prepay_option.gif");
						a8.setAttribute("width","104");
						a8.setAttribute("height","33");	
			
				var a5 = document.getElementById("financeideas");
				a5.setAttribute("href","http://www.babies-by-levin.com/finance.htm");
						var a6 = document.getElementById("finance_options");
						a6.setAttribute("src","http://www.babies-by-levin.com/images/finance_options.gif");
						a6.setAttribute("width","104");
						a6.setAttribute("height","33");
						
									
}

function checkhref2() {
				//alert("cat2");
				var a1 = document.getElementById("ecommerce");
				a1.setAttribute("href","http://www.babies-by-levin.com/ecommerce_cat2.htm");
						var a2 = document.getElementById("creditcards");
						a2.setAttribute("src","http://www.babies-by-levin.com/images/card_group.gif");
						a2.setAttribute("width","207");
						a2.setAttribute("height","33");
				
				var a3 = document.getElementById("loancommerce");
				a3.setAttribute("href","http://www.babies-by-levin.com/loan_company_cat2.htm");
						var a4 = document.getElementById("loan_options");
						a4.setAttribute("src","http://www.babies-by-levin.com/images/loan_options.gif");
						a4.setAttribute("width","104");
						a4.setAttribute("height","33");
						
				var a7 = document.getElementById("prepaycommerce");
				a7.setAttribute("href","http://www.babies-by-levin.com/pdf_forms/prepay24_25over.pdf");
						var a8 = document.getElementById("prepay_option");
						a8.setAttribute("src","http://www.babies-by-levin.com/images/prepay_option.gif");
						a8.setAttribute("width","104");
						a8.setAttribute("height","33");							
			
				var a5 = document.getElementById("financeideas");
				a5.setAttribute("href","http://www.babies-by-levin.com/finance.htm");
						var a6 = document.getElementById("finance_options");
						a6.setAttribute("src","http://www.babies-by-levin.com/images/finance_options.gif");
						a6.setAttribute("width","104");
						a6.setAttribute("height","33");
}

function checkhref3() {
				//alert("cat3");
				var a1 = document.getElementById("ecommerce");
				a1.setAttribute("href","http://www.babies-by-levin.com/ecommerce_cat3.htm");
						var a2 = document.getElementById("creditcards");
						a2.setAttribute("src","http://www.babies-by-levin.com/images/card_group.gif");
						a2.setAttribute("width","207");
						a2.setAttribute("height","33");
				
				var a3 = document.getElementById("loancommerce");
				a3.setAttribute("href","http://www.babies-by-levin.com/loan_company_cat3.htm");
						var a4 = document.getElementById("loan_options");
						a4.setAttribute("src","http://www.babies-by-levin.com/images/loan_options.gif");
						a4.setAttribute("width","104");
						a4.setAttribute("height","33");
						
				var a7 = document.getElementById("prepaycommerce");
				a7.setAttribute("href","http://www.babies-by-levin.com/pdf_forms/prepay24_50over.pdf");
						var a8 = document.getElementById("prepay_option");
						a8.setAttribute("src","http://www.babies-by-levin.com/images/prepay_option.gif");
						a8.setAttribute("width","104");
						a8.setAttribute("height","33");							
			
				var a5 = document.getElementById("financeideas");
				a5.setAttribute("href","http://www.babies-by-levin.com/finance.htm");
						var a6 = document.getElementById("finance_options");
						a6.setAttribute("src","http://www.babies-by-levin.com/images/finance_options.gif");
						a6.setAttribute("width","104");
						a6.setAttribute("height","33");
}

function checkhref4() {
				//alert("cat4");
				var a1 = document.getElementById("ecommerce");
				a1.setAttribute("href","http://www.babies-by-levin.com/ecommerce_cat3.htm");
						var a2 = document.getElementById("creditcards");
						a2.setAttribute("src","http://www.babies-by-levin.com/images/spacer.gif");
						a2.setAttribute("width","1");
						a2.setAttribute("height","1");
				
				var a3 = document.getElementById("loancommerce");
				a3.setAttribute("href","http://www.babies-by-levin.com/loan_company_cat3.htm");
						var a4 = document.getElementById("loan_options");
						a4.setAttribute("src","http://www.babies-by-levin.com/images/spacer.gif");
						a4.setAttribute("width","1");
						a4.setAttribute("height","1");
						
				var a7 = document.getElementById("prepaycommerce");
				a7.setAttribute("href","http://www.babies-by-levin.com/pdf_forms/prepay24_50over.pdf");
						var a8 = document.getElementById("prepay_option");
						a8.setAttribute("src","http://www.babies-by-levin.com/images/spacer.gif");
						a8.setAttribute("width","1");
						a8.setAttribute("height","1");									
			
				var a5 = document.getElementById("financeideas");
				a5.setAttribute("href","http://www.babies-by-levin.com/finance.htm");
						var a6 = document.getElementById("finance_options");
						a6.setAttribute("src","http://www.babies-by-levin.com/images/spacer.gif");
						a6.setAttribute("width","1");
						a6.setAttribute("height","1");
}


function Price(height,weight) {
	var tall = 0, pounds = 0, normal = 0, normalplus = 0, twentyfive = 0, fifty = 0, seventyfive = 0;
	var tall = height.value;
	var pounds = weight.value;
	var normal = habitus[tall].normal;
	var normalplus = habitus[tall].normalplus;	
	var twentyfive = habitus[tall].twentyfive;
	var fifty = habitus[tall].fifty;
	var seventyfive = habitus[tall].seventyfive;
	
	
	/*if (pounds == habitus[tall].normal) {
		alert("pounds is a number");
	}
		else alert("pounds is a string");
	*/
	
	
	switch(tall) {
	case tall:
		if (pounds<twentyfive) {
			cost = "$6,200.00 is our current fee for your reversal procedure.  If your weight goes above "+ (twentyfive-1) + ", the fee will go up to $7,200.00 so be careful not to exceed that weight.  Click on your choice of payment options below to start your new baby journey!";
			checkhref1();
		}
		else if (pounds>=(twentyfive) && pounds<(fifty)) {
			cost = "$7,200.00 is our current fee for your reversal procedure.  If your weight goes above "+ (fifty-1) + ", the fee will go up to $9,000.00 so be careful not to exceed that weight.  If your weight goes below " + (twentyfive) + " then the fee for the procedure will fall to $6,200.00.  Click on your choice of payment options below to start your new baby journey!"; 
			checkhref2();			
		}
		else if ((pounds>=(twentyfive+1)) && (pounds<=(seventyfive-1))) {
			cost = "$9,000.00 is our current fee for your reversal procedure.  If your weight goes below "+ (fifty) + ", the fee will drop to $7,200.00.  If your weight goes above " + (seventyfive-1) + " then we will not perform the procedure so please be careful if you are near this weight.  Click on your choice of payment options below to start your new baby journey!"; 
			checkhref3();
		}
		else if (pounds>=(fifty+1)) {
			cost = "You are currently above the weight limit that we will schedule a reversal for your height.  Once you reduce your weight below " + (seventyfive) + " pounds you will be able to schedule your reversal procedure.  The various payment options would normally be shown below but we do not want you to pay by credit card or loan until you have lost your extra weight.  You may wish to study the various payment options on the PAYMENT PLAN page.  Please call 1-800-766-0304 and speak with my staff if you have any questions about this.";
			checkhref4();
		}
		else cost = "Please call 1-800-766-0304 for our current fee for your height and weight.  Thanks you!  Click on your choice of payment options below to start your new baby journey!";
		document.theweightform.costdescription.value = cost;
		break;
	default:
		alert("Script is messed up, please notify Dr. Levin at 800-766-0304");
		break;		
	}
	
}

habitus[58] = new Habitus(58,109,122,152,182,212);
habitus[59] = new Habitus(59,111,124,155,185,216);
habitus[60] = new Habitus(60,113,127,158,190,221);
habitus[61] = new Habitus(61,115,130,162,194,226);
habitus[62] = new Habitus(62,118,133,166,199,232);
habitus[63] = new Habitus(63,121,136,170,203,237);
habitus[64] = new Habitus(64,124,139,173,208,242);
habitus[65] = new Habitus(65,127,142,177,212,247);
habitus[66] = new Habitus(66,130,145,181,217,253);
habitus[67] = new Habitus(67,133,148,185,221,258);
habitus[68] = new Habitus(68,136,151,188,226,263);
habitus[69] = new Habitus(69,139,154,192,230,268);
habitus[70] = new Habitus(70,142,157,196,235,274);
habitus[71] = new Habitus(71,145,160,200,239,279);
habitus[72] = new Habitus(72,148,163,203,244,284);


/*for (i=58 ; i<=72 ; i++) {
	document.write(habitus[i].height +"    "+ habitus[i].normal +"    "+ habitus[i].normalplus +"    "+ habitus[i].twentyfive +"    "+ habitus[i].fifty  +"    "+ habitus[i].seventyfive +"<br>\n");
	
}
*/

/*for (var propt in habitus) {
	alert(propt);
		
		}
*/