/**
 * obiekt przechowywujacy wszystkie modele cenowe
 */
var priceModels = 
{
	/**
	 * zwraca model o podanym id, zapisuje do niego wszystkie dane
	 * @param {int} modelId
	 * @param {object} prices
	 * @param {object} seasons
	 * @return {object}
	 */
	getPriceModel : function(modelId, prices, seasons)
	{
		var model;
		var code = 'var model = new priceModels.priceModel'+modelId+'(prices, seasons);';
		eval(code);
		return model;
	},
	
	/**
	 * klasa abstrakcyjna modeli cenowych
	 * @param {object} prices
	 * @param {object} seasons
	 */
	priceModel : function(prices, seasons)
	{
		this._prices = prices;
		for(var i=0; i<this._prices.length; i++){
			if(Object.isArray(this._prices[i])){
				for(var j=0; j<this._prices[i].length; j++){
					this._prices[i][j] = parseInt(this._prices[i][j]);
				}
			} else {
				this._prices[i] = parseInt(this._prices[i]);
			}
		}
		this._seasons = seasons;
		
		/**
		 * zwraca cene najmu dla podanego przedzialu
		 * @param {object} dateStart
		 * @param {object} dateEnd
		 * @return {int}
		 */
		this.getPrice = function(dateStart, dateEnd)
		{
			console.error('brak implementacji');
			// ta metode nalezy zaimplementowac w konkretnym modelu, nie tutaj
		}
		
		/**
		 * zwraca w tablicy wszystkie możliwe ceny za jeden dzien (do zdefiniowania kolorow na kalendarzu)
		 * @param {object} date
		 * @return {int}
		 */
		this.getDaysPrices = function()
		{
			console.error('brak implementacji');
			// ta metode nalezy zaimplementowac w konkretnym modelu, nie tutaj
		}
		
		/**
		 * zwraca cene wynajmu za podany dzien (uzywane do kolorowania kalendarzy)
		 * @param {int} month
		 * @param {int} day
		 * @return {int}
		 */
		this.getPriceForDay = function(year, month, day)
		{
			var date1 = new Date();
			date1.setYear(year);
			date1.setMonth(month);
			date1.setDate(day);
			date1.setHours(0);
			date1.setMinutes(0);
			date1.setSeconds(0);
			
			var date2 = new Date();
			date2.setYear(year);
			date2.setMonth(month);
			date2.setDate(day);
			date2.setHours(23);
			date2.setMinutes(59);
			date2.setSeconds(59);
			
			return this.getPrice(date1, date2);
		}
		
		/**
		 * zwraca wszystkie mozliwe poziomy ceny za dzien posortowane rosnaco (do ustalenia kolorow na kalendarzu)
		 * @return {array} 
		 */
		this.getPriceLevels = function()
		{
			var prices = this.getDaysPrices();
			prices = prices.uniq();
			prices.sort(function(a,b){return a-b});
			for(var i=0; i<prices.length; i++){
				prices[i] = Math.round(prices[i]);
			}
			return prices;
		}
		
		/**
		 * zwraca cennik aktualny dla podanej daty 
		 * (jesli model nie jest sezonowy to zwraca cennik glowny)
		 * @param {int} month
		 * @param {int} day
		 * @return {array}
		 */
		this.getSeasonsPrices = function(month, day)
		{
			if(this._seasons.length==0){
				return this._prices;
			} else {
				var monthFrom, monthTo, dayFrom, dayTo;
				for(key in this._seasons.monthFrom){
					monthFrom = this._seasons.monthFrom[key]-1;
					monthTo = this._seasons.monthTo[key]-1;
					dayFrom = this._seasons.dayFrom[key];
					dayTo = this._seasons.dayTo[key];
					if( ( monthFrom<month || (monthFrom==month && dayFrom<=day) ) 
							&& ( ( monthTo>month || (monthTo==month && dayTo>=day ) ) || monthTo<monthFrom ) ){
						return this._prices[key];
					}
				}
				return this._prices[0];
			}
		}
		
		/**
		 * zwraca ilosc dni lub godzin pomiedzy podanymi datami
		 * @param {object} date1
		 * @param {object} date2
		 * @param {string} intervalType - 'DAY' lub 'HOUR', domyslnie 'DAY'
		 * @return {int}
		 */
		this.getInterval = function(date1, date2, intervalType)
		{
			intervalType = intervalType || 'DAY';
			var interval = date2.getTime()-date1.getTime();
			if(intervalType=='DAY'){
				return Math.ceil((interval-3600000)/86400000);
				// to -3600000 zabezpiecza przed zmianą czasu a wynik po zaokragleniu jest ok
			} else {
				return Math.ceil(interval/3600000);
			}
		}
	},
	
	/**
	 * dziedziczy z priceModel
	 * implementacja modelu "LongTermBasic"
	 */
	priceModel1 : function(prices, seasons)
	{
		this.superClass = priceModels.priceModel;
		this.superClass(prices, seasons);
		
		/**
		 * zwraca cene najmu dla podanego przedzialu
		 * @param {object} dateStart
		 * @param {object} dateEnd
		 * @return {int}
		 */
		this.getPrice = function(dateStart, dateEnd)
		{
			var days = this.getInterval(dateStart, dateEnd);
			if(days<3) {
				return days*this._prices[0];
			} else if(days<5){
				return days*this._prices[1];
			} else if(days<7){
				return days*this._prices[2];
			} else {
				return days*this._prices[3];
			}
		}
		
		/**
		 * zwraca w tablicy wszystkie możliwe ceny za jeden dzien (do zdefiniowania kolorow na kalendarzu)
		 * @param {object} date
		 * @return {int}
		 */
		this.getDaysPrices = function()
		{
			return [this._prices[0]];
		}
	},
	
	/**
	 * dziedziczy z priceModel
	 * implementacja modelu "LongTermFixed"
	 */
	priceModel2 : function(prices, seasons)
	{
		this.superClass = priceModels.priceModel;
		this.superClass(prices, seasons);
		
		/**
		 * zwraca cene najmu dla podanego przedzialu
		 * @param {object} dateStart
		 * @param {object} dateEnd
		 * @return {int}
		 */
		this.getPrice = function(dateStart, dateEnd)
		{
			var days = this.getInterval(dateStart, dateEnd);
			return days*this._prices[0];
		}
		
		/**
		 * zwraca w tablicy wszystkie możliwe ceny za jeden dzien (do zdefiniowania kolorow na kalendarzu)
		 * @param {object} date
		 * @return {int}
		 */
		this.getDaysPrices = function()
		{
			return [this._prices[0]];
		}
	},
	
	/**
	 * dziedziczy z priceModel
	 * implementacja modelu "LongTermThreeDays"
	 */
	priceModel3 : function(prices, seasons)
	{
		this.superClass = priceModels.priceModel;
		this.superClass(prices, seasons);
		
		/**
		 * zwraca cene najmu dla podanego przedzialu
		 * @param {object} dateStart
		 * @param {object} dateEnd
		 * @return {int}
		 */
		this.getPrice = function(dateStart, dateEnd)
		{
			var days = this.getInterval(dateStart, dateEnd);
			if(days>5){
				return this._prices[1]*days;
			} else {
				return this._prices[0]*days;
			}
		}
		
		/**
		 * zwraca w tablicy wszystkie możliwe ceny za jeden dzien (do zdefiniowania kolorow na kalendarzu)
		 * @param {object} date
		 * @return {int}
		 */
		this.getDaysPrices = function()
		{
			return [parseInt(this._prices[0])];
		}
	},
	
	/**
	 * dziedziczy z priceModel
	 * implementacja modelu "LongTermWeekends"
	 */
	priceModel4 : function(prices, seasons)
	{
		this.superClass = priceModels.priceModel;
		this.superClass(prices, seasons);
		
		/**
		 * zwraca cene najmu dla podanego przedzialu
		 * @param {object} dateStart
		 * @param {object} dateEnd
		 * @return {int}
		 */
		this.getPrice = function(dateStart, dateEnd)
		{
			var days = this.getInterval(dateStart, dateEnd);
			if(days<7){
				var dateTemp = new Date(dateStart.getTime());
				var totalPrice = 0;
				var weekendDays = 0;
				for(var i=0; i<days; i++){
					if(dateTemp.getDay()==0 || dateTemp.getDay()>=5){
						totalPrice += this._prices[1];
						weekendDays++;
					} else {
						totalPrice += this._prices[0]
					}
					dateTemp.setTime(dateTemp.getTime()+86400000);
				}
				if(weekendDays==3){
					totalPrice -= this._prices[1]*3;
					totalPrice += this._prices[2];
				}
				return totalPrice;
			} else {
				return days*this._prices[3];
			}
		}
		
		/**
		 * zwraca w tablicy wszystkie możliwe ceny za jeden dzien (do zdefiniowania kolorow na kalendarzu)
		 * @param {object} date
		 * @return {int}
		 */
		this.getDaysPrices = function()
		{
			return [this._prices[0], this._prices[1]];
		}
	},
	
	/**
	 * dziedziczy z priceModel
	 * implementacja modelu "ShortTermBasic"
	 */
	priceModel5 : function(prices, seasons)
	{
		this.superClass = priceModels.priceModel;
		this.superClass(prices, seasons);
		
		/**
		 * zwraca cene najmu dla podanego przedzialu
		 * @param {object} dateStart
		 * @param {object} dateEnd
		 * @return {int}
		 */
		this.getPrice = function(dateStart, dateEnd)
		{
			var hours = this.getInterval(dateStart, dateEnd, 'HOUR');
			if(hours<3) {
				return hours*this._prices[0];
			} else if(hours<8) {
				return hours*this._prices[1];
			} else if(hours<12) {
				return hours*this._prices[2];
			} else if(hours<24) {
				return hours*this._prices[3];
			} else if(hours<48) {
				return hours*this._prices[4];
			} else {
				return hours*this._prices[5];
			}
		}
		
		/**
		 * zwraca w tablicy wszystkie możliwe ceny za jeden dzien (do zdefiniowania kolorow na kalendarzu)
		 * @param {object} date
		 * @return {int}
		 */
		this.getDaysPrices = function()
		{
			return [this._prices[4]*24	];
		}
	},
	
	/**
	 * dziedziczy z priceModel
	 * implementacja modelu "ShortTermDayHour"
	 */
	priceModel6 : function(prices, seasons)
	{
		this.superClass = priceModels.priceModel;
		this.superClass(prices, seasons);
		
		/**
		 * zwraca cene najmu dla podanego przedzialu
		 * @param {object} dateStart
		 * @param {object} dateEnd
		 * @return {int}
		 */
		this.getPrice = function(dateStart, dateEnd)
		{
			var hours = this.getInterval(dateStart, dateEnd, 'HOUR');
			if(hours<24) {
				return hours*this._prices[0];
			} else {
				return hours*(this._prices[1]/24);
			}
		}
		
		/**
		 * zwraca w tablicy wszystkie możliwe ceny za jeden dzien (do zdefiniowania kolorow na kalendarzu)
		 * @param {object} date
		 * @return {int}
		 */
		this.getDaysPrices = function()
		{
			return [this._prices[1]];
		}
	},
	
	/**
	 * dziedziczy z priceModel
	 * implementacja modelu "ShortTermDayHour2"
	 */
	priceModel7 : function(prices, seasons)
	{
		this.superClass = priceModels.priceModel;
		this.superClass(prices, seasons);
		
		/**
		 * zwraca cene najmu dla podanego przedzialu
		 * @param {object} dateStart
		 * @param {object} dateEnd
		 * @return {int}
		 */
		this.getPrice = function(dateStart, dateEnd)
		{
			var hours = this.getInterval(dateStart, dateEnd, 'HOUR');
			if(hours<24) {
				return this._prices[0]+this._prices[1]*(hours-1);
			} else {
				return this._prices[2]+this._prices[3]*((hours/24)-1);
			}
		}
		
		/**
		 * zwraca w tablicy wszystkie możliwe ceny za jeden dzien (do zdefiniowania kolorow na kalendarzu)
		 * @param {object} date
		 * @return {int}
		 */
		this.getDaysPrices = function()
		{
			return [this._prices[2]];
		}
	},
	
	/**
	 * dziedziczy z priceModel
	 * implementacja modelu "SeasonalDayHour1"
	 */
	priceModel8 : function(prices, seasons)
	{
		this.superClass = priceModels.priceModel;
		this.superClass(prices, seasons);
		
		/**
		 * zwraca cene najmu dla podanego przedzialu
		 * @param {object} dateStart
		 * @param {object} dateEnd
		 * @return {int}
		 */
		this.getPrice = function(dateStart, dateEnd)
		{
			var hours = this.getInterval(dateStart, dateEnd, 'HOUR');
			var prices;
			var dateTemp = new Date(dateStart.getTime());
			var totalPrice = 0;
			for(var i=0; i<hours; i++){
				prices = this.getSeasonsPrices(dateTemp.getMonth(), dateTemp.getDate());
				dateTemp.setTime(dateTemp.getTime()+3600000);
				if(hours<24){
					totalPrice += prices[0];
				} else {
					totalPrice += (prices[1]/24);
				}
			}
			return totalPrice;
		}
		
		/**
		 * zwraca w tablicy wszystkie możliwe ceny za jeden dzien (do zdefiniowania kolorow na kalendarzu)
		 * @param {object} date
		 * @return {int}
		 */
		this.getDaysPrices = function()
		{
			var prices = new Array();
			for(var i=0; i<this._prices.length; i++){
				prices.push(this._prices[i][1]);
			}
			return prices;
		}
	},
	
	/**
	 * dziedziczy z priceModel8
	 * implementacja modelu "SeasonalDayHour3"
	 */
	priceModel9 : function(prices, seasons)
	{
		this.superClass = priceModels.priceModel8;
		this.superClass(prices, seasons);
	},
	
	/**
	 * dziedziczy z priceModel8
	 * implementacja modelu "SeasonalDayHour5"
	 */
	priceModel10 : function(prices, seasons)
	{
		this.superClass = priceModels.priceModel8;
		this.superClass(prices, seasons);
	},
	
	/**
	 * dziedziczy z priceModel
	 * implementacja modelu "SeasonalWeekends1"
	 */
	priceModel11 : function(prices, seasons)
	{
		this.superClass = priceModels.priceModel;
		this.superClass(prices, seasons);
		
		/**
		 * zwraca cene najmu dla podanego przedzialu
		 * @param {object} dateStart
		 * @param {object} dateEnd
		 * @return {int}
		 */
		this.getPrice = function(dateStart, dateEnd)
		{
			var days = this.getInterval(dateStart, dateEnd);
			var prices;
			var dateTemp = new Date(dateStart.getTime());
			var totalPrice = 0;
			var weekendCountedIn = false;
			for(var i=0; i<days; i++){
				prices = this.getSeasonsPrices(dateTemp.getMonth(), dateTemp.getDate());
				if(days<7){
					if(dateTemp.getDay()==5 && i<days-2){
						weekendCountedIn = true;
						totalPrice += prices[2];
					} else if((dateTemp.getDay()==0 || dateTemp.getDay()>=5) && !weekendCountedIn){
						totalPrice += prices[1];
					} else if(dateTemp.getDay()!=0 && dateTemp.getDay()<5) {
						totalPrice += prices[0]
					}
				} else {
					totalPrice += prices[3];
				}
				dateTemp.setTime(dateTemp.getTime()+86400000);
			}
			return totalPrice;
		}
		
		/**
		 * zwraca w tablicy wszystkie możliwe ceny za jeden dzien (do zdefiniowania kolorow na kalendarzu)
		 * @param {object} date
		 * @return {int}
		 */
		this.getDaysPrices = function()
		{
			var prices = new Array();
			for(var i=0; i<this._prices.length; i++){
				prices.push(this._prices[i][0]);
				prices.push(this._prices[i][1]);
			}
			return prices;
		}
	},
	
	/**
	 * dziedziczy z priceModel11
	 * implementacja modelu "SeasonalWeekends3"
	 */
	priceModel12 : function(prices, seasons)
	{
		this.superClass = priceModels.priceModel11;
		this.superClass(prices, seasons);
	},
	
	/**
	 * dziedziczy z priceModel11
	 * implementacja modelu "SeasonalWeekends5"
	 */
	priceModel13 : function(prices, seasons)
	{
		this.superClass = priceModels.priceModel11;
		this.superClass(prices, seasons);
	},
	
	/**
	 * dziedziczy z priceModel
	 * implementacja modelu "ShortTermWeekends"
	 */
	priceModel14 : function(prices, seasons)
	{
		this.superClass = priceModels.priceModel;
		this.superClass(prices, seasons);
		
		/**
		 * zwraca cene najmu dla podanego przedzialu
		 * @param {object} dateStart
		 * @param {object} dateEnd
		 * @return {int}
		 */
		this.getPrice = function(dateStart, dateEnd)
		{
			var hours = this.getInterval(dateStart, dateEnd, 'HOUR');
			var dateTemp = new Date(dateStart.getTime());
			var totalPrice = 0;
			for(var i=0; i<hours; i++){
				if(dateTemp.getDay()==0 || dateTemp.getDay()>=5){
					if(hours<24){
						totalPrice += (this._prices[1]);
					} else {
						totalPrice += (this._prices[3]/24);
					}
				} else {
					if(hours<24){
						totalPrice += (this._prices[0]);
					} else {
						totalPrice += (this._prices[2]/24);
					}
				}
				dateTemp.setTime(dateTemp.getTime()+3600000);
			}
			return totalPrice;
		}
		
		/**
		 * zwraca w tablicy wszystkie możliwe ceny za jeden dzien (do zdefiniowania kolorow na kalendarzu)
		 * @param {object} date
		 * @return {int}
		 */
		this.getDaysPrices = function()
		{
			return [this._prices[2],this._prices[3]];
		}
	},
	
	/**
	 * dziedziczy z priceModel
	 * implementacja modelu "SeasonalDayWeek1"
	 */
	priceModel15 : function(prices, seasons)
	{
		this.superClass = priceModels.priceModel;
		this.superClass(prices, seasons);
		
		/**
		 * zwraca cene najmu dla podanego przedzialu
		 * @param {object} dateStart
		 * @param {object} dateEnd
		 * @return {int}
		 */
		this.getPrice = function(dateStart, dateEnd)
		{
			var days = this.getInterval(dateStart, dateEnd);
			var prices;
			var dateTemp = new Date(dateStart.getTime());
			var totalPrice = 0;
			for(var i=0; i<days; i++){
				prices = this.getSeasonsPrices(dateTemp.getMonth(), dateTemp.getDate());
				dateTemp.setTime(dateTemp.getTime()+86400000);
				if(days<7){
					totalPrice += prices[0];
				} else {
					totalPrice += prices[1];
				}
			}
			return totalPrice;
		}
		
		/**
		 * zwraca w tablicy wszystkie możliwe ceny za jeden dzien (do zdefiniowania kolorow na kalendarzu)
		 * @param {object} date
		 * @return {int}
		 */
		this.getDaysPrices = function()
		{
			var prices = new Array();
			for(var i=0; i<this._prices.length; i++){
				prices.push(parseInt(this._prices[i][0]));
			}
			return prices;
		}
	},
	
	/**
	 * dziedziczy z priceModel15
	 * implementacja modelu "SeasonalDayWeek3"
	 */
	priceModel16 : function(prices, seasons)
	{
		this.superClass = priceModels.priceModel15;
		this.superClass(prices, seasons);
	},
	
	/**
	 * dziedziczy z priceModel15
	 * implementacja modelu "SeasonalDayWeek5"
	 */
	priceModel17 : function(prices, seasons)
	{
		this.superClass = priceModels.priceModel15;
		this.superClass(prices, seasons);
	},
	
	/**
	 * dziedziczy z priceModel
	 * implementacja modelu "ShortTerm5HoursDay"
	 */
	priceModel18 : function(prices, seasons)
	{
		this.superClass = priceModels.priceModel;
		this.superClass(prices, seasons);
		
		/**
		 * zwraca cene najmu dla podanego przedzialu
		 * @param {object} dateStart
		 * @param {object} dateEnd
		 * @return {int}
		 */
		this.getPrice = function(dateStart, dateEnd)
		{
			var hours = this.getInterval(dateStart, dateEnd, 'HOUR');
			if(hours<24) {
				return hours*this._prices[0];
			} else if(hours<24*7){
				var dateTemp = new Date(dateStart.getTime());
				var totalPrice = 0;
				for(var i=0; i<hours; i++){
					if(dateTemp.getDay()==0 || dateTemp.getDay()>=5){
						totalPrice += (this._prices[2]/24);
					} else {
						totalPrice += (this._prices[1]/24);
					}
					dateTemp.setTime(dateTemp.getTime()+3600000);
				}
				return totalPrice;
			} else {
				return hours*(this._prices[3]/24);
			}
		}
		
		/**
		 * zwraca w tablicy wszystkie możliwe ceny za jeden dzien (do zdefiniowania kolorow na kalendarzu)
		 * @param {object} date
		 * @return {int}
		 */
		this.getDaysPrices = function()
		{
			return [this._prices[1],this._prices[2]];
		}
	},
	
	/**
	 * dziedziczy z priceModel
	 * implementacja modelu "ShortTerm8HoursDay"
	 */
	priceModel19 : function(prices, seasons)
	{
		this.superClass = priceModels.priceModel;
		this.superClass(prices, seasons);
		
		/**
		 * zwraca cene najmu dla podanego przedzialu
		 * @param {object} dateStart
		 * @param {object} dateEnd
		 * @return {int}
		 */
		this.getPrice = function(dateStart, dateEnd)
		{
			var hours = this.getInterval(dateStart, dateEnd, 'HOUR');
			if(hours<24) {
				return hours*this._prices[0];
			} else {
				var dateTemp = new Date(dateStart.getTime());
				var totalPrice = 0;
				for(var i=0; i<hours; i++){
					if(dateTemp.getDay()==0 || dateTemp.getDay()>=5){
						totalPrice += (this._prices[4]/24);
					} else if(hours<24*2) {
						totalPrice += (this._prices[1]/24);
					} else if(hours<24*3) {
						totalPrice += (this._prices[2]/24);
					} else {
						totalPrice += (this._prices[3]/24);
					}
					dateTemp.setTime(dateTemp.getTime()+3600000);
				}
				return totalPrice;
			}
		}
		
		/**
		 * zwraca w tablicy wszystkie możliwe ceny za jeden dzien (do zdefiniowania kolorow na kalendarzu)
		 * @param {object} date
		 * @return {int}
		 */
		this.getDaysPrices = function()
		{
			return [this._prices[1],this._prices[4]];
		}
	},
	
	/**
	 * dziedziczy z priceModel
	 * implementacja modelu "ShortTermWeekends6HoursDay"
	 */
	priceModel20 : function(prices, seasons)
	{
		this.superClass = priceModels.priceModel;
		this.superClass(prices, seasons);
		
		/**
		 * zwraca cene najmu dla podanego przedzialu
		 * @param {object} dateStart
		 * @param {object} dateEnd
		 * @return {int}
		 */
		this.getPrice = function(dateStart, dateEnd)
		{
			var hours = this.getInterval(dateStart, dateEnd, 'HOUR');
			var dateTemp = new Date(dateStart.getTime());
			var totalPrice = 0;
			for(var i=0; i<hours; i++){
				if(dateTemp.getDay()==0 || dateTemp.getDay()>=5){
					if(hours<24){
						totalPrice += (this._prices[1]);
					} else {
						totalPrice += (this._prices[3]/24);
					}
				} else {
					if(hours<24){
						totalPrice += (this._prices[0]);
					} else {
						totalPrice += (this._prices[2]/24);
					}
				}
				dateTemp.setTime(dateTemp.getTime()+3600000);
			}
			return totalPrice;
		}
		
		/**
		 * zwraca w tablicy wszystkie możliwe ceny za jeden dzien (do zdefiniowania kolorow na kalendarzu)
		 * @param {object} date
		 * @return {int}
		 */
		this.getDaysPrices = function()
		{
			return [this._prices[2],this._prices[3]];
		}
	},
	
	/**
	 * dziedziczy z priceModel
	 * implementacja modelu "LongTerm3DaysWeek"
	 */
	priceModel21 : function(prices, seasons)
	{
		this.superClass = priceModels.priceModel;
		this.superClass(prices, seasons);
		
		/**
		 * zwraca cene najmu dla podanego przedzialu
		 * @param {object} dateStart
		 * @param {object} dateEnd
		 * @return {int}
		 */
		this.getPrice = function(dateStart, dateEnd)
		{
			var days = this.getInterval(dateStart, dateEnd);
			if(days<7) {
				return days*this._prices[0];
			} else if(days<30){
				return days*this._prices[1];
			} else if(days<30*6){
				return (days/30)*this._prices[2];
			} else{
				return (days/30)*this._prices[3];
			}
		}
		
		/**
		 * zwraca w tablicy wszystkie możliwe ceny za jeden dzien (do zdefiniowania kolorow na kalendarzu)
		 * @param {object} date
		 * @return {int}
		 */
		this.getDaysPrices = function()
		{
			return [this._prices[0]];
		}
	},
	
	/**
	 * dziedziczy z priceModel
	 * implementacja modelu "LongTermMonth6Months"
	 */
	priceModel22 : function(prices, seasons)
	{
		this.superClass = priceModels.priceModel;
		this.superClass(prices, seasons);
		
		/**
		 * zwraca cene najmu dla podanego przedzialu
		 * @param {object} dateStart
		 * @param {object} dateEnd
		 * @return {int}
		 */
		this.getPrice = function(dateStart, dateEnd)
		{
			var days = this.getInterval(dateStart, dateEnd);
			if(days<30*6) {
				return (days/30)*this._prices[0];
			} else if(days<30*12){
				return (days/30)*this._prices[1];
			} else {
				return (days/30)*this._prices[2];
			}
		}
		
		/**
		 * zwraca w tablicy wszystkie możliwe ceny za jeden dzien (do zdefiniowania kolorow na kalendarzu)
		 * @param {object} date
		 * @return {int}
		 */
		this.getDaysPrices = function()
		{
			return [this._prices[0]/30];
		}
	},
	
	/**
	 * dziedziczy z priceModel
	 * implementacja modelu "LongTerm12Months"
	 */
	priceModel23 : function(prices, seasons)
	{
		this.superClass = priceModels.priceModel;
		this.superClass(prices, seasons);
		
		/**
		 * zwraca cene najmu dla podanego przedzialu
		 * @param {object} dateStart
		 * @param {object} dateEnd
		 * @return {int}
		 */
		this.getPrice = function(dateStart, dateEnd)
		{
			var days = this.getInterval(dateStart, dateEnd);
			if(days<365*2) {
				return (days/30)*this._prices[0];
			} else if(days<365*3){
				return (days/30)*this._prices[1];
			} else if(days<365*4){
				return (days/30)*this._prices[2];
			} else {
				return (days/30)*this._prices[4];
			}
		}
		
		/**
		 * zwraca w tablicy wszystkie możliwe ceny za jeden dzien (do zdefiniowania kolorow na kalendarzu)
		 * @param {object} date
		 * @return {int}
		 */
		this.getDaysPrices = function()
		{
			return [this._prices[0]/30];
		}
	},
	
	/**
	 * dziedziczy z priceModel
	 * implementacja modelu "LongTermDay2Days"
	 */
	priceModel24 : function(prices, seasons)
	{
		this.superClass = priceModels.priceModel;
		this.superClass(prices, seasons);
		
		/**
		 * zwraca cene najmu dla podanego przedzialu
		 * @param {object} dateStart
		 * @param {object} dateEnd
		 * @return {int}
		 */
		this.getPrice = function(dateStart, dateEnd)
		{
			var days = this.getInterval(dateStart, dateEnd);
			if(days<7){
				var dateTemp = new Date(dateStart.getTime());
				var totalPrice = 0;
				for(var i=0; i<days; i++){
					if(dateTemp.getDay()==0 || dateTemp.getDay()>=5){
						totalPrice += this._prices[2];
					} else if(days==1) {
						totalPrice += this._prices[0]
					} else {
						totalPrice += this._prices[1]
					}
					dateTemp.setTime(dateTemp.getTime()+86400000);
				}
				return totalPrice;
			} else if(days<14) {
				return days*this._prices[3];
			} else {
				return days*this._prices[4];
			}
		}
		
		/**
		 * zwraca w tablicy wszystkie możliwe ceny za jeden dzien (do zdefiniowania kolorow na kalendarzu)
		 * @param {object} date
		 * @return {int}
		 */
		this.getDaysPrices = function()
		{
			return [this._prices[0], this._prices[2]];
		}
	},
	
	/**
	 * dziedziczy z priceModel
	 * implementacja modelu "LongTermWeekNextWeek"
	 */
	priceModel25 : function(prices, seasons)
	{
		this.superClass = priceModels.priceModel;
		this.superClass(prices, seasons);
		
		/**
		 * zwraca cene najmu dla podanego przedzialu
		 * @param {object} dateStart
		 * @param {object} dateEnd
		 * @return {int}
		 */
		this.getPrice = function(dateStart, dateEnd)
		{
			var days = this.getInterval(dateStart, dateEnd);
			var first = (days>7 ? 7 : days );
			var rest = (days>7 ? days-7 : 0 );
			return first*(this._prices[0]/7) + rest*(this._prices[1]/7);
		}
		
		/**
		 * zwraca w tablicy wszystkie możliwe ceny za jeden dzien (do zdefiniowania kolorow na kalendarzu)
		 * @param {object} date
		 * @return {int}
		 */
		this.getDaysPrices = function()
		{
			return [this._prices[0]/7];
		}
	},
	
	/**
	 * dziedziczy z priceModel
	 * implementacja modelu "LongTerm4DaysNextDay"
	 */
	priceModel26 : function(prices, seasons)
	{
		this.superClass = priceModels.priceModel;
		this.superClass(prices, seasons);
		
		/**
		 * zwraca cene najmu dla podanego przedzialu
		 * @param {object} dateStart
		 * @param {object} dateEnd
		 * @return {int}
		 */
		this.getPrice = function(dateStart, dateEnd)
		{
			var days = this.getInterval(dateStart, dateEnd);
			var first = (days>4 ? 4 : days);
			var rest = (days>4 ? days-4 : 0 );
			return first*this._prices[0] + rest*this._prices[1];
		}
		
		/**
		 * zwraca w tablicy wszystkie możliwe ceny za jeden dzien (do zdefiniowania kolorow na kalendarzu)
		 * @param {object} date
		 * @return {int}
		 */
		this.getDaysPrices = function()
		{
			return [this._prices[0]];
		}
	},
	
	/**
	 * dziedziczy z priceModel
	 * implementacja modelu "LongTermDayNextDay"
	 */
	priceModel27 : function(prices, seasons)
	{
		this.superClass = priceModels.priceModel;
		this.superClass(prices, seasons);
		
		/**
		 * zwraca cene najmu dla podanego przedzialu
		 * @param {object} dateStart
		 * @param {object} dateEnd
		 * @return {int}
		 */
		this.getPrice = function(dateStart, dateEnd)
		{
			var days = this.getInterval(dateStart, dateEnd);
			return this._prices[0] + (days-1)*this._prices[1];
		}
		
		/**
		 * zwraca w tablicy wszystkie możliwe ceny za jeden dzien (do zdefiniowania kolorow na kalendarzu)
		 * @param {object} date
		 * @return {int}
		 */
		this.getDaysPrices = function()
		{
			return [this._prices[0]];
		}
	},
	
	/**
	 * dziedziczy z priceModel
	 * implementacja modelu "SeasonalDayNextDay1"
	 */
	priceModel30 : function(prices, seasons)
	{
		this.superClass = priceModels.priceModel;
		this.superClass(prices, seasons);
		
		/**
		 * zwraca cene najmu dla podanego przedzialu
		 * @param {object} dateStart
		 * @param {object} dateEnd
		 * @return {int}
		 */
		this.getPrice = function(dateStart, dateEnd)
		{
			var days = this.getInterval(dateStart, dateEnd);
			var prices;
			var dateTemp = new Date(dateStart.getTime());
			var totalPrice = 0;
			for(var i=0; i<days; i++){
				prices = this.getSeasonsPrices(dateTemp.getMonth(), dateTemp.getDate());
				dateTemp.setTime(dateTemp.getTime()+86400000);
				if(i==0){
					totalPrice += prices[0];
				} else {
					totalPrice += prices[1];
				}
			}
			return totalPrice;
		}
		
		/**
		 * zwraca w tablicy wszystkie możliwe ceny za jeden dzien (do zdefiniowania kolorow na kalendarzu)
		 * @param {object} date
		 * @return {int}
		 */
		this.getDaysPrices = function()
		{
			var prices = new Array();
			for(var i=0; i<this._prices.length; i++){
				prices.push(this._prices[i][0]);
			}
			return prices;
		}
	},
	
	/**
	 * dziedziczy z priceModel30
	 * implementacja modelu "SeasonalDayNextDay3"
	 */
	priceModel31 : function(prices, seasons)
	{
		this.superClass = priceModels.priceModel30;
		this.superClass(prices, seasons);
	},
	
	/**
	 * dziedziczy z priceModel30
	 * implementacja modelu "SeasonalDayNextDay5"
	 */
	priceModel32 : function(prices, seasons)
	{
		this.superClass = priceModels.priceModel30;
		this.superClass(prices, seasons);
	},
	
	/**
	 * dziedziczy z priceModel
	 * implementacja modelu "SeasonalDay1"
	 */
	priceModel33 : function(prices, seasons)
	{
		this.superClass = priceModels.priceModel;
		this.superClass(prices, seasons);
		
		/**
		 * zwraca cene najmu dla podanego przedzialu
		 * @param {object} dateStart
		 * @param {object} dateEnd
		 * @return {int}
		 */
		this.getPrice = function(dateStart, dateEnd)
		{
			var days = this.getInterval(dateStart, dateEnd);
			var prices;
			var dateTemp = new Date(dateStart.getTime());
			var totalPrice = 0;
			for(var i=0; i<days; i++){
				prices = this.getSeasonsPrices(dateTemp.getMonth(), dateTemp.getDate());
				dateTemp.setTime(dateTemp.getTime()+86400000);
				totalPrice += prices[0];
			}
			return totalPrice;
		}
		
		/**
		 * zwraca w tablicy wszystkie możliwe ceny za jeden dzien (do zdefiniowania kolorow na kalendarzu)
		 * @param {object} date
		 * @return {int}
		 */
		this.getDaysPrices = function()
		{
			var prices = new Array();
			for(var i=0; i<this._prices.length; i++){
				prices.push(this._prices[i][0]);
			}
			return prices;
		}
	},
	
	/**
	 * dziedziczy z priceModel33
	 * implementacja modelu "SeasonalDay3"
	 */
	priceModel34 : function(prices, seasons)
	{
		this.superClass = priceModels.priceModel33;
		this.superClass(prices, seasons);
	},
	
	/**
	 * dziedziczy z priceModel33
	 * implementacja modelu "SeasonalDay5"
	 */
	priceModel35 : function(prices, seasons)
	{
		this.superClass = priceModels.priceModel33;
		this.superClass(prices, seasons);
	},
	
	/**
	 * dziedziczy z priceModel
	 * implementacja modelu "SeasonalWeek1"
	 */
	priceModel36 : function(prices, seasons)
	{
		this.superClass = priceModels.priceModel;
		this.superClass(prices, seasons);
		
		/**
		 * zwraca cene najmu dla podanego przedzialu
		 * @param {object} dateStart
		 * @param {object} dateEnd
		 * @return {int}
		 */
		this.getPrice = function(dateStart, dateEnd)
		{
			var days = this.getInterval(dateStart, dateEnd);
			var prices;
			var dateTemp = new Date(dateStart.getTime());
			var totalPrice = 0;
			for(var i=0; i<days; i++){
				prices = this.getSeasonsPrices(dateTemp.getMonth(), dateTemp.getDate());
				dateTemp.setTime(dateTemp.getTime()+86400000);
				totalPrice += (prices[0]/7);
			}
			return totalPrice;
		}
		
		/**
		 * zwraca w tablicy wszystkie możliwe ceny za jeden dzien (do zdefiniowania kolorow na kalendarzu)
		 * @param {object} date
		 * @return {int}
		 */
		this.getDaysPrices = function()
		{
			var prices = new Array();
			for(var i=0; i<this._prices.length; i++){
				prices.push((this._prices[i][0]/7));
			}
			return prices;
		}
	},
	
	/**
	 * dziedziczy z priceModel36
	 * implementacja modelu "SeasonalWeek3"
	 */
	priceModel37 : function(prices, seasons)
	{
		this.superClass = priceModels.priceModel36;
		this.superClass(prices, seasons);
	},
	
	/**
	 * dziedziczy z priceModel36
	 * implementacja modelu "SeasonalWeek5"
	 */
	priceModel38 : function(prices, seasons)
	{
		this.superClass = priceModels.priceModel36;
		this.superClass(prices, seasons);
	},
	
	/**
	 * dziedziczy z priceModel
	 * implementacja modelu "SeasonalHour4Hours1"
	 */
	priceModel39 : function(prices, seasons)
	{
		this.superClass = priceModels.priceModel;
		this.superClass(prices, seasons);
		
		/**
		 * zwraca cene najmu dla podanego przedzialu
		 * @param {object} dateStart
		 * @param {object} dateEnd
		 * @return {int}
		 */
		this.getPrice = function(dateStart, dateEnd)
		{
			var hours = this.getInterval(dateStart, dateEnd, 'HOUR');
			var prices;
			var dateTemp = new Date(dateStart.getTime());
			var totalPrice = 0;
			for(var i=0; i<hours; i++){
				prices = this.getSeasonsPrices(dateTemp.getMonth(), dateTemp.getDate());
				dateTemp.setTime(dateTemp.getTime()+3600000);
				if(hours<4){
					totalPrice += prices[0];
				} else if(hours<24){
					totalPrice += prices[1];
				} else if(hours<24*3){
					totalPrice += (prices[2]/24);
				} else {
					totalPrice += (prices[3]/24);
				}
			}
			return totalPrice;
		}
		
		/**
		 * zwraca w tablicy wszystkie możliwe ceny za jeden dzien (do zdefiniowania kolorow na kalendarzu)
		 * @param {object} date
		 * @return {int}
		 */
		this.getDaysPrices = function()
		{
			var prices = new Array();
			for(var i=0; i<this._prices.length; i++){
				prices.push(parseInt(this._prices[i][2]));
			}
			return prices;
		}
	},
	
	/**
	 * dziedziczy z priceModel39
	 * implementacja modelu "SeasonalHour4Hours3"
	 */
	priceModel40 : function(prices, seasons)
	{
		this.superClass = priceModels.priceModel39;
		this.superClass(prices, seasons);
	},
	
	/**
	 * dziedziczy z priceModel39
	 * implementacja modelu "SeasonalHour4Hours5"
	 */
	priceModel141 : function(prices, seasons)
	{
		this.superClass = priceModels.priceModel39;
		this.superClass(prices, seasons);
	}
};
