	function quoteAmt() {
		if (document.frmQuote.Length.value == "") 
			Length = 0;
	    else
			Length = parseFloat(document.frmQuote.Length.value / 12);
			
		if (document.frmQuote.Width.value == "") 
			Width = 0;
	    else
			Width = parseFloat(document.frmQuote.Width.value / 12);
			
		TopSqrFt = Length * Width;
		LengthIn = parseFloat(document.frmQuote.Length.value);
		if (LengthIn > 237 ) 
			ShopWeld = 2;
		else if (LengthIn <= 237 && LengthIn >=117)
			ShopWeld = 1;
		else 
			ShopWeld = 0;
			
		if (Type != 3) {
			if (document.frmQuote.RearSplash[1].checked == true)
				RearSplash = 0;
		    else
				RearSplash = Length;	
	
			if (document.frmQuote.LSideSplash[1].checked == true) 
				LSideSplash = 0;
		    else
				LSideSplash = Width;	
					
			if (document.frmQuote.RSideSplash[1].checked == true) 
				RSideSplash = 0;
		    else
				RSideSplash = Width;					
		}
		else {
			RearSplash = 0;			
			LSideSplash = 0;
			RSideSplash = 0;	
		}
		
		if (document.frmQuote.SinkCut.value == "") 
			SinkCut = 0;
	    else
			SinkCut = parseFloat(document.frmQuote.SinkCut.value * Variable3);	
			
		if (document.frmQuote.StoveCutFlanges.value == "") 
			StoveCutFlanges = 0;
	    else
			StoveCutFlanges = parseFloat(document.frmQuote.StoveCutFlanges.value * Variable4);	
			
		if (document.frmQuote.StoveCut.value == "") 
			StoveCut = 0;
	    else
			StoveCut = parseFloat(document.frmQuote.StoveCut.value * Variable5);					
			
		if (Type == 2) {
			if (document.frmQuote.LSLength.value == "") 
				LSLength = 0;
	   	 	else
				LSLength = parseFloat(document.frmQuote.LSLength.value / 12);
				
			if (document.frmQuote.LSWidth.value == "") 
				LSWidth = 0;
		    else
				LSWidth = parseFloat(document.frmQuote.LSWidth.value / 12);				

			if (document.frmQuote.RearSplash2[1].checked == true)
				RearSplash2 = 0;
		    else 
				RearSplash2 = LSLength;	
				
			if (document.frmQuote.RSideSplash[1].checked == true)
				RSideSplash = 0;
		    else 
				RSideSplash = LSWidth;		
			
			LSLengthIn = parseFloat(document.frmQuote.LSLength.value);	
			if (LSLengthIn > 237 ) 
				ShopWeld2 = 2;
			else if (LSLengthIn <= 237 && LSLengthIn >=117)
				ShopWeld2 = 1;
			else 
				ShopWeld2 = 0;						
								
			WBLength = Length + LSLength;					
			TopSqrFt = (Length * Width) - (Width * LSWidth) + (LSLength * LSWidth) ;	
			LayOutCalcQ = 2;
			RipLengthQ = 2;
			RipBuildUpQ = 8;
			WidthCutQ = 2;	
			LShape = Variable20;
		}				
		else {
			WBLength = Length;
			LayOutCalcQ = 1;
			RipLengthQ = 1;
			RipBuildUpQ = 4;
			WidthCutQ = 1;				
			LShape = 0;	
			RearSplash2 = 0;
			ShopWeld2 = 0;
		}
		
		SmallSink = 0;
		MidSink = 0;
		LargeSink = 0;

		if (document.frmQuote.FirstSink.value != "No Sink Selected") {
			if (document.frmQuote.FirstSink.value == "13 x 14 x 8 Sink") 
				SmallSink = Variable6;
			if (document.frmQuote.FirstSink.value == "16 x 16 x 8 Sink") 
				SmallSink = Variable7;		
			if (document.frmQuote.FirstSink.value == "16 x 16 x 9 Sink") 
				SmallSink = Variable8;	
			if (document.frmQuote.FirstSink.value == "18 x 10 x 8 Sink") 
				SmallSink = Variable9;	
			if (document.frmQuote.FirstSink.value == "18 x 16 x 8 Sink") 
				SmallSink = Variable10;	
			if (document.frmQuote.FirstSink.value == "18 x 18 x 8 Sink") 
				SmallSink = Variable11;	
			if (document.frmQuote.FirstSink.value == "18 x 20 x 8 Sink") 
				SmallSink = Variable12;	
			if (document.frmQuote.FirstSink.value == "18 x 20 x 9 Sink") 
				SmallSink = Variable13;	
			if (document.frmQuote.FirstSink.value == "18 x 28 x 8 Sink") 
				SmallSink = Variable14;							
			if (document.frmQuote.FirstSink.value == "18 x 30 x 8 Sink") 
				SmallSink = Variable15;							
			if (document.frmQuote.FirstSink.value == "18 x 30 x 10 Sink") 
				SmallSink = Variable16;	
			if (document.frmQuote.FirstSink.value == "19 x 13 x 8 Sink") 
				SmallSink = Variable17;	
			if (document.frmQuote.FirstSink.value == "20 x 20 x 8 Sink") 
				SmallSink = Variable18;		
			if (document.frmQuote.FirstSink.value == "20 x 32 x 8 Sink") 
				SmallSink = Variable19;																																									
		}
		if (document.frmQuote.SecondSink.value != "No Sink Selected") {
			if (document.frmQuote.SecondSink.value == "13 x 14 x 8 Sink") 
				MidSink = Variable6;
			if (document.frmQuote.SecondSink.value == "16 x 16 x 8 Sink") 
				MidSink = Variable7;		
			if (document.frmQuote.SecondSink.value == "16 x 16 x 9 Sink") 
				MidSink = Variable8;	
			if (document.frmQuote.SecondSink.value == "18 x 10 x 8 Sink") 
				MidSink = Variable9;	
			if (document.frmQuote.SecondSink.value == "18 x 16 x 8 Sink") 
				MidSink = Variable10;	
			if (document.frmQuote.SecondSink.value == "18 x 18 x 8 Sink") 
				MidSink = Variable11;	
			if (document.frmQuote.SecondSink.value == "18 x 20 x 8 Sink") 
				MidSink = Variable12;	
			if (document.frmQuote.SecondSink.value == "18 x 20 x 9 Sink") 
				MidSink = Variable13;	
			if (document.frmQuote.SecondSink.value == "18 x 28 x 8 Sink") 
				MidSink = Variable14;							
			if (document.frmQuote.SecondSink.value == "18 x 30 x 8 Sink") 
				MidSink = Variable15;							
			if (document.frmQuote.SecondSink.value == "18 x 30 x 10 Sink") 
				MidSink = Variable16;	
			if (document.frmQuote.SecondSink.value == "19 x 13 x 8 Sink") 
				MidSink = Variable17;	
			if (document.frmQuote.SecondSink.value == "20 x 20 x 8 Sink") 
				MidSink = Variable18;		
			if (document.frmQuote.SecondSink.value == "20 x 32 x 8 Sink") 
				MidSink = Variable19;																																									
		}
		if (document.frmQuote.ThirdSink.value != "No Sink Selected") {
			if (document.frmQuote.ThirdSink.value == "13 x 14 x 8 Sink") 
				LargeSink = Variable6;
			if (document.frmQuote.ThirdSink.value == "16 x 16 x 8 Sink") 
				LargeSink = Variable7;		
			if (document.frmQuote.ThirdSink.value == "16 x 16 x 9 Sink") 
				LargeSink = Variable8;	
			if (document.frmQuote.ThirdSink.value == "18 x 10 x 8 Sink") 
				LargeSink = Variable9;	
			if (document.frmQuote.ThirdSink.value == "18 x 16 x 8 Sink") 
				LargeSink = Variable10;	
			if (document.frmQuote.ThirdSink.value == "18 x 18 x 8 Sink") 
				LargeSink = Variable11;	
			if (document.frmQuote.ThirdSink.value == "18 x 20 x 8 Sink") 
				LargeSink = Variable12;	
			if (document.frmQuote.ThirdSink.value == "18 x 20 x 9 Sink") 
				LargeSink = Variable13;	
			if (document.frmQuote.ThirdSink.value == "18 x 28 x 8 Sink") 
				LargeSink = Variable14;							
			if (document.frmQuote.ThirdSink.value == "18 x 30 x 8 Sink") 
				LargeSink = Variable15;							
			if (document.frmQuote.ThirdSink.value == "18 x 30 x 10 Sink") 
				LargeSink = Variable16;	
			if (document.frmQuote.ThirdSink.value == "19 x 13 x 8 Sink") 
				LargeSink = Variable17;	
			if (document.frmQuote.ThirdSink.value == "20 x 20 x 8 Sink") 
				LargeSink = Variable18;		
			if (document.frmQuote.ThirdSink.value == "20 x 32 x 8 Sink") 
				LargeSink = Variable19;																																									
		}				
		
		if (WBLength > 16)
			PartBlank = 3;
		else if (WBLength <= 16 && WBLength > 8)
			PartBlank = 2;
		else 
			PartBlank = 1;	
			
		//General Calc Variables
		Markup = 1 + Variable25;	
		DrawProg = Variable1;
		MoveWrap = Variable2;
		// orig : Quantity = parseInt(document.frmQuote.Qty.value);
		Quantity = 1;
		PriceTopSqrFt = TopSqrFt * Variable26;
		ShopWeld = ShopWeld * Variable21;
		ShopWeld2 = ShopWeld2 * Variable21;
		RearSplash = RearSplash * Variable22;
		RearSplash2 = RearSplash2 * Variable22;
		LSideSplash = LSideSplash * Variable23;
		RSideSplash = RSideSplash * Variable23;
		SmallSink = SmallSink * parseInt(document.frmQuote.FirstSinkQty.value);
		MidSink = MidSink * parseInt(document.frmQuote.SecondSinkQty.value);
		LargeSink = LargeSink * parseInt(document.frmQuote.ThirdSinkQty.value);
		Tooling = Length * Width * Variable27;
		
		if (document.frmQuote.backer[0].checked == true) {
		//Material Variables
		TotalPPSheet = PartBlank * 1;
		ExactSheets = Quantity * TotalPPSheet;
		FullSheets = Math.round(ExactSheets);
		MaterialCost = FullSheets * Variable24;	
		
		//Wood Backer Variables
		LayoutCalc = LayOutCalcQ * Variable29 * Variable28; 
		SawLengthCut = Variable31 * Variable30; 
		RipLength = RipLengthQ * Variable33 * Variable32;  // Double Up 
		SawStrips = Variable35 * Variable34;  
		RipBuildUp = RipBuildUpQ * Variable37 * Variable36;  // Double Up
		SawWidthCut = Variable39 * Variable38;
		WidthCut = WidthCutQ * Variable41 * Variable40;  // Double Up
			
		//WBLabor Variables
		if (document.frmQuote.SecondSink.value != "No Sink Selected" || document.frmQuote.FirstSink.value != "No Sink Selected" || document.frmQuote.ThirdSink.value != "No Sink Selected") {
		SinkCutoutDrill = Variable43 * Variable42;  // Double Up 
		//SinkCutoutDrill = 0;
		SinkCutoutLayout = Variable45 * Variable44;  // Double Up
		//SinkCutoutLayout = 0;
		SinkCutoutBowl = Variable47 * Variable46;  // Double Up
		//SinkCutoutBowl = 0;
		SinkTotal = parseInt(document.frmQuote.FirstSinkQty.value) + parseInt(document.frmQuote.SecondSinkQty.value) + parseInt(document.frmQuote.ThirdSinkQty.value);
		//SinkTotal = 0;
		SinkCutoutTotal = SinkTotal * (SinkCutoutDrill + SinkCutoutLayout + SinkCutoutBowl);
		}
		else
		{ SinkCutoutTotal = 0; }
		

  if (document.frmQuote.StoveCut.value != 0 || document.frmQuote.StoveCutFlanges.value != 0 || document.frmQuote.SinkCut.value != 0) {
		SinkCutoutDrill2 = Variable43 * Variable42;  // Double Up 
		//SinkCutoutDrill = 0;
		SinkCutoutLayout2 = Variable45 * Variable44;  // Double Up
		//SinkCutoutLayout = 0;
		SinkCutoutBowl2 = Variable47 * Variable46;  // Double Up
		//SinkCutoutBowl = 0;
		SinkTotal2 = parseInt(document.frmQuote.SinkCut.value) + parseInt(document.frmQuote.StoveCutFlanges.value) + parseInt(document.frmQuote.StoveCut.value);
		//SinkTotal = 0;
		SinkCutoutTotal2 = SinkTotal2 * (SinkCutoutDrill2 + SinkCutoutLayout2 + SinkCutoutBowl2);
		}
		else
		{ SinkCutoutTotal2 = 0; }


		SetupGlue = Variable49 * Variable48;
		GlueWood = Variable51 * WBLength * Variable50   // Double Up
		Move = 2 * Variable53 * Variable52;  // Double Up
		WBLaborI = LayoutCalc + SawLengthCut + SawWidthCut + SetupGlue + SawStrips;
		WBLaborII = RipLength + RipBuildUp + WidthCut + GlueWood + Move + SinkCutoutTotal + SinkCutoutTotal2;
		WBLaborIII = RipLength + RipBuildUp + WidthCut + GlueWood + Move;
				
		//Outside Sources Variables
		OSGlue = WBLength * .5 * Variable54;
		OSTooling = ExactSheets * Variable55;
		OSCost = OSGlue + OSTooling;

		}
		else {
		WBLaborI = 0;
		WBLaborII = 0;
		WBLaborIII = 0;
		OSTooling = 0;
		OSGlue = 0;
		MaterialCost = 0;
		}
		
		Cost = (Markup * (DrawProg + WBLaborI + OSTooling + MaterialCost + (Quantity * (LShape + OSGlue + WBLaborII + Tooling + MoveWrap + PriceTopSqrFt + RearSplash + RearSplash2 + LSideSplash + RSideSplash + SmallSink + MidSink + LargeSink + SinkCut + StoveCutFlanges + StoveCut + ShopWeld + ShopWeld2)))) / Quantity;
		Cost2= (Markup * (DrawProg + WBLaborI + OSTooling + MaterialCost + (Quantity * (LShape + OSGlue + WBLaborIII + Tooling + MoveWrap + PriceTopSqrFt + ShopWeld + ShopWeld2 )))) / Quantity;
		
		if (TopSqrFt > 0) {
			document.frmQuote.BudgetCost.value = roundIt(Cost, 2);
			document.frmQuote.LinearFoot.value = roundIt(Cost2 / Length, 2);
			document.frmQuote.SquareFoot.value = roundIt(Cost2 / TopSqrFt, 2);
		}
		//document.frmQuote.Test.value = roundIt(WBLaborI, 2);
		//Length + Width + LSLength + LSWidth
		//TopSqrFt
		//ShopWeld
		//MidSink + LargeSink + SinkCut + StoveCutFlanges + StoveCut + ShopWeld + ShopWeld2 + MoveWrap + PriceTopSqrFt + RearSplash + LSideSplash + RSideSplash + SmallSink + LShape + DrawProg + RearSplash2
		//MaterialCost + OSCost + WBLaborI + WBLaborII
	}
	function roundIt(Num, Places) {
	   if (Places > 0) {
	      if ((Num.toString().length - Num.toString().lastIndexOf('.')) > (Places + 1)) {
	         var Rounder = Math.pow(10, Places);
	         return Math.round(Num * Rounder) / Rounder;
	      }
	      else return Num;
	   }
	   else return Math.round(Num);
	}	
