			function calculate() {
				if(!document.pricing.square.value || document.pricing.square.value == '') {
					alert('Введите площадь комнаты.');
					return;
				}
				var square = document.pricing.square.value;
				var price = 0;
				var _price = 0;
				var zero = 0;
				var num = 0;


				var success = false;
				while(document.pricing['cat' + num] != null) {

					var item_price = new String(document.pricing['cat' + num].options[document.pricing['cat' + num].options.selectedIndex].value);
					if(item_price.indexOf('.') != -1) {
						if(item_price.substring(item_price.indexOf('.') + 1, item_price.length).length > zero) {
							price *= Math.pow(10, item_price.substring(item_price.indexOf('.') + 1, item_price.length).length - zero);
							zero = item_price.substring(item_price.indexOf('.') + 1, item_price.length).length;
						}
						_price = document.pricing['cat' + num].options[document.pricing['cat' + num].options.selectedIndex].value * Math.pow(10, zero);
					}
					else _price = document.pricing['cat' + num].options[document.pricing['cat' + num].options.selectedIndex].value;
					price += square * _price;
					document.getElementById('cat' + num);
					if(document.pricing['cat' + num].options.selectedIndex > 0 ) success = true;
					num++;
				}
				if(!success) {
					alert('Не выбран ни один вид услуги.');
					return;
				}

				var price_str = new String(price);
				var int_price = price_str.substring(0, price_str.length - zero);
				var float_price = price_str.substring(price_str.length - zero, price_str.length);
				var str = '<table boder="1" width="100%"><tr>'
					+	'<td bgcolor="#cccccc"><b>Стоимость:</b></td></tr>'
					+ 	'<tr><td bgcolor="#ddffdd">' + int_price + '.' + float_price + ' руб.</td>'
					+ '</tr>'
					+ '</table>';
				var obj = document.getElementById('pricing-text');
				obj.innerHTML = str;
			}