var MapControl = new Class({
	Implements: [Options, Events],
	options: {
		container: false
	},
	
	videoData: [],
	initialized: false,
	mapPoints: [],
	
	initialize: function(options) {
		this.setOptions(options);
	},

	extent: {left: 143000, bottom: 255000, right: 866000, top: 735000},
	
	resolution: 599.7218,
	
	addPoint: function(y, x, name, cats, url) {

	
		if(y >=1 && x >=1){
			this.mapPoints.push(y+"|"+x+"|"+escape(name)+"|"+cats+"|"+url);
		}
	},
	
	smallMap: function(mapEl, y, x) {
		if ((x && y) && (x > 0 && y > 0)) {
			
			var pixel = this.getPixel({lat: y, lon: x});
			

			mapEl.getElement('.marker').setStyles({'top': pixel.y, 'left': pixel.x});
		}
		else {
			mapEl.setStyle('display', 'none');
		}
	},
	
	setPoints: function() {
		if (this.mapPoints.length > 0) {
			(function() {
				ChangeView('map');
				MapInject(this.mapPoints.join(';'));
			}.bindWithEvent(this)).delay(500);
		}
	},
	
	resizePixel: function(px) {
		px.x = px.x * (134 / 1280);
		px.y = px.y * (134 / 1280);
		return px;
	},
	
	getPixel: function(lonlat) {
		var xx = (lonlat.lon - this.extent.left) / this.resolution;
		var yy = (this.extent.top - lonlat.lat) / this.resolution;
	
	
		return this.resizePixel({x: xx, y: yy});
	}

});
