function moshnost() <!-- raschet moshnosti -->
{
var ploshad= Number(document.form1.plosh.value)
var mosh = 0
var ostatok = 0

var komfortny = new Array (5)
komfortny[0] = 200;
komfortny[1] = 150;
komfortny[2] = 120;
komfortny[3] = 130;
komfortny[4] = 120;

var osnovnoy = new Array (5)
osnovnoy[0] = 250;
osnovnoy[1] = 250;
osnovnoy[2] = 200;
osnovnoy[3] = 250;
osnovnoy[4] = 200;

planobogr = document.form1.planobogrev.selectedIndex <!--?? ????? ???? ???????? ??????????-????????  -->
tippom    =  document.form1.tippomesh.selectedIndex <!--?? ????? ??? ????????? - ?????-???????-???  -->

if (planobogr == 0) 
{
mosh = ploshad*komfortny[document.form1.tippomesh.selectedIndex]
}
else 
{
mosh = ploshad*osnovnoy[document.form1.tippomesh.selectedIndex]
}

ostatok = (mosh%100)

if (ostatok == 0)
{}
else {mosh = mosh - ostatok + 100}


return mosh

}

function kolch() <!-- schit kolichestvo celih chastey kabelya-->
{
var tipkabf = document.form1.tipk.selectedIndex
var moshn = moshnost()
var kol = 1

if ( tipkabf == 0){if (moshn < 2400) {} else { kol = Math.ceil(moshn/2400)}}
 else { if (tipkabf == 1) {if (moshn < 1400) {} else { kol = Math.ceil(moshn/1400)}}
  else {if (tipkabf == 2) {if (moshn < 2200) {} else { kol = Math.ceil(moshn/2200)}}
    else {if (moshn < 2100) {} else { kol = Math.ceil(moshn/2100)}}}}

return kol
}


function celmosh()<!-- celoe kolichestvo moshnostey-->
{
var moshn = moshnost()
var kol = kolch()
var ostatok = 0
moshn = moshn/kol

ostatok = (moshn%100)

if (ostatok == 0)
{}
else {moshn = moshn - ostatok + 100}

return moshn
}




