/*   
Модуль "MAPS CONTROL", 
Версия: 1.3
Разработчик: Гринько В.Г. (vitalygrinko@gmail.com)
Зависимости: JQuery Lib, Google Maps API, MapInterface module (map.js) некоторые функции из main.js
*/

with (mapCollection = function () {this._constructor();}) {
  /*АТРИБУТЫ*/
  prototype.mapsArray = []; // массив с элементами типа mapInteface
  prototype.mapsIndex = []; // массив с элементами типа mapInteface
  
  /*РЕАЛИЗАЦИЯ МЕТОДОВ*/
  //Конструктор
  prototype._constructor = function() {}
  
  //Добавление очередной карты в массив
  prototype.add = function(objMapInterface) {
    this.mapsIndex[this.mapsArray.length] = objMapInterface.getMapId();
    this.mapsArray[this.mapsArray.length] = objMapInterface;
    return this.mapsArray[this.mapsArray.length-1];
  }


  //Получение элемента по индексу в атрибуте-массиве
  prototype.get = function(index) 
  {
    return this.mapsArray[index];
  }
  
   prototype.mapIdGet = function(index) 
   {
    	for (i = 0; i < this.mapsArray.length; i++)
		{
			if (this.mapsIndex[i] == index)
			{
				return this.mapsArray[i];
			}
		}
  }
  
    prototype.mapNameGet = function(index) 
   {
    	
		return this.mapsIndex[index];
		
  }
  
  
}


//Активируем основной объект
var objMaps = new mapCollection();

