function Lands() {
	this.init();
}

Lands.prototype = {
	whatLand : null,
	whatLandMouse : "none",
	
	allLands : null,
	space : null,
	sky : null,
	land: null,
	grass : null,
	sea : null,
	
	changeLand : false,
	prevLand : null,
	indicatorInterval : null,
	
	scrollStops : null,
	landStops : null,
	landNames : ['space','sky','land','grass','sea'],
	landIndex : null,
	
	map : null,
	fosforo : null,
	
	init : function() {
		//console.log('Lands Initialized');
		this.setLands();
		this.map = new Map(this);
		this.fosforo = new Fosforo();
		
		this.map.setInitLand();
	},
	
	setLands : function() {
		this.allLands = $('.strata');
		
		this.space = $('#space');
		this.sky = $('#sky');
		this.land= $('#land');
		this.grass = $('#grass');
		this.sea = $('#sea');
		
		this.landStops = [];
		
		var landTotalHeight = 0;
		
		for(var i=0; i < 6; i++) {
			this.landStops.push(landTotalHeight);
			landTotalHeight += this.allLands.eq(i).height();
		}
		
		//console.log('this.landStops: ' + this.landStops);
	},
	
	whereAmI : function(windowY) {
		
		for(var i=0; i < this.landNames.length; i++) {
			if(windowY >= this.landStops[i]) {
				this.whatLand = this.landNames[i];
				this.landIndex = i;
			}
		}
		
		if(this.prevLand === this.whatLand) {
			this.changeLand = false;
		} else {
			this.changeLand = true;
		}
		
		if(this.changeLand) {
			//console.log('Change of land! From: ' + this.prevLand + ' To: ' + this.whatLand);
			this.map.setMapLand();
			this.fosforo.changeMe(this.whatLand);
		}
		
		this.prevLand = this.whatLand;
	}
}
