// <script language="javascript">

gruz1=new Array(150, 200, 300, 400, 600);
gruz2=new Array(20, 30, 40, 60, 80);
gruz3=new Array(15, 20, 30, 40, 60);
gruz4=new Array(200, 300, 400, 600, 800);
mingr=260;

for (var i=0; i <= 4; i++)
  { gruz1[i]=Math.ceil(gruz1[i]*kursgr/500)*500; 
    gruz2[i]=Math.ceil(gruz2[i]*kursgr/300)*300; 
	gruz3[i]=Math.ceil(gruz3[i]*kursgr/200)*200; 
	gruz4[i]=Math.ceil(gruz4[i]*kursgr/2000)*2000;
  };
mingr=Math.ceil(mingr*kursgr/1000)*1000;

document.write("<div class=tsena><table cellpadding=0 cellspacing=0><tr><th rowSpan=2>Подъем грузов</th>");
document.write("<th colSpan=6>Вес груза, кг</th></tr>");
document.write("<tr><th>до 100</th>");
document.write("<th>до 200</th>");
document.write("<th>до 300</th>");
document.write("<th>до 400</th>");
document.write("<th>до 500</th>");
document.write("<th>свыше 500</th></tr>");
document.write("<tr><td class=poyasneniya>Стоимость вызова</td>");
document.write("<td>" + gruz1[0] + "</td>");
document.write("<td>" + gruz1[1] + "</td>");
document.write("<td>" + gruz1[2] + "</td>");
document.write("<td>" + gruz1[3] + "</td>");
document.write("<td>" + gruz1[4] + "</td>");
document.write("<td rowspan=3>Договорная</TD></tr>");
document.write("<tr><td class=poyasneniya>Подъем, цена за этаж</td>");
document.write("<td>" + gruz2[0] + "</td>");
document.write("<td>" + gruz2[1] + "</td>");
document.write("<td>" + gruz2[2] + "</td>");
document.write("<td>" + gruz2[3] + "</td>");
document.write("<td>" + gruz2[4] + "</td></tr>");
document.write("<tr><td class=poyasneniya>Спуск, цена за этаж</td>");
document.write("<td>" + gruz3[0] + "</td>");
document.write("<td>" + gruz3[1] + "</td>");
document.write("<td>" + gruz3[2] + "</td>");
document.write("<td>" + gruz3[3] + "</td>");
document.write("<td>" + gruz3[4] + "</td></tr>");
document.write("<tr><td class=poyasneniya>Подъем на крышу</td>");
document.write("<td>" + gruz4[0] + "</td>");
document.write("<td>" + gruz4[1] + "</td>");
document.write("<td>" + gruz4[2] + "</td>");
document.write("<td>" + gruz4[3] + "</td>");
document.write("<td>" + gruz4[4] + "</td>");
document.write("<td>Не всегда возможен</td></tr>");
document.write("<tr><td colSpan=7 class=poyasneniya><ul><li>Цены указаны в" + rublyah + ".</li>");
document.write("<li>Стоимость работ по подъему груза складывается из стоимости вызова (доставка и монтаж оборудования для подъема, подготовительные работы и др.) плюс поэтажная стоимость подъема груза.</li>");
document.write("<li>Окончательная стоимость работ оговаривается во время предварительного осмотра специалистом. Зависит от траектории подъема, сложности закрепления снаряжения, парусности груза и др. </li>");
document.write("<li>Минимальная стоимость работ - <strong>" + mingr + rub + "</strong></li>");
document.write("<li>Выезд и осмотр объекта - <strong>бесплатно</strong>!</li></ul></td></tr>");
document.write("<tr><td colSpan=7 class=poyasneniya>&nbsp; &nbsp; &nbsp; &nbsp;<strong>Расчет стоимости подъема груза:</strong><br>");
document.write("<form name=gruzy id=gruzy>");
document.write("<select name=direct><option selected value=1>Поднять</option>");
document.write("<option value=2>Спустить</option></select> ");
document.write("<input name=num value=1 size=2 maxlength=2> предмет весом ");
document.write("<select name=weigh><option selected value=0>до 100 кг</option>");
document.write("<option value=1>от 100 до 200 кг</option>");
document.write("<option value=2>от 200 до 300 кг</option>");
document.write("<option value=3>от 300 до 400 кг</option>");
document.write("<option value=4>от 400 до 500 кг</option></select><br>");
document.write("на <input name=heigh value=3 size=2 maxlength=2> этаж. ");
document.write("На крышу <input type=checkbox name=roof value=roof>?<br>");
document.write("<input onClick=gruz() type=button value=Вычислить name=submit>");
document.write(" <strong id=itogo>Стоимость подъема груза</strong>");
document.write("</form></td></tr>");
document.write("</table></div>");

function gruz(){
   d=document.gruzy.elements["direct"].value;
   w=document.gruzy.elements["weigh"].selectedIndex;
   h=document.gruzy.elements["heigh"].value;
   n=document.gruzy.elements["num"].value;
   r=0;
   if (document.gruzy.elements["roof"].checked) r=1;
   podyem=gruz1[w]+gruz2[w]*h*n+n*gruz4[w]*r;
   if(podyem < mingr) podyem=mingr;
   spusk=gruz1[w]+gruz3[w]*h*n+n*gruz4[w]*r;
   if(spusk < mingr) spusk=mingr;
   if (d == "1") {document.getElementById('itogo').innerHTML = "    " + podyem + rub;}
   else {document.getElementById('itogo').innerHTML = "    " + spusk + rub;};
}; 

// </script>
