function calc()
{
	id = document.getElementById('type').value;
	
	var weight;
	var rashod;
	var cost;
	weight = new Array();
	rashod = new Array();
	cost = document.getElementById('cost').value;

	weight[0] = '1';
	weight[1] = '2';
	weight[2] = '1.5';
	weight[3] = '0.8';
	weight[4] = '1.3';
	weight[5] = '1.2';
	weight[6] = '1.0';
	weight[7] = '2.0';
	weight[8] = '0.5';
	weight[9] = '0.6';
	
	rashod[0] = '1.4';
	rashod[1] = '2.8';
	rashod[2] = '2.4';
	rashod[3] = '1.1';
	rashod[4] = '2.0';
	rashod[5] = '1.4';
	rashod[6] = '1.1';
	rashod[7] = '2.8';
	rashod[8] = '0.6';
	rashod[9] = '0.7';
	
	document.getElementById('summ').innerHTML = rashod[id] * document.getElementById('num').value * cost;
	document.getElementById('weight').innerHTML =  weight[id];
}

function submit_zakaz()
{
	document.getElementById('user_id').value = document.getElementById('uid').innerHTML;
	if(document.getElementById('tovar1').value == '0' 
	&& document.getElementById('tovar2').value == '0' 
	&& document.getElementById('tovar3').value == '0' 
	&& document.getElementById('tovar4').value == '0'){
		alert('Вы должны выбрать хотя бы один товар');
	}
	else{
		document.forms['form_zakaz'].submit();
	}
}
