function RasSale(val1,val2){
        var sale1, sale2, dos;
        sale1=0;sale2=0;dos=200;
        if(val1>=5 && val1<=10)
          sale1=5;
        if(val1>10 && val1<=30)
          sale1=10;
        if(val1>30 && val1<=50)
          sale1=15;
        if(val1>50)
          sale1=20;

        if(itpGetElementById('vip').checked==true)
          sale1=sale1+5;

        itpGetElementById('val12').value=sale1;
        /////////////////////////////////////////
        if(val2<10000)
          sale2=0;
        if(val2>=10000 && val2<25000)
          sale2=3;
        if(val2>=25000 && val2<50000)
          sale2=5;
        if(val2>=50000 && val2<100000)
          sale2=7;
        if(val2>=100000)
          sale2=9;

        if(itpGetElementById('bn').checked==true)
          sale2=sale2-2;
        if(val2<10000 && itpGetElementById('vip').checked==true)
          sale2=sale2+2;

        itpGetElementById('val22').value=sale2;

        //////////////////////////////////
        if(val2<1000)
          dos="200 руб.";
        if(val2>=1000 && val2<3000)
          dos="100 руб.";
        if(val2>=3000)
          dos="Бесплатно";



        itpGetElementById('val3').value=dos;

        dos="Бесплатно";
        if(val1<3)
          dos="200 руб.";

        itpGetElementById('val4').value=dos;

        var aRows = itpGetElementById("oItemTable").rows("oDataRow");
        for(var i=0; i<aRows.length; i++) {
                aCells = aRows.item(i).cells;
                                var tRetail1 = Math.round( (aCells[aCells.length-4].basevalue*1*(1-sale1/100)*100)/100 )+' р.';
                                var tRetail2 = Math.round( (aCells[aCells.length-3].basevalue*1*(1-sale1/100)*100)/100 )+' р.';
                                var tRetail3 = Math.round( (aCells[aCells.length-2].basevalue*1*(1-sale2/100)*100)/100 )+' р.';
                                if(tRetail1=='0 р.')tRetail1='-';
                                if(tRetail2=='0 р.')tRetail2='-';
                                if(tRetail3=='0 р.')tRetail3='-';
                                itpGetElementById("oItemTable").rows("oDataRow").item(i).cells[aCells.length-4].firstChild.firstChild.innerHTML = tRetail1;
                                itpGetElementById("oItemTable").rows("oDataRow").item(i).cells[aCells.length-3].firstChild.firstChild.innerHTML = tRetail2;
                                itpGetElementById("oItemTable").rows("oDataRow").item(i).cells[aCells.length-2].firstChild.firstChild.innerHTML = tRetail3;
        }
}
