function calcPrice ()
{
	weight = base_weight;
	price = 0;
	model = base_model;

	for (i=0; i<par_list.length; i++)
	{
		tmp = document.forms['shop'].elements['pro_val['+par_list[i]+']'].value.split ('|');
		if (tmp.length < 3)	continue;
		price += parseInt (tmp[1]);
		weight += parseInt(tmp[2]);
		if (tmp[3].length > 0)	model += ' '+tmp[3];
	}
	if (price <= 0) price = base_price;
	if (getElem ('model_info'))	changeText (getElem ('model_info'), model);
	if (getElem ('weight_info'))	changeText (getElem ('weight_info'), weight);
	if (getElem ('netto_price_info'))	changeText (getElem ('netto_price_info'), number_format(price, 2, '.', ' '));
	if (getElem ('brutto_price_info'))	changeText (getElem ('brutto_price_info'), number_format(price*((100+vat)/100), 2, '.', ' '));
}

function calcMultiPrice (pid)
{
	pid = parseInt (pid);
	pinx = -1;
	for (i=0; i<par_list.length; i++)
	{
		if (par_list[i][0] == pid)	pinx = i;
	}
	if (pinx < 0)	return;

	weight = par_list[pinx][4];
	price = 0;
	model = par_list[pinx][5];

	for (i=0; i<par_list[pinx][1].length; i++)
	{
		tmp = document.forms['pro_'+pid].elements['pro_val['+par_list[pinx][1][i]+']'].value.split ('|');
		if (tmp.length < 3)	continue;
		price += parseInt (tmp[1]);
		weight += parseInt(tmp[2]);
		if (tmp[3].length > 0)	model += ' '+tmp[3];
	}
	if (price <= 0)	price = par_list[pinx][2];
	if (getElem ('model_info_'+pid))
		changeText (getElem ('model_info_'+pid), model);

	if (getElem ('weight_info_'+pid))
		changeText (getElem ('weight_info_'+pid), weight);

	if (getElem ('netto_price_info_'+pid))
		changeText (getElem ('netto_price_info_'+pid), number_format(price, 2, '.', ' '));

	if (getElem ('brutto_price_info_'+pid))
		changeText (getElem ('brutto_price_info_'+pid), number_format(price*((100+par_list[pinx][3])/100), 2, '.', ' '));
}