function tipkab() <!-- vibor tipa kabela -->
{
var i = 0
var tip = 0

var tipkab0 = new Array(17)
tipkab0[0] = " TK-180";
tipkab0[1] = " TK-250";
tipkab0[2] = " TK-300";
tipkab0[3] = " TK-400";
tipkab0[4] = " TK-600";
tipkab0[5] = " TK-800";
tipkab0[6] = " TK-900";
tipkab0[7] = " TK-1000";
tipkab0[8] = " TK-1100";
tipkab0[9] = " TK-1200";
tipkab0[10] = " TK-1300";
tipkab0[11] = " TK-1400";
tipkab0[12] = " TK-1800";
tipkab0[13] = " TK-1900";
tipkab0[14] = " TK-2100";
tipkab0[15] = " TK-2200";
tipkab0[16] = " TK-2400";


var tipkab1 = new Array(10)
tipkab1[0] = " tkd-150 ";
tipkab1[1] = " tkd-200 ";
tipkab1[2] = " tkd-350 ";
tipkab1[3] = " tkd-500 ";
tipkab1[4] = " tkd-700 ";
tipkab1[5] = " tkd-800 ";
tipkab1[6] = " tkd-900 ";
tipkab1[7] = " tkd-1000 ";
tipkab1[8] = " tkd-1200 ";
tipkab1[9] = " tkd-1400 ";

var tipkab2 = new Array(11)
tipkab2[0] = " TXPL/1-275/300 ";
tipkab2[1] = " TXPL/1-365/400 ";
tipkab2[2] = " TXPL/1-460/500 ";
tipkab2[3] = " TXPL/1-640/700 ";
tipkab2[4] = " TXPL/1-550/600 ";
tipkab2[5] = " TXPL/1-780/850 ";
tipkab2[6] = " TXPL/1-915/1000 ";
tipkab2[7] = " TXPL/1-1145/1250 ";
tipkab2[8] = " TXPL/1-1280/1400 ";
tipkab2[9] = " TXPL/1-1600/1750 ";
tipkab2[10] = " TXPL/1-2015/2200 ";

var tipkab3 = new Array(11)
tipkab3[0] = " TXPL/2R-280/300 ";
tipkab3[1] = " TXPL/2R-365/400 ";
tipkab3[2] = " TXPL/2R-460/500 ";
tipkab3[3] = " TXPL/2R-550/600 ";
tipkab3[4] = " TXPL/2R-640/700 ";
tipkab3[5] = " TXPL/2R-770/840 ";
tipkab3[6] = " TXPL/2R-910/1000 ";
tipkab3[7] = " TXPL/2R-1130/1250 ";
tipkab3[8] = " TXPL/2R-1260/1370 ";
tipkab3[9] = " TXPL/2R-1550/1700 ";
tipkab3[10] = " TXPL/2R-1925/2100 ";


mosh1 = celmosh()
tipkabf = document.form1.tipk.selectedIndex



if (tipkabf == 0)
{
if (mosh1 == 100) { i = 0} 
   else { if (mosh1 == 250) { i = 1 } 
    else { if (mosh1 == 300) { i = 2}
	 else { if (mosh1 == 400) { i = 3}
	   else { if (mosh1 == 500) { i = 4}
	     else { if (mosh1 == 600) { i = 4}
		  else { if (mosh1 == 700) { i = 5}
		   else { if (mosh1 == 800) { i = 5}
		    else { if (mosh1 == 900) { i = 6}
			 else { if (mosh1 == 1000) { i = 7}
			  else { if (mosh1 == 1100) { i = 8}
			   else { if (mosh1 == 1200) { i = 9}
			    else { if (mosh1 == 1300) { i = 10}
				 else { if (mosh1 == 1400) { i = 11}
				  else { if (mosh1 == 1500) { i = 12}
				   else { if (mosh1 == 1600) { i = 12}
				    else { if (mosh1 == 1700) { i = 12}
					 else { if (mosh1 == 1800) { i = 12}
					  else { if (mosh1 == 1900) { i = 13}
					   else { if (mosh1 == 2000) { i = 14}
					    else { if (mosh1 == 2100) { i = 14}
						 else { if (mosh1 == 2200) { i = 15}
						  else { if (mosh1 > 2200) { i = 16}
						 }}}}}}}}}}}}}}}}}}}}}}
tip = tipkab0[i]						 
						  
}
else
{if (tipkabf == 1)
{
if (mosh1 == 100) { i = 0} 
   else { if (mosh1 == 200) { i = 1 } 
    else { if (mosh1 == 300) { i = 2}
	 else { if (mosh1 == 400) { i = 3}
	   else { if (mosh1 == 500) { i = 3}
	     else { if (mosh1 == 600) { i = 4}
		  else { if (mosh1 == 700) { i = 4}
		   else { if (mosh1 == 800) { i = 5}
		    else { if (mosh1 == 900) { i = 6}
			 else { if (mosh1 == 1000) { i = 7}
			  else { if (mosh1 == 1100) { i = 8}
			   else { if (mosh1 == 1200) { i = 8}
			    else { if (mosh1 == 1300) { i = 9}
				 else { if (mosh1 >= 1400) { i = 9}}}}}}}}}}}}}}
tip = tipkab1[i]
}	else { if (tipkabf == 2)
{
if (mosh1 == 100) { i = 0} 
   else { if (mosh1 == 200) { i = 0 } 
    else { if (mosh1 == 300) { i = 0}
	 else { if (mosh1 == 400) { i = 1}
	   else { if (mosh1 == 500) { i = 2}
	     else { if (mosh1 == 600) { i = 3}
		  else { if (mosh1 == 700) { i = 4}
		   else { if (mosh1 == 800) { i = 5}
		    else { if (mosh1 == 900) { i = 6}
			 else { if (mosh1 == 1000) { i = 6}
			  else { if (mosh1 == 1100) { i = 7}
			   else { if (mosh1 == 1200) { i = 7}
			    else { if (mosh1 == 1300) { i = 8}
				 else { if (mosh1 == 1400) { i = 8}
				  else { if (mosh1 == 1500) { i = 9}
				   else { if (mosh1 == 1600) { i = 9}
				    else { if (mosh1 == 1700) { i = 9}
					 else { if (mosh1 == 1800) { i = 10}
					  else { if (mosh1 == 1900) { i = 10}
					   else { if (mosh1 == 2000) { i = 10}
					    else { if (mosh1 == 2100) { i = 10}
						 else { if (mosh1 == 2200) { i = 10}
						  else { if (mosh1 > 2200) { i = 10}
						 }}}}}}}}}}}}}}}}}}}}}}
tip = tipkab2[i]	
}



else {
if (mosh1 == 100) { i = 0} 
   else { if (mosh1 == 200) { i = 0 } 
    else { if (mosh1 == 300) { i = 0}
	 else { if (mosh1 == 400) { i = 1}
	   else { if (mosh1 == 500) { i = 2}
	     else { if (mosh1 == 600) { i = 3}
		  else { if (mosh1 == 700) { i = 4}
		   else { if (mosh1 == 800) { i = 5}
		    else { if (mosh1 == 900) { i = 6}
			 else { if (mosh1 == 1000) { i = 6}
			  else { if (mosh1 == 1100) { i = 7}
			   else { if (mosh1 == 1200) { i = 7}
			    else { if (mosh1 == 1300) { i = 8}
				 else { if (mosh1 == 1400) { i = 9}
				  else { if (mosh1 == 1500) { i = 9}
				   else { if (mosh1 == 1600) { i = 9}
				    else { if (mosh1 == 1700) { i = 9}
					 else { if (mosh1 == 1800) { i = 10}
					  else { if (mosh1 == 1900) { i = 10}
					   else { if (mosh1 == 2000) { i = 10}
					    else { if (mosh1 == 2100) { i = 10}
						 else { if (mosh1 == 2200) { i = 10}
						  else { if (mosh1 > 2200) { i = 10}
						 }}}}}}}}}}}}}}}}}}}}}}
tip = tipkab3[i]
}}				  
}



return tip
}


