function count()
{
	summ = 0;
	var typeCost1 = new Array(0,43000,48110,59000,66190,76860,166500);
	var typeCost2 = new Array(0,18900,21700,28100,28470,28470);
	var typeCost3 = new Array(0,0,1000,0,0,0);


	T = window.document.calc.type.value;
	//TB = window.document.calc.type_baget.value;
	TB = 1;
	C = window.document.calc.corner.value;
	
	VR=43620*window.document.calc.vyrez.value;
	KR=32660*window.document.calc.kryv.value;	
	SV=22210*window.document.calc.light1.value+32160*window.document.calc.light2.value+32160*window.document.calc.light3.value;
	LU=22300*window.document.calc.lightp1.value+42900*window.document.calc.lightp2.value+11500*window.document.calc.lightk.value;
	TR=25500*window.document.calc.pipe1.value+33000*window.document.calc.pipe2.value;
	DV=22900*window.document.calc.fire.value+30860*window.document.calc.vent.value;

	if(window.document.calc.type.value=="0")
    {
         alert('Выберите фактуру потолка');
         return 0;
    }

	if(window.document.calc.area.value==0)
    {
         alert('Введите площадь потолка');
         return 0;
    }
    if(window.document.calc.area.value>50)
    {
         alert('Площадь потолка не может быть больше 50 метров');
         return 0;
    }
	if(window.document.calc.type.value=="1")
	{
	if (TB=="0" || TB=="1"){B=0} else
	{
	if(window.document.calc.baget.value==0){alert('За применение выбраного Вами багета, взымается дополнительная плата, для расчета которой необходимо ввести периметр помещения '); return 0;};
	B=typeCost3[TB]*window.document.calc.baget.value;
	};
	S=43000*window.document.calc.area.value;
	if (C>4){SC=(C-4)*6500;} else {SC=0;};
	}
	if(window.document.calc.type.value=="1" && (TB=="3" || TB=="4" || TB=="5"))
	{
	alert('Выбранная Вами комбинация полотна и багета не входит в условия акции. Потолок будет перерасчитан!');
	B=typeCost2[TB]*window.document.calc.baget.value;
	S=typeCost1[T]*window.document.calc.area.value;
	SC=6500*window.document.calc.corner.value;
	}

	if(window.document.calc.type.value=="2")
	{
	if (TB=="0" || TB=="1"){B=0} else
	{
	if(window.document.calc.baget.value==0){alert('За применение выбраного Вами багета, взымается дополнительная плата, для расчета которой необходимо ввести периметр помещения '); return 0;};
	B=typeCost3[TB]*window.document.calc.baget.value;
	};
	S=54000*window.document.calc.area.value;
	if (C>4){SC=(C-4)*6500;} else {SC=0;};
	}
	if(window.document.calc.type.value=="2" && (TB=="3" || TB=="4" || TB=="5"))
	{
	alert('Выбранная Вами комбинация полотна и багета не входит в условия акции. Потолок будет перерасчитан! ');
	B=typeCost2[TB]*window.document.calc.baget.value;
	S=typeCost1[T]*window.document.calc.area.value;
	SC=6500*window.document.calc.corner.value;
    }
	if(window.document.calc.type.value=="3" || window.document.calc.type.value=="4" || window.document.calc.type.value=="5" || window.document.calc.type.value=="6" )
	{
    if(window.document.calc.type_baget.value=="0") {alert('Выберите тип багета'); return 0;};
    if(window.document.calc.baget.value==0){alert('Периметр потолка не может быть равен нулю'); return 0;};
	B=typeCost2[TB]*window.document.calc.baget.value;
	S=typeCost1[T]*window.document.calc.area.value;
	SC=6500*window.document.calc.corner.value;
	}
    if(document.getElementById('cen').checked)
         XC= S/100*15;
         else XC = 0;
    if(document.getElementById('dif').checked)
        XCC= S/100*15;
         else XCC = 0;


 	summ = B + S + SC + VR + KR + SV + + LU + TR + DV + XC + XCC;	window.document.calc.result.value = summ;
}