function Calc() {
	this.pricesHash = new Array();	
	this.pricesHash['1'] = new Array(0,800,850,800,800,750,750,800,850,850); // Vnukovo stand
	this.pricesHash['2'] = new Array(0,850,850,800,800,800,850,900,900,900);  // Domodedovo stand
	this.pricesHash['3'] = new Array(0,800,800,850,850,850,800,750,750,800); // Sheremetevo stand	
}

Calc.prototype = {

	getSelectedValue : function(select_id) {
		var el = document.getElementById(select_id);
		if(el) {
			return el.options[el.selectedIndex].value;
		} else {
			return 0;
		}
	},

	calculate : function() {
		var trip_type   = this.getSelectedValue('trip_type');
		var trip_aero   = this.getSelectedValue('trip_aero');
		var trip_dist   = this.getSelectedValue('trip_district');
		var trip_tariff = this.getSelectedValue('trip_tariff');
		if(trip_type == 0 || trip_aero == 0 || trip_dist == 0 || trip_tariff == 0) {
			this.resetPrice();
		} else {									
			var pr = this.pricesHash[trip_aero][trip_dist];
			if(trip_type == 2) {
				pr += 200;
			}
			if(trip_tariff == 2) {
				pr += 200;
			}			
			this.setPrice(pr);
		}
	},

	resetPrice : function() {
		var el = document.getElementById('price');
		if (el) {
			el.innerHTML = '';
		}
	},

    setPrice : function(price) {
		var el = document.getElementById('price');
		if (el) {
			el.innerHTML = 'Стоимость: ' + price +'р.';
		}
	}
}