function stoimkab() <!-- raschet stoim kabela -->
{
var stoimkabel = 0
var i = 0
var cel = kolch()
var stoim0 = new Array(17)
stoim0[0] = 1350
stoim0[1] = 1550
stoim0[2] = 1650
stoim0[3] = 1800
stoim0[4] = 2000
stoim0[5] = 2650
stoim0[6] = 2950
stoim0[7] = 3250
stoim0[8] = 3650
stoim0[9] = 3900
stoim0[10] = 4250
stoim0[11] = 4550
stoim0[12] = 5950
stoim0[13] = 6200
stoim0[14] = 6900 
stoim0[15] = 7200
stoim0[16] = 7800

var stoim1 = new Array(10)
stoim1[0] = 1400
stoim1[1] = 1650
stoim1[2] = 2200
stoim1[3] = 2800
stoim1[4] = 3150
stoim1[5] = 3580
stoim1[6] = 3740
stoim1[7] = 4250
stoim1[8] = 4680
stoim1[9] = 5280

var stoim2 = new Array(11)
stoim2[0] = 2607
stoim2[1] = 2824
stoim2[2] = 3041
stoim2[3] = 3186
stoim2[4] = 3476
stoim2[5] = 4200
stoim2[6] = 4779
stoim2[7] = 5648
stoim2[8] = 6227
stoim2[9] = 7240
stoim2[10] = 8688

var stoim3 = new Array(11)
stoim3[0] = 3186
stoim3[1] = 3620
stoim3[2] = 4200
stoim3[3] = 4634
stoim3[4] = 5141
stoim3[5] = 5792
stoim3[6] = 6516
stoim3[7] = 7530
stoim3[8] = 8326
stoim3[9] = 9268
stoim3[10] = 11512

mosh1 = celmosh()
tipkabf = document.form1.tipk.selectedIndex

if (tipkabf == 0)
{
if (mosh1 == 100) { i = 0} 
   else { if (mosh1 == 250) { i = 1 } 
    else { if (mosh1 == 300) { i = 2}
	 else { if (mosh1 == 400) { i = 3}
	   else { if (mosh1 == 500) { i = 4}
	     else { if (mosh1 == 600) { i = 4}
		  else { if (mosh1 == 700) { i = 5}
		   else { if (mosh1 == 800) { i = 5}
		    else { if (mosh1 == 900) { i = 6}
			 else { if (mosh1 == 1000) { i = 7}
			  else { if (mosh1 == 1100) { i = 8}
			   else { if (mosh1 == 1200) { i = 9}
			    else { if (mosh1 == 1300) { i = 10}
				 else { if (mosh1 == 1400) { i = 11}
				  else { if (mosh1 == 1500) { i = 12}
				   else { if (mosh1 == 1600) { i = 12}
				    else { if (mosh1 == 1700) { i = 12}
					 else { if (mosh1 == 1800) { i = 12}
					  else { if (mosh1 == 1900) { i = 13}
					   else { if (mosh1 == 2000) { i = 14}
					    else { if (mosh1 == 2100) { i = 14}
						 else { if (mosh1 == 2200) { i = 15}
						  else { if (mosh1 > 2200) { i = 16}
						 }}}}}}}}}}}}}}}}}}}}}}
						 
					 
stoimkabel = stoim0[i]
stoimkabel = stoimkabel*cel 
}

else {if (tipkabf == 1)
{
if (mosh1 == 100) { i = 0} 
   else { if (mosh1 == 200) { i = 1 } 
    else { if (mosh1 == 300) { i = 2}
	 else { if (mosh1 == 400) { i = 3}
	   else { if (mosh1 == 500) { i = 3}
	     else { if (mosh1 == 600) { i = 4}
		  else { if (mosh1 == 700) { i = 4}
		   else { if (mosh1 == 800) { i = 5}
		    else { if (mosh1 == 900) { i = 6}
			 else { if (mosh1 == 1000) { i = 7}
			  else { if (mosh1 == 1100) { i = 8}
			   else { if (mosh1 == 1200) { i = 8}
			    else { if (mosh1 == 1300) { i = 9}
				 else { if (mosh1 >= 1400) { i = 9}}}}}}}}}}}}}}
				 
stoimkabel = stoim1[i]
stoimkabel = stoimkabel*cel 				  
} else {if (tipkabf == 2)
{
if (mosh1 == 100) { i = 0} 
   else { if (mosh1 == 200) { i = 0 } 
    else { if (mosh1 == 300) { i = 0}
	 else { if (mosh1 == 400) { i = 1}
	   else { if (mosh1 == 500) { i = 2}
	     else { if (mosh1 == 600) { i = 3}
		  else { if (mosh1 == 700) { i = 4}
		   else { if (mosh1 == 800) { i = 5}
		    else { if (mosh1 == 900) { i = 6}
			 else { if (mosh1 == 1000) { i = 6}
			  else { if (mosh1 == 1100) { i = 7}
			   else { if (mosh1 == 1200) { i = 7}
			    else { if (mosh1 == 1300) { i = 8}
				 else { if (mosh1 == 1400) { i = 8}
				  else { if (mosh1 == 1500) { i = 9}
				   else { if (mosh1 == 1600) { i = 9}
				    else { if (mosh1 == 1700) { i = 9}
					 else { if (mosh1 == 1800) { i = 10}
					  else { if (mosh1 == 1900) { i = 10}
					   else { if (mosh1 == 2000) { i = 10}
					    else { if (mosh1 == 2100) { i = 10}
						 else { if (mosh1 == 2200) { i = 10}
						  else { if (mosh1 > 2200) { i = 10}
						 }}}}}}}}}}}}}}}}}}}}}}
stoimkabel = stoim2[i]
stoimkabel = stoimkabel*cel 
}
else {
if (mosh1 == 100) { i = 0} 
   else { if (mosh1 == 200) { i = 0 } 
    else { if (mosh1 == 300) { i = 0}
	 else { if (mosh1 == 400) { i = 1}
	   else { if (mosh1 == 500) { i = 2}
	     else { if (mosh1 == 600) { i = 3}
		  else { if (mosh1 == 700) { i = 4}
		   else { if (mosh1 == 800) { i = 5}
		    else { if (mosh1 == 900) { i = 6}
			 else { if (mosh1 == 1000) { i = 6}
			  else { if (mosh1 == 1100) { i = 7}
			   else { if (mosh1 == 1200) { i = 7}
			    else { if (mosh1 == 1300) { i = 8}
				 else { if (mosh1 == 1400) { i = 9}
				  else { if (mosh1 == 1500) { i = 9}
				   else { if (mosh1 == 1600) { i = 9}
				    else { if (mosh1 == 1700) { i = 9}
					 else { if (mosh1 == 1800) { i = 10}
					  else { if (mosh1 == 1900) { i = 10}
					   else { if (mosh1 == 2000) { i = 10}
					    else { if (mosh1 == 2100) { i = 10}
						 else { if (mosh1 == 2200) { i = 10}
						  else { if (mosh1 > 2200) { i = 10}
						 }}}}}}}}}}}}}}}}}}}}}}
stoimkabel = stoim3[i]
stoimkabel = stoimkabel*cel 
}}
}

return stoimkabel
}



