function calculator(form) {
p = eval(form.p.value);	
z = eval(form.z.value);
u = eval(form.u.value);
a = eval(form.a.value)*z;
b = eval(form.b.value)*p; 
c = eval(form.c.value)*u; 
tarif = eval(form.tariff.value); 
d = (a+b+c)*tarif; 
form.total1.value = d;
form.total1a.value = a;
form.total1b.value = tarif;
form.total1c.value = c;
} 
function getTarif(f, val, id, id2, id3)
{ 
f.tariff.value = val; 
        document.getElementById(id2).style.display = 'none';
		document.getElementById(id3).style.display = 'none';
        document.getElementById(id).style.display = '';
} 
function getNumbers3(f, val)
{ 
f.c.value += val; 
} 
function getNumbers(f, val) 
{ 
f.b.value += val; 
} 
function getNumbers2(f, val) 
{ 
f.a.value += val; 
} 
function collapsElement(id) {
    if ( document.getElementById(id).style.display != "none" ) {
        document.getElementById(id).style.display = 'none';
    }
    else {
        document.getElementById(id).style.display = '';
    }
}