function dlinlent()<!-- Расчёт длины ленты -->
{
var ploshad= Number(document.form1.plosh.value)
var dlinalent = 0
dlinalent = 1.3*ploshad
dlinalent = Math.ceil(dlinalent)


return dlinalent
}

function stoimlent()<!-- rashet stoim lenti -->
{
var stlent = dlinlent()
stlent = stlent*27


return stlent
}

function nalteploiz() <!-- nal teploiz --> 
{
var pod = Number(document.form1.pod.value)
var opr = 0
if ( pod == 0)
{ opr = 0 }
else { opr = 1}

return opr

}

function nalform()
{
var nal = nalteploiz() <!-- nalich teploiz -->
var nalf = 0
if ( nal == 0 ) { nalf = "HET"} else { nalf = "ECTb" }
return nalf

}

function stoimtiz() <!-- stoim teploiz -->
{
var op = nalteploiz()
var plosh = Number(document.form1.plosh.value)
var stoimtepiz = plosh*110*op


return stoimtepiz
}



function viborreg() <!-- vibor teplorega -->
{
var tip = document.form1.tipregul.selectedIndex
var regul = 0
var teploreg = new Array(8)
teploreg[0] = "OJ OTN 1991 ";
teploreg[1] = "OJ OTN2 1991 ";
teploreg[2] = "OJ OEC 1991 ";
teploreg[3] = "OJ OCC 1991 ";
teploreg[4] = "OJ OCD 1991 ";
teploreg[5] = "Eberle 52531 ";
teploreg[6] = "Eberle 52522 ";
teploreg[7] = "ТН-0502 N 16А ";

regul = teploreg[tip]


return regul
}

function stoimregul() <!-- stoimost regulatora -->
{
var tip = document.form1.tipregul.selectedIndex
var stoim = 0
var streg = new Array(8)
streg[0] = 2172
streg[1] = 2390
streg[2] = 2462
streg[3] = 3982
streg[4] = 4055
streg[5] = 2498
streg[6] = 2715
streg[7] = 1991

stoim = streg[tip]

return stoim
}

function stoimkomplekt()
{

var stoimkabel = stoimkab()
var stoimterm  = stoimregul()
var stlent = stoimlent()
var stoimteploiz = stoimtiz()
var stkomplekt = stoimkabel + stoimterm + stlent + stoimteploiz

stkomplekt = Math.ceil(stkomplekt)

return stkomplekt
}

function montazh1()
{
var mon = 0.3*stoimkomplekt()
mon = Math.ceil(mon)
return mon
}

function alerterr()
{  
var a = 0
var b = dlinlent()
if (b > 0) {} else {alert ("Возможно вы забыли ввести число метров Вашей площади или  сделали  ошибку: В поле для указания площади помещения недопустимо использование любых символов кроме цифр, для указания  числа в виде десятичной дроби для разделения используйте точку, например 5.87 ");}
}